@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,32 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { CliArgumentError, writeSuccess, } from "../command-line/index.js";
|
|
3
|
+
import { commandIdentifier } from "../local-node/index.js";
|
|
4
|
+
import { readConnectionSignin } from "./input.js";
|
|
5
|
+
import { localBrowserAvailable } from "./login.js";
|
|
6
|
+
import { formatConnectionResult, redactConnectionResult, } from "./output/index.js";
|
|
7
|
+
import { callNode } from "./resolve.js";
|
|
8
|
+
const parseSignin = (tokens) => Effect.try({
|
|
9
|
+
catch: (error) => error instanceof CliArgumentError
|
|
10
|
+
? error
|
|
11
|
+
: new CliArgumentError("Invalid connection input."),
|
|
12
|
+
try: () => readConnectionSignin(tokens),
|
|
13
|
+
});
|
|
14
|
+
const startSignin = (context, input) => Effect.gen(function* () {
|
|
15
|
+
const connectionId = input.connection;
|
|
16
|
+
const shown = yield* callNode(context.dependencies.showConnection, (show) => show({ connectionId }));
|
|
17
|
+
const commandId = yield* commandIdentifier(input.commandId);
|
|
18
|
+
const localBrowser = yield* localBrowserAvailable;
|
|
19
|
+
return yield* callNode(context.dependencies.startConnectionLogin, (start) => start({
|
|
20
|
+
commandId,
|
|
21
|
+
connectionId,
|
|
22
|
+
expectedRevision: shown.connection.revision,
|
|
23
|
+
flow: input.flow === "device-code" || !localBrowser
|
|
24
|
+
? "device-code"
|
|
25
|
+
: "browser",
|
|
26
|
+
}));
|
|
27
|
+
});
|
|
28
|
+
export const signInThroughNode = (tokens, context) => parseSignin(tokens).pipe(Effect.flatMap((input) => startSignin(context, input)), Effect.map((started) => {
|
|
29
|
+
writeSuccess({ command: started.method, result: redactConnectionResult(started) }, context, formatConnectionResult);
|
|
30
|
+
return 0;
|
|
31
|
+
}));
|
|
32
|
+
//# sourceMappingURL=signin.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type CommandContext, type CommandEffect } from "../command-line/index.js";
|
|
2
|
+
export declare const runConnectionDetect: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
3
|
+
export declare const runSetup: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
4
|
+
//# sourceMappingURL=system.d.ts.map
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { connectionSystemConfirmParametersSchema, } from "@maiaos/sdk";
|
|
2
|
+
import * as Data from "effect/Data";
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
import { askToConfirm, CliArgumentError, confirmParameters, EXIT_CANCELLED, parseOptions, promptOrRefuse, readPipedPreview, reportError, requestedTwoPhaseMode, requirePositionals, TWO_PHASE_FLAGS, } from "../command-line/index.js";
|
|
5
|
+
import { commandIdentifier, } from "../local-node/index.js";
|
|
6
|
+
class SetupNodeError extends Data.TaggedError("SetupNodeError") {
|
|
7
|
+
}
|
|
8
|
+
const required = (effect) => effect === undefined
|
|
9
|
+
? Effect.fail(new CliArgumentError("Connections are unavailable."))
|
|
10
|
+
: Effect.flatMap(effect, (result) => result.ok
|
|
11
|
+
? Effect.succeed(result.value)
|
|
12
|
+
: Effect.fail(new SetupNodeError({ error: result.error })));
|
|
13
|
+
const write = (context, output, text) => {
|
|
14
|
+
context.io.stdout(context.json ? `${JSON.stringify({ ok: true, result: output })}\n` : text);
|
|
15
|
+
};
|
|
16
|
+
const nodeLocal = (value) => ({
|
|
17
|
+
...value,
|
|
18
|
+
pathScope: "node-local",
|
|
19
|
+
});
|
|
20
|
+
const markDetected = (detected) => ({
|
|
21
|
+
...detected,
|
|
22
|
+
executors: detected.executors.map((item) => item.binary.found ? { ...item, binary: nodeLocal(item.binary) } : item),
|
|
23
|
+
});
|
|
24
|
+
const markPreview = (preview) => ({
|
|
25
|
+
...preview,
|
|
26
|
+
items: preview.items.map((item) => item.executable === undefined
|
|
27
|
+
? item
|
|
28
|
+
: { ...item, executable: nodeLocal(item.executable) }),
|
|
29
|
+
});
|
|
30
|
+
const signIn = (item) => {
|
|
31
|
+
if (item.endpoint !== undefined)
|
|
32
|
+
return `custom endpoint ${item.endpoint.host} (${item.endpoint.credential === "helper" ? "credential helper" : "key variable"})`;
|
|
33
|
+
const kind = item.accountKind === undefined ? "" : ` (${item.accountKind})`;
|
|
34
|
+
if (item.auth === "vendor-login")
|
|
35
|
+
return `signed in${kind}`;
|
|
36
|
+
return item.auth === "none" ? "signed out" : "sign-in unknown";
|
|
37
|
+
};
|
|
38
|
+
const detectedText = (item) => {
|
|
39
|
+
if (!item.binary.found)
|
|
40
|
+
return `${item.executor}: not installed\n`;
|
|
41
|
+
const { onNodePath, path, version } = item.binary;
|
|
42
|
+
const account = item.connection === undefined
|
|
43
|
+
? "no system-default account"
|
|
44
|
+
: `account ${item.connection.name} (${item.connection.state})`;
|
|
45
|
+
return [
|
|
46
|
+
`${item.executor} ${version ?? "(version unknown)"} ${path}${onNodePath ? "" : " (not on the Node's PATH)"}`,
|
|
47
|
+
` ${signIn(item)}; ${account}; executable ${item.executableApproved ? "approved" : "not approved"}`,
|
|
48
|
+
...(item.endpoint?.hint === undefined ? [] : [` ${item.endpoint.hint}`]),
|
|
49
|
+
"",
|
|
50
|
+
].join("\n");
|
|
51
|
+
};
|
|
52
|
+
export const runConnectionDetect = (tokens, context) => Effect.gen(function* () {
|
|
53
|
+
requirePositionals(tokens, 0);
|
|
54
|
+
const detected = yield* required(context.dependencies.detectConnections?.({}));
|
|
55
|
+
write(context, { command: "connection.detect", result: markDetected(detected) }, detected.executors.map(detectedText).join(""));
|
|
56
|
+
return 0;
|
|
57
|
+
}).pipe(Effect.catch(reportSetupFailure(context)));
|
|
58
|
+
const SKIPPED = new Map([
|
|
59
|
+
["approval-unavailable", "this Node cannot approve vendor executables"],
|
|
60
|
+
["auth-unknown", "Maia could not read its sign-in"],
|
|
61
|
+
[
|
|
62
|
+
"env-key-endpoint",
|
|
63
|
+
"its custom endpoint reads a key variable, which Maia Sessions do not pass",
|
|
64
|
+
],
|
|
65
|
+
["missing", "not installed"],
|
|
66
|
+
["name-taken", "the default account names are taken"],
|
|
67
|
+
[
|
|
68
|
+
"not-on-node-path",
|
|
69
|
+
"not on the Node's PATH; start the Node from a shell that finds it",
|
|
70
|
+
],
|
|
71
|
+
[
|
|
72
|
+
"settings-endpoint",
|
|
73
|
+
"its custom endpoint lives in ~/.claude/settings.json, which Maia's Claude Sessions do not load",
|
|
74
|
+
],
|
|
75
|
+
["signed-out", "signed out; sign in with the CLI itself first"],
|
|
76
|
+
]);
|
|
77
|
+
const skipText = (item) => `${SKIPPED.get(item.reason ?? "missing") ?? ""}${item.endpoint?.hint === undefined ? "" : `; ${item.endpoint.hint}`}`;
|
|
78
|
+
const itemText = (item) => {
|
|
79
|
+
if (item.reason !== undefined)
|
|
80
|
+
return ` ${item.executor}: skipped, ${skipText(item)}\n`;
|
|
81
|
+
const { connection, endpoint, executable, executor } = item;
|
|
82
|
+
const account = connection?.action === "create"
|
|
83
|
+
? `create account ${connection.name} (system default, ${String(connection.maxConcurrentSessions)} Sessions)`
|
|
84
|
+
: `use account ${connection?.name ?? ""} (${String(connection?.maxConcurrentSessions ?? "")} Sessions)`;
|
|
85
|
+
const approval = executable?.action === "approve"
|
|
86
|
+
? `approve ${executable.path}`
|
|
87
|
+
: "executable already approved";
|
|
88
|
+
const through = endpoint === undefined ? "" : `, through ${endpoint.host}`;
|
|
89
|
+
return ` ${executor} ${executable?.version ?? ""}: ${account}; ${approval}${through}\n`;
|
|
90
|
+
};
|
|
91
|
+
const hasWork = (item) => item.connection?.action === "create" || item.executable?.action === "approve";
|
|
92
|
+
const previewText = (preview) => `Maia uses the installed CLIs as they are, with your own login and config:\n${preview.items.map(itemText).join("")}${(preview.notes ?? []).map((note) => ` note: ${note}\n`).join("")}`;
|
|
93
|
+
const withCapacityNotes = (plan, requested) => {
|
|
94
|
+
const notes = plan.items.flatMap(({ connection, reason }) => requested === undefined ||
|
|
95
|
+
reason !== undefined ||
|
|
96
|
+
connection?.action !== "existing" ||
|
|
97
|
+
connection.maxConcurrentSessions === requested
|
|
98
|
+
? []
|
|
99
|
+
: [
|
|
100
|
+
`existing account ${connection.name} keeps Sessions<=${String(connection.maxConcurrentSessions)}, not ${String(requested)}; use 'maia connection capacity set ${connection.name} --max-sessions ${String(requested)} --expected-revision <revision>' to change it.`,
|
|
101
|
+
]);
|
|
102
|
+
return notes.length === 0 ? plan : { ...plan, notes };
|
|
103
|
+
};
|
|
104
|
+
const confirmedText = (result) => result.items
|
|
105
|
+
.map((item) => `${item.executor}: account ${item.connection.name} (${item.connection.connectionId})${item.connectionReceipt === undefined ? "" : ", created"}${item.approvalReceipt === undefined ? "" : ", executable approved"}\n`)
|
|
106
|
+
.join("") || "Nothing changed.\n";
|
|
107
|
+
const readSetup = (parsed) => {
|
|
108
|
+
requirePositionals(parsed.positionals, 0);
|
|
109
|
+
const sessions = parsed.options.get("--max-sessions");
|
|
110
|
+
if (sessions !== undefined && !/^(?:[1-9]|1[0-6])$/u.test(sessions))
|
|
111
|
+
throw new CliArgumentError("--max-sessions must be 1 to 16.");
|
|
112
|
+
return {
|
|
113
|
+
commandId: parsed.options.get("--command-id"),
|
|
114
|
+
...(sessions === undefined
|
|
115
|
+
? {}
|
|
116
|
+
: { maxConcurrentSessions: Number(sessions) }),
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
const confirm = (context, preview) => Effect.gen(function* () {
|
|
120
|
+
const parameters = yield* confirmParameters(connectionSystemConfirmParametersSchema, preview, ["items", "notes"]);
|
|
121
|
+
return yield* required(context.dependencies.confirmSystemConnections?.(parameters));
|
|
122
|
+
});
|
|
123
|
+
const preview = (context, input) => Effect.flatMap(commandIdentifier(input.commandId), (commandId) => required(context.dependencies.previewSystemConnections?.({
|
|
124
|
+
commandId,
|
|
125
|
+
...(input.maxConcurrentSessions === undefined
|
|
126
|
+
? {}
|
|
127
|
+
: { maxConcurrentSessions: input.maxConcurrentSessions }),
|
|
128
|
+
})).pipe(Effect.map((plan) => withCapacityNotes(plan, input.maxConcurrentSessions))));
|
|
129
|
+
const settled = (context, plan) => {
|
|
130
|
+
if (plan.items.some((item) => item.reason === undefined)) {
|
|
131
|
+
write(context, { command: "setup", result: { preview: markPreview(plan) } }, `${previewText(plan)}Already set up.\n`);
|
|
132
|
+
return 0;
|
|
133
|
+
}
|
|
134
|
+
if (!context.json)
|
|
135
|
+
context.io.stdout(previewText(plan));
|
|
136
|
+
const reasons = plan.items
|
|
137
|
+
.map((item) => `${item.executor} ${skipText(item)}`)
|
|
138
|
+
.join("; ");
|
|
139
|
+
return reportError({
|
|
140
|
+
code: "resource_not_found",
|
|
141
|
+
message: `No installed CLI is usable: ${reasons}.`,
|
|
142
|
+
retryable: false,
|
|
143
|
+
}, context);
|
|
144
|
+
};
|
|
145
|
+
const writeConfirmed = (context, result, plan) => {
|
|
146
|
+
write(context, {
|
|
147
|
+
command: "setup",
|
|
148
|
+
result: {
|
|
149
|
+
...(plan === undefined ? {} : { preview: markPreview(plan) }),
|
|
150
|
+
result,
|
|
151
|
+
},
|
|
152
|
+
}, confirmedText(result));
|
|
153
|
+
return 0;
|
|
154
|
+
};
|
|
155
|
+
const writeDryRun = (context, plan) => {
|
|
156
|
+
write(context, { command: "connection.system.preview", result: markPreview(plan) }, `${previewText(plan)}Confirm with: maia --json setup --dry-run | maia setup --confirm-stdin\n`);
|
|
157
|
+
return 0;
|
|
158
|
+
};
|
|
159
|
+
export const runSetup = (tokens, context) => Effect.gen(function* () {
|
|
160
|
+
const parsed = parseOptions(tokens, new Set(["--command-id", "--max-sessions"]), new Set(["--yes", ...TWO_PHASE_FLAGS]));
|
|
161
|
+
const input = readSetup(parsed);
|
|
162
|
+
const requested = requestedTwoPhaseMode(parsed.flags, true);
|
|
163
|
+
if (requested === "confirm-stdin")
|
|
164
|
+
return writeConfirmed(context, yield* confirm(context, yield* readPipedPreview(context)));
|
|
165
|
+
const plan = yield* preview(context, input);
|
|
166
|
+
if (requested === "dry-run")
|
|
167
|
+
return writeDryRun(context, plan);
|
|
168
|
+
if (!plan.items.some(hasWork))
|
|
169
|
+
return settled(context, plan);
|
|
170
|
+
const mode = requested ?? promptOrRefuse(context, true);
|
|
171
|
+
if (!context.json)
|
|
172
|
+
context.io.stdout(previewText(plan));
|
|
173
|
+
if (mode === "prompt" && !(yield* askToConfirm(context, "Use them?"))) {
|
|
174
|
+
context.io.stderr("Cancelled; nothing changed.\n");
|
|
175
|
+
return EXIT_CANCELLED;
|
|
176
|
+
}
|
|
177
|
+
return writeConfirmed(context, yield* confirm(context, plan), plan);
|
|
178
|
+
}).pipe(Effect.catch(reportSetupFailure(context)));
|
|
179
|
+
const reportSetupFailure = (context) => (error) => Effect.sync(() => reportError(error instanceof SetupNodeError
|
|
180
|
+
? error.error
|
|
181
|
+
: {
|
|
182
|
+
code: error instanceof CliArgumentError
|
|
183
|
+
? "invalid_argument"
|
|
184
|
+
: "internal_error",
|
|
185
|
+
message: error instanceof CliArgumentError
|
|
186
|
+
? error.message
|
|
187
|
+
: "The setup command failed.",
|
|
188
|
+
retryable: false,
|
|
189
|
+
}, context));
|
|
190
|
+
//# sourceMappingURL=system.js.map
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
const connection = () => import("../index.js");
|
|
2
|
+
const login = () => import("../../login/index.js");
|
|
3
|
+
const integration = () => import("../../integration/index.js");
|
|
4
|
+
const provider = () => import("../../provider/index.js");
|
|
5
|
+
const loginRunner = [login, "runLogin"];
|
|
6
|
+
export const CONNECTION_TREE = {
|
|
7
|
+
groups: [
|
|
8
|
+
["connection", "Worker account Connections."],
|
|
9
|
+
["connection login", "Sign-ins the Node starts."],
|
|
10
|
+
["connection usage", "A Connection's usage."],
|
|
11
|
+
["connection models", "Models a Connection offers."],
|
|
12
|
+
["connection capacity", "A Connection's Session limit."],
|
|
13
|
+
["integration", "Approve vendor executables."],
|
|
14
|
+
["integration plan", "Plan approving a vendor executable."],
|
|
15
|
+
["integration status", "A vendor integration's status."],
|
|
16
|
+
["integration apply", "Approve a vendor executable with a plan."],
|
|
17
|
+
["integration remove", "Remove a vendor integration."],
|
|
18
|
+
["provider", "Model providers."],
|
|
19
|
+
["provider pool", "Model-provider pools."],
|
|
20
|
+
],
|
|
21
|
+
leaves: [
|
|
22
|
+
[
|
|
23
|
+
"setup [--max-sessions <1..16>] [--command-id <id>] [--dry-run | --confirm-stdin | --yes]",
|
|
24
|
+
1,
|
|
25
|
+
["connection.system.preview", "connection.system.confirm"],
|
|
26
|
+
"Use the installed vendor CLIs as system-default accounts.",
|
|
27
|
+
{
|
|
28
|
+
example: "maia setup --max-sessions 4",
|
|
29
|
+
kind: "two-phase",
|
|
30
|
+
run: [connection, "runSetup"],
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
[
|
|
34
|
+
"login",
|
|
35
|
+
1,
|
|
36
|
+
"",
|
|
37
|
+
"List worker accounts and model providers.",
|
|
38
|
+
{ kind: "composite", run: loginRunner },
|
|
39
|
+
],
|
|
40
|
+
[
|
|
41
|
+
"login <claude|codex> [--name <name>] [--device-code] [--max-sessions <1..16>]",
|
|
42
|
+
1,
|
|
43
|
+
"",
|
|
44
|
+
"Add or re-sign a Claude Code or Codex account.",
|
|
45
|
+
{
|
|
46
|
+
example: "maia login codex --name codex-2 --device-code",
|
|
47
|
+
kind: "composite",
|
|
48
|
+
run: loginRunner,
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
[
|
|
52
|
+
"login <model-provider> [--api-key-stdin]",
|
|
53
|
+
1,
|
|
54
|
+
"",
|
|
55
|
+
"Sign in a model provider for Maia's agent.",
|
|
56
|
+
{ kind: "composite", run: loginRunner },
|
|
57
|
+
],
|
|
58
|
+
[
|
|
59
|
+
"login gateway --name <name> --base-url <url> --api-key-stdin [--max-sessions <1..16>] [--command-id <id>]",
|
|
60
|
+
1,
|
|
61
|
+
"connection.gateway.create",
|
|
62
|
+
"Add an AI gateway Connection with its API key.",
|
|
63
|
+
{ run: [login, "runLoginGateway"] },
|
|
64
|
+
],
|
|
65
|
+
[
|
|
66
|
+
"connection create --name <name> --executor <codex-cli|claude-code> --root <maia-managed|system-default> [--max-sessions <1..16>] [--command-id <id>]",
|
|
67
|
+
1,
|
|
68
|
+
"connection.create",
|
|
69
|
+
"Create a worker account Connection.",
|
|
70
|
+
{ run: [connection, "runConnectionCreate"] },
|
|
71
|
+
],
|
|
72
|
+
[
|
|
73
|
+
"connection list [--limit <1..100>] [--after <cursor>]",
|
|
74
|
+
1,
|
|
75
|
+
"connection.list",
|
|
76
|
+
"List Connections.",
|
|
77
|
+
{
|
|
78
|
+
example: "maia --json connection list",
|
|
79
|
+
run: [connection, "runConnectionList"],
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
[
|
|
83
|
+
"connection show <connection>",
|
|
84
|
+
1,
|
|
85
|
+
"connection.show",
|
|
86
|
+
"Show one Connection by name or ID.",
|
|
87
|
+
{ run: [connection, "runConnectionShow"] },
|
|
88
|
+
],
|
|
89
|
+
[
|
|
90
|
+
"connection detect",
|
|
91
|
+
1,
|
|
92
|
+
"connection.detect",
|
|
93
|
+
"Detect the installed vendor CLIs.",
|
|
94
|
+
{
|
|
95
|
+
example: "maia --json connection detect",
|
|
96
|
+
run: [connection, "runConnectionDetect"],
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
[
|
|
100
|
+
"connection login start <connection> [--device-code] [--command-id <id>]",
|
|
101
|
+
1,
|
|
102
|
+
"connection.login.start",
|
|
103
|
+
"Start a Node-side sign-in for a Connection.",
|
|
104
|
+
{ run: [connection, "runConnectionLoginStart"] },
|
|
105
|
+
],
|
|
106
|
+
[
|
|
107
|
+
"connection usage show <connection> [--refresh]",
|
|
108
|
+
1,
|
|
109
|
+
"connection.usage.show",
|
|
110
|
+
"Show a Connection's usage.",
|
|
111
|
+
{ run: [connection, "runConnectionUsageShow"] },
|
|
112
|
+
],
|
|
113
|
+
[
|
|
114
|
+
"connection models list --connection <connection>",
|
|
115
|
+
1,
|
|
116
|
+
"connection.models.list",
|
|
117
|
+
"List the models a Connection offers.",
|
|
118
|
+
{ run: [connection, "runConnectionModelsList"] },
|
|
119
|
+
],
|
|
120
|
+
[
|
|
121
|
+
"connection capacity set <connection> --max-sessions <1..16> --expected-revision <revision> [--command-id <id>]",
|
|
122
|
+
1,
|
|
123
|
+
"connection.capacity.set",
|
|
124
|
+
"Set a Connection's Session limit.",
|
|
125
|
+
{ run: [connection, "runConnectionCapacitySet"] },
|
|
126
|
+
],
|
|
127
|
+
[
|
|
128
|
+
"connection enable <connection> --expected-revision <revision> [--command-id <id>]",
|
|
129
|
+
1,
|
|
130
|
+
"connection.state.set",
|
|
131
|
+
"Enable a Connection.",
|
|
132
|
+
{ kind: "discriminant", run: [connection, "runConnectionEnable"] },
|
|
133
|
+
],
|
|
134
|
+
[
|
|
135
|
+
"connection disable <connection> --expected-revision <revision> [--command-id <id>]",
|
|
136
|
+
1,
|
|
137
|
+
"connection.state.set",
|
|
138
|
+
"Disable a Connection.",
|
|
139
|
+
{ kind: "discriminant", run: [connection, "runConnectionDisable"] },
|
|
140
|
+
],
|
|
141
|
+
[
|
|
142
|
+
"integration plan codex",
|
|
143
|
+
1,
|
|
144
|
+
"integration.plan.codex",
|
|
145
|
+
"Plan approving the Codex executable.",
|
|
146
|
+
{
|
|
147
|
+
example: "maia integration plan codex",
|
|
148
|
+
run: [integration, "runPlanCodex"],
|
|
149
|
+
},
|
|
150
|
+
],
|
|
151
|
+
[
|
|
152
|
+
"integration plan claude-code",
|
|
153
|
+
1,
|
|
154
|
+
"integration.plan.claude-code",
|
|
155
|
+
"Plan approving the Claude Code executable.",
|
|
156
|
+
{ run: [integration, "runPlanClaudeCode"] },
|
|
157
|
+
],
|
|
158
|
+
[
|
|
159
|
+
"integration status codex",
|
|
160
|
+
1,
|
|
161
|
+
"integration.status.codex",
|
|
162
|
+
"Show the Codex integration status.",
|
|
163
|
+
{ run: [integration, "runStatusCodex"] },
|
|
164
|
+
],
|
|
165
|
+
[
|
|
166
|
+
"integration status claude-code",
|
|
167
|
+
1,
|
|
168
|
+
"integration.status.claude-code",
|
|
169
|
+
"Show the Claude Code integration status.",
|
|
170
|
+
{ run: [integration, "runStatusClaudeCode"] },
|
|
171
|
+
],
|
|
172
|
+
[
|
|
173
|
+
"integration apply codex --plan <plan-id> [--command-id <id>]",
|
|
174
|
+
1,
|
|
175
|
+
"integration.apply.codex",
|
|
176
|
+
"Approve the Codex executable with a plan.",
|
|
177
|
+
{ run: [integration, "runApplyCodex"] },
|
|
178
|
+
],
|
|
179
|
+
[
|
|
180
|
+
"integration apply claude-code --plan <plan-id> [--command-id <id>]",
|
|
181
|
+
1,
|
|
182
|
+
"integration.apply.claude-code",
|
|
183
|
+
"Approve the Claude Code executable with a plan.",
|
|
184
|
+
{ run: [integration, "runApplyClaudeCode"] },
|
|
185
|
+
],
|
|
186
|
+
[
|
|
187
|
+
"integration remove codex [--command-id <id>]",
|
|
188
|
+
1,
|
|
189
|
+
"integration.remove.codex",
|
|
190
|
+
"Remove the Codex integration.",
|
|
191
|
+
{ run: [integration, "runRemoveCodex"] },
|
|
192
|
+
],
|
|
193
|
+
[
|
|
194
|
+
"integration remove claude-code [--command-id <id>]",
|
|
195
|
+
1,
|
|
196
|
+
"integration.remove.claude-code",
|
|
197
|
+
"Remove the Claude Code integration.",
|
|
198
|
+
{ run: [integration, "runRemoveClaudeCode"] },
|
|
199
|
+
],
|
|
200
|
+
[
|
|
201
|
+
"provider pool list",
|
|
202
|
+
1,
|
|
203
|
+
"provider.pool.list",
|
|
204
|
+
"List model-provider pools.",
|
|
205
|
+
{ run: [provider, "runProviderPoolList"] },
|
|
206
|
+
],
|
|
207
|
+
],
|
|
208
|
+
};
|
|
209
|
+
//# sourceMappingURL=tree.js.map
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { type ContainerCreateConfirmParameters, type ContainerCreatePreviewParameters, type ContainerIndexListParameters, type ContainerListParameters, type ContainerRenameConfirmParameters, type ContainerRenamePreviewParameters, type ContainerShowParameters } from "@maiaos/sdk";
|
|
2
|
+
import type { CliNodeOperations } from "../local-node/index.js";
|
|
3
|
+
export declare const makeContainerClient: (node: CliNodeOperations) => {
|
|
4
|
+
confirmContainerCreate: (input: ContainerCreateConfirmParameters) => import("../local-node/client.js").CliNodeEffect<{
|
|
5
|
+
readonly actorId: string;
|
|
6
|
+
readonly commandId: string;
|
|
7
|
+
readonly container: {
|
|
8
|
+
readonly createdAt: string;
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly name: string;
|
|
11
|
+
readonly revision: string;
|
|
12
|
+
readonly schemaVersion: "maia.container/v1";
|
|
13
|
+
readonly updatedAt: string;
|
|
14
|
+
};
|
|
15
|
+
readonly delivery: "duplicate" | "new";
|
|
16
|
+
readonly inputDigest: string;
|
|
17
|
+
readonly receipt: {
|
|
18
|
+
readonly actorId: string;
|
|
19
|
+
readonly aggregateRevision: string;
|
|
20
|
+
readonly commandId: string;
|
|
21
|
+
readonly createdAt: string;
|
|
22
|
+
readonly eventCursor: string;
|
|
23
|
+
readonly method: string;
|
|
24
|
+
readonly receiptId: string;
|
|
25
|
+
readonly schemaVersion: 1;
|
|
26
|
+
readonly state: "succeeded";
|
|
27
|
+
readonly target: {
|
|
28
|
+
readonly id: string;
|
|
29
|
+
readonly type: string;
|
|
30
|
+
};
|
|
31
|
+
readonly updatedAt: string;
|
|
32
|
+
};
|
|
33
|
+
readonly method: "container.create.confirm";
|
|
34
|
+
}>;
|
|
35
|
+
confirmContainerRename: (input: ContainerRenameConfirmParameters) => import("../local-node/client.js").CliNodeEffect<{
|
|
36
|
+
readonly actorId: string;
|
|
37
|
+
readonly commandId: string;
|
|
38
|
+
readonly container: {
|
|
39
|
+
readonly createdAt: string;
|
|
40
|
+
readonly id: string;
|
|
41
|
+
readonly name: string;
|
|
42
|
+
readonly revision: string;
|
|
43
|
+
readonly schemaVersion: "maia.container/v1";
|
|
44
|
+
readonly updatedAt: string;
|
|
45
|
+
};
|
|
46
|
+
readonly delivery: "duplicate" | "new";
|
|
47
|
+
readonly inputDigest: string;
|
|
48
|
+
readonly receipt: {
|
|
49
|
+
readonly actorId: string;
|
|
50
|
+
readonly aggregateRevision: string;
|
|
51
|
+
readonly commandId: string;
|
|
52
|
+
readonly createdAt: string;
|
|
53
|
+
readonly eventCursor: string;
|
|
54
|
+
readonly method: string;
|
|
55
|
+
readonly receiptId: string;
|
|
56
|
+
readonly schemaVersion: 1;
|
|
57
|
+
readonly state: "succeeded";
|
|
58
|
+
readonly target: {
|
|
59
|
+
readonly id: string;
|
|
60
|
+
readonly type: string;
|
|
61
|
+
};
|
|
62
|
+
readonly updatedAt: string;
|
|
63
|
+
};
|
|
64
|
+
readonly expectedRevision: string;
|
|
65
|
+
readonly method: "container.rename.confirm";
|
|
66
|
+
}>;
|
|
67
|
+
listContainerIndex: (input: ContainerIndexListParameters) => import("../local-node/client.js").CliNodeEffect<{
|
|
68
|
+
readonly items: readonly {
|
|
69
|
+
readonly container: {
|
|
70
|
+
readonly createdAt: string;
|
|
71
|
+
readonly id: string;
|
|
72
|
+
readonly name: string;
|
|
73
|
+
readonly revision: string;
|
|
74
|
+
readonly schemaVersion: "maia.container/v1";
|
|
75
|
+
readonly updatedAt: string;
|
|
76
|
+
};
|
|
77
|
+
readonly projectCount: number;
|
|
78
|
+
readonly projects: readonly {
|
|
79
|
+
readonly id: string;
|
|
80
|
+
readonly name: string;
|
|
81
|
+
readonly revision: string;
|
|
82
|
+
readonly path?: string | undefined;
|
|
83
|
+
}[];
|
|
84
|
+
}[];
|
|
85
|
+
readonly method: "container.index.list";
|
|
86
|
+
readonly nextCursor?: string | undefined;
|
|
87
|
+
}>;
|
|
88
|
+
listContainers: (input: ContainerListParameters) => import("../local-node/client.js").CliNodeEffect<{
|
|
89
|
+
readonly items: readonly {
|
|
90
|
+
readonly createdAt: string;
|
|
91
|
+
readonly id: string;
|
|
92
|
+
readonly name: string;
|
|
93
|
+
readonly revision: string;
|
|
94
|
+
readonly schemaVersion: "maia.container/v1";
|
|
95
|
+
readonly updatedAt: string;
|
|
96
|
+
}[];
|
|
97
|
+
readonly method: "container.list";
|
|
98
|
+
readonly nextCursor?: string | undefined;
|
|
99
|
+
}>;
|
|
100
|
+
previewContainerCreate: (input: ContainerCreatePreviewParameters) => import("../local-node/client.js").CliNodeEffect<{
|
|
101
|
+
readonly commandId: string;
|
|
102
|
+
readonly name: string;
|
|
103
|
+
readonly inputDigest: string;
|
|
104
|
+
readonly proof: string;
|
|
105
|
+
readonly actorId: string;
|
|
106
|
+
readonly expiresAt: string;
|
|
107
|
+
readonly issuedAt: string;
|
|
108
|
+
readonly containerId: string;
|
|
109
|
+
readonly method: "container.create.preview";
|
|
110
|
+
}>;
|
|
111
|
+
previewContainerRename: (input: ContainerRenamePreviewParameters) => import("../local-node/client.js").CliNodeEffect<{
|
|
112
|
+
readonly commandId: string;
|
|
113
|
+
readonly name: string;
|
|
114
|
+
readonly containerId: string;
|
|
115
|
+
readonly expectedRevision: string;
|
|
116
|
+
readonly inputDigest: string;
|
|
117
|
+
readonly proof: string;
|
|
118
|
+
readonly actorId: string;
|
|
119
|
+
readonly expiresAt: string;
|
|
120
|
+
readonly issuedAt: string;
|
|
121
|
+
readonly method: "container.rename.preview";
|
|
122
|
+
}>;
|
|
123
|
+
showContainer: (input: ContainerShowParameters) => import("../local-node/client.js").CliNodeEffect<{
|
|
124
|
+
readonly container: {
|
|
125
|
+
readonly createdAt: string;
|
|
126
|
+
readonly id: string;
|
|
127
|
+
readonly name: string;
|
|
128
|
+
readonly revision: string;
|
|
129
|
+
readonly schemaVersion: "maia.container/v1";
|
|
130
|
+
readonly updatedAt: string;
|
|
131
|
+
};
|
|
132
|
+
readonly method: "container.show";
|
|
133
|
+
readonly nextCursor?: string | undefined;
|
|
134
|
+
readonly projects: readonly {
|
|
135
|
+
readonly id: string;
|
|
136
|
+
readonly name: string;
|
|
137
|
+
readonly revision: string;
|
|
138
|
+
}[];
|
|
139
|
+
}>;
|
|
140
|
+
};
|
|
141
|
+
export type ContainerCliDependencies = ReturnType<typeof makeContainerClient>;
|
|
142
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { containerCreateConfirmParametersSchema, containerCreatePreviewParametersSchema, containerIndexListParametersSchema, containerListParametersSchema, containerRenameConfirmParametersSchema, containerRenamePreviewParametersSchema, containerShowParametersSchema, } from "@maiaos/sdk";
|
|
2
|
+
export const makeContainerClient = (node) => ({
|
|
3
|
+
confirmContainerCreate: (input) => node.runValidatedNodeOperation(input, containerCreateConfirmParametersSchema, (client, parameters, options) => client.confirmContainerCreate(parameters, options), { commandId: input.commandId }),
|
|
4
|
+
confirmContainerRename: (input) => node.runValidatedNodeOperation(input, containerRenameConfirmParametersSchema, (client, parameters, options) => client.confirmContainerRename(parameters, options), { commandId: input.commandId }),
|
|
5
|
+
listContainerIndex: (input) => node.runValidatedNodeOperation(input, containerIndexListParametersSchema, (client, parameters, options) => client.listContainerIndex(parameters, options)),
|
|
6
|
+
listContainers: (input) => node.runValidatedNodeOperation(input, containerListParametersSchema, (client, parameters, options) => client.listContainers(parameters, options)),
|
|
7
|
+
previewContainerCreate: (input) => node.runValidatedNodeOperation(input, containerCreatePreviewParametersSchema, (client, parameters, options) => client.previewContainerCreate(parameters, options)),
|
|
8
|
+
previewContainerRename: (input) => node.runValidatedNodeOperation(input, containerRenamePreviewParametersSchema, (client, parameters, options) => client.previewContainerRename(parameters, options)),
|
|
9
|
+
showContainer: (input) => node.runValidatedNodeOperation(input, containerShowParametersSchema, (client, parameters, options) => client.showContainer(parameters, options)),
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type CommandContext, type CommandEffect } from "../command-line/index.js";
|
|
2
|
+
export declare const runContainerList: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
3
|
+
export declare const runContainerShow: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
4
|
+
export declare const runContainerIndexList: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
5
|
+
export declare const runContainerCreate: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
6
|
+
export declare const runContainerRename: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
7
|
+
//# sourceMappingURL=commands.d.ts.map
|