claude-use 11.27.0 → 11.29.0
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/README.md +2 -0
- package/dist/cli.cjs +300 -83
- package/dist/index.cjs +266 -57
- package/dist/index.mjs +266 -57
- package/dist/types/index.d.ts +82 -1
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -27027,7 +27027,11 @@ var init_schema = __esm({
|
|
|
27027
27027
|
headroom: external_exports.boolean().optional(),
|
|
27028
27028
|
trackUsage: external_exports.boolean().optional(),
|
|
27029
27029
|
/** The exact Claude Code version to run, as it is named in Claude Code's versions directory (`2.1.220`). A pin that is not installed fails the launch; it never falls back to the highest version. */
|
|
27030
|
-
claudeVersion: external_exports.string().regex(NUMERIC_DOTTED_VERSION_RE, "must be an exact dotted-numeric Claude Code version such as 2.1.220").optional()
|
|
27030
|
+
claudeVersion: external_exports.string().regex(NUMERIC_DOTTED_VERSION_RE, "must be an exact dotted-numeric Claude Code version such as 2.1.220").optional(),
|
|
27031
|
+
/** How long the launcher waits after its own output before it starts claude, so that output can be read before Claude Code takes over the terminal (`5s`, `500ms`). Applies only when a terminal is watching. */
|
|
27032
|
+
delay: external_exports.string().regex(DURATION_RE, "must be a duration such as 5s or 500ms").optional(),
|
|
27033
|
+
/** Whether the launcher waits for a key press after its own output before it starts claude. Takes the place of `delay` when both are set. Applies only when a terminal is watching. */
|
|
27034
|
+
pause: external_exports.boolean().optional()
|
|
27031
27035
|
});
|
|
27032
27036
|
CREDENTIAL_TARGETS = ["bearer", "apiKey", "oauthToken"];
|
|
27033
27037
|
PROVIDER_CREDENTIAL_TARGETS = ["bearer", "apiKey"];
|
|
@@ -28683,20 +28687,53 @@ var init_supervisor = __esm({
|
|
|
28683
28687
|
}
|
|
28684
28688
|
});
|
|
28685
28689
|
|
|
28686
|
-
// src/
|
|
28687
|
-
function
|
|
28688
|
-
|
|
28689
|
-
|
|
28690
|
-
return style([colour], line);
|
|
28690
|
+
// src/launcher/report.ts
|
|
28691
|
+
function renderReport(rows, style) {
|
|
28692
|
+
if (rows.length === 0) {
|
|
28693
|
+
return [];
|
|
28691
28694
|
}
|
|
28692
|
-
const
|
|
28693
|
-
|
|
28695
|
+
const labelWidth = Math.max(...rows.map((row) => row.label.length));
|
|
28696
|
+
const indent = " ".repeat(COLUMN_GAP.length);
|
|
28697
|
+
const lines = [style(["bold"], REPORT_HEADING)];
|
|
28698
|
+
for (const row of rows) {
|
|
28699
|
+
const detail = row.detail === void 0 ? "" : ` ${style(["dim"], `(${row.detail})`)}`;
|
|
28700
|
+
lines.push(`${indent}${style(["dim"], row.label.padEnd(labelWidth))}${COLUMN_GAP}${row.value}${detail}`);
|
|
28701
|
+
for (const note of row.notes ?? []) {
|
|
28702
|
+
lines.push(`${indent}${" ".repeat(labelWidth)}${COLUMN_GAP}${style(["dim"], note)}`);
|
|
28703
|
+
}
|
|
28704
|
+
}
|
|
28705
|
+
return lines;
|
|
28706
|
+
}
|
|
28707
|
+
var REPORT_HEADING, COLUMN_GAP;
|
|
28708
|
+
var init_report = __esm({
|
|
28709
|
+
"src/launcher/report.ts"() {
|
|
28710
|
+
"use strict";
|
|
28711
|
+
REPORT_HEADING = "agent-shim";
|
|
28712
|
+
COLUMN_GAP = " ";
|
|
28713
|
+
}
|
|
28714
|
+
});
|
|
28715
|
+
|
|
28716
|
+
// src/logStyle.ts
|
|
28717
|
+
function styledDiagnostic(style, colour, text2) {
|
|
28718
|
+
return text2.split("\n").map((line, index) => {
|
|
28719
|
+
const lead = index === 0 ? DIAGNOSTIC_LEAD.exec(line) : null;
|
|
28720
|
+
if (lead === null) {
|
|
28721
|
+
return style([colour], line);
|
|
28722
|
+
}
|
|
28723
|
+
const [whole, prefix = "", code = "", separator = ""] = lead;
|
|
28724
|
+
return `${style([colour], prefix)}${style([colour, "bold"], code)}${style([colour], `${separator}${line.slice(whole.length)}`)}`;
|
|
28725
|
+
}).join("\n");
|
|
28694
28726
|
}
|
|
28695
28727
|
function createLogPort(sinks, styleFor) {
|
|
28696
28728
|
return {
|
|
28697
28729
|
info: (message) => {
|
|
28698
28730
|
sinks.out(styleFor.out(["dim"], message));
|
|
28699
28731
|
},
|
|
28732
|
+
report: (rows) => {
|
|
28733
|
+
for (const line of renderReport(rows, styleFor.out)) {
|
|
28734
|
+
sinks.out(line);
|
|
28735
|
+
}
|
|
28736
|
+
},
|
|
28700
28737
|
warn: (message) => {
|
|
28701
28738
|
sinks.warn(styledDiagnostic(styleFor.err, "yellow", message));
|
|
28702
28739
|
},
|
|
@@ -28713,6 +28750,7 @@ var init_logStyle = __esm({
|
|
|
28713
28750
|
"src/logStyle.ts"() {
|
|
28714
28751
|
"use strict";
|
|
28715
28752
|
import_node_util3 = require("node:util");
|
|
28753
|
+
init_report();
|
|
28716
28754
|
DIAGNOSTIC_LEAD = /^(agent-shim: )([A-Z][A-Z0-9_]*)(: )/;
|
|
28717
28755
|
}
|
|
28718
28756
|
});
|
|
@@ -29010,7 +29048,7 @@ function realResolveClaudeBinary(isOwnBinary) {
|
|
|
29010
29048
|
function realInstalledClaudeVersions() {
|
|
29011
29049
|
return installedVersions(listVersionsDir(defaultVersionsDir()));
|
|
29012
29050
|
}
|
|
29013
|
-
var import_node_child_process2, import_node_crypto4, import_node_fs3, import_node_os2, import_node_path9, import_node_sea, realFsPort, OWNER_ONLY_DIR_MODE, OWNER_ONLY_FILE_MODE, PERMISSION_BITS, realFarmFs, INT32_BYTE_LENGTH, LINE_FEED, UTF8_CONTINUATION_MASK, UTF8_CONTINUATION_BITS, PS_TIMEOUT_MS, realRunPort, MACOS_GUI_SESSION_MANAGER, realCredentialPort, SOCKET_PERMISSION_BITS, realHeadroomSocketTrust, realSpawnPort, realProcPort, realLogPort, EXECUTE_BITS_MASK, WINDOWS_DEFAULT_PATHEXT;
|
|
29051
|
+
var import_node_child_process2, import_node_crypto4, import_node_fs3, import_node_os2, import_node_path9, import_node_sea, realFsPort, OWNER_ONLY_DIR_MODE, OWNER_ONLY_FILE_MODE, PERMISSION_BITS, realFarmFs, INT32_BYTE_LENGTH, KEY_POLL_MS, CTRL_C_BYTE, realHoldPort, LINE_FEED, UTF8_CONTINUATION_MASK, UTF8_CONTINUATION_BITS, PS_TIMEOUT_MS, realRunPort, MACOS_GUI_SESSION_MANAGER, realCredentialPort, SOCKET_PERMISSION_BITS, realHeadroomSocketTrust, realSpawnPort, realProcPort, realLogPort, EXECUTE_BITS_MASK, WINDOWS_DEFAULT_PATHEXT;
|
|
29014
29052
|
var init_realPorts = __esm({
|
|
29015
29053
|
"src/realPorts.ts"() {
|
|
29016
29054
|
"use strict";
|
|
@@ -29159,6 +29197,31 @@ var init_realPorts = __esm({
|
|
|
29159
29197
|
}
|
|
29160
29198
|
};
|
|
29161
29199
|
INT32_BYTE_LENGTH = 4;
|
|
29200
|
+
KEY_POLL_MS = 25;
|
|
29201
|
+
CTRL_C_BYTE = 3;
|
|
29202
|
+
realHoldPort = {
|
|
29203
|
+
attended: () => process.stdin.isTTY && process.stdout.isTTY,
|
|
29204
|
+
sleep: realSleepSync,
|
|
29205
|
+
waitForKey: () => {
|
|
29206
|
+
process.stdin.setRawMode(true);
|
|
29207
|
+
try {
|
|
29208
|
+
const buffer2 = Buffer.alloc(1);
|
|
29209
|
+
for (; ; ) {
|
|
29210
|
+
try {
|
|
29211
|
+
const read = import_node_fs3.default.readSync(process.stdin.fd, buffer2, 0, buffer2.length, null);
|
|
29212
|
+
return read > 0 && buffer2[0] === CTRL_C_BYTE ? "interrupt" : "key";
|
|
29213
|
+
} catch (error63) {
|
|
29214
|
+
if (!(error63 instanceof Error && "code" in error63 && error63.code === "EAGAIN")) {
|
|
29215
|
+
throw error63;
|
|
29216
|
+
}
|
|
29217
|
+
realSleepSync(KEY_POLL_MS);
|
|
29218
|
+
}
|
|
29219
|
+
}
|
|
29220
|
+
} finally {
|
|
29221
|
+
process.stdin.setRawMode(false);
|
|
29222
|
+
}
|
|
29223
|
+
}
|
|
29224
|
+
};
|
|
29162
29225
|
LINE_FEED = 10;
|
|
29163
29226
|
UTF8_CONTINUATION_MASK = 192;
|
|
29164
29227
|
UTF8_CONTINUATION_BITS = 128;
|
|
@@ -32502,6 +32565,12 @@ function flattenLayers(layers, options) {
|
|
|
32502
32565
|
if (layer.launch.claudeVersion !== void 0) {
|
|
32503
32566
|
launch.claudeVersion = layer.launch.claudeVersion;
|
|
32504
32567
|
}
|
|
32568
|
+
if (layer.launch.delay !== void 0) {
|
|
32569
|
+
launch.delay = layer.launch.delay;
|
|
32570
|
+
}
|
|
32571
|
+
if (layer.launch.pause !== void 0) {
|
|
32572
|
+
launch.pause = layer.launch.pause;
|
|
32573
|
+
}
|
|
32505
32574
|
}
|
|
32506
32575
|
if (layer.entries === void 0) {
|
|
32507
32576
|
continue;
|
|
@@ -32600,11 +32669,15 @@ var init_flatten = __esm({
|
|
|
32600
32669
|
});
|
|
32601
32670
|
|
|
32602
32671
|
// src/resolve/decide.ts
|
|
32603
|
-
function
|
|
32672
|
+
function unclassifiedEntrySummary(names) {
|
|
32604
32673
|
const quoted = names.map((name) => `"${name}"`).join(", ");
|
|
32605
|
-
|
|
32606
|
-
|
|
32607
|
-
|
|
32674
|
+
return names.length === 1 ? `${quoted} is not in the category map, so it is excluded` : `${String(names.length)} entries are not in the category map, so they are excluded: ${quoted}`;
|
|
32675
|
+
}
|
|
32676
|
+
function unclassifiedEntryFix(names) {
|
|
32677
|
+
return `Run \`agent-shim configure\` to classify ${names.length === 1 ? "it" : "them"}`;
|
|
32678
|
+
}
|
|
32679
|
+
function unclassifiedEntryMessage(names) {
|
|
32680
|
+
return `${unclassifiedEntrySummary(names)}. ${unclassifiedEntryFix(names)}.`;
|
|
32608
32681
|
}
|
|
32609
32682
|
function selectRule(relPath, flattened, context) {
|
|
32610
32683
|
const eliminated = [];
|
|
@@ -34245,7 +34318,7 @@ var init_package = __esm({
|
|
|
34245
34318
|
"package.json"() {
|
|
34246
34319
|
package_default = {
|
|
34247
34320
|
name: "claude-use",
|
|
34248
|
-
version: "11.
|
|
34321
|
+
version: "11.29.0",
|
|
34249
34322
|
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.",
|
|
34250
34323
|
license: "MIT",
|
|
34251
34324
|
author: "Joseph Mearman <joseph@mearman.co.uk>",
|
|
@@ -62938,6 +63011,7 @@ function parseLauncherArgv(argv) {
|
|
|
62938
63011
|
let configProfile;
|
|
62939
63012
|
let provider;
|
|
62940
63013
|
let claudeVersion;
|
|
63014
|
+
let delay;
|
|
62941
63015
|
const booleans = {};
|
|
62942
63016
|
const categoryFlags = [];
|
|
62943
63017
|
const shareFlags = [];
|
|
@@ -62995,6 +63069,9 @@ function parseLauncherArgv(argv) {
|
|
|
62995
63069
|
case "--claude-version":
|
|
62996
63070
|
claudeVersion = value2;
|
|
62997
63071
|
break;
|
|
63072
|
+
case "--delay":
|
|
63073
|
+
delay = value2;
|
|
63074
|
+
break;
|
|
62998
63075
|
case "--category":
|
|
62999
63076
|
categoryFlags.push(value2);
|
|
63000
63077
|
break;
|
|
@@ -63017,6 +63094,7 @@ function parseLauncherArgv(argv) {
|
|
|
63017
63094
|
...configProfile === void 0 ? {} : { configProfile },
|
|
63018
63095
|
...provider === void 0 ? {} : { provider },
|
|
63019
63096
|
...claudeVersion === void 0 ? {} : { claudeVersion },
|
|
63097
|
+
...delay === void 0 ? {} : { delay },
|
|
63020
63098
|
...native ? { native: true } : {},
|
|
63021
63099
|
...booleans,
|
|
63022
63100
|
categoryFlags,
|
|
@@ -63040,13 +63118,14 @@ var init_argv = __esm({
|
|
|
63040
63118
|
positional;
|
|
63041
63119
|
flag;
|
|
63042
63120
|
};
|
|
63043
|
-
VALUED_FLAGS = ["--identity", "--config-profile", "--provider", "--claude-version", "--category", "--share", "--hide"];
|
|
63121
|
+
VALUED_FLAGS = ["--identity", "--config-profile", "--provider", "--claude-version", "--delay", "--category", "--share", "--hide"];
|
|
63044
63122
|
BOOLEAN_FLAGS = [
|
|
63045
63123
|
{ flag: "--headroom", key: "headroom" },
|
|
63046
63124
|
{ flag: "--track-usage", key: "trackUsage" },
|
|
63047
63125
|
{ flag: "--skip-permissions", key: "skipPermissions" },
|
|
63048
63126
|
{ flag: "--remote-control", key: "remoteControl" },
|
|
63049
|
-
{ flag: "--wait", key: "wait" }
|
|
63127
|
+
{ flag: "--wait", key: "wait" },
|
|
63128
|
+
{ flag: "--pause", key: "pause" }
|
|
63050
63129
|
];
|
|
63051
63130
|
LAUNCHER_FLAG_NAMES = [
|
|
63052
63131
|
...VALUED_FLAGS,
|
|
@@ -63233,9 +63312,23 @@ function resolveLaunchFlags(params) {
|
|
|
63233
63312
|
skipPermissions: params.flags?.skipPermissions ?? parseEnvBool("AGENT_SHIM_SKIP_PERMISSIONS", params.env.AGENT_SHIM_SKIP_PERMISSIONS) ?? params.cascade?.skipPermissions ?? false,
|
|
63234
63313
|
remoteControl: params.flags?.remoteControl ?? parseEnvBool("AGENT_SHIM_REMOTE_CONTROL", params.env.AGENT_SHIM_REMOTE_CONTROL) ?? params.cascade?.remoteControl ?? false,
|
|
63235
63314
|
headroom: params.flags?.headroom ?? parseEnvBool("AGENT_SHIM_HEADROOM", params.env.AGENT_SHIM_HEADROOM) ?? params.cascade?.headroom ?? false,
|
|
63236
|
-
trackUsage: params.flags?.trackUsage ?? parseEnvBool("AGENT_SHIM_TRACK_USAGE", params.env.AGENT_SHIM_TRACK_USAGE) ?? params.cascade?.trackUsage ?? true
|
|
63315
|
+
trackUsage: params.flags?.trackUsage ?? parseEnvBool("AGENT_SHIM_TRACK_USAGE", params.env.AGENT_SHIM_TRACK_USAGE) ?? params.cascade?.trackUsage ?? true,
|
|
63316
|
+
pause: params.flags?.pause ?? parseEnvBool("AGENT_SHIM_PAUSE", params.env.AGENT_SHIM_PAUSE) ?? params.cascade?.pause ?? false,
|
|
63317
|
+
delayMs: resolveDelayMs(params)
|
|
63237
63318
|
};
|
|
63238
63319
|
}
|
|
63320
|
+
function resolveDelayMs(params) {
|
|
63321
|
+
const fromEnv = params.env.AGENT_SHIM_DELAY === "" ? void 0 : params.env.AGENT_SHIM_DELAY;
|
|
63322
|
+
const [literal2, source] = params.flags?.delay !== void 0 ? [params.flags.delay, "--delay"] : fromEnv !== void 0 ? [fromEnv, "AGENT_SHIM_DELAY"] : [params.cascade?.delay, "launch.delay"];
|
|
63323
|
+
if (literal2 === void 0) {
|
|
63324
|
+
return 0;
|
|
63325
|
+
}
|
|
63326
|
+
try {
|
|
63327
|
+
return parseDuration(literal2);
|
|
63328
|
+
} catch (error63) {
|
|
63329
|
+
throw new UsageError(`${source}: ${error63 instanceof Error ? error63.message : String(error63)}`);
|
|
63330
|
+
}
|
|
63331
|
+
}
|
|
63239
63332
|
function buildFlagArgs(flags) {
|
|
63240
63333
|
const args = [];
|
|
63241
63334
|
if (flags.skipPermissions) {
|
|
@@ -63308,6 +63401,8 @@ var init_flags = __esm({
|
|
|
63308
63401
|
"use strict";
|
|
63309
63402
|
import_node_path40 = __toESM(require("node:path"), 1);
|
|
63310
63403
|
init_envBool();
|
|
63404
|
+
init_cliError();
|
|
63405
|
+
init_conditions();
|
|
63311
63406
|
init_credential();
|
|
63312
63407
|
init_headers();
|
|
63313
63408
|
init_capability();
|
|
@@ -63538,7 +63633,9 @@ function diagnosticLines(diagnostics) {
|
|
|
63538
63633
|
if (diagnostic.code === "UNCLASSIFIED_ENTRY") {
|
|
63539
63634
|
if (!unclassifiedReported) {
|
|
63540
63635
|
unclassifiedReported = true;
|
|
63541
|
-
|
|
63636
|
+
const names = unclassified.filter((name) => name !== void 0);
|
|
63637
|
+
lines.push({ severity: diagnostic.severity, text: `agent-shim: ${diagnostic.code}: ${unclassifiedEntrySummary(names)}
|
|
63638
|
+
${unclassifiedEntryFix(names)}.` });
|
|
63542
63639
|
}
|
|
63543
63640
|
continue;
|
|
63544
63641
|
}
|
|
@@ -63546,8 +63643,8 @@ function diagnosticLines(diagnostics) {
|
|
|
63546
63643
|
}
|
|
63547
63644
|
return lines;
|
|
63548
63645
|
}
|
|
63549
|
-
function
|
|
63550
|
-
for (const line of
|
|
63646
|
+
function printDiagnosticLines(log, lines, options) {
|
|
63647
|
+
for (const line of lines) {
|
|
63551
63648
|
if (line.severity === "error" && !options.errorsAsWarnings) {
|
|
63552
63649
|
log.error(line.text);
|
|
63553
63650
|
} else {
|
|
@@ -63555,6 +63652,9 @@ function reportDiagnostics(log, diagnostics, options) {
|
|
|
63555
63652
|
}
|
|
63556
63653
|
}
|
|
63557
63654
|
}
|
|
63655
|
+
function reportDiagnostics(log, diagnostics, options) {
|
|
63656
|
+
printDiagnosticLines(log, diagnosticLines(diagnostics), options);
|
|
63657
|
+
}
|
|
63558
63658
|
var init_diagnostics = __esm({
|
|
63559
63659
|
"src/launcher/diagnostics.ts"() {
|
|
63560
63660
|
"use strict";
|
|
@@ -63562,6 +63662,84 @@ var init_diagnostics = __esm({
|
|
|
63562
63662
|
}
|
|
63563
63663
|
});
|
|
63564
63664
|
|
|
63665
|
+
// src/launcher/hold.ts
|
|
63666
|
+
function describeDelay(ms2) {
|
|
63667
|
+
return ms2 % MS_PER_SECOND6 === 0 ? `${String(ms2 / MS_PER_SECOND6)}s` : `${String(ms2)}ms`;
|
|
63668
|
+
}
|
|
63669
|
+
function holdBeforeLaunch(hold, port, log) {
|
|
63670
|
+
if (port === void 0 || !port.attended() || !hold.pause && hold.delayMs <= 0) {
|
|
63671
|
+
return "go";
|
|
63672
|
+
}
|
|
63673
|
+
if (hold.pause) {
|
|
63674
|
+
log.info("agent-shim: paused before launch; press any key to start, or Ctrl-C to cancel");
|
|
63675
|
+
return port.waitForKey() === "interrupt" ? "cancelled" : "go";
|
|
63676
|
+
}
|
|
63677
|
+
log.info(`agent-shim: starting in ${describeDelay(hold.delayMs)}`);
|
|
63678
|
+
port.sleep(hold.delayMs);
|
|
63679
|
+
return "go";
|
|
63680
|
+
}
|
|
63681
|
+
var LAUNCH_CANCELLED_EXIT, MS_PER_SECOND6;
|
|
63682
|
+
var init_hold = __esm({
|
|
63683
|
+
"src/launcher/hold.ts"() {
|
|
63684
|
+
"use strict";
|
|
63685
|
+
LAUNCH_CANCELLED_EXIT = 130;
|
|
63686
|
+
MS_PER_SECOND6 = 1e3;
|
|
63687
|
+
}
|
|
63688
|
+
});
|
|
63689
|
+
|
|
63690
|
+
// src/launcher/launchReport.ts
|
|
63691
|
+
function poolDetail(pool) {
|
|
63692
|
+
const [reason] = pool.reasons;
|
|
63693
|
+
if (pool.movedOff !== void 0) {
|
|
63694
|
+
return { detail: `moved off ${pool.movedOff.identity}: ${pool.movedOff.reason}`, ...reason === void 0 ? {} : { notes: [reason] } };
|
|
63695
|
+
}
|
|
63696
|
+
return reason === void 0 ? {} : { detail: reason };
|
|
63697
|
+
}
|
|
63698
|
+
function decisionRows(facts) {
|
|
63699
|
+
return [
|
|
63700
|
+
{ label: "identity", value: facts.identity ?? "(none)", detail: facts.identitySource },
|
|
63701
|
+
...facts.pool === void 0 ? [] : [
|
|
63702
|
+
{
|
|
63703
|
+
label: "pool",
|
|
63704
|
+
value: facts.pool.name,
|
|
63705
|
+
...poolDetail(facts.pool)
|
|
63706
|
+
}
|
|
63707
|
+
],
|
|
63708
|
+
...facts.profile === void 0 ? [] : [{ label: "profile", value: facts.profile.name, detail: facts.profile.source }],
|
|
63709
|
+
...facts.provider === void 0 ? [] : [{ label: "provider", value: facts.provider.name, detail: `credential ${facts.provider.credential}` }],
|
|
63710
|
+
...facts.identityCredential === void 0 ? [] : [{ label: "credential", value: facts.identityCredential, detail: "the identity's own" }]
|
|
63711
|
+
];
|
|
63712
|
+
}
|
|
63713
|
+
function pinnedVersionRow(version2, source) {
|
|
63714
|
+
return { label: "claude", value: version2, detail: `pinned by ${source}` };
|
|
63715
|
+
}
|
|
63716
|
+
function routingRows(facts) {
|
|
63717
|
+
if (facts.frontDoor === void 0) {
|
|
63718
|
+
return [];
|
|
63719
|
+
}
|
|
63720
|
+
return [
|
|
63721
|
+
{
|
|
63722
|
+
label: "routing",
|
|
63723
|
+
value: `front door 127.0.0.1:${String(facts.frontDoor.port)}`,
|
|
63724
|
+
...facts.provider ? {} : { detail: `OAuth via CONNECT 127.0.0.1:${String(facts.frontDoor.connectPort)}` }
|
|
63725
|
+
},
|
|
63726
|
+
...facts.headroom === void 0 ? [] : [{ label: "headroom", value: "on", detail: `project ${facts.headroom.projectId}` }]
|
|
63727
|
+
];
|
|
63728
|
+
}
|
|
63729
|
+
function farmRow(links, builtDirectories, adopted) {
|
|
63730
|
+
const counted = (count, singular, plural2) => `${String(count)} ${count === 1 ? singular : plural2}`;
|
|
63731
|
+
const parts = [counted(links, "link", "links"), counted(builtDirectories, "built directory", "built directories"), ...adopted === 0 ? [] : [`${String(adopted)} adopted`]];
|
|
63732
|
+
return { label: "farm", value: "resynced", detail: parts.join(", ") };
|
|
63733
|
+
}
|
|
63734
|
+
function noteRow(text2) {
|
|
63735
|
+
return { label: "note", value: text2 };
|
|
63736
|
+
}
|
|
63737
|
+
var init_launchReport = __esm({
|
|
63738
|
+
"src/launcher/launchReport.ts"() {
|
|
63739
|
+
"use strict";
|
|
63740
|
+
}
|
|
63741
|
+
});
|
|
63742
|
+
|
|
63565
63743
|
// src/antigravity/cloudUpstream.ts
|
|
63566
63744
|
function isCcpaEndpoint(endpoint) {
|
|
63567
63745
|
return endpoint.includes("cloudcode-pa.googleapis.com");
|
|
@@ -63746,14 +63924,14 @@ function parseRetryAfterSeconds(raw, defaultSeconds = DEFAULT_RETRY_AFTER_SECOND
|
|
|
63746
63924
|
}
|
|
63747
63925
|
const parsedDate = Date.parse(raw);
|
|
63748
63926
|
if (!Number.isNaN(parsedDate)) {
|
|
63749
|
-
const diffSec = Math.ceil((parsedDate - Date.now()) /
|
|
63927
|
+
const diffSec = Math.ceil((parsedDate - Date.now()) / MS_PER_SECOND7);
|
|
63750
63928
|
return Math.max(1, diffSec);
|
|
63751
63929
|
}
|
|
63752
63930
|
return defaultSeconds;
|
|
63753
63931
|
}
|
|
63754
63932
|
function unifiedAntigravityQuotaHeaders(params) {
|
|
63755
63933
|
const rejected = params.rejected === true;
|
|
63756
|
-
const nowSec = Math.floor(params.nowMs /
|
|
63934
|
+
const nowSec = Math.floor(params.nowMs / MS_PER_SECOND7);
|
|
63757
63935
|
const { fiveHour: b5h, weekly: bWk } = selectAntigravityBuckets(params.quota ?? {}, params.model);
|
|
63758
63936
|
const used5h = calculateUtilization(b5h?.remaining_fraction);
|
|
63759
63937
|
const reset5h = calculateResetTimestamp(nowSec, b5h?.reset_in_seconds);
|
|
@@ -63801,7 +63979,7 @@ function unifiedAntigravityQuotaHeaders(params) {
|
|
|
63801
63979
|
}
|
|
63802
63980
|
function antigravityQuotaExhaustion(quota, model, nowMs) {
|
|
63803
63981
|
const { fiveHour, weekly } = selectAntigravityBuckets(quota ?? {}, model);
|
|
63804
|
-
const nowSec = Math.floor(nowMs /
|
|
63982
|
+
const nowSec = Math.floor(nowMs / MS_PER_SECOND7);
|
|
63805
63983
|
const spent = [];
|
|
63806
63984
|
for (const [window, bucket] of [["five_hour", fiveHour], ["seven_day", weekly]]) {
|
|
63807
63985
|
const remaining = bucket?.remaining_fraction;
|
|
@@ -63822,7 +64000,7 @@ function bucketToEntry(bucket, nowMs) {
|
|
|
63822
64000
|
}
|
|
63823
64001
|
const remainingFraction = typeof bucket.remainingFraction === "number" && Number.isFinite(bucket.remainingFraction) ? bucket.remainingFraction : void 0;
|
|
63824
64002
|
const resetMs = typeof bucket.resetTime === "string" ? Date.parse(bucket.resetTime) : Number.NaN;
|
|
63825
|
-
const resetInSeconds = Number.isNaN(resetMs) ? void 0 : Math.max(0, Math.ceil((resetMs - nowMs) /
|
|
64003
|
+
const resetInSeconds = Number.isNaN(resetMs) ? void 0 : Math.max(0, Math.ceil((resetMs - nowMs) / MS_PER_SECOND7));
|
|
63826
64004
|
if (remainingFraction === void 0 && resetInSeconds === void 0) {
|
|
63827
64005
|
return void 0;
|
|
63828
64006
|
}
|
|
@@ -63902,17 +64080,17 @@ function createCachedAntigravityQuotaSource(params) {
|
|
|
63902
64080
|
};
|
|
63903
64081
|
}
|
|
63904
64082
|
function ageQuotaMap(quota, elapsedMs) {
|
|
63905
|
-
const elapsedSec = elapsedMs /
|
|
64083
|
+
const elapsedSec = elapsedMs / MS_PER_SECOND7;
|
|
63906
64084
|
return Object.fromEntries(
|
|
63907
64085
|
Object.entries(quota).map(([key, bucket]) => [key, bucket?.reset_in_seconds === void 0 ? bucket : { ...bucket, reset_in_seconds: Math.max(0, bucket.reset_in_seconds - elapsedSec) }])
|
|
63908
64086
|
);
|
|
63909
64087
|
}
|
|
63910
|
-
var
|
|
64088
|
+
var MS_PER_SECOND7, DEFAULT_RETRY_AFTER_SECONDS, FRACTION_DIGITS, GEMINI_5H_KEYS, GEMINI_WEEKLY_KEYS, ARGON_WEEKLY_KEYS, THIRD_PARTY_5H_KEYS, THIRD_PARTY_WEEKLY_KEYS, QUOTA_FAMILY_WINDOWS, SECONDS_PER_HOUR, HOURS_PER_FIVE_HOUR_WINDOW, DAYS_PER_WEEK, HOURS_PER_DAY3, FIVE_HOUR_PERIOD_SECONDS, WEEK_PERIOD_SECONDS, ANTIGRAVITY_QUOTA_REFRESH_MS;
|
|
63911
64089
|
var init_quota = __esm({
|
|
63912
64090
|
"src/antigravity/quota.ts"() {
|
|
63913
64091
|
"use strict";
|
|
63914
64092
|
init_cloudUpstream();
|
|
63915
|
-
|
|
64093
|
+
MS_PER_SECOND7 = 1e3;
|
|
63916
64094
|
DEFAULT_RETRY_AFTER_SECONDS = 60;
|
|
63917
64095
|
FRACTION_DIGITS = 3;
|
|
63918
64096
|
GEMINI_5H_KEYS = ["gemini-5h", "gemini_5h", "gemini"];
|
|
@@ -64603,7 +64781,7 @@ async function fetchCatalogue(params) {
|
|
|
64603
64781
|
}
|
|
64604
64782
|
throw new CatalogueFetchError(`no catalogue from ${outcomes.join("; ")}`);
|
|
64605
64783
|
}
|
|
64606
|
-
var import_node_path42, import_picomatch3, DEFAULT_CANDIDATE_URLS,
|
|
64784
|
+
var import_node_path42, import_picomatch3, DEFAULT_CANDIDATE_URLS, MS_PER_SECOND8, SECONDS_PER_HOUR2, HOURS_PER_DAY4, MS_PER_HOUR3, HOURS_BETWEEN_RETRIES, HTTP_OK, HTTP_MULTIPLE_CHOICES, CATALOGUE_MAX_AGE_MS, CATALOGUE_RETRY_MS, CATALOGUE_REQUEST_SECONDS, CATALOGUE_REQUEST_TIMEOUT_MS, CATALOGUE_REFRESH_TIMEOUT_MS, CatalogueModelSchema, CatalogueCacheSchema, CatalogueFetchError;
|
|
64607
64785
|
var init_providerCatalogue = __esm({
|
|
64608
64786
|
"src/providerCatalogue.ts"() {
|
|
64609
64787
|
"use strict";
|
|
@@ -64611,17 +64789,17 @@ var init_providerCatalogue = __esm({
|
|
|
64611
64789
|
import_picomatch3 = __toESM(require_picomatch2(), 1);
|
|
64612
64790
|
init_zod();
|
|
64613
64791
|
DEFAULT_CANDIDATE_URLS = 2;
|
|
64614
|
-
|
|
64792
|
+
MS_PER_SECOND8 = 1e3;
|
|
64615
64793
|
SECONDS_PER_HOUR2 = 3600;
|
|
64616
64794
|
HOURS_PER_DAY4 = 24;
|
|
64617
|
-
MS_PER_HOUR3 = SECONDS_PER_HOUR2 *
|
|
64795
|
+
MS_PER_HOUR3 = SECONDS_PER_HOUR2 * MS_PER_SECOND8;
|
|
64618
64796
|
HOURS_BETWEEN_RETRIES = 1;
|
|
64619
64797
|
HTTP_OK = 200;
|
|
64620
64798
|
HTTP_MULTIPLE_CHOICES = 300;
|
|
64621
64799
|
CATALOGUE_MAX_AGE_MS = HOURS_PER_DAY4 * MS_PER_HOUR3;
|
|
64622
64800
|
CATALOGUE_RETRY_MS = HOURS_BETWEEN_RETRIES * MS_PER_HOUR3;
|
|
64623
64801
|
CATALOGUE_REQUEST_SECONDS = 10;
|
|
64624
|
-
CATALOGUE_REQUEST_TIMEOUT_MS = CATALOGUE_REQUEST_SECONDS *
|
|
64802
|
+
CATALOGUE_REQUEST_TIMEOUT_MS = CATALOGUE_REQUEST_SECONDS * MS_PER_SECOND8;
|
|
64625
64803
|
CATALOGUE_REFRESH_TIMEOUT_MS = DEFAULT_CANDIDATE_URLS * CATALOGUE_REQUEST_TIMEOUT_MS;
|
|
64626
64804
|
CatalogueModelSchema = external_exports.strictObject({ id: external_exports.string().min(1), name: external_exports.string().min(1).optional() });
|
|
64627
64805
|
CatalogueCacheSchema = external_exports.strictObject({ fetchedAt: external_exports.number(), url: external_exports.string().min(1), models: external_exports.array(CatalogueModelSchema) });
|
|
@@ -64956,7 +65134,7 @@ function pickFromPool(decided, params, parsedArgv, readOnly) {
|
|
|
64956
65134
|
}
|
|
64957
65135
|
if (params.supervised?.member !== void 0) {
|
|
64958
65136
|
const reasons = ["resumed here by the supervising launcher after the previous member ran out of quota"];
|
|
64959
|
-
return { identityDecision: { ...decided, name: params.supervised.member },
|
|
65137
|
+
return { identityDecision: { ...decided, name: params.supervised.member }, poolPick: { name: decided.pool, reasons } };
|
|
64960
65138
|
}
|
|
64961
65139
|
const farmRuntime = params.farm;
|
|
64962
65140
|
if (farmRuntime === void 0) {
|
|
@@ -64987,7 +65165,6 @@ function pickFromPool(decided, params, parsedArgv, readOnly) {
|
|
|
64987
65165
|
}
|
|
64988
65166
|
return {
|
|
64989
65167
|
identityDecision: { ...decided, name: resolution.identity },
|
|
64990
|
-
poolExplanation: resolution.explanation,
|
|
64991
65168
|
poolPick: { name: decided.pool, reasons: resolution.reasons, ...resolution.movedOff === void 0 ? {} : { movedOff: resolution.movedOff } }
|
|
64992
65169
|
};
|
|
64993
65170
|
}
|
|
@@ -65015,7 +65192,7 @@ function decideLaunch(params, readOnly) {
|
|
|
65015
65192
|
return trimmed === "" ? void 0 : trimmed;
|
|
65016
65193
|
}
|
|
65017
65194
|
});
|
|
65018
|
-
const { identityDecision,
|
|
65195
|
+
const { identityDecision, poolPick } = pickFromPool(decidedIdentity, params, parsedArgv, readOnly);
|
|
65019
65196
|
const farmIdentity = configDirEscapeHatchApplies ? void 0 : identityDecision.name;
|
|
65020
65197
|
const farm = farmIdentity === void 0 ? void 0 : params.farm;
|
|
65021
65198
|
if (!readOnly && farm !== void 0 && farmIdentity !== void 0) {
|
|
@@ -65149,19 +65326,22 @@ function decideLaunch(params, readOnly) {
|
|
|
65149
65326
|
...parsedArgv.skipPermissions === void 0 ? {} : { skipPermissions: parsedArgv.skipPermissions },
|
|
65150
65327
|
...parsedArgv.remoteControl === void 0 ? {} : { remoteControl: parsedArgv.remoteControl },
|
|
65151
65328
|
...parsedArgv.headroom === void 0 ? {} : { headroom: parsedArgv.headroom },
|
|
65152
|
-
...parsedArgv.trackUsage === void 0 ? {} : { trackUsage: parsedArgv.trackUsage }
|
|
65329
|
+
...parsedArgv.trackUsage === void 0 ? {} : { trackUsage: parsedArgv.trackUsage },
|
|
65330
|
+
...parsedArgv.pause === void 0 ? {} : { pause: parsedArgv.pause },
|
|
65331
|
+
...parsedArgv.delay === void 0 ? {} : { delay: parsedArgv.delay }
|
|
65153
65332
|
}
|
|
65154
65333
|
});
|
|
65155
65334
|
const loginlessProvider = requestedFlags.remoteControl && selectedProvider !== void 0 && farmIdentity !== void 0 && params.hasStoredLogin?.(farmIdentity) === false ? { identity: farmIdentity, provider: selectedProvider.name } : void 0;
|
|
65156
|
-
|
|
65157
|
-
|
|
65335
|
+
const notes = [];
|
|
65336
|
+
if (loginlessProvider !== void 0) {
|
|
65337
|
+
notes.push(`${loginlessProvider.identity} has no stored login, so Remote Control is off; provider ${loginlessProvider.provider} runs without it`);
|
|
65158
65338
|
}
|
|
65159
65339
|
const flags = loginlessProvider === void 0 ? requestedFlags : { ...requestedFlags, remoteControl: false };
|
|
65160
65340
|
const catalogue = selectedProvider === void 0 ? void 0 : parseCatalogueCache(params.fs.readFileUtf8(catalogueCachePath(paths, selectedProvider.name)));
|
|
65161
65341
|
const pickerSettings = selectedProvider === void 0 ? void 0 : modelPickerSettings(selectedProvider.definition, catalogue?.models);
|
|
65162
65342
|
const callerSettings = hasSettingsArgument(parsedArgv.rest);
|
|
65163
|
-
if (pickerSettings !== void 0 && callerSettings
|
|
65164
|
-
|
|
65343
|
+
if (pickerSettings !== void 0 && callerSettings) {
|
|
65344
|
+
notes.push("--settings was passed, so /model keeps Claude Code's own model names");
|
|
65165
65345
|
}
|
|
65166
65346
|
const launcherSettings = mergeSettings([params.supervised?.settings, callerSettings ? void 0 : pickerSettings]);
|
|
65167
65347
|
const args = buildArgv({
|
|
@@ -65183,8 +65363,8 @@ function decideLaunch(params, readOnly) {
|
|
|
65183
65363
|
return {
|
|
65184
65364
|
parsedArgv,
|
|
65185
65365
|
identityDecision,
|
|
65186
|
-
poolExplanation,
|
|
65187
65366
|
poolPick,
|
|
65367
|
+
notes,
|
|
65188
65368
|
configDirEscapeHatch: configDirEscapeHatchApplies,
|
|
65189
65369
|
farmIdentity,
|
|
65190
65370
|
farmContext,
|
|
@@ -65204,10 +65384,18 @@ function prepareLaunch(params) {
|
|
|
65204
65384
|
const { paths, proc, log } = params;
|
|
65205
65385
|
const { env } = proc;
|
|
65206
65386
|
const decided = decideLaunch(params, false);
|
|
65207
|
-
const { identityDecision, configProfileDecision, resolvedProvider, identityCredential,
|
|
65208
|
-
|
|
65209
|
-
|
|
65210
|
-
|
|
65387
|
+
const { identityDecision, configProfileDecision, resolvedProvider, identityCredential, poolPick, notes, flags: resolvedFlags, args: finalArgv, configDirEscapeHatch: configDirEscapeHatchApplies, decision } = decided;
|
|
65388
|
+
const rows = [
|
|
65389
|
+
...decisionRows({
|
|
65390
|
+
identity: identityDecision.name,
|
|
65391
|
+
identitySource: identityDecision.source,
|
|
65392
|
+
pool: poolPick,
|
|
65393
|
+
profile: configProfileDecision.name === void 0 ? void 0 : { name: configProfileDecision.name, source: configProfileDecision.source },
|
|
65394
|
+
provider: resolvedProvider === void 0 ? void 0 : { name: resolvedProvider.name, credential: `${resolvedProvider.credential.target} from ${describeSource(resolvedProvider.credential.source)}` },
|
|
65395
|
+
identityCredential: identityCredential === void 0 ? void 0 : `${identityCredential.target} from ${describeSource(identityCredential.source)}`
|
|
65396
|
+
})
|
|
65397
|
+
];
|
|
65398
|
+
let warnings = [];
|
|
65211
65399
|
const updateCheck = runLaunchUpdateCheck({
|
|
65212
65400
|
mode: params.updateMode ?? "off",
|
|
65213
65401
|
checkPath: import_node_path43.default.join(paths.root, "update.check"),
|
|
@@ -65242,15 +65430,13 @@ function prepareLaunch(params) {
|
|
|
65242
65430
|
}
|
|
65243
65431
|
throw error63;
|
|
65244
65432
|
}
|
|
65245
|
-
|
|
65433
|
+
warnings = diagnosticLines(result.diagnostics);
|
|
65246
65434
|
if (!result.noOp) {
|
|
65247
|
-
|
|
65248
|
-
`agent-shim: farm at ${result.farmRoot} resynced (${String(result.manifest.links.length)} link(s), ${String(result.manifest.materialised.length)} built director(ies)${result.adopted.length === 0 ? "" : `, ${String(result.adopted.length)} adopted into ${resyncFarmRuntime.claudeHome}`})`
|
|
65249
|
-
);
|
|
65435
|
+
rows.push(farmRow(result.manifest.links.length, result.manifest.materialised.length, result.adopted.length));
|
|
65250
65436
|
}
|
|
65251
65437
|
}
|
|
65252
65438
|
if (decided.pinnedVersion !== void 0) {
|
|
65253
|
-
|
|
65439
|
+
rows.push(pinnedVersionRow(decided.pinnedVersion.version, decided.pinnedVersion.source));
|
|
65254
65440
|
}
|
|
65255
65441
|
const frontDoorPort = params.frontdoor;
|
|
65256
65442
|
const frontDoorEngaged = resolvedProvider !== void 0 || resolvedFlags.headroom || resolvedFlags.trackUsage;
|
|
@@ -65266,14 +65452,11 @@ function prepareLaunch(params) {
|
|
|
65266
65452
|
const headroomPort = params.headroom;
|
|
65267
65453
|
if (resolvedFlags.headroom && headroomPort !== void 0) {
|
|
65268
65454
|
headroom = headroomPort.ensure({ routesProvider: resolvedProvider !== void 0 });
|
|
65269
|
-
const via = resolvedProvider === void 0 ? `OAuth via the door's CONNECT surface on 127.0.0.1:${String(frontDoor?.connectPort ?? 0)}` : `provider ${resolvedProvider.name}`;
|
|
65270
|
-
log.info(`agent-shim: routing through the front door on 127.0.0.1:${String(frontDoor?.port ?? 0)} with headroom on unix socket ${headroom.socketPath} (${via}, project ${headroom.projectId})`);
|
|
65271
65455
|
} else if (resolvedFlags.headroom) {
|
|
65272
65456
|
log.error("agent-shim: headroom routing was requested but this launcher has no headroom port wired; refusing to launch without it.");
|
|
65273
65457
|
proc.exit(1);
|
|
65274
|
-
} else if (frontDoor !== void 0) {
|
|
65275
|
-
log.info(`agent-shim: routing through the front door on 127.0.0.1:${String(frontDoor.port)}${resolvedProvider === void 0 ? ` (OAuth via the door's CONNECT surface on 127.0.0.1:${String(frontDoor.connectPort)}, usage recorded)` : ` (provider ${resolvedProvider.name})`}`);
|
|
65276
65458
|
}
|
|
65459
|
+
rows.push(...routingRows({ frontDoor, headroom, provider: resolvedProvider !== void 0 }));
|
|
65277
65460
|
const frontDoorRelease = frontDoor === void 0 ? void 0 : frontDoorPort?.release;
|
|
65278
65461
|
const sessionId = params.supervised?.sessionId ?? (0, import_node_crypto18.randomUUID)();
|
|
65279
65462
|
const finalEnv = buildEnv({
|
|
@@ -65294,7 +65477,11 @@ function prepareLaunch(params) {
|
|
|
65294
65477
|
registered();
|
|
65295
65478
|
}
|
|
65296
65479
|
};
|
|
65297
|
-
|
|
65480
|
+
rows.push(...notes.map(noteRow));
|
|
65481
|
+
log.report(rows);
|
|
65482
|
+
printDiagnosticLines(log, warnings, { errorsAsWarnings: false });
|
|
65483
|
+
const hold = () => holdBeforeLaunch({ delayMs: resolvedFlags.delayMs, pause: resolvedFlags.pause }, params.hold, log);
|
|
65484
|
+
return { bin: decided.bin, args: finalArgv, env: finalEnv, sessionId, release, markChildStarted: updateCheck.markChildStarted, hold, decision };
|
|
65298
65485
|
}
|
|
65299
65486
|
function resolveLaunch(params) {
|
|
65300
65487
|
const decided = decideLaunch(params, true);
|
|
@@ -65327,6 +65514,9 @@ function resolveLaunch(params) {
|
|
|
65327
65514
|
}
|
|
65328
65515
|
function runLaunchPlan(plan, spawn8) {
|
|
65329
65516
|
try {
|
|
65517
|
+
if (plan.hold() === "cancelled") {
|
|
65518
|
+
return LAUNCH_CANCELLED_EXIT;
|
|
65519
|
+
}
|
|
65330
65520
|
plan.markChildStarted();
|
|
65331
65521
|
const result = spawn8.spawnSync(plan.bin, plan.args, { stdio: "inherit", env: plan.env });
|
|
65332
65522
|
if (result.error !== void 0) {
|
|
@@ -65357,6 +65547,8 @@ var init_launcher = __esm({
|
|
|
65357
65547
|
init_extraFlags();
|
|
65358
65548
|
init_claudeSession();
|
|
65359
65549
|
init_diagnostics();
|
|
65550
|
+
init_hold();
|
|
65551
|
+
init_launchReport();
|
|
65360
65552
|
init_modelPicker();
|
|
65361
65553
|
init_providerCatalogue();
|
|
65362
65554
|
init_pool();
|
|
@@ -65429,6 +65621,7 @@ function realPrepareLaunchParams(paths, options) {
|
|
|
65429
65621
|
headroom: realHeadroomPort(paths, { spawnDaemon: options.spawnDaemon, cwd: farm.runtime.cwd }),
|
|
65430
65622
|
frontdoor: realFrontDoorPort(paths, options.spawnDaemon),
|
|
65431
65623
|
credentials: { ...realCredentialPort, cache: realCredentialCacheEnv(paths) },
|
|
65624
|
+
hold: realHoldPort,
|
|
65432
65625
|
hasStoredLogin: (identity) => identitySignIn(realFarmFs, { platform: process.platform, run: realRunPort }, { farmRoot: import_node_path44.default.join(paths.identitiesDir, identity), hasCredentialBlock: false }).state !== "signed-out",
|
|
65433
65626
|
...farm.directoryIdentity === void 0 ? {} : { directoryPinnedIdentity: farm.directoryIdentity },
|
|
65434
65627
|
...farm.directoryConfigProfile === void 0 ? {} : { directoryRuleConfigProfile: farm.directoryConfigProfile },
|
|
@@ -65447,6 +65640,7 @@ function resolveClaudeLaunch(options) {
|
|
|
65447
65640
|
const warnings = [];
|
|
65448
65641
|
const log = {
|
|
65449
65642
|
info: () => void 0,
|
|
65643
|
+
report: () => void 0,
|
|
65450
65644
|
warn: (message) => {
|
|
65451
65645
|
warnings.push(message);
|
|
65452
65646
|
},
|
|
@@ -65517,6 +65711,7 @@ async function withIdentityClaude(params, identity, flags, use2) {
|
|
|
65517
65711
|
},
|
|
65518
65712
|
log: {
|
|
65519
65713
|
info: () => void 0,
|
|
65714
|
+
report: () => void 0,
|
|
65520
65715
|
warn: () => void 0,
|
|
65521
65716
|
error: (message) => {
|
|
65522
65717
|
refusals.push(message);
|
|
@@ -65591,7 +65786,7 @@ function quotaFreshnessMs(quota) {
|
|
|
65591
65786
|
const lengths = quota.windows.flatMap((window) => window.periodMs === void 0 ? [] : [window.periodMs]);
|
|
65592
65787
|
return lengths.length === 0 ? Number.POSITIVE_INFINITY : Math.min(...lengths) / PERCENT3;
|
|
65593
65788
|
}
|
|
65594
|
-
var ProviderQuotaError,
|
|
65789
|
+
var ProviderQuotaError, MS_PER_SECOND9, SECONDS_PER_HOUR3, HOURS_PER_DAY5, DAYS_PER_MONTH, PERCENT3, HTTP_OK2, ZAI_SOURCE, ZAI_HOST, ZAI_QUOTA_URL, ZAI_UNIT_HOURS, ZAI_UNIT_MONTHS, ZAI_UNIT_MS, ZAI_MEASURES, ZaiLimitSchema, ZaiResponseSchema, zaiQuotaAdapter, OPENROUTER_SOURCE, OPENROUTER_HOST, OPENROUTER_KEY_URL, OPENROUTER_CREDITS_URL, HTTP_FORBIDDEN, MS_PER_DAY2, OpenRouterKeySchema, OpenRouterCreditsSchema, openRouterQuotaAdapter, ANTIGRAVITY_SOURCE, ANTIGRAVITY_HOST, ANTIGRAVITY_QUOTA_URL, ANTIGRAVITY_USER_URL, GOOGLE_TOKENINFO_URL, FIVE_HOURS2, DAYS_PER_WEEK2, FIVE_HOURS_MS, WEEK_MS, AntigravityBucketSchema, AntigravitySummarySchema, GoogleTokenInfoSchema, AntigravityUserSchema, ANTIGRAVITY_WINDOW_MS, antigravityQuotaAdapter, PROVIDER_QUOTA_ADAPTERS;
|
|
65595
65790
|
var init_providerQuota = __esm({
|
|
65596
65791
|
"src/usage/providerQuota.ts"() {
|
|
65597
65792
|
"use strict";
|
|
@@ -65604,7 +65799,7 @@ var init_providerQuota = __esm({
|
|
|
65604
65799
|
this.name = "ProviderQuotaError";
|
|
65605
65800
|
}
|
|
65606
65801
|
};
|
|
65607
|
-
|
|
65802
|
+
MS_PER_SECOND9 = 1e3;
|
|
65608
65803
|
SECONDS_PER_HOUR3 = 3600;
|
|
65609
65804
|
HOURS_PER_DAY5 = 24;
|
|
65610
65805
|
DAYS_PER_MONTH = 30;
|
|
@@ -65616,8 +65811,8 @@ var init_providerQuota = __esm({
|
|
|
65616
65811
|
ZAI_UNIT_HOURS = 3;
|
|
65617
65812
|
ZAI_UNIT_MONTHS = 5;
|
|
65618
65813
|
ZAI_UNIT_MS = /* @__PURE__ */ new Map([
|
|
65619
|
-
[ZAI_UNIT_HOURS, SECONDS_PER_HOUR3 *
|
|
65620
|
-
[ZAI_UNIT_MONTHS, DAYS_PER_MONTH * HOURS_PER_DAY5 * SECONDS_PER_HOUR3 *
|
|
65814
|
+
[ZAI_UNIT_HOURS, SECONDS_PER_HOUR3 * MS_PER_SECOND9],
|
|
65815
|
+
[ZAI_UNIT_MONTHS, DAYS_PER_MONTH * HOURS_PER_DAY5 * SECONDS_PER_HOUR3 * MS_PER_SECOND9]
|
|
65621
65816
|
]);
|
|
65622
65817
|
ZAI_MEASURES = { TOKENS_LIMIT: "tokens", TIME_LIMIT: "tool-calls" };
|
|
65623
65818
|
ZaiLimitSchema = external_exports.object({
|
|
@@ -65669,7 +65864,7 @@ var init_providerQuota = __esm({
|
|
|
65669
65864
|
OPENROUTER_KEY_URL = `https://${OPENROUTER_HOST}/api/v1/key`;
|
|
65670
65865
|
OPENROUTER_CREDITS_URL = `https://${OPENROUTER_HOST}/api/v1/credits`;
|
|
65671
65866
|
HTTP_FORBIDDEN = 403;
|
|
65672
|
-
MS_PER_DAY2 = HOURS_PER_DAY5 * SECONDS_PER_HOUR3 *
|
|
65867
|
+
MS_PER_DAY2 = HOURS_PER_DAY5 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
|
|
65673
65868
|
OpenRouterKeySchema = external_exports.object({
|
|
65674
65869
|
data: external_exports.object({
|
|
65675
65870
|
limit: external_exports.number().nonnegative().nullable(),
|
|
@@ -65717,8 +65912,8 @@ var init_providerQuota = __esm({
|
|
|
65717
65912
|
GOOGLE_TOKENINFO_URL = "https://oauth2.googleapis.com/tokeninfo";
|
|
65718
65913
|
FIVE_HOURS2 = 5;
|
|
65719
65914
|
DAYS_PER_WEEK2 = 7;
|
|
65720
|
-
FIVE_HOURS_MS = FIVE_HOURS2 * SECONDS_PER_HOUR3 *
|
|
65721
|
-
WEEK_MS = DAYS_PER_WEEK2 * HOURS_PER_DAY5 * SECONDS_PER_HOUR3 *
|
|
65915
|
+
FIVE_HOURS_MS = FIVE_HOURS2 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
|
|
65916
|
+
WEEK_MS = DAYS_PER_WEEK2 * HOURS_PER_DAY5 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
|
|
65722
65917
|
AntigravityBucketSchema = external_exports.object({
|
|
65723
65918
|
bucketId: external_exports.string(),
|
|
65724
65919
|
remainingFraction: external_exports.number().optional(),
|
|
@@ -111319,6 +111514,12 @@ function applyProfileChange(paths, name, change) {
|
|
|
111319
111514
|
if (change.launchClaudeVersion !== void 0) {
|
|
111320
111515
|
launchPatch.claudeVersion = change.launchClaudeVersion === false ? void 0 : change.launchClaudeVersion;
|
|
111321
111516
|
}
|
|
111517
|
+
if (change.launchDelay !== void 0) {
|
|
111518
|
+
launchPatch.delay = change.launchDelay === false ? void 0 : change.launchDelay;
|
|
111519
|
+
}
|
|
111520
|
+
if (change.launchPause !== void 0) {
|
|
111521
|
+
launchPatch.pause = change.launchPause;
|
|
111522
|
+
}
|
|
111322
111523
|
if (Object.keys(launchPatch).length > 0) {
|
|
111323
111524
|
setProfileLaunchFlags(paths, name, launchPatch);
|
|
111324
111525
|
touched = true;
|
|
@@ -112605,7 +112806,7 @@ function registerProfileCommand(program2, deps) {
|
|
|
112605
112806
|
withExamples(
|
|
112606
112807
|
profile.command("set <name>").description(
|
|
112607
112808
|
"Update a configuration profile's categories, entries, extends list, description or launch settings. With no options on a terminal, walks through its categories."
|
|
112608
|
-
).option("--category <category=bool>", "Share (true) or hide (false) a whole category (repeatable).", collectBoolPair).option("--entry <path=bool>", "Share (true) or hide (false) one <category>/<path> entry (repeatable).", collectBoolPair).option("--extends <profile>", "Replace the extends list with these profiles (repeatable, in order).", collectRepeated).option("--no-extends", "Clear the extends list.").option("--description <text>", "Replace the description.").option("--no-description", "Clear the description.").option("--launch-skip-permissions", "Launches under this profile skip permission prompts.").option("--no-launch-skip-permissions", "Launches under this profile keep permission prompts.").option("--launch-remote-control", "Launches under this profile enable Remote Control.").option("--no-launch-remote-control", "Launches under this profile leave Remote Control off.").option("--launch-headroom", "Launches under this profile route through headroom.").option("--no-launch-headroom", "Launches under this profile route direct.").option("--launch-track-usage", "Launches under this profile route through the front door so their requests and quota are recorded, with no headroom needed.").option("--no-launch-track-usage", "Launches under this profile are not recorded unless a provider or headroom routes them anyway.").option("--launch-provider <provider>", "Launches under this profile route through this provider.").option("--no-launch-provider", "Clear this profile's provider selection.").option("--launch-claude-version <version>", "Launches under this profile run exactly this installed Claude Code version (such as 2.1.220); a version that is not installed fails the launch.").option("--no-launch-claude-version", "Clear this profile's Claude Code version pin.").option("--json", "Print the result as JSON.").action(async (name, allOptions) => {
|
|
112809
|
+
).option("--category <category=bool>", "Share (true) or hide (false) a whole category (repeatable).", collectBoolPair).option("--entry <path=bool>", "Share (true) or hide (false) one <category>/<path> entry (repeatable).", collectBoolPair).option("--extends <profile>", "Replace the extends list with these profiles (repeatable, in order).", collectRepeated).option("--no-extends", "Clear the extends list.").option("--description <text>", "Replace the description.").option("--no-description", "Clear the description.").option("--launch-skip-permissions", "Launches under this profile skip permission prompts.").option("--no-launch-skip-permissions", "Launches under this profile keep permission prompts.").option("--launch-remote-control", "Launches under this profile enable Remote Control.").option("--no-launch-remote-control", "Launches under this profile leave Remote Control off.").option("--launch-headroom", "Launches under this profile route through headroom.").option("--no-launch-headroom", "Launches under this profile route direct.").option("--launch-track-usage", "Launches under this profile route through the front door so their requests and quota are recorded, with no headroom needed.").option("--no-launch-track-usage", "Launches under this profile are not recorded unless a provider or headroom routes them anyway.").option("--launch-provider <provider>", "Launches under this profile route through this provider.").option("--no-launch-provider", "Clear this profile's provider selection.").option("--launch-claude-version <version>", "Launches under this profile run exactly this installed Claude Code version (such as 2.1.220); a version that is not installed fails the launch.").option("--no-launch-claude-version", "Clear this profile's Claude Code version pin.").option("--launch-delay <duration>", "Launches under this profile wait this long (such as 5s) after the launcher's own output before starting claude, so the output can be read.", parseDurationLiteral).option("--no-launch-delay", "Clear this profile's launch delay.").option("--launch-pause", "Launches under this profile wait for a key press after the launcher's own output before starting claude.").option("--no-launch-pause", "Launches under this profile start claude without waiting for a key press.").option("--json", "Print the result as JSON.").action(async (name, allOptions) => {
|
|
112609
112810
|
const { json: json2, ...options } = allOptions;
|
|
112610
112811
|
requireProfileExists(paths, name);
|
|
112611
112812
|
if (Object.entries(allOptions).every(([key, value2]) => key === "json" || value2 === void 0)) {
|
|
@@ -115711,7 +115912,7 @@ var HIGH_BIT = 128;
|
|
|
115711
115912
|
var BASE_128_PAYLOAD_MASK = 127;
|
|
115712
115913
|
var FIRST_ARC_WEIGHT = 40;
|
|
115713
115914
|
var SHORT_FORM_MAX_LENGTH = 127;
|
|
115714
|
-
var
|
|
115915
|
+
var MS_PER_SECOND10 = 1e3;
|
|
115715
115916
|
var UTC_TIME_LAST_YEAR = 2049;
|
|
115716
115917
|
var YEAR_DIGITS = 4;
|
|
115717
115918
|
var TWO_DIGIT_YEAR_DIGITS = 2;
|
|
@@ -115770,7 +115971,7 @@ function wholeBitString(content) {
|
|
|
115770
115971
|
return tlv(TAG_BIT_STRING, Buffer.concat([Buffer.from([0]), content]));
|
|
115771
115972
|
}
|
|
115772
115973
|
function time3(instant) {
|
|
115773
|
-
const iso = new Date(Math.floor(instant.getTime() /
|
|
115974
|
+
const iso = new Date(Math.floor(instant.getTime() / MS_PER_SECOND10) * MS_PER_SECOND10).toISOString();
|
|
115774
115975
|
const compact = `${iso.replace(/[-:T]/g, "").slice(0, COMPACT_TIME_DIGITS)}Z`;
|
|
115775
115976
|
if (instant.getUTCFullYear() > UTC_TIME_LAST_YEAR) {
|
|
115776
115977
|
return tlv(TAG_GENERALIZED_TIME, Buffer.from(compact, "ascii"));
|
|
@@ -127505,7 +127706,9 @@ var ConfigProfileSetInputSchema = external_exports.strictObject({
|
|
|
127505
127706
|
headroom: external_exports.boolean().optional(),
|
|
127506
127707
|
trackUsage: external_exports.boolean().optional(),
|
|
127507
127708
|
provider: external_exports.union([external_exports.string().min(1), external_exports.literal(false)]).optional(),
|
|
127508
|
-
claudeVersion: external_exports.union([external_exports.string().min(1), external_exports.literal(false)]).optional()
|
|
127709
|
+
claudeVersion: external_exports.union([external_exports.string().min(1), external_exports.literal(false)]).optional(),
|
|
127710
|
+
delay: external_exports.union([external_exports.string().regex(DURATION_RE), external_exports.literal(false)]).optional(),
|
|
127711
|
+
pause: external_exports.boolean().optional()
|
|
127509
127712
|
}).optional()
|
|
127510
127713
|
});
|
|
127511
127714
|
var ConfigProfileSetOutputSchema = storedMutationOutput("profile", "updated", ProfileValueSchema);
|
|
@@ -127715,7 +127918,9 @@ function createConfigApiRouter(deps) {
|
|
|
127715
127918
|
...launch?.headroom === void 0 ? {} : { launchHeadroom: launch.headroom },
|
|
127716
127919
|
...launch?.trackUsage === void 0 ? {} : { launchTrackUsage: launch.trackUsage },
|
|
127717
127920
|
...launch?.provider === void 0 ? {} : { launchProvider: launch.provider },
|
|
127718
|
-
...launch?.claudeVersion === void 0 ? {} : { launchClaudeVersion: launch.claudeVersion }
|
|
127921
|
+
...launch?.claudeVersion === void 0 ? {} : { launchClaudeVersion: launch.claudeVersion },
|
|
127922
|
+
...launch?.delay === void 0 ? {} : { launchDelay: launch.delay },
|
|
127923
|
+
...launch?.pause === void 0 ? {} : { launchPause: launch.pause }
|
|
127719
127924
|
});
|
|
127720
127925
|
return { action: "updated", kind: "profile", name: input2.name, value: profileValue(input2.name, paths) };
|
|
127721
127926
|
})
|
|
@@ -128014,7 +128219,10 @@ var LaunchFlagsSchema = external_exports.strictObject({
|
|
|
128014
128219
|
skipPermissions: external_exports.boolean(),
|
|
128015
128220
|
remoteControl: external_exports.boolean(),
|
|
128016
128221
|
headroom: external_exports.boolean(),
|
|
128017
|
-
trackUsage: external_exports.boolean()
|
|
128222
|
+
trackUsage: external_exports.boolean(),
|
|
128223
|
+
pause: external_exports.boolean(),
|
|
128224
|
+
/** How long the launch waits after its own output before it starts claude, in milliseconds. */
|
|
128225
|
+
delayMs: external_exports.number()
|
|
128018
128226
|
});
|
|
128019
128227
|
var LaunchResolveOutputSchema = external_exports.strictObject({
|
|
128020
128228
|
decision: LaunchDecisionSchema,
|
|
@@ -129177,17 +129385,17 @@ function unifiedQuotaHeaders(upstream, rejected, quotaError) {
|
|
|
129177
129385
|
}
|
|
129178
129386
|
return headers;
|
|
129179
129387
|
}
|
|
129180
|
-
var
|
|
129388
|
+
var MS_PER_SECOND11 = 1e3;
|
|
129181
129389
|
function buildUsageSnapshot(upstream, quotaError, nowMs) {
|
|
129182
129390
|
const used7 = upstream.get("x-codex-primary-used-percent") ?? (quotaError === void 0 ? null : EXHAUSTED_PERCENT);
|
|
129183
129391
|
const reset7 = upstream.get("x-codex-primary-reset-at") ?? (quotaError?.resets_at === void 0 ? null : String(quotaError.resets_at));
|
|
129184
|
-
const sevenDay = used7 !== null && reset7 !== null ? { used_percentage: Number(used7), resets_at: new Date(Number(reset7) *
|
|
129392
|
+
const sevenDay = used7 !== null && reset7 !== null ? { used_percentage: Number(used7), resets_at: new Date(Number(reset7) * MS_PER_SECOND11).toISOString() } : void 0;
|
|
129185
129393
|
let fiveHour;
|
|
129186
129394
|
if (Number(upstream.get("x-codex-secondary-window-minutes")) > 0) {
|
|
129187
129395
|
const used5 = upstream.get("x-codex-secondary-used-percent");
|
|
129188
129396
|
const reset5 = upstream.get("x-codex-secondary-reset-at");
|
|
129189
129397
|
if (used5 !== null && reset5 !== null) {
|
|
129190
|
-
fiveHour = { used_percentage: Number(used5), resets_at: new Date(Number(reset5) *
|
|
129398
|
+
fiveHour = { used_percentage: Number(used5), resets_at: new Date(Number(reset5) * MS_PER_SECOND11).toISOString() };
|
|
129191
129399
|
}
|
|
129192
129400
|
}
|
|
129193
129401
|
if (sevenDay === void 0 && fiveHour === void 0) {
|
|
@@ -129977,11 +130185,11 @@ async function* callLocalAntigravity(params) {
|
|
|
129977
130185
|
|
|
129978
130186
|
// src/antigravity/route.ts
|
|
129979
130187
|
init_quota();
|
|
129980
|
-
var
|
|
130188
|
+
var MS_PER_SECOND12 = 1e3;
|
|
129981
130189
|
var ROUTING_MEMORY_SESSIONS = 256;
|
|
129982
130190
|
function exhaustedMessage(exhaustion) {
|
|
129983
130191
|
const window = exhaustion.window === "five_hour" ? "5-hour" : "weekly";
|
|
129984
|
-
return `Antigravity ${window} limit reached; it resets at ${new Date(exhaustion.resetSec *
|
|
130192
|
+
return `Antigravity ${window} limit reached; it resets at ${new Date(exhaustion.resetSec * MS_PER_SECOND12).toISOString()}.`;
|
|
129985
130193
|
}
|
|
129986
130194
|
function createAntigravityRoute(ports) {
|
|
129987
130195
|
const fallbackId = ports.fallbackId ?? (() => (0, import_node_crypto23.randomUUID)());
|
|
@@ -130707,7 +130915,7 @@ init_account();
|
|
|
130707
130915
|
var RC_SELF_HOST_OAUTH_HOST = "platform.claude.com";
|
|
130708
130916
|
var RC_SELF_HOST_SCOPE_LIST = ["user:profile", "user:inference", "user:sessions:claude_code", "user:mcp_servers", "user:file_upload"];
|
|
130709
130917
|
var RC_SELF_HOST_OAUTH_TOKEN_TTL_SECONDS = 3600;
|
|
130710
|
-
var
|
|
130918
|
+
var MS_PER_SECOND13 = 1e3;
|
|
130711
130919
|
var HTTP_SERVICE_UNAVAILABLE = 503;
|
|
130712
130920
|
function isRecord15(value2) {
|
|
130713
130921
|
return typeof value2 === "object" && value2 !== null && !Array.isArray(value2);
|
|
@@ -130763,7 +130971,7 @@ function createRcSelfHostLocal(deps) {
|
|
|
130763
130971
|
}
|
|
130764
130972
|
if (method === "POST" && pathname.startsWith("/api/eval/")) {
|
|
130765
130973
|
await deps.readBody(request7, CONTROL_BODY_CAP_BYTES);
|
|
130766
|
-
answerServerJson(response, HTTP_STATUS.ok, { features: growthBookFeatures(), dateUpdated: Math.floor(deps.now() /
|
|
130974
|
+
answerServerJson(response, HTTP_STATUS.ok, { features: growthBookFeatures(), dateUpdated: Math.floor(deps.now() / MS_PER_SECOND13) });
|
|
130767
130975
|
return true;
|
|
130768
130976
|
}
|
|
130769
130977
|
if (method === "GET" && pathname === "/api/oauth/profile") {
|
|
@@ -130947,12 +131155,12 @@ function eventExcerpt(text2) {
|
|
|
130947
131155
|
return text2.length <= RC_PENDING_SUMMARY_EXCERPT_CHARS ? text2 : `${text2.slice(0, RC_PENDING_SUMMARY_EXCERPT_CHARS)}...`;
|
|
130948
131156
|
}
|
|
130949
131157
|
var PERCENT_SCALE = 100;
|
|
130950
|
-
var
|
|
131158
|
+
var MS_PER_SECOND14 = 1e3;
|
|
130951
131159
|
function percentOf(fraction) {
|
|
130952
131160
|
return `${String(Math.round(fraction * PERCENT_SCALE))}%`;
|
|
130953
131161
|
}
|
|
130954
131162
|
function resetInstantOf(epochSeconds) {
|
|
130955
|
-
return new Date(epochSeconds *
|
|
131163
|
+
return new Date(epochSeconds * MS_PER_SECOND14).toISOString();
|
|
130956
131164
|
}
|
|
130957
131165
|
function formatRcRateLimitInfo(info) {
|
|
130958
131166
|
const parts = [info.status];
|
|
@@ -132387,7 +132595,7 @@ var RC_COMPAT_SESSIONS_PATH = "/v1/sessions";
|
|
|
132387
132595
|
var RC_SESSION_ID_PREFIX2 = "cse_";
|
|
132388
132596
|
var RC_SELF_HOST_API_BASE_URL = "https://api.anthropic.com";
|
|
132389
132597
|
var HTTP_CONFLICT = 409;
|
|
132390
|
-
var
|
|
132598
|
+
var MS_PER_SECOND15 = 1e3;
|
|
132391
132599
|
var HTTP_SERVICE_UNAVAILABLE2 = 503;
|
|
132392
132600
|
var RC_SELF_HOST_WORKER_JWT_TTL_SECONDS = 46800;
|
|
132393
132601
|
var RC_SELF_HOST_KEEPALIVE_MS = 15e3;
|
|
@@ -132487,7 +132695,7 @@ function parseJsonObject5(body) {
|
|
|
132487
132695
|
function mintWorkerJwt(randomToken, issuedAt) {
|
|
132488
132696
|
const encode3 = (value2) => Buffer.from(JSON.stringify(value2), "utf8").toString("base64url");
|
|
132489
132697
|
const header = encode3({ alg: "HS256", typ: "JWT" });
|
|
132490
|
-
const payload = encode3({ exp: Math.floor((issuedAt + RC_SELF_HOST_WORKER_JWT_TTL_SECONDS *
|
|
132698
|
+
const payload = encode3({ exp: Math.floor((issuedAt + RC_SELF_HOST_WORKER_JWT_TTL_SECONDS * MS_PER_SECOND15) / MS_PER_SECOND15), iat: Math.floor(issuedAt / MS_PER_SECOND15) });
|
|
132491
132699
|
return `${header}.${payload}.${Buffer.from(randomToken(), "utf8").toString("base64url")}`;
|
|
132492
132700
|
}
|
|
132493
132701
|
function createRcSelfHostSurface(deps) {
|
|
@@ -134214,7 +134422,7 @@ var realHeadroomGet = async (target, requestPath, timeoutMs) => {
|
|
|
134214
134422
|
// src/statusline/enrich.ts
|
|
134215
134423
|
init_quota();
|
|
134216
134424
|
var FULL_PERCENT = 100;
|
|
134217
|
-
var
|
|
134425
|
+
var MS_PER_SECOND16 = 1e3;
|
|
134218
134426
|
function identityOf(env) {
|
|
134219
134427
|
const headers = env.ANTHROPIC_CUSTOM_HEADERS;
|
|
134220
134428
|
if (headers !== void 0) {
|
|
@@ -134271,7 +134479,7 @@ function payloadWindow(rateLimits, key) {
|
|
|
134271
134479
|
const resetsAt = window.resets_at;
|
|
134272
134480
|
return {
|
|
134273
134481
|
used: Math.min(FULL_PERCENT, Math.max(0, window.used_percentage)),
|
|
134274
|
-
resetAt: typeof resetsAt === "number" && Number.isFinite(resetsAt) ? new Date(resetsAt *
|
|
134482
|
+
resetAt: typeof resetsAt === "number" && Number.isFinite(resetsAt) ? new Date(resetsAt * MS_PER_SECOND16).toISOString() : void 0
|
|
134275
134483
|
};
|
|
134276
134484
|
}
|
|
134277
134485
|
function payloadWindowsOf(payload) {
|
|
@@ -134299,7 +134507,7 @@ function antigravityQuotaMapOf(payload) {
|
|
|
134299
134507
|
function bucketView(bucket, nowMs) {
|
|
134300
134508
|
return {
|
|
134301
134509
|
used: bucket?.remaining_fraction === void 0 || !Number.isFinite(bucket.remaining_fraction) ? void 0 : (1 - Math.min(1, Math.max(0, bucket.remaining_fraction))) * FULL_PERCENT,
|
|
134302
|
-
resetAt: bucket?.reset_in_seconds === void 0 || !Number.isFinite(bucket.reset_in_seconds) ? void 0 : new Date(nowMs + bucket.reset_in_seconds *
|
|
134510
|
+
resetAt: bucket?.reset_in_seconds === void 0 || !Number.isFinite(bucket.reset_in_seconds) ? void 0 : new Date(nowMs + bucket.reset_in_seconds * MS_PER_SECOND16).toISOString()
|
|
134303
134511
|
};
|
|
134304
134512
|
}
|
|
134305
134513
|
function antigravityWindowsOf(payload, nowMs) {
|
|
@@ -134372,7 +134580,7 @@ function enrichStatuslinePayload(params) {
|
|
|
134372
134580
|
window.measures,
|
|
134373
134581
|
{
|
|
134374
134582
|
remaining_fraction: 1 - window.utilization,
|
|
134375
|
-
...window.resetsAt === void 0 ? {} : { reset_in_seconds: (Date.parse(window.resetsAt) - params.nowMs) /
|
|
134583
|
+
...window.resetsAt === void 0 ? {} : { reset_in_seconds: (Date.parse(window.resetsAt) - params.nowMs) / MS_PER_SECOND16 }
|
|
134376
134584
|
}
|
|
134377
134585
|
])
|
|
134378
134586
|
);
|
|
@@ -146819,11 +147027,13 @@ Launching:
|
|
|
146819
147027
|
--[no-]skip-permissions, --[no-]remote-control, --[no-]headroom, --[no-]track-usage
|
|
146820
147028
|
--claude-version <version> run exactly this installed Claude Code version (not the highest)
|
|
146821
147029
|
--[no-]wait with @pool:<name>, sleep until the earliest member returns when all are refused
|
|
147030
|
+
--delay <duration> wait this long (5s, 500ms) after the launcher's own output before starting claude
|
|
147031
|
+
--[no-]pause wait for a key press after the launcher's own output before starting claude
|
|
146822
147032
|
--native run the real claude with nothing from agent-shim applied (no other launch flag allowed)
|
|
146823
147033
|
|
|
146824
147034
|
Environment:
|
|
146825
147035
|
AGENT_SHIM_IDENTITY, AGENT_SHIM_CONFIG_PROFILE, AGENT_SHIM_SKIP_PERMISSIONS,
|
|
146826
|
-
AGENT_SHIM_REMOTE_CONTROL, AGENT_SHIM_HEADROOM, AGENT_SHIM_TRACK_USAGE, AGENT_SHIM_ALLOW_AMBIENT_CREDENTIAL,
|
|
147036
|
+
AGENT_SHIM_REMOTE_CONTROL, AGENT_SHIM_HEADROOM, AGENT_SHIM_TRACK_USAGE, AGENT_SHIM_DELAY, AGENT_SHIM_PAUSE, AGENT_SHIM_ALLOW_AMBIENT_CREDENTIAL,
|
|
146827
147037
|
AGENT_SHIM_CATEGORY_OVERRIDE, AGENT_SHIM_ENTRY_OVERRIDE, AGENT_SHIM_HOME,
|
|
146828
147038
|
AGENT_SHIM_DEBUG (print stack traces), NO_COLOR. Booleans are true, false, 1 or 0.
|
|
146829
147039
|
|
|
@@ -147212,6 +147422,7 @@ function resetTerminal() {
|
|
|
147212
147422
|
}
|
|
147213
147423
|
|
|
147214
147424
|
// src/supervise/supervise.ts
|
|
147425
|
+
init_hold();
|
|
147215
147426
|
init_spawn();
|
|
147216
147427
|
var STOP_GRACE_MS = 5e3;
|
|
147217
147428
|
function messageOf(error63) {
|
|
@@ -147383,6 +147594,10 @@ async function supervise(deps, first) {
|
|
|
147383
147594
|
plan.release();
|
|
147384
147595
|
throw new Error("a supervised launch resolved no identity to supervise");
|
|
147385
147596
|
}
|
|
147597
|
+
if (!moved && plan.hold() === "cancelled") {
|
|
147598
|
+
plan.release();
|
|
147599
|
+
return LAUNCH_CANCELLED_EXIT;
|
|
147600
|
+
}
|
|
147386
147601
|
if (!moved) {
|
|
147387
147602
|
deps.register({ pid: deps.pid, sessionId: plan.sessionId, pool: deps.pool, identity, cwd: deps.cwd, since: new Date(deps.now()).toISOString() });
|
|
147388
147603
|
}
|
|
@@ -147538,6 +147753,8 @@ function otherLaunchFlags(parsed) {
|
|
|
147538
147753
|
...parsed.configProfile === void 0 ? [] : ["--config-profile"],
|
|
147539
147754
|
...parsed.provider === void 0 ? [] : [parsed.provider === false ? "--no-provider" : "--provider"],
|
|
147540
147755
|
...parsed.claudeVersion === void 0 ? [] : ["--claude-version"],
|
|
147756
|
+
...parsed.delay === void 0 ? [] : ["--delay"],
|
|
147757
|
+
...parsed.pause === void 0 ? [] : ["--[no-]pause"],
|
|
147541
147758
|
...parsed.headroom === void 0 ? [] : ["--[no-]headroom"],
|
|
147542
147759
|
...parsed.trackUsage === void 0 ? [] : ["--[no-]track-usage"],
|
|
147543
147760
|
...parsed.skipPermissions === void 0 ? [] : ["--[no-]skip-permissions"],
|