mirror of
https://github.com/stablyai/orca.git
synced 2026-11-16 10:58:10 +00:00
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.
22 lines
696 B
TypeScript
22 lines
696 B
TypeScript
import { RuntimeClientError } from './runtime/types'
|
|
|
|
// 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 "--<flag> does not retarget …" with the command's actual scope. */
|
|
export function rejectRemoteSelectionFlags(
|
|
flags: ReadonlyMap<string, string | boolean>,
|
|
suffix: string,
|
|
data?: Record<string, unknown>
|
|
): void {
|
|
for (const flag of REMOTE_SELECTION_FLAGS) {
|
|
if (flags.has(flag)) {
|
|
throw new RuntimeClientError(
|
|
'invalid_argument',
|
|
`\`--${flag}\` does not retarget ${suffix}`,
|
|
data
|
|
)
|
|
}
|
|
}
|
|
}
|