@maiaos/cli 0.1.0-canary.5 → 0.1.0-canary.51
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 +2 -2
- 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.d.ts +3 -1
- package/dist/agents/input.js +6 -0
- package/dist/agents/output/format.d.ts +2 -2
- 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/bootstrap/run.js +5 -2
- package/dist/cli/cli.d.ts +8 -2
- package/dist/cli/cli.js +19 -6
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/command-line/context.d.ts +2 -1
- 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} +1 -0
- package/dist/command-line/{rows.js → emit/rows.js} +3 -0
- package/dist/command-line/index.d.ts +4 -4
- package/dist/command-line/index.js +4 -4
- 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 +1 -1
- package/dist/command-line/input/index.js +1 -1
- package/dist/command-line/two-phase.js +1 -1
- package/dist/command-receipt/command.js +1 -1
- package/dist/command-tree/tree.d.ts +1 -1
- package/dist/command-tree/tree.js +3 -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.d.ts +11 -0
- package/dist/events/commands.js +64 -0
- package/dist/events/index.d.ts +2 -0
- package/dist/events/index.js +2 -0
- package/dist/events/tree/index.d.ts +2 -0
- package/dist/events/tree/index.js +2 -0
- package/dist/events/tree/tree.d.ts +10 -0
- package/dist/events/tree/tree.js +17 -0
- package/dist/import/commands.js +1 -1
- package/dist/import/input.d.ts +4 -1
- package/dist/import/input.js +23 -2
- package/dist/import/output.js +3 -1
- 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.d.ts +3 -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.js +29 -15
- package/dist/session/client.d.ts +14 -3
- package/dist/session/client.js +17 -2
- package/dist/session/commands.d.ts +1 -0
- package/dist/session/commands.js +125 -9
- 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.d.ts +3 -0
- package/dist/session/output/human.js +20 -4
- package/dist/session/output/index.d.ts +1 -1
- package/dist/session/output/index.js +1 -1
- package/dist/session/output/tasks.d.ts +2 -0
- package/dist/session/output/tasks.js +34 -4
- package/dist/session/tree/tree.js +23 -12
- 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.d.ts +12 -0
- package/dist/terminal/keys.js +62 -0
- package/dist/terminal/output/compact-list.d.ts +1 -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/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 +4 -4
- /package/dist/command-line/{json-decoder.d.ts → emit/json-decoder.d.ts} +0 -0
- /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
|
@@ -3,8 +3,19 @@ import { liveTerminalWriteParametersSchema, MAX_TERMINAL_INPUT_CHUNK_BYTES, } fr
|
|
|
3
3
|
import * as Effect from "effect/Effect";
|
|
4
4
|
import { CliArgumentError, parseOptions, requirePositionals, } from "../command-line/index.js";
|
|
5
5
|
import { readTerminalColumns, readTerminalControllerFence, readTerminalExpectedRevision, readTerminalGeneration, readTerminalInputSequence, readTerminalLeaseDuration, readTerminalRows, terminalControllerFenceOptionNames, } from "./arguments.js";
|
|
6
|
+
import { terminalInputBytes, UnknownKeyError } from "./keys.js";
|
|
6
7
|
import { writeTerminalResult } from "./output/index.js";
|
|
7
8
|
const optionNames = (...additional) => new Set([...terminalControllerFenceOptionNames, ...additional]);
|
|
9
|
+
const typedInputBytes = (options) => {
|
|
10
|
+
try {
|
|
11
|
+
return terminalInputBytes([...options].filter(([name]) => name === "--text" || name === "--keys"));
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
throw error instanceof UnknownKeyError
|
|
15
|
+
? new CliArgumentError(error.message)
|
|
16
|
+
: error;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
8
19
|
const commandId = (options) => {
|
|
9
20
|
const value = options.get("--command-id");
|
|
10
21
|
return value === undefined ? {} : { commandId: value };
|
|
@@ -99,15 +110,15 @@ export const runControllerAcquire = (tokens, context) => Effect.gen(function* ()
|
|
|
99
110
|
}));
|
|
100
111
|
});
|
|
101
112
|
const parseTerminalWriteOptions = (tokens) => {
|
|
102
|
-
const parsed = parseOptions(tokens, optionNames("--input-id", "--input-sequence"), new Set(["--input-stdin"]));
|
|
113
|
+
const parsed = parseOptions(tokens, optionNames("--input-id", "--input-sequence", "--keys", "--text"), new Set(["--input-stdin"]));
|
|
103
114
|
requirePositionals(parsed.positionals, 1);
|
|
104
|
-
|
|
105
|
-
|
|
115
|
+
const typed = parsed.options.has("--text") || parsed.options.has("--keys");
|
|
116
|
+
if (parsed.flags.has("--input-stdin") === typed) {
|
|
117
|
+
throw new CliArgumentError("Give the input as '--input-stdin' or as '--text' and '--keys', not both.");
|
|
106
118
|
}
|
|
107
119
|
return parsed;
|
|
108
120
|
};
|
|
109
|
-
const readTerminalWriteScope = (
|
|
110
|
-
const parsed = parseTerminalWriteOptions(tokens);
|
|
121
|
+
const readTerminalWriteScope = (parsed) => {
|
|
111
122
|
const terminalId = requiredTerminalId(parsed.positionals);
|
|
112
123
|
const inputId = parsed.options.get("--input-id");
|
|
113
124
|
if (inputId === undefined) {
|
|
@@ -146,14 +157,20 @@ const readTerminalInput = (context) => {
|
|
|
146
157
|
});
|
|
147
158
|
};
|
|
148
159
|
export const runTerminalInputWrite = (tokens, context) => Effect.gen(function* () {
|
|
149
|
-
const
|
|
150
|
-
const
|
|
151
|
-
|
|
160
|
+
const parsed = parseTerminalWriteOptions(tokens);
|
|
161
|
+
const scope = readTerminalWriteScope(parsed);
|
|
162
|
+
const bytes = parsed.flags.has("--input-stdin")
|
|
163
|
+
? Buffer.from(yield* readTerminalInput(context), "utf8")
|
|
164
|
+
: typedInputBytes(parsed.options);
|
|
165
|
+
if (bytes.length === 0) {
|
|
152
166
|
throw new CliArgumentError("Terminal input must not be empty.");
|
|
153
167
|
}
|
|
168
|
+
if (bytes.length > MAX_TERMINAL_INPUT_CHUNK_BYTES) {
|
|
169
|
+
throw new CliArgumentError(`Terminal input must be at most ${String(MAX_TERMINAL_INPUT_CHUNK_BYTES)} bytes.`);
|
|
170
|
+
}
|
|
154
171
|
const result = yield* context.dependencies.writeTerminalInput({
|
|
155
172
|
...scope,
|
|
156
|
-
bytesBase64:
|
|
173
|
+
bytesBase64: bytes.toString("base64"),
|
|
157
174
|
});
|
|
158
175
|
return writeTerminalResult(result, context, (value) => ({
|
|
159
176
|
command: "terminal.input.write",
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Buffer } from "node:buffer";
|
|
2
|
+
declare const UnknownKeyError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
3
|
+
readonly _tag: "UnknownKeyError";
|
|
4
|
+
} & Readonly<A>;
|
|
5
|
+
export declare class UnknownKeyError extends UnknownKeyError_base<{
|
|
6
|
+
readonly message: string;
|
|
7
|
+
}> {
|
|
8
|
+
}
|
|
9
|
+
export declare const TERMINAL_KEY_NAMES: readonly string[];
|
|
10
|
+
export declare const terminalInputBytes: (parts: Iterable<readonly [option: string, value: string]>) => Buffer;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=keys.d.ts.map
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Buffer } from "node:buffer";
|
|
2
|
+
import { Data } from "effect";
|
|
3
|
+
const NAMED_KEYS = new Map([
|
|
4
|
+
["Backspace", "\u007F"],
|
|
5
|
+
["Delete", "\u001B[3~"],
|
|
6
|
+
["Down", "\u001B[B"],
|
|
7
|
+
["End", "\u001B[F"],
|
|
8
|
+
["Enter", "\r"],
|
|
9
|
+
["Escape", "\u001B"],
|
|
10
|
+
["F1", "\u001BOP"],
|
|
11
|
+
["F2", "\u001BOQ"],
|
|
12
|
+
["F3", "\u001BOR"],
|
|
13
|
+
["F4", "\u001BOS"],
|
|
14
|
+
["F5", "\u001B[15~"],
|
|
15
|
+
["F6", "\u001B[17~"],
|
|
16
|
+
["F7", "\u001B[18~"],
|
|
17
|
+
["F8", "\u001B[19~"],
|
|
18
|
+
["F9", "\u001B[20~"],
|
|
19
|
+
["F10", "\u001B[21~"],
|
|
20
|
+
["F11", "\u001B[23~"],
|
|
21
|
+
["F12", "\u001B[24~"],
|
|
22
|
+
["Home", "\u001B[H"],
|
|
23
|
+
["Insert", "\u001B[2~"],
|
|
24
|
+
["Left", "\u001B[D"],
|
|
25
|
+
["PageDown", "\u001B[6~"],
|
|
26
|
+
["PageUp", "\u001B[5~"],
|
|
27
|
+
["Right", "\u001B[C"],
|
|
28
|
+
["Space", " "],
|
|
29
|
+
["Tab", "\t"],
|
|
30
|
+
["Up", "\u001B[A"],
|
|
31
|
+
]);
|
|
32
|
+
export class UnknownKeyError extends Data.TaggedError("UnknownKeyError") {
|
|
33
|
+
}
|
|
34
|
+
export const TERMINAL_KEY_NAMES = [
|
|
35
|
+
...NAMED_KEYS.keys(),
|
|
36
|
+
"C-<a..z>",
|
|
37
|
+
"M-<char>",
|
|
38
|
+
];
|
|
39
|
+
const bytesOfKey = (name) => {
|
|
40
|
+
const named = NAMED_KEYS.get(name);
|
|
41
|
+
if (named !== undefined)
|
|
42
|
+
return named;
|
|
43
|
+
if (/^C-[a-z]$/u.test(name)) {
|
|
44
|
+
return String.fromCodePoint((name.codePointAt(2) ?? 0) - 0x60);
|
|
45
|
+
}
|
|
46
|
+
const alt = /^M-(\P{Cc})$/u.exec(name);
|
|
47
|
+
if (alt?.[1] !== undefined)
|
|
48
|
+
return `\u001B${alt[1]}`;
|
|
49
|
+
throw new UnknownKeyError({
|
|
50
|
+
message: `Unknown key '${name}'. Keys: ${TERMINAL_KEY_NAMES.join(", ")}.`,
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
export const terminalInputBytes = (parts) => Buffer.from([...parts]
|
|
54
|
+
.map(([option, value]) => option === "--text"
|
|
55
|
+
? value
|
|
56
|
+
: value
|
|
57
|
+
.split(/\s+/u)
|
|
58
|
+
.filter((name) => name !== "")
|
|
59
|
+
.map(bytesOfKey)
|
|
60
|
+
.join(""))
|
|
61
|
+
.join(""), "utf8");
|
|
62
|
+
//# sourceMappingURL=keys.js.map
|
|
@@ -120,6 +120,7 @@ export type CliTerminalEventsResult<TAudience extends CliOutputAudience = "json"
|
|
|
120
120
|
readonly headCursor: TerminalEventsListResult["headTerminalCursor"];
|
|
121
121
|
readonly items: readonly CliTerminalEvent<TAudience>[];
|
|
122
122
|
readonly nextCursor?: TerminalEventsListResult["nextTerminalCursor"];
|
|
123
|
+
readonly oldestRetainedCursor?: TerminalEventsListResult["oldestRetainedCursor"];
|
|
123
124
|
readonly terminalId: TerminalEventsListResult["terminalId"];
|
|
124
125
|
};
|
|
125
126
|
type CliTerminalChunk = {
|
|
@@ -132,6 +132,9 @@ export const projectTerminalEventsResult = (value, audience = "json") => ({
|
|
|
132
132
|
...(value.nextTerminalCursor === undefined
|
|
133
133
|
? {}
|
|
134
134
|
: { nextCursor: value.nextTerminalCursor }),
|
|
135
|
+
...(value.oldestRetainedCursor === undefined
|
|
136
|
+
? {}
|
|
137
|
+
: { oldestRetainedCursor: value.oldestRetainedCursor }),
|
|
135
138
|
terminalId: value.terminalId,
|
|
136
139
|
});
|
|
137
140
|
export const projectTerminalChunk = (chunk) => ({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cell, formatRows, jsonLine, writeNodeResult, } from "../../command-line/index.js";
|
|
1
|
+
import { cell, formatRows, jsonLine, withPrunedHistory, writeNodeResult, } from "../../command-line/index.js";
|
|
2
2
|
const isHumanLiveTerminal = (terminal) => terminal.state !== "unavailable" && "capability" in terminal;
|
|
3
3
|
const formatTerminalProjection = (terminal) => {
|
|
4
4
|
if (terminal.state === "unavailable") {
|
|
@@ -21,7 +21,7 @@ const formatTerminalEvent = (event) => {
|
|
|
21
21
|
}
|
|
22
22
|
return `${cell(event.cursor)}\t${cell(event.type)}`;
|
|
23
23
|
};
|
|
24
|
-
export const formatTerminalEvents = (result) => formatRows(result.items, formatTerminalEvent);
|
|
24
|
+
export const formatTerminalEvents = (result) => withPrunedHistory(formatRows(result.items, formatTerminalEvent), result.oldestRetainedCursor);
|
|
25
25
|
export const formatTerminalRead = (result) => (result.gap === undefined
|
|
26
26
|
? ""
|
|
27
27
|
: `gap\t${result.gap.reason}\t${cell(result.gap.oldestAvailableCursor)}\n`) +
|
|
@@ -72,7 +72,7 @@ export const TERMINAL_TREE = {
|
|
|
72
72
|
{ route: "<terminal-id>", run: [terminal, "runControllerRelease"] },
|
|
73
73
|
],
|
|
74
74
|
[
|
|
75
|
-
"terminal input write <terminal-id> --input-stdin --input-id <id> --input-sequence <1..2147483647> --controller-id <id> --controller-epoch <epoch> --controller-revision <revision> --controller-expires-at <timestamp> --terminal-generation <1..65535> --expected-revision <revision> [--command-id <id>]",
|
|
75
|
+
"terminal input write <terminal-id> (--input-stdin | [--text <text>] [--keys <names>]) --input-id <id> --input-sequence <1..2147483647> --controller-id <id> --controller-epoch <epoch> --controller-revision <revision> --controller-expires-at <timestamp> --terminal-generation <1..65535> --expected-revision <revision> [--command-id <id>]",
|
|
76
76
|
1,
|
|
77
77
|
"terminal.input.write",
|
|
78
78
|
"Write input to a terminal you control.",
|
|
@@ -11,7 +11,7 @@ description: >
|
|
|
11
11
|
## Goal
|
|
12
12
|
|
|
13
13
|
Use the installed `maia` binary as the public client. Treat `maia help --json`
|
|
14
|
-
and `maia help
|
|
14
|
+
and `maia help session --json` (or any other family) as the command allowlist.
|
|
15
15
|
|
|
16
16
|
## Main rules
|
|
17
17
|
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: maia-node
|
|
3
|
+
description: >
|
|
4
|
+
Check a Maia Node's health and reach local or remote Nodes with --node and
|
|
5
|
+
--profile through the public CLI. Use when an agent must find which Node a
|
|
6
|
+
command ran on, see whether a Node is ready, or register another Node.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Maia Node
|
|
10
|
+
|
|
11
|
+
A Node is the one place Maia keeps state and runs work. The CLI is a client of
|
|
12
|
+
it. Confirm each command on `maia help node --json` before use.
|
|
13
|
+
|
|
14
|
+
## Rules
|
|
15
|
+
|
|
16
|
+
1. Pass `--json` and read results from stdout and errors from stderr.
|
|
17
|
+
2. `--node <name>` sends a Node-backed command to a registered remote Node.
|
|
18
|
+
`--node local` names this machine. `--profile <name>` picks a local profile.
|
|
19
|
+
A flag beats `MAIA_NODE` and `MAIA_PROFILE`, which beat the default.
|
|
20
|
+
3. A command that manages this machine's Nodes, such as `maia node list`,
|
|
21
|
+
refuses `--node`.
|
|
22
|
+
4. An id belongs to one Node. A missing id (`resource_not_found`, exit 66) on
|
|
23
|
+
the selected Node does not prove it is absent everywhere; check the Node
|
|
24
|
+
selection and retry with the `--node` that holds it.
|
|
25
|
+
5. Exit code 69 means the Node is unavailable. Report it; do not start a Node
|
|
26
|
+
unless the caller asked for it.
|
|
27
|
+
|
|
28
|
+
## Implemented
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
maia --json status
|
|
32
|
+
maia --json node status
|
|
33
|
+
maia --json --node local node status
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
`node monitor` prints a one-time loopback URL for the admin monitor.
|
|
37
|
+
|
|
38
|
+
## Source candidates (release-disabled)
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
maia --json node list
|
|
42
|
+
maia --json node register <host> --name <name> --dry-run
|
|
43
|
+
maia --json node remove <node> --dry-run
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
`node register`, `node install` and `node remove` preview with `--dry-run`.
|
|
47
|
+
Confirm the preview only on the caller's request, from stdin with
|
|
48
|
+
`--confirm-stdin`.
|
|
49
|
+
|
|
50
|
+
## Do not
|
|
51
|
+
|
|
52
|
+
- Do not copy a Node's credentials or tokens into a prompt, a file or a log.
|
|
53
|
+
- Do not expose a Node beyond loopback or its tailnet.
|
|
54
|
+
- Do not remove a Node with `--purge` unless the caller named that.
|
|
@@ -5,7 +5,7 @@ description: >
|
|
|
5
5
|
public CLI: create, list, show, task list and show, inbox check and ack,
|
|
6
6
|
questions, and dispatch show or settle-terminal. Use when an external agent
|
|
7
7
|
is the explicit Run coordinator. Do not treat these commands as
|
|
8
|
-
release-enabled
|
|
8
|
+
release-enabled or worker assignment.
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
# Maia orchestration
|
|
@@ -51,4 +51,3 @@ caller-selected outcome. `settle-terminal` only records the Terminal's exact
|
|
|
51
51
|
unavailable failure. Do not teach Skill install/sync or extra runtime probes.
|
|
52
52
|
|
|
53
53
|
A compact CLI projection is not a protocol change. The SDK remains lossless.
|
|
54
|
-
No Orca command is equivalent.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: maia-sessions
|
|
3
|
+
description: >
|
|
4
|
+
Create, list, inspect and follow Maia Sessions through the public CLI, on
|
|
5
|
+
this machine or on a named Node with --node. Use when an agent needs to start
|
|
6
|
+
or watch coding work, read a Session's state, or recover after a retry.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Maia Sessions
|
|
10
|
+
|
|
11
|
+
A Session is one unit of coding work on a Maia Node. Maia Node owns its state;
|
|
12
|
+
the CLI only reads and requests changes. Confirm each command on
|
|
13
|
+
`maia help session --json` before use.
|
|
14
|
+
|
|
15
|
+
## Rules
|
|
16
|
+
|
|
17
|
+
1. Pass `--json`. A result, or a merged list with `ok: false`, is on stdout:
|
|
18
|
+
check `ok`, `error` and each `result.result.nodes[].error` before calling a
|
|
19
|
+
list complete. A plain refusal is JSON on stderr with empty stdout.
|
|
20
|
+
2. Use exact ids. Never infer a Project, Workspace or Session from the working
|
|
21
|
+
folder or a previous answer.
|
|
22
|
+
3. Add `--node <name>` to reach a remote Node. `--node local` names this
|
|
23
|
+
machine. See the maia-node Skill.
|
|
24
|
+
4. A mutation names itself with `--command-id <id>`. After exit code 76
|
|
25
|
+
(outcome unknown), run `maia receipt show <command-id>` before any retry,
|
|
26
|
+
and retry with the same id.
|
|
27
|
+
5. A change to an existing Session carries its current
|
|
28
|
+
`--expected-revision <revision>`. Exit code 75 also covers a full or held
|
|
29
|
+
Node and guard limits, so read `error.code` first. For `revision_conflict`
|
|
30
|
+
or `storage_conflict`, read the Session again and retry at its current
|
|
31
|
+
revision only if it is idle and the change still applies; else observe or
|
|
32
|
+
report. For `saturated`, `held` or `guard_*`, wait or report; never raise a
|
|
33
|
+
guard.
|
|
34
|
+
|
|
35
|
+
## Implemented
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
maia --json session list --project <project-id>
|
|
39
|
+
maia --json session show <session-id>
|
|
40
|
+
maia --json session create --workspace <workspace-id>
|
|
41
|
+
maia --json session events list --session <session-id>
|
|
42
|
+
maia --json session observe <session-id>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
`session list --all` lists Sessions of every Project. Without `--node` it also
|
|
46
|
+
merges the registered remote Nodes, and each row names its Node. A page cursor
|
|
47
|
+
(`--after`) pages one Node, so pass `--node <name>` with it. `--attention`
|
|
48
|
+
filters to Sessions that need attention.
|
|
49
|
+
|
|
50
|
+
## Source candidates (release-disabled)
|
|
51
|
+
|
|
52
|
+
These work from a source build only. Use them when the caller accepts that.
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
maia --json session start <session-id> --expected-revision <revision> --wait
|
|
56
|
+
maia --json session wait <session-id> --until running --timeout 5m
|
|
57
|
+
maia --json session turn queue <session-id>
|
|
58
|
+
maia --json session approval list --session <session-id>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Send prompt text on stdin with `--prompt-stdin`, never on the command line.
|
|
62
|
+
Exit code 74 means a wait reached its deadline.
|
|
63
|
+
|
|
64
|
+
## Do not
|
|
65
|
+
|
|
66
|
+
- `session observe` is one snapshot and exits 0. To watch a Session, re-run it
|
|
67
|
+
at a sensible pace; `session wait` is release-disabled.
|
|
68
|
+
- Do not read a worker's files or terminal to learn its state; read the Session.
|
|
69
|
+
- Do not delete or retire a Session unless the caller asked for it.
|
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.51",
|
|
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",
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@earendil-works/pi-tui": "1.0.0",
|
|
66
66
|
"@effect/platform-node-shared": "4.0.0",
|
|
67
|
-
"@maiaos/agent": "0.1.0-canary.
|
|
68
|
-
"@maiaos/client-core": "0.1.0-canary.
|
|
69
|
-
"@maiaos/sdk": "0.1.0-canary.
|
|
67
|
+
"@maiaos/agent": "0.1.0-canary.51",
|
|
68
|
+
"@maiaos/client-core": "0.1.0-canary.51",
|
|
69
|
+
"@maiaos/sdk": "0.1.0-canary.51",
|
|
70
70
|
"effect": "4.0.0"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|