@integrity-labs/agt-cli 0.28.345 → 0.28.347

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.
@@ -100,7 +100,7 @@ async function spawnPairSession(session) {
100
100
  return { ok: true };
101
101
  } catch {
102
102
  }
103
- const { resolveClaudeBinary } = await import("./persistent-session-6ADHOTEG.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-G22EFMQM.js");
104
104
  const claudeBin = resolveClaudeBinary();
105
105
  const pairEnv = {
106
106
  ...process.env,
@@ -373,4 +373,4 @@ export {
373
373
  startClaudePair,
374
374
  submitClaudePairCode
375
375
  };
376
- //# sourceMappingURL=claude-pair-runtime-2ZQZVFKF.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-LGKYHBI2.js.map
@@ -46,7 +46,7 @@ import {
46
46
  resolveEffectivePinRaw,
47
47
  safeWriteJsonAtomic,
48
48
  setConfigHash
49
- } from "../chunk-GJ5TGARW.js";
49
+ } from "../chunk-CD3HY46A.js";
50
50
  import {
51
51
  getProjectDir as getProjectDir2,
52
52
  getReadyTasks,
@@ -137,7 +137,7 @@ import {
137
137
  takeZombieDetection,
138
138
  transcriptActivityAgeSeconds,
139
139
  writeEgressAllowlist
140
- } from "../chunk-O5IINJDB.js";
140
+ } from "../chunk-ZGY4ADGS.js";
141
141
  import {
142
142
  reapOrphanChannelMcps
143
143
  } from "../chunk-XWVM4KPK.js";
@@ -1866,18 +1866,37 @@ import { mkdirSync as mkdirSync4, rmSync as rmSync2, writeFileSync as writeFileS
1866
1866
  import { homedir as homedir3 } from "os";
1867
1867
  import { join as join5 } from "path";
1868
1868
  function syncUsageLimitMarker(args) {
1869
+ if (args.pct < 100) {
1870
+ clearUsageLimitMarker(args.codeName, args.log);
1871
+ return;
1872
+ }
1869
1873
  const path = join5(homedir3(), ".augmented", args.codeName, USAGE_LIMIT_MARKER_FILENAME);
1870
1874
  try {
1871
- if (args.pct >= 100) {
1872
- mkdirSync4(join5(homedir3(), ".augmented", args.codeName), { recursive: true });
1873
- writeFileSync4(path, serializeUsageLimitMarker(args.weekResetsAt), "utf-8");
1874
- } else {
1875
- rmSync2(path, { force: true });
1876
- }
1875
+ mkdirSync4(join5(homedir3(), ".augmented", args.codeName), { recursive: true });
1876
+ writeFileSync4(path, serializeUsageLimitMarker(args.weekResetsAt), "utf-8");
1877
1877
  } catch (err) {
1878
1878
  args.log(`[usage-banner] usage-limit marker sync failed for '${args.codeName}': ${err.message}`);
1879
1879
  }
1880
1880
  }
1881
+ function clearUsageLimitMarker(codeName, log2) {
1882
+ const path = join5(homedir3(), ".augmented", codeName, USAGE_LIMIT_MARKER_FILENAME);
1883
+ try {
1884
+ rmSync2(path, { force: true });
1885
+ } catch (err) {
1886
+ log2(`[usage-banner] usage-limit marker clear failed for '${codeName}': ${err.message}`);
1887
+ }
1888
+ }
1889
+ var SPAWN_MARKER = /--- spawn \S+ \(session [^)]*\) ---/g;
1890
+ function scopeToCurrentPaneEpoch(tail) {
1891
+ SPAWN_MARKER.lastIndex = 0;
1892
+ let lastIndex = -1;
1893
+ let match;
1894
+ while ((match = SPAWN_MARKER.exec(tail)) !== null) {
1895
+ lastIndex = match.index;
1896
+ }
1897
+ if (lastIndex < 0) return { epochText: tail, sawSpawnMarker: false };
1898
+ return { epochText: tail.slice(lastIndex), sawSpawnMarker: true };
1899
+ }
1881
1900
  var MIN_CHECK_INTERVAL_MS = 6e4;
1882
1901
  var PANE_TAIL_LINES_FOR_BANNER = 5e3;
1883
1902
  var state = /* @__PURE__ */ new Map();
@@ -1905,8 +1924,12 @@ async function maybeReportUsageBanner(args) {
1905
1924
  state.set(codeName, next);
1906
1925
  return;
1907
1926
  }
1908
- const observation = parseUsageBanner(tail, now);
1927
+ const { epochText, sawSpawnMarker } = scopeToCurrentPaneEpoch(tail);
1928
+ const observation = parseUsageBanner(epochText, now);
1909
1929
  if (!observation) {
1930
+ if (sawSpawnMarker) {
1931
+ clearUsageLimitMarker(codeName, log2);
1932
+ }
1910
1933
  state.set(codeName, next);
1911
1934
  return;
1912
1935
  }
@@ -9280,7 +9303,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
9280
9303
  var lastVersionCheckAt = 0;
9281
9304
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
9282
9305
  var lastResponsivenessProbeAt = 0;
9283
- var agtCliVersion = true ? "0.28.345" : "dev";
9306
+ var agtCliVersion = true ? "0.28.347" : "dev";
9284
9307
  function resolveBrewPath(execFileSync2) {
9285
9308
  try {
9286
9309
  const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -10245,7 +10268,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
10245
10268
  if (codeNames.length === 0) return;
10246
10269
  void (async () => {
10247
10270
  try {
10248
- const { collectDiagnostics } = await import("../persistent-session-6ADHOTEG.js");
10271
+ const { collectDiagnostics } = await import("../persistent-session-G22EFMQM.js");
10249
10272
  await api.post("/host/heartbeat", {
10250
10273
  host_id: hostId,
10251
10274
  agent_diagnostics: collectDiagnostics(codeNames)
@@ -10344,7 +10367,7 @@ async function pollCycle() {
10344
10367
  }
10345
10368
  try {
10346
10369
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
10347
- const { collectDiagnostics } = await import("../persistent-session-6ADHOTEG.js");
10370
+ const { collectDiagnostics } = await import("../persistent-session-G22EFMQM.js");
10348
10371
  const diagCodeNames = [...agentState.persistentSessionAgents];
10349
10372
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames) : void 0;
10350
10373
  let tailscaleHostname;
@@ -10499,7 +10522,7 @@ async function pollCycle() {
10499
10522
  const {
10500
10523
  collectResponsivenessProbes,
10501
10524
  getResponsivenessIntervalMs
10502
- } = await import("../responsiveness-probe-UYVXWW5D.js");
10525
+ } = await import("../responsiveness-probe-HXZFFAGD.js");
10503
10526
  const probeIntervalMs = getResponsivenessIntervalMs();
10504
10527
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
10505
10528
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -10531,7 +10554,7 @@ async function pollCycle() {
10531
10554
  collectResponsivenessProbes,
10532
10555
  livePendingInboundOldestAgeSeconds,
10533
10556
  parkPendingInbound
10534
- } = await import("../responsiveness-probe-UYVXWW5D.js");
10557
+ } = await import("../responsiveness-probe-HXZFFAGD.js");
10535
10558
  const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-HYOOQV4A.js");
10536
10559
  const wedgeNow = /* @__PURE__ */ new Date();
10537
10560
  const liveAgents = agentState.persistentSessionAgents;
@@ -11435,7 +11458,7 @@ async function processAgent(agent, agentStates) {
11435
11458
  const primaryModel2 = resolvedModelsForRegistration.primary ?? refreshData.agent.primary_model;
11436
11459
  const registeredAgents = await getOrCacheRegisteredAgents(frameworkAdapter, agent.code_name);
11437
11460
  if (!registeredAgents.has(agent.code_name)) {
11438
- const registered = await frameworkAdapter.registerAgent(agent.code_name, agentDir, primaryModel2);
11461
+ const registered = await frameworkAdapter.registerAgent(agent.code_name, agentDir, primaryModel2, agent.agent_id);
11439
11462
  if (registered) {
11440
11463
  registeredAgents.add(agent.code_name);
11441
11464
  log(`Registered '${agent.code_name}' in ${frameworkAdapter.label}`);
@@ -13645,7 +13668,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
13645
13668
  void api.post("/host/restart-ack", { host_id: hostId, agent_id: agentId, restart_requested_at: requestedAt }).catch((err) => log(`[restart-lane] ack failed for '${codeName}': ${err.message}`));
13646
13669
  void (async () => {
13647
13670
  try {
13648
- const { collectDiagnostics } = await import("../persistent-session-6ADHOTEG.js");
13671
+ const { collectDiagnostics } = await import("../persistent-session-G22EFMQM.js");
13649
13672
  await api.post("/host/heartbeat", {
13650
13673
  host_id: hostId,
13651
13674
  agent_diagnostics: collectDiagnostics([codeName])
@@ -13695,7 +13718,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
13695
13718
  }
13696
13719
  try {
13697
13720
  const hostId = await getHostId();
13698
- const { collectDiagnostics } = await import("../persistent-session-6ADHOTEG.js");
13721
+ const { collectDiagnostics } = await import("../persistent-session-G22EFMQM.js");
13699
13722
  await api.post("/host/heartbeat", {
13700
13723
  host_id: hostId,
13701
13724
  agent_diagnostics: collectDiagnostics([codeName])
@@ -14193,7 +14216,7 @@ async function processClaudePairSessions(agents) {
14193
14216
  killPairSession,
14194
14217
  pairTmuxSession,
14195
14218
  finalizeClaudePairOnboarding
14196
- } = await import("../claude-pair-runtime-2ZQZVFKF.js");
14219
+ } = await import("../claude-pair-runtime-LGKYHBI2.js");
14197
14220
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
14198
14221
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
14199
14222
  const killed = await killPairSession(pairTmuxSession(pairId));