@integrity-labs/agt-cli 0.28.1171 → 0.28.1172

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.
package/dist/bin/agt.js CHANGED
@@ -40,7 +40,7 @@ import {
40
40
  success,
41
41
  table,
42
42
  warn
43
- } from "../chunk-TJ4MVWNH.js";
43
+ } from "../chunk-7XUOPTSD.js";
44
44
  import {
45
45
  getProjectDir,
46
46
  isSessionResumeDisabled,
@@ -5513,7 +5513,7 @@ import { execFileSync, execSync } from "child_process";
5513
5513
  import { existsSync as existsSync11, realpathSync as realpathSync2 } from "fs";
5514
5514
  import chalk18 from "chalk";
5515
5515
  import ora16 from "ora";
5516
- var cliVersion = true ? "0.28.1171" : "dev";
5516
+ var cliVersion = true ? "0.28.1172" : "dev";
5517
5517
  async function fetchLatestVersion() {
5518
5518
  const host2 = getHost();
5519
5519
  if (!host2) return null;
@@ -6773,7 +6773,7 @@ function handleError(err) {
6773
6773
  }
6774
6774
 
6775
6775
  // src/bin/agt.ts
6776
- var cliVersion2 = true ? "0.28.1171" : "dev";
6776
+ var cliVersion2 = true ? "0.28.1172" : "dev";
6777
6777
  var program = new Command();
6778
6778
  program.name("agt").description("Augmented CLI \u2014 agent provisioning and management").version(cliVersion2).option("--json", "Emit machine-readable JSON output (suppress spinners and colors)").option("--skip-update-check", "Skip the automatic update check on startup");
6779
6779
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -8078,7 +8078,7 @@ function exchangeFailureKind(err) {
8078
8078
  }
8079
8079
 
8080
8080
  // src/lib/api-client.ts
8081
- var agtCliVersion = true ? "0.28.1171" : "dev";
8081
+ var agtCliVersion = true ? "0.28.1172" : "dev";
8082
8082
  var lastConfigHash = null;
8083
8083
  function setConfigHash(hash) {
8084
8084
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -13235,4 +13235,4 @@ export {
13235
13235
  managerInstallSystemUnitCommand,
13236
13236
  managerUninstallSystemUnitCommand
13237
13237
  };
13238
- //# sourceMappingURL=chunk-TJ4MVWNH.js.map
13238
+ //# sourceMappingURL=chunk-7XUOPTSD.js.map
@@ -77,7 +77,7 @@ import {
77
77
  setConfigHash,
78
78
  shellGuard,
79
79
  tripClass
80
- } from "../chunk-TJ4MVWNH.js";
80
+ } from "../chunk-7XUOPTSD.js";
81
81
  import {
82
82
  CLAUDE_CODE_SECURITY_FLOOR,
83
83
  SELF_UPDATE_TIMEOUTS,
@@ -15928,7 +15928,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
15928
15928
  var lastVersionCheckAt = 0;
15929
15929
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
15930
15930
  var lastResponsivenessProbeAt = 0;
15931
- var agtCliVersion = true ? "0.28.1171" : "dev";
15931
+ var agtCliVersion = true ? "0.28.1172" : "dev";
15932
15932
  function resolveBrewPath(execFileSync3) {
15933
15933
  try {
15934
15934
  const out = execFileSync3("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -47473,6 +47473,9 @@ function classifyUndeliverableCause(i) {
47473
47473
  return null;
47474
47474
  }
47475
47475
  var UNDELIVERABLE_NOTICE_THROTTLE_MS = 5 * 60 * 1e3;
47476
+ function markerOwesNoReply(m) {
47477
+ return m.discretionary === true || m.ingress_only === true;
47478
+ }
47476
47479
  function shouldPostUndeliverableNotice(lastNoticeAtMs, nowMs, throttleMs = UNDELIVERABLE_NOTICE_THROTTLE_MS) {
47477
47480
  return lastNoticeAtMs == null || nowMs - lastNoticeAtMs >= throttleMs;
47478
47481
  }
@@ -47644,7 +47647,7 @@ function oldestPendingMarkerAgeMs(dir, now = Date.now(), opts) {
47644
47647
  let receivedAt;
47645
47648
  try {
47646
47649
  const raw = JSON.parse(readFileSync9(join10(dir, name), "utf-8"));
47647
- if (raw.discretionary === true) continue;
47650
+ if (markerOwesNoReply(raw)) continue;
47648
47651
  if (!opts?.includeSeen && typeof raw.seen_at === "string" && raw.seen_at) continue;
47649
47652
  receivedAt = raw.received_at;
47650
47653
  } catch {
@@ -41280,6 +41280,12 @@ var UNDELIVERABLE_NOTICE_THROTTLE_MS = 5 * 60 * 1e3;
41280
41280
  function undeliverableNoticeEligible(shouldEngage) {
41281
41281
  return shouldEngage;
41282
41282
  }
41283
+ function decideInboundReplyOwed(i) {
41284
+ return i.shouldEngage && !i.ingressOnlyThread;
41285
+ }
41286
+ function markerOwesNoReply(m) {
41287
+ return m.discretionary === true || m.ingress_only === true;
41288
+ }
41283
41289
  function shouldPostUndeliverableNotice(lastNoticeAtMs, nowMs, throttleMs = UNDELIVERABLE_NOTICE_THROTTLE_MS) {
41284
41290
  return lastNoticeAtMs == null || nowMs - lastNoticeAtMs >= throttleMs;
41285
41291
  }
@@ -41646,7 +41652,7 @@ function oldestPendingMarkerAgeMs(dir, now = Date.now(), opts) {
41646
41652
  let receivedAt;
41647
41653
  try {
41648
41654
  const raw = JSON.parse(readFileSync3(join3(dir, name), "utf-8"));
41649
- if (raw.discretionary === true) continue;
41655
+ if (markerOwesNoReply(raw)) continue;
41650
41656
  if (!opts?.includeSeen && typeof raw.seen_at === "string" && raw.seen_at) continue;
41651
41657
  receivedAt = raw.received_at;
41652
41658
  } catch {
@@ -43596,7 +43602,7 @@ function countOwedSlackRepliesForThread(dir, channel, threadTs) {
43596
43602
  try {
43597
43603
  const m = JSON.parse(readFileSync5(fullPath, "utf-8"));
43598
43604
  if (!m || typeof m !== "object") return;
43599
- if (m.discretionary === true || m.undeliverable === true) return;
43605
+ if (m.discretionary === true || m.undeliverable === true || m.ingress_only === true) return;
43600
43606
  owed += 1;
43601
43607
  } catch {
43602
43608
  }
@@ -43607,6 +43613,21 @@ function markSeenAllSlackPendingMarkersForThread(dir, channel, threadTs, markSee
43607
43613
  const prefix = `${sanitizeMarkerSegment(channel)}__${sanitizeMarkerSegment(threadTs)}__`;
43608
43614
  return applyToMatchingMarkers(dir, prefix, ".json", markSeen);
43609
43615
  }
43616
+ function clearIngressOnlySlackPendingMarkersForThread(dir, channel, threadTs, clear = defaultClearMarkerFile) {
43617
+ const cleared = [];
43618
+ markSeenAllSlackPendingMarkersForThread(dir, channel, threadTs, (fullPath) => {
43619
+ let marker;
43620
+ try {
43621
+ marker = JSON.parse(readFileSync5(fullPath, "utf-8"));
43622
+ } catch {
43623
+ return;
43624
+ }
43625
+ if (typeof marker !== "object" || marker === null || marker.ingress_only !== true) return;
43626
+ clear(fullPath);
43627
+ if (typeof marker.message_ts === "string") cleared.push(marker.message_ts);
43628
+ });
43629
+ return cleared;
43630
+ }
43610
43631
  function clearSlackPendingMarkerByMessageTs(dir, channel, messageTs, clear = defaultClearMarkerFile) {
43611
43632
  const channelPrefix = `${sanitizeMarkerSegment(channel)}__`;
43612
43633
  const messageSuffix = `__${sanitizeMarkerSegment(messageTs)}.json`;
@@ -47915,7 +47936,7 @@ function sweepSlackStaleMarkers(thresholdMs) {
47915
47936
  thresholdMs,
47916
47937
  hardCeilingMs: STALE_MARKER_MS,
47917
47938
  discretionaryThresholdMs: DISCRETIONARY_MARKER_MS,
47918
- discretionary: marker.discretionary,
47939
+ discretionary: markerOwesNoReply(marker),
47919
47940
  hasPayload: Boolean(marker.payload),
47920
47941
  replayCount: marker.replay_count ?? 0,
47921
47942
  replayEnabled
@@ -47923,7 +47944,7 @@ function sweepSlackStaleMarkers(thresholdMs) {
47923
47944
  const structurallyBroken = !channel || !thread_ts || !message_ts;
47924
47945
  const timeStale = isPendingMarkerStale(received_at, now, effectiveThresholdMs);
47925
47946
  if (structurallyBroken || timeStale) {
47926
- if (!marker.discretionary) {
47947
+ if (!markerOwesNoReply(marker)) {
47927
47948
  if (structurallyBroken || !isMarkerGenuinelyAged(received_at, now, effectiveThresholdMs)) {
47928
47949
  recordChannelDeflection(SLACK_AGENT_DIR, "slack", "marker_corrupt");
47929
47950
  } else if (marker.payload) {
@@ -48006,7 +48027,7 @@ function findSlackProgressTarget() {
48006
48027
  continue;
48007
48028
  }
48008
48029
  if (!m.channel || !m.thread_ts) continue;
48009
- if (m.discretionary === true || m.undeliverable === true) continue;
48030
+ if (markerOwesNoReply(m) || m.undeliverable === true) continue;
48010
48031
  const ms = Date.parse(m.received_at ?? "");
48011
48032
  if (!Number.isFinite(ms)) continue;
48012
48033
  if (ms < bestMs) {
@@ -48156,7 +48177,7 @@ function listPendingSlackConversations() {
48156
48177
  );
48157
48178
  if (typeof marker.channel !== "string" || !marker.channel) continue;
48158
48179
  if (typeof marker.thread_ts !== "string" || !marker.thread_ts) continue;
48159
- if (marker.discretionary === true) continue;
48180
+ if (markerOwesNoReply(marker)) continue;
48160
48181
  if (typeof marker.seen_at === "string" && marker.seen_at) continue;
48161
48182
  const isThreadReply = typeof marker.message_ts === "string" && marker.message_ts !== marker.thread_ts;
48162
48183
  const key2 = isThreadReply ? `${marker.channel}:${marker.thread_ts}` : marker.channel;
@@ -51315,7 +51336,8 @@ async function replayPendingSlackMarkers() {
51315
51336
  // ENG-6366: auto-followed un-mentioned thread inbound the agent may
51316
51337
  // legitimately silently skip — never re-deliver it (it never clears,
51317
51338
  // so it would otherwise re-push MAX_MARKER_REPLAYS times under replay).
51318
- discretionary: marker.discretionary,
51339
+ // ENG-11709: the same for a marker in a third-party-bot thread.
51340
+ discretionary: markerOwesNoReply(marker),
51319
51341
  // ENG-7736: bound the pane-fresh defer (clamped under the orphan
51320
51342
  // window) so a perpetually-fresh pane (respawn churn) can't hold off
51321
51343
  // replay until the orphan sweep GCs the marker - the Sherlock loss.
@@ -51774,6 +51796,16 @@ async function connectSocketMode() {
51774
51796
  }
51775
51797
  } else if (access.kind !== "drop" && (!isBot || peerClassification?.kind === "peer-ingress")) {
51776
51798
  ingressOnlyThreads.clear(evt.channel, ingressThreadTs);
51799
+ if (evt.channel && ingressThreadTs) {
51800
+ for (const clearedTs of clearIngressOnlySlackPendingMarkersForThread(
51801
+ SLACK_PENDING_INBOUND_DIR,
51802
+ evt.channel,
51803
+ ingressThreadTs,
51804
+ clearSlackMarkerFileWithHeal
51805
+ )) {
51806
+ slackInboundRegistry.markCleared(evt.channel, clearedTs);
51807
+ }
51808
+ }
51777
51809
  }
51778
51810
  if (access.kind === "drop") {
51779
51811
  const channelHash = createHash3("sha256").update(evt.channel ?? "").digest("hex").slice(0, 8);
@@ -52044,6 +52076,10 @@ async function connectSocketMode() {
52044
52076
  botPostedInThread,
52045
52077
  addressesAnotherAgent
52046
52078
  });
52079
+ const replyOwed = decideInboundReplyOwed({
52080
+ shouldEngage,
52081
+ ingressOnlyThread: ingressOnlyThreads.isIngressOnly(channel, threadTs)
52082
+ });
52047
52083
  const ackProbe = process.env.TMUX && AGENT_CODE_NAME ? probeAgentSessionCached(AGENT_CODE_NAME) : { tmux: "unknown", claude: "unknown" };
52048
52084
  let paneLogFreshAgeMs = null;
52049
52085
  if (SLACK_AGENT_DIR) {
@@ -52083,13 +52119,13 @@ async function connectSocketMode() {
52083
52119
  body: JSON.stringify({ channel, timestamp: ts, name: reactionName })
52084
52120
  }).catch(() => {
52085
52121
  });
52086
- if (ackDecision === "undeliverable" && channel && undeliverableNoticeEligible(shouldEngage)) {
52122
+ if (ackDecision === "undeliverable" && channel && undeliverableNoticeEligible(replyOwed)) {
52087
52123
  postUndeliverableNotice(channel, threadTs, isThreadReply, cause);
52088
52124
  }
52089
52125
  }
52090
52126
  if (channel && ts && armMarker) {
52091
- trackPendingMessage(channel, threadTs, ts, ackDecision === "undeliverable", !shouldEngage);
52092
- if (ackDecision === "ack" && shouldEngage) {
52127
+ trackPendingMessage(channel, threadTs, ts, ackDecision === "undeliverable", !replyOwed);
52128
+ if (ackDecision === "ack" && replyOwed) {
52093
52129
  scheduleBusyAck(
52094
52130
  channel,
52095
52131
  threadTs,
@@ -52168,7 +52204,7 @@ async function connectSocketMode() {
52168
52204
  // fork) - an auto-followed, un-addressed thread message (discretionary,
52169
52205
  // !shouldEngage) owes no reply. Additive only; no consumer gates on
52170
52206
  // these yet (Slice 2).
52171
- ...conversationalLaneMeta(shouldEngage),
52207
+ ...conversationalLaneMeta(replyOwed),
52172
52208
  // ENG-7919: surface the effective auto-follow state (already cleared when
52173
52209
  // the bot was @-mentioned) so the agent sees auto_followed="true" only
52174
52210
  // when the message genuinely requires discretionary engagement judgment.
@@ -52199,7 +52235,7 @@ async function connectSocketMode() {
52199
52235
  };
52200
52236
  recordLaneClassification(SLACK_AGENT_DIR, "slack", {
52201
52237
  lane: "conversational",
52202
- expectsReply: shouldEngage
52238
+ expectsReply: replyOwed
52203
52239
  });
52204
52240
  if (channel && ts && armMarker) {
52205
52241
  attachSlackReplayPayload(channel, threadTs, ts, replayPayload);
@@ -52250,7 +52286,7 @@ async function connectSocketMode() {
52250
52286
  sinceMs: dispatchedAtMs
52251
52287
  });
52252
52288
  }
52253
- if (shouldEngage) seedSlackProgressHeartbeat();
52289
+ if (replyOwed) seedSlackProgressHeartbeat();
52254
52290
  if (channel) {
52255
52291
  conversationIngestClient?.ingest({
52256
52292
  channel: "slack",
@@ -44212,6 +44212,9 @@ function decideRecoveryHeal(i) {
44212
44212
  return i.wasUndeliverable && i.hasTarget ? "heal" : "none";
44213
44213
  }
44214
44214
  var UNDELIVERABLE_NOTICE_THROTTLE_MS = 5 * 60 * 1e3;
44215
+ function markerOwesNoReply(m) {
44216
+ return m.discretionary === true || m.ingress_only === true;
44217
+ }
44215
44218
  function shouldPostUndeliverableNotice(lastNoticeAtMs, nowMs, throttleMs = UNDELIVERABLE_NOTICE_THROTTLE_MS) {
44216
44219
  return lastNoticeAtMs == null || nowMs - lastNoticeAtMs >= throttleMs;
44217
44220
  }
@@ -44553,7 +44556,7 @@ function oldestPendingMarkerAgeMs(dir, now = Date.now(), opts) {
44553
44556
  let receivedAt;
44554
44557
  try {
44555
44558
  const raw = JSON.parse(readFileSync14(join17(dir, name), "utf-8"));
44556
- if (raw.discretionary === true) continue;
44559
+ if (markerOwesNoReply(raw)) continue;
44557
44560
  if (!opts?.includeSeen && typeof raw.seen_at === "string" && raw.seen_at) continue;
44558
44561
  receivedAt = raw.received_at;
44559
44562
  } catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.28.1171",
3
+ "version": "0.28.1172",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {