@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,138 @@
|
|
|
1
|
+
const local = () => import("./commands.js");
|
|
2
|
+
const doctor = () => import("../status/index.js");
|
|
3
|
+
const mcp = () => import("../mcp/index.js");
|
|
4
|
+
const presentation = () => import("../presentation/index.js");
|
|
5
|
+
const dashboard = () => import("../dashboard/index.js");
|
|
6
|
+
const agent = [local, "runAgent"];
|
|
7
|
+
export const LOCAL_TREE = {
|
|
8
|
+
groups: [
|
|
9
|
+
["agent extension", "Agent extensions."],
|
|
10
|
+
["presentation", "Read-only view specifications."],
|
|
11
|
+
["presentation catalog", "The presentation view catalog."],
|
|
12
|
+
["presentation workspace-directory", "The Workspace directory view."],
|
|
13
|
+
["presentation project-list", "The Project list view."],
|
|
14
|
+
["presentation session-list", "The Session list view."],
|
|
15
|
+
],
|
|
16
|
+
leaves: [
|
|
17
|
+
[
|
|
18
|
+
"help [<command>...]",
|
|
19
|
+
0,
|
|
20
|
+
"",
|
|
21
|
+
"Show help for the CLI or one command.",
|
|
22
|
+
{
|
|
23
|
+
example: "maia --json help session create",
|
|
24
|
+
kind: "local",
|
|
25
|
+
run: [local, "runHelp"],
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
"version",
|
|
30
|
+
0,
|
|
31
|
+
"",
|
|
32
|
+
"Show the CLI version, protocol and commit.",
|
|
33
|
+
{
|
|
34
|
+
example: "maia --json version",
|
|
35
|
+
kind: "local",
|
|
36
|
+
run: [local, "runVersion"],
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
[
|
|
40
|
+
"completion <bash|zsh|fish>",
|
|
41
|
+
0,
|
|
42
|
+
"",
|
|
43
|
+
"Print a shell completion script.",
|
|
44
|
+
{
|
|
45
|
+
example: "maia completion zsh",
|
|
46
|
+
kind: "local",
|
|
47
|
+
run: [local, "runCompletion"],
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
[
|
|
51
|
+
"doctor",
|
|
52
|
+
0,
|
|
53
|
+
"",
|
|
54
|
+
"Check this installation, the Node and accounts; name each fix.",
|
|
55
|
+
{
|
|
56
|
+
example: "maia doctor",
|
|
57
|
+
kind: "local",
|
|
58
|
+
node: true,
|
|
59
|
+
run: [doctor, "runDoctor"],
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
[
|
|
63
|
+
"agent [--continue] [-e|--extension <path>] [-ne|--no-extensions] [--model <provider/model>] [--thinking <level>] [extension flags] [--] [prompt]",
|
|
64
|
+
0,
|
|
65
|
+
"",
|
|
66
|
+
"Run Maia's coding agent interactively.",
|
|
67
|
+
{ kind: "local", run: agent },
|
|
68
|
+
],
|
|
69
|
+
[
|
|
70
|
+
"agent --print [--no-session] [-e|--extension <path>] [-ne|--no-extensions] [--model <provider/model>] [--thinking <level>] [extension flags] [--] <prompt>",
|
|
71
|
+
0,
|
|
72
|
+
"",
|
|
73
|
+
"Print one answer from Maia's coding agent.",
|
|
74
|
+
{ kind: "local", run: agent },
|
|
75
|
+
],
|
|
76
|
+
[
|
|
77
|
+
"agent --json-events [--no-session] [-e|--extension <path>] [-ne|--no-extensions] [--model <provider/model>] [--thinking <level>] [extension flags] [--] <prompt>",
|
|
78
|
+
0,
|
|
79
|
+
"",
|
|
80
|
+
"Stream one answer as JSON events.",
|
|
81
|
+
{ kind: "local", run: agent },
|
|
82
|
+
],
|
|
83
|
+
[
|
|
84
|
+
"agent extension digest <path>",
|
|
85
|
+
0,
|
|
86
|
+
"",
|
|
87
|
+
"Print an agent extension's digest.",
|
|
88
|
+
{ kind: "local", run: [local, "runAgentExtensionDigest"] },
|
|
89
|
+
],
|
|
90
|
+
[
|
|
91
|
+
"presentation catalog show",
|
|
92
|
+
1,
|
|
93
|
+
"presentation.catalog.show",
|
|
94
|
+
"Show the presentation view catalog.",
|
|
95
|
+
{ run: [presentation, "runCatalogShow"] },
|
|
96
|
+
],
|
|
97
|
+
[
|
|
98
|
+
"presentation workspace-directory show --input-stdin",
|
|
99
|
+
1,
|
|
100
|
+
"presentation.workspace-directory.show",
|
|
101
|
+
"Show the Workspace directory view.",
|
|
102
|
+
{ run: [presentation, "runWorkspaceDirectoryShow"] },
|
|
103
|
+
],
|
|
104
|
+
[
|
|
105
|
+
"presentation project-list show --input-stdin",
|
|
106
|
+
1,
|
|
107
|
+
"presentation.project-list.show",
|
|
108
|
+
"Show the Project list view.",
|
|
109
|
+
{ run: [presentation, "runProjectListShow"] },
|
|
110
|
+
],
|
|
111
|
+
[
|
|
112
|
+
"presentation session-list show --input-stdin",
|
|
113
|
+
1,
|
|
114
|
+
"presentation.session-list.show",
|
|
115
|
+
"Show the Session list view.",
|
|
116
|
+
{ run: [presentation, "runSessionListShow"] },
|
|
117
|
+
],
|
|
118
|
+
[
|
|
119
|
+
"mcp [--worker]",
|
|
120
|
+
1,
|
|
121
|
+
"",
|
|
122
|
+
"Serve coordinator or worker tools over MCP stdio.",
|
|
123
|
+
{ kind: "local", node: true, run: [mcp, "runMcpCommand"] },
|
|
124
|
+
],
|
|
125
|
+
[
|
|
126
|
+
"dashboard [--plain]",
|
|
127
|
+
1,
|
|
128
|
+
"",
|
|
129
|
+
"Open the terminal dashboard; --plain prints its text once.",
|
|
130
|
+
{
|
|
131
|
+
example: "maia dashboard --plain",
|
|
132
|
+
kind: "composite",
|
|
133
|
+
run: [dashboard, "runDashboard"],
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
],
|
|
137
|
+
};
|
|
138
|
+
//# sourceMappingURL=local.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
const KINDS = "connection|container|project|session|workspace";
|
|
2
|
+
export const REFERENCE_PLACEHOLDER = new RegExp(`^<(?:[a-z]+-)*?(${KINDS})(?:-id)?>$`, "u");
|
|
3
|
+
export const REFERENCE_USAGE = new RegExp(`<(?:[a-z]+-)*?(?:${KINDS})(?:-id)?>`, "u");
|
|
4
|
+
export const ROUTE_ARGUMENT = /^(?:--|<(?:[a-z]+-)*?)(approval|command|project|routine|session|terminal|turn|workspace)(?:-id(?:\|.+)?>)?$/u;
|
|
5
|
+
//# sourceMappingURL=placeholder.js.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { localNodeRequestPayloadSchema, SessionAttachFrame } from "@maiaos/sdk";
|
|
2
|
+
import type { CommandContext, CommandEffect } from "../command-line/index.js";
|
|
3
|
+
export type TreeOperation = ReturnType<typeof localNodeRequestPayloadSchema.parse>["method"] | SessionAttachFrame["operationId"];
|
|
4
|
+
export type TreeLeafKind = "composite" | "discriminant" | "local" | "operation" | "shortcut" | "two-phase";
|
|
5
|
+
export type LeafRoute = readonly [string, string] | string;
|
|
6
|
+
export type LeafRunner = (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
7
|
+
export type RunnerReference = readonly [
|
|
8
|
+
load: () => Promise<object>,
|
|
9
|
+
name: string
|
|
10
|
+
];
|
|
11
|
+
export type LeafExtra = {
|
|
12
|
+
readonly example?: string;
|
|
13
|
+
readonly kind?: Exclude<TreeLeafKind, "operation">;
|
|
14
|
+
readonly node?: true;
|
|
15
|
+
readonly remote?: false;
|
|
16
|
+
readonly route?: LeafRoute;
|
|
17
|
+
readonly run: RunnerReference;
|
|
18
|
+
};
|
|
19
|
+
export type LeafRow = readonly [
|
|
20
|
+
usage: string,
|
|
21
|
+
availability: 0 | 1,
|
|
22
|
+
operations: "" | readonly TreeOperation[] | TreeOperation,
|
|
23
|
+
summary: string,
|
|
24
|
+
extra: LeafExtra
|
|
25
|
+
];
|
|
26
|
+
export type GroupRow = readonly [path: string, summary: string];
|
|
27
|
+
export type TreeFragment = {
|
|
28
|
+
readonly groups: readonly GroupRow[];
|
|
29
|
+
readonly leaves: readonly LeafRow[];
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=row.d.ts.map
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { findNode, treeNodes } from "./tree.js";
|
|
2
|
+
const PATH_WORD = /^[a-z][a-z0-9-]*$/u;
|
|
3
|
+
const MAXIMUM_SUGGESTIONS = 3;
|
|
4
|
+
const RETIRED_WORDS = new Map([
|
|
5
|
+
["add", ["register", "install", "attach"]],
|
|
6
|
+
["limit", ["capacity"]],
|
|
7
|
+
["recovery", ["doctor"]],
|
|
8
|
+
["signin", ["login"]],
|
|
9
|
+
]);
|
|
10
|
+
const stem = (word) => word.replace(/-(?:preview|confirm)$/u, "").replace(/s$/u, "");
|
|
11
|
+
const commonPrefix = (left, right, at = 0) => at < left.length && left[at] === right[at]
|
|
12
|
+
? commonPrefix(left, right, at + 1)
|
|
13
|
+
: at;
|
|
14
|
+
const resembles = (typed, name) => {
|
|
15
|
+
const [left, right] = [stem(typed), stem(name)];
|
|
16
|
+
if (left === right)
|
|
17
|
+
return true;
|
|
18
|
+
if (name.split("-").some((part) => stem(part) === left))
|
|
19
|
+
return true;
|
|
20
|
+
const shared = commonPrefix(left, right);
|
|
21
|
+
return shared >= 4 && shared >= Math.min(left.length, right.length) - 2;
|
|
22
|
+
};
|
|
23
|
+
const typedWords = (word) => [
|
|
24
|
+
word,
|
|
25
|
+
...(RETIRED_WORDS.get(word) ?? []),
|
|
26
|
+
];
|
|
27
|
+
const matches = (node, word) => typedWords(word).some((typed) => node.path.some((name) => resembles(typed, name)));
|
|
28
|
+
const strength = (node, word) => {
|
|
29
|
+
const typed = typedWords(word);
|
|
30
|
+
if (typed.some((each) => stem(each) === stem(node.name)))
|
|
31
|
+
return 2;
|
|
32
|
+
return typed.some((each) => resembles(each, node.name)) ? 1 : 0;
|
|
33
|
+
};
|
|
34
|
+
const collapse = (node) => {
|
|
35
|
+
const [only, ...others] = node.children;
|
|
36
|
+
return node.forms.length === 0 && only !== undefined && others.length === 0
|
|
37
|
+
? collapse(only)
|
|
38
|
+
: node;
|
|
39
|
+
};
|
|
40
|
+
export const suggestPaths = (tokens) => {
|
|
41
|
+
const words = tokens.filter((token) => PATH_WORD.test(token));
|
|
42
|
+
const { consumed } = findNode(tokens);
|
|
43
|
+
const unknown = tokens[consumed];
|
|
44
|
+
if (unknown === undefined || !PATH_WORD.test(unknown))
|
|
45
|
+
return [];
|
|
46
|
+
const scored = treeNodes()
|
|
47
|
+
.filter((node) => matches(node, unknown))
|
|
48
|
+
.map((node) => ({
|
|
49
|
+
node,
|
|
50
|
+
score: words.filter((word) => matches(node, word)).length,
|
|
51
|
+
strength: strength(node, unknown),
|
|
52
|
+
}));
|
|
53
|
+
const best = Math.max(0, ...scored.map(({ score }) => score));
|
|
54
|
+
const top = scored.filter(({ score }) => score === best);
|
|
55
|
+
const strongest = Math.max(0, ...top.map((entry) => entry.strength));
|
|
56
|
+
const paths = top
|
|
57
|
+
.filter((entry) => entry.strength === strongest)
|
|
58
|
+
.toSorted((left, right) => Number(right.node.forms.length > 0) -
|
|
59
|
+
Number(left.node.forms.length > 0) ||
|
|
60
|
+
left.node.path.length - right.node.path.length)
|
|
61
|
+
.map(({ node }) => `maia ${collapse(node).path.join(" ")}`);
|
|
62
|
+
return [...new Set(paths)].slice(0, MAXIMUM_SUGGESTIONS);
|
|
63
|
+
};
|
|
64
|
+
export const unknownPathMessage = (tokens) => {
|
|
65
|
+
const { consumed, node } = findNode(tokens);
|
|
66
|
+
const unknown = tokens[consumed];
|
|
67
|
+
const children = node.children.map((child) => child.name).join(", ");
|
|
68
|
+
if (unknown === undefined)
|
|
69
|
+
return `'maia ${node.path.join(" ")}' takes a command: ${children}.`;
|
|
70
|
+
if (unknown.startsWith("-"))
|
|
71
|
+
return node.path.length === 0
|
|
72
|
+
? `Unknown option '${unknown}'.`
|
|
73
|
+
: `'maia ${node.path.join(" ")}' takes a command: ${children}.`;
|
|
74
|
+
const suggestions = suggestPaths(tokens);
|
|
75
|
+
if (suggestions.length > 0)
|
|
76
|
+
return `Unknown command '${unknown}'. Did you mean ${suggestions.map((path) => `'${path}'`).join(", ")}?`;
|
|
77
|
+
return node.path.length === 0
|
|
78
|
+
? `Unknown command '${unknown}'.`
|
|
79
|
+
: `Unknown command '${unknown}'; 'maia ${node.path.join(" ")}' takes: ${children}.`;
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=suggest.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { LeafRoute, RunnerReference, TreeFragment, TreeLeafKind, TreeOperation } from "./row.js";
|
|
2
|
+
export type TreeAvailability = "implemented" | "source_implemented_candidate";
|
|
3
|
+
export type TreeLeafForm = {
|
|
4
|
+
readonly availability: TreeAvailability;
|
|
5
|
+
readonly summary: string;
|
|
6
|
+
readonly usage: string;
|
|
7
|
+
};
|
|
8
|
+
export type TreeNode = {
|
|
9
|
+
readonly children: readonly TreeNode[];
|
|
10
|
+
readonly example?: string;
|
|
11
|
+
readonly forms: readonly TreeLeafForm[];
|
|
12
|
+
readonly kind?: TreeLeafKind;
|
|
13
|
+
readonly name: string;
|
|
14
|
+
readonly node?: true;
|
|
15
|
+
readonly operations: readonly TreeOperation[];
|
|
16
|
+
readonly path: readonly string[];
|
|
17
|
+
readonly remote?: false;
|
|
18
|
+
readonly route?: LeafRoute;
|
|
19
|
+
readonly run?: RunnerReference;
|
|
20
|
+
readonly summary: string;
|
|
21
|
+
};
|
|
22
|
+
export declare const TREE_FRAGMENTS: readonly TreeFragment[];
|
|
23
|
+
export declare const TREE_SECTIONS: readonly [readonly ["Start and sign in", readonly ["setup", "login", "status"]], readonly ["Work", readonly ["session", "run", "routine", "import"]], readonly ["Resources", readonly ["project", "workspace", "container", "terminal", "execution", "port", "reference", "agents"]], readonly ["Accounts and Nodes", readonly ["connection", "integration", "provider", "node"]], readonly ["Safety and audit", readonly ["hold", "receipt", "context"]], readonly ["Clients and local", readonly ["presentation", "mcp", "dashboard", "agent", "help", "version", "doctor", "completion"]]];
|
|
24
|
+
export declare const usagePath: (usage: string) => readonly string[];
|
|
25
|
+
export declare const COMMAND_TREE: TreeNode;
|
|
26
|
+
export declare const commandTree: () => TreeNode;
|
|
27
|
+
export declare const findNode: (tokens: readonly string[]) => {
|
|
28
|
+
readonly consumed: number;
|
|
29
|
+
readonly node: TreeNode;
|
|
30
|
+
};
|
|
31
|
+
export declare const treeNodes: (node?: TreeNode) => TreeNode[];
|
|
32
|
+
export declare const isNodeBacked: (node: TreeNode) => boolean;
|
|
33
|
+
export declare const treeUsages: () => string[];
|
|
34
|
+
export declare const createTreeDigest: (usages?: readonly string[]) => string;
|
|
35
|
+
//# sourceMappingURL=tree.d.ts.map
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { AGENTS_TREE } from "../agents/tree/index.js";
|
|
3
|
+
import { CONNECTION_TREE } from "../connection/tree/index.js";
|
|
4
|
+
import { EXECUTION_TREE } from "../execution/tree/index.js";
|
|
5
|
+
import { SAFETY_TREE } from "../hold/tree/index.js";
|
|
6
|
+
import { RUN_TREE } from "../orchestration/tree/index.js";
|
|
7
|
+
import { PROJECT_TREE } from "../project-workspace/tree/index.js";
|
|
8
|
+
import { REFERENCE_TREE } from "../reference/tree/index.js";
|
|
9
|
+
import { NODE_TREE } from "../remote-node/tree/index.js";
|
|
10
|
+
import { ROUTINE_TREE } from "../routine/tree/index.js";
|
|
11
|
+
import { SESSION_TREE } from "../session/tree/index.js";
|
|
12
|
+
import { TERMINAL_TREE } from "../terminal/tree/index.js";
|
|
13
|
+
import { LOCAL_TREE } from "./local.js";
|
|
14
|
+
export const TREE_FRAGMENTS = [
|
|
15
|
+
NODE_TREE,
|
|
16
|
+
CONNECTION_TREE,
|
|
17
|
+
SESSION_TREE,
|
|
18
|
+
RUN_TREE,
|
|
19
|
+
ROUTINE_TREE,
|
|
20
|
+
PROJECT_TREE,
|
|
21
|
+
REFERENCE_TREE,
|
|
22
|
+
TERMINAL_TREE,
|
|
23
|
+
EXECUTION_TREE,
|
|
24
|
+
SAFETY_TREE,
|
|
25
|
+
AGENTS_TREE,
|
|
26
|
+
LOCAL_TREE,
|
|
27
|
+
];
|
|
28
|
+
export const TREE_SECTIONS = [
|
|
29
|
+
["Start and sign in", ["setup", "login", "status"]],
|
|
30
|
+
["Work", ["session", "run", "routine", "import"]],
|
|
31
|
+
[
|
|
32
|
+
"Resources",
|
|
33
|
+
[
|
|
34
|
+
"project",
|
|
35
|
+
"workspace",
|
|
36
|
+
"container",
|
|
37
|
+
"terminal",
|
|
38
|
+
"execution",
|
|
39
|
+
"port",
|
|
40
|
+
"reference",
|
|
41
|
+
"agents",
|
|
42
|
+
],
|
|
43
|
+
],
|
|
44
|
+
["Accounts and Nodes", ["connection", "integration", "provider", "node"]],
|
|
45
|
+
["Safety and audit", ["hold", "receipt", "context"]],
|
|
46
|
+
[
|
|
47
|
+
"Clients and local",
|
|
48
|
+
[
|
|
49
|
+
"presentation",
|
|
50
|
+
"mcp",
|
|
51
|
+
"dashboard",
|
|
52
|
+
"agent",
|
|
53
|
+
"help",
|
|
54
|
+
"version",
|
|
55
|
+
"doctor",
|
|
56
|
+
"completion",
|
|
57
|
+
],
|
|
58
|
+
],
|
|
59
|
+
];
|
|
60
|
+
const PATH_WORD = /^[a-z][a-z0-9-]*$/u;
|
|
61
|
+
export const usagePath = (usage) => {
|
|
62
|
+
const words = usage.split(" ");
|
|
63
|
+
const end = words.findIndex((word) => !PATH_WORD.test(word));
|
|
64
|
+
return words.slice(0, end === -1 ? words.length : end);
|
|
65
|
+
};
|
|
66
|
+
const nodeAt = (root, path) => path.reduce((parent, name) => {
|
|
67
|
+
const existing = parent.children.find((child) => child.name === name);
|
|
68
|
+
if (existing !== undefined)
|
|
69
|
+
return existing;
|
|
70
|
+
const created = {
|
|
71
|
+
children: [],
|
|
72
|
+
forms: [],
|
|
73
|
+
name,
|
|
74
|
+
operations: [],
|
|
75
|
+
path: [...parent.path, name],
|
|
76
|
+
summary: "",
|
|
77
|
+
};
|
|
78
|
+
parent.children.push(created);
|
|
79
|
+
return created;
|
|
80
|
+
}, root);
|
|
81
|
+
const addLeaf = (root, row) => {
|
|
82
|
+
const [usage, availability, operations, summary, extra] = row;
|
|
83
|
+
const node = nodeAt(root, usagePath(usage));
|
|
84
|
+
node.forms.push({
|
|
85
|
+
availability: availability === 0 ? "implemented" : "source_implemented_candidate",
|
|
86
|
+
summary,
|
|
87
|
+
usage,
|
|
88
|
+
});
|
|
89
|
+
if (node.forms.length > 1)
|
|
90
|
+
return;
|
|
91
|
+
node.summary = summary;
|
|
92
|
+
node.operations = operations === "" ? [] : [operations].flat();
|
|
93
|
+
node.kind = extra.kind ?? "operation";
|
|
94
|
+
node.run = extra.run;
|
|
95
|
+
if (extra.node !== undefined)
|
|
96
|
+
node.node = extra.node;
|
|
97
|
+
if (extra.remote !== undefined)
|
|
98
|
+
node.remote = extra.remote;
|
|
99
|
+
if (extra.route !== undefined)
|
|
100
|
+
node.route = extra.route;
|
|
101
|
+
if (extra.example !== undefined)
|
|
102
|
+
node.example = extra.example;
|
|
103
|
+
};
|
|
104
|
+
const sectionOrder = TREE_SECTIONS.flatMap(([, names]) => names);
|
|
105
|
+
const buildTree = () => {
|
|
106
|
+
const root = {
|
|
107
|
+
children: [],
|
|
108
|
+
forms: [],
|
|
109
|
+
name: "maia",
|
|
110
|
+
operations: [],
|
|
111
|
+
path: [],
|
|
112
|
+
summary: "Maia OS command line.",
|
|
113
|
+
};
|
|
114
|
+
sectionOrder.forEach((name) => nodeAt(root, [name]));
|
|
115
|
+
TREE_FRAGMENTS.forEach((fragment) => {
|
|
116
|
+
fragment.leaves.forEach((row) => {
|
|
117
|
+
addLeaf(root, row);
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
TREE_FRAGMENTS.forEach((fragment) => {
|
|
121
|
+
fragment.groups.forEach(([path, summary]) => {
|
|
122
|
+
nodeAt(root, path.split(" ")).summary = summary;
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
return root;
|
|
126
|
+
};
|
|
127
|
+
export const COMMAND_TREE = buildTree();
|
|
128
|
+
export const commandTree = () => COMMAND_TREE;
|
|
129
|
+
const descend = (node, tokens, consumed) => {
|
|
130
|
+
const child = node.children.find((candidate) => candidate.name === tokens[consumed]);
|
|
131
|
+
return child === undefined
|
|
132
|
+
? { consumed, node }
|
|
133
|
+
: descend(child, tokens, consumed + 1);
|
|
134
|
+
};
|
|
135
|
+
export const findNode = (tokens) => descend(COMMAND_TREE, tokens, 0);
|
|
136
|
+
export const treeNodes = (node = commandTree()) => node.children.flatMap((child) => [child, ...treeNodes(child)]);
|
|
137
|
+
export const isNodeBacked = (node) => node.forms.length > 0 && (node.kind !== "local" || node.node === true);
|
|
138
|
+
export const treeUsages = () => treeNodes().flatMap((node) => node.forms.map((form) => form.usage));
|
|
139
|
+
export const createTreeDigest = (usages = treeUsages()) => `sha256:${createHash("sha256").update(usages.join("\n")).digest("hex")}`;
|
|
140
|
+
//# sourceMappingURL=tree.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ConnectionGrantListParameters, type ConnectionGrantListResult, type ConnectionGrantSetConfirmParameters, type ConnectionGrantSetConfirmResult, type ConnectionGrantSetPreviewParameters, type ConnectionGrantSetPreviewResult, type ConnectionPoolListParameters, type ConnectionPoolListResult, type ConnectionPoolSetConfirmParameters, type ConnectionPoolSetConfirmResult, type ConnectionPoolSetPreviewParameters, type ConnectionPoolSetPreviewResult } from "@maiaos/sdk";
|
|
2
|
+
import type { CliNodeEffect, CliNodeOperations } from "../../local-node/index.js";
|
|
3
|
+
export type Operation<TInput, TResult> = (input: TInput) => CliNodeEffect<TResult>;
|
|
4
|
+
export type ConnectionAccessClient = {
|
|
5
|
+
readonly confirmConnectionGrant: Operation<ConnectionGrantSetConfirmParameters, ConnectionGrantSetConfirmResult>;
|
|
6
|
+
readonly confirmConnectionPool: Operation<ConnectionPoolSetConfirmParameters, ConnectionPoolSetConfirmResult>;
|
|
7
|
+
readonly listConnectionGrants: Operation<ConnectionGrantListParameters, ConnectionGrantListResult>;
|
|
8
|
+
readonly listConnectionPools: Operation<ConnectionPoolListParameters, ConnectionPoolListResult>;
|
|
9
|
+
readonly previewConnectionGrant: Operation<ConnectionGrantSetPreviewParameters, ConnectionGrantSetPreviewResult>;
|
|
10
|
+
readonly previewConnectionPool: Operation<ConnectionPoolSetPreviewParameters, ConnectionPoolSetPreviewResult>;
|
|
11
|
+
};
|
|
12
|
+
export declare const makeConnectionAccessClient: (node: CliNodeOperations) => ConnectionAccessClient;
|
|
13
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { connectionGrantListParametersSchema, connectionGrantSetConfirmParametersSchema, connectionGrantSetPreviewParametersSchema, connectionPoolListParametersSchema, connectionPoolSetConfirmParametersSchema, connectionPoolSetPreviewParametersSchema, } from "@maiaos/sdk";
|
|
2
|
+
const reads = (node) => ({
|
|
3
|
+
listConnectionGrants: (input) => node.runValidatedNodeOperation(input, connectionGrantListParametersSchema, (client, parameters, options) => client.listConnectionGrants(parameters, options)),
|
|
4
|
+
listConnectionPools: (input) => node.runValidatedNodeOperation(input, connectionPoolListParametersSchema, (client, parameters, options) => client.listConnectionPools(parameters, options)),
|
|
5
|
+
});
|
|
6
|
+
const previews = (node) => ({
|
|
7
|
+
previewConnectionGrant: (input) => node.runValidatedNodeOperation(input, connectionGrantSetPreviewParametersSchema, (client, parameters, options) => client.previewConnectionGrant(parameters, options)),
|
|
8
|
+
previewConnectionPool: (input) => node.runValidatedNodeOperation(input, connectionPoolSetPreviewParametersSchema, (client, parameters, options) => client.previewConnectionPool(parameters, options)),
|
|
9
|
+
});
|
|
10
|
+
const confirmations = (node) => ({
|
|
11
|
+
confirmConnectionGrant: (input) => node.runValidatedNodeOperation(input, connectionGrantSetConfirmParametersSchema, (client, parameters, options) => client.confirmConnectionGrant(parameters, options), { commandId: input.commandId }),
|
|
12
|
+
confirmConnectionPool: (input) => node.runValidatedNodeOperation(input, connectionPoolSetConfirmParametersSchema, (client, parameters, options) => client.confirmConnectionPool(parameters, options), { commandId: input.commandId }),
|
|
13
|
+
});
|
|
14
|
+
export const makeConnectionAccessClient = (node) => ({
|
|
15
|
+
...confirmations(node),
|
|
16
|
+
...previews(node),
|
|
17
|
+
...reads(node),
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type CommandContext, type CommandEffect } from "../../command-line/index.js";
|
|
2
|
+
export declare const runConnectionGrantList: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
3
|
+
export declare const runConnectionPoolList: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
4
|
+
export declare const runConnectionGrantSet: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
5
|
+
export declare const runConnectionPoolSet: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
6
|
+
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { connectionGrantSetConfirmParametersSchema, connectionPoolSetConfirmParametersSchema, } from "@maiaos/sdk";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import { CliArgumentError, confirmParameters, parseOptions, readTwoPhaseMode, runTwoPhase, TWO_PHASE_FLAGS, writeNodeResult, } from "../../command-line/index.js";
|
|
4
|
+
import { formatConnectionAccessResult, } from "./format.js";
|
|
5
|
+
import { GRANT_SET_OPTIONS, POOL_SET_OPTIONS, readGrantList, readGrantPreview, readPoolList, readPoolPreview, } from "./input.js";
|
|
6
|
+
const write = (context) => (result) => writeNodeResult(result, context, {
|
|
7
|
+
toResult: (value) => ({
|
|
8
|
+
command: value.method,
|
|
9
|
+
result: value,
|
|
10
|
+
}),
|
|
11
|
+
toText: formatConnectionAccessResult,
|
|
12
|
+
});
|
|
13
|
+
const unavailable = () => new CliArgumentError("Connection grants and pools are unavailable.");
|
|
14
|
+
const list = (step, read) => (tokens, context) => Effect.gen(function* () {
|
|
15
|
+
const operation = step(context.dependencies);
|
|
16
|
+
if (operation === undefined)
|
|
17
|
+
return yield* unavailable();
|
|
18
|
+
return write(context)(yield* operation(read(tokens)));
|
|
19
|
+
});
|
|
20
|
+
export const runConnectionGrantList = list((dependencies) => dependencies.listConnectionGrants, readGrantList);
|
|
21
|
+
export const runConnectionPoolList = list((dependencies) => dependencies.listConnectionPools, readPoolList);
|
|
22
|
+
const PROMPT = {
|
|
23
|
+
describe: (preview) => formatConnectionAccessResult({ command: preview.method, result: preview }),
|
|
24
|
+
question: "Apply this change?",
|
|
25
|
+
};
|
|
26
|
+
const runSet = (spec, tokens, context) => Effect.gen(function* () {
|
|
27
|
+
const parsed = parseOptions(tokens, spec.options, new Set(spec.flags));
|
|
28
|
+
const mode = readTwoPhaseMode(parsed.flags, context);
|
|
29
|
+
const send = spec.confirm(context.dependencies);
|
|
30
|
+
const preview = spec.preview(context.dependencies);
|
|
31
|
+
if (send === undefined || preview === undefined)
|
|
32
|
+
return yield* unavailable();
|
|
33
|
+
return yield* runTwoPhase({
|
|
34
|
+
confirm: (previewed) => Effect.flatMap(confirmParameters(spec.confirmSchema, previewed, ["current"]), send),
|
|
35
|
+
context,
|
|
36
|
+
mode,
|
|
37
|
+
preview: () => Effect.flatMap(spec.read(parsed), preview),
|
|
38
|
+
prompt: PROMPT,
|
|
39
|
+
writeConfirm: write(context),
|
|
40
|
+
writePreview: write(context),
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
const set = (spec) => (tokens, context) => runSet(spec, tokens, context);
|
|
44
|
+
export const runConnectionGrantSet = set({
|
|
45
|
+
confirm: (dependencies) => dependencies.confirmConnectionGrant,
|
|
46
|
+
confirmSchema: connectionGrantSetConfirmParametersSchema,
|
|
47
|
+
flags: ["--revoke", ...TWO_PHASE_FLAGS],
|
|
48
|
+
options: GRANT_SET_OPTIONS,
|
|
49
|
+
preview: (dependencies) => dependencies.previewConnectionGrant,
|
|
50
|
+
read: readGrantPreview,
|
|
51
|
+
});
|
|
52
|
+
export const runConnectionPoolSet = set({
|
|
53
|
+
confirm: (dependencies) => dependencies.confirmConnectionPool,
|
|
54
|
+
confirmSchema: connectionPoolSetConfirmParametersSchema,
|
|
55
|
+
flags: TWO_PHASE_FLAGS,
|
|
56
|
+
options: POOL_SET_OPTIONS,
|
|
57
|
+
preview: (dependencies) => dependencies.previewConnectionPool,
|
|
58
|
+
read: readPoolPreview,
|
|
59
|
+
});
|
|
60
|
+
//# sourceMappingURL=commands.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ConnectionGrantListResult, ConnectionGrantSetConfirmResult, ConnectionGrantSetPreviewResult, ConnectionPoolListResult, ConnectionPoolSetConfirmResult, ConnectionPoolSetPreviewResult } from "@maiaos/sdk";
|
|
2
|
+
export type ConnectionAccessResult = ConnectionGrantListResult | ConnectionGrantSetConfirmResult | ConnectionGrantSetPreviewResult | ConnectionPoolListResult | ConnectionPoolSetConfirmResult | ConnectionPoolSetPreviewResult;
|
|
3
|
+
export type CliConnectionAccessResult = {
|
|
4
|
+
readonly command: ConnectionAccessResult["method"];
|
|
5
|
+
readonly result: ConnectionAccessResult;
|
|
6
|
+
};
|
|
7
|
+
export declare const formatConnectionAccessResult: ({ result, }: CliConnectionAccessResult) => string;
|
|
8
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { formatRows, tab, withNextPage } from "../../command-line/index.js";
|
|
2
|
+
const scopeCell = (scope) => `${scope.kind === "project" ? "project" : "container"}:${scope.id}`;
|
|
3
|
+
const grantLine = (grant) => tab([
|
|
4
|
+
grant.grantId,
|
|
5
|
+
grant.connectionId,
|
|
6
|
+
scopeCell(grant.scope),
|
|
7
|
+
grant.state,
|
|
8
|
+
`revision=${grant.revision}`,
|
|
9
|
+
]);
|
|
10
|
+
const poolLine = (pool) => tab([
|
|
11
|
+
pool.poolId,
|
|
12
|
+
scopeCell(pool.scope),
|
|
13
|
+
pool.mode,
|
|
14
|
+
pool.members.length === 0 ? "-" : pool.members.join(","),
|
|
15
|
+
`revision=${pool.revision}`,
|
|
16
|
+
]);
|
|
17
|
+
const grantPreviewLines = (result) => [
|
|
18
|
+
result.current === undefined
|
|
19
|
+
? tab([result.connectionId, scopeCell(result.scope), "none", "current"])
|
|
20
|
+
: `${grantLine(result.current)}\tcurrent`,
|
|
21
|
+
tab([
|
|
22
|
+
result.connectionId,
|
|
23
|
+
scopeCell(result.scope),
|
|
24
|
+
result.granted ? "grant" : "revoke",
|
|
25
|
+
"proposed",
|
|
26
|
+
`command=${result.commandId}`,
|
|
27
|
+
`expires=${result.expiresAt}`,
|
|
28
|
+
]),
|
|
29
|
+
].join("\n");
|
|
30
|
+
const poolPreviewLines = (result) => [
|
|
31
|
+
result.current === undefined
|
|
32
|
+
? tab([scopeCell(result.scope), "none", "current"])
|
|
33
|
+
: `${poolLine(result.current)}\tcurrent`,
|
|
34
|
+
tab([
|
|
35
|
+
scopeCell(result.scope),
|
|
36
|
+
result.mode,
|
|
37
|
+
result.members.length === 0 ? "-" : result.members.join(","),
|
|
38
|
+
"proposed",
|
|
39
|
+
`command=${result.commandId}`,
|
|
40
|
+
`expires=${result.expiresAt}`,
|
|
41
|
+
]),
|
|
42
|
+
].join("\n");
|
|
43
|
+
const confirmed = (line, result) => tab([line, result.receipt.receiptId, result.delivery]);
|
|
44
|
+
const formatLines = (result) => {
|
|
45
|
+
switch (result.method) {
|
|
46
|
+
case "connection.grant.list":
|
|
47
|
+
return withNextPage(formatRows(result.items, grantLine, "No grants."), result.nextCursor).trimEnd();
|
|
48
|
+
case "connection.pool.list":
|
|
49
|
+
return withNextPage(formatRows(result.items, poolLine, "No pools."), result.nextCursor).trimEnd();
|
|
50
|
+
case "connection.grant.set.preview":
|
|
51
|
+
return grantPreviewLines(result);
|
|
52
|
+
case "connection.pool.set.preview":
|
|
53
|
+
return poolPreviewLines(result);
|
|
54
|
+
case "connection.grant.set.confirm":
|
|
55
|
+
return confirmed(grantLine(result.grant), result);
|
|
56
|
+
case "connection.pool.set.confirm":
|
|
57
|
+
return confirmed(poolLine(result.pool), result);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
export const formatConnectionAccessResult = ({ result, }) => `${formatLines(result)}\n`;
|
|
61
|
+
//# sourceMappingURL=format.js.map
|