Files
orca/src/cli/specs/orchestration.ts
T

157 lines
6.0 KiB
TypeScript

import type { CommandSpec } from '../args'
import { GLOBAL_FLAGS } from '../args'
export const ORCHESTRATION_COMMAND_SPECS: CommandSpec[] = [
{
path: ['orchestration', 'send'],
summary: 'Send an inter-agent message',
usage:
'orca orchestration send --to <handle> --subject <text> [--from <handle>] [--body <text>] [--type <type>] [--priority <level>] [--thread-id <id>] [--payload <json>] [--task-id <id>] [--dispatch-id <id>] [--files-modified <csv>] [--report-path <path>] [--phase <text>] [--json]',
allowedFlags: [
...GLOBAL_FLAGS,
'to',
'from',
'subject',
'body',
'type',
'priority',
'thread-id',
'payload',
'task-id',
'dispatch-id',
'files-modified',
'report-path',
'phase'
],
notes: [
'On Windows PowerShell, quote group addresses such as --to "@all" or --to "@worktree:<id>".',
'worker_done and heartbeat must target a concrete coordinator terminal handle; use status for broadcast updates.',
'Prefer --task-id/--dispatch-id/etc. over raw --payload JSON in worker commands; PowerShell strips JSON quotes easily.'
]
},
{
path: ['orchestration', 'check'],
summary: 'Check messages for a terminal',
usage:
'orca orchestration check [--terminal <handle>] [--unread | --all] [--types <type,...>] [--inject] [--wait] [--timeout-ms <n>] [--json]\n' +
' --unread (default): return only unread messages and mark them read.\n' +
' --all: return every message for the handle; does not mark read.\n' +
' --wait: block until a matching message arrives or --timeout-ms expires.\n' +
' Emits JSON heartbeat lines to stderr every 15s so the caller can\n' +
' tell the process is alive. Filter with `grep -v _heartbeat` or\n' +
' `jq "select(._heartbeat|not)"` when merging streams with 2>&1.',
allowedFlags: [
...GLOBAL_FLAGS,
'terminal',
'unread',
'all',
'types',
'inject',
'wait',
'timeout-ms'
],
notes: [
'On Windows PowerShell, quote comma-separated type filters, e.g. --types "worker_done,escalation".'
]
},
{
path: ['orchestration', 'reply'],
summary: 'Reply to a message',
usage: 'orca orchestration reply --id <msg_id> --body <text> [--from <handle>] [--json]',
allowedFlags: [...GLOBAL_FLAGS, 'id', 'body', 'from']
},
{
path: ['orchestration', 'inbox'],
summary: 'Show messages across (or for) recipients',
usage: 'orca orchestration inbox [--limit <n>] [--terminal <handle>] [--full] [--json]',
allowedFlags: [...GLOBAL_FLAGS, 'limit', 'terminal', 'full']
},
{
path: ['orchestration', 'task-create'],
summary: 'Create an orchestration task',
usage:
'orca orchestration task-create --spec <text> [--deps <json_array>] [--parent <task_id>] [--json]',
allowedFlags: [...GLOBAL_FLAGS, 'spec', 'deps', 'parent']
},
{
path: ['orchestration', 'task-list'],
summary: 'List orchestration tasks',
usage: 'orca orchestration task-list [--status <status>] [--ready] [--json]',
allowedFlags: [...GLOBAL_FLAGS, 'status', 'ready']
},
{
path: ['orchestration', 'task-update'],
summary: 'Update a task status',
usage:
'orca orchestration task-update --id <task_id> --status <status> [--result <json>] [--json]',
allowedFlags: [...GLOBAL_FLAGS, 'id', 'status', 'result'],
notes: ['Valid --status values: pending, ready, dispatched, completed, failed, blocked.']
},
{
path: ['orchestration', 'dispatch'],
summary: 'Dispatch a task to a terminal',
usage:
'orca orchestration dispatch --task <task_id> --to <handle> [--from <handle>] [--inject] [--dry-run] [--return-preamble] [--json]',
allowedFlags: [...GLOBAL_FLAGS, 'task', 'to', 'from', 'inject', 'dry-run', 'return-preamble']
},
{
path: ['orchestration', 'dispatch-show'],
summary: 'Show dispatch context for a task',
usage:
'orca orchestration dispatch-show --task <task_id> [--preamble] [--from <handle>] [--json]',
allowedFlags: [...GLOBAL_FLAGS, 'task', 'preamble', 'from']
},
{
path: ['orchestration', 'ask'],
summary: 'Ask the coordinator a question and block until answered',
usage:
'orca orchestration ask --to <handle> --question <text> [--options <csv>] [--timeout-ms <n>] [--from <handle>] [--json]',
allowedFlags: [...GLOBAL_FLAGS, 'to', 'question', 'options', 'timeout-ms', 'from']
},
{
path: ['orchestration', 'run'],
summary: 'Start the coordinator loop',
usage:
'orca orchestration run --spec <text> [--from <handle>] [--poll-interval-ms <n>] [--max-concurrent <n>] [--worktree <selector>] [--json]',
allowedFlags: [
...GLOBAL_FLAGS,
'spec',
'from',
'poll-interval-ms',
'max-concurrent',
'worktree'
]
},
{
path: ['orchestration', 'run-stop'],
summary: 'Stop the active coordinator run',
usage: 'orca orchestration run-stop [--json]',
allowedFlags: [...GLOBAL_FLAGS]
},
{
path: ['orchestration', 'gate-create'],
summary: 'Create a decision gate blocking a task',
usage:
'orca orchestration gate-create --task <task_id> --question <text> [--options <json_array>] [--json]',
allowedFlags: [...GLOBAL_FLAGS, 'task', 'question', 'options']
},
{
path: ['orchestration', 'gate-resolve'],
summary: 'Resolve a pending decision gate',
usage: 'orca orchestration gate-resolve --id <gate_id> --resolution <text> [--json]',
allowedFlags: [...GLOBAL_FLAGS, 'id', 'resolution']
},
{
path: ['orchestration', 'gate-list'],
summary: 'List decision gates',
usage: 'orca orchestration gate-list [--task <task_id>] [--status <status>] [--json]',
allowedFlags: [...GLOBAL_FLAGS, 'task', 'status']
},
{
path: ['orchestration', 'reset'],
summary: 'Reset orchestration state (one scope; bare command resets all)',
usage: 'orca orchestration reset [--all | --tasks | --messages] [--json]',
allowedFlags: [...GLOBAL_FLAGS, 'all', 'tasks', 'messages']
}
]