@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,128 @@
|
|
|
1
|
+
import { MAX_SESSION_CREATION_TASKS, MAX_TURN_INPUT_BYTES, } from "@maiaos/sdk";
|
|
2
|
+
import { Effect } from "effect";
|
|
3
|
+
import { CliArgumentError, reportError, writeSuccess, } from "../command-line/index.js";
|
|
4
|
+
import { formatSessionTasks } from "./output/index.js";
|
|
5
|
+
import { readTaskFile } from "./task-file.js";
|
|
6
|
+
const EXIT_OUTCOME_UNKNOWN = 76;
|
|
7
|
+
const EXIT_REFUSED = 70;
|
|
8
|
+
const readText = (source, context) => {
|
|
9
|
+
if (source.kind === "message")
|
|
10
|
+
return Effect.succeed(source.text);
|
|
11
|
+
if (source.kind === "file")
|
|
12
|
+
return readTaskFile(source.path);
|
|
13
|
+
if (context.io.stdin === undefined)
|
|
14
|
+
return Effect.fail(new CliArgumentError("Standard input is unavailable."));
|
|
15
|
+
return context.io.stdin({
|
|
16
|
+
label: "Session task",
|
|
17
|
+
maxBytes: MAX_TURN_INPUT_BYTES,
|
|
18
|
+
maxChunks: 1024,
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
const refusalMessage = (refusal) => refusal.reason === "too_long"
|
|
22
|
+
? `Task line ${String(refusal.line)} exceeds ${String(MAX_TURN_INPUT_BYTES)} bytes.`
|
|
23
|
+
: `A batch holds at most ${String(MAX_SESSION_CREATION_TASKS)} tasks; line ${String(refusal.line)} is beyond it.`;
|
|
24
|
+
const toTemplate = (selection) => {
|
|
25
|
+
const { agentId, baseRef, connectionId, effort, executor, model, role, title, } = selection;
|
|
26
|
+
return {
|
|
27
|
+
...(agentId === undefined ? {} : { agentId }),
|
|
28
|
+
...(connectionId === undefined ? {} : { connectionId }),
|
|
29
|
+
...(effort === undefined ? {} : { effort }),
|
|
30
|
+
...(executor === undefined ? {} : { executor }),
|
|
31
|
+
...(model === undefined ? {} : { model }),
|
|
32
|
+
...(role === undefined ? {} : { role }),
|
|
33
|
+
...(title === undefined ? {} : { title }),
|
|
34
|
+
...(baseRef === undefined ? {} : { worktree: { baseRef } }),
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
const toInput = (request, text) => {
|
|
38
|
+
const { projectId, selection, source, workspaceId } = request;
|
|
39
|
+
return {
|
|
40
|
+
...(projectId === undefined ? {} : { projectId }),
|
|
41
|
+
session: toTemplate(selection),
|
|
42
|
+
split: source.kind === "file" ? "lines" : "whole",
|
|
43
|
+
text,
|
|
44
|
+
...(workspaceId === undefined ? {} : { workspaceId }),
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
const reportItem = (plan, outcome) => {
|
|
48
|
+
const commandId = outcome.stage === "unknown" ? outcome.error?.commandId : undefined;
|
|
49
|
+
const { error, index, receipts, sessionId, stage, turnId } = outcome;
|
|
50
|
+
return {
|
|
51
|
+
...(error === undefined ? {} : { error }),
|
|
52
|
+
line: plan.items[index]?.line ?? 0,
|
|
53
|
+
receipts,
|
|
54
|
+
...(commandId === undefined ? {} : { recovery: { commandId } }),
|
|
55
|
+
...(sessionId === undefined ? {} : { sessionId }),
|
|
56
|
+
stage,
|
|
57
|
+
...(turnId === undefined ? {} : { turnId }),
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
const MAX_TASK_COMMAND_ID_LENGTH = 122;
|
|
61
|
+
const withCommandId = (plan, commandId) => {
|
|
62
|
+
if (commandId === undefined)
|
|
63
|
+
return plan;
|
|
64
|
+
if (plan.items.length !== 1)
|
|
65
|
+
throw new CliArgumentError("Option '--command-id' names one Session; the input holds several tasks.");
|
|
66
|
+
if (commandId.length > MAX_TASK_COMMAND_ID_LENGTH)
|
|
67
|
+
throw new CliArgumentError(`Option '--command-id' takes at most ${String(MAX_TASK_COMMAND_ID_LENGTH)} characters with a first message.`);
|
|
68
|
+
return {
|
|
69
|
+
...plan,
|
|
70
|
+
items: plan.items.map((item) => ({
|
|
71
|
+
...item,
|
|
72
|
+
commands: {
|
|
73
|
+
create: commandId,
|
|
74
|
+
send: `${commandId}.send`,
|
|
75
|
+
start: `${commandId}.start`,
|
|
76
|
+
},
|
|
77
|
+
})),
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
const exitCode = (items) => {
|
|
81
|
+
if (items.some((item) => item.stage === "unknown"))
|
|
82
|
+
return EXIT_OUTCOME_UNKNOWN;
|
|
83
|
+
return items.every((item) => item.stage === "sent" || item.stage === "started")
|
|
84
|
+
? 0
|
|
85
|
+
: EXIT_REFUSED;
|
|
86
|
+
};
|
|
87
|
+
const batchError = (items) => {
|
|
88
|
+
const failed = items.find((item) => item.error !== undefined);
|
|
89
|
+
if (failed?.error === undefined)
|
|
90
|
+
return undefined;
|
|
91
|
+
const { code, failure, kind, operationId, retryable } = failed.error;
|
|
92
|
+
return {
|
|
93
|
+
code: failure?.code ?? code ?? kind,
|
|
94
|
+
message: failure?.message ??
|
|
95
|
+
`Line ${String(failed.line)} stopped at ${operationId}: ${code ?? kind}.`,
|
|
96
|
+
retryable,
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
const writeBatch = (plan, outcomes, context) => {
|
|
100
|
+
const items = outcomes.map((outcome) => reportItem(plan, outcome));
|
|
101
|
+
const code = exitCode(items);
|
|
102
|
+
const error = batchError(items);
|
|
103
|
+
writeSuccess({
|
|
104
|
+
command: "session.create.tasks",
|
|
105
|
+
result: { items, workspaceId: plan.workspaceId },
|
|
106
|
+
}, { ...context, ...(error === undefined ? {} : { error }), ok: code === 0 }, ({ result }) => formatSessionTasks(result));
|
|
107
|
+
return code;
|
|
108
|
+
};
|
|
109
|
+
export const runSessionTasks = (request, context) => Effect.gen(function* () {
|
|
110
|
+
const { planSessions, runSessions } = context.dependencies;
|
|
111
|
+
if (planSessions === undefined || runSessions === undefined)
|
|
112
|
+
return yield* new CliArgumentError("Session tasks are unavailable.");
|
|
113
|
+
const text = yield* readText(request.source, context);
|
|
114
|
+
if (text.trim() === "")
|
|
115
|
+
return yield* new CliArgumentError("The task text is empty.");
|
|
116
|
+
const planned = yield* planSessions(toInput(request, text));
|
|
117
|
+
if (!planned.ok)
|
|
118
|
+
return reportError(planned.error, context);
|
|
119
|
+
const plan = withCommandId(planned.value, request.commandId);
|
|
120
|
+
const [refusal] = plan.refusals;
|
|
121
|
+
if (refusal !== undefined)
|
|
122
|
+
return yield* new CliArgumentError(refusalMessage(refusal));
|
|
123
|
+
const ran = yield* runSessions(plan);
|
|
124
|
+
if (!ran.ok)
|
|
125
|
+
return reportError(ran.error, context);
|
|
126
|
+
return writeBatch(plan, ran.value, context);
|
|
127
|
+
});
|
|
128
|
+
//# sourceMappingURL=create-tasks.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { runAgentPermissionSet } from "./agent-permission.js";
|
|
2
|
+
export { runSessionAttach } from "./attach.js";
|
|
3
|
+
export { type AttachSessionInput, makeAttachClient, type SessionAttachStream, } from "./attach-client.js";
|
|
4
|
+
export { type CreateSessionInput, type ListSessionsInput, makeSessionClient, type StartSessionInput, } from "./client.js";
|
|
5
|
+
export { type ArchiveSessionInput, type DiffSessionInput, } from "./coding-client.js";
|
|
6
|
+
export { runSessionArchive, runSessionDiff } from "./coding-commands.js";
|
|
7
|
+
export { runSessionCreate, runSessionEventsList, runSessionInboxAck, runSessionInboxCheck, runSessionList, runSessionMessageSend, runSessionObserve, runSessionResume, runSessionShow, runSessionStart, runSessionStop, runSessionWait, } from "./commands.js";
|
|
8
|
+
export { runSessionRename } from "./rename.js";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { runAgentPermissionSet } from "./agent-permission.js";
|
|
2
|
+
export { runSessionAttach } from "./attach.js";
|
|
3
|
+
export { makeAttachClient, } from "./attach-client.js";
|
|
4
|
+
export { makeSessionClient, } from "./client.js";
|
|
5
|
+
export { runSessionArchive, runSessionDiff } from "./coding-commands.js";
|
|
6
|
+
export { runSessionCreate, runSessionEventsList, runSessionInboxAck, runSessionInboxCheck, runSessionList, runSessionMessageSend, runSessionObserve, runSessionResume, runSessionShow, runSessionStart, runSessionStop, runSessionWait, } from "./commands.js";
|
|
7
|
+
export { runSessionRename } from "./rename.js";
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
import { type InteractionCancelParameters, type InteractionCreateParameters, type InteractionListParameters, type InteractionRespondParameters, type InteractionShowParameters } from "@maiaos/sdk";
|
|
2
|
+
import type { CliNodeOperations } from "../../local-node/index.js";
|
|
3
|
+
export declare const makeInteractionClient: (node: CliNodeOperations) => {
|
|
4
|
+
listInteractions: (input: InteractionListParameters) => import("../../local-node/client.js").CliNodeEffect<{
|
|
5
|
+
readonly items: readonly ({
|
|
6
|
+
readonly activationId: null;
|
|
7
|
+
readonly answeredAt: string | null;
|
|
8
|
+
readonly answerSchemaDigest: string;
|
|
9
|
+
readonly body: string;
|
|
10
|
+
readonly createdAt: string;
|
|
11
|
+
readonly expiresAt: string | null;
|
|
12
|
+
readonly interactionId: string;
|
|
13
|
+
readonly lifecycleStatus: "answered" | "cancelled" | "expired" | "pending";
|
|
14
|
+
readonly origin: {
|
|
15
|
+
readonly kind: "external-cli";
|
|
16
|
+
};
|
|
17
|
+
readonly projectId: string;
|
|
18
|
+
readonly requestingActorId: string;
|
|
19
|
+
readonly revision: string;
|
|
20
|
+
readonly schemaVersion: "maia.interaction/v1";
|
|
21
|
+
readonly sessionId: string;
|
|
22
|
+
readonly subject: string;
|
|
23
|
+
readonly wakeDisposition: "record-only";
|
|
24
|
+
readonly kind: "question";
|
|
25
|
+
} | {
|
|
26
|
+
readonly activationId: null;
|
|
27
|
+
readonly answeredAt: string | null;
|
|
28
|
+
readonly answerSchemaDigest: string;
|
|
29
|
+
readonly body: string;
|
|
30
|
+
readonly createdAt: string;
|
|
31
|
+
readonly expiresAt: string | null;
|
|
32
|
+
readonly interactionId: string;
|
|
33
|
+
readonly lifecycleStatus: "answered" | "cancelled" | "expired" | "pending";
|
|
34
|
+
readonly origin: {
|
|
35
|
+
readonly kind: "external-cli";
|
|
36
|
+
};
|
|
37
|
+
readonly projectId: string;
|
|
38
|
+
readonly requestingActorId: string;
|
|
39
|
+
readonly revision: string;
|
|
40
|
+
readonly schemaVersion: "maia.interaction/v1";
|
|
41
|
+
readonly sessionId: string;
|
|
42
|
+
readonly subject: string;
|
|
43
|
+
readonly wakeDisposition: "record-only";
|
|
44
|
+
readonly kind: "selection";
|
|
45
|
+
readonly options: readonly {
|
|
46
|
+
readonly label: string;
|
|
47
|
+
readonly optionId: string;
|
|
48
|
+
}[];
|
|
49
|
+
})[];
|
|
50
|
+
readonly method: "interaction.list";
|
|
51
|
+
readonly nextCursor?: string | undefined;
|
|
52
|
+
readonly projectId: string;
|
|
53
|
+
readonly sessionId: string;
|
|
54
|
+
}>;
|
|
55
|
+
showInteraction: (input: InteractionShowParameters) => import("../../local-node/client.js").CliNodeEffect<{
|
|
56
|
+
readonly interaction: {
|
|
57
|
+
readonly activationId: null;
|
|
58
|
+
readonly answeredAt: string | null;
|
|
59
|
+
readonly answerSchemaDigest: string;
|
|
60
|
+
readonly body: string;
|
|
61
|
+
readonly createdAt: string;
|
|
62
|
+
readonly expiresAt: string | null;
|
|
63
|
+
readonly interactionId: string;
|
|
64
|
+
readonly lifecycleStatus: "answered" | "cancelled" | "expired" | "pending";
|
|
65
|
+
readonly origin: {
|
|
66
|
+
readonly kind: "external-cli";
|
|
67
|
+
};
|
|
68
|
+
readonly projectId: string;
|
|
69
|
+
readonly requestingActorId: string;
|
|
70
|
+
readonly revision: string;
|
|
71
|
+
readonly schemaVersion: "maia.interaction/v1";
|
|
72
|
+
readonly sessionId: string;
|
|
73
|
+
readonly subject: string;
|
|
74
|
+
readonly wakeDisposition: "record-only";
|
|
75
|
+
readonly kind: "question";
|
|
76
|
+
readonly answer?: {
|
|
77
|
+
readonly kind: "text";
|
|
78
|
+
readonly value: string;
|
|
79
|
+
} | {
|
|
80
|
+
readonly kind: "selection";
|
|
81
|
+
readonly optionIds: readonly string[];
|
|
82
|
+
} | undefined;
|
|
83
|
+
readonly respondingActorId?: string | undefined;
|
|
84
|
+
readonly responseDigest?: string | undefined;
|
|
85
|
+
} | {
|
|
86
|
+
readonly activationId: null;
|
|
87
|
+
readonly answeredAt: string | null;
|
|
88
|
+
readonly answerSchemaDigest: string;
|
|
89
|
+
readonly body: string;
|
|
90
|
+
readonly createdAt: string;
|
|
91
|
+
readonly expiresAt: string | null;
|
|
92
|
+
readonly interactionId: string;
|
|
93
|
+
readonly lifecycleStatus: "answered" | "cancelled" | "expired" | "pending";
|
|
94
|
+
readonly origin: {
|
|
95
|
+
readonly kind: "external-cli";
|
|
96
|
+
};
|
|
97
|
+
readonly projectId: string;
|
|
98
|
+
readonly requestingActorId: string;
|
|
99
|
+
readonly revision: string;
|
|
100
|
+
readonly schemaVersion: "maia.interaction/v1";
|
|
101
|
+
readonly sessionId: string;
|
|
102
|
+
readonly subject: string;
|
|
103
|
+
readonly wakeDisposition: "record-only";
|
|
104
|
+
readonly kind: "selection";
|
|
105
|
+
readonly options: readonly {
|
|
106
|
+
readonly label: string;
|
|
107
|
+
readonly optionId: string;
|
|
108
|
+
}[];
|
|
109
|
+
readonly answer?: {
|
|
110
|
+
readonly kind: "text";
|
|
111
|
+
readonly value: string;
|
|
112
|
+
} | {
|
|
113
|
+
readonly kind: "selection";
|
|
114
|
+
readonly optionIds: readonly string[];
|
|
115
|
+
} | undefined;
|
|
116
|
+
readonly respondingActorId?: string | undefined;
|
|
117
|
+
readonly responseDigest?: string | undefined;
|
|
118
|
+
};
|
|
119
|
+
readonly method: "interaction.show";
|
|
120
|
+
}>;
|
|
121
|
+
cancelInteraction: (input: InteractionCancelParameters) => import("../../local-node/client.js").CliNodeEffect<{
|
|
122
|
+
readonly actorId: string;
|
|
123
|
+
readonly commandId: string;
|
|
124
|
+
readonly delivery: "duplicate" | "new";
|
|
125
|
+
readonly inputDigest: string;
|
|
126
|
+
readonly receipt: {
|
|
127
|
+
readonly actorId: string;
|
|
128
|
+
readonly aggregateRevision: string;
|
|
129
|
+
readonly commandId: string;
|
|
130
|
+
readonly createdAt: string;
|
|
131
|
+
readonly eventCursor: string;
|
|
132
|
+
readonly method: string;
|
|
133
|
+
readonly receiptId: string;
|
|
134
|
+
readonly schemaVersion: 1;
|
|
135
|
+
readonly state: "succeeded";
|
|
136
|
+
readonly target: {
|
|
137
|
+
readonly id: string;
|
|
138
|
+
readonly type: string;
|
|
139
|
+
};
|
|
140
|
+
readonly updatedAt: string;
|
|
141
|
+
};
|
|
142
|
+
readonly expectedRevision: string;
|
|
143
|
+
readonly interaction: {
|
|
144
|
+
readonly activationId: null;
|
|
145
|
+
readonly answeredAt: string | null;
|
|
146
|
+
readonly answerSchemaDigest: string;
|
|
147
|
+
readonly body: string;
|
|
148
|
+
readonly createdAt: string;
|
|
149
|
+
readonly expiresAt: string | null;
|
|
150
|
+
readonly interactionId: string;
|
|
151
|
+
readonly lifecycleStatus: "answered" | "cancelled" | "expired" | "pending";
|
|
152
|
+
readonly origin: {
|
|
153
|
+
readonly kind: "external-cli";
|
|
154
|
+
};
|
|
155
|
+
readonly projectId: string;
|
|
156
|
+
readonly requestingActorId: string;
|
|
157
|
+
readonly revision: string;
|
|
158
|
+
readonly schemaVersion: "maia.interaction/v1";
|
|
159
|
+
readonly sessionId: string;
|
|
160
|
+
readonly subject: string;
|
|
161
|
+
readonly wakeDisposition: "record-only";
|
|
162
|
+
readonly kind: "question";
|
|
163
|
+
} | {
|
|
164
|
+
readonly activationId: null;
|
|
165
|
+
readonly answeredAt: string | null;
|
|
166
|
+
readonly answerSchemaDigest: string;
|
|
167
|
+
readonly body: string;
|
|
168
|
+
readonly createdAt: string;
|
|
169
|
+
readonly expiresAt: string | null;
|
|
170
|
+
readonly interactionId: string;
|
|
171
|
+
readonly lifecycleStatus: "answered" | "cancelled" | "expired" | "pending";
|
|
172
|
+
readonly origin: {
|
|
173
|
+
readonly kind: "external-cli";
|
|
174
|
+
};
|
|
175
|
+
readonly projectId: string;
|
|
176
|
+
readonly requestingActorId: string;
|
|
177
|
+
readonly revision: string;
|
|
178
|
+
readonly schemaVersion: "maia.interaction/v1";
|
|
179
|
+
readonly sessionId: string;
|
|
180
|
+
readonly subject: string;
|
|
181
|
+
readonly wakeDisposition: "record-only";
|
|
182
|
+
readonly kind: "selection";
|
|
183
|
+
readonly options: readonly {
|
|
184
|
+
readonly label: string;
|
|
185
|
+
readonly optionId: string;
|
|
186
|
+
}[];
|
|
187
|
+
};
|
|
188
|
+
readonly method: "interaction.cancel";
|
|
189
|
+
}>;
|
|
190
|
+
createInteraction: (input: InteractionCreateParameters) => import("../../local-node/client.js").CliNodeEffect<{
|
|
191
|
+
readonly actorId: string;
|
|
192
|
+
readonly commandId: string;
|
|
193
|
+
readonly delivery: "duplicate" | "new";
|
|
194
|
+
readonly inputDigest: string;
|
|
195
|
+
readonly receipt: {
|
|
196
|
+
readonly actorId: string;
|
|
197
|
+
readonly aggregateRevision: string;
|
|
198
|
+
readonly commandId: string;
|
|
199
|
+
readonly createdAt: string;
|
|
200
|
+
readonly eventCursor: string;
|
|
201
|
+
readonly method: string;
|
|
202
|
+
readonly receiptId: string;
|
|
203
|
+
readonly schemaVersion: 1;
|
|
204
|
+
readonly state: "succeeded";
|
|
205
|
+
readonly target: {
|
|
206
|
+
readonly id: string;
|
|
207
|
+
readonly type: string;
|
|
208
|
+
};
|
|
209
|
+
readonly updatedAt: string;
|
|
210
|
+
};
|
|
211
|
+
readonly interaction: {
|
|
212
|
+
readonly activationId: null;
|
|
213
|
+
readonly answeredAt: string | null;
|
|
214
|
+
readonly answerSchemaDigest: string;
|
|
215
|
+
readonly body: string;
|
|
216
|
+
readonly createdAt: string;
|
|
217
|
+
readonly expiresAt: string | null;
|
|
218
|
+
readonly interactionId: string;
|
|
219
|
+
readonly lifecycleStatus: "answered" | "cancelled" | "expired" | "pending";
|
|
220
|
+
readonly origin: {
|
|
221
|
+
readonly kind: "external-cli";
|
|
222
|
+
};
|
|
223
|
+
readonly projectId: string;
|
|
224
|
+
readonly requestingActorId: string;
|
|
225
|
+
readonly revision: string;
|
|
226
|
+
readonly schemaVersion: "maia.interaction/v1";
|
|
227
|
+
readonly sessionId: string;
|
|
228
|
+
readonly subject: string;
|
|
229
|
+
readonly wakeDisposition: "record-only";
|
|
230
|
+
readonly kind: "question";
|
|
231
|
+
} | {
|
|
232
|
+
readonly activationId: null;
|
|
233
|
+
readonly answeredAt: string | null;
|
|
234
|
+
readonly answerSchemaDigest: string;
|
|
235
|
+
readonly body: string;
|
|
236
|
+
readonly createdAt: string;
|
|
237
|
+
readonly expiresAt: string | null;
|
|
238
|
+
readonly interactionId: string;
|
|
239
|
+
readonly lifecycleStatus: "answered" | "cancelled" | "expired" | "pending";
|
|
240
|
+
readonly origin: {
|
|
241
|
+
readonly kind: "external-cli";
|
|
242
|
+
};
|
|
243
|
+
readonly projectId: string;
|
|
244
|
+
readonly requestingActorId: string;
|
|
245
|
+
readonly revision: string;
|
|
246
|
+
readonly schemaVersion: "maia.interaction/v1";
|
|
247
|
+
readonly sessionId: string;
|
|
248
|
+
readonly subject: string;
|
|
249
|
+
readonly wakeDisposition: "record-only";
|
|
250
|
+
readonly kind: "selection";
|
|
251
|
+
readonly options: readonly {
|
|
252
|
+
readonly label: string;
|
|
253
|
+
readonly optionId: string;
|
|
254
|
+
}[];
|
|
255
|
+
};
|
|
256
|
+
readonly method: "interaction.create";
|
|
257
|
+
}>;
|
|
258
|
+
respondToInteraction: (input: InteractionRespondParameters) => import("../../local-node/client.js").CliNodeEffect<{
|
|
259
|
+
readonly actorId: string;
|
|
260
|
+
readonly commandId: string;
|
|
261
|
+
readonly delivery: "duplicate" | "new";
|
|
262
|
+
readonly inputDigest: string;
|
|
263
|
+
readonly receipt: {
|
|
264
|
+
readonly actorId: string;
|
|
265
|
+
readonly aggregateRevision: string;
|
|
266
|
+
readonly commandId: string;
|
|
267
|
+
readonly createdAt: string;
|
|
268
|
+
readonly eventCursor: string;
|
|
269
|
+
readonly method: string;
|
|
270
|
+
readonly receiptId: string;
|
|
271
|
+
readonly schemaVersion: 1;
|
|
272
|
+
readonly state: "succeeded";
|
|
273
|
+
readonly target: {
|
|
274
|
+
readonly id: string;
|
|
275
|
+
readonly type: string;
|
|
276
|
+
};
|
|
277
|
+
readonly updatedAt: string;
|
|
278
|
+
};
|
|
279
|
+
readonly expectedRevision: string;
|
|
280
|
+
readonly interaction: {
|
|
281
|
+
readonly activationId: null;
|
|
282
|
+
readonly answeredAt: string | null;
|
|
283
|
+
readonly answerSchemaDigest: string;
|
|
284
|
+
readonly body: string;
|
|
285
|
+
readonly createdAt: string;
|
|
286
|
+
readonly expiresAt: string | null;
|
|
287
|
+
readonly interactionId: string;
|
|
288
|
+
readonly lifecycleStatus: "answered" | "cancelled" | "expired" | "pending";
|
|
289
|
+
readonly origin: {
|
|
290
|
+
readonly kind: "external-cli";
|
|
291
|
+
};
|
|
292
|
+
readonly projectId: string;
|
|
293
|
+
readonly requestingActorId: string;
|
|
294
|
+
readonly revision: string;
|
|
295
|
+
readonly schemaVersion: "maia.interaction/v1";
|
|
296
|
+
readonly sessionId: string;
|
|
297
|
+
readonly subject: string;
|
|
298
|
+
readonly wakeDisposition: "record-only";
|
|
299
|
+
readonly kind: "question";
|
|
300
|
+
readonly answer?: {
|
|
301
|
+
readonly kind: "text";
|
|
302
|
+
readonly value: string;
|
|
303
|
+
} | {
|
|
304
|
+
readonly kind: "selection";
|
|
305
|
+
readonly optionIds: readonly string[];
|
|
306
|
+
} | undefined;
|
|
307
|
+
readonly respondingActorId?: string | undefined;
|
|
308
|
+
readonly responseDigest?: string | undefined;
|
|
309
|
+
} | {
|
|
310
|
+
readonly activationId: null;
|
|
311
|
+
readonly answeredAt: string | null;
|
|
312
|
+
readonly answerSchemaDigest: string;
|
|
313
|
+
readonly body: string;
|
|
314
|
+
readonly createdAt: string;
|
|
315
|
+
readonly expiresAt: string | null;
|
|
316
|
+
readonly interactionId: string;
|
|
317
|
+
readonly lifecycleStatus: "answered" | "cancelled" | "expired" | "pending";
|
|
318
|
+
readonly origin: {
|
|
319
|
+
readonly kind: "external-cli";
|
|
320
|
+
};
|
|
321
|
+
readonly projectId: string;
|
|
322
|
+
readonly requestingActorId: string;
|
|
323
|
+
readonly revision: string;
|
|
324
|
+
readonly schemaVersion: "maia.interaction/v1";
|
|
325
|
+
readonly sessionId: string;
|
|
326
|
+
readonly subject: string;
|
|
327
|
+
readonly wakeDisposition: "record-only";
|
|
328
|
+
readonly kind: "selection";
|
|
329
|
+
readonly options: readonly {
|
|
330
|
+
readonly label: string;
|
|
331
|
+
readonly optionId: string;
|
|
332
|
+
}[];
|
|
333
|
+
readonly answer?: {
|
|
334
|
+
readonly kind: "text";
|
|
335
|
+
readonly value: string;
|
|
336
|
+
} | {
|
|
337
|
+
readonly kind: "selection";
|
|
338
|
+
readonly optionIds: readonly string[];
|
|
339
|
+
} | undefined;
|
|
340
|
+
readonly respondingActorId?: string | undefined;
|
|
341
|
+
readonly responseDigest?: string | undefined;
|
|
342
|
+
};
|
|
343
|
+
readonly method: "interaction.respond";
|
|
344
|
+
}>;
|
|
345
|
+
};
|
|
346
|
+
export type InteractionCliDependencies = ReturnType<typeof makeInteractionClient>;
|
|
347
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { interactionCancelParametersSchema, interactionCreateParametersSchema, interactionListParametersSchema, interactionRespondParametersSchema, interactionShowParametersSchema, } from "@maiaos/sdk";
|
|
2
|
+
const readClient = (node) => ({
|
|
3
|
+
listInteractions: (input) => node.runValidatedNodeOperation(input, interactionListParametersSchema, (client, parameters, options) => client.listInteractions(parameters, options)),
|
|
4
|
+
showInteraction: (input) => node.runValidatedNodeOperation(input, interactionShowParametersSchema, (client, parameters, options) => client.showInteraction(parameters, options)),
|
|
5
|
+
});
|
|
6
|
+
const mutationClient = (node) => ({
|
|
7
|
+
cancelInteraction: (input) => node.runValidatedNodeOperation(input, interactionCancelParametersSchema, (client, parameters, options) => client.cancelInteraction(parameters, options), { commandId: input.commandId }),
|
|
8
|
+
createInteraction: (input) => node.runValidatedNodeOperation(input, interactionCreateParametersSchema, (client, parameters, options) => client.createInteraction(parameters, options), { commandId: input.commandId }),
|
|
9
|
+
respondToInteraction: (input) => node.runValidatedNodeOperation(input, interactionRespondParametersSchema, (client, parameters, options) => client.respondToInteraction(parameters, options), { commandId: input.commandId }),
|
|
10
|
+
});
|
|
11
|
+
export const makeInteractionClient = (node) => ({
|
|
12
|
+
...readClient(node),
|
|
13
|
+
...mutationClient(node),
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type CommandContext, type CommandEffect } from "../../command-line/index.js";
|
|
2
|
+
export declare const runInteractionCreate: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
3
|
+
export declare const runInteractionRespond: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
4
|
+
export declare const runInteractionCancel: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
5
|
+
export declare const runInteractionList: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
6
|
+
export declare const runInteractionShow: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
7
|
+
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { interactionCancelParametersSchema, interactionCreateParametersSchema, interactionListParametersSchema, interactionRespondParametersSchema, interactionShowParametersSchema, protocolErrorSchema, } from "@maiaos/sdk";
|
|
2
|
+
import { Cause, Effect } from "effect";
|
|
3
|
+
import { CliArgumentError, reportError, writeSuccess, } from "../../command-line/index.js";
|
|
4
|
+
import { invalidInteractionInput, readInteractionInput, readInteractionList, readInteractionShow, } from "./input.js";
|
|
5
|
+
import { formatInteractionResult, } from "./output/index.js";
|
|
6
|
+
const recoveryFor = (parameters) => typeof parameters === "object" &&
|
|
7
|
+
parameters !== null &&
|
|
8
|
+
"commandId" in parameters &&
|
|
9
|
+
typeof parameters.commandId === "string"
|
|
10
|
+
? { recovery: { commandId: parameters.commandId } }
|
|
11
|
+
: {};
|
|
12
|
+
const boundaryFailure = (parameters) => ({
|
|
13
|
+
error: {
|
|
14
|
+
code: "recovery" in recoveryFor(parameters)
|
|
15
|
+
? "outcome_unknown"
|
|
16
|
+
: "node_unavailable",
|
|
17
|
+
message: "Interaction response unavailable. Reconcile the original command before retrying a mutation.",
|
|
18
|
+
retryable: false,
|
|
19
|
+
},
|
|
20
|
+
ok: false,
|
|
21
|
+
...recoveryFor(parameters),
|
|
22
|
+
});
|
|
23
|
+
const writeResponse = (response, parameters, context) => {
|
|
24
|
+
if (!response.ok) {
|
|
25
|
+
const error = protocolErrorSchema.parse(response.error);
|
|
26
|
+
return reportError({
|
|
27
|
+
...error,
|
|
28
|
+
message: "Interaction operation failed. Answers never authorize operations.",
|
|
29
|
+
}, {
|
|
30
|
+
...context,
|
|
31
|
+
...(error.code === "outcome_unknown" ? recoveryFor(parameters) : {}),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
writeSuccess({ command: response.value.method, result: response.value }, context, formatInteractionResult);
|
|
35
|
+
return 0;
|
|
36
|
+
};
|
|
37
|
+
const callNode = (operation, parameters) => operation(parameters).pipe(Effect.catchCause((cause) => Cause.hasInterruptsOnly(cause)
|
|
38
|
+
? Effect.interrupt
|
|
39
|
+
: Effect.succeed(boundaryFailure(parameters))));
|
|
40
|
+
const invoke = (spec, context) => Effect.gen(function* () {
|
|
41
|
+
const input = yield* spec.input;
|
|
42
|
+
const parameters = yield* Effect.try({
|
|
43
|
+
catch: invalidInteractionInput,
|
|
44
|
+
try: () => spec.parameters.parse(input),
|
|
45
|
+
});
|
|
46
|
+
const operation = spec.operation;
|
|
47
|
+
if (operation === undefined)
|
|
48
|
+
return yield* Effect.fail(new Error("Missing interaction client."));
|
|
49
|
+
const response = yield* callNode(operation, parameters);
|
|
50
|
+
return yield* Effect.try({
|
|
51
|
+
catch: () => new Error("Invalid interaction response."),
|
|
52
|
+
try: () => writeResponse(response, parameters, context),
|
|
53
|
+
}).pipe(Effect.catch(() => Effect.sync(() => writeResponse(boundaryFailure(parameters), parameters, context))));
|
|
54
|
+
});
|
|
55
|
+
const mutations = {
|
|
56
|
+
cancel: (input, context) => invoke({
|
|
57
|
+
input,
|
|
58
|
+
operation: context.dependencies.cancelInteraction,
|
|
59
|
+
parameters: interactionCancelParametersSchema,
|
|
60
|
+
}, context),
|
|
61
|
+
create: (input, context) => invoke({
|
|
62
|
+
input,
|
|
63
|
+
operation: context.dependencies.createInteraction,
|
|
64
|
+
parameters: interactionCreateParametersSchema,
|
|
65
|
+
}, context),
|
|
66
|
+
respond: (input, context) => invoke({
|
|
67
|
+
input,
|
|
68
|
+
operation: context.dependencies.respondToInteraction,
|
|
69
|
+
parameters: interactionRespondParametersSchema,
|
|
70
|
+
}, context),
|
|
71
|
+
};
|
|
72
|
+
const recover = (context) => (error) => Effect.sync(() => reportError({
|
|
73
|
+
code: error instanceof CliArgumentError
|
|
74
|
+
? "invalid_argument"
|
|
75
|
+
: "internal_error",
|
|
76
|
+
message: error instanceof CliArgumentError
|
|
77
|
+
? error.message
|
|
78
|
+
: "Interaction command failed.",
|
|
79
|
+
retryable: false,
|
|
80
|
+
}, context));
|
|
81
|
+
const mutation = (action) => (tokens, context) => mutations[action](readInteractionInput(tokens, context), context).pipe(Effect.catch(recover(context)));
|
|
82
|
+
export const runInteractionCreate = mutation("create");
|
|
83
|
+
export const runInteractionRespond = mutation("respond");
|
|
84
|
+
export const runInteractionCancel = mutation("cancel");
|
|
85
|
+
export const runInteractionList = (tokens, context) => invoke({
|
|
86
|
+
input: Effect.try({
|
|
87
|
+
catch: invalidInteractionInput,
|
|
88
|
+
try: () => readInteractionList(tokens),
|
|
89
|
+
}),
|
|
90
|
+
operation: context.dependencies.listInteractions,
|
|
91
|
+
parameters: interactionListParametersSchema,
|
|
92
|
+
}, context).pipe(Effect.catch(recover(context)));
|
|
93
|
+
export const runInteractionShow = (tokens, context) => invoke({
|
|
94
|
+
input: Effect.try({
|
|
95
|
+
catch: invalidInteractionInput,
|
|
96
|
+
try: () => readInteractionShow(tokens),
|
|
97
|
+
}),
|
|
98
|
+
operation: context.dependencies.showInteraction,
|
|
99
|
+
parameters: interactionShowParametersSchema,
|
|
100
|
+
}, context).pipe(Effect.catch(recover(context)));
|
|
101
|
+
//# sourceMappingURL=commands.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { CliArgumentError, type CommandContext } from "../../command-line/index.js";
|
|
3
|
+
export declare const invalidInteractionInput: () => CliArgumentError;
|
|
4
|
+
export declare const readInteractionInput: (tokens: readonly string[], context: CommandContext) => Effect.Effect<unknown, CliArgumentError, never>;
|
|
5
|
+
export declare const readInteractionList: (tokens: readonly string[]) => {
|
|
6
|
+
limit: number;
|
|
7
|
+
projectId: string | undefined;
|
|
8
|
+
sessionId: string | undefined;
|
|
9
|
+
afterCursor?: string | undefined;
|
|
10
|
+
lifecycleStatus?: string | undefined;
|
|
11
|
+
};
|
|
12
|
+
export declare const readInteractionShow: (tokens: readonly string[]) => {
|
|
13
|
+
interactionId: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=input.d.ts.map
|