@integrity-labs/agt-cli 0.28.17 → 0.28.19

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.
@@ -14222,8 +14222,9 @@ var mcp = new Server(
14222
14222
  "CRITICAL: every response to a direct-chat <channel> tag MUST go through direct_chat.reply (passing the session_id verbatim). Text in your session WITHOUT a direct_chat.reply call never reaches the operator \u2014 the reply dies inside the agent process.",
14223
14223
  'Messages from the webapp Direct Chat arrive as <channel source="direct-chat" session_id="..." user="...">.',
14224
14224
  "Reply using the direct_chat.reply tool, passing the session_id from the tag.",
14225
- "Always reply to every direct chat message \u2014 the user is waiting in the webapp.",
14226
- "In the rare case you deliberately handle a message without replying (e.g. an internal command), call direct_chat.consume with the session_id so it is not treated as undelivered and redelivered.",
14225
+ "Always reply to every direct chat message that expects a reply (its meta has requires_reply=true, or no requires_reply field) \u2014 the user is waiting in the webapp.",
14226
+ "NEVER call direct_chat.reply for a NOTICE \u2014 a notification whose meta has requires_reply=false (ENG-6381). It is an informational FYI (e.g. an integration-status update), not a question, and it has ALREADY been acknowledged for you. Replying would wrongly post into the operator\u2019s chat history and burn a turn. Just take it into account and carry on.",
14227
+ "In the rare case you deliberately handle a reply-expecting message without replying (e.g. an internal command), call direct_chat.consume with the session_id so it is not treated as undelivered and redelivered.",
14227
14228
  "Keep replies concise and helpful. You have full access to all your MCP tools."
14228
14229
  ].join(" ")
14229
14230
  }
@@ -14384,14 +14385,20 @@ async function pollForMessages(sinceMs) {
14384
14385
  });
14385
14386
  if (!res.ok) return;
14386
14387
  const data = await res.json();
14387
- for (const msg of data.messages ?? []) {
14388
- if (processedIds.has(msg.id)) continue;
14389
- processedIds.add(msg.id);
14388
+ const markProcessed = (id) => {
14389
+ processedIds.add(id);
14390
14390
  if (processedIds.size > 500) {
14391
14391
  const ids = [...processedIds];
14392
14392
  for (let i = 0; i < 250; i++) processedIds.delete(ids[i]);
14393
14393
  }
14394
- claimTracker.track(msg.session_id, msg.id);
14394
+ };
14395
+ for (const msg of data.messages ?? []) {
14396
+ if (processedIds.has(msg.id)) continue;
14397
+ const isNotice = msg.kind === "notice";
14398
+ if (!isNotice) {
14399
+ markProcessed(msg.id);
14400
+ claimTracker.track(msg.session_id, msg.id);
14401
+ }
14395
14402
  await mcp.notification({
14396
14403
  method: "notifications/claude/channel",
14397
14404
  params: {
@@ -14399,10 +14406,28 @@ async function pollForMessages(sinceMs) {
14399
14406
  meta: {
14400
14407
  session_id: msg.session_id,
14401
14408
  user: "webapp",
14402
- source: "direct-chat"
14409
+ source: "direct-chat",
14410
+ requires_reply: !isNotice
14403
14411
  }
14404
14412
  }
14405
14413
  });
14414
+ if (isNotice) {
14415
+ try {
14416
+ const res2 = await apiPost("/host/direct-chat/consume", {
14417
+ agent_id: AGT_AGENT_ID,
14418
+ session_id: msg.session_id,
14419
+ message_ids: [msg.id]
14420
+ });
14421
+ if (!res2.ok) throw new Error(`consume returned HTTP ${res2.status}`);
14422
+ markProcessed(msg.id);
14423
+ } catch (err) {
14424
+ process.stderr.write(
14425
+ `direct-chat-channel: notice push/consume failed for ${msg.id}: ${err.message} \u2014 will retry
14426
+ `
14427
+ );
14428
+ continue;
14429
+ }
14430
+ }
14406
14431
  inboundContextClient?.recordInbound({
14407
14432
  sourceIntegration: "direct-chat",
14408
14433
  sourceExternalId: msg.session_id
@@ -25,8 +25,8 @@ import {
25
25
  takeZombieDetection,
26
26
  writeDirectChatSessionState,
27
27
  writePersistentClaudeWrapper
28
- } from "./chunk-F3RMS762.js";
29
- import "./chunk-FW5TXDQC.js";
28
+ } from "./chunk-5DIMLYS5.js";
29
+ import "./chunk-6UXSC4TR.js";
30
30
  import "./chunk-XWVM4KPK.js";
31
31
  export {
32
32
  SEND_KEYS_ENTER_DELAY_MS,
@@ -56,4 +56,4 @@ export {
56
56
  writeDirectChatSessionState,
57
57
  writePersistentClaudeWrapper
58
58
  };
59
- //# sourceMappingURL=persistent-session-MIRJWKG7.js.map
59
+ //# sourceMappingURL=persistent-session-RANQKKKC.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  paneLogPath
3
- } from "./chunk-F3RMS762.js";
4
- import "./chunk-FW5TXDQC.js";
3
+ } from "./chunk-5DIMLYS5.js";
4
+ import "./chunk-6UXSC4TR.js";
5
5
  import "./chunk-XWVM4KPK.js";
6
6
 
7
7
  // src/lib/responsiveness-probe.ts
@@ -250,4 +250,4 @@ export {
250
250
  parkPendingInbound,
251
251
  readAndResetChannelDeflections
252
252
  };
253
- //# sourceMappingURL=responsiveness-probe-3G7C4AP4.js.map
253
+ //# sourceMappingURL=responsiveness-probe-KQP6MY5N.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.28.17",
3
+ "version": "0.28.19",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {