@costrict/csc 4.2.13 → 4.2.15

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.13") {
76
- cached = "4.2.13";
739
+ if ("4.2.15") {
740
+ cached = "4.2.15";
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
  }
@@ -1631,89 +2295,135 @@ function lockSync(file, options) {
1631
2295
  }
1632
2296
  var _lockfile;
1633
2297
 
2298
+ // src/costrict/provider/credentialsStore.ts
2299
+ import { promises as fs3, existsSync } from "fs";
2300
+ import { join as join3 } from "path";
2301
+
2302
+ class CoStrictCredentialsStore {
2303
+ configDir;
2304
+ constructor(configDir) {
2305
+ this.configDir = configDir;
2306
+ }
2307
+ getPath() {
2308
+ return join3(this.configDir, "auth.json");
2309
+ }
2310
+ async load() {
2311
+ try {
2312
+ const content = await fs3.readFile(this.getPath(), "utf-8");
2313
+ const credentials = JSON.parse(content);
2314
+ if (!credentials.access_token || !credentials.base_url)
2315
+ return null;
2316
+ return credentials;
2317
+ } catch (error) {
2318
+ if (error.code === "ENOENT")
2319
+ return null;
2320
+ if (error instanceof SyntaxError)
2321
+ return null;
2322
+ return null;
2323
+ }
2324
+ }
2325
+ async save(credentials) {
2326
+ await this.withLock(async () => {
2327
+ await this.atomicWrite(credentials);
2328
+ });
2329
+ }
2330
+ async updateAtomically(updater) {
2331
+ return this.withLock(async (creds) => {
2332
+ const updated = updater(creds);
2333
+ if (updated) {
2334
+ await this.atomicWrite(updated);
2335
+ return updated;
2336
+ }
2337
+ return updated ?? creds;
2338
+ });
2339
+ }
2340
+ async delete() {
2341
+ try {
2342
+ await fs3.unlink(this.getPath());
2343
+ } catch (error) {
2344
+ if (error.code !== "ENOENT")
2345
+ throw error;
2346
+ }
2347
+ }
2348
+ async has() {
2349
+ try {
2350
+ await fs3.access(this.getPath());
2351
+ return true;
2352
+ } catch {
2353
+ return false;
2354
+ }
2355
+ }
2356
+ hasSync() {
2357
+ try {
2358
+ return existsSync(this.getPath());
2359
+ } catch {
2360
+ return false;
2361
+ }
2362
+ }
2363
+ async withLock(fn) {
2364
+ const filepath = this.getPath();
2365
+ await fs3.mkdir(this.configDir, { recursive: true });
2366
+ const release = await lock(filepath, {
2367
+ retries: 10,
2368
+ stale: 5000,
2369
+ realpath: false
2370
+ });
2371
+ try {
2372
+ let creds = null;
2373
+ try {
2374
+ const content = await fs3.readFile(filepath, "utf-8");
2375
+ const parsed = JSON.parse(content);
2376
+ if (parsed.access_token && parsed.base_url) {
2377
+ creds = parsed;
2378
+ }
2379
+ } catch {}
2380
+ return await fn(creds);
2381
+ } finally {
2382
+ await release();
2383
+ }
2384
+ }
2385
+ async atomicWrite(credentials) {
2386
+ const filepath = this.getPath();
2387
+ const tmpPath = `${filepath}.tmp.${process.pid}`;
2388
+ const data = JSON.stringify(credentials, null, 2) + `
2389
+ `;
2390
+ await fs3.writeFile(tmpPath, data, { encoding: "utf-8", mode: 384 });
2391
+ await fs3.rename(tmpPath, filepath);
2392
+ }
2393
+ }
2394
+ var init_credentialsStore = () => {};
2395
+
1634
2396
  // src/costrict/provider/credentials.ts
1635
- import { promises as fs3 } from "fs";
1636
- import { join } from "path";
2397
+ import { join as join4 } from "path";
1637
2398
  import { createHash } from "crypto";
1638
- import { homedir } from "os";
1639
- function getCoStrictCredentialsPath() {
1640
- return join(COSTRICT_CONFIG_DIR, "auth.json");
2399
+ import { homedir as homedir2 } from "os";
2400
+ function getCoStrictCredentialsDir() {
2401
+ return join4(homedir2(), ".costrict", "share");
1641
2402
  }
1642
2403
  function generateMachineId() {
1643
- const os2 = __require("os");
1644
- const platform = os2.platform();
1645
- const hostname = os2.hostname();
1646
- 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;
1647
2408
  const machineInfo = `${platform}-${hostname}-${username}`;
1648
2409
  return createHash("sha256").update(machineInfo).digest("hex");
1649
2410
  }
1650
2411
  async function loadCoStrictCredentials() {
1651
- try {
1652
- const content = await fs3.readFile(getCoStrictCredentialsPath(), "utf-8");
1653
- const credentials = JSON.parse(content);
1654
- if (!credentials.access_token || !credentials.base_url)
1655
- return null;
1656
- return credentials;
1657
- } catch (error) {
1658
- if (error.code === "ENOENT")
1659
- return null;
1660
- if (error instanceof SyntaxError)
1661
- return null;
1662
- return null;
1663
- }
1664
- }
1665
- async function withCredentialsLockInternal(fn) {
1666
- const filepath = getCoStrictCredentialsPath();
1667
- await fs3.mkdir(COSTRICT_CONFIG_DIR, { recursive: true });
1668
- const release = await lock(filepath, { retries: 10, stale: 5000 });
1669
- try {
1670
- let creds = null;
1671
- try {
1672
- const content = await fs3.readFile(filepath, "utf-8");
1673
- const parsed = JSON.parse(content);
1674
- if (parsed.access_token && parsed.base_url) {
1675
- creds = parsed;
1676
- }
1677
- } catch {}
1678
- return await fn(creds);
1679
- } finally {
1680
- await release();
1681
- }
1682
- }
1683
- async function atomicWriteCredentials(filepath, credentials) {
1684
- const tmpPath = `${filepath}.tmp.${process.pid}`;
1685
- const data = JSON.stringify(credentials, null, 2) + `
1686
- `;
1687
- await fs3.writeFile(tmpPath, data, { encoding: "utf-8", mode: 384 });
1688
- await fs3.rename(tmpPath, filepath);
2412
+ return defaultStore.load();
1689
2413
  }
1690
2414
  async function saveCoStrictCredentials(credentials) {
1691
- const filepath = getCoStrictCredentialsPath();
1692
- await withCredentialsLockInternal(async () => {
1693
- await atomicWriteCredentials(filepath, credentials);
1694
- return;
1695
- });
2415
+ return defaultStore.save(credentials);
1696
2416
  }
1697
2417
  async function updateCredentialsAtomically(updater) {
1698
- return withCredentialsLockInternal((creds) => {
1699
- const updated = updater(creds);
1700
- if (updated) {
1701
- return atomicWriteCredentials(getCoStrictCredentialsPath(), updated).then(() => updated);
1702
- }
1703
- return Promise.resolve(updated ?? creds);
1704
- });
2418
+ return defaultStore.updateAtomically(updater);
1705
2419
  }
1706
2420
  function hasCoStrictCredentialsSync() {
1707
- try {
1708
- const { existsSync } = __require("fs");
1709
- return existsSync(getCoStrictCredentialsPath());
1710
- } catch {
1711
- return false;
1712
- }
2421
+ return defaultStore.hasSync();
1713
2422
  }
1714
- var COSTRICT_CONFIG_DIR;
2423
+ var defaultStore;
1715
2424
  var init_credentials = __esm(() => {
1716
- COSTRICT_CONFIG_DIR = join(homedir(), ".costrict", "share");
2425
+ init_credentialsStore();
2426
+ defaultStore = new CoStrictCredentialsStore(getCoStrictCredentialsDir());
1717
2427
  });
1718
2428
 
1719
2429
  // src/costrict/provider/oauth-params.ts
@@ -3286,6 +3996,7 @@ var init_commands_descriptions = __esm(() => {
3286
3996
  "commands.desc.thinkback": "Your 2025 CoStrict Year in Review",
3287
3997
  "commands.desc.thinkbackPlay": "Play the thinkback animation",
3288
3998
  "commands.desc.tui": "Toggle TUI alternate-screen mode",
3999
+ "commands.desc.ultracode": "Launch a dynamic multi-agent coding workflow",
3289
4000
  "commands.desc.ultraplan": "CoStrict on the web drafts an advanced plan you can edit and approve",
3290
4001
  "commands.desc.upgrade": "Upgrade to Max for higher rate limits and more Opus",
3291
4002
  "commands.desc.usage": "Show session cost, plan usage, and activity stats",
@@ -3859,6 +4570,15 @@ Example: /fork Fix the null check in validate.ts`,
3859
4570
  "commands.skillStore.noPublishedVersions": "Skill {id} has no published versions to install.",
3860
4571
  "commands.skillStore.installed": "Skill installed to {path}",
3861
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}",
3862
4582
  "commands.agentsPlatform.listEmpty": "No scheduled agents found.",
3863
4583
  "commands.agentsPlatform.listCount": "{count} scheduled agent(s).",
3864
4584
  "commands.agentsPlatform.listFailed": "Failed to list agents: {error}",
@@ -3978,6 +4698,10 @@ Start a new session at {url}`,
3978
4698
  "commands.teleport.failed": "Teleport failed: {error}",
3979
4699
  "commands.teleport.availableSessions": "## Available sessions (most recent first)",
3980
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.",
3981
4705
  "commands.autofixPr.failed": "Autofix PR failed: {error}",
3982
4706
  "commands.autofixPr.noMonitor": "No active autofix monitor.",
3983
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.",
@@ -4833,6 +5557,8 @@ var init_cli = __esm(() => {
4833
5557
  "cli.cmd.pluginValidate": "Validate a plugin or marketplace manifest",
4834
5558
  "cli.cmd.serve": "Start a CoStrict HTTP API server",
4835
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",
4836
5562
  "cli.cmd.ssh": "SSH into a remote machine and start CoStrict",
4837
5563
  "cli.cmd.sshi": "SSH interactive login with CoStrict session management",
4838
5564
  "cli.cmd.status": "Show authentication status",
@@ -4958,6 +5684,10 @@ var init_cli = __esm(() => {
4958
5684
  "cli.option.rewindFiles": "Restore files to state at the specified user message and exit (requires --resume)",
4959
5685
  "cli.option.safe": "Roll back to the server-pinned safe version",
4960
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",
4961
5691
  "cli.option.sdkUrl": "Use remote WebSocket endpoint for SDK I/O streaming (only with -p and stream-json format)",
4962
5692
  "cli.option.sessionId": "Resume a session by ID",
4963
5693
  "cli.option.sessionIdArg": "Use a specific session ID for the conversation (must be a valid UUID)",
@@ -7807,6 +8537,7 @@ var init_commands_descriptions2 = __esm(() => {
7807
8537
  "commands.desc.thinkback": "\u60A8\u7684 2025 CoStrict \u5E74\u5EA6\u56DE\u987E",
7808
8538
  "commands.desc.thinkbackPlay": "\u64AD\u653E\u5E74\u5EA6\u56DE\u987E\u52A8\u753B",
7809
8539
  "commands.desc.tui": "\u5207\u6362 TUI \u5907\u7528\u5C4F\u5E55\u6A21\u5F0F",
8540
+ "commands.desc.ultracode": "\u542F\u52A8DynamicWorkflow\u673A\u5236",
7810
8541
  "commands.desc.ultraplan": "CoStrict \u7F51\u9875\u7AEF\u81EA\u52A8\u8D77\u8349\u9AD8\u7EA7\u8BA1\u5212\uFF0C\u53EF\u7F16\u8F91\u548C\u5BA1\u6279",
7811
8542
  "commands.desc.upgrade": "\u5347\u7EA7\u5230 Max \u83B7\u53D6\u66F4\u9AD8\u901F\u7387\u9650\u5236\u548C\u66F4\u591A Opus",
7812
8543
  "commands.desc.usage": "\u663E\u793A\u4F1A\u8BDD\u6210\u672C\u3001\u8BA1\u5212\u7528\u91CF\u548C\u6D3B\u52A8\u7EDF\u8BA1",
@@ -8378,6 +9109,15 @@ var init_commands_others2 = __esm(() => {
8378
9109
  "commands.skillStore.noPublishedVersions": "\u6280\u80FD {id} \u6CA1\u6709\u5DF2\u53D1\u5E03\u7684\u7248\u672C\u53EF\u4F9B\u5B89\u88C5\u3002",
8379
9110
  "commands.skillStore.installed": "\u6280\u80FD\u5DF2\u5B89\u88C5\u5230 {path}",
8380
9111
  "commands.skillStore.installFailed": "\u5B89\u88C5\u6280\u80FD {id} \u5931\u8D25\uFF1A{error}",
9112
+ "commands.skillInstall.installed": "\u6280\u80FD {name} \u5DF2\u5B89\u88C5\u4E3A {targetName}\uFF0C\u8DEF\u5F84\uFF1A{path}",
9113
+ "commands.skillInstall.notFound": "\u672A\u627E\u5230\u4E91\u7AEF\u6280\u80FD {spec}\u3002\u8BF7\u4F7F\u7528\u7CBE\u786E\u7684\u6280\u80FD slug \u6216 UUID\u3002",
9114
+ "commands.skillInstall.invalidScope": "\u65E0\u6548\u7684\u6280\u80FD\u5B89\u88C5\u8303\u56F4 {scope}\u3002\u8BF7\u4F7F\u7528 user \u6216 project\u3002",
9115
+ "commands.skillInstall.alreadyExists": "\u6280\u80FD\u5DF2\u5B58\u5728\u4E8E {path}\u3002\u4F7F\u7528 --force \u53EF\u8986\u76D6\u3002",
9116
+ "commands.skillInstall.unsupportedType": "\u4E91\u7AEF\u9879\u76EE {spec} \u7684\u7C7B\u578B\u662F {type}\uFF0C\u4E0D\u662F\u6280\u80FD\u3002",
9117
+ "commands.skillInstall.missingContent": "\u4E91\u7AEF\u6280\u80FD {slug} \u6CA1\u6709\u53EF\u5B89\u88C5\u5185\u5BB9\u3002",
9118
+ "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",
9119
+ "commands.skillInstall.invalidResponse": "\u4E91\u7AEF\u54CD\u5E94 {spec} \u7F3A\u5C11\u5FC5\u9700\u7684\u6280\u80FD\u5B57\u6BB5\u3002",
9120
+ "commands.skillInstall.failed": "\u5B89\u88C5\u6280\u80FD {spec} \u5931\u8D25\uFF1A{error}",
8381
9121
  "commands.agentsPlatform.listEmpty": "\u672A\u627E\u5230\u5B9A\u65F6\u4EE3\u7406\u3002",
8382
9122
  "commands.agentsPlatform.listCount": "{count} \u4E2A\u5B9A\u65F6\u4EE3\u7406\u3002",
8383
9123
  "commands.agentsPlatform.listFailed": "\u5217\u51FA\u4EE3\u7406\u5931\u8D25\uFF1A{error}",
@@ -8497,6 +9237,10 @@ var init_commands_others2 = __esm(() => {
8497
9237
  "commands.teleport.failed": "Teleport \u5931\u8D25\uFF1A{error}",
8498
9238
  "commands.teleport.availableSessions": "## \u53EF\u7528\u4F1A\u8BDD\uFF08\u6700\u8FD1\u4F18\u5148\uFF09",
8499
9239
  "commands.teleport.hint": "\u8FD0\u884C `/teleport <\u4F1A\u8BDDID>` \u6062\u590D\u4F1A\u8BDD\u3002",
9240
+ "commands.ultracode.permissionUnavailable": "\u65E0\u6CD5\u542F\u52A8 /ultracode\uFF1A\u5DE5\u5177\u6743\u9650\u5904\u7406\u5668\u4E0D\u53EF\u7528\u3002",
9241
+ "commands.ultracode.denied": "Ultracode \u672A\u542F\u52A8\uFF1A{message}",
9242
+ "commands.ultracode.notLaunched": "Ultracode \u672A\u542F\u52A8\u3002",
9243
+ "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",
8500
9244
  "commands.autofixPr.failed": "Autofix PR \u5931\u8D25\uFF1A{error}",
8501
9245
  "commands.autofixPr.noMonitor": "\u6CA1\u6709\u6D3B\u8DC3\u7684 autofix \u76D1\u63A7\u5668\u3002",
8502
9246
  "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",
@@ -9351,6 +10095,8 @@ var init_cli2 = __esm(() => {
9351
10095
  "cli.cmd.pluginValidate": "\u9A8C\u8BC1\u63D2\u4EF6\u6216\u5E02\u573A\u6E05\u5355\u6587\u4EF6",
9352
10096
  "cli.cmd.serve": "\u542F\u52A8 CoStrict HTTP API \u670D\u52A1\u5668",
9353
10097
  "cli.cmd.server": "\u542F\u52A8 CoStrict \u4F1A\u8BDD\u670D\u52A1\u5668\uFF08\u522B\u540D\uFF1Aserve\uFF09",
10098
+ "cli.cmd.skill": "\u5B89\u88C5\u4E91\u7AEF\u6280\u80FD",
10099
+ "cli.cmd.skillInstall": "\u901A\u8FC7 UUID \u6216\u7CBE\u786E slug \u5B89\u88C5\u4E91\u7AEF\u6280\u80FD",
9354
10100
  "cli.cmd.ssh": "SSH \u767B\u5F55\u8FDC\u7A0B\u673A\u5668\u5E76\u542F\u52A8 CoStrict",
9355
10101
  "cli.cmd.sshi": "SSH \u4EA4\u4E92\u5F0F\u767B\u5F55\u53CA CoStrict \u4F1A\u8BDD\u7BA1\u7406",
9356
10102
  "cli.cmd.status": "\u663E\u793A\u8BA4\u8BC1\u72B6\u6001",
@@ -9476,6 +10222,10 @@ var init_cli2 = __esm(() => {
9476
10222
  "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",
9477
10223
  "cli.option.safe": "\u56DE\u6EDA\u5230\u670D\u52A1\u5668\u56FA\u5B9A\u7684\u5B89\u5168\u7248\u672C",
9478
10224
  "cli.option.scope": "\u914D\u7F6E\u8303\u56F4\uFF08local, user \u6216 project\uFF09",
10225
+ "cli.option.skillInstallDir": "\u81EA\u5B9A\u4E49\u6280\u80FD\u6839\u76EE\u5F55\uFF08\u8986\u76D6 --scope\uFF09",
10226
+ "cli.option.skillInstallForce": "\u8986\u76D6\u5DF2\u6709\u7684 SKILL.md",
10227
+ "cli.option.skillInstallName": "\u76EE\u6807\u6280\u80FD\u76EE\u5F55\u548C\u8C03\u7528\u540D\u79F0",
10228
+ "cli.option.skillInstallScope": "\u5B89\u88C5\u8303\u56F4\uFF1Auser \u6216 project",
9479
10229
  "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",
9480
10230
  "cli.option.sessionId": "\u6309 ID \u6062\u590D\u4F1A\u8BDD",
9481
10231
  "cli.option.sessionIdArg": "\u4E3A\u5BF9\u8BDD\u4F7F\u7528\u7279\u5B9A\u7684\u4F1A\u8BDD ID\uFF08\u5FC5\u987B\u662F\u6709\u6548\u7684 UUID\uFF09",
@@ -10834,552 +11584,6 @@ var init_tips2 = __esm(() => {
10834
11584
  };
10835
11585
  });
10836
11586
 
10837
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js
10838
- var freeGlobal, _freeGlobal_default;
10839
- var init__freeGlobal = __esm(() => {
10840
- freeGlobal = typeof global == "object" && global && global.Object === Object && global;
10841
- _freeGlobal_default = freeGlobal;
10842
- });
10843
-
10844
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js
10845
- var freeSelf, root, _root_default;
10846
- var init__root = __esm(() => {
10847
- init__freeGlobal();
10848
- freeSelf = typeof self == "object" && self && self.Object === Object && self;
10849
- root = _freeGlobal_default || freeSelf || Function("return this")();
10850
- _root_default = root;
10851
- });
10852
-
10853
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js
10854
- var Symbol2, _Symbol_default;
10855
- var init__Symbol = __esm(() => {
10856
- init__root();
10857
- Symbol2 = _root_default.Symbol;
10858
- _Symbol_default = Symbol2;
10859
- });
10860
-
10861
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js
10862
- function getRawTag(value) {
10863
- var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
10864
- try {
10865
- value[symToStringTag] = undefined;
10866
- var unmasked = true;
10867
- } catch (e) {}
10868
- var result = nativeObjectToString.call(value);
10869
- if (unmasked) {
10870
- if (isOwn) {
10871
- value[symToStringTag] = tag;
10872
- } else {
10873
- delete value[symToStringTag];
10874
- }
10875
- }
10876
- return result;
10877
- }
10878
- var objectProto, hasOwnProperty, nativeObjectToString, symToStringTag, _getRawTag_default;
10879
- var init__getRawTag = __esm(() => {
10880
- init__Symbol();
10881
- objectProto = Object.prototype;
10882
- hasOwnProperty = objectProto.hasOwnProperty;
10883
- nativeObjectToString = objectProto.toString;
10884
- symToStringTag = _Symbol_default ? _Symbol_default.toStringTag : undefined;
10885
- _getRawTag_default = getRawTag;
10886
- });
10887
-
10888
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js
10889
- function objectToString(value) {
10890
- return nativeObjectToString2.call(value);
10891
- }
10892
- var objectProto2, nativeObjectToString2, _objectToString_default;
10893
- var init__objectToString = __esm(() => {
10894
- objectProto2 = Object.prototype;
10895
- nativeObjectToString2 = objectProto2.toString;
10896
- _objectToString_default = objectToString;
10897
- });
10898
-
10899
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js
10900
- function baseGetTag(value) {
10901
- if (value == null) {
10902
- return value === undefined ? undefinedTag : nullTag;
10903
- }
10904
- return symToStringTag2 && symToStringTag2 in Object(value) ? _getRawTag_default(value) : _objectToString_default(value);
10905
- }
10906
- var nullTag = "[object Null]", undefinedTag = "[object Undefined]", symToStringTag2, _baseGetTag_default;
10907
- var init__baseGetTag = __esm(() => {
10908
- init__Symbol();
10909
- init__getRawTag();
10910
- init__objectToString();
10911
- symToStringTag2 = _Symbol_default ? _Symbol_default.toStringTag : undefined;
10912
- _baseGetTag_default = baseGetTag;
10913
- });
10914
-
10915
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js
10916
- function isObject(value) {
10917
- var type = typeof value;
10918
- return value != null && (type == "object" || type == "function");
10919
- }
10920
- var isObject_default;
10921
- var init_isObject = __esm(() => {
10922
- isObject_default = isObject;
10923
- });
10924
-
10925
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js
10926
- function isFunction(value) {
10927
- if (!isObject_default(value)) {
10928
- return false;
10929
- }
10930
- var tag = _baseGetTag_default(value);
10931
- return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
10932
- }
10933
- var asyncTag = "[object AsyncFunction]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]", isFunction_default;
10934
- var init_isFunction = __esm(() => {
10935
- init__baseGetTag();
10936
- init_isObject();
10937
- isFunction_default = isFunction;
10938
- });
10939
-
10940
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js
10941
- var coreJsData, _coreJsData_default;
10942
- var init__coreJsData = __esm(() => {
10943
- init__root();
10944
- coreJsData = _root_default["__core-js_shared__"];
10945
- _coreJsData_default = coreJsData;
10946
- });
10947
-
10948
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js
10949
- function isMasked(func) {
10950
- return !!maskSrcKey && maskSrcKey in func;
10951
- }
10952
- var maskSrcKey, _isMasked_default;
10953
- var init__isMasked = __esm(() => {
10954
- init__coreJsData();
10955
- maskSrcKey = function() {
10956
- var uid = /[^.]+$/.exec(_coreJsData_default && _coreJsData_default.keys && _coreJsData_default.keys.IE_PROTO || "");
10957
- return uid ? "Symbol(src)_1." + uid : "";
10958
- }();
10959
- _isMasked_default = isMasked;
10960
- });
10961
-
10962
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js
10963
- function toSource(func) {
10964
- if (func != null) {
10965
- try {
10966
- return funcToString.call(func);
10967
- } catch (e) {}
10968
- try {
10969
- return func + "";
10970
- } catch (e) {}
10971
- }
10972
- return "";
10973
- }
10974
- var funcProto, funcToString, _toSource_default;
10975
- var init__toSource = __esm(() => {
10976
- funcProto = Function.prototype;
10977
- funcToString = funcProto.toString;
10978
- _toSource_default = toSource;
10979
- });
10980
-
10981
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js
10982
- function baseIsNative(value) {
10983
- if (!isObject_default(value) || _isMasked_default(value)) {
10984
- return false;
10985
- }
10986
- var pattern = isFunction_default(value) ? reIsNative : reIsHostCtor;
10987
- return pattern.test(_toSource_default(value));
10988
- }
10989
- var reRegExpChar, reIsHostCtor, funcProto2, objectProto3, funcToString2, hasOwnProperty2, reIsNative, _baseIsNative_default;
10990
- var init__baseIsNative = __esm(() => {
10991
- init_isFunction();
10992
- init__isMasked();
10993
- init_isObject();
10994
- init__toSource();
10995
- reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
10996
- reIsHostCtor = /^\[object .+?Constructor\]$/;
10997
- funcProto2 = Function.prototype;
10998
- objectProto3 = Object.prototype;
10999
- funcToString2 = funcProto2.toString;
11000
- hasOwnProperty2 = objectProto3.hasOwnProperty;
11001
- reIsNative = RegExp("^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
11002
- _baseIsNative_default = baseIsNative;
11003
- });
11004
-
11005
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js
11006
- function getValue(object, key) {
11007
- return object == null ? undefined : object[key];
11008
- }
11009
- var _getValue_default;
11010
- var init__getValue = __esm(() => {
11011
- _getValue_default = getValue;
11012
- });
11013
-
11014
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js
11015
- function getNative(object, key) {
11016
- var value = _getValue_default(object, key);
11017
- return _baseIsNative_default(value) ? value : undefined;
11018
- }
11019
- var _getNative_default;
11020
- var init__getNative = __esm(() => {
11021
- init__baseIsNative();
11022
- init__getValue();
11023
- _getNative_default = getNative;
11024
- });
11025
-
11026
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js
11027
- var nativeCreate, _nativeCreate_default;
11028
- var init__nativeCreate = __esm(() => {
11029
- init__getNative();
11030
- nativeCreate = _getNative_default(Object, "create");
11031
- _nativeCreate_default = nativeCreate;
11032
- });
11033
-
11034
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js
11035
- function hashClear() {
11036
- this.__data__ = _nativeCreate_default ? _nativeCreate_default(null) : {};
11037
- this.size = 0;
11038
- }
11039
- var _hashClear_default;
11040
- var init__hashClear = __esm(() => {
11041
- init__nativeCreate();
11042
- _hashClear_default = hashClear;
11043
- });
11044
-
11045
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js
11046
- function hashDelete(key) {
11047
- var result = this.has(key) && delete this.__data__[key];
11048
- this.size -= result ? 1 : 0;
11049
- return result;
11050
- }
11051
- var _hashDelete_default;
11052
- var init__hashDelete = __esm(() => {
11053
- _hashDelete_default = hashDelete;
11054
- });
11055
-
11056
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js
11057
- function hashGet(key) {
11058
- var data = this.__data__;
11059
- if (_nativeCreate_default) {
11060
- var result = data[key];
11061
- return result === HASH_UNDEFINED ? undefined : result;
11062
- }
11063
- return hasOwnProperty3.call(data, key) ? data[key] : undefined;
11064
- }
11065
- var HASH_UNDEFINED = "__lodash_hash_undefined__", objectProto4, hasOwnProperty3, _hashGet_default;
11066
- var init__hashGet = __esm(() => {
11067
- init__nativeCreate();
11068
- objectProto4 = Object.prototype;
11069
- hasOwnProperty3 = objectProto4.hasOwnProperty;
11070
- _hashGet_default = hashGet;
11071
- });
11072
-
11073
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js
11074
- function hashHas(key) {
11075
- var data = this.__data__;
11076
- return _nativeCreate_default ? data[key] !== undefined : hasOwnProperty4.call(data, key);
11077
- }
11078
- var objectProto5, hasOwnProperty4, _hashHas_default;
11079
- var init__hashHas = __esm(() => {
11080
- init__nativeCreate();
11081
- objectProto5 = Object.prototype;
11082
- hasOwnProperty4 = objectProto5.hasOwnProperty;
11083
- _hashHas_default = hashHas;
11084
- });
11085
-
11086
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js
11087
- function hashSet(key, value) {
11088
- var data = this.__data__;
11089
- this.size += this.has(key) ? 0 : 1;
11090
- data[key] = _nativeCreate_default && value === undefined ? HASH_UNDEFINED2 : value;
11091
- return this;
11092
- }
11093
- var HASH_UNDEFINED2 = "__lodash_hash_undefined__", _hashSet_default;
11094
- var init__hashSet = __esm(() => {
11095
- init__nativeCreate();
11096
- _hashSet_default = hashSet;
11097
- });
11098
-
11099
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js
11100
- function Hash(entries) {
11101
- var index = -1, length = entries == null ? 0 : entries.length;
11102
- this.clear();
11103
- while (++index < length) {
11104
- var entry = entries[index];
11105
- this.set(entry[0], entry[1]);
11106
- }
11107
- }
11108
- var _Hash_default;
11109
- var init__Hash = __esm(() => {
11110
- init__hashClear();
11111
- init__hashDelete();
11112
- init__hashGet();
11113
- init__hashHas();
11114
- init__hashSet();
11115
- Hash.prototype.clear = _hashClear_default;
11116
- Hash.prototype["delete"] = _hashDelete_default;
11117
- Hash.prototype.get = _hashGet_default;
11118
- Hash.prototype.has = _hashHas_default;
11119
- Hash.prototype.set = _hashSet_default;
11120
- _Hash_default = Hash;
11121
- });
11122
-
11123
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js
11124
- function listCacheClear() {
11125
- this.__data__ = [];
11126
- this.size = 0;
11127
- }
11128
- var _listCacheClear_default;
11129
- var init__listCacheClear = __esm(() => {
11130
- _listCacheClear_default = listCacheClear;
11131
- });
11132
-
11133
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js
11134
- function eq(value, other) {
11135
- return value === other || value !== value && other !== other;
11136
- }
11137
- var eq_default;
11138
- var init_eq = __esm(() => {
11139
- eq_default = eq;
11140
- });
11141
-
11142
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js
11143
- function assocIndexOf(array, key) {
11144
- var length = array.length;
11145
- while (length--) {
11146
- if (eq_default(array[length][0], key)) {
11147
- return length;
11148
- }
11149
- }
11150
- return -1;
11151
- }
11152
- var _assocIndexOf_default;
11153
- var init__assocIndexOf = __esm(() => {
11154
- init_eq();
11155
- _assocIndexOf_default = assocIndexOf;
11156
- });
11157
-
11158
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js
11159
- function listCacheDelete(key) {
11160
- var data = this.__data__, index = _assocIndexOf_default(data, key);
11161
- if (index < 0) {
11162
- return false;
11163
- }
11164
- var lastIndex = data.length - 1;
11165
- if (index == lastIndex) {
11166
- data.pop();
11167
- } else {
11168
- splice.call(data, index, 1);
11169
- }
11170
- --this.size;
11171
- return true;
11172
- }
11173
- var arrayProto, splice, _listCacheDelete_default;
11174
- var init__listCacheDelete = __esm(() => {
11175
- init__assocIndexOf();
11176
- arrayProto = Array.prototype;
11177
- splice = arrayProto.splice;
11178
- _listCacheDelete_default = listCacheDelete;
11179
- });
11180
-
11181
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js
11182
- function listCacheGet(key) {
11183
- var data = this.__data__, index = _assocIndexOf_default(data, key);
11184
- return index < 0 ? undefined : data[index][1];
11185
- }
11186
- var _listCacheGet_default;
11187
- var init__listCacheGet = __esm(() => {
11188
- init__assocIndexOf();
11189
- _listCacheGet_default = listCacheGet;
11190
- });
11191
-
11192
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js
11193
- function listCacheHas(key) {
11194
- return _assocIndexOf_default(this.__data__, key) > -1;
11195
- }
11196
- var _listCacheHas_default;
11197
- var init__listCacheHas = __esm(() => {
11198
- init__assocIndexOf();
11199
- _listCacheHas_default = listCacheHas;
11200
- });
11201
-
11202
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js
11203
- function listCacheSet(key, value) {
11204
- var data = this.__data__, index = _assocIndexOf_default(data, key);
11205
- if (index < 0) {
11206
- ++this.size;
11207
- data.push([key, value]);
11208
- } else {
11209
- data[index][1] = value;
11210
- }
11211
- return this;
11212
- }
11213
- var _listCacheSet_default;
11214
- var init__listCacheSet = __esm(() => {
11215
- init__assocIndexOf();
11216
- _listCacheSet_default = listCacheSet;
11217
- });
11218
-
11219
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js
11220
- function ListCache(entries) {
11221
- var index = -1, length = entries == null ? 0 : entries.length;
11222
- this.clear();
11223
- while (++index < length) {
11224
- var entry = entries[index];
11225
- this.set(entry[0], entry[1]);
11226
- }
11227
- }
11228
- var _ListCache_default;
11229
- var init__ListCache = __esm(() => {
11230
- init__listCacheClear();
11231
- init__listCacheDelete();
11232
- init__listCacheGet();
11233
- init__listCacheHas();
11234
- init__listCacheSet();
11235
- ListCache.prototype.clear = _listCacheClear_default;
11236
- ListCache.prototype["delete"] = _listCacheDelete_default;
11237
- ListCache.prototype.get = _listCacheGet_default;
11238
- ListCache.prototype.has = _listCacheHas_default;
11239
- ListCache.prototype.set = _listCacheSet_default;
11240
- _ListCache_default = ListCache;
11241
- });
11242
-
11243
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js
11244
- var Map2, _Map_default;
11245
- var init__Map = __esm(() => {
11246
- init__getNative();
11247
- init__root();
11248
- Map2 = _getNative_default(_root_default, "Map");
11249
- _Map_default = Map2;
11250
- });
11251
-
11252
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js
11253
- function mapCacheClear() {
11254
- this.size = 0;
11255
- this.__data__ = {
11256
- hash: new _Hash_default,
11257
- map: new (_Map_default || _ListCache_default),
11258
- string: new _Hash_default
11259
- };
11260
- }
11261
- var _mapCacheClear_default;
11262
- var init__mapCacheClear = __esm(() => {
11263
- init__Hash();
11264
- init__ListCache();
11265
- init__Map();
11266
- _mapCacheClear_default = mapCacheClear;
11267
- });
11268
-
11269
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js
11270
- function isKeyable(value) {
11271
- var type = typeof value;
11272
- return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
11273
- }
11274
- var _isKeyable_default;
11275
- var init__isKeyable = __esm(() => {
11276
- _isKeyable_default = isKeyable;
11277
- });
11278
-
11279
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js
11280
- function getMapData(map, key) {
11281
- var data = map.__data__;
11282
- return _isKeyable_default(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
11283
- }
11284
- var _getMapData_default;
11285
- var init__getMapData = __esm(() => {
11286
- init__isKeyable();
11287
- _getMapData_default = getMapData;
11288
- });
11289
-
11290
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js
11291
- function mapCacheDelete(key) {
11292
- var result = _getMapData_default(this, key)["delete"](key);
11293
- this.size -= result ? 1 : 0;
11294
- return result;
11295
- }
11296
- var _mapCacheDelete_default;
11297
- var init__mapCacheDelete = __esm(() => {
11298
- init__getMapData();
11299
- _mapCacheDelete_default = mapCacheDelete;
11300
- });
11301
-
11302
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js
11303
- function mapCacheGet(key) {
11304
- return _getMapData_default(this, key).get(key);
11305
- }
11306
- var _mapCacheGet_default;
11307
- var init__mapCacheGet = __esm(() => {
11308
- init__getMapData();
11309
- _mapCacheGet_default = mapCacheGet;
11310
- });
11311
-
11312
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js
11313
- function mapCacheHas(key) {
11314
- return _getMapData_default(this, key).has(key);
11315
- }
11316
- var _mapCacheHas_default;
11317
- var init__mapCacheHas = __esm(() => {
11318
- init__getMapData();
11319
- _mapCacheHas_default = mapCacheHas;
11320
- });
11321
-
11322
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js
11323
- function mapCacheSet(key, value) {
11324
- var data = _getMapData_default(this, key), size = data.size;
11325
- data.set(key, value);
11326
- this.size += data.size == size ? 0 : 1;
11327
- return this;
11328
- }
11329
- var _mapCacheSet_default;
11330
- var init__mapCacheSet = __esm(() => {
11331
- init__getMapData();
11332
- _mapCacheSet_default = mapCacheSet;
11333
- });
11334
-
11335
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js
11336
- function MapCache(entries) {
11337
- var index = -1, length = entries == null ? 0 : entries.length;
11338
- this.clear();
11339
- while (++index < length) {
11340
- var entry = entries[index];
11341
- this.set(entry[0], entry[1]);
11342
- }
11343
- }
11344
- var _MapCache_default;
11345
- var init__MapCache = __esm(() => {
11346
- init__mapCacheClear();
11347
- init__mapCacheDelete();
11348
- init__mapCacheGet();
11349
- init__mapCacheHas();
11350
- init__mapCacheSet();
11351
- MapCache.prototype.clear = _mapCacheClear_default;
11352
- MapCache.prototype["delete"] = _mapCacheDelete_default;
11353
- MapCache.prototype.get = _mapCacheGet_default;
11354
- MapCache.prototype.has = _mapCacheHas_default;
11355
- MapCache.prototype.set = _mapCacheSet_default;
11356
- _MapCache_default = MapCache;
11357
- });
11358
-
11359
- // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/memoize.js
11360
- function memoize(func, resolver) {
11361
- if (typeof func != "function" || resolver != null && typeof resolver != "function") {
11362
- throw new TypeError(FUNC_ERROR_TEXT);
11363
- }
11364
- var memoized = function() {
11365
- var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
11366
- if (cache.has(key)) {
11367
- return cache.get(key);
11368
- }
11369
- var result = func.apply(this, args);
11370
- memoized.cache = cache.set(key, result) || cache;
11371
- return result;
11372
- };
11373
- memoized.cache = new (memoize.Cache || _MapCache_default);
11374
- return memoized;
11375
- }
11376
- var FUNC_ERROR_TEXT = "Expected a function", memoize_default;
11377
- var init_memoize = __esm(() => {
11378
- init__MapCache();
11379
- memoize.Cache = _MapCache_default;
11380
- memoize_default = memoize;
11381
- });
11382
-
11383
11587
  // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayMap.js
11384
11588
  function arrayMap(array, iteratee) {
11385
11589
  var index = -1, length = array == null ? 0 : array.length, result = Array(length);
@@ -16090,69 +16294,6 @@ var init_debugFilter = __esm(() => {
16090
16294
  });
16091
16295
  });
16092
16296
 
16093
- // src/constants/branding.ts
16094
- 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";
16095
- var init_branding = __esm(() => {
16096
- PRODUCT_DOCS_URL = `${PRODUCT_URL}/docs`;
16097
- PRODUCT_CHROME_URL = `${PRODUCT_URL}/chrome`;
16098
- PRODUCT_SETTINGS_URL = `${PRODUCT_URL}/settings`;
16099
- PRODUCT_CODE_URL = `${PRODUCT_URL}/code`;
16100
- PRODUCT_SESSION_URL = `${PRODUCT_URL}/session`;
16101
- PRODUCT_UPGRADE_URL = `${PRODUCT_URL}/upgrade/max`;
16102
- PRODUCT_DOWNLOAD_URL = `${PRODUCT_URL}/download`;
16103
- PRODUCT_DESKTOP_API_URL = `${PRODUCT_URL}/api/desktop`;
16104
- PRODUCT_OAUTH_CLIENT_METADATA_URL = `${PRODUCT_URL}/oauth/costrict-client-metadata`;
16105
- });
16106
-
16107
- // src/utils/envUtils.ts
16108
- import { homedir as homedir2 } from "os";
16109
- import { join as join2 } from "path";
16110
- function getLegacyConfigHomeDir() {
16111
- if (process.env.COSTRICT_CONFIG_DIR || process.env.CLAUDE_CONFIG_DIR) {
16112
- return;
16113
- }
16114
- return join2(homedir2(), LEGACY_CONFIG_DIR_NAME).normalize("NFC");
16115
- }
16116
- function hasNodeOption(flag) {
16117
- const nodeOptions = process.env.NODE_OPTIONS;
16118
- if (!nodeOptions) {
16119
- return false;
16120
- }
16121
- return nodeOptions.split(/\s+/u).includes(flag);
16122
- }
16123
- function isEnvTruthy(envVar) {
16124
- if (!envVar)
16125
- return false;
16126
- if (typeof envVar === "boolean")
16127
- return envVar;
16128
- const normalizedValue = envVar.toLowerCase().trim();
16129
- return ["1", "true", "yes", "on"].includes(normalizedValue);
16130
- }
16131
- function getCostrictEnv(suffix) {
16132
- return process.env[`${ENV_PREFIX}_${suffix}`] ?? process.env[`${LEGACY_ENV_PREFIX}_${suffix}`] ?? process.env[`${LEGACY_BRIDGE_ENV_PREFIX}_${suffix}`];
16133
- }
16134
- function isCostrictEnvTruthy(suffix) {
16135
- return isEnvTruthy(getCostrictEnv(suffix));
16136
- }
16137
- function isBareMode() {
16138
- return isEnvTruthy(process.env.COSTRICT_SIMPLE) || isEnvTruthy(process.env.CLAUDE_CODE_SIMPLE) || process.argv.includes("--bare");
16139
- }
16140
- function getAWSRegion() {
16141
- return process.env.AWS_REGION || process.env.AWS_DEFAULT_REGION || "us-east-1";
16142
- }
16143
- function isRunningOnHomespace() {
16144
- return process.env.USER_TYPE === "sf" && isEnvTruthy(process.env.COO_RUNNING_ON_HOMESPACE);
16145
- }
16146
- var getCostrictConfigHomeDir, getClaudeConfigHomeDir;
16147
- var init_envUtils = __esm(() => {
16148
- init_memoize();
16149
- init_branding();
16150
- getCostrictConfigHomeDir = memoize_default(() => {
16151
- return (process.env.COSTRICT_CONFIG_DIR ?? process.env.CLAUDE_CONFIG_DIR ?? join2(homedir2(), CONFIG_DIR_NAME)).normalize("NFC");
16152
- }, () => process.env.COSTRICT_CONFIG_DIR ?? process.env.CLAUDE_CONFIG_DIR);
16153
- getClaudeConfigHomeDir = getCostrictConfigHomeDir;
16154
- });
16155
-
16156
16297
  // node_modules/.bun/@anthropic-ai+sdk@0.80.0+68a1e3a0c4588df3/node_modules/@anthropic-ai/sdk/internal/tslib.mjs
16157
16298
  function __classPrivateFieldSet(receiver, state, value, kind, f) {
16158
16299
  if (kind === "m")
@@ -20832,7 +20973,7 @@ function writeToStderr(data) {
20832
20973
 
20833
20974
  // src/utils/debug.ts
20834
20975
  import { appendFile, mkdir, symlink, unlink } from "fs/promises";
20835
- import { dirname, join as join3 } from "path";
20976
+ import { dirname, join as join5 } from "path";
20836
20977
  function shouldLogDebugMessage(message) {
20837
20978
  if (false) {}
20838
20979
  if (process.env.USER_TYPE !== "sf" && !isDebugMode()) {
@@ -20907,7 +21048,7 @@ function logForDebugging(message, { level } = {
20907
21048
  getDebugWriter().write(output);
20908
21049
  }
20909
21050
  function getDebugLogPath() {
20910
- return getDebugFilePath() ?? process.env.CLAUDE_CODE_DEBUG_LOGS_DIR ?? join3(getClaudeConfigHomeDir(), "debug", `${getSessionId()}.txt`);
21051
+ return getDebugFilePath() ?? process.env.CLAUDE_CODE_DEBUG_LOGS_DIR ?? join5(getClaudeConfigHomeDir(), "debug", `${getSessionId()}.txt`);
20911
21052
  }
20912
21053
  function logAntError(context, error2) {
20913
21054
  if (process.env.USER_TYPE !== "sf") {
@@ -20974,7 +21115,7 @@ var init_debug = __esm(() => {
20974
21115
  try {
20975
21116
  const debugLogPath = getDebugLogPath();
20976
21117
  const debugLogsDir = dirname(debugLogPath);
20977
- const latestSymlinkPath = join3(debugLogsDir, "latest");
21118
+ const latestSymlinkPath = join5(debugLogsDir, "latest");
20978
21119
  await unlink(latestSymlinkPath).catch(() => {});
20979
21120
  await symlink(debugLogPath, latestSymlinkPath);
20980
21121
  } catch {}
@@ -31753,12 +31894,12 @@ var require_form_data = __commonJS((exports, module) => {
31753
31894
  if (value.end != null && value.end != Infinity && value.start != null) {
31754
31895
  callback(null, value.end + 1 - (value.start ? value.start : 0));
31755
31896
  } else {
31756
- fs5.stat(value.path, function(err, stat2) {
31897
+ fs5.stat(value.path, function(err, stat4) {
31757
31898
  if (err) {
31758
31899
  callback(err);
31759
31900
  return;
31760
31901
  }
31761
- var fileSize = stat2.size - (value.start ? value.start : 0);
31902
+ var fileSize = stat4.size - (value.start ? value.start : 0);
31762
31903
  callback(null, fileSize);
31763
31904
  });
31764
31905
  }
@@ -33101,7 +33242,7 @@ __export(exports_supports_color, {
33101
33242
  createSupportsColor: () => createSupportsColor
33102
33243
  });
33103
33244
  import process2 from "process";
33104
- import os2 from "os";
33245
+ import os from "os";
33105
33246
  import tty from "tty";
33106
33247
  function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
33107
33248
  const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
@@ -33167,7 +33308,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
33167
33308
  return min;
33168
33309
  }
33169
33310
  if (process2.platform === "win32") {
33170
- const osRelease = os2.release().split(".");
33311
+ const osRelease = os.release().split(".");
33171
33312
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
33172
33313
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
33173
33314
  }
@@ -33424,7 +33565,7 @@ var require_src = __commonJS((exports, module) => {
33424
33565
  // node_modules/.bun/agent-base@6.0.2/node_modules/agent-base/dist/src/promisify.js
33425
33566
  var require_promisify = __commonJS((exports) => {
33426
33567
  Object.defineProperty(exports, "__esModule", { value: true });
33427
- function promisify(fn) {
33568
+ function promisify2(fn) {
33428
33569
  return function(req, opts) {
33429
33570
  return new Promise((resolve, reject) => {
33430
33571
  fn.call(this, req, opts, (err, rtn) => {
@@ -33437,7 +33578,7 @@ var require_promisify = __commonJS((exports) => {
33437
33578
  });
33438
33579
  };
33439
33580
  }
33440
- exports.default = promisify;
33581
+ exports.default = promisify2;
33441
33582
  });
33442
33583
 
33443
33584
  // node_modules/.bun/agent-base@6.0.2/node_modules/agent-base/dist/src/index.js
@@ -37650,7 +37791,7 @@ var init_ansi_styles = __esm(() => {
37650
37791
 
37651
37792
  // node_modules/.bun/chalk@5.6.2/node_modules/chalk/source/vendor/supports-color/index.js
37652
37793
  import process3 from "process";
37653
- import os3 from "os";
37794
+ import os2 from "os";
37654
37795
  import tty2 from "tty";
37655
37796
  function hasFlag2(flag, argv = globalThis.Deno ? globalThis.Deno.args : process3.argv) {
37656
37797
  const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
@@ -37708,7 +37849,7 @@ function _supportsColor2(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
37708
37849
  return min;
37709
37850
  }
37710
37851
  if (process3.platform === "win32") {
37711
- const osRelease = os3.release().split(".");
37852
+ const osRelease = os2.release().split(".");
37712
37853
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
37713
37854
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
37714
37855
  }
@@ -38830,15 +38971,15 @@ var require_windows = __commonJS((exports, module) => {
38830
38971
  }
38831
38972
  return false;
38832
38973
  }
38833
- function checkStat(stat2, path6, options) {
38834
- if (!stat2.isSymbolicLink() && !stat2.isFile()) {
38974
+ function checkStat(stat4, path6, options) {
38975
+ if (!stat4.isSymbolicLink() && !stat4.isFile()) {
38835
38976
  return false;
38836
38977
  }
38837
38978
  return checkPathExt(path6, options);
38838
38979
  }
38839
38980
  function isexe(path6, options, cb) {
38840
- fs5.stat(path6, function(er, stat2) {
38841
- cb(er, er ? false : checkStat(stat2, path6, options));
38981
+ fs5.stat(path6, function(er, stat4) {
38982
+ cb(er, er ? false : checkStat(stat4, path6, options));
38842
38983
  });
38843
38984
  }
38844
38985
  function sync(path6, options) {
@@ -38852,20 +38993,20 @@ var require_mode = __commonJS((exports, module) => {
38852
38993
  isexe.sync = sync;
38853
38994
  var fs5 = __require("fs");
38854
38995
  function isexe(path6, options, cb) {
38855
- fs5.stat(path6, function(er, stat2) {
38856
- cb(er, er ? false : checkStat(stat2, options));
38996
+ fs5.stat(path6, function(er, stat4) {
38997
+ cb(er, er ? false : checkStat(stat4, options));
38857
38998
  });
38858
38999
  }
38859
39000
  function sync(path6, options) {
38860
39001
  return checkStat(fs5.statSync(path6), options);
38861
39002
  }
38862
- function checkStat(stat2, options) {
38863
- return stat2.isFile() && checkMode(stat2, options);
39003
+ function checkStat(stat4, options) {
39004
+ return stat4.isFile() && checkMode(stat4, options);
38864
39005
  }
38865
- function checkMode(stat2, options) {
38866
- var mod = stat2.mode;
38867
- var uid = stat2.uid;
38868
- var gid = stat2.gid;
39006
+ function checkMode(stat4, options) {
39007
+ var mod = stat4.mode;
39008
+ var uid = stat4.uid;
39009
+ var gid = stat4.gid;
38869
39010
  var myUid = options.uid !== undefined ? options.uid : process.getuid && process.getuid();
38870
39011
  var myGid = options.gid !== undefined ? options.gid : process.getgid && process.getgid();
38871
39012
  var u = parseInt("100", 8);
@@ -39277,7 +39418,7 @@ function pathKey(options = {}) {
39277
39418
  }
39278
39419
 
39279
39420
  // node_modules/.bun/unicorn-magic@0.3.0/node_modules/unicorn-magic/node.js
39280
- import { promisify } from "util";
39421
+ import { promisify as promisify2 } from "util";
39281
39422
  import { execFile as execFileCallback, execFileSync as execFileSyncOriginal } from "child_process";
39282
39423
  import path6 from "path";
39283
39424
  import { fileURLToPath as fileURLToPath3 } from "url";
@@ -39299,7 +39440,7 @@ function traversePathUp(startPath) {
39299
39440
  }
39300
39441
  var execFileOriginal, TEN_MEGABYTES_IN_BYTES;
39301
39442
  var init_node2 = __esm(() => {
39302
- execFileOriginal = promisify(execFileCallback);
39443
+ execFileOriginal = promisify2(execFileCallback);
39303
39444
  TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;
39304
39445
  });
39305
39446
 
@@ -40242,7 +40383,7 @@ var init_outgoing = __esm(() => {
40242
40383
  });
40243
40384
 
40244
40385
  // node_modules/.bun/execa@9.6.1/node_modules/execa/lib/ipc/send.js
40245
- import { promisify as promisify2 } from "util";
40386
+ import { promisify as promisify3 } from "util";
40246
40387
  var sendMessage = ({ anyProcess, channel, isSubprocess, ipc }, message, { strict = false } = {}) => {
40247
40388
  const methodName = "sendMessage";
40248
40389
  validateIpcMethod({
@@ -40303,7 +40444,7 @@ var sendMessage = ({ anyProcess, channel, isSubprocess, ipc }, message, { strict
40303
40444
  if (PROCESS_SEND_METHODS.has(anyProcess)) {
40304
40445
  return PROCESS_SEND_METHODS.get(anyProcess);
40305
40446
  }
40306
- const sendMethod = promisify2(anyProcess.send.bind(anyProcess));
40447
+ const sendMethod = promisify3(anyProcess.send.bind(anyProcess));
40307
40448
  PROCESS_SEND_METHODS.set(anyProcess, sendMethod);
40308
40449
  return sendMethod;
40309
40450
  }, PROCESS_SEND_METHODS;
@@ -40694,10 +40835,10 @@ function stripFinalNewline(input) {
40694
40835
  }
40695
40836
  return stripFinalNewlineBinary(input);
40696
40837
  }
40697
- 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 = `
40838
+ 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 = `
40698
40839
  `, LF_BINARY, CR = "\r", CR_BINARY;
40699
40840
  var init_strip_final_newline = __esm(() => {
40700
- LF_BINARY = LF.codePointAt(0);
40841
+ LF_BINARY = LF2.codePointAt(0);
40701
40842
  CR_BINARY = CR.codePointAt(0);
40702
40843
  });
40703
40844
 
@@ -42353,8 +42494,8 @@ var getSplitLinesGenerator = (binary, preserveNewlines, skipped, state) => binar
42353
42494
  yield previousChunks;
42354
42495
  }
42355
42496
  }, getAppendNewlineGenerator = ({ binary, preserveNewlines, readableObjectMode, state }) => binary || preserveNewlines || readableObjectMode ? undefined : { transform: appendNewlineGenerator.bind(undefined, state) }, appendNewlineGenerator = function* ({ isWindowsNewline = false }, chunk) {
42356
- const { unixNewline, windowsNewline, LF: LF2, concatBytes: concatBytes2 } = typeof chunk === "string" ? linesStringInfo : linesUint8ArrayInfo;
42357
- if (chunk.at(-1) === LF2) {
42497
+ const { unixNewline, windowsNewline, LF: LF3, concatBytes: concatBytes2 } = typeof chunk === "string" ? linesStringInfo : linesUint8ArrayInfo;
42498
+ if (chunk.at(-1) === LF3) {
42358
42499
  yield chunk;
42359
42500
  return;
42360
42501
  }
@@ -45199,7 +45340,7 @@ var init_is_safe_filename = __esm(() => {
45199
45340
 
45200
45341
  // node_modules/.bun/env-paths@4.0.0/node_modules/env-paths/index.js
45201
45342
  import path11 from "path";
45202
- import os4 from "os";
45343
+ import os3 from "os";
45203
45344
  import process12 from "process";
45204
45345
  function envPaths(name, { suffix = "nodejs" } = {}) {
45205
45346
  assertSafeFilename(name);
@@ -45246,20 +45387,11 @@ var homedir3, tmpdir, env3, macos = (name) => {
45246
45387
  };
45247
45388
  var init_env_paths = __esm(() => {
45248
45389
  init_is_safe_filename();
45249
- homedir3 = os4.homedir();
45250
- tmpdir = os4.tmpdir();
45390
+ homedir3 = os3.homedir();
45391
+ tmpdir = os3.tmpdir();
45251
45392
  ({ env: env3 } = process12);
45252
45393
  });
45253
45394
 
45254
- // src/utils/hash.ts
45255
- function djb2Hash(str) {
45256
- let hash2 = 0;
45257
- for (let i2 = 0;i2 < str.length; i2++) {
45258
- hash2 = (hash2 << 5) - hash2 + str.charCodeAt(i2) | 0;
45259
- }
45260
- return hash2;
45261
- }
45262
-
45263
45395
  // src/utils/cachePaths.ts
45264
45396
  var paths;
45265
45397
  var init_cachePaths = __esm(() => {
@@ -60429,9 +60561,9 @@ function stripBOM2(content) {
60429
60561
  var UTF8_BOM = "\uFEFF";
60430
60562
 
60431
60563
  // src/services/remoteManagedSettings/syncCacheState.ts
60432
- import { join as join4 } from "path";
60564
+ import { join as join6 } from "path";
60433
60565
  function getSettingsPath() {
60434
- return join4(getClaudeConfigHomeDir(), SETTINGS_FILENAME);
60566
+ return join6(getClaudeConfigHomeDir(), SETTINGS_FILENAME);
60435
60567
  }
60436
60568
  function loadSettings() {
60437
60569
  try {
@@ -60587,7 +60719,7 @@ var init_fileReadCache = __esm(() => {
60587
60719
  });
60588
60720
 
60589
60721
  // src/utils/platform.ts
60590
- import { readdir, readFile } from "fs/promises";
60722
+ import { readdir as readdir2, readFile } from "fs/promises";
60591
60723
  import { release as osRelease } from "os";
60592
60724
  async function detectVcs(dir) {
60593
60725
  const detected = new Set;
@@ -60596,7 +60728,7 @@ async function detectVcs(dir) {
60596
60728
  }
60597
60729
  try {
60598
60730
  const targetDir = dir ?? getFsImplementation().cwd();
60599
- const entries = new Set(await readdir(targetDir));
60731
+ const entries = new Set(await readdir2(targetDir));
60600
60732
  for (const [marker, vcs] of VCS_MARKERS) {
60601
60733
  if (entries.has(marker)) {
60602
60734
  detected.add(vcs);
@@ -61430,11 +61562,11 @@ var init_memoize2 = __esm(() => {
61430
61562
  });
61431
61563
 
61432
61564
  // src/utils/windowsPaths.ts
61433
- import { existsSync as existsSync2 } from "fs";
61565
+ import { existsSync as existsSync3 } from "fs";
61434
61566
  import * as path12 from "path";
61435
61567
  import * as pathWin32 from "path/win32";
61436
61568
  function checkPathExists(filePath) {
61437
- return existsSync2(filePath);
61569
+ return existsSync3(filePath);
61438
61570
  }
61439
61571
  function findExecutable(executable) {
61440
61572
  if (executable === "git") {
@@ -61527,42 +61659,11 @@ var init_windowsPaths = __esm(() => {
61527
61659
  }, (p) => p, 500);
61528
61660
  });
61529
61661
 
61530
- // src/utils/getWorktreePathsPortable.ts
61531
- import { execFile as execFileCb } from "child_process";
61532
- import { promisify as promisify3 } from "util";
61533
- var execFileAsync;
61534
- var init_getWorktreePathsPortable = __esm(() => {
61535
- execFileAsync = promisify3(execFileCb);
61536
- });
61537
-
61538
- // src/utils/sessionStoragePortable.ts
61539
- function simpleHash(str) {
61540
- return Math.abs(djb2Hash(str)).toString(36);
61541
- }
61542
- function sanitizePath(name) {
61543
- const sanitized = name.replace(/[^a-zA-Z0-9]/g, "-");
61544
- if (sanitized.length <= MAX_SANITIZED_LENGTH) {
61545
- return sanitized;
61546
- }
61547
- const hash3 = typeof Bun !== "undefined" ? Bun.hash(name).toString(36) : simpleHash(name);
61548
- return `${sanitized.slice(0, MAX_SANITIZED_LENGTH)}-${hash3}`;
61549
- }
61550
- var MAX_SANITIZED_LENGTH = 200, TRANSCRIPT_READ_CHUNK_SIZE, SKIP_PRECOMPACT_THRESHOLD, ATTR_SNAP_PREFIX, SYSTEM_PREFIX, LF2 = 10, LF_BYTE;
61551
- var init_sessionStoragePortable = __esm(() => {
61552
- init_envUtils();
61553
- init_getWorktreePathsPortable();
61554
- TRANSCRIPT_READ_CHUNK_SIZE = 1024 * 1024;
61555
- SKIP_PRECOMPACT_THRESHOLD = 5 * 1024 * 1024;
61556
- ATTR_SNAP_PREFIX = Buffer.from('{"type":"attribution-snapshot"');
61557
- SYSTEM_PREFIX = Buffer.from('{"type":"system"');
61558
- LF_BYTE = Buffer.from([LF2]);
61559
- });
61560
-
61561
61662
  // src/utils/path.ts
61562
61663
  import {
61563
61664
  dirname as dirname4,
61564
61665
  isAbsolute,
61565
- join as join6,
61666
+ join as join8,
61566
61667
  normalize,
61567
61668
  posix,
61568
61669
  relative,
@@ -61587,7 +61688,7 @@ import {
61587
61688
  dirname as dirname5,
61588
61689
  extname,
61589
61690
  isAbsolute as isAbsolute2,
61590
- join as join7,
61691
+ join as join9,
61591
61692
  normalize as normalize2,
61592
61693
  relative as relative2,
61593
61694
  resolve as resolve3,
@@ -61694,6 +61795,15 @@ var init_file = __esm(() => {
61694
61795
  MAX_OUTPUT_SIZE = 0.25 * 1024 * 1024;
61695
61796
  });
61696
61797
 
61798
+ // src/utils/settings/userSettingsFilePaths.ts
61799
+ import { join as join10, resolve as resolve4 } from "path";
61800
+ function getUserSettingsFilePaths(filename) {
61801
+ return [join10(resolve4(getClaudeConfigHomeDir()), filename)];
61802
+ }
61803
+ var init_userSettingsFilePaths = __esm(() => {
61804
+ init_envUtils();
61805
+ });
61806
+
61697
61807
  // src/utils/execFileNoThrowPortable.ts
61698
61808
  function execSyncWithDefaults_DEPRECATED(command, optionsOrAbortSignal, timeout = 10 * SECONDS_IN_MINUTE * MS_IN_SECOND) {
61699
61809
  let options;
@@ -61782,7 +61892,7 @@ function execFileNoThrowWithCwd(file2, args, {
61782
61892
  preserveOutputOnError: true,
61783
61893
  maxBuffer: 1e6
61784
61894
  }) {
61785
- return new Promise((resolve4) => {
61895
+ return new Promise((resolve5) => {
61786
61896
  execa(file2, args, {
61787
61897
  maxBuffer,
61788
61898
  cancelSignal: abortSignal,
@@ -61797,17 +61907,17 @@ function execFileNoThrowWithCwd(file2, args, {
61797
61907
  if (result.failed) {
61798
61908
  if (finalPreserveOutput) {
61799
61909
  const errorCode = result.exitCode ?? 1;
61800
- resolve4({
61910
+ resolve5({
61801
61911
  stdout: result.stdout || "",
61802
61912
  stderr: result.stderr || "",
61803
61913
  code: errorCode,
61804
61914
  error: getErrorMessage(result, errorCode)
61805
61915
  });
61806
61916
  } else {
61807
- resolve4({ stdout: "", stderr: "", code: result.exitCode ?? 1 });
61917
+ resolve5({ stdout: "", stderr: "", code: result.exitCode ?? 1 });
61808
61918
  }
61809
61919
  } else {
61810
- resolve4({
61920
+ resolve5({
61811
61921
  stdout: result.stdout,
61812
61922
  stderr: result.stderr,
61813
61923
  code: 0
@@ -61815,7 +61925,7 @@ function execFileNoThrowWithCwd(file2, args, {
61815
61925
  }
61816
61926
  }).catch((error52) => {
61817
61927
  logError2(error52);
61818
- resolve4({ stdout: "", stderr: "", code: 1 });
61928
+ resolve5({ stdout: "", stderr: "", code: 1 });
61819
61929
  });
61820
61930
  });
61821
61931
  }
@@ -61933,10 +62043,10 @@ var init_gitConfigParser = () => {};
61933
62043
 
61934
62044
  // src/utils/git/gitFilesystem.ts
61935
62045
  import { unwatchFile, watchFile } from "fs";
61936
- import { readdir as readdir2, readFile as readFile2, stat as stat2 } from "fs/promises";
61937
- import { join as join8, resolve as resolve4 } from "path";
62046
+ import { readdir as readdir3, readFile as readFile2, stat as stat4 } from "fs/promises";
62047
+ import { join as join11, resolve as resolve5 } from "path";
61938
62048
  async function resolveGitDir(startPath) {
61939
- const cwd2 = resolve4(startPath ?? getCwd());
62049
+ const cwd2 = resolve5(startPath ?? getCwd());
61940
62050
  const cached3 = resolveGitDirCache.get(cwd2);
61941
62051
  if (cached3 !== undefined) {
61942
62052
  return cached3;
@@ -61946,14 +62056,14 @@ async function resolveGitDir(startPath) {
61946
62056
  resolveGitDirCache.set(cwd2, null);
61947
62057
  return null;
61948
62058
  }
61949
- const gitPath = join8(root2, ".git");
62059
+ const gitPath = join11(root2, ".git");
61950
62060
  try {
61951
- const st = await stat2(gitPath);
62061
+ const st = await stat4(gitPath);
61952
62062
  if (st.isFile()) {
61953
62063
  const content = (await readFile2(gitPath, "utf-8")).trim();
61954
62064
  if (content.startsWith("gitdir:")) {
61955
62065
  const rawDir = content.slice("gitdir:".length).trim();
61956
- const resolved = resolve4(root2, rawDir);
62066
+ const resolved = resolve5(root2, rawDir);
61957
62067
  resolveGitDirCache.set(cwd2, resolved);
61958
62068
  return resolved;
61959
62069
  }
@@ -61985,7 +62095,7 @@ function isValidGitSha(s) {
61985
62095
  }
61986
62096
  async function readGitHead(gitDir) {
61987
62097
  try {
61988
- const content = (await readFile2(join8(gitDir, "HEAD"), "utf-8")).trim();
62098
+ const content = (await readFile2(join11(gitDir, "HEAD"), "utf-8")).trim();
61989
62099
  if (content.startsWith("ref:")) {
61990
62100
  const ref = content.slice("ref:".length).trim();
61991
62101
  if (ref.startsWith("refs/heads/")) {
@@ -62022,7 +62132,7 @@ async function resolveRef2(gitDir, ref) {
62022
62132
  }
62023
62133
  async function resolveRefInDir(dir, ref) {
62024
62134
  try {
62025
- const content = (await readFile2(join8(dir, ref), "utf-8")).trim();
62135
+ const content = (await readFile2(join11(dir, ref), "utf-8")).trim();
62026
62136
  if (content.startsWith("ref:")) {
62027
62137
  const target = content.slice("ref:".length).trim();
62028
62138
  if (!isSafeRefName(target)) {
@@ -62036,7 +62146,7 @@ async function resolveRefInDir(dir, ref) {
62036
62146
  return content;
62037
62147
  } catch {}
62038
62148
  try {
62039
- const packed = await readFile2(join8(dir, "packed-refs"), "utf-8");
62149
+ const packed = await readFile2(join11(dir, "packed-refs"), "utf-8");
62040
62150
  for (const line of packed.split(`
62041
62151
  `)) {
62042
62152
  if (line.startsWith("#") || line.startsWith("^")) {
@@ -62056,8 +62166,8 @@ async function resolveRefInDir(dir, ref) {
62056
62166
  }
62057
62167
  async function getCommonDir(gitDir) {
62058
62168
  try {
62059
- const content = (await readFile2(join8(gitDir, "commondir"), "utf-8")).trim();
62060
- return resolve4(gitDir, content);
62169
+ const content = (await readFile2(join11(gitDir, "commondir"), "utf-8")).trim();
62170
+ return resolve5(gitDir, content);
62061
62171
  } catch {
62062
62172
  return null;
62063
62173
  }
@@ -62088,10 +62198,10 @@ class GitFileWatcher {
62088
62198
  return;
62089
62199
  }
62090
62200
  this.commonDir = await getCommonDir(this.gitDir);
62091
- this.watchPath(join8(this.gitDir, "HEAD"), () => {
62201
+ this.watchPath(join11(this.gitDir, "HEAD"), () => {
62092
62202
  this.onHeadChanged();
62093
62203
  });
62094
- this.watchPath(join8(this.commonDir ?? this.gitDir, "config"), () => {
62204
+ this.watchPath(join11(this.commonDir ?? this.gitDir, "config"), () => {
62095
62205
  this.invalidate();
62096
62206
  });
62097
62207
  await this.watchCurrentBranchRef();
@@ -62109,7 +62219,7 @@ class GitFileWatcher {
62109
62219
  }
62110
62220
  const head = await readGitHead(this.gitDir);
62111
62221
  const refsDir = this.commonDir ?? this.gitDir;
62112
- const refPath = head?.type === "branch" ? join8(refsDir, "refs", "heads", head.name) : null;
62222
+ const refPath = head?.type === "branch" ? join11(refsDir, "refs", "heads", head.name) : null;
62113
62223
  if (refPath === this.branchRefPath) {
62114
62224
  return;
62115
62225
  }
@@ -62238,7 +62348,7 @@ var init_which = __esm(() => {
62238
62348
 
62239
62349
  // src/utils/git.ts
62240
62350
  import { readFileSync as readFileSync7, realpathSync as realpathSync3, statSync as statSync3 } from "fs";
62241
- import { basename as basename2, dirname as dirname6, join as join9, resolve as resolve5, sep as sep3 } from "path";
62351
+ import { basename as basename2, dirname as dirname6, join as join12, resolve as resolve6, sep as sep3 } from "path";
62242
62352
  function createFindGitRoot() {
62243
62353
  function wrapper(startPath) {
62244
62354
  const result = findGitRootImpl(startPath);
@@ -62275,15 +62385,15 @@ var init_git = __esm(() => {
62275
62385
  findGitRootImpl = memoizeWithLRU((startPath) => {
62276
62386
  const startTime = Date.now();
62277
62387
  logForDiagnosticsNoPII("info", "find_git_root_started");
62278
- let current = resolve5(startPath);
62388
+ let current = resolve6(startPath);
62279
62389
  const root2 = current.substring(0, current.indexOf(sep3) + 1) || sep3;
62280
62390
  let statCount = 0;
62281
62391
  while (current !== root2) {
62282
62392
  try {
62283
- const gitPath = join9(current, ".git");
62393
+ const gitPath = join12(current, ".git");
62284
62394
  statCount++;
62285
- const stat3 = statSync3(gitPath);
62286
- if (stat3.isDirectory() || stat3.isFile()) {
62395
+ const stat5 = statSync3(gitPath);
62396
+ if (stat5.isDirectory() || stat5.isFile()) {
62287
62397
  logForDiagnosticsNoPII("info", "find_git_root_completed", {
62288
62398
  duration_ms: Date.now() - startTime,
62289
62399
  stat_count: statCount,
@@ -62299,10 +62409,10 @@ var init_git = __esm(() => {
62299
62409
  current = parent;
62300
62410
  }
62301
62411
  try {
62302
- const gitPath = join9(root2, ".git");
62412
+ const gitPath = join12(root2, ".git");
62303
62413
  statCount++;
62304
- const stat3 = statSync3(gitPath);
62305
- if (stat3.isDirectory() || stat3.isFile()) {
62414
+ const stat5 = statSync3(gitPath);
62415
+ if (stat5.isDirectory() || stat5.isFile()) {
62306
62416
  logForDiagnosticsNoPII("info", "find_git_root_completed", {
62307
62417
  duration_ms: Date.now() - startTime,
62308
62418
  stat_count: statCount,
@@ -62321,17 +62431,17 @@ var init_git = __esm(() => {
62321
62431
  findGitRoot = createFindGitRoot();
62322
62432
  resolveCanonicalRoot = memoizeWithLRU((gitRoot) => {
62323
62433
  try {
62324
- const gitContent = readFileSync7(join9(gitRoot, ".git"), "utf-8").trim();
62434
+ const gitContent = readFileSync7(join12(gitRoot, ".git"), "utf-8").trim();
62325
62435
  if (!gitContent.startsWith("gitdir:")) {
62326
62436
  return gitRoot;
62327
62437
  }
62328
- const worktreeGitDir = resolve5(gitRoot, gitContent.slice("gitdir:".length).trim());
62329
- const commonDir = resolve5(worktreeGitDir, readFileSync7(join9(worktreeGitDir, "commondir"), "utf-8").trim());
62330
- if (resolve5(dirname6(worktreeGitDir)) !== join9(commonDir, "worktrees")) {
62438
+ const worktreeGitDir = resolve6(gitRoot, gitContent.slice("gitdir:".length).trim());
62439
+ const commonDir = resolve6(worktreeGitDir, readFileSync7(join12(worktreeGitDir, "commondir"), "utf-8").trim());
62440
+ if (resolve6(dirname6(worktreeGitDir)) !== join12(commonDir, "worktrees")) {
62331
62441
  return gitRoot;
62332
62442
  }
62333
- const backlink = realpathSync3(readFileSync7(join9(worktreeGitDir, "gitdir"), "utf-8").trim());
62334
- if (backlink !== join9(realpathSync3(gitRoot), ".git")) {
62443
+ const backlink = realpathSync3(readFileSync7(join12(worktreeGitDir, "gitdir"), "utf-8").trim());
62444
+ if (backlink !== join12(realpathSync3(gitRoot), ".git")) {
62335
62445
  return gitRoot;
62336
62446
  }
62337
62447
  if (basename2(commonDir) !== ".git") {
@@ -67409,8 +67519,8 @@ Error generating stack: ` + x.message + `
67409
67519
  currentEntangledActionThenable = {
67410
67520
  status: "pending",
67411
67521
  value: undefined,
67412
- then: function(resolve6) {
67413
- entangledListeners.push(resolve6);
67522
+ then: function(resolve7) {
67523
+ entangledListeners.push(resolve7);
67414
67524
  }
67415
67525
  };
67416
67526
  }
@@ -67434,8 +67544,8 @@ Error generating stack: ` + x.message + `
67434
67544
  status: "pending",
67435
67545
  value: null,
67436
67546
  reason: null,
67437
- then: function(resolve6) {
67438
- listeners.push(resolve6);
67547
+ then: function(resolve7) {
67548
+ listeners.push(resolve7);
67439
67549
  }
67440
67550
  };
67441
67551
  thenable.then(function() {
@@ -79372,10 +79482,10 @@ var init_dec = __esm(() => {
79372
79482
  import { Buffer as Buffer8 } from "buffer";
79373
79483
  import { execFile as nodeExecFile } from "child_process";
79374
79484
  function execFileNoThrow2(command, args, options = {}) {
79375
- return new Promise((resolve6) => {
79485
+ return new Promise((resolve7) => {
79376
79486
  const { input, timeout } = options;
79377
79487
  const proc = nodeExecFile(command, args, { timeout }, (error52, stdout, stderr) => {
79378
- resolve6({
79488
+ resolve7({
79379
79489
  code: error52 ? 1 : 0,
79380
79490
  stdout: stdout ?? "",
79381
79491
  stderr: stderr ?? ""
@@ -79752,8 +79862,8 @@ function setTerminalFocused(v) {
79752
79862
  cb();
79753
79863
  }
79754
79864
  if (!v) {
79755
- for (const resolve6 of resolvers) {
79756
- resolve6();
79865
+ for (const resolve7 of resolvers) {
79866
+ resolve7();
79757
79867
  }
79758
79868
  resolvers.clear();
79759
79869
  }
@@ -79791,18 +79901,18 @@ class TerminalQuerier {
79791
79901
  this.stdout = stdout;
79792
79902
  }
79793
79903
  send(query) {
79794
- return new Promise((resolve6) => {
79904
+ return new Promise((resolve7) => {
79795
79905
  this.queue.push({
79796
79906
  kind: "query",
79797
79907
  match: query.match,
79798
- resolve: (r) => resolve6(r)
79908
+ resolve: (r) => resolve7(r)
79799
79909
  });
79800
79910
  this.stdout.write(query.request);
79801
79911
  });
79802
79912
  }
79803
79913
  flush() {
79804
- return new Promise((resolve6) => {
79805
- this.queue.push({ kind: "sentinel", resolve: resolve6 });
79914
+ return new Promise((resolve7) => {
79915
+ this.queue.push({ kind: "sentinel", resolve: resolve7 });
79806
79916
  this.stdout.write(SENTINEL);
79807
79917
  });
79808
79918
  }
@@ -84829,8 +84939,8 @@ class Ink {
84829
84939
  }
84830
84940
  }
84831
84941
  async waitUntilExit() {
84832
- this.exitPromise ||= new Promise((resolve6, reject) => {
84833
- this.resolveExitPromise = resolve6;
84942
+ this.exitPromise ||= new Promise((resolve7, reject) => {
84943
+ this.resolveExitPromise = resolve7;
84834
84944
  this.rejectExitPromise = reject;
84835
84945
  });
84836
84946
  return this.exitPromise;
@@ -86779,7 +86889,7 @@ var init_internalWrites = __esm(() => {
86779
86889
  });
86780
86890
 
86781
86891
  // src/utils/settings/managedPath.ts
86782
- import { join as join10 } from "path";
86892
+ import { join as join13 } from "path";
86783
86893
  var getManagedFilePath, getManagedSettingsDropInDir;
86784
86894
  var init_managedPath = __esm(() => {
86785
86895
  init_memoize();
@@ -86798,7 +86908,7 @@ var init_managedPath = __esm(() => {
86798
86908
  }
86799
86909
  });
86800
86910
  getManagedSettingsDropInDir = memoize_default(function() {
86801
- return join10(getManagedFilePath(), "managed-settings.d");
86911
+ return join13(getManagedFilePath(), "managed-settings.d");
86802
86912
  });
86803
86913
  });
86804
86914
 
@@ -86862,7 +86972,7 @@ var init_findExecutable = __esm(() => {
86862
86972
 
86863
86973
  // src/utils/env.ts
86864
86974
  import { homedir as homedir4 } from "os";
86865
- import { join as join11 } from "path";
86975
+ import { join as join14 } from "path";
86866
86976
  async function isCommandAvailable(command) {
86867
86977
  try {
86868
86978
  return !!await which(command);
@@ -86983,11 +87093,11 @@ var init_env = __esm(() => {
86983
87093
  init_fsOperations();
86984
87094
  init_which();
86985
87095
  getGlobalClaudeFile = memoize_default(() => {
86986
- if (getFsImplementation().existsSync(join11(getClaudeConfigHomeDir(), ".config.json"))) {
86987
- return join11(getClaudeConfigHomeDir(), ".config.json");
87096
+ if (getFsImplementation().existsSync(join14(getClaudeConfigHomeDir(), ".config.json"))) {
87097
+ return join14(getClaudeConfigHomeDir(), ".config.json");
86988
87098
  }
86989
87099
  const filename = `.claude${fileSuffixForOauthConfig()}.json`;
86990
- return join11(process.env.CLAUDE_CONFIG_DIR || homedir4(), filename);
87100
+ return join14(process.env.CLAUDE_CONFIG_DIR || homedir4(), filename);
86991
87101
  });
86992
87102
  hasInternetAccess = memoize_default(async () => {
86993
87103
  try {
@@ -88320,6 +88430,7 @@ var init_types2 = __esm(() => {
88320
88430
  sparsePaths: exports_external.array(exports_external.string()).optional().describe("Directories to include when creating worktrees, via git sparse-checkout (cone mode). " + "Dramatically faster in large monorepos \u2014 only the listed paths are written to disk.")
88321
88431
  }).optional().describe("Git worktree configuration for --worktree flag."),
88322
88432
  disableAllHooks: exports_external.boolean().optional().describe("Disable all hooks and statusLine execution"),
88433
+ dynamicWorkflowsEnabled: exports_external.boolean().optional().describe("Enable dynamic multi-agent workflow orchestration. Defaults to false."),
88323
88434
  defaultShell: exports_external.enum(["bash", "powershell"]).optional().describe("Default shell for input-box ! commands. " + "Defaults to 'bash' on all platforms (no Windows auto-flip)."),
88324
88435
  allowManagedHooksOnly: exports_external.boolean().optional().describe("When true (and set in managed settings), only hooks from managed settings run. " + "User, project, and local hooks are ignored."),
88325
88436
  allowedHttpHookUrls: exports_external.array(exports_external.string()).optional().describe("Allowlist of URL patterns that HTTP hooks may target. " + 'Supports * as a wildcard (e.g. "https://hooks.example.com/*"). ' + "When set, HTTP hooks with non-matching URLs are blocked. " + "If undefined, all URLs are allowed. If empty array, no HTTP hooks are allowed. " + "Arrays merge across settings sources (same semantics as allowedMcpServers)."),
@@ -88370,6 +88481,7 @@ var init_types2 = __esm(() => {
88370
88481
  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."),
88371
88482
  alwaysThinkingEnabled: exports_external.boolean().optional().describe("When false, thinking is disabled. When absent or true, thinking is " + "enabled automatically for supported models."),
88372
88483
  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."),
88484
+ reclaimMode: exports_external.enum(["off", "lite", "full", "ultra"]).optional().catch(undefined).describe("Persisted Reclaim intensity mode (off/lite/full/ultra)."),
88373
88485
  advisorModel: exports_external.string().optional().describe("Advisor model for the server-side advisor tool."),
88374
88486
  fastMode: exports_external.boolean().optional().describe("When true, fast mode is enabled. When absent or false, fast mode is off."),
88375
88487
  fastModePerSessionOptIn: exports_external.boolean().optional().describe("When true, fast mode does not persist across sessions. Each session starts with fast mode off."),
@@ -88736,10 +88848,9 @@ var init_settings = __esm(() => {
88736
88848
  });
88737
88849
 
88738
88850
  // src/utils/settings/settings.ts
88739
- import { homedir as homedir5 } from "os";
88740
- import { dirname as dirname7, join as join12, resolve as resolve6 } from "path";
88851
+ import { dirname as dirname7, join as join15, resolve as resolve7 } from "path";
88741
88852
  function getManagedSettingsFilePath() {
88742
- return join12(getManagedFilePath(), "managed-settings.json");
88853
+ return join15(getManagedFilePath(), "managed-settings.json");
88743
88854
  }
88744
88855
  function loadManagedFileSettings() {
88745
88856
  const errors3 = [];
@@ -88755,7 +88866,7 @@ function loadManagedFileSettings() {
88755
88866
  try {
88756
88867
  const entries = getFsImplementation().readdirSync(dropInDir).filter((d) => (d.isFile() || d.isSymbolicLink()) && d.name.endsWith(".json") && !d.name.startsWith(".")).map((d) => d.name).sort();
88757
88868
  for (const name of entries) {
88758
- const { settings: settings2, errors: fileErrors } = parseSettingsFile(join12(dropInDir, name));
88869
+ const { settings: settings2, errors: fileErrors } = parseSettingsFile(join15(dropInDir, name));
88759
88870
  errors3.push(...fileErrors);
88760
88871
  if (settings2 && Object.keys(settings2).length > 0) {
88761
88872
  merged = mergeWith_default(merged, settings2, settingsMergeCustomizer);
@@ -88815,15 +88926,15 @@ function parseSettingsFileUncached(path13) {
88815
88926
  function getSettingsRootPathForSource(source) {
88816
88927
  switch (source) {
88817
88928
  case "userSettings":
88818
- return resolve6(getClaudeConfigHomeDir());
88929
+ return resolve7(getClaudeConfigHomeDir());
88819
88930
  case "policySettings":
88820
88931
  case "projectSettings":
88821
88932
  case "localSettings": {
88822
- return resolve6(getOriginalCwd());
88933
+ return resolve7(getOriginalCwd());
88823
88934
  }
88824
88935
  case "flagSettings": {
88825
88936
  const path13 = getFlagSettingsPath();
88826
- return path13 ? dirname7(resolve6(path13)) : resolve6(getOriginalCwd());
88937
+ return path13 ? dirname7(resolve7(path13)) : resolve7(getOriginalCwd());
88827
88938
  }
88828
88939
  }
88829
88940
  }
@@ -88833,29 +88944,16 @@ function getUserSettingsFilePath() {
88833
88944
  }
88834
88945
  return "settings.json";
88835
88946
  }
88836
- function getUserSettingsFilePaths() {
88837
- const filename = getUserSettingsFilePath();
88838
- const primary = join12(resolve6(getClaudeConfigHomeDir()), filename);
88839
- if (process.env.COSTRICT_CONFIG_DIR || process.env.CLAUDE_CONFIG_DIR) {
88840
- return [primary];
88841
- }
88842
- const legacy = join12(homedir5(), LEGACY_CONFIG_DIR_NAME, filename);
88843
- const defaultPrimary = join12(homedir5(), CONFIG_DIR_NAME, filename);
88844
- if (resolve6(primary) !== resolve6(defaultPrimary)) {
88845
- return [primary];
88846
- }
88847
- if (resolve6(legacy) === resolve6(primary)) {
88848
- return [primary];
88849
- }
88850
- return [legacy, primary];
88947
+ function getUserSettingsFilePaths2() {
88948
+ return getUserSettingsFilePaths(getUserSettingsFilePath());
88851
88949
  }
88852
88950
  function getSettingsFilePathForSource(source) {
88853
88951
  switch (source) {
88854
88952
  case "userSettings":
88855
- return join12(getSettingsRootPathForSource(source), getUserSettingsFilePath());
88953
+ return join15(getSettingsRootPathForSource(source), getUserSettingsFilePath());
88856
88954
  case "projectSettings":
88857
88955
  case "localSettings": {
88858
- return join12(getSettingsRootPathForSource(source), getRelativeSettingsFilePathForSource(source));
88956
+ return join15(getSettingsRootPathForSource(source), getRelativeSettingsFilePathForSource(source));
88859
88957
  }
88860
88958
  case "policySettings":
88861
88959
  return getManagedSettingsFilePath();
@@ -88867,9 +88965,9 @@ function getSettingsFilePathForSource(source) {
88867
88965
  function getRelativeSettingsFilePathForSource(source) {
88868
88966
  switch (source) {
88869
88967
  case "projectSettings":
88870
- return join12(".claude", "settings.json");
88968
+ return join15(".claude", "settings.json");
88871
88969
  case "localSettings":
88872
- return join12(".claude", "settings.local.json");
88970
+ return join15(".claude", "settings.local.json");
88873
88971
  }
88874
88972
  }
88875
88973
  function getSettingsForSource(source) {
@@ -88903,7 +89001,7 @@ function getSettingsForSourceUncached(source) {
88903
89001
  if (source === "userSettings") {
88904
89002
  let mergedSettings = {};
88905
89003
  let found = false;
88906
- for (const settingsFilePath2 of getUserSettingsFilePaths()) {
89004
+ for (const settingsFilePath2 of getUserSettingsFilePaths2()) {
88907
89005
  const { settings } = parseSettingsFile(settingsFilePath2);
88908
89006
  if (settings) {
88909
89007
  mergedSettings = mergeWith_default(mergedSettings, settings, settingsMergeCustomizer);
@@ -88997,9 +89095,9 @@ function loadSettingsFromDisk() {
88997
89095
  }
88998
89096
  continue;
88999
89097
  }
89000
- const filePaths = source === "userSettings" ? getUserSettingsFilePaths() : getSettingsFilePathForSource(source) ? [getSettingsFilePathForSource(source)] : [];
89098
+ const filePaths = source === "userSettings" ? getUserSettingsFilePaths2() : getSettingsFilePathForSource(source) ? [getSettingsFilePathForSource(source)] : [];
89001
89099
  for (const filePath of filePaths) {
89002
- const resolvedPath = resolve6(filePath);
89100
+ const resolvedPath = resolve7(filePath);
89003
89101
  if (!seenFiles.has(resolvedPath)) {
89004
89102
  seenFiles.add(resolvedPath);
89005
89103
  const { settings, errors: errors3 } = parseSettingsFile(filePath);
@@ -89058,8 +89156,8 @@ var init_settings2 = __esm(() => {
89058
89156
  init_diagLogs();
89059
89157
  init_envUtils();
89060
89158
  init_errors3();
89061
- init_branding();
89062
89159
  init_file();
89160
+ init_userSettingsFilePaths();
89063
89161
  init_fileRead();
89064
89162
  init_fsOperations();
89065
89163
  init_gitignore();
@@ -89194,7 +89292,7 @@ var init_dist3 = __esm(() => {
89194
89292
 
89195
89293
  // node_modules/.bun/https-proxy-agent@8.0.0/node_modules/https-proxy-agent/dist/parse-proxy-response.js
89196
89294
  function parseProxyResponse(socket) {
89197
- return new Promise((resolve7, reject) => {
89295
+ return new Promise((resolve8, reject) => {
89198
89296
  let buffersLength = 0;
89199
89297
  const buffers = [];
89200
89298
  function read() {
@@ -89263,7 +89361,7 @@ function parseProxyResponse(socket) {
89263
89361
  }
89264
89362
  debug("got proxy server response: %o %o", firstLine, headers);
89265
89363
  cleanup();
89266
- resolve7({
89364
+ resolve8({
89267
89365
  connect: {
89268
89366
  statusCode,
89269
89367
  statusText,
@@ -90752,7 +90850,7 @@ var require_client = __commonJS((exports) => {
90752
90850
  };
90753
90851
  };
90754
90852
  var sleep2 = (seconds) => {
90755
- return new Promise((resolve7) => setTimeout(resolve7, seconds * 1000));
90853
+ return new Promise((resolve8) => setTimeout(resolve8, seconds * 1000));
90756
90854
  };
90757
90855
  var waiterServiceDefaults = {
90758
90856
  minDelay: 2,
@@ -90881,8 +90979,8 @@ var require_client = __commonJS((exports) => {
90881
90979
  };
90882
90980
  var abortTimeout = (abortSignal) => {
90883
90981
  let onAbort;
90884
- const promise2 = new Promise((resolve7) => {
90885
- onAbort = () => resolve7({ state: exports.WaiterState.ABORTED });
90982
+ const promise2 = new Promise((resolve8) => {
90983
+ onAbort = () => resolve8({ state: exports.WaiterState.ABORTED });
90886
90984
  if (typeof abortSignal.addEventListener === "function") {
90887
90985
  abortSignal.addEventListener("abort", onAbort);
90888
90986
  } else {
@@ -92099,7 +92197,7 @@ var require_config = __commonJS((exports) => {
92099
92197
  };
92100
92198
  var imdsHttpGet = async ({ hostname: hostname3, path: path13 }) => {
92101
92199
  const { request } = await import("http");
92102
- return new Promise((resolve7, reject) => {
92200
+ return new Promise((resolve8, reject) => {
92103
92201
  const req = request({
92104
92202
  method: "GET",
92105
92203
  hostname: hostname3.replace(/^\[(.+)]$/, "$1"),
@@ -92125,7 +92223,7 @@ var require_config = __commonJS((exports) => {
92125
92223
  const chunks = [];
92126
92224
  res.on("data", (chunk) => chunks.push(chunk));
92127
92225
  res.on("end", () => {
92128
- resolve7(Buffer.concat(chunks));
92226
+ resolve8(Buffer.concat(chunks));
92129
92227
  req.destroy();
92130
92228
  });
92131
92229
  });
@@ -94283,7 +94381,7 @@ ${value}\r
94283
94381
  if (isReadableStream4(stream4)) {
94284
94382
  return headStream$1(stream4, bytes);
94285
94383
  }
94286
- return new Promise((resolve7, reject) => {
94384
+ return new Promise((resolve8, reject) => {
94287
94385
  const collector = new Collector$1;
94288
94386
  collector.limit = bytes;
94289
94387
  stream4.pipe(collector);
@@ -94294,7 +94392,7 @@ ${value}\r
94294
94392
  collector.on("error", reject);
94295
94393
  collector.on("finish", function() {
94296
94394
  const bytes2 = new Uint8Array(Buffer.concat(this.buffers));
94297
- resolve7(bytes2);
94395
+ resolve8(bytes2);
94298
94396
  });
94299
94397
  });
94300
94398
  };
@@ -94392,7 +94490,7 @@ ${value}\r
94392
94490
  return collected;
94393
94491
  }
94394
94492
  function readToBase64(blob) {
94395
- return new Promise((resolve7, reject) => {
94493
+ return new Promise((resolve8, reject) => {
94396
94494
  const reader = new FileReader;
94397
94495
  reader.onloadend = () => {
94398
94496
  if (reader.readyState !== 2) {
@@ -94401,7 +94499,7 @@ ${value}\r
94401
94499
  const result = reader.result ?? "";
94402
94500
  const commaIndex = result.indexOf(",");
94403
94501
  const dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length;
94404
- resolve7(result.substring(dataOffset));
94502
+ resolve8(result.substring(dataOffset));
94405
94503
  };
94406
94504
  reader.onabort = () => reject(new Error("Read aborted"));
94407
94505
  reader.onerror = () => reject(reader.error);
@@ -94495,7 +94593,7 @@ ${value}\r
94495
94593
  if (isReadableStreamInstance(stream4)) {
94496
94594
  return collectReadableStream(stream4);
94497
94595
  }
94498
- return new Promise((resolve7, reject) => {
94596
+ return new Promise((resolve8, reject) => {
94499
94597
  const collector = new Collector;
94500
94598
  stream4.pipe(collector);
94501
94599
  stream4.on("error", (err) => {
@@ -94505,7 +94603,7 @@ ${value}\r
94505
94603
  collector.on("error", reject);
94506
94604
  collector.on("finish", function() {
94507
94605
  const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes));
94508
- resolve7(bytes);
94606
+ resolve8(bytes);
94509
94607
  });
94510
94608
  });
94511
94609
  };
@@ -94823,11 +94921,11 @@ var require_tslib = __commonJS((exports, module) => {
94823
94921
  };
94824
94922
  __awaiter = function(thisArg, _arguments, P2, generator) {
94825
94923
  function adopt(value) {
94826
- return value instanceof P2 ? value : new P2(function(resolve7) {
94827
- resolve7(value);
94924
+ return value instanceof P2 ? value : new P2(function(resolve8) {
94925
+ resolve8(value);
94828
94926
  });
94829
94927
  }
94830
- return new (P2 || (P2 = Promise))(function(resolve7, reject) {
94928
+ return new (P2 || (P2 = Promise))(function(resolve8, reject) {
94831
94929
  function fulfilled(value) {
94832
94930
  try {
94833
94931
  step(generator.next(value));
@@ -94843,7 +94941,7 @@ var require_tslib = __commonJS((exports, module) => {
94843
94941
  }
94844
94942
  }
94845
94943
  function step(result) {
94846
- result.done ? resolve7(result.value) : adopt(result.value).then(fulfilled, rejected);
94944
+ result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected);
94847
94945
  }
94848
94946
  step((generator = generator.apply(thisArg, _arguments || [])).next());
94849
94947
  });
@@ -95072,14 +95170,14 @@ var require_tslib = __commonJS((exports, module) => {
95072
95170
  }, i2);
95073
95171
  function verb(n2) {
95074
95172
  i2[n2] = o2[n2] && function(v) {
95075
- return new Promise(function(resolve7, reject) {
95076
- v = o2[n2](v), settle2(resolve7, reject, v.done, v.value);
95173
+ return new Promise(function(resolve8, reject) {
95174
+ v = o2[n2](v), settle2(resolve8, reject, v.done, v.value);
95077
95175
  });
95078
95176
  };
95079
95177
  }
95080
- function settle2(resolve7, reject, d, v) {
95178
+ function settle2(resolve8, reject, d, v) {
95081
95179
  Promise.resolve(v).then(function(v2) {
95082
- resolve7({ value: v2, done: d });
95180
+ resolve8({ value: v2, done: d });
95083
95181
  }, reject);
95084
95182
  }
95085
95183
  };
@@ -96363,7 +96461,7 @@ var require_event_streams = __commonJS((exports) => {
96363
96461
  streamEnded = true;
96364
96462
  });
96365
96463
  while (!generationEnded) {
96366
- const value = await new Promise((resolve7) => setTimeout(() => resolve7(records.shift()), 0));
96464
+ const value = await new Promise((resolve8) => setTimeout(() => resolve8(records.shift()), 0));
96367
96465
  if (value) {
96368
96466
  yield value;
96369
96467
  }
@@ -97773,21 +97871,21 @@ var require_dist_cjs5 = __commonJS((exports) => {
97773
97871
  let sendBody = true;
97774
97872
  if (!externalAgent && expect === "100-continue") {
97775
97873
  sendBody = await Promise.race([
97776
- new Promise((resolve7) => {
97777
- timeoutId = Number(timing2.setTimeout(() => resolve7(true), Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs)));
97874
+ new Promise((resolve8) => {
97875
+ timeoutId = Number(timing2.setTimeout(() => resolve8(true), Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs)));
97778
97876
  }),
97779
- new Promise((resolve7) => {
97877
+ new Promise((resolve8) => {
97780
97878
  httpRequest.on("continue", () => {
97781
97879
  timing2.clearTimeout(timeoutId);
97782
- resolve7(true);
97880
+ resolve8(true);
97783
97881
  });
97784
97882
  httpRequest.on("response", () => {
97785
97883
  timing2.clearTimeout(timeoutId);
97786
- resolve7(false);
97884
+ resolve8(false);
97787
97885
  });
97788
97886
  httpRequest.on("error", () => {
97789
97887
  timing2.clearTimeout(timeoutId);
97790
- resolve7(false);
97888
+ resolve8(false);
97791
97889
  });
97792
97890
  })
97793
97891
  ]);
@@ -97862,13 +97960,13 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
97862
97960
  return socketWarningTimestamp;
97863
97961
  }
97864
97962
  constructor(options) {
97865
- this.configProvider = new Promise((resolve7, reject) => {
97963
+ this.configProvider = new Promise((resolve8, reject) => {
97866
97964
  if (typeof options === "function") {
97867
97965
  options().then((_options) => {
97868
- resolve7(this.resolveDefaultConfig(_options));
97966
+ resolve8(this.resolveDefaultConfig(_options));
97869
97967
  }).catch(reject);
97870
97968
  } else {
97871
- resolve7(this.resolveDefaultConfig(options));
97969
+ resolve8(this.resolveDefaultConfig(options));
97872
97970
  }
97873
97971
  });
97874
97972
  }
@@ -97899,7 +97997,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
97899
97997
  timing2.clearTimeout(socketTimeoutId);
97900
97998
  timing2.clearTimeout(keepAliveTimeoutId);
97901
97999
  };
97902
- const resolve7 = async (arg) => {
98000
+ const resolve8 = async (arg) => {
97903
98001
  await writeRequestBodyPromise;
97904
98002
  clearTimeouts();
97905
98003
  _resolve(arg);
@@ -97963,7 +98061,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
97963
98061
  headers: getTransformedHeaders(res.headers),
97964
98062
  body: res
97965
98063
  });
97966
- resolve7({ response: httpResponse });
98064
+ resolve8({ response: httpResponse });
97967
98065
  });
97968
98066
  req.on("error", (err) => {
97969
98067
  if (NODEJS_TIMEOUT_ERROR_CODES.includes(err.code)) {
@@ -98289,13 +98387,13 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
98289
98387
  return new NodeHttp2Handler(instanceOrOptions);
98290
98388
  }
98291
98389
  constructor(options) {
98292
- this.configProvider = new Promise((resolve7, reject) => {
98390
+ this.configProvider = new Promise((resolve8, reject) => {
98293
98391
  if (typeof options === "function") {
98294
98392
  options().then((opts) => {
98295
- resolve7(opts || {});
98393
+ resolve8(opts || {});
98296
98394
  }).catch(reject);
98297
98395
  } else {
98298
- resolve7(options || {});
98396
+ resolve8(options || {});
98299
98397
  }
98300
98398
  });
98301
98399
  }
@@ -98320,7 +98418,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
98320
98418
  return new Promise((_resolve, _reject) => {
98321
98419
  let fulfilled = false;
98322
98420
  let writeRequestBodyPromise = undefined;
98323
- const resolve7 = async (arg) => {
98421
+ const resolve8 = async (arg) => {
98324
98422
  await writeRequestBodyPromise;
98325
98423
  _resolve(arg);
98326
98424
  };
@@ -98405,7 +98503,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
98405
98503
  body: clientHttp2Stream
98406
98504
  });
98407
98505
  fulfilled = true;
98408
- resolve7({ response: httpResponse });
98506
+ resolve8({ response: httpResponse });
98409
98507
  if (useIsolatedSession) {
98410
98508
  session.close();
98411
98509
  }
@@ -98448,7 +98546,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
98448
98546
  if (isReadableStreamInstance(stream4)) {
98449
98547
  return collectReadableStream(stream4);
98450
98548
  }
98451
- return new Promise((resolve7, reject) => {
98549
+ return new Promise((resolve8, reject) => {
98452
98550
  const collector = new Collector;
98453
98551
  stream4.pipe(collector);
98454
98552
  stream4.on("error", (err) => {
@@ -98458,7 +98556,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
98458
98556
  collector.on("error", reject);
98459
98557
  collector.on("finish", function() {
98460
98558
  const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes));
98461
- resolve7(bytes);
98559
+ resolve8(bytes);
98462
98560
  });
98463
98561
  });
98464
98562
  };
@@ -98676,7 +98774,7 @@ var require_retry2 = __commonJS((exports) => {
98676
98774
  }
98677
98775
  };
98678
98776
  }
98679
- var cooldown = (ms) => new Promise((resolve7) => setTimeout(resolve7, ms));
98777
+ var cooldown = (ms) => new Promise((resolve8) => setTimeout(resolve8, ms));
98680
98778
  var isRetryStrategyV2 = (retryStrategy) => typeof retryStrategy.acquireInitialRetryToken !== "undefined" && typeof retryStrategy.refreshRetryTokenForRetry !== "undefined" && typeof retryStrategy.recordSuccess !== "undefined";
98681
98779
  var getRetryErrorInfo = (error52, logger) => {
98682
98780
  const errorInfo = {
@@ -98775,7 +98873,7 @@ var require_retry2 = __commonJS((exports) => {
98775
98873
  this.refillTokenBucket();
98776
98874
  while (amount > this.availableTokens) {
98777
98875
  const delay = (amount - this.availableTokens) / this.fillRate * 1000;
98778
- await new Promise((resolve7) => DefaultRateLimiter.setTimeoutFn(resolve7, delay));
98876
+ await new Promise((resolve8) => DefaultRateLimiter.setTimeoutFn(resolve8, delay));
98779
98877
  this.refillTokenBucket();
98780
98878
  }
98781
98879
  this.availableTokens = this.availableTokens - amount;
@@ -99117,7 +99215,7 @@ var require_retry2 = __commonJS((exports) => {
99117
99215
  const delayFromResponse = getDelayFromRetryAfterHeader(err.$response);
99118
99216
  const delay = Math.max(delayFromResponse || 0, delayFromDecider);
99119
99217
  totalDelay += delay;
99120
- await new Promise((resolve7) => setTimeout(resolve7, delay));
99218
+ await new Promise((resolve8) => setTimeout(resolve8, delay));
99121
99219
  continue;
99122
99220
  }
99123
99221
  if (!err.$metadata) {
@@ -101121,14 +101219,14 @@ var init_parser_os = __esm(() => {
101121
101219
  describe(ua) {
101122
101220
  const version2 = Utils.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i, ua).replace(/[_\s]/g, ".");
101123
101221
  const versionName = Utils.getMacOSVersionName(version2);
101124
- const os5 = {
101222
+ const os4 = {
101125
101223
  name: OS_MAP.MacOS,
101126
101224
  version: version2
101127
101225
  };
101128
101226
  if (versionName) {
101129
- os5.versionName = versionName;
101227
+ os4.versionName = versionName;
101130
101228
  }
101131
- return os5;
101229
+ return os4;
101132
101230
  }
101133
101231
  },
101134
101232
  {
@@ -101160,27 +101258,27 @@ var init_parser_os = __esm(() => {
101160
101258
  describe(ua) {
101161
101259
  const version2 = Utils.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i, ua);
101162
101260
  const versionName = Utils.getAndroidVersionName(version2);
101163
- const os5 = {
101261
+ const os4 = {
101164
101262
  name: OS_MAP.Android,
101165
101263
  version: version2
101166
101264
  };
101167
101265
  if (versionName) {
101168
- os5.versionName = versionName;
101266
+ os4.versionName = versionName;
101169
101267
  }
101170
- return os5;
101268
+ return os4;
101171
101269
  }
101172
101270
  },
101173
101271
  {
101174
101272
  test: [/(web|hpw)[o0]s/i],
101175
101273
  describe(ua) {
101176
101274
  const version2 = Utils.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i, ua);
101177
- const os5 = {
101275
+ const os4 = {
101178
101276
  name: OS_MAP.WebOS
101179
101277
  };
101180
101278
  if (version2 && version2.length) {
101181
- os5.version = version2;
101279
+ os4.version = version2;
101182
101280
  }
101183
- return os5;
101281
+ return os4;
101184
101282
  }
101185
101283
  },
101186
101284
  {
@@ -101889,7 +101987,7 @@ class Parser2 {
101889
101987
  }
101890
101988
  parseOS() {
101891
101989
  this.parsedResult.os = {};
101892
- const os5 = Utils.find(parser_os_default, (_os) => {
101990
+ const os4 = Utils.find(parser_os_default, (_os) => {
101893
101991
  if (typeof _os.test === "function") {
101894
101992
  return _os.test(this);
101895
101993
  }
@@ -101898,8 +101996,8 @@ class Parser2 {
101898
101996
  }
101899
101997
  throw new Error("Browser's test function is not valid");
101900
101998
  });
101901
- if (os5) {
101902
- this.parsedResult.os = os5.describe(this.getUA());
101999
+ if (os4) {
102000
+ this.parsedResult.os = os4.describe(this.getUA());
101903
102001
  }
101904
102002
  return this.parsedResult.os;
101905
102003
  }
@@ -102926,7 +103024,7 @@ var init_node_http = () => {};
102926
103024
 
102927
103025
  // node_modules/.bun/@smithy+credential-provider-imds@4.3.8/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/httpRequest.js
102928
103026
  function httpRequest(options) {
102929
- return new Promise((resolve7, reject) => {
103027
+ return new Promise((resolve8, reject) => {
102930
103028
  const req = node_http.request({
102931
103029
  method: "GET",
102932
103030
  ...options,
@@ -102951,7 +103049,7 @@ function httpRequest(options) {
102951
103049
  chunks.push(chunk);
102952
103050
  });
102953
103051
  res.on("end", () => {
102954
- resolve7(Buffer.concat(chunks));
103052
+ resolve8(Buffer.concat(chunks));
102955
103053
  req.destroy();
102956
103054
  });
102957
103055
  });
@@ -103400,7 +103498,7 @@ var retryWrapper = (toRetry, maxRetries, delayMs) => {
103400
103498
  try {
103401
103499
  return await toRetry();
103402
103500
  } catch (e) {
103403
- await new Promise((resolve7) => setTimeout(resolve7, delayMs));
103501
+ await new Promise((resolve8) => setTimeout(resolve8, delayMs));
103404
103502
  }
103405
103503
  }
103406
103504
  return await toRetry();
@@ -113022,8 +113120,8 @@ var require_signin = __commonJS((exports) => {
113022
113120
  // node_modules/.bun/@aws-sdk+credential-provider-login@3.972.51/node_modules/@aws-sdk/credential-provider-login/dist-es/LoginCredentialsFetcher.js
113023
113121
  import { createHash as createHash2, createPrivateKey, createPublicKey, sign } from "crypto";
113024
113122
  import { promises as fs6 } from "fs";
113025
- import { homedir as homedir6 } from "os";
113026
- import { dirname as dirname8, join as join13 } from "path";
113123
+ import { homedir as homedir5 } from "os";
113124
+ import { dirname as dirname8, join as join16 } from "path";
113027
113125
  var import_config22, import_protocols3, LoginCredentialsFetcher;
113028
113126
  var init_LoginCredentialsFetcher = __esm(() => {
113029
113127
  import_config22 = __toESM(require_config(), 1);
@@ -113182,10 +113280,10 @@ var init_LoginCredentialsFetcher = __esm(() => {
113182
113280
  await fs6.writeFile(tokenFilePath, JSON.stringify(token, null, 2), "utf8");
113183
113281
  }
113184
113282
  getTokenFilePath() {
113185
- const directory = process.env.AWS_LOGIN_CACHE_DIRECTORY ?? join13(homedir6(), ".aws", "login", "cache");
113283
+ const directory = process.env.AWS_LOGIN_CACHE_DIRECTORY ?? join16(homedir5(), ".aws", "login", "cache");
113186
113284
  const loginSessionBytes = Buffer.from(this.loginSession, "utf8");
113187
113285
  const loginSessionSha256 = createHash2("sha256").update(loginSessionBytes).digest("hex");
113188
- return join13(directory, `${loginSessionSha256}.json`);
113286
+ return join16(directory, `${loginSessionSha256}.json`);
113189
113287
  }
113190
113288
  derToRawSignature(derSignature) {
113191
113289
  let offset = 2;
@@ -113872,7 +113970,7 @@ function probeProxyReachability(proxyUrl) {
113872
113970
  if (!host || !Number.isInteger(port2) || port2 < 1 || port2 > 65535) {
113873
113971
  return Promise.resolve(false);
113874
113972
  }
113875
- return new Promise((resolve7) => {
113973
+ return new Promise((resolve8) => {
113876
113974
  const socket = connect3({ host, port: port2 });
113877
113975
  let done = false;
113878
113976
  const finish = (reachable) => {
@@ -113880,7 +113978,7 @@ function probeProxyReachability(proxyUrl) {
113880
113978
  return;
113881
113979
  done = true;
113882
113980
  socket.destroy();
113883
- resolve7(reachable);
113981
+ resolve8(reachable);
113884
113982
  };
113885
113983
  socket.setTimeout(PROXY_REACHABILITY_TIMEOUT_MS);
113886
113984
  socket.once("connect", () => finish(true));
@@ -126806,35 +126904,35 @@ class IndexedDbStorage {
126806
126904
  getItem(key) {
126807
126905
  return this.withObjectStore("readonly", (store) => {
126808
126906
  const req = store.get(key);
126809
- return new Promise((resolve7) => {
126810
- req.onerror = () => resolve7(null);
126811
- req.onsuccess = () => resolve7(req.result ? req.result.value : null);
126907
+ return new Promise((resolve8) => {
126908
+ req.onerror = () => resolve8(null);
126909
+ req.onsuccess = () => resolve8(req.result ? req.result.value : null);
126812
126910
  });
126813
126911
  }).catch(() => null);
126814
126912
  }
126815
126913
  removeItem(key) {
126816
126914
  return this.withObjectStore("readwrite", (store) => {
126817
126915
  const req = store.delete(key);
126818
- return new Promise((resolve7, reject) => {
126916
+ return new Promise((resolve8, reject) => {
126819
126917
  req.onerror = () => reject(req.error);
126820
- req.onsuccess = () => resolve7();
126918
+ req.onsuccess = () => resolve8();
126821
126919
  });
126822
126920
  });
126823
126921
  }
126824
126922
  setItem(id, value) {
126825
126923
  return this.withObjectStore("readwrite", (store) => {
126826
126924
  const req = store.put({ id, value });
126827
- return new Promise((resolve7, reject) => {
126925
+ return new Promise((resolve8, reject) => {
126828
126926
  req.onerror = () => reject(req.error);
126829
- req.onsuccess = () => resolve7();
126927
+ req.onsuccess = () => resolve8();
126830
126928
  });
126831
126929
  });
126832
126930
  }
126833
126931
  getDb() {
126834
126932
  const openDbRequest = self.indexedDB.open(this.dbName, 1);
126835
- return new Promise((resolve7, reject) => {
126933
+ return new Promise((resolve8, reject) => {
126836
126934
  openDbRequest.onsuccess = () => {
126837
- resolve7(openDbRequest.result);
126935
+ resolve8(openDbRequest.result);
126838
126936
  };
126839
126937
  openDbRequest.onerror = () => {
126840
126938
  reject(openDbRequest.error);
@@ -126855,9 +126953,9 @@ class IndexedDbStorage {
126855
126953
  return this.getDb().then((db) => {
126856
126954
  const tx = db.transaction(STORE_NAME, mode);
126857
126955
  tx.oncomplete = () => db.close();
126858
- return new Promise((resolve7, reject) => {
126956
+ return new Promise((resolve8, reject) => {
126859
126957
  tx.onerror = () => reject(tx.error);
126860
- resolve7(action(tx.objectStore(STORE_NAME)));
126958
+ resolve8(action(tx.objectStore(STORE_NAME)));
126861
126959
  }).catch((err) => {
126862
126960
  db.close();
126863
126961
  throw err;
@@ -127938,11 +128036,11 @@ var init_macOsKeychainStorage = __esm(() => {
127938
128036
 
127939
128037
  // src/utils/secureStorage/plainTextStorage.ts
127940
128038
  import { chmodSync as chmodSync2 } from "fs";
127941
- import { join as join14 } from "path";
128039
+ import { join as join17 } from "path";
127942
128040
  function getStoragePath() {
127943
128041
  const storageDir = getClaudeConfigHomeDir();
127944
128042
  const storageFileName = ".credentials.json";
127945
- return { storageDir, storagePath: join14(storageDir, storageFileName) };
128043
+ return { storageDir, storagePath: join17(storageDir, storageFileName) };
127946
128044
  }
127947
128045
  var plainTextStorage;
127948
128046
  var init_plainTextStorage = __esm(() => {
@@ -128038,25 +128136,25 @@ var init_keychainPrefetch = __esm(() => {
128038
128136
 
128039
128137
  // src/utils/sleep.ts
128040
128138
  function sleep2(ms, signal, opts) {
128041
- return new Promise((resolve7, reject) => {
128139
+ return new Promise((resolve8, reject) => {
128042
128140
  if (signal?.aborted) {
128043
128141
  if (opts?.throwOnAbort || opts?.abortError) {
128044
128142
  reject(opts.abortError?.() ?? new Error("aborted"));
128045
128143
  } else {
128046
- resolve7();
128144
+ resolve8();
128047
128145
  }
128048
128146
  return;
128049
128147
  }
128050
- const timer = setTimeout((signal2, onAbort2, resolve8) => {
128148
+ const timer = setTimeout((signal2, onAbort2, resolve9) => {
128051
128149
  signal2?.removeEventListener("abort", onAbort2);
128052
- resolve8();
128053
- }, ms, signal, onAbort, resolve7);
128150
+ resolve9();
128151
+ }, ms, signal, onAbort, resolve8);
128054
128152
  function onAbort() {
128055
128153
  clearTimeout(timer);
128056
128154
  if (opts?.throwOnAbort || opts?.abortError) {
128057
128155
  reject(opts.abortError?.() ?? new Error("aborted"));
128058
128156
  } else {
128059
- resolve7();
128157
+ resolve8();
128060
128158
  }
128061
128159
  }
128062
128160
  signal?.addEventListener("abort", onAbort, { once: true });
@@ -128485,8 +128583,8 @@ var require_retry3 = __commonJS((exports) => {
128485
128583
  }
128486
128584
  const delay = getNextRetryDelay(config4);
128487
128585
  err.config.retryConfig.currentRetryAttempt += 1;
128488
- const backoff = config4.retryBackoff ? config4.retryBackoff(err, delay) : new Promise((resolve7) => {
128489
- setTimeout(resolve7, delay);
128586
+ const backoff = config4.retryBackoff ? config4.retryBackoff(err, delay) : new Promise((resolve8) => {
128587
+ setTimeout(resolve8, delay);
128490
128588
  });
128491
128589
  if (config4.onRetryAttempt) {
128492
128590
  await config4.onRetryAttempt(err);
@@ -128614,8 +128712,8 @@ var require_helpers = __commonJS((exports) => {
128614
128712
  function req(url3, opts = {}) {
128615
128713
  const href = typeof url3 === "string" ? url3 : url3.href;
128616
128714
  const req2 = (href.startsWith("https:") ? https2 : http4).request(url3, opts);
128617
- const promise2 = new Promise((resolve7, reject) => {
128618
- req2.once("response", resolve7).once("error", reject).end();
128715
+ const promise2 = new Promise((resolve8, reject) => {
128716
+ req2.once("response", resolve8).once("error", reject).end();
128619
128717
  });
128620
128718
  req2.then = promise2.then.bind(promise2);
128621
128719
  return req2;
@@ -128784,7 +128882,7 @@ var require_parse_proxy_response2 = __commonJS((exports) => {
128784
128882
  var debug_1 = __importDefault(require_src());
128785
128883
  var debug3 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response");
128786
128884
  function parseProxyResponse2(socket) {
128787
- return new Promise((resolve7, reject) => {
128885
+ return new Promise((resolve8, reject) => {
128788
128886
  let buffersLength = 0;
128789
128887
  const buffers = [];
128790
128888
  function read() {
@@ -128853,7 +128951,7 @@ var require_parse_proxy_response2 = __commonJS((exports) => {
128853
128951
  }
128854
128952
  debug3("got proxy server response: %o %o", firstLine, headers);
128855
128953
  cleanup();
128856
- resolve7({
128954
+ resolve8({
128857
128955
  connect: {
128858
128956
  statusCode,
128859
128957
  statusText,
@@ -132439,7 +132537,7 @@ var require_util2 = __commonJS((exports) => {
132439
132537
  exports.isValidFile = isValidFile;
132440
132538
  exports.getWellKnownCertificateConfigFileLocation = getWellKnownCertificateConfigFileLocation;
132441
132539
  var fs7 = __require("fs");
132442
- var os5 = __require("os");
132540
+ var os4 = __require("os");
132443
132541
  var path13 = __require("path");
132444
132542
  var WELL_KNOWN_CERTIFICATE_CONFIG_FILE = "certificate_config.json";
132445
132543
  var CLOUDSDK_CONFIG_DIRECTORY = "gcloud";
@@ -132512,7 +132610,7 @@ var require_util2 = __commonJS((exports) => {
132512
132610
  return path13.join(configDir, WELL_KNOWN_CERTIFICATE_CONFIG_FILE);
132513
132611
  }
132514
132612
  function _isWindows() {
132515
- return os5.platform().startsWith("win");
132613
+ return os4.platform().startsWith("win");
132516
132614
  }
132517
132615
  });
132518
132616
 
@@ -134567,7 +134665,7 @@ var require_jwtaccess = __commonJS((exports) => {
134567
134665
  }
134568
134666
  }
134569
134667
  fromStreamAsync(inputStream) {
134570
- return new Promise((resolve7, reject) => {
134668
+ return new Promise((resolve8, reject) => {
134571
134669
  if (!inputStream) {
134572
134670
  reject(new Error("Must pass in a stream containing the service account auth settings."));
134573
134671
  }
@@ -134576,7 +134674,7 @@ var require_jwtaccess = __commonJS((exports) => {
134576
134674
  try {
134577
134675
  const data = JSON.parse(s);
134578
134676
  this.fromJSON(data);
134579
- resolve7();
134677
+ resolve8();
134580
134678
  } catch (err) {
134581
134679
  reject(err);
134582
134680
  }
@@ -134763,7 +134861,7 @@ var require_jwtclient = __commonJS((exports) => {
134763
134861
  }
134764
134862
  }
134765
134863
  fromStreamAsync(inputStream) {
134766
- return new Promise((resolve7, reject) => {
134864
+ return new Promise((resolve8, reject) => {
134767
134865
  if (!inputStream) {
134768
134866
  throw new Error("Must pass in a stream containing the service account auth settings.");
134769
134867
  }
@@ -134772,7 +134870,7 @@ var require_jwtclient = __commonJS((exports) => {
134772
134870
  try {
134773
134871
  const data = JSON.parse(s);
134774
134872
  this.fromJSON(data);
134775
- resolve7();
134873
+ resolve8();
134776
134874
  } catch (e5) {
134777
134875
  reject(e5);
134778
134876
  }
@@ -134873,7 +134971,7 @@ var require_refreshclient = __commonJS((exports) => {
134873
134971
  }
134874
134972
  }
134875
134973
  async fromStreamAsync(inputStream) {
134876
- return new Promise((resolve7, reject) => {
134974
+ return new Promise((resolve8, reject) => {
134877
134975
  if (!inputStream) {
134878
134976
  return reject(new Error("Must pass in a stream containing the user refresh token."));
134879
134977
  }
@@ -134882,7 +134980,7 @@ var require_refreshclient = __commonJS((exports) => {
134882
134980
  try {
134883
134981
  const data = JSON.parse(s);
134884
134982
  this.fromJSON(data);
134885
- return resolve7();
134983
+ return resolve8();
134886
134984
  } catch (err) {
134887
134985
  return reject(err);
134888
134986
  }
@@ -135465,7 +135563,7 @@ var require_filesubjecttokensupplier = __commonJS((exports) => {
135465
135563
  var util_1 = __require("util");
135466
135564
  var fs7 = __require("fs");
135467
135565
  var readFile4 = (0, util_1.promisify)(fs7.readFile ?? (() => {}));
135468
- var realpath = (0, util_1.promisify)(fs7.realpath ?? (() => {}));
135566
+ var realpath2 = (0, util_1.promisify)(fs7.realpath ?? (() => {}));
135469
135567
  var lstat = (0, util_1.promisify)(fs7.lstat ?? (() => {}));
135470
135568
 
135471
135569
  class FileSubjectTokenSupplier {
@@ -135480,7 +135578,7 @@ var require_filesubjecttokensupplier = __commonJS((exports) => {
135480
135578
  async getSubjectToken() {
135481
135579
  let parsedFilePath = this.filePath;
135482
135580
  try {
135483
- parsedFilePath = await realpath(parsedFilePath);
135581
+ parsedFilePath = await realpath2(parsedFilePath);
135484
135582
  if (!(await lstat(parsedFilePath)).isFile()) {
135485
135583
  throw new Error;
135486
135584
  }
@@ -136246,7 +136344,7 @@ var require_pluggable_auth_handler = __commonJS((exports) => {
136246
136344
  this.outputFile = options.outputFile;
136247
136345
  }
136248
136346
  retrieveResponseFromExecutable(envMap) {
136249
- return new Promise((resolve7, reject) => {
136347
+ return new Promise((resolve8, reject) => {
136250
136348
  const child = childProcess.spawn(this.commandComponents[0], this.commandComponents.slice(1), {
136251
136349
  env: { ...process.env, ...Object.fromEntries(envMap) }
136252
136350
  });
@@ -136268,7 +136366,7 @@ var require_pluggable_auth_handler = __commonJS((exports) => {
136268
136366
  try {
136269
136367
  const responseJson = JSON.parse(output);
136270
136368
  const response = new executable_response_1.ExecutableResponse(responseJson);
136271
- return resolve7(response);
136369
+ return resolve8(response);
136272
136370
  } catch (error52) {
136273
136371
  if (error52 instanceof executable_response_1.ExecutableResponseError) {
136274
136372
  return reject(error52);
@@ -136879,7 +136977,7 @@ var require_googleauth = __commonJS((exports) => {
136879
136977
  var fs7 = __require("fs");
136880
136978
  var gaxios_1 = require_src3();
136881
136979
  var gcpMetadata = require_src5();
136882
- var os5 = __require("os");
136980
+ var os4 = __require("os");
136883
136981
  var path13 = __require("path");
136884
136982
  var crypto_1 = require_crypto3();
136885
136983
  var computeclient_1 = require_computeclient();
@@ -137204,7 +137302,7 @@ var require_googleauth = __commonJS((exports) => {
137204
137302
  }
137205
137303
  }
137206
137304
  fromStreamAsync(inputStream, options) {
137207
- return new Promise((resolve7, reject) => {
137305
+ return new Promise((resolve8, reject) => {
137208
137306
  if (!inputStream) {
137209
137307
  throw new Error("Must pass in a stream containing the Google auth settings.");
137210
137308
  }
@@ -137214,7 +137312,7 @@ var require_googleauth = __commonJS((exports) => {
137214
137312
  try {
137215
137313
  const data = JSON.parse(chunks.join(""));
137216
137314
  const r5 = this._cacheClientFromJSON(data, options);
137217
- return resolve7(r5);
137315
+ return resolve8(r5);
137218
137316
  } catch (err) {
137219
137317
  if (!this.keyFilename)
137220
137318
  throw err;
@@ -137224,7 +137322,7 @@ var require_googleauth = __commonJS((exports) => {
137224
137322
  });
137225
137323
  this.cachedCredential = client3;
137226
137324
  this.setGapicJWTValues(client3);
137227
- return resolve7(client3);
137325
+ return resolve8(client3);
137228
137326
  }
137229
137327
  } catch (err) {
137230
137328
  return reject(err);
@@ -137236,7 +137334,7 @@ var require_googleauth = __commonJS((exports) => {
137236
137334
  return new jwtclient_1.JWT({ ...options, apiKey });
137237
137335
  }
137238
137336
  _isWindows() {
137239
- const sys = os5.platform();
137337
+ const sys = os4.platform();
137240
137338
  if (sys && sys.length >= 3) {
137241
137339
  if (sys.substring(0, 3).toLowerCase() === "win") {
137242
137340
  return true;
@@ -137245,16 +137343,16 @@ var require_googleauth = __commonJS((exports) => {
137245
137343
  return false;
137246
137344
  }
137247
137345
  async getDefaultServiceProjectId() {
137248
- return new Promise((resolve7) => {
137346
+ return new Promise((resolve8) => {
137249
137347
  (0, child_process_1.exec)("gcloud config config-helper --format json", (err, stdout) => {
137250
137348
  if (!err && stdout) {
137251
137349
  try {
137252
137350
  const projectId = JSON.parse(stdout).configuration.properties.core.project;
137253
- resolve7(projectId);
137351
+ resolve8(projectId);
137254
137352
  return;
137255
137353
  } catch (e5) {}
137256
137354
  }
137257
- resolve7(null);
137355
+ resolve8(null);
137258
137356
  });
137259
137357
  });
137260
137358
  }
@@ -137926,7 +138024,7 @@ function refreshAwsAuth(awsAuthRefresh) {
137926
138024
  logForDebugging("Running AWS auth refresh command");
137927
138025
  const authStatusManager = AwsAuthStatusManager.getInstance();
137928
138026
  authStatusManager.startAuthentication();
137929
- return new Promise((resolve7) => {
138027
+ return new Promise((resolve8) => {
137930
138028
  const refreshProc = exec3(awsAuthRefresh, {
137931
138029
  timeout: AWS_AUTH_REFRESH_TIMEOUT_MS
137932
138030
  });
@@ -137948,13 +138046,13 @@ function refreshAwsAuth(awsAuthRefresh) {
137948
138046
  if (code === 0) {
137949
138047
  logForDebugging("AWS auth refresh completed successfully");
137950
138048
  authStatusManager.endAuthentication(true);
137951
- resolve7(true);
138049
+ resolve8(true);
137952
138050
  } else {
137953
138051
  const timedOut = signal === "SIGTERM";
137954
138052
  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):");
137955
138053
  console.error(message);
137956
138054
  authStatusManager.endAuthentication(false);
137957
- resolve7(false);
138055
+ resolve8(false);
137958
138056
  }
137959
138057
  });
137960
138058
  });
@@ -138069,7 +138167,7 @@ function refreshGcpAuth(gcpAuthRefresh) {
138069
138167
  logForDebugging("Running GCP auth refresh command");
138070
138168
  const authStatusManager = AwsAuthStatusManager.getInstance();
138071
138169
  authStatusManager.startAuthentication();
138072
- return new Promise((resolve7) => {
138170
+ return new Promise((resolve8) => {
138073
138171
  const refreshProc = exec3(gcpAuthRefresh, {
138074
138172
  timeout: GCP_AUTH_REFRESH_TIMEOUT_MS
138075
138173
  });
@@ -138091,13 +138189,13 @@ function refreshGcpAuth(gcpAuthRefresh) {
138091
138189
  if (code === 0) {
138092
138190
  logForDebugging("GCP auth refresh completed successfully");
138093
138191
  authStatusManager.endAuthentication(true);
138094
- resolve7(true);
138192
+ resolve8(true);
138095
138193
  } else {
138096
138194
  const timedOut = signal === "SIGTERM";
138097
138195
  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):");
138098
138196
  console.error(message);
138099
138197
  authStatusManager.endAuthentication(false);
138100
- resolve7(false);
138198
+ resolve8(false);
138101
138199
  }
138102
138200
  });
138103
138201
  });
@@ -138345,7 +138443,7 @@ var init_user = __esm(() => {
138345
138443
  deviceId,
138346
138444
  sessionId: getSessionId(),
138347
138445
  email: getEmail(),
138348
- appVersion: "4.2.13",
138446
+ appVersion: "4.2.15",
138349
138447
  platform: getHostPlatformForAnalytics(),
138350
138448
  organizationUuid,
138351
138449
  accountUuid,
@@ -138436,7 +138534,7 @@ var init_genericProcessUtils = __esm(() => {
138436
138534
  });
138437
138535
 
138438
138536
  // src/utils/envDynamic.ts
138439
- import { stat as stat3 } from "fs/promises";
138537
+ import { stat as stat5 } from "fs/promises";
138440
138538
  function getIsBubblewrapSandbox() {
138441
138539
  return process.platform === "linux" && isEnvTruthy(process.env.CLAUDE_CODE_BUBBLEWRAP);
138442
138540
  }
@@ -138512,7 +138610,7 @@ var init_envDynamic = __esm(() => {
138512
138610
  });
138513
138611
  if (process.platform === "linux") {
138514
138612
  const muslArch = process.arch === "x64" ? "x86_64" : "aarch64";
138515
- stat3(`/lib/libc.musl-${muslArch}.so.1`).then(() => {
138613
+ stat5(`/lib/libc.musl-${muslArch}.so.1`).then(() => {
138516
138614
  muslRuntimeCache = true;
138517
138615
  }, () => {
138518
138616
  muslRuntimeCache = false;
@@ -138632,7 +138730,7 @@ var init_metadata = __esm(() => {
138632
138730
  "sed"
138633
138731
  ]);
138634
138732
  getVersionBase = memoize_default(() => {
138635
- const match = "4.2.13".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
138733
+ const match = "4.2.15".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
138636
138734
  return match ? match[0] : undefined;
138637
138735
  });
138638
138736
  buildEnvContext = memoize_default(async () => {
@@ -138672,9 +138770,9 @@ var init_metadata = __esm(() => {
138672
138770
  isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
138673
138771
  isClaudeCodeAction: isEnvTruthy(process.env.CLAUDE_CODE_ACTION),
138674
138772
  isClaudeAiAuth: isClaudeAISubscriber(),
138675
- version: "4.2.13",
138773
+ version: "4.2.15",
138676
138774
  versionBase: getVersionBase(),
138677
- buildTime: "2026-07-14T13:52:36.818Z",
138775
+ buildTime: "2026-07-17T11:35:24.701Z",
138678
138776
  deploymentEnvironment: env4.detectDeploymentEnvironment(),
138679
138777
  ...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
138680
138778
  githubEventName: process.env.GITHUB_EVENT_NAME,
@@ -139229,8 +139327,8 @@ var init_growthbook = __esm(() => {
139229
139327
  });
139230
139328
 
139231
139329
  // src/memdir/paths.ts
139232
- import { homedir as homedir7 } from "os";
139233
- import { isAbsolute as isAbsolute3, join as join15, normalize as normalize3, sep as sep4 } from "path";
139330
+ import { homedir as homedir6 } from "os";
139331
+ import { isAbsolute as isAbsolute3, join as join18, normalize as normalize3, sep as sep4 } from "path";
139234
139332
  function getMemoryBaseDir() {
139235
139333
  const remoteMemoryDir = getCostrictEnv("REMOTE_MEMORY_DIR");
139236
139334
  if (remoteMemoryDir) {
@@ -139249,7 +139347,7 @@ function validateMemoryPath(raw, expandTilde) {
139249
139347
  if (restNorm === "." || restNorm === "..") {
139250
139348
  return;
139251
139349
  }
139252
- candidate = join15(homedir7(), rest);
139350
+ candidate = join18(homedir6(), rest);
139253
139351
  }
139254
139352
  const normalized = normalize3(candidate).replace(/[/\\]+$/u, "");
139255
139353
  if (!isAbsolute3(normalized) || normalized.length < 3 || /^[A-Za-z]:$/.test(normalized) || normalized.startsWith("\\\\") || normalized.startsWith("//") || normalized.includes("\x00")) {
@@ -139281,8 +139379,8 @@ var init_paths = __esm(() => {
139281
139379
  if (override) {
139282
139380
  return override;
139283
139381
  }
139284
- const projectsDir = join15(getMemoryBaseDir(), "projects");
139285
- return (join15(projectsDir, sanitizePath(getAutoMemBase()), AUTO_MEM_DIRNAME) + sep4).normalize("NFC");
139382
+ const projectsDir = join18(getMemoryBaseDir(), "projects");
139383
+ return (join18(projectsDir, sanitizePath(getAutoMemBase()), AUTO_MEM_DIRNAME) + sep4).normalize("NFC");
139286
139384
  }, () => getProjectRoot());
139287
139385
  });
139288
139386
 
@@ -139299,7 +139397,7 @@ var init_configConstants = () => {};
139299
139397
  // src/utils/config.ts
139300
139398
  import { randomBytes } from "crypto";
139301
139399
  import { unwatchFile as unwatchFile2, watchFile as watchFile2 } from "fs";
139302
- import { basename as basename3, dirname as dirname9, join as join16, resolve as resolve7 } from "path";
139400
+ import { basename as basename3, dirname as dirname9, join as join19, resolve as resolve8 } from "path";
139303
139401
  function createDefaultGlobalConfig() {
139304
139402
  return {
139305
139403
  numStartups: 0,
@@ -139364,7 +139462,7 @@ function computeTrustDialogAccepted() {
139364
139462
  if (pathConfig?.hasTrustDialogAccepted) {
139365
139463
  return true;
139366
139464
  }
139367
- const parentPath = normalizePathForConfigKey(resolve7(currentPath, ".."));
139465
+ const parentPath = normalizePathForConfigKey(resolve8(currentPath, ".."));
139368
139466
  if (parentPath === currentPath) {
139369
139467
  break;
139370
139468
  }
@@ -139652,14 +139750,14 @@ function saveConfigWithLock(file2, createDefault, mergeFn, readCurrent) {
139652
139750
  const mostRecentTimestamp = mostRecentBackup ? Number(mostRecentBackup.split(".backup.").pop()) : 0;
139653
139751
  const shouldCreateBackup = Number.isNaN(mostRecentTimestamp) || Date.now() - mostRecentTimestamp >= MIN_BACKUP_INTERVAL_MS;
139654
139752
  if (shouldCreateBackup) {
139655
- const backupPath = join16(backupDir, `${fileBase}.backup.${Date.now()}`);
139753
+ const backupPath = join19(backupDir, `${fileBase}.backup.${Date.now()}`);
139656
139754
  fs7.copyFileSync(file2, backupPath);
139657
139755
  }
139658
139756
  const MAX_BACKUPS = 5;
139659
139757
  const backupsForCleanup = shouldCreateBackup ? fs7.readdirStringSync(backupDir).filter((f5) => f5.startsWith(`${fileBase}.backup.`)).sort().reverse() : existingBackups;
139660
139758
  for (const oldBackup of backupsForCleanup.slice(MAX_BACKUPS)) {
139661
139759
  try {
139662
- fs7.unlinkSync(join16(backupDir, oldBackup));
139760
+ fs7.unlinkSync(join19(backupDir, oldBackup));
139663
139761
  } catch {}
139664
139762
  }
139665
139763
  } catch (e5) {
@@ -139685,7 +139783,7 @@ function saveConfigWithLock(file2, createDefault, mergeFn, readCurrent) {
139685
139783
  }
139686
139784
  }
139687
139785
  function getConfigBackupDir() {
139688
- return join16(getClaudeConfigHomeDir(), "backups");
139786
+ return join19(getClaudeConfigHomeDir(), "backups");
139689
139787
  }
139690
139788
  function findMostRecentBackup(file2) {
139691
139789
  const fs7 = getFsImplementation();
@@ -139694,7 +139792,7 @@ function findMostRecentBackup(file2) {
139694
139792
  const backupDirs = [primaryBackupDir];
139695
139793
  const legacyHome = getLegacyConfigHomeDir();
139696
139794
  if (legacyHome) {
139697
- const legacyBackupDir = join16(legacyHome, "backups");
139795
+ const legacyBackupDir = join19(legacyHome, "backups");
139698
139796
  if (legacyBackupDir !== primaryBackupDir) {
139699
139797
  backupDirs.push(legacyBackupDir);
139700
139798
  }
@@ -139704,7 +139802,7 @@ function findMostRecentBackup(file2) {
139704
139802
  const backups = fs7.readdirStringSync(backupDir).filter((f5) => f5.startsWith(`${fileBase}.backup.`)).sort();
139705
139803
  const mostRecent = backups.at(-1);
139706
139804
  if (mostRecent) {
139707
- return join16(backupDir, mostRecent);
139805
+ return join19(backupDir, mostRecent);
139708
139806
  }
139709
139807
  } catch {}
139710
139808
  }
@@ -139713,7 +139811,7 @@ function findMostRecentBackup(file2) {
139713
139811
  const backups = fs7.readdirStringSync(fileDir).filter((f5) => f5.startsWith(`${fileBase}.backup.`)).sort();
139714
139812
  const mostRecent = backups.at(-1);
139715
139813
  if (mostRecent) {
139716
- return join16(fileDir, mostRecent);
139814
+ return join19(fileDir, mostRecent);
139717
139815
  }
139718
139816
  const legacyBackup = `${file2}.backup`;
139719
139817
  try {
@@ -139796,7 +139894,7 @@ Claude configuration file at ${file2} is corrupted: ${error52.message}
139796
139894
  const currentContent = fs7.readFileSync(file2, { encoding: "utf-8" });
139797
139895
  for (const backup of existingCorruptedBackups) {
139798
139896
  try {
139799
- const backupContent = fs7.readFileSync(join16(corruptedBackupDir, backup), { encoding: "utf-8" });
139897
+ const backupContent = fs7.readFileSync(join19(corruptedBackupDir, backup), { encoding: "utf-8" });
139800
139898
  if (currentContent === backupContent) {
139801
139899
  alreadyBackedUp = true;
139802
139900
  break;
@@ -139804,7 +139902,7 @@ Claude configuration file at ${file2} is corrupted: ${error52.message}
139804
139902
  } catch {}
139805
139903
  }
139806
139904
  if (!alreadyBackedUp) {
139807
- corruptedBackupPath = join16(corruptedBackupDir, `${fileBase}.corrupted.${Date.now()}`);
139905
+ corruptedBackupPath = join19(corruptedBackupDir, `${fileBase}.corrupted.${Date.now()}`);
139808
139906
  try {
139809
139907
  fs7.copyFileSync(file2, corruptedBackupPath);
139810
139908
  logForDebugging(`Corrupted config backed up to: ${corruptedBackupPath}`, {
@@ -139899,7 +139997,7 @@ var init_config2 = __esm(() => {
139899
139997
  if (gitRoot) {
139900
139998
  return normalizePathForConfigKey(gitRoot);
139901
139999
  }
139902
- return normalizePathForConfigKey(resolve7(originalCwd));
140000
+ return normalizePathForConfigKey(resolve8(originalCwd));
139903
140001
  });
139904
140002
  });
139905
140003
 
@@ -140083,39 +140181,60 @@ import { appendFileSync } from "fs";
140083
140181
  import path2 from "path";
140084
140182
 
140085
140183
  // src/services/rawDump/dirs.ts
140184
+ init_memoize();
140185
+ init_envUtils();
140186
+ init_sessionStoragePortable();
140086
140187
  import fs from "fs";
140087
- import os from "os";
140188
+ import { stat as stat2 } from "fs/promises";
140088
140189
  import path from "path";
140089
- function getCscDir() {
140090
- const candidates = [
140091
- process.env.COSTRICT_CONFIG_DIR || "",
140092
- path.join(os.homedir(), ".costrict"),
140093
- process.env.CLAUDE_CONFIG_DIR || "",
140094
- path.join(os.homedir(), ".claude")
140095
- ];
140096
- const exists = (d) => d && fs.existsSync(path.join(d, "history.jsonl"));
140097
- return candidates.find(exists) || path.join(os.homedir(), ".costrict");
140098
- }
140099
- function getRawDumpDir() {
140100
- return path.join(getCscDir(), "raw-dump");
140101
- }
140102
- function normalizeProjectPath(dir) {
140103
- return dir.replace(/:/gu, "-").replace(/[/\\]/gu, "-");
140190
+ var getRawDumpDir = memoize_default(() => {
140191
+ const primary = path.join(getCostrictConfigHomeDir(), "raw-dump");
140192
+ if (!hasState(primary)) {
140193
+ const legacyHome = getLegacyConfigHomeDir();
140194
+ if (legacyHome) {
140195
+ const legacyDir = path.join(legacyHome, "raw-dump");
140196
+ if (hasState(legacyDir))
140197
+ return legacyDir;
140198
+ }
140199
+ }
140200
+ return primary;
140201
+ }, () => process.env.COSTRICT_CONFIG_DIR ?? process.env.CLAUDE_CONFIG_DIR);
140202
+ function hasState(dir) {
140203
+ try {
140204
+ return fs.readdirSync(dir).length > 0;
140205
+ } catch {
140206
+ return false;
140207
+ }
140104
140208
  }
140105
- function getSessionDirectory(directory) {
140106
- const claudeHome = getCscDir();
140107
- const projectPath = normalizeProjectPath(directory);
140108
- const candidates = [
140109
- path.join(claudeHome, "projects", projectPath),
140110
- path.join(claudeHome, "transcripts"),
140111
- path.join(claudeHome, "sessions"),
140112
- path.join(directory, ".claude", "sessions"),
140113
- path.join(directory, ".claude"),
140114
- directory,
140115
- process.env.CSC_SESSION_DIR || ""
140116
- ];
140117
- const exists = (d) => d && fs.existsSync(d);
140118
- return candidates.find(exists) || directory;
140209
+ async function resolveTranscriptPath(directory, sessionId, preferredPath) {
140210
+ const fileName = `${sessionId}.jsonl`;
140211
+ if (preferredPath && path.basename(preferredPath) === fileName) {
140212
+ try {
140213
+ const canonicalPreferred = await canonicalizePath(preferredPath);
140214
+ const s = await stat2(canonicalPreferred);
140215
+ if (s.size > 0)
140216
+ return canonicalPreferred;
140217
+ } catch {}
140218
+ }
140219
+ const canonicalDirectory = await canonicalizePath(directory);
140220
+ const projectsDir = await canonicalizePath(path.join(getCostrictConfigHomeDir(), "projects"));
140221
+ const relativeToProjects = path.relative(projectsDir, canonicalDirectory);
140222
+ const isTranscriptStorageDir = relativeToProjects !== "" && relativeToProjects !== ".." && !relativeToProjects.startsWith(`..${path.sep}`) && !path.isAbsolute(relativeToProjects);
140223
+ if (isTranscriptStorageDir) {
140224
+ const direct = path.join(canonicalDirectory, fileName);
140225
+ try {
140226
+ const s = await stat2(direct);
140227
+ if (s.size > 0)
140228
+ return direct;
140229
+ } catch {}
140230
+ }
140231
+ const viaProject = path.join(getProjectDir(canonicalDirectory), fileName);
140232
+ try {
140233
+ const s = await stat2(viaProject);
140234
+ if (s.size > 0)
140235
+ return viaProject;
140236
+ } catch {}
140237
+ return;
140119
140238
  }
140120
140239
 
140121
140240
  // src/services/rawDump/logger.ts
@@ -140503,6 +140622,9 @@ function addQueueTasks(tasks) {
140503
140622
  if (existing) {
140504
140623
  if (task.enqueuedAt > existing.enqueuedAt) {
140505
140624
  existing.enqueuedAt = task.enqueuedAt;
140625
+ if (task.transcriptPath) {
140626
+ existing.transcriptPath = task.transcriptPath;
140627
+ }
140506
140628
  }
140507
140629
  } else {
140508
140630
  state_task.tasks[key] = {
@@ -140510,6 +140632,7 @@ function addQueueTasks(tasks) {
140510
140632
  uploadedAt: "",
140511
140633
  attemptCount: 0,
140512
140634
  directory: task.directory,
140635
+ transcriptPath: task.transcriptPath,
140513
140636
  sessionId: task.sessionId,
140514
140637
  messageId: task.messageId,
140515
140638
  historyNo: undefined
@@ -140534,8 +140657,8 @@ init_credentials();
140534
140657
  init_token();
140535
140658
  import { promises as fs12 } from "fs";
140536
140659
  import { createHash as createHash4 } from "crypto";
140537
- import os5 from "os";
140538
- import path20 from "path";
140660
+ import os4 from "os";
140661
+ import path19 from "path";
140539
140662
 
140540
140663
  // src/costrict/provider/tokenManager.ts
140541
140664
  init_credentials();
@@ -140865,7 +140988,7 @@ function getRawDumpMode() {
140865
140988
  return 3;
140866
140989
  return 1;
140867
140990
  }
140868
- function normalizeProjectPath2(dir) {
140991
+ function normalizeProjectPath(dir) {
140869
140992
  return dir.replace(/:/gu, "-").replace(/[/\\]/gu, "-");
140870
140993
  }
140871
140994
  function getDateFromTimestamp(ts) {
@@ -140898,7 +141021,7 @@ async function writeLocalDump(type, body) {
140898
141021
  endpoint = "/raw-store/task-conversation";
140899
141022
  } else if (type == "commit") {
140900
141023
  ymd = getDateFromTimestamp(getTimestampField("commit", body));
140901
- subdir = path15.join(normalizeProjectPath2(body.repo_addr), normalizeProjectPath2(body.repo_branch), ymd);
141024
+ subdir = path15.join(normalizeProjectPath(body.repo_addr), normalizeProjectPath(body.repo_branch), ymd);
140902
141025
  fname = body.commit_id;
140903
141026
  endpoint = "/raw-store/commit";
140904
141027
  } else if (type == "statistics") {
@@ -140910,7 +141033,7 @@ async function writeLocalDump(type, body) {
140910
141033
  fname = `${h6}-${m3}-${s}`;
140911
141034
  endpoint = "/raw-store/statistics";
140912
141035
  } else if (type == "raw") {
140913
- subdir = path15.join(normalizeProjectPath2(body.project), body.session_id);
141036
+ subdir = path15.join(normalizeProjectPath(body.project), body.session_id);
140914
141037
  fname = String(body.start_cursor);
140915
141038
  endpoint = "/raw-store/raw-log";
140916
141039
  } else {
@@ -140939,12 +141062,24 @@ import { promises as fs9 } from "fs";
140939
141062
  import path17 from "path";
140940
141063
 
140941
141064
  // src/services/rawDump/lock.ts
141065
+ import { randomUUID as randomUUID4 } from "crypto";
140942
141066
  import { promises as fs8 } from "fs";
140943
141067
  import path16 from "path";
140944
141068
  var LOCK_INFO_FILE = "lock.json";
141069
+ var PUBLICATION_GRACE_MS = 5000;
140945
141070
  async function isHolderAlive(lockDir) {
141071
+ let text;
141072
+ try {
141073
+ text = await fs8.readFile(path16.join(lockDir, LOCK_INFO_FILE), "utf-8");
141074
+ } catch {
141075
+ try {
141076
+ const st = await fs8.stat(lockDir);
141077
+ return Date.now() - st.mtimeMs < PUBLICATION_GRACE_MS;
141078
+ } catch {
141079
+ return false;
141080
+ }
141081
+ }
140946
141082
  try {
140947
- const text = await fs8.readFile(path16.join(lockDir, LOCK_INFO_FILE), "utf-8");
140948
141083
  const info = JSON.parse(text);
140949
141084
  if (!info.pid || typeof info.pid !== "number")
140950
141085
  return false;
@@ -140958,7 +141093,49 @@ async function isHolderAlive(lockDir) {
140958
141093
  return false;
140959
141094
  }
140960
141095
  }
141096
+ var RECLAIM_MUTEX_STALE_MS = 30000;
141097
+ var RECLAIM_LEASE_MS = RECLAIM_MUTEX_STALE_MS / 2;
141098
+ async function acquireReclaimMutex(mutexDir) {
141099
+ for (let attempt = 0;attempt < 2; attempt++) {
141100
+ try {
141101
+ await fs8.mkdir(mutexDir, { recursive: false });
141102
+ return true;
141103
+ } catch {
141104
+ try {
141105
+ const st = await fs8.stat(mutexDir);
141106
+ if (Date.now() - st.mtimeMs < RECLAIM_MUTEX_STALE_MS)
141107
+ return false;
141108
+ await fs8.rm(mutexDir, { recursive: true, force: true });
141109
+ } catch {}
141110
+ }
141111
+ }
141112
+ return false;
141113
+ }
141114
+ async function reclaimStaleLock(lockDir) {
141115
+ const mutexDir = `${lockDir}.reclaim.d`;
141116
+ if (!await acquireReclaimMutex(mutexDir)) {
141117
+ return false;
141118
+ }
141119
+ const leaseStart = Date.now();
141120
+ const withinLease = () => Date.now() - leaseStart < RECLAIM_LEASE_MS;
141121
+ try {
141122
+ if (await isHolderAlive(lockDir))
141123
+ return false;
141124
+ if (!withinLease())
141125
+ return false;
141126
+ await fs8.rm(lockDir, { recursive: true, force: true });
141127
+ return true;
141128
+ } catch {
141129
+ return false;
141130
+ } finally {
141131
+ if (withinLease()) {
141132
+ await fs8.rm(mutexDir, { recursive: true, force: true }).catch(() => {});
141133
+ }
141134
+ }
141135
+ }
140961
141136
  async function acquireLock(lockDir, info) {
141137
+ const token = info.token ?? randomUUID4();
141138
+ const payload = JSON.stringify({ ...info, token });
140962
141139
  let retried = false;
140963
141140
  while (true) {
140964
141141
  try {
@@ -140966,46 +141143,63 @@ async function acquireLock(lockDir, info) {
140966
141143
  } catch (err) {
140967
141144
  if (err.code === "EEXIST") {
140968
141145
  if (retried)
140969
- return false;
140970
- const alive = await isHolderAlive(lockDir);
140971
- if (alive)
140972
- return false;
140973
- try {
140974
- await fs8.rm(lockDir, { recursive: true, force: true });
140975
- } catch {
140976
- return false;
140977
- }
141146
+ return null;
141147
+ if (await isHolderAlive(lockDir))
141148
+ return null;
141149
+ if (!await reclaimStaleLock(lockDir))
141150
+ return null;
140978
141151
  retried = true;
140979
141152
  continue;
140980
141153
  }
140981
- return false;
141154
+ return null;
140982
141155
  }
140983
141156
  try {
140984
- await fs8.writeFile(path16.join(lockDir, LOCK_INFO_FILE), JSON.stringify(info), "utf-8");
140985
- return true;
141157
+ await fs8.writeFile(path16.join(lockDir, LOCK_INFO_FILE), payload, "utf-8");
140986
141158
  } catch {
140987
- await releaseLock(lockDir);
140988
- return false;
141159
+ await releaseLock(lockDir, token);
141160
+ return null;
140989
141161
  }
141162
+ try {
141163
+ const current = JSON.parse(await fs8.readFile(path16.join(lockDir, LOCK_INFO_FILE), "utf-8"));
141164
+ if (current.token === token && current.pid === info.pid)
141165
+ return token;
141166
+ } catch {}
141167
+ return null;
140990
141168
  }
140991
141169
  }
140992
- async function releaseLock(lockDir) {
141170
+ async function releaseLock(lockDir, token) {
140993
141171
  try {
141172
+ const text = await fs8.readFile(path16.join(lockDir, LOCK_INFO_FILE), "utf-8").catch(() => null);
141173
+ if (text !== null) {
141174
+ try {
141175
+ const info = JSON.parse(text);
141176
+ if (token && info.token && info.token !== token) {
141177
+ return;
141178
+ }
141179
+ if (!token && info.pid && typeof info.pid === "number" && info.pid !== process.pid) {
141180
+ return;
141181
+ }
141182
+ } catch {}
141183
+ }
140994
141184
  await fs8.rm(lockDir, { recursive: true, force: true });
140995
141185
  } catch {}
140996
141186
  }
140997
141187
 
140998
141188
  // src/services/rawDump/queue.ts
140999
- var QUEUE_FILE = path17.join(getRawDumpDir(), "csc-work-queue.jsonl");
141000
- var QUEUE_LOCK_DIR = path17.join(getRawDumpDir(), "csc-work-queue.lock.d");
141189
+ function getQueueFile() {
141190
+ return path17.join(getRawDumpDir(), "csc-work-queue.jsonl");
141191
+ }
141192
+ function getQueueLockDir() {
141193
+ return path17.join(getRawDumpDir(), "csc-work-queue.lock.d");
141194
+ }
141001
141195
  var MAX_ATTEMPTS = 4;
141002
141196
  var queue = [];
141003
141197
  var queueLoaded = false;
141004
- async function loadQueue() {
141005
- if (queueLoaded)
141198
+ async function loadQueue(force = false) {
141199
+ if (queueLoaded && !force)
141006
141200
  return;
141007
141201
  try {
141008
- const text = await fs9.readFile(QUEUE_FILE, "utf-8");
141202
+ const text = await fs9.readFile(getQueueFile(), "utf-8");
141009
141203
  queue = text.split(`
141010
141204
  `).filter(Boolean).map((line) => {
141011
141205
  try {
@@ -141014,32 +141208,43 @@ async function loadQueue() {
141014
141208
  return null;
141015
141209
  }
141016
141210
  }).filter((t2) => t2 !== null);
141017
- } catch {
141211
+ } catch (err) {
141212
+ if (err.code !== "ENOENT")
141213
+ throw err;
141018
141214
  queue = [];
141019
141215
  }
141020
141216
  queueLoaded = true;
141021
141217
  }
141022
- function clearQueue() {
141218
+ async function clearQueue() {
141023
141219
  queue = [];
141024
- fs9.writeFile(QUEUE_FILE, "", "utf-8").catch(() => {});
141220
+ await fs9.writeFile(getQueueFile(), "", "utf-8");
141025
141221
  }
141026
141222
  function getQueue() {
141027
141223
  return [...queue];
141028
141224
  }
141225
+ var queueLockToken = null;
141029
141226
  async function acquireQueueLock() {
141030
- return acquireLock(QUEUE_LOCK_DIR, {
141227
+ const token = await acquireLock(getQueueLockDir(), {
141031
141228
  pid: process.pid,
141032
141229
  startedAt: new Date().toISOString()
141033
141230
  });
141231
+ if (token)
141232
+ queueLockToken = token;
141233
+ return token !== null;
141034
141234
  }
141035
141235
  async function releaseQueueLock() {
141036
- await releaseLock(QUEUE_LOCK_DIR);
141236
+ if (!queueLockToken)
141237
+ return;
141238
+ const token = queueLockToken;
141239
+ queueLockToken = null;
141240
+ await releaseLock(getQueueLockDir(), token);
141037
141241
  }
141038
141242
 
141039
141243
  // src/services/rawDump/history.ts
141244
+ init_envUtils();
141040
141245
  import { promises as fs10 } from "fs";
141041
141246
  import path18 from "path";
141042
- var HISTORY_FILE = path18.join(getCscDir(), "history.jsonl");
141247
+ var HISTORY_FILE = path18.join(getCostrictConfigHomeDir(), "history.jsonl");
141043
141248
  var cache7 = null;
141044
141249
  async function loadHistory() {
141045
141250
  const items = [];
@@ -141105,7 +141310,6 @@ async function getProjectDirs() {
141105
141310
 
141106
141311
  // src/services/rawDump/session.ts
141107
141312
  import { promises as fs11 } from "fs";
141108
- import path19 from "path";
141109
141313
 
141110
141314
  // src/services/rawDump/parse.ts
141111
141315
  function buildFlows(events) {
@@ -141207,10 +141411,15 @@ function fillConversation(conv, allSessionEvents) {
141207
141411
  conv.preview = conv.requestContent.substring(0, 80);
141208
141412
  const responseTexts = [];
141209
141413
  for (let j6 = 1;j6 < conv.events.length; j6++) {
141210
- const text = getTextContent(conv.events[j6].message?.content);
141414
+ const event = conv.events[j6];
141415
+ if (event.type !== "assistant")
141416
+ continue;
141417
+ const text = getAssistantTextContent(event.message?.content);
141211
141418
  if (text)
141212
141419
  responseTexts.push(text);
141213
141420
  }
141421
+ conv.responseContent = responseTexts.join(`
141422
+ `);
141214
141423
  const diffs = [];
141215
141424
  const toolEvents = [];
141216
141425
  let model = "";
@@ -141270,6 +141479,21 @@ function getTextContent(content) {
141270
141479
  }
141271
141480
  return String(content);
141272
141481
  }
141482
+ function getAssistantTextContent(content) {
141483
+ if (typeof content === "string")
141484
+ return content;
141485
+ if (!Array.isArray(content))
141486
+ return "";
141487
+ return content.map((item) => {
141488
+ if (typeof item === "string")
141489
+ return item;
141490
+ if (typeof item === "object" && item !== null && item.type === "text") {
141491
+ return String(item.text || "");
141492
+ }
141493
+ return "";
141494
+ }).filter(Boolean).join(`
141495
+ `);
141496
+ }
141273
141497
  function detectSender(assistant, user) {
141274
141498
  const mode = String(assistant.mode ?? "");
141275
141499
  if (mode === "agent" || mode === "auto")
@@ -141625,24 +141849,20 @@ function parseSession(cacheConversations, events) {
141625
141849
  // src/services/rawDump/session.ts
141626
141850
  var log3 = createLogger("session");
141627
141851
  async function loadSessionMessages(sessionFile) {
141628
- try {
141629
- const text = await fs11.readFile(sessionFile, "utf-8");
141630
- const messages = text.split(`
141852
+ const text = await fs11.readFile(sessionFile, "utf-8");
141853
+ const messages = text.split(`
141631
141854
  `).filter(Boolean).map((line) => {
141632
- try {
141633
- return JSON.parse(line);
141634
- } catch {
141635
- return null;
141636
- }
141637
- }).filter((m3) => m3 !== null);
141638
- log3.debug("loaded messages from file", {
141639
- sessionFile,
141640
- count: messages.length
141641
- });
141642
- return messages;
141643
- } catch {
141644
- return [];
141645
- }
141855
+ try {
141856
+ return JSON.parse(line);
141857
+ } catch {
141858
+ return null;
141859
+ }
141860
+ }).filter((m3) => m3 !== null);
141861
+ log3.debug("loaded messages from file", {
141862
+ sessionFile,
141863
+ count: messages.length
141864
+ });
141865
+ return messages;
141646
141866
  }
141647
141867
  var sessionMessagesCache = new Map;
141648
141868
  function cleanupOldSessions() {
@@ -141654,24 +141874,14 @@ function cleanupOldSessions() {
141654
141874
  }
141655
141875
  }
141656
141876
  }
141657
- async function getParsedSession(taskDir, sessionId) {
141658
- const sessionDir = getSessionDirectory(taskDir);
141659
- const cacheKey = `${sessionDir}:${sessionId}`;
141660
- const cached3 = sessionMessagesCache.get(cacheKey);
141661
- const sessionFile = path19.join(sessionDir, `${sessionId}.jsonl`);
141662
- let stats;
141663
- try {
141664
- stats = await fs11.stat(sessionFile);
141665
- } catch {
141666
- return {
141667
- sessionJsonlFileName: sessionFile,
141668
- fileTimestamp: 0,
141669
- cacheTimestamp: Date.now(),
141670
- fileSize: 0,
141671
- messages: [],
141672
- parsedSession: parseSession([], [])
141673
- };
141877
+ async function getParsedSession(taskDir, sessionId, preferredTranscriptPath) {
141878
+ const sessionFile = await resolveTranscriptPath(taskDir, sessionId, preferredTranscriptPath);
141879
+ if (!sessionFile) {
141880
+ throw new Error(`session transcript not found for session ${sessionId} under ${taskDir}`);
141674
141881
  }
141882
+ const cacheKey = sessionFile;
141883
+ const cached3 = sessionMessagesCache.get(cacheKey);
141884
+ const stats = await fs11.stat(sessionFile);
141675
141885
  const needsReanalysis = !cached3 || cached3.fileTimestamp !== stats.mtimeMs || cached3.fileSize !== stats.size || !cached3.parsedSession;
141676
141886
  if (!needsReanalysis && cached3) {
141677
141887
  log3.debug("using cached parsed session", { sessionId });
@@ -141679,7 +141889,7 @@ async function getParsedSession(taskDir, sessionId) {
141679
141889
  }
141680
141890
  cleanupOldSessions();
141681
141891
  const start = Date.now();
141682
- const messages = cached3?.messages ?? await loadSessionMessages(sessionFile);
141892
+ const messages = await loadSessionMessages(sessionFile);
141683
141893
  const elapsed = Date.now() - start;
141684
141894
  if (elapsed > 100) {
141685
141895
  log3.info("loadSessionMessages slow", { sessionId, elapsedMs: elapsed });
@@ -141740,7 +141950,16 @@ async function statHistorySessions() {
141740
141950
  });
141741
141951
  const sessionDateMap = new Map;
141742
141952
  for (const item of uniqueItems) {
141743
- const cacheEntry = await getParsedSession(item.project, item.sessionId);
141953
+ const cacheEntry = await getParsedSession(item.project, item.sessionId).catch((err) => {
141954
+ log4.warn("statistics: \u8DF3\u8FC7\u4F1A\u8BDD\uFF08transcript \u672A\u89E3\u6790\uFF09", {
141955
+ sessionId: item.sessionId,
141956
+ project: item.project,
141957
+ error: err instanceof Error ? err.message : String(err)
141958
+ });
141959
+ return null;
141960
+ });
141961
+ if (!cacheEntry)
141962
+ continue;
141744
141963
  const messages = cacheEntry.messages;
141745
141964
  if (!messages || messages.length === 0)
141746
141965
  continue;
@@ -141824,7 +142043,6 @@ async function statHistorySessions() {
141824
142043
 
141825
142044
  // src/services/rawDump/worker.ts
141826
142045
  var log5 = createLogger("worker");
141827
- var CSC_DIR = getCscDir();
141828
142046
  var REQUEST_TIMEOUT_MS = 30000;
141829
142047
  var TOOL_EVENTS_PAYLOAD_BUDGET = 256 * 1024;
141830
142048
  function capToolEventsPayload(events) {
@@ -141851,12 +142069,12 @@ async function getCachedRepoInfo(directory) {
141851
142069
  }
141852
142070
  async function processTask(task, authData) {
141853
142071
  log5.info("processing task:", { task });
141854
- await uploadRaw(task.sessionId, task.directory, authData);
142072
+ await uploadRaw(task.sessionId, task.directory, authData, task.transcriptPath);
141855
142073
  const repoInfo = await getCachedRepoInfo(task.directory);
141856
- const cacheEntry = await getParsedSession(task.directory, task.sessionId);
142074
+ const cacheEntry = await getParsedSession(task.directory, task.sessionId, task.transcriptPath);
141857
142075
  const parsedSession = cacheEntry.parsedSession;
141858
142076
  if (parsedSession.conversations.length === 0) {
141859
- log5.warn("no conversations found", { task });
142077
+ throw new Error(`session transcript contains no conversations: ${cacheEntry.sessionJsonlFileName}`);
141860
142078
  }
141861
142079
  await uploadSummary({ sessionId: task.sessionId, directory: task.directory, parsedSession }, authData);
141862
142080
  for (const conv of parsedSession.conversations) {
@@ -141947,7 +142165,7 @@ async function postJson(url3, body, headers, maxAttempts = 3) {
141947
142165
  for (let attempt = 0;attempt < maxAttempts; attempt++) {
141948
142166
  if (attempt > 0) {
141949
142167
  const delay = 5000 * 2 ** (attempt - 1);
141950
- await new Promise((resolve8) => setTimeout(resolve8, delay));
142168
+ await new Promise((resolve9) => setTimeout(resolve9, delay));
141951
142169
  }
141952
142170
  const controller = new AbortController;
141953
142171
  const timer = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS);
@@ -142124,7 +142342,7 @@ async function authWithFallback() {
142124
142342
  const version4 = getClientVersion();
142125
142343
  let deviceId = process.env.CSC_DEVICE_ID;
142126
142344
  if (!deviceId) {
142127
- const deviceIdFile = path20.join(getLocalDumpDir(), "device-id");
142345
+ const deviceIdFile = path19.join(getLocalDumpDir(), "device-id");
142128
142346
  try {
142129
142347
  deviceId = (await fs12.readFile(deviceIdFile, "utf-8")).trim();
142130
142348
  } catch {}
@@ -142161,10 +142379,14 @@ async function authWithFallback() {
142161
142379
  };
142162
142380
  }
142163
142381
  }
142164
- async function uploadRaw(sessionId, directory, authData) {
142165
- const normalizedProject = normalizeProjectPath2(directory);
142382
+ async function uploadRaw(sessionId, directory, authData, transcriptPath) {
142383
+ const normalizedProject = normalizeProjectPath(directory);
142166
142384
  const stateKey = `${normalizedProject}/${sessionId}`;
142167
- const filePath = path20.join(CSC_DIR, "projects", normalizedProject, `${sessionId}.jsonl`);
142385
+ const filePath = await resolveTranscriptPath(directory, sessionId, transcriptPath);
142386
+ if (!filePath) {
142387
+ log5.debug("raw file not found, skip", { sessionId, directory });
142388
+ return;
142389
+ }
142168
142390
  const lastReportedCount = state_raw.logs[stateKey] ?? 0;
142169
142391
  let fileContent;
142170
142392
  try {
@@ -142326,7 +142548,7 @@ async function uploadSummary(payload, authData) {
142326
142548
  client_ide: "cli",
142327
142549
  client_version: authData.version,
142328
142550
  client_os: detectOs(),
142329
- client_os_version: os5.release(),
142551
+ client_os_version: os4.release(),
142330
142552
  caller: process.env.CSC_RAW_DUMP_CALLER || "chat"
142331
142553
  };
142332
142554
  await uploadReport(authData, "/raw-store/task-summary", body);
@@ -142493,12 +142715,12 @@ async function processIncompleteTasks(authData) {
142493
142715
  });
142494
142716
  state_task.tasks[key].uploadedAt = "DEAD_LETTER";
142495
142717
  state_task.incomplete--;
142496
- await saveTasks();
142497
142718
  log5.error("task moved to dead letter", {
142498
142719
  key,
142499
142720
  attemptCount: state_task.tasks[key].attemptCount
142500
142721
  });
142501
142722
  }
142723
+ await saveTasks();
142502
142724
  }
142503
142725
  }
142504
142726
  }
@@ -142615,6 +142837,7 @@ async function runQueueTimer() {
142615
142837
  return;
142616
142838
  }
142617
142839
  try {
142840
+ await loadQueue(true);
142618
142841
  const newTasks = getQueue();
142619
142842
  if (newTasks.length === 0) {
142620
142843
  if (state_task.incomplete === 0) {
@@ -142626,7 +142849,7 @@ async function runQueueTimer() {
142626
142849
  log5.info(`processing ${newTasks.length} new tasks`);
142627
142850
  addQueueTasks(newTasks);
142628
142851
  await saveTasks();
142629
- clearQueue();
142852
+ await clearQueue();
142630
142853
  } catch (err) {
142631
142854
  log5.error("queue timer failed", {
142632
142855
  error: err instanceof Error ? err.message : String(err)
@@ -142654,18 +142877,26 @@ if (scriptPath.endsWith("worker.ts") || scriptPath.endsWith("worker.js")) {
142654
142877
  }
142655
142878
 
142656
142879
  // src/services/rawDump/timerWorker.ts
142657
- import path21 from "path";
142880
+ import path20 from "path";
142658
142881
  var log6 = createLogger("timer");
142659
- var TIMER_LOCK_DIR = path21.join(getRawDumpDir(), "csc-timer.lock.d");
142882
+ var TIMER_LOCK_DIR = path20.join(getRawDumpDir(), "csc-timer.lock.d");
142660
142883
  var isRunning = false;
142884
+ var timerLockToken = null;
142661
142885
  async function acquireTimerLock() {
142662
- return acquireLock(TIMER_LOCK_DIR, {
142886
+ const token = await acquireLock(TIMER_LOCK_DIR, {
142663
142887
  pid: process.pid,
142664
142888
  startedAt: new Date().toISOString()
142665
142889
  });
142890
+ if (token)
142891
+ timerLockToken = token;
142892
+ return token !== null;
142666
142893
  }
142667
142894
  async function releaseTimerLock() {
142668
- await releaseLock(TIMER_LOCK_DIR);
142895
+ if (!timerLockToken)
142896
+ return;
142897
+ const token = timerLockToken;
142898
+ timerLockToken = null;
142899
+ await releaseLock(TIMER_LOCK_DIR, token);
142669
142900
  }
142670
142901
  async function runTimers() {
142671
142902
  if (isRunning)
@@ -142721,10 +142952,10 @@ if (scriptPath2.endsWith("timerWorker.ts") || scriptPath2.endsWith("timerWorker.
142721
142952
 
142722
142953
  // src/services/rawDump/parentHeartbeat.ts
142723
142954
  import { promises as fs13 } from "fs";
142724
- import path22 from "path";
142955
+ import path21 from "path";
142725
142956
  var HEARTBEAT_STALE_MS = 15000;
142726
142957
  function getParentHeartbeatPath(pid) {
142727
- return path22.join(getRawDumpDir(), `csc-parent-heartbeat-${pid}.json`);
142958
+ return path21.join(getRawDumpDir(), `csc-parent-heartbeat-${pid}.json`);
142728
142959
  }
142729
142960
  async function readParentHeartbeat(pid) {
142730
142961
  try {
@@ -142756,13 +142987,19 @@ function scheduleForcedExit(reason, code) {
142756
142987
  process.exit(code);
142757
142988
  }, graceMs);
142758
142989
  }
142759
- process.on("SIGTERM", () => scheduleForcedExit("SIGTERM", 0));
142760
- process.on("SIGINT", () => scheduleForcedExit("SIGINT", 0));
142761
- process.on("unhandledRejection", (reason) => {
142762
- log7.error("unhandled rejection", { reason: String(reason), workerPid: process.pid });
142763
- });
142764
142990
  var PARENT_PID = process.ppid;
142765
- var IS_WORKER_PROCESS = process.argv[1]?.includes("batchWorker") || false;
142991
+ var WORKER_ENTRY_BASENAMES = ["batchworker.ts", "batchworker.js"];
142992
+ var IS_WORKER_PROCESS = process.env.CSC_RAW_DUMP_WORKER === "1" || WORKER_ENTRY_BASENAMES.includes((process.argv[1] ?? "").split(/[\\/]/).pop()?.toLowerCase() ?? "");
142993
+ if (IS_WORKER_PROCESS) {
142994
+ process.on("SIGTERM", () => scheduleForcedExit("SIGTERM", 0));
142995
+ process.on("SIGINT", () => scheduleForcedExit("SIGINT", 0));
142996
+ process.on("unhandledRejection", (reason) => {
142997
+ log7.error("unhandled rejection", {
142998
+ reason: String(reason),
142999
+ workerPid: process.pid
143000
+ });
143001
+ });
143002
+ }
142766
143003
  var parentHeartbeat = null;
142767
143004
  async function refreshParentHeartbeat() {
142768
143005
  parentHeartbeat = await readParentHeartbeat(PARENT_PID);
@@ -142791,31 +143028,34 @@ var stateLoaded = false;
142791
143028
  function startBatchWorker() {
142792
143029
  process.title = "csc_batch_worker";
142793
143030
  log7.info("batch worker started");
142794
- loadAllState().then(() => {
142795
- stateLoaded = true;
142796
- }).catch((err) => {
142797
- log7.error("failed to load state", {
142798
- error: err instanceof Error ? err.message : String(err)
142799
- });
142800
- process.exit(1);
142801
- });
142802
- loadQueue().catch((err) => {
142803
- log7.error("failed to load queue", {
142804
- error: err instanceof Error ? err.message : String(err)
142805
- });
142806
- process.exit(1);
142807
- });
142808
- setImmediate(async () => {
143031
+ startParentWatchdog();
143032
+ (async () => {
142809
143033
  try {
142810
- await runHistorySessionWorker();
143034
+ await loadAllState();
143035
+ await loadQueue();
143036
+ stateLoaded = true;
142811
143037
  } catch (err) {
142812
- log7.error("runHistorySessionWorker failed", {
143038
+ log7.error("failed to load state", {
142813
143039
  error: err instanceof Error ? err.message : String(err)
142814
143040
  });
143041
+ process.exit(1);
143042
+ return;
142815
143043
  }
143044
+ setImmediate(async () => {
143045
+ try {
143046
+ await runHistorySessionWorker();
143047
+ } catch (err) {
143048
+ log7.error("runHistorySessionWorker failed", {
143049
+ error: err instanceof Error ? err.message : String(err)
143050
+ });
143051
+ }
143052
+ });
143053
+ startTimerWorker();
143054
+ })().catch((err) => {
143055
+ log7.error("batch worker init failed", {
143056
+ error: err instanceof Error ? err.message : String(err)
143057
+ });
142816
143058
  });
142817
- startTimerWorker();
142818
- startParentWatchdog();
142819
143059
  }
142820
143060
  function startParentWatchdog() {
142821
143061
  if (!IS_WORKER_PROCESS)
@@ -142858,5 +143098,5 @@ export {
142858
143098
  startBatchWorker
142859
143099
  };
142860
143100
 
142861
- //# debugId=1CAF470F0E77F6CA64756E2164756E21
142862
- //# sourceMappingURL=batchWorker.js.map
143101
+ //# debugId=CF029F1C9836782B64756E2164756E21
143102
+