@maiaos/cli 0.1.0-canary.2
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/README.md +287 -0
- package/dist/bin/maia.NOTICES.txt +59 -0
- package/dist/bin/maia.cdx.json +145 -0
- package/dist/bin/maia.mjs +2 -0
- package/dist/bootstrap/index.d.ts +3 -0
- package/dist/bootstrap/index.js +3 -0
- package/dist/bootstrap/process.d.ts +5 -0
- package/dist/bootstrap/process.js +45 -0
- package/dist/bootstrap/run.d.ts +25 -0
- package/dist/bootstrap/run.js +95 -0
- package/dist/bootstrap/stdio.d.ts +4 -0
- package/dist/bootstrap/stdio.js +9 -0
- package/dist/cli/cli.d.ts +17 -0
- package/dist/cli/cli.js +481 -0
- package/dist/cli/environment.d.ts +8 -0
- package/dist/cli/environment.js +12 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +2 -0
- package/dist/cli/services.d.ts +4 -0
- package/dist/cli/services.js +4 -0
- package/dist/command-line/context.d.ts +178 -0
- package/dist/command-line/context.js +2 -0
- package/dist/command-line/index.d.ts +7 -0
- package/dist/command-line/index.js +6 -0
- package/dist/command-line/input/arguments.d.ts +55 -0
- package/dist/command-line/input/arguments.js +220 -0
- package/dist/command-line/input/index.d.ts +4 -0
- package/dist/command-line/input/index.js +4 -0
- package/dist/command-line/input/prompt.d.ts +8 -0
- package/dist/command-line/input/prompt.js +44 -0
- package/dist/command-line/input/stdin-stream.d.ts +4 -0
- package/dist/command-line/input/stdin-stream.js +3 -0
- package/dist/command-line/input/stdin.d.ts +11 -0
- package/dist/command-line/input/stdin.js +23 -0
- package/dist/command-line/json-decoder.d.ts +3 -0
- package/dist/command-line/json-decoder.js +3 -0
- package/dist/command-line/json.d.ts +3 -0
- package/dist/command-line/json.js +4 -0
- package/dist/command-line/output.d.ts +57 -0
- package/dist/command-line/output.js +94 -0
- package/dist/command-line/rows.d.ts +10 -0
- package/dist/command-line/rows.js +32 -0
- package/dist/command-line/two-phase.d.ts +57 -0
- package/dist/command-line/two-phase.js +148 -0
- package/dist/command-receipt/command.d.ts +4 -0
- package/dist/command-receipt/command.js +59 -0
- package/dist/command-receipt/compact-list.d.ts +20 -0
- package/dist/command-receipt/compact-list.js +29 -0
- package/dist/command-receipt/index.d.ts +3 -0
- package/dist/command-receipt/index.js +3 -0
- package/dist/command-tree/commands.d.ts +17 -0
- package/dist/command-tree/commands.js +41 -0
- package/dist/command-tree/completion.d.ts +6 -0
- package/dist/command-tree/completion.js +36 -0
- package/dist/command-tree/grammar.d.ts +18 -0
- package/dist/command-tree/grammar.js +160 -0
- package/dist/command-tree/help.d.ts +62 -0
- package/dist/command-tree/help.js +219 -0
- package/dist/command-tree/index.d.ts +8 -0
- package/dist/command-tree/index.js +6 -0
- package/dist/command-tree/local.d.ts +3 -0
- package/dist/command-tree/local.js +126 -0
- package/dist/command-tree/placeholder.d.ts +3 -0
- package/dist/command-tree/placeholder.js +4 -0
- package/dist/command-tree/row.d.ts +29 -0
- package/dist/command-tree/row.js +2 -0
- package/dist/command-tree/suggest.d.ts +3 -0
- package/dist/command-tree/suggest.js +81 -0
- package/dist/command-tree/tree.d.ts +34 -0
- package/dist/command-tree/tree.js +124 -0
- package/dist/connection/client.d.ts +692 -0
- package/dist/connection/client.js +28 -0
- package/dist/connection/commands.d.ts +15 -0
- package/dist/connection/commands.js +118 -0
- package/dist/connection/index.d.ts +7 -0
- package/dist/connection/index.js +7 -0
- package/dist/connection/input.d.ts +50 -0
- package/dist/connection/input.js +90 -0
- package/dist/connection/login.d.ts +13 -0
- package/dist/connection/login.js +69 -0
- package/dist/connection/output/format.d.ts +32 -0
- package/dist/connection/output/format.js +94 -0
- package/dist/connection/output/index.d.ts +2 -0
- package/dist/connection/output/index.js +2 -0
- package/dist/connection/resolve.d.ts +60 -0
- package/dist/connection/resolve.js +30 -0
- package/dist/connection/signin.d.ts +4 -0
- package/dist/connection/signin.js +32 -0
- package/dist/connection/system.d.ts +4 -0
- package/dist/connection/system.js +190 -0
- package/dist/connection/tree/index.d.ts +2 -0
- package/dist/connection/tree/index.js +2 -0
- package/dist/connection/tree/tree.d.ts +3 -0
- package/dist/connection/tree/tree.js +209 -0
- package/dist/container/client.d.ts +142 -0
- package/dist/container/client.js +11 -0
- package/dist/container/commands.d.ts +7 -0
- package/dist/container/commands.js +100 -0
- package/dist/container/index.d.ts +3 -0
- package/dist/container/index.js +3 -0
- package/dist/container/output/format.d.ts +11 -0
- package/dist/container/output/format.js +28 -0
- package/dist/container/output/index.d.ts +2 -0
- package/dist/container/output/index.js +2 -0
- package/dist/context/client.d.ts +7 -0
- package/dist/context/client.js +21 -0
- package/dist/context/commands.d.ts +3 -0
- package/dist/context/commands.js +27 -0
- package/dist/context/index.d.ts +3 -0
- package/dist/context/index.js +3 -0
- package/dist/development/cli.d.ts +3 -0
- package/dist/development/cli.js +44 -0
- package/dist/execution/client.d.ts +25 -0
- package/dist/execution/client.js +24 -0
- package/dist/execution/index.d.ts +3 -0
- package/dist/execution/index.js +3 -0
- package/dist/execution/relocation.d.ts +6 -0
- package/dist/execution/relocation.js +123 -0
- package/dist/execution/tree/index.d.ts +2 -0
- package/dist/execution/tree/index.js +2 -0
- package/dist/execution/tree/tree.d.ts +3 -0
- package/dist/execution/tree/tree.js +137 -0
- package/dist/hold/client.d.ts +137 -0
- package/dist/hold/client.js +12 -0
- package/dist/hold/commands.d.ts +5 -0
- package/dist/hold/commands.js +91 -0
- package/dist/hold/index.d.ts +3 -0
- package/dist/hold/index.js +3 -0
- package/dist/hold/output/format.d.ts +11 -0
- package/dist/hold/output/format.js +29 -0
- package/dist/hold/output/index.d.ts +2 -0
- package/dist/hold/output/index.js +2 -0
- package/dist/hold/tree/index.d.ts +2 -0
- package/dist/hold/tree/index.js +2 -0
- package/dist/hold/tree/tree.d.ts +3 -0
- package/dist/hold/tree/tree.js +96 -0
- package/dist/import/client.d.ts +14 -0
- package/dist/import/client.js +16 -0
- package/dist/import/commands.d.ts +5 -0
- package/dist/import/commands.js +76 -0
- package/dist/import/index.d.ts +3 -0
- package/dist/import/index.js +3 -0
- package/dist/import/input.d.ts +16 -0
- package/dist/import/input.js +92 -0
- package/dist/import/output.d.ts +6 -0
- package/dist/import/output.js +40 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/integration/client.d.ts +1284 -0
- package/dist/integration/client.js +24 -0
- package/dist/integration/commands.d.ts +10 -0
- package/dist/integration/commands.js +104 -0
- package/dist/integration/index.d.ts +3 -0
- package/dist/integration/index.js +3 -0
- package/dist/integration/output.d.ts +22 -0
- package/dist/integration/output.js +20 -0
- package/dist/local-node/call.d.ts +7 -0
- package/dist/local-node/call.js +13 -0
- package/dist/local-node/client.d.ts +67 -0
- package/dist/local-node/client.js +241 -0
- package/dist/local-node/index.d.ts +3 -0
- package/dist/local-node/index.js +3 -0
- package/dist/login/agent-provider.d.ts +20 -0
- package/dist/login/agent-provider.js +109 -0
- package/dist/login/commands.d.ts +4 -0
- package/dist/login/commands.js +93 -0
- package/dist/login/failure.d.ts +3 -0
- package/dist/login/failure.js +14 -0
- package/dist/login/gateway.d.ts +12 -0
- package/dist/login/gateway.js +71 -0
- package/dist/login/index.d.ts +3 -0
- package/dist/login/index.js +2 -0
- package/dist/login/menu.d.ts +4 -0
- package/dist/login/menu.js +105 -0
- package/dist/login/output/format.d.ts +16 -0
- package/dist/login/output/format.js +31 -0
- package/dist/login/output/index.d.ts +2 -0
- package/dist/login/output/index.js +2 -0
- package/dist/login/vendor-account.d.ts +95 -0
- package/dist/login/vendor-account.js +75 -0
- package/dist/login/vendor-input.d.ts +14 -0
- package/dist/login/vendor-input.js +36 -0
- package/dist/mcp/calls.d.ts +7 -0
- package/dist/mcp/calls.js +202 -0
- package/dist/mcp/commands.d.ts +9 -0
- package/dist/mcp/commands.js +21 -0
- package/dist/mcp/index.d.ts +2 -0
- package/dist/mcp/index.js +2 -0
- package/dist/mcp/server.d.ts +11 -0
- package/dist/mcp/server.js +57 -0
- package/dist/orchestration/client.d.ts +78 -0
- package/dist/orchestration/client.js +89 -0
- package/dist/orchestration/commands.d.ts +14 -0
- package/dist/orchestration/commands.js +312 -0
- package/dist/orchestration/index.d.ts +3 -0
- package/dist/orchestration/index.js +3 -0
- package/dist/orchestration/output/compact-aggregate.d.ts +121 -0
- package/dist/orchestration/output/compact-aggregate.js +110 -0
- package/dist/orchestration/output/compact-run-list.d.ts +20 -0
- package/dist/orchestration/output/compact-run-list.js +16 -0
- package/dist/orchestration/output/human.d.ts +80 -0
- package/dist/orchestration/output/human.js +252 -0
- package/dist/orchestration/output/index.d.ts +4 -0
- package/dist/orchestration/output/index.js +4 -0
- package/dist/orchestration/tree/index.d.ts +2 -0
- package/dist/orchestration/tree/index.js +2 -0
- package/dist/orchestration/tree/tree.d.ts +3 -0
- package/dist/orchestration/tree/tree.js +142 -0
- package/dist/port-lease/client.d.ts +160 -0
- package/dist/port-lease/client.js +11 -0
- package/dist/port-lease/commands.d.ts +6 -0
- package/dist/port-lease/commands.js +17 -0
- package/dist/port-lease/index.d.ts +3 -0
- package/dist/port-lease/index.js +3 -0
- package/dist/port-lease/input.d.ts +65 -0
- package/dist/port-lease/input.js +67 -0
- package/dist/port-lease/output/format.d.ts +11 -0
- package/dist/port-lease/output/format.js +24 -0
- package/dist/port-lease/output/index.d.ts +2 -0
- package/dist/port-lease/output/index.js +2 -0
- package/dist/presentation/client.d.ts +10 -0
- package/dist/presentation/client.js +9 -0
- package/dist/presentation/commands.d.ts +6 -0
- package/dist/presentation/commands.js +78 -0
- package/dist/presentation/index.d.ts +4 -0
- package/dist/presentation/index.js +3 -0
- package/dist/presentation/output/format.d.ts +11 -0
- package/dist/presentation/output/format.js +32 -0
- package/dist/presentation/output/index.d.ts +3 -0
- package/dist/presentation/output/index.js +2 -0
- package/dist/project-guard/client.d.ts +88 -0
- package/dist/project-guard/client.js +7 -0
- package/dist/project-guard/commands.d.ts +4 -0
- package/dist/project-guard/commands.js +39 -0
- package/dist/project-guard/index.d.ts +3 -0
- package/dist/project-guard/index.js +3 -0
- package/dist/project-guard/input.d.ts +18 -0
- package/dist/project-guard/input.js +47 -0
- package/dist/project-guard/output/format.d.ts +11 -0
- package/dist/project-guard/output/format.js +35 -0
- package/dist/project-guard/output/index.d.ts +2 -0
- package/dist/project-guard/output/index.js +2 -0
- package/dist/project-workspace/client.d.ts +86 -0
- package/dist/project-workspace/client.js +159 -0
- package/dist/project-workspace/commands.d.ts +30 -0
- package/dist/project-workspace/commands.js +700 -0
- package/dist/project-workspace/index.d.ts +5 -0
- package/dist/project-workspace/index.js +5 -0
- package/dist/project-workspace/metadata-client.d.ts +99 -0
- package/dist/project-workspace/metadata-client.js +8 -0
- package/dist/project-workspace/metadata-commands.d.ts +4 -0
- package/dist/project-workspace/metadata-commands.js +56 -0
- package/dist/project-workspace/output/human.d.ts +126 -0
- package/dist/project-workspace/output/human.js +103 -0
- package/dist/project-workspace/output/index.d.ts +3 -0
- package/dist/project-workspace/output/index.js +3 -0
- package/dist/project-workspace/output/metadata.d.ts +11 -0
- package/dist/project-workspace/output/metadata.js +17 -0
- package/dist/project-workspace/tree/index.d.ts +2 -0
- package/dist/project-workspace/tree/index.js +2 -0
- package/dist/project-workspace/tree/tree.d.ts +3 -0
- package/dist/project-workspace/tree/tree.js +197 -0
- package/dist/provider/client.d.ts +6 -0
- package/dist/provider/client.js +5 -0
- package/dist/provider/commands.d.ts +3 -0
- package/dist/provider/commands.js +38 -0
- package/dist/provider/index.d.ts +3 -0
- package/dist/provider/index.js +3 -0
- package/dist/reference/commands.d.ts +3 -0
- package/dist/reference/commands.js +39 -0
- package/dist/reference/index.d.ts +3 -0
- package/dist/reference/index.js +3 -0
- package/dist/reference/resolve.d.ts +29 -0
- package/dist/reference/resolve.js +294 -0
- package/dist/reference/tree/index.d.ts +2 -0
- package/dist/reference/tree/index.js +2 -0
- package/dist/reference/tree/tree.d.ts +3 -0
- package/dist/reference/tree/tree.js +17 -0
- package/dist/remote-node/client.d.ts +258 -0
- package/dist/remote-node/client.js +12 -0
- package/dist/remote-node/commands.d.ts +6 -0
- package/dist/remote-node/commands.js +264 -0
- package/dist/remote-node/connector.d.ts +59 -0
- package/dist/remote-node/connector.js +122 -0
- package/dist/remote-node/index.d.ts +4 -0
- package/dist/remote-node/index.js +4 -0
- package/dist/remote-node/reachability.d.ts +22 -0
- package/dist/remote-node/reachability.js +34 -0
- package/dist/remote-node/text.d.ts +9 -0
- package/dist/remote-node/text.js +64 -0
- package/dist/remote-node/tree/index.d.ts +2 -0
- package/dist/remote-node/tree/index.js +2 -0
- package/dist/remote-node/tree/tree.d.ts +3 -0
- package/dist/remote-node/tree/tree.js +51 -0
- package/dist/run-ledger/client.d.ts +358 -0
- package/dist/run-ledger/client.js +13 -0
- package/dist/run-ledger/commands.d.ts +8 -0
- package/dist/run-ledger/commands.js +19 -0
- package/dist/run-ledger/index.d.ts +3 -0
- package/dist/run-ledger/index.js +3 -0
- package/dist/run-ledger/input.d.ts +42 -0
- package/dist/run-ledger/input.js +107 -0
- package/dist/run-ledger/output/format.d.ts +11 -0
- package/dist/run-ledger/output/format.js +49 -0
- package/dist/run-ledger/output/index.d.ts +2 -0
- package/dist/run-ledger/output/index.js +2 -0
- package/dist/session/agent-permission.d.ts +63 -0
- package/dist/session/agent-permission.js +20 -0
- package/dist/session/approval/client.d.ts +117 -0
- package/dist/session/approval/client.js +7 -0
- package/dist/session/approval/commands.d.ts +7 -0
- package/dist/session/approval/commands.js +123 -0
- package/dist/session/approval/index.d.ts +3 -0
- package/dist/session/approval/index.js +3 -0
- package/dist/session/approval/output/format.d.ts +12 -0
- package/dist/session/approval/output/format.js +25 -0
- package/dist/session/approval/output/index.d.ts +2 -0
- package/dist/session/approval/output/index.js +2 -0
- package/dist/session/attach-client.d.ts +16 -0
- package/dist/session/attach-client.js +8 -0
- package/dist/session/attach-render.d.ts +16 -0
- package/dist/session/attach-render.js +154 -0
- package/dist/session/attach.d.ts +5 -0
- package/dist/session/attach.js +106 -0
- package/dist/session/client.d.ts +132 -0
- package/dist/session/client.js +128 -0
- package/dist/session/coding-client.d.ts +16 -0
- package/dist/session/coding-client.js +15 -0
- package/dist/session/coding-commands.d.ts +4 -0
- package/dist/session/coding-commands.js +50 -0
- package/dist/session/commands.d.ts +13 -0
- package/dist/session/commands.js +488 -0
- package/dist/session/create-tasks.d.ts +20 -0
- package/dist/session/create-tasks.js +110 -0
- package/dist/session/index.d.ts +9 -0
- package/dist/session/index.js +7 -0
- package/dist/session/interaction/client.d.ts +347 -0
- package/dist/session/interaction/client.js +15 -0
- package/dist/session/interaction/commands.d.ts +7 -0
- package/dist/session/interaction/commands.js +101 -0
- package/dist/session/interaction/index.d.ts +3 -0
- package/dist/session/interaction/index.js +3 -0
- package/dist/session/interaction/input.d.ts +15 -0
- package/dist/session/interaction/input.js +46 -0
- package/dist/session/interaction/output/format.d.ts +11 -0
- package/dist/session/interaction/output/format.js +3 -0
- package/dist/session/interaction/output/index.d.ts +2 -0
- package/dist/session/interaction/output/index.js +2 -0
- package/dist/session/output/diff.d.ts +3 -0
- package/dist/session/output/diff.js +30 -0
- package/dist/session/output/failure.d.ts +11 -0
- package/dist/session/output/failure.js +24 -0
- package/dist/session/output/human.d.ts +112 -0
- package/dist/session/output/human.js +71 -0
- package/dist/session/output/index.d.ts +6 -0
- package/dist/session/output/index.js +6 -0
- package/dist/session/output/observe.d.ts +4 -0
- package/dist/session/output/observe.js +46 -0
- package/dist/session/output/tasks.d.ts +19 -0
- package/dist/session/output/tasks.js +34 -0
- package/dist/session/rename.d.ts +3 -0
- package/dist/session/rename.js +37 -0
- package/dist/session/task-file.d.ts +5 -0
- package/dist/session/task-file.js +23 -0
- package/dist/session/tree/index.d.ts +2 -0
- package/dist/session/tree/index.js +2 -0
- package/dist/session/tree/tree.d.ts +3 -0
- package/dist/session/tree/tree.js +309 -0
- package/dist/session/turn/client.d.ts +25 -0
- package/dist/session/turn/client.js +40 -0
- package/dist/session/turn/commands.d.ts +6 -0
- package/dist/session/turn/commands.js +157 -0
- package/dist/session/turn/index.d.ts +4 -0
- package/dist/session/turn/index.js +3 -0
- package/dist/session/turn/output.d.ts +42 -0
- package/dist/session/turn/output.js +38 -0
- package/dist/status/client.d.ts +119 -0
- package/dist/status/client.js +5 -0
- package/dist/status/command.d.ts +4 -0
- package/dist/status/command.js +40 -0
- package/dist/status/doctor.d.ts +15 -0
- package/dist/status/doctor.js +111 -0
- package/dist/status/index.d.ts +5 -0
- package/dist/status/index.js +4 -0
- package/dist/status/output/compact.d.ts +31 -0
- package/dist/status/output/compact.js +46 -0
- package/dist/status/output/human.d.ts +7 -0
- package/dist/status/output/human.js +30 -0
- package/dist/status/output/index.d.ts +3 -0
- package/dist/status/output/index.js +3 -0
- package/dist/terminal/arguments.d.ts +13 -0
- package/dist/terminal/arguments.js +79 -0
- package/dist/terminal/client.d.ts +79 -0
- package/dist/terminal/client.js +68 -0
- package/dist/terminal/commands.d.ts +7 -0
- package/dist/terminal/commands.js +131 -0
- package/dist/terminal/control-commands.d.ts +10 -0
- package/dist/terminal/control-commands.js +212 -0
- package/dist/terminal/index.d.ts +4 -0
- package/dist/terminal/index.js +4 -0
- package/dist/terminal/output/compact-list.d.ts +147 -0
- package/dist/terminal/output/compact-list.js +152 -0
- package/dist/terminal/output/human.d.ts +59 -0
- package/dist/terminal/output/human.js +55 -0
- package/dist/terminal/output/index.d.ts +3 -0
- package/dist/terminal/output/index.js +3 -0
- package/dist/terminal/tree/index.d.ts +2 -0
- package/dist/terminal/tree/index.js +2 -0
- package/dist/terminal/tree/tree.d.ts +3 -0
- package/dist/terminal/tree/tree.js +104 -0
- package/guidance/maia-cli/SKILL.md +58 -0
- package/guidance/maia-orchestration/SKILL.md +54 -0
- package/package.json +76 -0
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { cell, formatRows, tab, withNextPage, writeNodeResult, } from "../../command-line/index.js";
|
|
2
|
+
import { projectDispatchSettleResult, projectDispatchShowDispatch, projectInboxAckResult, projectQuestionCancelResult, projectQuestionOpenResult, projectQuestionReplyResult, projectRunCreateResult, projectRunShowResult, } from "./compact-aggregate.js";
|
|
3
|
+
import { projectRunListResult, } from "./compact-run-list.js";
|
|
4
|
+
export const formatInboxAck = (result) => `${tab([
|
|
5
|
+
result.command,
|
|
6
|
+
result.receipt.commandId,
|
|
7
|
+
result.runId,
|
|
8
|
+
result.owner.kind,
|
|
9
|
+
result.owner.id,
|
|
10
|
+
result.mailboxRevision,
|
|
11
|
+
result.receipt.state,
|
|
12
|
+
])}\n${tab([
|
|
13
|
+
result.delivery.deliveryId,
|
|
14
|
+
result.delivery.sequence,
|
|
15
|
+
result.delivery.type,
|
|
16
|
+
cell(result.delivery.subject),
|
|
17
|
+
])}\n`;
|
|
18
|
+
const formatInboxCheck = (result) => {
|
|
19
|
+
const header = tab([
|
|
20
|
+
result.command,
|
|
21
|
+
result.runId,
|
|
22
|
+
result.owner.kind,
|
|
23
|
+
result.owner.id,
|
|
24
|
+
String(result.count),
|
|
25
|
+
result.mailboxRevision,
|
|
26
|
+
]);
|
|
27
|
+
if (result.items.length === 0)
|
|
28
|
+
return `${header}\n`;
|
|
29
|
+
return `${header}\n${result.items
|
|
30
|
+
.map((item) => tab([item.deliveryId, item.sequence, item.type, cell(item.subject)]))
|
|
31
|
+
.join("\n")}\n`;
|
|
32
|
+
};
|
|
33
|
+
export const formatRunList = (result) => withNextPage(formatRows(result.items, (item) => tab([
|
|
34
|
+
item.id,
|
|
35
|
+
item.state,
|
|
36
|
+
item.revision,
|
|
37
|
+
item.terminalId,
|
|
38
|
+
item.rootTaskId,
|
|
39
|
+
item.dispatchTaskId,
|
|
40
|
+
]), {
|
|
41
|
+
empty: "No runs.",
|
|
42
|
+
headers: [
|
|
43
|
+
"RUN",
|
|
44
|
+
"STATE",
|
|
45
|
+
"REVISION",
|
|
46
|
+
"TERMINAL",
|
|
47
|
+
"ROOT TASK",
|
|
48
|
+
"DISPATCH TASK",
|
|
49
|
+
],
|
|
50
|
+
}), result.nextCursor);
|
|
51
|
+
const formatTaskList = (result) => withNextPage(formatRows(result.items, (item) => tab([item.id, item.clientKey, item.state, item.revision]), { empty: "No tasks.", headers: ["TASK", "KEY", "STATE", "REVISION"] }), result.nextCursor);
|
|
52
|
+
const formatTaskShow = (result) => [
|
|
53
|
+
tab([
|
|
54
|
+
result.command,
|
|
55
|
+
result.task.runId,
|
|
56
|
+
result.task.id,
|
|
57
|
+
result.task.clientKey,
|
|
58
|
+
result.task.state,
|
|
59
|
+
result.task.revision,
|
|
60
|
+
]),
|
|
61
|
+
cell(result.task.objective),
|
|
62
|
+
"",
|
|
63
|
+
].join("\n");
|
|
64
|
+
const formatDispatchShow = (result) => {
|
|
65
|
+
const header = tab([
|
|
66
|
+
result.command,
|
|
67
|
+
result.dispatch.runId,
|
|
68
|
+
result.dispatch.id,
|
|
69
|
+
result.dispatch.taskId,
|
|
70
|
+
result.dispatch.state,
|
|
71
|
+
result.dispatch.revision,
|
|
72
|
+
]);
|
|
73
|
+
if (result.dispatch.state !== "failed" ||
|
|
74
|
+
result.dispatch.failure === undefined) {
|
|
75
|
+
return `${header}\n`;
|
|
76
|
+
}
|
|
77
|
+
return `${header}\n${result.dispatch.failure.code}\t${result.dispatch.failure.platform}\n`;
|
|
78
|
+
};
|
|
79
|
+
const formatFailedDispatchLine = (dispatch) => dispatch.state === "failed" && dispatch.failure !== undefined
|
|
80
|
+
? `${dispatch.failure.code}\t${dispatch.failure.platform}\n`
|
|
81
|
+
: "";
|
|
82
|
+
const formatMailboxLines = (mailboxes) => `${mailboxes.map((mailbox) => `${mailbox.owner.kind}\t${mailbox.id}\t${mailbox.revision}`).join("\n")}\n`;
|
|
83
|
+
const formatQuestionLines = (question) => {
|
|
84
|
+
if (question === undefined)
|
|
85
|
+
return "";
|
|
86
|
+
const lines = [
|
|
87
|
+
`${question.id}\t${question.state}\t${question.revision}`,
|
|
88
|
+
cell(question.subject),
|
|
89
|
+
cell(question.body),
|
|
90
|
+
];
|
|
91
|
+
if (question.state === "answered" && question.answer !== undefined) {
|
|
92
|
+
lines.push(cell(question.answer));
|
|
93
|
+
}
|
|
94
|
+
return `${lines.join("\n")}\n`;
|
|
95
|
+
};
|
|
96
|
+
const formatDeliveryLine = (delivery) => delivery === undefined
|
|
97
|
+
? ""
|
|
98
|
+
: `${delivery.deliveryId}\t${delivery.sequence}\t${delivery.type}\t${cell(delivery.subject)}\n`;
|
|
99
|
+
const formatCompactAggregateBody = (aggregate, delivery) => `${formatFailedDispatchLine(aggregate.dispatch)}${formatMailboxLines(aggregate.mailboxes)}${formatQuestionLines(aggregate.question)}${formatDeliveryLine(delivery)}`;
|
|
100
|
+
export const formatRunShow = (result) => `${tab([
|
|
101
|
+
result.command,
|
|
102
|
+
result.aggregate.run.id,
|
|
103
|
+
result.aggregate.run.state,
|
|
104
|
+
result.aggregate.run.revision,
|
|
105
|
+
result.aggregate.dispatch.id,
|
|
106
|
+
result.aggregate.dispatch.state,
|
|
107
|
+
result.aggregate.dispatch.revision,
|
|
108
|
+
])}\n${formatCompactAggregateBody(result.aggregate)}`;
|
|
109
|
+
export const formatRunCreate = (result) => `${tab([
|
|
110
|
+
result.command,
|
|
111
|
+
result.delivery,
|
|
112
|
+
result.receipt.commandId,
|
|
113
|
+
result.aggregate.run.id,
|
|
114
|
+
result.aggregate.run.revision,
|
|
115
|
+
result.aggregate.dispatch.id,
|
|
116
|
+
result.aggregate.dispatch.revision,
|
|
117
|
+
])}\n${formatCompactAggregateBody(result.aggregate, result.initialDelivery)}`;
|
|
118
|
+
const formatQuestionMutation = (result) => `${tab([
|
|
119
|
+
result.command,
|
|
120
|
+
result.receipt.commandId,
|
|
121
|
+
result.aggregate.run.id,
|
|
122
|
+
result.aggregate.question?.id ?? "",
|
|
123
|
+
result.aggregate.question?.revision ?? "",
|
|
124
|
+
result.aggregate.run.revision,
|
|
125
|
+
result.aggregate.dispatch.revision,
|
|
126
|
+
])}\n${formatCompactAggregateBody(result.aggregate, result.delivery)}`;
|
|
127
|
+
export const formatQuestionOpen = (result) => formatQuestionMutation(result);
|
|
128
|
+
const formatQuestionReply = (result) => formatQuestionMutation(result);
|
|
129
|
+
export const formatQuestionCancel = (result) => `${tab([
|
|
130
|
+
result.command,
|
|
131
|
+
result.receipt.commandId,
|
|
132
|
+
result.aggregate.run.id,
|
|
133
|
+
result.aggregate.run.revision,
|
|
134
|
+
result.aggregate.dispatch.revision,
|
|
135
|
+
])}\n${formatCompactAggregateBody(result.aggregate)}`;
|
|
136
|
+
const formatDispatchSettle = (result) => `${tab([
|
|
137
|
+
result.command,
|
|
138
|
+
result.receipt.commandId,
|
|
139
|
+
result.aggregate.run.id,
|
|
140
|
+
result.aggregate.dispatch.state,
|
|
141
|
+
result.aggregate.run.revision,
|
|
142
|
+
result.aggregate.dispatch.revision,
|
|
143
|
+
])}\n${formatCompactAggregateBody(result.aggregate, result.delivery)}`;
|
|
144
|
+
export const formatCompactOrchestration = (result) => {
|
|
145
|
+
if (result.command === "run.inbox.ack")
|
|
146
|
+
return formatInboxAck(result);
|
|
147
|
+
if (result.command === "run.inbox.check")
|
|
148
|
+
return formatInboxCheck(result);
|
|
149
|
+
if (result.command === "run.task.list")
|
|
150
|
+
return formatTaskList(result);
|
|
151
|
+
if (result.command === "run.task.show")
|
|
152
|
+
return formatTaskShow(result);
|
|
153
|
+
if (result.command === "run.dispatch.show")
|
|
154
|
+
return formatDispatchShow(result);
|
|
155
|
+
if (result.command === "run.show")
|
|
156
|
+
return formatRunShow(result);
|
|
157
|
+
if (result.command === "run.create")
|
|
158
|
+
return formatRunCreate(result);
|
|
159
|
+
if (result.command === "run.question.open")
|
|
160
|
+
return formatQuestionOpen(result);
|
|
161
|
+
if (result.command === "run.question.reply") {
|
|
162
|
+
return formatQuestionReply(result);
|
|
163
|
+
}
|
|
164
|
+
if (result.command === "run.question.cancel") {
|
|
165
|
+
return formatQuestionCancel(result);
|
|
166
|
+
}
|
|
167
|
+
if (result.command === "run.dispatch.settle-terminal") {
|
|
168
|
+
return formatDispatchSettle(result);
|
|
169
|
+
}
|
|
170
|
+
return formatRunList(result);
|
|
171
|
+
};
|
|
172
|
+
const projectInboxCheckItem = (delivery) => ({
|
|
173
|
+
body: delivery.message.body,
|
|
174
|
+
deliveryId: delivery.id,
|
|
175
|
+
mailboxId: delivery.mailboxId,
|
|
176
|
+
sequence: delivery.sequence,
|
|
177
|
+
subject: delivery.message.subject,
|
|
178
|
+
type: delivery.message.type,
|
|
179
|
+
});
|
|
180
|
+
const projectedResultWriter = (project) => (result, context) => writeNodeResult(result, context, {
|
|
181
|
+
toResult: project,
|
|
182
|
+
toText: formatCompactOrchestration,
|
|
183
|
+
});
|
|
184
|
+
export const writeInboxAckResult = projectedResultWriter(projectInboxAckResult);
|
|
185
|
+
export const writeInboxCheckResult = (result, context) => writeNodeResult(result, context, {
|
|
186
|
+
toResult: (value) => ({
|
|
187
|
+
command: "run.inbox.check",
|
|
188
|
+
count: value.items.length,
|
|
189
|
+
items: value.items.map(projectInboxCheckItem),
|
|
190
|
+
mailboxId: value.mailbox.id,
|
|
191
|
+
mailboxRevision: value.mailbox.revision,
|
|
192
|
+
owner: {
|
|
193
|
+
id: value.mailbox.owner.id,
|
|
194
|
+
kind: value.mailbox.owner.kind,
|
|
195
|
+
},
|
|
196
|
+
runId: value.mailbox.runId,
|
|
197
|
+
}),
|
|
198
|
+
toText: formatCompactOrchestration,
|
|
199
|
+
});
|
|
200
|
+
const projectTaskListItem = (task) => ({
|
|
201
|
+
clientKey: task.clientKey,
|
|
202
|
+
dependencyTaskIds: task.dependencyTaskIds,
|
|
203
|
+
id: task.id,
|
|
204
|
+
revision: task.revision,
|
|
205
|
+
state: task.state,
|
|
206
|
+
});
|
|
207
|
+
export const writeRunListResult = (result, context, workspaceId) => writeNodeResult(result, context, {
|
|
208
|
+
toResult: (value) => projectRunListResult(value, workspaceId),
|
|
209
|
+
toText: formatCompactOrchestration,
|
|
210
|
+
});
|
|
211
|
+
export const writeTaskListResult = (result, context) => writeNodeResult(result, context, {
|
|
212
|
+
toResult: (value) => ({
|
|
213
|
+
command: "run.task.list",
|
|
214
|
+
count: value.items.length,
|
|
215
|
+
items: value.items.map(projectTaskListItem),
|
|
216
|
+
...(value.nextCursor === undefined
|
|
217
|
+
? {}
|
|
218
|
+
: { nextCursor: value.nextCursor }),
|
|
219
|
+
runId: value.runId,
|
|
220
|
+
}),
|
|
221
|
+
toText: formatCompactOrchestration,
|
|
222
|
+
});
|
|
223
|
+
const projectTaskShowTask = (task) => ({
|
|
224
|
+
clientKey: task.clientKey,
|
|
225
|
+
dependencyTaskIds: task.dependencyTaskIds,
|
|
226
|
+
id: task.id,
|
|
227
|
+
objective: task.objective,
|
|
228
|
+
revision: task.revision,
|
|
229
|
+
runId: task.runId,
|
|
230
|
+
state: task.state,
|
|
231
|
+
});
|
|
232
|
+
export const writeTaskShowResult = (result, context) => writeNodeResult(result, context, {
|
|
233
|
+
toResult: (value) => ({
|
|
234
|
+
command: "run.task.show",
|
|
235
|
+
task: projectTaskShowTask(value.task),
|
|
236
|
+
}),
|
|
237
|
+
toText: formatCompactOrchestration,
|
|
238
|
+
});
|
|
239
|
+
export const writeDispatchShowResult = (result, context) => writeNodeResult(result, context, {
|
|
240
|
+
toResult: (value) => ({
|
|
241
|
+
command: "run.dispatch.show",
|
|
242
|
+
dispatch: projectDispatchShowDispatch(value.dispatch),
|
|
243
|
+
}),
|
|
244
|
+
toText: formatCompactOrchestration,
|
|
245
|
+
});
|
|
246
|
+
export const writeRunShowResult = projectedResultWriter(projectRunShowResult);
|
|
247
|
+
export const writeRunCreateResult = projectedResultWriter(projectRunCreateResult);
|
|
248
|
+
export const writeQuestionOpenResult = projectedResultWriter(projectQuestionOpenResult);
|
|
249
|
+
export const writeQuestionReplyResult = projectedResultWriter(projectQuestionReplyResult);
|
|
250
|
+
export const writeQuestionCancelResult = projectedResultWriter(projectQuestionCancelResult);
|
|
251
|
+
export const writeDispatchSettleResult = projectedResultWriter(projectDispatchSettleResult);
|
|
252
|
+
//# sourceMappingURL=human.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { type CliCompactDelivery, type CliCompactQuestion, type CliDispatchSettleResult, type CliDispatchShowDispatch, type CliInboxAckResult, type CliQuestionCancelResult, type CliQuestionOpenResult, type CliQuestionReplyResult, type CliRunCreateResult, type CliRunShowResult, projectDispatchSettleResult, projectDispatchShowDispatch, projectInboxAckResult, projectQuestionCancelResult, projectQuestionOpenResult, projectQuestionReplyResult, projectRunCreateResult, projectRunShowResult, } from "./compact-aggregate.js";
|
|
2
|
+
export { type CliRunListResult, projectRunListResult, } from "./compact-run-list.js";
|
|
3
|
+
export { type CliOrchestrationResult, formatCompactOrchestration, formatInboxAck, formatQuestionCancel, formatQuestionOpen, formatRunCreate, formatRunList, formatRunShow, writeDispatchSettleResult, writeDispatchShowResult, writeInboxAckResult, writeInboxCheckResult, writeQuestionCancelResult, writeQuestionOpenResult, writeQuestionReplyResult, writeRunCreateResult, writeRunListResult, writeRunShowResult, writeTaskListResult, writeTaskShowResult, } from "./human.js";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { projectDispatchSettleResult, projectDispatchShowDispatch, projectInboxAckResult, projectQuestionCancelResult, projectQuestionOpenResult, projectQuestionReplyResult, projectRunCreateResult, projectRunShowResult, } from "./compact-aggregate.js";
|
|
2
|
+
export { projectRunListResult, } from "./compact-run-list.js";
|
|
3
|
+
export { formatCompactOrchestration, formatInboxAck, formatQuestionCancel, formatQuestionOpen, formatRunCreate, formatRunList, formatRunShow, writeDispatchSettleResult, writeDispatchShowResult, writeInboxAckResult, writeInboxCheckResult, writeQuestionCancelResult, writeQuestionOpenResult, writeQuestionReplyResult, writeRunCreateResult, writeRunListResult, writeRunShowResult, writeTaskListResult, writeTaskShowResult, } from "./human.js";
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
const run = () => import("../index.js");
|
|
2
|
+
const ledger = () => import("../../run-ledger/index.js");
|
|
3
|
+
export const RUN_TREE = {
|
|
4
|
+
groups: [
|
|
5
|
+
["run", "Orchestration runs and the durable Run ledger."],
|
|
6
|
+
["run task", "A run's tasks."],
|
|
7
|
+
["run inbox", "Run and dispatch inboxes."],
|
|
8
|
+
["run question", "Questions on a dispatch."],
|
|
9
|
+
["run dispatch", "A run's dispatch."],
|
|
10
|
+
["run ledger", "The durable Run ledger."],
|
|
11
|
+
["run ledger task", "Ledger tasks."],
|
|
12
|
+
],
|
|
13
|
+
leaves: [
|
|
14
|
+
[
|
|
15
|
+
"run create --workspace <workspace-id> --terminal <terminal-id> --graph-stdin [--command-id <id>]",
|
|
16
|
+
1,
|
|
17
|
+
"run.create",
|
|
18
|
+
"Create an orchestration run from a task graph.",
|
|
19
|
+
{ run: [run, "runCreate"] },
|
|
20
|
+
],
|
|
21
|
+
[
|
|
22
|
+
"run list --workspace <workspace-id> [--limit <1..100>] [--after <cursor>]",
|
|
23
|
+
1,
|
|
24
|
+
"run.list",
|
|
25
|
+
"List a Workspace's runs.",
|
|
26
|
+
{ run: [run, "runList"] },
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
"run show <run-id>",
|
|
30
|
+
1,
|
|
31
|
+
"run.show",
|
|
32
|
+
"Show one run.",
|
|
33
|
+
{ run: [run, "runShow"] },
|
|
34
|
+
],
|
|
35
|
+
[
|
|
36
|
+
"run task list --run <run-id> [--limit <1..32>] [--after <cursor>]",
|
|
37
|
+
1,
|
|
38
|
+
"run.task.list",
|
|
39
|
+
"List a run's tasks.",
|
|
40
|
+
{ run: [run, "runTaskList"] },
|
|
41
|
+
],
|
|
42
|
+
[
|
|
43
|
+
"run task show <task-id> --run <run-id>",
|
|
44
|
+
1,
|
|
45
|
+
"run.task.show",
|
|
46
|
+
"Show one run task.",
|
|
47
|
+
{ run: [run, "runTaskShow"] },
|
|
48
|
+
],
|
|
49
|
+
[
|
|
50
|
+
"run inbox check --run <run-id> --owner <run|dispatch> --owner-id <id> --coordinator-epoch 1 [--limit <1..16>]",
|
|
51
|
+
1,
|
|
52
|
+
"run.inbox.check",
|
|
53
|
+
"Check a run or dispatch inbox.",
|
|
54
|
+
{ run: [run, "runInboxCheck"] },
|
|
55
|
+
],
|
|
56
|
+
[
|
|
57
|
+
"run inbox ack <delivery-id> --run <run-id> --owner <run|dispatch> --owner-id <id> --expected-mailbox-revision <revision> --coordinator-epoch 1 [--command-id <id>]",
|
|
58
|
+
1,
|
|
59
|
+
"run.inbox.ack",
|
|
60
|
+
"Acknowledge one inbox delivery.",
|
|
61
|
+
{ run: [run, "runInboxAck"] },
|
|
62
|
+
],
|
|
63
|
+
[
|
|
64
|
+
"run question open --run <run-id> --dispatch <dispatch-id> --subject <text> --body-stdin --expected-run-revision <revision> --expected-dispatch-revision <revision> --coordinator-epoch 1 [--command-id <id>]",
|
|
65
|
+
1,
|
|
66
|
+
"run.question.open",
|
|
67
|
+
"Open a question on a dispatch.",
|
|
68
|
+
{ run: [run, "runQuestionOpen"] },
|
|
69
|
+
],
|
|
70
|
+
[
|
|
71
|
+
"run question reply <question-id> --run <run-id> --dispatch <dispatch-id> --answer-stdin --expected-run-revision <revision> --expected-dispatch-revision <revision> --expected-question-revision <revision> --coordinator-epoch 1 [--command-id <id>]",
|
|
72
|
+
1,
|
|
73
|
+
"run.question.reply",
|
|
74
|
+
"Reply to a dispatch question.",
|
|
75
|
+
{ run: [run, "runQuestionReply"] },
|
|
76
|
+
],
|
|
77
|
+
[
|
|
78
|
+
"run question cancel <question-id> --run <run-id> --dispatch <dispatch-id> --expected-run-revision <revision> --expected-dispatch-revision <revision> --expected-question-revision <revision> --coordinator-epoch 1 [--command-id <id>]",
|
|
79
|
+
1,
|
|
80
|
+
"run.question.cancel",
|
|
81
|
+
"Cancel a dispatch question.",
|
|
82
|
+
{ run: [run, "runQuestionCancel"] },
|
|
83
|
+
],
|
|
84
|
+
[
|
|
85
|
+
"run dispatch show --run <run-id>",
|
|
86
|
+
1,
|
|
87
|
+
"run.dispatch.show",
|
|
88
|
+
"Show a run's dispatch.",
|
|
89
|
+
{ run: [run, "runDispatchShow"] },
|
|
90
|
+
],
|
|
91
|
+
[
|
|
92
|
+
"run dispatch settle-terminal <dispatch-id> --run <run-id> --expected-run-revision <revision> --expected-dispatch-revision <revision> --coordinator-epoch 1 [--command-id <id>]",
|
|
93
|
+
1,
|
|
94
|
+
"run.dispatch.settle-terminal",
|
|
95
|
+
"Settle a dispatch whose terminal ended.",
|
|
96
|
+
{ run: [run, "runDispatchSettleTerminal"] },
|
|
97
|
+
],
|
|
98
|
+
[
|
|
99
|
+
"run ledger create --workspace <workspace-id> --graph-stdin [--command-id <id>]",
|
|
100
|
+
1,
|
|
101
|
+
"run.ledger.create",
|
|
102
|
+
"Create a ledger run from a task graph.",
|
|
103
|
+
{ run: [ledger, "runLedgerCreate"] },
|
|
104
|
+
],
|
|
105
|
+
[
|
|
106
|
+
"run ledger list --workspace <workspace-id> [--limit <1..100>] [--after <cursor>]",
|
|
107
|
+
1,
|
|
108
|
+
"run.ledger.list",
|
|
109
|
+
"List a Workspace's ledger runs.",
|
|
110
|
+
{ run: [ledger, "runLedgerList"] },
|
|
111
|
+
],
|
|
112
|
+
[
|
|
113
|
+
"run ledger task list --run <run-id> [--ready]",
|
|
114
|
+
1,
|
|
115
|
+
"run.ledger.task.list",
|
|
116
|
+
"List a ledger run's tasks.",
|
|
117
|
+
{ run: [ledger, "runLedgerTaskList"] },
|
|
118
|
+
],
|
|
119
|
+
[
|
|
120
|
+
"run ledger task show <task-id> --run <run-id>",
|
|
121
|
+
1,
|
|
122
|
+
"run.ledger.task.show",
|
|
123
|
+
"Show one ledger task.",
|
|
124
|
+
{ run: [ledger, "runLedgerTaskShow"] },
|
|
125
|
+
],
|
|
126
|
+
[
|
|
127
|
+
"run ledger task dispatch <task-id> --run <run-id> --session <session-id> --expected-task-revision <revision> --expected-session-revision <revision> [--command-id <id>]",
|
|
128
|
+
1,
|
|
129
|
+
"run.ledger.task.dispatch",
|
|
130
|
+
"Dispatch a ledger task to a Session.",
|
|
131
|
+
{ run: [ledger, "runLedgerTaskDispatch"] },
|
|
132
|
+
],
|
|
133
|
+
[
|
|
134
|
+
"run ledger task settle <task-id> --run <run-id> --session <session-id> --outcome <succeeded|failed> --expected-task-revision <revision> --evidence-stdin [--turn <turn-id>] [--command-id <id>]",
|
|
135
|
+
1,
|
|
136
|
+
"run.ledger.task.settle",
|
|
137
|
+
"Settle a ledger task with evidence.",
|
|
138
|
+
{ run: [ledger, "runLedgerTaskSettle"] },
|
|
139
|
+
],
|
|
140
|
+
],
|
|
141
|
+
};
|
|
142
|
+
//# sourceMappingURL=tree.js.map
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { type PortLeaseAcquireParameters, type PortLeaseListParameters, type PortLeaseReleaseParameters, type PortLeaseRenewParameters } from "@maiaos/sdk";
|
|
2
|
+
import type { CliNodeOperations } from "../local-node/index.js";
|
|
3
|
+
export declare const makePortLeaseClient: (node: CliNodeOperations) => {
|
|
4
|
+
acquirePortLease: (input: PortLeaseAcquireParameters) => import("../local-node/client.js").CliNodeEffect<{
|
|
5
|
+
readonly commandId: string;
|
|
6
|
+
readonly delivery: "duplicate" | "new";
|
|
7
|
+
readonly lease: {
|
|
8
|
+
readonly endReason?: "owner_missing" | "owner_released" | "session_ended" | "ttl_expired" | undefined;
|
|
9
|
+
readonly expiresAt: string;
|
|
10
|
+
readonly grantedAt: string;
|
|
11
|
+
readonly leaseId: string;
|
|
12
|
+
readonly owner: {
|
|
13
|
+
readonly kind: "session";
|
|
14
|
+
readonly sessionId: string;
|
|
15
|
+
} | {
|
|
16
|
+
readonly kind: "principal";
|
|
17
|
+
readonly principalId: string;
|
|
18
|
+
};
|
|
19
|
+
readonly ports: readonly number[];
|
|
20
|
+
readonly purpose: string;
|
|
21
|
+
readonly revision: string;
|
|
22
|
+
readonly schemaVersion: "maia.port-lease/v1";
|
|
23
|
+
readonly state: "active" | "expired" | "released";
|
|
24
|
+
readonly updatedAt: string;
|
|
25
|
+
};
|
|
26
|
+
readonly receipt: {
|
|
27
|
+
readonly actorId: string;
|
|
28
|
+
readonly aggregateRevision: string;
|
|
29
|
+
readonly commandId: string;
|
|
30
|
+
readonly createdAt: string;
|
|
31
|
+
readonly eventCursor: string;
|
|
32
|
+
readonly method: string;
|
|
33
|
+
readonly receiptId: string;
|
|
34
|
+
readonly schemaVersion: 1;
|
|
35
|
+
readonly state: "succeeded";
|
|
36
|
+
readonly target: {
|
|
37
|
+
readonly id: string;
|
|
38
|
+
readonly type: string;
|
|
39
|
+
};
|
|
40
|
+
readonly updatedAt: string;
|
|
41
|
+
};
|
|
42
|
+
readonly method: "port.lease.acquire";
|
|
43
|
+
}>;
|
|
44
|
+
releasePortLease: (input: PortLeaseReleaseParameters) => import("../local-node/client.js").CliNodeEffect<{
|
|
45
|
+
readonly commandId: string;
|
|
46
|
+
readonly delivery: "duplicate" | "new";
|
|
47
|
+
readonly lease: {
|
|
48
|
+
readonly endReason?: "owner_missing" | "owner_released" | "session_ended" | "ttl_expired" | undefined;
|
|
49
|
+
readonly expiresAt: string;
|
|
50
|
+
readonly grantedAt: string;
|
|
51
|
+
readonly leaseId: string;
|
|
52
|
+
readonly owner: {
|
|
53
|
+
readonly kind: "session";
|
|
54
|
+
readonly sessionId: string;
|
|
55
|
+
} | {
|
|
56
|
+
readonly kind: "principal";
|
|
57
|
+
readonly principalId: string;
|
|
58
|
+
};
|
|
59
|
+
readonly ports: readonly number[];
|
|
60
|
+
readonly purpose: string;
|
|
61
|
+
readonly revision: string;
|
|
62
|
+
readonly schemaVersion: "maia.port-lease/v1";
|
|
63
|
+
readonly state: "active" | "expired" | "released";
|
|
64
|
+
readonly updatedAt: string;
|
|
65
|
+
};
|
|
66
|
+
readonly receipt: {
|
|
67
|
+
readonly actorId: string;
|
|
68
|
+
readonly aggregateRevision: string;
|
|
69
|
+
readonly commandId: string;
|
|
70
|
+
readonly createdAt: string;
|
|
71
|
+
readonly eventCursor: string;
|
|
72
|
+
readonly method: string;
|
|
73
|
+
readonly receiptId: string;
|
|
74
|
+
readonly schemaVersion: 1;
|
|
75
|
+
readonly state: "succeeded";
|
|
76
|
+
readonly target: {
|
|
77
|
+
readonly id: string;
|
|
78
|
+
readonly type: string;
|
|
79
|
+
};
|
|
80
|
+
readonly updatedAt: string;
|
|
81
|
+
};
|
|
82
|
+
readonly method: "port.lease.release";
|
|
83
|
+
}>;
|
|
84
|
+
renewPortLease: (input: PortLeaseRenewParameters) => import("../local-node/client.js").CliNodeEffect<{
|
|
85
|
+
readonly commandId: string;
|
|
86
|
+
readonly delivery: "duplicate" | "new";
|
|
87
|
+
readonly lease: {
|
|
88
|
+
readonly endReason?: "owner_missing" | "owner_released" | "session_ended" | "ttl_expired" | undefined;
|
|
89
|
+
readonly expiresAt: string;
|
|
90
|
+
readonly grantedAt: string;
|
|
91
|
+
readonly leaseId: string;
|
|
92
|
+
readonly owner: {
|
|
93
|
+
readonly kind: "session";
|
|
94
|
+
readonly sessionId: string;
|
|
95
|
+
} | {
|
|
96
|
+
readonly kind: "principal";
|
|
97
|
+
readonly principalId: string;
|
|
98
|
+
};
|
|
99
|
+
readonly ports: readonly number[];
|
|
100
|
+
readonly purpose: string;
|
|
101
|
+
readonly revision: string;
|
|
102
|
+
readonly schemaVersion: "maia.port-lease/v1";
|
|
103
|
+
readonly state: "active" | "expired" | "released";
|
|
104
|
+
readonly updatedAt: string;
|
|
105
|
+
};
|
|
106
|
+
readonly receipt: {
|
|
107
|
+
readonly actorId: string;
|
|
108
|
+
readonly aggregateRevision: string;
|
|
109
|
+
readonly commandId: string;
|
|
110
|
+
readonly createdAt: string;
|
|
111
|
+
readonly eventCursor: string;
|
|
112
|
+
readonly method: string;
|
|
113
|
+
readonly receiptId: string;
|
|
114
|
+
readonly schemaVersion: 1;
|
|
115
|
+
readonly state: "succeeded";
|
|
116
|
+
readonly target: {
|
|
117
|
+
readonly id: string;
|
|
118
|
+
readonly type: string;
|
|
119
|
+
};
|
|
120
|
+
readonly updatedAt: string;
|
|
121
|
+
};
|
|
122
|
+
readonly expectedRevision: string;
|
|
123
|
+
readonly method: "port.lease.renew";
|
|
124
|
+
}>;
|
|
125
|
+
listPortLeases: (input: PortLeaseListParameters) => import("../local-node/client.js").CliNodeEffect<{
|
|
126
|
+
readonly items: readonly {
|
|
127
|
+
readonly lease: {
|
|
128
|
+
readonly endReason?: "owner_missing" | "owner_released" | "session_ended" | "ttl_expired" | undefined;
|
|
129
|
+
readonly expiresAt: string;
|
|
130
|
+
readonly grantedAt: string;
|
|
131
|
+
readonly leaseId: string;
|
|
132
|
+
readonly owner: {
|
|
133
|
+
readonly kind: "session";
|
|
134
|
+
readonly sessionId: string;
|
|
135
|
+
} | {
|
|
136
|
+
readonly kind: "principal";
|
|
137
|
+
readonly principalId: string;
|
|
138
|
+
};
|
|
139
|
+
readonly ports: readonly number[];
|
|
140
|
+
readonly purpose: string;
|
|
141
|
+
readonly revision: string;
|
|
142
|
+
readonly schemaVersion: "maia.port-lease/v1";
|
|
143
|
+
readonly state: "active" | "expired" | "released";
|
|
144
|
+
readonly updatedAt: string;
|
|
145
|
+
};
|
|
146
|
+
readonly probes: readonly {
|
|
147
|
+
readonly inUse: boolean;
|
|
148
|
+
readonly port: number;
|
|
149
|
+
}[];
|
|
150
|
+
}[];
|
|
151
|
+
readonly method: "port.lease.list";
|
|
152
|
+
readonly nextCursor?: string | undefined;
|
|
153
|
+
readonly range: {
|
|
154
|
+
readonly end: number;
|
|
155
|
+
readonly start: number;
|
|
156
|
+
};
|
|
157
|
+
}>;
|
|
158
|
+
};
|
|
159
|
+
export type PortLeaseCliDependencies = ReturnType<typeof makePortLeaseClient>;
|
|
160
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { portLeaseAcquireParametersSchema, portLeaseListParametersSchema, portLeaseReleaseParametersSchema, portLeaseRenewParametersSchema, } from "@maiaos/sdk";
|
|
2
|
+
const mutationClient = (node) => ({
|
|
3
|
+
acquirePortLease: (input) => node.runValidatedNodeOperation(input, portLeaseAcquireParametersSchema, (client, parameters, options) => client.acquirePortLease(parameters, options), { commandId: input.commandId }),
|
|
4
|
+
releasePortLease: (input) => node.runValidatedNodeOperation(input, portLeaseReleaseParametersSchema, (client, parameters, options) => client.releasePortLease(parameters, options), { commandId: input.commandId }),
|
|
5
|
+
renewPortLease: (input) => node.runValidatedNodeOperation(input, portLeaseRenewParametersSchema, (client, parameters, options) => client.renewPortLease(parameters, options), { commandId: input.commandId }),
|
|
6
|
+
});
|
|
7
|
+
export const makePortLeaseClient = (node) => ({
|
|
8
|
+
...mutationClient(node),
|
|
9
|
+
listPortLeases: (input) => node.runValidatedNodeOperation(input, portLeaseListParametersSchema, (client, parameters, options) => client.listPortLeases(parameters, options)),
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type CommandContext, type CommandEffect } from "../command-line/index.js";
|
|
2
|
+
export declare const runPortLeaseAcquire: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
3
|
+
export declare const runPortLeaseList: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
4
|
+
export declare const runPortLeaseRelease: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
5
|
+
export declare const runPortLeaseRenew: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
6
|
+
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import { writeNodeResult, } from "../command-line/index.js";
|
|
3
|
+
import { readPortLease, readPortList, readPortRelease, readPortRenew, } from "./input.js";
|
|
4
|
+
import { formatPortLeaseResult, } from "./output/index.js";
|
|
5
|
+
const run = (operation, input, context) => {
|
|
6
|
+
if (operation === undefined)
|
|
7
|
+
return Effect.die(new Error("Missing port lease client."));
|
|
8
|
+
return input.pipe(Effect.flatMap(operation), Effect.map((result) => writeNodeResult(result, context, {
|
|
9
|
+
toResult: (value) => ({ command: value.method, result: value }),
|
|
10
|
+
toText: formatPortLeaseResult,
|
|
11
|
+
})));
|
|
12
|
+
};
|
|
13
|
+
export const runPortLeaseAcquire = (tokens, context) => run(context.dependencies.acquirePortLease, readPortLease(tokens), context);
|
|
14
|
+
export const runPortLeaseList = (tokens, context) => run(context.dependencies.listPortLeases, readPortList(tokens), context);
|
|
15
|
+
export const runPortLeaseRelease = (tokens, context) => run(context.dependencies.releasePortLease, readPortRelease(tokens), context);
|
|
16
|
+
export const runPortLeaseRenew = (tokens, context) => run(context.dependencies.renewPortLease, readPortRenew(tokens), context);
|
|
17
|
+
//# sourceMappingURL=commands.js.map
|