claude-use 11.66.1 → 11.66.3
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.cjs +324 -87
- package/dist/index.cjs +22 -16
- package/dist/index.mjs +22 -16
- package/package.json +2 -2
package/dist/cli.cjs
CHANGED
|
@@ -25872,20 +25872,7 @@ var init_statusline = __esm({
|
|
|
25872
25872
|
}
|
|
25873
25873
|
});
|
|
25874
25874
|
|
|
25875
|
-
// node_modules/.pnpm/trilean@1.
|
|
25876
|
-
var complexFromPolar;
|
|
25877
|
-
var init_complex = __esm({
|
|
25878
|
-
"node_modules/.pnpm/trilean@1.7.1/node_modules/trilean/dist/complex.js"() {
|
|
25879
|
-
complexFromPolar = (magnitude, phase, unit) => ({
|
|
25880
|
-
kind: "complex",
|
|
25881
|
-
re: magnitude * Math.cos(phase),
|
|
25882
|
-
im: magnitude * Math.sin(phase),
|
|
25883
|
-
unit
|
|
25884
|
-
});
|
|
25885
|
-
}
|
|
25886
|
-
});
|
|
25887
|
-
|
|
25888
|
-
// node_modules/.pnpm/trilean@1.7.1/node_modules/trilean/dist/computed-value.js
|
|
25875
|
+
// node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/computed-value.js
|
|
25889
25876
|
function normalizeUnit(unit) {
|
|
25890
25877
|
if (unit === void 0) return {};
|
|
25891
25878
|
const normalized = {};
|
|
@@ -25916,7 +25903,7 @@ function combineUnitsForDivide(a10, b) {
|
|
|
25916
25903
|
}
|
|
25917
25904
|
var UnitSchema, DurationUnitSchema, ComputedValueSchema;
|
|
25918
25905
|
var init_computed_value = __esm({
|
|
25919
|
-
"node_modules/.pnpm/trilean@1.
|
|
25906
|
+
"node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/computed-value.js"() {
|
|
25920
25907
|
init_zod();
|
|
25921
25908
|
UnitSchema = external_exports.record(external_exports.string(), external_exports.number());
|
|
25922
25909
|
DurationUnitSchema = external_exports.enum([
|
|
@@ -25959,7 +25946,20 @@ var init_computed_value = __esm({
|
|
|
25959
25946
|
}
|
|
25960
25947
|
});
|
|
25961
25948
|
|
|
25962
|
-
// node_modules/.pnpm/trilean@1.
|
|
25949
|
+
// node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/complex.js
|
|
25950
|
+
var complexFromPolar;
|
|
25951
|
+
var init_complex = __esm({
|
|
25952
|
+
"node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/complex.js"() {
|
|
25953
|
+
complexFromPolar = (magnitude, phase, unit) => ({
|
|
25954
|
+
kind: "complex",
|
|
25955
|
+
re: magnitude * Math.cos(phase),
|
|
25956
|
+
im: magnitude * Math.sin(phase),
|
|
25957
|
+
unit
|
|
25958
|
+
});
|
|
25959
|
+
}
|
|
25960
|
+
});
|
|
25961
|
+
|
|
25962
|
+
// node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/evaluation.js
|
|
25963
25963
|
function definite(value2) {
|
|
25964
25964
|
return {
|
|
25965
25965
|
status: "definite",
|
|
@@ -25980,7 +25980,7 @@ function firstIndeterminate(...results) {
|
|
|
25980
25980
|
}
|
|
25981
25981
|
var IndeterminateReasonSchema;
|
|
25982
25982
|
var init_evaluation = __esm({
|
|
25983
|
-
"node_modules/.pnpm/trilean@1.
|
|
25983
|
+
"node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/evaluation.js"() {
|
|
25984
25984
|
init_zod();
|
|
25985
25985
|
IndeterminateReasonSchema = external_exports.object({
|
|
25986
25986
|
/** Which of the three reason categories applies. */
|
|
@@ -25995,10 +25995,10 @@ var init_evaluation = __esm({
|
|
|
25995
25995
|
}
|
|
25996
25996
|
});
|
|
25997
25997
|
|
|
25998
|
-
// node_modules/.pnpm/trilean@1.
|
|
25998
|
+
// node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/json-value.js
|
|
25999
25999
|
var JsonValueSchema;
|
|
26000
26000
|
var init_json_value = __esm({
|
|
26001
|
-
"node_modules/.pnpm/trilean@1.
|
|
26001
|
+
"node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/json-value.js"() {
|
|
26002
26002
|
init_zod();
|
|
26003
26003
|
JsonValueSchema = external_exports.lazy(() => external_exports.union([
|
|
26004
26004
|
external_exports.string(),
|
|
@@ -26011,10 +26011,10 @@ var init_json_value = __esm({
|
|
|
26011
26011
|
}
|
|
26012
26012
|
});
|
|
26013
26013
|
|
|
26014
|
-
// node_modules/.pnpm/trilean@1.
|
|
26014
|
+
// node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/tree.js
|
|
26015
26015
|
var ComparisonOperatorSchema, TextComparisonOperatorSchema, MembershipOperatorSchema, ArithmeticOperatorSchema, HitPolicySchema, NotNodeSchema, AndNodeSchema, OrNodeSchema, AllOfNodeSchema, AnyOfNodeSchema, CompareNodeSchema, TextCompareNodeSchema, MemberOfNodeSchema, ExistsNodeSchema, SomeNodeSchema, EveryNodeSchema, TreeReferenceNodeSchema, PredicateNodeSchema, NumberLiteralNodeSchema, TextLiteralNodeSchema, BooleanLiteralNodeSchema, InstantLiteralNodeSchema, DurationLiteralNodeSchema, ComplexRectangularLiteralNodeSchema, ComplexPolarLiteralNodeSchema, ComplexLiteralNodeSchema, ReferenceNodeSchema, ArithmeticNodeSchema, NegateNodeSchema, CallNodeSchema, LookupNodeSchema, ConditionalCaseSchema, ConditionalNodeSchema, FoldCombinerSchema, FoldNodeSchema, AccumulatorNodeSchema, DelegateNodeSchema, CoreExpressionNodeSchema, ExpressionNodeSchema;
|
|
26016
26016
|
var init_tree = __esm({
|
|
26017
|
-
"node_modules/.pnpm/trilean@1.
|
|
26017
|
+
"node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/tree.js"() {
|
|
26018
26018
|
init_computed_value();
|
|
26019
26019
|
init_json_value();
|
|
26020
26020
|
init_zod();
|
|
@@ -26302,15 +26302,15 @@ var init_tree = __esm({
|
|
|
26302
26302
|
}
|
|
26303
26303
|
});
|
|
26304
26304
|
|
|
26305
|
-
// node_modules/.pnpm/trilean@1.
|
|
26305
|
+
// node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/functions.js
|
|
26306
26306
|
var emptyFunctionRegistry;
|
|
26307
26307
|
var init_functions = __esm({
|
|
26308
|
-
"node_modules/.pnpm/trilean@1.
|
|
26308
|
+
"node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/functions.js"() {
|
|
26309
26309
|
emptyFunctionRegistry = {};
|
|
26310
26310
|
}
|
|
26311
26311
|
});
|
|
26312
26312
|
|
|
26313
|
-
// node_modules/.pnpm/trilean@1.
|
|
26313
|
+
// node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/evaluator-budget.js
|
|
26314
26314
|
function createEvaluationBudget(maxNodes, maxNestingDepth) {
|
|
26315
26315
|
let nodesVisited = 0;
|
|
26316
26316
|
return { checkNode(nestingDepth) {
|
|
@@ -26321,13 +26321,13 @@ function createEvaluationBudget(maxNodes, maxNestingDepth) {
|
|
|
26321
26321
|
}
|
|
26322
26322
|
var DEFAULT_MAX_EVALUATION_NODES;
|
|
26323
26323
|
var init_evaluator_budget = __esm({
|
|
26324
|
-
"node_modules/.pnpm/trilean@1.
|
|
26324
|
+
"node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/evaluator-budget.js"() {
|
|
26325
26325
|
init_evaluation();
|
|
26326
26326
|
DEFAULT_MAX_EVALUATION_NODES = 1e4;
|
|
26327
26327
|
}
|
|
26328
26328
|
});
|
|
26329
26329
|
|
|
26330
|
-
// node_modules/.pnpm/trilean@1.
|
|
26330
|
+
// node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/evaluator-effect.js
|
|
26331
26331
|
function* wait(value2) {
|
|
26332
26332
|
return yield {
|
|
26333
26333
|
kind: "wait",
|
|
@@ -26366,11 +26366,11 @@ function runSync(task) {
|
|
|
26366
26366
|
return step2.value;
|
|
26367
26367
|
}
|
|
26368
26368
|
var init_evaluator_effect = __esm({
|
|
26369
|
-
"node_modules/.pnpm/trilean@1.
|
|
26369
|
+
"node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/evaluator-effect.js"() {
|
|
26370
26370
|
}
|
|
26371
26371
|
});
|
|
26372
26372
|
|
|
26373
|
-
// node_modules/.pnpm/trilean@1.
|
|
26373
|
+
// node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/evaluator-collection.js
|
|
26374
26374
|
function* resolveParticipatingItems(evaluatePredicate2, collection, filter, context, resolvers, functions, visitedTreeKeys, treeReferenceDepth, budget, nestingDepth) {
|
|
26375
26375
|
const candidates = yield* wait(resolvers.resolveCollection(collection, context));
|
|
26376
26376
|
return yield* all(candidates.map(function* (item) {
|
|
@@ -26396,12 +26396,136 @@ function firstFilterIndeterminate(participating) {
|
|
|
26396
26396
|
}
|
|
26397
26397
|
}
|
|
26398
26398
|
var init_evaluator_collection = __esm({
|
|
26399
|
-
"node_modules/.pnpm/trilean@1.
|
|
26399
|
+
"node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/evaluator-collection.js"() {
|
|
26400
26400
|
init_evaluator_effect();
|
|
26401
26401
|
}
|
|
26402
26402
|
});
|
|
26403
26403
|
|
|
26404
|
-
// node_modules/.pnpm/trilean
|
|
26404
|
+
// node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/complex-division.js
|
|
26405
|
+
function scaleByPowerOfTwo(value2, exponent) {
|
|
26406
|
+
const firstHalf = Math.trunc(exponent / 2);
|
|
26407
|
+
return value2 * 2 ** firstHalf * 2 ** (exponent - firstHalf);
|
|
26408
|
+
}
|
|
26409
|
+
function scaleToAboutAQuarter(larger2) {
|
|
26410
|
+
return -Math.floor(Math.log2(larger2)) - 2;
|
|
26411
|
+
}
|
|
26412
|
+
function divideComplexComponents(dividend, divisor) {
|
|
26413
|
+
const largerDividend = Math.max(Math.abs(dividend.re), Math.abs(dividend.im));
|
|
26414
|
+
if (largerDividend === 0) return {
|
|
26415
|
+
re: 0,
|
|
26416
|
+
im: 0
|
|
26417
|
+
};
|
|
26418
|
+
const largerDivisor = Math.max(Math.abs(divisor.re), Math.abs(divisor.im));
|
|
26419
|
+
const dividendScale = scaleToAboutAQuarter(largerDividend);
|
|
26420
|
+
const divisorScale = scaleToAboutAQuarter(largerDivisor);
|
|
26421
|
+
const a10 = scaleByPowerOfTwo(dividend.re, dividendScale);
|
|
26422
|
+
const b = scaleByPowerOfTwo(dividend.im, dividendScale);
|
|
26423
|
+
const c10 = scaleByPowerOfTwo(divisor.re, divisorScale);
|
|
26424
|
+
const d = scaleByPowerOfTwo(divisor.im, divisorScale);
|
|
26425
|
+
const denominator = c10 * c10 + d * d;
|
|
26426
|
+
const shift = divisorScale - dividendScale;
|
|
26427
|
+
return {
|
|
26428
|
+
re: scaleByPowerOfTwo((a10 * c10 + b * d) / denominator, shift),
|
|
26429
|
+
im: scaleByPowerOfTwo((b * c10 - a10 * d) / denominator, shift)
|
|
26430
|
+
};
|
|
26431
|
+
}
|
|
26432
|
+
var init_complex_division = __esm({
|
|
26433
|
+
"node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/complex-division.js"() {
|
|
26434
|
+
}
|
|
26435
|
+
});
|
|
26436
|
+
|
|
26437
|
+
// node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/duration-order.js
|
|
26438
|
+
function exactParts(magnitude) {
|
|
26439
|
+
scratchValue[0] = magnitude;
|
|
26440
|
+
const bits = scratchBits[0];
|
|
26441
|
+
if (bits === void 0) throw new Error("a one-element array always has an element zero");
|
|
26442
|
+
const exponentField = Number(bits >> FRACTION_BITS & EXPONENT_FIELD_MASK);
|
|
26443
|
+
const fraction = bits & FRACTION_MASK;
|
|
26444
|
+
if (exponentField === 0) return {
|
|
26445
|
+
significand: fraction,
|
|
26446
|
+
exponent: SUBNORMAL_EXPONENT
|
|
26447
|
+
};
|
|
26448
|
+
return {
|
|
26449
|
+
significand: fraction | IMPLICIT_LEADING_BIT,
|
|
26450
|
+
exponent: exponentField - EXPONENT_BIAS_WITH_FRACTION
|
|
26451
|
+
};
|
|
26452
|
+
}
|
|
26453
|
+
function orderOf(left, right) {
|
|
26454
|
+
if (left < right) return -1;
|
|
26455
|
+
return left > right ? 1 : 0;
|
|
26456
|
+
}
|
|
26457
|
+
function exactOrder(left, right) {
|
|
26458
|
+
const leftSign = Math.sign(left.value);
|
|
26459
|
+
const rightSign = Math.sign(right.value);
|
|
26460
|
+
if (leftSign !== rightSign) return leftSign < rightSign ? -1 : 1;
|
|
26461
|
+
if (leftSign === 0) return 0;
|
|
26462
|
+
const leftParts = exactParts(Math.abs(left.value));
|
|
26463
|
+
const rightParts = exactParts(Math.abs(right.value));
|
|
26464
|
+
let leftProduct = leftParts.significand * BigInt(left.size);
|
|
26465
|
+
let rightProduct = rightParts.significand * BigInt(right.size);
|
|
26466
|
+
const shift = leftParts.exponent - rightParts.exponent;
|
|
26467
|
+
if (shift > 0) leftProduct <<= BigInt(shift);
|
|
26468
|
+
else rightProduct <<= BigInt(-shift);
|
|
26469
|
+
return leftSign < 0 ? orderOf(rightProduct, leftProduct) : orderOf(leftProduct, rightProduct);
|
|
26470
|
+
}
|
|
26471
|
+
function compareDurations(left, right) {
|
|
26472
|
+
if (Number.isNaN(left.value) || Number.isNaN(right.value)) return void 0;
|
|
26473
|
+
if (!Number.isFinite(left.value) || !Number.isFinite(right.value)) return orderOf(left.value, right.value);
|
|
26474
|
+
const leftSize = millisecondsPerDurationUnit[left.unit];
|
|
26475
|
+
const rightSize = millisecondsPerDurationUnit[right.unit];
|
|
26476
|
+
const sharedSize = Math.max(leftSize, rightSize);
|
|
26477
|
+
const leftInShared = left.value / (sharedSize / leftSize);
|
|
26478
|
+
const rightInShared = right.value / (sharedSize / rightSize);
|
|
26479
|
+
if (leftInShared < rightInShared) return -1;
|
|
26480
|
+
if (leftInShared > rightInShared) return 1;
|
|
26481
|
+
return exactOrder({
|
|
26482
|
+
value: left.value,
|
|
26483
|
+
size: leftSize
|
|
26484
|
+
}, {
|
|
26485
|
+
value: right.value,
|
|
26486
|
+
size: rightSize
|
|
26487
|
+
});
|
|
26488
|
+
}
|
|
26489
|
+
var millisecondsPerDurationUnit, ONE, FRACTION_BITS, FRACTION_MASK, IMPLICIT_LEADING_BIT, EXPONENT_FIELD_MASK, EXPONENT_BIAS_WITH_FRACTION, SUBNORMAL_EXPONENT, scratchValue, scratchBits;
|
|
26490
|
+
var init_duration_order = __esm({
|
|
26491
|
+
"node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/duration-order.js"() {
|
|
26492
|
+
millisecondsPerDurationUnit = {
|
|
26493
|
+
ms: 1,
|
|
26494
|
+
s: 1e3,
|
|
26495
|
+
min: 6e4,
|
|
26496
|
+
h: 36e5,
|
|
26497
|
+
d: 864e5
|
|
26498
|
+
};
|
|
26499
|
+
ONE = 1n;
|
|
26500
|
+
FRACTION_BITS = 52n;
|
|
26501
|
+
FRACTION_MASK = (ONE << FRACTION_BITS) - ONE;
|
|
26502
|
+
IMPLICIT_LEADING_BIT = ONE << FRACTION_BITS;
|
|
26503
|
+
EXPONENT_FIELD_MASK = 2047n;
|
|
26504
|
+
EXPONENT_BIAS_WITH_FRACTION = 1075;
|
|
26505
|
+
SUBNORMAL_EXPONENT = -1074;
|
|
26506
|
+
scratchValue = /* @__PURE__ */ new Float64Array(1);
|
|
26507
|
+
scratchBits = new BigUint64Array(scratchValue.buffer);
|
|
26508
|
+
}
|
|
26509
|
+
});
|
|
26510
|
+
|
|
26511
|
+
// node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/integer-power.js
|
|
26512
|
+
function powerByRepeatedSquaring({ base, exponent, identity, multiply }) {
|
|
26513
|
+
let result = identity;
|
|
26514
|
+
let factor = base;
|
|
26515
|
+
let remaining = exponent;
|
|
26516
|
+
while (remaining > 0) {
|
|
26517
|
+
if (remaining % 2 === 1) result = multiply(result, factor);
|
|
26518
|
+
remaining = Math.floor(remaining / 2);
|
|
26519
|
+
if (remaining > 0) factor = multiply(factor, factor);
|
|
26520
|
+
}
|
|
26521
|
+
return result;
|
|
26522
|
+
}
|
|
26523
|
+
var init_integer_power = __esm({
|
|
26524
|
+
"node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/integer-power.js"() {
|
|
26525
|
+
}
|
|
26526
|
+
});
|
|
26527
|
+
|
|
26528
|
+
// node_modules/.pnpm/trilean-regex@1.0.13/node_modules/trilean-regex/dist/ast.js
|
|
26405
26529
|
function rangeContains(range2, unit) {
|
|
26406
26530
|
return unit >= range2.from && unit <= range2.to;
|
|
26407
26531
|
}
|
|
@@ -26410,14 +26534,14 @@ function charClassMatches(node2, unit) {
|
|
|
26410
26534
|
return node2.negated ? !inRanges : inRanges;
|
|
26411
26535
|
}
|
|
26412
26536
|
var init_ast = __esm({
|
|
26413
|
-
"node_modules/.pnpm/trilean-regex@1.0.
|
|
26537
|
+
"node_modules/.pnpm/trilean-regex@1.0.13/node_modules/trilean-regex/dist/ast.js"() {
|
|
26414
26538
|
}
|
|
26415
26539
|
});
|
|
26416
26540
|
|
|
26417
|
-
// node_modules/.pnpm/trilean-regex@1.0.
|
|
26541
|
+
// node_modules/.pnpm/trilean-regex@1.0.13/node_modules/trilean-regex/dist/errors.js
|
|
26418
26542
|
var RegexParseError;
|
|
26419
26543
|
var init_errors3 = __esm({
|
|
26420
|
-
"node_modules/.pnpm/trilean-regex@1.0.
|
|
26544
|
+
"node_modules/.pnpm/trilean-regex@1.0.13/node_modules/trilean-regex/dist/errors.js"() {
|
|
26421
26545
|
RegexParseError = class extends Error {
|
|
26422
26546
|
pattern;
|
|
26423
26547
|
index;
|
|
@@ -26433,7 +26557,7 @@ var init_errors3 = __esm({
|
|
|
26433
26557
|
}
|
|
26434
26558
|
});
|
|
26435
26559
|
|
|
26436
|
-
// node_modules/.pnpm/trilean-regex@1.0.
|
|
26560
|
+
// node_modules/.pnpm/trilean-regex@1.0.13/node_modules/trilean-regex/dist/shorthand-classes.js
|
|
26437
26561
|
function codeOf(char) {
|
|
26438
26562
|
return char.charCodeAt(0);
|
|
26439
26563
|
}
|
|
@@ -26494,7 +26618,7 @@ function expandShorthandClass(letter) {
|
|
|
26494
26618
|
}
|
|
26495
26619
|
var DIGIT_RANGES, WORD_RANGES, SPACE_RANGES;
|
|
26496
26620
|
var init_shorthand_classes = __esm({
|
|
26497
|
-
"node_modules/.pnpm/trilean-regex@1.0.
|
|
26621
|
+
"node_modules/.pnpm/trilean-regex@1.0.13/node_modules/trilean-regex/dist/shorthand-classes.js"() {
|
|
26498
26622
|
DIGIT_RANGES = [range("0", "9")];
|
|
26499
26623
|
WORD_RANGES = [
|
|
26500
26624
|
range("A", "Z"),
|
|
@@ -26513,7 +26637,7 @@ var init_shorthand_classes = __esm({
|
|
|
26513
26637
|
}
|
|
26514
26638
|
});
|
|
26515
26639
|
|
|
26516
|
-
// node_modules/.pnpm/trilean-regex@1.0.
|
|
26640
|
+
// node_modules/.pnpm/trilean-regex@1.0.13/node_modules/trilean-regex/dist/parser.js
|
|
26517
26641
|
function parseRegex(pattern) {
|
|
26518
26642
|
const parser = new Parser(pattern);
|
|
26519
26643
|
const node2 = parser.parseAlternation();
|
|
@@ -26522,7 +26646,7 @@ function parseRegex(pattern) {
|
|
|
26522
26646
|
}
|
|
26523
26647
|
var SEQUENCE_TERMINATORS, SIMPLE_ESCAPES, Parser;
|
|
26524
26648
|
var init_parser = __esm({
|
|
26525
|
-
"node_modules/.pnpm/trilean-regex@1.0.
|
|
26649
|
+
"node_modules/.pnpm/trilean-regex@1.0.13/node_modules/trilean-regex/dist/parser.js"() {
|
|
26526
26650
|
init_errors3();
|
|
26527
26651
|
init_shorthand_classes();
|
|
26528
26652
|
SEQUENCE_TERMINATORS = /* @__PURE__ */ new Set(["|", ")"]);
|
|
@@ -26837,13 +26961,13 @@ var init_parser = __esm({
|
|
|
26837
26961
|
}
|
|
26838
26962
|
});
|
|
26839
26963
|
|
|
26840
|
-
// node_modules/.pnpm/trilean-regex@1.0.
|
|
26964
|
+
// node_modules/.pnpm/trilean-regex@1.0.13/node_modules/trilean-regex/dist/nfa.js
|
|
26841
26965
|
function compileToNfa(node2) {
|
|
26842
26966
|
return new NfaBuilder().build(node2);
|
|
26843
26967
|
}
|
|
26844
26968
|
var NfaBuilder;
|
|
26845
26969
|
var init_nfa = __esm({
|
|
26846
|
-
"node_modules/.pnpm/trilean-regex@1.0.
|
|
26970
|
+
"node_modules/.pnpm/trilean-regex@1.0.13/node_modules/trilean-regex/dist/nfa.js"() {
|
|
26847
26971
|
init_ast();
|
|
26848
26972
|
NfaBuilder = class {
|
|
26849
26973
|
states = [];
|
|
@@ -27085,7 +27209,7 @@ var init_nfa = __esm({
|
|
|
27085
27209
|
}
|
|
27086
27210
|
});
|
|
27087
27211
|
|
|
27088
|
-
// node_modules/.pnpm/trilean-regex@1.0.
|
|
27212
|
+
// node_modules/.pnpm/trilean-regex@1.0.13/node_modules/trilean-regex/dist/matcher.js
|
|
27089
27213
|
function closure(nfa, seeds, pos, length) {
|
|
27090
27214
|
const result = /* @__PURE__ */ new Set();
|
|
27091
27215
|
const visited = /* @__PURE__ */ new Set();
|
|
@@ -27141,21 +27265,21 @@ function compilePattern(pattern) {
|
|
|
27141
27265
|
return { test: (input2) => matchesNfa(nfa, input2) };
|
|
27142
27266
|
}
|
|
27143
27267
|
var init_matcher = __esm({
|
|
27144
|
-
"node_modules/.pnpm/trilean-regex@1.0.
|
|
27268
|
+
"node_modules/.pnpm/trilean-regex@1.0.13/node_modules/trilean-regex/dist/matcher.js"() {
|
|
27145
27269
|
init_parser();
|
|
27146
27270
|
init_nfa();
|
|
27147
27271
|
}
|
|
27148
27272
|
});
|
|
27149
27273
|
|
|
27150
|
-
// node_modules/.pnpm/trilean-regex@1.0.
|
|
27274
|
+
// node_modules/.pnpm/trilean-regex@1.0.13/node_modules/trilean-regex/dist/index.js
|
|
27151
27275
|
var init_dist = __esm({
|
|
27152
|
-
"node_modules/.pnpm/trilean-regex@1.0.
|
|
27276
|
+
"node_modules/.pnpm/trilean-regex@1.0.13/node_modules/trilean-regex/dist/index.js"() {
|
|
27153
27277
|
init_errors3();
|
|
27154
27278
|
init_matcher();
|
|
27155
27279
|
}
|
|
27156
27280
|
});
|
|
27157
27281
|
|
|
27158
|
-
// node_modules/.pnpm/trilean@1.
|
|
27282
|
+
// node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/evaluator-operations.js
|
|
27159
27283
|
function combineAnd(left, right) {
|
|
27160
27284
|
if (left.status === "definite" && !left.value) return definite(false);
|
|
27161
27285
|
if (right.status === "definite" && !right.value) return definite(false);
|
|
@@ -27232,9 +27356,11 @@ function compareValues(op, left, right) {
|
|
|
27232
27356
|
if (rightEpoch === void 0) return unparseableInstant(right.value);
|
|
27233
27357
|
return definite(applyComparisonOperator(op, leftEpoch, rightEpoch));
|
|
27234
27358
|
}
|
|
27235
|
-
case "duration":
|
|
27359
|
+
case "duration": {
|
|
27236
27360
|
if (right.kind !== "duration") return indeterminate("wrong-type", `cannot compare a 'duration' value with a '${right.kind}' value`);
|
|
27237
|
-
|
|
27361
|
+
const order = compareDurations(left, right);
|
|
27362
|
+
return definite(applyComparisonOperator(op, order ?? NaN, 0));
|
|
27363
|
+
}
|
|
27238
27364
|
case "complex":
|
|
27239
27365
|
if (op !== "eq" && op !== "neq") return indeterminate("wrong-type", `ordering operator '${op}' is not defined for complex values; the complex plane has no total order`);
|
|
27240
27366
|
if (right.kind !== "complex") return indeterminate("wrong-type", `cannot compare a 'complex' value with a '${right.kind}' value`);
|
|
@@ -27301,7 +27427,7 @@ function computeMembershipMatch(operand, candidate) {
|
|
|
27301
27427
|
}
|
|
27302
27428
|
case "duration":
|
|
27303
27429
|
if (candidate.kind !== "duration") return indeterminate("wrong-type", `cannot compare a 'duration' value with a '${candidate.kind}' value for membership`);
|
|
27304
|
-
return definite(
|
|
27430
|
+
return definite(compareDurations(operand, candidate) === 0);
|
|
27305
27431
|
case "complex":
|
|
27306
27432
|
if (candidate.kind !== "complex") return indeterminate("wrong-type", `cannot compare a 'complex' value with a '${candidate.kind}' value for membership`);
|
|
27307
27433
|
if (!unitsEqual(operand.unit, candidate.unit)) return indeterminate("wrong-type", "cannot compare complex values with incompatible units for membership");
|
|
@@ -27451,12 +27577,12 @@ function applyArithmeticOnComplex(op, left, right) {
|
|
|
27451
27577
|
case "multiply":
|
|
27452
27578
|
return definite(multiplyComplexValues(left, right));
|
|
27453
27579
|
case "divide": {
|
|
27454
|
-
|
|
27455
|
-
|
|
27580
|
+
if (right.re === 0 && right.im === 0) return indeterminate("domain-error", "division by zero");
|
|
27581
|
+
const quotient = divideComplexComponents(left, right);
|
|
27456
27582
|
return definite({
|
|
27457
27583
|
kind: "complex",
|
|
27458
|
-
re:
|
|
27459
|
-
im:
|
|
27584
|
+
re: quotient.re,
|
|
27585
|
+
im: quotient.im,
|
|
27460
27586
|
unit: combineUnitsForDivide(left.unit, right.unit)
|
|
27461
27587
|
});
|
|
27462
27588
|
}
|
|
@@ -27466,6 +27592,20 @@ function applyArithmeticOnComplex(op, left, right) {
|
|
|
27466
27592
|
throw new Error("unreachable arithmetic operator");
|
|
27467
27593
|
}
|
|
27468
27594
|
}
|
|
27595
|
+
function reciprocalOf(value2) {
|
|
27596
|
+
return {
|
|
27597
|
+
kind: "complex",
|
|
27598
|
+
...divideComplexComponents({
|
|
27599
|
+
re: 1,
|
|
27600
|
+
im: 0
|
|
27601
|
+
}, value2),
|
|
27602
|
+
unit: combineUnitsForDivide({}, value2.unit)
|
|
27603
|
+
};
|
|
27604
|
+
}
|
|
27605
|
+
function isFiniteAndNonZero(value2) {
|
|
27606
|
+
const larger2 = Math.max(Math.abs(value2.re), Math.abs(value2.im));
|
|
27607
|
+
return Number.isFinite(larger2) && larger2 > 0;
|
|
27608
|
+
}
|
|
27469
27609
|
function applyComplexPower(base, exponent) {
|
|
27470
27610
|
if (exponent.kind !== "number" || !Number.isInteger(exponent.value)) return indeterminate("wrong-type", "'power' with a complex operand requires a real integer exponent");
|
|
27471
27611
|
if (!isDimensionless(base.unit) || !isDimensionless(exponent.unit)) return indeterminate("wrong-type", "'power' requires dimensionless operands");
|
|
@@ -27476,12 +27616,28 @@ function applyComplexPower(base, exponent) {
|
|
|
27476
27616
|
unit: {}
|
|
27477
27617
|
};
|
|
27478
27618
|
const complexBase = toComplexValue(base);
|
|
27479
|
-
|
|
27480
|
-
|
|
27481
|
-
|
|
27482
|
-
|
|
27619
|
+
if (exponent.value >= 0) return definite(powerByRepeatedSquaring({
|
|
27620
|
+
base: complexBase,
|
|
27621
|
+
exponent: exponent.value,
|
|
27622
|
+
identity: complexUnit,
|
|
27623
|
+
multiply: multiplyComplexValues
|
|
27624
|
+
}));
|
|
27625
|
+
if (complexBase.re === 0 && complexBase.im === 0) return indeterminate("domain-error", "division by zero");
|
|
27626
|
+
const positivePower = powerByRepeatedSquaring({
|
|
27627
|
+
base: complexBase,
|
|
27628
|
+
exponent: -exponent.value,
|
|
27629
|
+
identity: complexUnit,
|
|
27630
|
+
multiply: multiplyComplexValues
|
|
27631
|
+
});
|
|
27632
|
+
if (isFiniteAndNonZero(positivePower)) return definite(reciprocalOf(positivePower));
|
|
27633
|
+
return definite(powerByRepeatedSquaring({
|
|
27634
|
+
base: reciprocalOf(complexBase),
|
|
27635
|
+
exponent: -exponent.value,
|
|
27636
|
+
identity: complexUnit,
|
|
27637
|
+
multiply: multiplyComplexValues
|
|
27638
|
+
}));
|
|
27483
27639
|
}
|
|
27484
|
-
function
|
|
27640
|
+
function applyArithmeticByKind(op, left, right) {
|
|
27485
27641
|
if (left.kind === "instant" && right.kind === "instant" && op === "subtract") {
|
|
27486
27642
|
const leftEpoch = toEpochMilliseconds(left.value);
|
|
27487
27643
|
if (leftEpoch === void 0) return unparseableInstant(left.value);
|
|
@@ -27514,6 +27670,26 @@ function applyArithmetic(op, left, right) {
|
|
|
27514
27670
|
}
|
|
27515
27671
|
return applyArithmeticOnNumbers(op, left, right);
|
|
27516
27672
|
}
|
|
27673
|
+
function hasFiniteMagnitude(value2) {
|
|
27674
|
+
switch (value2.kind) {
|
|
27675
|
+
case "number":
|
|
27676
|
+
case "duration":
|
|
27677
|
+
return Number.isFinite(value2.value);
|
|
27678
|
+
case "complex":
|
|
27679
|
+
return Number.isFinite(value2.re) && Number.isFinite(value2.im);
|
|
27680
|
+
case "text":
|
|
27681
|
+
case "boolean":
|
|
27682
|
+
case "instant":
|
|
27683
|
+
return true;
|
|
27684
|
+
default:
|
|
27685
|
+
throw new Error("unreachable computed-value kind");
|
|
27686
|
+
}
|
|
27687
|
+
}
|
|
27688
|
+
function applyArithmetic(op, left, right) {
|
|
27689
|
+
const result = applyArithmeticByKind(op, left, right);
|
|
27690
|
+
if (result.status === "definite" && !hasFiniteMagnitude(result.value)) return indeterminate("domain-error", "result is not a finite number");
|
|
27691
|
+
return result;
|
|
27692
|
+
}
|
|
27517
27693
|
function checkReferenceUnit(expectedUnit, resolvedValue) {
|
|
27518
27694
|
if (expectedUnit === void 0) return void 0;
|
|
27519
27695
|
if (resolvedValue.kind !== "number" && resolvedValue.kind !== "complex") return indeterminate("wrong-type", "a unit was expected on a reference that resolved to a non-numeric value");
|
|
@@ -27524,25 +27700,21 @@ function invokeRegisteredFunction(functions, fnName, args) {
|
|
|
27524
27700
|
if (fn2 === void 0) return indeterminate("wrong-type", `no function registered under the name '${fnName}'`);
|
|
27525
27701
|
const outcome = fn2(args);
|
|
27526
27702
|
if ("domainError" in outcome) return indeterminate("domain-error", outcome.domainError);
|
|
27703
|
+
if ("wrongType" in outcome) return indeterminate("wrong-type", outcome.wrongType);
|
|
27527
27704
|
return definite(outcome);
|
|
27528
27705
|
}
|
|
27529
|
-
var millisecondsPerDurationUnit;
|
|
27530
27706
|
var init_evaluator_operations = __esm({
|
|
27531
|
-
"node_modules/.pnpm/trilean@1.
|
|
27707
|
+
"node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/evaluator-operations.js"() {
|
|
27532
27708
|
init_computed_value();
|
|
27709
|
+
init_complex_division();
|
|
27710
|
+
init_duration_order();
|
|
27533
27711
|
init_evaluation();
|
|
27712
|
+
init_integer_power();
|
|
27534
27713
|
init_dist();
|
|
27535
|
-
millisecondsPerDurationUnit = {
|
|
27536
|
-
ms: 1,
|
|
27537
|
-
s: 1e3,
|
|
27538
|
-
min: 6e4,
|
|
27539
|
-
h: 36e5,
|
|
27540
|
-
d: 864e5
|
|
27541
|
-
};
|
|
27542
27714
|
}
|
|
27543
27715
|
});
|
|
27544
27716
|
|
|
27545
|
-
// node_modules/.pnpm/trilean@1.
|
|
27717
|
+
// node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/evaluator.js
|
|
27546
27718
|
function* evaluatePredicateInternal(node2, context, resolvers, accumulator, functions, visitedTreeKeys, treeReferenceDepth, budget, nestingDepth) {
|
|
27547
27719
|
const budgetExceeded = budget.checkNode(nestingDepth);
|
|
27548
27720
|
if (budgetExceeded !== void 0) return budgetExceeded;
|
|
@@ -27788,7 +27960,7 @@ function* evaluateValueInternal(node2, context, resolvers, accumulator, function
|
|
|
27788
27960
|
}
|
|
27789
27961
|
}
|
|
27790
27962
|
var init_evaluator = __esm({
|
|
27791
|
-
"node_modules/.pnpm/trilean@1.
|
|
27963
|
+
"node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/evaluator.js"() {
|
|
27792
27964
|
init_complex();
|
|
27793
27965
|
init_evaluation();
|
|
27794
27966
|
init_evaluator_effect();
|
|
@@ -27798,7 +27970,7 @@ var init_evaluator = __esm({
|
|
|
27798
27970
|
}
|
|
27799
27971
|
});
|
|
27800
27972
|
|
|
27801
|
-
// node_modules/.pnpm/trilean@1.
|
|
27973
|
+
// node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/evaluator-factory.js
|
|
27802
27974
|
function createEvaluator({ functions = emptyFunctionRegistry, maxNodes = DEFAULT_MAX_EVALUATION_NODES, maxNestingDepth = 500 }) {
|
|
27803
27975
|
return {
|
|
27804
27976
|
evaluatePredicate: async (node2, context, resolvers) => runAsync(evaluatePredicateInternal(node2, context, resolvers, void 0, functions, /* @__PURE__ */ new Set(), 0, createEvaluationBudget(maxNodes, maxNestingDepth), 0)),
|
|
@@ -27813,7 +27985,7 @@ function createSyncEvaluator({ functions = emptyFunctionRegistry, maxNodes = DEF
|
|
|
27813
27985
|
}
|
|
27814
27986
|
var evaluatePredicate, evaluateValue;
|
|
27815
27987
|
var init_evaluator_factory = __esm({
|
|
27816
|
-
"node_modules/.pnpm/trilean@1.
|
|
27988
|
+
"node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/evaluator-factory.js"() {
|
|
27817
27989
|
init_evaluator_budget();
|
|
27818
27990
|
init_evaluator_effect();
|
|
27819
27991
|
init_evaluator();
|
|
@@ -27822,9 +27994,9 @@ var init_evaluator_factory = __esm({
|
|
|
27822
27994
|
}
|
|
27823
27995
|
});
|
|
27824
27996
|
|
|
27825
|
-
// node_modules/.pnpm/trilean@1.
|
|
27997
|
+
// node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/index.js
|
|
27826
27998
|
var init_dist2 = __esm({
|
|
27827
|
-
"node_modules/.pnpm/trilean@1.
|
|
27999
|
+
"node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/index.js"() {
|
|
27828
28000
|
init_tree();
|
|
27829
28001
|
init_evaluator_factory();
|
|
27830
28002
|
}
|
|
@@ -28806,6 +28978,22 @@ function daemonAdmits(fs31, allowlistFile, recordedHash, required2) {
|
|
|
28806
28978
|
const served = parseAllowlistFile(content);
|
|
28807
28979
|
return recordedHash === hashAllowlistFile(content) && required2.every((upstream) => served.includes(upstream));
|
|
28808
28980
|
}
|
|
28981
|
+
function startSupervisorUnderLock(params) {
|
|
28982
|
+
const { paths, ports } = params;
|
|
28983
|
+
ports.fs.mkdirp(paths.headroomDir);
|
|
28984
|
+
const created = ports.fs.writeFileExclusive(paths.headroomLockFile, `${JSON.stringify({ pid: params.holderPid, at: ports.now() })}
|
|
28985
|
+
`);
|
|
28986
|
+
if (created) {
|
|
28987
|
+
ports.spawnSupervisor(paths);
|
|
28988
|
+
return "spawned";
|
|
28989
|
+
}
|
|
28990
|
+
const lock = readStartLock(ports.fs, paths.headroomLockFile);
|
|
28991
|
+
if (lock === void 0 || !ports.isRunning(lock.pid)) {
|
|
28992
|
+
ports.fs.removeRecursive(paths.headroomLockFile);
|
|
28993
|
+
return "cleared-stale-lock";
|
|
28994
|
+
}
|
|
28995
|
+
return "held";
|
|
28996
|
+
}
|
|
28809
28997
|
function ensureHeadroom(params) {
|
|
28810
28998
|
const { paths, ports } = params;
|
|
28811
28999
|
let deadline = ports.now() + HEADROOM_START_TIMEOUT_MS;
|
|
@@ -28851,21 +29039,11 @@ function ensureHeadroom(params) {
|
|
|
28851
29039
|
);
|
|
28852
29040
|
}
|
|
28853
29041
|
} else if (!spawnedSupervisor) {
|
|
28854
|
-
|
|
28855
|
-
|
|
28856
|
-
paths.headroomLockFile,
|
|
28857
|
-
`${JSON.stringify({ pid: params.launcherPid, at: ports.now() })}
|
|
28858
|
-
`
|
|
28859
|
-
);
|
|
28860
|
-
if (created) {
|
|
28861
|
-
ports.spawnSupervisor(paths);
|
|
29042
|
+
const started = startSupervisorUnderLock({ paths, holderPid: params.launcherPid, ports });
|
|
29043
|
+
if (started === "spawned") {
|
|
28862
29044
|
spawnedSupervisor = true;
|
|
28863
|
-
} else {
|
|
28864
|
-
|
|
28865
|
-
if (lock === void 0 || !ports.isRunning(lock.pid)) {
|
|
28866
|
-
ports.fs.removeRecursive(paths.headroomLockFile);
|
|
28867
|
-
continue;
|
|
28868
|
-
}
|
|
29045
|
+
} else if (started === "cleared-stale-lock") {
|
|
29046
|
+
continue;
|
|
28869
29047
|
}
|
|
28870
29048
|
}
|
|
28871
29049
|
if (ports.now() >= deadline) {
|
|
@@ -37176,7 +37354,7 @@ var init_package = __esm({
|
|
|
37176
37354
|
"package.json"() {
|
|
37177
37355
|
package_default = {
|
|
37178
37356
|
name: "claude-use",
|
|
37179
|
-
version: "11.66.
|
|
37357
|
+
version: "11.66.3",
|
|
37180
37358
|
description: "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
|
|
37181
37359
|
license: "MIT",
|
|
37182
37360
|
author: "Joseph Mearman <joseph@mearman.co.uk>",
|
|
@@ -37235,7 +37413,7 @@ var init_package = __esm({
|
|
|
37235
37413
|
cosmiconfig: "^10.0.1",
|
|
37236
37414
|
picomatch: "^4.0.7",
|
|
37237
37415
|
"string-width": "8.3.0",
|
|
37238
|
-
trilean: "1.
|
|
37416
|
+
trilean: "1.9.0",
|
|
37239
37417
|
undici: "7.30.1",
|
|
37240
37418
|
zod: "^4.6.7"
|
|
37241
37419
|
},
|
|
@@ -119239,6 +119417,50 @@ function showSession(fs31, identitiesDir, identities, query, onlyIdentity) {
|
|
|
119239
119417
|
// src/frontdoor/commands.ts
|
|
119240
119418
|
init_realPorts();
|
|
119241
119419
|
|
|
119420
|
+
// src/headroom/keeper.ts
|
|
119421
|
+
init_ensure();
|
|
119422
|
+
init_state2();
|
|
119423
|
+
function createHeadroomKeeper(deps) {
|
|
119424
|
+
const { paths, ports, log } = deps;
|
|
119425
|
+
let lastAttemptAt;
|
|
119426
|
+
const releaseOwnLock = () => {
|
|
119427
|
+
if (readStartLock(ports.fs, paths.headroomLockFile)?.pid === deps.ownPid) {
|
|
119428
|
+
ports.fs.removeRecursive(paths.headroomLockFile);
|
|
119429
|
+
}
|
|
119430
|
+
};
|
|
119431
|
+
const tick = () => {
|
|
119432
|
+
const state = resolveServingHeadroomState(ports.fs, { stateFile: paths.headroomStateFile, legacyStateFile: paths.headroomLegacyStateFile }, ports.isRunning)?.state;
|
|
119433
|
+
const supervisorPid = state?.supervisorPid;
|
|
119434
|
+
const orphans = listSessions(ports.fs, paths.headroomSessionsDir).filter((session) => ports.isRunning(session.pid) && !ports.isRunning(session.supervisorPid));
|
|
119435
|
+
if (supervisorPid !== void 0 && ports.isRunning(supervisorPid)) {
|
|
119436
|
+
lastAttemptAt = void 0;
|
|
119437
|
+
releaseOwnLock();
|
|
119438
|
+
for (const session of orphans) {
|
|
119439
|
+
writeSession(ports.fs, paths.headroomSessionsDir, { ...session, supervisorPid });
|
|
119440
|
+
}
|
|
119441
|
+
if (orphans.length > 0) {
|
|
119442
|
+
log(`front door: re-registered ${String(orphans.length)} launcher(s) against headroom supervisor ${String(supervisorPid)}`);
|
|
119443
|
+
}
|
|
119444
|
+
return { kind: "serving", rebound: orphans.map((session) => session.pid) };
|
|
119445
|
+
}
|
|
119446
|
+
if (orphans.length === 0) {
|
|
119447
|
+
return { kind: "idle" };
|
|
119448
|
+
}
|
|
119449
|
+
if (lastAttemptAt !== void 0 && ports.now() - lastAttemptAt < HEADROOM_START_TIMEOUT_MS) {
|
|
119450
|
+
return { kind: "backing-off", waiting: orphans.length };
|
|
119451
|
+
}
|
|
119452
|
+
releaseOwnLock();
|
|
119453
|
+
lastAttemptAt = ports.now();
|
|
119454
|
+
const start = startSupervisorUnderLock({ paths, holderPid: deps.ownPid, ports });
|
|
119455
|
+
log(`front door: headroom supervisor is not running and ${String(orphans.length)} launcher(s) are registered against it (${start})`);
|
|
119456
|
+
return { kind: "starting", start, waiting: orphans.length };
|
|
119457
|
+
};
|
|
119458
|
+
return { tick };
|
|
119459
|
+
}
|
|
119460
|
+
|
|
119461
|
+
// src/frontdoor/commands.ts
|
|
119462
|
+
init_supervisor();
|
|
119463
|
+
|
|
119242
119464
|
// src/supervise/registry.ts
|
|
119243
119465
|
var import_node_path36 = __toESM(require("node:path"), 1);
|
|
119244
119466
|
init_zod();
|
|
@@ -139424,6 +139646,21 @@ function realFrontDoorSupervisorPorts(paths, respawnGeneration, lifecycle, track
|
|
|
139424
139646
|
timer.unref();
|
|
139425
139647
|
keeperTimers.push(timer);
|
|
139426
139648
|
};
|
|
139649
|
+
const headroomKeeper = createHeadroomKeeper({
|
|
139650
|
+
paths,
|
|
139651
|
+
ownPid: process.pid,
|
|
139652
|
+
ports: { fs: realFarmFs, now: () => Date.now(), isRunning: realIsProcessRunning, spawnSupervisor: (layout) => spawnDetachedSupervisor(layout, "__headroom-supervisor", layout.headroomLogPath) },
|
|
139653
|
+
log
|
|
139654
|
+
});
|
|
139655
|
+
const headroomKeeperTimer = setInterval(() => {
|
|
139656
|
+
try {
|
|
139657
|
+
headroomKeeper.tick();
|
|
139658
|
+
} catch (error63) {
|
|
139659
|
+
log(`headroom keeper failed: ${error63 instanceof Error ? error63.message : String(error63)}`);
|
|
139660
|
+
}
|
|
139661
|
+
}, HEADROOM_POLL_MS);
|
|
139662
|
+
headroomKeeperTimer.unref();
|
|
139663
|
+
keeperTimers.push(headroomKeeperTimer);
|
|
139427
139664
|
everyFreshnessInterval(() => {
|
|
139428
139665
|
try {
|
|
139429
139666
|
const pools = readPools(paths);
|
package/dist/index.cjs
CHANGED
|
@@ -4751,7 +4751,7 @@ var init_package = __esm({
|
|
|
4751
4751
|
"package.json"() {
|
|
4752
4752
|
package_default = {
|
|
4753
4753
|
name: "claude-use",
|
|
4754
|
-
version: "11.66.
|
|
4754
|
+
version: "11.66.3",
|
|
4755
4755
|
description: "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
|
|
4756
4756
|
license: "MIT",
|
|
4757
4757
|
author: "Joseph Mearman <joseph@mearman.co.uk>",
|
|
@@ -4810,7 +4810,7 @@ var init_package = __esm({
|
|
|
4810
4810
|
cosmiconfig: "^10.0.1",
|
|
4811
4811
|
picomatch: "^4.0.7",
|
|
4812
4812
|
"string-width": "8.3.0",
|
|
4813
|
-
trilean: "1.
|
|
4813
|
+
trilean: "1.9.0",
|
|
4814
4814
|
undici: "7.30.1",
|
|
4815
4815
|
zod: "^4.6.7"
|
|
4816
4816
|
},
|
|
@@ -5241,6 +5241,22 @@ function daemonAdmits(fs14, allowlistFile, recordedHash, required) {
|
|
|
5241
5241
|
const served = parseAllowlistFile(content);
|
|
5242
5242
|
return recordedHash === hashAllowlistFile(content) && required.every((upstream) => served.includes(upstream));
|
|
5243
5243
|
}
|
|
5244
|
+
function startSupervisorUnderLock(params) {
|
|
5245
|
+
const { paths, ports } = params;
|
|
5246
|
+
ports.fs.mkdirp(paths.headroomDir);
|
|
5247
|
+
const created = ports.fs.writeFileExclusive(paths.headroomLockFile, `${JSON.stringify({ pid: params.holderPid, at: ports.now() })}
|
|
5248
|
+
`);
|
|
5249
|
+
if (created) {
|
|
5250
|
+
ports.spawnSupervisor(paths);
|
|
5251
|
+
return "spawned";
|
|
5252
|
+
}
|
|
5253
|
+
const lock = readStartLock(ports.fs, paths.headroomLockFile);
|
|
5254
|
+
if (lock === void 0 || !ports.isRunning(lock.pid)) {
|
|
5255
|
+
ports.fs.removeRecursive(paths.headroomLockFile);
|
|
5256
|
+
return "cleared-stale-lock";
|
|
5257
|
+
}
|
|
5258
|
+
return "held";
|
|
5259
|
+
}
|
|
5244
5260
|
function ensureHeadroom(params) {
|
|
5245
5261
|
const { paths, ports } = params;
|
|
5246
5262
|
let deadline = ports.now() + HEADROOM_START_TIMEOUT_MS;
|
|
@@ -5286,21 +5302,11 @@ function ensureHeadroom(params) {
|
|
|
5286
5302
|
);
|
|
5287
5303
|
}
|
|
5288
5304
|
} else if (!spawnedSupervisor) {
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
paths.headroomLockFile,
|
|
5292
|
-
`${JSON.stringify({ pid: params.launcherPid, at: ports.now() })}
|
|
5293
|
-
`
|
|
5294
|
-
);
|
|
5295
|
-
if (created) {
|
|
5296
|
-
ports.spawnSupervisor(paths);
|
|
5305
|
+
const started = startSupervisorUnderLock({ paths, holderPid: params.launcherPid, ports });
|
|
5306
|
+
if (started === "spawned") {
|
|
5297
5307
|
spawnedSupervisor = true;
|
|
5298
|
-
} else {
|
|
5299
|
-
|
|
5300
|
-
if (lock === void 0 || !ports.isRunning(lock.pid)) {
|
|
5301
|
-
ports.fs.removeRecursive(paths.headroomLockFile);
|
|
5302
|
-
continue;
|
|
5303
|
-
}
|
|
5308
|
+
} else if (started === "cleared-stale-lock") {
|
|
5309
|
+
continue;
|
|
5304
5310
|
}
|
|
5305
5311
|
}
|
|
5306
5312
|
if (ports.now() >= deadline) {
|
package/dist/index.mjs
CHANGED
|
@@ -4727,7 +4727,7 @@ var init_package = __esm({
|
|
|
4727
4727
|
"package.json"() {
|
|
4728
4728
|
package_default = {
|
|
4729
4729
|
name: "claude-use",
|
|
4730
|
-
version: "11.66.
|
|
4730
|
+
version: "11.66.3",
|
|
4731
4731
|
description: "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
|
|
4732
4732
|
license: "MIT",
|
|
4733
4733
|
author: "Joseph Mearman <joseph@mearman.co.uk>",
|
|
@@ -4786,7 +4786,7 @@ var init_package = __esm({
|
|
|
4786
4786
|
cosmiconfig: "^10.0.1",
|
|
4787
4787
|
picomatch: "^4.0.7",
|
|
4788
4788
|
"string-width": "8.3.0",
|
|
4789
|
-
trilean: "1.
|
|
4789
|
+
trilean: "1.9.0",
|
|
4790
4790
|
undici: "7.30.1",
|
|
4791
4791
|
zod: "^4.6.7"
|
|
4792
4792
|
},
|
|
@@ -5218,6 +5218,22 @@ function daemonAdmits(fs14, allowlistFile, recordedHash, required) {
|
|
|
5218
5218
|
const served = parseAllowlistFile(content);
|
|
5219
5219
|
return recordedHash === hashAllowlistFile(content) && required.every((upstream) => served.includes(upstream));
|
|
5220
5220
|
}
|
|
5221
|
+
function startSupervisorUnderLock(params) {
|
|
5222
|
+
const { paths, ports } = params;
|
|
5223
|
+
ports.fs.mkdirp(paths.headroomDir);
|
|
5224
|
+
const created = ports.fs.writeFileExclusive(paths.headroomLockFile, `${JSON.stringify({ pid: params.holderPid, at: ports.now() })}
|
|
5225
|
+
`);
|
|
5226
|
+
if (created) {
|
|
5227
|
+
ports.spawnSupervisor(paths);
|
|
5228
|
+
return "spawned";
|
|
5229
|
+
}
|
|
5230
|
+
const lock = readStartLock(ports.fs, paths.headroomLockFile);
|
|
5231
|
+
if (lock === void 0 || !ports.isRunning(lock.pid)) {
|
|
5232
|
+
ports.fs.removeRecursive(paths.headroomLockFile);
|
|
5233
|
+
return "cleared-stale-lock";
|
|
5234
|
+
}
|
|
5235
|
+
return "held";
|
|
5236
|
+
}
|
|
5221
5237
|
function ensureHeadroom(params) {
|
|
5222
5238
|
const { paths, ports } = params;
|
|
5223
5239
|
let deadline = ports.now() + HEADROOM_START_TIMEOUT_MS;
|
|
@@ -5263,21 +5279,11 @@ function ensureHeadroom(params) {
|
|
|
5263
5279
|
);
|
|
5264
5280
|
}
|
|
5265
5281
|
} else if (!spawnedSupervisor) {
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
paths.headroomLockFile,
|
|
5269
|
-
`${JSON.stringify({ pid: params.launcherPid, at: ports.now() })}
|
|
5270
|
-
`
|
|
5271
|
-
);
|
|
5272
|
-
if (created) {
|
|
5273
|
-
ports.spawnSupervisor(paths);
|
|
5282
|
+
const started = startSupervisorUnderLock({ paths, holderPid: params.launcherPid, ports });
|
|
5283
|
+
if (started === "spawned") {
|
|
5274
5284
|
spawnedSupervisor = true;
|
|
5275
|
-
} else {
|
|
5276
|
-
|
|
5277
|
-
if (lock === void 0 || !ports.isRunning(lock.pid)) {
|
|
5278
|
-
ports.fs.removeRecursive(paths.headroomLockFile);
|
|
5279
|
-
continue;
|
|
5280
|
-
}
|
|
5285
|
+
} else if (started === "cleared-stale-lock") {
|
|
5286
|
+
continue;
|
|
5281
5287
|
}
|
|
5282
5288
|
}
|
|
5283
5289
|
if (ports.now() >= deadline) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-use",
|
|
3
|
-
"version": "11.66.
|
|
3
|
+
"version": "11.66.3",
|
|
4
4
|
"description": "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Joseph Mearman <joseph@mearman.co.uk>",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"cosmiconfig": "^10.0.1",
|
|
60
60
|
"picomatch": "^4.0.7",
|
|
61
61
|
"string-width": "8.3.0",
|
|
62
|
-
"trilean": "1.
|
|
62
|
+
"trilean": "1.9.0",
|
|
63
63
|
"undici": "7.30.1",
|
|
64
64
|
"zod": "^4.6.7"
|
|
65
65
|
},
|