agent-yes 1.122.2 → 1.122.3

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,8 +1,8 @@
1
- import { t as CLIS_CONFIG } from "./ts-CIf0uaR7.js";
1
+ import { t as CLIS_CONFIG } from "./ts-9GThuc3w.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-BTu2brih.js.map
8
+ //# sourceMappingURL=SUPPORTED_CLIS-BleNYXA2.js.map
@@ -0,0 +1,8 @@
1
+ import "./ts-9GThuc3w.js";
2
+ import "./logger-B9h0djqx.js";
3
+ import "./versionChecker-Bv9XKddN.js";
4
+ import "./pidStore-B5vBu8Px.js";
5
+ import "./globalPidIndex-gZuTvTBs.js";
6
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-BleNYXA2.js";
7
+
8
+ export { SUPPORTED_CLIS };
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bun
2
2
  import { n as logger } from "./logger-B9h0djqx.js";
3
- import { i as versionString, n as displayVersion, r as getInstalledPackage, t as checkAndAutoUpdate } from "./versionChecker-DjxKi4qe.js";
3
+ import { i as versionString, n as displayVersion, r as getInstalledPackage, t as checkAndAutoUpdate } from "./versionChecker-Bv9XKddN.js";
4
4
  import { argv } from "process";
5
5
  import { execFileSync, spawn } from "child_process";
6
6
  import ms from "ms";
@@ -482,7 +482,7 @@ function buildRustArgs(argv, cliFromScript, supportedClis) {
482
482
  {
483
483
  const rawArg = process.argv[2];
484
484
  const isHelpFlag = rawArg === "-h" || rawArg === "--help";
485
- const { isSubcommand, runSubcommand, cmdHelp } = await import("./subcommands-D8sHibKu.js");
485
+ const { isSubcommand, runSubcommand, cmdHelp } = await import("./subcommands-KAbIcd8_.js");
486
486
  if (isHelpFlag && process.argv.length === 3) {
487
487
  cmdHelp();
488
488
  process.exit(0);
@@ -515,7 +515,7 @@ if (config.useRust) {
515
515
  }
516
516
  }
517
517
  if (rustBinary) {
518
- const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-DcOKE9Nz.js");
518
+ const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-ClaOErso.js");
519
519
  const rustArgs = buildRustArgs(process.argv, config.cli, SUPPORTED_CLIS);
520
520
  if (config.verbose) {
521
521
  console.log(`[rust] Using binary: ${rustBinary}`);
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { a as removeControlCharacters, i as AgentContext, n as agentYes, r as config, t as CLIS_CONFIG } from "./ts-CIf0uaR7.js";
1
+ import { a as removeControlCharacters, i as AgentContext, n as agentYes, r as config, t as CLIS_CONFIG } from "./ts-9GThuc3w.js";
2
2
  import "./logger-B9h0djqx.js";
3
- import "./versionChecker-DjxKi4qe.js";
3
+ import "./versionChecker-Bv9XKddN.js";
4
4
  import "./pidStore-B5vBu8Px.js";
5
5
  import "./globalPidIndex-gZuTvTBs.js";
6
6
 
@@ -1,9 +1,9 @@
1
- import "./ts-CIf0uaR7.js";
1
+ import "./ts-9GThuc3w.js";
2
2
  import "./logger-B9h0djqx.js";
3
- import "./versionChecker-DjxKi4qe.js";
3
+ import "./versionChecker-Bv9XKddN.js";
4
4
  import "./pidStore-B5vBu8Px.js";
5
5
  import "./globalPidIndex-gZuTvTBs.js";
6
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-BTu2brih.js";
6
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-BleNYXA2.js";
7
7
  import { n as resolveSpawnCwd } from "./workspaceConfig-XP2NEWmV.js";
8
8
  import { createHash } from "node:crypto";
9
9
 
@@ -141,4 +141,4 @@ async function cmdSchedule(rest) {
141
141
 
142
142
  //#endregion
143
143
  export { cmdSchedule };
144
- //# sourceMappingURL=schedule-DgRrdA_n.js.map
144
+ //# sourceMappingURL=schedule-e4f7NlA2.js.map
@@ -1,11 +1,11 @@
1
- import "./ts-CIf0uaR7.js";
1
+ import "./ts-9GThuc3w.js";
2
2
  import "./logger-B9h0djqx.js";
3
- import { r as getInstalledPackage } from "./versionChecker-DjxKi4qe.js";
3
+ import { r as getInstalledPackage } from "./versionChecker-Bv9XKddN.js";
4
4
  import "./pidStore-B5vBu8Px.js";
5
5
  import "./globalPidIndex-gZuTvTBs.js";
6
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-BTu2brih.js";
6
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-BleNYXA2.js";
7
7
  import "./remotes-D2fqaRU8.js";
8
- import { c as listRecords, d as renderRawLog, f as resolveOne, g as writeToIpc, m as snapshotStatus, r as controlCodeFromName, u as readNotes } from "./subcommands-D9BWZilr.js";
8
+ import { c as listRecords, d as renderRawLog, f as resolveOne, g as writeToIpc, m as snapshotStatus, r as controlCodeFromName, u as readNotes } from "./subcommands-CQowpr1t.js";
9
9
  import yargs from "yargs";
10
10
  import { mkdir, open, readFile, writeFile } from "fs/promises";
11
11
  import { homedir, hostname, userInfo } from "os";
@@ -918,7 +918,7 @@ Options:
918
918
  const webrtcVal = argv.webrtc ?? argv.share;
919
919
  const explicitUrl = typeof webrtcVal === "string" && webrtcVal.startsWith("webrtc://") ? webrtcVal : void 0;
920
920
  try {
921
- const { startShare, loadOrCreateShareRoom } = await import("./share-CksllWW-.js");
921
+ const { startShare, loadOrCreateShareRoom } = await import("./share-CS9XVrLF.js");
922
922
  const linkFile = path.join(process.env.AGENT_YES_HOME ?? path.join(homedir(), ".agent-yes"), ".share-link");
923
923
  const announce = async (room, link, rotated) => {
924
924
  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)";
@@ -963,4 +963,4 @@ Options:
963
963
 
964
964
  //#endregion
965
965
  export { cmdServe };
966
- //# sourceMappingURL=serve-tn7ZetZs.js.map
966
+ //# sourceMappingURL=serve-CzztmZ_N.js.map
@@ -32,7 +32,7 @@ async function cmdSetup(rest) {
32
32
  if (!existsSync(abs)) process.stderr.write(` note: that directory doesn't exist yet — create it, or agents spawned there will fail\n`);
33
33
  if (noShare) return 0;
34
34
  process.stdout.write(`\nsharing this machine to agent-yes.com…\n`);
35
- const { cmdServe } = await import("./serve-tn7ZetZs.js");
35
+ const { cmdServe } = await import("./serve-CzztmZ_N.js");
36
36
  return cmdServe([
37
37
  "install",
38
38
  "--share",
@@ -42,4 +42,4 @@ async function cmdSetup(rest) {
42
42
 
43
43
  //#endregion
44
44
  export { cmdSetup };
45
- //# sourceMappingURL=setup-dZhgpNse.js.map
45
+ //# sourceMappingURL=setup-CPyRNiIA.js.map
@@ -181,6 +181,7 @@ const SUB = "ay-signal-1";
181
181
  const DEFAULT_SIGHOST = "s.agent-yes.com";
182
182
  const HOST_HEARTBEAT_MS = 2e4;
183
183
  const SIG_REFRESH_MS = 4 * 6e4;
184
+ const MAX_PEER_SETUP_FAILURES = 3;
184
185
  const STUN = [{ urls: "stun:stun.l.google.com:19302" }];
185
186
  let iceCache = null;
186
187
  async function getIceServers() {
@@ -342,6 +343,7 @@ async function startShare(opts) {
342
343
  const peers = /* @__PURE__ */ new Map();
343
344
  let closed = false;
344
345
  let currentWs;
346
+ let peerSetupFailures = 0;
345
347
  const connectSignaling = (onReady) => {
346
348
  if (closed) return;
347
349
  const ws = new WebSocket(`${wsScheme}://${host}/${room}`, [SUB]);
@@ -394,7 +396,17 @@ async function startShare(opts) {
394
396
  lastRecv = Date.now();
395
397
  const m = JSON.parse(ev.data);
396
398
  if (m.type === "pong") return;
397
- if (m.type === "peer-join") startPeer(ws, m.peer).catch(() => {});
399
+ if (m.type === "peer-join") startPeer(ws, m.peer).then(() => {
400
+ peerSetupFailures = 0;
401
+ }, (err) => {
402
+ peerSetupFailures++;
403
+ process.stderr.write(`[share] peer setup failed (${peerSetupFailures}/${MAX_PEER_SETUP_FAILURES}): ${err?.message ?? err}\n`);
404
+ closePeer(m.peer);
405
+ if (peerSetupFailures >= MAX_PEER_SETUP_FAILURES) {
406
+ process.stderr.write("[share] WebRTC stack wedged after repeated peer-setup failures — exiting so the service manager restarts with a fresh stack\n");
407
+ process.exit(1);
408
+ }
409
+ });
398
410
  else if (m.type === "answer") {
399
411
  const peer = peers.get(m.from);
400
412
  if (!peer) return;
@@ -490,6 +502,10 @@ async function startShare(opts) {
490
502
  };
491
503
  const offer = await pc.createOffer();
492
504
  await pc.setLocalDescription(offer);
505
+ if (ws.readyState !== WebSocket.OPEN) {
506
+ closePeer(peerId);
507
+ return;
508
+ }
493
509
  ws.send(JSON.stringify({
494
510
  type: "offer",
495
511
  to: peerId,
@@ -625,4 +641,4 @@ async function startShare(opts) {
625
641
 
626
642
  //#endregion
627
643
  export { loadOrCreateShareRoom, startShare };
628
- //# sourceMappingURL=share-CksllWW-.js.map
644
+ //# sourceMappingURL=share-CS9XVrLF.js.map
@@ -233,15 +233,15 @@ async function runSubcommand(argv) {
233
233
  case "restart": return await cmdRestart(rest);
234
234
  case "note": return await cmdNote(rest);
235
235
  case "serve": {
236
- const { cmdServe } = await import("./serve-tn7ZetZs.js");
236
+ const { cmdServe } = await import("./serve-CzztmZ_N.js");
237
237
  return cmdServe(rest);
238
238
  }
239
239
  case "setup": {
240
- const { cmdSetup } = await import("./setup-dZhgpNse.js");
240
+ const { cmdSetup } = await import("./setup-CPyRNiIA.js");
241
241
  return cmdSetup(rest);
242
242
  }
243
243
  case "schedule": {
244
- const { cmdSchedule } = await import("./schedule-DgRrdA_n.js");
244
+ const { cmdSchedule } = await import("./schedule-e4f7NlA2.js");
245
245
  return cmdSchedule(rest);
246
246
  }
247
247
  case "remote": {
@@ -1689,4 +1689,4 @@ async function cmdStatus(rest) {
1689
1689
 
1690
1690
  //#endregion
1691
1691
  export { finalizedLines as a, listRecords as c, renderRawLog as d, resolveOne as f, writeToIpc as g, stopTipForCli as h, cursorAbs as i, matchKeyword as l, snapshotStatus as m, cmdHelp as n, isPidAlive as o, runSubcommand as p, controlCodeFromName as r, isSubcommand as s, GRACEFUL_EXIT_COMMANDS as t, readNotes as u };
1692
- //# sourceMappingURL=subcommands-D9BWZilr.js.map
1692
+ //# sourceMappingURL=subcommands-CQowpr1t.js.map
@@ -1,6 +1,6 @@
1
1
  import "./logger-B9h0djqx.js";
2
2
  import "./globalPidIndex-gZuTvTBs.js";
3
3
  import "./remotes-D2fqaRU8.js";
4
- import { a as finalizedLines, c as listRecords, d as renderRawLog, f as resolveOne, g as writeToIpc, h as stopTipForCli, i as cursorAbs, l as matchKeyword, m as snapshotStatus, n as cmdHelp, o as isPidAlive, p as runSubcommand, r as controlCodeFromName, s as isSubcommand, t as GRACEFUL_EXIT_COMMANDS, u as readNotes } from "./subcommands-D9BWZilr.js";
4
+ import { a as finalizedLines, c as listRecords, d as renderRawLog, f as resolveOne, g as writeToIpc, h as stopTipForCli, i as cursorAbs, l as matchKeyword, m as snapshotStatus, n as cmdHelp, o as isPidAlive, p as runSubcommand, r as controlCodeFromName, s as isSubcommand, t as GRACEFUL_EXIT_COMMANDS, u as readNotes } from "./subcommands-CQowpr1t.js";
5
5
 
6
6
  export { cmdHelp, isSubcommand, runSubcommand };
@@ -1,5 +1,5 @@
1
1
  import { n as logger, t as addTransport } from "./logger-B9h0djqx.js";
2
- import { r as getInstalledPackage } from "./versionChecker-DjxKi4qe.js";
2
+ import { r as getInstalledPackage } from "./versionChecker-Bv9XKddN.js";
3
3
  import { t as agentYesHome } from "./agentYesHome-BvaUOzCV.js";
4
4
  import { i as shouldUseLock, r as releaseLock, t as acquireLock } from "./runningLock-CJxsoGdb.js";
5
5
  import { t as PidStore } from "./pidStore-B5vBu8Px.js";
@@ -1784,4 +1784,4 @@ function sleep(ms) {
1784
1784
 
1785
1785
  //#endregion
1786
1786
  export { removeControlCharacters as a, AgentContext as i, agentYes as n, config as r, CLIS_CONFIG as t };
1787
- //# sourceMappingURL=ts-CIf0uaR7.js.map
1787
+ //# sourceMappingURL=ts-9GThuc3w.js.map
@@ -7,7 +7,7 @@ import { fileURLToPath } from "url";
7
7
 
8
8
  //#region package.json
9
9
  var name = "agent-yes";
10
- var version = "1.122.2";
10
+ var version = "1.122.3";
11
11
 
12
12
  //#endregion
13
13
  //#region ts/versionChecker.ts
@@ -215,4 +215,4 @@ async function displayVersion() {
215
215
 
216
216
  //#endregion
217
217
  export { versionString as i, displayVersion as n, getInstalledPackage as r, checkAndAutoUpdate as t };
218
- //# sourceMappingURL=versionChecker-DjxKi4qe.js.map
218
+ //# sourceMappingURL=versionChecker-Bv9XKddN.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-yes",
3
- "version": "1.122.2",
3
+ "version": "1.122.3",
4
4
  "description": "A wrapper tool that automates interactions with various AI CLI tools by automatically handling common prompts and responses.",
5
5
  "keywords": [
6
6
  "ai",
package/ts/share.ts CHANGED
@@ -37,6 +37,13 @@ const HOST_HEARTBEAT_MS = 20000; // keepalive ping to the rendezvous + silent-dr
37
37
  // heartbeat never trips. Re-running the hello on a timer forces the DO to
38
38
  // re-register us, self-healing that state. Cheap: one reconnect per few minutes.
39
39
  const SIG_REFRESH_MS = 4 * 60_000;
40
+ // If building a peer connection fails this many times in a row, the native
41
+ // WebRTC stack (node-datachannel) is wedged — observed after long daemon uptime:
42
+ // signaling stays connected and peer-joins arrive, but every createOffer fails,
43
+ // so the host silently answers nobody and the room looks "offline". Reconnecting
44
+ // the socket can't clear it; only a fresh process can. Exit so the service
45
+ // manager restarts us with a clean stack (a fresh process provably works).
46
+ const MAX_PEER_SETUP_FAILURES = 3;
40
47
 
41
48
  type IceServer = { urls: string | string[]; username?: string; credential?: string };
42
49
  const STUN: IceServer[] = [{ urls: "stun:stun.l.google.com:19302" }];
@@ -299,6 +306,7 @@ export async function startShare(
299
306
  const peers = new Map<string, Peer>();
300
307
  let closed = false; // set by close(); stops signaling reconnect + new peers
301
308
  let currentWs: WebSocket | undefined; // the live rendezvous socket, for close()
309
+ let peerSetupFailures = 0; // consecutive startPeer() throws — see MAX_PEER_SETUP_FAILURES
302
310
 
303
311
  const connectSignaling = (onReady: () => void) => {
304
312
  if (closed) return; // a reconnect timer queued before close() must not revive it
@@ -355,7 +363,27 @@ export async function startShare(
355
363
  lastRecv = Date.now();
356
364
  const m = JSON.parse(ev.data as string);
357
365
  if (m.type === "pong") return; // heartbeat ack — liveness already recorded
358
- if (m.type === "peer-join") startPeer(ws, m.peer).catch(() => {});
366
+ if (m.type === "peer-join")
367
+ startPeer(ws, m.peer).then(
368
+ () => {
369
+ peerSetupFailures = 0; // a delivered offer proves the WebRTC stack works
370
+ },
371
+ (err) => {
372
+ // Don't swallow this: a failed createOffer is why a long-up host goes
373
+ // silently "offline". Surface it, and if it keeps failing, self-heal.
374
+ peerSetupFailures++;
375
+ process.stderr.write(
376
+ `[share] peer setup failed (${peerSetupFailures}/${MAX_PEER_SETUP_FAILURES}): ${(err as Error)?.message ?? err}\n`,
377
+ );
378
+ closePeer(m.peer);
379
+ if (peerSetupFailures >= MAX_PEER_SETUP_FAILURES) {
380
+ process.stderr.write(
381
+ "[share] WebRTC stack wedged after repeated peer-setup failures — exiting so the service manager restarts with a fresh stack\n",
382
+ );
383
+ process.exit(1);
384
+ }
385
+ },
386
+ );
359
387
  else if (m.type === "answer") {
360
388
  const peer = peers.get(m.from);
361
389
  if (!peer) return;
@@ -467,6 +495,14 @@ export async function startShare(
467
495
  };
468
496
  const offer = await pc.createOffer();
469
497
  await pc.setLocalDescription(offer);
498
+ // The signaling socket may have been recycled (SIG_REFRESH_MS) while we built
499
+ // the offer. Sending on a closing socket would throw and be miscounted as a
500
+ // wedged-stack failure — but it's benign: the browser re-joins on the fresh
501
+ // socket. Skip cleanly so only real createOffer failures trip the self-heal.
502
+ if (ws.readyState !== WebSocket.OPEN) {
503
+ closePeer(peerId);
504
+ return;
505
+ }
470
506
  // Hand the browser the same ICE servers (incl. the short-lived TURN creds)
471
507
  // so it can relay too when there's no direct path.
472
508
  ws.send(
@@ -1,8 +0,0 @@
1
- import "./ts-CIf0uaR7.js";
2
- import "./logger-B9h0djqx.js";
3
- import "./versionChecker-DjxKi4qe.js";
4
- import "./pidStore-B5vBu8Px.js";
5
- import "./globalPidIndex-gZuTvTBs.js";
6
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-BTu2brih.js";
7
-
8
- export { SUPPORTED_CLIS };