claude-use 11.26.0 → 11.28.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/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,6 +28687,40 @@ var init_supervisor = __esm({
28683
28687
  }
28684
28688
  });
28685
28689
 
28690
+ // src/logStyle.ts
28691
+ function styledDiagnostic(style, colour, line) {
28692
+ const lead = DIAGNOSTIC_LEAD.exec(line);
28693
+ if (lead === null) {
28694
+ return style([colour], line);
28695
+ }
28696
+ const [whole, prefix = "", code = "", separator = ""] = lead;
28697
+ return `${style([colour], prefix)}${style([colour, "bold"], code)}${style([colour], `${separator}${line.slice(whole.length)}`)}`;
28698
+ }
28699
+ function createLogPort(sinks, styleFor) {
28700
+ return {
28701
+ info: (message) => {
28702
+ sinks.out(styleFor.out(["dim"], message));
28703
+ },
28704
+ warn: (message) => {
28705
+ sinks.warn(styledDiagnostic(styleFor.err, "yellow", message));
28706
+ },
28707
+ error: (message) => {
28708
+ sinks.err(styledDiagnostic(styleFor.err, "red", message));
28709
+ }
28710
+ };
28711
+ }
28712
+ function styleTextFor(stream) {
28713
+ return (formats, text2) => (0, import_node_util3.styleText)([...formats], text2, { stream });
28714
+ }
28715
+ var import_node_util3, DIAGNOSTIC_LEAD;
28716
+ var init_logStyle = __esm({
28717
+ "src/logStyle.ts"() {
28718
+ "use strict";
28719
+ import_node_util3 = require("node:util");
28720
+ DIAGNOSTIC_LEAD = /^(agent-shim: )([A-Z][A-Z0-9_]*)(: )/;
28721
+ }
28722
+ });
28723
+
28686
28724
  // src/realPorts.ts
28687
28725
  function isEnoent2(error63) {
28688
28726
  return typeof error63 === "object" && error63 !== null && "code" in error63 && error63.code === "ENOENT";
@@ -28976,7 +29014,7 @@ function realResolveClaudeBinary(isOwnBinary) {
28976
29014
  function realInstalledClaudeVersions() {
28977
29015
  return installedVersions(listVersionsDir(defaultVersionsDir()));
28978
29016
  }
28979
- 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;
29017
+ 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;
28980
29018
  var init_realPorts = __esm({
28981
29019
  "src/realPorts.ts"() {
28982
29020
  "use strict";
@@ -28993,6 +29031,7 @@ var init_realPorts = __esm({
28993
29031
  init_ensure();
28994
29032
  init_supervisor();
28995
29033
  init_state2();
29034
+ init_logStyle();
28996
29035
  realFsPort = {
28997
29036
  readFileUtf8(filePath) {
28998
29037
  try {
@@ -29124,6 +29163,31 @@ var init_realPorts = __esm({
29124
29163
  }
29125
29164
  };
29126
29165
  INT32_BYTE_LENGTH = 4;
29166
+ KEY_POLL_MS = 25;
29167
+ CTRL_C_BYTE = 3;
29168
+ realHoldPort = {
29169
+ attended: () => process.stdin.isTTY && process.stdout.isTTY,
29170
+ sleep: realSleepSync,
29171
+ waitForKey: () => {
29172
+ process.stdin.setRawMode(true);
29173
+ try {
29174
+ const buffer2 = Buffer.alloc(1);
29175
+ for (; ; ) {
29176
+ try {
29177
+ const read = import_node_fs3.default.readSync(process.stdin.fd, buffer2, 0, buffer2.length, null);
29178
+ return read > 0 && buffer2[0] === CTRL_C_BYTE ? "interrupt" : "key";
29179
+ } catch (error63) {
29180
+ if (!(error63 instanceof Error && "code" in error63 && error63.code === "EAGAIN")) {
29181
+ throw error63;
29182
+ }
29183
+ realSleepSync(KEY_POLL_MS);
29184
+ }
29185
+ }
29186
+ } finally {
29187
+ process.stdin.setRawMode(false);
29188
+ }
29189
+ }
29190
+ };
29127
29191
  LINE_FEED = 10;
29128
29192
  UTF8_CONTINUATION_MASK = 192;
29129
29193
  UTF8_CONTINUATION_BITS = 128;
@@ -29201,17 +29265,16 @@ var init_realPorts = __esm({
29201
29265
  argv: process.argv.slice(2),
29202
29266
  exit: (code) => process.exit(code)
29203
29267
  };
29204
- realLogPort = {
29205
- info: (message) => {
29206
- console.log(message);
29207
- },
29208
- warn: (message) => {
29209
- console.warn(message);
29210
- },
29211
- error: (message) => {
29212
- console.error(message);
29213
- }
29214
- };
29268
+ realLogPort = createLogPort(
29269
+ { out: (line) => {
29270
+ console.log(line);
29271
+ }, warn: (line) => {
29272
+ console.warn(line);
29273
+ }, err: (line) => {
29274
+ console.error(line);
29275
+ } },
29276
+ { out: styleTextFor(process.stdout), err: styleTextFor(process.stderr) }
29277
+ );
29215
29278
  EXECUTE_BITS_MASK = 73;
29216
29279
  WINDOWS_DEFAULT_PATHEXT = ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PS1";
29217
29280
  }
@@ -31331,7 +31394,10 @@ var init_categories_default = __esm({
31331
31394
  "usage-data",
31332
31395
  "ide",
31333
31396
  "cache",
31334
- "scheduled_tasks.lock"
31397
+ "scheduled_tasks.lock",
31398
+ "policy-limits.json*",
31399
+ "remote-settings.json*",
31400
+ "state"
31335
31401
  ],
31336
31402
  history: [
31337
31403
  "projects",
@@ -32465,6 +32531,12 @@ function flattenLayers(layers, options) {
32465
32531
  if (layer.launch.claudeVersion !== void 0) {
32466
32532
  launch.claudeVersion = layer.launch.claudeVersion;
32467
32533
  }
32534
+ if (layer.launch.delay !== void 0) {
32535
+ launch.delay = layer.launch.delay;
32536
+ }
32537
+ if (layer.launch.pause !== void 0) {
32538
+ launch.pause = layer.launch.pause;
32539
+ }
32468
32540
  }
32469
32541
  if (layer.entries === void 0) {
32470
32542
  continue;
@@ -32563,6 +32635,12 @@ var init_flatten = __esm({
32563
32635
  });
32564
32636
 
32565
32637
  // src/resolve/decide.ts
32638
+ function unclassifiedEntryMessage(names) {
32639
+ const quoted = names.map((name) => `"${name}"`).join(", ");
32640
+ const subject = names.length === 1 ? `${quoted} is not` : `${String(names.length)} entries are not`;
32641
+ const excluded = names.length === 1 ? "it is excluded" : `they are excluded: ${quoted}`;
32642
+ return `${subject} in the category map, so ${excluded}. Run \`agent-shim configure\` to classify ${names.length === 1 ? "it" : "them"}, which records the answer in the local overlay without touching the shipped default map.`;
32643
+ }
32566
32644
  function selectRule(relPath, flattened, context) {
32567
32645
  const eliminated = [];
32568
32646
  for (const rule of matchingRules(flattened, relPath)) {
@@ -32600,7 +32678,7 @@ function resolveEntry(relPath, params) {
32600
32678
  diagnostics.push({
32601
32679
  code: "UNCLASSIFIED_ENTRY",
32602
32680
  severity: "warning",
32603
- message: `"${head}" is not in the category map, so it is excluded. Run \`agent-shim configure\` to classify it, which records the answer in the local overlay without touching the shipped default map.`,
32681
+ message: unclassifiedEntryMessage([head]),
32604
32682
  subject: head
32605
32683
  });
32606
32684
  return { decision: { relPath, shared: false, via: "unclassified", category }, diagnostics };
@@ -34202,7 +34280,7 @@ var init_package = __esm({
34202
34280
  "package.json"() {
34203
34281
  package_default = {
34204
34282
  name: "claude-use",
34205
- version: "11.26.0",
34283
+ version: "11.28.0",
34206
34284
  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.",
34207
34285
  license: "MIT",
34208
34286
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -62895,6 +62973,7 @@ function parseLauncherArgv(argv) {
62895
62973
  let configProfile;
62896
62974
  let provider;
62897
62975
  let claudeVersion;
62976
+ let delay;
62898
62977
  const booleans = {};
62899
62978
  const categoryFlags = [];
62900
62979
  const shareFlags = [];
@@ -62952,6 +63031,9 @@ function parseLauncherArgv(argv) {
62952
63031
  case "--claude-version":
62953
63032
  claudeVersion = value2;
62954
63033
  break;
63034
+ case "--delay":
63035
+ delay = value2;
63036
+ break;
62955
63037
  case "--category":
62956
63038
  categoryFlags.push(value2);
62957
63039
  break;
@@ -62974,6 +63056,7 @@ function parseLauncherArgv(argv) {
62974
63056
  ...configProfile === void 0 ? {} : { configProfile },
62975
63057
  ...provider === void 0 ? {} : { provider },
62976
63058
  ...claudeVersion === void 0 ? {} : { claudeVersion },
63059
+ ...delay === void 0 ? {} : { delay },
62977
63060
  ...native ? { native: true } : {},
62978
63061
  ...booleans,
62979
63062
  categoryFlags,
@@ -62997,13 +63080,14 @@ var init_argv = __esm({
62997
63080
  positional;
62998
63081
  flag;
62999
63082
  };
63000
- VALUED_FLAGS = ["--identity", "--config-profile", "--provider", "--claude-version", "--category", "--share", "--hide"];
63083
+ VALUED_FLAGS = ["--identity", "--config-profile", "--provider", "--claude-version", "--delay", "--category", "--share", "--hide"];
63001
63084
  BOOLEAN_FLAGS = [
63002
63085
  { flag: "--headroom", key: "headroom" },
63003
63086
  { flag: "--track-usage", key: "trackUsage" },
63004
63087
  { flag: "--skip-permissions", key: "skipPermissions" },
63005
63088
  { flag: "--remote-control", key: "remoteControl" },
63006
- { flag: "--wait", key: "wait" }
63089
+ { flag: "--wait", key: "wait" },
63090
+ { flag: "--pause", key: "pause" }
63007
63091
  ];
63008
63092
  LAUNCHER_FLAG_NAMES = [
63009
63093
  ...VALUED_FLAGS,
@@ -63190,9 +63274,23 @@ function resolveLaunchFlags(params) {
63190
63274
  skipPermissions: params.flags?.skipPermissions ?? parseEnvBool("AGENT_SHIM_SKIP_PERMISSIONS", params.env.AGENT_SHIM_SKIP_PERMISSIONS) ?? params.cascade?.skipPermissions ?? false,
63191
63275
  remoteControl: params.flags?.remoteControl ?? parseEnvBool("AGENT_SHIM_REMOTE_CONTROL", params.env.AGENT_SHIM_REMOTE_CONTROL) ?? params.cascade?.remoteControl ?? false,
63192
63276
  headroom: params.flags?.headroom ?? parseEnvBool("AGENT_SHIM_HEADROOM", params.env.AGENT_SHIM_HEADROOM) ?? params.cascade?.headroom ?? false,
63193
- trackUsage: params.flags?.trackUsage ?? parseEnvBool("AGENT_SHIM_TRACK_USAGE", params.env.AGENT_SHIM_TRACK_USAGE) ?? params.cascade?.trackUsage ?? true
63277
+ trackUsage: params.flags?.trackUsage ?? parseEnvBool("AGENT_SHIM_TRACK_USAGE", params.env.AGENT_SHIM_TRACK_USAGE) ?? params.cascade?.trackUsage ?? true,
63278
+ pause: params.flags?.pause ?? parseEnvBool("AGENT_SHIM_PAUSE", params.env.AGENT_SHIM_PAUSE) ?? params.cascade?.pause ?? false,
63279
+ delayMs: resolveDelayMs(params)
63194
63280
  };
63195
63281
  }
63282
+ function resolveDelayMs(params) {
63283
+ const fromEnv = params.env.AGENT_SHIM_DELAY === "" ? void 0 : params.env.AGENT_SHIM_DELAY;
63284
+ const [literal2, source] = params.flags?.delay !== void 0 ? [params.flags.delay, "--delay"] : fromEnv !== void 0 ? [fromEnv, "AGENT_SHIM_DELAY"] : [params.cascade?.delay, "launch.delay"];
63285
+ if (literal2 === void 0) {
63286
+ return 0;
63287
+ }
63288
+ try {
63289
+ return parseDuration(literal2);
63290
+ } catch (error63) {
63291
+ throw new UsageError(`${source}: ${error63 instanceof Error ? error63.message : String(error63)}`);
63292
+ }
63293
+ }
63196
63294
  function buildFlagArgs(flags) {
63197
63295
  const args = [];
63198
63296
  if (flags.skipPermissions) {
@@ -63265,6 +63363,8 @@ var init_flags = __esm({
63265
63363
  "use strict";
63266
63364
  import_node_path40 = __toESM(require("node:path"), 1);
63267
63365
  init_envBool();
63366
+ init_cliError();
63367
+ init_conditions();
63268
63368
  init_credential();
63269
63369
  init_headers();
63270
63370
  init_capability();
@@ -63483,6 +63583,67 @@ var init_claudeSession = __esm({
63483
63583
  }
63484
63584
  });
63485
63585
 
63586
+ // src/launcher/diagnostics.ts
63587
+ function diagnosticLines(diagnostics) {
63588
+ const unclassified = [...new Set(diagnostics.filter((diagnostic) => diagnostic.code === "UNCLASSIFIED_ENTRY").map((diagnostic) => diagnostic.subject))];
63589
+ const lines = [];
63590
+ let unclassifiedReported = false;
63591
+ for (const diagnostic of diagnostics) {
63592
+ if (diagnostic.severity === "info") {
63593
+ continue;
63594
+ }
63595
+ if (diagnostic.code === "UNCLASSIFIED_ENTRY") {
63596
+ if (!unclassifiedReported) {
63597
+ unclassifiedReported = true;
63598
+ lines.push({ severity: diagnostic.severity, text: `agent-shim: ${diagnostic.code}: ${unclassifiedEntryMessage(unclassified.filter((name) => name !== void 0))}` });
63599
+ }
63600
+ continue;
63601
+ }
63602
+ lines.push({ severity: diagnostic.severity, text: `agent-shim: ${diagnostic.code}: ${diagnostic.message}` });
63603
+ }
63604
+ return lines;
63605
+ }
63606
+ function reportDiagnostics(log, diagnostics, options) {
63607
+ for (const line of diagnosticLines(diagnostics)) {
63608
+ if (line.severity === "error" && !options.errorsAsWarnings) {
63609
+ log.error(line.text);
63610
+ } else {
63611
+ log.warn(line.text);
63612
+ }
63613
+ }
63614
+ }
63615
+ var init_diagnostics = __esm({
63616
+ "src/launcher/diagnostics.ts"() {
63617
+ "use strict";
63618
+ init_decide();
63619
+ }
63620
+ });
63621
+
63622
+ // src/launcher/hold.ts
63623
+ function describeDelay(ms2) {
63624
+ return ms2 % MS_PER_SECOND6 === 0 ? `${String(ms2 / MS_PER_SECOND6)}s` : `${String(ms2)}ms`;
63625
+ }
63626
+ function holdBeforeLaunch(hold, port, log) {
63627
+ if (port === void 0 || !port.attended() || !hold.pause && hold.delayMs <= 0) {
63628
+ return "go";
63629
+ }
63630
+ if (hold.pause) {
63631
+ log.info("agent-shim: paused before launch; press any key to start, or Ctrl-C to cancel");
63632
+ return port.waitForKey() === "interrupt" ? "cancelled" : "go";
63633
+ }
63634
+ log.info(`agent-shim: starting in ${describeDelay(hold.delayMs)}`);
63635
+ port.sleep(hold.delayMs);
63636
+ return "go";
63637
+ }
63638
+ var LAUNCH_CANCELLED_EXIT, MS_PER_SECOND6;
63639
+ var init_hold = __esm({
63640
+ "src/launcher/hold.ts"() {
63641
+ "use strict";
63642
+ LAUNCH_CANCELLED_EXIT = 130;
63643
+ MS_PER_SECOND6 = 1e3;
63644
+ }
63645
+ });
63646
+
63486
63647
  // src/antigravity/cloudUpstream.ts
63487
63648
  function isCcpaEndpoint(endpoint) {
63488
63649
  return endpoint.includes("cloudcode-pa.googleapis.com");
@@ -63667,14 +63828,14 @@ function parseRetryAfterSeconds(raw, defaultSeconds = DEFAULT_RETRY_AFTER_SECOND
63667
63828
  }
63668
63829
  const parsedDate = Date.parse(raw);
63669
63830
  if (!Number.isNaN(parsedDate)) {
63670
- const diffSec = Math.ceil((parsedDate - Date.now()) / MS_PER_SECOND6);
63831
+ const diffSec = Math.ceil((parsedDate - Date.now()) / MS_PER_SECOND7);
63671
63832
  return Math.max(1, diffSec);
63672
63833
  }
63673
63834
  return defaultSeconds;
63674
63835
  }
63675
63836
  function unifiedAntigravityQuotaHeaders(params) {
63676
63837
  const rejected = params.rejected === true;
63677
- const nowSec = Math.floor(params.nowMs / MS_PER_SECOND6);
63838
+ const nowSec = Math.floor(params.nowMs / MS_PER_SECOND7);
63678
63839
  const { fiveHour: b5h, weekly: bWk } = selectAntigravityBuckets(params.quota ?? {}, params.model);
63679
63840
  const used5h = calculateUtilization(b5h?.remaining_fraction);
63680
63841
  const reset5h = calculateResetTimestamp(nowSec, b5h?.reset_in_seconds);
@@ -63722,7 +63883,7 @@ function unifiedAntigravityQuotaHeaders(params) {
63722
63883
  }
63723
63884
  function antigravityQuotaExhaustion(quota, model, nowMs) {
63724
63885
  const { fiveHour, weekly } = selectAntigravityBuckets(quota ?? {}, model);
63725
- const nowSec = Math.floor(nowMs / MS_PER_SECOND6);
63886
+ const nowSec = Math.floor(nowMs / MS_PER_SECOND7);
63726
63887
  const spent = [];
63727
63888
  for (const [window, bucket] of [["five_hour", fiveHour], ["seven_day", weekly]]) {
63728
63889
  const remaining = bucket?.remaining_fraction;
@@ -63743,7 +63904,7 @@ function bucketToEntry(bucket, nowMs) {
63743
63904
  }
63744
63905
  const remainingFraction = typeof bucket.remainingFraction === "number" && Number.isFinite(bucket.remainingFraction) ? bucket.remainingFraction : void 0;
63745
63906
  const resetMs = typeof bucket.resetTime === "string" ? Date.parse(bucket.resetTime) : Number.NaN;
63746
- const resetInSeconds = Number.isNaN(resetMs) ? void 0 : Math.max(0, Math.ceil((resetMs - nowMs) / MS_PER_SECOND6));
63907
+ const resetInSeconds = Number.isNaN(resetMs) ? void 0 : Math.max(0, Math.ceil((resetMs - nowMs) / MS_PER_SECOND7));
63747
63908
  if (remainingFraction === void 0 && resetInSeconds === void 0) {
63748
63909
  return void 0;
63749
63910
  }
@@ -63823,17 +63984,17 @@ function createCachedAntigravityQuotaSource(params) {
63823
63984
  };
63824
63985
  }
63825
63986
  function ageQuotaMap(quota, elapsedMs) {
63826
- const elapsedSec = elapsedMs / MS_PER_SECOND6;
63987
+ const elapsedSec = elapsedMs / MS_PER_SECOND7;
63827
63988
  return Object.fromEntries(
63828
63989
  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) }])
63829
63990
  );
63830
63991
  }
63831
- var MS_PER_SECOND6, 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;
63992
+ 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;
63832
63993
  var init_quota = __esm({
63833
63994
  "src/antigravity/quota.ts"() {
63834
63995
  "use strict";
63835
63996
  init_cloudUpstream();
63836
- MS_PER_SECOND6 = 1e3;
63997
+ MS_PER_SECOND7 = 1e3;
63837
63998
  DEFAULT_RETRY_AFTER_SECONDS = 60;
63838
63999
  FRACTION_DIGITS = 3;
63839
64000
  GEMINI_5H_KEYS = ["gemini-5h", "gemini_5h", "gemini"];
@@ -64524,7 +64685,7 @@ async function fetchCatalogue(params) {
64524
64685
  }
64525
64686
  throw new CatalogueFetchError(`no catalogue from ${outcomes.join("; ")}`);
64526
64687
  }
64527
- var import_node_path42, import_picomatch3, DEFAULT_CANDIDATE_URLS, MS_PER_SECOND7, 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;
64688
+ 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;
64528
64689
  var init_providerCatalogue = __esm({
64529
64690
  "src/providerCatalogue.ts"() {
64530
64691
  "use strict";
@@ -64532,17 +64693,17 @@ var init_providerCatalogue = __esm({
64532
64693
  import_picomatch3 = __toESM(require_picomatch2(), 1);
64533
64694
  init_zod();
64534
64695
  DEFAULT_CANDIDATE_URLS = 2;
64535
- MS_PER_SECOND7 = 1e3;
64696
+ MS_PER_SECOND8 = 1e3;
64536
64697
  SECONDS_PER_HOUR2 = 3600;
64537
64698
  HOURS_PER_DAY4 = 24;
64538
- MS_PER_HOUR3 = SECONDS_PER_HOUR2 * MS_PER_SECOND7;
64699
+ MS_PER_HOUR3 = SECONDS_PER_HOUR2 * MS_PER_SECOND8;
64539
64700
  HOURS_BETWEEN_RETRIES = 1;
64540
64701
  HTTP_OK = 200;
64541
64702
  HTTP_MULTIPLE_CHOICES = 300;
64542
64703
  CATALOGUE_MAX_AGE_MS = HOURS_PER_DAY4 * MS_PER_HOUR3;
64543
64704
  CATALOGUE_RETRY_MS = HOURS_BETWEEN_RETRIES * MS_PER_HOUR3;
64544
64705
  CATALOGUE_REQUEST_SECONDS = 10;
64545
- CATALOGUE_REQUEST_TIMEOUT_MS = CATALOGUE_REQUEST_SECONDS * MS_PER_SECOND7;
64706
+ CATALOGUE_REQUEST_TIMEOUT_MS = CATALOGUE_REQUEST_SECONDS * MS_PER_SECOND8;
64546
64707
  CATALOGUE_REFRESH_TIMEOUT_MS = DEFAULT_CANDIDATE_URLS * CATALOGUE_REQUEST_TIMEOUT_MS;
64547
64708
  CatalogueModelSchema = external_exports.strictObject({ id: external_exports.string().min(1), name: external_exports.string().min(1).optional() });
64548
64709
  CatalogueCacheSchema = external_exports.strictObject({ fetchedAt: external_exports.number(), url: external_exports.string().min(1), models: external_exports.array(CatalogueModelSchema) });
@@ -65058,17 +65219,7 @@ function decideLaunch(params, readOnly) {
65058
65219
  const flattened = flattenLayers(assembled.layers, { home: params.farm.home });
65059
65220
  cascadeLaunch = flattened.launch;
65060
65221
  if (readOnly || farmContext === void 0) {
65061
- for (const diagnostic of [...assembled.diagnostics, ...flattened.diagnostics]) {
65062
- if (diagnostic.severity === "info") {
65063
- continue;
65064
- }
65065
- const message = `agent-shim: ${diagnostic.code}: ${diagnostic.message}`;
65066
- if (diagnostic.severity === "error" && !readOnly) {
65067
- log.error(message);
65068
- } else {
65069
- log.warn(message);
65070
- }
65071
- }
65222
+ reportDiagnostics(log, [...assembled.diagnostics, ...flattened.diagnostics], { errorsAsWarnings: readOnly });
65072
65223
  }
65073
65224
  }
65074
65225
  const pinnedVersion = resolveClaudeVersion({ env, ...parsedArgv.claudeVersion === void 0 ? {} : { flag: parsedArgv.claudeVersion }, ...cascadeLaunch?.claudeVersion === void 0 ? {} : { cascade: cascadeLaunch.claudeVersion } });
@@ -65080,7 +65231,9 @@ function decideLaunch(params, readOnly) {
65080
65231
  ...parsedArgv.skipPermissions === void 0 ? {} : { skipPermissions: parsedArgv.skipPermissions },
65081
65232
  ...parsedArgv.remoteControl === void 0 ? {} : { remoteControl: parsedArgv.remoteControl },
65082
65233
  ...parsedArgv.headroom === void 0 ? {} : { headroom: parsedArgv.headroom },
65083
- ...parsedArgv.trackUsage === void 0 ? {} : { trackUsage: parsedArgv.trackUsage }
65234
+ ...parsedArgv.trackUsage === void 0 ? {} : { trackUsage: parsedArgv.trackUsage },
65235
+ ...parsedArgv.pause === void 0 ? {} : { pause: parsedArgv.pause },
65236
+ ...parsedArgv.delay === void 0 ? {} : { delay: parsedArgv.delay }
65084
65237
  }
65085
65238
  });
65086
65239
  const loginlessProvider = requestedFlags.remoteControl && selectedProvider !== void 0 && farmIdentity !== void 0 && params.hasStoredLogin?.(farmIdentity) === false ? { identity: farmIdentity, provider: selectedProvider.name } : void 0;
@@ -65173,16 +65326,12 @@ function prepareLaunch(params) {
65173
65326
  }
65174
65327
  throw error63;
65175
65328
  }
65176
- for (const diagnostic of result.diagnostics) {
65177
- if (diagnostic.severity === "error") {
65178
- log.error(`agent-shim: ${diagnostic.code}: ${diagnostic.message}`);
65179
- } else if (diagnostic.severity === "warning") {
65180
- log.warn(`agent-shim: ${diagnostic.code}: ${diagnostic.message}`);
65181
- }
65329
+ reportDiagnostics(log, result.diagnostics, { errorsAsWarnings: false });
65330
+ if (!result.noOp) {
65331
+ log.info(
65332
+ `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}`})`
65333
+ );
65182
65334
  }
65183
- log.info(
65184
- result.noOp ? `agent-shim: farm at ${result.farmRoot} already matches the resolved cascade` : `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}`})`
65185
- );
65186
65335
  }
65187
65336
  if (decided.pinnedVersion !== void 0) {
65188
65337
  log.info(`agent-shim: Claude Code ${decided.pinnedVersion.version} (pinned by ${decided.pinnedVersion.source})`);
@@ -65229,7 +65378,8 @@ function prepareLaunch(params) {
65229
65378
  registered();
65230
65379
  }
65231
65380
  };
65232
- return { bin: decided.bin, args: finalArgv, env: finalEnv, sessionId, release, markChildStarted: updateCheck.markChildStarted, decision };
65381
+ const hold = () => holdBeforeLaunch({ delayMs: resolvedFlags.delayMs, pause: resolvedFlags.pause }, params.hold, log);
65382
+ return { bin: decided.bin, args: finalArgv, env: finalEnv, sessionId, release, markChildStarted: updateCheck.markChildStarted, hold, decision };
65233
65383
  }
65234
65384
  function resolveLaunch(params) {
65235
65385
  const decided = decideLaunch(params, true);
@@ -65262,6 +65412,9 @@ function resolveLaunch(params) {
65262
65412
  }
65263
65413
  function runLaunchPlan(plan, spawn8) {
65264
65414
  try {
65415
+ if (plan.hold() === "cancelled") {
65416
+ return LAUNCH_CANCELLED_EXIT;
65417
+ }
65265
65418
  plan.markChildStarted();
65266
65419
  const result = spawn8.spawnSync(plan.bin, plan.args, { stdio: "inherit", env: plan.env });
65267
65420
  if (result.error !== void 0) {
@@ -65291,6 +65444,8 @@ var init_launcher = __esm({
65291
65444
  init_flags();
65292
65445
  init_extraFlags();
65293
65446
  init_claudeSession();
65447
+ init_diagnostics();
65448
+ init_hold();
65294
65449
  init_modelPicker();
65295
65450
  init_providerCatalogue();
65296
65451
  init_pool();
@@ -65363,6 +65518,7 @@ function realPrepareLaunchParams(paths, options) {
65363
65518
  headroom: realHeadroomPort(paths, { spawnDaemon: options.spawnDaemon, cwd: farm.runtime.cwd }),
65364
65519
  frontdoor: realFrontDoorPort(paths, options.spawnDaemon),
65365
65520
  credentials: { ...realCredentialPort, cache: realCredentialCacheEnv(paths) },
65521
+ hold: realHoldPort,
65366
65522
  hasStoredLogin: (identity) => identitySignIn(realFarmFs, { platform: process.platform, run: realRunPort }, { farmRoot: import_node_path44.default.join(paths.identitiesDir, identity), hasCredentialBlock: false }).state !== "signed-out",
65367
65523
  ...farm.directoryIdentity === void 0 ? {} : { directoryPinnedIdentity: farm.directoryIdentity },
65368
65524
  ...farm.directoryConfigProfile === void 0 ? {} : { directoryRuleConfigProfile: farm.directoryConfigProfile },
@@ -65525,7 +65681,7 @@ function quotaFreshnessMs(quota) {
65525
65681
  const lengths = quota.windows.flatMap((window) => window.periodMs === void 0 ? [] : [window.periodMs]);
65526
65682
  return lengths.length === 0 ? Number.POSITIVE_INFINITY : Math.min(...lengths) / PERCENT3;
65527
65683
  }
65528
- var ProviderQuotaError, MS_PER_SECOND8, 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;
65684
+ 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;
65529
65685
  var init_providerQuota = __esm({
65530
65686
  "src/usage/providerQuota.ts"() {
65531
65687
  "use strict";
@@ -65538,7 +65694,7 @@ var init_providerQuota = __esm({
65538
65694
  this.name = "ProviderQuotaError";
65539
65695
  }
65540
65696
  };
65541
- MS_PER_SECOND8 = 1e3;
65697
+ MS_PER_SECOND9 = 1e3;
65542
65698
  SECONDS_PER_HOUR3 = 3600;
65543
65699
  HOURS_PER_DAY5 = 24;
65544
65700
  DAYS_PER_MONTH = 30;
@@ -65550,8 +65706,8 @@ var init_providerQuota = __esm({
65550
65706
  ZAI_UNIT_HOURS = 3;
65551
65707
  ZAI_UNIT_MONTHS = 5;
65552
65708
  ZAI_UNIT_MS = /* @__PURE__ */ new Map([
65553
- [ZAI_UNIT_HOURS, SECONDS_PER_HOUR3 * MS_PER_SECOND8],
65554
- [ZAI_UNIT_MONTHS, DAYS_PER_MONTH * HOURS_PER_DAY5 * SECONDS_PER_HOUR3 * MS_PER_SECOND8]
65709
+ [ZAI_UNIT_HOURS, SECONDS_PER_HOUR3 * MS_PER_SECOND9],
65710
+ [ZAI_UNIT_MONTHS, DAYS_PER_MONTH * HOURS_PER_DAY5 * SECONDS_PER_HOUR3 * MS_PER_SECOND9]
65555
65711
  ]);
65556
65712
  ZAI_MEASURES = { TOKENS_LIMIT: "tokens", TIME_LIMIT: "tool-calls" };
65557
65713
  ZaiLimitSchema = external_exports.object({
@@ -65603,7 +65759,7 @@ var init_providerQuota = __esm({
65603
65759
  OPENROUTER_KEY_URL = `https://${OPENROUTER_HOST}/api/v1/key`;
65604
65760
  OPENROUTER_CREDITS_URL = `https://${OPENROUTER_HOST}/api/v1/credits`;
65605
65761
  HTTP_FORBIDDEN = 403;
65606
- MS_PER_DAY2 = HOURS_PER_DAY5 * SECONDS_PER_HOUR3 * MS_PER_SECOND8;
65762
+ MS_PER_DAY2 = HOURS_PER_DAY5 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
65607
65763
  OpenRouterKeySchema = external_exports.object({
65608
65764
  data: external_exports.object({
65609
65765
  limit: external_exports.number().nonnegative().nullable(),
@@ -65651,8 +65807,8 @@ var init_providerQuota = __esm({
65651
65807
  GOOGLE_TOKENINFO_URL = "https://oauth2.googleapis.com/tokeninfo";
65652
65808
  FIVE_HOURS2 = 5;
65653
65809
  DAYS_PER_WEEK2 = 7;
65654
- FIVE_HOURS_MS = FIVE_HOURS2 * SECONDS_PER_HOUR3 * MS_PER_SECOND8;
65655
- WEEK_MS = DAYS_PER_WEEK2 * HOURS_PER_DAY5 * SECONDS_PER_HOUR3 * MS_PER_SECOND8;
65810
+ FIVE_HOURS_MS = FIVE_HOURS2 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
65811
+ WEEK_MS = DAYS_PER_WEEK2 * HOURS_PER_DAY5 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
65656
65812
  AntigravityBucketSchema = external_exports.object({
65657
65813
  bucketId: external_exports.string(),
65658
65814
  remainingFraction: external_exports.number().optional(),
@@ -109940,7 +110096,7 @@ var import_node_os4 = __toESM(require("node:os"), 1);
109940
110096
  var import_node_path21 = __toESM(require("node:path"), 1);
109941
110097
 
109942
110098
  // node_modules/.pnpm/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs
109943
- var import_node_util3 = require("node:util");
110099
+ var import_node_util4 = require("node:util");
109944
110100
  var import_node_process2 = require("node:process");
109945
110101
  var import_node_readline = __toESM(require("node:readline"), 1);
109946
110102
 
@@ -110652,7 +110808,7 @@ var n2 = class extends y {
110652
110808
  if (this.cursor >= t10.length)
110653
110809
  return `${this.userInput}\u2588`;
110654
110810
  const r10 = t10.slice(0, this.cursor), s = t10.slice(this.cursor, this.cursor + 1), e14 = t10.slice(this.cursor + 1);
110655
- return `${r10}${(0, import_node_util3.styleText)("inverse", s)}${e14}`;
110811
+ return `${r10}${(0, import_node_util4.styleText)("inverse", s)}${e14}`;
110656
110812
  }
110657
110813
  get cursor() {
110658
110814
  return this._cursor;
@@ -110670,7 +110826,7 @@ var n2 = class extends y {
110670
110826
  };
110671
110827
 
110672
110828
  // node_modules/.pnpm/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs
110673
- var import_node_util4 = require("node:util");
110829
+ var import_node_util5 = require("node:util");
110674
110830
  var import_node_process3 = __toESM(require("node:process"), 1);
110675
110831
  var import_sisteransi2 = __toESM(require_src(), 1);
110676
110832
  function isUnicodeSupported() {
@@ -110710,33 +110866,33 @@ var symbol2 = (o) => {
110710
110866
  switch (o) {
110711
110867
  case "initial":
110712
110868
  case "active":
110713
- return (0, import_node_util4.styleText)("cyan", S_STEP_ACTIVE);
110869
+ return (0, import_node_util5.styleText)("cyan", S_STEP_ACTIVE);
110714
110870
  case "cancel":
110715
- return (0, import_node_util4.styleText)("red", S_STEP_CANCEL);
110871
+ return (0, import_node_util5.styleText)("red", S_STEP_CANCEL);
110716
110872
  case "error":
110717
- return (0, import_node_util4.styleText)("yellow", S_STEP_ERROR);
110873
+ return (0, import_node_util5.styleText)("yellow", S_STEP_ERROR);
110718
110874
  case "submit":
110719
- return (0, import_node_util4.styleText)("green", S_STEP_SUBMIT);
110875
+ return (0, import_node_util5.styleText)("green", S_STEP_SUBMIT);
110720
110876
  case "validating":
110721
- return (0, import_node_util4.styleText)("dim", S_STEP_ACTIVE);
110877
+ return (0, import_node_util5.styleText)("dim", S_STEP_ACTIVE);
110722
110878
  }
110723
110879
  };
110724
110880
  var symbolBar = (o) => {
110725
110881
  switch (o) {
110726
110882
  case "initial":
110727
110883
  case "active":
110728
- return (0, import_node_util4.styleText)("cyan", S_BAR);
110884
+ return (0, import_node_util5.styleText)("cyan", S_BAR);
110729
110885
  case "cancel":
110730
- return (0, import_node_util4.styleText)("red", S_BAR);
110886
+ return (0, import_node_util5.styleText)("red", S_BAR);
110731
110887
  case "error":
110732
- return (0, import_node_util4.styleText)("yellow", S_BAR);
110888
+ return (0, import_node_util5.styleText)("yellow", S_BAR);
110733
110889
  case "submit":
110734
- return (0, import_node_util4.styleText)("green", S_BAR);
110890
+ return (0, import_node_util5.styleText)("green", S_BAR);
110735
110891
  }
110736
110892
  };
110737
110893
  function formatInstructionFooter(o, e14) {
110738
- const r10 = [`${e14 ? `${(0, import_node_util4.styleText)("cyan", S_BAR)} ` : ""}${o.join(" \u2022 ")}`];
110739
- return e14 && r10.push((0, import_node_util4.styleText)("cyan", S_BAR_END)), r10;
110894
+ const r10 = [`${e14 ? `${(0, import_node_util5.styleText)("cyan", S_BAR)} ` : ""}${o.join(" \u2022 ")}`];
110895
+ return e14 && r10.push((0, import_node_util5.styleText)("cyan", S_BAR_END)), r10;
110740
110896
  }
110741
110897
  var I = (l, e14, w, p, b, C = false) => {
110742
110898
  let r10 = e14, O = 0;
@@ -110761,7 +110917,7 @@ var limitOptions = ({
110761
110917
  columnPadding: C = 0,
110762
110918
  rowPadding: r10 = 4
110763
110919
  }) => {
110764
- const i10 = getColumns(p) - C, m10 = getRows(p), M = (0, import_node_util4.styleText)("dim", "..."), v = Math.max(m10 - r10, 0), a10 = Math.max(Math.min(b, v), 5);
110920
+ const i10 = getColumns(p) - C, m10 = getRows(p), M = (0, import_node_util5.styleText)("dim", "..."), v = Math.max(m10 - r10, 0), a10 = Math.max(Math.min(b, v), 5);
110765
110921
  let f = 0;
110766
110922
  l >= a10 - 3 && (f = Math.max(
110767
110923
  Math.min(l - a10 + 3, e14.length - a10),
@@ -110805,9 +110961,9 @@ var limitOptions = ({
110805
110961
  return c10 && x.push(M), x;
110806
110962
  };
110807
110963
  var MULTISELECT_INSTRUCTIONS = [
110808
- `${(0, import_node_util4.styleText)("dim", "\u2191/\u2193")} to navigate`,
110809
- `${(0, import_node_util4.styleText)("dim", "Space:")} select`,
110810
- `${(0, import_node_util4.styleText)("dim", "Enter:")} confirm`
110964
+ `${(0, import_node_util5.styleText)("dim", "\u2191/\u2193")} to navigate`,
110965
+ `${(0, import_node_util5.styleText)("dim", "Space:")} select`,
110966
+ `${(0, import_node_util5.styleText)("dim", "Enter:")} confirm`
110811
110967
  ];
110812
110968
  var m = (i10, u10) => i10.split(`
110813
110969
  `).map((d) => u10(d)).join(`
@@ -110815,7 +110971,7 @@ var m = (i10, u10) => i10.split(`
110815
110971
  var multiselect = (i10) => {
110816
110972
  const u10 = (t10, a10) => {
110817
110973
  const r10 = t10.label ?? String(t10.value);
110818
- return a10 === "disabled" ? `${(0, import_node_util4.styleText)("gray", S_CHECKBOX_INACTIVE)} ${m(r10, (o) => (0, import_node_util4.styleText)(["strikethrough", "gray"], o))}${t10.hint ? ` ${(0, import_node_util4.styleText)("dim", `(${t10.hint ?? "disabled"})`)}` : ""}` : a10 === "active" ? `${(0, import_node_util4.styleText)("cyan", S_CHECKBOX_ACTIVE)} ${r10}${t10.hint ? ` ${(0, import_node_util4.styleText)("dim", `(${t10.hint})`)}` : ""}` : a10 === "selected" ? `${(0, import_node_util4.styleText)("green", S_CHECKBOX_SELECTED)} ${m(r10, (o) => (0, import_node_util4.styleText)("dim", o))}${t10.hint ? ` ${(0, import_node_util4.styleText)("dim", `(${t10.hint})`)}` : ""}` : a10 === "cancelled" ? `${m(r10, (o) => (0, import_node_util4.styleText)(["strikethrough", "dim"], o))}` : a10 === "active-selected" ? `${(0, import_node_util4.styleText)("green", S_CHECKBOX_SELECTED)} ${r10}${t10.hint ? ` ${(0, import_node_util4.styleText)("dim", `(${t10.hint})`)}` : ""}` : a10 === "submitted" ? `${m(r10, (o) => (0, import_node_util4.styleText)("dim", o))}` : `${(0, import_node_util4.styleText)("dim", S_CHECKBOX_INACTIVE)} ${m(r10, (o) => (0, import_node_util4.styleText)("dim", o))}`;
110974
+ return a10 === "disabled" ? `${(0, import_node_util5.styleText)("gray", S_CHECKBOX_INACTIVE)} ${m(r10, (o) => (0, import_node_util5.styleText)(["strikethrough", "gray"], o))}${t10.hint ? ` ${(0, import_node_util5.styleText)("dim", `(${t10.hint ?? "disabled"})`)}` : ""}` : a10 === "active" ? `${(0, import_node_util5.styleText)("cyan", S_CHECKBOX_ACTIVE)} ${r10}${t10.hint ? ` ${(0, import_node_util5.styleText)("dim", `(${t10.hint})`)}` : ""}` : a10 === "selected" ? `${(0, import_node_util5.styleText)("green", S_CHECKBOX_SELECTED)} ${m(r10, (o) => (0, import_node_util5.styleText)("dim", o))}${t10.hint ? ` ${(0, import_node_util5.styleText)("dim", `(${t10.hint})`)}` : ""}` : a10 === "cancelled" ? `${m(r10, (o) => (0, import_node_util5.styleText)(["strikethrough", "dim"], o))}` : a10 === "active-selected" ? `${(0, import_node_util5.styleText)("green", S_CHECKBOX_SELECTED)} ${r10}${t10.hint ? ` ${(0, import_node_util5.styleText)("dim", `(${t10.hint})`)}` : ""}` : a10 === "submitted" ? `${m(r10, (o) => (0, import_node_util5.styleText)("dim", o))}` : `${(0, import_node_util5.styleText)("dim", S_CHECKBOX_INACTIVE)} ${m(r10, (o) => (0, import_node_util5.styleText)("dim", o))}`;
110819
110975
  }, d = i10.required ?? true, x = i10.showInstructions ?? true;
110820
110976
  return new a({
110821
110977
  options: i10.options,
@@ -110828,13 +110984,13 @@ var multiselect = (i10) => {
110828
110984
  validate(t10) {
110829
110985
  if (d && (t10 === void 0 || t10.length === 0))
110830
110986
  return `Please select at least one option.
110831
- ${(0, import_node_util4.styleText)(
110987
+ ${(0, import_node_util5.styleText)(
110832
110988
  "reset",
110833
- (0, import_node_util4.styleText)(
110989
+ (0, import_node_util5.styleText)(
110834
110990
  "dim",
110835
- `Press ${(0, import_node_util4.styleText)(["gray", "bgWhite", "inverse"], " space ")} to select, ${(0, import_node_util4.styleText)(
110991
+ `Press ${(0, import_node_util5.styleText)(["gray", "bgWhite", "inverse"], " space ")} to select, ${(0, import_node_util5.styleText)(
110836
110992
  "gray",
110837
- (0, import_node_util4.styleText)("bgWhite", (0, import_node_util4.styleText)("inverse", " enter "))
110993
+ (0, import_node_util5.styleText)("bgWhite", (0, import_node_util5.styleText)("inverse", " enter "))
110838
110994
  )} to submit`
110839
110995
  )
110840
110996
  )}`;
@@ -110845,7 +111001,7 @@ ${(0, import_node_util4.styleText)(
110845
111001
  i10.message,
110846
111002
  t10 ? `${symbolBar(this.state)} ` : "",
110847
111003
  `${symbol2(this.state)} `
110848
- ), r10 = `${t10 ? `${(0, import_node_util4.styleText)("gray", S_BAR)}
111004
+ ), r10 = `${t10 ? `${(0, import_node_util5.styleText)("gray", S_BAR)}
110849
111005
  ` : ""}${a10}
110850
111006
  `, o = this.value ?? [], g = (n10, l) => {
110851
111007
  if (n10.disabled)
@@ -110855,29 +111011,29 @@ ${(0, import_node_util4.styleText)(
110855
111011
  };
110856
111012
  switch (this.state) {
110857
111013
  case "submit": {
110858
- const n10 = this.options.filter(({ value: s }) => o.includes(s)).map((s) => u10(s, "submitted")).join((0, import_node_util4.styleText)("dim", ", ")) || (0, import_node_util4.styleText)("dim", "none"), l = wrapTextWithPrefix(
111014
+ const n10 = this.options.filter(({ value: s }) => o.includes(s)).map((s) => u10(s, "submitted")).join((0, import_node_util5.styleText)("dim", ", ")) || (0, import_node_util5.styleText)("dim", "none"), l = wrapTextWithPrefix(
110859
111015
  i10.output,
110860
111016
  n10,
110861
- t10 ? `${(0, import_node_util4.styleText)("gray", S_BAR)} ` : ""
111017
+ t10 ? `${(0, import_node_util5.styleText)("gray", S_BAR)} ` : ""
110862
111018
  );
110863
111019
  return `${r10}${l}`;
110864
111020
  }
110865
111021
  case "cancel": {
110866
- const n10 = this.options.filter(({ value: s }) => o.includes(s)).map((s) => u10(s, "cancelled")).join((0, import_node_util4.styleText)("dim", ", "));
111022
+ const n10 = this.options.filter(({ value: s }) => o.includes(s)).map((s) => u10(s, "cancelled")).join((0, import_node_util5.styleText)("dim", ", "));
110867
111023
  if (n10.trim() === "")
110868
- return `${r10}${(0, import_node_util4.styleText)("gray", S_BAR)}`;
111024
+ return `${r10}${(0, import_node_util5.styleText)("gray", S_BAR)}`;
110869
111025
  const l = wrapTextWithPrefix(
110870
111026
  i10.output,
110871
111027
  n10,
110872
- t10 ? `${(0, import_node_util4.styleText)("gray", S_BAR)} ` : ""
111028
+ t10 ? `${(0, import_node_util5.styleText)("gray", S_BAR)} ` : ""
110873
111029
  );
110874
111030
  return `${r10}${l}${t10 ? `
110875
- ${(0, import_node_util4.styleText)("gray", S_BAR)}` : ""}`;
111031
+ ${(0, import_node_util5.styleText)("gray", S_BAR)}` : ""}`;
110876
111032
  }
110877
111033
  case "error": {
110878
- const n10 = t10 ? `${(0, import_node_util4.styleText)("yellow", S_BAR)} ` : "", l = this.error.split(`
111034
+ const n10 = t10 ? `${(0, import_node_util5.styleText)("yellow", S_BAR)} ` : "", l = this.error.split(`
110879
111035
  `).map(
110880
- ($, v) => v === 0 ? `${t10 ? `${(0, import_node_util4.styleText)("yellow", S_BAR_END)} ` : ""}${(0, import_node_util4.styleText)("yellow", $)}` : ` ${$}`
111036
+ ($, v) => v === 0 ? `${t10 ? `${(0, import_node_util5.styleText)("yellow", S_BAR_END)} ` : ""}${(0, import_node_util5.styleText)("yellow", $)}` : ` ${$}`
110881
111037
  ).join(`
110882
111038
  `), s = r10.split(`
110883
111039
  `).length, h10 = l.split(`
@@ -110896,8 +111052,8 @@ ${l}
110896
111052
  `;
110897
111053
  }
110898
111054
  default: {
110899
- const n10 = t10 ? `${(0, import_node_util4.styleText)("cyan", S_BAR)} ` : "", l = r10.split(`
110900
- `).length, s = x ? formatInstructionFooter(MULTISELECT_INSTRUCTIONS, t10) : t10 ? [(0, import_node_util4.styleText)("cyan", S_BAR_END)] : [], h10 = s.join(`
111055
+ const n10 = t10 ? `${(0, import_node_util5.styleText)("cyan", S_BAR)} ` : "", l = r10.split(`
111056
+ `).length, s = x ? formatInstructionFooter(MULTISELECT_INSTRUCTIONS, t10) : t10 ? [(0, import_node_util5.styleText)("cyan", S_BAR_END)] : [], h10 = s.join(`
110901
111057
  `), $ = s.length + 1;
110902
111058
  return `${r10}${n10}${limitOptions({
110903
111059
  output: i10.output,
@@ -110917,19 +111073,19 @@ ${h10}
110917
111073
  }).prompt();
110918
111074
  };
110919
111075
  var cancel = (o = "", t10) => {
110920
- const i10 = t10?.output ?? process.stdout, e14 = t10?.withGuide ?? settings.withGuide ? `${(0, import_node_util4.styleText)("gray", S_BAR_END)} ` : "";
110921
- i10.write(`${e14}${(0, import_node_util4.styleText)("red", o)}
111076
+ const i10 = t10?.output ?? process.stdout, e14 = t10?.withGuide ?? settings.withGuide ? `${(0, import_node_util5.styleText)("gray", S_BAR_END)} ` : "";
111077
+ i10.write(`${e14}${(0, import_node_util5.styleText)("red", o)}
110922
111078
 
110923
111079
  `);
110924
111080
  };
110925
111081
  var intro = (o = "", t10) => {
110926
- const i10 = t10?.output ?? process.stdout, e14 = t10?.withGuide ?? settings.withGuide ? `${(0, import_node_util4.styleText)("gray", S_BAR_START)} ` : "";
111082
+ const i10 = t10?.output ?? process.stdout, e14 = t10?.withGuide ?? settings.withGuide ? `${(0, import_node_util5.styleText)("gray", S_BAR_START)} ` : "";
110927
111083
  i10.write(`${e14}${o}
110928
111084
  `);
110929
111085
  };
110930
111086
  var outro = (o = "", t10) => {
110931
- const i10 = t10?.output ?? process.stdout, e14 = t10?.withGuide ?? settings.withGuide ? `${(0, import_node_util4.styleText)("gray", S_BAR)}
110932
- ${(0, import_node_util4.styleText)("gray", S_BAR_END)} ` : "";
111087
+ const i10 = t10?.output ?? process.stdout, e14 = t10?.withGuide ?? settings.withGuide ? `${(0, import_node_util5.styleText)("gray", S_BAR)}
111088
+ ${(0, import_node_util5.styleText)("gray", S_BAR_END)} ` : "";
110933
111089
  i10.write(`${e14}${o}
110934
111090
 
110935
111091
  `);
@@ -110940,8 +111096,8 @@ var u2 = {
110940
111096
  block: unicodeOr("\u2588", "#")
110941
111097
  };
110942
111098
  var SELECT_INSTRUCTIONS = [
110943
- `${(0, import_node_util4.styleText)("dim", "\u2191/\u2193")} to navigate`,
110944
- `${(0, import_node_util4.styleText)("dim", "Enter:")} confirm`
111099
+ `${(0, import_node_util5.styleText)("dim", "\u2191/\u2193")} to navigate`,
111100
+ `${(0, import_node_util5.styleText)("dim", "Enter:")} confirm`
110945
111101
  ];
110946
111102
  var c = (t10, o) => t10.includes(`
110947
111103
  `) ? t10.split(`
@@ -110954,15 +111110,15 @@ var select = (t10) => {
110954
111110
  const s = n10.label ?? String(n10.value);
110955
111111
  switch (m10) {
110956
111112
  case "disabled":
110957
- return `${(0, import_node_util4.styleText)("gray", S_RADIO_INACTIVE)} ${c(s, (i10) => (0, import_node_util4.styleText)("gray", i10))}${n10.hint ? ` ${(0, import_node_util4.styleText)("dim", `(${n10.hint ?? "disabled"})`)}` : ""}`;
111113
+ return `${(0, import_node_util5.styleText)("gray", S_RADIO_INACTIVE)} ${c(s, (i10) => (0, import_node_util5.styleText)("gray", i10))}${n10.hint ? ` ${(0, import_node_util5.styleText)("dim", `(${n10.hint ?? "disabled"})`)}` : ""}`;
110958
111114
  case "selected":
110959
- return `${c(s, (i10) => (0, import_node_util4.styleText)("dim", i10))}`;
111115
+ return `${c(s, (i10) => (0, import_node_util5.styleText)("dim", i10))}`;
110960
111116
  case "active":
110961
- return `${(0, import_node_util4.styleText)("green", S_RADIO_ACTIVE)} ${s}${n10.hint ? ` ${(0, import_node_util4.styleText)("dim", `(${n10.hint})`)}` : ""}`;
111117
+ return `${(0, import_node_util5.styleText)("green", S_RADIO_ACTIVE)} ${s}${n10.hint ? ` ${(0, import_node_util5.styleText)("dim", `(${n10.hint})`)}` : ""}`;
110962
111118
  case "cancelled":
110963
- return `${c(s, (i10) => (0, import_node_util4.styleText)(["strikethrough", "dim"], i10))}`;
111119
+ return `${c(s, (i10) => (0, import_node_util5.styleText)(["strikethrough", "dim"], i10))}`;
110964
111120
  default:
110965
- return `${(0, import_node_util4.styleText)("dim", S_RADIO_INACTIVE)} ${c(s, (i10) => (0, import_node_util4.styleText)("dim", i10))}`;
111121
+ return `${(0, import_node_util5.styleText)("dim", S_RADIO_INACTIVE)} ${c(s, (i10) => (0, import_node_util5.styleText)("dim", i10))}`;
110966
111122
  }
110967
111123
  }, d = t10.showInstructions ?? true;
110968
111124
  return new n$1({
@@ -110977,12 +111133,12 @@ var select = (t10) => {
110977
111133
  t10.message,
110978
111134
  s,
110979
111135
  m10
110980
- ), u10 = `${n10 ? `${(0, import_node_util4.styleText)("gray", S_BAR)}
111136
+ ), u10 = `${n10 ? `${(0, import_node_util5.styleText)("gray", S_BAR)}
110981
111137
  ` : ""}${i10}
110982
111138
  `;
110983
111139
  switch (this.state) {
110984
111140
  case "submit": {
110985
- const r10 = n10 ? `${(0, import_node_util4.styleText)("gray", S_BAR)} ` : "", a10 = wrapTextWithPrefix(
111141
+ const r10 = n10 ? `${(0, import_node_util5.styleText)("gray", S_BAR)} ` : "", a10 = wrapTextWithPrefix(
110986
111142
  t10.output,
110987
111143
  o(this.options[this.cursor], "selected"),
110988
111144
  r10
@@ -110990,17 +111146,17 @@ var select = (t10) => {
110990
111146
  return `${u10}${a10}`;
110991
111147
  }
110992
111148
  case "cancel": {
110993
- const r10 = n10 ? `${(0, import_node_util4.styleText)("gray", S_BAR)} ` : "", a10 = wrapTextWithPrefix(
111149
+ const r10 = n10 ? `${(0, import_node_util5.styleText)("gray", S_BAR)} ` : "", a10 = wrapTextWithPrefix(
110994
111150
  t10.output,
110995
111151
  o(this.options[this.cursor], "cancelled"),
110996
111152
  r10
110997
111153
  );
110998
111154
  return `${u10}${a10}${n10 ? `
110999
- ${(0, import_node_util4.styleText)("gray", S_BAR)}` : ""}`;
111155
+ ${(0, import_node_util5.styleText)("gray", S_BAR)}` : ""}`;
111000
111156
  }
111001
111157
  default: {
111002
- const r10 = n10 ? `${(0, import_node_util4.styleText)("cyan", S_BAR)} ` : "", a10 = u10.split(`
111003
- `).length, p = d ? formatInstructionFooter(SELECT_INSTRUCTIONS, n10) : n10 ? [(0, import_node_util4.styleText)("cyan", S_BAR_END)] : [], f = p.join(`
111158
+ const r10 = n10 ? `${(0, import_node_util5.styleText)("cyan", S_BAR)} ` : "", a10 = u10.split(`
111159
+ `).length, p = d ? formatInstructionFooter(SELECT_INSTRUCTIONS, n10) : n10 ? [(0, import_node_util5.styleText)("cyan", S_BAR_END)] : [], f = p.join(`
111004
111160
  `), b = p.length + 1;
111005
111161
  return `${u10}${r10}${limitOptions({
111006
111162
  output: t10.output,
@@ -111019,7 +111175,7 @@ ${f}
111019
111175
  }
111020
111176
  }).prompt();
111021
111177
  };
111022
- var i = `${(0, import_node_util4.styleText)("gray", S_BAR)} `;
111178
+ var i = `${(0, import_node_util5.styleText)("gray", S_BAR)} `;
111023
111179
  var text = (t10) => new n2({
111024
111180
  validate: t10.validate,
111025
111181
  placeholder: t10.placeholder,
@@ -111029,37 +111185,37 @@ var text = (t10) => new n2({
111029
111185
  signal: t10.signal,
111030
111186
  input: t10.input,
111031
111187
  render() {
111032
- const r10 = t10?.withGuide ?? settings.withGuide, l = `${`${r10 ? `${(0, import_node_util4.styleText)("gray", S_BAR)}
111188
+ const r10 = t10?.withGuide ?? settings.withGuide, l = `${`${r10 ? `${(0, import_node_util5.styleText)("gray", S_BAR)}
111033
111189
  ` : ""}${symbol2(this.state)} `}${t10.message}
111034
111190
  `, d = t10.placeholder && t10.placeholder.length > 0 ? (
111035
111191
  // biome-ignore lint/style/noNonNullAssertion: guarded by placeholder.length > 0
111036
- (0, import_node_util4.styleText)("inverse", t10.placeholder[0]) + (0, import_node_util4.styleText)("dim", t10.placeholder.slice(1))
111037
- ) : (0, import_node_util4.styleText)(["inverse", "hidden"], "_"), o = this.userInput ? this.userInputWithCursor : d, s = this.value ?? "";
111192
+ (0, import_node_util5.styleText)("inverse", t10.placeholder[0]) + (0, import_node_util5.styleText)("dim", t10.placeholder.slice(1))
111193
+ ) : (0, import_node_util5.styleText)(["inverse", "hidden"], "_"), o = this.userInput ? this.userInputWithCursor : d, s = this.value ?? "";
111038
111194
  switch (this.state) {
111039
111195
  case "validating": {
111040
- const n10 = r10 ? `${(0, import_node_util4.styleText)("cyan", S_BAR)} ` : "", i10 = r10 ? (0, import_node_util4.styleText)("cyan", S_BAR_END) : "", c10 = (0, import_node_util4.styleText)("dim", o), $ = (0, import_node_util4.styleText)("dim", "Validating...");
111196
+ const n10 = r10 ? `${(0, import_node_util5.styleText)("cyan", S_BAR)} ` : "", i10 = r10 ? (0, import_node_util5.styleText)("cyan", S_BAR_END) : "", c10 = (0, import_node_util5.styleText)("dim", o), $ = (0, import_node_util5.styleText)("dim", "Validating...");
111041
111197
  return `${l}${n10}${c10}
111042
111198
  ${i10} ${$}
111043
111199
  `;
111044
111200
  }
111045
111201
  case "error": {
111046
- const n10 = this.error ? ` ${(0, import_node_util4.styleText)("yellow", this.error)}` : "", i10 = r10 ? `${(0, import_node_util4.styleText)("yellow", S_BAR)} ` : "", c10 = r10 ? (0, import_node_util4.styleText)("yellow", S_BAR_END) : "";
111202
+ const n10 = this.error ? ` ${(0, import_node_util5.styleText)("yellow", this.error)}` : "", i10 = r10 ? `${(0, import_node_util5.styleText)("yellow", S_BAR)} ` : "", c10 = r10 ? (0, import_node_util5.styleText)("yellow", S_BAR_END) : "";
111047
111203
  return `${l.trim()}
111048
111204
  ${i10}${o}
111049
111205
  ${c10}${n10}
111050
111206
  `;
111051
111207
  }
111052
111208
  case "submit": {
111053
- const n10 = s ? `${r10 ? " " : ""}${(0, import_node_util4.styleText)("dim", s)}` : "", i10 = r10 ? (0, import_node_util4.styleText)("gray", S_BAR) : "";
111209
+ const n10 = s ? `${r10 ? " " : ""}${(0, import_node_util5.styleText)("dim", s)}` : "", i10 = r10 ? (0, import_node_util5.styleText)("gray", S_BAR) : "";
111054
111210
  return `${l}${i10}${n10}`;
111055
111211
  }
111056
111212
  case "cancel": {
111057
- const n10 = s ? ` ${(0, import_node_util4.styleText)(["strikethrough", "dim"], s)}` : "", i10 = r10 ? (0, import_node_util4.styleText)("gray", S_BAR) : "";
111213
+ const n10 = s ? ` ${(0, import_node_util5.styleText)(["strikethrough", "dim"], s)}` : "", i10 = r10 ? (0, import_node_util5.styleText)("gray", S_BAR) : "";
111058
111214
  return `${l}${i10}${n10}${s.trim() ? `
111059
111215
  ${i10}` : ""}`;
111060
111216
  }
111061
111217
  default: {
111062
- const n10 = r10 ? `${(0, import_node_util4.styleText)("cyan", S_BAR)} ` : "", i10 = r10 ? (0, import_node_util4.styleText)("cyan", S_BAR_END) : "";
111218
+ const n10 = r10 ? `${(0, import_node_util5.styleText)("cyan", S_BAR)} ` : "", i10 = r10 ? (0, import_node_util5.styleText)("cyan", S_BAR_END) : "";
111063
111219
  return `${l}${n10}${o}
111064
111220
  ${i10}
111065
111221
  `;
@@ -111253,6 +111409,12 @@ function applyProfileChange(paths, name, change) {
111253
111409
  if (change.launchClaudeVersion !== void 0) {
111254
111410
  launchPatch.claudeVersion = change.launchClaudeVersion === false ? void 0 : change.launchClaudeVersion;
111255
111411
  }
111412
+ if (change.launchDelay !== void 0) {
111413
+ launchPatch.delay = change.launchDelay === false ? void 0 : change.launchDelay;
111414
+ }
111415
+ if (change.launchPause !== void 0) {
111416
+ launchPatch.pause = change.launchPause;
111417
+ }
111256
111418
  if (Object.keys(launchPatch).length > 0) {
111257
111419
  setProfileLaunchFlags(paths, name, launchPatch);
111258
111420
  touched = true;
@@ -112539,7 +112701,7 @@ function registerProfileCommand(program2, deps) {
112539
112701
  withExamples(
112540
112702
  profile.command("set <name>").description(
112541
112703
  "Update a configuration profile's categories, entries, extends list, description or launch settings. With no options on a terminal, walks through its categories."
112542
- ).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) => {
112704
+ ).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) => {
112543
112705
  const { json: json2, ...options } = allOptions;
112544
112706
  requireProfileExists(paths, name);
112545
112707
  if (Object.entries(allOptions).every(([key, value2]) => key === "json" || value2 === void 0)) {
@@ -115645,7 +115807,7 @@ var HIGH_BIT = 128;
115645
115807
  var BASE_128_PAYLOAD_MASK = 127;
115646
115808
  var FIRST_ARC_WEIGHT = 40;
115647
115809
  var SHORT_FORM_MAX_LENGTH = 127;
115648
- var MS_PER_SECOND9 = 1e3;
115810
+ var MS_PER_SECOND10 = 1e3;
115649
115811
  var UTC_TIME_LAST_YEAR = 2049;
115650
115812
  var YEAR_DIGITS = 4;
115651
115813
  var TWO_DIGIT_YEAR_DIGITS = 2;
@@ -115704,7 +115866,7 @@ function wholeBitString(content) {
115704
115866
  return tlv(TAG_BIT_STRING, Buffer.concat([Buffer.from([0]), content]));
115705
115867
  }
115706
115868
  function time3(instant) {
115707
- const iso = new Date(Math.floor(instant.getTime() / MS_PER_SECOND9) * MS_PER_SECOND9).toISOString();
115869
+ const iso = new Date(Math.floor(instant.getTime() / MS_PER_SECOND10) * MS_PER_SECOND10).toISOString();
115708
115870
  const compact = `${iso.replace(/[-:T]/g, "").slice(0, COMPACT_TIME_DIGITS)}Z`;
115709
115871
  if (instant.getUTCFullYear() > UTC_TIME_LAST_YEAR) {
115710
115872
  return tlv(TAG_GENERALIZED_TIME, Buffer.from(compact, "ascii"));
@@ -127439,7 +127601,9 @@ var ConfigProfileSetInputSchema = external_exports.strictObject({
127439
127601
  headroom: external_exports.boolean().optional(),
127440
127602
  trackUsage: external_exports.boolean().optional(),
127441
127603
  provider: external_exports.union([external_exports.string().min(1), external_exports.literal(false)]).optional(),
127442
- claudeVersion: external_exports.union([external_exports.string().min(1), external_exports.literal(false)]).optional()
127604
+ claudeVersion: external_exports.union([external_exports.string().min(1), external_exports.literal(false)]).optional(),
127605
+ delay: external_exports.union([external_exports.string().regex(DURATION_RE), external_exports.literal(false)]).optional(),
127606
+ pause: external_exports.boolean().optional()
127443
127607
  }).optional()
127444
127608
  });
127445
127609
  var ConfigProfileSetOutputSchema = storedMutationOutput("profile", "updated", ProfileValueSchema);
@@ -127649,7 +127813,9 @@ function createConfigApiRouter(deps) {
127649
127813
  ...launch?.headroom === void 0 ? {} : { launchHeadroom: launch.headroom },
127650
127814
  ...launch?.trackUsage === void 0 ? {} : { launchTrackUsage: launch.trackUsage },
127651
127815
  ...launch?.provider === void 0 ? {} : { launchProvider: launch.provider },
127652
- ...launch?.claudeVersion === void 0 ? {} : { launchClaudeVersion: launch.claudeVersion }
127816
+ ...launch?.claudeVersion === void 0 ? {} : { launchClaudeVersion: launch.claudeVersion },
127817
+ ...launch?.delay === void 0 ? {} : { launchDelay: launch.delay },
127818
+ ...launch?.pause === void 0 ? {} : { launchPause: launch.pause }
127653
127819
  });
127654
127820
  return { action: "updated", kind: "profile", name: input2.name, value: profileValue(input2.name, paths) };
127655
127821
  })
@@ -127948,7 +128114,10 @@ var LaunchFlagsSchema = external_exports.strictObject({
127948
128114
  skipPermissions: external_exports.boolean(),
127949
128115
  remoteControl: external_exports.boolean(),
127950
128116
  headroom: external_exports.boolean(),
127951
- trackUsage: external_exports.boolean()
128117
+ trackUsage: external_exports.boolean(),
128118
+ pause: external_exports.boolean(),
128119
+ /** How long the launch waits after its own output before it starts claude, in milliseconds. */
128120
+ delayMs: external_exports.number()
127952
128121
  });
127953
128122
  var LaunchResolveOutputSchema = external_exports.strictObject({
127954
128123
  decision: LaunchDecisionSchema,
@@ -129111,17 +129280,17 @@ function unifiedQuotaHeaders(upstream, rejected, quotaError) {
129111
129280
  }
129112
129281
  return headers;
129113
129282
  }
129114
- var MS_PER_SECOND10 = 1e3;
129283
+ var MS_PER_SECOND11 = 1e3;
129115
129284
  function buildUsageSnapshot(upstream, quotaError, nowMs) {
129116
129285
  const used7 = upstream.get("x-codex-primary-used-percent") ?? (quotaError === void 0 ? null : EXHAUSTED_PERCENT);
129117
129286
  const reset7 = upstream.get("x-codex-primary-reset-at") ?? (quotaError?.resets_at === void 0 ? null : String(quotaError.resets_at));
129118
- const sevenDay = used7 !== null && reset7 !== null ? { used_percentage: Number(used7), resets_at: new Date(Number(reset7) * MS_PER_SECOND10).toISOString() } : void 0;
129287
+ const sevenDay = used7 !== null && reset7 !== null ? { used_percentage: Number(used7), resets_at: new Date(Number(reset7) * MS_PER_SECOND11).toISOString() } : void 0;
129119
129288
  let fiveHour;
129120
129289
  if (Number(upstream.get("x-codex-secondary-window-minutes")) > 0) {
129121
129290
  const used5 = upstream.get("x-codex-secondary-used-percent");
129122
129291
  const reset5 = upstream.get("x-codex-secondary-reset-at");
129123
129292
  if (used5 !== null && reset5 !== null) {
129124
- fiveHour = { used_percentage: Number(used5), resets_at: new Date(Number(reset5) * MS_PER_SECOND10).toISOString() };
129293
+ fiveHour = { used_percentage: Number(used5), resets_at: new Date(Number(reset5) * MS_PER_SECOND11).toISOString() };
129125
129294
  }
129126
129295
  }
129127
129296
  if (sevenDay === void 0 && fiveHour === void 0) {
@@ -129911,11 +130080,11 @@ async function* callLocalAntigravity(params) {
129911
130080
 
129912
130081
  // src/antigravity/route.ts
129913
130082
  init_quota();
129914
- var MS_PER_SECOND11 = 1e3;
130083
+ var MS_PER_SECOND12 = 1e3;
129915
130084
  var ROUTING_MEMORY_SESSIONS = 256;
129916
130085
  function exhaustedMessage(exhaustion) {
129917
130086
  const window = exhaustion.window === "five_hour" ? "5-hour" : "weekly";
129918
- return `Antigravity ${window} limit reached; it resets at ${new Date(exhaustion.resetSec * MS_PER_SECOND11).toISOString()}.`;
130087
+ return `Antigravity ${window} limit reached; it resets at ${new Date(exhaustion.resetSec * MS_PER_SECOND12).toISOString()}.`;
129919
130088
  }
129920
130089
  function createAntigravityRoute(ports) {
129921
130090
  const fallbackId = ports.fallbackId ?? (() => (0, import_node_crypto23.randomUUID)());
@@ -130641,7 +130810,7 @@ init_account();
130641
130810
  var RC_SELF_HOST_OAUTH_HOST = "platform.claude.com";
130642
130811
  var RC_SELF_HOST_SCOPE_LIST = ["user:profile", "user:inference", "user:sessions:claude_code", "user:mcp_servers", "user:file_upload"];
130643
130812
  var RC_SELF_HOST_OAUTH_TOKEN_TTL_SECONDS = 3600;
130644
- var MS_PER_SECOND12 = 1e3;
130813
+ var MS_PER_SECOND13 = 1e3;
130645
130814
  var HTTP_SERVICE_UNAVAILABLE = 503;
130646
130815
  function isRecord15(value2) {
130647
130816
  return typeof value2 === "object" && value2 !== null && !Array.isArray(value2);
@@ -130697,7 +130866,7 @@ function createRcSelfHostLocal(deps) {
130697
130866
  }
130698
130867
  if (method === "POST" && pathname.startsWith("/api/eval/")) {
130699
130868
  await deps.readBody(request7, CONTROL_BODY_CAP_BYTES);
130700
- answerServerJson(response, HTTP_STATUS.ok, { features: growthBookFeatures(), dateUpdated: Math.floor(deps.now() / MS_PER_SECOND12) });
130869
+ answerServerJson(response, HTTP_STATUS.ok, { features: growthBookFeatures(), dateUpdated: Math.floor(deps.now() / MS_PER_SECOND13) });
130701
130870
  return true;
130702
130871
  }
130703
130872
  if (method === "GET" && pathname === "/api/oauth/profile") {
@@ -130881,12 +131050,12 @@ function eventExcerpt(text2) {
130881
131050
  return text2.length <= RC_PENDING_SUMMARY_EXCERPT_CHARS ? text2 : `${text2.slice(0, RC_PENDING_SUMMARY_EXCERPT_CHARS)}...`;
130882
131051
  }
130883
131052
  var PERCENT_SCALE = 100;
130884
- var MS_PER_SECOND13 = 1e3;
131053
+ var MS_PER_SECOND14 = 1e3;
130885
131054
  function percentOf(fraction) {
130886
131055
  return `${String(Math.round(fraction * PERCENT_SCALE))}%`;
130887
131056
  }
130888
131057
  function resetInstantOf(epochSeconds) {
130889
- return new Date(epochSeconds * MS_PER_SECOND13).toISOString();
131058
+ return new Date(epochSeconds * MS_PER_SECOND14).toISOString();
130890
131059
  }
130891
131060
  function formatRcRateLimitInfo(info) {
130892
131061
  const parts = [info.status];
@@ -132321,7 +132490,7 @@ var RC_COMPAT_SESSIONS_PATH = "/v1/sessions";
132321
132490
  var RC_SESSION_ID_PREFIX2 = "cse_";
132322
132491
  var RC_SELF_HOST_API_BASE_URL = "https://api.anthropic.com";
132323
132492
  var HTTP_CONFLICT = 409;
132324
- var MS_PER_SECOND14 = 1e3;
132493
+ var MS_PER_SECOND15 = 1e3;
132325
132494
  var HTTP_SERVICE_UNAVAILABLE2 = 503;
132326
132495
  var RC_SELF_HOST_WORKER_JWT_TTL_SECONDS = 46800;
132327
132496
  var RC_SELF_HOST_KEEPALIVE_MS = 15e3;
@@ -132421,7 +132590,7 @@ function parseJsonObject5(body) {
132421
132590
  function mintWorkerJwt(randomToken, issuedAt) {
132422
132591
  const encode3 = (value2) => Buffer.from(JSON.stringify(value2), "utf8").toString("base64url");
132423
132592
  const header = encode3({ alg: "HS256", typ: "JWT" });
132424
- const payload = encode3({ exp: Math.floor((issuedAt + RC_SELF_HOST_WORKER_JWT_TTL_SECONDS * MS_PER_SECOND14) / MS_PER_SECOND14), iat: Math.floor(issuedAt / MS_PER_SECOND14) });
132593
+ 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) });
132425
132594
  return `${header}.${payload}.${Buffer.from(randomToken(), "utf8").toString("base64url")}`;
132426
132595
  }
132427
132596
  function createRcSelfHostSurface(deps) {
@@ -134148,7 +134317,7 @@ var realHeadroomGet = async (target, requestPath, timeoutMs) => {
134148
134317
  // src/statusline/enrich.ts
134149
134318
  init_quota();
134150
134319
  var FULL_PERCENT = 100;
134151
- var MS_PER_SECOND15 = 1e3;
134320
+ var MS_PER_SECOND16 = 1e3;
134152
134321
  function identityOf(env) {
134153
134322
  const headers = env.ANTHROPIC_CUSTOM_HEADERS;
134154
134323
  if (headers !== void 0) {
@@ -134205,7 +134374,7 @@ function payloadWindow(rateLimits, key) {
134205
134374
  const resetsAt = window.resets_at;
134206
134375
  return {
134207
134376
  used: Math.min(FULL_PERCENT, Math.max(0, window.used_percentage)),
134208
- resetAt: typeof resetsAt === "number" && Number.isFinite(resetsAt) ? new Date(resetsAt * MS_PER_SECOND15).toISOString() : void 0
134377
+ resetAt: typeof resetsAt === "number" && Number.isFinite(resetsAt) ? new Date(resetsAt * MS_PER_SECOND16).toISOString() : void 0
134209
134378
  };
134210
134379
  }
134211
134380
  function payloadWindowsOf(payload) {
@@ -134233,7 +134402,7 @@ function antigravityQuotaMapOf(payload) {
134233
134402
  function bucketView(bucket, nowMs) {
134234
134403
  return {
134235
134404
  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,
134236
- resetAt: bucket?.reset_in_seconds === void 0 || !Number.isFinite(bucket.reset_in_seconds) ? void 0 : new Date(nowMs + bucket.reset_in_seconds * MS_PER_SECOND15).toISOString()
134405
+ 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()
134237
134406
  };
134238
134407
  }
134239
134408
  function antigravityWindowsOf(payload, nowMs) {
@@ -134306,7 +134475,7 @@ function enrichStatuslinePayload(params) {
134306
134475
  window.measures,
134307
134476
  {
134308
134477
  remaining_fraction: 1 - window.utilization,
134309
- ...window.resetsAt === void 0 ? {} : { reset_in_seconds: (Date.parse(window.resetsAt) - params.nowMs) / MS_PER_SECOND15 }
134478
+ ...window.resetsAt === void 0 ? {} : { reset_in_seconds: (Date.parse(window.resetsAt) - params.nowMs) / MS_PER_SECOND16 }
134310
134479
  }
134311
134480
  ])
134312
134481
  );
@@ -146753,11 +146922,13 @@ Launching:
146753
146922
  --[no-]skip-permissions, --[no-]remote-control, --[no-]headroom, --[no-]track-usage
146754
146923
  --claude-version <version> run exactly this installed Claude Code version (not the highest)
146755
146924
  --[no-]wait with @pool:<name>, sleep until the earliest member returns when all are refused
146925
+ --delay <duration> wait this long (5s, 500ms) after the launcher's own output before starting claude
146926
+ --[no-]pause wait for a key press after the launcher's own output before starting claude
146756
146927
  --native run the real claude with nothing from agent-shim applied (no other launch flag allowed)
146757
146928
 
146758
146929
  Environment:
146759
146930
  AGENT_SHIM_IDENTITY, AGENT_SHIM_CONFIG_PROFILE, AGENT_SHIM_SKIP_PERMISSIONS,
146760
- AGENT_SHIM_REMOTE_CONTROL, AGENT_SHIM_HEADROOM, AGENT_SHIM_TRACK_USAGE, AGENT_SHIM_ALLOW_AMBIENT_CREDENTIAL,
146931
+ AGENT_SHIM_REMOTE_CONTROL, AGENT_SHIM_HEADROOM, AGENT_SHIM_TRACK_USAGE, AGENT_SHIM_DELAY, AGENT_SHIM_PAUSE, AGENT_SHIM_ALLOW_AMBIENT_CREDENTIAL,
146761
146932
  AGENT_SHIM_CATEGORY_OVERRIDE, AGENT_SHIM_ENTRY_OVERRIDE, AGENT_SHIM_HOME,
146762
146933
  AGENT_SHIM_DEBUG (print stack traces), NO_COLOR. Booleans are true, false, 1 or 0.
146763
146934
 
@@ -147146,6 +147317,7 @@ function resetTerminal() {
147146
147317
  }
147147
147318
 
147148
147319
  // src/supervise/supervise.ts
147320
+ init_hold();
147149
147321
  init_spawn();
147150
147322
  var STOP_GRACE_MS = 5e3;
147151
147323
  function messageOf(error63) {
@@ -147317,6 +147489,10 @@ async function supervise(deps, first) {
147317
147489
  plan.release();
147318
147490
  throw new Error("a supervised launch resolved no identity to supervise");
147319
147491
  }
147492
+ if (!moved && plan.hold() === "cancelled") {
147493
+ plan.release();
147494
+ return LAUNCH_CANCELLED_EXIT;
147495
+ }
147320
147496
  if (!moved) {
147321
147497
  deps.register({ pid: deps.pid, sessionId: plan.sessionId, pool: deps.pool, identity, cwd: deps.cwd, since: new Date(deps.now()).toISOString() });
147322
147498
  }
@@ -147472,6 +147648,8 @@ function otherLaunchFlags(parsed) {
147472
147648
  ...parsed.configProfile === void 0 ? [] : ["--config-profile"],
147473
147649
  ...parsed.provider === void 0 ? [] : [parsed.provider === false ? "--no-provider" : "--provider"],
147474
147650
  ...parsed.claudeVersion === void 0 ? [] : ["--claude-version"],
147651
+ ...parsed.delay === void 0 ? [] : ["--delay"],
147652
+ ...parsed.pause === void 0 ? [] : ["--[no-]pause"],
147475
147653
  ...parsed.headroom === void 0 ? [] : ["--[no-]headroom"],
147476
147654
  ...parsed.trackUsage === void 0 ? [] : ["--[no-]track-usage"],
147477
147655
  ...parsed.skipPermissions === void 0 ? [] : ["--[no-]skip-permissions"],