localclawd 2.3.4 → 2.3.5

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 (2) hide show
  1. package/dist/cli.mjs +685 -766
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -34087,8 +34087,9 @@ var init_settings2 = __esm(() => {
34087
34087
  });
34088
34088
 
34089
34089
  // src/memdir/paths.ts
34090
+ import { createHash as createHash2 } from "crypto";
34090
34091
  import { existsSync as existsSync3, readFileSync as readFileSync4 } from "fs";
34091
- import { join as join20, normalize as normalize3, sep as sep4 } from "path";
34092
+ import { basename as basename4, isAbsolute as isAbsolute4, join as join20, normalize as normalize3, relative as relative3, sep as sep4 } from "path";
34092
34093
  function isAutoMemoryEnabled() {
34093
34094
  const localclawdEnvVal = process.env.LOCALCLAWD_DISABLE_MEMORY;
34094
34095
  if (isEnvTruthy(localclawdEnvVal))
@@ -34139,9 +34140,37 @@ function hasAutoMemPathOverride() {
34139
34140
  function getAutoMemBase() {
34140
34141
  return findCanonicalGitRoot(getProjectRoot()) ?? getProjectRoot();
34141
34142
  }
34143
+ function hashPath(path4) {
34144
+ return createHash2("sha256").update(path4).digest("hex").slice(0, 12);
34145
+ }
34146
+ function sanitizeDirectorySegment(segment) {
34147
+ const cleaned = segment.normalize("NFC").replace(/[^A-Za-z0-9._-]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 80);
34148
+ const value = cleaned || "dir";
34149
+ return /^(con|prn|aux|nul|com[1-9]|lpt[1-9])$/i.test(value) ? `${value}-dir` : value;
34150
+ }
34151
+ function directoryKeyParts(directory = getOriginalCwd()) {
34152
+ const normalizedDirectory = normalize3(directory).normalize("NFC");
34153
+ const base = getAutoMemBase();
34154
+ const relativeToBase = relative3(base, normalizedDirectory);
34155
+ if (!relativeToBase || relativeToBase === ".") {
34156
+ return ["root"];
34157
+ }
34158
+ const outsideBase = relativeToBase.startsWith("..") || isAbsolute4(relativeToBase);
34159
+ if (outsideBase) {
34160
+ const leaf = sanitizeDirectorySegment(basename4(normalizedDirectory) || "directory");
34161
+ return ["external", `${leaf}-${hashPath(normalizedDirectory)}`];
34162
+ }
34163
+ return relativeToBase.split(/[\\/]+/).filter(Boolean).map(sanitizeDirectorySegment);
34164
+ }
34165
+ function getDirectoryMemoryKey(directory = getOriginalCwd()) {
34166
+ return directoryKeyParts(directory).join("/");
34167
+ }
34142
34168
  function getAutoMemEntrypoint() {
34143
34169
  return join20(getAutoMemPath(), AUTO_MEM_ENTRYPOINT_NAME);
34144
34170
  }
34171
+ function getDirectoryMemoryPath(directory = getOriginalCwd()) {
34172
+ return (join20(getAutoMemPath(), DIRECTORY_MEM_DIRNAME, ...directoryKeyParts(directory)) + sep4).normalize("NFC");
34173
+ }
34145
34174
  function isAutoMemPath(absolutePath) {
34146
34175
  const normalizedPath = normalize3(absolutePath);
34147
34176
  if (process.platform === "win32") {
@@ -34149,7 +34178,7 @@ function isAutoMemPath(absolutePath) {
34149
34178
  }
34150
34179
  return normalizedPath.startsWith(getAutoMemPath());
34151
34180
  }
34152
- var AUTO_MEM_DIRNAME = "memory", AUTO_MEM_ENTRYPOINT_NAME = "MEMORY.md", getAutoMemPath;
34181
+ var AUTO_MEM_DIRNAME = "memory", AUTO_MEM_ENTRYPOINT_NAME = "MEMORY.md", DIRECTORY_MEM_DIRNAME = "directories", getAutoMemPath;
34153
34182
  var init_paths = __esm(() => {
34154
34183
  init_memoize();
34155
34184
  init_state();
@@ -35756,7 +35785,7 @@ __export(exports_config, {
35756
35785
  });
35757
35786
  import { randomBytes } from "crypto";
35758
35787
  import { unwatchFile as unwatchFile2, watchFile as watchFile2 } from "fs";
35759
- import { basename as basename4, dirname as dirname11, join as join21, resolve as resolve8 } from "path";
35788
+ import { basename as basename5, dirname as dirname11, join as join21, resolve as resolve8 } from "path";
35760
35789
  function createDefaultGlobalConfig() {
35761
35790
  return {
35762
35791
  numStartups: 0,
@@ -36104,7 +36133,7 @@ function saveConfigWithLock(file, createDefault, mergeFn) {
36104
36133
  }
36105
36134
  const filteredConfig = pickBy_default(mergedConfig, (value, key) => jsonStringify(value) !== jsonStringify(defaultConfig[key]));
36106
36135
  try {
36107
- const fileBase = basename4(file);
36136
+ const fileBase = basename5(file);
36108
36137
  const backupDir = getConfigBackupDir();
36109
36138
  try {
36110
36139
  fs2.mkdirSync(backupDir);
@@ -36169,7 +36198,7 @@ function getConfigBackupDir() {
36169
36198
  }
36170
36199
  function findMostRecentBackup(file) {
36171
36200
  const fs2 = getFsImplementation();
36172
- const fileBase = basename4(file);
36201
+ const fileBase = basename5(file);
36173
36202
  const backupDir = getConfigBackupDir();
36174
36203
  try {
36175
36204
  const backups = fs2.readdirStringSync(backupDir).filter((f) => f.startsWith(`${fileBase}.backup.`)).sort();
@@ -36250,7 +36279,7 @@ Claude configuration file not found at: ${file}
36250
36279
  process.stderr.write(`
36251
36280
  Claude configuration file at ${file} is corrupted: ${error2.message}
36252
36281
  `);
36253
- const fileBase = basename4(file);
36282
+ const fileBase = basename5(file);
36254
36283
  const corruptedBackupDir = getConfigBackupDir();
36255
36284
  try {
36256
36285
  fs2.mkdirSync(corruptedBackupDir);
@@ -69244,12 +69273,12 @@ var require_fromHttp = __commonJS((exports) => {
69244
69273
  var fromHttp = (options = {}) => {
69245
69274
  options.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");
69246
69275
  let host;
69247
- const relative3 = options.awsContainerCredentialsRelativeUri ?? process.env[AWS_CONTAINER_CREDENTIALS_RELATIVE_URI];
69276
+ const relative4 = options.awsContainerCredentialsRelativeUri ?? process.env[AWS_CONTAINER_CREDENTIALS_RELATIVE_URI];
69248
69277
  const full = options.awsContainerCredentialsFullUri ?? process.env[AWS_CONTAINER_CREDENTIALS_FULL_URI];
69249
69278
  const token = options.awsContainerAuthorizationToken ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN];
69250
69279
  const tokenFile = options.awsContainerAuthorizationTokenFile ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE];
69251
69280
  const warn = options.logger?.constructor?.name === "NoOpLogger" || !options.logger?.warn ? console.warn : options.logger.warn.bind(options.logger);
69252
- if (relative3 && full) {
69281
+ if (relative4 && full) {
69253
69282
  warn("@aws-sdk/credential-provider-http: " + "you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri.");
69254
69283
  warn("awsContainerCredentialsFullUri will take precedence.");
69255
69284
  }
@@ -69259,8 +69288,8 @@ var require_fromHttp = __commonJS((exports) => {
69259
69288
  }
69260
69289
  if (full) {
69261
69290
  host = full;
69262
- } else if (relative3) {
69263
- host = `${DEFAULT_LINK_LOCAL_HOST}${relative3}`;
69291
+ } else if (relative4) {
69292
+ host = `${DEFAULT_LINK_LOCAL_HOST}${relative4}`;
69264
69293
  } else {
69265
69294
  throw new property_provider_1.CredentialsProviderError(`No HTTP credential provider host provided.
69266
69295
  Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`, { logger: options.logger });
@@ -88055,12 +88084,12 @@ var init_authFileDescriptor = __esm(() => {
88055
88084
  });
88056
88085
 
88057
88086
  // src/utils/secureStorage/macOsKeychainHelpers.ts
88058
- import { createHash as createHash2 } from "crypto";
88087
+ import { createHash as createHash3 } from "crypto";
88059
88088
  import { userInfo as userInfo2 } from "os";
88060
88089
  function getMacOsKeychainStorageServiceName(serviceSuffix = "") {
88061
88090
  const configDir = getClaudeConfigHomeDir();
88062
88091
  const isDefaultDir = !process.env.CLAUDE_CONFIG_DIR;
88063
- const dirHash = isDefaultDir ? "" : `-${createHash2("sha256").update(configDir).digest("hex").substring(0, 8)}`;
88092
+ const dirHash = isDefaultDir ? "" : `-${createHash3("sha256").update(configDir).digest("hex").substring(0, 8)}`;
88064
88093
  return `localclawd${getOauthConfig().OAUTH_FILE_SUFFIX}${serviceSuffix}${dirHash}`;
88065
88094
  }
88066
88095
  function getUsername() {
@@ -88260,7 +88289,7 @@ var init_isEqual = __esm(() => {
88260
88289
 
88261
88290
  // src/utils/userAgent.ts
88262
88291
  function getClaudeCodeUserAgent() {
88263
- return `claude-code/${"2.3.4"}`;
88292
+ return `claude-code/${"2.3.5"}`;
88264
88293
  }
88265
88294
 
88266
88295
  // src/utils/workloadContext.ts
@@ -88282,7 +88311,7 @@ function getUserAgent() {
88282
88311
  const clientApp = process.env.CLAUDE_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}` : "";
88283
88312
  const workload = getWorkload();
88284
88313
  const workloadSuffix = workload ? `, workload/${workload}` : "";
88285
- return `claude-cli/${"2.3.4"} (${process.env.USER_TYPE}, ${process.env.CLAUDE_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
88314
+ return `claude-cli/${"2.3.5"} (${process.env.USER_TYPE}, ${process.env.CLAUDE_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
88286
88315
  }
88287
88316
  function getMCPUserAgent() {
88288
88317
  const parts = [];
@@ -88296,7 +88325,7 @@ function getMCPUserAgent() {
88296
88325
  parts.push(`client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}`);
88297
88326
  }
88298
88327
  const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
88299
- return `claude-code/${"2.3.4"}${suffix}`;
88328
+ return `claude-code/${"2.3.5"}${suffix}`;
88300
88329
  }
88301
88330
  function getWebFetchUserAgent() {
88302
88331
  return `Claude-User (${getClaudeCodeUserAgent()}; +https://support.anthropic.com/)`;
@@ -115978,7 +116007,7 @@ var init_node_domexception = __esm(() => {
115978
116007
 
115979
116008
  // node_modules/fetch-blob/from.js
115980
116009
  import { statSync as statSync3, createReadStream, promises as fs2 } from "node:fs";
115981
- import { basename as basename5 } from "node:path";
116010
+ import { basename as basename6 } from "node:path";
115982
116011
  var stat6, blobFromSync = (path5, type) => fromBlob(statSync3(path5), path5, type), blobFrom = (path5, type) => stat6(path5).then((stat7) => fromBlob(stat7, path5, type)), fileFrom = (path5, type) => stat6(path5).then((stat7) => fromFile(stat7, path5, type)), fileFromSync = (path5, type) => fromFile(statSync3(path5), path5, type), fromBlob = (stat7, path5, type = "") => new fetch_blob_default([new BlobDataItem({
115983
116012
  path: path5,
115984
116013
  size: stat7.size,
@@ -115989,7 +116018,7 @@ var stat6, blobFromSync = (path5, type) => fromBlob(statSync3(path5), path5, typ
115989
116018
  size: stat7.size,
115990
116019
  lastModified: stat7.mtimeMs,
115991
116020
  start: 0
115992
- })], basename5(path5), { type, lastModified: stat7.mtimeMs }), BlobDataItem;
116021
+ })], basename6(path5), { type, lastModified: stat7.mtimeMs }), BlobDataItem;
115993
116022
  var init_from = __esm(() => {
115994
116023
  init_node_domexception();
115995
116024
  init_file2();
@@ -123675,7 +123704,7 @@ function getModelMaxOutputTokens(model) {
123675
123704
  function getMaxThinkingTokensForModel(model) {
123676
123705
  return getModelMaxOutputTokens(model).upperLimit - 1;
123677
123706
  }
123678
- var MODEL_CONTEXT_WINDOW_DEFAULT = 131072, COMPACT_CONTEXT_WINDOW_CHOICES, COMPACT_MAX_OUTPUT_TOKENS = 20000, MAX_OUTPUT_TOKENS_DEFAULT = 32000, MAX_OUTPUT_TOKENS_UPPER_LIMIT = 64000, CAPPED_DEFAULT_MAX_TOKENS = 8000, ESCALATED_MAX_TOKENS = 64000, _localProviderContextWindow = null;
123707
+ var MODEL_CONTEXT_WINDOW_DEFAULT = 131072, COMPACT_CONTEXT_WINDOW_CHOICES, COMPACT_MAX_OUTPUT_TOKENS = 8000, MAX_OUTPUT_TOKENS_DEFAULT = 32000, MAX_OUTPUT_TOKENS_UPPER_LIMIT = 64000, CAPPED_DEFAULT_MAX_TOKENS = 8000, ESCALATED_MAX_TOKENS = 64000, _localProviderContextWindow = null;
123679
123708
  var init_context = __esm(() => {
123680
123709
  init_config();
123681
123710
  init_model();
@@ -142581,14 +142610,14 @@ var init_measure_text = __esm(() => {
142581
142610
  });
142582
142611
 
142583
142612
  // src/ink/node-cache.ts
142584
- function addPendingClear(parent, rect, isAbsolute4) {
142613
+ function addPendingClear(parent, rect, isAbsolute5) {
142585
142614
  const existing = pendingClears.get(parent);
142586
142615
  if (existing) {
142587
142616
  existing.push(rect);
142588
142617
  } else {
142589
142618
  pendingClears.set(parent, [rect]);
142590
142619
  }
142591
- if (isAbsolute4) {
142620
+ if (isAbsolute5) {
142592
142621
  absoluteNodeRemoved = true;
142593
142622
  }
142594
142623
  }
@@ -143696,14 +143725,14 @@ function collectRemovedRects(parent, removed, underAbsolute = false) {
143696
143725
  if (removed.nodeName === "#text")
143697
143726
  return;
143698
143727
  const elem = removed;
143699
- const isAbsolute4 = underAbsolute || elem.style.position === "absolute";
143728
+ const isAbsolute5 = underAbsolute || elem.style.position === "absolute";
143700
143729
  const cached = nodeCache.get(elem);
143701
143730
  if (cached) {
143702
- addPendingClear(parent, cached, isAbsolute4);
143731
+ addPendingClear(parent, cached, isAbsolute5);
143703
143732
  nodeCache.delete(elem);
143704
143733
  }
143705
143734
  for (const child of elem.childNodes) {
143706
- collectRemovedRects(parent, child, isAbsolute4);
143735
+ collectRemovedRects(parent, child, isAbsolute5);
143707
143736
  }
143708
143737
  }
143709
143738
  function stylesEqual(a, b) {
@@ -152357,16 +152386,16 @@ function renderChildren(node, output, offsetX, offsetY, hasRemovedChild, prevScr
152357
152386
  for (const childNode of node.childNodes) {
152358
152387
  const childElem = childNode;
152359
152388
  const wasDirty = childElem.dirty;
152360
- const isAbsolute4 = childElem.style.position === "absolute";
152389
+ const isAbsolute5 = childElem.style.position === "absolute";
152361
152390
  renderNodeToOutput(childElem, output, {
152362
152391
  offsetX,
152363
152392
  offsetY,
152364
152393
  prevScreen: hasRemovedChild || seenDirtyChild ? undefined : prevScreen,
152365
- skipSelfBlit: seenDirtyClipped && isAbsolute4 && !childElem.style.opaque && childElem.style.backgroundColor === undefined,
152394
+ skipSelfBlit: seenDirtyClipped && isAbsolute5 && !childElem.style.opaque && childElem.style.backgroundColor === undefined,
152366
152395
  inheritedBackgroundColor
152367
152396
  });
152368
152397
  if (wasDirty && !seenDirtyChild) {
152369
- if (!clipsBothAxes(childElem) || isAbsolute4) {
152398
+ if (!clipsBothAxes(childElem) || isAbsolute5) {
152370
152399
  seenDirtyChild = true;
152371
152400
  } else {
152372
152401
  seenDirtyClipped = true;
@@ -157079,10 +157108,10 @@ var init_readdirp = __esm(() => {
157079
157108
  }
157080
157109
  async _formatEntry(dirent, path5) {
157081
157110
  let entry;
157082
- const basename6 = this._isDirent ? dirent.name : dirent;
157111
+ const basename7 = this._isDirent ? dirent.name : dirent;
157083
157112
  try {
157084
- const fullPath = presolve(pjoin(path5, basename6));
157085
- entry = { path: prelative(this._root, fullPath), fullPath, basename: basename6 };
157113
+ const fullPath = presolve(pjoin(path5, basename7));
157114
+ entry = { path: prelative(this._root, fullPath), fullPath, basename: basename7 };
157086
157115
  entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
157087
157116
  } catch (err) {
157088
157117
  this._onError(err);
@@ -157169,9 +157198,9 @@ class NodeFsHandler {
157169
157198
  _watchWithNodeFs(path5, listener) {
157170
157199
  const opts = this.fsw.options;
157171
157200
  const directory = sp.dirname(path5);
157172
- const basename7 = sp.basename(path5);
157201
+ const basename8 = sp.basename(path5);
157173
157202
  const parent = this.fsw._getWatchedDir(directory);
157174
- parent.add(basename7);
157203
+ parent.add(basename8);
157175
157204
  const absolutePath = sp.resolve(path5);
157176
157205
  const options = {
157177
157206
  persistent: opts.persistent
@@ -157181,7 +157210,7 @@ class NodeFsHandler {
157181
157210
  let closer;
157182
157211
  if (opts.usePolling) {
157183
157212
  const enableBin = opts.interval !== opts.binaryInterval;
157184
- options.interval = enableBin && isBinaryPath(basename7) ? opts.binaryInterval : opts.interval;
157213
+ options.interval = enableBin && isBinaryPath(basename8) ? opts.binaryInterval : opts.interval;
157185
157214
  closer = setFsWatchFileListener(path5, absolutePath, options, {
157186
157215
  listener,
157187
157216
  rawEmitter: this.fsw._emitRaw
@@ -157200,10 +157229,10 @@ class NodeFsHandler {
157200
157229
  return;
157201
157230
  }
157202
157231
  const dirname14 = sp.dirname(file);
157203
- const basename7 = sp.basename(file);
157232
+ const basename8 = sp.basename(file);
157204
157233
  const parent = this.fsw._getWatchedDir(dirname14);
157205
157234
  let prevStats = stats;
157206
- if (parent.has(basename7))
157235
+ if (parent.has(basename8))
157207
157236
  return;
157208
157237
  const listener = async (path5, newStats) => {
157209
157238
  if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5))
@@ -157228,9 +157257,9 @@ class NodeFsHandler {
157228
157257
  prevStats = newStats2;
157229
157258
  }
157230
157259
  } catch (error5) {
157231
- this.fsw._remove(dirname14, basename7);
157260
+ this.fsw._remove(dirname14, basename8);
157232
157261
  }
157233
- } else if (parent.has(basename7)) {
157262
+ } else if (parent.has(basename8)) {
157234
157263
  const at = newStats.atimeMs;
157235
157264
  const mt = newStats.mtimeMs;
157236
157265
  if (!at || at <= mt || mt !== prevStats.mtimeMs) {
@@ -157855,11 +157884,11 @@ function createPattern(matcher) {
157855
157884
  if (matcher.path === string)
157856
157885
  return true;
157857
157886
  if (matcher.recursive) {
157858
- const relative5 = sp2.relative(matcher.path, string);
157859
- if (!relative5) {
157887
+ const relative6 = sp2.relative(matcher.path, string);
157888
+ if (!relative6) {
157860
157889
  return false;
157861
157890
  }
157862
- return !relative5.startsWith("..") && !sp2.isAbsolute(relative5);
157891
+ return !relative6.startsWith("..") && !sp2.isAbsolute(relative6);
157863
157892
  }
157864
157893
  return false;
157865
157894
  };
@@ -158794,7 +158823,7 @@ function getAttributionHeader(fingerprint) {
158794
158823
  if (!isAttributionHeaderEnabled()) {
158795
158824
  return "";
158796
158825
  }
158797
- const version = `${"2.3.4"}.${fingerprint}`;
158826
+ const version = `${"2.3.5"}.${fingerprint}`;
158798
158827
  const entrypoint = process.env.CLAUDE_CODE_ENTRYPOINT ?? "unknown";
158799
158828
  const cch = "";
158800
158829
  const workload = getWorkload();
@@ -169045,7 +169074,7 @@ var init_readOnlyCommandValidation = __esm(() => {
169045
169074
 
169046
169075
  // src/utils/permissions/pathValidation.ts
169047
169076
  import { homedir as homedir11 } from "os";
169048
- import { dirname as dirname17, isAbsolute as isAbsolute5, resolve as resolve15 } from "path";
169077
+ import { dirname as dirname17, isAbsolute as isAbsolute6, resolve as resolve15 } from "path";
169049
169078
  function formatDirectoryList(directories) {
169050
169079
  const dirCount = directories.length;
169051
169080
  if (dirCount <= MAX_DIRS_TO_LIST) {
@@ -169153,7 +169182,7 @@ function isPathAllowed(resolvedPath, context, operationType, precomputedPathsToC
169153
169182
  }
169154
169183
  function validateGlobPattern(cleanPath, cwd2, toolPermissionContext, operationType) {
169155
169184
  if (containsPathTraversal(cleanPath)) {
169156
- const absolutePath = isAbsolute5(cleanPath) ? cleanPath : resolve15(cwd2, cleanPath);
169185
+ const absolutePath = isAbsolute6(cleanPath) ? cleanPath : resolve15(cwd2, cleanPath);
169157
169186
  const { resolvedPath: resolvedPath2, isCanonical: isCanonical2 } = safeResolvePath(getFsImplementation(), absolutePath);
169158
169187
  const result2 = isPathAllowed(resolvedPath2, toolPermissionContext, operationType, isCanonical2 ? [resolvedPath2] : undefined);
169159
169188
  return {
@@ -169163,7 +169192,7 @@ function validateGlobPattern(cleanPath, cwd2, toolPermissionContext, operationTy
169163
169192
  };
169164
169193
  }
169165
169194
  const basePath = getGlobBaseDirectory(cleanPath);
169166
- const absoluteBasePath = isAbsolute5(basePath) ? basePath : resolve15(cwd2, basePath);
169195
+ const absoluteBasePath = isAbsolute6(basePath) ? basePath : resolve15(cwd2, basePath);
169167
169196
  const { resolvedPath, isCanonical } = safeResolvePath(getFsImplementation(), absoluteBasePath);
169168
169197
  const result = isPathAllowed(resolvedPath, toolPermissionContext, operationType, isCanonical ? [resolvedPath] : undefined);
169169
169198
  return {
@@ -169242,7 +169271,7 @@ function validatePath(path6, cwd2, toolPermissionContext, operationType) {
169242
169271
  }
169243
169272
  return validateGlobPattern(cleanPath, cwd2, toolPermissionContext, operationType);
169244
169273
  }
169245
- const absolutePath = isAbsolute5(cleanPath) ? cleanPath : resolve15(cwd2, cleanPath);
169274
+ const absolutePath = isAbsolute6(cleanPath) ? cleanPath : resolve15(cwd2, cleanPath);
169246
169275
  const { resolvedPath, isCanonical } = safeResolvePath(getFsImplementation(), absolutePath);
169247
169276
  const result = isPathAllowed(resolvedPath, toolPermissionContext, operationType, isCanonical ? [resolvedPath] : undefined);
169248
169277
  return {
@@ -171971,13 +172000,13 @@ var init_esm = __esm(() => {
171971
172000
  });
171972
172001
 
171973
172002
  // src/utils/dxt/zip.ts
171974
- import { isAbsolute as isAbsolute6, normalize as normalize6 } from "path";
172003
+ import { isAbsolute as isAbsolute7, normalize as normalize6 } from "path";
171975
172004
  function isPathSafe(filePath) {
171976
172005
  if (containsPathTraversal(filePath)) {
171977
172006
  return false;
171978
172007
  }
171979
172008
  const normalized = normalize6(filePath);
171980
- if (isAbsolute6(normalized)) {
172009
+ if (isAbsolute7(normalized)) {
171981
172010
  return false;
171982
172011
  }
171983
172012
  return true;
@@ -172121,7 +172150,7 @@ var init_systemDirectories = __esm(() => {
172121
172150
  });
172122
172151
 
172123
172152
  // src/utils/plugins/mcpbHandler.ts
172124
- import { createHash as createHash3 } from "crypto";
172153
+ import { createHash as createHash4 } from "crypto";
172125
172154
  import { chmod, writeFile as writeFile3 } from "fs/promises";
172126
172155
  import { dirname as dirname18, join as join33 } from "path";
172127
172156
  function isMcpbSource(source) {
@@ -172131,13 +172160,13 @@ function isUrl(source) {
172131
172160
  return source.startsWith("http://") || source.startsWith("https://");
172132
172161
  }
172133
172162
  function generateContentHash(data) {
172134
- return createHash3("sha256").update(data).digest("hex").substring(0, 16);
172163
+ return createHash4("sha256").update(data).digest("hex").substring(0, 16);
172135
172164
  }
172136
172165
  function getMcpbCacheDir(pluginPath) {
172137
172166
  return join33(pluginPath, ".mcpb-cache");
172138
172167
  }
172139
172168
  function getMetadataPath(cacheDir, source) {
172140
- const sourceHash = createHash3("md5").update(source).digest("hex").substring(0, 8);
172169
+ const sourceHash = createHash4("md5").update(source).digest("hex").substring(0, 8);
172141
172170
  return join33(cacheDir, `${sourceHash}.metadata.json`);
172142
172171
  }
172143
172172
  function serverSecretsKey(pluginId, serverName) {
@@ -172485,7 +172514,7 @@ async function loadMcpbFile(source, pluginPath, pluginId, onProgress, providedUs
172485
172514
  let mcpbData;
172486
172515
  let mcpbFilePath;
172487
172516
  if (isUrl(source)) {
172488
- const sourceHash = createHash3("md5").update(source).digest("hex").substring(0, 8);
172517
+ const sourceHash = createHash4("md5").update(source).digest("hex").substring(0, 8);
172489
172518
  mcpbFilePath = join33(cacheDir, `${sourceHash}.mcpb`);
172490
172519
  mcpbData = await downloadMcpb(source, mcpbFilePath, onProgress);
172491
172520
  } else {
@@ -172806,7 +172835,7 @@ var init_walkPluginMarkdown = __esm(() => {
172806
172835
  });
172807
172836
 
172808
172837
  // src/utils/plugins/loadPluginAgents.ts
172809
- import { basename as basename8 } from "path";
172838
+ import { basename as basename9 } from "path";
172810
172839
  async function loadAgentsFromDirectory(agentsPath, pluginName, sourceName, pluginPath, pluginManifest, loadedPaths) {
172811
172840
  const agents = [];
172812
172841
  await walkPluginMarkdown(agentsPath, async (fullPath, namespace) => {
@@ -172824,7 +172853,7 @@ async function loadAgentFromFile(filePath, pluginName, namespace, sourceName, pl
172824
172853
  try {
172825
172854
  const content = await fs3.readFile(filePath, { encoding: "utf-8" });
172826
172855
  const { frontmatter, content: markdownContent } = parseFrontmatter(content, filePath);
172827
- const baseAgentName = frontmatter.name || basename8(filePath).replace(/\.md$/, "");
172856
+ const baseAgentName = frontmatter.name || basename9(filePath).replace(/\.md$/, "");
172828
172857
  const nameParts = [pluginName, ...namespace, baseAgentName];
172829
172858
  const agentType = nameParts.join(":");
172830
172859
  const whenToUse = coerceDescriptionToString(frontmatter.description, agentType) ?? coerceDescriptionToString(frontmatter["when-to-use"], agentType) ?? `Agent from ${pluginName} plugin`;
@@ -173749,7 +173778,7 @@ __export(exports_loadAgentsDir, {
173749
173778
  filterAgentsByMcpRequirements: () => filterAgentsByMcpRequirements,
173750
173779
  clearAgentDefinitionsCache: () => clearAgentDefinitionsCache
173751
173780
  });
173752
- import { basename as basename9 } from "path";
173781
+ import { basename as basename10 } from "path";
173753
173782
  import { z as z12 } from "zod/v4";
173754
173783
  function isBuiltInAgent(agent) {
173755
173784
  return agent.source === "built-in";
@@ -173958,7 +173987,7 @@ function parseAgentFromMarkdown(filePath, baseDir, frontmatter, content, source)
173958
173987
  if (maxTurnsRaw !== undefined && maxTurns === undefined) {
173959
173988
  logForDebugging(`Agent file ${filePath} has invalid maxTurns '${maxTurnsRaw}'. Must be a positive integer.`);
173960
173989
  }
173961
- const filename = basename9(filePath, ".md");
173990
+ const filename = basename10(filePath, ".md");
173962
173991
  let tools = parseAgentToolsFromFrontmatter(frontmatter["tools"]);
173963
173992
  if (isAutoMemoryEnabled() && memory && tools !== undefined) {
173964
173993
  const toolSet = new Set(tools);
@@ -174981,7 +175010,7 @@ var init_metadata = __esm(() => {
174981
175010
  COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
174982
175011
  WHITESPACE_REGEX = /\s+/;
174983
175012
  getVersionBase = memoize_default(() => {
174984
- const match = "2.3.4".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
175013
+ const match = "2.3.5".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
174985
175014
  return match ? match[0] : undefined;
174986
175015
  });
174987
175016
  buildEnvContext = memoize_default(async () => {
@@ -175021,9 +175050,9 @@ var init_metadata = __esm(() => {
175021
175050
  isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
175022
175051
  isClaudeCodeAction: isEnvTruthy(process.env.CLAUDE_CODE_ACTION),
175023
175052
  isClaudeAiAuth: isClaudeAISubscriber(),
175024
- version: "2.3.4",
175053
+ version: "2.3.5",
175025
175054
  versionBase: getVersionBase(),
175026
- buildTime: "2026-05-10T21:07:59.152Z",
175055
+ buildTime: "2026-06-03T02:51:00.215Z",
175027
175056
  deploymentEnvironment: env3.detectDeploymentEnvironment(),
175028
175057
  ...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
175029
175058
  githubEventName: process.env.GITHUB_EVENT_NAME,
@@ -182671,13 +182700,13 @@ var init_fileStateCache = __esm(() => {
182671
182700
 
182672
182701
  // src/utils/instructionsmd.ts
182673
182702
  import {
182674
- basename as basename10,
182703
+ basename as basename11,
182675
182704
  dirname as dirname19,
182676
182705
  extname as extname4,
182677
- isAbsolute as isAbsolute7,
182706
+ isAbsolute as isAbsolute8,
182678
182707
  join as join35,
182679
182708
  parse as parse3,
182680
- relative as relative5,
182709
+ relative as relative6,
182681
182710
  sep as sep8
182682
182711
  } from "path";
182683
182712
  function pathInOriginalCwd(path6) {
@@ -183025,8 +183054,8 @@ async function processConditionedMdRules(targetPath, rulesDir, type, processedPa
183025
183054
  return false;
183026
183055
  }
183027
183056
  const baseDir = type === "Project" ? dirname19(dirname19(rulesDir)) : getOriginalCwd();
183028
- const relativePath = isAbsolute7(targetPath) ? relative5(baseDir, targetPath) : targetPath;
183029
- if (!relativePath || relativePath.startsWith("..") || isAbsolute7(relativePath)) {
183057
+ const relativePath = isAbsolute8(targetPath) ? relative6(baseDir, targetPath) : targetPath;
183058
+ if (!relativePath || relativePath.startsWith("..") || isAbsolute8(relativePath)) {
183030
183059
  return false;
183031
183060
  }
183032
183061
  return import_ignore.default().add(file.globs).ignores(relativePath);
@@ -184620,7 +184649,7 @@ var init_hooksConfigSnapshot = __esm(() => {
184620
184649
  });
184621
184650
 
184622
184651
  // src/utils/hooks/fileChangedWatcher.ts
184623
- import { isAbsolute as isAbsolute8, join as join38 } from "path";
184652
+ import { isAbsolute as isAbsolute9, join as join38 } from "path";
184624
184653
  function setEnvHookNotifier(cb) {
184625
184654
  notifyCallback = cb;
184626
184655
  }
@@ -184648,7 +184677,7 @@ function resolveWatchPaths(config) {
184648
184677
  for (const name of m3.matcher.split("|").map((s2) => s2.trim())) {
184649
184678
  if (!name)
184650
184679
  continue;
184651
- staticPaths.push(isAbsolute8(name) ? name : join38(currentCwd, name));
184680
+ staticPaths.push(isAbsolute9(name) ? name : join38(currentCwd, name));
184652
184681
  }
184653
184682
  }
184654
184683
  return [...new Set([...staticPaths, ...dynamicWatchPaths])];
@@ -185781,7 +185810,7 @@ var init_powershellProvider = __esm(() => {
185781
185810
  import { execFileSync, spawn as spawn2 } from "child_process";
185782
185811
  import { constants as fsConstants2, readFileSync as readFileSync7, unlinkSync as unlinkSync2 } from "fs";
185783
185812
  import { mkdir as mkdir8, open as open5, realpath as realpath7 } from "fs/promises";
185784
- import { isAbsolute as isAbsolute9, resolve as resolve16 } from "path";
185813
+ import { isAbsolute as isAbsolute10, resolve as resolve16 } from "path";
185785
185814
  import { join as posixJoin3 } from "path/posix";
185786
185815
  import { accessSync } from "fs";
185787
185816
  function isExecutable(shellPath) {
@@ -185975,7 +186004,7 @@ async function exec3(command, abortSignal, shellType, options) {
185975
186004
  }
185976
186005
  }
185977
186006
  function setCwd(path6, relativeTo) {
185978
- const resolved = isAbsolute9(path6) ? path6 : resolve16(relativeTo || getFsImplementation().cwd(), path6);
186007
+ const resolved = isAbsolute10(path6) ? path6 : resolve16(relativeTo || getFsImplementation().cwd(), path6);
185979
186008
  let physicalPath;
185980
186009
  try {
185981
186010
  physicalPath = getFsImplementation().realpathSync(resolved);
@@ -189652,8 +189681,8 @@ function extractBaseCommand(segment2) {
189652
189681
  const stripped = segment2.trim().replace(/^[&.]\s+/, "");
189653
189682
  const firstToken = stripped.split(/\s+/)[0] || "";
189654
189683
  const unquoted = firstToken.replace(/^["']|["']$/g, "");
189655
- const basename11 = unquoted.split(/[\\/]/).pop() || unquoted;
189656
- return basename11.toLowerCase().replace(/\.exe$/, "");
189684
+ const basename12 = unquoted.split(/[\\/]/).pop() || unquoted;
189685
+ return basename12.toLowerCase().replace(/\.exe$/, "");
189657
189686
  }
189658
189687
  function heuristicallyExtractBaseCommand(command) {
189659
189688
  const segments = command.split(/[;|]/).filter((s2) => s2.trim());
@@ -190709,11 +190738,11 @@ var init_parser5 = __esm(() => {
190709
190738
  });
190710
190739
 
190711
190740
  // src/tools/PowerShellTool/gitSafety.ts
190712
- import { basename as basename11, posix as posix2, resolve as resolve17, sep as sep9 } from "path";
190741
+ import { basename as basename12, posix as posix2, resolve as resolve17, sep as sep9 } from "path";
190713
190742
  function resolveCwdReentry(normalized) {
190714
190743
  if (!normalized.startsWith("../"))
190715
190744
  return normalized;
190716
- const cwdBase = basename11(getCwd()).toLowerCase();
190745
+ const cwdBase = basename12(getCwd()).toLowerCase();
190717
190746
  if (!cwdBase)
190718
190747
  return normalized;
190719
190748
  const prefix = "../" + cwdBase + "/";
@@ -192403,7 +192432,7 @@ var init_PermissionUpdate = __esm(() => {
192403
192432
 
192404
192433
  // src/tools/PowerShellTool/pathValidation.ts
192405
192434
  import { homedir as homedir14 } from "os";
192406
- import { isAbsolute as isAbsolute10, resolve as resolve18 } from "path";
192435
+ import { isAbsolute as isAbsolute11, resolve as resolve18 } from "path";
192407
192436
  function matchesParam(paramLower, paramList) {
192408
192437
  for (const p of paramList) {
192409
192438
  if (p === paramLower || paramLower.length > 1 && p.startsWith(paramLower)) {
@@ -192511,7 +192540,7 @@ function checkDenyRuleForGuessedPath(strippedPath, cwd2, toolPermissionContext,
192511
192540
  if (!strippedPath || strippedPath.includes("\x00"))
192512
192541
  return null;
192513
192542
  const tildeExpanded = expandTilde2(strippedPath);
192514
- const abs = isAbsolute10(tildeExpanded) ? tildeExpanded : resolve18(cwd2, tildeExpanded);
192543
+ const abs = isAbsolute11(tildeExpanded) ? tildeExpanded : resolve18(cwd2, tildeExpanded);
192515
192544
  const { resolvedPath } = safeResolvePath(getFsImplementation(), abs);
192516
192545
  const permissionType = operationType === "read" ? "read" : "edit";
192517
192546
  const denyRule = matchingRuleForInput(resolvedPath, toolPermissionContext, permissionType, "deny");
@@ -192601,7 +192630,7 @@ function validatePath2(filePath, cwd2, toolPermissionContext, operationType) {
192601
192630
  };
192602
192631
  }
192603
192632
  if (containsPathTraversal(normalizedPath)) {
192604
- const absolutePath2 = isAbsolute10(normalizedPath) ? normalizedPath : resolve18(cwd2, normalizedPath);
192633
+ const absolutePath2 = isAbsolute11(normalizedPath) ? normalizedPath : resolve18(cwd2, normalizedPath);
192605
192634
  const { resolvedPath: resolvedPath3, isCanonical: isCanonical2 } = safeResolvePath(getFsImplementation(), absolutePath2);
192606
192635
  const result2 = isPathAllowed2(resolvedPath3, toolPermissionContext, operationType, isCanonical2 ? [resolvedPath3] : undefined);
192607
192636
  return {
@@ -192611,7 +192640,7 @@ function validatePath2(filePath, cwd2, toolPermissionContext, operationType) {
192611
192640
  };
192612
192641
  }
192613
192642
  const basePath = getGlobBaseDirectory2(normalizedPath);
192614
- const absoluteBasePath = isAbsolute10(basePath) ? basePath : resolve18(cwd2, basePath);
192643
+ const absoluteBasePath = isAbsolute11(basePath) ? basePath : resolve18(cwd2, basePath);
192615
192644
  const { resolvedPath: resolvedPath2 } = safeResolvePath(getFsImplementation(), absoluteBasePath);
192616
192645
  const permissionType = operationType === "read" ? "read" : "edit";
192617
192646
  const denyRule = matchingRuleForInput(resolvedPath2, toolPermissionContext, permissionType, "deny");
@@ -192631,7 +192660,7 @@ function validatePath2(filePath, cwd2, toolPermissionContext, operationType) {
192631
192660
  }
192632
192661
  };
192633
192662
  }
192634
- const absolutePath = isAbsolute10(normalizedPath) ? normalizedPath : resolve18(cwd2, normalizedPath);
192663
+ const absolutePath = isAbsolute11(normalizedPath) ? normalizedPath : resolve18(cwd2, normalizedPath);
192635
192664
  const { resolvedPath, isCanonical } = safeResolvePath(getFsImplementation(), absolutePath);
192636
192665
  const result = isPathAllowed2(resolvedPath, toolPermissionContext, operationType, isCanonical ? [resolvedPath] : undefined);
192637
192666
  return {
@@ -196420,12 +196449,12 @@ var builders = null;
196420
196449
  // src/skills/loadSkillsDir.ts
196421
196450
  import { realpath as realpath8 } from "fs/promises";
196422
196451
  import {
196423
- basename as basename12,
196452
+ basename as basename13,
196424
196453
  dirname as dirname21,
196425
- isAbsolute as isAbsolute11,
196454
+ isAbsolute as isAbsolute12,
196426
196455
  join as join42,
196427
196456
  sep as pathSep,
196428
- relative as relative6
196457
+ relative as relative7
196429
196458
  } from "path";
196430
196459
  function getSkillsPath(source, dir) {
196431
196460
  switch (source) {
@@ -196639,7 +196668,7 @@ async function loadSkillsFromSkillsDir(basePath, source) {
196639
196668
  return results.filter((r2) => r2 !== null);
196640
196669
  }
196641
196670
  function isSkillFile(filePath) {
196642
- return /^skill\.md$/i.test(basename12(filePath));
196671
+ return /^skill\.md$/i.test(basename13(filePath));
196643
196672
  }
196644
196673
  function transformSkillFiles(files) {
196645
196674
  const filesByDir = new Map;
@@ -196655,7 +196684,7 @@ function transformSkillFiles(files) {
196655
196684
  if (skillFiles.length > 0) {
196656
196685
  const skillFile = skillFiles[0];
196657
196686
  if (skillFiles.length > 1) {
196658
- logForDebugging(`Multiple skill files found in ${dir}, using ${basename12(skillFile.filePath)}`);
196687
+ logForDebugging(`Multiple skill files found in ${dir}, using ${basename13(skillFile.filePath)}`);
196659
196688
  }
196660
196689
  result.push(skillFile);
196661
196690
  } else {
@@ -196675,12 +196704,12 @@ function buildNamespace(targetDir, baseDir) {
196675
196704
  function getSkillCommandName(filePath, baseDir) {
196676
196705
  const skillDirectory = dirname21(filePath);
196677
196706
  const parentOfSkillDir = dirname21(skillDirectory);
196678
- const commandBaseName = basename12(skillDirectory);
196707
+ const commandBaseName = basename13(skillDirectory);
196679
196708
  const namespace = buildNamespace(parentOfSkillDir, baseDir);
196680
196709
  return namespace ? `${namespace}:${commandBaseName}` : commandBaseName;
196681
196710
  }
196682
196711
  function getRegularCommandName(filePath, baseDir) {
196683
- const fileName = basename12(filePath);
196712
+ const fileName = basename13(filePath);
196684
196713
  const fileDirectory = dirname21(filePath);
196685
196714
  const commandBaseName = fileName.replace(/\.md$/, "");
196686
196715
  const namespace = buildNamespace(fileDirectory, baseDir);
@@ -196825,8 +196854,8 @@ function activateConditionalSkillsForPaths(filePaths, cwd2) {
196825
196854
  }
196826
196855
  const skillIgnore = import_ignore2.default().add(skill.paths);
196827
196856
  for (const filePath of filePaths) {
196828
- const relativePath = isAbsolute11(filePath) ? relative6(cwd2, filePath) : filePath;
196829
- if (!relativePath || relativePath.startsWith("..") || isAbsolute11(relativePath)) {
196857
+ const relativePath = isAbsolute12(filePath) ? relative7(cwd2, filePath) : filePath;
196858
+ if (!relativePath || relativePath.startsWith("..") || isAbsolute12(relativePath)) {
196830
196859
  continue;
196831
196860
  }
196832
196861
  if (skillIgnore.ignores(relativePath)) {
@@ -199946,46 +199975,49 @@ function getPartialCompactPrompt(customInstructions, direction = "from") {
199946
199975
  if (customInstructions && customInstructions.trim() !== "") {
199947
199976
  prompt += `
199948
199977
 
199949
- Additional Instructions:
199978
+ Additional instructions:
199950
199979
  ${customInstructions}`;
199951
199980
  }
199952
- prompt += NO_TOOLS_TRAILER;
199953
- return prompt;
199981
+ return prompt + NO_TOOLS_TRAILER;
199954
199982
  }
199955
199983
  function getCompactPrompt(customInstructions) {
199956
199984
  let prompt = NO_TOOLS_PREAMBLE + BASE_COMPACT_PROMPT;
199957
199985
  if (customInstructions && customInstructions.trim() !== "") {
199958
199986
  prompt += `
199959
199987
 
199960
- Additional Instructions:
199988
+ Additional instructions:
199961
199989
  ${customInstructions}`;
199962
199990
  }
199963
- prompt += NO_TOOLS_TRAILER;
199964
- return prompt;
199991
+ return prompt + NO_TOOLS_TRAILER;
199992
+ }
199993
+ function truncateFormattedSummary(summary) {
199994
+ if (summary.length <= MAX_FORMATTED_SUMMARY_CHARS) {
199995
+ return summary;
199996
+ }
199997
+ const sliceAt = Math.max(0, MAX_FORMATTED_SUMMARY_CHARS - SUMMARY_TRUNCATION_MARKER.length);
199998
+ return summary.slice(0, sliceAt).trimEnd() + SUMMARY_TRUNCATION_MARKER;
199965
199999
  }
199966
200000
  function formatCompactSummary(summary) {
199967
- let formattedSummary = summary;
199968
- formattedSummary = formattedSummary.replace(/<analysis>[\s\S]*?<\/analysis>/, "");
199969
- const summaryMatch = formattedSummary.match(/<summary>([\s\S]*?)<\/summary>/);
200001
+ let formattedSummary = summary.replace(/<analysis>[\s\S]*?<\/analysis>/gi, "").trim();
200002
+ const summaryMatch = formattedSummary.match(/<summary>([\s\S]*?)<\/summary>/i);
199970
200003
  if (summaryMatch) {
199971
- const content = summaryMatch[1] || "";
199972
- formattedSummary = formattedSummary.replace(/<summary>[\s\S]*?<\/summary>/, `Summary:
199973
- ${content.trim()}`);
200004
+ formattedSummary = `Summary:
200005
+ ${(summaryMatch[1] || "").trim()}`;
199974
200006
  }
199975
- formattedSummary = formattedSummary.replace(/\n\n+/g, `
200007
+ formattedSummary = formattedSummary.replace(/<\/?summary>/gi, "").replace(/\n\n+/g, `
199976
200008
 
199977
- `);
199978
- return formattedSummary.trim();
200009
+ `).trim();
200010
+ return truncateFormattedSummary(formattedSummary);
199979
200011
  }
199980
200012
  function getCompactUserSummaryMessage(summary, suppressFollowUpQuestions, transcriptPath, recentMessagesPreserved) {
199981
200013
  const formattedSummary = formatCompactSummary(summary);
199982
- let baseSummary = `This session is being continued from a previous conversation that ran out of context. The summary below covers the earlier portion of the conversation.
200014
+ let baseSummary = `This session is being continued after context compaction. The summary below is the working state needed to continue.
199983
200015
 
199984
200016
  ${formattedSummary}`;
199985
200017
  if (transcriptPath) {
199986
200018
  baseSummary += `
199987
200019
 
199988
- If you need specific details from before compaction (like exact code snippets, error messages, or content you generated), read the full transcript at: ${transcriptPath}`;
200020
+ For exact older details, read the full transcript at: ${transcriptPath}`;
199989
200021
  }
199990
200022
  if (recentMessagesPreserved) {
199991
200023
  baseSummary += `
@@ -199994,256 +200026,71 @@ Recent messages are preserved verbatim.`;
199994
200026
  }
199995
200027
  if (suppressFollowUpQuestions) {
199996
200028
  let continuation = `${baseSummary}
199997
- Continue the conversation from where it left off without asking the user any further questions. Resume directly — do not acknowledge the summary, do not recap what was happening, do not preface with "I'll continue" or similar. Pick up the last task as if the break never happened.`;
200029
+ Continue directly from the working state above. Do not acknowledge the summary or ask what to do next unless the summary says user input is required.`;
199998
200030
  if (false) {}
199999
200031
  return continuation;
200000
200032
  }
200001
200033
  return baseSummary;
200002
200034
  }
200003
- var NO_TOOLS_PREAMBLE = `CRITICAL: Respond with TEXT ONLY. Do NOT call any tools.
200004
-
200005
- - Do NOT use Read, Bash, Grep, Glob, Edit, Write, or ANY other tool.
200006
- - You already have all the context you need in the conversation above.
200007
- - Tool calls will be REJECTED and will waste your only turn — you will fail the task.
200008
- - Your entire response must be plain text: an <analysis> block followed by a <summary> block.
200009
-
200010
- `, DETAILED_ANALYSIS_INSTRUCTION_BASE = `Before providing your final summary, wrap your analysis in <analysis> tags to organize your thoughts and ensure you've covered all necessary points. In your analysis process:
200011
-
200012
- 1. Chronologically analyze each message and section of the conversation. For each section thoroughly identify:
200013
- - The user's explicit requests and intents
200014
- - Your approach to addressing the user's requests
200015
- - Key decisions, technical concepts and code patterns
200016
- - Specific details like:
200017
- - file names
200018
- - full code snippets
200019
- - function signatures
200020
- - file edits
200021
- - Errors that you ran into and how you fixed them
200022
- - Pay special attention to specific user feedback that you received, especially if the user told you to do something differently.
200023
- 2. Double-check for technical accuracy and completeness, addressing each required element thoroughly.`, DETAILED_ANALYSIS_INSTRUCTION_PARTIAL = `Before providing your final summary, wrap your analysis in <analysis> tags to organize your thoughts and ensure you've covered all necessary points. In your analysis process:
200024
-
200025
- 1. Analyze the recent messages chronologically. For each section thoroughly identify:
200026
- - The user's explicit requests and intents
200027
- - Your approach to addressing the user's requests
200028
- - Key decisions, technical concepts and code patterns
200029
- - Specific details like:
200030
- - file names
200031
- - full code snippets
200032
- - function signatures
200033
- - file edits
200034
- - Errors that you ran into and how you fixed them
200035
- - Pay special attention to specific user feedback that you received, especially if the user told you to do something differently.
200036
- 2. Double-check for technical accuracy and completeness, addressing each required element thoroughly.`, BASE_COMPACT_PROMPT, PARTIAL_COMPACT_PROMPT, PARTIAL_COMPACT_UP_TO_PROMPT, NO_TOOLS_TRAILER;
200037
- var init_prompt10 = __esm(() => {
200038
- BASE_COMPACT_PROMPT = `Your task is to create a detailed summary of the conversation so far, paying close attention to the user's explicit requests and your previous actions.
200039
- This summary should be thorough in capturing technical details, code patterns, and architectural decisions that would be essential for continuing development work without losing context.
200040
-
200041
- ${DETAILED_ANALYSIS_INSTRUCTION_BASE}
200042
-
200043
- Your summary should include the following sections:
200044
-
200045
- 1. Primary Request and Intent: Capture all of the user's explicit requests and intents in detail
200046
- 2. Key Technical Concepts: List all important technical concepts, technologies, and frameworks discussed.
200047
- 3. Files and Code Sections: Enumerate specific files and code sections examined, modified, or created. Pay special attention to the most recent messages and include full code snippets where applicable and include a summary of why this file read or edit is important.
200048
- 4. Errors and fixes: List all errors that you ran into, and how you fixed them. Pay special attention to specific user feedback that you received, especially if the user told you to do something differently.
200049
- 5. Problem Solving: Document problems solved and any ongoing troubleshooting efforts.
200050
- 6. All user messages: List ALL user messages that are not tool results. These are critical for understanding the users' feedback and changing intent.
200051
- 7. Pending Tasks: Outline any pending tasks that you have explicitly been asked to work on.
200052
- 8. Current Work: Describe in detail precisely what was being worked on immediately before this summary request, paying special attention to the most recent messages from both user and assistant. Include file names and code snippets where applicable.
200053
- 9. Optional Next Step: List the next step that you will take that is related to the most recent work you were doing. IMPORTANT: ensure that this step is DIRECTLY in line with the user's most recent explicit requests, and the task you were working on immediately before this summary request. If your last task was concluded, then only list next steps if they are explicitly in line with the users request. Do not start on tangential requests or really old requests that were already completed without confirming with the user first.
200054
- If there is a next step, include direct quotes from the most recent conversation showing exactly what task you were working on and where you left off. This should be verbatim to ensure there's no drift in task interpretation.
200055
-
200056
- Here's an example of how your output should be structured:
200057
-
200058
- <example>
200059
- <analysis>
200060
- [Your thought process, ensuring all points are covered thoroughly and accurately]
200061
- </analysis>
200062
-
200063
- <summary>
200064
- 1. Primary Request and Intent:
200065
- [Detailed description]
200066
-
200067
- 2. Key Technical Concepts:
200068
- - [Concept 1]
200069
- - [Concept 2]
200070
- - [...]
200071
-
200072
- 3. Files and Code Sections:
200073
- - [File Name 1]
200074
- - [Summary of why this file is important]
200075
- - [Summary of the changes made to this file, if any]
200076
- - [Important Code Snippet]
200077
- - [File Name 2]
200078
- - [Important Code Snippet]
200079
- - [...]
200080
-
200081
- 4. Errors and fixes:
200082
- - [Detailed description of error 1]:
200083
- - [How you fixed the error]
200084
- - [User feedback on the error if any]
200085
- - [...]
200086
-
200087
- 5. Problem Solving:
200088
- [Description of solved problems and ongoing troubleshooting]
200089
-
200090
- 6. All user messages:
200091
- - [Detailed non tool use user message]
200092
- - [...]
200093
-
200094
- 7. Pending Tasks:
200095
- - [Task 1]
200096
- - [Task 2]
200097
- - [...]
200098
-
200099
- 8. Current Work:
200100
- [Precise description of current work]
200101
-
200102
- 9. Optional Next Step:
200103
- [Optional Next step to take]
200104
-
200105
- </summary>
200106
- </example>
200107
-
200108
- Please provide your summary based on the conversation so far, following this structure and ensuring precision and thoroughness in your response.
200109
-
200110
- There may be additional summarization instructions provided in the included context. If so, remember to follow these instructions when creating the above summary. Examples of instructions include:
200111
- <example>
200112
- ## Compact Instructions
200113
- When summarizing the conversation focus on typescript code changes and also remember the mistakes you made and how you fixed them.
200114
- </example>
200115
-
200116
- <example>
200117
- # Summary instructions
200118
- When you are using compact - please focus on test output and code changes. Include file reads verbatim.
200119
- </example>
200120
- `;
200121
- PARTIAL_COMPACT_PROMPT = `Your task is to create a detailed summary of the RECENT portion of the conversation — the messages that follow earlier retained context. The earlier messages are being kept intact and do NOT need to be summarized. Focus your summary on what was discussed, learned, and accomplished in the recent messages only.
200122
-
200123
- ${DETAILED_ANALYSIS_INSTRUCTION_PARTIAL}
200124
-
200125
- Your summary should include the following sections:
200126
-
200127
- 1. Primary Request and Intent: Capture the user's explicit requests and intents from the recent messages
200128
- 2. Key Technical Concepts: List important technical concepts, technologies, and frameworks discussed recently.
200129
- 3. Files and Code Sections: Enumerate specific files and code sections examined, modified, or created. Include full code snippets where applicable and include a summary of why this file read or edit is important.
200130
- 4. Errors and fixes: List errors encountered and how they were fixed.
200131
- 5. Problem Solving: Document problems solved and any ongoing troubleshooting efforts.
200132
- 6. All user messages: List ALL user messages from the recent portion that are not tool results.
200133
- 7. Pending Tasks: Outline any pending tasks from the recent messages.
200134
- 8. Current Work: Describe precisely what was being worked on immediately before this summary request.
200135
- 9. Optional Next Step: List the next step related to the most recent work. Include direct quotes from the most recent conversation.
200136
-
200137
- Here's an example of how your output should be structured:
200138
-
200139
- <example>
200140
- <analysis>
200141
- [Your thought process, ensuring all points are covered thoroughly and accurately]
200142
- </analysis>
200143
-
200144
- <summary>
200145
- 1. Primary Request and Intent:
200146
- [Detailed description]
200147
-
200148
- 2. Key Technical Concepts:
200149
- - [Concept 1]
200150
- - [Concept 2]
200151
-
200152
- 3. Files and Code Sections:
200153
- - [File Name 1]
200154
- - [Summary of why this file is important]
200155
- - [Important Code Snippet]
200156
-
200157
- 4. Errors and fixes:
200158
- - [Error description]:
200159
- - [How you fixed it]
200160
-
200161
- 5. Problem Solving:
200162
- [Description]
200163
-
200164
- 6. All user messages:
200165
- - [Detailed non tool use user message]
200166
-
200167
- 7. Pending Tasks:
200168
- - [Task 1]
200169
-
200170
- 8. Current Work:
200171
- [Precise description of current work]
200172
-
200173
- 9. Optional Next Step:
200174
- [Optional Next step to take]
200175
-
200176
- </summary>
200177
- </example>
200178
-
200179
- Please provide your summary based on the RECENT messages only (after the retained earlier context), following this structure and ensuring precision and thoroughness in your response.
200180
- `;
200181
- PARTIAL_COMPACT_UP_TO_PROMPT = `Your task is to create a detailed summary of this conversation. This summary will be placed at the start of a continuing session; newer messages that build on this context will follow after your summary (you do not see them here). Summarize thoroughly so that someone reading only your summary and then the newer messages can fully understand what happened and continue the work.
200182
-
200183
- ${DETAILED_ANALYSIS_INSTRUCTION_BASE}
200184
-
200185
- Your summary should include the following sections:
200186
-
200187
- 1. Primary Request and Intent: Capture the user's explicit requests and intents in detail
200188
- 2. Key Technical Concepts: List important technical concepts, technologies, and frameworks discussed.
200189
- 3. Files and Code Sections: Enumerate specific files and code sections examined, modified, or created. Include full code snippets where applicable and include a summary of why this file read or edit is important.
200190
- 4. Errors and fixes: List errors encountered and how they were fixed.
200191
- 5. Problem Solving: Document problems solved and any ongoing troubleshooting efforts.
200192
- 6. All user messages: List ALL user messages that are not tool results.
200193
- 7. Pending Tasks: Outline any pending tasks.
200194
- 8. Work Completed: Describe what was accomplished by the end of this portion.
200195
- 9. Context for Continuing Work: Summarize any context, decisions, or state that would be needed to understand and continue the work in subsequent messages.
200196
-
200197
- Here's an example of how your output should be structured:
200198
-
200199
- <example>
200200
- <analysis>
200201
- [Your thought process, ensuring all points are covered thoroughly and accurately]
200202
- </analysis>
200203
-
200204
- <summary>
200205
- 1. Primary Request and Intent:
200206
- [Detailed description]
200035
+ var MAX_FORMATTED_SUMMARY_CHARS = 12000, SUMMARY_TRUNCATION_MARKER = `
200207
200036
 
200208
- 2. Key Technical Concepts:
200209
- - [Concept 1]
200210
- - [Concept 2]
200037
+ [Summary truncated to keep the post-compact context small. Read the transcript path below if exact older details are needed.]`, NO_TOOLS_PREAMBLE = `Respond with text only. Do not call tools.
200211
200038
 
200212
- 3. Files and Code Sections:
200213
- - [File Name 1]
200214
- - [Summary of why this file is important]
200215
- - [Important Code Snippet]
200039
+ Write one compact continuation summary in a <summary> block. Do not include an <analysis> block.
200216
200040
 
200217
- 4. Errors and fixes:
200218
- - [Error description]:
200219
- - [How you fixed it]
200041
+ `, BASE_COMPACT_PROMPT = `Summarize the conversation so the next assistant turn can continue the work without re-reading the full transcript.
200220
200042
 
200221
- 5. Problem Solving:
200222
- [Description]
200043
+ Keep the summary concise and operational. Prefer facts that affect the next action over narrative detail.
200223
200044
 
200224
- 6. All user messages:
200225
- - [Detailed non tool use user message]
200045
+ Include these sections:
200046
+ 1. Current objective: the user's active request and any important constraints.
200047
+ 2. Work completed: key decisions, files changed/read, commands run, and relevant outcomes.
200048
+ 3. Current state: what is in progress, what is known, and what remains uncertain.
200049
+ 4. Important references: filenames, symbols, tests, commands, issue IDs, or config keys needed to continue.
200050
+ 5. Next action: the specific next step that follows from the latest work.
200226
200051
 
200227
- 7. Pending Tasks:
200228
- - [Task 1]
200229
-
200230
- 8. Work Completed:
200231
- [Description of what was accomplished]
200232
-
200233
- 9. Context for Continuing Work:
200234
- [Key context, decisions, or state needed to continue the work]
200052
+ Rules:
200053
+ - Preserve exact filenames, function names, command names, errors, and user requirements.
200054
+ - Do not copy long code snippets or long command output. Mention where they came from instead.
200055
+ - Do not list every user message unless each one changes the task.
200056
+ - If the task is complete, say that clearly and leave "Next action" empty or state that no action remains.
200057
+ - Target 600-1200 words; shorter is better when the state is simple.
200058
+ `, PARTIAL_COMPACT_PROMPT = `Summarize only the recent portion of the conversation. Older retained messages will remain available after your summary, so do not restate them unless the recent work depends on them.
200059
+
200060
+ Include these sections:
200061
+ 1. Recent objective: what the user asked for in the recent messages.
200062
+ 2. Recent work completed: key files, decisions, commands, and outcomes.
200063
+ 3. Current state: what changed, what is still pending, and any blockers.
200064
+ 4. Next action: the specific next step that follows from the latest work.
200235
200065
 
200236
- </summary>
200237
- </example>
200066
+ Rules:
200067
+ - Preserve exact filenames, function names, command names, errors, and user requirements.
200068
+ - Do not copy long code snippets or long command output.
200069
+ - Do not list every user message unless each one changes the task.
200070
+ - Target 400-900 words.
200071
+ `, PARTIAL_COMPACT_UP_TO_PROMPT = `Summarize this earlier portion of the conversation. Newer messages will be preserved verbatim after your summary, so focus on context needed to understand those newer messages.
200072
+
200073
+ Include these sections:
200074
+ 1. Earlier objective and constraints.
200075
+ 2. Work completed and decisions made.
200076
+ 3. Important references: files, symbols, tests, commands, errors, and config values.
200077
+ 4. Context for continuing: facts the later preserved messages depend on.
200238
200078
 
200239
- Please provide your summary following this structure, ensuring precision and thoroughness in your response.
200240
- `;
200241
- NO_TOOLS_TRAILER = `
200079
+ Rules:
200080
+ - Preserve exact filenames, function names, command names, errors, and user requirements.
200081
+ - Do not copy long code snippets or long command output.
200082
+ - Do not list every user message unless each one changes the task.
200083
+ - Target 400-900 words.
200084
+ `, NO_TOOLS_TRAILER = `
200242
200085
 
200243
- REMINDER: Do NOT call any tools. Respond with plain text only ` + "an <analysis> block followed by a <summary> block. " + "Tool calls will be rejected and you will fail the task.";
200244
- });
200086
+ Reminder: respond with plain text only in a single <summary> block. Do not call tools.`;
200245
200087
 
200246
200088
  // src/services/compact/compact.ts
200089
+ function getCompactOutputTokenLimit(model) {
200090
+ const contextTokens = getContextWindowForModel(model, []);
200091
+ const scaledForWindow = Math.max(1024, Math.floor(contextTokens * 0.2));
200092
+ return Math.min(COMPACT_MAX_OUTPUT_TOKENS, getMaxOutputTokensForModel(model), scaledForWindow);
200093
+ }
200247
200094
  function stripImagesFromMessages(messages) {
200248
200095
  return messages.map((message) => {
200249
200096
  if (message.type !== "user") {
@@ -200509,6 +200356,7 @@ async function compactConversation(messages, context4, cacheSafeParams, suppress
200509
200356
  ...postCompactFileAttachments,
200510
200357
  ...hookMessages
200511
200358
  ]);
200359
+ boundaryMarker.compactMetadata.truePostCompactTokenCount = truePostCompactTokenCount;
200512
200360
  const compactionUsage = getTokenUsage(summaryResponse);
200513
200361
  const querySourceForEvent = recompactionInfo?.querySource ?? context4.options.querySource ?? "unknown";
200514
200362
  logEvent("tengu_compact", {
@@ -200872,6 +200720,7 @@ async function tryDirectLocalCompact({
200872
200720
  const apiKey = getLocalLLMApiKey();
200873
200721
  if (!baseUrl || !model)
200874
200722
  return null;
200723
+ const outputTokenLimit = getCompactOutputTokenLimit(model);
200875
200724
  const contextTokens = getContextWindowForModel(model, []);
200876
200725
  const charBudget = Math.max(4000, Math.floor(contextTokens * 0.5 * 3.5));
200877
200726
  const serialized = serializeMessagesForCleanRoom(messages, charBudget);
@@ -200904,7 +200753,7 @@ ${compactPromptText}`;
200904
200753
  { role: "system", content: "You are a helpful assistant that summarizes conversations." },
200905
200754
  { role: "user", content: userText }
200906
200755
  ],
200907
- max_tokens: COMPACT_MAX_OUTPUT_TOKENS,
200756
+ max_tokens: outputTokenLimit,
200908
200757
  temperature: 0.2,
200909
200758
  stream: false
200910
200759
  }),
@@ -200950,7 +200799,8 @@ async function tryCleanRoomCompactSummary({
200950
200799
  try {
200951
200800
  const model = context4.options.mainLoopModel;
200952
200801
  const contextTokens = getContextWindowForModel(model, []);
200953
- const reserve = Math.min(COMPACT_MAX_OUTPUT_TOKENS, Math.max(2000, Math.floor(contextTokens * 0.25)));
200802
+ const outputTokenLimit = getCompactOutputTokenLimit(model);
200803
+ const reserve = Math.min(outputTokenLimit, Math.max(2000, Math.floor(contextTokens * 0.25)));
200954
200804
  const inputTokens = Math.max(Math.floor(contextTokens * 0.5), contextTokens - reserve - 2000);
200955
200805
  const charBudget = Math.max(4000, Math.floor(inputTokens * 3.5));
200956
200806
  const serialized = serializeMessagesForCleanRoom(messages, charBudget);
@@ -200981,7 +200831,7 @@ ${compactPromptText}`
200981
200831
  toolChoice: undefined,
200982
200832
  isNonInteractiveSession: context4.options.isNonInteractiveSession,
200983
200833
  hasAppendSystemPrompt: false,
200984
- maxOutputTokensOverride: Math.min(COMPACT_MAX_OUTPUT_TOKENS, getMaxOutputTokensForModel(model)),
200834
+ maxOutputTokensOverride: outputTokenLimit,
200985
200835
  querySource: "compact",
200986
200836
  agents: context4.options.agentDefinitions.activeAgents,
200987
200837
  mcpTools: [],
@@ -201120,7 +200970,7 @@ async function streamCompactSummary({
201120
200970
  toolChoice: undefined,
201121
200971
  isNonInteractiveSession: context4.options.isNonInteractiveSession,
201122
200972
  hasAppendSystemPrompt: !!context4.options.appendSystemPrompt,
201123
- maxOutputTokensOverride: Math.min(COMPACT_MAX_OUTPUT_TOKENS, getMaxOutputTokensForModel(context4.options.mainLoopModel)),
200973
+ maxOutputTokensOverride: getCompactOutputTokenLimit(context4.options.mainLoopModel),
201124
200974
  querySource: "compact",
201125
200975
  agents: context4.options.agentDefinitions.activeAgents,
201126
200976
  mcpTools: [],
@@ -201363,7 +201213,6 @@ var init_compact = __esm(() => {
201363
201213
  init_withRetry();
201364
201214
  init_internalLogging();
201365
201215
  init_tokenEstimation();
201366
- init_prompt10();
201367
201216
  LOCAL_CONTEXT_OVERFLOW_PATTERNS = [
201368
201217
  /prompt is too long/i,
201369
201218
  /context.{0,20}(length|limit|window).{0,30}exceeded/i,
@@ -205773,13 +205622,13 @@ var init_sedValidation = __esm(() => {
205773
205622
 
205774
205623
  // src/tools/BashTool/pathValidation.ts
205775
205624
  import { homedir as homedir15 } from "os";
205776
- import { isAbsolute as isAbsolute12, resolve as resolve21 } from "path";
205625
+ import { isAbsolute as isAbsolute13, resolve as resolve21 } from "path";
205777
205626
  function checkDangerousRemovalPaths(command, args, cwd2) {
205778
205627
  const extractor = PATH_EXTRACTORS[command];
205779
205628
  const paths2 = extractor(args);
205780
205629
  for (const path6 of paths2) {
205781
205630
  const cleanPath = expandTilde(path6.replace(/^['"]|['"]$/g, ""));
205782
- const absolutePath = isAbsolute12(cleanPath) ? cleanPath : resolve21(cwd2, cleanPath);
205631
+ const absolutePath = isAbsolute13(cleanPath) ? cleanPath : resolve21(cwd2, cleanPath);
205783
205632
  if (isDangerousRemovalPath(absolutePath)) {
205784
205633
  return {
205785
205634
  behavior: "ask",
@@ -207688,7 +207537,7 @@ function getTelemetryAttributes() {
207688
207537
  attributes["session.id"] = sessionId;
207689
207538
  }
207690
207539
  if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
207691
- attributes["app.version"] = "2.3.4";
207540
+ attributes["app.version"] = "2.3.5";
207692
207541
  }
207693
207542
  const oauthAccount = getOauthAccountInfo();
207694
207543
  if (oauthAccount) {
@@ -207773,7 +207622,7 @@ var init_events = __esm(() => {
207773
207622
  });
207774
207623
 
207775
207624
  // src/utils/telemetry/betaSessionTracing.ts
207776
- import { createHash as createHash4 } from "crypto";
207625
+ import { createHash as createHash5 } from "crypto";
207777
207626
  function clearBetaTracingState() {
207778
207627
  seenHashes.clear();
207779
207628
  lastReportedMessageHash.clear();
@@ -207800,7 +207649,7 @@ function truncateContent(content, maxSize = MAX_CONTENT_SIZE) {
207800
207649
  };
207801
207650
  }
207802
207651
  function shortHash(content) {
207803
- return createHash4("sha256").update(content).digest("hex").slice(0, 12);
207652
+ return createHash5("sha256").update(content).digest("hex").slice(0, 12);
207804
207653
  }
207805
207654
  function hashSystemPrompt(systemPrompt) {
207806
207655
  return `sp_${shortHash(systemPrompt)}`;
@@ -208159,6 +208008,14 @@ async function shouldAutoCompact(messages, model, querySource, snipTokensFreed =
208159
208008
  const tokenCount = tokenCountWithEstimation(messages) - snipTokensFreed;
208160
208009
  const threshold = getAutoCompactThreshold(model);
208161
208010
  const effectiveWindow = getEffectiveContextWindowSize(model);
208011
+ const compactBoundaryIndex = findLastCompactBoundaryIndex(messages);
208012
+ if (compactBoundaryIndex >= 0) {
208013
+ const assistantTurnsAfterCompact = messages.slice(compactBoundaryIndex + 1).filter((message) => message.type === "assistant").length;
208014
+ if (assistantTurnsAfterCompact < MIN_ASSISTANT_TURNS_AFTER_COMPACT && tokenCount < effectiveWindow) {
208015
+ logForDebugging(`autocompact: skipping immediate recompact after boundary (assistantTurns=${assistantTurnsAfterCompact} tokens=${tokenCount} threshold=${threshold} effectiveWindow=${effectiveWindow})`);
208016
+ return false;
208017
+ }
208018
+ }
208162
208019
  logForDebugging(`autocompact: tokens=${tokenCount} threshold=${threshold} effectiveWindow=${effectiveWindow}${snipTokensFreed > 0 ? ` snipFreed=${snipTokensFreed}` : ""}`);
208163
208020
  const { isAboveAutoCompactThreshold } = calculateTokenWarningState(tokenCount, model);
208164
208021
  return isAboveAutoCompactThreshold;
@@ -208203,7 +208060,7 @@ async function autoCompactIfNeeded(messages, toolUseContext, cacheSafeParams, qu
208203
208060
  return { wasCompacted: false, consecutiveFailures: nextFailures };
208204
208061
  }
208205
208062
  }
208206
- var MAX_OUTPUT_TOKENS_FOR_SUMMARY = 20000, AUTOCOMPACT_BUFFER_TOKENS = 13000, WARNING_THRESHOLD_BUFFER_TOKENS = 20000, ERROR_THRESHOLD_BUFFER_TOKENS = 20000, MANUAL_COMPACT_BUFFER_TOKENS = 3000, MAX_CONSECUTIVE_AUTOCOMPACT_FAILURES = 3;
208063
+ var MAX_OUTPUT_TOKENS_FOR_SUMMARY = 20000, AUTOCOMPACT_BUFFER_TOKENS = 13000, WARNING_THRESHOLD_BUFFER_TOKENS = 20000, ERROR_THRESHOLD_BUFFER_TOKENS = 20000, MANUAL_COMPACT_BUFFER_TOKENS = 3000, MAX_CONSECUTIVE_AUTOCOMPACT_FAILURES = 3, MIN_ASSISTANT_TURNS_AFTER_COMPACT = 2;
208207
208064
  var init_autoCompact = __esm(() => {
208208
208065
  init_state();
208209
208066
  init_config();
@@ -208212,6 +208069,7 @@ var init_autoCompact = __esm(() => {
208212
208069
  init_envUtils();
208213
208070
  init_errors();
208214
208071
  init_log2();
208072
+ init_messages3();
208215
208073
  init_tokens();
208216
208074
  init_llm();
208217
208075
  init_compact();
@@ -208316,13 +208174,10 @@ function objectGroupBy(items, keySelector) {
208316
208174
  // src/utils/messageQueueManager.ts
208317
208175
  var exports_messageQueueManager = {};
208318
208176
  __export(exports_messageQueueManager, {
208319
- subscribeToPendingNotifications: () => subscribeToPendingNotifications,
208320
208177
  subscribeToCommandQueue: () => subscribeToCommandQueue,
208321
- resetPendingNotifications: () => resetPendingNotifications,
208322
208178
  resetCommandQueue: () => resetCommandQueue,
208323
208179
  removeByFilter: () => removeByFilter,
208324
208180
  remove: () => remove,
208325
- recheckPendingNotifications: () => recheckPendingNotifications,
208326
208181
  recheckCommandQueue: () => recheckCommandQueue,
208327
208182
  popAllEditable: () => popAllEditable,
208328
208183
  peek: () => peek,
@@ -208330,21 +208185,16 @@ __export(exports_messageQueueManager, {
208330
208185
  isQueuedCommandVisible: () => isQueuedCommandVisible,
208331
208186
  isQueuedCommandEditable: () => isQueuedCommandEditable,
208332
208187
  isPromptInputModeEditable: () => isPromptInputModeEditable,
208333
- hasPendingNotifications: () => hasPendingNotifications,
208334
208188
  hasCommandsInQueue: () => hasCommandsInQueue,
208335
- getPendingNotificationsSnapshot: () => getPendingNotificationsSnapshot,
208336
- getPendingNotificationsCount: () => getPendingNotificationsCount,
208337
208189
  getCommandsByMaxPriority: () => getCommandsByMaxPriority,
208338
208190
  getCommandQueueSnapshot: () => getCommandQueueSnapshot,
208339
208191
  getCommandQueueLength: () => getCommandQueueLength,
208340
208192
  getCommandQueue: () => getCommandQueue,
208341
208193
  enqueuePendingNotification: () => enqueuePendingNotification,
208342
208194
  enqueue: () => enqueue,
208343
- dequeuePendingNotification: () => dequeuePendingNotification,
208344
208195
  dequeueAllMatching: () => dequeueAllMatching,
208345
208196
  dequeueAll: () => dequeueAll,
208346
208197
  dequeue: () => dequeue,
208347
- clearPendingNotifications: () => clearPendingNotifications,
208348
208198
  clearCommandQueue: () => clearCommandQueue
208349
208199
  });
208350
208200
  function logOperation(operation, content) {
@@ -208578,12 +208428,6 @@ function popAllEditable(currentInput, currentCursorOffset) {
208578
208428
  notifySubscribers();
208579
208429
  return { text: newInput, cursorOffset, images };
208580
208430
  }
208581
- function getPendingNotificationsSnapshot() {
208582
- return snapshot;
208583
- }
208584
- function dequeuePendingNotification() {
208585
- return dequeue();
208586
- }
208587
208431
  function getCommandsByMaxPriority(maxPriority) {
208588
208432
  const threshold = PRIORITY_ORDER[maxPriority];
208589
208433
  return commandQueue.filter((cmd) => PRIORITY_ORDER[cmd.priority ?? "next"] <= threshold);
@@ -208591,7 +208435,7 @@ function getCommandsByMaxPriority(maxPriority) {
208591
208435
  function isSlashCommand(cmd) {
208592
208436
  return typeof cmd.value === "string" && cmd.value.trim().startsWith("/") && !cmd.skipSlashCommands;
208593
208437
  }
208594
- var commandQueue, snapshot, queueChanged, subscribeToCommandQueue, PRIORITY_ORDER, NON_EDITABLE_MODES, subscribeToPendingNotifications, hasPendingNotifications, getPendingNotificationsCount, recheckPendingNotifications, resetPendingNotifications, clearPendingNotifications;
208438
+ var commandQueue, snapshot, queueChanged, subscribeToCommandQueue, PRIORITY_ORDER, NON_EDITABLE_MODES;
208595
208439
  var init_messageQueueManager = __esm(() => {
208596
208440
  init_state();
208597
208441
  init_messages3();
@@ -208608,12 +208452,6 @@ var init_messageQueueManager = __esm(() => {
208608
208452
  NON_EDITABLE_MODES = new Set([
208609
208453
  "task-notification"
208610
208454
  ]);
208611
- subscribeToPendingNotifications = subscribeToCommandQueue;
208612
- hasPendingNotifications = hasCommandsInQueue;
208613
- getPendingNotificationsCount = getCommandQueueLength;
208614
- recheckPendingNotifications = recheckCommandQueue;
208615
- resetPendingNotifications = resetCommandQueue;
208616
- clearPendingNotifications = clearCommandQueue;
208617
208455
  });
208618
208456
 
208619
208457
  // src/utils/commandLifecycle.ts
@@ -208721,7 +208559,7 @@ var init_headlessProfiler = __esm(() => {
208721
208559
 
208722
208560
  // src/tools/SleepTool/prompt.ts
208723
208561
  var SLEEP_TOOL_NAME = "Sleep", SLEEP_TOOL_PROMPT;
208724
- var init_prompt11 = __esm(() => {
208562
+ var init_prompt10 = __esm(() => {
208725
208563
  init_xml();
208726
208564
  SLEEP_TOOL_PROMPT = `Wait for a specified duration. The user can interrupt the sleep at any time.
208727
208565
 
@@ -208765,11 +208603,11 @@ var init_postSamplingHooks = __esm(() => {
208765
208603
  });
208766
208604
 
208767
208605
  // src/services/api/dumpPrompts.ts
208768
- import { createHash as createHash5 } from "crypto";
208606
+ import { createHash as createHash6 } from "crypto";
208769
208607
  import { promises as fs3 } from "fs";
208770
208608
  import { dirname as dirname22, join as join44 } from "path";
208771
208609
  function hashString3(str2) {
208772
- return createHash5("sha256").update(str2).digest("hex");
208610
+ return createHash6("sha256").update(str2).digest("hex");
208773
208611
  }
208774
208612
  function clearDumpState(agentIdOrSessionId) {
208775
208613
  dumpState.delete(agentIdOrSessionId);
@@ -253816,49 +253654,49 @@ var require_fast_uri = __commonJS((exports, module) => {
253816
253654
  schemelessOptions.skipEscape = true;
253817
253655
  return serialize(resolved, schemelessOptions);
253818
253656
  }
253819
- function resolveComponent(base, relative7, options, skipNormalization) {
253657
+ function resolveComponent(base, relative8, options, skipNormalization) {
253820
253658
  const target = {};
253821
253659
  if (!skipNormalization) {
253822
253660
  base = parse4(serialize(base, options), options);
253823
- relative7 = parse4(serialize(relative7, options), options);
253661
+ relative8 = parse4(serialize(relative8, options), options);
253824
253662
  }
253825
253663
  options = options || {};
253826
- if (!options.tolerant && relative7.scheme) {
253827
- target.scheme = relative7.scheme;
253828
- target.userinfo = relative7.userinfo;
253829
- target.host = relative7.host;
253830
- target.port = relative7.port;
253831
- target.path = removeDotSegments(relative7.path || "");
253832
- target.query = relative7.query;
253833
- } else {
253834
- if (relative7.userinfo !== undefined || relative7.host !== undefined || relative7.port !== undefined) {
253835
- target.userinfo = relative7.userinfo;
253836
- target.host = relative7.host;
253837
- target.port = relative7.port;
253838
- target.path = removeDotSegments(relative7.path || "");
253839
- target.query = relative7.query;
253840
- } else {
253841
- if (!relative7.path) {
253664
+ if (!options.tolerant && relative8.scheme) {
253665
+ target.scheme = relative8.scheme;
253666
+ target.userinfo = relative8.userinfo;
253667
+ target.host = relative8.host;
253668
+ target.port = relative8.port;
253669
+ target.path = removeDotSegments(relative8.path || "");
253670
+ target.query = relative8.query;
253671
+ } else {
253672
+ if (relative8.userinfo !== undefined || relative8.host !== undefined || relative8.port !== undefined) {
253673
+ target.userinfo = relative8.userinfo;
253674
+ target.host = relative8.host;
253675
+ target.port = relative8.port;
253676
+ target.path = removeDotSegments(relative8.path || "");
253677
+ target.query = relative8.query;
253678
+ } else {
253679
+ if (!relative8.path) {
253842
253680
  target.path = base.path;
253843
- if (relative7.query !== undefined) {
253844
- target.query = relative7.query;
253681
+ if (relative8.query !== undefined) {
253682
+ target.query = relative8.query;
253845
253683
  } else {
253846
253684
  target.query = base.query;
253847
253685
  }
253848
253686
  } else {
253849
- if (relative7.path[0] === "/") {
253850
- target.path = removeDotSegments(relative7.path);
253687
+ if (relative8.path[0] === "/") {
253688
+ target.path = removeDotSegments(relative8.path);
253851
253689
  } else {
253852
253690
  if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {
253853
- target.path = "/" + relative7.path;
253691
+ target.path = "/" + relative8.path;
253854
253692
  } else if (!base.path) {
253855
- target.path = relative7.path;
253693
+ target.path = relative8.path;
253856
253694
  } else {
253857
- target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative7.path;
253695
+ target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative8.path;
253858
253696
  }
253859
253697
  target.path = removeDotSegments(target.path);
253860
253698
  }
253861
- target.query = relative7.query;
253699
+ target.query = relative8.query;
253862
253700
  }
253863
253701
  target.userinfo = base.userinfo;
253864
253702
  target.host = base.host;
@@ -253866,7 +253704,7 @@ var require_fast_uri = __commonJS((exports, module) => {
253866
253704
  }
253867
253705
  target.scheme = base.scheme;
253868
253706
  }
253869
- target.fragment = relative7.fragment;
253707
+ target.fragment = relative8.fragment;
253870
253708
  return target;
253871
253709
  }
253872
253710
  function equal(uriA, uriB, options) {
@@ -256713,7 +256551,7 @@ function isKairosCronEnabled() {
256713
256551
  return false;
256714
256552
  }
256715
256553
  var KAIROS_CRON_REFRESH_MS, DEFAULT_MAX_AGE_DAYS;
256716
- var init_prompt12 = __esm(() => {
256554
+ var init_prompt11 = __esm(() => {
256717
256555
  init_cronTasks();
256718
256556
  init_envUtils();
256719
256557
  KAIROS_CRON_REFRESH_MS = 5 * 60 * 1000;
@@ -256732,7 +256570,7 @@ var init_tools = __esm(() => {
256732
256570
  init_prompt3();
256733
256571
  init_prompt8();
256734
256572
  init_SyntheticOutputTool();
256735
- init_prompt12();
256573
+ init_prompt11();
256736
256574
  ALL_AGENT_DISALLOWED_TOOLS = new Set([
256737
256575
  TASK_OUTPUT_TOOL_NAME,
256738
256576
  EXIT_PLAN_MODE_TOOL_NAME,
@@ -265748,7 +265586,7 @@ var init_config2 = __esm(() => {
265748
265586
  });
265749
265587
 
265750
265588
  // src/services/mcp/utils.ts
265751
- import { createHash as createHash6 } from "crypto";
265589
+ import { createHash as createHash7 } from "crypto";
265752
265590
  import { join as join48 } from "path";
265753
265591
  function filterToolsByServer(tools, serverName) {
265754
265592
  const prefix = `mcp__${normalizeNameForMCP(serverName)}__`;
@@ -265788,7 +265626,7 @@ function hashMcpConfig(config) {
265788
265626
  }
265789
265627
  return v2;
265790
265628
  });
265791
- return createHash6("sha256").update(stable).digest("hex").slice(0, 16);
265629
+ return createHash7("sha256").update(stable).digest("hex").slice(0, 16);
265792
265630
  }
265793
265631
  function excludeStalePluginClients(mcp, configs) {
265794
265632
  const stale = mcp.clients.filter((c5) => {
@@ -266533,7 +266371,7 @@ var init_xaaIdpLogin = __esm(() => {
266533
266371
  });
266534
266372
 
266535
266373
  // src/services/mcp/auth.ts
266536
- import { createHash as createHash7, randomBytes as randomBytes6, randomUUID as randomUUID6 } from "crypto";
266374
+ import { createHash as createHash8, randomBytes as randomBytes6, randomUUID as randomUUID6 } from "crypto";
266537
266375
  import { mkdir as mkdir9 } from "fs/promises";
266538
266376
  import { createServer as createServer3 } from "http";
266539
266377
  import { join as join49 } from "path";
@@ -266647,7 +266485,7 @@ function getServerKey(serverName, serverConfig) {
266647
266485
  url: serverConfig.url,
266648
266486
  headers: serverConfig.headers || {}
266649
266487
  });
266650
- const hash = createHash7("sha256").update(configJson).digest("hex").substring(0, 16);
266488
+ const hash = createHash8("sha256").update(configJson).digest("hex").substring(0, 16);
266651
266489
  return `${serverName}|${hash}`;
266652
266490
  }
266653
266491
  function hasMcpDiscoveryButNoToken(serverName, serverConfig) {
@@ -269568,7 +269406,7 @@ var init_IdeOnboardingDialog = __esm(() => {
269568
269406
  import { execa as execa7 } from "execa";
269569
269407
  import { createConnection } from "net";
269570
269408
  import * as os5 from "os";
269571
- import { basename as basename13, join as join52, sep as pathSeparator, resolve as resolve22 } from "path";
269409
+ import { basename as basename14, join as join52, sep as pathSeparator, resolve as resolve22 } from "path";
269572
269410
  function isProcessRunning2(pid) {
269573
269411
  try {
269574
269412
  process.kill(pid, 0);
@@ -269978,7 +269816,7 @@ function getInstallationEnv() {
269978
269816
  return;
269979
269817
  }
269980
269818
  function getClaudeCodeVersion() {
269981
- return "2.3.4";
269819
+ return "2.3.5";
269982
269820
  }
269983
269821
  async function getInstalledVSCodeExtensionVersion(command) {
269984
269822
  const { stdout } = await execFileNoThrow(command, ["--list-extensions", "--show-versions"], {
@@ -270147,7 +269985,7 @@ function toIDEDisplayName(terminal) {
270147
269985
  return editorName;
270148
269986
  }
270149
269987
  const command = terminal.split(" ")[0];
270150
- const commandName = command ? basename13(command).toLowerCase() : null;
269988
+ const commandName = command ? basename14(command).toLowerCase() : null;
270151
269989
  if (commandName) {
270152
269990
  const mappedName = EDITOR_DISPLAY_NAMES[commandName];
270153
269991
  if (mappedName) {
@@ -273168,7 +273006,7 @@ var require_websocket2 = __commonJS((exports, module) => {
273168
273006
  var http4 = __require("http");
273169
273007
  var net3 = __require("net");
273170
273008
  var tls2 = __require("tls");
273171
- var { randomBytes: randomBytes7, createHash: createHash8 } = __require("crypto");
273009
+ var { randomBytes: randomBytes7, createHash: createHash9 } = __require("crypto");
273172
273010
  var { Duplex, Readable: Readable3 } = __require("stream");
273173
273011
  var { URL: URL3 } = __require("url");
273174
273012
  var PerMessageDeflate = require_permessage_deflate2();
@@ -273707,7 +273545,7 @@ var require_websocket2 = __commonJS((exports, module) => {
273707
273545
  abortHandshake(websocket, socket, "Invalid Upgrade header");
273708
273546
  return;
273709
273547
  }
273710
- const digest = createHash8("sha1").update(key + GUID).digest("base64");
273548
+ const digest = createHash9("sha1").update(key + GUID).digest("base64");
273711
273549
  if (res.headers["sec-websocket-accept"] !== digest) {
273712
273550
  abortHandshake(websocket, socket, "Invalid Sec-WebSocket-Accept header");
273713
273551
  return;
@@ -274080,7 +273918,7 @@ var require_websocket_server = __commonJS((exports, module) => {
274080
273918
  var EventEmitter4 = __require("events");
274081
273919
  var http4 = __require("http");
274082
273920
  var { Duplex } = __require("stream");
274083
- var { createHash: createHash8 } = __require("crypto");
273921
+ var { createHash: createHash9 } = __require("crypto");
274084
273922
  var extension = require_extension();
274085
273923
  var PerMessageDeflate = require_permessage_deflate2();
274086
273924
  var subprotocol = require_subprotocol();
@@ -274293,7 +274131,7 @@ var require_websocket_server = __commonJS((exports, module) => {
274293
274131
  }
274294
274132
  if (this._state > RUNNING)
274295
274133
  return abortHandshake(socket, 503);
274296
- const digest = createHash8("sha1").update(key + GUID).digest("base64");
274134
+ const digest = createHash9("sha1").update(key + GUID).digest("base64");
274297
274135
  const headers = [
274298
274136
  "HTTP/1.1 101 Switching Protocols",
274299
274137
  "Upgrade: websocket",
@@ -275252,7 +275090,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
275252
275090
  const client4 = new Client({
275253
275091
  name: "localclawd",
275254
275092
  title: "localclawd",
275255
- version: "2.3.4",
275093
+ version: "2.3.5",
275256
275094
  description: "local-first AI coding tool",
275257
275095
  websiteUrl: PRODUCT_URL
275258
275096
  }, {
@@ -275594,7 +275432,7 @@ var init_client9 = __esm(() => {
275594
275432
  const client4 = new Client({
275595
275433
  name: "localclawd",
275596
275434
  title: "localclawd",
275597
- version: "2.3.4",
275435
+ version: "2.3.5",
275598
275436
  description: "local-first AI coding tool",
275599
275437
  websiteUrl: PRODUCT_URL
275600
275438
  }, {
@@ -276603,12 +276441,12 @@ var init_LSPDiagnosticRegistry = __esm(() => {
276603
276441
 
276604
276442
  // src/utils/plugins/lspPluginIntegration.ts
276605
276443
  import { readFile as readFile14 } from "fs/promises";
276606
- import { join as join54, relative as relative7, resolve as resolve23 } from "path";
276444
+ import { join as join54, relative as relative8, resolve as resolve23 } from "path";
276607
276445
  import { z as z27 } from "zod/v4";
276608
276446
  function validatePathWithinPlugin(pluginPath, relativePath) {
276609
276447
  const resolvedPluginPath = resolve23(pluginPath);
276610
276448
  const resolvedFilePath = resolve23(pluginPath, relativePath);
276611
- const rel = relative7(resolvedPluginPath, resolvedFilePath);
276449
+ const rel = relative8(resolvedPluginPath, resolvedFilePath);
276612
276450
  if (rel.startsWith("..") || resolve23(rel) === rel) {
276613
276451
  return null;
276614
276452
  }
@@ -281375,7 +281213,7 @@ var init_diff2 = __esm(() => {
281375
281213
  });
281376
281214
 
281377
281215
  // src/utils/fileHistory.ts
281378
- import { createHash as createHash8 } from "crypto";
281216
+ import { createHash as createHash9 } from "crypto";
281379
281217
  import {
281380
281218
  chmod as chmod3,
281381
281219
  copyFile as copyFile3,
@@ -281385,7 +281223,7 @@ import {
281385
281223
  stat as stat21,
281386
281224
  unlink as unlink5
281387
281225
  } from "fs/promises";
281388
- import { dirname as dirname25, isAbsolute as isAbsolute13, join as join55, relative as relative8 } from "path";
281226
+ import { dirname as dirname25, isAbsolute as isAbsolute14, join as join55, relative as relative9 } from "path";
281389
281227
  import { inspect } from "util";
281390
281228
  function fileHistoryEnabled() {
281391
281229
  if (getIsNonInteractiveSession()) {
@@ -281799,7 +281637,7 @@ async function computeDiffStatsForFile(originalFile, backupFileName) {
281799
281637
  };
281800
281638
  }
281801
281639
  function getBackupFileName(filePath, version) {
281802
- const fileNameHash = createHash8("sha256").update(filePath).digest("hex").slice(0, 16);
281640
+ const fileNameHash = createHash9("sha256").update(filePath).digest("hex").slice(0, 16);
281803
281641
  return `${fileNameHash}@v${version}`;
281804
281642
  }
281805
281643
  function resolveBackupPath(backupFileName, sessionId) {
@@ -281873,17 +281711,17 @@ function getBackupFileNameFirstVersion(trackingPath, state) {
281873
281711
  return;
281874
281712
  }
281875
281713
  function maybeShortenFilePath(filePath) {
281876
- if (!isAbsolute13(filePath)) {
281714
+ if (!isAbsolute14(filePath)) {
281877
281715
  return filePath;
281878
281716
  }
281879
281717
  const cwd2 = getOriginalCwd();
281880
281718
  if (filePath.startsWith(cwd2)) {
281881
- return relative8(cwd2, filePath);
281719
+ return relative9(cwd2, filePath);
281882
281720
  }
281883
281721
  return filePath;
281884
281722
  }
281885
281723
  function maybeExpandFilePath(filePath) {
281886
- if (isAbsolute13(filePath)) {
281724
+ if (isAbsolute14(filePath)) {
281887
281725
  return filePath;
281888
281726
  }
281889
281727
  return join55(getOriginalCwd(), filePath);
@@ -282035,12 +281873,12 @@ var init_fileHistory = __esm(() => {
282035
281873
  });
282036
281874
 
282037
281875
  // src/utils/fileOperationAnalytics.ts
282038
- import { createHash as createHash9 } from "crypto";
281876
+ import { createHash as createHash10 } from "crypto";
282039
281877
  function hashFilePath(filePath) {
282040
- return createHash9("sha256").update(filePath).digest("hex").slice(0, 16);
281878
+ return createHash10("sha256").update(filePath).digest("hex").slice(0, 16);
282041
281879
  }
282042
281880
  function hashFileContent(content) {
282043
- return createHash9("sha256").update(content).digest("hex");
281881
+ return createHash10("sha256").update(content).digest("hex");
282044
281882
  }
282045
281883
  function logFileOperation(params) {
282046
281884
  const metadata = {
@@ -282063,7 +281901,7 @@ var init_fileOperationAnalytics = __esm(() => {
282063
281901
 
282064
281902
  // src/utils/gitDiff.ts
282065
281903
  import { access as access2, readFile as readFile16 } from "fs/promises";
282066
- import { dirname as dirname26, join as join56, relative as relative9, sep as sep11 } from "path";
281904
+ import { dirname as dirname26, join as join56, relative as relative10, sep as sep11 } from "path";
282067
281905
  async function fetchGitDiff() {
282068
281906
  const isGit = await getIsGit();
282069
281907
  if (!isGit)
@@ -282250,7 +282088,7 @@ async function fetchSingleFileGitDiff(absoluteFilePath) {
282250
282088
  const gitRoot = findGitRoot(dirname26(absoluteFilePath));
282251
282089
  if (!gitRoot)
282252
282090
  return null;
282253
- const gitPath = relative9(gitRoot, absoluteFilePath).split(sep11).join("/");
282091
+ const gitPath = relative10(gitRoot, absoluteFilePath).split(sep11).join("/");
282254
282092
  const repository = getCachedRepository();
282255
282093
  const { code: lsFilesCode } = await execFileNoThrowWithCwd(gitExe(), ["--no-optional-locks", "ls-files", "--error-unmatch", gitPath], { cwd: gitRoot, timeout: SINGLE_FILE_DIFF_TIMEOUT_MS });
282256
282094
  if (lsFilesCode === 0) {
@@ -282396,7 +282234,7 @@ Usage:${getPreReadInstruction2()}
282396
282234
  - The edit will FAIL if \`old_string\` is not unique in the file. Either provide a larger string with more surrounding context to make it unique or use \`replace_all\` to change every instance of \`old_string\`.${minimalUniquenessHint}
282397
282235
  - Use \`replace_all\` for replacing and renaming strings across the file. This parameter is useful if you want to rename a variable for instance.`;
282398
282236
  }
282399
- var init_prompt13 = __esm(() => {
282237
+ var init_prompt12 = __esm(() => {
282400
282238
  init_file();
282401
282239
  init_prompt2();
282402
282240
  });
@@ -283507,7 +283345,7 @@ var init_StructuredDiffList = __esm(() => {
283507
283345
  });
283508
283346
 
283509
283347
  // src/components/FileEditToolUseRejectedMessage.tsx
283510
- import { relative as relative10 } from "path";
283348
+ import { relative as relative11 } from "path";
283511
283349
  function FileEditToolUseRejectedMessage(t0) {
283512
283350
  const $2 = c3(38);
283513
283351
  const {
@@ -283540,7 +283378,7 @@ function FileEditToolUseRejectedMessage(t0) {
283540
283378
  }
283541
283379
  let t2;
283542
283380
  if ($2[2] !== file_path || $2[3] !== verbose) {
283543
- t2 = verbose ? file_path : relative10(getCwd(), file_path);
283381
+ t2 = verbose ? file_path : relative11(getCwd(), file_path);
283544
283382
  $2[2] = file_path;
283545
283383
  $2[3] = verbose;
283546
283384
  $2[4] = t2;
@@ -284719,7 +284557,7 @@ var init_UI6 = __esm(() => {
284719
284557
  });
284720
284558
 
284721
284559
  // src/tools/FileEditTool/FileEditTool.ts
284722
- import { dirname as dirname27, isAbsolute as isAbsolute14, sep as sep12 } from "path";
284560
+ import { dirname as dirname27, isAbsolute as isAbsolute15, sep as sep12 } from "path";
284723
284561
  function readFileForEdit(absoluteFilePath) {
284724
284562
  try {
284725
284563
  const meta = readFileSyncWithMetadata(absoluteFilePath);
@@ -284766,7 +284604,7 @@ var init_FileEditTool = __esm(() => {
284766
284604
  init_filesystem();
284767
284605
  init_shellRuleMatching();
284768
284606
  init_validateEditTool();
284769
- init_prompt13();
284607
+ init_prompt12();
284770
284608
  init_types6();
284771
284609
  init_UI6();
284772
284610
  init_utils6();
@@ -284921,7 +284759,7 @@ var init_FileEditTool = __esm(() => {
284921
284759
  behavior: "ask",
284922
284760
  message: "File has not been read yet. Read it first before writing to it.",
284923
284761
  meta: {
284924
- isFilePathAbsolute: String(isAbsolute14(file_path))
284762
+ isFilePathAbsolute: String(isAbsolute15(file_path))
284925
284763
  },
284926
284764
  errorCode: 6
284927
284765
  };
@@ -284949,7 +284787,7 @@ var init_FileEditTool = __esm(() => {
284949
284787
  message: `String to replace not found in file.
284950
284788
  String: ${old_string}`,
284951
284789
  meta: {
284952
- isFilePathAbsolute: String(isAbsolute14(file_path))
284790
+ isFilePathAbsolute: String(isAbsolute15(file_path))
284953
284791
  },
284954
284792
  errorCode: 8
284955
284793
  };
@@ -284962,7 +284800,7 @@ String: ${old_string}`,
284962
284800
  message: `Found ${matches} matches of the string to replace, but replace_all is false. To replace all occurrences, set replace_all to true. To replace only one occurrence, please provide more context to uniquely identify the instance.
284963
284801
  String: ${old_string}`,
284964
284802
  meta: {
284965
- isFilePathAbsolute: String(isAbsolute14(file_path)),
284803
+ isFilePathAbsolute: String(isAbsolute15(file_path)),
284966
284804
  actualOldString
284967
284805
  },
284968
284806
  errorCode: 9
@@ -285128,7 +284966,7 @@ String: ${old_string}`,
285128
284966
  });
285129
284967
 
285130
284968
  // src/tools/FileWriteTool/UI.tsx
285131
- import { isAbsolute as isAbsolute15, resolve as resolve25 } from "path";
284969
+ import { isAbsolute as isAbsolute16, resolve as resolve25 } from "path";
285132
284970
  function countLines(content) {
285133
284971
  const parts = content.split(EOL2);
285134
284972
  return content.endsWith(EOL2) ? parts.length - 1 : parts.length;
@@ -285452,7 +285290,7 @@ function WriteRejectionBody(t0) {
285452
285290
  }
285453
285291
  async function loadRejectionDiff2(filePath, content) {
285454
285292
  try {
285455
- const fullFilePath = isAbsolute15(filePath) ? filePath : resolve25(getCwd(), filePath);
285293
+ const fullFilePath = isAbsolute16(filePath) ? filePath : resolve25(getCwd(), filePath);
285456
285294
  const handle = await openForScan(fullFilePath);
285457
285295
  if (handle === null)
285458
285296
  return {
@@ -285879,7 +285717,7 @@ var init_FileWriteTool = __esm(() => {
285879
285717
  });
285880
285718
 
285881
285719
  // src/utils/plugins/orphanedPluginFilter.ts
285882
- import { dirname as dirname29, isAbsolute as isAbsolute16, join as join57, normalize as normalize9, relative as relative11, sep as sep14 } from "path";
285720
+ import { dirname as dirname29, isAbsolute as isAbsolute17, join as join57, normalize as normalize9, relative as relative12, sep as sep14 } from "path";
285883
285721
  async function getGlobExclusionsForPluginCache(searchPath) {
285884
285722
  const cachePath = normalize9(join57(getPluginsDirectory(), "cache"));
285885
285723
  if (searchPath && !pathsOverlap(searchPath, cachePath)) {
@@ -285900,7 +285738,7 @@ async function getGlobExclusionsForPluginCache(searchPath) {
285900
285738
  ], cachePath, new AbortController().signal);
285901
285739
  cachedExclusions = markers.map((markerPath) => {
285902
285740
  const versionDir = dirname29(markerPath);
285903
- const rel = isAbsolute16(versionDir) ? relative11(cachePath, versionDir) : versionDir;
285741
+ const rel = isAbsolute17(versionDir) ? relative12(cachePath, versionDir) : versionDir;
285904
285742
  const posixRelative = rel.replace(/\\/g, "/");
285905
285743
  return `!**/${posixRelative}/**`;
285906
285744
  });
@@ -285929,13 +285767,13 @@ var init_orphanedPluginFilter = __esm(() => {
285929
285767
  });
285930
285768
 
285931
285769
  // src/utils/glob.ts
285932
- import { basename as basename15, dirname as dirname30, isAbsolute as isAbsolute17, join as join58, sep as sep15 } from "path";
285770
+ import { basename as basename16, dirname as dirname30, isAbsolute as isAbsolute18, join as join58, sep as sep15 } from "path";
285933
285771
  function extractGlobBaseDirectory(pattern) {
285934
285772
  const globChars = /[*?[{]/;
285935
285773
  const match = pattern.match(globChars);
285936
285774
  if (!match || match.index === undefined) {
285937
285775
  const dir = dirname30(pattern);
285938
- const file = basename15(pattern);
285776
+ const file = basename16(pattern);
285939
285777
  return { baseDir: dir, relativePattern: file };
285940
285778
  }
285941
285779
  const staticPrefix = pattern.slice(0, match.index);
@@ -285956,7 +285794,7 @@ function extractGlobBaseDirectory(pattern) {
285956
285794
  async function glob(filePattern, cwd2, { limit, offset }, abortSignal, toolPermissionContext) {
285957
285795
  let searchDir = cwd2;
285958
285796
  let searchPattern = filePattern;
285959
- if (isAbsolute17(filePattern)) {
285797
+ if (isAbsolute18(filePattern)) {
285960
285798
  const { baseDir, relativePattern } = extractGlobBaseDirectory(filePattern);
285961
285799
  if (baseDir) {
285962
285800
  searchDir = baseDir;
@@ -285981,7 +285819,7 @@ async function glob(filePattern, cwd2, { limit, offset }, abortSignal, toolPermi
285981
285819
  args.push("--glob", exclusion);
285982
285820
  }
285983
285821
  const allPaths = await ripGrep(args, searchDir, abortSignal);
285984
- const absolutePaths = allPaths.map((p) => isAbsolute17(p) ? p : join58(searchDir, p));
285822
+ const absolutePaths = allPaths.map((p) => isAbsolute18(p) ? p : join58(searchDir, p));
285985
285823
  const truncated = absolutePaths.length > offset + limit;
285986
285824
  const files = absolutePaths.slice(offset, offset + limit);
285987
285825
  return { files, truncated };
@@ -287022,7 +286860,7 @@ var init_notebook = __esm(() => {
287022
286860
  var DESCRIPTION9 = "Replace the contents of a specific cell in a Jupyter notebook.", PROMPT4 = `Completely replaces the contents of a specific cell in a Jupyter notebook (.ipynb file) with new source. Jupyter notebooks are interactive documents that combine code, text, and visualizations, commonly used for data analysis and scientific computing. The notebook_path parameter must be an absolute path, not a relative path. The cell_number is 0-indexed. Use edit_mode=insert to add a new cell at the index specified by cell_number. Use edit_mode=delete to delete the cell at the index specified by cell_number.`;
287023
286861
 
287024
286862
  // src/components/NotebookEditToolUseRejectedMessage.tsx
287025
- import { relative as relative12 } from "path";
286863
+ import { relative as relative13 } from "path";
287026
286864
  function NotebookEditToolUseRejectedMessage(t0) {
287027
286865
  const $2 = c3(20);
287028
286866
  const {
@@ -287052,7 +286890,7 @@ function NotebookEditToolUseRejectedMessage(t0) {
287052
286890
  }
287053
286891
  let t3;
287054
286892
  if ($2[2] !== notebook_path || $2[3] !== verbose) {
287055
- t3 = verbose ? notebook_path : relative12(getCwd(), notebook_path);
286893
+ t3 = verbose ? notebook_path : relative13(getCwd(), notebook_path);
287056
286894
  $2[2] = notebook_path;
287057
286895
  $2[3] = verbose;
287058
286896
  $2[4] = t3;
@@ -287269,7 +287107,7 @@ var init_UI10 = __esm(() => {
287269
287107
  });
287270
287108
 
287271
287109
  // src/tools/NotebookEditTool/NotebookEditTool.ts
287272
- import { extname as extname8, isAbsolute as isAbsolute18, resolve as resolve26 } from "path";
287110
+ import { extname as extname8, isAbsolute as isAbsolute19, resolve as resolve26 } from "path";
287273
287111
  import { z as z32 } from "zod/v4";
287274
287112
  var inputSchema12, outputSchema11, NotebookEditTool;
287275
287113
  var init_NotebookEditTool = __esm(() => {
@@ -287379,7 +287217,7 @@ var init_NotebookEditTool = __esm(() => {
287379
287217
  renderToolUseErrorMessage: renderToolUseErrorMessage7,
287380
287218
  renderToolResultMessage: renderToolResultMessage10,
287381
287219
  async validateInput({ notebook_path, cell_type, cell_id, edit_mode = "replace" }, toolUseContext) {
287382
- const fullPath = isAbsolute18(notebook_path) ? notebook_path : resolve26(getCwd(), notebook_path);
287220
+ const fullPath = isAbsolute19(notebook_path) ? notebook_path : resolve26(getCwd(), notebook_path);
287383
287221
  if (fullPath.startsWith("\\\\") || fullPath.startsWith("//")) {
287384
287222
  return { result: true };
287385
287223
  }
@@ -287478,7 +287316,7 @@ var init_NotebookEditTool = __esm(() => {
287478
287316
  cell_type,
287479
287317
  edit_mode: originalEditMode
287480
287318
  }, { readFileState, updateFileHistoryState }, _2, parentMessage) {
287481
- const fullPath = isAbsolute18(notebook_path) ? notebook_path : resolve26(getCwd(), notebook_path);
287319
+ const fullPath = isAbsolute19(notebook_path) ? notebook_path : resolve26(getCwd(), notebook_path);
287482
287320
  if (fileHistoryEnabled()) {
287483
287321
  await fileHistoryTrackEdit(updateFileHistoryState, fullPath, parentMessage.uuid);
287484
287322
  }
@@ -289966,7 +289804,7 @@ var init_uuid = __esm(() => {
289966
289804
  });
289967
289805
 
289968
289806
  // src/utils/fingerprint.ts
289969
- import { createHash as createHash10 } from "crypto";
289807
+ import { createHash as createHash11 } from "crypto";
289970
289808
  function extractFirstMessageText(messages) {
289971
289809
  const firstUserMessage = messages.find((msg) => msg.type === "user");
289972
289810
  if (!firstUserMessage) {
@@ -289988,12 +289826,12 @@ function computeFingerprint(messageText, version) {
289988
289826
  const indices = [4, 7, 20];
289989
289827
  const chars = indices.map((i3) => messageText[i3] || "0").join("");
289990
289828
  const fingerprintInput = `${FINGERPRINT_SALT}${chars}${version}`;
289991
- const hash = createHash10("sha256").update(fingerprintInput).digest("hex");
289829
+ const hash = createHash11("sha256").update(fingerprintInput).digest("hex");
289992
289830
  return hash.slice(0, 3);
289993
289831
  }
289994
289832
  function computeFingerprintFromMessages(messages) {
289995
289833
  const firstMessageText = extractFirstMessageText(messages);
289996
- return computeFingerprint(firstMessageText, "2.3.4");
289834
+ return computeFingerprint(firstMessageText, "2.3.5");
289997
289835
  }
289998
289836
  var FINGERPRINT_SALT = "59cf53e54c78";
289999
289837
  var init_fingerprint = () => {};
@@ -290035,7 +289873,7 @@ async function sideQuery(opts) {
290035
289873
  betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
290036
289874
  }
290037
289875
  const messageText = extractFirstUserMessageText(messages);
290038
- const fingerprint = computeFingerprint(messageText, "2.3.4");
289876
+ const fingerprint = computeFingerprint(messageText, "2.3.5");
290039
289877
  const attributionHeader = getAttributionHeader(fingerprint);
290040
289878
  const systemBlocks = [
290041
289879
  attributionHeader ? { type: "text", text: attributionHeader } : null,
@@ -297762,7 +297600,7 @@ var init_UserTextMessage = __esm(() => {
297762
297600
  });
297763
297601
 
297764
297602
  // src/components/DiagnosticsDisplay.tsx
297765
- import { relative as relative13 } from "path";
297603
+ import { relative as relative14 } from "path";
297766
297604
  function DiagnosticsDisplay(t0) {
297767
297605
  const $2 = c3(14);
297768
297606
  const {
@@ -297866,7 +297704,7 @@ function _temp34(file_0, fileIndex) {
297866
297704
  children: [
297867
297705
  /* @__PURE__ */ jsx_dev_runtime90.jsxDEV(ThemedText, {
297868
297706
  bold: true,
297869
- children: relative13(getCwd(), file_0.uri.replace("file://", "").replace("_claude_fs_right:", ""))
297707
+ children: relative14(getCwd(), file_0.uri.replace("file://", "").replace("_claude_fs_right:", ""))
297870
297708
  }, undefined, false, undefined, this),
297871
297709
  " ",
297872
297710
  /* @__PURE__ */ jsx_dev_runtime90.jsxDEV(ThemedText, {
@@ -298091,7 +297929,7 @@ var init_UserImageMessage = __esm(() => {
298091
297929
  });
298092
297930
 
298093
297931
  // src/components/messages/AttachmentMessage.tsx
298094
- import { basename as basename16, sep as sep16 } from "path";
297932
+ import { basename as basename17, sep as sep16 } from "path";
298095
297933
  function AttachmentMessage({
298096
297934
  attachment,
298097
297935
  addMargin,
@@ -298341,7 +298179,7 @@ function AttachmentMessage({
298341
298179
  dimColor: true,
298342
298180
  children: /* @__PURE__ */ jsx_dev_runtime92.jsxDEV(FilePathLink, {
298343
298181
  filePath: m3.path,
298344
- children: basename16(m3.path)
298182
+ children: basename17(m3.path)
298345
298183
  }, undefined, false, undefined, this)
298346
298184
  }, undefined, false, undefined, this)
298347
298185
  }, undefined, false, undefined, this),
@@ -299026,7 +298864,7 @@ var init_PrBadge = __esm(() => {
299026
298864
  });
299027
298865
 
299028
298866
  // src/components/messages/CollapsedReadSearchContent.tsx
299029
- import { basename as basename17 } from "path";
298867
+ import { basename as basename18 } from "path";
299030
298868
  function VerboseToolUse(t0) {
299031
298869
  const $2 = c3(24);
299032
298870
  const {
@@ -299287,7 +299125,7 @@ function CollapsedReadSearchContent({
299287
299125
  children: [
299288
299126
  " ⎿ ",
299289
299127
  "Recalled ",
299290
- basename17(m3.path)
299128
+ basename18(m3.path)
299291
299129
  ]
299292
299130
  }, undefined, true, undefined, this),
299293
299131
  /* @__PURE__ */ jsx_dev_runtime94.jsxDEV(ThemedBox_default, {
@@ -300002,7 +299840,7 @@ var init_pillLabel = __esm(() => {
300002
299840
  });
300003
299841
 
300004
299842
  // src/components/messages/SystemTextMessage.tsx
300005
- import { basename as basename18 } from "path";
299843
+ import { basename as basename19 } from "path";
300006
299844
  function SystemTextMessage(t0) {
300007
299845
  const $2 = c3(51);
300008
299846
  const {
@@ -300927,7 +300765,7 @@ function MemoryFileRow(t0) {
300927
300765
  const t4 = !hover;
300928
300766
  let t5;
300929
300767
  if ($2[4] !== path8) {
300930
- t5 = basename18(path8);
300768
+ t5 = basename19(path8);
300931
300769
  $2[4] = path8;
300932
300770
  $2[5] = t5;
300933
300771
  } else {
@@ -303312,11 +303150,11 @@ var init_skillUsageTracking = __esm(() => {
303312
303150
  });
303313
303151
 
303314
303152
  // src/utils/telemetry/pluginTelemetry.ts
303315
- import { createHash as createHash11 } from "crypto";
303153
+ import { createHash as createHash12 } from "crypto";
303316
303154
  import { sep as sep17 } from "path";
303317
303155
  function hashPluginId(name, marketplace) {
303318
303156
  const key = marketplace ? `${name}@${marketplace.toLowerCase()}` : name;
303319
- return createHash11("sha256").update(key + PLUGIN_ID_HASH_SALT).digest("hex").slice(0, 16);
303157
+ return createHash12("sha256").update(key + PLUGIN_ID_HASH_SALT).digest("hex").slice(0, 16);
303320
303158
  }
303321
303159
  function getTelemetryPluginScope(name, marketplace, managedNames) {
303322
303160
  if (marketplace === BUILTIN_MARKETPLACE_NAME2)
@@ -304686,7 +304524,7 @@ var init_types7 = __esm(() => {
304686
304524
 
304687
304525
  // src/tools/TodoWriteTool/prompt.ts
304688
304526
  var PROMPT5, DESCRIPTION10 = "Update the todo list for the current session. To be used proactively and often to track progress and pending tasks. Make sure that at least one task is in_progress at all times. Always provide both content (imperative) and activeForm (present continuous) for each task.";
304689
- var init_prompt14 = __esm(() => {
304527
+ var init_prompt13 = __esm(() => {
304690
304528
  PROMPT5 = `Use this tool to create and manage a structured task list for your current coding session. This helps you track progress, organize complex tasks, and demonstrate thoroughness to the user.
304691
304529
  It also helps the user understand the progress of the task and overall progress of their requests.
304692
304530
 
@@ -304877,7 +304715,7 @@ var init_TodoWriteTool = __esm(() => {
304877
304715
  init_tasks();
304878
304716
  init_types7();
304879
304717
  init_constants3();
304880
- init_prompt14();
304718
+ init_prompt13();
304881
304719
  inputSchema14 = lazySchema(() => z39.strictObject({
304882
304720
  todos: TodoListSchema().describe("The updated todo list")
304883
304721
  }));
@@ -304966,7 +304804,7 @@ var init_types8 = __esm(() => {
304966
304804
  });
304967
304805
 
304968
304806
  // src/services/policyLimits/index.ts
304969
- import { createHash as createHash12 } from "crypto";
304807
+ import { createHash as createHash13 } from "crypto";
304970
304808
  import { readFileSync as fsReadFileSync } from "fs";
304971
304809
  import { unlink as unlink7, writeFile as writeFile11 } from "fs/promises";
304972
304810
  import { join as join62 } from "path";
@@ -305012,7 +304850,7 @@ function sortKeysDeep(obj) {
305012
304850
  function computeChecksum(restrictions) {
305013
304851
  const sorted = sortKeysDeep(restrictions);
305014
304852
  const normalized = jsonStringify(sorted);
305015
- const hash = createHash12("sha256").update(normalized).digest("hex");
304853
+ const hash = createHash13("sha256").update(normalized).digest("hex");
305016
304854
  return `sha256:${hash}`;
305017
304855
  }
305018
304856
  function isPolicyLimitsEligible() {
@@ -306375,7 +306213,7 @@ var init_grove = __esm(() => {
306375
306213
  // src/utils/imagePaste.ts
306376
306214
  import { randomBytes as randomBytes8 } from "crypto";
306377
306215
  import { execa as execa8 } from "execa";
306378
- import { basename as basename19, extname as extname9, isAbsolute as isAbsolute19, join as join63 } from "path";
306216
+ import { basename as basename20, extname as extname9, isAbsolute as isAbsolute20, join as join63 } from "path";
306379
306217
  function getClipboardCommands() {
306380
306218
  const platform2 = process.platform;
306381
306219
  const baseTmpDir = process.env.CLAUDE_CODE_TMPDIR || (platform2 === "win32" ? process.env.TEMP || "C:\\Temp" : "/tmp");
@@ -306512,11 +306350,11 @@ async function tryReadImageFromPath(text) {
306512
306350
  const imagePath = cleanedPath;
306513
306351
  let imageBuffer;
306514
306352
  try {
306515
- if (isAbsolute19(imagePath)) {
306353
+ if (isAbsolute20(imagePath)) {
306516
306354
  imageBuffer = getFsImplementation().readFileBytesSync(imagePath);
306517
306355
  } else {
306518
306356
  const clipboardPath = await getImagePathFromClipboard();
306519
- if (clipboardPath && imagePath === basename19(clipboardPath)) {
306357
+ if (clipboardPath && imagePath === basename20(clipboardPath)) {
306520
306358
  imageBuffer = getFsImplementation().readFileBytesSync(clipboardPath);
306521
306359
  }
306522
306360
  }
@@ -310361,7 +310199,7 @@ var init_types9 = __esm(() => {
310361
310199
  });
310362
310200
 
310363
310201
  // src/services/remoteManagedSettings/index.ts
310364
- import { createHash as createHash13 } from "crypto";
310202
+ import { createHash as createHash14 } from "crypto";
310365
310203
  import { open as open9, unlink as unlink8 } from "fs/promises";
310366
310204
  function initializeRemoteManagedSettingsLoadingPromise() {
310367
310205
  if (loadingCompletePromise2) {
@@ -310399,7 +310237,7 @@ function sortKeysDeep2(obj) {
310399
310237
  function computeChecksumFromSettings(settings) {
310400
310238
  const sorted = sortKeysDeep2(settings);
310401
310239
  const normalized = jsonStringify(sorted);
310402
- const hash = createHash13("sha256").update(normalized).digest("hex");
310240
+ const hash = createHash14("sha256").update(normalized).digest("hex");
310403
310241
  return `sha256:${hash}`;
310404
310242
  }
310405
310243
  function isEligibleForRemoteManagedSettings() {
@@ -310787,7 +310625,7 @@ var init_user = __esm(() => {
310787
310625
  deviceId,
310788
310626
  sessionId: getSessionId(),
310789
310627
  email: getEmail(),
310790
- appVersion: "2.3.4",
310628
+ appVersion: "2.3.5",
310791
310629
  platform: getHostPlatformForAnalytics(),
310792
310630
  organizationUuid,
310793
310631
  accountUuid,
@@ -311852,7 +311690,7 @@ async function initializeBetaTracing(resource) {
311852
311690
  });
311853
311691
  logs.setGlobalLoggerProvider(loggerProvider);
311854
311692
  setLoggerProvider(loggerProvider);
311855
- const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "2.3.4");
311693
+ const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "2.3.5");
311856
311694
  setEventLogger(eventLogger);
311857
311695
  process.on("beforeExit", async () => {
311858
311696
  await loggerProvider?.forceFlush();
@@ -311892,7 +311730,7 @@ async function initializeTelemetry() {
311892
311730
  const platform2 = getPlatform();
311893
311731
  const baseAttributes = {
311894
311732
  [ATTR_SERVICE_NAME4]: "claude-code",
311895
- [ATTR_SERVICE_VERSION4]: "2.3.4"
311733
+ [ATTR_SERVICE_VERSION4]: "2.3.5"
311896
311734
  };
311897
311735
  if (platform2 === "wsl") {
311898
311736
  const wslVersion = getWslVersion();
@@ -311937,7 +311775,7 @@ async function initializeTelemetry() {
311937
311775
  } catch {}
311938
311776
  };
311939
311777
  registerCleanup(shutdownTelemetry2);
311940
- return meterProvider2.getMeter("com.anthropic.claude_code", "2.3.4");
311778
+ return meterProvider2.getMeter("com.anthropic.claude_code", "2.3.5");
311941
311779
  }
311942
311780
  const meterProvider = new MeterProvider4({
311943
311781
  resource,
@@ -311957,7 +311795,7 @@ async function initializeTelemetry() {
311957
311795
  });
311958
311796
  logs.setGlobalLoggerProvider(loggerProvider);
311959
311797
  setLoggerProvider(loggerProvider);
311960
- const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "2.3.4");
311798
+ const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "2.3.5");
311961
311799
  setEventLogger(eventLogger);
311962
311800
  logForDebugging("[3P telemetry] Event logger set successfully");
311963
311801
  process.on("beforeExit", async () => {
@@ -312019,7 +311857,7 @@ Current timeout: ${timeoutMs}ms
312019
311857
  }
312020
311858
  };
312021
311859
  registerCleanup(shutdownTelemetry);
312022
- return meterProvider.getMeter("com.anthropic.claude_code", "2.3.4");
311860
+ return meterProvider.getMeter("com.anthropic.claude_code", "2.3.5");
312023
311861
  }
312024
311862
  async function flushTelemetry() {
312025
311863
  const meterProvider = getMeterProvider();
@@ -312386,7 +312224,7 @@ var init_auth_code_listener = __esm(() => {
312386
312224
  });
312387
312225
 
312388
312226
  // src/services/oauth/crypto.ts
312389
- import { createHash as createHash14, randomBytes as randomBytes9 } from "crypto";
312227
+ import { createHash as createHash15, randomBytes as randomBytes9 } from "crypto";
312390
312228
  function base64URLEncode(buffer) {
312391
312229
  return buffer.toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
312392
312230
  }
@@ -312394,7 +312232,7 @@ function generateCodeVerifier() {
312394
312232
  return base64URLEncode(randomBytes9(32));
312395
312233
  }
312396
312234
  function generateCodeChallenge(verifier) {
312397
- const hash = createHash14("sha256");
312235
+ const hash = createHash15("sha256");
312398
312236
  hash.update(verifier);
312399
312237
  return base64URLEncode(hash.digest());
312400
312238
  }
@@ -313209,7 +313047,7 @@ function detectLinuxGlobPatternWarnings() {
313209
313047
  }
313210
313048
  async function getDoctorDiagnostic() {
313211
313049
  const installationType = await getCurrentInstallationType();
313212
- const version = typeof MACRO !== "undefined" ? "2.3.4" : "unknown";
313050
+ const version = typeof MACRO !== "undefined" ? "2.3.5" : "unknown";
313213
313051
  const installationPath = await getInstallationPath();
313214
313052
  const invokedBinary = getInvokedBinary();
313215
313053
  const multipleInstallations = await detectMultipleInstallations();
@@ -313334,7 +313172,7 @@ function getUserBinDir(options) {
313334
313172
  var init_xdg = () => {};
313335
313173
 
313336
313174
  // src/utils/nativeInstaller/download.ts
313337
- import { createHash as createHash15 } from "crypto";
313175
+ import { createHash as createHash16 } from "crypto";
313338
313176
  import { chmod as chmod5, writeFile as writeFile13 } from "fs/promises";
313339
313177
  import { join as join68 } from "path";
313340
313178
  async function getLatestVersionFromArtifactory(tag = "latest") {
@@ -313520,7 +313358,7 @@ async function downloadAndVerifyBinary(binaryUrl, expectedChecksum, binaryPath,
313520
313358
  ...requestConfig
313521
313359
  });
313522
313360
  clearStallTimer();
313523
- const hash = createHash15("sha256");
313361
+ const hash = createHash16("sha256");
313524
313362
  hash.update(response.data);
313525
313363
  const actualChecksum = hash.digest("hex");
313526
313364
  if (actualChecksum !== expectedChecksum) {
@@ -313638,7 +313476,7 @@ var init_download = __esm(() => {
313638
313476
  });
313639
313477
 
313640
313478
  // src/utils/nativeInstaller/pidLock.ts
313641
- import { basename as basename20, join as join69 } from "path";
313479
+ import { basename as basename21, join as join69 } from "path";
313642
313480
  function isPidBasedLockingEnabled() {
313643
313481
  const envVar = process.env.ENABLE_PID_BASED_VERSION_LOCKING;
313644
313482
  if (isEnvTruthy(envVar)) {
@@ -313738,7 +313576,7 @@ function writeLockFile(lockFilePath, content) {
313738
313576
  }
313739
313577
  async function tryAcquireLock(versionPath, lockFilePath) {
313740
313578
  const fs4 = getFsImplementation();
313741
- const versionName = basename20(versionPath);
313579
+ const versionName = basename21(versionPath);
313742
313580
  if (isLockActive(lockFilePath)) {
313743
313581
  const existingContent = readLockContent(lockFilePath);
313744
313582
  logForDebugging(`Cannot acquire lock for ${versionName} - held by PID ${existingContent?.pid}`);
@@ -313887,7 +313725,7 @@ import {
313887
313725
  writeFile as writeFile14
313888
313726
  } from "fs/promises";
313889
313727
  import { homedir as homedir19 } from "os";
313890
- import { basename as basename21, delimiter as delimiter3, dirname as dirname31, join as join70, resolve as resolve28 } from "path";
313728
+ import { basename as basename22, delimiter as delimiter3, dirname as dirname31, join as join70, resolve as resolve28 } from "path";
313891
313729
  function getPlatform2() {
313892
313730
  const os6 = env3.platform;
313893
313731
  const arch = process.arch === "x64" ? "x64" : process.arch === "arm64" ? "arm64" : null;
@@ -314150,8 +313988,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
314150
313988
  const maxVersion = await getMaxVersion();
314151
313989
  if (maxVersion && gt(version, maxVersion)) {
314152
313990
  logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version} to ${maxVersion}`);
314153
- if (gte("2.3.4", maxVersion)) {
314154
- logForDebugging(`Native installer: current version ${"2.3.4"} is already at or above maxVersion ${maxVersion}, skipping update`);
313991
+ if (gte("2.3.5", maxVersion)) {
313992
+ logForDebugging(`Native installer: current version ${"2.3.5"} is already at or above maxVersion ${maxVersion}, skipping update`);
314155
313993
  logEvent("tengu_native_update_skipped_max_version", {
314156
313994
  latency_ms: Date.now() - startTime,
314157
313995
  max_version: maxVersion,
@@ -314162,7 +314000,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
314162
314000
  version = maxVersion;
314163
314001
  }
314164
314002
  }
314165
- if (!forceReinstall && version === "2.3.4" && await versionIsAvailable(version) && await isPossibleLocalClawdBinary(executablePath)) {
314003
+ if (!forceReinstall && version === "2.3.5" && await versionIsAvailable(version) && await isPossibleLocalClawdBinary(executablePath)) {
314166
314004
  logForDebugging(`Found ${version} at ${executablePath}, skipping install`);
314167
314005
  logEvent("tengu_native_update_complete", {
314168
314006
  latency_ms: Date.now() - startTime,
@@ -314480,7 +314318,7 @@ async function getVersionFromSymlink(symlinkPath) {
314480
314318
  return null;
314481
314319
  }
314482
314320
  function getLockFilePathFromVersionPath(dirs, versionPath) {
314483
- const versionName = basename21(versionPath);
314321
+ const versionName = basename22(versionPath);
314484
314322
  return join70(dirs.locks, `${versionName}.lock`);
314485
314323
  }
314486
314324
  async function lockCurrentVersion() {
@@ -323355,7 +323193,7 @@ var init_sessionIngress = __esm(() => {
323355
323193
  });
323356
323194
 
323357
323195
  // src/utils/conversationRecovery.ts
323358
- import { relative as relative14 } from "path";
323196
+ import { relative as relative15 } from "path";
323359
323197
  function migrateLegacyAttachmentTypes(message) {
323360
323198
  if (message.type !== "attachment") {
323361
323199
  return message;
@@ -323367,7 +323205,7 @@ function migrateLegacyAttachmentTypes(message) {
323367
323205
  attachment: {
323368
323206
  ...attachment,
323369
323207
  type: "file",
323370
- displayPath: relative14(getCwd(), attachment.filename)
323208
+ displayPath: relative15(getCwd(), attachment.filename)
323371
323209
  }
323372
323210
  };
323373
323211
  }
@@ -323377,7 +323215,7 @@ function migrateLegacyAttachmentTypes(message) {
323377
323215
  attachment: {
323378
323216
  ...attachment,
323379
323217
  type: "directory",
323380
- displayPath: relative14(getCwd(), attachment.path)
323218
+ displayPath: relative15(getCwd(), attachment.path)
323381
323219
  }
323382
323220
  };
323383
323221
  }
@@ -323388,7 +323226,7 @@ function migrateLegacyAttachmentTypes(message) {
323388
323226
  ...message,
323389
323227
  attachment: {
323390
323228
  ...attachment,
323391
- displayPath: relative14(getCwd(), path8)
323229
+ displayPath: relative15(getCwd(), path8)
323392
323230
  }
323393
323231
  };
323394
323232
  }
@@ -323934,11 +323772,11 @@ var init_filesApi = __esm(() => {
323934
323772
  });
323935
323773
 
323936
323774
  // src/utils/tempfile.ts
323937
- import { createHash as createHash16, randomUUID as randomUUID13 } from "crypto";
323775
+ import { createHash as createHash17, randomUUID as randomUUID13 } from "crypto";
323938
323776
  import { tmpdir as tmpdir4 } from "os";
323939
323777
  import { join as join73 } from "path";
323940
323778
  function generateTempFilePath(prefix = "claude-prompt", extension2 = ".md", options) {
323941
- const id = options?.contentHash ? createHash16("sha256").update(options.contentHash).digest("hex").slice(0, 16) : randomUUID13();
323779
+ const id = options?.contentHash ? createHash17("sha256").update(options.contentHash).digest("hex").slice(0, 16) : randomUUID13();
323942
323780
  return join73(tmpdir4(), `${prefix}-${id}${extension2}`);
323943
323781
  }
323944
323782
  var init_tempfile = () => {};
@@ -326930,7 +326768,7 @@ Usage notes:
326930
326768
 
326931
326769
  ${forkEnabled ? forkExamples : currentExamples}`;
326932
326770
  }
326933
- var init_prompt15 = __esm(() => {
326771
+ var init_prompt14 = __esm(() => {
326934
326772
  init_auth2();
326935
326773
  init_embeddedTools();
326936
326774
  init_envUtils();
@@ -326997,7 +326835,7 @@ var init_AgentTool = __esm(() => {
326997
326835
  init_constants3();
326998
326836
  init_forkSubagent();
326999
326837
  init_loadAgentsDir();
327000
- init_prompt15();
326838
+ init_prompt14();
327001
326839
  init_runAgent();
327002
326840
  init_UI11();
327003
326841
  jsx_dev_runtime134 = __toESM(require_jsx_dev_runtime(), 1);
@@ -333266,9 +333104,9 @@ var require_URL2 = __commonJS((exports, module) => {
333266
333104
  s2 += "#" + this.fragment;
333267
333105
  return s2;
333268
333106
  },
333269
- resolve: function(relative15) {
333107
+ resolve: function(relative16) {
333270
333108
  var base = this;
333271
- var r2 = new URL3(relative15);
333109
+ var r2 = new URL3(relative16);
333272
333110
  var t2 = new URL3;
333273
333111
  if (r2.scheme !== undefined) {
333274
333112
  t2.scheme = r2.scheme;
@@ -345790,7 +345628,7 @@ To complete your request, I need to fetch content from the redirected URL. Pleas
345790
345628
 
345791
345629
  // src/utils/listSessionsImpl.ts
345792
345630
  import { readdir as readdir11, stat as stat25 } from "fs/promises";
345793
- import { basename as basename23, join as join74 } from "path";
345631
+ import { basename as basename24, join as join74 } from "path";
345794
345632
  async function listCandidates(projectDir, doStat, projectPath) {
345795
345633
  let names;
345796
345634
  try {
@@ -346263,7 +346101,7 @@ var BRIEF_TOOL_NAME2 = "SendUserMessage", LEGACY_BRIEF_TOOL_NAME2 = "Brief", DES
346263
346101
  \`message\` supports markdown. \`attachments\` takes file paths (absolute or cwd-relative) for images, diffs, logs.
346264
346102
 
346265
346103
  \`status\` labels intent: 'normal' when replying to what they just asked; 'proactive' when you're initiating — a scheduled task finished, a blocker surfaced during background work, you need input on something they haven't asked about. Set it honestly; downstream routing uses it.`, BRIEF_PROACTIVE_SECTION;
346266
- var init_prompt16 = __esm(() => {
346104
+ var init_prompt15 = __esm(() => {
346267
346105
  BRIEF_PROACTIVE_SECTION = `## Talking to the user
346268
346106
 
346269
346107
  ${BRIEF_TOOL_NAME2} is where your replies go. Text outside it is visible if the user expands the detail view, but most won't — assume unread. Anything you want them to actually see goes through ${BRIEF_TOOL_NAME2}. The failure mode: the real answer lives in plain text while ${BRIEF_TOOL_NAME2} just says "done!" — they see "done!" and miss everything.
@@ -346459,7 +346297,7 @@ var init_BriefTool = __esm(() => {
346459
346297
  init_envUtils();
346460
346298
  init_stringUtils();
346461
346299
  init_attachments();
346462
- init_prompt16();
346300
+ init_prompt15();
346463
346301
  init_UI15();
346464
346302
  inputSchema19 = lazySchema(() => z52.strictObject({
346465
346303
  message: z52.string().describe("The message for the user. Supports markdown formatting."),
@@ -347711,7 +347549,7 @@ var init_inProcessTeammateHelpers = __esm(() => {
347711
347549
 
347712
347550
  // src/tools/ExitPlanModeTool/prompt.ts
347713
347551
  var ASK_USER_QUESTION_TOOL_NAME2 = "AskUserQuestion", EXIT_PLAN_MODE_V2_TOOL_PROMPT;
347714
- var init_prompt17 = __esm(() => {
347552
+ var init_prompt16 = __esm(() => {
347715
347553
  EXIT_PLAN_MODE_V2_TOOL_PROMPT = `Use this tool when you are in plan mode and have finished writing your plan to the plan file and are ready for user approval.
347716
347554
 
347717
347555
  ## How This Tool Works
@@ -347887,7 +347725,7 @@ var init_ExitPlanModeTool = __esm(() => {
347887
347725
  init_teammate();
347888
347726
  init_teammateMailbox();
347889
347727
  init_constants3();
347890
- init_prompt17();
347728
+ init_prompt16();
347891
347729
  init_UI17();
347892
347730
  allowedPromptSchema = lazySchema(() => z55.object({
347893
347731
  tool: z55.enum(["Bash"]).describe("The tool this prompt applies to"),
@@ -348484,7 +348322,7 @@ ${annotation.preview}`);
348484
348322
  });
348485
348323
 
348486
348324
  // src/tools/LSPTool/formatters.ts
348487
- import { relative as relative15 } from "path";
348325
+ import { relative as relative16 } from "path";
348488
348326
  function formatUri2(uri, cwd2) {
348489
348327
  if (!uri) {
348490
348328
  logForDebugging("formatUri called with undefined URI - indicates malformed LSP server response", { level: "warn" });
@@ -348501,7 +348339,7 @@ function formatUri2(uri, cwd2) {
348501
348339
  logForDebugging(`Failed to decode LSP URI '${uri}': ${errorMsg}. Using un-decoded path: ${filePath}`, { level: "warn" });
348502
348340
  }
348503
348341
  if (cwd2) {
348504
- const relativePath = relative15(cwd2, filePath).replaceAll("\\", "/");
348342
+ const relativePath = relative16(cwd2, filePath).replaceAll("\\", "/");
348505
348343
  if (relativePath.length < filePath.length && !relativePath.startsWith("../../")) {
348506
348344
  return relativePath;
348507
348345
  }
@@ -349927,7 +349765,7 @@ function getEnterPlanModeToolPrompt() {
349927
349765
  return process.env.USER_TYPE === "ant" ? getEnterPlanModeToolPromptAnt() : getEnterPlanModeToolPromptExternal();
349928
349766
  }
349929
349767
  var WHAT_HAPPENS_SECTION;
349930
- var init_prompt18 = __esm(() => {
349768
+ var init_prompt17 = __esm(() => {
349931
349769
  init_planMode();
349932
349770
  init_prompt7();
349933
349771
  WHAT_HAPPENS_SECTION = `## What Happens in Plan Mode
@@ -350006,7 +349844,7 @@ var init_EnterPlanModeTool = __esm(() => {
350006
349844
  init_PermissionUpdate();
350007
349845
  init_permissionSetup();
350008
349846
  init_planMode();
350009
- init_prompt18();
349847
+ init_prompt17();
350010
349848
  init_UI19();
350011
349849
  inputSchema26 = lazySchema(() => z60.strictObject({}));
350012
349850
  outputSchema22 = lazySchema(() => z60.object({
@@ -350093,10 +349931,10 @@ import {
350093
349931
  } from "crypto";
350094
349932
  import { existsSync as existsSync6, mkdirSync as mkdirSync5, readFileSync as readFileSync10, writeFileSync as writeFileSync3 } from "fs";
350095
349933
  import { homedir as homedir21 } from "os";
350096
- import { basename as basename24, join as join76, resolve as resolve29 } from "path";
349934
+ import { basename as basename25, join as join76, resolve as resolve29 } from "path";
350097
349935
  function getProjectId() {
350098
349936
  const root2 = getProjectRoot();
350099
- return basename24(resolve29(root2)).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "").slice(0, 64) || "default";
349937
+ return basename25(resolve29(root2)).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "").slice(0, 64) || "default";
350100
349938
  }
350101
349939
  function getSecretsFile() {
350102
349940
  return join76(getProjectRoot(), ".localclawd", "secrets.enc");
@@ -352163,7 +352001,7 @@ ${lines.join(`
352163
352001
  }
352164
352002
  }
352165
352003
  var DESCRIPTION14 = "Get or set localclawd configuration settings.";
352166
- var init_prompt19 = __esm(() => {
352004
+ var init_prompt18 = __esm(() => {
352167
352005
  init_modelOptions();
352168
352006
  init_voiceModeEnabled();
352169
352007
  init_supportedSettings();
@@ -352288,7 +352126,7 @@ var init_ConfigTool = __esm(() => {
352288
352126
  init_log2();
352289
352127
  init_settings2();
352290
352128
  init_slowOperations();
352291
- init_prompt19();
352129
+ init_prompt18();
352292
352130
  init_supportedSettings();
352293
352131
  init_UI23();
352294
352132
  inputSchema30 = lazySchema(() => z65.strictObject({
@@ -352631,7 +352469,7 @@ ${teammateTips}- Check TaskList first to avoid creating duplicate tasks
352631
352469
  `;
352632
352470
  }
352633
352471
  var DESCRIPTION15 = "Create a new task in the task list";
352634
- var init_prompt20 = __esm(() => {
352472
+ var init_prompt19 = __esm(() => {
352635
352473
  init_agentSwarmsEnabled();
352636
352474
  });
352637
352475
 
@@ -352643,7 +352481,7 @@ var init_TaskCreateTool = __esm(() => {
352643
352481
  init_hooks5();
352644
352482
  init_tasks();
352645
352483
  init_teammate();
352646
- init_prompt20();
352484
+ init_prompt19();
352647
352485
  inputSchema31 = lazySchema(() => z66.strictObject({
352648
352486
  subject: z66.string().describe("A brief title for the task"),
352649
352487
  description: z66.string().describe("What needs to be done"),
@@ -353245,7 +353083,7 @@ Use TaskGet with a specific task ID to view full details including description a
353245
353083
  ${teammateWorkflow}`;
353246
353084
  }
353247
353085
  var DESCRIPTION18 = "List all tasks in the task list";
353248
- var init_prompt21 = __esm(() => {
353086
+ var init_prompt20 = __esm(() => {
353249
353087
  init_agentSwarmsEnabled();
353250
353088
  });
353251
353089
 
@@ -353255,7 +353093,7 @@ var inputSchema34, outputSchema30, TaskListTool;
353255
353093
  var init_TaskListTool = __esm(() => {
353256
353094
  init_Tool();
353257
353095
  init_tasks();
353258
- init_prompt21();
353096
+ init_prompt20();
353259
353097
  inputSchema34 = lazySchema(() => z69.strictObject({}));
353260
353098
  outputSchema30 = lazySchema(() => z69.object({
353261
353099
  tasks: z69.array(z69.object({
@@ -357793,11 +357631,14 @@ var init_memoryTypes = __esm(() => {
357793
357631
 
357794
357632
  // src/memdir/memoryScan.ts
357795
357633
  import { readdir as readdir13 } from "fs/promises";
357796
- import { basename as basename25, join as join81 } from "path";
357634
+ import { basename as basename26, join as join81 } from "path";
357635
+ function isTurnMemoryPath(relativePath) {
357636
+ return /(^|[/\\])turns[/\\]/.test(relativePath);
357637
+ }
357797
357638
  async function scanMemoryFiles(memoryDir, signal) {
357798
357639
  try {
357799
357640
  const entries = await readdir13(memoryDir, { recursive: true });
357800
- const mdFiles = entries.filter((f3) => f3.endsWith(".md") && basename25(f3) !== "MEMORY.md");
357641
+ const mdFiles = entries.filter((f3) => f3.endsWith(".md") && basename26(f3) !== "MEMORY.md");
357801
357642
  const headerResults = await Promise.allSettled(mdFiles.map(async (relativePath) => {
357802
357643
  const filePath = join81(memoryDir, relativePath);
357803
357644
  const { content, mtimeMs } = await readFileInRange(filePath, 0, FRONTMATTER_MAX_LINES, undefined, signal);
@@ -357811,7 +357652,10 @@ async function scanMemoryFiles(memoryDir, signal) {
357811
357652
  tags: parseTags(frontmatter.tags)
357812
357653
  };
357813
357654
  }));
357814
- return headerResults.filter((r2) => r2.status === "fulfilled").map((r2) => r2.value).sort((a, b3) => b3.mtimeMs - a.mtimeMs).slice(0, MAX_MEMORY_FILES);
357655
+ const sorted = headerResults.filter((r2) => r2.status === "fulfilled").map((r2) => r2.value).sort((a, b3) => b3.mtimeMs - a.mtimeMs);
357656
+ const curated = sorted.filter((memory) => !isTurnMemoryPath(memory.filename)).slice(0, MAX_CURATED_MEMORY_FILES);
357657
+ const turnMemories = sorted.filter((memory) => isTurnMemoryPath(memory.filename)).slice(0, MAX_TURN_MEMORY_FILES);
357658
+ return [...curated, ...turnMemories].sort((a, b3) => b3.mtimeMs - a.mtimeMs).slice(0, MAX_MEMORY_FILES);
357815
357659
  } catch {
357816
357660
  return [];
357817
357661
  }
@@ -357824,7 +357668,7 @@ function formatMemoryManifest(memories) {
357824
357668
  }).join(`
357825
357669
  `);
357826
357670
  }
357827
- var MAX_MEMORY_FILES = 200, FRONTMATTER_MAX_LINES = 30;
357671
+ var MAX_MEMORY_FILES = 240, MAX_CURATED_MEMORY_FILES = 200, MAX_TURN_MEMORY_FILES = 80, FRONTMATTER_MAX_LINES = 30;
357828
357672
  var init_memoryScan = __esm(() => {
357829
357673
  init_frontmatterParser();
357830
357674
  init_readFileInRange();
@@ -358663,7 +358507,7 @@ __export(exports_embedding, {
358663
358507
  cosine: () => cosine
358664
358508
  });
358665
358509
  import { mkdir as mkdir22, readFile as readFile29, writeFile as writeFile22 } from "fs/promises";
358666
- import { createHash as createHash17 } from "crypto";
358510
+ import { createHash as createHash18 } from "crypto";
358667
358511
  import { join as join82 } from "path";
358668
358512
  async function loadCache2() {
358669
358513
  if (_cache)
@@ -358684,7 +358528,7 @@ async function saveCache(cache3) {
358684
358528
  await writeFile22(CACHE_PATH, JSON.stringify(cache3), "utf-8");
358685
358529
  }
358686
358530
  function hashText(text) {
358687
- return createHash17("sha256").update(text).digest("hex");
358531
+ return createHash18("sha256").update(text).digest("hex");
358688
358532
  }
358689
358533
  function evictIfNeeded(cache3) {
358690
358534
  while (cache3.order.length > MAX_CACHE_ENTRIES) {
@@ -359278,7 +359122,7 @@ var init_findRelevantMemories = __esm(() => {
359278
359122
  // src/memdir/turnMemory.ts
359279
359123
  import { randomUUID as randomUUID17 } from "crypto";
359280
359124
  import { mkdir as mkdir26, readdir as readdir15, readFile as readFile33, rm as rm4, stat as stat29, writeFile as writeFile26 } from "fs/promises";
359281
- import { basename as basename26, dirname as dirname33, join as join86, relative as relative16 } from "path";
359125
+ import { basename as basename27, dirname as dirname33, join as join86, relative as relative17 } from "path";
359282
359126
  function truncate4(text, maxChars) {
359283
359127
  const cleaned = text.replace(/\s+/g, " ").trim();
359284
359128
  if (cleaned.length <= maxChars)
@@ -359349,6 +359193,22 @@ async function writeConfig(config) {
359349
359193
  await writeFile26(configPath, `${JSON.stringify({ ...config, updatedAt: new Date().toISOString() }, null, 2)}
359350
359194
  `, "utf8");
359351
359195
  }
359196
+ async function countFilesUnder(dir) {
359197
+ let fileCount = 0;
359198
+ let bytes = 0;
359199
+ try {
359200
+ const entries = await readdir15(dir, { recursive: true });
359201
+ await Promise.all(entries.map(async (entry) => {
359202
+ const path10 = join86(dir, entry);
359203
+ const info = await stat29(path10).catch(() => null);
359204
+ if (!info?.isFile())
359205
+ return;
359206
+ fileCount++;
359207
+ bytes += info.size;
359208
+ }));
359209
+ } catch {}
359210
+ return { fileCount, bytes };
359211
+ }
359352
359212
  async function setProjectMemoryEnabled(enabled) {
359353
359213
  await writeConfig({ enabled });
359354
359214
  }
@@ -359364,24 +359224,20 @@ async function clearProjectMemory() {
359364
359224
  }
359365
359225
  async function getProjectMemoryStatus() {
359366
359226
  const memoryDir = getAutoMemPath();
359367
- let fileCount = 0;
359368
- let bytes = 0;
359369
- try {
359370
- const entries = await readdir15(memoryDir, { recursive: true });
359371
- await Promise.all(entries.map(async (entry) => {
359372
- const path10 = join86(memoryDir, entry);
359373
- const info = await stat29(path10).catch(() => null);
359374
- if (!info?.isFile())
359375
- return;
359376
- fileCount++;
359377
- bytes += info.size;
359378
- }));
359379
- } catch {}
359227
+ const directoryMemoryDir = getDirectoryMemoryPath();
359228
+ const [total, directory] = await Promise.all([
359229
+ countFilesUnder(memoryDir),
359230
+ countFilesUnder(directoryMemoryDir)
359231
+ ]);
359380
359232
  return {
359381
359233
  enabled: isAutoMemoryEnabled(),
359382
359234
  memoryDir,
359383
- fileCount,
359384
- bytes
359235
+ directoryKey: getDirectoryMemoryKey(),
359236
+ directoryMemoryDir,
359237
+ fileCount: total.fileCount,
359238
+ bytes: total.bytes,
359239
+ directoryFileCount: directory.fileCount,
359240
+ directoryBytes: directory.bytes
359385
359241
  };
359386
359242
  }
359387
359243
  async function saveTurnMemory(params) {
@@ -359399,10 +359255,12 @@ async function saveTurnMemory(params) {
359399
359255
  }
359400
359256
  const now2 = new Date;
359401
359257
  const iso2 = now2.toISOString();
359258
+ const cwd2 = getOriginalCwd();
359259
+ const directoryKey = getDirectoryMemoryKey(cwd2);
359402
359260
  const id = `${iso2.replace(/[:.]/g, "-")}-${randomUUID17().slice(0, 8)}`;
359403
359261
  const tags = tagsFor(`${userText} ${assistantText} ${summary}`);
359404
359262
  const filename = `${id}-${slugify2(summary)}.md`;
359405
- const dir = join86(getAutoMemPath(), TURN_MEMORY_DIR);
359263
+ const dir = join86(getDirectoryMemoryPath(cwd2), TURN_MEMORY_DIR);
359406
359264
  const path10 = join86(dir, filename);
359407
359265
  const description = summary;
359408
359266
  const frontmatter = [
@@ -359410,6 +359268,10 @@ async function saveTurnMemory(params) {
359410
359268
  `name: ${yamlQuote(`Turn ${iso2}`)}`,
359411
359269
  `description: ${yamlQuote(description)}`,
359412
359270
  "type: project",
359271
+ "scope: directory",
359272
+ `directory_key: ${yamlQuote(directoryKey)}`,
359273
+ `cwd: ${yamlQuote(cwd2)}`,
359274
+ `project_root: ${yamlQuote(getMemoryBaseDir())}`,
359413
359275
  tags.length > 0 ? `tags: [${tags.map(yamlQuote).join(", ")}]` : "tags: []",
359414
359276
  "---",
359415
359277
  ""
@@ -359421,6 +359283,10 @@ async function saveTurnMemory(params) {
359421
359283
  "## User Request",
359422
359284
  userText || "(No user text captured.)",
359423
359285
  "",
359286
+ "## Directory",
359287
+ `- cwd: ${cwd2}`,
359288
+ `- memory key: ${directoryKey}`,
359289
+ "",
359424
359290
  "## What Was Done",
359425
359291
  assistantText || summary,
359426
359292
  ""
@@ -359437,8 +359303,8 @@ async function searchProjectMemory(query2) {
359437
359303
  const selected = relevant.length > 0 ? relevant.slice(0, MAX_SEARCH_RESULTS) : (await scanMemoryFiles(memoryDir, controller.signal)).slice(0, MAX_SEARCH_RESULTS).map((memory) => ({ path: memory.filePath, mtimeMs: memory.mtimeMs }));
359438
359304
  return Promise.all(selected.map(async (item) => {
359439
359305
  const content = await readFile33(item.path, "utf8").catch(() => "");
359440
- const title = basename26(item.path);
359441
- const rel = relative16(memoryDir, item.path);
359306
+ const title = basename27(item.path);
359307
+ const rel = relative17(memoryDir, item.path);
359442
359308
  const summary = content.split(`
359443
359309
  `).filter((line) => line.trim() && !line.startsWith("---") && !line.includes(": ")).slice(0, 4).join(" ");
359444
359310
  return `${rel || title}: ${truncate4(summary, 240)}`;
@@ -359446,6 +359312,7 @@ async function searchProjectMemory(query2) {
359446
359312
  }
359447
359313
  var TURN_MEMORY_DIR = "turns", MAX_FIELD_CHARS = 2000, MAX_SUMMARY_CHARS = 260, MAX_SEARCH_RESULTS = 8;
359448
359314
  var init_turnMemory = __esm(() => {
359315
+ init_state();
359449
359316
  init_messages3();
359450
359317
  init_paths();
359451
359318
  init_findRelevantMemories();
@@ -360415,7 +360282,7 @@ var init_query2 = __esm(() => {
360415
360282
  init_model();
360416
360283
  init_tokens();
360417
360284
  init_context();
360418
- init_prompt11();
360285
+ init_prompt10();
360419
360286
  init_postSamplingHooks();
360420
360287
  init_hooks5();
360421
360288
  init_dumpPrompts();
@@ -360503,7 +360370,7 @@ function getAnthropicEnvMetadata() {
360503
360370
  function getBuildAgeMinutes() {
360504
360371
  if (false)
360505
360372
  ;
360506
- const buildTime = new Date("2026-05-10T21:07:59.152Z").getTime();
360373
+ const buildTime = new Date("2026-06-03T02:51:00.215Z").getTime();
360507
360374
  if (isNaN(buildTime))
360508
360375
  return;
360509
360376
  return Math.floor((Date.now() - buildTime) / 60000);
@@ -361518,10 +361385,10 @@ var init_promptSuggestion = __esm(() => {
361518
361385
  });
361519
361386
 
361520
361387
  // src/utils/generatedFiles.ts
361521
- import { basename as basename27, extname as extname11, posix as posix6, sep as sep19 } from "path";
361388
+ import { basename as basename28, extname as extname11, posix as posix6, sep as sep19 } from "path";
361522
361389
  function isGeneratedFile(filePath) {
361523
361390
  const normalizedPath = posix6.sep + filePath.split(sep19).join(posix6.sep).replace(/^\/+/, "");
361524
- const fileName = basename27(filePath).toLowerCase();
361391
+ const fileName = basename28(filePath).toLowerCase();
361525
361392
  const ext = extname11(filePath).toLowerCase();
361526
361393
  if (EXCLUDED_FILENAMES.has(fileName)) {
361527
361394
  return true;
@@ -361645,9 +361512,9 @@ __export(exports_commitAttribution, {
361645
361512
  buildSurfaceKey: () => buildSurfaceKey,
361646
361513
  attributionRestoreStateFromLog: () => attributionRestoreStateFromLog
361647
361514
  });
361648
- import { createHash as createHash18, randomUUID as randomUUID19 } from "crypto";
361515
+ import { createHash as createHash19, randomUUID as randomUUID19 } from "crypto";
361649
361516
  import { stat as stat30 } from "fs/promises";
361650
- import { isAbsolute as isAbsolute20, join as join87, relative as relative17, sep as sep20 } from "path";
361517
+ import { isAbsolute as isAbsolute21, join as join87, relative as relative18, sep as sep20 } from "path";
361651
361518
  function getAttributionRepoRoot() {
361652
361519
  const cwd2 = getCwd();
361653
361520
  return findGitRoot(cwd2) ?? getOriginalCwd();
@@ -361698,12 +361565,12 @@ function buildSurfaceKey(surface, model) {
361698
361565
  return `${surface}/${getCanonicalName(model)}`;
361699
361566
  }
361700
361567
  function computeContentHash(content) {
361701
- return createHash18("sha256").update(content).digest("hex");
361568
+ return createHash19("sha256").update(content).digest("hex");
361702
361569
  }
361703
361570
  function normalizeFilePath(filePath) {
361704
361571
  const fs5 = getFsImplementation();
361705
361572
  const cwd2 = getAttributionRepoRoot();
361706
- if (!isAbsolute20(filePath)) {
361573
+ if (!isAbsolute21(filePath)) {
361707
361574
  return filePath;
361708
361575
  }
361709
361576
  let resolvedPath = filePath;
@@ -361715,15 +361582,15 @@ function normalizeFilePath(filePath) {
361715
361582
  resolvedCwd = fs5.realpathSync(cwd2);
361716
361583
  } catch {}
361717
361584
  if (resolvedPath.startsWith(resolvedCwd + sep20) || resolvedPath === resolvedCwd) {
361718
- return relative17(resolvedCwd, resolvedPath).replaceAll(sep20, "/");
361585
+ return relative18(resolvedCwd, resolvedPath).replaceAll(sep20, "/");
361719
361586
  }
361720
361587
  if (filePath.startsWith(cwd2 + sep20) || filePath === cwd2) {
361721
- return relative17(cwd2, filePath).replaceAll(sep20, "/");
361588
+ return relative18(cwd2, filePath).replaceAll(sep20, "/");
361722
361589
  }
361723
361590
  return filePath;
361724
361591
  }
361725
361592
  function expandFilePath(filePath) {
361726
- if (isAbsolute20(filePath)) {
361593
+ if (isAbsolute21(filePath)) {
361727
361594
  return filePath;
361728
361595
  }
361729
361596
  return join87(getAttributionRepoRoot(), filePath);
@@ -363900,7 +363767,7 @@ var init_queryHelpers = __esm(() => {
363900
363767
  import { randomUUID as randomUUID20 } from "crypto";
363901
363768
  import { rm as rm5 } from "fs";
363902
363769
  import { appendFile as appendFile3, copyFile as copyFile5, mkdir as mkdir27 } from "fs/promises";
363903
- import { dirname as dirname34, isAbsolute as isAbsolute21, join as join88, relative as relative18 } from "path";
363770
+ import { dirname as dirname34, isAbsolute as isAbsolute22, join as join88, relative as relative19 } from "path";
363904
363771
  function safeRemoveOverlay(overlayPath) {
363905
363772
  rm5(overlayPath, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 }, () => {});
363906
363773
  }
@@ -364151,8 +364018,8 @@ async function startSpeculation(suggestionText, context5, setAppState, isPipelin
364151
364018
  const pathKey = "notebook_path" in input ? "notebook_path" : ("path" in input) ? "path" : "file_path";
364152
364019
  const filePath = input[pathKey];
364153
364020
  if (filePath) {
364154
- const rel = relative18(cwd2, filePath);
364155
- if (isAbsolute21(rel) || rel.startsWith("..")) {
364021
+ const rel = relative19(cwd2, filePath);
364022
+ if (isAbsolute22(rel) || rel.startsWith("..")) {
364156
364023
  if (isWriteTool) {
364157
364024
  logForDebugging(`[Speculation] Denied ${tool.name}: path outside cwd: ${filePath}`);
364158
364025
  return denySpeculation("Write outside cwd not allowed during speculation", "speculation_write_outside_root");
@@ -365649,7 +365516,7 @@ function getSimplePrompt() {
365649
365516
  ].join(`
365650
365517
  `);
365651
365518
  }
365652
- var init_prompt22 = __esm(() => {
365519
+ var init_prompt21 = __esm(() => {
365653
365520
  init_prompts2();
365654
365521
  init_attribution();
365655
365522
  init_embeddedTools();
@@ -366100,7 +365967,7 @@ var init_BashTool = __esm(() => {
366100
365967
  init_gitOperationTracking();
366101
365968
  init_bashPermissions();
366102
365969
  init_commandSemantics2();
366103
- init_prompt22();
365970
+ init_prompt21();
366104
365971
  init_readOnlyValidation2();
366105
365972
  init_sedEditParser();
366106
365973
  init_shouldUseSandbox();
@@ -369747,7 +369614,7 @@ var init_messages3 = __esm(() => {
369747
369614
  });
369748
369615
 
369749
369616
  // src/services/vcr.ts
369750
- import { createHash as createHash19, randomUUID as randomUUID22 } from "crypto";
369617
+ import { createHash as createHash20, randomUUID as randomUUID22 } from "crypto";
369751
369618
  import { mkdir as mkdir28, readFile as readFile34, writeFile as writeFile27 } from "fs/promises";
369752
369619
  import { dirname as dirname35, join as join89 } from "path";
369753
369620
  function shouldUseVCR() {
@@ -369761,7 +369628,7 @@ async function withFixture(input, fixtureName, f3) {
369761
369628
  if (!shouldUseVCR()) {
369762
369629
  return await f3();
369763
369630
  }
369764
- const hash = createHash19("sha1").update(jsonStringify(input)).digest("hex").slice(0, 12);
369631
+ const hash = createHash20("sha1").update(jsonStringify(input)).digest("hex").slice(0, 12);
369765
369632
  const filename = join89(process.env.CLAUDE_CODE_TEST_FIXTURES_ROOT ?? getCwd(), `fixtures/${fixtureName}-${hash}.json`);
369766
369633
  try {
369767
369634
  const cached2 = jsonParse(await readFile34(filename, { encoding: "utf8" }));
@@ -369796,7 +369663,7 @@ async function withVCR(messages, f3) {
369796
369663
  return true;
369797
369664
  }));
369798
369665
  const dehydratedInput = mapMessages(messagesForAPI.map((_2) => _2.message.content), dehydrateValue);
369799
- const filename = join89(process.env.CLAUDE_CODE_TEST_FIXTURES_ROOT ?? getCwd(), `fixtures/${dehydratedInput.map((_2) => createHash19("sha1").update(jsonStringify(_2)).digest("hex").slice(0, 6)).join("-")}.json`);
369666
+ const filename = join89(process.env.CLAUDE_CODE_TEST_FIXTURES_ROOT ?? getCwd(), `fixtures/${dehydratedInput.map((_2) => createHash20("sha1").update(jsonStringify(_2)).digest("hex").slice(0, 6)).join("-")}.json`);
369800
369667
  try {
369801
369668
  const cached2 = jsonParse(await readFile34(filename, { encoding: "utf8" }));
369802
369669
  cached2.output.forEach(addCachedCostToTotalSessionCost);
@@ -371799,7 +371666,7 @@ function isHumanTurn(m3) {
371799
371666
 
371800
371667
  // src/utils/attachments.ts
371801
371668
  import { readdir as readdir18, stat as stat33 } from "fs/promises";
371802
- import { dirname as dirname36, parse as parse7, relative as relative19, resolve as resolve30 } from "path";
371669
+ import { dirname as dirname36, parse as parse7, relative as relative20, resolve as resolve30 } from "path";
371803
371670
  import { randomUUID as randomUUID24 } from "crypto";
371804
371671
  async function getAttachments(input, toolUseContext, ideSelection, queuedCommands, messages, querySource, options) {
371805
371672
  if (isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_ATTACHMENTS) || isEnvTruthy(process.env.CLAUDE_CODE_SIMPLE)) {
@@ -372164,7 +372031,7 @@ async function getSelectedLinesFromIDE(ideSelection, toolUseContext) {
372164
372031
  lineEnd: ideSelection.lineStart + ideSelection.lineCount - 1,
372165
372032
  filename: ideSelection.filePath,
372166
372033
  content: ideSelection.text,
372167
- displayPath: relative19(getCwd(), ideSelection.filePath)
372034
+ displayPath: relative20(getCwd(), ideSelection.filePath)
372168
372035
  }
372169
372036
  ];
372170
372037
  }
@@ -372203,7 +372070,7 @@ function memoryFilesToAttachments(memoryFiles, toolUseContext, triggerFilePath)
372203
372070
  type: "nested_memory",
372204
372071
  path: memoryFile.path,
372205
372072
  content: memoryFile,
372206
- displayPath: relative19(getCwd(), memoryFile.path)
372073
+ displayPath: relative20(getCwd(), memoryFile.path)
372207
372074
  });
372208
372075
  toolUseContext.loadedNestedMemoryPaths?.add(memoryFile.path);
372209
372076
  toolUseContext.readFileState.set(memoryFile.path, {
@@ -372299,7 +372166,7 @@ async function processAtMentionedFiles(input, toolUseContext) {
372299
372166
  type: "directory",
372300
372167
  path: absoluteFilename,
372301
372168
  content: stdout,
372302
- displayPath: relative19(getCwd(), absoluteFilename)
372169
+ displayPath: relative20(getCwd(), absoluteFilename)
372303
372170
  };
372304
372171
  } catch {
372305
372172
  return null;
@@ -372467,9 +372334,9 @@ async function getRelevantMemoryAttachments(input, agents, readFileState, recent
372467
372334
  const agentDef = agents.find((def) => def.agentType === agentType);
372468
372335
  return agentDef?.memory ? [getAgentMemoryDir(agentType, agentDef.memory)] : [];
372469
372336
  });
372470
- const dirs = memoryDirs.length > 0 ? memoryDirs : [getAutoMemPath()];
372337
+ const dirs = memoryDirs.length > 0 ? memoryDirs : [getDirectoryMemoryPath(), getAutoMemPath()];
372471
372338
  const allResults = await Promise.all(dirs.map((dir) => findRelevantMemories(input, dir, signal, recentTools, alreadySurfaced).catch(() => [])));
372472
- const selected = allResults.flat().filter((m3) => !readFileState.has(m3.path) && !alreadySurfaced.has(m3.path)).slice(0, 5);
372339
+ const selected = [...new Map(allResults.flat().map((memory) => [memory.path, memory])).values()].filter((m3) => !readFileState.has(m3.path) && !alreadySurfaced.has(m3.path)).slice(0, 5);
372473
372340
  const memories = await readMemoriesForSurfacing(selected, signal);
372474
372341
  if (memories.length === 0) {
372475
372342
  return [];
@@ -372645,7 +372512,7 @@ async function getDynamicSkillAttachments(toolUseContext) {
372645
372512
  type: "dynamic_skill",
372646
372513
  skillDir,
372647
372514
  skillNames,
372648
- displayPath: relative19(getCwd(), skillDir)
372515
+ displayPath: relative20(getCwd(), skillDir)
372649
372516
  });
372650
372517
  }
372651
372518
  }
@@ -372832,7 +372699,7 @@ async function tryGetPDFReference(filename) {
372832
372699
  filename,
372833
372700
  pageCount: effectivePageCount,
372834
372701
  fileSize: stats.size,
372835
- displayPath: relative19(getCwd(), filename)
372702
+ displayPath: relative20(getCwd(), filename)
372836
372703
  };
372837
372704
  }
372838
372705
  } catch {}
@@ -372872,7 +372739,7 @@ async function generateFileAttachment(filename, toolUseContext, successEventName
372872
372739
  return {
372873
372740
  type: "already_read_file",
372874
372741
  filename,
372875
- displayPath: relative19(getCwd(), filename),
372742
+ displayPath: relative20(getCwd(), filename),
372876
372743
  content: {
372877
372744
  type: "text",
372878
372745
  file: {
@@ -372900,7 +372767,7 @@ async function generateFileAttachment(filename, toolUseContext, successEventName
372900
372767
  return {
372901
372768
  type: "compact_file_reference",
372902
372769
  filename,
372903
- displayPath: relative19(getCwd(), filename)
372770
+ displayPath: relative20(getCwd(), filename)
372904
372771
  };
372905
372772
  }
372906
372773
  const appState2 = toolUseContext.getAppState();
@@ -372920,7 +372787,7 @@ async function generateFileAttachment(filename, toolUseContext, successEventName
372920
372787
  filename,
372921
372788
  content: result.data,
372922
372789
  truncated: true,
372923
- displayPath: relative19(getCwd(), filename)
372790
+ displayPath: relative20(getCwd(), filename)
372924
372791
  };
372925
372792
  } catch {
372926
372793
  logEvent(errorEventName, {});
@@ -372938,7 +372805,7 @@ async function generateFileAttachment(filename, toolUseContext, successEventName
372938
372805
  type: "file",
372939
372806
  filename,
372940
372807
  content: result.data,
372941
- displayPath: relative19(getCwd(), filename)
372808
+ displayPath: relative20(getCwd(), filename)
372942
372809
  };
372943
372810
  } catch (error5) {
372944
372811
  if (error5 instanceof MaxFileReadTokenExceededError || error5 instanceof FileTooLargeError) {
@@ -373363,7 +373230,7 @@ var init_attachments2 = __esm(() => {
373363
373230
  init_file();
373364
373231
  init_loadAgentsDir();
373365
373232
  init_constants3();
373366
- init_prompt15();
373233
+ init_prompt14();
373367
373234
  init_permissions2();
373368
373235
  init_auth2();
373369
373236
  init_mcpStringUtils();
@@ -373417,22 +373284,22 @@ var init_attachments2 = __esm(() => {
373417
373284
  });
373418
373285
 
373419
373286
  // src/utils/plugins/loadPluginCommands.ts
373420
- import { basename as basename29, dirname as dirname37, join as join92 } from "path";
373287
+ import { basename as basename30, dirname as dirname37, join as join92 } from "path";
373421
373288
  function isSkillFile2(filePath) {
373422
- return /^skill\.md$/i.test(basename29(filePath));
373289
+ return /^skill\.md$/i.test(basename30(filePath));
373423
373290
  }
373424
373291
  function getCommandNameFromFile(filePath, baseDir, pluginName) {
373425
373292
  const isSkill = isSkillFile2(filePath);
373426
373293
  if (isSkill) {
373427
373294
  const skillDirectory = dirname37(filePath);
373428
373295
  const parentOfSkillDir = dirname37(skillDirectory);
373429
- const commandBaseName = basename29(skillDirectory);
373296
+ const commandBaseName = basename30(skillDirectory);
373430
373297
  const relativePath = parentOfSkillDir.startsWith(baseDir) ? parentOfSkillDir.slice(baseDir.length).replace(/^\//, "") : "";
373431
373298
  const namespace = relativePath ? relativePath.split("/").join(":") : "";
373432
373299
  return namespace ? `${pluginName}:${namespace}:${commandBaseName}` : `${pluginName}:${commandBaseName}`;
373433
373300
  } else {
373434
373301
  const fileDirectory = dirname37(filePath);
373435
- const commandBaseName = basename29(filePath).replace(/\.md$/, "");
373302
+ const commandBaseName = basename30(filePath).replace(/\.md$/, "");
373436
373303
  const relativePath = fileDirectory.startsWith(baseDir) ? fileDirectory.slice(baseDir.length).replace(/^\//, "") : "";
373437
373304
  const namespace = relativePath ? relativePath.split("/").join(":") : "";
373438
373305
  return namespace ? `${pluginName}:${namespace}:${commandBaseName}` : `${pluginName}:${commandBaseName}`;
@@ -373469,7 +373336,7 @@ function transformPluginSkillFiles(files) {
373469
373336
  if (skillFiles.length > 0) {
373470
373337
  const skillFile = skillFiles[0];
373471
373338
  if (skillFiles.length > 1) {
373472
- logForDebugging(`Multiple skill files found in ${dir}, using ${basename29(skillFile.filePath)}`);
373339
+ logForDebugging(`Multiple skill files found in ${dir}, using ${basename30(skillFile.filePath)}`);
373473
373340
  }
373474
373341
  result.push(skillFile);
373475
373342
  } else {
@@ -373616,7 +373483,7 @@ async function loadSkillsFromDirectory(skillsPath, pluginName, sourceName, plugi
373616
373483
  }
373617
373484
  try {
373618
373485
  const { frontmatter, content: markdownContent } = parseFrontmatter(directSkillContent, directSkillPath);
373619
- const skillName = `${pluginName}:${basename29(skillsPath)}`;
373486
+ const skillName = `${pluginName}:${basename30(skillsPath)}`;
373620
373487
  const file = {
373621
373488
  filePath: directSkillPath,
373622
373489
  baseDir: dirname37(directSkillPath),
@@ -373762,7 +373629,7 @@ var init_loadPluginCommands = __esm(() => {
373762
373629
  }
373763
373630
  }
373764
373631
  if (!commandName) {
373765
- commandName = `${plugin.name}:${basename29(commandPath).replace(/\.md$/, "")}`;
373632
+ commandName = `${plugin.name}:${basename30(commandPath).replace(/\.md$/, "")}`;
373766
373633
  }
373767
373634
  const finalFrontmatter = metadataOverride ? {
373768
373635
  ...frontmatter,
@@ -373906,7 +373773,7 @@ import {
373906
373773
  writeFile as writeFile28
373907
373774
  } from "fs/promises";
373908
373775
  import { tmpdir as tmpdir6 } from "os";
373909
- import { basename as basename30, dirname as dirname38, join as join93 } from "path";
373776
+ import { basename as basename31, dirname as dirname38, join as join93 } from "path";
373910
373777
  function isPluginZipCacheEnabled() {
373911
373778
  return isEnvTruthy(process.env.CLAUDE_CODE_PLUGIN_USE_ZIP_CACHE);
373912
373779
  }
@@ -373971,7 +373838,7 @@ async function cleanupSessionPluginCache() {
373971
373838
  async function atomicWriteToZipCache(targetPath, data) {
373972
373839
  const dir = dirname38(targetPath);
373973
373840
  await getFsImplementation().mkdir(dir);
373974
- const tmpName = `.${basename30(targetPath)}.tmp.${randomBytes12(4).toString("hex")}`;
373841
+ const tmpName = `.${basename31(targetPath)}.tmp.${randomBytes12(4).toString("hex")}`;
373975
373842
  const tmpPath = join93(dir, tmpName);
373976
373843
  try {
373977
373844
  if (typeof data === "string") {
@@ -374676,7 +374543,7 @@ var init_officialMarketplaceGcs = __esm(() => {
374676
374543
 
374677
374544
  // src/utils/plugins/marketplaceManager.ts
374678
374545
  import { writeFile as writeFile31 } from "fs/promises";
374679
- import { basename as basename31, dirname as dirname40, isAbsolute as isAbsolute22, join as join96, resolve as resolve32, sep as sep22 } from "path";
374546
+ import { basename as basename32, dirname as dirname40, isAbsolute as isAbsolute23, join as join96, resolve as resolve32, sep as sep22 } from "path";
374680
374547
  function getKnownMarketplacesFile() {
374681
374548
  return join96(getPluginsDirectory(), "known_marketplaces.json");
374682
374549
  }
@@ -375257,7 +375124,7 @@ Technical details: ${error5.message}`);
375257
375124
  });
375258
375125
  }
375259
375126
  function getCachePathForSource(source) {
375260
- const tempName = source.source === "github" ? source.repo.replace("/", "-") : source.source === "npm" ? source.package.replace("@", "").replace("/", "-") : source.source === "file" ? basename31(source.path).replace(".json", "") : source.source === "directory" ? basename31(source.path) : "temp_" + Date.now();
375127
+ const tempName = source.source === "github" ? source.repo.replace("/", "-") : source.source === "npm" ? source.package.replace("@", "").replace("/", "-") : source.source === "file" ? basename32(source.path).replace(".json", "") : source.source === "directory" ? basename32(source.path) : "temp_" + Date.now();
375261
375128
  return tempName;
375262
375129
  }
375263
375130
  async function parseFileWithSchema(filePath, schema) {
@@ -375430,7 +375297,7 @@ Technical details: ${errorMsg}`);
375430
375297
  }
375431
375298
  async function addMarketplaceSource(source, onProgress) {
375432
375299
  let resolvedSource = source;
375433
- if (isLocalMarketplaceSource(source) && !isAbsolute22(source.path)) {
375300
+ if (isLocalMarketplaceSource(source) && !isAbsolute23(source.path)) {
375434
375301
  resolvedSource = { ...source, path: resolve32(source.path) };
375435
375302
  }
375436
375303
  if (!isSourceAllowedByPolicy(resolvedSource)) {
@@ -375842,7 +375709,7 @@ var init_marketplaceManager = __esm(() => {
375842
375709
  if (!entry) {
375843
375710
  throw new Error(`Marketplace '${name}' not found in configuration. Available marketplaces: ${Object.keys(config).join(", ")}`);
375844
375711
  }
375845
- if (isLocalMarketplaceSource(entry.source) && !isAbsolute22(entry.source.path)) {
375712
+ if (isLocalMarketplaceSource(entry.source) && !isAbsolute23(entry.source.path)) {
375846
375713
  throw new Error(`Marketplace "${name}" has a relative source path (${entry.source.path}) ` + `in known_marketplaces.json — this is stale state from an older ` + `localclawd version. Run 'claude marketplace remove ${name}' and ` + `re-add it from the original project directory.`);
375847
375714
  }
375848
375715
  try {
@@ -376387,7 +376254,7 @@ var init_managedPlugins = __esm(() => {
376387
376254
  });
376388
376255
 
376389
376256
  // src/utils/plugins/pluginVersioning.ts
376390
- import { createHash as createHash20 } from "crypto";
376257
+ import { createHash as createHash21 } from "crypto";
376391
376258
  async function calculatePluginVersion(pluginId, source, manifest, installPath, providedVersion, gitCommitSha) {
376392
376259
  if (manifest?.version) {
376393
376260
  logForDebugging(`Using manifest version for ${pluginId}: ${manifest.version}`);
@@ -376401,7 +376268,7 @@ async function calculatePluginVersion(pluginId, source, manifest, installPath, p
376401
376268
  const shortSha = gitCommitSha.substring(0, 12);
376402
376269
  if (typeof source === "object" && source.source === "git-subdir") {
376403
376270
  const normPath = source.path.replace(/\\/g, "/").replace(/^\.\//, "").replace(/\/+$/, "");
376404
- const pathHash = createHash20("sha256").update(normPath).digest("hex").substring(0, 8);
376271
+ const pathHash = createHash21("sha256").update(normPath).digest("hex").substring(0, 8);
376405
376272
  const v2 = `${shortSha}-${pathHash}`;
376406
376273
  logForDebugging(`Using git-subdir SHA+path version for ${pluginId}: ${v2} (path=${normPath})`);
376407
376274
  return v2;
@@ -376690,7 +376557,7 @@ import {
376690
376557
  stat as stat36,
376691
376558
  symlink as symlink3
376692
376559
  } from "fs/promises";
376693
- import { basename as basename32, dirname as dirname43, join as join99, relative as relative20, resolve as resolve34, sep as sep24 } from "path";
376560
+ import { basename as basename33, dirname as dirname43, join as join99, relative as relative21, resolve as resolve34, sep as sep24 } from "path";
376694
376561
  function getPluginCachePath() {
376695
376562
  return join99(getPluginsDirectory(), "cache");
376696
376563
  }
@@ -376760,9 +376627,9 @@ async function copyDir(src, dest) {
376760
376627
  }
376761
376628
  const srcPrefix = resolvedSrc.endsWith(sep24) ? resolvedSrc : resolvedSrc + sep24;
376762
376629
  if (resolvedTarget.startsWith(srcPrefix) || resolvedTarget === resolvedSrc) {
376763
- const targetRelativeToSrc = relative20(resolvedSrc, resolvedTarget);
376630
+ const targetRelativeToSrc = relative21(resolvedSrc, resolvedTarget);
376764
376631
  const destTargetPath = join99(dest, targetRelativeToSrc);
376765
- const relativeLinkPath = relative20(dirname43(destPath), destTargetPath);
376632
+ const relativeLinkPath = relative21(dirname43(destPath), destTargetPath);
376766
376633
  await symlink3(relativeLinkPath, destPath);
376767
376634
  } else {
376768
376635
  await symlink3(resolvedTarget, destPath);
@@ -378055,7 +377922,7 @@ async function loadSessionOnlyPlugins(sessionPluginPaths) {
378055
377922
  });
378056
377923
  continue;
378057
377924
  }
378058
- const dirName = basename32(resolvedPath);
377925
+ const dirName = basename33(resolvedPath);
378059
377926
  const { plugin, errors: pluginErrors } = await createPluginFromPath(resolvedPath, `${dirName}@inline`, true, dirName);
378060
377927
  plugin.source = `${plugin.name}@inline`;
378061
377928
  plugin.repository = `${plugin.name}@inline`;
@@ -378227,7 +378094,7 @@ var init_pluginLoader = __esm(() => {
378227
378094
  });
378228
378095
 
378229
378096
  // src/utils/plugins/loadPluginOutputStyles.ts
378230
- import { basename as basename33 } from "path";
378097
+ import { basename as basename34 } from "path";
378231
378098
  async function loadOutputStylesFromDirectory(outputStylesPath, pluginName, loadedPaths) {
378232
378099
  const styles5 = [];
378233
378100
  await walkPluginMarkdown(outputStylesPath, async (fullPath) => {
@@ -378245,7 +378112,7 @@ async function loadOutputStyleFromFile(filePath, pluginName, loadedPaths) {
378245
378112
  try {
378246
378113
  const content = await fs5.readFile(filePath, { encoding: "utf-8" });
378247
378114
  const { frontmatter, content: markdownContent } = parseFrontmatter(content, filePath);
378248
- const fileName = basename33(filePath, ".md");
378115
+ const fileName = basename34(filePath, ".md");
378249
378116
  const baseStyleName = frontmatter.name || fileName;
378250
378117
  const name = `${pluginName}:${baseStyleName}`;
378251
378118
  const description = coerceDescriptionToString(frontmatter.description, name) ?? extractDescriptionFromMarkdown(markdownContent, `Output style from ${pluginName} plugin`);
@@ -378326,7 +378193,7 @@ var init_loadPluginOutputStyles = __esm(() => {
378326
378193
  });
378327
378194
 
378328
378195
  // src/outputStyles/loadOutputStylesDir.ts
378329
- import { basename as basename34 } from "path";
378196
+ import { basename as basename35 } from "path";
378330
378197
  var getOutputStyleDirStyles;
378331
378198
  var init_loadOutputStylesDir = __esm(() => {
378332
378199
  init_memoize();
@@ -378340,7 +378207,7 @@ var init_loadOutputStylesDir = __esm(() => {
378340
378207
  const markdownFiles = await loadMarkdownFilesForSubdir("output-styles", cwd2);
378341
378208
  const styles5 = markdownFiles.map(({ filePath, frontmatter, content, source }) => {
378342
378209
  try {
378343
- const fileName = basename34(filePath);
378210
+ const fileName = basename35(filePath);
378344
378211
  const styleName = fileName.replace(/\.md$/, "");
378345
378212
  const name = frontmatter["name"] || styleName;
378346
378213
  const description = coerceDescriptionToString(frontmatter["description"], styleName) ?? extractDescriptionFromMarkdown(content, `Custom ${styleName} output style`);
@@ -378984,7 +378851,7 @@ var init_prompts2 = __esm(() => {
378984
378851
  init_betas2();
378985
378852
  init_forkSubagent();
378986
378853
  init_systemPromptSections();
378987
- init_prompt11();
378854
+ init_prompt10();
378988
378855
  init_xml();
378989
378856
  init_debug();
378990
378857
  init_thinkharder();
@@ -379001,7 +378868,7 @@ function isFeedbackSurveyDisabled() {
379001
378868
  }
379002
378869
 
379003
378870
  // src/utils/api.ts
379004
- import { createHash as createHash21 } from "crypto";
378871
+ import { createHash as createHash22 } from "crypto";
379005
378872
  function filterSwarmFieldsFromSchema(toolName, schema) {
379006
378873
  const fieldsToRemove = SWARM_FIELDS_BY_TOOL[toolName];
379007
378874
  if (!fieldsToRemove || fieldsToRemove.length === 0) {
@@ -379091,7 +378958,7 @@ function logAPIPrefix(systemPrompt) {
379091
378958
  logEvent("tengu_sysprompt_block", {
379092
378959
  snippet: firstSystemPrompt?.slice(0, 20),
379093
378960
  length: firstSystemPrompt?.length ?? 0,
379094
- hash: firstSystemPrompt ? createHash21("sha256").update(firstSystemPrompt).digest("hex") : ""
378961
+ hash: firstSystemPrompt ? createHash22("sha256").update(firstSystemPrompt).digest("hex") : ""
379095
378962
  });
379096
378963
  }
379097
378964
  function splitSysPromptPrefix(systemPrompt, options) {
@@ -382663,7 +382530,7 @@ var init_permissions2 = __esm(() => {
382663
382530
  });
382664
382531
 
382665
382532
  // src/utils/permissions/permissionSetup.ts
382666
- import { relative as relative21 } from "path";
382533
+ import { relative as relative22 } from "path";
382667
382534
  import { resolve as resolve35 } from "path";
382668
382535
  function isDangerousBashPermission(toolName, ruleContent) {
382669
382536
  if (toolName !== BASH_TOOL_NAME) {
@@ -382767,7 +382634,7 @@ function formatPermissionSource(source) {
382767
382634
  if (SETTING_SOURCES.includes(source)) {
382768
382635
  const filePath = getSettingsFilePathForSource(source);
382769
382636
  if (filePath) {
382770
- const relativePath = relative21(getCwd(), filePath);
382637
+ const relativePath = relative22(getCwd(), filePath);
382771
382638
  return relativePath.length < filePath.length ? relativePath : filePath;
382772
382639
  }
382773
382640
  }
@@ -384389,14 +384256,14 @@ var init_terminalSetup = __esm(() => {
384389
384256
  });
384390
384257
 
384391
384258
  // src/utils/pasteStore.ts
384392
- import { createHash as createHash22 } from "crypto";
384259
+ import { createHash as createHash23 } from "crypto";
384393
384260
  import { mkdir as mkdir32, readdir as readdir22, readFile as readFile40, stat as stat38, unlink as unlink15, writeFile as writeFile33 } from "fs/promises";
384394
384261
  import { join as join105 } from "path";
384395
384262
  function getPasteStoreDir() {
384396
384263
  return join105(getClaudeConfigHomeDir(), PASTE_STORE_DIR);
384397
384264
  }
384398
384265
  function hashPastedText(content) {
384399
- return createHash22("sha256").update(content).digest("hex").slice(0, 16);
384266
+ return createHash23("sha256").update(content).digest("hex").slice(0, 16);
384400
384267
  }
384401
384268
  function getPastePath(hash) {
384402
384269
  return join105(getPasteStoreDir(), `${hash}.txt`);
@@ -386202,7 +386069,7 @@ var init_renderPlaceholder = __esm(() => {
386202
386069
  });
386203
386070
 
386204
386071
  // src/hooks/usePasteHandler.ts
386205
- import { basename as basename35 } from "path";
386072
+ import { basename as basename36 } from "path";
386206
386073
  function usePasteHandler({
386207
386074
  onPaste,
386208
386075
  onInput,
@@ -386253,7 +386120,7 @@ function usePasteHandler({
386253
386120
  const validImages = results.filter((r2) => r2 !== null);
386254
386121
  if (validImages.length > 0) {
386255
386122
  for (const imageData of validImages) {
386256
- const filename = basename35(imageData.path);
386123
+ const filename = basename36(imageData.path);
386257
386124
  onImagePaste2(imageData.base64, imageData.mediaType, filename, imageData.dimensions, imageData.path);
386258
386125
  }
386259
386126
  const nonImageLines = lines.filter((line) => !isImageFilePath(line));
@@ -386856,7 +386723,7 @@ var init_TextInput = __esm(() => {
386856
386723
  });
386857
386724
 
386858
386725
  // src/utils/suggestions/directoryCompletion.ts
386859
- import { basename as basename36, dirname as dirname46, join as join107, sep as sep25 } from "path";
386726
+ import { basename as basename37, dirname as dirname46, join as join107, sep as sep25 } from "path";
386860
386727
  function parsePartialPath(partialPath, basePath) {
386861
386728
  if (!partialPath) {
386862
386729
  const directory2 = basePath || getCwd();
@@ -386867,7 +386734,7 @@ function parsePartialPath(partialPath, basePath) {
386867
386734
  return { directory: resolved, prefix: "" };
386868
386735
  }
386869
386736
  const directory = dirname46(resolved);
386870
- const prefix = basename36(partialPath);
386737
+ const prefix = basename37(partialPath);
386871
386738
  return { directory, prefix };
386872
386739
  }
386873
386740
  async function scanDirectory(dirPath) {
@@ -388532,7 +388399,7 @@ function Feedback({
388532
388399
  platform: env3.platform,
388533
388400
  gitRepo: envInfo.isGit,
388534
388401
  terminal: env3.terminal,
388535
- version: "2.3.4",
388402
+ version: "2.3.5",
388536
388403
  transcript: normalizeMessagesForAPI(messages),
388537
388404
  errors: sanitizedErrors,
388538
388405
  lastApiRequest: getLastAPIRequest(),
@@ -388724,7 +388591,7 @@ function Feedback({
388724
388591
  ", ",
388725
388592
  env3.terminal,
388726
388593
  ", v",
388727
- "2.3.4"
388594
+ "2.3.5"
388728
388595
  ]
388729
388596
  }, undefined, true, undefined, this)
388730
388597
  ]
@@ -388830,7 +388697,7 @@ ${sanitizedDescription}
388830
388697
  ` + `**Environment Info**
388831
388698
  ` + `- Platform: ${env3.platform}
388832
388699
  ` + `- Terminal: ${env3.terminal}
388833
- ` + `- Version: ${"2.3.4"}
388700
+ ` + `- Version: ${"2.3.5"}
388834
388701
  ` + `- Feedback ID: ${feedbackId}
388835
388702
  ` + `
388836
388703
  **Errors**
@@ -391439,7 +391306,7 @@ function buildPrimarySection() {
391439
391306
  }, undefined, false, undefined, this);
391440
391307
  return [{
391441
391308
  label: "Version",
391442
- value: "2.3.4"
391309
+ value: "2.3.5"
391443
391310
  }, {
391444
391311
  label: "Session name",
391445
391312
  value: nameValue
@@ -396122,7 +395989,7 @@ function Config({
396122
395989
  }
396123
395990
  }, undefined, false, undefined, this)
396124
395991
  }, undefined, false, undefined, this) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_dev_runtime176.jsxDEV(ChannelDowngradeDialog, {
396125
- currentVersion: "2.3.4",
395992
+ currentVersion: "2.3.5",
396126
395993
  onChoice: (choice) => {
396127
395994
  setShowSubmenu(null);
396128
395995
  setTabsHidden(false);
@@ -396134,7 +396001,7 @@ function Config({
396134
396001
  autoUpdatesChannel: "stable"
396135
396002
  };
396136
396003
  if (choice === "stay") {
396137
- newSettings.minimumVersion = "2.3.4";
396004
+ newSettings.minimumVersion = "2.3.5";
396138
396005
  }
396139
396006
  updateSettingsForSource("userSettings", newSettings);
396140
396007
  setSettingsData((prev_27) => ({
@@ -402540,12 +402407,12 @@ var call19 = async (onDone, _context, args) => {
402540
402407
  const destArg = parts.slice(1).join(" ");
402541
402408
  const srcPath = srcName.includes("/") || srcName.includes("\\") ? srcName : join113(defaultOutputDir, srcName);
402542
402409
  const { copyFile: copyFile9, rename: rename7 } = await import("fs/promises");
402543
- const { basename: basename37 } = await import("path");
402410
+ const { basename: basename38 } = await import("path");
402544
402411
  let destPath;
402545
402412
  if (!destArg) {
402546
- destPath = join113(projectRoot, basename37(srcName));
402413
+ destPath = join113(projectRoot, basename38(srcName));
402547
402414
  } else if (!destArg.includes("/") && !destArg.includes("\\") && !destArg.includes(".")) {
402548
- destPath = join113(projectRoot, destArg, basename37(srcName));
402415
+ destPath = join113(projectRoot, destArg, basename38(srcName));
402549
402416
  } else {
402550
402417
  destPath = destArg.startsWith(".") || !destArg.includes(":") && !destArg.startsWith("/") ? join113(projectRoot, destArg) : destArg;
402551
402418
  }
@@ -403549,7 +403416,7 @@ function createEmptyState() {
403549
403416
 
403550
403417
  // src/services/director/directorMemoryOps.ts
403551
403418
  import { mkdir as mkdir38, readdir as readdir24, readFile as readFile45, stat as stat40, writeFile as writeFile40 } from "fs/promises";
403552
- import { basename as basename37, join as join117, resolve as resolve37 } from "path";
403419
+ import { basename as basename38, join as join117, resolve as resolve37 } from "path";
403553
403420
  function setDirectorProjectRoot(projectPath) {
403554
403421
  _projectStateDir = join117(projectPath, ".localclawd");
403555
403422
  }
@@ -403579,7 +403446,7 @@ async function saveDirectorState(state) {
403579
403446
  await writeFile40(join117(_projectStateDir, "director-memory.json"), JSON.stringify(state, null, 2), "utf-8");
403580
403447
  }
403581
403448
  function slugify4(path12) {
403582
- return basename37(resolve37(path12)).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
403449
+ return basename38(resolve37(path12)).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
403583
403450
  }
403584
403451
  async function detectGitRemote(projectPath) {
403585
403452
  try {
@@ -403604,11 +403471,11 @@ async function detectDescription(projectPath) {
403604
403471
  if (firstLine)
403605
403472
  return firstLine.trim().slice(0, 120);
403606
403473
  } catch {}
403607
- return basename37(resolve37(projectPath));
403474
+ return basename38(resolve37(projectPath));
403608
403475
  }
403609
403476
  function generateTags(project) {
403610
403477
  const tags = [];
403611
- const name = basename37(resolve37(project.path));
403478
+ const name = basename38(resolve37(project.path));
403612
403479
  tags.push(name.toLowerCase());
403613
403480
  const words = project.description.toLowerCase().split(/\W+/).filter((w2) => w2.length > 3);
403614
403481
  tags.push(...words.slice(0, 5));
@@ -405452,14 +405319,53 @@ function parseFocus(args) {
405452
405319
  function extractLastAssistantText(messages) {
405453
405320
  for (let i3 = messages.length - 1;i3 >= 0; i3--) {
405454
405321
  const msg = messages[i3];
405455
- if (msg.role !== "assistant")
405322
+ const role = msg.message?.role ?? msg.role;
405323
+ if (role !== "assistant" && msg.type !== "assistant")
405456
405324
  continue;
405457
- const blocks = Array.isArray(msg.content) ? msg.content : [];
405325
+ const content = msg.message?.content ?? msg.content;
405326
+ if (typeof content === "string") {
405327
+ return content;
405328
+ }
405329
+ const blocks = Array.isArray(content) ? content : [];
405458
405330
  return blocks.filter((b3) => b3.type === "text").map((b3) => b3.text ?? "").join(`
405459
405331
  `);
405460
405332
  }
405461
405333
  return "";
405462
405334
  }
405335
+ function hasCompactBoundaryAfterLastAssistant(messages) {
405336
+ let lastAssistantIndex = -1;
405337
+ let lastCompactBoundaryIndex = -1;
405338
+ for (let i3 = 0;i3 < messages.length; i3++) {
405339
+ const msg = messages[i3];
405340
+ const role = msg.message?.role ?? msg.role;
405341
+ if (role === "assistant" || msg.type === "assistant") {
405342
+ lastAssistantIndex = i3;
405343
+ }
405344
+ if (msg.type === "system" && msg.subtype === "compact_boundary") {
405345
+ lastCompactBoundaryIndex = i3;
405346
+ }
405347
+ }
405348
+ return lastCompactBoundaryIndex >= 0 && lastCompactBoundaryIndex > lastAssistantIndex;
405349
+ }
405350
+ function queuedKeepGoingCommand(value) {
405351
+ return typeof value === "string" && /^\/(keepgoing|kg|continue)(\s|$)/i.test(value.trim());
405352
+ }
405353
+ function scheduleKeepGoingResume(command3) {
405354
+ try {
405355
+ removeByFilter((cmd) => queuedKeepGoingCommand(cmd.value));
405356
+ const timer = setTimeout(() => {
405357
+ try {
405358
+ removeByFilter((cmd) => queuedKeepGoingCommand(cmd.value));
405359
+ enqueue({ value: command3, mode: "prompt", isMeta: true, priority: "later" });
405360
+ } catch (error5) {
405361
+ logKgCrash(error5, "resume-enqueue");
405362
+ }
405363
+ }, RECOVERY_REQUEUE_DELAY_MS);
405364
+ timer.unref?.();
405365
+ } catch (error5) {
405366
+ logKgCrash(error5, "resume-schedule");
405367
+ }
405368
+ }
405463
405369
  async function synthesizeNextDirective(focus) {
405464
405370
  try {
405465
405371
  const cacheSafeParams = getLastCacheSafeParams();
@@ -405651,9 +405557,8 @@ function logKgCrash(error5, context7) {
405651
405557
  const msg = error5 instanceof Error ? error5.stack ?? error5.message : String(error5);
405652
405558
  try {
405653
405559
  const { appendFileSync: appendFileSync3, mkdirSync: mkdirSync6 } = __require("fs");
405654
- const { homedir: homedir26 } = __require("os");
405655
405560
  const { join: join119 } = __require("path");
405656
- const dir = join119(homedir26(), ".claude");
405561
+ const dir = getClaudeConfigHomeDir();
405657
405562
  mkdirSync6(dir, { recursive: true });
405658
405563
  appendFileSync3(join119(dir, "crash.log"), `[${new Date().toISOString()}] keepgoing ${context7}: ${msg}
405659
405564
  `);
@@ -405692,15 +405597,18 @@ async function callInner3(onDone, context7, args) {
405692
405597
  }
405693
405598
  }));
405694
405599
  let lastText = "";
405600
+ let compactBoundaryAfterLastAssistant = false;
405695
405601
  try {
405696
405602
  context7.setMessages((prev) => {
405697
- lastText = extractLastAssistantText(prev);
405603
+ const transcript = prev;
405604
+ lastText = extractLastAssistantText(transcript);
405605
+ compactBoundaryAfterLastAssistant = hasCompactBoundaryAfterLastAssistant(transcript);
405698
405606
  return prev;
405699
405607
  });
405700
405608
  } catch (e2) {
405701
405609
  logKgCrash(e2, "extractLastAssistantText");
405702
405610
  }
405703
- const contextCompacted = lastText === NO_CONTENT_MESSAGE || lastText.trim() === "";
405611
+ const contextCompacted = lastText === NO_CONTENT_MESSAGE || compactBoundaryAfterLastAssistant;
405704
405612
  if (!contextCompacted) {
405705
405613
  const extracted = extractSelfDirective(lastText);
405706
405614
  const synthesized = lastText.trim() && sessionRound >= 1 ? await synthesizeNextDirective(focus) : "";
@@ -405713,7 +405621,7 @@ async function callInner3(onDone, context7, args) {
405713
405621
  sessionSelfDirective = preview ? `Continue from where you left off: ${preview.slice(0, 200)}` : "Continue with the next most important task.";
405714
405622
  }
405715
405623
  } else {
405716
- sessionSelfDirective = "";
405624
+ sessionSelfDirective = "Context was compacted or the last model response had no content. Reconstruct the current state from the compact summary, git status, active files, and recent tests, then continue the highest-value remaining work without waiting for the user.";
405717
405625
  }
405718
405626
  if (lastText.trim() && lastText !== NO_CONTENT_MESSAGE) {
405719
405627
  const preview = lastText.slice(0, 1200);
@@ -405763,7 +405671,8 @@ Round ${finalRound} · stopped via /stop`;
405763
405671
  const nextCmd = "/keepgoing";
405764
405672
  const handleReady = () => {
405765
405673
  try {
405766
- enqueue({ value: nextCmd, mode: "prompt", isMeta: true });
405674
+ removeByFilter((cmd) => queuedKeepGoingCommand(cmd.value));
405675
+ enqueue({ value: nextCmd, mode: "prompt", isMeta: true, priority: "later" });
405767
405676
  onDone(undefined, {
405768
405677
  display: "system",
405769
405678
  shouldQuery: true,
@@ -405771,8 +405680,9 @@ Round ${finalRound} · stopped via /stop`;
405771
405680
  });
405772
405681
  } catch (e2) {
405773
405682
  logKgCrash(e2, "handleReady");
405683
+ scheduleKeepGoingResume(nextCmd);
405774
405684
  try {
405775
- onDone(`⚠ keepgoing recovered from internal error`, { display: "system" });
405685
+ onDone(`⚠ keepgoing recovered from internal error and will continue`, { display: "system" });
405776
405686
  } catch {}
405777
405687
  }
405778
405688
  };
@@ -405785,16 +405695,23 @@ Round ${finalRound} · stopped via /stop`;
405785
405695
  onReady: handleReady
405786
405696
  }, undefined, false, undefined, this);
405787
405697
  }
405788
- var React58, jsx_dev_runtime196, sessionRound = 0, sessionFocus = "", sessionOriginalMode = "default", sessionSelfDirective = "", call22 = async (onDone, context7, args) => {
405698
+ var React58, jsx_dev_runtime196, sessionRound = 0, sessionFocus = "", sessionOriginalMode = "default", sessionSelfDirective = "", RECOVERY_REQUEUE_DELAY_MS = 1500, call22 = async (onDone, context7, args) => {
405789
405699
  try {
405790
405700
  return await callInner3(onDone, context7, args);
405791
405701
  } catch (error5) {
405792
405702
  logKgCrash(error5, "call");
405793
405703
  const msg = error5 instanceof Error ? error5.message : String(error5);
405794
- try {
405795
- enqueue({ value: "/keepgoing", mode: "prompt", isMeta: true });
405796
- } catch {}
405797
- onDone(`⚠ keepgoing error (restarting): ${msg}`, { display: "system" });
405704
+ const fallbackFocus = sessionFocus || parseFocus(args ?? "");
405705
+ const command3 = fallbackFocus ? `/keepgoing ${fallbackFocus}` : "/keepgoing";
405706
+ scheduleKeepGoingResume(command3);
405707
+ context7.setAppState((prev) => ({
405708
+ ...prev,
405709
+ toolPermissionContext: {
405710
+ ...prev.toolPermissionContext,
405711
+ mode: "bypassPermissions"
405712
+ }
405713
+ }));
405714
+ onDone(`keepgoing recovered from an internal error and will continue: ${msg}`, { display: "system" });
405798
405715
  return null;
405799
405716
  }
405800
405717
  };
@@ -405809,6 +405726,7 @@ var init_keepgoing = __esm(() => {
405809
405726
  init_messageQueueManager();
405810
405727
  init_forkedAgent();
405811
405728
  init_messages3();
405729
+ init_envUtils();
405812
405730
  React58 = __toESM(require_react(), 1);
405813
405731
  jsx_dev_runtime196 = __toESM(require_jsx_dev_runtime(), 1);
405814
405732
  });
@@ -409439,7 +409357,7 @@ var init_daytona_run2 = __esm(() => {
409439
409357
 
409440
409358
  // src/services/skills/skillPortable.ts
409441
409359
  import { readdir as readdir30, readFile as readFile52, writeFile as writeFile47, mkdir as mkdir45, stat as stat46 } from "fs/promises";
409442
- import { join as join127, basename as basename38, extname as extname13, resolve as resolve38 } from "path";
409360
+ import { join as join127, basename as basename39, extname as extname13, resolve as resolve38 } from "path";
409443
409361
  function parseFrontmatter2(raw) {
409444
409362
  const m3 = raw.match(/^---\s*\n([\s\S]*?)\n---\s*\n?([\s\S]*)$/);
409445
409363
  if (!m3)
@@ -409544,7 +409462,7 @@ async function importSkill(filePath) {
409544
409462
  const { meta, body } = parseFrontmatter2(raw);
409545
409463
  let name = typeof meta.name === "string" ? meta.name : "";
409546
409464
  if (!name) {
409547
- name = basename38(filePath, extname13(filePath));
409465
+ name = basename39(filePath, extname13(filePath));
409548
409466
  }
409549
409467
  name = name.toLowerCase().replace(/[^a-z0-9-]+/g, "-").replace(/^-|-$/g, "").slice(0, 48);
409550
409468
  if (!name)
@@ -410325,7 +410243,7 @@ __export(exports_webuiServer, {
410325
410243
  });
410326
410244
  import { createServer as createServer5 } from "http";
410327
410245
  import { mkdir as mkdir48, readdir as readdir31, readFile as readFile55, writeFile as writeFile50 } from "fs/promises";
410328
- import { createHash as createHash23 } from "crypto";
410246
+ import { createHash as createHash24 } from "crypto";
410329
410247
  import { join as join130 } from "path";
410330
410248
  function getWebuiPort() {
410331
410249
  return _boundPort;
@@ -410441,7 +410359,7 @@ function handleUpgrade(req, socket) {
410441
410359
  socket.destroy();
410442
410360
  return;
410443
410361
  }
410444
- const accept = createHash23("sha1").update(key + WS_GUID).digest("base64");
410362
+ const accept = createHash24("sha1").update(key + WS_GUID).digest("base64");
410445
410363
  socket.write(`HTTP/1.1 101 Switching Protocols\r
410446
410364
  ` + `Upgrade: websocket\r
410447
410365
  ` + `Connection: Upgrade\r
@@ -411122,7 +411040,7 @@ var init_windows_setup2 = __esm(() => {
411122
411040
  import { createServer as createServer6 } from "http";
411123
411041
  import { readFile as readFile56, writeFile as writeFile51, mkdir as mkdir49, readdir as readdir32, stat as stat48 } from "fs/promises";
411124
411042
  import { spawn as spawn12 } from "child_process";
411125
- import { join as join131, resolve as resolvePath, relative as relative24 } from "path";
411043
+ import { join as join131, resolve as resolvePath, relative as relative25 } from "path";
411126
411044
  async function handleRead(p) {
411127
411045
  try {
411128
411046
  const raw = await readFile56(p.path, "utf-8");
@@ -411249,7 +411167,7 @@ async function handleGlob(p) {
411249
411167
  const re2 = globToRegex(p.pattern);
411250
411168
  const all4 = [];
411251
411169
  await walk(cwd2, all4, 1e4);
411252
- const matches = all4.map((f3) => relative24(cwd2, f3).replace(/\\/g, "/")).filter((f3) => re2.test(f3));
411170
+ const matches = all4.map((f3) => relative25(cwd2, f3).replace(/\\/g, "/")).filter((f3) => re2.test(f3));
411253
411171
  return { ok: true, data: matches };
411254
411172
  } catch (e2) {
411255
411173
  return { ok: false, error: String(e2) };
@@ -411267,7 +411185,7 @@ async function handleGrep(p) {
411267
411185
  for (const f3 of files) {
411268
411186
  if (out.length >= max2)
411269
411187
  break;
411270
- if (globRe && !globRe.test(relative24(root2, f3).replace(/\\/g, "/")))
411188
+ if (globRe && !globRe.test(relative25(root2, f3).replace(/\\/g, "/")))
411271
411189
  continue;
411272
411190
  let content;
411273
411191
  try {
@@ -412384,12 +412302,12 @@ var init_MemoryFileSelector = __esm(() => {
412384
412302
 
412385
412303
  // src/components/memory/MemoryUpdateNotification.tsx
412386
412304
  import { homedir as homedir30 } from "os";
412387
- import { relative as relative25 } from "path";
412305
+ import { relative as relative26 } from "path";
412388
412306
  function getRelativeMemoryPath(path12) {
412389
412307
  const homeDir = homedir30();
412390
412308
  const cwd2 = getCwd();
412391
412309
  const relativeToHome = path12.startsWith(homeDir) ? "~" + path12.slice(homeDir.length) : null;
412392
- const relativeToCwd = path12.startsWith(cwd2) ? "./" + relative25(cwd2, path12) : null;
412310
+ const relativeToCwd = path12.startsWith(cwd2) ? "./" + relative26(cwd2, path12) : null;
412393
412311
  if (relativeToHome && relativeToCwd) {
412394
412312
  return relativeToHome.length <= relativeToCwd.length ? relativeToHome : relativeToCwd;
412395
412313
  }
@@ -412407,12 +412325,12 @@ import {
412407
412325
  spawn as spawn13,
412408
412326
  spawnSync as spawnSync8
412409
412327
  } from "child_process";
412410
- import { basename as basename39 } from "path";
412328
+ import { basename as basename40 } from "path";
412411
412329
  function isCommandAvailable3(command3) {
412412
412330
  return !!whichSync(command3);
412413
412331
  }
412414
412332
  function classifyGuiEditor(editor) {
412415
- const base = basename39(editor.split(" ")[0] ?? "");
412333
+ const base = basename40(editor.split(" ")[0] ?? "");
412416
412334
  return GUI_EDITORS.find((g2) => base.includes(g2));
412417
412335
  }
412418
412336
  function guiGotoArgv(guiFamily, filePath, line) {
@@ -412449,7 +412367,7 @@ function openFileInExternalEditor(filePath, line) {
412449
412367
  const inkInstance = instances_default.get(process.stdout);
412450
412368
  if (!inkInstance)
412451
412369
  return false;
412452
- const useGotoLine = line && PLUS_N_EDITORS.test(basename39(base));
412370
+ const useGotoLine = line && PLUS_N_EDITORS.test(basename40(base));
412453
412371
  inkInstance.enterAlternateScreen();
412454
412372
  try {
412455
412373
  const syncOpts = { stdio: "inherit" };
@@ -412646,7 +412564,7 @@ async function runMemoryControlCommand(args) {
412646
412564
  const [command3 = "status", ...rest] = args.trim().split(/\s+/);
412647
412565
  if (command3 === "on" || command3 === "enable") {
412648
412566
  await setProjectMemoryEnabled(true);
412649
- return "Project memory is on. Future turns will be saved in .localclawd/memory/.";
412567
+ return "Project memory is on. Future turns will be saved under .localclawd/memory/directories/<current-directory>.";
412650
412568
  }
412651
412569
  if (command3 === "off" || command3 === "disable") {
412652
412570
  await setProjectMemoryEnabled(false);
@@ -412668,9 +412586,11 @@ async function runMemoryControlCommand(args) {
412668
412586
  const status = await getProjectMemoryStatus();
412669
412587
  return [
412670
412588
  `Project memory: ${status.enabled ? "on" : "off"}`,
412671
- `Path: ${status.memoryDir}`,
412672
- `Files: ${status.fileCount}`,
412673
- `Size: ${formatBytes(status.bytes)}`
412589
+ `Project path: ${status.memoryDir}`,
412590
+ `Current directory key: ${status.directoryKey}`,
412591
+ `Current directory path: ${status.directoryMemoryDir}`,
412592
+ `Files: ${status.fileCount} total; ${status.directoryFileCount} in current directory memory`,
412593
+ `Size: ${formatBytes(status.bytes)} total; ${formatBytes(status.directoryBytes)} in current directory memory`
412674
412594
  ].join(`
412675
412595
  `);
412676
412596
  }
@@ -413658,7 +413578,7 @@ function Help(t0) {
413658
413578
  let t6;
413659
413579
  if ($2[31] !== tabs) {
413660
413580
  t6 = /* @__PURE__ */ jsx_dev_runtime218.jsxDEV(Tabs, {
413661
- title: `localclawd v${"2.3.4"}`,
413581
+ title: `localclawd v${"2.3.5"}`,
413662
413582
  color: "professionalBlue",
413663
413583
  defaultTab: "general",
413664
413584
  children: tabs
@@ -416356,7 +416276,7 @@ var init_channelPermissions = __esm(() => {
416356
416276
  });
416357
416277
 
416358
416278
  // src/services/mcp/useManageMCPConnections.ts
416359
- import { basename as basename40 } from "path";
416279
+ import { basename as basename41 } from "path";
416360
416280
  function getErrorKey(error5) {
416361
416281
  const plugin = "plugin" in error5 ? error5.plugin : "no-plugin";
416362
416282
  return `${error5.type}:${error5.source}:${plugin}`;
@@ -416733,7 +416653,7 @@ function useManageMCPConnections(dynamicMcpConfig, isStrictMcpConfig = false) {
416733
416653
  else if (serverConfig.scope === "claudeai")
416734
416654
  counts.claudeai++;
416735
416655
  if (process.env.USER_TYPE === "ant" && !isMcpServerDisabled(name) && (serverConfig.type === undefined || serverConfig.type === "stdio") && "command" in serverConfig) {
416736
- stdioCommands.push(basename40(serverConfig.command));
416656
+ stdioCommands.push(basename41(serverConfig.command));
416737
416657
  }
416738
416658
  }
416739
416659
  logEvent("tengu_mcp_servers", {
@@ -430920,7 +430840,7 @@ function getRecentReleaseNotes(currentVersion, previousVersion, changelogContent
430920
430840
  }
430921
430841
  return [];
430922
430842
  }
430923
- async function checkForReleaseNotes(lastSeenVersion, currentVersion = "2.3.4") {
430843
+ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "2.3.5") {
430924
430844
  if (process.env.USER_TYPE === "ant") {
430925
430845
  const changelog = MACRO.VERSION_CHANGELOG;
430926
430846
  if (changelog) {
@@ -430947,7 +430867,7 @@ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "2.3.4") {
430947
430867
  releaseNotes
430948
430868
  };
430949
430869
  }
430950
- function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "2.3.4") {
430870
+ function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "2.3.5") {
430951
430871
  if (process.env.USER_TYPE === "ant") {
430952
430872
  const changelog = MACRO.VERSION_CHANGELOG;
430953
430873
  if (changelog) {
@@ -431104,7 +431024,7 @@ function getRecentActivitySync() {
431104
431024
  return cachedActivity;
431105
431025
  }
431106
431026
  function getLogoDisplayData() {
431107
- const version = process.env.DEMO_VERSION ?? "2.3.4";
431027
+ const version = process.env.DEMO_VERSION ?? "2.3.5";
431108
431028
  const serverUrl = getDirectConnectServerUrl();
431109
431029
  const displayPath = process.env.DEMO_VERSION ? "/code/claude" : getDisplayPath(getCwd());
431110
431030
  const cwd2 = serverUrl ? `${displayPath} in ${serverUrl.replace(/^https?:\/\//, "")}` : displayPath;
@@ -432204,7 +432124,7 @@ function Logo() {
432204
432124
  if ($2[2] === Symbol.for("react.memo_cache_sentinel")) {
432205
432125
  t2 = () => {
432206
432126
  const currentConfig = getGlobalConfig();
432207
- if (currentConfig.lastReleaseNotesSeen === "2.3.4") {
432127
+ if (currentConfig.lastReleaseNotesSeen === "2.3.5") {
432208
432128
  return;
432209
432129
  }
432210
432130
  saveGlobalConfig(_temp325);
@@ -432863,12 +432783,12 @@ function Logo() {
432863
432783
  return t41;
432864
432784
  }
432865
432785
  function _temp325(current) {
432866
- if (current.lastReleaseNotesSeen === "2.3.4") {
432786
+ if (current.lastReleaseNotesSeen === "2.3.5") {
432867
432787
  return current;
432868
432788
  }
432869
432789
  return {
432870
432790
  ...current,
432871
- lastReleaseNotesSeen: "2.3.4"
432791
+ lastReleaseNotesSeen: "2.3.5"
432872
432792
  };
432873
432793
  }
432874
432794
  function _temp240(s_0) {
@@ -433424,7 +433344,7 @@ var init_nullRenderingAttachments = __esm(() => {
433424
433344
  });
433425
433345
 
433426
433346
  // src/utils/statusNoticeDefinitions.tsx
433427
- import { relative as relative26 } from "path";
433347
+ import { relative as relative27 } from "path";
433428
433348
  function getActiveNotices(context7) {
433429
433349
  return statusNoticeDefinitions.filter((notice) => notice.isActive(context7));
433430
433350
  }
@@ -433448,7 +433368,7 @@ var init_statusNoticeDefinitions = __esm(() => {
433448
433368
  const largeMemoryFiles = getLargeMemoryFiles(ctx2.memoryFiles);
433449
433369
  return /* @__PURE__ */ jsx_dev_runtime260.jsxDEV(jsx_dev_runtime260.Fragment, {
433450
433370
  children: largeMemoryFiles.map((file) => {
433451
- const displayPath = file.path.startsWith(getCwd()) ? relative26(getCwd(), file.path) : file.path;
433371
+ const displayPath = file.path.startsWith(getCwd()) ? relative27(getCwd(), file.path) : file.path;
433452
433372
  return /* @__PURE__ */ jsx_dev_runtime260.jsxDEV(ThemedBox_default, {
433453
433373
  flexDirection: "row",
433454
433374
  children: [
@@ -456827,13 +456747,13 @@ var exports_files2 = {};
456827
456747
  __export(exports_files2, {
456828
456748
  call: () => call78
456829
456749
  });
456830
- import { relative as relative27 } from "path";
456750
+ import { relative as relative28 } from "path";
456831
456751
  async function call78(_args, context7) {
456832
456752
  const files = context7.readFileState ? cacheKeys(context7.readFileState) : [];
456833
456753
  if (files.length === 0) {
456834
456754
  return { type: "text", value: "No files in context" };
456835
456755
  }
456836
- const fileList = files.map((file) => relative27(getCwd(), file)).join(`
456756
+ const fileList = files.map((file) => relative28(getCwd(), file)).join(`
456837
456757
  `);
456838
456758
  return { type: "text", value: `Files in context:
456839
456759
  ${fileList}` };
@@ -463327,7 +463247,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
463327
463247
  smapsRollup,
463328
463248
  platform: process.platform,
463329
463249
  nodeVersion: process.version,
463330
- ccVersion: "2.3.4"
463250
+ ccVersion: "2.3.5"
463331
463251
  };
463332
463252
  }
463333
463253
  async function performHeapDump(trigger = "manual", dumpNumber = 0) {
@@ -463912,7 +463832,7 @@ var init_bridge_kick = __esm(() => {
463912
463832
  var call86 = async () => {
463913
463833
  return {
463914
463834
  type: "text",
463915
- value: `${"2.3.4"} (built ${"2026-05-10T21:07:59.152Z"})`
463835
+ value: `${"2.3.5"} (built ${"2026-06-03T02:51:00.215Z"})`
463916
463836
  };
463917
463837
  }, version, version_default;
463918
463838
  var init_version = __esm(() => {
@@ -465080,7 +465000,7 @@ var exports_sandbox_toggle = {};
465080
465000
  __export(exports_sandbox_toggle, {
465081
465001
  call: () => call87
465082
465002
  });
465083
- import { relative as relative28 } from "path";
465003
+ import { relative as relative29 } from "path";
465084
465004
  async function call87(onDone, _context, args) {
465085
465005
  const settings = getSettings_DEPRECATED();
465086
465006
  const themeName = settings.theme || "light";
@@ -465122,7 +465042,7 @@ async function call87(onDone, _context, args) {
465122
465042
  const cleanPattern = commandPattern.replace(/^["']|["']$/g, "");
465123
465043
  addToExcludedCommands(cleanPattern);
465124
465044
  const localSettingsPath = getSettingsFilePathForSource("localSettings");
465125
- const relativePath = localSettingsPath ? relative28(getCwdState(), localSettingsPath) : ".claude/settings.local.json";
465045
+ const relativePath = localSettingsPath ? relative29(getCwdState(), localSettingsPath) : ".claude/settings.local.json";
465126
465046
  const message = color("success", themeName)(`Added "${cleanPattern}" to excluded commands in ${relativePath}`);
465127
465047
  onDone(message);
465128
465048
  return null;
@@ -465280,7 +465200,7 @@ var init_advisor2 = __esm(() => {
465280
465200
  // src/skills/bundledSkills.ts
465281
465201
  import { constants as fsConstants4 } from "fs";
465282
465202
  import { mkdir as mkdir55, open as open13 } from "fs/promises";
465283
- import { dirname as dirname54, isAbsolute as isAbsolute23, join as join145, normalize as normalize12, sep as pathSep2 } from "path";
465203
+ import { dirname as dirname54, isAbsolute as isAbsolute24, join as join145, normalize as normalize12, sep as pathSep2 } from "path";
465284
465204
  function registerBundledSkill(definition) {
465285
465205
  const { files: files2 } = definition;
465286
465206
  let skillRoot;
@@ -465367,7 +465287,7 @@ async function safeWriteFile(p, content) {
465367
465287
  }
465368
465288
  function resolveSkillFilePath(baseDir, relPath) {
465369
465289
  const normalized = normalize12(relPath);
465370
- if (isAbsolute23(normalized) || normalized.split(pathSep2).includes("..") || normalized.split("/").includes("..")) {
465290
+ if (isAbsolute24(normalized) || normalized.split(pathSep2).includes("..") || normalized.split("/").includes("..")) {
465371
465291
  throw new Error(`bundled skill file path escapes skill dir: ${relPath}`);
465372
465292
  }
465373
465293
  return join145(baseDir, normalized);
@@ -468335,7 +468255,7 @@ var init_screenshotClipboard = __esm(() => {
468335
468255
 
468336
468256
  // src/utils/stats.ts
468337
468257
  import { open as open15 } from "fs/promises";
468338
- import { basename as basename43, join as join150, sep as sep30 } from "path";
468258
+ import { basename as basename44, join as join150, sep as sep30 } from "path";
468339
468259
  async function processSessionFiles(sessionFiles, options = {}) {
468340
468260
  const { fromDate, toDate } = options;
468341
468261
  const fs6 = getFsImplementation();
@@ -468393,7 +468313,7 @@ async function processSessionFiles(sessionFiles, options = {}) {
468393
468313
  logForDebugging(`Failed to read session file ${sessionFile}: ${errorMessage(error5)}`);
468394
468314
  continue;
468395
468315
  }
468396
- const sessionId = basename43(sessionFile, ".jsonl");
468316
+ const sessionId = basename44(sessionFile, ".jsonl");
468397
468317
  const messages = [];
468398
468318
  for (const entry of entries) {
468399
468319
  if (isTranscriptMessage(entry)) {
@@ -471856,7 +471776,7 @@ function generateHtmlReport(data, insights) {
471856
471776
  </html>`;
471857
471777
  }
471858
471778
  function buildExportData(data, insights, facets, remoteStats) {
471859
- const version2 = typeof MACRO !== "undefined" ? "2.3.4" : "unknown";
471779
+ const version2 = typeof MACRO !== "undefined" ? "2.3.5" : "unknown";
471860
471780
  const remote_hosts_collected = remoteStats?.hosts.filter((h2) => h2.sessionCount > 0).map((h2) => h2.name);
471861
471781
  const facets_summary = {
471862
471782
  total: facets.size,
@@ -473234,7 +473154,7 @@ import {
473234
473154
  unlink as unlink22,
473235
473155
  writeFile as writeFile61
473236
473156
  } from "fs/promises";
473237
- import { basename as basename44, dirname as dirname56, join as join152 } from "path";
473157
+ import { basename as basename45, dirname as dirname56, join as join152 } from "path";
473238
473158
  function isTranscriptMessage(entry) {
473239
473159
  return entry.type === "user" || entry.type === "assistant" || entry.type === "attachment" || entry.type === "system";
473240
473160
  }
@@ -475668,7 +475588,7 @@ async function getSessionFilesWithMtime(projectDir) {
475668
475588
  for (const dirent of dirents) {
475669
475589
  if (!dirent.isFile() || !dirent.name.endsWith(".jsonl"))
475670
475590
  continue;
475671
- const sessionId = validateUuid2(basename44(dirent.name, ".jsonl"));
475591
+ const sessionId = validateUuid2(basename45(dirent.name, ".jsonl"));
475672
475592
  if (!sessionId)
475673
475593
  continue;
475674
475594
  candidates.push({ sessionId, filePath: join152(projectDir, dirent.name) });
@@ -476055,7 +475975,7 @@ var init_sessionStorage = __esm(() => {
476055
475975
  init_settings2();
476056
475976
  init_slowOperations();
476057
475977
  init_uuid();
476058
- VERSION6 = typeof MACRO !== "undefined" ? "2.3.4" : "unknown";
475978
+ VERSION6 = typeof MACRO !== "undefined" ? "2.3.5" : "unknown";
476059
475979
  MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
476060
475980
  SKIP_FIRST_PROMPT_PATTERN = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
476061
475981
  EPHEMERAL_PROGRESS_TYPES = new Set([
@@ -476212,14 +476132,14 @@ function buildMemoryLines(displayName, memoryDir, extraGuidelines, skipIndex = f
476212
476132
  return lines;
476213
476133
  }
476214
476134
  function buildMemoryPrompt(params) {
476215
- const { displayName, memoryDir, extraGuidelines } = params;
476135
+ const { displayName, memoryDir, extraGuidelines, skipIndex = false } = params;
476216
476136
  const fs6 = getFsImplementation();
476217
476137
  const entrypoint = memoryDir + ENTRYPOINT_NAME;
476218
476138
  let entrypointContent = "";
476219
476139
  try {
476220
476140
  entrypointContent = fs6.readFileSync(entrypoint, { encoding: "utf-8" });
476221
476141
  } catch {}
476222
- const lines = buildMemoryLines(displayName, memoryDir, extraGuidelines);
476142
+ const lines = buildMemoryLines(displayName, memoryDir, extraGuidelines, skipIndex);
476223
476143
  if (entrypointContent.trim()) {
476224
476144
  const t2 = truncateEntrypointContent(entrypointContent);
476225
476145
  const memoryType = displayName === AUTO_MEM_DISPLAY_NAME ? "auto" : "agent";
@@ -476550,14 +476470,14 @@ function pathInWorkingPath(path15, workingPath) {
476550
476470
  const normalizedWorkingPath = absoluteWorkingPath.replace(/^\/private\/var\//, "/var/").replace(/^\/private\/tmp(\/|$)/, "/tmp$1");
476551
476471
  const caseNormalizedPath = normalizeCaseForComparison(normalizedPath);
476552
476472
  const caseNormalizedWorkingPath = normalizeCaseForComparison(normalizedWorkingPath);
476553
- const relative29 = relativePath(caseNormalizedWorkingPath, caseNormalizedPath);
476554
- if (relative29 === "") {
476473
+ const relative30 = relativePath(caseNormalizedWorkingPath, caseNormalizedPath);
476474
+ if (relative30 === "") {
476555
476475
  return true;
476556
476476
  }
476557
- if (containsPathTraversal(relative29)) {
476477
+ if (containsPathTraversal(relative30)) {
476558
476478
  return false;
476559
476479
  }
476560
- return !posix8.isAbsolute(relative29);
476480
+ return !posix8.isAbsolute(relative30);
476561
476481
  }
476562
476482
  function rootPathForSource(source) {
476563
476483
  switch (source) {
@@ -477186,7 +477106,7 @@ var init_filesystem = __esm(() => {
477186
477106
  });
477187
477107
  getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
477188
477108
  const nonce = randomBytes20(16).toString("hex");
477189
- return join154(getClaudeTempDir(), "bundled-skills", "2.3.4", nonce);
477109
+ return join154(getClaudeTempDir(), "bundled-skills", "2.3.5", nonce);
477190
477110
  });
477191
477111
  getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
477192
477112
  });
@@ -478616,7 +478536,7 @@ __export(exports_hooks2, {
478616
478536
  executeConfigChangeHooks: () => executeConfigChangeHooks,
478617
478537
  createBaseHookInput: () => createBaseHookInput
478618
478538
  });
478619
- import { basename as basename45 } from "path";
478539
+ import { basename as basename46 } from "path";
478620
478540
  import { spawn as spawn14 } from "child_process";
478621
478541
  import { randomUUID as randomUUID31 } from "crypto";
478622
478542
  function getSessionEndHookTimeoutMs() {
@@ -479447,7 +479367,7 @@ async function getMatchingHooks(appState, sessionId, hookEvent, hookInput, tools
479447
479367
  matchQuery = hookInput.load_reason;
479448
479368
  break;
479449
479369
  case "FileChanged":
479450
- matchQuery = basename45(hookInput.file_path);
479370
+ matchQuery = basename46(hookInput.file_path);
479451
479371
  break;
479452
479372
  default:
479453
479373
  break;
@@ -481477,7 +481397,7 @@ import {
481477
481397
  symlink as symlink5,
481478
481398
  utimes as utimes2
481479
481399
  } from "fs/promises";
481480
- import { basename as basename46, dirname as dirname57, join as join156 } from "path";
481400
+ import { basename as basename47, dirname as dirname57, join as join156 } from "path";
481481
481401
  function validateWorktreeSlug(slug) {
481482
481402
  if (slug.length > MAX_WORKTREE_SLUG_LENGTH) {
481483
481403
  throw new Error(`Invalid worktree name: must be ${MAX_WORKTREE_SLUG_LENGTH} characters or fewer (got ${slug.length})`);
@@ -481520,7 +481440,7 @@ function restoreWorktreeSession(session2) {
481520
481440
  currentWorktreeSession = session2;
481521
481441
  }
481522
481442
  function generateTmuxSessionName(repoPath, branch2) {
481523
- const repoName = basename46(repoPath);
481443
+ const repoName = basename47(repoPath);
481524
481444
  const combined = `${repoName}_${branch2}`;
481525
481445
  return combined.replace(/[/.]/g, "_");
481526
481446
  }
@@ -482096,7 +482016,7 @@ async function execIntoTmuxWorktree(args) {
482096
482016
  error: `Error: ${errorMessage(error5)}`
482097
482017
  };
482098
482018
  }
482099
- repoName = basename46(findCanonicalGitRoot(getCwd()) ?? getCwd());
482019
+ repoName = basename47(findCanonicalGitRoot(getCwd()) ?? getCwd());
482100
482020
  console.log(`Using worktree via hook: ${worktreeDir}`);
482101
482021
  } else {
482102
482022
  const repoRoot = findCanonicalGitRoot(getCwd());
@@ -482106,7 +482026,7 @@ async function execIntoTmuxWorktree(args) {
482106
482026
  error: "Error: --worktree requires a git repository"
482107
482027
  };
482108
482028
  }
482109
- repoName = basename46(repoRoot);
482029
+ repoName = basename47(repoRoot);
482110
482030
  worktreeDir = worktreePathFor(repoRoot, worktreeName);
482111
482031
  try {
482112
482032
  const result = await getOrCreateWorktree(repoRoot, worktreeName, prNumber !== null ? { prNumber } : undefined);
@@ -486423,7 +486343,7 @@ function buildSystemInitMessage(inputs) {
486423
486343
  slash_commands: inputs.commands.filter((c5) => c5.userInvocable !== false).map((c5) => c5.name),
486424
486344
  apiKeySource: getAnthropicApiKeyWithSource().source,
486425
486345
  betas: getSdkBetas(),
486426
- claude_code_version: "2.3.4",
486346
+ claude_code_version: "2.3.5",
486427
486347
  output_style: outputStyle2,
486428
486348
  agents: inputs.agents.map((agent) => agent.agentType),
486429
486349
  skills: inputs.skills.filter((s2) => s2.userInvocable !== false).map((skill) => skill.name),
@@ -492373,7 +492293,7 @@ var init_FileEditToolDiff = __esm(() => {
492373
492293
 
492374
492294
  // src/hooks/useDiffInIDE.ts
492375
492295
  import { randomUUID as randomUUID34 } from "crypto";
492376
- import { basename as basename48 } from "path";
492296
+ import { basename as basename49 } from "path";
492377
492297
  function useDiffInIDE({
492378
492298
  onChange,
492379
492299
  toolUseContext,
@@ -492384,7 +492304,7 @@ function useDiffInIDE({
492384
492304
  const isUnmounted = import_react197.useRef(false);
492385
492305
  const [hasError, setHasError] = import_react197.useState(false);
492386
492306
  const sha = import_react197.useMemo(() => randomUUID34().slice(0, 6), []);
492387
- const tabName = import_react197.useMemo(() => `✻ [localclawd] ${basename48(filePath)} (${sha}) ⧉`, [filePath, sha]);
492307
+ const tabName = import_react197.useMemo(() => `✻ [localclawd] ${basename49(filePath)} (${sha}) ⧉`, [filePath, sha]);
492388
492308
  const shouldShowDiffInIDE = hasAccessToIDEExtensionDiffFeature(toolUseContext.options.mcpClients) && getGlobalConfig().diffTool === "auto" && !filePath.endsWith(".ipynb");
492389
492309
  const ideName = getConnectedIdeName(toolUseContext.options.mcpClients) ?? "IDE";
492390
492310
  async function showDiff() {
@@ -492565,7 +492485,7 @@ var init_useDiffInIDE = __esm(() => {
492565
492485
  });
492566
492486
 
492567
492487
  // src/components/ShowInIDEPrompt.tsx
492568
- import { basename as basename49, relative as relative29 } from "path";
492488
+ import { basename as basename50, relative as relative30 } from "path";
492569
492489
  function ShowInIDEPrompt(t0) {
492570
492490
  const $2 = c3(36);
492571
492491
  const {
@@ -492603,7 +492523,7 @@ function ShowInIDEPrompt(t0) {
492603
492523
  if ($2[2] !== symlinkTarget) {
492604
492524
  t2 = symlinkTarget && /* @__PURE__ */ jsx_dev_runtime377.jsxDEV(ThemedText, {
492605
492525
  color: "warning",
492606
- children: relative29(getCwd(), symlinkTarget).startsWith("..") ? `This will modify ${symlinkTarget} (outside working directory) via a symlink` : `Symlink target: ${symlinkTarget}`
492526
+ children: relative30(getCwd(), symlinkTarget).startsWith("..") ? `This will modify ${symlinkTarget} (outside working directory) via a symlink` : `Symlink target: ${symlinkTarget}`
492607
492527
  }, undefined, false, undefined, this);
492608
492528
  $2[2] = symlinkTarget;
492609
492529
  $2[3] = t2;
@@ -492622,7 +492542,7 @@ function ShowInIDEPrompt(t0) {
492622
492542
  }
492623
492543
  let t4;
492624
492544
  if ($2[5] !== filePath) {
492625
- t4 = basename49(filePath);
492545
+ t4 = basename50(filePath);
492626
492546
  $2[5] = filePath;
492627
492547
  $2[6] = t4;
492628
492548
  } else {
@@ -492782,7 +492702,7 @@ var init_ShowInIDEPrompt = __esm(() => {
492782
492702
 
492783
492703
  // src/components/permissions/FilePermissionDialog/permissionOptions.tsx
492784
492704
  import { homedir as homedir35 } from "os";
492785
- import { basename as basename50, join as join158, sep as sep33 } from "path";
492705
+ import { basename as basename51, join as join158, sep as sep33 } from "path";
492786
492706
  function isInClaudeFolder(filePath) {
492787
492707
  const absolutePath = expandPath(filePath);
492788
492708
  const claudeFolderPath = expandPath(`${getOriginalCwd()}/.claude`);
@@ -492864,7 +492784,7 @@ function getFilePermissionOptions({
492864
492784
  }
492865
492785
  } else {
492866
492786
  const dirPath = getDirectoryForPath(filePath);
492867
- const dirName = basename50(dirPath) || "this directory";
492787
+ const dirName = basename51(dirPath) || "this directory";
492868
492788
  if (operationType === "read") {
492869
492789
  sessionLabel = /* @__PURE__ */ jsx_dev_runtime378.jsxDEV(ThemedText, {
492870
492790
  children: [
@@ -493167,7 +493087,7 @@ var init_useFilePermissionDialog = __esm(() => {
493167
493087
  });
493168
493088
 
493169
493089
  // src/components/permissions/FilePermissionDialog/FilePermissionDialog.tsx
493170
- import { relative as relative30 } from "path";
493090
+ import { relative as relative31 } from "path";
493171
493091
  function FilePermissionDialog({
493172
493092
  toolUseConfirm,
493173
493093
  toolUseContext,
@@ -493274,7 +493194,7 @@ function FilePermissionDialog({
493274
493194
  noInputMode
493275
493195
  }, undefined, false, undefined, this);
493276
493196
  }
493277
- const isSymlinkOutsideCwd = symlinkTarget != null && relative30(getCwd(), symlinkTarget).startsWith("..");
493197
+ const isSymlinkOutsideCwd = symlinkTarget != null && relative31(getCwd(), symlinkTarget).startsWith("..");
493278
493198
  const symlinkWarning = symlinkTarget ? /* @__PURE__ */ jsx_dev_runtime379.jsxDEV(ThemedBox_default, {
493279
493199
  paddingX: 1,
493280
493200
  marginBottom: 1,
@@ -493361,7 +493281,7 @@ var init_FilePermissionDialog = __esm(() => {
493361
493281
  });
493362
493282
 
493363
493283
  // src/components/permissions/SedEditPermissionRequest/SedEditPermissionRequest.tsx
493364
- import { basename as basename51, relative as relative31 } from "path";
493284
+ import { basename as basename52, relative as relative32 } from "path";
493365
493285
  function SedEditPermissionRequest(t0) {
493366
493286
  const $2 = c3(9);
493367
493287
  let props;
@@ -493529,7 +493449,7 @@ function SedEditPermissionRequestInner(t0) {
493529
493449
  const t8 = props.onReject;
493530
493450
  let t9;
493531
493451
  if ($2[14] !== filePath) {
493532
- t9 = relative31(getCwd(), filePath);
493452
+ t9 = relative32(getCwd(), filePath);
493533
493453
  $2[14] = filePath;
493534
493454
  $2[15] = t9;
493535
493455
  } else {
@@ -493537,7 +493457,7 @@ function SedEditPermissionRequestInner(t0) {
493537
493457
  }
493538
493458
  let t10;
493539
493459
  if ($2[16] !== filePath) {
493540
- t10 = basename51(filePath);
493460
+ t10 = basename52(filePath);
493541
493461
  $2[16] = filePath;
493542
493462
  $2[17] = t10;
493543
493463
  } else {
@@ -493747,7 +493667,7 @@ var init_useShellPermissionFeedback = __esm(() => {
493747
493667
  });
493748
493668
 
493749
493669
  // src/components/permissions/shellPermissionHelpers.tsx
493750
- import { basename as basename52, sep as sep34 } from "path";
493670
+ import { basename as basename53, sep as sep34 } from "path";
493751
493671
  function commandListDisplay(commands) {
493752
493672
  switch (commands.length) {
493753
493673
  case 0:
@@ -493798,7 +493718,7 @@ function commandListDisplayTruncated(commands) {
493798
493718
  function formatPathList(paths2) {
493799
493719
  if (paths2.length === 0)
493800
493720
  return "";
493801
- const names = paths2.map((p) => basename52(p) || p);
493721
+ const names = paths2.map((p) => basename53(p) || p);
493802
493722
  if (names.length === 1) {
493803
493723
  return /* @__PURE__ */ jsx_dev_runtime381.jsxDEV(ThemedText, {
493804
493724
  children: [
@@ -493864,7 +493784,7 @@ function generateShellSuggestionsLabel(suggestions, shellToolName, commandTransf
493864
493784
  if (hasReadPaths && !hasDirectories && !hasCommands) {
493865
493785
  if (readPaths.length === 1) {
493866
493786
  const firstPath = readPaths[0];
493867
- const dirName = basename52(firstPath) || firstPath;
493787
+ const dirName = basename53(firstPath) || firstPath;
493868
493788
  return /* @__PURE__ */ jsx_dev_runtime381.jsxDEV(ThemedText, {
493869
493789
  children: [
493870
493790
  "Yes, allow reading from ",
@@ -493888,7 +493808,7 @@ function generateShellSuggestionsLabel(suggestions, shellToolName, commandTransf
493888
493808
  if (hasDirectories && !hasReadPaths && !hasCommands) {
493889
493809
  if (directories.length === 1) {
493890
493810
  const firstDir = directories[0];
493891
- const dirName = basename52(firstDir) || firstDir;
493811
+ const dirName = basename53(firstDir) || firstDir;
493892
493812
  return /* @__PURE__ */ jsx_dev_runtime381.jsxDEV(ThemedText, {
493893
493813
  children: [
493894
493814
  "Yes, and always allow access to ",
@@ -496119,7 +496039,7 @@ function createSingleEditDiffConfig(filePath, oldString, newString, replaceAll)
496119
496039
  }
496120
496040
 
496121
496041
  // src/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.tsx
496122
- import { basename as basename53, relative as relative32 } from "path";
496042
+ import { basename as basename54, relative as relative33 } from "path";
496123
496043
  function FileEditPermissionRequest(props) {
496124
496044
  const $2 = c3(51);
496125
496045
  const parseInput = _temp168;
@@ -496156,13 +496076,13 @@ function FileEditPermissionRequest(props) {
496156
496076
  t7 = props.onReject;
496157
496077
  t8 = props.workerBadge;
496158
496078
  t9 = "Edit file";
496159
- t10 = relative32(getCwd(), file_path);
496079
+ t10 = relative33(getCwd(), file_path);
496160
496080
  T1 = ThemedText;
496161
496081
  t2 = "Do you want to make this edit to";
496162
496082
  t3 = " ";
496163
496083
  T0 = ThemedText;
496164
496084
  t0 = true;
496165
- t1 = basename53(file_path);
496085
+ t1 = basename54(file_path);
496166
496086
  $2[0] = props.onDone;
496167
496087
  $2[1] = props.onReject;
496168
496088
  $2[2] = props.toolUseConfirm;
@@ -496586,7 +496506,7 @@ var init_FileWriteToolDiff = __esm(() => {
496586
496506
  });
496587
496507
 
496588
496508
  // src/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.tsx
496589
- import { basename as basename54, relative as relative33 } from "path";
496509
+ import { basename as basename55, relative as relative34 } from "path";
496590
496510
  function FileWritePermissionRequest(props) {
496591
496511
  const $2 = c3(30);
496592
496512
  const parseInput = _temp171;
@@ -496645,7 +496565,7 @@ function FileWritePermissionRequest(props) {
496645
496565
  const t7 = fileExists ? "Overwrite file" : "Create file";
496646
496566
  let t8;
496647
496567
  if ($2[5] !== file_path) {
496648
- t8 = relative33(getCwd(), file_path);
496568
+ t8 = relative34(getCwd(), file_path);
496649
496569
  $2[5] = file_path;
496650
496570
  $2[6] = t8;
496651
496571
  } else {
@@ -496653,7 +496573,7 @@ function FileWritePermissionRequest(props) {
496653
496573
  }
496654
496574
  let t9;
496655
496575
  if ($2[7] !== file_path) {
496656
- t9 = basename54(file_path);
496576
+ t9 = basename55(file_path);
496657
496577
  $2[7] = file_path;
496658
496578
  $2[8] = t9;
496659
496579
  } else {
@@ -496775,7 +496695,7 @@ var init_FileWritePermissionRequest = __esm(() => {
496775
496695
  });
496776
496696
 
496777
496697
  // src/components/permissions/NotebookEditPermissionRequest/NotebookEditToolDiff.tsx
496778
- import { relative as relative34 } from "path";
496698
+ import { relative as relative35 } from "path";
496779
496699
  function NotebookEditToolDiff(props) {
496780
496700
  const $2 = c3(5);
496781
496701
  let t0;
@@ -496918,7 +496838,7 @@ function NotebookEditToolDiffInner(t0) {
496918
496838
  }
496919
496839
  let t4;
496920
496840
  if ($2[11] !== notebook_path || $2[12] !== verbose) {
496921
- t4 = verbose ? notebook_path : relative34(getCwd(), notebook_path);
496841
+ t4 = verbose ? notebook_path : relative35(getCwd(), notebook_path);
496922
496842
  $2[11] = notebook_path;
496923
496843
  $2[12] = verbose;
496924
496844
  $2[13] = t4;
@@ -497056,7 +496976,7 @@ var init_NotebookEditToolDiff = __esm(() => {
497056
496976
  });
497057
496977
 
497058
496978
  // src/components/permissions/NotebookEditPermissionRequest/NotebookEditPermissionRequest.tsx
497059
- import { basename as basename55 } from "path";
496979
+ import { basename as basename56 } from "path";
497060
496980
  function NotebookEditPermissionRequest(props) {
497061
496981
  const $2 = c3(52);
497062
496982
  const parseInput = _temp175;
@@ -497100,7 +497020,7 @@ function NotebookEditPermissionRequest(props) {
497100
497020
  t4 = " ";
497101
497021
  T0 = ThemedText;
497102
497022
  t0 = true;
497103
- t1 = basename55(notebook_path);
497023
+ t1 = basename56(notebook_path);
497104
497024
  $2[0] = props.onDone;
497105
497025
  $2[1] = props.onReject;
497106
497026
  $2[2] = props.toolUseConfirm;
@@ -500580,7 +500500,7 @@ var init_useVoiceEnabled = __esm(() => {
500580
500500
  function getSemverPart(version2) {
500581
500501
  return `${import_semver10.major(version2, { loose: true })}.${import_semver10.minor(version2, { loose: true })}.${import_semver10.patch(version2, { loose: true })}`;
500582
500502
  }
500583
- function useUpdateNotification(updatedVersion, initialVersion = "2.3.4") {
500503
+ function useUpdateNotification(updatedVersion, initialVersion = "2.3.5") {
500584
500504
  const [lastNotifiedSemver, setLastNotifiedSemver] = import_react214.useState(() => getSemverPart(initialVersion));
500585
500505
  if (!updatedVersion) {
500586
500506
  return null;
@@ -500620,7 +500540,7 @@ function AutoUpdater({
500620
500540
  return;
500621
500541
  }
500622
500542
  if (false) {}
500623
- const currentVersion = "2.3.4";
500543
+ const currentVersion = "2.3.5";
500624
500544
  const channel = getInitialSettings()?.autoUpdatesChannel ?? "latest";
500625
500545
  let latestVersion = await getLatestVersion(channel);
500626
500546
  const isDisabled = isAutoUpdaterDisabled();
@@ -500831,12 +500751,12 @@ function NativeAutoUpdater({
500831
500751
  logEvent("tengu_native_auto_updater_start", {});
500832
500752
  try {
500833
500753
  const maxVersion = await getMaxVersion();
500834
- if (maxVersion && gt("2.3.4", maxVersion)) {
500754
+ if (maxVersion && gt("2.3.5", maxVersion)) {
500835
500755
  const msg = await getMaxVersionMessage();
500836
500756
  setMaxVersionIssue(msg ?? "affects your version");
500837
500757
  }
500838
500758
  const result = await installLatest(channel);
500839
- const currentVersion = "2.3.4";
500759
+ const currentVersion = "2.3.5";
500840
500760
  const latencyMs = Date.now() - startTime;
500841
500761
  if (result.lockFailed) {
500842
500762
  logEvent("tengu_native_auto_updater_lock_contention", {
@@ -500971,17 +500891,17 @@ function PackageManagerAutoUpdater(t0) {
500971
500891
  const maxVersion = await getMaxVersion();
500972
500892
  if (maxVersion && latest && gt(latest, maxVersion)) {
500973
500893
  logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
500974
- if (gte("2.3.4", maxVersion)) {
500975
- logForDebugging(`PackageManagerAutoUpdater: current version ${"2.3.4"} is already at or above maxVersion ${maxVersion}, skipping update`);
500894
+ if (gte("2.3.5", maxVersion)) {
500895
+ logForDebugging(`PackageManagerAutoUpdater: current version ${"2.3.5"} is already at or above maxVersion ${maxVersion}, skipping update`);
500976
500896
  setUpdateAvailable(false);
500977
500897
  return;
500978
500898
  }
500979
500899
  latest = maxVersion;
500980
500900
  }
500981
- const hasUpdate = latest && !gte("2.3.4", latest) && !shouldSkipVersion(latest);
500901
+ const hasUpdate = latest && !gte("2.3.5", latest) && !shouldSkipVersion(latest);
500982
500902
  setUpdateAvailable(!!hasUpdate);
500983
500903
  if (hasUpdate) {
500984
- logForDebugging(`PackageManagerAutoUpdater: Update available ${"2.3.4"} -> ${latest}`);
500904
+ logForDebugging(`PackageManagerAutoUpdater: Update available ${"2.3.5"} -> ${latest}`);
500985
500905
  }
500986
500906
  };
500987
500907
  $2[0] = t1;
@@ -501015,7 +500935,7 @@ function PackageManagerAutoUpdater(t0) {
501015
500935
  wrap: "truncate",
501016
500936
  children: [
501017
500937
  "currentVersion: ",
501018
- "2.3.4"
500938
+ "2.3.5"
501019
500939
  ]
501020
500940
  }, undefined, true, undefined, this);
501021
500941
  $2[3] = verbose;
@@ -501167,7 +501087,7 @@ var init_AutoUpdaterWrapper = __esm(() => {
501167
501087
  });
501168
501088
 
501169
501089
  // src/components/IdeStatusIndicator.tsx
501170
- import { basename as basename56 } from "path";
501090
+ import { basename as basename57 } from "path";
501171
501091
  function IdeStatusIndicator(t0) {
501172
501092
  const $2 = c3(7);
501173
501093
  const {
@@ -501207,7 +501127,7 @@ function IdeStatusIndicator(t0) {
501207
501127
  if (ideSelection.filePath) {
501208
501128
  let t1;
501209
501129
  if ($2[3] !== ideSelection.filePath) {
501210
- t1 = basename56(ideSelection.filePath);
501130
+ t1 = basename57(ideSelection.filePath);
501211
501131
  $2[3] = ideSelection.filePath;
501212
501132
  $2[4] = t1;
501213
501133
  } else {
@@ -504428,7 +504348,7 @@ var init_slackChannelSuggestions = __esm(() => {
504428
504348
  });
504429
504349
 
504430
504350
  // src/hooks/unifiedSuggestions.ts
504431
- import { basename as basename57 } from "path";
504351
+ import { basename as basename58 } from "path";
504432
504352
  function createSuggestionFromSource(source) {
504433
504353
  switch (source.type) {
504434
504354
  case "file":
@@ -504490,7 +504410,7 @@ async function generateUnifiedSuggestions(query2, mcpResources, agents2, showOnE
504490
504410
  displayText: suggestion.displayText,
504491
504411
  description: suggestion.description,
504492
504412
  path: suggestion.displayText,
504493
- filename: basename57(suggestion.displayText),
504413
+ filename: basename58(suggestion.displayText),
504494
504414
  score: suggestion.metadata?.score
504495
504415
  }));
504496
504416
  const mcpSources = Object.values(mcpResources).flat().map((resource) => ({
@@ -505710,7 +505630,7 @@ var init_AutoModeOptInDialog = __esm(() => {
505710
505630
  });
505711
505631
 
505712
505632
  // src/components/BridgeDialog.tsx
505713
- import { basename as basename58 } from "path";
505633
+ import { basename as basename59 } from "path";
505714
505634
  function BridgeDialog(t0) {
505715
505635
  const $2 = c3(87);
505716
505636
  const {
@@ -505733,7 +505653,7 @@ function BridgeDialog(t0) {
505733
505653
  const [branchName, setBranchName] = import_react229.useState("");
505734
505654
  let t1;
505735
505655
  if ($2[0] === Symbol.for("react.memo_cache_sentinel")) {
505736
- t1 = basename58(getOriginalCwd());
505656
+ t1 = basename59(getOriginalCwd());
505737
505657
  $2[0] = t1;
505738
505658
  } else {
505739
505659
  t1 = $2[0];
@@ -508575,7 +508495,7 @@ function buildStatusLineCommandInput(permissionMode, exceedsHalfContext, setting
508575
508495
  project_dir: getOriginalCwd(),
508576
508496
  added_dirs: addedDirs
508577
508497
  },
508578
- version: "2.3.4",
508498
+ version: "2.3.5",
508579
508499
  output_style: {
508580
508500
  name: outputStyleName
508581
508501
  },
@@ -518505,7 +518425,7 @@ __export(exports_asciicast, {
518505
518425
  _resetRecordingStateForTesting: () => _resetRecordingStateForTesting
518506
518426
  });
518507
518427
  import { appendFile as appendFile6, rename as rename10 } from "fs/promises";
518508
- import { basename as basename59, dirname as dirname58, join as join161 } from "path";
518428
+ import { basename as basename60, dirname as dirname58, join as join161 } from "path";
518509
518429
  function getRecordFilePath() {
518510
518430
  if (recordingState.filePath !== null) {
518511
518431
  return recordingState.filePath;
@@ -518551,8 +518471,8 @@ async function renameRecordingForSession() {
518551
518471
  return;
518552
518472
  }
518553
518473
  await recorder?.flush();
518554
- const oldName = basename59(oldPath);
518555
- const newName = basename59(newPath);
518474
+ const oldName = basename60(oldPath);
518475
+ const newName = basename60(newPath);
518556
518476
  try {
518557
518477
  await rename10(oldPath, newPath);
518558
518478
  recordingState.filePath = newPath;
@@ -520147,7 +520067,7 @@ async function submitTranscriptShare(messages, trigger, appearanceId) {
520147
520067
  } catch {}
520148
520068
  const data = {
520149
520069
  trigger,
520150
- version: "2.3.4",
520070
+ version: "2.3.5",
520151
520071
  platform: process.platform,
520152
520072
  transcript,
520153
520073
  subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
@@ -520765,7 +520685,6 @@ var init_sessionMemoryCompact = __esm(() => {
520765
520685
  init_sessionMemoryUtils();
520766
520686
  init_compact();
520767
520687
  init_microCompact();
520768
- init_prompt10();
520769
520688
  DEFAULT_SM_COMPACT_CONFIG = {
520770
520689
  minTokens: 1e4,
520771
520690
  minTextBlockMessages: 5,
@@ -522417,7 +522336,7 @@ var init_tipRegistry = __esm(() => {
522417
522336
  init_DesktopUpsellStartup();
522418
522337
  init_color();
522419
522338
  init_shortcutFormat();
522420
- init_prompt12();
522339
+ init_prompt11();
522421
522340
  init_auth2();
522422
522341
  init_concurrentSessions();
522423
522342
  init_config();
@@ -525641,7 +525560,7 @@ var init_usePluginAutoupdateNotification = __esm(() => {
525641
525560
  });
525642
525561
 
525643
525562
  // src/utils/plugins/reconciler.ts
525644
- import { isAbsolute as isAbsolute24, resolve as resolve43 } from "path";
525563
+ import { isAbsolute as isAbsolute25, resolve as resolve43 } from "path";
525645
525564
  function diffMarketplaces(declared, materialized, opts) {
525646
525565
  const missing = [];
525647
525566
  const sourceChanged = [];
@@ -525749,7 +525668,7 @@ async function reconcileMarketplaces(opts) {
525749
525668
  return { installed, updated, failed, upToDate: diff2.upToDate, skipped };
525750
525669
  }
525751
525670
  function normalizeSource(source, projectRoot) {
525752
- if ((source.source === "directory" || source.source === "file") && !isAbsolute24(source.path)) {
525671
+ if ((source.source === "directory" || source.source === "file") && !isAbsolute25(source.path)) {
525753
525672
  const base = projectRoot ?? getOriginalCwd();
525754
525673
  const canonicalRoot = findCanonicalGitRoot(base);
525755
525674
  return {
@@ -531195,7 +531114,7 @@ var init_REPL = __esm(() => {
531195
531114
  init_ExitPlanModePermissionRequest();
531196
531115
  init_permissionSetup();
531197
531116
  init_filesystem();
531198
- init_prompt11();
531117
+ init_prompt10();
531199
531118
  init_bashPermissions();
531200
531119
  init_config();
531201
531120
  init_billing();
@@ -537120,7 +537039,7 @@ function appendToLog(path17, message) {
537120
537039
  cwd: getFsImplementation().cwd(),
537121
537040
  userType: process.env.USER_TYPE,
537122
537041
  sessionId: getSessionId(),
537123
- version: "2.3.4"
537042
+ version: "2.3.5"
537124
537043
  };
537125
537044
  getLogWriter(path17).write(messageWithTimestamp);
537126
537045
  }
@@ -540613,7 +540532,7 @@ var init_idleTimeout = __esm(() => {
540613
540532
  // src/bridge/inboundAttachments.ts
540614
540533
  import { randomUUID as randomUUID50 } from "crypto";
540615
540534
  import { mkdir as mkdir62, writeFile as writeFile65 } from "fs/promises";
540616
- import { basename as basename60, join as join168 } from "path";
540535
+ import { basename as basename61, join as join168 } from "path";
540617
540536
  import { z as z95 } from "zod/v4";
540618
540537
  function debug3(msg) {
540619
540538
  logForDebugging(`[bridge:inbound-attach] ${msg}`);
@@ -540626,7 +540545,7 @@ function extractInboundAttachments(msg) {
540626
540545
  return parsed.success ? parsed.data : [];
540627
540546
  }
540628
540547
  function sanitizeFileName(name) {
540629
- const base = basename60(name).replace(/[^a-zA-Z0-9._-]/g, "_");
540548
+ const base = basename61(name).replace(/[^a-zA-Z0-9._-]/g, "_");
540630
540549
  return base || "attachment";
540631
540550
  }
540632
540551
  function uploadsDir() {
@@ -540919,8 +540838,8 @@ async function getEnvLessBridgeConfig() {
540919
540838
  }
540920
540839
  async function checkEnvLessBridgeMinVersion() {
540921
540840
  const cfg = await getEnvLessBridgeConfig();
540922
- if (cfg.min_version && lt("2.3.4", cfg.min_version)) {
540923
- return `Your version of localclawd (${"2.3.4"}) is too old for Remote Control.
540841
+ if (cfg.min_version && lt("2.3.5", cfg.min_version)) {
540842
+ return `Your version of localclawd (${"2.3.5"}) is too old for Remote Control.
540924
540843
  Version ${cfg.min_version} or higher is required. Run \`localclawd update\` to update.`;
540925
540844
  }
540926
540845
  return null;
@@ -541392,7 +541311,7 @@ async function initBridgeCore(params) {
541392
541311
  const rawApi = createBridgeApiClient({
541393
541312
  baseUrl,
541394
541313
  getAccessToken,
541395
- runnerVersion: "2.3.4",
541314
+ runnerVersion: "2.3.5",
541396
541315
  onDebug: logForDebugging,
541397
541316
  onAuth401,
541398
541317
  getTrustedDeviceToken
@@ -547111,7 +547030,7 @@ async function startMCPServer(cwd3, debug4, verbose) {
547111
547030
  setCwd(cwd3);
547112
547031
  const server = new Server({
547113
547032
  name: "claude/tengu",
547114
- version: "2.3.4"
547033
+ version: "2.3.5"
547115
547034
  }, {
547116
547035
  capabilities: {
547117
547036
  tools: {}
@@ -547664,7 +547583,7 @@ __export(exports_plugins, {
547664
547583
  VALID_UPDATE_SCOPES: () => VALID_UPDATE_SCOPES,
547665
547584
  VALID_INSTALLABLE_SCOPES: () => VALID_INSTALLABLE_SCOPES
547666
547585
  });
547667
- import { basename as basename61, dirname as dirname65 } from "path";
547586
+ import { basename as basename62, dirname as dirname65 } from "path";
547668
547587
  function handleMarketplaceError(error5, action2) {
547669
547588
  logError(error5);
547670
547589
  cliError(`${figures_default.cross} Failed to ${action2}: ${errorMessage(error5)}`);
@@ -547698,7 +547617,7 @@ async function pluginValidateHandler(manifestPath, options) {
547698
547617
  let contentResults = [];
547699
547618
  if (result.fileType === "plugin") {
547700
547619
  const manifestDir = dirname65(result.filePath);
547701
- if (basename61(manifestDir) === ".claude-plugin") {
547620
+ if (basename62(manifestDir) === ".claude-plugin") {
547702
547621
  contentResults = await validatePluginContents(dirname65(manifestDir));
547703
547622
  for (const r2 of contentResults) {
547704
547623
  console.log(`Validating ${r2.fileType}: ${r2.filePath}
@@ -548192,7 +548111,7 @@ function WelcomeLogo() {
548192
548111
  dimColor: true,
548193
548112
  children: [
548194
548113
  "v",
548195
- "2.3.4"
548114
+ "2.3.5"
548196
548115
  ]
548197
548116
  }, undefined, true, undefined, this)
548198
548117
  ]
@@ -548383,7 +548302,7 @@ __export(exports_update, {
548383
548302
  });
548384
548303
  async function update() {
548385
548304
  logEvent("tengu_update_check", {});
548386
- writeToStdout(`Current version: ${"2.3.4"}
548305
+ writeToStdout(`Current version: ${"2.3.5"}
548387
548306
  `);
548388
548307
  const channel = getInitialSettings()?.autoUpdatesChannel ?? "latest";
548389
548308
  writeToStdout(`Checking for updates to ${channel} version...
@@ -548458,8 +548377,8 @@ async function update() {
548458
548377
  writeToStdout(`localclawd is managed by Homebrew.
548459
548378
  `);
548460
548379
  const latest = await getLatestVersion(channel);
548461
- if (latest && !gte("2.3.4", latest)) {
548462
- writeToStdout(`Update available: ${"2.3.4"} → ${latest}
548380
+ if (latest && !gte("2.3.5", latest)) {
548381
+ writeToStdout(`Update available: ${"2.3.5"} → ${latest}
548463
548382
  `);
548464
548383
  writeToStdout(`
548465
548384
  `);
@@ -548475,8 +548394,8 @@ async function update() {
548475
548394
  writeToStdout(`localclawd is managed by winget.
548476
548395
  `);
548477
548396
  const latest = await getLatestVersion(channel);
548478
- if (latest && !gte("2.3.4", latest)) {
548479
- writeToStdout(`Update available: ${"2.3.4"} → ${latest}
548397
+ if (latest && !gte("2.3.5", latest)) {
548398
+ writeToStdout(`Update available: ${"2.3.5"} → ${latest}
548480
548399
  `);
548481
548400
  writeToStdout(`
548482
548401
  `);
@@ -548490,8 +548409,8 @@ async function update() {
548490
548409
  writeToStdout(`localclawd is managed by apk.
548491
548410
  `);
548492
548411
  const latest = await getLatestVersion(channel);
548493
- if (latest && !gte("2.3.4", latest)) {
548494
- writeToStdout(`Update available: ${"2.3.4"} → ${latest}
548412
+ if (latest && !gte("2.3.5", latest)) {
548413
+ writeToStdout(`Update available: ${"2.3.5"} → ${latest}
548495
548414
  `);
548496
548415
  writeToStdout(`
548497
548416
  `);
@@ -548556,11 +548475,11 @@ async function update() {
548556
548475
  `);
548557
548476
  await gracefulShutdown(1);
548558
548477
  }
548559
- if (result.latestVersion === "2.3.4") {
548560
- writeToStdout(source_default.green(`localclawd is up to date (${"2.3.4"})`) + `
548478
+ if (result.latestVersion === "2.3.5") {
548479
+ writeToStdout(source_default.green(`localclawd is up to date (${"2.3.5"})`) + `
548561
548480
  `);
548562
548481
  } else {
548563
- writeToStdout(source_default.green(`Successfully updated from ${"2.3.4"} to version ${result.latestVersion}`) + `
548482
+ writeToStdout(source_default.green(`Successfully updated from ${"2.3.5"} to version ${result.latestVersion}`) + `
548564
548483
  `);
548565
548484
  await regenerateCompletionCache();
548566
548485
  }
@@ -548620,12 +548539,12 @@ async function update() {
548620
548539
  `);
548621
548540
  await gracefulShutdown(1);
548622
548541
  }
548623
- if (latestVersion === "2.3.4") {
548624
- writeToStdout(source_default.green(`localclawd is up to date (${"2.3.4"})`) + `
548542
+ if (latestVersion === "2.3.5") {
548543
+ writeToStdout(source_default.green(`localclawd is up to date (${"2.3.5"})`) + `
548625
548544
  `);
548626
548545
  await gracefulShutdown(0);
548627
548546
  }
548628
- writeToStdout(`New version available: ${latestVersion} (current: ${"2.3.4"})
548547
+ writeToStdout(`New version available: ${latestVersion} (current: ${"2.3.5"})
548629
548548
  `);
548630
548549
  writeToStdout(`Installing update...
548631
548550
  `);
@@ -548670,7 +548589,7 @@ async function update() {
548670
548589
  logForDebugging(`update: Installation status: ${status2}`);
548671
548590
  switch (status2) {
548672
548591
  case "success":
548673
- writeToStdout(source_default.green(`Successfully updated from ${"2.3.4"} to version ${latestVersion}`) + `
548592
+ writeToStdout(source_default.green(`Successfully updated from ${"2.3.5"} to version ${latestVersion}`) + `
548674
548593
  `);
548675
548594
  await regenerateCompletionCache();
548676
548595
  break;
@@ -549912,7 +549831,7 @@ Run with --debug for more details.
549912
549831
  }
549913
549832
  }
549914
549833
  logForDiagnosticsNoPII("info", "started", {
549915
- version: "2.3.4",
549834
+ version: "2.3.5",
549916
549835
  is_native_binary: isInBundledMode()
549917
549836
  });
549918
549837
  registerCleanup(async () => {
@@ -550696,7 +550615,7 @@ Usage: localclawd --remote "your task description"`, () => gracefulShutdown(1));
550696
550615
  pendingHookMessages
550697
550616
  }, renderAndRun);
550698
550617
  }
550699
- }).version("2.3.4 (localclawd)", "-v, --version", "Output the version number");
550618
+ }).version("2.3.5 (localclawd)", "-v, --version", "Output the version number");
550700
550619
  program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
550701
550620
  program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
550702
550621
  if (canUserConfigureAdvisor()) {
@@ -551210,7 +551129,7 @@ if (false) {}
551210
551129
  async function main2() {
551211
551130
  const args = process.argv.slice(2);
551212
551131
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
551213
- console.log(`${"2.3.4"} (localclawd)`);
551132
+ console.log(`${"2.3.5"} (localclawd)`);
551214
551133
  return;
551215
551134
  }
551216
551135
  const {
@@ -551301,4 +551220,4 @@ localclawd crashed: ${msg}
551301
551220
  process.exit(1);
551302
551221
  });
551303
551222
 
551304
- //# debugId=A5F8BEA60598962064756E2164756E21
551223
+ //# debugId=842A682EBF63408664756E2164756E21