@maiaos/cli 0.1.0-canary.2
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 +287 -0
- package/dist/bin/maia.NOTICES.txt +59 -0
- package/dist/bin/maia.cdx.json +145 -0
- package/dist/bin/maia.mjs +2 -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 +45 -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 +481 -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 +178 -0
- package/dist/command-line/context.js +2 -0
- package/dist/command-line/index.d.ts +7 -0
- package/dist/command-line/index.js +6 -0
- package/dist/command-line/input/arguments.d.ts +55 -0
- package/dist/command-line/input/arguments.js +220 -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 +11 -0
- package/dist/command-line/input/stdin.js +23 -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 +3 -0
- package/dist/command-line/json.js +4 -0
- package/dist/command-line/output.d.ts +57 -0
- package/dist/command-line/output.js +94 -0
- package/dist/command-line/rows.d.ts +10 -0
- package/dist/command-line/rows.js +32 -0
- package/dist/command-line/two-phase.d.ts +57 -0
- package/dist/command-line/two-phase.js +148 -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 +219 -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 +126 -0
- package/dist/command-tree/placeholder.d.ts +3 -0
- package/dist/command-tree/placeholder.js +4 -0
- package/dist/command-tree/row.d.ts +29 -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 +34 -0
- package/dist/command-tree/tree.js +124 -0
- package/dist/connection/client.d.ts +692 -0
- package/dist/connection/client.js +28 -0
- package/dist/connection/commands.d.ts +15 -0
- package/dist/connection/commands.js +118 -0
- package/dist/connection/index.d.ts +7 -0
- package/dist/connection/index.js +7 -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 +4 -0
- package/dist/connection/system.js +190 -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 +209 -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 +28 -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/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/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 +29 -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 +96 -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 +76 -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 +40 -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 +67 -0
- package/dist/local-node/client.js +241 -0
- package/dist/local-node/index.d.ts +3 -0
- package/dist/local-node/index.js +3 -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 +93 -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 +7 -0
- package/dist/mcp/calls.js +202 -0
- package/dist/mcp/commands.d.ts +9 -0
- package/dist/mcp/commands.js +21 -0
- package/dist/mcp/index.d.ts +2 -0
- package/dist/mcp/index.js +2 -0
- package/dist/mcp/server.d.ts +11 -0
- package/dist/mcp/server.js +57 -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 +32 -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 +39 -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 +700 -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 +126 -0
- package/dist/project-workspace/output/human.js +103 -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 +197 -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 +39 -0
- package/dist/reference/index.d.ts +3 -0
- package/dist/reference/index.js +3 -0
- package/dist/reference/resolve.d.ts +29 -0
- package/dist/reference/resolve.js +294 -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 +258 -0
- package/dist/remote-node/client.js +12 -0
- package/dist/remote-node/commands.d.ts +6 -0
- package/dist/remote-node/commands.js +264 -0
- package/dist/remote-node/connector.d.ts +59 -0
- package/dist/remote-node/connector.js +122 -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 +22 -0
- package/dist/remote-node/reachability.js +34 -0
- package/dist/remote-node/text.d.ts +9 -0
- package/dist/remote-node/text.js +64 -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 +51 -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 +123 -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 +12 -0
- package/dist/session/approval/output/format.js +25 -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 +8 -0
- package/dist/session/attach-render.d.ts +16 -0
- package/dist/session/attach-render.js +154 -0
- package/dist/session/attach.d.ts +5 -0
- package/dist/session/attach.js +106 -0
- package/dist/session/client.d.ts +132 -0
- package/dist/session/client.js +128 -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 +13 -0
- package/dist/session/commands.js +488 -0
- package/dist/session/create-tasks.d.ts +20 -0
- package/dist/session/create-tasks.js +110 -0
- package/dist/session/index.d.ts +9 -0
- package/dist/session/index.js +7 -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 +3 -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 +30 -0
- package/dist/session/output/failure.d.ts +11 -0
- package/dist/session/output/failure.js +24 -0
- package/dist/session/output/human.d.ts +112 -0
- package/dist/session/output/human.js +71 -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 +19 -0
- package/dist/session/output/tasks.js +34 -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 +309 -0
- package/dist/session/turn/client.d.ts +25 -0
- package/dist/session/turn/client.js +40 -0
- package/dist/session/turn/commands.d.ts +6 -0
- package/dist/session/turn/commands.js +157 -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 +42 -0
- package/dist/session/turn/output.js +38 -0
- package/dist/status/client.d.ts +119 -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 +31 -0
- package/dist/status/output/compact.js +46 -0
- package/dist/status/output/human.d.ts +7 -0
- package/dist/status/output/human.js +30 -0
- package/dist/status/output/index.d.ts +3 -0
- package/dist/status/output/index.js +3 -0
- package/dist/terminal/arguments.d.ts +13 -0
- package/dist/terminal/arguments.js +79 -0
- package/dist/terminal/client.d.ts +79 -0
- package/dist/terminal/client.js +68 -0
- package/dist/terminal/commands.d.ts +7 -0
- package/dist/terminal/commands.js +131 -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 +147 -0
- package/dist/terminal/output/compact-list.js +152 -0
- package/dist/terminal/output/human.d.ts +59 -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 +76 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
const projectCleanup = (cleanup) => cleanup.state === "unknown"
|
|
2
|
+
? { reason: cleanup.reason, state: cleanup.state }
|
|
3
|
+
: { state: cleanup.state };
|
|
4
|
+
const projectOptionalCleanup = (cleanup) => cleanup.state === "pending" ? {} : { cleanup: projectCleanup(cleanup) };
|
|
5
|
+
const projectExit = (exit) => ({
|
|
6
|
+
...(exit.code === undefined ? {} : { code: exit.code }),
|
|
7
|
+
observedAt: exit.observedAt,
|
|
8
|
+
...(exit.signal === undefined ? {} : { signal: exit.signal }),
|
|
9
|
+
});
|
|
10
|
+
const projectOptionalExit = (terminal) => "exit" in terminal && terminal.exit !== undefined
|
|
11
|
+
? { exit: projectExit(terminal.exit) }
|
|
12
|
+
: {};
|
|
13
|
+
const projectUnavailableTerminal = (terminal) => ({
|
|
14
|
+
id: terminal.id,
|
|
15
|
+
projectId: terminal.projectId,
|
|
16
|
+
revision: terminal.revision,
|
|
17
|
+
state: terminal.state,
|
|
18
|
+
unavailability: terminal.unavailability,
|
|
19
|
+
workspaceId: terminal.workspaceId,
|
|
20
|
+
workspaceRevision: terminal.workspaceRevision,
|
|
21
|
+
});
|
|
22
|
+
const projectLiveTerminal = (terminal, includeViewport, audience) => ({
|
|
23
|
+
...(audience === "human"
|
|
24
|
+
? { capability: { tier: terminal.capability.tier } }
|
|
25
|
+
: {}),
|
|
26
|
+
...projectOptionalCleanup(terminal.cleanup),
|
|
27
|
+
...projectOptionalExit(terminal),
|
|
28
|
+
generation: terminal.generation,
|
|
29
|
+
id: terminal.id,
|
|
30
|
+
projectId: terminal.projectId,
|
|
31
|
+
revision: terminal.revision,
|
|
32
|
+
state: terminal.state,
|
|
33
|
+
...(includeViewport
|
|
34
|
+
? {
|
|
35
|
+
viewport: {
|
|
36
|
+
columns: terminal.viewport.columns,
|
|
37
|
+
rows: terminal.viewport.rows,
|
|
38
|
+
},
|
|
39
|
+
}
|
|
40
|
+
: {}),
|
|
41
|
+
workspaceId: terminal.workspaceId,
|
|
42
|
+
workspaceRevision: terminal.workspaceRevision,
|
|
43
|
+
});
|
|
44
|
+
export const terminalOutputAudience = (json) => json ? "json" : "human";
|
|
45
|
+
export const projectTerminalListItem = (terminal, audience = "json") => (terminal.state === "unavailable"
|
|
46
|
+
? projectUnavailableTerminal(terminal)
|
|
47
|
+
: projectLiveTerminal(terminal, false, audience));
|
|
48
|
+
const projectTerminalShowTerminal = (terminal, audience = "json") => (terminal.state === "unavailable"
|
|
49
|
+
? projectUnavailableTerminal(terminal)
|
|
50
|
+
: projectLiveTerminal(terminal, true, audience));
|
|
51
|
+
export const projectTerminalListResult = (value, workspaceId, audience = "json") => ({
|
|
52
|
+
command: "terminal.list",
|
|
53
|
+
count: value.items.length,
|
|
54
|
+
items: value.items.map((item) => projectTerminalListItem(item, audience)),
|
|
55
|
+
...(value.nextCursor === undefined ? {} : { nextCursor: value.nextCursor }),
|
|
56
|
+
workspaceId: value.items[0]?.workspaceId ?? workspaceId,
|
|
57
|
+
});
|
|
58
|
+
export const projectTerminalShowResult = (value, audience = "json") => ({
|
|
59
|
+
command: "terminal.show",
|
|
60
|
+
terminal: projectTerminalShowTerminal(value.terminal, audience),
|
|
61
|
+
});
|
|
62
|
+
const projectLegacyEvent = (event, audience) => ({
|
|
63
|
+
cursor: event.terminalCursor,
|
|
64
|
+
...(audience === "human" ? { globalCursor: event.globalCursor } : {}),
|
|
65
|
+
type: event.eventType,
|
|
66
|
+
unavailability: {
|
|
67
|
+
code: event.payload.code,
|
|
68
|
+
platform: event.payload.platform,
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
const projectCleanupEvent = (event) => ({
|
|
72
|
+
cleanup: projectCleanup(event.cleanup),
|
|
73
|
+
cursor: event.cursor,
|
|
74
|
+
type: "cleanup",
|
|
75
|
+
});
|
|
76
|
+
const projectControllerRevokedEvent = (event) => ({
|
|
77
|
+
cursor: event.cursor,
|
|
78
|
+
leaseId: event.leaseId,
|
|
79
|
+
reason: event.reason,
|
|
80
|
+
type: "controller-revoked",
|
|
81
|
+
});
|
|
82
|
+
const projectExitEvent = (event) => ({
|
|
83
|
+
cursor: event.cursor,
|
|
84
|
+
exit: projectExit(event.exit),
|
|
85
|
+
type: "exit",
|
|
86
|
+
});
|
|
87
|
+
const projectGapEvent = (event) => ({
|
|
88
|
+
cursor: event.cursor,
|
|
89
|
+
headCursor: event.headCursor,
|
|
90
|
+
oldestAvailableCursor: event.oldestAvailableCursor,
|
|
91
|
+
reason: event.reason,
|
|
92
|
+
recovery: event.recovery,
|
|
93
|
+
...(event.requestedAfterCursor === undefined
|
|
94
|
+
? {}
|
|
95
|
+
: { requestedAfterCursor: event.requestedAfterCursor }),
|
|
96
|
+
type: "gap",
|
|
97
|
+
});
|
|
98
|
+
const projectLifecycleEvent = (event, audience) => ({
|
|
99
|
+
cursor: event.cursor,
|
|
100
|
+
previousCleanup: projectCleanup(event.previousCleanup),
|
|
101
|
+
previousGeneration: event.previousGeneration,
|
|
102
|
+
previousRevision: event.previousRevision,
|
|
103
|
+
previousState: event.previousState,
|
|
104
|
+
terminal: projectTerminalListItem(event.terminal, audience),
|
|
105
|
+
transition: event.transition,
|
|
106
|
+
type: "lifecycle-transition",
|
|
107
|
+
});
|
|
108
|
+
const projectLiveEvent = (event, audience) => {
|
|
109
|
+
switch (event.type) {
|
|
110
|
+
case "cleanup":
|
|
111
|
+
return projectCleanupEvent(event);
|
|
112
|
+
case "controller-revoked":
|
|
113
|
+
return projectControllerRevokedEvent(event);
|
|
114
|
+
case "exit":
|
|
115
|
+
return projectExitEvent(event);
|
|
116
|
+
case "gap":
|
|
117
|
+
return projectGapEvent(event);
|
|
118
|
+
case "lifecycle-transition":
|
|
119
|
+
return projectLifecycleEvent(event, audience);
|
|
120
|
+
case "output":
|
|
121
|
+
return { cursor: event.cursor, type: "output" };
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
export const projectTerminalEvent = (event, audience = "json") => "eventType" in event
|
|
125
|
+
? projectLegacyEvent(event, audience)
|
|
126
|
+
: projectLiveEvent(event, audience);
|
|
127
|
+
export const projectTerminalEventsResult = (value, audience = "json") => ({
|
|
128
|
+
command: "terminal.events",
|
|
129
|
+
count: value.items.length,
|
|
130
|
+
headCursor: value.headTerminalCursor,
|
|
131
|
+
items: value.items.map((event) => projectTerminalEvent(event, audience)),
|
|
132
|
+
...(value.nextTerminalCursor === undefined
|
|
133
|
+
? {}
|
|
134
|
+
: { nextCursor: value.nextTerminalCursor }),
|
|
135
|
+
terminalId: value.terminalId,
|
|
136
|
+
});
|
|
137
|
+
export const projectTerminalChunk = (chunk) => ({
|
|
138
|
+
bytesBase64: chunk.bytesBase64,
|
|
139
|
+
cursor: chunk.cursor,
|
|
140
|
+
...("generation" in chunk ? { generation: chunk.generation } : {}),
|
|
141
|
+
});
|
|
142
|
+
export const projectTerminalReadResult = (value) => ({
|
|
143
|
+
command: "terminal.read",
|
|
144
|
+
count: value.items.length,
|
|
145
|
+
headChunkCursor: value.headChunkCursor,
|
|
146
|
+
items: value.items.map(projectTerminalChunk),
|
|
147
|
+
...(value.nextChunkCursor === undefined
|
|
148
|
+
? {}
|
|
149
|
+
: { nextChunkCursor: value.nextChunkCursor }),
|
|
150
|
+
terminalId: value.terminalId,
|
|
151
|
+
});
|
|
152
|
+
//# sourceMappingURL=compact-list.js.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { LiveTerminalCloseResult, LiveTerminalControllerAcquireResult, LiveTerminalControllerReleaseResult, LiveTerminalControllerRequestResult, LiveTerminalControllerRequestShowResult, LiveTerminalResizeResult, LiveTerminalSignalResult, LiveTerminalWriteResult, TerminalCreateResult, TerminalListResult } from "@maiaos/sdk";
|
|
2
|
+
import { type CliIo } from "../../command-line/index.js";
|
|
3
|
+
import type { CliNodeResult } from "../../local-node/index.js";
|
|
4
|
+
import type { CliOutputAudience, CliTerminalEventsResult, CliTerminalListResult, CliTerminalReadResult, CliTerminalShowResult } from "./compact-list.js";
|
|
5
|
+
type UnavailableTerminal = Extract<TerminalListResult["items"][number], {
|
|
6
|
+
readonly state: "unavailable";
|
|
7
|
+
}>;
|
|
8
|
+
type UnavailableTerminalCreateResult = Extract<TerminalCreateResult, {
|
|
9
|
+
readonly accepted: false;
|
|
10
|
+
}>;
|
|
11
|
+
type InteractiveTerminalCreateResult = Exclude<TerminalCreateResult, UnavailableTerminalCreateResult>;
|
|
12
|
+
export type CliTerminalResult = CliTerminalEventsResult<CliOutputAudience> | CliTerminalListResult<CliOutputAudience> | CliTerminalReadResult | CliTerminalShowResult<CliOutputAudience> | {
|
|
13
|
+
readonly command: "terminal.close";
|
|
14
|
+
readonly result: LiveTerminalCloseResult;
|
|
15
|
+
} | {
|
|
16
|
+
readonly command: "terminal.controller.acquire";
|
|
17
|
+
readonly result: LiveTerminalControllerAcquireResult;
|
|
18
|
+
} | {
|
|
19
|
+
readonly command: "terminal.controller.release";
|
|
20
|
+
readonly result: LiveTerminalControllerReleaseResult;
|
|
21
|
+
} | {
|
|
22
|
+
readonly command: "terminal.controller.request";
|
|
23
|
+
readonly result: LiveTerminalControllerRequestResult;
|
|
24
|
+
} | {
|
|
25
|
+
readonly command: "terminal.controller.request.show";
|
|
26
|
+
readonly result: LiveTerminalControllerRequestShowResult;
|
|
27
|
+
} | {
|
|
28
|
+
readonly command: "terminal.create";
|
|
29
|
+
readonly result: InteractiveTerminalCreateResult | {
|
|
30
|
+
readonly accepted: false;
|
|
31
|
+
readonly delivery: UnavailableTerminalCreateResult["delivery"];
|
|
32
|
+
readonly receipt: UnavailableTerminalCreateResult["receipt"];
|
|
33
|
+
readonly state: UnavailableTerminal["state"];
|
|
34
|
+
readonly terminalId: string;
|
|
35
|
+
readonly unavailability: UnavailableTerminal["unavailability"];
|
|
36
|
+
readonly workspaceId: string;
|
|
37
|
+
readonly workspaceRevision: string;
|
|
38
|
+
};
|
|
39
|
+
} | {
|
|
40
|
+
readonly command: "terminal.input.write";
|
|
41
|
+
readonly result: LiveTerminalWriteResult;
|
|
42
|
+
} | {
|
|
43
|
+
readonly command: "terminal.resize";
|
|
44
|
+
readonly result: LiveTerminalResizeResult;
|
|
45
|
+
} | {
|
|
46
|
+
readonly command: "terminal.signal";
|
|
47
|
+
readonly result: LiveTerminalSignalResult;
|
|
48
|
+
};
|
|
49
|
+
export declare const formatTerminalList: (result: CliTerminalListResult<CliOutputAudience>) => string;
|
|
50
|
+
export declare const formatTerminalShow: (result: CliTerminalShowResult<CliOutputAudience>) => string;
|
|
51
|
+
export declare const formatTerminalEvents: (result: CliTerminalEventsResult<CliOutputAudience>) => string;
|
|
52
|
+
export declare const formatTerminalRead: (result: CliTerminalReadResult) => string;
|
|
53
|
+
export declare const formatTerminalResult: (result: CliTerminalResult) => string;
|
|
54
|
+
export declare const writeTerminalResult: <TValue>(result: CliNodeResult<TValue>, context: {
|
|
55
|
+
readonly io: CliIo;
|
|
56
|
+
readonly json: boolean;
|
|
57
|
+
}, map: (value: TValue) => CliTerminalResult) => number;
|
|
58
|
+
export {};
|
|
59
|
+
//# sourceMappingURL=human.d.ts.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { cell, formatRows, writeNodeResult, } from "../../command-line/index.js";
|
|
2
|
+
const isHumanLiveTerminal = (terminal) => terminal.state !== "unavailable" && "capability" in terminal;
|
|
3
|
+
const formatTerminalProjection = (terminal) => {
|
|
4
|
+
if (terminal.state === "unavailable") {
|
|
5
|
+
return `${cell(terminal.id)}\t${cell(terminal.state)}\t${cell(terminal.unavailability.code)}\t${cell(terminal.workspaceId)}`;
|
|
6
|
+
}
|
|
7
|
+
if (!isHumanLiveTerminal(terminal)) {
|
|
8
|
+
throw new Error("Human live terminal TSV requires capability.tier.");
|
|
9
|
+
}
|
|
10
|
+
return `${cell(terminal.id)}\t${cell(terminal.state)}\t${cell(terminal.capability.tier)}\t${cell(terminal.workspaceId)}`;
|
|
11
|
+
};
|
|
12
|
+
export const formatTerminalList = (result) => formatRows(result.items, formatTerminalProjection, "No terminals.");
|
|
13
|
+
export const formatTerminalShow = (result) => `${formatTerminalProjection(result.terminal)}\n`;
|
|
14
|
+
const isHumanLegacyEvent = (event) => "unavailability" in event && "globalCursor" in event;
|
|
15
|
+
const formatTerminalEvent = (event) => {
|
|
16
|
+
if ("unavailability" in event) {
|
|
17
|
+
if (!isHumanLegacyEvent(event)) {
|
|
18
|
+
throw new Error("Human legacy terminal event TSV requires globalCursor.");
|
|
19
|
+
}
|
|
20
|
+
return `${cell(event.cursor)}\t${cell(event.type)}\t${cell(event.globalCursor)}`;
|
|
21
|
+
}
|
|
22
|
+
return `${cell(event.cursor)}\t${cell(event.type)}`;
|
|
23
|
+
};
|
|
24
|
+
export const formatTerminalEvents = (result) => formatRows(result.items, formatTerminalEvent);
|
|
25
|
+
export const formatTerminalRead = (result) => formatRows(result.items, (chunk) => `${cell(chunk.cursor)}\t${chunk.bytesBase64}`);
|
|
26
|
+
export const formatTerminalResult = (result) => {
|
|
27
|
+
switch (result.command) {
|
|
28
|
+
case "terminal.create":
|
|
29
|
+
return "accepted" in result.result && !result.result.accepted
|
|
30
|
+
? `${result.result.terminalId}\t${result.result.state}\t${result.result.unavailability.code}\n`
|
|
31
|
+
: `${JSON.stringify(result.result)}\n`;
|
|
32
|
+
case "terminal.close":
|
|
33
|
+
case "terminal.controller.acquire":
|
|
34
|
+
case "terminal.controller.release":
|
|
35
|
+
case "terminal.controller.request":
|
|
36
|
+
case "terminal.controller.request.show":
|
|
37
|
+
case "terminal.input.write":
|
|
38
|
+
case "terminal.resize":
|
|
39
|
+
case "terminal.signal":
|
|
40
|
+
return `${JSON.stringify(result.result)}\n`;
|
|
41
|
+
case "terminal.events":
|
|
42
|
+
return formatTerminalEvents(result);
|
|
43
|
+
case "terminal.list":
|
|
44
|
+
return formatTerminalList(result);
|
|
45
|
+
case "terminal.read":
|
|
46
|
+
return formatTerminalRead(result);
|
|
47
|
+
case "terminal.show":
|
|
48
|
+
return formatTerminalShow(result);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
export const writeTerminalResult = (result, context, map) => writeNodeResult(result, context, {
|
|
52
|
+
toResult: map,
|
|
53
|
+
toText: formatTerminalResult,
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=human.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { type CliLiveTerminal, type CliOutputAudience, type CliTerminalEvent, type CliTerminalEventsResult, type CliTerminalListItem, type CliTerminalListResult, type CliTerminalReadResult, type CliTerminalShowResult, type CliTerminalShowTerminal, projectTerminalEventsResult, projectTerminalListResult, projectTerminalReadResult, projectTerminalShowResult, terminalOutputAudience, } from "./compact-list.js";
|
|
2
|
+
export { type CliTerminalResult, formatTerminalEvents, formatTerminalList, formatTerminalRead, formatTerminalResult, formatTerminalShow, writeTerminalResult, } from "./human.js";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { projectTerminalEventsResult, projectTerminalListResult, projectTerminalReadResult, projectTerminalShowResult, terminalOutputAudience, } from "./compact-list.js";
|
|
2
|
+
export { formatTerminalEvents, formatTerminalList, formatTerminalRead, formatTerminalResult, formatTerminalShow, writeTerminalResult, } from "./human.js";
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
const terminal = () => import("../index.js");
|
|
2
|
+
export const TERMINAL_TREE = {
|
|
3
|
+
groups: [
|
|
4
|
+
["terminal", "Terminals in a Workspace."],
|
|
5
|
+
["terminal events", "A terminal's events."],
|
|
6
|
+
["terminal controller", "Control of a terminal."],
|
|
7
|
+
["terminal controller request", "Requests to control a terminal."],
|
|
8
|
+
["terminal input", "Terminal input."],
|
|
9
|
+
],
|
|
10
|
+
leaves: [
|
|
11
|
+
[
|
|
12
|
+
"terminal create --workspace <workspace-id> [--interactive --columns <2..500> --rows <2..300>] [--command-id <id>]",
|
|
13
|
+
1,
|
|
14
|
+
"terminal.create",
|
|
15
|
+
"Create a terminal in a Workspace.",
|
|
16
|
+
{ run: [terminal, "runTerminalCreate"] },
|
|
17
|
+
],
|
|
18
|
+
[
|
|
19
|
+
"terminal list --workspace <workspace-id> [--limit <1..100>] [--after <cursor>]",
|
|
20
|
+
1,
|
|
21
|
+
"terminal.list",
|
|
22
|
+
"List a Workspace's terminals.",
|
|
23
|
+
{ run: [terminal, "runTerminalList"] },
|
|
24
|
+
],
|
|
25
|
+
[
|
|
26
|
+
"terminal show <terminal-id>",
|
|
27
|
+
1,
|
|
28
|
+
"terminal.show",
|
|
29
|
+
"Show one terminal.",
|
|
30
|
+
{ run: [terminal, "runTerminalShow"] },
|
|
31
|
+
],
|
|
32
|
+
[
|
|
33
|
+
"terminal read <terminal-id> [--limit <1..8>] [--after <chunk-cursor>]",
|
|
34
|
+
1,
|
|
35
|
+
"terminal.read",
|
|
36
|
+
"Read a terminal's output.",
|
|
37
|
+
{ run: [terminal, "runTerminalRead"] },
|
|
38
|
+
],
|
|
39
|
+
[
|
|
40
|
+
"terminal events list --terminal <terminal-id> [--limit <1..32>] [--after <terminal-cursor>]",
|
|
41
|
+
1,
|
|
42
|
+
"terminal.events.list",
|
|
43
|
+
"List a terminal's events.",
|
|
44
|
+
{ run: [terminal, "runTerminalEventsList"] },
|
|
45
|
+
],
|
|
46
|
+
[
|
|
47
|
+
"terminal controller request create --terminal <terminal-id> --terminal-generation <1..65535> --lease-ms <1000..30000> [--command-id <id>]",
|
|
48
|
+
1,
|
|
49
|
+
"terminal.controller.request",
|
|
50
|
+
"Request control of a terminal.",
|
|
51
|
+
{ run: [terminal, "runControllerRequestCreate"] },
|
|
52
|
+
],
|
|
53
|
+
[
|
|
54
|
+
"terminal controller request show <controller-request-id> --terminal <terminal-id> --terminal-generation <1..65535>",
|
|
55
|
+
1,
|
|
56
|
+
"terminal.controller.request.show",
|
|
57
|
+
"Show a terminal control request.",
|
|
58
|
+
{ run: [terminal, "runControllerRequestShow"] },
|
|
59
|
+
],
|
|
60
|
+
[
|
|
61
|
+
"terminal controller acquire <terminal-id> --request <controller-request-id> --terminal-generation <1..65535> --expected-revision <revision> [--command-id <id>]",
|
|
62
|
+
1,
|
|
63
|
+
"terminal.controller.acquire",
|
|
64
|
+
"Acquire control of a terminal.",
|
|
65
|
+
{ run: [terminal, "runControllerAcquire"] },
|
|
66
|
+
],
|
|
67
|
+
[
|
|
68
|
+
"terminal controller release <terminal-id> --controller-id <id> --controller-epoch <epoch> --controller-revision <revision> --controller-expires-at <timestamp> --terminal-generation <1..65535> --expected-revision <revision> [--command-id <id>]",
|
|
69
|
+
1,
|
|
70
|
+
"terminal.controller.release",
|
|
71
|
+
"Release control of a terminal.",
|
|
72
|
+
{ run: [terminal, "runControllerRelease"] },
|
|
73
|
+
],
|
|
74
|
+
[
|
|
75
|
+
"terminal input write <terminal-id> --input-stdin --input-id <id> --input-sequence <1..2147483647> --controller-id <id> --controller-epoch <epoch> --controller-revision <revision> --controller-expires-at <timestamp> --terminal-generation <1..65535> --expected-revision <revision> [--command-id <id>]",
|
|
76
|
+
1,
|
|
77
|
+
"terminal.input.write",
|
|
78
|
+
"Write input to a terminal you control.",
|
|
79
|
+
{ run: [terminal, "runTerminalInputWrite"] },
|
|
80
|
+
],
|
|
81
|
+
[
|
|
82
|
+
"terminal resize <terminal-id> --columns <2..500> --rows <2..300> --controller-id <id> --controller-epoch <epoch> --controller-revision <revision> --controller-expires-at <timestamp> --terminal-generation <1..65535> --expected-revision <revision> [--command-id <id>]",
|
|
83
|
+
1,
|
|
84
|
+
"terminal.session.resize",
|
|
85
|
+
"Resize a terminal you control.",
|
|
86
|
+
{ run: [terminal, "runTerminalResize"] },
|
|
87
|
+
],
|
|
88
|
+
[
|
|
89
|
+
"terminal signal <terminal-id> --signal <hangup|interrupt|terminate> --controller-id <id> --controller-epoch <epoch> --controller-revision <revision> --controller-expires-at <timestamp> --terminal-generation <1..65535> --expected-revision <revision> [--command-id <id>]",
|
|
90
|
+
1,
|
|
91
|
+
"terminal.session.signal",
|
|
92
|
+
"Signal a terminal you control.",
|
|
93
|
+
{ run: [terminal, "runTerminalSignal"] },
|
|
94
|
+
],
|
|
95
|
+
[
|
|
96
|
+
"terminal close <terminal-id> --controller-id <id> --controller-epoch <epoch> --controller-revision <revision> --controller-expires-at <timestamp> --terminal-generation <1..65535> --expected-revision <revision> [--command-id <id>]",
|
|
97
|
+
1,
|
|
98
|
+
"terminal.session.close",
|
|
99
|
+
"Close a terminal you control.",
|
|
100
|
+
{ run: [terminal, "runTerminalClose"] },
|
|
101
|
+
],
|
|
102
|
+
],
|
|
103
|
+
};
|
|
104
|
+
//# sourceMappingURL=tree.js.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: maia-cli
|
|
3
|
+
description: >
|
|
4
|
+
Operate the public Maia CLI and first-party Pi agent. Discover
|
|
5
|
+
callable commands from classified help, inspect local control-plane state,
|
|
6
|
+
recover receipts, and run maia agent without inventing runtime adapters.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Maia CLI
|
|
10
|
+
|
|
11
|
+
## Goal
|
|
12
|
+
|
|
13
|
+
Use the installed `maia` binary as the public client. Treat `maia help --json`
|
|
14
|
+
and `maia help <family> --json` as the command allowlist.
|
|
15
|
+
|
|
16
|
+
## Main rules
|
|
17
|
+
|
|
18
|
+
1. Use only families and usage rows present in classified help.
|
|
19
|
+
2. Treat `source_implemented_candidate` as release-disabled unless the caller
|
|
20
|
+
explicitly accepts that status.
|
|
21
|
+
3. Prefer `--json` for node-facing commands. Read errors from stderr.
|
|
22
|
+
4. Put prompts and large or sensitive bodies on bounded stdin where the command
|
|
23
|
+
supports it.
|
|
24
|
+
5. Reuse a mutation's command ID and reconcile its receipt after an unknown
|
|
25
|
+
outcome.
|
|
26
|
+
6. Use exact project, workspace, session, turn, run, task, worker, and revision
|
|
27
|
+
identifiers. Never infer authority from cwd.
|
|
28
|
+
|
|
29
|
+
## Implemented foundation
|
|
30
|
+
|
|
31
|
+
- `maia --json status`
|
|
32
|
+
- `maia --json project register <path>`
|
|
33
|
+
- `maia --json project list`
|
|
34
|
+
- `maia --json project show <project-id>`
|
|
35
|
+
- `maia --json workspace list --project <project-id>`
|
|
36
|
+
- `maia --json workspace show <workspace-id>`
|
|
37
|
+
- `maia --json workspace repository attach <path> --workspace <workspace-id> --expected-revision <revision>`
|
|
38
|
+
- `maia --json receipt list`
|
|
39
|
+
- `maia --json receipt show <command-id>`
|
|
40
|
+
- `maia --json session create --workspace <workspace-id>`
|
|
41
|
+
- `maia --json session list --project <project-id>`
|
|
42
|
+
- `maia --json session show <session-id>`
|
|
43
|
+
- `maia --json session events list --session <session-id>`
|
|
44
|
+
- `maia agent`
|
|
45
|
+
- `maia agent --print --no-session -- <prompt>`
|
|
46
|
+
- `maia agent --json-events --no-session -- <prompt>`
|
|
47
|
+
|
|
48
|
+
`maia agent` is the first-party official-Pi harness. It is not a selector for
|
|
49
|
+
Codex, Claude, installed Pi, or `pi-rpc`. Ambient `~/.pi` resources are not
|
|
50
|
+
loaded.
|
|
51
|
+
|
|
52
|
+
## Do not
|
|
53
|
+
|
|
54
|
+
- Do not call absent integration or runtime-discovery families.
|
|
55
|
+
- Do not write provider-native configuration roots.
|
|
56
|
+
- Do not treat a Pi extension as Maia operation authority.
|
|
57
|
+
- Do not treat a worktree or Pi process as a sandbox.
|
|
58
|
+
- Do not invent a hidden coordinator, current Session, or unbounded target.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: maia-orchestration
|
|
3
|
+
description: >
|
|
4
|
+
Coordinate source-candidate, release-disabled local-v1 Maia Runs through the
|
|
5
|
+
public CLI: create, list, show, task list and show, inbox check and ack,
|
|
6
|
+
questions, and dispatch show or settle-terminal. Use when an external agent
|
|
7
|
+
is the explicit Run coordinator. Do not treat these commands as
|
|
8
|
+
release-enabled, worker assignment, or Orca equivalence.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Maia orchestration
|
|
12
|
+
|
|
13
|
+
Every command in this Skill is a **source-implemented candidate,
|
|
14
|
+
release-disabled**. Confirm the usage exists on `maia help run --json` and is
|
|
15
|
+
tagged `source_implemented_candidate` before running it. Do not start a
|
|
16
|
+
worker, waiter, harness, or model turn.
|
|
17
|
+
|
|
18
|
+
## Identity
|
|
19
|
+
|
|
20
|
+
Supply explicit ids. Do not infer a Run from the terminal, cwd, Git, or
|
|
21
|
+
environment. Do not use `--scope current`, `--from`, or `--preamble`.
|
|
22
|
+
|
|
23
|
+
After `run create`, keep `run.id`, `run.revision`, `dispatch.id`,
|
|
24
|
+
`dispatch.revision`, both mailbox ids and revisions, and `receipt.commandId`
|
|
25
|
+
from the compact CLI projection. Recover a Task objective with
|
|
26
|
+
`run task show`. Recover Dispatch identity with `run dispatch show`.
|
|
27
|
+
|
|
28
|
+
## Candidate commands
|
|
29
|
+
|
|
30
|
+
Label every invocation as release-disabled when you describe it.
|
|
31
|
+
|
|
32
|
+
- `maia --json run create --workspace <workspace-id> --terminal <terminal-id> --graph-stdin`
|
|
33
|
+
- `maia --json run list --workspace <workspace-id>`
|
|
34
|
+
- `maia --json run show <run-id>`
|
|
35
|
+
- `maia --json run task list --run <run-id>`
|
|
36
|
+
- `maia --json run task show <task-id> --run <run-id>`
|
|
37
|
+
- `maia --json run inbox check --run <run-id> --owner <run|dispatch> --owner-id <id> --coordinator-epoch 1`
|
|
38
|
+
- `maia --json run inbox ack <delivery-id> --run <run-id> --owner <run|dispatch> --owner-id <id> --expected-mailbox-revision <revision> --coordinator-epoch 1`
|
|
39
|
+
- `maia --json run question open --run <run-id> --dispatch <dispatch-id> --subject <text> --body-stdin --expected-run-revision <revision> --expected-dispatch-revision <revision> --coordinator-epoch 1`
|
|
40
|
+
- `maia --json run question reply <question-id> --run <run-id> --dispatch <dispatch-id> --answer-stdin --expected-run-revision <revision> --expected-dispatch-revision <revision> --expected-question-revision <revision> --coordinator-epoch 1`
|
|
41
|
+
- `maia --json run question cancel <question-id> --run <run-id> --dispatch <dispatch-id> --expected-run-revision <revision> --expected-dispatch-revision <revision> --expected-question-revision <revision> --coordinator-epoch 1`
|
|
42
|
+
- `maia --json run dispatch show --run <run-id>`
|
|
43
|
+
- `maia --json run dispatch settle-terminal <dispatch-id> --run <run-id> --expected-run-revision <revision> --expected-dispatch-revision <revision> --coordinator-epoch 1`
|
|
44
|
+
|
|
45
|
+
Put the Task graph, Question body, and reply answer on stdin.
|
|
46
|
+
|
|
47
|
+
## Do not run
|
|
48
|
+
|
|
49
|
+
Do not wait, watch, or poll an inbox. Do not assign a worker. Do not settle a
|
|
50
|
+
caller-selected outcome. `settle-terminal` only records the Terminal's exact
|
|
51
|
+
unavailable failure. Do not teach Skill install/sync or extra runtime probes.
|
|
52
|
+
|
|
53
|
+
A compact CLI projection is not a protocol change. The SDK remains lossless.
|
|
54
|
+
No Orca command is equivalent.
|
package/package.json
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maiaos/cli",
|
|
3
|
+
"version": "0.1.0-canary.2",
|
|
4
|
+
"description": "The maia CLI and MCP server: start, drive, observe and stop swarms of Claude Code and Codex agents from a terminal, a script or another agent.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"maia",
|
|
7
|
+
"maiaos",
|
|
8
|
+
"cli",
|
|
9
|
+
"mcp",
|
|
10
|
+
"mcp-server",
|
|
11
|
+
"model-context-protocol",
|
|
12
|
+
"ai-agents",
|
|
13
|
+
"coding-agents",
|
|
14
|
+
"multi-agent",
|
|
15
|
+
"agent-orchestration",
|
|
16
|
+
"claude-code",
|
|
17
|
+
"codex",
|
|
18
|
+
"typescript"
|
|
19
|
+
],
|
|
20
|
+
"homepage": "https://github.com/maiaos/maiaos/tree/main/apps/cli#readme",
|
|
21
|
+
"bugs": "https://github.com/maiaos/maiaos/issues",
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/maiaos/maiaos.git",
|
|
25
|
+
"directory": "apps/cli"
|
|
26
|
+
},
|
|
27
|
+
"type": "module",
|
|
28
|
+
"sideEffects": false,
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"bin": {
|
|
31
|
+
"maia": "./dist/bin/maia.mjs"
|
|
32
|
+
},
|
|
33
|
+
"exports": {
|
|
34
|
+
".": {
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"import": "./dist/index.js",
|
|
37
|
+
"default": "./dist/index.js"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"files": [
|
|
41
|
+
"dist",
|
|
42
|
+
"!dist/bin/*.meta.json",
|
|
43
|
+
"!dist/**/*.d.ts.map",
|
|
44
|
+
"!dist/**/*.js.map",
|
|
45
|
+
"!dist/**/*.mjs.map",
|
|
46
|
+
"!dist/bin/maia.d.ts",
|
|
47
|
+
"!dist/bin/maia.d.ts.map",
|
|
48
|
+
"guidance",
|
|
49
|
+
"README.md"
|
|
50
|
+
],
|
|
51
|
+
"publishConfig": {
|
|
52
|
+
"access": "public"
|
|
53
|
+
},
|
|
54
|
+
"engines": {
|
|
55
|
+
"node": "24.22.1"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@types/node": "24.13.3",
|
|
59
|
+
"@typescript/native": "npm:typescript@7.0.2",
|
|
60
|
+
"@vllnt/typescript": "2.0.0-canary.a1749e0",
|
|
61
|
+
"eslint": "9.39.5",
|
|
62
|
+
"typescript": "npm:@typescript/typescript6@6.0.2"
|
|
63
|
+
},
|
|
64
|
+
"dependencies": {
|
|
65
|
+
"@effect/platform-node-shared": "4.0.0",
|
|
66
|
+
"@maiaos/agent": "0.1.0-canary.2",
|
|
67
|
+
"@maiaos/sdk": "0.1.0-canary.2",
|
|
68
|
+
"effect": "4.0.0"
|
|
69
|
+
},
|
|
70
|
+
"scripts": {
|
|
71
|
+
"build": "node -e \"require('node:fs').rmSync('dist',{force:true,recursive:true})\" && tsc --project tsconfig.build.json && node scripts/build-executable.mjs",
|
|
72
|
+
"lint": "eslint src scripts --max-warnings 0",
|
|
73
|
+
"test": "node -e \"require('node:fs').rmSync('.test-dist',{force:true,recursive:true})\" && tsc --project tsconfig.test.json && node --import ../../scripts/lib/test-environment.mjs --test --test-concurrency=2 --enable-source-maps \".test-dist/**/*.test.js\"",
|
|
74
|
+
"typecheck": "tsc --project tsconfig.json --noEmit && tsc --project scripts/tsconfig.json --noEmit"
|
|
75
|
+
}
|
|
76
|
+
}
|