@integrity-labs/agt-cli 0.28.1209 → 0.28.1210

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 (28) hide show
  1. package/dist/bin/agt.js +6 -6
  2. package/dist/{chunk-QPNZGRNJ.js → chunk-6TXC2YC3.js} +2 -2
  3. package/dist/{chunk-WSJULPTE.js → chunk-EOMFINJP.js} +5 -5
  4. package/dist/{chunk-IXMHJ3GU.js → chunk-JM4J6GYJ.js} +18 -1
  5. package/dist/{chunk-IXMHJ3GU.js.map → chunk-JM4J6GYJ.js.map} +1 -1
  6. package/dist/{chunk-EV2TOTKT.js → chunk-PTWO2LSN.js} +2 -2
  7. package/dist/{chunk-BWIPB6CR.js → chunk-REX6HMS6.js} +3 -3
  8. package/dist/{claude-code-updater-5Z43CR4N.js → claude-code-updater-RC3TT5TZ.js} +3 -3
  9. package/dist/{claude-pair-runtime-EGFTJSNS.js → claude-pair-runtime-OVWGDMWK.js} +3 -3
  10. package/dist/lib/manager-worker.js +19 -19
  11. package/dist/mcp/direct-chat-channel.js +17 -0
  12. package/dist/mcp/index.js +17 -0
  13. package/dist/mcp/origami.js +17 -0
  14. package/dist/mcp/slack-channel.js +180 -0
  15. package/dist/mcp/telegram-channel.js +17 -0
  16. package/dist/{persistent-session-NEKCQLFH.js → persistent-session-UJBNO5IF.js} +4 -4
  17. package/dist/{responsiveness-probe-4VILKGY6.js → responsiveness-probe-6BELVQ42.js} +4 -4
  18. package/dist/{session-auth-dead-UZGQIMDK.js → session-auth-dead-RLOWHZ3T.js} +3 -3
  19. package/package.json +1 -1
  20. /package/dist/{chunk-QPNZGRNJ.js.map → chunk-6TXC2YC3.js.map} +0 -0
  21. /package/dist/{chunk-WSJULPTE.js.map → chunk-EOMFINJP.js.map} +0 -0
  22. /package/dist/{chunk-EV2TOTKT.js.map → chunk-PTWO2LSN.js.map} +0 -0
  23. /package/dist/{chunk-BWIPB6CR.js.map → chunk-REX6HMS6.js.map} +0 -0
  24. /package/dist/{claude-code-updater-5Z43CR4N.js.map → claude-code-updater-RC3TT5TZ.js.map} +0 -0
  25. /package/dist/{claude-pair-runtime-EGFTJSNS.js.map → claude-pair-runtime-OVWGDMWK.js.map} +0 -0
  26. /package/dist/{persistent-session-NEKCQLFH.js.map → persistent-session-UJBNO5IF.js.map} +0 -0
  27. /package/dist/{responsiveness-probe-4VILKGY6.js.map → responsiveness-probe-6BELVQ42.js.map} +0 -0
  28. /package/dist/{session-auth-dead-UZGQIMDK.js.map → session-auth-dead-RLOWHZ3T.js.map} +0 -0
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-XWVM4KPK.js";
5
5
  import {
6
6
  FORCED_UPDATE_HARD_DEADLINE_MS
7
- } from "./chunk-IXMHJ3GU.js";
7
+ } from "./chunk-JM4J6GYJ.js";
8
8
  import {
9
9
  effectiveClaudeJsonPath
10
10
  } from "./chunk-AIUIMEUS.js";
@@ -722,4 +722,4 @@ export {
722
722
  probeClaudeInstalls,
723
723
  maybeUpdateClaudeCode
724
724
  };
725
- //# sourceMappingURL=chunk-EV2TOTKT.js.map
725
+ //# sourceMappingURL=chunk-PTWO2LSN.js.map
@@ -4,7 +4,7 @@ import {
4
4
  rotateDailySession,
5
5
  sessionFileExists,
6
6
  todayLocalIso
7
- } from "./chunk-QPNZGRNJ.js";
7
+ } from "./chunk-6TXC2YC3.js";
8
8
  import {
9
9
  classifyUnanswerablePane,
10
10
  customApiKeyDialogKeys,
@@ -51,7 +51,7 @@ import {
51
51
  remoteMcpConnectionEnvInfix,
52
52
  remoteMcpConnectionLabel,
53
53
  remoteMcpConnectionScopedEnvVar
54
- } from "./chunk-IXMHJ3GU.js";
54
+ } from "./chunk-JM4J6GYJ.js";
55
55
  import {
56
56
  CLAUDE_CONFIG_DIR_ENV,
57
57
  approveApiKeyInClaudeConfig,
@@ -6173,4 +6173,4 @@ export {
6173
6173
  stopAllSessionsAndWait,
6174
6174
  getProjectDir
6175
6175
  };
6176
- //# sourceMappingURL=chunk-BWIPB6CR.js.map
6176
+ //# sourceMappingURL=chunk-REX6HMS6.js.map
@@ -13,9 +13,9 @@ import {
13
13
  probeClaudeInstalls,
14
14
  readsAsNativeInstall,
15
15
  shouldRunClaudeCodeUpdater
16
- } from "./chunk-EV2TOTKT.js";
16
+ } from "./chunk-PTWO2LSN.js";
17
17
  import "./chunk-XWVM4KPK.js";
18
- import "./chunk-IXMHJ3GU.js";
18
+ import "./chunk-JM4J6GYJ.js";
19
19
  import "./chunk-AIUIMEUS.js";
20
20
  import "./chunk-DGUM43GV.js";
21
21
  export {
@@ -34,4 +34,4 @@ export {
34
34
  readsAsNativeInstall,
35
35
  shouldRunClaudeCodeUpdater
36
36
  };
37
- //# sourceMappingURL=claude-code-updater-5Z43CR4N.js.map
37
+ //# sourceMappingURL=claude-code-updater-RC3TT5TZ.js.map
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  redactPaneFrame,
10
10
  sanitizeTerminalFrame
11
- } from "./chunk-IXMHJ3GU.js";
11
+ } from "./chunk-JM4J6GYJ.js";
12
12
  import {
13
13
  CLAUDE_CONFIG_DIR_ENV,
14
14
  claudeConfigDirFor,
@@ -321,7 +321,7 @@ async function spawnPairSession(session) {
321
321
  return { ok: true };
322
322
  } catch {
323
323
  }
324
- const { resolveClaudeBinary } = await import("./persistent-session-NEKCQLFH.js");
324
+ const { resolveClaudeBinary } = await import("./persistent-session-UJBNO5IF.js");
325
325
  const claudeBin = resolveClaudeBinary();
326
326
  const pairEnv = {
327
327
  ...process.env,
@@ -836,4 +836,4 @@ export {
836
836
  startClaudePair,
837
837
  submitClaudePairCode
838
838
  };
839
- //# sourceMappingURL=claude-pair-runtime-EGFTJSNS.js.map
839
+ //# sourceMappingURL=claude-pair-runtime-OVWGDMWK.js.map
@@ -85,7 +85,7 @@ import {
85
85
  tripClass,
86
86
  writeEtcEnvironment,
87
87
  writeProfileDScript
88
- } from "../chunk-WSJULPTE.js";
88
+ } from "../chunk-EOMFINJP.js";
89
89
  import {
90
90
  CLAUDE_CODE_SECURITY_FLOOR,
91
91
  SELF_UPDATE_TIMEOUTS,
@@ -99,7 +99,7 @@ import {
99
99
  runSafeCleanup,
100
100
  tightestDiskStat,
101
101
  withPackageCacheLock
102
- } from "../chunk-EV2TOTKT.js";
102
+ } from "../chunk-PTWO2LSN.js";
103
103
  import {
104
104
  rewriteSupervisorApiKey,
105
105
  supervisorChannelsRefusing
@@ -192,7 +192,7 @@ import {
192
192
  webFetchBaselineValue,
193
193
  webFetchRestartNeeded,
194
194
  writeEgressAllowlist
195
- } from "../chunk-BWIPB6CR.js";
195
+ } from "../chunk-REX6HMS6.js";
196
196
  import {
197
197
  isAgentIdle,
198
198
  isStaleForToday,
@@ -202,7 +202,7 @@ import {
202
202
  sessionTranscriptDir,
203
203
  subagentActivityAgeSeconds,
204
204
  transcriptActivityAgeSeconds
205
- } from "../chunk-QPNZGRNJ.js";
205
+ } from "../chunk-6TXC2YC3.js";
206
206
  import {
207
207
  classifyUnanswerablePane,
208
208
  focusedConfirmDialogBlock,
@@ -330,7 +330,7 @@ import {
330
330
  stabiliseResetInstant,
331
331
  sumTranscriptUsageInWindow,
332
332
  summarizeTranscriptActivity
333
- } from "../chunk-IXMHJ3GU.js";
333
+ } from "../chunk-JM4J6GYJ.js";
334
334
  import {
335
335
  CLAUDE_CONFIG_DIR_ENV,
336
336
  claudeConfigDirFor,
@@ -15650,7 +15650,7 @@ var pendingDayRolloverReset = /* @__PURE__ */ new Set();
15650
15650
  var dayRolloverInboundHold = /* @__PURE__ */ new Map();
15651
15651
  var INBOUND_HOLD_EPISODE_GAP_MS = 12e4;
15652
15652
  async function channelInboundActivityAgeSecondsFor(codeName) {
15653
- const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-4VILKGY6.js");
15653
+ const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-6BELVQ42.js");
15654
15654
  const newest = newestPendingInboundActivityMtimeMs(dirname11(paneLogPath(codeName)));
15655
15655
  if (newest === null) return null;
15656
15656
  return Math.max(0, Math.floor((Date.now() - newest) / 1e3));
@@ -16447,7 +16447,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
16447
16447
  var lastVersionCheckAt = 0;
16448
16448
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
16449
16449
  var lastResponsivenessProbeAt = 0;
16450
- var agtCliVersion = true ? "0.28.1209" : "dev";
16450
+ var agtCliVersion = true ? "0.28.1210" : "dev";
16451
16451
  function resolveBrewPath(execFileSync3) {
16452
16452
  try {
16453
16453
  const out = execFileSync3("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -18351,7 +18351,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
18351
18351
  if (codeNames.length === 0) return;
18352
18352
  void (async () => {
18353
18353
  try {
18354
- const { collectDiagnostics } = await import("../persistent-session-NEKCQLFH.js");
18354
+ const { collectDiagnostics } = await import("../persistent-session-UJBNO5IF.js");
18355
18355
  await api.post("/host/heartbeat", {
18356
18356
  host_id: hostId,
18357
18357
  agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor, sessionActivityFor)
@@ -18494,7 +18494,7 @@ async function pollCycleInner() {
18494
18494
  }
18495
18495
  try {
18496
18496
  const { detectHostSecurity } = await import("../host-security-KQYYZZVW.js");
18497
- const { collectDiagnostics } = await import("../persistent-session-NEKCQLFH.js");
18497
+ const { collectDiagnostics } = await import("../persistent-session-UJBNO5IF.js");
18498
18498
  const diagCodeNames = [...agentState.persistentSessionAgents];
18499
18499
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor, sessionActivityFor) : void 0;
18500
18500
  let tailscaleHostname;
@@ -18752,7 +18752,7 @@ async function pollCycleInner() {
18752
18752
  }
18753
18753
  try {
18754
18754
  const desiredClaudeCodeVersion = hbResp?.desired_claude_code_version?.trim();
18755
- const { maybeUpdateClaudeCode, shouldRunClaudeCodeUpdater } = await import("../claude-code-updater-5Z43CR4N.js");
18755
+ const { maybeUpdateClaudeCode, shouldRunClaudeCodeUpdater } = await import("../claude-code-updater-RC3TT5TZ.js");
18756
18756
  const securityFloor = currentSecurityFloor();
18757
18757
  claudeUpdaterInFlight = true;
18758
18758
  if (desiredClaudeCodeVersion && (claudePairLoop.busy || claudePairingInProgress())) {
@@ -18787,7 +18787,7 @@ async function pollCycleInner() {
18787
18787
  collectPanelessActivityProbes,
18788
18788
  getResponsivenessIntervalMs,
18789
18789
  occupancyQualificationClassifications
18790
- } = await import("../responsiveness-probe-4VILKGY6.js");
18790
+ } = await import("../responsiveness-probe-6BELVQ42.js");
18791
18791
  const probeIntervalMs = getResponsivenessIntervalMs();
18792
18792
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
18793
18793
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -18904,7 +18904,7 @@ async function pollCycleInner() {
18904
18904
  collectResponsivenessProbes,
18905
18905
  livePendingInboundOldestAgeSeconds,
18906
18906
  parkPendingInbound
18907
- } = await import("../responsiveness-probe-4VILKGY6.js");
18907
+ } = await import("../responsiveness-probe-6BELVQ42.js");
18908
18908
  const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-M6AFZWNU.js");
18909
18909
  const wedgeNow = /* @__PURE__ */ new Date();
18910
18910
  const liveAgents = agentState.persistentSessionAgents;
@@ -19190,7 +19190,7 @@ async function pollCycleInner() {
19190
19190
  }
19191
19191
  }
19192
19192
  );
19193
- const { parkPendingInbound } = await import("../responsiveness-probe-4VILKGY6.js");
19193
+ const { parkPendingInbound } = await import("../responsiveness-probe-6BELVQ42.js");
19194
19194
  const { parked, deadLettered } = parkPendingInbound(codeName, new Date(fatalNowMs));
19195
19195
  paneFatalStreak.delete(codeName);
19196
19196
  paneFatalRestarts.set(codeName, [...history, fatalNowMs]);
@@ -19221,7 +19221,7 @@ async function pollCycleInner() {
19221
19221
  TRANSCRIPT_MOUNT_ESCALATION_REFRESH_MS,
19222
19222
  bindSourceEscalations
19223
19223
  } = await import("../transcript-mount-health-OHE6IVJV.js");
19224
- const { transcriptBindSourcesFor, ensureTranscriptBindSources } = await import("../persistent-session-NEKCQLFH.js");
19224
+ const { transcriptBindSourcesFor, ensureTranscriptBindSources } = await import("../persistent-session-UJBNO5IF.js");
19225
19225
  const mountConfig = resolveTranscriptMountConfig();
19226
19226
  const liveAgents = agentState.persistentSessionAgents;
19227
19227
  for (const tracked of [
@@ -19386,7 +19386,7 @@ async function pollCycleInner() {
19386
19386
  }
19387
19387
  try {
19388
19388
  const { scrapeMcpFailedBannerCount } = await import("../pane-mcp-banner-scraper-VR5QGP3J.js");
19389
- const { probeSessionAuth } = await import("../session-auth-dead-UZGQIMDK.js");
19389
+ const { probeSessionAuth } = await import("../session-auth-dead-RLOWHZ3T.js");
19390
19390
  const observations = [];
19391
19391
  const pendingCacheCommits = [];
19392
19392
  const modelApiErrorReportingOn = hostFlagStore().getBoolean("model-api-error-reporting");
@@ -24116,7 +24116,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
24116
24116
  try {
24117
24117
  const freshId = rotateSessionForWedge(codeName);
24118
24118
  consecutiveWedgeCycles.delete(codeName);
24119
- const { parkPendingInbound: parkForRestart } = await import("../responsiveness-probe-4VILKGY6.js");
24119
+ const { parkPendingInbound: parkForRestart } = await import("../responsiveness-probe-6BELVQ42.js");
24120
24120
  const { parked, deadLettered } = parkForRestart(codeName, /* @__PURE__ */ new Date());
24121
24121
  const parkNote = parked > 0 ? `, ${parked} inbound parked` : "";
24122
24122
  const deadNote = deadLettered > 0 ? `, ${deadLettered} undeliverable dead-lettered` : "";
@@ -24159,7 +24159,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
24159
24159
  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}`));
24160
24160
  void (async () => {
24161
24161
  try {
24162
- const { collectDiagnostics } = await import("../persistent-session-NEKCQLFH.js");
24162
+ const { collectDiagnostics } = await import("../persistent-session-UJBNO5IF.js");
24163
24163
  await api.post("/host/heartbeat", {
24164
24164
  host_id: hostId,
24165
24165
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor, sessionActivityFor)
@@ -24210,7 +24210,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
24210
24210
  }
24211
24211
  try {
24212
24212
  const hostId = await getHostId();
24213
- const { collectDiagnostics } = await import("../persistent-session-NEKCQLFH.js");
24213
+ const { collectDiagnostics } = await import("../persistent-session-UJBNO5IF.js");
24214
24214
  await api.post("/host/heartbeat", {
24215
24215
  host_id: hostId,
24216
24216
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor, sessionActivityFor)
@@ -24912,7 +24912,7 @@ async function processClaudePairSessions(agents) {
24912
24912
  snapshotPairConfig,
24913
24913
  // ENG-11659: result -> report body + the manager.log line that records it.
24914
24914
  planPairStartReport
24915
- } = await import("../claude-pair-runtime-EGFTJSNS.js");
24915
+ } = await import("../claude-pair-runtime-OVWGDMWK.js");
24916
24916
  const { resetClaudeSignin, describeSigninResetForLog, describeSigninResetFailure } = await import("../claude-signin-reset-6IJMMVYG.js");
24917
24917
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
24918
24918
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
@@ -44818,6 +44818,23 @@ var FLAG_REGISTRY = [
44818
44818
  // change (ADR-0022 sensitive-flag confirm).
44819
44819
  sensitive: true
44820
44820
  },
44821
+ {
44822
+ key: "ghost-reply-narration-guard",
44823
+ description: "Model-free guard on the SLACK ghost-reply RECOVERY path (CS-1821, CS-1429, ENG-7780); Telegram and Teams recovery do not run it. Recovered end-of-turn text with no second person, question, link or mention, that uses stand-down wording or names the person being answered in the third person, is not published. enforce = keep the marker so the inbound is re-delivered and the agent can answer properly. When re-deliveries run out, stand-down wording closes unposted and a name-only match publishes; with no reply owed, either closes. shadow = log only. off = never runs. A false match usually costs a re-ask; a real reply using stand-down wording every time is lost.",
44824
+ flagType: "enum",
44825
+ allowedValues: ["off", "shadow", "enforce"],
44826
+ // Ships in SHADOW: a free local log line, like every enum flag here, enforce is a
44827
+ // deliberate flip. Read the match log before flipping: a false match usually costs
44828
+ // a re-ask, but one repeated on every re-delivery loses the reply.
44829
+ defaultValue: "shadow",
44830
+ envVar: "AGT_GHOST_REPLY_NARRATION_GUARD_MODE",
44831
+ sensitive: true,
44832
+ // DELIBERATE UNREACHABLE PLACEHOLDER, not a real threshold. The reader is host-side
44833
+ // (the channel MCP), so a host on an older agt-cli ignores this flag. Replace it with
44834
+ // the first published agt-cli carrying the reader before flipping to enforce. Same
44835
+ // convention as `github-broker-credentials`.
44836
+ since: "0.29.0"
44837
+ },
44821
44838
  {
44822
44839
  key: "slack-scheduled-channel-guard",
44823
44840
  description: 'Guard on slack.reply that refuses to let an active scheduled-task destination silently move a reply to a DIFFERENT channel than the agent named (ENG-8137). CS-1505 gave an explicit inbound_id priority over the task destination but left the no-inbound_id case treating "no inbound reference" as "no destination specified" - and `channel` is a REQUIRED argument, so every call names one. The symptom: a question asked in one channel answered in another, and a reply meant as a DM landing in a public channel. Fires only when the marker carries an EXPLICIT target, the named channel differs from it, and neither an inbound_id, an enforce binding, nor an ENG-7542 channel correction is available to arbitrate. off = never runs (today behaviour: silent retarget). shadow = count + log the would-block but STILL route as today, so the false-positive rate is measurable before anyone refuses a send. enforce = block the reply and tell the agent to retry. Read live from the heartbeat flags-cache (or the env override). NOTE: enforce is currently CLAMPED to shadow host-side and setting it here will not take effect - it stays blocked until ENG-8142 teaches the Stop hook to tell a refused reply from a delivered one, because until then a blocked send fails silently (no recovery, no re-prompt, nothing in the channel). Lifting the clamp is a code change, not a flag flip.',
package/dist/mcp/index.js CHANGED
@@ -30484,6 +30484,23 @@ var FLAG_REGISTRY = [
30484
30484
  // change (ADR-0022 sensitive-flag confirm).
30485
30485
  sensitive: true
30486
30486
  },
30487
+ {
30488
+ key: "ghost-reply-narration-guard",
30489
+ description: "Model-free guard on the SLACK ghost-reply RECOVERY path (CS-1821, CS-1429, ENG-7780); Telegram and Teams recovery do not run it. Recovered end-of-turn text with no second person, question, link or mention, that uses stand-down wording or names the person being answered in the third person, is not published. enforce = keep the marker so the inbound is re-delivered and the agent can answer properly. When re-deliveries run out, stand-down wording closes unposted and a name-only match publishes; with no reply owed, either closes. shadow = log only. off = never runs. A false match usually costs a re-ask; a real reply using stand-down wording every time is lost.",
30490
+ flagType: "enum",
30491
+ allowedValues: ["off", "shadow", "enforce"],
30492
+ // Ships in SHADOW: a free local log line, like every enum flag here, enforce is a
30493
+ // deliberate flip. Read the match log before flipping: a false match usually costs
30494
+ // a re-ask, but one repeated on every re-delivery loses the reply.
30495
+ defaultValue: "shadow",
30496
+ envVar: "AGT_GHOST_REPLY_NARRATION_GUARD_MODE",
30497
+ sensitive: true,
30498
+ // DELIBERATE UNREACHABLE PLACEHOLDER, not a real threshold. The reader is host-side
30499
+ // (the channel MCP), so a host on an older agt-cli ignores this flag. Replace it with
30500
+ // the first published agt-cli carrying the reader before flipping to enforce. Same
30501
+ // convention as `github-broker-credentials`.
30502
+ since: "0.29.0"
30503
+ },
30487
30504
  {
30488
30505
  key: "slack-scheduled-channel-guard",
30489
30506
  description: 'Guard on slack.reply that refuses to let an active scheduled-task destination silently move a reply to a DIFFERENT channel than the agent named (ENG-8137). CS-1505 gave an explicit inbound_id priority over the task destination but left the no-inbound_id case treating "no inbound reference" as "no destination specified" - and `channel` is a REQUIRED argument, so every call names one. The symptom: a question asked in one channel answered in another, and a reply meant as a DM landing in a public channel. Fires only when the marker carries an EXPLICIT target, the named channel differs from it, and neither an inbound_id, an enforce binding, nor an ENG-7542 channel correction is available to arbitrate. off = never runs (today behaviour: silent retarget). shadow = count + log the would-block but STILL route as today, so the false-positive rate is measurable before anyone refuses a send. enforce = block the reply and tell the agent to retry. Read live from the heartbeat flags-cache (or the env override). NOTE: enforce is currently CLAMPED to shadow host-side and setting it here will not take effect - it stays blocked until ENG-8142 teaches the Stop hook to tell a refused reply from a delivered one, because until then a blocked send fails silently (no recovery, no re-prompt, nothing in the channel). Lifting the clamp is a code change, not a flag flip.',
@@ -44324,6 +44324,23 @@ var FLAG_REGISTRY = [
44324
44324
  // change (ADR-0022 sensitive-flag confirm).
44325
44325
  sensitive: true
44326
44326
  },
44327
+ {
44328
+ key: "ghost-reply-narration-guard",
44329
+ description: "Model-free guard on the SLACK ghost-reply RECOVERY path (CS-1821, CS-1429, ENG-7780); Telegram and Teams recovery do not run it. Recovered end-of-turn text with no second person, question, link or mention, that uses stand-down wording or names the person being answered in the third person, is not published. enforce = keep the marker so the inbound is re-delivered and the agent can answer properly. When re-deliveries run out, stand-down wording closes unposted and a name-only match publishes; with no reply owed, either closes. shadow = log only. off = never runs. A false match usually costs a re-ask; a real reply using stand-down wording every time is lost.",
44330
+ flagType: "enum",
44331
+ allowedValues: ["off", "shadow", "enforce"],
44332
+ // Ships in SHADOW: a free local log line, like every enum flag here, enforce is a
44333
+ // deliberate flip. Read the match log before flipping: a false match usually costs
44334
+ // a re-ask, but one repeated on every re-delivery loses the reply.
44335
+ defaultValue: "shadow",
44336
+ envVar: "AGT_GHOST_REPLY_NARRATION_GUARD_MODE",
44337
+ sensitive: true,
44338
+ // DELIBERATE UNREACHABLE PLACEHOLDER, not a real threshold. The reader is host-side
44339
+ // (the channel MCP), so a host on an older agt-cli ignores this flag. Replace it with
44340
+ // the first published agt-cli carrying the reader before flipping to enforce. Same
44341
+ // convention as `github-broker-credentials`.
44342
+ since: "0.29.0"
44343
+ },
44327
44344
  {
44328
44345
  key: "slack-scheduled-channel-guard",
44329
44346
  description: 'Guard on slack.reply that refuses to let an active scheduled-task destination silently move a reply to a DIFFERENT channel than the agent named (ENG-8137). CS-1505 gave an explicit inbound_id priority over the task destination but left the no-inbound_id case treating "no inbound reference" as "no destination specified" - and `channel` is a REQUIRED argument, so every call names one. The symptom: a question asked in one channel answered in another, and a reply meant as a DM landing in a public channel. Fires only when the marker carries an EXPLICIT target, the named channel differs from it, and neither an inbound_id, an enforce binding, nor an ENG-7542 channel correction is available to arbitrate. off = never runs (today behaviour: silent retarget). shadow = count + log the would-block but STILL route as today, so the false-positive rate is measurable before anyone refuses a send. enforce = block the reply and tell the agent to retry. Read live from the heartbeat flags-cache (or the env override). NOTE: enforce is currently CLAMPED to shadow host-side and setting it here will not take effect - it stays blocked until ENG-8142 teaches the Stop hook to tell a refused reply from a delivered one, because until then a blocked send fails silently (no recovery, no re-prompt, nothing in the channel). Lifting the clamp is a code change, not a flag flip.',
@@ -30836,6 +30836,26 @@ function resolveGhostReplyMode(opts) {
30836
30836
  if (cached2 !== void 0) return cached2;
30837
30837
  return "off";
30838
30838
  }
30839
+ var GHOST_REPLY_NARRATION_GUARD_FLAG_KEY = "ghost-reply-narration-guard";
30840
+ function resolveGhostReplyNarrationGuardMode(opts) {
30841
+ const env2 = opts?.env ?? process.env;
30842
+ const parse3 = (raw) => {
30843
+ const v = typeof raw === "string" ? raw.trim().toLowerCase() : "";
30844
+ return v === "off" || v === "shadow" || v === "enforce" ? v : void 0;
30845
+ };
30846
+ const override = parse3(env2["AGT_GHOST_REPLY_NARRATION_GUARD_MODE"]);
30847
+ if (override) return override;
30848
+ try {
30849
+ const path = opts?.cachePath ?? defaultFlagsCachePath(env2);
30850
+ if (existsSync(path)) {
30851
+ const parsed = JSON.parse(readFileSync(path, "utf8"));
30852
+ const cached2 = parse3(parsed?.flags?.[GHOST_REPLY_NARRATION_GUARD_FLAG_KEY]);
30853
+ if (cached2) return cached2;
30854
+ }
30855
+ } catch {
30856
+ }
30857
+ return "shadow";
30858
+ }
30839
30859
  var MAINTENANCE_FLAG_KEY = "platform-maintenance-mode";
30840
30860
  function parseMaintenanceMode(raw) {
30841
30861
  if (raw === void 0) return void 0;
@@ -39156,6 +39176,23 @@ var FLAG_REGISTRY = [
39156
39176
  // change (ADR-0022 sensitive-flag confirm).
39157
39177
  sensitive: true
39158
39178
  },
39179
+ {
39180
+ key: "ghost-reply-narration-guard",
39181
+ description: "Model-free guard on the SLACK ghost-reply RECOVERY path (CS-1821, CS-1429, ENG-7780); Telegram and Teams recovery do not run it. Recovered end-of-turn text with no second person, question, link or mention, that uses stand-down wording or names the person being answered in the third person, is not published. enforce = keep the marker so the inbound is re-delivered and the agent can answer properly. When re-deliveries run out, stand-down wording closes unposted and a name-only match publishes; with no reply owed, either closes. shadow = log only. off = never runs. A false match usually costs a re-ask; a real reply using stand-down wording every time is lost.",
39182
+ flagType: "enum",
39183
+ allowedValues: ["off", "shadow", "enforce"],
39184
+ // Ships in SHADOW: a free local log line, like every enum flag here, enforce is a
39185
+ // deliberate flip. Read the match log before flipping: a false match usually costs
39186
+ // a re-ask, but one repeated on every re-delivery loses the reply.
39187
+ defaultValue: "shadow",
39188
+ envVar: "AGT_GHOST_REPLY_NARRATION_GUARD_MODE",
39189
+ sensitive: true,
39190
+ // DELIBERATE UNREACHABLE PLACEHOLDER, not a real threshold. The reader is host-side
39191
+ // (the channel MCP), so a host on an older agt-cli ignores this flag. Replace it with
39192
+ // the first published agt-cli carrying the reader before flipping to enforce. Same
39193
+ // convention as `github-broker-credentials`.
39194
+ since: "0.29.0"
39195
+ },
39159
39196
  {
39160
39197
  key: "slack-scheduled-channel-guard",
39161
39198
  description: 'Guard on slack.reply that refuses to let an active scheduled-task destination silently move a reply to a DIFFERENT channel than the agent named (ENG-8137). CS-1505 gave an explicit inbound_id priority over the task destination but left the no-inbound_id case treating "no inbound reference" as "no destination specified" - and `channel` is a REQUIRED argument, so every call names one. The symptom: a question asked in one channel answered in another, and a reply meant as a DM landing in a public channel. Fires only when the marker carries an EXPLICIT target, the named channel differs from it, and neither an inbound_id, an enforce binding, nor an ENG-7542 channel correction is available to arbitrate. off = never runs (today behaviour: silent retarget). shadow = count + log the would-block but STILL route as today, so the false-positive rate is measurable before anyone refuses a send. enforce = block the reply and tell the agent to retry. Read live from the heartbeat flags-cache (or the env override). NOTE: enforce is currently CLAMPED to shadow host-side and setting it here will not take effect - it stays blocked until ENG-8142 teaches the Stop hook to tell a refused reply from a delivered one, because until then a blocked send fails silently (no recovery, no re-prompt, nothing in the channel). Lifting the clamp is a code change, not a flag flip.',
@@ -43513,6 +43550,73 @@ function shouldDeliverWithoutClassifying(text) {
43513
43550
  if (/<[@#][A-Z0-9]/.test(t)) return true;
43514
43551
  return false;
43515
43552
  }
43553
+ var STAND_DOWN_NARRATION = [
43554
+ /\bstanding by\b/i,
43555
+ /\bstaying (silent|quiet|out)\b/i,
43556
+ /\bstand(ing)? down\b/i,
43557
+ /\bnot (addressed to|for|directed at) me\b/i,
43558
+ /\bno (reply|response) (is )?(needed|required|owed)\b/i,
43559
+ /\bnot replying\b/i,
43560
+ /\breacted,? nothing else\b/i,
43561
+ /\bcard (is )?parked\b/i,
43562
+ /\bparked (in|on) (todo|waiting|backlog)\b/i
43563
+ ];
43564
+ function withoutAddress(text, name) {
43565
+ const escaped = name.replace(/[.*+?^\${}()|[\]\\]/g, "\\$&");
43566
+ return text.replace(
43567
+ new RegExp(`^\\s*(?:(?:hi|hey|hello|thanks|thank you|ok|okay|sure|yes|no),?\\s+)?${escaped}\\s*[,:!.\\-]`, "i"),
43568
+ ""
43569
+ ).replace(new RegExp(`(?:thanks|thank you|cheers),?\\s+${escaped}\\s*[.!]*\\s*$`, "i"), "").replace(new RegExp(`,\\s*${escaped}\\s*[.!]*\\s*$`, "i"), "");
43570
+ }
43571
+ function detectInternalNarration(text, addresseeName) {
43572
+ const t = String(text ?? "");
43573
+ if (!t.trim() || shouldDeliverWithoutClassifying(t)) return null;
43574
+ if (STAND_DOWN_NARRATION.some((re) => re.test(t))) return "stand_down";
43575
+ const raw = String(addresseeName ?? "").trim().split(/\s+/)[0] ?? "";
43576
+ const first = raw.charAt(0).toUpperCase() + raw.slice(1);
43577
+ if (first.length >= 3) {
43578
+ const escaped = first.replace(/[.*+?^\${}()|[\]\\]/g, "\\$&");
43579
+ if (new RegExp(`\\b${escaped}\\b`).test(withoutAddress(t, first))) {
43580
+ return "third_person_addressee";
43581
+ }
43582
+ }
43583
+ return null;
43584
+ }
43585
+ function summariseRecoveryMarkers(markers) {
43586
+ const owed = markers.filter((m) => !m.owesNoReply);
43587
+ const newest = (list) => [...list].sort((a, b) => Number(b.messageTs) - Number(a.messageTs))[0];
43588
+ if (owed.length === 0) {
43589
+ return {
43590
+ owesNoReply: true,
43591
+ hasPayload: markers.every((m) => m.hasPayload),
43592
+ replayCount: Math.max(...markers.map((m) => m.replayCount)),
43593
+ addresseeName: newest(markers)?.addresseeName
43594
+ };
43595
+ }
43596
+ return {
43597
+ owesNoReply: false,
43598
+ hasPayload: owed.every((m) => m.hasPayload),
43599
+ replayCount: Math.min(...owed.map((m) => m.replayCount)),
43600
+ maxReplayCount: Math.max(...owed.map((m) => m.replayCount)),
43601
+ addresseeName: newest(owed)?.addresseeName
43602
+ };
43603
+ }
43604
+ var UNREADABLE_RECOVERY_MARKER = {
43605
+ owesNoReply: false,
43606
+ hasPayload: false,
43607
+ replayCount: 0,
43608
+ messageTs: ""
43609
+ };
43610
+ function decideNarrationGuard(opts) {
43611
+ if (!opts.match || opts.mode !== "enforce") return "publish";
43612
+ if (!opts.marker) return "publish";
43613
+ if (opts.marker.owesNoReply) return "close";
43614
+ if (!opts.marker.hasPayload || !opts.replayEnabled) return "publish";
43615
+ const mostReplays = opts.marker.maxReplayCount ?? opts.marker.replayCount;
43616
+ if (opts.match === "third_person_addressee" && mostReplays >= opts.maxReplays) return "publish";
43617
+ if (opts.marker.replayCount < opts.maxReplays) return "redeliver";
43618
+ return opts.match === "stand_down" ? "close" : "publish";
43619
+ }
43516
43620
  async function decideRecovery(text, mode, env2 = process.env, classify = classifyRecoveredReply) {
43517
43621
  if (shouldDeliverWithoutClassifying(text)) {
43518
43622
  return { action: "deliver", mode, verdict: "pre-gate-deliver", wouldSuppress: false };
@@ -47741,6 +47845,42 @@ function readSlackThreadMarkerState(channel, threadTs) {
47741
47845
  humanOwed: markers.some((m) => m.ingress_only !== true)
47742
47846
  };
47743
47847
  }
47848
+ function readRecoveryMarkerState(channel, threadTs, markerName) {
47849
+ if (!SLACK_PENDING_INBOUND_DIR) return null;
47850
+ const markers = [];
47851
+ const collect = (fullPath) => {
47852
+ let raw;
47853
+ try {
47854
+ raw = readFileSync20(fullPath, "utf-8");
47855
+ } catch (err) {
47856
+ if (err.code !== "ENOENT") markers.push(UNREADABLE_RECOVERY_MARKER);
47857
+ return;
47858
+ }
47859
+ try {
47860
+ const m = JSON.parse(raw);
47861
+ markers.push({
47862
+ owesNoReply: markerOwesNoReply(m),
47863
+ hasPayload: Boolean(m.payload),
47864
+ replayCount: m.replay_count ?? 0,
47865
+ messageTs: m.message_ts ?? "",
47866
+ addresseeName: m.payload?.meta?.["user_name"]
47867
+ });
47868
+ } catch {
47869
+ markers.push(UNREADABLE_RECOVERY_MARKER);
47870
+ }
47871
+ };
47872
+ try {
47873
+ if (threadTs) {
47874
+ markSeenAllSlackPendingMarkersForThread(SLACK_PENDING_INBOUND_DIR, channel, threadTs, collect);
47875
+ } else if (markerName) {
47876
+ collect(join22(SLACK_PENDING_INBOUND_DIR, basename(markerName)));
47877
+ }
47878
+ } catch {
47879
+ return null;
47880
+ }
47881
+ if (markers.length === 0) return null;
47882
+ return summariseRecoveryMarkers(markers);
47883
+ }
47744
47884
  async function processSlackRecoveryOutboxFile(filename) {
47745
47885
  if (!SLACK_RECOVERY_OUTBOX_DIR) return;
47746
47886
  if (filename.endsWith(".poison.json") || filename.endsWith(".tmp")) return;
@@ -47804,6 +47944,46 @@ async function processSlackRecoveryOutboxFile(filename) {
47804
47944
  }
47805
47945
  return;
47806
47946
  }
47947
+ const narrationGuardMode = resolveGhostReplyNarrationGuardMode();
47948
+ if (narrationGuardMode !== "off") {
47949
+ const recoveryMarker = readRecoveryMarkerState(payload.channel, payload.thread_ts, payload.marker_name);
47950
+ const narration = detectInternalNarration(text, recoveryMarker?.addresseeName);
47951
+ const narrationAction = decideNarrationGuard({
47952
+ match: narration,
47953
+ mode: narrationGuardMode,
47954
+ marker: recoveryMarker,
47955
+ maxReplays: MAX_MARKER_REPLAYS,
47956
+ replayEnabled: channelReplayEnabled()
47957
+ });
47958
+ if (narration) {
47959
+ const enforceAction = decideNarrationGuard({
47960
+ match: narration,
47961
+ mode: "enforce",
47962
+ marker: recoveryMarker,
47963
+ maxReplays: MAX_MARKER_REPLAYS,
47964
+ replayEnabled: channelReplayEnabled()
47965
+ });
47966
+ process.stderr.write(
47967
+ `slack-channel(${AGENT_CODE_NAME}): ghost-reply narration match=${narration} mode=${narrationGuardMode} action=${narrationAction} enforce_action=${enforceAction} channel=${redactSlackId(payload.channel)} thread=${redactSlackId(payload.thread_ts)} text_len=${text.length}
47968
+ `
47969
+ );
47970
+ }
47971
+ if (narrationAction !== "publish") {
47972
+ if (narrationAction === "close" && payload.thread_ts) clearPendingMessage(payload.channel, payload.thread_ts);
47973
+ if (narrationAction === "close" && recoveryMarker && !recoveryMarker.owesNoReply) {
47974
+ process.stderr.write(
47975
+ `slack-channel(${AGENT_CODE_NAME}): ghost-reply narration lost_owed_reply=1 match=${narration} replays=${recoveryMarker.replayCount} channel=${redactSlackId(payload.channel)} thread=${redactSlackId(payload.thread_ts)} text_len=${text.length}
47976
+ `
47977
+ );
47978
+ }
47979
+ removeRecoveryLedgerEntry(SLACK_RECOVERY_LEDGER_DIR, payload.marker_name);
47980
+ try {
47981
+ unlinkSync7(fullPath);
47982
+ } catch {
47983
+ }
47984
+ return;
47985
+ }
47986
+ }
47807
47987
  const ghostReplyMode = resolveGhostReplyMode();
47808
47988
  if (ghostReplyMode !== "off") {
47809
47989
  const decision = await decideRecovery(text, ghostReplyMode);
@@ -39367,6 +39367,23 @@ var FLAG_REGISTRY = [
39367
39367
  // change (ADR-0022 sensitive-flag confirm).
39368
39368
  sensitive: true
39369
39369
  },
39370
+ {
39371
+ key: "ghost-reply-narration-guard",
39372
+ description: "Model-free guard on the SLACK ghost-reply RECOVERY path (CS-1821, CS-1429, ENG-7780); Telegram and Teams recovery do not run it. Recovered end-of-turn text with no second person, question, link or mention, that uses stand-down wording or names the person being answered in the third person, is not published. enforce = keep the marker so the inbound is re-delivered and the agent can answer properly. When re-deliveries run out, stand-down wording closes unposted and a name-only match publishes; with no reply owed, either closes. shadow = log only. off = never runs. A false match usually costs a re-ask; a real reply using stand-down wording every time is lost.",
39373
+ flagType: "enum",
39374
+ allowedValues: ["off", "shadow", "enforce"],
39375
+ // Ships in SHADOW: a free local log line, like every enum flag here, enforce is a
39376
+ // deliberate flip. Read the match log before flipping: a false match usually costs
39377
+ // a re-ask, but one repeated on every re-delivery loses the reply.
39378
+ defaultValue: "shadow",
39379
+ envVar: "AGT_GHOST_REPLY_NARRATION_GUARD_MODE",
39380
+ sensitive: true,
39381
+ // DELIBERATE UNREACHABLE PLACEHOLDER, not a real threshold. The reader is host-side
39382
+ // (the channel MCP), so a host on an older agt-cli ignores this flag. Replace it with
39383
+ // the first published agt-cli carrying the reader before flipping to enforce. Same
39384
+ // convention as `github-broker-credentials`.
39385
+ since: "0.29.0"
39386
+ },
39370
39387
  {
39371
39388
  key: "slack-scheduled-channel-guard",
39372
39389
  description: 'Guard on slack.reply that refuses to let an active scheduled-task destination silently move a reply to a DIFFERENT channel than the agent named (ENG-8137). CS-1505 gave an explicit inbound_id priority over the task destination but left the no-inbound_id case treating "no inbound reference" as "no destination specified" - and `channel` is a REQUIRED argument, so every call names one. The symptom: a question asked in one channel answered in another, and a reply meant as a DM landing in a public channel. Fires only when the marker carries an EXPLICIT target, the named channel differs from it, and neither an inbound_id, an enforce binding, nor an ENG-7542 channel correction is available to arbitrate. off = never runs (today behaviour: silent retarget). shadow = count + log the would-block but STILL route as today, so the false-positive rate is measurable before anyone refuses a send. enforce = block the reply and tell the agent to retry. Read live from the heartbeat flags-cache (or the env override). NOTE: enforce is currently CLAMPED to shadow host-side and setting it here will not take effect - it stays blocked until ENG-8142 teaches the Stop hook to tell a refused reply from a delivered one, because until then a blocked send fails silently (no recovery, no re-prompt, nothing in the channel). Lifting the clamp is a code change, not a flag flip.',
@@ -68,12 +68,12 @@ import {
68
68
  writeDirectChatSessionState,
69
69
  writeEgressAllowlist,
70
70
  writePersistentClaudeWrapper
71
- } from "./chunk-BWIPB6CR.js";
72
- import "./chunk-QPNZGRNJ.js";
71
+ } from "./chunk-REX6HMS6.js";
72
+ import "./chunk-6TXC2YC3.js";
73
73
  import "./chunk-HYQ7VOC3.js";
74
74
  import "./chunk-6HBXEJHO.js";
75
75
  import "./chunk-XWVM4KPK.js";
76
- import "./chunk-IXMHJ3GU.js";
76
+ import "./chunk-JM4J6GYJ.js";
77
77
  import "./chunk-AIUIMEUS.js";
78
78
  import "./chunk-DGUM43GV.js";
79
79
  export {
@@ -147,4 +147,4 @@ export {
147
147
  writeEgressAllowlist,
148
148
  writePersistentClaudeWrapper
149
149
  };
150
- //# sourceMappingURL=persistent-session-NEKCQLFH.js.map
150
+ //# sourceMappingURL=persistent-session-UJBNO5IF.js.map
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  paneLogPath
3
- } from "./chunk-BWIPB6CR.js";
4
- import "./chunk-QPNZGRNJ.js";
3
+ } from "./chunk-REX6HMS6.js";
4
+ import "./chunk-6TXC2YC3.js";
5
5
  import "./chunk-HYQ7VOC3.js";
6
6
  import "./chunk-6HBXEJHO.js";
7
7
  import "./chunk-XWVM4KPK.js";
8
- import "./chunk-IXMHJ3GU.js";
8
+ import "./chunk-JM4J6GYJ.js";
9
9
  import "./chunk-AIUIMEUS.js";
10
10
  import "./chunk-DGUM43GV.js";
11
11
 
@@ -804,4 +804,4 @@ export {
804
804
  readAndResetSlackReplyBindingClassifications,
805
805
  readAndResetSlackReplyTargetClassifications
806
806
  };
807
- //# sourceMappingURL=responsiveness-probe-4VILKGY6.js.map
807
+ //# sourceMappingURL=responsiveness-probe-6BELVQ42.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  sessionTranscriptDir
3
- } from "./chunk-QPNZGRNJ.js";
4
- import "./chunk-IXMHJ3GU.js";
3
+ } from "./chunk-6TXC2YC3.js";
4
+ import "./chunk-JM4J6GYJ.js";
5
5
  import "./chunk-DGUM43GV.js";
6
6
 
7
7
  // src/lib/session-auth-dead.ts
@@ -205,4 +205,4 @@ export {
205
205
  decideSessionAuthState,
206
206
  probeSessionAuth
207
207
  };
208
- //# sourceMappingURL=session-auth-dead-UZGQIMDK.js.map
208
+ //# sourceMappingURL=session-auth-dead-RLOWHZ3T.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.28.1209",
3
+ "version": "0.28.1210",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {