@integrity-labs/agt-cli 0.28.1251 → 0.28.1253

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 (32) hide show
  1. package/dist/{api-client-ECOBF6BM.js → api-client-5ZXNFF4W.js} +3 -3
  2. package/dist/bin/agt.js +7 -7
  3. package/dist/{chunk-OAAKFU3J.js → chunk-233HXJ2D.js} +2 -2
  4. package/dist/{chunk-2VGFSHFP.js → chunk-2HF77X4C.js} +3 -3
  5. package/dist/{chunk-VOMOPWFI.js → chunk-CMLBFY5C.js} +2 -2
  6. package/dist/{chunk-O6WRX5FE.js → chunk-GRTMENH5.js} +3 -3
  7. package/dist/{chunk-4AUE34MF.js → chunk-UBGHZ2O2.js} +5 -5
  8. package/dist/{chunk-6KY5FKXC.js → chunk-UHT6L77A.js} +38 -1
  9. package/dist/{chunk-6KY5FKXC.js.map → chunk-UHT6L77A.js.map} +1 -1
  10. package/dist/{claude-code-updater-2TZ4TSOB.js → claude-code-updater-EKABTDXO.js} +3 -3
  11. package/dist/{claude-pair-runtime-CTJCJNK4.js → claude-pair-runtime-ZA24UQ7V.js} +3 -3
  12. package/dist/lib/manager-worker.js +21 -21
  13. package/dist/mcp/direct-chat-channel.js +102 -4
  14. package/dist/mcp/index.js +38 -1
  15. package/dist/mcp/origami.js +37 -0
  16. package/dist/mcp/slack-channel.js +37 -0
  17. package/dist/mcp/telegram-channel.js +37 -0
  18. package/dist/{persistent-session-TBE4KP4K.js → persistent-session-HXK2Z6GH.js} +4 -4
  19. package/dist/{responsiveness-probe-J7DA3AB4.js → responsiveness-probe-TPKISRGQ.js} +4 -4
  20. package/dist/{session-auth-dead-OL5ODQRN.js → session-auth-dead-KMB35KRB.js} +3 -3
  21. package/package.json +1 -1
  22. /package/dist/{api-client-ECOBF6BM.js.map → api-client-5ZXNFF4W.js.map} +0 -0
  23. /package/dist/{chunk-OAAKFU3J.js.map → chunk-233HXJ2D.js.map} +0 -0
  24. /package/dist/{chunk-2VGFSHFP.js.map → chunk-2HF77X4C.js.map} +0 -0
  25. /package/dist/{chunk-VOMOPWFI.js.map → chunk-CMLBFY5C.js.map} +0 -0
  26. /package/dist/{chunk-O6WRX5FE.js.map → chunk-GRTMENH5.js.map} +0 -0
  27. /package/dist/{chunk-4AUE34MF.js.map → chunk-UBGHZ2O2.js.map} +0 -0
  28. /package/dist/{claude-code-updater-2TZ4TSOB.js.map → claude-code-updater-EKABTDXO.js.map} +0 -0
  29. /package/dist/{claude-pair-runtime-CTJCJNK4.js.map → claude-pair-runtime-ZA24UQ7V.js.map} +0 -0
  30. /package/dist/{persistent-session-TBE4KP4K.js.map → persistent-session-HXK2Z6GH.js.map} +0 -0
  31. /package/dist/{responsiveness-probe-J7DA3AB4.js.map → responsiveness-probe-TPKISRGQ.js.map} +0 -0
  32. /package/dist/{session-auth-dead-OL5ODQRN.js.map → session-auth-dead-KMB35KRB.js.map} +0 -0
@@ -13,9 +13,9 @@ import {
13
13
  probeClaudeInstalls,
14
14
  readsAsNativeInstall,
15
15
  shouldRunClaudeCodeUpdater
16
- } from "./chunk-OAAKFU3J.js";
16
+ } from "./chunk-233HXJ2D.js";
17
17
  import "./chunk-XWVM4KPK.js";
18
- import "./chunk-6KY5FKXC.js";
18
+ import "./chunk-UHT6L77A.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-2TZ4TSOB.js.map
37
+ //# sourceMappingURL=claude-code-updater-EKABTDXO.js.map
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  redactPaneFrame,
10
10
  sanitizeTerminalFrame
11
- } from "./chunk-6KY5FKXC.js";
11
+ } from "./chunk-UHT6L77A.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-TBE4KP4K.js");
324
+ const { resolveClaudeBinary } = await import("./persistent-session-HXK2Z6GH.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-CTJCJNK4.js.map
839
+ //# sourceMappingURL=claude-pair-runtime-ZA24UQ7V.js.map
@@ -69,7 +69,7 @@ import {
69
69
  tripClass,
70
70
  writeEtcEnvironment,
71
71
  writeProfileDScript
72
- } from "../chunk-4AUE34MF.js";
72
+ } from "../chunk-UBGHZ2O2.js";
73
73
  import {
74
74
  ApiError,
75
75
  adoptHostKeyInProcess,
@@ -87,7 +87,7 @@ import {
87
87
  probeHostKey,
88
88
  requireHost,
89
89
  setConfigHash
90
- } from "../chunk-2VGFSHFP.js";
90
+ } from "../chunk-2HF77X4C.js";
91
91
  import {
92
92
  BLOCKED_ON_PROMPT_DECISION,
93
93
  CHANNEL_SECRET_ENV_KEYS,
@@ -171,7 +171,7 @@ import {
171
171
  webFetchBaselineValue,
172
172
  webFetchRestartNeeded,
173
173
  writeEgressAllowlist
174
- } from "../chunk-O6WRX5FE.js";
174
+ } from "../chunk-GRTMENH5.js";
175
175
  import {
176
176
  isAgentIdle,
177
177
  isStaleForToday,
@@ -182,7 +182,7 @@ import {
182
182
  subagentActivityAgeSeconds,
183
183
  subagentTranscriptDir,
184
184
  transcriptActivityAgeSeconds
185
- } from "../chunk-VOMOPWFI.js";
185
+ } from "../chunk-CMLBFY5C.js";
186
186
  import {
187
187
  classifyUnanswerablePane,
188
188
  focusedConfirmDialogBlock,
@@ -206,7 +206,7 @@ import {
206
206
  runSafeCleanup,
207
207
  tightestDiskStat,
208
208
  withPackageCacheLock
209
- } from "../chunk-OAAKFU3J.js";
209
+ } from "../chunk-233HXJ2D.js";
210
210
  import {
211
211
  parsePsRows,
212
212
  reapOrphanChannelMcps
@@ -333,7 +333,7 @@ import {
333
333
  stabiliseResetInstant,
334
334
  sumTranscriptUsageInWindow,
335
335
  summarizeTranscriptActivity
336
- } from "../chunk-6KY5FKXC.js";
336
+ } from "../chunk-UHT6L77A.js";
337
337
  import {
338
338
  CLAUDE_CONFIG_DIR_ENV,
339
339
  claudeConfigDirFor,
@@ -14133,7 +14133,7 @@ function createFileMigrationReportIO(codeName, log2) {
14133
14133
  };
14134
14134
  }
14135
14135
  var managerHostPost = async (path, body) => {
14136
- const { api: api2, ApiError: ApiError3 } = await import("../api-client-ECOBF6BM.js");
14136
+ const { api: api2, ApiError: ApiError3 } = await import("../api-client-5ZXNFF4W.js");
14137
14137
  try {
14138
14138
  const json = await api2.post(path, body);
14139
14139
  return { status: 200, json };
@@ -16172,7 +16172,7 @@ var pendingDayRolloverReset = /* @__PURE__ */ new Set();
16172
16172
  var dayRolloverInboundHold = /* @__PURE__ */ new Map();
16173
16173
  var INBOUND_HOLD_EPISODE_GAP_MS = 12e4;
16174
16174
  async function channelInboundActivityAgeSecondsFor(codeName) {
16175
- const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-J7DA3AB4.js");
16175
+ const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-TPKISRGQ.js");
16176
16176
  const newest = newestPendingInboundActivityMtimeMs(dirname11(paneLogPath(codeName)));
16177
16177
  if (newest === null) return null;
16178
16178
  return Math.max(0, Math.floor((Date.now() - newest) / 1e3));
@@ -16988,7 +16988,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
16988
16988
  var lastVersionCheckAt = 0;
16989
16989
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
16990
16990
  var lastResponsivenessProbeAt = 0;
16991
- var agtCliVersion = true ? "0.28.1251" : "dev";
16991
+ var agtCliVersion = true ? "0.28.1253" : "dev";
16992
16992
  function resolveBrewPath(execFileSync4) {
16993
16993
  try {
16994
16994
  const out = execFileSync4("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -18987,7 +18987,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
18987
18987
  if (codeNames.length === 0) return;
18988
18988
  void (async () => {
18989
18989
  try {
18990
- const { collectDiagnostics } = await import("../persistent-session-TBE4KP4K.js");
18990
+ const { collectDiagnostics } = await import("../persistent-session-HXK2Z6GH.js");
18991
18991
  await api.post("/host/heartbeat", {
18992
18992
  host_id: hostId,
18993
18993
  agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor, sessionActivityFor)
@@ -19130,7 +19130,7 @@ async function pollCycleInner() {
19130
19130
  }
19131
19131
  try {
19132
19132
  const { detectHostSecurity } = await import("../host-security-KQYYZZVW.js");
19133
- const { collectDiagnostics } = await import("../persistent-session-TBE4KP4K.js");
19133
+ const { collectDiagnostics } = await import("../persistent-session-HXK2Z6GH.js");
19134
19134
  const diagCodeNames = [...agentState.persistentSessionAgents];
19135
19135
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor, sessionActivityFor) : void 0;
19136
19136
  let tailscaleHostname;
@@ -19395,7 +19395,7 @@ async function pollCycleInner() {
19395
19395
  }
19396
19396
  try {
19397
19397
  const desiredClaudeCodeVersion = hbResp?.desired_claude_code_version?.trim();
19398
- const { maybeUpdateClaudeCode, shouldRunClaudeCodeUpdater } = await import("../claude-code-updater-2TZ4TSOB.js");
19398
+ const { maybeUpdateClaudeCode, shouldRunClaudeCodeUpdater } = await import("../claude-code-updater-EKABTDXO.js");
19399
19399
  const securityFloor = currentSecurityFloor();
19400
19400
  claudeUpdaterInFlight = true;
19401
19401
  if (desiredClaudeCodeVersion && (claudePairLoop.busy || claudePairingInProgress())) {
@@ -19430,7 +19430,7 @@ async function pollCycleInner() {
19430
19430
  collectPanelessActivityProbes,
19431
19431
  getResponsivenessIntervalMs,
19432
19432
  occupancyQualificationClassifications
19433
- } = await import("../responsiveness-probe-J7DA3AB4.js");
19433
+ } = await import("../responsiveness-probe-TPKISRGQ.js");
19434
19434
  const probeIntervalMs = getResponsivenessIntervalMs();
19435
19435
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
19436
19436
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -19547,7 +19547,7 @@ async function pollCycleInner() {
19547
19547
  collectResponsivenessProbes,
19548
19548
  livePendingInboundOldestAgeSeconds,
19549
19549
  parkPendingInbound
19550
- } = await import("../responsiveness-probe-J7DA3AB4.js");
19550
+ } = await import("../responsiveness-probe-TPKISRGQ.js");
19551
19551
  const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-5PCBGRNY.js");
19552
19552
  const wedgeNow = /* @__PURE__ */ new Date();
19553
19553
  const liveAgents = agentState.persistentSessionAgents;
@@ -19833,7 +19833,7 @@ async function pollCycleInner() {
19833
19833
  }
19834
19834
  }
19835
19835
  );
19836
- const { parkPendingInbound } = await import("../responsiveness-probe-J7DA3AB4.js");
19836
+ const { parkPendingInbound } = await import("../responsiveness-probe-TPKISRGQ.js");
19837
19837
  const { parked, deadLettered } = parkPendingInbound(codeName, new Date(fatalNowMs));
19838
19838
  paneFatalStreak.delete(codeName);
19839
19839
  paneFatalRestarts.set(codeName, [...history, fatalNowMs]);
@@ -19864,7 +19864,7 @@ async function pollCycleInner() {
19864
19864
  TRANSCRIPT_MOUNT_ESCALATION_REFRESH_MS,
19865
19865
  bindSourceEscalations
19866
19866
  } = await import("../transcript-mount-health-OHE6IVJV.js");
19867
- const { transcriptBindSourcesFor, ensureTranscriptBindSources } = await import("../persistent-session-TBE4KP4K.js");
19867
+ const { transcriptBindSourcesFor, ensureTranscriptBindSources } = await import("../persistent-session-HXK2Z6GH.js");
19868
19868
  const mountConfig = resolveTranscriptMountConfig();
19869
19869
  const liveAgents = agentState.persistentSessionAgents;
19870
19870
  for (const tracked of [
@@ -20029,7 +20029,7 @@ async function pollCycleInner() {
20029
20029
  }
20030
20030
  try {
20031
20031
  const { scrapeMcpFailedBannerCount } = await import("../pane-mcp-banner-scraper-VR5QGP3J.js");
20032
- const { probeSessionAuth } = await import("../session-auth-dead-OL5ODQRN.js");
20032
+ const { probeSessionAuth } = await import("../session-auth-dead-KMB35KRB.js");
20033
20033
  const observations = [];
20034
20034
  const pendingCacheCommits = [];
20035
20035
  const modelApiErrorReportingOn = hostFlagStore().getBoolean("model-api-error-reporting");
@@ -24957,7 +24957,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
24957
24957
  if (!refreshData) return;
24958
24958
  const framework = refreshData.agent?.framework ?? agentFrameworkCache.get(codeName) ?? DEFAULT_FRAMEWORK;
24959
24959
  const hostId = await getHostId();
24960
- const parkForRestart = await import("../responsiveness-probe-J7DA3AB4.js").then(
24960
+ const parkForRestart = await import("../responsiveness-probe-TPKISRGQ.js").then(
24961
24961
  (m) => m.parkPendingInbound,
24962
24962
  (err) => err
24963
24963
  );
@@ -25030,7 +25030,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
25030
25030
  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}`));
25031
25031
  void (async () => {
25032
25032
  try {
25033
- const { collectDiagnostics } = await import("../persistent-session-TBE4KP4K.js");
25033
+ const { collectDiagnostics } = await import("../persistent-session-HXK2Z6GH.js");
25034
25034
  await api.post("/host/heartbeat", {
25035
25035
  host_id: hostId,
25036
25036
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor, sessionActivityFor)
@@ -25081,7 +25081,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
25081
25081
  }
25082
25082
  try {
25083
25083
  const hostId = await getHostId();
25084
- const { collectDiagnostics } = await import("../persistent-session-TBE4KP4K.js");
25084
+ const { collectDiagnostics } = await import("../persistent-session-HXK2Z6GH.js");
25085
25085
  await api.post("/host/heartbeat", {
25086
25086
  host_id: hostId,
25087
25087
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor, sessionActivityFor)
@@ -25783,7 +25783,7 @@ async function processClaudePairSessions(agents) {
25783
25783
  snapshotPairConfig,
25784
25784
  // ENG-11659: result -> report body + the manager.log line that records it.
25785
25785
  planPairStartReport
25786
- } = await import("../claude-pair-runtime-CTJCJNK4.js");
25786
+ } = await import("../claude-pair-runtime-ZA24UQ7V.js");
25787
25787
  const { resetClaudeSignin, describeSigninResetForLog, describeSigninResetFailure } = await import("../claude-signin-reset-6IJMMVYG.js");
25788
25788
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
25789
25789
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
@@ -46494,6 +46494,31 @@ var FLAG_REGISTRY = [
46494
46494
  // edec921a519f); THREATS_FOUND rows stay hidden either way.
46495
46495
  defaultValue: false
46496
46496
  },
46497
+ {
46498
+ key: "direct-chat-extracted-text",
46499
+ // ENG-11967 part 2b. Read stage-wide only (empty scope), like
46500
+ // direct-chat-malware-scan: a scoped override would do nothing.
46501
+ stageWideOnly: true,
46502
+ sensitive: true,
46503
+ description: `Serve a Direct Chat PDF or DOCX to the agent as its EXTRACTED TEXT instead of the raw file (ENG-11967 part 2b, Sherlock ruling (a)). off = today: the agent gets the raw file (scan-gated). hold-30s / hold-60s / hold-120s = armed, and the value is the HOLD CAP: the agent poll does not claim a message whose text is not ready yet for up to that long, and holds the rest of its session with it so order is kept. Holds chain: a message also waits for every document sent after it in the same session, so its delay is bounded by the cap measured from the LAST document in a run of sends, not from its own send. Ready text is delivered as <name>.txt. If extraction finished without text, or died, the message is released at once with "text extraction unavailable for <name> (couldn't read the file)" or "(timed out)"; at the cap it is released with "(timed out)" and the release is logged. Takes effect only while direct-chat-malware-scan is on, because extraction runs on GuardDuty's clean-scan event. ARM ONLY AFTER DIRECT_CHAT_TEXT_EXTRACTION=true has deployed the DirectChatTextExtract Lambda: armed without it, every PDF/DOCX waits out the cap and arrives as a timed-out notice. A flag-store read error counts as off on this read path. GLOBAL ONLY: evaluated with an empty context, so scoped overrides have no effect.`,
46504
+ flagType: "enum",
46505
+ allowedValues: ["off", "hold-30s", "hold-60s", "hold-120s"],
46506
+ // Off is the pre-2b behaviour: no hold, no .txt read, the raw file.
46507
+ defaultValue: "off",
46508
+ // The flag is evaluated server-side, but its notice entries need the host's
46509
+ // direct-chat MCP to render them: an older agt-cli shows a notice as
46510
+ // "download failed; ask the user to re-send", which sends users in circles
46511
+ // (Sherlock, 13 Nov). So the flip-reach modal must count hosts by the CLI
46512
+ // that renders notices. 0.28.1252 is the first published agt-cli carrying
46513
+ // #7579's MCP change (tag agt-cli-0.28.1252, published from caf64c0b5; the
46514
+ // publish run on #7579's own merge commit 38465ce5f failed). Arm only when
46515
+ // the modal shows 0 stale and 0 unknown hosts. The reach count covers only
46516
+ // active hosts seen in the last 24h (routes/flags.ts), so also confirm no
46517
+ // active host older than 0.28.1252 is offline before arming the stage-wide
46518
+ // flip: one that reconnects later receives the armed flag on its first
46519
+ // heartbeat (CodeRabbit on #7588).
46520
+ since: "0.28.1252"
46521
+ },
46497
46522
  {
46498
46523
  key: "platform-held-key-central-probe",
46499
46524
  description: "Arm the scheduled CENTRAL connectivity probe lane for platform-held-key integrations (ENG-10086). These store no customer credential (auth_type none), so the host cannot probe them and reports unverified forever. When on, the hourly PlatformHeldKeyProbe cron runs each central probe that exists (today only ninjafy-notes: org entitlement + broker routing, never note contents) and writes the result through the monitor observation path, so consecutive_connectivity_failures / _ok_cycles move and integration_down alerts can open and close on it. Definitions with no central probe are skipped, never written as a failure. When off the cron reads nothing and writes nothing. Boolean gate; ships dark because a new writer of the escalation counters is a paging change. GLOBAL ONLY: the cron and the host connectivity route both evaluate this flag with an empty context, so an org-, team- or agent-scoped override is stored but has NO effect. Arm it by its global value, not as a staged per-org rollout (Obi Wan 63053d02035e).",
@@ -47352,6 +47377,18 @@ var FLAG_REGISTRY = [
47352
47377
  // honours the filter is unproven, so an org must not switch it on for itself.
47353
47378
  platformAdminOnly: true
47354
47379
  },
47380
+ {
47381
+ key: "agent-email-inbox",
47382
+ description: "ENG-12021 - lets an owner/admin give one agent its own email address on the platform's agent mail domain, provisioned as a Resend Inbox, which the agent can list, search and read. OFF (default) = the provisioning route refuses and no inbox can be created. This flag is ROLLOUT CONTROL, NOT the revocation: it decides whether an org may provision, and turning it off does NOT take the tools away from an agent that already has an address - `agent_email_inboxes.status` does that, and is what to reach for in an incident. Nor is it the only gate, and the two secrets do NOT gate the same things: AGENT_INBOX_RESEND_API_KEY gates EVERYTHING (unset = provisioning refuses AND every tool call on an existing inbox answers not_configured), while AGENT_INBOX_DOMAIN is read only when MINTING an address - so clearing the domain stops new inboxes and leaves an agent that already has one still reading its mail (NOT replying - this slice ships no send or reply tool at all; that is PR B). Do not reach for either as a kill switch; the status column is the one. A per-org cap refuses provisioning past its limit regardless of this flag. BEFORE ARMING THIS FOR AN ORG, verify cross-inbox thread isolation against a real key: the inbox segment of every Resend path is server-derived from the agent's own row, but thread_id is an AGENT-SUPPLIED argument, and Resend documents no error for a thread that belongs to a different inbox. Their thread response carries no inbox field either, so this cannot be re-checked on our side after the fact - it is a vendor behaviour that has to be measured once (request one inbox's thread id under another inbox and confirm a 404), not an invariant this code can enforce. Platform-admin-only AND sensitive because each inbox is a RECURRING monthly cost with no per-unit billing primitive behind it (ENG-8720) - an org must not be able to switch on a subscription for itself, and the cap is the only thing metering it.",
47383
+ flagType: "boolean",
47384
+ defaultValue: false,
47385
+ sensitive: true,
47386
+ platformAdminOnly: true
47387
+ // Deliberately NO envVar. The reader is the API, server-side, which can call the
47388
+ // flag evaluator directly - so there is no host-side bash hook needing a
47389
+ // materialised value, and declaring one would only create a literal for the
47390
+ // ENG-8303 sst-pin guard to catch.
47391
+ },
47355
47392
  {
47356
47393
  key: "premium-gateway-inference",
47357
47394
  description: "ENG-10865 / ADR-0117 - RESERVED, and INERT until the runtime wiring lands. Turning it ON today mints nothing and delivers nothing: no caller invokes the mint client yet, resolveBindingCredential is unchanged, and a gateway binding still resolves `blocked-gateway` either way. The flag is registered ahead of that wiring on purpose - see below - so an operator must not read it as a working switch. ONCE WIRED, ON will mean the API mints a budgeted key per agent and the host spawns against the gateway, so that a policy whose ACTIVE binding is transport=gateway with credential_owner=platform resolves `applied`; OFF will remain exactly the fleet behaviour before this flag existed. Registered early and kept deliberately SEPARATE from holding AI_GATEWAY_MINT_TOKEN, because possessing the minting credential is not clearance to spend platform money on a customer agent - the ENG-8247 shape. The secret is set in prod BEFORE ADR-0117 is accepted, before metering exists (ENG-10867) and before the premium opt-in is registered (ENG-10868), so presence of the credential must not be the gate. Boolean.",
@@ -48828,6 +48865,40 @@ async function fetchWithTimeout(input, init, timeoutMs, fetchImpl = fetch) {
48828
48865
  clearTimeout(timer);
48829
48866
  }
48830
48867
  }
48868
+ var HELD_RETRY_MIN_MS = 1e3;
48869
+ var HELD_RETRY_MAX_MS = 3e4;
48870
+ function heldRetryDelayMs(value) {
48871
+ if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) return null;
48872
+ return Math.min(HELD_RETRY_MAX_MS, Math.max(HELD_RETRY_MIN_MS, Math.round(value)));
48873
+ }
48874
+ var PollFollowUps = class {
48875
+ constructor(schedule, cancel) {
48876
+ this.schedule = schedule;
48877
+ this.cancel = cancel;
48878
+ }
48879
+ requested = null;
48880
+ retryTimer = null;
48881
+ /** A poll was requested but skipped because another was in flight. */
48882
+ noteSkipped(sinceMs) {
48883
+ this.requested = typeof sinceMs === "number" ? { sinceMs } : {};
48884
+ }
48885
+ /** Call when a poll finishes, with the server's retry_after_ms (if any). */
48886
+ afterPoll(run, sinceMs, retryAfterMs) {
48887
+ const owed = this.requested;
48888
+ this.requested = null;
48889
+ if (owed) {
48890
+ this.schedule(() => run(owed.sinceMs), 0);
48891
+ return;
48892
+ }
48893
+ const delay = heldRetryDelayMs(retryAfterMs);
48894
+ if (delay === null) return;
48895
+ if (this.retryTimer !== null) this.cancel(this.retryTimer);
48896
+ this.retryTimer = this.schedule(() => {
48897
+ this.retryTimer = null;
48898
+ run(sinceMs);
48899
+ }, delay);
48900
+ }
48901
+ };
48831
48902
 
48832
48903
  // src/mcp-spawn-lock.ts
48833
48904
  import {
@@ -54234,6 +54305,12 @@ function buildAttachmentAnnotation(items) {
54234
54305
  const lines = items.map((a) => {
54235
54306
  if (a.archive || isZipAttachment(a.content_type, a.filename)) return archiveAnnotationLines(a);
54236
54307
  if (a.email || emailParseType(a.content_type, a.filename)) return emailAnnotationLines(a);
54308
+ if (a.unavailable) {
54309
+ return `- ${sanitizeAttachmentLabel(a.filename)} - ${oneLine(a.unavailable, 400) || "text extraction unavailable"}. You were not given this file; ask the user to paste the part you need.`;
54310
+ }
54311
+ if (a.extractedTextOf && a.path) {
54312
+ return `- ${sanitizeAttachmentLabel(a.extractedTextOf)} (text extracted from it, ${formatBytes(a.byte_size)}) - downloaded to ${a.path}. Read it to inspect the document; the original file was not delivered.`;
54313
+ }
54237
54314
  const head = `- ${sanitizeAttachmentLabel(a.filename)} (${a.content_type}, ${formatBytes(a.byte_size)})`;
54238
54315
  if (a.path) {
54239
54316
  return a.isImage ? `${head} - downloaded to ${a.path}. Read it to view the image.` : `${head} - downloaded to ${a.path}. Read it to inspect the file.`;
@@ -54353,13 +54430,17 @@ async function downloadInboundAttachment(att, dir, deps) {
54353
54430
  filename: att.filename,
54354
54431
  content_type: att.content_type,
54355
54432
  byte_size: att.byte_size,
54356
- isImage: isImageContentType(att.content_type)
54433
+ isImage: isImageContentType(att.content_type),
54434
+ ...att.extracted_text_of ? { extractedTextOf: att.extracted_text_of } : {}
54357
54435
  };
54436
+ if (att.extraction_unavailable) return { ...base, unavailable: att.extraction_unavailable };
54437
+ if (!att.download_url) return { ...base, error: "no download link was provided" };
54358
54438
  if (att.byte_size > MAX_INBOUND_ATTACHMENT_BYTES) {
54359
54439
  return { ...base, error: OVER_CAP_ERROR };
54360
54440
  }
54441
+ const downloadUrl = att.download_url;
54361
54442
  try {
54362
- const res = await deps.fetchUrl(att.download_url, att.byte_size);
54443
+ const res = await deps.fetchUrl(downloadUrl, att.byte_size);
54363
54444
  if (!res.ok) {
54364
54445
  let s3Body = "";
54365
54446
  try {
@@ -54368,7 +54449,7 @@ async function downloadInboundAttachment(att, dir, deps) {
54368
54449
  } catch {
54369
54450
  }
54370
54451
  deps.warn(
54371
- `direct-chat inbound download HTTP ${res.status} for ${att.filename} url=${redactPresignSignature(att.download_url)} s3Body=${s3Body}`
54452
+ `direct-chat inbound download HTTP ${res.status} for ${att.filename} url=${redactPresignSignature(downloadUrl)} s3Body=${s3Body}`
54372
54453
  );
54373
54454
  return { ...base, error: `download HTTP ${res.status}` };
54374
54455
  }
@@ -56396,6 +56477,15 @@ function armUsageLimitWatch(args) {
56396
56477
  }
56397
56478
  })();
56398
56479
  }
56480
+ var lastPollRetryAfterMs = void 0;
56481
+ var pollFollowUps = new PollFollowUps(
56482
+ (fn, ms) => {
56483
+ const t = setTimeout(fn, ms);
56484
+ t.unref?.();
56485
+ return t;
56486
+ },
56487
+ (t) => clearTimeout(t)
56488
+ );
56399
56489
  async function pollForMessages(sinceMs) {
56400
56490
  let pushPendingId = null;
56401
56491
  try {
@@ -56418,6 +56508,7 @@ async function pollForMessages(sinceMs) {
56418
56508
  for (let i = 0; i < 250; i++) processedIds.delete(ids[i]);
56419
56509
  }
56420
56510
  };
56511
+ lastPollRetryAfterMs = data.retry_after_ms;
56421
56512
  for (const msg of data.messages ?? []) {
56422
56513
  if (processedIds.has(msg.id)) continue;
56423
56514
  const isNotice = msg.kind === "notice";
@@ -56682,7 +56773,10 @@ var DOORBELL_FILE = "direct-chat-doorbell";
56682
56773
  var pollGuard = { inFlight: false, inFlightSinceMs: null, leaseUntilMs: null };
56683
56774
  async function pollOnce(sinceMs) {
56684
56775
  const decision = evaluatePollGuard(pollGuard, Date.now(), POLL_STUCK_MS);
56685
- if (!decision.run) return { ran: false, ok: false };
56776
+ if (!decision.run) {
56777
+ pollFollowUps.noteSkipped(sinceMs);
56778
+ return { ran: false, ok: false };
56779
+ }
56686
56780
  if (decision.stuck) {
56687
56781
  process.stderr.write(
56688
56782
  `direct-chat-channel: previous poll wedged >${POLL_STUCK_MS}ms \u2014 superseding so the pull loop self-heals
@@ -56691,6 +56785,7 @@ async function pollOnce(sinceMs) {
56691
56785
  }
56692
56786
  pollGuard.inFlight = true;
56693
56787
  pollGuard.inFlightSinceMs = Date.now();
56788
+ lastPollRetryAfterMs = void 0;
56694
56789
  try {
56695
56790
  const ok = await pollForMessages(sinceMs);
56696
56791
  return { ran: true, ok };
@@ -56698,6 +56793,9 @@ async function pollOnce(sinceMs) {
56698
56793
  pollGuard.inFlight = false;
56699
56794
  pollGuard.inFlightSinceMs = null;
56700
56795
  pollGuard.leaseUntilMs = null;
56796
+ pollFollowUps.afterPoll((s) => {
56797
+ void pollOnce(s);
56798
+ }, sinceMs, lastPollRetryAfterMs);
56701
56799
  }
56702
56800
  }
56703
56801
  var doorbellWatcher = null;
package/dist/mcp/index.js CHANGED
@@ -32176,6 +32176,31 @@ var FLAG_REGISTRY = [
32176
32176
  // edec921a519f); THREATS_FOUND rows stay hidden either way.
32177
32177
  defaultValue: false
32178
32178
  },
32179
+ {
32180
+ key: "direct-chat-extracted-text",
32181
+ // ENG-11967 part 2b. Read stage-wide only (empty scope), like
32182
+ // direct-chat-malware-scan: a scoped override would do nothing.
32183
+ stageWideOnly: true,
32184
+ sensitive: true,
32185
+ description: `Serve a Direct Chat PDF or DOCX to the agent as its EXTRACTED TEXT instead of the raw file (ENG-11967 part 2b, Sherlock ruling (a)). off = today: the agent gets the raw file (scan-gated). hold-30s / hold-60s / hold-120s = armed, and the value is the HOLD CAP: the agent poll does not claim a message whose text is not ready yet for up to that long, and holds the rest of its session with it so order is kept. Holds chain: a message also waits for every document sent after it in the same session, so its delay is bounded by the cap measured from the LAST document in a run of sends, not from its own send. Ready text is delivered as <name>.txt. If extraction finished without text, or died, the message is released at once with "text extraction unavailable for <name> (couldn't read the file)" or "(timed out)"; at the cap it is released with "(timed out)" and the release is logged. Takes effect only while direct-chat-malware-scan is on, because extraction runs on GuardDuty's clean-scan event. ARM ONLY AFTER DIRECT_CHAT_TEXT_EXTRACTION=true has deployed the DirectChatTextExtract Lambda: armed without it, every PDF/DOCX waits out the cap and arrives as a timed-out notice. A flag-store read error counts as off on this read path. GLOBAL ONLY: evaluated with an empty context, so scoped overrides have no effect.`,
32186
+ flagType: "enum",
32187
+ allowedValues: ["off", "hold-30s", "hold-60s", "hold-120s"],
32188
+ // Off is the pre-2b behaviour: no hold, no .txt read, the raw file.
32189
+ defaultValue: "off",
32190
+ // The flag is evaluated server-side, but its notice entries need the host's
32191
+ // direct-chat MCP to render them: an older agt-cli shows a notice as
32192
+ // "download failed; ask the user to re-send", which sends users in circles
32193
+ // (Sherlock, 13 Nov). So the flip-reach modal must count hosts by the CLI
32194
+ // that renders notices. 0.28.1252 is the first published agt-cli carrying
32195
+ // #7579's MCP change (tag agt-cli-0.28.1252, published from caf64c0b5; the
32196
+ // publish run on #7579's own merge commit 38465ce5f failed). Arm only when
32197
+ // the modal shows 0 stale and 0 unknown hosts. The reach count covers only
32198
+ // active hosts seen in the last 24h (routes/flags.ts), so also confirm no
32199
+ // active host older than 0.28.1252 is offline before arming the stage-wide
32200
+ // flip: one that reconnects later receives the armed flag on its first
32201
+ // heartbeat (CodeRabbit on #7588).
32202
+ since: "0.28.1252"
32203
+ },
32179
32204
  {
32180
32205
  key: "platform-held-key-central-probe",
32181
32206
  description: "Arm the scheduled CENTRAL connectivity probe lane for platform-held-key integrations (ENG-10086). These store no customer credential (auth_type none), so the host cannot probe them and reports unverified forever. When on, the hourly PlatformHeldKeyProbe cron runs each central probe that exists (today only ninjafy-notes: org entitlement + broker routing, never note contents) and writes the result through the monitor observation path, so consecutive_connectivity_failures / _ok_cycles move and integration_down alerts can open and close on it. Definitions with no central probe are skipped, never written as a failure. When off the cron reads nothing and writes nothing. Boolean gate; ships dark because a new writer of the escalation counters is a paging change. GLOBAL ONLY: the cron and the host connectivity route both evaluate this flag with an empty context, so an org-, team- or agent-scoped override is stored but has NO effect. Arm it by its global value, not as a staged per-org rollout (Obi Wan 63053d02035e).",
@@ -33034,6 +33059,18 @@ var FLAG_REGISTRY = [
33034
33059
  // honours the filter is unproven, so an org must not switch it on for itself.
33035
33060
  platformAdminOnly: true
33036
33061
  },
33062
+ {
33063
+ key: "agent-email-inbox",
33064
+ description: "ENG-12021 - lets an owner/admin give one agent its own email address on the platform's agent mail domain, provisioned as a Resend Inbox, which the agent can list, search and read. OFF (default) = the provisioning route refuses and no inbox can be created. This flag is ROLLOUT CONTROL, NOT the revocation: it decides whether an org may provision, and turning it off does NOT take the tools away from an agent that already has an address - `agent_email_inboxes.status` does that, and is what to reach for in an incident. Nor is it the only gate, and the two secrets do NOT gate the same things: AGENT_INBOX_RESEND_API_KEY gates EVERYTHING (unset = provisioning refuses AND every tool call on an existing inbox answers not_configured), while AGENT_INBOX_DOMAIN is read only when MINTING an address - so clearing the domain stops new inboxes and leaves an agent that already has one still reading its mail (NOT replying - this slice ships no send or reply tool at all; that is PR B). Do not reach for either as a kill switch; the status column is the one. A per-org cap refuses provisioning past its limit regardless of this flag. BEFORE ARMING THIS FOR AN ORG, verify cross-inbox thread isolation against a real key: the inbox segment of every Resend path is server-derived from the agent's own row, but thread_id is an AGENT-SUPPLIED argument, and Resend documents no error for a thread that belongs to a different inbox. Their thread response carries no inbox field either, so this cannot be re-checked on our side after the fact - it is a vendor behaviour that has to be measured once (request one inbox's thread id under another inbox and confirm a 404), not an invariant this code can enforce. Platform-admin-only AND sensitive because each inbox is a RECURRING monthly cost with no per-unit billing primitive behind it (ENG-8720) - an org must not be able to switch on a subscription for itself, and the cap is the only thing metering it.",
33065
+ flagType: "boolean",
33066
+ defaultValue: false,
33067
+ sensitive: true,
33068
+ platformAdminOnly: true
33069
+ // Deliberately NO envVar. The reader is the API, server-side, which can call the
33070
+ // flag evaluator directly - so there is no host-side bash hook needing a
33071
+ // materialised value, and declaring one would only create a literal for the
33072
+ // ENG-8303 sst-pin guard to catch.
33073
+ },
33037
33074
  {
33038
33075
  key: "premium-gateway-inference",
33039
33076
  description: "ENG-10865 / ADR-0117 - RESERVED, and INERT until the runtime wiring lands. Turning it ON today mints nothing and delivers nothing: no caller invokes the mint client yet, resolveBindingCredential is unchanged, and a gateway binding still resolves `blocked-gateway` either way. The flag is registered ahead of that wiring on purpose - see below - so an operator must not read it as a working switch. ONCE WIRED, ON will mean the API mints a budgeted key per agent and the host spawns against the gateway, so that a policy whose ACTIVE binding is transport=gateway with credential_owner=platform resolves `applied`; OFF will remain exactly the fleet behaviour before this flag existed. Registered early and kept deliberately SEPARATE from holding AI_GATEWAY_MINT_TOKEN, because possessing the minting credential is not clearance to spend platform money on a customer agent - the ENG-8247 shape. The secret is set in prod BEFORE ADR-0117 is accepted, before metering exists (ENG-10867) and before the premium opt-in is registered (ENG-10868), so presence of the credential must not be the gate. Boolean.",
@@ -49898,7 +49935,7 @@ function registerApprovalTools(server2, deps) {
49898
49935
  detail: external_exports.record(external_exports.unknown()).optional().describe(
49899
49936
  "Optional structured context for the approver (display + audit only; never executed). When the action is sending an email, include email: { to, from, subject } (to: an address or a list of them; from: the mailbox it goes out from) so the approval card shows From / To / Subject. Asking again with a different detail under the same idempotency_key is a different request."
49900
49937
  ),
49901
- ttl_seconds: external_exports.number().int().optional().describe("How long the request stays open before it times out (default 3600; clamped to [60, 86400])."),
49938
+ ttl_seconds: external_exports.number().int().optional().describe("How long the request stays open before it times out, in seconds (default 14400 = 4 hours; clamped to [60, 86400]). Omit it to get the default; do not pass a shorter value unless the action genuinely goes stale sooner."),
49902
49939
  kanban_item_id: external_exports.string().uuid().optional().describe(
49903
49940
  'The id of YOUR kanban card this approval is about. Pass it whenever the ask belongs to a card: the platform tries to park that card as waiting on this approval, so the approver can Approve/Deny from the card itself and the answer reaches this request. The result says whether the link happened (kanban_link); if it did not, the reason is given and the card is NOT waiting on the approval. Do NOT also park the card as a "human" wait with your own Approve/Deny choices; that creates a second ask the approval never hears, and the request expires.'
49904
49941
  )
@@ -45978,6 +45978,31 @@ var FLAG_REGISTRY = [
45978
45978
  // edec921a519f); THREATS_FOUND rows stay hidden either way.
45979
45979
  defaultValue: false
45980
45980
  },
45981
+ {
45982
+ key: "direct-chat-extracted-text",
45983
+ // ENG-11967 part 2b. Read stage-wide only (empty scope), like
45984
+ // direct-chat-malware-scan: a scoped override would do nothing.
45985
+ stageWideOnly: true,
45986
+ sensitive: true,
45987
+ description: `Serve a Direct Chat PDF or DOCX to the agent as its EXTRACTED TEXT instead of the raw file (ENG-11967 part 2b, Sherlock ruling (a)). off = today: the agent gets the raw file (scan-gated). hold-30s / hold-60s / hold-120s = armed, and the value is the HOLD CAP: the agent poll does not claim a message whose text is not ready yet for up to that long, and holds the rest of its session with it so order is kept. Holds chain: a message also waits for every document sent after it in the same session, so its delay is bounded by the cap measured from the LAST document in a run of sends, not from its own send. Ready text is delivered as <name>.txt. If extraction finished without text, or died, the message is released at once with "text extraction unavailable for <name> (couldn't read the file)" or "(timed out)"; at the cap it is released with "(timed out)" and the release is logged. Takes effect only while direct-chat-malware-scan is on, because extraction runs on GuardDuty's clean-scan event. ARM ONLY AFTER DIRECT_CHAT_TEXT_EXTRACTION=true has deployed the DirectChatTextExtract Lambda: armed without it, every PDF/DOCX waits out the cap and arrives as a timed-out notice. A flag-store read error counts as off on this read path. GLOBAL ONLY: evaluated with an empty context, so scoped overrides have no effect.`,
45988
+ flagType: "enum",
45989
+ allowedValues: ["off", "hold-30s", "hold-60s", "hold-120s"],
45990
+ // Off is the pre-2b behaviour: no hold, no .txt read, the raw file.
45991
+ defaultValue: "off",
45992
+ // The flag is evaluated server-side, but its notice entries need the host's
45993
+ // direct-chat MCP to render them: an older agt-cli shows a notice as
45994
+ // "download failed; ask the user to re-send", which sends users in circles
45995
+ // (Sherlock, 13 Nov). So the flip-reach modal must count hosts by the CLI
45996
+ // that renders notices. 0.28.1252 is the first published agt-cli carrying
45997
+ // #7579's MCP change (tag agt-cli-0.28.1252, published from caf64c0b5; the
45998
+ // publish run on #7579's own merge commit 38465ce5f failed). Arm only when
45999
+ // the modal shows 0 stale and 0 unknown hosts. The reach count covers only
46000
+ // active hosts seen in the last 24h (routes/flags.ts), so also confirm no
46001
+ // active host older than 0.28.1252 is offline before arming the stage-wide
46002
+ // flip: one that reconnects later receives the armed flag on its first
46003
+ // heartbeat (CodeRabbit on #7588).
46004
+ since: "0.28.1252"
46005
+ },
45981
46006
  {
45982
46007
  key: "platform-held-key-central-probe",
45983
46008
  description: "Arm the scheduled CENTRAL connectivity probe lane for platform-held-key integrations (ENG-10086). These store no customer credential (auth_type none), so the host cannot probe them and reports unverified forever. When on, the hourly PlatformHeldKeyProbe cron runs each central probe that exists (today only ninjafy-notes: org entitlement + broker routing, never note contents) and writes the result through the monitor observation path, so consecutive_connectivity_failures / _ok_cycles move and integration_down alerts can open and close on it. Definitions with no central probe are skipped, never written as a failure. When off the cron reads nothing and writes nothing. Boolean gate; ships dark because a new writer of the escalation counters is a paging change. GLOBAL ONLY: the cron and the host connectivity route both evaluate this flag with an empty context, so an org-, team- or agent-scoped override is stored but has NO effect. Arm it by its global value, not as a staged per-org rollout (Obi Wan 63053d02035e).",
@@ -46836,6 +46861,18 @@ var FLAG_REGISTRY = [
46836
46861
  // honours the filter is unproven, so an org must not switch it on for itself.
46837
46862
  platformAdminOnly: true
46838
46863
  },
46864
+ {
46865
+ key: "agent-email-inbox",
46866
+ description: "ENG-12021 - lets an owner/admin give one agent its own email address on the platform's agent mail domain, provisioned as a Resend Inbox, which the agent can list, search and read. OFF (default) = the provisioning route refuses and no inbox can be created. This flag is ROLLOUT CONTROL, NOT the revocation: it decides whether an org may provision, and turning it off does NOT take the tools away from an agent that already has an address - `agent_email_inboxes.status` does that, and is what to reach for in an incident. Nor is it the only gate, and the two secrets do NOT gate the same things: AGENT_INBOX_RESEND_API_KEY gates EVERYTHING (unset = provisioning refuses AND every tool call on an existing inbox answers not_configured), while AGENT_INBOX_DOMAIN is read only when MINTING an address - so clearing the domain stops new inboxes and leaves an agent that already has one still reading its mail (NOT replying - this slice ships no send or reply tool at all; that is PR B). Do not reach for either as a kill switch; the status column is the one. A per-org cap refuses provisioning past its limit regardless of this flag. BEFORE ARMING THIS FOR AN ORG, verify cross-inbox thread isolation against a real key: the inbox segment of every Resend path is server-derived from the agent's own row, but thread_id is an AGENT-SUPPLIED argument, and Resend documents no error for a thread that belongs to a different inbox. Their thread response carries no inbox field either, so this cannot be re-checked on our side after the fact - it is a vendor behaviour that has to be measured once (request one inbox's thread id under another inbox and confirm a 404), not an invariant this code can enforce. Platform-admin-only AND sensitive because each inbox is a RECURRING monthly cost with no per-unit billing primitive behind it (ENG-8720) - an org must not be able to switch on a subscription for itself, and the cap is the only thing metering it.",
46867
+ flagType: "boolean",
46868
+ defaultValue: false,
46869
+ sensitive: true,
46870
+ platformAdminOnly: true
46871
+ // Deliberately NO envVar. The reader is the API, server-side, which can call the
46872
+ // flag evaluator directly - so there is no host-side bash hook needing a
46873
+ // materialised value, and declaring one would only create a literal for the
46874
+ // ENG-8303 sst-pin guard to catch.
46875
+ },
46839
46876
  {
46840
46877
  key: "premium-gateway-inference",
46841
46878
  description: "ENG-10865 / ADR-0117 - RESERVED, and INERT until the runtime wiring lands. Turning it ON today mints nothing and delivers nothing: no caller invokes the mint client yet, resolveBindingCredential is unchanged, and a gateway binding still resolves `blocked-gateway` either way. The flag is registered ahead of that wiring on purpose - see below - so an operator must not read it as a working switch. ONCE WIRED, ON will mean the API mints a budgeted key per agent and the host spawns against the gateway, so that a policy whose ACTIVE binding is transport=gateway with credential_owner=platform resolves `applied`; OFF will remain exactly the fleet behaviour before this flag existed. Registered early and kept deliberately SEPARATE from holding AI_GATEWAY_MINT_TOKEN, because possessing the minting credential is not clearance to spend platform money on a customer agent - the ENG-8247 shape. The secret is set in prod BEFORE ADR-0117 is accepted, before metering exists (ENG-10867) and before the premium opt-in is registered (ENG-10868), so presence of the credential must not be the gate. Boolean.",
@@ -40833,6 +40833,31 @@ var FLAG_REGISTRY = [
40833
40833
  // edec921a519f); THREATS_FOUND rows stay hidden either way.
40834
40834
  defaultValue: false
40835
40835
  },
40836
+ {
40837
+ key: "direct-chat-extracted-text",
40838
+ // ENG-11967 part 2b. Read stage-wide only (empty scope), like
40839
+ // direct-chat-malware-scan: a scoped override would do nothing.
40840
+ stageWideOnly: true,
40841
+ sensitive: true,
40842
+ description: `Serve a Direct Chat PDF or DOCX to the agent as its EXTRACTED TEXT instead of the raw file (ENG-11967 part 2b, Sherlock ruling (a)). off = today: the agent gets the raw file (scan-gated). hold-30s / hold-60s / hold-120s = armed, and the value is the HOLD CAP: the agent poll does not claim a message whose text is not ready yet for up to that long, and holds the rest of its session with it so order is kept. Holds chain: a message also waits for every document sent after it in the same session, so its delay is bounded by the cap measured from the LAST document in a run of sends, not from its own send. Ready text is delivered as <name>.txt. If extraction finished without text, or died, the message is released at once with "text extraction unavailable for <name> (couldn't read the file)" or "(timed out)"; at the cap it is released with "(timed out)" and the release is logged. Takes effect only while direct-chat-malware-scan is on, because extraction runs on GuardDuty's clean-scan event. ARM ONLY AFTER DIRECT_CHAT_TEXT_EXTRACTION=true has deployed the DirectChatTextExtract Lambda: armed without it, every PDF/DOCX waits out the cap and arrives as a timed-out notice. A flag-store read error counts as off on this read path. GLOBAL ONLY: evaluated with an empty context, so scoped overrides have no effect.`,
40843
+ flagType: "enum",
40844
+ allowedValues: ["off", "hold-30s", "hold-60s", "hold-120s"],
40845
+ // Off is the pre-2b behaviour: no hold, no .txt read, the raw file.
40846
+ defaultValue: "off",
40847
+ // The flag is evaluated server-side, but its notice entries need the host's
40848
+ // direct-chat MCP to render them: an older agt-cli shows a notice as
40849
+ // "download failed; ask the user to re-send", which sends users in circles
40850
+ // (Sherlock, 13 Nov). So the flip-reach modal must count hosts by the CLI
40851
+ // that renders notices. 0.28.1252 is the first published agt-cli carrying
40852
+ // #7579's MCP change (tag agt-cli-0.28.1252, published from caf64c0b5; the
40853
+ // publish run on #7579's own merge commit 38465ce5f failed). Arm only when
40854
+ // the modal shows 0 stale and 0 unknown hosts. The reach count covers only
40855
+ // active hosts seen in the last 24h (routes/flags.ts), so also confirm no
40856
+ // active host older than 0.28.1252 is offline before arming the stage-wide
40857
+ // flip: one that reconnects later receives the armed flag on its first
40858
+ // heartbeat (CodeRabbit on #7588).
40859
+ since: "0.28.1252"
40860
+ },
40836
40861
  {
40837
40862
  key: "platform-held-key-central-probe",
40838
40863
  description: "Arm the scheduled CENTRAL connectivity probe lane for platform-held-key integrations (ENG-10086). These store no customer credential (auth_type none), so the host cannot probe them and reports unverified forever. When on, the hourly PlatformHeldKeyProbe cron runs each central probe that exists (today only ninjafy-notes: org entitlement + broker routing, never note contents) and writes the result through the monitor observation path, so consecutive_connectivity_failures / _ok_cycles move and integration_down alerts can open and close on it. Definitions with no central probe are skipped, never written as a failure. When off the cron reads nothing and writes nothing. Boolean gate; ships dark because a new writer of the escalation counters is a paging change. GLOBAL ONLY: the cron and the host connectivity route both evaluate this flag with an empty context, so an org-, team- or agent-scoped override is stored but has NO effect. Arm it by its global value, not as a staged per-org rollout (Obi Wan 63053d02035e).",
@@ -41691,6 +41716,18 @@ var FLAG_REGISTRY = [
41691
41716
  // honours the filter is unproven, so an org must not switch it on for itself.
41692
41717
  platformAdminOnly: true
41693
41718
  },
41719
+ {
41720
+ key: "agent-email-inbox",
41721
+ description: "ENG-12021 - lets an owner/admin give one agent its own email address on the platform's agent mail domain, provisioned as a Resend Inbox, which the agent can list, search and read. OFF (default) = the provisioning route refuses and no inbox can be created. This flag is ROLLOUT CONTROL, NOT the revocation: it decides whether an org may provision, and turning it off does NOT take the tools away from an agent that already has an address - `agent_email_inboxes.status` does that, and is what to reach for in an incident. Nor is it the only gate, and the two secrets do NOT gate the same things: AGENT_INBOX_RESEND_API_KEY gates EVERYTHING (unset = provisioning refuses AND every tool call on an existing inbox answers not_configured), while AGENT_INBOX_DOMAIN is read only when MINTING an address - so clearing the domain stops new inboxes and leaves an agent that already has one still reading its mail (NOT replying - this slice ships no send or reply tool at all; that is PR B). Do not reach for either as a kill switch; the status column is the one. A per-org cap refuses provisioning past its limit regardless of this flag. BEFORE ARMING THIS FOR AN ORG, verify cross-inbox thread isolation against a real key: the inbox segment of every Resend path is server-derived from the agent's own row, but thread_id is an AGENT-SUPPLIED argument, and Resend documents no error for a thread that belongs to a different inbox. Their thread response carries no inbox field either, so this cannot be re-checked on our side after the fact - it is a vendor behaviour that has to be measured once (request one inbox's thread id under another inbox and confirm a 404), not an invariant this code can enforce. Platform-admin-only AND sensitive because each inbox is a RECURRING monthly cost with no per-unit billing primitive behind it (ENG-8720) - an org must not be able to switch on a subscription for itself, and the cap is the only thing metering it.",
41722
+ flagType: "boolean",
41723
+ defaultValue: false,
41724
+ sensitive: true,
41725
+ platformAdminOnly: true
41726
+ // Deliberately NO envVar. The reader is the API, server-side, which can call the
41727
+ // flag evaluator directly - so there is no host-side bash hook needing a
41728
+ // materialised value, and declaring one would only create a literal for the
41729
+ // ENG-8303 sst-pin guard to catch.
41730
+ },
41694
41731
  {
41695
41732
  key: "premium-gateway-inference",
41696
41733
  description: "ENG-10865 / ADR-0117 - RESERVED, and INERT until the runtime wiring lands. Turning it ON today mints nothing and delivers nothing: no caller invokes the mint client yet, resolveBindingCredential is unchanged, and a gateway binding still resolves `blocked-gateway` either way. The flag is registered ahead of that wiring on purpose - see below - so an operator must not read it as a working switch. ONCE WIRED, ON will mean the API mints a budgeted key per agent and the host spawns against the gateway, so that a policy whose ACTIVE binding is transport=gateway with credential_owner=platform resolves `applied`; OFF will remain exactly the fleet behaviour before this flag existed. Registered early and kept deliberately SEPARATE from holding AI_GATEWAY_MINT_TOKEN, because possessing the minting credential is not clearance to spend platform money on a customer agent - the ENG-8247 shape. The secret is set in prod BEFORE ADR-0117 is accepted, before metering exists (ENG-10867) and before the premium opt-in is registered (ENG-10868), so presence of the credential must not be the gate. Boolean.",