mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
Forget and Stop removed the managed server but left the SSH host's transport up with nothing serving it, so project setup offered the host and then failed with the raw connection id. The unlink now hangs up the host's transport inside its lifecycle, so every surface offers Connect (which sets a server up again) and a Connect queued behind the unlink still wins. The setup error names the host and its toast offers Connect, and the forget/stop help says the host is disconnected. Fixes #37767
92 lines
4.7 KiB
TypeScript
92 lines
4.7 KiB
TypeScript
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.'
|
||
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.'
|
||
|
||
export const MANAGED_SERVER_COMMAND_SPECS: CommandSpec[] = [
|
||
{
|
||
path: ['environment', 'status'],
|
||
summary: 'Show a managed Orca server’s active version, terminals and pending work',
|
||
usage: 'orca environment status --environment <selector> [--json]',
|
||
allowedFlags: [...LOCAL_COMMAND_FLAGS, 'environment'],
|
||
notes: [SELECTOR_NOTE, DESKTOP_NOTE],
|
||
examples: ['orca environment status --environment build-box']
|
||
},
|
||
{
|
||
path: ['environment', 'update'],
|
||
summary: 'Update a managed Orca server to this build’s version',
|
||
usage: 'orca environment update --environment <selector> [--force] [--json]',
|
||
allowedFlags: [...LOCAL_COMMAND_FLAGS, 'environment', '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']
|
||
},
|
||
{
|
||
path: ['environment', 'rollback'],
|
||
destructive: true,
|
||
summary: 'Roll a managed Orca server back to its previous version',
|
||
usage: 'orca environment rollback --environment <selector> [--json]',
|
||
allowedFlags: [...LOCAL_COMMAND_FLAGS, 'environment'],
|
||
notes: [SELECTOR_NOTE, DESKTOP_NOTE]
|
||
},
|
||
{
|
||
path: ['environment', 'recover'],
|
||
summary: 'Finish or undo a managed Orca server’s interrupted update, rollback or stop',
|
||
usage:
|
||
'orca environment recover --environment <selector> [--accept-changed-state --yes] [--json]',
|
||
allowedFlags: [...LOCAL_COMMAND_FLAGS, 'environment', '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'
|
||
]
|
||
},
|
||
{
|
||
path: ['environment', 'stop'],
|
||
destructive: true,
|
||
summary: 'Stop a managed Orca server and unlink it from this machine (decommission)',
|
||
usage: 'orca environment stop --environment <selector> --yes [--json]',
|
||
allowedFlags: [...LOCAL_COMMAND_FLAGS, 'environment', '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.',
|
||
SELECTOR_NOTE,
|
||
DESKTOP_NOTE
|
||
],
|
||
examples: ['orca environment stop --environment build-box --yes']
|
||
},
|
||
{
|
||
path: ['environment', 'forget'],
|
||
destructive: true,
|
||
summary: 'Unlink a managed Orca server whose SSH host is gone, without stopping it',
|
||
usage: 'orca environment forget --environment <selector> --yes [--json]',
|
||
allowedFlags: [...LOCAL_COMMAND_FLAGS, 'environment', '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.',
|
||
'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']
|
||
},
|
||
{
|
||
path: ['environment', 'cancel-stop'],
|
||
summary: 'Withdraw a managed Orca server stop that orcad has not acted on yet',
|
||
usage: 'orca environment cancel-stop --environment <selector> [--json]',
|
||
allowedFlags: [...LOCAL_COMMAND_FLAGS, 'environment'],
|
||
notes: [SELECTOR_NOTE, DESKTOP_NOTE]
|
||
}
|
||
]
|