@integrity-labs/agt-cli 0.28.638 → 0.28.640

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-LCKKFDCR.js";
43
+ } from "../chunk-4FANS7I6.js";
44
44
  import {
45
45
  readDirectChatSessionState
46
- } from "../chunk-MRQ2GRTN.js";
46
+ } from "../chunk-HYLJPTKL.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-MAZUBHNT.js";
76
+ } from "../chunk-REWZFCUX.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.638" : "dev";
4912
+ var cliVersion = true ? "0.28.640" : "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.638" : "dev";
6092
+ var cliVersion2 = true ? "0.28.640" : "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) => {
@@ -8,7 +8,7 @@ import {
8
8
  isolationMode,
9
9
  log,
10
10
  parseEnvIntegrations
11
- } from "./chunk-MRQ2GRTN.js";
11
+ } from "./chunk-HYLJPTKL.js";
12
12
  import {
13
13
  BIND_FAILURE_QUARANTINE_THRESHOLD,
14
14
  INTEGRATIONS_SECTION_END,
@@ -55,7 +55,7 @@ import {
55
55
  resolveConnectivityProbe,
56
56
  worseConnectivityOutcome,
57
57
  wrapScheduledTaskPrompt
58
- } from "./chunk-MAZUBHNT.js";
58
+ } from "./chunk-REWZFCUX.js";
59
59
  import {
60
60
  parsePsRows
61
61
  } from "./chunk-XWVM4KPK.js";
@@ -6073,7 +6073,7 @@ function exchangeFailureKind(err) {
6073
6073
  }
6074
6074
 
6075
6075
  // src/lib/api-client.ts
6076
- var agtCliVersion = true ? "0.28.638" : "dev";
6076
+ var agtCliVersion = true ? "0.28.640" : "dev";
6077
6077
  var lastConfigHash = null;
6078
6078
  function setConfigHash(hash) {
6079
6079
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -9814,4 +9814,4 @@ export {
9814
9814
  managerInstallSystemUnitCommand,
9815
9815
  managerUninstallSystemUnitCommand
9816
9816
  };
9817
- //# sourceMappingURL=chunk-LCKKFDCR.js.map
9817
+ //# sourceMappingURL=chunk-4FANS7I6.js.map
@@ -16,7 +16,7 @@ import {
16
16
  rotateDailySession,
17
17
  sessionFileExists,
18
18
  todayLocalIso
19
- } from "./chunk-MAZUBHNT.js";
19
+ } from "./chunk-REWZFCUX.js";
20
20
  import {
21
21
  reapOrphanChannelMcps
22
22
  } from "./chunk-XWVM4KPK.js";
@@ -4313,4 +4313,4 @@ export {
4313
4313
  stopAllSessionsAndWait,
4314
4314
  getProjectDir
4315
4315
  };
4316
- //# sourceMappingURL=chunk-MRQ2GRTN.js.map
4316
+ //# sourceMappingURL=chunk-HYLJPTKL.js.map
@@ -12118,4 +12118,4 @@ export {
12118
12118
  minutesSinceLocalMidnight,
12119
12119
  peekCurrentSession
12120
12120
  };
12121
- //# sourceMappingURL=chunk-MAZUBHNT.js.map
12121
+ //# sourceMappingURL=chunk-REWZFCUX.js.map
@@ -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-NMGMDXTO.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-JJ7L23KO.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-EZUIIJYB.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-F2O36YHH.js.map
@@ -55,7 +55,7 @@ import {
55
55
  safeWriteJsonAtomic,
56
56
  setConfigHash,
57
57
  tripClass
58
- } from "../chunk-LCKKFDCR.js";
58
+ } from "../chunk-4FANS7I6.js";
59
59
  import {
60
60
  getProjectDir as getProjectDir2,
61
61
  getReadyTasks,
@@ -111,7 +111,7 @@ import {
111
111
  takeZombieDetection,
112
112
  toOpencodeModel,
113
113
  writeEgressAllowlist
114
- } from "../chunk-MRQ2GRTN.js";
114
+ } from "../chunk-HYLJPTKL.js";
115
115
  import {
116
116
  ACCOUNT_ENFORCEMENT_MARKER_FILENAME,
117
117
  AnchorSessionClient,
@@ -188,7 +188,7 @@ import {
188
188
  subagentActivityAgeSeconds,
189
189
  sumTranscriptUsageInWindow,
190
190
  transcriptActivityAgeSeconds
191
- } from "../chunk-MAZUBHNT.js";
191
+ } from "../chunk-REWZFCUX.js";
192
192
  import {
193
193
  reapOrphanChannelMcps
194
194
  } from "../chunk-XWVM4KPK.js";
@@ -5595,6 +5595,20 @@ function writeManagedSkillManifest(path, ids) {
5595
5595
  }
5596
5596
  }
5597
5597
 
5598
+ // src/lib/poll-loop-guard.ts
5599
+ async function pollCycleAndReschedule(pollCycle2, opts) {
5600
+ try {
5601
+ await pollCycle2();
5602
+ } catch (err) {
5603
+ try {
5604
+ await opts.onError(err);
5605
+ } catch {
5606
+ }
5607
+ } finally {
5608
+ await opts.reschedule();
5609
+ }
5610
+ }
5611
+
5598
5612
  // src/lib/manager/restart-timing.ts
5599
5613
  var pendingRequested = /* @__PURE__ */ new Map();
5600
5614
  var tracks = /* @__PURE__ */ new Map();
@@ -11497,7 +11511,7 @@ var pendingDayRolloverReset = /* @__PURE__ */ new Set();
11497
11511
  var dayRolloverInboundHold = /* @__PURE__ */ new Map();
11498
11512
  var INBOUND_HOLD_EPISODE_GAP_MS = 12e4;
11499
11513
  async function channelInboundActivityAgeSecondsFor(codeName) {
11500
- const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-ZUFKGLDN.js");
11514
+ const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-JAME5YLS.js");
11501
11515
  const newest = newestPendingInboundActivityMtimeMs(dirname9(paneLogPath(codeName)));
11502
11516
  if (newest === null) return null;
11503
11517
  return Math.max(0, Math.floor((Date.now() - newest) / 1e3));
@@ -12140,7 +12154,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
12140
12154
  var lastVersionCheckAt = 0;
12141
12155
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
12142
12156
  var lastResponsivenessProbeAt = 0;
12143
- var agtCliVersion = true ? "0.28.638" : "dev";
12157
+ var agtCliVersion = true ? "0.28.640" : "dev";
12144
12158
  function resolveBrewPath(execFileSync3) {
12145
12159
  try {
12146
12160
  const out = execFileSync3("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -13447,7 +13461,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
13447
13461
  if (codeNames.length === 0) return;
13448
13462
  void (async () => {
13449
13463
  try {
13450
- const { collectDiagnostics } = await import("../persistent-session-NMGMDXTO.js");
13464
+ const { collectDiagnostics } = await import("../persistent-session-JJ7L23KO.js");
13451
13465
  await api.post("/host/heartbeat", {
13452
13466
  host_id: hostId,
13453
13467
  agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor)
@@ -13563,7 +13577,7 @@ async function pollCycleInner() {
13563
13577
  }
13564
13578
  try {
13565
13579
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
13566
- const { collectDiagnostics } = await import("../persistent-session-NMGMDXTO.js");
13580
+ const { collectDiagnostics } = await import("../persistent-session-JJ7L23KO.js");
13567
13581
  const diagCodeNames = [...agentState.persistentSessionAgents];
13568
13582
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor) : void 0;
13569
13583
  let tailscaleHostname;
@@ -13686,7 +13700,7 @@ async function pollCycleInner() {
13686
13700
  collectPanelessActivityProbes,
13687
13701
  getResponsivenessIntervalMs,
13688
13702
  occupancyQualificationClassifications
13689
- } = await import("../responsiveness-probe-ZUFKGLDN.js");
13703
+ } = await import("../responsiveness-probe-JAME5YLS.js");
13690
13704
  const probeIntervalMs = getResponsivenessIntervalMs();
13691
13705
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
13692
13706
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -13792,7 +13806,7 @@ async function pollCycleInner() {
13792
13806
  collectResponsivenessProbes,
13793
13807
  livePendingInboundOldestAgeSeconds,
13794
13808
  parkPendingInbound
13795
- } = await import("../responsiveness-probe-ZUFKGLDN.js");
13809
+ } = await import("../responsiveness-probe-JAME5YLS.js");
13796
13810
  const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-NDP36U7O.js");
13797
13811
  const wedgeNow = /* @__PURE__ */ new Date();
13798
13812
  const liveAgents = agentState.persistentSessionAgents;
@@ -13948,7 +13962,7 @@ async function pollCycleInner() {
13948
13962
  }
13949
13963
  try {
13950
13964
  const { scrapeMcpFailedBannerCount } = await import("../pane-mcp-banner-scraper-JA437JIB.js");
13951
- const { probeSessionAuth } = await import("../session-auth-dead-TDWEX7R5.js");
13965
+ const { probeSessionAuth } = await import("../session-auth-dead-WX47XEZJ.js");
13952
13966
  const observations = [];
13953
13967
  const pendingCacheCommits = [];
13954
13968
  const modelApiErrorReportingOn = hostFlagStore().getBoolean("model-api-error-reporting");
@@ -17515,7 +17529,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
17515
17529
  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}`));
17516
17530
  void (async () => {
17517
17531
  try {
17518
- const { collectDiagnostics } = await import("../persistent-session-NMGMDXTO.js");
17532
+ const { collectDiagnostics } = await import("../persistent-session-JJ7L23KO.js");
17519
17533
  await api.post("/host/heartbeat", {
17520
17534
  host_id: hostId,
17521
17535
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor)
@@ -17566,7 +17580,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
17566
17580
  }
17567
17581
  try {
17568
17582
  const hostId = await getHostId();
17569
- const { collectDiagnostics } = await import("../persistent-session-NMGMDXTO.js");
17583
+ const { collectDiagnostics } = await import("../persistent-session-JJ7L23KO.js");
17570
17584
  await api.post("/host/heartbeat", {
17571
17585
  host_id: hostId,
17572
17586
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor)
@@ -17788,8 +17802,9 @@ function triggerEarlyPoll(reason) {
17788
17802
  }
17789
17803
  log(`[realtime] Triggering early poll: ${reason}`);
17790
17804
  pollTimer = setTimeout(() => {
17791
- void pollCycle().then(() => {
17792
- scheduleNext();
17805
+ void pollCycleAndReschedule(pollCycle, {
17806
+ onError: (err) => log(`[poll-loop] early-poll cycle rejected: ${err?.message ?? String(err)}`),
17807
+ reschedule: () => scheduleNext()
17793
17808
  });
17794
17809
  }, 0);
17795
17810
  }
@@ -18162,7 +18177,7 @@ async function processClaudePairSessions(agents) {
18162
18177
  killPairSession,
18163
18178
  pairTmuxSession,
18164
18179
  finalizeClaudePairOnboarding
18165
- } = await import("../claude-pair-runtime-EZUIIJYB.js");
18180
+ } = await import("../claude-pair-runtime-F2O36YHH.js");
18166
18181
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
18167
18182
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
18168
18183
  const killed = await killPairSession(pairTmuxSession(pairId));
@@ -18652,10 +18667,13 @@ function startPolling() {
18652
18667
  }
18653
18668
  void killAllAgtTmuxSessions().catch(() => {
18654
18669
  }).then(() => {
18655
- return pollCycle();
18656
- }).then(() => {
18657
- void driveArtifactStreaming();
18658
- scheduleNext();
18670
+ return pollCycleAndReschedule(pollCycle, {
18671
+ onError: (err) => log(`[poll-loop] startup cycle rejected: ${err?.message ?? String(err)}`),
18672
+ reschedule: () => {
18673
+ void driveArtifactStreaming();
18674
+ scheduleNext();
18675
+ }
18676
+ });
18659
18677
  });
18660
18678
  }
18661
18679
  async function reportSelfUpdateRestarts() {
@@ -18697,9 +18715,12 @@ function scheduleNext() {
18697
18715
  restartNow();
18698
18716
  return;
18699
18717
  }
18700
- void pollCycle().then(() => {
18701
- void driveArtifactStreaming();
18702
- scheduleNext();
18718
+ void pollCycleAndReschedule(pollCycle, {
18719
+ onError: (err) => log(`[poll-loop] scheduled cycle rejected: ${err?.message ?? String(err)}`),
18720
+ reschedule: () => {
18721
+ void driveArtifactStreaming();
18722
+ scheduleNext();
18723
+ }
18703
18724
  });
18704
18725
  }, delayMs);
18705
18726
  }