@integrity-labs/agt-cli 0.28.647 → 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.
@@ -100,7 +100,7 @@ async function spawnPairSession(session) {
100
100
  return { ok: true };
101
101
  } catch {
102
102
  }
103
- const { resolveClaudeBinary } = await import("./persistent-session-KMPIHBCE.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-TE6CKC5R.js");
104
104
  const claudeBin = resolveClaudeBinary();
105
105
  const pairEnv = {
106
106
  ...process.env,
@@ -373,4 +373,4 @@ export {
373
373
  startClaudePair,
374
374
  submitClaudePairCode
375
375
  };
376
- //# sourceMappingURL=claude-pair-runtime-56Z3MRYQ.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-XTTGSEFA.js.map
@@ -55,7 +55,7 @@ import {
55
55
  safeWriteJsonAtomic,
56
56
  setConfigHash,
57
57
  tripClass
58
- } from "../chunk-3WJXUNQH.js";
58
+ } from "../chunk-7JQQG62Z.js";
59
59
  import {
60
60
  getProjectDir as getProjectDir2,
61
61
  getReadyTasks,
@@ -111,7 +111,7 @@ import {
111
111
  takeZombieDetection,
112
112
  toOpencodeModel,
113
113
  writeEgressAllowlist
114
- } from "../chunk-PJSEFPIS.js";
114
+ } from "../chunk-UTNGCJLO.js";
115
115
  import {
116
116
  ACCOUNT_ENFORCEMENT_MARKER_FILENAME,
117
117
  AnchorSessionClient,
@@ -192,7 +192,7 @@ import {
192
192
  subagentActivityAgeSeconds,
193
193
  sumTranscriptUsageInWindow,
194
194
  transcriptActivityAgeSeconds
195
- } from "../chunk-3ZK66WZZ.js";
195
+ } from "../chunk-WP6LYCRS.js";
196
196
  import {
197
197
  reapOrphanChannelMcps
198
198
  } from "../chunk-XWVM4KPK.js";
@@ -11607,7 +11607,7 @@ var pendingDayRolloverReset = /* @__PURE__ */ new Set();
11607
11607
  var dayRolloverInboundHold = /* @__PURE__ */ new Map();
11608
11608
  var INBOUND_HOLD_EPISODE_GAP_MS = 12e4;
11609
11609
  async function channelInboundActivityAgeSecondsFor(codeName) {
11610
- const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-24SNN4ZH.js");
11610
+ const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-BQNVH63L.js");
11611
11611
  const newest = newestPendingInboundActivityMtimeMs(dirname10(paneLogPath(codeName)));
11612
11612
  if (newest === null) return null;
11613
11613
  return Math.max(0, Math.floor((Date.now() - newest) / 1e3));
@@ -12250,7 +12250,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
12250
12250
  var lastVersionCheckAt = 0;
12251
12251
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
12252
12252
  var lastResponsivenessProbeAt = 0;
12253
- var agtCliVersion = true ? "0.28.647" : "dev";
12253
+ var agtCliVersion = true ? "0.28.648" : "dev";
12254
12254
  function resolveBrewPath(execFileSync3) {
12255
12255
  try {
12256
12256
  const out = execFileSync3("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -13558,7 +13558,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
13558
13558
  if (codeNames.length === 0) return;
13559
13559
  void (async () => {
13560
13560
  try {
13561
- const { collectDiagnostics } = await import("../persistent-session-KMPIHBCE.js");
13561
+ const { collectDiagnostics } = await import("../persistent-session-TE6CKC5R.js");
13562
13562
  await api.post("/host/heartbeat", {
13563
13563
  host_id: hostId,
13564
13564
  agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor)
@@ -13674,7 +13674,7 @@ async function pollCycleInner() {
13674
13674
  }
13675
13675
  try {
13676
13676
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
13677
- const { collectDiagnostics } = await import("../persistent-session-KMPIHBCE.js");
13677
+ const { collectDiagnostics } = await import("../persistent-session-TE6CKC5R.js");
13678
13678
  const diagCodeNames = [...agentState.persistentSessionAgents];
13679
13679
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor) : void 0;
13680
13680
  let tailscaleHostname;
@@ -13797,7 +13797,7 @@ async function pollCycleInner() {
13797
13797
  collectPanelessActivityProbes,
13798
13798
  getResponsivenessIntervalMs,
13799
13799
  occupancyQualificationClassifications
13800
- } = await import("../responsiveness-probe-24SNN4ZH.js");
13800
+ } = await import("../responsiveness-probe-BQNVH63L.js");
13801
13801
  const probeIntervalMs = getResponsivenessIntervalMs();
13802
13802
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
13803
13803
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -13907,7 +13907,7 @@ async function pollCycleInner() {
13907
13907
  collectResponsivenessProbes,
13908
13908
  livePendingInboundOldestAgeSeconds,
13909
13909
  parkPendingInbound
13910
- } = await import("../responsiveness-probe-24SNN4ZH.js");
13910
+ } = await import("../responsiveness-probe-BQNVH63L.js");
13911
13911
  const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-NDP36U7O.js");
13912
13912
  const wedgeNow = /* @__PURE__ */ new Date();
13913
13913
  const liveAgents = agentState.persistentSessionAgents;
@@ -14063,7 +14063,7 @@ async function pollCycleInner() {
14063
14063
  }
14064
14064
  try {
14065
14065
  const { scrapeMcpFailedBannerCount } = await import("../pane-mcp-banner-scraper-JA437JIB.js");
14066
- const { probeSessionAuth } = await import("../session-auth-dead-EB2WYA52.js");
14066
+ const { probeSessionAuth } = await import("../session-auth-dead-SZXCIJ4S.js");
14067
14067
  const observations = [];
14068
14068
  const pendingCacheCommits = [];
14069
14069
  const modelApiErrorReportingOn = hostFlagStore().getBoolean("model-api-error-reporting");
@@ -17696,7 +17696,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
17696
17696
  void api.post("/host/restart-ack", { host_id: hostId, agent_id: agentId, restart_requested_at: requestedAt }).catch((err) => log(`[restart-lane] ack failed for '${codeName}': ${err.message}`));
17697
17697
  void (async () => {
17698
17698
  try {
17699
- const { collectDiagnostics } = await import("../persistent-session-KMPIHBCE.js");
17699
+ const { collectDiagnostics } = await import("../persistent-session-TE6CKC5R.js");
17700
17700
  await api.post("/host/heartbeat", {
17701
17701
  host_id: hostId,
17702
17702
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor)
@@ -17747,7 +17747,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
17747
17747
  }
17748
17748
  try {
17749
17749
  const hostId = await getHostId();
17750
- const { collectDiagnostics } = await import("../persistent-session-KMPIHBCE.js");
17750
+ const { collectDiagnostics } = await import("../persistent-session-TE6CKC5R.js");
17751
17751
  await api.post("/host/heartbeat", {
17752
17752
  host_id: hostId,
17753
17753
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor)
@@ -18344,7 +18344,7 @@ async function processClaudePairSessions(agents) {
18344
18344
  killPairSession,
18345
18345
  pairTmuxSession,
18346
18346
  finalizeClaudePairOnboarding
18347
- } = await import("../claude-pair-runtime-56Z3MRYQ.js");
18347
+ } = await import("../claude-pair-runtime-XTTGSEFA.js");
18348
18348
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
18349
18349
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
18350
18350
  const killed = await killPairSession(pairTmuxSession(pairId));
@@ -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.647",
3
+ "version": "0.28.648",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {