@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.
@@ -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) => Effect.gen(function* () {
33
- const waitMilliseconds = Math.min(MAX_TURN_WAIT_MILLISECONDS, input.timeoutMilliseconds);
34
- const result = yield* waitTurnsOnce({
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
- const remaining = input.timeoutMilliseconds - waitMilliseconds;
40
- if (!result.ok || result.value.satisfied || remaining <= 0)
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, readDuration, readExpectedRevision, readRevisionOption, requirePositionals, writeNodeResult, } from "../../command-line/index.js";
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.7",
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.7",
68
- "@maiaos/client-core": "0.1.0-canary.7",
69
- "@maiaos/sdk": "0.1.0-canary.7",
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": {