@maiaos/cli 0.1.0-canary.7 → 0.1.0-canary.71
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 +208 -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 +150 -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 +457 -1
- package/dist/integration/client.js +31 -1
- package/dist/integration/commands.d.ts +12 -0
- package/dist/integration/commands.js +73 -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/session/attach.js
CHANGED
|
@@ -3,7 +3,7 @@ import * as Duration from "effect/Duration";
|
|
|
3
3
|
import * as Effect from "effect/Effect";
|
|
4
4
|
import * as Ref from "effect/Ref";
|
|
5
5
|
import * as Stream from "effect/Stream";
|
|
6
|
-
import { CliArgumentError, jsonLine, parseOptions, reportError, requirePositionals, } from "../command-line/index.js";
|
|
6
|
+
import { CliArgumentError, jsonLine, parseOptions, reportError, requirePositionals, TWO_PHASE_FLAGS, } from "../command-line/index.js";
|
|
7
7
|
import { finishSessionAttachRender, initialAttachRenderState, renderSessionAttachFrame, } from "./attach-render.js";
|
|
8
8
|
const MAX_IDLE_REATTACHES = 5;
|
|
9
9
|
const REATTACH_BACKOFF = Duration.millis(100);
|
|
@@ -102,7 +102,12 @@ const follow = (attachment, idle) => Effect.gen(function* () {
|
|
|
102
102
|
yield* Effect.sleep(Duration.times(REATTACH_BACKOFF, nextIdle));
|
|
103
103
|
return yield* follow(attachment, nextIdle);
|
|
104
104
|
});
|
|
105
|
-
|
|
105
|
+
const NATIVE_FORM = ["--runtime", "--external-id", ...TWO_PHASE_FLAGS];
|
|
106
|
+
const namesNativeSession = (tokens) => tokens.some((token) => NATIVE_FORM.some((option) => token === option || token.startsWith(`${option}=`)));
|
|
107
|
+
export const sessionAttachRunner = (loadNative) => (tokens, context) => namesNativeSession(tokens)
|
|
108
|
+
? Effect.promise(loadNative).pipe(Effect.flatMap((runNative) => runNative(tokens, context)))
|
|
109
|
+
: followSession(tokens, context);
|
|
110
|
+
const followSession = (tokens, context) => Effect.gen(function* () {
|
|
106
111
|
const parsed = parseOptions(tokens, new Set(["--after"]), new Set(["--no-follow"]));
|
|
107
112
|
requirePositionals(parsed.positionals, 1);
|
|
108
113
|
const [sessionId = ""] = parsed.positionals;
|
package/dist/session/client.d.ts
CHANGED
|
@@ -1,24 +1,29 @@
|
|
|
1
|
-
import type { Session, SessionCreateParameters, SessionCreateResult, SessionCreationInput, SessionCreationOutcome, SessionCreationPlan, SessionEventsListResult, SessionInboxAckResult, SessionInboxCheckResult, SessionListParameters, SessionListResult, SessionMessageSendResult, SessionObserveResult, SessionResumeResult, SessionShowResult,
|
|
1
|
+
import type { Session, SessionCreateParameters, SessionCreateResult, SessionCreationInput, SessionCreationOutcome, SessionCreationPlan, SessionEventsListResult, SessionInboxAckResult, SessionInboxCheckResult, SessionListParameters, SessionListResult, SessionMessageSendResult, SessionObserveResult, SessionResumeResult, SessionShowResult, SessionStartResult, SessionStopResult, SessionWaitResult, SupervisedResumeClaim } from "@maiaos/sdk";
|
|
2
2
|
import { type CliNodeEffect, type CliNodeOperations } from "../local-node/index.js";
|
|
3
|
+
export type WaitSessionInput = {
|
|
4
|
+
readonly activities?: readonly string[];
|
|
5
|
+
readonly sessionId: string;
|
|
6
|
+
readonly states?: readonly string[];
|
|
7
|
+
readonly timeoutMilliseconds: number;
|
|
8
|
+
};
|
|
3
9
|
export type CreateSessionInput = {
|
|
4
10
|
readonly agentId?: SessionCreateParameters["agentId"];
|
|
5
11
|
readonly baseRef?: string;
|
|
12
|
+
readonly branch?: string;
|
|
6
13
|
readonly commandId?: string;
|
|
7
14
|
readonly connectionId?: string;
|
|
15
|
+
readonly cwd?: string;
|
|
8
16
|
readonly definitionRef?: SessionCreateParameters["definitionRef"];
|
|
9
17
|
readonly effort?: SessionCreateParameters["effort"];
|
|
10
18
|
readonly executor?: SessionCreateParameters["executor"];
|
|
19
|
+
readonly hostAuthority?: SessionCreateParameters["hostAuthority"];
|
|
20
|
+
readonly labels?: SessionCreateParameters["labels"];
|
|
11
21
|
readonly model?: string;
|
|
22
|
+
readonly permission?: SessionCreateParameters["permission"];
|
|
12
23
|
readonly role?: SessionCreateParameters["role"];
|
|
13
24
|
readonly title?: string;
|
|
14
25
|
readonly workspaceId: string;
|
|
15
26
|
};
|
|
16
|
-
type SpawnSessionInput = {
|
|
17
|
-
readonly commandId?: string;
|
|
18
|
-
readonly harness: "maia-agent" | "pi";
|
|
19
|
-
readonly parentSessionId: string;
|
|
20
|
-
readonly workspaceId: string;
|
|
21
|
-
};
|
|
22
27
|
export type ListSessionsInput = Omit<SessionListParameters, "states"> & {
|
|
23
28
|
readonly states?: readonly string[];
|
|
24
29
|
};
|
|
@@ -27,6 +32,9 @@ export type StartSessionInput = {
|
|
|
27
32
|
readonly expectedRevision: string;
|
|
28
33
|
readonly sessionId: string;
|
|
29
34
|
};
|
|
35
|
+
export type ResumeSessionInput = StartSessionInput & {
|
|
36
|
+
readonly parent?: SupervisedResumeClaim;
|
|
37
|
+
};
|
|
30
38
|
type SendAttachedSessionMessageInput = {
|
|
31
39
|
readonly body: string;
|
|
32
40
|
readonly commandId?: string;
|
|
@@ -59,7 +67,7 @@ export declare const makeSessionClient: (node: CliNodeOperations) => {
|
|
|
59
67
|
readonly commandId: string;
|
|
60
68
|
readonly grantedAt: string;
|
|
61
69
|
readonly inputDigest: string;
|
|
62
|
-
readonly operationIds: readonly ("agents.change.confirm" | "agents.change.preview" | "agents.list" | "agents.show" | "approval.list" | "approval.respond" | "approval.show" | "connection.capacity.set" | "connection.create" | "connection.detect" | "connection.gateway.create" | "connection.grant.list" | "connection.grant.set.confirm" | "connection.grant.set.preview" | "connection.list" | "connection.login.start" | "connection.models.list" | "connection.pool.list" | "connection.pool.set.confirm" | "connection.pool.set.preview" | "connection.show" | "connection.state.set" | "connection.system.confirm" | "connection.system.preview" | "connection.upkeep.confirm" | "connection.upkeep.preview" | "connection.upkeep.refresh" | "connection.usage.show" | "container.create.confirm" | "container.create.preview" | "container.index.list" | "container.list" | "container.rename.confirm" | "container.rename.preview" | "container.show" | "context.show" | "discovery.sessions.list" | "execution.catalog.get" | "execution.checkpoint.create" | "execution.checkpoint.show" | "execution.command.run" | "execution.file.read" | "execution.placement.create" | "execution.placement.show" | "execution.relocation.apply" | "execution.relocation.plan" | "execution.relocation.reconcile" | "execution.relocation.show" | "execution.worktree.create" | "execution.worktree.import" | "execution.worktree.reconcile" | "execution.worktree.remove.apply" | "execution.worktree.remove.plan" | "execution.worktree.status" | "harness.installed.list" | "hold.list" | "hold.place.confirm" | "hold.place.preview" | "hold.release.confirm" | "hold.release.preview" | "integration.apply.claude-code" | "integration.apply.codex" | "integration.apply.pi-rpc" | "integration.plan.claude-code" | "integration.plan.codex" | "integration.plan.pi-rpc" | "integration.remove.claude-code" | "integration.remove.codex" | "integration.remove.pi-rpc" | "integration.status.claude-code" | "integration.status.codex" | "integration.status.pi-rpc" | "interaction.cancel" | "interaction.create" | "interaction.list" | "interaction.respond" | "interaction.show" | "monitor.bootstrap.create" | "node.remote.install.confirm" | "node.remote.install.preview" | "node.remote.list" | "node.remote.register.confirm" | "node.remote.register.preview" | "node.remote.remove.confirm" | "node.remote.remove.preview" | "node.shutdown" | "node.status" | "port.lease.acquire" | "port.lease.list" | "port.lease.release" | "port.lease.renew" | "presentation.catalog.show" | "presentation.project-list.show" | "presentation.session-list.show" | "presentation.workspace-directory.show" | "project.context.list" | "project.context.record" | "project.context.show" | "project.create.confirm" | "project.create.preview" | "project.guard.confirm" | "project.guard.preview" | "project.guard.show" | "project.list" | "project.register" | "project.rename.confirm" | "project.rename.preview" | "project.show" | "provider.pool.list" | "receipt.get" | "receipt.list" | "reference.resolve" | "routine.create.confirm" | "routine.create.preview" | "routine.disable.confirm" | "routine.disable.preview" | "routine.list" | "routine.pause" | "routine.resume" | "routine.run.confirm" | "routine.run.preview" | "routine.show" | "run.create" | "run.dispatch.settle-terminal" | "run.dispatch.show" | "run.inbox.ack" | "run.inbox.check" | "run.ledger.create" | "run.ledger.list" | "run.ledger.task.dispatch" | "run.ledger.task.list" | "run.ledger.task.settle" | "run.ledger.task.show" | "run.list" | "run.question.cancel" | "run.question.open" | "run.question.reply" | "run.show" | "run.task.list" | "run.task.show" | "runtime.probe" | "session.adopt.confirm" | "session.adopt.preview" | "session.agent-permission.confirm" | "session.agent-permission.preview" | "session.archive" | "session.create" | "session.diff" | "session.events.list" | "session.history.read" | "session.inbox.ack" | "session.inbox.check" | "session.list" | "session.message.send" | "session.observe" | "session.rename" | "session.resume" | "session.show" | "session.spawn" | "session.start" | "session.stop" | "team-workspace.bootstrap.apply" | "team-workspace.bootstrap.preview" | "terminal.controller.acquire" | "terminal.controller.release" | "terminal.controller.renew" | "terminal.controller.request" | "terminal.controller.request.show" | "terminal.create" | "terminal.events.list" | "terminal.input.write" | "terminal.list" | "terminal.mutation.reconcile" | "terminal.observer.attach" | "terminal.observer.check" | "terminal.observer.detach" | "terminal.observer.resync" | "terminal.read" | "terminal.session.close" | "terminal.session.delete" | "terminal.session.resize" | "terminal.session.restart" | "terminal.session.signal" | "terminal.show" | "turn.cancel" | "turn.interrupt" | "turn.queue.list" | "turn.send" | "turn.show" | "turn.wait" | "voice.managed-turn.confirm" | "voice.managed-turn.preview" | "voice.orchestrator.context.show" | "voice.orchestrator.tool.call" | "voice.pi.relay" | "voice.pi.relay.preview" | "voice.pi.relay.reconcile" | "workspace.context.show" | "workspace.execution.configure" | "workspace.execution.show" | "workspace.list" | "workspace.membership.attach" | "workspace.repository.attach" | "workspace.select" | "workspace.show")[];
|
|
70
|
+
readonly operationIds: readonly ("agents.change.confirm" | "agents.change.preview" | "agents.detect" | "agents.list" | "agents.show" | "approval.list" | "approval.respond" | "approval.show" | "board.message.post" | "board.message.reply" | "board.path.read" | "board.task.assign" | "board.task.cancel" | "board.task.claim" | "board.task.complete" | "board.task.create" | "board.task.fail" | "board.task.list" | "board.task.needs.replace" | "board.task.plan" | "board.task.promote" | "board.task.release" | "board.task.renew" | "board.task.reopen" | "board.task.show" | "board.thread.show" | "connection.capacity.set" | "connection.create" | "connection.detect" | "connection.executors.list" | "connection.executors.show" | "connection.gateway.create" | "connection.github.create" | "connection.github.revoke" | "connection.github.show" | "connection.grant.list" | "connection.grant.set.confirm" | "connection.grant.set.preview" | "connection.list" | "connection.login.start" | "connection.models.list" | "connection.pool.list" | "connection.pool.set.confirm" | "connection.pool.set.preview" | "connection.show" | "connection.state.set" | "connection.system.confirm" | "connection.system.preview" | "connection.upkeep.confirm" | "connection.upkeep.preview" | "connection.upkeep.refresh" | "connection.usage.show" | "container.create.confirm" | "container.create.preview" | "container.index.list" | "container.list" | "container.rename.confirm" | "container.rename.preview" | "container.show" | "context.show" | "discovery.sessions.list" | "events.read" | "execution.catalog.get" | "execution.checkpoint.create" | "execution.checkpoint.show" | "execution.command.run" | "execution.file.read" | "execution.placement.create" | "execution.placement.show" | "execution.relocation.apply" | "execution.relocation.plan" | "execution.relocation.reconcile" | "execution.relocation.show" | "execution.worktree.create" | "execution.worktree.import" | "execution.worktree.reconcile" | "execution.worktree.remove.apply" | "execution.worktree.remove.plan" | "execution.worktree.status" | "goal.clear" | "goal.mark" | "goal.set" | "goal.show" | "goal.transition" | "goal.update" | "harness.installed.list" | "hold.list" | "hold.place.confirm" | "hold.place.preview" | "hold.release.confirm" | "hold.release.preview" | "inbox.list" | "inbox.respond" | "inbox.settle" | "inbox.show" | "inbox.snooze" | "integration.apply.antigravity" | "integration.apply.claude-code" | "integration.apply.codex" | "integration.apply.maia-agent" | "integration.apply.pi" | "integration.apply.pi-rpc" | "integration.plan.antigravity" | "integration.plan.claude-code" | "integration.plan.codex" | "integration.plan.maia-agent" | "integration.plan.pi" | "integration.plan.pi-rpc" | "integration.remove.antigravity" | "integration.remove.claude-code" | "integration.remove.codex" | "integration.remove.maia-agent" | "integration.remove.pi" | "integration.remove.pi-rpc" | "integration.status.antigravity" | "integration.status.claude-code" | "integration.status.codex" | "integration.status.maia-agent" | "integration.status.pi" | "integration.status.pi-rpc" | "interaction.cancel" | "interaction.create" | "interaction.list" | "interaction.respond" | "interaction.show" | "monitor.bootstrap.create" | "node.pairing.confirm" | "node.pairing.preview" | "node.pairing.redeem" | "node.pairing.show" | "node.principal.confirm" | "node.principal.preview" | "node.principal.show" | "node.reach.confirm" | "node.reach.preview" | "node.reach.show" | "node.remote.install.confirm" | "node.remote.install.preview" | "node.remote.list" | "node.remote.register.confirm" | "node.remote.register.preview" | "node.remote.remove.confirm" | "node.remote.remove.preview" | "node.shutdown" | "node.status" | "node.update.apply.confirm" | "node.update.apply.preview" | "node.update.check" | "node.update.pause" | "node.update.policy.get" | "node.update.policy.set" | "node.update.resume" | "node.update.rollback.confirm" | "node.update.rollback.preview" | "node.update.show" | "node.update.status" | "port.lease.acquire" | "port.lease.list" | "port.lease.release" | "port.lease.renew" | "pr.link" | "pr.status" | "pr.watch" | "presentation.catalog.show" | "presentation.project-list.show" | "presentation.session-list.show" | "presentation.workspace-directory.show" | "project.context.list" | "project.context.record" | "project.context.show" | "project.create.confirm" | "project.create.preview" | "project.guard.confirm" | "project.guard.preview" | "project.guard.show" | "project.instructions.change.confirm" | "project.instructions.change.preview" | "project.instructions.show" | "project.knowledge.add.chunk" | "project.knowledge.add.commit" | "project.knowledge.add.confirm" | "project.knowledge.add.preview" | "project.knowledge.list" | "project.knowledge.remove.confirm" | "project.knowledge.remove.preview" | "project.knowledge.search" | "project.list" | "project.register" | "project.rename.confirm" | "project.rename.preview" | "project.show" | "provider.pool.list" | "receipt.get" | "receipt.list" | "reference.resolve" | "routine.create.confirm" | "routine.create.preview" | "routine.disable.confirm" | "routine.disable.preview" | "routine.list" | "routine.move.confirm" | "routine.move.preview" | "routine.pause" | "routine.resume" | "routine.run.confirm" | "routine.run.preview" | "routine.runs" | "routine.show" | "routine.trigger.create.confirm" | "routine.trigger.create.preview" | "routine.trigger.disable" | "routine.trigger.list" | "routine.update.confirm" | "routine.update.preview" | "run.create" | "run.dispatch.settle-terminal" | "run.dispatch.show" | "run.inbox.ack" | "run.inbox.check" | "run.ledger.create" | "run.ledger.list" | "run.ledger.task.dispatch" | "run.ledger.task.list" | "run.ledger.task.settle" | "run.ledger.task.show" | "run.list" | "run.question.cancel" | "run.question.open" | "run.question.reply" | "run.show" | "run.task.list" | "run.task.show" | "runtime.probe" | "secret.request" | "secret.set.confirm" | "secret.set.preview" | "session.adopt.confirm" | "session.adopt.preview" | "session.agent-permission.confirm" | "session.agent-permission.preview" | "session.archive" | "session.command.confirm" | "session.command.list" | "session.command.preview" | "session.command.send" | "session.create" | "session.detach.confirm" | "session.detach.preview" | "session.diff" | "session.events.list" | "session.fork.confirm" | "session.fork.preview" | "session.git.status" | "session.history.read" | "session.inbox.ack" | "session.inbox.check" | "session.list" | "session.message.send" | "session.observe" | "session.pause.confirm" | "session.pause.preview" | "session.placement.show" | "session.rename" | "session.resume" | "session.setup.confirm" | "session.setup.preview" | "session.show" | "session.spawn-caps.confirm" | "session.spawn-caps.preview" | "session.spawn-caps.show" | "session.spawn.confirm" | "session.spawn.preview" | "session.spawn.record" | "session.start" | "session.stop" | "session.switch.confirm" | "session.switch.preview" | "session.wait" | "skills.sync.confirm" | "skills.sync.preview" | "skills.sync.show" | "team-workspace.bootstrap.apply" | "team-workspace.bootstrap.preview" | "terminal.controller.acquire" | "terminal.controller.release" | "terminal.controller.renew" | "terminal.controller.request" | "terminal.controller.request.show" | "terminal.create" | "terminal.events.list" | "terminal.input.write" | "terminal.list" | "terminal.mutation.reconcile" | "terminal.observer.attach" | "terminal.observer.check" | "terminal.observer.detach" | "terminal.observer.resync" | "terminal.read" | "terminal.session.close" | "terminal.session.delete" | "terminal.session.resize" | "terminal.session.restart" | "terminal.session.signal" | "terminal.show" | "turn.attachment.policy" | "turn.cancel" | "turn.interrupt" | "turn.queue.list" | "turn.send" | "turn.show" | "turn.steer.confirm" | "turn.steer.preview" | "turn.wait" | "voice.managed-turn.confirm" | "voice.managed-turn.preview" | "voice.orchestrator.context.show" | "voice.orchestrator.tool.call" | "voice.pi.relay" | "voice.pi.relay.preview" | "voice.pi.relay.reconcile" | "webhooks.change.confirm" | "webhooks.change.preview" | "webhooks.deliveries" | "webhooks.list" | "workspace.branches.list" | "workspace.code-host.show" | "workspace.context.show" | "workspace.execution.configure" | "workspace.execution.show" | "workspace.list" | "workspace.membership.attach" | "workspace.repository.attach" | "workspace.select" | "workspace.show")[];
|
|
63
71
|
readonly revision: "1";
|
|
64
72
|
};
|
|
65
73
|
readonly method: "session.agent-permission.confirm";
|
|
@@ -70,6 +78,7 @@ export declare const makeSessionClient: (node: CliNodeOperations) => {
|
|
|
70
78
|
readonly createdAt: string;
|
|
71
79
|
readonly eventCursor: string;
|
|
72
80
|
readonly method: string;
|
|
81
|
+
readonly proposedBy?: string | undefined;
|
|
73
82
|
readonly receiptId: string;
|
|
74
83
|
readonly schemaVersion: 1;
|
|
75
84
|
readonly state: "succeeded";
|
|
@@ -96,7 +105,7 @@ export declare const makeSessionClient: (node: CliNodeOperations) => {
|
|
|
96
105
|
readonly inputDigest: string;
|
|
97
106
|
readonly issuedAt: string;
|
|
98
107
|
readonly method: "session.agent-permission.preview";
|
|
99
|
-
readonly operationIds: readonly ("agents.change.confirm" | "agents.change.preview" | "agents.list" | "agents.show" | "approval.list" | "approval.respond" | "approval.show" | "connection.capacity.set" | "connection.create" | "connection.detect" | "connection.gateway.create" | "connection.grant.list" | "connection.grant.set.confirm" | "connection.grant.set.preview" | "connection.list" | "connection.login.start" | "connection.models.list" | "connection.pool.list" | "connection.pool.set.confirm" | "connection.pool.set.preview" | "connection.show" | "connection.state.set" | "connection.system.confirm" | "connection.system.preview" | "connection.upkeep.confirm" | "connection.upkeep.preview" | "connection.upkeep.refresh" | "connection.usage.show" | "container.create.confirm" | "container.create.preview" | "container.index.list" | "container.list" | "container.rename.confirm" | "container.rename.preview" | "container.show" | "context.show" | "discovery.sessions.list" | "execution.catalog.get" | "execution.checkpoint.create" | "execution.checkpoint.show" | "execution.command.run" | "execution.file.read" | "execution.placement.create" | "execution.placement.show" | "execution.relocation.apply" | "execution.relocation.plan" | "execution.relocation.reconcile" | "execution.relocation.show" | "execution.worktree.create" | "execution.worktree.import" | "execution.worktree.reconcile" | "execution.worktree.remove.apply" | "execution.worktree.remove.plan" | "execution.worktree.status" | "harness.installed.list" | "hold.list" | "hold.place.confirm" | "hold.place.preview" | "hold.release.confirm" | "hold.release.preview" | "integration.apply.claude-code" | "integration.apply.codex" | "integration.apply.pi-rpc" | "integration.plan.claude-code" | "integration.plan.codex" | "integration.plan.pi-rpc" | "integration.remove.claude-code" | "integration.remove.codex" | "integration.remove.pi-rpc" | "integration.status.claude-code" | "integration.status.codex" | "integration.status.pi-rpc" | "interaction.cancel" | "interaction.create" | "interaction.list" | "interaction.respond" | "interaction.show" | "monitor.bootstrap.create" | "node.remote.install.confirm" | "node.remote.install.preview" | "node.remote.list" | "node.remote.register.confirm" | "node.remote.register.preview" | "node.remote.remove.confirm" | "node.remote.remove.preview" | "node.shutdown" | "node.status" | "port.lease.acquire" | "port.lease.list" | "port.lease.release" | "port.lease.renew" | "presentation.catalog.show" | "presentation.project-list.show" | "presentation.session-list.show" | "presentation.workspace-directory.show" | "project.context.list" | "project.context.record" | "project.context.show" | "project.create.confirm" | "project.create.preview" | "project.guard.confirm" | "project.guard.preview" | "project.guard.show" | "project.list" | "project.register" | "project.rename.confirm" | "project.rename.preview" | "project.show" | "provider.pool.list" | "receipt.get" | "receipt.list" | "reference.resolve" | "routine.create.confirm" | "routine.create.preview" | "routine.disable.confirm" | "routine.disable.preview" | "routine.list" | "routine.pause" | "routine.resume" | "routine.run.confirm" | "routine.run.preview" | "routine.show" | "run.create" | "run.dispatch.settle-terminal" | "run.dispatch.show" | "run.inbox.ack" | "run.inbox.check" | "run.ledger.create" | "run.ledger.list" | "run.ledger.task.dispatch" | "run.ledger.task.list" | "run.ledger.task.settle" | "run.ledger.task.show" | "run.list" | "run.question.cancel" | "run.question.open" | "run.question.reply" | "run.show" | "run.task.list" | "run.task.show" | "runtime.probe" | "session.adopt.confirm" | "session.adopt.preview" | "session.agent-permission.confirm" | "session.agent-permission.preview" | "session.archive" | "session.create" | "session.diff" | "session.events.list" | "session.history.read" | "session.inbox.ack" | "session.inbox.check" | "session.list" | "session.message.send" | "session.observe" | "session.rename" | "session.resume" | "session.show" | "session.spawn" | "session.start" | "session.stop" | "team-workspace.bootstrap.apply" | "team-workspace.bootstrap.preview" | "terminal.controller.acquire" | "terminal.controller.release" | "terminal.controller.renew" | "terminal.controller.request" | "terminal.controller.request.show" | "terminal.create" | "terminal.events.list" | "terminal.input.write" | "terminal.list" | "terminal.mutation.reconcile" | "terminal.observer.attach" | "terminal.observer.check" | "terminal.observer.detach" | "terminal.observer.resync" | "terminal.read" | "terminal.session.close" | "terminal.session.delete" | "terminal.session.resize" | "terminal.session.restart" | "terminal.session.signal" | "terminal.show" | "turn.cancel" | "turn.interrupt" | "turn.queue.list" | "turn.send" | "turn.show" | "turn.wait" | "voice.managed-turn.confirm" | "voice.managed-turn.preview" | "voice.orchestrator.context.show" | "voice.orchestrator.tool.call" | "voice.pi.relay" | "voice.pi.relay.preview" | "voice.pi.relay.reconcile" | "workspace.context.show" | "workspace.execution.configure" | "workspace.execution.show" | "workspace.list" | "workspace.membership.attach" | "workspace.repository.attach" | "workspace.select" | "workspace.show")[];
|
|
108
|
+
readonly operationIds: readonly ("agents.change.confirm" | "agents.change.preview" | "agents.detect" | "agents.list" | "agents.show" | "approval.list" | "approval.respond" | "approval.show" | "board.message.post" | "board.message.reply" | "board.path.read" | "board.task.assign" | "board.task.cancel" | "board.task.claim" | "board.task.complete" | "board.task.create" | "board.task.fail" | "board.task.list" | "board.task.needs.replace" | "board.task.plan" | "board.task.promote" | "board.task.release" | "board.task.renew" | "board.task.reopen" | "board.task.show" | "board.thread.show" | "connection.capacity.set" | "connection.create" | "connection.detect" | "connection.executors.list" | "connection.executors.show" | "connection.gateway.create" | "connection.github.create" | "connection.github.revoke" | "connection.github.show" | "connection.grant.list" | "connection.grant.set.confirm" | "connection.grant.set.preview" | "connection.list" | "connection.login.start" | "connection.models.list" | "connection.pool.list" | "connection.pool.set.confirm" | "connection.pool.set.preview" | "connection.show" | "connection.state.set" | "connection.system.confirm" | "connection.system.preview" | "connection.upkeep.confirm" | "connection.upkeep.preview" | "connection.upkeep.refresh" | "connection.usage.show" | "container.create.confirm" | "container.create.preview" | "container.index.list" | "container.list" | "container.rename.confirm" | "container.rename.preview" | "container.show" | "context.show" | "discovery.sessions.list" | "events.read" | "execution.catalog.get" | "execution.checkpoint.create" | "execution.checkpoint.show" | "execution.command.run" | "execution.file.read" | "execution.placement.create" | "execution.placement.show" | "execution.relocation.apply" | "execution.relocation.plan" | "execution.relocation.reconcile" | "execution.relocation.show" | "execution.worktree.create" | "execution.worktree.import" | "execution.worktree.reconcile" | "execution.worktree.remove.apply" | "execution.worktree.remove.plan" | "execution.worktree.status" | "goal.clear" | "goal.mark" | "goal.set" | "goal.show" | "goal.transition" | "goal.update" | "harness.installed.list" | "hold.list" | "hold.place.confirm" | "hold.place.preview" | "hold.release.confirm" | "hold.release.preview" | "inbox.list" | "inbox.respond" | "inbox.settle" | "inbox.show" | "inbox.snooze" | "integration.apply.antigravity" | "integration.apply.claude-code" | "integration.apply.codex" | "integration.apply.maia-agent" | "integration.apply.pi" | "integration.apply.pi-rpc" | "integration.plan.antigravity" | "integration.plan.claude-code" | "integration.plan.codex" | "integration.plan.maia-agent" | "integration.plan.pi" | "integration.plan.pi-rpc" | "integration.remove.antigravity" | "integration.remove.claude-code" | "integration.remove.codex" | "integration.remove.maia-agent" | "integration.remove.pi" | "integration.remove.pi-rpc" | "integration.status.antigravity" | "integration.status.claude-code" | "integration.status.codex" | "integration.status.maia-agent" | "integration.status.pi" | "integration.status.pi-rpc" | "interaction.cancel" | "interaction.create" | "interaction.list" | "interaction.respond" | "interaction.show" | "monitor.bootstrap.create" | "node.pairing.confirm" | "node.pairing.preview" | "node.pairing.redeem" | "node.pairing.show" | "node.principal.confirm" | "node.principal.preview" | "node.principal.show" | "node.reach.confirm" | "node.reach.preview" | "node.reach.show" | "node.remote.install.confirm" | "node.remote.install.preview" | "node.remote.list" | "node.remote.register.confirm" | "node.remote.register.preview" | "node.remote.remove.confirm" | "node.remote.remove.preview" | "node.shutdown" | "node.status" | "node.update.apply.confirm" | "node.update.apply.preview" | "node.update.check" | "node.update.pause" | "node.update.policy.get" | "node.update.policy.set" | "node.update.resume" | "node.update.rollback.confirm" | "node.update.rollback.preview" | "node.update.show" | "node.update.status" | "port.lease.acquire" | "port.lease.list" | "port.lease.release" | "port.lease.renew" | "pr.link" | "pr.status" | "pr.watch" | "presentation.catalog.show" | "presentation.project-list.show" | "presentation.session-list.show" | "presentation.workspace-directory.show" | "project.context.list" | "project.context.record" | "project.context.show" | "project.create.confirm" | "project.create.preview" | "project.guard.confirm" | "project.guard.preview" | "project.guard.show" | "project.instructions.change.confirm" | "project.instructions.change.preview" | "project.instructions.show" | "project.knowledge.add.chunk" | "project.knowledge.add.commit" | "project.knowledge.add.confirm" | "project.knowledge.add.preview" | "project.knowledge.list" | "project.knowledge.remove.confirm" | "project.knowledge.remove.preview" | "project.knowledge.search" | "project.list" | "project.register" | "project.rename.confirm" | "project.rename.preview" | "project.show" | "provider.pool.list" | "receipt.get" | "receipt.list" | "reference.resolve" | "routine.create.confirm" | "routine.create.preview" | "routine.disable.confirm" | "routine.disable.preview" | "routine.list" | "routine.move.confirm" | "routine.move.preview" | "routine.pause" | "routine.resume" | "routine.run.confirm" | "routine.run.preview" | "routine.runs" | "routine.show" | "routine.trigger.create.confirm" | "routine.trigger.create.preview" | "routine.trigger.disable" | "routine.trigger.list" | "routine.update.confirm" | "routine.update.preview" | "run.create" | "run.dispatch.settle-terminal" | "run.dispatch.show" | "run.inbox.ack" | "run.inbox.check" | "run.ledger.create" | "run.ledger.list" | "run.ledger.task.dispatch" | "run.ledger.task.list" | "run.ledger.task.settle" | "run.ledger.task.show" | "run.list" | "run.question.cancel" | "run.question.open" | "run.question.reply" | "run.show" | "run.task.list" | "run.task.show" | "runtime.probe" | "secret.request" | "secret.set.confirm" | "secret.set.preview" | "session.adopt.confirm" | "session.adopt.preview" | "session.agent-permission.confirm" | "session.agent-permission.preview" | "session.archive" | "session.command.confirm" | "session.command.list" | "session.command.preview" | "session.command.send" | "session.create" | "session.detach.confirm" | "session.detach.preview" | "session.diff" | "session.events.list" | "session.fork.confirm" | "session.fork.preview" | "session.git.status" | "session.history.read" | "session.inbox.ack" | "session.inbox.check" | "session.list" | "session.message.send" | "session.observe" | "session.pause.confirm" | "session.pause.preview" | "session.placement.show" | "session.rename" | "session.resume" | "session.setup.confirm" | "session.setup.preview" | "session.show" | "session.spawn-caps.confirm" | "session.spawn-caps.preview" | "session.spawn-caps.show" | "session.spawn.confirm" | "session.spawn.preview" | "session.spawn.record" | "session.start" | "session.stop" | "session.switch.confirm" | "session.switch.preview" | "session.wait" | "skills.sync.confirm" | "skills.sync.preview" | "skills.sync.show" | "team-workspace.bootstrap.apply" | "team-workspace.bootstrap.preview" | "terminal.controller.acquire" | "terminal.controller.release" | "terminal.controller.renew" | "terminal.controller.request" | "terminal.controller.request.show" | "terminal.create" | "terminal.events.list" | "terminal.input.write" | "terminal.list" | "terminal.mutation.reconcile" | "terminal.observer.attach" | "terminal.observer.check" | "terminal.observer.detach" | "terminal.observer.resync" | "terminal.read" | "terminal.session.close" | "terminal.session.delete" | "terminal.session.resize" | "terminal.session.restart" | "terminal.session.signal" | "terminal.show" | "turn.attachment.policy" | "turn.cancel" | "turn.interrupt" | "turn.queue.list" | "turn.send" | "turn.show" | "turn.steer.confirm" | "turn.steer.preview" | "turn.wait" | "voice.managed-turn.confirm" | "voice.managed-turn.preview" | "voice.orchestrator.context.show" | "voice.orchestrator.tool.call" | "voice.pi.relay" | "voice.pi.relay.preview" | "voice.pi.relay.reconcile" | "webhooks.change.confirm" | "webhooks.change.preview" | "webhooks.deliveries" | "webhooks.list" | "workspace.branches.list" | "workspace.code-host.show" | "workspace.context.show" | "workspace.execution.configure" | "workspace.execution.show" | "workspace.list" | "workspace.membership.attach" | "workspace.repository.attach" | "workspace.select" | "workspace.show")[];
|
|
100
109
|
readonly proof: string;
|
|
101
110
|
}>;
|
|
102
111
|
attachSession: (input: import("./attach-client.js").AttachSessionInput) => CliNodeEffect<import("./attach-client.js").SessionAttachStream>;
|
|
@@ -122,13 +131,15 @@ export declare const makeSessionClient: (node: CliNodeOperations) => {
|
|
|
122
131
|
readonly stallAfterSeconds?: number;
|
|
123
132
|
}) => CliNodeEffect<SessionObserveResult>;
|
|
124
133
|
planSessions: (input: SessionCreationInput) => CliNodeEffect<SessionCreationPlan>;
|
|
125
|
-
resumeSession: (input:
|
|
126
|
-
runSessions: (plan: SessionCreationPlan
|
|
134
|
+
resumeSession: (input: ResumeSessionInput) => CliNodeEffect<SessionResumeResult>;
|
|
135
|
+
runSessions: (plan: SessionCreationPlan, options?: {
|
|
136
|
+
readonly until?: "created";
|
|
137
|
+
}) => CliNodeEffect<readonly SessionCreationOutcome[]>;
|
|
127
138
|
sendAttachedSessionMessage: (input: SendAttachedSessionMessageInput) => CliNodeEffect<SessionMessageSendResult>;
|
|
128
139
|
showSession: (sessionId: string) => CliNodeEffect<SessionShowResult>;
|
|
129
|
-
spawnSession: (input: SpawnSessionInput) => CliNodeEffect<SessionSpawnResult>;
|
|
130
140
|
startSession: (input: StartSessionInput) => CliNodeEffect<SessionStartResult>;
|
|
131
141
|
stopSession: (input: StartSessionInput) => CliNodeEffect<SessionStopResult>;
|
|
142
|
+
waitSession: (input: WaitSessionInput) => CliNodeEffect<SessionWaitResult>;
|
|
132
143
|
};
|
|
133
144
|
export {};
|
|
134
145
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/session/client.js
CHANGED
|
@@ -1,20 +1,44 @@
|
|
|
1
|
-
import { sessionCreateParametersSchema, sessionEventsListParametersSchema, sessionInboxAckParametersSchema, sessionInboxCheckParametersSchema, sessionListParametersSchema, sessionMessageSendParametersSchema, sessionObserveParametersSchema, sessionResumeParametersSchema, sessionShowParametersSchema,
|
|
1
|
+
import { MAX_SESSION_WAIT_MILLISECONDS, sessionCreateParametersSchema, sessionEventsListParametersSchema, sessionInboxAckParametersSchema, sessionInboxCheckParametersSchema, sessionListParametersSchema, sessionMessageSendParametersSchema, sessionObserveParametersSchema, sessionResumeParametersSchema, sessionShowParametersSchema, sessionStartParametersSchema, sessionStopParametersSchema, sessionWaitParametersSchema, } from "@maiaos/sdk";
|
|
2
2
|
import * as Crypto from "effect/Crypto";
|
|
3
3
|
import * as Effect from "effect/Effect";
|
|
4
4
|
import { makeRelocateClient } from "../execution/index.js";
|
|
5
|
-
import { commandIdentifier, } from "../local-node/index.js";
|
|
5
|
+
import { commandIdentifier, nodeAnswerOf, repeatBoundedWait, } from "../local-node/index.js";
|
|
6
6
|
import { makeAgentPermissionCliClient } from "./agent-permission.js";
|
|
7
7
|
import { makeAttachClient } from "./attach-client.js";
|
|
8
8
|
import { makeCodingSessionClient } from "./coding-client.js";
|
|
9
|
+
import { toWorktreeRequest } from "./creation/index.js";
|
|
10
|
+
const keepingWords = (client, said) => {
|
|
11
|
+
const keep = (commandId, step) => Effect.tapError(step, (error) => Effect.sync(() => {
|
|
12
|
+
const answer = nodeAnswerOf(error);
|
|
13
|
+
if (answer !== undefined)
|
|
14
|
+
said.set(commandId, answer.message);
|
|
15
|
+
}));
|
|
16
|
+
return {
|
|
17
|
+
createSession: (parameters, options) => keep(parameters.commandId, client.createSession(parameters, options)),
|
|
18
|
+
listWorkspaces: (parameters, options) => client.listWorkspaces(parameters, options),
|
|
19
|
+
sendTurn: (parameters, options) => keep(parameters.commandId, client.sendTurn(parameters, options)),
|
|
20
|
+
showSession: (parameters, options) => client.showSession(parameters, options),
|
|
21
|
+
startSession: (parameters, options) => keep(parameters.commandId, client.startSession(parameters, options)),
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
const withWords = (outcome, said) => {
|
|
25
|
+
const { error } = outcome;
|
|
26
|
+
const message = error?.message === undefined && error?.commandId !== undefined
|
|
27
|
+
? said.get(error.commandId)
|
|
28
|
+
: undefined;
|
|
29
|
+
return error === undefined || message === undefined
|
|
30
|
+
? outcome
|
|
31
|
+
: { ...outcome, error: { ...error, message } };
|
|
32
|
+
};
|
|
9
33
|
export const makeSessionClient = (node) => {
|
|
10
34
|
const createSession = (input) => {
|
|
11
|
-
const { baseRef, commandId: requestedCommandId, ...selection } = input;
|
|
35
|
+
const { baseRef, branch, commandId: requestedCommandId, ...selection } = input;
|
|
12
36
|
return Effect.flatMap(commandIdentifier(requestedCommandId), (commandId) => {
|
|
13
37
|
return node.runValidatedNodeOperation({
|
|
14
38
|
...selection,
|
|
15
39
|
commandId,
|
|
16
40
|
expectedRevision: "0",
|
|
17
|
-
...(
|
|
41
|
+
...toWorktreeRequest({ baseRef, branch }),
|
|
18
42
|
}, sessionCreateParametersSchema, (client, parameters, options) => client.createSession(parameters, options), { commandId });
|
|
19
43
|
});
|
|
20
44
|
};
|
|
@@ -24,6 +48,20 @@ export const makeSessionClient = (node) => {
|
|
|
24
48
|
const showSession = (sessionId) => {
|
|
25
49
|
return node.runValidatedNodeOperation({ sessionId }, sessionShowParametersSchema, (client, parameters, options) => client.showSession(parameters, options));
|
|
26
50
|
};
|
|
51
|
+
const waitSessionOnce = (parameters) => node.runValidatedNodeOperation(parameters, sessionWaitParametersSchema, (client, validated, options) => client.waitSession(validated, options));
|
|
52
|
+
const waitSession = (input) => repeatBoundedWait({
|
|
53
|
+
maxRequestMilliseconds: MAX_SESSION_WAIT_MILLISECONDS,
|
|
54
|
+
once: (waitMilliseconds) => waitSessionOnce({
|
|
55
|
+
...(input.activities === undefined
|
|
56
|
+
? {}
|
|
57
|
+
: { activities: input.activities }),
|
|
58
|
+
sessionId: input.sessionId,
|
|
59
|
+
...(input.states === undefined ? {} : { states: input.states }),
|
|
60
|
+
waitMilliseconds,
|
|
61
|
+
}),
|
|
62
|
+
satisfied: (value) => value.satisfied,
|
|
63
|
+
timeoutMilliseconds: input.timeoutMilliseconds,
|
|
64
|
+
});
|
|
27
65
|
const observeSessions = (input) => node.runValidatedNodeOperation(input, sessionObserveParametersSchema, (client, parameters, options) => client.observeSessions(parameters, options));
|
|
28
66
|
const listSessionEvents = (input) => {
|
|
29
67
|
return node.runValidatedNodeOperation(input, sessionEventsListParametersSchema, (client, parameters, options) => client.listSessionEvents(parameters, options));
|
|
@@ -50,17 +88,6 @@ export const makeSessionClient = (node) => {
|
|
|
50
88
|
return node.runDiscoveryOperation((options) => Effect.promise(() => import("@maiaos/sdk/node/effect")).pipe(Effect.flatMap((sdk) => sdk.acknowledgeAttachedSessionDeliveryEffect(parameters, options))));
|
|
51
89
|
});
|
|
52
90
|
};
|
|
53
|
-
const spawnSession = (input) => {
|
|
54
|
-
return Effect.flatMap(commandIdentifier(input.commandId), (commandId) => {
|
|
55
|
-
return node.runValidatedNodeOperation({
|
|
56
|
-
commandId,
|
|
57
|
-
expectedRevision: "0",
|
|
58
|
-
harness: input.harness,
|
|
59
|
-
parentSessionId: input.parentSessionId,
|
|
60
|
-
workspaceId: input.workspaceId,
|
|
61
|
-
}, sessionSpawnParametersSchema, (client, parameters, options) => client.spawnSession(parameters, options), { commandId });
|
|
62
|
-
});
|
|
63
|
-
};
|
|
64
91
|
const startSession = (input) => {
|
|
65
92
|
return Effect.flatMap(commandIdentifier(input.commandId), (commandId) => {
|
|
66
93
|
return node.runValidatedNodeOperation({
|
|
@@ -80,17 +107,22 @@ export const makeSessionClient = (node) => {
|
|
|
80
107
|
});
|
|
81
108
|
};
|
|
82
109
|
const resumeSession = (input) => {
|
|
110
|
+
const supervised = input.parent === undefined ? {} : { parent: input.parent };
|
|
83
111
|
return Effect.flatMap(commandIdentifier(input.commandId), (commandId) => {
|
|
84
112
|
return node.runValidatedNodeOperation({
|
|
85
113
|
commandId,
|
|
86
114
|
expectedRevision: input.expectedRevision,
|
|
87
115
|
sessionId: input.sessionId,
|
|
88
|
-
|
|
116
|
+
...supervised,
|
|
117
|
+
}, sessionResumeParametersSchema, (client, { parent: _checked, ...parameters }, options) => client.resumeSession({ ...parameters, ...supervised }, options), { commandId });
|
|
89
118
|
});
|
|
90
119
|
};
|
|
91
120
|
const withSdk = (operation) => Effect.flatMap(Crypto.Crypto, (crypto) => node.runNodeClientOperation((client) => Effect.promise(() => import("@maiaos/sdk/node/effect")).pipe(Effect.flatMap((sdk) => operation(sdk, client)), Effect.provideService(Crypto.Crypto, crypto))));
|
|
92
121
|
const planSessions = (input) => withSdk((sdk, client) => sdk.planSessionCreationEffect(client, input));
|
|
93
|
-
const runSessions = (plan) => withSdk((sdk, client) =>
|
|
122
|
+
const runSessions = (plan, options) => withSdk((sdk, client) => {
|
|
123
|
+
const said = new Map();
|
|
124
|
+
return Effect.map(sdk.createSessionsEffect(keepingWords(client, said), plan, options), (outcomes) => outcomes.map((outcome) => withWords(outcome, said)));
|
|
125
|
+
});
|
|
94
126
|
const awaitSessionRunning = (input) => withSdk((sdk, client) => sdk.awaitSessionRunningEffect(client, input.sessionId, input.deadlineMilliseconds));
|
|
95
127
|
return {
|
|
96
128
|
acknowledgeAttachedSessionDelivery,
|
|
@@ -105,9 +137,9 @@ export const makeSessionClient = (node) => {
|
|
|
105
137
|
runSessions,
|
|
106
138
|
sendAttachedSessionMessage,
|
|
107
139
|
showSession,
|
|
108
|
-
spawnSession,
|
|
109
140
|
startSession,
|
|
110
141
|
stopSession,
|
|
142
|
+
waitSession,
|
|
111
143
|
...makeRelocateClient(node),
|
|
112
144
|
...makeAgentPermissionCliClient(node),
|
|
113
145
|
...makeCodingSessionClient(node),
|
|
@@ -8,6 +8,8 @@ export type ArchiveSessionInput = {
|
|
|
8
8
|
readonly commandId?: string;
|
|
9
9
|
readonly expectedRevision: string;
|
|
10
10
|
readonly sessionId: string;
|
|
11
|
+
readonly summary?: string;
|
|
12
|
+
readonly transcriptPath?: string;
|
|
11
13
|
};
|
|
12
14
|
export declare const makeCodingSessionClient: (node: CliNodeOperations) => {
|
|
13
15
|
archiveSession: (input: ArchiveSessionInput) => CliNodeEffect<SessionArchiveResult>;
|
|
@@ -3,9 +3,8 @@ import * as Effect from "effect/Effect";
|
|
|
3
3
|
import { commandIdentifier, } from "../local-node/index.js";
|
|
4
4
|
export const makeCodingSessionClient = (node) => ({
|
|
5
5
|
archiveSession: (input) => Effect.flatMap(commandIdentifier(input.commandId), (commandId) => node.runValidatedNodeOperation({
|
|
6
|
+
...input,
|
|
6
7
|
commandId,
|
|
7
|
-
expectedRevision: input.expectedRevision,
|
|
8
|
-
sessionId: input.sessionId,
|
|
9
8
|
}, sessionArchiveParametersSchema, (client, parameters, options) => client.archiveSession(parameters, options), { commandId })),
|
|
10
9
|
diffSession: (input) => node.runValidatedNodeOperation({
|
|
11
10
|
sessionId: input.sessionId,
|
|
@@ -29,19 +29,36 @@ const summarizeArchive = (result) => ({
|
|
|
29
29
|
revision: result.session.revision,
|
|
30
30
|
sessionId: result.session.id,
|
|
31
31
|
state: result.session.state,
|
|
32
|
+
...(result.summary === undefined ? {} : { summary: result.summary }),
|
|
33
|
+
...(result.transcriptPath === undefined
|
|
34
|
+
? {}
|
|
35
|
+
: { transcriptPath: result.transcriptPath }),
|
|
32
36
|
});
|
|
33
|
-
|
|
34
|
-
const parsed = parseOptions(tokens, new Set([
|
|
37
|
+
const readArchiveInput = (tokens) => {
|
|
38
|
+
const parsed = parseOptions(tokens, new Set([
|
|
39
|
+
"--command-id",
|
|
40
|
+
"--expected-revision",
|
|
41
|
+
"--summary",
|
|
42
|
+
"--transcript",
|
|
43
|
+
]));
|
|
35
44
|
requirePositionals(parsed.positionals, 1);
|
|
36
|
-
const { archiveSession } = context.dependencies;
|
|
37
|
-
if (archiveSession === undefined)
|
|
38
|
-
throw new CliArgumentError("Session archive is unavailable.");
|
|
39
45
|
const commandId = parsed.options.get("--command-id");
|
|
40
|
-
const
|
|
46
|
+
const summary = parsed.options.get("--summary");
|
|
47
|
+
const transcriptPath = parsed.options.get("--transcript");
|
|
48
|
+
return {
|
|
41
49
|
...(commandId === undefined ? {} : { commandId }),
|
|
42
50
|
expectedRevision: readExpectedRevision(parsed.options.get("--expected-revision")),
|
|
43
51
|
sessionId: requireSessionId(parsed.positionals),
|
|
44
|
-
|
|
52
|
+
...(summary === undefined ? {} : { summary }),
|
|
53
|
+
...(transcriptPath === undefined ? {} : { transcriptPath }),
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
export const runSessionArchive = (tokens, context) => Effect.gen(function* () {
|
|
57
|
+
const input = readArchiveInput(tokens);
|
|
58
|
+
const { archiveSession } = context.dependencies;
|
|
59
|
+
if (archiveSession === undefined)
|
|
60
|
+
throw new CliArgumentError("Session archive is unavailable.");
|
|
61
|
+
const result = yield* archiveSession(input);
|
|
45
62
|
return writeSessionResult(result, context, (value) => ({
|
|
46
63
|
command: "session.archive",
|
|
47
64
|
result: summarizeArchive(value),
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { sessionCommandConfirmParametersSchema, } from "@maiaos/sdk";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import { cell, fields, writeNodeResult, } from "../../command-line/emit/index.js";
|
|
4
|
+
import { CliArgumentError, parseOptionsWith, readOptionalRevision, requirePositionals, } from "../../command-line/input/index.js";
|
|
5
|
+
import { confirmParameters, readTwoPhaseMode, runTwoPhase, TWO_PHASE_FLAGS, } from "../../command-line/two-phase/index.js";
|
|
6
|
+
import { changeAtRevision, commandIdentifier, } from "../../local-node/index.js";
|
|
7
|
+
import { requirePipedAlone } from "../fork/index.js";
|
|
8
|
+
const UNAVAILABLE = "Session commands are unavailable.";
|
|
9
|
+
const wired = (context) => {
|
|
10
|
+
const { call } = context.dependencies;
|
|
11
|
+
if (call === undefined)
|
|
12
|
+
throw new CliArgumentError(UNAVAILABLE);
|
|
13
|
+
return call;
|
|
14
|
+
};
|
|
15
|
+
const listText = ({ commands, executor, harnessVersion }) => {
|
|
16
|
+
const heading = `${cell(executor)} ${cell(harnessVersion ?? "(no harness version)")}\n`;
|
|
17
|
+
const rows = commands.map((command) => command.class === "refused"
|
|
18
|
+
? `/${command.name}\trefused\t${command.reason}\t${command.operation ?? "-"}\n`
|
|
19
|
+
: `/${command.name}\t${command.class}\n`);
|
|
20
|
+
return heading + (rows.length === 0 ? "no commands\n" : rows.join(""));
|
|
21
|
+
};
|
|
22
|
+
const previewText = (preview) => fields([
|
|
23
|
+
["Session", preview.sessionId],
|
|
24
|
+
["Command", `/${preview.command}`],
|
|
25
|
+
["Arguments", preview.arguments],
|
|
26
|
+
["Class", preview.class],
|
|
27
|
+
["Command ID", preview.commandId],
|
|
28
|
+
["Revision", preview.expectedRevision],
|
|
29
|
+
["Valid until", preview.validUntil],
|
|
30
|
+
]);
|
|
31
|
+
const confirmedText = ({ class: kind, delivery, receipt, turn }) => fields([
|
|
32
|
+
["Session", turn.sessionId],
|
|
33
|
+
["Turn", turn.id],
|
|
34
|
+
["Class", kind],
|
|
35
|
+
["Delivery", delivery],
|
|
36
|
+
["Receipt", receipt.receiptId],
|
|
37
|
+
]);
|
|
38
|
+
const listed = {
|
|
39
|
+
toResult: (value) => ({ command: "session.command.list", result: value }),
|
|
40
|
+
toText: ({ result }) => listText(result),
|
|
41
|
+
};
|
|
42
|
+
const previewed = {
|
|
43
|
+
toResult: (value) => ({ command: "session.command.preview", result: value }),
|
|
44
|
+
toText: ({ result }) => previewText(result),
|
|
45
|
+
};
|
|
46
|
+
const confirmed = {
|
|
47
|
+
toResult: (value) => ({ command: "session.command.confirm", result: value }),
|
|
48
|
+
toText: ({ result }) => confirmedText(result),
|
|
49
|
+
};
|
|
50
|
+
export const runSessionCommandList = (tokens, context) => {
|
|
51
|
+
const parsed = parseOptionsWith(tokens, {
|
|
52
|
+
allowed: new Set(["--session"]),
|
|
53
|
+
allowedFlags: new Set(),
|
|
54
|
+
repeatable: new Set(),
|
|
55
|
+
});
|
|
56
|
+
requirePositionals(parsed.positionals, 0);
|
|
57
|
+
const sessionId = parsed.options.get("--session");
|
|
58
|
+
if (sessionId === undefined)
|
|
59
|
+
throw new CliArgumentError("Option '--session' is required.");
|
|
60
|
+
return Effect.map(wired(context)("session.command.list", { sessionId }), (result) => writeNodeResult(result, context, listed));
|
|
61
|
+
};
|
|
62
|
+
const previewCommand = (context, { options, positionals }) => {
|
|
63
|
+
requirePositionals(positionals, 2);
|
|
64
|
+
const [sessionId = "", command = ""] = positionals;
|
|
65
|
+
const named = readOptionalRevision(options);
|
|
66
|
+
const arguments_ = options.get("--arguments");
|
|
67
|
+
const call = wired(context);
|
|
68
|
+
const { showSession } = context.dependencies;
|
|
69
|
+
if (showSession === undefined)
|
|
70
|
+
throw new CliArgumentError(UNAVAILABLE);
|
|
71
|
+
return Effect.flatMap(commandIdentifier(options.get("--command-id")), (commandId) => changeAtRevision(named, {
|
|
72
|
+
change: (expectedRevision) => call("session.command.preview", {
|
|
73
|
+
...(arguments_ === undefined ? {} : { arguments: arguments_ }),
|
|
74
|
+
command: command.replace(/^\//u, ""),
|
|
75
|
+
commandId,
|
|
76
|
+
expectedRevision,
|
|
77
|
+
sessionId,
|
|
78
|
+
}),
|
|
79
|
+
read: () => showSession(sessionId),
|
|
80
|
+
revisionOf: ({ session }) => ({ ok: true, value: session.revision }),
|
|
81
|
+
}));
|
|
82
|
+
};
|
|
83
|
+
const SEND_OPTIONS = {
|
|
84
|
+
allowed: new Set(["--arguments", "--command-id", "--expected-revision"]),
|
|
85
|
+
allowedFlags: new Set(TWO_PHASE_FLAGS),
|
|
86
|
+
repeatable: new Set(),
|
|
87
|
+
};
|
|
88
|
+
export const runSessionCommandSend = (tokens, context) => {
|
|
89
|
+
const parsed = parseOptionsWith(tokens, SEND_OPTIONS);
|
|
90
|
+
const mode = readTwoPhaseMode(parsed.flags, context);
|
|
91
|
+
if (mode === "confirm-stdin")
|
|
92
|
+
requirePipedAlone(parsed, "Session, command and command ID");
|
|
93
|
+
const call = wired(context);
|
|
94
|
+
return runTwoPhase({
|
|
95
|
+
confirm: (preview) => Effect.flatMap(confirmParameters(sessionCommandConfirmParametersSchema, preview, [
|
|
96
|
+
"class",
|
|
97
|
+
]), (confirmation) => call("session.command.confirm", confirmation)),
|
|
98
|
+
context,
|
|
99
|
+
mode,
|
|
100
|
+
preview: () => previewCommand(context, parsed),
|
|
101
|
+
prompt: {
|
|
102
|
+
describe: previewText,
|
|
103
|
+
question: "Send this command to the Session's executor?",
|
|
104
|
+
},
|
|
105
|
+
writeConfirm: (result) => writeNodeResult(result, context, confirmed),
|
|
106
|
+
writePreview: (result) => writeNodeResult(result, context, previewed),
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
//# sourceMappingURL=commands.js.map
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { CliArgumentError, type CommandContext, type CommandEffect } from "../command-line/index.js";
|
|
2
3
|
export declare const runSessionCreate: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
3
4
|
export declare const runSessionList: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
5
|
+
export declare const runSessionPlacementShow: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
4
6
|
export declare const runSessionShow: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
7
|
+
export declare const runSessionWait: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
5
8
|
export declare const runSessionStart: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
6
9
|
export declare const runSessionStop: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
7
10
|
export declare const runSessionResume: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
11
|
+
export declare const runSessionReconcile: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
8
12
|
export declare const runSessionEventsList: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
9
13
|
export declare const runSessionObserve: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
10
14
|
export declare const runSessionMessageSend: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
11
15
|
export declare const runSessionInboxCheck: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
12
16
|
export declare const runSessionInboxAck: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
17
|
+
export declare const runSessionSpawn: (tokens: readonly string[], context: CommandContext) => Effect.Effect<number, CliArgumentError, import("effect/Crypto").Crypto>;
|
|
13
18
|
//# sourceMappingURL=commands.d.ts.map
|