@maiaos/cli 0.1.0-canary.6 → 0.1.0-canary.60
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 +8 -7
- package/dist/agents/client.d.ts +47 -27
- package/dist/agents/client.js +10 -3
- package/dist/agents/commands.d.ts +1 -0
- package/dist/agents/commands.js +24 -2
- package/dist/agents/index.d.ts +1 -1
- package/dist/agents/index.js +1 -1
- package/dist/agents/input.js +6 -0
- package/dist/agents/output/format.js +11 -0
- package/dist/agents/tree/tree.js +13 -1
- package/dist/bin/maia.cdx.json +19 -19
- package/dist/bin/maia.mjs +1 -1
- package/dist/cli/cli.d.ts +8 -2
- package/dist/cli/cli.js +29 -6
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/command-line/context.d.ts +4 -2
- package/dist/command-line/emit/index.d.ts +4 -0
- package/dist/command-line/emit/index.js +4 -0
- package/dist/command-line/{output.d.ts → emit/output.d.ts} +2 -2
- package/dist/command-line/{rows.d.ts → emit/rows.d.ts} +2 -0
- package/dist/command-line/{rows.js → emit/rows.js} +8 -0
- package/dist/command-line/index.d.ts +5 -5
- package/dist/command-line/index.js +5 -5
- package/dist/command-line/input/arguments.d.ts +10 -0
- package/dist/command-line/input/arguments.js +30 -10
- package/dist/command-line/input/index.d.ts +2 -1
- package/dist/command-line/input/index.js +2 -1
- package/dist/command-line/input/manager-options.d.ts +10 -0
- package/dist/command-line/input/manager-options.js +38 -0
- package/dist/command-line/two-phase/index.d.ts +2 -0
- package/dist/command-line/two-phase/index.js +2 -0
- package/dist/command-line/{two-phase.d.ts → two-phase/two-phase.d.ts} +12 -12
- package/dist/command-line/{two-phase.js → two-phase/two-phase.js} +2 -2
- package/dist/command-receipt/command.js +1 -1
- package/dist/command-tree/tree.d.ts +1 -1
- package/dist/command-tree/tree.js +6 -1
- package/dist/connection/input.js +2 -2
- package/dist/connection/system.js +3 -2
- package/dist/connection/tree/tree.js +5 -5
- package/dist/events/commands.js +65 -0
- package/dist/events/index.js +2 -0
- package/dist/events/tree/index.js +2 -0
- package/dist/events/tree/tree.js +17 -0
- package/dist/import/batch.js +196 -0
- package/dist/import/client.d.ts +3 -3
- package/dist/import/client.js +1 -1
- package/dist/import/commands.d.ts +1 -0
- package/dist/import/commands.js +82 -8
- package/dist/import/index.d.ts +1 -1
- package/dist/import/index.js +1 -1
- package/dist/import/input.js +38 -3
- package/dist/import/manifest.js +107 -0
- package/dist/import/output.js +46 -2
- package/dist/local-node/client.d.ts +1 -0
- package/dist/local-node/client.js +1 -0
- package/dist/local-node/index.d.ts +2 -1
- package/dist/local-node/index.js +2 -1
- package/dist/local-node/wait.d.ts +10 -0
- package/dist/local-node/wait.js +17 -0
- package/dist/login/gateway.js +2 -2
- package/dist/login/vendor-input.js +2 -2
- package/dist/mcp/calls.js +6 -1
- package/dist/mcp/routing.js +1 -0
- package/dist/project-guard/client.d.ts +12 -0
- package/dist/project-guard/input.js +15 -1
- package/dist/project-guard/output/format.js +5 -0
- package/dist/project-workspace/tree/tree.js +1 -1
- package/dist/reference/resolve.js +9 -2
- package/dist/remote-node/connector.js +8 -1
- package/dist/run-ledger/client.d.ts +2 -0
- package/dist/session/agent-permission.d.ts +2 -2
- package/dist/session/approval/client.d.ts +5 -2
- package/dist/session/approval/client.js +2 -2
- package/dist/session/approval/commands.d.ts +1 -0
- package/dist/session/approval/commands.js +97 -17
- package/dist/session/approval/index.d.ts +1 -1
- package/dist/session/approval/index.js +1 -1
- package/dist/session/client.d.ts +14 -3
- package/dist/session/client.js +17 -2
- package/dist/session/coding-client.d.ts +2 -0
- package/dist/session/coding-client.js +1 -2
- package/dist/session/coding-commands.js +24 -7
- package/dist/session/commands.d.ts +1 -0
- package/dist/session/commands.js +131 -18
- package/dist/session/create-tasks.js +10 -2
- package/dist/session/index.d.ts +1 -1
- package/dist/session/index.js +1 -1
- package/dist/session/output/human.js +32 -5
- package/dist/session/output/index.js +1 -1
- package/dist/session/output/tasks.js +51 -7
- package/dist/session/tree/tree.js +52 -19
- package/dist/session/turn/client.js +7 -9
- package/dist/session/turn/commands.js +67 -20
- package/dist/session/turn/output.d.ts +6 -0
- package/dist/session/turn/output.js +12 -2
- package/dist/status/client.d.ts +14 -3
- package/dist/status/command.js +3 -1
- package/dist/status/doctor.d.ts +5 -1
- package/dist/status/doctor.js +10 -4
- package/dist/status/output/compact.d.ts +3 -0
- package/dist/status/output/compact.js +17 -7
- package/dist/status/output/human.js +15 -0
- package/dist/terminal/control-commands.js +26 -9
- package/dist/terminal/keys.js +62 -0
- package/dist/terminal/output/compact-list.js +3 -0
- package/dist/terminal/output/human.js +2 -2
- package/dist/terminal/tree/tree.js +1 -1
- package/dist/webhooks/client.d.ts +156 -0
- package/dist/webhooks/client.js +8 -0
- package/dist/webhooks/commands.d.ts +17 -0
- package/dist/webhooks/commands.js +76 -0
- package/dist/webhooks/index.d.ts +3 -0
- package/dist/webhooks/index.js +3 -0
- package/dist/webhooks/input.js +125 -0
- package/dist/webhooks/output/format.js +75 -0
- package/dist/webhooks/output/index.js +2 -0
- package/dist/webhooks/tree/index.js +2 -0
- package/dist/webhooks/tree/tree.js +49 -0
- package/guidance/maia-cli/SKILL.md +1 -1
- package/guidance/maia-node/SKILL.md +54 -0
- package/guidance/maia-orchestration/SKILL.md +1 -2
- package/guidance/maia-sessions/SKILL.md +69 -0
- package/package.json +5 -5
- package/dist/address-space/address-space.d.ts +0 -38
- package/dist/address-space/index.d.ts +0 -2
- package/dist/agents/input.d.ts +0 -130
- package/dist/agents/output/format.d.ts +0 -8
- package/dist/agents/output/index.d.ts +0 -2
- package/dist/agents/tree/index.d.ts +0 -2
- package/dist/agents/tree/tree.d.ts +0 -3
- package/dist/bootstrap/exit.d.ts +0 -14
- package/dist/bootstrap/exit.js +0 -42
- package/dist/bootstrap/index.d.ts +0 -3
- package/dist/bootstrap/index.js +0 -3
- package/dist/bootstrap/process.d.ts +0 -5
- package/dist/bootstrap/process.js +0 -23
- package/dist/bootstrap/run.d.ts +0 -25
- package/dist/bootstrap/run.js +0 -95
- package/dist/bootstrap/stdio.d.ts +0 -4
- package/dist/bootstrap/stdio.js +0 -9
- package/dist/cli/environment.d.ts +0 -8
- package/dist/cli/services.d.ts +0 -4
- package/dist/command-line/input/stdin-stream.d.ts +0 -4
- package/dist/command-line/json-decoder.d.ts +0 -3
- package/dist/command-receipt/command.d.ts +0 -4
- package/dist/command-receipt/compact-list.d.ts +0 -20
- package/dist/command-receipt/index.d.ts +0 -3
- package/dist/command-tree/completion.d.ts +0 -6
- package/dist/command-tree/local.d.ts +0 -3
- package/dist/command-tree/row.js +0 -2
- package/dist/connection/access/format.d.ts +0 -8
- package/dist/connection/access/input.d.ts +0 -53
- package/dist/connection/input.d.ts +0 -50
- package/dist/connection/signin.d.ts +0 -4
- package/dist/connection/tree/index.d.ts +0 -2
- package/dist/connection/tree/tree.d.ts +0 -3
- package/dist/container/output/format.d.ts +0 -11
- package/dist/container/output/index.d.ts +0 -2
- package/dist/context/client.d.ts +0 -7
- package/dist/context/commands.d.ts +0 -3
- package/dist/context/index.d.ts +0 -3
- package/dist/dashboard/cockpit-client.d.ts +0 -6
- package/dist/dashboard/cockpit-client.js +0 -27
- package/dist/dashboard/cockpits.d.ts +0 -29
- package/dist/dashboard/cockpits.js +0 -65
- package/dist/dashboard/dashboard.d.ts +0 -7
- package/dist/dashboard/draw.d.ts +0 -15
- package/dist/dashboard/frame.d.ts +0 -4
- package/dist/dashboard/index.d.ts +0 -2
- package/dist/dashboard/modes.d.ts +0 -5
- package/dist/dashboard/node-connection.d.ts +0 -15
- package/dist/dashboard/node-connection.js +0 -51
- package/dist/dashboard/pi-tui.d.ts +0 -6
- package/dist/dashboard/status-bar.d.ts +0 -4
- package/dist/dashboard/terminal.d.ts +0 -53
- package/dist/dashboard/tree-model.d.ts +0 -28
- package/dist/dashboard/tree.d.ts +0 -10
- package/dist/development/cli.d.ts +0 -3
- package/dist/development/cli.js +0 -44
- package/dist/execution/tree/index.d.ts +0 -2
- package/dist/execution/tree/tree.d.ts +0 -3
- package/dist/hold/output/format.d.ts +0 -11
- package/dist/hold/output/index.d.ts +0 -2
- package/dist/hold/tree/index.d.ts +0 -2
- package/dist/hold/tree/tree.d.ts +0 -3
- package/dist/import/input.d.ts +0 -16
- package/dist/import/output.d.ts +0 -6
- package/dist/integration/output.d.ts +0 -22
- package/dist/login/failure.d.ts +0 -3
- package/dist/login/gateway.d.ts +0 -12
- package/dist/login/menu.d.ts +0 -4
- package/dist/login/output/format.d.ts +0 -16
- package/dist/login/output/index.d.ts +0 -2
- package/dist/login/vendor-account.d.ts +0 -95
- package/dist/login/vendor-input.d.ts +0 -14
- package/dist/mcp/calls.d.ts +0 -8
- package/dist/orchestration/output/compact-aggregate.d.ts +0 -121
- package/dist/orchestration/output/compact-run-list.d.ts +0 -20
- package/dist/orchestration/output/human.d.ts +0 -80
- package/dist/orchestration/output/index.d.ts +0 -4
- package/dist/orchestration/tree/index.d.ts +0 -2
- package/dist/orchestration/tree/tree.d.ts +0 -3
- package/dist/port-lease/input.d.ts +0 -65
- package/dist/port-lease/output/format.d.ts +0 -11
- package/dist/port-lease/output/index.d.ts +0 -2
- package/dist/presentation/output/format.d.ts +0 -11
- package/dist/presentation/output/index.d.ts +0 -3
- package/dist/project-guard/input.d.ts +0 -18
- package/dist/project-guard/output/format.d.ts +0 -11
- package/dist/project-guard/output/index.d.ts +0 -2
- package/dist/project-workspace/output/human.d.ts +0 -139
- package/dist/project-workspace/output/index.d.ts +0 -3
- package/dist/project-workspace/output/metadata.d.ts +0 -11
- package/dist/project-workspace/tree/index.d.ts +0 -2
- package/dist/project-workspace/tree/tree.d.ts +0 -3
- package/dist/provider/client.d.ts +0 -6
- package/dist/provider/commands.d.ts +0 -3
- package/dist/provider/index.d.ts +0 -3
- package/dist/reference/commands.d.ts +0 -3
- package/dist/reference/index.d.ts +0 -3
- package/dist/reference/resolve.d.ts +0 -31
- package/dist/reference/tree/index.d.ts +0 -2
- package/dist/reference/tree/tree.d.ts +0 -3
- package/dist/remote-node/reachability.d.ts +0 -64
- package/dist/remote-node/text.d.ts +0 -10
- package/dist/remote-node/tree/index.d.ts +0 -2
- package/dist/remote-node/tree/tree.d.ts +0 -3
- package/dist/routine/input.d.ts +0 -28
- package/dist/routine/output/format.d.ts +0 -23
- package/dist/routine/output/index.d.ts +0 -2
- package/dist/routine/tree/index.d.ts +0 -2
- package/dist/routine/tree/tree.d.ts +0 -3
- package/dist/run-ledger/input.d.ts +0 -42
- package/dist/run-ledger/output/format.d.ts +0 -11
- package/dist/run-ledger/output/index.d.ts +0 -2
- package/dist/session/approval/output/format.d.ts +0 -23
- package/dist/session/approval/output/index.d.ts +0 -2
- package/dist/session/attach-render.d.ts +0 -16
- package/dist/session/create-tasks.d.ts +0 -20
- package/dist/session/interaction/input.d.ts +0 -15
- package/dist/session/interaction/output/format.d.ts +0 -11
- package/dist/session/interaction/output/index.d.ts +0 -2
- package/dist/session/output/diff.d.ts +0 -3
- package/dist/session/output/failure.d.ts +0 -11
- package/dist/session/output/human.d.ts +0 -112
- package/dist/session/output/index.d.ts +0 -6
- package/dist/session/output/observe.d.ts +0 -4
- package/dist/session/output/tasks.d.ts +0 -34
- package/dist/session/task-file.d.ts +0 -5
- package/dist/session/tree/index.d.ts +0 -2
- package/dist/session/tree/tree.d.ts +0 -3
- package/dist/team-workspace/ceremony.d.ts +0 -19
- package/dist/team-workspace/confirmation.d.ts +0 -4
- package/dist/team-workspace/dependencies.js +0 -2
- package/dist/team-workspace/output.d.ts +0 -15
- package/dist/terminal/arguments.d.ts +0 -13
- package/dist/terminal/output/compact-list.d.ts +0 -148
- package/dist/terminal/output/human.d.ts +0 -42
- package/dist/terminal/output/index.d.ts +0 -3
- package/dist/terminal/tree/index.d.ts +0 -2
- package/dist/terminal/tree/tree.d.ts +0 -3
- /package/dist/command-line/{json-decoder.js → emit/json-decoder.js} +0 -0
- /package/dist/command-line/{json.d.ts → emit/json.d.ts} +0 -0
- /package/dist/command-line/{json.js → emit/json.js} +0 -0
- /package/dist/command-line/{output.js → emit/output.js} +0 -0
package/dist/cli/cli.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as Effect from "effect/Effect";
|
|
2
2
|
import type * as Scope from "effect/Scope";
|
|
3
|
-
import { type CliDependencies, type CliIo } from "../command-line/index.js";
|
|
3
|
+
import { type CliDependencies, type CliIo, type ParsedArguments } from "../command-line/index.js";
|
|
4
|
+
import { type TreeNode } from "../command-tree/index.js";
|
|
4
5
|
import type { CliNodeConnector } from "../local-node/index.js";
|
|
6
|
+
import type { SshLayer } from "../remote-node/index.js";
|
|
5
7
|
export type { CliDependencies, CliErrorOutput, CliIo, CliSuccessOutput, CliSuccessResult, } from "../command-line/index.js";
|
|
6
8
|
export type { CliHelpResult, CliVersionResult } from "../command-tree/index.js";
|
|
7
9
|
export type { CliStatusResult } from "../status/index.js";
|
|
@@ -11,7 +13,11 @@ export type CliRemoteNode = {
|
|
|
11
13
|
};
|
|
12
14
|
export type CliDependencyResolver = (profile: string | undefined, remote?: CliRemoteNode) => CliDependencies;
|
|
13
15
|
type CliDependencySource = CliDependencies | CliDependencyResolver;
|
|
16
|
+
export declare const resolveCommand: (parsed: ParsedArguments) => {
|
|
17
|
+
readonly node: TreeNode;
|
|
18
|
+
readonly rest: readonly string[];
|
|
19
|
+
};
|
|
14
20
|
export declare const makeCli: (dependencies: CliDependencySource) => (arguments_: readonly string[], version: string, io: CliIo) => Effect.Effect<number>;
|
|
15
|
-
export declare const makeCliDependencies: (connector?: CliNodeConnector) => CliDependencyResolver;
|
|
21
|
+
export declare const makeCliDependencies: (connector?: CliNodeConnector, ssh?: SshLayer) => CliDependencyResolver;
|
|
16
22
|
export declare const runCli: (arguments_: readonly string[], version: string, io: CliIo) => Effect.Effect<number>;
|
|
17
23
|
//# sourceMappingURL=cli.d.ts.map
|
package/dist/cli/cli.js
CHANGED
|
@@ -49,7 +49,6 @@ const noInputFrom = (value) => value !== undefined && value !== "" && value !==
|
|
|
49
49
|
const resolveOptions = (parsed, leaf, environment) => {
|
|
50
50
|
const nodeBacked = isNodeBacked(leaf);
|
|
51
51
|
const remote = nodeBacked && leaf.remote !== false;
|
|
52
|
-
checkGlobalOptions(parsed, leaf, remote);
|
|
53
52
|
const node = parsed.node ??
|
|
54
53
|
(remote ? fromEnvironment("--node", environment.node) : undefined);
|
|
55
54
|
const profile = parsed.profile ??
|
|
@@ -104,7 +103,7 @@ const reportFailures = (effect, context, tokens) => effect.pipe(Effect.catchDefe
|
|
|
104
103
|
? Effect.interrupt
|
|
105
104
|
: Effect.sync(() => reportFailure(Cause.squash(cause), context, tokens))));
|
|
106
105
|
const isHelpInvocation = (parsed) => parsed.help || parsed.tokens[0] === undefined || parsed.tokens[0] === "help";
|
|
107
|
-
const
|
|
106
|
+
const helpNode = (parsed) => {
|
|
108
107
|
const strict = parsed.tokens[0] === "help";
|
|
109
108
|
const end = parsed.tokens.indexOf("--");
|
|
110
109
|
const tokens = end === -1 ? parsed.tokens : parsed.tokens.slice(0, end);
|
|
@@ -112,6 +111,10 @@ const runHelp = (input, parsed) => Effect.sync(() => {
|
|
|
112
111
|
const { consumed, node } = findNode(path);
|
|
113
112
|
if (consumed < path.length && (strict || node.forms.length === 0))
|
|
114
113
|
throw new CliArgumentError(unknownPathMessage(path));
|
|
114
|
+
return node;
|
|
115
|
+
};
|
|
116
|
+
const runHelp = (input, parsed) => Effect.sync(() => {
|
|
117
|
+
const node = helpNode(parsed);
|
|
115
118
|
const root = node.path.length === 0;
|
|
116
119
|
writeSuccess(root
|
|
117
120
|
? createHelpTree(input.version)
|
|
@@ -125,6 +128,13 @@ const findLeaf = (typed) => {
|
|
|
125
128
|
throw new CliArgumentError(unknownPathMessage(tokens));
|
|
126
129
|
return { leaf: node, rest: tokens.slice(consumed) };
|
|
127
130
|
};
|
|
131
|
+
export const resolveCommand = (parsed) => {
|
|
132
|
+
if (isHelpInvocation(parsed))
|
|
133
|
+
return { node: helpNode(parsed), rest: [] };
|
|
134
|
+
const { leaf, rest } = findLeaf(parsed.tokens);
|
|
135
|
+
checkGlobalOptions(parsed, leaf, isNodeBacked(leaf) && leaf.remote !== false);
|
|
136
|
+
return { node: leaf, rest };
|
|
137
|
+
};
|
|
128
138
|
const leafProgram = (leaf, rest, context) => {
|
|
129
139
|
const reference = leaf.run;
|
|
130
140
|
if (reference === undefined)
|
|
@@ -167,7 +177,7 @@ const runParsed = (input, parsed) => {
|
|
|
167
177
|
if (isHelpInvocation(parsed))
|
|
168
178
|
return runHelp(input, parsed);
|
|
169
179
|
return Effect.gen(function* () {
|
|
170
|
-
const { leaf, rest } =
|
|
180
|
+
const { node: leaf, rest } = resolveCommand(parsed);
|
|
171
181
|
const resolved = resolveOptions(parsed, leaf, yield* readEnvironment(leaf));
|
|
172
182
|
if (parsed.node === undefined &&
|
|
173
183
|
resolved.node !== undefined &&
|
|
@@ -213,6 +223,7 @@ const loadRemoteNode = () => import("../remote-node/index.js");
|
|
|
213
223
|
const loadRunLedger = () => import("../run-ledger/index.js");
|
|
214
224
|
const loadProjectGuard = () => import("../project-guard/index.js");
|
|
215
225
|
const loadAgents = () => import("../agents/index.js");
|
|
226
|
+
const loadWebhooks = () => import("../webhooks/index.js");
|
|
216
227
|
const loadLocalNode = () => import("../local-node/index.js");
|
|
217
228
|
const loadBootstrap = () => import("../team-workspace/index.js");
|
|
218
229
|
const lazyDependencies = (load, makeClient, binding) => Object.fromEntries(binding.names.map((name) => [
|
|
@@ -419,6 +430,7 @@ const makeDefaultCliDependencies = (binding) => ({
|
|
|
419
430
|
"sendAttachedSessionMessage",
|
|
420
431
|
"showExecutionRelocation",
|
|
421
432
|
"showSession",
|
|
433
|
+
"waitSession",
|
|
422
434
|
"startSession",
|
|
423
435
|
"stopSession",
|
|
424
436
|
],
|
|
@@ -485,11 +497,21 @@ const makeDefaultCliDependencies = (binding) => ({
|
|
|
485
497
|
...binding,
|
|
486
498
|
names: [
|
|
487
499
|
"confirmAgentChange",
|
|
500
|
+
"detectAgents",
|
|
488
501
|
"listAgents",
|
|
489
502
|
"previewAgentChange",
|
|
490
503
|
"showAgent",
|
|
491
504
|
],
|
|
492
505
|
}),
|
|
506
|
+
...lazyDependencies(loadWebhooks, (module, node) => module.makeWebhooksClient(node), {
|
|
507
|
+
...binding,
|
|
508
|
+
names: [
|
|
509
|
+
"confirmWebhookChange",
|
|
510
|
+
"listWebhookDeliveries",
|
|
511
|
+
"listWebhooks",
|
|
512
|
+
"previewWebhookChange",
|
|
513
|
+
],
|
|
514
|
+
}),
|
|
493
515
|
...lazyDependencies(loadRemoteNode, (module, node) => module.makeRemoteNodeClient(node), {
|
|
494
516
|
...binding,
|
|
495
517
|
names: [
|
|
@@ -512,19 +534,20 @@ const makeDefaultCliDependencies = (binding) => ({
|
|
|
512
534
|
}),
|
|
513
535
|
...lazyDependencies(loadStatus, (module, node) => module.makeStatusClient(node), { ...binding, names: ["createMonitorBootstrap", "readStatus"] }),
|
|
514
536
|
});
|
|
515
|
-
const remoteConnector = (remote, local) => {
|
|
537
|
+
const remoteConnector = (remote, local, ssh) => {
|
|
516
538
|
const cache = {};
|
|
517
539
|
return (options) => Effect.promise(loadRemoteNode).pipe(Effect.flatMap((module) => {
|
|
518
540
|
cache.connector ??= module.makeRemoteNodeConnector({
|
|
519
541
|
...(local === undefined ? {} : { local }),
|
|
520
542
|
name: remote.name,
|
|
521
543
|
scope: remote.scope,
|
|
544
|
+
...(ssh === undefined ? {} : { ssh }),
|
|
522
545
|
});
|
|
523
546
|
return cache.connector(options);
|
|
524
547
|
}));
|
|
525
548
|
};
|
|
526
549
|
const remoteSignIn = (remote, binding) => (connection) => Effect.promise(loadRemoteNode).pipe(Effect.flatMap((module) => module.remoteVendorLogin({ ...binding, name: remote.name })(connection)));
|
|
527
|
-
export const makeCliDependencies = (connector) => (profile, remote) => {
|
|
550
|
+
export const makeCliDependencies = (connector, ssh) => (profile, remote) => {
|
|
528
551
|
const binding = {
|
|
529
552
|
...(connector === undefined ? {} : { connector }),
|
|
530
553
|
...(profile === undefined ? {} : { profile }),
|
|
@@ -534,7 +557,7 @@ export const makeCliDependencies = (connector) => (profile, remote) => {
|
|
|
534
557
|
: {
|
|
535
558
|
...makeDefaultCliDependencies({
|
|
536
559
|
...binding,
|
|
537
|
-
connector: remoteConnector(remote, connector),
|
|
560
|
+
connector: remoteConnector(remote, connector, ssh),
|
|
538
561
|
remote: true,
|
|
539
562
|
}),
|
|
540
563
|
runVendorLogin: remoteSignIn(remote, binding),
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { type CliDependencies, type CliDependencyResolver, type CliErrorOutput, type CliHelpResult, type CliIo, type CliStatusResult, type CliSuccessOutput, type CliSuccessResult, type CliVersionResult, makeCli, makeCliDependencies, runCli, } from "./cli.js";
|
|
1
|
+
export { type CliDependencies, type CliDependencyResolver, type CliErrorOutput, type CliHelpResult, type CliIo, type CliStatusResult, type CliSuccessOutput, type CliSuccessResult, type CliVersionResult, makeCli, makeCliDependencies, resolveCommand, runCli, } from "./cli.js";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/cli/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { makeCli, makeCliDependencies, runCli, } from "./cli.js";
|
|
1
|
+
export { makeCli, makeCliDependencies, resolveCommand, runCli, } from "./cli.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -25,12 +25,13 @@ import type { InteractionCliDependencies } from "../session/interaction/index.js
|
|
|
25
25
|
import type { CancelTurnInput, InterruptTurnInput, SendTurnInput, WaitTurnsInput } from "../session/turn/index.js";
|
|
26
26
|
import type { BootstrapCliDependencies } from "../team-workspace/index.js";
|
|
27
27
|
import type { CreateTerminalInput, makeTerminalClient } from "../terminal/index.js";
|
|
28
|
+
import type { WebhooksCliDependencies } from "../webhooks/index.js";
|
|
29
|
+
import type { CliIo, CliResolution } from "./emit/index.js";
|
|
28
30
|
import type { CliArgumentError } from "./input/index.js";
|
|
29
|
-
import type { CliIo, CliResolution } from "./output.js";
|
|
30
31
|
type OrchestrationClient = ReturnType<typeof makeOrchestrationClient>;
|
|
31
32
|
type SessionClient = ReturnType<typeof makeSessionClient>;
|
|
32
33
|
type TerminalClient = ReturnType<typeof makeTerminalClient>;
|
|
33
|
-
export type CliDependencies = Partial<AgentsCliDependencies & ApprovalCliDependencies & BootstrapCliDependencies & ConnectionCliDependencies & ContainerCliDependencies & HoldCliDependencies & DiscoveryCliDependencies & IntegrationCliDependencies & PresentationCliDependencies & McpCliDependencies & InteractionCliDependencies & PortLeaseCliDependencies & ProjectGuardCliDependencies & ProjectMetadataCliDependencies & RemoteNodeCliDependencies & RoutineCliDependencies & RunLedgerCliDependencies> & {
|
|
34
|
+
export type CliDependencies = Partial<AgentsCliDependencies & ApprovalCliDependencies & BootstrapCliDependencies & ConnectionCliDependencies & ContainerCliDependencies & HoldCliDependencies & DiscoveryCliDependencies & IntegrationCliDependencies & PresentationCliDependencies & McpCliDependencies & InteractionCliDependencies & PortLeaseCliDependencies & ProjectGuardCliDependencies & ProjectMetadataCliDependencies & RemoteNodeCliDependencies & RoutineCliDependencies & RunLedgerCliDependencies & WebhooksCliDependencies> & {
|
|
34
35
|
readonly acknowledgeAttachedSessionDelivery?: (input: Parameters<SessionClient["acknowledgeAttachedSessionDelivery"]>[0]) => CliNodeEffect<SessionInboxAckResult>;
|
|
35
36
|
readonly acknowledgeRunDelivery: (input: Parameters<OrchestrationClient["acknowledgeRunDelivery"]>[0]) => CliNodeEffect<OrchestrationInboxAckResult>;
|
|
36
37
|
readonly acquireTerminalController: (input: Parameters<TerminalClient["acquireTerminalController"]>[0]) => CliNodeEffect<LiveTerminalControllerAcquireResult>;
|
|
@@ -166,6 +167,7 @@ export type CliDependencies = Partial<AgentsCliDependencies & ApprovalCliDepende
|
|
|
166
167
|
readonly sshLayer?: SshLayer;
|
|
167
168
|
readonly startSession: (input: StartSessionInput) => CliNodeEffect<SessionStartResult>;
|
|
168
169
|
readonly stopSession?: (input: StartSessionInput) => CliNodeEffect<SessionStopResult>;
|
|
170
|
+
readonly waitSession?: SessionClient["waitSession"];
|
|
169
171
|
readonly waitTurns?: (input: WaitTurnsInput) => CliNodeEffect<TurnWaitResult>;
|
|
170
172
|
readonly writeTerminalInput: (input: Parameters<TerminalClient["writeTerminalInput"]>[0]) => CliNodeEffect<LiveTerminalWriteResult>;
|
|
171
173
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { decodeJsonText, jsonLine } from "./json.js";
|
|
2
|
+
export { type CliCommandOutput, type CliErrorOutput, type CliIo, type CliResolution, type CliSuccessOutput, type CliSuccessResult, exitCodeOf, type NodeResultPresenter, type OutputContext, reportError, writeNodeResult, writeSuccess, } from "./output.js";
|
|
3
|
+
export { block, cell, type CliTable, fields, formatRows, labelCells, tab, withNextPage, withPrunedHistory, } from "./rows.js";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { decodeJsonText, jsonLine } from "./json.js";
|
|
2
|
+
export { exitCodeOf, reportError, writeNodeResult, writeSuccess, } from "./output.js";
|
|
3
|
+
export { block, cell, fields, formatRows, labelCells, tab, withNextPage, withPrunedHistory, } from "./rows.js";
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { NodeHolding } from "@maiaos/client-core/cockpit";
|
|
2
2
|
import type { ProtocolError } from "@maiaos/sdk";
|
|
3
3
|
import type * as Effect from "effect/Effect";
|
|
4
|
-
import type { CliMutationRecovery, CliNodeResult } from "
|
|
5
|
-
import type { BoundedStdinRequest, CliArgumentError, PromptOptions } from "
|
|
4
|
+
import type { CliMutationRecovery, CliNodeResult } from "../../local-node/index.js";
|
|
5
|
+
import type { BoundedStdinRequest, CliArgumentError, PromptOptions } from "../input/index.js";
|
|
6
6
|
export type CliIo = {
|
|
7
7
|
readonly cwd?: string;
|
|
8
8
|
readonly interactive?: boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const isTerminalControl: (character: string) => boolean;
|
|
2
2
|
export declare const cell: (value: string) => string;
|
|
3
3
|
export declare const block: (value: string) => string;
|
|
4
|
+
export declare const labelCells: (labels: Readonly<Record<string, string>> | undefined) => string;
|
|
4
5
|
export declare const tab: (values: readonly unknown[]) => string;
|
|
5
6
|
export declare const fields: (entries: readonly (readonly [label: string, value: string | undefined])[]) => string;
|
|
6
7
|
export type CliTable = {
|
|
@@ -8,5 +9,6 @@ export type CliTable = {
|
|
|
8
9
|
readonly headers: readonly string[];
|
|
9
10
|
};
|
|
10
11
|
export declare const formatRows: <TValue>(items: readonly TValue[], format: (value: TValue) => string, text?: CliTable | string) => string;
|
|
12
|
+
export declare const withPrunedHistory: (text: string, oldest?: string) => string;
|
|
11
13
|
export declare const withNextPage: (text: string, nextCursor?: string) => string;
|
|
12
14
|
//# sourceMappingURL=rows.d.ts.map
|
|
@@ -11,6 +11,11 @@ export const isTerminalControl = (character) => {
|
|
|
11
11
|
const replaceControls = (value, kept) => Array.from(value, (character) => !kept.includes(character) && isTerminalControl(character) ? "�" : character).join("");
|
|
12
12
|
export const cell = (value) => replaceControls(value, "");
|
|
13
13
|
export const block = (value) => replaceControls(value, "\t\n");
|
|
14
|
+
export const labelCells = (labels) => labels === undefined
|
|
15
|
+
? "-"
|
|
16
|
+
: Object.entries(labels)
|
|
17
|
+
.map(([key, value]) => `${key}=${value}`)
|
|
18
|
+
.join(",");
|
|
14
19
|
export const tab = (values) => values.join("\t");
|
|
15
20
|
const align = (rows) => {
|
|
16
21
|
const widths = rows.reduce((sizes, row) => row.map((value, index) => Math.max(sizes[index] ?? 0, value.length)), []);
|
|
@@ -37,5 +42,8 @@ export const formatRows = (items, format, text) => {
|
|
|
37
42
|
? align([text.headers, ...lines.map((line) => line.split("\t"))])
|
|
38
43
|
: `${lines.join("\n")}\n`;
|
|
39
44
|
};
|
|
45
|
+
export const withPrunedHistory = (text, oldest) => oldest === undefined
|
|
46
|
+
? text
|
|
47
|
+
: `earlier history pruned; oldest retained cursor ${oldest}\n${text}`;
|
|
40
48
|
export const withNextPage = (text, nextCursor) => nextCursor === undefined ? text : `${text}next: --after ${nextCursor}\n`;
|
|
41
49
|
//# sourceMappingURL=rows.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { type CliDependencies, type CliServices, type CommandContext, type CommandEffect, LOCAL_NODE, } from "./context.js";
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export { askToConfirm, canPrompt, confirmationOf, confirmParameters, EXIT_CANCELLED, peekStdin, promptOrRefuse, readInputMode, readPipedPreview, readTwoPhaseMode, requestedTwoPhaseMode, runInputTwoPhase, runTwoPhase, TWO_PHASE_FLAGS, type TwoPhaseMode, } from "./two-phase.js";
|
|
2
|
+
export { decodeJsonText, jsonLine } from "./emit/index.js";
|
|
3
|
+
export { type CliCommandOutput, type CliErrorOutput, type CliIo, type CliResolution, type CliSuccessOutput, type CliSuccessResult, exitCodeOf, type NodeResultPresenter, reportError, writeNodeResult, writeSuccess, } from "./emit/index.js";
|
|
4
|
+
export { block, cell, type CliTable, fields, formatRows, labelCells, tab, withNextPage, withPrunedHistory, } from "./emit/index.js";
|
|
5
|
+
export { argumentsAreBounded, type ArgumentToken, CliArgumentError, LABEL_OPTION, missingArgument, type OptionSpec, parseArguments, type ParsedArguments, type ParsedOptions, parseOptions, parseOptionsWith, readBoundedStdin, readCursor, readDuration, readExpectedRevision, readGlobalValue, readLabels, readPageSize, readPermission, readRevisionOption, readSessionRole, readSessionTitle, readWaitTimeoutSeconds, recoverStdin, requireNoArguments, requireOneLabelPerOption, requirePositionals, tokenizeArguments, unknownCommand, } from "./input/index.js";
|
|
6
|
+
export { askToConfirm, canPrompt, confirmationOf, confirmParameters, EXIT_CANCELLED, peekStdin, promptOrRefuse, readInputMode, readPipedPreview, readTwoPhaseMode, requestedTwoPhaseMode, runInputTwoPhase, runTwoPhase, TWO_PHASE_FLAGS, type TwoPhaseMode, } from "./two-phase/index.js";
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { LOCAL_NODE, } from "./context.js";
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export { askToConfirm, canPrompt, confirmationOf, confirmParameters, EXIT_CANCELLED, peekStdin, promptOrRefuse, readInputMode, readPipedPreview, readTwoPhaseMode, requestedTwoPhaseMode, runInputTwoPhase, runTwoPhase, TWO_PHASE_FLAGS, } from "./two-phase.js";
|
|
2
|
+
export { decodeJsonText, jsonLine } from "./emit/index.js";
|
|
3
|
+
export { exitCodeOf, reportError, writeNodeResult, writeSuccess, } from "./emit/index.js";
|
|
4
|
+
export { block, cell, fields, formatRows, labelCells, tab, withNextPage, withPrunedHistory, } from "./emit/index.js";
|
|
5
|
+
export { argumentsAreBounded, CliArgumentError, LABEL_OPTION, missingArgument, parseArguments, parseOptions, parseOptionsWith, readBoundedStdin, readCursor, readDuration, readExpectedRevision, readGlobalValue, readLabels, readPageSize, readPermission, readRevisionOption, readSessionRole, readSessionTitle, readWaitTimeoutSeconds, recoverStdin, requireNoArguments, requireOneLabelPerOption, requirePositionals, tokenizeArguments, unknownCommand, } from "./input/index.js";
|
|
6
|
+
export { askToConfirm, canPrompt, confirmationOf, confirmParameters, EXIT_CANCELLED, peekStdin, promptOrRefuse, readInputMode, readPipedPreview, readTwoPhaseMode, requestedTwoPhaseMode, runInputTwoPhase, runTwoPhase, TWO_PHASE_FLAGS, } from "./two-phase/index.js";
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -24,6 +24,12 @@ export declare const argumentsAreBounded: (arguments_: readonly string[]) => boo
|
|
|
24
24
|
type ValueOption = "--node" | "--profile";
|
|
25
25
|
export declare const readGlobalValue: (option: ValueOption, value: string | undefined) => string;
|
|
26
26
|
export declare const parseArguments: (arguments_: readonly string[]) => ParsedArguments;
|
|
27
|
+
export type OptionSpec = {
|
|
28
|
+
readonly allowed: ReadonlySet<string>;
|
|
29
|
+
readonly allowedFlags: ReadonlySet<string>;
|
|
30
|
+
readonly repeatable: ReadonlySet<string>;
|
|
31
|
+
};
|
|
32
|
+
export declare const parseOptionsWith: (tokens: readonly string[], spec: OptionSpec) => ParsedOptions;
|
|
27
33
|
export declare const parseOptions: (tokens: readonly string[], allowed: ReadonlySet<string>, allowedFlags?: ReadonlySet<string>) => ParsedOptions;
|
|
28
34
|
export declare const requirePositionals: (positionals: readonly string[], count: number) => void;
|
|
29
35
|
export declare const missingArgument: () => CliArgumentError;
|
|
@@ -32,11 +38,15 @@ export declare const requireNoArguments: (tokens: readonly string[], command: st
|
|
|
32
38
|
export declare const readPageSize: (value: string | undefined, maximum?: number) => number;
|
|
33
39
|
export declare const readCursor: (value?: string) => string;
|
|
34
40
|
export declare const readRevisionOption: (value: string | undefined, option: `--${string}`) => string;
|
|
41
|
+
export declare const readPermission: <TPermission extends string>(permission: string | undefined, validate: (permission: string) => TPermission | undefined) => {
|
|
42
|
+
readonly permission?: TPermission;
|
|
43
|
+
};
|
|
35
44
|
export declare const readExpectedRevision: (value: string | undefined) => string;
|
|
36
45
|
export declare const readDuration: (value: string, option: `--${string}`, range: {
|
|
37
46
|
readonly max: number;
|
|
38
47
|
readonly min: number;
|
|
39
48
|
}) => number;
|
|
49
|
+
export declare const readWaitTimeoutSeconds: (value: string | undefined) => number;
|
|
40
50
|
export type ArgumentToken = {
|
|
41
51
|
readonly index: number;
|
|
42
52
|
readonly inline: boolean;
|
|
@@ -77,13 +77,20 @@ export const parseArguments = (arguments_) => {
|
|
|
77
77
|
tokens: [...scan.tokens, ...(end === -1 ? [] : arguments_.slice(end))],
|
|
78
78
|
};
|
|
79
79
|
};
|
|
80
|
+
const takeOptionValue = (state, token) => {
|
|
81
|
+
const { options, pendingOption } = state;
|
|
82
|
+
if (pendingOption === undefined)
|
|
83
|
+
return;
|
|
84
|
+
if (token.startsWith("--")) {
|
|
85
|
+
throw new CliArgumentError(`Option '${pendingOption}' requires a value.`);
|
|
86
|
+
}
|
|
87
|
+
const earlier = options.get(pendingOption);
|
|
88
|
+
options.set(pendingOption, earlier === undefined ? token : `${earlier},${token}`);
|
|
89
|
+
delete state.pendingOption;
|
|
90
|
+
};
|
|
80
91
|
const parseOptionToken = (state, token) => {
|
|
81
92
|
if (state.pendingOption !== undefined) {
|
|
82
|
-
|
|
83
|
-
throw new CliArgumentError(`Option '${state.pendingOption}' requires a value.`);
|
|
84
|
-
}
|
|
85
|
-
state.options.set(state.pendingOption, token);
|
|
86
|
-
delete state.pendingOption;
|
|
93
|
+
takeOptionValue(state, token);
|
|
87
94
|
return;
|
|
88
95
|
}
|
|
89
96
|
if (!token.startsWith("--")) {
|
|
@@ -100,7 +107,7 @@ const parseOptionToken = (state, token) => {
|
|
|
100
107
|
if (!state.allowed.has(token)) {
|
|
101
108
|
throw new CliArgumentError("The command contains an unknown option.");
|
|
102
109
|
}
|
|
103
|
-
if (state.options.has(token)) {
|
|
110
|
+
if (state.options.has(token) && !state.repeatable.has(token)) {
|
|
104
111
|
throw new CliArgumentError(`Option '${token}' may be used only once.`);
|
|
105
112
|
}
|
|
106
113
|
state.pendingOption = token;
|
|
@@ -112,16 +119,15 @@ const splitInlineValue = (token, allowed) => {
|
|
|
112
119
|
const name = token.slice(0, separator);
|
|
113
120
|
return allowed.has(name) ? [name, token.slice(separator + 1)] : [token];
|
|
114
121
|
};
|
|
115
|
-
export const
|
|
122
|
+
export const parseOptionsWith = (tokens, spec) => {
|
|
116
123
|
const state = {
|
|
117
|
-
|
|
118
|
-
allowedFlags,
|
|
124
|
+
...spec,
|
|
119
125
|
flags: new Set(),
|
|
120
126
|
options: new Map(),
|
|
121
127
|
positionals: [],
|
|
122
128
|
};
|
|
123
129
|
tokens
|
|
124
|
-
.flatMap((token) => splitInlineValue(token, allowed))
|
|
130
|
+
.flatMap((token) => splitInlineValue(token, spec.allowed))
|
|
125
131
|
.forEach((token) => {
|
|
126
132
|
parseOptionToken(state, token);
|
|
127
133
|
});
|
|
@@ -134,6 +140,7 @@ export const parseOptions = (tokens, allowed, allowedFlags = new Set()) => {
|
|
|
134
140
|
positionals: state.positionals,
|
|
135
141
|
};
|
|
136
142
|
};
|
|
143
|
+
export const parseOptions = (tokens, allowed, allowedFlags = new Set()) => parseOptionsWith(tokens, { allowed, allowedFlags, repeatable: new Set() });
|
|
137
144
|
export const requirePositionals = (positionals, count) => {
|
|
138
145
|
if (positionals.length === count)
|
|
139
146
|
return;
|
|
@@ -170,6 +177,14 @@ export const readRevisionOption = (value, option) => {
|
|
|
170
177
|
}
|
|
171
178
|
return readInt64(value, `Option '${option}' must be a non-negative signed 64-bit integer.`);
|
|
172
179
|
};
|
|
180
|
+
export const readPermission = (permission, validate) => {
|
|
181
|
+
if (permission === undefined)
|
|
182
|
+
return {};
|
|
183
|
+
const valid = validate(permission);
|
|
184
|
+
if (valid === undefined)
|
|
185
|
+
throw new CliArgumentError("Option '--permission' must be a permission mode Claude Code or Codex defines.");
|
|
186
|
+
return { permission: valid };
|
|
187
|
+
};
|
|
173
188
|
export const readExpectedRevision = (value) => readRevisionOption(value, "--expected-revision");
|
|
174
189
|
const DURATION = /^([1-9]\d{0,5})(s|m|h)$/u;
|
|
175
190
|
const unitSeconds = (unit) => {
|
|
@@ -191,6 +206,11 @@ export const readDuration = (value, option, range) => {
|
|
|
191
206
|
throw new CliArgumentError(`Option '${option}' must be a duration from ${describeSeconds(range.min)} to ${describeSeconds(range.max)}, such as 30s, 10m or 1h.`);
|
|
192
207
|
return seconds;
|
|
193
208
|
};
|
|
209
|
+
const DEFAULT_WAIT_SECONDS = 600;
|
|
210
|
+
const MAX_WAIT_SECONDS = 86_400;
|
|
211
|
+
export const readWaitTimeoutSeconds = (value) => value === undefined
|
|
212
|
+
? DEFAULT_WAIT_SECONDS
|
|
213
|
+
: readDuration(value, "--timeout", { max: MAX_WAIT_SECONDS, min: 1 });
|
|
194
214
|
const tokenRole = (token, index, valueOptions) => {
|
|
195
215
|
if (!token.startsWith("--"))
|
|
196
216
|
return { index, kind: "positional" };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { argumentsAreBounded, type ArgumentToken, CliArgumentError, missingArgument, parseArguments, type ParsedArguments, type ParsedOptions, parseOptions, readCursor, readDuration, readExpectedRevision, readGlobalValue, readPageSize, readRevisionOption, requireNoArguments, requirePositionals, tokenizeArguments, unknownCommand, } from "./arguments.js";
|
|
1
|
+
export { argumentsAreBounded, type ArgumentToken, CliArgumentError, missingArgument, type OptionSpec, parseArguments, type ParsedArguments, type ParsedOptions, parseOptions, parseOptionsWith, readCursor, readDuration, readExpectedRevision, readGlobalValue, readPageSize, readPermission, readRevisionOption, readWaitTimeoutSeconds, requireNoArguments, requirePositionals, tokenizeArguments, unknownCommand, } from "./arguments.js";
|
|
2
|
+
export { LABEL_OPTION, readLabels, readSessionRole, readSessionTitle, requireOneLabelPerOption, } from "./manager-options.js";
|
|
2
3
|
export { promptLine, type PromptOptions, terminalIsInteractive, } from "./prompt.js";
|
|
3
4
|
export { type BoundedStdinRequest, readBoundedStdin, recoverStdin, replayStdin, } from "./stdin.js";
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { argumentsAreBounded, CliArgumentError, missingArgument, parseArguments, parseOptions, readCursor, readDuration, readExpectedRevision, readGlobalValue, readPageSize, readRevisionOption, requireNoArguments, requirePositionals, tokenizeArguments, unknownCommand, } from "./arguments.js";
|
|
1
|
+
export { argumentsAreBounded, CliArgumentError, missingArgument, parseArguments, parseOptions, parseOptionsWith, readCursor, readDuration, readExpectedRevision, readGlobalValue, readPageSize, readPermission, readRevisionOption, readWaitTimeoutSeconds, requireNoArguments, requirePositionals, tokenizeArguments, unknownCommand, } from "./arguments.js";
|
|
2
|
+
export { LABEL_OPTION, readLabels, readSessionRole, readSessionTitle, requireOneLabelPerOption, } from "./manager-options.js";
|
|
2
3
|
export { promptLine, terminalIsInteractive, } from "./prompt.js";
|
|
3
4
|
export { readBoundedStdin, recoverStdin, replayStdin, } from "./stdin.js";
|
|
4
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const LABEL_OPTION: ReadonlySet<string>;
|
|
2
|
+
export declare const requireOneLabelPerOption: (tokens: readonly string[]) => void;
|
|
3
|
+
export declare const readLabels: (value: string | undefined) => {
|
|
4
|
+
readonly labels?: Readonly<Record<string, string>>;
|
|
5
|
+
};
|
|
6
|
+
export declare const readSessionRole: (value: string | undefined) => {
|
|
7
|
+
readonly role?: "orchestrator" | "worker";
|
|
8
|
+
};
|
|
9
|
+
export declare const readSessionTitle: (options: ReadonlyMap<string, string>) => string | undefined;
|
|
10
|
+
//# sourceMappingURL=manager-options.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { CliArgumentError } from "./arguments.js";
|
|
2
|
+
export const LABEL_OPTION = new Set(["--label"]);
|
|
3
|
+
export const requireOneLabelPerOption = (tokens) => {
|
|
4
|
+
const given = tokens.flatMap((token, index) => {
|
|
5
|
+
if (tokens[index - 1] === "--label")
|
|
6
|
+
return [token];
|
|
7
|
+
return token.startsWith("--label=") ? [token.slice("--label=".length)] : [];
|
|
8
|
+
});
|
|
9
|
+
if (given.some((value) => value.includes(",")))
|
|
10
|
+
throw new CliArgumentError("Option '--label' takes one key=value; repeat the option for more.");
|
|
11
|
+
};
|
|
12
|
+
export const readLabels = (value) => {
|
|
13
|
+
if (value === undefined)
|
|
14
|
+
return {};
|
|
15
|
+
const pairs = value.split(",").map((pair) => {
|
|
16
|
+
const separator = pair.indexOf("=");
|
|
17
|
+
if (separator < 1)
|
|
18
|
+
throw new CliArgumentError("Option '--label' takes key=value.");
|
|
19
|
+
return [pair.slice(0, separator), pair.slice(separator + 1)];
|
|
20
|
+
});
|
|
21
|
+
const duplicate = pairs.find(([key], index) => pairs.findIndex(([other]) => other === key) !== index);
|
|
22
|
+
if (duplicate !== undefined)
|
|
23
|
+
throw new CliArgumentError(`Label '${duplicate[0]}' is given twice.`);
|
|
24
|
+
return { labels: Object.fromEntries(pairs) };
|
|
25
|
+
};
|
|
26
|
+
export const readSessionRole = (value) => {
|
|
27
|
+
if (value === undefined)
|
|
28
|
+
return {};
|
|
29
|
+
if (value === "worker" || value === "orchestrator")
|
|
30
|
+
return { role: value };
|
|
31
|
+
throw new CliArgumentError("Option '--role' must be worker or orchestrator.");
|
|
32
|
+
};
|
|
33
|
+
export const readSessionTitle = (options) => {
|
|
34
|
+
if (options.has("--name") && options.has("--title"))
|
|
35
|
+
throw new CliArgumentError("Use one of '--name' or '--title'.");
|
|
36
|
+
return options.get("--title") ?? options.get("--name");
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=manager-options.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { askToConfirm, canPrompt, confirmationOf, confirmParameters, EXIT_CANCELLED, peekStdin, promptOrRefuse, readInputMode, readPipedPreview, readTwoPhaseMode, requestedTwoPhaseMode, runInputTwoPhase, runTwoPhase, TWO_PHASE_FLAGS, type TwoPhaseMode, } from "./two-phase.js";
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { askToConfirm, canPrompt, confirmationOf, confirmParameters, EXIT_CANCELLED, peekStdin, promptOrRefuse, readInputMode, readPipedPreview, readTwoPhaseMode, requestedTwoPhaseMode, runInputTwoPhase, runTwoPhase, TWO_PHASE_FLAGS, } from "./two-phase.js";
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as Effect from "effect/Effect";
|
|
2
|
-
import type { CliNodeResult } from "
|
|
3
|
-
import type
|
|
4
|
-
import { CliArgumentError } from "
|
|
2
|
+
import type { CliNodeResult } from "../../local-node/index.js";
|
|
3
|
+
import { type OutputContext } from "../emit/index.js";
|
|
4
|
+
import { CliArgumentError } from "../input/index.js";
|
|
5
5
|
export type TwoPhaseMode = "confirm-stdin" | "dry-run" | "prompt" | "yes";
|
|
6
6
|
export declare const TWO_PHASE_FLAGS: readonly string[];
|
|
7
|
-
export declare const canPrompt: (context:
|
|
7
|
+
export declare const canPrompt: (context: OutputContext) => boolean;
|
|
8
8
|
export declare const requestedTwoPhaseMode: (flags: ReadonlySet<string>, offersYes?: boolean) => Exclude<TwoPhaseMode, "prompt"> | undefined;
|
|
9
|
-
export declare const promptOrRefuse: (context:
|
|
10
|
-
export declare const readTwoPhaseMode: (flags: ReadonlySet<string>, context:
|
|
11
|
-
export declare const readPipedPreview: (context:
|
|
12
|
-
export declare const peekStdin: (context:
|
|
13
|
-
readonly context:
|
|
9
|
+
export declare const promptOrRefuse: (context: OutputContext, offersYes?: boolean) => "prompt";
|
|
10
|
+
export declare const readTwoPhaseMode: (flags: ReadonlySet<string>, context: OutputContext, offersYes?: boolean) => TwoPhaseMode;
|
|
11
|
+
export declare const readPipedPreview: (context: OutputContext) => Effect.Effect<object, CliArgumentError>;
|
|
12
|
+
export declare const peekStdin: <TContext extends OutputContext>(context: TContext) => Effect.Effect<{
|
|
13
|
+
readonly context: TContext;
|
|
14
14
|
readonly input: unknown;
|
|
15
15
|
}>;
|
|
16
16
|
export declare const confirmParameters: <TParameters>(schema: {
|
|
@@ -22,11 +22,11 @@ export declare const confirmParameters: <TParameters>(schema: {
|
|
|
22
22
|
};
|
|
23
23
|
}, preview: object, previewOnly?: readonly string[]) => Effect.Effect<TParameters, CliArgumentError>;
|
|
24
24
|
export declare const confirmationOf: (preview: object, previewOnly?: readonly string[]) => Record<string, unknown>;
|
|
25
|
-
export declare const askToConfirm: (context:
|
|
25
|
+
export declare const askToConfirm: (context: OutputContext, question: string) => Effect.Effect<boolean>;
|
|
26
26
|
export declare const EXIT_CANCELLED = 1;
|
|
27
27
|
export type TwoPhaseSpec<TPreview extends object, TConfirm, TRequirements> = {
|
|
28
28
|
readonly confirm: (preview: object) => Effect.Effect<CliNodeResult<TConfirm>, CliArgumentError, TRequirements>;
|
|
29
|
-
readonly context:
|
|
29
|
+
readonly context: OutputContext;
|
|
30
30
|
readonly mode: TwoPhaseMode;
|
|
31
31
|
readonly preview: () => Effect.Effect<CliNodeResult<TPreview>, CliArgumentError, TRequirements>;
|
|
32
32
|
readonly prompt?: {
|
|
@@ -48,7 +48,7 @@ type SafeParser<TValue> = {
|
|
|
48
48
|
export type InputTwoPhaseSpec<TPreviewParameters, TPreview extends object, TConfirmParameters, TConfirm, TRequirements> = {
|
|
49
49
|
readonly confirm?: (parameters: TConfirmParameters) => Effect.Effect<CliNodeResult<TConfirm>, never, TRequirements>;
|
|
50
50
|
readonly confirmSchema: SafeParser<TConfirmParameters>;
|
|
51
|
-
readonly context:
|
|
51
|
+
readonly context: OutputContext;
|
|
52
52
|
readonly label: string;
|
|
53
53
|
readonly preview?: (parameters: TPreviewParameters) => Effect.Effect<CliNodeResult<TPreview>, never, TRequirements>;
|
|
54
54
|
readonly previewOnly?: readonly string[];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as Cause from "effect/Cause";
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
3
|
import * as Exit from "effect/Exit";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { decodeJsonText } from "../emit/index.js";
|
|
5
|
+
import { CliArgumentError, parseOptions, recoverStdin, replayStdin, requirePositionals, } from "../input/index.js";
|
|
6
6
|
export const TWO_PHASE_FLAGS = [
|
|
7
7
|
"--confirm-stdin",
|
|
8
8
|
"--dry-run",
|
|
@@ -53,7 +53,7 @@ export const runReceiptShow = (tokens, context) => Effect.gen(function* () {
|
|
|
53
53
|
command: "receipt.show",
|
|
54
54
|
result: value,
|
|
55
55
|
}),
|
|
56
|
-
toText: ({ result: { receipt } }) => `${receipt.receiptId}\t${receipt.state}\t${receipt.target.type}:${receipt.target.id}\n`,
|
|
56
|
+
toText: ({ result: { eventsPruned, receipt } }) => `${receipt.receiptId}\t${receipt.state}\t${receipt.target.type}:${receipt.target.id}${eventsPruned === true ? "\tevents-pruned" : ""}\n`,
|
|
57
57
|
});
|
|
58
58
|
});
|
|
59
59
|
//# sourceMappingURL=command.js.map
|
|
@@ -20,7 +20,7 @@ export type TreeNode = {
|
|
|
20
20
|
readonly summary: string;
|
|
21
21
|
};
|
|
22
22
|
export declare const TREE_FRAGMENTS: readonly TreeFragment[];
|
|
23
|
-
export declare const TREE_SECTIONS: readonly [readonly ["Start and sign in", readonly ["setup", "login", "status"]], readonly ["Work", readonly ["session", "run", "routine", "import"]], readonly ["Resources", readonly ["project", "workspace", "container", "terminal", "execution", "port", "reference", "agents"]], readonly ["Accounts and Nodes", readonly ["connection", "integration", "provider", "node"]], readonly ["Safety and audit", readonly ["hold", "receipt", "context"]], readonly ["Clients and local", readonly ["presentation", "mcp", "dashboard", "agent", "help", "version", "doctor", "completion"]]];
|
|
23
|
+
export declare const TREE_SECTIONS: readonly [readonly ["Start and sign in", readonly ["setup", "login", "status"]], readonly ["Work", readonly ["session", "run", "routine", "import"]], readonly ["Resources", readonly ["project", "workspace", "container", "terminal", "execution", "port", "reference", "agents", "webhooks"]], readonly ["Accounts and Nodes", readonly ["connection", "integration", "provider", "node"]], readonly ["Safety and audit", readonly ["hold", "receipt", "events", "context"]], readonly ["Clients and local", readonly ["presentation", "mcp", "dashboard", "agent", "help", "version", "doctor", "completion"]]];
|
|
24
24
|
export declare const usagePath: (usage: string) => readonly string[];
|
|
25
25
|
export declare const COMMAND_TREE: TreeNode;
|
|
26
26
|
export declare const commandTree: () => TreeNode;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { AGENTS_TREE } from "../agents/tree/index.js";
|
|
3
3
|
import { CONNECTION_TREE } from "../connection/tree/index.js";
|
|
4
|
+
import { EVENTS_TREE } from "../events/tree/index.js";
|
|
4
5
|
import { EXECUTION_TREE } from "../execution/tree/index.js";
|
|
5
6
|
import { SAFETY_TREE } from "../hold/tree/index.js";
|
|
6
7
|
import { RUN_TREE } from "../orchestration/tree/index.js";
|
|
@@ -10,6 +11,7 @@ import { NODE_TREE } from "../remote-node/tree/index.js";
|
|
|
10
11
|
import { ROUTINE_TREE } from "../routine/tree/index.js";
|
|
11
12
|
import { SESSION_TREE } from "../session/tree/index.js";
|
|
12
13
|
import { TERMINAL_TREE } from "../terminal/tree/index.js";
|
|
14
|
+
import { WEBHOOKS_TREE } from "../webhooks/tree/index.js";
|
|
13
15
|
import { LOCAL_TREE } from "./local.js";
|
|
14
16
|
export const TREE_FRAGMENTS = [
|
|
15
17
|
NODE_TREE,
|
|
@@ -19,10 +21,12 @@ export const TREE_FRAGMENTS = [
|
|
|
19
21
|
ROUTINE_TREE,
|
|
20
22
|
PROJECT_TREE,
|
|
21
23
|
REFERENCE_TREE,
|
|
24
|
+
EVENTS_TREE,
|
|
22
25
|
TERMINAL_TREE,
|
|
23
26
|
EXECUTION_TREE,
|
|
24
27
|
SAFETY_TREE,
|
|
25
28
|
AGENTS_TREE,
|
|
29
|
+
WEBHOOKS_TREE,
|
|
26
30
|
LOCAL_TREE,
|
|
27
31
|
];
|
|
28
32
|
export const TREE_SECTIONS = [
|
|
@@ -39,10 +43,11 @@ export const TREE_SECTIONS = [
|
|
|
39
43
|
"port",
|
|
40
44
|
"reference",
|
|
41
45
|
"agents",
|
|
46
|
+
"webhooks",
|
|
42
47
|
],
|
|
43
48
|
],
|
|
44
49
|
["Accounts and Nodes", ["connection", "integration", "provider", "node"]],
|
|
45
|
-
["Safety and audit", ["hold", "receipt", "context"]],
|
|
50
|
+
["Safety and audit", ["hold", "receipt", "events", "context"]],
|
|
46
51
|
[
|
|
47
52
|
"Clients and local",
|
|
48
53
|
[
|
package/dist/connection/input.js
CHANGED
|
@@ -2,8 +2,8 @@ import { CliArgumentError, parseOptions, readExpectedRevision, readPageSize, req
|
|
|
2
2
|
const readSessionLimit = (value) => {
|
|
3
3
|
if (value === undefined)
|
|
4
4
|
return {};
|
|
5
|
-
if (!/^(?:[1-9]|1[0-6])$/u.test(value))
|
|
6
|
-
throw new CliArgumentError("Option '--max-sessions' must be an integer from 1 to
|
|
5
|
+
if (!/^(?:[1-9]|[1-5][0-9]|6[0-4])$/u.test(value))
|
|
6
|
+
throw new CliArgumentError("Option '--max-sessions' must be an integer from 1 to 64.");
|
|
7
7
|
return { maxConcurrentSessions: Number(value) };
|
|
8
8
|
};
|
|
9
9
|
const requireOption = (options, name) => {
|
|
@@ -146,8 +146,9 @@ const confirmedText = (result) => result.items
|
|
|
146
146
|
const readSetup = (parsed) => {
|
|
147
147
|
requirePositionals(parsed.positionals, 0);
|
|
148
148
|
const sessions = parsed.options.get("--max-sessions");
|
|
149
|
-
if (sessions !== undefined &&
|
|
150
|
-
|
|
149
|
+
if (sessions !== undefined &&
|
|
150
|
+
!/^(?:[1-9]|[1-5][0-9]|6[0-4])$/u.test(sessions))
|
|
151
|
+
throw new CliArgumentError("--max-sessions must be 1 to 64.");
|
|
151
152
|
return {
|
|
152
153
|
commandId: parsed.options.get("--command-id"),
|
|
153
154
|
...(sessions === undefined
|