agent-yes 1.196.2 → 1.197.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/default.config.yaml +51 -12
- package/dist/{SUPPORTED_CLIS-BuiThZSF.js → SUPPORTED_CLIS-BY83eM58.js} +2 -2
- package/dist/SUPPORTED_CLIS-D4Z--hGm.js +9 -0
- package/dist/{agent-yes.config-ugPYTPOd.js → agent-yes.config-whqkqq9P.js} +2 -2
- package/dist/{agentShare-BMZVmm7c.js → agentShare-DWioPObE.js} +8 -7
- package/dist/cli.js +8 -8
- package/dist/{configShared-0MnIQ652.js → configShared-aKTg-sa5.js} +1 -1
- package/dist/{e2e-BeKjLhmO.js → e2e-jb0Hp43q.js} +1 -1
- package/dist/{expose-B3AGhVhM.js → expose-k9l6ZJDA.js} +1 -1
- package/dist/{forkNested-C1kKsXi5.js → forkNested-DOyDAHnC.js} +1 -1
- package/dist/index.js +3 -2
- package/dist/messageLog-CxrKJj77.js +94 -0
- package/dist/{nodeRuntime-DZRjxpNp.js → nodeRuntime-CwNJuwH5.js} +1 -1
- package/dist/{notifyDaemon-Cikn_qKr.js → notifyDaemon-CRf_27kE.js} +7 -6
- package/dist/{openBrowser-DQVkxCyj.js → openBrowser-CSj21pZE.js} +1 -1
- package/dist/{reaper-CWF2_ATd.js → reaper-BUHCyxdF.js} +1 -1
- package/dist/{reaper-jfSmog15.js → reaper-CJSu8UVZ.js} +1 -1
- package/dist/{remotes-CW-yxSgW.js → remotes-CXqYR0p8.js} +3 -3
- package/dist/{remotes-oSmwSYaV.js → remotes-Cim0dBU7.js} +3 -3
- package/dist/{rustBinary-Uxkcz3zV.js → rustBinary-5HCt7_0b.js} +2 -2
- package/dist/{schedule-cvu-t8uo.js → schedule-CjBcOy-b.js} +7 -6
- package/dist/{serve-Cp9XGHAg.js → serve-C3E8uicL.js} +45 -26
- package/dist/{setup-onV23tOF.js → setup-C4SKqGy1.js} +3 -3
- package/dist/{share-29YbzpbU.js → share-BfIU8t_h.js} +2 -2
- package/dist/{share-nvqy64A2.js → share-Ciw1mWVN.js} +2 -2
- package/dist/{spawnGate-CWbdnJ5K.js → spawnGate-BkjeS4tg.js} +1 -1
- package/dist/{spawnGate-DRWa_Fzj.js → spawnGate-CXjEz6Pf.js} +2 -2
- package/dist/{subcommands-Dwzo0rx_.js → subcommands-B7UxIJRw.js} +17 -103
- package/dist/{subcommands-BReg256R.js → subcommands-DzWBZ6HE.js} +6 -5
- package/dist/{tray-BKTZ5gIf.js → tray-BSFi35Qg.js} +1 -1
- package/dist/{ts-ml_9eD1Y.js → ts-B64pNQlI.js} +84 -7
- package/dist/{versionChecker-ufJXjxRK.js → versionChecker-DKiSuTSp.js} +2 -2
- package/dist/{webrtcLink-BG0Xc4-W.js → webrtcLink-B7REGtK2.js} +2 -2
- package/dist/{webrtcRemote-BmuVKcrx.js → webrtcRemote-CvIEfWX8.js} +3 -3
- package/dist/{workspaceConfig-_GtAZtsi.js → workspaceConfig-CjaRvTjf.js} +1 -1
- package/package.json +1 -1
- package/ts/autoRetry.spec.ts +90 -1
- package/ts/autoRetry.ts +76 -0
- package/ts/index.ts +37 -4
- package/ts/messageLog.ts +3 -2
- package/ts/serve.ts +4 -5
- package/ts/subcommands.ts +9 -5
- package/ts/terminalReply.spec.ts +36 -0
- package/ts/terminalReply.ts +17 -0
- package/dist/SUPPORTED_CLIS-BBTAJQVG.js +0 -8
package/default.config.yaml
CHANGED
|
@@ -71,7 +71,13 @@ clis:
|
|
|
71
71
|
autoRetry:
|
|
72
72
|
- pattern: "API Error.*Overloaded"
|
|
73
73
|
flags: i
|
|
74
|
-
|
|
74
|
+
# The CLI's transient status toast is a line that is ONLY "Overloaded"
|
|
75
|
+
# (optionally a leading bullet/mark). Whole-line anchored: a task title or
|
|
76
|
+
# prose merely mentioning Overloaded must not arm a spurious retry —
|
|
77
|
+
# rendered task lists / summaries sit on screen next to a ready prompt,
|
|
78
|
+
# which is exactly the arm condition.
|
|
79
|
+
- pattern: '^\s*[·•●⎿✗×]?\s*Overloaded\.?\s*$'
|
|
80
|
+
flags: m
|
|
75
81
|
# "API Error: Response stalled mid-stream. The response above may be
|
|
76
82
|
# incomplete." — the streamed response wedged and the client aborted
|
|
77
83
|
# mid-token. Transient + server-side like Overloaded, so retry with
|
|
@@ -98,11 +104,20 @@ clis:
|
|
|
98
104
|
# a stray "529"/"500" in normal output can't trigger a spurious retry.
|
|
99
105
|
- pattern: 'API Error.{0,4}5\d\d'
|
|
100
106
|
flags: i
|
|
107
|
+
# 429 / rate-limit: anchored to the "API Error" chrome. A bare
|
|
108
|
+
# `rate.?limit` here caused real spurious retries — an on-screen task
|
|
109
|
+
# list ("client ignores rate-limit drop") or an agent's own summary
|
|
110
|
+
# (INGEST_RATE_LIMIT_PER_MIN) armed the loop and typed "retry" into a
|
|
111
|
+
# perfectly healthy session.
|
|
112
|
+
- pattern: 'API Error.{0,4}429'
|
|
113
|
+
flags: i
|
|
114
|
+
- pattern: 'API Error[\s\S]{0,60}rate.?limit'
|
|
115
|
+
flags: i
|
|
101
116
|
- Claude usage limit reached
|
|
102
117
|
- hit your usage limit
|
|
103
|
-
-
|
|
104
|
-
|
|
105
|
-
- pattern:
|
|
118
|
+
# Session/5-hour limit banners keep the distinctive "… limit reached"
|
|
119
|
+
# phrase; a bare "session limit" matched ordinary prose.
|
|
120
|
+
- pattern: '(session|5-hour) limit reached'
|
|
106
121
|
flags: i
|
|
107
122
|
restoreArgs:
|
|
108
123
|
- --continue
|
|
@@ -195,14 +210,26 @@ clis:
|
|
|
195
210
|
autoRetry:
|
|
196
211
|
- pattern: "API Error.*Overloaded"
|
|
197
212
|
flags: i
|
|
198
|
-
-
|
|
213
|
+
# Whole-line-only toast match — see the claude group for why a bare
|
|
214
|
+
# `Overloaded` substring is dangerous (task lists / prose arm retries).
|
|
215
|
+
- pattern: '^\s*[·•●⎿✗×]?\s*Overloaded\.?\s*$'
|
|
216
|
+
flags: m
|
|
199
217
|
- pattern: 'API Error.{0,4}5\d\d'
|
|
200
218
|
flags: i
|
|
219
|
+
# 429 / rate-limit: anchored to the "API Error" chrome. A bare
|
|
220
|
+
# `rate.?limit` here caused real spurious retries — an on-screen task
|
|
221
|
+
# list ("client ignores rate-limit drop") or an agent's own summary
|
|
222
|
+
# (INGEST_RATE_LIMIT_PER_MIN) armed the loop and typed "retry" into a
|
|
223
|
+
# perfectly healthy session.
|
|
224
|
+
- pattern: 'API Error.{0,4}429'
|
|
225
|
+
flags: i
|
|
226
|
+
- pattern: 'API Error[\s\S]{0,60}rate.?limit'
|
|
227
|
+
flags: i
|
|
201
228
|
- Claude usage limit reached
|
|
202
229
|
- hit your usage limit
|
|
203
|
-
-
|
|
204
|
-
|
|
205
|
-
- pattern:
|
|
230
|
+
# Session/5-hour limit banners keep the distinctive "… limit reached"
|
|
231
|
+
# phrase; a bare "session limit" matched ordinary prose.
|
|
232
|
+
- pattern: '(session|5-hour) limit reached'
|
|
206
233
|
flags: i
|
|
207
234
|
restoreArgs:
|
|
208
235
|
- --continue
|
|
@@ -300,14 +327,26 @@ clis:
|
|
|
300
327
|
autoRetry:
|
|
301
328
|
- pattern: "API Error.*Overloaded"
|
|
302
329
|
flags: i
|
|
303
|
-
-
|
|
330
|
+
# Whole-line-only toast match — see the claude group for why a bare
|
|
331
|
+
# `Overloaded` substring is dangerous (task lists / prose arm retries).
|
|
332
|
+
- pattern: '^\s*[·•●⎿✗×]?\s*Overloaded\.?\s*$'
|
|
333
|
+
flags: m
|
|
304
334
|
- pattern: 'API Error.{0,4}5\d\d'
|
|
305
335
|
flags: i
|
|
336
|
+
# 429 / rate-limit: anchored to the "API Error" chrome. A bare
|
|
337
|
+
# `rate.?limit` here caused real spurious retries — an on-screen task
|
|
338
|
+
# list ("client ignores rate-limit drop") or an agent's own summary
|
|
339
|
+
# (INGEST_RATE_LIMIT_PER_MIN) armed the loop and typed "retry" into a
|
|
340
|
+
# perfectly healthy session.
|
|
341
|
+
- pattern: 'API Error.{0,4}429'
|
|
342
|
+
flags: i
|
|
343
|
+
- pattern: 'API Error[\s\S]{0,60}rate.?limit'
|
|
344
|
+
flags: i
|
|
306
345
|
- Claude usage limit reached
|
|
307
346
|
- hit your usage limit
|
|
308
|
-
-
|
|
309
|
-
|
|
310
|
-
- pattern:
|
|
347
|
+
# Session/5-hour limit banners keep the distinctive "… limit reached"
|
|
348
|
+
# phrase; a bare "session limit" matched ordinary prose.
|
|
349
|
+
- pattern: '(session|5-hour) limit reached'
|
|
311
350
|
flags: i
|
|
312
351
|
restoreArgs:
|
|
313
352
|
- --continue
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as CLIS_CONFIG } from "./ts-
|
|
1
|
+
import { t as CLIS_CONFIG } from "./ts-B64pNQlI.js";
|
|
2
2
|
|
|
3
3
|
//#region ts/SUPPORTED_CLIS.ts
|
|
4
4
|
const SUPPORTED_CLIS = Object.keys(CLIS_CONFIG);
|
|
5
5
|
|
|
6
6
|
//#endregion
|
|
7
7
|
export { SUPPORTED_CLIS as t };
|
|
8
|
-
//# sourceMappingURL=SUPPORTED_CLIS-
|
|
8
|
+
//# sourceMappingURL=SUPPORTED_CLIS-BY83eM58.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "./ts-B64pNQlI.js";
|
|
2
|
+
import "./logger-CDIsZ-Pp.js";
|
|
3
|
+
import "./versionChecker-DKiSuTSp.js";
|
|
4
|
+
import "./pidStore-BIvsBQ8X.js";
|
|
5
|
+
import "./globalPidIndex-CoNr7tS8.js";
|
|
6
|
+
import "./messageLog-CxrKJj77.js";
|
|
7
|
+
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-BY83eM58.js";
|
|
8
|
+
|
|
9
|
+
export { SUPPORTED_CLIS };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as logger } from "./logger-CDIsZ-Pp.js";
|
|
2
|
-
import { n as normalizeAgentYesConfig, t as loadSharedCliDefaults } from "./configShared-
|
|
2
|
+
import { n as normalizeAgentYesConfig, t as loadSharedCliDefaults } from "./configShared-aKTg-sa5.js";
|
|
3
3
|
import os from "node:os";
|
|
4
4
|
import { access, mkdir, readFile, writeFile } from "node:fs/promises";
|
|
5
5
|
import path from "node:path";
|
|
@@ -226,4 +226,4 @@ async function getDefaultConfig() {
|
|
|
226
226
|
|
|
227
227
|
//#endregion
|
|
228
228
|
export { agent_yes_config_default as default };
|
|
229
|
-
//# sourceMappingURL=agent-yes.config-
|
|
229
|
+
//# sourceMappingURL=agent-yes.config-whqkqq9P.js.map
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import "./logger-CDIsZ-Pp.js";
|
|
2
2
|
import "./globalPidIndex-CoNr7tS8.js";
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
5
|
-
import "./
|
|
6
|
-
import "./
|
|
7
|
-
import "./
|
|
8
|
-
import
|
|
3
|
+
import "./messageLog-CxrKJj77.js";
|
|
4
|
+
import "./configShared-aKTg-sa5.js";
|
|
5
|
+
import { M as resolveOne } from "./subcommands-B7UxIJRw.js";
|
|
6
|
+
import "./e2e-jb0Hp43q.js";
|
|
7
|
+
import "./webrtcLink-B7REGtK2.js";
|
|
8
|
+
import "./remotes-Cim0dBU7.js";
|
|
9
|
+
import { r as startShare } from "./share-BfIU8t_h.js";
|
|
9
10
|
|
|
10
11
|
//#region ts/agentShare.ts
|
|
11
12
|
const MAX_SHARES = 8;
|
|
@@ -228,4 +229,4 @@ function transformEvent(rawEvent, agentId, forwarded) {
|
|
|
228
229
|
|
|
229
230
|
//#endregion
|
|
230
231
|
export { createScopedShare, listShares, revokeAllShares, revokeShare };
|
|
231
|
-
//# sourceMappingURL=agentShare-
|
|
232
|
+
//# sourceMappingURL=agentShare-DWioPObE.js.map
|
package/dist/cli.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
import { t as invokedCliName } from "./invokedCli-uqM2YYA7.js";
|
|
3
3
|
import { n as logger } from "./logger-CDIsZ-Pp.js";
|
|
4
|
-
import { i as versionString, n as displayVersion, t as checkAndAutoUpdate } from "./versionChecker-
|
|
5
|
-
import { n as getRustBinary } from "./rustBinary-
|
|
4
|
+
import { i as versionString, n as displayVersion, t as checkAndAutoUpdate } from "./versionChecker-DKiSuTSp.js";
|
|
5
|
+
import { n as getRustBinary } from "./rustBinary-5HCt7_0b.js";
|
|
6
6
|
import { argv } from "process";
|
|
7
7
|
import { spawn } from "child_process";
|
|
8
8
|
import ms from "ms";
|
|
@@ -285,7 +285,7 @@ function buildRustArgs(argv, cliFromScript, supportedClis) {
|
|
|
285
285
|
const rawArg = process.argv[2];
|
|
286
286
|
const managerCommands = !invokedCliName(process.argv);
|
|
287
287
|
const isHelpFlag = rawArg === "-h" || rawArg === "--help";
|
|
288
|
-
const { isSubcommand, runSubcommand, cmdHelp } = await import("./subcommands-
|
|
288
|
+
const { isSubcommand, runSubcommand, cmdHelp } = await import("./subcommands-DzWBZ6HE.js");
|
|
289
289
|
if (isHelpFlag && process.argv.length === 3) {
|
|
290
290
|
await cmdHelp(managerCommands);
|
|
291
291
|
process.exit(0);
|
|
@@ -299,16 +299,16 @@ await checkAndAutoUpdate();
|
|
|
299
299
|
logger.info(versionString());
|
|
300
300
|
const config = parseCliArgs(process.argv);
|
|
301
301
|
if (config.tray) {
|
|
302
|
-
const { startTray } = await import("./tray-
|
|
302
|
+
const { startTray } = await import("./tray-BSFi35Qg.js");
|
|
303
303
|
await startTray();
|
|
304
304
|
await new Promise(() => {});
|
|
305
305
|
}
|
|
306
306
|
{
|
|
307
|
-
const { ensureTray } = await import("./tray-
|
|
307
|
+
const { ensureTray } = await import("./tray-BSFi35Qg.js");
|
|
308
308
|
ensureTray();
|
|
309
309
|
}
|
|
310
310
|
if (!config.showVersion && !config.appendPrompt && !config.tray) {
|
|
311
|
-
const { waitForSpawnCapacity } = await import("./spawnGate-
|
|
311
|
+
const { waitForSpawnCapacity } = await import("./spawnGate-BkjeS4tg.js");
|
|
312
312
|
await waitForSpawnCapacity({
|
|
313
313
|
onWait: (reason, waitedMs) => {
|
|
314
314
|
if (config.verbose || waitedMs === 0) console.error(`[agent-yes] spawn gate: ${reason} — waiting…`);
|
|
@@ -327,14 +327,14 @@ if (config.useRust) {
|
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
329
|
if (rustBinary) {
|
|
330
|
-
const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-
|
|
330
|
+
const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-D4Z--hGm.js");
|
|
331
331
|
const rustArgs = buildRustArgs(process.argv, config.cli, SUPPORTED_CLIS);
|
|
332
332
|
if (config.verbose) {
|
|
333
333
|
console.log(`[rust] Using binary: ${rustBinary}`);
|
|
334
334
|
console.log(`[rust] Args: ${rustArgs.join(" ")}`);
|
|
335
335
|
}
|
|
336
336
|
const attach = config.attach || process.env.AGENT_YES_ATTACH === "1";
|
|
337
|
-
const { shouldForkNested, buildSpawnTutorial, waitForFifo } = await import("./forkNested-
|
|
337
|
+
const { shouldForkNested, buildSpawnTutorial, waitForFifo } = await import("./forkNested-DOyDAHnC.js");
|
|
338
338
|
if (shouldForkNested({
|
|
339
339
|
isTTY: Boolean(process.stdout.isTTY),
|
|
340
340
|
ayPid: process.env.AGENT_YES_PID,
|
|
@@ -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, 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-jb0Hp43q.js.map
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { a as removeControlCharacters, i as AgentContext, n as agentYes, r as config, t as CLIS_CONFIG } from "./ts-
|
|
1
|
+
import { a as removeControlCharacters, i as AgentContext, n as agentYes, r as config, t as CLIS_CONFIG } from "./ts-B64pNQlI.js";
|
|
2
2
|
import "./logger-CDIsZ-Pp.js";
|
|
3
|
-
import "./versionChecker-
|
|
3
|
+
import "./versionChecker-DKiSuTSp.js";
|
|
4
4
|
import "./pidStore-BIvsBQ8X.js";
|
|
5
5
|
import "./globalPidIndex-CoNr7tS8.js";
|
|
6
|
+
import "./messageLog-CxrKJj77.js";
|
|
6
7
|
|
|
7
8
|
export { AgentContext, CLIS_CONFIG, config, agentYes as default, removeControlCharacters };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { n as logger } from "./logger-CDIsZ-Pp.js";
|
|
2
|
+
import { appendFile, mkdir, readFile, writeFile } from "fs/promises";
|
|
3
|
+
import path from "path";
|
|
4
|
+
|
|
5
|
+
//#region ts/messageLog.ts
|
|
6
|
+
/**
|
|
7
|
+
* Durable inter-agent message log.
|
|
8
|
+
*
|
|
9
|
+
* Every `ay send` that carries a real body is recorded twice — from the two
|
|
10
|
+
* ends' points of view — as append-only JSONL colocated with each agent's
|
|
11
|
+
* project dir (the same `<cwd>/.agent-yes/` convention the session logs use):
|
|
12
|
+
*
|
|
13
|
+
* - the SENDER's `<from.cwd>/.agent-yes/outbox.jsonl`
|
|
14
|
+
* - the RECIPIENT's `<to.cwd>/.agent-yes/inbox.jsonl`
|
|
15
|
+
*
|
|
16
|
+
* A single cwd may host several agents, so records carry the stable `agent_id`
|
|
17
|
+
* (falling back to `pid`) of each end; `ay msgs` filters a mailbox down to one
|
|
18
|
+
* agent by that key. Reading needs no lock (last line wins isn't relevant — a
|
|
19
|
+
* message log keeps every entry); writing is best-effort and never blocks or
|
|
20
|
+
* fails a send.
|
|
21
|
+
*/
|
|
22
|
+
/** Keep at most this many lines per mailbox; older entries are compacted away. */
|
|
23
|
+
const MAILBOX_MAX_LINES = 2e3;
|
|
24
|
+
/** Path to a cwd's mailbox file (`<cwd>/.agent-yes/{inbox,outbox}.jsonl`). */
|
|
25
|
+
function mailboxPath(cwd, box) {
|
|
26
|
+
return path.join(cwd, ".agent-yes", `${box}.jsonl`);
|
|
27
|
+
}
|
|
28
|
+
/** Whether a mail party is the agent identified by (agentId, pid). Prefers the
|
|
29
|
+
* stable agent_id (survives restart); falls back to pid for legacy records. */
|
|
30
|
+
function partyMatches(party, agentId, pid) {
|
|
31
|
+
if (!party) return false;
|
|
32
|
+
if (agentId && party.agent_id && party.agent_id === agentId) return true;
|
|
33
|
+
if (typeof pid === "number" && party.pid === pid) return true;
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
async function appendCapped(filePath, record) {
|
|
37
|
+
await mkdir(path.dirname(filePath), { recursive: true });
|
|
38
|
+
await appendFile(filePath, JSON.stringify(record) + "\n");
|
|
39
|
+
const lines = (await readFile(filePath, "utf-8").catch(() => "")).split("\n").filter((l) => l.trim());
|
|
40
|
+
if (lines.length > MAILBOX_MAX_LINES) await writeFile(filePath, lines.slice(lines.length - MAILBOX_MAX_LINES).join("\n") + "\n");
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Record the SENDER's view in its outbox. Best-effort — a filesystem error is
|
|
44
|
+
* logged and swallowed so persistence never breaks a send. The outbox lives
|
|
45
|
+
* under `from.cwd`; a human sender (from === null) writes under `process.cwd()`.
|
|
46
|
+
*/
|
|
47
|
+
async function recordOutbox(record) {
|
|
48
|
+
const outCwd = record.from?.cwd ?? process.cwd();
|
|
49
|
+
try {
|
|
50
|
+
await appendCapped(mailboxPath(outCwd, "outbox"), record);
|
|
51
|
+
} catch (err) {
|
|
52
|
+
logger.debug(`[messageLog] outbox append failed: ${err}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/** Record the RECIPIENT's view in its inbox (under `to.cwd`). Best-effort. */
|
|
56
|
+
async function recordInbox(record) {
|
|
57
|
+
try {
|
|
58
|
+
await appendCapped(mailboxPath(record.to.cwd, "inbox"), record);
|
|
59
|
+
} catch (err) {
|
|
60
|
+
logger.debug(`[messageLog] inbox append failed: ${err}`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Record a same-host message in both mailboxes — the sender's outbox and the
|
|
65
|
+
* recipient's inbox both live on this machine. For a message that crossed the
|
|
66
|
+
* wire, each end calls `recordOutbox`/`recordInbox` on its own host instead.
|
|
67
|
+
*/
|
|
68
|
+
async function recordMessage(record) {
|
|
69
|
+
await recordOutbox(record);
|
|
70
|
+
await recordInbox(record);
|
|
71
|
+
}
|
|
72
|
+
/** Read and parse a cwd's mailbox, oldest first. Missing/corrupt lines skipped. */
|
|
73
|
+
async function readMailbox(cwd, box) {
|
|
74
|
+
let raw;
|
|
75
|
+
try {
|
|
76
|
+
raw = await readFile(mailboxPath(cwd, box), "utf-8");
|
|
77
|
+
} catch {
|
|
78
|
+
return [];
|
|
79
|
+
}
|
|
80
|
+
const out = [];
|
|
81
|
+
for (const line of raw.split("\n")) {
|
|
82
|
+
const t = line.trim();
|
|
83
|
+
if (!t) continue;
|
|
84
|
+
try {
|
|
85
|
+
const rec = JSON.parse(t);
|
|
86
|
+
if (rec && typeof rec.at === "number" && rec.to) out.push(rec);
|
|
87
|
+
} catch {}
|
|
88
|
+
}
|
|
89
|
+
return out;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
//#endregion
|
|
93
|
+
export { recordOutbox as a, recordMessage as i, readMailbox as n, recordInbox as r, partyMatches as t };
|
|
94
|
+
//# sourceMappingURL=messageLog-CxrKJj77.js.map
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { n as logger } from "./logger-CDIsZ-Pp.js";
|
|
2
2
|
import "./globalPidIndex-CoNr7tS8.js";
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
5
|
-
import "./
|
|
6
|
-
import "./
|
|
7
|
-
import "./
|
|
3
|
+
import "./messageLog-CxrKJj77.js";
|
|
4
|
+
import "./configShared-aKTg-sa5.js";
|
|
5
|
+
import { $ as notifyDir, G as gcInboxes, J as liveWatchers, K as hostId, Q as daemonLockOwnerPath, S as listRecords, W as appendEvent, X as shouldStealLock, Y as readInbox, Z as daemonLockDir, _ as isPidAlive, c as deriveLiveState, k as renderLogTailLines, q as listInboxParents } from "./subcommands-B7UxIJRw.js";
|
|
6
|
+
import "./e2e-jb0Hp43q.js";
|
|
7
|
+
import "./webrtcLink-B7REGtK2.js";
|
|
8
|
+
import "./remotes-Cim0dBU7.js";
|
|
8
9
|
import { mkdir, readFile, rename, rm, stat, writeFile } from "fs/promises";
|
|
9
10
|
import { randomUUID } from "node:crypto";
|
|
10
11
|
import { execFile } from "node:child_process";
|
|
@@ -588,4 +589,4 @@ async function ensureDaemon() {
|
|
|
588
589
|
|
|
589
590
|
//#endregion
|
|
590
591
|
export { daemonStatus, ensureDaemon, requestDaemonStop, runDaemon };
|
|
591
|
-
//# sourceMappingURL=notifyDaemon-
|
|
592
|
+
//# sourceMappingURL=notifyDaemon-CRf_27kE.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./e2e-
|
|
2
|
-
import "./webrtcLink-
|
|
3
|
-
import { a as resolveRemoteSpec, i as readRemotes, n as deleteRemoteAlias, o as writeRemoteAlias, r as parseDirectRemoteSpec, t as cmdRemote } from "./remotes-
|
|
1
|
+
import "./e2e-jb0Hp43q.js";
|
|
2
|
+
import "./webrtcLink-B7REGtK2.js";
|
|
3
|
+
import { a as resolveRemoteSpec, i as readRemotes, n as deleteRemoteAlias, o as writeRemoteAlias, r as parseDirectRemoteSpec, t as cmdRemote } from "./remotes-Cim0dBU7.js";
|
|
4
4
|
|
|
5
5
|
export { cmdRemote };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as isWebrtcSpec } from "./webrtcLink-
|
|
1
|
+
import { n as isWebrtcSpec } from "./webrtcLink-B7REGtK2.js";
|
|
2
2
|
import { mkdir, readFile, writeFile } from "fs/promises";
|
|
3
3
|
import { homedir } from "os";
|
|
4
4
|
import path from "path";
|
|
@@ -86,7 +86,7 @@ async function resolveRemoteSpec(spec) {
|
|
|
86
86
|
* The bridge lives for the rest of the process (torn down on `process.exit`).
|
|
87
87
|
*/
|
|
88
88
|
async function resolveWebrtc(link, keyword) {
|
|
89
|
-
const { startWebrtcBridge } = await import("./webrtcRemote-
|
|
89
|
+
const { startWebrtcBridge } = await import("./webrtcRemote-CvIEfWX8.js");
|
|
90
90
|
const bridge = await startWebrtcBridge(link);
|
|
91
91
|
return {
|
|
92
92
|
url: bridge.baseUrl,
|
|
@@ -173,4 +173,4 @@ async function cmdRemote(rest) {
|
|
|
173
173
|
|
|
174
174
|
//#endregion
|
|
175
175
|
export { resolveRemoteSpec as a, readRemotes as i, deleteRemoteAlias as n, writeRemoteAlias as o, parseDirectRemoteSpec as r, cmdRemote as t };
|
|
176
|
-
//# sourceMappingURL=remotes-
|
|
176
|
+
//# sourceMappingURL=remotes-Cim0dBU7.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as getInstalledPackage } from "./versionChecker-
|
|
1
|
+
import { r as getInstalledPackage } from "./versionChecker-DKiSuTSp.js";
|
|
2
2
|
import { execFileSync } from "child_process";
|
|
3
3
|
import { existsSync, mkdirSync, unlinkSync } from "fs";
|
|
4
4
|
import { chmod, copyFile } from "fs/promises";
|
|
@@ -225,4 +225,4 @@ async function getRustBinary(options = {}) {
|
|
|
225
225
|
|
|
226
226
|
//#endregion
|
|
227
227
|
export { getRustBinary as n, findSpawnHiddenLauncher as t };
|
|
228
|
-
//# sourceMappingURL=rustBinary-
|
|
228
|
+
//# sourceMappingURL=rustBinary-5HCt7_0b.js.map
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import "./ts-
|
|
1
|
+
import "./ts-B64pNQlI.js";
|
|
2
2
|
import "./logger-CDIsZ-Pp.js";
|
|
3
|
-
import "./versionChecker-
|
|
3
|
+
import "./versionChecker-DKiSuTSp.js";
|
|
4
4
|
import "./pidStore-BIvsBQ8X.js";
|
|
5
5
|
import "./globalPidIndex-CoNr7tS8.js";
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import "./messageLog-CxrKJj77.js";
|
|
7
|
+
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-BY83eM58.js";
|
|
8
|
+
import { d as resolveSpawnCwd } from "./workspaceConfig-CjaRvTjf.js";
|
|
9
|
+
import { n as liveEnv, t as ensureNodeRuntime } from "./nodeRuntime-CwNJuwH5.js";
|
|
9
10
|
import { createHash } from "node:crypto";
|
|
10
11
|
|
|
11
12
|
//#region ts/oxmgrService.ts
|
|
@@ -150,4 +151,4 @@ async function cmdSchedule(rest) {
|
|
|
150
151
|
|
|
151
152
|
//#endregion
|
|
152
153
|
export { cmdSchedule };
|
|
153
|
-
//# sourceMappingURL=schedule-
|
|
154
|
+
//# sourceMappingURL=schedule-CjBcOy-b.js.map
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import "./ts-
|
|
1
|
+
import "./ts-B64pNQlI.js";
|
|
2
2
|
import "./logger-CDIsZ-Pp.js";
|
|
3
|
-
import { r as getInstalledPackage } from "./versionChecker-
|
|
4
|
-
import { t as findSpawnHiddenLauncher } from "./rustBinary-
|
|
3
|
+
import { r as getInstalledPackage } from "./versionChecker-DKiSuTSp.js";
|
|
4
|
+
import { t as findSpawnHiddenLauncher } from "./rustBinary-5HCt7_0b.js";
|
|
5
5
|
import "./pidStore-BIvsBQ8X.js";
|
|
6
6
|
import { a as updateGlobalPidStatus } from "./globalPidIndex-CoNr7tS8.js";
|
|
7
|
-
import {
|
|
8
|
-
import "./
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import "./
|
|
12
|
-
import "./
|
|
13
|
-
import "./
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
7
|
+
import { r as recordInbox } from "./messageLog-CxrKJj77.js";
|
|
8
|
+
import { t as pgidForWrapper } from "./reaper-BUHCyxdF.js";
|
|
9
|
+
import "./configShared-aKTg-sa5.js";
|
|
10
|
+
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-BY83eM58.js";
|
|
11
|
+
import { A as renderRawLog, D as recentMessageEdges, E as readPtysize, L as snapshotStatus, M as resolveOne, O as recentReadEdges, S as listRecords, T as readNotes, U as writeToIpc, b as isUserTyping, et as TYPING_BADGE, f as extractNeedsInput, k as renderLogTailLines, l as deriveLiveStatus, o as controlCodeFromName, p as extractTaskCounts, u as extractBadges } from "./subcommands-B7UxIJRw.js";
|
|
12
|
+
import "./e2e-jb0Hp43q.js";
|
|
13
|
+
import "./webrtcLink-B7REGtK2.js";
|
|
14
|
+
import "./remotes-Cim0dBU7.js";
|
|
15
|
+
import { a as getSpawnHook, c as hasProvisionHook, d as resolveSpawnCwd, i as getProvisionRoot, l as hasSpawnHook, r as getProvisionHook, u as isProvisionAllowed } from "./workspaceConfig-CjaRvTjf.js";
|
|
16
|
+
import { n as liveEnv, t as ensureNodeRuntime } from "./nodeRuntime-CwNJuwH5.js";
|
|
17
|
+
import { r as spawnRejectionReason } from "./spawnGate-CXjEz6Pf.js";
|
|
17
18
|
import yargs from "yargs";
|
|
18
19
|
import { mkdir, open, readFile, stat, unlink, writeFile } from "fs/promises";
|
|
19
20
|
import { arch, cpus, freemem, homedir, hostname, loadavg, platform, totalmem, uptime, userInfo } from "os";
|
|
@@ -23,6 +24,25 @@ import { fileURLToPath } from "node:url";
|
|
|
23
24
|
import { randomBytes, timingSafeEqual } from "crypto";
|
|
24
25
|
import { renameSync, watch, writeFileSync } from "node:fs";
|
|
25
26
|
|
|
27
|
+
//#region ts/terminalReply.ts
|
|
28
|
+
/**
|
|
29
|
+
* Is this /api/send payload PURELY terminal auto-reply chatter — the responses
|
|
30
|
+
* a viewer's xterm generates to the agent TUI's protocol queries (Cursor
|
|
31
|
+
* Position Report incl. the DECXCPR `?`-prefixed form, Device Attributes,
|
|
32
|
+
* Device Status Report) — rather than a keystroke?
|
|
33
|
+
*
|
|
34
|
+
* Used by the serve daemon to keep such writes out of `last_stdin_at`, so a
|
|
35
|
+
* redraw/resize (or a TUI polling `ESC[?6n` every render) can't pin the
|
|
36
|
+
* console's stdin-flash + stdin age at "just typed".
|
|
37
|
+
*
|
|
38
|
+
* Anchored over ONE-OR-MORE replies: a burst of queries (e.g. tail replay on
|
|
39
|
+
* viewer attach) is answered in a single onData chunk, so several replies
|
|
40
|
+
* arrive concatenated in one payload. Real typing — including arrow keys like
|
|
41
|
+
* `ESC[A` — never matches any alternative.
|
|
42
|
+
*/
|
|
43
|
+
const isTerminalReply = (s) => /^(?:\x1b\[(?:\??\d+(?:;\d+)*R|\?[\d;]*c|>[\d;]*c|\d*n))+$/.test(s);
|
|
44
|
+
|
|
45
|
+
//#endregion
|
|
26
46
|
//#region ts/serve.ts
|
|
27
47
|
const DEFAULT_PORT = 7432;
|
|
28
48
|
/**
|
|
@@ -595,7 +615,7 @@ async function cmdServeDaemon(sub, args) {
|
|
|
595
615
|
let shareLink = null;
|
|
596
616
|
let shareLinkMinted = false;
|
|
597
617
|
if (webrtcDaemon) try {
|
|
598
|
-
const { loadOrCreateShareRoom, shareLinkFromRoomUrl } = await import("./share-
|
|
618
|
+
const { loadOrCreateShareRoom, shareLinkFromRoomUrl } = await import("./share-Ciw1mWVN.js");
|
|
599
619
|
const explicit = explicitWebrtcUrl(effArgs);
|
|
600
620
|
shareLink = shareLinkFromRoomUrl(explicit ?? await loadOrCreateShareRoom());
|
|
601
621
|
shareLinkMinted = !explicit;
|
|
@@ -604,7 +624,7 @@ async function cmdServeDaemon(sub, args) {
|
|
|
604
624
|
if (!webrtcDaemon) return;
|
|
605
625
|
if (shareLink) {
|
|
606
626
|
process.stdout.write(`\nshared over WebRTC — open this link (the token is eaten from the URL on open):\n ${shareLink}\n` + (shareLinkMinted ? ` (persistent room — same link across restarts; delete ~/.agent-yes/.share-room to rotate)\n` : ``));
|
|
607
|
-
const { offerOpenInBrowser } = await import("./openBrowser-
|
|
627
|
+
const { offerOpenInBrowser } = await import("./openBrowser-CSj21pZE.js");
|
|
608
628
|
await offerOpenInBrowser(shareLink);
|
|
609
629
|
} else process.stdout.write("\nthe WebRTC share link carries a secret, so the daemon does NOT log it —\nread it from ~/.agent-yes/.share-link (mode 0600). The room persists in\n~/.agent-yes/.share-room, so the link survives restarts.\n");
|
|
610
630
|
};
|
|
@@ -1074,7 +1094,6 @@ Options:
|
|
|
1074
1094
|
};
|
|
1075
1095
|
const meaningfulStdinAt = /* @__PURE__ */ new Map();
|
|
1076
1096
|
const anyDaemonWriteAt = /* @__PURE__ */ new Map();
|
|
1077
|
-
const isTerminalReply = (s) => /^\x1b\[(\d+;\d+R|\?[\d;]*c|>[\d;]*c|\d*n)$/.test(s);
|
|
1078
1097
|
const noteStdinWrite = async (pid, fifo, meaningful) => {
|
|
1079
1098
|
const mt = await stat(fifo).then((s) => s.mtimeMs).catch(() => null);
|
|
1080
1099
|
if (mt == null) return;
|
|
@@ -1953,7 +1972,7 @@ Options:
|
|
|
1953
1972
|
const perm = body.perm ?? "r";
|
|
1954
1973
|
if (perm !== "r" && perm !== "rw") return new Response(`invalid perm ${perm} (want r or rw)`, { status: 400 });
|
|
1955
1974
|
try {
|
|
1956
|
-
const { createScopedShare } = await import("./agentShare-
|
|
1975
|
+
const { createScopedShare } = await import("./agentShare-DWioPObE.js");
|
|
1957
1976
|
const share = await createScopedShare({
|
|
1958
1977
|
agent: body.agent,
|
|
1959
1978
|
perm,
|
|
@@ -1968,12 +1987,12 @@ Options:
|
|
|
1968
1987
|
}
|
|
1969
1988
|
}
|
|
1970
1989
|
if (req.method === "GET" && p === "/api/shares") {
|
|
1971
|
-
const { listShares } = await import("./agentShare-
|
|
1990
|
+
const { listShares } = await import("./agentShare-DWioPObE.js");
|
|
1972
1991
|
return Response.json(listShares());
|
|
1973
1992
|
}
|
|
1974
1993
|
const revokeM = /^\/api\/share\/([^/]+)$/.exec(p);
|
|
1975
1994
|
if (req.method === "DELETE" && revokeM) {
|
|
1976
|
-
const { revokeShare } = await import("./agentShare-
|
|
1995
|
+
const { revokeShare } = await import("./agentShare-DWioPObE.js");
|
|
1977
1996
|
const ok = revokeShare(decodeURIComponent(revokeM[1]));
|
|
1978
1997
|
return new Response(ok ? "revoked" : "no such share", { status: ok ? 200 : 404 });
|
|
1979
1998
|
}
|
|
@@ -1987,7 +2006,7 @@ Options:
|
|
|
1987
2006
|
const port = Number(body.port);
|
|
1988
2007
|
if (!Number.isInteger(port) || port < 1 || port > 65535) return new Response("valid port required", { status: 400 });
|
|
1989
2008
|
try {
|
|
1990
|
-
const { ensureExposure } = await import("./expose-
|
|
2009
|
+
const { ensureExposure } = await import("./expose-k9l6ZJDA.js");
|
|
1991
2010
|
const h = await ensureExposure(port, body.relay);
|
|
1992
2011
|
return Response.json({
|
|
1993
2012
|
id: h.id,
|
|
@@ -2001,12 +2020,12 @@ Options:
|
|
|
2001
2020
|
}
|
|
2002
2021
|
}
|
|
2003
2022
|
if (req.method === "GET" && p === "/api/exposes") {
|
|
2004
|
-
const { listExposures } = await import("./expose-
|
|
2023
|
+
const { listExposures } = await import("./expose-k9l6ZJDA.js");
|
|
2005
2024
|
return Response.json(listExposures());
|
|
2006
2025
|
}
|
|
2007
2026
|
const unexposeM = /^\/api\/expose\/(\d+)$/.exec(p);
|
|
2008
2027
|
if (req.method === "DELETE" && unexposeM) {
|
|
2009
|
-
const { stopExposure } = await import("./expose-
|
|
2028
|
+
const { stopExposure } = await import("./expose-k9l6ZJDA.js");
|
|
2010
2029
|
const ok = stopExposure(Number(unexposeM[1]));
|
|
2011
2030
|
return new Response(ok ? "revoked" : "no such exposure", { status: ok ? 200 : 404 });
|
|
2012
2031
|
}
|
|
@@ -2108,7 +2127,7 @@ Options:
|
|
|
2108
2127
|
const webrtcVal = argv.webrtc ?? argv.share;
|
|
2109
2128
|
const explicitUrl = typeof webrtcVal === "string" && webrtcVal.startsWith("webrtc://") ? webrtcVal : void 0;
|
|
2110
2129
|
try {
|
|
2111
|
-
const { startShare, loadOrCreateShareRoom } = await import("./share-
|
|
2130
|
+
const { startShare, loadOrCreateShareRoom } = await import("./share-Ciw1mWVN.js");
|
|
2112
2131
|
const linkFile = path.join(process.env.AGENT_YES_HOME ?? path.join(homedir(), ".agent-yes"), ".share-link");
|
|
2113
2132
|
const announce = async (room, link, rotated) => {
|
|
2114
2133
|
const lead = rotated ? "the room was rejected by signaling (stale generation) — rotated to a fresh link" : "shared over WebRTC — open this link (the token is eaten from the URL on open)";
|
|
@@ -2116,7 +2135,7 @@ Options:
|
|
|
2116
2135
|
const persistNote = explicitUrl ? "\n" : ` (persistent room — same link across restarts; delete ~/.agent-yes/.share-room to rotate)\n\n`;
|
|
2117
2136
|
process.stdout.write(`${wantHttp ? "\n" : ""}${lead}:\n ${link}\n` + persistNote);
|
|
2118
2137
|
if (!rotated) {
|
|
2119
|
-
const { offerOpenInBrowser } = await import("./openBrowser-
|
|
2138
|
+
const { offerOpenInBrowser } = await import("./openBrowser-CSj21pZE.js");
|
|
2120
2139
|
await offerOpenInBrowser(link);
|
|
2121
2140
|
}
|
|
2122
2141
|
} else {
|
|
@@ -2155,7 +2174,7 @@ Options:
|
|
|
2155
2174
|
const shutdown = (resolve) => {
|
|
2156
2175
|
if (heartbeat) clearInterval(heartbeat);
|
|
2157
2176
|
closeShare?.();
|
|
2158
|
-
import("./agentShare-
|
|
2177
|
+
import("./agentShare-DWioPObE.js").then((m) => m.revokeAllShares()).catch(() => {});
|
|
2159
2178
|
server?.stop();
|
|
2160
2179
|
resolve();
|
|
2161
2180
|
};
|
|
@@ -2168,4 +2187,4 @@ Options:
|
|
|
2168
2187
|
|
|
2169
2188
|
//#endregion
|
|
2170
2189
|
export { cmdServe };
|
|
2171
|
-
//# sourceMappingURL=serve-
|
|
2190
|
+
//# sourceMappingURL=serve-C3E8uicL.js.map
|