@integrity-labs/agt-cli 0.28.612 → 0.28.614

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/bin/agt.js CHANGED
@@ -40,10 +40,10 @@ import {
40
40
  success,
41
41
  table,
42
42
  warn
43
- } from "../chunk-F2WTBHMD.js";
43
+ } from "../chunk-IDWOHBI3.js";
44
44
  import {
45
45
  readDirectChatSessionState
46
- } from "../chunk-DJP4JZGE.js";
46
+ } from "../chunk-6SJJM4FT.js";
47
47
  import {
48
48
  AnchorSessionClient,
49
49
  CHANNEL_REGISTRY,
@@ -73,7 +73,7 @@ import {
73
73
  requiredMcpWildcard,
74
74
  resolveChannels,
75
75
  serializeManifestForSlackCli
76
- } from "../chunk-RQAAW5LL.js";
76
+ } from "../chunk-TYVQNCBU.js";
77
77
  import "../chunk-XWVM4KPK.js";
78
78
 
79
79
  // src/bin/agt.ts
@@ -4909,7 +4909,7 @@ import { execFileSync, execSync } from "child_process";
4909
4909
  import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
4910
4910
  import chalk18 from "chalk";
4911
4911
  import ora16 from "ora";
4912
- var cliVersion = true ? "0.28.612" : "dev";
4912
+ var cliVersion = true ? "0.28.614" : "dev";
4913
4913
  async function fetchLatestVersion() {
4914
4914
  const host2 = getHost();
4915
4915
  if (!host2) return null;
@@ -6089,7 +6089,7 @@ function handleError(err) {
6089
6089
  }
6090
6090
 
6091
6091
  // src/bin/agt.ts
6092
- var cliVersion2 = true ? "0.28.612" : "dev";
6092
+ var cliVersion2 = true ? "0.28.614" : "dev";
6093
6093
  var program = new Command();
6094
6094
  program.name("agt").description("Augmented CLI \u2014 agent provisioning and management").version(cliVersion2).option("--json", "Emit machine-readable JSON output (suppress spinners and colors)").option("--skip-update-check", "Skip the automatic update check on startup");
6095
6095
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -16,7 +16,7 @@ import {
16
16
  rotateDailySession,
17
17
  sessionFileExists,
18
18
  todayLocalIso
19
- } from "./chunk-RQAAW5LL.js";
19
+ } from "./chunk-TYVQNCBU.js";
20
20
  import {
21
21
  reapOrphanChannelMcps
22
22
  } from "./chunk-XWVM4KPK.js";
@@ -4349,4 +4349,4 @@ export {
4349
4349
  stopAllSessionsAndWait,
4350
4350
  getProjectDir
4351
4351
  };
4352
- //# sourceMappingURL=chunk-DJP4JZGE.js.map
4352
+ //# sourceMappingURL=chunk-6SJJM4FT.js.map
@@ -7,7 +7,7 @@ import {
7
7
  expandTemplateVars,
8
8
  isolationMode,
9
9
  parseEnvIntegrations
10
- } from "./chunk-DJP4JZGE.js";
10
+ } from "./chunk-6SJJM4FT.js";
11
11
  import {
12
12
  BIND_FAILURE_QUARANTINE_THRESHOLD,
13
13
  INTEGRATIONS_SECTION_END,
@@ -48,7 +48,7 @@ import {
48
48
  resolveConnectivityProbe,
49
49
  worseConnectivityOutcome,
50
50
  wrapScheduledTaskPrompt
51
- } from "./chunk-RQAAW5LL.js";
51
+ } from "./chunk-TYVQNCBU.js";
52
52
  import {
53
53
  parsePsRows
54
54
  } from "./chunk-XWVM4KPK.js";
@@ -6030,7 +6030,7 @@ function exchangeFailureKind(err) {
6030
6030
  }
6031
6031
 
6032
6032
  // src/lib/api-client.ts
6033
- var agtCliVersion = true ? "0.28.612" : "dev";
6033
+ var agtCliVersion = true ? "0.28.614" : "dev";
6034
6034
  var lastConfigHash = null;
6035
6035
  function setConfigHash(hash) {
6036
6036
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -9505,4 +9505,4 @@ export {
9505
9505
  managerInstallSystemUnitCommand,
9506
9506
  managerUninstallSystemUnitCommand
9507
9507
  };
9508
- //# sourceMappingURL=chunk-F2WTBHMD.js.map
9508
+ //# sourceMappingURL=chunk-IDWOHBI3.js.map
@@ -3638,7 +3638,14 @@ var AGENT_DIRECTED_NOTICE_KINDS = [
3638
3638
  // written for the machine. The user learns the same fact from the connect card
3639
3639
  // in that conversation flipping to its connected state, so showing this row as
3640
3640
  // well would say it twice, the second time in prose aimed at an agent.
3641
- "integration_connected"
3641
+ "integration_connected",
3642
+ // ENG-8745. The offer RESULT receipt (not the offer card — that one is
3643
+ // written for the human and is how they decided). Its content opens "Your
3644
+ // offer was ACCEPTED", carries an `[offer_result]` machine tag, and closes by
3645
+ // instructing the agent what not to do ("do not re-raise it yourself"). The
3646
+ // human needs none of it: they are the person who tapped the button, and the
3647
+ // card swapped under their finger to say so.
3648
+ "offer_result"
3642
3649
  ];
3643
3650
  var AGENT_DIRECTED_KIND_SET = new Set(AGENT_DIRECTED_NOTICE_KINDS);
3644
3651
 
@@ -10615,6 +10622,17 @@ var SCHEDULED_TURN_MARKER_FILENAME = ".current-scheduled-turn.json";
10615
10622
  var FRESH_HEARTBEAT_THRESHOLD_MS = 2 * 60 * 1e3;
10616
10623
 
10617
10624
  // ../../packages/core/dist/claude-code-usage/banner-parser.js
10625
+ var SESSION_QUALIFIER = /^(?:session|\d{1,2}\s*-?\s*hours?|\d{1,2}h)$/i;
10626
+ function classifyLimitScope(qualifier) {
10627
+ const q = (qualifier ?? "").trim();
10628
+ if (!q)
10629
+ return "weekly";
10630
+ if (SESSION_QUALIFIER.test(q))
10631
+ return "session";
10632
+ if (/^weekly$/i.test(q))
10633
+ return "weekly";
10634
+ return "unknown";
10635
+ }
10618
10636
  var SEP = /[\s·\-–—]+/.source;
10619
10637
  var SUBJECT = /(?:You(?:['’]ve|\s+have)?\s+)?/.source;
10620
10638
  var TIME_OF_DAY = /\d{1,2}(?::\d{2})?\s*(?:am|pm)(?:\s*\(?UTC\)?)?/.source;
@@ -10628,7 +10646,27 @@ var BANNER_PATTERNS = [
10628
10646
  // Wrapped to keep the per-pattern shape consistent with the percentage form:
10629
10647
  // the parser checks group 1 for a digit string and treats a missing one as
10630
10648
  // pct=100.
10631
- new RegExp(`${SUBJECT}hit\\s+your\\s+(?:[a-z0-9-]+\\s+)?limit${SEP}resets\\s+(${RESET_DATE})`, "i")
10649
+ // ENG-9007: the qualifier is CAPTURED now, by name. It used to be
10650
+ // `(?:[a-z0-9-]+\s+)?` - permissive and non-capturing - so the parser
10651
+ // recognised "session" and "5-hour", matched on them, and threw the word away.
10652
+ // Named groups keep the numbered capture indices stable for the percentage
10653
+ // form above, which still reads groups 1 and 2 positionally.
10654
+ new RegExp(
10655
+ // CodeRabbit on #4621: the qualifier was ONE token, so `classifyLimitScope`
10656
+ // accepted "5 hours" while this pattern could never deliver it — the whole
10657
+ // banner failed to match, no observation was recorded, and the agent went
10658
+ // dark rather than merely being misclassified. Multi-token qualifiers now
10659
+ // match the duration shapes SESSION_QUALIFIER already accepts.
10660
+ //
10661
+ // Deliberately NOT the naive `[a-z0-9]+(?:\s*-?\s*[a-z0-9]+)*`: the
10662
+ // separator there can match empty, which reduces to `(a+)+` and backtracks
10663
+ // catastrophically on a long alphanumeric run that is never followed by
10664
+ // "limit". This parser runs over agent-produced pane.log tails, so that is
10665
+ // reachable input. Requiring at least one separator per extra token, and
10666
+ // bounding the count, keeps it linear.
10667
+ `${SUBJECT}hit\\s+your\\s+(?<qualifier>[a-z0-9]+(?:[\\s-]+[a-z0-9]+){0,3}\\s+)?limit${SEP}resets\\s+(?<reset>${RESET_DATE})`,
10668
+ "i"
10669
+ )
10632
10670
  ];
10633
10671
  function parseUsageBanner(text, now = /* @__PURE__ */ new Date()) {
10634
10672
  let bestIndex = -1;
@@ -10641,24 +10679,33 @@ function parseUsageBanner(text, now = /* @__PURE__ */ new Date()) {
10641
10679
  pattern.lastIndex++;
10642
10680
  let pct;
10643
10681
  let resetStr;
10682
+ let qualifier;
10644
10683
  if (i === 0) {
10645
10684
  pct = Number.parseInt(match[1], 10);
10646
10685
  resetStr = match[2];
10686
+ qualifier = "weekly";
10647
10687
  } else {
10648
10688
  pct = 100;
10649
- resetStr = match[1];
10689
+ resetStr = match.groups?.["reset"] ?? "";
10690
+ qualifier = match.groups?.["qualifier"]?.trim() || null;
10650
10691
  }
10651
10692
  if (!Number.isFinite(pct) || pct < 0 || pct > 100)
10652
10693
  continue;
10653
10694
  const nextChar = text[match.index + match[0].length];
10654
10695
  if (nextChar !== void 0 && /[A-Za-z0-9]/.test(nextChar))
10655
10696
  continue;
10656
- const weekResetsAt = parseResetDateTime(resetStr, now);
10657
- if (!weekResetsAt)
10697
+ const reset = parseResetDateTime(resetStr, now);
10698
+ if (!reset)
10658
10699
  continue;
10659
10700
  if (match.index >= bestIndex) {
10660
10701
  bestIndex = match.index;
10661
- best = { pct, weekResetsAt };
10702
+ best = {
10703
+ pct,
10704
+ weekResetsAt: reset.at,
10705
+ resetPrecision: reset.precision,
10706
+ limitScope: classifyLimitScope(qualifier),
10707
+ limitQualifier: qualifier
10708
+ };
10662
10709
  }
10663
10710
  }
10664
10711
  }
@@ -10702,7 +10749,10 @@ function parseResetDateTime(humanDate, now) {
10702
10749
  if (!hm)
10703
10750
  return null;
10704
10751
  const todayAt = Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), hm.hour, hm.minute);
10705
- return new Date(todayAt <= now.getTime() ? todayAt + MS_PER_DAY : todayAt);
10752
+ return {
10753
+ at: new Date(todayAt <= now.getTime() ? todayAt + MS_PER_DAY : todayAt),
10754
+ precision: "hour_only"
10755
+ };
10706
10756
  }
10707
10757
  const timeMatch = trimmed.match(TIME_TAIL);
10708
10758
  const dateOnly = timeMatch ? trimmed.slice(0, timeMatch.index).trim() : trimmed;
@@ -10735,7 +10785,7 @@ function parseResetDateTime(humanDate, now) {
10735
10785
  resolved = candidate;
10736
10786
  }
10737
10787
  }
10738
- return resolved;
10788
+ return resolved ? { at: resolved, precision: "dated" } : null;
10739
10789
  }
10740
10790
 
10741
10791
  // ../../packages/core/dist/claude-code-usage/transcript-parser.js
@@ -11957,4 +12007,4 @@ export {
11957
12007
  minutesSinceLocalMidnight,
11958
12008
  peekCurrentSession
11959
12009
  };
11960
- //# sourceMappingURL=chunk-RQAAW5LL.js.map
12010
+ //# sourceMappingURL=chunk-TYVQNCBU.js.map