@maiaos/cli 0.1.0-canary.2 → 0.1.0-canary.4
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 +38 -265
- package/dist/address-space/address-space.d.ts +38 -0
- package/dist/address-space/address-space.js +130 -0
- package/dist/address-space/index.d.ts +2 -0
- package/dist/address-space/index.js +2 -0
- package/dist/agents/client.d.ts +171 -0
- package/dist/agents/client.js +8 -0
- package/dist/agents/commands.d.ts +7 -0
- package/dist/agents/commands.js +65 -0
- package/dist/agents/index.d.ts +3 -0
- package/dist/agents/index.js +3 -0
- package/dist/agents/input.d.ts +130 -0
- package/dist/agents/input.js +99 -0
- package/dist/agents/output/format.d.ts +8 -0
- package/dist/agents/output/format.js +47 -0
- package/dist/agents/output/index.d.ts +2 -0
- package/dist/agents/output/index.js +2 -0
- package/dist/agents/tree/index.d.ts +2 -0
- package/dist/agents/tree/index.js +2 -0
- package/dist/agents/tree/tree.d.ts +3 -0
- package/dist/agents/tree/tree.js +43 -0
- package/dist/bin/maia.cdx.json +37 -14
- package/dist/bin/maia.mjs +1 -1
- package/dist/bootstrap/exit.d.ts +14 -0
- package/dist/bootstrap/exit.js +42 -0
- package/dist/bootstrap/process.js +4 -26
- package/dist/cli/cli.js +76 -13
- package/dist/command-line/context.d.ts +13 -4
- package/dist/command-line/context.js +1 -1
- package/dist/command-line/index.d.ts +5 -5
- package/dist/command-line/index.js +5 -4
- package/dist/command-line/input/index.d.ts +1 -1
- package/dist/command-line/input/index.js +1 -1
- package/dist/command-line/input/stdin.d.ts +1 -0
- package/dist/command-line/input/stdin.js +1 -0
- package/dist/command-line/json.d.ts +1 -0
- package/dist/command-line/json.js +23 -0
- package/dist/command-line/output.d.ts +8 -1
- package/dist/command-line/output.js +33 -14
- package/dist/command-line/rows.d.ts +2 -0
- package/dist/command-line/rows.js +10 -1
- package/dist/command-line/two-phase.d.ts +5 -0
- package/dist/command-line/two-phase.js +33 -8
- package/dist/command-tree/help.d.ts +1 -1
- package/dist/command-tree/help.js +1 -0
- package/dist/command-tree/index.d.ts +2 -2
- package/dist/command-tree/index.js +1 -1
- package/dist/command-tree/local.js +12 -0
- package/dist/command-tree/placeholder.d.ts +1 -0
- package/dist/command-tree/placeholder.js +1 -0
- package/dist/command-tree/row.d.ts +2 -0
- package/dist/command-tree/tree.d.ts +3 -2
- package/dist/command-tree/tree.js +18 -2
- package/dist/connection/access/client.d.ts +13 -0
- package/dist/connection/access/client.js +19 -0
- package/dist/connection/access/commands.d.ts +6 -0
- package/dist/connection/access/commands.js +60 -0
- package/dist/connection/access/format.d.ts +8 -0
- package/dist/connection/access/format.js +61 -0
- package/dist/connection/access/index.d.ts +3 -0
- package/dist/connection/access/index.js +3 -0
- package/dist/connection/access/input.d.ts +53 -0
- package/dist/connection/access/input.js +83 -0
- package/dist/connection/client.d.ts +99 -1
- package/dist/connection/client.js +9 -1
- package/dist/connection/index.d.ts +2 -1
- package/dist/connection/index.js +2 -1
- package/dist/connection/system.d.ts +1 -0
- package/dist/connection/system.js +109 -5
- package/dist/connection/tree/tree.js +59 -8
- package/dist/container/output/format.js +1 -2
- package/dist/dashboard/cockpit-client.d.ts +6 -0
- package/dist/dashboard/cockpit-client.js +27 -0
- package/dist/dashboard/cockpits.d.ts +29 -0
- package/dist/dashboard/cockpits.js +65 -0
- package/dist/dashboard/dashboard.d.ts +7 -0
- package/dist/dashboard/dashboard.js +47 -0
- package/dist/dashboard/draw.d.ts +15 -0
- package/dist/dashboard/draw.js +30 -0
- package/dist/dashboard/frame.d.ts +4 -0
- package/dist/dashboard/frame.js +15 -0
- package/dist/dashboard/index.d.ts +2 -0
- package/dist/dashboard/index.js +2 -0
- package/dist/dashboard/modes.d.ts +5 -0
- package/dist/dashboard/modes.js +16 -0
- package/dist/dashboard/node-connection.d.ts +15 -0
- package/dist/dashboard/node-connection.js +51 -0
- package/dist/dashboard/pi-tui.d.ts +6 -0
- package/dist/dashboard/pi-tui.js +35 -0
- package/dist/dashboard/status-bar.d.ts +4 -0
- package/dist/dashboard/status-bar.js +60 -0
- package/dist/dashboard/terminal.d.ts +53 -0
- package/dist/dashboard/terminal.js +165 -0
- package/dist/dashboard/tree-model.d.ts +28 -0
- package/dist/dashboard/tree-model.js +97 -0
- package/dist/dashboard/tree.d.ts +10 -0
- package/dist/dashboard/tree.js +76 -0
- package/dist/fleet/fleet.d.ts +70 -0
- package/dist/fleet/fleet.js +91 -0
- package/dist/fleet/index.d.ts +2 -0
- package/dist/fleet/index.js +2 -0
- package/dist/hold/output/format.js +1 -5
- package/dist/hold/tree/tree.js +1 -0
- package/dist/import/commands.js +3 -4
- package/dist/import/output.js +1 -4
- package/dist/local-node/client.d.ts +8 -4
- package/dist/local-node/client.js +20 -9
- package/dist/local-node/index.d.ts +1 -1
- package/dist/local-node/index.js +1 -1
- package/dist/login/commands.js +2 -1
- package/dist/mcp/calls.d.ts +1 -0
- package/dist/mcp/calls.js +36 -3
- package/dist/mcp/commands.d.ts +5 -2
- package/dist/mcp/commands.js +30 -4
- package/dist/mcp/routing.d.ts +24 -0
- package/dist/mcp/routing.js +188 -0
- package/dist/mcp/server.d.ts +13 -4
- package/dist/mcp/server.js +35 -12
- package/dist/presentation/output/format.js +4 -3
- package/dist/project-guard/commands.js +11 -2
- package/dist/project-workspace/commands.js +16 -6
- package/dist/project-workspace/output/human.d.ts +13 -0
- package/dist/project-workspace/output/human.js +17 -5
- package/dist/project-workspace/output/index.d.ts +1 -1
- package/dist/project-workspace/output/index.js +1 -1
- package/dist/project-workspace/output/metadata.js +1 -1
- package/dist/project-workspace/tree/tree.js +27 -12
- package/dist/reference/commands.js +4 -2
- package/dist/reference/index.d.ts +1 -1
- package/dist/reference/index.js +1 -1
- package/dist/reference/resolve.d.ts +2 -0
- package/dist/reference/resolve.js +20 -17
- package/dist/remote-node/client.d.ts +89 -9
- package/dist/remote-node/client.js +6 -1
- package/dist/remote-node/commands.d.ts +9 -0
- package/dist/remote-node/commands.js +96 -18
- package/dist/remote-node/connector.d.ts +12 -4
- package/dist/remote-node/connector.js +46 -25
- package/dist/remote-node/index.d.ts +2 -2
- package/dist/remote-node/index.js +2 -2
- package/dist/remote-node/reachability.d.ts +43 -1
- package/dist/remote-node/reachability.js +13 -3
- package/dist/remote-node/text.d.ts +2 -1
- package/dist/remote-node/text.js +74 -27
- package/dist/remote-node/tree/tree.js +21 -1
- package/dist/routine/client.d.ts +398 -0
- package/dist/routine/client.js +28 -0
- package/dist/routine/commands.d.ts +9 -0
- package/dist/routine/commands.js +109 -0
- package/dist/routine/index.d.ts +3 -0
- package/dist/routine/index.js +3 -0
- package/dist/routine/input.d.ts +28 -0
- package/dist/routine/input.js +44 -0
- package/dist/routine/output/format.d.ts +23 -0
- package/dist/routine/output/format.js +83 -0
- package/dist/routine/output/index.d.ts +2 -0
- package/dist/routine/output/index.js +2 -0
- package/dist/routine/tree/index.d.ts +2 -0
- package/dist/routine/tree/index.js +2 -0
- package/dist/routine/tree/tree.d.ts +3 -0
- package/dist/routine/tree/tree.js +70 -0
- package/dist/session/agent-permission.d.ts +2 -2
- package/dist/session/approval/commands.js +24 -6
- package/dist/session/approval/output/format.d.ts +11 -0
- package/dist/session/approval/output/format.js +8 -0
- package/dist/session/approval/output/index.d.ts +1 -1
- package/dist/session/approval/output/index.js +1 -1
- package/dist/session/attach-client.d.ts +1 -1
- package/dist/session/attach-client.js +12 -3
- package/dist/session/attach-render.js +15 -7
- package/dist/session/attach.js +17 -3
- package/dist/session/client.d.ts +4 -2
- package/dist/session/client.js +4 -15
- package/dist/session/commands.js +76 -9
- package/dist/session/create-tasks.js +29 -11
- package/dist/session/index.d.ts +1 -1
- package/dist/session/index.js +1 -0
- package/dist/session/interaction/output/format.js +2 -1
- package/dist/session/output/diff.js +3 -10
- package/dist/session/output/failure.js +3 -10
- package/dist/session/output/human.js +21 -10
- package/dist/session/output/index.d.ts +1 -1
- package/dist/session/output/index.js +1 -1
- package/dist/session/output/tasks.d.ts +16 -1
- package/dist/session/output/tasks.js +41 -27
- package/dist/session/tree/tree.js +56 -8
- package/dist/session/turn/client.d.ts +4 -1
- package/dist/session/turn/client.js +15 -2
- package/dist/session/turn/commands.d.ts +2 -0
- package/dist/session/turn/commands.js +38 -5
- package/dist/session/turn/index.d.ts +3 -3
- package/dist/session/turn/index.js +1 -1
- package/dist/session/turn/output.d.ts +7 -2
- package/dist/session/turn/output.js +36 -13
- package/dist/status/client.d.ts +7 -2
- package/dist/status/output/compact.d.ts +1 -0
- package/dist/status/output/compact.js +3 -0
- package/dist/status/output/human.d.ts +1 -1
- package/dist/status/output/human.js +71 -14
- package/dist/team-workspace/ceremony.d.ts +19 -0
- package/dist/team-workspace/ceremony.js +141 -0
- package/dist/team-workspace/client.d.ts +58 -0
- package/dist/team-workspace/client.js +6 -0
- package/dist/team-workspace/commands.d.ts +3 -0
- package/dist/team-workspace/commands.js +85 -0
- package/dist/team-workspace/confirmation.d.ts +4 -0
- package/dist/team-workspace/confirmation.js +8 -0
- package/dist/team-workspace/dependencies.d.ts +8 -0
- package/dist/team-workspace/dependencies.js +2 -0
- package/dist/team-workspace/index.d.ts +6 -0
- package/dist/team-workspace/index.js +5 -0
- package/dist/team-workspace/launcher.d.ts +17 -0
- package/dist/team-workspace/launcher.js +30 -0
- package/dist/team-workspace/output.d.ts +15 -0
- package/dist/team-workspace/output.js +28 -0
- package/dist/team-workspace/terminal.d.ts +9 -0
- package/dist/team-workspace/terminal.js +46 -0
- package/dist/terminal/client.d.ts +4 -0
- package/dist/terminal/client.js +3 -0
- package/dist/terminal/commands.js +37 -25
- package/dist/terminal/output/compact-list.d.ts +1 -0
- package/dist/terminal/output/compact-list.js +1 -0
- package/dist/terminal/output/human.d.ts +2 -19
- package/dist/terminal/output/human.js +6 -6
- package/dist/terminal/tree/tree.js +15 -15
- package/package.json +10 -8
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { formatMerged } from "../../address-space/index.js";
|
|
2
|
+
import { cell, formatRows, withNextPage } from "../../command-line/index.js";
|
|
3
|
+
export const isRoutineResult = (result) => result.command.startsWith("routine.");
|
|
4
|
+
const scheduleText = (routine) => `${routine.schedule.expression} ${routine.schedule.timezone}`;
|
|
5
|
+
const routineRow = (routine) => [
|
|
6
|
+
routine.id,
|
|
7
|
+
routine.state,
|
|
8
|
+
routine.nextFireAt ?? "-",
|
|
9
|
+
scheduleText(routine),
|
|
10
|
+
cell(routine.name),
|
|
11
|
+
].join("\t");
|
|
12
|
+
const causeText = ({ failure, failureReason }) => {
|
|
13
|
+
if (failure === undefined)
|
|
14
|
+
return failureReason ?? "-";
|
|
15
|
+
return failureReason === undefined
|
|
16
|
+
? `${failure.code}: ${cell(failure.message)}`
|
|
17
|
+
: `${failureReason} (${failure.code}): ${cell(failure.message)}`;
|
|
18
|
+
};
|
|
19
|
+
const fireRow = (fire) => [
|
|
20
|
+
fire.scheduledAt,
|
|
21
|
+
fire.triggerKind,
|
|
22
|
+
fire.outcome,
|
|
23
|
+
fire.reason ?? "-",
|
|
24
|
+
fire.sessionId ?? "-",
|
|
25
|
+
fire.turnState ?? "-",
|
|
26
|
+
String(fire.missed ?? 0),
|
|
27
|
+
causeText(fire),
|
|
28
|
+
].join("\t");
|
|
29
|
+
const formatShow = ({ fires, routine }) => [
|
|
30
|
+
`${routine.id}\t${routine.state}\trevision=${routine.revision}\t${cell(routine.name)}`,
|
|
31
|
+
`schedule\t${scheduleText(routine)}`,
|
|
32
|
+
`next\t${routine.nextFireAt ?? "-"}`,
|
|
33
|
+
`project\t${routine.template.projectId}`,
|
|
34
|
+
`prompt\t${cell(routine.template.prompt)}`,
|
|
35
|
+
formatRows(fires, fireRow, {
|
|
36
|
+
empty: "No fires yet.",
|
|
37
|
+
headers: [
|
|
38
|
+
"SCHEDULED",
|
|
39
|
+
"TRIGGER",
|
|
40
|
+
"OUTCOME",
|
|
41
|
+
"REASON",
|
|
42
|
+
"SESSION",
|
|
43
|
+
"TURN",
|
|
44
|
+
"MISSED",
|
|
45
|
+
"CAUSE",
|
|
46
|
+
],
|
|
47
|
+
}),
|
|
48
|
+
].join("\n");
|
|
49
|
+
const formatPreview = (result) => `${result.routineId}\t${result.expiresAt}\n${result.nextFires
|
|
50
|
+
.map((fire) => `next\t${fire}\n`)
|
|
51
|
+
.join("")}`;
|
|
52
|
+
const formatChangePreview = (result) => `${result.routineId}\t${result.expiresAt}\t${cell(result.name)}\n`;
|
|
53
|
+
const formatChanged = ({ delivery, receipt, routine }) => `${routine.id}\t${routine.state}\t${routine.revision}\t${receipt.receiptId}\t${delivery}\t${routine.nextFireAt ?? "-"}\n`;
|
|
54
|
+
const ROUTINE_HEADERS = ["ROUTINE", "STATE", "NEXT FIRE", "SCHEDULE", "NAME"];
|
|
55
|
+
export const formatRoutineList = ({ result }) => formatMerged(result, routineRow, {
|
|
56
|
+
empty: "No routines.",
|
|
57
|
+
headers: ROUTINE_HEADERS,
|
|
58
|
+
});
|
|
59
|
+
const formatRun = ({ delivery, fire, receipt, }) => `${fire.id}\t${fire.outcome}\t${fire.routineId}\t${receipt.receiptId}\t${delivery}\n`;
|
|
60
|
+
export const formatRoutineResult = ({ result }) => {
|
|
61
|
+
switch (result.method) {
|
|
62
|
+
case "routine.list":
|
|
63
|
+
return withNextPage(formatRows(result.items, routineRow, {
|
|
64
|
+
empty: "No routines.",
|
|
65
|
+
headers: ROUTINE_HEADERS,
|
|
66
|
+
}), result.nextCursor);
|
|
67
|
+
case "routine.show":
|
|
68
|
+
return formatShow(result);
|
|
69
|
+
case "routine.create.preview":
|
|
70
|
+
return formatPreview(result);
|
|
71
|
+
case "routine.disable.preview":
|
|
72
|
+
case "routine.run.preview":
|
|
73
|
+
return formatChangePreview(result);
|
|
74
|
+
case "routine.create.confirm":
|
|
75
|
+
case "routine.pause":
|
|
76
|
+
case "routine.resume":
|
|
77
|
+
case "routine.disable.confirm":
|
|
78
|
+
return formatChanged(result);
|
|
79
|
+
case "routine.run.confirm":
|
|
80
|
+
return formatRun(result);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
const routine = () => import("../index.js");
|
|
2
|
+
export const ROUTINE_TREE = {
|
|
3
|
+
groups: [["routine", "Cron-scheduled Sessions on exact Projects."]],
|
|
4
|
+
leaves: [
|
|
5
|
+
[
|
|
6
|
+
"routine create (--input-stdin --dry-run | --confirm-stdin)",
|
|
7
|
+
1,
|
|
8
|
+
["routine.create.preview", "routine.create.confirm"],
|
|
9
|
+
"Create a routine after a preview.",
|
|
10
|
+
{
|
|
11
|
+
example: "maia --json routine create --input-stdin --dry-run",
|
|
12
|
+
kind: "two-phase",
|
|
13
|
+
run: [routine, "runRoutineCreate"],
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
[
|
|
17
|
+
"routine list [--project <project-id>] [--state <active|paused|disabled>] [--limit <1..100>] [--after <cursor>]",
|
|
18
|
+
1,
|
|
19
|
+
"routine.list",
|
|
20
|
+
"List routines.",
|
|
21
|
+
{ route: "--project", run: [routine, "runRoutineList"] },
|
|
22
|
+
],
|
|
23
|
+
[
|
|
24
|
+
"routine show <routine-id>",
|
|
25
|
+
1,
|
|
26
|
+
"routine.show",
|
|
27
|
+
"Show a routine and its latest fires.",
|
|
28
|
+
{ route: "<routine-id>", run: [routine, "runRoutineShow"] },
|
|
29
|
+
],
|
|
30
|
+
[
|
|
31
|
+
"routine run <routine-id> --expected-revision <revision> [--command-id <id>] [--dry-run | --confirm-stdin]",
|
|
32
|
+
1,
|
|
33
|
+
["routine.run.preview", "routine.run.confirm"],
|
|
34
|
+
"Run a routine now, after a preview.",
|
|
35
|
+
{
|
|
36
|
+
example: "maia --json routine run <routine-id> --expected-revision 1 --dry-run",
|
|
37
|
+
kind: "two-phase",
|
|
38
|
+
route: "<routine-id>",
|
|
39
|
+
run: [routine, "runRoutineRun"],
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
[
|
|
43
|
+
"routine pause <routine-id> --expected-revision <revision> [--command-id <id>]",
|
|
44
|
+
1,
|
|
45
|
+
"routine.pause",
|
|
46
|
+
"Pause a routine; it fires no Session until resumed.",
|
|
47
|
+
{ route: "<routine-id>", run: [routine, "runRoutinePause"] },
|
|
48
|
+
],
|
|
49
|
+
[
|
|
50
|
+
"routine resume <routine-id> --expected-revision <revision> [--command-id <id>]",
|
|
51
|
+
1,
|
|
52
|
+
"routine.resume",
|
|
53
|
+
"Resume a paused routine from its next slot.",
|
|
54
|
+
{ route: "<routine-id>", run: [routine, "runRoutineResume"] },
|
|
55
|
+
],
|
|
56
|
+
[
|
|
57
|
+
"routine disable <routine-id> --expected-revision <revision> [--command-id <id>] [--dry-run | --confirm-stdin]",
|
|
58
|
+
1,
|
|
59
|
+
["routine.disable.preview", "routine.disable.confirm"],
|
|
60
|
+
"Disable a routine for good, after a preview.",
|
|
61
|
+
{
|
|
62
|
+
example: "maia --json routine disable <routine-id> --expected-revision 1 --dry-run",
|
|
63
|
+
kind: "two-phase",
|
|
64
|
+
route: "<routine-id>",
|
|
65
|
+
run: [routine, "runRoutineDisable"],
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
],
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=tree.js.map
|
|
@@ -18,7 +18,7 @@ export declare const makeAgentPermissionCliClient: (node: CliNodeOperations) =>
|
|
|
18
18
|
readonly commandId: string;
|
|
19
19
|
readonly grantedAt: string;
|
|
20
20
|
readonly inputDigest: string;
|
|
21
|
-
readonly operationIds: readonly ("approval.list" | "approval.respond" | "approval.show" | "connection.capacity.set" | "connection.create" | "connection.detect" | "connection.gateway.create" | "connection.list" | "connection.login.start" | "connection.models.list" | "connection.show" | "connection.state.set" | "connection.system.confirm" | "connection.system.preview" | "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.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" | "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" | "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.interrupt" | "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")[];
|
|
21
|
+
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")[];
|
|
22
22
|
readonly revision: "1";
|
|
23
23
|
};
|
|
24
24
|
readonly method: "session.agent-permission.confirm";
|
|
@@ -55,7 +55,7 @@ export declare const makeAgentPermissionCliClient: (node: CliNodeOperations) =>
|
|
|
55
55
|
readonly inputDigest: string;
|
|
56
56
|
readonly issuedAt: string;
|
|
57
57
|
readonly method: "session.agent-permission.preview";
|
|
58
|
-
readonly operationIds: readonly ("approval.list" | "approval.respond" | "approval.show" | "connection.capacity.set" | "connection.create" | "connection.detect" | "connection.gateway.create" | "connection.list" | "connection.login.start" | "connection.models.list" | "connection.show" | "connection.state.set" | "connection.system.confirm" | "connection.system.preview" | "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.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" | "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" | "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.interrupt" | "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")[];
|
|
58
|
+
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")[];
|
|
59
59
|
readonly proof: string;
|
|
60
60
|
}>;
|
|
61
61
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as Effect from "effect/Effect";
|
|
2
|
+
import { listEach, writeMerged } from "../../address-space/index.js";
|
|
2
3
|
import { CliArgumentError, parseOptions, reportError, requirePositionals, writeNodeResult, } from "../../command-line/index.js";
|
|
4
|
+
import { mergeLists } from "../../fleet/index.js";
|
|
3
5
|
import { commandIdentifier, } from "../../local-node/index.js";
|
|
4
|
-
import { describeApproval, formatApprovalResult, } from "./output/index.js";
|
|
6
|
+
import { describeApproval, formatApprovalResult, formatMergedApprovals, } from "./output/index.js";
|
|
5
7
|
const missing = (name) => Effect.die(new Error(`Missing approval client: ${name}.`));
|
|
6
8
|
const write = (context) => (result) => writeNodeResult(result, context, {
|
|
7
9
|
toResult: (value) => ({ command: value.method, result: value }),
|
|
@@ -14,18 +16,34 @@ const readLimit = (value) => {
|
|
|
14
16
|
throw new CliArgumentError("Option '--limit' must be an integer from 1 to 50.");
|
|
15
17
|
return Number(value);
|
|
16
18
|
};
|
|
19
|
+
const writeMergedApprovals = (context, answers) => {
|
|
20
|
+
const { items, nodes } = mergeLists(answers);
|
|
21
|
+
const pending = items.filter((item) => item.status === "pending");
|
|
22
|
+
const result = {
|
|
23
|
+
items: [...pending, ...items.filter((item) => item.status !== "pending")],
|
|
24
|
+
method: "approval.list",
|
|
25
|
+
nodes,
|
|
26
|
+
};
|
|
27
|
+
return writeMerged(context, { command: "approval.list", result }, formatMergedApprovals);
|
|
28
|
+
};
|
|
17
29
|
export const runApprovalList = (tokens, context) => {
|
|
18
30
|
const parsed = parseOptions(tokens, new Set(["--limit", "--session"]), new Set(["--all"]));
|
|
19
31
|
requirePositionals(parsed.positionals, 0);
|
|
20
32
|
const session = parsed.options.get("--session");
|
|
21
|
-
const
|
|
22
|
-
if (listApprovals === undefined)
|
|
23
|
-
return missing("list");
|
|
24
|
-
return Effect.map(listApprovals({
|
|
33
|
+
const input = {
|
|
25
34
|
limit: readLimit(parsed.options.get("--limit")),
|
|
26
35
|
...(parsed.flags.has("--all") ? { pendingOnly: false } : {}),
|
|
27
36
|
...(session === undefined ? {} : { sessionId: session }),
|
|
28
|
-
}
|
|
37
|
+
};
|
|
38
|
+
const read = (dependencies) => dependencies.listApprovals?.(input) ?? missing("list");
|
|
39
|
+
if (session !== undefined)
|
|
40
|
+
return Effect.map(read(context.dependencies), write(context));
|
|
41
|
+
return listEach(context, {
|
|
42
|
+
merged: (answers) => writeMergedApprovals(context, answers),
|
|
43
|
+
paged: false,
|
|
44
|
+
read,
|
|
45
|
+
sole: write(context),
|
|
46
|
+
});
|
|
29
47
|
};
|
|
30
48
|
export const runApprovalShow = (tokens, context) => {
|
|
31
49
|
const rest = tokens;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Approval, ApprovalListResult, ApprovalRespondResult, ApprovalShowResult } from "@maiaos/sdk";
|
|
2
|
+
import type { ListedNode } from "../../../fleet/index.js";
|
|
2
3
|
export type ApprovalCliResult = ApprovalListResult | ApprovalRespondResult | ApprovalShowResult;
|
|
3
4
|
export type CliApprovalResult = {
|
|
4
5
|
readonly command: ApprovalCliResult["method"];
|
|
@@ -8,5 +9,15 @@ export declare const isApprovalResult: (result: {
|
|
|
8
9
|
readonly command: string;
|
|
9
10
|
}) => result is CliApprovalResult;
|
|
10
11
|
export declare const describeApproval: (approval: Approval) => string;
|
|
12
|
+
export type CliMergedApprovals = {
|
|
13
|
+
readonly items: readonly (Approval & {
|
|
14
|
+
readonly node: string;
|
|
15
|
+
})[];
|
|
16
|
+
readonly method: "approval.list";
|
|
17
|
+
readonly nodes: readonly ListedNode[];
|
|
18
|
+
};
|
|
19
|
+
export declare const formatMergedApprovals: ({ result, }: {
|
|
20
|
+
readonly result: CliMergedApprovals;
|
|
21
|
+
}) => string;
|
|
11
22
|
export declare const formatApprovalResult: ({ result }: CliApprovalResult) => string;
|
|
12
23
|
//# sourceMappingURL=format.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { nodeLines } from "../../../address-space/index.js";
|
|
1
2
|
export const isApprovalResult = (result) => result.command.startsWith("approval.");
|
|
2
3
|
const indent = (text) => text
|
|
3
4
|
.split("\n")
|
|
@@ -17,6 +18,13 @@ export const describeApproval = (approval) => [
|
|
|
17
18
|
const formatList = (result) => result.items.length === 0
|
|
18
19
|
? "No worker waits on a person.\n"
|
|
19
20
|
: `${result.items.map(describeApproval).join("\n")}\n`;
|
|
21
|
+
export const formatMergedApprovals = ({ result, }) => `${formatList({
|
|
22
|
+
items: result.items.map((item) => ({
|
|
23
|
+
...item,
|
|
24
|
+
approvalId: `${item.node}\t${item.approvalId}`,
|
|
25
|
+
})),
|
|
26
|
+
method: "approval.list",
|
|
27
|
+
})}${nodeLines(result.nodes)}`;
|
|
20
28
|
export const formatApprovalResult = ({ result }) => {
|
|
21
29
|
if (result.method === "approval.list")
|
|
22
30
|
return formatList(result);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { type ApprovalCliResult, type CliApprovalResult, describeApproval, formatApprovalResult, isApprovalResult, } from "./format.js";
|
|
1
|
+
export { type ApprovalCliResult, type CliApprovalResult, type CliMergedApprovals, describeApproval, formatApprovalResult, formatMergedApprovals, isApprovalResult, } from "./format.js";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { describeApproval, formatApprovalResult, isApprovalResult, } from "./format.js";
|
|
1
|
+
export { describeApproval, formatApprovalResult, formatMergedApprovals, isApprovalResult, } from "./format.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SessionAttachFrame } from "@maiaos/sdk";
|
|
2
2
|
import type * as Crypto from "effect/Crypto";
|
|
3
3
|
import type * as Stream from "effect/Stream";
|
|
4
|
-
import type
|
|
4
|
+
import { type CliNodeEffect, type CliNodeOperations } from "../local-node/index.js";
|
|
5
5
|
export type AttachSessionInput = {
|
|
6
6
|
readonly after?: {
|
|
7
7
|
readonly epoch: string;
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import * as Effect from "effect/Effect";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { newCliIdentifier, } from "../local-node/index.js";
|
|
3
|
+
const attachOverBridge = ({ attachSession }, input) => attachSession === undefined
|
|
4
|
+
? Effect.fail(new Error("This Node connection carries no Session stream."))
|
|
5
|
+
: Effect.map(newCliIdentifier("request"), (messageId) => attachSession({
|
|
4
6
|
...(input.after === undefined ? {} : { after: input.after }),
|
|
5
7
|
sessionId: input.sessionId,
|
|
6
|
-
},
|
|
8
|
+
}, { messageId }));
|
|
9
|
+
export const makeAttachClient = (node) => ({
|
|
10
|
+
attachSession: (input) => node.remote
|
|
11
|
+
? node.runConnectionOperation((connection) => attachOverBridge(connection, input))
|
|
12
|
+
: node.runDiscoveryOperation((options) => Effect.promise(() => import("@maiaos/sdk/node/effect")).pipe(Effect.map((sdk) => sdk.attachSessionEffect({
|
|
13
|
+
...(input.after === undefined ? {} : { after: input.after }),
|
|
14
|
+
sessionId: input.sessionId,
|
|
15
|
+
}, options)))),
|
|
7
16
|
});
|
|
8
17
|
//# sourceMappingURL=attach-client.js.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isNewSessionRecord, reduceSessionAttach, sessionItemText, } from "@maiaos/sdk";
|
|
2
|
+
import { block, cell } from "../command-line/index.js";
|
|
2
3
|
import { formatFailureCell } from "./output/index.js";
|
|
3
4
|
const MAX_ARGUMENTS_SHOWN = 200;
|
|
4
5
|
const header = (item) => {
|
|
@@ -8,9 +9,9 @@ const header = (item) => {
|
|
|
8
9
|
case "reasoning":
|
|
9
10
|
return "thinking> ";
|
|
10
11
|
case "command":
|
|
11
|
-
return `$ ${item.command}\n`;
|
|
12
|
+
return `$ ${cell(item.command)}\n`;
|
|
12
13
|
case "tool_call":
|
|
13
|
-
return `tool ${item.name} ${(item.arguments ?? "").slice(0, MAX_ARGUMENTS_SHOWN)}\n`;
|
|
14
|
+
return `tool ${cell(`${item.name} ${(item.arguments ?? "").slice(0, MAX_ARGUMENTS_SHOWN)}`)}\n`;
|
|
14
15
|
case "approval_request":
|
|
15
16
|
return item.approvalId === undefined
|
|
16
17
|
? "approval? "
|
|
@@ -28,7 +29,7 @@ const footer = (record) => {
|
|
|
28
29
|
if (item.kind === "command" && item.exitCode !== undefined)
|
|
29
30
|
return `[exit ${String(item.exitCode)}]\n${status}`;
|
|
30
31
|
if (item.kind === "file_change")
|
|
31
|
-
return `${item.changes.map((change) => `${change.change} ${change.path}\n`).join("")}${status}`;
|
|
32
|
+
return `${item.changes.map((change) => `${change.change} ${cell(change.path)}\n`).join("")}${status}`;
|
|
32
33
|
if (item.kind === "usage")
|
|
33
34
|
return `tokens: ${String(item.inputTokens)} in (${String(item.cachedInputTokens)} cached), ${String(item.outputTokens)} out${item.modelCallCount === undefined ? "" : `, ${String(item.modelCallCount)} model call${item.modelCallCount === 1 ? "" : "s"}`}\n`;
|
|
34
35
|
return status;
|
|
@@ -39,6 +40,13 @@ const emit = (rendered, text) => text.length === 0
|
|
|
39
40
|
state: { ...rendered.state, lineOpen: !text.endsWith("\n") },
|
|
40
41
|
text: `${rendered.text}${text}`,
|
|
41
42
|
};
|
|
43
|
+
const INDENT = " ";
|
|
44
|
+
const emitBody = (rendered, text) => emit(rendered, text
|
|
45
|
+
.split("\n")
|
|
46
|
+
.map((line, index) => line.length > 0 && (index > 0 || !rendered.state.lineOpen)
|
|
47
|
+
? `${INDENT}${line}`
|
|
48
|
+
: line)
|
|
49
|
+
.join("\n"));
|
|
42
50
|
const closeLine = (rendered) => {
|
|
43
51
|
const closed = rendered.state.lineOpen ? emit(rendered, "\n") : rendered;
|
|
44
52
|
return { ...closed, state: { ...closed.state, openItem: undefined } };
|
|
@@ -64,11 +72,11 @@ const writeItemText = (rendered, itemId, { cut = false, text }) => {
|
|
|
64
72
|
if (cut && !extendsShown) {
|
|
65
73
|
const positioned = onItemLine(rendered, itemId);
|
|
66
74
|
const separator = positioned.state.lineOpen ? "\n" : "";
|
|
67
|
-
return withShown(emit(positioned, `${separator}
|
|
75
|
+
return withShown(emitBody(emit(positioned, `${separator}…`), text), itemId, text);
|
|
68
76
|
}
|
|
69
77
|
if (!extendsShown || text.length === shown.length)
|
|
70
78
|
return rendered;
|
|
71
|
-
return withShown(
|
|
79
|
+
return withShown(emitBody(onItemLine(rendered, itemId), text.slice(shown.length)), itemId, text);
|
|
72
80
|
};
|
|
73
81
|
const renderStarted = (rendered, record) => {
|
|
74
82
|
const opened = emit(closeLine(rendered), header(record.item));
|
|
@@ -85,7 +93,7 @@ const renderDelta = (rendered, record) => {
|
|
|
85
93
|
const shown = rendered.state.written.get(record.itemId);
|
|
86
94
|
if (shown === undefined)
|
|
87
95
|
return rendered;
|
|
88
|
-
const appended =
|
|
96
|
+
const appended = emitBody(onItemLine(rendered, record.itemId), record.delta);
|
|
89
97
|
return {
|
|
90
98
|
...appended,
|
|
91
99
|
state: {
|
|
@@ -147,7 +155,7 @@ export const renderSessionAttachFrame = (state, frame) => {
|
|
|
147
155
|
const rendered = renderFrameText(state, frame);
|
|
148
156
|
return {
|
|
149
157
|
state: { ...rendered.state, view: reduceSessionAttach(state.view, frame) },
|
|
150
|
-
text: rendered.text,
|
|
158
|
+
text: block(rendered.text),
|
|
151
159
|
};
|
|
152
160
|
};
|
|
153
161
|
export const finishSessionAttachRender = (state) => state.lineOpen ? "\n" : "";
|
package/dist/session/attach.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { initialSessionAttachView, sessionAttachCursor, } from "@maiaos/sdk";
|
|
1
|
+
import { initialSessionAttachView, protocolErrorSchema, sessionAttachCursor, } from "@maiaos/sdk";
|
|
2
2
|
import * as Duration from "effect/Duration";
|
|
3
3
|
import * as Effect from "effect/Effect";
|
|
4
4
|
import * as Ref from "effect/Ref";
|
|
5
5
|
import * as Stream from "effect/Stream";
|
|
6
|
-
import { CliArgumentError, parseOptions, reportError, requirePositionals, } from "../command-line/index.js";
|
|
6
|
+
import { CliArgumentError, jsonLine, parseOptions, reportError, requirePositionals, } from "../command-line/index.js";
|
|
7
7
|
import { finishSessionAttachRender, initialAttachRenderState, renderSessionAttachFrame, } from "./attach-render.js";
|
|
8
8
|
const MAX_IDLE_REATTACHES = 5;
|
|
9
9
|
const REATTACH_BACKOFF = Duration.millis(100);
|
|
@@ -31,10 +31,21 @@ const writeFrame = (attachment, frame) => Ref.modify(attachment.state, (state) =
|
|
|
31
31
|
}).pipe(Effect.map((text) => {
|
|
32
32
|
const { io, json } = attachment.context;
|
|
33
33
|
if (json)
|
|
34
|
-
io.stdout(
|
|
34
|
+
io.stdout(jsonLine(frame));
|
|
35
35
|
else if (text.length > 0)
|
|
36
36
|
io.stdout(text);
|
|
37
37
|
}));
|
|
38
|
+
const finalFailure = (failure) => {
|
|
39
|
+
if (!(failure instanceof Error) || !("code" in failure))
|
|
40
|
+
return undefined;
|
|
41
|
+
const remote = protocolErrorSchema.safeParse("remoteError" in failure ? failure.remoteError : undefined);
|
|
42
|
+
if (remote.success)
|
|
43
|
+
return remote.data;
|
|
44
|
+
return failure.code === "transport_failure" ||
|
|
45
|
+
typeof failure.code !== "string"
|
|
46
|
+
? undefined
|
|
47
|
+
: { code: failure.code, message: failure.message, retryable: false };
|
|
48
|
+
};
|
|
38
49
|
const framesOf = (attachment, stream) => attachment.follow
|
|
39
50
|
? stream
|
|
40
51
|
: stream.pipe(Stream.takeUntil((frame) => frame.kind === "synchronized"));
|
|
@@ -64,6 +75,9 @@ const attachOnce = (attachment) => Effect.gen(function* () {
|
|
|
64
75
|
if (!opened.ok)
|
|
65
76
|
return { error: opened.error, kind: "failed" };
|
|
66
77
|
const ran = yield* Effect.result(Stream.runForEach(framesOf(attachment, opened.value), (frame) => writeFrame(attachment, frame)));
|
|
78
|
+
const refusal = ran._tag === "Failure" ? finalFailure(ran.failure) : undefined;
|
|
79
|
+
if (refusal !== undefined)
|
|
80
|
+
return { error: refusal, kind: "failed" };
|
|
67
81
|
return yield* outcomeOf(attachment, ran._tag === "Success");
|
|
68
82
|
});
|
|
69
83
|
const finish = (attachment, outcome) => Ref.get(attachment.state).pipe(Effect.map((state) => {
|
package/dist/session/client.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { Session, SessionCreateParameters, SessionCreateResult, SessionCreationInput, SessionCreationOutcome, SessionCreationPlan, SessionEventsListResult, SessionInboxAckResult, SessionInboxCheckResult, SessionListParameters, SessionListResult, SessionMessageSendResult, SessionObserveResult, SessionResumeResult, SessionShowResult, SessionSpawnResult, SessionStartResult, SessionStopResult } from "@maiaos/sdk";
|
|
2
2
|
import { type CliNodeEffect, type CliNodeOperations } from "../local-node/index.js";
|
|
3
3
|
export type CreateSessionInput = {
|
|
4
|
+
readonly agentId?: SessionCreateParameters["agentId"];
|
|
4
5
|
readonly baseRef?: string;
|
|
5
6
|
readonly commandId?: string;
|
|
6
7
|
readonly connectionId?: string;
|
|
7
8
|
readonly definitionRef?: SessionCreateParameters["definitionRef"];
|
|
9
|
+
readonly effort?: SessionCreateParameters["effort"];
|
|
8
10
|
readonly executor?: SessionCreateParameters["executor"];
|
|
9
11
|
readonly model?: string;
|
|
10
12
|
readonly role?: SessionCreateParameters["role"];
|
|
@@ -57,7 +59,7 @@ export declare const makeSessionClient: (node: CliNodeOperations) => {
|
|
|
57
59
|
readonly commandId: string;
|
|
58
60
|
readonly grantedAt: string;
|
|
59
61
|
readonly inputDigest: string;
|
|
60
|
-
readonly operationIds: readonly ("approval.list" | "approval.respond" | "approval.show" | "connection.capacity.set" | "connection.create" | "connection.detect" | "connection.gateway.create" | "connection.list" | "connection.login.start" | "connection.models.list" | "connection.show" | "connection.state.set" | "connection.system.confirm" | "connection.system.preview" | "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.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" | "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" | "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.interrupt" | "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")[];
|
|
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")[];
|
|
61
63
|
readonly revision: "1";
|
|
62
64
|
};
|
|
63
65
|
readonly method: "session.agent-permission.confirm";
|
|
@@ -94,7 +96,7 @@ export declare const makeSessionClient: (node: CliNodeOperations) => {
|
|
|
94
96
|
readonly inputDigest: string;
|
|
95
97
|
readonly issuedAt: string;
|
|
96
98
|
readonly method: "session.agent-permission.preview";
|
|
97
|
-
readonly operationIds: readonly ("approval.list" | "approval.respond" | "approval.show" | "connection.capacity.set" | "connection.create" | "connection.detect" | "connection.gateway.create" | "connection.list" | "connection.login.start" | "connection.models.list" | "connection.show" | "connection.state.set" | "connection.system.confirm" | "connection.system.preview" | "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.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" | "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" | "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.interrupt" | "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")[];
|
|
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")[];
|
|
98
100
|
readonly proof: string;
|
|
99
101
|
}>;
|
|
100
102
|
attachSession: (input: import("./attach-client.js").AttachSessionInput) => CliNodeEffect<import("./attach-client.js").SessionAttachStream>;
|
package/dist/session/client.js
CHANGED
|
@@ -8,24 +8,13 @@ import { makeAttachClient } from "./attach-client.js";
|
|
|
8
8
|
import { makeCodingSessionClient } from "./coding-client.js";
|
|
9
9
|
export const makeSessionClient = (node) => {
|
|
10
10
|
const createSession = (input) => {
|
|
11
|
-
|
|
11
|
+
const { baseRef, commandId: requestedCommandId, ...selection } = input;
|
|
12
|
+
return Effect.flatMap(commandIdentifier(requestedCommandId), (commandId) => {
|
|
12
13
|
return node.runValidatedNodeOperation({
|
|
14
|
+
...selection,
|
|
13
15
|
commandId,
|
|
14
|
-
...(input.connectionId === undefined
|
|
15
|
-
? {}
|
|
16
|
-
: { connectionId: input.connectionId }),
|
|
17
16
|
expectedRevision: "0",
|
|
18
|
-
...(
|
|
19
|
-
? {}
|
|
20
|
-
: { definitionRef: input.definitionRef }),
|
|
21
|
-
...(input.executor === undefined ? {} : { executor: input.executor }),
|
|
22
|
-
...(input.model === undefined ? {} : { model: input.model }),
|
|
23
|
-
...(input.role === undefined ? {} : { role: input.role }),
|
|
24
|
-
...(input.title === undefined ? {} : { title: input.title }),
|
|
25
|
-
workspaceId: input.workspaceId,
|
|
26
|
-
...(input.baseRef === undefined
|
|
27
|
-
? {}
|
|
28
|
-
: { worktree: { baseRef: input.baseRef } }),
|
|
17
|
+
...(baseRef === undefined ? {} : { worktree: { baseRef } }),
|
|
29
18
|
}, sessionCreateParametersSchema, (client, parameters, options) => client.createSession(parameters, options), { commandId });
|
|
30
19
|
});
|
|
31
20
|
};
|