@costrict/csc 4.2.14 → 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.
- package/dist/cli.js +9195 -75031
- package/dist/services/rawDump/batchWorker.js +1273 -1080
- package/package.json +2 -1
|
@@ -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.
|
|
76
|
-
cached = "4.2.
|
|
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 =
|
|
1339
|
+
fs4.readdir = readdir2;
|
|
676
1340
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
677
|
-
function
|
|
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,
|
|
1930
|
+
return fs3.stat(file, (err, stat4) => {
|
|
1267
1931
|
if (err) {
|
|
1268
1932
|
return callback(err);
|
|
1269
1933
|
}
|
|
1270
|
-
callback(null,
|
|
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,
|
|
1942
|
+
fs3.stat(file, (err2, stat4) => {
|
|
1279
1943
|
if (err2) {
|
|
1280
1944
|
return callback(err2);
|
|
1281
1945
|
}
|
|
1282
|
-
const precision =
|
|
1946
|
+
const precision = stat4.mtime.getTime() % 1000 === 0 ? "s" : "ms";
|
|
1283
1947
|
Object.defineProperty(fs3, cacheSymbol, { value: precision });
|
|
1284
|
-
callback(null,
|
|
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,
|
|
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(
|
|
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(
|
|
1354
|
-
return
|
|
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,
|
|
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() ===
|
|
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,
|
|
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(
|
|
2167
|
+
return callback(null, !isLockStale(stat4, options));
|
|
1504
2168
|
});
|
|
1505
2169
|
});
|
|
1506
2170
|
}
|
|
@@ -1633,7 +2297,7 @@ var _lockfile;
|
|
|
1633
2297
|
|
|
1634
2298
|
// src/costrict/provider/credentialsStore.ts
|
|
1635
2299
|
import { promises as fs3, existsSync } from "fs";
|
|
1636
|
-
import { join } from "path";
|
|
2300
|
+
import { join as join3 } from "path";
|
|
1637
2301
|
|
|
1638
2302
|
class CoStrictCredentialsStore {
|
|
1639
2303
|
configDir;
|
|
@@ -1641,7 +2305,7 @@ class CoStrictCredentialsStore {
|
|
|
1641
2305
|
this.configDir = configDir;
|
|
1642
2306
|
}
|
|
1643
2307
|
getPath() {
|
|
1644
|
-
return
|
|
2308
|
+
return join3(this.configDir, "auth.json");
|
|
1645
2309
|
}
|
|
1646
2310
|
async load() {
|
|
1647
2311
|
try {
|
|
@@ -1730,17 +2394,17 @@ class CoStrictCredentialsStore {
|
|
|
1730
2394
|
var init_credentialsStore = () => {};
|
|
1731
2395
|
|
|
1732
2396
|
// src/costrict/provider/credentials.ts
|
|
1733
|
-
import { join as
|
|
2397
|
+
import { join as join4 } from "path";
|
|
1734
2398
|
import { createHash } from "crypto";
|
|
1735
|
-
import { homedir } from "os";
|
|
2399
|
+
import { homedir as homedir2 } from "os";
|
|
1736
2400
|
function getCoStrictCredentialsDir() {
|
|
1737
|
-
return
|
|
2401
|
+
return join4(homedir2(), ".costrict", "share");
|
|
1738
2402
|
}
|
|
1739
2403
|
function generateMachineId() {
|
|
1740
|
-
const
|
|
1741
|
-
const platform =
|
|
1742
|
-
const hostname =
|
|
1743
|
-
const username =
|
|
2404
|
+
const os = __require("os");
|
|
2405
|
+
const platform = os.platform();
|
|
2406
|
+
const hostname = os.hostname();
|
|
2407
|
+
const username = os.userInfo().username;
|
|
1744
2408
|
const machineInfo = `${platform}-${hostname}-${username}`;
|
|
1745
2409
|
return createHash("sha256").update(machineInfo).digest("hex");
|
|
1746
2410
|
}
|
|
@@ -3332,6 +3996,7 @@ var init_commands_descriptions = __esm(() => {
|
|
|
3332
3996
|
"commands.desc.thinkback": "Your 2025 CoStrict Year in Review",
|
|
3333
3997
|
"commands.desc.thinkbackPlay": "Play the thinkback animation",
|
|
3334
3998
|
"commands.desc.tui": "Toggle TUI alternate-screen mode",
|
|
3999
|
+
"commands.desc.ultracode": "Launch a dynamic multi-agent coding workflow",
|
|
3335
4000
|
"commands.desc.ultraplan": "CoStrict on the web drafts an advanced plan you can edit and approve",
|
|
3336
4001
|
"commands.desc.upgrade": "Upgrade to Max for higher rate limits and more Opus",
|
|
3337
4002
|
"commands.desc.usage": "Show session cost, plan usage, and activity stats",
|
|
@@ -3905,6 +4570,15 @@ Example: /fork Fix the null check in validate.ts`,
|
|
|
3905
4570
|
"commands.skillStore.noPublishedVersions": "Skill {id} has no published versions to install.",
|
|
3906
4571
|
"commands.skillStore.installed": "Skill installed to {path}",
|
|
3907
4572
|
"commands.skillStore.installFailed": "Failed to install skill {id}: {error}",
|
|
4573
|
+
"commands.skillInstall.installed": "Skill {name} installed as {targetName} at {path}",
|
|
4574
|
+
"commands.skillInstall.notFound": "No cloud skill found for {spec}. Use an exact skill slug or UUID.",
|
|
4575
|
+
"commands.skillInstall.invalidScope": "Invalid skill install scope {scope}. Use user or project.",
|
|
4576
|
+
"commands.skillInstall.alreadyExists": "Skill already exists at {path}. Use --force to overwrite it.",
|
|
4577
|
+
"commands.skillInstall.unsupportedType": "Cloud item {spec} is type {type}, not a skill.",
|
|
4578
|
+
"commands.skillInstall.missingContent": "Cloud skill {slug} has no installable content.",
|
|
4579
|
+
"commands.skillInstall.invalidName": "Invalid skill install name {name}. Use letters, numbers, underscores, or hyphens.",
|
|
4580
|
+
"commands.skillInstall.invalidResponse": "Cloud response for {spec} is missing required skill fields.",
|
|
4581
|
+
"commands.skillInstall.failed": "Failed to install skill {spec}: {error}",
|
|
3908
4582
|
"commands.agentsPlatform.listEmpty": "No scheduled agents found.",
|
|
3909
4583
|
"commands.agentsPlatform.listCount": "{count} scheduled agent(s).",
|
|
3910
4584
|
"commands.agentsPlatform.listFailed": "Failed to list agents: {error}",
|
|
@@ -4024,6 +4698,10 @@ Start a new session at {url}`,
|
|
|
4024
4698
|
"commands.teleport.failed": "Teleport failed: {error}",
|
|
4025
4699
|
"commands.teleport.availableSessions": "## Available sessions (most recent first)",
|
|
4026
4700
|
"commands.teleport.hint": "Run `/teleport <session-id>` to resume a session.",
|
|
4701
|
+
"commands.ultracode.permissionUnavailable": "Unable to launch /ultracode: tool permission handler is unavailable.",
|
|
4702
|
+
"commands.ultracode.denied": "Ultracode was not launched: {message}",
|
|
4703
|
+
"commands.ultracode.notLaunched": "Ultracode was not launched.",
|
|
4704
|
+
"commands.ultracode.launched": "Ultracode workflow launched in the background (task id: {taskId}, run id: {runId}). Use /dynamic-workflows to watch progress.",
|
|
4027
4705
|
"commands.autofixPr.failed": "Autofix PR failed: {error}",
|
|
4028
4706
|
"commands.autofixPr.noMonitor": "No active autofix monitor.",
|
|
4029
4707
|
"commands.autofixPr.stopped": "Stopped local monitoring of {repo}#{prNumber}. Any already-running remote session continues until it finishes or is cancelled from {domain}/code.",
|
|
@@ -4879,6 +5557,8 @@ var init_cli = __esm(() => {
|
|
|
4879
5557
|
"cli.cmd.pluginValidate": "Validate a plugin or marketplace manifest",
|
|
4880
5558
|
"cli.cmd.serve": "Start a CoStrict HTTP API server",
|
|
4881
5559
|
"cli.cmd.server": "Start a CoStrict session server (alias: serve)",
|
|
5560
|
+
"cli.cmd.skill": "Install cloud skills",
|
|
5561
|
+
"cli.cmd.skillInstall": "Install a cloud skill by UUID or exact slug",
|
|
4882
5562
|
"cli.cmd.ssh": "SSH into a remote machine and start CoStrict",
|
|
4883
5563
|
"cli.cmd.sshi": "SSH interactive login with CoStrict session management",
|
|
4884
5564
|
"cli.cmd.status": "Show authentication status",
|
|
@@ -5004,6 +5684,10 @@ var init_cli = __esm(() => {
|
|
|
5004
5684
|
"cli.option.rewindFiles": "Restore files to state at the specified user message and exit (requires --resume)",
|
|
5005
5685
|
"cli.option.safe": "Roll back to the server-pinned safe version",
|
|
5006
5686
|
"cli.option.scope": "Configuration scope (local, user, or project)",
|
|
5687
|
+
"cli.option.skillInstallDir": "Custom skills root directory (overrides --scope)",
|
|
5688
|
+
"cli.option.skillInstallForce": "Overwrite an existing SKILL.md",
|
|
5689
|
+
"cli.option.skillInstallName": "Target skill directory and invocation name",
|
|
5690
|
+
"cli.option.skillInstallScope": "Install scope: user or project",
|
|
5007
5691
|
"cli.option.sdkUrl": "Use remote WebSocket endpoint for SDK I/O streaming (only with -p and stream-json format)",
|
|
5008
5692
|
"cli.option.sessionId": "Resume a session by ID",
|
|
5009
5693
|
"cli.option.sessionIdArg": "Use a specific session ID for the conversation (must be a valid UUID)",
|
|
@@ -7853,6 +8537,7 @@ var init_commands_descriptions2 = __esm(() => {
|
|
|
7853
8537
|
"commands.desc.thinkback": "\u60A8\u7684 2025 CoStrict \u5E74\u5EA6\u56DE\u987E",
|
|
7854
8538
|
"commands.desc.thinkbackPlay": "\u64AD\u653E\u5E74\u5EA6\u56DE\u987E\u52A8\u753B",
|
|
7855
8539
|
"commands.desc.tui": "\u5207\u6362 TUI \u5907\u7528\u5C4F\u5E55\u6A21\u5F0F",
|
|
8540
|
+
"commands.desc.ultracode": "\u542F\u52A8DynamicWorkflow\u673A\u5236",
|
|
7856
8541
|
"commands.desc.ultraplan": "CoStrict \u7F51\u9875\u7AEF\u81EA\u52A8\u8D77\u8349\u9AD8\u7EA7\u8BA1\u5212\uFF0C\u53EF\u7F16\u8F91\u548C\u5BA1\u6279",
|
|
7857
8542
|
"commands.desc.upgrade": "\u5347\u7EA7\u5230 Max \u83B7\u53D6\u66F4\u9AD8\u901F\u7387\u9650\u5236\u548C\u66F4\u591A Opus",
|
|
7858
8543
|
"commands.desc.usage": "\u663E\u793A\u4F1A\u8BDD\u6210\u672C\u3001\u8BA1\u5212\u7528\u91CF\u548C\u6D3B\u52A8\u7EDF\u8BA1",
|
|
@@ -8424,6 +9109,15 @@ var init_commands_others2 = __esm(() => {
|
|
|
8424
9109
|
"commands.skillStore.noPublishedVersions": "\u6280\u80FD {id} \u6CA1\u6709\u5DF2\u53D1\u5E03\u7684\u7248\u672C\u53EF\u4F9B\u5B89\u88C5\u3002",
|
|
8425
9110
|
"commands.skillStore.installed": "\u6280\u80FD\u5DF2\u5B89\u88C5\u5230 {path}",
|
|
8426
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}",
|
|
8427
9121
|
"commands.agentsPlatform.listEmpty": "\u672A\u627E\u5230\u5B9A\u65F6\u4EE3\u7406\u3002",
|
|
8428
9122
|
"commands.agentsPlatform.listCount": "{count} \u4E2A\u5B9A\u65F6\u4EE3\u7406\u3002",
|
|
8429
9123
|
"commands.agentsPlatform.listFailed": "\u5217\u51FA\u4EE3\u7406\u5931\u8D25\uFF1A{error}",
|
|
@@ -8543,6 +9237,10 @@ var init_commands_others2 = __esm(() => {
|
|
|
8543
9237
|
"commands.teleport.failed": "Teleport \u5931\u8D25\uFF1A{error}",
|
|
8544
9238
|
"commands.teleport.availableSessions": "## \u53EF\u7528\u4F1A\u8BDD\uFF08\u6700\u8FD1\u4F18\u5148\uFF09",
|
|
8545
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",
|
|
8546
9244
|
"commands.autofixPr.failed": "Autofix PR \u5931\u8D25\uFF1A{error}",
|
|
8547
9245
|
"commands.autofixPr.noMonitor": "\u6CA1\u6709\u6D3B\u8DC3\u7684 autofix \u76D1\u63A7\u5668\u3002",
|
|
8548
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",
|
|
@@ -9397,6 +10095,8 @@ var init_cli2 = __esm(() => {
|
|
|
9397
10095
|
"cli.cmd.pluginValidate": "\u9A8C\u8BC1\u63D2\u4EF6\u6216\u5E02\u573A\u6E05\u5355\u6587\u4EF6",
|
|
9398
10096
|
"cli.cmd.serve": "\u542F\u52A8 CoStrict HTTP API \u670D\u52A1\u5668",
|
|
9399
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",
|
|
9400
10100
|
"cli.cmd.ssh": "SSH \u767B\u5F55\u8FDC\u7A0B\u673A\u5668\u5E76\u542F\u52A8 CoStrict",
|
|
9401
10101
|
"cli.cmd.sshi": "SSH \u4EA4\u4E92\u5F0F\u767B\u5F55\u53CA CoStrict \u4F1A\u8BDD\u7BA1\u7406",
|
|
9402
10102
|
"cli.cmd.status": "\u663E\u793A\u8BA4\u8BC1\u72B6\u6001",
|
|
@@ -9522,6 +10222,10 @@ var init_cli2 = __esm(() => {
|
|
|
9522
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",
|
|
9523
10223
|
"cli.option.safe": "\u56DE\u6EDA\u5230\u670D\u52A1\u5668\u56FA\u5B9A\u7684\u5B89\u5168\u7248\u672C",
|
|
9524
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",
|
|
9525
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",
|
|
9526
10230
|
"cli.option.sessionId": "\u6309 ID \u6062\u590D\u4F1A\u8BDD",
|
|
9527
10231
|
"cli.option.sessionIdArg": "\u4E3A\u5BF9\u8BDD\u4F7F\u7528\u7279\u5B9A\u7684\u4F1A\u8BDD ID\uFF08\u5FC5\u987B\u662F\u6709\u6548\u7684 UUID\uFF09",
|
|
@@ -10880,552 +11584,6 @@ var init_tips2 = __esm(() => {
|
|
|
10880
11584
|
};
|
|
10881
11585
|
});
|
|
10882
11586
|
|
|
10883
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js
|
|
10884
|
-
var freeGlobal, _freeGlobal_default;
|
|
10885
|
-
var init__freeGlobal = __esm(() => {
|
|
10886
|
-
freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
10887
|
-
_freeGlobal_default = freeGlobal;
|
|
10888
|
-
});
|
|
10889
|
-
|
|
10890
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js
|
|
10891
|
-
var freeSelf, root, _root_default;
|
|
10892
|
-
var init__root = __esm(() => {
|
|
10893
|
-
init__freeGlobal();
|
|
10894
|
-
freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
10895
|
-
root = _freeGlobal_default || freeSelf || Function("return this")();
|
|
10896
|
-
_root_default = root;
|
|
10897
|
-
});
|
|
10898
|
-
|
|
10899
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js
|
|
10900
|
-
var Symbol2, _Symbol_default;
|
|
10901
|
-
var init__Symbol = __esm(() => {
|
|
10902
|
-
init__root();
|
|
10903
|
-
Symbol2 = _root_default.Symbol;
|
|
10904
|
-
_Symbol_default = Symbol2;
|
|
10905
|
-
});
|
|
10906
|
-
|
|
10907
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js
|
|
10908
|
-
function getRawTag(value) {
|
|
10909
|
-
var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
|
|
10910
|
-
try {
|
|
10911
|
-
value[symToStringTag] = undefined;
|
|
10912
|
-
var unmasked = true;
|
|
10913
|
-
} catch (e) {}
|
|
10914
|
-
var result = nativeObjectToString.call(value);
|
|
10915
|
-
if (unmasked) {
|
|
10916
|
-
if (isOwn) {
|
|
10917
|
-
value[symToStringTag] = tag;
|
|
10918
|
-
} else {
|
|
10919
|
-
delete value[symToStringTag];
|
|
10920
|
-
}
|
|
10921
|
-
}
|
|
10922
|
-
return result;
|
|
10923
|
-
}
|
|
10924
|
-
var objectProto, hasOwnProperty, nativeObjectToString, symToStringTag, _getRawTag_default;
|
|
10925
|
-
var init__getRawTag = __esm(() => {
|
|
10926
|
-
init__Symbol();
|
|
10927
|
-
objectProto = Object.prototype;
|
|
10928
|
-
hasOwnProperty = objectProto.hasOwnProperty;
|
|
10929
|
-
nativeObjectToString = objectProto.toString;
|
|
10930
|
-
symToStringTag = _Symbol_default ? _Symbol_default.toStringTag : undefined;
|
|
10931
|
-
_getRawTag_default = getRawTag;
|
|
10932
|
-
});
|
|
10933
|
-
|
|
10934
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js
|
|
10935
|
-
function objectToString(value) {
|
|
10936
|
-
return nativeObjectToString2.call(value);
|
|
10937
|
-
}
|
|
10938
|
-
var objectProto2, nativeObjectToString2, _objectToString_default;
|
|
10939
|
-
var init__objectToString = __esm(() => {
|
|
10940
|
-
objectProto2 = Object.prototype;
|
|
10941
|
-
nativeObjectToString2 = objectProto2.toString;
|
|
10942
|
-
_objectToString_default = objectToString;
|
|
10943
|
-
});
|
|
10944
|
-
|
|
10945
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js
|
|
10946
|
-
function baseGetTag(value) {
|
|
10947
|
-
if (value == null) {
|
|
10948
|
-
return value === undefined ? undefinedTag : nullTag;
|
|
10949
|
-
}
|
|
10950
|
-
return symToStringTag2 && symToStringTag2 in Object(value) ? _getRawTag_default(value) : _objectToString_default(value);
|
|
10951
|
-
}
|
|
10952
|
-
var nullTag = "[object Null]", undefinedTag = "[object Undefined]", symToStringTag2, _baseGetTag_default;
|
|
10953
|
-
var init__baseGetTag = __esm(() => {
|
|
10954
|
-
init__Symbol();
|
|
10955
|
-
init__getRawTag();
|
|
10956
|
-
init__objectToString();
|
|
10957
|
-
symToStringTag2 = _Symbol_default ? _Symbol_default.toStringTag : undefined;
|
|
10958
|
-
_baseGetTag_default = baseGetTag;
|
|
10959
|
-
});
|
|
10960
|
-
|
|
10961
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js
|
|
10962
|
-
function isObject(value) {
|
|
10963
|
-
var type = typeof value;
|
|
10964
|
-
return value != null && (type == "object" || type == "function");
|
|
10965
|
-
}
|
|
10966
|
-
var isObject_default;
|
|
10967
|
-
var init_isObject = __esm(() => {
|
|
10968
|
-
isObject_default = isObject;
|
|
10969
|
-
});
|
|
10970
|
-
|
|
10971
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js
|
|
10972
|
-
function isFunction(value) {
|
|
10973
|
-
if (!isObject_default(value)) {
|
|
10974
|
-
return false;
|
|
10975
|
-
}
|
|
10976
|
-
var tag = _baseGetTag_default(value);
|
|
10977
|
-
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
10978
|
-
}
|
|
10979
|
-
var asyncTag = "[object AsyncFunction]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]", isFunction_default;
|
|
10980
|
-
var init_isFunction = __esm(() => {
|
|
10981
|
-
init__baseGetTag();
|
|
10982
|
-
init_isObject();
|
|
10983
|
-
isFunction_default = isFunction;
|
|
10984
|
-
});
|
|
10985
|
-
|
|
10986
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js
|
|
10987
|
-
var coreJsData, _coreJsData_default;
|
|
10988
|
-
var init__coreJsData = __esm(() => {
|
|
10989
|
-
init__root();
|
|
10990
|
-
coreJsData = _root_default["__core-js_shared__"];
|
|
10991
|
-
_coreJsData_default = coreJsData;
|
|
10992
|
-
});
|
|
10993
|
-
|
|
10994
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js
|
|
10995
|
-
function isMasked(func) {
|
|
10996
|
-
return !!maskSrcKey && maskSrcKey in func;
|
|
10997
|
-
}
|
|
10998
|
-
var maskSrcKey, _isMasked_default;
|
|
10999
|
-
var init__isMasked = __esm(() => {
|
|
11000
|
-
init__coreJsData();
|
|
11001
|
-
maskSrcKey = function() {
|
|
11002
|
-
var uid = /[^.]+$/.exec(_coreJsData_default && _coreJsData_default.keys && _coreJsData_default.keys.IE_PROTO || "");
|
|
11003
|
-
return uid ? "Symbol(src)_1." + uid : "";
|
|
11004
|
-
}();
|
|
11005
|
-
_isMasked_default = isMasked;
|
|
11006
|
-
});
|
|
11007
|
-
|
|
11008
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js
|
|
11009
|
-
function toSource(func) {
|
|
11010
|
-
if (func != null) {
|
|
11011
|
-
try {
|
|
11012
|
-
return funcToString.call(func);
|
|
11013
|
-
} catch (e) {}
|
|
11014
|
-
try {
|
|
11015
|
-
return func + "";
|
|
11016
|
-
} catch (e) {}
|
|
11017
|
-
}
|
|
11018
|
-
return "";
|
|
11019
|
-
}
|
|
11020
|
-
var funcProto, funcToString, _toSource_default;
|
|
11021
|
-
var init__toSource = __esm(() => {
|
|
11022
|
-
funcProto = Function.prototype;
|
|
11023
|
-
funcToString = funcProto.toString;
|
|
11024
|
-
_toSource_default = toSource;
|
|
11025
|
-
});
|
|
11026
|
-
|
|
11027
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js
|
|
11028
|
-
function baseIsNative(value) {
|
|
11029
|
-
if (!isObject_default(value) || _isMasked_default(value)) {
|
|
11030
|
-
return false;
|
|
11031
|
-
}
|
|
11032
|
-
var pattern = isFunction_default(value) ? reIsNative : reIsHostCtor;
|
|
11033
|
-
return pattern.test(_toSource_default(value));
|
|
11034
|
-
}
|
|
11035
|
-
var reRegExpChar, reIsHostCtor, funcProto2, objectProto3, funcToString2, hasOwnProperty2, reIsNative, _baseIsNative_default;
|
|
11036
|
-
var init__baseIsNative = __esm(() => {
|
|
11037
|
-
init_isFunction();
|
|
11038
|
-
init__isMasked();
|
|
11039
|
-
init_isObject();
|
|
11040
|
-
init__toSource();
|
|
11041
|
-
reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
11042
|
-
reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
11043
|
-
funcProto2 = Function.prototype;
|
|
11044
|
-
objectProto3 = Object.prototype;
|
|
11045
|
-
funcToString2 = funcProto2.toString;
|
|
11046
|
-
hasOwnProperty2 = objectProto3.hasOwnProperty;
|
|
11047
|
-
reIsNative = RegExp("^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
|
|
11048
|
-
_baseIsNative_default = baseIsNative;
|
|
11049
|
-
});
|
|
11050
|
-
|
|
11051
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js
|
|
11052
|
-
function getValue(object, key) {
|
|
11053
|
-
return object == null ? undefined : object[key];
|
|
11054
|
-
}
|
|
11055
|
-
var _getValue_default;
|
|
11056
|
-
var init__getValue = __esm(() => {
|
|
11057
|
-
_getValue_default = getValue;
|
|
11058
|
-
});
|
|
11059
|
-
|
|
11060
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js
|
|
11061
|
-
function getNative(object, key) {
|
|
11062
|
-
var value = _getValue_default(object, key);
|
|
11063
|
-
return _baseIsNative_default(value) ? value : undefined;
|
|
11064
|
-
}
|
|
11065
|
-
var _getNative_default;
|
|
11066
|
-
var init__getNative = __esm(() => {
|
|
11067
|
-
init__baseIsNative();
|
|
11068
|
-
init__getValue();
|
|
11069
|
-
_getNative_default = getNative;
|
|
11070
|
-
});
|
|
11071
|
-
|
|
11072
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js
|
|
11073
|
-
var nativeCreate, _nativeCreate_default;
|
|
11074
|
-
var init__nativeCreate = __esm(() => {
|
|
11075
|
-
init__getNative();
|
|
11076
|
-
nativeCreate = _getNative_default(Object, "create");
|
|
11077
|
-
_nativeCreate_default = nativeCreate;
|
|
11078
|
-
});
|
|
11079
|
-
|
|
11080
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js
|
|
11081
|
-
function hashClear() {
|
|
11082
|
-
this.__data__ = _nativeCreate_default ? _nativeCreate_default(null) : {};
|
|
11083
|
-
this.size = 0;
|
|
11084
|
-
}
|
|
11085
|
-
var _hashClear_default;
|
|
11086
|
-
var init__hashClear = __esm(() => {
|
|
11087
|
-
init__nativeCreate();
|
|
11088
|
-
_hashClear_default = hashClear;
|
|
11089
|
-
});
|
|
11090
|
-
|
|
11091
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js
|
|
11092
|
-
function hashDelete(key) {
|
|
11093
|
-
var result = this.has(key) && delete this.__data__[key];
|
|
11094
|
-
this.size -= result ? 1 : 0;
|
|
11095
|
-
return result;
|
|
11096
|
-
}
|
|
11097
|
-
var _hashDelete_default;
|
|
11098
|
-
var init__hashDelete = __esm(() => {
|
|
11099
|
-
_hashDelete_default = hashDelete;
|
|
11100
|
-
});
|
|
11101
|
-
|
|
11102
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js
|
|
11103
|
-
function hashGet(key) {
|
|
11104
|
-
var data = this.__data__;
|
|
11105
|
-
if (_nativeCreate_default) {
|
|
11106
|
-
var result = data[key];
|
|
11107
|
-
return result === HASH_UNDEFINED ? undefined : result;
|
|
11108
|
-
}
|
|
11109
|
-
return hasOwnProperty3.call(data, key) ? data[key] : undefined;
|
|
11110
|
-
}
|
|
11111
|
-
var HASH_UNDEFINED = "__lodash_hash_undefined__", objectProto4, hasOwnProperty3, _hashGet_default;
|
|
11112
|
-
var init__hashGet = __esm(() => {
|
|
11113
|
-
init__nativeCreate();
|
|
11114
|
-
objectProto4 = Object.prototype;
|
|
11115
|
-
hasOwnProperty3 = objectProto4.hasOwnProperty;
|
|
11116
|
-
_hashGet_default = hashGet;
|
|
11117
|
-
});
|
|
11118
|
-
|
|
11119
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js
|
|
11120
|
-
function hashHas(key) {
|
|
11121
|
-
var data = this.__data__;
|
|
11122
|
-
return _nativeCreate_default ? data[key] !== undefined : hasOwnProperty4.call(data, key);
|
|
11123
|
-
}
|
|
11124
|
-
var objectProto5, hasOwnProperty4, _hashHas_default;
|
|
11125
|
-
var init__hashHas = __esm(() => {
|
|
11126
|
-
init__nativeCreate();
|
|
11127
|
-
objectProto5 = Object.prototype;
|
|
11128
|
-
hasOwnProperty4 = objectProto5.hasOwnProperty;
|
|
11129
|
-
_hashHas_default = hashHas;
|
|
11130
|
-
});
|
|
11131
|
-
|
|
11132
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js
|
|
11133
|
-
function hashSet(key, value) {
|
|
11134
|
-
var data = this.__data__;
|
|
11135
|
-
this.size += this.has(key) ? 0 : 1;
|
|
11136
|
-
data[key] = _nativeCreate_default && value === undefined ? HASH_UNDEFINED2 : value;
|
|
11137
|
-
return this;
|
|
11138
|
-
}
|
|
11139
|
-
var HASH_UNDEFINED2 = "__lodash_hash_undefined__", _hashSet_default;
|
|
11140
|
-
var init__hashSet = __esm(() => {
|
|
11141
|
-
init__nativeCreate();
|
|
11142
|
-
_hashSet_default = hashSet;
|
|
11143
|
-
});
|
|
11144
|
-
|
|
11145
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js
|
|
11146
|
-
function Hash(entries) {
|
|
11147
|
-
var index = -1, length = entries == null ? 0 : entries.length;
|
|
11148
|
-
this.clear();
|
|
11149
|
-
while (++index < length) {
|
|
11150
|
-
var entry = entries[index];
|
|
11151
|
-
this.set(entry[0], entry[1]);
|
|
11152
|
-
}
|
|
11153
|
-
}
|
|
11154
|
-
var _Hash_default;
|
|
11155
|
-
var init__Hash = __esm(() => {
|
|
11156
|
-
init__hashClear();
|
|
11157
|
-
init__hashDelete();
|
|
11158
|
-
init__hashGet();
|
|
11159
|
-
init__hashHas();
|
|
11160
|
-
init__hashSet();
|
|
11161
|
-
Hash.prototype.clear = _hashClear_default;
|
|
11162
|
-
Hash.prototype["delete"] = _hashDelete_default;
|
|
11163
|
-
Hash.prototype.get = _hashGet_default;
|
|
11164
|
-
Hash.prototype.has = _hashHas_default;
|
|
11165
|
-
Hash.prototype.set = _hashSet_default;
|
|
11166
|
-
_Hash_default = Hash;
|
|
11167
|
-
});
|
|
11168
|
-
|
|
11169
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js
|
|
11170
|
-
function listCacheClear() {
|
|
11171
|
-
this.__data__ = [];
|
|
11172
|
-
this.size = 0;
|
|
11173
|
-
}
|
|
11174
|
-
var _listCacheClear_default;
|
|
11175
|
-
var init__listCacheClear = __esm(() => {
|
|
11176
|
-
_listCacheClear_default = listCacheClear;
|
|
11177
|
-
});
|
|
11178
|
-
|
|
11179
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js
|
|
11180
|
-
function eq(value, other) {
|
|
11181
|
-
return value === other || value !== value && other !== other;
|
|
11182
|
-
}
|
|
11183
|
-
var eq_default;
|
|
11184
|
-
var init_eq = __esm(() => {
|
|
11185
|
-
eq_default = eq;
|
|
11186
|
-
});
|
|
11187
|
-
|
|
11188
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js
|
|
11189
|
-
function assocIndexOf(array, key) {
|
|
11190
|
-
var length = array.length;
|
|
11191
|
-
while (length--) {
|
|
11192
|
-
if (eq_default(array[length][0], key)) {
|
|
11193
|
-
return length;
|
|
11194
|
-
}
|
|
11195
|
-
}
|
|
11196
|
-
return -1;
|
|
11197
|
-
}
|
|
11198
|
-
var _assocIndexOf_default;
|
|
11199
|
-
var init__assocIndexOf = __esm(() => {
|
|
11200
|
-
init_eq();
|
|
11201
|
-
_assocIndexOf_default = assocIndexOf;
|
|
11202
|
-
});
|
|
11203
|
-
|
|
11204
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js
|
|
11205
|
-
function listCacheDelete(key) {
|
|
11206
|
-
var data = this.__data__, index = _assocIndexOf_default(data, key);
|
|
11207
|
-
if (index < 0) {
|
|
11208
|
-
return false;
|
|
11209
|
-
}
|
|
11210
|
-
var lastIndex = data.length - 1;
|
|
11211
|
-
if (index == lastIndex) {
|
|
11212
|
-
data.pop();
|
|
11213
|
-
} else {
|
|
11214
|
-
splice.call(data, index, 1);
|
|
11215
|
-
}
|
|
11216
|
-
--this.size;
|
|
11217
|
-
return true;
|
|
11218
|
-
}
|
|
11219
|
-
var arrayProto, splice, _listCacheDelete_default;
|
|
11220
|
-
var init__listCacheDelete = __esm(() => {
|
|
11221
|
-
init__assocIndexOf();
|
|
11222
|
-
arrayProto = Array.prototype;
|
|
11223
|
-
splice = arrayProto.splice;
|
|
11224
|
-
_listCacheDelete_default = listCacheDelete;
|
|
11225
|
-
});
|
|
11226
|
-
|
|
11227
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js
|
|
11228
|
-
function listCacheGet(key) {
|
|
11229
|
-
var data = this.__data__, index = _assocIndexOf_default(data, key);
|
|
11230
|
-
return index < 0 ? undefined : data[index][1];
|
|
11231
|
-
}
|
|
11232
|
-
var _listCacheGet_default;
|
|
11233
|
-
var init__listCacheGet = __esm(() => {
|
|
11234
|
-
init__assocIndexOf();
|
|
11235
|
-
_listCacheGet_default = listCacheGet;
|
|
11236
|
-
});
|
|
11237
|
-
|
|
11238
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js
|
|
11239
|
-
function listCacheHas(key) {
|
|
11240
|
-
return _assocIndexOf_default(this.__data__, key) > -1;
|
|
11241
|
-
}
|
|
11242
|
-
var _listCacheHas_default;
|
|
11243
|
-
var init__listCacheHas = __esm(() => {
|
|
11244
|
-
init__assocIndexOf();
|
|
11245
|
-
_listCacheHas_default = listCacheHas;
|
|
11246
|
-
});
|
|
11247
|
-
|
|
11248
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js
|
|
11249
|
-
function listCacheSet(key, value) {
|
|
11250
|
-
var data = this.__data__, index = _assocIndexOf_default(data, key);
|
|
11251
|
-
if (index < 0) {
|
|
11252
|
-
++this.size;
|
|
11253
|
-
data.push([key, value]);
|
|
11254
|
-
} else {
|
|
11255
|
-
data[index][1] = value;
|
|
11256
|
-
}
|
|
11257
|
-
return this;
|
|
11258
|
-
}
|
|
11259
|
-
var _listCacheSet_default;
|
|
11260
|
-
var init__listCacheSet = __esm(() => {
|
|
11261
|
-
init__assocIndexOf();
|
|
11262
|
-
_listCacheSet_default = listCacheSet;
|
|
11263
|
-
});
|
|
11264
|
-
|
|
11265
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js
|
|
11266
|
-
function ListCache(entries) {
|
|
11267
|
-
var index = -1, length = entries == null ? 0 : entries.length;
|
|
11268
|
-
this.clear();
|
|
11269
|
-
while (++index < length) {
|
|
11270
|
-
var entry = entries[index];
|
|
11271
|
-
this.set(entry[0], entry[1]);
|
|
11272
|
-
}
|
|
11273
|
-
}
|
|
11274
|
-
var _ListCache_default;
|
|
11275
|
-
var init__ListCache = __esm(() => {
|
|
11276
|
-
init__listCacheClear();
|
|
11277
|
-
init__listCacheDelete();
|
|
11278
|
-
init__listCacheGet();
|
|
11279
|
-
init__listCacheHas();
|
|
11280
|
-
init__listCacheSet();
|
|
11281
|
-
ListCache.prototype.clear = _listCacheClear_default;
|
|
11282
|
-
ListCache.prototype["delete"] = _listCacheDelete_default;
|
|
11283
|
-
ListCache.prototype.get = _listCacheGet_default;
|
|
11284
|
-
ListCache.prototype.has = _listCacheHas_default;
|
|
11285
|
-
ListCache.prototype.set = _listCacheSet_default;
|
|
11286
|
-
_ListCache_default = ListCache;
|
|
11287
|
-
});
|
|
11288
|
-
|
|
11289
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js
|
|
11290
|
-
var Map2, _Map_default;
|
|
11291
|
-
var init__Map = __esm(() => {
|
|
11292
|
-
init__getNative();
|
|
11293
|
-
init__root();
|
|
11294
|
-
Map2 = _getNative_default(_root_default, "Map");
|
|
11295
|
-
_Map_default = Map2;
|
|
11296
|
-
});
|
|
11297
|
-
|
|
11298
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js
|
|
11299
|
-
function mapCacheClear() {
|
|
11300
|
-
this.size = 0;
|
|
11301
|
-
this.__data__ = {
|
|
11302
|
-
hash: new _Hash_default,
|
|
11303
|
-
map: new (_Map_default || _ListCache_default),
|
|
11304
|
-
string: new _Hash_default
|
|
11305
|
-
};
|
|
11306
|
-
}
|
|
11307
|
-
var _mapCacheClear_default;
|
|
11308
|
-
var init__mapCacheClear = __esm(() => {
|
|
11309
|
-
init__Hash();
|
|
11310
|
-
init__ListCache();
|
|
11311
|
-
init__Map();
|
|
11312
|
-
_mapCacheClear_default = mapCacheClear;
|
|
11313
|
-
});
|
|
11314
|
-
|
|
11315
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js
|
|
11316
|
-
function isKeyable(value) {
|
|
11317
|
-
var type = typeof value;
|
|
11318
|
-
return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
|
|
11319
|
-
}
|
|
11320
|
-
var _isKeyable_default;
|
|
11321
|
-
var init__isKeyable = __esm(() => {
|
|
11322
|
-
_isKeyable_default = isKeyable;
|
|
11323
|
-
});
|
|
11324
|
-
|
|
11325
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js
|
|
11326
|
-
function getMapData(map, key) {
|
|
11327
|
-
var data = map.__data__;
|
|
11328
|
-
return _isKeyable_default(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
|
|
11329
|
-
}
|
|
11330
|
-
var _getMapData_default;
|
|
11331
|
-
var init__getMapData = __esm(() => {
|
|
11332
|
-
init__isKeyable();
|
|
11333
|
-
_getMapData_default = getMapData;
|
|
11334
|
-
});
|
|
11335
|
-
|
|
11336
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js
|
|
11337
|
-
function mapCacheDelete(key) {
|
|
11338
|
-
var result = _getMapData_default(this, key)["delete"](key);
|
|
11339
|
-
this.size -= result ? 1 : 0;
|
|
11340
|
-
return result;
|
|
11341
|
-
}
|
|
11342
|
-
var _mapCacheDelete_default;
|
|
11343
|
-
var init__mapCacheDelete = __esm(() => {
|
|
11344
|
-
init__getMapData();
|
|
11345
|
-
_mapCacheDelete_default = mapCacheDelete;
|
|
11346
|
-
});
|
|
11347
|
-
|
|
11348
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js
|
|
11349
|
-
function mapCacheGet(key) {
|
|
11350
|
-
return _getMapData_default(this, key).get(key);
|
|
11351
|
-
}
|
|
11352
|
-
var _mapCacheGet_default;
|
|
11353
|
-
var init__mapCacheGet = __esm(() => {
|
|
11354
|
-
init__getMapData();
|
|
11355
|
-
_mapCacheGet_default = mapCacheGet;
|
|
11356
|
-
});
|
|
11357
|
-
|
|
11358
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js
|
|
11359
|
-
function mapCacheHas(key) {
|
|
11360
|
-
return _getMapData_default(this, key).has(key);
|
|
11361
|
-
}
|
|
11362
|
-
var _mapCacheHas_default;
|
|
11363
|
-
var init__mapCacheHas = __esm(() => {
|
|
11364
|
-
init__getMapData();
|
|
11365
|
-
_mapCacheHas_default = mapCacheHas;
|
|
11366
|
-
});
|
|
11367
|
-
|
|
11368
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js
|
|
11369
|
-
function mapCacheSet(key, value) {
|
|
11370
|
-
var data = _getMapData_default(this, key), size = data.size;
|
|
11371
|
-
data.set(key, value);
|
|
11372
|
-
this.size += data.size == size ? 0 : 1;
|
|
11373
|
-
return this;
|
|
11374
|
-
}
|
|
11375
|
-
var _mapCacheSet_default;
|
|
11376
|
-
var init__mapCacheSet = __esm(() => {
|
|
11377
|
-
init__getMapData();
|
|
11378
|
-
_mapCacheSet_default = mapCacheSet;
|
|
11379
|
-
});
|
|
11380
|
-
|
|
11381
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js
|
|
11382
|
-
function MapCache(entries) {
|
|
11383
|
-
var index = -1, length = entries == null ? 0 : entries.length;
|
|
11384
|
-
this.clear();
|
|
11385
|
-
while (++index < length) {
|
|
11386
|
-
var entry = entries[index];
|
|
11387
|
-
this.set(entry[0], entry[1]);
|
|
11388
|
-
}
|
|
11389
|
-
}
|
|
11390
|
-
var _MapCache_default;
|
|
11391
|
-
var init__MapCache = __esm(() => {
|
|
11392
|
-
init__mapCacheClear();
|
|
11393
|
-
init__mapCacheDelete();
|
|
11394
|
-
init__mapCacheGet();
|
|
11395
|
-
init__mapCacheHas();
|
|
11396
|
-
init__mapCacheSet();
|
|
11397
|
-
MapCache.prototype.clear = _mapCacheClear_default;
|
|
11398
|
-
MapCache.prototype["delete"] = _mapCacheDelete_default;
|
|
11399
|
-
MapCache.prototype.get = _mapCacheGet_default;
|
|
11400
|
-
MapCache.prototype.has = _mapCacheHas_default;
|
|
11401
|
-
MapCache.prototype.set = _mapCacheSet_default;
|
|
11402
|
-
_MapCache_default = MapCache;
|
|
11403
|
-
});
|
|
11404
|
-
|
|
11405
|
-
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/memoize.js
|
|
11406
|
-
function memoize(func, resolver) {
|
|
11407
|
-
if (typeof func != "function" || resolver != null && typeof resolver != "function") {
|
|
11408
|
-
throw new TypeError(FUNC_ERROR_TEXT);
|
|
11409
|
-
}
|
|
11410
|
-
var memoized = function() {
|
|
11411
|
-
var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
|
|
11412
|
-
if (cache.has(key)) {
|
|
11413
|
-
return cache.get(key);
|
|
11414
|
-
}
|
|
11415
|
-
var result = func.apply(this, args);
|
|
11416
|
-
memoized.cache = cache.set(key, result) || cache;
|
|
11417
|
-
return result;
|
|
11418
|
-
};
|
|
11419
|
-
memoized.cache = new (memoize.Cache || _MapCache_default);
|
|
11420
|
-
return memoized;
|
|
11421
|
-
}
|
|
11422
|
-
var FUNC_ERROR_TEXT = "Expected a function", memoize_default;
|
|
11423
|
-
var init_memoize = __esm(() => {
|
|
11424
|
-
init__MapCache();
|
|
11425
|
-
memoize.Cache = _MapCache_default;
|
|
11426
|
-
memoize_default = memoize;
|
|
11427
|
-
});
|
|
11428
|
-
|
|
11429
11587
|
// node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayMap.js
|
|
11430
11588
|
function arrayMap(array, iteratee) {
|
|
11431
11589
|
var index = -1, length = array == null ? 0 : array.length, result = Array(length);
|
|
@@ -16136,69 +16294,6 @@ var init_debugFilter = __esm(() => {
|
|
|
16136
16294
|
});
|
|
16137
16295
|
});
|
|
16138
16296
|
|
|
16139
|
-
// src/constants/branding.ts
|
|
16140
|
-
var PRODUCT_URL = "https://costrict.ai", PRODUCT_DOMAIN = "costrict.ai", PRODUCT_DOCS_URL, PRODUCT_CHROME_URL, PRODUCT_SETTINGS_URL, PRODUCT_CODE_URL, PRODUCT_SESSION_URL, PRODUCT_UPGRADE_URL, PRODUCT_DOWNLOAD_URL, PRODUCT_DESKTOP_API_URL, PRODUCT_OAUTH_CLIENT_METADATA_URL, CONFIG_DIR_NAME = ".costrict", LEGACY_CONFIG_DIR_NAME = ".claude", ENV_PREFIX = "COSTRICT", LEGACY_ENV_PREFIX = "CLAUDE_CODE", LEGACY_BRIDGE_ENV_PREFIX = "CLAUDE";
|
|
16141
|
-
var init_branding = __esm(() => {
|
|
16142
|
-
PRODUCT_DOCS_URL = `${PRODUCT_URL}/docs`;
|
|
16143
|
-
PRODUCT_CHROME_URL = `${PRODUCT_URL}/chrome`;
|
|
16144
|
-
PRODUCT_SETTINGS_URL = `${PRODUCT_URL}/settings`;
|
|
16145
|
-
PRODUCT_CODE_URL = `${PRODUCT_URL}/code`;
|
|
16146
|
-
PRODUCT_SESSION_URL = `${PRODUCT_URL}/session`;
|
|
16147
|
-
PRODUCT_UPGRADE_URL = `${PRODUCT_URL}/upgrade/max`;
|
|
16148
|
-
PRODUCT_DOWNLOAD_URL = `${PRODUCT_URL}/download`;
|
|
16149
|
-
PRODUCT_DESKTOP_API_URL = `${PRODUCT_URL}/api/desktop`;
|
|
16150
|
-
PRODUCT_OAUTH_CLIENT_METADATA_URL = `${PRODUCT_URL}/oauth/costrict-client-metadata`;
|
|
16151
|
-
});
|
|
16152
|
-
|
|
16153
|
-
// src/utils/envUtils.ts
|
|
16154
|
-
import { homedir as homedir2 } from "os";
|
|
16155
|
-
import { join as join3 } from "path";
|
|
16156
|
-
function getLegacyConfigHomeDir() {
|
|
16157
|
-
if (process.env.COSTRICT_CONFIG_DIR || process.env.CLAUDE_CONFIG_DIR) {
|
|
16158
|
-
return;
|
|
16159
|
-
}
|
|
16160
|
-
return join3(homedir2(), LEGACY_CONFIG_DIR_NAME).normalize("NFC");
|
|
16161
|
-
}
|
|
16162
|
-
function hasNodeOption(flag) {
|
|
16163
|
-
const nodeOptions = process.env.NODE_OPTIONS;
|
|
16164
|
-
if (!nodeOptions) {
|
|
16165
|
-
return false;
|
|
16166
|
-
}
|
|
16167
|
-
return nodeOptions.split(/\s+/u).includes(flag);
|
|
16168
|
-
}
|
|
16169
|
-
function isEnvTruthy(envVar) {
|
|
16170
|
-
if (!envVar)
|
|
16171
|
-
return false;
|
|
16172
|
-
if (typeof envVar === "boolean")
|
|
16173
|
-
return envVar;
|
|
16174
|
-
const normalizedValue = envVar.toLowerCase().trim();
|
|
16175
|
-
return ["1", "true", "yes", "on"].includes(normalizedValue);
|
|
16176
|
-
}
|
|
16177
|
-
function getCostrictEnv(suffix) {
|
|
16178
|
-
return process.env[`${ENV_PREFIX}_${suffix}`] ?? process.env[`${LEGACY_ENV_PREFIX}_${suffix}`] ?? process.env[`${LEGACY_BRIDGE_ENV_PREFIX}_${suffix}`];
|
|
16179
|
-
}
|
|
16180
|
-
function isCostrictEnvTruthy(suffix) {
|
|
16181
|
-
return isEnvTruthy(getCostrictEnv(suffix));
|
|
16182
|
-
}
|
|
16183
|
-
function isBareMode() {
|
|
16184
|
-
return isEnvTruthy(process.env.COSTRICT_SIMPLE) || isEnvTruthy(process.env.CLAUDE_CODE_SIMPLE) || process.argv.includes("--bare");
|
|
16185
|
-
}
|
|
16186
|
-
function getAWSRegion() {
|
|
16187
|
-
return process.env.AWS_REGION || process.env.AWS_DEFAULT_REGION || "us-east-1";
|
|
16188
|
-
}
|
|
16189
|
-
function isRunningOnHomespace() {
|
|
16190
|
-
return process.env.USER_TYPE === "sf" && isEnvTruthy(process.env.COO_RUNNING_ON_HOMESPACE);
|
|
16191
|
-
}
|
|
16192
|
-
var getCostrictConfigHomeDir, getClaudeConfigHomeDir;
|
|
16193
|
-
var init_envUtils = __esm(() => {
|
|
16194
|
-
init_memoize();
|
|
16195
|
-
init_branding();
|
|
16196
|
-
getCostrictConfigHomeDir = memoize_default(() => {
|
|
16197
|
-
return (process.env.COSTRICT_CONFIG_DIR ?? process.env.CLAUDE_CONFIG_DIR ?? join3(homedir2(), CONFIG_DIR_NAME)).normalize("NFC");
|
|
16198
|
-
}, () => process.env.COSTRICT_CONFIG_DIR ?? process.env.CLAUDE_CONFIG_DIR);
|
|
16199
|
-
getClaudeConfigHomeDir = getCostrictConfigHomeDir;
|
|
16200
|
-
});
|
|
16201
|
-
|
|
16202
16297
|
// node_modules/.bun/@anthropic-ai+sdk@0.80.0+68a1e3a0c4588df3/node_modules/@anthropic-ai/sdk/internal/tslib.mjs
|
|
16203
16298
|
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
16204
16299
|
if (kind === "m")
|
|
@@ -20878,7 +20973,7 @@ function writeToStderr(data) {
|
|
|
20878
20973
|
|
|
20879
20974
|
// src/utils/debug.ts
|
|
20880
20975
|
import { appendFile, mkdir, symlink, unlink } from "fs/promises";
|
|
20881
|
-
import { dirname, join as
|
|
20976
|
+
import { dirname, join as join5 } from "path";
|
|
20882
20977
|
function shouldLogDebugMessage(message) {
|
|
20883
20978
|
if (false) {}
|
|
20884
20979
|
if (process.env.USER_TYPE !== "sf" && !isDebugMode()) {
|
|
@@ -20953,7 +21048,7 @@ function logForDebugging(message, { level } = {
|
|
|
20953
21048
|
getDebugWriter().write(output);
|
|
20954
21049
|
}
|
|
20955
21050
|
function getDebugLogPath() {
|
|
20956
|
-
return getDebugFilePath() ?? process.env.CLAUDE_CODE_DEBUG_LOGS_DIR ??
|
|
21051
|
+
return getDebugFilePath() ?? process.env.CLAUDE_CODE_DEBUG_LOGS_DIR ?? join5(getClaudeConfigHomeDir(), "debug", `${getSessionId()}.txt`);
|
|
20957
21052
|
}
|
|
20958
21053
|
function logAntError(context, error2) {
|
|
20959
21054
|
if (process.env.USER_TYPE !== "sf") {
|
|
@@ -21020,7 +21115,7 @@ var init_debug = __esm(() => {
|
|
|
21020
21115
|
try {
|
|
21021
21116
|
const debugLogPath = getDebugLogPath();
|
|
21022
21117
|
const debugLogsDir = dirname(debugLogPath);
|
|
21023
|
-
const latestSymlinkPath =
|
|
21118
|
+
const latestSymlinkPath = join5(debugLogsDir, "latest");
|
|
21024
21119
|
await unlink(latestSymlinkPath).catch(() => {});
|
|
21025
21120
|
await symlink(debugLogPath, latestSymlinkPath);
|
|
21026
21121
|
} catch {}
|
|
@@ -31799,12 +31894,12 @@ var require_form_data = __commonJS((exports, module) => {
|
|
|
31799
31894
|
if (value.end != null && value.end != Infinity && value.start != null) {
|
|
31800
31895
|
callback(null, value.end + 1 - (value.start ? value.start : 0));
|
|
31801
31896
|
} else {
|
|
31802
|
-
fs5.stat(value.path, function(err,
|
|
31897
|
+
fs5.stat(value.path, function(err, stat4) {
|
|
31803
31898
|
if (err) {
|
|
31804
31899
|
callback(err);
|
|
31805
31900
|
return;
|
|
31806
31901
|
}
|
|
31807
|
-
var fileSize =
|
|
31902
|
+
var fileSize = stat4.size - (value.start ? value.start : 0);
|
|
31808
31903
|
callback(null, fileSize);
|
|
31809
31904
|
});
|
|
31810
31905
|
}
|
|
@@ -33147,7 +33242,7 @@ __export(exports_supports_color, {
|
|
|
33147
33242
|
createSupportsColor: () => createSupportsColor
|
|
33148
33243
|
});
|
|
33149
33244
|
import process2 from "process";
|
|
33150
|
-
import
|
|
33245
|
+
import os from "os";
|
|
33151
33246
|
import tty from "tty";
|
|
33152
33247
|
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
|
|
33153
33248
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
@@ -33213,7 +33308,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
33213
33308
|
return min;
|
|
33214
33309
|
}
|
|
33215
33310
|
if (process2.platform === "win32") {
|
|
33216
|
-
const osRelease =
|
|
33311
|
+
const osRelease = os.release().split(".");
|
|
33217
33312
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
33218
33313
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
33219
33314
|
}
|
|
@@ -33470,7 +33565,7 @@ var require_src = __commonJS((exports, module) => {
|
|
|
33470
33565
|
// node_modules/.bun/agent-base@6.0.2/node_modules/agent-base/dist/src/promisify.js
|
|
33471
33566
|
var require_promisify = __commonJS((exports) => {
|
|
33472
33567
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33473
|
-
function
|
|
33568
|
+
function promisify2(fn) {
|
|
33474
33569
|
return function(req, opts) {
|
|
33475
33570
|
return new Promise((resolve, reject) => {
|
|
33476
33571
|
fn.call(this, req, opts, (err, rtn) => {
|
|
@@ -33483,7 +33578,7 @@ var require_promisify = __commonJS((exports) => {
|
|
|
33483
33578
|
});
|
|
33484
33579
|
};
|
|
33485
33580
|
}
|
|
33486
|
-
exports.default =
|
|
33581
|
+
exports.default = promisify2;
|
|
33487
33582
|
});
|
|
33488
33583
|
|
|
33489
33584
|
// node_modules/.bun/agent-base@6.0.2/node_modules/agent-base/dist/src/index.js
|
|
@@ -37696,7 +37791,7 @@ var init_ansi_styles = __esm(() => {
|
|
|
37696
37791
|
|
|
37697
37792
|
// node_modules/.bun/chalk@5.6.2/node_modules/chalk/source/vendor/supports-color/index.js
|
|
37698
37793
|
import process3 from "process";
|
|
37699
|
-
import
|
|
37794
|
+
import os2 from "os";
|
|
37700
37795
|
import tty2 from "tty";
|
|
37701
37796
|
function hasFlag2(flag, argv = globalThis.Deno ? globalThis.Deno.args : process3.argv) {
|
|
37702
37797
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
@@ -37754,7 +37849,7 @@ function _supportsColor2(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
37754
37849
|
return min;
|
|
37755
37850
|
}
|
|
37756
37851
|
if (process3.platform === "win32") {
|
|
37757
|
-
const osRelease =
|
|
37852
|
+
const osRelease = os2.release().split(".");
|
|
37758
37853
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
37759
37854
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
37760
37855
|
}
|
|
@@ -38876,15 +38971,15 @@ var require_windows = __commonJS((exports, module) => {
|
|
|
38876
38971
|
}
|
|
38877
38972
|
return false;
|
|
38878
38973
|
}
|
|
38879
|
-
function checkStat(
|
|
38880
|
-
if (!
|
|
38974
|
+
function checkStat(stat4, path6, options) {
|
|
38975
|
+
if (!stat4.isSymbolicLink() && !stat4.isFile()) {
|
|
38881
38976
|
return false;
|
|
38882
38977
|
}
|
|
38883
38978
|
return checkPathExt(path6, options);
|
|
38884
38979
|
}
|
|
38885
38980
|
function isexe(path6, options, cb) {
|
|
38886
|
-
fs5.stat(path6, function(er,
|
|
38887
|
-
cb(er, er ? false : checkStat(
|
|
38981
|
+
fs5.stat(path6, function(er, stat4) {
|
|
38982
|
+
cb(er, er ? false : checkStat(stat4, path6, options));
|
|
38888
38983
|
});
|
|
38889
38984
|
}
|
|
38890
38985
|
function sync(path6, options) {
|
|
@@ -38898,20 +38993,20 @@ var require_mode = __commonJS((exports, module) => {
|
|
|
38898
38993
|
isexe.sync = sync;
|
|
38899
38994
|
var fs5 = __require("fs");
|
|
38900
38995
|
function isexe(path6, options, cb) {
|
|
38901
|
-
fs5.stat(path6, function(er,
|
|
38902
|
-
cb(er, er ? false : checkStat(
|
|
38996
|
+
fs5.stat(path6, function(er, stat4) {
|
|
38997
|
+
cb(er, er ? false : checkStat(stat4, options));
|
|
38903
38998
|
});
|
|
38904
38999
|
}
|
|
38905
39000
|
function sync(path6, options) {
|
|
38906
39001
|
return checkStat(fs5.statSync(path6), options);
|
|
38907
39002
|
}
|
|
38908
|
-
function checkStat(
|
|
38909
|
-
return
|
|
39003
|
+
function checkStat(stat4, options) {
|
|
39004
|
+
return stat4.isFile() && checkMode(stat4, options);
|
|
38910
39005
|
}
|
|
38911
|
-
function checkMode(
|
|
38912
|
-
var mod =
|
|
38913
|
-
var uid =
|
|
38914
|
-
var gid =
|
|
39006
|
+
function checkMode(stat4, options) {
|
|
39007
|
+
var mod = stat4.mode;
|
|
39008
|
+
var uid = stat4.uid;
|
|
39009
|
+
var gid = stat4.gid;
|
|
38915
39010
|
var myUid = options.uid !== undefined ? options.uid : process.getuid && process.getuid();
|
|
38916
39011
|
var myGid = options.gid !== undefined ? options.gid : process.getgid && process.getgid();
|
|
38917
39012
|
var u = parseInt("100", 8);
|
|
@@ -39323,7 +39418,7 @@ function pathKey(options = {}) {
|
|
|
39323
39418
|
}
|
|
39324
39419
|
|
|
39325
39420
|
// node_modules/.bun/unicorn-magic@0.3.0/node_modules/unicorn-magic/node.js
|
|
39326
|
-
import { promisify } from "util";
|
|
39421
|
+
import { promisify as promisify2 } from "util";
|
|
39327
39422
|
import { execFile as execFileCallback, execFileSync as execFileSyncOriginal } from "child_process";
|
|
39328
39423
|
import path6 from "path";
|
|
39329
39424
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
@@ -39345,7 +39440,7 @@ function traversePathUp(startPath) {
|
|
|
39345
39440
|
}
|
|
39346
39441
|
var execFileOriginal, TEN_MEGABYTES_IN_BYTES;
|
|
39347
39442
|
var init_node2 = __esm(() => {
|
|
39348
|
-
execFileOriginal =
|
|
39443
|
+
execFileOriginal = promisify2(execFileCallback);
|
|
39349
39444
|
TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;
|
|
39350
39445
|
});
|
|
39351
39446
|
|
|
@@ -40288,7 +40383,7 @@ var init_outgoing = __esm(() => {
|
|
|
40288
40383
|
});
|
|
40289
40384
|
|
|
40290
40385
|
// node_modules/.bun/execa@9.6.1/node_modules/execa/lib/ipc/send.js
|
|
40291
|
-
import { promisify as
|
|
40386
|
+
import { promisify as promisify3 } from "util";
|
|
40292
40387
|
var sendMessage = ({ anyProcess, channel, isSubprocess, ipc }, message, { strict = false } = {}) => {
|
|
40293
40388
|
const methodName = "sendMessage";
|
|
40294
40389
|
validateIpcMethod({
|
|
@@ -40349,7 +40444,7 @@ var sendMessage = ({ anyProcess, channel, isSubprocess, ipc }, message, { strict
|
|
|
40349
40444
|
if (PROCESS_SEND_METHODS.has(anyProcess)) {
|
|
40350
40445
|
return PROCESS_SEND_METHODS.get(anyProcess);
|
|
40351
40446
|
}
|
|
40352
|
-
const sendMethod =
|
|
40447
|
+
const sendMethod = promisify3(anyProcess.send.bind(anyProcess));
|
|
40353
40448
|
PROCESS_SEND_METHODS.set(anyProcess, sendMethod);
|
|
40354
40449
|
return sendMethod;
|
|
40355
40450
|
}, PROCESS_SEND_METHODS;
|
|
@@ -40740,10 +40835,10 @@ function stripFinalNewline(input) {
|
|
|
40740
40835
|
}
|
|
40741
40836
|
return stripFinalNewlineBinary(input);
|
|
40742
40837
|
}
|
|
40743
|
-
var stripFinalNewlineString = (input) => input.at(-1) ===
|
|
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 = `
|
|
40744
40839
|
`, LF_BINARY, CR = "\r", CR_BINARY;
|
|
40745
40840
|
var init_strip_final_newline = __esm(() => {
|
|
40746
|
-
LF_BINARY =
|
|
40841
|
+
LF_BINARY = LF2.codePointAt(0);
|
|
40747
40842
|
CR_BINARY = CR.codePointAt(0);
|
|
40748
40843
|
});
|
|
40749
40844
|
|
|
@@ -42399,8 +42494,8 @@ var getSplitLinesGenerator = (binary, preserveNewlines, skipped, state) => binar
|
|
|
42399
42494
|
yield previousChunks;
|
|
42400
42495
|
}
|
|
42401
42496
|
}, getAppendNewlineGenerator = ({ binary, preserveNewlines, readableObjectMode, state }) => binary || preserveNewlines || readableObjectMode ? undefined : { transform: appendNewlineGenerator.bind(undefined, state) }, appendNewlineGenerator = function* ({ isWindowsNewline = false }, chunk) {
|
|
42402
|
-
const { unixNewline, windowsNewline, LF:
|
|
42403
|
-
if (chunk.at(-1) ===
|
|
42497
|
+
const { unixNewline, windowsNewline, LF: LF3, concatBytes: concatBytes2 } = typeof chunk === "string" ? linesStringInfo : linesUint8ArrayInfo;
|
|
42498
|
+
if (chunk.at(-1) === LF3) {
|
|
42404
42499
|
yield chunk;
|
|
42405
42500
|
return;
|
|
42406
42501
|
}
|
|
@@ -45245,7 +45340,7 @@ var init_is_safe_filename = __esm(() => {
|
|
|
45245
45340
|
|
|
45246
45341
|
// node_modules/.bun/env-paths@4.0.0/node_modules/env-paths/index.js
|
|
45247
45342
|
import path11 from "path";
|
|
45248
|
-
import
|
|
45343
|
+
import os3 from "os";
|
|
45249
45344
|
import process12 from "process";
|
|
45250
45345
|
function envPaths(name, { suffix = "nodejs" } = {}) {
|
|
45251
45346
|
assertSafeFilename(name);
|
|
@@ -45292,20 +45387,11 @@ var homedir3, tmpdir, env3, macos = (name) => {
|
|
|
45292
45387
|
};
|
|
45293
45388
|
var init_env_paths = __esm(() => {
|
|
45294
45389
|
init_is_safe_filename();
|
|
45295
|
-
homedir3 =
|
|
45296
|
-
tmpdir =
|
|
45390
|
+
homedir3 = os3.homedir();
|
|
45391
|
+
tmpdir = os3.tmpdir();
|
|
45297
45392
|
({ env: env3 } = process12);
|
|
45298
45393
|
});
|
|
45299
45394
|
|
|
45300
|
-
// src/utils/hash.ts
|
|
45301
|
-
function djb2Hash(str) {
|
|
45302
|
-
let hash2 = 0;
|
|
45303
|
-
for (let i2 = 0;i2 < str.length; i2++) {
|
|
45304
|
-
hash2 = (hash2 << 5) - hash2 + str.charCodeAt(i2) | 0;
|
|
45305
|
-
}
|
|
45306
|
-
return hash2;
|
|
45307
|
-
}
|
|
45308
|
-
|
|
45309
45395
|
// src/utils/cachePaths.ts
|
|
45310
45396
|
var paths;
|
|
45311
45397
|
var init_cachePaths = __esm(() => {
|
|
@@ -60475,9 +60561,9 @@ function stripBOM2(content) {
|
|
|
60475
60561
|
var UTF8_BOM = "\uFEFF";
|
|
60476
60562
|
|
|
60477
60563
|
// src/services/remoteManagedSettings/syncCacheState.ts
|
|
60478
|
-
import { join as
|
|
60564
|
+
import { join as join6 } from "path";
|
|
60479
60565
|
function getSettingsPath() {
|
|
60480
|
-
return
|
|
60566
|
+
return join6(getClaudeConfigHomeDir(), SETTINGS_FILENAME);
|
|
60481
60567
|
}
|
|
60482
60568
|
function loadSettings() {
|
|
60483
60569
|
try {
|
|
@@ -60633,7 +60719,7 @@ var init_fileReadCache = __esm(() => {
|
|
|
60633
60719
|
});
|
|
60634
60720
|
|
|
60635
60721
|
// src/utils/platform.ts
|
|
60636
|
-
import { readdir, readFile } from "fs/promises";
|
|
60722
|
+
import { readdir as readdir2, readFile } from "fs/promises";
|
|
60637
60723
|
import { release as osRelease } from "os";
|
|
60638
60724
|
async function detectVcs(dir) {
|
|
60639
60725
|
const detected = new Set;
|
|
@@ -60642,7 +60728,7 @@ async function detectVcs(dir) {
|
|
|
60642
60728
|
}
|
|
60643
60729
|
try {
|
|
60644
60730
|
const targetDir = dir ?? getFsImplementation().cwd();
|
|
60645
|
-
const entries = new Set(await
|
|
60731
|
+
const entries = new Set(await readdir2(targetDir));
|
|
60646
60732
|
for (const [marker, vcs] of VCS_MARKERS) {
|
|
60647
60733
|
if (entries.has(marker)) {
|
|
60648
60734
|
detected.add(vcs);
|
|
@@ -61573,42 +61659,11 @@ var init_windowsPaths = __esm(() => {
|
|
|
61573
61659
|
}, (p) => p, 500);
|
|
61574
61660
|
});
|
|
61575
61661
|
|
|
61576
|
-
// src/utils/getWorktreePathsPortable.ts
|
|
61577
|
-
import { execFile as execFileCb } from "child_process";
|
|
61578
|
-
import { promisify as promisify3 } from "util";
|
|
61579
|
-
var execFileAsync;
|
|
61580
|
-
var init_getWorktreePathsPortable = __esm(() => {
|
|
61581
|
-
execFileAsync = promisify3(execFileCb);
|
|
61582
|
-
});
|
|
61583
|
-
|
|
61584
|
-
// src/utils/sessionStoragePortable.ts
|
|
61585
|
-
function simpleHash(str) {
|
|
61586
|
-
return Math.abs(djb2Hash(str)).toString(36);
|
|
61587
|
-
}
|
|
61588
|
-
function sanitizePath(name) {
|
|
61589
|
-
const sanitized = name.replace(/[^a-zA-Z0-9]/g, "-");
|
|
61590
|
-
if (sanitized.length <= MAX_SANITIZED_LENGTH) {
|
|
61591
|
-
return sanitized;
|
|
61592
|
-
}
|
|
61593
|
-
const hash3 = typeof Bun !== "undefined" ? Bun.hash(name).toString(36) : simpleHash(name);
|
|
61594
|
-
return `${sanitized.slice(0, MAX_SANITIZED_LENGTH)}-${hash3}`;
|
|
61595
|
-
}
|
|
61596
|
-
var MAX_SANITIZED_LENGTH = 200, TRANSCRIPT_READ_CHUNK_SIZE, SKIP_PRECOMPACT_THRESHOLD, ATTR_SNAP_PREFIX, SYSTEM_PREFIX, LF2 = 10, LF_BYTE;
|
|
61597
|
-
var init_sessionStoragePortable = __esm(() => {
|
|
61598
|
-
init_envUtils();
|
|
61599
|
-
init_getWorktreePathsPortable();
|
|
61600
|
-
TRANSCRIPT_READ_CHUNK_SIZE = 1024 * 1024;
|
|
61601
|
-
SKIP_PRECOMPACT_THRESHOLD = 5 * 1024 * 1024;
|
|
61602
|
-
ATTR_SNAP_PREFIX = Buffer.from('{"type":"attribution-snapshot"');
|
|
61603
|
-
SYSTEM_PREFIX = Buffer.from('{"type":"system"');
|
|
61604
|
-
LF_BYTE = Buffer.from([LF2]);
|
|
61605
|
-
});
|
|
61606
|
-
|
|
61607
61662
|
// src/utils/path.ts
|
|
61608
61663
|
import {
|
|
61609
61664
|
dirname as dirname4,
|
|
61610
61665
|
isAbsolute,
|
|
61611
|
-
join as
|
|
61666
|
+
join as join8,
|
|
61612
61667
|
normalize,
|
|
61613
61668
|
posix,
|
|
61614
61669
|
relative,
|
|
@@ -61633,7 +61688,7 @@ import {
|
|
|
61633
61688
|
dirname as dirname5,
|
|
61634
61689
|
extname,
|
|
61635
61690
|
isAbsolute as isAbsolute2,
|
|
61636
|
-
join as
|
|
61691
|
+
join as join9,
|
|
61637
61692
|
normalize as normalize2,
|
|
61638
61693
|
relative as relative2,
|
|
61639
61694
|
resolve as resolve3,
|
|
@@ -61740,6 +61795,15 @@ var init_file = __esm(() => {
|
|
|
61740
61795
|
MAX_OUTPUT_SIZE = 0.25 * 1024 * 1024;
|
|
61741
61796
|
});
|
|
61742
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
|
+
|
|
61743
61807
|
// src/utils/execFileNoThrowPortable.ts
|
|
61744
61808
|
function execSyncWithDefaults_DEPRECATED(command, optionsOrAbortSignal, timeout = 10 * SECONDS_IN_MINUTE * MS_IN_SECOND) {
|
|
61745
61809
|
let options;
|
|
@@ -61828,7 +61892,7 @@ function execFileNoThrowWithCwd(file2, args, {
|
|
|
61828
61892
|
preserveOutputOnError: true,
|
|
61829
61893
|
maxBuffer: 1e6
|
|
61830
61894
|
}) {
|
|
61831
|
-
return new Promise((
|
|
61895
|
+
return new Promise((resolve5) => {
|
|
61832
61896
|
execa(file2, args, {
|
|
61833
61897
|
maxBuffer,
|
|
61834
61898
|
cancelSignal: abortSignal,
|
|
@@ -61843,17 +61907,17 @@ function execFileNoThrowWithCwd(file2, args, {
|
|
|
61843
61907
|
if (result.failed) {
|
|
61844
61908
|
if (finalPreserveOutput) {
|
|
61845
61909
|
const errorCode = result.exitCode ?? 1;
|
|
61846
|
-
|
|
61910
|
+
resolve5({
|
|
61847
61911
|
stdout: result.stdout || "",
|
|
61848
61912
|
stderr: result.stderr || "",
|
|
61849
61913
|
code: errorCode,
|
|
61850
61914
|
error: getErrorMessage(result, errorCode)
|
|
61851
61915
|
});
|
|
61852
61916
|
} else {
|
|
61853
|
-
|
|
61917
|
+
resolve5({ stdout: "", stderr: "", code: result.exitCode ?? 1 });
|
|
61854
61918
|
}
|
|
61855
61919
|
} else {
|
|
61856
|
-
|
|
61920
|
+
resolve5({
|
|
61857
61921
|
stdout: result.stdout,
|
|
61858
61922
|
stderr: result.stderr,
|
|
61859
61923
|
code: 0
|
|
@@ -61861,7 +61925,7 @@ function execFileNoThrowWithCwd(file2, args, {
|
|
|
61861
61925
|
}
|
|
61862
61926
|
}).catch((error52) => {
|
|
61863
61927
|
logError2(error52);
|
|
61864
|
-
|
|
61928
|
+
resolve5({ stdout: "", stderr: "", code: 1 });
|
|
61865
61929
|
});
|
|
61866
61930
|
});
|
|
61867
61931
|
}
|
|
@@ -61979,10 +62043,10 @@ var init_gitConfigParser = () => {};
|
|
|
61979
62043
|
|
|
61980
62044
|
// src/utils/git/gitFilesystem.ts
|
|
61981
62045
|
import { unwatchFile, watchFile } from "fs";
|
|
61982
|
-
import { readdir as
|
|
61983
|
-
import { join as
|
|
62046
|
+
import { readdir as readdir3, readFile as readFile2, stat as stat4 } from "fs/promises";
|
|
62047
|
+
import { join as join11, resolve as resolve5 } from "path";
|
|
61984
62048
|
async function resolveGitDir(startPath) {
|
|
61985
|
-
const cwd2 =
|
|
62049
|
+
const cwd2 = resolve5(startPath ?? getCwd());
|
|
61986
62050
|
const cached3 = resolveGitDirCache.get(cwd2);
|
|
61987
62051
|
if (cached3 !== undefined) {
|
|
61988
62052
|
return cached3;
|
|
@@ -61992,14 +62056,14 @@ async function resolveGitDir(startPath) {
|
|
|
61992
62056
|
resolveGitDirCache.set(cwd2, null);
|
|
61993
62057
|
return null;
|
|
61994
62058
|
}
|
|
61995
|
-
const gitPath =
|
|
62059
|
+
const gitPath = join11(root2, ".git");
|
|
61996
62060
|
try {
|
|
61997
|
-
const st = await
|
|
62061
|
+
const st = await stat4(gitPath);
|
|
61998
62062
|
if (st.isFile()) {
|
|
61999
62063
|
const content = (await readFile2(gitPath, "utf-8")).trim();
|
|
62000
62064
|
if (content.startsWith("gitdir:")) {
|
|
62001
62065
|
const rawDir = content.slice("gitdir:".length).trim();
|
|
62002
|
-
const resolved =
|
|
62066
|
+
const resolved = resolve5(root2, rawDir);
|
|
62003
62067
|
resolveGitDirCache.set(cwd2, resolved);
|
|
62004
62068
|
return resolved;
|
|
62005
62069
|
}
|
|
@@ -62031,7 +62095,7 @@ function isValidGitSha(s) {
|
|
|
62031
62095
|
}
|
|
62032
62096
|
async function readGitHead(gitDir) {
|
|
62033
62097
|
try {
|
|
62034
|
-
const content = (await readFile2(
|
|
62098
|
+
const content = (await readFile2(join11(gitDir, "HEAD"), "utf-8")).trim();
|
|
62035
62099
|
if (content.startsWith("ref:")) {
|
|
62036
62100
|
const ref = content.slice("ref:".length).trim();
|
|
62037
62101
|
if (ref.startsWith("refs/heads/")) {
|
|
@@ -62068,7 +62132,7 @@ async function resolveRef2(gitDir, ref) {
|
|
|
62068
62132
|
}
|
|
62069
62133
|
async function resolveRefInDir(dir, ref) {
|
|
62070
62134
|
try {
|
|
62071
|
-
const content = (await readFile2(
|
|
62135
|
+
const content = (await readFile2(join11(dir, ref), "utf-8")).trim();
|
|
62072
62136
|
if (content.startsWith("ref:")) {
|
|
62073
62137
|
const target = content.slice("ref:".length).trim();
|
|
62074
62138
|
if (!isSafeRefName(target)) {
|
|
@@ -62082,7 +62146,7 @@ async function resolveRefInDir(dir, ref) {
|
|
|
62082
62146
|
return content;
|
|
62083
62147
|
} catch {}
|
|
62084
62148
|
try {
|
|
62085
|
-
const packed = await readFile2(
|
|
62149
|
+
const packed = await readFile2(join11(dir, "packed-refs"), "utf-8");
|
|
62086
62150
|
for (const line of packed.split(`
|
|
62087
62151
|
`)) {
|
|
62088
62152
|
if (line.startsWith("#") || line.startsWith("^")) {
|
|
@@ -62102,8 +62166,8 @@ async function resolveRefInDir(dir, ref) {
|
|
|
62102
62166
|
}
|
|
62103
62167
|
async function getCommonDir(gitDir) {
|
|
62104
62168
|
try {
|
|
62105
|
-
const content = (await readFile2(
|
|
62106
|
-
return
|
|
62169
|
+
const content = (await readFile2(join11(gitDir, "commondir"), "utf-8")).trim();
|
|
62170
|
+
return resolve5(gitDir, content);
|
|
62107
62171
|
} catch {
|
|
62108
62172
|
return null;
|
|
62109
62173
|
}
|
|
@@ -62134,10 +62198,10 @@ class GitFileWatcher {
|
|
|
62134
62198
|
return;
|
|
62135
62199
|
}
|
|
62136
62200
|
this.commonDir = await getCommonDir(this.gitDir);
|
|
62137
|
-
this.watchPath(
|
|
62201
|
+
this.watchPath(join11(this.gitDir, "HEAD"), () => {
|
|
62138
62202
|
this.onHeadChanged();
|
|
62139
62203
|
});
|
|
62140
|
-
this.watchPath(
|
|
62204
|
+
this.watchPath(join11(this.commonDir ?? this.gitDir, "config"), () => {
|
|
62141
62205
|
this.invalidate();
|
|
62142
62206
|
});
|
|
62143
62207
|
await this.watchCurrentBranchRef();
|
|
@@ -62155,7 +62219,7 @@ class GitFileWatcher {
|
|
|
62155
62219
|
}
|
|
62156
62220
|
const head = await readGitHead(this.gitDir);
|
|
62157
62221
|
const refsDir = this.commonDir ?? this.gitDir;
|
|
62158
|
-
const refPath = head?.type === "branch" ?
|
|
62222
|
+
const refPath = head?.type === "branch" ? join11(refsDir, "refs", "heads", head.name) : null;
|
|
62159
62223
|
if (refPath === this.branchRefPath) {
|
|
62160
62224
|
return;
|
|
62161
62225
|
}
|
|
@@ -62284,7 +62348,7 @@ var init_which = __esm(() => {
|
|
|
62284
62348
|
|
|
62285
62349
|
// src/utils/git.ts
|
|
62286
62350
|
import { readFileSync as readFileSync7, realpathSync as realpathSync3, statSync as statSync3 } from "fs";
|
|
62287
|
-
import { basename as basename2, dirname as dirname6, join as
|
|
62351
|
+
import { basename as basename2, dirname as dirname6, join as join12, resolve as resolve6, sep as sep3 } from "path";
|
|
62288
62352
|
function createFindGitRoot() {
|
|
62289
62353
|
function wrapper(startPath) {
|
|
62290
62354
|
const result = findGitRootImpl(startPath);
|
|
@@ -62321,15 +62385,15 @@ var init_git = __esm(() => {
|
|
|
62321
62385
|
findGitRootImpl = memoizeWithLRU((startPath) => {
|
|
62322
62386
|
const startTime = Date.now();
|
|
62323
62387
|
logForDiagnosticsNoPII("info", "find_git_root_started");
|
|
62324
|
-
let current =
|
|
62388
|
+
let current = resolve6(startPath);
|
|
62325
62389
|
const root2 = current.substring(0, current.indexOf(sep3) + 1) || sep3;
|
|
62326
62390
|
let statCount = 0;
|
|
62327
62391
|
while (current !== root2) {
|
|
62328
62392
|
try {
|
|
62329
|
-
const gitPath =
|
|
62393
|
+
const gitPath = join12(current, ".git");
|
|
62330
62394
|
statCount++;
|
|
62331
|
-
const
|
|
62332
|
-
if (
|
|
62395
|
+
const stat5 = statSync3(gitPath);
|
|
62396
|
+
if (stat5.isDirectory() || stat5.isFile()) {
|
|
62333
62397
|
logForDiagnosticsNoPII("info", "find_git_root_completed", {
|
|
62334
62398
|
duration_ms: Date.now() - startTime,
|
|
62335
62399
|
stat_count: statCount,
|
|
@@ -62345,10 +62409,10 @@ var init_git = __esm(() => {
|
|
|
62345
62409
|
current = parent;
|
|
62346
62410
|
}
|
|
62347
62411
|
try {
|
|
62348
|
-
const gitPath =
|
|
62412
|
+
const gitPath = join12(root2, ".git");
|
|
62349
62413
|
statCount++;
|
|
62350
|
-
const
|
|
62351
|
-
if (
|
|
62414
|
+
const stat5 = statSync3(gitPath);
|
|
62415
|
+
if (stat5.isDirectory() || stat5.isFile()) {
|
|
62352
62416
|
logForDiagnosticsNoPII("info", "find_git_root_completed", {
|
|
62353
62417
|
duration_ms: Date.now() - startTime,
|
|
62354
62418
|
stat_count: statCount,
|
|
@@ -62367,17 +62431,17 @@ var init_git = __esm(() => {
|
|
|
62367
62431
|
findGitRoot = createFindGitRoot();
|
|
62368
62432
|
resolveCanonicalRoot = memoizeWithLRU((gitRoot) => {
|
|
62369
62433
|
try {
|
|
62370
|
-
const gitContent = readFileSync7(
|
|
62434
|
+
const gitContent = readFileSync7(join12(gitRoot, ".git"), "utf-8").trim();
|
|
62371
62435
|
if (!gitContent.startsWith("gitdir:")) {
|
|
62372
62436
|
return gitRoot;
|
|
62373
62437
|
}
|
|
62374
|
-
const worktreeGitDir =
|
|
62375
|
-
const commonDir =
|
|
62376
|
-
if (
|
|
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")) {
|
|
62377
62441
|
return gitRoot;
|
|
62378
62442
|
}
|
|
62379
|
-
const backlink = realpathSync3(readFileSync7(
|
|
62380
|
-
if (backlink !==
|
|
62443
|
+
const backlink = realpathSync3(readFileSync7(join12(worktreeGitDir, "gitdir"), "utf-8").trim());
|
|
62444
|
+
if (backlink !== join12(realpathSync3(gitRoot), ".git")) {
|
|
62381
62445
|
return gitRoot;
|
|
62382
62446
|
}
|
|
62383
62447
|
if (basename2(commonDir) !== ".git") {
|
|
@@ -67455,8 +67519,8 @@ Error generating stack: ` + x.message + `
|
|
|
67455
67519
|
currentEntangledActionThenable = {
|
|
67456
67520
|
status: "pending",
|
|
67457
67521
|
value: undefined,
|
|
67458
|
-
then: function(
|
|
67459
|
-
entangledListeners.push(
|
|
67522
|
+
then: function(resolve7) {
|
|
67523
|
+
entangledListeners.push(resolve7);
|
|
67460
67524
|
}
|
|
67461
67525
|
};
|
|
67462
67526
|
}
|
|
@@ -67480,8 +67544,8 @@ Error generating stack: ` + x.message + `
|
|
|
67480
67544
|
status: "pending",
|
|
67481
67545
|
value: null,
|
|
67482
67546
|
reason: null,
|
|
67483
|
-
then: function(
|
|
67484
|
-
listeners.push(
|
|
67547
|
+
then: function(resolve7) {
|
|
67548
|
+
listeners.push(resolve7);
|
|
67485
67549
|
}
|
|
67486
67550
|
};
|
|
67487
67551
|
thenable.then(function() {
|
|
@@ -79418,10 +79482,10 @@ var init_dec = __esm(() => {
|
|
|
79418
79482
|
import { Buffer as Buffer8 } from "buffer";
|
|
79419
79483
|
import { execFile as nodeExecFile } from "child_process";
|
|
79420
79484
|
function execFileNoThrow2(command, args, options = {}) {
|
|
79421
|
-
return new Promise((
|
|
79485
|
+
return new Promise((resolve7) => {
|
|
79422
79486
|
const { input, timeout } = options;
|
|
79423
79487
|
const proc = nodeExecFile(command, args, { timeout }, (error52, stdout, stderr) => {
|
|
79424
|
-
|
|
79488
|
+
resolve7({
|
|
79425
79489
|
code: error52 ? 1 : 0,
|
|
79426
79490
|
stdout: stdout ?? "",
|
|
79427
79491
|
stderr: stderr ?? ""
|
|
@@ -79798,8 +79862,8 @@ function setTerminalFocused(v) {
|
|
|
79798
79862
|
cb();
|
|
79799
79863
|
}
|
|
79800
79864
|
if (!v) {
|
|
79801
|
-
for (const
|
|
79802
|
-
|
|
79865
|
+
for (const resolve7 of resolvers) {
|
|
79866
|
+
resolve7();
|
|
79803
79867
|
}
|
|
79804
79868
|
resolvers.clear();
|
|
79805
79869
|
}
|
|
@@ -79837,18 +79901,18 @@ class TerminalQuerier {
|
|
|
79837
79901
|
this.stdout = stdout;
|
|
79838
79902
|
}
|
|
79839
79903
|
send(query) {
|
|
79840
|
-
return new Promise((
|
|
79904
|
+
return new Promise((resolve7) => {
|
|
79841
79905
|
this.queue.push({
|
|
79842
79906
|
kind: "query",
|
|
79843
79907
|
match: query.match,
|
|
79844
|
-
resolve: (r) =>
|
|
79908
|
+
resolve: (r) => resolve7(r)
|
|
79845
79909
|
});
|
|
79846
79910
|
this.stdout.write(query.request);
|
|
79847
79911
|
});
|
|
79848
79912
|
}
|
|
79849
79913
|
flush() {
|
|
79850
|
-
return new Promise((
|
|
79851
|
-
this.queue.push({ kind: "sentinel", resolve:
|
|
79914
|
+
return new Promise((resolve7) => {
|
|
79915
|
+
this.queue.push({ kind: "sentinel", resolve: resolve7 });
|
|
79852
79916
|
this.stdout.write(SENTINEL);
|
|
79853
79917
|
});
|
|
79854
79918
|
}
|
|
@@ -84875,8 +84939,8 @@ class Ink {
|
|
|
84875
84939
|
}
|
|
84876
84940
|
}
|
|
84877
84941
|
async waitUntilExit() {
|
|
84878
|
-
this.exitPromise ||= new Promise((
|
|
84879
|
-
this.resolveExitPromise =
|
|
84942
|
+
this.exitPromise ||= new Promise((resolve7, reject) => {
|
|
84943
|
+
this.resolveExitPromise = resolve7;
|
|
84880
84944
|
this.rejectExitPromise = reject;
|
|
84881
84945
|
});
|
|
84882
84946
|
return this.exitPromise;
|
|
@@ -86825,7 +86889,7 @@ var init_internalWrites = __esm(() => {
|
|
|
86825
86889
|
});
|
|
86826
86890
|
|
|
86827
86891
|
// src/utils/settings/managedPath.ts
|
|
86828
|
-
import { join as
|
|
86892
|
+
import { join as join13 } from "path";
|
|
86829
86893
|
var getManagedFilePath, getManagedSettingsDropInDir;
|
|
86830
86894
|
var init_managedPath = __esm(() => {
|
|
86831
86895
|
init_memoize();
|
|
@@ -86844,7 +86908,7 @@ var init_managedPath = __esm(() => {
|
|
|
86844
86908
|
}
|
|
86845
86909
|
});
|
|
86846
86910
|
getManagedSettingsDropInDir = memoize_default(function() {
|
|
86847
|
-
return
|
|
86911
|
+
return join13(getManagedFilePath(), "managed-settings.d");
|
|
86848
86912
|
});
|
|
86849
86913
|
});
|
|
86850
86914
|
|
|
@@ -86908,7 +86972,7 @@ var init_findExecutable = __esm(() => {
|
|
|
86908
86972
|
|
|
86909
86973
|
// src/utils/env.ts
|
|
86910
86974
|
import { homedir as homedir4 } from "os";
|
|
86911
|
-
import { join as
|
|
86975
|
+
import { join as join14 } from "path";
|
|
86912
86976
|
async function isCommandAvailable(command) {
|
|
86913
86977
|
try {
|
|
86914
86978
|
return !!await which(command);
|
|
@@ -87029,11 +87093,11 @@ var init_env = __esm(() => {
|
|
|
87029
87093
|
init_fsOperations();
|
|
87030
87094
|
init_which();
|
|
87031
87095
|
getGlobalClaudeFile = memoize_default(() => {
|
|
87032
|
-
if (getFsImplementation().existsSync(
|
|
87033
|
-
return
|
|
87096
|
+
if (getFsImplementation().existsSync(join14(getClaudeConfigHomeDir(), ".config.json"))) {
|
|
87097
|
+
return join14(getClaudeConfigHomeDir(), ".config.json");
|
|
87034
87098
|
}
|
|
87035
87099
|
const filename = `.claude${fileSuffixForOauthConfig()}.json`;
|
|
87036
|
-
return
|
|
87100
|
+
return join14(process.env.CLAUDE_CONFIG_DIR || homedir4(), filename);
|
|
87037
87101
|
});
|
|
87038
87102
|
hasInternetAccess = memoize_default(async () => {
|
|
87039
87103
|
try {
|
|
@@ -88417,6 +88481,7 @@ var init_types2 = __esm(() => {
|
|
|
88417
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."),
|
|
88418
88482
|
alwaysThinkingEnabled: exports_external.boolean().optional().describe("When false, thinking is disabled. When absent or true, thinking is " + "enabled automatically for supported models."),
|
|
88419
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)."),
|
|
88420
88485
|
advisorModel: exports_external.string().optional().describe("Advisor model for the server-side advisor tool."),
|
|
88421
88486
|
fastMode: exports_external.boolean().optional().describe("When true, fast mode is enabled. When absent or false, fast mode is off."),
|
|
88422
88487
|
fastModePerSessionOptIn: exports_external.boolean().optional().describe("When true, fast mode does not persist across sessions. Each session starts with fast mode off."),
|
|
@@ -88783,10 +88848,9 @@ var init_settings = __esm(() => {
|
|
|
88783
88848
|
});
|
|
88784
88849
|
|
|
88785
88850
|
// src/utils/settings/settings.ts
|
|
88786
|
-
import {
|
|
88787
|
-
import { dirname as dirname7, join as join13, resolve as resolve6 } from "path";
|
|
88851
|
+
import { dirname as dirname7, join as join15, resolve as resolve7 } from "path";
|
|
88788
88852
|
function getManagedSettingsFilePath() {
|
|
88789
|
-
return
|
|
88853
|
+
return join15(getManagedFilePath(), "managed-settings.json");
|
|
88790
88854
|
}
|
|
88791
88855
|
function loadManagedFileSettings() {
|
|
88792
88856
|
const errors3 = [];
|
|
@@ -88802,7 +88866,7 @@ function loadManagedFileSettings() {
|
|
|
88802
88866
|
try {
|
|
88803
88867
|
const entries = getFsImplementation().readdirSync(dropInDir).filter((d) => (d.isFile() || d.isSymbolicLink()) && d.name.endsWith(".json") && !d.name.startsWith(".")).map((d) => d.name).sort();
|
|
88804
88868
|
for (const name of entries) {
|
|
88805
|
-
const { settings: settings2, errors: fileErrors } = parseSettingsFile(
|
|
88869
|
+
const { settings: settings2, errors: fileErrors } = parseSettingsFile(join15(dropInDir, name));
|
|
88806
88870
|
errors3.push(...fileErrors);
|
|
88807
88871
|
if (settings2 && Object.keys(settings2).length > 0) {
|
|
88808
88872
|
merged = mergeWith_default(merged, settings2, settingsMergeCustomizer);
|
|
@@ -88862,15 +88926,15 @@ function parseSettingsFileUncached(path13) {
|
|
|
88862
88926
|
function getSettingsRootPathForSource(source) {
|
|
88863
88927
|
switch (source) {
|
|
88864
88928
|
case "userSettings":
|
|
88865
|
-
return
|
|
88929
|
+
return resolve7(getClaudeConfigHomeDir());
|
|
88866
88930
|
case "policySettings":
|
|
88867
88931
|
case "projectSettings":
|
|
88868
88932
|
case "localSettings": {
|
|
88869
|
-
return
|
|
88933
|
+
return resolve7(getOriginalCwd());
|
|
88870
88934
|
}
|
|
88871
88935
|
case "flagSettings": {
|
|
88872
88936
|
const path13 = getFlagSettingsPath();
|
|
88873
|
-
return path13 ? dirname7(
|
|
88937
|
+
return path13 ? dirname7(resolve7(path13)) : resolve7(getOriginalCwd());
|
|
88874
88938
|
}
|
|
88875
88939
|
}
|
|
88876
88940
|
}
|
|
@@ -88880,29 +88944,16 @@ function getUserSettingsFilePath() {
|
|
|
88880
88944
|
}
|
|
88881
88945
|
return "settings.json";
|
|
88882
88946
|
}
|
|
88883
|
-
function
|
|
88884
|
-
|
|
88885
|
-
const primary = join13(resolve6(getClaudeConfigHomeDir()), filename);
|
|
88886
|
-
if (process.env.COSTRICT_CONFIG_DIR || process.env.CLAUDE_CONFIG_DIR) {
|
|
88887
|
-
return [primary];
|
|
88888
|
-
}
|
|
88889
|
-
const legacy = join13(homedir5(), LEGACY_CONFIG_DIR_NAME, filename);
|
|
88890
|
-
const defaultPrimary = join13(homedir5(), CONFIG_DIR_NAME, filename);
|
|
88891
|
-
if (resolve6(primary) !== resolve6(defaultPrimary)) {
|
|
88892
|
-
return [primary];
|
|
88893
|
-
}
|
|
88894
|
-
if (resolve6(legacy) === resolve6(primary)) {
|
|
88895
|
-
return [primary];
|
|
88896
|
-
}
|
|
88897
|
-
return [legacy, primary];
|
|
88947
|
+
function getUserSettingsFilePaths2() {
|
|
88948
|
+
return getUserSettingsFilePaths(getUserSettingsFilePath());
|
|
88898
88949
|
}
|
|
88899
88950
|
function getSettingsFilePathForSource(source) {
|
|
88900
88951
|
switch (source) {
|
|
88901
88952
|
case "userSettings":
|
|
88902
|
-
return
|
|
88953
|
+
return join15(getSettingsRootPathForSource(source), getUserSettingsFilePath());
|
|
88903
88954
|
case "projectSettings":
|
|
88904
88955
|
case "localSettings": {
|
|
88905
|
-
return
|
|
88956
|
+
return join15(getSettingsRootPathForSource(source), getRelativeSettingsFilePathForSource(source));
|
|
88906
88957
|
}
|
|
88907
88958
|
case "policySettings":
|
|
88908
88959
|
return getManagedSettingsFilePath();
|
|
@@ -88914,9 +88965,9 @@ function getSettingsFilePathForSource(source) {
|
|
|
88914
88965
|
function getRelativeSettingsFilePathForSource(source) {
|
|
88915
88966
|
switch (source) {
|
|
88916
88967
|
case "projectSettings":
|
|
88917
|
-
return
|
|
88968
|
+
return join15(".claude", "settings.json");
|
|
88918
88969
|
case "localSettings":
|
|
88919
|
-
return
|
|
88970
|
+
return join15(".claude", "settings.local.json");
|
|
88920
88971
|
}
|
|
88921
88972
|
}
|
|
88922
88973
|
function getSettingsForSource(source) {
|
|
@@ -88950,7 +89001,7 @@ function getSettingsForSourceUncached(source) {
|
|
|
88950
89001
|
if (source === "userSettings") {
|
|
88951
89002
|
let mergedSettings = {};
|
|
88952
89003
|
let found = false;
|
|
88953
|
-
for (const settingsFilePath2 of
|
|
89004
|
+
for (const settingsFilePath2 of getUserSettingsFilePaths2()) {
|
|
88954
89005
|
const { settings } = parseSettingsFile(settingsFilePath2);
|
|
88955
89006
|
if (settings) {
|
|
88956
89007
|
mergedSettings = mergeWith_default(mergedSettings, settings, settingsMergeCustomizer);
|
|
@@ -89044,9 +89095,9 @@ function loadSettingsFromDisk() {
|
|
|
89044
89095
|
}
|
|
89045
89096
|
continue;
|
|
89046
89097
|
}
|
|
89047
|
-
const filePaths = source === "userSettings" ?
|
|
89098
|
+
const filePaths = source === "userSettings" ? getUserSettingsFilePaths2() : getSettingsFilePathForSource(source) ? [getSettingsFilePathForSource(source)] : [];
|
|
89048
89099
|
for (const filePath of filePaths) {
|
|
89049
|
-
const resolvedPath =
|
|
89100
|
+
const resolvedPath = resolve7(filePath);
|
|
89050
89101
|
if (!seenFiles.has(resolvedPath)) {
|
|
89051
89102
|
seenFiles.add(resolvedPath);
|
|
89052
89103
|
const { settings, errors: errors3 } = parseSettingsFile(filePath);
|
|
@@ -89105,8 +89156,8 @@ var init_settings2 = __esm(() => {
|
|
|
89105
89156
|
init_diagLogs();
|
|
89106
89157
|
init_envUtils();
|
|
89107
89158
|
init_errors3();
|
|
89108
|
-
init_branding();
|
|
89109
89159
|
init_file();
|
|
89160
|
+
init_userSettingsFilePaths();
|
|
89110
89161
|
init_fileRead();
|
|
89111
89162
|
init_fsOperations();
|
|
89112
89163
|
init_gitignore();
|
|
@@ -89241,7 +89292,7 @@ var init_dist3 = __esm(() => {
|
|
|
89241
89292
|
|
|
89242
89293
|
// node_modules/.bun/https-proxy-agent@8.0.0/node_modules/https-proxy-agent/dist/parse-proxy-response.js
|
|
89243
89294
|
function parseProxyResponse(socket) {
|
|
89244
|
-
return new Promise((
|
|
89295
|
+
return new Promise((resolve8, reject) => {
|
|
89245
89296
|
let buffersLength = 0;
|
|
89246
89297
|
const buffers = [];
|
|
89247
89298
|
function read() {
|
|
@@ -89310,7 +89361,7 @@ function parseProxyResponse(socket) {
|
|
|
89310
89361
|
}
|
|
89311
89362
|
debug("got proxy server response: %o %o", firstLine, headers);
|
|
89312
89363
|
cleanup();
|
|
89313
|
-
|
|
89364
|
+
resolve8({
|
|
89314
89365
|
connect: {
|
|
89315
89366
|
statusCode,
|
|
89316
89367
|
statusText,
|
|
@@ -90799,7 +90850,7 @@ var require_client = __commonJS((exports) => {
|
|
|
90799
90850
|
};
|
|
90800
90851
|
};
|
|
90801
90852
|
var sleep2 = (seconds) => {
|
|
90802
|
-
return new Promise((
|
|
90853
|
+
return new Promise((resolve8) => setTimeout(resolve8, seconds * 1000));
|
|
90803
90854
|
};
|
|
90804
90855
|
var waiterServiceDefaults = {
|
|
90805
90856
|
minDelay: 2,
|
|
@@ -90928,8 +90979,8 @@ var require_client = __commonJS((exports) => {
|
|
|
90928
90979
|
};
|
|
90929
90980
|
var abortTimeout = (abortSignal) => {
|
|
90930
90981
|
let onAbort;
|
|
90931
|
-
const promise2 = new Promise((
|
|
90932
|
-
onAbort = () =>
|
|
90982
|
+
const promise2 = new Promise((resolve8) => {
|
|
90983
|
+
onAbort = () => resolve8({ state: exports.WaiterState.ABORTED });
|
|
90933
90984
|
if (typeof abortSignal.addEventListener === "function") {
|
|
90934
90985
|
abortSignal.addEventListener("abort", onAbort);
|
|
90935
90986
|
} else {
|
|
@@ -92146,7 +92197,7 @@ var require_config = __commonJS((exports) => {
|
|
|
92146
92197
|
};
|
|
92147
92198
|
var imdsHttpGet = async ({ hostname: hostname3, path: path13 }) => {
|
|
92148
92199
|
const { request } = await import("http");
|
|
92149
|
-
return new Promise((
|
|
92200
|
+
return new Promise((resolve8, reject) => {
|
|
92150
92201
|
const req = request({
|
|
92151
92202
|
method: "GET",
|
|
92152
92203
|
hostname: hostname3.replace(/^\[(.+)]$/, "$1"),
|
|
@@ -92172,7 +92223,7 @@ var require_config = __commonJS((exports) => {
|
|
|
92172
92223
|
const chunks = [];
|
|
92173
92224
|
res.on("data", (chunk) => chunks.push(chunk));
|
|
92174
92225
|
res.on("end", () => {
|
|
92175
|
-
|
|
92226
|
+
resolve8(Buffer.concat(chunks));
|
|
92176
92227
|
req.destroy();
|
|
92177
92228
|
});
|
|
92178
92229
|
});
|
|
@@ -94330,7 +94381,7 @@ ${value}\r
|
|
|
94330
94381
|
if (isReadableStream4(stream4)) {
|
|
94331
94382
|
return headStream$1(stream4, bytes);
|
|
94332
94383
|
}
|
|
94333
|
-
return new Promise((
|
|
94384
|
+
return new Promise((resolve8, reject) => {
|
|
94334
94385
|
const collector = new Collector$1;
|
|
94335
94386
|
collector.limit = bytes;
|
|
94336
94387
|
stream4.pipe(collector);
|
|
@@ -94341,7 +94392,7 @@ ${value}\r
|
|
|
94341
94392
|
collector.on("error", reject);
|
|
94342
94393
|
collector.on("finish", function() {
|
|
94343
94394
|
const bytes2 = new Uint8Array(Buffer.concat(this.buffers));
|
|
94344
|
-
|
|
94395
|
+
resolve8(bytes2);
|
|
94345
94396
|
});
|
|
94346
94397
|
});
|
|
94347
94398
|
};
|
|
@@ -94439,7 +94490,7 @@ ${value}\r
|
|
|
94439
94490
|
return collected;
|
|
94440
94491
|
}
|
|
94441
94492
|
function readToBase64(blob) {
|
|
94442
|
-
return new Promise((
|
|
94493
|
+
return new Promise((resolve8, reject) => {
|
|
94443
94494
|
const reader = new FileReader;
|
|
94444
94495
|
reader.onloadend = () => {
|
|
94445
94496
|
if (reader.readyState !== 2) {
|
|
@@ -94448,7 +94499,7 @@ ${value}\r
|
|
|
94448
94499
|
const result = reader.result ?? "";
|
|
94449
94500
|
const commaIndex = result.indexOf(",");
|
|
94450
94501
|
const dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length;
|
|
94451
|
-
|
|
94502
|
+
resolve8(result.substring(dataOffset));
|
|
94452
94503
|
};
|
|
94453
94504
|
reader.onabort = () => reject(new Error("Read aborted"));
|
|
94454
94505
|
reader.onerror = () => reject(reader.error);
|
|
@@ -94542,7 +94593,7 @@ ${value}\r
|
|
|
94542
94593
|
if (isReadableStreamInstance(stream4)) {
|
|
94543
94594
|
return collectReadableStream(stream4);
|
|
94544
94595
|
}
|
|
94545
|
-
return new Promise((
|
|
94596
|
+
return new Promise((resolve8, reject) => {
|
|
94546
94597
|
const collector = new Collector;
|
|
94547
94598
|
stream4.pipe(collector);
|
|
94548
94599
|
stream4.on("error", (err) => {
|
|
@@ -94552,7 +94603,7 @@ ${value}\r
|
|
|
94552
94603
|
collector.on("error", reject);
|
|
94553
94604
|
collector.on("finish", function() {
|
|
94554
94605
|
const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes));
|
|
94555
|
-
|
|
94606
|
+
resolve8(bytes);
|
|
94556
94607
|
});
|
|
94557
94608
|
});
|
|
94558
94609
|
};
|
|
@@ -94870,11 +94921,11 @@ var require_tslib = __commonJS((exports, module) => {
|
|
|
94870
94921
|
};
|
|
94871
94922
|
__awaiter = function(thisArg, _arguments, P2, generator) {
|
|
94872
94923
|
function adopt(value) {
|
|
94873
|
-
return value instanceof P2 ? value : new P2(function(
|
|
94874
|
-
|
|
94924
|
+
return value instanceof P2 ? value : new P2(function(resolve8) {
|
|
94925
|
+
resolve8(value);
|
|
94875
94926
|
});
|
|
94876
94927
|
}
|
|
94877
|
-
return new (P2 || (P2 = Promise))(function(
|
|
94928
|
+
return new (P2 || (P2 = Promise))(function(resolve8, reject) {
|
|
94878
94929
|
function fulfilled(value) {
|
|
94879
94930
|
try {
|
|
94880
94931
|
step(generator.next(value));
|
|
@@ -94890,7 +94941,7 @@ var require_tslib = __commonJS((exports, module) => {
|
|
|
94890
94941
|
}
|
|
94891
94942
|
}
|
|
94892
94943
|
function step(result) {
|
|
94893
|
-
result.done ?
|
|
94944
|
+
result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
94894
94945
|
}
|
|
94895
94946
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
94896
94947
|
});
|
|
@@ -95119,14 +95170,14 @@ var require_tslib = __commonJS((exports, module) => {
|
|
|
95119
95170
|
}, i2);
|
|
95120
95171
|
function verb(n2) {
|
|
95121
95172
|
i2[n2] = o2[n2] && function(v) {
|
|
95122
|
-
return new Promise(function(
|
|
95123
|
-
v = o2[n2](v), settle2(
|
|
95173
|
+
return new Promise(function(resolve8, reject) {
|
|
95174
|
+
v = o2[n2](v), settle2(resolve8, reject, v.done, v.value);
|
|
95124
95175
|
});
|
|
95125
95176
|
};
|
|
95126
95177
|
}
|
|
95127
|
-
function settle2(
|
|
95178
|
+
function settle2(resolve8, reject, d, v) {
|
|
95128
95179
|
Promise.resolve(v).then(function(v2) {
|
|
95129
|
-
|
|
95180
|
+
resolve8({ value: v2, done: d });
|
|
95130
95181
|
}, reject);
|
|
95131
95182
|
}
|
|
95132
95183
|
};
|
|
@@ -96410,7 +96461,7 @@ var require_event_streams = __commonJS((exports) => {
|
|
|
96410
96461
|
streamEnded = true;
|
|
96411
96462
|
});
|
|
96412
96463
|
while (!generationEnded) {
|
|
96413
|
-
const value = await new Promise((
|
|
96464
|
+
const value = await new Promise((resolve8) => setTimeout(() => resolve8(records.shift()), 0));
|
|
96414
96465
|
if (value) {
|
|
96415
96466
|
yield value;
|
|
96416
96467
|
}
|
|
@@ -97820,21 +97871,21 @@ var require_dist_cjs5 = __commonJS((exports) => {
|
|
|
97820
97871
|
let sendBody = true;
|
|
97821
97872
|
if (!externalAgent && expect === "100-continue") {
|
|
97822
97873
|
sendBody = await Promise.race([
|
|
97823
|
-
new Promise((
|
|
97824
|
-
timeoutId = Number(timing2.setTimeout(() =>
|
|
97874
|
+
new Promise((resolve8) => {
|
|
97875
|
+
timeoutId = Number(timing2.setTimeout(() => resolve8(true), Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs)));
|
|
97825
97876
|
}),
|
|
97826
|
-
new Promise((
|
|
97877
|
+
new Promise((resolve8) => {
|
|
97827
97878
|
httpRequest.on("continue", () => {
|
|
97828
97879
|
timing2.clearTimeout(timeoutId);
|
|
97829
|
-
|
|
97880
|
+
resolve8(true);
|
|
97830
97881
|
});
|
|
97831
97882
|
httpRequest.on("response", () => {
|
|
97832
97883
|
timing2.clearTimeout(timeoutId);
|
|
97833
|
-
|
|
97884
|
+
resolve8(false);
|
|
97834
97885
|
});
|
|
97835
97886
|
httpRequest.on("error", () => {
|
|
97836
97887
|
timing2.clearTimeout(timeoutId);
|
|
97837
|
-
|
|
97888
|
+
resolve8(false);
|
|
97838
97889
|
});
|
|
97839
97890
|
})
|
|
97840
97891
|
]);
|
|
@@ -97909,13 +97960,13 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
97909
97960
|
return socketWarningTimestamp;
|
|
97910
97961
|
}
|
|
97911
97962
|
constructor(options) {
|
|
97912
|
-
this.configProvider = new Promise((
|
|
97963
|
+
this.configProvider = new Promise((resolve8, reject) => {
|
|
97913
97964
|
if (typeof options === "function") {
|
|
97914
97965
|
options().then((_options) => {
|
|
97915
|
-
|
|
97966
|
+
resolve8(this.resolveDefaultConfig(_options));
|
|
97916
97967
|
}).catch(reject);
|
|
97917
97968
|
} else {
|
|
97918
|
-
|
|
97969
|
+
resolve8(this.resolveDefaultConfig(options));
|
|
97919
97970
|
}
|
|
97920
97971
|
});
|
|
97921
97972
|
}
|
|
@@ -97946,7 +97997,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
97946
97997
|
timing2.clearTimeout(socketTimeoutId);
|
|
97947
97998
|
timing2.clearTimeout(keepAliveTimeoutId);
|
|
97948
97999
|
};
|
|
97949
|
-
const
|
|
98000
|
+
const resolve8 = async (arg) => {
|
|
97950
98001
|
await writeRequestBodyPromise;
|
|
97951
98002
|
clearTimeouts();
|
|
97952
98003
|
_resolve(arg);
|
|
@@ -98010,7 +98061,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
98010
98061
|
headers: getTransformedHeaders(res.headers),
|
|
98011
98062
|
body: res
|
|
98012
98063
|
});
|
|
98013
|
-
|
|
98064
|
+
resolve8({ response: httpResponse });
|
|
98014
98065
|
});
|
|
98015
98066
|
req.on("error", (err) => {
|
|
98016
98067
|
if (NODEJS_TIMEOUT_ERROR_CODES.includes(err.code)) {
|
|
@@ -98336,13 +98387,13 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
98336
98387
|
return new NodeHttp2Handler(instanceOrOptions);
|
|
98337
98388
|
}
|
|
98338
98389
|
constructor(options) {
|
|
98339
|
-
this.configProvider = new Promise((
|
|
98390
|
+
this.configProvider = new Promise((resolve8, reject) => {
|
|
98340
98391
|
if (typeof options === "function") {
|
|
98341
98392
|
options().then((opts) => {
|
|
98342
|
-
|
|
98393
|
+
resolve8(opts || {});
|
|
98343
98394
|
}).catch(reject);
|
|
98344
98395
|
} else {
|
|
98345
|
-
|
|
98396
|
+
resolve8(options || {});
|
|
98346
98397
|
}
|
|
98347
98398
|
});
|
|
98348
98399
|
}
|
|
@@ -98367,7 +98418,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
98367
98418
|
return new Promise((_resolve, _reject) => {
|
|
98368
98419
|
let fulfilled = false;
|
|
98369
98420
|
let writeRequestBodyPromise = undefined;
|
|
98370
|
-
const
|
|
98421
|
+
const resolve8 = async (arg) => {
|
|
98371
98422
|
await writeRequestBodyPromise;
|
|
98372
98423
|
_resolve(arg);
|
|
98373
98424
|
};
|
|
@@ -98452,7 +98503,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
98452
98503
|
body: clientHttp2Stream
|
|
98453
98504
|
});
|
|
98454
98505
|
fulfilled = true;
|
|
98455
|
-
|
|
98506
|
+
resolve8({ response: httpResponse });
|
|
98456
98507
|
if (useIsolatedSession) {
|
|
98457
98508
|
session.close();
|
|
98458
98509
|
}
|
|
@@ -98495,7 +98546,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
98495
98546
|
if (isReadableStreamInstance(stream4)) {
|
|
98496
98547
|
return collectReadableStream(stream4);
|
|
98497
98548
|
}
|
|
98498
|
-
return new Promise((
|
|
98549
|
+
return new Promise((resolve8, reject) => {
|
|
98499
98550
|
const collector = new Collector;
|
|
98500
98551
|
stream4.pipe(collector);
|
|
98501
98552
|
stream4.on("error", (err) => {
|
|
@@ -98505,7 +98556,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
98505
98556
|
collector.on("error", reject);
|
|
98506
98557
|
collector.on("finish", function() {
|
|
98507
98558
|
const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes));
|
|
98508
|
-
|
|
98559
|
+
resolve8(bytes);
|
|
98509
98560
|
});
|
|
98510
98561
|
});
|
|
98511
98562
|
};
|
|
@@ -98723,7 +98774,7 @@ var require_retry2 = __commonJS((exports) => {
|
|
|
98723
98774
|
}
|
|
98724
98775
|
};
|
|
98725
98776
|
}
|
|
98726
|
-
var cooldown = (ms) => new Promise((
|
|
98777
|
+
var cooldown = (ms) => new Promise((resolve8) => setTimeout(resolve8, ms));
|
|
98727
98778
|
var isRetryStrategyV2 = (retryStrategy) => typeof retryStrategy.acquireInitialRetryToken !== "undefined" && typeof retryStrategy.refreshRetryTokenForRetry !== "undefined" && typeof retryStrategy.recordSuccess !== "undefined";
|
|
98728
98779
|
var getRetryErrorInfo = (error52, logger) => {
|
|
98729
98780
|
const errorInfo = {
|
|
@@ -98822,7 +98873,7 @@ var require_retry2 = __commonJS((exports) => {
|
|
|
98822
98873
|
this.refillTokenBucket();
|
|
98823
98874
|
while (amount > this.availableTokens) {
|
|
98824
98875
|
const delay = (amount - this.availableTokens) / this.fillRate * 1000;
|
|
98825
|
-
await new Promise((
|
|
98876
|
+
await new Promise((resolve8) => DefaultRateLimiter.setTimeoutFn(resolve8, delay));
|
|
98826
98877
|
this.refillTokenBucket();
|
|
98827
98878
|
}
|
|
98828
98879
|
this.availableTokens = this.availableTokens - amount;
|
|
@@ -99164,7 +99215,7 @@ var require_retry2 = __commonJS((exports) => {
|
|
|
99164
99215
|
const delayFromResponse = getDelayFromRetryAfterHeader(err.$response);
|
|
99165
99216
|
const delay = Math.max(delayFromResponse || 0, delayFromDecider);
|
|
99166
99217
|
totalDelay += delay;
|
|
99167
|
-
await new Promise((
|
|
99218
|
+
await new Promise((resolve8) => setTimeout(resolve8, delay));
|
|
99168
99219
|
continue;
|
|
99169
99220
|
}
|
|
99170
99221
|
if (!err.$metadata) {
|
|
@@ -101168,14 +101219,14 @@ var init_parser_os = __esm(() => {
|
|
|
101168
101219
|
describe(ua) {
|
|
101169
101220
|
const version2 = Utils.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i, ua).replace(/[_\s]/g, ".");
|
|
101170
101221
|
const versionName = Utils.getMacOSVersionName(version2);
|
|
101171
|
-
const
|
|
101222
|
+
const os4 = {
|
|
101172
101223
|
name: OS_MAP.MacOS,
|
|
101173
101224
|
version: version2
|
|
101174
101225
|
};
|
|
101175
101226
|
if (versionName) {
|
|
101176
|
-
|
|
101227
|
+
os4.versionName = versionName;
|
|
101177
101228
|
}
|
|
101178
|
-
return
|
|
101229
|
+
return os4;
|
|
101179
101230
|
}
|
|
101180
101231
|
},
|
|
101181
101232
|
{
|
|
@@ -101207,27 +101258,27 @@ var init_parser_os = __esm(() => {
|
|
|
101207
101258
|
describe(ua) {
|
|
101208
101259
|
const version2 = Utils.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i, ua);
|
|
101209
101260
|
const versionName = Utils.getAndroidVersionName(version2);
|
|
101210
|
-
const
|
|
101261
|
+
const os4 = {
|
|
101211
101262
|
name: OS_MAP.Android,
|
|
101212
101263
|
version: version2
|
|
101213
101264
|
};
|
|
101214
101265
|
if (versionName) {
|
|
101215
|
-
|
|
101266
|
+
os4.versionName = versionName;
|
|
101216
101267
|
}
|
|
101217
|
-
return
|
|
101268
|
+
return os4;
|
|
101218
101269
|
}
|
|
101219
101270
|
},
|
|
101220
101271
|
{
|
|
101221
101272
|
test: [/(web|hpw)[o0]s/i],
|
|
101222
101273
|
describe(ua) {
|
|
101223
101274
|
const version2 = Utils.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i, ua);
|
|
101224
|
-
const
|
|
101275
|
+
const os4 = {
|
|
101225
101276
|
name: OS_MAP.WebOS
|
|
101226
101277
|
};
|
|
101227
101278
|
if (version2 && version2.length) {
|
|
101228
|
-
|
|
101279
|
+
os4.version = version2;
|
|
101229
101280
|
}
|
|
101230
|
-
return
|
|
101281
|
+
return os4;
|
|
101231
101282
|
}
|
|
101232
101283
|
},
|
|
101233
101284
|
{
|
|
@@ -101936,7 +101987,7 @@ class Parser2 {
|
|
|
101936
101987
|
}
|
|
101937
101988
|
parseOS() {
|
|
101938
101989
|
this.parsedResult.os = {};
|
|
101939
|
-
const
|
|
101990
|
+
const os4 = Utils.find(parser_os_default, (_os) => {
|
|
101940
101991
|
if (typeof _os.test === "function") {
|
|
101941
101992
|
return _os.test(this);
|
|
101942
101993
|
}
|
|
@@ -101945,8 +101996,8 @@ class Parser2 {
|
|
|
101945
101996
|
}
|
|
101946
101997
|
throw new Error("Browser's test function is not valid");
|
|
101947
101998
|
});
|
|
101948
|
-
if (
|
|
101949
|
-
this.parsedResult.os =
|
|
101999
|
+
if (os4) {
|
|
102000
|
+
this.parsedResult.os = os4.describe(this.getUA());
|
|
101950
102001
|
}
|
|
101951
102002
|
return this.parsedResult.os;
|
|
101952
102003
|
}
|
|
@@ -102973,7 +103024,7 @@ var init_node_http = () => {};
|
|
|
102973
103024
|
|
|
102974
103025
|
// node_modules/.bun/@smithy+credential-provider-imds@4.3.8/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/httpRequest.js
|
|
102975
103026
|
function httpRequest(options) {
|
|
102976
|
-
return new Promise((
|
|
103027
|
+
return new Promise((resolve8, reject) => {
|
|
102977
103028
|
const req = node_http.request({
|
|
102978
103029
|
method: "GET",
|
|
102979
103030
|
...options,
|
|
@@ -102998,7 +103049,7 @@ function httpRequest(options) {
|
|
|
102998
103049
|
chunks.push(chunk);
|
|
102999
103050
|
});
|
|
103000
103051
|
res.on("end", () => {
|
|
103001
|
-
|
|
103052
|
+
resolve8(Buffer.concat(chunks));
|
|
103002
103053
|
req.destroy();
|
|
103003
103054
|
});
|
|
103004
103055
|
});
|
|
@@ -103447,7 +103498,7 @@ var retryWrapper = (toRetry, maxRetries, delayMs) => {
|
|
|
103447
103498
|
try {
|
|
103448
103499
|
return await toRetry();
|
|
103449
103500
|
} catch (e) {
|
|
103450
|
-
await new Promise((
|
|
103501
|
+
await new Promise((resolve8) => setTimeout(resolve8, delayMs));
|
|
103451
103502
|
}
|
|
103452
103503
|
}
|
|
103453
103504
|
return await toRetry();
|
|
@@ -113069,8 +113120,8 @@ var require_signin = __commonJS((exports) => {
|
|
|
113069
113120
|
// node_modules/.bun/@aws-sdk+credential-provider-login@3.972.51/node_modules/@aws-sdk/credential-provider-login/dist-es/LoginCredentialsFetcher.js
|
|
113070
113121
|
import { createHash as createHash2, createPrivateKey, createPublicKey, sign } from "crypto";
|
|
113071
113122
|
import { promises as fs6 } from "fs";
|
|
113072
|
-
import { homedir as
|
|
113073
|
-
import { dirname as dirname8, join as
|
|
113123
|
+
import { homedir as homedir5 } from "os";
|
|
113124
|
+
import { dirname as dirname8, join as join16 } from "path";
|
|
113074
113125
|
var import_config22, import_protocols3, LoginCredentialsFetcher;
|
|
113075
113126
|
var init_LoginCredentialsFetcher = __esm(() => {
|
|
113076
113127
|
import_config22 = __toESM(require_config(), 1);
|
|
@@ -113229,10 +113280,10 @@ var init_LoginCredentialsFetcher = __esm(() => {
|
|
|
113229
113280
|
await fs6.writeFile(tokenFilePath, JSON.stringify(token, null, 2), "utf8");
|
|
113230
113281
|
}
|
|
113231
113282
|
getTokenFilePath() {
|
|
113232
|
-
const directory = process.env.AWS_LOGIN_CACHE_DIRECTORY ??
|
|
113283
|
+
const directory = process.env.AWS_LOGIN_CACHE_DIRECTORY ?? join16(homedir5(), ".aws", "login", "cache");
|
|
113233
113284
|
const loginSessionBytes = Buffer.from(this.loginSession, "utf8");
|
|
113234
113285
|
const loginSessionSha256 = createHash2("sha256").update(loginSessionBytes).digest("hex");
|
|
113235
|
-
return
|
|
113286
|
+
return join16(directory, `${loginSessionSha256}.json`);
|
|
113236
113287
|
}
|
|
113237
113288
|
derToRawSignature(derSignature) {
|
|
113238
113289
|
let offset = 2;
|
|
@@ -113919,7 +113970,7 @@ function probeProxyReachability(proxyUrl) {
|
|
|
113919
113970
|
if (!host || !Number.isInteger(port2) || port2 < 1 || port2 > 65535) {
|
|
113920
113971
|
return Promise.resolve(false);
|
|
113921
113972
|
}
|
|
113922
|
-
return new Promise((
|
|
113973
|
+
return new Promise((resolve8) => {
|
|
113923
113974
|
const socket = connect3({ host, port: port2 });
|
|
113924
113975
|
let done = false;
|
|
113925
113976
|
const finish = (reachable) => {
|
|
@@ -113927,7 +113978,7 @@ function probeProxyReachability(proxyUrl) {
|
|
|
113927
113978
|
return;
|
|
113928
113979
|
done = true;
|
|
113929
113980
|
socket.destroy();
|
|
113930
|
-
|
|
113981
|
+
resolve8(reachable);
|
|
113931
113982
|
};
|
|
113932
113983
|
socket.setTimeout(PROXY_REACHABILITY_TIMEOUT_MS);
|
|
113933
113984
|
socket.once("connect", () => finish(true));
|
|
@@ -126853,35 +126904,35 @@ class IndexedDbStorage {
|
|
|
126853
126904
|
getItem(key) {
|
|
126854
126905
|
return this.withObjectStore("readonly", (store) => {
|
|
126855
126906
|
const req = store.get(key);
|
|
126856
|
-
return new Promise((
|
|
126857
|
-
req.onerror = () =>
|
|
126858
|
-
req.onsuccess = () =>
|
|
126907
|
+
return new Promise((resolve8) => {
|
|
126908
|
+
req.onerror = () => resolve8(null);
|
|
126909
|
+
req.onsuccess = () => resolve8(req.result ? req.result.value : null);
|
|
126859
126910
|
});
|
|
126860
126911
|
}).catch(() => null);
|
|
126861
126912
|
}
|
|
126862
126913
|
removeItem(key) {
|
|
126863
126914
|
return this.withObjectStore("readwrite", (store) => {
|
|
126864
126915
|
const req = store.delete(key);
|
|
126865
|
-
return new Promise((
|
|
126916
|
+
return new Promise((resolve8, reject) => {
|
|
126866
126917
|
req.onerror = () => reject(req.error);
|
|
126867
|
-
req.onsuccess = () =>
|
|
126918
|
+
req.onsuccess = () => resolve8();
|
|
126868
126919
|
});
|
|
126869
126920
|
});
|
|
126870
126921
|
}
|
|
126871
126922
|
setItem(id, value) {
|
|
126872
126923
|
return this.withObjectStore("readwrite", (store) => {
|
|
126873
126924
|
const req = store.put({ id, value });
|
|
126874
|
-
return new Promise((
|
|
126925
|
+
return new Promise((resolve8, reject) => {
|
|
126875
126926
|
req.onerror = () => reject(req.error);
|
|
126876
|
-
req.onsuccess = () =>
|
|
126927
|
+
req.onsuccess = () => resolve8();
|
|
126877
126928
|
});
|
|
126878
126929
|
});
|
|
126879
126930
|
}
|
|
126880
126931
|
getDb() {
|
|
126881
126932
|
const openDbRequest = self.indexedDB.open(this.dbName, 1);
|
|
126882
|
-
return new Promise((
|
|
126933
|
+
return new Promise((resolve8, reject) => {
|
|
126883
126934
|
openDbRequest.onsuccess = () => {
|
|
126884
|
-
|
|
126935
|
+
resolve8(openDbRequest.result);
|
|
126885
126936
|
};
|
|
126886
126937
|
openDbRequest.onerror = () => {
|
|
126887
126938
|
reject(openDbRequest.error);
|
|
@@ -126902,9 +126953,9 @@ class IndexedDbStorage {
|
|
|
126902
126953
|
return this.getDb().then((db) => {
|
|
126903
126954
|
const tx = db.transaction(STORE_NAME, mode);
|
|
126904
126955
|
tx.oncomplete = () => db.close();
|
|
126905
|
-
return new Promise((
|
|
126956
|
+
return new Promise((resolve8, reject) => {
|
|
126906
126957
|
tx.onerror = () => reject(tx.error);
|
|
126907
|
-
|
|
126958
|
+
resolve8(action(tx.objectStore(STORE_NAME)));
|
|
126908
126959
|
}).catch((err) => {
|
|
126909
126960
|
db.close();
|
|
126910
126961
|
throw err;
|
|
@@ -127985,11 +128036,11 @@ var init_macOsKeychainStorage = __esm(() => {
|
|
|
127985
128036
|
|
|
127986
128037
|
// src/utils/secureStorage/plainTextStorage.ts
|
|
127987
128038
|
import { chmodSync as chmodSync2 } from "fs";
|
|
127988
|
-
import { join as
|
|
128039
|
+
import { join as join17 } from "path";
|
|
127989
128040
|
function getStoragePath() {
|
|
127990
128041
|
const storageDir = getClaudeConfigHomeDir();
|
|
127991
128042
|
const storageFileName = ".credentials.json";
|
|
127992
|
-
return { storageDir, storagePath:
|
|
128043
|
+
return { storageDir, storagePath: join17(storageDir, storageFileName) };
|
|
127993
128044
|
}
|
|
127994
128045
|
var plainTextStorage;
|
|
127995
128046
|
var init_plainTextStorage = __esm(() => {
|
|
@@ -128085,25 +128136,25 @@ var init_keychainPrefetch = __esm(() => {
|
|
|
128085
128136
|
|
|
128086
128137
|
// src/utils/sleep.ts
|
|
128087
128138
|
function sleep2(ms, signal, opts) {
|
|
128088
|
-
return new Promise((
|
|
128139
|
+
return new Promise((resolve8, reject) => {
|
|
128089
128140
|
if (signal?.aborted) {
|
|
128090
128141
|
if (opts?.throwOnAbort || opts?.abortError) {
|
|
128091
128142
|
reject(opts.abortError?.() ?? new Error("aborted"));
|
|
128092
128143
|
} else {
|
|
128093
|
-
|
|
128144
|
+
resolve8();
|
|
128094
128145
|
}
|
|
128095
128146
|
return;
|
|
128096
128147
|
}
|
|
128097
|
-
const timer = setTimeout((signal2, onAbort2,
|
|
128148
|
+
const timer = setTimeout((signal2, onAbort2, resolve9) => {
|
|
128098
128149
|
signal2?.removeEventListener("abort", onAbort2);
|
|
128099
|
-
|
|
128100
|
-
}, ms, signal, onAbort,
|
|
128150
|
+
resolve9();
|
|
128151
|
+
}, ms, signal, onAbort, resolve8);
|
|
128101
128152
|
function onAbort() {
|
|
128102
128153
|
clearTimeout(timer);
|
|
128103
128154
|
if (opts?.throwOnAbort || opts?.abortError) {
|
|
128104
128155
|
reject(opts.abortError?.() ?? new Error("aborted"));
|
|
128105
128156
|
} else {
|
|
128106
|
-
|
|
128157
|
+
resolve8();
|
|
128107
128158
|
}
|
|
128108
128159
|
}
|
|
128109
128160
|
signal?.addEventListener("abort", onAbort, { once: true });
|
|
@@ -128532,8 +128583,8 @@ var require_retry3 = __commonJS((exports) => {
|
|
|
128532
128583
|
}
|
|
128533
128584
|
const delay = getNextRetryDelay(config4);
|
|
128534
128585
|
err.config.retryConfig.currentRetryAttempt += 1;
|
|
128535
|
-
const backoff = config4.retryBackoff ? config4.retryBackoff(err, delay) : new Promise((
|
|
128536
|
-
setTimeout(
|
|
128586
|
+
const backoff = config4.retryBackoff ? config4.retryBackoff(err, delay) : new Promise((resolve8) => {
|
|
128587
|
+
setTimeout(resolve8, delay);
|
|
128537
128588
|
});
|
|
128538
128589
|
if (config4.onRetryAttempt) {
|
|
128539
128590
|
await config4.onRetryAttempt(err);
|
|
@@ -128661,8 +128712,8 @@ var require_helpers = __commonJS((exports) => {
|
|
|
128661
128712
|
function req(url3, opts = {}) {
|
|
128662
128713
|
const href = typeof url3 === "string" ? url3 : url3.href;
|
|
128663
128714
|
const req2 = (href.startsWith("https:") ? https2 : http4).request(url3, opts);
|
|
128664
|
-
const promise2 = new Promise((
|
|
128665
|
-
req2.once("response",
|
|
128715
|
+
const promise2 = new Promise((resolve8, reject) => {
|
|
128716
|
+
req2.once("response", resolve8).once("error", reject).end();
|
|
128666
128717
|
});
|
|
128667
128718
|
req2.then = promise2.then.bind(promise2);
|
|
128668
128719
|
return req2;
|
|
@@ -128831,7 +128882,7 @@ var require_parse_proxy_response2 = __commonJS((exports) => {
|
|
|
128831
128882
|
var debug_1 = __importDefault(require_src());
|
|
128832
128883
|
var debug3 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response");
|
|
128833
128884
|
function parseProxyResponse2(socket) {
|
|
128834
|
-
return new Promise((
|
|
128885
|
+
return new Promise((resolve8, reject) => {
|
|
128835
128886
|
let buffersLength = 0;
|
|
128836
128887
|
const buffers = [];
|
|
128837
128888
|
function read() {
|
|
@@ -128900,7 +128951,7 @@ var require_parse_proxy_response2 = __commonJS((exports) => {
|
|
|
128900
128951
|
}
|
|
128901
128952
|
debug3("got proxy server response: %o %o", firstLine, headers);
|
|
128902
128953
|
cleanup();
|
|
128903
|
-
|
|
128954
|
+
resolve8({
|
|
128904
128955
|
connect: {
|
|
128905
128956
|
statusCode,
|
|
128906
128957
|
statusText,
|
|
@@ -132486,7 +132537,7 @@ var require_util2 = __commonJS((exports) => {
|
|
|
132486
132537
|
exports.isValidFile = isValidFile;
|
|
132487
132538
|
exports.getWellKnownCertificateConfigFileLocation = getWellKnownCertificateConfigFileLocation;
|
|
132488
132539
|
var fs7 = __require("fs");
|
|
132489
|
-
var
|
|
132540
|
+
var os4 = __require("os");
|
|
132490
132541
|
var path13 = __require("path");
|
|
132491
132542
|
var WELL_KNOWN_CERTIFICATE_CONFIG_FILE = "certificate_config.json";
|
|
132492
132543
|
var CLOUDSDK_CONFIG_DIRECTORY = "gcloud";
|
|
@@ -132559,7 +132610,7 @@ var require_util2 = __commonJS((exports) => {
|
|
|
132559
132610
|
return path13.join(configDir, WELL_KNOWN_CERTIFICATE_CONFIG_FILE);
|
|
132560
132611
|
}
|
|
132561
132612
|
function _isWindows() {
|
|
132562
|
-
return
|
|
132613
|
+
return os4.platform().startsWith("win");
|
|
132563
132614
|
}
|
|
132564
132615
|
});
|
|
132565
132616
|
|
|
@@ -134614,7 +134665,7 @@ var require_jwtaccess = __commonJS((exports) => {
|
|
|
134614
134665
|
}
|
|
134615
134666
|
}
|
|
134616
134667
|
fromStreamAsync(inputStream) {
|
|
134617
|
-
return new Promise((
|
|
134668
|
+
return new Promise((resolve8, reject) => {
|
|
134618
134669
|
if (!inputStream) {
|
|
134619
134670
|
reject(new Error("Must pass in a stream containing the service account auth settings."));
|
|
134620
134671
|
}
|
|
@@ -134623,7 +134674,7 @@ var require_jwtaccess = __commonJS((exports) => {
|
|
|
134623
134674
|
try {
|
|
134624
134675
|
const data = JSON.parse(s);
|
|
134625
134676
|
this.fromJSON(data);
|
|
134626
|
-
|
|
134677
|
+
resolve8();
|
|
134627
134678
|
} catch (err) {
|
|
134628
134679
|
reject(err);
|
|
134629
134680
|
}
|
|
@@ -134810,7 +134861,7 @@ var require_jwtclient = __commonJS((exports) => {
|
|
|
134810
134861
|
}
|
|
134811
134862
|
}
|
|
134812
134863
|
fromStreamAsync(inputStream) {
|
|
134813
|
-
return new Promise((
|
|
134864
|
+
return new Promise((resolve8, reject) => {
|
|
134814
134865
|
if (!inputStream) {
|
|
134815
134866
|
throw new Error("Must pass in a stream containing the service account auth settings.");
|
|
134816
134867
|
}
|
|
@@ -134819,7 +134870,7 @@ var require_jwtclient = __commonJS((exports) => {
|
|
|
134819
134870
|
try {
|
|
134820
134871
|
const data = JSON.parse(s);
|
|
134821
134872
|
this.fromJSON(data);
|
|
134822
|
-
|
|
134873
|
+
resolve8();
|
|
134823
134874
|
} catch (e5) {
|
|
134824
134875
|
reject(e5);
|
|
134825
134876
|
}
|
|
@@ -134920,7 +134971,7 @@ var require_refreshclient = __commonJS((exports) => {
|
|
|
134920
134971
|
}
|
|
134921
134972
|
}
|
|
134922
134973
|
async fromStreamAsync(inputStream) {
|
|
134923
|
-
return new Promise((
|
|
134974
|
+
return new Promise((resolve8, reject) => {
|
|
134924
134975
|
if (!inputStream) {
|
|
134925
134976
|
return reject(new Error("Must pass in a stream containing the user refresh token."));
|
|
134926
134977
|
}
|
|
@@ -134929,7 +134980,7 @@ var require_refreshclient = __commonJS((exports) => {
|
|
|
134929
134980
|
try {
|
|
134930
134981
|
const data = JSON.parse(s);
|
|
134931
134982
|
this.fromJSON(data);
|
|
134932
|
-
return
|
|
134983
|
+
return resolve8();
|
|
134933
134984
|
} catch (err) {
|
|
134934
134985
|
return reject(err);
|
|
134935
134986
|
}
|
|
@@ -135512,7 +135563,7 @@ var require_filesubjecttokensupplier = __commonJS((exports) => {
|
|
|
135512
135563
|
var util_1 = __require("util");
|
|
135513
135564
|
var fs7 = __require("fs");
|
|
135514
135565
|
var readFile4 = (0, util_1.promisify)(fs7.readFile ?? (() => {}));
|
|
135515
|
-
var
|
|
135566
|
+
var realpath2 = (0, util_1.promisify)(fs7.realpath ?? (() => {}));
|
|
135516
135567
|
var lstat = (0, util_1.promisify)(fs7.lstat ?? (() => {}));
|
|
135517
135568
|
|
|
135518
135569
|
class FileSubjectTokenSupplier {
|
|
@@ -135527,7 +135578,7 @@ var require_filesubjecttokensupplier = __commonJS((exports) => {
|
|
|
135527
135578
|
async getSubjectToken() {
|
|
135528
135579
|
let parsedFilePath = this.filePath;
|
|
135529
135580
|
try {
|
|
135530
|
-
parsedFilePath = await
|
|
135581
|
+
parsedFilePath = await realpath2(parsedFilePath);
|
|
135531
135582
|
if (!(await lstat(parsedFilePath)).isFile()) {
|
|
135532
135583
|
throw new Error;
|
|
135533
135584
|
}
|
|
@@ -136293,7 +136344,7 @@ var require_pluggable_auth_handler = __commonJS((exports) => {
|
|
|
136293
136344
|
this.outputFile = options.outputFile;
|
|
136294
136345
|
}
|
|
136295
136346
|
retrieveResponseFromExecutable(envMap) {
|
|
136296
|
-
return new Promise((
|
|
136347
|
+
return new Promise((resolve8, reject) => {
|
|
136297
136348
|
const child = childProcess.spawn(this.commandComponents[0], this.commandComponents.slice(1), {
|
|
136298
136349
|
env: { ...process.env, ...Object.fromEntries(envMap) }
|
|
136299
136350
|
});
|
|
@@ -136315,7 +136366,7 @@ var require_pluggable_auth_handler = __commonJS((exports) => {
|
|
|
136315
136366
|
try {
|
|
136316
136367
|
const responseJson = JSON.parse(output);
|
|
136317
136368
|
const response = new executable_response_1.ExecutableResponse(responseJson);
|
|
136318
|
-
return
|
|
136369
|
+
return resolve8(response);
|
|
136319
136370
|
} catch (error52) {
|
|
136320
136371
|
if (error52 instanceof executable_response_1.ExecutableResponseError) {
|
|
136321
136372
|
return reject(error52);
|
|
@@ -136926,7 +136977,7 @@ var require_googleauth = __commonJS((exports) => {
|
|
|
136926
136977
|
var fs7 = __require("fs");
|
|
136927
136978
|
var gaxios_1 = require_src3();
|
|
136928
136979
|
var gcpMetadata = require_src5();
|
|
136929
|
-
var
|
|
136980
|
+
var os4 = __require("os");
|
|
136930
136981
|
var path13 = __require("path");
|
|
136931
136982
|
var crypto_1 = require_crypto3();
|
|
136932
136983
|
var computeclient_1 = require_computeclient();
|
|
@@ -137251,7 +137302,7 @@ var require_googleauth = __commonJS((exports) => {
|
|
|
137251
137302
|
}
|
|
137252
137303
|
}
|
|
137253
137304
|
fromStreamAsync(inputStream, options) {
|
|
137254
|
-
return new Promise((
|
|
137305
|
+
return new Promise((resolve8, reject) => {
|
|
137255
137306
|
if (!inputStream) {
|
|
137256
137307
|
throw new Error("Must pass in a stream containing the Google auth settings.");
|
|
137257
137308
|
}
|
|
@@ -137261,7 +137312,7 @@ var require_googleauth = __commonJS((exports) => {
|
|
|
137261
137312
|
try {
|
|
137262
137313
|
const data = JSON.parse(chunks.join(""));
|
|
137263
137314
|
const r5 = this._cacheClientFromJSON(data, options);
|
|
137264
|
-
return
|
|
137315
|
+
return resolve8(r5);
|
|
137265
137316
|
} catch (err) {
|
|
137266
137317
|
if (!this.keyFilename)
|
|
137267
137318
|
throw err;
|
|
@@ -137271,7 +137322,7 @@ var require_googleauth = __commonJS((exports) => {
|
|
|
137271
137322
|
});
|
|
137272
137323
|
this.cachedCredential = client3;
|
|
137273
137324
|
this.setGapicJWTValues(client3);
|
|
137274
|
-
return
|
|
137325
|
+
return resolve8(client3);
|
|
137275
137326
|
}
|
|
137276
137327
|
} catch (err) {
|
|
137277
137328
|
return reject(err);
|
|
@@ -137283,7 +137334,7 @@ var require_googleauth = __commonJS((exports) => {
|
|
|
137283
137334
|
return new jwtclient_1.JWT({ ...options, apiKey });
|
|
137284
137335
|
}
|
|
137285
137336
|
_isWindows() {
|
|
137286
|
-
const sys =
|
|
137337
|
+
const sys = os4.platform();
|
|
137287
137338
|
if (sys && sys.length >= 3) {
|
|
137288
137339
|
if (sys.substring(0, 3).toLowerCase() === "win") {
|
|
137289
137340
|
return true;
|
|
@@ -137292,16 +137343,16 @@ var require_googleauth = __commonJS((exports) => {
|
|
|
137292
137343
|
return false;
|
|
137293
137344
|
}
|
|
137294
137345
|
async getDefaultServiceProjectId() {
|
|
137295
|
-
return new Promise((
|
|
137346
|
+
return new Promise((resolve8) => {
|
|
137296
137347
|
(0, child_process_1.exec)("gcloud config config-helper --format json", (err, stdout) => {
|
|
137297
137348
|
if (!err && stdout) {
|
|
137298
137349
|
try {
|
|
137299
137350
|
const projectId = JSON.parse(stdout).configuration.properties.core.project;
|
|
137300
|
-
|
|
137351
|
+
resolve8(projectId);
|
|
137301
137352
|
return;
|
|
137302
137353
|
} catch (e5) {}
|
|
137303
137354
|
}
|
|
137304
|
-
|
|
137355
|
+
resolve8(null);
|
|
137305
137356
|
});
|
|
137306
137357
|
});
|
|
137307
137358
|
}
|
|
@@ -137973,7 +138024,7 @@ function refreshAwsAuth(awsAuthRefresh) {
|
|
|
137973
138024
|
logForDebugging("Running AWS auth refresh command");
|
|
137974
138025
|
const authStatusManager = AwsAuthStatusManager.getInstance();
|
|
137975
138026
|
authStatusManager.startAuthentication();
|
|
137976
|
-
return new Promise((
|
|
138027
|
+
return new Promise((resolve8) => {
|
|
137977
138028
|
const refreshProc = exec3(awsAuthRefresh, {
|
|
137978
138029
|
timeout: AWS_AUTH_REFRESH_TIMEOUT_MS
|
|
137979
138030
|
});
|
|
@@ -137995,13 +138046,13 @@ function refreshAwsAuth(awsAuthRefresh) {
|
|
|
137995
138046
|
if (code === 0) {
|
|
137996
138047
|
logForDebugging("AWS auth refresh completed successfully");
|
|
137997
138048
|
authStatusManager.endAuthentication(true);
|
|
137998
|
-
|
|
138049
|
+
resolve8(true);
|
|
137999
138050
|
} else {
|
|
138000
138051
|
const timedOut = signal === "SIGTERM";
|
|
138001
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):");
|
|
138002
138053
|
console.error(message);
|
|
138003
138054
|
authStatusManager.endAuthentication(false);
|
|
138004
|
-
|
|
138055
|
+
resolve8(false);
|
|
138005
138056
|
}
|
|
138006
138057
|
});
|
|
138007
138058
|
});
|
|
@@ -138116,7 +138167,7 @@ function refreshGcpAuth(gcpAuthRefresh) {
|
|
|
138116
138167
|
logForDebugging("Running GCP auth refresh command");
|
|
138117
138168
|
const authStatusManager = AwsAuthStatusManager.getInstance();
|
|
138118
138169
|
authStatusManager.startAuthentication();
|
|
138119
|
-
return new Promise((
|
|
138170
|
+
return new Promise((resolve8) => {
|
|
138120
138171
|
const refreshProc = exec3(gcpAuthRefresh, {
|
|
138121
138172
|
timeout: GCP_AUTH_REFRESH_TIMEOUT_MS
|
|
138122
138173
|
});
|
|
@@ -138138,13 +138189,13 @@ function refreshGcpAuth(gcpAuthRefresh) {
|
|
|
138138
138189
|
if (code === 0) {
|
|
138139
138190
|
logForDebugging("GCP auth refresh completed successfully");
|
|
138140
138191
|
authStatusManager.endAuthentication(true);
|
|
138141
|
-
|
|
138192
|
+
resolve8(true);
|
|
138142
138193
|
} else {
|
|
138143
138194
|
const timedOut = signal === "SIGTERM";
|
|
138144
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):");
|
|
138145
138196
|
console.error(message);
|
|
138146
138197
|
authStatusManager.endAuthentication(false);
|
|
138147
|
-
|
|
138198
|
+
resolve8(false);
|
|
138148
138199
|
}
|
|
138149
138200
|
});
|
|
138150
138201
|
});
|
|
@@ -138392,7 +138443,7 @@ var init_user = __esm(() => {
|
|
|
138392
138443
|
deviceId,
|
|
138393
138444
|
sessionId: getSessionId(),
|
|
138394
138445
|
email: getEmail(),
|
|
138395
|
-
appVersion: "4.2.
|
|
138446
|
+
appVersion: "4.2.15",
|
|
138396
138447
|
platform: getHostPlatformForAnalytics(),
|
|
138397
138448
|
organizationUuid,
|
|
138398
138449
|
accountUuid,
|
|
@@ -138483,7 +138534,7 @@ var init_genericProcessUtils = __esm(() => {
|
|
|
138483
138534
|
});
|
|
138484
138535
|
|
|
138485
138536
|
// src/utils/envDynamic.ts
|
|
138486
|
-
import { stat as
|
|
138537
|
+
import { stat as stat5 } from "fs/promises";
|
|
138487
138538
|
function getIsBubblewrapSandbox() {
|
|
138488
138539
|
return process.platform === "linux" && isEnvTruthy(process.env.CLAUDE_CODE_BUBBLEWRAP);
|
|
138489
138540
|
}
|
|
@@ -138559,7 +138610,7 @@ var init_envDynamic = __esm(() => {
|
|
|
138559
138610
|
});
|
|
138560
138611
|
if (process.platform === "linux") {
|
|
138561
138612
|
const muslArch = process.arch === "x64" ? "x86_64" : "aarch64";
|
|
138562
|
-
|
|
138613
|
+
stat5(`/lib/libc.musl-${muslArch}.so.1`).then(() => {
|
|
138563
138614
|
muslRuntimeCache = true;
|
|
138564
138615
|
}, () => {
|
|
138565
138616
|
muslRuntimeCache = false;
|
|
@@ -138679,7 +138730,7 @@ var init_metadata = __esm(() => {
|
|
|
138679
138730
|
"sed"
|
|
138680
138731
|
]);
|
|
138681
138732
|
getVersionBase = memoize_default(() => {
|
|
138682
|
-
const match = "4.2.
|
|
138733
|
+
const match = "4.2.15".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
|
|
138683
138734
|
return match ? match[0] : undefined;
|
|
138684
138735
|
});
|
|
138685
138736
|
buildEnvContext = memoize_default(async () => {
|
|
@@ -138719,9 +138770,9 @@ var init_metadata = __esm(() => {
|
|
|
138719
138770
|
isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
|
|
138720
138771
|
isClaudeCodeAction: isEnvTruthy(process.env.CLAUDE_CODE_ACTION),
|
|
138721
138772
|
isClaudeAiAuth: isClaudeAISubscriber(),
|
|
138722
|
-
version: "4.2.
|
|
138773
|
+
version: "4.2.15",
|
|
138723
138774
|
versionBase: getVersionBase(),
|
|
138724
|
-
buildTime: "2026-07-
|
|
138775
|
+
buildTime: "2026-07-17T11:35:24.701Z",
|
|
138725
138776
|
deploymentEnvironment: env4.detectDeploymentEnvironment(),
|
|
138726
138777
|
...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
|
|
138727
138778
|
githubEventName: process.env.GITHUB_EVENT_NAME,
|
|
@@ -139276,8 +139327,8 @@ var init_growthbook = __esm(() => {
|
|
|
139276
139327
|
});
|
|
139277
139328
|
|
|
139278
139329
|
// src/memdir/paths.ts
|
|
139279
|
-
import { homedir as
|
|
139280
|
-
import { isAbsolute as isAbsolute3, join as
|
|
139330
|
+
import { homedir as homedir6 } from "os";
|
|
139331
|
+
import { isAbsolute as isAbsolute3, join as join18, normalize as normalize3, sep as sep4 } from "path";
|
|
139281
139332
|
function getMemoryBaseDir() {
|
|
139282
139333
|
const remoteMemoryDir = getCostrictEnv("REMOTE_MEMORY_DIR");
|
|
139283
139334
|
if (remoteMemoryDir) {
|
|
@@ -139296,7 +139347,7 @@ function validateMemoryPath(raw, expandTilde) {
|
|
|
139296
139347
|
if (restNorm === "." || restNorm === "..") {
|
|
139297
139348
|
return;
|
|
139298
139349
|
}
|
|
139299
|
-
candidate =
|
|
139350
|
+
candidate = join18(homedir6(), rest);
|
|
139300
139351
|
}
|
|
139301
139352
|
const normalized = normalize3(candidate).replace(/[/\\]+$/u, "");
|
|
139302
139353
|
if (!isAbsolute3(normalized) || normalized.length < 3 || /^[A-Za-z]:$/.test(normalized) || normalized.startsWith("\\\\") || normalized.startsWith("//") || normalized.includes("\x00")) {
|
|
@@ -139328,8 +139379,8 @@ var init_paths = __esm(() => {
|
|
|
139328
139379
|
if (override) {
|
|
139329
139380
|
return override;
|
|
139330
139381
|
}
|
|
139331
|
-
const projectsDir =
|
|
139332
|
-
return (
|
|
139382
|
+
const projectsDir = join18(getMemoryBaseDir(), "projects");
|
|
139383
|
+
return (join18(projectsDir, sanitizePath(getAutoMemBase()), AUTO_MEM_DIRNAME) + sep4).normalize("NFC");
|
|
139333
139384
|
}, () => getProjectRoot());
|
|
139334
139385
|
});
|
|
139335
139386
|
|
|
@@ -139346,7 +139397,7 @@ var init_configConstants = () => {};
|
|
|
139346
139397
|
// src/utils/config.ts
|
|
139347
139398
|
import { randomBytes } from "crypto";
|
|
139348
139399
|
import { unwatchFile as unwatchFile2, watchFile as watchFile2 } from "fs";
|
|
139349
|
-
import { basename as basename3, dirname as dirname9, join as
|
|
139400
|
+
import { basename as basename3, dirname as dirname9, join as join19, resolve as resolve8 } from "path";
|
|
139350
139401
|
function createDefaultGlobalConfig() {
|
|
139351
139402
|
return {
|
|
139352
139403
|
numStartups: 0,
|
|
@@ -139411,7 +139462,7 @@ function computeTrustDialogAccepted() {
|
|
|
139411
139462
|
if (pathConfig?.hasTrustDialogAccepted) {
|
|
139412
139463
|
return true;
|
|
139413
139464
|
}
|
|
139414
|
-
const parentPath = normalizePathForConfigKey(
|
|
139465
|
+
const parentPath = normalizePathForConfigKey(resolve8(currentPath, ".."));
|
|
139415
139466
|
if (parentPath === currentPath) {
|
|
139416
139467
|
break;
|
|
139417
139468
|
}
|
|
@@ -139699,14 +139750,14 @@ function saveConfigWithLock(file2, createDefault, mergeFn, readCurrent) {
|
|
|
139699
139750
|
const mostRecentTimestamp = mostRecentBackup ? Number(mostRecentBackup.split(".backup.").pop()) : 0;
|
|
139700
139751
|
const shouldCreateBackup = Number.isNaN(mostRecentTimestamp) || Date.now() - mostRecentTimestamp >= MIN_BACKUP_INTERVAL_MS;
|
|
139701
139752
|
if (shouldCreateBackup) {
|
|
139702
|
-
const backupPath =
|
|
139753
|
+
const backupPath = join19(backupDir, `${fileBase}.backup.${Date.now()}`);
|
|
139703
139754
|
fs7.copyFileSync(file2, backupPath);
|
|
139704
139755
|
}
|
|
139705
139756
|
const MAX_BACKUPS = 5;
|
|
139706
139757
|
const backupsForCleanup = shouldCreateBackup ? fs7.readdirStringSync(backupDir).filter((f5) => f5.startsWith(`${fileBase}.backup.`)).sort().reverse() : existingBackups;
|
|
139707
139758
|
for (const oldBackup of backupsForCleanup.slice(MAX_BACKUPS)) {
|
|
139708
139759
|
try {
|
|
139709
|
-
fs7.unlinkSync(
|
|
139760
|
+
fs7.unlinkSync(join19(backupDir, oldBackup));
|
|
139710
139761
|
} catch {}
|
|
139711
139762
|
}
|
|
139712
139763
|
} catch (e5) {
|
|
@@ -139732,7 +139783,7 @@ function saveConfigWithLock(file2, createDefault, mergeFn, readCurrent) {
|
|
|
139732
139783
|
}
|
|
139733
139784
|
}
|
|
139734
139785
|
function getConfigBackupDir() {
|
|
139735
|
-
return
|
|
139786
|
+
return join19(getClaudeConfigHomeDir(), "backups");
|
|
139736
139787
|
}
|
|
139737
139788
|
function findMostRecentBackup(file2) {
|
|
139738
139789
|
const fs7 = getFsImplementation();
|
|
@@ -139741,7 +139792,7 @@ function findMostRecentBackup(file2) {
|
|
|
139741
139792
|
const backupDirs = [primaryBackupDir];
|
|
139742
139793
|
const legacyHome = getLegacyConfigHomeDir();
|
|
139743
139794
|
if (legacyHome) {
|
|
139744
|
-
const legacyBackupDir =
|
|
139795
|
+
const legacyBackupDir = join19(legacyHome, "backups");
|
|
139745
139796
|
if (legacyBackupDir !== primaryBackupDir) {
|
|
139746
139797
|
backupDirs.push(legacyBackupDir);
|
|
139747
139798
|
}
|
|
@@ -139751,7 +139802,7 @@ function findMostRecentBackup(file2) {
|
|
|
139751
139802
|
const backups = fs7.readdirStringSync(backupDir).filter((f5) => f5.startsWith(`${fileBase}.backup.`)).sort();
|
|
139752
139803
|
const mostRecent = backups.at(-1);
|
|
139753
139804
|
if (mostRecent) {
|
|
139754
|
-
return
|
|
139805
|
+
return join19(backupDir, mostRecent);
|
|
139755
139806
|
}
|
|
139756
139807
|
} catch {}
|
|
139757
139808
|
}
|
|
@@ -139760,7 +139811,7 @@ function findMostRecentBackup(file2) {
|
|
|
139760
139811
|
const backups = fs7.readdirStringSync(fileDir).filter((f5) => f5.startsWith(`${fileBase}.backup.`)).sort();
|
|
139761
139812
|
const mostRecent = backups.at(-1);
|
|
139762
139813
|
if (mostRecent) {
|
|
139763
|
-
return
|
|
139814
|
+
return join19(fileDir, mostRecent);
|
|
139764
139815
|
}
|
|
139765
139816
|
const legacyBackup = `${file2}.backup`;
|
|
139766
139817
|
try {
|
|
@@ -139843,7 +139894,7 @@ Claude configuration file at ${file2} is corrupted: ${error52.message}
|
|
|
139843
139894
|
const currentContent = fs7.readFileSync(file2, { encoding: "utf-8" });
|
|
139844
139895
|
for (const backup of existingCorruptedBackups) {
|
|
139845
139896
|
try {
|
|
139846
|
-
const backupContent = fs7.readFileSync(
|
|
139897
|
+
const backupContent = fs7.readFileSync(join19(corruptedBackupDir, backup), { encoding: "utf-8" });
|
|
139847
139898
|
if (currentContent === backupContent) {
|
|
139848
139899
|
alreadyBackedUp = true;
|
|
139849
139900
|
break;
|
|
@@ -139851,7 +139902,7 @@ Claude configuration file at ${file2} is corrupted: ${error52.message}
|
|
|
139851
139902
|
} catch {}
|
|
139852
139903
|
}
|
|
139853
139904
|
if (!alreadyBackedUp) {
|
|
139854
|
-
corruptedBackupPath =
|
|
139905
|
+
corruptedBackupPath = join19(corruptedBackupDir, `${fileBase}.corrupted.${Date.now()}`);
|
|
139855
139906
|
try {
|
|
139856
139907
|
fs7.copyFileSync(file2, corruptedBackupPath);
|
|
139857
139908
|
logForDebugging(`Corrupted config backed up to: ${corruptedBackupPath}`, {
|
|
@@ -139946,7 +139997,7 @@ var init_config2 = __esm(() => {
|
|
|
139946
139997
|
if (gitRoot) {
|
|
139947
139998
|
return normalizePathForConfigKey(gitRoot);
|
|
139948
139999
|
}
|
|
139949
|
-
return normalizePathForConfigKey(
|
|
140000
|
+
return normalizePathForConfigKey(resolve8(originalCwd));
|
|
139950
140001
|
});
|
|
139951
140002
|
});
|
|
139952
140003
|
|
|
@@ -140130,39 +140181,60 @@ import { appendFileSync } from "fs";
|
|
|
140130
140181
|
import path2 from "path";
|
|
140131
140182
|
|
|
140132
140183
|
// src/services/rawDump/dirs.ts
|
|
140184
|
+
init_memoize();
|
|
140185
|
+
init_envUtils();
|
|
140186
|
+
init_sessionStoragePortable();
|
|
140133
140187
|
import fs from "fs";
|
|
140134
|
-
import
|
|
140188
|
+
import { stat as stat2 } from "fs/promises";
|
|
140135
140189
|
import path from "path";
|
|
140136
|
-
|
|
140137
|
-
const
|
|
140138
|
-
|
|
140139
|
-
|
|
140140
|
-
|
|
140141
|
-
|
|
140142
|
-
|
|
140143
|
-
|
|
140144
|
-
|
|
140145
|
-
}
|
|
140146
|
-
|
|
140147
|
-
|
|
140148
|
-
|
|
140149
|
-
|
|
140150
|
-
|
|
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
|
+
}
|
|
140151
140208
|
}
|
|
140152
|
-
function
|
|
140153
|
-
const
|
|
140154
|
-
|
|
140155
|
-
|
|
140156
|
-
|
|
140157
|
-
|
|
140158
|
-
|
|
140159
|
-
|
|
140160
|
-
|
|
140161
|
-
|
|
140162
|
-
|
|
140163
|
-
|
|
140164
|
-
const
|
|
140165
|
-
|
|
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;
|
|
140166
140238
|
}
|
|
140167
140239
|
|
|
140168
140240
|
// src/services/rawDump/logger.ts
|
|
@@ -140550,6 +140622,9 @@ function addQueueTasks(tasks) {
|
|
|
140550
140622
|
if (existing) {
|
|
140551
140623
|
if (task.enqueuedAt > existing.enqueuedAt) {
|
|
140552
140624
|
existing.enqueuedAt = task.enqueuedAt;
|
|
140625
|
+
if (task.transcriptPath) {
|
|
140626
|
+
existing.transcriptPath = task.transcriptPath;
|
|
140627
|
+
}
|
|
140553
140628
|
}
|
|
140554
140629
|
} else {
|
|
140555
140630
|
state_task.tasks[key] = {
|
|
@@ -140557,6 +140632,7 @@ function addQueueTasks(tasks) {
|
|
|
140557
140632
|
uploadedAt: "",
|
|
140558
140633
|
attemptCount: 0,
|
|
140559
140634
|
directory: task.directory,
|
|
140635
|
+
transcriptPath: task.transcriptPath,
|
|
140560
140636
|
sessionId: task.sessionId,
|
|
140561
140637
|
messageId: task.messageId,
|
|
140562
140638
|
historyNo: undefined
|
|
@@ -140581,8 +140657,8 @@ init_credentials();
|
|
|
140581
140657
|
init_token();
|
|
140582
140658
|
import { promises as fs12 } from "fs";
|
|
140583
140659
|
import { createHash as createHash4 } from "crypto";
|
|
140584
|
-
import
|
|
140585
|
-
import
|
|
140660
|
+
import os4 from "os";
|
|
140661
|
+
import path19 from "path";
|
|
140586
140662
|
|
|
140587
140663
|
// src/costrict/provider/tokenManager.ts
|
|
140588
140664
|
init_credentials();
|
|
@@ -140912,7 +140988,7 @@ function getRawDumpMode() {
|
|
|
140912
140988
|
return 3;
|
|
140913
140989
|
return 1;
|
|
140914
140990
|
}
|
|
140915
|
-
function
|
|
140991
|
+
function normalizeProjectPath(dir) {
|
|
140916
140992
|
return dir.replace(/:/gu, "-").replace(/[/\\]/gu, "-");
|
|
140917
140993
|
}
|
|
140918
140994
|
function getDateFromTimestamp(ts) {
|
|
@@ -140945,7 +141021,7 @@ async function writeLocalDump(type, body) {
|
|
|
140945
141021
|
endpoint = "/raw-store/task-conversation";
|
|
140946
141022
|
} else if (type == "commit") {
|
|
140947
141023
|
ymd = getDateFromTimestamp(getTimestampField("commit", body));
|
|
140948
|
-
subdir = path15.join(
|
|
141024
|
+
subdir = path15.join(normalizeProjectPath(body.repo_addr), normalizeProjectPath(body.repo_branch), ymd);
|
|
140949
141025
|
fname = body.commit_id;
|
|
140950
141026
|
endpoint = "/raw-store/commit";
|
|
140951
141027
|
} else if (type == "statistics") {
|
|
@@ -140957,7 +141033,7 @@ async function writeLocalDump(type, body) {
|
|
|
140957
141033
|
fname = `${h6}-${m3}-${s}`;
|
|
140958
141034
|
endpoint = "/raw-store/statistics";
|
|
140959
141035
|
} else if (type == "raw") {
|
|
140960
|
-
subdir = path15.join(
|
|
141036
|
+
subdir = path15.join(normalizeProjectPath(body.project), body.session_id);
|
|
140961
141037
|
fname = String(body.start_cursor);
|
|
140962
141038
|
endpoint = "/raw-store/raw-log";
|
|
140963
141039
|
} else {
|
|
@@ -140986,12 +141062,24 @@ import { promises as fs9 } from "fs";
|
|
|
140986
141062
|
import path17 from "path";
|
|
140987
141063
|
|
|
140988
141064
|
// src/services/rawDump/lock.ts
|
|
141065
|
+
import { randomUUID as randomUUID4 } from "crypto";
|
|
140989
141066
|
import { promises as fs8 } from "fs";
|
|
140990
141067
|
import path16 from "path";
|
|
140991
141068
|
var LOCK_INFO_FILE = "lock.json";
|
|
141069
|
+
var PUBLICATION_GRACE_MS = 5000;
|
|
140992
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
|
+
}
|
|
140993
141082
|
try {
|
|
140994
|
-
const text = await fs8.readFile(path16.join(lockDir, LOCK_INFO_FILE), "utf-8");
|
|
140995
141083
|
const info = JSON.parse(text);
|
|
140996
141084
|
if (!info.pid || typeof info.pid !== "number")
|
|
140997
141085
|
return false;
|
|
@@ -141005,7 +141093,49 @@ async function isHolderAlive(lockDir) {
|
|
|
141005
141093
|
return false;
|
|
141006
141094
|
}
|
|
141007
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
|
+
}
|
|
141008
141136
|
async function acquireLock(lockDir, info) {
|
|
141137
|
+
const token = info.token ?? randomUUID4();
|
|
141138
|
+
const payload = JSON.stringify({ ...info, token });
|
|
141009
141139
|
let retried = false;
|
|
141010
141140
|
while (true) {
|
|
141011
141141
|
try {
|
|
@@ -141013,46 +141143,63 @@ async function acquireLock(lockDir, info) {
|
|
|
141013
141143
|
} catch (err) {
|
|
141014
141144
|
if (err.code === "EEXIST") {
|
|
141015
141145
|
if (retried)
|
|
141016
|
-
return
|
|
141017
|
-
|
|
141018
|
-
|
|
141019
|
-
|
|
141020
|
-
|
|
141021
|
-
await fs8.rm(lockDir, { recursive: true, force: true });
|
|
141022
|
-
} catch {
|
|
141023
|
-
return false;
|
|
141024
|
-
}
|
|
141146
|
+
return null;
|
|
141147
|
+
if (await isHolderAlive(lockDir))
|
|
141148
|
+
return null;
|
|
141149
|
+
if (!await reclaimStaleLock(lockDir))
|
|
141150
|
+
return null;
|
|
141025
141151
|
retried = true;
|
|
141026
141152
|
continue;
|
|
141027
141153
|
}
|
|
141028
|
-
return
|
|
141154
|
+
return null;
|
|
141029
141155
|
}
|
|
141030
141156
|
try {
|
|
141031
|
-
await fs8.writeFile(path16.join(lockDir, LOCK_INFO_FILE),
|
|
141032
|
-
return true;
|
|
141157
|
+
await fs8.writeFile(path16.join(lockDir, LOCK_INFO_FILE), payload, "utf-8");
|
|
141033
141158
|
} catch {
|
|
141034
|
-
await releaseLock(lockDir);
|
|
141035
|
-
return
|
|
141159
|
+
await releaseLock(lockDir, token);
|
|
141160
|
+
return null;
|
|
141036
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;
|
|
141037
141168
|
}
|
|
141038
141169
|
}
|
|
141039
|
-
async function releaseLock(lockDir) {
|
|
141170
|
+
async function releaseLock(lockDir, token) {
|
|
141040
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
|
+
}
|
|
141041
141184
|
await fs8.rm(lockDir, { recursive: true, force: true });
|
|
141042
141185
|
} catch {}
|
|
141043
141186
|
}
|
|
141044
141187
|
|
|
141045
141188
|
// src/services/rawDump/queue.ts
|
|
141046
|
-
|
|
141047
|
-
|
|
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
|
+
}
|
|
141048
141195
|
var MAX_ATTEMPTS = 4;
|
|
141049
141196
|
var queue = [];
|
|
141050
141197
|
var queueLoaded = false;
|
|
141051
|
-
async function loadQueue() {
|
|
141052
|
-
if (queueLoaded)
|
|
141198
|
+
async function loadQueue(force = false) {
|
|
141199
|
+
if (queueLoaded && !force)
|
|
141053
141200
|
return;
|
|
141054
141201
|
try {
|
|
141055
|
-
const text = await fs9.readFile(
|
|
141202
|
+
const text = await fs9.readFile(getQueueFile(), "utf-8");
|
|
141056
141203
|
queue = text.split(`
|
|
141057
141204
|
`).filter(Boolean).map((line) => {
|
|
141058
141205
|
try {
|
|
@@ -141061,32 +141208,43 @@ async function loadQueue() {
|
|
|
141061
141208
|
return null;
|
|
141062
141209
|
}
|
|
141063
141210
|
}).filter((t2) => t2 !== null);
|
|
141064
|
-
} catch {
|
|
141211
|
+
} catch (err) {
|
|
141212
|
+
if (err.code !== "ENOENT")
|
|
141213
|
+
throw err;
|
|
141065
141214
|
queue = [];
|
|
141066
141215
|
}
|
|
141067
141216
|
queueLoaded = true;
|
|
141068
141217
|
}
|
|
141069
|
-
function clearQueue() {
|
|
141218
|
+
async function clearQueue() {
|
|
141070
141219
|
queue = [];
|
|
141071
|
-
fs9.writeFile(
|
|
141220
|
+
await fs9.writeFile(getQueueFile(), "", "utf-8");
|
|
141072
141221
|
}
|
|
141073
141222
|
function getQueue() {
|
|
141074
141223
|
return [...queue];
|
|
141075
141224
|
}
|
|
141225
|
+
var queueLockToken = null;
|
|
141076
141226
|
async function acquireQueueLock() {
|
|
141077
|
-
|
|
141227
|
+
const token = await acquireLock(getQueueLockDir(), {
|
|
141078
141228
|
pid: process.pid,
|
|
141079
141229
|
startedAt: new Date().toISOString()
|
|
141080
141230
|
});
|
|
141231
|
+
if (token)
|
|
141232
|
+
queueLockToken = token;
|
|
141233
|
+
return token !== null;
|
|
141081
141234
|
}
|
|
141082
141235
|
async function releaseQueueLock() {
|
|
141083
|
-
|
|
141236
|
+
if (!queueLockToken)
|
|
141237
|
+
return;
|
|
141238
|
+
const token = queueLockToken;
|
|
141239
|
+
queueLockToken = null;
|
|
141240
|
+
await releaseLock(getQueueLockDir(), token);
|
|
141084
141241
|
}
|
|
141085
141242
|
|
|
141086
141243
|
// src/services/rawDump/history.ts
|
|
141244
|
+
init_envUtils();
|
|
141087
141245
|
import { promises as fs10 } from "fs";
|
|
141088
141246
|
import path18 from "path";
|
|
141089
|
-
var HISTORY_FILE = path18.join(
|
|
141247
|
+
var HISTORY_FILE = path18.join(getCostrictConfigHomeDir(), "history.jsonl");
|
|
141090
141248
|
var cache7 = null;
|
|
141091
141249
|
async function loadHistory() {
|
|
141092
141250
|
const items = [];
|
|
@@ -141152,7 +141310,6 @@ async function getProjectDirs() {
|
|
|
141152
141310
|
|
|
141153
141311
|
// src/services/rawDump/session.ts
|
|
141154
141312
|
import { promises as fs11 } from "fs";
|
|
141155
|
-
import path19 from "path";
|
|
141156
141313
|
|
|
141157
141314
|
// src/services/rawDump/parse.ts
|
|
141158
141315
|
function buildFlows(events) {
|
|
@@ -141254,10 +141411,15 @@ function fillConversation(conv, allSessionEvents) {
|
|
|
141254
141411
|
conv.preview = conv.requestContent.substring(0, 80);
|
|
141255
141412
|
const responseTexts = [];
|
|
141256
141413
|
for (let j6 = 1;j6 < conv.events.length; j6++) {
|
|
141257
|
-
const
|
|
141414
|
+
const event = conv.events[j6];
|
|
141415
|
+
if (event.type !== "assistant")
|
|
141416
|
+
continue;
|
|
141417
|
+
const text = getAssistantTextContent(event.message?.content);
|
|
141258
141418
|
if (text)
|
|
141259
141419
|
responseTexts.push(text);
|
|
141260
141420
|
}
|
|
141421
|
+
conv.responseContent = responseTexts.join(`
|
|
141422
|
+
`);
|
|
141261
141423
|
const diffs = [];
|
|
141262
141424
|
const toolEvents = [];
|
|
141263
141425
|
let model = "";
|
|
@@ -141317,6 +141479,21 @@ function getTextContent(content) {
|
|
|
141317
141479
|
}
|
|
141318
141480
|
return String(content);
|
|
141319
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
|
+
}
|
|
141320
141497
|
function detectSender(assistant, user) {
|
|
141321
141498
|
const mode = String(assistant.mode ?? "");
|
|
141322
141499
|
if (mode === "agent" || mode === "auto")
|
|
@@ -141672,24 +141849,20 @@ function parseSession(cacheConversations, events) {
|
|
|
141672
141849
|
// src/services/rawDump/session.ts
|
|
141673
141850
|
var log3 = createLogger("session");
|
|
141674
141851
|
async function loadSessionMessages(sessionFile) {
|
|
141675
|
-
|
|
141676
|
-
|
|
141677
|
-
const messages = text.split(`
|
|
141852
|
+
const text = await fs11.readFile(sessionFile, "utf-8");
|
|
141853
|
+
const messages = text.split(`
|
|
141678
141854
|
`).filter(Boolean).map((line) => {
|
|
141679
|
-
|
|
141680
|
-
|
|
141681
|
-
|
|
141682
|
-
|
|
141683
|
-
|
|
141684
|
-
|
|
141685
|
-
|
|
141686
|
-
|
|
141687
|
-
|
|
141688
|
-
|
|
141689
|
-
|
|
141690
|
-
} catch {
|
|
141691
|
-
return [];
|
|
141692
|
-
}
|
|
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;
|
|
141693
141866
|
}
|
|
141694
141867
|
var sessionMessagesCache = new Map;
|
|
141695
141868
|
function cleanupOldSessions() {
|
|
@@ -141701,24 +141874,14 @@ function cleanupOldSessions() {
|
|
|
141701
141874
|
}
|
|
141702
141875
|
}
|
|
141703
141876
|
}
|
|
141704
|
-
async function getParsedSession(taskDir, sessionId) {
|
|
141705
|
-
const
|
|
141706
|
-
|
|
141707
|
-
|
|
141708
|
-
const sessionFile = path19.join(sessionDir, `${sessionId}.jsonl`);
|
|
141709
|
-
let stats;
|
|
141710
|
-
try {
|
|
141711
|
-
stats = await fs11.stat(sessionFile);
|
|
141712
|
-
} catch {
|
|
141713
|
-
return {
|
|
141714
|
-
sessionJsonlFileName: sessionFile,
|
|
141715
|
-
fileTimestamp: 0,
|
|
141716
|
-
cacheTimestamp: Date.now(),
|
|
141717
|
-
fileSize: 0,
|
|
141718
|
-
messages: [],
|
|
141719
|
-
parsedSession: parseSession([], [])
|
|
141720
|
-
};
|
|
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}`);
|
|
141721
141881
|
}
|
|
141882
|
+
const cacheKey = sessionFile;
|
|
141883
|
+
const cached3 = sessionMessagesCache.get(cacheKey);
|
|
141884
|
+
const stats = await fs11.stat(sessionFile);
|
|
141722
141885
|
const needsReanalysis = !cached3 || cached3.fileTimestamp !== stats.mtimeMs || cached3.fileSize !== stats.size || !cached3.parsedSession;
|
|
141723
141886
|
if (!needsReanalysis && cached3) {
|
|
141724
141887
|
log3.debug("using cached parsed session", { sessionId });
|
|
@@ -141726,7 +141889,7 @@ async function getParsedSession(taskDir, sessionId) {
|
|
|
141726
141889
|
}
|
|
141727
141890
|
cleanupOldSessions();
|
|
141728
141891
|
const start = Date.now();
|
|
141729
|
-
const messages =
|
|
141892
|
+
const messages = await loadSessionMessages(sessionFile);
|
|
141730
141893
|
const elapsed = Date.now() - start;
|
|
141731
141894
|
if (elapsed > 100) {
|
|
141732
141895
|
log3.info("loadSessionMessages slow", { sessionId, elapsedMs: elapsed });
|
|
@@ -141787,7 +141950,16 @@ async function statHistorySessions() {
|
|
|
141787
141950
|
});
|
|
141788
141951
|
const sessionDateMap = new Map;
|
|
141789
141952
|
for (const item of uniqueItems) {
|
|
141790
|
-
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;
|
|
141791
141963
|
const messages = cacheEntry.messages;
|
|
141792
141964
|
if (!messages || messages.length === 0)
|
|
141793
141965
|
continue;
|
|
@@ -141871,7 +142043,6 @@ async function statHistorySessions() {
|
|
|
141871
142043
|
|
|
141872
142044
|
// src/services/rawDump/worker.ts
|
|
141873
142045
|
var log5 = createLogger("worker");
|
|
141874
|
-
var CSC_DIR = getCscDir();
|
|
141875
142046
|
var REQUEST_TIMEOUT_MS = 30000;
|
|
141876
142047
|
var TOOL_EVENTS_PAYLOAD_BUDGET = 256 * 1024;
|
|
141877
142048
|
function capToolEventsPayload(events) {
|
|
@@ -141898,12 +142069,12 @@ async function getCachedRepoInfo(directory) {
|
|
|
141898
142069
|
}
|
|
141899
142070
|
async function processTask(task, authData) {
|
|
141900
142071
|
log5.info("processing task:", { task });
|
|
141901
|
-
await uploadRaw(task.sessionId, task.directory, authData);
|
|
142072
|
+
await uploadRaw(task.sessionId, task.directory, authData, task.transcriptPath);
|
|
141902
142073
|
const repoInfo = await getCachedRepoInfo(task.directory);
|
|
141903
|
-
const cacheEntry = await getParsedSession(task.directory, task.sessionId);
|
|
142074
|
+
const cacheEntry = await getParsedSession(task.directory, task.sessionId, task.transcriptPath);
|
|
141904
142075
|
const parsedSession = cacheEntry.parsedSession;
|
|
141905
142076
|
if (parsedSession.conversations.length === 0) {
|
|
141906
|
-
|
|
142077
|
+
throw new Error(`session transcript contains no conversations: ${cacheEntry.sessionJsonlFileName}`);
|
|
141907
142078
|
}
|
|
141908
142079
|
await uploadSummary({ sessionId: task.sessionId, directory: task.directory, parsedSession }, authData);
|
|
141909
142080
|
for (const conv of parsedSession.conversations) {
|
|
@@ -141994,7 +142165,7 @@ async function postJson(url3, body, headers, maxAttempts = 3) {
|
|
|
141994
142165
|
for (let attempt = 0;attempt < maxAttempts; attempt++) {
|
|
141995
142166
|
if (attempt > 0) {
|
|
141996
142167
|
const delay = 5000 * 2 ** (attempt - 1);
|
|
141997
|
-
await new Promise((
|
|
142168
|
+
await new Promise((resolve9) => setTimeout(resolve9, delay));
|
|
141998
142169
|
}
|
|
141999
142170
|
const controller = new AbortController;
|
|
142000
142171
|
const timer = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS);
|
|
@@ -142171,7 +142342,7 @@ async function authWithFallback() {
|
|
|
142171
142342
|
const version4 = getClientVersion();
|
|
142172
142343
|
let deviceId = process.env.CSC_DEVICE_ID;
|
|
142173
142344
|
if (!deviceId) {
|
|
142174
|
-
const deviceIdFile =
|
|
142345
|
+
const deviceIdFile = path19.join(getLocalDumpDir(), "device-id");
|
|
142175
142346
|
try {
|
|
142176
142347
|
deviceId = (await fs12.readFile(deviceIdFile, "utf-8")).trim();
|
|
142177
142348
|
} catch {}
|
|
@@ -142208,10 +142379,14 @@ async function authWithFallback() {
|
|
|
142208
142379
|
};
|
|
142209
142380
|
}
|
|
142210
142381
|
}
|
|
142211
|
-
async function uploadRaw(sessionId, directory, authData) {
|
|
142212
|
-
const normalizedProject =
|
|
142382
|
+
async function uploadRaw(sessionId, directory, authData, transcriptPath) {
|
|
142383
|
+
const normalizedProject = normalizeProjectPath(directory);
|
|
142213
142384
|
const stateKey = `${normalizedProject}/${sessionId}`;
|
|
142214
|
-
const filePath =
|
|
142385
|
+
const filePath = await resolveTranscriptPath(directory, sessionId, transcriptPath);
|
|
142386
|
+
if (!filePath) {
|
|
142387
|
+
log5.debug("raw file not found, skip", { sessionId, directory });
|
|
142388
|
+
return;
|
|
142389
|
+
}
|
|
142215
142390
|
const lastReportedCount = state_raw.logs[stateKey] ?? 0;
|
|
142216
142391
|
let fileContent;
|
|
142217
142392
|
try {
|
|
@@ -142373,7 +142548,7 @@ async function uploadSummary(payload, authData) {
|
|
|
142373
142548
|
client_ide: "cli",
|
|
142374
142549
|
client_version: authData.version,
|
|
142375
142550
|
client_os: detectOs(),
|
|
142376
|
-
client_os_version:
|
|
142551
|
+
client_os_version: os4.release(),
|
|
142377
142552
|
caller: process.env.CSC_RAW_DUMP_CALLER || "chat"
|
|
142378
142553
|
};
|
|
142379
142554
|
await uploadReport(authData, "/raw-store/task-summary", body);
|
|
@@ -142540,12 +142715,12 @@ async function processIncompleteTasks(authData) {
|
|
|
142540
142715
|
});
|
|
142541
142716
|
state_task.tasks[key].uploadedAt = "DEAD_LETTER";
|
|
142542
142717
|
state_task.incomplete--;
|
|
142543
|
-
await saveTasks();
|
|
142544
142718
|
log5.error("task moved to dead letter", {
|
|
142545
142719
|
key,
|
|
142546
142720
|
attemptCount: state_task.tasks[key].attemptCount
|
|
142547
142721
|
});
|
|
142548
142722
|
}
|
|
142723
|
+
await saveTasks();
|
|
142549
142724
|
}
|
|
142550
142725
|
}
|
|
142551
142726
|
}
|
|
@@ -142662,6 +142837,7 @@ async function runQueueTimer() {
|
|
|
142662
142837
|
return;
|
|
142663
142838
|
}
|
|
142664
142839
|
try {
|
|
142840
|
+
await loadQueue(true);
|
|
142665
142841
|
const newTasks = getQueue();
|
|
142666
142842
|
if (newTasks.length === 0) {
|
|
142667
142843
|
if (state_task.incomplete === 0) {
|
|
@@ -142673,7 +142849,7 @@ async function runQueueTimer() {
|
|
|
142673
142849
|
log5.info(`processing ${newTasks.length} new tasks`);
|
|
142674
142850
|
addQueueTasks(newTasks);
|
|
142675
142851
|
await saveTasks();
|
|
142676
|
-
clearQueue();
|
|
142852
|
+
await clearQueue();
|
|
142677
142853
|
} catch (err) {
|
|
142678
142854
|
log5.error("queue timer failed", {
|
|
142679
142855
|
error: err instanceof Error ? err.message : String(err)
|
|
@@ -142701,18 +142877,26 @@ if (scriptPath.endsWith("worker.ts") || scriptPath.endsWith("worker.js")) {
|
|
|
142701
142877
|
}
|
|
142702
142878
|
|
|
142703
142879
|
// src/services/rawDump/timerWorker.ts
|
|
142704
|
-
import
|
|
142880
|
+
import path20 from "path";
|
|
142705
142881
|
var log6 = createLogger("timer");
|
|
142706
|
-
var TIMER_LOCK_DIR =
|
|
142882
|
+
var TIMER_LOCK_DIR = path20.join(getRawDumpDir(), "csc-timer.lock.d");
|
|
142707
142883
|
var isRunning = false;
|
|
142884
|
+
var timerLockToken = null;
|
|
142708
142885
|
async function acquireTimerLock() {
|
|
142709
|
-
|
|
142886
|
+
const token = await acquireLock(TIMER_LOCK_DIR, {
|
|
142710
142887
|
pid: process.pid,
|
|
142711
142888
|
startedAt: new Date().toISOString()
|
|
142712
142889
|
});
|
|
142890
|
+
if (token)
|
|
142891
|
+
timerLockToken = token;
|
|
142892
|
+
return token !== null;
|
|
142713
142893
|
}
|
|
142714
142894
|
async function releaseTimerLock() {
|
|
142715
|
-
|
|
142895
|
+
if (!timerLockToken)
|
|
142896
|
+
return;
|
|
142897
|
+
const token = timerLockToken;
|
|
142898
|
+
timerLockToken = null;
|
|
142899
|
+
await releaseLock(TIMER_LOCK_DIR, token);
|
|
142716
142900
|
}
|
|
142717
142901
|
async function runTimers() {
|
|
142718
142902
|
if (isRunning)
|
|
@@ -142768,10 +142952,10 @@ if (scriptPath2.endsWith("timerWorker.ts") || scriptPath2.endsWith("timerWorker.
|
|
|
142768
142952
|
|
|
142769
142953
|
// src/services/rawDump/parentHeartbeat.ts
|
|
142770
142954
|
import { promises as fs13 } from "fs";
|
|
142771
|
-
import
|
|
142955
|
+
import path21 from "path";
|
|
142772
142956
|
var HEARTBEAT_STALE_MS = 15000;
|
|
142773
142957
|
function getParentHeartbeatPath(pid) {
|
|
142774
|
-
return
|
|
142958
|
+
return path21.join(getRawDumpDir(), `csc-parent-heartbeat-${pid}.json`);
|
|
142775
142959
|
}
|
|
142776
142960
|
async function readParentHeartbeat(pid) {
|
|
142777
142961
|
try {
|
|
@@ -142803,13 +142987,19 @@ function scheduleForcedExit(reason, code) {
|
|
|
142803
142987
|
process.exit(code);
|
|
142804
142988
|
}, graceMs);
|
|
142805
142989
|
}
|
|
142806
|
-
process.on("SIGTERM", () => scheduleForcedExit("SIGTERM", 0));
|
|
142807
|
-
process.on("SIGINT", () => scheduleForcedExit("SIGINT", 0));
|
|
142808
|
-
process.on("unhandledRejection", (reason) => {
|
|
142809
|
-
log7.error("unhandled rejection", { reason: String(reason), workerPid: process.pid });
|
|
142810
|
-
});
|
|
142811
142990
|
var PARENT_PID = process.ppid;
|
|
142812
|
-
var
|
|
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
|
+
}
|
|
142813
143003
|
var parentHeartbeat = null;
|
|
142814
143004
|
async function refreshParentHeartbeat() {
|
|
142815
143005
|
parentHeartbeat = await readParentHeartbeat(PARENT_PID);
|
|
@@ -142838,31 +143028,34 @@ var stateLoaded = false;
|
|
|
142838
143028
|
function startBatchWorker() {
|
|
142839
143029
|
process.title = "csc_batch_worker";
|
|
142840
143030
|
log7.info("batch worker started");
|
|
142841
|
-
|
|
142842
|
-
|
|
142843
|
-
}).catch((err) => {
|
|
142844
|
-
log7.error("failed to load state", {
|
|
142845
|
-
error: err instanceof Error ? err.message : String(err)
|
|
142846
|
-
});
|
|
142847
|
-
process.exit(1);
|
|
142848
|
-
});
|
|
142849
|
-
loadQueue().catch((err) => {
|
|
142850
|
-
log7.error("failed to load queue", {
|
|
142851
|
-
error: err instanceof Error ? err.message : String(err)
|
|
142852
|
-
});
|
|
142853
|
-
process.exit(1);
|
|
142854
|
-
});
|
|
142855
|
-
setImmediate(async () => {
|
|
143031
|
+
startParentWatchdog();
|
|
143032
|
+
(async () => {
|
|
142856
143033
|
try {
|
|
142857
|
-
await
|
|
143034
|
+
await loadAllState();
|
|
143035
|
+
await loadQueue();
|
|
143036
|
+
stateLoaded = true;
|
|
142858
143037
|
} catch (err) {
|
|
142859
|
-
log7.error("
|
|
143038
|
+
log7.error("failed to load state", {
|
|
142860
143039
|
error: err instanceof Error ? err.message : String(err)
|
|
142861
143040
|
});
|
|
143041
|
+
process.exit(1);
|
|
143042
|
+
return;
|
|
142862
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
|
+
});
|
|
142863
143058
|
});
|
|
142864
|
-
startTimerWorker();
|
|
142865
|
-
startParentWatchdog();
|
|
142866
143059
|
}
|
|
142867
143060
|
function startParentWatchdog() {
|
|
142868
143061
|
if (!IS_WORKER_PROCESS)
|
|
@@ -142905,5 +143098,5 @@ export {
|
|
|
142905
143098
|
startBatchWorker
|
|
142906
143099
|
};
|
|
142907
143100
|
|
|
142908
|
-
//# debugId=
|
|
142909
|
-
|
|
143101
|
+
//# debugId=CF029F1C9836782B64756E2164756E21
|
|
143102
|
+
|