From c46a06032eacaa4e95d4d85b3980d0b2dcbb2ec7 Mon Sep 17 00:00:00 2001 From: Jinwoo-H Date: Sun, 8 Nov 2026 21:14:08 -0500 Subject: [PATCH] feat(cli): name the Orca that owns a workspace 'server' orca server ... replaces orca environment ... and orca host name; --server and --parent-server replace --environment and --parent-environment. Old spellings stay accepted as input only: help, suggestions, errors and printed commands use the new names, and giving both spellings different values is invalid_argument. --host is still parsed but leaves help; orca host list/rm are hidden. Listings name each row's owning server (server: / server=) from data already returned, mapping a stored owner to a saved-server name only from this computer's own store, and print server=unknown instead of guessing local. The ports footer and search hits drop host=. CLI-built JSON uses server keys (server, address.server, parent.server, unknown-server, servers, knownServers, status target kind server). create/set print the same parent line as ps. --- docs/reference/plugin-authoring.md | 4 +- docs/site/content/docs/cli/automations.mdx | 6 +- docs/site/content/docs/cli/orchestration.mdx | 2 +- docs/site/content/docs/cli/reference.mdx | 40 ++--- docs/site/content/docs/ssh.mdx | 2 +- skill-guides/linear-tickets.md | 2 +- skill-guides/orca-cli.md | 33 ++-- skill-guides/orca-cli/references/plugins.md | 12 +- skill-guides/orca-emulator-android.md | 2 +- skill-guides/orca-emulator.md | 2 +- skill-guides/orca-jira.md | 2 +- skill-guides/orca-linear.md | 2 +- skill-guides/orca-plugin-authoring.md | 2 +- .../orca-plugin-authoring/references/cli.md | 6 +- .../references/workflow.md | 2 +- skill-guides/orchestration.md | 2 +- .../references/placement-and-remote.md | 4 +- src/cli/agent-context.ts | 3 +- src/cli/agent-launch-recovery.ts | 6 +- src/cli/agent-launch-request.ts | 10 +- src/cli/agent-session-search-format.test.ts | 9 +- src/cli/agent-session-search-format.ts | 18 +-- src/cli/args.test.ts | 8 +- src/cli/args.ts | 86 +++++++++- src/cli/automation-destination.ts | 2 +- src/cli/automation-format.ts | 52 +++--- src/cli/automation-owner-conflict-recovery.ts | 12 +- src/cli/browser/browser-command-target.ts | 2 +- src/cli/browser/browser-identity.ts | 2 +- src/cli/bundled-skill-guides.ts | 71 ++++---- src/cli/caller-host-worktree-selection.ts | 2 +- src/cli/cli-error.ts | 4 +- src/cli/command-scoped-flag-help.ts | 16 +- src/cli/command-spec.ts | 7 +- ...nd-suggestion-destructive-families.test.ts | 14 +- src/cli/command-suggestion.ts | 29 +++- src/cli/enclosing-workspace-rule.test.ts | 1 - src/cli/execution-host-flag.ts | 76 +++++---- src/cli/flag-help-text.ts | 10 +- src/cli/format.ts | 29 ++-- src/cli/handlers/account-selection.ts | 2 +- src/cli/handlers/account.ts | 2 +- src/cli/handlers/agent-launch.ts | 4 +- src/cli/handlers/automation-host-support.ts | 2 +- src/cli/handlers/automations.ts | 11 +- .../handlers/bundled-skill-install-command.ts | 2 +- src/cli/handlers/chat.ts | 2 +- src/cli/handlers/connector.test.ts | 2 +- src/cli/handlers/connector.ts | 2 +- src/cli/handlers/data-account-commands.ts | 2 +- src/cli/handlers/environment.ts | 80 +++++----- .../handlers/folder-workspace-mutations.ts | 7 +- src/cli/handlers/managed-server-format.ts | 5 +- src/cli/handlers/managed-server-reconnect.ts | 7 +- src/cli/handlers/managed-server.ts | 36 +++-- .../handlers/orchestration/agent-view.test.ts | 2 +- .../orchestration/removed-work-format.ts | 2 +- .../orchestration/worker-agent-views.ts | 19 ++- .../orchestration/worker-launch-handler.ts | 2 +- .../orchestration/worker-terminal-handlers.ts | 10 +- src/cli/handlers/plugin-dev-watch.test.ts | 4 +- src/cli/handlers/plugin-dev-watch.ts | 4 +- src/cli/handlers/plugin-install.ts | 2 +- src/cli/handlers/plugin-runtime.ts | 8 +- src/cli/handlers/plugin-shot-scenario.ts | 2 +- src/cli/handlers/plugin-view.ts | 4 +- src/cli/handlers/ports.ts | 2 +- src/cli/handlers/profile-state.test.ts | 2 +- src/cli/handlers/project.ts | 19 ++- src/cli/handlers/reference.ts | 2 +- src/cli/handlers/skill-sharing.ts | 2 +- src/cli/handlers/terminal-close.ts | 2 +- src/cli/handlers/terminal-send.ts | 8 +- src/cli/handlers/terminal.ts | 13 +- .../handlers/worktree-address-annotation.ts | 51 +++++- .../handlers/worktree-create-agent-launch.ts | 24 +-- src/cli/handlers/worktree-lineage-summary.ts | 46 +++--- .../handlers/worktree-parent-environment.ts | 86 +++++----- src/cli/handlers/worktree-removal-request.ts | 4 +- src/cli/handlers/worktree.ts | 21 ++- src/cli/help.ts | 7 +- src/cli/host-handler-groups.ts | 28 ++-- src/cli/host-selector-alternatives.test.ts | 36 ++--- src/cli/host-selector-alternatives.ts | 31 ++-- src/cli/index-environment-commands.test.ts | 4 +- src/cli/index-environment-local.test.ts | 44 ++++- .../index-worktree-parent-environment.test.ts | 14 +- src/cli/index.ts | 26 +-- src/cli/jira-target.ts | 2 +- src/cli/legacy-server-spellings.test.ts | 70 ++++++++ src/cli/local-environment-selector.ts | 31 ++-- src/cli/omitted-host-scope-selectors.ts | 15 +- src/cli/plugin-authoring/plugin-cli-output.ts | 4 +- .../plugin-dev-watch/plugin-dev-watch-loop.ts | 2 +- .../plugin-dev-watch/plugin-dev-watch-shot.ts | 2 +- src/cli/plugin-handler-groups.ts | 2 +- src/cli/ports-format.ts | 8 +- src/cli/project-format.ts | 8 +- src/cli/reference-input.ts | 2 +- src/cli/remote-selection-flag-rejection.ts | 4 +- src/cli/remote-selection-scope.ts | 10 +- src/cli/root-help-text-primary.ts | 37 ++--- src/cli/root-help-text-secondary.ts | 36 ++--- src/cli/row-owner-server.test.ts | 112 +++++++++++++ src/cli/row-owner-server.ts | 138 ++++++++++++++++ src/cli/runtime/client.ts | 6 +- .../runtime/environment-pairing-exchange.ts | 2 +- src/cli/runtime/environments.ts | 2 +- src/cli/runtime/recipe-vm-wake-gate.ts | 6 +- src/cli/runtime/runtime-access-denied.ts | 2 +- src/cli/runtime/runtime-remote-pairing.ts | 2 +- .../terminal-prompt-mutation-recovery.ts | 9 +- src/cli/runtime/transport.test.ts | 4 +- src/cli/runtime/transport.ts | 10 +- src/cli/selector-ambiguity-recovery.ts | 4 +- src/cli/specs/account.ts | 14 +- src/cli/specs/agent-launch.ts | 4 +- src/cli/specs/automations.ts | 13 +- src/cli/specs/browser-basic.ts | 4 +- src/cli/specs/chat.ts | 2 +- src/cli/specs/core.ts | 8 +- src/cli/specs/environment.ts | 71 ++++---- src/cli/specs/managed-server.ts | 76 +++++---- src/cli/specs/orchestration-worker-specs.ts | 2 +- src/cli/specs/plugin-install.ts | 8 +- src/cli/specs/plugin-view.ts | 6 +- src/cli/specs/plugin.ts | 16 +- src/cli/specs/project.ts | 48 +++--- src/cli/specs/repo.ts | 2 +- src/cli/specs/search.ts | 16 +- src/cli/specs/serve.ts | 4 +- src/cli/specs/skills.ts | 6 +- src/cli/specs/speech.ts | 8 +- src/cli/specs/terminal-daemon.ts | 2 +- src/cli/specs/worktree-create.ts | 17 +- src/cli/specs/worktree-listing-scope-notes.ts | 6 +- src/cli/specs/worktree-set.ts | 6 +- src/cli/terminal-format.ts | 8 +- .../terminal-list-host-scope-format.test.ts | 13 +- src/cli/workspace-address.ts | 151 +++++++++--------- src/cli/workspace-catalog-row.ts | 2 +- src/cli/workspace-format.ts | 82 +++++----- src/cli/worktree-project-target.ts | 70 ++++++-- src/cli/worktree-selector-recovery.ts | 2 +- .../orcad-managed-tunnel-identity.ts | 2 +- .../runtime/rpc/methods/accounts/accounts.ts | 4 +- .../rpc/worktree-rm-cli.integration.test.ts | 2 +- src/main/startup/cli-command-names.ts | 1 + src/main/startup/serve-mode-argv.ts | 1 + .../ipc-events/runtime-client-ipc-bridge.ts | 2 +- .../src/i18n/en-runtime-required.json | 4 +- src/renderer/src/i18n/locales/de.json | 4 +- src/renderer/src/i18n/locales/en.json | 4 +- src/renderer/src/i18n/locales/es.json | 4 +- src/renderer/src/i18n/locales/fr.json | 4 +- src/renderer/src/i18n/locales/ja.json | 4 +- src/renderer/src/i18n/locales/ko.json | 4 +- src/renderer/src/i18n/locales/pt.json | 4 +- src/renderer/src/i18n/locales/ru.json | 4 +- src/renderer/src/i18n/locales/tr.json | 4 +- src/renderer/src/i18n/locales/zh-Hant.json | 4 +- src/renderer/src/i18n/locales/zh.json | 4 +- src/shared/cli-argument-boundary.ts | 7 +- .../runtime-environment-catalog-channel.ts | 2 +- .../remote-server-pairing-failure-copy.ts | 4 +- .../rpc-contract/managed-server-params.ts | 2 +- .../rpc-contract/recipe-vm-wake-params.ts | 2 +- src/shared/runtime-session-contracts.ts | 3 +- src/shared/serve-option-validation.ts | 1 + 169 files changed, 1574 insertions(+), 995 deletions(-) create mode 100644 src/cli/legacy-server-spellings.test.ts create mode 100644 src/cli/row-owner-server.test.ts create mode 100644 src/cli/row-owner-server.ts diff --git a/docs/reference/plugin-authoring.md b/docs/reference/plugin-authoring.md index 586a68c824a..5d1d6a5c42e 100644 --- a/docs/reference/plugin-authoring.md +++ b/docs/reference/plugin-authoring.md @@ -491,7 +491,7 @@ or a development plugin's key when you run it inside that folder; installed plug The result adds `replay: true` and `scenario`, `errors` lists what the render reported, and an unknown name fails and lists the panel's scenarios. A replay is a still frame: controls whose value Orca owns start from the tree's props, images show their placeholder, it takes no `--act`, -it works only on this machine (no `--environment`), and it needs Orca's window hidden or +it works only on this machine (no `--server`), and it needs Orca's window hidden or minimized because the preview is drawn inside it. It writes `.orca/shots/-..png` in the plugin folder unless you pass `--out`. @@ -543,7 +543,7 @@ sidebar it skips the shot and says so once (`shot_skipped`), and resumes when th Both need the Orca desktop app with a workspace showing; `orca serve` has no window and refuses them. A shot never changes the view, so while Orca shows Settings or another full page it fails -with `no_workspace`. With `--environment`, the PNG (at most 5 MiB) comes back to the machine +with `no_workspace`. With `--server`, the PNG (at most 5 MiB) comes back to the machine that ran the command. To keep a folder loaded without a terminal, use Settings instead: diff --git a/docs/site/content/docs/cli/automations.mdx b/docs/site/content/docs/cli/automations.mdx index c69f367121d..ae5b7da79f0 100644 --- a/docs/site/content/docs/cli/automations.mdx +++ b/docs/site/content/docs/cli/automations.mdx @@ -66,14 +66,14 @@ orca automations create \ --prompt "Triage open issues" \ --provider claude \ --project \ - --host \ + --server \ --disabled \ --json ``` -`--project` takes the project id or the display name from `orca project list`. `--host` takes `local`, `ssh:`, `runtime:`, or the bare name from `orca host list`, and it can be omitted entirely when the project is set up on only one host — Orca uses that one. When the project is set up on several, the error names each host and the flag to select it. +`--project` takes the project id or the display name from `orca project list`. `--server` runs the command on that server and uses its own setup of the project; omit it to stay on this computer. When the project has setups for several servers here and no `--server` is given, the error names each setup and the server that owns it. -Use `--project-host-setup ` when you already have a setup id. Optional `--source-context ''` pins task/provider data to a host/account (pass `null` on edit to clear). +Use `--project-host-setup ` when you already have a setup id. Optional `--source-context ''` pins task/provider data to a server/account (pass `null` on edit to clear). ## Manage automations across hosts diff --git a/docs/site/content/docs/cli/orchestration.mdx b/docs/site/content/docs/cli/orchestration.mdx index 3f6551f3753..ccd693b0ac9 100644 --- a/docs/site/content/docs/cli/orchestration.mdx +++ b/docs/site/content/docs/cli/orchestration.mdx @@ -11,7 +11,7 @@ Use it when you need ownership, completion tracking, or a DAG. For one-off promp Enable orchestration under Settings → Experimental before using these commands. The CLI talks to - the running Orca runtime, so `orca status --json` should succeed first. + the running Orca server, so `orca status --json` should succeed first. diff --git a/docs/site/content/docs/cli/reference.mdx b/docs/site/content/docs/cli/reference.mdx index 12cfa96f2b0..11d9186e9ee 100644 --- a/docs/site/content/docs/cli/reference.mdx +++ b/docs/site/content/docs/cli/reference.mdx @@ -5,7 +5,7 @@ description: Commands, selectors, and agent-friendly patterns for driving Orca f import { Callout } from '@/components/docs/prose' -The `orca` CLI talks to a running Orca runtime. Use it when a shell script or agent needs to inspect worktrees, launch terminals, open files, automate the built-in browser, or report progress back into Orca. +The `orca` CLI talks to a running Orca server. Use it when a shell script or agent needs to inspect worktrees, launch terminals, open files, automate the built-in browser, or report progress back into Orca. ## Verify the runtime @@ -53,27 +53,19 @@ orca worktree show --worktree branch:feature-name --json orca worktree show --worktree issue:123 --json ``` -`active` and `current` resolve to the enclosing Orca-managed worktree from the shell's current directory or terminal context. Use explicit selectors in scripts that may run outside the target worktree. For remote runtimes, prefer full server-side selectors such as `id:::` or `path:` because the local shell's current directory may not exist on the runtime host. +`active` and `current` resolve to the enclosing Orca-managed worktree from the shell's current directory or terminal context. Use explicit selectors in scripts that may run outside the target worktree. With `--server`, prefer full server-side selectors such as `id:::` or `path:` because the local shell's current directory may not exist on that server. -## Choose a host +## Choose a server -List every machine the current Orca host can target and the selector for each one: +Every command runs on one Orca server. Without a flag it is `local`, the Orca on this computer. Pass `--server ` to run on a saved [Remote Orca Server](/docs/remote-servers), or `--server local` to stay on this computer even when `ORCA_ENVIRONMENT` sets a default. List the saved servers and the selector for each one: ```bash -orca host list --json +orca server list --json ``` -The result includes this machine, its registered [SSH targets](/docs/ssh), and paired [Remote Orca Servers](/docs/remote-servers). Use `--host local` for this machine, `--host ssh:` for an SSH target, and `--environment ` for a paired server. SSH rows include the detected remote platform (`linux`, `darwin`, or `win32`) after the target connects; older or disconnected targets report `platform unknown`. They also include `connected` and, when known, the SSH lifecycle `connectionStatus`. If you put a machine name on the wrong selector, Orca reports the matching machine and the flag to use instead of returning an empty result. +`server list` reads this computer's pairing store and never contacts a server. Ask one server for its status with `orca status --server --json`. A server set up over [SSH](/docs/ssh) is a saved server like any other; SSH connections themselves are managed in Settings. -`--host` also takes the bare name shown in the `name` column, on either axis — `--host trader-local` reaches the same machine as `--host ssh:ssh-1783599077486-fyasux`. Names resolve only when they are unique: a name held by two SSH targets, by two paired servers, or by one of each is refused, and the error hands back the id form for each candidate — `--host ssh:` for an SSH target and `--host runtime:` for a paired server. Use those to settle it, since `--environment ` cannot separate two servers sharing a name. - -Remove a saved SSH target with the id `orca host list` prints: - -```bash -orca host rm --host ssh: --json -``` - -It removes the target the same way Settings does, so the passive `~/.ssh/config` import does not add the alias back on the next launch. It takes only the `ssh:` form, not the bare name, because it deletes data. It refuses `--host local`, paired servers (use `orca environment rm`), and an id this Orca host does not have. +Listings name the server that owns each row: `server:` in `worktree ps` and `worktree show`, and `server=` in `worktree list`, `terminal list`, `project setups` and orchestration worker lines. `server=unknown (...)` means Orca cannot verify the owner from here, so don't treat that row's paths as files on this computer. ## Runtime commands @@ -99,7 +91,7 @@ orca repo search-refs --repo id: --query main --limit 10 --json Set the repo base ref before creating lots of worktrees so new tasks branch from the right place by default. -`repo add` defaults to `--kind git`. Use `--kind folder` to open an ordinary directory, including a repo-tool root containing separate Git repositories, as a folder workspace without Git worktrees or source control. With `--environment`, use an absolute path on that Orca server. +`repo add` defaults to `--kind git`. Use `--kind folder` to open an ordinary directory, including a repo-tool root containing separate Git repositories, as a folder workspace without Git worktrees or source control. With `--server`, use an absolute path on that Orca server. ## Worktrees @@ -209,7 +201,7 @@ Omit `--terminal` to target the active terminal in the current worktree. Read be Close stops the process as part of removing the terminal. Use `--terminal ` for one terminal, or `--worktree --all` to durably close every terminal in exactly that workspace, including its saved layouts and agent-resume records. Use workspace Sleep when those -terminals should resume later. If the execution host cannot confirm that every PTY stopped, bulk +terminals should resume later. If the server cannot confirm that every PTY stopped, bulk close returns a failing `unverifiable` result rather than claiming the processes exited. `terminal stop` remains only for compatibility with older tooling. @@ -218,7 +210,7 @@ close returns a failing `unverifiable` result rather than claiming the processes handle, run `orca terminal list --json` and reacquire the handle. -`terminal list` reports each terminal's `executionHostId` when Orca can verify it, plus a result-level `hostScope` with covered and omitted host IDs. Treat a missing host identity or scope as **unverifiable**, not local. A missing terminal is evidence that it exited only when its execution host is listed in `hostScope.hostIds`. +`terminal list` reports each terminal's `executionHostId` when Orca can verify it, plus a result-level `hostScope` with covered and omitted host IDs. Treat a missing host identity or scope as **unverifiable**, not local; text output prints it as `server=unknown`. A missing terminal is evidence that it exited only when its host is listed in `hostScope.hostIds`. By default, `terminal read` returns the accumulated output stream with terminal escapes stripped. Programs that redraw lines can therefore appear as stacked fragments. Use `--screen` when you need the currently rendered frame; the response's `source` identifies `stream`, `screen`, or `screen-unavailable`. Screen reads have no history to page, so `--screen` and `--cursor` are mutually exclusive. @@ -231,7 +223,7 @@ orca chat rename --session --name "Release notes" --json orca chat rename --name "Migrate auth" ``` -Renames a chat tab, the same as renaming it by hand. `--session` takes the `sessionId` that `orca agent launch` prints. Run inside a chat, it defaults to that chat; with `--environment` it is required. +Renames a chat tab, the same as renaming it by hand. `--session` takes the `sessionId` that `orca agent launch` prints. Run inside a chat, it defaults to that chat; with `--server` it is required. ## Files @@ -384,7 +376,7 @@ orca skills install --all --dry-run orca skills update --all ``` -`install` / `update` run Orca's own skill installer on the machine that runs them, the same planner the app's **Update skills** uses. They do not contact the Orca runtime or need `npx`. See [Orca skills](/docs/cli/skills#keep-skills-up-to-date). +`install` / `update` run Orca's own skill installer on the machine that runs them, the same planner the app's **Update skills** uses. They do not contact an Orca server or need `npx`. See [Orca skills](/docs/cli/skills#keep-skills-up-to-date). ## Account (host-local runtime) @@ -442,12 +434,12 @@ orca automations create --name "Daily review" --trigger daily --time 09:00 --pro orca automations run --json ``` -Remote runtime environments: +Saved servers: ```bash -orca environment add --name work-laptop --pairing-code "orca://pair?code=..." --json -orca environment list --json -orca environment rm --environment --json +orca server add --name work-laptop --pairing-code "orca://pair?code=..." --json +orca server list --json +orca server rm --server --json ``` Agent status hooks: diff --git a/docs/site/content/docs/ssh.mdx b/docs/site/content/docs/ssh.mdx index 1d2fbbca597..c3f2820b77b 100644 --- a/docs/site/content/docs/ssh.mdx +++ b/docs/site/content/docs/ssh.mdx @@ -25,7 +25,7 @@ Orca won't add a second target for a machine already in Orca. When it imports `~ The import reads `Host` blocks only. It adds each concrete alias of a `Host` line and skips patterns with `*`, `?`, or `!`. A `Match` block adds no target: a `Match` line ends the `Host` block above it, and the import ignores its lines until the next `Host` line. A tool that writes its own SSH config blocks can use `Match originalhost ` instead of `Host ` to keep a machine out of the import. Orca expands `Include` files in place before it parses, so a `Host` block in an included file is imported even when the `Include` line is inside a `Match` block. -When you remove a target that came from `~/.ssh/config` (in Settings, or with `orca host rm`), the passive import (on launch, **Sync ~/.ssh/config**, or **Add all**) does not add its alias back. **Restore removed hosts…** in Settings → SSH brings it back. +When you remove a target that came from `~/.ssh/config` (in Settings), the passive import (on launch, **Sync ~/.ssh/config**, or **Add all**) does not add its alias back. **Restore removed hosts…** in Settings → SSH brings it back. ## Host key verification diff --git a/skill-guides/linear-tickets.md b/skill-guides/linear-tickets.md index c6ac3a81b5b..255f47eb2cf 100644 --- a/skill-guides/linear-tickets.md +++ b/skill-guides/linear-tickets.md @@ -86,7 +86,7 @@ Use `ORCA linear list-issues` when MCP-compatible filters or cursor pagination a - Omitting `--limit` returns every match and reports `result.meta.limit` as `null`, so filter before listing a large workspace. `--limit ` caps the read. - When a cap held results back, `--json` sets `result.truncated` and `result.meta.hasMore`; human output prints `truncated: showing N`. Check `truncated` before reporting a count, then page with `--cursor` until it is false. -- A `--cursor` is bound to the workspace and the Orca runtime that issued it. `--workspace all` cannot page, and a raw Linear cursor still needs a concrete `--workspace`. +- A `--cursor` is bound to the workspace and the Orca server that issued it. `--workspace all` cannot page, and a raw Linear cursor still needs a concrete `--workspace`. - `--priority` is `0=none`, `1=urgent`, `2=high`, `3=medium`, `4=low`. Issue JSON carries `priorityLabel` in the CLI setter vocabulary; project JSON keeps Linear's title-case label. - `ORCA linear search`, `ORCA linear list`, and `ORCA linear project list` cap at their own `--limit` and set `result.truncated` the same way. diff --git a/skill-guides/orca-cli.md b/skill-guides/orca-cli.md index 523f0ec335b..8c34cb4b761 100644 --- a/skill-guides/orca-cli.md +++ b/skill-guides/orca-cli.md @@ -46,7 +46,7 @@ For a requested model or effort, such as `gpt-6-astra high`, add `--model` and ` ORCA worktree create --name --no-parent --agent codex --model gpt-6-astra --effort high --prompt "" --json ``` -Read what started from `result.launch`: `outcome.kind` is `structured` (a chat) or `terminal`, `outcome.handle` is the agent handle, `receipt.detail` says why, and `prompt.outcome` says whether the brief arrived. An Orca host older than this returns the terminal handle in `result.agentTerminalHandle` and refuses `--model`/`--effort`. +Read what started from `result.launch`: `outcome.kind` is `structured` (a chat) or `terminal`, `outcome.handle` is the agent handle, `receipt.detail` says why, and `prompt.outcome` says whether the brief arrived. An Orca server older than this returns the terminal handle in `result.agentTerminalHandle` and refuses `--model`/`--effort`. For a fresh agent in a worktree that already exists, use `agent launch`, which takes the same `--prompt`, `--model` and `--effort`: @@ -64,7 +64,7 @@ ORCA terminal send --terminal --text "" --enter --json `worktree create --agent` (new checkout) and `agent launch` (existing worktree) are how to start an agent. They go through Orca's agent launch, the same one the app's new-agent tab uses: the user's Chat | CLI choice for that agent decides whether it opens as a chat or a terminal, and the result reports which (`outcome.kind`) and why (`receipt.detail`). When a chat is not possible, such as for an agent without chat support, the launch starts a terminal and the receipt says so. `--surface chat|terminal` picks one for that launch instead of the setting; pass it only when the user asked for a chat or a terminal. `--surface chat` is refused when Orca can establish before starting anything that the agent cannot open as a chat. If support cannot be checked, the launch can fall back to a terminal. If chat becomes unavailable only after a new workspace is created, Orca keeps that workspace, its setup and default tabs, then opens a terminal; the receipt explains the fallback. `terminal create` makes a terminal for shells and commands. -If a launch reply is lost, use the returned `operationId` to re-issue the exact same command from the same directory against the same execution host with `--retry-launch `. Keep that ID on every retry: the host replays the accepted launch instead of starting another agent or submitting the brief twice. Do not retry as a fresh launch. If replay says the outcome is unknown or expired, or an older host gives no replay ID, inspect the workspace and agent without sending input before deciding whether another launch is needed. A host that cannot safely carry prompts or honor background/focus requests is refused before launch; update Orca on that execution host. +If a launch reply is lost, use the returned `operationId` to re-issue the exact same command from the same directory against the same server with `--retry-launch `. Keep that ID on every retry: the server replays the accepted launch instead of starting another agent or submitting the brief twice. Do not retry as a fresh launch. If replay says the outcome is unknown or expired, or an older server gives no replay ID, inspect the workspace and agent without sending input before deciding whether another launch is needed. A server that cannot safely carry prompts or honor background/focus requests is refused before launch; update Orca on that server. ## Worktrees @@ -72,7 +72,7 @@ An Orca worktree is Orca's tracked view of a repo checkout, its metadata, termin Its id is a two-part address, `::`, such as `repo-123::/Users/me/orca/fix-login`. Copy the whole `id` field from `ORCA worktree create --json` or `ORCA worktree list --json`. `repo-123` alone names only the repo. -For local creation, omit `--repo` and `--project` to stay in the caller's project. Use `--parent-worktree active` for a child of the current workspace. Project selection and parent selection are separate: a native folder parent supplies lineage, not a Git destination, so pass an explicit Git target when creating from a folder outside any managed checkout. Otherwise, pass `--repo` or `--project` only when deliberately creating in another project, or when Orca asks you to disambiguate. Outside any Orca-managed project, pass an explicit target. With a paired server, discover and use that server's exact target instead of the local cwd. +For local creation, omit `--repo` and `--project` to stay in the caller's project. Use `--parent-worktree active` for a child of the current workspace. Project selection and parent selection are separate: a native folder parent supplies lineage, not a Git destination, so pass an explicit Git target when creating from a folder outside any managed checkout. Otherwise, pass `--repo` or `--project` only when deliberately creating in another project, or when Orca asks you to disambiguate. Outside any Orca-managed project, pass an explicit target. With `--server`, discover and use that server's exact target instead of the local cwd. If several Orca workspaces share the checkout and no caller identity selects one, workspace-specific commands ask you to choose an exact selector. Inspect a listed workspace with `ORCA worktree show --worktree --json`, then use the command’s workspace target flag. For an implicit-create refusal, use `ORCA worktree list --limit 10000 --json` with the same server and host selection; match path and host, increasing --limit if truncated. Pass `--parent-worktree ` or deliberately use `--no-parent` on a fresh request without --retry-launch. Retrying the refused ID returns its original explanation. Pass each exact selector as one argument quoted for your shell. Native folder choices are shown in the local error; exact show inspection is supported, while native folders are not enumerated by worktree list. Implicit creation checks this only when the host actually uses the directory’s parent context; older hosts retain their existing implicit-parent behavior. @@ -120,9 +120,9 @@ ORCA worktree set --worktree active --pr null --gitlab-mr null --json ORCA worktree rm --worktree id::: --force --json ``` -`repo add` defaults to Git. Use `--kind folder` for an ordinary directory or a parent of separate Git repositories; worktrees attached to a folder workspace appear in its Source Control panel, one section each. With `--environment`, pass an absolute path on that server. +`repo add` defaults to Git. Use `--kind folder` for an ordinary directory or a parent of separate Git repositories; worktrees attached to a folder workspace appear in its Source Control panel, one section each. With `--server`, pass an absolute path on that server. -Ports: `ORCA ports --json` lists the listening ports Orca tied to the current workspace (`--worktree ` for another one, `--all` for every listener on that workspace's host). Each row has `port`, `pid`, `processName`, `connectHost`, `protocol`, and `kind` (`workspace`, `container`, or `external`). Only `workspace` rows have `owner` (with `owner.confidence`: `cwd` or `command`) and, when the dev server printed one in an Orca terminal, `advertisedUrl`. Use this to find a dev server's port instead of running `lsof` yourself. If `unavailableReason` is set, the scan could not run on that host. Native folder workspaces need `--all`, because Orca does not tie ports to them. SSH workspaces opened directly from this app report `unavailableReason` for now; a workspace on a managed Orca server is scanned on that server. +Ports: `ORCA ports --json` lists the listening ports Orca tied to the current workspace (`--worktree ` for another one, `--all` for every listener on that workspace's server). Each row has `port`, `pid`, `processName`, `connectHost`, `protocol`, and `kind` (`workspace`, `container`, or `external`). Only `workspace` rows have `owner` (with `owner.confidence`: `cwd` or `command`) and, when the dev server printed one in an Orca terminal, `advertisedUrl`. Use this to find a dev server's port instead of running `lsof` yourself. If `unavailableReason` is set, the scan could not run on that server. Native folder workspaces need `--all`, because Orca does not tie ports to them. SSH workspaces opened directly from this app report `unavailableReason` for now; a workspace on a managed Orca server is scanned on that server. Use `repo set --external-worktree-visibility show` to show a repo's non-Orca worktrees. `hide` hides them; `inherit` clears the repo override and follows the global default. @@ -134,11 +134,12 @@ Selectors: - `folder:` names a folder workspace, for commands that take one (`worktree activate` doesn't yet). On a folder workspace, `worktree set` changes `--display-name`, `--comment`, `--workspace-status` and `--unread`/`--read` (links go through `reference add`), and `worktree rm` makes Orca forget it while the folder stays on disk. `path:` and `name:` also match folder workspaces, so `--worktree path:` reaches the folder; `branch:`, `issue:` and `identity:` match worktrees only. `ORCA worktree ps --json` lists folder workspaces; `worktree list` does not. - Older Orca versions match `path:` and `name:` against worktrees only, and may pick a worktree at the folder's path. If a folder is meant, pass `folder:`. - When several workspaces match, the error usually lists each choice's kind, host, path and exact selector; pass one of those. If it lists none, find the row with `ORCA worktree ps --json` (if `truncated`, repeat with `--limit `) and pass `identity:`, `folder:`, or `id:` when no other row has that id. A folder id that two folder workspaces share can't be selected; the error says how to repair it. -- For a workspace in another environment, add `--environment ` to the command, as with any other selector. +- For a workspace on another server, add `--server ` to the command, as with any other selector. - The full id is the exact `::` value returned by `ORCA worktree create --json` or `ORCA worktree list --json`; a bare repo id is not a worktree id. -- `active` / `current` for the Orca workspace enclosing the shell cwd, worktree or folder workspace: the innermost one wins, so a worktree nested inside a folder workspace is picked over the folder; at equal depth this terminal's own workspace wins, otherwise the error lists the choices. Pass `folder:` to get the folder itself. `worktree rm` refuses `current`/`active` and needs an explicit selector; its error prints the one `current` resolves to. `current` resolves on this machine's Orca, so it is refused with `--environment ` or `--pairing-code`; use an explicit selector from that environment instead (`--environment local` keeps it on this machine even when `ORCA_ENVIRONMENT` is set). -- `--environment` selects which Orca receives the command (`local` is this machine's own Orca); `host` is that Orca's stored location metadata. Never derive an environment from `host`. -- `worktree ps` and `worktree show` give each workspace an `address` (text: an `address:` line). Copy `address.line` as is, keeping its `--environment`, or pass `address.environment` and `address.worktree` as `--environment` and `--worktree`. If `address` is null, follow `addressUnavailable` (`one-off-connection`, `unverifiable-row` or `duplicate-folder-id`) and never construct a route yourself. `parent` names the parent's environment when it is known; with `state: unknown-environment` there is no route to it from here. +- `active` / `current` for the Orca workspace enclosing the shell cwd, worktree or folder workspace: the innermost one wins, so a worktree nested inside a folder workspace is picked over the folder; at equal depth this terminal's own workspace wins, otherwise the error lists the choices. Pass `folder:` to get the folder itself. `worktree rm` refuses `current`/`active` and needs an explicit selector; its error prints the one `current` resolves to. `current` resolves on the Orca on this computer, so it is refused with `--server ` or `--pairing-code`; use an explicit selector from that server instead (`--server local` keeps it on this computer even when `ORCA_ENVIRONMENT` is set). +- `--server` selects which Orca server receives the command: `local` is the Orca on this computer, any other value is a saved server's id or name (`ORCA server list`). +- A row's `server` (text: `server:` in `ps`/`show`, `server=` in `worktree list`, `terminal list`, `project setups` and worker lines) is the server that owns it. `server=unknown (...)` means Orca cannot verify the owner from here; it never guesses `local`, so don't treat that row's paths as files on this computer. JSON `hostId` is raw stored data; never build a route from it. +- `worktree ps` and `worktree show` give each workspace an `address` (text: an `address:` line): the server that answered plus a selector it accepts, which can differ from the owning `server`. Copy `address.line` as is, or pass `address.server` and `address.worktree` as `--server` and `--worktree`. If `address` is null, follow `addressUnavailable` (`one-off-connection`, `unverifiable-row` or `duplicate-folder-id`) and never construct a route yourself. `parent.server` names the parent's server when it is known; with `parent.state: unknown-server` there is no route to it from here. - For `worktree create --parent-worktree`, folder/worktree parent context keys are also valid: `folder:`, `worktree:::`, `id:folder:`, `id:worktree:::`. `worktree set --parent-worktree` also takes the folder keys, `folder:` or `id:folder:`. On both, `path:` and `name:` record a folder workspace parent when they match one. Lineage rules: @@ -147,9 +148,9 @@ Lineage rules: - Use `--parent-worktree active` when the child worktree relationship should be explicit. - Use `--parent-worktree folder:` or `--parent-worktree worktree:::` when a folder or worktree parent context should be explicit. - Use `--no-parent` only when the new work is independent. -- A parent can be in a different project from its child, such as `worktree create --repo id: --name related-task --parent-worktree id:::`. A worktree parent and child must use the same execution host (local machine, SSH target, or paired server). -- `--parent-worktree` is looked up in the child's environment. For a parent in another environment, add `--parent-environment `: to reuse a workspace from `ps`/`show` as a parent, pass its `address.environment` as `--parent-environment` and its `address.worktree` as `--parent-worktree`. Orca never searches other environments; a parent missing there is an error. `active`/`current` always mean this machine's own workspace, so they take only `--parent-environment local`. -- An address with `--environment local` means the Orca that printed it, because `local` is always the machine running the command; don't hand an address to another machine to run. To link workspaces across environments, run the command from the Orca that has both paired, such as `--environment --worktree --parent-worktree current`. +- A parent can be in a different project from its child, such as `worktree create --repo id: --name related-task --parent-worktree id:::`. A parent can also be on another server: name it with `--parent-server`. The child's server must support parents on other servers; an older one refuses before changing anything. +- `--parent-worktree` is looked up on the child's server. For a parent on another server, add `--parent-server `: to reuse a workspace from `ps`/`show` as a parent, pass its `address.server` as `--parent-server` and its `address.worktree` as `--parent-worktree`. Orca never searches other servers; a parent missing there is an error. `active`/`current` always mean a workspace on this computer, so they take only `--parent-server local`. +- An address with `--server local` means the Orca that printed it, because `local` is always the computer running the command; don't hand an address to another computer to run. To link workspaces across servers, run the command from the Orca that has both saved, such as `--server --worktree --parent-worktree current`. - To move an existing worktree under a different parent, or make it top-level, use `worktree set` with `--parent-worktree ` or `--no-parent`. - `--no-parent` only controls Orca lineage; it does not choose the Git base. For independent top-level work, omit `--base-branch` so Orca uses the repo default base, or explicitly pass the repo default base. Never base it on the current feature branch unless the user asks for stacked work or "branch from current". @@ -248,13 +249,13 @@ Terminal rules: - `--terminal` is optional for most commands; omitted means the active terminal in the current worktree. - Use `terminal close --terminal ` to close one terminal. Use `terminal close --worktree --all` to stop every terminal process in exactly that workspace and durably remove its terminal tabs, layouts, and agent-resume records. -- A bulk close fails when the execution host cannot confirm every PTY stopped. Treat that as `unverifiable`; do not report the processes as exited or retry against another host. +- A bulk close fails when the server cannot confirm every PTY stopped. Treat that as `unverifiable`; do not report the processes as exited or retry against another server. - Use workspace Sleep, not close, when the terminals and agent sessions should resume later. `terminal stop` is legacy compatibility plumbing and should not be used in new agent workflows. - `terminal list --json` omits `visualLayouts` to keep the common agent payload bounded. Add `--include-visual-layouts` only when tab and pane topology is required. - A chat tab has no terminal handle, so `terminal rename` cannot rename it. Use `ORCA chat rename --session --name "New Name" --json` with the `sessionId` `agent launch` printed; inside a chat, omit `--session` to rename that chat. - `terminal create --title` and `terminal rename` set the tab title, which `terminal list` reports under `visualLayouts`. `terminal set-pane-title` sets one pane's title, reported as `terminals[].paneTitle`. `terminals[].title` may be the tab title or the running program's own title, which agents repaint constantly, so never match on it to re-find a terminal. - `terminals[].agentIdentity`, when present, is only the agent type (e.g. `codex`), not a session identity, so two Codex panes share it. To find a specific agent's terminal, join `worktree ps --json` `agents[].paneKey` (`:`) to the `tabId` and `leafId` of a `terminal list` row to get its handle. -- A paired server has no window. `terminal switch --environment ` moves the desktop app on this machine to that server's terminal, and reports `navigated: false` when no desktop here shows that server. +- A server reached with `--server` has no window. `terminal switch --server ` moves the desktop app on this computer to that server's terminal, and reports `navigated: false` when no desktop here shows that server. - Use `terminal read` before `terminal send` unless the next input is obvious. - `terminal read` returns accumulated output with escape sequences stripped, not the rendered screen, so anything that repaints (shells, progress bars, TUIs) reads as stacked fragments. Use `--screen` whenever the answer depends on what the terminal actually shows. - `--screen` and `--cursor` are mutually exclusive: a screen read is the current frame and has no history to page. @@ -325,7 +326,7 @@ a plugin. To design, write and debug a plugin end to end, invoke the `orca-plugi ## Agent Session Search -`ORCA search` runs a full-text search over the agent sessions indexed on one Orca host: this machine, or the paired server named by `--environment` or `--pairing-code`. There is no all-computers search. +`ORCA search` runs a full-text search over the agent sessions indexed on one Orca server: the Orca on this computer, or the server named by `--server` or `--pairing-code`. There is no all-servers search. Common commands: @@ -335,7 +336,7 @@ ORCA search "resolveTerminalPath" --scope conversation --json ORCA search "blank restore" --agent codex --since 2026-09-01T00:00:00Z --json ORCA search "blank restore" --path /abs/worktree --sort newest --limit 50 --json ORCA search "blank restore" --cursor --json -ORCA search "blank restore" --environment --json +ORCA search "blank restore" --server --json ORCA search "blank restore" --fresh --debug --json ORCA search --index-status --json ``` diff --git a/skill-guides/orca-cli/references/plugins.md b/skill-guides/orca-cli/references/plugins.md index e816a032acf..91882511213 100644 --- a/skill-guides/orca-cli/references/plugins.md +++ b/skill-guides/orca-cli/references/plugins.md @@ -52,7 +52,7 @@ Exit codes: `0` ok, `1` error, `2` `plugin_invalid`, `3` `approval_required` or (see `docs/reference/plugin-declarative-ui.md`, "Testing"). Both run the plugin's code unsandboxed on this machine: use them only on code you trust. 4. `plugin dev load ` adds the folder to Settings → Plugins → Development folders on the - Orca host and loads it. Orca reloads it, and restarts its worker, when its files change; run + Orca server and loads it. Orca reloads it, and restarts its worker, when its files change; run `plugin dev reload ` if a change was missed. `plugin restart ` stops a worker so its next command or event reruns its startup code. `plugin logs` shows what a worker printed and a panel's or editor's console errors, warnings and uncaught exceptions as `[frame] : `. @@ -92,13 +92,13 @@ Exit codes: `0` ok, `1` error, `2` `plugin_invalid`, `3` `approval_required` or Both need the desktop app with a workspace showing and never raise the window. 6. `plugin dev unload ` when done. -Paths are on the machine that runs Orca. With `--environment `, pass an absolute path +Paths are on the machine that runs Orca. With `--server `, pass an absolute path on that server. From an SSH or WSL shell that forwards `orca` to another machine, the authoring -and dev commands refuse; work on the Orca host instead. +and dev commands refuse; work on the Orca server instead. `plugin_system_disabled` means plugins are off on that host. Ask the user to click "Turn on plugins" in Settings → Plugins, or on a host with no window (`orca serve`) to run -`plugin system on` with the same `--environment`. It approves nothing; only plugins approved +`plugin system on` with the same `--server`. It approves nothing; only plugins approved earlier start. ## Install, update and remove @@ -110,7 +110,7 @@ earlier start. - `owner/repo` or `owner/repo@v1.2.0` on GitHub, - any `https://` or `ssh://` Git URL or `git@host:owner/repo.git`, with `#ref` for a version, - a GitHub or GitLab release, tag or tree page URL (`.../releases/tag/v1.2.0`, `.../-/tree/main`), -- a plugin folder (a path on the Orca host). +- a plugin folder (a path on the Orca server). With no version, Orca installs the newest version tag (`vX.Y.Z`), else the default branch, and always pins the exact commit. The result names the version, commit, publisher and repository. @@ -137,7 +137,7 @@ returns `approval_required` with a `cat1-…` fingerprint for that exact URL and ## Private repositories -Git runs on the Orca host (the `--environment` server when given) with that machine's own Git +Git runs on the Orca server (the `--server` one when given) with that machine's own Git credentials and never prompts. Nothing to pass to `orca`; set up Git there once: - HTTPS on GitHub: `gh auth login` then `gh auth setup-git`. GitLab: `glab auth login`. Elsewhere: diff --git a/skill-guides/orca-emulator-android.md b/skill-guides/orca-emulator-android.md index 2588175d309..de3649afd23 100644 --- a/skill-guides/orca-emulator-android.md +++ b/skill-guides/orca-emulator-android.md @@ -30,7 +30,7 @@ device with `emulator_unsupported`. `tap`, `type`, `gesture`, `button`, `rotate` tree on Android, a serve-sim node tree on iOS. Camera and sensor injection are not wrapped; Android virtual-scene is out of scope. Commands -drive the SDK and devices on the host that runs the Orca runtime, including a headless +drive the SDK and devices on the computer that runs the Orca server, including a headless `orca serve` or SSH host. ## Prerequisites diff --git a/skill-guides/orca-emulator.md b/skill-guides/orca-emulator.md index f2b14a1be43..0b1425ac03e 100644 --- a/skill-guides/orca-emulator.md +++ b/skill-guides/orca-emulator.md @@ -24,7 +24,7 @@ unvalidated with the active device injected. device with `emulator_unsupported`. `tap`, `type`, `gesture`, `button`, `rotate`, `ax`, and `exec` work on both backends. -Commands drive devices on the host that runs the Orca runtime. Simulators need that host to +Commands drive devices on the computer that runs the Orca server. Simulators need that computer to be a Mac, so a Linux `orca serve` or SSH host can drive only Android devices. ## Prerequisites diff --git a/skill-guides/orca-jira.md b/skill-guides/orca-jira.md index 661a49ae9e1..440fe996352 100644 --- a/skill-guides/orca-jira.md +++ b/skill-guides/orca-jira.md @@ -142,7 +142,7 @@ Confirm `ORCA status --json` unless already checked this turn, then read the iss ## Connections and verified reads -Configure credentials in Orca Settings. `ORCA jira connection --json` lists saved site IDs; it does not test access or agent MCP authentication. These commands use credentials on the selected execution host, including SSH hosts. Update that host if the CLI reports `incompatible_runtime`. +Configure credentials in Orca Settings. `ORCA jira connection --json` lists saved site IDs; it does not test access or agent MCP authentication. These commands use credentials on the selected server, including servers on SSH hosts. Update that host if the CLI reports `incompatible_runtime`. A successful empty list means the Jira read completed; API, permission and network errors remain errors. Jira keys are case-insensitive; full browse URLs are accepted wherever an issue key is required. Use `--body-file ` for multiline descriptions and comments, or `--body-file -` for stdin. diff --git a/skill-guides/orca-linear.md b/skill-guides/orca-linear.md index 09d09f2f6f2..2139ce4fe6e 100644 --- a/skill-guides/orca-linear.md +++ b/skill-guides/orca-linear.md @@ -83,7 +83,7 @@ Use `ORCA linear list-issues` when MCP-compatible filters or cursor pagination a - Omitting `--limit` returns every match and reports `result.meta.limit` as `null`, so filter before listing a large workspace. `--limit ` caps the read. - When a cap held results back, `--json` sets `result.truncated` and `result.meta.hasMore`; human output prints `truncated: showing N`. Check `truncated` before reporting a count, then page with `--cursor` until it is false. -- A `--cursor` is bound to the workspace and the Orca runtime that issued it. `--workspace all` cannot page, and a raw Linear cursor still needs a concrete `--workspace`. +- A `--cursor` is bound to the workspace and the Orca server that issued it. `--workspace all` cannot page, and a raw Linear cursor still needs a concrete `--workspace`. - `--priority` is `0=none`, `1=urgent`, `2=high`, `3=medium`, `4=low`. Issue JSON carries `priorityLabel` in the CLI setter vocabulary; project JSON keeps Linear's title-case label. - `ORCA linear search`, `ORCA linear list`, and `ORCA linear project list` cap at their own `--limit` and set `result.truncated` the same way. diff --git a/skill-guides/orca-plugin-authoring.md b/skill-guides/orca-plugin-authoring.md index 65a246aa89c..2abbb1e3296 100644 --- a/skill-guides/orca-plugin-authoring.md +++ b/skill-guides/orca-plugin-authoring.md @@ -18,7 +18,7 @@ Pass `--json` to every `ORCA plugin` command and branch on `error.code`, not on - **Your files:** a new folder, ideally its own Git repository, with `orca-plugin.json` at its root, made by `ORCA plugin create` (never overwrites). Paths are on the machine that runs Orca; - with `--environment` pass an absolute path on that server. + with `--server` pass an absolute path on that server. - **Types:** `ORCA plugin types ` (also run by `dev watch`) writes `.orca/types/` for every surface; the plugin's `tsconfig.json` extends `./.orca/types/tsconfig.json`. Never edit `.orca/`. - **Ground truth:** the references below match this Orca. Read them instead of guessing. diff --git a/skill-guides/orca-plugin-authoring/references/cli.md b/skill-guides/orca-plugin-authoring/references/cli.md index cb7c979efbc..3090cb7c6b3 100644 --- a/skill-guides/orca-plugin-authoring/references/cli.md +++ b/skill-guides/orca-plugin-authoring/references/cli.md @@ -11,12 +11,12 @@ - `ORCA plugin validate [--json]`: Check a plugin folder, manifest or catalog the way Orca will load it - `ORCA plugin inspect [--json]`: Show what a plugin folder contributes, the access it asks for, and its content hash - `ORCA plugin release-entry [--json]`: Print the catalog release entry for a plugin folder's committed HEAD -- `ORCA plugin list [--json]`: List plugins on the Orca host with their status and access level +- `ORCA plugin list [--json]`: List plugins on the Orca server with their status and access level - `ORCA plugin logs [--json]`: Print the recent log lines of a plugin - `ORCA plugin enable [--approve ] [--json]`: Enable a plugin; code and capabilities need --approve - `ORCA plugin disable [--json]`: Disable a plugin -- `ORCA plugin system on [--json]`: Turn plugins on for the Orca host -- `ORCA plugin system off [--json]`: Turn plugins off for the Orca host +- `ORCA plugin system on [--json]`: Turn plugins on for the Orca server +- `ORCA plugin system off [--json]`: Turn plugins off for the Orca server - `ORCA plugin restart [--json]`: Stop a plugin's worker so its next command or event starts it fresh - `ORCA plugin dev watch [--check] [--shot [--shot-panel ]] [--approve ] [--json]`: Load a plugin folder, then stream its logs and reloads until Ctrl-C - `ORCA plugin dev load [--approve ] [--json]`: Load a plugin folder into Orca as a development plugin diff --git a/skill-guides/orca-plugin-authoring/references/workflow.md b/skill-guides/orca-plugin-authoring/references/workflow.md index ecbdab13150..597a5977ca2 100644 --- a/skill-guides/orca-plugin-authoring/references/workflow.md +++ b/skill-guides/orca-plugin-authoring/references/workflow.md @@ -67,7 +67,7 @@ re-checks changed commands and shortcuts), `ORCA plugin dev unload `. a dev plugin, run inside its folder. The result adds `replay: true` and `scenario`, and `errors` has what the render reported; an unknown name fails and lists the scenarios. Limits: a still frame (host-owned control values start from the tree's props), images show their - placeholder, no `--act`, local only (no `--environment`), and Orca's window must be hidden + placeholder, no `--act`, local only (no `--server`), and Orca's window must be hidden or minimized. Default file `.orca/shots/-..png`. - `ORCA plugin open [--panel | --editor ]` shows the panel in the right sidebar, or a file in the plugin's custom editor. Neither raises the window. `--editor` opens the diff --git a/skill-guides/orchestration.md b/skill-guides/orchestration.md index 8187a43ec48..4a5a0fd6c07 100644 --- a/skill-guides/orchestration.md +++ b/skill-guides/orchestration.md @@ -50,7 +50,7 @@ ORCA orchestration worker-start --spec "" --worktree current --agent codex in any state: a working worker gets it when its current turn ends; a finished or closed one gets it as a follow-up Task and reports with `worker_done`. The receipt says which. - Except on a paired server: a finished worker there refuses `send`, so start + Except on another server: a finished worker there refuses `send`, so start new work there with `worker-start --on ` (load `references/placement-and-remote.md` first). diff --git a/skill-guides/orchestration/references/placement-and-remote.md b/skill-guides/orchestration/references/placement-and-remote.md index e633f12bd90..2fba18b05fc 100644 --- a/skill-guides/orchestration/references/placement-and-remote.md +++ b/skill-guides/orchestration/references/placement-and-remote.md @@ -18,10 +18,10 @@ when requesting a child of the current workspace. ORCA orchestration worker-start --task --worktree new-child --agent codex --setup run # On a connected server; the Run stays on yours. -ORCA orchestration worker-start --task --on --worktree new-top-level --repo --name --agent codex --setup run +ORCA orchestration worker-start --task --on --worktree new-top-level --repo --name --agent codex --setup run # On a connected server, nested under your workspace in the sidebar. -ORCA orchestration worker-start --task --on --worktree new-child --repo --name --agent codex --setup run +ORCA orchestration worker-start --task --on --worktree new-child --repo --name --agent codex --setup run ``` With `--on`, both `new-child` and `new-top-level` need `--repo` naming a diff --git a/src/cli/agent-context.ts b/src/cli/agent-context.ts index 224eec63b5a..b3aba091400 100644 --- a/src/cli/agent-context.ts +++ b/src/cli/agent-context.ts @@ -1,5 +1,6 @@ import type { CommandSpec } from './args' import { effectiveAllowedFlags } from './args' +import { INPUT_ONLY_FLAGS } from './command-spec' const SCHEMA_VERSION = 1 @@ -36,7 +37,7 @@ export function buildAgentContext(specs: CommandSpec[]): AgentContextSchema { summary: spec.summary, usage: spec.usage, // Include globals and conditional flags so discovery matches validation. - flags: effectiveAllowedFlags(spec), + flags: effectiveAllowedFlags(spec).filter((flag) => !INPUT_ONLY_FLAGS.has(flag)), positionalArgs: spec.positionalArgs ?? [], ...(spec.variadicPositional ? { variadicPositional: true } : {}), ...(spec.repeatableFlags ? { repeatableFlags: spec.repeatableFlags } : {}), diff --git a/src/cli/agent-launch-recovery.ts b/src/cli/agent-launch-recovery.ts index 2311b86f86e..e64c563cfbf 100644 --- a/src/cli/agent-launch-recovery.ts +++ b/src/cli/agent-launch-recovery.ts @@ -59,12 +59,12 @@ export async function withCliAgentLaunchRecovery( : undefined const nextSteps = recovery.operationId ? [ - `Re-issue the exact same command from the same directory against the same execution host with --retry-launch ${recovery.operationId}. Keep that ID on every retry; never retry as a fresh launch.`, + `Re-issue the exact same command from the same directory against the same server with --retry-launch ${recovery.operationId}. Keep that ID on every retry; never retry as a fresh launch.`, 'If replay reports an unknown or expired outcome, inspect the workspace and agent without sending input before deciding what to do.' ] : [ - 'Do not repeat the launch: this older host cannot prove whether it started the agent or sent the prompt.', - 'Inspect worktree list and terminal list on the execution host, then read the agent without sending input. Confirm the outcome before deliberately starting another agent.' + 'Do not repeat the launch: this older server cannot prove whether it started the agent or sent the prompt.', + 'Inspect worktree list and terminal list on the server, then read the agent without sending input. Confirm the outcome before deliberately starting another agent.' ] // Replace transport restart-and-retry advice: the accepted launch may still be running. throw new RuntimeClientError( diff --git a/src/cli/agent-launch-request.ts b/src/cli/agent-launch-request.ts index df2508164af..67b57ba99b9 100644 --- a/src/cli/agent-launch-request.ts +++ b/src/cli/agent-launch-request.ts @@ -75,7 +75,7 @@ export function readCliAgentLaunch( model: getOptionalStringFlag(flags, 'model'), effort: getOptionalStringFlag(flags, 'effort'), createsWorktree: target.createsWorktree, - // The execution host verifies an OpenCode model itself before it starts one. + // The server verifies an OpenCode model itself before it starts one. openCodeModelLaunchSupported: true }) if ('refusal' in checked) { @@ -107,7 +107,7 @@ export function hasLaunchModelFlags(flags: Flags): boolean { // An older host strips `surface` and follows its own setting, so an explicit pick never reaches it. export const SURFACE_UNSUPPORTED_MESSAGE = - 'This Orca host cannot start an agent as a chat or a terminal on request. Update Orca on the execution host, or omit --surface.' + 'This Orca server cannot start an agent as a chat or a terminal on request. Update Orca on that server, or omit --surface.' export async function getAgentLaunchCapabilities( client: RuntimeClient @@ -128,13 +128,13 @@ export async function callAgentLaunch( if (launch.operationId && !replaySupported) { throw new RuntimeClientError( 'agent_session_operation_unknown', - 'This host cannot replay the earlier launch. Return to the original execution host; do not retry without --retry-launch.' + 'This server cannot replay the earlier launch. Return to the server that started it; do not retry without --retry-launch.' ) } if (launch.prompt && !capabilities.includes(AGENT_LAUNCH_PROMPT_CARRY_RUNTIME_CAPABILITY)) { throw new RuntimeClientError( 'incompatible_runtime', - 'This Orca host cannot safely carry launch prompts. Update Orca on the execution host.' + 'This Orca server cannot safely carry launch prompts. Update Orca on that server.' ) } if (launch.surface && !capabilities.includes(AGENT_LAUNCH_SURFACE_RUNTIME_CAPABILITY)) { @@ -143,7 +143,7 @@ export async function callAgentLaunch( if (!capabilities.includes(AGENT_LAUNCH_LOCAL_PRESENTATION_RUNTIME_CAPABILITY)) { throw new RuntimeClientError( 'incompatible_runtime', - 'This Orca host cannot honor CLI launch focus or background behavior. Update Orca on the execution host.' + 'This Orca server cannot honor CLI launch focus or background behavior. Update Orca on that server.' ) } const operationId = replaySupported diff --git a/src/cli/agent-session-search-format.test.ts b/src/cli/agent-session-search-format.test.ts index dc37e2792e9..22fe56986a4 100644 --- a/src/cli/agent-session-search-format.test.ts +++ b/src/cli/agent-session-search-format.test.ts @@ -46,12 +46,7 @@ describe('terminal safety', () => { { updatedAt: '2026-09-12\u001b[31mT18:04:11.000Z' }, 'Claude 2026-09-12T18:04:11.000Z' ], - [ - 'executionHostId', - { executionHostId: 'ssh:\u001b]0;pwned\u0007build-01' }, - 'host=ssh:build-01' - ], - ['title', { title: 'resize\u001b[2Jrace' }, ' resizerace host='], + ['title', { title: 'resize\u001b[2Jrace' }, ' resizerace\n'], [ 'evidence snippet', { evidence: { ...localHit.evidence!, snippet: 'a\u001b[1mb' } }, @@ -125,7 +120,7 @@ describe('terminal safety', () => { ] }) ) - expect(text).toContain('Claude 2026-09-12T18:04:11.000Z wrapped title host=ssh:build-01') + expect(text).toContain('Claude 2026-09-12T18:04:11.000Z wrapped title\n') expect(text).toContain(' assistant: first second') }) }) diff --git a/src/cli/agent-session-search-format.ts b/src/cli/agent-session-search-format.ts index d14c96b0dbd..a48ed71fd9d 100644 --- a/src/cli/agent-session-search-format.ts +++ b/src/cli/agent-session-search-format.ts @@ -18,12 +18,10 @@ function oneLine(value: string): string { } function formatHit(hit: AiVaultSearchHit): string { - const host = oneLine(hit.executionHostId ?? '') const header = [ aiVaultAgentLabel(hit.agent), oneLine(hit.updatedAt ?? '') || 'unknown time', - oneLine(hit.title) || '(untitled)', - ...(host ? [`host=${host}`] : []) + oneLine(hit.title) || '(untitled)' ].join(' ') const evidence = hit.evidence ? ` ${hit.evidence.role}: ${oneLine(hit.evidence.snippet)}` @@ -65,21 +63,21 @@ function formatUnavailable( reason: 'disabled' | 'not-ready' | 'no-service' | 'scope-unknown' | 'unsupported-agent' ): string { if (reason === 'disabled') { - return 'Session search is off on this host.' + return 'Session search is off on this server.' } if (reason === 'unsupported-agent') { - return 'This host does not support history search for the selected agent. Update Orca on that host or select another agent.' + return 'This server does not support history search for the selected agent. Update Orca on that server or select another agent.' } // Only hand-built requests can select an unknown identity; the CLI scopes by path. if (reason === 'scope-unknown') { - return 'This host does not know the workspace or project that search was scoped to.' + return 'This server does not know the workspace or project that search was scoped to.' } if (reason === 'not-ready') { - return 'Session search is not ready on this host yet. Try again once its index has started.' + return 'Session search is not ready on this server yet. Try again once its index has started.' } return [ - 'This host runs no session search service.', - 'An Orca host older than session search answers the same way; update it and try again.' + 'This server runs no session search service.', + 'An Orca server older than session search answers the same way; update it and try again.' ].join('\n') } @@ -92,7 +90,7 @@ function formatResults(response: SessionSearchResults): string { ...(response.page.hasMore && cursor ? [`more pages: re-run with --cursor ${cursor}`] : response.page.hasMore - ? ['more pages exist, but this host issued no cursor for them'] + ? ['more pages exist, but this server issued no cursor for them'] : []), ...formatTruncation(response.truncated) ] diff --git a/src/cli/args.test.ts b/src/cli/args.test.ts index f54aee5efc5..ad2f770016b 100644 --- a/src/cli/args.test.ts +++ b/src/cli/args.test.ts @@ -224,21 +224,21 @@ describe('validateCommandAndFlags', () => { 'demo', '--pairing-code', 'remote-runtime', - '--environment', - 'server', + '--server', + 'build-box', '--json' ]) expect(() => validateCommandAndFlags(specs, parsed)).not.toThrow() }) - it.each(['environment', 'pairing-code'])('rejects --%s without a value', (flag) => { + it.each(['server', 'pairing-code'])('rejects --%s without a value', (flag) => { const parsed = parseArgs([`--${flag}`, 'demo'], [['demo']]) expect(() => validateCommandAndFlags(specs, parsed)).toThrow(`Flag --${flag} requires a value.`) }) - it.each(['environment', 'pairing-code'])('rejects an empty --%s= value', (flag) => { + it.each(['server', 'pairing-code'])('rejects an empty --%s= value', (flag) => { const parsed = parseArgs(['demo', `--${flag}=`]) expect(() => validateCommandAndFlags(specs, parsed)).toThrow(`Flag --${flag} requires a value.`) diff --git a/src/cli/args.ts b/src/cli/args.ts index f7083e67601..aaae0440869 100644 --- a/src/cli/args.ts +++ b/src/cli/args.ts @@ -1,8 +1,9 @@ import { RuntimeClientError } from './runtime/types' import { unknownCommandData, unknownFlagData } from './command-suggestion' -import { specPaths, type CommandSpec } from './command-spec' +import { INPUT_ONLY_FLAGS, specPaths, type CommandSpec } from './command-spec' import { CLI_BOOLEAN_FLAGS, + CLI_FLAG_ALIASES, CLI_GLOBAL_FLAGS, CLI_GLOBAL_VALUE_FLAGS, findCliCommandIndex @@ -15,6 +16,8 @@ export type ParsedArgs = { commandPath: string[] flags: Map positionalFlagConflicts?: string[] + /** Canonical flags given under both spellings with different values. */ + flagAliasConflicts?: { flag: string; alias: string }[] } export const GLOBAL_FLAGS = CLI_GLOBAL_FLAGS @@ -171,11 +174,71 @@ export function isCommandGroup(specs: CommandSpec[], commandPath: string[]): boo ) } -export function normalizeCommandPositionals(specs: CommandSpec[], parsed: ParsedArgs): ParsedArgs { +/** Raw argv with old flag spellings renamed, so commands rebuilt from argv print only canonical flags. */ +export function canonicalizeLegacyFlagArgv(argv: readonly string[]): string[] { + const end = argv.indexOf('--') + return argv.map((token, index) => { + if ((end !== -1 && index >= end) || !token.startsWith('--')) { + return token + } + const [name, ...value] = token.slice(2).split('=') + const canonical = CLI_FLAG_ALIASES[name] + return canonical === undefined ? token : [`--${canonical}`, ...value].join('=') + }) +} + +/** Renames old flag spellings so every later reader sees only canonical flags. */ +function canonicalizeFlagAliases(parsed: ParsedArgs): ParsedArgs { + if (!Object.keys(CLI_FLAG_ALIASES).some((alias) => parsed.flags.has(alias))) { + return parsed + } + const flags = new Map() + const conflicts: { flag: string; alias: string }[] = [] + for (const [name, value] of parsed.flags) { + const canonical = CLI_FLAG_ALIASES[name] + if (canonical === undefined) { + flags.set(name, value) + } else if (!parsed.flags.has(canonical)) { + flags.set(canonical, value) + } else if (parsed.flags.get(canonical) !== value) { + conflicts.push({ flag: canonical, alias: name }) + } + } + return { + ...parsed, + flags, + ...(conflicts.length > 0 ? { flagAliasConflicts: conflicts } : {}) + } +} + +/** A group typed under an alias (`orca environment`) names the canonical group (`orca server`). */ +function canonicalizeGroupAlias(specs: CommandSpec[], parsed: ParsedArgs): ParsedArgs { + const path = parsed.commandPath + if (path.length === 0 || isCanonicalPrefix(specs, path)) { + return parsed + } + for (const spec of specs) { + for (const alias of [...(spec.aliases ?? []), ...(spec.legacyAliases ?? [])]) { + if (alias.length > path.length && matches(alias.slice(0, path.length), path)) { + return { ...parsed, commandPath: spec.path.slice(0, path.length) } + } + } + } + return parsed +} + +function isCanonicalPrefix(specs: CommandSpec[], path: string[]): boolean { + return specs.some( + (spec) => spec.path.length >= path.length && matches(spec.path.slice(0, path.length), path) + ) +} + +export function normalizeCommandPositionals(specs: CommandSpec[], input: ParsedArgs): ParsedArgs { + const parsed = canonicalizeFlagAliases(input) for (const spec of specs) { const positionalArgs = spec.positionalArgs ?? [] // Alias-only paths still need canonicalization without positional arguments. - if (positionalArgs.length === 0 && !spec.aliases) { + if (positionalArgs.length === 0 && !spec.aliases && !spec.legacyAliases) { continue } for (const base of specPaths(spec)) { @@ -203,10 +266,10 @@ export function normalizeCommandPositionals(specs: CommandSpec[], parsed: Parsed setFlagValue(flags, name, value, new Set(spec.repeatableFlags ?? [])) } }) - return { commandPath: spec.path, flags, positionalFlagConflicts } + return { ...parsed, commandPath: spec.path, flags, positionalFlagConflicts } } } - return parsed + return canonicalizeGroupAlias(specs, parsed) } export function findCommandSpec( @@ -243,6 +306,14 @@ export function validateCommandAndFlags(specs: CommandSpec[], parsed: ParsedArgs ) } + const aliasConflict = parsed.flagAliasConflicts?.[0] + if (aliasConflict) { + throw new RuntimeClientError( + 'invalid_argument', + `--${aliasConflict.flag} and --${aliasConflict.alias} name different values; pass only --${aliasConflict.flag}.` + ) + } + const pageAllowed = supportsBrowserPageFlag(spec) const repeatable = new Set([...REPEATABLE_STRING_FLAGS, ...(spec.repeatableFlags ?? [])]) for (const [flag, value] of parsed.flags) { @@ -254,7 +325,10 @@ export function validateCommandAndFlags(specs: CommandSpec[], parsed: ParsedArgs throw new RuntimeClientError( 'invalid_argument', `Unknown flag --${flag} for command: ${spec.path.join(' ')}`, - unknownFlagData(flag, effectiveAllowedFlags(spec)) + unknownFlagData( + flag, + effectiveAllowedFlags(spec).filter((name) => !INPUT_ONLY_FLAGS.has(name)) + ) ) } if (repeatable.has(flag) && !BOOLEAN_FLAGS.has(flag) && typeof value !== 'string') { diff --git a/src/cli/automation-destination.ts b/src/cli/automation-destination.ts index ffddcb351ae..218716b1db2 100644 --- a/src/cli/automation-destination.ts +++ b/src/cli/automation-destination.ts @@ -14,7 +14,7 @@ import { listEnvironments } from '../shared/remote-runtime/host-store/runtime-en import { RuntimeClient } from './runtime-client' import { fetchSshTargetSummaries } from './host-selector-alternatives' -/** Empty selectors mean the execution host cannot change. */ +/** Empty selectors mean the server cannot change. */ export type AutomationDestinationTarget = { repo?: string; workspace?: string } async function resolveTargetRepo( diff --git a/src/cli/automation-format.ts b/src/cli/automation-format.ts index 844d2b2a0cd..cde22c6aa02 100644 --- a/src/cli/automation-format.ts +++ b/src/cli/automation-format.ts @@ -8,6 +8,7 @@ import { getAutomationLegacyRepoId } from '../shared/automations/history/automat import { formatAutomationPrecheckTimeout } from '../shared/automations/launch/automation-precheck' import { formatAutomationSchedule } from '../shared/automations/scheduling/automation-schedules' import { quoteCliCommandArgument } from './shell-command-quote' +import { serverLabel, type WorkspaceServer } from './row-owner-server' export type AutomationListPayload = { automations: Automation[] @@ -21,24 +22,26 @@ export type AutomationShowPayload = { owner?: AutomationOwnerPrecondition } -const ORPHAN_HOST_LABEL = 'orphan (no host can run this automation)' - -function formatOwnerSelector(selector: AutomationOwnerPrecondition['selector']): string { +/** `self` is the answering server; an SSH owner is not proven to be an Orca server, so it is not named. */ +function formatOwnerServer( + selector: AutomationOwnerPrecondition['selector'] | AutomationListItem['selector'], + answering: WorkspaceServer | undefined, + orphanIssue: string +): string { if (selector.kind === 'ssh') { - return `ssh:${selector.targetId} (generation ${selector.targetGeneration})` + return `unknown (SSH connection ssh:${selector.targetId}, generation ${selector.targetGeneration})` } - return selector.kind === 'orphan' ? ORPHAN_HOST_LABEL : 'self' + if (selector.kind === 'orphan') { + return `none (orphan: ${orphanIssue})` + } + return answering ? serverLabel(answering) : 'self' } -function formatListItemSelector(item: AutomationListItem): string { - const selector = item.selector - if (selector.kind === 'ssh') { - return `ssh:${selector.targetId} (generation ${selector.targetGeneration})` - } - return selector.kind === 'orphan' ? `orphan — ${selector.issue}` : 'self' -} - -export function formatAutomationList(result: AutomationListPayload): string { +/** `answering` is the server that answered, which owns its `self` automations. */ +export function formatAutomationList( + result: AutomationListPayload, + answering?: WorkspaceServer +): string { if (result.automations.length === 0) { return 'No automations found.' } @@ -47,13 +50,18 @@ export function formatAutomationList(result: AutomationListPayload): string { .map((automation) => { const status = automation.enabled ? 'enabled' : 'disabled' const item = hosts.get(automation.id) - const host = item ? `\nhost: ${formatListItemSelector(item)}` : '' - return `${automation.id} ${automation.name} ${automation.agentId} ${status}\n${formatAutomationSchedule(automation.rrule)} next: ${new Date(automation.nextRunAt).toISOString()}${host}` + const server = item + ? `\nserver: ${formatOwnerServer(item.selector, answering, item.selector.kind === 'orphan' ? item.selector.issue : '')}` + : '' + return `${automation.id} ${automation.name} ${automation.agentId} ${status}\n${formatAutomationSchedule(automation.rrule)} next: ${new Date(automation.nextRunAt).toISOString()}${server}` }) .join('\n\n') } -export function formatAutomationShow(result: AutomationShowPayload): string { +export function formatAutomationShow( + result: AutomationShowPayload, + answering?: WorkspaceServer +): string { const automation = result.automation const runContext = automation.runContext ?? null const projectLines = runContext @@ -92,7 +100,11 @@ export function formatAutomationShow(result: AutomationShowPayload): string { `baseBranch: ${automation.baseBranch ?? 'null'}`, `reuseSession: ${automation.reuseSession}`, `target: ${automation.executionTargetType}:${automation.executionTargetId}`, - ...(result.owner ? [`host: ${formatOwnerSelector(result.owner.selector)}`] : []), + ...(result.owner + ? [ + `server: ${formatOwnerServer(result.owner.selector, answering, 'no server can run this automation')}` + ] + : []), `prompt: ${automation.prompt}` ].join('\n') } @@ -141,11 +153,11 @@ function formatAutomationRunFollowUp( !target.environment.startsWith('--') && (process.platform !== 'win32' || /^[a-zA-Z0-9._:/@ -]+$/.test(target.environment)) if (target.environment && safeEnvironment) { - command.push('--environment', quoteCliCommandArgument(target.environment)) + command.push('--server', quoteCliCommandArgument(target.environment)) } const prefix = target.preserveConnectionSettings || (target.environment && !safeEnvironment) - ? 'Follow up on the same host and profile (preserve your connection/profile settings)' + ? 'Follow up on the same server and profile (preserve your connection/profile settings)' : 'Follow up' return `${prefix}: ${command.join(' ')}` } diff --git a/src/cli/automation-owner-conflict-recovery.ts b/src/cli/automation-owner-conflict-recovery.ts index 9007fe2af4e..b918f772b69 100644 --- a/src/cli/automation-owner-conflict-recovery.ts +++ b/src/cli/automation-owner-conflict-recovery.ts @@ -9,20 +9,20 @@ export type AutomationOwnerConflictRecovery = { nextSteps: readonly string[] } const RECOVERY: Record = { [AUTOMATION_OWNER_CONFLICT_CODES.ownerChanged]: [ - 'The automation moved to a different host between the read and the write.', - 'Run the command again; it captures the current host on each attempt.' + 'The automation moved to a different owner between the read and the write.', + 'Run the command again; it captures the current owner on each attempt.' ], [AUTOMATION_OWNER_CONFLICT_CODES.targetRemoved]: [ 'This automation is pinned to an SSH host that is no longer registered, so it cannot run and retrying will not change that.', 'Re-add that SSH host, or delete the automation with `orca automations remove --id `.' ], [AUTOMATION_OWNER_CONFLICT_CODES.fencingRequired]: [ - 'The host accepted the request but did not report which host owns the automation, so the CLI had no owner to send.', - 'Update Orca on the host, then run the command again.' + 'The server accepted the request but did not report who owns the automation, so the CLI had no owner to send.', + 'Update Orca on the server, then run the command again.' ], [AUTOMATION_OWNER_CONFLICT_CODES.invalidDestination]: [ - 'The host this command targets is not registered on the authority that stores the automation.', - 'Run `orca automations show --id ` to see where it lives, then target a host that authority knows.' + 'The owner this command targets is not registered on the server that stores the automation.', + 'Run `orca automations show --id ` to see where it lives, then target an owner that server knows.' ] } diff --git a/src/cli/browser/browser-command-target.ts b/src/cli/browser/browser-command-target.ts index 80cab8468a5..f0907f590eb 100644 --- a/src/cli/browser/browser-command-target.ts +++ b/src/cli/browser/browser-command-target.ts @@ -40,7 +40,7 @@ async function getEnforceableExpectUrl( if (!status.result.capabilities?.includes(BROWSER_EXPECT_URL_RUNTIME_CAPABILITY)) { throw new RuntimeClientError( 'incompatible_runtime', - 'This Orca runtime cannot check --expect-url yet. Update Orca on it or drop the flag.' + 'This Orca server cannot check --expect-url yet. Update Orca on it or drop the flag.' ) } return expectUrl diff --git a/src/cli/browser/browser-identity.ts b/src/cli/browser/browser-identity.ts index d89c42808a9..9b15580cf16 100644 --- a/src/cli/browser/browser-identity.ts +++ b/src/cli/browser/browser-identity.ts @@ -15,7 +15,7 @@ async function assertBrowserIdentitySupported({ client }: HandlerContext): Promi if (!status.result.capabilities?.includes(BROWSER_IDENTITY_RUNTIME_CAPABILITY)) { throw new RuntimeClientError( 'incompatible_runtime', - 'The running Orca runtime does not support browser identity management. Update or restart Orca and try again.' + 'The running Orca server does not support browser identity management. Update or restart Orca and try again.' ) } } diff --git a/src/cli/bundled-skill-guides.ts b/src/cli/bundled-skill-guides.ts index c5d92714523..7d82e351f74 100644 --- a/src/cli/bundled-skill-guides.ts +++ b/src/cli/bundled-skill-guides.ts @@ -127,7 +127,7 @@ const LINEAR_TICKETS_MARKDOWN = [ "", "- Omitting `--limit` returns every match and reports `result.meta.limit` as `null`, so filter before listing a large workspace. `--limit ` caps the read.", "- When a cap held results back, `--json` sets `result.truncated` and `result.meta.hasMore`; human output prints `truncated: showing N`. Check `truncated` before reporting a count, then page with `--cursor` until it is false.", - "- A `--cursor` is bound to the workspace and the Orca runtime that issued it. `--workspace all` cannot page, and a raw Linear cursor still needs a concrete `--workspace`.", + "- A `--cursor` is bound to the workspace and the Orca server that issued it. `--workspace all` cannot page, and a raw Linear cursor still needs a concrete `--workspace`.", "- `--priority` is `0=none`, `1=urgent`, `2=high`, `3=medium`, `4=low`. Issue JSON carries `priorityLabel` in the CLI setter vocabulary; project JSON keeps Linear's title-case label.", "- `ORCA linear search`, `ORCA linear list`, and `ORCA linear project list` cap at their own `--limit` and set `result.truncated` the same way.", "", @@ -274,7 +274,7 @@ const ORCA_CLI_MARKDOWN = [ "ORCA worktree create --name --no-parent --agent codex --model gpt-6-astra --effort high --prompt \"\" --json", "```", "", - "Read what started from `result.launch`: `outcome.kind` is `structured` (a chat) or `terminal`, `outcome.handle` is the agent handle, `receipt.detail` says why, and `prompt.outcome` says whether the brief arrived. An Orca host older than this returns the terminal handle in `result.agentTerminalHandle` and refuses `--model`/`--effort`.", + "Read what started from `result.launch`: `outcome.kind` is `structured` (a chat) or `terminal`, `outcome.handle` is the agent handle, `receipt.detail` says why, and `prompt.outcome` says whether the brief arrived. An Orca server older than this returns the terminal handle in `result.agentTerminalHandle` and refuses `--model`/`--effort`.", "", "For a fresh agent in a worktree that already exists, use `agent launch`, which takes the same `--prompt`, `--model` and `--effort`:", "", @@ -292,7 +292,7 @@ const ORCA_CLI_MARKDOWN = [ "", "`worktree create --agent` (new checkout) and `agent launch` (existing worktree) are how to start an agent. They go through Orca's agent launch, the same one the app's new-agent tab uses: the user's Chat | CLI choice for that agent decides whether it opens as a chat or a terminal, and the result reports which (`outcome.kind`) and why (`receipt.detail`). When a chat is not possible, such as for an agent without chat support, the launch starts a terminal and the receipt says so. `--surface chat|terminal` picks one for that launch instead of the setting; pass it only when the user asked for a chat or a terminal. `--surface chat` is refused when Orca can establish before starting anything that the agent cannot open as a chat. If support cannot be checked, the launch can fall back to a terminal. If chat becomes unavailable only after a new workspace is created, Orca keeps that workspace, its setup and default tabs, then opens a terminal; the receipt explains the fallback. `terminal create` makes a terminal for shells and commands.", "", - "If a launch reply is lost, use the returned `operationId` to re-issue the exact same command from the same directory against the same execution host with `--retry-launch `. Keep that ID on every retry: the host replays the accepted launch instead of starting another agent or submitting the brief twice. Do not retry as a fresh launch. If replay says the outcome is unknown or expired, or an older host gives no replay ID, inspect the workspace and agent without sending input before deciding whether another launch is needed. A host that cannot safely carry prompts or honor background/focus requests is refused before launch; update Orca on that execution host.", + "If a launch reply is lost, use the returned `operationId` to re-issue the exact same command from the same directory against the same server with `--retry-launch `. Keep that ID on every retry: the server replays the accepted launch instead of starting another agent or submitting the brief twice. Do not retry as a fresh launch. If replay says the outcome is unknown or expired, or an older server gives no replay ID, inspect the workspace and agent without sending input before deciding whether another launch is needed. A server that cannot safely carry prompts or honor background/focus requests is refused before launch; update Orca on that server.", "", "## Worktrees", "", @@ -300,7 +300,7 @@ const ORCA_CLI_MARKDOWN = [ "", "Its id is a two-part address, `::`, such as `repo-123::/Users/me/orca/fix-login`. Copy the whole `id` field from `ORCA worktree create --json` or `ORCA worktree list --json`. `repo-123` alone names only the repo.", "", - "For local creation, omit `--repo` and `--project` to stay in the caller's project. Use `--parent-worktree active` for a child of the current workspace. Project selection and parent selection are separate: a native folder parent supplies lineage, not a Git destination, so pass an explicit Git target when creating from a folder outside any managed checkout. Otherwise, pass `--repo` or `--project` only when deliberately creating in another project, or when Orca asks you to disambiguate. Outside any Orca-managed project, pass an explicit target. With a paired server, discover and use that server's exact target instead of the local cwd.", + "For local creation, omit `--repo` and `--project` to stay in the caller's project. Use `--parent-worktree active` for a child of the current workspace. Project selection and parent selection are separate: a native folder parent supplies lineage, not a Git destination, so pass an explicit Git target when creating from a folder outside any managed checkout. Otherwise, pass `--repo` or `--project` only when deliberately creating in another project, or when Orca asks you to disambiguate. Outside any Orca-managed project, pass an explicit target. With `--server`, discover and use that server's exact target instead of the local cwd.", "", "If several Orca workspaces share the checkout and no caller identity selects one, workspace-specific commands ask you to choose an exact selector. Inspect a listed workspace with `ORCA worktree show --worktree --json`, then use the command’s workspace target flag. For an implicit-create refusal, use `ORCA worktree list --limit 10000 --json` with the same server and host selection; match path and host, increasing --limit if truncated. Pass `--parent-worktree ` or deliberately use `--no-parent` on a fresh request without --retry-launch. Retrying the refused ID returns its original explanation. Pass each exact selector as one argument quoted for your shell. Native folder choices are shown in the local error; exact show inspection is supported, while native folders are not enumerated by worktree list. Implicit creation checks this only when the host actually uses the directory’s parent context; older hosts retain their existing implicit-parent behavior.", "", @@ -348,9 +348,9 @@ const ORCA_CLI_MARKDOWN = [ "ORCA worktree rm --worktree id::: --force --json", "```", "", - "`repo add` defaults to Git. Use `--kind folder` for an ordinary directory or a parent of separate Git repositories; worktrees attached to a folder workspace appear in its Source Control panel, one section each. With `--environment`, pass an absolute path on that server.", + "`repo add` defaults to Git. Use `--kind folder` for an ordinary directory or a parent of separate Git repositories; worktrees attached to a folder workspace appear in its Source Control panel, one section each. With `--server`, pass an absolute path on that server.", "", - "Ports: `ORCA ports --json` lists the listening ports Orca tied to the current workspace (`--worktree ` for another one, `--all` for every listener on that workspace's host). Each row has `port`, `pid`, `processName`, `connectHost`, `protocol`, and `kind` (`workspace`, `container`, or `external`). Only `workspace` rows have `owner` (with `owner.confidence`: `cwd` or `command`) and, when the dev server printed one in an Orca terminal, `advertisedUrl`. Use this to find a dev server's port instead of running `lsof` yourself. If `unavailableReason` is set, the scan could not run on that host. Native folder workspaces need `--all`, because Orca does not tie ports to them. SSH workspaces opened directly from this app report `unavailableReason` for now; a workspace on a managed Orca server is scanned on that server.", + "Ports: `ORCA ports --json` lists the listening ports Orca tied to the current workspace (`--worktree ` for another one, `--all` for every listener on that workspace's server). Each row has `port`, `pid`, `processName`, `connectHost`, `protocol`, and `kind` (`workspace`, `container`, or `external`). Only `workspace` rows have `owner` (with `owner.confidence`: `cwd` or `command`) and, when the dev server printed one in an Orca terminal, `advertisedUrl`. Use this to find a dev server's port instead of running `lsof` yourself. If `unavailableReason` is set, the scan could not run on that server. Native folder workspaces need `--all`, because Orca does not tie ports to them. SSH workspaces opened directly from this app report `unavailableReason` for now; a workspace on a managed Orca server is scanned on that server.", "", "Use `repo set --external-worktree-visibility show` to show a repo's non-Orca worktrees.", "`hide` hides them; `inherit` clears the repo override and follows the global default.", @@ -362,11 +362,12 @@ const ORCA_CLI_MARKDOWN = [ "- `folder:` names a folder workspace, for commands that take one (`worktree activate` doesn't yet). On a folder workspace, `worktree set` changes `--display-name`, `--comment`, `--workspace-status` and `--unread`/`--read` (links go through `reference add`), and `worktree rm` makes Orca forget it while the folder stays on disk. `path:` and `name:` also match folder workspaces, so `--worktree path:` reaches the folder; `branch:`, `issue:` and `identity:` match worktrees only. `ORCA worktree ps --json` lists folder workspaces; `worktree list` does not.", "- Older Orca versions match `path:` and `name:` against worktrees only, and may pick a worktree at the folder's path. If a folder is meant, pass `folder:`.", "- When several workspaces match, the error usually lists each choice's kind, host, path and exact selector; pass one of those. If it lists none, find the row with `ORCA worktree ps --json` (if `truncated`, repeat with `--limit `) and pass `identity:`, `folder:`, or `id:` when no other row has that id. A folder id that two folder workspaces share can't be selected; the error says how to repair it.", - "- For a workspace in another environment, add `--environment ` to the command, as with any other selector.", + "- For a workspace on another server, add `--server ` to the command, as with any other selector.", "- The full id is the exact `::` value returned by `ORCA worktree create --json` or `ORCA worktree list --json`; a bare repo id is not a worktree id.", - "- `active` / `current` for the Orca workspace enclosing the shell cwd, worktree or folder workspace: the innermost one wins, so a worktree nested inside a folder workspace is picked over the folder; at equal depth this terminal's own workspace wins, otherwise the error lists the choices. Pass `folder:` to get the folder itself. `worktree rm` refuses `current`/`active` and needs an explicit selector; its error prints the one `current` resolves to. `current` resolves on this machine's Orca, so it is refused with `--environment ` or `--pairing-code`; use an explicit selector from that environment instead (`--environment local` keeps it on this machine even when `ORCA_ENVIRONMENT` is set).", - "- `--environment` selects which Orca receives the command (`local` is this machine's own Orca); `host` is that Orca's stored location metadata. Never derive an environment from `host`.", - "- `worktree ps` and `worktree show` give each workspace an `address` (text: an `address:` line). Copy `address.line` as is, keeping its `--environment`, or pass `address.environment` and `address.worktree` as `--environment` and `--worktree`. If `address` is null, follow `addressUnavailable` (`one-off-connection`, `unverifiable-row` or `duplicate-folder-id`) and never construct a route yourself. `parent` names the parent's environment when it is known; with `state: unknown-environment` there is no route to it from here.", + "- `active` / `current` for the Orca workspace enclosing the shell cwd, worktree or folder workspace: the innermost one wins, so a worktree nested inside a folder workspace is picked over the folder; at equal depth this terminal's own workspace wins, otherwise the error lists the choices. Pass `folder:` to get the folder itself. `worktree rm` refuses `current`/`active` and needs an explicit selector; its error prints the one `current` resolves to. `current` resolves on the Orca on this computer, so it is refused with `--server ` or `--pairing-code`; use an explicit selector from that server instead (`--server local` keeps it on this computer even when `ORCA_ENVIRONMENT` is set).", + "- `--server` selects which Orca server receives the command: `local` is the Orca on this computer, any other value is a saved server's id or name (`ORCA server list`).", + "- A row's `server` (text: `server:` in `ps`/`show`, `server=` in `worktree list`, `terminal list`, `project setups` and worker lines) is the server that owns it. `server=unknown (...)` means Orca cannot verify the owner from here; it never guesses `local`, so don't treat that row's paths as files on this computer. JSON `hostId` is raw stored data; never build a route from it.", + "- `worktree ps` and `worktree show` give each workspace an `address` (text: an `address:` line): the server that answered plus a selector it accepts, which can differ from the owning `server`. Copy `address.line` as is, or pass `address.server` and `address.worktree` as `--server` and `--worktree`. If `address` is null, follow `addressUnavailable` (`one-off-connection`, `unverifiable-row` or `duplicate-folder-id`) and never construct a route yourself. `parent.server` names the parent's server when it is known; with `parent.state: unknown-server` there is no route to it from here.", "- For `worktree create --parent-worktree`, folder/worktree parent context keys are also valid: `folder:`, `worktree:::`, `id:folder:`, `id:worktree:::`. `worktree set --parent-worktree` also takes the folder keys, `folder:` or `id:folder:`. On both, `path:` and `name:` record a folder workspace parent when they match one.", "", "Lineage rules:", @@ -375,9 +376,9 @@ const ORCA_CLI_MARKDOWN = [ "- Use `--parent-worktree active` when the child worktree relationship should be explicit.", "- Use `--parent-worktree folder:` or `--parent-worktree worktree:::` when a folder or worktree parent context should be explicit.", "- Use `--no-parent` only when the new work is independent.", - "- A parent can be in a different project from its child, such as `worktree create --repo id: --name related-task --parent-worktree id:::`. A worktree parent and child must use the same execution host (local machine, SSH target, or paired server).", - "- `--parent-worktree` is looked up in the child's environment. For a parent in another environment, add `--parent-environment `: to reuse a workspace from `ps`/`show` as a parent, pass its `address.environment` as `--parent-environment` and its `address.worktree` as `--parent-worktree`. Orca never searches other environments; a parent missing there is an error. `active`/`current` always mean this machine's own workspace, so they take only `--parent-environment local`.", - "- An address with `--environment local` means the Orca that printed it, because `local` is always the machine running the command; don't hand an address to another machine to run. To link workspaces across environments, run the command from the Orca that has both paired, such as `--environment --worktree --parent-worktree current`.", + "- A parent can be in a different project from its child, such as `worktree create --repo id: --name related-task --parent-worktree id:::`. A parent can also be on another server: name it with `--parent-server`. The child's server must support parents on other servers; an older one refuses before changing anything.", + "- `--parent-worktree` is looked up on the child's server. For a parent on another server, add `--parent-server `: to reuse a workspace from `ps`/`show` as a parent, pass its `address.server` as `--parent-server` and its `address.worktree` as `--parent-worktree`. Orca never searches other servers; a parent missing there is an error. `active`/`current` always mean a workspace on this computer, so they take only `--parent-server local`.", + "- An address with `--server local` means the Orca that printed it, because `local` is always the computer running the command; don't hand an address to another computer to run. To link workspaces across servers, run the command from the Orca that has both saved, such as `--server --worktree --parent-worktree current`.", "- To move an existing worktree under a different parent, or make it top-level, use `worktree set` with `--parent-worktree ` or `--no-parent`.", "- `--no-parent` only controls Orca lineage; it does not choose the Git base. For independent top-level work, omit `--base-branch` so Orca uses the repo default base, or explicitly pass the repo default base. Never base it on the current feature branch unless the user asks for stacked work or \"branch from current\".", "", @@ -476,13 +477,13 @@ const ORCA_CLI_MARKDOWN = [ "", "- `--terminal` is optional for most commands; omitted means the active terminal in the current worktree.", "- Use `terminal close --terminal ` to close one terminal. Use `terminal close --worktree --all` to stop every terminal process in exactly that workspace and durably remove its terminal tabs, layouts, and agent-resume records.", - "- A bulk close fails when the execution host cannot confirm every PTY stopped. Treat that as `unverifiable`; do not report the processes as exited or retry against another host.", + "- A bulk close fails when the server cannot confirm every PTY stopped. Treat that as `unverifiable`; do not report the processes as exited or retry against another server.", "- Use workspace Sleep, not close, when the terminals and agent sessions should resume later. `terminal stop` is legacy compatibility plumbing and should not be used in new agent workflows.", "- `terminal list --json` omits `visualLayouts` to keep the common agent payload bounded. Add `--include-visual-layouts` only when tab and pane topology is required.", "- A chat tab has no terminal handle, so `terminal rename` cannot rename it. Use `ORCA chat rename --session --name \"New Name\" --json` with the `sessionId` `agent launch` printed; inside a chat, omit `--session` to rename that chat.", "- `terminal create --title` and `terminal rename` set the tab title, which `terminal list` reports under `visualLayouts`. `terminal set-pane-title` sets one pane's title, reported as `terminals[].paneTitle`. `terminals[].title` may be the tab title or the running program's own title, which agents repaint constantly, so never match on it to re-find a terminal.", "- `terminals[].agentIdentity`, when present, is only the agent type (e.g. `codex`), not a session identity, so two Codex panes share it. To find a specific agent's terminal, join `worktree ps --json` `agents[].paneKey` (`:`) to the `tabId` and `leafId` of a `terminal list` row to get its handle.", - "- A paired server has no window. `terminal switch --environment ` moves the desktop app on this machine to that server's terminal, and reports `navigated: false` when no desktop here shows that server.", + "- A server reached with `--server` has no window. `terminal switch --server ` moves the desktop app on this computer to that server's terminal, and reports `navigated: false` when no desktop here shows that server.", "- Use `terminal read` before `terminal send` unless the next input is obvious.", "- `terminal read` returns accumulated output with escape sequences stripped, not the rendered screen, so anything that repaints (shells, progress bars, TUIs) reads as stacked fragments. Use `--screen` whenever the answer depends on what the terminal actually shows.", "- `--screen` and `--cursor` are mutually exclusive: a screen read is the current frame and has no history to page.", @@ -553,7 +554,7 @@ const ORCA_CLI_MARKDOWN = [ "", "## Agent Session Search", "", - "`ORCA search` runs a full-text search over the agent sessions indexed on one Orca host: this machine, or the paired server named by `--environment` or `--pairing-code`. There is no all-computers search.", + "`ORCA search` runs a full-text search over the agent sessions indexed on one Orca server: the Orca on this computer, or the server named by `--server` or `--pairing-code`. There is no all-servers search.", "", "Common commands:", "", @@ -563,7 +564,7 @@ const ORCA_CLI_MARKDOWN = [ "ORCA search \"blank restore\" --agent codex --since 2026-09-01T00:00:00Z --json", "ORCA search \"blank restore\" --path /abs/worktree --sort newest --limit 50 --json", "ORCA search \"blank restore\" --cursor --json", - "ORCA search \"blank restore\" --environment --json", + "ORCA search \"blank restore\" --server --json", "ORCA search \"blank restore\" --fresh --debug --json", "ORCA search --index-status --json", "```", @@ -818,7 +819,7 @@ const ORCA_CLI_PLUGINS_REFERENCE_MARKDOWN = [ " (see `docs/reference/plugin-declarative-ui.md`, \"Testing\"). Both run the plugin's code", " unsandboxed on this machine: use them only on code you trust.", "4. `plugin dev load ` adds the folder to Settings → Plugins → Development folders on the", - " Orca host and loads it. Orca reloads it, and restarts its worker, when its files change; run", + " Orca server and loads it. Orca reloads it, and restarts its worker, when its files change; run", " `plugin dev reload ` if a change was missed. `plugin restart ` stops a", " worker so its next command or event reruns its startup code. `plugin logs` shows what a worker printed and a panel's or editor's", " console errors, warnings and uncaught exceptions as `[frame] : `.", @@ -858,13 +859,13 @@ const ORCA_CLI_PLUGINS_REFERENCE_MARKDOWN = [ " Both need the desktop app with a workspace showing and never raise the window.", "6. `plugin dev unload ` when done.", "", - "Paths are on the machine that runs Orca. With `--environment `, pass an absolute path", + "Paths are on the machine that runs Orca. With `--server `, pass an absolute path", "on that server. From an SSH or WSL shell that forwards `orca` to another machine, the authoring", - "and dev commands refuse; work on the Orca host instead.", + "and dev commands refuse; work on the Orca server instead.", "", "`plugin_system_disabled` means plugins are off on that host. Ask the user to click \"Turn on", "plugins\" in Settings → Plugins, or on a host with no window (`orca serve`) to run", - "`plugin system on` with the same `--environment`. It approves nothing; only plugins approved", + "`plugin system on` with the same `--server`. It approves nothing; only plugins approved", "earlier start.", "", "## Install, update and remove", @@ -876,7 +877,7 @@ const ORCA_CLI_PLUGINS_REFERENCE_MARKDOWN = [ "- `owner/repo` or `owner/repo@v1.2.0` on GitHub,", "- any `https://` or `ssh://` Git URL or `git@host:owner/repo.git`, with `#ref` for a version,", "- a GitHub or GitLab release, tag or tree page URL (`.../releases/tag/v1.2.0`, `.../-/tree/main`),", - "- a plugin folder (a path on the Orca host).", + "- a plugin folder (a path on the Orca server).", "", "With no version, Orca installs the newest version tag (`vX.Y.Z`), else the default branch, and", "always pins the exact commit. The result names the version, commit, publisher and repository.", @@ -903,7 +904,7 @@ const ORCA_CLI_PLUGINS_REFERENCE_MARKDOWN = [ "", "## Private repositories", "", - "Git runs on the Orca host (the `--environment` server when given) with that machine's own Git", + "Git runs on the Orca server (the `--server` one when given) with that machine's own Git", "credentials and never prompts. Nothing to pass to `orca`; set up Git there once:", "", "- HTTPS on GitHub: `gh auth login` then `gh auth setup-git`. GitLab: `glab auth login`. Elsewhere:", @@ -1224,7 +1225,7 @@ const ORCA_EMULATOR_MARKDOWN = [ "device with `emulator_unsupported`. `tap`, `type`, `gesture`, `button`, `rotate`, `ax`, and", "`exec` work on both backends.", "", - "Commands drive devices on the host that runs the Orca runtime. Simulators need that host to", + "Commands drive devices on the computer that runs the Orca server. Simulators need that computer to", "be a Mac, so a Linux `orca serve` or SSH host can drive only Android devices.", "", "## Prerequisites", @@ -1345,7 +1346,7 @@ const ORCA_EMULATOR_ANDROID_MARKDOWN = [ "tree on Android, a serve-sim node tree on iOS.", "", "Camera and sensor injection are not wrapped; Android virtual-scene is out of scope. Commands", - "drive the SDK and devices on the host that runs the Orca runtime, including a headless", + "drive the SDK and devices on the computer that runs the Orca server, including a headless", "`orca serve` or SSH host.", "", "## Prerequisites", @@ -1580,7 +1581,7 @@ const ORCA_JIRA_MARKDOWN = [ "", "## Connections and verified reads", "", - "Configure credentials in Orca Settings. `ORCA jira connection --json` lists saved site IDs; it does not test access or agent MCP authentication. These commands use credentials on the selected execution host, including SSH hosts. Update that host if the CLI reports `incompatible_runtime`.", + "Configure credentials in Orca Settings. `ORCA jira connection --json` lists saved site IDs; it does not test access or agent MCP authentication. These commands use credentials on the selected server, including servers on SSH hosts. Update that host if the CLI reports `incompatible_runtime`.", "", "A successful empty list means the Jira read completed; API, permission and network errors remain errors. Jira keys are case-insensitive; full browse URLs are accepted wherever an issue key is required. Use `--body-file ` for multiline descriptions and comments, or `--body-file -` for stdin.", "", @@ -1683,7 +1684,7 @@ const ORCA_LINEAR_MARKDOWN = [ "", "- Omitting `--limit` returns every match and reports `result.meta.limit` as `null`, so filter before listing a large workspace. `--limit ` caps the read.", "- When a cap held results back, `--json` sets `result.truncated` and `result.meta.hasMore`; human output prints `truncated: showing N`. Check `truncated` before reporting a count, then page with `--cursor` until it is false.", - "- A `--cursor` is bound to the workspace and the Orca runtime that issued it. `--workspace all` cannot page, and a raw Linear cursor still needs a concrete `--workspace`.", + "- A `--cursor` is bound to the workspace and the Orca server that issued it. `--workspace all` cannot page, and a raw Linear cursor still needs a concrete `--workspace`.", "- `--priority` is `0=none`, `1=urgent`, `2=high`, `3=medium`, `4=low`. Issue JSON carries `priorityLabel` in the CLI setter vocabulary; project JSON keeps Linear's title-case label.", "- `ORCA linear search`, `ORCA linear list`, and `ORCA linear project list` cap at their own `--limit` and set `result.truncated` the same way.", "", @@ -2685,7 +2686,7 @@ const ORCA_PLUGIN_AUTHORING_MARKDOWN = [ "", "- **Your files:** a new folder, ideally its own Git repository, with `orca-plugin.json` at its", " root, made by `ORCA plugin create` (never overwrites). Paths are on the machine that runs Orca;", - " with `--environment` pass an absolute path on that server.", + " with `--server` pass an absolute path on that server.", "- **Types:** `ORCA plugin types ` (also run by `dev watch`) writes `.orca/types/` for every", " surface; the plugin's `tsconfig.json` extends `./.orca/types/tsconfig.json`. Never edit `.orca/`.", "- **Ground truth:** the references below match this Orca. Read them instead of guessing.", @@ -2816,12 +2817,12 @@ const ORCA_PLUGIN_AUTHORING_CLI_REFERENCE_MARKDOWN = [ "- `ORCA plugin validate [--json]`: Check a plugin folder, manifest or catalog the way Orca will load it", "- `ORCA plugin inspect [--json]`: Show what a plugin folder contributes, the access it asks for, and its content hash", "- `ORCA plugin release-entry [--json]`: Print the catalog release entry for a plugin folder's committed HEAD", - "- `ORCA plugin list [--json]`: List plugins on the Orca host with their status and access level", + "- `ORCA plugin list [--json]`: List plugins on the Orca server with their status and access level", "- `ORCA plugin logs [--json]`: Print the recent log lines of a plugin", "- `ORCA plugin enable [--approve ] [--json]`: Enable a plugin; code and capabilities need --approve", "- `ORCA plugin disable [--json]`: Disable a plugin", - "- `ORCA plugin system on [--json]`: Turn plugins on for the Orca host", - "- `ORCA plugin system off [--json]`: Turn plugins off for the Orca host", + "- `ORCA plugin system on [--json]`: Turn plugins on for the Orca server", + "- `ORCA plugin system off [--json]`: Turn plugins off for the Orca server", "- `ORCA plugin restart [--json]`: Stop a plugin's worker so its next command or event starts it fresh", "- `ORCA plugin dev watch [--check] [--shot [--shot-panel ]] [--approve ] [--json]`: Load a plugin folder, then stream its logs and reloads until Ctrl-C", "- `ORCA plugin dev load [--approve ] [--json]`: Load a plugin folder into Orca as a development plugin", @@ -3728,7 +3729,7 @@ const ORCA_PLUGIN_AUTHORING_WORKFLOW_REFERENCE_MARKDOWN = [ " a dev plugin, run inside its folder. The result adds `replay: true` and `scenario`, and", " `errors` has what the render reported; an unknown name fails and lists the scenarios. Limits:", " a still frame (host-owned control values start from the tree's props), images show their", - " placeholder, no `--act`, local only (no `--environment`), and Orca's window must be hidden", + " placeholder, no `--act`, local only (no `--server`), and Orca's window must be hidden", " or minimized. Default file `.orca/shots/-..png`.", "- `ORCA plugin open [--panel | --editor ]` shows the panel in the right", " sidebar, or a file in the plugin's custom editor. Neither raises the window. `--editor` opens the", @@ -3973,7 +3974,7 @@ const ORCHESTRATION_MARKDOWN = [ " in any state: a working worker gets it when its current turn ends; a finished", " or closed one gets it as a follow-up Task and reports with `worker_done`. The", " receipt says which.", - " Except on a paired server: a finished worker there refuses `send`, so start", + " Except on another server: a finished worker there refuses `send`, so start", " new work there with `worker-start --on ` (load", " `references/placement-and-remote.md` first).", "", @@ -4116,10 +4117,10 @@ const ORCHESTRATION_PLACEMENT_AND_REMOTE_REFERENCE_MARKDOWN = [ "ORCA orchestration worker-start --task --worktree new-child --agent codex --setup run", "", "# On a connected server; the Run stays on yours.", - "ORCA orchestration worker-start --task --on --worktree new-top-level --repo --name --agent codex --setup run", + "ORCA orchestration worker-start --task --on --worktree new-top-level --repo --name --agent codex --setup run", "", "# On a connected server, nested under your workspace in the sidebar.", - "ORCA orchestration worker-start --task --on --worktree new-child --repo --name --agent codex --setup run", + "ORCA orchestration worker-start --task --on --worktree new-child --repo --name --agent codex --setup run", "```", "", "With `--on`, both `new-child` and `new-top-level` need `--repo` naming a", diff --git a/src/cli/caller-host-worktree-selection.ts b/src/cli/caller-host-worktree-selection.ts index 2e390975e92..0440f61e236 100644 --- a/src/cli/caller-host-worktree-selection.ts +++ b/src/cli/caller-host-worktree-selection.ts @@ -178,7 +178,7 @@ export function selectEnclosingWorktreeSelectionOnHost( 'Inspect a chosen workspace with `orca worktree show --worktree --json`.', purpose === 'current' ? 'Use the intended action’s target flag to select that workspace; current has no replacement target flag.' - : `Pass ${flag} on your original invocation${purpose === 'ports' ? '; native folders require --all for a host-wide scan' : ''}.`, + : `Pass ${flag} on your original invocation${purpose === 'ports' ? '; native folders require --all for a server-wide scan' : ''}.`, 'Pass the exact selector as one argument quoted for your shell.' ] } diff --git a/src/cli/cli-error.ts b/src/cli/cli-error.ts index 07a4fe913ea..d4bf4d5f934 100644 --- a/src/cli/cli-error.ts +++ b/src/cli/cli-error.ts @@ -16,7 +16,7 @@ export type CliErrorContext = { worktreeSelector?: string /** The runtime error omits the original --repo selector. */ repoSelector?: string - /** True when --environment, --pairing-code, --host runtime:, or their env vars chose a server. */ + /** True when --server, --pairing-code, --host runtime:, or their env vars chose a server. */ remoteServerSelected?: boolean /** Concise orchestration failures: compact JSON plus one `error: : ` stderr line. */ conciseOrchestration?: boolean @@ -25,7 +25,7 @@ export type CliErrorContext = { type ContextRecovery = { nextSteps: readonly string[] } & Record const STALE_HANDLE_SERVER_HINT = - 'Terminal handles belong to the Orca server that issued them. If this handle came from a paired server (for example `orca terminal list --environment `), pass the same --environment to this command.' + 'Terminal handles belong to the Orca server that issued them. If this handle came from another server (for example `orca terminal list --server `), pass the same --server to this command.' function contextRecovery(error: unknown, context: CliErrorContext): ContextRecovery | undefined { const code = cliErrorCode(error) diff --git a/src/cli/command-scoped-flag-help.ts b/src/cli/command-scoped-flag-help.ts index fc5c6c56006..e1700612d36 100644 --- a/src/cli/command-scoped-flag-help.ts +++ b/src/cli/command-scoped-flag-help.ts @@ -46,16 +46,16 @@ const COMMAND_SCOPED_FLAG_HELP: Record> = { id: '--id Plugin id (default: the folder name)', name: '--name Plugin name shown in Orca' }, - 'environment update': { + 'server update': { force: '--force Restart over running terminals instead of deferring the update' }, - 'environment recover': { + 'server recover': { 'accept-changed-state': '--accept-changed-state Restore the prelaunch snapshot over state a rejected build changed', yes: '--yes Confirm discarding what the rejected build changed' }, - 'environment stop': { - yes: '--yes Confirm stopping the server and unlinking it from this machine' + 'server stop': { + yes: '--yes Confirm stopping the server and unlinking it from this computer' }, 'file open': { line: '--line Cursor line (1-based)', @@ -82,18 +82,18 @@ const COMMAND_SCOPED_FLAG_HELP: Record> = { search: { query: '--query Search text; also accepted as the positional argument', scope: '--scope conversation (user and assistant turns) or all (default)', - fresh: '--fresh Wait up to 5s for the host to reconcile its index first', + fresh: '--fresh Wait up to 5s for the server to reconcile its index first', limit: '--limit Hits per page (default 20, maximum 100)', cursor: '--cursor Opaque cursor printed by the previous page of this search', agent: '--agent Restrict to one agent; repeat for several', - path: '--path Restrict to an execution-host path; repeat for several', + path: '--path Restrict to a path on the server; repeat for several', since: '--since Only sessions updated at or after this ISO 8601 timestamp', sort: '--sort relevance (default) or newest', - debug: '--debug Include the planner route the host used', + debug: '--debug Include the planner route the server used', 'index-status': '--index-status Report the index instead of searching' }, ports: { - all: '--all List every listener on the workspace host, not just this workspace' + all: '--all List every listener on the workspace server, not just this workspace' }, snapshot: { interactive: diff --git a/src/cli/command-spec.ts b/src/cli/command-spec.ts index 5997144fdc0..e77f4cbe88e 100644 --- a/src/cli/command-spec.ts +++ b/src/cli/command-spec.ts @@ -1,6 +1,8 @@ export type CommandSpec = { path: string[] aliases?: string[][] + /** Old spellings: accepted as input, canonicalized to `path`, and never shown. */ + legacyAliases?: string[][] argumentMode?: 'parsed' | 'passthrough' // Prevent typo recovery from suggesting destructive actions for unrelated commands. destructive?: boolean @@ -22,6 +24,9 @@ export type CommandSpec = { export type IdentityFlag = 'from' | 'terminal' +/** Still parsed for old scripts, but never offered in help or typo recovery. */ +export const INPUT_ONLY_FLAGS: ReadonlySet = new Set(['host']) + export function specPaths(spec: CommandSpec): string[][] { - return spec.aliases ? [spec.path, ...spec.aliases] : [spec.path] + return [spec.path, ...(spec.aliases ?? []), ...(spec.legacyAliases ?? [])] } diff --git a/src/cli/command-suggestion-destructive-families.test.ts b/src/cli/command-suggestion-destructive-families.test.ts index e798030188a..c241f26a2e6 100644 --- a/src/cli/command-suggestion-destructive-families.test.ts +++ b/src/cli/command-suggestion-destructive-families.test.ts @@ -22,7 +22,7 @@ const blocked = [ ['orchestration worker-reuse', 'orchestration worker-release'], ['tab clues', 'tab close'], ['linear relation move', 'linear relation remove'], - ['environment rollbook', 'environment rollback'] + ['environment rollbook', 'server rollback'] ] const recovery = [ @@ -34,8 +34,8 @@ const recovery = [ ['orchestration worker-releasee', 'orchestration worker-release'], ['tab clos', 'tab close'], ['tab clone', 'tab close'], - ['environment rollbac', 'environment rollback'], - ['environment remov', 'environment rm'], + ['environment rollbac', 'server rollback'], + ['environment remov', 'server rm'], ['artifacts delet', 'artifacts delete'], ['worktree remov', 'worktree remove'], ['worktree delet', 'worktree delete'], @@ -62,16 +62,16 @@ describe('live destructive command recovery', () => { expect(data.nextSteps.join(' ')).toContain(`orca ${expected}`) }) - it('retains the complete legitimate environment removal ranking', () => { + it('suggests only canonical server commands for a typo in the old spelling', () => { expect(suggestCommands(COMMAND_SPECS, ['environment', 'remov'])).toEqual([ - 'environment recover', - 'environment rm' + 'server recover', + 'server rm' ]) }) it('keeps every declared alias accepted and normalized to its canonical command', () => { for (const spec of COMMAND_SPECS) { - for (const path of [spec.path, ...(spec.aliases ?? [])]) { + for (const path of [spec.path, ...(spec.aliases ?? []), ...(spec.legacyAliases ?? [])]) { expect(findCommandSpec(COMMAND_SPECS, path)).toBe(spec) const parsed = normalizeCommandPositionals(COMMAND_SPECS, parseArgs(path)) expect(parsed.commandPath).toEqual(spec.path) diff --git a/src/cli/command-suggestion.ts b/src/cli/command-suggestion.ts index d0e96637f1b..f8816aecd99 100644 --- a/src/cli/command-suggestion.ts +++ b/src/cli/command-suggestion.ts @@ -69,24 +69,37 @@ export function suggestCommands(specs: CommandSpec[], commandPath: string[]): st ) { continue } - const candidates = specPaths(spec).map((path) => - commandPath.length === 1 ? path.slice(0, 1) : path - ) - for (const candidate of candidates) { + const canonical = (commandPath.length === 1 ? spec.path.slice(0, 1) : spec.path).join(' ') + const legacy = new Set((spec.legacyAliases ?? []).map((path) => path.join(' '))) + for (const path of specPaths(spec)) { + const candidate = commandPath.length === 1 ? path.slice(0, 1) : path if (candidate.length !== commandPath.length) { continue } const joined = candidate.join(' ') + // Legacy spellings are input only: match on them, but suggest the canonical path. + const label = legacy.has(path.join(' ')) ? canonical : joined if (seen.has(joined)) { continue } seen.add(joined) if (Math.abs(input.length - joined.length) <= SUGGESTION_THRESHOLD) { - scored.push({ label: joined, distance: levenshtein(input, joined) }) + scored.push({ label, distance: levenshtein(input, joined) }) } } } - return rankByDistance(scored) + return rankByDistance(bestPerLabel(scored)) +} + +// A legacy alias and its canonical path can share a label; keep the closer match. +function bestPerLabel( + scored: { label: string; distance: number }[] +): { label: string; distance: number }[] { + const best = new Map() + for (const { label, distance } of scored) { + best.set(label, Math.min(distance, best.get(label) ?? distance)) + } + return [...best].map(([label, distance]) => ({ label, distance })) } // A positional terminal handle lands in the command path; point at the flag form instead. @@ -101,7 +114,7 @@ function terminalFlagSuggestion(specs: CommandSpec[], commandPath: string[]): st !candidate.hidden && specPaths(candidate).some((path) => path.join(' ') === parent) ) return spec?.allowedFlags.includes('terminal') && spec.identityFlagRoles?.terminal !== 'caller' - ? [`${parent} --terminal `] + ? [`${spec.path.join(' ')} --terminal `] : [] } @@ -123,7 +136,7 @@ export type FlagErrorData = { } // Recover renamed flags only when the typed flag is rejected and its synonym is accepted. -const FLAG_SYNONYMS: Readonly> = { from: 'terminal' } +const FLAG_SYNONYMS: Readonly> = { from: 'terminal', host: 'server' } function suggestFlags(flag: string, validFlags: string[]): string[] { const synonym = FLAG_SYNONYMS[flag] diff --git a/src/cli/enclosing-workspace-rule.test.ts b/src/cli/enclosing-workspace-rule.test.ts index 8b011029ca6..b623eca5497 100644 --- a/src/cli/enclosing-workspace-rule.test.ts +++ b/src/cli/enclosing-workspace-rule.test.ts @@ -166,7 +166,6 @@ describe('a folder workspace whose host is unknown', () => { expect(() => select(rows, '/tmp/hub/notes')).toThrow( expect.objectContaining({ code: 'selector_ambiguous', - message: expect.stringContaining("can't tell which host owns the folder workspace"), data: expect.objectContaining({ nextSteps: expect.arrayContaining([ 'Pass --worktree folder:hub to target the folder workspace itself.' diff --git a/src/cli/execution-host-flag.ts b/src/cli/execution-host-flag.ts index 3720e25fba1..8ad0851688f 100644 --- a/src/cli/execution-host-flag.ts +++ b/src/cli/execution-host-flag.ts @@ -15,6 +15,7 @@ import { LOCAL_HOST_LIST_NAME, normalizeTypedName, resolveSshHostTargetId, + sshConnectionStep, stripWrappingQuotes, type EnvironmentSummary, type SshTargetSummary @@ -59,13 +60,13 @@ export function parseHostFlag(flags: Map): HostFlagSel if (!alias || alias.startsWith('ssh:') || alias.startsWith('runtime:')) { throw new RuntimeClientError( 'invalid_argument', - `Invalid --host value: ${raw}. Expected local, ssh:, runtime:, or a host name from \`orca host list\`.` + `Invalid --host value: ${raw}. To run on another server, use --server ; \`orca server list\` prints each id.` ) } return { kind: 'alias', alias } } -// Pairing IDs are local to this machine; route to the paired host before applying its filters. +// Pairing IDs are local to this computer; route to the saved server before applying its filters. export async function resolveHostFlagEnvironmentId( flags: Map, selection: HostFlagRoutingSelection @@ -91,25 +92,25 @@ export async function resolveHostFlagEnvironmentId( if (host.kind === 'alias' && (selection.environmentSelector || selection.pairingCode)) { return null } - // Accept environment names but canonicalize them to IDs for stored-host comparisons. + // Accept server names but canonicalize them to IDs for stored-host comparisons. const environment = findEnvironmentByName(environments, wanted) if (!environment) { assertEnvironmentNameUnambiguous(environments, wanted, flagSpelling) - // A missing server alias may still name the local machine or one of its SSH targets. + // A missing server alias may still name this computer or one of its SSH targets. if (host.kind === 'alias') { return null } const sshTargets = await selection.listSshTargets() throw new RuntimeClientError( 'invalid_argument', - `Unknown Orca server in ${flagSpelling}: no paired Orca server is named or has id ${wanted}.`, + `Unknown server in ${flagSpelling}: no saved server has that id or name.`, { - knownEnvironments: environments, + knownServers: environments, knownSshTargets: sshTargets, nextSteps: [ - ...crossKindNextSteps(wanted, { environments, sshTargets }, 'environment'), - 'Run `orca environment list` to see paired Orca servers.', - 'Use --host local to target this machine.' + ...crossKindNextSteps(wanted, { environments, sshTargets }, 'server'), + 'Run `orca server list` to see saved servers.', + 'Use --server local for the Orca on this computer.' ] } ) @@ -118,12 +119,12 @@ export async function resolveHostFlagEnvironmentId( if (isLocalHostListName(host.alias)) { throw new RuntimeClientError( 'invalid_argument', - `Ambiguous --host ${host.alias}: it names both this machine and a paired Orca server.`, + `Ambiguous --host ${host.alias}: it names both this computer and a saved server.`, { - knownEnvironments: [environment], + knownServers: [environment], nextSteps: [ - 'Use --host local for this machine.', - `Use --host runtime:${environment.id} for the paired Orca server named ${environment.name}.` + 'Use --server local for the Orca on this computer.', + `Use --server ${environment.id} for the saved server named ${environment.name}.` ] } ) @@ -133,7 +134,7 @@ export async function resolveHostFlagEnvironmentId( if (selection.pairingCode) { throw new RuntimeClientError( 'invalid_argument', - `${flagSpelling} already selects a paired Orca server; use either --host runtime: or --pairing-code, not both.` + `${flagSpelling} already selects a saved server; use either --server or --pairing-code, not both.` ) } if (selection.environmentSelector) { @@ -144,14 +145,14 @@ export async function resolveHostFlagEnvironmentId( if (selected?.id !== environment.id) { throw new RuntimeClientError( 'invalid_argument', - `${flagSpelling} and ${selection.environmentSelector.label} ${selection.environmentSelector.value} name different Orca servers.` + `${flagSpelling} and ${selection.environmentSelector.label} ${selection.environmentSelector.value} name different servers; pass only --server.` ) } } return environment.id } -// An alias naming both a paired server and an SSH target must not choose either silently. +// An alias naming both a saved server and an SSH target must not choose either silently. async function assertAliasNamesOneHost( alias: string, environment: EnvironmentSummary, @@ -163,11 +164,11 @@ async function assertAliasNamesOneHost( } catch { throw new RuntimeClientError( 'invalid_argument', - `Cannot verify --host ${alias}: it names a paired Orca server, but this machine's SSH targets could not be read to rule out one with the same name.`, + `Cannot verify --host ${alias}: it names a saved server, but this computer's SSH connections could not be read to rule out one with the same name.`, { - knownEnvironments: [environment], + knownServers: [environment], nextSteps: [ - `Use --host runtime:${environment.id} for the paired Orca server named ${environment.name}.` + `Use --server ${environment.id} for the saved server named ${environment.name}.` ] } ) @@ -182,15 +183,13 @@ async function assertAliasNamesOneHost( conflicts.length === 1 ? 'an SSH target' : `${conflicts.length} SSH targets sharing that label` throw new RuntimeClientError( 'invalid_argument', - `Ambiguous --host ${alias}: it names both a paired Orca server and ${sshCount} on this machine.`, + `Ambiguous --host ${alias}: it names both a saved server and ${sshCount} on this computer.`, { - knownEnvironments: [environment], + knownServers: [environment], knownSshTargets: conflicts, nextSteps: [ - `Use --host runtime:${environment.id} for the paired Orca server named ${environment.name}.`, - ...conflicts.map( - (target) => `Use --host ssh:${target.id} for the SSH target labeled ${target.label}.` - ) + `Use --server ${environment.id} for the saved server named ${environment.name}.`, + sshConnectionStep(alias) ] } ) @@ -208,7 +207,7 @@ export function hostFilterMatchesHostId( return filter.kind === 'runtime' && candidate === LOCAL_EXECUTION_HOST_ID } -// Validate SSH IDs against the connected runtime, not this machine's pairing store. +// Validate SSH IDs against the connected server, not this computer's pairing store. export async function resolveHostFlagTarget( flags: Map, client: RuntimeClient @@ -255,20 +254,17 @@ async function resolveLocalHostListName( if (clashing.length > 0) { throw new RuntimeClientError( 'invalid_argument', - `Ambiguous --host ${alias}: it names both this machine and an SSH target.`, + `Ambiguous --host ${alias}: it names both this computer and an SSH connection.`, { knownSshTargets: clashing, - nextSteps: [ - 'Use --host local for this machine.', - ...clashing.map((target) => `Use --host ssh:${target.id} for ${target.label}.`) - ] + nextSteps: ['Use --server local for the Orca on this computer.', sshConnectionStep(alias)] } ) } return { kind: 'local', id: LOCAL_EXECUTION_HOST_ID } } -// Preserve the store's refusal to guess between duplicate environment names. +// Preserve the store's refusal to guess between duplicate server names. function assertEnvironmentNameUnambiguous( environments: readonly { id: string; name: string }[], name: string, @@ -280,11 +276,11 @@ function assertEnvironmentNameUnambiguous( } throw new RuntimeClientError( 'invalid_argument', - `Ambiguous Orca server in ${flag}: ${ambiguous.length} paired servers are named ${name}. Use the environment id.`, + `Ambiguous server in ${flag}: ${ambiguous.length} saved servers are named ${name}. Use the server id.`, { - knownEnvironments: ambiguous, + knownServers: ambiguous, nextSteps: ambiguous.map( - (candidate) => `Use --host runtime:${candidate.id} for the server named ${candidate.name}.` + (candidate) => `Use --server ${candidate.id} for the server named ${candidate.name}.` ) } ) @@ -308,17 +304,17 @@ export async function resolveEnvironmentSelectorForStore( if (found) { return found.id === selector || found.name === selector ? selector : found.id } - assertEnvironmentNameUnambiguous(environments, selector, `--environment ${selector}`) + assertEnvironmentNameUnambiguous(environments, selector, `--server ${selector}`) const sshTargets = await listSshTargetsForSuggestion() throw new RuntimeClientError( 'invalid_argument', - `Unknown Orca server in --environment ${selector}: no paired Orca server is named or has id ${selector}.`, + `Unknown server in --server ${selector}: no saved server has that id or name.`, { - knownEnvironments: environments, + knownServers: environments, knownSshTargets: sshTargets, nextSteps: [ - ...crossKindNextSteps(selector, { environments, sshTargets }, 'environment'), - 'Run `orca host list` to see every machine you can target and the flag for each.' + ...crossKindNextSteps(selector, { environments, sshTargets }, 'server'), + 'Run `orca server list` to see saved servers, or use --server local for the Orca on this computer.' ] } ) diff --git a/src/cli/flag-help-text.ts b/src/cli/flag-help-text.ts index 108cf43bf8f..b032d2b6977 100644 --- a/src/cli/flag-help-text.ts +++ b/src/cli/flag-help-text.ts @@ -13,10 +13,10 @@ export const FLAG_HELP_TEXT: Record = { direction: '--direction Direction: up|down|left|right for scroll, horizontal|vertical for split', 'display-name': '--display-name Override the Orca display name', - environment: - "--environment Run against a saved paired Orca server (id or name), or `local` for this machine's own Orca over ORCA_ENVIRONMENT/ORCA_PAIRING_CODE; terminal handles belong to the server that issued them", + server: + "--server The Orca server to run on: `local` for the Orca on this computer, or a saved server's id or name (`orca server list`). Terminal handles belong to the server that issued them", 'pairing-code': - '--pairing-code Run against a remote Orca server using an orca://pair?... code', + '--pairing-code Connect once to an Orca server with an orca://pair?... code', 'element-index': '--element-index Element index from get-app-state', title: '--title Custom title for the terminal tab (omit to reset)', enter: '--enter Append Enter after sending text', @@ -61,8 +61,8 @@ export const FLAG_HELP_TEXT: Record = { pages: '--pages Number of scroll pages', 'parent-worktree': '--parent-worktree Parent worktree selector such as identity:, id:::, folder:, name:, branch:, issue:, path:, or active/current', - 'parent-environment': - "--parent-environment Environment holding --parent-worktree: local, or a saved environment id or name (default: the worktree's own)", + 'parent-server': + "--parent-server The server holding --parent-worktree: `local` or a saved server's id or name (default: the worktree's own server)", path: '--path Path argument for the command', pr: '--pr Linked GitHub pull request number; null clears on set', prompt: '--prompt Prompt text for agent-backed commands', diff --git a/src/cli/format.ts b/src/cli/format.ts index 27f39e160da..c6014c89e4c 100644 --- a/src/cli/format.ts +++ b/src/cli/format.ts @@ -45,8 +45,8 @@ export { } from './automation-format' export type { AutomationListPayload, AutomationShowPayload } from './automation-format' export { - formatEnvironment, - formatEnvironmentList, + formatSavedServer, + formatSavedServerList, formatMemorySnapshot, formatRepoList, formatRepoRefs, @@ -69,7 +69,7 @@ export function printResult( } export type HostListEntry = { - kind: 'local' | 'ssh' | 'environment' + kind: 'local' | 'ssh' | 'server' name: string id: string selector: string @@ -84,7 +84,7 @@ export function formatHostList(result: { hosts: HostListEntry[] }): string { const kindLabel: Record = { local: 'local', ssh: 'ssh target', - environment: 'orca server' + server: 'orca server' } return result.hosts .map( @@ -94,7 +94,7 @@ export function formatHostList(result: { hosts: HostListEntry[] }): string { .join('\n') } -/** What one runtime calls itself; `machineName` is absent when the runtime predates the field. */ +/** What one server calls itself; `machineName` is absent when the server predates the field. */ export type HostNameResult = { machineName?: string platform?: string @@ -118,22 +118,27 @@ function formatHostConnection(host: HostListEntry): string { export function formatCliStatus(status: CliStatusResult): string { return [ - ...(status.target && status.target.kind === 'environment' - ? [`target: environment ${status.target.environment}`] - : []), + ...(status.target ? [`server: ${formatStatusTarget(status.target)}`] : []), `appRunning: ${status.app.running}`, `pid: ${status.app.pid ?? 'none'}`, `desktopWindowStatus: ${status.app.desktopWindowStatus ?? 'unknown'}`, - `runtimeState: ${status.runtime.state}`, - `runtimeReachable: ${status.runtime.reachable}`, - `runtimeConnectionState: ${status.runtime.connectionState ?? 'unknown'}`, - `runtimeId: ${status.runtime.runtimeId ?? 'none'}`, + `state: ${status.runtime.state}`, + `reachable: ${status.runtime.reachable}`, + `connection: ${status.runtime.connectionState ?? 'unknown'}`, + `instance: ${status.runtime.runtimeId ?? 'none'}`, `graphState: ${status.graph.state}`, ...(status.runtime.degradations ?? []).map((degradation) => `degraded: ${degradation.message}`), ...(status.caller === undefined ? [] : [`orcaSessionId: ${formatStatusCaller(status.caller)}`]) ].join('\n') } +function formatStatusTarget(target: NonNullable): string { + if (target.kind === 'local') { + return 'local' + } + return target.server === 'pairing-code' ? 'one-off connection' : target.server +} + function formatStatusCaller(caller: CliStatusCaller): string { if ('refusal' in caller) { return `none (refused: ${caller.refusal.code})` diff --git a/src/cli/handlers/account-selection.ts b/src/cli/handlers/account-selection.ts index bce8995f3b0..56cd3a4bc81 100644 --- a/src/cli/handlers/account-selection.ts +++ b/src/cli/handlers/account-selection.ts @@ -161,7 +161,7 @@ function antigravityAccounts(ctx: HandlerContext): ProviderAccounts { if (!(await supportsAntigravityAccounts(ctx))) { throw new RuntimeClientError( 'incompatible_runtime', - 'Update or restart this Orca host to manage Antigravity accounts.' + 'Update or restart this Orca server to manage Antigravity accounts.' ) } return client.call('accounts.antigravityList', target) diff --git a/src/cli/handlers/account.ts b/src/cli/handlers/account.ts index 3f2fc1ecb8d..233f534874a 100644 --- a/src/cli/handlers/account.ts +++ b/src/cli/handlers/account.ts @@ -234,7 +234,7 @@ async function assertAccountImportSupported( if (!status.result.capabilities?.includes(capability)) { throw new RuntimeClientError( 'incompatible_runtime', - 'The running Orca runtime is too old to add accounts from the CLI. Update or restart Orca and try again.' + 'The running Orca server is too old to add accounts from the CLI. Update or restart Orca and try again.' ) } } diff --git a/src/cli/handlers/agent-launch.ts b/src/cli/handlers/agent-launch.ts index df4f2536ba5..0a42b7a1089 100644 --- a/src/cli/handlers/agent-launch.ts +++ b/src/cli/handlers/agent-launch.ts @@ -32,12 +32,12 @@ export const AGENT_LAUNCH_HANDLERS: Record = { if (launch.operationId) { throw new RuntimeClientError( 'agent_session_operation_unknown', - 'This host cannot replay the earlier launch. Return to the original execution host; do not retry without --retry-launch.' + 'This server cannot replay the earlier launch. Return to the server that started it; do not retry without --retry-launch.' ) } throw new RuntimeClientError( 'incompatible_runtime', - 'This Orca host cannot start agents from the CLI. Update Orca on the execution host.' + 'This Orca server cannot start agents from the CLI. Update Orca on that server.' ) } const result = await callAgentLaunch( diff --git a/src/cli/handlers/automation-host-support.ts b/src/cli/handlers/automation-host-support.ts index ff9463d0d27..a856b0a03f6 100644 --- a/src/cli/handlers/automation-host-support.ts +++ b/src/cli/handlers/automation-host-support.ts @@ -11,7 +11,7 @@ import type { RuntimeClient } from '../runtime-client' import { RuntimeClientError } from '../runtime-client' const SETUP_CHOICE_HOST_UPDATE_REQUIRED = - "This host's Orca is too old for --setup on automations. Update Orca on that host, or run the command without --setup." + "This host's Orca is too old for --setup on automations. Update Orca on that server, or run the command without --setup." // Older runtimes silently strip these fields and would run without the requested arguments or setup choice. export async function assertAutomationFieldsSupported( diff --git a/src/cli/handlers/automations.ts b/src/cli/handlers/automations.ts index b96a1d5b737..6dde44bc98f 100644 --- a/src/cli/handlers/automations.ts +++ b/src/cli/handlers/automations.ts @@ -1,3 +1,4 @@ +import { describeClientServer } from '../row-owner-server' import type { Automation, AutomationCreateInput, @@ -159,13 +160,13 @@ function buildAutomationRunContextFromSetup(setup: ProjectHostSetup): WorkspaceR export const AUTOMATION_HANDLERS: Record = { 'automations list': async ({ client, json }) => { const result = await client.call<{ automations: Automation[] }>('automation.list') - printResult(result, json, formatAutomationList) + printResult(result, json, (value) => formatAutomationList(value, describeClientServer(client))) }, 'automations show': async ({ flags, client, json }) => { const result = await client.call('automation.show', { id: getRequiredStringFlag(flags, 'id') }) - printResult(result, json, formatAutomationShow) + printResult(result, json, (value) => formatAutomationShow(value, describeClientServer(client))) }, 'automations create': async ({ flags, client, cwd, json }) => { const setupDecision = getAutomationSetupFlag(flags) @@ -204,7 +205,7 @@ export const AUTOMATION_HANDLERS: Record = { await assertAutomationFieldsSupported(writer, create) } const result = await writer.call<{ automation: Automation }>('automation.create', params) - printResult(result, json, formatAutomationShow) + printResult(result, json, (value) => formatAutomationShow(value, describeClientServer(client))) }, 'automations edit': async ({ flags, client, cwd, json }) => { const setupDecision = getAutomationSetupFlag(flags) @@ -251,7 +252,7 @@ export const AUTOMATION_HANDLERS: Record = { ...(setupDecision && !updates.workspaceMode ? { expectedWorkspaceMode: 'new_per_run' } : {}), updates }) - printResult(result, json, formatAutomationShow) + printResult(result, json, (value) => formatAutomationShow(value, describeClientServer(client))) }, 'automations remove': async ({ flags, client, json }) => { const id = getRequiredStringFlag(flags, 'id') @@ -269,7 +270,7 @@ export const AUTOMATION_HANDLERS: Record = { id, ...(expectedOwner ? { expectedOwner } : {}) }) - const environment = getOptionalStringFlag(flags, 'environment') ?? process.env.ORCA_ENVIRONMENT + const environment = getOptionalStringFlag(flags, 'server') ?? process.env.ORCA_ENVIRONMENT const preserveConnectionSettings = Boolean( (client.isRemote && !environment) || process.env.ORCA_USER_DATA_PATH ) diff --git a/src/cli/handlers/bundled-skill-install-command.ts b/src/cli/handlers/bundled-skill-install-command.ts index c4db81b3d10..fcdc87cd292 100644 --- a/src/cli/handlers/bundled-skill-install-command.ts +++ b/src/cli/handlers/bundled-skill-install-command.ts @@ -179,7 +179,7 @@ export function createSkillMutationHandler(verb: SkillMutationVerb): CommandHand throw new RuntimeClientError( 'invalid_environment', `orca skills ${verb} writes to the machine that runs it, but this shell forwards ` + - `orca to the Orca host. Run the same orca skills ${verb} command on the machine ` + + `orca to the Orca server. Run the same orca skills ${verb} command on the machine ` + "you want it on, where it can detect that host's agents." ) } diff --git a/src/cli/handlers/chat.ts b/src/cli/handlers/chat.ts index f9303026a8d..cfad89ec518 100644 --- a/src/cli/handlers/chat.ts +++ b/src/cli/handlers/chat.ts @@ -50,7 +50,7 @@ function explainRenameRefusal(error: unknown, sessionId: string): unknown { ) { return new RuntimeClientError( 'incompatible_runtime', - 'This Orca host cannot rename chats from the CLI. Update Orca on that host, or check that it has chats turned on.' + 'This Orca server cannot rename chats from the CLI. Update Orca on that server, or check that it has chats turned on.' ) } return error diff --git a/src/cli/handlers/connector.test.ts b/src/cli/handlers/connector.test.ts index ab0c81ac89b..b2e1476836b 100644 --- a/src/cli/handlers/connector.test.ts +++ b/src/cli/handlers/connector.test.ts @@ -25,7 +25,7 @@ describe('orca connector', () => { it('names the update instead of surfacing method_not_found from an older host', async () => { await expect( callConnector(refusingClient('method_not_found'), 'connector.send', {}) - ).rejects.toThrow('Update Orca on the host') + ).rejects.toMatchObject({ code: 'incompatible_runtime' }) }) it('claims a start only for a definite answer', () => { diff --git a/src/cli/handlers/connector.ts b/src/cli/handlers/connector.ts index 5f392f11444..40e97fa0b3e 100644 --- a/src/cli/handlers/connector.ts +++ b/src/cli/handlers/connector.ts @@ -42,7 +42,7 @@ export async function callConnector( if (error instanceof RuntimeClientError && error.code === 'method_not_found') { throw new RuntimeClientError( 'incompatible_runtime', - 'This Orca host has no connectors. Update Orca on the host and try again.' + 'This Orca server has no connectors. Update Orca on the server and try again.' ) } throw error diff --git a/src/cli/handlers/data-account-commands.ts b/src/cli/handlers/data-account-commands.ts index 40d7e96479d..3d1c206dbc6 100644 --- a/src/cli/handlers/data-account-commands.ts +++ b/src/cli/handlers/data-account-commands.ts @@ -23,7 +23,7 @@ export async function assertDataAccountsSupported(ctx: HandlerContext): Promise< if (!status.result.capabilities?.includes(DATA_ACCOUNT_RUNTIME_CAPABILITY)) { throw new RuntimeClientError( 'incompatible_runtime', - 'Update or restart this Orca host to manage OpenCode and Devin accounts.' + 'Update or restart this Orca server to manage OpenCode and Devin accounts.' ) } } diff --git a/src/cli/handlers/environment.ts b/src/cli/handlers/environment.ts index cea32095c3b..19752cf1586 100644 --- a/src/cli/handlers/environment.ts +++ b/src/cli/handlers/environment.ts @@ -1,7 +1,7 @@ import type { CommandHandler } from '../dispatch' import { - formatEnvironment, - formatEnvironmentList, + formatSavedServer, + formatSavedServerList, formatHostList, formatHostName, printResult, @@ -34,10 +34,11 @@ import { } from '../runtime/environments' import { exchangeCliPairingCode } from '../runtime/environment-pairing-exchange' import { refuseReservedEnvironmentName } from '../local-environment-selector' +import { quoteCliCommandArgument } from '../shell-command-quote' import { listEnvironments } from '../../shared/remote-runtime/host-store/runtime-environment-store' export const ENVIRONMENT_HANDLERS: Record = { - 'host name': async ({ client, flags, json }) => { + 'server name': async ({ client, flags, json }) => { const requestedName = flags.get('name') if (requestedName !== undefined && typeof requestedName !== 'string') { throw new RuntimeClientError('invalid_argument', 'Missing value for --name') @@ -48,37 +49,36 @@ export const ENVIRONMENT_HANDLERS: Record = { if (current.result.machineName === undefined) { throw new RuntimeClientError( 'incompatible_runtime', - 'This Orca runtime does not support machine names. Update Orca on that host and try again.' + 'This Orca server does not support machine names. Update Orca on that server and try again.' ) } await client.call('settings.update', { machineName: requestedName }) } - // A blank override restores the detected name; read it from the runtime after writing. + // A blank override restores the detected name; read it from the server after writing. const status = await client.call('status.get') printResult({ ...status, result: describeRuntimeHost(status.result) }, json, formatHostName) }, - 'environment add': async ({ flags, json }) => { + 'server add': async ({ flags, json }) => { const name = getRequiredStringFlag(flags, 'name') refuseReservedEnvironmentName(name) const pairingCode = await exchangeCliPairingCode(getRequiredStringFlag(flags, 'pairing-code')) - const environment = redactRuntimeEnvironment( + const server = redactRuntimeEnvironment( addEnvironmentFromPairingCode(getDefaultUserDataPath(), { name, pairingCode }) ) printResult( - localSuccess({ environment }), + localSuccess({ server }), json, - (result: EnvironmentAddResult) => - `Saved environment ${result.environment.name} (${result.environment.id}).` + (result: EnvironmentAddResult) => `Saved server ${result.server.name} (${result.server.id}).` ) }, 'host list': async ({ client, flags, json }) => { rejectLocalPairingStoreRetargeting( flags, - '`orca host list`. It answers from this machine\u2019s own pairing store, so a routed answer would name servers paired with a different machine.', - 'Run `orca host list` on that machine to see the SSH targets registered there.' + '`orca host list`. It answers from this computer\u2019s own pairing store, so a routed answer would name servers saved on a different computer.', + 'Run `orca host list` on that computer to see the SSH connections registered there.' ) const sshTargets = (await listSshTargets(client)).map((target) => ({ kind: 'ssh' as const, @@ -91,11 +91,11 @@ export const ENVIRONMENT_HANDLERS: Record = { })) // Read the local pairing store without dialing every server, so listing works offline. const localStatus = await readLocalHostDescriptor(client) - const environments = listEnvironments(getDefaultUserDataPath()).map((environment) => ({ - kind: 'environment' as const, - name: environment.name, - id: environment.id, - selector: `--environment ${environment.name}` + const servers = listEnvironments(getDefaultUserDataPath()).map((server) => ({ + kind: 'server' as const, + name: server.name, + id: server.id, + selector: `--server ${quoteCliCommandArgument(server.id)}` })) const hosts = [ { @@ -107,15 +107,15 @@ export const ENVIRONMENT_HANDLERS: Record = { platform: localStatus.platform ?? process.platform }, ...sshTargets, - ...environments + ...servers ] printResult(localSuccess({ hosts }), json, formatHostList) }, 'host rm': async ({ client, flags, json }) => { rejectLocalPairingStoreRetargeting( flags, - '`orca host rm`. It removes an SSH target from this machine\u2019s own Orca runtime, the same one `orca host list` reads.', - 'Run `orca host rm` on that machine to remove an SSH target registered there.' + '`orca host rm`. It removes an SSH connection from the Orca on this computer, the same one `orca host list` reads.', + 'Run `orca host rm` on that computer to remove an SSH connection registered there.' ) const targetId = requireSshHostFlag(flags) // Unlike listSshTargets, this keeps runtime_unavailable instead of reporting an unknown target. @@ -124,7 +124,7 @@ export const ENVIRONMENT_HANDLERS: Record = { if (!target) { throw new RuntimeClientError( 'invalid_argument', - `Unknown SSH target in --host ssh:${targetId}: this Orca host has no SSH target with that id.`, + `Unknown SSH target in --host ssh:${targetId}: the Orca on this computer has no SSH target with that id.`, { knownSshTargets: targets, nextSteps: ['Run `orca host list` to see each SSH target and its --host ssh: flag.'] @@ -141,32 +141,28 @@ export const ENVIRONMENT_HANDLERS: Record = { `Removed SSH target ${result.removed.name} (${result.removed.id}).` ) }, - 'environment list': async ({ flags, json }) => { + 'server list': async ({ flags, json }) => { rejectLocalPairingStoreRetargeting( flags, - '`orca environment list`. Paired servers are stored on this machine, so there is no other host to ask.', - 'Run `orca environment list` on that machine to see the servers paired with it.' + '`orca server list`. Saved servers are stored on this computer, so no other server could answer.', + 'Run `orca server list` on that computer to see the servers saved there.' ) - const environments = listEnvironments(getDefaultUserDataPath()).map(redactRuntimeEnvironment) - printResult(localSuccess({ environments }), json, formatEnvironmentList) + const servers = listEnvironments(getDefaultUserDataPath()).map(redactRuntimeEnvironment) + printResult(localSuccess({ servers }), json, formatSavedServerList) }, - 'environment show': async ({ flags, json }) => { - const selector = getRequiredStringFlag(flags, 'environment') - const environment = redactRuntimeEnvironment( - resolveEnvironment(getDefaultUserDataPath(), selector) - ) - printResult(localSuccess({ environment }), json, ({ environment: value }) => - formatEnvironment(value) - ) + 'server show': async ({ flags, json }) => { + const selector = getRequiredStringFlag(flags, 'server') + const server = redactRuntimeEnvironment(resolveEnvironment(getDefaultUserDataPath(), selector)) + printResult(localSuccess({ server }), json, ({ server: value }) => formatSavedServer(value)) }, - 'environment rm': async ({ flags, json }) => { - const selector = getRequiredStringFlag(flags, 'environment') + 'server rm': async ({ flags, json }) => { + const selector = getRequiredStringFlag(flags, 'server') const removed = redactRuntimeEnvironment(removeEnvironment(getDefaultUserDataPath(), selector)) printResult( localSuccess({ removed }), json, (result: EnvironmentRemoveResult) => - `Removed environment ${result.removed.name} (${result.removed.id}).` + `Removed server ${result.removed.name} (${result.removed.id}).` ) } } @@ -178,7 +174,7 @@ function describeRuntimeHost(status: RuntimeStatus): HostNameResult { } } -/** The local row of `host list` still prints when this machine's runtime is not running. */ +/** The local row of `host list` still prints when the Orca on this computer is not running. */ async function readLocalHostDescriptor(client: RuntimeClient): Promise { try { return describeRuntimeHost((await client.call('status.get')).result) @@ -187,14 +183,14 @@ async function readLocalHostDescriptor(client: RuntimeClient): Promise, suffix: string, crossHostNextStep: string ): void { rejectRemoteSelectionFlags(flags, suffix, { - nextSteps: [crossHostNextStep, 'Drop the flag to answer for this machine.'] + nextSteps: [crossHostNextStep, 'Drop the flag to answer for this computer.'] }) } @@ -209,9 +205,9 @@ function requireSshHostFlag(flags: Map): string { const named = host.kind === 'alias' ? host.alias : host.id const nextStep = host.kind === 'runtime' - ? 'A paired Orca server is removed with `orca environment rm --environment `.' + ? 'A saved server is removed with `orca server rm --server `.' : host.kind === 'local' || normalizeTypedName(named) === LOCAL_HOST_LIST_NAME - ? 'This machine is always listed and cannot be removed.' + ? 'This computer is always listed and cannot be removed.' : 'Pass the SSH target id as --host ssh:; `orca host list` prints it.' throw new RuntimeClientError( 'invalid_argument', diff --git a/src/cli/handlers/folder-workspace-mutations.ts b/src/cli/handlers/folder-workspace-mutations.ts index 1438b220232..bc59df7ef77 100644 --- a/src/cli/handlers/folder-workspace-mutations.ts +++ b/src/cli/handlers/folder-workspace-mutations.ts @@ -11,6 +11,7 @@ import { formatWorktreeShow, printResult } from '../format' import { getOptionalStringFlag, getOptionalStringFlagAllowingEmpty } from '../flags' import { RuntimeClientError, type RuntimeClient, type RuntimeRpcSuccess } from '../runtime-client' import { getWorktreeReadFlags } from './worktree-unread-flag' +import { annotateMutationResult } from './worktree-address-annotation' type Flags = Map @@ -65,7 +66,11 @@ export async function setIfFolderWorkspace( if (folderId === undefined) { return false } - printResult(await setFolderWorkspace(client, flags, folderId), json, formatWorktreeShow) + const { response } = await annotateMutationResult( + client, + await setFolderWorkspace(client, flags, folderId) + ) + printResult(response, json, formatWorktreeShow) return true } diff --git a/src/cli/handlers/managed-server-format.ts b/src/cli/handlers/managed-server-format.ts index e6652b816a9..be613fee7d9 100644 --- a/src/cli/handlers/managed-server-format.ts +++ b/src/cli/handlers/managed-server-format.ts @@ -1,4 +1,5 @@ import type { OrcadManagedRuntimeStatus } from '../../shared/orcad-managed-runtime' +import { quoteCliCommandArgument } from '../shell-command-quote' function count(value: number | null): string { return value === null ? 'unverifiable' : String(value) @@ -12,7 +13,7 @@ export function formatManagedServerStatus(status: OrcadManagedRuntimeStatus): st ] if (status.recovery) { lines.push( - `Interrupted ${status.recovery.operation} of ${status.recovery.version} (${status.recovery.phase}); run \`orca environment recover\`.` + `Interrupted ${status.recovery.operation} of ${status.recovery.version} (${status.recovery.phase}); run \`orca server recover --server ${quoteCliCommandArgument(status.environmentId)}\`.` ) } if (status.migration) { @@ -25,7 +26,7 @@ export function formatManagedServerStatus(status: OrcadManagedRuntimeStatus): st } if (status.availableUpdate) { lines.push( - `Update available: ${status.availableUpdate}; run \`orca environment update --environment ${status.environmentId}\`.` + `Update available: ${status.availableUpdate}; run \`orca server update --server ${quoteCliCommandArgument(status.environmentId)}\`.` ) } return lines.join('\n') diff --git a/src/cli/handlers/managed-server-reconnect.ts b/src/cli/handlers/managed-server-reconnect.ts index 94ae2565130..4cf806abd9f 100644 --- a/src/cli/handlers/managed-server-reconnect.ts +++ b/src/cli/handlers/managed-server-reconnect.ts @@ -1,8 +1,9 @@ -// Updates can close this connection mid-call; report the outcome from status after the runtime returns. +// Updates can close this connection mid-call; report the outcome from status after the server returns. import type { OrcadManagedRuntimeStatus } from '../../shared/orcad-managed-runtime' import type { HandlerContext } from '../dispatch' import { printResult } from '../format' import { RuntimeClientError, type RuntimeRpcSuccess } from '../runtime-client' +import { quoteCliCommandArgument } from '../shell-command-quote' const STATUS_ATTEMPTS = 15 const STATUS_RETRY_MS = 2_000 @@ -24,7 +25,7 @@ export async function reportAfterClosedConnection( if (status.recovery) { throw new RuntimeClientError( 'managed_server_interrupted', - `The ${status.recovery.operation} of ${status.recovery.version} was interrupted. Run \`orca environment recover\`.`, + `The ${status.recovery.operation} of ${status.recovery.version} was interrupted. Run \`orca server recover --server ${quoteCliCommandArgument(selector.selector)}\`.`, status ) } @@ -41,6 +42,6 @@ export async function reportAfterClosedConnection( } throw new RuntimeClientError( 'managed_server_in_progress', - 'The connection closed while the server restarted, and it has not answered since. Check `orca environment status`.' + `The connection closed while the server restarted, and it has not answered since. Check \`orca server status --server ${quoteCliCommandArgument(selector.selector)}\`.` ) } diff --git a/src/cli/handlers/managed-server.ts b/src/cli/handlers/managed-server.ts index 579239d02ea..bb4c80fff5d 100644 --- a/src/cli/handlers/managed-server.ts +++ b/src/cli/handlers/managed-server.ts @@ -16,9 +16,10 @@ import { printResult } from '../format' import { RuntimeClientError, type RuntimeRpcSuccess } from '../runtime-client' import { formatManagedServerStatus } from './managed-server-format' import { reportAfterClosedConnection } from './managed-server-reconnect' +import { quoteCliCommandArgument } from '../shell-command-quote' const UNSUPPORTED_MESSAGE = - 'This Orca runtime cannot manage servers over SSH. Run this on the computer whose Orca desktop app deployed the server, after updating Orca there.' + 'This Orca server cannot manage servers over SSH. Run this on the computer whose Orca desktop app deployed the server, after updating Orca there.' // Windows promotion and readiness waits can take ten minutes; allow headroom on slow hosts. export const MANAGED_SERVER_ACTION_TIMEOUT_MS = 20 * 60_000 @@ -48,11 +49,11 @@ async function callManagedServer( if (error instanceof RuntimeClientError && error.code === 'method_not_found') { throw unsupported() } - // The runtime continues the action after this client times out. + // The desktop continues the action after this client times out. if (!readOnly && error instanceof RuntimeClientError && error.code === 'runtime_timeout') { throw new RuntimeClientError( 'managed_server_in_progress', - 'Stopped waiting, but the desktop may still be running this action. Check `orca environment status` before retrying.' + `Stopped waiting, but the desktop may still be running this action. Check \`orca server status --server ${quoteCliCommandArgument(String(params.selector))}\` before retrying.` ) } throw error @@ -77,7 +78,7 @@ async function callExpectingRestart( } function selectorOf(context: HandlerContext): { selector: string } { - return { selector: getRequiredStringFlag(context.flags, 'environment') } + return { selector: getRequiredStringFlag(context.flags, 'server') } } type Outcome = { outcome: string; code?: string; reason?: string } @@ -111,7 +112,7 @@ function isSettled } export const MANAGED_SERVER_HANDLERS: Record = { - 'environment status': async (context) => { + 'server status': async (context) => { const response = await callManagedServer( context, 'managedServer.status', @@ -119,7 +120,7 @@ export const MANAGED_SERVER_HANDLERS: Record = { ) printResult(response, context.json, formatManagedServerStatus) }, - 'environment update': async (context) => { + 'server update': async (context) => { const params = { ...selectorOf(context), force: context.flags.get('force') === true } const response = await callExpectingRestart( context, @@ -135,7 +136,7 @@ export const MANAGED_SERVER_HANDLERS: Record = { : `Updated ${result.environment.name} to ${result.activeVersion}.` ) }, - 'environment rollback': async (context) => { + 'server rollback': async (context) => { const response = await callExpectingRestart( context, 'managedServer.rollback', @@ -151,7 +152,7 @@ export const MANAGED_SERVER_HANDLERS: Record = { (result) => `Rolled ${result.environment.name} back to ${result.activeVersion}.` ) }, - 'environment recover': async (context) => { + 'server recover': async (context) => { const params = selectorOf(context) const acceptChangedState = context.flags.get('accept-changed-state') === true if (acceptChangedState && context.flags.get('yes') !== true) { @@ -179,12 +180,12 @@ export const MANAGED_SERVER_HANDLERS: Record = { : null ) }, - 'environment stop': async (context) => { + 'server stop': async (context) => { const params = selectorOf(context) if (context.flags.get('yes') !== true) { throw new RuntimeClientError( 'confirmation_required', - `Stopping ${params.selector} ends its terminals and unlinks it from this machine. Re-run with --yes to confirm.` + `Stopping ${params.selector} ends its terminals and unlinks it from this computer. Re-run with --yes to confirm.` ) } const response = await callManagedServer( @@ -197,15 +198,15 @@ export const MANAGED_SERVER_HANDLERS: Record = { context.json, ['unlinked'], () => - `Stopped ${params.selector}, unlinked it from this machine and disconnected its SSH host.` + `Stopped ${params.selector}, unlinked it from this computer and disconnected its SSH host.` ) }, - 'environment forget': async (context) => { + 'server forget': async (context) => { const params = selectorOf(context) if (context.flags.get('yes') !== true) { throw new RuntimeClientError( 'confirmation_required', - `Forgetting ${params.selector} unlinks it from this machine without stopping it on its host. Re-run with --yes to confirm.` + `Forgetting ${params.selector} unlinks it from this computer without stopping it on its host. Re-run with --yes to confirm.` ) } const response = await callManagedServer( @@ -218,21 +219,22 @@ export const MANAGED_SERVER_HANDLERS: Record = { context.json, ['forgotten'], () => - `Unlinked ${params.selector} from this machine and disconnected its SSH host. The host was not contacted, so orcad may still be running there; connect the host to set its server up again.` + `Unlinked ${params.selector} from this computer and disconnected its SSH host. The host was not contacted, so orcad may still be running there; connect the host to set its server up again.` ) }, - 'environment cancel-stop': async (context) => { + 'server cancel-stop': async (context) => { + const params = selectorOf(context) const response = await callManagedServer( context, 'managedServer.cancelStop', - selectorOf(context) + params ) report(response, context.json, ['canceled', 'already-stopped', 'none'], (result) => { switch (result.outcome) { case 'canceled': return `Stop withdrawn; the server keeps serving ${result.activeVersion}.` case 'already-stopped': - return 'orcad had already exited. Run `orca environment stop --yes` to unlink it.' + return `orcad had already exited. Run \`orca server stop --server ${quoteCliCommandArgument(params.selector)} --yes\` to unlink it.` case 'none': return 'No stop is pending.' } diff --git a/src/cli/handlers/orchestration/agent-view.test.ts b/src/cli/handlers/orchestration/agent-view.test.ts index cbc09aa345d..ed0bdc45f2d 100644 --- a/src/cli/handlers/orchestration/agent-view.test.ts +++ b/src/cli/handlers/orchestration/agent-view.test.ts @@ -248,7 +248,7 @@ describe('orchestration agent views', () => { expect(stdout).toBe( 'scope.run=run_1 scope.source=flag\n' + - 'dispatchId=ctx_1 taskId=task_1 state=running liveness=live terminal=term_agent terminalState=active workspace=wt_1::/repo host=local attention=input next="orca-dev orchestration worker-stop --dispatch ctx_1"' + 'dispatchId=ctx_1 taskId=task_1 state=running liveness=live terminal=term_agent terminalState=active workspace=wt_1::/repo server=local attention=input next="orca-dev orchestration worker-stop --dispatch ctx_1"' ) }) diff --git a/src/cli/handlers/orchestration/removed-work-format.ts b/src/cli/handlers/orchestration/removed-work-format.ts index c0d5181ae93..78a03925474 100644 --- a/src/cli/handlers/orchestration/removed-work-format.ts +++ b/src/cli/handlers/orchestration/removed-work-format.ts @@ -66,7 +66,7 @@ export function formatRemovedWorkListing( ): string { if (!removed) { // Also shown when a host could not read its record; run-show omits the field either way. - return 'No record of removed work is available from this Orca host.' + return 'No record of removed work is available from this Orca server.' } const entries = removed.entries ?? [] if (entries.length === 0) { diff --git a/src/cli/handlers/orchestration/worker-agent-views.ts b/src/cli/handlers/orchestration/worker-agent-views.ts index ac76e9c214a..c818207bbcd 100644 --- a/src/cli/handlers/orchestration/worker-agent-views.ts +++ b/src/cli/handlers/orchestration/worker-agent-views.ts @@ -1,4 +1,5 @@ import { renderOrchestrationArgv, type OrchestrationAgentView } from './agent-view' +import { formatOwner, ownerOfWorkerHost, type OwnerContext } from '../../row-owner-server' import type { WorkerListRunScope } from './worker-list-run-scope' import { isActionableOrchestrationFleetAttention } from '../../../shared/orchestration/fleet/orchestration-fleet-attention' import { formatPrCommentRelativeTime } from '../../../shared/source-control/review-comments/pr-comment-time' @@ -7,7 +8,7 @@ type WorkerProjection = { runId?: string outcome?: string | null provider?: { id: string; model: string | null } | null - host: { id: string } + host: { kind?: 'local' | 'remote'; id: string } workspace?: { id: string } | null stage: { activity: string } liveness: { verdict: string; detail?: string } @@ -132,7 +133,7 @@ type WorkerListRow = { terminal?: string terminalState?: string workspace?: string - host?: string + server?: string attention?: string[] autoReleaseAt?: string next?: string @@ -147,7 +148,10 @@ type WorkerListFields = { type ScopedWorkerList = WorkerListResult & { scope: WorkerListRunScope } -export const WORKER_LIST_VIEW: OrchestrationAgentView = { +/** `owners` names each worker's server from the home coordinator's own store; nothing is dialed. */ +export const workerListView = ( + owners: OwnerContext +): OrchestrationAgentView => ({ fields: (value) => ({ workers: value.workers.map((worker) => { const projection = worker.projection @@ -167,7 +171,7 @@ export const WORKER_LIST_VIEW: OrchestrationAgentView ) { throw new RuntimeClientError( 'incompatible_runtime', - 'The connected Orca runtime does not support worker model or effort overrides. Update or restart Orca and try again.' + 'The connected Orca server does not support worker model or effort overrides. Update or restart Orca and try again.' ) } } diff --git a/src/cli/handlers/orchestration/worker-terminal-handlers.ts b/src/cli/handlers/orchestration/worker-terminal-handlers.ts index df70532be85..91cd7310c14 100644 --- a/src/cli/handlers/orchestration/worker-terminal-handlers.ts +++ b/src/cli/handlers/orchestration/worker-terminal-handlers.ts @@ -1,7 +1,8 @@ import type { CommandHandler } from '../../dispatch' import { printResult } from '../../format' import { printOrchestrationResult } from './agent-view' -import { WORKER_LIST_VIEW, type WorkerListResult } from './worker-agent-views' +import { workerListView, type WorkerListResult } from './worker-agent-views' +import { formatOwnerToken, ownerOfWorkerHost, readOwnerContext } from '../../row-owner-server' import { formatHelperStops, WORKER_RELEASE_VIEW, @@ -139,18 +140,19 @@ export const ORCHESTRATION_WORKER_TERMINAL_HANDLERS: Record { + const owners = readOwnerContext(client) const rows = value.workers.length === 0 ? 'No workers found.' @@ -165,7 +167,7 @@ export const ORCHESTRATION_WORKER_TERMINAL_HANDLERS: Record { '--approve', 'ap1-old', '--json', - '--environment', + '--server', 'box' ] const call = vi @@ -65,7 +65,7 @@ describe('orca plugin dev watch', () => { dir: '/work/notes', approve: 'ap1-new', json: true, - environment: 'box' + server: 'box' }) }) diff --git a/src/cli/handlers/plugin-dev-watch.ts b/src/cli/handlers/plugin-dev-watch.ts index 59c84af725e..6af7234f83a 100644 --- a/src/cli/handlers/plugin-dev-watch.ts +++ b/src/cli/handlers/plugin-dev-watch.ts @@ -125,11 +125,11 @@ function bindShotHost( export function bindPluginDevWatchHost(ctx: HandlerContext, path: string): PluginDevWatchHost { const approve = ctx.flags.get('approve') const check = ctx.flags.get('check') === true - // Why local only: the check renders the folder's code on this machine, not on the Orca host. + // Why local only: the check renders the folder's code on this machine, not on the Orca server. if (check && ctx.client.isRemote) { throw new RuntimeClientError( 'invalid_argument', - '--check renders the plugin on this machine, so it needs a local folder; drop --environment or --check.' + '--check renders the plugin on this machine, so it needs a local folder; drop --server or --check.' ) } const shotFlag = ctx.flags.get('shot') diff --git a/src/cli/handlers/plugin-install.ts b/src/cli/handlers/plugin-install.ts index 1720dcff3a8..a62c2d3743c 100644 --- a/src/cli/handlers/plugin-install.ts +++ b/src/cli/handlers/plugin-install.ts @@ -62,7 +62,7 @@ function looksLikePath(value: string): boolean { ) } -/** Sorts what the caller typed into a catalog id, a Git source or a folder on the Orca host. */ +/** Sorts what the caller typed into a catalog id, a Git source or a folder on the Orca server. */ export function classifyPluginInstallSource(ctx: HandlerContext, value: string): InstallSpec { const ref = stringFlag(ctx, 'ref') const catalog = stringFlag(ctx, 'catalog') diff --git a/src/cli/handlers/plugin-runtime.ts b/src/cli/handlers/plugin-runtime.ts index e9965182438..6f037849079 100644 --- a/src/cli/handlers/plugin-runtime.ts +++ b/src/cli/handlers/plugin-runtime.ts @@ -46,8 +46,8 @@ export function translatePluginRpcError( if (code === 'method_not_found') { return new RuntimeClientError( 'runtime_unsupported', - `The Orca host this command reached is too old for \`${method}\`.`, - { nextSteps: ['Update Orca on that host, then run the command again.'] } + `The Orca server this command reached is too old for \`${method}\`.`, + { nextSteps: ['Update Orca on that server, then run the command again.'] } ) } const fingerprint = approvalFingerprintOf(data) @@ -85,12 +85,12 @@ export async function callPlugins( } } -/** Development folders are paths on the Orca host, which may not be this machine. */ +/** Development folders are paths on the Orca server, which may not be this machine. */ export function resolveHostPluginPath(ctx: HandlerContext, value: string): string { if (process.env.ORCA_CLI_CWD) { throw new RuntimeClientError( 'invalid_environment', - 'This shell forwards orca to an Orca host on another machine, which cannot read this folder. Run the command on the machine that runs Orca, or pass --environment for an Orca server that has the folder.' + 'This shell forwards orca to an Orca server on another machine, which cannot read this folder. Run the command on the machine that runs Orca, or pass --server for an Orca server that has the folder.' ) } if (isAbsolute(value)) { diff --git a/src/cli/handlers/plugin-shot-scenario.ts b/src/cli/handlers/plugin-shot-scenario.ts index 5af3507e09e..7190469e677 100644 --- a/src/cli/handlers/plugin-shot-scenario.ts +++ b/src/cli/handlers/plugin-shot-scenario.ts @@ -45,7 +45,7 @@ function requireLocal(ctx: HandlerContext): void { if (process.env.ORCA_CLI_CWD || ctx.client.isRemote) { throw refuse( 'invalid_environment', - "shot --scenario runs the plugin's code on this machine and shows it in the Orca on this machine, so it does not reach another host. Run it where Orca and the plugin folder are, without --environment." + "shot --scenario runs the plugin's code on this machine and shows it in the Orca on this machine, so it does not reach another host. Run it where Orca and the plugin folder are, without --server." ) } } diff --git a/src/cli/handlers/plugin-view.ts b/src/cli/handlers/plugin-view.ts index 1fdb5121811..eed70d7c87f 100644 --- a/src/cli/handlers/plugin-view.ts +++ b/src/cli/handlers/plugin-view.ts @@ -79,12 +79,12 @@ export function defaultPluginShotPath(dir: string, pluginKey: string, panelId: s return join(dir, `${pluginKey}-${panelId}.png`) } -/** The PNG lands on the machine that runs the CLI, also with --environment. */ +/** The PNG lands on the machine that runs the CLI, also with --server. */ export function resolveLocalShotPath(ctx: HandlerContext, value: string): string { if (process.env.ORCA_CLI_CWD) { throw new RuntimeClientError( 'invalid_environment', - 'orca plugin shot writes the PNG on the machine that runs it, but this shell forwards orca to the Orca host. Run it on the machine that should keep the image.' + 'orca plugin shot writes the PNG on the machine that runs it, but this shell forwards orca to the Orca server. Run it on the machine that should keep the image.' ) } return isAbsolute(value) ? value : resolve(ctx.cwd, value) diff --git a/src/cli/handlers/ports.ts b/src/cli/handlers/ports.ts index ba6e9f30c4a..a9cc695cbd7 100644 --- a/src/cli/handlers/ports.ts +++ b/src/cli/handlers/ports.ts @@ -140,7 +140,7 @@ async function scanPortsOnWorkspaceHost( if (error instanceof RuntimeClientError && error.code === 'method_not_found') { throw new RuntimeClientError( 'incompatible_runtime', - 'This Orca runtime cannot list workspace ports yet. Update Orca and try again.' + 'This Orca server cannot list workspace ports yet. Update Orca and try again.' ) } throw error diff --git a/src/cli/handlers/profile-state.test.ts b/src/cli/handlers/profile-state.test.ts index 1ded91eaf79..272d5b1dded 100644 --- a/src/cli/handlers/profile-state.test.ts +++ b/src/cli/handlers/profile-state.test.ts @@ -477,7 +477,7 @@ describe('profile-state CLI recovery', () => { expect(existsSync(profile.databaseFile)).toBe(true) expect(vi.mocked(console.log).mock.calls.at(-1)?.[0]).toContain( - '`--environment` does not retarget profile-state recovery' + '`--server` does not retarget profile-state recovery' ) }) diff --git a/src/cli/handlers/project.ts b/src/cli/handlers/project.ts index 798eaa8bdb6..ad7db742930 100644 --- a/src/cli/handlers/project.ts +++ b/src/cli/handlers/project.ts @@ -10,7 +10,11 @@ import type { ProjectHostSetupUpdateArgs, ProjectHostSetupUpdateResult } from '../../shared/project-types' -import { getSshTargetIdForExecutionHost, type ExecutionHostId } from '../../shared/execution-host' +import { + getSshTargetIdForExecutionHost, + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../shared/execution-host' import type { RuntimeStatus } from '../../shared/runtime-types' import { PROJECT_HOST_SETUP_HOST_TARGET_RUNTIME_CAPABILITY } from '../../shared/worktree-runtime-capabilities' import type { CommandHandler, HandlerContext } from '../dispatch' @@ -28,6 +32,7 @@ import { parseHostFlag, resolveHostFlagTarget } from '../execution-host-flag' +import { readOwnerContext } from '../row-owner-server' import { getOptionalRepoKind, getOptionalStringFlag, getRequiredStringFlag } from '../flags' import { findProjectSetups, resolveProjectIdSelector } from '../project-selector' import { resolveRepoPathArgument } from '../repo-path-arguments' @@ -59,10 +64,7 @@ async function getResolvedHostId( client: HandlerContext['client'] ): Promise { const host = await resolveHostFlagTarget(flags, client) - if (!host) { - throw new RuntimeClientError('invalid_argument', 'Missing required --host') - } - return host.id + return host?.id ?? LOCAL_EXECUTION_HOST_ID } // The runtime rejects SSH setup operations regardless of target existence; preserve that refusal. @@ -71,8 +73,9 @@ async function getRequiredHostId( client: HandlerContext['client'] ): Promise { const host = parseHostFlag(flags) + // Without --host the setup belongs to the server the command runs on. if (!host) { - throw new RuntimeClientError('invalid_argument', 'Missing required --host') + return LOCAL_EXECUTION_HOST_ID } if (host.kind !== 'alias') { return host.id @@ -123,7 +126,9 @@ export const PROJECT_HANDLERS: Record = { const setups = projectSetups.filter( (setup) => hostFilter === undefined || hostFilterMatchesHostId(hostFilter, setup.hostId) ) - printResult({ ...result, result: { setups } }, json, formatProjectHostSetupList) + printResult({ ...result, result: { setups } }, json, (value) => + formatProjectHostSetupList(value, readOwnerContext(client)) + ) }, 'project setup-existing-folder': async ({ flags, client, cwd, json }) => { const rawPath = getRequiredStringFlag(flags, 'path') diff --git a/src/cli/handlers/reference.ts b/src/cli/handlers/reference.ts index 22e66511d15..81382aa8555 100644 --- a/src/cli/handlers/reference.ts +++ b/src/cli/handlers/reference.ts @@ -36,7 +36,7 @@ async function callReference( if (error instanceof RuntimeClientError && error.code === 'method_not_found') { throw new RuntimeClientError( 'incompatible_runtime', - 'This Orca host does not support reference commands yet. Update Orca on the execution host.' + 'This Orca server does not support reference commands yet. Update Orca on that server.' ) } throw error diff --git a/src/cli/handlers/skill-sharing.ts b/src/cli/handlers/skill-sharing.ts index 8d4cd883fd3..3d5516e4f82 100644 --- a/src/cli/handlers/skill-sharing.ts +++ b/src/cli/handlers/skill-sharing.ts @@ -134,7 +134,7 @@ async function callShare( if (error instanceof RuntimeRpcFailureError && error.code === 'method_not_found') { throw new RuntimeClientError( 'update_required', - 'The connected Orca runtime does not support agent skill sharing yet. Update Orca on that machine and try again.' + 'The connected Orca server does not support agent skill sharing yet. Update Orca on that machine and try again.' ) } throw error diff --git a/src/cli/handlers/terminal-close.ts b/src/cli/handlers/terminal-close.ts index d11b4e17da8..9d5473728ea 100644 --- a/src/cli/handlers/terminal-close.ts +++ b/src/cli/handlers/terminal-close.ts @@ -74,7 +74,7 @@ export const terminalCloseHandler: CommandHandler = async ({ flags, client, cwd, if (error instanceof RuntimeClientError && error.code === 'method_not_found') { throw new RuntimeClientError( 'incompatible_runtime', - 'This Orca host does not support closing every terminal in a workspace yet. Update Orca on the host and try again.' + 'This Orca server does not support closing every terminal in a workspace yet. Update Orca on the server and try again.' ) } throw error diff --git a/src/cli/handlers/terminal-send.ts b/src/cli/handlers/terminal-send.ts index e9d03856b31..951556a5e17 100644 --- a/src/cli/handlers/terminal-send.ts +++ b/src/cli/handlers/terminal-send.ts @@ -35,7 +35,7 @@ export const terminalSendHandler: CommandHandler = async ({ flags, client, cwd, if (!status.result.runtime.reachable) { throw new RuntimeClientError( 'runtime_unavailable', - 'Orca could not verify prompt-delivery support, so no input was sent. Wait for the execution host to become reachable and retry.' + 'Orca could not verify prompt-delivery support, so no input was sent. Wait for the server to become reachable and retry.' ) } promptDeliverySupported = @@ -46,13 +46,13 @@ export const terminalSendHandler: CommandHandler = async ({ flags, client, cwd, if (retryRequest && !promptDeliverySupported) { throw new RuntimeClientError( 'incompatible_runtime', - 'This Orca host cannot honor --retry-request and never recorded this request ID. This attempt sent no input, but an earlier prompt may have been delivered; inspect the terminal and do not resend unless you independently prove it was not delivered, because updating the host cannot make this specific retry idempotent.' + 'This Orca server cannot honor --retry-request and never recorded this request ID. This attempt sent no input, but an earlier prompt may have been delivered; inspect the terminal and do not resend unless you independently prove it was not delivered, because updating the host cannot make this specific retry idempotent.' ) } if (waitSubmitMs && !promptDeliverySupported) { throw new RuntimeClientError( 'incompatible_runtime', - 'This Orca host does not support --wait-submit. No input was sent; update Orca on the execution host, or omit only --wait-submit for a legacy prompt whose delivery cannot be observed or retried safely.' + 'This Orca server does not support --wait-submit. No input was sent; update Orca on the server, or omit only --wait-submit for a legacy prompt whose delivery cannot be observed or retried safely.' ) } const params = { @@ -86,7 +86,7 @@ export const terminalSendHandler: CommandHandler = async ({ flags, client, cwd, throw attachUnverifiedTerminalPromptRecovery( new RuntimeClientError( 'incompatible_runtime', - 'The Orca host changed after prompt-delivery support was verified and accepted input without returning a durable prompt receipt.' + 'The Orca server changed after prompt-delivery support was verified and accepted input without returning a durable prompt receipt.' ) ) } diff --git a/src/cli/handlers/terminal.ts b/src/cli/handlers/terminal.ts index 9dbfafd6312..175910af232 100644 --- a/src/cli/handlers/terminal.ts +++ b/src/cli/handlers/terminal.ts @@ -34,6 +34,7 @@ import { type WithAnnotatedHostScope } from '../omitted-host-scope-selectors' import { RuntimeClientError } from '../runtime-client' +import { readOwnerContext } from '../row-owner-server' import { isSupportedWindowsShellOverride, listSupportedWindowsShellOverrides @@ -80,7 +81,7 @@ export const TERMINAL_HANDLERS: Record = { } ) await annotateOmittedHostScope(result.result) - printResult(result, json, formatTerminalList) + printResult(result, json, (value) => formatTerminalList(value, readOwnerContext(client))) }, 'terminal show': async ({ flags, client, cwd, json }) => { const result = await client.call<{ terminal: RuntimeTerminalShow }>('terminal.show', { @@ -115,7 +116,7 @@ export const TERMINAL_HANDLERS: Record = { if (screen && result.result.terminal.source === undefined) { throw new RuntimeClientError( 'incompatible_runtime', - 'This Orca host does not support --screen reads, so it answered with accumulated output instead of the rendered screen. Update Orca on the host, or drop --screen to read accumulated output deliberately.' + 'This Orca server does not support --screen reads, so it answered with accumulated output instead of the rendered screen. Update Orca on the server, or drop --screen to read accumulated output deliberately.' ) } printResult(result, json, formatTerminalRead) @@ -186,7 +187,7 @@ export const TERMINAL_HANDLERS: Record = { if (!status.result.runtime.reachable) { throw new RuntimeClientError( 'runtime_unavailable', - 'Orca could not verify --shell support on the execution host, so no terminal was created. Wait for the execution host to become reachable and retry.' + 'Orca could not verify --shell support on the server, so no terminal was created. Wait for the server to become reachable and retry.' ) } if ( @@ -196,7 +197,7 @@ export const TERMINAL_HANDLERS: Record = { ) { throw new RuntimeClientError( 'incompatible_runtime', - 'This Orca host does not support --shell, and would silently create a terminal running its default shell instead. No terminal was created; update Orca on the execution host.' + 'This Orca server does not support --shell, and would silently create a terminal running its default shell instead. No terminal was created; update Orca on the server.' ) } } @@ -234,7 +235,7 @@ export const TERMINAL_HANDLERS: Record = { if (!status.result.runtime.reachable) { throw new RuntimeClientError( 'runtime_unavailable', - 'Orca could not verify --retry-split support on the execution host, so nothing was split. Wait for the execution host to become reachable and retry.' + 'Orca could not verify --retry-split support on the server, so nothing was split. Wait for the server to become reachable and retry.' ) } if ( @@ -243,7 +244,7 @@ export const TERMINAL_HANDLERS: Record = { ) { throw new RuntimeClientError( 'incompatible_runtime', - 'This Orca host does not support --retry-split and would split again. Nothing was split; check `orca terminal list --json` for the pane instead.' + 'This Orca server does not support --retry-split and would split again. Nothing was split; check `orca terminal list --json` for the pane instead.' ) } } diff --git a/src/cli/handlers/worktree-address-annotation.ts b/src/cli/handlers/worktree-address-annotation.ts index a543e1b7f9b..9fd89c83e67 100644 --- a/src/cli/handlers/worktree-address-annotation.ts +++ b/src/cli/handlers/worktree-address-annotation.ts @@ -1,6 +1,16 @@ import type { RuntimeWorktreePsSummary, RuntimeWorktreeRecord } from '../../shared/runtime-types' import type { RuntimeClient } from '../runtime-client' -import { addressableOfPsRow, addressableOfShowRecord, annotateListing } from '../workspace-address' +import type { + CrossStoreWorkspaceLineage, + WorkspaceLineage, + WorktreeLineage +} from '../../shared/worktree/lineage-types' +import { + addressableOfPsRow, + addressableOfShowRecord, + annotateListing, + formatParentText +} from '../workspace-address' import { callerOrcaClient } from './worktree-parent-fields' /** Annotates `worktree ps` rows; the returned function applies them to any rows aligned by index. */ @@ -16,7 +26,7 @@ export async function annotatePsRows( return (aligned) => aligned.map((row, index) => ({ ...row, ...annotations[index] })) } -/** A `worktree show` record with its environment, address and parent. */ +/** A `worktree show` record with its server, address and parent. */ export async function annotateShown< Response extends { result: { worktree: RuntimeWorktreeRecord } } >(client: RuntimeClient, response: Response): Promise { @@ -28,3 +38,40 @@ export async function annotateShown< result: { ...response.result, worktree: { ...response.result.worktree, ...annotation } } } } + +type MutationResult = { + worktree: RuntimeWorktreeRecord + lineage?: WorktreeLineage | null + workspaceLineage?: WorkspaceLineage | null + crossStoreLineage?: CrossStoreWorkspaceLineage | null +} + +/** + * A create/set result annotated the way `show` is, so its summary prints the same parent line as + * `ps`. Reporting only: an annotation failure keeps the unannotated result. + */ +export async function annotateMutationResult( + client: RuntimeClient, + response: Response +): Promise<{ response: Response; parentText: string | null }> { + const { worktree, lineage, workspaceLineage, crossStoreLineage } = response.result + try { + const [annotation] = await annotateListing(client, () => callerOrcaClient(client), [ + addressableOfShowRecord({ + ...worktree, + parentWorktreeId: worktree.parentWorktreeId ?? lineage?.parentWorktreeId ?? null, + workspaceLineage: worktree.workspaceLineage ?? workspaceLineage ?? null, + crossStoreLineage: worktree.crossStoreLineage ?? crossStoreLineage ?? null + }) + ]) + return { + response: { + ...response, + result: { ...response.result, worktree: { ...worktree, ...annotation } } + }, + parentText: formatParentText(annotation) + } + } catch { + return { response, parentText: null } + } +} diff --git a/src/cli/handlers/worktree-create-agent-launch.ts b/src/cli/handlers/worktree-create-agent-launch.ts index 05f24c713ef..d3b275fa994 100644 --- a/src/cli/handlers/worktree-create-agent-launch.ts +++ b/src/cli/handlers/worktree-create-agent-launch.ts @@ -1,4 +1,4 @@ -// Use agent.launch for surface/model/effort; older hosts fall back to the create startup terminal. +// Use agent.launch for surface/model/effort; older servers fall back to the create startup terminal. import type { AgentLaunchResult } from '../../shared/agent-launch/contracts/agent-launch-intent' import { @@ -17,6 +17,7 @@ import { import { formatWorktreeShow, printResult } from '../format' import { RuntimeClientError, type RuntimeClient } from '../runtime-client' import { printLineageSummary } from './worktree-lineage-summary' +import { annotateMutationResult } from './worktree-address-annotation' import { printHookWarning } from './worktree-removal-warnings' import { withSetupDecisionRecovery } from './worktree-setup-decision-recovery' import { withCliAgentLaunchRecovery } from '../agent-launch-recovery' @@ -25,7 +26,7 @@ type WorktreeAgentLaunchResult = Pick< RuntimeWorktreeCreateResult, 'lineage' | 'workspaceLineage' | 'crossStoreLineage' > & { - /** Absent only when the host could not show the worktree it just created. */ + /** Absent only when the server could not show the worktree it just created. */ worktree?: RuntimeWorktreeRecord launch: AgentLaunchResult } @@ -47,13 +48,13 @@ export async function createWorktreeWithAgent(args: { if (launch.operationId) { throw new RuntimeClientError( 'agent_session_operation_unknown', - 'This host cannot replay the earlier launch. Return to the original execution host; do not retry without --retry-launch.' + 'This server cannot replay the earlier launch. Return to the server that started it; do not retry without --retry-launch.' ) } if (hasLaunchModelFlags(flags)) { throw new RuntimeClientError( 'incompatible_runtime', - 'This Orca host cannot start an agent on a chosen model or effort. Update Orca on the execution host, or omit --model and --effort.' + "This Orca server can't start an agent on a chosen model or effort. Update Orca on that server, or omit --model and --effort." ) } if (launch.surface) { @@ -74,9 +75,10 @@ export async function createWorktreeWithAgent(args: { } ) ) - printHookWarning(created.result, json) - printLineageSummary(created.result, json) - printResult(created, json, formatWorktreeShow) + const { response, parentText } = await annotateMutationResult(client, created) + printHookWarning(response.result, json) + printLineageSummary(response.result, json, parentText) + printResult(response, json, formatWorktreeShow) return } const launched = await withSetupDecisionRecovery( @@ -92,7 +94,11 @@ export async function createWorktreeWithAgent(args: { ), launch.operationId !== undefined ) - const worktree = await showLaunchedWorktree(client, launched.result.worktreeId) + const shown = await showLaunchedWorktree(client, launched.result.worktreeId) + const annotated = shown + ? await annotateMutationResult(client, { result: { worktree: shown } }) + : undefined + const worktree = annotated?.response.result.worktree const result: WorktreeAgentLaunchResult = { ...(worktree ? { @@ -104,7 +110,7 @@ export async function createWorktreeWithAgent(args: { : { lineage: null }), launch: launched.result } - printLineageSummary(result, json) + printLineageSummary(result, json, annotated?.parentText ?? null) printResult({ ...launched, result }, json, (value) => [ ...(value.worktree ? [formatWorktreeShow({ worktree: value.worktree })] : []), diff --git a/src/cli/handlers/worktree-lineage-summary.ts b/src/cli/handlers/worktree-lineage-summary.ts index b3e88e82698..772f5e2eafb 100644 --- a/src/cli/handlers/worktree-lineage-summary.ts +++ b/src/cli/handlers/worktree-lineage-summary.ts @@ -19,35 +19,42 @@ function getLineageSourceLabel(source: string): string { } } -/** The summary line for a parent saved in another Orca store. */ -export function formatCrossStoreParentLine( - lineage: NonNullable +/** + * The stderr parent summary for create/set: the `ps` parent text plus how the parent was captured. + * `parentText` comes from the result's annotation; without one, a cross-store parent's server is unknown. + */ +function parentSummaryText( + parentText: string | null, + fallback: string, + capture: { confidence: string; source: string } ): string { - return `parent: ${lineage.parent.workspaceKey} on another machine (${lineage.capture.confidence} from ${getLineageSourceLabel(lineage.capture.source)})` -} - -export function formatFolderParentLine( - lineage: NonNullable -): string { - return `parent: ${lineage.parentWorkspaceKey} (folder workspace)` + return `parent: ${parentText ?? fallback} (${capture.confidence} from ${getLineageSourceLabel(capture.source)})` } /** The parent `worktree set` attached; same-store lineage fields stay null for both kinds. */ export function printSetParentLine( worktree: RuntimeWorktreeRecord, - parentFields: { crossStoreParent?: unknown; parentWorktree?: string } + parentFields: { crossStoreParent?: unknown; parentWorktree?: string }, + parentText: string | null ): void { if (parentFields.crossStoreParent && worktree.crossStoreLineage) { - console.error(formatCrossStoreParentLine(worktree.crossStoreLineage)) + const { parent, capture } = worktree.crossStoreLineage + console.error(parentSummaryText(parentText, crossStoreFallback(parent.workspaceKey), capture)) } else if (parentFields.parentWorktree && worktree.workspaceLineage) { - console.error(formatFolderParentLine(worktree.workspaceLineage)) + const { parentWorkspaceKey, capture } = worktree.workspaceLineage + console.error(parentSummaryText(parentText, parentWorkspaceKey, capture)) } } +function crossStoreFallback(workspaceKey: string): string { + return `${workspaceKey} server=unknown (no verified route here)` +} + export function printLineageSummary( result: Pick & Partial>, - json: boolean + json: boolean, + parentText: string | null = null ): void { if (json) { return @@ -56,21 +63,18 @@ export function printLineageSummary( console.error(`warning: ${warning.message}`) } if (result.crossStoreLineage) { - console.error(formatCrossStoreParentLine(result.crossStoreLineage)) + const { parent, capture } = result.crossStoreLineage + console.error(parentSummaryText(parentText, crossStoreFallback(parent.workspaceKey), capture)) return } if (result.workspaceLineage) { const { parentWorkspaceKey, capture } = result.workspaceLineage - console.error( - `parent: ${parentWorkspaceKey} (${capture.confidence} from ${getLineageSourceLabel(capture.source)})` - ) + console.error(parentSummaryText(parentText, parentWorkspaceKey, capture)) return } if (result.lineage) { const { parentWorktreeId, capture } = result.lineage - console.error( - `parent: ${parentWorktreeId} (${capture.confidence} from ${getLineageSourceLabel(capture.source)})` - ) + console.error(parentSummaryText(parentText, `id:${parentWorktreeId}`, capture)) return } console.error('parent: none') diff --git a/src/cli/handlers/worktree-parent-environment.ts b/src/cli/handlers/worktree-parent-environment.ts index 73ae5caac22..a5f1a096b6a 100644 --- a/src/cli/handlers/worktree-parent-environment.ts +++ b/src/cli/handlers/worktree-parent-environment.ts @@ -13,10 +13,10 @@ import { mayNameFolderWorkspace } from '../folder-workspace-selector' import { isLocalEnvironmentSelector, LOCAL_ENVIRONMENT } from '../local-environment-selector' import { RuntimeClient, RuntimeClientError, type RuntimeRpcSuccess } from '../runtime-client' import { quoteCliCommandArgument } from '../shell-command-quote' -import { describeClientEnvironment, environmentLabel } from '../workspace-address' +import { describeClientServer, serverLabel } from '../row-owner-server' import { attachCliErrorData } from './worktree-setup-decision-recovery' -/** The Orca a parent lives in: `local` or a saved environment's id. */ +/** The server a parent lives on: `local` or a saved server's id. */ export type ParentEnvironment = { route: string; name: string } const LOCAL: ParentEnvironment = { route: LOCAL_ENVIRONMENT, name: LOCAL_ENVIRONMENT } @@ -36,43 +36,43 @@ function savedParentEnvironment(userDataPath: string, value: string): ParentEnvi if (byName.length > 1) { throw new RuntimeClientError( 'invalid_argument', - `--parent-environment ${value} is ambiguous: ${byName.length} saved environments have that name. Use the environment id.`, - { nextSteps: byName.map((environment) => `--parent-environment ${environment.id}`) } + `--parent-server ${value} is ambiguous: ${byName.length} saved servers have that name. Use the server id.`, + { nextSteps: byName.map((environment) => `--parent-server ${environment.id}`) } ) } throw new RuntimeClientError( - 'environment_not_paired', - `--parent-environment ${value} is not a saved environment here, so its workspaces can't be reached from this machine.`, + 'server_not_saved', + `--parent-server ${value} is not a saved server here, so its workspaces can't be reached from here.`, { - environment: value, - knownEnvironments: saved.map(({ id, name }) => ({ id, name })), + server: value, + knownServers: saved.map(({ id, name }) => ({ id, name })), nextSteps: [ - 'Pass local, or the id or name of a saved environment from `orca environment list`.', - 'Pair it first with `orca environment add --name --pairing-code `.' + "Pass local, or a saved server's id or name from `orca server list`.", + 'Save it first with `orca server add --name --pairing-code `.' ] } ) } /** - * Which environment `--parent-worktree` names, when that differs from the child's. Undefined keeps - * same-environment parents. A caller-relative parent (active/current) is always on the caller's own - * Orca, so against another environment it is implicitly `local`. + * Which server `--parent-worktree` names, when that differs from the child's. Undefined keeps + * same-server parents. A caller-relative parent (active/current) is always on the caller's own + * Orca, so against another server it is implicitly `local`. */ export function resolveParentEnvironment( flags: Map, client: RuntimeClient ): ParentEnvironment | undefined { const parentSelector = getOptionalStringFlag(flags, 'parent-worktree') - const value = getOptionalStringFlag(flags, 'parent-environment') - if (flags.has('parent-environment')) { + const value = getOptionalStringFlag(flags, 'parent-server') + if (flags.has('parent-server')) { if (value === undefined) { - throw new RuntimeClientError('invalid_argument', 'Missing required --parent-environment') + throw new RuntimeClientError('invalid_argument', 'Missing required --parent-server') } if (flags.get('no-parent') === true || !parentSelector) { throw new RuntimeClientError( 'invalid_argument', - '--parent-environment says where --parent-worktree lives; pass it with --parent-worktree, not with --no-parent or alone.' + '--parent-server says which server holds --parent-worktree; pass it with --parent-worktree, not with --no-parent or alone.' ) } } @@ -84,17 +84,17 @@ export function resolveParentEnvironment( if (isCallerRelative(parentSelector) && named && named.route !== LOCAL_ENVIRONMENT) { throw new RuntimeClientError( 'invalid_argument', - `--parent-worktree ${parentSelector} names the workspace containing this terminal or cwd, which is on this machine's own Orca, not ${named.name}.`, + `--parent-worktree ${parentSelector} names the workspace containing this terminal or cwd, which is on the Orca on this computer, not ${named.name}.`, { nextSteps: [ - `Drop --parent-environment, or pass --parent-environment local.`, - `For a workspace in ${named.name}, list it with \`orca worktree ps --environment ${quoteCliCommandArgument(named.route)} --json\` and pass its address.worktree as --parent-worktree.` + 'Drop --parent-server, or pass --parent-server local.', + `For a workspace on ${named.name}, list it with \`orca worktree ps --server ${quoteCliCommandArgument(named.route)} --json\` and pass its address.worktree as --parent-worktree.` ] } ) } const parentEnvironment = named ?? (isCallerRelative(parentSelector) ? LOCAL : undefined) - return parentEnvironment && parentEnvironment.route !== describeClientEnvironment(client).id + return parentEnvironment && parentEnvironment.route !== describeClientServer(client).id ? parentEnvironment : undefined } @@ -117,11 +117,11 @@ async function assertChildSavesCrossStoreParents(client: RuntimeClient): Promise if (supportsCrossStoreLineage(status.capabilities)) { return } - const environment = describeClientEnvironment(client) + const server = describeClientServer(client) throw new RuntimeClientError( 'incompatible_runtime', - `Update Orca in ${environmentLabel(environment)} to nest workspaces under a parent in another environment. Nothing was changed.`, - { environment: environment.id, requires: WORKTREE_CROSS_STORE_LINEAGE_RUNTIME_CAPABILITY } + `Update Orca on ${serverLabel(server)} to nest workspaces under a parent on another server. Nothing was changed.`, + { server: server.id, requires: WORKTREE_CROSS_STORE_LINEAGE_RUNTIME_CAPABILITY } ) } @@ -130,11 +130,11 @@ function unavailableError(error: unknown, environment: ParentEnvironment): unkno return error } return new RuntimeClientError( - 'environment_unavailable', + 'server_unavailable', `${environment.name} didn't answer, so the parent couldn't be checked. Nothing was changed. (${error.message})`, { - environment: environment.route, - nextSteps: [`orca status --environment ${quoteCliCommandArgument(environment.route)} --json`] + server: environment.route, + nextSteps: [`orca status --server ${quoteCliCommandArgument(environment.route)} --json`] } ) } @@ -145,7 +145,7 @@ function isParentLookupCode(code: string): code is ParentLookupCode { return code === 'LINEAGE_PARENT_NOT_FOUND' || code === 'LINEAGE_PARENT_AMBIGUOUS' } -/** The lineage code for a parent lookup's own error, as the runtime reports an explicit parent. */ +/** The lineage code for a parent lookup's own error, as the server reports an explicit parent. */ function parentLookupCode(error: RuntimeClientError): ParentLookupCode | undefined { if (isParentLookupCode(error.code)) { return error.code @@ -158,8 +158,8 @@ function parentLookupCode(error: RuntimeClientError): ParentLookupCode | undefin } /** - * Error data for a parent miss or ambiguity: the environment searched, and recovery that lists that - * environment. Inherited steps are dropped because they inspect the caller's default route. + * Error data for a parent miss or ambiguity: the server searched, and recovery that lists that + * server. Inherited steps are dropped because they inspect the caller's default route. */ function searchedEnvironmentData( error: RuntimeClientError, @@ -168,16 +168,16 @@ function searchedEnvironmentData( extraSteps: readonly string[] = [] ): Record { const list = environment.route - ? `orca worktree ps --environment ${quoteCliCommandArgument(environment.route)} --json` + ? `orca worktree ps --server ${quoteCliCommandArgument(environment.route)} --json` : undefined const listStep = list ? code === 'LINEAGE_PARENT_AMBIGUOUS' ? `Compare the choices with \`${list}\`, then pass one as --parent-worktree.` : list - : 'This one-off connection has no listing route; save it with `orca environment add --name --pairing-code `, then run `orca worktree ps --environment --json`.' + : 'This one-off connection has no listing route; save it with `orca server add --name --pairing-code `, then run `orca worktree ps --server --json`.' return { ...(error.data && typeof error.data === 'object' ? error.data : {}), - environment: environment.route, + server: environment.route, nextSteps: [listStep, ...extraSteps] } } @@ -192,14 +192,14 @@ function parentLookupError(error: unknown, environment: ParentEnvironment): unkn } const message = code === 'LINEAGE_PARENT_NOT_FOUND' - ? `No workspace in ${environment.name} matched the parent selector. Nothing was changed; no other environment was searched.` - : `${error.message} (in ${environment.name}; nothing was changed)` + ? `No workspace on ${environment.name} matched the parent selector. Nothing was changed; no other server was searched.` + : `${error.message} (on ${environment.name}; nothing was changed)` return new RuntimeClientError(code, message, searchedEnvironmentData(error, code, environment)) } /** - * The verified ref a child saves for a parent in another environment, built as the app builds it: - * the parent store's own installationId plus the parent row's identity. No other environment is + * The verified ref a child saves for a parent on another server, built as the app builds it: + * the parent store's own installationId plus the parent row's identity. No other server is * searched, and every check runs before the child is changed. */ export async function resolveCrossEnvironmentParent( @@ -230,9 +230,9 @@ export async function resolveCrossEnvironmentParent( if (!installationId) { throw new RuntimeClientError( 'incompatible_runtime', - `Update Orca in ${environment.name} so workspaces in other environments can name it as a parent. Nothing was changed.`, + `Update Orca on ${environment.name} so workspaces on other servers can name it as a parent. Nothing was changed.`, { - environment: environment.route, + server: environment.route, requires: WORKTREE_CROSS_STORE_LINEAGE_RUNTIME_CAPABILITY } ) @@ -249,7 +249,7 @@ export async function resolveCrossEnvironmentParent( } } -/** Sends a create/set; a miss or ambiguity on its same-environment parent names where it looked +/** Sends a create/set; a miss or ambiguity on its same-server parent names where it looked * and how to list it, and a miss says how to name a parent elsewhere. */ export async function callNamingParentEnvironment< T, @@ -274,16 +274,16 @@ export async function callNamingParentEnvironment< throw error } const code = error.code - const environment = describeClientEnvironment(client) + const environment = describeClientServer(client) throw attachCliErrorData( error, searchedEnvironmentData( error, code, - { route: environment.id, name: environmentLabel(environment) }, + { route: environment.id, name: serverLabel(environment) }, code === 'LINEAGE_PARENT_NOT_FOUND' ? [ - `Only ${environmentLabel(environment)} was searched for "${parentSelector}". For a parent in another environment, add --parent-environment (a row's address.environment from \`orca worktree ps --environment --json\`).` + `Only ${serverLabel(environment)} was searched for "${parentSelector}". For a parent on another server, add --parent-server (a row's address.server from \`orca worktree ps --server --json\`).` ] : [] ) diff --git a/src/cli/handlers/worktree-removal-request.ts b/src/cli/handlers/worktree-removal-request.ts index bc1cb0c2f73..580de32ec4d 100644 --- a/src/cli/handlers/worktree-removal-request.ts +++ b/src/cli/handlers/worktree-removal-request.ts @@ -35,7 +35,7 @@ export async function requestWorktreeRemoval( if (!parsed.success) { throw new RuntimeClientError( 'invalid_runtime_response', - 'The Orca host returned an invalid status response.' + 'The Orca server returned an invalid status response.' ) } if ( @@ -44,7 +44,7 @@ export async function requestWorktreeRemoval( return deleteBranch === undefined ? legacy : { ...legacy, deleteBranch } } console.error( - 'warning: This Orca host is older and uses its existing branch policy. Keep-by-default and --delete-branch do not apply.' + 'warning: This Orca server is older and uses its existing branch policy. Keep-by-default and --delete-branch do not apply.' ) return legacy }, diff --git a/src/cli/handlers/worktree.ts b/src/cli/handlers/worktree.ts index d1ff9d7bf72..1620575c2b1 100644 --- a/src/cli/handlers/worktree.ts +++ b/src/cli/handlers/worktree.ts @@ -34,7 +34,12 @@ import { createWorktreeWithAgent } from './worktree-create-agent-launch' import { printLineageSummary, printSetParentLine } from './worktree-lineage-summary' import { resolveCreateParentFields, resolveSetParentFields } from './worktree-parent-fields' import { callNamingParentEnvironment } from './worktree-parent-environment' -import { annotatePsRows, annotateShown } from './worktree-address-annotation' +import { + annotateMutationResult, + annotatePsRows, + annotateShown +} from './worktree-address-annotation' +import { readOwnerContext } from '../row-owner-server' import { refuseCurrentForRemoval } from './worktree-removal-current-refusal' import { projectWorktreePsTerminalVerdict } from '../worktree-ps-terminal-verdict' import { @@ -101,7 +106,7 @@ export const WORKTREE_HANDLERS: Record = { } ) await annotateOmittedHostScope(result.result) - printResult(result, json, formatWorktreeList) + printResult(result, json, (value) => formatWorktreeList(value, readOwnerContext(client))) }, 'worktree show': async ({ flags, client, cwd, json }) => { const result = await client.call<{ worktree: RuntimeWorktreeRecord }>('worktree.show', { @@ -204,11 +209,12 @@ export const WORKTREE_HANDLERS: Record = { await createWorktreeWithAgent({ client, flags, create, launch: agentLaunch, json, rawArgs }) return } - const result = await withSetupDecisionRecovery( + const created = await withSetupDecisionRecovery( callNamingParentEnvironment(client, 'worktree.create', create) ) + const { response: result, parentText } = await annotateMutationResult(client, created) printHookWarning(result.result, json) - printLineageSummary(result.result, json) + printLineageSummary(result.result, json, parentText) printResult(result, json, formatWorktreeShow) }, 'worktree set': async ({ flags, client, cwd, json }) => { @@ -240,7 +246,7 @@ export const WORKTREE_HANDLERS: Record = { ...parentFields, noParent: flags.get('no-parent') === true }) - const result = await withWorktreeSelectorRecovery( + const updated = await withWorktreeSelectorRecovery( pending, parentSelector ? [ @@ -249,11 +255,12 @@ export const WORKTREE_HANDLERS: Record = { ] : [] ) + const { response: result, parentText } = await annotateMutationResult(client, updated) if (!json) { for (const warning of result.result.warnings ?? []) { console.error(`warning: ${warning.message}`) } - printSetParentLine(result.result.worktree, parentFields) + printSetParentLine(result.result.worktree, parentFields, parentText) } printResult(result, json, formatWorktreeShow) }, @@ -270,7 +277,7 @@ export const WORKTREE_HANDLERS: Record = { if (!hostId) { throw new RuntimeClientError( 'worktree_host_unresolved', - 'Orca cannot tell which host owns this workspace. Refresh projects and try again.' + 'Orca cannot tell which server owns this workspace. Refresh projects and try again.' ) } if (flags.get('allow-failed-archive-hook') === true && flags.get('run-hooks') !== true) { diff --git a/src/cli/help.ts b/src/cli/help.ts index 65afa70ee63..5a6fdc4720f 100644 --- a/src/cli/help.ts +++ b/src/cli/help.ts @@ -1,6 +1,7 @@ import type { CommandSpec } from './args' import { findCommandSpec, isCommandGroup, matches, supportsBrowserPageFlag } from './args' import { unknownCommandData } from './command-suggestion' +import { INPUT_ONLY_FLAGS } from './command-spec' import { formatCommandScopedFlagHelp } from './command-scoped-flag-help' import { FLAG_HELP_TEXT } from './flag-help-text' import { ROOT_HELP_TEXT_PRIMARY } from './root-help-text-primary' @@ -34,9 +35,9 @@ export function formatCommandHelp(spec: CommandSpec): string { const displayedFlags = spec.argumentMode === 'passthrough' ? [] - : supportsBrowserPageFlag(spec) - ? [...spec.allowedFlags, 'page'] - : spec.allowedFlags + : (supportsBrowserPageFlag(spec) ? [...spec.allowedFlags, 'page'] : spec.allowedFlags).filter( + (flag) => !INPUT_ONLY_FLAGS.has(flag) + ) if (displayedFlags.length > 0) { lines.push('', 'Options:') diff --git a/src/cli/host-handler-groups.ts b/src/cli/host-handler-groups.ts index 160656e60ba..69088e86ec0 100644 --- a/src/cli/host-handler-groups.ts +++ b/src/cli/host-handler-groups.ts @@ -1,31 +1,31 @@ import type { HandlerGroup } from './handler-group-manifest' -// The machines Orca reaches: saved hosts and paired environments, the Orca servers it manages on -// them, and recipe VMs. +// The Orca servers this computer reaches: saved servers, the servers it manages over SSH, its SSH +// connections, and recipe VMs. export const HOST_HANDLER_GROUPS: readonly HandlerGroup[] = [ { name: 'environment', keys: [ - 'host name', + 'server name', 'host list', 'host rm', - 'environment add', - 'environment list', - 'environment show', - 'environment rm' + 'server add', + 'server list', + 'server show', + 'server rm' ], load: async () => (await import('./handlers/environment.js')).ENVIRONMENT_HANDLERS }, { name: 'managed-server', keys: [ - 'environment status', - 'environment update', - 'environment rollback', - 'environment recover', - 'environment stop', - 'environment cancel-stop', - 'environment forget' + 'server status', + 'server update', + 'server rollback', + 'server recover', + 'server stop', + 'server cancel-stop', + 'server forget' ], load: async () => (await import('./handlers/managed-server.js')).MANAGED_SERVER_HANDLERS }, diff --git a/src/cli/host-selector-alternatives.test.ts b/src/cli/host-selector-alternatives.test.ts index 3a5ef8c1d2f..78d236ec285 100644 --- a/src/cli/host-selector-alternatives.test.ts +++ b/src/cli/host-selector-alternatives.test.ts @@ -48,18 +48,17 @@ describe('findEnvironmentByName', () => { describe('crossKindNextSteps', () => { const alternatives = { sshTargets: SSH_TARGETS, environments: ENVIRONMENTS } - it('points an SSH name at the SSH flag when a server was asked for', () => { - const steps = crossKindNextSteps('openclaw', alternatives, 'environment') + it('never offers an SSH connection as a place to run', () => { + const steps = crossKindNextSteps('openclaw', alternatives, 'server') - expect(steps.join('\n')).toContain('--host ssh:ssh-1755000000000-a1b2c3') - expect(steps.join('\n')).toContain('is an SSH target') + expect(steps.join('\n')).toContain('`orca server list`') + expect(steps.join('\n')).not.toContain('--host') }) - it('points a server name at --environment when an SSH target was asked for', () => { + it('points a server name at --server when an SSH target was asked for', () => { const steps = crossKindNextSteps('awin', alternatives, 'ssh') - expect(steps.join('\n')).toContain('--environment awin') - expect(steps.join('\n')).toContain('is a paired Orca server') + expect(steps.join('\n')).toContain('--server 03ef704c-b180-4b10-998d-e28fbd5de9a3') }) it('says nothing when the name exists on neither axis', () => { @@ -68,7 +67,7 @@ describe('crossKindNextSteps', () => { it('does not suggest the axis that was already requested', () => { expect(crossKindNextSteps('openclaw', alternatives, 'ssh')).toEqual([]) - expect(crossKindNextSteps('awin', alternatives, 'environment')).toEqual([]) + expect(crossKindNextSteps('awin', alternatives, 'server')).toEqual([]) }) }) @@ -94,19 +93,12 @@ describe('resolveSshHostTargetId', () => { ).rejects.toMatchObject({ code: 'invalid_argument', data: { - nextSteps: expect.arrayContaining([expect.stringContaining('--environment awin')]) + nextSteps: expect.arrayContaining([ + expect.stringContaining('--server 03ef704c-b180-4b10-998d-e28fbd5de9a3') + ]) } }) }) - - it('says so plainly when the host has no SSH targets at all', async () => { - await expect( - resolveSshHostTargetId(clientReturning([]), 'openclaw', ENVIRONMENTS) - ).rejects.toMatchObject({ - code: 'invalid_argument', - data: { nextSteps: expect.arrayContaining(['This Orca host has no SSH targets registered.']) } - }) - }) }) describe('listSshTargets', () => { @@ -188,10 +180,10 @@ describe('ambiguous names never resolve silently', () => { ).rejects.toMatchObject({ code: 'invalid_argument', data: { - nextSteps: expect.arrayContaining([ - expect.stringContaining('ssh-1-a'), - expect.stringContaining('ssh-2-b') - ]) + knownSshTargets: [ + expect.objectContaining({ id: 'ssh-1-a' }), + expect.objectContaining({ id: 'ssh-2-b' }) + ] } }) }) diff --git a/src/cli/host-selector-alternatives.ts b/src/cli/host-selector-alternatives.ts index 9e4db8d4508..845b47dd724 100644 --- a/src/cli/host-selector-alternatives.ts +++ b/src/cli/host-selector-alternatives.ts @@ -72,23 +72,24 @@ export function ambiguousEnvironments( return byName.length > 1 ? byName : [] } +/** SSH is how a server is set up, never a place to run; Orca does not guess which server it hosts. */ +export function sshConnectionStep(name: string): string { + return `"${name}" is an SSH connection, not a server. If Orca runs a server there, it is in \`orca server list\`; otherwise set it up in Settings → SSH Hosts.` +} + export function crossKindNextSteps( name: string, alternatives: HostAlternatives, - requested: 'environment' | 'ssh' + requested: 'server' | 'ssh' ): string[] { const steps: string[] = [] const ssh = findSshTargetByName(alternatives.sshTargets, name) - const environment = findEnvironmentByName(alternatives.environments, name) + const server = findEnvironmentByName(alternatives.environments, name) if (requested !== 'ssh' && ssh) { - steps.push( - `"${name}" is an SSH target on this Orca host, not a paired server. Use --host ssh:${ssh.id}.` - ) + steps.push(sshConnectionStep(name)) } - if (requested !== 'environment' && environment) { - steps.push( - `"${name}" is a paired Orca server, not an SSH target. Use --environment ${environment.name}.` - ) + if (requested !== 'server' && server) { + steps.push(`"${name}" is a saved server, not an SSH connection. Use --server ${server.id}.`) } return steps } @@ -167,23 +168,21 @@ export async function resolveSshHostTargetId( `Ambiguous SSH target in ${flagSpelling}: ${ambiguous.length} targets share that label. Use the target id.`, { knownSshTargets: ambiguous, - nextSteps: ambiguous.map((target) => `Use --host ssh:${target.id} for ${target.label}.`) + nextSteps: [sshConnectionStep(targetId)] } ) } throw new RuntimeClientError( 'invalid_argument', bareName - ? `Unknown host in ${flagSpelling}: it is not this machine or a paired Orca server the command can use, and the connected Orca host has no SSH target named ${targetId}. Run \`orca host list\` to see every name.` - : `Unknown SSH target in ${flagSpelling}: this Orca host has no SSH target named or with id ${targetId}.`, + ? `Unknown name in ${flagSpelling}: it is not this computer, a saved server, or an SSH connection of the answering server.` + : `Unknown SSH target in ${flagSpelling}: the answering Orca server has no SSH target named or with id ${targetId}.`, { knownSshTargets: targets, - knownEnvironments: environments, + knownServers: environments, nextSteps: [ ...crossKindNextSteps(targetId, { sshTargets: targets, environments }, 'ssh'), - ...(targets.length > 0 - ? [`Known SSH targets: ${targets.map((target) => target.label).join(', ')}.`] - : ['This Orca host has no SSH targets registered.']) + 'To run on another server, use --server ; `orca server list` prints each id.' ] } ) diff --git a/src/cli/index-environment-commands.test.ts b/src/cli/index-environment-commands.test.ts index c2282c520d5..56be8a6017c 100644 --- a/src/cli/index-environment-commands.test.ts +++ b/src/cli/index-environment-commands.test.ts @@ -56,7 +56,7 @@ describe('orca cli worktree awareness', () => { spawnMock }) - it('lists saved environments even when ORCA_ENVIRONMENT is set', async () => { + it('lists saved servers under the old spelling even when ORCA_ENVIRONMENT is set', async () => { process.env.ORCA_ENVIRONMENT = 'stale-env' listEnvironmentsMock.mockReturnValue([addEnvironmentFromPairingCodeMock()]) const logSpy = vi.spyOn(console, 'log').mockImplementation(() => {}) @@ -68,7 +68,7 @@ describe('orca cli worktree awareness', () => { expect(JSON.parse(String(logSpy.mock.calls[0]?.[0]))).toMatchObject({ ok: true, result: { - environments: [ + servers: [ { id: 'env-1', name: 'desk', diff --git a/src/cli/index-environment-local.test.ts b/src/cli/index-environment-local.test.ts index 5444e653a18..820b5fe792f 100644 --- a/src/cli/index-environment-local.test.ts +++ b/src/cli/index-environment-local.test.ts @@ -90,7 +90,23 @@ describe('--environment local and workspace addresses', () => { [['worktree', 'ps', '--pairing-code', 'orca://pair?code=x', '--environment', 'local']], [['worktree', 'ps', '--host', 'runtime:srv-b', '--environment', 'local']], [['environment', 'add', '--name', ' Local ', '--pairing-code', 'orca://pair?code=x']], - [['environment', 'stop', '--environment', 'local']] + [['environment', 'stop', '--environment', 'local']], + [['server', 'stop', '--server', 'local']], + [['worktree', 'ps', '--environment', 'srv-b', '--server', 'build-box']], + [ + [ + 'worktree', + 'create', + '--name', + 'child', + '--parent-worktree', + 'folder:hub-a', + '--parent-environment', + 'local', + '--parent-server', + 'srv-b' + ] + ] ])('refuses %j before any request', async (args) => { listEnvironmentsMock.mockReturnValue(SAVED) const { exitCode, output } = await run([...args, '--json']) @@ -98,11 +114,27 @@ describe('--environment local and workspace addresses', () => { expect(JSON.parse(output).error.code).toBe('invalid_argument') expect(callMock).not.toHaveBeenCalled() expect(addEnvironmentFromPairingCodeMock).not.toHaveBeenCalled() - if (args[0] === 'environment' && args[1] === 'stop') { - expect(output).toContain('--environment srv-old') + if (args[1] === 'stop') { + expect(output).toContain('--server srv-old') } }) + it('accepts both spellings when they name the same server', async () => { + listEnvironmentsMock.mockReturnValue(SAVED) + callMock.mockResolvedValue(okFixture('ps', { worktrees: [], totalCount: 0, truncated: false })) + const { exitCode } = await run([ + 'worktree', + 'ps', + '--environment', + 'srv-b', + '--server', + 'srv-b', + '--json' + ]) + expect(exitCode).toBeUndefined() + expect(runtimeClientConstructorMock).toHaveBeenLastCalledWith(undefined, 'srv-b') + }) + it('refuses current against another environment with an inspection command', async () => { listEnvironmentsMock.mockReturnValue(SAVED) const { exitCode, output } = await run([ @@ -114,7 +146,7 @@ describe('--environment local and workspace addresses', () => { ]) expect(exitCode).toBe(1) expect(JSON.parse(output).error.data.nextSteps[0]).toContain( - '`orca worktree ps --environment srv-b --json`' + '`orca worktree ps --server srv-b --json`' ) expect(callMock).not.toHaveBeenCalled() }) @@ -146,7 +178,7 @@ describe('--environment local and workspace addresses', () => { expect(exitCode).toBeUndefined() expect(callMock).toHaveBeenCalledWith('worktree.show', { worktree: 'folder:hub-a' }) expect(JSON.parse(output).result.worktree.address.line).toBe( - '--environment local --worktree folder:hub-a' + '--server local --worktree folder:hub-a' ) vi.unstubAllEnvs() }) @@ -309,7 +341,7 @@ describe('worktree rm needs an explicit workspace', () => { ]) expect(exitCode).toBe(1) expect(JSON.parse(output).error.data.nextSteps[0]).toContain( - '`orca worktree ps --environment srv-b --json`' + '`orca worktree ps --server srv-b --json`' ) expect(callMock).not.toHaveBeenCalled() }) diff --git a/src/cli/index-worktree-parent-environment.test.ts b/src/cli/index-worktree-parent-environment.test.ts index 24659f2c2de..25720834fa6 100644 --- a/src/cli/index-worktree-parent-environment.test.ts +++ b/src/cli/index-worktree-parent-environment.test.ts @@ -141,8 +141,8 @@ describe('--parent-environment', () => { expect(exitCode).toBe(1) const error = JSON.parse(output).error expect(error.code).toBe('LINEAGE_PARENT_NOT_FOUND') - expect(error.data.environment).toBe('srv-b') - expect(error.data.nextSteps.join('\n')).toContain('--parent-environment') + expect(error.data.server).toBe('srv-b') + expect(error.data.nextSteps.join('\n')).toContain('--parent-server') expect(new Set(calls.map((call) => call.environment))).toEqual(new Set(['srv-b'])) }) @@ -198,10 +198,10 @@ describe('--parent-environment', () => { 'folder:hub-a' ] const cases: [string, string, Answer][] = [ - ['srv-z', 'environment_not_paired', FOLDER_PARENT], + ['srv-z', 'server_not_saved', FOLDER_PARENT], [ 'srv-c', - 'environment_unavailable', + 'server_unavailable', ({ environment }) => environment === 'srv-c' ? new RuntimeClientError('remote_runtime_unavailable', 'Could not connect.') @@ -229,7 +229,7 @@ describe('--parent-environment', () => { const { output } = await run(setOnB(parentEnvironment)) expect(JSON.parse(output).error.code, parentEnvironment).toBe(code) expect(calls.filter((call) => MUTATIONS.has(call.method))).toEqual([]) - if (code === 'environment_not_paired') { + if (code === 'server_not_saved') { expect(calls).toEqual([]) } } @@ -269,13 +269,13 @@ describe('--parent-environment', () => { const { output } = await run([...command, ...parent]) const error = JSON.parse(output).error expect(error.code, command[1]).toBe('LINEAGE_PARENT_AMBIGUOUS') - expect(error.data.environment).toBe('srv-b') + expect(error.data.server).toBe('srv-b') expect(error.data.candidates).toEqual([ { selector: 'folder:one' }, { selector: 'folder:two' } ]) expect(error.data.nextSteps).toEqual([ - 'Compare the choices with `orca worktree ps --environment srv-b --json`, then pass one as --parent-worktree.' + 'Compare the choices with `orca worktree ps --server srv-b --json`, then pass one as --parent-worktree.' ]) } }) diff --git a/src/cli/index.ts b/src/cli/index.ts index 10ce7052964..734c7383a2c 100644 --- a/src/cli/index.ts +++ b/src/cli/index.ts @@ -1,5 +1,6 @@ #!/usr/bin/env node import { + canonicalizeLegacyFlagArgv, findCommandSpec, isCommandGroup, normalizeCommandPositionals, @@ -97,6 +98,11 @@ export async function main( return } const json = parsed.flags.has('json') + // Passthrough argv belongs to another program; everything else is echoed in canonical spelling. + const echoedArgv = + findCommandSpec(COMMAND_SPECS, parsed.commandPath)?.argumentMode === 'passthrough' + ? argv + : canonicalizeLegacyFlagArgv(argv) try { // Report invalid commands before runtime lookup can mask them with connection errors. @@ -107,27 +113,27 @@ export async function main( const RuntimeClientClass = await loadRuntimeClientClass() const ignoreRemoteSelection = ignoresRemoteSelection(parsed.commandPath) const pairingCode = ignoreRemoteSelection ? null : parsed.flags.get('pairing-code') - const environmentSelector = ignoreRemoteSelection ? null : parsed.flags.get('environment') + const environmentSelector = ignoreRemoteSelection ? null : parsed.flags.get('server') // An explicit local route suppresses ambient ORCA_ENVIRONMENT and pairing codes. const explicitLocal = isLocalEnvironmentSelector(environmentSelector) if (explicitLocal && typeof pairingCode === 'string') { throw new RuntimeClientError( 'invalid_argument', - 'Use either --pairing-code or --environment, not both.' + 'Use either --pairing-code or --server, not both.' ) } - // Eagerly resolve explicit --environment; stale ambient config must not break local-only commands. + // Eagerly resolve explicit --server; stale ambient config must not break local-only commands. const listSshTargetsForSuggestion = async (): Promise<{ id: string; label: string }[]> => listSshTargets(new RuntimeClientClass(undefined, undefined, null, null)) const storeEnvironmentSelector = typeof environmentSelector === 'string' && !explicitLocal ? await resolveEnvironmentSelectorForStore(environmentSelector, listSshTargetsForSuggestion) : null - // Select the paired connection before constructing the client; reject conflicting environments. + // Select the saved connection before constructing the client; reject conflicting servers. const hostEnvironmentId = ignoreRemoteSelection ? null : await resolveHostFlagEnvironmentId(parsed.flags, { - // SSH targets belong to this machine, even when the missing name was a paired server. + // SSH targets belong to this computer, even when the missing name was a saved server. listSshTargets: listSshTargetsForSuggestion, verifySshTargets: async () => ( @@ -138,7 +144,7 @@ export async function main( pairingCode: typeof pairingCode === 'string' ? pairingCode : null, environmentSelector: typeof environmentSelector === 'string' - ? { value: environmentSelector, label: '--environment' } + ? { value: environmentSelector, label: '--server' } : process.env.ORCA_ENVIRONMENT ? { value: process.env.ORCA_ENVIRONMENT, label: 'ORCA_ENVIRONMENT' } : null @@ -164,13 +170,13 @@ export async function main( remotePairingCode, remoteEnvironment, resolveOrchestrationCliExecutable(), - argv + echoedArgv ) return client }, cwd, json, - rawArgs: argv + rawArgs: echoedArgv }) } catch (error) { const worktreeSelector = parsed.flags.get('worktree') @@ -181,8 +187,8 @@ export async function main( ...(typeof worktreeSelector === 'string' ? { worktreeSelector } : {}), ...(typeof repoSelector === 'string' ? { repoSelector } : {}), remoteServerSelected: - !isLocalEnvironmentSelector(parsed.flags.get('environment')) && - (parsed.flags.has('environment') || + !isLocalEnvironmentSelector(parsed.flags.get('server')) && + (parsed.flags.has('server') || parsed.flags.has('pairing-code') || (typeof hostFlag === 'string' && hostFlag.startsWith('runtime:')) || Boolean(process.env.ORCA_ENVIRONMENT?.trim() || process.env.ORCA_PAIRING_CODE?.trim())), diff --git a/src/cli/jira-target.ts b/src/cli/jira-target.ts index 5266393d213..09af0bd9994 100644 --- a/src/cli/jira-target.ts +++ b/src/cli/jira-target.ts @@ -39,7 +39,7 @@ export async function resolveJiraTarget( if (!runtime.result.capabilities?.includes(JIRA_AGENT_ACCESS_RUNTIME_CAPABILITY)) { throw new RuntimeClientError( 'incompatible_runtime', - 'Update Orca on the execution host to use verified Jira commands.' + 'Update Orca on that server to use verified Jira commands.' ) } const { result: status } = await context.client.call('jira.status') diff --git a/src/cli/legacy-server-spellings.test.ts b/src/cli/legacy-server-spellings.test.ts new file mode 100644 index 00000000000..d477e5cde78 --- /dev/null +++ b/src/cli/legacy-server-spellings.test.ts @@ -0,0 +1,70 @@ +import { describe, expect, it } from 'vitest' +import { + canonicalizeLegacyFlagArgv, + normalizeCommandPositionals, + parseArgs, + validateCommandAndFlags +} from './args' +import { unknownCommandData } from './command-suggestion' +import { ignoresRemoteSelection } from './remote-selection-scope' +import { COMMAND_SPECS } from './specs' + +function normalize(argv: string[]) { + return normalizeCommandPositionals(COMMAND_SPECS, parseArgs(argv, undefined, COMMAND_SPECS)) +} + +describe('old server spellings are input only', () => { + it('routes the old command and flag to the same handler and flag as the new ones', () => { + const legacy = normalize(['environment', 'stop', '--environment', 'srv-b', '--yes']) + const current = normalize(['server', 'stop', '--server', 'srv-b', '--yes']) + expect(legacy.commandPath).toEqual(['server', 'stop']) + expect(Object.fromEntries(legacy.flags)).toEqual(Object.fromEntries(current.flags)) + expect(normalize(['host', 'name']).commandPath).toEqual(['server', 'name']) + expect(normalize(['environment']).commandPath).toEqual(['server']) + }) + + it('accepts both spellings only when their values are equal', () => { + const same = normalize(['worktree', 'ps', '--environment', 'srv-b', '--server', 'srv-b']) + expect(() => validateCommandAndFlags(COMMAND_SPECS, same)).not.toThrow() + expect(same.flags.get('server')).toBe('srv-b') + for (const argv of [ + ['worktree', 'ps', '--environment', 'srv-a', '--server', 'srv-b'], + [ + 'worktree', + 'set', + '--worktree', + 'id:x', + '--parent-worktree', + 'id:y', + '--parent-environment', + 'local', + '--parent-server', + 'srv-b' + ] + ]) { + expect(() => validateCommandAndFlags(COMMAND_SPECS, normalize(argv))).toThrow( + expect.objectContaining({ code: 'invalid_argument' }) + ) + } + }) + + it('suggests and echoes only the new names', () => { + const { suggestions } = unknownCommandData(COMMAND_SPECS, ['environment', 'stp']) + expect(suggestions).toContain('server stop') + expect(suggestions.filter((path) => !path.startsWith('server '))).toEqual([]) + expect( + canonicalizeLegacyFlagArgv([ + 'plugin', + 'list', + '--environment=box', + '--parent-environment', + 'x' + ]) + ).toEqual(['plugin', 'list', '--server=box', '--parent-server', 'x']) + }) + + it('routes `server name` but keeps saved-server management on this computer', () => { + expect(ignoresRemoteSelection(['server', 'name'])).toBe(false) + expect(ignoresRemoteSelection(['server', 'list'])).toBe(true) + }) +}) diff --git a/src/cli/local-environment-selector.ts b/src/cli/local-environment-selector.ts index 44849c1e87d..1025044efa2 100644 --- a/src/cli/local-environment-selector.ts +++ b/src/cli/local-environment-selector.ts @@ -3,7 +3,7 @@ import type { RuntimeClient } from './runtime-client' import { RuntimeClientError } from './runtime/types' import { quoteCliCommandArgument } from './shell-command-quote' -/** `--environment local`: the caller's own Orca, even over an ambient ORCA_ENVIRONMENT or pairing code. */ +/** `--server local`: the caller's own Orca, even over an ambient ORCA_ENVIRONMENT or pairing code. */ export const LOCAL_ENVIRONMENT = 'local' export function isLocalEnvironmentSelector(value: unknown): value is string { @@ -21,24 +21,29 @@ export async function savedEnvironmentNamedLocal(): Promise<{ id: string } | und ) } -/** `orca environment …` takes --environment as a saved entry to act on; local is not one. */ +/** `orca server …` management commands act on a saved entry named by --server; `server name` is routed. */ +export function isServerManagementCommand(commandPath: readonly string[]): boolean { + return commandPath[0] === 'server' && commandPath[1] !== 'name' +} + +/** Management commands take --server as a saved entry to act on; local is not one. */ export async function refuseLocalManagementSelector( commandPath: readonly string[], flags: Map ): Promise { - if (commandPath[0] !== 'environment' || !isLocalEnvironmentSelector(flags.get('environment'))) { + if (!isServerManagementCommand(commandPath) || !isLocalEnvironmentSelector(flags.get('server'))) { return } const named = await savedEnvironmentNamedLocal() throw new RuntimeClientError( 'invalid_argument', - `--environment local names this machine's own Orca, not a saved environment, so \`orca ${commandPath.join(' ')}\` cannot act on it.`, + `--server local is the Orca on this computer, not a saved server, so \`orca ${commandPath.join(' ')}\` can't act on it.`, { nextSteps: [ ...(named - ? [`A saved environment named local is reached by its id: --environment ${named.id}.`] + ? [`A saved server named local is reached by its id: --server ${named.id}.`] : []), - 'Run `orca environment list` to see saved environments.' + 'Run `orca server list` to see saved servers.' ] } ) @@ -48,7 +53,7 @@ export function refuseReservedEnvironmentName(name: string): void { if (isLocalEnvironmentSelector(name)) { throw new RuntimeClientError( 'invalid_argument', - '`local` is reserved: --environment local always means this machine’s own Orca. Save the environment under another name.' + '`local` is reserved: --server local always means the Orca on this computer. Save the server under another name.' ) } } @@ -59,16 +64,16 @@ export function assertLocalCwdWorktreeSelector(selector: string, client: Runtime return } // A paired CLI's cwd belongs to the client filesystem, so it cannot identify server worktrees. - const environment = client.environmentSelector + const server = client.environmentSelector throw new RuntimeClientError( 'invalid_argument', - `${selector} is a local cwd shortcut and cannot be resolved against a remote runtime. Pass an explicit server-side worktree selector such as identity:, id:::, folder:, name:, branch:, issue:, or path:.`, + `${selector} is a cwd shortcut and resolves only on the Orca on this computer. Pass an explicit server-side worktree selector such as identity:, id:::, folder:, name:, branch:, issue:, or path:.`, { nextSteps: [ - environment - ? `List that environment's workspaces: \`orca worktree ps --environment ${quoteCliCommandArgument(environment)} --json\`, then copy a row's address.` - : 'Save this connection with `orca environment add --name --pairing-code `, then list its workspaces with `orca worktree ps --environment --json`.', - `For this machine's own workspace, rerun with --environment local.` + server + ? `List that server's workspaces: \`orca worktree ps --server ${quoteCliCommandArgument(server)} --json\`, then copy a row's address.` + : 'Save this connection with `orca server add --name --pairing-code `, then list its workspaces with `orca worktree ps --server --json`.', + 'For a workspace on this computer, rerun with --server local.' ] } ) diff --git a/src/cli/omitted-host-scope-selectors.ts b/src/cli/omitted-host-scope-selectors.ts index 2982a73268a..e3162464dee 100644 --- a/src/cli/omitted-host-scope-selectors.ts +++ b/src/cli/omitted-host-scope-selectors.ts @@ -5,14 +5,15 @@ import { } from '../shared/execution-host' import type { RuntimeListingHostScope } from '../shared/runtime-listing-host-scope' import { findEnvironmentByName } from './host-selector-alternatives' +import { quoteCliCommandArgument } from './shell-command-quote' export type OmittedHostScopeSelector = { hostId: ExecutionHostId - /** null means this machine has no selector for the omitted host. */ + /** null means this computer has no selector for the omitted host. */ selector: string | null } -/** omittedHostSelectors is added locally, never sent by the runtime. */ +/** omittedHostSelectors is added locally, never sent by the server. */ export type ListingHostScopeWithSelectors = RuntimeListingHostScope & { omittedHostSelectors?: OmittedHostScopeSelector[] } @@ -56,16 +57,16 @@ function resolveSelector( ): string | null { if (host?.kind === 'runtime') { const environment = findEnvironmentByName(environments, host.environmentId) - return environment ? `--environment ${environment.name}` : null + return environment ? `--server ${quoteCliCommandArgument(environment.id)}` : null } - // Listings take no --host flag; local and SSH hosts are reached through the answering runtime. + // Listings take no --host flag; local and SSH hosts are reached through the answering server. return null } /** An absent scope means coverage is unknown. */ export function formatListingHostScope(scope: ListingHostScopeWithSelectors | undefined): string { if (!scope) { - return 'scope: unverifiable — this host does not report which hosts it lists' + return 'scope: unverifiable — this server does not report what it lists' } const covered = scope.hostIds.length > 0 ? scope.hostIds.join(', ') : 'none' if (scope.omittedHostIds.length === 0) { @@ -84,8 +85,8 @@ export function formatListingHostScope(scope: ListingHostScopeWithSelectors | un } const kind = parseExecutionHostId(hostId)?.kind return kind === 'local' || kind === 'ssh' - ? `${hostId} (reached through this runtime; no flag selects it)` - : `${hostId} (not selectable from this machine)` + ? `${hostId} (reached through this server; no flag selects it)` + : `${hostId} (not reachable from here)` }) return `scope: ${covered} — not covered: ${omitted.join(', ')}` } diff --git a/src/cli/plugin-authoring/plugin-cli-output.ts b/src/cli/plugin-authoring/plugin-cli-output.ts index 1fdf64eedb9..f37dfa25f0b 100644 --- a/src/cli/plugin-authoring/plugin-cli-output.ts +++ b/src/cli/plugin-authoring/plugin-cli-output.ts @@ -19,7 +19,7 @@ export function requirePluginPathArg(ctx: HandlerContext, flag: string): string /** * Authoring commands read and write the files of the machine that runs them. Why refuse a bridged - * shell: there the CLI runs on the Orca host, so the caller's paths would name the wrong machine. + * shell: there the CLI runs on the Orca server, so the caller's paths would name the wrong machine. */ export function resolveLocalPluginPath( ctx: HandlerContext, @@ -30,7 +30,7 @@ export function resolveLocalPluginPath( if (process.env.ORCA_CLI_CWD) { throw new RuntimeClientError( 'invalid_environment', - `orca plugin ${command} works on the files of the machine that runs it, but this shell forwards orca to the Orca host. Write and check the plugin files on this machine directly, or run the command on the Orca host.` + `orca plugin ${command} works on the files of the machine that runs it, but this shell forwards orca to the Orca server. Write and check the plugin files on this machine directly, or run the command on the Orca server.` ) } return isAbsolute(value) ? value : resolve(ctx.cwd, value) diff --git a/src/cli/plugin-dev-watch/plugin-dev-watch-loop.ts b/src/cli/plugin-dev-watch/plugin-dev-watch-loop.ts index c33786253c8..f8b46581660 100644 --- a/src/cli/plugin-dev-watch/plugin-dev-watch-loop.ts +++ b/src/cli/plugin-dev-watch/plugin-dev-watch-loop.ts @@ -18,7 +18,7 @@ import { type PluginDevWatchShotHost } from './plugin-dev-watch-shot' -/** What the loop asks of the Orca host; the handler binds it to RPC for one folder. */ +/** What the loop asks of the Orca server; the handler binds it to RPC for one folder. */ export type PluginDevWatchHost = { refreshTypes(): Promise /** `approvalFingerprint` overrides `--approve` once the person approved at the prompt. */ diff --git a/src/cli/plugin-dev-watch/plugin-dev-watch-shot.ts b/src/cli/plugin-dev-watch/plugin-dev-watch-shot.ts index cda01518dfb..ca0e158ab37 100644 --- a/src/cli/plugin-dev-watch/plugin-dev-watch-shot.ts +++ b/src/cli/plugin-dev-watch/plugin-dev-watch-shot.ts @@ -15,7 +15,7 @@ export type PluginDevWatchShot = { pendingRequests?: number } -/** What `--shot` asks of the Orca host; the handler binds it to RPC. */ +/** What `--shot` asks of the Orca server; the handler binds it to RPC. */ export type PluginDevWatchShotHost = { /** `--shot-panel`, else the plugin's first panel; null when it has none. Throws on an unknown id. */ panelOf(entry: PluginHostListEntry | null): string | null diff --git a/src/cli/plugin-handler-groups.ts b/src/cli/plugin-handler-groups.ts index 24ae0b21cc6..c8eed4f890b 100644 --- a/src/cli/plugin-handler-groups.ts +++ b/src/cli/plugin-handler-groups.ts @@ -1,6 +1,6 @@ import type { HandlerGroup } from './handler-group-manifest' -// Authoring runs offline; runtime commands reach the Orca host. Split so authoring never loads the RPC graph. +// Authoring runs offline; runtime commands reach the Orca server. Split so authoring never loads the RPC graph. export const PLUGIN_HANDLER_GROUPS: readonly HandlerGroup[] = [ { name: 'plugin-authoring', diff --git a/src/cli/ports-format.ts b/src/cli/ports-format.ts index ef25d083838..b48ef1551c1 100644 --- a/src/cli/ports-format.ts +++ b/src/cli/ports-format.ts @@ -47,14 +47,12 @@ export function formatPortsScan( scan: WorkspacePortHostScanResult, options: { showOwner: boolean } ): string { - const host = `host=${scan.executionHostId}` if (scan.unavailableReason) { - return `Port scan unavailable: ${scan.unavailableReason}\n${host}` + return `Port scan unavailable: ${scan.unavailableReason}` } if (scan.ports.length === 0) { - return `No listening ports found.\n${host}` + return 'No listening ports found.' } const ambiguousNames = options.showOwner ? findAmbiguousOwnerNames(scan.ports) : null - const rows = scan.ports.map((port) => formatPortRow(port, ambiguousNames)) - return `${rows.join('\n')}\n\n${host}` + return scan.ports.map((port) => formatPortRow(port, ambiguousNames)).join('\n') } diff --git a/src/cli/project-format.ts b/src/cli/project-format.ts index 82265411146..eb7598cb059 100644 --- a/src/cli/project-format.ts +++ b/src/cli/project-format.ts @@ -1,3 +1,4 @@ +import { ownerTokenOf, type OwnerContext } from './row-owner-server' import type { Project, ProjectHostSetup, @@ -21,14 +22,17 @@ export function formatProjectList(result: { projects: Project[] }): string { .join('\n') } -export function formatProjectHostSetupList(result: { setups: ProjectHostSetup[] }): string { +export function formatProjectHostSetupList( + result: { setups: ProjectHostSetup[] }, + owners?: OwnerContext +): string { if (result.setups.length === 0) { return 'No project host setups found.' } return result.setups .map( (setup) => - `${setup.id} project:${setup.projectId} host:${setup.hostId} ${setup.setupState} ${setup.path}` + `${setup.id} project:${setup.projectId}${ownerTokenOf(setup.hostId, owners)} ${setup.setupState} ${setup.path}` ) .join('\n') } diff --git a/src/cli/reference-input.ts b/src/cli/reference-input.ts index d60bc1049c1..82fa9b8e765 100644 --- a/src/cli/reference-input.ts +++ b/src/cli/reference-input.ts @@ -97,7 +97,7 @@ export async function assertReferenceWritesSupported(client: RuntimeClient): Pro if (!status.result.capabilities?.includes(WORKTREE_LINKED_ITEMS_DELTA_RUNTIME_CAPABILITY)) { throw new RuntimeClientError( 'incompatible_runtime', - 'This Orca host cannot merge reference changes safely. Update Orca on the execution host.' + 'This Orca server cannot merge reference changes safely. Update Orca on that server.' ) } } diff --git a/src/cli/remote-selection-flag-rejection.ts b/src/cli/remote-selection-flag-rejection.ts index 86b560ad111..5530f9555ec 100644 --- a/src/cli/remote-selection-flag-rejection.ts +++ b/src/cli/remote-selection-flag-rejection.ts @@ -1,7 +1,7 @@ import { RuntimeClientError } from './runtime/types' -// Local-only command families reject explicit runtime selectors rather than silently ignoring them. -export const REMOTE_SELECTION_FLAGS = ['environment', 'pairing-code'] as const +// Local-only command families reject explicit server selectors rather than silently ignoring them. +export const REMOTE_SELECTION_FLAGS = ['server', 'pairing-code'] as const /** suffix completes "-- does not retarget …" with the command's actual scope. */ export function rejectRemoteSelectionFlags( diff --git a/src/cli/remote-selection-scope.ts b/src/cli/remote-selection-scope.ts index 7c31dae0b73..b7edc280a36 100644 --- a/src/cli/remote-selection-scope.ts +++ b/src/cli/remote-selection-scope.ts @@ -1,12 +1,14 @@ -/** Commands that act only on this machine: dispatch ignores --environment / --pairing-code for them, and help does not offer them. */ +import { isServerManagementCommand } from './local-environment-selector' + +/** Commands that act only on this computer: dispatch ignores --server / --pairing-code for them, and help does not offer them. */ export function ignoresRemoteSelection(commandPath: readonly string[]): boolean { return ( commandPath[0] === 'account' || commandPath[0] === 'artifacts' || - commandPath[0] === 'environment' || - // Paired servers come from the local store; routing SSH lookup would mix two machines in one list. + isServerManagementCommand(commandPath) || + // Saved servers come from the local store; routing SSH lookup would mix two computers in one list. commandPath.join(' ') === 'host list' || - // Removes ids that `host list` printed from this runtime; an ambient selection must not retarget it. + // Removes ids that `host list` printed from this Orca; an ambient selection must not retarget it. commandPath.join(' ') === 'host rm' || commandPath[0] === 'serve' || (commandPath[0] === 'agent' && commandPath[1] !== 'launch') || diff --git a/src/cli/root-help-text-primary.ts b/src/cli/root-help-text-primary.ts index 6ad30800fca..cf9bbe3d8dc 100644 --- a/src/cli/root-help-text-primary.ts +++ b/src/cli/root-help-text-primary.ts @@ -4,9 +4,9 @@ export const ROOT_HELP_TEXT_PRIMARY = [ 'Usage: orca [options]', '', 'Startup:', - ' open Launch Orca and wait for the runtime to be reachable', - ' serve Start a headless Orca runtime server', - ' status Show app/runtime/graph readiness', + ' open Launch Orca and wait for it to be reachable', + ' serve Start a headless Orca server', + ' status Show app/server/graph readiness', '', 'Diagnostics:', ' diagnostics memory Collect a memory snapshot for Orca and managed terminals', @@ -21,11 +21,11 @@ export const ROOT_HELP_TEXT_PRIMARY = [ ' reference find Find workspaces and agents by URL or issue key', '', 'Agent Sessions:', - ' search Search the full text of agent sessions on one Orca host', + ' search Search the full text of agent sessions on one Orca server', '', 'Accounts:', - ' account add Add a managed agent account on this Orca host', - ' account list List managed agent accounts on this Orca host', + ' account add Add a managed agent account on this Orca server', + ' account list List managed agent accounts on this Orca server', ' account select Select the account new agent launches use', ' account rm Remove a managed agent account and its private data', '', @@ -37,15 +37,12 @@ export const ROOT_HELP_TEXT_PRIMARY = [ ' skills install Install bundled Orca skills globally via the community skills CLI', ' skills update Update Orca skills to the version this Orca build ships', '', - 'Hosts:', - ' host list List targetable machines and how to name each one', - ' host rm Remove a saved SSH target', - '', - 'Environments:', - ' environment add Save a remote Orca runtime from a pairing code', - ' environment list List saved remote Orca runtimes', - ' environment show Show one saved remote Orca runtime', - ' environment rm Remove a saved remote Orca runtime', + 'Servers:', + ' server add Save an Orca server from a pairing code', + ' server list List saved Orca servers', + ' server show Show one saved server', + ' server rm Remove a saved server', + ' server name Show or set the name the answering server reports', '', 'Plugins:', ' plugin create Scaffold a plugin from a template', @@ -55,7 +52,7 @@ export const ROOT_HELP_TEXT_PRIMARY = [ ' plugin release-entry Print the catalog release entry for HEAD', " plugin test Run a plugin's tests on this machine, unsandboxed", ' plugin check Validate, then render each panel on this machine, unsandboxed', - ' plugin list List plugins on the Orca host', + ' plugin list List plugins on the Orca server', " plugin logs Print a plugin's recent log lines", ' plugin install Install from a catalog, Git repo or folder (code needs --approve)', ' plugin update Update one plugin or --all (new access needs --approve)', @@ -63,7 +60,7 @@ export const ROOT_HELP_TEXT_PRIMARY = [ ' plugin catalog List, add (needs --approve) or remove plugin catalogs', ' plugin enable Enable a plugin (code needs --approve)', ' plugin disable Disable a plugin', - ' plugin system on|off Turn plugins on or off for the Orca host', + ' plugin system on|off Turn plugins on or off for the Orca server', " plugin restart Restart a plugin's worker", " plugin open Show a plugin's panel or editor in Orca", ' plugin shot Save a PNG of a plugin panel as Orca draws it', @@ -91,8 +88,8 @@ export const ROOT_HELP_TEXT_PRIMARY = [ 'Projects:', ' project list List durable projects known to Orca', ' project setups List project host setups', - ' project setup-existing-folder Make a project available on a host by importing an existing folder', - ' project setup-clone Make a project available on a host by cloning a repository', + ' project setup-existing-folder Make a project available on a server by importing an existing folder', + ' project setup-clone Make a project available on a server by cloning a repository', ' project setup-create Create independent project host setup metadata', ' project setup-update Update project host setup metadata', ' project setup-delete Remove a project host setup', @@ -108,7 +105,7 @@ export const ROOT_HELP_TEXT_PRIMARY = [ 'Worktrees:', ' worktree list List Orca-managed worktrees', ' worktree show Show one worktree', - ' worktree activate Open a worktree on its host, waking a sleeping recipe VM', + ' worktree activate Open a worktree on its server, waking a sleeping recipe VM', ' worktree current Show the Orca-managed worktree for the current directory', ' worktree create Create a new Orca-managed worktree', ' worktree set Update Orca metadata for a worktree', diff --git a/src/cli/root-help-text-secondary.ts b/src/cli/root-help-text-secondary.ts index 05c4f482f1e..d5475716051 100644 --- a/src/cli/root-help-text-secondary.ts +++ b/src/cli/root-help-text-secondary.ts @@ -45,18 +45,16 @@ export const ROOT_HELP_TEXT_SECONDARY = [ ' orca account add [--agent claude|codex] [--json]', ' orca account list [--json]', ' orca account select --agent claude --account [--json]', - ' orca host list [--json]', - ' orca host rm --host ssh: [--json]', - ' orca environment add --name --pairing-code [--json]', - ' orca environment list [--json]', - ' orca environment show --environment [--json]', - ' orca environment rm --environment [--json]', + ' orca server add --name --pairing-code [--json]', + ' orca server list [--json]', + ' orca server show --server [--json]', + ' orca server rm --server [--json]', ' orca worktree list [--repo ] [--limit ] [--json]', - ' orca worktree create --name [--repo |--project [--host ]|--project-host-setup ] [--agent ] [--prompt ] [--model ] [--effort ] [--setup run|skip|inherit] [--base-branch ] [--issue ] [--pr ] [--linear-issue ] [--gitlab-issue ] [--gitlab-mr ] [--comment ] [--parent-worktree [--parent-environment ]] [--no-parent] [--run-hooks] [--activate] [--json]', + ' orca worktree create --name [--repo |--project |--project-host-setup ] [--agent ] [--prompt ] [--model ] [--effort ] [--setup run|skip|inherit] [--base-branch ] [--issue ] [--pr ] [--linear-issue ] [--gitlab-issue ] [--gitlab-mr ] [--comment ] [--parent-worktree [--parent-server ]] [--no-parent] [--run-hooks] [--activate] [--json]', ' orca worktree show --worktree [--json]', ' orca worktree activate --worktree [--json]', ' orca worktree current [--json]', - ' orca worktree set --worktree [--display-name ] [--issue ] [--pr ] [--linear-issue ] [--gitlab-issue ] [--gitlab-mr ] [--comment ] [--workspace-status ] [--unread|--read] [--parent-worktree [--parent-environment ]|--no-parent] [--json]', + ' orca worktree set --worktree [--display-name ] [--issue ] [--pr ] [--linear-issue ] [--gitlab-issue ] [--gitlab-mr ] [--comment ] [--workspace-status ] [--unread|--read] [--parent-worktree [--parent-server ]|--no-parent] [--json]', ' orca worktree rm --worktree [--force] [--run-hooks] [--allow-failed-archive-hook] [--json]', ' orca worktree ps [--limit ] [--agent-wait] [--json]', ' orca ports [--worktree ] [--all] [--json]', @@ -74,12 +72,12 @@ export const ROOT_HELP_TEXT_SECONDARY = [ ' orca terminal switch [--terminal ] [--json]', ' orca terminal close ([--terminal ] [--tab] | --worktree --all) [--json]', ' orca project list [--json]', - ' orca project setups [--project ] [--host ] [--json]', - ' orca project setup-existing-folder --project --host --path [--kind git|folder] [--display-name ] [--json]', - ' orca project setup-clone --project --host --url --destination [--display-name ] [--json]', - ' orca project setup-create --project --host [--setup-id ] [--path ] [--kind git|folder] [--display-name ] [--worktree-base-path ] [--git-username ] [--state ready|not-set-up|setting-up|error|unsupported] [--method imported-existing-folder|cloned|provisioned] [--json]', - ' orca project setup-update --setup [--host ] [--display-name ] [--path ] [--worktree-base-path ] [--git-username ] [--kind git|folder] [--state ready|not-set-up|setting-up|error|unsupported] [--method legacy-repo|imported-existing-folder|cloned|provisioned] [--json]', - ' orca project setup-delete --setup [--host ] [--force] [--json]', + ' orca project setups [--project ] [--json]', + ' orca project setup-existing-folder --project --path [--kind git|folder] [--display-name ] [--json]', + ' orca project setup-clone --project --url --destination [--display-name ] [--json]', + ' orca project setup-create --project [--setup-id ] [--path ] [--kind git|folder] [--display-name ] [--worktree-base-path ] [--git-username ] [--state ready|not-set-up|setting-up|error|unsupported] [--method imported-existing-folder|cloned|provisioned] [--json]', + ' orca project setup-update --setup [--display-name ] [--path ] [--worktree-base-path ] [--git-username ] [--kind git|folder] [--state ready|not-set-up|setting-up|error|unsupported] [--method legacy-repo|imported-existing-folder|cloned|provisioned] [--json]', + ' orca project setup-delete --setup [--force] [--json]', ' orca repo list [--json]', ' orca repo add --path [--kind git|folder] [--json]', ' orca repo show --repo [--json]', @@ -92,7 +90,7 @@ export const ROOT_HELP_TEXT_SECONDARY = [ ' --worktree Worktree selector such as identity:, id:::, folder: (where the command takes folder workspaces), name:, branch:, issue:, path:, or active/current', ' --terminal Runtime-issued terminal handle returned by `orca terminal list --json`', ' --parent-worktree Parent worktree selector such as identity:, id:::, folder:, name:, branch:, issue:, path:, or active/current', - " --parent-environment Environment holding --parent-worktree: local or a saved id/name (default: the worktree's own)", + " --parent-server The server holding --parent-worktree: local or a saved server's id/name (default: the worktree's own server)", ' --no-parent Force no parent lineage for unrelated worktree creation/update', '', 'Terminal Send Options:', @@ -111,13 +109,13 @@ export const ROOT_HELP_TEXT_SECONDARY = [ '', 'Output Options:', ' --json Emit machine-readable JSON instead of human text', - ' --pairing-code Connect to a remote Orca runtime using an orca://pair?... code', - " --environment Connect using a saved environment id or name; `local` is this machine's own Orca", + ' --pairing-code Connect once to an Orca server with an orca://pair?... code', + " --server The Orca server to run on: `local` (the Orca on this computer) or a saved server's id or name", ' --help Show this help message', '', 'Behavior:', - ' Most commands require a running Orca runtime. If Orca is not open yet, run `orca open` first.', - ' Remote runtime access can also be supplied with ORCA_PAIRING_CODE or ORCA_ENVIRONMENT.', + ' Most commands need a running Orca. If Orca is not open yet, run `orca open` first.', + ' Set a default server with ORCA_ENVIRONMENT, or ORCA_PAIRING_CODE for a one-off connection.', ' Use selectors for discovery and handles for repeated live terminal operations.', '', 'Agent Sessions And Worktrees:', diff --git a/src/cli/row-owner-server.test.ts b/src/cli/row-owner-server.test.ts new file mode 100644 index 00000000000..bdeae11418c --- /dev/null +++ b/src/cli/row-owner-server.test.ts @@ -0,0 +1,112 @@ +import { describe, expect, it } from 'vitest' +import { + formatOwnerToken, + ownerOfHostId, + ownerOfWorkerHost, + type OwnerContext, + type WorkspaceServer +} from './row-owner-server' +import { annotateWorkspaces } from './workspace-address' + +const LOCAL: WorkspaceServer = { id: 'local', name: 'local' } +const BUILD_BOX: WorkspaceServer = { id: 'env-1', name: 'build-box' } + +/** The caller's store holds env-1. */ +function context(answering: WorkspaceServer): OwnerContext { + return { answering, savedServer: (id) => (id === 'env-1' ? BUILD_BOX : undefined) } +} + +describe('the server that owns a row', () => { + it('names the answering server for a local row', () => { + expect(ownerOfHostId('local', context(LOCAL))).toEqual({ server: LOCAL }) + expect(ownerOfHostId('local', context(BUILD_BOX))).toEqual({ server: BUILD_BOX }) + }) + + it("names a runtime owner only from the local answer's own store", () => { + expect(ownerOfHostId('runtime:env-1', context(LOCAL))).toEqual({ server: BUILD_BOX }) + expect(ownerOfHostId('runtime:env-9', context(LOCAL))).toEqual({ + server: null, + unknown: 'unverified-owner', + stored: 'runtime:env-9' + }) + }) + + it("never joins a remote server's runtime stamp against this computer's store", () => { + expect(ownerOfHostId('runtime:env-1', context(BUILD_BOX))).toEqual({ + server: null, + unknown: 'unverified-owner', + stored: 'runtime:env-1' + }) + }) + + it('keeps conflicting, legacy SSH and missing owners unknown instead of local', () => { + expect(ownerOfHostId('runtime:unresolved-owner', context(LOCAL))).toMatchObject({ + server: null, + unknown: 'conflicting-ownership' + }) + expect(ownerOfHostId('ssh:box', context(LOCAL))).toMatchObject({ + server: null, + unknown: 'legacy-ssh-row' + }) + expect(ownerOfHostId(undefined, context(LOCAL))).toMatchObject({ + server: null, + unknown: 'owner-not-reported' + }) + }) + + it('prints a known owner by name and an unknown one as server=unknown', () => { + expect(formatOwnerToken(ownerOfHostId('runtime:env-1', context(LOCAL)))).toBe( + 'server=build-box' + ) + expect(formatOwnerToken(ownerOfHostId('ssh:box', context(LOCAL)))).toMatch(/^server=unknown /) + }) + + it('names federated workers by their saved id and the home coordinator as answering', () => { + expect(ownerOfWorkerHost({ kind: 'local', id: 'local' }, context(BUILD_BOX))).toEqual({ + server: BUILD_BOX + }) + expect(ownerOfWorkerHost({ kind: 'remote', id: 'env-1' }, context(LOCAL))).toEqual({ + server: BUILD_BOX + }) + expect(ownerOfWorkerHost({ kind: 'remote', id: 'ssh-1' }, context(LOCAL))).toMatchObject({ + server: null, + unknown: 'unverified-owner' + }) + }) +}) + +describe('workspace annotation JSON', () => { + it('names the owner and route under server keys', () => { + const [mirror, stranger] = annotateWorkspaces( + [ + { id: 'repo::/srv/app', hostId: 'runtime:env-1', identityKey: 'wt2:a' }, + { + id: 'repo::/srv/other', + hostId: 'ssh:box', + identityKey: 'wt2:b', + crossStoreParent: { + installationId: 'elsewhere', + workspaceKey: 'folder:hub', + instanceId: 'i' + } + } + ], + { owners: context(LOCAL), localInstallationId: 'mine' } + ) + expect(mirror).toEqual({ + server: BUILD_BOX, + address: { + server: 'local', + worktree: 'identity:wt2:a', + line: '--server local --worktree identity:wt2:a' + }, + parent: null + }) + expect(stranger).toMatchObject({ + server: null, + serverUnknown: 'legacy-ssh-row', + address: { server: 'local' }, + parent: { state: 'unknown-server', server: null, address: null } + }) + }) +}) diff --git a/src/cli/row-owner-server.ts b/src/cli/row-owner-server.ts new file mode 100644 index 00000000000..bae1e635809 --- /dev/null +++ b/src/cli/row-owner-server.ts @@ -0,0 +1,138 @@ +import { isUnresolvedOwnerHostId, parseExecutionHostId } from '../shared/execution-host' +import { listEnvironments } from '../shared/remote-runtime/host-store/runtime-environment-store' +import { LOCAL_ENVIRONMENT } from './local-environment-selector' +import type { RuntimeClient } from './runtime-client' +import { quoteCliCommandArgument } from './shell-command-quote' + +/** An Orca server: `local`, a saved server, or a one-off pairing-code connection (id and name null). */ +export type WorkspaceServer = { id: string | null; name: string | null } + +/** Why a row's owning server is not named; Orca never guesses one. */ +export type ServerUnknownReason = + | 'conflicting-ownership' + | 'unverified-owner' + | 'legacy-ssh-row' + | 'owner-not-reported' + +export type RowOwner = + | { server: WorkspaceServer } + | { server: null; unknown: ServerUnknownReason; stored: string | null } + +export type OwnerContext = { + /** The server that answered the listing. */ + answering: WorkspaceServer + /** Saved servers by id, from this computer's store. */ + savedServer: (id: string) => WorkspaceServer | undefined +} + +export const LOCAL_SERVER: WorkspaceServer = { id: LOCAL_ENVIRONMENT, name: LOCAL_ENVIRONMENT } + +/** The server the client routes to; a saved route is named by its stored id and name. */ +export function describeClientServer(client: RuntimeClient): WorkspaceServer { + if (!client.isRemote) { + return LOCAL_SERVER + } + const selector = client.environmentSelector + if (!selector) { + return { id: null, name: null } + } + const saved = listEnvironments(client.userDataPath).find( + (server) => server.id === selector || server.name === selector + ) + return saved ? { id: saved.id, name: saved.name } : { id: selector, name: selector } +} + +export function readOwnerContext(client: RuntimeClient): OwnerContext { + const answering = describeClientServer(client) + let saved: Map | undefined + return { + answering, + savedServer: (id) => { + saved ??= new Map( + listEnvironments(client.userDataPath).map((server) => [ + server.id, + { id: server.id, name: server.name } + ]) + ) + return saved.get(id) + } + } +} + +/** The server that owns a row with this stored host id, or why it can't be named here. */ +/** Stamps are relative to the store that wrote them; only the local answer shares this computer's. */ +function savedServerInAnswerNamespace( + id: string, + context: OwnerContext +): WorkspaceServer | undefined { + return context.answering.id === LOCAL_ENVIRONMENT ? context.savedServer(id) : undefined +} + +export function ownerOfHostId(hostId: string | null | undefined, context: OwnerContext): RowOwner { + const stored = hostId?.trim() || null + if (!stored) { + return { server: null, unknown: 'owner-not-reported', stored } + } + if (isUnresolvedOwnerHostId(stored)) { + return { server: null, unknown: 'conflicting-ownership', stored } + } + const parsed = parseExecutionHostId(stored) + if (parsed?.kind === 'local') { + return { server: context.answering } + } + if (parsed?.kind === 'ssh') { + return { server: null, unknown: 'legacy-ssh-row', stored } + } + const saved = + parsed?.kind === 'runtime' + ? savedServerInAnswerNamespace(parsed.environmentId, context) + : undefined + return saved ? { server: saved } : { server: null, unknown: 'unverified-owner', stored } +} + +/** Orchestration projections name the home coordinator `local` and other owners by a bare id. */ +export function ownerOfWorkerHost( + host: { kind?: 'local' | 'remote'; id: string }, + context: OwnerContext +): RowOwner { + if (host.kind === 'local' || (host.kind === undefined && host.id === LOCAL_ENVIRONMENT)) { + return { server: context.answering } + } + const saved = savedServerInAnswerNamespace(host.id, context) + return saved ? { server: saved } : { server: null, unknown: 'unverified-owner', stored: host.id } +} + +export function serverLabel(server: WorkspaceServer | null): string { + return server?.name ?? 'one-off connection' +} + +function unknownDetail(owner: Extract): string { + switch (owner.unknown) { + case 'conflicting-ownership': + return 'conflicting ownership' + case 'legacy-ssh-row': + return `legacy SSH row ${owner.stored}` + case 'owner-not-reported': + return 'owner not reported' + case 'unverified-owner': + return `stored ${owner.stored}; owner not verified` + } +} + +/** The owner as printed after `server:` or `server=`. */ +export function formatOwner(owner: RowOwner): string { + return owner.server ? serverLabel(owner.server) : `unknown (${unknownDetail(owner)})` +} + +/** `server=` for one listing row; a name that would split the row is quoted. */ +export function formatOwnerToken(owner: RowOwner): string { + return `server=${owner.server ? quoteCliCommandArgument(serverLabel(owner.server)) : formatOwner(owner)}` +} + +/** A row's `server=` token, or none when no owner context was given. */ +export function ownerTokenOf( + hostId: string | null | undefined, + context: OwnerContext | undefined +): string { + return context ? ` ${formatOwnerToken(ownerOfHostId(hostId, context))}` : '' +} diff --git a/src/cli/runtime/client.ts b/src/cli/runtime/client.ts index 1425d23af36..ff4efbb5b6a 100644 --- a/src/cli/runtime/client.ts +++ b/src/cli/runtime/client.ts @@ -246,8 +246,8 @@ export class RuntimeClient { ok: true, result: { target: { - kind: 'environment', - environment: this.environmentSelector ?? 'pairing-code' + kind: 'server', + server: this.environmentSelector ?? 'pairing-code' }, app: projectRemoteAppStatus(response.result), runtime: { @@ -308,7 +308,7 @@ export class RuntimeClient { if (!response.result.capabilities?.includes(ORCHESTRATION_CONTRACT_RUNTIME_CAPABILITY)) { throw new RuntimeClientError( 'orchestration_migration_required', - 'The connected Orca runtime does not support the current orchestration contract. No effects were applied.', + 'The connected Orca server does not support the current orchestration contract. No effects were applied.', orchestrationMigrationData('runtime_capability_missing') ) } diff --git a/src/cli/runtime/environment-pairing-exchange.ts b/src/cli/runtime/environment-pairing-exchange.ts index 2e0321c8509..3a9a777aad2 100644 --- a/src/cli/runtime/environment-pairing-exchange.ts +++ b/src/cli/runtime/environment-pairing-exchange.ts @@ -13,7 +13,7 @@ const STATUS_PROBE_TIMEOUT_MS = 5_000 function pairingCodeRefused(): RuntimeClientError { return new RuntimeClientError( 'unauthorized', - 'The host refused this pairing code. It may have expired or already been used by another device. Show a new pairing code on the host (`orca pair`, or Settings → Remote Orca Servers in Orca) and run `orca environment add` again.' + 'The host refused this pairing code. It may have expired or already been used by another device. Show a new pairing code on the host (`orca pair`, or Settings → Remote Orca Servers in Orca) and run `orca server add` again.' ) } diff --git a/src/cli/runtime/environments.ts b/src/cli/runtime/environments.ts index 5342e21e429..40453733e30 100644 --- a/src/cli/runtime/environments.ts +++ b/src/cli/runtime/environments.ts @@ -16,7 +16,7 @@ import type { PairingOffer } from '../../shared/remote-runtime/pairing/mobile-re import { RuntimeClientError } from './types' export type EnvironmentAddResult = { - environment: PublicKnownRuntimeEnvironment + server: PublicKnownRuntimeEnvironment } export type EnvironmentRemoveResult = { diff --git a/src/cli/runtime/recipe-vm-wake-gate.ts b/src/cli/runtime/recipe-vm-wake-gate.ts index 0b5f937a5a2..e7b0a0b2725 100644 --- a/src/cli/runtime/recipe-vm-wake-gate.ts +++ b/src/cli/runtime/recipe-vm-wake-gate.ts @@ -50,7 +50,7 @@ export async function prepareRecipeVmEnvironmentCall( } throw new RuntimeClientError( RUNTIME_ENVIRONMENT_ASLEEP_ERROR_CODE, - `The VM behind environment "${environment.name}" is asleep. Run \`orca worktree activate --worktree \` for its workspace, or open it in Orca, to wake it.` + `The VM behind server "${environment.name}" is asleep. Run \`orca worktree activate --worktree \` for its workspace, or open it in Orca, to wake it.` ) } const answer = await askDesktopToWake(environment.id) @@ -61,13 +61,13 @@ export async function prepareRecipeVmEnvironmentCall( if (answer === 'unsupported') { throw new RuntimeClientError( RUNTIME_ENVIRONMENT_ASLEEP_ERROR_CODE, - `The VM behind environment "${environment.name}" is asleep, and no running Orca here can wake it. Open Orca and open the workspace to wake it.` + `The VM behind server "${environment.name}" is asleep, and no running Orca here can wake it. Open Orca and open the workspace to wake it.` ) } if (answer === 'still-waking') { throw new RuntimeClientError( RUNTIME_ENVIRONMENT_WAKING_ERROR_CODE, - `The VM behind environment "${environment.name}" is still waking up. Try again in a moment.` + `The VM behind server "${environment.name}" is still waking up. Try again in a moment.` ) } // Up now, perhaps woken since this command read the server's pairing. diff --git a/src/cli/runtime/runtime-access-denied.ts b/src/cli/runtime/runtime-access-denied.ts index 33b8dde90b3..1c6fa853043 100644 --- a/src/cli/runtime/runtime-access-denied.ts +++ b/src/cli/runtime/runtime-access-denied.ts @@ -12,7 +12,7 @@ export function runtimeAccessDeniedError(socketError: Error): RuntimeClientError : `Permission denied connecting to Orca (${systemCode}). Orca may be running normally; this command's sandbox or OS permissions block the connection.` const retryStep = codexSandbox ? "Retry through Codex's existing escalation when the session permits it; otherwise run the same command from a terminal outside the sandbox." - : 'Re-run this command outside its sandbox, or as a user allowed to reach the Orca runtime.' + : 'Re-run this command outside its sandbox, or as a user allowed to reach the Orca server.' return new RuntimeClientError('runtime_access_denied', message, { systemCode, nextSteps: [ diff --git a/src/cli/runtime/runtime-remote-pairing.ts b/src/cli/runtime/runtime-remote-pairing.ts index 6de5f01e56e..ad3cd789c84 100644 --- a/src/cli/runtime/runtime-remote-pairing.ts +++ b/src/cli/runtime/runtime-remote-pairing.ts @@ -28,7 +28,7 @@ function resolvePairedConnection( if (pairingCode && environmentSelector) { throw new RuntimeClientError( 'invalid_argument', - 'Use either --pairing-code or --environment, not both.' + 'Use either --pairing-code or --server, not both.' ) } if (environmentSelector) { diff --git a/src/cli/runtime/terminal-prompt-mutation-recovery.ts b/src/cli/runtime/terminal-prompt-mutation-recovery.ts index 9fee7462043..68579c8f014 100644 --- a/src/cli/runtime/terminal-prompt-mutation-recovery.ts +++ b/src/cli/runtime/terminal-prompt-mutation-recovery.ts @@ -44,10 +44,7 @@ export function attachLegacyTerminalPromptRecovery(error: unknown): unknown { return attachUnknownTerminalPromptRecovery( error, 'The legacy host cannot prove whether the prompt was delivered', - [ - INSPECT_STEP, - 'Update Orca on the execution host before future prompt sends that need durable retry.' - ] + [INSPECT_STEP, 'Update Orca on that server before future prompt sends that need durable retry.'] ) } @@ -61,10 +58,10 @@ export function attachUnverifiedTerminalPromptRecovery(error: unknown): RuntimeC ) return attachUnknownTerminalPromptRecovery( normalized, - 'Orca cannot prove whether the prompt was delivered by the prompt-delivery-capable runtime from the preflight', + 'Orca cannot prove whether the prompt was delivered by the prompt-delivery-capable server from the preflight', [ INSPECT_STEP, - 'A different Orca runtime answered than the one whose prompt-delivery support was verified; confirm which runtime serves this host before sending again.' + 'A different Orca server answered than the one whose prompt-delivery support was verified; confirm which server answers this route before sending again.' ] ) } diff --git a/src/cli/runtime/transport.test.ts b/src/cli/runtime/transport.test.ts index 31871e1b96f..d53dac4788e 100644 --- a/src/cli/runtime/transport.test.ts +++ b/src/cli/runtime/transport.test.ts @@ -108,9 +108,7 @@ describe.skipIf(process.platform === 'win32')('runtime transport', () => { ) expect(error).toMatchObject({ code: 'runtime_unavailable' }) - expect(formatCliError(error)).toBe( - 'The Orca runtime changed while the request was in flight.\nNext step: Retry the command.' - ) + expect(formatCliError(error)).toContain('\nNext step: Retry the command.') }) it.each(['preflight', 'mutation'] as const)( diff --git a/src/cli/runtime/transport.ts b/src/cli/runtime/transport.ts index eafc4672ff8..fc7e6432f11 100644 --- a/src/cli/runtime/transport.ts +++ b/src/cli/runtime/transport.ts @@ -72,7 +72,7 @@ export async function sendRequest( reject( new RuntimeClientError( 'runtime_timeout', - 'Timed out waiting for the Orca runtime to respond.' + 'Timed out waiting for the Orca server to respond.' ) ) }, timeoutMs) @@ -147,7 +147,7 @@ export async function sendRequest( ok: false, error: new RuntimeClientError( 'invalid_runtime_response', - 'The Orca runtime returned an invalid response frame.' + 'The Orca server returned an invalid response frame.' ) }) return @@ -166,7 +166,7 @@ export async function sendRequest( ok: false, error: new RuntimeClientError( 'invalid_runtime_response', - 'The Orca runtime returned an invalid response frame.' + 'The Orca server returned an invalid response frame.' ) }) return @@ -184,7 +184,7 @@ export async function sendRequest( ok: false, error: new RuntimeClientError( 'invalid_runtime_response', - 'The Orca runtime returned a mismatched response id.' + 'The Orca server returned a mismatched response id.' ) }) return @@ -194,7 +194,7 @@ export async function sendRequest( ok: false, error: new RuntimeClientError( 'runtime_unavailable', - 'The Orca runtime changed while the request was in flight.', + 'The Orca server changed while the request was in flight.', { nextSteps: ['Retry the command.'] } ) }) diff --git a/src/cli/selector-ambiguity-recovery.ts b/src/cli/selector-ambiguity-recovery.ts index 6205c958eeb..5379a8dace2 100644 --- a/src/cli/selector-ambiguity-recovery.ts +++ b/src/cli/selector-ambiguity-recovery.ts @@ -14,7 +14,7 @@ const EXACT_FORMS = { }, worktree: { forms: - 'identity: (host-qualified), id::: when only one host has that checkout, or folder: for a folder workspace', + 'identity: (host-qualified), id::: when only one server has that checkout, or folder: for a folder workspace', list: 'orca worktree ps --json', noun: 'workspace' } @@ -45,7 +45,7 @@ export function selectorAmbiguityRecovery(selectors: { return [ `${matched} Pass an exact selector: ${exact.forms}.`, selectors.remoteServerSelected - ? `List the exact values with \`${exact.list}\`, passing the same server flag (--environment, --pairing-code or --host runtime:) as this command.` + ? `List the exact values with \`${exact.list}\`, passing the same server flag (--server, --pairing-code or --host runtime:) as this command.` : `List the exact values with \`${exact.list}\`.` ] }) diff --git a/src/cli/specs/account.ts b/src/cli/specs/account.ts index 1b93df78f2f..c7c5e465f40 100644 --- a/src/cli/specs/account.ts +++ b/src/cli/specs/account.ts @@ -4,13 +4,13 @@ import { LOCAL_COMMAND_FLAGS, type CommandSpec } from '../args' export const ACCOUNT_COMMAND_SPECS: CommandSpec[] = [ { path: ['account', 'add'], - summary: 'Add a managed agent account by signing in on this Orca host', + summary: 'Add a managed agent account by signing in on this Orca server', usage: 'orca account add [--agent claude|codex|opencode|devin] [--label ] [--integration ] [--method ] [--answer ]... [--json]', allowedFlags: [...LOCAL_COMMAND_FLAGS, 'agent', 'label', 'integration', 'method', 'answer'], repeatableFlags: ['answer'], notes: [ - 'Runs the agent login (`claude login` / `codex login`) in this terminal, then registers the account with the local Orca runtime.', + 'Runs the agent login (`claude login` / `codex login`) in this terminal, then registers the account with the Orca on this computer.', 'Codex uses device authorization so the browser can complete sign-in from a different machine.', 'OpenCode 2 uses `opencode auth login --standalone` in private XDG directories. Devin uses `devin auth login --force-manual-token-flow`.', 'Use --integration to skip the OpenCode integration picker; --label names the saved OpenCode or Devin profile.', @@ -18,7 +18,7 @@ export const ACCOUNT_COMMAND_SPECS: CommandSpec[] = [ 'Antigravity accounts are saved from the current `agy` login in Orca Settings > AI Provider Accounts.', 'OpenCode and Devin profiles apply to new explicit host agent launches. Direct SSH relay and Windows-hosted WSL selection are not supported; run the command on a headless Orca runtime on that host.', 'Sign in with the account you want to add (e.g. use a private/incognito browser window for a second account).', - '--agent defaults to claude. Requires the Orca runtime to be running on this machine.' + '--agent defaults to claude. Requires Orca to be running on this computer.' ], examples: [ 'orca account add', @@ -28,24 +28,24 @@ export const ACCOUNT_COMMAND_SPECS: CommandSpec[] = [ }, { path: ['account', 'list'], - summary: 'List managed agent accounts on this Orca host', + summary: 'List managed agent accounts on this Orca server', usage: 'orca account list [--agent claude|codex|opencode|devin|antigravity] [--json]', allowedFlags: [...LOCAL_COMMAND_FLAGS, 'agent'], notes: [ "Lists the accounts on this machine with the ids `orca account select` and `orca account rm` accept. `system` is the provider's own sign-in outside Orca.", - '`--environment` / `--pairing-code` are rejected rather than ignored; run it on the host whose accounts you want to see.' + '`--server` / `--pairing-code` are rejected rather than ignored; run it on the server whose accounts you want to see.' ], examples: ['orca account list', 'orca account list --agent claude'] }, { path: ['account', 'select'], - summary: 'Select the account new agent launches use on this Orca host', + summary: 'Select the account new agent launches use on this Orca server', usage: 'orca account select --agent claude|codex|opencode|devin|antigravity --account [--json]', allowedFlags: [...LOCAL_COMMAND_FLAGS, 'agent', 'account'], notes: [ "--account takes an id, email or label from `orca account list`, or `system` for the provider's own sign-in. An email shared by several accounts is refused; pass the id.", - 'The selection applies to agents launched on this host after it, like the status-bar account switcher. Antigravity has no `system` default.' + 'The selection applies to agents launched on this server after it, like the status-bar account switcher. Antigravity has no `system` default.' ], examples: [ 'orca account select --agent claude --account me@work.example', diff --git a/src/cli/specs/agent-launch.ts b/src/cli/specs/agent-launch.ts index ac1ef1870ff..bff291049bb 100644 --- a/src/cli/specs/agent-launch.ts +++ b/src/cli/specs/agent-launch.ts @@ -19,12 +19,12 @@ export const AGENT_LAUNCH_COMMAND_SPECS: CommandSpec[] = [ 'retry-launch' ], notes: [ - 'Starts the agent the way a new agent tab does: as a chat when your Chat | CLI choice for the agent is Chat and the agent and host support it, otherwise as a terminal. The result says which (`outcome.kind`) and why (`receipt.detail`).', + 'Starts the agent the way a new agent tab does: as a chat when your Chat | CLI choice for the agent is Chat and the agent and server support it, otherwise as a terminal. The result says which (`outcome.kind`) and why (`receipt.detail`).', '--surface chat|terminal picks for this launch instead of your setting. --surface terminal always runs the agent CLI; --surface chat is refused when Orca can establish before starting anything that this agent cannot open as a chat there. If support cannot be checked, the launch can fall back to a terminal. If chat becomes unavailable after creating a workspace, Orca keeps the workspace, setup and default tabs, then opens a terminal; the receipt explains the fallback.', '--worktree defaults to the native folder workspace or worktree containing the current directory. For a new checkout with its agent, use `orca worktree create --agent`.', '--model takes a provider model id (OMP also takes its model roles and selectors) and --effort a reasoning effort for that model; --effort requires --model. They apply to either surface.', 'The tab opens without switching focus; pass --focus to switch to it.', - 'If the launch reply is lost, re-issue the same command from the same directory on the same host with --retry-launch from the error. Never retry as a fresh launch; older hosts require inspecting the workspace first.' + 'If the launch reply is lost, re-issue the same command from the same directory on the same server with --retry-launch from the error. Never retry as a fresh launch; older hosts require inspecting the workspace first.' ], examples: [ 'orca agent launch --agent codex --json', diff --git a/src/cli/specs/automations.ts b/src/cli/specs/automations.ts index a7597c8f0e0..40dc5a206fa 100644 --- a/src/cli/specs/automations.ts +++ b/src/cli/specs/automations.ts @@ -42,7 +42,7 @@ export const AUTOMATION_COMMAND_SPECS: CommandSpec[] = [ path: ['automations', 'create'], summary: 'Create a scheduled Orca automation', usage: - 'orca automations create --name --trigger --prompt --provider [--precheck ] [--setup run|skip] [--repo |--workspace |--project [--host ]|--project-host-setup ] [--json]', + 'orca automations create --name --trigger --prompt --provider [--precheck ] [--setup run|skip] [--repo |--workspace |--project |--project-host-setup ] [--json]', allowedFlags: [ ...GLOBAL_FLAGS, 'name', @@ -57,16 +57,15 @@ export const AUTOMATION_COMMAND_SPECS: CommandSpec[] = [ notes: [ 'Trigger accepts hourly, daily, weekdays, weekly, a 5-field cron expression, or an RRULE string.', 'When --repo is omitted, the CLI uses the enclosing Orca worktree when one can be resolved from cwd.', - 'Use --project, or --project-host-setup, to run on a specific project host setup. --project takes the project id or the display name from `orca project list`, and --host is only needed when the project is set up on more than one host.', - '--host takes local, ssh:, runtime:, or the bare host name `orca host list` prints for any of them.', - 'Use --source-context with a JSON TaskSourceContext when task/provider data should come from a specific host/account; pass null on edit to clear it.', + 'Use --project, or --project-host-setup, to run on a specific project host setup. --project takes the project id or the display name from `orca project list`, and --server picks that server\u2019s own setup when the project is set up for more than one server here.', + 'Use --source-context with a JSON TaskSourceContext when task/provider data should come from a specific server/account; pass null on edit to clear it.', 'Use --workspace to run in an existing worktree. With --repo or a project target, the automation creates a new worktree per run; with no target, a local create runs in the current Orca worktree unless you pass --workspace-mode new-per-run.', - 'Use --setup run|skip for repository setup on new-per-run automations. Explicit choices override the repository setup policy and need a host running current Orca. When omitted on create, no choice is saved; current Orca skips setup.', + 'Use --setup run|skip for repository setup on new-per-run automations. Explicit choices override the repository setup policy and need a server running current Orca. When omitted on create, no choice is saved; current Orca skips setup.', 'Use --precheck to run a command only before scheduled runs; exit code 0 continues, any other exit, error, or timeout skips the run.', 'Use --precheck-timeout to set the time limit (default 60 seconds). Skips appear in Orca run history and orca automations runs --id as skipped_precheck.', 'Run now in Orca and orca automations run intentionally bypass the precheck so you can test or override the scheduled condition.', 'Use --reuse-session only with existing-workspace automations to submit later runs to the previous live automation session when it is still available. Use --fresh-session to disable reuse.', - 'Use --extra-agent-args="--model opus --effort high" to add arguments after the host\'s default agent Arguments on each fresh run. Only model, effort, and a few safe options are accepted (Antigravity, Claude, Codex, CodeBuddy, Cursor, Grok, OMP, Pi); extras cannot be combined with --reuse-session. On edit, --extra-agent-args= clears them.' + 'Use --extra-agent-args="--model opus --effort high" to add arguments after the server\'s default agent Arguments on each fresh run. Only model, effort, and a few safe options are accepted (Antigravity, Claude, Codex, CodeBuddy, Cursor, Grok, OMP, Pi); extras cannot be combined with --reuse-session. On edit, --extra-agent-args= clears them.' ], examples: [ 'orca automations create --name "Daily review" --trigger daily --prompt "Review open changes" --provider codex', @@ -134,7 +133,7 @@ export const AUTOMATION_COMMAND_SPECS: CommandSpec[] = [ 'orca automations runs [--id ] [--limit ] [--cursor ] [--json]', allowedFlags: [...GLOBAL_FLAGS, 'id', 'limit', 'cursor'], notes: [ - 'Without --limit or --cursor, reads the whole history in pages, so a large history from a paired server still fits in its replies.', + 'Without --limit or --cursor, reads the whole history in pages, so a large history from another server still fits in its replies.', 'With --limit or --cursor, prints one page (newest first, at most 100 runs) and its nextCursor; pass that as --cursor for the next page.' ], examples: [ diff --git a/src/cli/specs/browser-basic.ts b/src/cli/specs/browser-basic.ts index 2d9ea0f589e..669acd5ff94 100644 --- a/src/cli/specs/browser-basic.ts +++ b/src/cli/specs/browser-basic.ts @@ -6,14 +6,14 @@ import { BROWSER_WAIT_DEFAULT_TIMEOUT_MS } from '../../shared/browser-wait-timeo export const BROWSER_BASIC_COMMAND_SPECS: CommandSpec[] = withBrowserPageTarget([ { path: ['browser', 'identity', 'get'], - summary: 'Show the browser identity configured on this Orca host', + summary: 'Show the browser identity configured on this Orca server', usage: 'orca browser identity get [--json]', aliases: [['browser', 'identity', 'show']], allowedFlags: [...GLOBAL_FLAGS] }, { path: ['browser', 'identity', 'set'], - summary: 'Choose the browser identity for every page on this Orca host', + summary: 'Choose the browser identity for every page on this Orca server', usage: 'orca browser identity set --mode [--reset] [--json]', allowedFlags: [...GLOBAL_FLAGS, 'mode', 'reset'] }, diff --git a/src/cli/specs/chat.ts b/src/cli/specs/chat.ts index 28fb41556dd..488b5c2370d 100644 --- a/src/cli/specs/chat.ts +++ b/src/cli/specs/chat.ts @@ -8,7 +8,7 @@ export const CHAT_COMMAND_SPECS: CommandSpec[] = [ usage: 'orca chat rename [--session ] --name [--json]', allowedFlags: [...GLOBAL_FLAGS, 'session', 'name'], notes: [ - '--session takes the chat session id `orca agent launch` prints. Run inside a chat, it defaults to that chat; with --environment it is required.', + '--session takes the chat session id `orca agent launch` prints. Run inside a chat, it defaults to that chat; with --server it is required.', 'The name shows in the tab, the sidebar, Session History and on paired phones, the same as renaming the tab by hand.' ], examples: [ diff --git a/src/cli/specs/core.ts b/src/cli/specs/core.ts index 120b61001d3..47892ea9f99 100644 --- a/src/cli/specs/core.ts +++ b/src/cli/specs/core.ts @@ -60,10 +60,10 @@ export const CORE_COMMAND_SPECS: CommandSpec[] = [ usage: 'orca worktree activate --worktree [--json]', allowedFlags: [...GLOBAL_FLAGS, 'worktree'], notes: [ - 'With --environment naming a recipe VM that is asleep, Orca on this computer wakes the VM first and waits for it.', + 'With --server naming a recipe VM that is asleep, Orca on this computer wakes the VM first and waits for it.', 'Folder workspaces cannot be activated from the CLI yet; open them from the Orca sidebar.' ], - examples: ['orca worktree activate --worktree branch:fix-login --environment sandbox'] + examples: ['orca worktree activate --worktree branch:fix-login --server sandbox'] }, { path: ['worktree', 'current'], @@ -184,7 +184,7 @@ export const CORE_COMMAND_SPECS: CommandSpec[] = [ 'Creates a visible terminal tab without switching focus when possible; falls back to a background handle if the UI cannot adopt it. Pass --focus to switch to it.', 'This creates a terminal and runs --command in it. To start an agent, use `orca agent launch` (or `orca worktree create --agent` for a new checkout), which follows your Chat | CLI choice.', '--shell picks the shell the terminal IS on a Windows host (cmd.exe, powershell.exe, pwsh.exe, wsl.exe, bash.exe, git-bash); --command is typed into whatever shell the host started, so `--command cmd.exe` leaves a cmd running INSIDE the default shell and exiting it drops back to that shell.', - 'A host that cannot apply --shell refuses the create rather than quietly spawning its default shell: macOS and Linux execution hosts spawn the login shell, terminals routed over SSH resolve their shell on the SSH host, a --shell that contradicts the project execution runtime (WSL vs Windows host) is refused, and an Orca host older than --shell is refused by the CLI.' + 'A host that cannot apply --shell refuses the create rather than quietly spawning its default shell: macOS and Linux servers spawn the login shell, terminals routed over SSH resolve their shell on the SSH host, a --shell that contradicts the project execution runtime (WSL vs Windows host) is refused, and an Orca server older than --shell is refused by the CLI.' ], examples: [ 'orca terminal create --json', @@ -202,7 +202,7 @@ export const CORE_COMMAND_SPECS: CommandSpec[] = [ usage: 'orca terminal switch [--terminal ] [--json]', allowedFlags: [...GLOBAL_FLAGS, 'terminal'], notes: [ - "With --environment, the desktop app on this machine switches to that server's terminal; a server has no window of its own." + "With --server, the desktop app on this machine switches to that server's terminal; a server has no window of its own." ], examples: ['orca terminal switch --terminal term_abc123'] }, diff --git a/src/cli/specs/environment.ts b/src/cli/specs/environment.ts index f44a0fa5e56..fb829e9df8e 100644 --- a/src/cli/specs/environment.ts +++ b/src/cli/specs/environment.ts @@ -3,43 +3,45 @@ import { GLOBAL_FLAGS, LOCAL_COMMAND_FLAGS } from '../args' export const ENVIRONMENT_COMMAND_SPECS: CommandSpec[] = [ { - path: ['host', 'name'], - summary: 'Show or set the name this Orca runtime reports to connected clients', - usage: 'orca host name [--name ] [--json]', + path: ['server', 'name'], + legacyAliases: [['host', 'name']], + summary: + 'Show or set the name this Orca server reports (its computer name, not its saved name)', + usage: 'orca server name [--name ] [--json]', allowedFlags: [...GLOBAL_FLAGS, 'name'], notes: [ - 'With --name, updates the answering runtime over its authenticated connection. Use an empty value to return to the detected computer name.', - 'Without --name, prints the name and platform the answering runtime reports.' + 'With --name, updates the answering server over its authenticated connection. Use an empty value to return to the detected computer name.', + 'Without --name, prints the name and platform the answering server reports.' ], - examples: ['orca host name', 'orca host name --name build-server'] + examples: ['orca server name', 'orca server name --name build-server'] }, { path: ['host', 'list'], - summary: 'List every machine this Orca host can target, and how to name each one', + hidden: true, + summary: 'List this computer, its SSH connections and saved Orca servers', usage: 'orca host list [--json]', allowedFlags: [...LOCAL_COMMAND_FLAGS], notes: [ - 'Answers "what can I target and what do I pass" in one place: this machine, the SSH targets registered on it, and the Orca servers paired with it.', - 'The three kinds are reached differently. A paired Orca server is a connection, selected with --environment . An SSH target is a machine the connected Orca host reaches, selected with --host ssh:. Passing one where the other belongs is the most common way to get an empty or missing-host answer.', - 'Commands that take --host also accept any name this list prints, such as --host "this machine" or --host (except `orca host rm`, which takes only the ssh: form). A name two hosts share is refused with the exact flag for each.', + 'Lists this computer, the SSH connections registered on it, and the saved Orca servers. To run a command on a server, use --server; see `orca server list`.', 'SSH rows include the detected remote platform after that target has connected (linux, darwin, or win32); disconnected or older targets report platform unknown.', 'SSH rows also include whether the target is currently connected and its lifecycle status when known.', - 'Paired-server rows come from the pairing store and report platform unknown; ask one server directly with `orca host name --environment `.', - "SSH targets are read from this machine's own Orca runtime, so this lists that machine's targets and not another server's. Run `orca host list` on the other machine to see the targets registered there.", - '--environment and --pairing-code are rejected rather than ignored: paired servers come from this machine\u2019s pairing store, so a routed answer would describe two machines at once.' + 'Saved-server rows come from the pairing store and report platform unknown; ask one server directly with `orca server name --server `.', + "SSH connections are read from the Orca on this computer, so this lists this computer's connections and not another server's.", + '--server and --pairing-code are rejected rather than ignored: saved servers come from this computer\u2019s pairing store, so a routed answer would describe two computers at once.' ], examples: ['orca host list', 'orca host list --json'] }, { path: ['host', 'rm'], + hidden: true, destructive: true, - summary: 'Remove one saved SSH target from this Orca host', + summary: 'Remove one saved SSH connection from the Orca on this computer', usage: 'orca host rm --host ssh: [--json]', allowedFlags: [...LOCAL_COMMAND_FLAGS, 'host'], notes: [ 'Removes the target the same way Settings does: its connection closes, and the passive ~/.ssh/config import does not add the alias back. Restore removed hosts in Settings brings it back.', - 'Takes only the --host ssh: form that `orca host list` prints. This machine and paired Orca servers are refused; remove a paired server with `orca environment rm`.', - '--environment and --pairing-code are rejected rather than ignored: SSH targets are removed from this machine\u2019s own Orca runtime.' + 'Takes only the --host ssh: form that `orca host list` prints. This computer and saved Orca servers are refused; remove a saved server with `orca server rm`.', + '--server and --pairing-code are rejected rather than ignored: SSH connections are removed from the Orca on this computer.' ], examples: [ 'orca host rm --host ssh:ssh-1783599077486-fyasux', @@ -47,32 +49,37 @@ export const ENVIRONMENT_COMMAND_SPECS: CommandSpec[] = [ ] }, { - path: ['environment', 'add'], - summary: 'Save a remote Orca runtime environment from a pairing code', - usage: 'orca environment add --name --pairing-code [--json]', + path: ['server', 'add'], + legacyAliases: [['environment', 'add']], + summary: 'Save an Orca server from a pairing code', + usage: 'orca server add --name --pairing-code [--json]', allowedFlags: [...LOCAL_COMMAND_FLAGS, 'pairing-code', 'name'], - examples: ['orca environment add --name work-laptop --pairing-code orca://pair?code=...'] + examples: ['orca server add --name work-laptop --pairing-code orca://pair?code=...'] }, { - path: ['environment', 'list'], - summary: 'List saved Orca runtime environments', - usage: 'orca environment list [--json]', + path: ['server', 'list'], + legacyAliases: [['environment', 'list']], + summary: 'List saved Orca servers', + usage: 'orca server list [--json]', allowedFlags: [...LOCAL_COMMAND_FLAGS], notes: [ - 'Answers from this machine\u2019s pairing store. --environment and --pairing-code are rejected rather than ignored, because there is no other host that could answer.' + 'Answers from this computer\u2019s pairing store and never contacts a server. `local` (the Orca on this computer) is always available and is not listed.', + '--server and --pairing-code are rejected rather than ignored, because no other server could answer.' ] }, { - path: ['environment', 'show'], - summary: 'Show one saved Orca runtime environment', - usage: 'orca environment show --environment [--json]', - allowedFlags: [...LOCAL_COMMAND_FLAGS, 'environment'] + path: ['server', 'show'], + legacyAliases: [['environment', 'show']], + summary: 'Show one saved server', + usage: 'orca server show --server [--json]', + allowedFlags: [...LOCAL_COMMAND_FLAGS, 'server'] }, { - path: ['environment', 'rm'], + path: ['server', 'rm'], + legacyAliases: [['environment', 'rm']], destructive: true, - summary: 'Remove one saved Orca runtime environment', - usage: 'orca environment rm --environment [--json]', - allowedFlags: [...LOCAL_COMMAND_FLAGS, 'environment'] + summary: 'Remove a saved server', + usage: 'orca server rm --server [--json]', + allowedFlags: [...LOCAL_COMMAND_FLAGS, 'server'] } ] diff --git a/src/cli/specs/managed-server.ts b/src/cli/specs/managed-server.ts index 160c42c77bd..3759faca6e8 100644 --- a/src/cli/specs/managed-server.ts +++ b/src/cli/specs/managed-server.ts @@ -2,90 +2,96 @@ import type { CommandSpec } from '../args' import { LOCAL_COMMAND_FLAGS } from '../args' const SELECTOR_NOTE = - '--environment names a managed Orca server this machine deployed over SSH (see `orca environment list`); it is a selector here, not a routing flag.' + '--server names a managed server this computer set up over SSH (see `orca server list`); here it picks the saved entry, it does not route the command.' const DESKTOP_NOTE = - 'Runs on this machine’s Orca desktop app, the same action as Settings > Orca on your SSH hosts. A runtime without the SSH registry (headless `orca serve`) refuses it.' + 'Runs on the Orca desktop app on this computer, the same action as Settings > Orca on your SSH hosts. A server without the SSH registry (headless `orca serve`) refuses it.' export const MANAGED_SERVER_COMMAND_SPECS: CommandSpec[] = [ { - path: ['environment', 'status'], + path: ['server', 'status'], + legacyAliases: [['environment', 'status']], summary: 'Show a managed Orca server’s active version, terminals and pending work', - usage: 'orca environment status --environment [--json]', - allowedFlags: [...LOCAL_COMMAND_FLAGS, 'environment'], + usage: 'orca server status --server [--json]', + allowedFlags: [...LOCAL_COMMAND_FLAGS, 'server'], notes: [SELECTOR_NOTE, DESKTOP_NOTE], - examples: ['orca environment status --environment build-box'] + examples: ['orca server status --server build-box'] }, { - path: ['environment', 'update'], + path: ['server', 'update'], + legacyAliases: [['environment', 'update']], summary: 'Update a managed Orca server to this build’s version', - usage: 'orca environment update --environment [--force] [--json]', - allowedFlags: [...LOCAL_COMMAND_FLAGS, 'environment', 'force'], + usage: 'orca server update --server [--force] [--json]', + allowedFlags: [...LOCAL_COMMAND_FLAGS, 'server', 'force'], notes: [ 'Without --force, an update that would restart over running terminals is deferred and reported, not applied.', SELECTOR_NOTE, DESKTOP_NOTE ], - examples: ['orca environment update --environment build-box'] + examples: ['orca server update --server build-box'] }, { - path: ['environment', 'rollback'], + path: ['server', 'rollback'], + legacyAliases: [['environment', 'rollback']], destructive: true, summary: 'Roll a managed Orca server back to its previous version', - usage: 'orca environment rollback --environment [--json]', - allowedFlags: [...LOCAL_COMMAND_FLAGS, 'environment'], + usage: 'orca server rollback --server [--json]', + allowedFlags: [...LOCAL_COMMAND_FLAGS, 'server'], notes: [SELECTOR_NOTE, DESKTOP_NOTE] }, { - path: ['environment', 'recover'], + path: ['server', 'recover'], + legacyAliases: [['environment', 'recover']], summary: 'Finish or undo a managed Orca server’s interrupted update, rollback or stop', - usage: - 'orca environment recover --environment [--accept-changed-state --yes] [--json]', - allowedFlags: [...LOCAL_COMMAND_FLAGS, 'environment', 'accept-changed-state', 'yes'], + usage: 'orca server recover --server [--accept-changed-state --yes] [--json]', + allowedFlags: [...LOCAL_COMMAND_FLAGS, 'server', 'accept-changed-state', 'yes'], notes: [ 'When a rejected build changed profile state, recover refuses rather than restart the previous build over it. --accept-changed-state --yes restores the prelaunch snapshot instead, the same as Restore in Settings > Orca on your SSH hosts; what the rejected build changed is discarded.', SELECTOR_NOTE, DESKTOP_NOTE ], examples: [ - 'orca environment recover --environment build-box', - 'orca environment recover --environment build-box --accept-changed-state --yes' + 'orca server recover --server build-box', + 'orca server recover --server build-box --accept-changed-state --yes' ] }, { - path: ['environment', 'stop'], + path: ['server', 'stop'], + legacyAliases: [['environment', 'stop']], destructive: true, - summary: 'Stop a managed Orca server and unlink it from this machine (decommission)', - usage: 'orca environment stop --environment --yes [--json]', - allowedFlags: [...LOCAL_COMMAND_FLAGS, 'environment', 'yes'], + summary: 'Stop a managed Orca server and unlink it from this computer (decommission)', + usage: 'orca server stop --server --yes [--json]', + allowedFlags: [...LOCAL_COMMAND_FLAGS, 'server', 'yes'], notes: [ - 'Stops orcad on the SSH host and, once the host proves it exited, removes the server from this machine and disconnects the host. Its terminals end. Connecting the host again sets up a new server. Requires --yes.', - 'If the host cannot prove orcad exited, the server stays linked and the refusal says why; nothing is removed on a guess. For a host that is gone for good, use `orca environment forget`.', - 'If this server is the default host for new projects, choose another one first. `orca environment cancel-stop` withdraws a stop orcad has not acted on yet.', + 'Stops orcad on the SSH host and, once the host proves it exited, removes the server from this computer and disconnects the host. Its terminals end. Connecting the host again sets up a new server. Requires --yes.', + 'If the host cannot prove orcad exited, the server stays linked and the refusal says why; nothing is removed on a guess. For a host that is gone for good, use `orca server forget`.', + 'If this server is the default host for new projects, choose another one first. `orca server cancel-stop` withdraws a stop orcad has not acted on yet.', SELECTOR_NOTE, DESKTOP_NOTE ], - examples: ['orca environment stop --environment build-box --yes'] + examples: ['orca server stop --server build-box --yes'] }, { - path: ['environment', 'forget'], + path: ['server', 'forget'], + legacyAliases: [['environment', 'forget']], destructive: true, summary: 'Unlink a managed Orca server whose SSH host is gone, without stopping it', - usage: 'orca environment forget --environment --yes [--json]', - allowedFlags: [...LOCAL_COMMAND_FLAGS, 'environment', 'yes'], + usage: 'orca server forget --server --yes [--json]', + allowedFlags: [...LOCAL_COMMAND_FLAGS, 'server', 'yes'], notes: [ - 'Removes the server from this machine without contacting its host, so the SSH host can then be removed. Use it when the host was deleted or can never be reached again. Requires --yes.', + 'Removes the server from this computer without contacting its host, so the SSH host can then be removed. Use it when the host was deleted or can never be reached again. Requires --yes.', 'Nothing on the host is stopped: if it comes back, orcad may still be running there.', 'The SSH host is left disconnected, since no Orca server serves it any more. Connecting it again (Connect in Orca) sets its server up again, relinking one still running there.', SELECTOR_NOTE, DESKTOP_NOTE ], - examples: ['orca environment forget --environment build-box --yes'] + examples: ['orca server forget --server build-box --yes'] }, { - path: ['environment', 'cancel-stop'], + path: ['server', 'cancel-stop'], + legacyAliases: [['environment', 'cancel-stop']], summary: 'Withdraw a managed Orca server stop that orcad has not acted on yet', - usage: 'orca environment cancel-stop --environment [--json]', - allowedFlags: [...LOCAL_COMMAND_FLAGS, 'environment'], + usage: 'orca server cancel-stop --server [--json]', + allowedFlags: [...LOCAL_COMMAND_FLAGS, 'server'], notes: [SELECTOR_NOTE, DESKTOP_NOTE] } ] diff --git a/src/cli/specs/orchestration-worker-specs.ts b/src/cli/specs/orchestration-worker-specs.ts index b4f7dfc12f5..87126f04a2c 100644 --- a/src/cli/specs/orchestration-worker-specs.ts +++ b/src/cli/specs/orchestration-worker-specs.ts @@ -5,7 +5,7 @@ export const ORCHESTRATION_WORKER_COMMAND_SPECS: CommandSpec[] = [ path: ['orchestration', 'worker-start'], summary: 'Start one supervised worker on the Run home or a connected Orca server', usage: - 'orca orchestration worker-start (--task | --spec | --spec-file ) [--keep-open] [--on ] [--worktree ] (--agent | --terminal ) [--task-title ] [--deps ] [--parent ] [--model ] [--effort ] [--name ] [--repo ] [--base-branch ] [--display-name ] [--comment ] [--setup ] [--retry-of ] [--timeout-ms ] [--run ] [--from ] [--retry-request ] [--json]', + 'orca orchestration worker-start (--task | --spec | --spec-file ) [--keep-open] [--on ] [--worktree ] (--agent | --terminal ) [--task-title ] [--deps ] [--parent ] [--model ] [--effort ] [--name ] [--repo ] [--base-branch ] [--display-name ] [--comment ] [--setup ] [--retry-of ] [--timeout-ms ] [--run ] [--from ] [--retry-request ] [--json]', allowedFlags: [ ...GLOBAL_FLAGS, 'task', diff --git a/src/cli/specs/plugin-install.ts b/src/cli/specs/plugin-install.ts index 20303089b80..87ea918e0a3 100644 --- a/src/cli/specs/plugin-install.ts +++ b/src/cli/specs/plugin-install.ts @@ -8,7 +8,7 @@ const SOURCE_NOTE = 'Sources: a catalog id (publisher.id), owner/repo[@ref] on GitHub, any https:// or ssh:// Git URL or git@host:owner/repo.git, a GitHub or GitLab release, tag or tree page URL, or a folder path. Without a version Orca installs the newest version tag (vX.Y.Z), else the default branch, always pinned to the exact commit.' const PRIVATE_NOTE = - "Git runs on the Orca host with that host's own credentials (credential helper such as `gh auth setup-git`, Git Credential Manager or osxkeychain, or the SSH agent) and never prompts. A repository it cannot read fails with git_auth_failed, which names the host and how to sign Git in there. URLs carrying a username or token are refused." + "Git runs on the Orca server with that host's own credentials (credential helper such as `gh auth setup-git`, Git Credential Manager or osxkeychain, or the SSH agent) and never prompts. A repository it cannot read fails with git_auth_failed, which names the host and how to sign Git in there. URLs carrying a username or token are refused." const APPROVE_NOTE = 'Content-only plugins (themes, icons, syntaxes, translations) install and enable without approval. Anything that runs code or acts in Orca fails with approval_required before anything is written; it lists what it would be granted, why, the publisher and repository, and the exact command to re-run with --approve , which is bound to that plugin, version, files and access.' @@ -26,7 +26,7 @@ export const PLUGIN_INSTALL_COMMAND_SPECS: CommandSpec[] = [ PRIVATE_NOTE, APPROVE_NOTE, 'Plugins not from Orca’s official catalog also show their publisher (the repository owner) and source repository, so your user can decide whether to trust them.', - '--catalog picks the catalog when more than one lists the id. A folder path is on the Orca host; with --environment pass it absolute.', + '--catalog picks the catalog when more than one lists the id. A folder path is on the Orca server; with --server pass it absolute.', EXIT_CODES_NOTE ], examples: [ @@ -69,7 +69,7 @@ export const PLUGIN_INSTALL_COMMAND_SPECS: CommandSpec[] = [ }, { path: ['plugin', 'catalog', 'list'], - summary: 'List the plugin catalogs on the Orca host', + summary: 'List the plugin catalogs on the Orca server', usage: 'orca plugin catalog list [--json]', allowedFlags: [...GLOBAL_FLAGS], notes: [ @@ -86,7 +86,7 @@ export const PLUGIN_INSTALL_COMMAND_SPECS: CommandSpec[] = [ positionalArgs: ['source'], notes: [ 'A catalog decides which repositories Orca installs and auto-updates plugins from, so adding one fails with approval_required until re-run with --approve for that exact URL and branch. Adding one that is already there only refreshes it.', - '--ref defaults to main. Private catalogs use the Orca host’s Git credentials like installs do.', + '--ref defaults to main. Private catalogs use the Orca server’s Git credentials like installs do.', EXIT_CODES_NOTE ], examples: [ diff --git a/src/cli/specs/plugin-view.ts b/src/cli/specs/plugin-view.ts index ce6c2f8c54c..57b3728e7c4 100644 --- a/src/cli/specs/plugin-view.ts +++ b/src/cli/specs/plugin-view.ts @@ -13,7 +13,7 @@ export const PLUGIN_VIEW_COMMAND_SPECS: CommandSpec[] = [ "Without --panel it shows the plugin's first panel, opening the right sidebar if it is closed. --editor opens the file in the plugin's first custom editor that takes it, in the workspace that holds the file (its real path counts, so /tmp and /private/tmp match); when none does, Orca opens the file's folder as a folder workspace and opens it there.", 'Changes only what Orca shows: it never brings the window forward or takes focus. It leaves Settings for the workspace behind it; for a panel, other full-page views and a window with no workspace fail with no_workspace.', 'The plugin must be running or idle (approved and enabled); a pending plugin fails and says how to approve it.', - 'Desktop app only: a server with no window (`orca serve`) refuses it. With --environment, --editor takes an absolute path on that host.', + 'Desktop app only: a server with no window (`orca serve`) refuses it. With --server, --editor takes an absolute path on that host.', 'Use it to show your user the panel you just built; `orca plugin shot` captures it for you.' ], examples: [ @@ -49,10 +49,10 @@ export const PLUGIN_VIEW_COMMAND_SPECS: CommandSpec[] = [ '--width sets the panel width for this capture only. --theme paints Orca light or dark for this capture only, and only while its window is hidden or minimized, then puts your theme back; the setting never changes. With the window on screen it captures in the current theme rather than repaint the app in front of you. The result says which theme it shows, whether --theme took effect (themeApplied) and why not (themeReason).', '--act runs input on a components panel before the capture, in the test kit\'s words: a JSON list (at most 20) of {"press":Q}, {"type":Q,"text":"…","replace"?:true,"submit"?:true}, {"select":Q,"value":"…"}, {"toggle":Q}, {"slide":Q,"value":n}, and for a Table {"sort":Q,"column":"…"}, {"selectRows":Q,"keys":[…]}, {"activateRow":Q,"key":"…"}, {"loadMore":Q}, for a Tree {"expand"|"collapse"|"selectItem"|"activateItem":Q,"key":"…"}, where Q matches like the kit\'s queries ({"text"|"label"|"testId"|"type"|"role":"…"}). Each act goes through Orca\'s own control and waits for the panel to redraw and its host calls to answer. After the capture Orca puts the panel\'s atoms back (persisted ones included, so neither later shots nor the user keep the acted state); what handlers did elsewhere stays, such as a plugin.request that changed the worker\'s storage. It acts only on this panel and only while Orca\'s window is hidden or minimized; html panels refuse it. Acts are not a person\'s input: a Link\'s href stays unopened and gesture-only calls (shell.openExternal, files.saveAs) are refused. The first failed act stops the rest; the PNG shows the panel at that point and the command exits 1.', '--json prints { path, width, height, theme, themeApplied, themeReason?, settled, errors, pendingRequests?, actions?, restored? }; pendingRequests counts host calls still unanswered at the capture (components panels), actions has one { ok, error? } per act, and restored is false when the panel reloaded during --act so its acted state stayed. errors lists the error banner the panel shows and the errors it logged (`orca plugin logs`) during the capture; settled is false when it had not finished drawing after 15s.', - "--scenario shoots the panel in one scenario of its `.check.ts` instead of the live panel. Not sandboxed: like `orca plugin check` it runs the plugin's code (panel and worker) on this machine with your user's full access, against a stand-in host, so the scenario's data never reaches the plugin's real panel, storage, settings or worker; then the Orca on this machine draws what it rendered apart from the plugin (the right sidebar is not opened or switched) and captures it. It takes a plugin folder, or the key of a development plugin when run inside its folder; installed plugins are refused. A replay is a still frame: host-owned control values start from the tree's props, images show their placeholder, it has no --act, and it is local only (no --environment). It needs Orca's window hidden or minimized, since the preview is drawn inside it; --theme then always applies. Writes .orca/shots/-..png in the plugin folder unless --out names a file; --json adds replay: true, scenario and notes, and errors lists what the render reported. An unknown name fails and lists the scenarios.", + "--scenario shoots the panel in one scenario of its `.check.ts` instead of the live panel. Not sandboxed: like `orca plugin check` it runs the plugin's code (panel and worker) on this machine with your user's full access, against a stand-in host, so the scenario's data never reaches the plugin's real panel, storage, settings or worker; then the Orca on this machine draws what it rendered apart from the plugin (the right sidebar is not opened or switched) and captures it. It takes a plugin folder, or the key of a development plugin when run inside its folder; installed plugins are refused. A replay is a still frame: host-owned control values start from the tree's props, images show their placeholder, it has no --act, and it is local only (no --server). It needs Orca's window hidden or minimized, since the preview is drawn inside it; --theme then always applies. Writes .orca/shots/-..png in the plugin folder unless --out names a file; --json adds replay: true, scenario and notes, and errors lists what the render reported. An unknown name fails and lists the scenarios.", 'With --editor it shoots the plugin\'s custom editor instead: it opens the file like `orca plugin open --editor` (a folder or a key works as the first argument), waits for the editor to get its document and ask for it (`orca.document.get` or `onDidChange`) and paint, then captures exactly the editor, hidden window included. --width/--height size the editor for this capture only; --theme works as for panels and is put back after. --act there is real input to the editor in its own CSS pixels from its top-left: a JSON list (at most 20) of {"click":[x,y]}, {"drag":[[x1,y1],[x2,y2]]} and {"key":"r","modifiers"?:["shift"|"control"|"alt"|"meta"]}, each painted before the next; it needs the window hidden or minimized. A shot never changes your file: with --act it shoots a copy in a temporary folder workspace that it removes afterwards, unless --in-place acts on the file itself (edits then reach its buffer like typing, and its tab stays open with them; end --act with {"key":"s","modifiers":["meta"]}, "control" off macOS, to save them to disk). Without --act it opens the file itself, leaves its buffer alone and closes the tab if the shot opened it. Writes .orca/shots/-.png unless --out names a file. The PNG is written either way, but the command exits 1 and prints the errors when the editor threw, was blocked by its content policy (both from `orca plugin logs`), or never asked for its document within 5s. Orca\'s previous workspace is shown again afterwards.', "--status-bar captures Orca's status bar, where a plugin's status bar items draw, and --window the whole window; both from the hidden window like a panel shot, never showing or focusing it. They take --theme (put back after) and --out, and write .orca/shots/-status-bar.png or -window.png. The plugin must be running; errors lists what it logged during the capture. On Linux an html panel's guest may show blank in a --window shot; use a panel shot for it.", - 'Desktop app only: a server with no window (`orca serve`) refuses it. With --environment the PNG (at most 5 MiB; it shows only the plugin panel) comes back to this machine and is written here.' + 'Desktop app only: a server with no window (`orca serve`) refuses it. With --server the PNG (at most 5 MiB; it shows only the plugin panel) comes back to this machine and is written here.' ], examples: [ 'orca plugin shot acme.todos', diff --git a/src/cli/specs/plugin.ts b/src/cli/specs/plugin.ts index 838c1c87500..13c9d0ed30b 100644 --- a/src/cli/specs/plugin.ts +++ b/src/cli/specs/plugin.ts @@ -126,7 +126,7 @@ const APPROVE_NOTE = export const PLUGIN_RUNTIME_COMMAND_SPECS: CommandSpec[] = [ { path: ['plugin', 'list'], - summary: 'List plugins on the Orca host with their status and access level', + summary: 'List plugins on the Orca server with their status and access level', usage: 'orca plugin list [--json]', allowedFlags: [...GLOBAL_FLAGS], notes: [ @@ -167,18 +167,18 @@ export const PLUGIN_RUNTIME_COMMAND_SPECS: CommandSpec[] = [ }, { path: ['plugin', 'system', 'on'], - summary: 'Turn plugins on for the Orca host', + summary: 'Turn plugins on for the Orca server', usage: 'orca plugin system on [--json]', allowedFlags: [...GLOBAL_FLAGS], notes: [ - 'The same switch as "Turn on plugins" in Settings → Plugins, for a host with no window such as `orca serve`.', + 'The same switch as "Turn on plugins" in Settings → Plugins, for a server with no window such as `orca serve`.', 'Approves nothing: only plugins approved earlier start; anything else still needs its own --approve.' ], - examples: ['orca plugin system on', 'orca plugin system on --environment build-box --json'] + examples: ['orca plugin system on', 'orca plugin system on --server build-box --json'] }, { path: ['plugin', 'system', 'off'], - summary: 'Turn plugins off for the Orca host', + summary: 'Turn plugins off for the Orca server', usage: 'orca plugin system off [--json]', allowedFlags: [...GLOBAL_FLAGS], notes: [ @@ -215,7 +215,7 @@ export const PLUGIN_RUNTIME_COMMAND_SPECS: CommandSpec[] = [ '--shot opens one panel in the right sidebar once (the first, or --shot-panel ; an unknown id fails at start), then after the load and each reload that leaves the plugin running saves a PNG of it, like `orca plugin shot`, to /-.png (overwritten; a `shot` event). It never switches the sidebar again: while you show another tab or close the sidebar it skips, with one `shot_skipped` event per time away, and resumes when the panel is back. With --check, the check runs first. Needs the Orca desktop app.', '--json prints one JSON object per line: `loaded`, `log`, `reloaded`, `status`, `approval`, `check`, `shot`, `shot_skipped`, `warning`, `disconnected`, `unloaded` (field `type`). A failed first load prints the usual error envelope instead, on one line.', APPROVE_NOTE, - 'With --environment the folder is a path on that Orca server; pass it absolute.', + 'With --server the folder is a path on that Orca server; pass it absolute.', EXIT_CODES_NOTE ], examples: [ @@ -232,12 +232,12 @@ export const PLUGIN_RUNTIME_COMMAND_SPECS: CommandSpec[] = [ allowedFlags: [...GLOBAL_FLAGS, 'dir', 'approve'], positionalArgs: ['dir'], notes: [ - 'Adds the folder to Settings → Plugins → Development folders on the Orca host; it overrides an installed plugin with the same key.', + 'Adds the folder to Settings → Plugins → Development folders on the Orca server; it overrides an installed plugin with the same key.', 'Orca reloads the plugin when its files change. For an approved panel, editor or worker, later code edits run without asking again; new access does not.', '.ts, .tsx, .mts and .jsx files load without a build step. When the folder uses them (or components panels) and is on this machine, this also refreshes its .orca/types typings, like `orca plugin types`.', APPROVE_NOTE, 'Without approval the folder stays loaded but nothing in it runs.', - 'With --environment the folder is a path on that Orca server; pass it absolute.', + 'With --server the folder is a path on that Orca server; pass it absolute.', EXIT_CODES_NOTE ], examples: ['orca plugin dev load ./dusk-theme', 'orca plugin dev load ./notes-editor --json'] diff --git a/src/cli/specs/project.ts b/src/cli/specs/project.ts index 1f7d989b8ba..61c6fdc9809 100644 --- a/src/cli/specs/project.ts +++ b/src/cli/specs/project.ts @@ -12,43 +12,39 @@ export const PROJECT_COMMAND_SPECS: CommandSpec[] = [ { path: ['project', 'setups'], summary: 'List project host setups', - usage: 'orca project setups [--project ] [--host ] [--json]', + usage: 'orca project setups [--project ] [--json]', allowedFlags: [...GLOBAL_FLAGS, 'project', 'host'], notes: [ - 'A setup means a project is available on a host at a concrete filesystem path.', - '--host runtime: runs the command on that paired Orca server instead of filtering this runtime; unknown environment ids are rejected rather than answered with an empty list.', - 'Run `orca environment list` to see the environment ids that runtime: accepts. It matches ids only, never environment names.', - "A routed --host runtime: also lists that server's own local-stamped setups, because both spellings name the machine the command reached." + 'A setup means a project is available on a server at a concrete filesystem path. Each row names the server that owns it; server=unknown means Orca cannot verify the owner from here.', + 'To list another server\u2019s setups, pass --server .' ], examples: [ 'orca project setups', 'orca project setups --project github:stablyai/orca', - 'orca project setups --host local', - 'orca project setups --host runtime:03ef704c-b180-4b10-998d-e28fbd5de9a3' + 'orca project setups --server build-box' ] }, { path: ['project', 'setup-existing-folder'], - summary: 'Make a project available on a host by importing an existing folder', + summary: 'Make a project available on a server by importing an existing folder', usage: - 'orca project setup-existing-folder --project --host --path [--kind git|folder] [--display-name ] [--json]', + 'orca project setup-existing-folder --project --path [--kind git|folder] [--display-name ] [--json]', allowedFlags: [...GLOBAL_FLAGS, 'project', 'host', 'path', 'kind', 'display-name'], notes: [ - 'For remote runtimes, --path must be an absolute path on the remote server.', - '--host takes local, ssh:, runtime:, or the bare host name `orca host list` prints for any of them.', - 'SSH targets are set up through the desktop UI because the desktop client owns SSH connections.', + 'The folder is on the server the command runs on: this computer, or the one --server names. With --server, --path must be an absolute path on that server.', + 'SSH connections are set up through the desktop UI because the desktop client owns SSH connections.', "--project takes a project id or an existing project's name. A remote-backed Git folder's project id usually comes from its remote: github:owner/repo, github:/owner/repo for GitHub Enterprise, or git:/ for other remotes." ], examples: [ - 'orca project setup-existing-folder --project github:stablyai/orca --host local --path ~/orca', - 'orca project setup-existing-folder --project github:stablyai/orca --host runtime:03ef704c-b180-4b10-998d-e28fbd5de9a3 --path /home/me/orca --kind git --json' + 'orca project setup-existing-folder --project github:stablyai/orca --path ~/orca', + 'orca project setup-existing-folder --project github:stablyai/orca --server build-box --path /home/me/orca --kind git --json' ] }, { path: ['project', 'setup-clone'], - summary: 'Make a project available on a host by cloning a repository', + summary: 'Make a project available on a server by cloning a repository', usage: - 'orca project setup-clone --project --host --url --destination [--folder-name ] [--display-name ] [--json]', + 'orca project setup-clone --project --url --destination [--folder-name ] [--display-name ] [--json]', allowedFlags: [ ...GLOBAL_FLAGS, 'project', @@ -59,21 +55,20 @@ export const PROJECT_COMMAND_SPECS: CommandSpec[] = [ 'display-name' ], notes: [ - 'For remote runtimes, --destination must be an absolute parent directory on the remote server.', + 'The clone is made on the server the command runs on. With --server, --destination must be an absolute parent directory on that server.', '--folder-name sets the folder created inside --destination; it defaults to the repository name from the URL.', - '--host takes local, ssh:, runtime:, or the bare host name `orca host list` prints for any of them.', - 'SSH targets are cloned through the desktop UI because the desktop client owns SSH connections.' + 'SSH connections are cloned through the desktop UI because the desktop client owns SSH connections.' ], examples: [ - 'orca project setup-clone --project github:stablyai/orca --host local --url https://github.com/stablyai/orca.git --destination ~/src', - 'orca project setup-clone --project github:stablyai/orca --host runtime:03ef704c-b180-4b10-998d-e28fbd5de9a3 --url https://github.com/stablyai/orca.git --destination /srv --json' + 'orca project setup-clone --project github:stablyai/orca --url https://github.com/stablyai/orca.git --destination ~/src', + 'orca project setup-clone --project github:stablyai/orca --server build-box --url https://github.com/stablyai/orca.git --destination /srv --json' ] }, { path: ['project', 'setup-create'], summary: 'Create independent project host setup metadata', usage: - 'orca project setup-create --project --host [--setup-id ] [--path ] [--kind git|folder] [--display-name ] [--worktree-base-path ] [--git-username ] [--state ready|not-set-up|setting-up|error|unsupported] [--method imported-existing-folder|cloned|provisioned] [--json]', + 'orca project setup-create --project [--setup-id ] [--path ] [--kind git|folder] [--display-name ] [--worktree-base-path ] [--git-username ] [--state ready|not-set-up|setting-up|error|unsupported] [--method imported-existing-folder|cloned|provisioned] [--json]', allowedFlags: [ ...GLOBAL_FLAGS, 'project', @@ -89,18 +84,18 @@ export const PROJECT_COMMAND_SPECS: CommandSpec[] = [ ], notes: [ 'Creates setup metadata without registering a repo compatibility record.', - '--host takes local, ssh:, runtime:, or the bare host name `orca host list` prints for any of them.', + 'The setup is recorded on the server the command runs on: this computer, or the one --server names.', 'Use setup-existing-folder when Orca should import and manage an actual checkout path now.' ], examples: [ - 'orca project setup-create --project github:stablyai/orca --host runtime:03ef704c-b180-4b10-998d-e28fbd5de9a3 --state setting-up --method provisioned --json' + 'orca project setup-create --project github:stablyai/orca --server build-box --state setting-up --method provisioned --json' ] }, { path: ['project', 'setup-update'], summary: 'Update project host setup metadata', usage: - 'orca project setup-update --setup [--host ] [--display-name ] [--path ] [--worktree-base-path ] [--git-username ] [--kind git|folder] [--state ready|not-set-up|setting-up|error|unsupported] [--method legacy-repo|imported-existing-folder|cloned|provisioned] [--json]', + 'orca project setup-update --setup [--display-name ] [--path ] [--worktree-base-path ] [--git-username ] [--kind git|folder] [--state ready|not-set-up|setting-up|error|unsupported] [--method legacy-repo|imported-existing-folder|cloned|provisioned] [--json]', allowedFlags: [ ...GLOBAL_FLAGS, 'setup', @@ -115,7 +110,6 @@ export const PROJECT_COMMAND_SPECS: CommandSpec[] = [ ], notes: [ 'Repo-backed setups mirror safe fields onto the repo record.', - '--host picks the setup when the project is set up on more than one host under the same setup id.', 'Path and availability state changes are only supported for independent setup records.' ], examples: [ @@ -127,7 +121,7 @@ export const PROJECT_COMMAND_SPECS: CommandSpec[] = [ path: ['project', 'setup-delete'], destructive: true, summary: 'Remove a project host setup', - usage: 'orca project setup-delete --setup [--host ] [--force] [--json]', + usage: 'orca project setup-delete --setup [--force] [--json]', allowedFlags: [...GLOBAL_FLAGS, 'setup', 'host', 'force'], notes: [ 'Independent setups are removed directly.', diff --git a/src/cli/specs/repo.ts b/src/cli/specs/repo.ts index 6d974225dc3..c48769fa9b6 100644 --- a/src/cli/specs/repo.ts +++ b/src/cli/specs/repo.ts @@ -15,7 +15,7 @@ export const REPO_COMMAND_SPECS: CommandSpec[] = [ allowedFlags: [...GLOBAL_FLAGS, 'path', 'kind'], notes: [ 'Defaults to git. Use --kind folder for an ordinary directory, including a parent of separate Git repositories; worktrees attached to a folder workspace appear in its Source Control panel, one section each.', - 'With --environment, --path must be an absolute path on that Orca server.' + 'With --server, --path must be an absolute path on that Orca server.' ], examples: ['orca repo add --path /abs/path/to/folder --kind folder --json'] }, diff --git a/src/cli/specs/search.ts b/src/cli/specs/search.ts index 36d8a3a0e5d..e7e1f74abfc 100644 --- a/src/cli/specs/search.ts +++ b/src/cli/specs/search.ts @@ -4,7 +4,7 @@ import { GLOBAL_FLAGS, type CommandSpec } from '../args' export const SEARCH_COMMAND_SPECS: CommandSpec[] = [ { path: ['search'], - summary: 'Search the full text of agent sessions indexed on the selected Orca host', + summary: 'Search the full text of agent sessions indexed on the selected Orca server', usage: 'orca search [--scope conversation|all] [--fresh] [--limit ] [--cursor ] [--agent ] [--path

] [--since ] [--sort relevance|newest] [--debug] [--json]\n orca search --index-status [--json]', allowedFlags: [ @@ -24,16 +24,16 @@ export const SEARCH_COMMAND_SPECS: CommandSpec[] = [ repeatableFlags: ['agent', 'path'], positionalArgs: ['query'], notes: [ - 'Searches one host: this machine, or the paired Orca server named by --environment / --pairing-code. There is no all-computers search.', - 'In an Orca SSH terminal, the forwarded CLI searches the controlling Orca runtime by default. Use --environment / --pairing-code to select a paired server; --path only filters results on the selected runtime.', + 'Searches one server: the Orca on this computer, or the server named by --server / --pairing-code. There is no all-servers search.', + 'In an Orca SSH terminal, the forwarded CLI searches the controlling Orca server by default. Use --server / --pairing-code to select another server; --path only filters results on the selected runtime.', 'Quote a multi-word query, or pass it as --query ""; unquoted words are read as command names.', '--scope conversation and --scope all (the default) search user and assistant turns; tool output is excluded.', - '--fresh waits up to five seconds for the host to reconcile its index before searching, then searches anyway.', - '--agent and --path may be repeated. --path is a literal execution-host path and is not expanded or resolved against the current directory.', + '--fresh waits up to five seconds for the server to reconcile its index before searching, then searches anyway.', + '--agent and --path may be repeated. --path is a literal path on the server and is not expanded or resolved against the current directory.', '--since takes an ISO 8601 timestamp with an offset, for example 2026-08-01T00:00:00Z.', '--limit is per page (default 20, maximum 100). Pass the printed cursor back with --cursor to read the next page.', - 'A cursor belongs to one query on one host. Change the query, the filters, or the host and the cursor stops being valid.', - 'Resume commands and source paths are printed only for a host on this machine; a paired server withholds them.', + 'A cursor belongs to one query on one server. Change the query, the filters, or the server and the cursor stops being valid.', + 'Resume commands and source paths are printed only for the Orca on this computer; another server withholds them.', '--json prints the runtime response envelope with the search contract answer under `result`.' ], examples: [ @@ -42,7 +42,7 @@ export const SEARCH_COMMAND_SPECS: CommandSpec[] = [ 'orca search "kernel panic" --path /Users/me/orca --since 2026-08-01T00:00:00Z --json', 'orca search "kernel panic" --limit 50 --cursor eyJ2IjoxfQ', 'orca search --index-status', - 'orca search "flaky test" --environment build-server' + 'orca search "flaky test" --server build-server' ] } ] diff --git a/src/cli/specs/serve.ts b/src/cli/specs/serve.ts index 3bc6b770259..80777ae3e0f 100644 --- a/src/cli/specs/serve.ts +++ b/src/cli/specs/serve.ts @@ -4,7 +4,7 @@ import { LOCAL_COMMAND_FLAGS } from '../args' export const SERVE_COMMAND_SPECS: CommandSpec[] = [ { path: ['serve'], - summary: 'Start an Orca runtime server without opening a desktop window', + summary: 'Start an Orca server without opening a desktop window', usage: 'orca serve [--port ] [--bind ] [--pairing-address ] [--allow-public | --refuse-public] [--mobile-pairing] [--no-pairing] [--grant-desktop-control] [--project-root ] [--recipe-json] [--supervise] [--force] [--reclaim-stale-lock [--data-root

] [--yes]] [--json]', allowedFlags: [ @@ -32,7 +32,7 @@ export const SERVE_COMMAND_SPECS: CommandSpec[] = [ '--bind controls the interface the runtime listens on; it accepts a literal IP such as 127.0.0.1, a Tailscale address, or 0.0.0.0. --mobile-pairing needs no --bind or --bind 0.0.0.0.', 'Serve accepts clients from localhost, LAN (10/8, 172.16/12, 192.168/16, link-local, fc00::/7) and Tailscale (100.64/10, fd7a:115c:a1e0::/48) addresses. Public addresses are also accepted with --allow-public, when --pairing-address is a hostname or public IP, once a paired device has connected from one, or while devices paired before this check existed remain paired. Addresses inside a network prefix of one of this host interfaces (for example same-network global IPv6) count as LAN. --refuse-public refuses public addresses in every case and cannot be combined with --allow-public. The startup log states which applies.', 'Use --recipe-json with --project-root from VM recipes to print the recipe result JSON and leave the server running.', - 'Use --mobile-pairing to print a mobile-scoped pairing QR/link instead of the default runtime-environment pairing link. To pair later without restarting, run `orca pair`.', + 'Use --mobile-pairing to print a mobile-scoped pairing QR/link instead of the default server pairing link. To pair later without restarting, run `orca pair`.', 'On a packaged macOS app serve runs Electron, which needs a desktop login; over SSH with nobody logged in, set ORCA_SERVE_RUNTIME=orcad to run the Node server instead (it has no in-app updater).', "A paired client cannot drive this machine's desktop (orca computer) unless the offer was created with --grant-desktop-control.", 'When the web client bundle is available, the server also prints a browser URL with the pairing data embedded.', diff --git a/src/cli/specs/skills.ts b/src/cli/specs/skills.ts index b9afef401f2..24239147531 100644 --- a/src/cli/specs/skills.ts +++ b/src/cli/specs/skills.ts @@ -38,7 +38,7 @@ export const SKILL_COMMAND_SPECS: CommandSpec[] = [ usage: 'orca skills list [--json]', allowedFlags: [...GLOBAL_FLAGS], notes: [ - 'Reads bundled guide metadata locally without contacting the Orca runtime.', + 'Reads bundled guide metadata locally without contacting an Orca server.', 'With --json, prints a topics array of canonical names and one-line descriptions.', 'Use `orca skills get ` for the compact guide, `--full` for its full reference package, or `orca skills install` to install skills.' ] @@ -51,7 +51,7 @@ export const SKILL_COMMAND_SPECS: CommandSpec[] = [ allowedFlags: [...GLOBAL_FLAGS, 'topic', 'full', 'reference', 'references'], positionalArgs: ['topic'], notes: [ - 'Reads bundled guide content locally without contacting the Orca runtime.', + 'Reads bundled guide content locally without contacting an Orca server.', 'Prints the compact guide by default. Use --full to print the full guide with bundled references when provided.', 'Use --reference to print one bundled reference alone, which is what an action gate in the compact guide needs; --references lists the available names.', 'A reference name may be given bare (recovery-and-cleanup) or as the guide spells it (references/recovery-and-cleanup.md).', @@ -72,7 +72,7 @@ export const SKILL_COMMAND_SPECS: CommandSpec[] = [ '[--local] [--force] [--dry-run] [--json]', allowedFlags: [...GLOBAL_FLAGS, 'skill', 'all', 'agent', 'local', 'force', 'dry-run'], notes: [ - 'Reads the bundled skill registry locally without contacting the Orca runtime, ' + + 'Reads the bundled skill registry locally without contacting an Orca server, ' + 'and needs no network, Node, Git or npx.', 'Writes the copy this Orca build ships into the shared .agents/skills folder and ' + 'links it into each detected agent\u2019s skills folder, the same way the app\u2019s ' + diff --git a/src/cli/specs/speech.ts b/src/cli/specs/speech.ts index 98915568458..ab2b9abb37d 100644 --- a/src/cli/specs/speech.ts +++ b/src/cli/specs/speech.ts @@ -4,19 +4,19 @@ import { GLOBAL_FLAGS } from '../args' export const SPEECH_COMMAND_SPECS: CommandSpec[] = [ { path: ['speech', 'openai-key', 'status'], - summary: 'Show whether this host has an OpenAI key for cloud voice dictation', + summary: 'Show whether this server has an OpenAI key for cloud voice dictation', usage: 'orca speech openai-key status [--json]', allowedFlags: [...GLOBAL_FLAGS], examples: ['orca speech openai-key status --json'] }, { path: ['speech', 'openai-key', 'set'], - summary: 'Save the OpenAI key cloud voice dictation uses on this host, read from stdin', + summary: 'Save the OpenAI key cloud voice dictation uses on this server, read from stdin', usage: 'orca speech openai-key set [--json] < key-file', allowedFlags: [...GLOBAL_FLAGS], notes: [ 'Reads the key from stdin so it never lands in shell history or a process list.', - 'The host that runs dictation seals it, so a headless `orca serve` host can use it.' + 'The server that runs dictation seals it, so a headless `orca serve` server can use it.' ], examples: [ 'printf %s "$OPENAI_API_KEY" | orca speech openai-key set', @@ -25,7 +25,7 @@ export const SPEECH_COMMAND_SPECS: CommandSpec[] = [ }, { path: ['speech', 'openai-key', 'clear'], - summary: 'Remove the OpenAI key cloud voice dictation uses on this host', + summary: 'Remove the OpenAI key cloud voice dictation uses on this server', usage: 'orca speech openai-key clear [--json]', allowedFlags: [...GLOBAL_FLAGS], examples: ['orca speech openai-key clear'] diff --git a/src/cli/specs/terminal-daemon.ts b/src/cli/specs/terminal-daemon.ts index cea526b9d87..3701c3505c4 100644 --- a/src/cli/specs/terminal-daemon.ts +++ b/src/cli/specs/terminal-daemon.ts @@ -23,7 +23,7 @@ export const TERMINAL_DAEMON_COMMAND_SPECS: CommandSpec[] = [ allowedFlags: [...GLOBAL_FLAGS, 'yes'], notes: [ 'Restarting ENDS every process running in its terminals. Agents that support resume can be resumed afterwards; shells and other jobs must be started again.', - 'The host re-checks that the daemon is still the one reported by status before stopping it, and refuses otherwise.' + 'Orca re-checks that the daemon is still the one reported by status before stopping it, and refuses otherwise.' ], examples: ['orca terminal-daemon restart --yes'] } diff --git a/src/cli/specs/worktree-create.ts b/src/cli/specs/worktree-create.ts index 743f4b68504..11f9427a222 100644 --- a/src/cli/specs/worktree-create.ts +++ b/src/cli/specs/worktree-create.ts @@ -6,7 +6,7 @@ export const WORKTREE_CREATE_COMMAND_SPEC: CommandSpec = { repeatableFlags: ['reference'], summary: 'Create a new Orca-managed worktree', usage: - 'orca worktree create --name [--repo |--project [--host ]|--project-host-setup ] [--agent ] [--prompt ] [--model ] [--effort ] [--surface chat|terminal] [--setup run|skip|inherit] [--base-branch ] [--branch ] [--reference ...] [--reference-site ] [--issue ] [--pr ] [--linear-issue ] [--gitlab-issue ] [--gitlab-mr ] [--comment ] [--parent-worktree [--parent-environment ]] [--no-parent] [--run-hooks] [--activate] [--retry-launch ] [--json]', + 'orca worktree create --name [--repo |--project |--project-host-setup ] [--agent ] [--prompt ] [--model ] [--effort ] [--surface chat|terminal] [--setup run|skip|inherit] [--base-branch ] [--branch ] [--reference ...] [--reference-site ] [--issue ] [--pr ] [--linear-issue ] [--gitlab-issue ] [--gitlab-mr ] [--comment ] [--parent-worktree [--parent-server ]] [--no-parent] [--run-hooks] [--activate] [--retry-launch ] [--json]', allowedFlags: [ ...GLOBAL_FLAGS, 'repo', @@ -32,7 +32,7 @@ export const WORKTREE_CREATE_COMMAND_SPEC: CommandSpec = { 'comment', 'setup', 'parent-worktree', - 'parent-environment', + 'parent-server', 'no-parent', 'run-hooks', 'activate' @@ -43,17 +43,16 @@ export const WORKTREE_CREATE_COMMAND_SPEC: CommandSpec = { 'By default, Orca records the new worktree as a child of the caller context when it can infer one from the Orca terminal or current directory.', 'If --repo is omitted, Orca infers the repo from the current Orca-managed worktree.', 'Use --project to create on a ready project host setup without spelling the backing repo id. --project takes the project id or the display name from `orca project list`.', - '--host is only needed when the project is set up on more than one host; with a single setup Orca uses it. When it is ambiguous the error names every host the project is set up on.', - '--host takes local, ssh:, runtime:, or the bare host name `orca host list` prints for any of them.', + 'When the project has setups for more than one server here, pass --server to use that server\u2019s own setup; otherwise the error names each setup and the server that owns it.', 'For related work, use the inferred parent or pass --parent-worktree active, folder:, or worktree: to make the relationship explicit. Worktree ids are the full :: values returned by `orca worktree list --json`.', - "--parent-worktree is looked up in the new worktree's environment. For a parent in another environment, add --parent-environment with local or a saved environment id or name, such as a row's address.environment from `orca worktree ps --json`. No other environment is searched.", + "--parent-worktree is looked up on the new worktree's server. For a parent on another server, add --parent-server with local or a saved server's id or name, such as a row's address.server from `orca worktree ps --json`. No other server is searched.", 'Use --no-parent when the new worktree should be independent of the current context.', 'Pass --branch to name the Git branch without the configured prefix (a taken name gets a numeric suffix); --base-branch selects the starting ref instead.', '--no-parent only affects Orca lineage; omit --base-branch to use the repo default base, or pass the default base ref explicitly for independent top-level work.', 'By default this creates the worktree and its first terminal without switching the active Orca view.', 'Pass --agent to start an agent with the worktree, as a chat or a terminal per your Chat | CLI choice for that agent, exactly as a new agent tab does; --prompt sends initial work to it. --model and --effort pick its model and reasoning effort, and --surface chat|terminal picks chat or terminal for this launch instead of your setting.', - 'After a lost agent launch reply, re-issue the same command from the same directory on the same host with --retry-launch from the error. Never retry as a fresh launch; older hosts require inspecting the workspace first.', - 'With --agent --json, result.launch says what started: launch.outcome.kind (structured chat or terminal), launch.outcome.handle, and launch.receipt.detail for why. An Orca host older than this returns the terminal agent handle in result.agentTerminalHandle instead.', + 'After a lost agent launch reply, re-issue the same command from the same directory on the same server with --retry-launch from the error. Never retry as a fresh launch; older servers require inspecting the workspace first.', + 'With --agent --json, result.launch says what started: launch.outcome.kind (structured chat or terminal), launch.outcome.handle, and launch.receipt.detail for why. An Orca server older than this returns the terminal agent handle in result.agentTerminalHandle instead.', 'Repo-defined setup hooks follow the repository setup policy; pass --setup run to force them.', 'Pass --activate when the CLI caller intentionally wants to reveal the new worktree in the app.', 'Passing --run-hooks is kept as a legacy alias for --setup run and reveals the worktree.', @@ -63,12 +62,12 @@ export const WORKTREE_CREATE_COMMAND_SPEC: CommandSpec = { 'orca worktree create --name agent-task --agent codex --prompt "hi" --json', 'orca worktree create --name design --no-parent --agent codex --model gpt-6-astra --effort high --prompt "Write the design doc" --json', 'orca worktree create --repo id: --name related-task --json', - 'orca worktree create --project github:stablyai/orca --host runtime:03ef704c-b180-4b10-998d-e28fbd5de9a3 --name benchmark --json', + 'orca worktree create --project github:stablyai/orca --server build-box --name benchmark --json', 'orca worktree create --repo id: --name linear-task --linear-issue https://linear.app/stably/issue/STA-335/test-issue --json', 'orca worktree create --repo id: --name agent-task --agent codex --prompt "hi" --json', 'orca worktree create --repo id: --name folder-child --parent-worktree folder: --json', 'orca worktree create --repo id: --name related-task --parent-worktree active --json', - 'orca worktree create --environment --repo id: --name child --parent-environment local --parent-worktree folder: --json', + 'orca worktree create --server --repo id: --name child --parent-server local --parent-worktree folder: --json', 'orca worktree create --repo id: --name independent-task --no-parent --json' ] } diff --git a/src/cli/specs/worktree-listing-scope-notes.ts b/src/cli/specs/worktree-listing-scope-notes.ts index 85345cd52e3..14c982d2174 100644 --- a/src/cli/specs/worktree-listing-scope-notes.ts +++ b/src/cli/specs/worktree-listing-scope-notes.ts @@ -1,5 +1,5 @@ export const WORKTREE_LISTING_SCOPE_NOTES: readonly string[] = [ - 'Each row carries the execution host that owns it (`host=`), and the trailing `scope:` line names every host the page covers plus the ones it does not.', - 'A host named under `not covered` may still have workspaces; an empty answer for it is not evidence that it has none. A paired server is annotated with the `--environment` flag that reaches it; this machine and its SSH targets are reached through the same runtime, so no flag selects them.', - 'The row cap is shared across hosts, so a host whose rows sort last is not starved out of the page.' + 'Each row names the server that owns it (`server=` or the `server:` line); `server=unknown` means Orca cannot verify the owner from here and does not guess. The trailing `scope:` line names every host id the page covers plus the ones it does not.', + 'An id named under `not covered` may still have workspaces; an empty answer for it is not evidence that it has none. A saved server is annotated with the `--server` flag that reaches it; this computer and its SSH connections are reached through the answering server, so no flag selects them.', + 'The row cap is shared across hosts, so rows that sort last are not starved out of the page.' ] diff --git a/src/cli/specs/worktree-set.ts b/src/cli/specs/worktree-set.ts index 3203a9cb2a2..47a28078549 100644 --- a/src/cli/specs/worktree-set.ts +++ b/src/cli/specs/worktree-set.ts @@ -5,7 +5,7 @@ export const WORKTREE_SET_COMMAND_SPEC: CommandSpec = { path: ['worktree', 'set'], summary: 'Update Orca metadata for a worktree', usage: - 'orca worktree set --worktree [--display-name ] [--issue ] [--pr ] [--linear-issue ] [--gitlab-issue ] [--gitlab-mr ] [--comment ] [--workspace-status ] [--unread|--read] [--parent-worktree [--parent-environment ]|--no-parent] [--json]', + 'orca worktree set --worktree [--display-name ] [--issue ] [--pr ] [--linear-issue ] [--gitlab-issue ] [--gitlab-mr ] [--comment ] [--workspace-status ] [--unread|--read] [--parent-worktree [--parent-server ]|--no-parent] [--json]', allowedFlags: [ ...GLOBAL_FLAGS, 'worktree', @@ -20,14 +20,14 @@ export const WORKTREE_SET_COMMAND_SPEC: CommandSpec = { 'unread', 'read', 'parent-worktree', - 'parent-environment', + 'parent-server', 'no-parent' ], notes: [ 'Workspace status ids match the board columns (defaults: todo, in-progress, in-review, completed); custom statuses use their configured id.', 'Pass --comment "" (or --comment=) to clear the comment.', 'Pass --linear-issue null to clear the Linear issue link.', - "--parent-worktree is looked up in the worktree's own environment; add --parent-environment for a parent in another environment. No other environment is searched.", + "--parent-worktree is looked up on the worktree's own server; add --parent-server for a parent on another server. No other server is searched.", 'Pass --pr null, --gitlab-issue null, or --gitlab-mr null to clear only the matching link.', 'Each link flag updates its own field and leaves unrelated links unchanged. GitLab URLs must match the stored source project or remote; they cannot select a foreign project.', 'On a folder workspace (folder:, or a path:/name: selector that matches one), only --display-name, --comment, --workspace-status and --unread/--read apply. Parent and link flags are refused; link it with orca reference add.' diff --git a/src/cli/terminal-format.ts b/src/cli/terminal-format.ts index 16924796c2e..2a6f0e92490 100644 --- a/src/cli/terminal-format.ts +++ b/src/cli/terminal-format.ts @@ -4,6 +4,7 @@ import { } from '../shared/terminal/pty/lifecycle/pty-liveness-verdict' import { describeTerminalWaitBlockedReason } from '../shared/terminal/runtime-policy/terminal-wait-blocked-reason-legacy-alias' import { formatListingHostScope, type WithAnnotatedHostScope } from './omitted-host-scope-selectors' +import { ownerTokenOf, type OwnerContext } from './row-owner-server' import type { RuntimeTerminalClose, RuntimeTerminalCreate, @@ -23,7 +24,8 @@ import type { } from '../shared/runtime-types' export function formatTerminalList( - result: WithAnnotatedHostScope + result: WithAnnotatedHostScope, + owners?: OwnerContext ): string { const scope = formatListingHostScope(result.hostScope) if (result.terminals.length === 0) { @@ -32,7 +34,7 @@ export function formatTerminalList( const body = result.terminals .map( (terminal) => - `${terminal.handle} ${terminal.paneTitle ?? terminal.title ?? '(untitled)'} ${terminal.connected ? 'connected' : 'disconnected'}${terminal.orphaned ? ' orphaned' : ''} host=${terminal.executionHostId ?? 'unverifiable'} ${terminal.worktreePath}\n${terminal.preview ? `preview: ${terminal.preview}` : 'preview: '}` + `${terminal.handle} ${terminal.paneTitle ?? terminal.title ?? '(untitled)'} ${terminal.connected ? 'connected' : 'disconnected'}${terminal.orphaned ? ' orphaned' : ''}${ownerTokenOf(terminal.executionHostId, owners)} ${terminal.worktreePath}\n${terminal.preview ? `preview: ${terminal.preview}` : 'preview: '}` ) .join('\n\n') const visualLayout = formatTerminalVisualLayouts(result.visualLayouts) @@ -216,7 +218,7 @@ function promptObservationWarning( } if (prompt.observation === 'unsupported') { return prompt.provider === 'old-host' - ? 'this host predates durable prompt receipts. Update Orca on the execution host, and inspect the terminal before retrying an ambiguous send.' + ? 'this server predates durable prompt receipts. Update Orca on that server, and inspect the terminal before retrying an ambiguous send.' : 'input was accepted, but this provider cannot report delivery. Inspect the terminal before retrying.' } return null diff --git a/src/cli/terminal-list-host-scope-format.test.ts b/src/cli/terminal-list-host-scope-format.test.ts index fec612920ad..aba3a99fc24 100644 --- a/src/cli/terminal-list-host-scope-format.test.ts +++ b/src/cli/terminal-list-host-scope-format.test.ts @@ -24,22 +24,13 @@ function listResult(overrides: Partial = {}): Runtime return { terminals: [terminal()], totalCount: 1, truncated: false, ...overrides } } -describe('formatTerminalList host identity', () => { - it('prints unverifiable, not local, for a row whose host the runtime could not name', () => { - const output = formatTerminalList(listResult({ terminals: [terminal()] })) - - expect(output).toContain('host=unverifiable') - expect(output).not.toContain('host=local') - }) -}) - describe('formatTerminalList orphaned marker', () => { it('marks only the terminal with no pane binding', () => { const list = formatTerminalList( listResult({ terminals: [terminal(), terminal({ handle: 'term_2', orphaned: true })] }) ) - expect(list).toContain('term_1 worker connected host=') - expect(list).toContain('term_2 worker connected orphaned host=') + expect(list).toContain('term_1 worker connected /repo') + expect(list).toContain('term_2 worker connected orphaned /repo') }) }) diff --git a/src/cli/workspace-address.ts b/src/cli/workspace-address.ts index e4a2bb6b1cb..3cf7332bf77 100644 --- a/src/cli/workspace-address.ts +++ b/src/cli/workspace-address.ts @@ -1,16 +1,25 @@ import { isUnresolvedOwnerHostId, parseExecutionHostId } from '../shared/execution-host' -import { listEnvironments } from '../shared/remote-runtime/host-store/runtime-environment-store' import { parseWorkspaceKey } from '../shared/workspace-scope' import type { CrossStoreParentRef } from '../shared/worktree/lineage-types' import { LOCAL_ENVIRONMENT } from './local-environment-selector' import type { RuntimeClient } from './runtime-client' import { quoteCliCommandArgument } from './shell-command-quote' -/** Which Orca answered: `local`, a saved environment, or a one-off pairing-code connection (id null). */ -export type WorkspaceEnvironment = { id: string | null; name: string | null } +import { + formatOwner, + LOCAL_SERVER, + ownerOfHostId, + readOwnerContext, + serverLabel, + type OwnerContext, + type ServerUnknownReason, + type WorkspaceServer +} from './row-owner-server' -/** A copyable route to one workspace; `environment` is the exact `--environment` value. */ -export type WorkspaceAddress = { environment: string; worktree: string; line: string } +export type { WorkspaceServer } + +/** A copyable route to one workspace; `server` is the exact `--server` value. */ +export type WorkspaceAddress = { server: string; worktree: string; line: string } export type AddressUnavailableReason = | 'one-off-connection' @@ -18,14 +27,16 @@ export type AddressUnavailableReason = | 'duplicate-folder-id' export type WorkspaceParentAnnotation = { - state: 'known' | 'unknown-environment' + state: 'known' | 'unknown-server' selector: string - environment: WorkspaceEnvironment | null + server: WorkspaceServer | null address: WorkspaceAddress | null } +/** `server` owns the row; `address` is the route that answered and a selector it accepts. */ export type WorkspaceAnnotation = { - environment: WorkspaceEnvironment + server: WorkspaceServer | null + serverUnknown?: ServerUnknownReason address: WorkspaceAddress | null addressUnavailable?: AddressUnavailableReason parent: WorkspaceParentAnnotation | null @@ -42,51 +53,30 @@ export type AddressableRow = { } export type AddressContext = { - environment: WorkspaceEnvironment + owners: OwnerContext /** The caller's own store, read only when some row has a parent in another store. */ localInstallationId?: string } -const LOCAL: WorkspaceEnvironment = { id: LOCAL_ENVIRONMENT, name: LOCAL_ENVIRONMENT } - -/** The environment the client routes to; a saved route is named by its stored id and name. */ -export function describeClientEnvironment(client: RuntimeClient): WorkspaceEnvironment { - if (!client.isRemote) { - return LOCAL - } - const selector = client.environmentSelector - if (!selector) { - return { id: null, name: null } - } - const saved = listEnvironments(client.userDataPath).find( - (environment) => environment.id === selector || environment.name === selector - ) - return saved ? { id: saved.id, name: saved.name } : { id: selector, name: selector } -} - export async function readAddressContext( client: RuntimeClient, rows: readonly AddressableRow[], readLocalInstallationId: () => Promise ): Promise { - const environment = describeClientEnvironment(client) + const owners = readOwnerContext(client) if (!rows.some((row) => row.crossStoreParent)) { - return { environment } + return { owners } } - // Only the caller's own store is verified here; other environments are never dialed. + // Only the caller's own store is verified here; other servers are never dialed. const localInstallationId = await readLocalInstallationId().catch(() => undefined) - return { environment, localInstallationId } + return { owners, localInstallationId } } -export function environmentLabel(environment: WorkspaceEnvironment | null): string { - return environment?.name ?? 'one-off connection' -} - -function addressOf(environment: string, worktree: string): WorkspaceAddress { +function addressOf(server: string, worktree: string): WorkspaceAddress { return { - environment, + server, worktree, - line: `--environment ${quoteCliCommandArgument(environment)} --worktree ${quoteCliCommandArgument(worktree)}` + line: `--server ${quoteCliCommandArgument(server)} --worktree ${quoteCliCommandArgument(worktree)}` } } @@ -113,7 +103,7 @@ function listingOf(rows: readonly AddressableRow[]): Listing { return { rowsById } } -/** The selector naming this row alone in its environment, or why none can. */ +/** The selector naming this row alone on the answering server, or why none can. */ function rowSelector( row: AddressableRow, listing: Listing @@ -137,16 +127,18 @@ function rowSelector( function parentOf( row: AddressableRow, + rowServer: WorkspaceServer | null, listing: Listing, context: AddressContext ): WorkspaceParentAnnotation | null { - const route = context.environment.id - const sameEnvironment = (selector: string, parentRow?: AddressableRow) => { + const route = context.owners.answering.id + // A same-store parent shares its child's owner. + const sameServer = (selector: string, parentRow?: AddressableRow) => { const resolved = parentRow ? rowSelector(parentRow, listing) : { selector } return { state: 'known' as const, selector, - environment: context.environment, + server: rowServer, address: route && 'selector' in resolved ? addressOf(route, resolved.selector) : null } } @@ -155,11 +147,11 @@ function parentOf( const parentRow = listing.rowsById .get(row.parentWorktreeId) ?.find((candidate) => (candidate.hostId ?? null) === (row.hostId ?? null)) - return sameEnvironment(`id:${row.parentWorktreeId}`, parentRow) + return sameServer(`id:${row.parentWorktreeId}`, parentRow) } if (row.parentFolderKey) { // A listed copy carries the duplicate-folder-id check, so a shared id gets no address. - return sameEnvironment(row.parentFolderKey, listing.rowsById.get(row.parentFolderKey)?.[0]) + return sameServer(row.parentFolderKey, listing.rowsById.get(row.parentFolderKey)?.[0]) } const ref = row.crossStoreParent if (!ref) { @@ -170,11 +162,11 @@ function parentOf( return { state: 'known', selector, - environment: LOCAL, + server: LOCAL_SERVER, address: addressOf(LOCAL_ENVIRONMENT, selector) } } - return { state: 'unknown-environment', selector, environment: null, address: null } + return { state: 'unknown-server', selector, server: null, address: null } } /** Annotations for every row of one listing, aligned by index. */ @@ -183,56 +175,66 @@ export function annotateWorkspaces( context: AddressContext ): WorkspaceAnnotation[] { const listing = listingOf(rows) + const route = context.owners.answering.id return rows.map((row) => { - const parent = parentOf(row, listing, context) - const route = context.environment.id + const owner = ownerOfHostId(row.hostId, context.owners) + const server = owner.server + ? { server: owner.server } + : { server: null, serverUnknown: owner.unknown } + const parent = parentOf(row, owner.server, listing, context) if (!route) { - return { - environment: context.environment, - address: null, - addressUnavailable: 'one-off-connection', - parent - } + return { ...server, address: null, addressUnavailable: 'one-off-connection', parent } } const selected = rowSelector(row, listing) return 'selector' in selected - ? { environment: context.environment, address: addressOf(route, selected.selector), parent } - : { - environment: context.environment, - address: null, - addressUnavailable: selected.unavailable, - parent - } + ? { ...server, address: addressOf(route, selected.selector), parent } + : { ...server, address: null, addressUnavailable: selected.unavailable, parent } }) } const UNAVAILABLE_TEXT: Record = { 'one-off-connection': - 'unavailable (one-off pairing-code connection; save it with `orca environment add --name --pairing-code `)', - 'unverifiable-row': "unavailable (this row's host or identity can't be verified)", + 'unavailable (one-off connection; save it with `orca server add --name --pairing-code `)', + 'unverifiable-row': "unavailable (this row's owner or identity can't be verified)", 'duplicate-folder-id': 'unavailable (several folder workspaces share this id; remove one in the Orca app and add its folder again)' } -/** `environment:` and `address:` lines, each on its own line. */ -export function formatAddressLines(annotation: WorkspaceAnnotation): string { - return `\nenvironment: ${environmentLabel(annotation.environment)}\naddress: ${ +/** `server:` and `address:` lines, each on its own line. */ +export function formatAddressLines( + annotation: WorkspaceAnnotation, + hostId?: string | null +): string { + const owner = annotation.server + ? { server: annotation.server } + : { + server: null, + unknown: annotation.serverUnknown ?? ('owner-not-reported' as const), + stored: hostId ?? null + } + return `\nserver: ${formatOwner(owner)}\naddress: ${ annotation.address?.line ?? UNAVAILABLE_TEXT[annotation.addressUnavailable ?? 'unverifiable-row'] }` } -/** The `parent:` line, naming the parent's environment when it differs from the row's. */ -export function formatParentLine(annotation: WorkspaceAnnotation): string { +/** The parent text after `parent: `, naming the parent's server when it differs from the row's. */ +export function formatParentText(annotation: WorkspaceAnnotation): string | null { const { parent } = annotation if (!parent) { - return '' + return null } - if (parent.state === 'unknown-environment') { - return `\nparent: ${parent.selector} environment=unknown (no verified route here)` + if (parent.state === 'unknown-server') { + return `${parent.selector} server=unknown (no verified route here)` } - const differs = parent.environment?.id !== annotation.environment.id - return `\nparent: ${parent.selector}${differs ? ` environment=${environmentLabel(parent.environment)}` : ''}` + const differs = parent.server?.id !== annotation.server?.id + return `${parent.selector}${differs ? ` server=${serverLabel(parent.server)}` : ''}` +} + +/** The `parent:` line, or nothing when the row has no parent. */ +export function formatParentLine(annotation: WorkspaceAnnotation): string { + const text = formatParentText(annotation) + return text === null ? '' : `\nparent: ${text}` } type PsRowFacts = { @@ -275,10 +277,11 @@ export function addressableOfShowRecord(record: ShowRecordFacts): AddressableRow } } -/** The JSON fields one row gains; `addressUnavailable` appears only beside a null address. */ +/** The JSON fields one row gains; the `*Unavailable`/`*Unknown` reasons appear only beside a null. */ export function annotationFields(annotation: WorkspaceAnnotation): WorkspaceAnnotation { return { - environment: annotation.environment, + server: annotation.server, + ...(annotation.serverUnknown ? { serverUnknown: annotation.serverUnknown } : {}), parent: annotation.parent, address: annotation.address, ...(annotation.addressUnavailable ? { addressUnavailable: annotation.addressUnavailable } : {}) diff --git a/src/cli/workspace-catalog-row.ts b/src/cli/workspace-catalog-row.ts index 11b2e5e834f..12bb115707b 100644 --- a/src/cli/workspace-catalog-row.ts +++ b/src/cli/workspace-catalog-row.ts @@ -18,7 +18,7 @@ export function refuseUnresolvedOwner(innermost: readonly CatalogRow[]): void { } throw new RuntimeClientError( 'selector_ambiguous', - `Orca can't tell which host owns the folder workspace containing the current directory (${unresolved.map((row) => `${row.id} at ${row.path}`).join(', ')}), so it won't guess the workspace.`, + `Orca can't tell which server owns the folder workspace containing the current directory (${unresolved.map((row) => `${row.id} at ${row.path}`).join(', ')}), so it won't guess the workspace.`, { workspaces: innermost.map((row) => ({ kind: parseWorkspaceKey(row.id)?.type === 'folder' ? 'folder workspace' : 'worktree', diff --git a/src/cli/workspace-format.ts b/src/cli/workspace-format.ts index 77a26c4fedf..5e77924a1b4 100644 --- a/src/cli/workspace-format.ts +++ b/src/cli/workspace-format.ts @@ -11,6 +11,8 @@ import type { MemorySnapshot, WorktreeMemory } from '../shared/process-stats-typ import { formatListingHostScope, type WithAnnotatedHostScope } from './omitted-host-scope-selectors' import { formatWorktreePsTerminalFields } from './worktree-ps-terminal-verdict' import { formatWorktreePsProgramStatus } from './worktree-ps-program-status' +import { quoteCliCommandArgument } from './shell-command-quote' +import { ownerTokenOf, type OwnerContext } from './row-owner-server' export function formatMemorySnapshot(snapshot: MemorySnapshot): string { const topWorktrees = [...snapshot.worktrees].sort((a, b) => b.memory - a.memory).slice(0, 10) @@ -109,28 +111,28 @@ function formatByteCount(bytes: number): string { return `${formatted} ${units[unitIndex]}` } -export function formatEnvironmentList(result: { - environments: PublicKnownRuntimeEnvironment[] +export function formatSavedServerList(result: { + servers: PublicKnownRuntimeEnvironment[] }): string { - if (result.environments.length === 0) { - return 'No saved environments.' + if (result.servers.length === 0) { + return 'No saved servers. Add one with `orca server add --name --pairing-code `.' } - return result.environments + return result.servers .map( - (environment) => - `${environment.id} ${environment.name} ${environment.endpoints[0]?.endpoint ?? 'no-endpoint'}` + (server) => + `${server.id} ${server.name} ${server.endpoints[0]?.endpoint ?? 'no-endpoint'} -> --server ${quoteCliCommandArgument(server.id)}` ) .join('\n') } -export function formatEnvironment(environment: PublicKnownRuntimeEnvironment): string { +export function formatSavedServer(server: PublicKnownRuntimeEnvironment): string { return [ - `id: ${environment.id}`, - `name: ${environment.name}`, - `runtimeId: ${environment.runtimeId ?? 'unknown'}`, - `lastUsedAt: ${environment.lastUsedAt ?? 'never'}`, - `preferredEndpointId: ${environment.preferredEndpointId}`, - ...environment.endpoints.map( + `id: ${server.id}`, + `name: ${server.name}`, + `instance: ${server.runtimeId ?? 'unknown'}`, + `lastUsedAt: ${server.lastUsedAt ?? 'never'}`, + `preferredEndpointId: ${server.preferredEndpointId}`, + ...server.endpoints.map( (endpoint) => `endpoint: ${endpoint.id} ${endpoint.kind} ${endpoint.endpoint}` ) ].join('\n') @@ -150,7 +152,7 @@ export function formatWorktreePs( const body = result.worktrees .map( (worktree) => - `${worktree.repo} ${worktree.branch} host=${worktree.hostId ?? 'unverifiable'} ${formatWorktreePsTerminalFields(worktree)} unread:${worktree.unread ? 'yes' : 'no'}${formatWorktreePsProgramStatus(worktree.agents)}\n${worktree.path}${formatWorktreePsLocation(worktree)}${worktree.preview ? `\npreview: ${worktree.preview}` : ''}` + `${worktree.repo} ${worktree.branch} ${formatWorktreePsTerminalFields(worktree)} unread:${worktree.unread ? 'yes' : 'no'}${formatWorktreePsProgramStatus(worktree.agents)}\n${worktree.path}${formatWorktreePsLocation(worktree)}${worktree.preview ? `\npreview: ${worktree.preview}` : ''}` ) .join('\n\n') const bodyWithScope = `${body}\n\n${scope}` @@ -162,19 +164,8 @@ export function formatWorktreePs( function formatWorktreePsLocation(worktree: AnnotatedPsRow): string { const annotation = workspaceAnnotationOf(worktree) return annotation - ? `${formatParentLine(annotation)}${formatAddressLines(annotation)}` - : formatWorktreePsParent(worktree) -} - -/** The parent line, in the sidebar's precedence: worktree, then folder workspace, then another machine. */ -function formatWorktreePsParent(worktree: RuntimeWorktreePsResult['worktrees'][number]): string { - const parent = - worktree.parentWorktreeId ?? - worktree.workspaceLineage?.parentWorkspaceKey ?? - (worktree.crossStoreParent - ? `${worktree.crossStoreParent.parent.workspaceKey} on another machine` - : null) - return parent ? `\nparent: ${parent}` : '' + ? `${formatParentLine(annotation)}${formatAddressLines(annotation, worktree.hostId)}` + : '' } export function formatRepoList(result: RuntimeRepoList): string { @@ -201,7 +192,8 @@ export function formatRepoRefs(result: RuntimeRepoSearchRefs): string { } export function formatWorktreeList( - result: WithAnnotatedHostScope + result: WithAnnotatedHostScope, + owners?: OwnerContext ): string { const scope = formatListingHostScope(result.hostScope) if (result.worktrees.length === 0) { @@ -210,7 +202,7 @@ export function formatWorktreeList( const body = result.worktrees .map((worktree) => { const childCount = worktree.childWorktreeIds?.length ?? 0 - return `${String(worktree.id)} ${String(worktree.branch)} host=${String(worktree.hostId ?? 'unverifiable')} ${String(worktree.path)}\ndisplayName: ${String(worktree.displayName ?? '')}\nparentWorktreeId: ${String(worktree.parentWorktreeId ?? 'null')}\nchildWorktreeIds: ${childCount > 0 ? worktree.childWorktreeIds.join(',') : '[]'}\nlinkedIssue: ${String(worktree.linkedIssue ?? 'null')}\ncomment: ${String(worktree.comment ?? '')}` + return `${String(worktree.id)} ${String(worktree.branch)}${ownerTokenOf(worktree.hostId, owners)} ${String(worktree.path)}\ndisplayName: ${String(worktree.displayName ?? '')}\nparentWorktreeId: ${String(worktree.parentWorktreeId ?? 'null')}\nchildWorktreeIds: ${childCount > 0 ? worktree.childWorktreeIds.join(',') : '[]'}\nlinkedIssue: ${String(worktree.linkedIssue ?? 'null')}\ncomment: ${String(worktree.comment ?? '')}` }) .join('\n\n') const bodyWithScope = `${body}\n\n${scope}` @@ -219,18 +211,26 @@ export function formatWorktreeList( : bodyWithScope } -const ANNOTATION_KEYS = new Set(['environment', 'address', 'addressUnavailable', 'parent']) +const ANNOTATION_KEYS = new Set([ + 'server', + 'serverUnknown', + 'address', + 'addressUnavailable', + 'parent' +]) function workspaceAnnotationOf(record: Partial): WorkspaceAnnotation | null { - const { environment, address, addressUnavailable, parent } = record - return environment - ? { - environment, - address: address ?? null, - parent: parent ?? null, - ...(addressUnavailable ? { addressUnavailable } : {}) - } - : null + if (!('address' in record)) { + return null + } + const { server, serverUnknown, address, addressUnavailable, parent } = record + return { + server: server ?? null, + address: address ?? null, + parent: parent ?? null, + ...(serverUnknown ? { serverUnknown } : {}), + ...(addressUnavailable ? { addressUnavailable } : {}) + } } export function formatWorktreeShow(result: { @@ -246,6 +246,6 @@ export function formatWorktreeShow(result: { ) .join('\n') return annotation - ? `${fields}${formatParentLine(annotation)}${formatAddressLines(annotation)}` + ? `${fields}${formatParentLine(annotation)}${formatAddressLines(annotation, worktree.hostId)}` : fields } diff --git a/src/cli/worktree-project-target.ts b/src/cli/worktree-project-target.ts index c538b0c9482..e730302b29f 100644 --- a/src/cli/worktree-project-target.ts +++ b/src/cli/worktree-project-target.ts @@ -1,4 +1,8 @@ -import { normalizeExecutionHostId, type ParsedExecutionHost } from '../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + normalizeExecutionHostId, + type ParsedExecutionHost +} from '../shared/execution-host' import type { ProjectHostSetup } from '../shared/project-types' import { hostFilterMatchesHostId, resolveHostFlagTarget } from './execution-host-flag' import { findProjectSetups, setupHostId } from './project-selector' @@ -6,10 +10,18 @@ import type { RuntimeClient } from './runtime-client' import { RuntimeClientError } from './runtime-client' import { getPresentStringFlag } from './flags' import { getFolderWorkspaceMissingRepoError } from './caller-folder-workspace' +import { + formatOwnerToken, + ownerOfHostId, + readOwnerContext, + serverLabel, + type OwnerContext +} from './row-owner-server' +import { quoteCliCommandArgument } from './shell-command-quote' export type ProjectCreateTarget = { repoSelector: string - /** Repo ids can be shared across hosts. */ + /** Repo ids can be shared across servers. */ repoHostId: string setup: ProjectHostSetup } @@ -34,11 +46,25 @@ export function assertWorkspaceTargetFlagsCompatible(flags: Map + `${candidate.path} ${formatOwnerToken(ownerOfHostId(setupHostId(candidate), context.owners))}` + ) +} + // Prefer the exact runtime stamp over its local alias when both setups exist. function selectSetupOnHost( candidates: readonly ProjectHostSetup[], host: ParsedExecutionHost | undefined, - selectorLabel: string + selectorLabel: string, + context: SetupChoiceContext ): ProjectHostSetup | undefined { if (host) { return ( @@ -51,16 +77,25 @@ function selectSetupOnHost( if (hostIds.size <= 1) { return candidates[0] } + // An explicit --server names the server the command runs on, which owns its local setups. + const own = candidates.filter((candidate) => setupHostId(candidate) === LOCAL_EXECUTION_HOST_ID) + if (context.explicitServer && own.length > 0) { + return own[0] + } + const answering = context.owners.answering throw new RuntimeClientError( 'invalid_argument', - `Ambiguous ${selectorLabel}: it is set up on ${hostIds.size} hosts. Pass --host to choose one.`, + `Ambiguous ${selectorLabel}: it has setups for ${hostIds.size} servers here.`, { knownProjectHostSetups: candidates.map(summarizeSetup), nextSteps: [ - ...candidates.map( - (candidate) => `Use --host ${setupHostId(candidate)} for ${candidate.path}.` - ), - 'Run `orca host list` to see every machine you can target and the flag for each.' + ...describeSetupChoices(candidates, context), + ...(own.length > 0 && answering.id + ? [ + `Add --server ${quoteCliCommandArgument(answering.id)} to use the setup on ${serverLabel(answering)}.` + ] + : []), + 'A setup owned by another server is used by running the command on that server with --server .' ] } ) @@ -104,14 +139,19 @@ export async function resolveProjectCreateTarget( : (await findProjectSetups(client, result.result.setups, projectId)).filter( (candidate) => candidate.setupState === 'ready' ) - // Setup ids are scoped to a host, so --host must disambiguate them too. + // Setup ids are scoped to a host, so the same owner rule disambiguates them too. + const choice: SetupChoiceContext = { + owners: readOwnerContext(client), + explicitServer: flags.has('server') + } const setup = projectHostSetupId ? selectSetupOnHost( ready.filter((candidate) => candidate.id === projectHostSetupId), host, - `--project-host-setup ${projectHostSetupId}` + `--project-host-setup ${projectHostSetupId}`, + choice ) - : selectSetupOnHost(candidates, host, `--project ${projectId}`) + : selectSetupOnHost(candidates, host, `--project ${projectId}`, choice) if (!setup) { if (projectHostSetupId) { throw new RuntimeClientError( @@ -122,7 +162,7 @@ export async function resolveProjectCreateTarget( if (candidates.length === 0) { throw new RuntimeClientError( 'invalid_argument', - `No ready setup found for --project ${projectId} on any host.`, + `No ready setup found for --project ${projectId} on this server.`, { nextSteps: [ 'Run `orca project list` for project ids and names, and `orca project setups` for where each is set up.' @@ -132,12 +172,10 @@ export async function resolveProjectCreateTarget( } throw new RuntimeClientError( 'invalid_argument', - `Project is not set up on the selected host: ${projectId}${host ? ` on ${host.id}` : ''}`, + `Project ${projectId} has no ready setup${host ? ` for ${host.id}` : ''} here.`, { knownProjectHostSetups: candidates.map(summarizeSetup), - nextSteps: candidates.map( - (candidate) => `Use --host ${setupHostId(candidate)} for ${candidate.path}.` - ) + nextSteps: describeSetupChoices(candidates, choice) } ) } diff --git a/src/cli/worktree-selector-recovery.ts b/src/cli/worktree-selector-recovery.ts index c67a0b4e658..21a3cb7cf2b 100644 --- a/src/cli/worktree-selector-recovery.ts +++ b/src/cli/worktree-selector-recovery.ts @@ -54,7 +54,7 @@ export function worktreeSelectorRecovery(selector: string): WorktreeSelectorReco `No Orca workspace matched the worktree selector "${selector}".`, ...(suggestions.length > 0 ? [`Did you mean: ${suggestions.join(', ')}`] : []), `Valid selector forms: ${WORKTREE_SELECTOR_FORMS.join(', ')}.`, - 'List the exact values, folder workspaces included, with `orca worktree ps --json` (add `--environment ` for a workspace in another environment); a bare repository id is not a worktree id.' + 'List the exact values, folder workspaces included, with `orca worktree ps --json` (add `--server ` for a workspace on another server); a bare repository id is not a worktree id.' ] } } diff --git a/src/main/managed-server/lifecycle/orcad-managed-tunnel-identity.ts b/src/main/managed-server/lifecycle/orcad-managed-tunnel-identity.ts index 80c6c6c0645..c562dcd460e 100644 --- a/src/main/managed-server/lifecycle/orcad-managed-tunnel-identity.ts +++ b/src/main/managed-server/lifecycle/orcad-managed-tunnel-identity.ts @@ -66,7 +66,7 @@ export class OrcadManagedIdentityError extends Error { 'to the host as a different SSH user, or the server was reinstalled), so reconnecting ' + `won’t restore access. To pair with the host’s current server, open the ⋯ menu on ` + `${environmentName} in Settings › Remote Orca Servers and choose Forget… (or run ` + - `\`orca environment forget --environment ${selector} --yes\`), then click ` + + `\`orca server forget --server ${selector} --yes\`), then click ` + 'Connect on the SSH host', detail ) diff --git a/src/main/runtime/rpc/methods/accounts/accounts.ts b/src/main/runtime/rpc/methods/accounts/accounts.ts index 33c9fdc4879..9ca4897328a 100644 --- a/src/main/runtime/rpc/methods/accounts/accounts.ts +++ b/src/main/runtime/rpc/methods/accounts/accounts.ts @@ -113,7 +113,7 @@ const ACCOUNT_METHOD_DEFINITIONS = [ params: AddDataAccountParams, handler: async (params, { runtime, clientKind }) => { if (clientKind !== undefined) { - throw new Error('Adding accounts is only available on the Orca host runtime.') + throw new Error('Adding accounts works only on the Orca server itself.') } return runtime.addDataAccountFromHome(params.provider, params.sourceDataHome, params.label) } @@ -209,7 +209,7 @@ const ACCOUNT_METHOD_DEFINITIONS = [ params: AddCodexFromHomeParams, handler: async (params, { runtime, clientKind }) => { if (clientKind !== undefined) { - throw new Error('Adding Codex accounts is only available on the Orca host runtime.') + throw new Error('Adding Codex accounts works only on the Orca server itself.') } return runtime.addCodexAccountFromHome(params.sourceHome, { runtime: params.runtime, diff --git a/src/main/runtime/rpc/worktree-rm-cli.integration.test.ts b/src/main/runtime/rpc/worktree-rm-cli.integration.test.ts index dcc36708742..73c2688f9df 100644 --- a/src/main/runtime/rpc/worktree-rm-cli.integration.test.ts +++ b/src/main/runtime/rpc/worktree-rm-cli.integration.test.ts @@ -384,7 +384,7 @@ function legacyParams(worktree = `id:${id}`, hostId = 'local', force = false) { function warnings() { return vi .mocked(console.error) - .mock.calls.filter(([value]) => String(value).includes('host is older')) + .mock.calls.filter(([value]) => String(value).includes('server is older')) } it.each([false, true])('sends exact legacy params and one warning, JSON=%s', async (json) => { supported = false diff --git a/src/main/startup/cli-command-names.ts b/src/main/startup/cli-command-names.ts index 9a09163faf7..b78bdbfabb8 100644 --- a/src/main/startup/cli-command-names.ts +++ b/src/main/startup/cli-command-names.ts @@ -68,6 +68,7 @@ export const CLI_COMMAND_NAMES = [ 'select', 'select-all', 'serve', + 'server', 'set', 'skills', 'snapshot', diff --git a/src/main/startup/serve-mode-argv.ts b/src/main/startup/serve-mode-argv.ts index 01dd2ae2883..0bcb1460058 100644 --- a/src/main/startup/serve-mode-argv.ts +++ b/src/main/startup/serve-mode-argv.ts @@ -30,6 +30,7 @@ export const VALUE_TAKING_FLAGS = new Set([ '--disable-features', '--user-data-dir', '--proxy-server', + '--server', '--environment', '--pairing-code' ]) diff --git a/src/renderer/src/hooks/ipc-events/runtime-client-ipc-bridge.ts b/src/renderer/src/hooks/ipc-events/runtime-client-ipc-bridge.ts index dfd4f38e6bc..b54ab389a8d 100644 --- a/src/renderer/src/hooks/ipc-events/runtime-client-ipc-bridge.ts +++ b/src/renderer/src/hooks/ipc-events/runtime-client-ipc-bridge.ts @@ -226,7 +226,7 @@ export function registerRuntimeClientIpcBridge( useAppStore.getState().setRuntimeEnvironments(await window.api.runtimeEnvironments.list()) }) unsubs.push(() => setRuntimeEnvironmentCatalogRefresher(null)) - // `orca environment add/rm` edits the registry without any renderer request (#25251). + // `orca server add/rm` edits the registry without any renderer request (#25251). const stopCatalogChanged = window.api.runtimeEnvironments?.onCatalogChanged?.(() => { void refreshRuntimeEnvironmentCatalog() }) diff --git a/src/renderer/src/i18n/en-runtime-required.json b/src/renderer/src/i18n/en-runtime-required.json index bd1b52da623..5d63f15145d 100644 --- a/src/renderer/src/i18n/en-runtime-required.json +++ b/src/renderer/src/i18n/en-runtime-required.json @@ -2127,7 +2127,7 @@ "alreadyPairedAddAgain": "This server is already paired as \"{{name}}\". To update its connection, add it again under Settings > Remote Orca Servers.", "alreadyPairedCloudIdentity": "This server is already paired as \"{{name}}\". The cloud workspace's server reuses that server's identity, so it was not saved.", "alreadyPairedCloudWorkspace": "This server is already paired as \"{{name}}\". It belongs to a cloud workspace, which pairs it again when it resumes.", - "alreadyPairedManagedDeployment": "This server is already paired as \"{{name}}\". Orca runs this server on an SSH host for you; its pairing cannot be replaced or removed here. To decommission it, run `orca environment stop --environment --yes` or use Settings > Orca on your SSH hosts; for a host that is gone, run `orca environment forget --environment --yes`.", + "alreadyPairedManagedDeployment": "This server is already paired as \"{{name}}\". Orca runs this server on an SSH host for you; its pairing cannot be replaced or removed here. To decommission it, run `orca server stop --server --yes` or use Settings > Orca on your SSH hosts; for a host that is gone, run `orca server forget --server --yes`.", "alreadyPairedSshAccessChangePending": "This server is already paired as \"{{name}}\". This server's SSH access change didn't finish. Retry or cancel it under Settings > Remote Orca Servers > SSH access for paired servers before replacing its pairing or removing it.", "alreadyPairedSshAccessLinked": "This server is already paired as \"{{name}}\". Unlink this server's SSH access under Settings > Remote Orca Servers > SSH access for paired servers before replacing its pairing or removing it.", "alreadyPairedUnreadable": "This server is already paired as \"{{name}}\", whose saved settings this version of Orca cannot read.", @@ -2135,7 +2135,7 @@ "hostSaveFailed": "Orca verified the host but could not save it. Check local settings storage and try again.", "idNeedsNewerOrca": "A server with this id already exists in a format that needs a newer version of Orca.", "invalidPairingCode": "Invalid pairing code. Expected an orca://pair?... URL or bare pairing payload.", - "managedDeployment": "Orca runs this server on an SSH host for you; its pairing cannot be replaced or removed here. To decommission it, run `orca environment stop --environment --yes` or use Settings > Orca on your SSH hosts; for a host that is gone, run `orca environment forget --environment --yes`.", + "managedDeployment": "Orca runs this server on an SSH host for you; its pairing cannot be replaced or removed here. To decommission it, run `orca server stop --server --yes` or use Settings > Orca on your SSH hosts; for a host that is gone, run `orca server forget --server --yes`.", "nameTaken": "A server named \"{{name}}\" already exists.", "repairCloudWorkspace": "This server belongs to a cloud workspace, which pairs it again when it resumes.", "repairSaveFailed": "Orca verified the server but could not save the new pairing. Check local settings storage and try again.", diff --git a/src/renderer/src/i18n/locales/de.json b/src/renderer/src/i18n/locales/de.json index 19efd403491..96164ca2bbf 100644 --- a/src/renderer/src/i18n/locales/de.json +++ b/src/renderer/src/i18n/locales/de.json @@ -22921,13 +22921,13 @@ "remoteServerPairingErrors": { "invalidPairingCode": "Ungültiger Kopplungscode. Eine URL im Format orca://pair?... oder reine Kopplungsdaten erwartet.", "selfPairingCode": "Dieser Kopplungscode gehört zu dieser Orca-Instanz selbst. Den Code stattdessen auf dem anderen Computer erzeugen.", - "managedDeployment": "Orca betreibt diesen Server für dich auf einem SSH-Host; seine Kopplung kann hier nicht ersetzt oder entfernt werden. Zur Stilllegung `orca environment stop --environment --yes` ausführen oder Einstellungen > Orca auf SSH-Hosts verwenden; falls der Host nicht mehr vorhanden ist, `orca environment forget --environment --yes` ausführen.", + "managedDeployment": "Orca betreibt diesen Server für dich auf einem SSH-Host; seine Kopplung kann hier nicht ersetzt oder entfernt werden. Zur Stilllegung `orca server stop --server --yes` ausführen oder Einstellungen > Orca auf SSH-Hosts verwenden; falls der Host nicht mehr vorhanden ist, `orca server forget --server --yes` ausführen.", "sshAccessChangePending": "Die Änderung des SSH-Zugriffs für diesen Server wurde nicht abgeschlossen. Unter Einstellungen > Entfernte Orca-Server > SSH-Zugriff für gekoppelte Server erneut versuchen oder abbrechen, bevor die Kopplung ersetzt oder der Server entfernt wird.", "sshAccessLinked": "Die Verknüpfung des SSH-Zugriffs für diesen Server unter Einstellungen > Entfernte Orca-Server > SSH-Zugriff für gekoppelte Server aufheben, bevor die Kopplung ersetzt oder der Server entfernt wird.", "alreadyPairedCloudWorkspace": "Dieser Server ist bereits als „{{name}}“ gekoppelt. Er gehört zu einem Cloud-Arbeitsbereich, der ihn beim Fortsetzen erneut koppelt.", "alreadyPairedCloudIdentity": "Dieser Server ist bereits als „{{name}}“ gekoppelt. Der Server des Cloud-Arbeitsbereichs verwendet die Identität dieses Servers erneut und wurde daher nicht gespeichert.", "alreadyPairedWslHost": "Dieser Server ist bereits als „{{name}}“ gekoppelt. Orca verwaltet ihn als WSL-Host, daher kann seine Kopplung hier nicht ersetzt werden.", - "alreadyPairedManagedDeployment": "Dieser Server ist bereits als „{{name}}“ gekoppelt. Orca betreibt diesen Server für dich auf einem SSH-Host; seine Kopplung kann hier nicht ersetzt oder entfernt werden. Zur Stilllegung `orca environment stop --environment --yes` ausführen oder Einstellungen > Orca auf SSH-Hosts verwenden; falls der Host nicht mehr vorhanden ist, `orca environment forget --environment --yes` ausführen.", + "alreadyPairedManagedDeployment": "Dieser Server ist bereits als „{{name}}“ gekoppelt. Orca betreibt diesen Server für dich auf einem SSH-Host; seine Kopplung kann hier nicht ersetzt oder entfernt werden. Zur Stilllegung `orca server stop --server --yes` ausführen oder Einstellungen > Orca auf SSH-Hosts verwenden; falls der Host nicht mehr vorhanden ist, `orca server forget --server --yes` ausführen.", "alreadyPairedSshAccessChangePending": "Dieser Server ist bereits als „{{name}}“ gekoppelt. Die Änderung des SSH-Zugriffs für diesen Server wurde nicht abgeschlossen. Unter Einstellungen > Entfernte Orca-Server > SSH-Zugriff für gekoppelte Server erneut versuchen oder abbrechen, bevor die Kopplung ersetzt oder der Server entfernt wird.", "alreadyPairedSshAccessLinked": "Dieser Server ist bereits als „{{name}}“ gekoppelt. Die Verknüpfung des SSH-Zugriffs für diesen Server unter Einstellungen > Entfernte Orca-Server > SSH-Zugriff für gekoppelte Server aufheben, bevor die Kopplung ersetzt oder der Server entfernt wird.", "alreadyPairedAddAgain": "Dieser Server ist bereits als „{{name}}“ gekoppelt. Zum Aktualisieren seiner Verbindung unter Einstellungen > Entfernte Orca-Server erneut hinzufügen.", diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json index 54fb1287966..9e5ea22fe51 100644 --- a/src/renderer/src/i18n/locales/en.json +++ b/src/renderer/src/i18n/locales/en.json @@ -23726,13 +23726,13 @@ "remoteServerPairingErrors": { "invalidPairingCode": "Invalid pairing code. Expected an orca://pair?... URL or bare pairing payload.", "selfPairingCode": "This pairing code is for this Orca itself. Generate the code on the other computer instead.", - "managedDeployment": "Orca runs this server on an SSH host for you; its pairing cannot be replaced or removed here. To decommission it, run `orca environment stop --environment --yes` or use Settings > Orca on your SSH hosts; for a host that is gone, run `orca environment forget --environment --yes`.", + "managedDeployment": "Orca runs this server on an SSH host for you; its pairing cannot be replaced or removed here. To decommission it, run `orca server stop --server --yes` or use Settings > Orca on your SSH hosts; for a host that is gone, run `orca server forget --server --yes`.", "sshAccessChangePending": "This server's SSH access change didn't finish. Retry or cancel it under Settings > Remote Orca Servers > SSH access for paired servers before replacing its pairing or removing it.", "sshAccessLinked": "Unlink this server's SSH access under Settings > Remote Orca Servers > SSH access for paired servers before replacing its pairing or removing it.", "alreadyPairedCloudWorkspace": "This server is already paired as \"{{name}}\". It belongs to a cloud workspace, which pairs it again when it resumes.", "alreadyPairedCloudIdentity": "This server is already paired as \"{{name}}\". The cloud workspace's server reuses that server's identity, so it was not saved.", "alreadyPairedWslHost": "This server is already paired as \"{{name}}\". Orca manages it as a WSL host, so its pairing cannot be replaced here.", - "alreadyPairedManagedDeployment": "This server is already paired as \"{{name}}\". Orca runs this server on an SSH host for you; its pairing cannot be replaced or removed here. To decommission it, run `orca environment stop --environment --yes` or use Settings > Orca on your SSH hosts; for a host that is gone, run `orca environment forget --environment --yes`.", + "alreadyPairedManagedDeployment": "This server is already paired as \"{{name}}\". Orca runs this server on an SSH host for you; its pairing cannot be replaced or removed here. To decommission it, run `orca server stop --server --yes` or use Settings > Orca on your SSH hosts; for a host that is gone, run `orca server forget --server --yes`.", "alreadyPairedSshAccessChangePending": "This server is already paired as \"{{name}}\". This server's SSH access change didn't finish. Retry or cancel it under Settings > Remote Orca Servers > SSH access for paired servers before replacing its pairing or removing it.", "alreadyPairedSshAccessLinked": "This server is already paired as \"{{name}}\". Unlink this server's SSH access under Settings > Remote Orca Servers > SSH access for paired servers before replacing its pairing or removing it.", "alreadyPairedAddAgain": "This server is already paired as \"{{name}}\". To update its connection, add it again under Settings > Remote Orca Servers.", diff --git a/src/renderer/src/i18n/locales/es.json b/src/renderer/src/i18n/locales/es.json index c9374061e0a..e5f6b154e2a 100644 --- a/src/renderer/src/i18n/locales/es.json +++ b/src/renderer/src/i18n/locales/es.json @@ -23134,13 +23134,13 @@ "remoteServerPairingErrors": { "invalidPairingCode": "Código de emparejamiento no válido. Se esperaba una URL orca://pair?... o datos de emparejamiento sin URL.", "selfPairingCode": "Este código de emparejamiento es para esta misma instancia de Orca. Genera el código en el otro equipo.", - "managedDeployment": "Orca ejecuta este servidor en un host SSH por ti; su emparejamiento no se puede reemplazar ni eliminar aquí. Para retirarlo, ejecuta `orca environment stop --environment --yes` o usa Ajustes > Orca en tus hosts SSH; si el host ya no existe, ejecuta `orca environment forget --environment --yes`.", + "managedDeployment": "Orca ejecuta este servidor en un host SSH por ti; su emparejamiento no se puede reemplazar ni eliminar aquí. Para retirarlo, ejecuta `orca server stop --server --yes` o usa Ajustes > Orca en tus hosts SSH; si el host ya no existe, ejecuta `orca server forget --server --yes`.", "sshAccessChangePending": "El cambio de acceso SSH de este servidor no terminó. Reinténtalo o cancélalo en Ajustes > Servidores remotos de Orca > Acceso SSH para servidores emparejados antes de reemplazar su emparejamiento o eliminarlo.", "sshAccessLinked": "Desvincula el acceso SSH de este servidor en Ajustes > Servidores remotos de Orca > Acceso SSH para servidores emparejados antes de reemplazar su emparejamiento o eliminarlo.", "alreadyPairedCloudWorkspace": "Este servidor ya está emparejado como \"{{name}}\". Pertenece a un espacio de trabajo en la nube, que lo vuelve a emparejar al reanudarse.", "alreadyPairedCloudIdentity": "Este servidor ya está emparejado como \"{{name}}\". El servidor del espacio de trabajo en la nube reutiliza la identidad de ese servidor, por lo que no se guardó.", "alreadyPairedWslHost": "Este servidor ya está emparejado como \"{{name}}\". Orca lo gestiona como un host WSL, por lo que su emparejamiento no se puede reemplazar aquí.", - "alreadyPairedManagedDeployment": "Este servidor ya está emparejado como \"{{name}}\". Orca ejecuta este servidor en un host SSH por ti; su emparejamiento no se puede reemplazar ni eliminar aquí. Para retirarlo, ejecuta `orca environment stop --environment --yes` o usa Ajustes > Orca en tus hosts SSH; si el host ya no existe, ejecuta `orca environment forget --environment --yes`.", + "alreadyPairedManagedDeployment": "Este servidor ya está emparejado como \"{{name}}\". Orca ejecuta este servidor en un host SSH por ti; su emparejamiento no se puede reemplazar ni eliminar aquí. Para retirarlo, ejecuta `orca server stop --server --yes` o usa Ajustes > Orca en tus hosts SSH; si el host ya no existe, ejecuta `orca server forget --server --yes`.", "alreadyPairedSshAccessChangePending": "Este servidor ya está emparejado como \"{{name}}\". El cambio de acceso SSH de este servidor no terminó. Reinténtalo o cancélalo en Ajustes > Servidores remotos de Orca > Acceso SSH para servidores emparejados antes de reemplazar su emparejamiento o eliminarlo.", "alreadyPairedSshAccessLinked": "Este servidor ya está emparejado como \"{{name}}\". Desvincula el acceso SSH de este servidor en Ajustes > Servidores remotos de Orca > Acceso SSH para servidores emparejados antes de reemplazar su emparejamiento o eliminarlo.", "alreadyPairedAddAgain": "Este servidor ya está emparejado como \"{{name}}\". Para actualizar su conexión, vuelve a añadirlo en Ajustes > Servidores remotos de Orca.", diff --git a/src/renderer/src/i18n/locales/fr.json b/src/renderer/src/i18n/locales/fr.json index 0cc2a499b89..7c35951d69d 100644 --- a/src/renderer/src/i18n/locales/fr.json +++ b/src/renderer/src/i18n/locales/fr.json @@ -23134,13 +23134,13 @@ "remoteServerPairingErrors": { "invalidPairingCode": "Code d’appairage invalide. Une URL orca://pair?... ou des données d’appairage brutes sont attendues.", "selfPairingCode": "Ce code d’appairage concerne cette instance même d’Orca. Générez plutôt le code sur l’autre ordinateur.", - "managedDeployment": "Orca exécute ce serveur pour vous sur un hôte SSH ; son appairage ne peut être ni remplacé ni supprimé ici. Pour le mettre hors service, exécutez `orca environment stop --environment --yes` ou utilisez Paramètres > Orca sur vos hôtes SSH ; si l’hôte n’existe plus, exécutez `orca environment forget --environment --yes`.", + "managedDeployment": "Orca exécute ce serveur pour vous sur un hôte SSH ; son appairage ne peut être ni remplacé ni supprimé ici. Pour le mettre hors service, exécutez `orca server stop --server --yes` ou utilisez Paramètres > Orca sur vos hôtes SSH ; si l’hôte n’existe plus, exécutez `orca server forget --server --yes`.", "sshAccessChangePending": "La modification de l’accès SSH de ce serveur n’a pas abouti. Réessayez ou annulez-la dans Paramètres > Serveurs Orca distants > Accès SSH aux serveurs appairés avant de remplacer son appairage ou de le supprimer.", "sshAccessLinked": "Dissociez l’accès SSH de ce serveur dans Paramètres > Serveurs Orca distants > Accès SSH aux serveurs appairés avant de remplacer son appairage ou de le supprimer.", "alreadyPairedCloudWorkspace": "Ce serveur est déjà appairé sous le nom « {{name}} ». Il appartient à un espace de travail cloud, qui l’appaire à nouveau à chaque reprise.", "alreadyPairedCloudIdentity": "Ce serveur est déjà appairé sous le nom « {{name}} ». Le serveur de l’espace de travail cloud réutilise l’identité de ce serveur ; il n’a donc pas été enregistré.", "alreadyPairedWslHost": "Ce serveur est déjà appairé sous le nom « {{name}} ». Orca le gère comme un hôte WSL ; son appairage ne peut donc pas être remplacé ici.", - "alreadyPairedManagedDeployment": "Ce serveur est déjà appairé sous le nom « {{name}} ». Orca exécute ce serveur pour vous sur un hôte SSH ; son appairage ne peut être ni remplacé ni supprimé ici. Pour le mettre hors service, exécutez `orca environment stop --environment --yes` ou utilisez Paramètres > Orca sur vos hôtes SSH ; si l’hôte n’existe plus, exécutez `orca environment forget --environment --yes`.", + "alreadyPairedManagedDeployment": "Ce serveur est déjà appairé sous le nom « {{name}} ». Orca exécute ce serveur pour vous sur un hôte SSH ; son appairage ne peut être ni remplacé ni supprimé ici. Pour le mettre hors service, exécutez `orca server stop --server --yes` ou utilisez Paramètres > Orca sur vos hôtes SSH ; si l’hôte n’existe plus, exécutez `orca server forget --server --yes`.", "alreadyPairedSshAccessChangePending": "Ce serveur est déjà appairé sous le nom « {{name}} ». La modification de l’accès SSH de ce serveur n’a pas abouti. Réessayez ou annulez-la dans Paramètres > Serveurs Orca distants > Accès SSH aux serveurs appairés avant de remplacer son appairage ou de le supprimer.", "alreadyPairedSshAccessLinked": "Ce serveur est déjà appairé sous le nom « {{name}} ». Dissociez l’accès SSH de ce serveur dans Paramètres > Serveurs Orca distants > Accès SSH aux serveurs appairés avant de remplacer son appairage ou de le supprimer.", "alreadyPairedAddAgain": "Ce serveur est déjà appairé sous le nom « {{name}} ». Pour mettre à jour sa connexion, ajoutez-le à nouveau dans Paramètres > Serveurs Orca distants.", diff --git a/src/renderer/src/i18n/locales/ja.json b/src/renderer/src/i18n/locales/ja.json index b8623ebda27..3ba170f93e9 100644 --- a/src/renderer/src/i18n/locales/ja.json +++ b/src/renderer/src/i18n/locales/ja.json @@ -22451,13 +22451,13 @@ "remoteServerPairingErrors": { "invalidPairingCode": "ペアリングコードが無効です。orca://pair?... 形式の URL または生のペアリングデータが必要です。", "selfPairingCode": "このペアリングコードは、この Orca 自身のものです。もう一方のコンピューターでコードを生成してください。", - "managedDeployment": "Orca が SSH ホスト上でこのサーバーを実行しているため、ここではペアリングを置き換えたり解除したりできません。廃止するには `orca environment stop --environment --yes` を実行するか、設定 > SSH ホスト上の Orca を使用してください。ホストが存在しない場合は `orca environment forget --environment --yes` を実行してください。", + "managedDeployment": "Orca が SSH ホスト上でこのサーバーを実行しているため、ここではペアリングを置き換えたり解除したりできません。廃止するには `orca server stop --server --yes` を実行するか、設定 > SSH ホスト上の Orca を使用してください。ホストが存在しない場合は `orca server forget --server --yes` を実行してください。", "sshAccessChangePending": "このサーバーの SSH アクセスの変更が完了しませんでした。ペアリングの置き換えやサーバーの削除を行う前に、設定 > リモート Orca サーバー > ペアリング済みサーバーの SSH アクセスで再試行するかキャンセルしてください。", "sshAccessLinked": "設定 > リモート Orca サーバー > ペアリング済みサーバーの SSH アクセスでこのサーバーの SSH アクセスのリンクを解除してから、ペアリングを置き換えるかサーバーを削除してください。", "alreadyPairedCloudWorkspace": "このサーバーはすでに「{{name}}」としてペアリングされています。クラウドワークスペースに属しており、ワークスペースの再開時に再びペアリングされます。", "alreadyPairedCloudIdentity": "このサーバーはすでに「{{name}}」としてペアリングされています。クラウドワークスペースのサーバーがそのサーバーの識別情報を再利用しているため、保存されませんでした。", "alreadyPairedWslHost": "このサーバーはすでに「{{name}}」としてペアリングされています。Orca が WSL ホストとして管理しているため、ここではペアリングを置き換えられません。", - "alreadyPairedManagedDeployment": "このサーバーはすでに「{{name}}」としてペアリングされています。Orca が SSH ホスト上でこのサーバーを実行しているため、ここではペアリングを置き換えたり解除したりできません。廃止するには `orca environment stop --environment --yes` を実行するか、設定 > SSH ホスト上の Orca を使用してください。ホストが存在しない場合は `orca environment forget --environment --yes` を実行してください。", + "alreadyPairedManagedDeployment": "このサーバーはすでに「{{name}}」としてペアリングされています。Orca が SSH ホスト上でこのサーバーを実行しているため、ここではペアリングを置き換えたり解除したりできません。廃止するには `orca server stop --server --yes` を実行するか、設定 > SSH ホスト上の Orca を使用してください。ホストが存在しない場合は `orca server forget --server --yes` を実行してください。", "alreadyPairedSshAccessChangePending": "このサーバーはすでに「{{name}}」としてペアリングされています。このサーバーの SSH アクセスの変更が完了しませんでした。ペアリングの置き換えやサーバーの削除を行う前に、設定 > リモート Orca サーバー > ペアリング済みサーバーの SSH アクセスで再試行するかキャンセルしてください。", "alreadyPairedSshAccessLinked": "このサーバーはすでに「{{name}}」としてペアリングされています。設定 > リモート Orca サーバー > ペアリング済みサーバーの SSH アクセスでこのサーバーの SSH アクセスのリンクを解除してから、ペアリングを置き換えるかサーバーを削除してください。", "alreadyPairedAddAgain": "このサーバーはすでに「{{name}}」としてペアリングされています。接続情報を更新するには、設定 > リモート Orca サーバーで再度追加してください。", diff --git a/src/renderer/src/i18n/locales/ko.json b/src/renderer/src/i18n/locales/ko.json index 72076ace398..f8d6168599e 100644 --- a/src/renderer/src/i18n/locales/ko.json +++ b/src/renderer/src/i18n/locales/ko.json @@ -22451,13 +22451,13 @@ "remoteServerPairingErrors": { "invalidPairingCode": "잘못된 페어링 코드입니다. orca://pair?... URL 또는 원시 페어링 데이터가 필요합니다.", "selfPairingCode": "이 페어링 코드는 현재 Orca 인스턴스용입니다. 다른 컴퓨터에서 코드를 생성하세요.", - "managedDeployment": "Orca가 SSH 호스트에서 이 서버를 실행하므로 여기서는 페어링을 교체하거나 제거할 수 없습니다. 사용을 중단하려면 `orca environment stop --environment --yes` 명령을 실행하거나 설정 > SSH 호스트의 Orca를 사용하세요. 호스트가 더 이상 존재하지 않으면 `orca environment forget --environment --yes` 명령을 실행하세요.", + "managedDeployment": "Orca가 SSH 호스트에서 이 서버를 실행하므로 여기서는 페어링을 교체하거나 제거할 수 없습니다. 사용을 중단하려면 `orca server stop --server --yes` 명령을 실행하거나 설정 > SSH 호스트의 Orca를 사용하세요. 호스트가 더 이상 존재하지 않으면 `orca server forget --server --yes` 명령을 실행하세요.", "sshAccessChangePending": "이 서버의 SSH 액세스 변경이 완료되지 않았습니다. 페어링을 교체하거나 서버를 제거하기 전에 설정 > 원격 Orca 서버 > 페어링된 서버의 SSH 액세스에서 다시 시도하거나 취소하세요.", "sshAccessLinked": "설정 > 원격 Orca 서버 > 페어링된 서버의 SSH 액세스에서 이 서버의 SSH 액세스 연결을 해제한 후 페어링을 교체하거나 서버를 제거하세요.", "alreadyPairedCloudWorkspace": "이 서버는 이미 \"{{name}}\"(으)로 페어링되어 있습니다. 클라우드 워크스페이스에 속해 있으며 워크스페이스가 재개되면 다시 페어링됩니다.", "alreadyPairedCloudIdentity": "이 서버는 이미 \"{{name}}\"(으)로 페어링되어 있습니다. 클라우드 워크스페이스의 서버가 해당 서버의 ID를 재사용하므로 저장되지 않았습니다.", "alreadyPairedWslHost": "이 서버는 이미 \"{{name}}\"(으)로 페어링되어 있습니다. Orca가 WSL 호스트로 관리하므로 여기서는 페어링을 교체할 수 없습니다.", - "alreadyPairedManagedDeployment": "이 서버는 이미 \"{{name}}\"(으)로 페어링되어 있습니다. Orca가 SSH 호스트에서 이 서버를 실행하므로 여기서는 페어링을 교체하거나 제거할 수 없습니다. 사용을 중단하려면 `orca environment stop --environment --yes` 명령을 실행하거나 설정 > SSH 호스트의 Orca를 사용하세요. 호스트가 더 이상 존재하지 않으면 `orca environment forget --environment --yes` 명령을 실행하세요.", + "alreadyPairedManagedDeployment": "이 서버는 이미 \"{{name}}\"(으)로 페어링되어 있습니다. Orca가 SSH 호스트에서 이 서버를 실행하므로 여기서는 페어링을 교체하거나 제거할 수 없습니다. 사용을 중단하려면 `orca server stop --server --yes` 명령을 실행하거나 설정 > SSH 호스트의 Orca를 사용하세요. 호스트가 더 이상 존재하지 않으면 `orca server forget --server --yes` 명령을 실행하세요.", "alreadyPairedSshAccessChangePending": "이 서버는 이미 \"{{name}}\"(으)로 페어링되어 있습니다. 이 서버의 SSH 액세스 변경이 완료되지 않았습니다. 페어링을 교체하거나 서버를 제거하기 전에 설정 > 원격 Orca 서버 > 페어링된 서버의 SSH 액세스에서 다시 시도하거나 취소하세요.", "alreadyPairedSshAccessLinked": "이 서버는 이미 \"{{name}}\"(으)로 페어링되어 있습니다. 설정 > 원격 Orca 서버 > 페어링된 서버의 SSH 액세스에서 이 서버의 SSH 액세스 연결을 해제한 후 페어링을 교체하거나 서버를 제거하세요.", "alreadyPairedAddAgain": "이 서버는 이미 \"{{name}}\"(으)로 페어링되어 있습니다. 연결 정보를 업데이트하려면 설정 > 원격 Orca 서버에서 다시 추가하세요.", diff --git a/src/renderer/src/i18n/locales/pt.json b/src/renderer/src/i18n/locales/pt.json index 140f629d103..99c5db268b8 100644 --- a/src/renderer/src/i18n/locales/pt.json +++ b/src/renderer/src/i18n/locales/pt.json @@ -23107,13 +23107,13 @@ "remoteServerPairingErrors": { "invalidPairingCode": "Código de pareamento inválido. Era esperada uma URL orca://pair?... ou dados de pareamento sem URL.", "selfPairingCode": "Este código de pareamento é desta própria instância do Orca. Gere o código no outro computador.", - "managedDeployment": "O Orca executa este servidor para você em um host SSH; o pareamento não pode ser substituído nem removido aqui. Para desativá-lo, execute `orca environment stop --environment --yes` ou use Configurações > Orca nos seus hosts SSH; se o host não existir mais, execute `orca environment forget --environment --yes`.", + "managedDeployment": "O Orca executa este servidor para você em um host SSH; o pareamento não pode ser substituído nem removido aqui. Para desativá-lo, execute `orca server stop --server --yes` ou use Configurações > Orca nos seus hosts SSH; se o host não existir mais, execute `orca server forget --server --yes`.", "sshAccessChangePending": "A alteração do acesso SSH deste servidor não foi concluída. Tente novamente ou cancele em Configurações > Servidores Orca Remotos > Acesso SSH para servidores pareados antes de substituir o pareamento ou remover o servidor.", "sshAccessLinked": "Desvincule o acesso SSH deste servidor em Configurações > Servidores Orca Remotos > Acesso SSH para servidores pareados antes de substituir o pareamento ou removê-lo.", "alreadyPairedCloudWorkspace": "Este servidor já está pareado como \"{{name}}\". Ele pertence a um espaço de trabalho na nuvem, que o pareia novamente ao ser retomado.", "alreadyPairedCloudIdentity": "Este servidor já está pareado como \"{{name}}\". O servidor do espaço de trabalho na nuvem reutiliza a identidade desse servidor, por isso não foi salvo.", "alreadyPairedWslHost": "Este servidor já está pareado como \"{{name}}\". O Orca o gerencia como um host WSL, por isso o pareamento não pode ser substituído aqui.", - "alreadyPairedManagedDeployment": "Este servidor já está pareado como \"{{name}}\". O Orca executa este servidor para você em um host SSH; o pareamento não pode ser substituído nem removido aqui. Para desativá-lo, execute `orca environment stop --environment --yes` ou use Configurações > Orca nos seus hosts SSH; se o host não existir mais, execute `orca environment forget --environment --yes`.", + "alreadyPairedManagedDeployment": "Este servidor já está pareado como \"{{name}}\". O Orca executa este servidor para você em um host SSH; o pareamento não pode ser substituído nem removido aqui. Para desativá-lo, execute `orca server stop --server --yes` ou use Configurações > Orca nos seus hosts SSH; se o host não existir mais, execute `orca server forget --server --yes`.", "alreadyPairedSshAccessChangePending": "Este servidor já está pareado como \"{{name}}\". A alteração do acesso SSH deste servidor não foi concluída. Tente novamente ou cancele em Configurações > Servidores Orca Remotos > Acesso SSH para servidores pareados antes de substituir o pareamento ou remover o servidor.", "alreadyPairedSshAccessLinked": "Este servidor já está pareado como \"{{name}}\". Desvincule o acesso SSH deste servidor em Configurações > Servidores Orca Remotos > Acesso SSH para servidores pareados antes de substituir o pareamento ou removê-lo.", "alreadyPairedAddAgain": "Este servidor já está pareado como \"{{name}}\". Para atualizar a conexão, adicione-o novamente em Configurações > Servidores Orca Remotos.", diff --git a/src/renderer/src/i18n/locales/ru.json b/src/renderer/src/i18n/locales/ru.json index f717776e4f7..74d2c48666a 100644 --- a/src/renderer/src/i18n/locales/ru.json +++ b/src/renderer/src/i18n/locales/ru.json @@ -23504,13 +23504,13 @@ "remoteServerPairingErrors": { "invalidPairingCode": "Неверный код сопряжения. Ожидается URL вида orca://pair?... или данные сопряжения без ссылки.", "selfPairingCode": "Этот код сопряжения относится к этому же экземпляру Orca. Создайте код на другом компьютере.", - "managedDeployment": "Orca запускает этот сервер для вас на SSH-сервере; здесь нельзя заменить или удалить его сопряжение. Чтобы вывести его из эксплуатации, выполните `orca environment stop --environment --yes` или откройте Настройки > Orca на ваших SSH-серверах; если SSH-сервер больше не существует, выполните `orca environment forget --environment --yes`.", + "managedDeployment": "Orca запускает этот сервер для вас на SSH-сервере; здесь нельзя заменить или удалить его сопряжение. Чтобы вывести его из эксплуатации, выполните `orca server stop --server --yes` или откройте Настройки > Orca на ваших SSH-серверах; если SSH-сервер больше не существует, выполните `orca server forget --server --yes`.", "sshAccessChangePending": "Изменение доступа SSH к этому серверу не завершено. Повторите попытку или отмените изменение в разделе Настройки > Удалённые серверы Orca > Доступ SSH к сопряжённым серверам, прежде чем заменять сопряжение или удалять сервер.", "sshAccessLinked": "Отвяжите доступ SSH к этому серверу в разделе Настройки > Удалённые серверы Orca > Доступ SSH к сопряжённым серверам, прежде чем заменять сопряжение или удалять сервер.", "alreadyPairedCloudWorkspace": "Этот сервер уже сопряжён как «{{name}}». Он принадлежит облачному рабочему пространству, которое повторно сопрягает его при возобновлении работы.", "alreadyPairedCloudIdentity": "Этот сервер уже сопряжён как «{{name}}». Сервер облачного рабочего пространства повторно использует идентификатор этого сервера, поэтому он не был сохранён.", "alreadyPairedWslHost": "Этот сервер уже сопряжён как «{{name}}». Orca управляет им как сервером WSL, поэтому здесь нельзя заменить его сопряжение.", - "alreadyPairedManagedDeployment": "Этот сервер уже сопряжён как «{{name}}». Orca запускает этот сервер для вас на SSH-сервере; здесь нельзя заменить или удалить его сопряжение. Чтобы вывести его из эксплуатации, выполните `orca environment stop --environment --yes` или откройте Настройки > Orca на ваших SSH-серверах; если SSH-сервер больше не существует, выполните `orca environment forget --environment --yes`.", + "alreadyPairedManagedDeployment": "Этот сервер уже сопряжён как «{{name}}». Orca запускает этот сервер для вас на SSH-сервере; здесь нельзя заменить или удалить его сопряжение. Чтобы вывести его из эксплуатации, выполните `orca server stop --server --yes` или откройте Настройки > Orca на ваших SSH-серверах; если SSH-сервер больше не существует, выполните `orca server forget --server --yes`.", "alreadyPairedSshAccessChangePending": "Этот сервер уже сопряжён как «{{name}}». Изменение доступа SSH к этому серверу не завершено. Повторите попытку или отмените изменение в разделе Настройки > Удалённые серверы Orca > Доступ SSH к сопряжённым серверам, прежде чем заменять сопряжение или удалять сервер.", "alreadyPairedSshAccessLinked": "Этот сервер уже сопряжён как «{{name}}». Отвяжите доступ SSH к этому серверу в разделе Настройки > Удалённые серверы Orca > Доступ SSH к сопряжённым серверам, прежде чем заменять сопряжение или удалять сервер.", "alreadyPairedAddAgain": "Этот сервер уже сопряжён как «{{name}}». Чтобы обновить подключение, добавьте его снова в разделе Настройки > Удалённые серверы Orca.", diff --git a/src/renderer/src/i18n/locales/tr.json b/src/renderer/src/i18n/locales/tr.json index a1ed138def4..919b765684a 100644 --- a/src/renderer/src/i18n/locales/tr.json +++ b/src/renderer/src/i18n/locales/tr.json @@ -22745,13 +22745,13 @@ "remoteServerPairingErrors": { "invalidPairingCode": "Geçersiz eşleştirme kodu. orca://pair?... biçiminde bir URL veya salt eşleştirme verisi bekleniyor.", "selfPairingCode": "Bu eşleştirme kodu bu Orca örneğinin kendisi içindir. Kodu diğer bilgisayarda oluşturun.", - "managedDeployment": "Orca bu sunucuyu sizin için bir SSH sunucusunda çalıştırır; eşleştirmesi burada değiştirilemez veya kaldırılamaz. Hizmetten çıkarmak için `orca environment stop --environment --yes` komutunu çalıştırın ya da Ayarlar > SSH sunucularınızda Orca bölümünü kullanın; SSH sunucusu artık yoksa `orca environment forget --environment --yes` komutunu çalıştırın.", + "managedDeployment": "Orca bu sunucuyu sizin için bir SSH sunucusunda çalıştırır; eşleştirmesi burada değiştirilemez veya kaldırılamaz. Hizmetten çıkarmak için `orca server stop --server --yes` komutunu çalıştırın ya da Ayarlar > SSH sunucularınızda Orca bölümünü kullanın; SSH sunucusu artık yoksa `orca server forget --server --yes` komutunu çalıştırın.", "sshAccessChangePending": "Bu sunucunun SSH erişimi değişikliği tamamlanamadı. Eşleştirmesini değiştirmeden veya sunucuyu kaldırmadan önce Ayarlar > Uzak Orca Sunucuları > Eşleştirilmiş sunucular için SSH erişimi bölümünden yeniden deneyin veya iptal edin.", "sshAccessLinked": "Eşleştirmesini değiştirmeden veya sunucuyu kaldırmadan önce Ayarlar > Uzak Orca Sunucuları > Eşleştirilmiş sunucular için SSH erişimi bölümünden bu sunucunun SSH erişimi bağlantısını kaldırın.", "alreadyPairedCloudWorkspace": "Bu sunucu zaten \"{{name}}\" olarak eşleştirilmiş. Devam ettirildiğinde sunucuyu yeniden eşleştiren bir bulut çalışma alanına ait.", "alreadyPairedCloudIdentity": "Bu sunucu zaten \"{{name}}\" olarak eşleştirilmiş. Bulut çalışma alanının sunucusu bu sunucunun kimliğini yeniden kullandığı için kaydedilmedi.", "alreadyPairedWslHost": "Bu sunucu zaten \"{{name}}\" olarak eşleştirilmiş. Orca bu sunucuyu bir WSL ana makinesi olarak yönetir; bu nedenle eşleştirmesi burada değiştirilemez.", - "alreadyPairedManagedDeployment": "Bu sunucu zaten \"{{name}}\" olarak eşleştirilmiş. Orca bu sunucuyu sizin için bir SSH sunucusunda çalıştırır; eşleştirmesi burada değiştirilemez veya kaldırılamaz. Hizmetten çıkarmak için `orca environment stop --environment --yes` komutunu çalıştırın ya da Ayarlar > SSH sunucularınızda Orca bölümünü kullanın; SSH sunucusu artık yoksa `orca environment forget --environment --yes` komutunu çalıştırın.", + "alreadyPairedManagedDeployment": "Bu sunucu zaten \"{{name}}\" olarak eşleştirilmiş. Orca bu sunucuyu sizin için bir SSH sunucusunda çalıştırır; eşleştirmesi burada değiştirilemez veya kaldırılamaz. Hizmetten çıkarmak için `orca server stop --server --yes` komutunu çalıştırın ya da Ayarlar > SSH sunucularınızda Orca bölümünü kullanın; SSH sunucusu artık yoksa `orca server forget --server --yes` komutunu çalıştırın.", "alreadyPairedSshAccessChangePending": "Bu sunucu zaten \"{{name}}\" olarak eşleştirilmiş. Bu sunucunun SSH erişimi değişikliği tamamlanamadı. Eşleştirmesini değiştirmeden veya sunucuyu kaldırmadan önce Ayarlar > Uzak Orca Sunucuları > Eşleştirilmiş sunucular için SSH erişimi bölümünden yeniden deneyin veya iptal edin.", "alreadyPairedSshAccessLinked": "Bu sunucu zaten \"{{name}}\" olarak eşleştirilmiş. Eşleştirmesini değiştirmeden veya sunucuyu kaldırmadan önce Ayarlar > Uzak Orca Sunucuları > Eşleştirilmiş sunucular için SSH erişimi bölümünden bu sunucunun SSH erişimi bağlantısını kaldırın.", "alreadyPairedAddAgain": "Bu sunucu zaten \"{{name}}\" olarak eşleştirilmiş. Bağlantısını güncellemek için Ayarlar > Uzak Orca Sunucuları bölümünden yeniden ekleyin.", diff --git a/src/renderer/src/i18n/locales/zh-Hant.json b/src/renderer/src/i18n/locales/zh-Hant.json index 2b2f51a0d7c..46d57e06e69 100644 --- a/src/renderer/src/i18n/locales/zh-Hant.json +++ b/src/renderer/src/i18n/locales/zh-Hant.json @@ -22430,13 +22430,13 @@ "remoteServerPairingErrors": { "invalidPairingCode": "配對碼無效。需要 orca://pair?... URL 或原始配對資料。", "selfPairingCode": "此配對碼是給目前這個 Orca 用的。請改在另一臺電腦上產生配對碼。", - "managedDeployment": "Orca 會在 SSH 主機上為你執行此伺服器;無法在此取代或移除其配對。若要停用,請執行 `orca environment stop --environment --yes`,或使用設定 > SSH 主機上的 Orca;若主機已不存在,請執行 `orca environment forget --environment --yes`。", + "managedDeployment": "Orca 會在 SSH 主機上為你執行此伺服器;無法在此取代或移除其配對。若要停用,請執行 `orca server stop --server --yes`,或使用設定 > SSH 主機上的 Orca;若主機已不存在,請執行 `orca server forget --server --yes`。", "sshAccessChangePending": "此伺服器的 SSH 存取變更未完成。取代配對或移除此伺服器前,請在設定 > 遠端 Orca 伺服器 > 已配對伺服器的 SSH 存取中重試或取消變更。", "sshAccessLinked": "取代配對或移除此伺服器前,請在設定 > 遠端 Orca 伺服器 > 已配對伺服器的 SSH 存取中解除此伺服器的 SSH 存取連結。", "alreadyPairedCloudWorkspace": "此伺服器已配對為「{{name}}」。它屬於雲端工作區,該工作區恢復執行時會再次與其配對。", "alreadyPairedCloudIdentity": "此伺服器已配對為「{{name}}」。雲端工作區的伺服器重複使用了該伺服器的身分,因此未儲存。", "alreadyPairedWslHost": "此伺服器已配對為「{{name}}」。Orca 將其作為 WSL 主機管理,因此無法在此取代其配對。", - "alreadyPairedManagedDeployment": "此伺服器已配對為「{{name}}」。Orca 會在 SSH 主機上為你執行此伺服器;無法在此取代或移除其配對。若要停用,請執行 `orca environment stop --environment --yes`,或使用設定 > SSH 主機上的 Orca;若主機已不存在,請執行 `orca environment forget --environment --yes`。", + "alreadyPairedManagedDeployment": "此伺服器已配對為「{{name}}」。Orca 會在 SSH 主機上為你執行此伺服器;無法在此取代或移除其配對。若要停用,請執行 `orca server stop --server --yes`,或使用設定 > SSH 主機上的 Orca;若主機已不存在,請執行 `orca server forget --server --yes`。", "alreadyPairedSshAccessChangePending": "此伺服器已配對為「{{name}}」。此伺服器的 SSH 存取變更未完成。取代配對或移除此伺服器前,請在設定 > 遠端 Orca 伺服器 > 已配對伺服器的 SSH 存取中重試或取消變更。", "alreadyPairedSshAccessLinked": "此伺服器已配對為「{{name}}」。取代配對或移除此伺服器前,請在設定 > 遠端 Orca 伺服器 > 已配對伺服器的 SSH 存取中解除此伺服器的 SSH 存取連結。", "alreadyPairedAddAgain": "此伺服器已配對為「{{name}}」。若要更新其連線,請在設定 > 遠端 Orca 伺服器中重新新增。", diff --git a/src/renderer/src/i18n/locales/zh.json b/src/renderer/src/i18n/locales/zh.json index 1e0ae4fc103..30cf3c5b52f 100644 --- a/src/renderer/src/i18n/locales/zh.json +++ b/src/renderer/src/i18n/locales/zh.json @@ -22451,13 +22451,13 @@ "remoteServerPairingErrors": { "invalidPairingCode": "配对码无效。需要 orca://pair?... URL 或原始配对数据。", "selfPairingCode": "这是当前 Orca 的配对码。请改在另一台计算机上生成配对码。", - "managedDeployment": "Orca 为你在 SSH 主机上运行此服务器;无法在此替换或移除其配对。要停用它,请运行 `orca environment stop --environment --yes`,或前往设置 > SSH 主机上的 Orca;如果主机已不存在,请运行 `orca environment forget --environment --yes`。", + "managedDeployment": "Orca 为你在 SSH 主机上运行此服务器;无法在此替换或移除其配对。要停用它,请运行 `orca server stop --server --yes`,或前往设置 > SSH 主机上的 Orca;如果主机已不存在,请运行 `orca server forget --server --yes`。", "sshAccessChangePending": "此服务器的 SSH 访问更改未完成。替换配对或移除此服务器之前,请在设置 > 远程 Orca 服务器 > 已配对服务器的 SSH 访问下重试或取消更改。", "sshAccessLinked": "替换配对或移除此服务器之前,请在设置 > 远程 Orca 服务器 > 已配对服务器的 SSH 访问下解除此服务器的 SSH 访问关联。", "alreadyPairedCloudWorkspace": "此服务器已作为“{{name}}”配对。它属于一个云工作区,该工作区恢复运行时会再次与其配对。", "alreadyPairedCloudIdentity": "此服务器已作为“{{name}}”配对。云工作区的服务器复用了该服务器的身份,因此未保存。", "alreadyPairedWslHost": "此服务器已作为“{{name}}”配对。Orca 将其作为 WSL 主机管理,因此无法在此替换其配对。", - "alreadyPairedManagedDeployment": "此服务器已作为“{{name}}”配对。Orca 为你在 SSH 主机上运行此服务器;无法在此替换或移除其配对。要停用它,请运行 `orca environment stop --environment --yes`,或前往设置 > SSH 主机上的 Orca;如果主机已不存在,请运行 `orca environment forget --environment --yes`。", + "alreadyPairedManagedDeployment": "此服务器已作为“{{name}}”配对。Orca 为你在 SSH 主机上运行此服务器;无法在此替换或移除其配对。要停用它,请运行 `orca server stop --server --yes`,或前往设置 > SSH 主机上的 Orca;如果主机已不存在,请运行 `orca server forget --server --yes`。", "alreadyPairedSshAccessChangePending": "此服务器已作为“{{name}}”配对。此服务器的 SSH 访问更改未完成。替换配对或移除此服务器之前,请在设置 > 远程 Orca 服务器 > 已配对服务器的 SSH 访问下重试或取消更改。", "alreadyPairedSshAccessLinked": "此服务器已作为“{{name}}”配对。替换配对或移除此服务器之前,请在设置 > 远程 Orca 服务器 > 已配对服务器的 SSH 访问下解除此服务器的 SSH 访问关联。", "alreadyPairedAddAgain": "此服务器已作为“{{name}}”配对。要更新其连接,请在设置 > 远程 Orca 服务器下重新添加。", diff --git a/src/shared/cli-argument-boundary.ts b/src/shared/cli-argument-boundary.ts index c1655091178..5026d524b13 100644 --- a/src/shared/cli-argument-boundary.ts +++ b/src/shared/cli-argument-boundary.ts @@ -1,5 +1,10 @@ -export const CLI_GLOBAL_VALUE_FLAGS: readonly string[] = ['pairing-code', 'environment'] +export const CLI_GLOBAL_VALUE_FLAGS: readonly string[] = ['pairing-code', 'server'] export const CLI_GLOBAL_FLAGS: readonly string[] = ['help', 'json', ...CLI_GLOBAL_VALUE_FLAGS] +/** Old flag spellings, accepted as input only and renamed to their canonical flag before validation. */ +export const CLI_FLAG_ALIASES: Readonly> = { + environment: 'server', + 'parent-environment': 'parent-server' +} export const CLI_BOOLEAN_FLAGS = new Set([ 'accept-changed-state', diff --git a/src/shared/remote-runtime/host-catalog/runtime-environment-catalog-channel.ts b/src/shared/remote-runtime/host-catalog/runtime-environment-catalog-channel.ts index 243b85ba91f..25f8a22fab3 100644 --- a/src/shared/remote-runtime/host-catalog/runtime-environment-catalog-channel.ts +++ b/src/shared/remote-runtime/host-catalog/runtime-environment-catalog-channel.ts @@ -1,2 +1,2 @@ -/** Main → renderer: the saved-server registry changed on disk, e.g. via `orca environment add`. */ +/** Main → renderer: the saved-server registry changed on disk, e.g. via `orca server add`. */ export const RUNTIME_ENVIRONMENT_CATALOG_CHANGED_CHANNEL = 'runtimeEnvironments:catalogChanged' diff --git a/src/shared/remote-runtime/pairing/remote-server-pairing-failure-copy.ts b/src/shared/remote-runtime/pairing/remote-server-pairing-failure-copy.ts index 2ef67412f09..89db234c1b4 100644 --- a/src/shared/remote-runtime/pairing/remote-server-pairing-failure-copy.ts +++ b/src/shared/remote-runtime/pairing/remote-server-pairing-failure-copy.ts @@ -5,7 +5,7 @@ export const REMOTE_SERVER_PAIRING_FAILURE_COPY = { selfPairingCode: 'This pairing code is for this Orca itself. Generate the code on the other computer instead.', managedDeployment: - 'Orca runs this server on an SSH host for you; its pairing cannot be replaced or removed here. To decommission it, run `orca environment stop --environment --yes` or use Settings > Orca on your SSH hosts; for a host that is gone, run `orca environment forget --environment --yes`.', + 'Orca runs this server on an SSH host for you; its pairing cannot be replaced or removed here. To decommission it, run `orca server stop --server --yes` or use Settings > Orca on your SSH hosts; for a host that is gone, run `orca server forget --server --yes`.', sshAccessChangePending: "This server's SSH access change didn't finish. Retry or cancel it under Settings > Remote Orca Servers > SSH access for paired servers before replacing its pairing or removing it.", sshAccessLinked: @@ -17,7 +17,7 @@ export const REMOTE_SERVER_PAIRING_FAILURE_COPY = { alreadyPairedWslHost: 'This server is already paired as "{{name}}". Orca manages it as a WSL host, so its pairing cannot be replaced here.', alreadyPairedManagedDeployment: - 'This server is already paired as "{{name}}". Orca runs this server on an SSH host for you; its pairing cannot be replaced or removed here. To decommission it, run `orca environment stop --environment --yes` or use Settings > Orca on your SSH hosts; for a host that is gone, run `orca environment forget --environment --yes`.', + 'This server is already paired as "{{name}}". Orca runs this server on an SSH host for you; its pairing cannot be replaced or removed here. To decommission it, run `orca server stop --server --yes` or use Settings > Orca on your SSH hosts; for a host that is gone, run `orca server forget --server --yes`.', alreadyPairedSshAccessChangePending: 'This server is already paired as "{{name}}". This server\'s SSH access change didn\'t finish. Retry or cancel it under Settings > Remote Orca Servers > SSH access for paired servers before replacing its pairing or removing it.', alreadyPairedSshAccessLinked: diff --git a/src/shared/rpc-contract/managed-server-params.ts b/src/shared/rpc-contract/managed-server-params.ts index 4cd482d2cfa..64cf16055ae 100644 --- a/src/shared/rpc-contract/managed-server-params.ts +++ b/src/shared/rpc-contract/managed-server-params.ts @@ -3,7 +3,7 @@ import { requiredString } from './rpc-param-primitives' /** A managed Orca server on this host, by environment name or id. */ export const ManagedServerSelector = z.object({ - selector: requiredString('Missing required --environment') + selector: requiredString('Missing required --server') }) export const ManagedServerRecover = ManagedServerSelector.extend({ diff --git a/src/shared/rpc-contract/recipe-vm-wake-params.ts b/src/shared/rpc-contract/recipe-vm-wake-params.ts index 26a1398c346..bc77f1be260 100644 --- a/src/shared/rpc-contract/recipe-vm-wake-params.ts +++ b/src/shared/rpc-contract/recipe-vm-wake-params.ts @@ -3,5 +3,5 @@ import { requiredString } from './rpc-param-primitives' /** A saved runtime environment served by a recipe VM, by name or id. */ export const RecipeVmWakeParams = z.object({ - environment: requiredString('Missing required --environment') + environment: requiredString('Missing required --server') }) diff --git a/src/shared/runtime-session-contracts.ts b/src/shared/runtime-session-contracts.ts index 46eb0eab084..8839202e8ad 100644 --- a/src/shared/runtime-session-contracts.ts +++ b/src/shared/runtime-session-contracts.ts @@ -110,7 +110,8 @@ export type CliRuntimeState = | 'stale_bootstrap' export type CliStatusResult = { - target?: { kind: 'local' } | { kind: 'environment'; environment: string } + /** `server` is the saved selector, or `pairing-code` for a one-off connection. */ + target?: { kind: 'local' } | { kind: 'server'; server: string } app: { running: boolean pid: number | null diff --git a/src/shared/serve-option-validation.ts b/src/shared/serve-option-validation.ts index d00803c8ed3..d56e6260efa 100644 --- a/src/shared/serve-option-validation.ts +++ b/src/shared/serve-option-validation.ts @@ -67,6 +67,7 @@ const SERVE_VALUE_FLAG_NAMES = new Set([ '--project-root', '--serve-project-root', '--pairing-code', + '--server', '--environment' ])