@maiaos/cli 0.1.0-canary.8 → 0.1.0-canary.81
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/LICENSE +21 -0
- package/README.md +21 -15
- package/dist/address-space/address-space.js +21 -2
- package/dist/address-space/index.js +1 -1
- package/dist/agents/client.d.ts +48 -27
- package/dist/agents/client.js +10 -3
- package/dist/agents/commands.d.ts +1 -0
- package/dist/agents/commands.js +24 -2
- package/dist/agents/index.d.ts +1 -1
- package/dist/agents/index.js +1 -1
- package/dist/agents/input.js +6 -0
- package/dist/agents/output/format.js +11 -0
- package/dist/agents/tree/tree.js +16 -4
- package/dist/bin/maia.NOTICES.txt +1 -1
- package/dist/bin/maia.cdx.json +70 -19
- package/dist/bin/maia.mjs +1 -1
- package/dist/board/client.d.ts +27 -0
- package/dist/board/client.js +40 -0
- package/dist/board/commands.d.ts +28 -0
- package/dist/board/commands.js +52 -0
- package/dist/board/index.d.ts +3 -0
- package/dist/board/index.js +3 -0
- package/dist/board/input.js +339 -0
- package/dist/board/output/format.js +175 -0
- package/dist/board/output/index.js +2 -0
- package/dist/board/plan.js +47 -0
- package/dist/board/tree/index.js +2 -0
- package/dist/board/tree/tree.js +161 -0
- package/dist/cli/cli.d.ts +11 -3
- package/dist/cli/cli.js +211 -12
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/log-level.d.ts +11 -0
- package/dist/cli/log-level.js +14 -0
- package/dist/command-line/context.d.ts +20 -6
- package/dist/command-line/emit/index.d.ts +4 -0
- package/dist/command-line/emit/index.js +4 -0
- package/dist/command-line/{output.d.ts → emit/output.d.ts} +7 -3
- package/dist/command-line/{output.js → emit/output.js} +13 -5
- package/dist/command-line/{rows.d.ts → emit/rows.d.ts} +2 -0
- package/dist/command-line/{rows.js → emit/rows.js} +6 -0
- package/dist/command-line/index.d.ts +6 -6
- package/dist/command-line/index.js +5 -6
- package/dist/command-line/input/arguments.d.ts +6 -0
- package/dist/command-line/input/arguments.js +20 -0
- package/dist/command-line/input/index.d.ts +3 -2
- package/dist/command-line/input/index.js +3 -2
- package/dist/command-line/input/manager-options.d.ts +10 -0
- package/dist/command-line/input/manager-options.js +38 -0
- package/dist/command-line/input/prompt.d.ts +1 -0
- package/dist/command-line/input/prompt.js +1 -0
- package/dist/command-line/two-phase/index.d.ts +2 -0
- package/dist/command-line/two-phase/index.js +2 -0
- package/dist/command-line/{two-phase.d.ts → two-phase/two-phase.d.ts} +14 -14
- package/dist/command-line/{two-phase.js → two-phase/two-phase.js} +11 -11
- package/dist/command-receipt/command.js +1 -1
- package/dist/command-tree/commands.d.ts +1 -1
- package/dist/command-tree/commands.js +1 -5
- package/dist/command-tree/deprecated.d.ts +2 -0
- package/dist/command-tree/deprecated.js +29 -0
- package/dist/command-tree/grammar.js +2 -0
- package/dist/command-tree/help.d.ts +2 -2
- package/dist/command-tree/help.js +13 -15
- package/dist/command-tree/index.d.ts +1 -0
- package/dist/command-tree/index.js +1 -0
- package/dist/command-tree/local.js +27 -7
- package/dist/command-tree/placeholder.js +1 -1
- package/dist/command-tree/row.d.ts +1 -0
- package/dist/command-tree/tree.d.ts +2 -1
- package/dist/command-tree/tree.js +35 -4
- package/dist/connection/client.d.ts +72 -18
- package/dist/connection/client.js +1 -0
- package/dist/connection/executors/executors.d.ts +18 -0
- package/dist/connection/executors/executors.js +95 -0
- package/dist/connection/executors/index.d.ts +2 -0
- package/dist/connection/executors/index.js +2 -0
- package/dist/connection/executors/reading.js +22 -0
- package/dist/connection/index.d.ts +1 -0
- package/dist/connection/index.js +1 -0
- package/dist/connection/input.js +4 -4
- package/dist/connection/login.d.ts +1 -1
- package/dist/connection/login.js +4 -3
- package/dist/connection/output/format.js +6 -3
- package/dist/connection/output/index.d.ts +1 -1
- package/dist/connection/output/index.js +1 -1
- package/dist/connection/resolve.d.ts +5 -0
- package/dist/connection/setup-file.js +227 -0
- package/dist/connection/setup-project.js +138 -0
- package/dist/connection/system.js +126 -61
- package/dist/connection/tree/tree.js +179 -10
- package/dist/container/client.d.ts +2 -0
- package/dist/events/commands.js +65 -0
- package/dist/events/index.js +2 -0
- package/dist/events/tree/index.js +2 -0
- package/dist/events/tree/tree.js +17 -0
- package/dist/fleet/fleet.d.ts +7 -8
- package/dist/fleet/fleet.js +18 -6
- package/dist/fleet/index.d.ts +1 -1
- package/dist/fleet/index.js +1 -1
- package/dist/github/client.d.ts +189 -0
- package/dist/github/client.js +16 -0
- package/dist/github/commands.d.ts +17 -0
- package/dist/github/commands.js +81 -0
- package/dist/github/index.d.ts +3 -0
- package/dist/github/index.js +3 -0
- package/dist/github/input.js +114 -0
- package/dist/github/output/format.js +78 -0
- package/dist/github/output/index.js +2 -0
- package/dist/github/tree/index.js +2 -0
- package/dist/github/tree/tree.js +28 -0
- package/dist/goal/client.d.ts +246 -0
- package/dist/goal/client.js +13 -0
- package/dist/goal/commands.d.ts +22 -0
- package/dist/goal/commands.js +110 -0
- package/dist/goal/index.d.ts +4 -0
- package/dist/goal/index.js +4 -0
- package/dist/goal/input.js +118 -0
- package/dist/goal/output/format.js +29 -0
- package/dist/goal/output/index.js +2 -0
- package/dist/goal/pause.d.ts +16 -0
- package/dist/goal/pause.js +91 -0
- package/dist/goal/tree/index.js +2 -0
- package/dist/goal/tree/tree.js +49 -0
- package/dist/hold/client.d.ts +2 -0
- package/dist/hold/tree/tree.js +2 -2
- package/dist/import/batch/batch.js +196 -0
- package/dist/import/batch/index.js +3 -0
- package/dist/import/batch/manifest.js +108 -0
- package/dist/import/client.d.ts +3 -3
- package/dist/import/client.js +1 -1
- package/dist/import/commands.d.ts +2 -0
- package/dist/import/commands.js +104 -18
- package/dist/import/detach.d.ts +12 -0
- package/dist/import/detach.js +70 -0
- package/dist/import/index.d.ts +2 -1
- package/dist/import/index.js +2 -1
- package/dist/import/input.js +68 -11
- package/dist/import/output.js +57 -8
- package/dist/inbox/client.d.ts +310 -0
- package/dist/inbox/client.js +15 -0
- package/dist/inbox/index.d.ts +2 -0
- package/dist/inbox/index.js +2 -0
- package/dist/integration/client.d.ts +607 -1
- package/dist/integration/client.js +41 -1
- package/dist/integration/commands.d.ts +16 -0
- package/dist/integration/commands.js +93 -10
- package/dist/integration/index.d.ts +1 -1
- package/dist/integration/index.js +1 -1
- package/dist/local-node/client.d.ts +13 -1
- package/dist/local-node/client.js +189 -234
- package/dist/local-node/index.d.ts +1 -1
- package/dist/local-node/index.js +1 -1
- package/dist/login/commands.js +7 -1
- package/dist/login/gateway.js +36 -13
- package/dist/login/menu.js +2 -1
- package/dist/login/vendor-account.js +3 -2
- package/dist/login/vendor-input.js +5 -4
- package/dist/mcp/calls.js +47 -221
- package/dist/mcp/routing.d.ts +3 -2
- package/dist/mcp/routing.js +38 -8
- package/dist/mcp/server.d.ts +10 -1
- package/dist/mcp/server.js +16 -6
- package/dist/migrate/classes.js +158 -0
- package/dist/migrate/commands.js +46 -0
- package/dist/migrate/format.js +199 -0
- package/dist/migrate/index.js +2 -0
- package/dist/migrate/item.js +59 -0
- package/dist/migrate/plan.js +79 -0
- package/dist/migrate/tree/index.js +2 -0
- package/dist/migrate/tree/tree.js +23 -0
- package/dist/node-update/client.d.ts +17 -0
- package/dist/node-update/client.js +27 -0
- package/dist/node-update/commands.d.ts +20 -0
- package/dist/node-update/commands.js +150 -0
- package/dist/node-update/index.d.ts +4 -0
- package/dist/node-update/index.js +4 -0
- package/dist/node-update/output.d.ts +12 -0
- package/dist/node-update/output.js +165 -0
- package/dist/node-update/tree/index.js +2 -0
- package/dist/node-update/tree/tree.js +73 -0
- package/dist/pairing/client.d.ts +13 -0
- package/dist/pairing/client.js +36 -0
- package/dist/pairing/commands.d.ts +15 -0
- package/dist/pairing/commands.js +131 -0
- package/dist/pairing/index.d.ts +4 -0
- package/dist/pairing/index.js +4 -0
- package/dist/pairing/output.d.ts +12 -0
- package/dist/pairing/output.js +53 -0
- package/dist/pairing/tree/index.js +2 -0
- package/dist/pairing/tree/tree.js +35 -0
- package/dist/panel/client.d.ts +9 -0
- package/dist/panel/client.js +24 -0
- package/dist/panel/commands.d.ts +19 -0
- package/dist/panel/commands.js +112 -0
- package/dist/panel/index.d.ts +3 -0
- package/dist/panel/index.js +3 -0
- package/dist/panel/tree/index.js +2 -0
- package/dist/panel/tree/tree.js +14 -0
- package/dist/port-lease/client.d.ts +3 -0
- package/dist/principal/client.d.ts +9 -0
- package/dist/principal/client.js +7 -0
- package/dist/principal/commands.d.ts +14 -0
- package/dist/principal/commands.js +84 -0
- package/dist/principal/index.d.ts +4 -0
- package/dist/principal/index.js +4 -0
- package/dist/principal/output.d.ts +8 -0
- package/dist/principal/output.js +43 -0
- package/dist/principal/tree/index.js +2 -0
- package/dist/principal/tree/tree.js +31 -0
- package/dist/project-guard/client.d.ts +13 -0
- package/dist/project-guard/input.js +15 -1
- package/dist/project-guard/output/format.js +5 -0
- package/dist/project-instructions/client.d.ts +56 -0
- package/dist/project-instructions/client.js +7 -0
- package/dist/project-instructions/commands.d.ts +13 -0
- package/dist/project-instructions/commands.js +89 -0
- package/dist/project-instructions/index.d.ts +3 -0
- package/dist/project-instructions/index.js +3 -0
- package/dist/project-instructions/input.js +33 -0
- package/dist/project-instructions/output/format.js +22 -0
- package/dist/project-instructions/output/index.js +2 -0
- package/dist/project-knowledge/change.js +22 -0
- package/dist/project-knowledge/client.d.ts +127 -0
- package/dist/project-knowledge/client.js +17 -0
- package/dist/project-knowledge/commands.d.ts +14 -0
- package/dist/project-knowledge/commands.js +100 -0
- package/dist/project-knowledge/index.d.ts +3 -0
- package/dist/project-knowledge/index.js +3 -0
- package/dist/project-knowledge/input.js +32 -0
- package/dist/project-knowledge/output/format.js +64 -0
- package/dist/project-knowledge/output/index.js +2 -0
- package/dist/project-knowledge/sources.js +108 -0
- package/dist/project-knowledge/upload.js +27 -0
- package/dist/project-workspace/git-reads.d.ts +12 -0
- package/dist/project-workspace/git-reads.js +71 -0
- package/dist/project-workspace/index.d.ts +1 -0
- package/dist/project-workspace/index.js +1 -0
- package/dist/project-workspace/metadata-client.d.ts +2 -0
- package/dist/project-workspace/output/human.js +1 -1
- package/dist/project-workspace/tree/tree.js +95 -5
- package/dist/reach/client.d.ts +9 -0
- package/dist/reach/client.js +7 -0
- package/dist/reach/commands.d.ts +14 -0
- package/dist/reach/commands.js +72 -0
- package/dist/reach/index.d.ts +3 -0
- package/dist/reach/index.js +3 -0
- package/dist/reach/output.js +41 -0
- package/dist/reach/tree/index.js +2 -0
- package/dist/reach/tree/tree.js +28 -0
- package/dist/reference/resolve.js +2 -1
- package/dist/remote-node/client.d.ts +85 -0
- package/dist/remote-node/commands.js +32 -17
- package/dist/remote-node/connector.d.ts +16 -0
- package/dist/remote-node/connector.js +10 -3
- package/dist/remote-node/reachability.js +31 -18
- package/dist/remote-node/reading.js +31 -0
- package/dist/remote-node/text.js +68 -5
- package/dist/remote-node/tree/tree.js +14 -3
- package/dist/routine/client.d.ts +547 -13
- package/dist/routine/client.js +19 -1
- package/dist/routine/commands.d.ts +5 -0
- package/dist/routine/commands.js +73 -15
- package/dist/routine/index.d.ts +2 -1
- package/dist/routine/index.js +2 -1
- package/dist/routine/input.js +66 -3
- package/dist/routine/output/format.js +80 -19
- package/dist/routine/output/index.js +1 -1
- package/dist/routine/portable/import-files.js +74 -0
- package/dist/routine/portable/import-output.js +21 -0
- package/dist/routine/portable/import.js +274 -0
- package/dist/routine/portable/index.js +3 -0
- package/dist/routine/portable/portable.js +185 -0
- package/dist/routine/tree/tree.js +80 -8
- package/dist/routine/trigger/commands.d.ts +20 -0
- package/dist/routine/trigger/commands.js +74 -0
- package/dist/routine/trigger/format.js +42 -0
- package/dist/routine/trigger/index.d.ts +2 -0
- package/dist/routine/trigger/index.js +2 -0
- package/dist/routine/trigger/input.js +81 -0
- package/dist/run-ledger/client.d.ts +47 -0
- package/dist/secret/client.d.ts +39 -0
- package/dist/secret/client.js +6 -0
- package/dist/secret/commands.d.ts +12 -0
- package/dist/secret/commands.js +91 -0
- package/dist/secret/index.d.ts +3 -0
- package/dist/secret/index.js +3 -0
- package/dist/secret/input.js +22 -0
- package/dist/secret/output/format.js +10 -0
- package/dist/secret/output/index.js +2 -0
- package/dist/secret/tree/index.js +2 -0
- package/dist/secret/tree/tree.js +16 -0
- package/dist/session/agent-permission.d.ts +3 -2
- package/dist/session/approval/client.d.ts +9 -5
- package/dist/session/approval/client.js +2 -2
- package/dist/session/approval/commands.d.ts +8 -0
- package/dist/session/approval/commands.js +272 -22
- package/dist/session/approval/index.d.ts +1 -1
- package/dist/session/approval/index.js +1 -1
- package/dist/session/approval/output/format.js +53 -1
- package/dist/session/approval/output/index.js +1 -1
- package/dist/session/attach.d.ts +1 -1
- package/dist/session/attach.js +7 -2
- package/dist/session/client.d.ts +18 -13
- package/dist/session/client.js +39 -19
- package/dist/session/coding-client.d.ts +2 -0
- package/dist/session/coding-client.js +1 -2
- package/dist/session/coding-commands.js +24 -7
- package/dist/session/command/commands.js +109 -0
- package/dist/session/command/index.js +2 -0
- package/dist/session/commands.d.ts +6 -1
- package/dist/session/commands.js +411 -73
- package/dist/session/create-tasks.js +23 -51
- package/dist/session/creation/creation.js +51 -0
- package/dist/session/creation/index.js +2 -0
- package/dist/session/fork/fork.js +135 -0
- package/dist/session/fork/index.js +2 -0
- package/dist/session/git-status.d.ts +11 -0
- package/dist/session/git-status.js +30 -0
- package/dist/session/index.d.ts +4 -3
- package/dist/session/index.js +3 -2
- package/dist/session/interaction/client.d.ts +3 -0
- package/dist/session/move/index.js +2 -0
- package/dist/session/move/move.js +439 -0
- package/dist/session/output/held.js +28 -0
- package/dist/session/output/human.js +64 -10
- package/dist/session/output/tasks.js +68 -7
- package/dist/session/setup/index.js +2 -0
- package/dist/session/setup/setup.js +69 -0
- package/dist/session/spawn/caps.js +128 -0
- package/dist/session/spawn/index.js +5 -0
- package/dist/session/spawn/spawn.js +203 -0
- package/dist/session/spawn/standing.js +62 -0
- package/dist/session/spawn/supervision.js +62 -0
- package/dist/session/switch/index.js +2 -0
- package/dist/session/switch/switch.js +103 -0
- package/dist/session/tree/tree.js +328 -32
- package/dist/session/turn/attachments.js +54 -0
- package/dist/session/turn/client.d.ts +3 -1
- package/dist/session/turn/client.js +6 -1
- package/dist/session/turn/commands.d.ts +5 -1
- package/dist/session/turn/commands.js +204 -31
- package/dist/session/turn/index.d.ts +2 -2
- package/dist/session/turn/index.js +1 -1
- package/dist/session/turn/output.d.ts +31 -1
- package/dist/session/turn/output.js +45 -2
- package/dist/skills-sync/client.d.ts +9 -0
- package/dist/skills-sync/client.js +7 -0
- package/dist/skills-sync/commands.d.ts +15 -0
- package/dist/skills-sync/commands.js +241 -0
- package/dist/skills-sync/index.d.ts +3 -0
- package/dist/skills-sync/index.js +3 -0
- package/dist/skills-sync/output.js +168 -0
- package/dist/skills-sync/set-file.js +23 -0
- package/dist/skills-sync/tree/index.js +2 -0
- package/dist/skills-sync/tree/tree.js +38 -0
- package/dist/status/client.d.ts +21 -3
- package/dist/status/command.js +6 -3
- package/dist/status/doctor.d.ts +5 -1
- package/dist/status/doctor.js +14 -7
- package/dist/status/output/compact.d.ts +3 -0
- package/dist/status/output/compact.js +17 -7
- package/dist/status/output/human.js +25 -0
- package/dist/team-workspace/client.d.ts +1 -0
- package/dist/terminal/control-commands.js +26 -9
- package/dist/terminal/keys.js +62 -0
- package/dist/terminal/output/compact-list.js +3 -0
- package/dist/terminal/output/human.js +2 -2
- package/dist/terminal/tree/tree.js +1 -1
- package/dist/text-input/index.js +2 -0
- package/dist/text-input/text-input.js +35 -0
- package/dist/webhooks/client.d.ts +157 -0
- package/dist/webhooks/client.js +8 -0
- package/dist/webhooks/commands.d.ts +17 -0
- package/dist/webhooks/commands.js +76 -0
- package/dist/webhooks/index.d.ts +3 -0
- package/dist/webhooks/index.js +3 -0
- package/dist/webhooks/input.js +125 -0
- package/dist/webhooks/output/format.js +75 -0
- package/dist/webhooks/output/index.js +2 -0
- package/dist/webhooks/tree/index.js +2 -0
- package/dist/webhooks/tree/tree.js +49 -0
- package/guidance/maia-cli/SKILL.md +1 -1
- package/guidance/maia-node/SKILL.md +54 -0
- package/guidance/maia-orchestration/SKILL.md +1 -2
- package/guidance/maia-sessions/SKILL.md +110 -0
- package/package.json +7 -6
- package/dist/address-space/address-space.d.ts +0 -38
- package/dist/address-space/index.d.ts +0 -2
- package/dist/agents/input.d.ts +0 -130
- package/dist/agents/output/format.d.ts +0 -8
- package/dist/agents/output/index.d.ts +0 -2
- package/dist/agents/tree/index.d.ts +0 -2
- package/dist/agents/tree/tree.d.ts +0 -3
- package/dist/bootstrap/exit.d.ts +0 -14
- package/dist/bootstrap/exit.js +0 -42
- package/dist/bootstrap/index.d.ts +0 -3
- package/dist/bootstrap/index.js +0 -3
- package/dist/bootstrap/process.d.ts +0 -5
- package/dist/bootstrap/process.js +0 -23
- package/dist/bootstrap/run.d.ts +0 -25
- package/dist/bootstrap/run.js +0 -95
- package/dist/bootstrap/stdio.d.ts +0 -4
- package/dist/bootstrap/stdio.js +0 -9
- package/dist/cli/environment.d.ts +0 -8
- package/dist/cli/services.d.ts +0 -4
- package/dist/command-line/context.js +0 -2
- package/dist/command-line/input/stdin-stream.d.ts +0 -4
- package/dist/command-line/json-decoder.d.ts +0 -3
- package/dist/command-receipt/command.d.ts +0 -4
- package/dist/command-receipt/compact-list.d.ts +0 -20
- package/dist/command-receipt/index.d.ts +0 -3
- package/dist/command-tree/completion.d.ts +0 -6
- package/dist/command-tree/local.d.ts +0 -3
- package/dist/command-tree/row.js +0 -2
- package/dist/connection/access/format.d.ts +0 -8
- package/dist/connection/access/input.d.ts +0 -53
- package/dist/connection/input.d.ts +0 -50
- package/dist/connection/signin.d.ts +0 -4
- package/dist/connection/tree/index.d.ts +0 -2
- package/dist/connection/tree/tree.d.ts +0 -3
- package/dist/container/output/format.d.ts +0 -11
- package/dist/container/output/index.d.ts +0 -2
- package/dist/context/client.d.ts +0 -7
- package/dist/context/commands.d.ts +0 -3
- package/dist/context/index.d.ts +0 -3
- package/dist/dashboard/cockpit-client.d.ts +0 -6
- package/dist/dashboard/cockpit-client.js +0 -27
- package/dist/dashboard/cockpits.d.ts +0 -29
- package/dist/dashboard/cockpits.js +0 -65
- package/dist/dashboard/dashboard.d.ts +0 -7
- package/dist/dashboard/draw.d.ts +0 -15
- package/dist/dashboard/frame.d.ts +0 -4
- package/dist/dashboard/index.d.ts +0 -2
- package/dist/dashboard/modes.d.ts +0 -5
- package/dist/dashboard/node-connection.d.ts +0 -15
- package/dist/dashboard/node-connection.js +0 -51
- package/dist/dashboard/pi-tui.d.ts +0 -6
- package/dist/dashboard/status-bar.d.ts +0 -4
- package/dist/dashboard/terminal.d.ts +0 -53
- package/dist/dashboard/tree-model.d.ts +0 -28
- package/dist/dashboard/tree.d.ts +0 -10
- package/dist/development/cli.d.ts +0 -3
- package/dist/development/cli.js +0 -44
- package/dist/execution/tree/index.d.ts +0 -2
- package/dist/execution/tree/tree.d.ts +0 -3
- package/dist/hold/output/format.d.ts +0 -11
- package/dist/hold/output/index.d.ts +0 -2
- package/dist/hold/tree/index.d.ts +0 -2
- package/dist/hold/tree/tree.d.ts +0 -3
- package/dist/import/input.d.ts +0 -16
- package/dist/import/output.d.ts +0 -6
- package/dist/integration/output.d.ts +0 -22
- package/dist/login/failure.d.ts +0 -3
- package/dist/login/gateway.d.ts +0 -12
- package/dist/login/menu.d.ts +0 -4
- package/dist/login/output/format.d.ts +0 -16
- package/dist/login/output/index.d.ts +0 -2
- package/dist/login/vendor-account.d.ts +0 -95
- package/dist/login/vendor-input.d.ts +0 -14
- package/dist/mcp/calls.d.ts +0 -8
- package/dist/orchestration/output/compact-aggregate.d.ts +0 -121
- package/dist/orchestration/output/compact-run-list.d.ts +0 -20
- package/dist/orchestration/output/human.d.ts +0 -80
- package/dist/orchestration/output/index.d.ts +0 -4
- package/dist/orchestration/tree/index.d.ts +0 -2
- package/dist/orchestration/tree/tree.d.ts +0 -3
- package/dist/port-lease/input.d.ts +0 -65
- package/dist/port-lease/output/format.d.ts +0 -11
- package/dist/port-lease/output/index.d.ts +0 -2
- package/dist/presentation/output/format.d.ts +0 -11
- package/dist/presentation/output/index.d.ts +0 -3
- package/dist/project-guard/input.d.ts +0 -18
- package/dist/project-guard/output/format.d.ts +0 -11
- package/dist/project-guard/output/index.d.ts +0 -2
- package/dist/project-workspace/output/human.d.ts +0 -139
- package/dist/project-workspace/output/index.d.ts +0 -3
- package/dist/project-workspace/output/metadata.d.ts +0 -11
- package/dist/project-workspace/tree/index.d.ts +0 -2
- package/dist/project-workspace/tree/tree.d.ts +0 -3
- package/dist/provider/client.d.ts +0 -6
- package/dist/provider/commands.d.ts +0 -3
- package/dist/provider/index.d.ts +0 -3
- package/dist/reference/commands.d.ts +0 -3
- package/dist/reference/index.d.ts +0 -3
- package/dist/reference/resolve.d.ts +0 -31
- package/dist/reference/tree/index.d.ts +0 -2
- package/dist/reference/tree/tree.d.ts +0 -3
- package/dist/remote-node/reachability.d.ts +0 -64
- package/dist/remote-node/text.d.ts +0 -10
- package/dist/remote-node/tree/index.d.ts +0 -2
- package/dist/remote-node/tree/tree.d.ts +0 -3
- package/dist/routine/input.d.ts +0 -28
- package/dist/routine/output/format.d.ts +0 -23
- package/dist/routine/output/index.d.ts +0 -2
- package/dist/routine/tree/index.d.ts +0 -2
- package/dist/routine/tree/tree.d.ts +0 -3
- package/dist/run-ledger/input.d.ts +0 -42
- package/dist/run-ledger/output/format.d.ts +0 -11
- package/dist/run-ledger/output/index.d.ts +0 -2
- package/dist/session/approval/output/format.d.ts +0 -23
- package/dist/session/approval/output/index.d.ts +0 -2
- package/dist/session/attach-render.d.ts +0 -16
- package/dist/session/create-tasks.d.ts +0 -20
- package/dist/session/interaction/input.d.ts +0 -15
- package/dist/session/interaction/output/format.d.ts +0 -11
- package/dist/session/interaction/output/index.d.ts +0 -2
- package/dist/session/output/diff.d.ts +0 -3
- package/dist/session/output/failure.d.ts +0 -11
- package/dist/session/output/human.d.ts +0 -113
- package/dist/session/output/index.d.ts +0 -6
- package/dist/session/output/observe.d.ts +0 -4
- package/dist/session/output/tasks.d.ts +0 -34
- package/dist/session/task-file.d.ts +0 -5
- package/dist/session/tree/index.d.ts +0 -2
- package/dist/session/tree/tree.d.ts +0 -3
- package/dist/team-workspace/ceremony.d.ts +0 -19
- package/dist/team-workspace/confirmation.d.ts +0 -4
- package/dist/team-workspace/dependencies.js +0 -2
- package/dist/team-workspace/output.d.ts +0 -15
- package/dist/terminal/arguments.d.ts +0 -13
- package/dist/terminal/output/compact-list.d.ts +0 -148
- package/dist/terminal/output/human.d.ts +0 -42
- package/dist/terminal/output/index.d.ts +0 -3
- package/dist/terminal/tree/index.d.ts +0 -2
- package/dist/terminal/tree/tree.d.ts +0 -3
- /package/dist/command-line/{json-decoder.js → emit/json-decoder.js} +0 -0
- /package/dist/command-line/{json.d.ts → emit/json.d.ts} +0 -0
- /package/dist/command-line/{json.js → emit/json.js} +0 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { WEBHOOK_SECRET_ENV_PREFIX, webhookSpecSchema, } from "@maiaos/sdk";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import { CliArgumentError, parseOptionsWith, readExpectedRevision, readPageSize, requirePositionals, } from "../command-line/input/index.js";
|
|
4
|
+
import { TWO_PHASE_FLAGS } from "../command-line/two-phase/index.js";
|
|
5
|
+
import { commandIdentifier } from "../local-node/index.js";
|
|
6
|
+
const targetOptions = ["--command-id", "--expected-revision"];
|
|
7
|
+
export const WEBHOOK_OPTIONS = {
|
|
8
|
+
add: {
|
|
9
|
+
allowed: new Set([
|
|
10
|
+
"--command-id",
|
|
11
|
+
"--event",
|
|
12
|
+
"--label",
|
|
13
|
+
"--node-id",
|
|
14
|
+
"--project",
|
|
15
|
+
"--secret-env",
|
|
16
|
+
"--url",
|
|
17
|
+
]),
|
|
18
|
+
allowedFlags: new Set([...TWO_PHASE_FLAGS, "--allow-private"]),
|
|
19
|
+
repeatable: new Set(["--event", "--label"]),
|
|
20
|
+
},
|
|
21
|
+
deliveries: {
|
|
22
|
+
allowed: new Set(["--after", "--limit", "--webhook"]),
|
|
23
|
+
allowedFlags: new Set(["--failed"]),
|
|
24
|
+
repeatable: new Set(),
|
|
25
|
+
},
|
|
26
|
+
list: {
|
|
27
|
+
allowed: new Set(["--after", "--limit"]),
|
|
28
|
+
allowedFlags: new Set(),
|
|
29
|
+
repeatable: new Set(),
|
|
30
|
+
},
|
|
31
|
+
redeliver: {
|
|
32
|
+
allowed: new Set(targetOptions),
|
|
33
|
+
allowedFlags: new Set(TWO_PHASE_FLAGS),
|
|
34
|
+
repeatable: new Set(),
|
|
35
|
+
},
|
|
36
|
+
remove: {
|
|
37
|
+
allowed: new Set(targetOptions),
|
|
38
|
+
allowedFlags: new Set(TWO_PHASE_FLAGS),
|
|
39
|
+
repeatable: new Set(),
|
|
40
|
+
},
|
|
41
|
+
test: {
|
|
42
|
+
allowed: new Set(targetOptions),
|
|
43
|
+
allowedFlags: new Set(TWO_PHASE_FLAGS),
|
|
44
|
+
repeatable: new Set(),
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
const required = (options, name) => {
|
|
48
|
+
const value = options.get(name);
|
|
49
|
+
if (value === undefined)
|
|
50
|
+
throw new CliArgumentError(`Option '${name}' is required.`);
|
|
51
|
+
return value;
|
|
52
|
+
};
|
|
53
|
+
const INVALID_SPEC = `The webhook is invalid: check '--url' (http or https, no credentials), '--secret-env' (${WEBHOOK_SECRET_ENV_PREFIX} then 1 to 43 of A-Z, 0-9 and _), '--event' (a hook event) and '--label' (key=value, no comma).`;
|
|
54
|
+
const labelFilter = (label) => {
|
|
55
|
+
const [key, ...rest] = label.split("=");
|
|
56
|
+
if (key === undefined || key === "" || rest.length === 0)
|
|
57
|
+
throw new CliArgumentError("Option '--label' takes key=value.");
|
|
58
|
+
return { key: `label.${key}`, value: rest.join("=") };
|
|
59
|
+
};
|
|
60
|
+
const filtersOf = (options) => {
|
|
61
|
+
const project = options.get("--project");
|
|
62
|
+
const node = options.get("--node-id");
|
|
63
|
+
return [
|
|
64
|
+
...(project === undefined ? [] : [{ key: "project", value: project }]),
|
|
65
|
+
...(node === undefined ? [] : [{ key: "node", value: node }]),
|
|
66
|
+
...(options.get("--label")?.split(",").map(labelFilter) ?? []),
|
|
67
|
+
];
|
|
68
|
+
};
|
|
69
|
+
const readSpec = (parsed) => {
|
|
70
|
+
const { flags, options } = parsed;
|
|
71
|
+
const spec = webhookSpecSchema.safeParse({
|
|
72
|
+
allowPrivate: flags.has("--allow-private"),
|
|
73
|
+
events: required(options, "--event").split(","),
|
|
74
|
+
filters: filtersOf(options),
|
|
75
|
+
secretEnv: required(options, "--secret-env"),
|
|
76
|
+
url: required(options, "--url"),
|
|
77
|
+
});
|
|
78
|
+
if (!spec.success)
|
|
79
|
+
throw new CliArgumentError(INVALID_SPEC);
|
|
80
|
+
return spec.data;
|
|
81
|
+
};
|
|
82
|
+
export const readWebhooksList = (tokens) => {
|
|
83
|
+
const { options, positionals } = parseOptionsWith(tokens, WEBHOOK_OPTIONS.list);
|
|
84
|
+
requirePositionals(positionals, 0);
|
|
85
|
+
const afterCursor = options.get("--after");
|
|
86
|
+
return {
|
|
87
|
+
...(afterCursor === undefined ? {} : { afterCursor }),
|
|
88
|
+
limit: readPageSize(options.get("--limit")),
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
export const readWebhooksDeliveries = (tokens) => {
|
|
92
|
+
const { flags, options, positionals } = parseOptionsWith(tokens, WEBHOOK_OPTIONS.deliveries);
|
|
93
|
+
requirePositionals(positionals, 0);
|
|
94
|
+
const afterCursor = options.get("--after");
|
|
95
|
+
const webhookId = options.get("--webhook");
|
|
96
|
+
return {
|
|
97
|
+
...(afterCursor === undefined ? {} : { afterCursor }),
|
|
98
|
+
...(flags.has("--failed") ? { failedOnly: true } : {}),
|
|
99
|
+
limit: readPageSize(options.get("--limit")),
|
|
100
|
+
...(webhookId === undefined ? {} : { webhookId }),
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
const withCommandId = (parsed, change) => Effect.map(commandIdentifier(parsed.options.get("--command-id")), (commandId) => ({ change, commandId }));
|
|
104
|
+
export const readAddChange = (parsed) => {
|
|
105
|
+
requirePositionals(parsed.positionals, 0);
|
|
106
|
+
return withCommandId(parsed, { kind: "add", spec: readSpec(parsed) });
|
|
107
|
+
};
|
|
108
|
+
const targetOf = (parsed, positionals) => {
|
|
109
|
+
requirePositionals(parsed.positionals, positionals);
|
|
110
|
+
return {
|
|
111
|
+
expectedRevision: readExpectedRevision(parsed.options.get("--expected-revision")),
|
|
112
|
+
webhookId: parsed.positionals[0] ?? "",
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
export const readRemoveChange = (parsed) => withCommandId(parsed, { ...targetOf(parsed, 1), kind: "remove" });
|
|
116
|
+
export const readTestChange = (parsed) => withCommandId(parsed, { ...targetOf(parsed, 1), kind: "test" });
|
|
117
|
+
export const readRedeliverChange = (parsed) => {
|
|
118
|
+
requirePositionals(parsed.positionals, 1);
|
|
119
|
+
return withCommandId(parsed, {
|
|
120
|
+
deliveryId: parsed.positionals[0] ?? "",
|
|
121
|
+
expectedRevision: readExpectedRevision(parsed.options.get("--expected-revision")),
|
|
122
|
+
kind: "redeliver",
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
//# sourceMappingURL=input.js.map
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { cell, formatRows, tab, withNextPage, } from "../../command-line/emit/index.js";
|
|
2
|
+
const hookLine = (hook) => tab([
|
|
3
|
+
hook.id,
|
|
4
|
+
hook.state,
|
|
5
|
+
hook.revision,
|
|
6
|
+
cell(hook.spec.url),
|
|
7
|
+
hook.spec.events.join(","),
|
|
8
|
+
]);
|
|
9
|
+
const deliveryLine = (delivery) => tab([
|
|
10
|
+
delivery.id,
|
|
11
|
+
delivery.webhookId,
|
|
12
|
+
delivery.state,
|
|
13
|
+
delivery.kind,
|
|
14
|
+
`attempts=${String(delivery.attempts)}`,
|
|
15
|
+
delivery.errorClass ?? "",
|
|
16
|
+
]);
|
|
17
|
+
const specOf = ({ change, current }) => change.kind === "add" ? change.spec : current?.spec;
|
|
18
|
+
const specLines = (spec) => [
|
|
19
|
+
spec.allowPrivate
|
|
20
|
+
? "allowPrivate=true (sends may reach private and loopback addresses)"
|
|
21
|
+
: "allowPrivate=false",
|
|
22
|
+
`url=${cell(spec.url)}`,
|
|
23
|
+
`events=${spec.events.join(",")}`,
|
|
24
|
+
`filters=${spec.filters.map(({ key, value }) => `${key}=${cell(value)}`).join(",") || "none"}`,
|
|
25
|
+
`secretEnv=${spec.secretEnv}`,
|
|
26
|
+
];
|
|
27
|
+
const targetLines = (result) => {
|
|
28
|
+
const { change, deletesDeliveries } = result;
|
|
29
|
+
return [
|
|
30
|
+
...(change.kind === "add" ? [] : [`revision=${change.expectedRevision}`]),
|
|
31
|
+
...(change.kind === "redeliver" ? [`delivery=${change.deliveryId}`] : []),
|
|
32
|
+
...(deletesDeliveries === undefined
|
|
33
|
+
? []
|
|
34
|
+
: [`deletes=${String(deletesDeliveries)} deliveries`]),
|
|
35
|
+
];
|
|
36
|
+
};
|
|
37
|
+
const previewLines = (result) => {
|
|
38
|
+
const { change, commandId, expiresAt, webhookId } = result;
|
|
39
|
+
const spec = specOf(result);
|
|
40
|
+
const header = tab([
|
|
41
|
+
change.kind,
|
|
42
|
+
webhookId,
|
|
43
|
+
`command=${commandId}`,
|
|
44
|
+
`expires=${expiresAt}`,
|
|
45
|
+
]);
|
|
46
|
+
return `${[header, ...(spec === undefined ? [] : specLines(spec)), ...targetLines(result)].join("\n")}\n`;
|
|
47
|
+
};
|
|
48
|
+
const confirmLine = ({ delivery, receipt, webhook, }) => `${tab([webhook.id, webhook.state, webhook.revision, receipt.receiptId, delivery])}\n`;
|
|
49
|
+
const DELIVERY_HEADERS = [
|
|
50
|
+
"DELIVERY",
|
|
51
|
+
"WEBHOOK",
|
|
52
|
+
"STATE",
|
|
53
|
+
"KIND",
|
|
54
|
+
"ATTEMPTS",
|
|
55
|
+
"ERROR",
|
|
56
|
+
];
|
|
57
|
+
export const formatWebhooksResult = ({ result }) => {
|
|
58
|
+
switch (result.method) {
|
|
59
|
+
case "webhooks.list":
|
|
60
|
+
return withNextPage(formatRows(result.items, hookLine, {
|
|
61
|
+
empty: "No webhooks.",
|
|
62
|
+
headers: ["WEBHOOK", "STATE", "REVISION", "URL", "EVENTS"],
|
|
63
|
+
}), result.nextCursor);
|
|
64
|
+
case "webhooks.deliveries":
|
|
65
|
+
return withNextPage(formatRows(result.items, deliveryLine, {
|
|
66
|
+
empty: "No deliveries.",
|
|
67
|
+
headers: DELIVERY_HEADERS,
|
|
68
|
+
}), result.nextCursor);
|
|
69
|
+
case "webhooks.change.preview":
|
|
70
|
+
return previewLines(result);
|
|
71
|
+
case "webhooks.change.confirm":
|
|
72
|
+
return confirmLine(result);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const webhooks = () => import("../index.js");
|
|
2
|
+
export const WEBHOOKS_TREE = {
|
|
3
|
+
groups: [["webhooks", "Signed outbound webhooks for Node events."]],
|
|
4
|
+
leaves: [
|
|
5
|
+
[
|
|
6
|
+
"webhooks list [--limit <1..100>] [--after <cursor>]",
|
|
7
|
+
1,
|
|
8
|
+
"webhooks.list",
|
|
9
|
+
"List webhooks.",
|
|
10
|
+
{ run: [webhooks, "runWebhooksList"] },
|
|
11
|
+
],
|
|
12
|
+
[
|
|
13
|
+
"webhooks deliveries [--webhook <webhook-id>] [--failed] [--limit <1..100>] [--after <cursor>]",
|
|
14
|
+
1,
|
|
15
|
+
"webhooks.deliveries",
|
|
16
|
+
"List webhook deliveries; --failed lists parked and denied ones.",
|
|
17
|
+
{ run: [webhooks, "runWebhooksDeliveries"] },
|
|
18
|
+
],
|
|
19
|
+
[
|
|
20
|
+
"webhooks add (--url <http-url> --secret-env <MAIA_WEBHOOK_SECRET_NAME> --event <kind>... [--label <key=value>...] [--project <project-id>] [--node-id <node-id>] [--allow-private] [--command-id <id>] [--dry-run | --yes] | --confirm-stdin)",
|
|
21
|
+
1,
|
|
22
|
+
["webhooks.change.preview", "webhooks.change.confirm"],
|
|
23
|
+
"Add a webhook after a preview.",
|
|
24
|
+
{ kind: "two-phase", run: [webhooks, "runWebhooksAdd"] },
|
|
25
|
+
],
|
|
26
|
+
[
|
|
27
|
+
"webhooks test (<webhook-id> --expected-revision <revision> [--command-id <id>] [--dry-run | --yes] | --confirm-stdin)",
|
|
28
|
+
1,
|
|
29
|
+
["webhooks.change.preview", "webhooks.change.confirm"],
|
|
30
|
+
"Send a test event to a webhook after a preview.",
|
|
31
|
+
{ kind: "two-phase", run: [webhooks, "runWebhooksTest"] },
|
|
32
|
+
],
|
|
33
|
+
[
|
|
34
|
+
"webhooks remove (<webhook-id> --expected-revision <revision> [--command-id <id>] [--dry-run | --yes] | --confirm-stdin)",
|
|
35
|
+
1,
|
|
36
|
+
["webhooks.change.preview", "webhooks.change.confirm"],
|
|
37
|
+
"Remove a webhook and its deliveries after a preview.",
|
|
38
|
+
{ kind: "two-phase", run: [webhooks, "runWebhooksRemove"] },
|
|
39
|
+
],
|
|
40
|
+
[
|
|
41
|
+
"webhooks redeliver (<delivery-id> --expected-revision <revision> [--command-id <id>] [--dry-run | --yes] | --confirm-stdin)",
|
|
42
|
+
1,
|
|
43
|
+
["webhooks.change.preview", "webhooks.change.confirm"],
|
|
44
|
+
"Send a delivery again after a preview.",
|
|
45
|
+
{ kind: "two-phase", run: [webhooks, "runWebhooksRedeliver"] },
|
|
46
|
+
],
|
|
47
|
+
],
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=tree.js.map
|
|
@@ -11,7 +11,7 @@ description: >
|
|
|
11
11
|
## Goal
|
|
12
12
|
|
|
13
13
|
Use the installed `maia` binary as the public client. Treat `maia help --json`
|
|
14
|
-
and `maia help
|
|
14
|
+
and `maia help session --json` (or any other family) as the command allowlist.
|
|
15
15
|
|
|
16
16
|
## Main rules
|
|
17
17
|
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: maia-node
|
|
3
|
+
description: >
|
|
4
|
+
Check a Maia Node's health and reach local or remote Nodes with --node and
|
|
5
|
+
--profile through the public CLI. Use when an agent must find which Node a
|
|
6
|
+
command ran on, see whether a Node is ready, or register another Node.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Maia Node
|
|
10
|
+
|
|
11
|
+
A Node is the one place Maia keeps state and runs work. The CLI is a client of
|
|
12
|
+
it. Confirm each command on `maia help node --json` before use.
|
|
13
|
+
|
|
14
|
+
## Rules
|
|
15
|
+
|
|
16
|
+
1. Pass `--json` and read results from stdout and errors from stderr.
|
|
17
|
+
2. `--node <name>` sends a Node-backed command to a registered remote Node.
|
|
18
|
+
`--node local` names this machine. `--profile <name>` picks a local profile.
|
|
19
|
+
A flag beats `MAIA_NODE` and `MAIA_PROFILE`, which beat the default.
|
|
20
|
+
3. A command that manages this machine's Nodes, such as `maia node list`,
|
|
21
|
+
refuses `--node`.
|
|
22
|
+
4. An id belongs to one Node. A missing id (`resource_not_found`, exit 66) on
|
|
23
|
+
the selected Node does not prove it is absent everywhere; check the Node
|
|
24
|
+
selection and retry with the `--node` that holds it.
|
|
25
|
+
5. Exit code 69 means the Node is unavailable. Report it; do not start a Node
|
|
26
|
+
unless the caller asked for it.
|
|
27
|
+
|
|
28
|
+
## Implemented
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
maia --json status
|
|
32
|
+
maia --json node status
|
|
33
|
+
maia --json --node local node status
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
`node monitor` prints a one-time loopback URL for the admin monitor.
|
|
37
|
+
|
|
38
|
+
## Source candidates (release-disabled)
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
maia --json node list
|
|
42
|
+
maia --json node register <host> --name <name> --dry-run
|
|
43
|
+
maia --json node remove <node> --dry-run
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
`node register`, `node install` and `node remove` preview with `--dry-run`.
|
|
47
|
+
Confirm the preview only on the caller's request, from stdin with
|
|
48
|
+
`--confirm-stdin`.
|
|
49
|
+
|
|
50
|
+
## Do not
|
|
51
|
+
|
|
52
|
+
- Do not copy a Node's credentials or tokens into a prompt, a file or a log.
|
|
53
|
+
- Do not expose a Node beyond loopback or its tailnet.
|
|
54
|
+
- Do not remove a Node with `--purge` unless the caller named that.
|
|
@@ -5,7 +5,7 @@ description: >
|
|
|
5
5
|
public CLI: create, list, show, task list and show, inbox check and ack,
|
|
6
6
|
questions, and dispatch show or settle-terminal. Use when an external agent
|
|
7
7
|
is the explicit Run coordinator. Do not treat these commands as
|
|
8
|
-
release-enabled
|
|
8
|
+
release-enabled or worker assignment.
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
# Maia orchestration
|
|
@@ -51,4 +51,3 @@ caller-selected outcome. `settle-terminal` only records the Terminal's exact
|
|
|
51
51
|
unavailable failure. Do not teach Skill install/sync or extra runtime probes.
|
|
52
52
|
|
|
53
53
|
A compact CLI projection is not a protocol change. The SDK remains lossless.
|
|
54
|
-
No Orca command is equivalent.
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: maia-sessions
|
|
3
|
+
description: >
|
|
4
|
+
Create, list, inspect and follow Maia Sessions through the public CLI, on
|
|
5
|
+
this machine or on a named Node with --node. Use when an agent needs to start
|
|
6
|
+
or watch coding work, read a Session's state, or recover after a retry.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Maia Sessions
|
|
10
|
+
|
|
11
|
+
A Session is one unit of coding work on a Maia Node. Maia Node owns its state;
|
|
12
|
+
the CLI only reads and requests changes. Confirm each command on
|
|
13
|
+
`maia help session --json` before use.
|
|
14
|
+
|
|
15
|
+
## Rules
|
|
16
|
+
|
|
17
|
+
1. Pass `--json`. A result, or a merged list with `ok: false`, is on stdout:
|
|
18
|
+
check `ok`, `error` and each `result.result.nodes[].error` before calling a
|
|
19
|
+
list complete. A plain refusal is JSON on stderr with empty stdout.
|
|
20
|
+
2. Use exact ids. Never infer a Project, Workspace or Session from the working
|
|
21
|
+
folder or a previous answer.
|
|
22
|
+
3. Add `--node <name>` to reach a remote Node. `--node local` names this
|
|
23
|
+
machine. See the maia-node Skill.
|
|
24
|
+
4. A mutation names itself with `--command-id <id>`. After exit code 76
|
|
25
|
+
(outcome unknown), run `maia receipt show <command-id>` before any retry,
|
|
26
|
+
and retry with the same id.
|
|
27
|
+
5. A change to an existing Session carries its current
|
|
28
|
+
`--expected-revision <revision>`; `session start` and `session turn send`
|
|
29
|
+
read it when none is named. Exit code 75 also covers a full or held Node
|
|
30
|
+
and guard limits, so read `error.code` first. For `revision_conflict`
|
|
31
|
+
or `storage_conflict`, read the Session again and retry at its current
|
|
32
|
+
revision only if it is idle and the change still applies; else observe or
|
|
33
|
+
report. For `saturated`, `held` or `guard_*`, wait or report; never raise a
|
|
34
|
+
guard.
|
|
35
|
+
|
|
36
|
+
## Implemented
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
maia --json session list --project <project-id>
|
|
40
|
+
maia --json session show <session-id>
|
|
41
|
+
maia --json session create --workspace <workspace-id>
|
|
42
|
+
maia --json session events list --session <session-id>
|
|
43
|
+
maia --json session observe <session-id>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
`session list --all` lists Sessions of every Project. Without `--node` it also
|
|
47
|
+
merges the registered remote Nodes, and each row names its Node. A page cursor
|
|
48
|
+
(`--after`) pages one Node, so pass `--node <name>` with it. `--attention`
|
|
49
|
+
filters to Sessions that need attention.
|
|
50
|
+
|
|
51
|
+
## Source candidates (release-disabled)
|
|
52
|
+
|
|
53
|
+
These work from a source build only. Use them when the caller accepts that.
|
|
54
|
+
|
|
55
|
+
```sh
|
|
56
|
+
maia --json session placement show --harness <executor-id>
|
|
57
|
+
maia --json session defaults show --project <project-id>
|
|
58
|
+
maia --json session spawn <session-id> --harness <executor-id> --workspace <workspace-id> --to-node <name> --yes
|
|
59
|
+
maia --json session stop <session-id> --expected-revision <revision> --children
|
|
60
|
+
maia --json session reconcile <session-id>
|
|
61
|
+
maia --json session start <session-id> --wait
|
|
62
|
+
maia --json session wait <session-id> --until running --timeout 5m
|
|
63
|
+
maia --json session turn queue <session-id>
|
|
64
|
+
maia --json session approval list --session <session-id>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Send prompt text on stdin with `--prompt-stdin`, never on the command line.
|
|
68
|
+
Exit code 74 means a wait reached its deadline.
|
|
69
|
+
|
|
70
|
+
A create with a first message that names no harness, account or agent takes
|
|
71
|
+
your last Session's harness, account, model and effort in the Project;
|
|
72
|
+
`session defaults show` prints them. A named option wins. `error.code`
|
|
73
|
+
`session_default_stale` means that account no longer takes Sessions: name
|
|
74
|
+
`--harness` or `--connection`.
|
|
75
|
+
|
|
76
|
+
`session placement show` asks every Node (or the one `--node` names) whether it
|
|
77
|
+
can take a Session of an executor: `ready`, `login`, `reason` and capacity. A
|
|
78
|
+
Node that is not ready also sends `refusal`, the limit as fields: `code`, and
|
|
79
|
+
where they apply `saturation`, `resource`, `measured` and `required`. Match on
|
|
80
|
+
those, never on `reason`. A
|
|
81
|
+
Node that did not answer is `unknown`, never ready. Maia never places a Session
|
|
82
|
+
for you: read the answers, pick one Node, and pass `--node <name>` to
|
|
83
|
+
`session create`. A create on a Node without the executor signed in is refused
|
|
84
|
+
with the reason, and no other Node takes it instead.
|
|
85
|
+
|
|
86
|
+
`session spawn` starts a child of one of your Sessions on any executor and any
|
|
87
|
+
Node, after a preview (`--dry-run` shows it, `--yes` confirms). The child never
|
|
88
|
+
holds more host authority or a wider permission mode than its parent; a wider
|
|
89
|
+
request is refused with `session_spawn_wider` (exit 77), and nothing is
|
|
90
|
+
created. `session stop --children` stops the parent, then its running children
|
|
91
|
+
on every Node; a child on a Node that did not answer is named with its error,
|
|
92
|
+
never counted as stopped. A child on another Node that stays silent past the
|
|
93
|
+
12 s deadline is marked orphaned on the parent's Node (`session show` lists
|
|
94
|
+
it); `session resume` refuses it with `session_child_orphaned` until
|
|
95
|
+
`session reconcile <parent-session-id>` reaches its Node and stops it.
|
|
96
|
+
|
|
97
|
+
Each Node caps spawned children: depth 3, fan-out 8 and 4 live children per
|
|
98
|
+
parent by default, counted across every Node. The next child past a cap is
|
|
99
|
+
refused with `spawn_depth_exceeded`, `spawn_fan_out_exceeded` (exit 70) or
|
|
100
|
+
`spawn_concurrency_exceeded` (exit 75, retry once a child ends).
|
|
101
|
+
`session spawn-caps show` prints the caps; only a person raises them, with
|
|
102
|
+
`session spawn-caps set` and its confirmation. Never ask to raise a cap to fit
|
|
103
|
+
your plan: split the work or wait for a child to end.
|
|
104
|
+
|
|
105
|
+
## Do not
|
|
106
|
+
|
|
107
|
+
- `session observe` is one snapshot and exits 0. To watch a Session, re-run it
|
|
108
|
+
at a sensible pace; `session wait` is release-disabled.
|
|
109
|
+
- Do not read a worker's files or terminal to learn its state; read the Session.
|
|
110
|
+
- Do not delete or retire a Session unless the caller asked for it.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maiaos/cli",
|
|
3
|
-
"version": "0.1.0-canary.
|
|
3
|
+
"version": "0.1.0-canary.81",
|
|
4
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
5
|
"keywords": [
|
|
6
6
|
"maia",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"url": "git+https://github.com/vllnt/maia.git",
|
|
25
25
|
"directory": "apps/cli"
|
|
26
26
|
},
|
|
27
|
+
"license": "MIT",
|
|
27
28
|
"type": "module",
|
|
28
29
|
"sideEffects": false,
|
|
29
30
|
"types": "./dist/index.d.ts",
|
|
@@ -57,20 +58,20 @@
|
|
|
57
58
|
"devDependencies": {
|
|
58
59
|
"@types/node": "24.13.3",
|
|
59
60
|
"@typescript/native": "npm:typescript@7.0.2",
|
|
60
|
-
"@vllnt/typescript": "
|
|
61
|
+
"@vllnt/typescript": "3.0.1",
|
|
61
62
|
"eslint": "9.39.5",
|
|
62
63
|
"typescript": "npm:@typescript/typescript6@6.0.2"
|
|
63
64
|
},
|
|
64
65
|
"dependencies": {
|
|
65
66
|
"@earendil-works/pi-tui": "1.0.0",
|
|
66
67
|
"@effect/platform-node-shared": "4.0.0",
|
|
67
|
-
"@maiaos/agent": "0.1.0-canary.
|
|
68
|
-
"@maiaos/client-core": "0.1.0-canary.
|
|
69
|
-
"@maiaos/sdk": "0.1.0-canary.
|
|
68
|
+
"@maiaos/agent": "0.1.0-canary.81",
|
|
69
|
+
"@maiaos/client-core": "0.1.0-canary.81",
|
|
70
|
+
"@maiaos/sdk": "0.1.0-canary.81",
|
|
70
71
|
"effect": "4.0.0"
|
|
71
72
|
},
|
|
72
73
|
"scripts": {
|
|
73
|
-
"build": "node -e \"require('node:fs').rmSync('dist',{force:true,recursive:true})\" && tsc --project tsconfig.build.json && node scripts/build-executable.mjs",
|
|
74
|
+
"build": "node -e \"require('node:fs').rmSync('dist',{force:true,recursive:true})\" && tsc --project tsconfig.build.json && node scripts/build-executable.mjs && node scripts/prune-library.mjs",
|
|
74
75
|
"lint": "eslint src scripts --max-warnings 0 --cache --cache-location node_modules/.cache/eslint/ --cache-strategy content",
|
|
75
76
|
"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\"",
|
|
76
77
|
"typecheck": "tsc --project tsconfig.json --noEmit --incremental --tsBuildInfoFile node_modules/.cache/tsc/typecheck.tsbuildinfo && tsc --project scripts/tsconfig.json --noEmit --incremental --tsBuildInfoFile node_modules/.cache/tsc/scripts.tsbuildinfo"
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { RouteKind } from "@maiaos/client-core/cockpit";
|
|
2
|
-
import { type CliCommandOutput, type CliDependencies, type CliTable, type CommandContext, type CommandEffect } from "../command-line/index.js";
|
|
3
|
-
import { type LeafRoute } from "../command-tree/index.js";
|
|
4
|
-
import { type HeldId, type ListedNode, type NodeAnswer } from "../fleet/index.js";
|
|
5
|
-
import type { CliNodeEffect, CliNodeResult } from "../local-node/index.js";
|
|
6
|
-
export declare const onHolder: (context: CommandContext, held: HeldId, run: (bound: CommandContext) => CommandEffect) => CommandEffect;
|
|
7
|
-
type InputRoute = {
|
|
8
|
-
readonly idOf: (input: object) => unknown;
|
|
9
|
-
readonly kind: RouteKind;
|
|
10
|
-
};
|
|
11
|
-
export declare const onInputHolder: (context: CommandContext, { idOf, kind }: InputRoute, run: (bound: CommandContext) => CommandEffect) => CommandEffect;
|
|
12
|
-
export type RoutedLeaf = {
|
|
13
|
-
readonly argument: LeafRoute;
|
|
14
|
-
readonly tokens: readonly string[];
|
|
15
|
-
readonly usage: string;
|
|
16
|
-
};
|
|
17
|
-
export declare const routeLeaf: (context: CommandContext, { argument, tokens, usage }: RoutedLeaf, run: (bound: CommandContext) => CommandEffect) => CommandEffect;
|
|
18
|
-
export declare const nodeLines: (nodes: readonly ListedNode[]) => string;
|
|
19
|
-
export declare const formatMerged: <TItem extends {
|
|
20
|
-
readonly node: string;
|
|
21
|
-
}>({ items, nodes, }: {
|
|
22
|
-
readonly items: readonly TItem[];
|
|
23
|
-
readonly nodes: readonly ListedNode[];
|
|
24
|
-
}, row: (item: TItem) => string, { empty, headers }: CliTable) => string;
|
|
25
|
-
export declare const writeMerged: <TResult extends CliCommandOutput & {
|
|
26
|
-
readonly result: {
|
|
27
|
-
readonly nodes: readonly ListedNode[];
|
|
28
|
-
};
|
|
29
|
-
}>(context: CommandContext, output: TResult, text: (output: TResult) => string) => number;
|
|
30
|
-
type ListSpec<TList> = {
|
|
31
|
-
readonly merged: (answers: readonly NodeAnswer<TList>[]) => number;
|
|
32
|
-
readonly paged: boolean;
|
|
33
|
-
readonly read: (dependencies: CliDependencies) => CliNodeEffect<TList>;
|
|
34
|
-
readonly sole: (result: CliNodeResult<TList>) => number;
|
|
35
|
-
};
|
|
36
|
-
export declare const listEach: <TList>(context: CommandContext, { merged, paged, read, sole }: ListSpec<TList>) => CommandEffect;
|
|
37
|
-
export {};
|
|
38
|
-
//# sourceMappingURL=address-space.d.ts.map
|
package/dist/agents/input.d.ts
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { type AgentsListParameters, type AgentsShowParameters } from "@maiaos/sdk";
|
|
2
|
-
import * as Effect from "effect/Effect";
|
|
3
|
-
import { type ParsedOptions } from "../command-line/index.js";
|
|
4
|
-
export declare const AGENT_OPTIONS: {
|
|
5
|
-
readonly create: Set<string>;
|
|
6
|
-
readonly disable: Set<string>;
|
|
7
|
-
readonly list: Set<string>;
|
|
8
|
-
readonly revise: Set<string>;
|
|
9
|
-
readonly show: Set<string>;
|
|
10
|
-
};
|
|
11
|
-
export declare const readAgentsList: (tokens: readonly string[]) => AgentsListParameters;
|
|
12
|
-
export declare const readAgentsShow: (tokens: readonly string[]) => AgentsShowParameters;
|
|
13
|
-
export declare const readCreateChange: (parsed: ParsedOptions) => Effect.Effect<{
|
|
14
|
-
change: {
|
|
15
|
-
readonly kind: "create";
|
|
16
|
-
readonly projectId: string;
|
|
17
|
-
readonly spec: {
|
|
18
|
-
readonly accountableActorId: string;
|
|
19
|
-
readonly connectionId?: string | undefined;
|
|
20
|
-
readonly effort?: "high" | "low" | "max" | "medium" | "ultra" | "xhigh" | undefined;
|
|
21
|
-
readonly harness: "claude-code" | "codex-cli" | "maia-agent" | "pi";
|
|
22
|
-
readonly homeSessionId?: string | undefined;
|
|
23
|
-
readonly instruction: string;
|
|
24
|
-
readonly managerAgentId?: string | undefined;
|
|
25
|
-
readonly model?: string | undefined;
|
|
26
|
-
readonly name: string;
|
|
27
|
-
readonly placement: "local";
|
|
28
|
-
};
|
|
29
|
-
} | {
|
|
30
|
-
readonly agentId: string;
|
|
31
|
-
readonly expectedRevision: string;
|
|
32
|
-
readonly kind: "revise";
|
|
33
|
-
readonly spec: {
|
|
34
|
-
readonly accountableActorId: string;
|
|
35
|
-
readonly connectionId?: string | undefined;
|
|
36
|
-
readonly effort?: "high" | "low" | "max" | "medium" | "ultra" | "xhigh" | undefined;
|
|
37
|
-
readonly harness: "claude-code" | "codex-cli" | "maia-agent" | "pi";
|
|
38
|
-
readonly homeSessionId?: string | undefined;
|
|
39
|
-
readonly instruction: string;
|
|
40
|
-
readonly managerAgentId?: string | undefined;
|
|
41
|
-
readonly model?: string | undefined;
|
|
42
|
-
readonly name: string;
|
|
43
|
-
readonly placement: "local";
|
|
44
|
-
};
|
|
45
|
-
} | {
|
|
46
|
-
readonly agentId: string;
|
|
47
|
-
readonly expectedRevision: string;
|
|
48
|
-
readonly kind: "disable";
|
|
49
|
-
};
|
|
50
|
-
commandId: string;
|
|
51
|
-
}, never, import("effect/Crypto").Crypto>;
|
|
52
|
-
export declare const readReviseChange: (parsed: ParsedOptions) => Effect.Effect<{
|
|
53
|
-
change: {
|
|
54
|
-
readonly kind: "create";
|
|
55
|
-
readonly projectId: string;
|
|
56
|
-
readonly spec: {
|
|
57
|
-
readonly accountableActorId: string;
|
|
58
|
-
readonly connectionId?: string | undefined;
|
|
59
|
-
readonly effort?: "high" | "low" | "max" | "medium" | "ultra" | "xhigh" | undefined;
|
|
60
|
-
readonly harness: "claude-code" | "codex-cli" | "maia-agent" | "pi";
|
|
61
|
-
readonly homeSessionId?: string | undefined;
|
|
62
|
-
readonly instruction: string;
|
|
63
|
-
readonly managerAgentId?: string | undefined;
|
|
64
|
-
readonly model?: string | undefined;
|
|
65
|
-
readonly name: string;
|
|
66
|
-
readonly placement: "local";
|
|
67
|
-
};
|
|
68
|
-
} | {
|
|
69
|
-
readonly agentId: string;
|
|
70
|
-
readonly expectedRevision: string;
|
|
71
|
-
readonly kind: "revise";
|
|
72
|
-
readonly spec: {
|
|
73
|
-
readonly accountableActorId: string;
|
|
74
|
-
readonly connectionId?: string | undefined;
|
|
75
|
-
readonly effort?: "high" | "low" | "max" | "medium" | "ultra" | "xhigh" | undefined;
|
|
76
|
-
readonly harness: "claude-code" | "codex-cli" | "maia-agent" | "pi";
|
|
77
|
-
readonly homeSessionId?: string | undefined;
|
|
78
|
-
readonly instruction: string;
|
|
79
|
-
readonly managerAgentId?: string | undefined;
|
|
80
|
-
readonly model?: string | undefined;
|
|
81
|
-
readonly name: string;
|
|
82
|
-
readonly placement: "local";
|
|
83
|
-
};
|
|
84
|
-
} | {
|
|
85
|
-
readonly agentId: string;
|
|
86
|
-
readonly expectedRevision: string;
|
|
87
|
-
readonly kind: "disable";
|
|
88
|
-
};
|
|
89
|
-
commandId: string;
|
|
90
|
-
}, never, import("effect/Crypto").Crypto>;
|
|
91
|
-
export declare const readDisableChange: (parsed: ParsedOptions) => Effect.Effect<{
|
|
92
|
-
change: {
|
|
93
|
-
readonly kind: "create";
|
|
94
|
-
readonly projectId: string;
|
|
95
|
-
readonly spec: {
|
|
96
|
-
readonly accountableActorId: string;
|
|
97
|
-
readonly connectionId?: string | undefined;
|
|
98
|
-
readonly effort?: "high" | "low" | "max" | "medium" | "ultra" | "xhigh" | undefined;
|
|
99
|
-
readonly harness: "claude-code" | "codex-cli" | "maia-agent" | "pi";
|
|
100
|
-
readonly homeSessionId?: string | undefined;
|
|
101
|
-
readonly instruction: string;
|
|
102
|
-
readonly managerAgentId?: string | undefined;
|
|
103
|
-
readonly model?: string | undefined;
|
|
104
|
-
readonly name: string;
|
|
105
|
-
readonly placement: "local";
|
|
106
|
-
};
|
|
107
|
-
} | {
|
|
108
|
-
readonly agentId: string;
|
|
109
|
-
readonly expectedRevision: string;
|
|
110
|
-
readonly kind: "revise";
|
|
111
|
-
readonly spec: {
|
|
112
|
-
readonly accountableActorId: string;
|
|
113
|
-
readonly connectionId?: string | undefined;
|
|
114
|
-
readonly effort?: "high" | "low" | "max" | "medium" | "ultra" | "xhigh" | undefined;
|
|
115
|
-
readonly harness: "claude-code" | "codex-cli" | "maia-agent" | "pi";
|
|
116
|
-
readonly homeSessionId?: string | undefined;
|
|
117
|
-
readonly instruction: string;
|
|
118
|
-
readonly managerAgentId?: string | undefined;
|
|
119
|
-
readonly model?: string | undefined;
|
|
120
|
-
readonly name: string;
|
|
121
|
-
readonly placement: "local";
|
|
122
|
-
};
|
|
123
|
-
} | {
|
|
124
|
-
readonly agentId: string;
|
|
125
|
-
readonly expectedRevision: string;
|
|
126
|
-
readonly kind: "disable";
|
|
127
|
-
};
|
|
128
|
-
commandId: string;
|
|
129
|
-
}, never, import("effect/Crypto").Crypto>;
|
|
130
|
-
//# sourceMappingURL=input.d.ts.map
|