@mutagent/cli 0.2.7 → 0.2.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/cli.js +32 -2
- package/package.json +1 -1
package/dist/bin/cli.js
CHANGED
|
@@ -26529,6 +26529,9 @@ async function withStoppingRetry(send, sleep2 = (ms) => new Promise((resolve11)
|
|
|
26529
26529
|
|
|
26530
26530
|
// src/lib/sandbox-api.ts
|
|
26531
26531
|
init_known_secrets();
|
|
26532
|
+
function queuedForWake(result) {
|
|
26533
|
+
return result.wake?.state === "waking";
|
|
26534
|
+
}
|
|
26532
26535
|
async function resolveConnection() {
|
|
26533
26536
|
const apiKey = getApiKey();
|
|
26534
26537
|
if (!apiKey)
|
|
@@ -27388,6 +27391,11 @@ async function runNativeSession(options) {
|
|
|
27388
27391
|
throw new MutagentError("INVALID_ARGUMENTS", "RPC stdin requires JSON command objects.", "Send one JSON command object per line.");
|
|
27389
27392
|
}
|
|
27390
27393
|
const result = await options.send(line, inputController.signal);
|
|
27394
|
+
if (queuedForWake(result)) {
|
|
27395
|
+
stderr(`[mutagent] The session is being restored from its checkpoint; the command is queued, not delivered yet.
|
|
27396
|
+
`);
|
|
27397
|
+
continue;
|
|
27398
|
+
}
|
|
27391
27399
|
if (!result.accepted) {
|
|
27392
27400
|
throw new MutagentError("RPC_INPUT_REJECTED", "The session did not accept the RPC command.", "Reconnect to the live session before sending more input.");
|
|
27393
27401
|
}
|
|
@@ -28620,7 +28628,9 @@ AI Agent Directive:
|
|
|
28620
28628
|
--json returns ONE object: { success, reference, type, id, line, accepted,
|
|
28621
28629
|
_links }. 'accepted' means delivered, not answered: the answer is a 'response'
|
|
28622
28630
|
event with the same id on 'mutagent helix session attach <reference>'. This
|
|
28623
|
-
command does not wait for it.
|
|
28631
|
+
command does not wait for it. wake.state 'waking' means queued: the session is
|
|
28632
|
+
being restored and the message is not delivered yet; the stream reports the
|
|
28633
|
+
delivery, or the failed restore and the message it lost. Use --type and a message; use --line only for a
|
|
28624
28634
|
command the four types cannot express.
|
|
28625
28635
|
`).action(async (id, messageParts, options) => {
|
|
28626
28636
|
const isJson = getJsonFlag(jsonSource);
|
|
@@ -28629,6 +28639,26 @@ AI Agent Directive:
|
|
|
28629
28639
|
if (options.session === undefined) {
|
|
28630
28640
|
const built2 = buildLine(messageParts.join(" ").trim(), options);
|
|
28631
28641
|
const result2 = await sendHelixInput(id, built2.line);
|
|
28642
|
+
if (queuedForWake(result2)) {
|
|
28643
|
+
const watch = `mutagent helix session attach ${id}`;
|
|
28644
|
+
if (isJson) {
|
|
28645
|
+
output.output({
|
|
28646
|
+
success: true,
|
|
28647
|
+
reference: id,
|
|
28648
|
+
...built2,
|
|
28649
|
+
...result2,
|
|
28650
|
+
_links: { api: liveSessionPath(id) },
|
|
28651
|
+
_directive: {
|
|
28652
|
+
instruction: "Queued, not delivered yet: the session is being restored from its checkpoint. The stream reports the delivery, or a failed restore.",
|
|
28653
|
+
next: [watch]
|
|
28654
|
+
}
|
|
28655
|
+
});
|
|
28656
|
+
} else {
|
|
28657
|
+
output.success("Queued " + built2.type + " for " + id + ": the session is being restored from its checkpoint, so the message is not delivered yet.");
|
|
28658
|
+
console.error(chalk28.dim(" Watch for the reply, or a failed restore: " + watch));
|
|
28659
|
+
}
|
|
28660
|
+
return;
|
|
28661
|
+
}
|
|
28632
28662
|
if (!result2.accepted) {
|
|
28633
28663
|
throw new MutagentError("RPC_INPUT_REJECTED", "The session did not accept the command.", "Check the session: mutagent helix session list");
|
|
28634
28664
|
}
|
|
@@ -37228,4 +37258,4 @@ if (process.env.CLI_VERSION) {
|
|
|
37228
37258
|
}
|
|
37229
37259
|
runCli(process.argv.slice(2), cliVersion);
|
|
37230
37260
|
|
|
37231
|
-
//# debugId=
|
|
37261
|
+
//# debugId=16491E1FF7CAB85064756E2164756E21
|
package/package.json
CHANGED