@maiaos/cli 0.1.0-canary.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -0
- package/dist/address-space/address-space.d.ts +38 -0
- package/dist/address-space/address-space.js +130 -0
- package/dist/address-space/index.d.ts +2 -0
- package/dist/address-space/index.js +2 -0
- package/dist/agents/client.d.ts +171 -0
- package/dist/agents/client.js +8 -0
- package/dist/agents/commands.d.ts +7 -0
- package/dist/agents/commands.js +65 -0
- package/dist/agents/index.d.ts +3 -0
- package/dist/agents/index.js +3 -0
- package/dist/agents/input.d.ts +130 -0
- package/dist/agents/input.js +99 -0
- package/dist/agents/output/format.d.ts +8 -0
- package/dist/agents/output/format.js +47 -0
- package/dist/agents/output/index.d.ts +2 -0
- package/dist/agents/output/index.js +2 -0
- package/dist/agents/tree/index.d.ts +2 -0
- package/dist/agents/tree/index.js +2 -0
- package/dist/agents/tree/tree.d.ts +3 -0
- package/dist/agents/tree/tree.js +43 -0
- package/dist/bin/maia.NOTICES.txt +59 -0
- package/dist/bin/maia.cdx.json +168 -0
- package/dist/bin/maia.mjs +2 -0
- package/dist/bootstrap/exit.d.ts +14 -0
- package/dist/bootstrap/exit.js +42 -0
- package/dist/bootstrap/index.d.ts +3 -0
- package/dist/bootstrap/index.js +3 -0
- package/dist/bootstrap/process.d.ts +5 -0
- package/dist/bootstrap/process.js +23 -0
- package/dist/bootstrap/run.d.ts +25 -0
- package/dist/bootstrap/run.js +95 -0
- package/dist/bootstrap/stdio.d.ts +4 -0
- package/dist/bootstrap/stdio.js +9 -0
- package/dist/cli/cli.d.ts +17 -0
- package/dist/cli/cli.js +545 -0
- package/dist/cli/environment.d.ts +8 -0
- package/dist/cli/environment.js +12 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +2 -0
- package/dist/cli/services.d.ts +4 -0
- package/dist/cli/services.js +4 -0
- package/dist/command-line/context.d.ts +188 -0
- package/dist/command-line/context.js +2 -0
- package/dist/command-line/index.d.ts +7 -0
- package/dist/command-line/index.js +7 -0
- package/dist/command-line/input/arguments.d.ts +62 -0
- package/dist/command-line/input/arguments.js +232 -0
- package/dist/command-line/input/index.d.ts +4 -0
- package/dist/command-line/input/index.js +4 -0
- package/dist/command-line/input/prompt.d.ts +8 -0
- package/dist/command-line/input/prompt.js +44 -0
- package/dist/command-line/input/stdin-stream.d.ts +4 -0
- package/dist/command-line/input/stdin-stream.js +3 -0
- package/dist/command-line/input/stdin.d.ts +12 -0
- package/dist/command-line/input/stdin.js +24 -0
- package/dist/command-line/json-decoder.d.ts +3 -0
- package/dist/command-line/json-decoder.js +3 -0
- package/dist/command-line/json.d.ts +4 -0
- package/dist/command-line/json.js +27 -0
- package/dist/command-line/output.d.ts +64 -0
- package/dist/command-line/output.js +113 -0
- package/dist/command-line/rows.d.ts +12 -0
- package/dist/command-line/rows.js +41 -0
- package/dist/command-line/two-phase.d.ts +62 -0
- package/dist/command-line/two-phase.js +173 -0
- package/dist/command-receipt/command.d.ts +4 -0
- package/dist/command-receipt/command.js +59 -0
- package/dist/command-receipt/compact-list.d.ts +20 -0
- package/dist/command-receipt/compact-list.js +29 -0
- package/dist/command-receipt/index.d.ts +3 -0
- package/dist/command-receipt/index.js +3 -0
- package/dist/command-tree/commands.d.ts +17 -0
- package/dist/command-tree/commands.js +41 -0
- package/dist/command-tree/completion.d.ts +6 -0
- package/dist/command-tree/completion.js +36 -0
- package/dist/command-tree/grammar.d.ts +18 -0
- package/dist/command-tree/grammar.js +160 -0
- package/dist/command-tree/help.d.ts +62 -0
- package/dist/command-tree/help.js +220 -0
- package/dist/command-tree/index.d.ts +8 -0
- package/dist/command-tree/index.js +6 -0
- package/dist/command-tree/local.d.ts +3 -0
- package/dist/command-tree/local.js +138 -0
- package/dist/command-tree/placeholder.d.ts +4 -0
- package/dist/command-tree/placeholder.js +5 -0
- package/dist/command-tree/row.d.ts +31 -0
- package/dist/command-tree/row.js +2 -0
- package/dist/command-tree/suggest.d.ts +3 -0
- package/dist/command-tree/suggest.js +81 -0
- package/dist/command-tree/tree.d.ts +35 -0
- package/dist/command-tree/tree.js +140 -0
- package/dist/connection/access/client.d.ts +13 -0
- package/dist/connection/access/client.js +19 -0
- package/dist/connection/access/commands.d.ts +6 -0
- package/dist/connection/access/commands.js +60 -0
- package/dist/connection/access/format.d.ts +8 -0
- package/dist/connection/access/format.js +61 -0
- package/dist/connection/access/index.d.ts +3 -0
- package/dist/connection/access/index.js +3 -0
- package/dist/connection/access/input.d.ts +53 -0
- package/dist/connection/access/input.js +83 -0
- package/dist/connection/client.d.ts +790 -0
- package/dist/connection/client.js +36 -0
- package/dist/connection/commands.d.ts +15 -0
- package/dist/connection/commands.js +118 -0
- package/dist/connection/index.d.ts +8 -0
- package/dist/connection/index.js +8 -0
- package/dist/connection/input.d.ts +50 -0
- package/dist/connection/input.js +90 -0
- package/dist/connection/login.d.ts +13 -0
- package/dist/connection/login.js +69 -0
- package/dist/connection/output/format.d.ts +32 -0
- package/dist/connection/output/format.js +94 -0
- package/dist/connection/output/index.d.ts +2 -0
- package/dist/connection/output/index.js +2 -0
- package/dist/connection/resolve.d.ts +60 -0
- package/dist/connection/resolve.js +30 -0
- package/dist/connection/signin.d.ts +4 -0
- package/dist/connection/signin.js +32 -0
- package/dist/connection/system.d.ts +5 -0
- package/dist/connection/system.js +294 -0
- package/dist/connection/tree/index.d.ts +2 -0
- package/dist/connection/tree/index.js +2 -0
- package/dist/connection/tree/tree.d.ts +3 -0
- package/dist/connection/tree/tree.js +260 -0
- package/dist/container/client.d.ts +142 -0
- package/dist/container/client.js +11 -0
- package/dist/container/commands.d.ts +7 -0
- package/dist/container/commands.js +100 -0
- package/dist/container/index.d.ts +3 -0
- package/dist/container/index.js +3 -0
- package/dist/container/output/format.d.ts +11 -0
- package/dist/container/output/format.js +27 -0
- package/dist/container/output/index.d.ts +2 -0
- package/dist/container/output/index.js +2 -0
- package/dist/context/client.d.ts +7 -0
- package/dist/context/client.js +21 -0
- package/dist/context/commands.d.ts +3 -0
- package/dist/context/commands.js +27 -0
- package/dist/context/index.d.ts +3 -0
- package/dist/context/index.js +3 -0
- package/dist/dashboard/cockpit-client.d.ts +6 -0
- package/dist/dashboard/cockpit-client.js +27 -0
- package/dist/dashboard/cockpits.d.ts +29 -0
- package/dist/dashboard/cockpits.js +65 -0
- package/dist/dashboard/dashboard.d.ts +7 -0
- package/dist/dashboard/dashboard.js +47 -0
- package/dist/dashboard/draw.d.ts +15 -0
- package/dist/dashboard/draw.js +30 -0
- package/dist/dashboard/frame.d.ts +4 -0
- package/dist/dashboard/frame.js +15 -0
- package/dist/dashboard/index.d.ts +2 -0
- package/dist/dashboard/index.js +2 -0
- package/dist/dashboard/modes.d.ts +5 -0
- package/dist/dashboard/modes.js +16 -0
- package/dist/dashboard/node-connection.d.ts +15 -0
- package/dist/dashboard/node-connection.js +51 -0
- package/dist/dashboard/pi-tui.d.ts +6 -0
- package/dist/dashboard/pi-tui.js +35 -0
- package/dist/dashboard/status-bar.d.ts +4 -0
- package/dist/dashboard/status-bar.js +60 -0
- package/dist/dashboard/terminal.d.ts +53 -0
- package/dist/dashboard/terminal.js +165 -0
- package/dist/dashboard/tree-model.d.ts +28 -0
- package/dist/dashboard/tree-model.js +97 -0
- package/dist/dashboard/tree.d.ts +10 -0
- package/dist/dashboard/tree.js +76 -0
- package/dist/development/cli.d.ts +3 -0
- package/dist/development/cli.js +44 -0
- package/dist/execution/client.d.ts +25 -0
- package/dist/execution/client.js +24 -0
- package/dist/execution/index.d.ts +3 -0
- package/dist/execution/index.js +3 -0
- package/dist/execution/relocation.d.ts +6 -0
- package/dist/execution/relocation.js +123 -0
- package/dist/execution/tree/index.d.ts +2 -0
- package/dist/execution/tree/index.js +2 -0
- package/dist/execution/tree/tree.d.ts +3 -0
- package/dist/execution/tree/tree.js +137 -0
- package/dist/fleet/fleet.d.ts +70 -0
- package/dist/fleet/fleet.js +91 -0
- package/dist/fleet/index.d.ts +2 -0
- package/dist/fleet/index.js +2 -0
- package/dist/hold/client.d.ts +137 -0
- package/dist/hold/client.js +12 -0
- package/dist/hold/commands.d.ts +5 -0
- package/dist/hold/commands.js +91 -0
- package/dist/hold/index.d.ts +3 -0
- package/dist/hold/index.js +3 -0
- package/dist/hold/output/format.d.ts +11 -0
- package/dist/hold/output/format.js +25 -0
- package/dist/hold/output/index.d.ts +2 -0
- package/dist/hold/output/index.js +2 -0
- package/dist/hold/tree/index.d.ts +2 -0
- package/dist/hold/tree/index.js +2 -0
- package/dist/hold/tree/tree.d.ts +3 -0
- package/dist/hold/tree/tree.js +97 -0
- package/dist/import/client.d.ts +14 -0
- package/dist/import/client.js +16 -0
- package/dist/import/commands.d.ts +5 -0
- package/dist/import/commands.js +75 -0
- package/dist/import/index.d.ts +3 -0
- package/dist/import/index.js +3 -0
- package/dist/import/input.d.ts +16 -0
- package/dist/import/input.js +92 -0
- package/dist/import/output.d.ts +6 -0
- package/dist/import/output.js +37 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/integration/client.d.ts +1284 -0
- package/dist/integration/client.js +24 -0
- package/dist/integration/commands.d.ts +10 -0
- package/dist/integration/commands.js +104 -0
- package/dist/integration/index.d.ts +3 -0
- package/dist/integration/index.js +3 -0
- package/dist/integration/output.d.ts +22 -0
- package/dist/integration/output.js +20 -0
- package/dist/local-node/call.d.ts +7 -0
- package/dist/local-node/call.js +13 -0
- package/dist/local-node/client.d.ts +72 -0
- package/dist/local-node/client.js +253 -0
- package/dist/local-node/index.d.ts +4 -0
- package/dist/local-node/index.js +4 -0
- package/dist/local-node/wait.d.ts +10 -0
- package/dist/local-node/wait.js +17 -0
- package/dist/login/agent-provider.d.ts +20 -0
- package/dist/login/agent-provider.js +109 -0
- package/dist/login/commands.d.ts +4 -0
- package/dist/login/commands.js +94 -0
- package/dist/login/failure.d.ts +3 -0
- package/dist/login/failure.js +14 -0
- package/dist/login/gateway.d.ts +12 -0
- package/dist/login/gateway.js +71 -0
- package/dist/login/index.d.ts +3 -0
- package/dist/login/index.js +2 -0
- package/dist/login/menu.d.ts +4 -0
- package/dist/login/menu.js +105 -0
- package/dist/login/output/format.d.ts +16 -0
- package/dist/login/output/format.js +31 -0
- package/dist/login/output/index.d.ts +2 -0
- package/dist/login/output/index.js +2 -0
- package/dist/login/vendor-account.d.ts +95 -0
- package/dist/login/vendor-account.js +75 -0
- package/dist/login/vendor-input.d.ts +14 -0
- package/dist/login/vendor-input.js +36 -0
- package/dist/mcp/calls.d.ts +8 -0
- package/dist/mcp/calls.js +236 -0
- package/dist/mcp/commands.d.ts +12 -0
- package/dist/mcp/commands.js +47 -0
- package/dist/mcp/index.d.ts +2 -0
- package/dist/mcp/index.js +2 -0
- package/dist/mcp/routing.d.ts +24 -0
- package/dist/mcp/routing.js +188 -0
- package/dist/mcp/server.d.ts +20 -0
- package/dist/mcp/server.js +80 -0
- package/dist/orchestration/client.d.ts +78 -0
- package/dist/orchestration/client.js +89 -0
- package/dist/orchestration/commands.d.ts +14 -0
- package/dist/orchestration/commands.js +312 -0
- package/dist/orchestration/index.d.ts +3 -0
- package/dist/orchestration/index.js +3 -0
- package/dist/orchestration/output/compact-aggregate.d.ts +121 -0
- package/dist/orchestration/output/compact-aggregate.js +110 -0
- package/dist/orchestration/output/compact-run-list.d.ts +20 -0
- package/dist/orchestration/output/compact-run-list.js +16 -0
- package/dist/orchestration/output/human.d.ts +80 -0
- package/dist/orchestration/output/human.js +252 -0
- package/dist/orchestration/output/index.d.ts +4 -0
- package/dist/orchestration/output/index.js +4 -0
- package/dist/orchestration/tree/index.d.ts +2 -0
- package/dist/orchestration/tree/index.js +2 -0
- package/dist/orchestration/tree/tree.d.ts +3 -0
- package/dist/orchestration/tree/tree.js +142 -0
- package/dist/port-lease/client.d.ts +160 -0
- package/dist/port-lease/client.js +11 -0
- package/dist/port-lease/commands.d.ts +6 -0
- package/dist/port-lease/commands.js +17 -0
- package/dist/port-lease/index.d.ts +3 -0
- package/dist/port-lease/index.js +3 -0
- package/dist/port-lease/input.d.ts +65 -0
- package/dist/port-lease/input.js +67 -0
- package/dist/port-lease/output/format.d.ts +11 -0
- package/dist/port-lease/output/format.js +24 -0
- package/dist/port-lease/output/index.d.ts +2 -0
- package/dist/port-lease/output/index.js +2 -0
- package/dist/presentation/client.d.ts +10 -0
- package/dist/presentation/client.js +9 -0
- package/dist/presentation/commands.d.ts +6 -0
- package/dist/presentation/commands.js +78 -0
- package/dist/presentation/index.d.ts +4 -0
- package/dist/presentation/index.js +3 -0
- package/dist/presentation/output/format.d.ts +11 -0
- package/dist/presentation/output/format.js +33 -0
- package/dist/presentation/output/index.d.ts +3 -0
- package/dist/presentation/output/index.js +2 -0
- package/dist/project-guard/client.d.ts +88 -0
- package/dist/project-guard/client.js +7 -0
- package/dist/project-guard/commands.d.ts +4 -0
- package/dist/project-guard/commands.js +48 -0
- package/dist/project-guard/index.d.ts +3 -0
- package/dist/project-guard/index.js +3 -0
- package/dist/project-guard/input.d.ts +18 -0
- package/dist/project-guard/input.js +47 -0
- package/dist/project-guard/output/format.d.ts +11 -0
- package/dist/project-guard/output/format.js +35 -0
- package/dist/project-guard/output/index.d.ts +2 -0
- package/dist/project-guard/output/index.js +2 -0
- package/dist/project-workspace/client.d.ts +86 -0
- package/dist/project-workspace/client.js +159 -0
- package/dist/project-workspace/commands.d.ts +30 -0
- package/dist/project-workspace/commands.js +710 -0
- package/dist/project-workspace/index.d.ts +5 -0
- package/dist/project-workspace/index.js +5 -0
- package/dist/project-workspace/metadata-client.d.ts +99 -0
- package/dist/project-workspace/metadata-client.js +8 -0
- package/dist/project-workspace/metadata-commands.d.ts +4 -0
- package/dist/project-workspace/metadata-commands.js +56 -0
- package/dist/project-workspace/output/human.d.ts +139 -0
- package/dist/project-workspace/output/human.js +115 -0
- package/dist/project-workspace/output/index.d.ts +3 -0
- package/dist/project-workspace/output/index.js +3 -0
- package/dist/project-workspace/output/metadata.d.ts +11 -0
- package/dist/project-workspace/output/metadata.js +17 -0
- package/dist/project-workspace/tree/index.d.ts +2 -0
- package/dist/project-workspace/tree/index.js +2 -0
- package/dist/project-workspace/tree/tree.d.ts +3 -0
- package/dist/project-workspace/tree/tree.js +212 -0
- package/dist/provider/client.d.ts +6 -0
- package/dist/provider/client.js +5 -0
- package/dist/provider/commands.d.ts +3 -0
- package/dist/provider/commands.js +38 -0
- package/dist/provider/index.d.ts +3 -0
- package/dist/provider/index.js +3 -0
- package/dist/reference/commands.d.ts +3 -0
- package/dist/reference/commands.js +41 -0
- package/dist/reference/index.d.ts +3 -0
- package/dist/reference/index.js +3 -0
- package/dist/reference/resolve.d.ts +31 -0
- package/dist/reference/resolve.js +304 -0
- package/dist/reference/tree/index.d.ts +2 -0
- package/dist/reference/tree/index.js +2 -0
- package/dist/reference/tree/tree.d.ts +3 -0
- package/dist/reference/tree/tree.js +17 -0
- package/dist/remote-node/client.d.ts +338 -0
- package/dist/remote-node/client.js +17 -0
- package/dist/remote-node/commands.d.ts +15 -0
- package/dist/remote-node/commands.js +342 -0
- package/dist/remote-node/connector.d.ts +67 -0
- package/dist/remote-node/connector.js +143 -0
- package/dist/remote-node/index.d.ts +4 -0
- package/dist/remote-node/index.js +4 -0
- package/dist/remote-node/reachability.d.ts +64 -0
- package/dist/remote-node/reachability.js +44 -0
- package/dist/remote-node/text.d.ts +10 -0
- package/dist/remote-node/text.js +111 -0
- package/dist/remote-node/tree/index.d.ts +2 -0
- package/dist/remote-node/tree/index.js +2 -0
- package/dist/remote-node/tree/tree.d.ts +3 -0
- package/dist/remote-node/tree/tree.js +71 -0
- package/dist/routine/client.d.ts +398 -0
- package/dist/routine/client.js +28 -0
- package/dist/routine/commands.d.ts +9 -0
- package/dist/routine/commands.js +109 -0
- package/dist/routine/index.d.ts +3 -0
- package/dist/routine/index.js +3 -0
- package/dist/routine/input.d.ts +28 -0
- package/dist/routine/input.js +44 -0
- package/dist/routine/output/format.d.ts +23 -0
- package/dist/routine/output/format.js +83 -0
- package/dist/routine/output/index.d.ts +2 -0
- package/dist/routine/output/index.js +2 -0
- package/dist/routine/tree/index.d.ts +2 -0
- package/dist/routine/tree/index.js +2 -0
- package/dist/routine/tree/tree.d.ts +3 -0
- package/dist/routine/tree/tree.js +70 -0
- package/dist/run-ledger/client.d.ts +358 -0
- package/dist/run-ledger/client.js +13 -0
- package/dist/run-ledger/commands.d.ts +8 -0
- package/dist/run-ledger/commands.js +19 -0
- package/dist/run-ledger/index.d.ts +3 -0
- package/dist/run-ledger/index.js +3 -0
- package/dist/run-ledger/input.d.ts +42 -0
- package/dist/run-ledger/input.js +107 -0
- package/dist/run-ledger/output/format.d.ts +11 -0
- package/dist/run-ledger/output/format.js +49 -0
- package/dist/run-ledger/output/index.d.ts +2 -0
- package/dist/run-ledger/output/index.js +2 -0
- package/dist/session/agent-permission.d.ts +63 -0
- package/dist/session/agent-permission.js +20 -0
- package/dist/session/approval/client.d.ts +117 -0
- package/dist/session/approval/client.js +7 -0
- package/dist/session/approval/commands.d.ts +7 -0
- package/dist/session/approval/commands.js +145 -0
- package/dist/session/approval/index.d.ts +3 -0
- package/dist/session/approval/index.js +3 -0
- package/dist/session/approval/output/format.d.ts +23 -0
- package/dist/session/approval/output/format.js +33 -0
- package/dist/session/approval/output/index.d.ts +2 -0
- package/dist/session/approval/output/index.js +2 -0
- package/dist/session/attach-client.d.ts +16 -0
- package/dist/session/attach-client.js +17 -0
- package/dist/session/attach-render.d.ts +16 -0
- package/dist/session/attach-render.js +162 -0
- package/dist/session/attach.d.ts +5 -0
- package/dist/session/attach.js +120 -0
- package/dist/session/client.d.ts +140 -0
- package/dist/session/client.js +129 -0
- package/dist/session/coding-client.d.ts +16 -0
- package/dist/session/coding-client.js +15 -0
- package/dist/session/coding-commands.d.ts +4 -0
- package/dist/session/coding-commands.js +50 -0
- package/dist/session/commands.d.ts +14 -0
- package/dist/session/commands.js +585 -0
- package/dist/session/create-tasks.d.ts +20 -0
- package/dist/session/create-tasks.js +128 -0
- package/dist/session/index.d.ts +9 -0
- package/dist/session/index.js +8 -0
- package/dist/session/interaction/client.d.ts +347 -0
- package/dist/session/interaction/client.js +15 -0
- package/dist/session/interaction/commands.d.ts +7 -0
- package/dist/session/interaction/commands.js +101 -0
- package/dist/session/interaction/index.d.ts +3 -0
- package/dist/session/interaction/index.js +3 -0
- package/dist/session/interaction/input.d.ts +15 -0
- package/dist/session/interaction/input.js +46 -0
- package/dist/session/interaction/output/format.d.ts +11 -0
- package/dist/session/interaction/output/format.js +4 -0
- package/dist/session/interaction/output/index.d.ts +2 -0
- package/dist/session/interaction/output/index.js +2 -0
- package/dist/session/output/diff.d.ts +3 -0
- package/dist/session/output/diff.js +23 -0
- package/dist/session/output/failure.d.ts +11 -0
- package/dist/session/output/failure.js +17 -0
- package/dist/session/output/human.d.ts +113 -0
- package/dist/session/output/human.js +82 -0
- package/dist/session/output/index.d.ts +6 -0
- package/dist/session/output/index.js +6 -0
- package/dist/session/output/observe.d.ts +4 -0
- package/dist/session/output/observe.js +46 -0
- package/dist/session/output/tasks.d.ts +34 -0
- package/dist/session/output/tasks.js +48 -0
- package/dist/session/rename.d.ts +3 -0
- package/dist/session/rename.js +37 -0
- package/dist/session/task-file.d.ts +5 -0
- package/dist/session/task-file.js +23 -0
- package/dist/session/tree/index.d.ts +2 -0
- package/dist/session/tree/index.js +2 -0
- package/dist/session/tree/tree.d.ts +3 -0
- package/dist/session/tree/tree.js +368 -0
- package/dist/session/turn/client.d.ts +28 -0
- package/dist/session/turn/client.js +51 -0
- package/dist/session/turn/commands.d.ts +8 -0
- package/dist/session/turn/commands.js +185 -0
- package/dist/session/turn/index.d.ts +4 -0
- package/dist/session/turn/index.js +3 -0
- package/dist/session/turn/output.d.ts +47 -0
- package/dist/session/turn/output.js +61 -0
- package/dist/status/client.d.ts +124 -0
- package/dist/status/client.js +5 -0
- package/dist/status/command.d.ts +4 -0
- package/dist/status/command.js +40 -0
- package/dist/status/doctor.d.ts +15 -0
- package/dist/status/doctor.js +111 -0
- package/dist/status/index.d.ts +5 -0
- package/dist/status/index.js +4 -0
- package/dist/status/output/compact.d.ts +32 -0
- package/dist/status/output/compact.js +49 -0
- package/dist/status/output/human.d.ts +7 -0
- package/dist/status/output/human.js +87 -0
- package/dist/status/output/index.d.ts +3 -0
- package/dist/status/output/index.js +3 -0
- package/dist/team-workspace/ceremony.d.ts +19 -0
- package/dist/team-workspace/ceremony.js +141 -0
- package/dist/team-workspace/client.d.ts +58 -0
- package/dist/team-workspace/client.js +6 -0
- package/dist/team-workspace/commands.d.ts +3 -0
- package/dist/team-workspace/commands.js +85 -0
- package/dist/team-workspace/confirmation.d.ts +4 -0
- package/dist/team-workspace/confirmation.js +8 -0
- package/dist/team-workspace/dependencies.d.ts +8 -0
- package/dist/team-workspace/dependencies.js +2 -0
- package/dist/team-workspace/index.d.ts +6 -0
- package/dist/team-workspace/index.js +5 -0
- package/dist/team-workspace/launcher.d.ts +17 -0
- package/dist/team-workspace/launcher.js +30 -0
- package/dist/team-workspace/output.d.ts +15 -0
- package/dist/team-workspace/output.js +28 -0
- package/dist/team-workspace/terminal.d.ts +9 -0
- package/dist/team-workspace/terminal.js +46 -0
- package/dist/terminal/arguments.d.ts +13 -0
- package/dist/terminal/arguments.js +79 -0
- package/dist/terminal/client.d.ts +83 -0
- package/dist/terminal/client.js +71 -0
- package/dist/terminal/commands.d.ts +7 -0
- package/dist/terminal/commands.js +143 -0
- package/dist/terminal/control-commands.d.ts +10 -0
- package/dist/terminal/control-commands.js +212 -0
- package/dist/terminal/index.d.ts +4 -0
- package/dist/terminal/index.js +4 -0
- package/dist/terminal/output/compact-list.d.ts +148 -0
- package/dist/terminal/output/compact-list.js +153 -0
- package/dist/terminal/output/human.d.ts +42 -0
- package/dist/terminal/output/human.js +55 -0
- package/dist/terminal/output/index.d.ts +3 -0
- package/dist/terminal/output/index.js +3 -0
- package/dist/terminal/tree/index.d.ts +2 -0
- package/dist/terminal/tree/index.js +2 -0
- package/dist/terminal/tree/tree.d.ts +3 -0
- package/dist/terminal/tree/tree.js +104 -0
- package/guidance/maia-cli/SKILL.md +58 -0
- package/guidance/maia-orchestration/SKILL.md +54 -0
- package/package.json +78 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import type { TerminalEventsListResult, TerminalListResult, TerminalReadResult, TerminalShowResult } from "@maiaos/sdk";
|
|
2
|
+
type ProtocolTerminal = TerminalListResult["items"][number];
|
|
3
|
+
type ProtocolUnavailable = Extract<ProtocolTerminal, {
|
|
4
|
+
readonly state: "unavailable";
|
|
5
|
+
}>;
|
|
6
|
+
type ProtocolLive = Exclude<ProtocolTerminal, ProtocolUnavailable>;
|
|
7
|
+
type ProtocolCleanup = ProtocolLive["cleanup"];
|
|
8
|
+
type ProtocolExit = NonNullable<Extract<ProtocolLive, {
|
|
9
|
+
readonly exit?: unknown;
|
|
10
|
+
}>["exit"]>;
|
|
11
|
+
type ProtocolEvent = TerminalEventsListResult["items"][number];
|
|
12
|
+
type ProtocolLegacyEvent = Extract<ProtocolEvent, {
|
|
13
|
+
readonly eventType: unknown;
|
|
14
|
+
}>;
|
|
15
|
+
type ProtocolLiveEvent = Exclude<ProtocolEvent, ProtocolLegacyEvent>;
|
|
16
|
+
type ProtocolChunk = TerminalReadResult["items"][number];
|
|
17
|
+
export type CliOutputAudience = "human" | "json";
|
|
18
|
+
type CliTerminalCleanup = {
|
|
19
|
+
readonly reason: Extract<ProtocolCleanup, {
|
|
20
|
+
readonly state: "unknown";
|
|
21
|
+
}>["reason"];
|
|
22
|
+
readonly state: "unknown";
|
|
23
|
+
} | {
|
|
24
|
+
readonly state: Exclude<ProtocolCleanup["state"], "unknown">;
|
|
25
|
+
};
|
|
26
|
+
type CliUnavailableTerminal = {
|
|
27
|
+
readonly id: ProtocolUnavailable["id"];
|
|
28
|
+
readonly projectId: ProtocolUnavailable["projectId"];
|
|
29
|
+
readonly revision: ProtocolUnavailable["revision"];
|
|
30
|
+
readonly state: ProtocolUnavailable["state"];
|
|
31
|
+
readonly unavailability: ProtocolUnavailable["unavailability"];
|
|
32
|
+
readonly workspaceId: ProtocolUnavailable["workspaceId"];
|
|
33
|
+
readonly workspaceRevision: ProtocolUnavailable["workspaceRevision"];
|
|
34
|
+
};
|
|
35
|
+
type CliHumanLiveCapability = {
|
|
36
|
+
readonly capability: {
|
|
37
|
+
readonly tier: ProtocolLive["capability"]["tier"];
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
type CliLiveTerminalFields = {
|
|
41
|
+
readonly cleanup?: CliTerminalCleanup;
|
|
42
|
+
readonly exit?: ProtocolExit;
|
|
43
|
+
readonly generation: ProtocolLive["generation"];
|
|
44
|
+
readonly id: ProtocolLive["id"];
|
|
45
|
+
readonly projectId: ProtocolLive["projectId"];
|
|
46
|
+
readonly revision: ProtocolLive["revision"];
|
|
47
|
+
readonly state: ProtocolLive["state"];
|
|
48
|
+
readonly workspaceId: ProtocolLive["workspaceId"];
|
|
49
|
+
readonly workspaceRevision: ProtocolLive["workspaceRevision"];
|
|
50
|
+
};
|
|
51
|
+
export type CliLiveTerminal<TAudience extends CliOutputAudience = "json"> = TAudience extends "human" ? CliLiveTerminalFields & CliHumanLiveCapability : CliLiveTerminalFields;
|
|
52
|
+
export type CliTerminalListItem<TAudience extends CliOutputAudience = "json"> = CliLiveTerminal<TAudience> | CliUnavailableTerminal;
|
|
53
|
+
export type CliTerminalShowTerminal<TAudience extends CliOutputAudience = "json"> = (CliLiveTerminal<TAudience> & {
|
|
54
|
+
readonly viewport: ProtocolLive["viewport"];
|
|
55
|
+
}) | CliUnavailableTerminal;
|
|
56
|
+
export type CliTerminalListResult<TAudience extends CliOutputAudience = "json"> = {
|
|
57
|
+
readonly command: "terminal.list";
|
|
58
|
+
readonly count: number;
|
|
59
|
+
readonly items: readonly CliTerminalListItem<TAudience>[];
|
|
60
|
+
readonly nextCursor?: TerminalListResult["nextCursor"];
|
|
61
|
+
readonly workspaceId: ProtocolTerminal["workspaceId"];
|
|
62
|
+
};
|
|
63
|
+
export type CliTerminalShowResult<TAudience extends CliOutputAudience = "json"> = {
|
|
64
|
+
readonly command: "terminal.show";
|
|
65
|
+
readonly terminal: CliTerminalShowTerminal<TAudience>;
|
|
66
|
+
};
|
|
67
|
+
type CliLegacyEventFields = {
|
|
68
|
+
readonly cursor: string;
|
|
69
|
+
readonly type: ProtocolLegacyEvent["eventType"];
|
|
70
|
+
readonly unavailability: ProtocolUnavailable["unavailability"];
|
|
71
|
+
};
|
|
72
|
+
type CliLegacyTerminalEvent<TAudience extends CliOutputAudience = "json"> = TAudience extends "human" ? CliLegacyEventFields & {
|
|
73
|
+
readonly globalCursor: ProtocolLegacyEvent["globalCursor"];
|
|
74
|
+
} : CliLegacyEventFields;
|
|
75
|
+
export type CliTerminalEvent<TAudience extends CliOutputAudience = "json"> = CliLegacyTerminalEvent<TAudience> | {
|
|
76
|
+
readonly cleanup: CliTerminalCleanup;
|
|
77
|
+
readonly cursor: string;
|
|
78
|
+
readonly type: "cleanup";
|
|
79
|
+
} | {
|
|
80
|
+
readonly cursor: string;
|
|
81
|
+
readonly exit: ProtocolExit;
|
|
82
|
+
readonly type: "exit";
|
|
83
|
+
} | {
|
|
84
|
+
readonly cursor: string;
|
|
85
|
+
readonly headCursor: string;
|
|
86
|
+
readonly oldestAvailableCursor: string;
|
|
87
|
+
readonly reason: Extract<ProtocolLiveEvent, {
|
|
88
|
+
readonly type: "gap";
|
|
89
|
+
}>["reason"];
|
|
90
|
+
readonly recovery: Extract<ProtocolLiveEvent, {
|
|
91
|
+
readonly type: "gap";
|
|
92
|
+
}>["recovery"];
|
|
93
|
+
readonly requestedAfterCursor?: string;
|
|
94
|
+
readonly type: "gap";
|
|
95
|
+
} | {
|
|
96
|
+
readonly cursor: string;
|
|
97
|
+
readonly leaseId: string;
|
|
98
|
+
readonly reason: Extract<ProtocolLiveEvent, {
|
|
99
|
+
readonly type: "controller-revoked";
|
|
100
|
+
}>["reason"];
|
|
101
|
+
readonly type: "controller-revoked";
|
|
102
|
+
} | {
|
|
103
|
+
readonly cursor: string;
|
|
104
|
+
readonly previousCleanup: CliTerminalCleanup;
|
|
105
|
+
readonly previousGeneration: number;
|
|
106
|
+
readonly previousRevision: string;
|
|
107
|
+
readonly previousState: ProtocolLive["state"];
|
|
108
|
+
readonly terminal: CliTerminalListItem<TAudience>;
|
|
109
|
+
readonly transition: Extract<ProtocolLiveEvent, {
|
|
110
|
+
readonly type: "lifecycle-transition";
|
|
111
|
+
}>["transition"];
|
|
112
|
+
readonly type: "lifecycle-transition";
|
|
113
|
+
} | {
|
|
114
|
+
readonly cursor: string;
|
|
115
|
+
readonly type: "output";
|
|
116
|
+
};
|
|
117
|
+
export type CliTerminalEventsResult<TAudience extends CliOutputAudience = "json"> = {
|
|
118
|
+
readonly command: "terminal.events";
|
|
119
|
+
readonly count: number;
|
|
120
|
+
readonly headCursor: TerminalEventsListResult["headTerminalCursor"];
|
|
121
|
+
readonly items: readonly CliTerminalEvent<TAudience>[];
|
|
122
|
+
readonly nextCursor?: TerminalEventsListResult["nextTerminalCursor"];
|
|
123
|
+
readonly terminalId: TerminalEventsListResult["terminalId"];
|
|
124
|
+
};
|
|
125
|
+
type CliTerminalChunk = {
|
|
126
|
+
readonly bytesBase64: ProtocolChunk["bytesBase64"];
|
|
127
|
+
readonly cursor: ProtocolChunk["cursor"];
|
|
128
|
+
readonly generation?: number;
|
|
129
|
+
};
|
|
130
|
+
export type CliTerminalReadResult = {
|
|
131
|
+
readonly command: "terminal.read";
|
|
132
|
+
readonly count: number;
|
|
133
|
+
readonly gap?: TerminalReadResult["gap"];
|
|
134
|
+
readonly headChunkCursor: TerminalReadResult["headChunkCursor"];
|
|
135
|
+
readonly items: readonly CliTerminalChunk[];
|
|
136
|
+
readonly nextChunkCursor?: TerminalReadResult["nextChunkCursor"];
|
|
137
|
+
readonly terminalId: TerminalReadResult["terminalId"];
|
|
138
|
+
};
|
|
139
|
+
export declare const terminalOutputAudience: (json: boolean) => CliOutputAudience;
|
|
140
|
+
export declare const projectTerminalListItem: <TAudience extends CliOutputAudience = "json">(terminal: ProtocolTerminal, audience?: TAudience) => CliTerminalListItem<TAudience>;
|
|
141
|
+
export declare const projectTerminalListResult: <TAudience extends CliOutputAudience = "json">(value: TerminalListResult, workspaceId: ProtocolTerminal["workspaceId"], audience?: TAudience) => CliTerminalListResult<TAudience>;
|
|
142
|
+
export declare const projectTerminalShowResult: <TAudience extends CliOutputAudience = "json">(value: TerminalShowResult, audience?: TAudience) => CliTerminalShowResult<TAudience>;
|
|
143
|
+
export declare const projectTerminalEvent: <TAudience extends CliOutputAudience = "json">(event: ProtocolEvent, audience?: TAudience) => CliTerminalEvent<TAudience>;
|
|
144
|
+
export declare const projectTerminalEventsResult: <TAudience extends CliOutputAudience = "json">(value: TerminalEventsListResult, audience?: TAudience) => CliTerminalEventsResult<TAudience>;
|
|
145
|
+
export declare const projectTerminalChunk: (chunk: ProtocolChunk) => CliTerminalChunk;
|
|
146
|
+
export declare const projectTerminalReadResult: (value: TerminalReadResult) => CliTerminalReadResult;
|
|
147
|
+
export {};
|
|
148
|
+
//# sourceMappingURL=compact-list.d.ts.map
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
const projectCleanup = (cleanup) => cleanup.state === "unknown"
|
|
2
|
+
? { reason: cleanup.reason, state: cleanup.state }
|
|
3
|
+
: { state: cleanup.state };
|
|
4
|
+
const projectOptionalCleanup = (cleanup) => cleanup.state === "pending" ? {} : { cleanup: projectCleanup(cleanup) };
|
|
5
|
+
const projectExit = (exit) => ({
|
|
6
|
+
...(exit.code === undefined ? {} : { code: exit.code }),
|
|
7
|
+
observedAt: exit.observedAt,
|
|
8
|
+
...(exit.signal === undefined ? {} : { signal: exit.signal }),
|
|
9
|
+
});
|
|
10
|
+
const projectOptionalExit = (terminal) => "exit" in terminal && terminal.exit !== undefined
|
|
11
|
+
? { exit: projectExit(terminal.exit) }
|
|
12
|
+
: {};
|
|
13
|
+
const projectUnavailableTerminal = (terminal) => ({
|
|
14
|
+
id: terminal.id,
|
|
15
|
+
projectId: terminal.projectId,
|
|
16
|
+
revision: terminal.revision,
|
|
17
|
+
state: terminal.state,
|
|
18
|
+
unavailability: terminal.unavailability,
|
|
19
|
+
workspaceId: terminal.workspaceId,
|
|
20
|
+
workspaceRevision: terminal.workspaceRevision,
|
|
21
|
+
});
|
|
22
|
+
const projectLiveTerminal = (terminal, includeViewport, audience) => ({
|
|
23
|
+
...(audience === "human"
|
|
24
|
+
? { capability: { tier: terminal.capability.tier } }
|
|
25
|
+
: {}),
|
|
26
|
+
...projectOptionalCleanup(terminal.cleanup),
|
|
27
|
+
...projectOptionalExit(terminal),
|
|
28
|
+
generation: terminal.generation,
|
|
29
|
+
id: terminal.id,
|
|
30
|
+
projectId: terminal.projectId,
|
|
31
|
+
revision: terminal.revision,
|
|
32
|
+
state: terminal.state,
|
|
33
|
+
...(includeViewport
|
|
34
|
+
? {
|
|
35
|
+
viewport: {
|
|
36
|
+
columns: terminal.viewport.columns,
|
|
37
|
+
rows: terminal.viewport.rows,
|
|
38
|
+
},
|
|
39
|
+
}
|
|
40
|
+
: {}),
|
|
41
|
+
workspaceId: terminal.workspaceId,
|
|
42
|
+
workspaceRevision: terminal.workspaceRevision,
|
|
43
|
+
});
|
|
44
|
+
export const terminalOutputAudience = (json) => json ? "json" : "human";
|
|
45
|
+
export const projectTerminalListItem = (terminal, audience = "json") => (terminal.state === "unavailable"
|
|
46
|
+
? projectUnavailableTerminal(terminal)
|
|
47
|
+
: projectLiveTerminal(terminal, false, audience));
|
|
48
|
+
const projectTerminalShowTerminal = (terminal, audience = "json") => (terminal.state === "unavailable"
|
|
49
|
+
? projectUnavailableTerminal(terminal)
|
|
50
|
+
: projectLiveTerminal(terminal, true, audience));
|
|
51
|
+
export const projectTerminalListResult = (value, workspaceId, audience = "json") => ({
|
|
52
|
+
command: "terminal.list",
|
|
53
|
+
count: value.items.length,
|
|
54
|
+
items: value.items.map((item) => projectTerminalListItem(item, audience)),
|
|
55
|
+
...(value.nextCursor === undefined ? {} : { nextCursor: value.nextCursor }),
|
|
56
|
+
workspaceId: value.items[0]?.workspaceId ?? workspaceId,
|
|
57
|
+
});
|
|
58
|
+
export const projectTerminalShowResult = (value, audience = "json") => ({
|
|
59
|
+
command: "terminal.show",
|
|
60
|
+
terminal: projectTerminalShowTerminal(value.terminal, audience),
|
|
61
|
+
});
|
|
62
|
+
const projectLegacyEvent = (event, audience) => ({
|
|
63
|
+
cursor: event.terminalCursor,
|
|
64
|
+
...(audience === "human" ? { globalCursor: event.globalCursor } : {}),
|
|
65
|
+
type: event.eventType,
|
|
66
|
+
unavailability: {
|
|
67
|
+
code: event.payload.code,
|
|
68
|
+
platform: event.payload.platform,
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
const projectCleanupEvent = (event) => ({
|
|
72
|
+
cleanup: projectCleanup(event.cleanup),
|
|
73
|
+
cursor: event.cursor,
|
|
74
|
+
type: "cleanup",
|
|
75
|
+
});
|
|
76
|
+
const projectControllerRevokedEvent = (event) => ({
|
|
77
|
+
cursor: event.cursor,
|
|
78
|
+
leaseId: event.leaseId,
|
|
79
|
+
reason: event.reason,
|
|
80
|
+
type: "controller-revoked",
|
|
81
|
+
});
|
|
82
|
+
const projectExitEvent = (event) => ({
|
|
83
|
+
cursor: event.cursor,
|
|
84
|
+
exit: projectExit(event.exit),
|
|
85
|
+
type: "exit",
|
|
86
|
+
});
|
|
87
|
+
const projectGapEvent = (event) => ({
|
|
88
|
+
cursor: event.cursor,
|
|
89
|
+
headCursor: event.headCursor,
|
|
90
|
+
oldestAvailableCursor: event.oldestAvailableCursor,
|
|
91
|
+
reason: event.reason,
|
|
92
|
+
recovery: event.recovery,
|
|
93
|
+
...(event.requestedAfterCursor === undefined
|
|
94
|
+
? {}
|
|
95
|
+
: { requestedAfterCursor: event.requestedAfterCursor }),
|
|
96
|
+
type: "gap",
|
|
97
|
+
});
|
|
98
|
+
const projectLifecycleEvent = (event, audience) => ({
|
|
99
|
+
cursor: event.cursor,
|
|
100
|
+
previousCleanup: projectCleanup(event.previousCleanup),
|
|
101
|
+
previousGeneration: event.previousGeneration,
|
|
102
|
+
previousRevision: event.previousRevision,
|
|
103
|
+
previousState: event.previousState,
|
|
104
|
+
terminal: projectTerminalListItem(event.terminal, audience),
|
|
105
|
+
transition: event.transition,
|
|
106
|
+
type: "lifecycle-transition",
|
|
107
|
+
});
|
|
108
|
+
const projectLiveEvent = (event, audience) => {
|
|
109
|
+
switch (event.type) {
|
|
110
|
+
case "cleanup":
|
|
111
|
+
return projectCleanupEvent(event);
|
|
112
|
+
case "controller-revoked":
|
|
113
|
+
return projectControllerRevokedEvent(event);
|
|
114
|
+
case "exit":
|
|
115
|
+
return projectExitEvent(event);
|
|
116
|
+
case "gap":
|
|
117
|
+
return projectGapEvent(event);
|
|
118
|
+
case "lifecycle-transition":
|
|
119
|
+
return projectLifecycleEvent(event, audience);
|
|
120
|
+
case "output":
|
|
121
|
+
return { cursor: event.cursor, type: "output" };
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
export const projectTerminalEvent = (event, audience = "json") => "eventType" in event
|
|
125
|
+
? projectLegacyEvent(event, audience)
|
|
126
|
+
: projectLiveEvent(event, audience);
|
|
127
|
+
export const projectTerminalEventsResult = (value, audience = "json") => ({
|
|
128
|
+
command: "terminal.events",
|
|
129
|
+
count: value.items.length,
|
|
130
|
+
headCursor: value.headTerminalCursor,
|
|
131
|
+
items: value.items.map((event) => projectTerminalEvent(event, audience)),
|
|
132
|
+
...(value.nextTerminalCursor === undefined
|
|
133
|
+
? {}
|
|
134
|
+
: { nextCursor: value.nextTerminalCursor }),
|
|
135
|
+
terminalId: value.terminalId,
|
|
136
|
+
});
|
|
137
|
+
export const projectTerminalChunk = (chunk) => ({
|
|
138
|
+
bytesBase64: chunk.bytesBase64,
|
|
139
|
+
cursor: chunk.cursor,
|
|
140
|
+
...("generation" in chunk ? { generation: chunk.generation } : {}),
|
|
141
|
+
});
|
|
142
|
+
export const projectTerminalReadResult = (value) => ({
|
|
143
|
+
command: "terminal.read",
|
|
144
|
+
count: value.items.length,
|
|
145
|
+
...(value.gap === undefined ? {} : { gap: value.gap }),
|
|
146
|
+
headChunkCursor: value.headChunkCursor,
|
|
147
|
+
items: value.items.map(projectTerminalChunk),
|
|
148
|
+
...(value.nextChunkCursor === undefined
|
|
149
|
+
? {}
|
|
150
|
+
: { nextChunkCursor: value.nextChunkCursor }),
|
|
151
|
+
terminalId: value.terminalId,
|
|
152
|
+
});
|
|
153
|
+
//# sourceMappingURL=compact-list.js.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { LiveTerminalCloseResult, LiveTerminalControllerAcquireResult, LiveTerminalControllerReleaseResult, LiveTerminalControllerRequestResult, LiveTerminalControllerRequestShowResult, LiveTerminalResizeResult, LiveTerminalSignalResult, LiveTerminalWriteResult, TerminalCreateResult } from "@maiaos/sdk";
|
|
2
|
+
import { type CliIo } from "../../command-line/index.js";
|
|
3
|
+
import type { CliNodeResult } from "../../local-node/index.js";
|
|
4
|
+
import type { CliOutputAudience, CliTerminalEventsResult, CliTerminalListResult, CliTerminalReadResult, CliTerminalShowResult } from "./compact-list.js";
|
|
5
|
+
export type CliTerminalResult = CliTerminalEventsResult<CliOutputAudience> | CliTerminalListResult<CliOutputAudience> | CliTerminalReadResult | CliTerminalShowResult<CliOutputAudience> | {
|
|
6
|
+
readonly command: "terminal.close";
|
|
7
|
+
readonly result: LiveTerminalCloseResult;
|
|
8
|
+
} | {
|
|
9
|
+
readonly command: "terminal.controller.acquire";
|
|
10
|
+
readonly result: LiveTerminalControllerAcquireResult;
|
|
11
|
+
} | {
|
|
12
|
+
readonly command: "terminal.controller.release";
|
|
13
|
+
readonly result: LiveTerminalControllerReleaseResult;
|
|
14
|
+
} | {
|
|
15
|
+
readonly command: "terminal.controller.request";
|
|
16
|
+
readonly result: LiveTerminalControllerRequestResult;
|
|
17
|
+
} | {
|
|
18
|
+
readonly command: "terminal.controller.request.show";
|
|
19
|
+
readonly result: LiveTerminalControllerRequestShowResult;
|
|
20
|
+
} | {
|
|
21
|
+
readonly command: "terminal.create";
|
|
22
|
+
readonly result: TerminalCreateResult;
|
|
23
|
+
} | {
|
|
24
|
+
readonly command: "terminal.input.write";
|
|
25
|
+
readonly result: LiveTerminalWriteResult;
|
|
26
|
+
} | {
|
|
27
|
+
readonly command: "terminal.resize";
|
|
28
|
+
readonly result: LiveTerminalResizeResult;
|
|
29
|
+
} | {
|
|
30
|
+
readonly command: "terminal.signal";
|
|
31
|
+
readonly result: LiveTerminalSignalResult;
|
|
32
|
+
};
|
|
33
|
+
export declare const formatTerminalList: (result: CliTerminalListResult<CliOutputAudience>) => string;
|
|
34
|
+
export declare const formatTerminalShow: (result: CliTerminalShowResult<CliOutputAudience>) => string;
|
|
35
|
+
export declare const formatTerminalEvents: (result: CliTerminalEventsResult<CliOutputAudience>) => string;
|
|
36
|
+
export declare const formatTerminalRead: (result: CliTerminalReadResult) => string;
|
|
37
|
+
export declare const formatTerminalResult: (result: CliTerminalResult) => string;
|
|
38
|
+
export declare const writeTerminalResult: <TValue>(result: CliNodeResult<TValue>, context: {
|
|
39
|
+
readonly io: CliIo;
|
|
40
|
+
readonly json: boolean;
|
|
41
|
+
}, map: (value: TValue) => CliTerminalResult) => number;
|
|
42
|
+
//# sourceMappingURL=human.d.ts.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { cell, formatRows, jsonLine, writeNodeResult, } from "../../command-line/index.js";
|
|
2
|
+
const isHumanLiveTerminal = (terminal) => terminal.state !== "unavailable" && "capability" in terminal;
|
|
3
|
+
const formatTerminalProjection = (terminal) => {
|
|
4
|
+
if (terminal.state === "unavailable") {
|
|
5
|
+
return `${cell(terminal.id)}\t${cell(terminal.state)}\t${cell(terminal.unavailability.code)}\t${cell(terminal.workspaceId)}`;
|
|
6
|
+
}
|
|
7
|
+
if (!isHumanLiveTerminal(terminal)) {
|
|
8
|
+
throw new Error("Human live terminal TSV requires capability.tier.");
|
|
9
|
+
}
|
|
10
|
+
return `${cell(terminal.id)}\t${cell(terminal.state)}\t${cell(terminal.capability.tier)}\t${cell(terminal.workspaceId)}`;
|
|
11
|
+
};
|
|
12
|
+
export const formatTerminalList = (result) => formatRows(result.items, formatTerminalProjection, "No terminals.");
|
|
13
|
+
export const formatTerminalShow = (result) => `${formatTerminalProjection(result.terminal)}\n`;
|
|
14
|
+
const isHumanLegacyEvent = (event) => "unavailability" in event && "globalCursor" in event;
|
|
15
|
+
const formatTerminalEvent = (event) => {
|
|
16
|
+
if ("unavailability" in event) {
|
|
17
|
+
if (!isHumanLegacyEvent(event)) {
|
|
18
|
+
throw new Error("Human legacy terminal event TSV requires globalCursor.");
|
|
19
|
+
}
|
|
20
|
+
return `${cell(event.cursor)}\t${cell(event.type)}\t${cell(event.globalCursor)}`;
|
|
21
|
+
}
|
|
22
|
+
return `${cell(event.cursor)}\t${cell(event.type)}`;
|
|
23
|
+
};
|
|
24
|
+
export const formatTerminalEvents = (result) => formatRows(result.items, formatTerminalEvent);
|
|
25
|
+
export const formatTerminalRead = (result) => (result.gap === undefined
|
|
26
|
+
? ""
|
|
27
|
+
: `gap\t${result.gap.reason}\t${cell(result.gap.oldestAvailableCursor)}\n`) +
|
|
28
|
+
formatRows(result.items, (chunk) => `${cell(chunk.cursor)}\t${chunk.bytesBase64}`);
|
|
29
|
+
export const formatTerminalResult = (result) => {
|
|
30
|
+
switch (result.command) {
|
|
31
|
+
case "terminal.create":
|
|
32
|
+
case "terminal.close":
|
|
33
|
+
case "terminal.controller.acquire":
|
|
34
|
+
case "terminal.controller.release":
|
|
35
|
+
case "terminal.controller.request":
|
|
36
|
+
case "terminal.controller.request.show":
|
|
37
|
+
case "terminal.input.write":
|
|
38
|
+
case "terminal.resize":
|
|
39
|
+
case "terminal.signal":
|
|
40
|
+
return jsonLine(result.result);
|
|
41
|
+
case "terminal.events":
|
|
42
|
+
return formatTerminalEvents(result);
|
|
43
|
+
case "terminal.list":
|
|
44
|
+
return formatTerminalList(result);
|
|
45
|
+
case "terminal.read":
|
|
46
|
+
return formatTerminalRead(result);
|
|
47
|
+
case "terminal.show":
|
|
48
|
+
return formatTerminalShow(result);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
export const writeTerminalResult = (result, context, map) => writeNodeResult(result, context, {
|
|
52
|
+
toResult: map,
|
|
53
|
+
toText: formatTerminalResult,
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=human.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { type CliLiveTerminal, type CliOutputAudience, type CliTerminalEvent, type CliTerminalEventsResult, type CliTerminalListItem, type CliTerminalListResult, type CliTerminalReadResult, type CliTerminalShowResult, type CliTerminalShowTerminal, projectTerminalEventsResult, projectTerminalListResult, projectTerminalReadResult, projectTerminalShowResult, terminalOutputAudience, } from "./compact-list.js";
|
|
2
|
+
export { type CliTerminalResult, formatTerminalEvents, formatTerminalList, formatTerminalRead, formatTerminalResult, formatTerminalShow, writeTerminalResult, } from "./human.js";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { projectTerminalEventsResult, projectTerminalListResult, projectTerminalReadResult, projectTerminalShowResult, terminalOutputAudience, } from "./compact-list.js";
|
|
2
|
+
export { formatTerminalEvents, formatTerminalList, formatTerminalRead, formatTerminalResult, formatTerminalShow, writeTerminalResult, } from "./human.js";
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
const terminal = () => import("../index.js");
|
|
2
|
+
export const TERMINAL_TREE = {
|
|
3
|
+
groups: [
|
|
4
|
+
["terminal", "Terminals in a Workspace."],
|
|
5
|
+
["terminal events", "A terminal's events."],
|
|
6
|
+
["terminal controller", "Control of a terminal."],
|
|
7
|
+
["terminal controller request", "Requests to control a terminal."],
|
|
8
|
+
["terminal input", "Terminal input."],
|
|
9
|
+
],
|
|
10
|
+
leaves: [
|
|
11
|
+
[
|
|
12
|
+
"terminal create --workspace <workspace-id> [--interactive --columns <2..500> --rows <2..300>] [--command-id <id>] [-- <program> [arguments...]]",
|
|
13
|
+
1,
|
|
14
|
+
"terminal.create",
|
|
15
|
+
"Create a terminal: a login shell, or a listed program after '--'.",
|
|
16
|
+
{ route: "--workspace", run: [terminal, "runTerminalCreate"] },
|
|
17
|
+
],
|
|
18
|
+
[
|
|
19
|
+
"terminal list --workspace <workspace-id> [--limit <1..100>] [--after <cursor>]",
|
|
20
|
+
1,
|
|
21
|
+
"terminal.list",
|
|
22
|
+
"List a Workspace's terminals.",
|
|
23
|
+
{ route: "--workspace", run: [terminal, "runTerminalList"] },
|
|
24
|
+
],
|
|
25
|
+
[
|
|
26
|
+
"terminal show <terminal-id>",
|
|
27
|
+
1,
|
|
28
|
+
"terminal.show",
|
|
29
|
+
"Show one terminal.",
|
|
30
|
+
{ route: "<terminal-id>", run: [terminal, "runTerminalShow"] },
|
|
31
|
+
],
|
|
32
|
+
[
|
|
33
|
+
"terminal read <terminal-id> [--limit <1..8>] [--after <chunk-cursor>]",
|
|
34
|
+
1,
|
|
35
|
+
"terminal.read",
|
|
36
|
+
"Read a terminal's output.",
|
|
37
|
+
{ route: "<terminal-id>", run: [terminal, "runTerminalRead"] },
|
|
38
|
+
],
|
|
39
|
+
[
|
|
40
|
+
"terminal events list --terminal <terminal-id> [--limit <1..32>] [--after <terminal-cursor>]",
|
|
41
|
+
1,
|
|
42
|
+
"terminal.events.list",
|
|
43
|
+
"List a terminal's events.",
|
|
44
|
+
{ route: "--terminal", run: [terminal, "runTerminalEventsList"] },
|
|
45
|
+
],
|
|
46
|
+
[
|
|
47
|
+
"terminal controller request create --terminal <terminal-id> --terminal-generation <1..65535> --lease-ms <1000..30000> [--command-id <id>]",
|
|
48
|
+
1,
|
|
49
|
+
"terminal.controller.request",
|
|
50
|
+
"Request control of a terminal.",
|
|
51
|
+
{ route: "--terminal", run: [terminal, "runControllerRequestCreate"] },
|
|
52
|
+
],
|
|
53
|
+
[
|
|
54
|
+
"terminal controller request show <controller-request-id> --terminal <terminal-id> --terminal-generation <1..65535>",
|
|
55
|
+
1,
|
|
56
|
+
"terminal.controller.request.show",
|
|
57
|
+
"Show a terminal control request.",
|
|
58
|
+
{ route: "--terminal", run: [terminal, "runControllerRequestShow"] },
|
|
59
|
+
],
|
|
60
|
+
[
|
|
61
|
+
"terminal controller acquire <terminal-id> --request <controller-request-id> --terminal-generation <1..65535> --expected-revision <revision> [--command-id <id>]",
|
|
62
|
+
1,
|
|
63
|
+
"terminal.controller.acquire",
|
|
64
|
+
"Acquire control of a terminal.",
|
|
65
|
+
{ route: "<terminal-id>", run: [terminal, "runControllerAcquire"] },
|
|
66
|
+
],
|
|
67
|
+
[
|
|
68
|
+
"terminal controller release <terminal-id> --controller-id <id> --controller-epoch <epoch> --controller-revision <revision> --controller-expires-at <timestamp> --terminal-generation <1..65535> --expected-revision <revision> [--command-id <id>]",
|
|
69
|
+
1,
|
|
70
|
+
"terminal.controller.release",
|
|
71
|
+
"Release control of a terminal.",
|
|
72
|
+
{ route: "<terminal-id>", run: [terminal, "runControllerRelease"] },
|
|
73
|
+
],
|
|
74
|
+
[
|
|
75
|
+
"terminal input write <terminal-id> --input-stdin --input-id <id> --input-sequence <1..2147483647> --controller-id <id> --controller-epoch <epoch> --controller-revision <revision> --controller-expires-at <timestamp> --terminal-generation <1..65535> --expected-revision <revision> [--command-id <id>]",
|
|
76
|
+
1,
|
|
77
|
+
"terminal.input.write",
|
|
78
|
+
"Write input to a terminal you control.",
|
|
79
|
+
{ route: "<terminal-id>", run: [terminal, "runTerminalInputWrite"] },
|
|
80
|
+
],
|
|
81
|
+
[
|
|
82
|
+
"terminal resize <terminal-id> --columns <2..500> --rows <2..300> --controller-id <id> --controller-epoch <epoch> --controller-revision <revision> --controller-expires-at <timestamp> --terminal-generation <1..65535> --expected-revision <revision> [--command-id <id>]",
|
|
83
|
+
1,
|
|
84
|
+
"terminal.session.resize",
|
|
85
|
+
"Resize a terminal you control.",
|
|
86
|
+
{ route: "<terminal-id>", run: [terminal, "runTerminalResize"] },
|
|
87
|
+
],
|
|
88
|
+
[
|
|
89
|
+
"terminal signal <terminal-id> --signal <hangup|interrupt|terminate> --controller-id <id> --controller-epoch <epoch> --controller-revision <revision> --controller-expires-at <timestamp> --terminal-generation <1..65535> --expected-revision <revision> [--command-id <id>]",
|
|
90
|
+
1,
|
|
91
|
+
"terminal.session.signal",
|
|
92
|
+
"Signal a terminal you control.",
|
|
93
|
+
{ route: "<terminal-id>", run: [terminal, "runTerminalSignal"] },
|
|
94
|
+
],
|
|
95
|
+
[
|
|
96
|
+
"terminal close <terminal-id> --controller-id <id> --controller-epoch <epoch> --controller-revision <revision> --controller-expires-at <timestamp> --terminal-generation <1..65535> --expected-revision <revision> [--command-id <id>]",
|
|
97
|
+
1,
|
|
98
|
+
"terminal.session.close",
|
|
99
|
+
"Close a terminal you control.",
|
|
100
|
+
{ route: "<terminal-id>", run: [terminal, "runTerminalClose"] },
|
|
101
|
+
],
|
|
102
|
+
],
|
|
103
|
+
};
|
|
104
|
+
//# sourceMappingURL=tree.js.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: maia-cli
|
|
3
|
+
description: >
|
|
4
|
+
Operate the public Maia CLI and first-party Pi agent. Discover
|
|
5
|
+
callable commands from classified help, inspect local control-plane state,
|
|
6
|
+
recover receipts, and run maia agent without inventing runtime adapters.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Maia CLI
|
|
10
|
+
|
|
11
|
+
## Goal
|
|
12
|
+
|
|
13
|
+
Use the installed `maia` binary as the public client. Treat `maia help --json`
|
|
14
|
+
and `maia help <family> --json` as the command allowlist.
|
|
15
|
+
|
|
16
|
+
## Main rules
|
|
17
|
+
|
|
18
|
+
1. Use only families and usage rows present in classified help.
|
|
19
|
+
2. Treat `source_implemented_candidate` as release-disabled unless the caller
|
|
20
|
+
explicitly accepts that status.
|
|
21
|
+
3. Prefer `--json` for node-facing commands. Read errors from stderr.
|
|
22
|
+
4. Put prompts and large or sensitive bodies on bounded stdin where the command
|
|
23
|
+
supports it.
|
|
24
|
+
5. Reuse a mutation's command ID and reconcile its receipt after an unknown
|
|
25
|
+
outcome.
|
|
26
|
+
6. Use exact project, workspace, session, turn, run, task, worker, and revision
|
|
27
|
+
identifiers. Never infer authority from cwd.
|
|
28
|
+
|
|
29
|
+
## Implemented foundation
|
|
30
|
+
|
|
31
|
+
- `maia --json status`
|
|
32
|
+
- `maia --json project register <path>`
|
|
33
|
+
- `maia --json project list`
|
|
34
|
+
- `maia --json project show <project-id>`
|
|
35
|
+
- `maia --json workspace list --project <project-id>`
|
|
36
|
+
- `maia --json workspace show <workspace-id>`
|
|
37
|
+
- `maia --json workspace repository attach <path> --workspace <workspace-id> --expected-revision <revision>`
|
|
38
|
+
- `maia --json receipt list`
|
|
39
|
+
- `maia --json receipt show <command-id>`
|
|
40
|
+
- `maia --json session create --workspace <workspace-id>`
|
|
41
|
+
- `maia --json session list --project <project-id>`
|
|
42
|
+
- `maia --json session show <session-id>`
|
|
43
|
+
- `maia --json session events list --session <session-id>`
|
|
44
|
+
- `maia agent`
|
|
45
|
+
- `maia agent --print --no-session -- <prompt>`
|
|
46
|
+
- `maia agent --json-events --no-session -- <prompt>`
|
|
47
|
+
|
|
48
|
+
`maia agent` is the first-party official-Pi harness. It is not a selector for
|
|
49
|
+
Codex, Claude, installed Pi, or `pi-rpc`. Ambient `~/.pi` resources are not
|
|
50
|
+
loaded.
|
|
51
|
+
|
|
52
|
+
## Do not
|
|
53
|
+
|
|
54
|
+
- Do not call absent integration or runtime-discovery families.
|
|
55
|
+
- Do not write provider-native configuration roots.
|
|
56
|
+
- Do not treat a Pi extension as Maia operation authority.
|
|
57
|
+
- Do not treat a worktree or Pi process as a sandbox.
|
|
58
|
+
- Do not invent a hidden coordinator, current Session, or unbounded target.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: maia-orchestration
|
|
3
|
+
description: >
|
|
4
|
+
Coordinate source-candidate, release-disabled local-v1 Maia Runs through the
|
|
5
|
+
public CLI: create, list, show, task list and show, inbox check and ack,
|
|
6
|
+
questions, and dispatch show or settle-terminal. Use when an external agent
|
|
7
|
+
is the explicit Run coordinator. Do not treat these commands as
|
|
8
|
+
release-enabled, worker assignment, or Orca equivalence.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Maia orchestration
|
|
12
|
+
|
|
13
|
+
Every command in this Skill is a **source-implemented candidate,
|
|
14
|
+
release-disabled**. Confirm the usage exists on `maia help run --json` and is
|
|
15
|
+
tagged `source_implemented_candidate` before running it. Do not start a
|
|
16
|
+
worker, waiter, harness, or model turn.
|
|
17
|
+
|
|
18
|
+
## Identity
|
|
19
|
+
|
|
20
|
+
Supply explicit ids. Do not infer a Run from the terminal, cwd, Git, or
|
|
21
|
+
environment. Do not use `--scope current`, `--from`, or `--preamble`.
|
|
22
|
+
|
|
23
|
+
After `run create`, keep `run.id`, `run.revision`, `dispatch.id`,
|
|
24
|
+
`dispatch.revision`, both mailbox ids and revisions, and `receipt.commandId`
|
|
25
|
+
from the compact CLI projection. Recover a Task objective with
|
|
26
|
+
`run task show`. Recover Dispatch identity with `run dispatch show`.
|
|
27
|
+
|
|
28
|
+
## Candidate commands
|
|
29
|
+
|
|
30
|
+
Label every invocation as release-disabled when you describe it.
|
|
31
|
+
|
|
32
|
+
- `maia --json run create --workspace <workspace-id> --terminal <terminal-id> --graph-stdin`
|
|
33
|
+
- `maia --json run list --workspace <workspace-id>`
|
|
34
|
+
- `maia --json run show <run-id>`
|
|
35
|
+
- `maia --json run task list --run <run-id>`
|
|
36
|
+
- `maia --json run task show <task-id> --run <run-id>`
|
|
37
|
+
- `maia --json run inbox check --run <run-id> --owner <run|dispatch> --owner-id <id> --coordinator-epoch 1`
|
|
38
|
+
- `maia --json run inbox ack <delivery-id> --run <run-id> --owner <run|dispatch> --owner-id <id> --expected-mailbox-revision <revision> --coordinator-epoch 1`
|
|
39
|
+
- `maia --json run question open --run <run-id> --dispatch <dispatch-id> --subject <text> --body-stdin --expected-run-revision <revision> --expected-dispatch-revision <revision> --coordinator-epoch 1`
|
|
40
|
+
- `maia --json run question reply <question-id> --run <run-id> --dispatch <dispatch-id> --answer-stdin --expected-run-revision <revision> --expected-dispatch-revision <revision> --expected-question-revision <revision> --coordinator-epoch 1`
|
|
41
|
+
- `maia --json run question cancel <question-id> --run <run-id> --dispatch <dispatch-id> --expected-run-revision <revision> --expected-dispatch-revision <revision> --expected-question-revision <revision> --coordinator-epoch 1`
|
|
42
|
+
- `maia --json run dispatch show --run <run-id>`
|
|
43
|
+
- `maia --json run dispatch settle-terminal <dispatch-id> --run <run-id> --expected-run-revision <revision> --expected-dispatch-revision <revision> --coordinator-epoch 1`
|
|
44
|
+
|
|
45
|
+
Put the Task graph, Question body, and reply answer on stdin.
|
|
46
|
+
|
|
47
|
+
## Do not run
|
|
48
|
+
|
|
49
|
+
Do not wait, watch, or poll an inbox. Do not assign a worker. Do not settle a
|
|
50
|
+
caller-selected outcome. `settle-terminal` only records the Terminal's exact
|
|
51
|
+
unavailable failure. Do not teach Skill install/sync or extra runtime probes.
|
|
52
|
+
|
|
53
|
+
A compact CLI projection is not a protocol change. The SDK remains lossless.
|
|
54
|
+
No Orca command is equivalent.
|