@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,368 @@
|
|
|
1
|
+
const session = () => import("../index.js");
|
|
2
|
+
const turn = () => import("../turn/index.js");
|
|
3
|
+
const approval = () => import("../approval/index.js");
|
|
4
|
+
const interaction = () => import("../interaction/index.js");
|
|
5
|
+
const discovery = () => import("../../import/index.js");
|
|
6
|
+
export const SESSION_TREE = {
|
|
7
|
+
groups: [
|
|
8
|
+
["session", "Sessions: workers that run in a Workspace."],
|
|
9
|
+
["session events", "A Session's events."],
|
|
10
|
+
["session history", "Session transcripts."],
|
|
11
|
+
["session inbox", "This Session's inbox."],
|
|
12
|
+
["session message", "Messages between Sessions."],
|
|
13
|
+
["session agent-permission", "Agent permission grants."],
|
|
14
|
+
["session turn", "Turns sent to a Session."],
|
|
15
|
+
["session approval", "What a worker waits on a person for."],
|
|
16
|
+
["session interaction", "Record-only questions to a person."],
|
|
17
|
+
["import", "Find sessions to adopt."],
|
|
18
|
+
],
|
|
19
|
+
leaves: [
|
|
20
|
+
[
|
|
21
|
+
"session create (--workspace <workspace-id> | --project <project-id>) [--command-id <id>] [--role <worker|orchestrator>] [--connection <connection-id> [--executor <codex-cli|claude-code>] [--model <id>] | --executor <codex-cli|claude-code> | --agent <agent-id> | --agent-definition <key> --agent-definition-version <version> --agent-definition-digest <sha256>] [--effort <low|medium|high|xhigh|max|ultra>] [--base <branch-tag-or-commit>] [--title <text>] [--message <text> | --prompt-stdin | --from-file <path>]",
|
|
22
|
+
0,
|
|
23
|
+
"session.create",
|
|
24
|
+
"Create a Session, optionally starting it with a first message.",
|
|
25
|
+
{
|
|
26
|
+
example: "maia --json session create --executor codex-cli --message 'Fix the build' --command-id create-1",
|
|
27
|
+
route: ["--project", "--workspace"],
|
|
28
|
+
run: [session, "runSessionCreate"],
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
[
|
|
32
|
+
"session list (--project <project-id> | --all) [--state <state>[,<state>...]] [--attention] [--limit <1..100>] [--after <cursor>]",
|
|
33
|
+
0,
|
|
34
|
+
"session.list",
|
|
35
|
+
"List Sessions of a Project, or all of them.",
|
|
36
|
+
{
|
|
37
|
+
example: "maia --json session list --all --attention",
|
|
38
|
+
route: "--project",
|
|
39
|
+
run: [session, "runSessionList"],
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
[
|
|
43
|
+
"session show <session-id>",
|
|
44
|
+
0,
|
|
45
|
+
"session.show",
|
|
46
|
+
"Show one Session.",
|
|
47
|
+
{
|
|
48
|
+
example: "maia --json session show session_1",
|
|
49
|
+
route: "<session-id>",
|
|
50
|
+
run: [session, "runSessionShow"],
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
[
|
|
54
|
+
"session wait <session-id> --until <state>[,<state>...] [--timeout <duration>]",
|
|
55
|
+
1,
|
|
56
|
+
"session.wait",
|
|
57
|
+
"Wait until a Session reaches one of the states; exits 74 on timeout.",
|
|
58
|
+
{
|
|
59
|
+
example: "maia --json session wait session_1 --until idle --until failed --timeout 10m",
|
|
60
|
+
route: "<session-id>",
|
|
61
|
+
run: [session, "runSessionWait"],
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
[
|
|
65
|
+
"session rename <session-id> --title <text> --expected-revision <revision> [--command-id <id>]",
|
|
66
|
+
1,
|
|
67
|
+
"session.rename",
|
|
68
|
+
"Rename a Session at its current revision.",
|
|
69
|
+
{
|
|
70
|
+
example: "maia --json session rename session_1 --title 'Fix the build' --expected-revision 2",
|
|
71
|
+
route: "<session-id>",
|
|
72
|
+
run: [session, "runSessionRename"],
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
[
|
|
76
|
+
"session start <session-id> --expected-revision <revision> [--command-id <id>] [--wait [--timeout <duration>]]",
|
|
77
|
+
1,
|
|
78
|
+
"session.start",
|
|
79
|
+
"Start a Session; --wait returns once it runs.",
|
|
80
|
+
{
|
|
81
|
+
example: "maia --json session start session_1 --expected-revision 1 --command-id start-1 --wait",
|
|
82
|
+
route: "<session-id>",
|
|
83
|
+
run: [session, "runSessionStart"],
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
[
|
|
87
|
+
"session stop <session-id> --expected-revision <revision> [--command-id <id>]",
|
|
88
|
+
1,
|
|
89
|
+
"session.stop",
|
|
90
|
+
"Stop a Session.",
|
|
91
|
+
{
|
|
92
|
+
example: "maia --json session stop session_1 --expected-revision 2 --command-id stop-1",
|
|
93
|
+
route: "<session-id>",
|
|
94
|
+
run: [session, "runSessionStop"],
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
[
|
|
98
|
+
"session resume <session-id> --expected-revision <revision> [--command-id <id>]",
|
|
99
|
+
1,
|
|
100
|
+
"session.resume",
|
|
101
|
+
"Resume a stopped Session.",
|
|
102
|
+
{ route: "<session-id>", run: [session, "runSessionResume"] },
|
|
103
|
+
],
|
|
104
|
+
[
|
|
105
|
+
"session archive <session-id> --expected-revision <revision> [--command-id <id>]",
|
|
106
|
+
1,
|
|
107
|
+
"session.archive",
|
|
108
|
+
"Archive a Session and retire its worktree.",
|
|
109
|
+
{
|
|
110
|
+
example: "maia --json session archive session_1 --expected-revision 3 --command-id archive-1",
|
|
111
|
+
route: "<session-id>",
|
|
112
|
+
run: [session, "runSessionArchive"],
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
[
|
|
116
|
+
"session diff <session-id> [--stat]",
|
|
117
|
+
1,
|
|
118
|
+
"session.diff",
|
|
119
|
+
"Show the changes a coding Session made.",
|
|
120
|
+
{
|
|
121
|
+
example: "maia session diff session_1 --stat",
|
|
122
|
+
route: "<session-id>",
|
|
123
|
+
run: [session, "runSessionDiff"],
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
[
|
|
127
|
+
"session observe [<session-id>...] [--stall-after <duration>]",
|
|
128
|
+
0,
|
|
129
|
+
"session.observe",
|
|
130
|
+
"Stream Session state changes and stalls.",
|
|
131
|
+
{
|
|
132
|
+
example: "maia --json session observe --stall-after 5m",
|
|
133
|
+
run: [session, "runSessionObserve"],
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
[
|
|
137
|
+
"session attach <session-id> [--after <epoch>:<sequence>] [--no-follow]",
|
|
138
|
+
1,
|
|
139
|
+
"session.attach",
|
|
140
|
+
"Follow a Session's live items.",
|
|
141
|
+
{
|
|
142
|
+
example: "maia session attach session_1",
|
|
143
|
+
route: "<session-id>",
|
|
144
|
+
run: [session, "runSessionAttach"],
|
|
145
|
+
},
|
|
146
|
+
],
|
|
147
|
+
[
|
|
148
|
+
"session events list --session <session-id> [--limit <1..32>] [--after <session-cursor>]",
|
|
149
|
+
0,
|
|
150
|
+
"session.events.list",
|
|
151
|
+
"List a Session's events.",
|
|
152
|
+
{ route: "--session", run: [session, "runSessionEventsList"] },
|
|
153
|
+
],
|
|
154
|
+
[
|
|
155
|
+
"session history read <session-id|claude:<id>|codex:<id>> [--offset <n>] [--limit <1..50>]",
|
|
156
|
+
1,
|
|
157
|
+
"session.history.read",
|
|
158
|
+
"Read a Session's or vendor session's history.",
|
|
159
|
+
{
|
|
160
|
+
route: "<session-id|claude:<id>|codex:<id>>",
|
|
161
|
+
run: [discovery, "runHistoryRead"],
|
|
162
|
+
},
|
|
163
|
+
],
|
|
164
|
+
[
|
|
165
|
+
"session adopt (<claude|codex>:<native-id> --workspace <workspace-id> [--attest-ended] [--command-id <id>] [--dry-run] | --confirm-stdin)",
|
|
166
|
+
1,
|
|
167
|
+
["session.adopt.preview", "session.adopt.confirm"],
|
|
168
|
+
"Adopt a Claude Code or Codex session after a preview.",
|
|
169
|
+
{
|
|
170
|
+
example: "maia --json session adopt codex:019a --workspace workspace_1 --dry-run",
|
|
171
|
+
kind: "two-phase",
|
|
172
|
+
run: [discovery, "runAdopt"],
|
|
173
|
+
},
|
|
174
|
+
],
|
|
175
|
+
[
|
|
176
|
+
"session agent-permission set (--input-stdin --dry-run | --confirm-stdin)",
|
|
177
|
+
1,
|
|
178
|
+
["session.agent-permission.preview", "session.agent-permission.confirm"],
|
|
179
|
+
"Grant or change an agent permission after a preview.",
|
|
180
|
+
{ kind: "two-phase", run: [session, "runAgentPermissionSet"] },
|
|
181
|
+
],
|
|
182
|
+
[
|
|
183
|
+
"session message send --session <recipient-session-id> --attached --subject <text> --body-stdin [--command-id <id>]",
|
|
184
|
+
1,
|
|
185
|
+
"session.message.send",
|
|
186
|
+
"Send a message to another Session.",
|
|
187
|
+
{ run: [session, "runSessionMessageSend"] },
|
|
188
|
+
],
|
|
189
|
+
[
|
|
190
|
+
"session inbox check --attached [--limit <1..16>]",
|
|
191
|
+
1,
|
|
192
|
+
"session.inbox.check",
|
|
193
|
+
"Check this Session's inbox.",
|
|
194
|
+
{ run: [session, "runSessionInboxCheck"] },
|
|
195
|
+
],
|
|
196
|
+
[
|
|
197
|
+
"session inbox ack <delivery-id> --attached --expected-mailbox-revision <revision> [--command-id <id>]",
|
|
198
|
+
1,
|
|
199
|
+
"session.inbox.ack",
|
|
200
|
+
"Acknowledge one message delivered to this Session.",
|
|
201
|
+
{ run: [session, "runSessionInboxAck"] },
|
|
202
|
+
],
|
|
203
|
+
[
|
|
204
|
+
"session turn send --session <session-id> --prompt-stdin --expected-revision <revision> [--command-id <id>]",
|
|
205
|
+
1,
|
|
206
|
+
"turn.send",
|
|
207
|
+
"Send a turn from stdin; it queues behind the running turn.",
|
|
208
|
+
{
|
|
209
|
+
example: "printf %s 'Explain the build' | maia --json session turn send --session session_1 --prompt-stdin --expected-revision 2 --command-id send-1",
|
|
210
|
+
route: "--session",
|
|
211
|
+
run: [turn, "runTurnSend"],
|
|
212
|
+
},
|
|
213
|
+
],
|
|
214
|
+
[
|
|
215
|
+
"session turn queue <session-id>",
|
|
216
|
+
1,
|
|
217
|
+
"turn.queue.list",
|
|
218
|
+
"List the running turn and the queued turns in dispatch order.",
|
|
219
|
+
{
|
|
220
|
+
example: "maia --json session turn queue session_1",
|
|
221
|
+
route: "<session-id>",
|
|
222
|
+
run: [turn, "runTurnQueue"],
|
|
223
|
+
},
|
|
224
|
+
],
|
|
225
|
+
[
|
|
226
|
+
"session turn cancel <turn-id> --expected-turn-revision <revision> [--command-id <id>]",
|
|
227
|
+
1,
|
|
228
|
+
"turn.cancel",
|
|
229
|
+
"Cancel a queued turn at the turn's own revision.",
|
|
230
|
+
{
|
|
231
|
+
example: "maia --json session turn cancel turn_2 --expected-turn-revision 1 --command-id cancel-turn-2",
|
|
232
|
+
route: "<turn-id>",
|
|
233
|
+
run: [turn, "runTurnCancel"],
|
|
234
|
+
},
|
|
235
|
+
],
|
|
236
|
+
[
|
|
237
|
+
"session turn show <turn-id> [--include-content]",
|
|
238
|
+
1,
|
|
239
|
+
"turn.show",
|
|
240
|
+
"Show one turn, its usage and, with --include-content, its text.",
|
|
241
|
+
{
|
|
242
|
+
example: "maia --json session turn show turn_1 --include-content",
|
|
243
|
+
route: "<turn-id>",
|
|
244
|
+
run: [turn, "runTurnShow"],
|
|
245
|
+
},
|
|
246
|
+
],
|
|
247
|
+
[
|
|
248
|
+
"session turn wait <turn-id>... [--any] [--timeout <duration>]",
|
|
249
|
+
1,
|
|
250
|
+
"turn.wait",
|
|
251
|
+
"Wait for turns to finish; a failed turn exits non-zero.",
|
|
252
|
+
{
|
|
253
|
+
example: "maia --json session turn wait turn_1 --timeout 10m",
|
|
254
|
+
route: "<turn-id>",
|
|
255
|
+
run: [turn, "runTurnWait"],
|
|
256
|
+
},
|
|
257
|
+
],
|
|
258
|
+
[
|
|
259
|
+
"session turn interrupt <turn-id> --expected-session-revision <revision> [--command-id <id>]",
|
|
260
|
+
1,
|
|
261
|
+
"turn.interrupt",
|
|
262
|
+
"Interrupt a running turn at its Session's revision.",
|
|
263
|
+
{
|
|
264
|
+
example: "maia --json session turn interrupt turn_1 --expected-session-revision 4 --command-id stop-turn-1",
|
|
265
|
+
route: "<turn-id>",
|
|
266
|
+
run: [turn, "runTurnInterrupt"],
|
|
267
|
+
},
|
|
268
|
+
],
|
|
269
|
+
[
|
|
270
|
+
"session approval list [--session <session-id>] [--all] [--limit <1..50>]",
|
|
271
|
+
1,
|
|
272
|
+
"approval.list",
|
|
273
|
+
"List what workers wait on a person for.",
|
|
274
|
+
{
|
|
275
|
+
example: "maia --json session approval list --all",
|
|
276
|
+
route: "--session",
|
|
277
|
+
run: [approval, "runApprovalList"],
|
|
278
|
+
},
|
|
279
|
+
],
|
|
280
|
+
[
|
|
281
|
+
"session approval show <approval-id>",
|
|
282
|
+
1,
|
|
283
|
+
"approval.show",
|
|
284
|
+
"Show one approval request.",
|
|
285
|
+
{ route: "<approval-id>", run: [approval, "runApprovalShow"] },
|
|
286
|
+
],
|
|
287
|
+
[
|
|
288
|
+
"session approval approve <approval-id> [--for-session] [--command-id <id>]",
|
|
289
|
+
1,
|
|
290
|
+
"approval.respond",
|
|
291
|
+
"Approve a worker's request.",
|
|
292
|
+
{
|
|
293
|
+
example: "maia session approval approve approval_1 --command-id approve-1",
|
|
294
|
+
kind: "discriminant",
|
|
295
|
+
route: "<approval-id>",
|
|
296
|
+
run: [approval, "runApprovalApprove"],
|
|
297
|
+
},
|
|
298
|
+
],
|
|
299
|
+
[
|
|
300
|
+
"session approval deny <approval-id> [--reason <text>] [--command-id <id>]",
|
|
301
|
+
1,
|
|
302
|
+
"approval.respond",
|
|
303
|
+
"Deny a worker's request.",
|
|
304
|
+
{
|
|
305
|
+
kind: "discriminant",
|
|
306
|
+
route: "<approval-id>",
|
|
307
|
+
run: [approval, "runApprovalDeny"],
|
|
308
|
+
},
|
|
309
|
+
],
|
|
310
|
+
[
|
|
311
|
+
"session approval answer <approval-id> (--text <answer> | --option <option-id>) [--command-id <id>]",
|
|
312
|
+
1,
|
|
313
|
+
"approval.respond",
|
|
314
|
+
"Answer a worker's question.",
|
|
315
|
+
{
|
|
316
|
+
kind: "discriminant",
|
|
317
|
+
route: "<approval-id>",
|
|
318
|
+
run: [approval, "runApprovalAnswer"],
|
|
319
|
+
},
|
|
320
|
+
],
|
|
321
|
+
[
|
|
322
|
+
"session interaction create --input-stdin",
|
|
323
|
+
1,
|
|
324
|
+
"interaction.create",
|
|
325
|
+
"Ask a person a question for an idle Session.",
|
|
326
|
+
{ run: [interaction, "runInteractionCreate"] },
|
|
327
|
+
],
|
|
328
|
+
[
|
|
329
|
+
"session interaction list --session <session-id> --project <project-id> [--status <pending|answered|cancelled|expired>] [--limit <1..100>] [--after <cursor>]",
|
|
330
|
+
1,
|
|
331
|
+
"interaction.list",
|
|
332
|
+
"List a Session's questions.",
|
|
333
|
+
{ run: [interaction, "runInteractionList"] },
|
|
334
|
+
],
|
|
335
|
+
[
|
|
336
|
+
"session interaction show <interaction-id>",
|
|
337
|
+
1,
|
|
338
|
+
"interaction.show",
|
|
339
|
+
"Show one question.",
|
|
340
|
+
{ run: [interaction, "runInteractionShow"] },
|
|
341
|
+
],
|
|
342
|
+
[
|
|
343
|
+
"session interaction respond --input-stdin",
|
|
344
|
+
1,
|
|
345
|
+
"interaction.respond",
|
|
346
|
+
"Record an answer to a question.",
|
|
347
|
+
{ run: [interaction, "runInteractionRespond"] },
|
|
348
|
+
],
|
|
349
|
+
[
|
|
350
|
+
"session interaction cancel --input-stdin",
|
|
351
|
+
1,
|
|
352
|
+
"interaction.cancel",
|
|
353
|
+
"Cancel a question.",
|
|
354
|
+
{ run: [interaction, "runInteractionCancel"] },
|
|
355
|
+
],
|
|
356
|
+
[
|
|
357
|
+
"import scan [--source claude,codex] [--since <days>d] [--root <path>] [--include-content] [--limit <1..100>] [--after <cursor>]",
|
|
358
|
+
1,
|
|
359
|
+
"discovery.sessions.list",
|
|
360
|
+
"Find Claude Code and Codex sessions to adopt.",
|
|
361
|
+
{
|
|
362
|
+
example: "maia --json import scan --source codex --since 7d",
|
|
363
|
+
run: [discovery, "runScan"],
|
|
364
|
+
},
|
|
365
|
+
],
|
|
366
|
+
],
|
|
367
|
+
};
|
|
368
|
+
//# sourceMappingURL=tree.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { TurnCancelResult, TurnInterruptResult, TurnQueueListResult, TurnSendResult, TurnShowResult, TurnWaitParameters, TurnWaitResult } from "@maiaos/sdk";
|
|
2
|
+
import { type CliNodeEffect, type CliNodeOperations } from "../../local-node/index.js";
|
|
3
|
+
export type InterruptTurnInput = {
|
|
4
|
+
readonly commandId?: string;
|
|
5
|
+
readonly expectedRevision: string;
|
|
6
|
+
readonly turnId: string;
|
|
7
|
+
};
|
|
8
|
+
export type CancelTurnInput = InterruptTurnInput;
|
|
9
|
+
export type SendTurnInput = {
|
|
10
|
+
readonly commandId?: string;
|
|
11
|
+
readonly expectedRevision: string;
|
|
12
|
+
readonly prompt: string;
|
|
13
|
+
readonly sessionId: string;
|
|
14
|
+
};
|
|
15
|
+
export type WaitTurnsInput = {
|
|
16
|
+
readonly mode: TurnWaitParameters["mode"];
|
|
17
|
+
readonly timeoutMilliseconds: number;
|
|
18
|
+
readonly turnIds: readonly string[];
|
|
19
|
+
};
|
|
20
|
+
export declare const makeTurnClient: (node: CliNodeOperations) => {
|
|
21
|
+
cancelTurn: (input: CancelTurnInput) => CliNodeEffect<TurnCancelResult>;
|
|
22
|
+
interruptTurn: (input: InterruptTurnInput) => CliNodeEffect<TurnInterruptResult>;
|
|
23
|
+
listTurnQueue: (sessionId: string) => CliNodeEffect<TurnQueueListResult>;
|
|
24
|
+
sendTurn: (input: SendTurnInput) => CliNodeEffect<TurnSendResult>;
|
|
25
|
+
showTurn: (turnId: string) => CliNodeEffect<TurnShowResult>;
|
|
26
|
+
waitTurns: (input: WaitTurnsInput) => CliNodeEffect<TurnWaitResult>;
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { MAX_TURN_WAIT_MILLISECONDS, turnCancelParametersSchema, turnInterruptParametersSchema, turnQueueListParametersSchema, turnSendParametersSchema, turnShowParametersSchema, turnWaitParametersSchema, } from "@maiaos/sdk";
|
|
2
|
+
import { Effect } from "effect";
|
|
3
|
+
import { commandIdentifier, repeatBoundedWait, } from "../../local-node/index.js";
|
|
4
|
+
export const makeTurnClient = (node) => {
|
|
5
|
+
const interruptTurn = (input) => {
|
|
6
|
+
return Effect.flatMap(commandIdentifier(input.commandId), (commandId) => {
|
|
7
|
+
return node.runValidatedNodeOperation({
|
|
8
|
+
commandId,
|
|
9
|
+
expectedRevision: input.expectedRevision,
|
|
10
|
+
turnId: input.turnId,
|
|
11
|
+
}, turnInterruptParametersSchema, (client, parameters, options) => client.interruptTurn(parameters, options), { commandId });
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
const cancelTurn = (input) => Effect.flatMap(commandIdentifier(input.commandId), (commandId) => node.runValidatedNodeOperation({
|
|
15
|
+
commandId,
|
|
16
|
+
expectedRevision: input.expectedRevision,
|
|
17
|
+
turnId: input.turnId,
|
|
18
|
+
}, turnCancelParametersSchema, (client, parameters, options) => client.cancelTurn(parameters, options), { commandId }));
|
|
19
|
+
const listTurnQueue = (sessionId) => node.runValidatedNodeOperation({ sessionId }, turnQueueListParametersSchema, (client, parameters, options) => client.listTurnQueue(parameters, options));
|
|
20
|
+
const sendTurn = (input) => {
|
|
21
|
+
return Effect.flatMap(commandIdentifier(input.commandId), (commandId) => {
|
|
22
|
+
return node.runValidatedNodeOperation({
|
|
23
|
+
commandId,
|
|
24
|
+
expectedRevision: input.expectedRevision,
|
|
25
|
+
input: { text: input.prompt, type: "text" },
|
|
26
|
+
sessionId: input.sessionId,
|
|
27
|
+
}, turnSendParametersSchema, (client, parameters, options) => client.sendTurn(parameters, options), { commandId });
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
const showTurn = (turnId) => node.runValidatedNodeOperation({ turnId }, turnShowParametersSchema, (client, parameters, options) => client.showTurn(parameters, options));
|
|
31
|
+
const waitTurnsOnce = (parameters) => node.runValidatedNodeOperation(parameters, turnWaitParametersSchema, (client, validated, options) => client.waitTurns(validated, options));
|
|
32
|
+
const waitWithin = (input) => repeatBoundedWait({
|
|
33
|
+
maxRequestMilliseconds: MAX_TURN_WAIT_MILLISECONDS,
|
|
34
|
+
once: (waitMilliseconds) => waitTurnsOnce({
|
|
35
|
+
mode: input.mode,
|
|
36
|
+
turnIds: input.turnIds,
|
|
37
|
+
waitMilliseconds,
|
|
38
|
+
}),
|
|
39
|
+
satisfied: (value) => value.satisfied,
|
|
40
|
+
timeoutMilliseconds: input.timeoutMilliseconds,
|
|
41
|
+
});
|
|
42
|
+
return {
|
|
43
|
+
cancelTurn,
|
|
44
|
+
interruptTurn,
|
|
45
|
+
listTurnQueue,
|
|
46
|
+
sendTurn,
|
|
47
|
+
showTurn,
|
|
48
|
+
waitTurns: waitWithin,
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type CommandContext, type CommandEffect } from "../../command-line/index.js";
|
|
2
|
+
export declare const runTurnSend: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
3
|
+
export declare const runTurnInterrupt: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
4
|
+
export declare const runTurnCancel: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
5
|
+
export declare const runTurnQueue: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
6
|
+
export declare const runTurnShow: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
7
|
+
export declare const runTurnWait: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
8
|
+
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { MAX_TURN_INPUT_BYTES, MAX_TURN_WAIT_IDS, } from "@maiaos/sdk";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import { CliArgumentError, parseOptions, readExpectedRevision, readRevisionOption, readWaitTimeoutSeconds, requirePositionals, writeNodeResult, } from "../../command-line/index.js";
|
|
4
|
+
import { formatTurnMutation, formatTurnQueue, formatTurnShow, formatTurnWait, turnWaitExitCode, } from "./output.js";
|
|
5
|
+
const utf8 = new TextEncoder();
|
|
6
|
+
const summarizeTurnMutation = (result) => ({
|
|
7
|
+
delivery: result.delivery,
|
|
8
|
+
receipt: result.receipt,
|
|
9
|
+
revision: result.turn.revision,
|
|
10
|
+
sessionId: result.turn.sessionId,
|
|
11
|
+
state: result.turn.state,
|
|
12
|
+
turnId: result.turn.id,
|
|
13
|
+
});
|
|
14
|
+
const parseTurnSendArguments = (tokens) => {
|
|
15
|
+
const parsed = parseOptions(tokens, new Set(["--command-id", "--expected-revision", "--session"]), new Set(["--prompt-stdin"]));
|
|
16
|
+
requirePositionals(parsed.positionals, 0);
|
|
17
|
+
const sessionId = parsed.options.get("--session");
|
|
18
|
+
if (sessionId === undefined) {
|
|
19
|
+
throw new CliArgumentError("Option '--session' is required.");
|
|
20
|
+
}
|
|
21
|
+
if (!parsed.flags.has("--prompt-stdin")) {
|
|
22
|
+
throw new CliArgumentError("Option '--prompt-stdin' is required.");
|
|
23
|
+
}
|
|
24
|
+
const commandId = parsed.options.get("--command-id");
|
|
25
|
+
return {
|
|
26
|
+
expectedRevision: readExpectedRevision(parsed.options.get("--expected-revision")),
|
|
27
|
+
sessionId,
|
|
28
|
+
...(commandId === undefined ? {} : { commandId }),
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export const runTurnSend = (tokens, context) => Effect.gen(function* () {
|
|
32
|
+
const input = parseTurnSendArguments(tokens);
|
|
33
|
+
if (context.io.stdin === undefined) {
|
|
34
|
+
throw new CliArgumentError("Standard input is unavailable.");
|
|
35
|
+
}
|
|
36
|
+
const prompt = yield* context.io.stdin({
|
|
37
|
+
label: "turn prompt",
|
|
38
|
+
maxBytes: MAX_TURN_INPUT_BYTES,
|
|
39
|
+
maxChunks: 1024,
|
|
40
|
+
});
|
|
41
|
+
const result = yield* context.dependencies.sendTurn({ ...input, prompt });
|
|
42
|
+
return writeNodeResult(result, context, {
|
|
43
|
+
toResult: (value) => ({
|
|
44
|
+
command: "turn.send",
|
|
45
|
+
result: summarizeTurnMutation(value),
|
|
46
|
+
}),
|
|
47
|
+
toText: formatTurnMutation,
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
const parseTurnMutationArguments = (tokens, revisionOption) => {
|
|
51
|
+
const parsed = parseOptions(tokens, new Set(["--command-id", revisionOption]));
|
|
52
|
+
requirePositionals(parsed.positionals, 1);
|
|
53
|
+
const turnId = parsed.positionals[0];
|
|
54
|
+
if (turnId === undefined) {
|
|
55
|
+
throw new CliArgumentError("The turn identifier is missing.");
|
|
56
|
+
}
|
|
57
|
+
const commandId = parsed.options.get("--command-id");
|
|
58
|
+
return {
|
|
59
|
+
expectedRevision: readRevisionOption(parsed.options.get(revisionOption), revisionOption),
|
|
60
|
+
turnId,
|
|
61
|
+
...(commandId === undefined ? {} : { commandId }),
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
export const runTurnInterrupt = (tokens, context) => Effect.gen(function* () {
|
|
65
|
+
const input = parseTurnMutationArguments(tokens, "--expected-session-revision");
|
|
66
|
+
const result = yield* context.dependencies.interruptTurn(input);
|
|
67
|
+
return writeNodeResult(result, context, {
|
|
68
|
+
toResult: (value) => ({
|
|
69
|
+
command: "turn.interrupt",
|
|
70
|
+
result: summarizeTurnMutation(value),
|
|
71
|
+
}),
|
|
72
|
+
toText: formatTurnMutation,
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
export const runTurnCancel = (tokens, context) => Effect.gen(function* () {
|
|
76
|
+
const input = parseTurnMutationArguments(tokens, "--expected-turn-revision");
|
|
77
|
+
const { cancelTurn } = context.dependencies;
|
|
78
|
+
if (cancelTurn === undefined)
|
|
79
|
+
throw new CliArgumentError("Turn cancel is unavailable.");
|
|
80
|
+
const result = yield* cancelTurn(input);
|
|
81
|
+
return writeNodeResult(result, context, {
|
|
82
|
+
toResult: (value) => ({
|
|
83
|
+
command: "turn.cancel",
|
|
84
|
+
result: summarizeTurnMutation(value),
|
|
85
|
+
}),
|
|
86
|
+
toText: formatTurnMutation,
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
export const runTurnQueue = (tokens, context) => Effect.gen(function* () {
|
|
90
|
+
const parsed = parseOptions(tokens, new Set());
|
|
91
|
+
requirePositionals(parsed.positionals, 1);
|
|
92
|
+
const sessionId = parsed.positionals[0];
|
|
93
|
+
if (sessionId === undefined) {
|
|
94
|
+
throw new CliArgumentError("The Session identifier is missing.");
|
|
95
|
+
}
|
|
96
|
+
const { listTurnQueue } = context.dependencies;
|
|
97
|
+
if (listTurnQueue === undefined)
|
|
98
|
+
throw new CliArgumentError("Turn queue is unavailable.");
|
|
99
|
+
const result = yield* listTurnQueue(sessionId);
|
|
100
|
+
return writeNodeResult(result, context, {
|
|
101
|
+
toResult: (value) => ({
|
|
102
|
+
command: "turn.queue.list",
|
|
103
|
+
result: value,
|
|
104
|
+
}),
|
|
105
|
+
toText: formatTurnQueue,
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
const parseTurnShowArguments = (tokens) => {
|
|
109
|
+
const parsed = parseOptions(tokens, new Set(), new Set(["--include-content"]));
|
|
110
|
+
requirePositionals(parsed.positionals, 1);
|
|
111
|
+
const includeContent = parsed.flags.has("--include-content");
|
|
112
|
+
const turnId = parsed.positionals[0];
|
|
113
|
+
if (turnId === undefined) {
|
|
114
|
+
throw new CliArgumentError("The turn identifier is missing.");
|
|
115
|
+
}
|
|
116
|
+
return { includeContent, turnId };
|
|
117
|
+
};
|
|
118
|
+
const turnTerminalProjection = (turn) => {
|
|
119
|
+
if (turn.state === "completed") {
|
|
120
|
+
return {
|
|
121
|
+
responseBytes: utf8.encode(turn.responseText).byteLength,
|
|
122
|
+
...(turn.tokenUsage === undefined ? {} : { tokenUsage: turn.tokenUsage }),
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
return turn.state === "failed" || turn.state === "outcome-unknown"
|
|
126
|
+
? {
|
|
127
|
+
...(turn.failure === undefined ? {} : { failure: turn.failure }),
|
|
128
|
+
failureReason: turn.failureReason,
|
|
129
|
+
}
|
|
130
|
+
: {};
|
|
131
|
+
};
|
|
132
|
+
const projectTurnWithoutContent = (value) => ({
|
|
133
|
+
contentIncluded: false,
|
|
134
|
+
method: value.method,
|
|
135
|
+
turn: {
|
|
136
|
+
id: value.turn.id,
|
|
137
|
+
inputBytes: utf8.encode(value.turn.input.text).byteLength,
|
|
138
|
+
revision: value.turn.revision,
|
|
139
|
+
sessionId: value.turn.sessionId,
|
|
140
|
+
sessionRevision: value.turn.sessionRevision,
|
|
141
|
+
state: value.turn.state,
|
|
142
|
+
...turnTerminalProjection(value.turn),
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
const summarizeTurnShow = (value, includeContent) => includeContent
|
|
146
|
+
? { ...value, contentIncluded: true }
|
|
147
|
+
: projectTurnWithoutContent(value);
|
|
148
|
+
export const runTurnShow = (tokens, context) => Effect.gen(function* () {
|
|
149
|
+
const input = parseTurnShowArguments(tokens);
|
|
150
|
+
const result = yield* context.dependencies.showTurn(input.turnId);
|
|
151
|
+
return writeNodeResult(result, context, {
|
|
152
|
+
toResult: (value) => ({
|
|
153
|
+
command: "turn.show",
|
|
154
|
+
result: summarizeTurnShow(value, input.includeContent),
|
|
155
|
+
}),
|
|
156
|
+
toText: formatTurnShow,
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
const parseTurnWaitArguments = (tokens) => {
|
|
160
|
+
const parsed = parseOptions(tokens, new Set(["--timeout"]), new Set(["--any"]));
|
|
161
|
+
if (parsed.positionals.length === 0 ||
|
|
162
|
+
parsed.positionals.length > MAX_TURN_WAIT_IDS)
|
|
163
|
+
throw new CliArgumentError(`Wait for 1 to ${String(MAX_TURN_WAIT_IDS)} turns.`);
|
|
164
|
+
return {
|
|
165
|
+
mode: parsed.flags.has("--any") ? "any" : "all",
|
|
166
|
+
timeoutMilliseconds: readWaitTimeoutSeconds(parsed.options.get("--timeout")) * 1000,
|
|
167
|
+
turnIds: parsed.positionals,
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
export const runTurnWait = (tokens, context) => Effect.gen(function* () {
|
|
171
|
+
const input = parseTurnWaitArguments(tokens);
|
|
172
|
+
const { waitTurns } = context.dependencies;
|
|
173
|
+
if (waitTurns === undefined)
|
|
174
|
+
throw new CliArgumentError("Turn wait is unavailable.");
|
|
175
|
+
const result = yield* waitTurns(input);
|
|
176
|
+
const code = writeNodeResult(result, context, {
|
|
177
|
+
toResult: (value) => ({
|
|
178
|
+
command: "turn.wait",
|
|
179
|
+
result: value,
|
|
180
|
+
}),
|
|
181
|
+
toText: formatTurnWait,
|
|
182
|
+
});
|
|
183
|
+
return result.ok ? turnWaitExitCode(result.value) : code;
|
|
184
|
+
});
|
|
185
|
+
//# sourceMappingURL=commands.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { type CancelTurnInput, type InterruptTurnInput, makeTurnClient, type SendTurnInput, type WaitTurnsInput, } from "./client.js";
|
|
2
|
+
export { runTurnCancel, runTurnInterrupt, runTurnQueue, runTurnSend, runTurnShow, runTurnWait, } from "./commands.js";
|
|
3
|
+
export { type CliTurnMutation, type CliTurnQueue, type CliTurnShow, type CliTurnWait, } from "./output.js";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|