@integrity-labs/agt-cli 0.27.88 → 0.27.90

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.
@@ -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-5LZH3KKT.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-BMP74QGP.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-N2OVK463.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-XCZUY66M.js.map
@@ -16,7 +16,7 @@ import {
16
16
  provisionStopHook,
17
17
  requireHost,
18
18
  safeWriteJsonAtomic
19
- } from "../chunk-X747EIDT.js";
19
+ } from "../chunk-BGXIKCLR.js";
20
20
  import {
21
21
  getProjectDir as getProjectDir2,
22
22
  getReadyTasks,
@@ -54,7 +54,7 @@ import {
54
54
  stopPersistentSession,
55
55
  takeWatchdogGiveUpCount,
56
56
  takeZombieDetection
57
- } from "../chunk-SI2WVUAR.js";
57
+ } from "../chunk-4MZWINDQ.js";
58
58
  import {
59
59
  KANBAN_CHECK_COMMAND,
60
60
  appendDmFooter,
@@ -77,7 +77,7 @@ import {
77
77
  resolveConnectivityProbe,
78
78
  resolveDmTarget,
79
79
  wrapScheduledTaskPrompt
80
- } from "../chunk-54TIJVLZ.js";
80
+ } from "../chunk-T2UTQH6W.js";
81
81
  import {
82
82
  parsePsRows,
83
83
  reapOrphanChannelMcps
@@ -3931,6 +3931,9 @@ var alertSlackWebhook = null;
3931
3931
  var alertedJobs = /* @__PURE__ */ new Set();
3932
3932
  var taskDisplayInfo = /* @__PURE__ */ new Map();
3933
3933
  var agentChannelTokens = /* @__PURE__ */ new Map();
3934
+ function __setAgentChannelTokensForTest(codeName, tokens) {
3935
+ agentChannelTokens.set(codeName, tokens);
3936
+ }
3934
3937
  var activeChannels = /* @__PURE__ */ new Map();
3935
3938
  var gatewaysStartedThisCycle = /* @__PURE__ */ new Set();
3936
3939
  var state5 = {
@@ -3972,7 +3975,7 @@ var cachedMaintenanceWindow = null;
3972
3975
  var lastVersionCheckAt = 0;
3973
3976
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
3974
3977
  var lastResponsivenessProbeAt = 0;
3975
- var agtCliVersion = true ? "0.27.88" : "dev";
3978
+ var agtCliVersion = true ? "0.27.90" : "dev";
3976
3979
  function resolveBrewPath(execFileSync4) {
3977
3980
  try {
3978
3981
  const out = execFileSync4("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -5163,7 +5166,7 @@ async function pollCycle() {
5163
5166
  }
5164
5167
  try {
5165
5168
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
5166
- const { collectDiagnostics } = await import("../persistent-session-5LZH3KKT.js");
5169
+ const { collectDiagnostics } = await import("../persistent-session-BMP74QGP.js");
5167
5170
  const diagCodeNames = [...agentState.persistentSessionAgents];
5168
5171
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames) : void 0;
5169
5172
  let tailscaleHostname;
@@ -5236,7 +5239,7 @@ async function pollCycle() {
5236
5239
  const {
5237
5240
  collectResponsivenessProbes,
5238
5241
  getResponsivenessIntervalMs
5239
- } = await import("../responsiveness-probe-DG5VINBC.js");
5242
+ } = await import("../responsiveness-probe-AFOPQEFX.js");
5240
5243
  const probeIntervalMs = getResponsivenessIntervalMs();
5241
5244
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
5242
5245
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -9185,7 +9188,7 @@ async function postSlackChannelMessage(agentCodeName, channelId, text, threadTs)
9185
9188
  const data = await response.json();
9186
9189
  if (!data.ok) {
9187
9190
  log(`Slack chat.postMessage failed for '${agentCodeName}' to ${channelId}: ${data.error}`);
9188
- return { ok: false };
9191
+ return { ok: false, error: data.error };
9189
9192
  }
9190
9193
  return { ok: true, ts: data.ts };
9191
9194
  } finally {
@@ -9267,14 +9270,26 @@ async function deliverScheduledTaskOutput(agentCodeName, agentId, rawTarget, bod
9267
9270
  if (parsed.kind === "channel") {
9268
9271
  if (parsed.provider === "slack") {
9269
9272
  const channelId = parsed.channel_id ?? "";
9270
- const sent = await postSlackChannelMessage(agentCodeName, channelId, withLink(body, "slack"));
9273
+ const threadTs = parsed.thread_ts;
9274
+ let sent = await postSlackChannelMessage(agentCodeName, channelId, withLink(body, "slack"), threadTs);
9275
+ let deliveredInThread = Boolean(threadTs);
9276
+ if (!sent.ok && threadTs && (sent.error === "thread_not_found" || sent.error === "message_not_found")) {
9277
+ log(`[delivery] Originating thread ${threadTs} gone in ${channelId} for '${agentCodeName}' \u2014 falling back to top-level post`);
9278
+ sent = await postSlackChannelMessage(agentCodeName, channelId, withLink(body, "slack"));
9279
+ deliveredInThread = false;
9280
+ }
9271
9281
  await reportDeliveryStatus(agentId, taskId, {
9272
9282
  status: sent.ok ? "ok" : "failed",
9273
9283
  medium: "slack",
9274
- error_code: sent.ok ? null : "SLACK_SEND_FAILED"
9284
+ // Preserve Slack's concrete failure code (channel_not_found,
9285
+ // not_in_channel, auth errors, …) in the observability row rather
9286
+ // than collapsing everything to the generic constant.
9287
+ error_code: sent.ok ? null : sent.error ? `SLACK_SEND_FAILED:${sent.error}` : "SLACK_SEND_FAILED"
9275
9288
  });
9276
9289
  if (sent.ok) {
9277
- await maybePostSlackThreadHint(agentCodeName, channelId, sent.ts);
9290
+ if (!deliveredInThread) {
9291
+ await maybePostSlackThreadHint(agentCodeName, channelId, sent.ts);
9292
+ }
9278
9293
  if (sent.ts && taskId) {
9279
9294
  await maybePostScheduledTaskRatingPrompt(agentId, taskId, channelId, sent.ts);
9280
9295
  }
@@ -9469,7 +9484,7 @@ async function processClaudePairSessions(agents) {
9469
9484
  killPairSession,
9470
9485
  pairTmuxSession,
9471
9486
  finalizeClaudePairOnboarding
9472
- } = await import("../claude-pair-runtime-N2OVK463.js");
9487
+ } = await import("../claude-pair-runtime-XCZUY66M.js");
9473
9488
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
9474
9489
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
9475
9490
  const killed = await killPairSession(pairTmuxSession(pairId));
@@ -10347,12 +10362,14 @@ process.on("disconnect", () => {
10347
10362
  export {
10348
10363
  ChildProcessError,
10349
10364
  __resetScheduledDeliveryDedupeForTest,
10365
+ __setAgentChannelTokensForTest,
10350
10366
  applyRestartAcks,
10351
10367
  buildDoneCardNotification,
10352
10368
  claudeCodeUpgradeMarkerPath,
10353
10369
  claudeCodeUpgradeThrottled,
10354
10370
  claudeManagedSettingsPath,
10355
10371
  deliverScheduledCardResult,
10372
+ deliverScheduledTaskOutput,
10356
10373
  ensureClaudeManagedSettings,
10357
10374
  extractCharterSlackPeers,
10358
10375
  extractCharterTelegramPeers,