@integrity-labs/agt-cli 0.28.727 → 0.28.729

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-ZCTFF4PA.js → chunk-KF3IFJVV.js} +2 -2
  3. package/dist/{chunk-65RGJKFR.js → chunk-TRKFDPYJ.js} +4 -4
  4. package/dist/{chunk-IXGIGDJG.js → chunk-WVYNQJRS.js} +17 -1
  5. package/dist/chunk-WVYNQJRS.js.map +1 -0
  6. package/dist/{claude-pair-runtime-42GBPDC7.js → claude-pair-runtime-BHULWRDO.js} +2 -2
  7. package/dist/lib/manager-worker.js +79 -13
  8. package/dist/lib/manager-worker.js.map +1 -1
  9. package/dist/mcp/direct-chat-channel.js +16 -0
  10. package/dist/mcp/index.js +16 -0
  11. package/dist/mcp/origami.js +16 -0
  12. package/dist/mcp/slack-channel.js +16 -0
  13. package/dist/mcp/telegram-channel.js +16 -0
  14. package/dist/{persistent-session-LP7JOGZ5.js → persistent-session-KHGH6UKC.js} +3 -3
  15. package/dist/{responsiveness-probe-TTHNHBBS.js → responsiveness-probe-ASAPVDUQ.js} +3 -3
  16. package/dist/{session-auth-dead-YQHE3WKV.js → session-auth-dead-ABEYQHK3.js} +2 -2
  17. package/package.json +1 -1
  18. package/dist/chunk-IXGIGDJG.js.map +0 -1
  19. /package/dist/{chunk-ZCTFF4PA.js.map → chunk-KF3IFJVV.js.map} +0 -0
  20. /package/dist/{chunk-65RGJKFR.js.map → chunk-TRKFDPYJ.js.map} +0 -0
  21. /package/dist/{claude-pair-runtime-42GBPDC7.js.map → claude-pair-runtime-BHULWRDO.js.map} +0 -0
  22. /package/dist/{persistent-session-LP7JOGZ5.js.map → persistent-session-KHGH6UKC.js.map} +0 -0
  23. /package/dist/{responsiveness-probe-TTHNHBBS.js.map → responsiveness-probe-ASAPVDUQ.js.map} +0 -0
  24. /package/dist/{session-auth-dead-YQHE3WKV.js.map → session-auth-dead-ABEYQHK3.js.map} +0 -0
@@ -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-LP7JOGZ5.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-KHGH6UKC.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-42GBPDC7.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-BHULWRDO.js.map
@@ -57,7 +57,7 @@ import {
57
57
  safeWriteJsonAtomic,
58
58
  setConfigHash,
59
59
  tripClass
60
- } from "../chunk-65RGJKFR.js";
60
+ } from "../chunk-TRKFDPYJ.js";
61
61
  import {
62
62
  getProjectDir as getProjectDir2,
63
63
  getReadyTasks,
@@ -118,7 +118,7 @@ import {
118
118
  takeZombieDetection,
119
119
  toOpencodeModel,
120
120
  writeEgressAllowlist
121
- } from "../chunk-ZCTFF4PA.js";
121
+ } from "../chunk-KF3IFJVV.js";
122
122
  import {
123
123
  ACCOUNT_ENFORCEMENT_MARKER_FILENAME,
124
124
  AnchorSessionClient,
@@ -203,7 +203,7 @@ import {
203
203
  subagentActivityAgeSeconds,
204
204
  sumTranscriptUsageInWindow,
205
205
  transcriptActivityAgeSeconds
206
- } from "../chunk-IXGIGDJG.js";
206
+ } from "../chunk-WVYNQJRS.js";
207
207
  import {
208
208
  reapOrphanChannelMcps
209
209
  } from "../chunk-XWVM4KPK.js";
@@ -281,6 +281,49 @@ function createSingleFlight(task, opts = {}) {
281
281
  };
282
282
  }
283
283
 
284
+ // src/lib/poll-rate-limiter.ts
285
+ var DEFAULT_POLL_INTERVAL_MS = 1e4;
286
+ var DEFAULT_POLL_BURST = 3;
287
+ function positiveOr(value, fallback) {
288
+ return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : fallback;
289
+ }
290
+ function createPollRateLimiter(opts) {
291
+ const intervalMs = positiveOr(opts.intervalMs, 1e4);
292
+ const burst = Math.max(1, positiveOr(opts.burst, DEFAULT_POLL_BURST));
293
+ const now = opts.now ?? (() => performance.now());
294
+ let tokens = burst;
295
+ let lastRefillAt = now();
296
+ let consecutiveThrottled = 0;
297
+ let totalThrottled = 0;
298
+ function refill(at) {
299
+ if (at < lastRefillAt) {
300
+ tokens = 0;
301
+ lastRefillAt = at;
302
+ return;
303
+ }
304
+ const elapsed = at - lastRefillAt;
305
+ lastRefillAt = at;
306
+ tokens = Math.min(burst, tokens + elapsed / intervalMs);
307
+ }
308
+ function tryAcquire() {
309
+ const at = now();
310
+ refill(at);
311
+ if (tokens >= 1) {
312
+ tokens -= 1;
313
+ consecutiveThrottled = 0;
314
+ return { allowed: true, verdict: "allowed", consecutiveThrottled: 0, totalThrottled };
315
+ }
316
+ consecutiveThrottled += 1;
317
+ totalThrottled += 1;
318
+ return { allowed: false, verdict: "throttled", consecutiveThrottled, totalThrottled };
319
+ }
320
+ return {
321
+ tryAcquire,
322
+ totalThrottled: () => totalThrottled,
323
+ tokens: () => tokens
324
+ };
325
+ }
326
+
284
327
  // src/lib/claude-code-upgrade-throttle.ts
285
328
  import { mkdirSync, readFileSync, writeFileSync } from "fs";
286
329
  import { dirname as dirname2, join as join2 } from "path";
@@ -12288,7 +12331,7 @@ var pendingDayRolloverReset = /* @__PURE__ */ new Set();
12288
12331
  var dayRolloverInboundHold = /* @__PURE__ */ new Map();
12289
12332
  var INBOUND_HOLD_EPISODE_GAP_MS = 12e4;
12290
12333
  async function channelInboundActivityAgeSecondsFor(codeName) {
12291
- const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-TTHNHBBS.js");
12334
+ const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-ASAPVDUQ.js");
12292
12335
  const newest = newestPendingInboundActivityMtimeMs(dirname10(paneLogPath(codeName)));
12293
12336
  if (newest === null) return null;
12294
12337
  return Math.max(0, Math.floor((Date.now() - newest) / 1e3));
@@ -12936,7 +12979,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
12936
12979
  var lastVersionCheckAt = 0;
12937
12980
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
12938
12981
  var lastResponsivenessProbeAt = 0;
12939
- var agtCliVersion = true ? "0.28.727" : "dev";
12982
+ var agtCliVersion = true ? "0.28.729" : "dev";
12940
12983
  function resolveBrewPath(execFileSync3) {
12941
12984
  try {
12942
12985
  const out = execFileSync3("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -14463,7 +14506,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
14463
14506
  if (codeNames.length === 0) return;
14464
14507
  void (async () => {
14465
14508
  try {
14466
- const { collectDiagnostics } = await import("../persistent-session-LP7JOGZ5.js");
14509
+ const { collectDiagnostics } = await import("../persistent-session-KHGH6UKC.js");
14467
14510
  await api.post("/host/heartbeat", {
14468
14511
  host_id: hostId,
14469
14512
  agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor)
@@ -14478,7 +14521,30 @@ var pollCycleGuard = createSingleFlight(() => pollCycleInner(), {
14478
14521
  log(`[poll-cycle] coalesced an early-poll trigger into the in-flight cycle (total=${total})`);
14479
14522
  }
14480
14523
  });
14524
+ var pollRateLimiter = null;
14525
+ var pollRateLimiterIntervalMs = 0;
14526
+ function getPollRateLimiter() {
14527
+ const intervalMs = config?.intervalMs ?? DEFAULT_POLL_INTERVAL_MS;
14528
+ if (!pollRateLimiter || pollRateLimiterIntervalMs !== intervalMs) {
14529
+ pollRateLimiter = createPollRateLimiter({ intervalMs });
14530
+ pollRateLimiterIntervalMs = intervalMs;
14531
+ }
14532
+ return pollRateLimiter;
14533
+ }
14534
+ var lastPollThrottleLogAt = 0;
14535
+ var POLL_THROTTLE_LOG_INTERVAL_MS = 6e4;
14481
14536
  function pollCycle() {
14537
+ const decision = getPollRateLimiter().tryAcquire();
14538
+ if (!decision.allowed) {
14539
+ const at = performance.now();
14540
+ if (decision.consecutiveThrottled === 1 || at - lastPollThrottleLogAt >= POLL_THROTTLE_LOG_INTERVAL_MS) {
14541
+ lastPollThrottleLogAt = at;
14542
+ log(
14543
+ `[poll-rate] throttled a poll pass (consecutive=${decision.consecutiveThrottled}, total=${decision.totalThrottled}, ceiling=1 per ${pollRateLimiterIntervalMs}ms) \u2014 more callers are asking to poll than the configured cadence allows`
14544
+ );
14545
+ }
14546
+ return Promise.resolve({ coalesced: false });
14547
+ }
14482
14548
  return pollCycleGuard.run();
14483
14549
  }
14484
14550
  async function pollCycleInner() {
@@ -14581,7 +14647,7 @@ async function pollCycleInner() {
14581
14647
  }
14582
14648
  try {
14583
14649
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
14584
- const { collectDiagnostics } = await import("../persistent-session-LP7JOGZ5.js");
14650
+ const { collectDiagnostics } = await import("../persistent-session-KHGH6UKC.js");
14585
14651
  const diagCodeNames = [...agentState.persistentSessionAgents];
14586
14652
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor) : void 0;
14587
14653
  let tailscaleHostname;
@@ -14750,7 +14816,7 @@ async function pollCycleInner() {
14750
14816
  collectPanelessActivityProbes,
14751
14817
  getResponsivenessIntervalMs,
14752
14818
  occupancyQualificationClassifications
14753
- } = await import("../responsiveness-probe-TTHNHBBS.js");
14819
+ } = await import("../responsiveness-probe-ASAPVDUQ.js");
14754
14820
  const probeIntervalMs = getResponsivenessIntervalMs();
14755
14821
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
14756
14822
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -14860,7 +14926,7 @@ async function pollCycleInner() {
14860
14926
  collectResponsivenessProbes,
14861
14927
  livePendingInboundOldestAgeSeconds,
14862
14928
  parkPendingInbound
14863
- } = await import("../responsiveness-probe-TTHNHBBS.js");
14929
+ } = await import("../responsiveness-probe-ASAPVDUQ.js");
14864
14930
  const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-NDP36U7O.js");
14865
14931
  const wedgeNow = /* @__PURE__ */ new Date();
14866
14932
  const liveAgents = agentState.persistentSessionAgents;
@@ -15016,7 +15082,7 @@ async function pollCycleInner() {
15016
15082
  }
15017
15083
  try {
15018
15084
  const { scrapeMcpFailedBannerCount } = await import("../pane-mcp-banner-scraper-JA437JIB.js");
15019
- const { probeSessionAuth } = await import("../session-auth-dead-YQHE3WKV.js");
15085
+ const { probeSessionAuth } = await import("../session-auth-dead-ABEYQHK3.js");
15020
15086
  const observations = [];
15021
15087
  const pendingCacheCommits = [];
15022
15088
  const modelApiErrorReportingOn = hostFlagStore().getBoolean("model-api-error-reporting");
@@ -18931,7 +18997,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
18931
18997
  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}`));
18932
18998
  void (async () => {
18933
18999
  try {
18934
- const { collectDiagnostics } = await import("../persistent-session-LP7JOGZ5.js");
19000
+ const { collectDiagnostics } = await import("../persistent-session-KHGH6UKC.js");
18935
19001
  await api.post("/host/heartbeat", {
18936
19002
  host_id: hostId,
18937
19003
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor)
@@ -18982,7 +19048,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
18982
19048
  }
18983
19049
  try {
18984
19050
  const hostId = await getHostId();
18985
- const { collectDiagnostics } = await import("../persistent-session-LP7JOGZ5.js");
19051
+ const { collectDiagnostics } = await import("../persistent-session-KHGH6UKC.js");
18986
19052
  await api.post("/host/heartbeat", {
18987
19053
  host_id: hostId,
18988
19054
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor)
@@ -19614,7 +19680,7 @@ async function processClaudePairSessions(agents) {
19614
19680
  killPairSession,
19615
19681
  pairTmuxSession,
19616
19682
  finalizeClaudePairOnboarding
19617
- } = await import("../claude-pair-runtime-42GBPDC7.js");
19683
+ } = await import("../claude-pair-runtime-BHULWRDO.js");
19618
19684
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
19619
19685
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
19620
19686
  const killed = await killPairSession(pairTmuxSession(pairId));