very-happy-cli 0.2.143 → 0.2.145

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.
Files changed (49) hide show
  1. package/dist/{AcpBackend-LEgn9vol.mjs → AcpBackend-BITeBnbV.mjs} +2 -2
  2. package/dist/{AcpBackend-B8oehrfU.cjs → AcpBackend-FPv5uXFa.cjs} +30 -30
  3. package/dist/{AcpSessionManager-BomdfyhZ.cjs → AcpSessionManager-vqLzM219.cjs} +9 -9
  4. package/dist/{AcpSessionManager-Yfbs5bi2.mjs → AcpSessionManager-w2srpWQJ.mjs} +1 -1
  5. package/dist/{agentGuidance-CJSl54ua.cjs → agentGuidance-Bd6GEiYp.cjs} +1 -1
  6. package/dist/{agentGuidance-BU4hxm8M.mjs → agentGuidance-HFHrz3C1.mjs} +1 -1
  7. package/dist/agentHome-CGl7FF7a.cjs +113 -0
  8. package/dist/agentHome-DBqr8rpv.mjs +107 -0
  9. package/dist/codex/happyMcpStdioBridge.cjs +2 -2
  10. package/dist/codex/happyMcpStdioBridge.mjs +2 -2
  11. package/dist/{config-euZ_K5Lo.mjs → config-B9zAvnGT.mjs} +4 -4
  12. package/dist/{config-CfqWoHmO.cjs → config-CPfFuHP6.cjs} +4 -4
  13. package/dist/{index-ZOMC8Gzn.mjs → index-BzLZu_aF.mjs} +8 -8
  14. package/dist/{index-PM_SsRpw.mjs → index-CxK0l_t0.mjs} +4 -4
  15. package/dist/{index-BREtikhm.cjs → index-D4Smqppj.cjs} +4 -4
  16. package/dist/{index-C510dSUn.cjs → index-DhwtFJEe.cjs} +309 -212
  17. package/dist/{index-Bj68y6ee.cjs → index-avfJgX4p.cjs} +31 -31
  18. package/dist/{index-DoiG88oX.mjs → index-eBrE-0R1.mjs} +136 -39
  19. package/dist/index.cjs +4 -4
  20. package/dist/index.mjs +4 -4
  21. package/dist/{installTerminalHooks-BGVQqbgq.mjs → installTerminalHooks-Dq1MFFDQ.mjs} +4 -4
  22. package/dist/{installTerminalHooks-C_jraM1j.cjs → installTerminalHooks-DspFGxBI.cjs} +4 -4
  23. package/dist/lib.cjs +5 -5
  24. package/dist/lib.mjs +2 -2
  25. package/dist/{limits-uABU-yq3.mjs → limits-CzWD9hWU.mjs} +8 -8
  26. package/dist/{limits-B3oVgqBJ.cjs → limits-DGZB-OVl.cjs} +7 -7
  27. package/dist/{mcp-G-3lL_KH.cjs → mcp-BioGrTC_.cjs} +9 -9
  28. package/dist/{mcp-CfbTQXyh.mjs → mcp-L1Yq25LB.mjs} +4 -4
  29. package/dist/{piRuntime-CWE-1W-y.cjs → piRuntime-DodWS0UI.cjs} +2 -2
  30. package/dist/{piRuntime-BE6iYQwU.mjs → piRuntime-UdVG4eJ7.mjs} +2 -2
  31. package/dist/{piTerminal-Dyc_9pGP.cjs → piTerminal-6P00O_w8.cjs} +6 -6
  32. package/dist/{piTerminal-rqKn1_Zy.mjs → piTerminal-BIRroC_N.mjs} +6 -6
  33. package/dist/{runGemini-BMlXIaTL.mjs → runGemini-B-It6K8t.mjs} +6 -6
  34. package/dist/{runGemini-C6qMFzcn.cjs → runGemini-ChCHjnIh.cjs} +24 -24
  35. package/dist/{runOpenClaw-C2_aCP7v.cjs → runOpenClaw-Cc4_zmHz.cjs} +26 -26
  36. package/dist/{runOpenClaw-CoO5Vp3S.mjs → runOpenClaw-DET6LY2v.mjs} +5 -5
  37. package/dist/{send-CBrJylJc.mjs → send-CPayvXBm.mjs} +4 -4
  38. package/dist/{send-DGVwmB-p.cjs → send-LBjLfAos.cjs} +4 -4
  39. package/dist/{sessions-DbLubh2N.mjs → sessions-CJUEp43_.mjs} +4 -4
  40. package/dist/{sessions-DyQXMN-8.cjs → sessions-WBowxNO-.cjs} +5 -5
  41. package/dist/{spawn-DIyFOn3W.cjs → spawn-BqgZc7YE.cjs} +6 -6
  42. package/dist/{spawn-wkkxEGdF.mjs → spawn-Dcetf5Jt.mjs} +4 -4
  43. package/dist/{teams-BTyVFK3P.mjs → teams-CW_Zb2Q1.mjs} +4 -4
  44. package/dist/{teams-QOkGFjkJ.cjs → teams-eIUxGmqg.cjs} +4 -4
  45. package/dist/{todo-DoLkqdBe.mjs → todo-CV5fwHg_.mjs} +3 -3
  46. package/dist/{todo-Du6pjwx_.cjs → todo-DeouLiGa.cjs} +5 -5
  47. package/dist/{types-BG4gFjLL.mjs → types-BbvxVQF3.mjs} +321 -11
  48. package/dist/{types-6__wqmmP.cjs → types-Bqo68u61.cjs} +328 -9
  49. package/package.json +7 -7
@@ -1,5 +1,5 @@
1
1
  import axios from 'axios';
2
- import { l as logger, g as encodeBase64, j as encrypt, k as decrypt, m as decodeBase64, c as configuration, o as readDaemonState, q as clearDaemonState, s as decryptBlob, t as prepareClipboardText, u as prepareClipboardHistoryText, f as readSettings, r as readPersistedSessions, v as credentialRelayProblem, p as packageJson, x as readTrackedClaudeSessionIds, y as readTrackedCodexThreadIds, z as libsodiumEncryptForPublicKey, A as libsodiumPublicKeyFromSecretKey, B as getRandomBytes, D as redactLogValue } from './limits-uABU-yq3.mjs';
2
+ import { l as logger, g as encodeBase64, j as encrypt, k as decrypt, m as decodeBase64, c as configuration, o as readDaemonState, q as clearDaemonState, s as decryptBlob, t as prepareClipboardText, v as prepareClipboardHistoryText, r as readSettings, d as readPersistedSessions, x as credentialRelayProblem, p as packageJson, y as readTrackedClaudeSessionIds, z as readTrackedCodexThreadIds, A as libsodiumEncryptForPublicKey, B as libsodiumPublicKeyFromSecretKey, D as getRandomBytes, E as redactLogValue } from './limits-CzWD9hWU.mjs';
3
3
  import { EventEmitter } from 'node:events';
4
4
  import { io } from 'socket.io-client';
5
5
  import * as z from 'zod';
@@ -19,7 +19,7 @@ import { join as join$1, isAbsolute, resolve as resolve$1 } from 'node:path';
19
19
  import os$1, { homedir } from 'node:os';
20
20
  import { spawn as spawn$2, spawnSync, execSync as execSync$1 } from 'node:child_process';
21
21
  import * as pty from 'node-pty';
22
- import { existsSync, statSync, writeFileSync, unlinkSync, readFileSync, mkdirSync, accessSync, constants, createReadStream, createWriteStream } from 'node:fs';
22
+ import { statSync, readdirSync, existsSync, writeFileSync, unlinkSync, readFileSync, mkdirSync, accessSync, constants, createReadStream, createWriteStream } from 'node:fs';
23
23
  import { existsSync as existsSync$1 } from 'fs';
24
24
  import tweetnacl from 'tweetnacl';
25
25
  import { createInterface } from 'node:readline';
@@ -4950,17 +4950,315 @@ function scrubTmuxClientEnv(env) {
4950
4950
  return env;
4951
4951
  }
4952
4952
 
4953
- function getClaudeConfigDir() {
4954
- return process.env.CLAUDE_CONFIG_DIR || join$1(homedir(), ".claude");
4953
+ const CLAUDE_CONFIG_DIR_ENV = "CLAUDE_CONFIG_DIR";
4954
+ const CODEX_HOME_ENV = "CODEX_HOME";
4955
+ const AGENT_HOME_ENV_NAMES = [CLAUDE_CONFIG_DIR_ENV, CODEX_HOME_ENV];
4956
+ function expandHomePath(value, homeDir) {
4957
+ const trimmed = value.trim();
4958
+ if (trimmed === "~") return homeDir;
4959
+ if (trimmed.startsWith("~/")) return join$1(homeDir, trimmed.slice(2));
4960
+ return isAbsolute(trimmed) ? trimmed : resolve$1(homeDir, trimmed);
4961
+ }
4962
+ function nonEmpty(value) {
4963
+ const trimmed = value?.trim();
4964
+ return trimmed ? trimmed : null;
4965
+ }
4966
+ function pick(envName, settingValue, input, defaultRelative) {
4967
+ const fromSettings = nonEmpty(settingValue);
4968
+ if (fromSettings) return { path: expandHomePath(fromSettings, input.homeDir), source: "settings" };
4969
+ const fromShell = nonEmpty(input.loginShellEnv?.[envName]);
4970
+ if (fromShell) return { path: expandHomePath(fromShell, input.homeDir), source: "login-shell" };
4971
+ const fromDaemon = nonEmpty(input.daemonEnv[envName]);
4972
+ if (fromDaemon) return { path: expandHomePath(fromDaemon, input.homeDir), source: "daemon-env" };
4973
+ return { path: join$1(input.homeDir, defaultRelative), source: "default" };
4974
+ }
4975
+ function resolveAgentHomes(input) {
4976
+ return {
4977
+ claudeConfigDir: pick(CLAUDE_CONFIG_DIR_ENV, input.settings.claudeConfigDir, input, ".claude"),
4978
+ codexHome: pick(CODEX_HOME_ENV, input.settings.codexHome, input, ".codex")
4979
+ };
4955
4980
  }
4956
- function getClaudeProjectsRoot() {
4957
- return join$1(getClaudeConfigDir(), "projects");
4981
+ function agentHomeEnv(homes) {
4982
+ const env = {};
4983
+ if (homes.claudeConfigDir.source !== "default") env[CLAUDE_CONFIG_DIR_ENV] = homes.claudeConfigDir.path;
4984
+ if (homes.codexHome.source !== "default") env[CODEX_HOME_ENV] = homes.codexHome.path;
4985
+ return env;
4958
4986
  }
4959
- function getProjectPath(workingDirectory) {
4960
- const projectId = resolve$1(workingDirectory).replace(/[^a-zA-Z0-9-]/g, "-");
4961
- return join$1(getClaudeProjectsRoot(), projectId);
4987
+ function claudeProjectDirName(workingDirectory) {
4988
+ return resolve$1(workingDirectory).replace(/[^a-zA-Z0-9-]/g, "-");
4989
+ }
4990
+ function claudeConversationPath(configDir, workingDirectory, claudeSessionId) {
4991
+ return join$1(configDir, "projects", claudeProjectDirName(workingDirectory), `${claudeSessionId}.jsonl`);
4992
+ }
4993
+ function agentHomeCandidates(kind, input, homes = resolveAgentHomes(input)) {
4994
+ const envName = kind === "claude" ? CLAUDE_CONFIG_DIR_ENV : CODEX_HOME_ENV;
4995
+ const resolved = kind === "claude" ? homes.claudeConfigDir : homes.codexHome;
4996
+ const raw = [
4997
+ resolved.path,
4998
+ nonEmpty(kind === "claude" ? input.settings.claudeConfigDir : input.settings.codexHome),
4999
+ nonEmpty(input.loginShellEnv?.[envName]),
5000
+ nonEmpty(input.daemonEnv[envName]),
5001
+ join$1(input.homeDir, kind === "claude" ? ".claude" : ".codex")
5002
+ ];
5003
+ const out = [];
5004
+ for (const value of raw) {
5005
+ if (!value) continue;
5006
+ const expanded = expandHomePath(value, input.homeDir);
5007
+ if (!out.includes(expanded)) out.push(expanded);
5008
+ }
5009
+ return out;
5010
+ }
5011
+ function findClaudeConversation(claudeSessionId, workingDirectory, candidates, fileSize) {
5012
+ let best = null;
5013
+ let bestSize = -1;
5014
+ for (let i = 0; i < candidates.length; i++) {
5015
+ const file = claudeConversationPath(candidates[i], workingDirectory, claudeSessionId);
5016
+ const size = fileSize(file);
5017
+ if (size === null || size <= bestSize) continue;
5018
+ best = { home: candidates[i], file, resolved: i === 0 };
5019
+ bestSize = size;
5020
+ }
5021
+ return best;
5022
+ }
5023
+ function codexRolloutFileMatches(fileName, threadId) {
5024
+ return fileName.startsWith("rollout-") && fileName.endsWith(`-${threadId}.jsonl`);
5025
+ }
5026
+ function findCodexThread(threadId, candidates, listDir) {
5027
+ const digits = /^\d+$/;
5028
+ for (let i = 0; i < candidates.length; i++) {
5029
+ const sessions = join$1(candidates[i], "sessions");
5030
+ for (const year of listDir(sessions).filter((name) => digits.test(name)).sort().reverse()) {
5031
+ for (const month of listDir(join$1(sessions, year)).filter((name) => digits.test(name)).sort().reverse()) {
5032
+ for (const day of listDir(join$1(sessions, year, month)).filter((name) => digits.test(name)).sort().reverse()) {
5033
+ const dayDir = join$1(sessions, year, month, day);
5034
+ const hit = listDir(dayDir).find((name) => codexRolloutFileMatches(name, threadId));
5035
+ if (hit) return { home: candidates[i], file: join$1(dayDir, hit), resolved: i === 0 };
5036
+ }
5037
+ }
5038
+ }
5039
+ }
5040
+ return null;
5041
+ }
5042
+ function describeAgentHome(choice) {
5043
+ const source = {
5044
+ settings: "settings.json",
5045
+ "login-shell": "login shell",
5046
+ "daemon-env": "daemon environment",
5047
+ default: "default"
5048
+ };
5049
+ return `${choice.path} (${source[choice.source]})`;
4962
5050
  }
4963
5051
 
5052
+ const LOGIN_SHELL_ENV_MARKER = "__VH_ENV__";
5053
+ const LOGIN_SHELL_PROBE_TIMEOUT_MS = 3e3;
5054
+ function loginShellProbeScript(names) {
5055
+ const pairs = names.map((name) => `${name} "$${name}"`).join(" ");
5056
+ return `printf '${LOGIN_SHELL_ENV_MARKER}%s=%s\\n' ${pairs}`;
5057
+ }
5058
+ function parseLoginShellEnv(output, names) {
5059
+ const wanted = new Set(names);
5060
+ const env = {};
5061
+ for (const rawLine of output.split(/\r?\n/)) {
5062
+ const at = rawLine.indexOf(LOGIN_SHELL_ENV_MARKER);
5063
+ if (at < 0) continue;
5064
+ const line = rawLine.slice(at + LOGIN_SHELL_ENV_MARKER.length);
5065
+ const eq = line.indexOf("=");
5066
+ if (eq <= 0) continue;
5067
+ const name = line.slice(0, eq);
5068
+ if (!wanted.has(name)) continue;
5069
+ const value = line.slice(eq + 1).trim();
5070
+ env[name] = value ? value : void 0;
5071
+ }
5072
+ return env;
5073
+ }
5074
+ function probeLoginShellEnv(names, options = {}) {
5075
+ const platform = options.platform ?? process.platform;
5076
+ if (platform === "win32") return Promise.resolve(null);
5077
+ const shell = (options.shell ?? process.env.SHELL ?? "").trim() || "/bin/sh";
5078
+ const timeoutMs = options.timeoutMs ?? LOGIN_SHELL_PROBE_TIMEOUT_MS;
5079
+ return new Promise((resolve) => {
5080
+ let stdout = "";
5081
+ let settled = false;
5082
+ const finish = (value) => {
5083
+ if (settled) return;
5084
+ settled = true;
5085
+ clearTimeout(timer);
5086
+ resolve(value);
5087
+ };
5088
+ let child;
5089
+ try {
5090
+ child = spawn$2(shell, ["-l", "-i", "-c", loginShellProbeScript(names)], {
5091
+ stdio: ["ignore", "pipe", "ignore"],
5092
+ env: options.env ?? process.env,
5093
+ windowsHide: true
5094
+ });
5095
+ } catch {
5096
+ resolve(null);
5097
+ return;
5098
+ }
5099
+ const timer = setTimeout(() => {
5100
+ try {
5101
+ child.kill("SIGKILL");
5102
+ } catch {
5103
+ }
5104
+ finish(null);
5105
+ }, timeoutMs);
5106
+ child.stdout?.on("data", (chunk) => {
5107
+ stdout += chunk.toString("utf8");
5108
+ });
5109
+ child.on("error", () => finish(null));
5110
+ child.on("close", () => {
5111
+ finish(stdout.includes(LOGIN_SHELL_ENV_MARKER) ? parseLoginShellEnv(stdout, names) : null);
5112
+ });
5113
+ });
5114
+ }
5115
+
5116
+ const AGENT_HOME_CACHE_MS = 6e4;
5117
+ const AGENT_HOME_FAILURE_CACHE_MS = 5 * 6e4;
5118
+ let cache = null;
5119
+ let inFlight = null;
5120
+ let originalDaemonEnv = null;
5121
+ function snapshotDaemonEnv() {
5122
+ if (!originalDaemonEnv) {
5123
+ originalDaemonEnv = {};
5124
+ for (const name of AGENT_HOME_ENV_NAMES) originalDaemonEnv[name] = process.env[name];
5125
+ }
5126
+ return originalDaemonEnv;
5127
+ }
5128
+ async function load(now) {
5129
+ const settings = await readSettings();
5130
+ const loginShellEnv = await probeLoginShellEnv(AGENT_HOME_ENV_NAMES);
5131
+ const input = {
5132
+ settings: { claudeConfigDir: settings.claudeConfigDir, codexHome: settings.codexHome },
5133
+ daemonEnv: snapshotDaemonEnv(),
5134
+ loginShellEnv,
5135
+ homeDir: homedir()
5136
+ };
5137
+ const homes = resolveAgentHomes(input);
5138
+ return {
5139
+ input,
5140
+ homes,
5141
+ expiresAt: now + (loginShellEnv ? AGENT_HOME_CACHE_MS : AGENT_HOME_FAILURE_CACHE_MS)
5142
+ };
5143
+ }
5144
+ async function refreshAgentHomes(now = Date.now()) {
5145
+ if (cache && cache.expiresAt > now) return cache.homes;
5146
+ if (!inFlight) {
5147
+ inFlight = load(now).finally(() => {
5148
+ inFlight = null;
5149
+ });
5150
+ }
5151
+ let entry;
5152
+ try {
5153
+ entry = await inFlight;
5154
+ } catch (error) {
5155
+ logger.debug("[AGENT HOME] resolve failed, falling back", error);
5156
+ if (cache) return cache.homes;
5157
+ const input = { settings: {}, daemonEnv: snapshotDaemonEnv(), loginShellEnv: null, homeDir: homedir() };
5158
+ return resolveAgentHomes(input);
5159
+ }
5160
+ const previous = cache?.homes;
5161
+ cache = entry;
5162
+ applyAgentHomesToProcessEnv(entry.homes);
5163
+ if (!previous || previous.claudeConfigDir.path !== entry.homes.claudeConfigDir.path || previous.codexHome.path !== entry.homes.codexHome.path) {
5164
+ logger.debug(`[AGENT HOME] Claude config dir: ${describeAgentHome(entry.homes.claudeConfigDir)}; Codex home: ${describeAgentHome(entry.homes.codexHome)}`);
5165
+ }
5166
+ return entry.homes;
5167
+ }
5168
+ function currentAgentHomes() {
5169
+ return cache?.homes ?? null;
5170
+ }
5171
+ function resetAgentHomesCache() {
5172
+ cache = null;
5173
+ inFlight = null;
5174
+ originalDaemonEnv = null;
5175
+ }
5176
+ function applyAgentHomesToProcessEnv(homes) {
5177
+ const overlay = agentHomeEnv(homes);
5178
+ for (const name of AGENT_HOME_ENV_NAMES) {
5179
+ const next = overlay[name];
5180
+ if (next === void 0) {
5181
+ const original = snapshotDaemonEnv()[name];
5182
+ if (original === void 0) delete process.env[name];
5183
+ else process.env[name] = original;
5184
+ } else if (process.env[name] !== next) {
5185
+ process.env[name] = next;
5186
+ }
5187
+ }
5188
+ }
5189
+ function listDirSafe(path) {
5190
+ try {
5191
+ return readdirSync(path);
5192
+ } catch {
5193
+ return [];
5194
+ }
5195
+ }
5196
+ function fileSizeSafe(path) {
5197
+ try {
5198
+ const st = statSync(path);
5199
+ return st.isFile() ? st.size : null;
5200
+ } catch {
5201
+ return null;
5202
+ }
5203
+ }
5204
+ function locateClaudeConversation(workingDirectory, claudeSessionId) {
5205
+ const entry = cache;
5206
+ if (!entry) {
5207
+ const input = { settings: {}, daemonEnv: process.env, loginShellEnv: null, homeDir: homedir() };
5208
+ return findClaudeConversation(claudeSessionId, workingDirectory, agentHomeCandidates("claude", input), fileSizeSafe);
5209
+ }
5210
+ return findClaudeConversation(claudeSessionId, workingDirectory, agentHomeCandidates("claude", entry.input, entry.homes), fileSizeSafe);
5211
+ }
5212
+ function locateCodexThread(codexThreadId) {
5213
+ const entry = cache;
5214
+ const input = entry?.input ?? { settings: {}, daemonEnv: process.env, loginShellEnv: null, homeDir: homedir() };
5215
+ return findCodexThread(codexThreadId, agentHomeCandidates("codex", input, entry?.homes), listDirSafe);
5216
+ }
5217
+ function agentHomeSpawnEnv(input) {
5218
+ const env = {};
5219
+ if (input.claudeSessionId) {
5220
+ const hit = locateClaudeConversation(input.workingDirectory, input.claudeSessionId);
5221
+ if (hit && !hit.resolved) {
5222
+ env[CLAUDE_CONFIG_DIR_ENV] = hit.home;
5223
+ logger.debug(`[AGENT HOME] Claude conversation ${input.claudeSessionId} found under ${hit.home}; overriding ${CLAUDE_CONFIG_DIR_ENV} for this spawn`);
5224
+ }
5225
+ }
5226
+ if (input.codexThreadId) {
5227
+ const hit = locateCodexThread(input.codexThreadId);
5228
+ if (hit && !hit.resolved) {
5229
+ env[CODEX_HOME_ENV] = hit.home;
5230
+ logger.debug(`[AGENT HOME] Codex thread ${input.codexThreadId} found under ${hit.home}; overriding ${CODEX_HOME_ENV} for this spawn`);
5231
+ }
5232
+ }
5233
+ return env;
5234
+ }
5235
+
5236
+ var index = /*#__PURE__*/Object.freeze({
5237
+ __proto__: null,
5238
+ AGENT_HOME_CACHE_MS: AGENT_HOME_CACHE_MS,
5239
+ AGENT_HOME_ENV_NAMES: AGENT_HOME_ENV_NAMES,
5240
+ AGENT_HOME_FAILURE_CACHE_MS: AGENT_HOME_FAILURE_CACHE_MS,
5241
+ CLAUDE_CONFIG_DIR_ENV: CLAUDE_CONFIG_DIR_ENV,
5242
+ CODEX_HOME_ENV: CODEX_HOME_ENV,
5243
+ agentHomeCandidates: agentHomeCandidates,
5244
+ agentHomeEnv: agentHomeEnv,
5245
+ agentHomeSpawnEnv: agentHomeSpawnEnv,
5246
+ claudeConversationPath: claudeConversationPath,
5247
+ claudeProjectDirName: claudeProjectDirName,
5248
+ codexRolloutFileMatches: codexRolloutFileMatches,
5249
+ currentAgentHomes: currentAgentHomes,
5250
+ describeAgentHome: describeAgentHome,
5251
+ expandHomePath: expandHomePath,
5252
+ findClaudeConversation: findClaudeConversation,
5253
+ findCodexThread: findCodexThread,
5254
+ locateClaudeConversation: locateClaudeConversation,
5255
+ locateCodexThread: locateCodexThread,
5256
+ probeLoginShellEnv: probeLoginShellEnv,
5257
+ refreshAgentHomes: refreshAgentHomes,
5258
+ resetAgentHomesCache: resetAgentHomesCache,
5259
+ resolveAgentHomes: resolveAgentHomes
5260
+ });
5261
+
4964
5262
  var xtermHeadless = {};
4965
5263
 
4966
5264
  var hasRequiredXtermHeadless;
@@ -11321,7 +11619,8 @@ class WebTerminalManager {
11321
11619
  return false;
11322
11620
  }
11323
11621
  },
11324
- conversationExists: (cwd, claudeSessionId) => existsSync(join$1(getProjectPath(cwd), `${claudeSessionId}.jsonl`)),
11622
+ // B-478: every Claude config dir the user might have pointed a shell at.
11623
+ conversationExists: (cwd, claudeSessionId) => locateClaudeConversation(cwd, claudeSessionId) !== null,
11325
11624
  // B-273: only consulted for records that were attach terminals.
11326
11625
  // Unbounded: the panel's 50-row cap must not hide a restore target.
11327
11626
  userSessions: record.attachTmux ? this.listUserTmuxSessions(Infinity) : [],
@@ -12671,6 +12970,17 @@ function detectResumeSupport(happyHomeDir = configuration.happyHomeDir) {
12671
12970
  };
12672
12971
  }
12673
12972
 
12973
+ function getClaudeConfigDir() {
12974
+ return process.env.CLAUDE_CONFIG_DIR || join$1(homedir(), ".claude");
12975
+ }
12976
+ function getClaudeProjectsRoot() {
12977
+ return join$1(getClaudeConfigDir(), "projects");
12978
+ }
12979
+ function getProjectPath(workingDirectory) {
12980
+ const projectId = resolve$1(workingDirectory).replace(/[^a-zA-Z0-9-]/g, "-");
12981
+ return join$1(getClaudeProjectsRoot(), projectId);
12982
+ }
12983
+
12674
12984
  const TITLE_PROMPT_PREFIX = "Summarize the SPECIFIC topic/request of this message into a 3-6 word title";
12675
12985
  const BOARD_ANALYZER_PROMPT_PREFIX = "You are a status analyzer for a task board of coding-agent sessions.";
12676
12986
  const VERY_HAPPY_ONE_SHOT_PROMPT_PREFIXES = [
@@ -16980,4 +17290,4 @@ const RawJSONLinesSchema = z$1.discriminatedUnion("type", [
16980
17290
  }).passthrough()
16981
17291
  ]);
16982
17292
 
16983
- export { shellescape as $, ApiClient as A, BUILTIN_TODO_SKILL as B, getLocalHappyAgentCredentialPath as C, readLocalHappyAgentCredentials as D, parseExactVersion as E, compareExactVersions as F, extractCompleteLines as G, decideBackfill as H, InvalidateSync as I, parseTerminalHookPayload as J, tmuxArgs as K, scrubTmuxClientEnv as L, MAX_CHAT_ATTACHMENT_SOURCE_BYTES as M, decideMirrorBinding as N, MIRROR_BACKFILL_LINES_DEFAULT as O, mirrorLineKey as P, mirrorLocalId as Q, RawJSONLinesSchema as R, STREAM_DELTA_MAX_CHARS as S, listDaemonSessions as T, stopDaemonSession as U, detectCLIAvailability as V, detectResumeSupport as W, isDaemonRunningCurrentlyInstalledHappyVersion as X, stopDaemon as Y, TurnActivityTracker as Z, summarizeSpawnSessionForLog as _, ApiSessionClient as a, fetchCliUpdateState as a0, resolveCliUpdateCheckInterval as a1, DEFAULT_CLI_UPDATE_CHECK_INTERVAL_MS as a2, cleanupDaemonState as a3, listVhTerminals as a4, isValidTerminalId as a5, readVhTerminal as a6, sendToVhTerminal as a7, ContextUsageSchema as a8, TITLE_PROMPT_PREFIX as a9, BOARD_ANALYZER_PROMPT_PREFIX as aa, startOfflineReconnection as ab, CodexAppServerClient as ac, api as ad, streamKeyOf as b, checkIfDaemonRunningAndCleanupStaleState as c, createEnvelope as d, createBuiltinTodoClient as e, pushFilePreviewViaDaemon as f, setTerminalTitleViaDaemon as g, connectionState as h, isValidSessionId as i, BUILTIN_TODO_DISCOVERY as j, errorLogMetadata as k, contentLogMetadata as l, delay as m, notifyDaemonSessionStarted as n, notifyDaemonSessionEvent as o, pushClipboardViaDaemon as p, getProjectPath as q, initializeSandbox as r, spawnDaemonSession as s, AsyncLock as t, notifyDaemonClaudeAuthFailed as u, commandOnPath as v, wrapCommand as w, deriveLocalCliUpdateSummary as x, AGENT_VERSION_SOURCES as y, isClaudeSessionId as z };
17293
+ export { detectResumeSupport as $, ApiClient as A, BUILTIN_TODO_SKILL as B, notifyDaemonClaudeAuthFailed as C, commandOnPath as D, deriveLocalCliUpdateSummary as E, AGENT_VERSION_SOURCES as F, isClaudeSessionId as G, getLocalHappyAgentCredentialPath as H, InvalidateSync as I, readLocalHappyAgentCredentials as J, parseExactVersion as K, compareExactVersions as L, MAX_CHAT_ATTACHMENT_SOURCE_BYTES as M, extractCompleteLines as N, decideBackfill as O, parseTerminalHookPayload as P, tmuxArgs as Q, RawJSONLinesSchema as R, STREAM_DELTA_MAX_CHARS as S, scrubTmuxClientEnv as T, decideMirrorBinding as U, MIRROR_BACKFILL_LINES_DEFAULT as V, mirrorLineKey as W, mirrorLocalId as X, listDaemonSessions as Y, stopDaemonSession as Z, detectCLIAvailability as _, ApiSessionClient as a, refreshAgentHomes as a0, isDaemonRunningCurrentlyInstalledHappyVersion as a1, stopDaemon as a2, TurnActivityTracker as a3, summarizeSpawnSessionForLog as a4, locateClaudeConversation as a5, agentHomeSpawnEnv as a6, shellescape as a7, fetchCliUpdateState as a8, resolveCliUpdateCheckInterval as a9, DEFAULT_CLI_UPDATE_CHECK_INTERVAL_MS as aa, cleanupDaemonState as ab, listVhTerminals as ac, isValidTerminalId as ad, readVhTerminal as ae, sendToVhTerminal as af, ContextUsageSchema as ag, TITLE_PROMPT_PREFIX as ah, BOARD_ANALYZER_PROMPT_PREFIX as ai, startOfflineReconnection as aj, CodexAppServerClient as ak, index as al, api as am, AGENT_HOME_ENV_NAMES as b, checkIfDaemonRunningAndCleanupStaleState as c, describeAgentHome as d, expandHomePath as e, streamKeyOf as f, createEnvelope as g, createBuiltinTodoClient as h, isValidSessionId as i, pushClipboardViaDaemon as j, pushFilePreviewViaDaemon as k, setTerminalTitleViaDaemon as l, connectionState as m, notifyDaemonSessionStarted as n, BUILTIN_TODO_DISCOVERY as o, probeLoginShellEnv as p, errorLogMetadata as q, resolveAgentHomes as r, spawnDaemonSession as s, contentLogMetadata as t, delay as u, notifyDaemonSessionEvent as v, getProjectPath as w, initializeSandbox as x, wrapCommand as y, AsyncLock as z };