@costrict/csc 4.2.14 → 4.2.16

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.
@@ -64,6 +64,670 @@ var __export = (target, all) => {
64
64
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
65
65
  var __require = typeof import.meta.require === "function" ? import.meta.require : (await import("module")).createRequire(import.meta.url);
66
66
 
67
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js
68
+ var freeGlobal, _freeGlobal_default;
69
+ var init__freeGlobal = __esm(() => {
70
+ freeGlobal = typeof global == "object" && global && global.Object === Object && global;
71
+ _freeGlobal_default = freeGlobal;
72
+ });
73
+
74
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js
75
+ var freeSelf, root, _root_default;
76
+ var init__root = __esm(() => {
77
+ init__freeGlobal();
78
+ freeSelf = typeof self == "object" && self && self.Object === Object && self;
79
+ root = _freeGlobal_default || freeSelf || Function("return this")();
80
+ _root_default = root;
81
+ });
82
+
83
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js
84
+ var Symbol2, _Symbol_default;
85
+ var init__Symbol = __esm(() => {
86
+ init__root();
87
+ Symbol2 = _root_default.Symbol;
88
+ _Symbol_default = Symbol2;
89
+ });
90
+
91
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js
92
+ function getRawTag(value) {
93
+ var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
94
+ try {
95
+ value[symToStringTag] = undefined;
96
+ var unmasked = true;
97
+ } catch (e) {}
98
+ var result = nativeObjectToString.call(value);
99
+ if (unmasked) {
100
+ if (isOwn) {
101
+ value[symToStringTag] = tag;
102
+ } else {
103
+ delete value[symToStringTag];
104
+ }
105
+ }
106
+ return result;
107
+ }
108
+ var objectProto, hasOwnProperty, nativeObjectToString, symToStringTag, _getRawTag_default;
109
+ var init__getRawTag = __esm(() => {
110
+ init__Symbol();
111
+ objectProto = Object.prototype;
112
+ hasOwnProperty = objectProto.hasOwnProperty;
113
+ nativeObjectToString = objectProto.toString;
114
+ symToStringTag = _Symbol_default ? _Symbol_default.toStringTag : undefined;
115
+ _getRawTag_default = getRawTag;
116
+ });
117
+
118
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js
119
+ function objectToString(value) {
120
+ return nativeObjectToString2.call(value);
121
+ }
122
+ var objectProto2, nativeObjectToString2, _objectToString_default;
123
+ var init__objectToString = __esm(() => {
124
+ objectProto2 = Object.prototype;
125
+ nativeObjectToString2 = objectProto2.toString;
126
+ _objectToString_default = objectToString;
127
+ });
128
+
129
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js
130
+ function baseGetTag(value) {
131
+ if (value == null) {
132
+ return value === undefined ? undefinedTag : nullTag;
133
+ }
134
+ return symToStringTag2 && symToStringTag2 in Object(value) ? _getRawTag_default(value) : _objectToString_default(value);
135
+ }
136
+ var nullTag = "[object Null]", undefinedTag = "[object Undefined]", symToStringTag2, _baseGetTag_default;
137
+ var init__baseGetTag = __esm(() => {
138
+ init__Symbol();
139
+ init__getRawTag();
140
+ init__objectToString();
141
+ symToStringTag2 = _Symbol_default ? _Symbol_default.toStringTag : undefined;
142
+ _baseGetTag_default = baseGetTag;
143
+ });
144
+
145
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js
146
+ function isObject(value) {
147
+ var type = typeof value;
148
+ return value != null && (type == "object" || type == "function");
149
+ }
150
+ var isObject_default;
151
+ var init_isObject = __esm(() => {
152
+ isObject_default = isObject;
153
+ });
154
+
155
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js
156
+ function isFunction(value) {
157
+ if (!isObject_default(value)) {
158
+ return false;
159
+ }
160
+ var tag = _baseGetTag_default(value);
161
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
162
+ }
163
+ var asyncTag = "[object AsyncFunction]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]", isFunction_default;
164
+ var init_isFunction = __esm(() => {
165
+ init__baseGetTag();
166
+ init_isObject();
167
+ isFunction_default = isFunction;
168
+ });
169
+
170
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js
171
+ var coreJsData, _coreJsData_default;
172
+ var init__coreJsData = __esm(() => {
173
+ init__root();
174
+ coreJsData = _root_default["__core-js_shared__"];
175
+ _coreJsData_default = coreJsData;
176
+ });
177
+
178
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js
179
+ function isMasked(func) {
180
+ return !!maskSrcKey && maskSrcKey in func;
181
+ }
182
+ var maskSrcKey, _isMasked_default;
183
+ var init__isMasked = __esm(() => {
184
+ init__coreJsData();
185
+ maskSrcKey = function() {
186
+ var uid = /[^.]+$/.exec(_coreJsData_default && _coreJsData_default.keys && _coreJsData_default.keys.IE_PROTO || "");
187
+ return uid ? "Symbol(src)_1." + uid : "";
188
+ }();
189
+ _isMasked_default = isMasked;
190
+ });
191
+
192
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js
193
+ function toSource(func) {
194
+ if (func != null) {
195
+ try {
196
+ return funcToString.call(func);
197
+ } catch (e) {}
198
+ try {
199
+ return func + "";
200
+ } catch (e) {}
201
+ }
202
+ return "";
203
+ }
204
+ var funcProto, funcToString, _toSource_default;
205
+ var init__toSource = __esm(() => {
206
+ funcProto = Function.prototype;
207
+ funcToString = funcProto.toString;
208
+ _toSource_default = toSource;
209
+ });
210
+
211
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js
212
+ function baseIsNative(value) {
213
+ if (!isObject_default(value) || _isMasked_default(value)) {
214
+ return false;
215
+ }
216
+ var pattern = isFunction_default(value) ? reIsNative : reIsHostCtor;
217
+ return pattern.test(_toSource_default(value));
218
+ }
219
+ var reRegExpChar, reIsHostCtor, funcProto2, objectProto3, funcToString2, hasOwnProperty2, reIsNative, _baseIsNative_default;
220
+ var init__baseIsNative = __esm(() => {
221
+ init_isFunction();
222
+ init__isMasked();
223
+ init_isObject();
224
+ init__toSource();
225
+ reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
226
+ reIsHostCtor = /^\[object .+?Constructor\]$/;
227
+ funcProto2 = Function.prototype;
228
+ objectProto3 = Object.prototype;
229
+ funcToString2 = funcProto2.toString;
230
+ hasOwnProperty2 = objectProto3.hasOwnProperty;
231
+ reIsNative = RegExp("^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
232
+ _baseIsNative_default = baseIsNative;
233
+ });
234
+
235
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js
236
+ function getValue(object, key) {
237
+ return object == null ? undefined : object[key];
238
+ }
239
+ var _getValue_default;
240
+ var init__getValue = __esm(() => {
241
+ _getValue_default = getValue;
242
+ });
243
+
244
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js
245
+ function getNative(object, key) {
246
+ var value = _getValue_default(object, key);
247
+ return _baseIsNative_default(value) ? value : undefined;
248
+ }
249
+ var _getNative_default;
250
+ var init__getNative = __esm(() => {
251
+ init__baseIsNative();
252
+ init__getValue();
253
+ _getNative_default = getNative;
254
+ });
255
+
256
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js
257
+ var nativeCreate, _nativeCreate_default;
258
+ var init__nativeCreate = __esm(() => {
259
+ init__getNative();
260
+ nativeCreate = _getNative_default(Object, "create");
261
+ _nativeCreate_default = nativeCreate;
262
+ });
263
+
264
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js
265
+ function hashClear() {
266
+ this.__data__ = _nativeCreate_default ? _nativeCreate_default(null) : {};
267
+ this.size = 0;
268
+ }
269
+ var _hashClear_default;
270
+ var init__hashClear = __esm(() => {
271
+ init__nativeCreate();
272
+ _hashClear_default = hashClear;
273
+ });
274
+
275
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js
276
+ function hashDelete(key) {
277
+ var result = this.has(key) && delete this.__data__[key];
278
+ this.size -= result ? 1 : 0;
279
+ return result;
280
+ }
281
+ var _hashDelete_default;
282
+ var init__hashDelete = __esm(() => {
283
+ _hashDelete_default = hashDelete;
284
+ });
285
+
286
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js
287
+ function hashGet(key) {
288
+ var data = this.__data__;
289
+ if (_nativeCreate_default) {
290
+ var result = data[key];
291
+ return result === HASH_UNDEFINED ? undefined : result;
292
+ }
293
+ return hasOwnProperty3.call(data, key) ? data[key] : undefined;
294
+ }
295
+ var HASH_UNDEFINED = "__lodash_hash_undefined__", objectProto4, hasOwnProperty3, _hashGet_default;
296
+ var init__hashGet = __esm(() => {
297
+ init__nativeCreate();
298
+ objectProto4 = Object.prototype;
299
+ hasOwnProperty3 = objectProto4.hasOwnProperty;
300
+ _hashGet_default = hashGet;
301
+ });
302
+
303
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js
304
+ function hashHas(key) {
305
+ var data = this.__data__;
306
+ return _nativeCreate_default ? data[key] !== undefined : hasOwnProperty4.call(data, key);
307
+ }
308
+ var objectProto5, hasOwnProperty4, _hashHas_default;
309
+ var init__hashHas = __esm(() => {
310
+ init__nativeCreate();
311
+ objectProto5 = Object.prototype;
312
+ hasOwnProperty4 = objectProto5.hasOwnProperty;
313
+ _hashHas_default = hashHas;
314
+ });
315
+
316
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js
317
+ function hashSet(key, value) {
318
+ var data = this.__data__;
319
+ this.size += this.has(key) ? 0 : 1;
320
+ data[key] = _nativeCreate_default && value === undefined ? HASH_UNDEFINED2 : value;
321
+ return this;
322
+ }
323
+ var HASH_UNDEFINED2 = "__lodash_hash_undefined__", _hashSet_default;
324
+ var init__hashSet = __esm(() => {
325
+ init__nativeCreate();
326
+ _hashSet_default = hashSet;
327
+ });
328
+
329
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js
330
+ function Hash(entries) {
331
+ var index = -1, length = entries == null ? 0 : entries.length;
332
+ this.clear();
333
+ while (++index < length) {
334
+ var entry = entries[index];
335
+ this.set(entry[0], entry[1]);
336
+ }
337
+ }
338
+ var _Hash_default;
339
+ var init__Hash = __esm(() => {
340
+ init__hashClear();
341
+ init__hashDelete();
342
+ init__hashGet();
343
+ init__hashHas();
344
+ init__hashSet();
345
+ Hash.prototype.clear = _hashClear_default;
346
+ Hash.prototype["delete"] = _hashDelete_default;
347
+ Hash.prototype.get = _hashGet_default;
348
+ Hash.prototype.has = _hashHas_default;
349
+ Hash.prototype.set = _hashSet_default;
350
+ _Hash_default = Hash;
351
+ });
352
+
353
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js
354
+ function listCacheClear() {
355
+ this.__data__ = [];
356
+ this.size = 0;
357
+ }
358
+ var _listCacheClear_default;
359
+ var init__listCacheClear = __esm(() => {
360
+ _listCacheClear_default = listCacheClear;
361
+ });
362
+
363
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js
364
+ function eq(value, other) {
365
+ return value === other || value !== value && other !== other;
366
+ }
367
+ var eq_default;
368
+ var init_eq = __esm(() => {
369
+ eq_default = eq;
370
+ });
371
+
372
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js
373
+ function assocIndexOf(array, key) {
374
+ var length = array.length;
375
+ while (length--) {
376
+ if (eq_default(array[length][0], key)) {
377
+ return length;
378
+ }
379
+ }
380
+ return -1;
381
+ }
382
+ var _assocIndexOf_default;
383
+ var init__assocIndexOf = __esm(() => {
384
+ init_eq();
385
+ _assocIndexOf_default = assocIndexOf;
386
+ });
387
+
388
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js
389
+ function listCacheDelete(key) {
390
+ var data = this.__data__, index = _assocIndexOf_default(data, key);
391
+ if (index < 0) {
392
+ return false;
393
+ }
394
+ var lastIndex = data.length - 1;
395
+ if (index == lastIndex) {
396
+ data.pop();
397
+ } else {
398
+ splice.call(data, index, 1);
399
+ }
400
+ --this.size;
401
+ return true;
402
+ }
403
+ var arrayProto, splice, _listCacheDelete_default;
404
+ var init__listCacheDelete = __esm(() => {
405
+ init__assocIndexOf();
406
+ arrayProto = Array.prototype;
407
+ splice = arrayProto.splice;
408
+ _listCacheDelete_default = listCacheDelete;
409
+ });
410
+
411
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js
412
+ function listCacheGet(key) {
413
+ var data = this.__data__, index = _assocIndexOf_default(data, key);
414
+ return index < 0 ? undefined : data[index][1];
415
+ }
416
+ var _listCacheGet_default;
417
+ var init__listCacheGet = __esm(() => {
418
+ init__assocIndexOf();
419
+ _listCacheGet_default = listCacheGet;
420
+ });
421
+
422
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js
423
+ function listCacheHas(key) {
424
+ return _assocIndexOf_default(this.__data__, key) > -1;
425
+ }
426
+ var _listCacheHas_default;
427
+ var init__listCacheHas = __esm(() => {
428
+ init__assocIndexOf();
429
+ _listCacheHas_default = listCacheHas;
430
+ });
431
+
432
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js
433
+ function listCacheSet(key, value) {
434
+ var data = this.__data__, index = _assocIndexOf_default(data, key);
435
+ if (index < 0) {
436
+ ++this.size;
437
+ data.push([key, value]);
438
+ } else {
439
+ data[index][1] = value;
440
+ }
441
+ return this;
442
+ }
443
+ var _listCacheSet_default;
444
+ var init__listCacheSet = __esm(() => {
445
+ init__assocIndexOf();
446
+ _listCacheSet_default = listCacheSet;
447
+ });
448
+
449
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js
450
+ function ListCache(entries) {
451
+ var index = -1, length = entries == null ? 0 : entries.length;
452
+ this.clear();
453
+ while (++index < length) {
454
+ var entry = entries[index];
455
+ this.set(entry[0], entry[1]);
456
+ }
457
+ }
458
+ var _ListCache_default;
459
+ var init__ListCache = __esm(() => {
460
+ init__listCacheClear();
461
+ init__listCacheDelete();
462
+ init__listCacheGet();
463
+ init__listCacheHas();
464
+ init__listCacheSet();
465
+ ListCache.prototype.clear = _listCacheClear_default;
466
+ ListCache.prototype["delete"] = _listCacheDelete_default;
467
+ ListCache.prototype.get = _listCacheGet_default;
468
+ ListCache.prototype.has = _listCacheHas_default;
469
+ ListCache.prototype.set = _listCacheSet_default;
470
+ _ListCache_default = ListCache;
471
+ });
472
+
473
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js
474
+ var Map2, _Map_default;
475
+ var init__Map = __esm(() => {
476
+ init__getNative();
477
+ init__root();
478
+ Map2 = _getNative_default(_root_default, "Map");
479
+ _Map_default = Map2;
480
+ });
481
+
482
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js
483
+ function mapCacheClear() {
484
+ this.size = 0;
485
+ this.__data__ = {
486
+ hash: new _Hash_default,
487
+ map: new (_Map_default || _ListCache_default),
488
+ string: new _Hash_default
489
+ };
490
+ }
491
+ var _mapCacheClear_default;
492
+ var init__mapCacheClear = __esm(() => {
493
+ init__Hash();
494
+ init__ListCache();
495
+ init__Map();
496
+ _mapCacheClear_default = mapCacheClear;
497
+ });
498
+
499
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js
500
+ function isKeyable(value) {
501
+ var type = typeof value;
502
+ return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
503
+ }
504
+ var _isKeyable_default;
505
+ var init__isKeyable = __esm(() => {
506
+ _isKeyable_default = isKeyable;
507
+ });
508
+
509
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js
510
+ function getMapData(map, key) {
511
+ var data = map.__data__;
512
+ return _isKeyable_default(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
513
+ }
514
+ var _getMapData_default;
515
+ var init__getMapData = __esm(() => {
516
+ init__isKeyable();
517
+ _getMapData_default = getMapData;
518
+ });
519
+
520
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js
521
+ function mapCacheDelete(key) {
522
+ var result = _getMapData_default(this, key)["delete"](key);
523
+ this.size -= result ? 1 : 0;
524
+ return result;
525
+ }
526
+ var _mapCacheDelete_default;
527
+ var init__mapCacheDelete = __esm(() => {
528
+ init__getMapData();
529
+ _mapCacheDelete_default = mapCacheDelete;
530
+ });
531
+
532
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js
533
+ function mapCacheGet(key) {
534
+ return _getMapData_default(this, key).get(key);
535
+ }
536
+ var _mapCacheGet_default;
537
+ var init__mapCacheGet = __esm(() => {
538
+ init__getMapData();
539
+ _mapCacheGet_default = mapCacheGet;
540
+ });
541
+
542
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js
543
+ function mapCacheHas(key) {
544
+ return _getMapData_default(this, key).has(key);
545
+ }
546
+ var _mapCacheHas_default;
547
+ var init__mapCacheHas = __esm(() => {
548
+ init__getMapData();
549
+ _mapCacheHas_default = mapCacheHas;
550
+ });
551
+
552
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js
553
+ function mapCacheSet(key, value) {
554
+ var data = _getMapData_default(this, key), size = data.size;
555
+ data.set(key, value);
556
+ this.size += data.size == size ? 0 : 1;
557
+ return this;
558
+ }
559
+ var _mapCacheSet_default;
560
+ var init__mapCacheSet = __esm(() => {
561
+ init__getMapData();
562
+ _mapCacheSet_default = mapCacheSet;
563
+ });
564
+
565
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js
566
+ function MapCache(entries) {
567
+ var index = -1, length = entries == null ? 0 : entries.length;
568
+ this.clear();
569
+ while (++index < length) {
570
+ var entry = entries[index];
571
+ this.set(entry[0], entry[1]);
572
+ }
573
+ }
574
+ var _MapCache_default;
575
+ var init__MapCache = __esm(() => {
576
+ init__mapCacheClear();
577
+ init__mapCacheDelete();
578
+ init__mapCacheGet();
579
+ init__mapCacheHas();
580
+ init__mapCacheSet();
581
+ MapCache.prototype.clear = _mapCacheClear_default;
582
+ MapCache.prototype["delete"] = _mapCacheDelete_default;
583
+ MapCache.prototype.get = _mapCacheGet_default;
584
+ MapCache.prototype.has = _mapCacheHas_default;
585
+ MapCache.prototype.set = _mapCacheSet_default;
586
+ _MapCache_default = MapCache;
587
+ });
588
+
589
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/memoize.js
590
+ function memoize(func, resolver) {
591
+ if (typeof func != "function" || resolver != null && typeof resolver != "function") {
592
+ throw new TypeError(FUNC_ERROR_TEXT);
593
+ }
594
+ var memoized = function() {
595
+ var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
596
+ if (cache.has(key)) {
597
+ return cache.get(key);
598
+ }
599
+ var result = func.apply(this, args);
600
+ memoized.cache = cache.set(key, result) || cache;
601
+ return result;
602
+ };
603
+ memoized.cache = new (memoize.Cache || _MapCache_default);
604
+ return memoized;
605
+ }
606
+ var FUNC_ERROR_TEXT = "Expected a function", memoize_default;
607
+ var init_memoize = __esm(() => {
608
+ init__MapCache();
609
+ memoize.Cache = _MapCache_default;
610
+ memoize_default = memoize;
611
+ });
612
+
613
+ // src/constants/branding.ts
614
+ var PRODUCT_URL = "https://costrict.ai", PRODUCT_DOMAIN = "costrict.ai", PRODUCT_DOCS_URL, PRODUCT_CHROME_URL, PRODUCT_SETTINGS_URL, PRODUCT_CODE_URL, PRODUCT_SESSION_URL, PRODUCT_UPGRADE_URL, PRODUCT_DOWNLOAD_URL, PRODUCT_DESKTOP_API_URL, PRODUCT_OAUTH_CLIENT_METADATA_URL, CONFIG_DIR_NAME = ".costrict", LEGACY_CONFIG_DIR_NAME = ".claude", ENV_PREFIX = "COSTRICT", LEGACY_ENV_PREFIX = "CLAUDE_CODE", LEGACY_BRIDGE_ENV_PREFIX = "CLAUDE";
615
+ var init_branding = __esm(() => {
616
+ PRODUCT_DOCS_URL = `${PRODUCT_URL}/docs`;
617
+ PRODUCT_CHROME_URL = `${PRODUCT_URL}/chrome`;
618
+ PRODUCT_SETTINGS_URL = `${PRODUCT_URL}/settings`;
619
+ PRODUCT_CODE_URL = `${PRODUCT_URL}/code`;
620
+ PRODUCT_SESSION_URL = `${PRODUCT_URL}/session`;
621
+ PRODUCT_UPGRADE_URL = `${PRODUCT_URL}/upgrade/max`;
622
+ PRODUCT_DOWNLOAD_URL = `${PRODUCT_URL}/download`;
623
+ PRODUCT_DESKTOP_API_URL = `${PRODUCT_URL}/api/desktop`;
624
+ PRODUCT_OAUTH_CLIENT_METADATA_URL = `${PRODUCT_URL}/oauth/costrict-client-metadata`;
625
+ });
626
+
627
+ // src/utils/envUtils.ts
628
+ import { homedir } from "os";
629
+ import { join } from "path";
630
+ function getLegacyConfigHomeDir() {
631
+ if (process.env.COSTRICT_CONFIG_DIR || process.env.CLAUDE_CONFIG_DIR) {
632
+ return;
633
+ }
634
+ return join(homedir(), LEGACY_CONFIG_DIR_NAME).normalize("NFC");
635
+ }
636
+ function hasNodeOption(flag) {
637
+ const nodeOptions = process.env.NODE_OPTIONS;
638
+ if (!nodeOptions) {
639
+ return false;
640
+ }
641
+ return nodeOptions.split(/\s+/u).includes(flag);
642
+ }
643
+ function isEnvTruthy(envVar) {
644
+ if (!envVar)
645
+ return false;
646
+ if (typeof envVar === "boolean")
647
+ return envVar;
648
+ const normalizedValue = envVar.toLowerCase().trim();
649
+ return ["1", "true", "yes", "on"].includes(normalizedValue);
650
+ }
651
+ function getCostrictEnv(suffix) {
652
+ return process.env[`${ENV_PREFIX}_${suffix}`] ?? process.env[`${LEGACY_ENV_PREFIX}_${suffix}`] ?? process.env[`${LEGACY_BRIDGE_ENV_PREFIX}_${suffix}`];
653
+ }
654
+ function isCostrictEnvTruthy(suffix) {
655
+ return isEnvTruthy(getCostrictEnv(suffix));
656
+ }
657
+ function isBareMode() {
658
+ return isEnvTruthy(process.env.COSTRICT_SIMPLE) || isEnvTruthy(process.env.CLAUDE_CODE_SIMPLE) || process.argv.includes("--bare");
659
+ }
660
+ function getAWSRegion() {
661
+ return process.env.AWS_REGION || process.env.AWS_DEFAULT_REGION || "us-east-1";
662
+ }
663
+ function isRunningOnHomespace() {
664
+ return process.env.USER_TYPE === "sf" && isEnvTruthy(process.env.COO_RUNNING_ON_HOMESPACE);
665
+ }
666
+ var getCostrictConfigHomeDir, getClaudeConfigHomeDir;
667
+ var init_envUtils = __esm(() => {
668
+ init_memoize();
669
+ init_branding();
670
+ getCostrictConfigHomeDir = memoize_default(() => {
671
+ return (process.env.COSTRICT_CONFIG_DIR ?? process.env.CLAUDE_CONFIG_DIR ?? join(homedir(), CONFIG_DIR_NAME)).normalize("NFC");
672
+ }, () => process.env.COSTRICT_CONFIG_DIR ?? process.env.CLAUDE_CONFIG_DIR);
673
+ getClaudeConfigHomeDir = getCostrictConfigHomeDir;
674
+ });
675
+
676
+ // src/utils/getWorktreePathsPortable.ts
677
+ import { execFile as execFileCb } from "child_process";
678
+ import { promisify } from "util";
679
+ var execFileAsync;
680
+ var init_getWorktreePathsPortable = __esm(() => {
681
+ execFileAsync = promisify(execFileCb);
682
+ });
683
+
684
+ // src/utils/hash.ts
685
+ function djb2Hash(str) {
686
+ let hash = 0;
687
+ for (let i = 0;i < str.length; i++) {
688
+ hash = (hash << 5) - hash + str.charCodeAt(i) | 0;
689
+ }
690
+ return hash;
691
+ }
692
+
693
+ // src/utils/sessionStoragePortable.ts
694
+ import { open as fsOpen, readdir, realpath, stat } from "fs/promises";
695
+ import { join as join2 } from "path";
696
+ function simpleHash(str) {
697
+ return Math.abs(djb2Hash(str)).toString(36);
698
+ }
699
+ function sanitizePath(name) {
700
+ const sanitized = name.replace(/[^a-zA-Z0-9]/g, "-");
701
+ if (sanitized.length <= MAX_SANITIZED_LENGTH) {
702
+ return sanitized;
703
+ }
704
+ const hash = typeof Bun !== "undefined" ? Bun.hash(name).toString(36) : simpleHash(name);
705
+ return `${sanitized.slice(0, MAX_SANITIZED_LENGTH)}-${hash}`;
706
+ }
707
+ function getProjectsDir() {
708
+ return join2(getClaudeConfigHomeDir(), "projects");
709
+ }
710
+ function getProjectDir(projectDir) {
711
+ return join2(getProjectsDir(), sanitizePath(projectDir));
712
+ }
713
+ async function canonicalizePath(dir) {
714
+ try {
715
+ return (await realpath(dir)).normalize("NFC");
716
+ } catch {
717
+ return dir.normalize("NFC");
718
+ }
719
+ }
720
+ var MAX_SANITIZED_LENGTH = 200, TRANSCRIPT_READ_CHUNK_SIZE, SKIP_PRECOMPACT_THRESHOLD, ATTR_SNAP_PREFIX, SYSTEM_PREFIX, LF = 10, LF_BYTE;
721
+ var init_sessionStoragePortable = __esm(() => {
722
+ init_envUtils();
723
+ init_getWorktreePathsPortable();
724
+ TRANSCRIPT_READ_CHUNK_SIZE = 1024 * 1024;
725
+ SKIP_PRECOMPACT_THRESHOLD = 5 * 1024 * 1024;
726
+ ATTR_SNAP_PREFIX = Buffer.from('{"type":"attribution-snapshot"');
727
+ SYSTEM_PREFIX = Buffer.from('{"type":"system"');
728
+ LF_BYTE = Buffer.from([LF]);
729
+ });
730
+
67
731
  // src/utils/clientVersion.ts
68
732
  import { readFileSync as readFileSync2 } from "fs";
69
733
  import path4 from "path";
@@ -72,8 +736,8 @@ function getClientVersion() {
72
736
  if (cached)
73
737
  return cached;
74
738
  try {
75
- if ("4.2.14") {
76
- cached = "4.2.14";
739
+ if ("4.2.16") {
740
+ cached = "4.2.16";
77
741
  return cached;
78
742
  }
79
743
  } catch {}
@@ -672,9 +1336,9 @@ GFS4: `);
672
1336
  }
673
1337
  }
674
1338
  var fs$readdir = fs4.readdir;
675
- fs4.readdir = readdir;
1339
+ fs4.readdir = readdir2;
676
1340
  var noReaddirOptionVersions = /^v[0-5]\./;
677
- function readdir(path5, options, cb) {
1341
+ function readdir2(path5, options, cb) {
678
1342
  if (typeof options === "function")
679
1343
  cb = options, options = null;
680
1344
  var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path6, options2, cb2, startTime) {
@@ -1263,11 +1927,11 @@ var require_mtime_precision = __commonJS((exports, module) => {
1263
1927
  function probe(file, fs3, callback) {
1264
1928
  const cachedPrecision = fs3[cacheSymbol];
1265
1929
  if (cachedPrecision) {
1266
- return fs3.stat(file, (err, stat2) => {
1930
+ return fs3.stat(file, (err, stat4) => {
1267
1931
  if (err) {
1268
1932
  return callback(err);
1269
1933
  }
1270
- callback(null, stat2.mtime, cachedPrecision);
1934
+ callback(null, stat4.mtime, cachedPrecision);
1271
1935
  });
1272
1936
  }
1273
1937
  const mtime = new Date(Math.ceil(Date.now() / 1000) * 1000 + 5);
@@ -1275,13 +1939,13 @@ var require_mtime_precision = __commonJS((exports, module) => {
1275
1939
  if (err) {
1276
1940
  return callback(err);
1277
1941
  }
1278
- fs3.stat(file, (err2, stat2) => {
1942
+ fs3.stat(file, (err2, stat4) => {
1279
1943
  if (err2) {
1280
1944
  return callback(err2);
1281
1945
  }
1282
- const precision = stat2.mtime.getTime() % 1000 === 0 ? "s" : "ms";
1946
+ const precision = stat4.mtime.getTime() % 1000 === 0 ? "s" : "ms";
1283
1947
  Object.defineProperty(fs3, cacheSymbol, { value: precision });
1284
- callback(null, stat2.mtime, precision);
1948
+ callback(null, stat4.mtime, precision);
1285
1949
  });
1286
1950
  });
1287
1951
  }
@@ -1331,14 +1995,14 @@ var require_lockfile = __commonJS((exports, module) => {
1331
1995
  if (options.stale <= 0) {
1332
1996
  return callback(Object.assign(new Error("Lock file is already being held"), { code: "ELOCKED", file }));
1333
1997
  }
1334
- options.fs.stat(lockfilePath, (err2, stat2) => {
1998
+ options.fs.stat(lockfilePath, (err2, stat4) => {
1335
1999
  if (err2) {
1336
2000
  if (err2.code === "ENOENT") {
1337
2001
  return acquireLock(file, { ...options, stale: 0 }, callback);
1338
2002
  }
1339
2003
  return callback(err2);
1340
2004
  }
1341
- if (!isLockStale(stat2, options)) {
2005
+ if (!isLockStale(stat4, options)) {
1342
2006
  return callback(Object.assign(new Error("Lock file is already being held"), { code: "ELOCKED", file }));
1343
2007
  }
1344
2008
  removeLock(file, options, (err3) => {
@@ -1350,8 +2014,8 @@ var require_lockfile = __commonJS((exports, module) => {
1350
2014
  });
1351
2015
  });
1352
2016
  }
1353
- function isLockStale(stat2, options) {
1354
- return stat2.mtime.getTime() < Date.now() - options.stale;
2017
+ function isLockStale(stat4, options) {
2018
+ return stat4.mtime.getTime() < Date.now() - options.stale;
1355
2019
  }
1356
2020
  function removeLock(file, options, callback) {
1357
2021
  options.fs.rmdir(getLockFile(file, options), (err) => {
@@ -1369,7 +2033,7 @@ var require_lockfile = __commonJS((exports, module) => {
1369
2033
  lock2.updateDelay = lock2.updateDelay || options.update;
1370
2034
  lock2.updateTimeout = setTimeout(() => {
1371
2035
  lock2.updateTimeout = null;
1372
- options.fs.stat(lock2.lockfilePath, (err, stat2) => {
2036
+ options.fs.stat(lock2.lockfilePath, (err, stat4) => {
1373
2037
  const isOverThreshold = lock2.lastUpdate + options.stale < Date.now();
1374
2038
  if (err) {
1375
2039
  if (err.code === "ENOENT" || isOverThreshold) {
@@ -1378,7 +2042,7 @@ var require_lockfile = __commonJS((exports, module) => {
1378
2042
  lock2.updateDelay = 1000;
1379
2043
  return updateLock(file, options);
1380
2044
  }
1381
- const isMtimeOurs = lock2.mtime.getTime() === stat2.mtime.getTime();
2045
+ const isMtimeOurs = lock2.mtime.getTime() === stat4.mtime.getTime();
1382
2046
  if (!isMtimeOurs) {
1383
2047
  return setLockAsCompromised(file, lock2, Object.assign(new Error("Unable to update lock within the stale threshold"), { code: "ECOMPROMISED" }));
1384
2048
  }
@@ -1496,11 +2160,11 @@ var require_lockfile = __commonJS((exports, module) => {
1496
2160
  if (err) {
1497
2161
  return callback(err);
1498
2162
  }
1499
- options.fs.stat(getLockFile(file2, options), (err2, stat2) => {
2163
+ options.fs.stat(getLockFile(file2, options), (err2, stat4) => {
1500
2164
  if (err2) {
1501
2165
  return err2.code === "ENOENT" ? callback(null, false) : callback(err2);
1502
2166
  }
1503
- return callback(null, !isLockStale(stat2, options));
2167
+ return callback(null, !isLockStale(stat4, options));
1504
2168
  });
1505
2169
  });
1506
2170
  }
@@ -1633,7 +2297,7 @@ var _lockfile;
1633
2297
 
1634
2298
  // src/costrict/provider/credentialsStore.ts
1635
2299
  import { promises as fs3, existsSync } from "fs";
1636
- import { join } from "path";
2300
+ import { join as join3 } from "path";
1637
2301
 
1638
2302
  class CoStrictCredentialsStore {
1639
2303
  configDir;
@@ -1641,7 +2305,7 @@ class CoStrictCredentialsStore {
1641
2305
  this.configDir = configDir;
1642
2306
  }
1643
2307
  getPath() {
1644
- return join(this.configDir, "auth.json");
2308
+ return join3(this.configDir, "auth.json");
1645
2309
  }
1646
2310
  async load() {
1647
2311
  try {
@@ -1730,17 +2394,17 @@ class CoStrictCredentialsStore {
1730
2394
  var init_credentialsStore = () => {};
1731
2395
 
1732
2396
  // src/costrict/provider/credentials.ts
1733
- import { join as join2 } from "path";
2397
+ import { join as join4 } from "path";
1734
2398
  import { createHash } from "crypto";
1735
- import { homedir } from "os";
2399
+ import { homedir as homedir2 } from "os";
1736
2400
  function getCoStrictCredentialsDir() {
1737
- return join2(homedir(), ".costrict", "share");
2401
+ return join4(homedir2(), ".costrict", "share");
1738
2402
  }
1739
2403
  function generateMachineId() {
1740
- const os2 = __require("os");
1741
- const platform = os2.platform();
1742
- const hostname = os2.hostname();
1743
- const username = os2.userInfo().username;
2404
+ const os = __require("os");
2405
+ const platform = os.platform();
2406
+ const hostname = os.hostname();
2407
+ const username = os.userInfo().username;
1744
2408
  const machineInfo = `${platform}-${hostname}-${username}`;
1745
2409
  return createHash("sha256").update(machineInfo).digest("hex");
1746
2410
  }
@@ -3332,6 +3996,7 @@ var init_commands_descriptions = __esm(() => {
3332
3996
  "commands.desc.thinkback": "Your 2025 CoStrict Year in Review",
3333
3997
  "commands.desc.thinkbackPlay": "Play the thinkback animation",
3334
3998
  "commands.desc.tui": "Toggle TUI alternate-screen mode",
3999
+ "commands.desc.ultracode": "Launch a dynamic multi-agent coding workflow",
3335
4000
  "commands.desc.ultraplan": "CoStrict on the web drafts an advanced plan you can edit and approve",
3336
4001
  "commands.desc.upgrade": "Upgrade to Max for higher rate limits and more Opus",
3337
4002
  "commands.desc.usage": "Show session cost, plan usage, and activity stats",
@@ -3905,6 +4570,15 @@ Example: /fork Fix the null check in validate.ts`,
3905
4570
  "commands.skillStore.noPublishedVersions": "Skill {id} has no published versions to install.",
3906
4571
  "commands.skillStore.installed": "Skill installed to {path}",
3907
4572
  "commands.skillStore.installFailed": "Failed to install skill {id}: {error}",
4573
+ "commands.skillInstall.installed": "Skill {name} installed as {targetName} at {path}",
4574
+ "commands.skillInstall.notFound": "No cloud skill found for {spec}. Use an exact skill slug or UUID.",
4575
+ "commands.skillInstall.invalidScope": "Invalid skill install scope {scope}. Use user or project.",
4576
+ "commands.skillInstall.alreadyExists": "Skill already exists at {path}. Use --force to overwrite it.",
4577
+ "commands.skillInstall.unsupportedType": "Cloud item {spec} is type {type}, not a skill.",
4578
+ "commands.skillInstall.missingContent": "Cloud skill {slug} has no installable content.",
4579
+ "commands.skillInstall.invalidName": "Invalid skill install name {name}. Use letters, numbers, underscores, or hyphens.",
4580
+ "commands.skillInstall.invalidResponse": "Cloud response for {spec} is missing required skill fields.",
4581
+ "commands.skillInstall.failed": "Failed to install skill {spec}: {error}",
3908
4582
  "commands.agentsPlatform.listEmpty": "No scheduled agents found.",
3909
4583
  "commands.agentsPlatform.listCount": "{count} scheduled agent(s).",
3910
4584
  "commands.agentsPlatform.listFailed": "Failed to list agents: {error}",
@@ -4024,6 +4698,10 @@ Start a new session at {url}`,
4024
4698
  "commands.teleport.failed": "Teleport failed: {error}",
4025
4699
  "commands.teleport.availableSessions": "## Available sessions (most recent first)",
4026
4700
  "commands.teleport.hint": "Run `/teleport <session-id>` to resume a session.",
4701
+ "commands.ultracode.permissionUnavailable": "Unable to launch /ultracode: tool permission handler is unavailable.",
4702
+ "commands.ultracode.denied": "Ultracode was not launched: {message}",
4703
+ "commands.ultracode.notLaunched": "Ultracode was not launched.",
4704
+ "commands.ultracode.launched": "Ultracode workflow launched in the background (task id: {taskId}, run id: {runId}). Use /dynamic-workflows to watch progress.",
4027
4705
  "commands.autofixPr.failed": "Autofix PR failed: {error}",
4028
4706
  "commands.autofixPr.noMonitor": "No active autofix monitor.",
4029
4707
  "commands.autofixPr.stopped": "Stopped local monitoring of {repo}#{prNumber}. Any already-running remote session continues until it finishes or is cancelled from {domain}/code.",
@@ -4879,6 +5557,8 @@ var init_cli = __esm(() => {
4879
5557
  "cli.cmd.pluginValidate": "Validate a plugin or marketplace manifest",
4880
5558
  "cli.cmd.serve": "Start a CoStrict HTTP API server",
4881
5559
  "cli.cmd.server": "Start a CoStrict session server (alias: serve)",
5560
+ "cli.cmd.skill": "Install cloud skills",
5561
+ "cli.cmd.skillInstall": "Install a cloud skill by UUID or exact slug",
4882
5562
  "cli.cmd.ssh": "SSH into a remote machine and start CoStrict",
4883
5563
  "cli.cmd.sshi": "SSH interactive login with CoStrict session management",
4884
5564
  "cli.cmd.status": "Show authentication status",
@@ -5004,6 +5684,10 @@ var init_cli = __esm(() => {
5004
5684
  "cli.option.rewindFiles": "Restore files to state at the specified user message and exit (requires --resume)",
5005
5685
  "cli.option.safe": "Roll back to the server-pinned safe version",
5006
5686
  "cli.option.scope": "Configuration scope (local, user, or project)",
5687
+ "cli.option.skillInstallDir": "Custom skills root directory (overrides --scope)",
5688
+ "cli.option.skillInstallForce": "Overwrite an existing SKILL.md",
5689
+ "cli.option.skillInstallName": "Target skill directory and invocation name",
5690
+ "cli.option.skillInstallScope": "Install scope: user or project",
5007
5691
  "cli.option.sdkUrl": "Use remote WebSocket endpoint for SDK I/O streaming (only with -p and stream-json format)",
5008
5692
  "cli.option.sessionId": "Resume a session by ID",
5009
5693
  "cli.option.sessionIdArg": "Use a specific session ID for the conversation (must be a valid UUID)",
@@ -6151,8 +6835,6 @@ var init_ui_plugins = __esm(() => {
6151
6835
  "plugins.installed.partial": "Installed {success}/{total} plugins",
6152
6836
  "plugins.installed.plugins": "Installed plugins (",
6153
6837
  "plugins.installing": "Installing\u2026",
6154
- "plugins.installs": "installs",
6155
- "plugins.installs_2": "installs",
6156
6838
  "plugins.is.enabled.in.costrictsettingsjson.shared.with.your.team": "is enabled in .costrict/settings.json (shared with your team)",
6157
6839
  "plugins.loading": "Loading\u2026",
6158
6840
  "plugins.loading_2": "Loading\u2026",
@@ -7853,6 +8535,7 @@ var init_commands_descriptions2 = __esm(() => {
7853
8535
  "commands.desc.thinkback": "\u60A8\u7684 2025 CoStrict \u5E74\u5EA6\u56DE\u987E",
7854
8536
  "commands.desc.thinkbackPlay": "\u64AD\u653E\u5E74\u5EA6\u56DE\u987E\u52A8\u753B",
7855
8537
  "commands.desc.tui": "\u5207\u6362 TUI \u5907\u7528\u5C4F\u5E55\u6A21\u5F0F",
8538
+ "commands.desc.ultracode": "\u542F\u52A8DynamicWorkflow\u673A\u5236",
7856
8539
  "commands.desc.ultraplan": "CoStrict \u7F51\u9875\u7AEF\u81EA\u52A8\u8D77\u8349\u9AD8\u7EA7\u8BA1\u5212\uFF0C\u53EF\u7F16\u8F91\u548C\u5BA1\u6279",
7857
8540
  "commands.desc.upgrade": "\u5347\u7EA7\u5230 Max \u83B7\u53D6\u66F4\u9AD8\u901F\u7387\u9650\u5236\u548C\u66F4\u591A Opus",
7858
8541
  "commands.desc.usage": "\u663E\u793A\u4F1A\u8BDD\u6210\u672C\u3001\u8BA1\u5212\u7528\u91CF\u548C\u6D3B\u52A8\u7EDF\u8BA1",
@@ -8424,6 +9107,15 @@ var init_commands_others2 = __esm(() => {
8424
9107
  "commands.skillStore.noPublishedVersions": "\u6280\u80FD {id} \u6CA1\u6709\u5DF2\u53D1\u5E03\u7684\u7248\u672C\u53EF\u4F9B\u5B89\u88C5\u3002",
8425
9108
  "commands.skillStore.installed": "\u6280\u80FD\u5DF2\u5B89\u88C5\u5230 {path}",
8426
9109
  "commands.skillStore.installFailed": "\u5B89\u88C5\u6280\u80FD {id} \u5931\u8D25\uFF1A{error}",
9110
+ "commands.skillInstall.installed": "\u6280\u80FD {name} \u5DF2\u5B89\u88C5\u4E3A {targetName}\uFF0C\u8DEF\u5F84\uFF1A{path}",
9111
+ "commands.skillInstall.notFound": "\u672A\u627E\u5230\u4E91\u7AEF\u6280\u80FD {spec}\u3002\u8BF7\u4F7F\u7528\u7CBE\u786E\u7684\u6280\u80FD slug \u6216 UUID\u3002",
9112
+ "commands.skillInstall.invalidScope": "\u65E0\u6548\u7684\u6280\u80FD\u5B89\u88C5\u8303\u56F4 {scope}\u3002\u8BF7\u4F7F\u7528 user \u6216 project\u3002",
9113
+ "commands.skillInstall.alreadyExists": "\u6280\u80FD\u5DF2\u5B58\u5728\u4E8E {path}\u3002\u4F7F\u7528 --force \u53EF\u8986\u76D6\u3002",
9114
+ "commands.skillInstall.unsupportedType": "\u4E91\u7AEF\u9879\u76EE {spec} \u7684\u7C7B\u578B\u662F {type}\uFF0C\u4E0D\u662F\u6280\u80FD\u3002",
9115
+ "commands.skillInstall.missingContent": "\u4E91\u7AEF\u6280\u80FD {slug} \u6CA1\u6709\u53EF\u5B89\u88C5\u5185\u5BB9\u3002",
9116
+ "commands.skillInstall.invalidName": "\u65E0\u6548\u7684\u6280\u80FD\u5B89\u88C5\u540D\u79F0 {name}\u3002\u8BF7\u4F7F\u7528\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u4E0B\u5212\u7EBF\u6216\u8FDE\u5B57\u7B26\u3002",
9117
+ "commands.skillInstall.invalidResponse": "\u4E91\u7AEF\u54CD\u5E94 {spec} \u7F3A\u5C11\u5FC5\u9700\u7684\u6280\u80FD\u5B57\u6BB5\u3002",
9118
+ "commands.skillInstall.failed": "\u5B89\u88C5\u6280\u80FD {spec} \u5931\u8D25\uFF1A{error}",
8427
9119
  "commands.agentsPlatform.listEmpty": "\u672A\u627E\u5230\u5B9A\u65F6\u4EE3\u7406\u3002",
8428
9120
  "commands.agentsPlatform.listCount": "{count} \u4E2A\u5B9A\u65F6\u4EE3\u7406\u3002",
8429
9121
  "commands.agentsPlatform.listFailed": "\u5217\u51FA\u4EE3\u7406\u5931\u8D25\uFF1A{error}",
@@ -8543,6 +9235,10 @@ var init_commands_others2 = __esm(() => {
8543
9235
  "commands.teleport.failed": "Teleport \u5931\u8D25\uFF1A{error}",
8544
9236
  "commands.teleport.availableSessions": "## \u53EF\u7528\u4F1A\u8BDD\uFF08\u6700\u8FD1\u4F18\u5148\uFF09",
8545
9237
  "commands.teleport.hint": "\u8FD0\u884C `/teleport <\u4F1A\u8BDDID>` \u6062\u590D\u4F1A\u8BDD\u3002",
9238
+ "commands.ultracode.permissionUnavailable": "\u65E0\u6CD5\u542F\u52A8 /ultracode\uFF1A\u5DE5\u5177\u6743\u9650\u5904\u7406\u5668\u4E0D\u53EF\u7528\u3002",
9239
+ "commands.ultracode.denied": "Ultracode \u672A\u542F\u52A8\uFF1A{message}",
9240
+ "commands.ultracode.notLaunched": "Ultracode \u672A\u542F\u52A8\u3002",
9241
+ "commands.ultracode.launched": "Ultracode \u5DE5\u4F5C\u6D41\u5DF2\u5728\u540E\u53F0\u542F\u52A8\uFF08\u4EFB\u52A1 ID\uFF1A{taskId}\uFF0C\u8FD0\u884C ID\uFF1A{runId}\uFF09\u3002\u53EF\u4F7F\u7528 /dynamic-workflows \u67E5\u770B\u8FDB\u5EA6\u3002",
8546
9242
  "commands.autofixPr.failed": "Autofix PR \u5931\u8D25\uFF1A{error}",
8547
9243
  "commands.autofixPr.noMonitor": "\u6CA1\u6709\u6D3B\u8DC3\u7684 autofix \u76D1\u63A7\u5668\u3002",
8548
9244
  "commands.autofixPr.stopped": "\u5DF2\u505C\u6B62\u5BF9 {repo}#{prNumber} \u7684\u672C\u5730\u76D1\u63A7\u3002\u4EFB\u4F55\u5DF2\u5728\u8FD0\u884C\u7684\u8FDC\u7A0B\u4F1A\u8BDD\u5C06\u7EE7\u7EED\u8FD0\u884C\u76F4\u5230\u5B8C\u6210\u6216\u4ECE {domain}/code \u53D6\u6D88\u3002",
@@ -9397,6 +10093,8 @@ var init_cli2 = __esm(() => {
9397
10093
  "cli.cmd.pluginValidate": "\u9A8C\u8BC1\u63D2\u4EF6\u6216\u5E02\u573A\u6E05\u5355\u6587\u4EF6",
9398
10094
  "cli.cmd.serve": "\u542F\u52A8 CoStrict HTTP API \u670D\u52A1\u5668",
9399
10095
  "cli.cmd.server": "\u542F\u52A8 CoStrict \u4F1A\u8BDD\u670D\u52A1\u5668\uFF08\u522B\u540D\uFF1Aserve\uFF09",
10096
+ "cli.cmd.skill": "\u5B89\u88C5\u4E91\u7AEF\u6280\u80FD",
10097
+ "cli.cmd.skillInstall": "\u901A\u8FC7 UUID \u6216\u7CBE\u786E slug \u5B89\u88C5\u4E91\u7AEF\u6280\u80FD",
9400
10098
  "cli.cmd.ssh": "SSH \u767B\u5F55\u8FDC\u7A0B\u673A\u5668\u5E76\u542F\u52A8 CoStrict",
9401
10099
  "cli.cmd.sshi": "SSH \u4EA4\u4E92\u5F0F\u767B\u5F55\u53CA CoStrict \u4F1A\u8BDD\u7BA1\u7406",
9402
10100
  "cli.cmd.status": "\u663E\u793A\u8BA4\u8BC1\u72B6\u6001",
@@ -9522,6 +10220,10 @@ var init_cli2 = __esm(() => {
9522
10220
  "cli.option.rewindFiles": "\u5C06\u6587\u4EF6\u6062\u590D\u5230\u6307\u5B9A\u7528\u6237\u6D88\u606F\u65F6\u7684\u72B6\u6001\u5E76\u9000\u51FA\uFF08\u9700\u8981 --resume\uFF09",
9523
10221
  "cli.option.safe": "\u56DE\u6EDA\u5230\u670D\u52A1\u5668\u56FA\u5B9A\u7684\u5B89\u5168\u7248\u672C",
9524
10222
  "cli.option.scope": "\u914D\u7F6E\u8303\u56F4\uFF08local, user \u6216 project\uFF09",
10223
+ "cli.option.skillInstallDir": "\u81EA\u5B9A\u4E49\u6280\u80FD\u6839\u76EE\u5F55\uFF08\u8986\u76D6 --scope\uFF09",
10224
+ "cli.option.skillInstallForce": "\u8986\u76D6\u5DF2\u6709\u7684 SKILL.md",
10225
+ "cli.option.skillInstallName": "\u76EE\u6807\u6280\u80FD\u76EE\u5F55\u548C\u8C03\u7528\u540D\u79F0",
10226
+ "cli.option.skillInstallScope": "\u5B89\u88C5\u8303\u56F4\uFF1Auser \u6216 project",
9525
10227
  "cli.option.sdkUrl": "\u4F7F\u7528\u8FDC\u7A0B WebSocket \u7AEF\u70B9\u8FDB\u884C SDK I/O \u6D41\u5F0F\u4F20\u8F93\uFF08\u4EC5\u4E0E -p \u548C stream-json \u683C\u5F0F\u914D\u5408\u4F7F\u7528\uFF09",
9526
10228
  "cli.option.sessionId": "\u6309 ID \u6062\u590D\u4F1A\u8BDD",
9527
10229
  "cli.option.sessionIdArg": "\u4E3A\u5BF9\u8BDD\u4F7F\u7528\u7279\u5B9A\u7684\u4F1A\u8BDD ID\uFF08\u5FC5\u987B\u662F\u6709\u6548\u7684 UUID\uFF09",
@@ -10668,8 +11370,6 @@ var init_ui_plugins2 = __esm(() => {
10668
11370
  "plugins.installed.partial": "\u5DF2\u5B89\u88C5 {success}/{total} \u4E2A\u63D2\u4EF6",
10669
11371
  "plugins.installed.plugins": "\u5DF2\u5B89\u88C5\u63D2\u4EF6\uFF08",
10670
11372
  "plugins.installing": "\u6B63\u5728\u5B89\u88C5\u2026",
10671
- "plugins.installs": "\u5B89\u88C5\u91CF",
10672
- "plugins.installs_2": "\u5B89\u88C5\u91CF",
10673
11373
  "plugins.is.enabled.in.costrictsettingsjson.shared.with.your.team": "\u5DF2\u5728 .costrict/settings.json \u4E2D\u542F\u7528\uFF08\u4E0E\u4F60\u7684\u56E2\u961F\u5171\u4EAB\uFF09",
10674
11374
  "plugins.loading": "\u52A0\u8F7D\u4E2D\u2026",
10675
11375
  "plugins.loading_2": "\u52A0\u8F7D\u4E2D\u2026",
@@ -10880,552 +11580,6 @@ var init_tips2 = __esm(() => {
10880
11580
  };
10881
11581
  });
10882
11582
 
10883
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js
10884
- var freeGlobal, _freeGlobal_default;
10885
- var init__freeGlobal = __esm(() => {
10886
- freeGlobal = typeof global == "object" && global && global.Object === Object && global;
10887
- _freeGlobal_default = freeGlobal;
10888
- });
10889
-
10890
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js
10891
- var freeSelf, root, _root_default;
10892
- var init__root = __esm(() => {
10893
- init__freeGlobal();
10894
- freeSelf = typeof self == "object" && self && self.Object === Object && self;
10895
- root = _freeGlobal_default || freeSelf || Function("return this")();
10896
- _root_default = root;
10897
- });
10898
-
10899
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js
10900
- var Symbol2, _Symbol_default;
10901
- var init__Symbol = __esm(() => {
10902
- init__root();
10903
- Symbol2 = _root_default.Symbol;
10904
- _Symbol_default = Symbol2;
10905
- });
10906
-
10907
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js
10908
- function getRawTag(value) {
10909
- var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
10910
- try {
10911
- value[symToStringTag] = undefined;
10912
- var unmasked = true;
10913
- } catch (e) {}
10914
- var result = nativeObjectToString.call(value);
10915
- if (unmasked) {
10916
- if (isOwn) {
10917
- value[symToStringTag] = tag;
10918
- } else {
10919
- delete value[symToStringTag];
10920
- }
10921
- }
10922
- return result;
10923
- }
10924
- var objectProto, hasOwnProperty, nativeObjectToString, symToStringTag, _getRawTag_default;
10925
- var init__getRawTag = __esm(() => {
10926
- init__Symbol();
10927
- objectProto = Object.prototype;
10928
- hasOwnProperty = objectProto.hasOwnProperty;
10929
- nativeObjectToString = objectProto.toString;
10930
- symToStringTag = _Symbol_default ? _Symbol_default.toStringTag : undefined;
10931
- _getRawTag_default = getRawTag;
10932
- });
10933
-
10934
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js
10935
- function objectToString(value) {
10936
- return nativeObjectToString2.call(value);
10937
- }
10938
- var objectProto2, nativeObjectToString2, _objectToString_default;
10939
- var init__objectToString = __esm(() => {
10940
- objectProto2 = Object.prototype;
10941
- nativeObjectToString2 = objectProto2.toString;
10942
- _objectToString_default = objectToString;
10943
- });
10944
-
10945
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js
10946
- function baseGetTag(value) {
10947
- if (value == null) {
10948
- return value === undefined ? undefinedTag : nullTag;
10949
- }
10950
- return symToStringTag2 && symToStringTag2 in Object(value) ? _getRawTag_default(value) : _objectToString_default(value);
10951
- }
10952
- var nullTag = "[object Null]", undefinedTag = "[object Undefined]", symToStringTag2, _baseGetTag_default;
10953
- var init__baseGetTag = __esm(() => {
10954
- init__Symbol();
10955
- init__getRawTag();
10956
- init__objectToString();
10957
- symToStringTag2 = _Symbol_default ? _Symbol_default.toStringTag : undefined;
10958
- _baseGetTag_default = baseGetTag;
10959
- });
10960
-
10961
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js
10962
- function isObject(value) {
10963
- var type = typeof value;
10964
- return value != null && (type == "object" || type == "function");
10965
- }
10966
- var isObject_default;
10967
- var init_isObject = __esm(() => {
10968
- isObject_default = isObject;
10969
- });
10970
-
10971
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js
10972
- function isFunction(value) {
10973
- if (!isObject_default(value)) {
10974
- return false;
10975
- }
10976
- var tag = _baseGetTag_default(value);
10977
- return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
10978
- }
10979
- var asyncTag = "[object AsyncFunction]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]", isFunction_default;
10980
- var init_isFunction = __esm(() => {
10981
- init__baseGetTag();
10982
- init_isObject();
10983
- isFunction_default = isFunction;
10984
- });
10985
-
10986
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js
10987
- var coreJsData, _coreJsData_default;
10988
- var init__coreJsData = __esm(() => {
10989
- init__root();
10990
- coreJsData = _root_default["__core-js_shared__"];
10991
- _coreJsData_default = coreJsData;
10992
- });
10993
-
10994
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js
10995
- function isMasked(func) {
10996
- return !!maskSrcKey && maskSrcKey in func;
10997
- }
10998
- var maskSrcKey, _isMasked_default;
10999
- var init__isMasked = __esm(() => {
11000
- init__coreJsData();
11001
- maskSrcKey = function() {
11002
- var uid = /[^.]+$/.exec(_coreJsData_default && _coreJsData_default.keys && _coreJsData_default.keys.IE_PROTO || "");
11003
- return uid ? "Symbol(src)_1." + uid : "";
11004
- }();
11005
- _isMasked_default = isMasked;
11006
- });
11007
-
11008
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js
11009
- function toSource(func) {
11010
- if (func != null) {
11011
- try {
11012
- return funcToString.call(func);
11013
- } catch (e) {}
11014
- try {
11015
- return func + "";
11016
- } catch (e) {}
11017
- }
11018
- return "";
11019
- }
11020
- var funcProto, funcToString, _toSource_default;
11021
- var init__toSource = __esm(() => {
11022
- funcProto = Function.prototype;
11023
- funcToString = funcProto.toString;
11024
- _toSource_default = toSource;
11025
- });
11026
-
11027
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js
11028
- function baseIsNative(value) {
11029
- if (!isObject_default(value) || _isMasked_default(value)) {
11030
- return false;
11031
- }
11032
- var pattern = isFunction_default(value) ? reIsNative : reIsHostCtor;
11033
- return pattern.test(_toSource_default(value));
11034
- }
11035
- var reRegExpChar, reIsHostCtor, funcProto2, objectProto3, funcToString2, hasOwnProperty2, reIsNative, _baseIsNative_default;
11036
- var init__baseIsNative = __esm(() => {
11037
- init_isFunction();
11038
- init__isMasked();
11039
- init_isObject();
11040
- init__toSource();
11041
- reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
11042
- reIsHostCtor = /^\[object .+?Constructor\]$/;
11043
- funcProto2 = Function.prototype;
11044
- objectProto3 = Object.prototype;
11045
- funcToString2 = funcProto2.toString;
11046
- hasOwnProperty2 = objectProto3.hasOwnProperty;
11047
- reIsNative = RegExp("^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
11048
- _baseIsNative_default = baseIsNative;
11049
- });
11050
-
11051
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js
11052
- function getValue(object, key) {
11053
- return object == null ? undefined : object[key];
11054
- }
11055
- var _getValue_default;
11056
- var init__getValue = __esm(() => {
11057
- _getValue_default = getValue;
11058
- });
11059
-
11060
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js
11061
- function getNative(object, key) {
11062
- var value = _getValue_default(object, key);
11063
- return _baseIsNative_default(value) ? value : undefined;
11064
- }
11065
- var _getNative_default;
11066
- var init__getNative = __esm(() => {
11067
- init__baseIsNative();
11068
- init__getValue();
11069
- _getNative_default = getNative;
11070
- });
11071
-
11072
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js
11073
- var nativeCreate, _nativeCreate_default;
11074
- var init__nativeCreate = __esm(() => {
11075
- init__getNative();
11076
- nativeCreate = _getNative_default(Object, "create");
11077
- _nativeCreate_default = nativeCreate;
11078
- });
11079
-
11080
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js
11081
- function hashClear() {
11082
- this.__data__ = _nativeCreate_default ? _nativeCreate_default(null) : {};
11083
- this.size = 0;
11084
- }
11085
- var _hashClear_default;
11086
- var init__hashClear = __esm(() => {
11087
- init__nativeCreate();
11088
- _hashClear_default = hashClear;
11089
- });
11090
-
11091
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js
11092
- function hashDelete(key) {
11093
- var result = this.has(key) && delete this.__data__[key];
11094
- this.size -= result ? 1 : 0;
11095
- return result;
11096
- }
11097
- var _hashDelete_default;
11098
- var init__hashDelete = __esm(() => {
11099
- _hashDelete_default = hashDelete;
11100
- });
11101
-
11102
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js
11103
- function hashGet(key) {
11104
- var data = this.__data__;
11105
- if (_nativeCreate_default) {
11106
- var result = data[key];
11107
- return result === HASH_UNDEFINED ? undefined : result;
11108
- }
11109
- return hasOwnProperty3.call(data, key) ? data[key] : undefined;
11110
- }
11111
- var HASH_UNDEFINED = "__lodash_hash_undefined__", objectProto4, hasOwnProperty3, _hashGet_default;
11112
- var init__hashGet = __esm(() => {
11113
- init__nativeCreate();
11114
- objectProto4 = Object.prototype;
11115
- hasOwnProperty3 = objectProto4.hasOwnProperty;
11116
- _hashGet_default = hashGet;
11117
- });
11118
-
11119
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js
11120
- function hashHas(key) {
11121
- var data = this.__data__;
11122
- return _nativeCreate_default ? data[key] !== undefined : hasOwnProperty4.call(data, key);
11123
- }
11124
- var objectProto5, hasOwnProperty4, _hashHas_default;
11125
- var init__hashHas = __esm(() => {
11126
- init__nativeCreate();
11127
- objectProto5 = Object.prototype;
11128
- hasOwnProperty4 = objectProto5.hasOwnProperty;
11129
- _hashHas_default = hashHas;
11130
- });
11131
-
11132
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js
11133
- function hashSet(key, value) {
11134
- var data = this.__data__;
11135
- this.size += this.has(key) ? 0 : 1;
11136
- data[key] = _nativeCreate_default && value === undefined ? HASH_UNDEFINED2 : value;
11137
- return this;
11138
- }
11139
- var HASH_UNDEFINED2 = "__lodash_hash_undefined__", _hashSet_default;
11140
- var init__hashSet = __esm(() => {
11141
- init__nativeCreate();
11142
- _hashSet_default = hashSet;
11143
- });
11144
-
11145
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js
11146
- function Hash(entries) {
11147
- var index = -1, length = entries == null ? 0 : entries.length;
11148
- this.clear();
11149
- while (++index < length) {
11150
- var entry = entries[index];
11151
- this.set(entry[0], entry[1]);
11152
- }
11153
- }
11154
- var _Hash_default;
11155
- var init__Hash = __esm(() => {
11156
- init__hashClear();
11157
- init__hashDelete();
11158
- init__hashGet();
11159
- init__hashHas();
11160
- init__hashSet();
11161
- Hash.prototype.clear = _hashClear_default;
11162
- Hash.prototype["delete"] = _hashDelete_default;
11163
- Hash.prototype.get = _hashGet_default;
11164
- Hash.prototype.has = _hashHas_default;
11165
- Hash.prototype.set = _hashSet_default;
11166
- _Hash_default = Hash;
11167
- });
11168
-
11169
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js
11170
- function listCacheClear() {
11171
- this.__data__ = [];
11172
- this.size = 0;
11173
- }
11174
- var _listCacheClear_default;
11175
- var init__listCacheClear = __esm(() => {
11176
- _listCacheClear_default = listCacheClear;
11177
- });
11178
-
11179
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js
11180
- function eq(value, other) {
11181
- return value === other || value !== value && other !== other;
11182
- }
11183
- var eq_default;
11184
- var init_eq = __esm(() => {
11185
- eq_default = eq;
11186
- });
11187
-
11188
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js
11189
- function assocIndexOf(array, key) {
11190
- var length = array.length;
11191
- while (length--) {
11192
- if (eq_default(array[length][0], key)) {
11193
- return length;
11194
- }
11195
- }
11196
- return -1;
11197
- }
11198
- var _assocIndexOf_default;
11199
- var init__assocIndexOf = __esm(() => {
11200
- init_eq();
11201
- _assocIndexOf_default = assocIndexOf;
11202
- });
11203
-
11204
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js
11205
- function listCacheDelete(key) {
11206
- var data = this.__data__, index = _assocIndexOf_default(data, key);
11207
- if (index < 0) {
11208
- return false;
11209
- }
11210
- var lastIndex = data.length - 1;
11211
- if (index == lastIndex) {
11212
- data.pop();
11213
- } else {
11214
- splice.call(data, index, 1);
11215
- }
11216
- --this.size;
11217
- return true;
11218
- }
11219
- var arrayProto, splice, _listCacheDelete_default;
11220
- var init__listCacheDelete = __esm(() => {
11221
- init__assocIndexOf();
11222
- arrayProto = Array.prototype;
11223
- splice = arrayProto.splice;
11224
- _listCacheDelete_default = listCacheDelete;
11225
- });
11226
-
11227
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js
11228
- function listCacheGet(key) {
11229
- var data = this.__data__, index = _assocIndexOf_default(data, key);
11230
- return index < 0 ? undefined : data[index][1];
11231
- }
11232
- var _listCacheGet_default;
11233
- var init__listCacheGet = __esm(() => {
11234
- init__assocIndexOf();
11235
- _listCacheGet_default = listCacheGet;
11236
- });
11237
-
11238
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js
11239
- function listCacheHas(key) {
11240
- return _assocIndexOf_default(this.__data__, key) > -1;
11241
- }
11242
- var _listCacheHas_default;
11243
- var init__listCacheHas = __esm(() => {
11244
- init__assocIndexOf();
11245
- _listCacheHas_default = listCacheHas;
11246
- });
11247
-
11248
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js
11249
- function listCacheSet(key, value) {
11250
- var data = this.__data__, index = _assocIndexOf_default(data, key);
11251
- if (index < 0) {
11252
- ++this.size;
11253
- data.push([key, value]);
11254
- } else {
11255
- data[index][1] = value;
11256
- }
11257
- return this;
11258
- }
11259
- var _listCacheSet_default;
11260
- var init__listCacheSet = __esm(() => {
11261
- init__assocIndexOf();
11262
- _listCacheSet_default = listCacheSet;
11263
- });
11264
-
11265
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js
11266
- function ListCache(entries) {
11267
- var index = -1, length = entries == null ? 0 : entries.length;
11268
- this.clear();
11269
- while (++index < length) {
11270
- var entry = entries[index];
11271
- this.set(entry[0], entry[1]);
11272
- }
11273
- }
11274
- var _ListCache_default;
11275
- var init__ListCache = __esm(() => {
11276
- init__listCacheClear();
11277
- init__listCacheDelete();
11278
- init__listCacheGet();
11279
- init__listCacheHas();
11280
- init__listCacheSet();
11281
- ListCache.prototype.clear = _listCacheClear_default;
11282
- ListCache.prototype["delete"] = _listCacheDelete_default;
11283
- ListCache.prototype.get = _listCacheGet_default;
11284
- ListCache.prototype.has = _listCacheHas_default;
11285
- ListCache.prototype.set = _listCacheSet_default;
11286
- _ListCache_default = ListCache;
11287
- });
11288
-
11289
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js
11290
- var Map2, _Map_default;
11291
- var init__Map = __esm(() => {
11292
- init__getNative();
11293
- init__root();
11294
- Map2 = _getNative_default(_root_default, "Map");
11295
- _Map_default = Map2;
11296
- });
11297
-
11298
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js
11299
- function mapCacheClear() {
11300
- this.size = 0;
11301
- this.__data__ = {
11302
- hash: new _Hash_default,
11303
- map: new (_Map_default || _ListCache_default),
11304
- string: new _Hash_default
11305
- };
11306
- }
11307
- var _mapCacheClear_default;
11308
- var init__mapCacheClear = __esm(() => {
11309
- init__Hash();
11310
- init__ListCache();
11311
- init__Map();
11312
- _mapCacheClear_default = mapCacheClear;
11313
- });
11314
-
11315
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js
11316
- function isKeyable(value) {
11317
- var type = typeof value;
11318
- return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
11319
- }
11320
- var _isKeyable_default;
11321
- var init__isKeyable = __esm(() => {
11322
- _isKeyable_default = isKeyable;
11323
- });
11324
-
11325
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js
11326
- function getMapData(map, key) {
11327
- var data = map.__data__;
11328
- return _isKeyable_default(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
11329
- }
11330
- var _getMapData_default;
11331
- var init__getMapData = __esm(() => {
11332
- init__isKeyable();
11333
- _getMapData_default = getMapData;
11334
- });
11335
-
11336
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js
11337
- function mapCacheDelete(key) {
11338
- var result = _getMapData_default(this, key)["delete"](key);
11339
- this.size -= result ? 1 : 0;
11340
- return result;
11341
- }
11342
- var _mapCacheDelete_default;
11343
- var init__mapCacheDelete = __esm(() => {
11344
- init__getMapData();
11345
- _mapCacheDelete_default = mapCacheDelete;
11346
- });
11347
-
11348
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js
11349
- function mapCacheGet(key) {
11350
- return _getMapData_default(this, key).get(key);
11351
- }
11352
- var _mapCacheGet_default;
11353
- var init__mapCacheGet = __esm(() => {
11354
- init__getMapData();
11355
- _mapCacheGet_default = mapCacheGet;
11356
- });
11357
-
11358
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js
11359
- function mapCacheHas(key) {
11360
- return _getMapData_default(this, key).has(key);
11361
- }
11362
- var _mapCacheHas_default;
11363
- var init__mapCacheHas = __esm(() => {
11364
- init__getMapData();
11365
- _mapCacheHas_default = mapCacheHas;
11366
- });
11367
-
11368
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js
11369
- function mapCacheSet(key, value) {
11370
- var data = _getMapData_default(this, key), size = data.size;
11371
- data.set(key, value);
11372
- this.size += data.size == size ? 0 : 1;
11373
- return this;
11374
- }
11375
- var _mapCacheSet_default;
11376
- var init__mapCacheSet = __esm(() => {
11377
- init__getMapData();
11378
- _mapCacheSet_default = mapCacheSet;
11379
- });
11380
-
11381
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js
11382
- function MapCache(entries) {
11383
- var index = -1, length = entries == null ? 0 : entries.length;
11384
- this.clear();
11385
- while (++index < length) {
11386
- var entry = entries[index];
11387
- this.set(entry[0], entry[1]);
11388
- }
11389
- }
11390
- var _MapCache_default;
11391
- var init__MapCache = __esm(() => {
11392
- init__mapCacheClear();
11393
- init__mapCacheDelete();
11394
- init__mapCacheGet();
11395
- init__mapCacheHas();
11396
- init__mapCacheSet();
11397
- MapCache.prototype.clear = _mapCacheClear_default;
11398
- MapCache.prototype["delete"] = _mapCacheDelete_default;
11399
- MapCache.prototype.get = _mapCacheGet_default;
11400
- MapCache.prototype.has = _mapCacheHas_default;
11401
- MapCache.prototype.set = _mapCacheSet_default;
11402
- _MapCache_default = MapCache;
11403
- });
11404
-
11405
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/memoize.js
11406
- function memoize(func, resolver) {
11407
- if (typeof func != "function" || resolver != null && typeof resolver != "function") {
11408
- throw new TypeError(FUNC_ERROR_TEXT);
11409
- }
11410
- var memoized = function() {
11411
- var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
11412
- if (cache.has(key)) {
11413
- return cache.get(key);
11414
- }
11415
- var result = func.apply(this, args);
11416
- memoized.cache = cache.set(key, result) || cache;
11417
- return result;
11418
- };
11419
- memoized.cache = new (memoize.Cache || _MapCache_default);
11420
- return memoized;
11421
- }
11422
- var FUNC_ERROR_TEXT = "Expected a function", memoize_default;
11423
- var init_memoize = __esm(() => {
11424
- init__MapCache();
11425
- memoize.Cache = _MapCache_default;
11426
- memoize_default = memoize;
11427
- });
11428
-
11429
11583
  // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayMap.js
11430
11584
  function arrayMap(array, iteratee) {
11431
11585
  var index = -1, length = array == null ? 0 : array.length, result = Array(length);
@@ -16136,69 +16290,6 @@ var init_debugFilter = __esm(() => {
16136
16290
  });
16137
16291
  });
16138
16292
 
16139
- // src/constants/branding.ts
16140
- var PRODUCT_URL = "https://costrict.ai", PRODUCT_DOMAIN = "costrict.ai", PRODUCT_DOCS_URL, PRODUCT_CHROME_URL, PRODUCT_SETTINGS_URL, PRODUCT_CODE_URL, PRODUCT_SESSION_URL, PRODUCT_UPGRADE_URL, PRODUCT_DOWNLOAD_URL, PRODUCT_DESKTOP_API_URL, PRODUCT_OAUTH_CLIENT_METADATA_URL, CONFIG_DIR_NAME = ".costrict", LEGACY_CONFIG_DIR_NAME = ".claude", ENV_PREFIX = "COSTRICT", LEGACY_ENV_PREFIX = "CLAUDE_CODE", LEGACY_BRIDGE_ENV_PREFIX = "CLAUDE";
16141
- var init_branding = __esm(() => {
16142
- PRODUCT_DOCS_URL = `${PRODUCT_URL}/docs`;
16143
- PRODUCT_CHROME_URL = `${PRODUCT_URL}/chrome`;
16144
- PRODUCT_SETTINGS_URL = `${PRODUCT_URL}/settings`;
16145
- PRODUCT_CODE_URL = `${PRODUCT_URL}/code`;
16146
- PRODUCT_SESSION_URL = `${PRODUCT_URL}/session`;
16147
- PRODUCT_UPGRADE_URL = `${PRODUCT_URL}/upgrade/max`;
16148
- PRODUCT_DOWNLOAD_URL = `${PRODUCT_URL}/download`;
16149
- PRODUCT_DESKTOP_API_URL = `${PRODUCT_URL}/api/desktop`;
16150
- PRODUCT_OAUTH_CLIENT_METADATA_URL = `${PRODUCT_URL}/oauth/costrict-client-metadata`;
16151
- });
16152
-
16153
- // src/utils/envUtils.ts
16154
- import { homedir as homedir2 } from "os";
16155
- import { join as join3 } from "path";
16156
- function getLegacyConfigHomeDir() {
16157
- if (process.env.COSTRICT_CONFIG_DIR || process.env.CLAUDE_CONFIG_DIR) {
16158
- return;
16159
- }
16160
- return join3(homedir2(), LEGACY_CONFIG_DIR_NAME).normalize("NFC");
16161
- }
16162
- function hasNodeOption(flag) {
16163
- const nodeOptions = process.env.NODE_OPTIONS;
16164
- if (!nodeOptions) {
16165
- return false;
16166
- }
16167
- return nodeOptions.split(/\s+/u).includes(flag);
16168
- }
16169
- function isEnvTruthy(envVar) {
16170
- if (!envVar)
16171
- return false;
16172
- if (typeof envVar === "boolean")
16173
- return envVar;
16174
- const normalizedValue = envVar.toLowerCase().trim();
16175
- return ["1", "true", "yes", "on"].includes(normalizedValue);
16176
- }
16177
- function getCostrictEnv(suffix) {
16178
- return process.env[`${ENV_PREFIX}_${suffix}`] ?? process.env[`${LEGACY_ENV_PREFIX}_${suffix}`] ?? process.env[`${LEGACY_BRIDGE_ENV_PREFIX}_${suffix}`];
16179
- }
16180
- function isCostrictEnvTruthy(suffix) {
16181
- return isEnvTruthy(getCostrictEnv(suffix));
16182
- }
16183
- function isBareMode() {
16184
- return isEnvTruthy(process.env.COSTRICT_SIMPLE) || isEnvTruthy(process.env.CLAUDE_CODE_SIMPLE) || process.argv.includes("--bare");
16185
- }
16186
- function getAWSRegion() {
16187
- return process.env.AWS_REGION || process.env.AWS_DEFAULT_REGION || "us-east-1";
16188
- }
16189
- function isRunningOnHomespace() {
16190
- return process.env.USER_TYPE === "sf" && isEnvTruthy(process.env.COO_RUNNING_ON_HOMESPACE);
16191
- }
16192
- var getCostrictConfigHomeDir, getClaudeConfigHomeDir;
16193
- var init_envUtils = __esm(() => {
16194
- init_memoize();
16195
- init_branding();
16196
- getCostrictConfigHomeDir = memoize_default(() => {
16197
- return (process.env.COSTRICT_CONFIG_DIR ?? process.env.CLAUDE_CONFIG_DIR ?? join3(homedir2(), CONFIG_DIR_NAME)).normalize("NFC");
16198
- }, () => process.env.COSTRICT_CONFIG_DIR ?? process.env.CLAUDE_CONFIG_DIR);
16199
- getClaudeConfigHomeDir = getCostrictConfigHomeDir;
16200
- });
16201
-
16202
16293
  // node_modules/.bun/@anthropic-ai+sdk@0.80.0+68a1e3a0c4588df3/node_modules/@anthropic-ai/sdk/internal/tslib.mjs
16203
16294
  function __classPrivateFieldSet(receiver, state, value, kind, f) {
16204
16295
  if (kind === "m")
@@ -20878,7 +20969,7 @@ function writeToStderr(data) {
20878
20969
 
20879
20970
  // src/utils/debug.ts
20880
20971
  import { appendFile, mkdir, symlink, unlink } from "fs/promises";
20881
- import { dirname, join as join4 } from "path";
20972
+ import { dirname, join as join5 } from "path";
20882
20973
  function shouldLogDebugMessage(message) {
20883
20974
  if (false) {}
20884
20975
  if (process.env.USER_TYPE !== "sf" && !isDebugMode()) {
@@ -20953,7 +21044,7 @@ function logForDebugging(message, { level } = {
20953
21044
  getDebugWriter().write(output);
20954
21045
  }
20955
21046
  function getDebugLogPath() {
20956
- return getDebugFilePath() ?? process.env.CLAUDE_CODE_DEBUG_LOGS_DIR ?? join4(getClaudeConfigHomeDir(), "debug", `${getSessionId()}.txt`);
21047
+ return getDebugFilePath() ?? process.env.CLAUDE_CODE_DEBUG_LOGS_DIR ?? join5(getClaudeConfigHomeDir(), "debug", `${getSessionId()}.txt`);
20957
21048
  }
20958
21049
  function logAntError(context, error2) {
20959
21050
  if (process.env.USER_TYPE !== "sf") {
@@ -21020,7 +21111,7 @@ var init_debug = __esm(() => {
21020
21111
  try {
21021
21112
  const debugLogPath = getDebugLogPath();
21022
21113
  const debugLogsDir = dirname(debugLogPath);
21023
- const latestSymlinkPath = join4(debugLogsDir, "latest");
21114
+ const latestSymlinkPath = join5(debugLogsDir, "latest");
21024
21115
  await unlink(latestSymlinkPath).catch(() => {});
21025
21116
  await symlink(debugLogPath, latestSymlinkPath);
21026
21117
  } catch {}
@@ -31799,12 +31890,12 @@ var require_form_data = __commonJS((exports, module) => {
31799
31890
  if (value.end != null && value.end != Infinity && value.start != null) {
31800
31891
  callback(null, value.end + 1 - (value.start ? value.start : 0));
31801
31892
  } else {
31802
- fs5.stat(value.path, function(err, stat2) {
31893
+ fs5.stat(value.path, function(err, stat4) {
31803
31894
  if (err) {
31804
31895
  callback(err);
31805
31896
  return;
31806
31897
  }
31807
- var fileSize = stat2.size - (value.start ? value.start : 0);
31898
+ var fileSize = stat4.size - (value.start ? value.start : 0);
31808
31899
  callback(null, fileSize);
31809
31900
  });
31810
31901
  }
@@ -33147,7 +33238,7 @@ __export(exports_supports_color, {
33147
33238
  createSupportsColor: () => createSupportsColor
33148
33239
  });
33149
33240
  import process2 from "process";
33150
- import os2 from "os";
33241
+ import os from "os";
33151
33242
  import tty from "tty";
33152
33243
  function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
33153
33244
  const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
@@ -33213,7 +33304,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
33213
33304
  return min;
33214
33305
  }
33215
33306
  if (process2.platform === "win32") {
33216
- const osRelease = os2.release().split(".");
33307
+ const osRelease = os.release().split(".");
33217
33308
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
33218
33309
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
33219
33310
  }
@@ -33470,7 +33561,7 @@ var require_src = __commonJS((exports, module) => {
33470
33561
  // node_modules/.bun/agent-base@6.0.2/node_modules/agent-base/dist/src/promisify.js
33471
33562
  var require_promisify = __commonJS((exports) => {
33472
33563
  Object.defineProperty(exports, "__esModule", { value: true });
33473
- function promisify(fn) {
33564
+ function promisify2(fn) {
33474
33565
  return function(req, opts) {
33475
33566
  return new Promise((resolve, reject) => {
33476
33567
  fn.call(this, req, opts, (err, rtn) => {
@@ -33483,7 +33574,7 @@ var require_promisify = __commonJS((exports) => {
33483
33574
  });
33484
33575
  };
33485
33576
  }
33486
- exports.default = promisify;
33577
+ exports.default = promisify2;
33487
33578
  });
33488
33579
 
33489
33580
  // node_modules/.bun/agent-base@6.0.2/node_modules/agent-base/dist/src/index.js
@@ -37696,7 +37787,7 @@ var init_ansi_styles = __esm(() => {
37696
37787
 
37697
37788
  // node_modules/.bun/chalk@5.6.2/node_modules/chalk/source/vendor/supports-color/index.js
37698
37789
  import process3 from "process";
37699
- import os3 from "os";
37790
+ import os2 from "os";
37700
37791
  import tty2 from "tty";
37701
37792
  function hasFlag2(flag, argv = globalThis.Deno ? globalThis.Deno.args : process3.argv) {
37702
37793
  const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
@@ -37754,7 +37845,7 @@ function _supportsColor2(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
37754
37845
  return min;
37755
37846
  }
37756
37847
  if (process3.platform === "win32") {
37757
- const osRelease = os3.release().split(".");
37848
+ const osRelease = os2.release().split(".");
37758
37849
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
37759
37850
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
37760
37851
  }
@@ -38876,15 +38967,15 @@ var require_windows = __commonJS((exports, module) => {
38876
38967
  }
38877
38968
  return false;
38878
38969
  }
38879
- function checkStat(stat2, path6, options) {
38880
- if (!stat2.isSymbolicLink() && !stat2.isFile()) {
38970
+ function checkStat(stat4, path6, options) {
38971
+ if (!stat4.isSymbolicLink() && !stat4.isFile()) {
38881
38972
  return false;
38882
38973
  }
38883
38974
  return checkPathExt(path6, options);
38884
38975
  }
38885
38976
  function isexe(path6, options, cb) {
38886
- fs5.stat(path6, function(er, stat2) {
38887
- cb(er, er ? false : checkStat(stat2, path6, options));
38977
+ fs5.stat(path6, function(er, stat4) {
38978
+ cb(er, er ? false : checkStat(stat4, path6, options));
38888
38979
  });
38889
38980
  }
38890
38981
  function sync(path6, options) {
@@ -38898,20 +38989,20 @@ var require_mode = __commonJS((exports, module) => {
38898
38989
  isexe.sync = sync;
38899
38990
  var fs5 = __require("fs");
38900
38991
  function isexe(path6, options, cb) {
38901
- fs5.stat(path6, function(er, stat2) {
38902
- cb(er, er ? false : checkStat(stat2, options));
38992
+ fs5.stat(path6, function(er, stat4) {
38993
+ cb(er, er ? false : checkStat(stat4, options));
38903
38994
  });
38904
38995
  }
38905
38996
  function sync(path6, options) {
38906
38997
  return checkStat(fs5.statSync(path6), options);
38907
38998
  }
38908
- function checkStat(stat2, options) {
38909
- return stat2.isFile() && checkMode(stat2, options);
38999
+ function checkStat(stat4, options) {
39000
+ return stat4.isFile() && checkMode(stat4, options);
38910
39001
  }
38911
- function checkMode(stat2, options) {
38912
- var mod = stat2.mode;
38913
- var uid = stat2.uid;
38914
- var gid = stat2.gid;
39002
+ function checkMode(stat4, options) {
39003
+ var mod = stat4.mode;
39004
+ var uid = stat4.uid;
39005
+ var gid = stat4.gid;
38915
39006
  var myUid = options.uid !== undefined ? options.uid : process.getuid && process.getuid();
38916
39007
  var myGid = options.gid !== undefined ? options.gid : process.getgid && process.getgid();
38917
39008
  var u = parseInt("100", 8);
@@ -39323,7 +39414,7 @@ function pathKey(options = {}) {
39323
39414
  }
39324
39415
 
39325
39416
  // node_modules/.bun/unicorn-magic@0.3.0/node_modules/unicorn-magic/node.js
39326
- import { promisify } from "util";
39417
+ import { promisify as promisify2 } from "util";
39327
39418
  import { execFile as execFileCallback, execFileSync as execFileSyncOriginal } from "child_process";
39328
39419
  import path6 from "path";
39329
39420
  import { fileURLToPath as fileURLToPath3 } from "url";
@@ -39345,7 +39436,7 @@ function traversePathUp(startPath) {
39345
39436
  }
39346
39437
  var execFileOriginal, TEN_MEGABYTES_IN_BYTES;
39347
39438
  var init_node2 = __esm(() => {
39348
- execFileOriginal = promisify(execFileCallback);
39439
+ execFileOriginal = promisify2(execFileCallback);
39349
39440
  TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;
39350
39441
  });
39351
39442
 
@@ -40288,7 +40379,7 @@ var init_outgoing = __esm(() => {
40288
40379
  });
40289
40380
 
40290
40381
  // node_modules/.bun/execa@9.6.1/node_modules/execa/lib/ipc/send.js
40291
- import { promisify as promisify2 } from "util";
40382
+ import { promisify as promisify3 } from "util";
40292
40383
  var sendMessage = ({ anyProcess, channel, isSubprocess, ipc }, message, { strict = false } = {}) => {
40293
40384
  const methodName = "sendMessage";
40294
40385
  validateIpcMethod({
@@ -40349,7 +40440,7 @@ var sendMessage = ({ anyProcess, channel, isSubprocess, ipc }, message, { strict
40349
40440
  if (PROCESS_SEND_METHODS.has(anyProcess)) {
40350
40441
  return PROCESS_SEND_METHODS.get(anyProcess);
40351
40442
  }
40352
- const sendMethod = promisify2(anyProcess.send.bind(anyProcess));
40443
+ const sendMethod = promisify3(anyProcess.send.bind(anyProcess));
40353
40444
  PROCESS_SEND_METHODS.set(anyProcess, sendMethod);
40354
40445
  return sendMethod;
40355
40446
  }, PROCESS_SEND_METHODS;
@@ -40740,10 +40831,10 @@ function stripFinalNewline(input) {
40740
40831
  }
40741
40832
  return stripFinalNewlineBinary(input);
40742
40833
  }
40743
- var stripFinalNewlineString = (input) => input.at(-1) === LF ? input.slice(0, input.at(-2) === CR ? -2 : -1) : input, stripFinalNewlineBinary = (input) => input.at(-1) === LF_BINARY ? input.subarray(0, input.at(-2) === CR_BINARY ? -2 : -1) : input, LF = `
40834
+ var stripFinalNewlineString = (input) => input.at(-1) === LF2 ? input.slice(0, input.at(-2) === CR ? -2 : -1) : input, stripFinalNewlineBinary = (input) => input.at(-1) === LF_BINARY ? input.subarray(0, input.at(-2) === CR_BINARY ? -2 : -1) : input, LF2 = `
40744
40835
  `, LF_BINARY, CR = "\r", CR_BINARY;
40745
40836
  var init_strip_final_newline = __esm(() => {
40746
- LF_BINARY = LF.codePointAt(0);
40837
+ LF_BINARY = LF2.codePointAt(0);
40747
40838
  CR_BINARY = CR.codePointAt(0);
40748
40839
  });
40749
40840
 
@@ -42399,8 +42490,8 @@ var getSplitLinesGenerator = (binary, preserveNewlines, skipped, state) => binar
42399
42490
  yield previousChunks;
42400
42491
  }
42401
42492
  }, getAppendNewlineGenerator = ({ binary, preserveNewlines, readableObjectMode, state }) => binary || preserveNewlines || readableObjectMode ? undefined : { transform: appendNewlineGenerator.bind(undefined, state) }, appendNewlineGenerator = function* ({ isWindowsNewline = false }, chunk) {
42402
- const { unixNewline, windowsNewline, LF: LF2, concatBytes: concatBytes2 } = typeof chunk === "string" ? linesStringInfo : linesUint8ArrayInfo;
42403
- if (chunk.at(-1) === LF2) {
42493
+ const { unixNewline, windowsNewline, LF: LF3, concatBytes: concatBytes2 } = typeof chunk === "string" ? linesStringInfo : linesUint8ArrayInfo;
42494
+ if (chunk.at(-1) === LF3) {
42404
42495
  yield chunk;
42405
42496
  return;
42406
42497
  }
@@ -45245,7 +45336,7 @@ var init_is_safe_filename = __esm(() => {
45245
45336
 
45246
45337
  // node_modules/.bun/env-paths@4.0.0/node_modules/env-paths/index.js
45247
45338
  import path11 from "path";
45248
- import os4 from "os";
45339
+ import os3 from "os";
45249
45340
  import process12 from "process";
45250
45341
  function envPaths(name, { suffix = "nodejs" } = {}) {
45251
45342
  assertSafeFilename(name);
@@ -45292,20 +45383,11 @@ var homedir3, tmpdir, env3, macos = (name) => {
45292
45383
  };
45293
45384
  var init_env_paths = __esm(() => {
45294
45385
  init_is_safe_filename();
45295
- homedir3 = os4.homedir();
45296
- tmpdir = os4.tmpdir();
45386
+ homedir3 = os3.homedir();
45387
+ tmpdir = os3.tmpdir();
45297
45388
  ({ env: env3 } = process12);
45298
45389
  });
45299
45390
 
45300
- // src/utils/hash.ts
45301
- function djb2Hash(str) {
45302
- let hash2 = 0;
45303
- for (let i2 = 0;i2 < str.length; i2++) {
45304
- hash2 = (hash2 << 5) - hash2 + str.charCodeAt(i2) | 0;
45305
- }
45306
- return hash2;
45307
- }
45308
-
45309
45391
  // src/utils/cachePaths.ts
45310
45392
  var paths;
45311
45393
  var init_cachePaths = __esm(() => {
@@ -60475,9 +60557,9 @@ function stripBOM2(content) {
60475
60557
  var UTF8_BOM = "\uFEFF";
60476
60558
 
60477
60559
  // src/services/remoteManagedSettings/syncCacheState.ts
60478
- import { join as join5 } from "path";
60560
+ import { join as join6 } from "path";
60479
60561
  function getSettingsPath() {
60480
- return join5(getClaudeConfigHomeDir(), SETTINGS_FILENAME);
60562
+ return join6(getClaudeConfigHomeDir(), SETTINGS_FILENAME);
60481
60563
  }
60482
60564
  function loadSettings() {
60483
60565
  try {
@@ -60633,7 +60715,7 @@ var init_fileReadCache = __esm(() => {
60633
60715
  });
60634
60716
 
60635
60717
  // src/utils/platform.ts
60636
- import { readdir, readFile } from "fs/promises";
60718
+ import { readdir as readdir2, readFile } from "fs/promises";
60637
60719
  import { release as osRelease } from "os";
60638
60720
  async function detectVcs(dir) {
60639
60721
  const detected = new Set;
@@ -60642,7 +60724,7 @@ async function detectVcs(dir) {
60642
60724
  }
60643
60725
  try {
60644
60726
  const targetDir = dir ?? getFsImplementation().cwd();
60645
- const entries = new Set(await readdir(targetDir));
60727
+ const entries = new Set(await readdir2(targetDir));
60646
60728
  for (const [marker, vcs] of VCS_MARKERS) {
60647
60729
  if (entries.has(marker)) {
60648
60730
  detected.add(vcs);
@@ -61573,42 +61655,11 @@ var init_windowsPaths = __esm(() => {
61573
61655
  }, (p) => p, 500);
61574
61656
  });
61575
61657
 
61576
- // src/utils/getWorktreePathsPortable.ts
61577
- import { execFile as execFileCb } from "child_process";
61578
- import { promisify as promisify3 } from "util";
61579
- var execFileAsync;
61580
- var init_getWorktreePathsPortable = __esm(() => {
61581
- execFileAsync = promisify3(execFileCb);
61582
- });
61583
-
61584
- // src/utils/sessionStoragePortable.ts
61585
- function simpleHash(str) {
61586
- return Math.abs(djb2Hash(str)).toString(36);
61587
- }
61588
- function sanitizePath(name) {
61589
- const sanitized = name.replace(/[^a-zA-Z0-9]/g, "-");
61590
- if (sanitized.length <= MAX_SANITIZED_LENGTH) {
61591
- return sanitized;
61592
- }
61593
- const hash3 = typeof Bun !== "undefined" ? Bun.hash(name).toString(36) : simpleHash(name);
61594
- return `${sanitized.slice(0, MAX_SANITIZED_LENGTH)}-${hash3}`;
61595
- }
61596
- var MAX_SANITIZED_LENGTH = 200, TRANSCRIPT_READ_CHUNK_SIZE, SKIP_PRECOMPACT_THRESHOLD, ATTR_SNAP_PREFIX, SYSTEM_PREFIX, LF2 = 10, LF_BYTE;
61597
- var init_sessionStoragePortable = __esm(() => {
61598
- init_envUtils();
61599
- init_getWorktreePathsPortable();
61600
- TRANSCRIPT_READ_CHUNK_SIZE = 1024 * 1024;
61601
- SKIP_PRECOMPACT_THRESHOLD = 5 * 1024 * 1024;
61602
- ATTR_SNAP_PREFIX = Buffer.from('{"type":"attribution-snapshot"');
61603
- SYSTEM_PREFIX = Buffer.from('{"type":"system"');
61604
- LF_BYTE = Buffer.from([LF2]);
61605
- });
61606
-
61607
61658
  // src/utils/path.ts
61608
61659
  import {
61609
61660
  dirname as dirname4,
61610
61661
  isAbsolute,
61611
- join as join7,
61662
+ join as join8,
61612
61663
  normalize,
61613
61664
  posix,
61614
61665
  relative,
@@ -61633,7 +61684,7 @@ import {
61633
61684
  dirname as dirname5,
61634
61685
  extname,
61635
61686
  isAbsolute as isAbsolute2,
61636
- join as join8,
61687
+ join as join9,
61637
61688
  normalize as normalize2,
61638
61689
  relative as relative2,
61639
61690
  resolve as resolve3,
@@ -61740,6 +61791,15 @@ var init_file = __esm(() => {
61740
61791
  MAX_OUTPUT_SIZE = 0.25 * 1024 * 1024;
61741
61792
  });
61742
61793
 
61794
+ // src/utils/settings/userSettingsFilePaths.ts
61795
+ import { join as join10, resolve as resolve4 } from "path";
61796
+ function getUserSettingsFilePaths(filename) {
61797
+ return [join10(resolve4(getClaudeConfigHomeDir()), filename)];
61798
+ }
61799
+ var init_userSettingsFilePaths = __esm(() => {
61800
+ init_envUtils();
61801
+ });
61802
+
61743
61803
  // src/utils/execFileNoThrowPortable.ts
61744
61804
  function execSyncWithDefaults_DEPRECATED(command, optionsOrAbortSignal, timeout = 10 * SECONDS_IN_MINUTE * MS_IN_SECOND) {
61745
61805
  let options;
@@ -61828,7 +61888,7 @@ function execFileNoThrowWithCwd(file2, args, {
61828
61888
  preserveOutputOnError: true,
61829
61889
  maxBuffer: 1e6
61830
61890
  }) {
61831
- return new Promise((resolve4) => {
61891
+ return new Promise((resolve5) => {
61832
61892
  execa(file2, args, {
61833
61893
  maxBuffer,
61834
61894
  cancelSignal: abortSignal,
@@ -61843,17 +61903,17 @@ function execFileNoThrowWithCwd(file2, args, {
61843
61903
  if (result.failed) {
61844
61904
  if (finalPreserveOutput) {
61845
61905
  const errorCode = result.exitCode ?? 1;
61846
- resolve4({
61906
+ resolve5({
61847
61907
  stdout: result.stdout || "",
61848
61908
  stderr: result.stderr || "",
61849
61909
  code: errorCode,
61850
61910
  error: getErrorMessage(result, errorCode)
61851
61911
  });
61852
61912
  } else {
61853
- resolve4({ stdout: "", stderr: "", code: result.exitCode ?? 1 });
61913
+ resolve5({ stdout: "", stderr: "", code: result.exitCode ?? 1 });
61854
61914
  }
61855
61915
  } else {
61856
- resolve4({
61916
+ resolve5({
61857
61917
  stdout: result.stdout,
61858
61918
  stderr: result.stderr,
61859
61919
  code: 0
@@ -61861,7 +61921,7 @@ function execFileNoThrowWithCwd(file2, args, {
61861
61921
  }
61862
61922
  }).catch((error52) => {
61863
61923
  logError2(error52);
61864
- resolve4({ stdout: "", stderr: "", code: 1 });
61924
+ resolve5({ stdout: "", stderr: "", code: 1 });
61865
61925
  });
61866
61926
  });
61867
61927
  }
@@ -61979,10 +62039,10 @@ var init_gitConfigParser = () => {};
61979
62039
 
61980
62040
  // src/utils/git/gitFilesystem.ts
61981
62041
  import { unwatchFile, watchFile } from "fs";
61982
- import { readdir as readdir2, readFile as readFile2, stat as stat2 } from "fs/promises";
61983
- import { join as join9, resolve as resolve4 } from "path";
62042
+ import { readdir as readdir3, readFile as readFile2, stat as stat4 } from "fs/promises";
62043
+ import { join as join11, resolve as resolve5 } from "path";
61984
62044
  async function resolveGitDir(startPath) {
61985
- const cwd2 = resolve4(startPath ?? getCwd());
62045
+ const cwd2 = resolve5(startPath ?? getCwd());
61986
62046
  const cached3 = resolveGitDirCache.get(cwd2);
61987
62047
  if (cached3 !== undefined) {
61988
62048
  return cached3;
@@ -61992,14 +62052,14 @@ async function resolveGitDir(startPath) {
61992
62052
  resolveGitDirCache.set(cwd2, null);
61993
62053
  return null;
61994
62054
  }
61995
- const gitPath = join9(root2, ".git");
62055
+ const gitPath = join11(root2, ".git");
61996
62056
  try {
61997
- const st = await stat2(gitPath);
62057
+ const st = await stat4(gitPath);
61998
62058
  if (st.isFile()) {
61999
62059
  const content = (await readFile2(gitPath, "utf-8")).trim();
62000
62060
  if (content.startsWith("gitdir:")) {
62001
62061
  const rawDir = content.slice("gitdir:".length).trim();
62002
- const resolved = resolve4(root2, rawDir);
62062
+ const resolved = resolve5(root2, rawDir);
62003
62063
  resolveGitDirCache.set(cwd2, resolved);
62004
62064
  return resolved;
62005
62065
  }
@@ -62031,7 +62091,7 @@ function isValidGitSha(s) {
62031
62091
  }
62032
62092
  async function readGitHead(gitDir) {
62033
62093
  try {
62034
- const content = (await readFile2(join9(gitDir, "HEAD"), "utf-8")).trim();
62094
+ const content = (await readFile2(join11(gitDir, "HEAD"), "utf-8")).trim();
62035
62095
  if (content.startsWith("ref:")) {
62036
62096
  const ref = content.slice("ref:".length).trim();
62037
62097
  if (ref.startsWith("refs/heads/")) {
@@ -62068,7 +62128,7 @@ async function resolveRef2(gitDir, ref) {
62068
62128
  }
62069
62129
  async function resolveRefInDir(dir, ref) {
62070
62130
  try {
62071
- const content = (await readFile2(join9(dir, ref), "utf-8")).trim();
62131
+ const content = (await readFile2(join11(dir, ref), "utf-8")).trim();
62072
62132
  if (content.startsWith("ref:")) {
62073
62133
  const target = content.slice("ref:".length).trim();
62074
62134
  if (!isSafeRefName(target)) {
@@ -62082,7 +62142,7 @@ async function resolveRefInDir(dir, ref) {
62082
62142
  return content;
62083
62143
  } catch {}
62084
62144
  try {
62085
- const packed = await readFile2(join9(dir, "packed-refs"), "utf-8");
62145
+ const packed = await readFile2(join11(dir, "packed-refs"), "utf-8");
62086
62146
  for (const line of packed.split(`
62087
62147
  `)) {
62088
62148
  if (line.startsWith("#") || line.startsWith("^")) {
@@ -62102,8 +62162,8 @@ async function resolveRefInDir(dir, ref) {
62102
62162
  }
62103
62163
  async function getCommonDir(gitDir) {
62104
62164
  try {
62105
- const content = (await readFile2(join9(gitDir, "commondir"), "utf-8")).trim();
62106
- return resolve4(gitDir, content);
62165
+ const content = (await readFile2(join11(gitDir, "commondir"), "utf-8")).trim();
62166
+ return resolve5(gitDir, content);
62107
62167
  } catch {
62108
62168
  return null;
62109
62169
  }
@@ -62134,10 +62194,10 @@ class GitFileWatcher {
62134
62194
  return;
62135
62195
  }
62136
62196
  this.commonDir = await getCommonDir(this.gitDir);
62137
- this.watchPath(join9(this.gitDir, "HEAD"), () => {
62197
+ this.watchPath(join11(this.gitDir, "HEAD"), () => {
62138
62198
  this.onHeadChanged();
62139
62199
  });
62140
- this.watchPath(join9(this.commonDir ?? this.gitDir, "config"), () => {
62200
+ this.watchPath(join11(this.commonDir ?? this.gitDir, "config"), () => {
62141
62201
  this.invalidate();
62142
62202
  });
62143
62203
  await this.watchCurrentBranchRef();
@@ -62155,7 +62215,7 @@ class GitFileWatcher {
62155
62215
  }
62156
62216
  const head = await readGitHead(this.gitDir);
62157
62217
  const refsDir = this.commonDir ?? this.gitDir;
62158
- const refPath = head?.type === "branch" ? join9(refsDir, "refs", "heads", head.name) : null;
62218
+ const refPath = head?.type === "branch" ? join11(refsDir, "refs", "heads", head.name) : null;
62159
62219
  if (refPath === this.branchRefPath) {
62160
62220
  return;
62161
62221
  }
@@ -62284,7 +62344,7 @@ var init_which = __esm(() => {
62284
62344
 
62285
62345
  // src/utils/git.ts
62286
62346
  import { readFileSync as readFileSync7, realpathSync as realpathSync3, statSync as statSync3 } from "fs";
62287
- import { basename as basename2, dirname as dirname6, join as join10, resolve as resolve5, sep as sep3 } from "path";
62347
+ import { basename as basename2, dirname as dirname6, join as join12, resolve as resolve6, sep as sep3 } from "path";
62288
62348
  function createFindGitRoot() {
62289
62349
  function wrapper(startPath) {
62290
62350
  const result = findGitRootImpl(startPath);
@@ -62321,15 +62381,15 @@ var init_git = __esm(() => {
62321
62381
  findGitRootImpl = memoizeWithLRU((startPath) => {
62322
62382
  const startTime = Date.now();
62323
62383
  logForDiagnosticsNoPII("info", "find_git_root_started");
62324
- let current = resolve5(startPath);
62384
+ let current = resolve6(startPath);
62325
62385
  const root2 = current.substring(0, current.indexOf(sep3) + 1) || sep3;
62326
62386
  let statCount = 0;
62327
62387
  while (current !== root2) {
62328
62388
  try {
62329
- const gitPath = join10(current, ".git");
62389
+ const gitPath = join12(current, ".git");
62330
62390
  statCount++;
62331
- const stat3 = statSync3(gitPath);
62332
- if (stat3.isDirectory() || stat3.isFile()) {
62391
+ const stat5 = statSync3(gitPath);
62392
+ if (stat5.isDirectory() || stat5.isFile()) {
62333
62393
  logForDiagnosticsNoPII("info", "find_git_root_completed", {
62334
62394
  duration_ms: Date.now() - startTime,
62335
62395
  stat_count: statCount,
@@ -62345,10 +62405,10 @@ var init_git = __esm(() => {
62345
62405
  current = parent;
62346
62406
  }
62347
62407
  try {
62348
- const gitPath = join10(root2, ".git");
62408
+ const gitPath = join12(root2, ".git");
62349
62409
  statCount++;
62350
- const stat3 = statSync3(gitPath);
62351
- if (stat3.isDirectory() || stat3.isFile()) {
62410
+ const stat5 = statSync3(gitPath);
62411
+ if (stat5.isDirectory() || stat5.isFile()) {
62352
62412
  logForDiagnosticsNoPII("info", "find_git_root_completed", {
62353
62413
  duration_ms: Date.now() - startTime,
62354
62414
  stat_count: statCount,
@@ -62367,17 +62427,17 @@ var init_git = __esm(() => {
62367
62427
  findGitRoot = createFindGitRoot();
62368
62428
  resolveCanonicalRoot = memoizeWithLRU((gitRoot) => {
62369
62429
  try {
62370
- const gitContent = readFileSync7(join10(gitRoot, ".git"), "utf-8").trim();
62430
+ const gitContent = readFileSync7(join12(gitRoot, ".git"), "utf-8").trim();
62371
62431
  if (!gitContent.startsWith("gitdir:")) {
62372
62432
  return gitRoot;
62373
62433
  }
62374
- const worktreeGitDir = resolve5(gitRoot, gitContent.slice("gitdir:".length).trim());
62375
- const commonDir = resolve5(worktreeGitDir, readFileSync7(join10(worktreeGitDir, "commondir"), "utf-8").trim());
62376
- if (resolve5(dirname6(worktreeGitDir)) !== join10(commonDir, "worktrees")) {
62434
+ const worktreeGitDir = resolve6(gitRoot, gitContent.slice("gitdir:".length).trim());
62435
+ const commonDir = resolve6(worktreeGitDir, readFileSync7(join12(worktreeGitDir, "commondir"), "utf-8").trim());
62436
+ if (resolve6(dirname6(worktreeGitDir)) !== join12(commonDir, "worktrees")) {
62377
62437
  return gitRoot;
62378
62438
  }
62379
- const backlink = realpathSync3(readFileSync7(join10(worktreeGitDir, "gitdir"), "utf-8").trim());
62380
- if (backlink !== join10(realpathSync3(gitRoot), ".git")) {
62439
+ const backlink = realpathSync3(readFileSync7(join12(worktreeGitDir, "gitdir"), "utf-8").trim());
62440
+ if (backlink !== join12(realpathSync3(gitRoot), ".git")) {
62381
62441
  return gitRoot;
62382
62442
  }
62383
62443
  if (basename2(commonDir) !== ".git") {
@@ -67455,8 +67515,8 @@ Error generating stack: ` + x.message + `
67455
67515
  currentEntangledActionThenable = {
67456
67516
  status: "pending",
67457
67517
  value: undefined,
67458
- then: function(resolve6) {
67459
- entangledListeners.push(resolve6);
67518
+ then: function(resolve7) {
67519
+ entangledListeners.push(resolve7);
67460
67520
  }
67461
67521
  };
67462
67522
  }
@@ -67480,8 +67540,8 @@ Error generating stack: ` + x.message + `
67480
67540
  status: "pending",
67481
67541
  value: null,
67482
67542
  reason: null,
67483
- then: function(resolve6) {
67484
- listeners.push(resolve6);
67543
+ then: function(resolve7) {
67544
+ listeners.push(resolve7);
67485
67545
  }
67486
67546
  };
67487
67547
  thenable.then(function() {
@@ -79418,10 +79478,10 @@ var init_dec = __esm(() => {
79418
79478
  import { Buffer as Buffer8 } from "buffer";
79419
79479
  import { execFile as nodeExecFile } from "child_process";
79420
79480
  function execFileNoThrow2(command, args, options = {}) {
79421
- return new Promise((resolve6) => {
79481
+ return new Promise((resolve7) => {
79422
79482
  const { input, timeout } = options;
79423
79483
  const proc = nodeExecFile(command, args, { timeout }, (error52, stdout, stderr) => {
79424
- resolve6({
79484
+ resolve7({
79425
79485
  code: error52 ? 1 : 0,
79426
79486
  stdout: stdout ?? "",
79427
79487
  stderr: stderr ?? ""
@@ -79798,8 +79858,8 @@ function setTerminalFocused(v) {
79798
79858
  cb();
79799
79859
  }
79800
79860
  if (!v) {
79801
- for (const resolve6 of resolvers) {
79802
- resolve6();
79861
+ for (const resolve7 of resolvers) {
79862
+ resolve7();
79803
79863
  }
79804
79864
  resolvers.clear();
79805
79865
  }
@@ -79837,18 +79897,18 @@ class TerminalQuerier {
79837
79897
  this.stdout = stdout;
79838
79898
  }
79839
79899
  send(query) {
79840
- return new Promise((resolve6) => {
79900
+ return new Promise((resolve7) => {
79841
79901
  this.queue.push({
79842
79902
  kind: "query",
79843
79903
  match: query.match,
79844
- resolve: (r) => resolve6(r)
79904
+ resolve: (r) => resolve7(r)
79845
79905
  });
79846
79906
  this.stdout.write(query.request);
79847
79907
  });
79848
79908
  }
79849
79909
  flush() {
79850
- return new Promise((resolve6) => {
79851
- this.queue.push({ kind: "sentinel", resolve: resolve6 });
79910
+ return new Promise((resolve7) => {
79911
+ this.queue.push({ kind: "sentinel", resolve: resolve7 });
79852
79912
  this.stdout.write(SENTINEL);
79853
79913
  });
79854
79914
  }
@@ -84875,8 +84935,8 @@ class Ink {
84875
84935
  }
84876
84936
  }
84877
84937
  async waitUntilExit() {
84878
- this.exitPromise ||= new Promise((resolve6, reject) => {
84879
- this.resolveExitPromise = resolve6;
84938
+ this.exitPromise ||= new Promise((resolve7, reject) => {
84939
+ this.resolveExitPromise = resolve7;
84880
84940
  this.rejectExitPromise = reject;
84881
84941
  });
84882
84942
  return this.exitPromise;
@@ -86825,7 +86885,7 @@ var init_internalWrites = __esm(() => {
86825
86885
  });
86826
86886
 
86827
86887
  // src/utils/settings/managedPath.ts
86828
- import { join as join11 } from "path";
86888
+ import { join as join13 } from "path";
86829
86889
  var getManagedFilePath, getManagedSettingsDropInDir;
86830
86890
  var init_managedPath = __esm(() => {
86831
86891
  init_memoize();
@@ -86844,7 +86904,7 @@ var init_managedPath = __esm(() => {
86844
86904
  }
86845
86905
  });
86846
86906
  getManagedSettingsDropInDir = memoize_default(function() {
86847
- return join11(getManagedFilePath(), "managed-settings.d");
86907
+ return join13(getManagedFilePath(), "managed-settings.d");
86848
86908
  });
86849
86909
  });
86850
86910
 
@@ -86908,7 +86968,7 @@ var init_findExecutable = __esm(() => {
86908
86968
 
86909
86969
  // src/utils/env.ts
86910
86970
  import { homedir as homedir4 } from "os";
86911
- import { join as join12 } from "path";
86971
+ import { join as join14 } from "path";
86912
86972
  async function isCommandAvailable(command) {
86913
86973
  try {
86914
86974
  return !!await which(command);
@@ -87029,11 +87089,11 @@ var init_env = __esm(() => {
87029
87089
  init_fsOperations();
87030
87090
  init_which();
87031
87091
  getGlobalClaudeFile = memoize_default(() => {
87032
- if (getFsImplementation().existsSync(join12(getClaudeConfigHomeDir(), ".config.json"))) {
87033
- return join12(getClaudeConfigHomeDir(), ".config.json");
87092
+ if (getFsImplementation().existsSync(join14(getClaudeConfigHomeDir(), ".config.json"))) {
87093
+ return join14(getClaudeConfigHomeDir(), ".config.json");
87034
87094
  }
87035
87095
  const filename = `.claude${fileSuffixForOauthConfig()}.json`;
87036
- return join12(process.env.CLAUDE_CONFIG_DIR || homedir4(), filename);
87096
+ return join14(process.env.CLAUDE_CONFIG_DIR || homedir4(), filename);
87037
87097
  });
87038
87098
  hasInternetAccess = memoize_default(async () => {
87039
87099
  try {
@@ -88417,6 +88477,7 @@ var init_types2 = __esm(() => {
88417
88477
  terminalTitleFromRename: exports_external.boolean().optional().describe("Whether /rename updates the terminal tab title (defaults to true). Set to false to keep auto-generated topic titles."),
88418
88478
  alwaysThinkingEnabled: exports_external.boolean().optional().describe("When false, thinking is disabled. When absent or true, thinking is " + "enabled automatically for supported models."),
88419
88479
  effortLevel: exports_external.enum(process.env.USER_TYPE === "sf" ? ["low", "medium", "high", "xhigh", "max"] : ["low", "medium", "high", "xhigh"]).optional().catch(undefined).describe("Persisted effort level for supported models."),
88480
+ reclaimMode: exports_external.enum(["off", "lite", "full", "ultra"]).optional().catch(undefined).describe("Persisted Reclaim intensity mode (off/lite/full/ultra)."),
88420
88481
  advisorModel: exports_external.string().optional().describe("Advisor model for the server-side advisor tool."),
88421
88482
  fastMode: exports_external.boolean().optional().describe("When true, fast mode is enabled. When absent or false, fast mode is off."),
88422
88483
  fastModePerSessionOptIn: exports_external.boolean().optional().describe("When true, fast mode does not persist across sessions. Each session starts with fast mode off."),
@@ -88783,10 +88844,9 @@ var init_settings = __esm(() => {
88783
88844
  });
88784
88845
 
88785
88846
  // src/utils/settings/settings.ts
88786
- import { homedir as homedir5 } from "os";
88787
- import { dirname as dirname7, join as join13, resolve as resolve6 } from "path";
88847
+ import { dirname as dirname7, join as join15, resolve as resolve7 } from "path";
88788
88848
  function getManagedSettingsFilePath() {
88789
- return join13(getManagedFilePath(), "managed-settings.json");
88849
+ return join15(getManagedFilePath(), "managed-settings.json");
88790
88850
  }
88791
88851
  function loadManagedFileSettings() {
88792
88852
  const errors3 = [];
@@ -88802,7 +88862,7 @@ function loadManagedFileSettings() {
88802
88862
  try {
88803
88863
  const entries = getFsImplementation().readdirSync(dropInDir).filter((d) => (d.isFile() || d.isSymbolicLink()) && d.name.endsWith(".json") && !d.name.startsWith(".")).map((d) => d.name).sort();
88804
88864
  for (const name of entries) {
88805
- const { settings: settings2, errors: fileErrors } = parseSettingsFile(join13(dropInDir, name));
88865
+ const { settings: settings2, errors: fileErrors } = parseSettingsFile(join15(dropInDir, name));
88806
88866
  errors3.push(...fileErrors);
88807
88867
  if (settings2 && Object.keys(settings2).length > 0) {
88808
88868
  merged = mergeWith_default(merged, settings2, settingsMergeCustomizer);
@@ -88862,15 +88922,15 @@ function parseSettingsFileUncached(path13) {
88862
88922
  function getSettingsRootPathForSource(source) {
88863
88923
  switch (source) {
88864
88924
  case "userSettings":
88865
- return resolve6(getClaudeConfigHomeDir());
88925
+ return resolve7(getClaudeConfigHomeDir());
88866
88926
  case "policySettings":
88867
88927
  case "projectSettings":
88868
88928
  case "localSettings": {
88869
- return resolve6(getOriginalCwd());
88929
+ return resolve7(getOriginalCwd());
88870
88930
  }
88871
88931
  case "flagSettings": {
88872
88932
  const path13 = getFlagSettingsPath();
88873
- return path13 ? dirname7(resolve6(path13)) : resolve6(getOriginalCwd());
88933
+ return path13 ? dirname7(resolve7(path13)) : resolve7(getOriginalCwd());
88874
88934
  }
88875
88935
  }
88876
88936
  }
@@ -88880,29 +88940,16 @@ function getUserSettingsFilePath() {
88880
88940
  }
88881
88941
  return "settings.json";
88882
88942
  }
88883
- function getUserSettingsFilePaths() {
88884
- const filename = getUserSettingsFilePath();
88885
- const primary = join13(resolve6(getClaudeConfigHomeDir()), filename);
88886
- if (process.env.COSTRICT_CONFIG_DIR || process.env.CLAUDE_CONFIG_DIR) {
88887
- return [primary];
88888
- }
88889
- const legacy = join13(homedir5(), LEGACY_CONFIG_DIR_NAME, filename);
88890
- const defaultPrimary = join13(homedir5(), CONFIG_DIR_NAME, filename);
88891
- if (resolve6(primary) !== resolve6(defaultPrimary)) {
88892
- return [primary];
88893
- }
88894
- if (resolve6(legacy) === resolve6(primary)) {
88895
- return [primary];
88896
- }
88897
- return [legacy, primary];
88943
+ function getUserSettingsFilePaths2() {
88944
+ return getUserSettingsFilePaths(getUserSettingsFilePath());
88898
88945
  }
88899
88946
  function getSettingsFilePathForSource(source) {
88900
88947
  switch (source) {
88901
88948
  case "userSettings":
88902
- return join13(getSettingsRootPathForSource(source), getUserSettingsFilePath());
88949
+ return join15(getSettingsRootPathForSource(source), getUserSettingsFilePath());
88903
88950
  case "projectSettings":
88904
88951
  case "localSettings": {
88905
- return join13(getSettingsRootPathForSource(source), getRelativeSettingsFilePathForSource(source));
88952
+ return join15(getSettingsRootPathForSource(source), getRelativeSettingsFilePathForSource(source));
88906
88953
  }
88907
88954
  case "policySettings":
88908
88955
  return getManagedSettingsFilePath();
@@ -88914,9 +88961,9 @@ function getSettingsFilePathForSource(source) {
88914
88961
  function getRelativeSettingsFilePathForSource(source) {
88915
88962
  switch (source) {
88916
88963
  case "projectSettings":
88917
- return join13(".claude", "settings.json");
88964
+ return join15(".claude", "settings.json");
88918
88965
  case "localSettings":
88919
- return join13(".claude", "settings.local.json");
88966
+ return join15(".claude", "settings.local.json");
88920
88967
  }
88921
88968
  }
88922
88969
  function getSettingsForSource(source) {
@@ -88950,7 +88997,7 @@ function getSettingsForSourceUncached(source) {
88950
88997
  if (source === "userSettings") {
88951
88998
  let mergedSettings = {};
88952
88999
  let found = false;
88953
- for (const settingsFilePath2 of getUserSettingsFilePaths()) {
89000
+ for (const settingsFilePath2 of getUserSettingsFilePaths2()) {
88954
89001
  const { settings } = parseSettingsFile(settingsFilePath2);
88955
89002
  if (settings) {
88956
89003
  mergedSettings = mergeWith_default(mergedSettings, settings, settingsMergeCustomizer);
@@ -89044,9 +89091,9 @@ function loadSettingsFromDisk() {
89044
89091
  }
89045
89092
  continue;
89046
89093
  }
89047
- const filePaths = source === "userSettings" ? getUserSettingsFilePaths() : getSettingsFilePathForSource(source) ? [getSettingsFilePathForSource(source)] : [];
89094
+ const filePaths = source === "userSettings" ? getUserSettingsFilePaths2() : getSettingsFilePathForSource(source) ? [getSettingsFilePathForSource(source)] : [];
89048
89095
  for (const filePath of filePaths) {
89049
- const resolvedPath = resolve6(filePath);
89096
+ const resolvedPath = resolve7(filePath);
89050
89097
  if (!seenFiles.has(resolvedPath)) {
89051
89098
  seenFiles.add(resolvedPath);
89052
89099
  const { settings, errors: errors3 } = parseSettingsFile(filePath);
@@ -89105,8 +89152,8 @@ var init_settings2 = __esm(() => {
89105
89152
  init_diagLogs();
89106
89153
  init_envUtils();
89107
89154
  init_errors3();
89108
- init_branding();
89109
89155
  init_file();
89156
+ init_userSettingsFilePaths();
89110
89157
  init_fileRead();
89111
89158
  init_fsOperations();
89112
89159
  init_gitignore();
@@ -89241,7 +89288,7 @@ var init_dist3 = __esm(() => {
89241
89288
 
89242
89289
  // node_modules/.bun/https-proxy-agent@8.0.0/node_modules/https-proxy-agent/dist/parse-proxy-response.js
89243
89290
  function parseProxyResponse(socket) {
89244
- return new Promise((resolve7, reject) => {
89291
+ return new Promise((resolve8, reject) => {
89245
89292
  let buffersLength = 0;
89246
89293
  const buffers = [];
89247
89294
  function read() {
@@ -89310,7 +89357,7 @@ function parseProxyResponse(socket) {
89310
89357
  }
89311
89358
  debug("got proxy server response: %o %o", firstLine, headers);
89312
89359
  cleanup();
89313
- resolve7({
89360
+ resolve8({
89314
89361
  connect: {
89315
89362
  statusCode,
89316
89363
  statusText,
@@ -90799,7 +90846,7 @@ var require_client = __commonJS((exports) => {
90799
90846
  };
90800
90847
  };
90801
90848
  var sleep2 = (seconds) => {
90802
- return new Promise((resolve7) => setTimeout(resolve7, seconds * 1000));
90849
+ return new Promise((resolve8) => setTimeout(resolve8, seconds * 1000));
90803
90850
  };
90804
90851
  var waiterServiceDefaults = {
90805
90852
  minDelay: 2,
@@ -90928,8 +90975,8 @@ var require_client = __commonJS((exports) => {
90928
90975
  };
90929
90976
  var abortTimeout = (abortSignal) => {
90930
90977
  let onAbort;
90931
- const promise2 = new Promise((resolve7) => {
90932
- onAbort = () => resolve7({ state: exports.WaiterState.ABORTED });
90978
+ const promise2 = new Promise((resolve8) => {
90979
+ onAbort = () => resolve8({ state: exports.WaiterState.ABORTED });
90933
90980
  if (typeof abortSignal.addEventListener === "function") {
90934
90981
  abortSignal.addEventListener("abort", onAbort);
90935
90982
  } else {
@@ -92146,7 +92193,7 @@ var require_config = __commonJS((exports) => {
92146
92193
  };
92147
92194
  var imdsHttpGet = async ({ hostname: hostname3, path: path13 }) => {
92148
92195
  const { request } = await import("http");
92149
- return new Promise((resolve7, reject) => {
92196
+ return new Promise((resolve8, reject) => {
92150
92197
  const req = request({
92151
92198
  method: "GET",
92152
92199
  hostname: hostname3.replace(/^\[(.+)]$/, "$1"),
@@ -92172,7 +92219,7 @@ var require_config = __commonJS((exports) => {
92172
92219
  const chunks = [];
92173
92220
  res.on("data", (chunk) => chunks.push(chunk));
92174
92221
  res.on("end", () => {
92175
- resolve7(Buffer.concat(chunks));
92222
+ resolve8(Buffer.concat(chunks));
92176
92223
  req.destroy();
92177
92224
  });
92178
92225
  });
@@ -94330,7 +94377,7 @@ ${value}\r
94330
94377
  if (isReadableStream4(stream4)) {
94331
94378
  return headStream$1(stream4, bytes);
94332
94379
  }
94333
- return new Promise((resolve7, reject) => {
94380
+ return new Promise((resolve8, reject) => {
94334
94381
  const collector = new Collector$1;
94335
94382
  collector.limit = bytes;
94336
94383
  stream4.pipe(collector);
@@ -94341,7 +94388,7 @@ ${value}\r
94341
94388
  collector.on("error", reject);
94342
94389
  collector.on("finish", function() {
94343
94390
  const bytes2 = new Uint8Array(Buffer.concat(this.buffers));
94344
- resolve7(bytes2);
94391
+ resolve8(bytes2);
94345
94392
  });
94346
94393
  });
94347
94394
  };
@@ -94439,7 +94486,7 @@ ${value}\r
94439
94486
  return collected;
94440
94487
  }
94441
94488
  function readToBase64(blob) {
94442
- return new Promise((resolve7, reject) => {
94489
+ return new Promise((resolve8, reject) => {
94443
94490
  const reader = new FileReader;
94444
94491
  reader.onloadend = () => {
94445
94492
  if (reader.readyState !== 2) {
@@ -94448,7 +94495,7 @@ ${value}\r
94448
94495
  const result = reader.result ?? "";
94449
94496
  const commaIndex = result.indexOf(",");
94450
94497
  const dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length;
94451
- resolve7(result.substring(dataOffset));
94498
+ resolve8(result.substring(dataOffset));
94452
94499
  };
94453
94500
  reader.onabort = () => reject(new Error("Read aborted"));
94454
94501
  reader.onerror = () => reject(reader.error);
@@ -94542,7 +94589,7 @@ ${value}\r
94542
94589
  if (isReadableStreamInstance(stream4)) {
94543
94590
  return collectReadableStream(stream4);
94544
94591
  }
94545
- return new Promise((resolve7, reject) => {
94592
+ return new Promise((resolve8, reject) => {
94546
94593
  const collector = new Collector;
94547
94594
  stream4.pipe(collector);
94548
94595
  stream4.on("error", (err) => {
@@ -94552,7 +94599,7 @@ ${value}\r
94552
94599
  collector.on("error", reject);
94553
94600
  collector.on("finish", function() {
94554
94601
  const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes));
94555
- resolve7(bytes);
94602
+ resolve8(bytes);
94556
94603
  });
94557
94604
  });
94558
94605
  };
@@ -94870,11 +94917,11 @@ var require_tslib = __commonJS((exports, module) => {
94870
94917
  };
94871
94918
  __awaiter = function(thisArg, _arguments, P2, generator) {
94872
94919
  function adopt(value) {
94873
- return value instanceof P2 ? value : new P2(function(resolve7) {
94874
- resolve7(value);
94920
+ return value instanceof P2 ? value : new P2(function(resolve8) {
94921
+ resolve8(value);
94875
94922
  });
94876
94923
  }
94877
- return new (P2 || (P2 = Promise))(function(resolve7, reject) {
94924
+ return new (P2 || (P2 = Promise))(function(resolve8, reject) {
94878
94925
  function fulfilled(value) {
94879
94926
  try {
94880
94927
  step(generator.next(value));
@@ -94890,7 +94937,7 @@ var require_tslib = __commonJS((exports, module) => {
94890
94937
  }
94891
94938
  }
94892
94939
  function step(result) {
94893
- result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected);
94940
+ result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected);
94894
94941
  }
94895
94942
  step((generator = generator.apply(thisArg, _arguments || [])).next());
94896
94943
  });
@@ -95119,14 +95166,14 @@ var require_tslib = __commonJS((exports, module) => {
95119
95166
  }, i2);
95120
95167
  function verb(n2) {
95121
95168
  i2[n2] = o2[n2] && function(v) {
95122
- return new Promise(function(resolve7, reject) {
95123
- v = o2[n2](v), settle2(resolve7, reject, v.done, v.value);
95169
+ return new Promise(function(resolve8, reject) {
95170
+ v = o2[n2](v), settle2(resolve8, reject, v.done, v.value);
95124
95171
  });
95125
95172
  };
95126
95173
  }
95127
- function settle2(resolve7, reject, d, v) {
95174
+ function settle2(resolve8, reject, d, v) {
95128
95175
  Promise.resolve(v).then(function(v2) {
95129
- resolve7({ value: v2, done: d });
95176
+ resolve8({ value: v2, done: d });
95130
95177
  }, reject);
95131
95178
  }
95132
95179
  };
@@ -96410,7 +96457,7 @@ var require_event_streams = __commonJS((exports) => {
96410
96457
  streamEnded = true;
96411
96458
  });
96412
96459
  while (!generationEnded) {
96413
- const value = await new Promise((resolve7) => setTimeout(() => resolve7(records.shift()), 0));
96460
+ const value = await new Promise((resolve8) => setTimeout(() => resolve8(records.shift()), 0));
96414
96461
  if (value) {
96415
96462
  yield value;
96416
96463
  }
@@ -97820,21 +97867,21 @@ var require_dist_cjs5 = __commonJS((exports) => {
97820
97867
  let sendBody = true;
97821
97868
  if (!externalAgent && expect === "100-continue") {
97822
97869
  sendBody = await Promise.race([
97823
- new Promise((resolve7) => {
97824
- timeoutId = Number(timing2.setTimeout(() => resolve7(true), Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs)));
97870
+ new Promise((resolve8) => {
97871
+ timeoutId = Number(timing2.setTimeout(() => resolve8(true), Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs)));
97825
97872
  }),
97826
- new Promise((resolve7) => {
97873
+ new Promise((resolve8) => {
97827
97874
  httpRequest.on("continue", () => {
97828
97875
  timing2.clearTimeout(timeoutId);
97829
- resolve7(true);
97876
+ resolve8(true);
97830
97877
  });
97831
97878
  httpRequest.on("response", () => {
97832
97879
  timing2.clearTimeout(timeoutId);
97833
- resolve7(false);
97880
+ resolve8(false);
97834
97881
  });
97835
97882
  httpRequest.on("error", () => {
97836
97883
  timing2.clearTimeout(timeoutId);
97837
- resolve7(false);
97884
+ resolve8(false);
97838
97885
  });
97839
97886
  })
97840
97887
  ]);
@@ -97909,13 +97956,13 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
97909
97956
  return socketWarningTimestamp;
97910
97957
  }
97911
97958
  constructor(options) {
97912
- this.configProvider = new Promise((resolve7, reject) => {
97959
+ this.configProvider = new Promise((resolve8, reject) => {
97913
97960
  if (typeof options === "function") {
97914
97961
  options().then((_options) => {
97915
- resolve7(this.resolveDefaultConfig(_options));
97962
+ resolve8(this.resolveDefaultConfig(_options));
97916
97963
  }).catch(reject);
97917
97964
  } else {
97918
- resolve7(this.resolveDefaultConfig(options));
97965
+ resolve8(this.resolveDefaultConfig(options));
97919
97966
  }
97920
97967
  });
97921
97968
  }
@@ -97946,7 +97993,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
97946
97993
  timing2.clearTimeout(socketTimeoutId);
97947
97994
  timing2.clearTimeout(keepAliveTimeoutId);
97948
97995
  };
97949
- const resolve7 = async (arg) => {
97996
+ const resolve8 = async (arg) => {
97950
97997
  await writeRequestBodyPromise;
97951
97998
  clearTimeouts();
97952
97999
  _resolve(arg);
@@ -98010,7 +98057,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
98010
98057
  headers: getTransformedHeaders(res.headers),
98011
98058
  body: res
98012
98059
  });
98013
- resolve7({ response: httpResponse });
98060
+ resolve8({ response: httpResponse });
98014
98061
  });
98015
98062
  req.on("error", (err) => {
98016
98063
  if (NODEJS_TIMEOUT_ERROR_CODES.includes(err.code)) {
@@ -98336,13 +98383,13 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
98336
98383
  return new NodeHttp2Handler(instanceOrOptions);
98337
98384
  }
98338
98385
  constructor(options) {
98339
- this.configProvider = new Promise((resolve7, reject) => {
98386
+ this.configProvider = new Promise((resolve8, reject) => {
98340
98387
  if (typeof options === "function") {
98341
98388
  options().then((opts) => {
98342
- resolve7(opts || {});
98389
+ resolve8(opts || {});
98343
98390
  }).catch(reject);
98344
98391
  } else {
98345
- resolve7(options || {});
98392
+ resolve8(options || {});
98346
98393
  }
98347
98394
  });
98348
98395
  }
@@ -98367,7 +98414,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
98367
98414
  return new Promise((_resolve, _reject) => {
98368
98415
  let fulfilled = false;
98369
98416
  let writeRequestBodyPromise = undefined;
98370
- const resolve7 = async (arg) => {
98417
+ const resolve8 = async (arg) => {
98371
98418
  await writeRequestBodyPromise;
98372
98419
  _resolve(arg);
98373
98420
  };
@@ -98452,7 +98499,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
98452
98499
  body: clientHttp2Stream
98453
98500
  });
98454
98501
  fulfilled = true;
98455
- resolve7({ response: httpResponse });
98502
+ resolve8({ response: httpResponse });
98456
98503
  if (useIsolatedSession) {
98457
98504
  session.close();
98458
98505
  }
@@ -98495,7 +98542,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
98495
98542
  if (isReadableStreamInstance(stream4)) {
98496
98543
  return collectReadableStream(stream4);
98497
98544
  }
98498
- return new Promise((resolve7, reject) => {
98545
+ return new Promise((resolve8, reject) => {
98499
98546
  const collector = new Collector;
98500
98547
  stream4.pipe(collector);
98501
98548
  stream4.on("error", (err) => {
@@ -98505,7 +98552,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
98505
98552
  collector.on("error", reject);
98506
98553
  collector.on("finish", function() {
98507
98554
  const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes));
98508
- resolve7(bytes);
98555
+ resolve8(bytes);
98509
98556
  });
98510
98557
  });
98511
98558
  };
@@ -98723,7 +98770,7 @@ var require_retry2 = __commonJS((exports) => {
98723
98770
  }
98724
98771
  };
98725
98772
  }
98726
- var cooldown = (ms) => new Promise((resolve7) => setTimeout(resolve7, ms));
98773
+ var cooldown = (ms) => new Promise((resolve8) => setTimeout(resolve8, ms));
98727
98774
  var isRetryStrategyV2 = (retryStrategy) => typeof retryStrategy.acquireInitialRetryToken !== "undefined" && typeof retryStrategy.refreshRetryTokenForRetry !== "undefined" && typeof retryStrategy.recordSuccess !== "undefined";
98728
98775
  var getRetryErrorInfo = (error52, logger) => {
98729
98776
  const errorInfo = {
@@ -98822,7 +98869,7 @@ var require_retry2 = __commonJS((exports) => {
98822
98869
  this.refillTokenBucket();
98823
98870
  while (amount > this.availableTokens) {
98824
98871
  const delay = (amount - this.availableTokens) / this.fillRate * 1000;
98825
- await new Promise((resolve7) => DefaultRateLimiter.setTimeoutFn(resolve7, delay));
98872
+ await new Promise((resolve8) => DefaultRateLimiter.setTimeoutFn(resolve8, delay));
98826
98873
  this.refillTokenBucket();
98827
98874
  }
98828
98875
  this.availableTokens = this.availableTokens - amount;
@@ -99164,7 +99211,7 @@ var require_retry2 = __commonJS((exports) => {
99164
99211
  const delayFromResponse = getDelayFromRetryAfterHeader(err.$response);
99165
99212
  const delay = Math.max(delayFromResponse || 0, delayFromDecider);
99166
99213
  totalDelay += delay;
99167
- await new Promise((resolve7) => setTimeout(resolve7, delay));
99214
+ await new Promise((resolve8) => setTimeout(resolve8, delay));
99168
99215
  continue;
99169
99216
  }
99170
99217
  if (!err.$metadata) {
@@ -101168,14 +101215,14 @@ var init_parser_os = __esm(() => {
101168
101215
  describe(ua) {
101169
101216
  const version2 = Utils.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i, ua).replace(/[_\s]/g, ".");
101170
101217
  const versionName = Utils.getMacOSVersionName(version2);
101171
- const os5 = {
101218
+ const os4 = {
101172
101219
  name: OS_MAP.MacOS,
101173
101220
  version: version2
101174
101221
  };
101175
101222
  if (versionName) {
101176
- os5.versionName = versionName;
101223
+ os4.versionName = versionName;
101177
101224
  }
101178
- return os5;
101225
+ return os4;
101179
101226
  }
101180
101227
  },
101181
101228
  {
@@ -101207,27 +101254,27 @@ var init_parser_os = __esm(() => {
101207
101254
  describe(ua) {
101208
101255
  const version2 = Utils.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i, ua);
101209
101256
  const versionName = Utils.getAndroidVersionName(version2);
101210
- const os5 = {
101257
+ const os4 = {
101211
101258
  name: OS_MAP.Android,
101212
101259
  version: version2
101213
101260
  };
101214
101261
  if (versionName) {
101215
- os5.versionName = versionName;
101262
+ os4.versionName = versionName;
101216
101263
  }
101217
- return os5;
101264
+ return os4;
101218
101265
  }
101219
101266
  },
101220
101267
  {
101221
101268
  test: [/(web|hpw)[o0]s/i],
101222
101269
  describe(ua) {
101223
101270
  const version2 = Utils.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i, ua);
101224
- const os5 = {
101271
+ const os4 = {
101225
101272
  name: OS_MAP.WebOS
101226
101273
  };
101227
101274
  if (version2 && version2.length) {
101228
- os5.version = version2;
101275
+ os4.version = version2;
101229
101276
  }
101230
- return os5;
101277
+ return os4;
101231
101278
  }
101232
101279
  },
101233
101280
  {
@@ -101936,7 +101983,7 @@ class Parser2 {
101936
101983
  }
101937
101984
  parseOS() {
101938
101985
  this.parsedResult.os = {};
101939
- const os5 = Utils.find(parser_os_default, (_os) => {
101986
+ const os4 = Utils.find(parser_os_default, (_os) => {
101940
101987
  if (typeof _os.test === "function") {
101941
101988
  return _os.test(this);
101942
101989
  }
@@ -101945,8 +101992,8 @@ class Parser2 {
101945
101992
  }
101946
101993
  throw new Error("Browser's test function is not valid");
101947
101994
  });
101948
- if (os5) {
101949
- this.parsedResult.os = os5.describe(this.getUA());
101995
+ if (os4) {
101996
+ this.parsedResult.os = os4.describe(this.getUA());
101950
101997
  }
101951
101998
  return this.parsedResult.os;
101952
101999
  }
@@ -102973,7 +103020,7 @@ var init_node_http = () => {};
102973
103020
 
102974
103021
  // node_modules/.bun/@smithy+credential-provider-imds@4.3.8/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/httpRequest.js
102975
103022
  function httpRequest(options) {
102976
- return new Promise((resolve7, reject) => {
103023
+ return new Promise((resolve8, reject) => {
102977
103024
  const req = node_http.request({
102978
103025
  method: "GET",
102979
103026
  ...options,
@@ -102998,7 +103045,7 @@ function httpRequest(options) {
102998
103045
  chunks.push(chunk);
102999
103046
  });
103000
103047
  res.on("end", () => {
103001
- resolve7(Buffer.concat(chunks));
103048
+ resolve8(Buffer.concat(chunks));
103002
103049
  req.destroy();
103003
103050
  });
103004
103051
  });
@@ -103447,7 +103494,7 @@ var retryWrapper = (toRetry, maxRetries, delayMs) => {
103447
103494
  try {
103448
103495
  return await toRetry();
103449
103496
  } catch (e) {
103450
- await new Promise((resolve7) => setTimeout(resolve7, delayMs));
103497
+ await new Promise((resolve8) => setTimeout(resolve8, delayMs));
103451
103498
  }
103452
103499
  }
103453
103500
  return await toRetry();
@@ -113069,8 +113116,8 @@ var require_signin = __commonJS((exports) => {
113069
113116
  // node_modules/.bun/@aws-sdk+credential-provider-login@3.972.51/node_modules/@aws-sdk/credential-provider-login/dist-es/LoginCredentialsFetcher.js
113070
113117
  import { createHash as createHash2, createPrivateKey, createPublicKey, sign } from "crypto";
113071
113118
  import { promises as fs6 } from "fs";
113072
- import { homedir as homedir6 } from "os";
113073
- import { dirname as dirname8, join as join14 } from "path";
113119
+ import { homedir as homedir5 } from "os";
113120
+ import { dirname as dirname8, join as join16 } from "path";
113074
113121
  var import_config22, import_protocols3, LoginCredentialsFetcher;
113075
113122
  var init_LoginCredentialsFetcher = __esm(() => {
113076
113123
  import_config22 = __toESM(require_config(), 1);
@@ -113229,10 +113276,10 @@ var init_LoginCredentialsFetcher = __esm(() => {
113229
113276
  await fs6.writeFile(tokenFilePath, JSON.stringify(token, null, 2), "utf8");
113230
113277
  }
113231
113278
  getTokenFilePath() {
113232
- const directory = process.env.AWS_LOGIN_CACHE_DIRECTORY ?? join14(homedir6(), ".aws", "login", "cache");
113279
+ const directory = process.env.AWS_LOGIN_CACHE_DIRECTORY ?? join16(homedir5(), ".aws", "login", "cache");
113233
113280
  const loginSessionBytes = Buffer.from(this.loginSession, "utf8");
113234
113281
  const loginSessionSha256 = createHash2("sha256").update(loginSessionBytes).digest("hex");
113235
- return join14(directory, `${loginSessionSha256}.json`);
113282
+ return join16(directory, `${loginSessionSha256}.json`);
113236
113283
  }
113237
113284
  derToRawSignature(derSignature) {
113238
113285
  let offset = 2;
@@ -113919,7 +113966,7 @@ function probeProxyReachability(proxyUrl) {
113919
113966
  if (!host || !Number.isInteger(port2) || port2 < 1 || port2 > 65535) {
113920
113967
  return Promise.resolve(false);
113921
113968
  }
113922
- return new Promise((resolve7) => {
113969
+ return new Promise((resolve8) => {
113923
113970
  const socket = connect3({ host, port: port2 });
113924
113971
  let done = false;
113925
113972
  const finish = (reachable) => {
@@ -113927,7 +113974,7 @@ function probeProxyReachability(proxyUrl) {
113927
113974
  return;
113928
113975
  done = true;
113929
113976
  socket.destroy();
113930
- resolve7(reachable);
113977
+ resolve8(reachable);
113931
113978
  };
113932
113979
  socket.setTimeout(PROXY_REACHABILITY_TIMEOUT_MS);
113933
113980
  socket.once("connect", () => finish(true));
@@ -126853,35 +126900,35 @@ class IndexedDbStorage {
126853
126900
  getItem(key) {
126854
126901
  return this.withObjectStore("readonly", (store) => {
126855
126902
  const req = store.get(key);
126856
- return new Promise((resolve7) => {
126857
- req.onerror = () => resolve7(null);
126858
- req.onsuccess = () => resolve7(req.result ? req.result.value : null);
126903
+ return new Promise((resolve8) => {
126904
+ req.onerror = () => resolve8(null);
126905
+ req.onsuccess = () => resolve8(req.result ? req.result.value : null);
126859
126906
  });
126860
126907
  }).catch(() => null);
126861
126908
  }
126862
126909
  removeItem(key) {
126863
126910
  return this.withObjectStore("readwrite", (store) => {
126864
126911
  const req = store.delete(key);
126865
- return new Promise((resolve7, reject) => {
126912
+ return new Promise((resolve8, reject) => {
126866
126913
  req.onerror = () => reject(req.error);
126867
- req.onsuccess = () => resolve7();
126914
+ req.onsuccess = () => resolve8();
126868
126915
  });
126869
126916
  });
126870
126917
  }
126871
126918
  setItem(id, value) {
126872
126919
  return this.withObjectStore("readwrite", (store) => {
126873
126920
  const req = store.put({ id, value });
126874
- return new Promise((resolve7, reject) => {
126921
+ return new Promise((resolve8, reject) => {
126875
126922
  req.onerror = () => reject(req.error);
126876
- req.onsuccess = () => resolve7();
126923
+ req.onsuccess = () => resolve8();
126877
126924
  });
126878
126925
  });
126879
126926
  }
126880
126927
  getDb() {
126881
126928
  const openDbRequest = self.indexedDB.open(this.dbName, 1);
126882
- return new Promise((resolve7, reject) => {
126929
+ return new Promise((resolve8, reject) => {
126883
126930
  openDbRequest.onsuccess = () => {
126884
- resolve7(openDbRequest.result);
126931
+ resolve8(openDbRequest.result);
126885
126932
  };
126886
126933
  openDbRequest.onerror = () => {
126887
126934
  reject(openDbRequest.error);
@@ -126902,9 +126949,9 @@ class IndexedDbStorage {
126902
126949
  return this.getDb().then((db) => {
126903
126950
  const tx = db.transaction(STORE_NAME, mode);
126904
126951
  tx.oncomplete = () => db.close();
126905
- return new Promise((resolve7, reject) => {
126952
+ return new Promise((resolve8, reject) => {
126906
126953
  tx.onerror = () => reject(tx.error);
126907
- resolve7(action(tx.objectStore(STORE_NAME)));
126954
+ resolve8(action(tx.objectStore(STORE_NAME)));
126908
126955
  }).catch((err) => {
126909
126956
  db.close();
126910
126957
  throw err;
@@ -127985,11 +128032,11 @@ var init_macOsKeychainStorage = __esm(() => {
127985
128032
 
127986
128033
  // src/utils/secureStorage/plainTextStorage.ts
127987
128034
  import { chmodSync as chmodSync2 } from "fs";
127988
- import { join as join15 } from "path";
128035
+ import { join as join17 } from "path";
127989
128036
  function getStoragePath() {
127990
128037
  const storageDir = getClaudeConfigHomeDir();
127991
128038
  const storageFileName = ".credentials.json";
127992
- return { storageDir, storagePath: join15(storageDir, storageFileName) };
128039
+ return { storageDir, storagePath: join17(storageDir, storageFileName) };
127993
128040
  }
127994
128041
  var plainTextStorage;
127995
128042
  var init_plainTextStorage = __esm(() => {
@@ -128085,25 +128132,25 @@ var init_keychainPrefetch = __esm(() => {
128085
128132
 
128086
128133
  // src/utils/sleep.ts
128087
128134
  function sleep2(ms, signal, opts) {
128088
- return new Promise((resolve7, reject) => {
128135
+ return new Promise((resolve8, reject) => {
128089
128136
  if (signal?.aborted) {
128090
128137
  if (opts?.throwOnAbort || opts?.abortError) {
128091
128138
  reject(opts.abortError?.() ?? new Error("aborted"));
128092
128139
  } else {
128093
- resolve7();
128140
+ resolve8();
128094
128141
  }
128095
128142
  return;
128096
128143
  }
128097
- const timer = setTimeout((signal2, onAbort2, resolve8) => {
128144
+ const timer = setTimeout((signal2, onAbort2, resolve9) => {
128098
128145
  signal2?.removeEventListener("abort", onAbort2);
128099
- resolve8();
128100
- }, ms, signal, onAbort, resolve7);
128146
+ resolve9();
128147
+ }, ms, signal, onAbort, resolve8);
128101
128148
  function onAbort() {
128102
128149
  clearTimeout(timer);
128103
128150
  if (opts?.throwOnAbort || opts?.abortError) {
128104
128151
  reject(opts.abortError?.() ?? new Error("aborted"));
128105
128152
  } else {
128106
- resolve7();
128153
+ resolve8();
128107
128154
  }
128108
128155
  }
128109
128156
  signal?.addEventListener("abort", onAbort, { once: true });
@@ -128532,8 +128579,8 @@ var require_retry3 = __commonJS((exports) => {
128532
128579
  }
128533
128580
  const delay = getNextRetryDelay(config4);
128534
128581
  err.config.retryConfig.currentRetryAttempt += 1;
128535
- const backoff = config4.retryBackoff ? config4.retryBackoff(err, delay) : new Promise((resolve7) => {
128536
- setTimeout(resolve7, delay);
128582
+ const backoff = config4.retryBackoff ? config4.retryBackoff(err, delay) : new Promise((resolve8) => {
128583
+ setTimeout(resolve8, delay);
128537
128584
  });
128538
128585
  if (config4.onRetryAttempt) {
128539
128586
  await config4.onRetryAttempt(err);
@@ -128661,8 +128708,8 @@ var require_helpers = __commonJS((exports) => {
128661
128708
  function req(url3, opts = {}) {
128662
128709
  const href = typeof url3 === "string" ? url3 : url3.href;
128663
128710
  const req2 = (href.startsWith("https:") ? https2 : http4).request(url3, opts);
128664
- const promise2 = new Promise((resolve7, reject) => {
128665
- req2.once("response", resolve7).once("error", reject).end();
128711
+ const promise2 = new Promise((resolve8, reject) => {
128712
+ req2.once("response", resolve8).once("error", reject).end();
128666
128713
  });
128667
128714
  req2.then = promise2.then.bind(promise2);
128668
128715
  return req2;
@@ -128831,7 +128878,7 @@ var require_parse_proxy_response2 = __commonJS((exports) => {
128831
128878
  var debug_1 = __importDefault(require_src());
128832
128879
  var debug3 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response");
128833
128880
  function parseProxyResponse2(socket) {
128834
- return new Promise((resolve7, reject) => {
128881
+ return new Promise((resolve8, reject) => {
128835
128882
  let buffersLength = 0;
128836
128883
  const buffers = [];
128837
128884
  function read() {
@@ -128900,7 +128947,7 @@ var require_parse_proxy_response2 = __commonJS((exports) => {
128900
128947
  }
128901
128948
  debug3("got proxy server response: %o %o", firstLine, headers);
128902
128949
  cleanup();
128903
- resolve7({
128950
+ resolve8({
128904
128951
  connect: {
128905
128952
  statusCode,
128906
128953
  statusText,
@@ -132486,7 +132533,7 @@ var require_util2 = __commonJS((exports) => {
132486
132533
  exports.isValidFile = isValidFile;
132487
132534
  exports.getWellKnownCertificateConfigFileLocation = getWellKnownCertificateConfigFileLocation;
132488
132535
  var fs7 = __require("fs");
132489
- var os5 = __require("os");
132536
+ var os4 = __require("os");
132490
132537
  var path13 = __require("path");
132491
132538
  var WELL_KNOWN_CERTIFICATE_CONFIG_FILE = "certificate_config.json";
132492
132539
  var CLOUDSDK_CONFIG_DIRECTORY = "gcloud";
@@ -132559,7 +132606,7 @@ var require_util2 = __commonJS((exports) => {
132559
132606
  return path13.join(configDir, WELL_KNOWN_CERTIFICATE_CONFIG_FILE);
132560
132607
  }
132561
132608
  function _isWindows() {
132562
- return os5.platform().startsWith("win");
132609
+ return os4.platform().startsWith("win");
132563
132610
  }
132564
132611
  });
132565
132612
 
@@ -134614,7 +134661,7 @@ var require_jwtaccess = __commonJS((exports) => {
134614
134661
  }
134615
134662
  }
134616
134663
  fromStreamAsync(inputStream) {
134617
- return new Promise((resolve7, reject) => {
134664
+ return new Promise((resolve8, reject) => {
134618
134665
  if (!inputStream) {
134619
134666
  reject(new Error("Must pass in a stream containing the service account auth settings."));
134620
134667
  }
@@ -134623,7 +134670,7 @@ var require_jwtaccess = __commonJS((exports) => {
134623
134670
  try {
134624
134671
  const data = JSON.parse(s);
134625
134672
  this.fromJSON(data);
134626
- resolve7();
134673
+ resolve8();
134627
134674
  } catch (err) {
134628
134675
  reject(err);
134629
134676
  }
@@ -134810,7 +134857,7 @@ var require_jwtclient = __commonJS((exports) => {
134810
134857
  }
134811
134858
  }
134812
134859
  fromStreamAsync(inputStream) {
134813
- return new Promise((resolve7, reject) => {
134860
+ return new Promise((resolve8, reject) => {
134814
134861
  if (!inputStream) {
134815
134862
  throw new Error("Must pass in a stream containing the service account auth settings.");
134816
134863
  }
@@ -134819,7 +134866,7 @@ var require_jwtclient = __commonJS((exports) => {
134819
134866
  try {
134820
134867
  const data = JSON.parse(s);
134821
134868
  this.fromJSON(data);
134822
- resolve7();
134869
+ resolve8();
134823
134870
  } catch (e5) {
134824
134871
  reject(e5);
134825
134872
  }
@@ -134920,7 +134967,7 @@ var require_refreshclient = __commonJS((exports) => {
134920
134967
  }
134921
134968
  }
134922
134969
  async fromStreamAsync(inputStream) {
134923
- return new Promise((resolve7, reject) => {
134970
+ return new Promise((resolve8, reject) => {
134924
134971
  if (!inputStream) {
134925
134972
  return reject(new Error("Must pass in a stream containing the user refresh token."));
134926
134973
  }
@@ -134929,7 +134976,7 @@ var require_refreshclient = __commonJS((exports) => {
134929
134976
  try {
134930
134977
  const data = JSON.parse(s);
134931
134978
  this.fromJSON(data);
134932
- return resolve7();
134979
+ return resolve8();
134933
134980
  } catch (err) {
134934
134981
  return reject(err);
134935
134982
  }
@@ -135512,7 +135559,7 @@ var require_filesubjecttokensupplier = __commonJS((exports) => {
135512
135559
  var util_1 = __require("util");
135513
135560
  var fs7 = __require("fs");
135514
135561
  var readFile4 = (0, util_1.promisify)(fs7.readFile ?? (() => {}));
135515
- var realpath = (0, util_1.promisify)(fs7.realpath ?? (() => {}));
135562
+ var realpath2 = (0, util_1.promisify)(fs7.realpath ?? (() => {}));
135516
135563
  var lstat = (0, util_1.promisify)(fs7.lstat ?? (() => {}));
135517
135564
 
135518
135565
  class FileSubjectTokenSupplier {
@@ -135527,7 +135574,7 @@ var require_filesubjecttokensupplier = __commonJS((exports) => {
135527
135574
  async getSubjectToken() {
135528
135575
  let parsedFilePath = this.filePath;
135529
135576
  try {
135530
- parsedFilePath = await realpath(parsedFilePath);
135577
+ parsedFilePath = await realpath2(parsedFilePath);
135531
135578
  if (!(await lstat(parsedFilePath)).isFile()) {
135532
135579
  throw new Error;
135533
135580
  }
@@ -136293,7 +136340,7 @@ var require_pluggable_auth_handler = __commonJS((exports) => {
136293
136340
  this.outputFile = options.outputFile;
136294
136341
  }
136295
136342
  retrieveResponseFromExecutable(envMap) {
136296
- return new Promise((resolve7, reject) => {
136343
+ return new Promise((resolve8, reject) => {
136297
136344
  const child = childProcess.spawn(this.commandComponents[0], this.commandComponents.slice(1), {
136298
136345
  env: { ...process.env, ...Object.fromEntries(envMap) }
136299
136346
  });
@@ -136315,7 +136362,7 @@ var require_pluggable_auth_handler = __commonJS((exports) => {
136315
136362
  try {
136316
136363
  const responseJson = JSON.parse(output);
136317
136364
  const response = new executable_response_1.ExecutableResponse(responseJson);
136318
- return resolve7(response);
136365
+ return resolve8(response);
136319
136366
  } catch (error52) {
136320
136367
  if (error52 instanceof executable_response_1.ExecutableResponseError) {
136321
136368
  return reject(error52);
@@ -136926,7 +136973,7 @@ var require_googleauth = __commonJS((exports) => {
136926
136973
  var fs7 = __require("fs");
136927
136974
  var gaxios_1 = require_src3();
136928
136975
  var gcpMetadata = require_src5();
136929
- var os5 = __require("os");
136976
+ var os4 = __require("os");
136930
136977
  var path13 = __require("path");
136931
136978
  var crypto_1 = require_crypto3();
136932
136979
  var computeclient_1 = require_computeclient();
@@ -137251,7 +137298,7 @@ var require_googleauth = __commonJS((exports) => {
137251
137298
  }
137252
137299
  }
137253
137300
  fromStreamAsync(inputStream, options) {
137254
- return new Promise((resolve7, reject) => {
137301
+ return new Promise((resolve8, reject) => {
137255
137302
  if (!inputStream) {
137256
137303
  throw new Error("Must pass in a stream containing the Google auth settings.");
137257
137304
  }
@@ -137261,7 +137308,7 @@ var require_googleauth = __commonJS((exports) => {
137261
137308
  try {
137262
137309
  const data = JSON.parse(chunks.join(""));
137263
137310
  const r5 = this._cacheClientFromJSON(data, options);
137264
- return resolve7(r5);
137311
+ return resolve8(r5);
137265
137312
  } catch (err) {
137266
137313
  if (!this.keyFilename)
137267
137314
  throw err;
@@ -137271,7 +137318,7 @@ var require_googleauth = __commonJS((exports) => {
137271
137318
  });
137272
137319
  this.cachedCredential = client3;
137273
137320
  this.setGapicJWTValues(client3);
137274
- return resolve7(client3);
137321
+ return resolve8(client3);
137275
137322
  }
137276
137323
  } catch (err) {
137277
137324
  return reject(err);
@@ -137283,7 +137330,7 @@ var require_googleauth = __commonJS((exports) => {
137283
137330
  return new jwtclient_1.JWT({ ...options, apiKey });
137284
137331
  }
137285
137332
  _isWindows() {
137286
- const sys = os5.platform();
137333
+ const sys = os4.platform();
137287
137334
  if (sys && sys.length >= 3) {
137288
137335
  if (sys.substring(0, 3).toLowerCase() === "win") {
137289
137336
  return true;
@@ -137292,16 +137339,16 @@ var require_googleauth = __commonJS((exports) => {
137292
137339
  return false;
137293
137340
  }
137294
137341
  async getDefaultServiceProjectId() {
137295
- return new Promise((resolve7) => {
137342
+ return new Promise((resolve8) => {
137296
137343
  (0, child_process_1.exec)("gcloud config config-helper --format json", (err, stdout) => {
137297
137344
  if (!err && stdout) {
137298
137345
  try {
137299
137346
  const projectId = JSON.parse(stdout).configuration.properties.core.project;
137300
- resolve7(projectId);
137347
+ resolve8(projectId);
137301
137348
  return;
137302
137349
  } catch (e5) {}
137303
137350
  }
137304
- resolve7(null);
137351
+ resolve8(null);
137305
137352
  });
137306
137353
  });
137307
137354
  }
@@ -137973,7 +138020,7 @@ function refreshAwsAuth(awsAuthRefresh) {
137973
138020
  logForDebugging("Running AWS auth refresh command");
137974
138021
  const authStatusManager = AwsAuthStatusManager.getInstance();
137975
138022
  authStatusManager.startAuthentication();
137976
- return new Promise((resolve7) => {
138023
+ return new Promise((resolve8) => {
137977
138024
  const refreshProc = exec3(awsAuthRefresh, {
137978
138025
  timeout: AWS_AUTH_REFRESH_TIMEOUT_MS
137979
138026
  });
@@ -137995,13 +138042,13 @@ function refreshAwsAuth(awsAuthRefresh) {
137995
138042
  if (code === 0) {
137996
138043
  logForDebugging("AWS auth refresh completed successfully");
137997
138044
  authStatusManager.endAuthentication(true);
137998
- resolve7(true);
138045
+ resolve8(true);
137999
138046
  } else {
138000
138047
  const timedOut = signal === "SIGTERM";
138001
138048
  const message = timedOut ? source_default.red("AWS auth refresh timed out after 3 minutes. Run your auth command manually in a separate terminal.") : source_default.red("Error running awsAuthRefresh (in settings or ~/.claude.json):");
138002
138049
  console.error(message);
138003
138050
  authStatusManager.endAuthentication(false);
138004
- resolve7(false);
138051
+ resolve8(false);
138005
138052
  }
138006
138053
  });
138007
138054
  });
@@ -138116,7 +138163,7 @@ function refreshGcpAuth(gcpAuthRefresh) {
138116
138163
  logForDebugging("Running GCP auth refresh command");
138117
138164
  const authStatusManager = AwsAuthStatusManager.getInstance();
138118
138165
  authStatusManager.startAuthentication();
138119
- return new Promise((resolve7) => {
138166
+ return new Promise((resolve8) => {
138120
138167
  const refreshProc = exec3(gcpAuthRefresh, {
138121
138168
  timeout: GCP_AUTH_REFRESH_TIMEOUT_MS
138122
138169
  });
@@ -138138,13 +138185,13 @@ function refreshGcpAuth(gcpAuthRefresh) {
138138
138185
  if (code === 0) {
138139
138186
  logForDebugging("GCP auth refresh completed successfully");
138140
138187
  authStatusManager.endAuthentication(true);
138141
- resolve7(true);
138188
+ resolve8(true);
138142
138189
  } else {
138143
138190
  const timedOut = signal === "SIGTERM";
138144
138191
  const message = timedOut ? source_default.red("GCP auth refresh timed out after 3 minutes. Run your auth command manually in a separate terminal.") : source_default.red("Error running gcpAuthRefresh (in settings or ~/.claude.json):");
138145
138192
  console.error(message);
138146
138193
  authStatusManager.endAuthentication(false);
138147
- resolve7(false);
138194
+ resolve8(false);
138148
138195
  }
138149
138196
  });
138150
138197
  });
@@ -138392,7 +138439,7 @@ var init_user = __esm(() => {
138392
138439
  deviceId,
138393
138440
  sessionId: getSessionId(),
138394
138441
  email: getEmail(),
138395
- appVersion: "4.2.14",
138442
+ appVersion: "4.2.16",
138396
138443
  platform: getHostPlatformForAnalytics(),
138397
138444
  organizationUuid,
138398
138445
  accountUuid,
@@ -138483,7 +138530,7 @@ var init_genericProcessUtils = __esm(() => {
138483
138530
  });
138484
138531
 
138485
138532
  // src/utils/envDynamic.ts
138486
- import { stat as stat3 } from "fs/promises";
138533
+ import { stat as stat5 } from "fs/promises";
138487
138534
  function getIsBubblewrapSandbox() {
138488
138535
  return process.platform === "linux" && isEnvTruthy(process.env.CLAUDE_CODE_BUBBLEWRAP);
138489
138536
  }
@@ -138559,7 +138606,7 @@ var init_envDynamic = __esm(() => {
138559
138606
  });
138560
138607
  if (process.platform === "linux") {
138561
138608
  const muslArch = process.arch === "x64" ? "x86_64" : "aarch64";
138562
- stat3(`/lib/libc.musl-${muslArch}.so.1`).then(() => {
138609
+ stat5(`/lib/libc.musl-${muslArch}.so.1`).then(() => {
138563
138610
  muslRuntimeCache = true;
138564
138611
  }, () => {
138565
138612
  muslRuntimeCache = false;
@@ -138679,7 +138726,7 @@ var init_metadata = __esm(() => {
138679
138726
  "sed"
138680
138727
  ]);
138681
138728
  getVersionBase = memoize_default(() => {
138682
- const match = "4.2.14".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
138729
+ const match = "4.2.16".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
138683
138730
  return match ? match[0] : undefined;
138684
138731
  });
138685
138732
  buildEnvContext = memoize_default(async () => {
@@ -138719,9 +138766,9 @@ var init_metadata = __esm(() => {
138719
138766
  isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
138720
138767
  isClaudeCodeAction: isEnvTruthy(process.env.CLAUDE_CODE_ACTION),
138721
138768
  isClaudeAiAuth: isClaudeAISubscriber(),
138722
- version: "4.2.14",
138769
+ version: "4.2.16",
138723
138770
  versionBase: getVersionBase(),
138724
- buildTime: "2026-07-15T07:34:29.634Z",
138771
+ buildTime: "2026-07-17T11:45:26.183Z",
138725
138772
  deploymentEnvironment: env4.detectDeploymentEnvironment(),
138726
138773
  ...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
138727
138774
  githubEventName: process.env.GITHUB_EVENT_NAME,
@@ -139276,8 +139323,8 @@ var init_growthbook = __esm(() => {
139276
139323
  });
139277
139324
 
139278
139325
  // src/memdir/paths.ts
139279
- import { homedir as homedir7 } from "os";
139280
- import { isAbsolute as isAbsolute3, join as join16, normalize as normalize3, sep as sep4 } from "path";
139326
+ import { homedir as homedir6 } from "os";
139327
+ import { isAbsolute as isAbsolute3, join as join18, normalize as normalize3, sep as sep4 } from "path";
139281
139328
  function getMemoryBaseDir() {
139282
139329
  const remoteMemoryDir = getCostrictEnv("REMOTE_MEMORY_DIR");
139283
139330
  if (remoteMemoryDir) {
@@ -139296,7 +139343,7 @@ function validateMemoryPath(raw, expandTilde) {
139296
139343
  if (restNorm === "." || restNorm === "..") {
139297
139344
  return;
139298
139345
  }
139299
- candidate = join16(homedir7(), rest);
139346
+ candidate = join18(homedir6(), rest);
139300
139347
  }
139301
139348
  const normalized = normalize3(candidate).replace(/[/\\]+$/u, "");
139302
139349
  if (!isAbsolute3(normalized) || normalized.length < 3 || /^[A-Za-z]:$/.test(normalized) || normalized.startsWith("\\\\") || normalized.startsWith("//") || normalized.includes("\x00")) {
@@ -139328,8 +139375,8 @@ var init_paths = __esm(() => {
139328
139375
  if (override) {
139329
139376
  return override;
139330
139377
  }
139331
- const projectsDir = join16(getMemoryBaseDir(), "projects");
139332
- return (join16(projectsDir, sanitizePath(getAutoMemBase()), AUTO_MEM_DIRNAME) + sep4).normalize("NFC");
139378
+ const projectsDir = join18(getMemoryBaseDir(), "projects");
139379
+ return (join18(projectsDir, sanitizePath(getAutoMemBase()), AUTO_MEM_DIRNAME) + sep4).normalize("NFC");
139333
139380
  }, () => getProjectRoot());
139334
139381
  });
139335
139382
 
@@ -139346,7 +139393,7 @@ var init_configConstants = () => {};
139346
139393
  // src/utils/config.ts
139347
139394
  import { randomBytes } from "crypto";
139348
139395
  import { unwatchFile as unwatchFile2, watchFile as watchFile2 } from "fs";
139349
- import { basename as basename3, dirname as dirname9, join as join17, resolve as resolve7 } from "path";
139396
+ import { basename as basename3, dirname as dirname9, join as join19, resolve as resolve8 } from "path";
139350
139397
  function createDefaultGlobalConfig() {
139351
139398
  return {
139352
139399
  numStartups: 0,
@@ -139411,7 +139458,7 @@ function computeTrustDialogAccepted() {
139411
139458
  if (pathConfig?.hasTrustDialogAccepted) {
139412
139459
  return true;
139413
139460
  }
139414
- const parentPath = normalizePathForConfigKey(resolve7(currentPath, ".."));
139461
+ const parentPath = normalizePathForConfigKey(resolve8(currentPath, ".."));
139415
139462
  if (parentPath === currentPath) {
139416
139463
  break;
139417
139464
  }
@@ -139699,14 +139746,14 @@ function saveConfigWithLock(file2, createDefault, mergeFn, readCurrent) {
139699
139746
  const mostRecentTimestamp = mostRecentBackup ? Number(mostRecentBackup.split(".backup.").pop()) : 0;
139700
139747
  const shouldCreateBackup = Number.isNaN(mostRecentTimestamp) || Date.now() - mostRecentTimestamp >= MIN_BACKUP_INTERVAL_MS;
139701
139748
  if (shouldCreateBackup) {
139702
- const backupPath = join17(backupDir, `${fileBase}.backup.${Date.now()}`);
139749
+ const backupPath = join19(backupDir, `${fileBase}.backup.${Date.now()}`);
139703
139750
  fs7.copyFileSync(file2, backupPath);
139704
139751
  }
139705
139752
  const MAX_BACKUPS = 5;
139706
139753
  const backupsForCleanup = shouldCreateBackup ? fs7.readdirStringSync(backupDir).filter((f5) => f5.startsWith(`${fileBase}.backup.`)).sort().reverse() : existingBackups;
139707
139754
  for (const oldBackup of backupsForCleanup.slice(MAX_BACKUPS)) {
139708
139755
  try {
139709
- fs7.unlinkSync(join17(backupDir, oldBackup));
139756
+ fs7.unlinkSync(join19(backupDir, oldBackup));
139710
139757
  } catch {}
139711
139758
  }
139712
139759
  } catch (e5) {
@@ -139732,7 +139779,7 @@ function saveConfigWithLock(file2, createDefault, mergeFn, readCurrent) {
139732
139779
  }
139733
139780
  }
139734
139781
  function getConfigBackupDir() {
139735
- return join17(getClaudeConfigHomeDir(), "backups");
139782
+ return join19(getClaudeConfigHomeDir(), "backups");
139736
139783
  }
139737
139784
  function findMostRecentBackup(file2) {
139738
139785
  const fs7 = getFsImplementation();
@@ -139741,7 +139788,7 @@ function findMostRecentBackup(file2) {
139741
139788
  const backupDirs = [primaryBackupDir];
139742
139789
  const legacyHome = getLegacyConfigHomeDir();
139743
139790
  if (legacyHome) {
139744
- const legacyBackupDir = join17(legacyHome, "backups");
139791
+ const legacyBackupDir = join19(legacyHome, "backups");
139745
139792
  if (legacyBackupDir !== primaryBackupDir) {
139746
139793
  backupDirs.push(legacyBackupDir);
139747
139794
  }
@@ -139751,7 +139798,7 @@ function findMostRecentBackup(file2) {
139751
139798
  const backups = fs7.readdirStringSync(backupDir).filter((f5) => f5.startsWith(`${fileBase}.backup.`)).sort();
139752
139799
  const mostRecent = backups.at(-1);
139753
139800
  if (mostRecent) {
139754
- return join17(backupDir, mostRecent);
139801
+ return join19(backupDir, mostRecent);
139755
139802
  }
139756
139803
  } catch {}
139757
139804
  }
@@ -139760,7 +139807,7 @@ function findMostRecentBackup(file2) {
139760
139807
  const backups = fs7.readdirStringSync(fileDir).filter((f5) => f5.startsWith(`${fileBase}.backup.`)).sort();
139761
139808
  const mostRecent = backups.at(-1);
139762
139809
  if (mostRecent) {
139763
- return join17(fileDir, mostRecent);
139810
+ return join19(fileDir, mostRecent);
139764
139811
  }
139765
139812
  const legacyBackup = `${file2}.backup`;
139766
139813
  try {
@@ -139843,7 +139890,7 @@ Claude configuration file at ${file2} is corrupted: ${error52.message}
139843
139890
  const currentContent = fs7.readFileSync(file2, { encoding: "utf-8" });
139844
139891
  for (const backup of existingCorruptedBackups) {
139845
139892
  try {
139846
- const backupContent = fs7.readFileSync(join17(corruptedBackupDir, backup), { encoding: "utf-8" });
139893
+ const backupContent = fs7.readFileSync(join19(corruptedBackupDir, backup), { encoding: "utf-8" });
139847
139894
  if (currentContent === backupContent) {
139848
139895
  alreadyBackedUp = true;
139849
139896
  break;
@@ -139851,7 +139898,7 @@ Claude configuration file at ${file2} is corrupted: ${error52.message}
139851
139898
  } catch {}
139852
139899
  }
139853
139900
  if (!alreadyBackedUp) {
139854
- corruptedBackupPath = join17(corruptedBackupDir, `${fileBase}.corrupted.${Date.now()}`);
139901
+ corruptedBackupPath = join19(corruptedBackupDir, `${fileBase}.corrupted.${Date.now()}`);
139855
139902
  try {
139856
139903
  fs7.copyFileSync(file2, corruptedBackupPath);
139857
139904
  logForDebugging(`Corrupted config backed up to: ${corruptedBackupPath}`, {
@@ -139946,7 +139993,7 @@ var init_config2 = __esm(() => {
139946
139993
  if (gitRoot) {
139947
139994
  return normalizePathForConfigKey(gitRoot);
139948
139995
  }
139949
- return normalizePathForConfigKey(resolve7(originalCwd));
139996
+ return normalizePathForConfigKey(resolve8(originalCwd));
139950
139997
  });
139951
139998
  });
139952
139999
 
@@ -140130,39 +140177,60 @@ import { appendFileSync } from "fs";
140130
140177
  import path2 from "path";
140131
140178
 
140132
140179
  // src/services/rawDump/dirs.ts
140180
+ init_memoize();
140181
+ init_envUtils();
140182
+ init_sessionStoragePortable();
140133
140183
  import fs from "fs";
140134
- import os from "os";
140184
+ import { stat as stat2 } from "fs/promises";
140135
140185
  import path from "path";
140136
- function getCscDir() {
140137
- const candidates = [
140138
- process.env.COSTRICT_CONFIG_DIR || "",
140139
- path.join(os.homedir(), ".costrict"),
140140
- process.env.CLAUDE_CONFIG_DIR || "",
140141
- path.join(os.homedir(), ".claude")
140142
- ];
140143
- const exists = (d) => d && fs.existsSync(path.join(d, "history.jsonl"));
140144
- return candidates.find(exists) || path.join(os.homedir(), ".costrict");
140145
- }
140146
- function getRawDumpDir() {
140147
- return path.join(getCscDir(), "raw-dump");
140148
- }
140149
- function normalizeProjectPath(dir) {
140150
- return dir.replace(/:/gu, "-").replace(/[/\\]/gu, "-");
140186
+ var getRawDumpDir = memoize_default(() => {
140187
+ const primary = path.join(getCostrictConfigHomeDir(), "raw-dump");
140188
+ if (!hasState(primary)) {
140189
+ const legacyHome = getLegacyConfigHomeDir();
140190
+ if (legacyHome) {
140191
+ const legacyDir = path.join(legacyHome, "raw-dump");
140192
+ if (hasState(legacyDir))
140193
+ return legacyDir;
140194
+ }
140195
+ }
140196
+ return primary;
140197
+ }, () => process.env.COSTRICT_CONFIG_DIR ?? process.env.CLAUDE_CONFIG_DIR);
140198
+ function hasState(dir) {
140199
+ try {
140200
+ return fs.readdirSync(dir).length > 0;
140201
+ } catch {
140202
+ return false;
140203
+ }
140151
140204
  }
140152
- function getSessionDirectory(directory) {
140153
- const claudeHome = getCscDir();
140154
- const projectPath = normalizeProjectPath(directory);
140155
- const candidates = [
140156
- path.join(claudeHome, "projects", projectPath),
140157
- path.join(claudeHome, "transcripts"),
140158
- path.join(claudeHome, "sessions"),
140159
- path.join(directory, ".claude", "sessions"),
140160
- path.join(directory, ".claude"),
140161
- directory,
140162
- process.env.CSC_SESSION_DIR || ""
140163
- ];
140164
- const exists = (d) => d && fs.existsSync(d);
140165
- return candidates.find(exists) || directory;
140205
+ async function resolveTranscriptPath(directory, sessionId, preferredPath) {
140206
+ const fileName = `${sessionId}.jsonl`;
140207
+ if (preferredPath && path.basename(preferredPath) === fileName) {
140208
+ try {
140209
+ const canonicalPreferred = await canonicalizePath(preferredPath);
140210
+ const s = await stat2(canonicalPreferred);
140211
+ if (s.size > 0)
140212
+ return canonicalPreferred;
140213
+ } catch {}
140214
+ }
140215
+ const canonicalDirectory = await canonicalizePath(directory);
140216
+ const projectsDir = await canonicalizePath(path.join(getCostrictConfigHomeDir(), "projects"));
140217
+ const relativeToProjects = path.relative(projectsDir, canonicalDirectory);
140218
+ const isTranscriptStorageDir = relativeToProjects !== "" && relativeToProjects !== ".." && !relativeToProjects.startsWith(`..${path.sep}`) && !path.isAbsolute(relativeToProjects);
140219
+ if (isTranscriptStorageDir) {
140220
+ const direct = path.join(canonicalDirectory, fileName);
140221
+ try {
140222
+ const s = await stat2(direct);
140223
+ if (s.size > 0)
140224
+ return direct;
140225
+ } catch {}
140226
+ }
140227
+ const viaProject = path.join(getProjectDir(canonicalDirectory), fileName);
140228
+ try {
140229
+ const s = await stat2(viaProject);
140230
+ if (s.size > 0)
140231
+ return viaProject;
140232
+ } catch {}
140233
+ return;
140166
140234
  }
140167
140235
 
140168
140236
  // src/services/rawDump/logger.ts
@@ -140550,6 +140618,9 @@ function addQueueTasks(tasks) {
140550
140618
  if (existing) {
140551
140619
  if (task.enqueuedAt > existing.enqueuedAt) {
140552
140620
  existing.enqueuedAt = task.enqueuedAt;
140621
+ if (task.transcriptPath) {
140622
+ existing.transcriptPath = task.transcriptPath;
140623
+ }
140553
140624
  }
140554
140625
  } else {
140555
140626
  state_task.tasks[key] = {
@@ -140557,6 +140628,7 @@ function addQueueTasks(tasks) {
140557
140628
  uploadedAt: "",
140558
140629
  attemptCount: 0,
140559
140630
  directory: task.directory,
140631
+ transcriptPath: task.transcriptPath,
140560
140632
  sessionId: task.sessionId,
140561
140633
  messageId: task.messageId,
140562
140634
  historyNo: undefined
@@ -140581,8 +140653,8 @@ init_credentials();
140581
140653
  init_token();
140582
140654
  import { promises as fs12 } from "fs";
140583
140655
  import { createHash as createHash4 } from "crypto";
140584
- import os5 from "os";
140585
- import path20 from "path";
140656
+ import os4 from "os";
140657
+ import path19 from "path";
140586
140658
 
140587
140659
  // src/costrict/provider/tokenManager.ts
140588
140660
  init_credentials();
@@ -140912,7 +140984,7 @@ function getRawDumpMode() {
140912
140984
  return 3;
140913
140985
  return 1;
140914
140986
  }
140915
- function normalizeProjectPath2(dir) {
140987
+ function normalizeProjectPath(dir) {
140916
140988
  return dir.replace(/:/gu, "-").replace(/[/\\]/gu, "-");
140917
140989
  }
140918
140990
  function getDateFromTimestamp(ts) {
@@ -140945,7 +141017,7 @@ async function writeLocalDump(type, body) {
140945
141017
  endpoint = "/raw-store/task-conversation";
140946
141018
  } else if (type == "commit") {
140947
141019
  ymd = getDateFromTimestamp(getTimestampField("commit", body));
140948
- subdir = path15.join(normalizeProjectPath2(body.repo_addr), normalizeProjectPath2(body.repo_branch), ymd);
141020
+ subdir = path15.join(normalizeProjectPath(body.repo_addr), normalizeProjectPath(body.repo_branch), ymd);
140949
141021
  fname = body.commit_id;
140950
141022
  endpoint = "/raw-store/commit";
140951
141023
  } else if (type == "statistics") {
@@ -140957,7 +141029,7 @@ async function writeLocalDump(type, body) {
140957
141029
  fname = `${h6}-${m3}-${s}`;
140958
141030
  endpoint = "/raw-store/statistics";
140959
141031
  } else if (type == "raw") {
140960
- subdir = path15.join(normalizeProjectPath2(body.project), body.session_id);
141032
+ subdir = path15.join(normalizeProjectPath(body.project), body.session_id);
140961
141033
  fname = String(body.start_cursor);
140962
141034
  endpoint = "/raw-store/raw-log";
140963
141035
  } else {
@@ -140986,12 +141058,24 @@ import { promises as fs9 } from "fs";
140986
141058
  import path17 from "path";
140987
141059
 
140988
141060
  // src/services/rawDump/lock.ts
141061
+ import { randomUUID as randomUUID4 } from "crypto";
140989
141062
  import { promises as fs8 } from "fs";
140990
141063
  import path16 from "path";
140991
141064
  var LOCK_INFO_FILE = "lock.json";
141065
+ var PUBLICATION_GRACE_MS = 5000;
140992
141066
  async function isHolderAlive(lockDir) {
141067
+ let text;
141068
+ try {
141069
+ text = await fs8.readFile(path16.join(lockDir, LOCK_INFO_FILE), "utf-8");
141070
+ } catch {
141071
+ try {
141072
+ const st = await fs8.stat(lockDir);
141073
+ return Date.now() - st.mtimeMs < PUBLICATION_GRACE_MS;
141074
+ } catch {
141075
+ return false;
141076
+ }
141077
+ }
140993
141078
  try {
140994
- const text = await fs8.readFile(path16.join(lockDir, LOCK_INFO_FILE), "utf-8");
140995
141079
  const info = JSON.parse(text);
140996
141080
  if (!info.pid || typeof info.pid !== "number")
140997
141081
  return false;
@@ -141005,7 +141089,49 @@ async function isHolderAlive(lockDir) {
141005
141089
  return false;
141006
141090
  }
141007
141091
  }
141092
+ var RECLAIM_MUTEX_STALE_MS = 30000;
141093
+ var RECLAIM_LEASE_MS = RECLAIM_MUTEX_STALE_MS / 2;
141094
+ async function acquireReclaimMutex(mutexDir) {
141095
+ for (let attempt = 0;attempt < 2; attempt++) {
141096
+ try {
141097
+ await fs8.mkdir(mutexDir, { recursive: false });
141098
+ return true;
141099
+ } catch {
141100
+ try {
141101
+ const st = await fs8.stat(mutexDir);
141102
+ if (Date.now() - st.mtimeMs < RECLAIM_MUTEX_STALE_MS)
141103
+ return false;
141104
+ await fs8.rm(mutexDir, { recursive: true, force: true });
141105
+ } catch {}
141106
+ }
141107
+ }
141108
+ return false;
141109
+ }
141110
+ async function reclaimStaleLock(lockDir) {
141111
+ const mutexDir = `${lockDir}.reclaim.d`;
141112
+ if (!await acquireReclaimMutex(mutexDir)) {
141113
+ return false;
141114
+ }
141115
+ const leaseStart = Date.now();
141116
+ const withinLease = () => Date.now() - leaseStart < RECLAIM_LEASE_MS;
141117
+ try {
141118
+ if (await isHolderAlive(lockDir))
141119
+ return false;
141120
+ if (!withinLease())
141121
+ return false;
141122
+ await fs8.rm(lockDir, { recursive: true, force: true });
141123
+ return true;
141124
+ } catch {
141125
+ return false;
141126
+ } finally {
141127
+ if (withinLease()) {
141128
+ await fs8.rm(mutexDir, { recursive: true, force: true }).catch(() => {});
141129
+ }
141130
+ }
141131
+ }
141008
141132
  async function acquireLock(lockDir, info) {
141133
+ const token = info.token ?? randomUUID4();
141134
+ const payload = JSON.stringify({ ...info, token });
141009
141135
  let retried = false;
141010
141136
  while (true) {
141011
141137
  try {
@@ -141013,46 +141139,63 @@ async function acquireLock(lockDir, info) {
141013
141139
  } catch (err) {
141014
141140
  if (err.code === "EEXIST") {
141015
141141
  if (retried)
141016
- return false;
141017
- const alive = await isHolderAlive(lockDir);
141018
- if (alive)
141019
- return false;
141020
- try {
141021
- await fs8.rm(lockDir, { recursive: true, force: true });
141022
- } catch {
141023
- return false;
141024
- }
141142
+ return null;
141143
+ if (await isHolderAlive(lockDir))
141144
+ return null;
141145
+ if (!await reclaimStaleLock(lockDir))
141146
+ return null;
141025
141147
  retried = true;
141026
141148
  continue;
141027
141149
  }
141028
- return false;
141150
+ return null;
141029
141151
  }
141030
141152
  try {
141031
- await fs8.writeFile(path16.join(lockDir, LOCK_INFO_FILE), JSON.stringify(info), "utf-8");
141032
- return true;
141153
+ await fs8.writeFile(path16.join(lockDir, LOCK_INFO_FILE), payload, "utf-8");
141033
141154
  } catch {
141034
- await releaseLock(lockDir);
141035
- return false;
141155
+ await releaseLock(lockDir, token);
141156
+ return null;
141036
141157
  }
141158
+ try {
141159
+ const current = JSON.parse(await fs8.readFile(path16.join(lockDir, LOCK_INFO_FILE), "utf-8"));
141160
+ if (current.token === token && current.pid === info.pid)
141161
+ return token;
141162
+ } catch {}
141163
+ return null;
141037
141164
  }
141038
141165
  }
141039
- async function releaseLock(lockDir) {
141166
+ async function releaseLock(lockDir, token) {
141040
141167
  try {
141168
+ const text = await fs8.readFile(path16.join(lockDir, LOCK_INFO_FILE), "utf-8").catch(() => null);
141169
+ if (text !== null) {
141170
+ try {
141171
+ const info = JSON.parse(text);
141172
+ if (token && info.token && info.token !== token) {
141173
+ return;
141174
+ }
141175
+ if (!token && info.pid && typeof info.pid === "number" && info.pid !== process.pid) {
141176
+ return;
141177
+ }
141178
+ } catch {}
141179
+ }
141041
141180
  await fs8.rm(lockDir, { recursive: true, force: true });
141042
141181
  } catch {}
141043
141182
  }
141044
141183
 
141045
141184
  // src/services/rawDump/queue.ts
141046
- var QUEUE_FILE = path17.join(getRawDumpDir(), "csc-work-queue.jsonl");
141047
- var QUEUE_LOCK_DIR = path17.join(getRawDumpDir(), "csc-work-queue.lock.d");
141185
+ function getQueueFile() {
141186
+ return path17.join(getRawDumpDir(), "csc-work-queue.jsonl");
141187
+ }
141188
+ function getQueueLockDir() {
141189
+ return path17.join(getRawDumpDir(), "csc-work-queue.lock.d");
141190
+ }
141048
141191
  var MAX_ATTEMPTS = 4;
141049
141192
  var queue = [];
141050
141193
  var queueLoaded = false;
141051
- async function loadQueue() {
141052
- if (queueLoaded)
141194
+ async function loadQueue(force = false) {
141195
+ if (queueLoaded && !force)
141053
141196
  return;
141054
141197
  try {
141055
- const text = await fs9.readFile(QUEUE_FILE, "utf-8");
141198
+ const text = await fs9.readFile(getQueueFile(), "utf-8");
141056
141199
  queue = text.split(`
141057
141200
  `).filter(Boolean).map((line) => {
141058
141201
  try {
@@ -141061,32 +141204,43 @@ async function loadQueue() {
141061
141204
  return null;
141062
141205
  }
141063
141206
  }).filter((t2) => t2 !== null);
141064
- } catch {
141207
+ } catch (err) {
141208
+ if (err.code !== "ENOENT")
141209
+ throw err;
141065
141210
  queue = [];
141066
141211
  }
141067
141212
  queueLoaded = true;
141068
141213
  }
141069
- function clearQueue() {
141214
+ async function clearQueue() {
141070
141215
  queue = [];
141071
- fs9.writeFile(QUEUE_FILE, "", "utf-8").catch(() => {});
141216
+ await fs9.writeFile(getQueueFile(), "", "utf-8");
141072
141217
  }
141073
141218
  function getQueue() {
141074
141219
  return [...queue];
141075
141220
  }
141221
+ var queueLockToken = null;
141076
141222
  async function acquireQueueLock() {
141077
- return acquireLock(QUEUE_LOCK_DIR, {
141223
+ const token = await acquireLock(getQueueLockDir(), {
141078
141224
  pid: process.pid,
141079
141225
  startedAt: new Date().toISOString()
141080
141226
  });
141227
+ if (token)
141228
+ queueLockToken = token;
141229
+ return token !== null;
141081
141230
  }
141082
141231
  async function releaseQueueLock() {
141083
- await releaseLock(QUEUE_LOCK_DIR);
141232
+ if (!queueLockToken)
141233
+ return;
141234
+ const token = queueLockToken;
141235
+ queueLockToken = null;
141236
+ await releaseLock(getQueueLockDir(), token);
141084
141237
  }
141085
141238
 
141086
141239
  // src/services/rawDump/history.ts
141240
+ init_envUtils();
141087
141241
  import { promises as fs10 } from "fs";
141088
141242
  import path18 from "path";
141089
- var HISTORY_FILE = path18.join(getCscDir(), "history.jsonl");
141243
+ var HISTORY_FILE = path18.join(getCostrictConfigHomeDir(), "history.jsonl");
141090
141244
  var cache7 = null;
141091
141245
  async function loadHistory() {
141092
141246
  const items = [];
@@ -141152,7 +141306,6 @@ async function getProjectDirs() {
141152
141306
 
141153
141307
  // src/services/rawDump/session.ts
141154
141308
  import { promises as fs11 } from "fs";
141155
- import path19 from "path";
141156
141309
 
141157
141310
  // src/services/rawDump/parse.ts
141158
141311
  function buildFlows(events) {
@@ -141254,10 +141407,15 @@ function fillConversation(conv, allSessionEvents) {
141254
141407
  conv.preview = conv.requestContent.substring(0, 80);
141255
141408
  const responseTexts = [];
141256
141409
  for (let j6 = 1;j6 < conv.events.length; j6++) {
141257
- const text = getTextContent(conv.events[j6].message?.content);
141410
+ const event = conv.events[j6];
141411
+ if (event.type !== "assistant")
141412
+ continue;
141413
+ const text = getAssistantTextContent(event.message?.content);
141258
141414
  if (text)
141259
141415
  responseTexts.push(text);
141260
141416
  }
141417
+ conv.responseContent = responseTexts.join(`
141418
+ `);
141261
141419
  const diffs = [];
141262
141420
  const toolEvents = [];
141263
141421
  let model = "";
@@ -141317,6 +141475,21 @@ function getTextContent(content) {
141317
141475
  }
141318
141476
  return String(content);
141319
141477
  }
141478
+ function getAssistantTextContent(content) {
141479
+ if (typeof content === "string")
141480
+ return content;
141481
+ if (!Array.isArray(content))
141482
+ return "";
141483
+ return content.map((item) => {
141484
+ if (typeof item === "string")
141485
+ return item;
141486
+ if (typeof item === "object" && item !== null && item.type === "text") {
141487
+ return String(item.text || "");
141488
+ }
141489
+ return "";
141490
+ }).filter(Boolean).join(`
141491
+ `);
141492
+ }
141320
141493
  function detectSender(assistant, user) {
141321
141494
  const mode = String(assistant.mode ?? "");
141322
141495
  if (mode === "agent" || mode === "auto")
@@ -141672,24 +141845,20 @@ function parseSession(cacheConversations, events) {
141672
141845
  // src/services/rawDump/session.ts
141673
141846
  var log3 = createLogger("session");
141674
141847
  async function loadSessionMessages(sessionFile) {
141675
- try {
141676
- const text = await fs11.readFile(sessionFile, "utf-8");
141677
- const messages = text.split(`
141848
+ const text = await fs11.readFile(sessionFile, "utf-8");
141849
+ const messages = text.split(`
141678
141850
  `).filter(Boolean).map((line) => {
141679
- try {
141680
- return JSON.parse(line);
141681
- } catch {
141682
- return null;
141683
- }
141684
- }).filter((m3) => m3 !== null);
141685
- log3.debug("loaded messages from file", {
141686
- sessionFile,
141687
- count: messages.length
141688
- });
141689
- return messages;
141690
- } catch {
141691
- return [];
141692
- }
141851
+ try {
141852
+ return JSON.parse(line);
141853
+ } catch {
141854
+ return null;
141855
+ }
141856
+ }).filter((m3) => m3 !== null);
141857
+ log3.debug("loaded messages from file", {
141858
+ sessionFile,
141859
+ count: messages.length
141860
+ });
141861
+ return messages;
141693
141862
  }
141694
141863
  var sessionMessagesCache = new Map;
141695
141864
  function cleanupOldSessions() {
@@ -141701,24 +141870,14 @@ function cleanupOldSessions() {
141701
141870
  }
141702
141871
  }
141703
141872
  }
141704
- async function getParsedSession(taskDir, sessionId) {
141705
- const sessionDir = getSessionDirectory(taskDir);
141706
- const cacheKey = `${sessionDir}:${sessionId}`;
141707
- const cached3 = sessionMessagesCache.get(cacheKey);
141708
- const sessionFile = path19.join(sessionDir, `${sessionId}.jsonl`);
141709
- let stats;
141710
- try {
141711
- stats = await fs11.stat(sessionFile);
141712
- } catch {
141713
- return {
141714
- sessionJsonlFileName: sessionFile,
141715
- fileTimestamp: 0,
141716
- cacheTimestamp: Date.now(),
141717
- fileSize: 0,
141718
- messages: [],
141719
- parsedSession: parseSession([], [])
141720
- };
141873
+ async function getParsedSession(taskDir, sessionId, preferredTranscriptPath) {
141874
+ const sessionFile = await resolveTranscriptPath(taskDir, sessionId, preferredTranscriptPath);
141875
+ if (!sessionFile) {
141876
+ throw new Error(`session transcript not found for session ${sessionId} under ${taskDir}`);
141721
141877
  }
141878
+ const cacheKey = sessionFile;
141879
+ const cached3 = sessionMessagesCache.get(cacheKey);
141880
+ const stats = await fs11.stat(sessionFile);
141722
141881
  const needsReanalysis = !cached3 || cached3.fileTimestamp !== stats.mtimeMs || cached3.fileSize !== stats.size || !cached3.parsedSession;
141723
141882
  if (!needsReanalysis && cached3) {
141724
141883
  log3.debug("using cached parsed session", { sessionId });
@@ -141726,7 +141885,7 @@ async function getParsedSession(taskDir, sessionId) {
141726
141885
  }
141727
141886
  cleanupOldSessions();
141728
141887
  const start = Date.now();
141729
- const messages = cached3?.messages ?? await loadSessionMessages(sessionFile);
141888
+ const messages = await loadSessionMessages(sessionFile);
141730
141889
  const elapsed = Date.now() - start;
141731
141890
  if (elapsed > 100) {
141732
141891
  log3.info("loadSessionMessages slow", { sessionId, elapsedMs: elapsed });
@@ -141787,7 +141946,16 @@ async function statHistorySessions() {
141787
141946
  });
141788
141947
  const sessionDateMap = new Map;
141789
141948
  for (const item of uniqueItems) {
141790
- const cacheEntry = await getParsedSession(item.project, item.sessionId);
141949
+ const cacheEntry = await getParsedSession(item.project, item.sessionId).catch((err) => {
141950
+ log4.warn("statistics: \u8DF3\u8FC7\u4F1A\u8BDD\uFF08transcript \u672A\u89E3\u6790\uFF09", {
141951
+ sessionId: item.sessionId,
141952
+ project: item.project,
141953
+ error: err instanceof Error ? err.message : String(err)
141954
+ });
141955
+ return null;
141956
+ });
141957
+ if (!cacheEntry)
141958
+ continue;
141791
141959
  const messages = cacheEntry.messages;
141792
141960
  if (!messages || messages.length === 0)
141793
141961
  continue;
@@ -141871,7 +142039,6 @@ async function statHistorySessions() {
141871
142039
 
141872
142040
  // src/services/rawDump/worker.ts
141873
142041
  var log5 = createLogger("worker");
141874
- var CSC_DIR = getCscDir();
141875
142042
  var REQUEST_TIMEOUT_MS = 30000;
141876
142043
  var TOOL_EVENTS_PAYLOAD_BUDGET = 256 * 1024;
141877
142044
  function capToolEventsPayload(events) {
@@ -141898,12 +142065,12 @@ async function getCachedRepoInfo(directory) {
141898
142065
  }
141899
142066
  async function processTask(task, authData) {
141900
142067
  log5.info("processing task:", { task });
141901
- await uploadRaw(task.sessionId, task.directory, authData);
142068
+ await uploadRaw(task.sessionId, task.directory, authData, task.transcriptPath);
141902
142069
  const repoInfo = await getCachedRepoInfo(task.directory);
141903
- const cacheEntry = await getParsedSession(task.directory, task.sessionId);
142070
+ const cacheEntry = await getParsedSession(task.directory, task.sessionId, task.transcriptPath);
141904
142071
  const parsedSession = cacheEntry.parsedSession;
141905
142072
  if (parsedSession.conversations.length === 0) {
141906
- log5.warn("no conversations found", { task });
142073
+ throw new Error(`session transcript contains no conversations: ${cacheEntry.sessionJsonlFileName}`);
141907
142074
  }
141908
142075
  await uploadSummary({ sessionId: task.sessionId, directory: task.directory, parsedSession }, authData);
141909
142076
  for (const conv of parsedSession.conversations) {
@@ -141994,7 +142161,7 @@ async function postJson(url3, body, headers, maxAttempts = 3) {
141994
142161
  for (let attempt = 0;attempt < maxAttempts; attempt++) {
141995
142162
  if (attempt > 0) {
141996
142163
  const delay = 5000 * 2 ** (attempt - 1);
141997
- await new Promise((resolve8) => setTimeout(resolve8, delay));
142164
+ await new Promise((resolve9) => setTimeout(resolve9, delay));
141998
142165
  }
141999
142166
  const controller = new AbortController;
142000
142167
  const timer = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS);
@@ -142171,7 +142338,7 @@ async function authWithFallback() {
142171
142338
  const version4 = getClientVersion();
142172
142339
  let deviceId = process.env.CSC_DEVICE_ID;
142173
142340
  if (!deviceId) {
142174
- const deviceIdFile = path20.join(getLocalDumpDir(), "device-id");
142341
+ const deviceIdFile = path19.join(getLocalDumpDir(), "device-id");
142175
142342
  try {
142176
142343
  deviceId = (await fs12.readFile(deviceIdFile, "utf-8")).trim();
142177
142344
  } catch {}
@@ -142208,10 +142375,14 @@ async function authWithFallback() {
142208
142375
  };
142209
142376
  }
142210
142377
  }
142211
- async function uploadRaw(sessionId, directory, authData) {
142212
- const normalizedProject = normalizeProjectPath2(directory);
142378
+ async function uploadRaw(sessionId, directory, authData, transcriptPath) {
142379
+ const normalizedProject = normalizeProjectPath(directory);
142213
142380
  const stateKey = `${normalizedProject}/${sessionId}`;
142214
- const filePath = path20.join(CSC_DIR, "projects", normalizedProject, `${sessionId}.jsonl`);
142381
+ const filePath = await resolveTranscriptPath(directory, sessionId, transcriptPath);
142382
+ if (!filePath) {
142383
+ log5.debug("raw file not found, skip", { sessionId, directory });
142384
+ return;
142385
+ }
142215
142386
  const lastReportedCount = state_raw.logs[stateKey] ?? 0;
142216
142387
  let fileContent;
142217
142388
  try {
@@ -142373,7 +142544,7 @@ async function uploadSummary(payload, authData) {
142373
142544
  client_ide: "cli",
142374
142545
  client_version: authData.version,
142375
142546
  client_os: detectOs(),
142376
- client_os_version: os5.release(),
142547
+ client_os_version: os4.release(),
142377
142548
  caller: process.env.CSC_RAW_DUMP_CALLER || "chat"
142378
142549
  };
142379
142550
  await uploadReport(authData, "/raw-store/task-summary", body);
@@ -142540,12 +142711,12 @@ async function processIncompleteTasks(authData) {
142540
142711
  });
142541
142712
  state_task.tasks[key].uploadedAt = "DEAD_LETTER";
142542
142713
  state_task.incomplete--;
142543
- await saveTasks();
142544
142714
  log5.error("task moved to dead letter", {
142545
142715
  key,
142546
142716
  attemptCount: state_task.tasks[key].attemptCount
142547
142717
  });
142548
142718
  }
142719
+ await saveTasks();
142549
142720
  }
142550
142721
  }
142551
142722
  }
@@ -142662,6 +142833,7 @@ async function runQueueTimer() {
142662
142833
  return;
142663
142834
  }
142664
142835
  try {
142836
+ await loadQueue(true);
142665
142837
  const newTasks = getQueue();
142666
142838
  if (newTasks.length === 0) {
142667
142839
  if (state_task.incomplete === 0) {
@@ -142673,7 +142845,7 @@ async function runQueueTimer() {
142673
142845
  log5.info(`processing ${newTasks.length} new tasks`);
142674
142846
  addQueueTasks(newTasks);
142675
142847
  await saveTasks();
142676
- clearQueue();
142848
+ await clearQueue();
142677
142849
  } catch (err) {
142678
142850
  log5.error("queue timer failed", {
142679
142851
  error: err instanceof Error ? err.message : String(err)
@@ -142701,18 +142873,26 @@ if (scriptPath.endsWith("worker.ts") || scriptPath.endsWith("worker.js")) {
142701
142873
  }
142702
142874
 
142703
142875
  // src/services/rawDump/timerWorker.ts
142704
- import path21 from "path";
142876
+ import path20 from "path";
142705
142877
  var log6 = createLogger("timer");
142706
- var TIMER_LOCK_DIR = path21.join(getRawDumpDir(), "csc-timer.lock.d");
142878
+ var TIMER_LOCK_DIR = path20.join(getRawDumpDir(), "csc-timer.lock.d");
142707
142879
  var isRunning = false;
142880
+ var timerLockToken = null;
142708
142881
  async function acquireTimerLock() {
142709
- return acquireLock(TIMER_LOCK_DIR, {
142882
+ const token = await acquireLock(TIMER_LOCK_DIR, {
142710
142883
  pid: process.pid,
142711
142884
  startedAt: new Date().toISOString()
142712
142885
  });
142886
+ if (token)
142887
+ timerLockToken = token;
142888
+ return token !== null;
142713
142889
  }
142714
142890
  async function releaseTimerLock() {
142715
- await releaseLock(TIMER_LOCK_DIR);
142891
+ if (!timerLockToken)
142892
+ return;
142893
+ const token = timerLockToken;
142894
+ timerLockToken = null;
142895
+ await releaseLock(TIMER_LOCK_DIR, token);
142716
142896
  }
142717
142897
  async function runTimers() {
142718
142898
  if (isRunning)
@@ -142768,10 +142948,10 @@ if (scriptPath2.endsWith("timerWorker.ts") || scriptPath2.endsWith("timerWorker.
142768
142948
 
142769
142949
  // src/services/rawDump/parentHeartbeat.ts
142770
142950
  import { promises as fs13 } from "fs";
142771
- import path22 from "path";
142951
+ import path21 from "path";
142772
142952
  var HEARTBEAT_STALE_MS = 15000;
142773
142953
  function getParentHeartbeatPath(pid) {
142774
- return path22.join(getRawDumpDir(), `csc-parent-heartbeat-${pid}.json`);
142954
+ return path21.join(getRawDumpDir(), `csc-parent-heartbeat-${pid}.json`);
142775
142955
  }
142776
142956
  async function readParentHeartbeat(pid) {
142777
142957
  try {
@@ -142803,13 +142983,19 @@ function scheduleForcedExit(reason, code) {
142803
142983
  process.exit(code);
142804
142984
  }, graceMs);
142805
142985
  }
142806
- process.on("SIGTERM", () => scheduleForcedExit("SIGTERM", 0));
142807
- process.on("SIGINT", () => scheduleForcedExit("SIGINT", 0));
142808
- process.on("unhandledRejection", (reason) => {
142809
- log7.error("unhandled rejection", { reason: String(reason), workerPid: process.pid });
142810
- });
142811
142986
  var PARENT_PID = process.ppid;
142812
- var IS_WORKER_PROCESS = process.argv[1]?.includes("batchWorker") || false;
142987
+ var WORKER_ENTRY_BASENAMES = ["batchworker.ts", "batchworker.js"];
142988
+ var IS_WORKER_PROCESS = process.env.CSC_RAW_DUMP_WORKER === "1" || WORKER_ENTRY_BASENAMES.includes((process.argv[1] ?? "").split(/[\\/]/).pop()?.toLowerCase() ?? "");
142989
+ if (IS_WORKER_PROCESS) {
142990
+ process.on("SIGTERM", () => scheduleForcedExit("SIGTERM", 0));
142991
+ process.on("SIGINT", () => scheduleForcedExit("SIGINT", 0));
142992
+ process.on("unhandledRejection", (reason) => {
142993
+ log7.error("unhandled rejection", {
142994
+ reason: String(reason),
142995
+ workerPid: process.pid
142996
+ });
142997
+ });
142998
+ }
142813
142999
  var parentHeartbeat = null;
142814
143000
  async function refreshParentHeartbeat() {
142815
143001
  parentHeartbeat = await readParentHeartbeat(PARENT_PID);
@@ -142838,31 +143024,34 @@ var stateLoaded = false;
142838
143024
  function startBatchWorker() {
142839
143025
  process.title = "csc_batch_worker";
142840
143026
  log7.info("batch worker started");
142841
- loadAllState().then(() => {
142842
- stateLoaded = true;
142843
- }).catch((err) => {
142844
- log7.error("failed to load state", {
142845
- error: err instanceof Error ? err.message : String(err)
142846
- });
142847
- process.exit(1);
142848
- });
142849
- loadQueue().catch((err) => {
142850
- log7.error("failed to load queue", {
142851
- error: err instanceof Error ? err.message : String(err)
142852
- });
142853
- process.exit(1);
142854
- });
142855
- setImmediate(async () => {
143027
+ startParentWatchdog();
143028
+ (async () => {
142856
143029
  try {
142857
- await runHistorySessionWorker();
143030
+ await loadAllState();
143031
+ await loadQueue();
143032
+ stateLoaded = true;
142858
143033
  } catch (err) {
142859
- log7.error("runHistorySessionWorker failed", {
143034
+ log7.error("failed to load state", {
142860
143035
  error: err instanceof Error ? err.message : String(err)
142861
143036
  });
143037
+ process.exit(1);
143038
+ return;
142862
143039
  }
143040
+ setImmediate(async () => {
143041
+ try {
143042
+ await runHistorySessionWorker();
143043
+ } catch (err) {
143044
+ log7.error("runHistorySessionWorker failed", {
143045
+ error: err instanceof Error ? err.message : String(err)
143046
+ });
143047
+ }
143048
+ });
143049
+ startTimerWorker();
143050
+ })().catch((err) => {
143051
+ log7.error("batch worker init failed", {
143052
+ error: err instanceof Error ? err.message : String(err)
143053
+ });
142863
143054
  });
142864
- startTimerWorker();
142865
- startParentWatchdog();
142866
143055
  }
142867
143056
  function startParentWatchdog() {
142868
143057
  if (!IS_WORKER_PROCESS)
@@ -142905,5 +143094,5 @@ export {
142905
143094
  startBatchWorker
142906
143095
  };
142907
143096
 
142908
- //# debugId=F58E705C32DFA9C364756E2164756E21
142909
- //# sourceMappingURL=batchWorker.js.map
143097
+ //# debugId=A510A8F9F97ED6F964756E2164756E21
143098
+