agent-yes 1.307.0 → 1.308.0
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 +53 -0
- package/dist/{JsonlStore-CB_0sfdT.js → JsonlStore-fEAVg5aY.js} +1 -1
- package/dist/SUPPORTED_CLIS-Ce_7n97m.js +12 -0
- package/dist/{SUPPORTED_CLIS-qL9_2DZ8.js → SUPPORTED_CLIS-DFpjQ2Ke.js} +2 -2
- package/dist/agent-yes.config-ByXwI-t3.js +47 -0
- package/dist/agentPermissions-CgM1bl6m.js +62 -0
- package/dist/{agentShare-C2oXrGvf.js → agentShare-Dz_T6b5v.js} +14 -14
- package/dist/{askCli-D4czi-_j.js → askCli-BjQOqpvv.js} +6 -6
- package/dist/{browser-BW90gl2w.js → browser-BzjhscIR.js} +5 -5
- package/dist/{browser-BAFPmEvN.js → browser-CU933aYj.js} +1 -1
- package/dist/{callback-ie8yyKma.js → callback-CAWItwdn.js} +5 -5
- package/dist/callback-oTjpUn2G.js +17 -0
- package/dist/{callbackCore-Deve5pv3.js → callbackCore-DoPrLOFY.js} +1 -1
- package/dist/{callbackCore-BZ_10zyc.js → callbackCore-TE7HjQm9.js} +1 -1
- package/dist/{channels-jIa5fNjY.js → channels-BGSdyeQs.js} +2 -2
- package/dist/{channels-Y36S0ccW.js → channels-bw-b9z0l.js} +6 -6
- package/dist/channels.js +5 -5
- package/dist/claude-DLN2dvVD.js +180 -0
- package/dist/cli.js +60 -15
- package/dist/{cmdDsh-DZ8bLsH7.js → cmdDsh-h7V2ThH5.js} +1 -1
- package/dist/{cmdKill-DUyZ7Dch.js → cmdKill-b5I7H8wx.js} +5 -5
- package/dist/{cmdPs-CfR5qCiO.js → cmdPs-RZU-tTd4.js} +14 -14
- package/dist/{agent-yes.config-CRfpdp3A.js → configLoader-CLSX_LND.js} +4 -42
- package/dist/configLoader-D9O9zwKR.js +5 -0
- package/dist/{configShared-De4bR5hH.js → configShared-B9gyn11R.js} +1 -1
- package/dist/{cwdConflictWarn-ml6Qs3Qu.js → cwdConflictWarn-BQ8vH915.js} +2 -2
- package/dist/{cwdPassthroughHint-CzWh0hrw.js → cwdPassthroughHint-h4dQQCLO.js} +1 -1
- package/dist/detach-B_n7xRl2.js +58 -0
- package/dist/{e2e-BdLf8DvY.js → e2e-C34A1uYu.js} +1 -1
- package/dist/{expose-Bhsn5yUz.js → expose-BKxcKYt-.js} +1 -1
- package/dist/{forceKill-BDqxx4uQ.js → forceKill-BAqKNR_f.js} +2 -2
- package/dist/{forkNested-DHuYbpaf.js → forkNested-CVSWfZT6.js} +3 -3
- package/dist/{globalPidIndex-DmDCB_X7.js → globalPidIndex-B5c_g_yJ.js} +1 -1
- package/dist/{globalPidIndex-C6p_AY4D.js → globalPidIndex-D9fxq9Ad.js} +10 -2
- package/dist/{hist-DY16wm7g.js → hist-OSUKO8sb.js} +1 -1
- package/dist/{html2canvas-pro.esm-Dp-JZojz.js → html2canvas-pro.esm-BW1GOcB-.js} +1 -1
- package/dist/{identity-D3hr59eC.js → identity-BVHHqtvP.js} +1 -1
- package/dist/{identity-puvd7hVQ.js → identity-CtwRW1nD.js} +1 -1
- package/dist/index.js +8 -8
- package/dist/{initMsg-GPU52N-j.js → initMsg-C1tgHfYP.js} +1 -1
- package/dist/{initMsg-BEVDWYnv.js → initMsg-CkrZjsX-.js} +1 -1
- package/dist/launch-BlKMU2ZA.js +74 -0
- package/dist/launch-CMran68t.js +3 -0
- package/dist/{messageLog-CEqe4Hk1.js → messageLog-BrXNxItW.js} +1 -1
- package/dist/{needsInput-hRiWFjGy.js → needsInput-B3aPVSqs.js} +1 -1
- package/dist/{nodeRuntime-DGMQRTGT.js → nodeRuntime-B1nCglgu.js} +1 -1
- package/dist/{notifyDaemon-DcAbvP43.js → notifyDaemon-Dh4cLfBU.js} +13 -13
- package/dist/{notifyStore-C4pH_-zJ.js → notifyStore-B7DLD83Q.js} +1 -1
- package/dist/{notifyStore-DIfkfKB2.js → notifyStore-CNdHlJyW.js} +1 -1
- package/dist/{openBrowser-CQAOIrD6.js → openBrowser-CwhGNBhv.js} +1 -1
- package/dist/oxmgrService-C0nYf9CD.js +3 -0
- package/dist/{oxmgrService-DlYHmqyI.js → oxmgrService-CBlFJ_-C.js} +2 -2
- package/dist/{parentLink-UiM6WoKm.js → parentLink-C2gocHk9.js} +2 -2
- package/dist/{parentLink-B7_kEM1v.js → parentLink-EVI_0cLu.js} +2 -2
- package/dist/{parentPingLoop-BYT4XgfN.js → parentPingLoop-B9QDw20l.js} +7 -7
- package/dist/peer-BSZQbKB7.js +4 -0
- package/dist/{peer-L-prov9t.js → peer-DI_xxui8.js} +3 -3
- package/dist/pidStore-BRU1Q0uN.js +6 -0
- package/dist/{pidStore-DUXifdBr.js → pidStore-DXEbQrh-.js} +3 -3
- package/dist/{procStats-DwTxj3rs.js → procStats-CkzFrwx7.js} +1 -1
- package/dist/{reaper-DsZhX5FH.js → reaper-A_eEjMxS.js} +1 -1
- package/dist/{reaper-C2cuougX.js → reaper-BTfq0-5j.js} +1 -1
- package/dist/{remotes-CAZymHd7.js → remotes-B0vw-dsd.js} +3 -3
- package/dist/{remotes-W6NhMDfP.js → remotes-TKXkCV76.js} +3 -3
- package/dist/roomReplyAlias-0xfUQlda.js +6 -0
- package/dist/{roomReplyAlias-B1EJft2d.js → roomReplyAlias-CkfEtW2v.js} +3 -3
- package/dist/runner-B1vocYOj.js +371 -0
- package/dist/{runningLock-DMznYh45.js → runningLock-DaVbNt4d.js} +1 -1
- package/dist/{rustBinary-BjsZbiv5.js → rustBinary-B603fLUa.js} +2 -2
- package/dist/{rustBinary-CXQGcJEm.js → rustBinary-CTEd2FnZ.js} +2 -2
- package/dist/{schedule-zacFV53l.js → schedule-DncJhp1d.js} +15 -15
- package/dist/{schedules-BvwTGXU2.js → schedules-D6hZ7VpJ.js} +1 -1
- package/dist/{schedulesCli-Donh0LS2.js → schedulesCli-DSBZwREE.js} +3 -3
- package/dist/{senderAncestry-KhAUPCQs.js → senderAncestry-Brb-cYni.js} +1 -1
- package/dist/{senderAncestry-CVHeKk1Y.js → senderAncestry-DqbNIecg.js} +1 -1
- package/dist/{serve-C38WYmzz.js → serve-BJEDb5Az.js} +52 -51
- package/dist/{serveRust-76_apYb8.js → serveRust-B50JWdfK.js} +3 -3
- package/dist/{setup-CeAisuhv.js → setup-CxQJtnmp.js} +4 -4
- package/dist/{share-_TPYAGWC.js → share-CPtJgXt2.js} +2 -2
- package/dist/{share-CbFetL5H.js → share-zVt71n2g.js} +2 -2
- package/dist/{shareCmd-foO5MbJp.js → shareCmd-96G551OE.js} +10 -10
- package/dist/{spawnGate-nUrmf4dd.js → spawnGate-BkkT7GF2.js} +3 -3
- package/dist/spawnGate-Ky21E51l.js +5 -0
- package/dist/{store-xmBpqPUq.js → store-MjCqeJDI.js} +1 -1
- package/dist/{subcommands-DE31Tfv_.js → subcommands-BJezWaHi.js} +455 -124
- package/dist/{subcommands-DLQEC24N.js → subcommands-DbdxjvFI.js} +12 -12
- package/dist/{systemPathLink-DI9WdoqQ.js → systemPathLink-BQE53HED.js} +1 -1
- package/dist/{terminal-CBbp6PfB.js → terminal-CLjXOXI7.js} +2 -2
- package/dist/terminal.js +1 -1
- package/dist/{todoAutomation-CKlrxuZv.js → todoAutomation-KgmnTAsD.js} +2 -2
- package/dist/{todoCli-BllShFnc.js → todoCli-ammnk6Wv.js} +6 -6
- package/dist/{todoIdentity-DeDp7LKl.js → todoIdentity-DzjduXlF.js} +2 -2
- package/dist/{todoStore-msRCEUi1.js → todoStore-Dre3Yhwt.js} +2 -2
- package/dist/{tray-RIjHSw7z.js → tray-C4sCiT8B.js} +2 -2
- package/dist/{trayApp-C9SZOPpw.js → trayApp-CZwRPF62.js} +2 -2
- package/dist/trayApp-UWX_Bfay.js +5 -0
- package/dist/{ts-CO1H1P2R.js → ts-J77_edCv.js} +20 -79
- package/dist/{versionChecker-CG--tQsV.js → versionChecker-DcrK7m4z.js} +2 -2
- package/dist/{webrtcLink-WxS1nTIs.js → webrtcLink-CGCXjlQJ.js} +2 -2
- package/dist/{webrtcLink-DcvacEci.js → webrtcLink-D4pMhyvY.js} +2 -2
- package/dist/{webrtcRemote-B4pwES4i.js → webrtcRemote-DdCC3aZC.js} +3 -3
- package/dist/{widget-CI7BtN94.js → widget-DU-iJOPF.js} +3 -3
- package/dist/widget.js +1 -1
- package/dist/widgets.js +5 -5
- package/dist/{workspaceConfig-DjEklzxf.js → workspaceConfig-BmK6COFt.js} +1 -1
- package/dist/{ws-DLJSBws6.js → ws-AZ6QSr2M.js} +3 -3
- package/dist/ws-CNd9TMOE.js +16 -0
- package/package.json +1 -1
- package/ts/cli.ts +40 -1
- package/ts/globalPidIndex.ts +19 -2
- package/ts/parseCliArgs.spec.ts +10 -0
- package/ts/parseCliArgs.ts +22 -0
- package/ts/subcommands.spec.ts +2 -2
- package/ts/subcommands.ts +186 -13
- package/dist/SUPPORTED_CLIS-BOGmmIrH.js +0 -12
- package/dist/callback-CNL-PGwh.js +0 -17
- package/dist/oxmgrService-o9L3I6FX.js +0 -3
- package/dist/peer-3F7owPWt.js +0 -4
- package/dist/pidStore-B89BOF_T.js +0 -6
- package/dist/roomReplyAlias-BeGVkAlc.js +0 -6
- package/dist/spawnGate-DhPgMs0Y.js +0 -5
- package/dist/trayApp-BSOmax2E.js +0 -5
- package/dist/ws-W5nWHjDt.js +0 -16
package/dist/cli.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
import { t as invokedCliName } from "./invokedCli-zdFbz1ST.js";
|
|
3
3
|
import { n as logger } from "./logger-CDIsZ-Pp.js";
|
|
4
|
-
import { a as versionString, r as displayVersion, t as checkAndAutoUpdate } from "./versionChecker-
|
|
5
|
-
import { h as getRustBinary } from "./rustBinary-
|
|
4
|
+
import { a as versionString, r as displayVersion, t as checkAndAutoUpdate } from "./versionChecker-DcrK7m4z.js";
|
|
5
|
+
import { h as getRustBinary } from "./rustBinary-CTEd2FnZ.js";
|
|
6
6
|
import { statSync } from "node:fs";
|
|
7
7
|
import { isAbsolute } from "node:path";
|
|
8
8
|
import { argv } from "process";
|
|
@@ -94,7 +94,11 @@ applyCwdGuard();
|
|
|
94
94
|
*/
|
|
95
95
|
function parseCliArgs(argv, supportedClis) {
|
|
96
96
|
const cliName = invokedCliName(argv);
|
|
97
|
-
const yargsInstance = yargs(hideBin(argv)).usage("Usage: $0 [agent-yes args] [cli] [agent-cli args] [--] [prompts...]").example("$0 --timeout=30s claude -- solve all todos in my codebase, commit one by one", "Run Claude with a 30 seconds idle timeout (will type /exit when timeout), everything after `--` will be treated as the prompt").example("$0 claude --stdpush", "Run Claude with external stdin input enabled via --append-prompt").option("
|
|
97
|
+
const yargsInstance = yargs(hideBin(argv)).usage("Usage: $0 [agent-yes args] [cli] [agent-cli args] [--] [prompts...]").example("$0 --timeout=30s claude -- solve all todos in my codebase, commit one by one", "Run Claude with a 30 seconds idle timeout (will type /exit when timeout), everything after `--` will be treated as the prompt").example("$0 claude --stdpush", "Run Claude with external stdin input enabled via --append-prompt").option("stream", {
|
|
98
|
+
type: "boolean",
|
|
99
|
+
default: false,
|
|
100
|
+
description: "Run Claude using the stream JSON protocol (TypeScript runtime)"
|
|
101
|
+
}).option("robust", {
|
|
98
102
|
type: "boolean",
|
|
99
103
|
default: true,
|
|
100
104
|
description: "re-spawn Claude with --continue if it crashes, only works for claude yet",
|
|
@@ -299,6 +303,18 @@ function parseCliArgs(argv, supportedClis) {
|
|
|
299
303
|
const dashPrompt = dashIndex === void 0 ? void 0 : rawArgs.slice(dashIndex + 1).join(" ");
|
|
300
304
|
if (parsedArgv.exitOnIdle !== void 0) console.warn("\x1B[33m⚠ Warning: --exit-on-idle and -e are deprecated. Please use --timeout instead.\x1B[0m");
|
|
301
305
|
return {
|
|
306
|
+
nativeArgs: (() => {
|
|
307
|
+
const args = parsedArgv._[0] && !cliName ? rawArgs.slice((cliArgIndex ?? 0) + 1) : [
|
|
308
|
+
...cliArgsForSpawn,
|
|
309
|
+
...positionalPromptWords,
|
|
310
|
+
...dashIndex === void 0 ? [] : rawArgs.slice(dashIndex + 1)
|
|
311
|
+
];
|
|
312
|
+
const separator = args.indexOf("--");
|
|
313
|
+
if (parsedArgv._[0] && !cliName && separator !== -1) args.splice(separator, 1);
|
|
314
|
+
return args;
|
|
315
|
+
})(),
|
|
316
|
+
explicitPrompt: parsedArgv.prompt,
|
|
317
|
+
stream: parsedArgv.stream,
|
|
302
318
|
cwd: process.cwd(),
|
|
303
319
|
env: process.env,
|
|
304
320
|
cli: cliName || parsedArgv.cli || (dashIndex !== 0 ? parsedArgv._[0]?.toString()?.replace?.(/-yes$/, "") : void 0),
|
|
@@ -378,7 +394,7 @@ function buildRustArgs(argv, cliFromScript, supportedClis) {
|
|
|
378
394
|
const rawArg = process.argv[2];
|
|
379
395
|
const managerCommands = !invokedCliName(process.argv);
|
|
380
396
|
const isHelpFlag = rawArg === "-h" || rawArg === "--help";
|
|
381
|
-
const { isSubcommand, runSubcommand, cmdHelp, isUnknownManagerToken, isBareManagerInvocation } = await import("./subcommands-
|
|
397
|
+
const { isSubcommand, runSubcommand, cmdHelp, isUnknownManagerToken, isBareManagerInvocation } = await import("./subcommands-DbdxjvFI.js");
|
|
382
398
|
if (isHelpFlag && process.argv.length === 3) {
|
|
383
399
|
await cmdHelp(managerCommands);
|
|
384
400
|
process.exit(0);
|
|
@@ -392,7 +408,7 @@ function buildRustArgs(argv, cliFromScript, supportedClis) {
|
|
|
392
408
|
process.exit(code ?? 0);
|
|
393
409
|
}
|
|
394
410
|
{
|
|
395
|
-
const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-
|
|
411
|
+
const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-Ce_7n97m.js");
|
|
396
412
|
if (isUnknownManagerToken(rawArg, managerCommands, SUPPORTED_CLIS)) {
|
|
397
413
|
process.stderr.write(`ay: unknown subcommand or CLI '${rawArg}'.\n See 'ay help' for subcommands. To run an agent, name a CLI:\n 'ay <cli> …' (e.g. 'ay claude …') or 'ay --cli <cli> …'.\n`);
|
|
398
414
|
process.exit(1);
|
|
@@ -400,7 +416,7 @@ function buildRustArgs(argv, cliFromScript, supportedClis) {
|
|
|
400
416
|
}
|
|
401
417
|
}
|
|
402
418
|
{
|
|
403
|
-
const { detectCwdPassthrough, SUPPRESS_CWD_WARN_ENV } = await import("./cwdPassthroughHint-
|
|
419
|
+
const { detectCwdPassthrough, SUPPRESS_CWD_WARN_ENV } = await import("./cwdPassthroughHint-h4dQQCLO.js");
|
|
404
420
|
const dep = detectCwdPassthrough(process.argv);
|
|
405
421
|
if (dep) {
|
|
406
422
|
console.warn(dep.message);
|
|
@@ -410,8 +426,13 @@ function buildRustArgs(argv, cliFromScript, supportedClis) {
|
|
|
410
426
|
await checkAndAutoUpdate();
|
|
411
427
|
logger.info(versionString());
|
|
412
428
|
const config = parseCliArgs(process.argv);
|
|
429
|
+
const { loadCascadingConfig } = await import("./configLoader-D9O9zwKR.js");
|
|
430
|
+
const { planClaudeStream } = await import("./launch-CMran68t.js");
|
|
431
|
+
const streamCliConfig = (await loadCascadingConfig()).clis?.[config.cli];
|
|
432
|
+
if (config.stream && config.cli !== "claude") throw new Error("--stream currently supports claude only");
|
|
433
|
+
const streamLaunch = planClaudeStream(config.cli, [...streamCliConfig?.defaultArgs ?? [], ...config.nativeArgs], config.explicitPrompt, config.stream);
|
|
413
434
|
{
|
|
414
|
-
const { stripDetachFlag } = await import("./forkNested-
|
|
435
|
+
const { stripDetachFlag } = await import("./forkNested-CVSWfZT6.js");
|
|
415
436
|
const res = stripDetachFlag(process.argv.slice(2), Boolean(config.detach));
|
|
416
437
|
if (!res.ok) {
|
|
417
438
|
console.error(res.error);
|
|
@@ -423,21 +444,21 @@ if (config.detach && (config.attach || process.env.AGENT_YES_ATTACH === "1")) {
|
|
|
423
444
|
console.error("--detach and --attach (or AGENT_YES_ATTACH=1) contradict each other.");
|
|
424
445
|
process.exit(1);
|
|
425
446
|
}
|
|
426
|
-
if (config.detach && !config.useRust) {
|
|
447
|
+
if (config.detach && !config.useRust && !streamLaunch) {
|
|
427
448
|
console.error("--detach needs the Rust runtime (drop --no-rust / AGENT_YES_NO_RUST).");
|
|
428
449
|
process.exit(1);
|
|
429
450
|
}
|
|
430
451
|
if (config.tray) {
|
|
431
|
-
const { startTray } = await import("./tray-
|
|
452
|
+
const { startTray } = await import("./tray-C4sCiT8B.js");
|
|
432
453
|
await startTray();
|
|
433
454
|
await new Promise(() => {});
|
|
434
455
|
}
|
|
435
456
|
{
|
|
436
|
-
const { ensureTray } = await import("./tray-
|
|
457
|
+
const { ensureTray } = await import("./tray-C4sCiT8B.js");
|
|
437
458
|
ensureTray();
|
|
438
459
|
}
|
|
439
460
|
if (!config.showVersion && !config.appendPrompt && !config.tray) {
|
|
440
|
-
const { waitForSpawnCapacity } = await import("./spawnGate-
|
|
461
|
+
const { waitForSpawnCapacity } = await import("./spawnGate-Ky21E51l.js");
|
|
441
462
|
await waitForSpawnCapacity({
|
|
442
463
|
onWait: (reason, waitedMs) => {
|
|
443
464
|
if (config.verbose || waitedMs === 0) console.error(`[agent-yes] spawn gate: ${reason} — waiting…`);
|
|
@@ -446,9 +467,33 @@ if (!config.showVersion && !config.appendPrompt && !config.tray) {
|
|
|
446
467
|
});
|
|
447
468
|
}
|
|
448
469
|
if (!config.showVersion && !config.appendPrompt && !config.tray) {
|
|
449
|
-
const { warnIfCwdOccupied } = await import("./cwdConflictWarn-
|
|
470
|
+
const { warnIfCwdOccupied } = await import("./cwdConflictWarn-BQ8vH915.js");
|
|
450
471
|
await warnIfCwdOccupied(process.argv);
|
|
451
472
|
}
|
|
473
|
+
if (streamLaunch) {
|
|
474
|
+
const { runStream } = await import("./runner-B1vocYOj.js");
|
|
475
|
+
const args = [...streamLaunch.args];
|
|
476
|
+
if (config.skipPermissions) args.push("--dangerously-skip-permissions");
|
|
477
|
+
if (config.resume) args.push("--continue");
|
|
478
|
+
if (config.detach) {
|
|
479
|
+
const { detachStream } = await import("./detach-B_n7xRl2.js");
|
|
480
|
+
const record = await detachStream({
|
|
481
|
+
entry: process.argv[1],
|
|
482
|
+
args: process.argv.slice(2),
|
|
483
|
+
cwd: config.cwd
|
|
484
|
+
});
|
|
485
|
+
console.log(`Spawned ${record.cli} stream session as pid ${record.pid}.`);
|
|
486
|
+
console.log(` ay tail ${record.pid}\n ay send ${record.pid} "message"`);
|
|
487
|
+
process.exit(0);
|
|
488
|
+
}
|
|
489
|
+
process.exit(await runStream({
|
|
490
|
+
...config,
|
|
491
|
+
...streamLaunch,
|
|
492
|
+
cliArgs: args,
|
|
493
|
+
binary: streamCliConfig?.binary,
|
|
494
|
+
input: process.stdin.isTTY ? void 0 : process.stdin
|
|
495
|
+
}));
|
|
496
|
+
}
|
|
452
497
|
if (config.useRust) {
|
|
453
498
|
let rustBinary;
|
|
454
499
|
try {
|
|
@@ -464,14 +509,14 @@ if (config.useRust) {
|
|
|
464
509
|
process.exit(1);
|
|
465
510
|
}
|
|
466
511
|
if (rustBinary) {
|
|
467
|
-
const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-
|
|
512
|
+
const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-Ce_7n97m.js");
|
|
468
513
|
const rustArgs = buildRustArgs(process.argv, config.cli, SUPPORTED_CLIS);
|
|
469
514
|
if (config.verbose) {
|
|
470
515
|
console.log(`[rust] Using binary: ${rustBinary}`);
|
|
471
516
|
console.log(`[rust] Args: ${rustArgs.join(" ")}`);
|
|
472
517
|
}
|
|
473
518
|
const attach = config.attach || process.env.AGENT_YES_ATTACH === "1";
|
|
474
|
-
const { shouldForkNested, buildSpawnTutorial, waitForRegistration, confirmAgentStarted, predictedLogPath } = await import("./forkNested-
|
|
519
|
+
const { shouldForkNested, buildSpawnTutorial, waitForRegistration, confirmAgentStarted, predictedLogPath } = await import("./forkNested-CVSWfZT6.js");
|
|
475
520
|
if (shouldForkNested({
|
|
476
521
|
isTTY: Boolean(process.stdout.isTTY),
|
|
477
522
|
ayPid: process.env.AGENT_YES_PID,
|
|
@@ -539,7 +584,7 @@ if (config.showVersion) {
|
|
|
539
584
|
process.exit(0);
|
|
540
585
|
}
|
|
541
586
|
if (config.appendPrompt) {
|
|
542
|
-
const { PidStore } = await import("./pidStore-
|
|
587
|
+
const { PidStore } = await import("./pidStore-BRU1Q0uN.js");
|
|
543
588
|
const ipcPath = await PidStore.findActiveFifo(process.cwd());
|
|
544
589
|
if (!ipcPath) {
|
|
545
590
|
console.error("No active agent with IPC found in current directory.");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as pidOwnershipVerdict } from "./senderAncestry-
|
|
1
|
+
import { o as pidOwnershipVerdict } from "./senderAncestry-DqbNIecg.js";
|
|
2
2
|
import yargs from "yargs";
|
|
3
3
|
|
|
4
4
|
//#region ts/cmdKill.ts
|
|
@@ -54,7 +54,7 @@ async function cmdKill(rest) {
|
|
|
54
54
|
return 1;
|
|
55
55
|
}
|
|
56
56
|
const pid = Number(sel);
|
|
57
|
-
const { readGlobalPids, updateGlobalPidStatus } = await import("./globalPidIndex-
|
|
57
|
+
const { readGlobalPids, updateGlobalPidStatus } = await import("./globalPidIndex-B5c_g_yJ.js");
|
|
58
58
|
const matches = (await readGlobalPids()).filter((r) => r.pid === pid);
|
|
59
59
|
if (matches.length !== 1) {
|
|
60
60
|
process.stderr.write(matches.length === 0 ? `ay kill: no registered agent has pid ${pid} (see: ay ls --all)\n` : `ay kill: ${matches.length} registry rows claim pid ${pid} — refusing an ambiguous kill\n`);
|
|
@@ -65,7 +65,7 @@ async function cmdKill(rest) {
|
|
|
65
65
|
process.stderr.write(`ay kill: pid ${pid} is registered as exited — refusing: the number may belong to another process by now\n`);
|
|
66
66
|
return 1;
|
|
67
67
|
}
|
|
68
|
-
const { ancestorPids, pidOwnershipVerdict, readAncestryTable } = await import("./senderAncestry-
|
|
68
|
+
const { ancestorPids, pidOwnershipVerdict, readAncestryTable } = await import("./senderAncestry-Brb-cYni.js");
|
|
69
69
|
const table = await readAncestryTable();
|
|
70
70
|
const selfPgid = await ownPgid();
|
|
71
71
|
if (!table || !selfPgid) {
|
|
@@ -76,7 +76,7 @@ async function cmdKill(rest) {
|
|
|
76
76
|
process.stderr.write(`ay kill: pid ${pid} is alive but is NOT the agent that registered it (the number was reused) — refusing. Retire the stale row with: ay stop ${pid}\n`);
|
|
77
77
|
return 1;
|
|
78
78
|
}
|
|
79
|
-
const { forceKill, forceKillTargets } = await import("./forceKill-
|
|
79
|
+
const { forceKill, forceKillTargets } = await import("./forceKill-BAqKNR_f.js");
|
|
80
80
|
const targets = await forceKillTargets(record);
|
|
81
81
|
const reusedWrapper = reusedWrapperPid(record, table);
|
|
82
82
|
if (reusedWrapper) {
|
|
@@ -113,4 +113,4 @@ async function cmdKill(rest) {
|
|
|
113
113
|
|
|
114
114
|
//#endregion
|
|
115
115
|
export { cmdKill };
|
|
116
|
-
//# sourceMappingURL=cmdKill-
|
|
116
|
+
//# sourceMappingURL=cmdKill-b5I7H8wx.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import "./logger-CDIsZ-Pp.js";
|
|
2
|
-
import "./JsonlStore-
|
|
3
|
-
import "./globalPidIndex-
|
|
4
|
-
import "./pidStore-
|
|
5
|
-
import "./messageLog-
|
|
6
|
-
import "./e2e-
|
|
7
|
-
import "./configShared-
|
|
8
|
-
import { Dt as buildAgentForest, G as listRecords, Ot as flattenForest, y as deriveLiveState } from "./subcommands-
|
|
9
|
-
import "./webrtcLink-
|
|
10
|
-
import "./remotes-
|
|
11
|
-
import "./roomReplyAlias-
|
|
12
|
-
import "./notifyStore-
|
|
13
|
-
import "./senderAncestry-
|
|
14
|
-
import { i as systemStats, n as sampleTrees, r as snapshotProcs, t as humanBytes } from "./procStats-
|
|
2
|
+
import "./JsonlStore-fEAVg5aY.js";
|
|
3
|
+
import "./globalPidIndex-D9fxq9Ad.js";
|
|
4
|
+
import "./pidStore-DXEbQrh-.js";
|
|
5
|
+
import "./messageLog-BrXNxItW.js";
|
|
6
|
+
import "./e2e-C34A1uYu.js";
|
|
7
|
+
import "./configShared-B9gyn11R.js";
|
|
8
|
+
import { Dt as buildAgentForest, G as listRecords, Ot as flattenForest, y as deriveLiveState } from "./subcommands-BJezWaHi.js";
|
|
9
|
+
import "./webrtcLink-D4pMhyvY.js";
|
|
10
|
+
import "./remotes-B0vw-dsd.js";
|
|
11
|
+
import "./roomReplyAlias-CkfEtW2v.js";
|
|
12
|
+
import "./notifyStore-CNdHlJyW.js";
|
|
13
|
+
import "./senderAncestry-DqbNIecg.js";
|
|
14
|
+
import { i as systemStats, n as sampleTrees, r as snapshotProcs, t as humanBytes } from "./procStats-CkzFrwx7.js";
|
|
15
15
|
import { readFileSync } from "node:fs";
|
|
16
16
|
import path from "node:path";
|
|
17
17
|
import yargs from "yargs";
|
|
@@ -332,4 +332,4 @@ function readPpidSync(pid) {
|
|
|
332
332
|
|
|
333
333
|
//#endregion
|
|
334
334
|
export { cmdPs };
|
|
335
|
-
//# sourceMappingURL=cmdPs-
|
|
335
|
+
//# sourceMappingURL=cmdPs-RZU-tTd4.js.map
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
import { n as logger } from "./logger-CDIsZ-Pp.js";
|
|
2
|
-
import { n as normalizeAgentYesConfig
|
|
2
|
+
import { n as normalizeAgentYesConfig } from "./configShared-B9gyn11R.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import os from "node:os";
|
|
5
|
-
import { access,
|
|
5
|
+
import { access, readFile, writeFile } from "node:fs/promises";
|
|
6
6
|
import { parse } from "yaml";
|
|
7
7
|
|
|
8
|
-
//#region ts/defineConfig.ts
|
|
9
|
-
async function defineCliYesConfig(cfg) {
|
|
10
|
-
if (typeof cfg === "function") cfg = await cfg({ clis: {} });
|
|
11
|
-
return cfg;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
//#endregion
|
|
15
8
|
//#region ts/utils.ts
|
|
16
9
|
function deepMixin(target, source, ...more) {
|
|
17
10
|
for (const key in source) if (source[key] && typeof source[key] === "object" && !Array.isArray(source[key])) {
|
|
@@ -194,36 +187,5 @@ async function ensureSchemaInConfigFiles(options = {}) {
|
|
|
194
187
|
}
|
|
195
188
|
|
|
196
189
|
//#endregion
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
ensureSchemaInConfigFiles().catch(() => {});
|
|
200
|
-
const configDir = await (async () => {
|
|
201
|
-
const homeConfigDir = path.resolve(os.homedir(), ".agent-yes");
|
|
202
|
-
if (await mkdir(homeConfigDir, { recursive: true }).then(() => true).catch(() => false)) {
|
|
203
|
-
logger.debug("[config] Using home directory:", homeConfigDir);
|
|
204
|
-
return homeConfigDir;
|
|
205
|
-
}
|
|
206
|
-
const tmpConfigDir = path.resolve("/tmp/.agent-yes");
|
|
207
|
-
if (await mkdir(tmpConfigDir, { recursive: true })) {
|
|
208
|
-
logger.debug("[config] Using workspace directory:", tmpConfigDir);
|
|
209
|
-
return tmpConfigDir;
|
|
210
|
-
}
|
|
211
|
-
})();
|
|
212
|
-
const cascadingConfig = await loadCascadingConfig();
|
|
213
|
-
const legacyConfigs = await Promise.all([
|
|
214
|
-
import(path.resolve(os.homedir(), ".agent-yes/config.ts")).catch(() => ({ default: {} })).then((mod) => mod.default),
|
|
215
|
-
import(path.resolve(process.cwd(), "node_modules/.agent-yes/config.ts")).catch(() => ({ default: {} })).then((mod) => mod.default),
|
|
216
|
-
import(path.resolve(process.cwd(), ".agent-yes/config.ts")).catch(() => ({ default: {} })).then((mod) => mod.default)
|
|
217
|
-
]);
|
|
218
|
-
var agent_yes_config_default = deepMixin(await getDefaultConfig(), cascadingConfig, ...legacyConfigs);
|
|
219
|
-
async function getDefaultConfig() {
|
|
220
|
-
return defineCliYesConfig({
|
|
221
|
-
configDir,
|
|
222
|
-
logsDir: configDir && path.resolve(configDir, "logs"),
|
|
223
|
-
clis: await loadSharedCliDefaults(import.meta.url)
|
|
224
|
-
});
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
//#endregion
|
|
228
|
-
export { agent_yes_config_default as default };
|
|
229
|
-
//# sourceMappingURL=agent-yes.config-CRfpdp3A.js.map
|
|
190
|
+
export { loadCascadingConfig as n, deepMixin as r, ensureSchemaInConfigFiles as t };
|
|
191
|
+
//# sourceMappingURL=configLoader-CLSX_LND.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./logger-CDIsZ-Pp.js";
|
|
2
|
-
import { o as readGlobalPids } from "./globalPidIndex-
|
|
2
|
+
import { o as readGlobalPids } from "./globalPidIndex-D9fxq9Ad.js";
|
|
3
3
|
import path from "path";
|
|
4
4
|
|
|
5
5
|
//#region ts/cwdConflictWarn.ts
|
|
@@ -77,4 +77,4 @@ async function warnIfCwdOccupied(rawArgv) {
|
|
|
77
77
|
|
|
78
78
|
//#endregion
|
|
79
79
|
export { warnIfCwdOccupied };
|
|
80
|
-
//# sourceMappingURL=cwdConflictWarn-
|
|
80
|
+
//# sourceMappingURL=cwdConflictWarn-BQ8vH915.js.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import "./logger-CDIsZ-Pp.js";
|
|
2
|
+
import { o as readGlobalPids } from "./globalPidIndex-D9fxq9Ad.js";
|
|
3
|
+
import { closeSync, mkdirSync, openSync } from "node:fs";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { randomUUID } from "node:crypto";
|
|
6
|
+
import { spawn } from "node:child_process";
|
|
7
|
+
import { readFile } from "node:fs/promises";
|
|
8
|
+
|
|
9
|
+
//#region ts/stream/detach.ts
|
|
10
|
+
/** Start a TS wrapper and return only once its canonical CLI pid is discoverable. */
|
|
11
|
+
async function detachStream(options) {
|
|
12
|
+
const dir = path.join(options.cwd, ".agent-yes");
|
|
13
|
+
mkdirSync(dir, { recursive: true });
|
|
14
|
+
const errorFile = path.join(dir, `stream-start-${randomUUID()}.log`);
|
|
15
|
+
const errorFd = openSync(errorFile, "wx", 384);
|
|
16
|
+
const child = spawn(process.execPath, [options.entry, ...options.args], {
|
|
17
|
+
cwd: options.cwd,
|
|
18
|
+
detached: true,
|
|
19
|
+
stdio: [
|
|
20
|
+
"ignore",
|
|
21
|
+
"ignore",
|
|
22
|
+
errorFd
|
|
23
|
+
],
|
|
24
|
+
env: {
|
|
25
|
+
...process.env,
|
|
26
|
+
AGENT_YES_ATTACH: "1",
|
|
27
|
+
AGENT_YES_NO_CWD_WARN: "1"
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
closeSync(errorFd);
|
|
31
|
+
let failure;
|
|
32
|
+
child.on("error", (error) => {
|
|
33
|
+
failure = error.message;
|
|
34
|
+
});
|
|
35
|
+
child.on("exit", (code, signal) => {
|
|
36
|
+
failure = `wrapper exited (${signal ?? code})`;
|
|
37
|
+
});
|
|
38
|
+
const startedAt = Date.now();
|
|
39
|
+
const deadline = startedAt + (options.timeoutMs ?? 5e3);
|
|
40
|
+
try {
|
|
41
|
+
while (Date.now() < deadline) {
|
|
42
|
+
const record = (await readGlobalPids()).find((record) => child.pid !== void 0 && record.wrapper_pid === child.pid && record.started_at >= startedAt - 1e3);
|
|
43
|
+
if (record && (record.status !== "exited" || record.exit_code === 0)) return record;
|
|
44
|
+
if (record?.status === "exited") failure = `CLI exited (${record.exit_code})`;
|
|
45
|
+
if (failure) break;
|
|
46
|
+
await new Promise((resolve) => setTimeout(resolve, 25));
|
|
47
|
+
}
|
|
48
|
+
const detail = (await readFile(errorFile, "utf8").catch(() => "")).trim().slice(-1500);
|
|
49
|
+
child.kill("SIGTERM");
|
|
50
|
+
throw new Error(`Stream launch failed: ${failure ?? "no agent registered within the startup timeout"}${detail ? `\n${detail}` : ""}`);
|
|
51
|
+
} finally {
|
|
52
|
+
child.unref();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
//#endregion
|
|
57
|
+
export { detachStream };
|
|
58
|
+
//# sourceMappingURL=detach-B_n7xRl2.js.map
|
|
@@ -172,4 +172,4 @@ function randomHex(n) {
|
|
|
172
172
|
|
|
173
173
|
//#endregion
|
|
174
174
|
export { computeTranscriptHash as a, open as c, randomHex as d, seal as f, MAX_CHUNK as i, packEnvelope as l, validateS as m, FLAG_CONFIRM as n, deriveAuthToken as o, unpackEnvelope as p, MARKER as r, deriveDirKeys as s, CONFIRM_TIMEOUT_MS as t, parseSecret as u };
|
|
175
|
-
//# sourceMappingURL=e2e-
|
|
175
|
+
//# sourceMappingURL=e2e-C34A1uYu.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as pgidForWrapper } from "./reaper-
|
|
1
|
+
import { t as pgidForWrapper } from "./reaper-BTfq0-5j.js";
|
|
2
2
|
|
|
3
3
|
//#region ts/forceKill.ts
|
|
4
4
|
/** What forceKill would signal, without signalling it. */
|
|
@@ -41,4 +41,4 @@ function forceKill(targets) {
|
|
|
41
41
|
|
|
42
42
|
//#endregion
|
|
43
43
|
export { forceKill, forceKillTargets };
|
|
44
|
-
//# sourceMappingURL=forceKill-
|
|
44
|
+
//# sourceMappingURL=forceKill-BAqKNR_f.js.map
|
|
@@ -102,7 +102,7 @@ function buildSpawnTutorial(cli, pid) {
|
|
|
102
102
|
* fast instead of waiting out the whole window).
|
|
103
103
|
*/
|
|
104
104
|
async function waitForRegistration(pid, timeoutMs = 5e3, aborted) {
|
|
105
|
-
const { readGlobalPids } = await import("./globalPidIndex-
|
|
105
|
+
const { readGlobalPids } = await import("./globalPidIndex-B5c_g_yJ.js");
|
|
106
106
|
const isRegistered = async () => (await readGlobalPids()).some((r) => r.pid === pid && r.status !== "exited");
|
|
107
107
|
const deadline = Date.now() + timeoutMs;
|
|
108
108
|
while (Date.now() < deadline) {
|
|
@@ -150,7 +150,7 @@ async function tailFile(file, max = 400) {
|
|
|
150
150
|
* success, keeping the previous behaviour for anything this can't decide.
|
|
151
151
|
*/
|
|
152
152
|
async function confirmAgentStarted(pid, graceMs = 1500, aborted) {
|
|
153
|
-
const { readGlobalPids } = await import("./globalPidIndex-
|
|
153
|
+
const { readGlobalPids } = await import("./globalPidIndex-B5c_g_yJ.js");
|
|
154
154
|
const { stat } = await import("fs/promises");
|
|
155
155
|
const deadline = Date.now() + graceMs;
|
|
156
156
|
while (Date.now() < deadline) {
|
|
@@ -181,4 +181,4 @@ async function confirmAgentStarted(pid, graceMs = 1500, aborted) {
|
|
|
181
181
|
|
|
182
182
|
//#endregion
|
|
183
183
|
export { buildSpawnTutorial, confirmAgentStarted, predictedLogPath, shouldForkNested, stripDetachFlag, waitForRegistration };
|
|
184
|
-
//# sourceMappingURL=forkNested-
|
|
184
|
+
//# sourceMappingURL=forkNested-CVSWfZT6.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "./logger-CDIsZ-Pp.js";
|
|
2
|
-
import { a as pruneOldLogs, c as updateGlobalPidStatus, i as maybeCompactGlobalPids, n as gcLogs, o as readGlobalPids, r as getGlobalPidIndexPath, s as sweepOrphanLogs, t as appendGlobalPid } from "./globalPidIndex-
|
|
2
|
+
import { a as pruneOldLogs, c as updateGlobalPidStatus, i as maybeCompactGlobalPids, n as gcLogs, o as readGlobalPids, r as getGlobalPidIndexPath, s as sweepOrphanLogs, t as appendGlobalPid } from "./globalPidIndex-D9fxq9Ad.js";
|
|
3
3
|
|
|
4
4
|
export { gcLogs, readGlobalPids, updateGlobalPidStatus };
|
|
@@ -98,7 +98,15 @@ async function readGlobalPidsRaw(file = resolveGlobalFile()) {
|
|
|
98
98
|
* Optionally filter to live processes only.
|
|
99
99
|
*/
|
|
100
100
|
async function readGlobalPids(opts = {}) {
|
|
101
|
-
const records = await readGlobalPidsRaw()
|
|
101
|
+
const records = await Promise.all((await readGlobalPidsRaw()).map(async (record) => {
|
|
102
|
+
if (record.mode != null || typeof record.cwd !== "string" || typeof record.started_at !== "number") return record;
|
|
103
|
+
const info = await stat(path.join(record.cwd, ".agent-yes", `${record.pid}.events.jsonl`)).catch(() => null);
|
|
104
|
+
if (info?.isFile() && info.mtimeMs >= record.started_at - 1e3) return {
|
|
105
|
+
...record,
|
|
106
|
+
mode: "stream"
|
|
107
|
+
};
|
|
108
|
+
return record;
|
|
109
|
+
}));
|
|
102
110
|
if (!opts.liveOnly) return records;
|
|
103
111
|
return records.filter((r) => r.status !== "exited" && isProcessAlive(r.pid));
|
|
104
112
|
}
|
|
@@ -319,4 +327,4 @@ async function gcLogs(maxAgeMs = retentionMs()) {
|
|
|
319
327
|
|
|
320
328
|
//#endregion
|
|
321
329
|
export { pruneOldLogs as a, updateGlobalPidStatus as c, maybeCompactGlobalPids as i, gcLogs as n, readGlobalPids as o, getGlobalPidIndexPath as r, sweepOrphanLogs as s, appendGlobalPid as t };
|
|
322
|
-
//# sourceMappingURL=globalPidIndex-
|
|
330
|
+
//# sourceMappingURL=globalPidIndex-D9fxq9Ad.js.map
|
|
@@ -10895,4 +10895,4 @@ const html2canvas = (element, options = {}, config) => {
|
|
|
10895
10895
|
|
|
10896
10896
|
//#endregion
|
|
10897
10897
|
export { Html2CanvasConfig, PerformanceMonitor, Validator, createDefaultValidator, html2canvas as default, html2canvas };
|
|
10898
|
-
//# sourceMappingURL=html2canvas-pro.esm-
|
|
10898
|
+
//# sourceMappingURL=html2canvas-pro.esm-BW1GOcB-.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as safeBranch, i as readGitBranch, n as localHost, o as safeToken, r as localUser, s as tildify, t as formatIdentity } from "./identity-
|
|
1
|
+
import { a as safeBranch, i as readGitBranch, n as localHost, o as safeToken, r as localUser, s as tildify, t as formatIdentity } from "./identity-CtwRW1nD.js";
|
|
2
2
|
|
|
3
3
|
export { formatIdentity };
|
|
@@ -106,4 +106,4 @@ function formatIdentity(parts) {
|
|
|
106
106
|
|
|
107
107
|
//#endregion
|
|
108
108
|
export { safeBranch as a, readGitBranch as i, localHost as n, safeToken as o, localUser as r, tildify as s, formatIdentity as t };
|
|
109
|
-
//# sourceMappingURL=identity-
|
|
109
|
+
//# sourceMappingURL=identity-CtwRW1nD.js.map
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "./logger-CDIsZ-Pp.js";
|
|
2
|
-
import "./versionChecker-
|
|
3
|
-
import { a as hasTodoStore,
|
|
4
|
-
import { a as renderTree, c as describeBlock, i as renderDigest, l as monitorHint, o as unblockedTasks, r as openBlockers, t as reconcileTodos, u as removeControlCharacters } from "./todoAutomation-
|
|
5
|
-
import "./JsonlStore-
|
|
6
|
-
import "./globalPidIndex-
|
|
7
|
-
import "./pidStore-
|
|
8
|
-
import "./messageLog-
|
|
9
|
-
import { a as LIFECYCLES, c as initialState, d as requiredGate, f as statesOf, i as DONE_STATE, l as isKnownKind, n as TodoStore, o as ORPHANED_STATE, r as openStore, s as canTransition, t as CycleError, u as nextStates } from "./todoStore-
|
|
2
|
+
import "./versionChecker-DcrK7m4z.js";
|
|
3
|
+
import { a as hasTodoStore, c as AgentContext, i as answerAsk, n as agentYes, o as listAsks, r as config, s as listAsksForProject, t as CLIS_CONFIG } from "./ts-J77_edCv.js";
|
|
4
|
+
import { a as renderTree, c as describeBlock, i as renderDigest, l as monitorHint, o as unblockedTasks, r as openBlockers, t as reconcileTodos, u as removeControlCharacters } from "./todoAutomation-KgmnTAsD.js";
|
|
5
|
+
import "./JsonlStore-fEAVg5aY.js";
|
|
6
|
+
import "./globalPidIndex-D9fxq9Ad.js";
|
|
7
|
+
import "./pidStore-DXEbQrh-.js";
|
|
8
|
+
import "./messageLog-BrXNxItW.js";
|
|
9
|
+
import { a as LIFECYCLES, c as initialState, d as requiredGate, f as statesOf, i as DONE_STATE, l as isKnownKind, n as TodoStore, o as ORPHANED_STATE, r as openStore, s as canTransition, t as CycleError, u as nextStates } from "./todoStore-Dre3Yhwt.js";
|
|
10
10
|
|
|
11
11
|
export { AgentContext, CLIS_CONFIG, CycleError, DONE_STATE, LIFECYCLES, ORPHANED_STATE, TodoStore, answerAsk, canTransition, config, agentYes as default, describeBlock, hasTodoStore, initialState, isKnownKind, listAsks, listAsksForProject, monitorHint, nextStates, openBlockers, openStore, reconcileTodos, removeControlCharacters, renderDigest, renderTree, requiredGate, statesOf, unblockedTasks };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
//#region ts/stream/launch.ts
|
|
2
|
+
/** Read the last native flag value, including --flag=value spelling. */
|
|
3
|
+
function nativeFlagValue(args, flag) {
|
|
4
|
+
let value;
|
|
5
|
+
for (let i = 0; i < args.length; i++) {
|
|
6
|
+
if (args[i] === "--") break;
|
|
7
|
+
if (args[i] === flag) value = args[++i];
|
|
8
|
+
else if (args[i]?.startsWith(flag + "=")) value = args[i].slice(flag.length + 1);
|
|
9
|
+
}
|
|
10
|
+
return value;
|
|
11
|
+
}
|
|
12
|
+
function isClaudeStream(cli, args) {
|
|
13
|
+
return cli === "claude" && nativeFlagValue(args, "--output-format") === "stream-json";
|
|
14
|
+
}
|
|
15
|
+
/** --stream is only sugar for explicitly requesting Claude's native protocol. */
|
|
16
|
+
function withStreamFlags(args) {
|
|
17
|
+
return [
|
|
18
|
+
...args,
|
|
19
|
+
"-p",
|
|
20
|
+
"--input-format",
|
|
21
|
+
"stream-json",
|
|
22
|
+
"--output-format",
|
|
23
|
+
"stream-json",
|
|
24
|
+
"--verbose",
|
|
25
|
+
"--replay-user-messages",
|
|
26
|
+
"--permission-prompt-tool",
|
|
27
|
+
"stdio"
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
/** Split native Claude arguments from its task, without treating boolean flags as values. */
|
|
31
|
+
function planClaudeStream(cli, nativeArgs, explicitPrompt, sugar = false) {
|
|
32
|
+
const separator = nativeArgs.indexOf("--");
|
|
33
|
+
const end = separator === -1 ? nativeArgs.length : separator;
|
|
34
|
+
const candidate = sugar ? [...withStreamFlags(nativeArgs.slice(0, end)), ...nativeArgs.slice(end)] : [...nativeArgs];
|
|
35
|
+
if (!isClaudeStream(cli, candidate)) return null;
|
|
36
|
+
const args = [];
|
|
37
|
+
const words = [];
|
|
38
|
+
const booleans = new Set([
|
|
39
|
+
"-p",
|
|
40
|
+
"--print",
|
|
41
|
+
"--verbose",
|
|
42
|
+
"--replay-user-messages",
|
|
43
|
+
"--continue",
|
|
44
|
+
"-c",
|
|
45
|
+
"--dangerously-skip-permissions",
|
|
46
|
+
"--allow-dangerously-skip-permissions",
|
|
47
|
+
"--no-session-persistence",
|
|
48
|
+
"--strict-mcp-config",
|
|
49
|
+
"--disable-slash-commands",
|
|
50
|
+
"--include-partial-messages",
|
|
51
|
+
"--include-hook-events"
|
|
52
|
+
]);
|
|
53
|
+
for (let i = 0; i < candidate.length; i++) {
|
|
54
|
+
const arg = candidate[i];
|
|
55
|
+
if (arg === "--") {
|
|
56
|
+
words.push(...candidate.slice(i + 1));
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
if (!arg.startsWith("-")) {
|
|
60
|
+
words.push(arg);
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
args.push(arg);
|
|
64
|
+
if (!arg.includes("=") && !booleans.has(arg) && candidate[i + 1] && !candidate[i + 1].startsWith("-")) args.push(candidate[++i]);
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
args,
|
|
68
|
+
prompt: [explicitPrompt, ...words].filter(Boolean).join(" ") || void 0
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
//#endregion
|
|
73
|
+
export { withStreamFlags as i, nativeFlagValue as n, planClaudeStream as r, isClaudeStream as t };
|
|
74
|
+
//# sourceMappingURL=launch-BlKMU2ZA.js.map
|
|
@@ -233,4 +233,4 @@ async function readMailbox(cwd, box) {
|
|
|
233
233
|
|
|
234
234
|
//#endregion
|
|
235
235
|
export { recordOutbox as a, isTerminalReply as c, recordMessage as i, readMailbox as n, senderLabel as o, recordInbox as r, isRedundantViewerReply as s, partyMatches as t };
|
|
236
|
-
//# sourceMappingURL=messageLog-
|
|
236
|
+
//# sourceMappingURL=messageLog-BrXNxItW.js.map
|