@maiaos/cli 0.1.0-canary.7 → 0.1.0-canary.70
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 +22 -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 +204 -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 +21 -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 +13 -0
- package/dist/command-line/input/arguments.js +42 -10
- 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 +36 -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 +2 -2
- package/dist/connection/output/index.d.ts +1 -1
- package/dist/connection/output/index.js +1 -1
- package/dist/connection/resolve.d.ts +1 -0
- package/dist/connection/setup-file.js +161 -0
- package/dist/connection/system.js +93 -47
- package/dist/connection/tree/tree.js +122 -9
- 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 +307 -1
- package/dist/integration/client.js +21 -1
- package/dist/integration/commands.d.ts +8 -0
- package/dist/integration/commands.js +53 -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 +2 -1
- package/dist/local-node/index.js +2 -1
- package/dist/local-node/wait.d.ts +10 -0
- package/dist/local-node/wait.js +17 -0
- 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 +9 -2
- 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 +23 -12
- package/dist/session/client.js +50 -18
- 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 +391 -62
- package/dist/session/create-tasks.js +10 -47
- 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/index.js +1 -1
- 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 +324 -29
- package/dist/session/turn/attachments.js +54 -0
- package/dist/session/turn/client.d.ts +3 -1
- package/dist/session/turn/client.js +13 -10
- package/dist/session/turn/commands.d.ts +5 -1
- package/dist/session/turn/commands.js +204 -36
- 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 +103 -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 -112
- 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
package/dist/cli/cli.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as Cause from "effect/Cause";
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as References from "effect/References";
|
|
3
4
|
import { argumentsAreBounded, CliArgumentError, LOCAL_NODE, parseArguments, readGlobalValue, reportError, writeSuccess, } from "../command-line/index.js";
|
|
4
|
-
import { createHelpTree, createNodeHelp, findNode, formatNodeHelp, formatRootHelp, isNodeBacked, REFERENCE_USAGE, unknownPathMessage, usageHint, } from "../command-tree/index.js";
|
|
5
|
+
import { createHelpTree, createNodeHelp, currentOptionSpellings, findNode, formatNodeHelp, formatRootHelp, isNodeBacked, REFERENCE_USAGE, unknownPathMessage, usageHint, } from "../command-tree/index.js";
|
|
5
6
|
const createArgumentError = (message) => ({
|
|
6
7
|
code: "invalid_argument",
|
|
7
8
|
message,
|
|
@@ -34,6 +35,15 @@ const NO_ENVIRONMENT = {};
|
|
|
34
35
|
const readEnvironment = (leaf) => isNodeBacked(leaf)
|
|
35
36
|
? Effect.flatMap(Effect.promise(() => import("./environment.js")), (module) => module.environmentOptions)
|
|
36
37
|
: Effect.succeed(NO_ENVIRONMENT);
|
|
38
|
+
const atConfiguredLogLevel = (source, context, program) => source === undefined
|
|
39
|
+
? program
|
|
40
|
+
: source.pipe(Effect.flatMap((configured) => configured.ok
|
|
41
|
+
? Effect.provideService(program, References.MinimumLogLevel, configured.level)
|
|
42
|
+
: Effect.sync(() => reportError({
|
|
43
|
+
code: "configuration_invalid",
|
|
44
|
+
message: configured.message,
|
|
45
|
+
retryable: false,
|
|
46
|
+
}, context))));
|
|
37
47
|
const fromEnvironment = (option, value) => value === undefined || value === ""
|
|
38
48
|
? undefined
|
|
39
49
|
: readGlobalValue(option, value);
|
|
@@ -44,12 +54,15 @@ const checkGlobalOptions = (parsed, leaf, remote) => {
|
|
|
44
54
|
: "Option '--node' is supported only by Node-backed commands.");
|
|
45
55
|
if (parsed.profile !== undefined && !isNodeBacked(leaf))
|
|
46
56
|
throw new CliArgumentError("Option '--profile' is supported only by Node-backed commands.");
|
|
57
|
+
if (parsed.json && leaf.json === false)
|
|
58
|
+
throw new CliArgumentError(`'maia ${leaf.path.join(" ")}' does not take the global '--json'; ${leaf.forms.some((form) => form.usage.includes("--json-events"))
|
|
59
|
+
? "use '--json-events' with print mode"
|
|
60
|
+
: "omit it"}.`);
|
|
47
61
|
};
|
|
48
62
|
const noInputFrom = (value) => value !== undefined && value !== "" && value !== "0";
|
|
49
63
|
const resolveOptions = (parsed, leaf, environment) => {
|
|
50
64
|
const nodeBacked = isNodeBacked(leaf);
|
|
51
65
|
const remote = nodeBacked && leaf.remote !== false;
|
|
52
|
-
checkGlobalOptions(parsed, leaf, remote);
|
|
53
66
|
const node = parsed.node ??
|
|
54
67
|
(remote ? fromEnvironment("--node", environment.node) : undefined);
|
|
55
68
|
const profile = parsed.profile ??
|
|
@@ -77,7 +90,11 @@ const resolveInvocationDependencies = (source, parsed, scope) => {
|
|
|
77
90
|
: source(parsed.profile, { name, scope });
|
|
78
91
|
};
|
|
79
92
|
const nodeBinder = (source, profile, scope) => typeof source === "function" && scope !== undefined
|
|
80
|
-
? {
|
|
93
|
+
? {
|
|
94
|
+
bindNode: (name) => name === LOCAL_NODE
|
|
95
|
+
? source(profile)
|
|
96
|
+
: source(profile, { name, scope }),
|
|
97
|
+
}
|
|
81
98
|
: {};
|
|
82
99
|
const commandContext = (input, parsed, scope) => ({
|
|
83
100
|
...nodeBinder(input.dependencies, parsed.profile, scope),
|
|
@@ -104,7 +121,7 @@ const reportFailures = (effect, context, tokens) => effect.pipe(Effect.catchDefe
|
|
|
104
121
|
? Effect.interrupt
|
|
105
122
|
: Effect.sync(() => reportFailure(Cause.squash(cause), context, tokens))));
|
|
106
123
|
const isHelpInvocation = (parsed) => parsed.help || parsed.tokens[0] === undefined || parsed.tokens[0] === "help";
|
|
107
|
-
const
|
|
124
|
+
const helpNode = (parsed) => {
|
|
108
125
|
const strict = parsed.tokens[0] === "help";
|
|
109
126
|
const end = parsed.tokens.indexOf("--");
|
|
110
127
|
const tokens = end === -1 ? parsed.tokens : parsed.tokens.slice(0, end);
|
|
@@ -112,6 +129,10 @@ const runHelp = (input, parsed) => Effect.sync(() => {
|
|
|
112
129
|
const { consumed, node } = findNode(path);
|
|
113
130
|
if (consumed < path.length && (strict || node.forms.length === 0))
|
|
114
131
|
throw new CliArgumentError(unknownPathMessage(path));
|
|
132
|
+
return node;
|
|
133
|
+
};
|
|
134
|
+
const runHelp = (input, parsed) => Effect.sync(() => {
|
|
135
|
+
const node = helpNode(parsed);
|
|
115
136
|
const root = node.path.length === 0;
|
|
116
137
|
writeSuccess(root
|
|
117
138
|
? createHelpTree(input.version)
|
|
@@ -123,7 +144,17 @@ const findLeaf = (typed) => {
|
|
|
123
144
|
const { consumed, node } = findNode(tokens);
|
|
124
145
|
if (node.forms.length === 0)
|
|
125
146
|
throw new CliArgumentError(unknownPathMessage(tokens));
|
|
126
|
-
return {
|
|
147
|
+
return {
|
|
148
|
+
leaf: node,
|
|
149
|
+
rest: currentOptionSpellings(node.path, tokens.slice(consumed)),
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
export const resolveCommand = (parsed) => {
|
|
153
|
+
if (isHelpInvocation(parsed))
|
|
154
|
+
return { node: helpNode(parsed), rest: [] };
|
|
155
|
+
const { leaf, rest } = findLeaf(parsed.tokens);
|
|
156
|
+
checkGlobalOptions(parsed, leaf, isNodeBacked(leaf) && leaf.remote !== false);
|
|
157
|
+
return { node: leaf, rest };
|
|
127
158
|
};
|
|
128
159
|
const leafProgram = (leaf, rest, context) => {
|
|
129
160
|
const reference = leaf.run;
|
|
@@ -167,14 +198,14 @@ const runParsed = (input, parsed) => {
|
|
|
167
198
|
if (isHelpInvocation(parsed))
|
|
168
199
|
return runHelp(input, parsed);
|
|
169
200
|
return Effect.gen(function* () {
|
|
170
|
-
const { leaf, rest } =
|
|
201
|
+
const { node: leaf, rest } = resolveCommand(parsed);
|
|
171
202
|
const resolved = resolveOptions(parsed, leaf, yield* readEnvironment(leaf));
|
|
172
203
|
if (parsed.node === undefined &&
|
|
173
204
|
resolved.node !== undefined &&
|
|
174
205
|
!parsed.json)
|
|
175
206
|
input.io.stderr(`node: ${resolved.node} (MAIA_NODE)\n`);
|
|
176
207
|
const run = (scope) => Effect.suspend(() => runResolved(leaf, rest, commandContext(input, resolved, scope)));
|
|
177
|
-
return yield* Effect.scoped(Effect.flatMap(Effect.scope, run));
|
|
208
|
+
return yield* atConfiguredLogLevel(isNodeBacked(leaf) ? input.logLevel : undefined, { io: input.io, json: parsed.json }, Effect.scoped(Effect.flatMap(Effect.scope, run)));
|
|
178
209
|
});
|
|
179
210
|
};
|
|
180
211
|
const executeCli = (input) => Effect.suspend(() => {
|
|
@@ -184,10 +215,11 @@ const executeCli = (input) => Effect.suspend(() => {
|
|
|
184
215
|
const { parsed } = invocation;
|
|
185
216
|
return reportFailures(runParsed(input, parsed), { io: input.io, json: parsed.json }, parsed.tokens);
|
|
186
217
|
});
|
|
187
|
-
export const makeCli = (dependencies) => (arguments_, version, io) => executeCli({
|
|
218
|
+
export const makeCli = (dependencies, logLevel) => (arguments_, version, io) => executeCli({
|
|
188
219
|
arguments_,
|
|
189
220
|
dependencies,
|
|
190
221
|
io,
|
|
222
|
+
logLevel,
|
|
191
223
|
version,
|
|
192
224
|
});
|
|
193
225
|
const loadProjectWorkspace = () => import("../project-workspace/index.js");
|
|
@@ -209,10 +241,24 @@ const loadPresentation = () => import("../presentation/index.js");
|
|
|
209
241
|
const loadMcp = () => import("../mcp/index.js");
|
|
210
242
|
const loadPortLease = () => import("../port-lease/index.js");
|
|
211
243
|
const loadApproval = () => import("../session/approval/index.js");
|
|
244
|
+
const loadInbox = () => import("../inbox/index.js");
|
|
212
245
|
const loadRemoteNode = () => import("../remote-node/index.js");
|
|
213
246
|
const loadRunLedger = () => import("../run-ledger/index.js");
|
|
247
|
+
const loadBoard = () => import("../board/index.js");
|
|
214
248
|
const loadProjectGuard = () => import("../project-guard/index.js");
|
|
249
|
+
const loadProjectInstructions = () => import("../project-instructions/index.js");
|
|
250
|
+
const loadSecret = () => import("../secret/index.js");
|
|
251
|
+
const loadProjectKnowledge = () => import("../project-knowledge/index.js");
|
|
215
252
|
const loadAgents = () => import("../agents/index.js");
|
|
253
|
+
const loadWebhooks = () => import("../webhooks/index.js");
|
|
254
|
+
const loadGithub = () => import("../github/index.js");
|
|
255
|
+
const loadGoal = () => import("../goal/index.js");
|
|
256
|
+
const loadPairing = () => import("../pairing/index.js");
|
|
257
|
+
const loadPrincipal = () => import("../principal/index.js");
|
|
258
|
+
const loadNodeUpdate = () => import("../node-update/index.js");
|
|
259
|
+
const loadSkillsSync = () => import("../skills-sync/index.js");
|
|
260
|
+
const loadPanel = () => import("../panel/index.js");
|
|
261
|
+
const loadReach = () => import("../reach/index.js");
|
|
216
262
|
const loadLocalNode = () => import("../local-node/index.js");
|
|
217
263
|
const loadBootstrap = () => import("../team-workspace/index.js");
|
|
218
264
|
const lazyDependencies = (load, makeClient, binding) => Object.fromEntries(binding.names.map((name) => [
|
|
@@ -250,6 +296,14 @@ const makeDefaultCliDependencies = (binding) => ({
|
|
|
250
296
|
"statusClaudeCodeIntegration",
|
|
251
297
|
"applyClaudeCodeIntegration",
|
|
252
298
|
"removeClaudeCodeIntegration",
|
|
299
|
+
"planMaiaAgentIntegration",
|
|
300
|
+
"statusMaiaAgentIntegration",
|
|
301
|
+
"applyMaiaAgentIntegration",
|
|
302
|
+
"removeMaiaAgentIntegration",
|
|
303
|
+
"planPiIntegration",
|
|
304
|
+
"statusPiIntegration",
|
|
305
|
+
"applyPiIntegration",
|
|
306
|
+
"removePiIntegration",
|
|
253
307
|
],
|
|
254
308
|
}),
|
|
255
309
|
...lazyDependencies(loadConnection, (module, node) => module.makeConnectionClient(node), {
|
|
@@ -262,6 +316,7 @@ const makeDefaultCliDependencies = (binding) => ({
|
|
|
262
316
|
"listConnectionGrants",
|
|
263
317
|
"listConnectionPools",
|
|
264
318
|
"listConnections",
|
|
319
|
+
"listInstalledHarnesses",
|
|
265
320
|
"previewConnectionGrant",
|
|
266
321
|
"previewConnectionPool",
|
|
267
322
|
"listConnectionModels",
|
|
@@ -323,6 +378,7 @@ const makeDefaultCliDependencies = (binding) => ({
|
|
|
323
378
|
...binding,
|
|
324
379
|
names: [
|
|
325
380
|
"listRoutines",
|
|
381
|
+
"listRoutineRuns",
|
|
326
382
|
"showRoutine",
|
|
327
383
|
"previewRoutineCreate",
|
|
328
384
|
"confirmRoutineCreate",
|
|
@@ -332,6 +388,14 @@ const makeDefaultCliDependencies = (binding) => ({
|
|
|
332
388
|
"confirmRoutineDisable",
|
|
333
389
|
"previewRoutineRun",
|
|
334
390
|
"confirmRoutineRun",
|
|
391
|
+
"previewRoutineUpdate",
|
|
392
|
+
"confirmRoutineUpdate",
|
|
393
|
+
"previewRoutineMove",
|
|
394
|
+
"confirmRoutineMove",
|
|
395
|
+
"listRoutineTriggers",
|
|
396
|
+
"previewRoutineTriggerCreate",
|
|
397
|
+
"confirmRoutineTriggerCreate",
|
|
398
|
+
"disableRoutineTrigger",
|
|
335
399
|
],
|
|
336
400
|
}),
|
|
337
401
|
...lazyDependencies(() => import("../project-workspace/index.js"), (module, node) => module.makeProjectMetadataClient(node), {
|
|
@@ -419,6 +483,7 @@ const makeDefaultCliDependencies = (binding) => ({
|
|
|
419
483
|
"sendAttachedSessionMessage",
|
|
420
484
|
"showExecutionRelocation",
|
|
421
485
|
"showSession",
|
|
486
|
+
"waitSession",
|
|
422
487
|
"startSession",
|
|
423
488
|
"stopSession",
|
|
424
489
|
],
|
|
@@ -449,6 +514,7 @@ const makeDefaultCliDependencies = (binding) => ({
|
|
|
449
514
|
"listTurnQueue",
|
|
450
515
|
"sendTurn",
|
|
451
516
|
"showTurn",
|
|
517
|
+
"showTurnAttachmentPolicy",
|
|
452
518
|
"waitTurns",
|
|
453
519
|
],
|
|
454
520
|
}),
|
|
@@ -457,6 +523,16 @@ const makeDefaultCliDependencies = (binding) => ({
|
|
|
457
523
|
...binding,
|
|
458
524
|
names: ["listApprovals", "respondToApproval", "showApproval"],
|
|
459
525
|
}),
|
|
526
|
+
...lazyDependencies(loadInbox, (module, node) => module.makeInboxClient(node), {
|
|
527
|
+
...binding,
|
|
528
|
+
names: [
|
|
529
|
+
"listInbox",
|
|
530
|
+
"respondToInboxItem",
|
|
531
|
+
"settleInboxItem",
|
|
532
|
+
"showInboxItem",
|
|
533
|
+
"snoozeInboxItem",
|
|
534
|
+
],
|
|
535
|
+
}),
|
|
460
536
|
...lazyDependencies(loadPortLease, (module, node) => module.makePortLeaseClient(node), {
|
|
461
537
|
...binding,
|
|
462
538
|
names: [
|
|
@@ -477,19 +553,133 @@ const makeDefaultCliDependencies = (binding) => ({
|
|
|
477
553
|
"showRunLedgerTask",
|
|
478
554
|
],
|
|
479
555
|
}),
|
|
556
|
+
...lazyDependencies(loadBoard, (module, node) => module.makeBoardClient(node), {
|
|
557
|
+
...binding,
|
|
558
|
+
names: [
|
|
559
|
+
"assignBoardTask",
|
|
560
|
+
"cancelBoardTask",
|
|
561
|
+
"claimBoardTask",
|
|
562
|
+
"completeBoardTask",
|
|
563
|
+
"createBoardTask",
|
|
564
|
+
"failBoardTask",
|
|
565
|
+
"listBoardTasks",
|
|
566
|
+
"planBoardTasks",
|
|
567
|
+
"postBoardMessage",
|
|
568
|
+
"promoteBoardThread",
|
|
569
|
+
"readBoardPath",
|
|
570
|
+
"releaseBoardTask",
|
|
571
|
+
"renewBoardTask",
|
|
572
|
+
"reopenBoardTask",
|
|
573
|
+
"replaceBoardTaskNeeds",
|
|
574
|
+
"replyToBoardMessage",
|
|
575
|
+
"showBoardTask",
|
|
576
|
+
"showBoardThread",
|
|
577
|
+
],
|
|
578
|
+
}),
|
|
480
579
|
...lazyDependencies(loadProjectGuard, (module, node) => module.makeProjectGuardClient(node), {
|
|
481
580
|
...binding,
|
|
482
581
|
names: ["confirmProjectGuard", "previewProjectGuard", "showProjectGuard"],
|
|
483
582
|
}),
|
|
583
|
+
...lazyDependencies(loadProjectInstructions, (module, node) => module.makeProjectInstructionsClient(node), {
|
|
584
|
+
...binding,
|
|
585
|
+
names: [
|
|
586
|
+
"confirmProjectInstructionsChange",
|
|
587
|
+
"previewProjectInstructionsChange",
|
|
588
|
+
"showProjectInstructions",
|
|
589
|
+
],
|
|
590
|
+
}),
|
|
591
|
+
...lazyDependencies(loadSecret, (module, node) => module.makeSecretClient(node), { ...binding, names: ["confirmSecretSet", "previewSecretSet"] }),
|
|
592
|
+
...lazyDependencies(loadProjectKnowledge, (module, node) => module.makeProjectKnowledgeClient(node), {
|
|
593
|
+
...binding,
|
|
594
|
+
names: [
|
|
595
|
+
"commitProjectKnowledgeAdd",
|
|
596
|
+
"confirmProjectKnowledgeAdd",
|
|
597
|
+
"confirmProjectKnowledgeRemove",
|
|
598
|
+
"listProjectKnowledge",
|
|
599
|
+
"previewProjectKnowledgeAdd",
|
|
600
|
+
"previewProjectKnowledgeRemove",
|
|
601
|
+
"sendProjectKnowledgeChunk",
|
|
602
|
+
],
|
|
603
|
+
}),
|
|
484
604
|
...lazyDependencies(loadAgents, (module, node) => module.makeAgentsClient(node), {
|
|
485
605
|
...binding,
|
|
486
606
|
names: [
|
|
487
607
|
"confirmAgentChange",
|
|
608
|
+
"detectAgents",
|
|
488
609
|
"listAgents",
|
|
489
610
|
"previewAgentChange",
|
|
490
611
|
"showAgent",
|
|
491
612
|
],
|
|
492
613
|
}),
|
|
614
|
+
...lazyDependencies(loadWebhooks, (module, node) => module.makeWebhooksClient(node), {
|
|
615
|
+
...binding,
|
|
616
|
+
names: [
|
|
617
|
+
"confirmWebhookChange",
|
|
618
|
+
"listWebhookDeliveries",
|
|
619
|
+
"listWebhooks",
|
|
620
|
+
"previewWebhookChange",
|
|
621
|
+
],
|
|
622
|
+
}),
|
|
623
|
+
...lazyDependencies(loadGithub, (module, node) => module.makeGithubCliClient(node), {
|
|
624
|
+
...binding,
|
|
625
|
+
names: [
|
|
626
|
+
"createGithubConnection",
|
|
627
|
+
"linkPullRequest",
|
|
628
|
+
"revokeGithubConnection",
|
|
629
|
+
"showGithubConnections",
|
|
630
|
+
"showPullRequestStatus",
|
|
631
|
+
"watchPullRequest",
|
|
632
|
+
],
|
|
633
|
+
}),
|
|
634
|
+
...lazyDependencies(loadGoal, (module, node) => module.makeGoalCliClient(node), {
|
|
635
|
+
...binding,
|
|
636
|
+
names: [
|
|
637
|
+
"clearGoal",
|
|
638
|
+
"markGoal",
|
|
639
|
+
"setGoal",
|
|
640
|
+
"showGoal",
|
|
641
|
+
"transitionGoal",
|
|
642
|
+
"updateGoal",
|
|
643
|
+
],
|
|
644
|
+
}),
|
|
645
|
+
...lazyDependencies(loadPairing, (module, node) => module.makePairingClient(node), {
|
|
646
|
+
...binding,
|
|
647
|
+
names: [
|
|
648
|
+
"confirmPairing",
|
|
649
|
+
"previewPairing",
|
|
650
|
+
"redeemPairing",
|
|
651
|
+
"showPairings",
|
|
652
|
+
],
|
|
653
|
+
}),
|
|
654
|
+
...lazyDependencies(loadPrincipal, (module, node) => module.makePrincipalClient(node), {
|
|
655
|
+
...binding,
|
|
656
|
+
names: ["confirmPrincipal", "previewPrincipal", "showPrincipals"],
|
|
657
|
+
}),
|
|
658
|
+
...lazyDependencies(loadNodeUpdate, (module, node) => module.makeNodeUpdateClient(node), {
|
|
659
|
+
...binding,
|
|
660
|
+
names: [
|
|
661
|
+
"checkNodeUpdate",
|
|
662
|
+
"confirmNodeUpdateApply",
|
|
663
|
+
"confirmNodeUpdateRollback",
|
|
664
|
+
"getNodeUpdatePolicy",
|
|
665
|
+
"pauseNodeUpdate",
|
|
666
|
+
"previewNodeUpdateApply",
|
|
667
|
+
"previewNodeUpdateRollback",
|
|
668
|
+
"resumeNodeUpdate",
|
|
669
|
+
"setNodeUpdatePolicy",
|
|
670
|
+
"showNodeUpdate",
|
|
671
|
+
"showNodeUpdateStatus",
|
|
672
|
+
],
|
|
673
|
+
}),
|
|
674
|
+
...lazyDependencies(loadSkillsSync, (module, node) => module.makeSkillsSyncClient(node), {
|
|
675
|
+
...binding,
|
|
676
|
+
names: ["confirmSkillsSync", "previewSkillsSync", "showSkillsSync"],
|
|
677
|
+
}),
|
|
678
|
+
...lazyDependencies(loadPanel, (module, node) => module.makePanelClient(node), { ...binding, names: ["openBrowser", "panelAddress"] }),
|
|
679
|
+
...lazyDependencies(loadReach, (module, node) => module.makeReachClient(node), {
|
|
680
|
+
...binding,
|
|
681
|
+
names: ["confirmReach", "previewReach", "showReach"],
|
|
682
|
+
}),
|
|
493
683
|
...lazyDependencies(loadRemoteNode, (module, node) => module.makeRemoteNodeClient(node), {
|
|
494
684
|
...binding,
|
|
495
685
|
names: [
|
|
@@ -512,19 +702,20 @@ const makeDefaultCliDependencies = (binding) => ({
|
|
|
512
702
|
}),
|
|
513
703
|
...lazyDependencies(loadStatus, (module, node) => module.makeStatusClient(node), { ...binding, names: ["createMonitorBootstrap", "readStatus"] }),
|
|
514
704
|
});
|
|
515
|
-
const remoteConnector = (remote, local) => {
|
|
705
|
+
const remoteConnector = (remote, local, ssh) => {
|
|
516
706
|
const cache = {};
|
|
517
707
|
return (options) => Effect.promise(loadRemoteNode).pipe(Effect.flatMap((module) => {
|
|
518
708
|
cache.connector ??= module.makeRemoteNodeConnector({
|
|
519
709
|
...(local === undefined ? {} : { local }),
|
|
520
710
|
name: remote.name,
|
|
521
711
|
scope: remote.scope,
|
|
712
|
+
...(ssh === undefined ? {} : { ssh }),
|
|
522
713
|
});
|
|
523
714
|
return cache.connector(options);
|
|
524
715
|
}));
|
|
525
716
|
};
|
|
526
717
|
const remoteSignIn = (remote, binding) => (connection) => Effect.promise(loadRemoteNode).pipe(Effect.flatMap((module) => module.remoteVendorLogin({ ...binding, name: remote.name })(connection)));
|
|
527
|
-
export const makeCliDependencies = (connector) => (profile, remote) => {
|
|
718
|
+
export const makeCliDependencies = (connector, ssh) => (profile, remote) => {
|
|
528
719
|
const binding = {
|
|
529
720
|
...(connector === undefined ? {} : { connector }),
|
|
530
721
|
...(profile === undefined ? {} : { profile }),
|
|
@@ -534,11 +725,12 @@ export const makeCliDependencies = (connector) => (profile, remote) => {
|
|
|
534
725
|
: {
|
|
535
726
|
...makeDefaultCliDependencies({
|
|
536
727
|
...binding,
|
|
537
|
-
connector: remoteConnector(remote, connector),
|
|
728
|
+
connector: remoteConnector(remote, connector, ssh),
|
|
538
729
|
remote: true,
|
|
539
730
|
}),
|
|
540
731
|
runVendorLogin: remoteSignIn(remote, binding),
|
|
541
732
|
};
|
|
542
733
|
};
|
|
543
|
-
|
|
734
|
+
const loadConfiguredLogLevel = Effect.promise(() => import("./log-level.js")).pipe(Effect.flatMap((module) => module.configuredLogLevel));
|
|
735
|
+
export const runCli = makeCli(makeCliDependencies(), loadConfiguredLogLevel);
|
|
544
736
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { type CliDependencies, type CliDependencyResolver, type CliErrorOutput, type CliHelpResult, type CliIo, type CliStatusResult, type CliSuccessOutput, type CliSuccessResult, type CliVersionResult, makeCli, makeCliDependencies, runCli, } from "./cli.js";
|
|
1
|
+
export { type CliDependencies, type CliDependencyResolver, type CliErrorOutput, type CliHelpResult, type CliIo, type CliStatusResult, type CliSuccessOutput, type CliSuccessResult, type CliVersionResult, makeCli, makeCliDependencies, resolveCommand, runCli, } from "./cli.js";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/cli/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { makeCli, makeCliDependencies, runCli, } from "./cli.js";
|
|
1
|
+
export { makeCli, makeCliDependencies, resolveCommand, runCli, } from "./cli.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import type { LogLevel } from "effect/LogLevel";
|
|
3
|
+
export type ConfiguredLogLevel = {
|
|
4
|
+
readonly level: LogLevel;
|
|
5
|
+
readonly ok: true;
|
|
6
|
+
} | {
|
|
7
|
+
readonly message: string;
|
|
8
|
+
readonly ok: false;
|
|
9
|
+
};
|
|
10
|
+
export declare const configuredLogLevel: Effect.Effect<ConfiguredLogLevel>;
|
|
11
|
+
//# sourceMappingURL=log-level.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as NodeFileSystem from "@effect/platform-node-shared/NodeFileSystem";
|
|
2
|
+
import { minimumLogLevel, readMaiaConfig } from "@maiaos/agent/config";
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
export const configuredLogLevel = readMaiaConfig.pipe(Effect.match({
|
|
5
|
+
onFailure: (error) => ({
|
|
6
|
+
message: error.message,
|
|
7
|
+
ok: false,
|
|
8
|
+
}),
|
|
9
|
+
onSuccess: (config) => ({
|
|
10
|
+
level: minimumLogLevel(config),
|
|
11
|
+
ok: true,
|
|
12
|
+
}),
|
|
13
|
+
}), Effect.provide(NodeFileSystem.layer));
|
|
14
|
+
//# sourceMappingURL=log-level.js.map
|
|
@@ -1,36 +1,50 @@
|
|
|
1
|
-
import type { AgentPermissionConfirmParameters, AgentPermissionConfirmResult, AgentPermissionPreviewParameters, AgentPermissionPreviewResult, ExecutionCatalogGetResult, ExecutionCommandRunResult, ExecutionFileReadResult, ExecutionPlacementCreateResult, ExecutionPlacementShowResult, ExecutionRelocationApplyResult, ExecutionRelocationPlanResult, ExecutionRelocationReconcileResult, ExecutionRelocationShowResult, ExecutionWorktreeCheckpointCreateResult, ExecutionWorktreeCheckpointShowResult, ExecutionWorktreeCreateResult, ExecutionWorktreeImportResult, ExecutionWorktreeReconcileResult, ExecutionWorktreeRemoveApplyResult, ExecutionWorktreeRemovePlanResult, ExecutionWorktreeStatusResult, InvocationContextShowResult, LiveTerminalCloseResult, LiveTerminalControllerAcquireResult, LiveTerminalControllerReleaseResult, LiveTerminalControllerRequestResult, LiveTerminalControllerRequestShowResult, LiveTerminalResizeResult, LiveTerminalSignalResult, LiveTerminalWriteResult, LocalNodeStatusResult, MonitorBootstrapCreateResult, OrchestrationDispatchSettleTerminalResult, OrchestrationDispatchShowResult, OrchestrationInboxAckResult, OrchestrationInboxCheckResult, OrchestrationQuestionCancelResult, OrchestrationQuestionOpenResult, OrchestrationQuestionReplyResult, OrchestrationRunCreateResult, OrchestrationRunListResult, OrchestrationRunShowResult, OrchestrationTaskListResult, OrchestrationTaskShowResult, ProjectContextListResult, ProjectContextRecordResult, ProjectContextShowResult, ProjectListResult, ProjectRegisterResult, ProjectShowResult, ProviderPoolListResult, ReceiptGetResult, ReceiptListParameters, ReceiptListResult, SessionArchiveResult, SessionCreateResult, SessionDiffResult, SessionEventsListResult, SessionInboxAckResult, SessionInboxCheckResult, SessionListResult, SessionMessageSendResult, SessionObserveResult, SessionResumeResult, SessionShowResult, SessionStartResult, SessionStopResult, TerminalCreateResult, TerminalEventsListResult, TerminalListResult, TerminalReadResult, TerminalShowResult, TurnCancelResult, TurnInterruptResult, TurnQueueListResult, TurnSendResult, TurnShowResult, TurnWaitResult, WorkspaceContextShowResult, WorkspaceExecutionConfigureResult, WorkspaceExecutionShowResult, WorkspaceListResult, WorkspaceMembershipAttachResult, WorkspaceRepositoryAttachResult, WorkspaceSelectResult, WorkspaceShowResult } from "@maiaos/sdk";
|
|
1
|
+
import type { AgentPermissionConfirmParameters, AgentPermissionConfirmResult, AgentPermissionPreviewParameters, AgentPermissionPreviewResult, ExecutionCatalogGetResult, ExecutionCommandRunResult, ExecutionFileReadResult, ExecutionPlacementCreateResult, ExecutionPlacementShowResult, ExecutionRelocationApplyResult, ExecutionRelocationPlanResult, ExecutionRelocationReconcileResult, ExecutionRelocationShowResult, ExecutionWorktreeCheckpointCreateResult, ExecutionWorktreeCheckpointShowResult, ExecutionWorktreeCreateResult, ExecutionWorktreeImportResult, ExecutionWorktreeReconcileResult, ExecutionWorktreeRemoveApplyResult, ExecutionWorktreeRemovePlanResult, ExecutionWorktreeStatusResult, InvocationContextShowResult, LiveTerminalCloseResult, LiveTerminalControllerAcquireResult, LiveTerminalControllerReleaseResult, LiveTerminalControllerRequestResult, LiveTerminalControllerRequestShowResult, LiveTerminalResizeResult, LiveTerminalSignalResult, LiveTerminalWriteResult, LocalNodeStatusResult, MonitorBootstrapCreateResult, OrchestrationDispatchSettleTerminalResult, OrchestrationDispatchShowResult, OrchestrationInboxAckResult, OrchestrationInboxCheckResult, OrchestrationQuestionCancelResult, OrchestrationQuestionOpenResult, OrchestrationQuestionReplyResult, OrchestrationRunCreateResult, OrchestrationRunListResult, OrchestrationRunShowResult, OrchestrationTaskListResult, OrchestrationTaskShowResult, ProjectContextListResult, ProjectContextRecordResult, ProjectContextShowResult, ProjectListResult, ProjectRegisterResult, ProjectShowResult, ProviderPoolListResult, ReceiptGetResult, ReceiptListParameters, ReceiptListResult, SessionArchiveResult, SessionCreateResult, SessionDiffResult, SessionEventsListResult, SessionInboxAckResult, SessionInboxCheckResult, SessionListResult, SessionMessageSendResult, SessionObserveResult, SessionResumeResult, SessionShowResult, SessionStartResult, SessionStopResult, TerminalCreateResult, TerminalEventsListResult, TerminalListResult, TerminalReadResult, TerminalShowResult, TurnAttachmentPolicyResult, TurnCancelResult, TurnInterruptResult, TurnQueueListResult, TurnSendResult, TurnShowResult, TurnWaitResult, WorkspaceContextShowResult, WorkspaceExecutionConfigureResult, WorkspaceExecutionShowResult, WorkspaceListResult, WorkspaceMembershipAttachResult, WorkspaceRepositoryAttachResult, WorkspaceSelectResult, WorkspaceShowResult } from "@maiaos/sdk";
|
|
2
2
|
import type * as Crypto from "effect/Crypto";
|
|
3
3
|
import type * as Effect from "effect/Effect";
|
|
4
4
|
import type { AgentsCliDependencies } from "../agents/index.js";
|
|
5
|
+
import type { BoardCliDependencies } from "../board/index.js";
|
|
5
6
|
import type { ConnectionCliDependencies, VendorLogin } from "../connection/index.js";
|
|
6
7
|
import type { ContainerCliDependencies } from "../container/index.js";
|
|
7
8
|
import type { ApplyExecutionRelocationInput, PlanExecutionRelocationInput, ReconcileExecutionRelocationInput } from "../execution/index.js";
|
|
9
|
+
import type { GithubCliDependencies } from "../github/index.js";
|
|
10
|
+
import type { GoalCliDependencies } from "../goal/index.js";
|
|
8
11
|
import type { HoldCliDependencies } from "../hold/index.js";
|
|
9
12
|
import type { DiscoveryCliDependencies } from "../import/index.js";
|
|
13
|
+
import type { InboxCliDependencies } from "../inbox/index.js";
|
|
10
14
|
import type { IntegrationCliDependencies } from "../integration/index.js";
|
|
11
15
|
import type { CliNodeCall, CliNodeEffect } from "../local-node/index.js";
|
|
12
16
|
import type { AgentProviderAccess } from "../login/index.js";
|
|
13
17
|
import type { McpCliDependencies } from "../mcp/index.js";
|
|
18
|
+
import type { NodeUpdateCliDependencies } from "../node-update/index.js";
|
|
14
19
|
import type { makeOrchestrationClient } from "../orchestration/index.js";
|
|
20
|
+
import type { PairingCliDependencies } from "../pairing/index.js";
|
|
21
|
+
import type { PanelCliDependencies } from "../panel/index.js";
|
|
15
22
|
import type { PortLeaseCliDependencies } from "../port-lease/index.js";
|
|
16
23
|
import type { PresentationCliDependencies } from "../presentation/index.js";
|
|
24
|
+
import type { PrincipalCliDependencies } from "../principal/index.js";
|
|
17
25
|
import type { ProjectGuardCliDependencies } from "../project-guard/index.js";
|
|
26
|
+
import type { ProjectInstructionsCliDependencies } from "../project-instructions/index.js";
|
|
27
|
+
import type { ProjectKnowledgeCliDependencies } from "../project-knowledge/index.js";
|
|
18
28
|
import type { AttachRepositoryInput, AttachWorkspaceMembershipInput, ConfigureWorkspaceExecutionInput, CreateExecutionCheckpointInput, CreateExecutionPlacementInput, CreateExecutionWorktreeInput, ImportExecutionWorktreeInput, ProjectMetadataCliDependencies, ReadExecutionFileInput, ReconcileExecutionWorktreeInput, RecordProjectContextInput, RegisterProjectInput, RemoveExecutionWorktreeInput, RunExecutionCommandInput, SelectWorkspaceInput } from "../project-workspace/index.js";
|
|
29
|
+
import type { ReachCliDependencies } from "../reach/index.js";
|
|
19
30
|
import type { RemoteNodeCliDependencies, SshLayer } from "../remote-node/index.js";
|
|
20
31
|
import type { RoutineCliDependencies } from "../routine/index.js";
|
|
21
32
|
import type { RunLedgerCliDependencies } from "../run-ledger/index.js";
|
|
33
|
+
import type { SecretCliDependencies } from "../secret/index.js";
|
|
22
34
|
import type { ApprovalCliDependencies } from "../session/approval/index.js";
|
|
23
|
-
import type { ArchiveSessionInput, AttachSessionInput, CreateSessionInput, DiffSessionInput, ListSessionsInput, makeSessionClient, SessionAttachStream, StartSessionInput } from "../session/index.js";
|
|
35
|
+
import type { ArchiveSessionInput, AttachSessionInput, CreateSessionInput, DiffSessionInput, ListSessionsInput, makeSessionClient, ResumeSessionInput, SessionAttachStream, StartSessionInput } from "../session/index.js";
|
|
24
36
|
import type { InteractionCliDependencies } from "../session/interaction/index.js";
|
|
25
37
|
import type { CancelTurnInput, InterruptTurnInput, SendTurnInput, WaitTurnsInput } from "../session/turn/index.js";
|
|
38
|
+
import type { SkillsSyncCliDependencies } from "../skills-sync/index.js";
|
|
26
39
|
import type { BootstrapCliDependencies } from "../team-workspace/index.js";
|
|
27
40
|
import type { CreateTerminalInput, makeTerminalClient } from "../terminal/index.js";
|
|
41
|
+
import type { WebhooksCliDependencies } from "../webhooks/index.js";
|
|
42
|
+
import type { CliIo, CliResolution } from "./emit/index.js";
|
|
28
43
|
import type { CliArgumentError } from "./input/index.js";
|
|
29
|
-
import type { CliIo, CliResolution } from "./output.js";
|
|
30
44
|
type OrchestrationClient = ReturnType<typeof makeOrchestrationClient>;
|
|
31
45
|
type SessionClient = ReturnType<typeof makeSessionClient>;
|
|
32
46
|
type TerminalClient = ReturnType<typeof makeTerminalClient>;
|
|
33
|
-
export type CliDependencies = Partial<AgentsCliDependencies & ApprovalCliDependencies & BootstrapCliDependencies & ConnectionCliDependencies & ContainerCliDependencies & HoldCliDependencies & DiscoveryCliDependencies & IntegrationCliDependencies & PresentationCliDependencies & McpCliDependencies & InteractionCliDependencies & PortLeaseCliDependencies & ProjectGuardCliDependencies & ProjectMetadataCliDependencies & RemoteNodeCliDependencies & RoutineCliDependencies & RunLedgerCliDependencies> & {
|
|
47
|
+
export type CliDependencies = Partial<AgentsCliDependencies & ApprovalCliDependencies & BoardCliDependencies & BootstrapCliDependencies & ConnectionCliDependencies & ContainerCliDependencies & GithubCliDependencies & GoalCliDependencies & HoldCliDependencies & InboxCliDependencies & DiscoveryCliDependencies & IntegrationCliDependencies & PresentationCliDependencies & McpCliDependencies & NodeUpdateCliDependencies & InteractionCliDependencies & PairingCliDependencies & PanelCliDependencies & PortLeaseCliDependencies & PrincipalCliDependencies & ProjectGuardCliDependencies & ProjectInstructionsCliDependencies & ProjectKnowledgeCliDependencies & ProjectMetadataCliDependencies & ReachCliDependencies & RemoteNodeCliDependencies & RoutineCliDependencies & RunLedgerCliDependencies & SecretCliDependencies & SkillsSyncCliDependencies & WebhooksCliDependencies> & {
|
|
34
48
|
readonly acknowledgeAttachedSessionDelivery?: (input: Parameters<SessionClient["acknowledgeAttachedSessionDelivery"]>[0]) => CliNodeEffect<SessionInboxAckResult>;
|
|
35
49
|
readonly acknowledgeRunDelivery: (input: Parameters<OrchestrationClient["acknowledgeRunDelivery"]>[0]) => CliNodeEffect<OrchestrationInboxAckResult>;
|
|
36
50
|
readonly acquireTerminalController: (input: Parameters<TerminalClient["acquireTerminalController"]>[0]) => CliNodeEffect<LiveTerminalControllerAcquireResult>;
|
|
@@ -129,7 +143,7 @@ export type CliDependencies = Partial<AgentsCliDependencies & ApprovalCliDepende
|
|
|
129
143
|
readonly replyRunQuestion: (input: Parameters<OrchestrationClient["replyRunQuestion"]>[0]) => CliNodeEffect<OrchestrationQuestionReplyResult>;
|
|
130
144
|
readonly requestTerminalController: (input: Parameters<TerminalClient["requestTerminalController"]>[0]) => CliNodeEffect<LiveTerminalControllerRequestResult>;
|
|
131
145
|
readonly resizeTerminal: (input: Parameters<TerminalClient["resizeTerminal"]>[0]) => CliNodeEffect<LiveTerminalResizeResult>;
|
|
132
|
-
readonly resumeSession?: (input:
|
|
146
|
+
readonly resumeSession?: (input: ResumeSessionInput) => CliNodeEffect<SessionResumeResult>;
|
|
133
147
|
readonly runAgent?: (arguments_: readonly string[], io: CliIo) => Effect.Effect<number, unknown>;
|
|
134
148
|
readonly runExecutionCommand?: (input: RunExecutionCommandInput) => CliNodeEffect<ExecutionCommandRunResult>;
|
|
135
149
|
readonly runSessions?: SessionClient["runSessions"];
|
|
@@ -159,6 +173,7 @@ export type CliDependencies = Partial<AgentsCliDependencies & ApprovalCliDepende
|
|
|
159
173
|
readonly showTerminal: (terminalId: string) => CliNodeEffect<TerminalShowResult>;
|
|
160
174
|
readonly showTerminalControllerRequest: (input: Parameters<TerminalClient["showTerminalControllerRequest"]>[0]) => CliNodeEffect<LiveTerminalControllerRequestShowResult>;
|
|
161
175
|
readonly showTurn: (turnId: string) => CliNodeEffect<TurnShowResult>;
|
|
176
|
+
readonly showTurnAttachmentPolicy?: (sessionId: string) => CliNodeEffect<TurnAttachmentPolicyResult>;
|
|
162
177
|
readonly showWorkspace: (workspaceId: string) => CliNodeEffect<WorkspaceShowResult>;
|
|
163
178
|
readonly showWorkspaceContext?: () => CliNodeEffect<WorkspaceContextShowResult>;
|
|
164
179
|
readonly showWorkspaceExecution?: (workspaceId: string) => CliNodeEffect<WorkspaceExecutionShowResult>;
|
|
@@ -166,12 +181,12 @@ export type CliDependencies = Partial<AgentsCliDependencies & ApprovalCliDepende
|
|
|
166
181
|
readonly sshLayer?: SshLayer;
|
|
167
182
|
readonly startSession: (input: StartSessionInput) => CliNodeEffect<SessionStartResult>;
|
|
168
183
|
readonly stopSession?: (input: StartSessionInput) => CliNodeEffect<SessionStopResult>;
|
|
184
|
+
readonly waitSession?: SessionClient["waitSession"];
|
|
169
185
|
readonly waitTurns?: (input: WaitTurnsInput) => CliNodeEffect<TurnWaitResult>;
|
|
170
186
|
readonly writeTerminalInput: (input: Parameters<TerminalClient["writeTerminalInput"]>[0]) => CliNodeEffect<LiveTerminalWriteResult>;
|
|
171
187
|
};
|
|
172
188
|
export type CliServices = Crypto.Crypto;
|
|
173
189
|
export type CommandEffect = Effect.Effect<number, CliArgumentError, CliServices>;
|
|
174
|
-
export declare const LOCAL_NODE = "local";
|
|
175
190
|
export type CommandContext = {
|
|
176
191
|
readonly bindNode?: (name: string) => CliDependencies;
|
|
177
192
|
readonly dependencies: CliDependencies;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { decodeJsonText, jsonLine } from "./json.js";
|
|
2
|
+
export { type CliCommandOutput, type CliErrorOutput, type CliIo, type CliResolution, type CliSuccessOutput, type CliSuccessResult, exitCodeOf, type NodeResultPresenter, type OutputContext, reportError, writeNodeResult, writeSuccess, } from "./output.js";
|
|
3
|
+
export { block, cell, type CliTable, fields, formatRows, labelCells, tab, withNextPage, withPrunedHistory, } from "./rows.js";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { decodeJsonText, jsonLine } from "./json.js";
|
|
2
|
+
export { exitCodeOf, reportError, writeNodeResult, writeSuccess, } from "./output.js";
|
|
3
|
+
export { block, cell, fields, formatRows, labelCells, tab, withNextPage, withPrunedHistory, } from "./rows.js";
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import type { NodeHolding } from "@maiaos/client-core/cockpit";
|
|
2
2
|
import type { ProtocolError } from "@maiaos/sdk";
|
|
3
3
|
import type * as Effect from "effect/Effect";
|
|
4
|
-
import type { CliMutationRecovery, CliNodeResult } from "
|
|
5
|
-
import type { BoundedStdinRequest, CliArgumentError, PromptOptions } from "
|
|
4
|
+
import type { CliMutationRecovery, CliNodeResult } from "../../local-node/index.js";
|
|
5
|
+
import type { BoundedStdinRequest, CliArgumentError, PromptOptions } from "../input/index.js";
|
|
6
6
|
export type CliIo = {
|
|
7
7
|
readonly cwd?: string;
|
|
8
8
|
readonly interactive?: boolean;
|
|
9
9
|
readonly prompt?: (question: string, options?: PromptOptions) => Effect.Effect<string | undefined>;
|
|
10
10
|
readonly stderr: (text: string) => void;
|
|
11
11
|
readonly stdin?: (request: BoundedStdinRequest) => Effect.Effect<string, CliArgumentError>;
|
|
12
|
+
readonly stdinIsTerminal?: boolean;
|
|
12
13
|
readonly stdout: (text: string) => void;
|
|
13
14
|
};
|
|
14
15
|
export type CliSuccessResult = {
|
|
@@ -46,6 +47,7 @@ export type OutputContext = {
|
|
|
46
47
|
readonly resolved?: readonly CliResolution[];
|
|
47
48
|
};
|
|
48
49
|
type ErrorContext = OutputContext & {
|
|
50
|
+
readonly hint?: string;
|
|
49
51
|
readonly nodes?: readonly NodeHolding[];
|
|
50
52
|
readonly notFoundHint?: string;
|
|
51
53
|
readonly recovery?: CliMutationRecovery;
|
|
@@ -55,10 +57,12 @@ export type CliCommandOutput = CliSuccessResult;
|
|
|
55
57
|
export declare const writeSuccess: <TResult extends CliCommandOutput>(result: TResult, { error, io, json, ok, resolved }: OutputContext, human: (result: TResult) => string) => void;
|
|
56
58
|
export declare const reportError: (error: ProtocolError, context: ErrorContext) => number;
|
|
57
59
|
export declare const exitCodeOf: (error: ProtocolError) => number;
|
|
60
|
+
type RefusalHint = (error: ProtocolError) => string | undefined;
|
|
58
61
|
export type NodeResultPresenter<TValue, TResult extends CliCommandOutput> = {
|
|
62
|
+
readonly refusalHint?: RefusalHint;
|
|
59
63
|
readonly toResult: (value: TValue) => TResult;
|
|
60
64
|
readonly toText: (result: TResult) => string;
|
|
61
65
|
};
|
|
62
|
-
export declare const writeNodeResult: <TValue, TResult extends CliCommandOutput>(result: CliNodeResult<TValue>, context: OutputContext, { toResult, toText }: NodeResultPresenter<TValue, TResult>) => number;
|
|
66
|
+
export declare const writeNodeResult: <TValue, TResult extends CliCommandOutput>(result: CliNodeResult<TValue>, context: OutputContext, { refusalHint, toResult, toText }: NodeResultPresenter<TValue, TResult>) => number;
|
|
63
67
|
export {};
|
|
64
68
|
//# sourceMappingURL=output.d.ts.map
|
|
@@ -34,14 +34,15 @@ const formatRecovery = ({ commandId, profile }) => profile === undefined
|
|
|
34
34
|
: `Outcome unknown. Start the Node of profile ${profile}, then read the receipt:\n maia-node --desktop --profile ${profile}\n maia --profile ${profile} receipt show ${commandId}\n`;
|
|
35
35
|
const writeError = (error, context) => {
|
|
36
36
|
const { io, json, nodes, notFoundHint, recovery, usage: hint } = context;
|
|
37
|
-
const
|
|
37
|
+
const leafHint = (error.code === "resource_not_found" ? notFoundHint : undefined) ??
|
|
38
|
+
context.hint;
|
|
38
39
|
if (json) {
|
|
39
40
|
const output = {
|
|
40
41
|
error,
|
|
41
42
|
ok: false,
|
|
42
43
|
...(nodes === undefined ? {} : { nodes }),
|
|
43
44
|
...(recovery === undefined ? {} : { recovery }),
|
|
44
|
-
...(
|
|
45
|
+
...(leafHint === undefined ? {} : { hint: leafHint }),
|
|
45
46
|
...hint,
|
|
46
47
|
};
|
|
47
48
|
io.stderr(jsonLine(output));
|
|
@@ -49,8 +50,8 @@ const writeError = (error, context) => {
|
|
|
49
50
|
}
|
|
50
51
|
const usage = formatUsageHint(error, hint);
|
|
51
52
|
const recoveryHint = recovery === undefined ? "" : formatRecovery(recovery);
|
|
52
|
-
const
|
|
53
|
-
io.stderr(`maia: ${cell(error.message)}\n${
|
|
53
|
+
const hintLine = leafHint === undefined ? "" : `${leafHint}\n`;
|
|
54
|
+
io.stderr(`maia: ${cell(error.message)}\n${hintLine}${recoveryHint}${usage}`);
|
|
54
55
|
};
|
|
55
56
|
const TEMPORARY_ERROR_CODES = new Set([
|
|
56
57
|
"guard_leases_per_session_exceeded",
|
|
@@ -58,22 +59,27 @@ const TEMPORARY_ERROR_CODES = new Set([
|
|
|
58
59
|
"guard_messages_per_minute_exceeded",
|
|
59
60
|
"held",
|
|
60
61
|
"saturated",
|
|
62
|
+
"spawn_concurrency_exceeded",
|
|
61
63
|
]);
|
|
62
64
|
const PERMISSION_ERROR_CODES = new Set([
|
|
63
65
|
"authentication_failed",
|
|
64
66
|
"context_override_forbidden",
|
|
65
67
|
"role_denied",
|
|
68
|
+
"session_command_refused",
|
|
69
|
+
"session_spawn_wider",
|
|
66
70
|
"terminal_program_not_admitted",
|
|
67
71
|
]);
|
|
68
72
|
const USAGE_ERROR_CODES = new Set([
|
|
69
73
|
"command_not_implemented",
|
|
70
74
|
"invalid_argument",
|
|
71
75
|
"node_ambiguous",
|
|
76
|
+
"turn_attachment_refused",
|
|
72
77
|
]);
|
|
73
78
|
const UNAVAILABLE_ERROR_CODES = new Set([
|
|
74
79
|
"node_context_unavailable",
|
|
75
80
|
"node_unavailable",
|
|
76
81
|
"platform_unsupported",
|
|
82
|
+
"protocol_incompatible",
|
|
77
83
|
"terminal_containment_unsupported",
|
|
78
84
|
]);
|
|
79
85
|
export const reportError = (error, context) => {
|
|
@@ -100,10 +106,12 @@ export const exitCodeOf = (error) => {
|
|
|
100
106
|
return EXIT_TEMPORARY;
|
|
101
107
|
return EXIT_SOFTWARE;
|
|
102
108
|
};
|
|
103
|
-
export const writeNodeResult = (result, context, { toResult, toText }) => {
|
|
109
|
+
export const writeNodeResult = (result, context, { refusalHint, toResult, toText }) => {
|
|
104
110
|
if (!result.ok) {
|
|
111
|
+
const hint = refusalHint?.(result.error);
|
|
105
112
|
return reportError(result.error, {
|
|
106
113
|
...context,
|
|
114
|
+
...(hint === undefined ? {} : { hint }),
|
|
107
115
|
...(result.recovery === undefined ? {} : { recovery: result.recovery }),
|
|
108
116
|
});
|
|
109
117
|
}
|