@integrity-labs/agt-cli 0.28.1025 → 0.28.1027

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.
@@ -39355,6 +39355,15 @@ function readBlockedPromptForBusyAck(agentDir, now = Date.now()) {
39355
39355
  if (now - t > BLOCKED_PROMPT_LIVE_WINDOW_MS) return null;
39356
39356
  return { kind };
39357
39357
  }
39358
+ function readBusyAckState(agentDir, now = Date.now()) {
39359
+ return {
39360
+ usageLimit: readUsageLimitForBusyAck(agentDir, now),
39361
+ blockedOnPrompt: readBlockedPromptForBusyAck(agentDir, now)
39362
+ };
39363
+ }
39364
+ function busyAckStateIsLive(state) {
39365
+ return Boolean(state.usageLimit || state.blockedOnPrompt);
39366
+ }
39358
39367
  function giveUpNoticeText(reason = null, resetsHint = null) {
39359
39368
  if (reason === "usage_limit") {
39360
39369
  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.";
@@ -41330,7 +41339,7 @@ async function postDirectChatNoticeMessage(sessionId, content) {
41330
41339
  return false;
41331
41340
  }
41332
41341
  }
41333
- function postDirectChatBusyAckNotice(sessionId) {
41342
+ function postDirectChatBusyAckNotice(sessionId, state) {
41334
41343
  const now = Date.now();
41335
41344
  if (!shouldPostUndeliverableNotice(lastBusyAckNoticeAt.get(sessionId), now, BUSY_ACK_NOTICE_THROTTLE_MS)) {
41336
41345
  return;
@@ -41339,10 +41348,7 @@ function postDirectChatBusyAckNotice(sessionId) {
41339
41348
  void (async () => {
41340
41349
  const ok = await postDirectChatNoticeMessage(
41341
41350
  sessionId,
41342
- busyAckNoticeText(
41343
- readUsageLimitForBusyAck(DIRECT_CHAT_CODE_NAME_AGENT_DIR),
41344
- readBlockedPromptForBusyAck(DIRECT_CHAT_CODE_NAME_AGENT_DIR)
41345
- )
41351
+ busyAckNoticeText(state.usageLimit, state.blockedOnPrompt)
41346
41352
  );
41347
41353
  if (!ok) {
41348
41354
  lastBusyAckNoticeAt.delete(sessionId);
@@ -41430,6 +41436,7 @@ function scheduleDirectChatBusyAck(sessionId, messageId, arrivedWhileBusy) {
41430
41436
  if (!marker) return;
41431
41437
  const sessionAlive = probe.tmux === "alive" && probe.claude === "alive";
41432
41438
  const pendingAgeMs = Math.max(0, Date.now() - Date.parse(marker.received_at));
41439
+ const state = readBusyAckState(DIRECT_CHAT_CODE_NAME_AGENT_DIR);
41433
41440
  if (decideBusyAck({
41434
41441
  hasTarget: Boolean(sessionId && messageId),
41435
41442
  arrivedWhileBusy,
@@ -41438,7 +41445,7 @@ function scheduleDirectChatBusyAck(sessionId, messageId, arrivedWhileBusy) {
41438
41445
  sessionAlive,
41439
41446
  paneLogFreshAgeMs,
41440
41447
  // 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)),
41448
+ liveStateMarker: busyAckStateIsLive(state),
41442
41449
  thresholdMs
41443
41450
  })) {
41444
41451
  recordChannelDeflection(DIRECT_CHAT_CODE_NAME_AGENT_DIR, "direct-chat", "busy");
@@ -41446,7 +41453,7 @@ function scheduleDirectChatBusyAck(sessionId, messageId, arrivedWhileBusy) {
41446
41453
  `direct-chat-channel(${AGT_AGENT_CODE_NAME}): [channel-deflection] cause=busy channel=direct-chat session=${sessionId}
41447
41454
  `
41448
41455
  );
41449
- postDirectChatBusyAckNotice(sessionId);
41456
+ postDirectChatBusyAckNotice(sessionId, state);
41450
41457
  return;
41451
41458
  }
41452
41459
  const cause = classifyUndeliverableCause({
@@ -40035,6 +40035,15 @@ function readBlockedPromptForBusyAck(agentDir, now = Date.now()) {
40035
40035
  if (now - t > BLOCKED_PROMPT_LIVE_WINDOW_MS) return null;
40036
40036
  return { kind };
40037
40037
  }
40038
+ function readBusyAckState(agentDir, now = Date.now()) {
40039
+ return {
40040
+ usageLimit: readUsageLimitForBusyAck(agentDir, now),
40041
+ blockedOnPrompt: readBlockedPromptForBusyAck(agentDir, now)
40042
+ };
40043
+ }
40044
+ function busyAckStateIsLive(state) {
40045
+ return Boolean(state.usageLimit || state.blockedOnPrompt);
40046
+ }
40038
40047
  function decideGiveUpNotice(input) {
40039
40048
  const maxAge = input.maxAgeMs ?? GIVE_UP_SIGNAL_MAX_AGE_MS;
40040
40049
  if (input.signalAtMs == null) return false;
@@ -45465,7 +45474,7 @@ function deleteSlackUndeliverableNotice(conversationKey) {
45465
45474
  });
45466
45475
  }
45467
45476
  var lastSlackBusyAckNoticeAt = /* @__PURE__ */ new Map();
45468
- function postBusyAckNotice(channel, threadTs, isThreadReply) {
45477
+ function postBusyAckNotice(channel, threadTs, isThreadReply, state) {
45469
45478
  if (!BOT_TOKEN || !channel) return;
45470
45479
  const now = Date.now();
45471
45480
  const conversationKey = isThreadReply && threadTs ? `${channel}:${threadTs}` : channel;
@@ -45486,10 +45495,7 @@ function postBusyAckNotice(channel, threadTs, isThreadReply) {
45486
45495
  body: JSON.stringify({
45487
45496
  channel,
45488
45497
  // ENG-10972: say RATE-LIMITED rather than "busy" when that is the truth.
45489
- text: busyAckNoticeText(
45490
- readUsageLimitForBusyAck(SLACK_AGENT_DIR),
45491
- readBlockedPromptForBusyAck(SLACK_AGENT_DIR)
45492
- ),
45498
+ text: busyAckNoticeText(state.usageLimit, state.blockedOnPrompt),
45493
45499
  ...threadTs ? { thread_ts: threadTs } : {}
45494
45500
  }),
45495
45501
  // Bound the request so a hung Slack call can't dangle to the platform
@@ -45515,6 +45521,7 @@ function scheduleBusyAck(channel, threadTs, messageTs, isThreadReply, arrivedWhi
45515
45521
  }
45516
45522
  const marker = readSlackPendingInboundMarker(channel, threadTs, messageTs);
45517
45523
  if (!marker) return;
45524
+ const state = readBusyAckState(SLACK_AGENT_DIR);
45518
45525
  const post = decideBusyAck({
45519
45526
  hasTarget: Boolean(channel && messageTs),
45520
45527
  arrivedWhileBusy,
@@ -45523,7 +45530,7 @@ function scheduleBusyAck(channel, threadTs, messageTs, isThreadReply, arrivedWhi
45523
45530
  sessionAlive: probe.tmux === "alive" && probe.claude === "alive",
45524
45531
  paneLogFreshAgeMs,
45525
45532
  // ENG-10972: a live watchdog marker stands in for pane freshness (see BusyAckInputs).
45526
- liveStateMarker: Boolean(readUsageLimitForBusyAck(SLACK_AGENT_DIR) || readBlockedPromptForBusyAck(SLACK_AGENT_DIR)),
45533
+ liveStateMarker: busyAckStateIsLive(state),
45527
45534
  thresholdMs
45528
45535
  });
45529
45536
  if (post) {
@@ -45532,7 +45539,7 @@ function scheduleBusyAck(channel, threadTs, messageTs, isThreadReply, arrivedWhi
45532
45539
  `slack-channel(${AGENT_CODE_NAME}): [channel-deflection] cause=busy channel=slack ts=${redactSlackId(messageTs)}
45533
45540
  `
45534
45541
  );
45535
- postBusyAckNotice(channel, threadTs, isThreadReply);
45542
+ postBusyAckNotice(channel, threadTs, isThreadReply, state);
45536
45543
  }
45537
45544
  }, thresholdMs);
45538
45545
  timer.unref();
@@ -42758,6 +42758,15 @@ function readBlockedPromptForBusyAck(agentDir, now = Date.now()) {
42758
42758
  if (now - t > BLOCKED_PROMPT_LIVE_WINDOW_MS) return null;
42759
42759
  return { kind };
42760
42760
  }
42761
+ function readBusyAckState(agentDir, now = Date.now()) {
42762
+ return {
42763
+ usageLimit: readUsageLimitForBusyAck(agentDir, now),
42764
+ blockedOnPrompt: readBlockedPromptForBusyAck(agentDir, now)
42765
+ };
42766
+ }
42767
+ function busyAckStateIsLive(state) {
42768
+ return Boolean(state.usageLimit || state.blockedOnPrompt);
42769
+ }
42761
42770
  function decideGiveUpNotice(input) {
42762
42771
  const maxAge = input.maxAgeMs ?? GIVE_UP_SIGNAL_MAX_AGE_MS;
42763
42772
  if (input.signalAtMs == null) return false;
@@ -43578,7 +43587,7 @@ function __resetBackOnlineNoticeThrottle() {
43578
43587
  lastBackOnlineNoticeAt.clear();
43579
43588
  }
43580
43589
  var lastBusyAckNoticeAt = /* @__PURE__ */ new Map();
43581
- function postBusyAckNotice(chatId, messageId) {
43590
+ function postBusyAckNotice(chatId, messageId, state) {
43582
43591
  const key2 = String(chatId);
43583
43592
  const now = Date.now();
43584
43593
  if (!shouldPostUndeliverableNotice(lastBusyAckNoticeAt.get(key2), now, BUSY_ACK_NOTICE_THROTTLE_MS)) {
@@ -43592,10 +43601,7 @@ function postBusyAckNotice(chatId, messageId) {
43592
43601
  {
43593
43602
  chat_id: chatId,
43594
43603
  // ENG-10972: say RATE-LIMITED rather than "busy" when that is the truth.
43595
- text: busyAckNoticeText(
43596
- readUsageLimitForBusyAck(TELEGRAM_AGENT_DIR),
43597
- readBlockedPromptForBusyAck(TELEGRAM_AGENT_DIR)
43598
- ),
43604
+ text: busyAckNoticeText(state.usageLimit, state.blockedOnPrompt),
43599
43605
  reply_to_message_id: Number(messageId),
43600
43606
  allow_sending_without_reply: true
43601
43607
  },
@@ -43631,6 +43637,7 @@ function scheduleBusyAck(chatId, messageId, arrivedWhileBusy) {
43631
43637
  }
43632
43638
  const marker = readPendingInboundMarker(chatId, messageId);
43633
43639
  if (!marker) return;
43640
+ const state = readBusyAckState(TELEGRAM_AGENT_DIR);
43634
43641
  const post = decideBusyAck({
43635
43642
  hasTarget: Boolean(chatId && messageId),
43636
43643
  arrivedWhileBusy,
@@ -43639,7 +43646,7 @@ function scheduleBusyAck(chatId, messageId, arrivedWhileBusy) {
43639
43646
  sessionAlive: probe.tmux === "alive" && probe.claude === "alive",
43640
43647
  paneLogFreshAgeMs,
43641
43648
  // ENG-10972: a live watchdog marker stands in for pane freshness (see BusyAckInputs).
43642
- liveStateMarker: Boolean(readUsageLimitForBusyAck(TELEGRAM_AGENT_DIR) || readBlockedPromptForBusyAck(TELEGRAM_AGENT_DIR)),
43649
+ liveStateMarker: busyAckStateIsLive(state),
43643
43650
  thresholdMs
43644
43651
  });
43645
43652
  if (post) {
@@ -43648,7 +43655,7 @@ function scheduleBusyAck(chatId, messageId, arrivedWhileBusy) {
43648
43655
  `telegram-channel(${AGENT_CODE_NAME}): [channel-deflection] cause=busy channel=telegram chat=${redactId(chatId)}
43649
43656
  `
43650
43657
  );
43651
- postBusyAckNotice(chatId, messageId);
43658
+ postBusyAckNotice(chatId, messageId, state);
43652
43659
  }
43653
43660
  }, thresholdMs);
43654
43661
  timer.unref();
@@ -65,9 +65,9 @@ import {
65
65
  writeDirectChatSessionState,
66
66
  writeEgressAllowlist,
67
67
  writePersistentClaudeWrapper
68
- } from "./chunk-5XPZF6FT.js";
68
+ } from "./chunk-34GFI2WX.js";
69
69
  import "./chunk-BHKFVSIX.js";
70
- import "./chunk-DHWNVVX4.js";
70
+ import "./chunk-TQDIIS3X.js";
71
71
  import "./chunk-XWVM4KPK.js";
72
72
  import "./chunk-EL5MWGGH.js";
73
73
  import "./chunk-DGUM43GV.js";
@@ -139,4 +139,4 @@ export {
139
139
  writeEgressAllowlist,
140
140
  writePersistentClaudeWrapper
141
141
  };
142
- //# sourceMappingURL=persistent-session-GZV4EXKD.js.map
142
+ //# sourceMappingURL=persistent-session-2ZBF77YE.js.map
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  paneLogPath
3
- } from "./chunk-5XPZF6FT.js";
3
+ } from "./chunk-34GFI2WX.js";
4
4
  import "./chunk-BHKFVSIX.js";
5
- import "./chunk-DHWNVVX4.js";
5
+ import "./chunk-TQDIIS3X.js";
6
6
  import "./chunk-XWVM4KPK.js";
7
7
  import "./chunk-EL5MWGGH.js";
8
8
  import "./chunk-DGUM43GV.js";
@@ -802,4 +802,4 @@ export {
802
802
  readAndResetSlackReplyBindingClassifications,
803
803
  readAndResetSlackReplyTargetClassifications
804
804
  };
805
- //# sourceMappingURL=responsiveness-probe-WRHLHQCE.js.map
805
+ //# sourceMappingURL=responsiveness-probe-M4BIZZ4G.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.28.1025",
3
+ "version": "0.28.1027",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {