@maiaos/cli 0.1.0-canary.7 → 0.1.0-canary.8
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/cli/cli.js +1 -0
- package/dist/command-line/context.d.ts +1 -0
- package/dist/command-line/index.d.ts +1 -1
- package/dist/command-line/index.js +1 -1
- package/dist/command-line/input/arguments.d.ts +7 -0
- package/dist/command-line/input/arguments.js +22 -10
- package/dist/command-line/input/index.d.ts +1 -1
- package/dist/command-line/input/index.js +1 -1
- package/dist/local-node/index.d.ts +1 -0
- package/dist/local-node/index.js +1 -0
- package/dist/local-node/wait.d.ts +10 -0
- package/dist/local-node/wait.js +17 -0
- package/dist/reference/resolve.js +9 -2
- package/dist/session/agent-permission.d.ts +2 -2
- package/dist/session/client.d.ts +9 -3
- package/dist/session/client.js +14 -2
- package/dist/session/commands.d.ts +1 -0
- package/dist/session/commands.js +32 -2
- package/dist/session/index.d.ts +1 -1
- package/dist/session/index.js +1 -1
- package/dist/session/output/human.d.ts +1 -0
- package/dist/session/output/human.js +1 -1
- package/dist/session/output/index.d.ts +1 -1
- package/dist/session/output/index.js +1 -1
- package/dist/session/tree/tree.js +11 -0
- package/dist/session/turn/client.js +7 -9
- package/dist/session/turn/commands.js +1 -6
- package/package.json +4 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MAX_TURN_WAIT_MILLISECONDS, turnCancelParametersSchema, turnInterruptParametersSchema, turnQueueListParametersSchema, turnSendParametersSchema, turnShowParametersSchema, turnWaitParametersSchema, } from "@maiaos/sdk";
|
|
2
2
|
import { Effect } from "effect";
|
|
3
|
-
import { commandIdentifier, } from "../../local-node/index.js";
|
|
3
|
+
import { commandIdentifier, repeatBoundedWait, } from "../../local-node/index.js";
|
|
4
4
|
export const makeTurnClient = (node) => {
|
|
5
5
|
const interruptTurn = (input) => {
|
|
6
6
|
return Effect.flatMap(commandIdentifier(input.commandId), (commandId) => {
|
|
@@ -29,17 +29,15 @@ export const makeTurnClient = (node) => {
|
|
|
29
29
|
};
|
|
30
30
|
const showTurn = (turnId) => node.runValidatedNodeOperation({ turnId }, turnShowParametersSchema, (client, parameters, options) => client.showTurn(parameters, options));
|
|
31
31
|
const waitTurnsOnce = (parameters) => node.runValidatedNodeOperation(parameters, turnWaitParametersSchema, (client, validated, options) => client.waitTurns(validated, options));
|
|
32
|
-
const waitWithin = (input) =>
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
const waitWithin = (input) => repeatBoundedWait({
|
|
33
|
+
maxRequestMilliseconds: MAX_TURN_WAIT_MILLISECONDS,
|
|
34
|
+
once: (waitMilliseconds) => waitTurnsOnce({
|
|
35
35
|
mode: input.mode,
|
|
36
36
|
turnIds: input.turnIds,
|
|
37
37
|
waitMilliseconds,
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return result;
|
|
42
|
-
return yield* waitWithin({ ...input, timeoutMilliseconds: remaining });
|
|
38
|
+
}),
|
|
39
|
+
satisfied: (value) => value.satisfied,
|
|
40
|
+
timeoutMilliseconds: input.timeoutMilliseconds,
|
|
43
41
|
});
|
|
44
42
|
return {
|
|
45
43
|
cancelTurn,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MAX_TURN_INPUT_BYTES, MAX_TURN_WAIT_IDS, } from "@maiaos/sdk";
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
|
-
import { CliArgumentError, parseOptions,
|
|
3
|
+
import { CliArgumentError, parseOptions, readExpectedRevision, readRevisionOption, readWaitTimeoutSeconds, requirePositionals, writeNodeResult, } from "../../command-line/index.js";
|
|
4
4
|
import { formatTurnMutation, formatTurnQueue, formatTurnShow, formatTurnWait, turnWaitExitCode, } from "./output.js";
|
|
5
5
|
const utf8 = new TextEncoder();
|
|
6
6
|
const summarizeTurnMutation = (result) => ({
|
|
@@ -156,11 +156,6 @@ export const runTurnShow = (tokens, context) => Effect.gen(function* () {
|
|
|
156
156
|
toText: formatTurnShow,
|
|
157
157
|
});
|
|
158
158
|
});
|
|
159
|
-
const DEFAULT_TURN_WAIT_SECONDS = 600;
|
|
160
|
-
const MAX_TURN_WAIT_SECONDS = 86_400;
|
|
161
|
-
const readWaitTimeoutSeconds = (value) => value === undefined
|
|
162
|
-
? DEFAULT_TURN_WAIT_SECONDS
|
|
163
|
-
: readDuration(value, "--timeout", { max: MAX_TURN_WAIT_SECONDS, min: 1 });
|
|
164
159
|
const parseTurnWaitArguments = (tokens) => {
|
|
165
160
|
const parsed = parseOptions(tokens, new Set(["--timeout"]), new Set(["--any"]));
|
|
166
161
|
if (parsed.positionals.length === 0 ||
|
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.8",
|
|
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.8",
|
|
68
|
+
"@maiaos/client-core": "0.1.0-canary.8",
|
|
69
|
+
"@maiaos/sdk": "0.1.0-canary.8",
|
|
70
70
|
"effect": "4.0.0"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|