@maiaos/cli 0.1.0-canary.80 → 0.1.0-canary.82
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/dist/bin/maia.cdx.json +24 -24
- package/dist/bin/maia.mjs +1 -1
- package/dist/cli/cli.js +4 -0
- package/dist/command-line/context.d.ts +6 -2
- package/dist/local-node/client.d.ts +1 -0
- package/dist/local-node/client.js +4 -2
- package/dist/local-node/index.d.ts +1 -1
- package/dist/local-node/index.js +1 -1
- package/dist/local-node/launch/index.d.ts +2 -0
- package/dist/local-node/launch/index.js +2 -0
- package/dist/local-node/launch/launch.d.ts +19 -0
- package/dist/local-node/launch/launch.js +49 -0
- package/dist/mcp/routing.js +1 -0
- package/dist/reference/resolve.js +2 -1
- package/dist/remote-node/commands.d.ts +1 -0
- package/dist/remote-node/commands.js +29 -2
- package/dist/remote-node/index.d.ts +1 -1
- package/dist/remote-node/index.js +1 -1
- package/dist/remote-node/lifecycle.js +66 -0
- package/dist/remote-node/tree/tree.js +12 -0
- package/dist/session/agent-permission.d.ts +2 -2
- package/dist/session/attach-render.js +6 -0
- package/dist/session/client.d.ts +3 -2
- package/dist/session/commands.d.ts +1 -0
- package/dist/session/commands.js +55 -10
- package/dist/session/create-tasks.js +15 -5
- package/dist/session/index.d.ts +1 -1
- package/dist/session/index.js +1 -1
- package/dist/session/tree/tree.js +60 -4
- package/dist/session/turn/client.d.ts +7 -1
- package/dist/session/turn/client.js +15 -1
- package/dist/session/turn/commands.d.ts +3 -0
- package/dist/session/turn/commands.js +52 -8
- package/dist/session/turn/index.d.ts +2 -2
- package/dist/session/turn/index.js +1 -1
- package/dist/session/turn/output.d.ts +6 -4
- package/dist/session/turn/output.js +7 -0
- package/guidance/maia-sessions/SKILL.md +7 -0
- package/package.json +4 -4
|
@@ -13,7 +13,7 @@ const TURN_SEND_OPTIONS = {
|
|
|
13
13
|
"--expected-revision",
|
|
14
14
|
"--session",
|
|
15
15
|
]),
|
|
16
|
-
allowedFlags: new Set(["--prompt-stdin", "--wait"]),
|
|
16
|
+
allowedFlags: new Set(["--now", "--prompt-stdin", "--queue", "--wait"]),
|
|
17
17
|
repeatable: new Set(["--attach"]),
|
|
18
18
|
};
|
|
19
19
|
const parseTurnSendArguments = (tokens) => {
|
|
@@ -26,10 +26,15 @@ const parseTurnSendArguments = (tokens) => {
|
|
|
26
26
|
if (!parsed.flags.has("--prompt-stdin")) {
|
|
27
27
|
throw new CliArgumentError("Option '--prompt-stdin' is required.");
|
|
28
28
|
}
|
|
29
|
+
const now = parsed.flags.has("--now");
|
|
30
|
+
if (now && parsed.flags.has("--queue")) {
|
|
31
|
+
throw new CliArgumentError("Options '--now' and '--queue' cannot be used together.");
|
|
32
|
+
}
|
|
29
33
|
const commandId = parsed.options.get("--command-id");
|
|
30
34
|
const expectedRevision = readOptionalRevision(parsed.options);
|
|
31
35
|
return {
|
|
32
36
|
attach: parsed.options.get("--attach")?.split(",") ?? [],
|
|
37
|
+
now,
|
|
33
38
|
sessionId,
|
|
34
39
|
wait: parsed.flags.has("--wait"),
|
|
35
40
|
...(commandId === undefined ? {} : { commandId }),
|
|
@@ -85,12 +90,13 @@ const sendAtRevision = (context, input, { attachments, prompt, }) => {
|
|
|
85
90
|
...(input.commandId === undefined
|
|
86
91
|
? {}
|
|
87
92
|
: { commandId: input.commandId }),
|
|
93
|
+
...(input.now ? { delivery: "now" } : {}),
|
|
88
94
|
expectedRevision,
|
|
89
95
|
prompt,
|
|
90
96
|
sessionId: input.sessionId,
|
|
91
97
|
}),
|
|
92
98
|
read: () => showSession(input.sessionId),
|
|
93
|
-
retry: `session turn send --session ${input.sessionId} --prompt-stdin`,
|
|
99
|
+
retry: `session turn send --session ${input.sessionId} --prompt-stdin${input.now ? " --now" : ""}`,
|
|
94
100
|
revisionOf: ({ session }) => ({ ok: true, value: session.revision }),
|
|
95
101
|
});
|
|
96
102
|
};
|
|
@@ -114,13 +120,15 @@ export const runTurnSend = (tokens, context) => Effect.gen(function* () {
|
|
|
114
120
|
});
|
|
115
121
|
return yield* waitForSentTurn(context, sent.value);
|
|
116
122
|
});
|
|
117
|
-
const parseTurnMutationArguments = (tokens, revisionOption) => {
|
|
118
|
-
const parsed = parseOptions(tokens, new Set(["--command-id", revisionOption]));
|
|
123
|
+
const parseTurnMutationArguments = (tokens, revisionOption, readsPrompt = false) => {
|
|
124
|
+
const parsed = parseOptions(tokens, new Set(["--command-id", revisionOption]), new Set(readsPrompt ? ["--prompt-stdin"] : []));
|
|
119
125
|
requirePositionals(parsed.positionals, 1);
|
|
120
126
|
const [turnId] = parsed.positionals;
|
|
121
127
|
if (turnId === undefined) {
|
|
122
128
|
throw new CliArgumentError("The turn identifier is missing.");
|
|
123
129
|
}
|
|
130
|
+
if (readsPrompt && !parsed.flags.has("--prompt-stdin"))
|
|
131
|
+
throw new CliArgumentError("Option '--prompt-stdin' is required.");
|
|
124
132
|
const commandId = parsed.options.get("--command-id");
|
|
125
133
|
return {
|
|
126
134
|
expectedRevision: readRevisionOption(parsed.options.get(revisionOption), revisionOption),
|
|
@@ -153,10 +161,36 @@ export const runTurnCancel = (tokens, context) => Effect.gen(function* () {
|
|
|
153
161
|
toText: formatTurnMutation,
|
|
154
162
|
});
|
|
155
163
|
});
|
|
156
|
-
export const
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
|
|
164
|
+
export const runTurnQueuePromote = (tokens, context) => Effect.gen(function* () {
|
|
165
|
+
const input = parseTurnMutationArguments(tokens, "--expected-turn-revision");
|
|
166
|
+
const { promoteQueuedTurn } = context.dependencies;
|
|
167
|
+
if (promoteQueuedTurn === undefined)
|
|
168
|
+
throw new CliArgumentError("Turn promote is unavailable.");
|
|
169
|
+
const result = yield* promoteQueuedTurn(input);
|
|
170
|
+
return writeNodeResult(result, context, {
|
|
171
|
+
toResult: (value) => ({
|
|
172
|
+
command: "turn.queue.promote",
|
|
173
|
+
result: { ...summarizeTurnMutation(value), outcome: value.outcome },
|
|
174
|
+
}),
|
|
175
|
+
toText: formatTurnMutation,
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
export const runTurnQueueEdit = (tokens, context) => Effect.gen(function* () {
|
|
179
|
+
const edit = parseTurnMutationArguments(tokens, "--expected-turn-revision", true);
|
|
180
|
+
const { editQueuedTurn } = context.dependencies;
|
|
181
|
+
if (editQueuedTurn === undefined)
|
|
182
|
+
throw new CliArgumentError("Turn edit is unavailable.");
|
|
183
|
+
const prompt = yield* readTurnPrompt(context);
|
|
184
|
+
const result = yield* editQueuedTurn({ ...edit, prompt });
|
|
185
|
+
return writeNodeResult(result, context, {
|
|
186
|
+
toResult: (value) => ({
|
|
187
|
+
command: "turn.queue.edit",
|
|
188
|
+
result: summarizeTurnMutation(value),
|
|
189
|
+
}),
|
|
190
|
+
toText: formatTurnMutation,
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
const showTurnQueue = (sessionId, context) => Effect.gen(function* () {
|
|
160
194
|
if (sessionId === undefined) {
|
|
161
195
|
throw new CliArgumentError("The Session identifier is missing.");
|
|
162
196
|
}
|
|
@@ -172,6 +206,16 @@ export const runTurnQueue = (tokens, context) => Effect.gen(function* () {
|
|
|
172
206
|
toText: formatTurnQueue,
|
|
173
207
|
});
|
|
174
208
|
});
|
|
209
|
+
export const runTurnQueue = (tokens, context) => {
|
|
210
|
+
const parsed = parseOptions(tokens, new Set());
|
|
211
|
+
requirePositionals(parsed.positionals, 1);
|
|
212
|
+
return showTurnQueue(parsed.positionals[0], context);
|
|
213
|
+
};
|
|
214
|
+
export const runTurnQueueList = (tokens, context) => {
|
|
215
|
+
const parsed = parseOptions(tokens, new Set(["--session"]));
|
|
216
|
+
requirePositionals(parsed.positionals, 0);
|
|
217
|
+
return showTurnQueue(parsed.options.get("--session"), context);
|
|
218
|
+
};
|
|
175
219
|
export const runTurnAttachments = (tokens, context) => Effect.gen(function* () {
|
|
176
220
|
const parsed = parseOptions(tokens, new Set());
|
|
177
221
|
requirePositionals(parsed.positionals, 1);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { type CancelTurnInput, type InterruptTurnInput, makeTurnClient, type SendTurnInput, type WaitTurnsInput, } from "./client.js";
|
|
2
|
-
export { runTurnAttachments, runTurnCancel, runTurnInterrupt, runTurnQueue, runTurnSend, runTurnShow, runTurnSteer, runTurnWait, } from "./commands.js";
|
|
1
|
+
export { type CancelTurnInput, type EditTurnInput, type InterruptTurnInput, makeTurnClient, type SendTurnInput, type WaitTurnsInput, } from "./client.js";
|
|
2
|
+
export { runTurnAttachments, runTurnCancel, runTurnInterrupt, runTurnQueue, runTurnQueueEdit, runTurnQueueList, runTurnQueuePromote, runTurnSend, runTurnShow, runTurnSteer, runTurnWait, } from "./commands.js";
|
|
3
3
|
export { type CliTurnAttachments, type CliTurnMutation, type CliTurnQueue, type CliTurnShow, type CliTurnSteer, type CliTurnSteerPreview, type CliTurnWait, } from "./output.js";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { makeTurnClient, } from "./client.js";
|
|
2
|
-
export { runTurnAttachments, runTurnCancel, runTurnInterrupt, runTurnQueue, runTurnSend, runTurnShow, runTurnSteer, runTurnWait, } from "./commands.js";
|
|
2
|
+
export { runTurnAttachments, runTurnCancel, runTurnInterrupt, runTurnQueue, runTurnQueueEdit, runTurnQueueList, runTurnQueuePromote, runTurnSend, runTurnShow, runTurnSteer, runTurnWait, } from "./commands.js";
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import type { FailureDetail, LocalNodeCallResult, TurnAttachmentPolicyResult, TurnCancelResult, TurnInterruptResult, TurnQueueListResult, TurnSendResult, TurnShowResult, TurnTokenUsage, TurnWaitResult } from "@maiaos/sdk";
|
|
1
|
+
import type { FailureDetail, LocalNodeCallResult, TurnAttachmentPolicyResult, TurnCancelResult, TurnInterruptResult, TurnQueueEditResult, TurnQueueListResult, TurnQueuePromoteResult, TurnSendResult, TurnShowResult, TurnTokenUsage, TurnWaitResult } from "@maiaos/sdk";
|
|
2
2
|
type SteerPreview = LocalNodeCallResult<"turn.steer.preview">;
|
|
3
3
|
type SteerConfirmed = LocalNodeCallResult<"turn.steer.confirm">;
|
|
4
4
|
export type CliTurnMutation = {
|
|
5
|
-
readonly command: "turn.cancel" | "turn.interrupt" | "turn.send";
|
|
5
|
+
readonly command: "turn.cancel" | "turn.interrupt" | "turn.queue.edit" | "turn.queue.promote" | "turn.send";
|
|
6
6
|
readonly result: {
|
|
7
7
|
readonly delivery: TurnInterruptResult["delivery"];
|
|
8
|
-
readonly outcome?: TurnCancelResult["outcome"];
|
|
8
|
+
readonly outcome?: TurnCancelResult["outcome"] | TurnQueuePromoteResult["outcome"];
|
|
9
|
+
readonly path?: TurnSendResult["path"];
|
|
9
10
|
readonly receipt: TurnInterruptResult["receipt"];
|
|
10
11
|
readonly revision: string;
|
|
11
12
|
readonly sessionId: string;
|
|
13
|
+
readonly sourceTurnId?: string;
|
|
12
14
|
readonly state: TurnInterruptResult["turn"]["state"];
|
|
13
15
|
readonly turnId: string;
|
|
14
16
|
readonly wait?: TurnWaitResult;
|
|
15
17
|
};
|
|
16
18
|
};
|
|
17
|
-
export declare const summarizeTurnMutation: (result: SteerConfirmed | TurnCancelResult | TurnInterruptResult | TurnSendResult) => CliTurnMutation["result"];
|
|
19
|
+
export declare const summarizeTurnMutation: (result: SteerConfirmed | TurnCancelResult | TurnInterruptResult | TurnQueueEditResult | TurnQueuePromoteResult | TurnSendResult) => CliTurnMutation["result"];
|
|
18
20
|
export type CliTurnSteerPreview = {
|
|
19
21
|
readonly command: "turn.steer.preview";
|
|
20
22
|
readonly result: SteerPreview;
|
|
@@ -7,6 +7,11 @@ export const summarizeTurnMutation = (result) => ({
|
|
|
7
7
|
sessionId: result.turn.sessionId,
|
|
8
8
|
state: result.turn.state,
|
|
9
9
|
turnId: result.turn.id,
|
|
10
|
+
...("sourceTurnId" in result &&
|
|
11
|
+
result.path !== undefined &&
|
|
12
|
+
result.sourceTurnId !== undefined
|
|
13
|
+
? { path: result.path, sourceTurnId: result.sourceTurnId }
|
|
14
|
+
: {}),
|
|
10
15
|
});
|
|
11
16
|
export const formatTurnAttachments = ({ result }) => fields([
|
|
12
17
|
["session", result.sessionId],
|
|
@@ -19,6 +24,8 @@ export const formatTurnMutation = ({ result }) => fields([
|
|
|
19
24
|
["outcome", result.outcome],
|
|
20
25
|
["state", result.state],
|
|
21
26
|
["revision", result.revision],
|
|
27
|
+
["path", result.path],
|
|
28
|
+
["source", result.sourceTurnId],
|
|
22
29
|
]);
|
|
23
30
|
export const formatTurnSteer = ({ result }) => fields([
|
|
24
31
|
["turn", result.turnId],
|
|
@@ -54,6 +54,7 @@ These work from a source build only. Use them when the caller accepts that.
|
|
|
54
54
|
|
|
55
55
|
```sh
|
|
56
56
|
maia --json session placement show --harness <executor-id>
|
|
57
|
+
maia --json session defaults show --project <project-id>
|
|
57
58
|
maia --json session spawn <session-id> --harness <executor-id> --workspace <workspace-id> --to-node <name> --yes
|
|
58
59
|
maia --json session stop <session-id> --expected-revision <revision> --children
|
|
59
60
|
maia --json session reconcile <session-id>
|
|
@@ -66,6 +67,12 @@ maia --json session approval list --session <session-id>
|
|
|
66
67
|
Send prompt text on stdin with `--prompt-stdin`, never on the command line.
|
|
67
68
|
Exit code 74 means a wait reached its deadline.
|
|
68
69
|
|
|
70
|
+
A create with a first message that names no harness, account or agent takes
|
|
71
|
+
your last Session's harness, account, model and effort in the Project;
|
|
72
|
+
`session defaults show` prints them. A named option wins. `error.code`
|
|
73
|
+
`session_default_stale` means that account no longer takes Sessions: name
|
|
74
|
+
`--harness` or `--connection`.
|
|
75
|
+
|
|
69
76
|
`session placement show` asks every Node (or the one `--node` names) whether it
|
|
70
77
|
can take a Session of an executor: `ready`, `login`, `reason` and capacity. A
|
|
71
78
|
Node that is not ready also sends `refusal`, the limit as fields: `code`, and
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maiaos/cli",
|
|
3
|
-
"version": "0.1.0-canary.
|
|
3
|
+
"version": "0.1.0-canary.82",
|
|
4
4
|
"description": "The maia CLI and MCP server: start, drive, observe and stop swarms of Claude Code and Codex agents from a terminal, a script or another agent.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"maia",
|
|
@@ -65,9 +65,9 @@
|
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"@earendil-works/pi-tui": "1.0.0",
|
|
67
67
|
"@effect/platform-node-shared": "4.0.0",
|
|
68
|
-
"@maiaos/agent": "0.1.0-canary.
|
|
69
|
-
"@maiaos/client-core": "0.1.0-canary.
|
|
70
|
-
"@maiaos/sdk": "0.1.0-canary.
|
|
68
|
+
"@maiaos/agent": "0.1.0-canary.82",
|
|
69
|
+
"@maiaos/client-core": "0.1.0-canary.82",
|
|
70
|
+
"@maiaos/sdk": "0.1.0-canary.82",
|
|
71
71
|
"effect": "4.0.0"
|
|
72
72
|
},
|
|
73
73
|
"scripts": {
|