@integrity-labs/agt-cli 0.28.501 → 0.28.503

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.
@@ -42,7 +42,7 @@ import {
42
42
  resolveConnectivityProbe,
43
43
  worseConnectivityOutcome,
44
44
  wrapScheduledTaskPrompt
45
- } from "./chunk-XKBUTWON.js";
45
+ } from "./chunk-GBSMIV4P.js";
46
46
  import {
47
47
  parsePsRows
48
48
  } from "./chunk-XWVM4KPK.js";
@@ -5061,7 +5061,7 @@ function exchangeFailureKind(err) {
5061
5061
  }
5062
5062
 
5063
5063
  // src/lib/api-client.ts
5064
- var agtCliVersion = true ? "0.28.501" : "dev";
5064
+ var agtCliVersion = true ? "0.28.503" : "dev";
5065
5065
  var lastConfigHash = null;
5066
5066
  function setConfigHash(hash) {
5067
5067
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -8280,4 +8280,4 @@ export {
8280
8280
  managerInstallSystemUnitCommand,
8281
8281
  managerUninstallSystemUnitCommand
8282
8282
  };
8283
- //# sourceMappingURL=chunk-N4Y5IBZR.js.map
8283
+ //# sourceMappingURL=chunk-GR375XXG.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-HL3LNPAX.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-4PVEGHA5.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-U5ES3GOY.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-JEMJAZPB.js.map
@@ -52,7 +52,7 @@ import {
52
52
  safeWriteJsonAtomic,
53
53
  setConfigHash,
54
54
  tripClass
55
- } from "../chunk-N4Y5IBZR.js";
55
+ } from "../chunk-GR375XXG.js";
56
56
  import {
57
57
  getProjectDir as getProjectDir2,
58
58
  getReadyTasks,
@@ -77,6 +77,7 @@ import {
77
77
  SUPPRESS_SENTINEL,
78
78
  StreamEncoder,
79
79
  UNKNOWN_RATE_LIMIT,
80
+ agentRuntimeKey,
80
81
  appendDmFooter,
81
82
  attributeTranscriptUsageByRun,
82
83
  buildEgressAllowlist,
@@ -89,7 +90,7 @@ import {
89
90
  classifyTranscriptRateLimit,
90
91
  coerceOnboardingState,
91
92
  creditWatchdogGiveUpCount,
92
- cursorShortfallKey,
93
+ cursorAdvanceCounterKey,
93
94
  describeOnboardingChannel,
94
95
  egressMode,
95
96
  estimateActiveTasksTokens,
@@ -171,7 +172,7 @@ import {
171
172
  toOpencodeModel,
172
173
  transcriptActivityAgeSeconds,
173
174
  writeEgressAllowlist
174
- } from "../chunk-XKBUTWON.js";
175
+ } from "../chunk-GBSMIV4P.js";
175
176
  import {
176
177
  reapOrphanChannelMcps
177
178
  } from "../chunk-XWVM4KPK.js";
@@ -1907,9 +1908,12 @@ function collectEnvGates(env) {
1907
1908
  import { readFileSync as readFileSync7, writeFileSync as writeFileSync4 } from "fs";
1908
1909
  import { join as join6 } from "path";
1909
1910
  var CURSOR_SHORTFALL_COUNTER_SUFFIX = "-cursor-advance-classifications.json";
1910
- function recordCursorAdvanceShortfall(agentDir, source, classification) {
1911
+ function recordCursorAdvanceOutcome(agentDir, source, route, verdict) {
1911
1912
  if (!agentDir)
1912
1913
  return;
1914
+ const key = cursorAdvanceCounterKey(route, verdict);
1915
+ if (key === null)
1916
+ return;
1913
1917
  const path = join6(agentDir, `${source}${CURSOR_SHORTFALL_COUNTER_SUFFIX}`);
1914
1918
  const counts = {};
1915
1919
  try {
@@ -1922,7 +1926,6 @@ function recordCursorAdvanceShortfall(agentDir, source, classification) {
1922
1926
  }
1923
1927
  } catch {
1924
1928
  }
1925
- const key = cursorShortfallKey(classification.route, classification.reason, classification.partial);
1926
1929
  counts[key] = (counts[key] ?? 0) + 1;
1927
1930
  try {
1928
1931
  writeFileSync4(path, JSON.stringify(counts), { mode: 384 });
@@ -9953,7 +9956,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
9953
9956
  var lastVersionCheckAt = 0;
9954
9957
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
9955
9958
  var lastResponsivenessProbeAt = 0;
9956
- var agtCliVersion = true ? "0.28.501" : "dev";
9959
+ var agtCliVersion = true ? "0.28.503" : "dev";
9957
9960
  function resolveBrewPath(execFileSync2) {
9958
9961
  try {
9959
9962
  const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -11116,7 +11119,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
11116
11119
  if (codeNames.length === 0) return;
11117
11120
  void (async () => {
11118
11121
  try {
11119
- const { collectDiagnostics } = await import("../persistent-session-HL3LNPAX.js");
11122
+ const { collectDiagnostics } = await import("../persistent-session-4PVEGHA5.js");
11120
11123
  await api.post("/host/heartbeat", {
11121
11124
  host_id: hostId,
11122
11125
  agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor)
@@ -11223,7 +11226,7 @@ async function pollCycle() {
11223
11226
  }
11224
11227
  try {
11225
11228
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
11226
- const { collectDiagnostics } = await import("../persistent-session-HL3LNPAX.js");
11229
+ const { collectDiagnostics } = await import("../persistent-session-4PVEGHA5.js");
11227
11230
  const diagCodeNames = [...agentState.persistentSessionAgents];
11228
11231
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor, claudeMdSizeFor) : void 0;
11229
11232
  let tailscaleHostname;
@@ -11338,7 +11341,7 @@ async function pollCycle() {
11338
11341
  collectResponsivenessProbes,
11339
11342
  collectPanelessActivityProbes,
11340
11343
  getResponsivenessIntervalMs
11341
- } = await import("../responsiveness-probe-AZ44ONES.js");
11344
+ } = await import("../responsiveness-probe-PNKFXRVF.js");
11342
11345
  const probeIntervalMs = getResponsivenessIntervalMs();
11343
11346
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
11344
11347
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -11402,7 +11405,7 @@ async function pollCycle() {
11402
11405
  collectResponsivenessProbes,
11403
11406
  livePendingInboundOldestAgeSeconds,
11404
11407
  parkPendingInbound
11405
- } = await import("../responsiveness-probe-AZ44ONES.js");
11408
+ } = await import("../responsiveness-probe-PNKFXRVF.js");
11406
11409
  const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-NDP36U7O.js");
11407
11410
  const wedgeNow = /* @__PURE__ */ new Date();
11408
11411
  const liveAgents = agentState.persistentSessionAgents;
@@ -14894,7 +14897,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
14894
14897
  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}`));
14895
14898
  void (async () => {
14896
14899
  try {
14897
- const { collectDiagnostics } = await import("../persistent-session-HL3LNPAX.js");
14900
+ const { collectDiagnostics } = await import("../persistent-session-4PVEGHA5.js");
14898
14901
  await api.post("/host/heartbeat", {
14899
14902
  host_id: hostId,
14900
14903
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor)
@@ -14944,7 +14947,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
14944
14947
  }
14945
14948
  try {
14946
14949
  const hostId = await getHostId();
14947
- const { collectDiagnostics } = await import("../persistent-session-HL3LNPAX.js");
14950
+ const { collectDiagnostics } = await import("../persistent-session-4PVEGHA5.js");
14948
14951
  await api.post("/host/heartbeat", {
14949
14952
  host_id: hostId,
14950
14953
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor)
@@ -15186,6 +15189,7 @@ async function processDirectChatMessageOpencode(agent, msg) {
15186
15189
  return;
15187
15190
  }
15188
15191
  if (result.status === "replied" && result.reply) {
15192
+ let recorded = false;
15189
15193
  try {
15190
15194
  const body = await api.post("/host/direct-chat/reply", {
15191
15195
  agent_id: agent.agentId,
@@ -15198,6 +15202,13 @@ async function processDirectChatMessageOpencode(agent, msg) {
15198
15202
  httpOk: true,
15199
15203
  body
15200
15204
  });
15205
+ recordCursorAdvanceOutcome(
15206
+ dirname8(paneLogPath(agent.codeName)),
15207
+ "direct-chat-manager",
15208
+ "reply",
15209
+ verdict
15210
+ );
15211
+ recorded = true;
15201
15212
  if (verdict.outcome === "failed") {
15202
15213
  log(
15203
15214
  `[direct-chat] opencode reply REFUSED for '${agent.codeName}' (msg=${msg.id}): ${verdict.error} \u2014 leaving for redelivery`
@@ -15217,14 +15228,17 @@ async function processDirectChatMessageOpencode(agent, msg) {
15217
15228
  cleared: []
15218
15229
  })
15219
15230
  );
15220
- recordCursorAdvanceShortfall(dirname8(paneLogPath(agent.codeName)), "direct-chat-manager", {
15221
- route: "reply",
15222
- reason: verdict.reason,
15223
- partial: verdict.partial
15224
- });
15225
15231
  }
15226
15232
  log(`[direct-chat] opencode replied for '${agent.codeName}' (msg=${msg.id}, ${result.reply.length} chars)`);
15227
15233
  } catch (err) {
15234
+ if (!recorded) {
15235
+ recordCursorAdvanceOutcome(
15236
+ dirname8(paneLogPath(agent.codeName)),
15237
+ "direct-chat-manager",
15238
+ "reply",
15239
+ { outcome: "failed", error: err.message, expected: 1 }
15240
+ );
15241
+ }
15228
15242
  log(`[direct-chat] opencode reply POST failed for '${agent.codeName}' (msg=${msg.id}): ${err.message} \u2014 leaving for redelivery`);
15229
15243
  }
15230
15244
  return;
@@ -15298,19 +15312,38 @@ ${escapeXml(msg.content)}
15298
15312
  }
15299
15313
  var lastKanbanInjectAt = /* @__PURE__ */ new Map();
15300
15314
  var kanbanNudgeStateByCode = /* @__PURE__ */ new Map();
15315
+ function kanbanNudgeStateKey(codeName) {
15316
+ return agentRuntimeKey(codeName);
15317
+ }
15318
+ function getKanbanNudgeState(codeName) {
15319
+ const key = kanbanNudgeStateKey(codeName);
15320
+ const hit = kanbanNudgeStateByCode.get(key);
15321
+ if (hit || key === codeName) return hit;
15322
+ const legacy = kanbanNudgeStateByCode.get(codeName);
15323
+ if (!legacy) return void 0;
15324
+ kanbanNudgeStateByCode.delete(codeName);
15325
+ kanbanNudgeStateByCode.set(key, legacy);
15326
+ saveKanbanNudgeState(kanbanNudgeStateByCode, channelHashCacheDir());
15327
+ return legacy;
15328
+ }
15301
15329
  function loadKanbanNudgeStateFromDisk() {
15302
15330
  loadKanbanNudgeState(kanbanNudgeStateByCode, channelHashCacheDir());
15303
15331
  }
15304
15332
  function setKanbanNudgeState(codeName, state7) {
15305
- kanbanNudgeStateByCode.set(codeName, state7);
15333
+ const key = kanbanNudgeStateKey(codeName);
15334
+ if (key !== codeName) kanbanNudgeStateByCode.delete(codeName);
15335
+ kanbanNudgeStateByCode.set(key, state7);
15306
15336
  saveKanbanNudgeState(kanbanNudgeStateByCode, channelHashCacheDir());
15307
15337
  }
15308
15338
  function clearKanbanNudgeState(codeName) {
15309
- if (!kanbanNudgeStateByCode.delete(codeName)) return;
15339
+ const key = kanbanNudgeStateKey(codeName);
15340
+ let removed = kanbanNudgeStateByCode.delete(key);
15341
+ if (key !== codeName && kanbanNudgeStateByCode.delete(codeName)) removed = true;
15342
+ if (!removed) return;
15310
15343
  saveKanbanNudgeState(kanbanNudgeStateByCode, channelHashCacheDir());
15311
15344
  }
15312
15345
  function nextKanbanNudgeCount(codeName, signature) {
15313
- const prev = kanbanNudgeStateByCode.get(codeName);
15346
+ const prev = getKanbanNudgeState(codeName);
15314
15347
  return prev && prev.signature === signature ? (prev.nudgeCount ?? 1) + 1 : 1;
15315
15348
  }
15316
15349
  var openInjectedRunByCode = /* @__PURE__ */ new Map();
@@ -15388,7 +15421,7 @@ ${formatRunMarker(run_id)}` : KANBAN_CHECK_COMMAND;
15388
15421
  async function maybeInjectKanbanCheck(codeName, agentId, actionableCount, signature) {
15389
15422
  if (!shouldNudgeUnchangedBoard(
15390
15423
  signature,
15391
- kanbanNudgeStateByCode.get(codeName),
15424
+ getKanbanNudgeState(codeName),
15392
15425
  Date.now(),
15393
15426
  KANBAN_HYBRID_FULL_CADENCE_MS,
15394
15427
  KANBAN_HYBRID_MAX_CADENCE_MS
@@ -15432,7 +15465,7 @@ async function processClaudePairSessions(agents) {
15432
15465
  killPairSession,
15433
15466
  pairTmuxSession,
15434
15467
  finalizeClaudePairOnboarding
15435
- } = await import("../claude-pair-runtime-U5ES3GOY.js");
15468
+ } = await import("../claude-pair-runtime-JEMJAZPB.js");
15436
15469
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
15437
15470
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
15438
15471
  const killed = await killPairSession(pairTmuxSession(pairId));