agent-yes 1.116.0 → 1.117.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.
@@ -0,0 +1,8 @@
1
+ import "./ts-B4lhxCQx.js";
2
+ import "./logger-B9h0djqx.js";
3
+ import "./versionChecker-CS7qsffQ.js";
4
+ import "./pidStore-DBjlqzo8.js";
5
+ import "./globalPidIndex-yVd3mbsV.js";
6
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-DQYx5cvl.js";
7
+
8
+ export { SUPPORTED_CLIS };
@@ -1,8 +1,8 @@
1
- import { t as CLIS_CONFIG } from "./ts-DvnOmOAf.js";
1
+ import { t as CLIS_CONFIG } from "./ts-B4lhxCQx.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-DuCEAzP9.js.map
8
+ //# sourceMappingURL=SUPPORTED_CLIS-DQYx5cvl.js.map
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-DeXuTfJ0.js";
3
+ import { i as versionString, n as displayVersion, r as getInstalledPackage, t as checkAndAutoUpdate } from "./versionChecker-CS7qsffQ.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-CxHjPXEH.js");
485
+ const { isSubcommand, runSubcommand, cmdHelp } = await import("./subcommands-BuLieGot.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-vFwB3bnK.js");
518
+ const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-DK9PO6Y6.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-DvnOmOAf.js";
1
+ import { a as removeControlCharacters, i as AgentContext, n as agentYes, r as config, t as CLIS_CONFIG } from "./ts-B4lhxCQx.js";
2
2
  import "./logger-B9h0djqx.js";
3
- import "./versionChecker-DeXuTfJ0.js";
3
+ import "./versionChecker-CS7qsffQ.js";
4
4
  import "./pidStore-DBjlqzo8.js";
5
5
  import "./globalPidIndex-yVd3mbsV.js";
6
6
 
@@ -1,11 +1,11 @@
1
- import "./ts-DvnOmOAf.js";
1
+ import "./ts-B4lhxCQx.js";
2
2
  import "./logger-B9h0djqx.js";
3
- import { r as getInstalledPackage } from "./versionChecker-DeXuTfJ0.js";
3
+ import { r as getInstalledPackage } from "./versionChecker-CS7qsffQ.js";
4
4
  import "./pidStore-DBjlqzo8.js";
5
5
  import "./globalPidIndex-yVd3mbsV.js";
6
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-DuCEAzP9.js";
6
+ import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-DQYx5cvl.js";
7
7
  import "./remotes-C3xPRtfg.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-DLJqD_Yj.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-B_JJRHkV.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";
@@ -51,6 +51,21 @@ const defaultOpts = (overrides = {}) => ({
51
51
  cwdScope: null,
52
52
  ...overrides
53
53
  });
54
+ const SESSION_PIN_ENV = new Set([
55
+ "CLAUDECODE",
56
+ "CLAUDE_CODE_SSE_PORT",
57
+ "CLAUDE_CODE_SESSION_ID",
58
+ "CLAUDE_CODE_CHILD_SESSION",
59
+ "CLAUDE_CODE_ENTRYPOINT"
60
+ ]);
61
+ function freshAgentEnv() {
62
+ const env = {};
63
+ for (const [k, v] of Object.entries(process.env)) {
64
+ if (v === void 0 || SESSION_PIN_ENV.has(k)) continue;
65
+ env[k] = v;
66
+ }
67
+ return env;
68
+ }
54
69
  const DAEMON_NAME = "agent-yes";
55
70
  async function ensureBootAutostart(oxmgrBin) {
56
71
  try {
@@ -669,6 +684,7 @@ Options:
669
684
  ...prompt ? ["--", prompt] : []
670
685
  ], {
671
686
  cwd,
687
+ env: freshAgentEnv(),
672
688
  stdin: "ignore",
673
689
  stdout: "ignore",
674
690
  stderr: "ignore"
@@ -773,4 +789,4 @@ Options:
773
789
 
774
790
  //#endregion
775
791
  export { cmdServe };
776
- //# sourceMappingURL=serve-CSupgu7Q.js.map
792
+ //# sourceMappingURL=serve-DJthZQAN.js.map
@@ -163,7 +163,7 @@ async function runSubcommand(argv) {
163
163
  case "restart": return await cmdRestart(rest);
164
164
  case "note": return await cmdNote(rest);
165
165
  case "serve": {
166
- const { cmdServe } = await import("./serve-CSupgu7Q.js");
166
+ const { cmdServe } = await import("./serve-DJthZQAN.js");
167
167
  return cmdServe(rest);
168
168
  }
169
169
  case "setup": {
@@ -1595,4 +1595,4 @@ async function cmdStatus(rest) {
1595
1595
 
1596
1596
  //#endregion
1597
1597
  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 };
1598
- //# sourceMappingURL=subcommands-DLJqD_Yj.js.map
1598
+ //# sourceMappingURL=subcommands-B_JJRHkV.js.map
@@ -1,6 +1,6 @@
1
1
  import "./logger-B9h0djqx.js";
2
2
  import "./globalPidIndex-yVd3mbsV.js";
3
3
  import "./remotes-C3xPRtfg.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-DLJqD_Yj.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-B_JJRHkV.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-DeXuTfJ0.js";
2
+ import { r as getInstalledPackage } from "./versionChecker-CS7qsffQ.js";
3
3
  import { n as agentYesHome, t as PidStore } from "./pidStore-DBjlqzo8.js";
4
4
  import { i as shouldUseLock, r as releaseLock, t as acquireLock } from "./runningLock-CJxsoGdb.js";
5
5
  import { i as readGlobalPids } from "./globalPidIndex-yVd3mbsV.js";
@@ -1713,4 +1713,4 @@ function sleep(ms) {
1713
1713
 
1714
1714
  //#endregion
1715
1715
  export { removeControlCharacters as a, AgentContext as i, agentYes as n, config as r, CLIS_CONFIG as t };
1716
- //# sourceMappingURL=ts-DvnOmOAf.js.map
1716
+ //# sourceMappingURL=ts-B4lhxCQx.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.116.0";
10
+ var version = "1.117.0";
11
11
 
12
12
  //#endregion
13
13
  //#region ts/versionChecker.ts
@@ -221,4 +221,4 @@ async function displayVersion() {
221
221
 
222
222
  //#endregion
223
223
  export { versionString as i, displayVersion as n, getInstalledPackage as r, checkAndAutoUpdate as t };
224
- //# sourceMappingURL=versionChecker-DeXuTfJ0.js.map
224
+ //# sourceMappingURL=versionChecker-CS7qsffQ.js.map
package/lab/ui/index.html CHANGED
@@ -1545,6 +1545,15 @@
1545
1545
  try {
1546
1546
  localStorage.setItem("ay.sel", sel);
1547
1547
  } catch {}
1548
+ // Reflect it in the URL hash as #room:pid. The fragment is never sent in
1549
+ // any request, so — unlike the old ?pid= query that landed in the server's
1550
+ // access logs — the agent id stays client-side, while still surviving a
1551
+ // refresh and being copy-pasteable as a deep link.
1552
+ try {
1553
+ const want = "#" + e._room + ":" + e.pid;
1554
+ if (location.hash !== want)
1555
+ history.replaceState(null, document.title, location.pathname + want);
1556
+ } catch {}
1548
1557
  // pid + tx are how we talk to the agent's own host; sel (composite) is
1549
1558
  // only for UI identity/highlight, since pids can collide across rooms.
1550
1559
  const pid = e.pid;
@@ -2256,7 +2265,23 @@
2256
2265
  }
2257
2266
  const full = pending ? null : /^([A-Za-z0-9_-]+):([^@]+)(?:@(.+))?$/.exec(h);
2258
2267
  const bare = /^([A-Za-z0-9_-]+)$/.exec(h);
2259
- if (full) {
2268
+ // Treat the colon form as #room:agentId only when there's no @host, the id
2269
+ // is a bare pid (digits), AND we can actually reconnect that room (it's
2270
+ // cached or local). Otherwise the second part must be the token we need to
2271
+ // connect — so a fresh browser still honours #room:token even when the token
2272
+ // is custom and happens to be all digits.
2273
+ // …and bounded to a plausible pid width (≤7 digits) so a long numeric
2274
+ // custom token can't be mistaken for an agent id. A returning user's room
2275
+ // token is persisted, so even a short numeric token reconnects fine from
2276
+ // cache; only the share-link form needs the token, which stays uneaten.
2277
+ const aidLike =
2278
+ full &&
2279
+ !full[3] &&
2280
+ /^\d{1,7}$/.test(full[2]) &&
2281
+ (full[1] === LOCAL || !!loadRooms()[full[1]]);
2282
+ if (full && !aidLike) {
2283
+ // #room:token — a share link. Connect, then eat the token so only #room
2284
+ // lingers.
2260
2285
  const [, room, token, host] = full;
2261
2286
  // SECURITY: strip the token from the URL immediately so it never lingers in
2262
2287
  // the omnibox, history, or a screenshot. Keep only the room mnemonic.
@@ -2266,6 +2291,16 @@
2266
2291
  location.pathname + location.search + "#" + room,
2267
2292
  );
2268
2293
  pending = { room, token, host };
2294
+ } else if (full) {
2295
+ // #room:agentId — a deep link to one agent in a (cached) room. The id is
2296
+ // not a secret, so it stays in the hash; reconnect the room from its
2297
+ // cached token and select the agent once it streams in. autoPid uses the
2298
+ // composite key so it picks the right host when pids collide across rooms.
2299
+ const [, room, aid] = full;
2300
+ autoPid = room + "#" + aid;
2301
+ autoPidExplicit = true;
2302
+ const r = loadRooms()[room];
2303
+ if (r) pending = { room, token: r.token, host: r.host };
2269
2304
  } else if (bare && loadRooms()[bare[1]]) {
2270
2305
  const r = loadRooms()[bare[1]];
2271
2306
  pending = { room: bare[1], token: r.token, host: r.host };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-yes",
3
- "version": "1.116.0",
3
+ "version": "1.117.0",
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/serve.ts CHANGED
@@ -65,6 +65,33 @@ const defaultOpts = (overrides: Partial<CommonOpts> = {}): CommonOpts => ({
65
65
  ...overrides,
66
66
  });
67
67
 
68
+ // The vars that pin a process to a PARENT Claude Code session — NOT the many
69
+ // other CLAUDE_CODE_* settings that configure provider/auth/limits (USE_BEDROCK,
70
+ // USE_VERTEX, MAX_OUTPUT_TOKENS, …), which must pass through untouched.
71
+ const SESSION_PIN_ENV = new Set([
72
+ "CLAUDECODE",
73
+ "CLAUDE_CODE_SSE_PORT",
74
+ "CLAUDE_CODE_SESSION_ID",
75
+ "CLAUDE_CODE_CHILD_SESSION",
76
+ "CLAUDE_CODE_ENTRYPOINT",
77
+ ]);
78
+
79
+ // Env for a console-spawned agent, minus only the session-pinning vars above. If
80
+ // `ay serve` was launched from inside Claude Code (or any shell carrying these),
81
+ // it would otherwise leak the parent's SSE port / session id into every spawned
82
+ // agent — so the new `claude` thinks it's a nested child and tries to attach to a
83
+ // stale port, surfacing as "fail to connect". Dropping them makes each agent a
84
+ // clean top-level session; all config/provider env (CLAUDE_EFFORT, CLAUDE_CODE_*
85
+ // settings) is preserved.
86
+ function freshAgentEnv(): Record<string, string> {
87
+ const env: Record<string, string> = {};
88
+ for (const [k, v] of Object.entries(process.env)) {
89
+ if (v === undefined || SESSION_PIN_ENV.has(k)) continue;
90
+ env[k] = v;
91
+ }
92
+ return env;
93
+ }
94
+
68
95
  // ---------------------------------------------------------------------------
69
96
  // ay serve install / uninstall / logs (oxmgr daemon management)
70
97
  // ---------------------------------------------------------------------------
@@ -860,6 +887,7 @@ export async function cmdServe(rest: string[]): Promise<number> {
860
887
  try {
861
888
  const child = Bun.spawn(["ay", cli, ...(prompt ? ["--", prompt] : [])], {
862
889
  cwd,
890
+ env: freshAgentEnv(), // don't leak our Claude Code session into the agent
863
891
  stdin: "ignore",
864
892
  stdout: "ignore",
865
893
  stderr: "ignore",
@@ -1,8 +0,0 @@
1
- import "./ts-DvnOmOAf.js";
2
- import "./logger-B9h0djqx.js";
3
- import "./versionChecker-DeXuTfJ0.js";
4
- import "./pidStore-DBjlqzo8.js";
5
- import "./globalPidIndex-yVd3mbsV.js";
6
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-DuCEAzP9.js";
7
-
8
- export { SUPPORTED_CLIS };