@integrity-labs/agt-cli 0.28.694 → 0.28.696

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.
Files changed (24) hide show
  1. package/dist/bin/agt.js +5 -5
  2. package/dist/{chunk-YLADZNC5.js → chunk-QCYRC5FK.js} +2 -2
  3. package/dist/{chunk-7F4RC4PU.js → chunk-WB6ERJPU.js} +4 -4
  4. package/dist/{chunk-NYWCE5JH.js → chunk-Y7AHOXHP.js} +255 -80
  5. package/dist/chunk-Y7AHOXHP.js.map +1 -0
  6. package/dist/{claude-pair-runtime-WRVD63Q7.js → claude-pair-runtime-I7MIDQSW.js} +2 -2
  7. package/dist/lib/manager-worker.js +271 -144
  8. package/dist/lib/manager-worker.js.map +1 -1
  9. package/dist/mcp/direct-chat-channel.js +114 -79
  10. package/dist/mcp/index.js +49 -4
  11. package/dist/mcp/origami.js +49 -4
  12. package/dist/mcp/slack-channel.js +114 -79
  13. package/dist/mcp/telegram-channel.js +114 -79
  14. package/dist/{persistent-session-WC27KXJE.js → persistent-session-5ZWDVVIH.js} +3 -3
  15. package/dist/{responsiveness-probe-V5M5OXNB.js → responsiveness-probe-KDQFIROB.js} +3 -3
  16. package/dist/{session-auth-dead-TVTRCTJR.js → session-auth-dead-7S7IQGNX.js} +2 -2
  17. package/package.json +1 -1
  18. package/dist/chunk-NYWCE5JH.js.map +0 -1
  19. /package/dist/{chunk-YLADZNC5.js.map → chunk-QCYRC5FK.js.map} +0 -0
  20. /package/dist/{chunk-7F4RC4PU.js.map → chunk-WB6ERJPU.js.map} +0 -0
  21. /package/dist/{claude-pair-runtime-WRVD63Q7.js.map → claude-pair-runtime-I7MIDQSW.js.map} +0 -0
  22. /package/dist/{persistent-session-WC27KXJE.js.map → persistent-session-5ZWDVVIH.js.map} +0 -0
  23. /package/dist/{responsiveness-probe-V5M5OXNB.js.map → responsiveness-probe-KDQFIROB.js.map} +0 -0
  24. /package/dist/{session-auth-dead-TVTRCTJR.js.map → session-auth-dead-7S7IQGNX.js.map} +0 -0
@@ -34388,6 +34388,111 @@ var CONDITIONAL_DELIVERY_BODY = [
34388
34388
  // ../core/dist/liveness/agent-liveness.js
34389
34389
  var FRESH_HEARTBEAT_THRESHOLD_MS = 2 * 60 * 1e3;
34390
34390
 
34391
+ // ../core/dist/claude-code-usage/reset-time.js
34392
+ var MONTHS = [
34393
+ "jan",
34394
+ "feb",
34395
+ "mar",
34396
+ "apr",
34397
+ "may",
34398
+ "jun",
34399
+ "jul",
34400
+ "aug",
34401
+ "sep",
34402
+ "oct",
34403
+ "nov",
34404
+ "dec"
34405
+ ];
34406
+ var FULL_MONTHS = [
34407
+ "january",
34408
+ "february",
34409
+ "march",
34410
+ "april",
34411
+ "may",
34412
+ "june",
34413
+ "july",
34414
+ "august",
34415
+ "september",
34416
+ "october",
34417
+ "november",
34418
+ "december"
34419
+ ];
34420
+ var MONTH_TOKENS = new Map([
34421
+ ...MONTHS.map((m, i) => [m, i]),
34422
+ ...FULL_MONTHS.map((m, i) => [m, i]),
34423
+ // "Sept" is the one four-letter abbreviation in common use and is inside the
34424
+ // {3,9} the grammar accepts, so it is reachable and must resolve.
34425
+ ["sept", 8]
34426
+ ]);
34427
+ var TIME_OF_DAY_SOURCE = /\d{1,2}(?::\d{2})?\s*(?:am|pm)(?:\s*\(?UTC\)?)?/.source;
34428
+ var RESET_DATE_SOURCE = `(?:[A-Za-z]{3,9}\\s+\\d{1,2}(?:\\s*,\\s*${TIME_OF_DAY_SOURCE})?|${TIME_OF_DAY_SOURCE})`;
34429
+ var TIME_TAIL = /,\s*(\d{1,2})(?::(\d{2}))?\s*(am|pm)(?:\s*\(?UTC\)?)?\s*$/i;
34430
+ var TIME_ONLY = /^(\d{1,2})(?::(\d{2}))?\s*(am|pm)(?:\s*\(?UTC\)?)?$/i;
34431
+ var MS_PER_DAY = 24 * 60 * 60 * 1e3;
34432
+ function parseAmPm(hourStr, minStr, ampm) {
34433
+ const rawHour = Number.parseInt(hourStr, 10);
34434
+ if (!Number.isFinite(rawHour) || rawHour < 1 || rawHour > 12)
34435
+ return null;
34436
+ let minute = 0;
34437
+ if (minStr) {
34438
+ minute = Number.parseInt(minStr, 10);
34439
+ if (!Number.isFinite(minute) || minute < 0 || minute > 59)
34440
+ return null;
34441
+ }
34442
+ const isPm = ampm.toLowerCase() === "pm";
34443
+ return { hour: rawHour % 12 + (isPm ? 12 : 0), minute };
34444
+ }
34445
+ function parseResetDateTime(humanDate, now) {
34446
+ const trimmed = humanDate.trim();
34447
+ const timeOnly = trimmed.match(TIME_ONLY);
34448
+ if (timeOnly) {
34449
+ const hm = parseAmPm(timeOnly[1], timeOnly[2], timeOnly[3]);
34450
+ if (!hm)
34451
+ return null;
34452
+ const todayAt = Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), hm.hour, hm.minute);
34453
+ return {
34454
+ at: new Date(todayAt <= now.getTime() ? todayAt + MS_PER_DAY : todayAt),
34455
+ precision: "hour_only"
34456
+ };
34457
+ }
34458
+ const timeMatch = trimmed.match(TIME_TAIL);
34459
+ const dateOnly = timeMatch ? trimmed.slice(0, timeMatch.index).trim() : trimmed;
34460
+ const parts = dateOnly.split(/\s+/);
34461
+ if (parts.length !== 2)
34462
+ return null;
34463
+ const lookedUpMonth = MONTH_TOKENS.get(parts[0].toLowerCase());
34464
+ if (lookedUpMonth === void 0)
34465
+ return null;
34466
+ const month = lookedUpMonth;
34467
+ const day = Number.parseInt(parts[1], 10);
34468
+ if (!Number.isFinite(day) || day < 1 || day > 31)
34469
+ return null;
34470
+ let hour = 0;
34471
+ let minute = 0;
34472
+ if (timeMatch) {
34473
+ const hm = parseAmPm(timeMatch[1], timeMatch[2], timeMatch[3]);
34474
+ if (!hm)
34475
+ return null;
34476
+ hour = hm.hour;
34477
+ minute = hm.minute;
34478
+ }
34479
+ const baseYear = now.getUTCFullYear();
34480
+ let resolved = null;
34481
+ let bestDelta = Number.POSITIVE_INFINITY;
34482
+ for (const y of [baseYear - 1, baseYear, baseYear + 1]) {
34483
+ const candidate = new Date(Date.UTC(y, month, day, hour, minute));
34484
+ if (candidate.getUTCFullYear() !== y || candidate.getUTCMonth() !== month || candidate.getUTCDate() !== day) {
34485
+ continue;
34486
+ }
34487
+ const delta = Math.abs(candidate.getTime() - now.getTime());
34488
+ if (delta < bestDelta) {
34489
+ bestDelta = delta;
34490
+ resolved = candidate;
34491
+ }
34492
+ }
34493
+ return resolved ? { at: resolved, precision: "dated" } : null;
34494
+ }
34495
+
34391
34496
  // ../core/dist/claude-code-usage/banner-parser.js
34392
34497
  var SESSION_QUALIFIER = /^(?:session|\d{1,2}\s*-?\s*hours?|\d{1,2}h)$/i;
34393
34498
  function classifyLimitScope(qualifier) {
@@ -34402,8 +34507,7 @@ function classifyLimitScope(qualifier) {
34402
34507
  }
34403
34508
  var SEP = /[\s·\-–—]+/.source;
34404
34509
  var SUBJECT = /(?:You(?:['’]ve|\s+have)?\s+)?/.source;
34405
- var TIME_OF_DAY = /\d{1,2}(?::\d{2})?\s*(?:am|pm)(?:\s*\(?UTC\)?)?/.source;
34406
- var RESET_DATE = `(?:[A-Za-z]{3,9}\\s+\\d{1,2}(?:\\s*,\\s*${TIME_OF_DAY})?|${TIME_OF_DAY})`;
34510
+ var RESET_DATE = RESET_DATE_SOURCE;
34407
34511
  var BANNER_PATTERNS = [
34408
34512
  // Percentage form — pct in group 1, reset in group 2.
34409
34513
  new RegExp(`${SUBJECT}used\\s+(\\d{1,3})%\\s+of\\s+your\\s+weekly\\s+limit${SEP}resets\\s+(${RESET_DATE})`, "i"),
@@ -34478,82 +34582,6 @@ function parseUsageBanner(text, now = /* @__PURE__ */ new Date()) {
34478
34582
  }
34479
34583
  return best;
34480
34584
  }
34481
- var MONTHS = [
34482
- "jan",
34483
- "feb",
34484
- "mar",
34485
- "apr",
34486
- "may",
34487
- "jun",
34488
- "jul",
34489
- "aug",
34490
- "sep",
34491
- "oct",
34492
- "nov",
34493
- "dec"
34494
- ];
34495
- var TIME_TAIL = /,\s*(\d{1,2})(?::(\d{2}))?\s*(am|pm)(?:\s*\(?UTC\)?)?\s*$/i;
34496
- var TIME_ONLY = /^(\d{1,2})(?::(\d{2}))?\s*(am|pm)(?:\s*\(?UTC\)?)?$/i;
34497
- var MS_PER_DAY = 24 * 60 * 60 * 1e3;
34498
- function parseAmPm(hourStr, minStr, ampm) {
34499
- const rawHour = Number.parseInt(hourStr, 10);
34500
- if (!Number.isFinite(rawHour) || rawHour < 1 || rawHour > 12)
34501
- return null;
34502
- let minute = 0;
34503
- if (minStr) {
34504
- minute = Number.parseInt(minStr, 10);
34505
- if (!Number.isFinite(minute) || minute < 0 || minute > 59)
34506
- return null;
34507
- }
34508
- const isPm = ampm.toLowerCase() === "pm";
34509
- return { hour: rawHour % 12 + (isPm ? 12 : 0), minute };
34510
- }
34511
- function parseResetDateTime(humanDate, now) {
34512
- const trimmed = humanDate.trim();
34513
- const timeOnly = trimmed.match(TIME_ONLY);
34514
- if (timeOnly) {
34515
- const hm = parseAmPm(timeOnly[1], timeOnly[2], timeOnly[3]);
34516
- if (!hm)
34517
- return null;
34518
- const todayAt = Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), hm.hour, hm.minute);
34519
- return {
34520
- at: new Date(todayAt <= now.getTime() ? todayAt + MS_PER_DAY : todayAt),
34521
- precision: "hour_only"
34522
- };
34523
- }
34524
- const timeMatch = trimmed.match(TIME_TAIL);
34525
- const dateOnly = timeMatch ? trimmed.slice(0, timeMatch.index).trim() : trimmed;
34526
- const parts = dateOnly.split(/\s+/);
34527
- if (parts.length !== 2)
34528
- return null;
34529
- const month = MONTHS.indexOf(parts[0].slice(0, 3).toLowerCase());
34530
- if (month < 0)
34531
- return null;
34532
- const day = Number.parseInt(parts[1], 10);
34533
- if (!Number.isFinite(day) || day < 1 || day > 31)
34534
- return null;
34535
- let hour = 0;
34536
- let minute = 0;
34537
- if (timeMatch) {
34538
- const hm = parseAmPm(timeMatch[1], timeMatch[2], timeMatch[3]);
34539
- if (!hm)
34540
- return null;
34541
- hour = hm.hour;
34542
- minute = hm.minute;
34543
- }
34544
- const baseYear = now.getUTCFullYear();
34545
- let resolved = null;
34546
- let bestDelta = Number.POSITIVE_INFINITY;
34547
- for (const y of [baseYear - 1, baseYear, baseYear + 1]) {
34548
- const candidate = new Date(Date.UTC(y, month, day, hour, minute));
34549
- const delta = Math.abs(candidate.getTime() - now.getTime());
34550
- if (delta < bestDelta) {
34551
- bestDelta = delta;
34552
- resolved = candidate;
34553
- }
34554
- }
34555
- return resolved ? { at: resolved, precision: "dated" } : null;
34556
- }
34557
34585
 
34558
34586
  // ../core/dist/claude-code-usage/run-marker.js
34559
34587
  var RUN_MARKER_RE = /<!--\s*agt-run:([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})\s*-->/;
@@ -34572,6 +34600,13 @@ function buildUsageLimitReplyText(limitedUntil) {
34572
34600
  return `Your agent has hit its Claude Code usage limit until ${formatUtcClock(limitedUntil)}. It'll pick back up once the limit resets \u2014 please try again after then.`;
34573
34601
  }
34574
34602
 
34603
+ // ../core/dist/claude-code-usage/usage-report-parser.js
34604
+ var SEP2 = /[\s·\-–—]+/.source;
34605
+ var WINDOW_LINE = new RegExp(`^\\s*Current\\s+(session|week)(?:\\s*\\(([^)]*)\\))?\\s*:\\s*(\\d{1,3})%\\s+used(?:${SEP2}resets\\s+(${RESET_DATE_SOURCE}))?\\s*$`, "gim");
34606
+
34607
+ // ../core/dist/claude-code-usage/host-usage-reading.js
34608
+ var RESET_JITTER_TOLERANCE_MS = 5 * 60 * 1e3;
34609
+
34575
34610
  // ../core/dist/claude-code-usage/rate-limit-classifier.js
34576
34611
  var UNKNOWN_RATE_LIMIT = Object.freeze({
34577
34612
  verdict: "unknown",
@@ -35925,7 +35960,7 @@ var FLAG_REGISTRY = [
35925
35960
  },
35926
35961
  {
35927
35962
  key: "tool-call-audit",
35928
- description: "Host-side tool-call audit extraction (ENG-8575, slice 3 of ENG-8427): the manager scans agent transcripts for tool calls, redacts each to identity-without-content, and POSTs them to /host/tool-calls. Boolean gate; ships dark \u2014 when off the manager reads no transcripts and sends nothing, so 0 agent_tool_calls rows fleet-wide is the expected steady state until it is armed. NOT the commercial gate: /host/tool-calls independently re-checks the advanced_governance entitlement and refuses regardless of this flag, because the host is customer-owned infrastructure. This flag is rollout control only.",
35963
+ description: "Host-side tool-call audit extraction (ENG-8575, slice 3 of ENG-8427): the manager scans agent transcripts for tool calls, redacts each to identity-without-content, and POSTs them to /host/tool-calls. Boolean gate; when off the manager reads no transcripts and sends nothing. ARMED STAGE-WIDE SINCE 2026-08-17 \u2014 the compiled default below is what a host resolves when nothing else says otherwise, NOT a description of the fleet. This text once asserted the opposite and outlived its truth by nine days, which is what got ENG-9472 filed to arm an already-armed flag. Query the table, do not infer it from this line. NOT the commercial gate: /host/tool-calls independently re-checks the advanced_governance entitlement and refuses regardless of this flag, because the host is customer-owned infrastructure. This flag is rollout control only.",
35929
35964
  flagType: "boolean",
35930
35965
  // Declared safe value is `false` (no extraction). Fail-safe direction: a
35931
35966
  // flag-DB read error must never start shipping tool-call metadata across the
package/dist/mcp/index.js CHANGED
@@ -41732,11 +41732,50 @@ var CONDITIONAL_DELIVERY_BODY = [
41732
41732
  // ../core/dist/liveness/agent-liveness.js
41733
41733
  var FRESH_HEARTBEAT_THRESHOLD_MS = 2 * 60 * 1e3;
41734
41734
 
41735
+ // ../core/dist/claude-code-usage/reset-time.js
41736
+ var MONTHS = [
41737
+ "jan",
41738
+ "feb",
41739
+ "mar",
41740
+ "apr",
41741
+ "may",
41742
+ "jun",
41743
+ "jul",
41744
+ "aug",
41745
+ "sep",
41746
+ "oct",
41747
+ "nov",
41748
+ "dec"
41749
+ ];
41750
+ var FULL_MONTHS = [
41751
+ "january",
41752
+ "february",
41753
+ "march",
41754
+ "april",
41755
+ "may",
41756
+ "june",
41757
+ "july",
41758
+ "august",
41759
+ "september",
41760
+ "october",
41761
+ "november",
41762
+ "december"
41763
+ ];
41764
+ var MONTH_TOKENS = new Map([
41765
+ ...MONTHS.map((m, i) => [m, i]),
41766
+ ...FULL_MONTHS.map((m, i) => [m, i]),
41767
+ // "Sept" is the one four-letter abbreviation in common use and is inside the
41768
+ // {3,9} the grammar accepts, so it is reachable and must resolve.
41769
+ ["sept", 8]
41770
+ ]);
41771
+ var TIME_OF_DAY_SOURCE = /\d{1,2}(?::\d{2})?\s*(?:am|pm)(?:\s*\(?UTC\)?)?/.source;
41772
+ var RESET_DATE_SOURCE = `(?:[A-Za-z]{3,9}\\s+\\d{1,2}(?:\\s*,\\s*${TIME_OF_DAY_SOURCE})?|${TIME_OF_DAY_SOURCE})`;
41773
+ var MS_PER_DAY = 24 * 60 * 60 * 1e3;
41774
+
41735
41775
  // ../core/dist/claude-code-usage/banner-parser.js
41736
41776
  var SEP = /[\s·\-–—]+/.source;
41737
41777
  var SUBJECT = /(?:You(?:['’]ve|\s+have)?\s+)?/.source;
41738
- var TIME_OF_DAY = /\d{1,2}(?::\d{2})?\s*(?:am|pm)(?:\s*\(?UTC\)?)?/.source;
41739
- var RESET_DATE = `(?:[A-Za-z]{3,9}\\s+\\d{1,2}(?:\\s*,\\s*${TIME_OF_DAY})?|${TIME_OF_DAY})`;
41778
+ var RESET_DATE = RESET_DATE_SOURCE;
41740
41779
  var BANNER_PATTERNS = [
41741
41780
  // Percentage form — pct in group 1, reset in group 2.
41742
41781
  new RegExp(`${SUBJECT}used\\s+(\\d{1,3})%\\s+of\\s+your\\s+weekly\\s+limit${SEP}resets\\s+(${RESET_DATE})`, "i"),
@@ -41768,12 +41807,18 @@ var BANNER_PATTERNS = [
41768
41807
  "i"
41769
41808
  )
41770
41809
  ];
41771
- var MS_PER_DAY = 24 * 60 * 60 * 1e3;
41772
41810
 
41773
41811
  // ../core/dist/claude-code-usage/run-marker.js
41774
41812
  var RUN_MARKER_RE = /<!--\s*agt-run:([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})\s*-->/;
41775
41813
  var RUN_MARKER_RE_GLOBAL = new RegExp(RUN_MARKER_RE.source, "g");
41776
41814
 
41815
+ // ../core/dist/claude-code-usage/usage-report-parser.js
41816
+ var SEP2 = /[\s·\-–—]+/.source;
41817
+ var WINDOW_LINE = new RegExp(`^\\s*Current\\s+(session|week)(?:\\s*\\(([^)]*)\\))?\\s*:\\s*(\\d{1,3})%\\s+used(?:${SEP2}resets\\s+(${RESET_DATE_SOURCE}))?\\s*$`, "gim");
41818
+
41819
+ // ../core/dist/claude-code-usage/host-usage-reading.js
41820
+ var RESET_JITTER_TOLERANCE_MS = 5 * 60 * 1e3;
41821
+
41777
41822
  // ../core/dist/claude-code-usage/rate-limit-classifier.js
41778
41823
  var UNKNOWN_RATE_LIMIT = Object.freeze({
41779
41824
  verdict: "unknown",
@@ -42876,7 +42921,7 @@ var FLAG_REGISTRY = [
42876
42921
  },
42877
42922
  {
42878
42923
  key: "tool-call-audit",
42879
- description: "Host-side tool-call audit extraction (ENG-8575, slice 3 of ENG-8427): the manager scans agent transcripts for tool calls, redacts each to identity-without-content, and POSTs them to /host/tool-calls. Boolean gate; ships dark \u2014 when off the manager reads no transcripts and sends nothing, so 0 agent_tool_calls rows fleet-wide is the expected steady state until it is armed. NOT the commercial gate: /host/tool-calls independently re-checks the advanced_governance entitlement and refuses regardless of this flag, because the host is customer-owned infrastructure. This flag is rollout control only.",
42924
+ description: "Host-side tool-call audit extraction (ENG-8575, slice 3 of ENG-8427): the manager scans agent transcripts for tool calls, redacts each to identity-without-content, and POSTs them to /host/tool-calls. Boolean gate; when off the manager reads no transcripts and sends nothing. ARMED STAGE-WIDE SINCE 2026-08-17 \u2014 the compiled default below is what a host resolves when nothing else says otherwise, NOT a description of the fleet. This text once asserted the opposite and outlived its truth by nine days, which is what got ENG-9472 filed to arm an already-armed flag. Query the table, do not infer it from this line. NOT the commercial gate: /host/tool-calls independently re-checks the advanced_governance entitlement and refuses regardless of this flag, because the host is customer-owned infrastructure. This flag is rollout control only.",
42880
42925
  flagType: "boolean",
42881
42926
  // Declared safe value is `false` (no extraction). Fail-safe direction: a
42882
42927
  // flag-DB read error must never start shipping tool-call metadata across the
@@ -40540,11 +40540,50 @@ var CONDITIONAL_DELIVERY_BODY = [
40540
40540
  // ../core/dist/liveness/agent-liveness.js
40541
40541
  var FRESH_HEARTBEAT_THRESHOLD_MS = 2 * 60 * 1e3;
40542
40542
 
40543
+ // ../core/dist/claude-code-usage/reset-time.js
40544
+ var MONTHS = [
40545
+ "jan",
40546
+ "feb",
40547
+ "mar",
40548
+ "apr",
40549
+ "may",
40550
+ "jun",
40551
+ "jul",
40552
+ "aug",
40553
+ "sep",
40554
+ "oct",
40555
+ "nov",
40556
+ "dec"
40557
+ ];
40558
+ var FULL_MONTHS = [
40559
+ "january",
40560
+ "february",
40561
+ "march",
40562
+ "april",
40563
+ "may",
40564
+ "june",
40565
+ "july",
40566
+ "august",
40567
+ "september",
40568
+ "october",
40569
+ "november",
40570
+ "december"
40571
+ ];
40572
+ var MONTH_TOKENS = new Map([
40573
+ ...MONTHS.map((m, i) => [m, i]),
40574
+ ...FULL_MONTHS.map((m, i) => [m, i]),
40575
+ // "Sept" is the one four-letter abbreviation in common use and is inside the
40576
+ // {3,9} the grammar accepts, so it is reachable and must resolve.
40577
+ ["sept", 8]
40578
+ ]);
40579
+ var TIME_OF_DAY_SOURCE = /\d{1,2}(?::\d{2})?\s*(?:am|pm)(?:\s*\(?UTC\)?)?/.source;
40580
+ var RESET_DATE_SOURCE = `(?:[A-Za-z]{3,9}\\s+\\d{1,2}(?:\\s*,\\s*${TIME_OF_DAY_SOURCE})?|${TIME_OF_DAY_SOURCE})`;
40581
+ var MS_PER_DAY = 24 * 60 * 60 * 1e3;
40582
+
40543
40583
  // ../core/dist/claude-code-usage/banner-parser.js
40544
40584
  var SEP = /[\s·\-–—]+/.source;
40545
40585
  var SUBJECT = /(?:You(?:['’]ve|\s+have)?\s+)?/.source;
40546
- var TIME_OF_DAY = /\d{1,2}(?::\d{2})?\s*(?:am|pm)(?:\s*\(?UTC\)?)?/.source;
40547
- var RESET_DATE = `(?:[A-Za-z]{3,9}\\s+\\d{1,2}(?:\\s*,\\s*${TIME_OF_DAY})?|${TIME_OF_DAY})`;
40586
+ var RESET_DATE = RESET_DATE_SOURCE;
40548
40587
  var BANNER_PATTERNS = [
40549
40588
  // Percentage form — pct in group 1, reset in group 2.
40550
40589
  new RegExp(`${SUBJECT}used\\s+(\\d{1,3})%\\s+of\\s+your\\s+weekly\\s+limit${SEP}resets\\s+(${RESET_DATE})`, "i"),
@@ -40576,12 +40615,18 @@ var BANNER_PATTERNS = [
40576
40615
  "i"
40577
40616
  )
40578
40617
  ];
40579
- var MS_PER_DAY = 24 * 60 * 60 * 1e3;
40580
40618
 
40581
40619
  // ../core/dist/claude-code-usage/run-marker.js
40582
40620
  var RUN_MARKER_RE = /<!--\s*agt-run:([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})\s*-->/;
40583
40621
  var RUN_MARKER_RE_GLOBAL = new RegExp(RUN_MARKER_RE.source, "g");
40584
40622
 
40623
+ // ../core/dist/claude-code-usage/usage-report-parser.js
40624
+ var SEP2 = /[\s·\-–—]+/.source;
40625
+ var WINDOW_LINE = new RegExp(`^\\s*Current\\s+(session|week)(?:\\s*\\(([^)]*)\\))?\\s*:\\s*(\\d{1,3})%\\s+used(?:${SEP2}resets\\s+(${RESET_DATE_SOURCE}))?\\s*$`, "gim");
40626
+
40627
+ // ../core/dist/claude-code-usage/host-usage-reading.js
40628
+ var RESET_JITTER_TOLERANCE_MS = 5 * 60 * 1e3;
40629
+
40585
40630
  // ../core/dist/claude-code-usage/rate-limit-classifier.js
40586
40631
  var UNKNOWN_RATE_LIMIT = Object.freeze({
40587
40632
  verdict: "unknown",
@@ -41663,7 +41708,7 @@ var FLAG_REGISTRY = [
41663
41708
  },
41664
41709
  {
41665
41710
  key: "tool-call-audit",
41666
- description: "Host-side tool-call audit extraction (ENG-8575, slice 3 of ENG-8427): the manager scans agent transcripts for tool calls, redacts each to identity-without-content, and POSTs them to /host/tool-calls. Boolean gate; ships dark \u2014 when off the manager reads no transcripts and sends nothing, so 0 agent_tool_calls rows fleet-wide is the expected steady state until it is armed. NOT the commercial gate: /host/tool-calls independently re-checks the advanced_governance entitlement and refuses regardless of this flag, because the host is customer-owned infrastructure. This flag is rollout control only.",
41711
+ description: "Host-side tool-call audit extraction (ENG-8575, slice 3 of ENG-8427): the manager scans agent transcripts for tool calls, redacts each to identity-without-content, and POSTs them to /host/tool-calls. Boolean gate; when off the manager reads no transcripts and sends nothing. ARMED STAGE-WIDE SINCE 2026-08-17 \u2014 the compiled default below is what a host resolves when nothing else says otherwise, NOT a description of the fleet. This text once asserted the opposite and outlived its truth by nine days, which is what got ENG-9472 filed to arm an already-armed flag. Query the table, do not infer it from this line. NOT the commercial gate: /host/tool-calls independently re-checks the advanced_governance entitlement and refuses regardless of this flag, because the host is customer-owned infrastructure. This flag is rollout control only.",
41667
41712
  flagType: "boolean",
41668
41713
  // Declared safe value is `false` (no extraction). Fail-safe direction: a
41669
41714
  // flag-DB read error must never start shipping tool-call metadata across the
@@ -34594,6 +34594,111 @@ var CONDITIONAL_DELIVERY_BODY = [
34594
34594
  // ../core/dist/liveness/agent-liveness.js
34595
34595
  var FRESH_HEARTBEAT_THRESHOLD_MS = 2 * 60 * 1e3;
34596
34596
 
34597
+ // ../core/dist/claude-code-usage/reset-time.js
34598
+ var MONTHS = [
34599
+ "jan",
34600
+ "feb",
34601
+ "mar",
34602
+ "apr",
34603
+ "may",
34604
+ "jun",
34605
+ "jul",
34606
+ "aug",
34607
+ "sep",
34608
+ "oct",
34609
+ "nov",
34610
+ "dec"
34611
+ ];
34612
+ var FULL_MONTHS = [
34613
+ "january",
34614
+ "february",
34615
+ "march",
34616
+ "april",
34617
+ "may",
34618
+ "june",
34619
+ "july",
34620
+ "august",
34621
+ "september",
34622
+ "october",
34623
+ "november",
34624
+ "december"
34625
+ ];
34626
+ var MONTH_TOKENS = new Map([
34627
+ ...MONTHS.map((m, i) => [m, i]),
34628
+ ...FULL_MONTHS.map((m, i) => [m, i]),
34629
+ // "Sept" is the one four-letter abbreviation in common use and is inside the
34630
+ // {3,9} the grammar accepts, so it is reachable and must resolve.
34631
+ ["sept", 8]
34632
+ ]);
34633
+ var TIME_OF_DAY_SOURCE = /\d{1,2}(?::\d{2})?\s*(?:am|pm)(?:\s*\(?UTC\)?)?/.source;
34634
+ var RESET_DATE_SOURCE = `(?:[A-Za-z]{3,9}\\s+\\d{1,2}(?:\\s*,\\s*${TIME_OF_DAY_SOURCE})?|${TIME_OF_DAY_SOURCE})`;
34635
+ var TIME_TAIL = /,\s*(\d{1,2})(?::(\d{2}))?\s*(am|pm)(?:\s*\(?UTC\)?)?\s*$/i;
34636
+ var TIME_ONLY = /^(\d{1,2})(?::(\d{2}))?\s*(am|pm)(?:\s*\(?UTC\)?)?$/i;
34637
+ var MS_PER_DAY = 24 * 60 * 60 * 1e3;
34638
+ function parseAmPm(hourStr, minStr, ampm) {
34639
+ const rawHour = Number.parseInt(hourStr, 10);
34640
+ if (!Number.isFinite(rawHour) || rawHour < 1 || rawHour > 12)
34641
+ return null;
34642
+ let minute = 0;
34643
+ if (minStr) {
34644
+ minute = Number.parseInt(minStr, 10);
34645
+ if (!Number.isFinite(minute) || minute < 0 || minute > 59)
34646
+ return null;
34647
+ }
34648
+ const isPm = ampm.toLowerCase() === "pm";
34649
+ return { hour: rawHour % 12 + (isPm ? 12 : 0), minute };
34650
+ }
34651
+ function parseResetDateTime(humanDate, now) {
34652
+ const trimmed = humanDate.trim();
34653
+ const timeOnly = trimmed.match(TIME_ONLY);
34654
+ if (timeOnly) {
34655
+ const hm = parseAmPm(timeOnly[1], timeOnly[2], timeOnly[3]);
34656
+ if (!hm)
34657
+ return null;
34658
+ const todayAt = Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), hm.hour, hm.minute);
34659
+ return {
34660
+ at: new Date(todayAt <= now.getTime() ? todayAt + MS_PER_DAY : todayAt),
34661
+ precision: "hour_only"
34662
+ };
34663
+ }
34664
+ const timeMatch = trimmed.match(TIME_TAIL);
34665
+ const dateOnly = timeMatch ? trimmed.slice(0, timeMatch.index).trim() : trimmed;
34666
+ const parts = dateOnly.split(/\s+/);
34667
+ if (parts.length !== 2)
34668
+ return null;
34669
+ const lookedUpMonth = MONTH_TOKENS.get(parts[0].toLowerCase());
34670
+ if (lookedUpMonth === void 0)
34671
+ return null;
34672
+ const month = lookedUpMonth;
34673
+ const day = Number.parseInt(parts[1], 10);
34674
+ if (!Number.isFinite(day) || day < 1 || day > 31)
34675
+ return null;
34676
+ let hour = 0;
34677
+ let minute = 0;
34678
+ if (timeMatch) {
34679
+ const hm = parseAmPm(timeMatch[1], timeMatch[2], timeMatch[3]);
34680
+ if (!hm)
34681
+ return null;
34682
+ hour = hm.hour;
34683
+ minute = hm.minute;
34684
+ }
34685
+ const baseYear = now.getUTCFullYear();
34686
+ let resolved = null;
34687
+ let bestDelta = Number.POSITIVE_INFINITY;
34688
+ for (const y of [baseYear - 1, baseYear, baseYear + 1]) {
34689
+ const candidate = new Date(Date.UTC(y, month, day, hour, minute));
34690
+ if (candidate.getUTCFullYear() !== y || candidate.getUTCMonth() !== month || candidate.getUTCDate() !== day) {
34691
+ continue;
34692
+ }
34693
+ const delta = Math.abs(candidate.getTime() - now.getTime());
34694
+ if (delta < bestDelta) {
34695
+ bestDelta = delta;
34696
+ resolved = candidate;
34697
+ }
34698
+ }
34699
+ return resolved ? { at: resolved, precision: "dated" } : null;
34700
+ }
34701
+
34597
34702
  // ../core/dist/claude-code-usage/banner-parser.js
34598
34703
  var SESSION_QUALIFIER = /^(?:session|\d{1,2}\s*-?\s*hours?|\d{1,2}h)$/i;
34599
34704
  function classifyLimitScope(qualifier) {
@@ -34608,8 +34713,7 @@ function classifyLimitScope(qualifier) {
34608
34713
  }
34609
34714
  var SEP = /[\s·\-–—]+/.source;
34610
34715
  var SUBJECT = /(?:You(?:['’]ve|\s+have)?\s+)?/.source;
34611
- var TIME_OF_DAY = /\d{1,2}(?::\d{2})?\s*(?:am|pm)(?:\s*\(?UTC\)?)?/.source;
34612
- var RESET_DATE = `(?:[A-Za-z]{3,9}\\s+\\d{1,2}(?:\\s*,\\s*${TIME_OF_DAY})?|${TIME_OF_DAY})`;
34716
+ var RESET_DATE = RESET_DATE_SOURCE;
34613
34717
  var BANNER_PATTERNS = [
34614
34718
  // Percentage form — pct in group 1, reset in group 2.
34615
34719
  new RegExp(`${SUBJECT}used\\s+(\\d{1,3})%\\s+of\\s+your\\s+weekly\\s+limit${SEP}resets\\s+(${RESET_DATE})`, "i"),
@@ -34684,82 +34788,6 @@ function parseUsageBanner(text, now = /* @__PURE__ */ new Date()) {
34684
34788
  }
34685
34789
  return best;
34686
34790
  }
34687
- var MONTHS = [
34688
- "jan",
34689
- "feb",
34690
- "mar",
34691
- "apr",
34692
- "may",
34693
- "jun",
34694
- "jul",
34695
- "aug",
34696
- "sep",
34697
- "oct",
34698
- "nov",
34699
- "dec"
34700
- ];
34701
- var TIME_TAIL = /,\s*(\d{1,2})(?::(\d{2}))?\s*(am|pm)(?:\s*\(?UTC\)?)?\s*$/i;
34702
- var TIME_ONLY = /^(\d{1,2})(?::(\d{2}))?\s*(am|pm)(?:\s*\(?UTC\)?)?$/i;
34703
- var MS_PER_DAY = 24 * 60 * 60 * 1e3;
34704
- function parseAmPm(hourStr, minStr, ampm) {
34705
- const rawHour = Number.parseInt(hourStr, 10);
34706
- if (!Number.isFinite(rawHour) || rawHour < 1 || rawHour > 12)
34707
- return null;
34708
- let minute = 0;
34709
- if (minStr) {
34710
- minute = Number.parseInt(minStr, 10);
34711
- if (!Number.isFinite(minute) || minute < 0 || minute > 59)
34712
- return null;
34713
- }
34714
- const isPm = ampm.toLowerCase() === "pm";
34715
- return { hour: rawHour % 12 + (isPm ? 12 : 0), minute };
34716
- }
34717
- function parseResetDateTime(humanDate, now) {
34718
- const trimmed = humanDate.trim();
34719
- const timeOnly = trimmed.match(TIME_ONLY);
34720
- if (timeOnly) {
34721
- const hm = parseAmPm(timeOnly[1], timeOnly[2], timeOnly[3]);
34722
- if (!hm)
34723
- return null;
34724
- const todayAt = Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), hm.hour, hm.minute);
34725
- return {
34726
- at: new Date(todayAt <= now.getTime() ? todayAt + MS_PER_DAY : todayAt),
34727
- precision: "hour_only"
34728
- };
34729
- }
34730
- const timeMatch = trimmed.match(TIME_TAIL);
34731
- const dateOnly = timeMatch ? trimmed.slice(0, timeMatch.index).trim() : trimmed;
34732
- const parts = dateOnly.split(/\s+/);
34733
- if (parts.length !== 2)
34734
- return null;
34735
- const month = MONTHS.indexOf(parts[0].slice(0, 3).toLowerCase());
34736
- if (month < 0)
34737
- return null;
34738
- const day = Number.parseInt(parts[1], 10);
34739
- if (!Number.isFinite(day) || day < 1 || day > 31)
34740
- return null;
34741
- let hour = 0;
34742
- let minute = 0;
34743
- if (timeMatch) {
34744
- const hm = parseAmPm(timeMatch[1], timeMatch[2], timeMatch[3]);
34745
- if (!hm)
34746
- return null;
34747
- hour = hm.hour;
34748
- minute = hm.minute;
34749
- }
34750
- const baseYear = now.getUTCFullYear();
34751
- let resolved = null;
34752
- let bestDelta = Number.POSITIVE_INFINITY;
34753
- for (const y of [baseYear - 1, baseYear, baseYear + 1]) {
34754
- const candidate = new Date(Date.UTC(y, month, day, hour, minute));
34755
- const delta = Math.abs(candidate.getTime() - now.getTime());
34756
- if (delta < bestDelta) {
34757
- bestDelta = delta;
34758
- resolved = candidate;
34759
- }
34760
- }
34761
- return resolved ? { at: resolved, precision: "dated" } : null;
34762
- }
34763
34791
 
34764
34792
  // ../core/dist/claude-code-usage/run-marker.js
34765
34793
  var RUN_MARKER_RE = /<!--\s*agt-run:([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})\s*-->/;
@@ -34778,6 +34806,13 @@ function buildUsageLimitReplyText(limitedUntil) {
34778
34806
  return `Your agent has hit its Claude Code usage limit until ${formatUtcClock(limitedUntil)}. It'll pick back up once the limit resets \u2014 please try again after then.`;
34779
34807
  }
34780
34808
 
34809
+ // ../core/dist/claude-code-usage/usage-report-parser.js
34810
+ var SEP2 = /[\s·\-–—]+/.source;
34811
+ var WINDOW_LINE = new RegExp(`^\\s*Current\\s+(session|week)(?:\\s*\\(([^)]*)\\))?\\s*:\\s*(\\d{1,3})%\\s+used(?:${SEP2}resets\\s+(${RESET_DATE_SOURCE}))?\\s*$`, "gim");
34812
+
34813
+ // ../core/dist/claude-code-usage/host-usage-reading.js
34814
+ var RESET_JITTER_TOLERANCE_MS = 5 * 60 * 1e3;
34815
+
34781
34816
  // ../core/dist/claude-code-usage/rate-limit-classifier.js
34782
34817
  var UNKNOWN_RATE_LIMIT = Object.freeze({
34783
34818
  verdict: "unknown",
@@ -36134,7 +36169,7 @@ var FLAG_REGISTRY = [
36134
36169
  },
36135
36170
  {
36136
36171
  key: "tool-call-audit",
36137
- description: "Host-side tool-call audit extraction (ENG-8575, slice 3 of ENG-8427): the manager scans agent transcripts for tool calls, redacts each to identity-without-content, and POSTs them to /host/tool-calls. Boolean gate; ships dark \u2014 when off the manager reads no transcripts and sends nothing, so 0 agent_tool_calls rows fleet-wide is the expected steady state until it is armed. NOT the commercial gate: /host/tool-calls independently re-checks the advanced_governance entitlement and refuses regardless of this flag, because the host is customer-owned infrastructure. This flag is rollout control only.",
36172
+ description: "Host-side tool-call audit extraction (ENG-8575, slice 3 of ENG-8427): the manager scans agent transcripts for tool calls, redacts each to identity-without-content, and POSTs them to /host/tool-calls. Boolean gate; when off the manager reads no transcripts and sends nothing. ARMED STAGE-WIDE SINCE 2026-08-17 \u2014 the compiled default below is what a host resolves when nothing else says otherwise, NOT a description of the fleet. This text once asserted the opposite and outlived its truth by nine days, which is what got ENG-9472 filed to arm an already-armed flag. Query the table, do not infer it from this line. NOT the commercial gate: /host/tool-calls independently re-checks the advanced_governance entitlement and refuses regardless of this flag, because the host is customer-owned infrastructure. This flag is rollout control only.",
36138
36173
  flagType: "boolean",
36139
36174
  // Declared safe value is `false` (no extraction). Fail-safe direction: a
36140
36175
  // flag-DB read error must never start shipping tool-call metadata across the