@maiaos/cli 0.1.0-canary.35 → 0.1.0-canary.36
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 +19 -19
- package/dist/bin/maia.mjs +1 -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/login/gateway.js +2 -2
- package/dist/login/vendor-input.js +2 -2
- 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/status/client.d.ts +4 -0
- package/dist/status/output/compact.d.ts +1 -0
- package/dist/status/output/compact.js +11 -7
- package/package.json +4 -4
package/dist/connection/input.js
CHANGED
|
@@ -2,8 +2,8 @@ import { CliArgumentError, parseOptions, readExpectedRevision, readPageSize, req
|
|
|
2
2
|
const readSessionLimit = (value) => {
|
|
3
3
|
if (value === undefined)
|
|
4
4
|
return {};
|
|
5
|
-
if (!/^(?:[1-9]|1[0-6])$/u.test(value))
|
|
6
|
-
throw new CliArgumentError("Option '--max-sessions' must be an integer from 1 to
|
|
5
|
+
if (!/^(?:[1-9]|[1-5][0-9]|6[0-4])$/u.test(value))
|
|
6
|
+
throw new CliArgumentError("Option '--max-sessions' must be an integer from 1 to 64.");
|
|
7
7
|
return { maxConcurrentSessions: Number(value) };
|
|
8
8
|
};
|
|
9
9
|
const requireOption = (options, name) => {
|
|
@@ -146,8 +146,9 @@ const confirmedText = (result) => result.items
|
|
|
146
146
|
const readSetup = (parsed) => {
|
|
147
147
|
requirePositionals(parsed.positionals, 0);
|
|
148
148
|
const sessions = parsed.options.get("--max-sessions");
|
|
149
|
-
if (sessions !== undefined &&
|
|
150
|
-
|
|
149
|
+
if (sessions !== undefined &&
|
|
150
|
+
!/^(?:[1-9]|[1-5][0-9]|6[0-4])$/u.test(sessions))
|
|
151
|
+
throw new CliArgumentError("--max-sessions must be 1 to 64.");
|
|
151
152
|
return {
|
|
152
153
|
commandId: parsed.options.get("--command-id"),
|
|
153
154
|
...(sessions === undefined
|
|
@@ -23,7 +23,7 @@ export const CONNECTION_TREE = {
|
|
|
23
23
|
],
|
|
24
24
|
leaves: [
|
|
25
25
|
[
|
|
26
|
-
"setup [--max-sessions <1..
|
|
26
|
+
"setup [--max-sessions <1..64>] [--command-id <id>] [--dry-run | --confirm-stdin | --yes]",
|
|
27
27
|
1,
|
|
28
28
|
["connection.system.preview", "connection.system.confirm"],
|
|
29
29
|
"Use installed vendor CLIs as system-default accounts.",
|
|
@@ -41,7 +41,7 @@ export const CONNECTION_TREE = {
|
|
|
41
41
|
{ kind: "composite", run: loginRunner },
|
|
42
42
|
],
|
|
43
43
|
[
|
|
44
|
-
"login <claude|codex> [--name <name>] [--device-code] [--max-sessions <1..
|
|
44
|
+
"login <claude|codex> [--name <name>] [--device-code] [--max-sessions <1..64>]",
|
|
45
45
|
1,
|
|
46
46
|
"",
|
|
47
47
|
"Add or re-sign a Claude Code or Codex account.",
|
|
@@ -59,14 +59,14 @@ export const CONNECTION_TREE = {
|
|
|
59
59
|
{ kind: "composite", run: loginRunner },
|
|
60
60
|
],
|
|
61
61
|
[
|
|
62
|
-
"login gateway --name <name> --base-url <url> --api-key-stdin [--max-sessions <1..
|
|
62
|
+
"login gateway --name <name> --base-url <url> --api-key-stdin [--max-sessions <1..64>] [--command-id <id>]",
|
|
63
63
|
1,
|
|
64
64
|
"connection.gateway.create",
|
|
65
65
|
"Add a gateway Connection with its API key.",
|
|
66
66
|
{ run: [login, "runLoginGateway"] },
|
|
67
67
|
],
|
|
68
68
|
[
|
|
69
|
-
"connection create --name <name> --executor <codex-cli|claude-code> --root <maia-managed|system-default> [--max-sessions <1..
|
|
69
|
+
"connection create --name <name> --executor <codex-cli|claude-code> --root <maia-managed|system-default> [--max-sessions <1..64>] [--command-id <id>]",
|
|
70
70
|
1,
|
|
71
71
|
"connection.create",
|
|
72
72
|
"Create a worker account Connection.",
|
|
@@ -133,7 +133,7 @@ export const CONNECTION_TREE = {
|
|
|
133
133
|
{ run: [connection, "runConnectionModelsList"] },
|
|
134
134
|
],
|
|
135
135
|
[
|
|
136
|
-
"connection capacity set <connection> --max-sessions <1..
|
|
136
|
+
"connection capacity set <connection> --max-sessions <1..64> --expected-revision <revision> [--command-id <id>]",
|
|
137
137
|
1,
|
|
138
138
|
"connection.capacity.set",
|
|
139
139
|
"Set a Connection's Session limit.",
|
package/dist/login/gateway.js
CHANGED
|
@@ -6,8 +6,8 @@ import { newCliIdentifier } from "../local-node/index.js";
|
|
|
6
6
|
const readSessionLimit = (value) => {
|
|
7
7
|
if (value === undefined)
|
|
8
8
|
return {};
|
|
9
|
-
if (!/^(?:[1-9]|1[0-6])$/u.test(value))
|
|
10
|
-
throw new CliArgumentError("Option '--max-sessions' must be an integer from 1 to
|
|
9
|
+
if (!/^(?:[1-9]|[1-5][0-9]|6[0-4])$/u.test(value))
|
|
10
|
+
throw new CliArgumentError("Option '--max-sessions' must be an integer from 1 to 64.");
|
|
11
11
|
return { maxConcurrentSessions: Number(value) };
|
|
12
12
|
};
|
|
13
13
|
export const readGatewayLogin = (tokens) => {
|
|
@@ -7,8 +7,8 @@ export const vendorExecutor = (vendor) => EXECUTORS.get(vendor);
|
|
|
7
7
|
const readSessionLimit = (value) => {
|
|
8
8
|
if (value === undefined)
|
|
9
9
|
return {};
|
|
10
|
-
if (!/^(?:[1-9]|1[0-6])$/u.test(value))
|
|
11
|
-
throw new CliArgumentError("Option '--max-sessions' must be an integer from 1 to
|
|
10
|
+
if (!/^(?:[1-9]|[1-5][0-9]|6[0-4])$/u.test(value))
|
|
11
|
+
throw new CliArgumentError("Option '--max-sessions' must be an integer from 1 to 64.");
|
|
12
12
|
return { maxConcurrentSessions: Number(value) };
|
|
13
13
|
};
|
|
14
14
|
export const readVendorLogin = (tokens) => {
|
|
@@ -6,6 +6,9 @@ export declare const makeProjectGuardClient: (node: CliNodeOperations) => {
|
|
|
6
6
|
readonly delivery: "duplicate" | "new";
|
|
7
7
|
readonly expectedRevision: string;
|
|
8
8
|
readonly guard: {
|
|
9
|
+
readonly approvalGrants: {
|
|
10
|
+
readonly coordinator: "answer" | "decide" | "none";
|
|
11
|
+
};
|
|
9
12
|
readonly limits: {
|
|
10
13
|
readonly maxDepth: number;
|
|
11
14
|
readonly maxLeasesPerSession: number;
|
|
@@ -41,8 +44,14 @@ export declare const makeProjectGuardClient: (node: CliNodeOperations) => {
|
|
|
41
44
|
readonly inputDigest: string;
|
|
42
45
|
readonly proof: string;
|
|
43
46
|
readonly actorId: string;
|
|
47
|
+
readonly approvalGrants: {
|
|
48
|
+
readonly coordinator: "answer" | "decide" | "none";
|
|
49
|
+
};
|
|
44
50
|
readonly commandId: string;
|
|
45
51
|
readonly current: {
|
|
52
|
+
readonly approvalGrants: {
|
|
53
|
+
readonly coordinator: "answer" | "decide" | "none";
|
|
54
|
+
};
|
|
46
55
|
readonly limits: {
|
|
47
56
|
readonly maxDepth: number;
|
|
48
57
|
readonly maxLeasesPerSession: number;
|
|
@@ -69,6 +78,9 @@ export declare const makeProjectGuardClient: (node: CliNodeOperations) => {
|
|
|
69
78
|
}>;
|
|
70
79
|
showProjectGuard: (input: ProjectGuardShowParameters) => import("../local-node/client.js").CliNodeEffect<{
|
|
71
80
|
readonly guard: {
|
|
81
|
+
readonly approvalGrants: {
|
|
82
|
+
readonly coordinator: "answer" | "decide" | "none";
|
|
83
|
+
};
|
|
72
84
|
readonly limits: {
|
|
73
85
|
readonly maxDepth: number;
|
|
74
86
|
readonly maxLeasesPerSession: number;
|
|
@@ -5,6 +5,9 @@ export declare const readGuardShow: (tokens: readonly string[]) => {
|
|
|
5
5
|
};
|
|
6
6
|
export declare const GUARD_OPTIONS: ReadonlySet<string>;
|
|
7
7
|
export declare const readGuardPreview: (parsed: ParsedOptions) => Effect.Effect<{
|
|
8
|
+
approvalGrants?: Partial<{
|
|
9
|
+
readonly coordinator: "answer" | "decide" | "none";
|
|
10
|
+
}> | undefined;
|
|
8
11
|
commandId: string;
|
|
9
12
|
expectedRevision: string;
|
|
10
13
|
limits: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SESSION_GUARD_BOUNDS } from "@maiaos/sdk";
|
|
1
|
+
import { COORDINATOR_APPROVAL_GRANTS, SESSION_GUARD_BOUNDS, } from "@maiaos/sdk";
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
3
|
import { CliArgumentError, parseOptions, readExpectedRevision, requirePositionals, } from "../command-line/index.js";
|
|
4
4
|
import { commandIdentifier } from "../local-node/index.js";
|
|
@@ -23,6 +23,17 @@ const readLimits = (options) => ({
|
|
|
23
23
|
maxLiveChildren: readLimit(options, "maxLiveChildren"),
|
|
24
24
|
maxMessagesPerMinute: readLimit(options, "maxMessagesPerMinute"),
|
|
25
25
|
});
|
|
26
|
+
const GRANT_OPTIONS = { coordinator: "--approval-coordinator" };
|
|
27
|
+
const readGrants = (options) => {
|
|
28
|
+
const option = GRANT_OPTIONS.coordinator;
|
|
29
|
+
const value = options.get(option);
|
|
30
|
+
if (value === undefined)
|
|
31
|
+
return undefined;
|
|
32
|
+
const levels = COORDINATOR_APPROVAL_GRANTS;
|
|
33
|
+
if (!levels.includes(value))
|
|
34
|
+
throw new CliArgumentError(`Option '${option}' must be ${levels.join(", ")}.`);
|
|
35
|
+
return { coordinator: value };
|
|
36
|
+
};
|
|
26
37
|
export const readGuardShow = (tokens) => {
|
|
27
38
|
const parsed = parseOptions(tokens, new Set());
|
|
28
39
|
requirePositionals(parsed.positionals, 1);
|
|
@@ -32,12 +43,15 @@ export const GUARD_OPTIONS = new Set([
|
|
|
32
43
|
"--command-id",
|
|
33
44
|
"--expected-revision",
|
|
34
45
|
...Object.values(LIMIT_OPTIONS),
|
|
46
|
+
...Object.values(GRANT_OPTIONS),
|
|
35
47
|
]);
|
|
36
48
|
export const readGuardPreview = (parsed) => {
|
|
37
49
|
requirePositionals(parsed.positionals, 1);
|
|
38
50
|
const expectedRevision = readExpectedRevision(parsed.options.get("--expected-revision"));
|
|
39
51
|
const limits = readLimits(parsed.options);
|
|
52
|
+
const approvalGrants = readGrants(parsed.options);
|
|
40
53
|
return Effect.map(commandIdentifier(parsed.options.get("--command-id")), (commandId) => ({
|
|
54
|
+
...(approvalGrants === undefined ? {} : { approvalGrants }),
|
|
41
55
|
commandId,
|
|
42
56
|
expectedRevision,
|
|
43
57
|
limits,
|
|
@@ -5,11 +5,15 @@ const limitCells = (limits) => [
|
|
|
5
5
|
`maxMessagesPerMinute=${String(limits.maxMessagesPerMinute)}`,
|
|
6
6
|
`maxLeasesPerSession=${String(limits.maxLeasesPerSession)}`,
|
|
7
7
|
];
|
|
8
|
+
const grantCells = (grants) => [
|
|
9
|
+
`approvalCoordinator=${grants.coordinator}`,
|
|
10
|
+
];
|
|
8
11
|
const guardLine = (guard) => [
|
|
9
12
|
guard.projectId,
|
|
10
13
|
`source=${guard.source}`,
|
|
11
14
|
`revision=${guard.revision}`,
|
|
12
15
|
...limitCells(guard.limits),
|
|
16
|
+
...grantCells(guard.approvalGrants),
|
|
13
17
|
].join("\t");
|
|
14
18
|
const previewLines = (result) => [
|
|
15
19
|
`${guardLine(result.current)}\tcurrent`,
|
|
@@ -17,6 +21,7 @@ const previewLines = (result) => [
|
|
|
17
21
|
result.projectId,
|
|
18
22
|
"proposed",
|
|
19
23
|
...limitCells(result.limits),
|
|
24
|
+
...grantCells(result.approvalGrants),
|
|
20
25
|
`command=${result.commandId}`,
|
|
21
26
|
`expires=${result.expiresAt}`,
|
|
22
27
|
].join("\t"),
|
|
@@ -64,7 +64,7 @@ export const PROJECT_TREE = {
|
|
|
64
64
|
{ route: "<project-id>", run: [guard, "runProjectGuardShow"] },
|
|
65
65
|
],
|
|
66
66
|
[
|
|
67
|
-
"project guard set (<project-id> --expected-revision <revision> --max-depth <1..4> --max-live-children <1..64> --max-messages-per-minute <1..600> --max-leases-per-session <1..64> [--command-id <id>] [--dry-run] | --confirm-stdin)",
|
|
67
|
+
"project guard set (<project-id> --expected-revision <revision> --max-depth <1..4> --max-live-children <1..64> --max-messages-per-minute <1..600> --max-leases-per-session <1..64> [--approval-coordinator <none|answer|decide>] [--command-id <id>] [--dry-run] | --confirm-stdin)",
|
|
68
68
|
1,
|
|
69
69
|
["project.guard.preview", "project.guard.confirm"],
|
|
70
70
|
"Set a Project's guards after a preview.",
|
package/dist/status/client.d.ts
CHANGED
|
@@ -8,6 +8,10 @@ export declare const makeStatusClient: (node: CliNodeOperations) => {
|
|
|
8
8
|
readonly pid: number;
|
|
9
9
|
readonly profile: string;
|
|
10
10
|
readonly startedAt: string;
|
|
11
|
+
readonly admissionCaps?: {
|
|
12
|
+
readonly defaultAccountSessions: number;
|
|
13
|
+
readonly maximumActiveSessions: number;
|
|
14
|
+
} | undefined;
|
|
11
15
|
readonly executorHost?: {
|
|
12
16
|
readonly bubblewrap: "found" | "missing";
|
|
13
17
|
readonly socat: "found" | "missing";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { LocalNodeStatusResult } from "@maiaos/sdk";
|
|
2
2
|
export declare const sumObservationWarningTrees: (observations: LocalNodeStatusResult["processResources"]["observations"]) => number;
|
|
3
3
|
export type CliCompactStatusResult = {
|
|
4
|
+
readonly admissionCaps?: LocalNodeStatusResult["admissionCaps"];
|
|
4
5
|
readonly command: "status";
|
|
5
6
|
readonly executorHost?: LocalNodeStatusResult["executorHost"];
|
|
6
7
|
readonly instanceId: LocalNodeStatusResult["instanceId"];
|
|
@@ -24,21 +24,25 @@ const projectStatusCapability = (capability) => ({
|
|
|
24
24
|
mode: capability.mode,
|
|
25
25
|
releaseQualified: capability.releaseQualified,
|
|
26
26
|
});
|
|
27
|
+
const projectProcessResources = (node) => ({
|
|
28
|
+
admission: projectStatusAdmission(node.processResources.admission),
|
|
29
|
+
capability: projectStatusCapability(node.processResources.capability),
|
|
30
|
+
nextStep: node.processResources.nextStep,
|
|
31
|
+
pressure: node.processResources.pressure,
|
|
32
|
+
warningTrees: sumObservationWarningTrees(node.processResources.observations),
|
|
33
|
+
});
|
|
27
34
|
export const projectStatusResult = (node) => ({
|
|
28
35
|
command: "status",
|
|
36
|
+
...(node.admissionCaps === undefined
|
|
37
|
+
? {}
|
|
38
|
+
: { admissionCaps: node.admissionCaps }),
|
|
29
39
|
...(node.executorHost === undefined
|
|
30
40
|
? {}
|
|
31
41
|
: { executorHost: node.executorHost }),
|
|
32
42
|
instanceId: node.instanceId,
|
|
33
43
|
lifecycle: node.lifecycle,
|
|
34
44
|
pid: node.pid,
|
|
35
|
-
processResources:
|
|
36
|
-
admission: projectStatusAdmission(node.processResources.admission),
|
|
37
|
-
capability: projectStatusCapability(node.processResources.capability),
|
|
38
|
-
nextStep: node.processResources.nextStep,
|
|
39
|
-
pressure: node.processResources.pressure,
|
|
40
|
-
warningTrees: sumObservationWarningTrees(node.processResources.observations),
|
|
41
|
-
},
|
|
45
|
+
processResources: projectProcessResources(node),
|
|
42
46
|
profile: node.profile,
|
|
43
47
|
storage: {
|
|
44
48
|
...(node.storage.events === undefined
|
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.36",
|
|
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.36",
|
|
68
|
+
"@maiaos/client-core": "0.1.0-canary.36",
|
|
69
|
+
"@maiaos/sdk": "0.1.0-canary.36",
|
|
70
70
|
"effect": "4.0.0"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|