@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
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { MAX_AGENT_PAGE_SIZE, MAX_DISCOVERY_PAGE_SIZE, MAX_DISCOVERY_WINDOW_DAYS, remoteNodeRegisterPreviewParametersSchema, routineCreatePreviewParametersSchema, } from "@maiaos/sdk";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import { SOURCES } from "../import/batch/index.js";
|
|
4
|
+
import { classify, listLive, readyOf } from "../routine/portable/index.js";
|
|
5
|
+
import { ask, CREATE, held, idOf, listedIn, named, pages, planned, skip, } from "./item.js";
|
|
6
|
+
const skips = (items, reference) => named(items, reference)?.action === "skip";
|
|
7
|
+
const projectDecision = (live) => ({ name, path }) => {
|
|
8
|
+
if (path === undefined)
|
|
9
|
+
return skip("A Project registers from a folder on the Node's machine: give 'path'.");
|
|
10
|
+
return live.some((item) => item.name === name)
|
|
11
|
+
? skip("A Project of this name exists; the plan cannot tell whether it is the same repository.")
|
|
12
|
+
: CREATE;
|
|
13
|
+
};
|
|
14
|
+
export const planProjects = (context, projects) => Effect.flatMap(projects.length === 0
|
|
15
|
+
? Effect.succeed([])
|
|
16
|
+
: pages((afterCursor = "0") => ask(context.dependencies.listProjects?.({ afterCursor, limit: 100 }))), (live) => Effect.map(planned(context, ["projects", projects], projectDecision(live)), (items) => items.map(listedIn(live.map(({ id }) => id)))));
|
|
17
|
+
const perProject = (references, projects, read) => Effect.map(Effect.forEach([
|
|
18
|
+
...new Set(references.flatMap((reference) => idOf(named(projects, reference)) ?? [])),
|
|
19
|
+
], (projectId) => Effect.map(read(projectId), (live) => [projectId, live])), (entries) => new Map(entries));
|
|
20
|
+
const idsOf = (lives) => [...lives.values()].flatMap((live) => live.map(({ id }) => id));
|
|
21
|
+
const active = ({ state }) => state === "active";
|
|
22
|
+
const agentsOf = (context) => (projectId) => pages((afterCursor) => ask(context.dependencies.listAgents?.({
|
|
23
|
+
...(afterCursor === undefined ? {} : { afterCursor }),
|
|
24
|
+
limit: MAX_AGENT_PAGE_SIZE,
|
|
25
|
+
projectId,
|
|
26
|
+
})));
|
|
27
|
+
const activeIn = (lives) => idsOf(new Map([...lives].map(([project, live]) => [project, live.filter(active)])));
|
|
28
|
+
const agentDecision = (projects, lives) => ({ executor, instructions, name, project }) => {
|
|
29
|
+
if (project === undefined)
|
|
30
|
+
return skip("An Agent lives in a Project: give 'project'.");
|
|
31
|
+
if (executor === undefined)
|
|
32
|
+
return skip("An Agent names its executor: give 'executor'.");
|
|
33
|
+
const home = idOf(named(projects, project));
|
|
34
|
+
const same = (lives.get(home ?? "") ?? []).filter(({ spec }) => spec.name === name);
|
|
35
|
+
const match = same.find((live) => active(live) &&
|
|
36
|
+
live.spec.instruction === instructions &&
|
|
37
|
+
live.spec.harness === executor);
|
|
38
|
+
if (match !== undefined)
|
|
39
|
+
return held(match.id, "name");
|
|
40
|
+
return same.length === 0
|
|
41
|
+
? CREATE
|
|
42
|
+
: skip("An Agent of this name is disabled, or holds another instruction or executor.");
|
|
43
|
+
};
|
|
44
|
+
export const planAgents = (context, agents, projects) => {
|
|
45
|
+
const personas = agents.map(({ memory: _memory, ...persona }) => persona);
|
|
46
|
+
return Effect.flatMap(perProject(personas.map(({ project }) => project), projects, agentsOf(context)), (lives) => Effect.map(planned(context, ["agents", personas, ({ project }) => skips(projects, project)], agentDecision(projects, lives)), (items) => items.map(listedIn(activeIn(lives)))));
|
|
47
|
+
};
|
|
48
|
+
const homeOf = ({ agent, executor, name, project }, { agents, projects }, lives) => {
|
|
49
|
+
if (agent === undefined && executor === undefined)
|
|
50
|
+
return skip("A routine names who runs it: give 'agent' or 'executor'.");
|
|
51
|
+
const projectId = idOf(named(projects, project));
|
|
52
|
+
if (projectId === undefined)
|
|
53
|
+
return CREATE;
|
|
54
|
+
const live = lives.get(projectId) ?? [];
|
|
55
|
+
const agentId = idOf(named(agents, agent));
|
|
56
|
+
if (agent === undefined)
|
|
57
|
+
return { live, projectId };
|
|
58
|
+
if (agentId !== undefined)
|
|
59
|
+
return { agentId, live, projectId };
|
|
60
|
+
return live.some((item) => item.name === name)
|
|
61
|
+
? skip("A live routine has this name, and its Agent is still to create.")
|
|
62
|
+
: CREATE;
|
|
63
|
+
};
|
|
64
|
+
const inputOf = ({ enabled, executor, name, prompt, schedule }, commandId, { agentId, projectId }) => routineCreatePreviewParametersSchema.safeParse({
|
|
65
|
+
commandId,
|
|
66
|
+
name,
|
|
67
|
+
...(enabled === false ? { paused: true } : {}),
|
|
68
|
+
schedule,
|
|
69
|
+
template: {
|
|
70
|
+
...(agentId === undefined ? { executor } : { agentId }),
|
|
71
|
+
projectId,
|
|
72
|
+
prompt,
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
const liveDecision = (draft, live) => {
|
|
76
|
+
const { entry } = classify(draft, live);
|
|
77
|
+
if (entry.action === "create")
|
|
78
|
+
return CREATE;
|
|
79
|
+
return entry.action === "unchanged" && entry.routineId !== undefined
|
|
80
|
+
? held(entry.routineId, "name")
|
|
81
|
+
: skip(entry.error?.message ?? "A live routine has this name.");
|
|
82
|
+
};
|
|
83
|
+
const routineDecision = (context, plans, lives) => (routine, commandId) => {
|
|
84
|
+
const home = homeOf(routine, plans, lives);
|
|
85
|
+
if ("action" in home)
|
|
86
|
+
return home;
|
|
87
|
+
const input = inputOf(routine, commandId, home);
|
|
88
|
+
return input.success
|
|
89
|
+
? liveDecision(readyOf(context, { input: input.data, name: routine.name }), home.live)
|
|
90
|
+
: skip("The routine does not fit a Node routine: check its name, executor and prompt.");
|
|
91
|
+
};
|
|
92
|
+
export const planRoutines = (context, routines, plans) => Effect.flatMap(perProject(routines.map(({ project }) => project), plans.projects, (projectId) => ask(listLive(context, projectId))), (lives) => Effect.map(planned(context, [
|
|
93
|
+
"routines",
|
|
94
|
+
routines,
|
|
95
|
+
({ agent, project }) => skips(plans.projects, project) || skips(plans.agents, agent),
|
|
96
|
+
], routineDecision(context, plans, lives)), (items) => items.map(listedIn(idsOf(lives)))));
|
|
97
|
+
const INCOMPLETE = skip("The Node did not list every native session, so the plan cannot place this one: plan again.");
|
|
98
|
+
const nativeDecision = (pointer, { complete, listed }) => {
|
|
99
|
+
const match = listed.find(({ executor, nativeId }) => executor === pointer.executor && nativeId === pointer.nativeId);
|
|
100
|
+
if (match?.adoptedSessionId !== undefined)
|
|
101
|
+
return held(match.adoptedSessionId, "native-id");
|
|
102
|
+
if (match !== undefined)
|
|
103
|
+
return CREATE;
|
|
104
|
+
return complete
|
|
105
|
+
? skip(`The Node does not list this native session among those of the last ${String(MAX_DISCOVERY_WINDOW_DAYS)} days.`)
|
|
106
|
+
: INCOMPLETE;
|
|
107
|
+
};
|
|
108
|
+
const sessionDecision = (listing) => ({ project, transcript }) => {
|
|
109
|
+
if ("location" in transcript)
|
|
110
|
+
return skip("No importer reads a transcript file yet.");
|
|
111
|
+
return project === undefined
|
|
112
|
+
? skip("An adoption runs in the Workspace of a Project: give 'project'.")
|
|
113
|
+
: nativeDecision(transcript, listing);
|
|
114
|
+
};
|
|
115
|
+
const natives = (context) => Effect.map(pages((cursor) => Effect.map(ask(context.dependencies.listDiscoveredSessions?.({
|
|
116
|
+
...(cursor === undefined ? {} : { cursor }),
|
|
117
|
+
limit: MAX_DISCOVERY_PAGE_SIZE,
|
|
118
|
+
sinceDays: MAX_DISCOVERY_WINDOW_DAYS,
|
|
119
|
+
sources: SOURCES,
|
|
120
|
+
})), ({ nextCursor, ...page }) => ({
|
|
121
|
+
items: [page],
|
|
122
|
+
...(nextCursor === undefined ? {} : { nextCursor }),
|
|
123
|
+
}))), (listed) => ({
|
|
124
|
+
complete: listed.every(({ sourceErrors, truncatedSources = [] }) => sourceErrors.length === 0 && truncatedSources.length === 0),
|
|
125
|
+
listed: listed.flatMap(({ items }) => items),
|
|
126
|
+
}));
|
|
127
|
+
const adoptedIn = ({ listed }) => listed.flatMap(({ adoptedSessionId }) => adoptedSessionId ?? []);
|
|
128
|
+
export const planSessions = (context, sessions, projects) => Effect.flatMap(sessions.some(({ transcript }) => "executor" in transcript)
|
|
129
|
+
? natives(context)
|
|
130
|
+
: Effect.succeed({ complete: true, listed: [] }), (listing) => Effect.map(planned(context, ["sessions", sessions, ({ project }) => skips(projects, project)], sessionDecision(listing)), (items) => items.map(listedIn(adoptedIn(listing), listing.complete ? undefined : INCOMPLETE))));
|
|
131
|
+
const ready = ({ state }) => state === "ready";
|
|
132
|
+
const NOT_READY = skip("The registry holds a remote Node of this name that is not ready.");
|
|
133
|
+
const hostDecision = (local, nodes) => ({ name, reach }, commandId) => {
|
|
134
|
+
if (!local)
|
|
135
|
+
return skip("A host registers on this machine's Node: plan it without '--node'.");
|
|
136
|
+
if (reach.transport !== "ssh")
|
|
137
|
+
return skip("A Node reaches another machine over ssh.");
|
|
138
|
+
const host = reach.address;
|
|
139
|
+
const input = { commandId, host, name };
|
|
140
|
+
if (!remoteNodeRegisterPreviewParametersSchema.safeParse(input).success)
|
|
141
|
+
return skip("The host does not fit a remote Node: check its name and address.");
|
|
142
|
+
const match = nodes.find((node) => node.name === name);
|
|
143
|
+
if (match === undefined)
|
|
144
|
+
return CREATE;
|
|
145
|
+
if (!ready(match))
|
|
146
|
+
return NOT_READY;
|
|
147
|
+
return match.host === host
|
|
148
|
+
? held(name, "name")
|
|
149
|
+
: skip("A remote Node of this name is registered at another address.");
|
|
150
|
+
};
|
|
151
|
+
export const planHosts = (context, hosts) => {
|
|
152
|
+
const local = context.node === undefined;
|
|
153
|
+
const registered = local && hosts.length > 0
|
|
154
|
+
? Effect.map(ask(context.dependencies.listRemoteNodes?.({})), ({ nodes }) => nodes)
|
|
155
|
+
: Effect.succeed([]);
|
|
156
|
+
return Effect.flatMap(registered, (nodes) => Effect.map(planned(context, ["hosts", hosts], hostDecision(local, nodes)), (items) => items.map(listedIn(nodes.filter(ready).map(({ name }) => name)))));
|
|
157
|
+
};
|
|
158
|
+
//# sourceMappingURL=classes.js.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { resolve } from "node:path";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import { cell, reportError, writeSuccess } from "../command-line/emit/index.js";
|
|
4
|
+
import { CliArgumentError, parseOptions, requirePositionals, } from "../command-line/input/index.js";
|
|
5
|
+
import { readManifestFile } from "../import/batch/index.js";
|
|
6
|
+
import { MAX_MIGRATION_BYTES, parseMigrationFile } from "./format.js";
|
|
7
|
+
import { PLAN_CLASSES, planMigration } from "./plan.js";
|
|
8
|
+
const line = (...cells) => cells.map(cell).join("\t");
|
|
9
|
+
const NO_MATCH = "no match found; the Node may still refuse";
|
|
10
|
+
const noteOf = (item) => {
|
|
11
|
+
if (item.action === "exists")
|
|
12
|
+
return `${item.id} by ${item.matchedBy}`;
|
|
13
|
+
return item.action === "skip" ? item.reason : NO_MATCH;
|
|
14
|
+
};
|
|
15
|
+
const formatPlan = ({ result: { classes, digest, node }, }) => [
|
|
16
|
+
...PLAN_CLASSES.flatMap((kind) => {
|
|
17
|
+
const { create, exists, items, notImportable, skip } = classes[kind];
|
|
18
|
+
return items.length === 0
|
|
19
|
+
? []
|
|
20
|
+
: [
|
|
21
|
+
line(kind, String(items.length), notImportable === undefined
|
|
22
|
+
? `create ${String(create)}, exists ${String(exists)}, skip ${String(skip)}`
|
|
23
|
+
: `not importable yet: ${notImportable.reason}`),
|
|
24
|
+
...items.map((item) => line("", item.action, item.sourceId, item.contentHash, noteOf(item))),
|
|
25
|
+
];
|
|
26
|
+
}),
|
|
27
|
+
line("digest", digest, `Node ${node.name}`, node.instanceId),
|
|
28
|
+
"",
|
|
29
|
+
].join("\n");
|
|
30
|
+
const readFrom = (tokens) => {
|
|
31
|
+
const parsed = parseOptions(tokens, new Set(["--from"]));
|
|
32
|
+
requirePositionals(parsed.positionals, 0);
|
|
33
|
+
const from = parsed.options.get("--from");
|
|
34
|
+
if (from === undefined)
|
|
35
|
+
throw new CliArgumentError("Option '--from' is required.");
|
|
36
|
+
return from;
|
|
37
|
+
};
|
|
38
|
+
export const runMigratePlan = (tokens, context) => Effect.gen(function* () {
|
|
39
|
+
const from = resolve(context.io.cwd ?? process.cwd(), readFrom(tokens));
|
|
40
|
+
const file = yield* Effect.flatMap(readManifestFile(from, MAX_MIGRATION_BYTES), parseMigrationFile);
|
|
41
|
+
return yield* planMigration(file, context).pipe(Effect.map((result) => {
|
|
42
|
+
writeSuccess({ command: "migrate.plan", result }, context, formatPlan);
|
|
43
|
+
return 0;
|
|
44
|
+
}), Effect.catch((error) => Effect.sync(() => reportError(error, context))));
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=commands.js.map
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { routineScheduleSchema, secretNameSchema } from "@maiaos/sdk";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Predicate from "effect/Predicate";
|
|
4
|
+
import * as Schema from "effect/Schema";
|
|
5
|
+
import { CliArgumentError } from "../command-line/input/index.js";
|
|
6
|
+
import { issuesOf } from "../routine/portable/index.js";
|
|
7
|
+
export const MIGRATION_SCHEMA = "maia.migration/v1";
|
|
8
|
+
export const MAX_MIGRATION_BYTES = 1024 * 1024;
|
|
9
|
+
export const MAX_MIGRATION_ITEMS = 64;
|
|
10
|
+
const text = (maximum) => Schema.String.check(Schema.isMinLength(1), Schema.isMaxLength(maximum));
|
|
11
|
+
const list = (item) => Schema.optionalKey(Schema.Array(item).check(Schema.isMaxLength(MAX_MIGRATION_ITEMS)));
|
|
12
|
+
const sourceId = Schema.String.check(Schema.isPattern(/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/u));
|
|
13
|
+
const name = text(160);
|
|
14
|
+
const instant = Schema.String.check(Schema.isPattern(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?(?:Z|[+-]\d{2}:\d{2})$/u), Schema.makeFilter((value) => !Number.isNaN(Date.parse(value))));
|
|
15
|
+
const taken = (parser) => Schema.makeFilter((value) => parser.safeParse(value).success);
|
|
16
|
+
const secretName = Schema.String.check(Schema.isPattern(/^(?![\s\S]*[A-Za-z0-9]{17})(?!(?:\D*\d){9})/u), taken(secretNameSchema));
|
|
17
|
+
const credential = Schema.Struct({ secret: secretName }).pipe(Schema.annotate({
|
|
18
|
+
description: "A credential by the name of a secret, never its value: the importing person stores the value with `maia secret`.",
|
|
19
|
+
}));
|
|
20
|
+
const USER = String.raw `(?![A-Za-z0-9._-]*[A-Za-z0-9]{17})[A-Za-z_][A-Za-z0-9._-]{0,31}@`;
|
|
21
|
+
const HOST = String.raw `[A-Za-z0-9][A-Za-z0-9.-]{0,252}(?::\d{1,5})?`;
|
|
22
|
+
const SEGMENTS = "[A-Za-z0-9._~/-]";
|
|
23
|
+
const remote = Schema.String.check(Schema.isMaxLength(2048), Schema.isPattern(new RegExp(`^(?:(?:https?|git)://${HOST}(?:/${SEGMENTS}*)?|ssh://(?:${USER})?${HOST}(?:/${SEGMENTS}*)?|${USER}${HOST}:${SEGMENTS}+)$`, "u")));
|
|
24
|
+
const address = Schema.String.check(Schema.isMaxLength(255), Schema.isPattern(new RegExp(`^(?:${USER})?${HOST}$`, "u")));
|
|
25
|
+
const NO_CLIMB = String.raw `(?![\s\S]*(?:^|/)\.\.(?:/|$))`;
|
|
26
|
+
const path = (start) => Schema.String.check(Schema.isMaxLength(4096), Schema.isPattern(new RegExp(`^${NO_CLIMB}${start}`, "u")));
|
|
27
|
+
const absolutePath = path("/");
|
|
28
|
+
const relativePath = path("[^/]");
|
|
29
|
+
const project = Schema.Struct({
|
|
30
|
+
credential: Schema.optionalKey(credential),
|
|
31
|
+
defaultBranch: Schema.optionalKey(text(255)),
|
|
32
|
+
name,
|
|
33
|
+
path: Schema.optionalKey(absolutePath),
|
|
34
|
+
remote: Schema.optionalKey(remote),
|
|
35
|
+
sourceId,
|
|
36
|
+
}).pipe(Schema.annotate({
|
|
37
|
+
description: "A project and its repository: a folder on the Node's machine (`path`, absolute), a remote, or both.",
|
|
38
|
+
}));
|
|
39
|
+
const memory = Schema.Struct({
|
|
40
|
+
createdAt: Schema.optionalKey(instant),
|
|
41
|
+
sourceId,
|
|
42
|
+
text: text(16_384),
|
|
43
|
+
});
|
|
44
|
+
const agent = Schema.Struct({
|
|
45
|
+
executor: Schema.optionalKey(text(64)),
|
|
46
|
+
instructions: text(16_384),
|
|
47
|
+
memory: list(memory),
|
|
48
|
+
name,
|
|
49
|
+
project: Schema.optionalKey(sourceId),
|
|
50
|
+
sourceId,
|
|
51
|
+
}).pipe(Schema.annotate({
|
|
52
|
+
description: "An agent or persona: its instructions, the project it works in, the executor that runs it, and what it remembers.",
|
|
53
|
+
}));
|
|
54
|
+
const schedule = Schema.Union([
|
|
55
|
+
Schema.Struct({ expression: Schema.String, timezone: Schema.String }),
|
|
56
|
+
Schema.Struct({ everyMinutes: Schema.Int, startsAt: Schema.String }),
|
|
57
|
+
Schema.Struct({ at: Schema.String }),
|
|
58
|
+
Schema.Struct({ event: Schema.String }),
|
|
59
|
+
])
|
|
60
|
+
.check(taken(routineScheduleSchema))
|
|
61
|
+
.pipe(Schema.annotate({
|
|
62
|
+
description: "A schedule as a Maia routine takes one: a cron `expression` in a `timezone`, `everyMinutes` from `startsAt`, one time `at`, or an `event` kind. An instant is UTC with milliseconds.",
|
|
63
|
+
}));
|
|
64
|
+
const routine = Schema.Struct({
|
|
65
|
+
agent: Schema.optionalKey(sourceId),
|
|
66
|
+
enabled: Schema.optionalKey(Schema.Boolean),
|
|
67
|
+
executor: Schema.optionalKey(text(64)),
|
|
68
|
+
name,
|
|
69
|
+
project: sourceId,
|
|
70
|
+
prompt: text(65_536),
|
|
71
|
+
schedule,
|
|
72
|
+
sourceId,
|
|
73
|
+
}).pipe(Schema.annotate({
|
|
74
|
+
description: "A scheduled prompt in a project, run by an agent of this file or by an executor.",
|
|
75
|
+
}));
|
|
76
|
+
const skill = Schema.Struct({
|
|
77
|
+
contentHash: Schema.String.check(Schema.isPattern(/^sha256:[0-9a-f]{64}$/u)),
|
|
78
|
+
credential: Schema.optionalKey(credential),
|
|
79
|
+
name,
|
|
80
|
+
source: Schema.Union([
|
|
81
|
+
Schema.Struct({ folder: relativePath }),
|
|
82
|
+
Schema.Struct({
|
|
83
|
+
path: Schema.optionalKey(relativePath),
|
|
84
|
+
repository: remote,
|
|
85
|
+
revision: Schema.optionalKey(text(255)),
|
|
86
|
+
}),
|
|
87
|
+
]),
|
|
88
|
+
sourceId,
|
|
89
|
+
}).pipe(Schema.annotate({
|
|
90
|
+
description: "A skill by reference, and the hash of its content: a `folder` relative to the folder of the migration file, or a `repository` with a `path` relative to its root.",
|
|
91
|
+
}));
|
|
92
|
+
const session = Schema.Struct({
|
|
93
|
+
endedAt: Schema.optionalKey(instant),
|
|
94
|
+
project: Schema.optionalKey(sourceId),
|
|
95
|
+
sourceId,
|
|
96
|
+
startedAt: Schema.optionalKey(instant),
|
|
97
|
+
title: Schema.optionalKey(text(256)),
|
|
98
|
+
transcript: Schema.Union([
|
|
99
|
+
Schema.Struct({ executor: text(64), nativeId: text(128) }),
|
|
100
|
+
Schema.Struct({ location: relativePath }),
|
|
101
|
+
]),
|
|
102
|
+
}).pipe(Schema.annotate({
|
|
103
|
+
description: "A pointer to one session's history, never the transcript: an executor's native session, or a transcript file at a `location` relative to the folder of the migration file.",
|
|
104
|
+
}));
|
|
105
|
+
const host = Schema.Struct({
|
|
106
|
+
name,
|
|
107
|
+
reach: Schema.Struct({
|
|
108
|
+
address,
|
|
109
|
+
credential: Schema.optionalKey(credential),
|
|
110
|
+
transport: text(32),
|
|
111
|
+
}),
|
|
112
|
+
role: Schema.optionalKey(text(64)),
|
|
113
|
+
sourceId,
|
|
114
|
+
}).pipe(Schema.annotate({
|
|
115
|
+
description: "A machine of the set-up and how another machine reaches it.",
|
|
116
|
+
}));
|
|
117
|
+
export const migrationFile = Schema.Struct({
|
|
118
|
+
agents: list(agent),
|
|
119
|
+
hosts: list(host),
|
|
120
|
+
origin: sourceId.pipe(Schema.annotate({
|
|
121
|
+
description: "The name of the set-up the file describes, the same on every export: a `sourceId` names an item within its origin and its list.",
|
|
122
|
+
})),
|
|
123
|
+
projects: list(project),
|
|
124
|
+
routines: list(routine),
|
|
125
|
+
schema: Schema.Literal(MIGRATION_SCHEMA),
|
|
126
|
+
sessions: list(session),
|
|
127
|
+
skills: list(skill),
|
|
128
|
+
}).pipe(Schema.annotate({
|
|
129
|
+
description: "A set-up to import with `maia migrate`: the file names its `origin`, and every item carries a `sourceId` that stays the same on every export.",
|
|
130
|
+
title: MIGRATION_SCHEMA,
|
|
131
|
+
}));
|
|
132
|
+
export const migrationJsonSchema = () => ({
|
|
133
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
134
|
+
...Schema.toJsonSchemaDocument(migrationFile, { onExcessProperty: "error" })
|
|
135
|
+
.schema,
|
|
136
|
+
});
|
|
137
|
+
const invalid = (message) => new CliArgumentError(message);
|
|
138
|
+
const decodeJson = Schema.decodeUnknownEffect(Schema.fromJsonString(Schema.Unknown));
|
|
139
|
+
const decodeFile = Schema.decodeUnknownEffect(migrationFile, {
|
|
140
|
+
onExcessProperty: "error",
|
|
141
|
+
});
|
|
142
|
+
const repeats = (where, items = []) => items.flatMap(({ sourceId: id }, index) => items.findIndex((item) => item.sourceId === id) === index
|
|
143
|
+
? []
|
|
144
|
+
: [`${where} ${String(index)} sourceId repeats an earlier item`]);
|
|
145
|
+
const dangling = ([where, field], references, known) => references.flatMap((reference, index) => reference === undefined ||
|
|
146
|
+
known.some(({ sourceId: id }) => id === reference)
|
|
147
|
+
? []
|
|
148
|
+
: [`${where} ${String(index)} ${field} names no item of this file`]);
|
|
149
|
+
const repeated = ({ agents = [], hosts, projects, routines, sessions, skills, }) => [
|
|
150
|
+
...Object.entries({
|
|
151
|
+
agents,
|
|
152
|
+
hosts,
|
|
153
|
+
projects,
|
|
154
|
+
routines,
|
|
155
|
+
sessions,
|
|
156
|
+
skills,
|
|
157
|
+
}).flatMap(([where, items]) => repeats(where, items)),
|
|
158
|
+
...agents.flatMap(({ memory: entries }, index) => repeats(`agents ${String(index)} memory`, entries)),
|
|
159
|
+
];
|
|
160
|
+
const projectOf = ({ project: reference }) => reference;
|
|
161
|
+
const unresolved = ({ agents = [], projects = [], routines = [], sessions = [], }) => [
|
|
162
|
+
...dangling(["agents", "project"], agents.map(projectOf), projects),
|
|
163
|
+
...dangling(["routines", "project"], routines.map(projectOf), projects),
|
|
164
|
+
...dangling(["sessions", "project"], sessions.map(projectOf), projects),
|
|
165
|
+
...dangling(["routines", "agent"], routines.map(({ agent: reference }) => reference), agents),
|
|
166
|
+
];
|
|
167
|
+
const incomplete = ({ agents = [], projects = [], routines = [], }) => [
|
|
168
|
+
...projects.flatMap(({ path: folder, remote: from }, index) => folder === undefined && from === undefined
|
|
169
|
+
? [`projects ${String(index)} needs path or remote`]
|
|
170
|
+
: []),
|
|
171
|
+
...routines.flatMap((item, index) => {
|
|
172
|
+
if (item.agent === undefined)
|
|
173
|
+
return [];
|
|
174
|
+
if (item.executor !== undefined)
|
|
175
|
+
return [`routines ${String(index)} gives agent and executor: give one`];
|
|
176
|
+
const home = agents.find(({ sourceId: id }) => id === item.agent)?.project;
|
|
177
|
+
return home === undefined || home === item.project
|
|
178
|
+
? []
|
|
179
|
+
: [`routines ${String(index)} agent works in another project`];
|
|
180
|
+
}),
|
|
181
|
+
];
|
|
182
|
+
const MAX_PROBLEM_CHARACTERS = 300;
|
|
183
|
+
const refused = (problem) => new CliArgumentError(`The file is not a ${MIGRATION_SCHEMA} document: ${problem.slice(0, MAX_PROBLEM_CHARACTERS)}.`);
|
|
184
|
+
const OTHER_VERSION = invalid(`The file is of another version of the format: this CLI reads ${MIGRATION_SCHEMA}.`);
|
|
185
|
+
const decodeTagged = (document) => Predicate.hasProperty(document, "schema") &&
|
|
186
|
+
document.schema !== MIGRATION_SCHEMA
|
|
187
|
+
? Effect.fail(OTHER_VERSION)
|
|
188
|
+
: Effect.mapError(decodeFile(document), ({ issue }) => refused(issuesOf(issue)));
|
|
189
|
+
export const parseMigrationFile = (content) => decodeJson(content).pipe(Effect.mapError(() => invalid("The migration file is not valid JSON.")), Effect.flatMap(decodeTagged), Effect.flatMap((file) => {
|
|
190
|
+
const [problem] = [
|
|
191
|
+
...repeated(file),
|
|
192
|
+
...unresolved(file),
|
|
193
|
+
...incomplete(file),
|
|
194
|
+
];
|
|
195
|
+
return problem === undefined
|
|
196
|
+
? Effect.succeed(file)
|
|
197
|
+
: Effect.fail(refused(problem));
|
|
198
|
+
}));
|
|
199
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import { commandIdOf } from "../routine/portable/index.js";
|
|
4
|
+
import { MIGRATION_SCHEMA } from "./format.js";
|
|
5
|
+
const missing = () => Effect.die(new Error("Missing migrate client."));
|
|
6
|
+
export const ask = (effect) => Effect.flatMap(effect ?? missing(), (answer) => answer.ok ? Effect.succeed(answer.value) : Effect.fail(answer.error));
|
|
7
|
+
export const pages = (read, cursor) => Effect.flatMap(read(cursor), ({ items, nextCursor }) => nextCursor === undefined
|
|
8
|
+
? Effect.succeed(items)
|
|
9
|
+
: Effect.map(pages(read, nextCursor), (rest) => [...items, ...rest]));
|
|
10
|
+
const canonical = (value) => JSON.stringify(value, (_key, nested) => typeof nested !== "object" || nested === null || Array.isArray(nested)
|
|
11
|
+
? nested
|
|
12
|
+
: Object.fromEntries(Object.entries(nested).toSorted(([left], [right]) => left < right ? -1 : 1)));
|
|
13
|
+
export const hashOf = (value) => `sha256:${createHash("sha256").update(canonical(value)).digest("hex")}`;
|
|
14
|
+
export const CREATE = { action: "create" };
|
|
15
|
+
export const skip = (reason) => ({ action: "skip", reason });
|
|
16
|
+
export const held = (id, matchedBy) => ({ action: "exists", id, matchedBy });
|
|
17
|
+
const DEPENDENCY_SKIPPED = skip("The plan skips an item it refers to.");
|
|
18
|
+
const GONE = skip("An earlier import made this item and the Node no longer lists it.");
|
|
19
|
+
export const listedIn = (ids, unlisted = GONE) => (item) => {
|
|
20
|
+
if (item.action !== "exists" || item.matchedBy !== "source-id")
|
|
21
|
+
return item;
|
|
22
|
+
if (ids.includes(item.id))
|
|
23
|
+
return item;
|
|
24
|
+
const { commandId, contentHash, sourceId } = item;
|
|
25
|
+
return { ...unlisted, commandId, contentHash, sourceId };
|
|
26
|
+
};
|
|
27
|
+
export const named = (items, sourceId) => items.find((item) => item.sourceId === sourceId);
|
|
28
|
+
export const idOf = (item) => item?.action === "exists" ? item.id : undefined;
|
|
29
|
+
const appliedBy = (context, commandId) => Effect.flatMap(context.dependencies.getReceipt?.(commandId) ?? missing(), (answer) => {
|
|
30
|
+
if (answer.ok)
|
|
31
|
+
return Effect.succeed([answer.value.receipt.target.id]);
|
|
32
|
+
return answer.error.code === "resource_not_found"
|
|
33
|
+
? Effect.succeed([])
|
|
34
|
+
: Effect.fail(answer.error);
|
|
35
|
+
});
|
|
36
|
+
export const planned = (context, [kind, items, blocked = () => false], decide) => Effect.forEach(items, (item) => {
|
|
37
|
+
const { sourceId } = item;
|
|
38
|
+
const commandId = commandIdOf({
|
|
39
|
+
class: kind,
|
|
40
|
+
origin: context.origin,
|
|
41
|
+
schema: MIGRATION_SCHEMA,
|
|
42
|
+
sourceId,
|
|
43
|
+
});
|
|
44
|
+
const decisionOf = (id) => {
|
|
45
|
+
if (blocked(item))
|
|
46
|
+
return DEPENDENCY_SKIPPED;
|
|
47
|
+
return id === undefined
|
|
48
|
+
? decide(item, commandId)
|
|
49
|
+
: { action: "exists", id, matchedBy: "source-id" };
|
|
50
|
+
};
|
|
51
|
+
return Effect.map(appliedBy(context, commandId), ([id]) => ({
|
|
52
|
+
...decisionOf(id),
|
|
53
|
+
commandId,
|
|
54
|
+
contentHash: hashOf(item),
|
|
55
|
+
sourceId,
|
|
56
|
+
}));
|
|
57
|
+
});
|
|
58
|
+
export const unsupported = (sourceId, content, reason) => ({ ...skip(reason), contentHash: hashOf(content), sourceId });
|
|
59
|
+
//# sourceMappingURL=item.js.map
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import { LOCAL_NODE } from "../command-line/input/index.js";
|
|
3
|
+
import { operationError } from "../local-node/index.js";
|
|
4
|
+
import { planAgents, planHosts, planProjects, planRoutines, planSessions, } from "./classes.js";
|
|
5
|
+
import { MIGRATION_SCHEMA } from "./format.js";
|
|
6
|
+
import { hashOf, unsupported, } from "./item.js";
|
|
7
|
+
export const PLAN_CLASSES = [
|
|
8
|
+
"projects",
|
|
9
|
+
"agents",
|
|
10
|
+
"memory",
|
|
11
|
+
"routines",
|
|
12
|
+
"skills",
|
|
13
|
+
"sessions",
|
|
14
|
+
"hosts",
|
|
15
|
+
];
|
|
16
|
+
const NOT_IMPORTABLE = {
|
|
17
|
+
memory: { reason: "Maia has no Agent memory store yet." },
|
|
18
|
+
skills: {
|
|
19
|
+
reason: "A Node takes its skills as one set pinned by digest; no operation adds one referenced skill yet.",
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
const count = (items, action) => items.filter((item) => item.action === action).length;
|
|
23
|
+
const classOf = (items, notImportable) => ({
|
|
24
|
+
count: items.length,
|
|
25
|
+
create: count(items, "create"),
|
|
26
|
+
exists: count(items, "exists"),
|
|
27
|
+
items,
|
|
28
|
+
...(notImportable === undefined || items.length === 0
|
|
29
|
+
? {}
|
|
30
|
+
: { notImportable }),
|
|
31
|
+
skip: count(items, "skip"),
|
|
32
|
+
});
|
|
33
|
+
const unsupportedOf = ({ agents = [], skills = [] }) => ({
|
|
34
|
+
memory: classOf(agents.flatMap(({ memory = [], sourceId }) => memory.map((entry) => unsupported(`${sourceId}/${entry.sourceId}`, entry, NOT_IMPORTABLE.memory.reason))), NOT_IMPORTABLE.memory),
|
|
35
|
+
skills: classOf(skills.map((item) => unsupported(item.sourceId, item, NOT_IMPORTABLE.skills.reason)), NOT_IMPORTABLE.skills),
|
|
36
|
+
});
|
|
37
|
+
const UNIDENTIFIED = {
|
|
38
|
+
code: "node_unavailable",
|
|
39
|
+
message: "The Node did not say which Node it is, so no plan binds to it.",
|
|
40
|
+
retryable: true,
|
|
41
|
+
};
|
|
42
|
+
const nodeOf = (context) => {
|
|
43
|
+
const { readStatus } = context.dependencies;
|
|
44
|
+
return readStatus === undefined
|
|
45
|
+
? Effect.fail(UNIDENTIFIED)
|
|
46
|
+
: Effect.suspend(readStatus).pipe(Effect.map(({ instanceId, profile }) => ({
|
|
47
|
+
instanceId,
|
|
48
|
+
name: context.node ?? LOCAL_NODE,
|
|
49
|
+
profile,
|
|
50
|
+
})), Effect.mapError(operationError));
|
|
51
|
+
};
|
|
52
|
+
const classesOf = (file, context) => Effect.gen(function* () {
|
|
53
|
+
const { hosts = [], origin, routines = [], sessions = [] } = file;
|
|
54
|
+
const { agents: personas = [], projects: folders = [] } = file;
|
|
55
|
+
const scope = { ...context, origin };
|
|
56
|
+
const projects = yield* planProjects(scope, folders);
|
|
57
|
+
const agents = yield* planAgents(scope, personas, projects);
|
|
58
|
+
const plans = { agents, projects };
|
|
59
|
+
return {
|
|
60
|
+
...unsupportedOf(file),
|
|
61
|
+
agents: classOf(agents),
|
|
62
|
+
hosts: classOf(yield* planHosts(scope, hosts)),
|
|
63
|
+
projects: classOf(projects),
|
|
64
|
+
routines: classOf(yield* planRoutines(scope, routines, plans)),
|
|
65
|
+
sessions: classOf(yield* planSessions(scope, sessions, projects)),
|
|
66
|
+
};
|
|
67
|
+
});
|
|
68
|
+
export const planMigration = (file, context) => Effect.gen(function* () {
|
|
69
|
+
const classes = yield* classesOf(file, context);
|
|
70
|
+
const node = yield* nodeOf(context);
|
|
71
|
+
const body = {
|
|
72
|
+
classes,
|
|
73
|
+
fileHash: hashOf(file),
|
|
74
|
+
node,
|
|
75
|
+
schema: MIGRATION_SCHEMA,
|
|
76
|
+
};
|
|
77
|
+
return { ...body, digest: hashOf(body) };
|
|
78
|
+
});
|
|
79
|
+
//# sourceMappingURL=plan.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const migrate = () => import("../index.js");
|
|
2
|
+
export const MIGRATE_TREE = {
|
|
3
|
+
groups: [["migrate", "Import a set-up from one maia.migration/v1 file."]],
|
|
4
|
+
leaves: [
|
|
5
|
+
[
|
|
6
|
+
"migrate plan --from <file>",
|
|
7
|
+
1,
|
|
8
|
+
[
|
|
9
|
+
"agents.list",
|
|
10
|
+
"routine.list",
|
|
11
|
+
"discovery.sessions.list",
|
|
12
|
+
"node.remote.list",
|
|
13
|
+
],
|
|
14
|
+
"Preview what a migration file would import; it writes nothing.",
|
|
15
|
+
{
|
|
16
|
+
example: "maia --json migrate plan --from migration.json",
|
|
17
|
+
kind: "composite",
|
|
18
|
+
run: [migrate, "runMigratePlan"],
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
],
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=tree.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type NodeUpdateApplyConfirmParameters, type NodeUpdateApplyConfirmResult, type NodeUpdateApplyPreviewParameters, type NodeUpdateApplyPreviewResult, type NodeUpdateCheckResult, type NodeUpdatePauseParameters, type NodeUpdatePauseResult, type NodeUpdatePolicyGetResult, type NodeUpdatePolicySetParameters, type NodeUpdatePolicySetResult, type NodeUpdateResumeParameters, type NodeUpdateResumeResult, type NodeUpdateRollbackConfirmParameters, type NodeUpdateRollbackConfirmResult, type NodeUpdateRollbackPreviewParameters, type NodeUpdateRollbackPreviewResult, type NodeUpdateShowResult, type NodeUpdateStatusResult } from "@maiaos/sdk";
|
|
2
|
+
import type { CliNodeEffect, CliNodeOperations } from "../local-node/index.js";
|
|
3
|
+
export declare const makeNodeUpdateClient: (node: CliNodeOperations) => {
|
|
4
|
+
confirmNodeUpdateApply: (input: NodeUpdateApplyConfirmParameters) => CliNodeEffect<NodeUpdateApplyConfirmResult>;
|
|
5
|
+
previewNodeUpdateApply: (input: NodeUpdateApplyPreviewParameters) => CliNodeEffect<NodeUpdateApplyPreviewResult>;
|
|
6
|
+
confirmNodeUpdateRollback: (input: NodeUpdateRollbackConfirmParameters) => CliNodeEffect<NodeUpdateRollbackConfirmResult>;
|
|
7
|
+
previewNodeUpdateRollback: (input: NodeUpdateRollbackPreviewParameters) => CliNodeEffect<NodeUpdateRollbackPreviewResult>;
|
|
8
|
+
pauseNodeUpdate: (input: NodeUpdatePauseParameters) => CliNodeEffect<NodeUpdatePauseResult>;
|
|
9
|
+
resumeNodeUpdate: (input: NodeUpdateResumeParameters) => CliNodeEffect<NodeUpdateResumeResult>;
|
|
10
|
+
showNodeUpdate: () => CliNodeEffect<NodeUpdateShowResult>;
|
|
11
|
+
checkNodeUpdate: () => CliNodeEffect<NodeUpdateCheckResult>;
|
|
12
|
+
getNodeUpdatePolicy: () => CliNodeEffect<NodeUpdatePolicyGetResult>;
|
|
13
|
+
setNodeUpdatePolicy: (input: NodeUpdatePolicySetParameters) => CliNodeEffect<NodeUpdatePolicySetResult>;
|
|
14
|
+
showNodeUpdateStatus: () => CliNodeEffect<NodeUpdateStatusResult>;
|
|
15
|
+
};
|
|
16
|
+
export type NodeUpdateCliDependencies = ReturnType<typeof makeNodeUpdateClient>;
|
|
17
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { nodeUpdateApplyConfirmParametersSchema, nodeUpdateApplyPreviewParametersSchema, nodeUpdatePauseParametersSchema, nodeUpdatePolicySetParametersSchema, nodeUpdateResumeParametersSchema, nodeUpdateRollbackConfirmParametersSchema, nodeUpdateRollbackPreviewParametersSchema, } from "@maiaos/sdk";
|
|
2
|
+
const applyOperations = (node) => ({
|
|
3
|
+
confirmNodeUpdateApply: (input) => node.runValidatedNodeOperation(input, nodeUpdateApplyConfirmParametersSchema, (client, parameters, options) => client.confirmNodeUpdateApply(parameters, options), { commandId: input.commandId }),
|
|
4
|
+
previewNodeUpdateApply: (input) => node.runValidatedNodeOperation(input, nodeUpdateApplyPreviewParametersSchema, (client, parameters, options) => client.previewNodeUpdateApply(parameters, options)),
|
|
5
|
+
});
|
|
6
|
+
const rollbackOperations = (node) => ({
|
|
7
|
+
confirmNodeUpdateRollback: (input) => node.runValidatedNodeOperation(input, nodeUpdateRollbackConfirmParametersSchema, (client, parameters, options) => client.confirmNodeUpdateRollback(parameters, options), { commandId: input.commandId }),
|
|
8
|
+
previewNodeUpdateRollback: (input) => node.runValidatedNodeOperation(input, nodeUpdateRollbackPreviewParametersSchema, (client, parameters, options) => client.previewNodeUpdateRollback(parameters, options)),
|
|
9
|
+
});
|
|
10
|
+
const pauseOperations = (node) => ({
|
|
11
|
+
pauseNodeUpdate: (input) => node.runValidatedNodeOperation(input, nodeUpdatePauseParametersSchema, (client, parameters, options) => client.pauseNodeUpdate(parameters, options), { commandId: input.commandId }),
|
|
12
|
+
resumeNodeUpdate: (input) => node.runValidatedNodeOperation(input, nodeUpdateResumeParametersSchema, (client, parameters, options) => client.resumeNodeUpdate(parameters, options), { commandId: input.commandId }),
|
|
13
|
+
showNodeUpdate: () => node.runNodeClientOperation((client, options) => client.showNodeUpdate(options)),
|
|
14
|
+
});
|
|
15
|
+
const policyOperations = (node) => ({
|
|
16
|
+
checkNodeUpdate: () => node.runNodeClientOperation((client, options) => client.checkNodeUpdate(options)),
|
|
17
|
+
getNodeUpdatePolicy: () => node.runNodeClientOperation((client, options) => client.getNodeUpdatePolicy(options)),
|
|
18
|
+
setNodeUpdatePolicy: (input) => node.runValidatedNodeOperation(input, nodeUpdatePolicySetParametersSchema, (client, parameters, options) => client.setNodeUpdatePolicy(parameters, options), { commandId: input.commandId }),
|
|
19
|
+
showNodeUpdateStatus: () => node.runNodeClientOperation((client, options) => client.showNodeUpdateStatus(options)),
|
|
20
|
+
});
|
|
21
|
+
export const makeNodeUpdateClient = (node) => ({
|
|
22
|
+
...applyOperations(node),
|
|
23
|
+
...pauseOperations(node),
|
|
24
|
+
...policyOperations(node),
|
|
25
|
+
...rollbackOperations(node),
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
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 { NodeUpdateCliDependencies } from "./client.js";
|
|
6
|
+
type CommandContext = OutputContext & {
|
|
7
|
+
readonly dependencies: NodeUpdateCliDependencies;
|
|
8
|
+
};
|
|
9
|
+
type CommandEffect = Effect.Effect<number, CliArgumentError, Crypto.Crypto>;
|
|
10
|
+
export declare const runNodeUpdateShow: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
11
|
+
export declare const runNodeUpdateCheck: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
12
|
+
export declare const runNodeUpdateStatus: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
13
|
+
export declare const runNodeUpdatePolicyShow: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
14
|
+
export declare const runNodeUpdatePolicySet: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
15
|
+
export declare const runNodeUpdatePause: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
16
|
+
export declare const runNodeUpdateResume: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
17
|
+
export declare const runNodeUpdateRollback: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
18
|
+
export declare const runNodeUpdateApply: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=commands.d.ts.map
|