mirror of
https://github.com/nightly-labs/openbot.git
synced 2026-11-23 02:01:26 +08:00
main
8
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
03c2ff34c2 |
Remove code comments and add the no-comments rule (#12604)
* Remove code comments and add the no-comments rule Remove the comments from first-party code and configuration files: TS/JS, JSX, CSS, SQL migrations, Swift, Kotlin, Gradle, shell, Docker, systemd, Nix, YAML, TOML, JSONC and GritQL. Keep only what a tool reads: license headers, shebangs, compiler and lint directives, JSDoc types in plain .js files, generated file headers, GritQL scope lines, the install-server.sh help text and the openbot-boat-pre-stop marker. Vendored code, fixtures and released schemas keep their comments. Add the rule to AGENTS.md, and change the docs that asked for comments. Add two i18n keys that only comments named to RELEASED_SOURCE_KEYS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Keep comments that are data in strings The benchmark task files in opencode-free-models-bench.ts tell the model what each function must do. The sample file and HTML page in the two stories are display content. Put their comments back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Keep released migrations and mobile native inputs unchanged check:migrations compares each released migration with v0.73.0 byte for byte, so restore src/backend/migrations. A change to a native build input of apps/mobile makes a new runtime version, so restore those files and the extra fingerprint sources. List these files and the comment markers that a tool reads in AGENTS.md. Remove the last requests for comments in src/renderer/AGENTS.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
5a0d304c5f |
Retry network failures in the macOS release (#2252)
* Retry network failures in the macOS release Apple's ticket service and GitHub downloads sometimes drop the connection on the hosted macOS runners. Releases v0.38.1 to v0.40.0 then needed 2 to 4 attempts. - Build step: also retry when stapler or a download loses the connection. - Signature check and Host installer: give stapler five attempts. - Runtime downloads: retry a network error, HTTP 429 or 5xx two times. The SHA-256 checks after the download do not change. Refs #2249 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Use the retrying download for all runtime installers The Claude, Codex and cua-driver installers fetched their files inline, so a dropped connection still stopped the release. They now use the shared download(). The checksum checks do not change. Also cancel the body of a failed response before the next attempt, and retry the macOS build only on the network errors that releases showed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
e26b637ad0 |
Move shared runtime installer helpers to one module (#1458)
* Move shared runtime installer helpers to scripts/runtime-install.ts The Claude, Codex, Grok, cua-driver and remote desktop installers had copies of the same helpers. Put one copy of each in scripts/runtime-install.ts: - installValidatedTree (the remote desktop installer calls it for the platform/architecture directory) - isCurrentInstallation, which now takes the verify function - download (Grok and remote desktop) - safeArchivePathParts, the common safety part of validateArchivePath - escapeRegExp Error messages, user agents and install paths do not change. The remote desktop download now sets redirect: "follow" explicitly; that is the fetch default, so the result is the same. The cua-driver and pin-cua-driver downloads keep their own copies, because their error messages (and the pin user agent) are different. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Keep remote-desktop-runtime-release.ts unchanged The remote desktop workflow requires a recipeVersion increase when this file changes. That increase changes the input digest and starts a new native build and release. A refactor must not do that, so this file keeps its own validateArchivePath. Also run the cua-driver workflow when scripts/runtime-install.ts changes, because install-cua-driver.ts now imports it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
1bcd679adb |
Add an Intel (x64) macOS build (#1087)
* Add an Intel (x64) macOS build Fixes #1070. - Build ARM64 on macos-14 and x64 on macos-15-intel in release.yml. The Host PKG stays ARM64 only. - Merge the two latest-mac.yml files in the publish job, so each Mac gets the update for its architecture. The ARM64 path and sha512 stay the default. - Add darwin-x64 to the provider runtimes, cua-driver and the remote desktop runtime. - Increase the remote desktop recipeVersion to 13 and remove the old pin. The branch must pin the new runtime release before merge. - Remove the arch list from the mac targets in electron-builder.yml, so --x64 builds x64. - Send /download/macos?arch=x64 to the Intel DMG. * Link the compiler runtime into the Intel Moonlight streamer rustc links with -nodefaultlibs, so libclang_rt.osx.a is not on the link line. On x86_64, moonlight-common-c calls __builtin_cpu_supports, and the streamer link fails with an undefined ___cpu_model. * Pin the remote desktop runtime with the Intel macOS build Pin remote-desktop-runtime-29cff66db32af6debc1ff179dd754e953c6fb750b5155e17015cd7e54e66eb78 from workflow run 36442402655. It has darwin-arm64, darwin-x64 and win32-x64 artifacts. * Keep the release token in the publish step and build Whisper for macOS 13 - Set GH_TOKEN only on the step that publishes the release. The earlier steps now run dependency code. - Build whisper-cli with a macOS 13.0 deployment target. Without it, clang uses the runner's macOS version. - Tell users to install the runtime on any Mac, not only Apple silicon. - List all provider targets in docs/ARCHITECTURE.md. |
||
|
|
7f85a67111 |
Add Linux arm64 builds and managed runtimes (#746)
Add the linux-arm64 target to the runtime lock, the pin and install scripts, and the provider runtime manager. Build an arm64 AppImage on a native arm64 runner in the release workflow, with its own updater manifest, checksums, SBOM and attestation. Refs #689 |
||
|
|
8beb0a9866 |
feat: ship a Linux x64 AppImage (#459)
* feat: ship a Linux x64 AppImage OpenBot shipped macOS and Windows only. This adds the third target as an AppImage, the one Linux format electron-updater can update in place. - Pin `linux-x64` artifacts for codex, claude, opencode, and grok, so the in-app provider download works as it does on macOS. - Discover a CLI through `$SHELL` on Linux instead of `/bin/zsh`, which most distributions do not install, and look in `/usr/bin` as well. - Register the `openbot://` scheme on Linux, and update in place only when `APPIMAGE` says the app runs from an AppImage. - Report voice transcription as unavailable when the build carries no whisper binary, rather than failing at transcribe time. The composer offers no microphone on Linux. - Move the whisper and remote-desktop resources out of the shared `extraResources` list, because neither is built for Linux. - Ship an AppArmor profile for the Ubuntu 23.10 and Debian 13 user-namespace restriction. `--no-sandbox` stays out of the product and the documentation. - Add the release job, the package verifier, the download route, and the install and troubleshooting sections. Remote desktop stays unavailable on Linux, and the AppImage is unsigned, as the Windows installer is. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * fix(linux): install a desktop entry and keep the sandbox on in CI The protocol registration on Linux goes through `xdg-settings`, which can only name a desktop entry that already exists. An AppImage has none, so the first start now writes `~/.local/share/applications/openbot.desktop` with an `Exec` that points at the running AppImage and accepts `%U`, and a failed registration is logged instead of ignored. Ubuntu 24.04 restricts unprivileged user namespaces through AppArmor, so the release job loads a narrow profile for the verification executable and gives the SUID helper the ownership a package manager would give it. `--no-sandbox` stays out of the tree: the launch check must prove what a real install does. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * fix(linux): keep the launcher icon after the AppImage unmounts An AppImage mounts its resources in a temporary directory the runtime removes on exit, so a desktop entry that names the packaged icon loses it as soon as OpenBot is not running. The first start now copies the icon to `<data home>/icons` and names the copy. A copy that fails still leaves the entry, because the entry is what registers the invitation scheme. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
799de8791a |
feat(dev): AI automation bridge over CDP plus ts-log logging package (#220)
* feat(dev): AI automation bridge over CDP plus ts-log logging package
- packages/logging: ts-log Logger with secret redaction, covered by tests
- scripts/dev-automation: snapshot/screenshot/click/type against the running dev app
- migrate console.* in main/backend/scripts to the redacting logger
* fix(dev-automation): drive the main window, not helper popups
CDP lists Dynamic Island surfaces in arbitrary order; prefer the bare
app URL so snapshot/screenshot/act always target the main window.
* docs(agents): point e2e smoke checks at dev:automation
* fix(review): bundle logging, stderr JSON, UA guard, cycle-safe logs, injectable test loggers
- main build bundles @openbot/logging like contracts (packaged startup)
- dev-automation CLI logs to stderr, stdout keeps pure JSON
- CDP refuses non-OpenBot targets; main-window pick covered by tests
- logging handles bigint/circular values without throwing
- team-api-server and dynamic-island accept an optional logger;
console spies replaced with injected or observed loggers
* fix(review): recipe bump, catalog literals, explicit port for mutations
- bump remoteDesktop.recipeVersion for the touched runtime scripts
- ts-log/playwright-core as literals: single-workspace deps per catalog rule
- click/type refuse a defaulted port; name the instance with --port=
* fix(review): redact serialized payloads, gate log levels, enforce noConsole
- redaction covers a payload that arrives as one string: quoted values are
consumed whole, `{"apiKey":"…"}` and `set-cookie:` shapes match, and a
scheme-prefixed `Authorization: Basic …` no longer leaks its base64
- redaction is idempotent, so a value passed through `toLogValue` and then
formatted no longer grows a stray `]`
- error message and stack are redacted at conversion, not only at format time
- logger honours a level threshold (`info` by default, `OPENBOT_LOG_LEVEL`
lowers it); dev-automation asks for `debug` to keep renderer console output
- Biome `noConsole` enabled for src, scripts and packages so the migration
cannot regress
- dev-automation: mutation gate extracted and tested, `ForeignBrowserError`
sentinel instead of message matching, one role list with the type derived
from Playwright, unused `waitForRole` dropped, `--text=` can clear a field
- remote-debugging port validated through `readDevelopmentRemoteDebuggingPort`
so main and automation agree on the range
- docs: restore rule 7 indentation, document the level and the lint rule
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix(dev): tighten automation target selection and screenshot paths
Addresses the review findings on the CDP bridge and unbreaks CI.
- Diagnostics no longer print page titles or full URLs. `describeTarget`
reduces a target to origin + path for loopback pages and to
`scheme//host (external)` for anything else, so a visited page's query
string never reaches the log.
- `pickMainPage` could latch onto an embedded browser page. `isMainAppUrl`
now requires a loopback http(s) origin, no `surface` query and the bare
app route, and `findMainPages` refuses to guess when two candidates
match.
- `screenshot --out` accepted any path with no mutation flag.
`resolveScreenshotPath` keeps the destination inside the build directory
and requires a `.png` name.
- Revert the cosmetic logging edits to the three recipe-guarded runtime
scripts and `recipeVersion` back to 8: the bump guard fired on them,
and a bumped recipe with a stale `artifactRelease.inputDigest` fails
`parseNativeRuntimeLock` and 10 tests. Those files are exempted from
`noConsole` via an enabling override instead.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* feat(dev): make automation pick the right dev instance per worktree
Several worktrees run `bun run dev` on one machine, and only the first
gets 9333: `dev-services` walks the port upwards, so the second instance
answered on a port nobody wrote down and `dev:automation` drove the
wrong app.
- Each dev app and test client now publishes its worktree, profile,
renderer port, debugging port and pid to a registry in the per-user
temporary directory, and removes the record on shutdown. Reading prunes
records whose process is gone, so a killed instance never keeps
offering a port another one has taken.
- `dev:automation instances` lists what is live. Resolution prefers the
record of the worktree the command runs in, refuses to guess between
two, and accepts `--instance=<id>`, `--port=` or `--service=`.
- The mutation gate now asks whether the instance was *named* rather than
whether a port was typed. Another worktree's app stays readable and
is never clickable.
- Two review findings on target selection: the snapshot document carried
a raw `page.url()`, which on the app route can hold an OAuth code, so
it goes through the extracted `describeTarget`; and a visited local
site in an embedded browser view wore the same loopback origin and
bare path as the app, so a page is only driven when it carries the
`window.openbot` preload bridge and, when the registry named one, the
expected renderer port.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* feat(dev): let automation drive any dev window on purpose
The main-window restriction was a safe default that had turned into a
limit. Dev is where every flow has to be testable, embedded browser
views and Dynamic Island surfaces included.
- `dev:automation pages` lists every CDP target with an index and a
sanitized description.
- `--page=<index|url-substring>` drives any of them, overriding both the
bare-route filter and the preload-bridge probe. An empty selector is
refused rather than matching everything.
- Aiming at nothing still resolves the app window, and an ambiguous
selector prints the target list instead of guessing.
The guards that stay are the ones about hitting the wrong process, not
the wrong page: `--allow-mutations` and an instance that was named
rather than inferred.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix(logging): bound the redaction patterns and redact snapshot text
Four review findings, and one the third one uncovered.
- `sk-` and friends matched inside ordinary words, so `risk-register`
logged as `ri[redacted]` and erased the part naming what failed. The
provider prefixes now need a token boundary.
- A quoted JSON `"key"` is redacted in the text fallback too, for a
payload too malformed to reparse structurally.
- The 100 KB reparse cap is gone: a long body is exactly where a secret
hides, and truncation keeps the first characters, which were the
unredacted ones.
- Removing that cap surfaced why it was there. `SECRET_LABEL` and `EMAIL`
both had unbounded affix runs, so every position in a long payload
consumed the rest of it and backtracked: 200 KB took 9.6s. Bounded, the
same payload takes 150ms and 2 MB takes 1.4s.
- The snapshot document carried the page title and the accessibility tree
verbatim, so a screen showing an API token exported it on stdout. Both
go through `redactText` before truncation, so a secret cannot survive
in the part that is kept.
- The registry record is written to a sibling and renamed into place. A
plain write truncates first, and a reader hitting that window deleted
the file as corrupt, leaving a freshly started instance undiscoverable.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix(logging): stop treating prose as a credential assignment and bound conversion depth
- CREDENTIAL_ASSIGNMENT required an explicit = or : separator; bare whitespace
turned `SKILLS_ADMIN_TOKEN is missing` into `SKILLS_ADMIN_TOKEN [redacted] missing`.
- convertValue now stops at depth 32, so a deeply nested external payload cannot
overflow the stack and replace the failure the caller was reporting.
- dev:automation instances redacts profile and projectRoot on its stdout JSON,
the one registry field that did not pass through the logger.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* feat(dev-automation): add --wait-for, warn on cross-worktree ports, tighten redaction
- --wait-for=<role>,<name> settles on an accessible target before a capture and
after a click or a keystroke, so a flow no longer needs a snapshot loop.
- An explicit --port= stays authoritative, but says whose worktree it resolved
to when that is not this one; a mistyped digit was silent before.
- Registry directory 0700 and records 0600, created exclusively so a planted
staging path cannot redirect the write.
- Basic/Digest/Token only redact inside an Authorization context, so
'Token validation failed' survives; Bearer still matches anywhere.
- Error names, object keys and the String() fallback pass through redactText;
conversion is exception-safe and emits [unserializable] instead of throwing
from inside the logger.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix(dev-automation): contain screenshots against symlinks and fail closed on an unsafe registry
- resolveScreenshotPath refuses a symlink anywhere between the build root and
the destination; the containment check was lexical and page.screenshot
follows links, so a read-only command could write outside the directory.
- The screenshot response reports a workspace-relative path, dropping the home
directory prefix, and refuses a name whose redacted form differs rather than
returning one the caller cannot reopen.
- Publishing a dev instance verifies the registry directory is owned by this
user and unreachable by other accounts, instead of swallowing a failed chmod.
A registry someone else can write lets them choose which CDP port a mutation
command trusts.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix(dev-automation): validate the registry directory on read as well as on write
Only the writer failed closed on a directory other accounts can reach, so a
reader that never publishes trusted whatever it found there. A planted record
naming this worktree, a live pid and an attacker's CDP endpoint would have been
classified as the local instance a mutation may drive.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix(dev-automation): hide non-app loopback paths and aim by CDP target id
A loopback origin does not make a page the app: an embedded view can serve a
callback on 127.0.0.1 whose path carries the code as a plain segment, which no
redaction rule recognizes. `describeTarget` now prints a path only for the
app's own routes and collapses anything else to its origin.
Aiming moves from an array index to CDP's target id. Each command opens its own
connection, so a window closing in between shifted every later position and
`--page=1` could drive a target nobody printed. Verified against a live dev
instance: a stale id now refuses instead of drifting to another window.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix(dev-automation): redact renderer console before truncating, and verify instance process identity
Two review findings on the dev automation layer.
The renderer console handler sliced the message to 500 characters before
handing it to the logger, which redacts and only then truncates at 2000. A
cut could hand the log a prefix of a token short enough that no redaction
rule recognizes its shape - so the full text now goes to the logger.
`process.kill(pid, 0)` proves only that something holds that pid. A dev
instance killed with SIGKILL leaves its record behind, and a recycled pid
made that record - with its debugging port - look like this worktree's live
app, which is the one match `click` and `type` accept. Liveness now also
compares the process start time from `ps -o lstart=` against the record's
`startedAt`, and two live records claiming one debugging port keep only the
newest, which is what still fails closed where `ps` is unavailable.
Watched both new guards fail: removing the start-time comparison reds
"rejects a pid that was recycled after the record was published", and
returning the records unfiltered reds the port-collision test.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix(dev-automation): keep a one-time code out of the snapshot document
`ariaSnapshot` prints what a control holds, and `redactText` cannot recognize
a login code: it is a handful of characters with no label and no secret shape.
The snapshot goes to stdout and lands in an agent transcript, so a code typed
by `type` without `--submit` left the machine.
`redactSensitiveSnapshotValues` now blanks what was entered into any node
whose accessible name reads as a one-time code, password, token or
credential - the inline value, and the unnamed text anywhere in its subtree.
Named nodes inside that subtree survive, because a developer still has to see
the control to aim `type` at it.
The subtree half is the part that matters for `OtpInput`: it clears the native
input on every keystroke and rebuilds the code as visible characters, so the
code never is the textbox value - it is loose text under the fieldset. That
fieldset was unnamed, leaving nothing for either consumer to recognize, so it
now carries `aria-label="One-time code entry"`: assistive tech announces the
context those characters belong to, and the redactor knows the subtree.
Watched all three guards fail: neutering the sensitive-name pattern reds both
snapshot tests, dropping the subtree rule reds the loose-character one, and
removing the fieldset name reds the OtpInput contract. Verified against the
live dev app that an ordinary textbox value still prints.
Surfaces touched: desktop renderer (OtpInput), dev automation scripts.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
|
||
|
|
2e0ca2561c |
Bundle provider CLIs and harden onboarding (#35)
* feat: bundle agent providers and improve onboarding * fix: isolate agent runtime lock validation * chore: restart CI * chore: retrigger CI |