@integrity-labs/agt-cli 0.28.699 → 0.28.700

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 (23) hide show
  1. package/dist/bin/agt.js +5 -5
  2. package/dist/{chunk-WDHT7D67.js → chunk-GE2FIKUX.js} +2 -2
  3. package/dist/{chunk-ZLHRSMKL.js → chunk-MZWFZIN2.js} +4 -4
  4. package/dist/{chunk-PBOSJQE6.js → chunk-QRQE2MVT.js} +3 -1
  5. package/dist/{chunk-PBOSJQE6.js.map → chunk-QRQE2MVT.js.map} +1 -1
  6. package/dist/{claude-pair-runtime-6W4UKH3J.js → claude-pair-runtime-NVLSNWWS.js} +2 -2
  7. package/dist/lib/manager-worker.js +36 -18
  8. package/dist/lib/manager-worker.js.map +1 -1
  9. package/dist/mcp/direct-chat-channel.js +1 -0
  10. package/dist/mcp/index.js +1 -0
  11. package/dist/mcp/origami.js +1 -0
  12. package/dist/mcp/slack-channel.js +1 -0
  13. package/dist/mcp/telegram-channel.js +1 -0
  14. package/dist/{persistent-session-MIMASNZD.js → persistent-session-7XILEFLF.js} +3 -3
  15. package/dist/{responsiveness-probe-UWABMXTD.js → responsiveness-probe-ZU33A2GB.js} +3 -3
  16. package/dist/{session-auth-dead-LRVZHGJI.js → session-auth-dead-ODQB4UPP.js} +2 -2
  17. package/package.json +1 -1
  18. /package/dist/{chunk-WDHT7D67.js.map → chunk-GE2FIKUX.js.map} +0 -0
  19. /package/dist/{chunk-ZLHRSMKL.js.map → chunk-MZWFZIN2.js.map} +0 -0
  20. /package/dist/{claude-pair-runtime-6W4UKH3J.js.map → claude-pair-runtime-NVLSNWWS.js.map} +0 -0
  21. /package/dist/{persistent-session-MIMASNZD.js.map → persistent-session-7XILEFLF.js.map} +0 -0
  22. /package/dist/{responsiveness-probe-UWABMXTD.js.map → responsiveness-probe-ZU33A2GB.js.map} +0 -0
  23. /package/dist/{session-auth-dead-LRVZHGJI.js.map → session-auth-dead-ODQB4UPP.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-MIMASNZD.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-7XILEFLF.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-6W4UKH3J.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-NVLSNWWS.js.map
@@ -54,7 +54,7 @@ import {
54
54
  safeWriteJsonAtomic,
55
55
  setConfigHash,
56
56
  tripClass
57
- } from "../chunk-ZLHRSMKL.js";
57
+ } from "../chunk-MZWFZIN2.js";
58
58
  import {
59
59
  getProjectDir as getProjectDir2,
60
60
  getReadyTasks,
@@ -112,7 +112,7 @@ import {
112
112
  takeZombieDetection,
113
113
  toOpencodeModel,
114
114
  writeEgressAllowlist
115
- } from "../chunk-WDHT7D67.js";
115
+ } from "../chunk-GE2FIKUX.js";
116
116
  import {
117
117
  ACCOUNT_ENFORCEMENT_MARKER_FILENAME,
118
118
  AnchorSessionClient,
@@ -124,6 +124,7 @@ import {
124
124
  FLAG_REGISTRY,
125
125
  FORCED_UPDATE_HARD_DEADLINE_MS,
126
126
  FORCED_UPDATE_RELAX_AFTER_MS,
127
+ HOST_USAGE_POLL_INTERVAL_MS,
127
128
  INTEGRATIONS_SECTION_END,
128
129
  INTEGRATIONS_SECTION_START,
129
130
  KANBAN_CHECK_COMMAND,
@@ -196,7 +197,7 @@ import {
196
197
  subagentActivityAgeSeconds,
197
198
  sumTranscriptUsageInWindow,
198
199
  transcriptActivityAgeSeconds
199
- } from "../chunk-PBOSJQE6.js";
200
+ } from "../chunk-QRQE2MVT.js";
200
201
  import {
201
202
  reapOrphanChannelMcps
202
203
  } from "../chunk-XWVM4KPK.js";
@@ -2542,7 +2543,6 @@ async function maybeReportUsageBanner(args) {
2542
2543
  }
2543
2544
 
2544
2545
  // src/lib/host-usage-poller.ts
2545
- var HOST_USAGE_POLL_INTERVAL_MS = 15 * 60 * 1e3;
2546
2546
  var HOST_USAGE_POLL_TIMEOUT_MS = 6e4;
2547
2547
  var USAGE_COMMAND_ARGS = ["-p", "/usage", "--output-format", "json"];
2548
2548
  var state2 = {
@@ -2562,6 +2562,22 @@ function extractUsageText(stdout) {
2562
2562
  return null;
2563
2563
  }
2564
2564
  }
2565
+ function readStoredInstant(raw) {
2566
+ if (raw === null) return null;
2567
+ if (typeof raw !== "string" || raw === "") return void 0;
2568
+ const parsed = new Date(raw);
2569
+ return Number.isNaN(parsed.getTime()) ? void 0 : parsed;
2570
+ }
2571
+ function storedResetInstants(response) {
2572
+ if (!response || typeof response !== "object" || Array.isArray(response)) return {};
2573
+ const body = response;
2574
+ const out = {};
2575
+ const week = readStoredInstant(body["week_resets_at"]);
2576
+ if (week !== void 0) out.week = week;
2577
+ const session = readStoredInstant(body["session_resets_at"]);
2578
+ if (session !== void 0) out.session = session;
2579
+ return out;
2580
+ }
2565
2581
  async function maybePollHostUsage(deps) {
2566
2582
  const { api: api2, runUsageCommand, authMode, cliVersion, log: log2 } = deps;
2567
2583
  const now = deps.now ?? /* @__PURE__ */ new Date();
@@ -2596,7 +2612,7 @@ async function maybePollHostUsage(deps) {
2596
2612
  state2.lastSessionResetsAt,
2597
2613
  reading.sessionResetsAt
2598
2614
  );
2599
- await api2.post("/host/usage-readings", {
2615
+ const response = await api2.post("/host/usage-readings", {
2600
2616
  state: reading.state,
2601
2617
  week_pct: reading.weekPct,
2602
2618
  week_resets_at: weekResetsAt ? weekResetsAt.toISOString() : null,
@@ -2607,11 +2623,13 @@ async function maybePollHostUsage(deps) {
2607
2623
  source: reading.source,
2608
2624
  unknown_reason: reading.unknownReason
2609
2625
  });
2610
- state2.lastWeekResetsAt = weekResetsAt;
2611
- state2.lastSessionResetsAt = sessionResetsAt;
2626
+ const stored = storedResetInstants(response);
2627
+ state2.lastWeekResetsAt = stored.week !== void 0 ? stored.week : weekResetsAt;
2628
+ state2.lastSessionResetsAt = stored.session !== void 0 ? stored.session : sessionResetsAt;
2612
2629
  if (reading.state === "ok") {
2630
+ const anchoredWeek = state2.lastWeekResetsAt;
2613
2631
  log2(
2614
- `[host-usage] week ${reading.weekPct}%` + (weekResetsAt ? ` (resets ${weekResetsAt.toISOString()})` : "") + `, session ${reading.sessionPct}%`
2632
+ `[host-usage] week ${reading.weekPct}%` + (anchoredWeek ? ` (resets ${anchoredWeek.toISOString()})` : "") + `, session ${reading.sessionPct}%`
2615
2633
  );
2616
2634
  } else if (reading.state === "unknown") {
2617
2635
  log2(`[host-usage] reading unknown: ${reading.unknownReason}`);
@@ -11874,7 +11892,7 @@ var pendingDayRolloverReset = /* @__PURE__ */ new Set();
11874
11892
  var dayRolloverInboundHold = /* @__PURE__ */ new Map();
11875
11893
  var INBOUND_HOLD_EPISODE_GAP_MS = 12e4;
11876
11894
  async function channelInboundActivityAgeSecondsFor(codeName) {
11877
- const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-UWABMXTD.js");
11895
+ const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-ZU33A2GB.js");
11878
11896
  const newest = newestPendingInboundActivityMtimeMs(dirname10(paneLogPath(codeName)));
11879
11897
  if (newest === null) return null;
11880
11898
  return Math.max(0, Math.floor((Date.now() - newest) / 1e3));
@@ -12522,7 +12540,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
12522
12540
  var lastVersionCheckAt = 0;
12523
12541
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
12524
12542
  var lastResponsivenessProbeAt = 0;
12525
- var agtCliVersion = true ? "0.28.699" : "dev";
12543
+ var agtCliVersion = true ? "0.28.700" : "dev";
12526
12544
  function resolveBrewPath(execFileSync3) {
12527
12545
  try {
12528
12546
  const out = execFileSync3("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -14023,7 +14041,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
14023
14041
  if (codeNames.length === 0) return;
14024
14042
  void (async () => {
14025
14043
  try {
14026
- const { collectDiagnostics } = await import("../persistent-session-MIMASNZD.js");
14044
+ const { collectDiagnostics } = await import("../persistent-session-7XILEFLF.js");
14027
14045
  await api.post("/host/heartbeat", {
14028
14046
  host_id: hostId,
14029
14047
  agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor)
@@ -14141,7 +14159,7 @@ async function pollCycleInner() {
14141
14159
  }
14142
14160
  try {
14143
14161
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
14144
- const { collectDiagnostics } = await import("../persistent-session-MIMASNZD.js");
14162
+ const { collectDiagnostics } = await import("../persistent-session-7XILEFLF.js");
14145
14163
  const diagCodeNames = [...agentState.persistentSessionAgents];
14146
14164
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor) : void 0;
14147
14165
  let tailscaleHostname;
@@ -14293,7 +14311,7 @@ async function pollCycleInner() {
14293
14311
  collectPanelessActivityProbes,
14294
14312
  getResponsivenessIntervalMs,
14295
14313
  occupancyQualificationClassifications
14296
- } = await import("../responsiveness-probe-UWABMXTD.js");
14314
+ } = await import("../responsiveness-probe-ZU33A2GB.js");
14297
14315
  const probeIntervalMs = getResponsivenessIntervalMs();
14298
14316
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
14299
14317
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -14403,7 +14421,7 @@ async function pollCycleInner() {
14403
14421
  collectResponsivenessProbes,
14404
14422
  livePendingInboundOldestAgeSeconds,
14405
14423
  parkPendingInbound
14406
- } = await import("../responsiveness-probe-UWABMXTD.js");
14424
+ } = await import("../responsiveness-probe-ZU33A2GB.js");
14407
14425
  const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-NDP36U7O.js");
14408
14426
  const wedgeNow = /* @__PURE__ */ new Date();
14409
14427
  const liveAgents = agentState.persistentSessionAgents;
@@ -14559,7 +14577,7 @@ async function pollCycleInner() {
14559
14577
  }
14560
14578
  try {
14561
14579
  const { scrapeMcpFailedBannerCount } = await import("../pane-mcp-banner-scraper-JA437JIB.js");
14562
- const { probeSessionAuth } = await import("../session-auth-dead-LRVZHGJI.js");
14580
+ const { probeSessionAuth } = await import("../session-auth-dead-ODQB4UPP.js");
14563
14581
  const observations = [];
14564
14582
  const pendingCacheCommits = [];
14565
14583
  const modelApiErrorReportingOn = hostFlagStore().getBoolean("model-api-error-reporting");
@@ -18319,7 +18337,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
18319
18337
  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}`));
18320
18338
  void (async () => {
18321
18339
  try {
18322
- const { collectDiagnostics } = await import("../persistent-session-MIMASNZD.js");
18340
+ const { collectDiagnostics } = await import("../persistent-session-7XILEFLF.js");
18323
18341
  await api.post("/host/heartbeat", {
18324
18342
  host_id: hostId,
18325
18343
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor)
@@ -18370,7 +18388,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
18370
18388
  }
18371
18389
  try {
18372
18390
  const hostId = await getHostId();
18373
- const { collectDiagnostics } = await import("../persistent-session-MIMASNZD.js");
18391
+ const { collectDiagnostics } = await import("../persistent-session-7XILEFLF.js");
18374
18392
  await api.post("/host/heartbeat", {
18375
18393
  host_id: hostId,
18376
18394
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor)
@@ -19002,7 +19020,7 @@ async function processClaudePairSessions(agents) {
19002
19020
  killPairSession,
19003
19021
  pairTmuxSession,
19004
19022
  finalizeClaudePairOnboarding
19005
- } = await import("../claude-pair-runtime-6W4UKH3J.js");
19023
+ } = await import("../claude-pair-runtime-NVLSNWWS.js");
19006
19024
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
19007
19025
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
19008
19026
  const killed = await killPairSession(pairTmuxSession(pairId));