@maiaos/cli 0.1.0-canary.6 → 0.1.0-canary.61
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
|
@@ -2,7 +2,7 @@ import * as Effect from "effect/Effect";
|
|
|
2
2
|
import { listEach, writeMerged } from "../../address-space/index.js";
|
|
3
3
|
import { CliArgumentError, parseOptions, reportError, requirePositionals, writeNodeResult, } from "../../command-line/index.js";
|
|
4
4
|
import { mergeLists } from "../../fleet/index.js";
|
|
5
|
-
import { commandIdentifier, } from "../../local-node/index.js";
|
|
5
|
+
import { commandIdentifier, holdsSessionCredential, } from "../../local-node/index.js";
|
|
6
6
|
import { describeApproval, formatApprovalResult, formatMergedApprovals, } from "./output/index.js";
|
|
7
7
|
const missing = (name) => Effect.die(new Error(`Missing approval client: ${name}.`));
|
|
8
8
|
const write = (context) => (result) => writeNodeResult(result, context, {
|
|
@@ -85,10 +85,16 @@ const OPTIONS = {
|
|
|
85
85
|
approve: new Set(["--command-id"]),
|
|
86
86
|
deny: new Set(["--command-id", "--reason"]),
|
|
87
87
|
};
|
|
88
|
-
const
|
|
88
|
+
const FLAGS = {
|
|
89
|
+
answer: new Set(["--as-coordinator"]),
|
|
90
|
+
approve: new Set(["--as-coordinator", "--for-session"]),
|
|
91
|
+
deny: new Set(["--as-coordinator"]),
|
|
92
|
+
};
|
|
93
|
+
const confirmed = (context, { approval, asCoordinator, decision }) => {
|
|
89
94
|
context.io.stderr(`${describeApproval(approval)}\n`);
|
|
90
|
-
if (
|
|
91
|
-
decision.decision !== "
|
|
95
|
+
if (asCoordinator ||
|
|
96
|
+
(decision.decision !== "approve" &&
|
|
97
|
+
decision.decision !== "approve_for_session"))
|
|
92
98
|
return Effect.succeed(true);
|
|
93
99
|
const scope = decision.decision === "approve_for_session"
|
|
94
100
|
? "for this Session until its worker restarts"
|
|
@@ -103,34 +109,49 @@ const notConfirmed = (context) => reportError({
|
|
|
103
109
|
message: "Nothing approved; the worker still waits until the request expires.",
|
|
104
110
|
retryable: false,
|
|
105
111
|
}, context);
|
|
112
|
+
const respond = (context, { approvalId, asCoordinator, commandId }, { approval, decision }) => Effect.gen(function* () {
|
|
113
|
+
const { respondToApproval } = context.dependencies;
|
|
114
|
+
if (respondToApproval === undefined)
|
|
115
|
+
return yield* missing("decision");
|
|
116
|
+
const id = yield* commandIdentifier(commandId);
|
|
117
|
+
return write(context)(yield* respondToApproval({
|
|
118
|
+
...decision,
|
|
119
|
+
approvalId,
|
|
120
|
+
commandId: id,
|
|
121
|
+
requestDigest: approval.requestDigest,
|
|
122
|
+
}, asCoordinator));
|
|
123
|
+
});
|
|
106
124
|
const decide = (context, input) => {
|
|
125
|
+
const { approvalId, asCoordinator, requested } = input;
|
|
107
126
|
const { respondToApproval, showApproval } = context.dependencies;
|
|
108
127
|
if (respondToApproval === undefined || showApproval === undefined)
|
|
109
128
|
return missing("decision");
|
|
110
129
|
return Effect.gen(function* () {
|
|
111
|
-
const shown = yield* showApproval({ approvalId
|
|
130
|
+
const shown = yield* showApproval({ approvalId }, asCoordinator);
|
|
112
131
|
if (!shown.ok)
|
|
113
132
|
return write(context)(shown);
|
|
114
133
|
const { approval } = shown.value;
|
|
115
|
-
const decision = resolveAnswer(approval,
|
|
116
|
-
|
|
134
|
+
const decision = resolveAnswer(approval, typeof requested === "function" ? requested(approval) : requested);
|
|
135
|
+
const reading = { approval, asCoordinator, decision };
|
|
136
|
+
if (!(yield* confirmed(context, reading)))
|
|
117
137
|
return notConfirmed(context);
|
|
118
|
-
|
|
119
|
-
return write(context)(yield* respondToApproval({
|
|
120
|
-
...decision,
|
|
121
|
-
approvalId: input.approvalId,
|
|
122
|
-
commandId,
|
|
123
|
-
requestDigest: approval.requestDigest,
|
|
124
|
-
}));
|
|
138
|
+
return yield* respond(context, input, reading);
|
|
125
139
|
});
|
|
126
140
|
};
|
|
127
|
-
const runDecision = (verb, tokens, context) => {
|
|
128
|
-
|
|
129
|
-
|
|
141
|
+
const runDecision = (verb, tokens, context) => Effect.gen(function* () {
|
|
142
|
+
const asCoordinator = tokens.includes("--as-coordinator");
|
|
143
|
+
if (!asCoordinator &&
|
|
144
|
+
(verb !== "answer" || !(yield* holdsSessionCredential)))
|
|
145
|
+
requirePerson(context, verb);
|
|
146
|
+
return yield* parseDecision(verb, tokens, context);
|
|
147
|
+
});
|
|
148
|
+
const parseDecision = (verb, tokens, context) => {
|
|
149
|
+
const parsed = parseOptions(tokens, OPTIONS[verb], FLAGS[verb]);
|
|
130
150
|
requirePositionals(parsed.positionals, 1);
|
|
131
151
|
const commandId = parsed.options.get("--command-id");
|
|
132
152
|
return decide(context, {
|
|
133
153
|
approvalId: parsed.positionals[0] ?? "",
|
|
154
|
+
asCoordinator: parsed.flags.has("--as-coordinator"),
|
|
134
155
|
...(commandId === undefined ? {} : { commandId }),
|
|
135
156
|
requested: readDecision(verb, parsed.options, parsed.flags),
|
|
136
157
|
});
|
|
@@ -138,4 +159,63 @@ const runDecision = (verb, tokens, context) => {
|
|
|
138
159
|
export const runApprovalApprove = (tokens, context) => runDecision("approve", tokens, context);
|
|
139
160
|
export const runApprovalDeny = (tokens, context) => runDecision("deny", tokens, context);
|
|
140
161
|
export const runApprovalAnswer = (tokens, context) => runDecision("answer", tokens, context);
|
|
162
|
+
const answerDecision = (approval, text) => {
|
|
163
|
+
if (approval.kind === "question")
|
|
164
|
+
return { answer: text, decision: "answer" };
|
|
165
|
+
const word = text.trim().toLowerCase();
|
|
166
|
+
if (word === "approve" || word === "deny")
|
|
167
|
+
return { decision: word };
|
|
168
|
+
throw new CliArgumentError(`This ${approval.kind} request takes 'approve' or 'deny', not an answer.`);
|
|
169
|
+
};
|
|
170
|
+
const decisionFor = (context, approval, { asCoordinator, credential, sessionId, text }) => {
|
|
171
|
+
if (approval.sessionId !== sessionId)
|
|
172
|
+
throw new CliArgumentError(`Prompt '${approval.approvalId}' belongs to ${approval.sessionId}, not ${sessionId}.`);
|
|
173
|
+
const decision = answerDecision(approval, text);
|
|
174
|
+
const verb = decision.decision;
|
|
175
|
+
if (!asCoordinator && !(credential && verb === "answer"))
|
|
176
|
+
requirePerson(context, verb);
|
|
177
|
+
return decision;
|
|
178
|
+
};
|
|
179
|
+
const statusUnreadable = (context) => reportError({
|
|
180
|
+
code: "invalid_argument",
|
|
181
|
+
message: "The Session's status is unknown; no answer was sent.",
|
|
182
|
+
retryable: false,
|
|
183
|
+
}, context);
|
|
184
|
+
const parseAnswer = (tokens) => {
|
|
185
|
+
const parsed = parseOptions(tokens, new Set(["--command-id", "--prompt"]), new Set(["--as-coordinator"]));
|
|
186
|
+
requirePositionals(parsed.positionals, 2);
|
|
187
|
+
const [sessionId = "", text = ""] = parsed.positionals;
|
|
188
|
+
const approvalId = parsed.options.get("--prompt");
|
|
189
|
+
if (approvalId === undefined)
|
|
190
|
+
throw new CliArgumentError("Option '--prompt' is required: name the prompt that 'session show' printed.");
|
|
191
|
+
const commandId = parsed.options.get("--command-id");
|
|
192
|
+
return {
|
|
193
|
+
approvalId,
|
|
194
|
+
asCoordinator: parsed.flags.has("--as-coordinator"),
|
|
195
|
+
...(commandId === undefined ? {} : { commandId }),
|
|
196
|
+
sessionId,
|
|
197
|
+
text,
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
export const runSessionAnswer = (tokens, context) => {
|
|
201
|
+
const { sessionId, text, ...input } = parseAnswer(tokens);
|
|
202
|
+
return Effect.gen(function* () {
|
|
203
|
+
const credential = yield* holdsSessionCredential;
|
|
204
|
+
const shown = yield* context.dependencies.showSession(sessionId);
|
|
205
|
+
if (!shown.ok)
|
|
206
|
+
return reportError(shown.error, context);
|
|
207
|
+
if (shown.value.session.status === "unknown")
|
|
208
|
+
return statusUnreadable(context);
|
|
209
|
+
const { asCoordinator } = input;
|
|
210
|
+
return yield* decide(context, {
|
|
211
|
+
...input,
|
|
212
|
+
requested: (approval) => decisionFor(context, approval, {
|
|
213
|
+
asCoordinator,
|
|
214
|
+
credential,
|
|
215
|
+
sessionId,
|
|
216
|
+
text,
|
|
217
|
+
}),
|
|
218
|
+
});
|
|
219
|
+
});
|
|
220
|
+
};
|
|
141
221
|
//# sourceMappingURL=commands.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { type ApprovalCliDependencies, makeApprovalClient } from "./client.js";
|
|
2
|
-
export { runApprovalAnswer, runApprovalApprove, runApprovalDeny, runApprovalList, runApprovalShow, } from "./commands.js";
|
|
2
|
+
export { runApprovalAnswer, runApprovalApprove, runApprovalDeny, runApprovalList, runApprovalShow, runSessionAnswer, } from "./commands.js";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { makeApprovalClient } from "./client.js";
|
|
2
|
-
export { runApprovalAnswer, runApprovalApprove, runApprovalDeny, runApprovalList, runApprovalShow, } from "./commands.js";
|
|
2
|
+
export { runApprovalAnswer, runApprovalApprove, runApprovalDeny, runApprovalList, runApprovalShow, runSessionAnswer, } from "./commands.js";
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/dist/session/client.d.ts
CHANGED
|
@@ -1,14 +1,24 @@
|
|
|
1
|
-
import type { Session, SessionCreateParameters, SessionCreateResult, SessionCreationInput, SessionCreationOutcome, SessionCreationPlan, SessionEventsListResult, SessionInboxAckResult, SessionInboxCheckResult, SessionListParameters, SessionListResult, SessionMessageSendResult, SessionObserveResult, SessionResumeResult, SessionShowResult, SessionSpawnResult, SessionStartResult, SessionStopResult } from "@maiaos/sdk";
|
|
1
|
+
import type { Session, SessionCreateParameters, SessionCreateResult, SessionCreationInput, SessionCreationOutcome, SessionCreationPlan, SessionEventsListResult, SessionInboxAckResult, SessionInboxCheckResult, SessionListParameters, SessionListResult, SessionMessageSendResult, SessionObserveResult, SessionResumeResult, SessionShowResult, SessionSpawnResult, SessionStartResult, SessionStopResult, SessionWaitResult } from "@maiaos/sdk";
|
|
2
2
|
import { type CliNodeEffect, type CliNodeOperations } from "../local-node/index.js";
|
|
3
|
+
export type WaitSessionInput = {
|
|
4
|
+
readonly activities?: readonly string[];
|
|
5
|
+
readonly sessionId: string;
|
|
6
|
+
readonly states?: readonly string[];
|
|
7
|
+
readonly timeoutMilliseconds: number;
|
|
8
|
+
};
|
|
3
9
|
export type CreateSessionInput = {
|
|
4
10
|
readonly agentId?: SessionCreateParameters["agentId"];
|
|
5
11
|
readonly baseRef?: string;
|
|
6
12
|
readonly commandId?: string;
|
|
7
13
|
readonly connectionId?: string;
|
|
14
|
+
readonly cwd?: string;
|
|
8
15
|
readonly definitionRef?: SessionCreateParameters["definitionRef"];
|
|
9
16
|
readonly effort?: SessionCreateParameters["effort"];
|
|
10
17
|
readonly executor?: SessionCreateParameters["executor"];
|
|
18
|
+
readonly hostAuthority?: SessionCreateParameters["hostAuthority"];
|
|
19
|
+
readonly labels?: SessionCreateParameters["labels"];
|
|
11
20
|
readonly model?: string;
|
|
21
|
+
readonly permission?: SessionCreateParameters["permission"];
|
|
12
22
|
readonly role?: SessionCreateParameters["role"];
|
|
13
23
|
readonly title?: string;
|
|
14
24
|
readonly workspaceId: string;
|
|
@@ -59,7 +69,7 @@ export declare const makeSessionClient: (node: CliNodeOperations) => {
|
|
|
59
69
|
readonly commandId: string;
|
|
60
70
|
readonly grantedAt: string;
|
|
61
71
|
readonly inputDigest: string;
|
|
62
|
-
readonly operationIds: readonly ("agents.change.confirm" | "agents.change.preview" | "agents.list" | "agents.show" | "approval.list" | "approval.respond" | "approval.show" | "connection.capacity.set" | "connection.create" | "connection.detect" | "connection.gateway.create" | "connection.grant.list" | "connection.grant.set.confirm" | "connection.grant.set.preview" | "connection.list" | "connection.login.start" | "connection.models.list" | "connection.pool.list" | "connection.pool.set.confirm" | "connection.pool.set.preview" | "connection.show" | "connection.state.set" | "connection.system.confirm" | "connection.system.preview" | "connection.upkeep.confirm" | "connection.upkeep.preview" | "connection.upkeep.refresh" | "connection.usage.show" | "container.create.confirm" | "container.create.preview" | "container.index.list" | "container.list" | "container.rename.confirm" | "container.rename.preview" | "container.show" | "context.show" | "discovery.sessions.list" | "execution.catalog.get" | "execution.checkpoint.create" | "execution.checkpoint.show" | "execution.command.run" | "execution.file.read" | "execution.placement.create" | "execution.placement.show" | "execution.relocation.apply" | "execution.relocation.plan" | "execution.relocation.reconcile" | "execution.relocation.show" | "execution.worktree.create" | "execution.worktree.import" | "execution.worktree.reconcile" | "execution.worktree.remove.apply" | "execution.worktree.remove.plan" | "execution.worktree.status" | "harness.installed.list" | "hold.list" | "hold.place.confirm" | "hold.place.preview" | "hold.release.confirm" | "hold.release.preview" | "integration.apply.claude-code" | "integration.apply.codex" | "integration.apply.pi-rpc" | "integration.plan.claude-code" | "integration.plan.codex" | "integration.plan.pi-rpc" | "integration.remove.claude-code" | "integration.remove.codex" | "integration.remove.pi-rpc" | "integration.status.claude-code" | "integration.status.codex" | "integration.status.pi-rpc" | "interaction.cancel" | "interaction.create" | "interaction.list" | "interaction.respond" | "interaction.show" | "monitor.bootstrap.create" | "node.remote.install.confirm" | "node.remote.install.preview" | "node.remote.list" | "node.remote.register.confirm" | "node.remote.register.preview" | "node.remote.remove.confirm" | "node.remote.remove.preview" | "node.shutdown" | "node.status" | "port.lease.acquire" | "port.lease.list" | "port.lease.release" | "port.lease.renew" | "presentation.catalog.show" | "presentation.project-list.show" | "presentation.session-list.show" | "presentation.workspace-directory.show" | "project.context.list" | "project.context.record" | "project.context.show" | "project.create.confirm" | "project.create.preview" | "project.guard.confirm" | "project.guard.preview" | "project.guard.show" | "project.list" | "project.register" | "project.rename.confirm" | "project.rename.preview" | "project.show" | "provider.pool.list" | "receipt.get" | "receipt.list" | "reference.resolve" | "routine.create.confirm" | "routine.create.preview" | "routine.disable.confirm" | "routine.disable.preview" | "routine.list" | "routine.pause" | "routine.resume" | "routine.run.confirm" | "routine.run.preview" | "routine.show" | "run.create" | "run.dispatch.settle-terminal" | "run.dispatch.show" | "run.inbox.ack" | "run.inbox.check" | "run.ledger.create" | "run.ledger.list" | "run.ledger.task.dispatch" | "run.ledger.task.list" | "run.ledger.task.settle" | "run.ledger.task.show" | "run.list" | "run.question.cancel" | "run.question.open" | "run.question.reply" | "run.show" | "run.task.list" | "run.task.show" | "runtime.probe" | "session.adopt.confirm" | "session.adopt.preview" | "session.agent-permission.confirm" | "session.agent-permission.preview" | "session.archive" | "session.create" | "session.diff" | "session.events.list" | "session.history.read" | "session.inbox.ack" | "session.inbox.check" | "session.list" | "session.message.send" | "session.observe" | "session.rename" | "session.resume" | "session.show" | "session.spawn" | "session.start" | "session.stop" | "team-workspace.bootstrap.apply" | "team-workspace.bootstrap.preview" | "terminal.controller.acquire" | "terminal.controller.release" | "terminal.controller.renew" | "terminal.controller.request" | "terminal.controller.request.show" | "terminal.create" | "terminal.events.list" | "terminal.input.write" | "terminal.list" | "terminal.mutation.reconcile" | "terminal.observer.attach" | "terminal.observer.check" | "terminal.observer.detach" | "terminal.observer.resync" | "terminal.read" | "terminal.session.close" | "terminal.session.delete" | "terminal.session.resize" | "terminal.session.restart" | "terminal.session.signal" | "terminal.show" | "turn.cancel" | "turn.interrupt" | "turn.queue.list" | "turn.send" | "turn.show" | "turn.wait" | "voice.managed-turn.confirm" | "voice.managed-turn.preview" | "voice.orchestrator.context.show" | "voice.orchestrator.tool.call" | "voice.pi.relay" | "voice.pi.relay.preview" | "voice.pi.relay.reconcile" | "workspace.context.show" | "workspace.execution.configure" | "workspace.execution.show" | "workspace.list" | "workspace.membership.attach" | "workspace.repository.attach" | "workspace.select" | "workspace.show")[];
|
|
72
|
+
readonly operationIds: readonly ("agents.change.confirm" | "agents.change.preview" | "agents.detect" | "agents.list" | "agents.show" | "approval.list" | "approval.respond" | "approval.show" | "connection.capacity.set" | "connection.create" | "connection.detect" | "connection.gateway.create" | "connection.grant.list" | "connection.grant.set.confirm" | "connection.grant.set.preview" | "connection.list" | "connection.login.start" | "connection.models.list" | "connection.pool.list" | "connection.pool.set.confirm" | "connection.pool.set.preview" | "connection.show" | "connection.state.set" | "connection.system.confirm" | "connection.system.preview" | "connection.upkeep.confirm" | "connection.upkeep.preview" | "connection.upkeep.refresh" | "connection.usage.show" | "container.create.confirm" | "container.create.preview" | "container.index.list" | "container.list" | "container.rename.confirm" | "container.rename.preview" | "container.show" | "context.show" | "discovery.sessions.list" | "events.read" | "execution.catalog.get" | "execution.checkpoint.create" | "execution.checkpoint.show" | "execution.command.run" | "execution.file.read" | "execution.placement.create" | "execution.placement.show" | "execution.relocation.apply" | "execution.relocation.plan" | "execution.relocation.reconcile" | "execution.relocation.show" | "execution.worktree.create" | "execution.worktree.import" | "execution.worktree.reconcile" | "execution.worktree.remove.apply" | "execution.worktree.remove.plan" | "execution.worktree.status" | "harness.installed.list" | "hold.list" | "hold.place.confirm" | "hold.place.preview" | "hold.release.confirm" | "hold.release.preview" | "integration.apply.claude-code" | "integration.apply.codex" | "integration.apply.pi-rpc" | "integration.plan.claude-code" | "integration.plan.codex" | "integration.plan.pi-rpc" | "integration.remove.claude-code" | "integration.remove.codex" | "integration.remove.pi-rpc" | "integration.status.claude-code" | "integration.status.codex" | "integration.status.pi-rpc" | "interaction.cancel" | "interaction.create" | "interaction.list" | "interaction.respond" | "interaction.show" | "monitor.bootstrap.create" | "node.remote.install.confirm" | "node.remote.install.preview" | "node.remote.list" | "node.remote.register.confirm" | "node.remote.register.preview" | "node.remote.remove.confirm" | "node.remote.remove.preview" | "node.shutdown" | "node.status" | "port.lease.acquire" | "port.lease.list" | "port.lease.release" | "port.lease.renew" | "presentation.catalog.show" | "presentation.project-list.show" | "presentation.session-list.show" | "presentation.workspace-directory.show" | "project.context.list" | "project.context.record" | "project.context.show" | "project.create.confirm" | "project.create.preview" | "project.guard.confirm" | "project.guard.preview" | "project.guard.show" | "project.list" | "project.register" | "project.rename.confirm" | "project.rename.preview" | "project.show" | "provider.pool.list" | "receipt.get" | "receipt.list" | "reference.resolve" | "routine.create.confirm" | "routine.create.preview" | "routine.disable.confirm" | "routine.disable.preview" | "routine.list" | "routine.pause" | "routine.resume" | "routine.run.confirm" | "routine.run.preview" | "routine.show" | "run.create" | "run.dispatch.settle-terminal" | "run.dispatch.show" | "run.inbox.ack" | "run.inbox.check" | "run.ledger.create" | "run.ledger.list" | "run.ledger.task.dispatch" | "run.ledger.task.list" | "run.ledger.task.settle" | "run.ledger.task.show" | "run.list" | "run.question.cancel" | "run.question.open" | "run.question.reply" | "run.show" | "run.task.list" | "run.task.show" | "runtime.probe" | "session.adopt.confirm" | "session.adopt.preview" | "session.agent-permission.confirm" | "session.agent-permission.preview" | "session.archive" | "session.create" | "session.diff" | "session.events.list" | "session.history.read" | "session.inbox.ack" | "session.inbox.check" | "session.list" | "session.message.send" | "session.observe" | "session.rename" | "session.resume" | "session.show" | "session.spawn" | "session.start" | "session.stop" | "session.wait" | "team-workspace.bootstrap.apply" | "team-workspace.bootstrap.preview" | "terminal.controller.acquire" | "terminal.controller.release" | "terminal.controller.renew" | "terminal.controller.request" | "terminal.controller.request.show" | "terminal.create" | "terminal.events.list" | "terminal.input.write" | "terminal.list" | "terminal.mutation.reconcile" | "terminal.observer.attach" | "terminal.observer.check" | "terminal.observer.detach" | "terminal.observer.resync" | "terminal.read" | "terminal.session.close" | "terminal.session.delete" | "terminal.session.resize" | "terminal.session.restart" | "terminal.session.signal" | "terminal.show" | "turn.cancel" | "turn.interrupt" | "turn.queue.list" | "turn.send" | "turn.show" | "turn.wait" | "voice.managed-turn.confirm" | "voice.managed-turn.preview" | "voice.orchestrator.context.show" | "voice.orchestrator.tool.call" | "voice.pi.relay" | "voice.pi.relay.preview" | "voice.pi.relay.reconcile" | "webhooks.change.confirm" | "webhooks.change.preview" | "webhooks.deliveries" | "webhooks.list" | "workspace.context.show" | "workspace.execution.configure" | "workspace.execution.show" | "workspace.list" | "workspace.membership.attach" | "workspace.repository.attach" | "workspace.select" | "workspace.show")[];
|
|
63
73
|
readonly revision: "1";
|
|
64
74
|
};
|
|
65
75
|
readonly method: "session.agent-permission.confirm";
|
|
@@ -96,7 +106,7 @@ export declare const makeSessionClient: (node: CliNodeOperations) => {
|
|
|
96
106
|
readonly inputDigest: string;
|
|
97
107
|
readonly issuedAt: string;
|
|
98
108
|
readonly method: "session.agent-permission.preview";
|
|
99
|
-
readonly operationIds: readonly ("agents.change.confirm" | "agents.change.preview" | "agents.list" | "agents.show" | "approval.list" | "approval.respond" | "approval.show" | "connection.capacity.set" | "connection.create" | "connection.detect" | "connection.gateway.create" | "connection.grant.list" | "connection.grant.set.confirm" | "connection.grant.set.preview" | "connection.list" | "connection.login.start" | "connection.models.list" | "connection.pool.list" | "connection.pool.set.confirm" | "connection.pool.set.preview" | "connection.show" | "connection.state.set" | "connection.system.confirm" | "connection.system.preview" | "connection.upkeep.confirm" | "connection.upkeep.preview" | "connection.upkeep.refresh" | "connection.usage.show" | "container.create.confirm" | "container.create.preview" | "container.index.list" | "container.list" | "container.rename.confirm" | "container.rename.preview" | "container.show" | "context.show" | "discovery.sessions.list" | "execution.catalog.get" | "execution.checkpoint.create" | "execution.checkpoint.show" | "execution.command.run" | "execution.file.read" | "execution.placement.create" | "execution.placement.show" | "execution.relocation.apply" | "execution.relocation.plan" | "execution.relocation.reconcile" | "execution.relocation.show" | "execution.worktree.create" | "execution.worktree.import" | "execution.worktree.reconcile" | "execution.worktree.remove.apply" | "execution.worktree.remove.plan" | "execution.worktree.status" | "harness.installed.list" | "hold.list" | "hold.place.confirm" | "hold.place.preview" | "hold.release.confirm" | "hold.release.preview" | "integration.apply.claude-code" | "integration.apply.codex" | "integration.apply.pi-rpc" | "integration.plan.claude-code" | "integration.plan.codex" | "integration.plan.pi-rpc" | "integration.remove.claude-code" | "integration.remove.codex" | "integration.remove.pi-rpc" | "integration.status.claude-code" | "integration.status.codex" | "integration.status.pi-rpc" | "interaction.cancel" | "interaction.create" | "interaction.list" | "interaction.respond" | "interaction.show" | "monitor.bootstrap.create" | "node.remote.install.confirm" | "node.remote.install.preview" | "node.remote.list" | "node.remote.register.confirm" | "node.remote.register.preview" | "node.remote.remove.confirm" | "node.remote.remove.preview" | "node.shutdown" | "node.status" | "port.lease.acquire" | "port.lease.list" | "port.lease.release" | "port.lease.renew" | "presentation.catalog.show" | "presentation.project-list.show" | "presentation.session-list.show" | "presentation.workspace-directory.show" | "project.context.list" | "project.context.record" | "project.context.show" | "project.create.confirm" | "project.create.preview" | "project.guard.confirm" | "project.guard.preview" | "project.guard.show" | "project.list" | "project.register" | "project.rename.confirm" | "project.rename.preview" | "project.show" | "provider.pool.list" | "receipt.get" | "receipt.list" | "reference.resolve" | "routine.create.confirm" | "routine.create.preview" | "routine.disable.confirm" | "routine.disable.preview" | "routine.list" | "routine.pause" | "routine.resume" | "routine.run.confirm" | "routine.run.preview" | "routine.show" | "run.create" | "run.dispatch.settle-terminal" | "run.dispatch.show" | "run.inbox.ack" | "run.inbox.check" | "run.ledger.create" | "run.ledger.list" | "run.ledger.task.dispatch" | "run.ledger.task.list" | "run.ledger.task.settle" | "run.ledger.task.show" | "run.list" | "run.question.cancel" | "run.question.open" | "run.question.reply" | "run.show" | "run.task.list" | "run.task.show" | "runtime.probe" | "session.adopt.confirm" | "session.adopt.preview" | "session.agent-permission.confirm" | "session.agent-permission.preview" | "session.archive" | "session.create" | "session.diff" | "session.events.list" | "session.history.read" | "session.inbox.ack" | "session.inbox.check" | "session.list" | "session.message.send" | "session.observe" | "session.rename" | "session.resume" | "session.show" | "session.spawn" | "session.start" | "session.stop" | "team-workspace.bootstrap.apply" | "team-workspace.bootstrap.preview" | "terminal.controller.acquire" | "terminal.controller.release" | "terminal.controller.renew" | "terminal.controller.request" | "terminal.controller.request.show" | "terminal.create" | "terminal.events.list" | "terminal.input.write" | "terminal.list" | "terminal.mutation.reconcile" | "terminal.observer.attach" | "terminal.observer.check" | "terminal.observer.detach" | "terminal.observer.resync" | "terminal.read" | "terminal.session.close" | "terminal.session.delete" | "terminal.session.resize" | "terminal.session.restart" | "terminal.session.signal" | "terminal.show" | "turn.cancel" | "turn.interrupt" | "turn.queue.list" | "turn.send" | "turn.show" | "turn.wait" | "voice.managed-turn.confirm" | "voice.managed-turn.preview" | "voice.orchestrator.context.show" | "voice.orchestrator.tool.call" | "voice.pi.relay" | "voice.pi.relay.preview" | "voice.pi.relay.reconcile" | "workspace.context.show" | "workspace.execution.configure" | "workspace.execution.show" | "workspace.list" | "workspace.membership.attach" | "workspace.repository.attach" | "workspace.select" | "workspace.show")[];
|
|
109
|
+
readonly operationIds: readonly ("agents.change.confirm" | "agents.change.preview" | "agents.detect" | "agents.list" | "agents.show" | "approval.list" | "approval.respond" | "approval.show" | "connection.capacity.set" | "connection.create" | "connection.detect" | "connection.gateway.create" | "connection.grant.list" | "connection.grant.set.confirm" | "connection.grant.set.preview" | "connection.list" | "connection.login.start" | "connection.models.list" | "connection.pool.list" | "connection.pool.set.confirm" | "connection.pool.set.preview" | "connection.show" | "connection.state.set" | "connection.system.confirm" | "connection.system.preview" | "connection.upkeep.confirm" | "connection.upkeep.preview" | "connection.upkeep.refresh" | "connection.usage.show" | "container.create.confirm" | "container.create.preview" | "container.index.list" | "container.list" | "container.rename.confirm" | "container.rename.preview" | "container.show" | "context.show" | "discovery.sessions.list" | "events.read" | "execution.catalog.get" | "execution.checkpoint.create" | "execution.checkpoint.show" | "execution.command.run" | "execution.file.read" | "execution.placement.create" | "execution.placement.show" | "execution.relocation.apply" | "execution.relocation.plan" | "execution.relocation.reconcile" | "execution.relocation.show" | "execution.worktree.create" | "execution.worktree.import" | "execution.worktree.reconcile" | "execution.worktree.remove.apply" | "execution.worktree.remove.plan" | "execution.worktree.status" | "harness.installed.list" | "hold.list" | "hold.place.confirm" | "hold.place.preview" | "hold.release.confirm" | "hold.release.preview" | "integration.apply.claude-code" | "integration.apply.codex" | "integration.apply.pi-rpc" | "integration.plan.claude-code" | "integration.plan.codex" | "integration.plan.pi-rpc" | "integration.remove.claude-code" | "integration.remove.codex" | "integration.remove.pi-rpc" | "integration.status.claude-code" | "integration.status.codex" | "integration.status.pi-rpc" | "interaction.cancel" | "interaction.create" | "interaction.list" | "interaction.respond" | "interaction.show" | "monitor.bootstrap.create" | "node.remote.install.confirm" | "node.remote.install.preview" | "node.remote.list" | "node.remote.register.confirm" | "node.remote.register.preview" | "node.remote.remove.confirm" | "node.remote.remove.preview" | "node.shutdown" | "node.status" | "port.lease.acquire" | "port.lease.list" | "port.lease.release" | "port.lease.renew" | "presentation.catalog.show" | "presentation.project-list.show" | "presentation.session-list.show" | "presentation.workspace-directory.show" | "project.context.list" | "project.context.record" | "project.context.show" | "project.create.confirm" | "project.create.preview" | "project.guard.confirm" | "project.guard.preview" | "project.guard.show" | "project.list" | "project.register" | "project.rename.confirm" | "project.rename.preview" | "project.show" | "provider.pool.list" | "receipt.get" | "receipt.list" | "reference.resolve" | "routine.create.confirm" | "routine.create.preview" | "routine.disable.confirm" | "routine.disable.preview" | "routine.list" | "routine.pause" | "routine.resume" | "routine.run.confirm" | "routine.run.preview" | "routine.show" | "run.create" | "run.dispatch.settle-terminal" | "run.dispatch.show" | "run.inbox.ack" | "run.inbox.check" | "run.ledger.create" | "run.ledger.list" | "run.ledger.task.dispatch" | "run.ledger.task.list" | "run.ledger.task.settle" | "run.ledger.task.show" | "run.list" | "run.question.cancel" | "run.question.open" | "run.question.reply" | "run.show" | "run.task.list" | "run.task.show" | "runtime.probe" | "session.adopt.confirm" | "session.adopt.preview" | "session.agent-permission.confirm" | "session.agent-permission.preview" | "session.archive" | "session.create" | "session.diff" | "session.events.list" | "session.history.read" | "session.inbox.ack" | "session.inbox.check" | "session.list" | "session.message.send" | "session.observe" | "session.rename" | "session.resume" | "session.show" | "session.spawn" | "session.start" | "session.stop" | "session.wait" | "team-workspace.bootstrap.apply" | "team-workspace.bootstrap.preview" | "terminal.controller.acquire" | "terminal.controller.release" | "terminal.controller.renew" | "terminal.controller.request" | "terminal.controller.request.show" | "terminal.create" | "terminal.events.list" | "terminal.input.write" | "terminal.list" | "terminal.mutation.reconcile" | "terminal.observer.attach" | "terminal.observer.check" | "terminal.observer.detach" | "terminal.observer.resync" | "terminal.read" | "terminal.session.close" | "terminal.session.delete" | "terminal.session.resize" | "terminal.session.restart" | "terminal.session.signal" | "terminal.show" | "turn.cancel" | "turn.interrupt" | "turn.queue.list" | "turn.send" | "turn.show" | "turn.wait" | "voice.managed-turn.confirm" | "voice.managed-turn.preview" | "voice.orchestrator.context.show" | "voice.orchestrator.tool.call" | "voice.pi.relay" | "voice.pi.relay.preview" | "voice.pi.relay.reconcile" | "webhooks.change.confirm" | "webhooks.change.preview" | "webhooks.deliveries" | "webhooks.list" | "workspace.context.show" | "workspace.execution.configure" | "workspace.execution.show" | "workspace.list" | "workspace.membership.attach" | "workspace.repository.attach" | "workspace.select" | "workspace.show")[];
|
|
100
110
|
readonly proof: string;
|
|
101
111
|
}>;
|
|
102
112
|
attachSession: (input: import("./attach-client.js").AttachSessionInput) => CliNodeEffect<import("./attach-client.js").SessionAttachStream>;
|
|
@@ -129,6 +139,7 @@ export declare const makeSessionClient: (node: CliNodeOperations) => {
|
|
|
129
139
|
spawnSession: (input: SpawnSessionInput) => CliNodeEffect<SessionSpawnResult>;
|
|
130
140
|
startSession: (input: StartSessionInput) => CliNodeEffect<SessionStartResult>;
|
|
131
141
|
stopSession: (input: StartSessionInput) => CliNodeEffect<SessionStopResult>;
|
|
142
|
+
waitSession: (input: WaitSessionInput) => CliNodeEffect<SessionWaitResult>;
|
|
132
143
|
};
|
|
133
144
|
export {};
|
|
134
145
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/session/client.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { sessionCreateParametersSchema, sessionEventsListParametersSchema, sessionInboxAckParametersSchema, sessionInboxCheckParametersSchema, sessionListParametersSchema, sessionMessageSendParametersSchema, sessionObserveParametersSchema, sessionResumeParametersSchema, sessionShowParametersSchema, sessionSpawnParametersSchema, sessionStartParametersSchema, sessionStopParametersSchema, } from "@maiaos/sdk";
|
|
1
|
+
import { MAX_SESSION_WAIT_MILLISECONDS, sessionCreateParametersSchema, sessionEventsListParametersSchema, sessionInboxAckParametersSchema, sessionInboxCheckParametersSchema, sessionListParametersSchema, sessionMessageSendParametersSchema, sessionObserveParametersSchema, sessionResumeParametersSchema, sessionShowParametersSchema, sessionSpawnParametersSchema, sessionStartParametersSchema, sessionStopParametersSchema, sessionWaitParametersSchema, } from "@maiaos/sdk";
|
|
2
2
|
import * as Crypto from "effect/Crypto";
|
|
3
3
|
import * as Effect from "effect/Effect";
|
|
4
4
|
import { makeRelocateClient } from "../execution/index.js";
|
|
5
|
-
import { commandIdentifier, } from "../local-node/index.js";
|
|
5
|
+
import { commandIdentifier, repeatBoundedWait, } from "../local-node/index.js";
|
|
6
6
|
import { makeAgentPermissionCliClient } from "./agent-permission.js";
|
|
7
7
|
import { makeAttachClient } from "./attach-client.js";
|
|
8
8
|
import { makeCodingSessionClient } from "./coding-client.js";
|
|
@@ -24,6 +24,20 @@ export const makeSessionClient = (node) => {
|
|
|
24
24
|
const showSession = (sessionId) => {
|
|
25
25
|
return node.runValidatedNodeOperation({ sessionId }, sessionShowParametersSchema, (client, parameters, options) => client.showSession(parameters, options));
|
|
26
26
|
};
|
|
27
|
+
const waitSessionOnce = (parameters) => node.runValidatedNodeOperation(parameters, sessionWaitParametersSchema, (client, validated, options) => client.waitSession(validated, options));
|
|
28
|
+
const waitSession = (input) => repeatBoundedWait({
|
|
29
|
+
maxRequestMilliseconds: MAX_SESSION_WAIT_MILLISECONDS,
|
|
30
|
+
once: (waitMilliseconds) => waitSessionOnce({
|
|
31
|
+
...(input.activities === undefined
|
|
32
|
+
? {}
|
|
33
|
+
: { activities: input.activities }),
|
|
34
|
+
sessionId: input.sessionId,
|
|
35
|
+
...(input.states === undefined ? {} : { states: input.states }),
|
|
36
|
+
waitMilliseconds,
|
|
37
|
+
}),
|
|
38
|
+
satisfied: (value) => value.satisfied,
|
|
39
|
+
timeoutMilliseconds: input.timeoutMilliseconds,
|
|
40
|
+
});
|
|
27
41
|
const observeSessions = (input) => node.runValidatedNodeOperation(input, sessionObserveParametersSchema, (client, parameters, options) => client.observeSessions(parameters, options));
|
|
28
42
|
const listSessionEvents = (input) => {
|
|
29
43
|
return node.runValidatedNodeOperation(input, sessionEventsListParametersSchema, (client, parameters, options) => client.listSessionEvents(parameters, options));
|
|
@@ -108,6 +122,7 @@ export const makeSessionClient = (node) => {
|
|
|
108
122
|
spawnSession,
|
|
109
123
|
startSession,
|
|
110
124
|
stopSession,
|
|
125
|
+
waitSession,
|
|
111
126
|
...makeRelocateClient(node),
|
|
112
127
|
...makeAgentPermissionCliClient(node),
|
|
113
128
|
...makeCodingSessionClient(node),
|
|
@@ -8,6 +8,8 @@ export type ArchiveSessionInput = {
|
|
|
8
8
|
readonly commandId?: string;
|
|
9
9
|
readonly expectedRevision: string;
|
|
10
10
|
readonly sessionId: string;
|
|
11
|
+
readonly summary?: string;
|
|
12
|
+
readonly transcriptPath?: string;
|
|
11
13
|
};
|
|
12
14
|
export declare const makeCodingSessionClient: (node: CliNodeOperations) => {
|
|
13
15
|
archiveSession: (input: ArchiveSessionInput) => CliNodeEffect<SessionArchiveResult>;
|
|
@@ -3,9 +3,8 @@ import * as Effect from "effect/Effect";
|
|
|
3
3
|
import { commandIdentifier, } from "../local-node/index.js";
|
|
4
4
|
export const makeCodingSessionClient = (node) => ({
|
|
5
5
|
archiveSession: (input) => Effect.flatMap(commandIdentifier(input.commandId), (commandId) => node.runValidatedNodeOperation({
|
|
6
|
+
...input,
|
|
6
7
|
commandId,
|
|
7
|
-
expectedRevision: input.expectedRevision,
|
|
8
|
-
sessionId: input.sessionId,
|
|
9
8
|
}, sessionArchiveParametersSchema, (client, parameters, options) => client.archiveSession(parameters, options), { commandId })),
|
|
10
9
|
diffSession: (input) => node.runValidatedNodeOperation({
|
|
11
10
|
sessionId: input.sessionId,
|
|
@@ -29,19 +29,36 @@ const summarizeArchive = (result) => ({
|
|
|
29
29
|
revision: result.session.revision,
|
|
30
30
|
sessionId: result.session.id,
|
|
31
31
|
state: result.session.state,
|
|
32
|
+
...(result.summary === undefined ? {} : { summary: result.summary }),
|
|
33
|
+
...(result.transcriptPath === undefined
|
|
34
|
+
? {}
|
|
35
|
+
: { transcriptPath: result.transcriptPath }),
|
|
32
36
|
});
|
|
33
|
-
|
|
34
|
-
const parsed = parseOptions(tokens, new Set([
|
|
37
|
+
const readArchiveInput = (tokens) => {
|
|
38
|
+
const parsed = parseOptions(tokens, new Set([
|
|
39
|
+
"--command-id",
|
|
40
|
+
"--expected-revision",
|
|
41
|
+
"--summary",
|
|
42
|
+
"--transcript",
|
|
43
|
+
]));
|
|
35
44
|
requirePositionals(parsed.positionals, 1);
|
|
36
|
-
const { archiveSession } = context.dependencies;
|
|
37
|
-
if (archiveSession === undefined)
|
|
38
|
-
throw new CliArgumentError("Session archive is unavailable.");
|
|
39
45
|
const commandId = parsed.options.get("--command-id");
|
|
40
|
-
const
|
|
46
|
+
const summary = parsed.options.get("--summary");
|
|
47
|
+
const transcriptPath = parsed.options.get("--transcript");
|
|
48
|
+
return {
|
|
41
49
|
...(commandId === undefined ? {} : { commandId }),
|
|
42
50
|
expectedRevision: readExpectedRevision(parsed.options.get("--expected-revision")),
|
|
43
51
|
sessionId: requireSessionId(parsed.positionals),
|
|
44
|
-
|
|
52
|
+
...(summary === undefined ? {} : { summary }),
|
|
53
|
+
...(transcriptPath === undefined ? {} : { transcriptPath }),
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
export const runSessionArchive = (tokens, context) => Effect.gen(function* () {
|
|
57
|
+
const input = readArchiveInput(tokens);
|
|
58
|
+
const { archiveSession } = context.dependencies;
|
|
59
|
+
if (archiveSession === undefined)
|
|
60
|
+
throw new CliArgumentError("Session archive is unavailable.");
|
|
61
|
+
const result = yield* archiveSession(input);
|
|
45
62
|
return writeSessionResult(result, context, (value) => ({
|
|
46
63
|
command: "session.archive",
|
|
47
64
|
result: summarizeArchive(value),
|
|
@@ -2,6 +2,7 @@ import { type CommandContext, type CommandEffect } from "../command-line/index.j
|
|
|
2
2
|
export declare const runSessionCreate: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
3
3
|
export declare const runSessionList: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
4
4
|
export declare const runSessionShow: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
5
|
+
export declare const runSessionWait: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
5
6
|
export declare const runSessionStart: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
6
7
|
export declare const runSessionStop: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
7
8
|
export declare const runSessionResume: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|