localclawd 1.7.0 → 1.7.1

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 +1621 -1311
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -2476,14 +2476,17 @@ function getTotalCacheCreationInputTokens() {
2476
2476
  function getTotalWebSearchRequests() {
2477
2477
  return sumBy_default(Object.values(STATE.modelUsage), "webSearchRequests");
2478
2478
  }
2479
+ function getTotalTurnTokens() {
2480
+ return getTotalInputTokens() + getTotalOutputTokens() + getTotalCacheReadInputTokens() + getTotalCacheCreationInputTokens();
2481
+ }
2479
2482
  function getTurnOutputTokens() {
2480
- return getTotalOutputTokens() - outputTokensAtTurnStart;
2483
+ return getTotalTurnTokens() - turnTokensAtTurnStart;
2481
2484
  }
2482
2485
  function getCurrentTurnTokenBudget() {
2483
2486
  return currentTurnTokenBudget;
2484
2487
  }
2485
2488
  function snapshotOutputTokensForTurn(budget) {
2486
- outputTokensAtTurnStart = getTotalOutputTokens();
2489
+ turnTokensAtTurnStart = getTotalTurnTokens();
2487
2490
  currentTurnTokenBudget = budget;
2488
2491
  budgetContinuationCount = 0;
2489
2492
  }
@@ -3152,7 +3155,7 @@ function getPromptId() {
3152
3155
  function setPromptId(id) {
3153
3156
  STATE.promptId = id;
3154
3157
  }
3155
- var STATE, sessionSwitched, onSessionSwitch, interactionTimeDirty = false, outputTokensAtTurnStart = 0, currentTurnTokenBudget = null, budgetContinuationCount = 0, scrollDraining = false, scrollDrainTimer, SCROLL_DRAIN_IDLE_MS = 150, MAX_SLOW_OPERATIONS = 10, SLOW_OPERATION_TTL_MS = 1e4, EMPTY_SLOW_OPERATIONS;
3158
+ var STATE, sessionSwitched, onSessionSwitch, interactionTimeDirty = false, turnTokensAtTurnStart = 0, currentTurnTokenBudget = null, budgetContinuationCount = 0, scrollDraining = false, scrollDrainTimer, SCROLL_DRAIN_IDLE_MS = 150, MAX_SLOW_OPERATIONS = 10, SLOW_OPERATION_TTL_MS = 1e4, EMPTY_SLOW_OPERATIONS;
3156
3159
  var init_state = __esm(() => {
3157
3160
  init_sumBy();
3158
3161
  init_crypto();
@@ -12719,6 +12722,556 @@ var init_git = __esm(() => {
12719
12722
  });
12720
12723
  });
12721
12724
 
12725
+ // node_modules/lodash-es/_assignMergeValue.js
12726
+ function assignMergeValue(object, key, value) {
12727
+ if (value !== undefined && !eq_default(object[key], value) || value === undefined && !(key in object)) {
12728
+ _baseAssignValue_default(object, key, value);
12729
+ }
12730
+ }
12731
+ var _assignMergeValue_default;
12732
+ var init__assignMergeValue = __esm(() => {
12733
+ init__baseAssignValue();
12734
+ init_eq();
12735
+ _assignMergeValue_default = assignMergeValue;
12736
+ });
12737
+
12738
+ // node_modules/lodash-es/_createBaseFor.js
12739
+ function createBaseFor(fromRight) {
12740
+ return function(object, iteratee, keysFunc) {
12741
+ var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
12742
+ while (length--) {
12743
+ var key = props[fromRight ? length : ++index];
12744
+ if (iteratee(iterable[key], key, iterable) === false) {
12745
+ break;
12746
+ }
12747
+ }
12748
+ return object;
12749
+ };
12750
+ }
12751
+ var _createBaseFor_default;
12752
+ var init__createBaseFor = __esm(() => {
12753
+ _createBaseFor_default = createBaseFor;
12754
+ });
12755
+
12756
+ // node_modules/lodash-es/_baseFor.js
12757
+ var baseFor, _baseFor_default;
12758
+ var init__baseFor = __esm(() => {
12759
+ init__createBaseFor();
12760
+ baseFor = _createBaseFor_default();
12761
+ _baseFor_default = baseFor;
12762
+ });
12763
+
12764
+ // node_modules/lodash-es/isArrayLikeObject.js
12765
+ function isArrayLikeObject(value) {
12766
+ return isObjectLike_default(value) && isArrayLike_default(value);
12767
+ }
12768
+ var isArrayLikeObject_default;
12769
+ var init_isArrayLikeObject = __esm(() => {
12770
+ init_isArrayLike();
12771
+ init_isObjectLike();
12772
+ isArrayLikeObject_default = isArrayLikeObject;
12773
+ });
12774
+
12775
+ // node_modules/lodash-es/isPlainObject.js
12776
+ function isPlainObject(value) {
12777
+ if (!isObjectLike_default(value) || _baseGetTag_default(value) != objectTag5) {
12778
+ return false;
12779
+ }
12780
+ var proto = _getPrototype_default(value);
12781
+ if (proto === null) {
12782
+ return true;
12783
+ }
12784
+ var Ctor = hasOwnProperty13.call(proto, "constructor") && proto.constructor;
12785
+ return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString3.call(Ctor) == objectCtorString;
12786
+ }
12787
+ var objectTag5 = "[object Object]", funcProto3, objectProto16, funcToString3, hasOwnProperty13, objectCtorString, isPlainObject_default;
12788
+ var init_isPlainObject = __esm(() => {
12789
+ init__baseGetTag();
12790
+ init__getPrototype();
12791
+ init_isObjectLike();
12792
+ funcProto3 = Function.prototype;
12793
+ objectProto16 = Object.prototype;
12794
+ funcToString3 = funcProto3.toString;
12795
+ hasOwnProperty13 = objectProto16.hasOwnProperty;
12796
+ objectCtorString = funcToString3.call(Object);
12797
+ isPlainObject_default = isPlainObject;
12798
+ });
12799
+
12800
+ // node_modules/lodash-es/_safeGet.js
12801
+ function safeGet(object, key) {
12802
+ if (key === "constructor" && typeof object[key] === "function") {
12803
+ return;
12804
+ }
12805
+ if (key == "__proto__") {
12806
+ return;
12807
+ }
12808
+ return object[key];
12809
+ }
12810
+ var _safeGet_default;
12811
+ var init__safeGet = __esm(() => {
12812
+ _safeGet_default = safeGet;
12813
+ });
12814
+
12815
+ // node_modules/lodash-es/toPlainObject.js
12816
+ function toPlainObject(value) {
12817
+ return _copyObject_default(value, keysIn_default(value));
12818
+ }
12819
+ var toPlainObject_default;
12820
+ var init_toPlainObject = __esm(() => {
12821
+ init__copyObject();
12822
+ init_keysIn();
12823
+ toPlainObject_default = toPlainObject;
12824
+ });
12825
+
12826
+ // node_modules/lodash-es/_baseMergeDeep.js
12827
+ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
12828
+ var objValue = _safeGet_default(object, key), srcValue = _safeGet_default(source, key), stacked = stack.get(srcValue);
12829
+ if (stacked) {
12830
+ _assignMergeValue_default(object, key, stacked);
12831
+ return;
12832
+ }
12833
+ var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : undefined;
12834
+ var isCommon = newValue === undefined;
12835
+ if (isCommon) {
12836
+ var isArr = isArray_default(srcValue), isBuff = !isArr && isBuffer_default(srcValue), isTyped = !isArr && !isBuff && isTypedArray_default(srcValue);
12837
+ newValue = srcValue;
12838
+ if (isArr || isBuff || isTyped) {
12839
+ if (isArray_default(objValue)) {
12840
+ newValue = objValue;
12841
+ } else if (isArrayLikeObject_default(objValue)) {
12842
+ newValue = _copyArray_default(objValue);
12843
+ } else if (isBuff) {
12844
+ isCommon = false;
12845
+ newValue = _cloneBuffer_default(srcValue, true);
12846
+ } else if (isTyped) {
12847
+ isCommon = false;
12848
+ newValue = _cloneTypedArray_default(srcValue, true);
12849
+ } else {
12850
+ newValue = [];
12851
+ }
12852
+ } else if (isPlainObject_default(srcValue) || isArguments_default(srcValue)) {
12853
+ newValue = objValue;
12854
+ if (isArguments_default(objValue)) {
12855
+ newValue = toPlainObject_default(objValue);
12856
+ } else if (!isObject_default(objValue) || isFunction_default(objValue)) {
12857
+ newValue = _initCloneObject_default(srcValue);
12858
+ }
12859
+ } else {
12860
+ isCommon = false;
12861
+ }
12862
+ }
12863
+ if (isCommon) {
12864
+ stack.set(srcValue, newValue);
12865
+ mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
12866
+ stack["delete"](srcValue);
12867
+ }
12868
+ _assignMergeValue_default(object, key, newValue);
12869
+ }
12870
+ var _baseMergeDeep_default;
12871
+ var init__baseMergeDeep = __esm(() => {
12872
+ init__assignMergeValue();
12873
+ init__cloneBuffer();
12874
+ init__cloneTypedArray();
12875
+ init__copyArray();
12876
+ init__initCloneObject();
12877
+ init_isArguments();
12878
+ init_isArray();
12879
+ init_isArrayLikeObject();
12880
+ init_isBuffer();
12881
+ init_isFunction();
12882
+ init_isObject();
12883
+ init_isPlainObject();
12884
+ init_isTypedArray();
12885
+ init__safeGet();
12886
+ init_toPlainObject();
12887
+ _baseMergeDeep_default = baseMergeDeep;
12888
+ });
12889
+
12890
+ // node_modules/lodash-es/_baseMerge.js
12891
+ function baseMerge(object, source, srcIndex, customizer, stack) {
12892
+ if (object === source) {
12893
+ return;
12894
+ }
12895
+ _baseFor_default(source, function(srcValue, key) {
12896
+ stack || (stack = new _Stack_default);
12897
+ if (isObject_default(srcValue)) {
12898
+ _baseMergeDeep_default(object, source, key, srcIndex, baseMerge, customizer, stack);
12899
+ } else {
12900
+ var newValue = customizer ? customizer(_safeGet_default(object, key), srcValue, key + "", object, source, stack) : undefined;
12901
+ if (newValue === undefined) {
12902
+ newValue = srcValue;
12903
+ }
12904
+ _assignMergeValue_default(object, key, newValue);
12905
+ }
12906
+ }, keysIn_default);
12907
+ }
12908
+ var _baseMerge_default;
12909
+ var init__baseMerge = __esm(() => {
12910
+ init__Stack();
12911
+ init__assignMergeValue();
12912
+ init__baseFor();
12913
+ init__baseMergeDeep();
12914
+ init_isObject();
12915
+ init_keysIn();
12916
+ init__safeGet();
12917
+ _baseMerge_default = baseMerge;
12918
+ });
12919
+
12920
+ // node_modules/lodash-es/_apply.js
12921
+ function apply(func, thisArg, args) {
12922
+ switch (args.length) {
12923
+ case 0:
12924
+ return func.call(thisArg);
12925
+ case 1:
12926
+ return func.call(thisArg, args[0]);
12927
+ case 2:
12928
+ return func.call(thisArg, args[0], args[1]);
12929
+ case 3:
12930
+ return func.call(thisArg, args[0], args[1], args[2]);
12931
+ }
12932
+ return func.apply(thisArg, args);
12933
+ }
12934
+ var _apply_default;
12935
+ var init__apply = __esm(() => {
12936
+ _apply_default = apply;
12937
+ });
12938
+
12939
+ // node_modules/lodash-es/_overRest.js
12940
+ function overRest(func, start, transform) {
12941
+ start = nativeMax(start === undefined ? func.length - 1 : start, 0);
12942
+ return function() {
12943
+ var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length);
12944
+ while (++index < length) {
12945
+ array[index] = args[start + index];
12946
+ }
12947
+ index = -1;
12948
+ var otherArgs = Array(start + 1);
12949
+ while (++index < start) {
12950
+ otherArgs[index] = args[index];
12951
+ }
12952
+ otherArgs[start] = transform(array);
12953
+ return _apply_default(func, this, otherArgs);
12954
+ };
12955
+ }
12956
+ var nativeMax, _overRest_default;
12957
+ var init__overRest = __esm(() => {
12958
+ init__apply();
12959
+ nativeMax = Math.max;
12960
+ _overRest_default = overRest;
12961
+ });
12962
+
12963
+ // node_modules/lodash-es/constant.js
12964
+ function constant(value) {
12965
+ return function() {
12966
+ return value;
12967
+ };
12968
+ }
12969
+ var constant_default;
12970
+ var init_constant = __esm(() => {
12971
+ constant_default = constant;
12972
+ });
12973
+
12974
+ // node_modules/lodash-es/_baseSetToString.js
12975
+ var baseSetToString, _baseSetToString_default;
12976
+ var init__baseSetToString = __esm(() => {
12977
+ init_constant();
12978
+ init__defineProperty();
12979
+ init_identity();
12980
+ baseSetToString = !_defineProperty_default ? identity_default : function(func, string) {
12981
+ return _defineProperty_default(func, "toString", {
12982
+ configurable: true,
12983
+ enumerable: false,
12984
+ value: constant_default(string),
12985
+ writable: true
12986
+ });
12987
+ };
12988
+ _baseSetToString_default = baseSetToString;
12989
+ });
12990
+
12991
+ // node_modules/lodash-es/_shortOut.js
12992
+ function shortOut(func) {
12993
+ var count = 0, lastCalled = 0;
12994
+ return function() {
12995
+ var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
12996
+ lastCalled = stamp;
12997
+ if (remaining > 0) {
12998
+ if (++count >= HOT_COUNT) {
12999
+ return arguments[0];
13000
+ }
13001
+ } else {
13002
+ count = 0;
13003
+ }
13004
+ return func.apply(undefined, arguments);
13005
+ };
13006
+ }
13007
+ var HOT_COUNT = 800, HOT_SPAN = 16, nativeNow, _shortOut_default;
13008
+ var init__shortOut = __esm(() => {
13009
+ nativeNow = Date.now;
13010
+ _shortOut_default = shortOut;
13011
+ });
13012
+
13013
+ // node_modules/lodash-es/_setToString.js
13014
+ var setToString, _setToString_default;
13015
+ var init__setToString = __esm(() => {
13016
+ init__baseSetToString();
13017
+ init__shortOut();
13018
+ setToString = _shortOut_default(_baseSetToString_default);
13019
+ _setToString_default = setToString;
13020
+ });
13021
+
13022
+ // node_modules/lodash-es/_baseRest.js
13023
+ function baseRest(func, start) {
13024
+ return _setToString_default(_overRest_default(func, start, identity_default), func + "");
13025
+ }
13026
+ var _baseRest_default;
13027
+ var init__baseRest = __esm(() => {
13028
+ init_identity();
13029
+ init__overRest();
13030
+ init__setToString();
13031
+ _baseRest_default = baseRest;
13032
+ });
13033
+
13034
+ // node_modules/lodash-es/_isIterateeCall.js
13035
+ function isIterateeCall(value, index, object) {
13036
+ if (!isObject_default(object)) {
13037
+ return false;
13038
+ }
13039
+ var type = typeof index;
13040
+ if (type == "number" ? isArrayLike_default(object) && _isIndex_default(index, object.length) : type == "string" && (index in object)) {
13041
+ return eq_default(object[index], value);
13042
+ }
13043
+ return false;
13044
+ }
13045
+ var _isIterateeCall_default;
13046
+ var init__isIterateeCall = __esm(() => {
13047
+ init_eq();
13048
+ init_isArrayLike();
13049
+ init__isIndex();
13050
+ init_isObject();
13051
+ _isIterateeCall_default = isIterateeCall;
13052
+ });
13053
+
13054
+ // node_modules/lodash-es/_createAssigner.js
13055
+ function createAssigner(assigner) {
13056
+ return _baseRest_default(function(object, sources) {
13057
+ var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined, guard = length > 2 ? sources[2] : undefined;
13058
+ customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : undefined;
13059
+ if (guard && _isIterateeCall_default(sources[0], sources[1], guard)) {
13060
+ customizer = length < 3 ? undefined : customizer;
13061
+ length = 1;
13062
+ }
13063
+ object = Object(object);
13064
+ while (++index < length) {
13065
+ var source = sources[index];
13066
+ if (source) {
13067
+ assigner(object, source, index, customizer);
13068
+ }
13069
+ }
13070
+ return object;
13071
+ });
13072
+ }
13073
+ var _createAssigner_default;
13074
+ var init__createAssigner = __esm(() => {
13075
+ init__baseRest();
13076
+ init__isIterateeCall();
13077
+ _createAssigner_default = createAssigner;
13078
+ });
13079
+
13080
+ // node_modules/lodash-es/mergeWith.js
13081
+ var mergeWith, mergeWith_default;
13082
+ var init_mergeWith = __esm(() => {
13083
+ init__baseMerge();
13084
+ init__createAssigner();
13085
+ mergeWith = _createAssigner_default(function(object, source, srcIndex, customizer) {
13086
+ _baseMerge_default(object, source, srcIndex, customizer);
13087
+ });
13088
+ mergeWith_default = mergeWith;
13089
+ });
13090
+
13091
+ // src/utils/fileRead.ts
13092
+ function detectEncodingForResolvedPath(resolvedPath) {
13093
+ const { buffer, bytesRead } = getFsImplementation().readSync(resolvedPath, {
13094
+ length: 4096
13095
+ });
13096
+ if (bytesRead === 0) {
13097
+ return "utf8";
13098
+ }
13099
+ if (bytesRead >= 2) {
13100
+ if (buffer[0] === 255 && buffer[1] === 254)
13101
+ return "utf16le";
13102
+ }
13103
+ if (bytesRead >= 3 && buffer[0] === 239 && buffer[1] === 187 && buffer[2] === 191) {
13104
+ return "utf8";
13105
+ }
13106
+ return "utf8";
13107
+ }
13108
+ function detectLineEndingsForString(content) {
13109
+ let crlfCount = 0;
13110
+ let lfCount = 0;
13111
+ for (let i = 0;i < content.length; i++) {
13112
+ if (content[i] === `
13113
+ `) {
13114
+ if (i > 0 && content[i - 1] === "\r") {
13115
+ crlfCount++;
13116
+ } else {
13117
+ lfCount++;
13118
+ }
13119
+ }
13120
+ }
13121
+ return crlfCount > lfCount ? "CRLF" : "LF";
13122
+ }
13123
+ function readFileSyncWithMetadata(filePath) {
13124
+ const fs2 = getFsImplementation();
13125
+ const { resolvedPath, isSymlink } = safeResolvePath(fs2, filePath);
13126
+ if (isSymlink) {
13127
+ logForDebugging(`Reading through symlink: ${filePath} -> ${resolvedPath}`);
13128
+ }
13129
+ const encoding = detectEncodingForResolvedPath(resolvedPath);
13130
+ const raw = fs2.readFileSync(resolvedPath, { encoding });
13131
+ const lineEndings = detectLineEndingsForString(raw.slice(0, 4096));
13132
+ return {
13133
+ content: raw.replaceAll(`\r
13134
+ `, `
13135
+ `),
13136
+ encoding,
13137
+ lineEndings
13138
+ };
13139
+ }
13140
+ function readFileSync3(filePath) {
13141
+ return readFileSyncWithMetadata(filePath).content;
13142
+ }
13143
+ var init_fileRead = __esm(() => {
13144
+ init_debug();
13145
+ init_fsOperations();
13146
+ });
13147
+
13148
+ // src/utils/jsonRead.ts
13149
+ function stripBOM(content) {
13150
+ return content.startsWith(UTF8_BOM) ? content.slice(1) : content;
13151
+ }
13152
+ var UTF8_BOM = "\uFEFF";
13153
+
13154
+ // src/services/remoteManagedSettings/syncCacheState.ts
13155
+ import { join as join9 } from "path";
13156
+ function setSessionCache(value) {
13157
+ sessionCache = value;
13158
+ }
13159
+ function resetSyncCache() {
13160
+ sessionCache = null;
13161
+ eligible = undefined;
13162
+ }
13163
+ function setEligibility(v) {
13164
+ eligible = v;
13165
+ return v;
13166
+ }
13167
+ function getSettingsPath() {
13168
+ return join9(getClaudeConfigHomeDir(), SETTINGS_FILENAME);
13169
+ }
13170
+ function loadSettings() {
13171
+ try {
13172
+ const content = readFileSync3(getSettingsPath());
13173
+ const data = jsonParse(stripBOM(content));
13174
+ if (!data || typeof data !== "object" || Array.isArray(data)) {
13175
+ return null;
13176
+ }
13177
+ return data;
13178
+ } catch {
13179
+ return null;
13180
+ }
13181
+ }
13182
+ function getRemoteManagedSettingsSyncFromCache() {
13183
+ if (eligible !== true)
13184
+ return null;
13185
+ if (sessionCache)
13186
+ return sessionCache;
13187
+ const cachedSettings = loadSettings();
13188
+ if (cachedSettings) {
13189
+ sessionCache = cachedSettings;
13190
+ resetSettingsCache();
13191
+ return cachedSettings;
13192
+ }
13193
+ return null;
13194
+ }
13195
+ var SETTINGS_FILENAME = "remote-settings.json", sessionCache = null, eligible;
13196
+ var init_syncCacheState = __esm(() => {
13197
+ init_envUtils();
13198
+ init_fileRead();
13199
+ init_settingsCache();
13200
+ init_slowOperations();
13201
+ });
13202
+
13203
+ // src/utils/array.ts
13204
+ function intersperse(as, separator) {
13205
+ return as.flatMap((a, i) => i ? [separator(i), a] : [a]);
13206
+ }
13207
+ function count(arr, pred) {
13208
+ let n = 0;
13209
+ for (const x2 of arr)
13210
+ n += +!!pred(x2);
13211
+ return n;
13212
+ }
13213
+ function uniq(xs) {
13214
+ return [...new Set(xs)];
13215
+ }
13216
+
13217
+ // src/utils/fileReadCache.ts
13218
+ class FileReadCache {
13219
+ cache = new Map;
13220
+ maxCacheSize = 1000;
13221
+ readFile(filePath) {
13222
+ const fs2 = getFsImplementation();
13223
+ let stats;
13224
+ try {
13225
+ stats = fs2.statSync(filePath);
13226
+ } catch (error2) {
13227
+ this.cache.delete(filePath);
13228
+ throw error2;
13229
+ }
13230
+ const cacheKey = filePath;
13231
+ const cachedData = this.cache.get(cacheKey);
13232
+ if (cachedData && cachedData.mtime === stats.mtimeMs) {
13233
+ return {
13234
+ content: cachedData.content,
13235
+ encoding: cachedData.encoding
13236
+ };
13237
+ }
13238
+ const encoding = detectFileEncoding(filePath);
13239
+ const content = fs2.readFileSync(filePath, { encoding }).replaceAll(`\r
13240
+ `, `
13241
+ `);
13242
+ this.cache.set(cacheKey, {
13243
+ content,
13244
+ encoding,
13245
+ mtime: stats.mtimeMs
13246
+ });
13247
+ if (this.cache.size > this.maxCacheSize) {
13248
+ const firstKey = this.cache.keys().next().value;
13249
+ if (firstKey) {
13250
+ this.cache.delete(firstKey);
13251
+ }
13252
+ }
13253
+ return { content, encoding };
13254
+ }
13255
+ clear() {
13256
+ this.cache.clear();
13257
+ }
13258
+ invalidate(filePath) {
13259
+ this.cache.delete(filePath);
13260
+ }
13261
+ getStats() {
13262
+ return {
13263
+ size: this.cache.size,
13264
+ entries: Array.from(this.cache.keys())
13265
+ };
13266
+ }
13267
+ }
13268
+ var fileReadCache;
13269
+ var init_fileReadCache = __esm(() => {
13270
+ init_file();
13271
+ init_fsOperations();
13272
+ fileReadCache = new FileReadCache;
13273
+ });
13274
+
12722
13275
  // src/utils/platform.ts
12723
13276
  import { readdir as readdir2, readFile as readFile4 } from "fs/promises";
12724
13277
  import { release as osRelease } from "os";
@@ -12956,7 +13509,7 @@ var init_getWorktreePathsPortable = __esm(() => {
12956
13509
 
12957
13510
  // src/utils/sessionStoragePortable.ts
12958
13511
  import { open as fsOpen, readdir as readdir3, realpath as realpath2, stat as stat3 } from "fs/promises";
12959
- import { join as join10 } from "path";
13512
+ import { join as join11 } from "path";
12960
13513
  function validateUuid(maybeUuid) {
12961
13514
  if (typeof maybeUuid !== "string")
12962
13515
  return null;
@@ -13053,7 +13606,7 @@ function sanitizePath2(name) {
13053
13606
  return `${sanitized.slice(0, MAX_SANITIZED_LENGTH2)}-${hash}`;
13054
13607
  }
13055
13608
  function getProjectsDir() {
13056
- return join10(getClaudeConfigHomeDir(), "projects");
13609
+ return join11(getClaudeConfigHomeDir(), "projects");
13057
13610
  }
13058
13611
  function compactBoundaryMarker() {
13059
13612
  return _compactBoundaryMarker ??= Buffer.from('"compact_boundary"');
@@ -13271,7 +13824,7 @@ var init_sessionStoragePortable = __esm(() => {
13271
13824
 
13272
13825
  // src/utils/path.ts
13273
13826
  import { homedir as homedir4 } from "os";
13274
- import { dirname as dirname7, isAbsolute as isAbsolute2, join as join11, normalize, relative, resolve as resolve5 } from "path";
13827
+ import { dirname as dirname7, isAbsolute as isAbsolute2, join as join12, normalize, relative, resolve as resolve5 } from "path";
13275
13828
  function expandPath(path4, baseDir) {
13276
13829
  const actualBaseDir = baseDir ?? getCwd() ?? getFsImplementation().cwd();
13277
13830
  if (typeof path4 !== "string") {
@@ -13291,7 +13844,7 @@ function expandPath(path4, baseDir) {
13291
13844
  return homedir4().normalize("NFC");
13292
13845
  }
13293
13846
  if (trimmedPath.startsWith("~/")) {
13294
- return join11(homedir4(), trimmedPath.slice(2)).normalize("NFC");
13847
+ return join12(homedir4(), trimmedPath.slice(2)).normalize("NFC");
13295
13848
  }
13296
13849
  let processedPath = trimmedPath;
13297
13850
  if (getPlatform() === "windows" && trimmedPath.match(/^\/[a-z]\//i)) {
@@ -13338,556 +13891,6 @@ var init_path2 = __esm(() => {
13338
13891
  init_sessionStoragePortable();
13339
13892
  });
13340
13893
 
13341
- // node_modules/lodash-es/_assignMergeValue.js
13342
- function assignMergeValue(object, key, value) {
13343
- if (value !== undefined && !eq_default(object[key], value) || value === undefined && !(key in object)) {
13344
- _baseAssignValue_default(object, key, value);
13345
- }
13346
- }
13347
- var _assignMergeValue_default;
13348
- var init__assignMergeValue = __esm(() => {
13349
- init__baseAssignValue();
13350
- init_eq();
13351
- _assignMergeValue_default = assignMergeValue;
13352
- });
13353
-
13354
- // node_modules/lodash-es/_createBaseFor.js
13355
- function createBaseFor(fromRight) {
13356
- return function(object, iteratee, keysFunc) {
13357
- var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
13358
- while (length--) {
13359
- var key = props[fromRight ? length : ++index];
13360
- if (iteratee(iterable[key], key, iterable) === false) {
13361
- break;
13362
- }
13363
- }
13364
- return object;
13365
- };
13366
- }
13367
- var _createBaseFor_default;
13368
- var init__createBaseFor = __esm(() => {
13369
- _createBaseFor_default = createBaseFor;
13370
- });
13371
-
13372
- // node_modules/lodash-es/_baseFor.js
13373
- var baseFor, _baseFor_default;
13374
- var init__baseFor = __esm(() => {
13375
- init__createBaseFor();
13376
- baseFor = _createBaseFor_default();
13377
- _baseFor_default = baseFor;
13378
- });
13379
-
13380
- // node_modules/lodash-es/isArrayLikeObject.js
13381
- function isArrayLikeObject(value) {
13382
- return isObjectLike_default(value) && isArrayLike_default(value);
13383
- }
13384
- var isArrayLikeObject_default;
13385
- var init_isArrayLikeObject = __esm(() => {
13386
- init_isArrayLike();
13387
- init_isObjectLike();
13388
- isArrayLikeObject_default = isArrayLikeObject;
13389
- });
13390
-
13391
- // node_modules/lodash-es/isPlainObject.js
13392
- function isPlainObject(value) {
13393
- if (!isObjectLike_default(value) || _baseGetTag_default(value) != objectTag5) {
13394
- return false;
13395
- }
13396
- var proto = _getPrototype_default(value);
13397
- if (proto === null) {
13398
- return true;
13399
- }
13400
- var Ctor = hasOwnProperty13.call(proto, "constructor") && proto.constructor;
13401
- return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString3.call(Ctor) == objectCtorString;
13402
- }
13403
- var objectTag5 = "[object Object]", funcProto3, objectProto16, funcToString3, hasOwnProperty13, objectCtorString, isPlainObject_default;
13404
- var init_isPlainObject = __esm(() => {
13405
- init__baseGetTag();
13406
- init__getPrototype();
13407
- init_isObjectLike();
13408
- funcProto3 = Function.prototype;
13409
- objectProto16 = Object.prototype;
13410
- funcToString3 = funcProto3.toString;
13411
- hasOwnProperty13 = objectProto16.hasOwnProperty;
13412
- objectCtorString = funcToString3.call(Object);
13413
- isPlainObject_default = isPlainObject;
13414
- });
13415
-
13416
- // node_modules/lodash-es/_safeGet.js
13417
- function safeGet(object, key) {
13418
- if (key === "constructor" && typeof object[key] === "function") {
13419
- return;
13420
- }
13421
- if (key == "__proto__") {
13422
- return;
13423
- }
13424
- return object[key];
13425
- }
13426
- var _safeGet_default;
13427
- var init__safeGet = __esm(() => {
13428
- _safeGet_default = safeGet;
13429
- });
13430
-
13431
- // node_modules/lodash-es/toPlainObject.js
13432
- function toPlainObject(value) {
13433
- return _copyObject_default(value, keysIn_default(value));
13434
- }
13435
- var toPlainObject_default;
13436
- var init_toPlainObject = __esm(() => {
13437
- init__copyObject();
13438
- init_keysIn();
13439
- toPlainObject_default = toPlainObject;
13440
- });
13441
-
13442
- // node_modules/lodash-es/_baseMergeDeep.js
13443
- function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
13444
- var objValue = _safeGet_default(object, key), srcValue = _safeGet_default(source, key), stacked = stack.get(srcValue);
13445
- if (stacked) {
13446
- _assignMergeValue_default(object, key, stacked);
13447
- return;
13448
- }
13449
- var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : undefined;
13450
- var isCommon = newValue === undefined;
13451
- if (isCommon) {
13452
- var isArr = isArray_default(srcValue), isBuff = !isArr && isBuffer_default(srcValue), isTyped = !isArr && !isBuff && isTypedArray_default(srcValue);
13453
- newValue = srcValue;
13454
- if (isArr || isBuff || isTyped) {
13455
- if (isArray_default(objValue)) {
13456
- newValue = objValue;
13457
- } else if (isArrayLikeObject_default(objValue)) {
13458
- newValue = _copyArray_default(objValue);
13459
- } else if (isBuff) {
13460
- isCommon = false;
13461
- newValue = _cloneBuffer_default(srcValue, true);
13462
- } else if (isTyped) {
13463
- isCommon = false;
13464
- newValue = _cloneTypedArray_default(srcValue, true);
13465
- } else {
13466
- newValue = [];
13467
- }
13468
- } else if (isPlainObject_default(srcValue) || isArguments_default(srcValue)) {
13469
- newValue = objValue;
13470
- if (isArguments_default(objValue)) {
13471
- newValue = toPlainObject_default(objValue);
13472
- } else if (!isObject_default(objValue) || isFunction_default(objValue)) {
13473
- newValue = _initCloneObject_default(srcValue);
13474
- }
13475
- } else {
13476
- isCommon = false;
13477
- }
13478
- }
13479
- if (isCommon) {
13480
- stack.set(srcValue, newValue);
13481
- mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
13482
- stack["delete"](srcValue);
13483
- }
13484
- _assignMergeValue_default(object, key, newValue);
13485
- }
13486
- var _baseMergeDeep_default;
13487
- var init__baseMergeDeep = __esm(() => {
13488
- init__assignMergeValue();
13489
- init__cloneBuffer();
13490
- init__cloneTypedArray();
13491
- init__copyArray();
13492
- init__initCloneObject();
13493
- init_isArguments();
13494
- init_isArray();
13495
- init_isArrayLikeObject();
13496
- init_isBuffer();
13497
- init_isFunction();
13498
- init_isObject();
13499
- init_isPlainObject();
13500
- init_isTypedArray();
13501
- init__safeGet();
13502
- init_toPlainObject();
13503
- _baseMergeDeep_default = baseMergeDeep;
13504
- });
13505
-
13506
- // node_modules/lodash-es/_baseMerge.js
13507
- function baseMerge(object, source, srcIndex, customizer, stack) {
13508
- if (object === source) {
13509
- return;
13510
- }
13511
- _baseFor_default(source, function(srcValue, key) {
13512
- stack || (stack = new _Stack_default);
13513
- if (isObject_default(srcValue)) {
13514
- _baseMergeDeep_default(object, source, key, srcIndex, baseMerge, customizer, stack);
13515
- } else {
13516
- var newValue = customizer ? customizer(_safeGet_default(object, key), srcValue, key + "", object, source, stack) : undefined;
13517
- if (newValue === undefined) {
13518
- newValue = srcValue;
13519
- }
13520
- _assignMergeValue_default(object, key, newValue);
13521
- }
13522
- }, keysIn_default);
13523
- }
13524
- var _baseMerge_default;
13525
- var init__baseMerge = __esm(() => {
13526
- init__Stack();
13527
- init__assignMergeValue();
13528
- init__baseFor();
13529
- init__baseMergeDeep();
13530
- init_isObject();
13531
- init_keysIn();
13532
- init__safeGet();
13533
- _baseMerge_default = baseMerge;
13534
- });
13535
-
13536
- // node_modules/lodash-es/_apply.js
13537
- function apply(func, thisArg, args) {
13538
- switch (args.length) {
13539
- case 0:
13540
- return func.call(thisArg);
13541
- case 1:
13542
- return func.call(thisArg, args[0]);
13543
- case 2:
13544
- return func.call(thisArg, args[0], args[1]);
13545
- case 3:
13546
- return func.call(thisArg, args[0], args[1], args[2]);
13547
- }
13548
- return func.apply(thisArg, args);
13549
- }
13550
- var _apply_default;
13551
- var init__apply = __esm(() => {
13552
- _apply_default = apply;
13553
- });
13554
-
13555
- // node_modules/lodash-es/_overRest.js
13556
- function overRest(func, start, transform) {
13557
- start = nativeMax(start === undefined ? func.length - 1 : start, 0);
13558
- return function() {
13559
- var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length);
13560
- while (++index < length) {
13561
- array[index] = args[start + index];
13562
- }
13563
- index = -1;
13564
- var otherArgs = Array(start + 1);
13565
- while (++index < start) {
13566
- otherArgs[index] = args[index];
13567
- }
13568
- otherArgs[start] = transform(array);
13569
- return _apply_default(func, this, otherArgs);
13570
- };
13571
- }
13572
- var nativeMax, _overRest_default;
13573
- var init__overRest = __esm(() => {
13574
- init__apply();
13575
- nativeMax = Math.max;
13576
- _overRest_default = overRest;
13577
- });
13578
-
13579
- // node_modules/lodash-es/constant.js
13580
- function constant(value) {
13581
- return function() {
13582
- return value;
13583
- };
13584
- }
13585
- var constant_default;
13586
- var init_constant = __esm(() => {
13587
- constant_default = constant;
13588
- });
13589
-
13590
- // node_modules/lodash-es/_baseSetToString.js
13591
- var baseSetToString, _baseSetToString_default;
13592
- var init__baseSetToString = __esm(() => {
13593
- init_constant();
13594
- init__defineProperty();
13595
- init_identity();
13596
- baseSetToString = !_defineProperty_default ? identity_default : function(func, string) {
13597
- return _defineProperty_default(func, "toString", {
13598
- configurable: true,
13599
- enumerable: false,
13600
- value: constant_default(string),
13601
- writable: true
13602
- });
13603
- };
13604
- _baseSetToString_default = baseSetToString;
13605
- });
13606
-
13607
- // node_modules/lodash-es/_shortOut.js
13608
- function shortOut(func) {
13609
- var count = 0, lastCalled = 0;
13610
- return function() {
13611
- var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
13612
- lastCalled = stamp;
13613
- if (remaining > 0) {
13614
- if (++count >= HOT_COUNT) {
13615
- return arguments[0];
13616
- }
13617
- } else {
13618
- count = 0;
13619
- }
13620
- return func.apply(undefined, arguments);
13621
- };
13622
- }
13623
- var HOT_COUNT = 800, HOT_SPAN = 16, nativeNow, _shortOut_default;
13624
- var init__shortOut = __esm(() => {
13625
- nativeNow = Date.now;
13626
- _shortOut_default = shortOut;
13627
- });
13628
-
13629
- // node_modules/lodash-es/_setToString.js
13630
- var setToString, _setToString_default;
13631
- var init__setToString = __esm(() => {
13632
- init__baseSetToString();
13633
- init__shortOut();
13634
- setToString = _shortOut_default(_baseSetToString_default);
13635
- _setToString_default = setToString;
13636
- });
13637
-
13638
- // node_modules/lodash-es/_baseRest.js
13639
- function baseRest(func, start) {
13640
- return _setToString_default(_overRest_default(func, start, identity_default), func + "");
13641
- }
13642
- var _baseRest_default;
13643
- var init__baseRest = __esm(() => {
13644
- init_identity();
13645
- init__overRest();
13646
- init__setToString();
13647
- _baseRest_default = baseRest;
13648
- });
13649
-
13650
- // node_modules/lodash-es/_isIterateeCall.js
13651
- function isIterateeCall(value, index, object) {
13652
- if (!isObject_default(object)) {
13653
- return false;
13654
- }
13655
- var type = typeof index;
13656
- if (type == "number" ? isArrayLike_default(object) && _isIndex_default(index, object.length) : type == "string" && (index in object)) {
13657
- return eq_default(object[index], value);
13658
- }
13659
- return false;
13660
- }
13661
- var _isIterateeCall_default;
13662
- var init__isIterateeCall = __esm(() => {
13663
- init_eq();
13664
- init_isArrayLike();
13665
- init__isIndex();
13666
- init_isObject();
13667
- _isIterateeCall_default = isIterateeCall;
13668
- });
13669
-
13670
- // node_modules/lodash-es/_createAssigner.js
13671
- function createAssigner(assigner) {
13672
- return _baseRest_default(function(object, sources) {
13673
- var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined, guard = length > 2 ? sources[2] : undefined;
13674
- customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : undefined;
13675
- if (guard && _isIterateeCall_default(sources[0], sources[1], guard)) {
13676
- customizer = length < 3 ? undefined : customizer;
13677
- length = 1;
13678
- }
13679
- object = Object(object);
13680
- while (++index < length) {
13681
- var source = sources[index];
13682
- if (source) {
13683
- assigner(object, source, index, customizer);
13684
- }
13685
- }
13686
- return object;
13687
- });
13688
- }
13689
- var _createAssigner_default;
13690
- var init__createAssigner = __esm(() => {
13691
- init__baseRest();
13692
- init__isIterateeCall();
13693
- _createAssigner_default = createAssigner;
13694
- });
13695
-
13696
- // node_modules/lodash-es/mergeWith.js
13697
- var mergeWith, mergeWith_default;
13698
- var init_mergeWith = __esm(() => {
13699
- init__baseMerge();
13700
- init__createAssigner();
13701
- mergeWith = _createAssigner_default(function(object, source, srcIndex, customizer) {
13702
- _baseMerge_default(object, source, srcIndex, customizer);
13703
- });
13704
- mergeWith_default = mergeWith;
13705
- });
13706
-
13707
- // src/utils/fileRead.ts
13708
- function detectEncodingForResolvedPath(resolvedPath) {
13709
- const { buffer, bytesRead } = getFsImplementation().readSync(resolvedPath, {
13710
- length: 4096
13711
- });
13712
- if (bytesRead === 0) {
13713
- return "utf8";
13714
- }
13715
- if (bytesRead >= 2) {
13716
- if (buffer[0] === 255 && buffer[1] === 254)
13717
- return "utf16le";
13718
- }
13719
- if (bytesRead >= 3 && buffer[0] === 239 && buffer[1] === 187 && buffer[2] === 191) {
13720
- return "utf8";
13721
- }
13722
- return "utf8";
13723
- }
13724
- function detectLineEndingsForString(content) {
13725
- let crlfCount = 0;
13726
- let lfCount = 0;
13727
- for (let i = 0;i < content.length; i++) {
13728
- if (content[i] === `
13729
- `) {
13730
- if (i > 0 && content[i - 1] === "\r") {
13731
- crlfCount++;
13732
- } else {
13733
- lfCount++;
13734
- }
13735
- }
13736
- }
13737
- return crlfCount > lfCount ? "CRLF" : "LF";
13738
- }
13739
- function readFileSyncWithMetadata(filePath) {
13740
- const fs2 = getFsImplementation();
13741
- const { resolvedPath, isSymlink } = safeResolvePath(fs2, filePath);
13742
- if (isSymlink) {
13743
- logForDebugging(`Reading through symlink: ${filePath} -> ${resolvedPath}`);
13744
- }
13745
- const encoding = detectEncodingForResolvedPath(resolvedPath);
13746
- const raw = fs2.readFileSync(resolvedPath, { encoding });
13747
- const lineEndings = detectLineEndingsForString(raw.slice(0, 4096));
13748
- return {
13749
- content: raw.replaceAll(`\r
13750
- `, `
13751
- `),
13752
- encoding,
13753
- lineEndings
13754
- };
13755
- }
13756
- function readFileSync3(filePath) {
13757
- return readFileSyncWithMetadata(filePath).content;
13758
- }
13759
- var init_fileRead = __esm(() => {
13760
- init_debug();
13761
- init_fsOperations();
13762
- });
13763
-
13764
- // src/utils/jsonRead.ts
13765
- function stripBOM(content) {
13766
- return content.startsWith(UTF8_BOM) ? content.slice(1) : content;
13767
- }
13768
- var UTF8_BOM = "\uFEFF";
13769
-
13770
- // src/services/remoteManagedSettings/syncCacheState.ts
13771
- import { join as join12 } from "path";
13772
- function setSessionCache(value) {
13773
- sessionCache = value;
13774
- }
13775
- function resetSyncCache() {
13776
- sessionCache = null;
13777
- eligible = undefined;
13778
- }
13779
- function setEligibility(v) {
13780
- eligible = v;
13781
- return v;
13782
- }
13783
- function getSettingsPath() {
13784
- return join12(getClaudeConfigHomeDir(), SETTINGS_FILENAME);
13785
- }
13786
- function loadSettings() {
13787
- try {
13788
- const content = readFileSync3(getSettingsPath());
13789
- const data = jsonParse(stripBOM(content));
13790
- if (!data || typeof data !== "object" || Array.isArray(data)) {
13791
- return null;
13792
- }
13793
- return data;
13794
- } catch {
13795
- return null;
13796
- }
13797
- }
13798
- function getRemoteManagedSettingsSyncFromCache() {
13799
- if (eligible !== true)
13800
- return null;
13801
- if (sessionCache)
13802
- return sessionCache;
13803
- const cachedSettings = loadSettings();
13804
- if (cachedSettings) {
13805
- sessionCache = cachedSettings;
13806
- resetSettingsCache();
13807
- return cachedSettings;
13808
- }
13809
- return null;
13810
- }
13811
- var SETTINGS_FILENAME = "remote-settings.json", sessionCache = null, eligible;
13812
- var init_syncCacheState = __esm(() => {
13813
- init_envUtils();
13814
- init_fileRead();
13815
- init_settingsCache();
13816
- init_slowOperations();
13817
- });
13818
-
13819
- // src/utils/array.ts
13820
- function intersperse(as, separator) {
13821
- return as.flatMap((a, i) => i ? [separator(i), a] : [a]);
13822
- }
13823
- function count(arr, pred) {
13824
- let n = 0;
13825
- for (const x2 of arr)
13826
- n += +!!pred(x2);
13827
- return n;
13828
- }
13829
- function uniq(xs) {
13830
- return [...new Set(xs)];
13831
- }
13832
-
13833
- // src/utils/fileReadCache.ts
13834
- class FileReadCache {
13835
- cache = new Map;
13836
- maxCacheSize = 1000;
13837
- readFile(filePath) {
13838
- const fs2 = getFsImplementation();
13839
- let stats;
13840
- try {
13841
- stats = fs2.statSync(filePath);
13842
- } catch (error2) {
13843
- this.cache.delete(filePath);
13844
- throw error2;
13845
- }
13846
- const cacheKey = filePath;
13847
- const cachedData = this.cache.get(cacheKey);
13848
- if (cachedData && cachedData.mtime === stats.mtimeMs) {
13849
- return {
13850
- content: cachedData.content,
13851
- encoding: cachedData.encoding
13852
- };
13853
- }
13854
- const encoding = detectFileEncoding(filePath);
13855
- const content = fs2.readFileSync(filePath, { encoding }).replaceAll(`\r
13856
- `, `
13857
- `);
13858
- this.cache.set(cacheKey, {
13859
- content,
13860
- encoding,
13861
- mtime: stats.mtimeMs
13862
- });
13863
- if (this.cache.size > this.maxCacheSize) {
13864
- const firstKey = this.cache.keys().next().value;
13865
- if (firstKey) {
13866
- this.cache.delete(firstKey);
13867
- }
13868
- }
13869
- return { content, encoding };
13870
- }
13871
- clear() {
13872
- this.cache.clear();
13873
- }
13874
- invalidate(filePath) {
13875
- this.cache.delete(filePath);
13876
- }
13877
- getStats() {
13878
- return {
13879
- size: this.cache.size,
13880
- entries: Array.from(this.cache.keys())
13881
- };
13882
- }
13883
- }
13884
- var fileReadCache;
13885
- var init_fileReadCache = __esm(() => {
13886
- init_file();
13887
- init_fsOperations();
13888
- fileReadCache = new FileReadCache;
13889
- });
13890
-
13891
13894
  // src/utils/file.ts
13892
13895
  import { chmodSync, writeFileSync as fsWriteFileSync2 } from "fs";
13893
13896
  import { realpath as realpath3, stat as stat4 } from "fs/promises";
@@ -14106,7 +14109,7 @@ function writeFileSyncAndFlush_DEPRECATED(filePath, content, options = { encodin
14106
14109
  logForDebugging(`Applied original permissions to temp file`);
14107
14110
  }
14108
14111
  logForDebugging(`Renaming ${tempPath} to ${targetPath}`);
14109
- fs2.renameSync(tempPath, targetPath);
14112
+ retrySyncOnWindowsWriteError(`rename ${tempPath} -> ${targetPath}`, () => fs2.renameSync(tempPath, targetPath));
14110
14113
  logForDebugging(`File ${targetPath} written atomically`);
14111
14114
  } catch (atomicError) {
14112
14115
  logForDebugging(`Failed to write file atomically: ${atomicError}`, {
@@ -14128,7 +14131,7 @@ function writeFileSyncAndFlush_DEPRECATED(filePath, content, options = { encodin
14128
14131
  if (!targetExists && options.mode !== undefined) {
14129
14132
  fallbackOptions.mode = options.mode;
14130
14133
  }
14131
- fsWriteFileSync2(targetPath, content, fallbackOptions);
14134
+ retrySyncOnWindowsWriteError(`write ${targetPath}`, () => fsWriteFileSync2(targetPath, content, fallbackOptions));
14132
14135
  logForDebugging(`File ${targetPath} written successfully with non-atomic fallback`);
14133
14136
  } catch (fallbackError) {
14134
14137
  logForDebugging(`Non-atomic write also failed: ${fallbackError}`);
@@ -14136,6 +14139,28 @@ function writeFileSyncAndFlush_DEPRECATED(filePath, content, options = { encodin
14136
14139
  }
14137
14140
  }
14138
14141
  }
14142
+ function isTransientWindowsWriteError(error2) {
14143
+ return getPlatform() === "windows" && WINDOWS_TRANSIENT_WRITE_ERROR_CODES.has(getErrnoCode(error2) ?? "");
14144
+ }
14145
+ function sleepSync(ms) {
14146
+ const buffer = new SharedArrayBuffer(4);
14147
+ const view = new Int32Array(buffer);
14148
+ Atomics.wait(view, 0, 0, ms);
14149
+ }
14150
+ function retrySyncOnWindowsWriteError(operation, fn) {
14151
+ for (let attempt = 0;; attempt++) {
14152
+ try {
14153
+ return fn();
14154
+ } catch (error2) {
14155
+ if (!isTransientWindowsWriteError(error2) || attempt >= WINDOWS_WRITE_RETRY_DELAYS_MS.length) {
14156
+ throw error2;
14157
+ }
14158
+ const code = getErrnoCode(error2) ?? "unknown";
14159
+ logForDebugging(`Retrying ${operation} after transient ${code} error on Windows (${attempt + 1}/${WINDOWS_WRITE_RETRY_DELAYS_MS.length + 1})`);
14160
+ sleepSync(WINDOWS_WRITE_RETRY_DELAYS_MS[attempt]);
14161
+ }
14162
+ }
14163
+ }
14139
14164
  function getDesktopPath() {
14140
14165
  const platform = getPlatform();
14141
14166
  const homeDir = homedir5();
@@ -14191,7 +14216,7 @@ function normalizePathForComparison(filePath) {
14191
14216
  function pathsEqual(path1, path22) {
14192
14217
  return normalizePathForComparison(path1) === normalizePathForComparison(path22);
14193
14218
  }
14194
- var MAX_OUTPUT_SIZE, FILE_NOT_FOUND_CWD_NOTE = "Note: your current working directory is";
14219
+ var MAX_OUTPUT_SIZE, FILE_NOT_FOUND_CWD_NOTE = "Note: your current working directory is", WINDOWS_TRANSIENT_WRITE_ERROR_CODES, WINDOWS_WRITE_RETRY_DELAYS_MS;
14195
14220
  var init_file = __esm(() => {
14196
14221
  init_cwd();
14197
14222
  init_debug();
@@ -14203,6 +14228,8 @@ var init_file = __esm(() => {
14203
14228
  init_path2();
14204
14229
  init_platform();
14205
14230
  MAX_OUTPUT_SIZE = 0.25 * 1024 * 1024;
14231
+ WINDOWS_TRANSIENT_WRITE_ERROR_CODES = new Set(["EACCES", "EBUSY", "EPERM"]);
14232
+ WINDOWS_WRITE_RETRY_DELAYS_MS = [25, 75, 150];
14206
14233
  });
14207
14234
 
14208
14235
  // src/utils/git/gitignore.ts
@@ -34063,6 +34090,9 @@ function getMemoryBaseDir() {
34063
34090
  }
34064
34091
  return getClaudeConfigHomeDir();
34065
34092
  }
34093
+ function getProjectMemoryBaseDir() {
34094
+ return join20(getAutoMemBase(), ".localclawd").normalize("NFC");
34095
+ }
34066
34096
  function validateMemoryPath(raw, expandTilde) {
34067
34097
  if (!raw) {
34068
34098
  return;
@@ -34108,15 +34138,13 @@ var init_paths = __esm(() => {
34108
34138
  init_state();
34109
34139
  init_envUtils();
34110
34140
  init_git();
34111
- init_path2();
34112
34141
  init_settings2();
34113
34142
  getAutoMemPath = memoize_default(() => {
34114
34143
  const override = getAutoMemPathOverride() ?? getAutoMemPathSetting();
34115
34144
  if (override) {
34116
34145
  return override;
34117
34146
  }
34118
- const projectsDir = join20(getMemoryBaseDir(), "projects");
34119
- return (join20(projectsDir, sanitizePath2(getAutoMemBase()), AUTO_MEM_DIRNAME) + sep4).normalize("NFC");
34147
+ return (join20(getProjectMemoryBaseDir(), AUTO_MEM_DIRNAME) + sep4).normalize("NFC");
34120
34148
  }, () => getProjectRoot());
34121
34149
  });
34122
34150
 
@@ -87580,7 +87608,7 @@ var init_isEqual = __esm(() => {
87580
87608
 
87581
87609
  // src/utils/userAgent.ts
87582
87610
  function getClaudeCodeUserAgent() {
87583
- return `claude-code/${"1.7.0"}`;
87611
+ return `claude-code/${"1.7.1"}`;
87584
87612
  }
87585
87613
 
87586
87614
  // src/utils/workloadContext.ts
@@ -87602,7 +87630,7 @@ function getUserAgent() {
87602
87630
  const clientApp = process.env.CLAUDE_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}` : "";
87603
87631
  const workload = getWorkload();
87604
87632
  const workloadSuffix = workload ? `, workload/${workload}` : "";
87605
- return `claude-cli/${"1.7.0"} (${process.env.USER_TYPE}, ${process.env.CLAUDE_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
87633
+ return `claude-cli/${"1.7.1"} (${process.env.USER_TYPE}, ${process.env.CLAUDE_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
87606
87634
  }
87607
87635
  function getMCPUserAgent() {
87608
87636
  const parts = [];
@@ -87616,7 +87644,7 @@ function getMCPUserAgent() {
87616
87644
  parts.push(`client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}`);
87617
87645
  }
87618
87646
  const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
87619
- return `claude-code/${"1.7.0"}${suffix}`;
87647
+ return `claude-code/${"1.7.1"}${suffix}`;
87620
87648
  }
87621
87649
  function getWebFetchUserAgent() {
87622
87650
  return `Claude-User (${getClaudeCodeUserAgent()}; +https://support.anthropic.com/)`;
@@ -130812,7 +130840,7 @@ function getAttributionHeader(fingerprint) {
130812
130840
  if (!isAttributionHeaderEnabled()) {
130813
130841
  return "";
130814
130842
  }
130815
- const version = `${"1.7.0"}.${fingerprint}`;
130843
+ const version = `${"1.7.1"}.${fingerprint}`;
130816
130844
  const entrypoint = process.env.CLAUDE_CODE_ENTRYPOINT ?? "unknown";
130817
130845
  const cch = "";
130818
130846
  const workload = getWorkload();
@@ -147001,7 +147029,7 @@ var init_metadata = __esm(() => {
147001
147029
  COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
147002
147030
  WHITESPACE_REGEX = /\s+/;
147003
147031
  getVersionBase = memoize_default(() => {
147004
- const match = "1.7.0".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
147032
+ const match = "1.7.1".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
147005
147033
  return match ? match[0] : undefined;
147006
147034
  });
147007
147035
  buildEnvContext = memoize_default(async () => {
@@ -147041,9 +147069,9 @@ var init_metadata = __esm(() => {
147041
147069
  isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
147042
147070
  isClaudeCodeAction: isEnvTruthy(process.env.CLAUDE_CODE_ACTION),
147043
147071
  isClaudeAiAuth: isClaudeAISubscriber(),
147044
- version: "1.7.0",
147072
+ version: "1.7.1",
147045
147073
  versionBase: getVersionBase(),
147046
- buildTime: "2026-04-26T17:37:22.796Z",
147074
+ buildTime: "2026-05-05T20:42:20.896Z",
147047
147075
  deploymentEnvironment: env3.detectDeploymentEnvironment(),
147048
147076
  ...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
147049
147077
  githubEventName: process.env.GITHUB_EVENT_NAME,
@@ -147069,7 +147097,7 @@ var init_last = __esm(() => {
147069
147097
  });
147070
147098
 
147071
147099
  // src/buddy/types.ts
147072
- var RARITIES, c4, duck, goose, blob, cat, dragon, octopus, owl, penguin, turtle, snail, ghost, axolotl, capybara, cactus, robot, rabbit, mushroom, chonk, SPECIES, EYES, HATS, STAT_NAMES, RARITY_WEIGHTS;
147100
+ var RARITIES, c4, duck, goose, blob, cat, dragon, octopus, owl, penguin, turtle, snail, ghost, axolotl, capybara, cactus, robot, rabbit, mushroom, chonk, SPECIES, EYES, HATS, STAT_NAMES, RARITY_WEIGHTS, RARITY_STARS;
147073
147101
  var init_types3 = __esm(() => {
147074
147102
  RARITIES = [
147075
147103
  "common",
@@ -147142,6 +147170,13 @@ var init_types3 = __esm(() => {
147142
147170
  epic: 4,
147143
147171
  legendary: 1
147144
147172
  };
147173
+ RARITY_STARS = {
147174
+ common: "★",
147175
+ uncommon: "★★",
147176
+ rare: "★★★",
147177
+ epic: "★★★★",
147178
+ legendary: "★★★★★"
147179
+ };
147145
147180
  });
147146
147181
 
147147
147182
  // src/buddy/companion.ts
@@ -147221,6 +147256,15 @@ function companionUserId() {
147221
147256
  const config = getGlobalConfig();
147222
147257
  return config.oauthAccount?.accountUuid ?? config.userID ?? "anon";
147223
147258
  }
147259
+ function createStoredCompanion(userId) {
147260
+ const { inspirationSeed } = roll(userId);
147261
+ const rng = mulberry32(hashString(`${userId}:${inspirationSeed}:soul`));
147262
+ return {
147263
+ name: pick(rng, COMPANION_NAMES),
147264
+ personality: pick(rng, COMPANION_PERSONALITIES),
147265
+ hatchedAt: Date.now()
147266
+ };
147267
+ }
147224
147268
  function getCompanion() {
147225
147269
  const stored = getGlobalConfig().companion;
147226
147270
  if (!stored)
@@ -147228,8 +147272,32 @@ function getCompanion() {
147228
147272
  const { bones } = roll(companionUserId());
147229
147273
  return { ...stored, ...bones };
147230
147274
  }
147231
- var RARITY_FLOOR, SALT = "friend-2026-401", rollCache;
147275
+ function ensureCompanion(options) {
147276
+ const existing = getCompanion();
147277
+ const shouldUnmute = options?.unmute === true;
147278
+ if (existing && (!shouldUnmute || getGlobalConfig().companionMuted !== true)) {
147279
+ return existing;
147280
+ }
147281
+ const userId = companionUserId();
147282
+ const { bones } = roll(userId);
147283
+ const stored = getGlobalConfig().companion ?? createStoredCompanion(userId);
147284
+ saveGlobalConfig((current) => {
147285
+ const nextCompanion = current.companion ?? stored;
147286
+ const nextMuted = shouldUnmute ? false : current.companionMuted;
147287
+ if (current.companion === nextCompanion && current.companionMuted === nextMuted) {
147288
+ return current;
147289
+ }
147290
+ return {
147291
+ ...current,
147292
+ companion: nextCompanion,
147293
+ companionMuted: nextMuted
147294
+ };
147295
+ });
147296
+ return { ...stored, ...bones };
147297
+ }
147298
+ var RARITY_FLOOR, SALT = "friend-2026-401", COMPANION_NAMES, COMPANION_PERSONALITIES, rollCache;
147232
147299
  var init_companion = __esm(() => {
147300
+ init_config();
147233
147301
  init_config();
147234
147302
  init_types3();
147235
147303
  RARITY_FLOOR = {
@@ -147239,6 +147307,28 @@ var init_companion = __esm(() => {
147239
147307
  epic: 35,
147240
147308
  legendary: 50
147241
147309
  };
147310
+ COMPANION_NAMES = [
147311
+ "Pip",
147312
+ "Mochi",
147313
+ "Tango",
147314
+ "Pebble",
147315
+ "Nori",
147316
+ "Comet",
147317
+ "Juniper",
147318
+ "Nova",
147319
+ "Fig",
147320
+ "Rook",
147321
+ "Miso",
147322
+ "Sprout"
147323
+ ];
147324
+ COMPANION_PERSONALITIES = [
147325
+ "curious and methodical",
147326
+ "quietly confident",
147327
+ "playful but observant",
147328
+ "cheerfully relentless",
147329
+ "calm under pressure",
147330
+ "detail-obsessed in a useful way"
147331
+ ];
147242
147332
  });
147243
147333
 
147244
147334
  // src/buddy/prompt.ts
@@ -151465,11 +151555,25 @@ function isPowerShellToolEnabled() {
151465
151555
  return false;
151466
151556
  return process.env.USER_TYPE === "ant" ? !isEnvDefinedFalsy(process.env.CLAUDE_CODE_USE_POWERSHELL_TOOL) : isEnvTruthy(process.env.CLAUDE_CODE_USE_POWERSHELL_TOOL);
151467
151557
  }
151468
- var SHELL_TOOL_NAMES;
151558
+ function shouldPreferPowerShellForCommand(command) {
151559
+ if (!isPowerShellToolEnabled())
151560
+ return false;
151561
+ if (!WINDOWS_NATIVE_BUILD_RE.test(command))
151562
+ return false;
151563
+ if (WINDOWS_MINGW_OR_MSYS_RE.test(command))
151564
+ return false;
151565
+ if (BASH_ONLY_SYNTAX_RE.test(command))
151566
+ return false;
151567
+ return true;
151568
+ }
151569
+ var SHELL_TOOL_NAMES, WINDOWS_NATIVE_BUILD_RE, WINDOWS_MINGW_OR_MSYS_RE, BASH_ONLY_SYNTAX_RE;
151469
151570
  var init_shellToolUtils = __esm(() => {
151470
151571
  init_envUtils();
151471
151572
  init_platform();
151472
151573
  SHELL_TOOL_NAMES = [BASH_TOOL_NAME, POWERSHELL_TOOL_NAME];
151574
+ WINDOWS_NATIVE_BUILD_RE = /(^|\s)(cmake|ctest|ninja|msbuild|devenv|cl(?:\.exe)?|link(?:\.exe)?|dumpbin(?:\.exe)?|rc(?:\.exe)?|mt(?:\.exe)?|signtool(?:\.exe)?)(?=\s|$)/i;
151575
+ WINDOWS_MINGW_OR_MSYS_RE = /(mingw|msys2?|ucrt64|clang64|mingw32-make|g\+\+|gcc|makefiles|pacman|\/mingw|\\mingw)/i;
151576
+ BASH_ONLY_SYNTAX_RE = /(\&\&|\|\||2>\/dev\/null|>\/dev\/null|\$\(|`)/;
151473
151577
  });
151474
151578
 
151475
151579
  // src/services/compact/compactWarningState.ts
@@ -161418,6 +161522,25 @@ function renderToolUseErrorMessage(result, {
161418
161522
  progressMessagesForMessage: _progressMessagesForMessage,
161419
161523
  tools: _tools
161420
161524
  }) {
161525
+ if (!verbose && typeof result === "string" && extractTag(result, "tool_use_error")) {
161526
+ const errorMessage2 = extractTag(result, "tool_use_error")?.trim() ?? "";
161527
+ if (/Exit code 127|command not found/i.test(errorMessage2)) {
161528
+ return /* @__PURE__ */ jsx_dev_runtime33.jsxDEV(MessageResponse, {
161529
+ children: /* @__PURE__ */ jsx_dev_runtime33.jsxDEV(ThemedText, {
161530
+ color: "error",
161531
+ children: "Command not found in Bash. Install the missing tool or use PowerShell on Windows."
161532
+ }, undefined, false, undefined, this)
161533
+ }, undefined, false, undefined, this);
161534
+ }
161535
+ if (/MinGW Makefiles|cmake|g\+\+|gcc/i.test(errorMessage2)) {
161536
+ return /* @__PURE__ */ jsx_dev_runtime33.jsxDEV(MessageResponse, {
161537
+ children: /* @__PURE__ */ jsx_dev_runtime33.jsxDEV(ThemedText, {
161538
+ color: "error",
161539
+ children: "Build toolchain not available or not configured in Bash."
161540
+ }, undefined, false, undefined, this)
161541
+ }, undefined, false, undefined, this);
161542
+ }
161543
+ }
161421
161544
  return /* @__PURE__ */ jsx_dev_runtime33.jsxDEV(FallbackToolUseErrorMessage, {
161422
161545
  result,
161423
161546
  verbose
@@ -161438,6 +161561,7 @@ var init_UI = __esm(() => {
161438
161561
  init_envUtils();
161439
161562
  init_file();
161440
161563
  init_fullscreen();
161564
+ init_messages3();
161441
161565
  init_BashToolResultMessage();
161442
161566
  init_sedEditParser();
161443
161567
  jsx_dev_runtime33 = __toESM(require_jsx_dev_runtime(), 1);
@@ -168411,13 +168535,14 @@ var init_PowerShellTool = __esm(() => {
168411
168535
  import { randomUUID as randomUUID4 } from "crypto";
168412
168536
  async function executeShellCommandsInPrompt(text, context4, slashCommandName, shell) {
168413
168537
  let result = text;
168414
- const shellTool = shell === "powershell" && isPowerShellToolEnabled() ? getPowerShellTool() : BashTool;
168538
+ const getShellTool = (command) => shell === "powershell" && isPowerShellToolEnabled() ? getPowerShellTool() : shell === undefined && shouldPreferPowerShellForCommand(command) ? getPowerShellTool() : BashTool;
168415
168539
  const blockMatches = text.matchAll(BLOCK_PATTERN);
168416
168540
  const inlineMatches = text.includes("!`") ? text.matchAll(INLINE_PATTERN) : [];
168417
168541
  await Promise.all([...blockMatches, ...inlineMatches].map(async (match) => {
168418
168542
  const command = match[1]?.trim();
168419
168543
  if (command) {
168420
168544
  try {
168545
+ const shellTool = getShellTool(command);
168421
168546
  const permissionResult = await hasPermissionsToUseTool(shellTool, { command }, context4, createAssistantMessage({ content: [] }), "");
168422
168547
  if (permissionResult.behavior !== "allow") {
168423
168548
  logForDebugging(`Shell command permission check failed for command in ${slashCommandName}: ${command}. Error: ${permissionResult.message}`);
@@ -179522,7 +179647,7 @@ function getTelemetryAttributes() {
179522
179647
  attributes["session.id"] = sessionId;
179523
179648
  }
179524
179649
  if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
179525
- attributes["app.version"] = "1.7.0";
179650
+ attributes["app.version"] = "1.7.1";
179526
179651
  }
179527
179652
  const oauthAccount = getOauthAccountInfo();
179528
179653
  if (oauthAccount) {
@@ -180274,9 +180399,18 @@ function shouldUseSessionMemoryCompaction() {
180274
180399
  if (isEnvTruthy(process.env.ENABLE_CLAUDE_CODE_SM_COMPACT)) {
180275
180400
  return true;
180276
180401
  }
180402
+ if (isEnvTruthy(process.env.ENABLE_CLAUDE_CODE_SESSION_MEMORY)) {
180403
+ return true;
180404
+ }
180277
180405
  if (isEnvTruthy(process.env.DISABLE_CLAUDE_CODE_SM_COMPACT)) {
180278
180406
  return false;
180279
180407
  }
180408
+ if (isEnvTruthy(process.env.DISABLE_CLAUDE_CODE_SESSION_MEMORY)) {
180409
+ return false;
180410
+ }
180411
+ if (process.env.USER_TYPE !== "ant") {
180412
+ return true;
180413
+ }
180280
180414
  const sessionMemoryFlag = getFeatureValue_CACHED_MAY_BE_STALE("tengu_session_memory", false);
180281
180415
  const smCompactFlag = getFeatureValue_CACHED_MAY_BE_STALE("tengu_sm_compact", false);
180282
180416
  const shouldUse = sessionMemoryFlag && smCompactFlag;
@@ -234032,6 +234166,7 @@ var init_stdio2 = __esm(() => {
234032
234166
  // node_modules/eventsource-parser/dist/stream.js
234033
234167
  var EventSourceParserStream;
234034
234168
  var init_stream = __esm(() => {
234169
+ init_dist4();
234035
234170
  init_dist4();
234036
234171
  EventSourceParserStream = class EventSourceParserStream extends TransformStream {
234037
234172
  constructor({ onError, onRetry, onComment } = {}) {
@@ -242314,7 +242449,7 @@ function getInstallationEnv() {
242314
242449
  return;
242315
242450
  }
242316
242451
  function getClaudeCodeVersion() {
242317
- return "1.7.0";
242452
+ return "1.7.1";
242318
242453
  }
242319
242454
  async function getInstalledVSCodeExtensionVersion(command) {
242320
242455
  const { stdout } = await execFileNoThrow(command, ["--list-extensions", "--show-versions"], {
@@ -247588,7 +247723,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
247588
247723
  const client4 = new Client({
247589
247724
  name: "localclawd",
247590
247725
  title: "localclawd",
247591
- version: "1.7.0",
247726
+ version: "1.7.1",
247592
247727
  description: "local-first AI coding tool",
247593
247728
  websiteUrl: PRODUCT_URL
247594
247729
  }, {
@@ -247930,7 +248065,7 @@ var init_client9 = __esm(() => {
247930
248065
  const client4 = new Client({
247931
248066
  name: "localclawd",
247932
248067
  title: "localclawd",
247933
- version: "1.7.0",
248068
+ version: "1.7.1",
247934
248069
  description: "local-first AI coding tool",
247935
248070
  websiteUrl: PRODUCT_URL
247936
248071
  }, {
@@ -257464,7 +257599,7 @@ String: ${old_string}`,
257464
257599
  });
257465
257600
 
257466
257601
  // src/tools/FileWriteTool/UI.tsx
257467
- import { isAbsolute as isAbsolute16, relative as relative11, resolve as resolve25 } from "path";
257602
+ import { isAbsolute as isAbsolute16, resolve as resolve25 } from "path";
257468
257603
  function countLines(content) {
257469
257604
  const parts = content.split(EOL2);
257470
257605
  return content.endsWith(EOL2) ? parts.length - 1 : parts.length;
@@ -257495,7 +257630,7 @@ function FileWriteToolCreatedMessage(t0) {
257495
257630
  }
257496
257631
  let t2;
257497
257632
  if ($2[2] !== filePath || $2[3] !== verbose) {
257498
- t2 = verbose ? filePath : relative11(getCwd(), filePath);
257633
+ t2 = verbose ? filePath : getDisplayPath(filePath);
257499
257634
  $2[2] = filePath;
257500
257635
  $2[3] = verbose;
257501
257636
  $2[4] = t2;
@@ -257829,6 +257964,15 @@ function renderToolUseErrorMessage4(result, {
257829
257964
  verbose
257830
257965
  }) {
257831
257966
  if (!verbose && typeof result === "string" && extractTag(result, "tool_use_error")) {
257967
+ const errorMessage2 = extractTag(result, "tool_use_error")?.trim() ?? "";
257968
+ if (/(EPERM|EBUSY|EACCES)/.test(errorMessage2)) {
257969
+ return /* @__PURE__ */ jsx_dev_runtime55.jsxDEV(MessageResponse, {
257970
+ children: /* @__PURE__ */ jsx_dev_runtime55.jsxDEV(ThemedText, {
257971
+ color: "error",
257972
+ children: "File is locked or not writable"
257973
+ }, undefined, false, undefined, this)
257974
+ }, undefined, false, undefined, this);
257975
+ }
257832
257976
  return /* @__PURE__ */ jsx_dev_runtime55.jsxDEV(MessageResponse, {
257833
257977
  children: /* @__PURE__ */ jsx_dev_runtime55.jsxDEV(ThemedText, {
257834
257978
  color: "error",
@@ -257876,7 +258020,7 @@ function renderToolResultMessage7({
257876
258020
  " ",
257877
258021
  /* @__PURE__ */ jsx_dev_runtime55.jsxDEV(ThemedText, {
257878
258022
  bold: true,
257879
- children: relative11(getCwd(), filePath)
258023
+ children: getDisplayPath(filePath)
257880
258024
  }, undefined, false, undefined, this)
257881
258025
  ]
257882
258026
  }, undefined, true, undefined, this);
@@ -258206,7 +258350,7 @@ var init_FileWriteTool = __esm(() => {
258206
258350
  });
258207
258351
 
258208
258352
  // src/utils/plugins/orphanedPluginFilter.ts
258209
- import { dirname as dirname29, isAbsolute as isAbsolute17, join as join58, normalize as normalize9, relative as relative12, sep as sep14 } from "path";
258353
+ import { dirname as dirname29, isAbsolute as isAbsolute17, join as join58, normalize as normalize9, relative as relative11, sep as sep14 } from "path";
258210
258354
  async function getGlobExclusionsForPluginCache(searchPath) {
258211
258355
  const cachePath = normalize9(join58(getPluginsDirectory(), "cache"));
258212
258356
  if (searchPath && !pathsOverlap(searchPath, cachePath)) {
@@ -258227,7 +258371,7 @@ async function getGlobExclusionsForPluginCache(searchPath) {
258227
258371
  ], cachePath, new AbortController().signal);
258228
258372
  cachedExclusions = markers.map((markerPath) => {
258229
258373
  const versionDir = dirname29(markerPath);
258230
- const rel = isAbsolute17(versionDir) ? relative12(cachePath, versionDir) : versionDir;
258374
+ const rel = isAbsolute17(versionDir) ? relative11(cachePath, versionDir) : versionDir;
258231
258375
  const posixRelative = rel.replace(/\\/g, "/");
258232
258376
  return `!**/${posixRelative}/**`;
258233
258377
  });
@@ -259349,7 +259493,7 @@ var init_notebook = __esm(() => {
259349
259493
  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.`;
259350
259494
 
259351
259495
  // src/components/NotebookEditToolUseRejectedMessage.tsx
259352
- import { relative as relative13 } from "path";
259496
+ import { relative as relative12 } from "path";
259353
259497
  function NotebookEditToolUseRejectedMessage(t0) {
259354
259498
  const $2 = c3(20);
259355
259499
  const {
@@ -259379,7 +259523,7 @@ function NotebookEditToolUseRejectedMessage(t0) {
259379
259523
  }
259380
259524
  let t3;
259381
259525
  if ($2[2] !== notebook_path || $2[3] !== verbose) {
259382
- t3 = verbose ? notebook_path : relative13(getCwd(), notebook_path);
259526
+ t3 = verbose ? notebook_path : relative12(getCwd(), notebook_path);
259383
259527
  $2[2] = notebook_path;
259384
259528
  $2[3] = verbose;
259385
259529
  $2[4] = t3;
@@ -262323,7 +262467,7 @@ function computeFingerprint(messageText, version) {
262323
262467
  }
262324
262468
  function computeFingerprintFromMessages(messages) {
262325
262469
  const firstMessageText = extractFirstMessageText(messages);
262326
- return computeFingerprint(firstMessageText, "1.7.0");
262470
+ return computeFingerprint(firstMessageText, "1.7.1");
262327
262471
  }
262328
262472
  var FINGERPRINT_SALT = "59cf53e54c78";
262329
262473
  var init_fingerprint = () => {};
@@ -262365,7 +262509,7 @@ async function sideQuery(opts) {
262365
262509
  betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
262366
262510
  }
262367
262511
  const messageText = extractFirstUserMessageText(messages);
262368
- const fingerprint = computeFingerprint(messageText, "1.7.0");
262512
+ const fingerprint = computeFingerprint(messageText, "1.7.1");
262369
262513
  const attributionHeader = getAttributionHeader(fingerprint);
262370
262514
  const systemBlocks = [
262371
262515
  attributionHeader ? { type: "text", text: attributionHeader } : null,
@@ -270092,7 +270236,7 @@ var init_UserTextMessage = __esm(() => {
270092
270236
  });
270093
270237
 
270094
270238
  // src/components/DiagnosticsDisplay.tsx
270095
- import { relative as relative14 } from "path";
270239
+ import { relative as relative13 } from "path";
270096
270240
  function DiagnosticsDisplay(t0) {
270097
270241
  const $2 = c3(14);
270098
270242
  const {
@@ -270196,7 +270340,7 @@ function _temp34(file_0, fileIndex) {
270196
270340
  children: [
270197
270341
  /* @__PURE__ */ jsx_dev_runtime90.jsxDEV(ThemedText, {
270198
270342
  bold: true,
270199
- children: relative14(getCwd(), file_0.uri.replace("file://", "").replace("_claude_fs_right:", ""))
270343
+ children: relative13(getCwd(), file_0.uri.replace("file://", "").replace("_claude_fs_right:", ""))
270200
270344
  }, undefined, false, undefined, this),
270201
270345
  " ",
270202
270346
  /* @__PURE__ */ jsx_dev_runtime90.jsxDEV(ThemedText, {
@@ -270429,6 +270573,25 @@ function AttachmentMessage({
270429
270573
  isTranscriptMode
270430
270574
  }) {
270431
270575
  const bg = useSelectedMessageBg();
270576
+ const getAttachmentDisplayPath = () => {
270577
+ switch (attachment.type) {
270578
+ case "directory":
270579
+ return getDisplayPath(attachment.path);
270580
+ case "file":
270581
+ case "already_read_file":
270582
+ case "compact_file_reference":
270583
+ case "pdf_reference":
270584
+ case "selected_lines_in_ide":
270585
+ return getDisplayPath(attachment.filename);
270586
+ case "nested_memory":
270587
+ return getDisplayPath(attachment.path);
270588
+ case "dynamic_skill":
270589
+ return getDisplayPath(attachment.skillDir);
270590
+ default:
270591
+ return "displayPath" in attachment ? attachment.displayPath : "";
270592
+ }
270593
+ };
270594
+ const resolvedDisplayPath = getAttachmentDisplayPath();
270432
270595
  const isDemoEnv = false;
270433
270596
  if (isAgentSwarmsEnabled() && attachment.type === "teammate_mailbox") {
270434
270597
  const visibleMessages = attachment.messages.filter((msg) => {
@@ -270515,7 +270678,7 @@ function AttachmentMessage({
270515
270678
  "Listed directory ",
270516
270679
  /* @__PURE__ */ jsx_dev_runtime92.jsxDEV(ThemedText, {
270517
270680
  bold: true,
270518
- children: attachment.displayPath + sep16
270681
+ children: resolvedDisplayPath + sep16
270519
270682
  }, undefined, false, undefined, this)
270520
270683
  ]
270521
270684
  }, undefined, true, undefined, this);
@@ -270527,7 +270690,7 @@ function AttachmentMessage({
270527
270690
  "Read ",
270528
270691
  /* @__PURE__ */ jsx_dev_runtime92.jsxDEV(ThemedText, {
270529
270692
  bold: true,
270530
- children: attachment.displayPath
270693
+ children: resolvedDisplayPath
270531
270694
  }, undefined, false, undefined, this),
270532
270695
  " (",
270533
270696
  attachment.content.file.cells.length,
@@ -270541,7 +270704,7 @@ function AttachmentMessage({
270541
270704
  "Read ",
270542
270705
  /* @__PURE__ */ jsx_dev_runtime92.jsxDEV(ThemedText, {
270543
270706
  bold: true,
270544
- children: attachment.displayPath
270707
+ children: resolvedDisplayPath
270545
270708
  }, undefined, false, undefined, this),
270546
270709
  " (unchanged)"
270547
270710
  ]
@@ -270552,7 +270715,7 @@ function AttachmentMessage({
270552
270715
  "Read ",
270553
270716
  /* @__PURE__ */ jsx_dev_runtime92.jsxDEV(ThemedText, {
270554
270717
  bold: true,
270555
- children: attachment.displayPath
270718
+ children: resolvedDisplayPath
270556
270719
  }, undefined, false, undefined, this),
270557
270720
  " (",
270558
270721
  attachment.content.type === "text" ? `${attachment.content.file.numLines}${attachment.truncated ? "+" : ""} lines` : formatFileSize(attachment.content.file.originalSize),
@@ -270565,7 +270728,7 @@ function AttachmentMessage({
270565
270728
  "Referenced file ",
270566
270729
  /* @__PURE__ */ jsx_dev_runtime92.jsxDEV(ThemedText, {
270567
270730
  bold: true,
270568
- children: attachment.displayPath
270731
+ children: resolvedDisplayPath
270569
270732
  }, undefined, false, undefined, this)
270570
270733
  ]
270571
270734
  }, undefined, true, undefined, this);
@@ -270575,7 +270738,7 @@ function AttachmentMessage({
270575
270738
  "Referenced PDF ",
270576
270739
  /* @__PURE__ */ jsx_dev_runtime92.jsxDEV(ThemedText, {
270577
270740
  bold: true,
270578
- children: attachment.displayPath
270741
+ children: resolvedDisplayPath
270579
270742
  }, undefined, false, undefined, this),
270580
270743
  " (",
270581
270744
  attachment.pageCount,
@@ -270595,7 +270758,7 @@ function AttachmentMessage({
270595
270758
  "lines from ",
270596
270759
  /* @__PURE__ */ jsx_dev_runtime92.jsxDEV(ThemedText, {
270597
270760
  bold: true,
270598
- children: attachment.displayPath
270761
+ children: resolvedDisplayPath
270599
270762
  }, undefined, false, undefined, this),
270600
270763
  " in",
270601
270764
  " ",
@@ -270608,7 +270771,7 @@ function AttachmentMessage({
270608
270771
  "Loaded ",
270609
270772
  /* @__PURE__ */ jsx_dev_runtime92.jsxDEV(ThemedText, {
270610
270773
  bold: true,
270611
- children: attachment.displayPath
270774
+ children: resolvedDisplayPath
270612
270775
  }, undefined, false, undefined, this)
270613
270776
  ]
270614
270777
  }, undefined, true, undefined, this);
@@ -270686,7 +270849,7 @@ function AttachmentMessage({
270686
270849
  "from ",
270687
270850
  /* @__PURE__ */ jsx_dev_runtime92.jsxDEV(ThemedText, {
270688
270851
  bold: true,
270689
- children: attachment.displayPath
270852
+ children: resolvedDisplayPath
270690
270853
  }, undefined, false, undefined, this)
270691
270854
  ]
270692
270855
  }, undefined, true, undefined, this);
@@ -280875,6 +281038,19 @@ function getTextContent(node) {
280875
281038
  }
280876
281039
  return "";
280877
281040
  }
281041
+ function renderOptionLabel(label, color2, dimColor) {
281042
+ if (typeof label === "string" || typeof label === "number") {
281043
+ return /* @__PURE__ */ jsx_dev_runtime112.jsxDEV(ThemedText, {
281044
+ dimColor,
281045
+ color: color2,
281046
+ children: label
281047
+ }, undefined, false, undefined, this);
281048
+ }
281049
+ return /* @__PURE__ */ jsx_dev_runtime112.jsxDEV(ThemedBox_default, {
281050
+ flexGrow: 1,
281051
+ children: label
281052
+ }, undefined, false, undefined, this);
281053
+ }
280878
281054
  function Select(t0) {
280879
281055
  const $2 = c3(72);
280880
281056
  const {
@@ -281129,11 +281305,7 @@ function Select(t0) {
281129
281305
  isSelected,
281130
281306
  shouldShowDownArrow: areMoreOptionsBelow && isLastVisibleOption,
281131
281307
  shouldShowUpArrow: areMoreOptionsAbove && isFirstVisibleOption,
281132
- children: /* @__PURE__ */ jsx_dev_runtime112.jsxDEV(ThemedText, {
281133
- dimColor: isOptionDisabled,
281134
- color: optionColor,
281135
- children: label
281136
- }, undefined, false, undefined, this)
281308
+ children: renderOptionLabel(label, optionColor, isOptionDisabled)
281137
281309
  }, undefined, false, undefined, this),
281138
281310
  option_1.description && /* @__PURE__ */ jsx_dev_runtime112.jsxDEV(ThemedBox_default, {
281139
281311
  paddingLeft: 2,
@@ -281246,11 +281418,7 @@ function Select(t0) {
281246
281418
  dimColor: true,
281247
281419
  children: `${i_0}.`.padEnd(maxIndexWidth_0 + 1)
281248
281420
  }, undefined, false, undefined, this),
281249
- /* @__PURE__ */ jsx_dev_runtime112.jsxDEV(ThemedText, {
281250
- dimColor: isOptionDisabled_0,
281251
- color: isOptionDisabled_0 ? undefined : isSelected_0 ? "success" : isFocused_0 ? "suggestion" : undefined,
281252
- children: label_0
281253
- }, undefined, false, undefined, this)
281421
+ renderOptionLabel(label_0, isOptionDisabled_0 ? undefined : isSelected_0 ? "success" : isFocused_0 ? "suggestion" : undefined, isOptionDisabled_0)
281254
281422
  ]
281255
281423
  }, undefined, true, undefined, this)
281256
281424
  }, undefined, false, undefined, this),
@@ -283089,7 +283257,7 @@ var init_user = __esm(() => {
283089
283257
  deviceId,
283090
283258
  sessionId: getSessionId(),
283091
283259
  email: getEmail(),
283092
- appVersion: "1.7.0",
283260
+ appVersion: "1.7.1",
283093
283261
  platform: getHostPlatformForAnalytics(),
283094
283262
  organizationUuid,
283095
283263
  accountUuid,
@@ -284154,7 +284322,7 @@ async function initializeBetaTracing(resource) {
284154
284322
  });
284155
284323
  logs.setGlobalLoggerProvider(loggerProvider);
284156
284324
  setLoggerProvider(loggerProvider);
284157
- const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "1.7.0");
284325
+ const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "1.7.1");
284158
284326
  setEventLogger(eventLogger);
284159
284327
  process.on("beforeExit", async () => {
284160
284328
  await loggerProvider?.forceFlush();
@@ -284194,7 +284362,7 @@ async function initializeTelemetry() {
284194
284362
  const platform2 = getPlatform();
284195
284363
  const baseAttributes = {
284196
284364
  [ATTR_SERVICE_NAME4]: "claude-code",
284197
- [ATTR_SERVICE_VERSION4]: "1.7.0"
284365
+ [ATTR_SERVICE_VERSION4]: "1.7.1"
284198
284366
  };
284199
284367
  if (platform2 === "wsl") {
284200
284368
  const wslVersion = getWslVersion();
@@ -284239,7 +284407,7 @@ async function initializeTelemetry() {
284239
284407
  } catch {}
284240
284408
  };
284241
284409
  registerCleanup(shutdownTelemetry2);
284242
- return meterProvider2.getMeter("com.anthropic.claude_code", "1.7.0");
284410
+ return meterProvider2.getMeter("com.anthropic.claude_code", "1.7.1");
284243
284411
  }
284244
284412
  const meterProvider = new MeterProvider4({
284245
284413
  resource,
@@ -284259,7 +284427,7 @@ async function initializeTelemetry() {
284259
284427
  });
284260
284428
  logs.setGlobalLoggerProvider(loggerProvider);
284261
284429
  setLoggerProvider(loggerProvider);
284262
- const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "1.7.0");
284430
+ const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "1.7.1");
284263
284431
  setEventLogger(eventLogger);
284264
284432
  logForDebugging("[3P telemetry] Event logger set successfully");
284265
284433
  process.on("beforeExit", async () => {
@@ -284321,7 +284489,7 @@ Current timeout: ${timeoutMs}ms
284321
284489
  }
284322
284490
  };
284323
284491
  registerCleanup(shutdownTelemetry);
284324
- return meterProvider.getMeter("com.anthropic.claude_code", "1.7.0");
284492
+ return meterProvider.getMeter("com.anthropic.claude_code", "1.7.1");
284325
284493
  }
284326
284494
  async function flushTelemetry() {
284327
284495
  const meterProvider = getMeterProvider();
@@ -285511,7 +285679,7 @@ function detectLinuxGlobPatternWarnings() {
285511
285679
  }
285512
285680
  async function getDoctorDiagnostic() {
285513
285681
  const installationType = await getCurrentInstallationType();
285514
- const version = typeof MACRO !== "undefined" ? "1.7.0" : "unknown";
285682
+ const version = typeof MACRO !== "undefined" ? "1.7.1" : "unknown";
285515
285683
  const installationPath = await getInstallationPath();
285516
285684
  const invokedBinary = getInvokedBinary();
285517
285685
  const multipleInstallations = await detectMultipleInstallations();
@@ -286452,8 +286620,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
286452
286620
  const maxVersion = await getMaxVersion();
286453
286621
  if (maxVersion && gt(version, maxVersion)) {
286454
286622
  logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version} to ${maxVersion}`);
286455
- if (gte("1.7.0", maxVersion)) {
286456
- logForDebugging(`Native installer: current version ${"1.7.0"} is already at or above maxVersion ${maxVersion}, skipping update`);
286623
+ if (gte("1.7.1", maxVersion)) {
286624
+ logForDebugging(`Native installer: current version ${"1.7.1"} is already at or above maxVersion ${maxVersion}, skipping update`);
286457
286625
  logEvent("tengu_native_update_skipped_max_version", {
286458
286626
  latency_ms: Date.now() - startTime,
286459
286627
  max_version: maxVersion,
@@ -286464,7 +286632,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
286464
286632
  version = maxVersion;
286465
286633
  }
286466
286634
  }
286467
- if (!forceReinstall && version === "1.7.0" && await versionIsAvailable(version) && await isPossibleLocalClawdBinary(executablePath)) {
286635
+ if (!forceReinstall && version === "1.7.1" && await versionIsAvailable(version) && await isPossibleLocalClawdBinary(executablePath)) {
286468
286636
  logForDebugging(`Found ${version} at ${executablePath}, skipping install`);
286469
286637
  logEvent("tengu_native_update_complete", {
286470
286638
  latency_ms: Date.now() - startTime,
@@ -295657,7 +295825,7 @@ var init_sessionIngress = __esm(() => {
295657
295825
  });
295658
295826
 
295659
295827
  // src/utils/conversationRecovery.ts
295660
- import { relative as relative15 } from "path";
295828
+ import { relative as relative14 } from "path";
295661
295829
  function migrateLegacyAttachmentTypes(message) {
295662
295830
  if (message.type !== "attachment") {
295663
295831
  return message;
@@ -295669,7 +295837,7 @@ function migrateLegacyAttachmentTypes(message) {
295669
295837
  attachment: {
295670
295838
  ...attachment,
295671
295839
  type: "file",
295672
- displayPath: relative15(getCwd(), attachment.filename)
295840
+ displayPath: relative14(getCwd(), attachment.filename)
295673
295841
  }
295674
295842
  };
295675
295843
  }
@@ -295679,7 +295847,7 @@ function migrateLegacyAttachmentTypes(message) {
295679
295847
  attachment: {
295680
295848
  ...attachment,
295681
295849
  type: "directory",
295682
- displayPath: relative15(getCwd(), attachment.path)
295850
+ displayPath: relative14(getCwd(), attachment.path)
295683
295851
  }
295684
295852
  };
295685
295853
  }
@@ -295690,7 +295858,7 @@ function migrateLegacyAttachmentTypes(message) {
295690
295858
  ...message,
295691
295859
  attachment: {
295692
295860
  ...attachment,
295693
- displayPath: relative15(getCwd(), path8)
295861
+ displayPath: relative14(getCwd(), path8)
295694
295862
  }
295695
295863
  };
295696
295864
  }
@@ -305568,9 +305736,9 @@ var require_URL = __commonJS((exports, module) => {
305568
305736
  s += "#" + this.fragment;
305569
305737
  return s;
305570
305738
  },
305571
- resolve: function(relative16) {
305739
+ resolve: function(relative15) {
305572
305740
  var base = this;
305573
- var r = new URL3(relative16);
305741
+ var r = new URL3(relative15);
305574
305742
  var t = new URL3;
305575
305743
  if (r.scheme !== undefined) {
305576
305744
  t.scheme = r.scheme;
@@ -320786,7 +320954,7 @@ ${annotation.preview}`);
320786
320954
  });
320787
320955
 
320788
320956
  // src/tools/LSPTool/formatters.ts
320789
- import { relative as relative16 } from "path";
320957
+ import { relative as relative15 } from "path";
320790
320958
  function formatUri2(uri, cwd2) {
320791
320959
  if (!uri) {
320792
320960
  logForDebugging("formatUri called with undefined URI - indicates malformed LSP server response", { level: "warn" });
@@ -320803,7 +320971,7 @@ function formatUri2(uri, cwd2) {
320803
320971
  logForDebugging(`Failed to decode LSP URI '${uri}': ${errorMsg}. Using un-decoded path: ${filePath}`, { level: "warn" });
320804
320972
  }
320805
320973
  if (cwd2) {
320806
- const relativePath = relative16(cwd2, filePath).replaceAll("\\", "/");
320974
+ const relativePath = relative15(cwd2, filePath).replaceAll("\\", "/");
320807
320975
  if (relativePath.length < filePath.length && !relativePath.startsWith("../../")) {
320808
320976
  return relativePath;
320809
320977
  }
@@ -328060,6 +328228,14 @@ async function checkPermissionsAndCallTool(tool, toolUseID, input, toolUseContex
328060
328228
  sourceToolAssistantUUID: assistantMessage.uuid
328061
328229
  })
328062
328230
  },
328231
+ ...!isInterrupt ? [
328232
+ {
328233
+ message: createUserMessage({
328234
+ content: TOOL_FAILURE_REFLECTION_HINT,
328235
+ isMeta: true
328236
+ })
328237
+ }
328238
+ ] : [],
328063
328239
  ...hookMessages
328064
328240
  ];
328065
328241
  } finally {
@@ -328069,7 +328245,7 @@ async function checkPermissionsAndCallTool(tool, toolUseID, input, toolUseContex
328069
328245
  }
328070
328246
  }
328071
328247
  }
328072
- var HOOK_TIMING_DISPLAY_THRESHOLD_MS2 = 500, SLOW_PHASE_LOG_THRESHOLD_MS = 2000;
328248
+ var TOOL_FAILURE_REFLECTION_HINT = "The previous tool call failed. Reflect on the error, adjust your approach, and continue the task unless the user needs to make a decision.", HOOK_TIMING_DISPLAY_THRESHOLD_MS2 = 500, SLOW_PHASE_LOG_THRESHOLD_MS = 2000;
328073
328249
  var init_toolExecution = __esm(() => {
328074
328250
  init_metadata();
328075
328251
  init_state();
@@ -330016,6 +330192,54 @@ var init_tokenBudget2 = __esm(() => {
330016
330192
  init_tokenBudget();
330017
330193
  });
330018
330194
 
330195
+ // src/utils/sessionState.ts
330196
+ function setSessionStateChangedListener(cb) {
330197
+ stateListener = cb;
330198
+ }
330199
+ function setSessionMetadataChangedListener(cb) {
330200
+ metadataListener = cb;
330201
+ }
330202
+ function setPermissionModeChangedListener(cb) {
330203
+ permissionModeListener = cb;
330204
+ }
330205
+ function getSessionState() {
330206
+ return currentState;
330207
+ }
330208
+ function notifySessionStateChanged(state, details) {
330209
+ currentState = state;
330210
+ stateListener?.(state, details);
330211
+ if (state === "requires_action" && details) {
330212
+ hasPendingAction = true;
330213
+ metadataListener?.({
330214
+ pending_action: details
330215
+ });
330216
+ } else if (hasPendingAction) {
330217
+ hasPendingAction = false;
330218
+ metadataListener?.({ pending_action: null });
330219
+ }
330220
+ if (state === "idle") {
330221
+ metadataListener?.({ task_summary: null });
330222
+ }
330223
+ if (isEnvTruthy(process.env.CLAUDE_CODE_EMIT_SESSION_STATE_EVENTS)) {
330224
+ enqueueSdkEvent({
330225
+ type: "system",
330226
+ subtype: "session_state_changed",
330227
+ state
330228
+ });
330229
+ }
330230
+ }
330231
+ function notifySessionMetadataChanged(metadata) {
330232
+ metadataListener?.(metadata);
330233
+ }
330234
+ function notifyPermissionModeChanged(mode) {
330235
+ permissionModeListener?.(mode);
330236
+ }
330237
+ var stateListener = null, metadataListener = null, permissionModeListener = null, hasPendingAction = false, currentState = "idle";
330238
+ var init_sessionState = __esm(() => {
330239
+ init_envUtils();
330240
+ init_sdkEventQueue();
330241
+ });
330242
+
330019
330243
  // src/query.ts
330020
330244
  function* yieldMissingToolResultBlocks(assistantMessages, errorMessage2) {
330021
330245
  for (const assistantMessage of assistantMessages) {
@@ -330039,6 +330263,99 @@ function* yieldMissingToolResultBlocks(assistantMessages, errorMessage2) {
330039
330263
  function isWithheldMaxOutputTokens(msg) {
330040
330264
  return msg?.type === "assistant" && msg.apiError === "max_output_tokens";
330041
330265
  }
330266
+ function extractAssistantText(message) {
330267
+ if (!message) {
330268
+ return "";
330269
+ }
330270
+ const { content } = message.message;
330271
+ if (typeof content === "string") {
330272
+ return content;
330273
+ }
330274
+ return content.filter((block) => block.type === "text" && typeof block.text === "string" && block.text.trim().length > 0).map((block) => block.text).join(`
330275
+ `);
330276
+ }
330277
+ function toSingleLineSummary(text) {
330278
+ const cleaned = stripSignatureBlocks(text).replace(/\s+/g, " ").trim();
330279
+ if (!cleaned) {
330280
+ return "Completed another work step.";
330281
+ }
330282
+ const firstSentence = cleaned.split(/(?<=[.!?])\s+/)[0]?.trim() || cleaned;
330283
+ const normalized = firstSentence.replace(/^summary:\s*/i, "").trim();
330284
+ if (normalized.length <= 220) {
330285
+ return normalized;
330286
+ }
330287
+ return `${normalized.slice(0, 217).trimEnd()}...`;
330288
+ }
330289
+ function detectTurnCompletionSignal(text) {
330290
+ if (!text) {
330291
+ return null;
330292
+ }
330293
+ const normalized = text.toLowerCase().replace(/[^a-z0-9\s]/g, " ").replace(/\s+/g, " ").trim();
330294
+ if (/\b(task complete|task completed|work complete|work completed|implementation complete|implementation completed|audit complete|audit completed)\b/.test(normalized) || /\b(all done|task is complete|work is complete)\b/.test(normalized)) {
330295
+ return "completed";
330296
+ }
330297
+ if (/\b(needs? input|need your input|need user input|waiting on you|please confirm|please choose)\b/.test(normalized)) {
330298
+ return "needs_input";
330299
+ }
330300
+ return null;
330301
+ }
330302
+ function isKeepGoingTurn(messages) {
330303
+ return messages.some((message) => message.type === "user" && message.isMeta === true && typeof message.message.content === "string" && message.message.content.includes("[KEEP GOING"));
330304
+ }
330305
+ function createPostTurnSummaryMessage(params) {
330306
+ const { assistantMessage, summary, completionSignal, autoContinuing } = params;
330307
+ const baseMessage = createSystemMessage(autoContinuing ? `Summary: ${summary} Continuing automatically.` : `Summary: ${summary}`, "info");
330308
+ const statusCategory = completionSignal === "completed" ? "completed" : completionSignal === "needs_input" ? "waiting" : "review_ready";
330309
+ const statusDetail = autoContinuing ? "Turn ended without an explicit completion marker; continuing automatically." : completionSignal === "needs_input" ? "Waiting for user input." : "Turn completed.";
330310
+ const needsAction = completionSignal === "needs_input" ? "Provide the requested input to continue." : autoContinuing ? "No action required; continuing automatically." : "No immediate action required.";
330311
+ const summarizesUuid = assistantMessage?.uuid ?? baseMessage.uuid ?? "";
330312
+ const metadata = {
330313
+ type: "system",
330314
+ subtype: "post_turn_summary",
330315
+ summarizes_uuid: summarizesUuid,
330316
+ status_category: statusCategory,
330317
+ status_detail: statusDetail,
330318
+ is_noteworthy: autoContinuing || completionSignal === "needs_input",
330319
+ title: autoContinuing ? "Continuing work" : "Turn summary",
330320
+ description: summary,
330321
+ recent_action: summary,
330322
+ needs_action: needsAction,
330323
+ artifact_urls: [],
330324
+ uuid: baseMessage.uuid,
330325
+ session_id: getSessionId()
330326
+ };
330327
+ return {
330328
+ message: {
330329
+ ...baseMessage,
330330
+ ...metadata
330331
+ },
330332
+ metadata
330333
+ };
330334
+ }
330335
+ function createAutoContinuationPrompt(summary) {
330336
+ return createUserMessage({
330337
+ content: `The previous turn ended before you explicitly marked the task complete. Continue directly from this summary without repeating prior work: ${summary}
330338
+ ` + `When the task is actually done, say TASK COMPLETE in your response. If you need the user to proceed, say NEEDS INPUT and state exactly what you need.`,
330339
+ isMeta: true
330340
+ });
330341
+ }
330342
+ function shouldAutoContinueTurn(params) {
330343
+ const {
330344
+ assistantMessage,
330345
+ completionSignal,
330346
+ hasTurnHistory,
330347
+ keepGoingActive,
330348
+ preventContinuation,
330349
+ agentId
330350
+ } = params;
330351
+ if (!assistantMessage || assistantMessage.isApiErrorMessage) {
330352
+ return false;
330353
+ }
330354
+ if (completionSignal || keepGoingActive || preventContinuation || agentId) {
330355
+ return false;
330356
+ }
330357
+ return hasTurnHistory;
330358
+ }
330042
330359
  async function* query(params) {
330043
330360
  const consumedCommandUuids = [];
330044
330361
  const terminal = yield* queryLoop(params, consumedCommandUuids);
@@ -330522,9 +330839,6 @@ async function* queryLoop(params, consumedCommandUuids) {
330522
330839
  return { reason: "completed" };
330523
330840
  }
330524
330841
  const stopHookResult = yield* handleStopHooks(messagesForQuery, assistantMessages, systemPrompt, userContext, systemContext, toolUseContext, querySource, stopHookActive);
330525
- if (stopHookResult.preventContinuation) {
330526
- return { reason: "stop_hook_prevented" };
330527
- }
330528
330842
  if (stopHookResult.blockingErrors.length > 0) {
330529
330843
  const next2 = {
330530
330844
  messages: [
@@ -330545,7 +330859,50 @@ async function* queryLoop(params, consumedCommandUuids) {
330545
330859
  state = next2;
330546
330860
  continue;
330547
330861
  }
330862
+ const lastAssistantText = extractAssistantText(lastMessage);
330863
+ const completionSignal = detectTurnCompletionSignal(lastAssistantText);
330864
+ const autoContinueTurn = shouldAutoContinueTurn({
330865
+ assistantMessage: lastMessage,
330866
+ completionSignal,
330867
+ hasTurnHistory: Boolean(pendingToolUseSummary) || turnCount > 1,
330868
+ keepGoingActive: isKeepGoingTurn(messagesForQuery),
330869
+ preventContinuation: stopHookResult.preventContinuation,
330870
+ agentId: toolUseContext.agentId
330871
+ });
330872
+ const postTurnSummary = createPostTurnSummaryMessage({
330873
+ assistantMessage: lastMessage,
330874
+ summary: toSingleLineSummary(lastAssistantText),
330875
+ completionSignal,
330876
+ autoContinuing: autoContinueTurn
330877
+ });
330878
+ yield postTurnSummary.message;
330879
+ notifySessionMetadataChanged({
330880
+ post_turn_summary: postTurnSummary.metadata
330881
+ });
330882
+ if (stopHookResult.preventContinuation) {
330883
+ return { reason: "stop_hook_prevented" };
330884
+ }
330548
330885
  if (false) {}
330886
+ if (autoContinueTurn) {
330887
+ state = {
330888
+ messages: [
330889
+ ...messagesForQuery,
330890
+ ...assistantMessages,
330891
+ postTurnSummary.message,
330892
+ createAutoContinuationPrompt(postTurnSummary.metadata.description)
330893
+ ],
330894
+ toolUseContext,
330895
+ autoCompactTracking: tracking,
330896
+ maxOutputTokensRecoveryCount: 0,
330897
+ hasAttemptedReactiveCompact: false,
330898
+ maxOutputTokensOverride: undefined,
330899
+ pendingToolUseSummary: undefined,
330900
+ stopHookActive: undefined,
330901
+ turnCount,
330902
+ transition: { reason: "next_turn" }
330903
+ };
330904
+ continue;
330905
+ }
330549
330906
  return { reason: "completed" };
330550
330907
  }
330551
330908
  let shouldPreventContinuation = false;
@@ -330781,6 +331138,7 @@ var init_query2 = __esm(() => {
330781
331138
  init_deps();
330782
331139
  init_state();
330783
331140
  init_tokenBudget2();
331141
+ init_sessionState();
330784
331142
  });
330785
331143
 
330786
331144
  // src/services/api/emptyUsage.ts
@@ -330853,7 +331211,7 @@ function getAnthropicEnvMetadata() {
330853
331211
  function getBuildAgeMinutes() {
330854
331212
  if (false)
330855
331213
  ;
330856
- const buildTime = new Date("2026-04-26T17:37:22.796Z").getTime();
331214
+ const buildTime = new Date("2026-05-05T20:42:20.896Z").getTime();
330857
331215
  if (isNaN(buildTime))
330858
331216
  return;
330859
331217
  return Math.floor((Date.now() - buildTime) / 60000);
@@ -331997,7 +332355,7 @@ __export(exports_commitAttribution, {
331997
332355
  });
331998
332356
  import { createHash as createHash17, randomUUID as randomUUID18 } from "crypto";
331999
332357
  import { stat as stat27 } from "fs/promises";
332000
- import { isAbsolute as isAbsolute21, join as join81, relative as relative17, sep as sep20 } from "path";
332358
+ import { isAbsolute as isAbsolute21, join as join81, relative as relative16, sep as sep20 } from "path";
332001
332359
  function getAttributionRepoRoot() {
332002
332360
  const cwd2 = getCwd();
332003
332361
  return findGitRoot(cwd2) ?? getOriginalCwd();
@@ -332065,10 +332423,10 @@ function normalizeFilePath(filePath) {
332065
332423
  resolvedCwd = fs4.realpathSync(cwd2);
332066
332424
  } catch {}
332067
332425
  if (resolvedPath.startsWith(resolvedCwd + sep20) || resolvedPath === resolvedCwd) {
332068
- return relative17(resolvedCwd, resolvedPath).replaceAll(sep20, "/");
332426
+ return relative16(resolvedCwd, resolvedPath).replaceAll(sep20, "/");
332069
332427
  }
332070
332428
  if (filePath.startsWith(cwd2 + sep20) || filePath === cwd2) {
332071
- return relative17(cwd2, filePath).replaceAll(sep20, "/");
332429
+ return relative16(cwd2, filePath).replaceAll(sep20, "/");
332072
332430
  }
332073
332431
  return filePath;
332074
332432
  }
@@ -334250,7 +334608,7 @@ var init_queryHelpers = __esm(() => {
334250
334608
  import { randomUUID as randomUUID19 } from "crypto";
334251
334609
  import { rm as rm4 } from "fs";
334252
334610
  import { appendFile as appendFile3, copyFile as copyFile5, mkdir as mkdir20 } from "fs/promises";
334253
- import { dirname as dirname33, isAbsolute as isAbsolute22, join as join82, relative as relative18 } from "path";
334611
+ import { dirname as dirname33, isAbsolute as isAbsolute22, join as join82, relative as relative17 } from "path";
334254
334612
  function safeRemoveOverlay(overlayPath) {
334255
334613
  rm4(overlayPath, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 }, () => {});
334256
334614
  }
@@ -334501,7 +334859,7 @@ async function startSpeculation(suggestionText, context5, setAppState, isPipelin
334501
334859
  const pathKey = "notebook_path" in input ? "notebook_path" : ("path" in input) ? "path" : "file_path";
334502
334860
  const filePath = input[pathKey];
334503
334861
  if (filePath) {
334504
- const rel = relative18(cwd2, filePath);
334862
+ const rel = relative17(cwd2, filePath);
334505
334863
  if (isAbsolute22(rel) || rel.startsWith("..")) {
334506
334864
  if (isWriteTool) {
334507
334865
  logForDebugging(`[Speculation] Denied ${tool.name}: path outside cwd: ${filePath}`);
@@ -335967,6 +336325,7 @@ function getSimplePrompt() {
335967
336325
  const backgroundNote = getBackgroundUsageNote2();
335968
336326
  const instructionItems = [
335969
336327
  "If your command will create new directories or files, first use this tool to run `ls` to verify the parent directory exists and is the correct location.",
336328
+ "On Windows, prefer the PowerShell tool for native Windows build commands (for example Visual Studio, MSBuild, Ninja, or plain CMake workflows). Keep using Bash only when the command explicitly targets MinGW/MSYS2/Git Bash semantics.",
335970
336329
  'Always quote file paths that contain spaces with double quotes in your command (e.g., cd "path with spaces/file.txt")',
335971
336330
  "Try to maintain your current working directory throughout the session by using absolute paths and avoiding usage of `cd`. You may use `cd` if the User explicitly requests it.",
335972
336331
  `You may specify an optional timeout in milliseconds (up to ${getMaxTimeoutMs2()}ms / ${getMaxTimeoutMs2() / 60000} minutes). By default, your command will timeout after ${getDefaultTimeoutMs2()}ms (${getDefaultTimeoutMs2() / 60000} minutes).`,
@@ -342960,7 +343319,7 @@ var init_findRelevantMemories = __esm(() => {
342960
343319
 
342961
343320
  // src/utils/attachments.ts
342962
343321
  import { readdir as readdir17, stat as stat31 } from "fs/promises";
342963
- import { dirname as dirname35, parse as parse7, relative as relative19, resolve as resolve29 } from "path";
343322
+ import { dirname as dirname35, parse as parse7, relative as relative18, resolve as resolve29 } from "path";
342964
343323
  import { randomUUID as randomUUID23 } from "crypto";
342965
343324
  async function getAttachments(input, toolUseContext, ideSelection, queuedCommands, messages, querySource, options) {
342966
343325
  if (isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_ATTACHMENTS) || isEnvTruthy(process.env.CLAUDE_CODE_SIMPLE)) {
@@ -343325,7 +343684,7 @@ async function getSelectedLinesFromIDE(ideSelection, toolUseContext) {
343325
343684
  lineEnd: ideSelection.lineStart + ideSelection.lineCount - 1,
343326
343685
  filename: ideSelection.filePath,
343327
343686
  content: ideSelection.text,
343328
- displayPath: relative19(getCwd(), ideSelection.filePath)
343687
+ displayPath: relative18(getCwd(), ideSelection.filePath)
343329
343688
  }
343330
343689
  ];
343331
343690
  }
@@ -343364,7 +343723,7 @@ function memoryFilesToAttachments(memoryFiles, toolUseContext, triggerFilePath)
343364
343723
  type: "nested_memory",
343365
343724
  path: memoryFile.path,
343366
343725
  content: memoryFile,
343367
- displayPath: relative19(getCwd(), memoryFile.path)
343726
+ displayPath: relative18(getCwd(), memoryFile.path)
343368
343727
  });
343369
343728
  toolUseContext.loadedNestedMemoryPaths?.add(memoryFile.path);
343370
343729
  toolUseContext.readFileState.set(memoryFile.path, {
@@ -343460,7 +343819,7 @@ async function processAtMentionedFiles(input, toolUseContext) {
343460
343819
  type: "directory",
343461
343820
  path: absoluteFilename,
343462
343821
  content: stdout,
343463
- displayPath: relative19(getCwd(), absoluteFilename)
343822
+ displayPath: relative18(getCwd(), absoluteFilename)
343464
343823
  };
343465
343824
  } catch {
343466
343825
  return null;
@@ -343806,7 +344165,7 @@ async function getDynamicSkillAttachments(toolUseContext) {
343806
344165
  type: "dynamic_skill",
343807
344166
  skillDir,
343808
344167
  skillNames,
343809
- displayPath: relative19(getCwd(), skillDir)
344168
+ displayPath: relative18(getCwd(), skillDir)
343810
344169
  });
343811
344170
  }
343812
344171
  }
@@ -343993,7 +344352,7 @@ async function tryGetPDFReference(filename) {
343993
344352
  filename,
343994
344353
  pageCount: effectivePageCount,
343995
344354
  fileSize: stats.size,
343996
- displayPath: relative19(getCwd(), filename)
344355
+ displayPath: relative18(getCwd(), filename)
343997
344356
  };
343998
344357
  }
343999
344358
  } catch {}
@@ -344033,7 +344392,7 @@ async function generateFileAttachment(filename, toolUseContext, successEventName
344033
344392
  return {
344034
344393
  type: "already_read_file",
344035
344394
  filename,
344036
- displayPath: relative19(getCwd(), filename),
344395
+ displayPath: relative18(getCwd(), filename),
344037
344396
  content: {
344038
344397
  type: "text",
344039
344398
  file: {
@@ -344061,7 +344420,7 @@ async function generateFileAttachment(filename, toolUseContext, successEventName
344061
344420
  return {
344062
344421
  type: "compact_file_reference",
344063
344422
  filename,
344064
- displayPath: relative19(getCwd(), filename)
344423
+ displayPath: relative18(getCwd(), filename)
344065
344424
  };
344066
344425
  }
344067
344426
  const appState2 = toolUseContext.getAppState();
@@ -344081,7 +344440,7 @@ async function generateFileAttachment(filename, toolUseContext, successEventName
344081
344440
  filename,
344082
344441
  content: result.data,
344083
344442
  truncated: true,
344084
- displayPath: relative19(getCwd(), filename)
344443
+ displayPath: relative18(getCwd(), filename)
344085
344444
  };
344086
344445
  } catch {
344087
344446
  logEvent(errorEventName, {});
@@ -344099,7 +344458,7 @@ async function generateFileAttachment(filename, toolUseContext, successEventName
344099
344458
  type: "file",
344100
344459
  filename,
344101
344460
  content: result.data,
344102
- displayPath: relative19(getCwd(), filename)
344461
+ displayPath: relative18(getCwd(), filename)
344103
344462
  };
344104
344463
  } catch (error5) {
344105
344464
  if (error5 instanceof MaxFileReadTokenExceededError || error5 instanceof FileTooLargeError) {
@@ -347851,7 +348210,7 @@ import {
347851
348210
  stat as stat34,
347852
348211
  symlink as symlink3
347853
348212
  } from "fs/promises";
347854
- import { basename as basename29, dirname as dirname42, join as join97, relative as relative20, resolve as resolve33, sep as sep24 } from "path";
348213
+ import { basename as basename29, dirname as dirname42, join as join97, relative as relative19, resolve as resolve33, sep as sep24 } from "path";
347855
348214
  function getPluginCachePath() {
347856
348215
  return join97(getPluginsDirectory(), "cache");
347857
348216
  }
@@ -347921,9 +348280,9 @@ async function copyDir(src, dest) {
347921
348280
  }
347922
348281
  const srcPrefix = resolvedSrc.endsWith(sep24) ? resolvedSrc : resolvedSrc + sep24;
347923
348282
  if (resolvedTarget.startsWith(srcPrefix) || resolvedTarget === resolvedSrc) {
347924
- const targetRelativeToSrc = relative20(resolvedSrc, resolvedTarget);
348283
+ const targetRelativeToSrc = relative19(resolvedSrc, resolvedTarget);
347925
348284
  const destTargetPath = join97(dest, targetRelativeToSrc);
347926
- const relativeLinkPath = relative20(dirname42(destPath), destTargetPath);
348285
+ const relativeLinkPath = relative19(dirname42(destPath), destTargetPath);
347927
348286
  await symlink3(relativeLinkPath, destPath);
347928
348287
  } else {
347929
348288
  await symlink3(resolvedTarget, destPath);
@@ -353812,7 +354171,7 @@ var init_permissions2 = __esm(() => {
353812
354171
  });
353813
354172
 
353814
354173
  // src/utils/permissions/permissionSetup.ts
353815
- import { relative as relative21 } from "path";
354174
+ import { relative as relative20 } from "path";
353816
354175
  import { resolve as resolve34 } from "path";
353817
354176
  function isDangerousBashPermission(toolName, ruleContent) {
353818
354177
  if (toolName !== BASH_TOOL_NAME) {
@@ -353916,7 +354275,7 @@ function formatPermissionSource(source) {
353916
354275
  if (SETTING_SOURCES.includes(source)) {
353917
354276
  const filePath = getSettingsFilePathForSource(source);
353918
354277
  if (filePath) {
353919
- const relativePath = relative21(getCwd(), filePath);
354278
+ const relativePath = relative20(getCwd(), filePath);
353920
354279
  return relativePath.length < filePath.length ? relativePath : filePath;
353921
354280
  }
353922
354281
  }
@@ -359681,7 +360040,7 @@ function Feedback({
359681
360040
  platform: env3.platform,
359682
360041
  gitRepo: envInfo.isGit,
359683
360042
  terminal: env3.terminal,
359684
- version: "1.7.0",
360043
+ version: "1.7.1",
359685
360044
  transcript: normalizeMessagesForAPI(messages),
359686
360045
  errors: sanitizedErrors,
359687
360046
  lastApiRequest: getLastAPIRequest(),
@@ -359873,7 +360232,7 @@ function Feedback({
359873
360232
  ", ",
359874
360233
  env3.terminal,
359875
360234
  ", v",
359876
- "1.7.0"
360235
+ "1.7.1"
359877
360236
  ]
359878
360237
  }, undefined, true, undefined, this)
359879
360238
  ]
@@ -359979,7 +360338,7 @@ ${sanitizedDescription}
359979
360338
  ` + `**Environment Info**
359980
360339
  ` + `- Platform: ${env3.platform}
359981
360340
  ` + `- Terminal: ${env3.terminal}
359982
- ` + `- Version: ${"1.7.0"}
360341
+ ` + `- Version: ${"1.7.1"}
359983
360342
  ` + `- Feedback ID: ${feedbackId}
359984
360343
  ` + `
359985
360344
  **Errors**
@@ -362607,7 +362966,7 @@ function buildPrimarySection() {
362607
362966
  }, undefined, false, undefined, this);
362608
362967
  return [{
362609
362968
  label: "Version",
362610
- value: "1.7.0"
362969
+ value: "1.7.1"
362611
362970
  }, {
362612
362971
  label: "Session name",
362613
362972
  value: nameValue
@@ -367288,7 +367647,7 @@ function Config({
367288
367647
  }
367289
367648
  }, undefined, false, undefined, this)
367290
367649
  }, undefined, false, undefined, this) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_dev_runtime175.jsxDEV(ChannelDowngradeDialog, {
367291
- currentVersion: "1.7.0",
367650
+ currentVersion: "1.7.1",
367292
367651
  onChoice: (choice) => {
367293
367652
  setShowSubmenu(null);
367294
367653
  setTabsHidden(false);
@@ -367300,7 +367659,7 @@ function Config({
367300
367659
  autoUpdatesChannel: "stable"
367301
367660
  };
367302
367661
  if (choice === "stay") {
367303
- newSettings.minimumVersion = "1.7.0";
367662
+ newSettings.minimumVersion = "1.7.1";
367304
367663
  }
367305
367664
  updateSettingsForSource("userSettings", newSettings);
367306
367665
  setSettingsData((prev_27) => ({
@@ -372997,22 +373356,482 @@ var init_doctor2 = __esm(() => {
372997
373356
  doctor_default = doctor;
372998
373357
  });
372999
373358
 
373359
+ // src/buddy/sprites.ts
373360
+ function renderSprite(bones, frame = 0) {
373361
+ const frames = BODIES[bones.species];
373362
+ const body = frames[frame % frames.length].map((line) => line.replaceAll("{E}", bones.eye));
373363
+ const lines = [...body];
373364
+ if (bones.hat !== "none" && !lines[0].trim()) {
373365
+ lines[0] = HAT_LINES[bones.hat];
373366
+ }
373367
+ if (!lines[0].trim() && frames.every((f) => !f[0].trim()))
373368
+ lines.shift();
373369
+ return lines;
373370
+ }
373371
+ var BODIES, HAT_LINES;
373372
+ var init_sprites = __esm(() => {
373373
+ init_types3();
373374
+ BODIES = {
373375
+ [duck]: [
373376
+ [
373377
+ " ",
373378
+ " __ ",
373379
+ " <({E} )___ ",
373380
+ " ( ._> ",
373381
+ " `--´ "
373382
+ ],
373383
+ [
373384
+ " ",
373385
+ " __ ",
373386
+ " <({E} )___ ",
373387
+ " ( ._> ",
373388
+ " `--´~ "
373389
+ ],
373390
+ [
373391
+ " ",
373392
+ " __ ",
373393
+ " <({E} )___ ",
373394
+ " ( .__> ",
373395
+ " `--´ "
373396
+ ]
373397
+ ],
373398
+ [goose]: [
373399
+ [
373400
+ " ",
373401
+ " ({E}> ",
373402
+ " || ",
373403
+ " _(__)_ ",
373404
+ " ^^^^ "
373405
+ ],
373406
+ [
373407
+ " ",
373408
+ " ({E}> ",
373409
+ " || ",
373410
+ " _(__)_ ",
373411
+ " ^^^^ "
373412
+ ],
373413
+ [
373414
+ " ",
373415
+ " ({E}>> ",
373416
+ " || ",
373417
+ " _(__)_ ",
373418
+ " ^^^^ "
373419
+ ]
373420
+ ],
373421
+ [blob]: [
373422
+ [
373423
+ " ",
373424
+ " .----. ",
373425
+ " ( {E} {E} ) ",
373426
+ " ( ) ",
373427
+ " `----´ "
373428
+ ],
373429
+ [
373430
+ " ",
373431
+ " .------. ",
373432
+ " ( {E} {E} ) ",
373433
+ " ( ) ",
373434
+ " `------´ "
373435
+ ],
373436
+ [
373437
+ " ",
373438
+ " .--. ",
373439
+ " ({E} {E}) ",
373440
+ " ( ) ",
373441
+ " `--´ "
373442
+ ]
373443
+ ],
373444
+ [cat]: [
373445
+ [
373446
+ " ",
373447
+ " /\\_/\\ ",
373448
+ " ( {E} {E}) ",
373449
+ " ( ω ) ",
373450
+ ' (")_(") '
373451
+ ],
373452
+ [
373453
+ " ",
373454
+ " /\\_/\\ ",
373455
+ " ( {E} {E}) ",
373456
+ " ( ω ) ",
373457
+ ' (")_(")~ '
373458
+ ],
373459
+ [
373460
+ " ",
373461
+ " /\\-/\\ ",
373462
+ " ( {E} {E}) ",
373463
+ " ( ω ) ",
373464
+ ' (")_(") '
373465
+ ]
373466
+ ],
373467
+ [dragon]: [
373468
+ [
373469
+ " ",
373470
+ " /^\\ /^\\ ",
373471
+ " < {E} {E} > ",
373472
+ " ( ~~ ) ",
373473
+ " `-vvvv-´ "
373474
+ ],
373475
+ [
373476
+ " ",
373477
+ " /^\\ /^\\ ",
373478
+ " < {E} {E} > ",
373479
+ " ( ) ",
373480
+ " `-vvvv-´ "
373481
+ ],
373482
+ [
373483
+ " ~ ~ ",
373484
+ " /^\\ /^\\ ",
373485
+ " < {E} {E} > ",
373486
+ " ( ~~ ) ",
373487
+ " `-vvvv-´ "
373488
+ ]
373489
+ ],
373490
+ [octopus]: [
373491
+ [
373492
+ " ",
373493
+ " .----. ",
373494
+ " ( {E} {E} ) ",
373495
+ " (______) ",
373496
+ " /\\/\\/\\/\\ "
373497
+ ],
373498
+ [
373499
+ " ",
373500
+ " .----. ",
373501
+ " ( {E} {E} ) ",
373502
+ " (______) ",
373503
+ " \\/\\/\\/\\/ "
373504
+ ],
373505
+ [
373506
+ " o ",
373507
+ " .----. ",
373508
+ " ( {E} {E} ) ",
373509
+ " (______) ",
373510
+ " /\\/\\/\\/\\ "
373511
+ ]
373512
+ ],
373513
+ [owl]: [
373514
+ [
373515
+ " ",
373516
+ " /\\ /\\ ",
373517
+ " (({E})({E})) ",
373518
+ " ( >< ) ",
373519
+ " `----´ "
373520
+ ],
373521
+ [
373522
+ " ",
373523
+ " /\\ /\\ ",
373524
+ " (({E})({E})) ",
373525
+ " ( >< ) ",
373526
+ " .----. "
373527
+ ],
373528
+ [
373529
+ " ",
373530
+ " /\\ /\\ ",
373531
+ " (({E})(-)) ",
373532
+ " ( >< ) ",
373533
+ " `----´ "
373534
+ ]
373535
+ ],
373536
+ [penguin]: [
373537
+ [
373538
+ " ",
373539
+ " .---. ",
373540
+ " ({E}>{E}) ",
373541
+ " /( )\\ ",
373542
+ " `---´ "
373543
+ ],
373544
+ [
373545
+ " ",
373546
+ " .---. ",
373547
+ " ({E}>{E}) ",
373548
+ " |( )| ",
373549
+ " `---´ "
373550
+ ],
373551
+ [
373552
+ " .---. ",
373553
+ " ({E}>{E}) ",
373554
+ " /( )\\ ",
373555
+ " `---´ ",
373556
+ " ~ ~ "
373557
+ ]
373558
+ ],
373559
+ [turtle]: [
373560
+ [
373561
+ " ",
373562
+ " _,--._ ",
373563
+ " ( {E} {E} ) ",
373564
+ " /[______]\\ ",
373565
+ " `` `` "
373566
+ ],
373567
+ [
373568
+ " ",
373569
+ " _,--._ ",
373570
+ " ( {E} {E} ) ",
373571
+ " /[______]\\ ",
373572
+ " `` `` "
373573
+ ],
373574
+ [
373575
+ " ",
373576
+ " _,--._ ",
373577
+ " ( {E} {E} ) ",
373578
+ " /[======]\\ ",
373579
+ " `` `` "
373580
+ ]
373581
+ ],
373582
+ [snail]: [
373583
+ [
373584
+ " ",
373585
+ " {E} .--. ",
373586
+ " \\ ( @ ) ",
373587
+ " \\_`--´ ",
373588
+ " ~~~~~~~ "
373589
+ ],
373590
+ [
373591
+ " ",
373592
+ " {E} .--. ",
373593
+ " | ( @ ) ",
373594
+ " \\_`--´ ",
373595
+ " ~~~~~~~ "
373596
+ ],
373597
+ [
373598
+ " ",
373599
+ " {E} .--. ",
373600
+ " \\ ( @ ) ",
373601
+ " \\_`--´ ",
373602
+ " ~~~~~~ "
373603
+ ]
373604
+ ],
373605
+ [ghost]: [
373606
+ [
373607
+ " ",
373608
+ " .----. ",
373609
+ " / {E} {E} \\ ",
373610
+ " | | ",
373611
+ " ~`~``~`~ "
373612
+ ],
373613
+ [
373614
+ " ",
373615
+ " .----. ",
373616
+ " / {E} {E} \\ ",
373617
+ " | | ",
373618
+ " `~`~~`~` "
373619
+ ],
373620
+ [
373621
+ " ~ ~ ",
373622
+ " .----. ",
373623
+ " / {E} {E} \\ ",
373624
+ " | | ",
373625
+ " ~~`~~`~~ "
373626
+ ]
373627
+ ],
373628
+ [axolotl]: [
373629
+ [
373630
+ " ",
373631
+ "}~(______)~{",
373632
+ "}~({E} .. {E})~{",
373633
+ " ( .--. ) ",
373634
+ " (_/ \\_) "
373635
+ ],
373636
+ [
373637
+ " ",
373638
+ "~}(______){~",
373639
+ "~}({E} .. {E}){~",
373640
+ " ( .--. ) ",
373641
+ " (_/ \\_) "
373642
+ ],
373643
+ [
373644
+ " ",
373645
+ "}~(______)~{",
373646
+ "}~({E} .. {E})~{",
373647
+ " ( -- ) ",
373648
+ " ~_/ \\_~ "
373649
+ ]
373650
+ ],
373651
+ [capybara]: [
373652
+ [
373653
+ " ",
373654
+ " n______n ",
373655
+ " ( {E} {E} ) ",
373656
+ " ( oo ) ",
373657
+ " `------´ "
373658
+ ],
373659
+ [
373660
+ " ",
373661
+ " n______n ",
373662
+ " ( {E} {E} ) ",
373663
+ " ( Oo ) ",
373664
+ " `------´ "
373665
+ ],
373666
+ [
373667
+ " ~ ~ ",
373668
+ " u______n ",
373669
+ " ( {E} {E} ) ",
373670
+ " ( oo ) ",
373671
+ " `------´ "
373672
+ ]
373673
+ ],
373674
+ [cactus]: [
373675
+ [
373676
+ " ",
373677
+ " n ____ n ",
373678
+ " | |{E} {E}| | ",
373679
+ " |_| |_| ",
373680
+ " | | "
373681
+ ],
373682
+ [
373683
+ " ",
373684
+ " ____ ",
373685
+ " n |{E} {E}| n ",
373686
+ " |_| |_| ",
373687
+ " | | "
373688
+ ],
373689
+ [
373690
+ " n n ",
373691
+ " | ____ | ",
373692
+ " | |{E} {E}| | ",
373693
+ " |_| |_| ",
373694
+ " | | "
373695
+ ]
373696
+ ],
373697
+ [robot]: [
373698
+ [
373699
+ " ",
373700
+ " .[||]. ",
373701
+ " [ {E} {E} ] ",
373702
+ " [ ==== ] ",
373703
+ " `------´ "
373704
+ ],
373705
+ [
373706
+ " ",
373707
+ " .[||]. ",
373708
+ " [ {E} {E} ] ",
373709
+ " [ -==- ] ",
373710
+ " `------´ "
373711
+ ],
373712
+ [
373713
+ " * ",
373714
+ " .[||]. ",
373715
+ " [ {E} {E} ] ",
373716
+ " [ ==== ] ",
373717
+ " `------´ "
373718
+ ]
373719
+ ],
373720
+ [rabbit]: [
373721
+ [
373722
+ " ",
373723
+ " (\\__/) ",
373724
+ " ( {E} {E} ) ",
373725
+ " =( .. )= ",
373726
+ ' (")__(") '
373727
+ ],
373728
+ [
373729
+ " ",
373730
+ " (|__/) ",
373731
+ " ( {E} {E} ) ",
373732
+ " =( .. )= ",
373733
+ ' (")__(") '
373734
+ ],
373735
+ [
373736
+ " ",
373737
+ " (\\__/) ",
373738
+ " ( {E} {E} ) ",
373739
+ " =( . . )= ",
373740
+ ' (")__(") '
373741
+ ]
373742
+ ],
373743
+ [mushroom]: [
373744
+ [
373745
+ " ",
373746
+ " .-o-OO-o-. ",
373747
+ "(__________)",
373748
+ " |{E} {E}| ",
373749
+ " |____| "
373750
+ ],
373751
+ [
373752
+ " ",
373753
+ " .-O-oo-O-. ",
373754
+ "(__________)",
373755
+ " |{E} {E}| ",
373756
+ " |____| "
373757
+ ],
373758
+ [
373759
+ " . o . ",
373760
+ " .-o-OO-o-. ",
373761
+ "(__________)",
373762
+ " |{E} {E}| ",
373763
+ " |____| "
373764
+ ]
373765
+ ],
373766
+ [chonk]: [
373767
+ [
373768
+ " ",
373769
+ " /\\ /\\ ",
373770
+ " ( {E} {E} ) ",
373771
+ " ( .. ) ",
373772
+ " `------´ "
373773
+ ],
373774
+ [
373775
+ " ",
373776
+ " /\\ /| ",
373777
+ " ( {E} {E} ) ",
373778
+ " ( .. ) ",
373779
+ " `------´ "
373780
+ ],
373781
+ [
373782
+ " ",
373783
+ " /\\ /\\ ",
373784
+ " ( {E} {E} ) ",
373785
+ " ( .. ) ",
373786
+ " `------´~ "
373787
+ ]
373788
+ ]
373789
+ };
373790
+ HAT_LINES = {
373791
+ none: "",
373792
+ crown: " \\^^^/ ",
373793
+ tophat: " [___] ",
373794
+ propeller: " -+- ",
373795
+ halo: " ( ) ",
373796
+ wizard: " /^\\ ",
373797
+ beanie: " (___) ",
373798
+ tinyduck: " ,> "
373799
+ };
373800
+ });
373801
+
373000
373802
  // src/commands/buddy/buddy.tsx
373001
373803
  var exports_buddy = {};
373002
373804
  __export(exports_buddy, {
373003
373805
  call: () => call18
373004
373806
  });
373005
- function getSessionBuddy() {
373006
- if (!sessionBuddy) {
373007
- sessionBuddy = BUDDIES[Math.floor(Math.random() * BUDDIES.length)];
373008
- }
373009
- return sessionBuddy;
373010
- }
373011
373807
  function randomFrom(arr) {
373012
373808
  return arr[Math.floor(Math.random() * arr.length)];
373013
373809
  }
373810
+ function formatSpeciesLabel(species) {
373811
+ return species.charAt(0).toUpperCase() + species.slice(1);
373812
+ }
373813
+ function companionCatchphrase(name, species) {
373814
+ return randomFrom([
373815
+ `${name} the ${species} is ready to keep watch.`,
373816
+ `${name} is perched nearby and paying attention.`,
373817
+ `${name} settles in and starts inspecting the workspace.`
373818
+ ]);
373819
+ }
373820
+ function companionPetComment(name, species) {
373821
+ return randomFrom([
373822
+ `${name} the ${species} peers at the code and suspects one more edge case is worth checking.`,
373823
+ `${name} gives an approving nod, but only after a full lint pass.`,
373824
+ `${name} seems pleased. The posture suggests the current approach is sound.`,
373825
+ `${name} taps the terminal and votes for one more quick verification before shipping.`
373826
+ ]);
373827
+ }
373014
373828
  function BuddyIntro({
373015
- buddy,
373829
+ art,
373830
+ name,
373831
+ species,
373832
+ personality,
373833
+ rarity,
373834
+ created,
373016
373835
  onReady
373017
373836
  }) {
373018
373837
  React57.useEffect(() => {
@@ -373026,7 +373845,7 @@ function BuddyIntro({
373026
373845
  /* @__PURE__ */ jsx_dev_runtime194.jsxDEV(ThemedText, {
373027
373846
  bold: true,
373028
373847
  color: "magenta",
373029
- children: `◆ Your buddy for this session: ${buddy.name} the ${buddy.animal}`
373848
+ children: created ? `◆ Your buddy just hatched: ${name} the ${species}` : `◆ Your buddy: ${name} the ${species}`
373030
373849
  }, undefined, false, undefined, this),
373031
373850
  /* @__PURE__ */ jsx_dev_runtime194.jsxDEV(ThemedBox_default, {
373032
373851
  marginTop: 1,
@@ -373035,7 +373854,7 @@ function BuddyIntro({
373035
373854
  children: [
373036
373855
  /* @__PURE__ */ jsx_dev_runtime194.jsxDEV(ThemedBox_default, {
373037
373856
  flexDirection: "column",
373038
- children: buddy.art.map((line, i2) => /* @__PURE__ */ jsx_dev_runtime194.jsxDEV(ThemedText, {
373857
+ children: art.map((line, i2) => /* @__PURE__ */ jsx_dev_runtime194.jsxDEV(ThemedText, {
373039
373858
  color: "cyan",
373040
373859
  children: line
373041
373860
  }, i2, false, undefined, this))
@@ -373046,11 +373865,15 @@ function BuddyIntro({
373046
373865
  children: [
373047
373866
  /* @__PURE__ */ jsx_dev_runtime194.jsxDEV(ThemedText, {
373048
373867
  dimColor: true,
373049
- children: `Personality: ${buddy.personality}`
373868
+ children: `Personality: ${personality}`
373869
+ }, undefined, false, undefined, this),
373870
+ /* @__PURE__ */ jsx_dev_runtime194.jsxDEV(ThemedText, {
373871
+ dimColor: true,
373872
+ children: `Rarity: ${rarity}`
373050
373873
  }, undefined, false, undefined, this),
373051
373874
  /* @__PURE__ */ jsx_dev_runtime194.jsxDEV(ThemedText, {
373052
373875
  color: "yellow",
373053
- children: `"${buddy.catchphrase}"`
373876
+ children: `"${companionCatchphrase(name, species)}"`
373054
373877
  }, undefined, false, undefined, this),
373055
373878
  /* @__PURE__ */ jsx_dev_runtime194.jsxDEV(ThemedText, {
373056
373879
  dimColor: true,
@@ -373064,7 +373887,9 @@ function BuddyIntro({
373064
373887
  }, undefined, true, undefined, this);
373065
373888
  }
373066
373889
  function BuddyPet({
373067
- buddy,
373890
+ art,
373891
+ name,
373892
+ species,
373068
373893
  comment,
373069
373894
  onReady
373070
373895
  }) {
@@ -373079,7 +373904,7 @@ function BuddyPet({
373079
373904
  /* @__PURE__ */ jsx_dev_runtime194.jsxDEV(ThemedText, {
373080
373905
  bold: true,
373081
373906
  color: "magenta",
373082
- children: `◆ ${buddy.name} the ${buddy.animal} says:`
373907
+ children: `◆ ${name} the ${species} says:`
373083
373908
  }, undefined, false, undefined, this),
373084
373909
  /* @__PURE__ */ jsx_dev_runtime194.jsxDEV(ThemedBox_default, {
373085
373910
  marginTop: 1,
@@ -373088,7 +373913,7 @@ function BuddyPet({
373088
373913
  children: [
373089
373914
  /* @__PURE__ */ jsx_dev_runtime194.jsxDEV(ThemedBox_default, {
373090
373915
  flexDirection: "column",
373091
- children: buddy.art.map((line, i2) => /* @__PURE__ */ jsx_dev_runtime194.jsxDEV(ThemedText, {
373916
+ children: art.map((line, i2) => /* @__PURE__ */ jsx_dev_runtime194.jsxDEV(ThemedText, {
373092
373917
  color: "cyan",
373093
373918
  children: line
373094
373919
  }, i2, false, undefined, this))
@@ -373111,103 +373936,42 @@ function BuddyPet({
373111
373936
  ]
373112
373937
  }, undefined, true, undefined, this);
373113
373938
  }
373114
- var React57, jsx_dev_runtime194, BUDDIES, sessionBuddy = null, call18 = async (onDone, _context, args) => {
373115
- const buddy = getSessionBuddy();
373939
+ var React57, jsx_dev_runtime194, call18 = async (onDone, _context, args) => {
373940
+ const hadCompanion = Boolean(getCompanion());
373941
+ const wasMuted = getGlobalConfig().companionMuted === true;
373942
+ const companion = ensureCompanion({ unmute: true });
373116
373943
  const subcommand = args?.trim().toLowerCase();
373944
+ const species = formatSpeciesLabel(companion.species);
373945
+ const art = renderSprite(companion);
373946
+ const rarity = RARITY_STARS[companion.rarity];
373117
373947
  if (subcommand === "pet") {
373118
- const comment = randomFrom(buddy.petComments);
373948
+ const comment = companionPetComment(companion.name, species);
373119
373949
  return /* @__PURE__ */ jsx_dev_runtime194.jsxDEV(BuddyPet, {
373120
- buddy,
373950
+ art,
373951
+ name: companion.name,
373952
+ species,
373121
373953
  comment,
373122
373954
  onReady: () => onDone(undefined)
373123
373955
  }, undefined, false, undefined, this);
373124
373956
  }
373125
373957
  return /* @__PURE__ */ jsx_dev_runtime194.jsxDEV(BuddyIntro, {
373126
- buddy,
373958
+ art,
373959
+ name: companion.name,
373960
+ species,
373961
+ personality: companion.personality,
373962
+ rarity,
373963
+ created: !hadCompanion || wasMuted,
373127
373964
  onReady: () => onDone(undefined)
373128
373965
  }, undefined, false, undefined, this);
373129
373966
  };
373130
373967
  var init_buddy = __esm(() => {
373131
373968
  init_ink2();
373969
+ init_companion();
373970
+ init_types3();
373971
+ init_sprites();
373972
+ init_config();
373132
373973
  React57 = __toESM(require_react(), 1);
373133
373974
  jsx_dev_runtime194 = __toESM(require_jsx_dev_runtime(), 1);
373134
- BUDDIES = [
373135
- {
373136
- name: "Pippa",
373137
- animal: "Cat",
373138
- art: [
373139
- " /\\_/\\ ",
373140
- "( o.o ) ",
373141
- " > ^ < "
373142
- ],
373143
- personality: "curious and methodical",
373144
- catchphrase: "Purring along…",
373145
- petComments: [
373146
- "Mrow! The code smells a little ripe — want me to help refactor?",
373147
- "*stretches* Looking good so far. I spotted one suspicious import though.",
373148
- "Purr… things are mostly tidy. Keep that test coverage up!",
373149
- "*blinks slowly* I like how the types are named. Very descriptive.",
373150
- "Mrrrow! Did you remember to handle the error case?"
373151
- ]
373152
- },
373153
- {
373154
- name: "Biscuit",
373155
- animal: "Dog",
373156
- art: [
373157
- " / \\__ ",
373158
- " ( @\\___",
373159
- " / O",
373160
- "/ (_____/ ",
373161
- "/_____/ "
373162
- ],
373163
- personality: "enthusiastic and loyal",
373164
- catchphrase: "Woof woof! Lets ship it!",
373165
- petComments: [
373166
- "WOOF! I love this codebase! Have you run the tests yet? Have you?!",
373167
- "*tail wagging* Looks great! Maybe add one more comment here?",
373168
- "Good code, good code! Can we refactor this function? Can we?!",
373169
- "*happy barking* The build passed! BEST DAY EVER!",
373170
- "Sniff sniff… I detect a potential off-by-one error. Just saying!"
373171
- ]
373172
- },
373173
- {
373174
- name: "Wobbler",
373175
- animal: "Duck",
373176
- art: [
373177
- " __ ",
373178
- ">'/ oo\\",
373179
- " \\ ~~/ ",
373180
- " njmj "
373181
- ],
373182
- personality: "calm and philosophical",
373183
- catchphrase: "Quack. All is proceeding as expected.",
373184
- petComments: [
373185
- "Quack. The abstraction is sound. Though I wonder if the interface could be simpler.",
373186
- "*waddles thoughtfully* Have you considered the edge cases in that parser?",
373187
- "Quack quack. Good variable names. The duck approves.",
373188
- "*tilts head* This function is doing two things. The duck prefers single responsibility.",
373189
- "Quack. Ship it. We can refactor in the next iteration."
373190
- ]
373191
- },
373192
- {
373193
- name: "Ziggy",
373194
- animal: "Hamster",
373195
- art: [
373196
- " (\\(\\ ",
373197
- " ( -.-)/",
373198
- ' c(")(")'
373199
- ],
373200
- personality: "hyperactive and detail-oriented",
373201
- catchphrase: "*zooms in wheel* ON IT!",
373202
- petComments: [
373203
- "*squeaks* I counted 47 lines in that function — maybe split it?",
373204
- "Ooh ooh ooh! You forgot a semicolon! Wait, TypeScript. Never mind.",
373205
- "*running very fast* The bundle size looks good! Keep it lean!",
373206
- "Squeak! I saw a TODO comment from 2023. Should we address it?",
373207
- "*spins wheel nervously* Dependencies look a little heavy. Just noting!"
373208
- ]
373209
- }
373210
- ];
373211
373975
  });
373212
373976
 
373213
373977
  // src/commands/buddy/index.ts
@@ -375308,6 +376072,13 @@ var React58, jsx_dev_runtime195, sessionRound = 0, sessionFocus = "", DEFAULT_MA
375308
376072
  const { extractChain: extractChain2, validateCommandChain: validateCommandChain2, parseCommandChain: parseCommandChain2, chainWarning: chainWarning2 } = await Promise.resolve().then(() => (init_commandChaining(), exports_commandChaining));
375309
376073
  const { ownArgs: chainedArgs, nextCmd: _nextCmdFromChain } = extractChain2(rawArgs);
375310
376074
  const { maxRounds, focus } = parseMaxRounds(chainedArgs);
376075
+ if (sessionRound === 0 && !focus) {
376076
+ onDone("What should I keep going on?", {
376077
+ display: "system",
376078
+ nextInput: "/keepgoing "
376079
+ });
376080
+ return null;
376081
+ }
375311
376082
  if (sessionRound === 0 || focus && focus !== sessionFocus) {
375312
376083
  resetSession(focus);
375313
376084
  }
@@ -375432,7 +376203,7 @@ var init_keepgoing2 = __esm(() => {
375432
376203
  type: "local-jsx",
375433
376204
  name: "keepgoing",
375434
376205
  aliases: ["kg", "continue"],
375435
- description: "Continue working autonomously until the task is complete or you intervene (Ctrl+C)",
376206
+ description: "Continue autonomously until the task is done",
375436
376207
  load: () => Promise.resolve().then(() => (init_keepgoing(), exports_keepgoing))
375437
376208
  };
375438
376209
  keepgoing_default = keepgoing;
@@ -381913,7 +382684,7 @@ var init_windows_setup2 = __esm(() => {
381913
382684
  import { createServer as createServer6 } from "http";
381914
382685
  import { readFile as readFile53, writeFile as writeFile45, mkdir as mkdir43, readdir as readdir31, stat as stat46 } from "fs/promises";
381915
382686
  import { spawn as spawn12 } from "child_process";
381916
- import { join as join125, resolve as resolvePath, relative as relative24 } from "path";
382687
+ import { join as join125, resolve as resolvePath, relative as relative23 } from "path";
381917
382688
  async function handleRead(p) {
381918
382689
  try {
381919
382690
  const raw = await readFile53(p.path, "utf-8");
@@ -382040,7 +382811,7 @@ async function handleGlob(p) {
382040
382811
  const re2 = globToRegex(p.pattern);
382041
382812
  const all4 = [];
382042
382813
  await walk(cwd2, all4, 1e4);
382043
- const matches = all4.map((f) => relative24(cwd2, f).replace(/\\/g, "/")).filter((f) => re2.test(f));
382814
+ const matches = all4.map((f) => relative23(cwd2, f).replace(/\\/g, "/")).filter((f) => re2.test(f));
382044
382815
  return { ok: true, data: matches };
382045
382816
  } catch (e) {
382046
382817
  return { ok: false, error: String(e) };
@@ -382058,7 +382829,7 @@ async function handleGrep(p) {
382058
382829
  for (const f of files) {
382059
382830
  if (out.length >= max2)
382060
382831
  break;
382061
- if (globRe && !globRe.test(relative24(root2, f).replace(/\\/g, "/")))
382832
+ if (globRe && !globRe.test(relative23(root2, f).replace(/\\/g, "/")))
382062
382833
  continue;
382063
382834
  let content;
382064
382835
  try {
@@ -383529,12 +384300,12 @@ var init_MemoryFileSelector = __esm(() => {
383529
384300
 
383530
384301
  // src/components/memory/MemoryUpdateNotification.tsx
383531
384302
  import { homedir as homedir30 } from "os";
383532
- import { relative as relative25 } from "path";
384303
+ import { relative as relative24 } from "path";
383533
384304
  function getRelativeMemoryPath(path12) {
383534
384305
  const homeDir = homedir30();
383535
384306
  const cwd2 = getCwd();
383536
384307
  const relativeToHome = path12.startsWith(homeDir) ? "~" + path12.slice(homeDir.length) : null;
383537
- const relativeToCwd = path12.startsWith(cwd2) ? "./" + relative25(cwd2, path12) : null;
384308
+ const relativeToCwd = path12.startsWith(cwd2) ? "./" + relative24(cwd2, path12) : null;
383538
384309
  if (relativeToHome && relativeToCwd) {
383539
384310
  return relativeToHome.length <= relativeToCwd.length ? relativeToHome : relativeToCwd;
383540
384311
  }
@@ -384712,7 +385483,7 @@ function Help(t0) {
384712
385483
  let t6;
384713
385484
  if ($2[31] !== tabs) {
384714
385485
  t6 = /* @__PURE__ */ jsx_dev_runtime235.jsxDEV(Tabs, {
384715
- title: `localclawd v${"1.7.0"}`,
385486
+ title: `localclawd v${"1.7.1"}`,
384716
385487
  color: "professionalBlue",
384717
385488
  defaultTab: "general",
384718
385489
  children: tabs
@@ -401974,7 +402745,7 @@ function getRecentReleaseNotes(currentVersion, previousVersion, changelogContent
401974
402745
  }
401975
402746
  return [];
401976
402747
  }
401977
- async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.7.0") {
402748
+ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.7.1") {
401978
402749
  if (process.env.USER_TYPE === "ant") {
401979
402750
  const changelog = MACRO.VERSION_CHANGELOG;
401980
402751
  if (changelog) {
@@ -402001,7 +402772,7 @@ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.7.0") {
402001
402772
  releaseNotes
402002
402773
  };
402003
402774
  }
402004
- function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.7.0") {
402775
+ function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.7.1") {
402005
402776
  if (process.env.USER_TYPE === "ant") {
402006
402777
  const changelog = MACRO.VERSION_CHANGELOG;
402007
402778
  if (changelog) {
@@ -402158,7 +402929,7 @@ function getRecentActivitySync() {
402158
402929
  return cachedActivity;
402159
402930
  }
402160
402931
  function getLogoDisplayData() {
402161
- const version = process.env.DEMO_VERSION ?? "1.7.0";
402932
+ const version = process.env.DEMO_VERSION ?? "1.7.1";
402162
402933
  const serverUrl = getDirectConnectServerUrl();
402163
402934
  const displayPath = process.env.DEMO_VERSION ? "/code/claude" : getDisplayPath(getCwd());
402164
402935
  const cwd2 = serverUrl ? `${displayPath} in ${serverUrl.replace(/^https?:\/\//, "")}` : displayPath;
@@ -403258,7 +404029,7 @@ function Logo() {
403258
404029
  if ($2[2] === Symbol.for("react.memo_cache_sentinel")) {
403259
404030
  t2 = () => {
403260
404031
  const currentConfig = getGlobalConfig();
403261
- if (currentConfig.lastReleaseNotesSeen === "1.7.0") {
404032
+ if (currentConfig.lastReleaseNotesSeen === "1.7.1") {
403262
404033
  return;
403263
404034
  }
403264
404035
  saveGlobalConfig(_temp326);
@@ -403917,12 +404688,12 @@ function Logo() {
403917
404688
  return t41;
403918
404689
  }
403919
404690
  function _temp326(current) {
403920
- if (current.lastReleaseNotesSeen === "1.7.0") {
404691
+ if (current.lastReleaseNotesSeen === "1.7.1") {
403921
404692
  return current;
403922
404693
  }
403923
404694
  return {
403924
404695
  ...current,
403925
- lastReleaseNotesSeen: "1.7.0"
404696
+ lastReleaseNotesSeen: "1.7.1"
403926
404697
  };
403927
404698
  }
403928
404699
  function _temp241(s_0) {
@@ -404478,7 +405249,7 @@ var init_nullRenderingAttachments = __esm(() => {
404478
405249
  });
404479
405250
 
404480
405251
  // src/utils/statusNoticeDefinitions.tsx
404481
- import { relative as relative26 } from "path";
405252
+ import { relative as relative25 } from "path";
404482
405253
  function getActiveNotices(context7) {
404483
405254
  return statusNoticeDefinitions.filter((notice) => notice.isActive(context7));
404484
405255
  }
@@ -404502,7 +405273,7 @@ var init_statusNoticeDefinitions = __esm(() => {
404502
405273
  const largeMemoryFiles = getLargeMemoryFiles(ctx2.memoryFiles);
404503
405274
  return /* @__PURE__ */ jsx_dev_runtime277.jsxDEV(jsx_dev_runtime277.Fragment, {
404504
405275
  children: largeMemoryFiles.map((file) => {
404505
- const displayPath = file.path.startsWith(getCwd()) ? relative26(getCwd(), file.path) : file.path;
405276
+ const displayPath = file.path.startsWith(getCwd()) ? relative25(getCwd(), file.path) : file.path;
404506
405277
  return /* @__PURE__ */ jsx_dev_runtime277.jsxDEV(ThemedBox_default, {
404507
405278
  flexDirection: "row",
404508
405279
  children: [
@@ -427881,13 +428652,13 @@ var exports_files2 = {};
427881
428652
  __export(exports_files2, {
427882
428653
  call: () => call77
427883
428654
  });
427884
- import { relative as relative27 } from "path";
428655
+ import { relative as relative26 } from "path";
427885
428656
  async function call77(_args, context7) {
427886
428657
  const files = context7.readFileState ? cacheKeys(context7.readFileState) : [];
427887
428658
  if (files.length === 0) {
427888
428659
  return { type: "text", value: "No files in context" };
427889
428660
  }
427890
- const fileList = files.map((file) => relative27(getCwd(), file)).join(`
428661
+ const fileList = files.map((file) => relative26(getCwd(), file)).join(`
427891
428662
  `);
427892
428663
  return { type: "text", value: `Files in context:
427893
428664
  ${fileList}` };
@@ -434401,7 +435172,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
434401
435172
  smapsRollup,
434402
435173
  platform: process.platform,
434403
435174
  nodeVersion: process.version,
434404
- ccVersion: "1.7.0"
435175
+ ccVersion: "1.7.1"
434405
435176
  };
434406
435177
  }
434407
435178
  async function performHeapDump(trigger = "manual", dumpNumber = 0) {
@@ -434986,7 +435757,7 @@ var init_bridge_kick = __esm(() => {
434986
435757
  var call85 = async () => {
434987
435758
  return {
434988
435759
  type: "text",
434989
- value: `${"1.7.0"} (built ${"2026-04-26T17:37:22.796Z"})`
435760
+ value: `${"1.7.1"} (built ${"2026-05-05T20:42:20.896Z"})`
434990
435761
  };
434991
435762
  }, version, version_default;
434992
435763
  var init_version = __esm(() => {
@@ -436154,7 +436925,7 @@ var exports_sandbox_toggle = {};
436154
436925
  __export(exports_sandbox_toggle, {
436155
436926
  call: () => call86
436156
436927
  });
436157
- import { relative as relative28 } from "path";
436928
+ import { relative as relative27 } from "path";
436158
436929
  async function call86(onDone, _context, args) {
436159
436930
  const settings = getSettings_DEPRECATED();
436160
436931
  const themeName = settings.theme || "light";
@@ -436196,7 +436967,7 @@ async function call86(onDone, _context, args) {
436196
436967
  const cleanPattern = commandPattern.replace(/^["']|["']$/g, "");
436197
436968
  addToExcludedCommands(cleanPattern);
436198
436969
  const localSettingsPath = getSettingsFilePathForSource("localSettings");
436199
- const relativePath = localSettingsPath ? relative28(getCwdState(), localSettingsPath) : ".claude/settings.local.json";
436970
+ const relativePath = localSettingsPath ? relative27(getCwdState(), localSettingsPath) : ".claude/settings.local.json";
436200
436971
  const message = color("success", themeName)(`Added "${cleanPattern}" to excluded commands in ${relativePath}`);
436201
436972
  onDone(message);
436202
436973
  return null;
@@ -442930,7 +443701,7 @@ function generateHtmlReport(data, insights) {
442930
443701
  </html>`;
442931
443702
  }
442932
443703
  function buildExportData(data, insights, facets, remoteStats) {
442933
- const version2 = typeof MACRO !== "undefined" ? "1.7.0" : "unknown";
443704
+ const version2 = typeof MACRO !== "undefined" ? "1.7.1" : "unknown";
442934
443705
  const remote_hosts_collected = remoteStats?.hosts.filter((h) => h.sessionCount > 0).map((h) => h.name);
442935
443706
  const facets_summary = {
442936
443707
  total: facets.size,
@@ -447127,7 +447898,7 @@ var init_sessionStorage = __esm(() => {
447127
447898
  init_settings2();
447128
447899
  init_slowOperations();
447129
447900
  init_uuid();
447130
- VERSION6 = typeof MACRO !== "undefined" ? "1.7.0" : "unknown";
447901
+ VERSION6 = typeof MACRO !== "undefined" ? "1.7.1" : "unknown";
447131
447902
  MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
447132
447903
  SKIP_FIRST_PROMPT_PATTERN = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
447133
447904
  EPHEMERAL_PROGRESS_TYPES = new Set([
@@ -447383,13 +448154,13 @@ function getLocalAgentMemoryDir(dirName) {
447383
448154
  if (process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR) {
447384
448155
  return join146(process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR, "projects", sanitizePath2(findCanonicalGitRoot(getProjectRoot()) ?? getProjectRoot()), "agent-memory-local", dirName) + sep31;
447385
448156
  }
447386
- return join146(getCwd(), ".claude", "agent-memory-local", dirName) + sep31;
448157
+ return join146(getProjectMemoryBaseDir(), "agent-memory-local", dirName) + sep31;
447387
448158
  }
447388
448159
  function getAgentMemoryDir(agentType, scope) {
447389
448160
  const dirName = sanitizeAgentTypeForPath(agentType);
447390
448161
  switch (scope) {
447391
448162
  case "project":
447392
- return join146(getCwd(), ".claude", "agent-memory", dirName) + sep31;
448163
+ return join146(getProjectMemoryBaseDir(), "agent-memory", dirName) + sep31;
447393
448164
  case "local":
447394
448165
  return getLocalAgentMemoryDir(dirName);
447395
448166
  case "user":
@@ -447402,14 +448173,14 @@ function isAgentMemoryPath(absolutePath) {
447402
448173
  if (normalizedPath.startsWith(join146(memoryBase, "agent-memory") + sep31)) {
447403
448174
  return true;
447404
448175
  }
447405
- if (normalizedPath.startsWith(join146(getCwd(), ".claude", "agent-memory") + sep31)) {
448176
+ if (normalizedPath.startsWith(join146(getProjectMemoryBaseDir(), "agent-memory") + sep31)) {
447406
448177
  return true;
447407
448178
  }
447408
448179
  if (process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR) {
447409
448180
  if (normalizedPath.includes(sep31 + "agent-memory-local" + sep31) && normalizedPath.startsWith(join146(process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR, "projects") + sep31)) {
447410
448181
  return true;
447411
448182
  }
447412
- } else if (normalizedPath.startsWith(join146(getCwd(), ".claude", "agent-memory-local") + sep31)) {
448183
+ } else if (normalizedPath.startsWith(join146(getProjectMemoryBaseDir(), "agent-memory-local") + sep31)) {
447413
448184
  return true;
447414
448185
  }
447415
448186
  return false;
@@ -447419,7 +448190,7 @@ function getMemoryScopeDisplay(memory2) {
447419
448190
  case "user":
447420
448191
  return `User (${join146(getMemoryBaseDir(), "agent-memory")}/)`;
447421
448192
  case "project":
447422
- return "Project (.claude/agent-memory/)";
448193
+ return "Project (.localclawd/agent-memory/)";
447423
448194
  case "local":
447424
448195
  return `Local (${getLocalAgentMemoryDir("...")})`;
447425
448196
  default:
@@ -447452,7 +448223,6 @@ var init_agentMemory = __esm(() => {
447452
448223
  init_state();
447453
448224
  init_memdir();
447454
448225
  init_paths();
447455
- init_cwd();
447456
448226
  init_git();
447457
448227
  init_path2();
447458
448228
  });
@@ -447693,14 +448463,14 @@ function pathInWorkingPath(path15, workingPath) {
447693
448463
  const normalizedWorkingPath = absoluteWorkingPath.replace(/^\/private\/var\//, "/var/").replace(/^\/private\/tmp(\/|$)/, "/tmp$1");
447694
448464
  const caseNormalizedPath = normalizeCaseForComparison(normalizedPath);
447695
448465
  const caseNormalizedWorkingPath = normalizeCaseForComparison(normalizedWorkingPath);
447696
- const relative29 = relativePath(caseNormalizedWorkingPath, caseNormalizedPath);
447697
- if (relative29 === "") {
448466
+ const relative28 = relativePath(caseNormalizedWorkingPath, caseNormalizedPath);
448467
+ if (relative28 === "") {
447698
448468
  return true;
447699
448469
  }
447700
- if (containsPathTraversal(relative29)) {
448470
+ if (containsPathTraversal(relative28)) {
447701
448471
  return false;
447702
448472
  }
447703
- return !posix8.isAbsolute(relative29);
448473
+ return !posix8.isAbsolute(relative28);
447704
448474
  }
447705
448475
  function rootPathForSource(source) {
447706
448476
  switch (source) {
@@ -448329,7 +449099,7 @@ var init_filesystem = __esm(() => {
448329
449099
  });
448330
449100
  getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
448331
449101
  const nonce = randomBytes20(16).toString("hex");
448332
- return join147(getClaudeTempDir(), "bundled-skills", "1.7.0", nonce);
449102
+ return join147(getClaudeTempDir(), "bundled-skills", "1.7.1", nonce);
448333
449103
  });
448334
449104
  getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
448335
449105
  });
@@ -455545,9 +456315,9 @@ var require_extra_typings = __commonJS((exports, module) => {
455545
456315
  });
455546
456316
 
455547
456317
  // node_modules/@commander-js/extra-typings/esm.mjs
455548
- var import__2, program, createCommand, createArgument, createOption, CommanderError, InvalidArgumentError, InvalidOptionArgumentError, Command, Argument, Option, Help2;
456318
+ var import__3, program, createCommand, createArgument, createOption, CommanderError, InvalidArgumentError, InvalidOptionArgumentError, Command, Argument, Option, Help2;
455549
456319
  var init_esm3 = __esm(() => {
455550
- import__2 = __toESM(require_extra_typings(), 1);
456320
+ import__3 = __toESM(require_extra_typings(), 1);
455551
456321
  ({
455552
456322
  program,
455553
456323
  createCommand,
@@ -455560,7 +456330,7 @@ var init_esm3 = __esm(() => {
455560
456330
  Argument,
455561
456331
  Option,
455562
456332
  Help: Help2
455563
- } = import__2.default);
456333
+ } = import__3.default);
455564
456334
  });
455565
456335
 
455566
456336
  // src/utils/apiPreconnect.ts
@@ -456700,54 +457470,6 @@ var init_stats4 = __esm(() => {
456700
457470
  StatsContext = import_react182.createContext(null);
456701
457471
  });
456702
457472
 
456703
- // src/utils/sessionState.ts
456704
- function setSessionStateChangedListener(cb) {
456705
- stateListener = cb;
456706
- }
456707
- function setSessionMetadataChangedListener(cb) {
456708
- metadataListener = cb;
456709
- }
456710
- function setPermissionModeChangedListener(cb) {
456711
- permissionModeListener = cb;
456712
- }
456713
- function getSessionState() {
456714
- return currentState;
456715
- }
456716
- function notifySessionStateChanged(state2, details) {
456717
- currentState = state2;
456718
- stateListener?.(state2, details);
456719
- if (state2 === "requires_action" && details) {
456720
- hasPendingAction = true;
456721
- metadataListener?.({
456722
- pending_action: details
456723
- });
456724
- } else if (hasPendingAction) {
456725
- hasPendingAction = false;
456726
- metadataListener?.({ pending_action: null });
456727
- }
456728
- if (state2 === "idle") {
456729
- metadataListener?.({ task_summary: null });
456730
- }
456731
- if (isEnvTruthy(process.env.CLAUDE_CODE_EMIT_SESSION_STATE_EVENTS)) {
456732
- enqueueSdkEvent({
456733
- type: "system",
456734
- subtype: "session_state_changed",
456735
- state: state2
456736
- });
456737
- }
456738
- }
456739
- function notifySessionMetadataChanged(metadata) {
456740
- metadataListener?.(metadata);
456741
- }
456742
- function notifyPermissionModeChanged(mode) {
456743
- permissionModeListener?.(mode);
456744
- }
456745
- var stateListener = null, metadataListener = null, permissionModeListener = null, hasPendingAction = false, currentState = "idle";
456746
- var init_sessionState = __esm(() => {
456747
- init_envUtils();
456748
- init_sdkEventQueue();
456749
- });
456750
-
456751
457473
  // src/state/onChangeAppState.ts
456752
457474
  function externalMetadataToAppState(metadata) {
456753
457475
  return (prev) => ({
@@ -457614,7 +458336,7 @@ function buildSystemInitMessage(inputs) {
457614
458336
  slash_commands: inputs.commands.filter((c5) => c5.userInvocable !== false).map((c5) => c5.name),
457615
458337
  apiKeySource: getAnthropicApiKeyWithSource().source,
457616
458338
  betas: getSdkBetas(),
457617
- claude_code_version: "1.7.0",
458339
+ claude_code_version: "1.7.1",
457618
458340
  output_style: outputStyle2,
457619
458341
  agents: inputs.agents.map((agent) => agent.agentType),
457620
458342
  skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill) => skill.name),
@@ -463756,7 +464478,7 @@ var init_useDiffInIDE = __esm(() => {
463756
464478
  });
463757
464479
 
463758
464480
  // src/components/ShowInIDEPrompt.tsx
463759
- import { basename as basename46, relative as relative29 } from "path";
464481
+ import { basename as basename46, relative as relative28 } from "path";
463760
464482
  function ShowInIDEPrompt(t0) {
463761
464483
  const $2 = c3(36);
463762
464484
  const {
@@ -463794,7 +464516,7 @@ function ShowInIDEPrompt(t0) {
463794
464516
  if ($2[2] !== symlinkTarget) {
463795
464517
  t2 = symlinkTarget && /* @__PURE__ */ jsx_dev_runtime394.jsxDEV(ThemedText, {
463796
464518
  color: "warning",
463797
- children: relative29(getCwd(), symlinkTarget).startsWith("..") ? `This will modify ${symlinkTarget} (outside working directory) via a symlink` : `Symlink target: ${symlinkTarget}`
464519
+ children: relative28(getCwd(), symlinkTarget).startsWith("..") ? `This will modify ${symlinkTarget} (outside working directory) via a symlink` : `Symlink target: ${symlinkTarget}`
463798
464520
  }, undefined, false, undefined, this);
463799
464521
  $2[2] = symlinkTarget;
463800
464522
  $2[3] = t2;
@@ -464358,7 +465080,7 @@ var init_useFilePermissionDialog = __esm(() => {
464358
465080
  });
464359
465081
 
464360
465082
  // src/components/permissions/FilePermissionDialog/FilePermissionDialog.tsx
464361
- import { relative as relative30 } from "path";
465083
+ import { relative as relative29 } from "path";
464362
465084
  function FilePermissionDialog({
464363
465085
  toolUseConfirm,
464364
465086
  toolUseContext,
@@ -464465,7 +465187,7 @@ function FilePermissionDialog({
464465
465187
  noInputMode
464466
465188
  }, undefined, false, undefined, this);
464467
465189
  }
464468
- const isSymlinkOutsideCwd = symlinkTarget != null && relative30(getCwd(), symlinkTarget).startsWith("..");
465190
+ const isSymlinkOutsideCwd = symlinkTarget != null && relative29(getCwd(), symlinkTarget).startsWith("..");
464469
465191
  const symlinkWarning = symlinkTarget ? /* @__PURE__ */ jsx_dev_runtime396.jsxDEV(ThemedBox_default, {
464470
465192
  paddingX: 1,
464471
465193
  marginBottom: 1,
@@ -464552,7 +465274,7 @@ var init_FilePermissionDialog = __esm(() => {
464552
465274
  });
464553
465275
 
464554
465276
  // src/components/permissions/SedEditPermissionRequest/SedEditPermissionRequest.tsx
464555
- import { basename as basename48, relative as relative31 } from "path";
465277
+ import { basename as basename48, relative as relative30 } from "path";
464556
465278
  function SedEditPermissionRequest(t0) {
464557
465279
  const $2 = c3(9);
464558
465280
  let props;
@@ -464720,7 +465442,7 @@ function SedEditPermissionRequestInner(t0) {
464720
465442
  const t8 = props.onReject;
464721
465443
  let t9;
464722
465444
  if ($2[14] !== filePath) {
464723
- t9 = relative31(getCwd(), filePath);
465445
+ t9 = relative30(getCwd(), filePath);
464724
465446
  $2[14] = filePath;
464725
465447
  $2[15] = t9;
464726
465448
  } else {
@@ -467310,7 +468032,7 @@ function createSingleEditDiffConfig(filePath, oldString, newString, replaceAll)
467310
468032
  }
467311
468033
 
467312
468034
  // src/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.tsx
467313
- import { basename as basename50, relative as relative32 } from "path";
468035
+ import { basename as basename50, relative as relative31 } from "path";
467314
468036
  function FileEditPermissionRequest(props) {
467315
468037
  const $2 = c3(51);
467316
468038
  const parseInput = _temp171;
@@ -467347,7 +468069,7 @@ function FileEditPermissionRequest(props) {
467347
468069
  t7 = props.onReject;
467348
468070
  t8 = props.workerBadge;
467349
468071
  t9 = "Edit file";
467350
- t10 = relative32(getCwd(), file_path);
468072
+ t10 = relative31(getCwd(), file_path);
467351
468073
  T1 = ThemedText;
467352
468074
  t2 = "Do you want to make this edit to";
467353
468075
  t3 = " ";
@@ -467777,7 +468499,7 @@ var init_FileWriteToolDiff = __esm(() => {
467777
468499
  });
467778
468500
 
467779
468501
  // src/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.tsx
467780
- import { basename as basename51, relative as relative33 } from "path";
468502
+ import { basename as basename51, relative as relative32 } from "path";
467781
468503
  function FileWritePermissionRequest(props) {
467782
468504
  const $2 = c3(30);
467783
468505
  const parseInput = _temp176;
@@ -467836,7 +468558,7 @@ function FileWritePermissionRequest(props) {
467836
468558
  const t7 = fileExists ? "Overwrite file" : "Create file";
467837
468559
  let t8;
467838
468560
  if ($2[5] !== file_path) {
467839
- t8 = relative33(getCwd(), file_path);
468561
+ t8 = relative32(getCwd(), file_path);
467840
468562
  $2[5] = file_path;
467841
468563
  $2[6] = t8;
467842
468564
  } else {
@@ -467966,7 +468688,7 @@ var init_FileWritePermissionRequest = __esm(() => {
467966
468688
  });
467967
468689
 
467968
468690
  // src/components/permissions/NotebookEditPermissionRequest/NotebookEditToolDiff.tsx
467969
- import { relative as relative34 } from "path";
468691
+ import { relative as relative33 } from "path";
467970
468692
  function NotebookEditToolDiff(props) {
467971
468693
  const $2 = c3(5);
467972
468694
  let t0;
@@ -468109,7 +468831,7 @@ function NotebookEditToolDiffInner(t0) {
468109
468831
  }
468110
468832
  let t4;
468111
468833
  if ($2[11] !== notebook_path || $2[12] !== verbose) {
468112
- t4 = verbose ? notebook_path : relative34(getCwd(), notebook_path);
468834
+ t4 = verbose ? notebook_path : relative33(getCwd(), notebook_path);
468113
468835
  $2[11] = notebook_path;
468114
468836
  $2[12] = verbose;
468115
468837
  $2[13] = t4;
@@ -471610,428 +472332,6 @@ var init_useIdeAtMentioned = __esm(() => {
471610
472332
  }));
471611
472333
  });
471612
472334
 
471613
- // src/buddy/sprites.ts
471614
- var BODIES;
471615
- var init_sprites = __esm(() => {
471616
- init_types3();
471617
- BODIES = {
471618
- [duck]: [
471619
- [
471620
- " ",
471621
- " __ ",
471622
- " <({E} )___ ",
471623
- " ( ._> ",
471624
- " `--´ "
471625
- ],
471626
- [
471627
- " ",
471628
- " __ ",
471629
- " <({E} )___ ",
471630
- " ( ._> ",
471631
- " `--´~ "
471632
- ],
471633
- [
471634
- " ",
471635
- " __ ",
471636
- " <({E} )___ ",
471637
- " ( .__> ",
471638
- " `--´ "
471639
- ]
471640
- ],
471641
- [goose]: [
471642
- [
471643
- " ",
471644
- " ({E}> ",
471645
- " || ",
471646
- " _(__)_ ",
471647
- " ^^^^ "
471648
- ],
471649
- [
471650
- " ",
471651
- " ({E}> ",
471652
- " || ",
471653
- " _(__)_ ",
471654
- " ^^^^ "
471655
- ],
471656
- [
471657
- " ",
471658
- " ({E}>> ",
471659
- " || ",
471660
- " _(__)_ ",
471661
- " ^^^^ "
471662
- ]
471663
- ],
471664
- [blob]: [
471665
- [
471666
- " ",
471667
- " .----. ",
471668
- " ( {E} {E} ) ",
471669
- " ( ) ",
471670
- " `----´ "
471671
- ],
471672
- [
471673
- " ",
471674
- " .------. ",
471675
- " ( {E} {E} ) ",
471676
- " ( ) ",
471677
- " `------´ "
471678
- ],
471679
- [
471680
- " ",
471681
- " .--. ",
471682
- " ({E} {E}) ",
471683
- " ( ) ",
471684
- " `--´ "
471685
- ]
471686
- ],
471687
- [cat]: [
471688
- [
471689
- " ",
471690
- " /\\_/\\ ",
471691
- " ( {E} {E}) ",
471692
- " ( ω ) ",
471693
- ' (")_(") '
471694
- ],
471695
- [
471696
- " ",
471697
- " /\\_/\\ ",
471698
- " ( {E} {E}) ",
471699
- " ( ω ) ",
471700
- ' (")_(")~ '
471701
- ],
471702
- [
471703
- " ",
471704
- " /\\-/\\ ",
471705
- " ( {E} {E}) ",
471706
- " ( ω ) ",
471707
- ' (")_(") '
471708
- ]
471709
- ],
471710
- [dragon]: [
471711
- [
471712
- " ",
471713
- " /^\\ /^\\ ",
471714
- " < {E} {E} > ",
471715
- " ( ~~ ) ",
471716
- " `-vvvv-´ "
471717
- ],
471718
- [
471719
- " ",
471720
- " /^\\ /^\\ ",
471721
- " < {E} {E} > ",
471722
- " ( ) ",
471723
- " `-vvvv-´ "
471724
- ],
471725
- [
471726
- " ~ ~ ",
471727
- " /^\\ /^\\ ",
471728
- " < {E} {E} > ",
471729
- " ( ~~ ) ",
471730
- " `-vvvv-´ "
471731
- ]
471732
- ],
471733
- [octopus]: [
471734
- [
471735
- " ",
471736
- " .----. ",
471737
- " ( {E} {E} ) ",
471738
- " (______) ",
471739
- " /\\/\\/\\/\\ "
471740
- ],
471741
- [
471742
- " ",
471743
- " .----. ",
471744
- " ( {E} {E} ) ",
471745
- " (______) ",
471746
- " \\/\\/\\/\\/ "
471747
- ],
471748
- [
471749
- " o ",
471750
- " .----. ",
471751
- " ( {E} {E} ) ",
471752
- " (______) ",
471753
- " /\\/\\/\\/\\ "
471754
- ]
471755
- ],
471756
- [owl]: [
471757
- [
471758
- " ",
471759
- " /\\ /\\ ",
471760
- " (({E})({E})) ",
471761
- " ( >< ) ",
471762
- " `----´ "
471763
- ],
471764
- [
471765
- " ",
471766
- " /\\ /\\ ",
471767
- " (({E})({E})) ",
471768
- " ( >< ) ",
471769
- " .----. "
471770
- ],
471771
- [
471772
- " ",
471773
- " /\\ /\\ ",
471774
- " (({E})(-)) ",
471775
- " ( >< ) ",
471776
- " `----´ "
471777
- ]
471778
- ],
471779
- [penguin]: [
471780
- [
471781
- " ",
471782
- " .---. ",
471783
- " ({E}>{E}) ",
471784
- " /( )\\ ",
471785
- " `---´ "
471786
- ],
471787
- [
471788
- " ",
471789
- " .---. ",
471790
- " ({E}>{E}) ",
471791
- " |( )| ",
471792
- " `---´ "
471793
- ],
471794
- [
471795
- " .---. ",
471796
- " ({E}>{E}) ",
471797
- " /( )\\ ",
471798
- " `---´ ",
471799
- " ~ ~ "
471800
- ]
471801
- ],
471802
- [turtle]: [
471803
- [
471804
- " ",
471805
- " _,--._ ",
471806
- " ( {E} {E} ) ",
471807
- " /[______]\\ ",
471808
- " `` `` "
471809
- ],
471810
- [
471811
- " ",
471812
- " _,--._ ",
471813
- " ( {E} {E} ) ",
471814
- " /[______]\\ ",
471815
- " `` `` "
471816
- ],
471817
- [
471818
- " ",
471819
- " _,--._ ",
471820
- " ( {E} {E} ) ",
471821
- " /[======]\\ ",
471822
- " `` `` "
471823
- ]
471824
- ],
471825
- [snail]: [
471826
- [
471827
- " ",
471828
- " {E} .--. ",
471829
- " \\ ( @ ) ",
471830
- " \\_`--´ ",
471831
- " ~~~~~~~ "
471832
- ],
471833
- [
471834
- " ",
471835
- " {E} .--. ",
471836
- " | ( @ ) ",
471837
- " \\_`--´ ",
471838
- " ~~~~~~~ "
471839
- ],
471840
- [
471841
- " ",
471842
- " {E} .--. ",
471843
- " \\ ( @ ) ",
471844
- " \\_`--´ ",
471845
- " ~~~~~~ "
471846
- ]
471847
- ],
471848
- [ghost]: [
471849
- [
471850
- " ",
471851
- " .----. ",
471852
- " / {E} {E} \\ ",
471853
- " | | ",
471854
- " ~`~``~`~ "
471855
- ],
471856
- [
471857
- " ",
471858
- " .----. ",
471859
- " / {E} {E} \\ ",
471860
- " | | ",
471861
- " `~`~~`~` "
471862
- ],
471863
- [
471864
- " ~ ~ ",
471865
- " .----. ",
471866
- " / {E} {E} \\ ",
471867
- " | | ",
471868
- " ~~`~~`~~ "
471869
- ]
471870
- ],
471871
- [axolotl]: [
471872
- [
471873
- " ",
471874
- "}~(______)~{",
471875
- "}~({E} .. {E})~{",
471876
- " ( .--. ) ",
471877
- " (_/ \\_) "
471878
- ],
471879
- [
471880
- " ",
471881
- "~}(______){~",
471882
- "~}({E} .. {E}){~",
471883
- " ( .--. ) ",
471884
- " (_/ \\_) "
471885
- ],
471886
- [
471887
- " ",
471888
- "}~(______)~{",
471889
- "}~({E} .. {E})~{",
471890
- " ( -- ) ",
471891
- " ~_/ \\_~ "
471892
- ]
471893
- ],
471894
- [capybara]: [
471895
- [
471896
- " ",
471897
- " n______n ",
471898
- " ( {E} {E} ) ",
471899
- " ( oo ) ",
471900
- " `------´ "
471901
- ],
471902
- [
471903
- " ",
471904
- " n______n ",
471905
- " ( {E} {E} ) ",
471906
- " ( Oo ) ",
471907
- " `------´ "
471908
- ],
471909
- [
471910
- " ~ ~ ",
471911
- " u______n ",
471912
- " ( {E} {E} ) ",
471913
- " ( oo ) ",
471914
- " `------´ "
471915
- ]
471916
- ],
471917
- [cactus]: [
471918
- [
471919
- " ",
471920
- " n ____ n ",
471921
- " | |{E} {E}| | ",
471922
- " |_| |_| ",
471923
- " | | "
471924
- ],
471925
- [
471926
- " ",
471927
- " ____ ",
471928
- " n |{E} {E}| n ",
471929
- " |_| |_| ",
471930
- " | | "
471931
- ],
471932
- [
471933
- " n n ",
471934
- " | ____ | ",
471935
- " | |{E} {E}| | ",
471936
- " |_| |_| ",
471937
- " | | "
471938
- ]
471939
- ],
471940
- [robot]: [
471941
- [
471942
- " ",
471943
- " .[||]. ",
471944
- " [ {E} {E} ] ",
471945
- " [ ==== ] ",
471946
- " `------´ "
471947
- ],
471948
- [
471949
- " ",
471950
- " .[||]. ",
471951
- " [ {E} {E} ] ",
471952
- " [ -==- ] ",
471953
- " `------´ "
471954
- ],
471955
- [
471956
- " * ",
471957
- " .[||]. ",
471958
- " [ {E} {E} ] ",
471959
- " [ ==== ] ",
471960
- " `------´ "
471961
- ]
471962
- ],
471963
- [rabbit]: [
471964
- [
471965
- " ",
471966
- " (\\__/) ",
471967
- " ( {E} {E} ) ",
471968
- " =( .. )= ",
471969
- ' (")__(") '
471970
- ],
471971
- [
471972
- " ",
471973
- " (|__/) ",
471974
- " ( {E} {E} ) ",
471975
- " =( .. )= ",
471976
- ' (")__(") '
471977
- ],
471978
- [
471979
- " ",
471980
- " (\\__/) ",
471981
- " ( {E} {E} ) ",
471982
- " =( . . )= ",
471983
- ' (")__(") '
471984
- ]
471985
- ],
471986
- [mushroom]: [
471987
- [
471988
- " ",
471989
- " .-o-OO-o-. ",
471990
- "(__________)",
471991
- " |{E} {E}| ",
471992
- " |____| "
471993
- ],
471994
- [
471995
- " ",
471996
- " .-O-oo-O-. ",
471997
- "(__________)",
471998
- " |{E} {E}| ",
471999
- " |____| "
472000
- ],
472001
- [
472002
- " . o . ",
472003
- " .-o-OO-o-. ",
472004
- "(__________)",
472005
- " |{E} {E}| ",
472006
- " |____| "
472007
- ]
472008
- ],
472009
- [chonk]: [
472010
- [
472011
- " ",
472012
- " /\\ /\\ ",
472013
- " ( {E} {E} ) ",
472014
- " ( .. ) ",
472015
- " `------´ "
472016
- ],
472017
- [
472018
- " ",
472019
- " /\\ /| ",
472020
- " ( {E} {E} ) ",
472021
- " ( .. ) ",
472022
- " `------´ "
472023
- ],
472024
- [
472025
- " ",
472026
- " /\\ /\\ ",
472027
- " ( {E} {E} ) ",
472028
- " ( .. ) ",
472029
- " `------´~ "
472030
- ]
472031
- ]
472032
- };
472033
- });
472034
-
472035
472335
  // src/buddy/CompanionSprite.tsx
472036
472336
  function spriteColWidth(nameWidth) {
472037
472337
  return Math.max(SPRITE_BODY_WIDTH, nameWidth + NAME_ROW_PAD);
@@ -472193,7 +472493,7 @@ var init_useVoiceEnabled = __esm(() => {
472193
472493
  function getSemverPart(version2) {
472194
472494
  return `${import_semver10.major(version2, { loose: true })}.${import_semver10.minor(version2, { loose: true })}.${import_semver10.patch(version2, { loose: true })}`;
472195
472495
  }
472196
- function useUpdateNotification(updatedVersion, initialVersion = "1.7.0") {
472496
+ function useUpdateNotification(updatedVersion, initialVersion = "1.7.1") {
472197
472497
  const [lastNotifiedSemver, setLastNotifiedSemver] = import_react214.useState(() => getSemverPart(initialVersion));
472198
472498
  if (!updatedVersion) {
472199
472499
  return null;
@@ -472233,7 +472533,7 @@ function AutoUpdater({
472233
472533
  return;
472234
472534
  }
472235
472535
  if (false) {}
472236
- const currentVersion = "1.7.0";
472536
+ const currentVersion = "1.7.1";
472237
472537
  const channel = getInitialSettings()?.autoUpdatesChannel ?? "latest";
472238
472538
  let latestVersion = await getLatestVersion(channel);
472239
472539
  const isDisabled = isAutoUpdaterDisabled();
@@ -472444,12 +472744,12 @@ function NativeAutoUpdater({
472444
472744
  logEvent("tengu_native_auto_updater_start", {});
472445
472745
  try {
472446
472746
  const maxVersion = await getMaxVersion();
472447
- if (maxVersion && gt("1.7.0", maxVersion)) {
472747
+ if (maxVersion && gt("1.7.1", maxVersion)) {
472448
472748
  const msg = await getMaxVersionMessage();
472449
472749
  setMaxVersionIssue(msg ?? "affects your version");
472450
472750
  }
472451
472751
  const result = await installLatest(channel);
472452
- const currentVersion = "1.7.0";
472752
+ const currentVersion = "1.7.1";
472453
472753
  const latencyMs = Date.now() - startTime;
472454
472754
  if (result.lockFailed) {
472455
472755
  logEvent("tengu_native_auto_updater_lock_contention", {
@@ -472584,17 +472884,17 @@ function PackageManagerAutoUpdater(t0) {
472584
472884
  const maxVersion = await getMaxVersion();
472585
472885
  if (maxVersion && latest && gt(latest, maxVersion)) {
472586
472886
  logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
472587
- if (gte("1.7.0", maxVersion)) {
472588
- logForDebugging(`PackageManagerAutoUpdater: current version ${"1.7.0"} is already at or above maxVersion ${maxVersion}, skipping update`);
472887
+ if (gte("1.7.1", maxVersion)) {
472888
+ logForDebugging(`PackageManagerAutoUpdater: current version ${"1.7.1"} is already at or above maxVersion ${maxVersion}, skipping update`);
472589
472889
  setUpdateAvailable(false);
472590
472890
  return;
472591
472891
  }
472592
472892
  latest = maxVersion;
472593
472893
  }
472594
- const hasUpdate = latest && !gte("1.7.0", latest) && !shouldSkipVersion(latest);
472894
+ const hasUpdate = latest && !gte("1.7.1", latest) && !shouldSkipVersion(latest);
472595
472895
  setUpdateAvailable(!!hasUpdate);
472596
472896
  if (hasUpdate) {
472597
- logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.7.0"} -> ${latest}`);
472897
+ logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.7.1"} -> ${latest}`);
472598
472898
  }
472599
472899
  };
472600
472900
  $2[0] = t1;
@@ -472628,7 +472928,7 @@ function PackageManagerAutoUpdater(t0) {
472628
472928
  wrap: "truncate",
472629
472929
  children: [
472630
472930
  "currentVersion: ",
472631
- "1.7.0"
472931
+ "1.7.1"
472632
472932
  ]
472633
472933
  }, undefined, true, undefined, this);
472634
472934
  $2[3] = verbose;
@@ -480188,7 +480488,7 @@ function buildStatusLineCommandInput(permissionMode, exceeds200kTokens, settings
480188
480488
  project_dir: getOriginalCwd(),
480189
480489
  added_dirs: addedDirs
480190
480490
  },
480191
- version: "1.7.0",
480491
+ version: "1.7.1",
480192
480492
  output_style: {
480193
480493
  name: outputStyleName
480194
480494
  },
@@ -485150,7 +485450,7 @@ function convertStatusMessage(msg) {
485150
485450
  return {
485151
485451
  type: "system",
485152
485452
  subtype: "informational",
485153
- content: msg.status === "compacting" ? "Compacting conversation…" : `Status: ${msg.status}`,
485453
+ content: msg.status === "compacting" ? "Compressing context…" : `Status: ${msg.status}`,
485154
485454
  level: "info",
485155
485455
  uuid: msg.uuid,
485156
485456
  timestamp: new Date().toISOString()
@@ -488628,7 +488928,7 @@ __export(exports_processBashCommand, {
488628
488928
  });
488629
488929
  import { randomUUID as randomUUID41 } from "crypto";
488630
488930
  async function processBashCommand(inputString, precedingInputBlocks, attachmentMessages, context8, setToolJSX) {
488631
- const usePowerShell = isPowerShellToolEnabled() && resolveDefaultShell() === "powershell";
488931
+ const usePowerShell = isPowerShellToolEnabled() && resolveDefaultShell() === "powershell" || shouldPreferPowerShellForCommand(inputString);
488632
488932
  logEvent("tengu_input_bash", {
488633
488933
  powershell: usePowerShell
488634
488934
  });
@@ -491760,7 +492060,7 @@ async function submitTranscriptShare(messages, trigger, appearanceId) {
491760
492060
  } catch {}
491761
492061
  const data = {
491762
492062
  trigger,
491763
- version: "1.7.0",
492063
+ version: "1.7.1",
491764
492064
  platform: process.platform,
491765
492065
  transcript,
491766
492066
  subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
@@ -500687,7 +500987,7 @@ Error: sandbox required but unavailable: ${reason}
500687
500987
  setSpinnerMessage(event.hookType === "pre_compact" ? "Running PreCompact hooks…" : event.hookType === "post_compact" ? "Running PostCompact hooks…" : "Running SessionStart hooks…");
500688
500988
  break;
500689
500989
  case "compact_start":
500690
- setSpinnerMessage("Compacting conversation");
500990
+ setSpinnerMessage("Compressing context");
500691
500991
  break;
500692
500992
  case "compact_end":
500693
500993
  setSpinnerMessage(null);
@@ -508219,7 +508519,7 @@ function appendToLog(path17, message) {
508219
508519
  cwd: getFsImplementation().cwd(),
508220
508520
  userType: process.env.USER_TYPE,
508221
508521
  sessionId: getSessionId(),
508222
- version: "1.7.0"
508522
+ version: "1.7.1"
508223
508523
  };
508224
508524
  getLogWriter(path17).write(messageWithTimestamp);
508225
508525
  }
@@ -508320,6 +508620,15 @@ var init_sinks = __esm(() => {
508320
508620
  // src/services/SessionMemory/sessionMemory.ts
508321
508621
  import { writeFile as writeFile59 } from "fs/promises";
508322
508622
  function isSessionMemoryGateEnabled() {
508623
+ if (isEnvTruthy(process.env.ENABLE_CLAUDE_CODE_SESSION_MEMORY)) {
508624
+ return true;
508625
+ }
508626
+ if (isEnvTruthy(process.env.DISABLE_CLAUDE_CODE_SESSION_MEMORY)) {
508627
+ return false;
508628
+ }
508629
+ if (process.env.USER_TYPE !== "ant") {
508630
+ return true;
508631
+ }
508323
508632
  return getFeatureValue_CACHED_MAY_BE_STALE("tengu_session_memory", false);
508324
508633
  }
508325
508634
  function getSessionMemoryRemoteConfig() {
@@ -508451,6 +508760,7 @@ var init_sessionMemory = __esm(() => {
508451
508760
  init_fsOperations();
508452
508761
  init_postSamplingHooks();
508453
508762
  init_messages3();
508763
+ init_envUtils();
508454
508764
  init_filesystem();
508455
508765
  init_tokens();
508456
508766
  init_autoCompact();
@@ -512233,8 +512543,8 @@ async function getEnvLessBridgeConfig() {
512233
512543
  }
512234
512544
  async function checkEnvLessBridgeMinVersion() {
512235
512545
  const cfg = await getEnvLessBridgeConfig();
512236
- if (cfg.min_version && lt("1.7.0", cfg.min_version)) {
512237
- return `Your version of localclawd (${"1.7.0"}) is too old for Remote Control.
512546
+ if (cfg.min_version && lt("1.7.1", cfg.min_version)) {
512547
+ return `Your version of localclawd (${"1.7.1"}) is too old for Remote Control.
512238
512548
  Version ${cfg.min_version} or higher is required. Run \`localclawd update\` to update.`;
512239
512549
  }
512240
512550
  return null;
@@ -512706,7 +513016,7 @@ async function initBridgeCore(params) {
512706
513016
  const rawApi = createBridgeApiClient({
512707
513017
  baseUrl,
512708
513018
  getAccessToken,
512709
- runnerVersion: "1.7.0",
513019
+ runnerVersion: "1.7.1",
512710
513020
  onDebug: logForDebugging,
512711
513021
  onAuth401,
512712
513022
  getTrustedDeviceToken
@@ -518425,7 +518735,7 @@ async function startMCPServer(cwd3, debug4, verbose) {
518425
518735
  setCwd(cwd3);
518426
518736
  const server = new Server({
518427
518737
  name: "claude/tengu",
518428
- version: "1.7.0"
518738
+ version: "1.7.1"
518429
518739
  }, {
518430
518740
  capabilities: {
518431
518741
  tools: {}
@@ -519506,7 +519816,7 @@ function WelcomeLogo() {
519506
519816
  dimColor: true,
519507
519817
  children: [
519508
519818
  "v",
519509
- "1.7.0"
519819
+ "1.7.1"
519510
519820
  ]
519511
519821
  }, undefined, true, undefined, this)
519512
519822
  ]
@@ -519697,7 +520007,7 @@ __export(exports_update, {
519697
520007
  });
519698
520008
  async function update() {
519699
520009
  logEvent("tengu_update_check", {});
519700
- writeToStdout(`Current version: ${"1.7.0"}
520010
+ writeToStdout(`Current version: ${"1.7.1"}
519701
520011
  `);
519702
520012
  const channel = getInitialSettings()?.autoUpdatesChannel ?? "latest";
519703
520013
  writeToStdout(`Checking for updates to ${channel} version...
@@ -519772,8 +520082,8 @@ async function update() {
519772
520082
  writeToStdout(`localclawd is managed by Homebrew.
519773
520083
  `);
519774
520084
  const latest = await getLatestVersion(channel);
519775
- if (latest && !gte("1.7.0", latest)) {
519776
- writeToStdout(`Update available: ${"1.7.0"} → ${latest}
520085
+ if (latest && !gte("1.7.1", latest)) {
520086
+ writeToStdout(`Update available: ${"1.7.1"} → ${latest}
519777
520087
  `);
519778
520088
  writeToStdout(`
519779
520089
  `);
@@ -519789,8 +520099,8 @@ async function update() {
519789
520099
  writeToStdout(`localclawd is managed by winget.
519790
520100
  `);
519791
520101
  const latest = await getLatestVersion(channel);
519792
- if (latest && !gte("1.7.0", latest)) {
519793
- writeToStdout(`Update available: ${"1.7.0"} → ${latest}
520102
+ if (latest && !gte("1.7.1", latest)) {
520103
+ writeToStdout(`Update available: ${"1.7.1"} → ${latest}
519794
520104
  `);
519795
520105
  writeToStdout(`
519796
520106
  `);
@@ -519804,8 +520114,8 @@ async function update() {
519804
520114
  writeToStdout(`localclawd is managed by apk.
519805
520115
  `);
519806
520116
  const latest = await getLatestVersion(channel);
519807
- if (latest && !gte("1.7.0", latest)) {
519808
- writeToStdout(`Update available: ${"1.7.0"} → ${latest}
520117
+ if (latest && !gte("1.7.1", latest)) {
520118
+ writeToStdout(`Update available: ${"1.7.1"} → ${latest}
519809
520119
  `);
519810
520120
  writeToStdout(`
519811
520121
  `);
@@ -519870,11 +520180,11 @@ async function update() {
519870
520180
  `);
519871
520181
  await gracefulShutdown(1);
519872
520182
  }
519873
- if (result.latestVersion === "1.7.0") {
519874
- writeToStdout(source_default.green(`localclawd is up to date (${"1.7.0"})`) + `
520183
+ if (result.latestVersion === "1.7.1") {
520184
+ writeToStdout(source_default.green(`localclawd is up to date (${"1.7.1"})`) + `
519875
520185
  `);
519876
520186
  } else {
519877
- writeToStdout(source_default.green(`Successfully updated from ${"1.7.0"} to version ${result.latestVersion}`) + `
520187
+ writeToStdout(source_default.green(`Successfully updated from ${"1.7.1"} to version ${result.latestVersion}`) + `
519878
520188
  `);
519879
520189
  await regenerateCompletionCache();
519880
520190
  }
@@ -519934,12 +520244,12 @@ async function update() {
519934
520244
  `);
519935
520245
  await gracefulShutdown(1);
519936
520246
  }
519937
- if (latestVersion === "1.7.0") {
519938
- writeToStdout(source_default.green(`localclawd is up to date (${"1.7.0"})`) + `
520247
+ if (latestVersion === "1.7.1") {
520248
+ writeToStdout(source_default.green(`localclawd is up to date (${"1.7.1"})`) + `
519939
520249
  `);
519940
520250
  await gracefulShutdown(0);
519941
520251
  }
519942
- writeToStdout(`New version available: ${latestVersion} (current: ${"1.7.0"})
520252
+ writeToStdout(`New version available: ${latestVersion} (current: ${"1.7.1"})
519943
520253
  `);
519944
520254
  writeToStdout(`Installing update...
519945
520255
  `);
@@ -519984,7 +520294,7 @@ async function update() {
519984
520294
  logForDebugging(`update: Installation status: ${status2}`);
519985
520295
  switch (status2) {
519986
520296
  case "success":
519987
- writeToStdout(source_default.green(`Successfully updated from ${"1.7.0"} to version ${latestVersion}`) + `
520297
+ writeToStdout(source_default.green(`Successfully updated from ${"1.7.1"} to version ${latestVersion}`) + `
519988
520298
  `);
519989
520299
  await regenerateCompletionCache();
519990
520300
  break;
@@ -521226,7 +521536,7 @@ Run with --debug for more details.
521226
521536
  }
521227
521537
  }
521228
521538
  logForDiagnosticsNoPII("info", "started", {
521229
- version: "1.7.0",
521539
+ version: "1.7.1",
521230
521540
  is_native_binary: isInBundledMode()
521231
521541
  });
521232
521542
  registerCleanup(async () => {
@@ -522010,7 +522320,7 @@ Usage: localclawd --remote "your task description"`, () => gracefulShutdown(1));
522010
522320
  pendingHookMessages
522011
522321
  }, renderAndRun);
522012
522322
  }
522013
- }).version("1.7.0 (localclawd)", "-v, --version", "Output the version number");
522323
+ }).version("1.7.1 (localclawd)", "-v, --version", "Output the version number");
522014
522324
  program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
522015
522325
  program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
522016
522326
  if (canUserConfigureAdvisor()) {
@@ -522524,7 +522834,7 @@ if (false) {}
522524
522834
  async function main2() {
522525
522835
  const args = process.argv.slice(2);
522526
522836
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
522527
- console.log(`${"1.7.0"} (localclawd)`);
522837
+ console.log(`${"1.7.1"} (localclawd)`);
522528
522838
  return;
522529
522839
  }
522530
522840
  const {
@@ -522607,4 +522917,4 @@ localclawd crashed: ${msg}
522607
522917
  process.exit(1);
522608
522918
  });
522609
522919
 
522610
- //# debugId=CF3A42B64044289E64756E2164756E21
522920
+ //# debugId=F043612BE1588F6464756E2164756E21