@rayss-dev/openclaude 0.31.2-by-rayss → 0.33.2-by-rayss

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 (5) hide show
  1. package/README.md +9 -0
  2. package/dist/acp.mjs +3920 -3292
  3. package/dist/cli.mjs +165 -157
  4. package/dist/sdk.mjs +664 -353
  5. package/package.json +1 -1
package/dist/sdk.mjs CHANGED
@@ -10131,7 +10131,7 @@ var init_version = __esm(() => {
10131
10131
  import_semver = __toESM(require_semver2(), 1);
10132
10132
  fallbackBuildVersion = (() => {
10133
10133
  try {
10134
- return "0.31.2-by-rayss";
10134
+ return "0.33.2-by-rayss";
10135
10135
  } catch {
10136
10136
  return "0.0.0";
10137
10137
  }
@@ -69154,6 +69154,10 @@ function inferRemoteModelOpenAIShimConfig(modelApiName, catalogEntry3) {
69154
69154
  removeBodyFields: ["store"]
69155
69155
  };
69156
69156
  }
69157
+ const hasAnthropicModel = segments.some((s) => /^(?:[a-z]{2,4}\.)?(?:claude|anthropic)|^(?:sonnet|opus|haiku)-\d/.test(s));
69158
+ if (hasAnthropicModel) {
69159
+ return { removeBodyFields: ["store"] };
69160
+ }
69157
69161
  const hasGlm = segments.some((s) => /^glm-\d/.test(s));
69158
69162
  const isFireworks = segments.some((s) => s === "fireworks");
69159
69163
  if (hasGlm && !isFireworks && !catalogEntry3) {
@@ -70361,7 +70365,7 @@ function getAttributionHeader(fingerprint, policy) {
70361
70365
  if (!policy.generate) {
70362
70366
  return "";
70363
70367
  }
70364
- const version2 = `${"0.31.2-by-rayss"}.${fingerprint}`;
70368
+ const version2 = `${"0.33.2-by-rayss"}.${fingerprint}`;
70365
70369
  const entrypoint = process.env.CLAUDE_CODE_ENTRYPOINT ?? "unknown";
70366
70370
  const cch = "";
70367
70371
  const workload = getWorkload();
@@ -103997,7 +104001,7 @@ var init_metadata = __esm(() => {
103997
104001
  COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
103998
104002
  WHITESPACE_REGEX = /\s+/;
103999
104003
  getVersionBase = memoize_default(() => {
104000
- const match = "0.31.2-by-rayss".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
104004
+ const match = "0.33.2-by-rayss".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
104001
104005
  return match ? match[0] : undefined;
104002
104006
  });
104003
104007
  buildEnvContext = memoize_default(async () => {
@@ -104037,9 +104041,9 @@ var init_metadata = __esm(() => {
104037
104041
  isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
104038
104042
  isClaudeCodeAction: isEnvTruthy(process.env.CLAUDE_CODE_ACTION),
104039
104043
  isClaudeAiAuth: isClaudeAISubscriber(),
104040
- version: "0.31.2-by-rayss",
104044
+ version: "0.33.2-by-rayss",
104041
104045
  versionBase: getVersionBase(),
104042
- buildTime: "2026-10-08T13:31:49.092Z",
104046
+ buildTime: "2026-10-23T01:50:01.313Z",
104043
104047
  deploymentEnvironment: env2.detectDeploymentEnvironment(),
104044
104048
  ...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
104045
104049
  githubEventName: process.env.GITHUB_EVENT_NAME,
@@ -111629,16 +111633,6 @@ function normalizeReasoningLevels(levels) {
111629
111633
  const normalized = (levels ?? DEFAULT_REASONING_LEVELS).filter(isSupportedEffortLevel);
111630
111634
  return normalized.length > 0 ? normalized : [...DEFAULT_REASONING_LEVELS];
111631
111635
  }
111632
- function normalizeMetadataReasoningLevels(wireFormat, levels) {
111633
- const normalized = normalizeReasoningLevels(levels);
111634
- if (wireFormat === "deepseek_compatible") {
111635
- return normalized.filter((level) => DEEPSEEK_METADATA_COMPAT_LEVELS.includes(level));
111636
- }
111637
- if (wireFormat === "zai_compatible") {
111638
- return normalized.filter((level) => ZAI_METADATA_COMPAT_LEVELS.includes(level));
111639
- }
111640
- return normalized;
111641
- }
111642
111636
  function normalizeReasoningDefaultLevel(level, levels) {
111643
111637
  if (!level || !isSupportedEffortLevel(level)) {
111644
111638
  return;
@@ -111678,14 +111672,6 @@ function normalizeReasoningThinkingType(value) {
111678
111672
  }
111679
111673
  return;
111680
111674
  }
111681
- function normalizeDeepSeekReasoningEffort(effort) {
111682
- return effort === "xhigh" || effort === "max" ? "max" : "high";
111683
- }
111684
- function normalizeZaiReasoningEffort(effort, supportsLowEffort = false) {
111685
- if (supportsLowEffort && effort === "low")
111686
- return "low";
111687
- return effort === "xhigh" || effort === "max" ? "max" : "high";
111688
- }
111689
111675
  function resolveCompatibilityWireFormat(model, thinkingRequestFormat, routeIdOverride, useRuntimeFallback = true, processEnv = process.env) {
111690
111676
  if (thinkingRequestFormat === "deepseek-compatible") {
111691
111677
  return "deepseek_compatible";
@@ -111793,7 +111779,7 @@ function resolveMetadataReasoningControl(model, context) {
111793
111779
  };
111794
111780
  }
111795
111781
  const wireFormat = reasoning.wireFormat;
111796
- const levels = reasoning.mode === "levels" ? normalizeMetadataReasoningLevels(wireFormat, reasoning.levels) : [];
111782
+ const levels = reasoning.mode === "levels" ? normalizeReasoningLevels(reasoning.levels) : [];
111797
111783
  const controllable = Boolean(capabilities?.supportsReasoning !== false && metadataWireFormatSupportsEffort(wireFormat) && reasoning.mode === "levels" && levels.length > 0);
111798
111784
  return {
111799
111785
  supportsReasoning: capabilities?.supportsReasoning ?? true,
@@ -111859,6 +111845,9 @@ function legacyModelSupportsEffort(model, context) {
111859
111845
  if (modelUsesOpenAIEffort(model, context) && (context?.routeId === "custom" || resolveActiveRouteIdFromEnv(process.env) === "custom")) {
111860
111846
  return true;
111861
111847
  }
111848
+ if (context?.routeId === "custom" && getReasoningApiProvider(context) === "openai") {
111849
+ return true;
111850
+ }
111862
111851
  if (modelUsesOpenAIEffort(model, context) && modelSupportsCodexReasoningEffort(model, context)) {
111863
111852
  return true;
111864
111853
  }
@@ -111949,7 +111938,7 @@ function resolveOpenAIShimReasoningRequestPlan(options) {
111949
111938
  if (wireFormat === "deepseek_compatible") {
111950
111939
  const thinkingType = requestedThinkingType ?? defaultThinkingType;
111951
111940
  const shouldEnableThinking = thinkingType !== "disabled" && (thinkingType === "enabled" || options.requestedEffort !== undefined);
111952
- const reasoningEffort = shouldEnableThinking && options.requestedEffort ? normalizeDeepSeekReasoningEffort(options.requestedEffort) : undefined;
111941
+ const reasoningEffort = shouldEnableThinking && options.requestedEffort ? options.requestedEffort : undefined;
111953
111942
  return {
111954
111943
  thinkingType: shouldEnableThinking ? "enabled" : requestedThinkingType === "disabled" ? "disabled" : undefined,
111955
111944
  reasoningEffort,
@@ -111961,7 +111950,7 @@ function resolveOpenAIShimReasoningRequestPlan(options) {
111961
111950
  const thinkingType = requestedThinkingType ?? defaultThinkingType;
111962
111951
  if (thinkingType === "disabled") {
111963
111952
  const supportsLowEffort = metadataWireFormat === "zai_compatible" && options.reasoningControl?.levels.includes("low") === true && options.reasoningControl.disableFormat !== "thinking_type_disabled";
111964
- const translatedEffort = supportsLowEffort && options.requestedEffort ? normalizeZaiReasoningEffort(options.requestedEffort, true) : "low";
111953
+ const translatedEffort = supportsLowEffort && options.requestedEffort ? options.requestedEffort : "low";
111965
111954
  return {
111966
111955
  thinkingType: supportsLowEffort ? "enabled" : "disabled",
111967
111956
  reasoningEffort: supportsLowEffort ? translatedEffort : undefined,
@@ -111971,7 +111960,7 @@ function resolveOpenAIShimReasoningRequestPlan(options) {
111971
111960
  }
111972
111961
  const shouldEnableThinking = thinkingType === "enabled" || options.requestedEffort !== undefined;
111973
111962
  const metadataZaiSupportsReasoningEffort = metadataWireFormat === "zai_compatible" && (options.reasoningControl?.levels.length ?? 0) > 0;
111974
- const reasoningEffort = options.requestedEffort && (metadataZaiSupportsReasoningEffort || metadataWireFormat !== "zai_compatible" && supportsZaiReasoningEffort(options.model)) ? normalizeZaiReasoningEffort(options.requestedEffort, options.reasoningControl?.levels.includes("low") === true) : undefined;
111963
+ const reasoningEffort = options.requestedEffort && (metadataZaiSupportsReasoningEffort || metadataWireFormat !== "zai_compatible" && supportsZaiReasoningEffort(options.model)) ? options.requestedEffort : undefined;
111975
111964
  return {
111976
111965
  thinkingType: shouldEnableThinking ? "enabled" : undefined,
111977
111966
  reasoningEffort,
@@ -112177,7 +112166,7 @@ function getLegacyDefaultEffortForModel(model, context) {
112177
112166
  }
112178
112167
  return;
112179
112168
  }
112180
- var EFFORT_LEVELS, DEFAULT_REASONING_LEVELS, OPENAI_SHIM_COMPAT_LEVELS, DEEPSEEK_METADATA_COMPAT_LEVELS, ZAI_METADATA_COMPAT_LEVELS, GLOBAL_EFFORT_LEVELS, OPUS_DEFAULT_EFFORT_CONFIG_DEFAULT;
112169
+ var EFFORT_LEVELS, DEFAULT_REASONING_LEVELS, OPENAI_SHIM_COMPAT_LEVELS, GLOBAL_EFFORT_LEVELS, OPUS_DEFAULT_EFFORT_CONFIG_DEFAULT;
112181
112170
  var init_effort = __esm(() => {
112182
112171
  init_thinking();
112183
112172
  init_settings2();
@@ -112201,8 +112190,6 @@ var init_effort = __esm(() => {
112201
112190
  ];
112202
112191
  DEFAULT_REASONING_LEVELS = ["low", "medium", "high"];
112203
112192
  OPENAI_SHIM_COMPAT_LEVELS = ["low", "medium", "high", "xhigh"];
112204
- DEEPSEEK_METADATA_COMPAT_LEVELS = ["high", "xhigh"];
112205
- ZAI_METADATA_COMPAT_LEVELS = ["low", "medium", "high", "xhigh"];
112206
112193
  GLOBAL_EFFORT_LEVELS = ["low", "medium", "high", "xhigh", "max", "ultracode"];
112207
112194
  OPUS_DEFAULT_EFFORT_CONFIG_DEFAULT = {
112208
112195
  enabled: true,
@@ -112213,11 +112200,11 @@ var init_effort = __esm(() => {
112213
112200
 
112214
112201
  // src/utils/userAgent.ts
112215
112202
  function getClaudeCodeUserAgent() {
112216
- return `claude-code/${"0.31.2-by-rayss"}`;
112203
+ return `claude-code/${"0.33.2-by-rayss"}`;
112217
112204
  }
112218
112205
  function getOpenClaudeUserAgent() {
112219
112206
  try {
112220
- return `openclaude/${"0.31.2-by-rayss"}`;
112207
+ return `openclaude/${"0.33.2-by-rayss"}`;
112221
112208
  } catch {
112222
112209
  return "openclaude/0.0.0";
112223
112210
  }
@@ -112229,7 +112216,7 @@ function getUserAgent() {
112229
112216
  const clientApp = process.env.CLAUDE_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}` : "";
112230
112217
  const workload = getWorkload();
112231
112218
  const workloadSuffix = workload ? `, workload/${workload}` : "";
112232
- return `claude-cli/${"0.31.2-by-rayss"} (${process.env.USER_TYPE}, ${process.env.CLAUDE_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
112219
+ return `claude-cli/${"0.33.2-by-rayss"} (${process.env.USER_TYPE}, ${process.env.CLAUDE_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
112233
112220
  }
112234
112221
  function getMCPUserAgent() {
112235
112222
  const parts = [];
@@ -112243,7 +112230,7 @@ function getMCPUserAgent() {
112243
112230
  parts.push(`client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}`);
112244
112231
  }
112245
112232
  const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
112246
- return `claude-code/${"0.31.2-by-rayss"}${suffix}`;
112233
+ return `claude-code/${"0.33.2-by-rayss"}${suffix}`;
112247
112234
  }
112248
112235
  function getWebFetchUserAgent() {
112249
112236
  const supportUrl = isFirstPartyAnthropicProvider() ? "https://support.anthropic.com/" : "https://github.com/rayss868/openclaude";
@@ -116009,6 +115996,12 @@ function tempPathFor(targetPath, writeId) {
116009
115996
  const resolved = resolve14(targetPath);
116010
115997
  return join35(dirname18(resolved), `${basename6(resolved)}.${writeId}.openclaude.tmp`);
116011
115998
  }
115999
+ function unknownWriteIdError(writeId, targetPath) {
116000
+ const resolved = resolve14(targetPath);
116001
+ const active = [...states.values()].find((state) => state.targetPath === resolved);
116002
+ const recovery = active ? ` An active chunked write for this path uses write_id ` + `${active.writeId} and expects chunk index ${active.nextChunkIndex}; ` + `retry with that write_id.` : ` Restart with write_mode "start" and reuse the write_id returned in ` + `that tool result for the following append calls.`;
116003
+ return new ChunkedWriteError(`Unknown writeId: ${writeId}. The chunked write is no longer active — it ` + `may have been started in a different process, already finished, or ` + `discarded.${recovery}`);
116004
+ }
116012
116005
  function enforceChunkLimit(content) {
116013
116006
  if (content.length > MAX_FILE_WRITE_CHUNK_CHARS) {
116014
116007
  throw new ChunkedWriteError(`Chunk is ${content.length} characters but must be at most ` + `${MAX_FILE_WRITE_CHUNK_CHARS} characters; split it into smaller chunks.`);
@@ -116018,6 +116011,11 @@ async function startChunkedWrite(targetPath, content, snapshot) {
116018
116011
  enforceChunkLimit(content);
116019
116012
  const fs2 = getFsImplementation();
116020
116013
  const resolvedTarget = resolve14(targetPath);
116014
+ for (const [existingId, existing] of states) {
116015
+ if (existing.targetPath === resolvedTarget) {
116016
+ await clearChunkedWrite(existingId).catch(() => {});
116017
+ }
116018
+ }
116021
116019
  const writeId = randomUUID4();
116022
116020
  const tempPath = tempPathFor(resolvedTarget, writeId);
116023
116021
  let initialMtimeMs = snapshot.expectedInitialMtimeMs;
@@ -116044,6 +116042,7 @@ async function startChunkedWrite(targetPath, content, snapshot) {
116044
116042
  }
116045
116043
  }
116046
116044
  try {
116045
+ await fs2.mkdir(dirname18(resolvedTarget));
116047
116046
  await fs2.writeFile(tempPath, content, { encoding: snapshot.encoding });
116048
116047
  } catch (error40) {
116049
116048
  await fs2.unlink(tempPath).catch(() => {});
@@ -116071,7 +116070,7 @@ async function appendChunkedWrite(targetPath, writeId, chunkIndex, content, resp
116071
116070
  enforceChunkLimit(content);
116072
116071
  const state = states.get(writeId);
116073
116072
  if (!state) {
116074
- throw new ChunkedWriteError(`Unknown writeId: ${writeId}`);
116073
+ throw unknownWriteIdError(writeId, targetPath);
116075
116074
  }
116076
116075
  if (resolve14(targetPath) !== state.targetPath) {
116077
116076
  throw new ChunkedWriteError(`Target path ${targetPath} does not match the chunked write for ${writeId}`);
@@ -116102,7 +116101,7 @@ async function discardChunkedWriteState(writeId) {
116102
116101
  async function commitChunkedWrite(targetPath, writeId) {
116103
116102
  const state = states.get(writeId);
116104
116103
  if (!state) {
116105
- throw new ChunkedWriteError(`Unknown writeId: ${writeId}`);
116104
+ throw unknownWriteIdError(writeId, targetPath);
116106
116105
  }
116107
116106
  if (resolve14(targetPath) !== state.targetPath) {
116108
116107
  throw new ChunkedWriteError(`Target path ${targetPath} does not match the chunked write for ${writeId}`);
@@ -125264,287 +125263,293 @@ var init_session = __esm(() => {
125264
125263
  session_default = noop63;
125265
125264
  });
125266
125265
 
125266
+ // sdk-missing-stub:./commands/sessions/index.js
125267
+ var noop64 = () => null, sessions_default;
125268
+ var init_sessions = __esm(() => {
125269
+ sessions_default = noop64;
125270
+ });
125271
+
125267
125272
  // sdk-missing-stub:./commands/set-context-window/index.js
125268
- var noop64 = () => null, set_context_window_default;
125273
+ var noop65 = () => null, set_context_window_default;
125269
125274
  var init_set_context_window = __esm(() => {
125270
- set_context_window_default = noop64;
125275
+ set_context_window_default = noop65;
125271
125276
  });
125272
125277
 
125273
125278
  // sdk-missing-stub:./commands/share/index.js
125274
- var noop65 = () => null, share_default;
125279
+ var noop66 = () => null, share_default;
125275
125280
  var init_share = __esm(() => {
125276
- share_default = noop65;
125281
+ share_default = noop66;
125277
125282
  });
125278
125283
 
125279
125284
  // sdk-missing-stub:./commands/skills/index.js
125280
- var noop66 = () => null, skills_default;
125285
+ var noop67 = () => null, skills_default;
125281
125286
  var init_skills = __esm(() => {
125282
- skills_default = noop66;
125287
+ skills_default = noop67;
125283
125288
  });
125284
125289
 
125285
125290
  // sdk-missing-stub:./commands/status/index.js
125286
- var noop67 = () => null, status_default;
125291
+ var noop68 = () => null, status_default;
125287
125292
  var init_status = __esm(() => {
125288
- status_default = noop67;
125293
+ status_default = noop68;
125289
125294
  });
125290
125295
 
125291
125296
  // sdk-missing-stub:./commands/tasks/index.js
125292
- var noop68 = () => null, tasks_default;
125297
+ var noop69 = () => null, tasks_default;
125293
125298
  var init_tasks = __esm(() => {
125294
- tasks_default = noop68;
125299
+ tasks_default = noop69;
125295
125300
  });
125296
125301
 
125297
125302
  // sdk-missing-stub:./commands/teleport/index.js
125298
- var noop69 = () => null, teleport_default;
125303
+ var noop70 = () => null, teleport_default;
125299
125304
  var init_teleport = __esm(() => {
125300
- teleport_default = noop69;
125305
+ teleport_default = noop70;
125301
125306
  });
125302
125307
 
125303
125308
  // sdk-missing-stub:./commands/security-review.js
125304
- var noop70 = () => null, security_review_default;
125309
+ var noop71 = () => null, security_review_default;
125305
125310
  var init_security_review = __esm(() => {
125306
- security_review_default = noop70;
125311
+ security_review_default = noop71;
125307
125312
  });
125308
125313
 
125309
125314
  // sdk-missing-stub:./commands/bughunter/index.js
125310
- var noop71 = () => null, bughunter_default;
125315
+ var noop72 = () => null, bughunter_default;
125311
125316
  var init_bughunter = __esm(() => {
125312
- bughunter_default = noop71;
125317
+ bughunter_default = noop72;
125313
125318
  });
125314
125319
 
125315
125320
  // sdk-missing-stub:./commands/bughunter-security/index.js
125316
- var noop72 = () => null, bughunter_security_default;
125321
+ var noop73 = () => null, bughunter_security_default;
125317
125322
  var init_bughunter_security = __esm(() => {
125318
- bughunter_security_default = noop72;
125323
+ bughunter_security_default = noop73;
125319
125324
  });
125320
125325
 
125321
125326
  // sdk-missing-stub:./commands/bughunter-perf/index.js
125322
- var noop73 = () => null, bughunter_perf_default;
125327
+ var noop74 = () => null, bughunter_perf_default;
125323
125328
  var init_bughunter_perf = __esm(() => {
125324
- bughunter_perf_default = noop73;
125329
+ bughunter_perf_default = noop74;
125325
125330
  });
125326
125331
 
125327
125332
  // sdk-missing-stub:./commands/terminalSetup/index.js
125328
- var noop74 = () => null, terminalSetup_default;
125333
+ var noop75 = () => null, terminalSetup_default;
125329
125334
  var init_terminalSetup = __esm(() => {
125330
- terminalSetup_default = noop74;
125335
+ terminalSetup_default = noop75;
125331
125336
  });
125332
125337
 
125333
125338
  // sdk-missing-stub:./commands/usage/index.js
125334
- var noop75 = () => null, usage_default;
125339
+ var noop76 = () => null, usage_default;
125335
125340
  var init_usage = __esm(() => {
125336
- usage_default = noop75;
125341
+ usage_default = noop76;
125337
125342
  });
125338
125343
 
125339
125344
  // sdk-missing-stub:./commands/theme/index.js
125340
- var noop76 = () => null, theme_default;
125345
+ var noop77 = () => null, theme_default;
125341
125346
  var init_theme = __esm(() => {
125342
- theme_default = noop76;
125347
+ theme_default = noop77;
125343
125348
  });
125344
125349
 
125345
125350
  // sdk-missing-stub:./commands/logo/index.js
125346
- var noop77 = () => null, logo_default;
125351
+ var noop78 = () => null, logo_default;
125347
125352
  var init_logo = __esm(() => {
125348
- logo_default = noop77;
125353
+ logo_default = noop78;
125349
125354
  });
125350
125355
 
125351
125356
  // sdk-missing-stub:./commands/vim/index.js
125352
- var noop78 = () => null, vim_default;
125357
+ var noop79 = () => null, vim_default;
125353
125358
  var init_vim = __esm(() => {
125354
- vim_default = noop78;
125359
+ vim_default = noop79;
125355
125360
  });
125356
125361
 
125357
125362
  // sdk-missing-stub:./commands/thinkback/index.js
125358
- var noop79 = () => null, thinkback_default;
125363
+ var noop80 = () => null, thinkback_default;
125359
125364
  var init_thinkback = __esm(() => {
125360
- thinkback_default = noop79;
125365
+ thinkback_default = noop80;
125361
125366
  });
125362
125367
 
125363
125368
  // sdk-missing-stub:./commands/thinkback-play/index.js
125364
- var noop80 = () => null, thinkback_play_default;
125369
+ var noop81 = () => null, thinkback_play_default;
125365
125370
  var init_thinkback_play = __esm(() => {
125366
- thinkback_play_default = noop80;
125371
+ thinkback_play_default = noop81;
125367
125372
  });
125368
125373
 
125369
125374
  // sdk-missing-stub:./commands/permissions/index.js
125370
- var noop81 = () => null, permissions_default;
125375
+ var noop82 = () => null, permissions_default;
125371
125376
  var init_permissions2 = __esm(() => {
125372
- permissions_default = noop81;
125377
+ permissions_default = noop82;
125373
125378
  });
125374
125379
 
125375
125380
  // sdk-missing-stub:./commands/plan/index.js
125376
- var noop82 = () => null, plan_default;
125381
+ var noop83 = () => null, plan_default;
125377
125382
  var init_plan = __esm(() => {
125378
- plan_default = noop82;
125383
+ plan_default = noop83;
125379
125384
  });
125380
125385
 
125381
125386
  // sdk-missing-stub:./commands/fast/index.js
125382
- var noop83 = () => null, fast_default;
125387
+ var noop84 = () => null, fast_default;
125383
125388
  var init_fast = __esm(() => {
125384
- fast_default = noop83;
125389
+ fast_default = noop84;
125385
125390
  });
125386
125391
 
125387
125392
  // sdk-missing-stub:./commands/passes/index.js
125388
- var noop84 = () => null, passes_default;
125393
+ var noop85 = () => null, passes_default;
125389
125394
  var init_passes = __esm(() => {
125390
- passes_default = noop84;
125395
+ passes_default = noop85;
125391
125396
  });
125392
125397
 
125393
125398
  // sdk-missing-stub:./commands/privacy-settings/index.js
125394
- var noop85 = () => null, privacy_settings_default;
125399
+ var noop86 = () => null, privacy_settings_default;
125395
125400
  var init_privacy_settings = __esm(() => {
125396
- privacy_settings_default = noop85;
125401
+ privacy_settings_default = noop86;
125397
125402
  });
125398
125403
 
125399
125404
  // sdk-missing-stub:./commands/provider/index.js
125400
- var noop86 = () => null, provider_default;
125405
+ var noop87 = () => null, provider_default;
125401
125406
  var init_provider = __esm(() => {
125402
- provider_default = noop86;
125407
+ provider_default = noop87;
125403
125408
  });
125404
125409
 
125405
125410
  // sdk-missing-stub:./commands/hooks/index.js
125406
- var noop87 = () => null, hooks_default;
125411
+ var noop88 = () => null, hooks_default;
125407
125412
  var init_hooks2 = __esm(() => {
125408
- hooks_default = noop87;
125413
+ hooks_default = noop88;
125409
125414
  });
125410
125415
 
125411
125416
  // sdk-missing-stub:./commands/files/index.js
125412
- var noop88 = () => null, files_default;
125417
+ var noop89 = () => null, files_default;
125413
125418
  var init_files2 = __esm(() => {
125414
- files_default = noop88;
125419
+ files_default = noop89;
125415
125420
  });
125416
125421
 
125417
125422
  // sdk-missing-stub:./commands/branch/index.js
125418
- var noop89 = () => null, branch_default;
125423
+ var noop90 = () => null, branch_default;
125419
125424
  var init_branch = __esm(() => {
125420
- branch_default = noop89;
125425
+ branch_default = noop90;
125421
125426
  });
125422
125427
 
125423
125428
  // sdk-missing-stub:./commands/agents/index.js
125424
- var noop90 = () => null, agents_default;
125429
+ var noop91 = () => null, agents_default;
125425
125430
  var init_agents = __esm(() => {
125426
- agents_default = noop90;
125431
+ agents_default = noop91;
125427
125432
  });
125428
125433
 
125429
125434
  // sdk-missing-stub:./commands/auto-fix.js
125430
- var noop91 = () => null, auto_fix_default;
125435
+ var noop92 = () => null, auto_fix_default;
125431
125436
  var init_auto_fix = __esm(() => {
125432
- auto_fix_default = noop91;
125437
+ auto_fix_default = noop92;
125433
125438
  });
125434
125439
 
125435
125440
  // sdk-missing-stub:./commands/plugin/index.js
125436
- var noop92 = () => null, plugin_default;
125441
+ var noop93 = () => null, plugin_default;
125437
125442
  var init_plugin = __esm(() => {
125438
- plugin_default = noop92;
125443
+ plugin_default = noop93;
125439
125444
  });
125440
125445
 
125441
125446
  // sdk-missing-stub:./commands/reload-plugins/index.js
125442
- var noop93 = () => null, reload_plugins_default;
125447
+ var noop94 = () => null, reload_plugins_default;
125443
125448
  var init_reload_plugins = __esm(() => {
125444
- reload_plugins_default = noop93;
125449
+ reload_plugins_default = noop94;
125445
125450
  });
125446
125451
 
125447
125452
  // sdk-missing-stub:./commands/rewind/index.js
125448
- var noop94 = () => null, rewind_default;
125453
+ var noop95 = () => null, rewind_default;
125449
125454
  var init_rewind = __esm(() => {
125450
- rewind_default = noop94;
125455
+ rewind_default = noop95;
125451
125456
  });
125452
125457
 
125453
125458
  // sdk-missing-stub:./commands/heapdump/index.js
125454
- var noop95 = () => null, heapdump_default;
125459
+ var noop96 = () => null, heapdump_default;
125455
125460
  var init_heapdump = __esm(() => {
125456
- heapdump_default = noop95;
125461
+ heapdump_default = noop96;
125457
125462
  });
125458
125463
 
125459
125464
  // sdk-missing-stub:./commands/mock-limits/index.js
125460
- var noop96 = () => null, mock_limits_default;
125465
+ var noop97 = () => null, mock_limits_default;
125461
125466
  var init_mock_limits = __esm(() => {
125462
- mock_limits_default = noop96;
125467
+ mock_limits_default = noop97;
125463
125468
  });
125464
125469
 
125465
125470
  // sdk-missing-stub:./commands/bridge-kick.js
125466
- var noop97 = () => null, bridge_kick_default;
125471
+ var noop98 = () => null, bridge_kick_default;
125467
125472
  var init_bridge_kick = __esm(() => {
125468
- bridge_kick_default = noop97;
125473
+ bridge_kick_default = noop98;
125469
125474
  });
125470
125475
 
125471
125476
  // sdk-missing-stub:./commands/version.js
125472
- var noop98 = () => null, version_default;
125477
+ var noop99 = () => null, version_default;
125473
125478
  var init_version2 = __esm(() => {
125474
- version_default = noop98;
125479
+ version_default = noop99;
125475
125480
  });
125476
125481
 
125477
125482
  // sdk-missing-stub:./commands/update/index.js
125478
- var noop99 = () => null, update_default;
125483
+ var noop100 = () => null, update_default;
125479
125484
  var init_update = __esm(() => {
125480
- update_default = noop99;
125485
+ update_default = noop100;
125481
125486
  });
125482
125487
 
125483
125488
  // sdk-missing-stub:./commands/wiki/index.js
125484
- var noop100 = () => null, wiki_default;
125489
+ var noop101 = () => null, wiki_default;
125485
125490
  var init_wiki = __esm(() => {
125486
- wiki_default = noop100;
125491
+ wiki_default = noop101;
125487
125492
  });
125488
125493
 
125489
125494
  // sdk-missing-stub:./commands/summary/index.js
125490
- var noop101 = () => null, summary_default;
125495
+ var noop102 = () => null, summary_default;
125491
125496
  var init_summary = __esm(() => {
125492
- summary_default = noop101;
125497
+ summary_default = noop102;
125493
125498
  });
125494
125499
 
125495
125500
  // sdk-missing-stub:./commands/reset-limits/index.js
125496
- var noop102 = () => null, resetLimits, resetLimitsNonInteractive;
125501
+ var noop103 = () => null, resetLimits, resetLimitsNonInteractive;
125497
125502
  var init_reset_limits = __esm(() => {
125498
- resetLimits = noop102;
125499
- resetLimitsNonInteractive = noop102;
125503
+ resetLimits = noop103;
125504
+ resetLimitsNonInteractive = noop103;
125500
125505
  });
125501
125506
 
125502
125507
  // sdk-missing-stub:./commands/ant-trace/index.js
125503
- var noop103 = () => null, ant_trace_default;
125508
+ var noop104 = () => null, ant_trace_default;
125504
125509
  var init_ant_trace = __esm(() => {
125505
- ant_trace_default = noop103;
125510
+ ant_trace_default = noop104;
125506
125511
  });
125507
125512
 
125508
125513
  // sdk-missing-stub:./commands/perf-issue/index.js
125509
- var noop104 = () => null, perf_issue_default;
125514
+ var noop105 = () => null, perf_issue_default;
125510
125515
  var init_perf_issue = __esm(() => {
125511
- perf_issue_default = noop104;
125516
+ perf_issue_default = noop105;
125512
125517
  });
125513
125518
 
125514
125519
  // sdk-missing-stub:./commands/sandbox-toggle/index.js
125515
- var noop105 = () => null, sandbox_toggle_default;
125520
+ var noop106 = () => null, sandbox_toggle_default;
125516
125521
  var init_sandbox_toggle = __esm(() => {
125517
- sandbox_toggle_default = noop105;
125522
+ sandbox_toggle_default = noop106;
125518
125523
  });
125519
125524
 
125520
125525
  // sdk-missing-stub:./commands/chrome/index.js
125521
- var noop106 = () => null, chrome_default;
125526
+ var noop107 = () => null, chrome_default;
125522
125527
  var init_chrome = __esm(() => {
125523
- chrome_default = noop106;
125528
+ chrome_default = noop107;
125524
125529
  });
125525
125530
 
125526
125531
  // sdk-missing-stub:./commands/stickers/index.js
125527
- var noop107 = () => null, stickers_default;
125532
+ var noop108 = () => null, stickers_default;
125528
125533
  var init_stickers = __esm(() => {
125529
- stickers_default = noop107;
125534
+ stickers_default = noop108;
125530
125535
  });
125531
125536
 
125532
125537
  // sdk-missing-stub:./commands/advisor.js
125533
- var noop108 = () => null, advisor_default;
125538
+ var noop109 = () => null, advisor_default;
125534
125539
  var init_advisor = __esm(() => {
125535
- advisor_default = noop108;
125540
+ advisor_default = noop109;
125536
125541
  });
125537
125542
 
125538
125543
  // sdk-missing-stub:./commands/ads.js
125539
- var noop109 = () => null, ads_default;
125544
+ var noop110 = () => null, ads_default;
125540
125545
  var init_ads = __esm(() => {
125541
- ads_default = noop109;
125546
+ ads_default = noop110;
125542
125547
  });
125543
125548
 
125544
125549
  // sdk-missing-stub:./commands/smartroute/index.js
125545
- var noop110 = () => null, smartroute_default;
125550
+ var noop111 = () => null, smartroute_default;
125546
125551
  var init_smartroute = __esm(() => {
125547
- smartroute_default = noop110;
125552
+ smartroute_default = noop111;
125548
125553
  });
125549
125554
 
125550
125555
  // node_modules/shell-quote/quote.js
@@ -126659,8 +126664,10 @@ function validateRetryAttemptsEnvVar(envVarName, value) {
126659
126664
  if (!value) {
126660
126665
  return DEFAULT_MAX_RETRIES;
126661
126666
  }
126662
- const parsed = parseInt(value, 10);
126663
- if (isNaN(parsed) || parsed < 0) {
126667
+ const normalized = value.trim();
126668
+ const isDecimalInteger = /^\d+$/.test(normalized);
126669
+ const parsed = isDecimalInteger ? Number(normalized) : Number.NaN;
126670
+ if (!Number.isFinite(parsed)) {
126664
126671
  logForDebugging(`${envVarName} Invalid value "${value}" (using default: ${DEFAULT_MAX_RETRIES})`);
126665
126672
  return DEFAULT_MAX_RETRIES;
126666
126673
  }
@@ -128146,10 +128153,10 @@ var init__arrayIncludesWith = __esm(() => {
128146
128153
  });
128147
128154
 
128148
128155
  // node_modules/lodash-es/noop.js
128149
- function noop111() {}
128156
+ function noop112() {}
128150
128157
  var noop_default;
128151
128158
  var init_noop = __esm(() => {
128152
- noop_default = noop111;
128159
+ noop_default = noop112;
128153
128160
  });
128154
128161
 
128155
128162
  // node_modules/lodash-es/_createSet.js
@@ -130507,15 +130514,15 @@ var init_fileChangedWatcher = __esm(() => {
130507
130514
  });
130508
130515
 
130509
130516
  // sdk-missing-stub:@anthropic-ai/sandbox-runtime
130510
- var noop112 = () => null, SandboxManager, SandboxRuntimeConfigSchema, SandboxViolationStore = null;
130517
+ var noop113 = () => null, SandboxManager, SandboxRuntimeConfigSchema, SandboxViolationStore = null;
130511
130518
  var init_sandbox_runtime = __esm(() => {
130512
130519
  SandboxManager = class {
130513
130520
  static isSupportedPlatform = () => false;
130514
- static create = noop112;
130521
+ static create = noop113;
130515
130522
  static Version = "";
130516
130523
  static annotateStderrWithSandboxFailures = (_command, stderr) => stderr;
130517
130524
  };
130518
- SandboxRuntimeConfigSchema = { parse: noop112 };
130525
+ SandboxRuntimeConfigSchema = { parse: noop113 };
130519
130526
  });
130520
130527
 
130521
130528
  // node_modules/lodash-es/lodash.js
@@ -134588,28 +134595,68 @@ var init_limits = __esm(() => {
134588
134595
  });
134589
134596
  });
134590
134597
 
134598
+ // src/tools/FileReadTool/readDedup.ts
134599
+ function isFullRead(state2) {
134600
+ return (state2.offset === 1 || state2.offset === 0) && state2.limit === undefined;
134601
+ }
134602
+ function countLines(content) {
134603
+ if (content === "")
134604
+ return 0;
134605
+ const lines = content.split(`
134606
+ `).length;
134607
+ return content.endsWith(`
134608
+ `) ? lines - 1 : lines;
134609
+ }
134610
+ function isCoveredByFullRead(state2, offset, limit) {
134611
+ if (!isFullRead(state2))
134612
+ return false;
134613
+ if (limit !== undefined && limit <= 0)
134614
+ return false;
134615
+ const startLine = offset === 0 ? 1 : offset;
134616
+ return startLine >= 1 && startLine <= countLines(state2.content);
134617
+ }
134618
+ async function checkReadDedup(state2, offset, limit, deps) {
134619
+ if (!state2 || state2.isPartialView || state2.offset === undefined) {
134620
+ return { kind: "miss" };
134621
+ }
134622
+ const exactRange = state2.offset === offset && state2.limit === limit;
134623
+ if (!exactRange && !isCoveredByFullRead(state2, offset, limit)) {
134624
+ return { kind: "miss" };
134625
+ }
134626
+ try {
134627
+ const mtimeMs = await deps.getModificationTime();
134628
+ if (mtimeMs === state2.timestamp)
134629
+ return { kind: "unchanged" };
134630
+ const current = await deps.readRange(state2.offset, state2.limit);
134631
+ if (current.content === state2.content) {
134632
+ return { kind: "touched", timestamp: Math.floor(current.mtimeMs) };
134633
+ }
134634
+ } catch {}
134635
+ return { kind: "miss" };
134636
+ }
134637
+
134591
134638
  // sdk-missing-stub:./UI.js
134592
- var noop113 = () => null, renderToolResultMessage, renderGroupedAgentToolUse, renderToolUseErrorMessage, renderToolUseMessage, renderToolUseProgressMessage, renderToolUseRejectedMessage, renderToolUseTag, userFacingName, userFacingNameBackgroundColor, BackgroundHint, renderToolUseQueuedMessage, getToolUseSummary, isResultTruncated, renderCreateResultMessage, renderCreateToolUseMessage, renderDeleteResultMessage, renderDeleteToolUseMessage, renderListResultMessage, renderListToolUseMessage;
134639
+ var noop114 = () => null, renderToolResultMessage, renderGroupedAgentToolUse, renderToolUseErrorMessage, renderToolUseMessage, renderToolUseProgressMessage, renderToolUseRejectedMessage, renderToolUseTag, userFacingName, userFacingNameBackgroundColor, BackgroundHint, renderToolUseQueuedMessage, getToolUseSummary, isResultTruncated, renderCreateResultMessage, renderCreateToolUseMessage, renderDeleteResultMessage, renderDeleteToolUseMessage, renderListResultMessage, renderListToolUseMessage;
134593
134640
  var init_UI = __esm(() => {
134594
- renderToolResultMessage = noop113;
134595
- renderGroupedAgentToolUse = noop113;
134596
- renderToolUseErrorMessage = noop113;
134597
- renderToolUseMessage = noop113;
134598
- renderToolUseProgressMessage = noop113;
134599
- renderToolUseRejectedMessage = noop113;
134600
- renderToolUseTag = noop113;
134601
- userFacingName = noop113;
134602
- userFacingNameBackgroundColor = noop113;
134603
- BackgroundHint = noop113;
134604
- renderToolUseQueuedMessage = noop113;
134605
- getToolUseSummary = noop113;
134606
- isResultTruncated = noop113;
134607
- renderCreateResultMessage = noop113;
134608
- renderCreateToolUseMessage = noop113;
134609
- renderDeleteResultMessage = noop113;
134610
- renderDeleteToolUseMessage = noop113;
134611
- renderListResultMessage = noop113;
134612
- renderListToolUseMessage = noop113;
134641
+ renderToolResultMessage = noop114;
134642
+ renderGroupedAgentToolUse = noop114;
134643
+ renderToolUseErrorMessage = noop114;
134644
+ renderToolUseMessage = noop114;
134645
+ renderToolUseProgressMessage = noop114;
134646
+ renderToolUseRejectedMessage = noop114;
134647
+ renderToolUseTag = noop114;
134648
+ userFacingName = noop114;
134649
+ userFacingNameBackgroundColor = noop114;
134650
+ BackgroundHint = noop114;
134651
+ renderToolUseQueuedMessage = noop114;
134652
+ getToolUseSummary = noop114;
134653
+ isResultTruncated = noop114;
134654
+ renderCreateResultMessage = noop114;
134655
+ renderCreateToolUseMessage = noop114;
134656
+ renderDeleteResultMessage = noop114;
134657
+ renderDeleteToolUseMessage = noop114;
134658
+ renderListResultMessage = noop114;
134659
+ renderListToolUseMessage = noop114;
134613
134660
  });
134614
134661
 
134615
134662
  // src/tools/FileReadTool/FileReadTool.ts
@@ -135258,25 +135305,27 @@ var init_FileReadTool = __esm(() => {
135258
135305
  const fullFilePath = expandPath(file_path);
135259
135306
  const dedupKillswitch = getFeatureValue_CACHED_MAY_BE_STALE("tengu_read_dedup_killswitch", false);
135260
135307
  const existingState = dedupKillswitch ? undefined : readFileState.get(fullFilePath);
135261
- if (existingState && !existingState.isPartialView && existingState.offset !== undefined) {
135262
- const rangeMatch = existingState.offset === offset && existingState.limit === limit;
135263
- if (rangeMatch) {
135264
- try {
135265
- const mtimeMs = await getFileModificationTimeAsync(fullFilePath);
135266
- if (mtimeMs === existingState.timestamp) {
135267
- const analyticsExt = getFileExtensionForAnalytics(fullFilePath);
135268
- logEvent("tengu_file_read_dedup", {
135269
- ...analyticsExt !== undefined && { ext: analyticsExt }
135270
- });
135271
- return {
135272
- data: {
135273
- type: "file_unchanged",
135274
- file: { filePath: file_path }
135275
- }
135276
- };
135277
- }
135278
- } catch {}
135308
+ const dedup = await checkReadDedup(existingState, offset, limit, {
135309
+ getModificationTime: () => getFileModificationTimeAsync(fullFilePath),
135310
+ readRange: (rangeOffset, rangeLimit) => readFileInRange(fullFilePath, rangeOffset === 0 ? 0 : rangeOffset - 1, rangeLimit, rangeLimit === undefined ? maxSizeBytes : undefined, context2.abortController.signal)
135311
+ });
135312
+ if (dedup.kind !== "miss" && existingState) {
135313
+ if (dedup.kind === "touched") {
135314
+ readFileState.set(fullFilePath, {
135315
+ ...existingState,
135316
+ timestamp: dedup.timestamp
135317
+ });
135279
135318
  }
135319
+ const analyticsExt = getFileExtensionForAnalytics(fullFilePath);
135320
+ logEvent("tengu_file_read_dedup", {
135321
+ ...analyticsExt !== undefined && { ext: analyticsExt }
135322
+ });
135323
+ return {
135324
+ data: {
135325
+ type: "file_unchanged",
135326
+ file: { filePath: file_path }
135327
+ }
135328
+ };
135280
135329
  }
135281
135330
  const cwd2 = getCwd();
135282
135331
  if (!isEnvTruthy(process.env.CLAUDE_CODE_SIMPLE)) {
@@ -144795,6 +144844,7 @@ var init_en2 = __esm(() => {
144795
144844
  "commands.rename.description": "Rename the current conversation",
144796
144845
  "commands.request-size.description": "Show estimated request context load and top contributors",
144797
144846
  "commands.resume.description": "Resume a previous conversation",
144847
+ "commands.sessions.description": "List saved conversations to resume or delete them",
144798
144848
  "commands.review.description": "Review a pull request",
144799
144849
  "commands.rewind.description": "Restore the code and/or conversation to a previous point",
144800
144850
  "commands.security-review.description": "Complete a security review of the pending changes on the current branch",
@@ -144870,6 +144920,7 @@ var init_vi2 = __esm(() => {
144870
144920
  "commands.rename.description": "Đổi tên cuộc hội thoại hiện tại",
144871
144921
  "commands.request-size.description": "Hiện tải ngữ cảnh ước tính và các thành phần chính",
144872
144922
  "commands.resume.description": "Tiếp tục cuộc hội thoại trước",
144923
+ "commands.sessions.description": "Liệt kê các cuộc hội thoại đã lưu để tiếp tục hoặc xóa",
144873
144924
  "commands.review.description": "Đánh giá pull request",
144874
144925
  "commands.rewind.description": "Khôi phục mã và/hoặc cuộc hội thoại về điểm trước",
144875
144926
  "commands.security-review.description": "Hoàn thành đánh giá bảo mật cho các thay đổi đang chờ trên nhánh hiện tại",
@@ -144948,6 +144999,7 @@ var init_commandDescriptions = __esm(() => {
144948
144999
  rename: "commands.rename.description",
144949
145000
  "request-size": "commands.request-size.description",
144950
145001
  resume: "commands.resume.description",
145002
+ sessions: "commands.sessions.description",
144951
145003
  review: "commands.review.description",
144952
145004
  rewind: "commands.rewind.description",
144953
145005
  "security-review": "commands.security-review.description",
@@ -153972,9 +154024,9 @@ __export(exports_toolRendering, {
153972
154024
  default: () => toolRendering_default,
153973
154025
  __stub: () => __stub2
153974
154026
  });
153975
- var noop114 = () => null, toolRendering_default, __stub2 = true;
154027
+ var noop115 = () => null, toolRendering_default, __stub2 = true;
153976
154028
  var init_toolRendering = __esm(() => {
153977
- toolRendering_default = noop114;
154029
+ toolRendering_default = noop115;
153978
154030
  });
153979
154031
 
153980
154032
  // node_modules/ws/lib/constants.js
@@ -156897,14 +156949,14 @@ __export(exports_claude_for_chrome_mcp, {
156897
156949
  ClaudeForChromeContext: () => ClaudeForChromeContext,
156898
156950
  BROWSER_TOOLS: () => BROWSER_TOOLS
156899
156951
  });
156900
- var noop115 = () => null, claude_for_chrome_mcp_default, __stub3 = true, BROWSER_TOOLS, ClaudeForChromeContext, createClaudeForChromeMcpServer, Logger, PermissionMode;
156952
+ var noop116 = () => null, claude_for_chrome_mcp_default, __stub3 = true, BROWSER_TOOLS, ClaudeForChromeContext, createClaudeForChromeMcpServer, Logger, PermissionMode;
156901
156953
  var init_claude_for_chrome_mcp = __esm(() => {
156902
- claude_for_chrome_mcp_default = noop115;
156903
- BROWSER_TOOLS = noop115;
156904
- ClaudeForChromeContext = noop115;
156905
- createClaudeForChromeMcpServer = noop115;
156906
- Logger = noop115;
156907
- PermissionMode = noop115;
156954
+ claude_for_chrome_mcp_default = noop116;
156955
+ BROWSER_TOOLS = noop116;
156956
+ ClaudeForChromeContext = noop116;
156957
+ createClaudeForChromeMcpServer = noop116;
156958
+ Logger = noop116;
156959
+ PermissionMode = noop116;
156908
156960
  });
156909
156961
 
156910
156962
  // src/services/analytics/sink.ts
@@ -156938,7 +156990,7 @@ function computeFingerprint(messageText2, version2) {
156938
156990
  }
156939
156991
  function computeFingerprintFromMessages(messages) {
156940
156992
  const firstMessageText = extractFirstMessageText(messages);
156941
- return computeFingerprint(firstMessageText, "0.31.2-by-rayss");
156993
+ return computeFingerprint(firstMessageText, "0.33.2-by-rayss");
156942
156994
  }
156943
156995
  var FINGERPRINT_SALT = "59cf53e54c78";
156944
156996
  var init_fingerprint = () => {};
@@ -157400,6 +157452,57 @@ async function createNodeWsClient(url3, options) {
157400
157452
  function getConnectionTimeoutMs() {
157401
157453
  return parseInt(process.env.MCP_TIMEOUT || "", 10) || 30000;
157402
157454
  }
157455
+ function wrapResponseBodyWithCleanup2(response, cleanup, signal) {
157456
+ if (!response.body) {
157457
+ cleanup();
157458
+ return response;
157459
+ }
157460
+ const reader = response.body.getReader();
157461
+ let isCleanedUp = false;
157462
+ const finish = () => {
157463
+ if (isCleanedUp)
157464
+ return;
157465
+ isCleanedUp = true;
157466
+ signal?.removeEventListener("abort", cancelReader);
157467
+ cleanup();
157468
+ };
157469
+ const cancelReader = () => {
157470
+ reader.cancel(signal?.reason).catch(() => {});
157471
+ finish();
157472
+ };
157473
+ signal?.addEventListener("abort", cancelReader, { once: true });
157474
+ if (signal?.aborted) {
157475
+ cancelReader();
157476
+ }
157477
+ const body = new ReadableStream({
157478
+ async pull(controller) {
157479
+ try {
157480
+ const { done, value } = await reader.read();
157481
+ if (done) {
157482
+ controller.close();
157483
+ finish();
157484
+ } else {
157485
+ controller.enqueue(value);
157486
+ }
157487
+ } catch (error40) {
157488
+ controller.error(error40);
157489
+ finish();
157490
+ }
157491
+ },
157492
+ async cancel(reason) {
157493
+ try {
157494
+ await reader.cancel(reason);
157495
+ } finally {
157496
+ finish();
157497
+ }
157498
+ }
157499
+ });
157500
+ return new Response(body, {
157501
+ status: response.status,
157502
+ statusText: response.statusText,
157503
+ headers: response.headers
157504
+ });
157505
+ }
157403
157506
  function wrapFetchWithTimeout(baseFetch) {
157404
157507
  return async (url3, init) => {
157405
157508
  const method = (init?.method ?? "GET").toUpperCase();
@@ -157429,14 +157532,64 @@ function wrapFetchWithTimeout(baseFetch) {
157429
157532
  headers,
157430
157533
  signal: controller.signal
157431
157534
  });
157432
- cleanup();
157433
- return response;
157535
+ clearTimeout(timer);
157536
+ return wrapResponseBodyWithCleanup2(response, cleanup, controller.signal);
157434
157537
  } catch (error40) {
157435
157538
  cleanup();
157436
157539
  throw error40;
157437
157540
  }
157438
157541
  };
157439
157542
  }
157543
+ function wrapFetchWithRequestCancellation(baseFetch, activeRequests) {
157544
+ return async (url3, init) => {
157545
+ let requestId;
157546
+ if ((init?.method ?? "GET").toUpperCase() === "POST" && typeof init?.body === "string") {
157547
+ try {
157548
+ const request = JSON.parse(init.body);
157549
+ if (request !== null && typeof request === "object" && "id" in request && (typeof request.id === "string" || typeof request.id === "number")) {
157550
+ requestId = request.id;
157551
+ }
157552
+ } catch {}
157553
+ }
157554
+ if (requestId === undefined) {
157555
+ return baseFetch(url3, init);
157556
+ }
157557
+ const requestController = createAbortController();
157558
+ activeRequests.set(requestId, requestController);
157559
+ const { signal, cleanup } = createCombinedAbortSignal(init?.signal ?? undefined, {
157560
+ signalB: requestController.signal,
157561
+ trace: {
157562
+ subsystem: "mcp_http_request",
157563
+ controllerRole: "mcp_http_request"
157564
+ }
157565
+ });
157566
+ const finish = () => {
157567
+ cleanup();
157568
+ if (activeRequests.get(requestId) === requestController) {
157569
+ activeRequests.delete(requestId);
157570
+ }
157571
+ };
157572
+ try {
157573
+ const response = await baseFetch(url3, { ...init, signal });
157574
+ return wrapResponseBodyWithCleanup2(response, finish, signal);
157575
+ } catch (error40) {
157576
+ finish();
157577
+ throw error40;
157578
+ }
157579
+ };
157580
+ }
157581
+ function attachMcpRequestCancellationHandler(transport, activeRequests) {
157582
+ const send = transport.send.bind(transport);
157583
+ transport.send = async (message, options) => {
157584
+ if ("method" in message && message.method === "notifications/cancelled" && "params" in message && message.params !== undefined && typeof message.params === "object" && "requestId" in message.params) {
157585
+ const requestId = message.params.requestId;
157586
+ if (typeof requestId === "string" || typeof requestId === "number") {
157587
+ activeRequests.get(requestId)?.abort(new DOMException("MCP request cancelled.", "AbortError"));
157588
+ }
157589
+ }
157590
+ return send(message, options);
157591
+ };
157592
+ }
157440
157593
  function buildMcpSseEventSourceHeaders(initHeaders) {
157441
157594
  const headers = new Headers(initHeaders);
157442
157595
  if (!headers.has("User-Agent")) {
@@ -157742,7 +157895,7 @@ async function callMCPToolWithUrlElicitationRetry({
157742
157895
  const MAX_URL_ELICITATION_RETRIES = 3;
157743
157896
  for (let attempt = 0;; attempt++) {
157744
157897
  if (signal.aborted) {
157745
- throw new Error("Tool call aborted during URL elicitation");
157898
+ throw new AbortError("Tool call aborted during URL elicitation");
157746
157899
  }
157747
157900
  try {
157748
157901
  return await callToolFn({
@@ -157867,11 +158020,20 @@ async function callMCPTool({
157867
158020
  logMCPDebug(name2, `Tool '${tool3}' still running (${duration4} elapsed)`);
157868
158021
  }, 30000, toolStartTime, name, tool2);
157869
158022
  const timeoutMs = getMcpToolTimeoutMs();
158023
+ const timeoutController = createAbortController();
158024
+ const {
158025
+ signal: requestSignal,
158026
+ cleanup: cleanupRequestSignal
158027
+ } = createCombinedAbortSignal(signal, {
158028
+ signalB: timeoutController.signal,
158029
+ trace: { subsystem: "mcp_tool_call", controllerRole: "mcp_tool_call" }
158030
+ });
157870
158031
  let timeoutId;
157871
158032
  const timeoutPromise = new Promise((_, reject) => {
157872
- timeoutId = setTimeout((reject2, name2, tool3, timeoutMs2) => {
157873
- reject2(new TelemetrySafeError_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS(`MCP server "${name2}" tool "${tool3}" timed out after ${Math.floor(timeoutMs2 / 1000)}s`, "MCP tool timeout"));
157874
- }, timeoutMs, reject, name, tool2, timeoutMs);
158033
+ timeoutId = setTimeout(() => {
158034
+ timeoutController.abort(new DOMException("The operation timed out.", "TimeoutError"));
158035
+ reject(new TelemetrySafeError_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS(`MCP server "${name}" tool "${tool2}" timed out after ${Math.floor(timeoutMs / 1000)}s`, "MCP tool timeout"));
158036
+ }, timeoutMs);
157875
158037
  });
157876
158038
  const result = await Promise.race([
157877
158039
  client.callTool({
@@ -157879,7 +158041,7 @@ async function callMCPTool({
157879
158041
  arguments: args,
157880
158042
  _meta: meta
157881
158043
  }, CallToolResultSchema, {
157882
- signal,
158044
+ signal: requestSignal,
157883
158045
  timeout: timeoutMs,
157884
158046
  onprogress: onProgress ? (sdkProgress) => {
157885
158047
  onProgress({
@@ -157898,6 +158060,7 @@ async function callMCPTool({
157898
158060
  if (timeoutId) {
157899
158061
  clearTimeout(timeoutId);
157900
158062
  }
158063
+ cleanupRequestSignal();
157901
158064
  });
157902
158065
  if ("isError" in result && result.isError) {
157903
158066
  let errorDetails = "Unknown error";
@@ -158011,6 +158174,7 @@ var init_client2 = __esm(() => {
158011
158174
  init_McpAuthTool();
158012
158175
  init_ReadMcpResourceTool();
158013
158176
  init_abortController();
158177
+ init_combinedAbortSignal();
158014
158178
  init_errors();
158015
158179
  init_auth();
158016
158180
  init_cleanupRegistry();
@@ -158215,13 +158379,14 @@ var init_client2 = __esm(() => {
158215
158379
  const allowUnauthorizedRefresh = !hasExplicitAuthorization;
158216
158380
  const proxyOptions = getProxyFetchOptions();
158217
158381
  logMCPDebug(name, `Proxy options: ${proxyOptions.dispatcher ? "custom dispatcher" : "default"}`);
158382
+ const activeHttpRequests = new Map;
158218
158383
  const transportOptions = {
158219
158384
  authProvider,
158220
- fetch: wrapFetchWithTimeout(wrapFetchWithStepUpDetection(createFetchWithInit(), authProvider, {
158385
+ fetch: wrapFetchWithRequestCancellation(wrapFetchWithTimeout(wrapFetchWithStepUpDetection(createFetchWithInit(), authProvider, {
158221
158386
  allowUnauthorizedRefresh,
158222
158387
  resourceUrl: serverRef.url,
158223
158388
  providerOwnsAuthorization: allowUnauthorizedRefresh
158224
- })),
158389
+ })), activeHttpRequests),
158225
158390
  requestInit: {
158226
158391
  ...proxyOptions,
158227
158392
  headers: {
@@ -158241,6 +158406,7 @@ var init_client2 = __esm(() => {
158241
158406
  timeoutMs: MCP_REQUEST_TIMEOUT_MS
158242
158407
  })}`);
158243
158408
  transport = new StreamableHTTPClientTransport(new URL(serverRef.url), transportOptions);
158409
+ attachMcpRequestCancellationHandler(transport, activeHttpRequests);
158244
158410
  logMCPDebug(name, `HTTP transport created successfully`);
158245
158411
  } else if (serverRef.type === "sdk") {
158246
158412
  throw new Error("SDK servers should be handled in print.ts");
@@ -158255,8 +158421,9 @@ var init_client2 = __esm(() => {
158255
158421
  logMCPDebug(name, `Using claude.ai proxy at ${proxyUrl}`);
158256
158422
  const fetchWithAuth = createClaudeAiProxyFetch(globalThis.fetch);
158257
158423
  const proxyOptions = getProxyFetchOptions();
158424
+ const activeProxyRequests = new Map;
158258
158425
  const transportOptions = {
158259
- fetch: wrapFetchWithTimeout(fetchWithAuth),
158426
+ fetch: wrapFetchWithRequestCancellation(wrapFetchWithTimeout(fetchWithAuth), activeProxyRequests),
158260
158427
  requestInit: {
158261
158428
  ...proxyOptions,
158262
158429
  headers: {
@@ -158266,6 +158433,7 @@ var init_client2 = __esm(() => {
158266
158433
  }
158267
158434
  };
158268
158435
  transport = new StreamableHTTPClientTransport(new URL(proxyUrl), transportOptions);
158436
+ attachMcpRequestCancellationHandler(transport, activeProxyRequests);
158269
158437
  logMCPDebug(name, `claude.ai proxy transport created successfully`);
158270
158438
  } else if ((serverRef.type === "stdio" || !serverRef.type) && isClaudeInChromeMCPServer(name)) {
158271
158439
  const { createChromeContext: createChromeContext2 } = await Promise.resolve().then(() => (init_mcpServer(), exports_mcpServer));
@@ -158305,7 +158473,7 @@ var init_client2 = __esm(() => {
158305
158473
  const client = new Client({
158306
158474
  name: "claude-code",
158307
158475
  title: "OpenClaude",
158308
- version: "0.31.2-by-rayss",
158476
+ version: "0.33.2-by-rayss",
158309
158477
  description: "OpenClaude — coding-agent CLI for any LLM provider",
158310
158478
  websiteUrl: PRODUCT_URL
158311
158479
  }, {
@@ -164037,9 +164205,9 @@ var init_claudemd = __esm(() => {
164037
164205
  });
164038
164206
 
164039
164207
  // sdk-missing-stub:../state/selectors.js
164040
- var noop116 = () => null, getViewedTeammateTask;
164208
+ var noop117 = () => null, getViewedTeammateTask;
164041
164209
  var init_selectors = __esm(() => {
164042
- getViewedTeammateTask = noop116;
164210
+ getViewedTeammateTask = noop117;
164043
164211
  });
164044
164212
 
164045
164213
  // src/services/diagnosticTracking.ts
@@ -165352,9 +165520,9 @@ __export(exports_repoMap, {
165352
165520
  default: () => repoMap_default,
165353
165521
  __stub: () => __stub4
165354
165522
  });
165355
- var noop117 = () => null, repoMap_default, __stub4 = true;
165523
+ var noop118 = () => null, repoMap_default, __stub4 = true;
165356
165524
  var init_repoMap = __esm(() => {
165357
- repoMap_default = noop117;
165525
+ repoMap_default = noop118;
165358
165526
  });
165359
165527
 
165360
165528
  // src/utils/nativeInstaller/pidLock.ts
@@ -167969,22 +168137,22 @@ function canDescendantShowPermissionPrompts({
167969
168137
  }
167970
168138
 
167971
168139
  // sdk-missing-stub:react-compiler-runtime
167972
- var noop118 = () => null, c6;
168140
+ var noop119 = () => null, c6;
167973
168141
  var init_react_compiler_runtime = __esm(() => {
167974
- c6 = noop118;
168142
+ c6 = noop119;
167975
168143
  });
167976
168144
 
167977
168145
  // sdk-missing-stub:src/components/ConfigurableShortcutHint.js
167978
- var noop119 = () => null, ConfigurableShortcutHint;
168146
+ var noop120 = () => null, ConfigurableShortcutHint;
167979
168147
  var init_ConfigurableShortcutHint = __esm(() => {
167980
- ConfigurableShortcutHint = noop119;
168148
+ ConfigurableShortcutHint = noop120;
167981
168149
  });
167982
168150
 
167983
168151
  // sdk-missing-stub:src/components/CtrlOToExpand.js
167984
- var noop120 = () => null, CtrlOToExpand, SubAgentProvider;
168152
+ var noop121 = () => null, CtrlOToExpand, SubAgentProvider;
167985
168153
  var init_CtrlOToExpand2 = __esm(() => {
167986
- CtrlOToExpand = noop120;
167987
- SubAgentProvider = noop120;
168154
+ CtrlOToExpand = noop121;
168155
+ SubAgentProvider = noop121;
167988
168156
  });
167989
168157
 
167990
168158
  // sdk-missing-stub:src/components/design-system/Byline.js
@@ -167997,43 +168165,43 @@ var init_KeyboardShortcutHint = () => {};
167997
168165
  var init_AgentProgressLine = () => {};
167998
168166
 
167999
168167
  // sdk-missing-stub:../../components/FallbackToolUseErrorMessage.js
168000
- var noop121 = () => null, FallbackToolUseErrorMessage;
168168
+ var noop122 = () => null, FallbackToolUseErrorMessage;
168001
168169
  var init_FallbackToolUseErrorMessage = __esm(() => {
168002
- FallbackToolUseErrorMessage = noop121;
168170
+ FallbackToolUseErrorMessage = noop122;
168003
168171
  });
168004
168172
 
168005
168173
  // sdk-missing-stub:../../components/FallbackToolUseRejectedMessage.js
168006
- var noop122 = () => null, FallbackToolUseRejectedMessage;
168174
+ var noop123 = () => null, FallbackToolUseRejectedMessage;
168007
168175
  var init_FallbackToolUseRejectedMessage = __esm(() => {
168008
- FallbackToolUseRejectedMessage = noop122;
168176
+ FallbackToolUseRejectedMessage = noop123;
168009
168177
  });
168010
168178
 
168011
168179
  // sdk-missing-stub:../../components/Markdown.js
168012
- var noop123 = () => null, Markdown;
168180
+ var noop124 = () => null, Markdown;
168013
168181
  var init_Markdown = __esm(() => {
168014
- Markdown = noop123;
168182
+ Markdown = noop124;
168015
168183
  });
168016
168184
 
168017
168185
  // sdk-missing-stub:../../components/Message.js
168018
- var noop124 = () => null, Message;
168186
+ var noop125 = () => null, Message;
168019
168187
  var init_Message = __esm(() => {
168020
- Message = noop124;
168188
+ Message = noop125;
168021
168189
  });
168022
168190
 
168023
168191
  // sdk-missing-stub:../../components/MessageResponse.js
168024
- var noop125 = () => null, MessageResponse;
168192
+ var noop126 = () => null, MessageResponse;
168025
168193
  var init_MessageResponse = __esm(() => {
168026
- MessageResponse = noop125;
168194
+ MessageResponse = noop126;
168027
168195
  });
168028
168196
 
168029
168197
  // sdk-missing-stub:../../components/ToolUseLoader.js
168030
168198
  var init_ToolUseLoader = () => {};
168031
168199
 
168032
168200
  // sdk-missing-stub:../../ink.js
168033
- var noop126 = () => null, Box, Text;
168201
+ var noop127 = () => null, Box, Text;
168034
168202
  var init_ink = __esm(() => {
168035
- Box = noop126;
168036
- Text = noop126;
168203
+ Box = noop127;
168204
+ Text = noop127;
168037
168205
  });
168038
168206
 
168039
168207
  // sdk-jsx-stub:react/jsx-dev-runtime
@@ -173630,8 +173798,8 @@ var init_FileEditTool = __esm(() => {
173630
173798
  if (readTimestamp) {
173631
173799
  const lastWriteTime = getFileModificationTime(fullFilePath);
173632
173800
  if (lastWriteTime > readTimestamp.timestamp) {
173633
- const isFullRead = readTimestamp.offset === undefined && readTimestamp.limit === undefined;
173634
- if (isFullRead && fileContent === readTimestamp.content) {} else {
173801
+ const isFullRead2 = readTimestamp.offset === undefined && readTimestamp.limit === undefined;
173802
+ if (isFullRead2 && fileContent === readTimestamp.content) {} else {
173635
173803
  return {
173636
173804
  result: false,
173637
173805
  behavior: "ask",
@@ -173733,8 +173901,8 @@ String: ${old_string}`,
173733
173901
  const lastWriteTime = getFileModificationTime(absoluteFilePath);
173734
173902
  const lastRead = readFileState.get(absoluteFilePath);
173735
173903
  if (!lastRead || lastWriteTime > lastRead.timestamp) {
173736
- const isFullRead = lastRead && lastRead.offset === undefined && lastRead.limit === undefined;
173737
- const contentUnchanged = isFullRead && originalFileContents === lastRead.content;
173904
+ const isFullRead2 = lastRead && lastRead.offset === undefined && lastRead.limit === undefined;
173905
+ const contentUnchanged = isFullRead2 && originalFileContents === lastRead.content;
173738
173906
  if (!contentUnchanged) {
173739
173907
  throw new Error(FILE_UNEXPECTEDLY_MODIFIED_ERROR);
173740
173908
  }
@@ -173995,7 +174163,7 @@ var init_FileWriteTool = __esm(() => {
173995
174163
  file_path: exports_external.string().describe("The absolute path to the file to write (must be absolute, not relative)"),
173996
174164
  write_mode: exports_external.enum(["replace", "start", "append", "finish"]).default("replace").describe("Write lifecycle mode"),
173997
174165
  write_id: exports_external.string().optional().describe("Chunked write identifier"),
173998
- chunk_index: exports_external.number().int().nonnegative().optional().describe("Zero-based chunk sequence index"),
174166
+ chunk_index: exports_external.number().int().nonnegative().optional().describe("Chunk sequence index; the first append after start must be 1"),
173999
174167
  content: exports_external.string().optional().describe("Content to write to the file")
174000
174168
  }).superRefine((value, ctx) => {
174001
174169
  if (value.write_mode === "finish") {
@@ -174289,8 +174457,8 @@ var init_FileWriteTool = __esm(() => {
174289
174457
  const lastWriteTime = getFileModificationTime(fullFilePath);
174290
174458
  const lastRead = readFileState.get(fullFilePath);
174291
174459
  if (!lastRead || lastWriteTime > lastRead.timestamp) {
174292
- const isFullRead = lastRead && lastRead.offset === undefined && lastRead.limit === undefined;
174293
- if (!isFullRead || meta.content !== lastRead.content) {
174460
+ const isFullRead2 = lastRead && lastRead.offset === undefined && lastRead.limit === undefined;
174461
+ if (!isFullRead2 || meta.content !== lastRead.content) {
174294
174462
  throw new Error(FILE_UNEXPECTEDLY_MODIFIED_ERROR);
174295
174463
  }
174296
174464
  }
@@ -174314,14 +174482,14 @@ var init_FileWriteTool = __esm(() => {
174314
174482
  return {
174315
174483
  tool_use_id: toolUseID,
174316
174484
  type: "tool_result",
174317
- content: `Started chunked write for ${output.filePath}; next chunk index is ${output.nextChunkIndex}.`
174485
+ content: `Started chunked write for ${output.filePath}; write_id is ` + `${output.writeId}; next chunk index is ${output.nextChunkIndex}.`
174318
174486
  };
174319
174487
  }
174320
174488
  if (output.type === "chunked_append") {
174321
174489
  return {
174322
174490
  tool_use_id: toolUseID,
174323
174491
  type: "tool_result",
174324
- content: `Appended chunk to ${output.filePath}; next chunk index is ${output.nextChunkIndex}.`
174492
+ content: `Appended chunk to ${output.filePath}; write_id is ` + `${output.writeId}; next chunk index is ${output.nextChunkIndex}.`
174325
174493
  };
174326
174494
  }
174327
174495
  if (output.type === "chunked_finish") {
@@ -194157,9 +194325,9 @@ var init_BriefTool = __esm(() => {
194157
194325
  });
194158
194326
 
194159
194327
  // sdk-missing-stub:../../keybindings/useShortcutDisplay.js
194160
- var noop127 = () => null, useShortcutDisplay;
194328
+ var noop128 = () => null, useShortcutDisplay;
194161
194329
  var init_useShortcutDisplay = __esm(() => {
194162
- useShortcutDisplay = noop127;
194330
+ useShortcutDisplay = noop128;
194163
194331
  });
194164
194332
 
194165
194333
  // src/utils/task/outputFormatting.ts
@@ -194187,10 +194355,10 @@ var init_outputFormatting = __esm(() => {
194187
194355
  });
194188
194356
 
194189
194357
  // sdk-missing-stub:../AgentTool/UI.js
194190
- var noop128 = () => null, AgentPromptDisplay2, AgentResponseDisplay;
194358
+ var noop129 = () => null, AgentPromptDisplay2, AgentResponseDisplay;
194191
194359
  var init_UI3 = __esm(() => {
194192
- AgentPromptDisplay2 = noop128;
194193
- AgentResponseDisplay = noop128;
194360
+ AgentPromptDisplay2 = noop129;
194361
+ AgentResponseDisplay = noop129;
194194
194362
  });
194195
194363
 
194196
194364
  // src/utils/sandbox/sandbox-ui-utils.ts
@@ -194199,27 +194367,27 @@ function removeSandboxViolationTags(text) {
194199
194367
  }
194200
194368
 
194201
194369
  // sdk-missing-stub:../../components/design-system/FullWidthRow.js
194202
- var noop129 = () => null, FullWidthRow_default;
194370
+ var noop130 = () => null, FullWidthRow_default;
194203
194371
  var init_FullWidthRow = __esm(() => {
194204
- FullWidthRow_default = noop129;
194372
+ FullWidthRow_default = noop130;
194205
194373
  });
194206
194374
 
194207
194375
  // sdk-missing-stub:../../components/design-system/KeyboardShortcutHint.js
194208
- var noop130 = () => null, KeyboardShortcutHint2;
194376
+ var noop131 = () => null, KeyboardShortcutHint2;
194209
194377
  var init_KeyboardShortcutHint2 = __esm(() => {
194210
- KeyboardShortcutHint2 = noop130;
194378
+ KeyboardShortcutHint2 = noop131;
194211
194379
  });
194212
194380
 
194213
194381
  // sdk-missing-stub:../../components/shell/OutputLine.js
194214
- var noop131 = () => null, OutputLine;
194382
+ var noop132 = () => null, OutputLine;
194215
194383
  var init_OutputLine = __esm(() => {
194216
- OutputLine = noop131;
194384
+ OutputLine = noop132;
194217
194385
  });
194218
194386
 
194219
194387
  // sdk-missing-stub:../../components/shell/ShellTimeDisplay.js
194220
- var noop132 = () => null, ShellTimeDisplay;
194388
+ var noop133 = () => null, ShellTimeDisplay;
194221
194389
  var init_ShellTimeDisplay = __esm(() => {
194222
- ShellTimeDisplay = noop132;
194390
+ ShellTimeDisplay = noop133;
194223
194391
  });
194224
194392
 
194225
194393
  // src/tools/BashTool/BashToolResultMessage.tsx
@@ -207144,9 +207312,9 @@ ${filenames.join(`
207144
207312
  });
207145
207313
 
207146
207314
  // sdk-missing-stub:../../context/repoMap/index.js
207147
- var noop133 = () => null, buildRepoMap;
207315
+ var noop134 = () => null, buildRepoMap;
207148
207316
  var init_repoMap2 = __esm(() => {
207149
- buildRepoMap = noop133;
207317
+ buildRepoMap = noop134;
207150
207318
  });
207151
207319
 
207152
207320
  // src/tools/RepoMapTool/prompt.ts
@@ -207301,9 +207469,9 @@ ${output.rendered}`
207301
207469
  });
207302
207470
 
207303
207471
  // sdk-missing-stub:src/components/MessageResponse.js
207304
- var noop134 = () => null, MessageResponse2;
207472
+ var noop135 = () => null, MessageResponse2;
207305
207473
  var init_MessageResponse2 = __esm(() => {
207306
- MessageResponse2 = noop134;
207474
+ MessageResponse2 = noop135;
207307
207475
  });
207308
207476
 
207309
207477
  // src/tools/AskUserQuestionTool/AskUserQuestionTool.tsx
@@ -219575,9 +219743,11 @@ function getMaxActiveMessagesHardCap(env4 = process.env) {
219575
219743
  const parsed = parseMaxActiveMessagesLimit(trimmed);
219576
219744
  return parsed > 0 ? parsed : DEFAULT_MAX_ACTIVE_MESSAGES_HARD_CAP;
219577
219745
  }
219578
- function resolveMaxActiveMessagesLimit(configSetting, envSetting) {
219579
- const configuredLimit = configSetting !== undefined && configSetting !== "off" ? parseMaxActiveMessagesLimit(configSetting) : parseMaxActiveMessagesLimit(envSetting);
219580
- const hardCap = getMaxActiveMessagesHardCap();
219746
+ function resolveMaxActiveMessagesLimit(configSetting, envSetting, hardCap = getMaxActiveMessagesHardCap()) {
219747
+ if (configSetting === "off") {
219748
+ return parseMaxActiveMessagesLimit(envSetting);
219749
+ }
219750
+ const configuredLimit = configSetting !== undefined ? parseMaxActiveMessagesLimit(configSetting) : parseMaxActiveMessagesLimit(envSetting);
219581
219751
  if (configuredLimit > 0 && hardCap > 0) {
219582
219752
  return Math.min(configuredLimit, hardCap);
219583
219753
  }
@@ -224196,7 +224366,7 @@ function getPrompt12() {
224196
224366
  ## When to Use This Tool
224197
224367
 
224198
224368
  - When the user asks what another active session is actually working on
224199
- - To see the most recent user prompts and assistant replies of a peer, beyond the metadata returned by HallPeers
224369
+ - To follow a peer's live progress: which files it is editing, what commands it runs, and their results
224200
224370
  - Before coordinating on shared files, to understand the peer's current intent
224201
224371
 
224202
224372
  ## Privacy
@@ -224206,13 +224376,19 @@ This reads the peer's transcript JSONL from this machine's OpenClaude config hom
224206
224376
  ## Input
224207
224377
 
224208
224378
  - **session_id** (optional): a peer session id from HallPeers. When omitted, reads every peer in this workspace.
224209
- - **limit** (optional): how many recent messages per peer to return (1-30, default 8).
224379
+ - **limit** (optional): how many recent activity events per peer to return (1-100, default 50).
224210
224380
 
224211
224381
  ## Output
224212
224382
 
224213
- For each peer: the session id, agent name, whether its transcript was found, and a list of recent messages with role and text.`;
224383
+ For each peer: the session id, agent name, whether its transcript was found, and a list of recent events in order. Each event has a role:
224384
+
224385
+ - **user** / **assistant**: conversation text.
224386
+ - **tool_use** (shown as \`[→] ToolName: key-argument\`): a tool the peer invoked, e.g. \`[→] Bash: bun test ./src/hall/\`.
224387
+ - **tool_result** (shown as \`[←] ToolName: result-summary\`): that tool's outcome.
224388
+
224389
+ Because tool calls and results are included, this reflects the peer's live progress within a long turn, not just its opening messages.`;
224214
224390
  }
224215
- var DESCRIPTION20 = "Read a peer session's recent conversation from its local transcript (Agent Hall)";
224391
+ var DESCRIPTION20 = "Read a peer session's recent activity (messages, tool calls, results) from its local transcript (Agent Hall)";
224216
224392
 
224217
224393
  // src/tools/HallPeerActivityTool/transcript.ts
224218
224394
  import { open as open9, readdir as readdir14, stat as stat22 } from "fs/promises";
@@ -224268,30 +224444,57 @@ function textOfContent2(content) {
224268
224444
  return parts.join(`
224269
224445
  `);
224270
224446
  }
224271
- function isToolResultOnly(content) {
224272
- if (!Array.isArray(content) || content.length === 0)
224273
- return false;
224274
- return content.every((b) => b !== null && typeof b === "object" && b.type === "tool_result");
224275
- }
224276
- async function readPeerMessages(sessionId, limit) {
224277
- const path13 = await findTranscriptPath(sessionId);
224278
- if (!path13)
224279
- return { found: false, messages: [] };
224280
- const tail = await readTail(path13, TAIL_BYTES);
224281
- const lines = tail.split(`
224282
- `);
224283
- const messages = [];
224284
- for (const rawLine of lines) {
224447
+ function summarizeToolInput2(input) {
224448
+ if (!input || typeof input !== "object")
224449
+ return "";
224450
+ const i3 = input;
224451
+ const candidate = i3.command ?? i3.file_path ?? i3.path ?? i3.pattern ?? i3.query ?? i3.url ?? i3.description;
224452
+ if (typeof candidate === "string")
224453
+ return clip(candidate, MAX_TOOL_CHARS);
224454
+ if (Array.isArray(i3.file_paths))
224455
+ return clip(i3.file_paths.join(", "), MAX_TOOL_CHARS);
224456
+ return clip(JSON.stringify(i3), MAX_TOOL_CHARS);
224457
+ }
224458
+ function summarizeToolResult(content) {
224459
+ const text = textOfContent2(content);
224460
+ return text ? clip(text, MAX_TOOL_CHARS) : "";
224461
+ }
224462
+ function parseRecords(tail) {
224463
+ const records = [];
224464
+ for (const rawLine of tail.split(`
224465
+ `)) {
224285
224466
  const line = rawLine.trim();
224286
224467
  if (!line)
224287
224468
  continue;
224288
- let rec;
224289
224469
  try {
224290
- rec = JSON.parse(line);
224291
- } catch {
224470
+ const rec = JSON.parse(line);
224471
+ records.push({ type: String(rec.type ?? ""), rec });
224472
+ } catch {}
224473
+ }
224474
+ return records;
224475
+ }
224476
+ function collectToolNames(records) {
224477
+ const names = new Map;
224478
+ for (const { type, rec } of records) {
224479
+ if (type !== "assistant")
224480
+ continue;
224481
+ const message = rec.message;
224482
+ if (!message || !Array.isArray(message.content))
224292
224483
  continue;
224484
+ for (const block2 of message.content) {
224485
+ if (!block2 || typeof block2 !== "object")
224486
+ continue;
224487
+ const b = block2;
224488
+ if (b.type === "tool_use" && typeof b.id === "string") {
224489
+ names.set(b.id, typeof b.name === "string" ? b.name : "tool");
224490
+ }
224293
224491
  }
224294
- const type = rec.type;
224492
+ }
224493
+ return names;
224494
+ }
224495
+ function buildMessages(records, toolNames) {
224496
+ const messages = [];
224497
+ for (const { type, rec } of records) {
224295
224498
  if (type !== "user" && type !== "assistant")
224296
224499
  continue;
224297
224500
  if (rec.isMeta === true)
@@ -224300,16 +224503,51 @@ async function readPeerMessages(sessionId, limit) {
224300
224503
  if (!message)
224301
224504
  continue;
224302
224505
  const content = message.content;
224303
- if (type === "user" && isToolResultOnly(content))
224506
+ if (Array.isArray(content)) {
224507
+ for (const block2 of content) {
224508
+ if (!block2 || typeof block2 !== "object")
224509
+ continue;
224510
+ const b = block2;
224511
+ if (b.type === "text" && typeof b.text === "string") {
224512
+ const body2 = clip(b.text);
224513
+ if (body2)
224514
+ messages.push({ role: type, text: body2 });
224515
+ } else if (type === "assistant" && b.type === "tool_use") {
224516
+ const name = typeof b.name === "string" ? b.name : "tool";
224517
+ const arg = summarizeToolInput2(b.input);
224518
+ messages.push({
224519
+ role: "tool_use",
224520
+ text: arg ? `${name}: ${arg}` : name
224521
+ });
224522
+ } else if (type === "user" && b.type === "tool_result") {
224523
+ const summary = summarizeToolResult(b.content);
224524
+ if (!summary)
224525
+ continue;
224526
+ const id = typeof b.tool_use_id === "string" ? b.tool_use_id : "";
224527
+ const name = toolNames.get(id) ?? "tool";
224528
+ messages.push({ role: "tool_result", text: `${name}: ${summary}` });
224529
+ }
224530
+ }
224304
224531
  continue;
224532
+ }
224305
224533
  const body = textOfContent2(content);
224306
- if (!body.trim())
224307
- continue;
224308
- messages.push({ role: type, text: clip(body) });
224534
+ if (body.trim()) {
224535
+ messages.push({ role: type, text: clip(body) });
224536
+ }
224309
224537
  }
224538
+ return messages;
224539
+ }
224540
+ async function readPeerMessages(sessionId, limit) {
224541
+ const path13 = await findTranscriptPath(sessionId);
224542
+ if (!path13)
224543
+ return { found: false, messages: [] };
224544
+ const tail = await readTail(path13, TAIL_BYTES);
224545
+ const records = parseRecords(tail);
224546
+ const toolNames = collectToolNames(records);
224547
+ const messages = buildMessages(records, toolNames);
224310
224548
  return { found: true, messages: messages.slice(-limit) };
224311
224549
  }
224312
- var TAIL_BYTES, MAX_MSG_CHARS = 400;
224550
+ var TAIL_BYTES, MAX_MSG_CHARS = 400, MAX_TOOL_CHARS = 160;
224313
224551
  var init_transcript = __esm(() => {
224314
224552
  init_envUtils();
224315
224553
  TAIL_BYTES = 512 * 1024;
@@ -224328,7 +224566,7 @@ var init_HallPeerActivityTool = __esm(() => {
224328
224566
  init_transcript();
224329
224567
  inputSchema45 = lazySchema(() => exports_external.strictObject({
224330
224568
  session_id: exports_external.string().optional().describe("Target a specific peer session id; omit to read all workspace peers"),
224331
- limit: exports_external.number().int().min(1).max(30).optional().describe("Recent messages per peer (default 8, max 30)")
224569
+ limit: exports_external.number().int().min(1).max(100).optional().describe("Recent activity events per peer (default 50, max 100)")
224332
224570
  }));
224333
224571
  outputSchema35 = lazySchema(() => exports_external.object({
224334
224572
  connected: exports_external.boolean(),
@@ -224379,7 +224617,7 @@ var init_HallPeerActivityTool = __esm(() => {
224379
224617
  if (!client2 || !client2.isConnected) {
224380
224618
  return { data: { connected: false, peers: [] } };
224381
224619
  }
224382
- const limit = input.limit ?? 8;
224620
+ const limit = input.limit ?? 50;
224383
224621
  let targets;
224384
224622
  if (input.session_id) {
224385
224623
  targets = [{ session_id: input.session_id, agent_name: input.session_id }];
@@ -224428,7 +224666,13 @@ Transcript not found on this machine.`;
224428
224666
  return `${header}
224429
224667
  No recent messages.`;
224430
224668
  }
224431
- const lines = peer.messages.map((m) => `[${m.role}] ${m.text}`);
224669
+ const lines = peer.messages.map((m) => {
224670
+ if (m.role === "tool_use")
224671
+ return ` [→] ${m.text}`;
224672
+ if (m.role === "tool_result")
224673
+ return ` [←] ${m.text}`;
224674
+ return `[${m.role}] ${m.text}`;
224675
+ });
224432
224676
  return `${header}
224433
224677
  ${lines.join(`
224434
224678
  `)}`;
@@ -224677,9 +224921,9 @@ __export(exports_PowerShellTool, {
224677
224921
  default: () => PowerShellTool_default,
224678
224922
  __stub: () => __stub5
224679
224923
  });
224680
- var noop135 = () => null, PowerShellTool_default, __stub5 = true;
224924
+ var noop136 = () => null, PowerShellTool_default, __stub5 = true;
224681
224925
  var init_PowerShellTool = __esm(() => {
224682
- PowerShellTool_default = noop135;
224926
+ PowerShellTool_default = noop136;
224683
224927
  });
224684
224928
 
224685
224929
  // src/tools.ts
@@ -224918,9 +225162,9 @@ var init_copilotOptimization = __esm(() => {
224918
225162
  });
224919
225163
 
224920
225164
  // sdk-missing-stub:../BashTool/UI.js
224921
- var noop136 = () => null, BackgroundHint2;
225165
+ var noop137 = () => null, BackgroundHint2;
224922
225166
  var init_UI4 = __esm(() => {
224923
- BackgroundHint2 = noop136;
225167
+ BackgroundHint2 = noop137;
224924
225168
  });
224925
225169
 
224926
225170
  // src/utils/swarm/teammateModel.ts
@@ -224938,9 +225182,9 @@ __export(exports_It2SetupPrompt, {
224938
225182
  default: () => It2SetupPrompt_default,
224939
225183
  __stub: () => __stub6
224940
225184
  });
224941
- var noop137 = () => null, It2SetupPrompt_default, __stub6 = true;
225185
+ var noop138 = () => null, It2SetupPrompt_default, __stub6 = true;
224942
225186
  var init_It2SetupPrompt = __esm(() => {
224943
- It2SetupPrompt_default = noop137;
225187
+ It2SetupPrompt_default = noop138;
224944
225188
  });
224945
225189
 
224946
225190
  // src/tools/shared/spawnMultiAgent.ts
@@ -229198,7 +229442,9 @@ async function getSkillListingAttachments(toolUseContext) {
229198
229442
  const localCommands = await getSkillToolCommands(cwd2);
229199
229443
  const mcpSkills = getMcpSkillCommands(toolUseContext.getAppState().mcp.commands);
229200
229444
  let allCommands = mcpSkills.length > 0 ? uniqBy_default([...localCommands, ...mcpSkills], "name") : localCommands;
229201
- allCommands = filterToBundledAndMcp(allCommands);
229445
+ if (skillSearchModules?.featureCheck.isSkillSearchEnabled()) {
229446
+ allCommands = filterToBundledAndMcp(allCommands);
229447
+ }
229202
229448
  const agentKey = toolUseContext.agentId ?? "";
229203
229449
  let sent = sentSkillNames.get(agentKey);
229204
229450
  if (!sent) {
@@ -235042,9 +235288,9 @@ var init_providerFallback = __esm(() => {
235042
235288
  });
235043
235289
 
235044
235290
  // sdk-missing-stub:../keybindings/shortcutFormat.js
235045
- var noop138 = () => null, getShortcutDisplay;
235291
+ var noop139 = () => null, getShortcutDisplay;
235046
235292
  var init_shortcutFormat = __esm(() => {
235047
- getShortcutDisplay = noop138;
235293
+ getShortcutDisplay = noop139;
235048
235294
  });
235049
235295
 
235050
235296
  // src/services/autoDream/config.ts
@@ -238216,7 +238462,7 @@ function getAnthropicEnvMetadata() {
238216
238462
  function getBuildAgeMinutes() {
238217
238463
  if (false)
238218
238464
  ;
238219
- const buildTime = new Date("2026-10-08T13:31:49.092Z").getTime();
238465
+ const buildTime = new Date("2026-10-23T01:50:01.313Z").getTime();
238220
238466
  if (isNaN(buildTime))
238221
238467
  return;
238222
238468
  return Math.floor((Date.now() - buildTime) / 60000);
@@ -240622,9 +240868,9 @@ var init_hintRecommendation = __esm(() => {
240622
240868
  });
240623
240869
 
240624
240870
  // sdk-missing-stub:../FileEditTool/UI.js
240625
- var noop139 = () => null, userFacingName2;
240871
+ var noop140 = () => null, userFacingName2;
240626
240872
  var init_UI5 = __esm(() => {
240627
- userFacingName2 = noop139;
240873
+ userFacingName2 = noop140;
240628
240874
  });
240629
240875
 
240630
240876
  // src/tools/BashTool/commandSemantics.ts
@@ -244007,9 +244253,9 @@ __export(exports_PowerShellTool2, {
244007
244253
  default: () => PowerShellTool_default2,
244008
244254
  __stub: () => __stub7
244009
244255
  });
244010
- var noop140 = () => null, PowerShellTool_default2, __stub7 = true;
244256
+ var noop141 = () => null, PowerShellTool_default2, __stub7 = true;
244011
244257
  var init_PowerShellTool2 = __esm(() => {
244012
- PowerShellTool_default2 = noop140;
244258
+ PowerShellTool_default2 = noop141;
244013
244259
  });
244014
244260
 
244015
244261
  // src/utils/promptShellExecution.ts
@@ -244776,94 +245022,94 @@ var init_bundledSkills = __esm(() => {
244776
245022
  });
244777
245023
 
244778
245024
  // sdk-missing-stub:./commands/env/index.js
244779
- var noop141 = () => null, env_default;
245025
+ var noop142 = () => null, env_default;
244780
245026
  var init_env2 = __esm(() => {
244781
- env_default = noop141;
245027
+ env_default = noop142;
244782
245028
  });
244783
245029
 
244784
245030
  // sdk-missing-stub:./commands/exit/index.js
244785
- var noop142 = () => null, exit_default;
245031
+ var noop143 = () => null, exit_default;
244786
245032
  var init_exit = __esm(() => {
244787
- exit_default = noop142;
245033
+ exit_default = noop143;
244788
245034
  });
244789
245035
 
244790
245036
  // sdk-missing-stub:./commands/export/index.js
244791
- var noop143 = () => null, export_default;
245037
+ var noop144 = () => null, export_default;
244792
245038
  var init_export = __esm(() => {
244793
- export_default = noop143;
245039
+ export_default = noop144;
244794
245040
  });
244795
245041
 
244796
245042
  // sdk-missing-stub:./commands/model/index.js
244797
- var noop144 = () => null, model_default;
245043
+ var noop145 = () => null, model_default;
244798
245044
  var init_model2 = __esm(() => {
244799
- model_default = noop144;
245045
+ model_default = noop145;
244800
245046
  });
244801
245047
 
244802
245048
  // sdk-missing-stub:./commands/tag/index.js
244803
- var noop145 = () => null, tag_default;
245049
+ var noop146 = () => null, tag_default;
244804
245050
  var init_tag = __esm(() => {
244805
- tag_default = noop145;
245051
+ tag_default = noop146;
244806
245052
  });
244807
245053
 
244808
245054
  // sdk-missing-stub:./commands/output-style/index.js
244809
- var noop146 = () => null, output_style_default;
245055
+ var noop147 = () => null, output_style_default;
244810
245056
  var init_output_style = __esm(() => {
244811
- output_style_default = noop146;
245057
+ output_style_default = noop147;
244812
245058
  });
244813
245059
 
244814
245060
  // sdk-missing-stub:./commands/remote-env/index.js
244815
- var noop147 = () => null, remote_env_default;
245061
+ var noop148 = () => null, remote_env_default;
244816
245062
  var init_remote_env = __esm(() => {
244817
- remote_env_default = noop147;
245063
+ remote_env_default = noop148;
244818
245064
  });
244819
245065
 
244820
245066
  // sdk-missing-stub:./commands/upgrade/index.js
244821
- var noop148 = () => null, upgrade_default;
245067
+ var noop149 = () => null, upgrade_default;
244822
245068
  var init_upgrade = __esm(() => {
244823
- upgrade_default = noop148;
245069
+ upgrade_default = noop149;
244824
245070
  });
244825
245071
 
244826
245072
  // sdk-missing-stub:./commands/extra-usage/index.js
244827
- var noop149 = () => null, extraUsage, extraUsageNonInteractive;
245073
+ var noop150 = () => null, extraUsage, extraUsageNonInteractive;
244828
245074
  var init_extra_usage = __esm(() => {
244829
- extraUsage = noop149;
244830
- extraUsageNonInteractive = noop149;
245075
+ extraUsage = noop150;
245076
+ extraUsageNonInteractive = noop150;
244831
245077
  });
244832
245078
 
244833
245079
  // sdk-missing-stub:./commands/rate-limit-options/index.js
244834
- var noop150 = () => null, rate_limit_options_default;
245080
+ var noop151 = () => null, rate_limit_options_default;
244835
245081
  var init_rate_limit_options = __esm(() => {
244836
- rate_limit_options_default = noop150;
245082
+ rate_limit_options_default = noop151;
244837
245083
  });
244838
245084
 
244839
245085
  // sdk-missing-stub:./commands/statusline.js
244840
- var noop151 = () => null, statusline_default;
245086
+ var noop152 = () => null, statusline_default;
244841
245087
  var init_statusline = __esm(() => {
244842
- statusline_default = noop151;
245088
+ statusline_default = noop152;
244843
245089
  });
244844
245090
 
244845
245091
  // sdk-missing-stub:./commands/effort/index.js
244846
- var noop152 = () => null, effort_default;
245092
+ var noop153 = () => null, effort_default;
244847
245093
  var init_effort2 = __esm(() => {
244848
- effort_default = noop152;
245094
+ effort_default = noop153;
244849
245095
  });
244850
245096
 
244851
245097
  // sdk-missing-stub:./commands/stats/index.js
244852
- var noop153 = () => null, stats_default;
245098
+ var noop154 = () => null, stats_default;
244853
245099
  var init_stats = __esm(() => {
244854
- stats_default = noop153;
245100
+ stats_default = noop154;
244855
245101
  });
244856
245102
 
244857
245103
  // sdk-missing-stub:./commands/oauth-refresh/index.js
244858
- var noop154 = () => null, oauth_refresh_default;
245104
+ var noop155 = () => null, oauth_refresh_default;
244859
245105
  var init_oauth_refresh = __esm(() => {
244860
- oauth_refresh_default = noop154;
245106
+ oauth_refresh_default = noop155;
244861
245107
  });
244862
245108
 
244863
245109
  // sdk-missing-stub:./commands/debug-tool-call/index.js
244864
- var noop155 = () => null, debug_tool_call_default;
245110
+ var noop156 = () => null, debug_tool_call_default;
244865
245111
  var init_debug_tool_call = __esm(() => {
244866
- debug_tool_call_default = noop155;
245112
+ debug_tool_call_default = noop156;
244867
245113
  });
244868
245114
 
244869
245115
  // src/types/command.ts
@@ -244886,9 +245132,9 @@ __export(exports_agents_platform, {
244886
245132
  default: () => agents_platform_default,
244887
245133
  __stub: () => __stub8
244888
245134
  });
244889
- var noop156 = () => null, agents_platform_default, __stub8 = true;
245135
+ var noop157 = () => null, agents_platform_default, __stub8 = true;
244890
245136
  var init_agents_platform = __esm(() => {
244891
- agents_platform_default = noop156;
245137
+ agents_platform_default = noop157;
244892
245138
  });
244893
245139
 
244894
245140
  // sdk-missing-stub:./commands/hall/index.js
@@ -244897,9 +245143,9 @@ __export(exports_hall, {
244897
245143
  default: () => hall_default,
244898
245144
  __stub: () => __stub9
244899
245145
  });
244900
- var noop157 = () => null, hall_default, __stub9 = true;
245146
+ var noop158 = () => null, hall_default, __stub9 = true;
244901
245147
  var init_hall = __esm(() => {
244902
- hall_default = noop157;
245148
+ hall_default = noop158;
244903
245149
  });
244904
245150
 
244905
245151
  // sdk-missing-stub:./commands/buddy/index.js
@@ -244908,9 +245154,9 @@ __export(exports_buddy, {
244908
245154
  default: () => buddy_default,
244909
245155
  __stub: () => __stub10
244910
245156
  });
244911
- var noop158 = () => null, buddy_default, __stub10 = true;
245157
+ var noop159 = () => null, buddy_default, __stub10 = true;
244912
245158
  var init_buddy = __esm(() => {
244913
- buddy_default = noop158;
245159
+ buddy_default = noop159;
244914
245160
  });
244915
245161
 
244916
245162
  // sdk-missing-stub:./commands/insights.js
@@ -244919,9 +245165,9 @@ __export(exports_insights, {
244919
245165
  default: () => insights_default,
244920
245166
  __stub: () => __stub11
244921
245167
  });
244922
- var noop159 = () => null, insights_default, __stub11 = true;
245168
+ var noop160 = () => null, insights_default, __stub11 = true;
244923
245169
  var init_insights = __esm(() => {
244924
- insights_default = noop159;
245170
+ insights_default = noop160;
244925
245171
  });
244926
245172
 
244927
245173
  // src/commands.ts
@@ -245161,6 +245407,7 @@ var init_commands = __esm(() => {
245161
245407
  init_resume();
245162
245408
  init_review();
245163
245409
  init_session();
245410
+ init_sessions();
245164
245411
  init_set_context_window();
245165
245412
  init_share();
245166
245413
  init_skills();
@@ -245345,6 +245592,7 @@ var init_commands = __esm(() => {
245345
245592
  requestSizeNonInteractive,
245346
245593
  resume_default,
245347
245594
  session_default,
245595
+ sessions_default,
245348
245596
  set_context_window_default,
245349
245597
  skills_default,
245350
245598
  stats_default,
@@ -246719,6 +246967,7 @@ function messageTokenCountFromLastAPIResponse(messages) {
246719
246967
  return 0;
246720
246968
  }
246721
246969
  function getCurrentUsage(messages) {
246970
+ messages = getMessagesAfterCompactBoundary(messages);
246722
246971
  for (let i3 = messages.length - 1;i3 >= 0; i3--) {
246723
246972
  const message = messages[i3];
246724
246973
  const usage = message ? getTokenUsage(message) : undefined;
@@ -247498,8 +247747,11 @@ __export(exports_autoCompact, {
247498
247747
  function getEffectiveContextWindowSize(model, runtimeLimits) {
247499
247748
  const reservedTokensForSummary = Math.min(runtimeLimits?.maxOutputTokens ?? getMaxOutputTokensForModel(model), MAX_OUTPUT_TOKENS_FOR_SUMMARY);
247500
247749
  let contextWindow = getContextWindowForModel(model, getSdkBetas(), runtimeLimits);
247750
+ const internalContextWindowOverride = process.env.USER_TYPE === "ant" ? parseInt(process.env.CLAUDE_CODE_MAX_CONTEXT_TOKENS ?? "", 10) : NaN;
247751
+ const internalOverrideTakesPrecedence = Number.isFinite(internalContextWindowOverride) && internalContextWindowOverride > 0;
247752
+ const hasSessionOverride = getSessionContextWindowOverride(model) !== undefined && !internalOverrideTakesPrecedence;
247501
247753
  const autoCompactWindow = process.env.CLAUDE_CODE_AUTO_COMPACT_WINDOW;
247502
- if (autoCompactWindow) {
247754
+ if (autoCompactWindow && !hasSessionOverride) {
247503
247755
  const parsed = parseInt(autoCompactWindow, 10);
247504
247756
  if (!isNaN(parsed) && parsed > 0) {
247505
247757
  contextWindow = Math.min(contextWindow, parsed);
@@ -249781,7 +250033,7 @@ async function* openaiStreamToAnthropic(response, model, signal, isOllama, reque
249781
250033
  }
249782
250034
  }
249783
250035
  }
249784
- if (!hasEmittedFinalUsage && chunkUsage && (chunk.choices?.length ?? 0) === 0 && lastStopReason !== null) {
250036
+ if (!hasEmittedFinalUsage && chunkUsage && lastStopReason !== null) {
249785
250037
  throwIfStreamAborted2(signal);
249786
250038
  yield {
249787
250039
  type: "message_delta",
@@ -257561,10 +257813,10 @@ var init_dangerousModePromptRuntime = __esm(() => {
257561
257813
  });
257562
257814
 
257563
257815
  // sdk-missing-stub:../../commands/add-dir/validation.js
257564
- var noop160 = () => null, addDirHelpMessage, validateDirectoryForWorkspace;
257816
+ var noop161 = () => null, addDirHelpMessage, validateDirectoryForWorkspace;
257565
257817
  var init_validation3 = __esm(() => {
257566
- addDirHelpMessage = noop160;
257567
- validateDirectoryForWorkspace = noop160;
257818
+ addDirHelpMessage = noop161;
257819
+ validateDirectoryForWorkspace = noop161;
257568
257820
  });
257569
257821
 
257570
257822
  // src/utils/permissions/dangerousPatterns.ts
@@ -263329,6 +263581,7 @@ __export(exports_sessionStorage, {
263329
263581
  saveAgentSetting: () => saveAgentSetting,
263330
263582
  saveAgentName: () => saveAgentName,
263331
263583
  saveAgentColor: () => saveAgentColor,
263584
+ restoreSessionWrites: () => restoreSessionWrites,
263332
263585
  restoreSessionMetadata: () => restoreSessionMetadata,
263333
263586
  resetTranscriptRewriteHooksForTesting: () => resetTranscriptRewriteHooksForTesting,
263334
263587
  resetSessionFilePointer: () => resetSessionFilePointer,
@@ -263388,6 +263641,7 @@ __export(exports_sessionStorage, {
263388
263641
  getCurrentSessionAgentColor: () => getCurrentSessionAgentColor,
263389
263642
  getAgentTranscriptPath: () => getAgentTranscriptPath,
263390
263643
  getAgentTranscript: () => getAgentTranscript,
263644
+ forgetDeletedSession: () => forgetDeletedSession,
263391
263645
  flushSessionStorage: () => flushSessionStorage,
263392
263646
  findUnresolvedToolUse: () => findUnresolvedToolUse,
263393
263647
  fetchLogs: () => fetchLogs,
@@ -263417,7 +263671,7 @@ import {
263417
263671
  unlink as unlink10,
263418
263672
  writeFile as writeFile23
263419
263673
  } from "fs/promises";
263420
- import { basename as basename26, dirname as dirname47, join as join92 } from "path";
263674
+ import { basename as basename26, dirname as dirname47, join as join92, resolve as resolvePath2 } from "path";
263421
263675
  function getBuiltInCommandNames() {
263422
263676
  if (builtInCommandNamesCache)
263423
263677
  return builtInCommandNamesCache;
@@ -263618,6 +263872,16 @@ function isTranscriptMessage(entry) {
263618
263872
  function isChainParticipant(m) {
263619
263873
  return m.type !== "progress";
263620
263874
  }
263875
+ function startsConversation(message) {
263876
+ if (message.type === "assistant") {
263877
+ return message.message.model !== SYNTHETIC_MODEL;
263878
+ }
263879
+ if (message.type !== "user" || message.isMeta)
263880
+ return false;
263881
+ const content = message.message.content;
263882
+ const blocks = typeof content === "string" ? [{ type: "text", text: content }] : content;
263883
+ return blocks.some((block2) => block2.type !== "text" || !LOCAL_COMMAND_TAGS.some((tag2) => block2.text.trimStart().startsWith(`<${tag2}>`)));
263884
+ }
263621
263885
  function isLegacyProgressEntry(entry) {
263622
263886
  return typeof entry === "object" && entry !== null && "type" in entry && entry.type === "progress" && "uuid" in entry && typeof entry.uuid === "string";
263623
263887
  }
@@ -263809,6 +264073,7 @@ class Project {
263809
264073
  currentSessionBranch;
263810
264074
  sessionFile = null;
263811
264075
  pendingEntries = [];
264076
+ pendingEntriesSessionId = null;
263812
264077
  remoteIngressUrl = null;
263813
264078
  internalEventWriter = null;
263814
264079
  internalEventReader = null;
@@ -263910,6 +264175,8 @@ class Project {
263910
264175
  this.scheduleDrain();
263911
264176
  }
263912
264177
  async appendDirectlyToFile(filePath, data) {
264178
+ if (this.isDeletedSessionFile(filePath))
264179
+ return;
263913
264180
  transcriptRewriteHooksForTesting.beforeFileAppend?.(filePath);
263914
264181
  await mkdir25(dirname47(filePath), { recursive: true, mode: 448 });
263915
264182
  await withTranscriptFileLock(filePath, async (signal) => {
@@ -263961,6 +264228,8 @@ class Project {
263961
264228
  const earlierDirectAppends = this.pendingDirectAppends.get(filePath);
263962
264229
  if (earlierDirectAppends)
263963
264230
  await Promise.all(earlierDirectAppends);
264231
+ if (this.isDeletedSessionFile(filePath))
264232
+ return;
263964
264233
  await withTranscriptFileLock(filePath, (signal) => rewrite(signal));
263965
264234
  transcriptRewriteHooksForTesting.beforeBarrierRelease?.(filePath);
263966
264235
  }
@@ -264076,6 +264345,13 @@ class Project {
264076
264345
  resetSessionFile() {
264077
264346
  this.sessionFile = null;
264078
264347
  this.pendingEntries = [];
264348
+ this.pendingEntriesSessionId = null;
264349
+ }
264350
+ dropForeignPendingEntries(sessionId) {
264351
+ if (this.pendingEntriesSessionId !== null && this.pendingEntriesSessionId !== sessionId) {
264352
+ this.pendingEntries = [];
264353
+ this.pendingEntriesSessionId = null;
264354
+ }
264079
264355
  }
264080
264356
  reAppendSessionMetadata(skipTitleRefresh = false) {
264081
264357
  if (!this.sessionFile)
@@ -264262,11 +264538,13 @@ class Project {
264262
264538
  async materializeSessionFile() {
264263
264539
  if (this.shouldSkipPersistence())
264264
264540
  return;
264541
+ this.dropForeignPendingEntries(getSessionId());
264265
264542
  this.ensureCurrentSessionFile();
264266
264543
  this.reAppendSessionMetadata();
264267
264544
  if (this.pendingEntries.length > 0) {
264268
264545
  const buffered = this.pendingEntries;
264269
264546
  this.pendingEntries = [];
264547
+ this.pendingEntriesSessionId = null;
264270
264548
  for (const entry of buffered) {
264271
264549
  await this.appendEntry(entry);
264272
264550
  }
@@ -264275,7 +264553,7 @@ class Project {
264275
264553
  async insertMessageChain(messages, isSidechain = false, agentId, startingParentUuid, teamInfo) {
264276
264554
  return this.trackWrite(async () => {
264277
264555
  let parentUuid = startingParentUuid ?? null;
264278
- if (this.sessionFile === null && messages.some((m) => m.type === "user" || m.type === "assistant")) {
264556
+ if (this.sessionFile === null && messages.some(startsConversation)) {
264279
264557
  await this.materializeSessionFile();
264280
264558
  }
264281
264559
  let gitBranch;
@@ -264401,6 +264679,8 @@ class Project {
264401
264679
  let sessionFile;
264402
264680
  if (isCurrentSession) {
264403
264681
  if (this.sessionFile === null) {
264682
+ this.dropForeignPendingEntries(currentSessionId);
264683
+ this.pendingEntriesSessionId = currentSessionId;
264404
264684
  this.pendingEntries.push(entry);
264405
264685
  return;
264406
264686
  }
@@ -264486,6 +264766,23 @@ class Project {
264486
264766
  return this.sessionFile;
264487
264767
  }
264488
264768
  existingSessionFiles = new Map;
264769
+ deletedSessionFiles = new Set;
264770
+ isDeletedSessionFile(filePath) {
264771
+ return this.deletedSessionFiles.size > 0 && this.deletedSessionFiles.has(resolvePath2(filePath));
264772
+ }
264773
+ async forgetDeletedSession(sessionId, transcriptPath) {
264774
+ this.deletedSessionFiles.add(resolvePath2(transcriptPath));
264775
+ this.existingSessionFiles.delete(sessionId);
264776
+ if (this.sessionFile && this.isDeletedSessionFile(this.sessionFile)) {
264777
+ this.resetSessionFile();
264778
+ }
264779
+ await this.flush();
264780
+ const inFlight = [...this.pendingDirectAppends].filter(([path13]) => this.isDeletedSessionFile(path13)).flatMap(([, appends]) => [...appends]);
264781
+ await Promise.allSettled(inFlight);
264782
+ }
264783
+ restoreSessionWrites(transcriptPath) {
264784
+ this.deletedSessionFiles.delete(resolvePath2(transcriptPath));
264785
+ }
264489
264786
  async getExistingSessionFile(sessionId) {
264490
264787
  const cached3 = this.existingSessionFiles.get(sessionId);
264491
264788
  if (cached3)
@@ -264600,6 +264897,12 @@ async function recordSpeculationAccept(entry) {
264600
264897
  async function recordGoalState(goal, sessionId = getSessionId()) {
264601
264898
  await getProject().insertGoalState(goal, sessionId);
264602
264899
  }
264900
+ async function forgetDeletedSession(sessionId, transcriptPath) {
264901
+ await getProject().forgetDeletedSession(sessionId, transcriptPath);
264902
+ }
264903
+ function restoreSessionWrites(transcriptPath) {
264904
+ getProject().restoreSessionWrites(transcriptPath);
264905
+ }
264603
264906
  async function resetSessionFilePointer() {
264604
264907
  getProject().resetSessionFile();
264605
264908
  }
@@ -265459,6 +265762,8 @@ async function fetchLogs(limit) {
265459
265762
  }
265460
265763
  function appendEntryToFile(fullPath, entry) {
265461
265764
  const fs2 = getFsImplementation();
265765
+ if (project?.isDeletedSessionFile(fullPath))
265766
+ return;
265462
265767
  const line = jsonStringify(entry) + `
265463
265768
  `;
265464
265769
  if (project?._deferSynchronousAppend(fullPath, line))
@@ -267126,7 +267431,7 @@ async function enrichLogs(allLogs, startIndex, count4, options2) {
267126
267431
  }
267127
267432
  return { logs: result, nextIndex: i3 };
267128
267433
  }
267129
- var VERSION3, builtInCommandNamesCache, MAX_TOMBSTONE_REWRITE_BYTES, TRANSCRIPT_COPY_CHUNK_BYTES, transcriptRewriteHooksForTesting, SKIP_FIRST_PROMPT_PATTERN2, EPHEMERAL_PROGRESS_TYPES, MAX_TRANSCRIPT_READ_BYTES, agentTranscriptSubdirs, getProjectDir2, project = null, cleanupRegistered2 = false, REMOTE_FLUSH_INTERVAL_MS = 10, PERSISTED_OUTPUT_TAG2, TOOL_USE_RESULT_KEY, SEARCH_HEAD_BYTES, SEARCH_TAIL_BYTES, SEARCH_MID_WINDOW_BYTES, SEARCH_MAX_MID_WINDOWS = 12, SEARCH_MAX_TOTAL_READ_BYTES, SEARCH_MAX_CHAR_COUNT = 80000, METADATA_TYPE_MARKERS, METADATA_MARKER_BUFS, METADATA_PREFIX_BOUND = 25, getSessionMessages2, INITIAL_ENRICH_COUNT = 50, SESSION_BRANCH_ENTRY_PREFIX = '{"type":"session-branch"', SESSION_BRANCH_ENTRY_PREFIX_SPACED = '{"type": "session-branch"';
267434
+ var VERSION3, builtInCommandNamesCache, MAX_TOMBSTONE_REWRITE_BYTES, TRANSCRIPT_COPY_CHUNK_BYTES, transcriptRewriteHooksForTesting, SKIP_FIRST_PROMPT_PATTERN2, LOCAL_COMMAND_TAGS, EPHEMERAL_PROGRESS_TYPES, MAX_TRANSCRIPT_READ_BYTES, agentTranscriptSubdirs, getProjectDir2, project = null, cleanupRegistered2 = false, REMOTE_FLUSH_INTERVAL_MS = 10, PERSISTED_OUTPUT_TAG2, TOOL_USE_RESULT_KEY, SEARCH_HEAD_BYTES, SEARCH_TAIL_BYTES, SEARCH_MID_WINDOW_BYTES, SEARCH_MAX_MID_WINDOWS = 12, SEARCH_MAX_TOTAL_READ_BYTES, SEARCH_MAX_CHAR_COUNT = 80000, METADATA_TYPE_MARKERS, METADATA_MARKER_BUFS, METADATA_PREFIX_BOUND = 25, getSessionMessages2, INITIAL_ENRICH_COUNT = 50, SESSION_BRANCH_ENTRY_PREFIX = '{"type":"session-branch"', SESSION_BRANCH_ENTRY_PREFIX_SPACED = '{"type": "session-branch"';
267130
267435
  var init_sessionStorage = __esm(() => {
267131
267436
  init_memoize();
267132
267437
  init_state();
@@ -267156,11 +267461,17 @@ var init_sessionStorage = __esm(() => {
267156
267461
  init_slowOperations();
267157
267462
  init_transcriptFileLock();
267158
267463
  init_uuid();
267159
- VERSION3 = typeof MACRO !== "undefined" ? "0.31.2-by-rayss" : "unknown";
267464
+ VERSION3 = typeof MACRO !== "undefined" ? "0.33.2-by-rayss" : "unknown";
267160
267465
  MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
267161
267466
  TRANSCRIPT_COPY_CHUNK_BYTES = 64 * 1024;
267162
267467
  transcriptRewriteHooksForTesting = {};
267163
267468
  SKIP_FIRST_PROMPT_PATTERN2 = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
267469
+ LOCAL_COMMAND_TAGS = [
267470
+ COMMAND_NAME_TAG,
267471
+ LOCAL_COMMAND_STDOUT_TAG,
267472
+ LOCAL_COMMAND_STDERR_TAG,
267473
+ LOCAL_COMMAND_CAVEAT_TAG
267474
+ ];
267164
267475
  EPHEMERAL_PROGRESS_TYPES = new Set([
267165
267476
  "bash_progress",
267166
267477
  "powershell_progress",
@@ -268627,7 +268938,7 @@ var init_filesystem = __esm(() => {
268627
268938
  });
268628
268939
  getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
268629
268940
  const nonce = randomBytes10(16).toString("hex");
268630
- return join94(getClaudeTempDir(), "bundled-skills", "0.31.2-by-rayss", nonce);
268941
+ return join94(getClaudeTempDir(), "bundled-skills", "0.33.2-by-rayss", nonce);
268631
268942
  });
268632
268943
  getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
268633
268944
  });
@@ -269381,7 +269692,7 @@ function getWindowsBashHookCommand(command) {
269381
269692
  }
269382
269693
  if (/^\s*\(\s*\)/.test(rest.trimStart().slice(word.length)))
269383
269694
  return command;
269384
- return /\.sh["']?$/.test(word) ? `${command.slice(0, offset)}bash ${rest}` : command;
269695
+ return /\.sh["']?$/i.test(word) ? `${command.slice(0, offset)}bash ${rest}` : command;
269385
269696
  }
269386
269697
  }
269387
269698
 
@@ -277802,9 +278113,9 @@ var init_processTextPrompt = __esm(() => {
277802
278113
  });
277803
278114
 
277804
278115
  // sdk-missing-stub:src/components/BashModeProgress.js
277805
- var noop161 = () => null, BashModeProgress;
278116
+ var noop162 = () => null, BashModeProgress;
277806
278117
  var init_BashModeProgress = __esm(() => {
277807
- BashModeProgress = noop161;
278118
+ BashModeProgress = noop162;
277808
278119
  });
277809
278120
 
277810
278121
  // src/utils/shell/resolveDefaultShell.ts
@@ -283166,7 +283477,7 @@ function buildSystemInitMessage(inputs) {
283166
283477
  slash_commands: inputs.commands.filter((c7) => c7.userInvocable !== false).map((c7) => c7.name),
283167
283478
  apiKeySource: getAnthropicApiKeyWithSource().source,
283168
283479
  betas: getSdkBetas(),
283169
- claude_code_version: "0.31.2-by-rayss",
283480
+ claude_code_version: "0.33.2-by-rayss",
283170
283481
  output_style: outputStyle,
283171
283482
  agents: inputs.agents.map((agent) => agent.agentType),
283172
283483
  skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill) => skill.name),
@@ -285593,9 +285904,9 @@ __export(exports_InvalidConfigDialog, {
285593
285904
  default: () => InvalidConfigDialog_default,
285594
285905
  __stub: () => __stub12
285595
285906
  });
285596
- var noop162 = () => null, InvalidConfigDialog_default, __stub12 = true;
285907
+ var noop163 = () => null, InvalidConfigDialog_default, __stub12 = true;
285597
285908
  var init_InvalidConfigDialog = __esm(() => {
285598
- InvalidConfigDialog_default = noop162;
285909
+ InvalidConfigDialog_default = noop163;
285599
285910
  });
285600
285911
 
285601
285912
  // src/entrypoints/init.ts
@@ -286090,7 +286401,7 @@ async function forkSession(sessionId, options2) {
286090
286401
  }
286091
286402
  return { sessionId: forkSessionId };
286092
286403
  }
286093
- var init_sessions = __esm(() => {
286404
+ var init_sessions2 = __esm(() => {
286094
286405
  init_listSessionsImpl();
286095
286406
  init_sessionStoragePortable();
286096
286407
  init_json();
@@ -286781,7 +287092,7 @@ var init_query2 = __esm(() => {
286781
287092
  init_fileHistory();
286782
287093
  init_shared2();
286783
287094
  init_permissions4();
286784
- init_sessions();
287095
+ init_sessions2();
286785
287096
  init_agentDefinitions();
286786
287097
  QueryImpl = class QueryImpl {
286787
287098
  _engine = null;
@@ -287755,7 +288066,7 @@ var init_sdk2 = __esm(() => {
287755
288066
  init_QueryEngine();
287756
288067
  init_tools2();
287757
288068
  init_init2();
287758
- init_sessions();
288069
+ init_sessions2();
287759
288070
  init_query2();
287760
288071
  init_v2();
287761
288072
  init_errors();
@@ -287790,4 +288101,4 @@ export {
287790
288101
  AbortError
287791
288102
  };
287792
288103
 
287793
- //# debugId=4114905C61A7F2F064756E2164756E21
288104
+ //# debugId=FF699A9CFF4EF9BA64756E2164756E21