@integrity-labs/agt-cli 0.28.371 → 0.28.373

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.
@@ -25,7 +25,7 @@ import {
25
25
  resolveConnectivityProbe,
26
26
  worseConnectivityOutcome,
27
27
  wrapScheduledTaskPrompt
28
- } from "./chunk-NDF3YMP5.js";
28
+ } from "./chunk-TRBANZZ4.js";
29
29
  import {
30
30
  parsePsRows
31
31
  } from "./chunk-XWVM4KPK.js";
@@ -6166,7 +6166,7 @@ function requireHost() {
6166
6166
  }
6167
6167
 
6168
6168
  // src/lib/api-client.ts
6169
- var agtCliVersion = true ? "0.28.371" : "dev";
6169
+ var agtCliVersion = true ? "0.28.373" : "dev";
6170
6170
  var lastConfigHash = null;
6171
6171
  function setConfigHash(hash) {
6172
6172
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -8612,4 +8612,4 @@ export {
8612
8612
  managerInstallSystemUnitCommand,
8613
8613
  managerUninstallSystemUnitCommand
8614
8614
  };
8615
- //# sourceMappingURL=chunk-D6BJJ334.js.map
8615
+ //# sourceMappingURL=chunk-WQMTAMLX.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-HXUYS63V.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-G4GDPZ54.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-U2SO44TW.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-DPFC3EF3.js.map
@@ -43,7 +43,7 @@ import {
43
43
  resolveEffectivePinRaw,
44
44
  safeWriteJsonAtomic,
45
45
  setConfigHash
46
- } from "../chunk-D6BJJ334.js";
46
+ } from "../chunk-WQMTAMLX.js";
47
47
  import {
48
48
  getProjectDir as getProjectDir2,
49
49
  getReadyTasks,
@@ -90,7 +90,6 @@ import {
90
90
  injectMessageWithStatus,
91
91
  injectOpencodeMessage,
92
92
  isAgentIdle,
93
- isAgentPromptReady,
94
93
  isBareAck,
95
94
  isConversationFailureCategory,
96
95
  isEmptyTotals,
@@ -131,7 +130,6 @@ import {
131
130
  resolveDmTarget,
132
131
  restartEgressSidecar,
133
132
  rotateSessionForWedge,
134
- sendToAgent,
135
133
  serializeUsageLimitMarker,
136
134
  sessionTranscriptDir,
137
135
  sha256,
@@ -147,7 +145,7 @@ import {
147
145
  toOpencodeModel,
148
146
  transcriptActivityAgeSeconds,
149
147
  writeEgressAllowlist
150
- } from "../chunk-NDF3YMP5.js";
148
+ } from "../chunk-TRBANZZ4.js";
151
149
  import {
152
150
  reapOrphanChannelMcps
153
151
  } from "../chunk-XWVM4KPK.js";
@@ -4128,7 +4126,13 @@ function isKanbanHybridDryRun() {
4128
4126
  }
4129
4127
  var HYBRID_ACTIONABLE_STATUSES = new Set(KANBAN_NUDGE_ACTIONABLE_STATUSES);
4130
4128
  function isHybridActionable(item) {
4131
- return HYBRID_ACTIONABLE_STATUSES.has(item.status) && item.source_type !== "scheduled_task";
4129
+ return HYBRID_ACTIONABLE_STATUSES.has(item.status) && item.source_type !== "scheduled_task" && item.assignee_type !== "human";
4130
+ }
4131
+ function resolveHybridNudgeAction(stale, allowedCount, suppressedCount) {
4132
+ if (stale) return "skip-stale";
4133
+ if (allowedCount > 0) return "nudge";
4134
+ if (suppressedCount > 0) return "close-suppressed";
4135
+ return "drain";
4132
4136
  }
4133
4137
  function kanbanActionableSignature(allowed) {
4134
4138
  return allowed.map((i) => `${i.id}:${i.status}`).sort().join("|");
@@ -4142,9 +4146,6 @@ function shouldNudgeUnchangedBoard(signature, state7, now, fullCadenceMs, maxCad
4142
4146
  if (state7.signature !== signature) return true;
4143
4147
  return now - state7.nudgedAt >= nudgeIntervalForCount(state7.nudgeCount ?? 1, fullCadenceMs, maxCadenceMs);
4144
4148
  }
4145
- function isSlashCommand(command) {
4146
- return command.trimStart().startsWith("/");
4147
- }
4148
4149
  var BOARD_INJECT_TEMPLATES = /* @__PURE__ */ new Set(["morning-plan", "task-update", "hourly-status", "end-of-day-summary"]);
4149
4150
  function parseStandupSummary(summary) {
4150
4151
  const lines = summary.split("\n");
@@ -9099,7 +9100,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
9099
9100
  var lastVersionCheckAt = 0;
9100
9101
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
9101
9102
  var lastResponsivenessProbeAt = 0;
9102
- var agtCliVersion = true ? "0.28.371" : "dev";
9103
+ var agtCliVersion = true ? "0.28.373" : "dev";
9103
9104
  function resolveBrewPath(execFileSync2) {
9104
9105
  try {
9105
9106
  const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -10118,7 +10119,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
10118
10119
  if (codeNames.length === 0) return;
10119
10120
  void (async () => {
10120
10121
  try {
10121
- const { collectDiagnostics } = await import("../persistent-session-HXUYS63V.js");
10122
+ const { collectDiagnostics } = await import("../persistent-session-G4GDPZ54.js");
10122
10123
  await api.post("/host/heartbeat", {
10123
10124
  host_id: hostId,
10124
10125
  agent_diagnostics: collectDiagnostics(codeNames)
@@ -10217,7 +10218,7 @@ async function pollCycle() {
10217
10218
  }
10218
10219
  try {
10219
10220
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
10220
- const { collectDiagnostics } = await import("../persistent-session-HXUYS63V.js");
10221
+ const { collectDiagnostics } = await import("../persistent-session-G4GDPZ54.js");
10221
10222
  const diagCodeNames = [...agentState.persistentSessionAgents];
10222
10223
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames) : void 0;
10223
10224
  let tailscaleHostname;
@@ -10372,7 +10373,7 @@ async function pollCycle() {
10372
10373
  const {
10373
10374
  collectResponsivenessProbes,
10374
10375
  getResponsivenessIntervalMs
10375
- } = await import("../responsiveness-probe-TVSASSZY.js");
10376
+ } = await import("../responsiveness-probe-2JNQBULO.js");
10376
10377
  const probeIntervalMs = getResponsivenessIntervalMs();
10377
10378
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
10378
10379
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -10404,7 +10405,7 @@ async function pollCycle() {
10404
10405
  collectResponsivenessProbes,
10405
10406
  livePendingInboundOldestAgeSeconds,
10406
10407
  parkPendingInbound
10407
- } = await import("../responsiveness-probe-TVSASSZY.js");
10408
+ } = await import("../responsiveness-probe-2JNQBULO.js");
10408
10409
  const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-HYOOQV4A.js");
10409
10410
  const wedgeNow = /* @__PURE__ */ new Date();
10410
10411
  const liveAgents = agentState.persistentSessionAgents;
@@ -12458,6 +12459,7 @@ async function processAgent(agent, agentStates) {
12458
12459
  }
12459
12460
  }
12460
12461
  let boardItems = [];
12462
+ let boardItemsStale = false;
12461
12463
  const hasBoardTemplates = tasks.some((t) => BOARD_INJECT_TEMPLATES.has(t.template_id));
12462
12464
  if (hasBoardTemplates) {
12463
12465
  try {
@@ -12466,6 +12468,7 @@ async function processAgent(agent, agentStates) {
12466
12468
  kanbanBoardCache.set(agent.code_name, boardItems);
12467
12469
  } catch {
12468
12470
  boardItems = kanbanBoardCache.get(agent.code_name) ?? [];
12471
+ boardItemsStale = true;
12469
12472
  }
12470
12473
  }
12471
12474
  const agentFw = agentFrameworkCache.get(agent.code_name) ?? DEFAULT_FRAMEWORK;
@@ -12473,7 +12476,7 @@ async function processAgent(agent, agentStates) {
12473
12476
  const wantsHybridInject = isKanbanHybridEnabled();
12474
12477
  if (agentFw === "claude-code" && sessionMode === "persistent") {
12475
12478
  let hybridBoard = hasBoardTemplates ? boardItems : void 0;
12476
- let hybridBoardStale = false;
12479
+ let hybridBoardStale = boardItemsStale;
12477
12480
  if (!hybridBoard) {
12478
12481
  try {
12479
12482
  const boardData = await api.post(
@@ -12500,20 +12503,25 @@ async function processAgent(agent, agentStates) {
12500
12503
  const cardStates = wedgeRestartsByCard.get(agent.code_name);
12501
12504
  const actionable = hybridBoard.filter(isHybridActionable);
12502
12505
  const { allowed, suppressed } = cardStates ? partitionActionableByPoison(actionable, cardStates, poisonCfg) : { allowed: actionable, suppressed: [] };
12503
- if (hybridBoardStale) {
12506
+ const nudgeAction = resolveHybridNudgeAction(
12507
+ hybridBoardStale,
12508
+ allowed.length,
12509
+ suppressed.length
12510
+ );
12511
+ if (nudgeAction === "skip-stale") {
12504
12512
  if (allowed.length > 0) {
12505
12513
  log(
12506
12514
  `[manager-worker] kanban inject skipped for '${agent.code_name}' - board fetch failed this tick (stale cache)`
12507
12515
  );
12508
12516
  }
12509
- } else if (allowed.length > 0) {
12517
+ } else if (nudgeAction === "nudge") {
12510
12518
  void maybeInjectKanbanCheck(
12511
12519
  agent.code_name,
12512
12520
  agent.agent_id,
12513
12521
  allowed.length,
12514
12522
  kanbanActionableSignature(allowed)
12515
12523
  );
12516
- } else if (suppressed.length > 0) {
12524
+ } else if (nudgeAction === "close-suppressed") {
12517
12525
  closeInjectedRunIfOpen(
12518
12526
  agent.code_name,
12519
12527
  "completed",
@@ -13575,7 +13583,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
13575
13583
  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}`));
13576
13584
  void (async () => {
13577
13585
  try {
13578
- const { collectDiagnostics } = await import("../persistent-session-HXUYS63V.js");
13586
+ const { collectDiagnostics } = await import("../persistent-session-G4GDPZ54.js");
13579
13587
  await api.post("/host/heartbeat", {
13580
13588
  host_id: hostId,
13581
13589
  agent_diagnostics: collectDiagnostics([codeName])
@@ -13625,7 +13633,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
13625
13633
  }
13626
13634
  try {
13627
13635
  const hostId = await getHostId();
13628
- const { collectDiagnostics } = await import("../persistent-session-HXUYS63V.js");
13636
+ const { collectDiagnostics } = await import("../persistent-session-G4GDPZ54.js");
13629
13637
  await api.post("/host/heartbeat", {
13630
13638
  host_id: hostId,
13631
13639
  agent_diagnostics: collectDiagnostics([codeName])
@@ -14046,61 +14054,16 @@ async function maybeInjectKanbanCheck(codeName, agentId, actionableCount, signat
14046
14054
  return;
14047
14055
  }
14048
14056
  lastKanbanInjectAt.set(codeName, Date.now());
14049
- if (hostFlagStore().getBoolean("kanban-doorbell")) {
14050
- const ok = await injectKanbanCheckViaDirectChat(codeName, agentId, actionableCount);
14051
- if (ok) {
14052
- setKanbanNudgeState(codeName, {
14053
- signature,
14054
- nudgedAt: Date.now(),
14055
- nudgeCount: nextKanbanNudgeCount(codeName, signature)
14056
- });
14057
- return;
14058
- }
14059
- log(`[manager-worker] kanban direct-chat enqueue failed for '${codeName}' \u2014 falling back to send-keys`);
14060
- }
14061
- const tmuxSession = `agt-${codeName}`;
14062
- const ready = await isAgentPromptReady(tmuxSession);
14063
- if (!ready) {
14064
- log(`[manager-worker] kanban inject skipped \u2014 agent busy ('${codeName}')`);
14065
- return;
14066
- }
14067
- if (isKanbanHybridDryRun()) {
14068
- log(
14069
- `[manager-worker] kanban inject DRY-RUN \u2014 would inject for '${codeName}' (${actionableCount} actionable items)`
14070
- );
14071
- lastKanbanInjectAt.delete(codeName);
14072
- return;
14073
- }
14074
- closeInjectedRunIfOpen(codeName, "completed", "kanban inject superseded by next inject");
14075
- const { run_id } = await startRun({
14076
- agent_id: agentId,
14077
- source_type: "kanban",
14078
- metadata: { injected: "kanban-check", actionable_count: actionableCount }
14079
- });
14080
- let delivered;
14081
- if (isSlashCommand(KANBAN_CHECK_COMMAND)) {
14082
- delivered = sendToAgent(tmuxSession, KANBAN_CHECK_COMMAND);
14083
- } else {
14084
- const content = run_id ? `${KANBAN_CHECK_COMMAND}
14085
- ${formatRunMarker(run_id)}` : KANBAN_CHECK_COMMAND;
14086
- delivered = await injectMessage(codeName, "system", content, void 0, log);
14087
- }
14088
- if (delivered) {
14089
- if (run_id) openInjectedRunByCode.set(codeName, run_id);
14057
+ const ok = await injectKanbanCheckViaDirectChat(codeName, agentId, actionableCount);
14058
+ if (ok) {
14090
14059
  setKanbanNudgeState(codeName, {
14091
14060
  signature,
14092
14061
  nudgedAt: Date.now(),
14093
14062
  nudgeCount: nextKanbanNudgeCount(codeName, signature)
14094
14063
  });
14095
- log(
14096
- `[manager-worker] Injected kanban check for '${codeName}' (${actionableCount} actionable items)${run_id ? ` run_id=${run_id}` : ""}`
14097
- );
14098
- } else {
14099
- if (run_id) {
14100
- void finishRun(run_id, "failed", { outcomeMessage: "kanban inject delivery failed" });
14101
- }
14102
- log(`[manager-worker] kanban inject failed for '${codeName}'`);
14064
+ return;
14103
14065
  }
14066
+ log(`[manager-worker] kanban direct-chat enqueue failed for '${codeName}' - will re-nudge next tick`);
14104
14067
  }
14105
14068
  var lastHarvestAt = /* @__PURE__ */ new Map();
14106
14069
  var HARVEST_INTERVAL_MS = 3 * 60 * 1e3;
@@ -14123,7 +14086,7 @@ async function processClaudePairSessions(agents) {
14123
14086
  killPairSession,
14124
14087
  pairTmuxSession,
14125
14088
  finalizeClaudePairOnboarding
14126
- } = await import("../claude-pair-runtime-U2SO44TW.js");
14089
+ } = await import("../claude-pair-runtime-DPFC3EF3.js");
14127
14090
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
14128
14091
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
14129
14092
  const killed = await killPairSession(pairTmuxSession(pairId));