@integrity-labs/agt-cli 0.28.1023 → 0.28.1025

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.
@@ -39286,13 +39286,17 @@ function decideBusyAck(i) {
39286
39286
  const threshold = i.thresholdMs ?? channelBusyAckThresholdMs();
39287
39287
  if (i.pendingAgeMs < threshold) return false;
39288
39288
  if (!i.sessionAlive) return false;
39289
+ if (i.liveStateMarker) return true;
39289
39290
  const paneFreshThreshold = i.paneFreshThresholdMs ?? ACK_PANE_FRESH_THRESHOLD_MS;
39290
39291
  return i.paneLogFreshAgeMs != null && i.paneLogFreshAgeMs <= paneFreshThreshold;
39291
39292
  }
39292
- function busyAckNoticeText(usageLimit) {
39293
+ function busyAckNoticeText(usageLimit, blockedOnPrompt) {
39293
39294
  if (usageLimit) return giveUpNoticeText("usage_limit", usageLimit.resetsHint);
39294
- return "\u{1F6E0}\uFE0F I'm in the middle of something right now \u2014 I'll follow up on this as soon as I'm free.";
39295
+ if (blockedOnPrompt) return BLOCKED_ON_PROMPT_NOTICE;
39296
+ return BUSY_NOTICE;
39295
39297
  }
39298
+ var BUSY_NOTICE = "\u{1F6E0}\uFE0F I'm in the middle of something right now \u2014 I'll follow up on this as soon as I'm free.";
39299
+ var BLOCKED_ON_PROMPT_NOTICE = "\u26A0\uFE0F I'm stuck on a prompt I can't answer myself, so I can't get to this right now. This isn't me ignoring you - it needs someone on our side to clear it before I can continue.";
39296
39300
  var GIVE_UP_SIGNAL_FILENAME = "watchdog-give-up.json";
39297
39301
  var GIVE_UP_SIGNAL_MAX_AGE_MS = 30 * 60 * 1e3;
39298
39302
  function readGiveUpSignal(path, now = Date.now()) {
@@ -39329,6 +39333,28 @@ function readUsageLimitForBusyAck(agentDir, now = Date.now()) {
39329
39333
  if (now - lastSeenMs > USAGE_LIMIT_LIVE_WINDOW_MS) return null;
39330
39334
  return { resetsHint: sig.resetsHint };
39331
39335
  }
39336
+ var BLOCKED_PROMPT_SIGNAL_FILENAME = "blocked-prompt.json";
39337
+ var BLOCKED_PROMPT_KINDS = ["login-picker", "usage-limit-unanswerable", "unclaimed-modal"];
39338
+ var BLOCKED_PROMPT_LIVE_WINDOW_MS = 3 * 6e4;
39339
+ function readBlockedPromptForBusyAck(agentDir, now = Date.now()) {
39340
+ if (!agentDir) return null;
39341
+ let raw;
39342
+ try {
39343
+ raw = JSON.parse(readFileSync7(join7(agentDir, BLOCKED_PROMPT_SIGNAL_FILENAME), "utf8"));
39344
+ } catch {
39345
+ return null;
39346
+ }
39347
+ if (typeof raw !== "object" || raw === null) return null;
39348
+ const kind = raw.kind;
39349
+ if (typeof kind !== "string" || !BLOCKED_PROMPT_KINDS.includes(kind)) {
39350
+ return null;
39351
+ }
39352
+ if (typeof raw.last_seen_at !== "string") return null;
39353
+ const t = Date.parse(raw.last_seen_at);
39354
+ if (!Number.isFinite(t) || t > now) return null;
39355
+ if (now - t > BLOCKED_PROMPT_LIVE_WINDOW_MS) return null;
39356
+ return { kind };
39357
+ }
39332
39358
  function giveUpNoticeText(reason = null, resetsHint = null) {
39333
39359
  if (reason === "usage_limit") {
39334
39360
  return resetsHint ? `\u23F3 I've reached my usage limit for now, so I can't reply until ${resetsHint}. Your message is queued \u2014 I'll pick it up then, no need to resend.` : "\u23F3 I've reached my usage limit for now, so I can't reply just yet. Your message is queued \u2014 I'll pick it up as soon as it lifts, no need to resend.";
@@ -41313,7 +41339,10 @@ function postDirectChatBusyAckNotice(sessionId) {
41313
41339
  void (async () => {
41314
41340
  const ok = await postDirectChatNoticeMessage(
41315
41341
  sessionId,
41316
- busyAckNoticeText(readUsageLimitForBusyAck(DIRECT_CHAT_CODE_NAME_AGENT_DIR))
41342
+ busyAckNoticeText(
41343
+ readUsageLimitForBusyAck(DIRECT_CHAT_CODE_NAME_AGENT_DIR),
41344
+ readBlockedPromptForBusyAck(DIRECT_CHAT_CODE_NAME_AGENT_DIR)
41345
+ )
41317
41346
  );
41318
41347
  if (!ok) {
41319
41348
  lastBusyAckNoticeAt.delete(sessionId);
@@ -41408,6 +41437,8 @@ function scheduleDirectChatBusyAck(sessionId, messageId, arrivedWhileBusy) {
41408
41437
  pendingAgeMs,
41409
41438
  sessionAlive,
41410
41439
  paneLogFreshAgeMs,
41440
+ // ENG-10972: a live watchdog marker stands in for pane freshness (see BusyAckInputs).
41441
+ liveStateMarker: Boolean(readUsageLimitForBusyAck(DIRECT_CHAT_CODE_NAME_AGENT_DIR) || readBlockedPromptForBusyAck(DIRECT_CHAT_CODE_NAME_AGENT_DIR)),
41411
41442
  thresholdMs
41412
41443
  })) {
41413
41444
  recordChannelDeflection(DIRECT_CHAT_CODE_NAME_AGENT_DIR, "direct-chat", "busy");
@@ -39966,13 +39966,17 @@ function decideBusyAck(i) {
39966
39966
  const threshold = i.thresholdMs ?? channelBusyAckThresholdMs();
39967
39967
  if (i.pendingAgeMs < threshold) return false;
39968
39968
  if (!i.sessionAlive) return false;
39969
+ if (i.liveStateMarker) return true;
39969
39970
  const paneFreshThreshold = i.paneFreshThresholdMs ?? ACK_PANE_FRESH_THRESHOLD_MS;
39970
39971
  return i.paneLogFreshAgeMs != null && i.paneLogFreshAgeMs <= paneFreshThreshold;
39971
39972
  }
39972
- function busyAckNoticeText(usageLimit) {
39973
+ function busyAckNoticeText(usageLimit, blockedOnPrompt) {
39973
39974
  if (usageLimit) return giveUpNoticeText("usage_limit", usageLimit.resetsHint);
39974
- return "\u{1F6E0}\uFE0F I'm in the middle of something right now \u2014 I'll follow up on this as soon as I'm free.";
39975
+ if (blockedOnPrompt) return BLOCKED_ON_PROMPT_NOTICE;
39976
+ return BUSY_NOTICE;
39975
39977
  }
39978
+ var BUSY_NOTICE = "\u{1F6E0}\uFE0F I'm in the middle of something right now \u2014 I'll follow up on this as soon as I'm free.";
39979
+ var BLOCKED_ON_PROMPT_NOTICE = "\u26A0\uFE0F I'm stuck on a prompt I can't answer myself, so I can't get to this right now. This isn't me ignoring you - it needs someone on our side to clear it before I can continue.";
39976
39980
  var GIVE_UP_SIGNAL_FILENAME = "watchdog-give-up.json";
39977
39981
  var GIVE_UP_SIGNAL_MAX_AGE_MS = 30 * 60 * 1e3;
39978
39982
  function readGiveUpSignal(path, now = Date.now()) {
@@ -40009,6 +40013,28 @@ function readUsageLimitForBusyAck(agentDir, now = Date.now()) {
40009
40013
  if (now - lastSeenMs > USAGE_LIMIT_LIVE_WINDOW_MS) return null;
40010
40014
  return { resetsHint: sig.resetsHint };
40011
40015
  }
40016
+ var BLOCKED_PROMPT_SIGNAL_FILENAME = "blocked-prompt.json";
40017
+ var BLOCKED_PROMPT_KINDS = ["login-picker", "usage-limit-unanswerable", "unclaimed-modal"];
40018
+ var BLOCKED_PROMPT_LIVE_WINDOW_MS = 3 * 6e4;
40019
+ function readBlockedPromptForBusyAck(agentDir, now = Date.now()) {
40020
+ if (!agentDir) return null;
40021
+ let raw;
40022
+ try {
40023
+ raw = JSON.parse(readFileSync3(join3(agentDir, BLOCKED_PROMPT_SIGNAL_FILENAME), "utf8"));
40024
+ } catch {
40025
+ return null;
40026
+ }
40027
+ if (typeof raw !== "object" || raw === null) return null;
40028
+ const kind = raw.kind;
40029
+ if (typeof kind !== "string" || !BLOCKED_PROMPT_KINDS.includes(kind)) {
40030
+ return null;
40031
+ }
40032
+ if (typeof raw.last_seen_at !== "string") return null;
40033
+ const t = Date.parse(raw.last_seen_at);
40034
+ if (!Number.isFinite(t) || t > now) return null;
40035
+ if (now - t > BLOCKED_PROMPT_LIVE_WINDOW_MS) return null;
40036
+ return { kind };
40037
+ }
40012
40038
  function decideGiveUpNotice(input) {
40013
40039
  const maxAge = input.maxAgeMs ?? GIVE_UP_SIGNAL_MAX_AGE_MS;
40014
40040
  if (input.signalAtMs == null) return false;
@@ -45460,7 +45486,10 @@ function postBusyAckNotice(channel, threadTs, isThreadReply) {
45460
45486
  body: JSON.stringify({
45461
45487
  channel,
45462
45488
  // ENG-10972: say RATE-LIMITED rather than "busy" when that is the truth.
45463
- text: busyAckNoticeText(readUsageLimitForBusyAck(SLACK_AGENT_DIR)),
45489
+ text: busyAckNoticeText(
45490
+ readUsageLimitForBusyAck(SLACK_AGENT_DIR),
45491
+ readBlockedPromptForBusyAck(SLACK_AGENT_DIR)
45492
+ ),
45464
45493
  ...threadTs ? { thread_ts: threadTs } : {}
45465
45494
  }),
45466
45495
  // Bound the request so a hung Slack call can't dangle to the platform
@@ -45493,6 +45522,8 @@ function scheduleBusyAck(channel, threadTs, messageTs, isThreadReply, arrivedWhi
45493
45522
  pendingAgeMs: Math.max(0, Date.now() - Date.parse(marker.received_at)),
45494
45523
  sessionAlive: probe.tmux === "alive" && probe.claude === "alive",
45495
45524
  paneLogFreshAgeMs,
45525
+ // ENG-10972: a live watchdog marker stands in for pane freshness (see BusyAckInputs).
45526
+ liveStateMarker: Boolean(readUsageLimitForBusyAck(SLACK_AGENT_DIR) || readBlockedPromptForBusyAck(SLACK_AGENT_DIR)),
45496
45527
  thresholdMs
45497
45528
  });
45498
45529
  if (post) {
@@ -42689,13 +42689,17 @@ function decideBusyAck(i) {
42689
42689
  const threshold = i.thresholdMs ?? channelBusyAckThresholdMs();
42690
42690
  if (i.pendingAgeMs < threshold) return false;
42691
42691
  if (!i.sessionAlive) return false;
42692
+ if (i.liveStateMarker) return true;
42692
42693
  const paneFreshThreshold = i.paneFreshThresholdMs ?? ACK_PANE_FRESH_THRESHOLD_MS;
42693
42694
  return i.paneLogFreshAgeMs != null && i.paneLogFreshAgeMs <= paneFreshThreshold;
42694
42695
  }
42695
- function busyAckNoticeText(usageLimit) {
42696
+ function busyAckNoticeText(usageLimit, blockedOnPrompt) {
42696
42697
  if (usageLimit) return giveUpNoticeText("usage_limit", usageLimit.resetsHint);
42697
- return "\u{1F6E0}\uFE0F I'm in the middle of something right now \u2014 I'll follow up on this as soon as I'm free.";
42698
+ if (blockedOnPrompt) return BLOCKED_ON_PROMPT_NOTICE;
42699
+ return BUSY_NOTICE;
42698
42700
  }
42701
+ var BUSY_NOTICE = "\u{1F6E0}\uFE0F I'm in the middle of something right now \u2014 I'll follow up on this as soon as I'm free.";
42702
+ var BLOCKED_ON_PROMPT_NOTICE = "\u26A0\uFE0F I'm stuck on a prompt I can't answer myself, so I can't get to this right now. This isn't me ignoring you - it needs someone on our side to clear it before I can continue.";
42699
42703
  var GIVE_UP_SIGNAL_FILENAME = "watchdog-give-up.json";
42700
42704
  var GIVE_UP_SIGNAL_MAX_AGE_MS = 30 * 60 * 1e3;
42701
42705
  function readGiveUpSignal(path, now = Date.now()) {
@@ -42732,6 +42736,28 @@ function readUsageLimitForBusyAck(agentDir, now = Date.now()) {
42732
42736
  if (now - lastSeenMs > USAGE_LIMIT_LIVE_WINDOW_MS) return null;
42733
42737
  return { resetsHint: sig.resetsHint };
42734
42738
  }
42739
+ var BLOCKED_PROMPT_SIGNAL_FILENAME = "blocked-prompt.json";
42740
+ var BLOCKED_PROMPT_KINDS = ["login-picker", "usage-limit-unanswerable", "unclaimed-modal"];
42741
+ var BLOCKED_PROMPT_LIVE_WINDOW_MS = 3 * 6e4;
42742
+ function readBlockedPromptForBusyAck(agentDir, now = Date.now()) {
42743
+ if (!agentDir) return null;
42744
+ let raw;
42745
+ try {
42746
+ raw = JSON.parse(readFileSync13(join15(agentDir, BLOCKED_PROMPT_SIGNAL_FILENAME), "utf8"));
42747
+ } catch {
42748
+ return null;
42749
+ }
42750
+ if (typeof raw !== "object" || raw === null) return null;
42751
+ const kind = raw.kind;
42752
+ if (typeof kind !== "string" || !BLOCKED_PROMPT_KINDS.includes(kind)) {
42753
+ return null;
42754
+ }
42755
+ if (typeof raw.last_seen_at !== "string") return null;
42756
+ const t = Date.parse(raw.last_seen_at);
42757
+ if (!Number.isFinite(t) || t > now) return null;
42758
+ if (now - t > BLOCKED_PROMPT_LIVE_WINDOW_MS) return null;
42759
+ return { kind };
42760
+ }
42735
42761
  function decideGiveUpNotice(input) {
42736
42762
  const maxAge = input.maxAgeMs ?? GIVE_UP_SIGNAL_MAX_AGE_MS;
42737
42763
  if (input.signalAtMs == null) return false;
@@ -43566,7 +43592,10 @@ function postBusyAckNotice(chatId, messageId) {
43566
43592
  {
43567
43593
  chat_id: chatId,
43568
43594
  // ENG-10972: say RATE-LIMITED rather than "busy" when that is the truth.
43569
- text: busyAckNoticeText(readUsageLimitForBusyAck(TELEGRAM_AGENT_DIR)),
43595
+ text: busyAckNoticeText(
43596
+ readUsageLimitForBusyAck(TELEGRAM_AGENT_DIR),
43597
+ readBlockedPromptForBusyAck(TELEGRAM_AGENT_DIR)
43598
+ ),
43570
43599
  reply_to_message_id: Number(messageId),
43571
43600
  allow_sending_without_reply: true
43572
43601
  },
@@ -43609,6 +43638,8 @@ function scheduleBusyAck(chatId, messageId, arrivedWhileBusy) {
43609
43638
  pendingAgeMs: Math.max(0, Date.now() - Date.parse(marker.received_at)),
43610
43639
  sessionAlive: probe.tmux === "alive" && probe.claude === "alive",
43611
43640
  paneLogFreshAgeMs,
43641
+ // ENG-10972: a live watchdog marker stands in for pane freshness (see BusyAckInputs).
43642
+ liveStateMarker: Boolean(readUsageLimitForBusyAck(TELEGRAM_AGENT_DIR) || readBlockedPromptForBusyAck(TELEGRAM_AGENT_DIR)),
43612
43643
  thresholdMs
43613
43644
  });
43614
43645
  if (post) {
@@ -65,7 +65,7 @@ import {
65
65
  writeDirectChatSessionState,
66
66
  writeEgressAllowlist,
67
67
  writePersistentClaudeWrapper
68
- } from "./chunk-RDQILPRF.js";
68
+ } from "./chunk-5XPZF6FT.js";
69
69
  import "./chunk-BHKFVSIX.js";
70
70
  import "./chunk-DHWNVVX4.js";
71
71
  import "./chunk-XWVM4KPK.js";
@@ -139,4 +139,4 @@ export {
139
139
  writeEgressAllowlist,
140
140
  writePersistentClaudeWrapper
141
141
  };
142
- //# sourceMappingURL=persistent-session-3NQHNU6H.js.map
142
+ //# sourceMappingURL=persistent-session-GZV4EXKD.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  paneLogPath
3
- } from "./chunk-RDQILPRF.js";
3
+ } from "./chunk-5XPZF6FT.js";
4
4
  import "./chunk-BHKFVSIX.js";
5
5
  import "./chunk-DHWNVVX4.js";
6
6
  import "./chunk-XWVM4KPK.js";
@@ -802,4 +802,4 @@ export {
802
802
  readAndResetSlackReplyBindingClassifications,
803
803
  readAndResetSlackReplyTargetClassifications
804
804
  };
805
- //# sourceMappingURL=responsiveness-probe-ZOXVXDPT.js.map
805
+ //# sourceMappingURL=responsiveness-probe-WRHLHQCE.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.28.1023",
3
+ "version": "0.28.1025",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {