mirror of
https://github.com/stablyai/orca.git
synced 2026-11-01 17:47:40 +00:00
* chore: shorten process-host comments * chore: audit CLI parsing and host-routing comments * chore: remove stale host-selector restriction comment * chore: shorten remaining CLI root comments --------- Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
22 lines
702 B
TypeScript
22 lines
702 B
TypeScript
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
|
|
|
|
/** 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
|
|
)
|
|
}
|
|
}
|
|
}
|