@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
|
@@ -24,23 +24,33 @@ const projectStatusCapability = (capability) => ({
|
|
|
24
24
|
mode: capability.mode,
|
|
25
25
|
releaseQualified: capability.releaseQualified,
|
|
26
26
|
});
|
|
27
|
+
const projectProcessResources = (node) => ({
|
|
28
|
+
admission: projectStatusAdmission(node.processResources.admission),
|
|
29
|
+
capability: projectStatusCapability(node.processResources.capability),
|
|
30
|
+
nextStep: node.processResources.nextStep,
|
|
31
|
+
pressure: node.processResources.pressure,
|
|
32
|
+
warningTrees: sumObservationWarningTrees(node.processResources.observations),
|
|
33
|
+
});
|
|
27
34
|
export const projectStatusResult = (node) => ({
|
|
28
35
|
command: "status",
|
|
36
|
+
...(node.admissionCaps === undefined
|
|
37
|
+
? {}
|
|
38
|
+
: { admissionCaps: node.admissionCaps }),
|
|
29
39
|
...(node.executorHost === undefined
|
|
30
40
|
? {}
|
|
31
41
|
: { executorHost: node.executorHost }),
|
|
42
|
+
...(node.hostAuthority === undefined
|
|
43
|
+
? {}
|
|
44
|
+
: { hostAuthority: node.hostAuthority }),
|
|
32
45
|
instanceId: node.instanceId,
|
|
33
46
|
lifecycle: node.lifecycle,
|
|
34
47
|
pid: node.pid,
|
|
35
|
-
processResources:
|
|
36
|
-
admission: projectStatusAdmission(node.processResources.admission),
|
|
37
|
-
capability: projectStatusCapability(node.processResources.capability),
|
|
38
|
-
nextStep: node.processResources.nextStep,
|
|
39
|
-
pressure: node.processResources.pressure,
|
|
40
|
-
warningTrees: sumObservationWarningTrees(node.processResources.observations),
|
|
41
|
-
},
|
|
48
|
+
processResources: projectProcessResources(node),
|
|
42
49
|
profile: node.profile,
|
|
43
50
|
storage: {
|
|
51
|
+
...(node.storage.events === undefined
|
|
52
|
+
? {}
|
|
53
|
+
: { events: node.storage.events }),
|
|
44
54
|
integrity: node.storage.integrity,
|
|
45
55
|
journalMode: node.storage.journalMode,
|
|
46
56
|
schemaVersion: node.storage.schemaVersion,
|
|
@@ -10,6 +10,8 @@ const processResourceNextStep = (nextStep) => {
|
|
|
10
10
|
return "none";
|
|
11
11
|
case "run_node_in_delegated_cgroup":
|
|
12
12
|
return "restart the Node in a cgroup delegated to its user: a systemd user unit with Delegate=yes and DelegateSubgroup=node, or systemd-run --user -p Delegate=yes -p DelegateSubgroup=node";
|
|
13
|
+
case "upgrade_kernel":
|
|
14
|
+
return "upgrade the Linux kernel to 6.12 or newer";
|
|
13
15
|
case "verify_native_host":
|
|
14
16
|
return "verify the native process host";
|
|
15
17
|
}
|
|
@@ -73,12 +75,35 @@ const executorHostLines = (host) => {
|
|
|
73
75
|
userNamespaces[host.userNamespaces],
|
|
74
76
|
];
|
|
75
77
|
};
|
|
78
|
+
const days = (milliseconds) => {
|
|
79
|
+
const count = Math.floor(milliseconds / 86_400_000);
|
|
80
|
+
if (count < 1)
|
|
81
|
+
return "less than a day";
|
|
82
|
+
return count === 1 ? "1 day" : `${String(count)} days`;
|
|
83
|
+
};
|
|
84
|
+
const eventLines = (events) => events === undefined
|
|
85
|
+
? []
|
|
86
|
+
: [
|
|
87
|
+
...(events.oldestAgeMs === undefined
|
|
88
|
+
? []
|
|
89
|
+
: [`events: history reaches back ${days(events.oldestAgeMs)}`]),
|
|
90
|
+
...(events.excessBytes > 0
|
|
91
|
+
? [`events: ${String(events.excessBytes)} bytes over the size limit`]
|
|
92
|
+
: []),
|
|
93
|
+
...(events.checkpointBlocked === true
|
|
94
|
+
? ["events: checkpoint blocked"]
|
|
95
|
+
: []),
|
|
96
|
+
];
|
|
76
97
|
export const formatHumanStatus = ({ node }) => {
|
|
77
98
|
const lines = [
|
|
78
99
|
`profile: ${node.profile}`,
|
|
79
100
|
`pid: ${String(node.pid)}`,
|
|
80
101
|
`instance: ${node.instanceId}`,
|
|
81
102
|
`storage: ${node.storage.integrity} (${node.storage.journalMode})`,
|
|
103
|
+
...(node.hostAuthority === undefined
|
|
104
|
+
? []
|
|
105
|
+
: [`host authority: ${node.hostAuthority}`]),
|
|
106
|
+
...eventLines(node.storage.events),
|
|
82
107
|
...processResourceLines(node.processResources),
|
|
83
108
|
...executorHostLines(node.executorHost),
|
|
84
109
|
];
|
|
@@ -21,6 +21,7 @@ export declare const makeBootstrapClient: (node: CliNodeOperations) => {
|
|
|
21
21
|
readonly createdAt: string;
|
|
22
22
|
readonly eventCursor: string;
|
|
23
23
|
readonly method: string;
|
|
24
|
+
readonly proposedBy?: string | undefined;
|
|
24
25
|
readonly receiptId: string;
|
|
25
26
|
readonly schemaVersion: 1;
|
|
26
27
|
readonly state: "succeeded";
|
|
@@ -3,8 +3,19 @@ import { liveTerminalWriteParametersSchema, MAX_TERMINAL_INPUT_CHUNK_BYTES, } fr
|
|
|
3
3
|
import * as Effect from "effect/Effect";
|
|
4
4
|
import { CliArgumentError, parseOptions, requirePositionals, } from "../command-line/index.js";
|
|
5
5
|
import { readTerminalColumns, readTerminalControllerFence, readTerminalExpectedRevision, readTerminalGeneration, readTerminalInputSequence, readTerminalLeaseDuration, readTerminalRows, terminalControllerFenceOptionNames, } from "./arguments.js";
|
|
6
|
+
import { terminalInputBytes, UnknownKeyError } from "./keys.js";
|
|
6
7
|
import { writeTerminalResult } from "./output/index.js";
|
|
7
8
|
const optionNames = (...additional) => new Set([...terminalControllerFenceOptionNames, ...additional]);
|
|
9
|
+
const typedInputBytes = (options) => {
|
|
10
|
+
try {
|
|
11
|
+
return terminalInputBytes([...options].filter(([name]) => name === "--text" || name === "--keys"));
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
throw error instanceof UnknownKeyError
|
|
15
|
+
? new CliArgumentError(error.message)
|
|
16
|
+
: error;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
8
19
|
const commandId = (options) => {
|
|
9
20
|
const value = options.get("--command-id");
|
|
10
21
|
return value === undefined ? {} : { commandId: value };
|
|
@@ -99,15 +110,15 @@ export const runControllerAcquire = (tokens, context) => Effect.gen(function* ()
|
|
|
99
110
|
}));
|
|
100
111
|
});
|
|
101
112
|
const parseTerminalWriteOptions = (tokens) => {
|
|
102
|
-
const parsed = parseOptions(tokens, optionNames("--input-id", "--input-sequence"), new Set(["--input-stdin"]));
|
|
113
|
+
const parsed = parseOptions(tokens, optionNames("--input-id", "--input-sequence", "--keys", "--text"), new Set(["--input-stdin"]));
|
|
103
114
|
requirePositionals(parsed.positionals, 1);
|
|
104
|
-
|
|
105
|
-
|
|
115
|
+
const typed = parsed.options.has("--text") || parsed.options.has("--keys");
|
|
116
|
+
if (parsed.flags.has("--input-stdin") === typed) {
|
|
117
|
+
throw new CliArgumentError("Give the input as '--input-stdin' or as '--text' and '--keys', not both.");
|
|
106
118
|
}
|
|
107
119
|
return parsed;
|
|
108
120
|
};
|
|
109
|
-
const readTerminalWriteScope = (
|
|
110
|
-
const parsed = parseTerminalWriteOptions(tokens);
|
|
121
|
+
const readTerminalWriteScope = (parsed) => {
|
|
111
122
|
const terminalId = requiredTerminalId(parsed.positionals);
|
|
112
123
|
const inputId = parsed.options.get("--input-id");
|
|
113
124
|
if (inputId === undefined) {
|
|
@@ -146,14 +157,20 @@ const readTerminalInput = (context) => {
|
|
|
146
157
|
});
|
|
147
158
|
};
|
|
148
159
|
export const runTerminalInputWrite = (tokens, context) => Effect.gen(function* () {
|
|
149
|
-
const
|
|
150
|
-
const
|
|
151
|
-
|
|
160
|
+
const parsed = parseTerminalWriteOptions(tokens);
|
|
161
|
+
const scope = readTerminalWriteScope(parsed);
|
|
162
|
+
const bytes = parsed.flags.has("--input-stdin")
|
|
163
|
+
? Buffer.from(yield* readTerminalInput(context), "utf8")
|
|
164
|
+
: typedInputBytes(parsed.options);
|
|
165
|
+
if (bytes.length === 0) {
|
|
152
166
|
throw new CliArgumentError("Terminal input must not be empty.");
|
|
153
167
|
}
|
|
168
|
+
if (bytes.length > MAX_TERMINAL_INPUT_CHUNK_BYTES) {
|
|
169
|
+
throw new CliArgumentError(`Terminal input must be at most ${String(MAX_TERMINAL_INPUT_CHUNK_BYTES)} bytes.`);
|
|
170
|
+
}
|
|
154
171
|
const result = yield* context.dependencies.writeTerminalInput({
|
|
155
172
|
...scope,
|
|
156
|
-
bytesBase64:
|
|
173
|
+
bytesBase64: bytes.toString("base64"),
|
|
157
174
|
});
|
|
158
175
|
return writeTerminalResult(result, context, (value) => ({
|
|
159
176
|
command: "terminal.input.write",
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Buffer } from "node:buffer";
|
|
2
|
+
import { Data } from "effect";
|
|
3
|
+
const NAMED_KEYS = new Map([
|
|
4
|
+
["Backspace", "\u007F"],
|
|
5
|
+
["Delete", "\u001B[3~"],
|
|
6
|
+
["Down", "\u001B[B"],
|
|
7
|
+
["End", "\u001B[F"],
|
|
8
|
+
["Enter", "\r"],
|
|
9
|
+
["Escape", "\u001B"],
|
|
10
|
+
["F1", "\u001BOP"],
|
|
11
|
+
["F2", "\u001BOQ"],
|
|
12
|
+
["F3", "\u001BOR"],
|
|
13
|
+
["F4", "\u001BOS"],
|
|
14
|
+
["F5", "\u001B[15~"],
|
|
15
|
+
["F6", "\u001B[17~"],
|
|
16
|
+
["F7", "\u001B[18~"],
|
|
17
|
+
["F8", "\u001B[19~"],
|
|
18
|
+
["F9", "\u001B[20~"],
|
|
19
|
+
["F10", "\u001B[21~"],
|
|
20
|
+
["F11", "\u001B[23~"],
|
|
21
|
+
["F12", "\u001B[24~"],
|
|
22
|
+
["Home", "\u001B[H"],
|
|
23
|
+
["Insert", "\u001B[2~"],
|
|
24
|
+
["Left", "\u001B[D"],
|
|
25
|
+
["PageDown", "\u001B[6~"],
|
|
26
|
+
["PageUp", "\u001B[5~"],
|
|
27
|
+
["Right", "\u001B[C"],
|
|
28
|
+
["Space", " "],
|
|
29
|
+
["Tab", "\t"],
|
|
30
|
+
["Up", "\u001B[A"],
|
|
31
|
+
]);
|
|
32
|
+
export class UnknownKeyError extends Data.TaggedError("UnknownKeyError") {
|
|
33
|
+
}
|
|
34
|
+
export const TERMINAL_KEY_NAMES = [
|
|
35
|
+
...NAMED_KEYS.keys(),
|
|
36
|
+
"C-<a..z>",
|
|
37
|
+
"M-<char>",
|
|
38
|
+
];
|
|
39
|
+
const bytesOfKey = (name) => {
|
|
40
|
+
const named = NAMED_KEYS.get(name);
|
|
41
|
+
if (named !== undefined)
|
|
42
|
+
return named;
|
|
43
|
+
if (/^C-[a-z]$/u.test(name)) {
|
|
44
|
+
return String.fromCodePoint((name.codePointAt(2) ?? 0) - 0x60);
|
|
45
|
+
}
|
|
46
|
+
const alt = /^M-(\P{Cc})$/u.exec(name);
|
|
47
|
+
if (alt?.[1] !== undefined)
|
|
48
|
+
return `\u001B${alt[1]}`;
|
|
49
|
+
throw new UnknownKeyError({
|
|
50
|
+
message: `Unknown key '${name}'. Keys: ${TERMINAL_KEY_NAMES.join(", ")}.`,
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
export const terminalInputBytes = (parts) => Buffer.from([...parts]
|
|
54
|
+
.map(([option, value]) => option === "--text"
|
|
55
|
+
? value
|
|
56
|
+
: value
|
|
57
|
+
.split(/\s+/u)
|
|
58
|
+
.filter((name) => name !== "")
|
|
59
|
+
.map(bytesOfKey)
|
|
60
|
+
.join(""))
|
|
61
|
+
.join(""), "utf8");
|
|
62
|
+
//# sourceMappingURL=keys.js.map
|
|
@@ -132,6 +132,9 @@ export const projectTerminalEventsResult = (value, audience = "json") => ({
|
|
|
132
132
|
...(value.nextTerminalCursor === undefined
|
|
133
133
|
? {}
|
|
134
134
|
: { nextCursor: value.nextTerminalCursor }),
|
|
135
|
+
...(value.oldestRetainedCursor === undefined
|
|
136
|
+
? {}
|
|
137
|
+
: { oldestRetainedCursor: value.oldestRetainedCursor }),
|
|
135
138
|
terminalId: value.terminalId,
|
|
136
139
|
});
|
|
137
140
|
export const projectTerminalChunk = (chunk) => ({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cell, formatRows, jsonLine, writeNodeResult, } from "../../command-line/index.js";
|
|
1
|
+
import { cell, formatRows, jsonLine, withPrunedHistory, writeNodeResult, } from "../../command-line/index.js";
|
|
2
2
|
const isHumanLiveTerminal = (terminal) => terminal.state !== "unavailable" && "capability" in terminal;
|
|
3
3
|
const formatTerminalProjection = (terminal) => {
|
|
4
4
|
if (terminal.state === "unavailable") {
|
|
@@ -21,7 +21,7 @@ const formatTerminalEvent = (event) => {
|
|
|
21
21
|
}
|
|
22
22
|
return `${cell(event.cursor)}\t${cell(event.type)}`;
|
|
23
23
|
};
|
|
24
|
-
export const formatTerminalEvents = (result) => formatRows(result.items, formatTerminalEvent);
|
|
24
|
+
export const formatTerminalEvents = (result) => withPrunedHistory(formatRows(result.items, formatTerminalEvent), result.oldestRetainedCursor !== undefined);
|
|
25
25
|
export const formatTerminalRead = (result) => (result.gap === undefined
|
|
26
26
|
? ""
|
|
27
27
|
: `gap\t${result.gap.reason}\t${cell(result.gap.oldestAvailableCursor)}\n`) +
|
|
@@ -72,7 +72,7 @@ export const TERMINAL_TREE = {
|
|
|
72
72
|
{ route: "<terminal-id>", run: [terminal, "runControllerRelease"] },
|
|
73
73
|
],
|
|
74
74
|
[
|
|
75
|
-
"terminal input write <terminal-id> --input-stdin --input-id <id> --input-sequence <1..2147483647> --controller-id <id> --controller-epoch <epoch> --controller-revision <revision> --controller-expires-at <timestamp> --terminal-generation <1..65535> --expected-revision <revision> [--command-id <id>]",
|
|
75
|
+
"terminal input write <terminal-id> (--input-stdin | [--text <text>] [--keys <names>]) --input-id <id> --input-sequence <1..2147483647> --controller-id <id> --controller-epoch <epoch> --controller-revision <revision> --controller-expires-at <timestamp> --terminal-generation <1..65535> --expected-revision <revision> [--command-id <id>]",
|
|
76
76
|
1,
|
|
77
77
|
"terminal.input.write",
|
|
78
78
|
"Write input to a terminal you control.",
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as NodeFileSystem from "@effect/platform-node-shared/NodeFileSystem";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as FileSystem from "effect/FileSystem";
|
|
4
|
+
import { CliArgumentError } from "../command-line/input/index.js";
|
|
5
|
+
const READ_LIMIT_BYTES = 1024 * 1024;
|
|
6
|
+
const STDIN_CHUNKS = 1024;
|
|
7
|
+
const STDIN = "-";
|
|
8
|
+
const unreadable = (option) => new CliArgumentError(`Option '${option}' must name a readable file.`);
|
|
9
|
+
export const readTextFile = (path, option = "--file") => Effect.gen(function* () {
|
|
10
|
+
const fs = yield* FileSystem.FileSystem;
|
|
11
|
+
const info = yield* fs.stat(path);
|
|
12
|
+
if (info.type !== "File")
|
|
13
|
+
return yield* unreadable(option);
|
|
14
|
+
if (Number(info.size) > READ_LIMIT_BYTES)
|
|
15
|
+
return yield* new CliArgumentError(`Option '${option}' must name a file of at most ${String(READ_LIMIT_BYTES)} bytes.`);
|
|
16
|
+
const bytes = yield* fs.readFile(path);
|
|
17
|
+
return yield* Effect.try({
|
|
18
|
+
catch: () => new CliArgumentError(`Option '${option}' must name a UTF-8 file.`),
|
|
19
|
+
try: () => new TextDecoder("utf-8", { fatal: true }).decode(bytes),
|
|
20
|
+
});
|
|
21
|
+
}).pipe(Effect.catchTag("PlatformError", () => Effect.fail(unreadable(option))), Effect.provide(NodeFileSystem.layer));
|
|
22
|
+
export const readTextInput = (file, { stdin, stdinIsTerminal }, noun) => {
|
|
23
|
+
if (file !== undefined && file !== STDIN)
|
|
24
|
+
return readTextFile(file);
|
|
25
|
+
if (file === undefined && stdinIsTerminal === true)
|
|
26
|
+
return Effect.fail(new CliArgumentError(`Give the ${noun} with '--file <path>', or on standard input.`));
|
|
27
|
+
return stdin === undefined
|
|
28
|
+
? Effect.fail(new CliArgumentError("Standard input is unavailable."))
|
|
29
|
+
: stdin({
|
|
30
|
+
label: noun,
|
|
31
|
+
maxBytes: READ_LIMIT_BYTES,
|
|
32
|
+
maxChunks: STDIN_CHUNKS,
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=text-input.js.map
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { type WebhooksChangeConfirmParameters, type WebhooksChangePreviewParameters, type WebhooksDeliveriesParameters, type WebhooksListParameters } from "@maiaos/sdk";
|
|
2
|
+
import type { CliNodeOperations } from "../local-node/index.js";
|
|
3
|
+
export declare const makeWebhooksClient: (node: CliNodeOperations) => {
|
|
4
|
+
confirmWebhookChange: (input: WebhooksChangeConfirmParameters) => import("../local-node/client.js").CliNodeEffect<{
|
|
5
|
+
readonly actorId: string;
|
|
6
|
+
readonly commandId: string;
|
|
7
|
+
readonly delivery: "duplicate" | "new";
|
|
8
|
+
readonly deliveryId?: string | undefined;
|
|
9
|
+
readonly inputDigest: string;
|
|
10
|
+
readonly kind: "add" | "redeliver" | "remove" | "test";
|
|
11
|
+
readonly method: "webhooks.change.confirm";
|
|
12
|
+
readonly receipt: {
|
|
13
|
+
readonly actorId: string;
|
|
14
|
+
readonly aggregateRevision: string;
|
|
15
|
+
readonly commandId: string;
|
|
16
|
+
readonly createdAt: string;
|
|
17
|
+
readonly eventCursor: string;
|
|
18
|
+
readonly method: string;
|
|
19
|
+
readonly proposedBy?: string | undefined;
|
|
20
|
+
readonly receiptId: string;
|
|
21
|
+
readonly schemaVersion: 1;
|
|
22
|
+
readonly state: "succeeded";
|
|
23
|
+
readonly target: {
|
|
24
|
+
readonly id: string;
|
|
25
|
+
readonly type: string;
|
|
26
|
+
};
|
|
27
|
+
readonly updatedAt: string;
|
|
28
|
+
};
|
|
29
|
+
readonly webhook: {
|
|
30
|
+
readonly actorId: string;
|
|
31
|
+
readonly createdAt: string;
|
|
32
|
+
readonly droppedParked: number;
|
|
33
|
+
readonly gapOldest?: string | undefined;
|
|
34
|
+
readonly gapResets: number;
|
|
35
|
+
readonly id: string;
|
|
36
|
+
readonly lastErrorClass?: string | undefined;
|
|
37
|
+
readonly revision: string;
|
|
38
|
+
readonly schemaVersion: "maia.webhook/v1";
|
|
39
|
+
readonly spec: {
|
|
40
|
+
readonly allowPrivate: boolean;
|
|
41
|
+
readonly events: readonly ("admission.refused" | "approval.requested" | "approval.resolved" | "drift.raised" | "drift.settled" | "inbox.item.created" | "inbox.item.settled" | "node.health.changed" | "node.started" | "node.stopping" | "session.adopted" | "session.blocked" | "session.ended" | "session.idle" | "session.runtime.failed" | "session.started" | "session.turn.completed" | "session.turn.failed" | "session.working" | "update.done" | "webhook.test")[];
|
|
42
|
+
readonly filters: readonly {
|
|
43
|
+
readonly key: string;
|
|
44
|
+
readonly value: string;
|
|
45
|
+
}[];
|
|
46
|
+
readonly url: string;
|
|
47
|
+
readonly secretEnv: string;
|
|
48
|
+
};
|
|
49
|
+
readonly state: "active" | "removed";
|
|
50
|
+
readonly updatedAt: string;
|
|
51
|
+
};
|
|
52
|
+
}>;
|
|
53
|
+
listWebhookDeliveries: (input: WebhooksDeliveriesParameters) => import("../local-node/client.js").CliNodeEffect<{
|
|
54
|
+
readonly items: readonly {
|
|
55
|
+
readonly attempts: number;
|
|
56
|
+
readonly createdAt: string;
|
|
57
|
+
readonly errorClass?: string | undefined;
|
|
58
|
+
readonly eventId: string;
|
|
59
|
+
readonly id: string;
|
|
60
|
+
readonly kind: "admission.refused" | "approval.requested" | "approval.resolved" | "drift.raised" | "drift.settled" | "inbox.item.created" | "inbox.item.settled" | "node.health.changed" | "node.started" | "node.stopping" | "session.adopted" | "session.blocked" | "session.ended" | "session.idle" | "session.runtime.failed" | "session.started" | "session.turn.completed" | "session.turn.failed" | "session.working" | "update.done" | "webhook.test";
|
|
61
|
+
readonly nextAttemptAt?: string | undefined;
|
|
62
|
+
readonly state: "dead" | "delivered" | "denied" | "expired" | "in_flight" | "pending" | "retry";
|
|
63
|
+
readonly updatedAt: string;
|
|
64
|
+
readonly webhookId: string;
|
|
65
|
+
}[];
|
|
66
|
+
readonly method: "webhooks.deliveries";
|
|
67
|
+
readonly nextCursor?: string | undefined;
|
|
68
|
+
}>;
|
|
69
|
+
listWebhooks: (input: WebhooksListParameters) => import("../local-node/client.js").CliNodeEffect<{
|
|
70
|
+
readonly items: readonly {
|
|
71
|
+
readonly actorId: string;
|
|
72
|
+
readonly createdAt: string;
|
|
73
|
+
readonly droppedParked: number;
|
|
74
|
+
readonly gapOldest?: string | undefined;
|
|
75
|
+
readonly gapResets: number;
|
|
76
|
+
readonly id: string;
|
|
77
|
+
readonly lastErrorClass?: string | undefined;
|
|
78
|
+
readonly revision: string;
|
|
79
|
+
readonly schemaVersion: "maia.webhook/v1";
|
|
80
|
+
readonly spec: {
|
|
81
|
+
readonly allowPrivate: boolean;
|
|
82
|
+
readonly events: readonly ("admission.refused" | "approval.requested" | "approval.resolved" | "drift.raised" | "drift.settled" | "inbox.item.created" | "inbox.item.settled" | "node.health.changed" | "node.started" | "node.stopping" | "session.adopted" | "session.blocked" | "session.ended" | "session.idle" | "session.runtime.failed" | "session.started" | "session.turn.completed" | "session.turn.failed" | "session.working" | "update.done" | "webhook.test")[];
|
|
83
|
+
readonly filters: readonly {
|
|
84
|
+
readonly key: string;
|
|
85
|
+
readonly value: string;
|
|
86
|
+
}[];
|
|
87
|
+
readonly url: string;
|
|
88
|
+
readonly secretEnv: string;
|
|
89
|
+
};
|
|
90
|
+
readonly state: "active" | "removed";
|
|
91
|
+
readonly updatedAt: string;
|
|
92
|
+
}[];
|
|
93
|
+
readonly method: "webhooks.list";
|
|
94
|
+
readonly nextCursor?: string | undefined;
|
|
95
|
+
}>;
|
|
96
|
+
previewWebhookChange: (input: WebhooksChangePreviewParameters) => import("../local-node/client.js").CliNodeEffect<{
|
|
97
|
+
readonly change: {
|
|
98
|
+
readonly kind: "add";
|
|
99
|
+
readonly spec: {
|
|
100
|
+
readonly allowPrivate: boolean;
|
|
101
|
+
readonly events: readonly ("admission.refused" | "approval.requested" | "approval.resolved" | "drift.raised" | "drift.settled" | "inbox.item.created" | "inbox.item.settled" | "node.health.changed" | "node.started" | "node.stopping" | "session.adopted" | "session.blocked" | "session.ended" | "session.idle" | "session.runtime.failed" | "session.started" | "session.turn.completed" | "session.turn.failed" | "session.working" | "update.done" | "webhook.test")[];
|
|
102
|
+
readonly filters: readonly {
|
|
103
|
+
readonly key: string;
|
|
104
|
+
readonly value: string;
|
|
105
|
+
}[];
|
|
106
|
+
readonly url: string;
|
|
107
|
+
readonly secretEnv: string;
|
|
108
|
+
};
|
|
109
|
+
} | {
|
|
110
|
+
readonly expectedRevision: string;
|
|
111
|
+
readonly webhookId: string;
|
|
112
|
+
readonly kind: "remove";
|
|
113
|
+
} | {
|
|
114
|
+
readonly expectedRevision: string;
|
|
115
|
+
readonly webhookId: string;
|
|
116
|
+
readonly kind: "test";
|
|
117
|
+
} | {
|
|
118
|
+
readonly deliveryId: string;
|
|
119
|
+
readonly expectedRevision: string;
|
|
120
|
+
readonly kind: "redeliver";
|
|
121
|
+
};
|
|
122
|
+
readonly commandId: string;
|
|
123
|
+
readonly inputDigest: string;
|
|
124
|
+
readonly proof: string;
|
|
125
|
+
readonly actorId: string;
|
|
126
|
+
readonly current?: {
|
|
127
|
+
readonly actorId: string;
|
|
128
|
+
readonly createdAt: string;
|
|
129
|
+
readonly droppedParked: number;
|
|
130
|
+
readonly gapOldest?: string | undefined;
|
|
131
|
+
readonly gapResets: number;
|
|
132
|
+
readonly id: string;
|
|
133
|
+
readonly lastErrorClass?: string | undefined;
|
|
134
|
+
readonly revision: string;
|
|
135
|
+
readonly schemaVersion: "maia.webhook/v1";
|
|
136
|
+
readonly spec: {
|
|
137
|
+
readonly allowPrivate: boolean;
|
|
138
|
+
readonly events: readonly ("admission.refused" | "approval.requested" | "approval.resolved" | "drift.raised" | "drift.settled" | "inbox.item.created" | "inbox.item.settled" | "node.health.changed" | "node.started" | "node.stopping" | "session.adopted" | "session.blocked" | "session.ended" | "session.idle" | "session.runtime.failed" | "session.started" | "session.turn.completed" | "session.turn.failed" | "session.working" | "update.done" | "webhook.test")[];
|
|
139
|
+
readonly filters: readonly {
|
|
140
|
+
readonly key: string;
|
|
141
|
+
readonly value: string;
|
|
142
|
+
}[];
|
|
143
|
+
readonly url: string;
|
|
144
|
+
readonly secretEnv: string;
|
|
145
|
+
};
|
|
146
|
+
readonly state: "active" | "removed";
|
|
147
|
+
readonly updatedAt: string;
|
|
148
|
+
} | undefined;
|
|
149
|
+
readonly deletesDeliveries?: number | undefined;
|
|
150
|
+
readonly expiresAt: string;
|
|
151
|
+
readonly issuedAt: string;
|
|
152
|
+
readonly method: "webhooks.change.preview";
|
|
153
|
+
readonly webhookId: string;
|
|
154
|
+
}>;
|
|
155
|
+
};
|
|
156
|
+
export type WebhooksCliDependencies = ReturnType<typeof makeWebhooksClient>;
|
|
157
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { webhooksChangeConfirmParametersSchema, webhooksChangePreviewParametersSchema, webhooksDeliveriesParametersSchema, webhooksListParametersSchema, } from "@maiaos/sdk";
|
|
2
|
+
export const makeWebhooksClient = (node) => ({
|
|
3
|
+
confirmWebhookChange: (input) => node.runValidatedNodeOperation(input, webhooksChangeConfirmParametersSchema, (client, parameters, options) => client.confirmWebhookChange(parameters, options), { commandId: input.commandId }),
|
|
4
|
+
listWebhookDeliveries: (input) => node.runValidatedNodeOperation(input, webhooksDeliveriesParametersSchema, (client, parameters, options) => client.listWebhookDeliveries(parameters, options)),
|
|
5
|
+
listWebhooks: (input) => node.runValidatedNodeOperation(input, webhooksListParametersSchema, (client, parameters, options) => client.listWebhooks(parameters, options)),
|
|
6
|
+
previewWebhookChange: (input) => node.runValidatedNodeOperation(input, webhooksChangePreviewParametersSchema, (client, parameters, options) => client.previewWebhookChange(parameters, options)),
|
|
7
|
+
});
|
|
8
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type * as Crypto from "effect/Crypto";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import { type OutputContext } from "../command-line/emit/index.js";
|
|
4
|
+
import { CliArgumentError } from "../command-line/input/index.js";
|
|
5
|
+
import type { WebhooksCliDependencies } from "./client.js";
|
|
6
|
+
type CommandContext = OutputContext & {
|
|
7
|
+
readonly dependencies: WebhooksCliDependencies;
|
|
8
|
+
};
|
|
9
|
+
type CommandEffect = Effect.Effect<number, CliArgumentError, Crypto.Crypto>;
|
|
10
|
+
export declare const runWebhooksList: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
11
|
+
export declare const runWebhooksDeliveries: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
12
|
+
export declare const runWebhooksAdd: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
13
|
+
export declare const runWebhooksRemove: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
14
|
+
export declare const runWebhooksTest: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
15
|
+
export declare const runWebhooksRedeliver: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { webhooksChangeConfirmParametersSchema, } from "@maiaos/sdk";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import { writeNodeResult, } from "../command-line/emit/index.js";
|
|
4
|
+
import { CliArgumentError, parseOptionsWith, requirePositionals, } from "../command-line/input/index.js";
|
|
5
|
+
import { confirmParameters, readTwoPhaseMode, runTwoPhase, } from "../command-line/two-phase/index.js";
|
|
6
|
+
import { readAddChange, readRedeliverChange, readRemoveChange, readTestChange, readWebhooksDeliveries, readWebhooksList, WEBHOOK_OPTIONS, } from "./input.js";
|
|
7
|
+
import { formatWebhooksResult } from "./output/index.js";
|
|
8
|
+
const write = (context) => (result) => writeNodeResult(result, context, {
|
|
9
|
+
toResult: (value) => ({ command: value.method, result: value }),
|
|
10
|
+
toText: formatWebhooksResult,
|
|
11
|
+
});
|
|
12
|
+
const unavailable = () => Effect.die(new Error("Missing webhooks client."));
|
|
13
|
+
export const runWebhooksList = (tokens, context) => Effect.gen(function* () {
|
|
14
|
+
const list = context.dependencies.listWebhooks;
|
|
15
|
+
if (list === undefined)
|
|
16
|
+
return yield* unavailable();
|
|
17
|
+
return write(context)(yield* list(readWebhooksList(tokens)));
|
|
18
|
+
});
|
|
19
|
+
export const runWebhooksDeliveries = (tokens, context) => Effect.gen(function* () {
|
|
20
|
+
const list = context.dependencies.listWebhookDeliveries;
|
|
21
|
+
if (list === undefined)
|
|
22
|
+
return yield* unavailable();
|
|
23
|
+
return write(context)(yield* list(readWebhooksDeliveries(tokens)));
|
|
24
|
+
});
|
|
25
|
+
const describe = (preview) => formatWebhooksResult({ command: preview.method, result: preview });
|
|
26
|
+
const confirmOwnKind = (kind, confirm) => (preview) => Effect.flatMap(confirmParameters(webhooksChangeConfirmParametersSchema, preview, [
|
|
27
|
+
"current",
|
|
28
|
+
"deletesDeliveries",
|
|
29
|
+
"webhookId",
|
|
30
|
+
]), (parameters) => parameters.change.kind === kind
|
|
31
|
+
? confirm(parameters)
|
|
32
|
+
: Effect.fail(new CliArgumentError(`The piped preview is a ${parameters.change.kind} change; confirm it with 'maia webhooks ${parameters.change.kind} --confirm-stdin'.`)));
|
|
33
|
+
const runChange = (tokens, context, spec) => Effect.gen(function* () {
|
|
34
|
+
const parsed = parseOptionsWith(tokens, spec.options);
|
|
35
|
+
const mode = readTwoPhaseMode(parsed.flags, context);
|
|
36
|
+
if (mode === "confirm-stdin")
|
|
37
|
+
requirePositionals(parsed.positionals, 0);
|
|
38
|
+
const { confirmWebhookChange, previewWebhookChange } = context.dependencies;
|
|
39
|
+
if (confirmWebhookChange === undefined ||
|
|
40
|
+
previewWebhookChange === undefined)
|
|
41
|
+
return yield* new CliArgumentError("Webhook changes are unavailable.");
|
|
42
|
+
return yield* runTwoPhase({
|
|
43
|
+
confirm: confirmOwnKind(spec.kind, confirmWebhookChange),
|
|
44
|
+
context,
|
|
45
|
+
mode,
|
|
46
|
+
preview: () => Effect.flatMap(spec.read(parsed), previewWebhookChange),
|
|
47
|
+
prompt: { describe, question: spec.question },
|
|
48
|
+
writeConfirm: write(context),
|
|
49
|
+
writePreview: write(context),
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
export const runWebhooksAdd = (tokens, context) => runChange(tokens, context, {
|
|
53
|
+
kind: "add",
|
|
54
|
+
options: WEBHOOK_OPTIONS.add,
|
|
55
|
+
question: "Add this webhook?",
|
|
56
|
+
read: readAddChange,
|
|
57
|
+
});
|
|
58
|
+
export const runWebhooksRemove = (tokens, context) => runChange(tokens, context, {
|
|
59
|
+
kind: "remove",
|
|
60
|
+
options: WEBHOOK_OPTIONS.remove,
|
|
61
|
+
question: "Remove this webhook and its deliveries?",
|
|
62
|
+
read: readRemoveChange,
|
|
63
|
+
});
|
|
64
|
+
export const runWebhooksTest = (tokens, context) => runChange(tokens, context, {
|
|
65
|
+
kind: "test",
|
|
66
|
+
options: WEBHOOK_OPTIONS.test,
|
|
67
|
+
question: "Send a test event to this webhook?",
|
|
68
|
+
read: readTestChange,
|
|
69
|
+
});
|
|
70
|
+
export const runWebhooksRedeliver = (tokens, context) => runChange(tokens, context, {
|
|
71
|
+
kind: "redeliver",
|
|
72
|
+
options: WEBHOOK_OPTIONS.redeliver,
|
|
73
|
+
question: "Send this delivery again?",
|
|
74
|
+
read: readRedeliverChange,
|
|
75
|
+
});
|
|
76
|
+
//# sourceMappingURL=commands.js.map
|