mirror of
https://github.com/nightly-labs/openbot.git
synced 2026-11-22 11:00:34 +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> |
||
|
|
1eea1d0adf |
Install OpenCode 2 as the managed OpenCode CLI (#2605)
* Install OpenCode 2 as the managed OpenCode CLI Pin @opencode/cli 2.1.1 and read its releases. Show a clear message when an OpenCode 1 CLI cannot open a database that OpenCode 2 created. Resume an OpenCode 2 session again when its service is still starting, and treat its "session not found" error as a missing session. Show model groups by name. Let the seed script list models without a background OpenCode service. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Report a stopped OpenCode as a provider error in the resume retry The OpenCode 2 startup retry read the connection outside a typed failure, so a process that stopped during the wait became a defect. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
fcf3a95f50 |
Remove most exactOptionalPropertyTypes type errors (#2496)
* Remove exactOptionalPropertyTypes errors in contracts and team-client Add `| undefined` to optional fields that callers already set to `undefined`: the channel read cursor, the marketplace query fields and the v4 base adapter option. These are type changes only; the wire format does not change. The team client now sends `contentType` only when it has an upload. A transfer ID exists only with an upload, so the request is the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Remove exactOptionalPropertyTypes errors in the account service Add `| undefined` to optional inputs that the routes already set to `undefined`: skill marketplace queries, host registration and Mobile Connect tickets, and the article figure props. The R2 list and the footer route link now leave out a missing cursor or hash. Both APIs read a missing value and `undefined` the same way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Remove exactOptionalPropertyTypes errors in scripts Add `| undefined` to optional options that the scripts already set to `undefined`. The renderer dev server port is now left out of the Vite config when it is not set; Vite skips an undefined value the same way. `ConversationMessage` fields now include `undefined`, as `isConversationMessage` already accepts. The seed scripts and the backend build messages with `undefined` fields. Two renderer helpers that read these messages accept the same fields. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Remove exactOptionalPropertyTypes errors in the backend Optional fields that the backend sets to undefined now say so in their type. The MCP server bridge leaves out missing options instead of passing undefined, and update_profile forwards only the profile fields that the agent sent. Two errors stay: the MCP SDK transport classes declare onclose and sessionId as accessors that can return undefined, and its Transport interface does not allow it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Remove exactOptionalPropertyTypes errors in the main process Widen optional fields that receive undefined, and use conditional spreads for DOM, Electron and fetch option objects. The Team protocol options are coerced with `=== true`; the adapters read them only by truthiness. The ICE server schema drops absent credentials so parsed servers match `IceServer`. Two MCP SDK transport errors stay in github-mcp-proxy.ts: the SDK typings are not compatible with the flag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Remove exactOptionalPropertyTypes errors in shared UI Widen optional props that callers set to undefined. Pass external props that can be undefined through conditional spreads, or with the default that the library uses. Add selectValue for a Select option that can be missing. Keep the Switch input id error: an explicit undefined removes the Kobalte generated id today. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Remove exactOptionalPropertyTypes errors in the renderer Add `| undefined` to optional props and fields that callers already set to `undefined`: the shared agent and message models, renderer state, and helper parameters. In contracts and team-client, this applies to `AgentModelChoice.providerAccountId`, the direct conversation `readState`, the host analytics `agentId`, the remote request `upload` and `timeoutMs`, and the parameters of the agent policy and chat visual helpers. These are type changes only; the wire format does not change. Portal mounts use `?? document.body`, which is the Solid default. The skill switch and the story select pass `false` in place of `undefined`. The preview search mock omits absent filters. Stories share named render functions and decorators. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Fix Settings and model picker after the shared UI type changes A conditional JSX spread on a Kobalte component stops it from rendering in Solid 2.0.0-rc.0. Settings showed an empty page and the model picker with an effort select did not open. Pass disabled and step as plain props with the Kobalte defaults. Restore the plain value prop of the effort and display selects, and keep their two exactOptionalPropertyTypes errors in the baseline: no form that the checker accepts keeps an undefined value uncontrolled. Remove selectValue. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Use plain Link props for the footer hash A conditional JSX spread can stop a Solid 2.0 component from rendering. The footer link now uses a plain `hash` prop when the link has a hash, and no `hash` prop when it has none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Let linkFavicons take undefined `MarkdownMessageText` passes `props.linkFavicons` through, and the value can be undefined. The prop type now says so, as the other optional props of the branch do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
c163f616d3 |
Install the OpenCode CLI from npm only and name failed requests (#1642)
* Install the OpenCode CLI from npm only and name failed requests (#1632) - Get the OpenCode LICENSE from the opencode-ai npm tarball, not from GitHub. The SHA-256 is the same as the lock value. The pin script hashes the same file. - When a runtime request gets no answer, show the URL and the network reason, not only "fetch failed". - When a complete download passes its digest check, a Retry installs it and does not download it again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Offer an OpenCode release only when its opencode-ai package exists - The release check reads opencode-ai/latest and gets the platform package at that version. Staging needs the LICENSE from that package. - Get the small LICENSE tarball before the platform tarball is unpacked, so a failed request stops early. - The pin script checks the name and version of the opencode-ai package. - PRIVACY.md and docs/RELEASING.md name npm as the LICENSE source. 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> |
||
|
|
59542e1ae6 |
feat: download OpenCode, run its free models without an account (#405)
* feat: download OpenCode, run its free models without an account OpenCode was the only provider OpenBot did not manage: Install opened opencode.ai/docs and left the user to install a CLI by hand, and every provider row told them to run `opencode auth login`. - Pin and download the OpenCode CLI like the other three providers, with sha256 and byte sizes in native-runtime.lock.json plus a `pin:opencode-runtime` refresh script. The Install button is gone. - Run the free models with no account and no sign-in. `opencode acp` initializes, lists 7 free OpenCode Zen models and completes a turn with zero credentials, so `#signedIn` is derived from the models `session/new` returns rather than from a credential. - Add an optional OpenCode Zen key, encrypted by safeStorage in a 0o600 envelope under userData. Only a boolean crosses IPC; no getter returns the key, and it is excluded from every export, log, and diagnostics report. `AcpProviderOptions.extraEnv` is read at each spawn so a key saved in Settings reaches the next process. - Keep an OpenCode CLI the user installed themselves, with an update offer and never a forced download. - Leave the `opencode-go/` models out of the picker while OpenBot is the one supplying the key. OpenCode reports Zen and Go as one catalog on two endpoints, and a Zen key does not buy Go, so those models answered every prompt with "Invalid API key.". Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * fix: default a new OpenCode agent to a free model OpenCode reports the third-party services the user signed in to before its own, and a provider with no `defaultProviderModel` runs the first model of its catalog. So a new agent picked `openai/gpt-5.3-codex-spark` and its first message failed with "Token refresh failed: 401" while the free models sat further down the list, behind no account at all. `opencodeModelRank` orders the catalog in four tiers: free with Muse first, the rest of the free tier, OpenCode's own paid models, then anything behind a separate sign-in whose token OpenBot can neither see nor refresh. The sort is stable, so the CLI's own order survives inside one tier. Free is a display name ending in "Free": `model/list` carries no price and neither Zen endpoint authenticates, so the name is the only signal. That was already how the picker badge worked, so `isFreeOpencodeModelName` now holds it once and both callers share it -- a badge and a default cannot disagree about what costs money. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * fix: keep the OpenCode key consistent with the process that uses it - Startup survives an unreadable key file. The store reports it as `unreadable`, OpenCode runs keyless, Settings says so, and the file stays until the user saves or removes a key. - The store writes a change to disk before it changes memory, so a failed write changes neither and a retry runs again. - A key change runs inside the provider's serialized connection command. It refuses a busy provider before it writes, holds deliveries while it writes, and reports success only after a new process runs with the new key. - `ProviderApiKeyState` carries a status instead of a boolean. - Add `opencode` to the preload runtime-snapshot test fixture. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * fix: start a managed Windows CLI without a shell A managed CLI lives under userData, which holds a space for a user such as C:\Users\Jane Doe and for the OpenBot Dev profile. AcpAgentClient spawned it with shell: true on Windows, so cmd.exe split the unquoted path and the downloaded OpenCode or Grok CLI never connected. cliSpawnTarget now starts a native executable with no shell, and runs a .cmd or .bat shim through cmd.exe with the verbatim quoting readCliVersion uses. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |