@integrity-labs/agt-cli 0.28.646 → 0.28.648

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.
Files changed (23) hide show
  1. package/dist/bin/agt.js +5 -5
  2. package/dist/{chunk-NVIFY3WZ.js → chunk-7JQQG62Z.js} +4 -4
  3. package/dist/{chunk-PJSEFPIS.js → chunk-UTNGCJLO.js} +2 -2
  4. package/dist/{chunk-3ZK66WZZ.js → chunk-WP6LYCRS.js} +13 -1
  5. package/dist/{chunk-3ZK66WZZ.js.map → chunk-WP6LYCRS.js.map} +1 -1
  6. package/dist/{claude-pair-runtime-56Z3MRYQ.js → claude-pair-runtime-XTTGSEFA.js} +2 -2
  7. package/dist/lib/manager-worker.js +16 -13
  8. package/dist/lib/manager-worker.js.map +1 -1
  9. package/dist/mcp/direct-chat-channel.js +73 -5
  10. package/dist/mcp/index.js +12 -0
  11. package/dist/mcp/origami.js +12 -0
  12. package/dist/mcp/slack-channel.js +12 -0
  13. package/dist/mcp/telegram-channel.js +12 -0
  14. package/dist/{persistent-session-KMPIHBCE.js → persistent-session-TE6CKC5R.js} +3 -3
  15. package/dist/{responsiveness-probe-24SNN4ZH.js → responsiveness-probe-BQNVH63L.js} +3 -3
  16. package/dist/{session-auth-dead-EB2WYA52.js → session-auth-dead-SZXCIJ4S.js} +2 -2
  17. package/package.json +1 -1
  18. /package/dist/{chunk-NVIFY3WZ.js.map → chunk-7JQQG62Z.js.map} +0 -0
  19. /package/dist/{chunk-PJSEFPIS.js.map → chunk-UTNGCJLO.js.map} +0 -0
  20. /package/dist/{claude-pair-runtime-56Z3MRYQ.js.map → claude-pair-runtime-XTTGSEFA.js.map} +0 -0
  21. /package/dist/{persistent-session-KMPIHBCE.js.map → persistent-session-TE6CKC5R.js.map} +0 -0
  22. /package/dist/{responsiveness-probe-24SNN4ZH.js.map → responsiveness-probe-BQNVH63L.js.map} +0 -0
  23. /package/dist/{session-auth-dead-EB2WYA52.js.map → session-auth-dead-SZXCIJ4S.js.map} +0 -0
@@ -29710,6 +29710,51 @@ async function describeFailedResponse(res) {
29710
29710
  }
29711
29711
  }
29712
29712
 
29713
+ // src/direct-chat-backlog-drain.ts
29714
+ var DEFAULT_MAX_ATTEMPTS = 6;
29715
+ var DEFAULT_BASE_DELAY_MS = 2e3;
29716
+ var MAX_DELAY_MS = 3e4;
29717
+ function backoffMs(attemptsMade, baseDelayMs = DEFAULT_BASE_DELAY_MS) {
29718
+ const raw = baseDelayMs * 2 ** (attemptsMade - 1);
29719
+ return Math.min(raw, MAX_DELAY_MS);
29720
+ }
29721
+ async function runBacklogDrain(opts) {
29722
+ const maxAttempts = opts.maxAttempts ?? DEFAULT_MAX_ATTEMPTS;
29723
+ const baseDelayMs = opts.baseDelayMs ?? DEFAULT_BASE_DELAY_MS;
29724
+ const failures = [];
29725
+ for (let attempts = 1; attempts <= maxAttempts; attempts++) {
29726
+ let result;
29727
+ try {
29728
+ result = await opts.attempt();
29729
+ } catch (err) {
29730
+ result = { ran: true, ok: false };
29731
+ opts.onLog(
29732
+ `direct-chat-channel: backlog drain attempt ${attempts}/${maxAttempts} threw \u2014 ${err.message}`
29733
+ );
29734
+ }
29735
+ if (result.ran && result.ok) {
29736
+ if (attempts > 1) {
29737
+ opts.onLog(
29738
+ `direct-chat-channel: backlog drain succeeded on attempt ${attempts}/${maxAttempts} after ${failures.join(", ")}`
29739
+ );
29740
+ }
29741
+ return { drained: true, attempts, failures };
29742
+ }
29743
+ const reason = result.ran ? "poll-failed" : "guard-skipped";
29744
+ failures.push(reason);
29745
+ opts.onLog(
29746
+ `direct-chat-channel: backlog drain attempt ${attempts}/${maxAttempts} did not complete (${reason})`
29747
+ );
29748
+ if (attempts < maxAttempts) {
29749
+ await opts.sleep(backoffMs(attempts, baseDelayMs));
29750
+ }
29751
+ }
29752
+ opts.onLog(
29753
+ `direct-chat-channel: BACKLOG DRAIN FAILED after ${maxAttempts} attempts (${failures.join(", ")}) \u2014 messages that arrived while this agent was down were NOT delivered, and the stale sweeper marks them failed 30 minutes after arrival, after which no pull can recover them`
29754
+ );
29755
+ return { drained: false, attempts: maxAttempts, failures };
29756
+ }
29757
+
29713
29758
  // src/transient-api-error.ts
29714
29759
  var CODE_KIND = {
29715
29760
  "429": "rate_limit",
@@ -31033,6 +31078,18 @@ var integration_metadata_v1_default = {
31033
31078
  agent: { $ref: "#/$defs/scopeConfig" }
31034
31079
  }
31035
31080
  },
31081
+ action_item_target: {
31082
+ type: "object",
31083
+ description: "Declares that this integration is somewhere action items can be FILED (ENG-9151). Presence is the signal; the object carries display copy. Absent means the integration is not offered as an action-item destination. Deliberately a declaration rather than something inferred from `category` or from tool names \u2014 see the resolver header in packages/api/src/lib/notes-action-item-targets.ts for why both inferences are wrong.",
31084
+ additionalProperties: true,
31085
+ properties: {
31086
+ label: {
31087
+ type: "string",
31088
+ minLength: 1,
31089
+ description: 'Short product noun as it should read mid-sentence: "create action items in Linear". Falls back to display_name when absent, which is why it exists \u2014 several definitions are named "... Pack".'
31090
+ }
31091
+ }
31092
+ },
31036
31093
  tools: {
31037
31094
  type: "array",
31038
31095
  description: "Auto-loaded MCP tool descriptors. Each entry produces one MCP tool entry per supported runtime scope.",
@@ -38388,7 +38445,7 @@ async function pollForMessages(sinceMs) {
38388
38445
  `direct-chat-channel: poll returned HTTP ${res.status} \u2014 pull skipped this tick \u2014 ${await describeFailedResponse(res)}
38389
38446
  `
38390
38447
  );
38391
- return;
38448
+ return false;
38392
38449
  }
38393
38450
  const data = await res.json();
38394
38451
  const markProcessed = (id) => {
@@ -38615,11 +38672,13 @@ async function pollForMessages(sinceMs) {
38615
38672
  });
38616
38673
  }
38617
38674
  }
38675
+ return true;
38618
38676
  } catch (err) {
38619
38677
  process.stderr.write(
38620
38678
  `direct-chat-channel: Poll error: ${err.message}
38621
38679
  `
38622
38680
  );
38681
+ return false;
38623
38682
  }
38624
38683
  }
38625
38684
  var acquiredLockPath = null;
@@ -38651,7 +38710,7 @@ var POLL_STUCK_MS = 9e4;
38651
38710
  var pollGuard = { inFlight: false, inFlightSinceMs: null };
38652
38711
  async function pollOnce(sinceMs) {
38653
38712
  const decision = evaluatePollGuard(pollGuard, Date.now(), POLL_STUCK_MS);
38654
- if (!decision.run) return;
38713
+ if (!decision.run) return { ran: false, ok: false };
38655
38714
  if (decision.stuck) {
38656
38715
  process.stderr.write(
38657
38716
  `direct-chat-channel: previous poll wedged >${POLL_STUCK_MS}ms \u2014 superseding so the pull loop self-heals
@@ -38661,7 +38720,8 @@ async function pollOnce(sinceMs) {
38661
38720
  pollGuard.inFlight = true;
38662
38721
  pollGuard.inFlightSinceMs = Date.now();
38663
38722
  try {
38664
- await pollForMessages(sinceMs);
38723
+ const ok = await pollForMessages(sinceMs);
38724
+ return { ran: true, ok };
38665
38725
  } finally {
38666
38726
  pollGuard.inFlight = false;
38667
38727
  pollGuard.inFlightSinceMs = null;
@@ -38696,10 +38756,18 @@ if (DOORBELL_ENABLED && DIRECT_CHAT_AGENT_DIR) {
38696
38756
  }, SAFETY_NET_POLL_MS);
38697
38757
  safetyNetTimer.unref?.();
38698
38758
  if (sessionState.fresh) {
38699
- void pollOnce(void 0);
38759
+ void runBacklogDrain({
38760
+ attempt: () => pollOnce(void 0),
38761
+ sleep: (ms) => new Promise((resolve) => {
38762
+ const t = setTimeout(resolve, ms);
38763
+ t.unref?.();
38764
+ }),
38765
+ onLog: (line) => process.stderr.write(`${line}
38766
+ `)
38767
+ });
38700
38768
  }
38701
38769
  process.stderr.write(
38702
- `direct-chat-channel: Started (agent=${AGT_AGENT_ID}, delivery=doorbell+pull, session=${sessionState.fresh ? "fresh\u2192backlog-drain" : "resumed\u2192new-only"}, since=${sinceMs} \u2014 watching ${DOORBELL_FILE}, safety-net ${SAFETY_NET_POLL_MS}ms)
38770
+ `direct-chat-channel: Started (agent=${AGT_AGENT_ID}, delivery=doorbell+pull, session=${sessionState.fresh ? "fresh\u2192backlog-drain (unscoped, retried)" : "resumed\u2192new-only"}, new_message_watermark_since=${sinceMs} \u2014 watching ${DOORBELL_FILE}, safety-net ${SAFETY_NET_POLL_MS}ms)
38703
38771
  `
38704
38772
  );
38705
38773
  } else {
package/dist/mcp/index.js CHANGED
@@ -38417,6 +38417,18 @@ var integration_metadata_v1_default = {
38417
38417
  agent: { $ref: "#/$defs/scopeConfig" }
38418
38418
  }
38419
38419
  },
38420
+ action_item_target: {
38421
+ type: "object",
38422
+ description: "Declares that this integration is somewhere action items can be FILED (ENG-9151). Presence is the signal; the object carries display copy. Absent means the integration is not offered as an action-item destination. Deliberately a declaration rather than something inferred from `category` or from tool names \u2014 see the resolver header in packages/api/src/lib/notes-action-item-targets.ts for why both inferences are wrong.",
38423
+ additionalProperties: true,
38424
+ properties: {
38425
+ label: {
38426
+ type: "string",
38427
+ minLength: 1,
38428
+ description: 'Short product noun as it should read mid-sentence: "create action items in Linear". Falls back to display_name when absent, which is why it exists \u2014 several definitions are named "... Pack".'
38429
+ }
38430
+ }
38431
+ },
38420
38432
  tools: {
38421
38433
  type: "array",
38422
38434
  description: "Auto-loaded MCP tool descriptors. Each entry produces one MCP tool entry per supported runtime scope.",
@@ -37115,6 +37115,18 @@ var integration_metadata_v1_default = {
37115
37115
  agent: { $ref: "#/$defs/scopeConfig" }
37116
37116
  }
37117
37117
  },
37118
+ action_item_target: {
37119
+ type: "object",
37120
+ description: "Declares that this integration is somewhere action items can be FILED (ENG-9151). Presence is the signal; the object carries display copy. Absent means the integration is not offered as an action-item destination. Deliberately a declaration rather than something inferred from `category` or from tool names \u2014 see the resolver header in packages/api/src/lib/notes-action-item-targets.ts for why both inferences are wrong.",
37121
+ additionalProperties: true,
37122
+ properties: {
37123
+ label: {
37124
+ type: "string",
37125
+ minLength: 1,
37126
+ description: 'Short product noun as it should read mid-sentence: "create action items in Linear". Falls back to display_name when absent, which is why it exists \u2014 several definitions are named "... Pack".'
37127
+ }
37128
+ }
37129
+ },
37118
37130
  tools: {
37119
37131
  type: "array",
37120
37132
  description: "Auto-loaded MCP tool descriptors. Each entry produces one MCP tool entry per supported runtime scope.",
@@ -31361,6 +31361,18 @@ var integration_metadata_v1_default = {
31361
31361
  agent: { $ref: "#/$defs/scopeConfig" }
31362
31362
  }
31363
31363
  },
31364
+ action_item_target: {
31365
+ type: "object",
31366
+ description: "Declares that this integration is somewhere action items can be FILED (ENG-9151). Presence is the signal; the object carries display copy. Absent means the integration is not offered as an action-item destination. Deliberately a declaration rather than something inferred from `category` or from tool names \u2014 see the resolver header in packages/api/src/lib/notes-action-item-targets.ts for why both inferences are wrong.",
31367
+ additionalProperties: true,
31368
+ properties: {
31369
+ label: {
31370
+ type: "string",
31371
+ minLength: 1,
31372
+ description: 'Short product noun as it should read mid-sentence: "create action items in Linear". Falls back to display_name when absent, which is why it exists \u2014 several definitions are named "... Pack".'
31373
+ }
31374
+ }
31375
+ },
31364
31376
  tools: {
31365
31377
  type: "array",
31366
31378
  description: "Auto-loaded MCP tool descriptors. Each entry produces one MCP tool entry per supported runtime scope.",
@@ -31511,6 +31511,18 @@ var integration_metadata_v1_default = {
31511
31511
  agent: { $ref: "#/$defs/scopeConfig" }
31512
31512
  }
31513
31513
  },
31514
+ action_item_target: {
31515
+ type: "object",
31516
+ description: "Declares that this integration is somewhere action items can be FILED (ENG-9151). Presence is the signal; the object carries display copy. Absent means the integration is not offered as an action-item destination. Deliberately a declaration rather than something inferred from `category` or from tool names \u2014 see the resolver header in packages/api/src/lib/notes-action-item-targets.ts for why both inferences are wrong.",
31517
+ additionalProperties: true,
31518
+ properties: {
31519
+ label: {
31520
+ type: "string",
31521
+ minLength: 1,
31522
+ description: 'Short product noun as it should read mid-sentence: "create action items in Linear". Falls back to display_name when absent, which is why it exists \u2014 several definitions are named "... Pack".'
31523
+ }
31524
+ }
31525
+ },
31514
31526
  tools: {
31515
31527
  type: "array",
31516
31528
  description: "Auto-loaded MCP tool descriptors. Each entry produces one MCP tool entry per supported runtime scope.",
@@ -43,8 +43,8 @@ import {
43
43
  writeDirectChatSessionState,
44
44
  writeEgressAllowlist,
45
45
  writePersistentClaudeWrapper
46
- } from "./chunk-PJSEFPIS.js";
47
- import "./chunk-3ZK66WZZ.js";
46
+ } from "./chunk-UTNGCJLO.js";
47
+ import "./chunk-WP6LYCRS.js";
48
48
  import "./chunk-XWVM4KPK.js";
49
49
  export {
50
50
  EGRESS_BASELINE_DOMAINS,
@@ -92,4 +92,4 @@ export {
92
92
  writeEgressAllowlist,
93
93
  writePersistentClaudeWrapper
94
94
  };
95
- //# sourceMappingURL=persistent-session-KMPIHBCE.js.map
95
+ //# sourceMappingURL=persistent-session-TE6CKC5R.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  paneLogPath
3
- } from "./chunk-PJSEFPIS.js";
4
- import "./chunk-3ZK66WZZ.js";
3
+ } from "./chunk-UTNGCJLO.js";
4
+ import "./chunk-WP6LYCRS.js";
5
5
  import "./chunk-XWVM4KPK.js";
6
6
 
7
7
  // src/lib/responsiveness-probe.ts
@@ -727,4 +727,4 @@ export {
727
727
  readAndResetSlackReplyBindingClassifications,
728
728
  readAndResetSlackReplyTargetClassifications
729
729
  };
730
- //# sourceMappingURL=responsiveness-probe-24SNN4ZH.js.map
730
+ //# sourceMappingURL=responsiveness-probe-BQNVH63L.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  sessionTranscriptDir
3
- } from "./chunk-3ZK66WZZ.js";
3
+ } from "./chunk-WP6LYCRS.js";
4
4
 
5
5
  // src/lib/session-auth-dead.ts
6
6
  import { closeSync, openSync, readSync, readdirSync, statSync } from "fs";
@@ -203,4 +203,4 @@ export {
203
203
  decideSessionAuthState,
204
204
  probeSessionAuth
205
205
  };
206
- //# sourceMappingURL=session-auth-dead-EB2WYA52.js.map
206
+ //# sourceMappingURL=session-auth-dead-SZXCIJ4S.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.28.646",
3
+ "version": "0.28.648",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {