@integrity-labs/agt-cli 0.28.1260 → 0.28.1262

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 (36) hide show
  1. package/dist/{api-client-PXVHBJBB.js → api-client-DQ7YV5IG.js} +3 -3
  2. package/dist/bin/agt.js +7 -7
  3. package/dist/{chunk-UKZ3NXB7.js → chunk-5BXIXSSH.js} +2 -2
  4. package/dist/{chunk-7EEU3X3T.js → chunk-6YWVKLHF.js} +3 -3
  5. package/dist/{chunk-E7DKUEXC.js → chunk-CEJNJ6NF.js} +3 -3
  6. package/dist/{chunk-LLVL6LIB.js → chunk-HJWOXFJM.js} +2 -2
  7. package/dist/{chunk-UQLSI3C7.js → chunk-KJ5OCCSJ.js} +98 -6
  8. package/dist/chunk-KJ5OCCSJ.js.map +1 -0
  9. package/dist/{chunk-NABJJPLW.js → chunk-PIKXAEVA.js} +525 -254
  10. package/dist/chunk-PIKXAEVA.js.map +1 -0
  11. package/dist/{claude-code-updater-OXTQF5E5.js → claude-code-updater-JQLNRK25.js} +3 -3
  12. package/dist/{claude-pair-runtime-BBOAF76W.js → claude-pair-runtime-BJ3EAWEJ.js} +3 -3
  13. package/dist/lib/manager-worker.js +580 -427
  14. package/dist/lib/manager-worker.js.map +1 -1
  15. package/dist/mcp/direct-chat-channel.js +94 -2
  16. package/dist/mcp/index.js +94 -2
  17. package/dist/mcp/origami.js +94 -2
  18. package/dist/mcp/slack-channel.js +94 -2
  19. package/dist/mcp/teams-channel.js +218 -82
  20. package/dist/mcp/telegram-channel.js +252 -2
  21. package/dist/{persistent-session-XPDKIBEM.js → persistent-session-YNHYNCNA.js} +4 -4
  22. package/dist/{responsiveness-probe-4B6Y2446.js → responsiveness-probe-57RV3U2H.js} +4 -4
  23. package/dist/{session-auth-dead-4C7AK3A6.js → session-auth-dead-A3TO2N63.js} +3 -3
  24. package/package.json +1 -1
  25. package/dist/chunk-NABJJPLW.js.map +0 -1
  26. package/dist/chunk-UQLSI3C7.js.map +0 -1
  27. /package/dist/{api-client-PXVHBJBB.js.map → api-client-DQ7YV5IG.js.map} +0 -0
  28. /package/dist/{chunk-UKZ3NXB7.js.map → chunk-5BXIXSSH.js.map} +0 -0
  29. /package/dist/{chunk-7EEU3X3T.js.map → chunk-6YWVKLHF.js.map} +0 -0
  30. /package/dist/{chunk-E7DKUEXC.js.map → chunk-CEJNJ6NF.js.map} +0 -0
  31. /package/dist/{chunk-LLVL6LIB.js.map → chunk-HJWOXFJM.js.map} +0 -0
  32. /package/dist/{claude-code-updater-OXTQF5E5.js.map → claude-code-updater-JQLNRK25.js.map} +0 -0
  33. /package/dist/{claude-pair-runtime-BBOAF76W.js.map → claude-pair-runtime-BJ3EAWEJ.js.map} +0 -0
  34. /package/dist/{persistent-session-XPDKIBEM.js.map → persistent-session-YNHYNCNA.js.map} +0 -0
  35. /package/dist/{responsiveness-probe-4B6Y2446.js.map → responsiveness-probe-57RV3U2H.js.map} +0 -0
  36. /package/dist/{session-auth-dead-4C7AK3A6.js.map → session-auth-dead-A3TO2N63.js.map} +0 -0
@@ -13915,17 +13915,17 @@ var StdioServerTransport = class {
13915
13915
  import {
13916
13916
  existsSync as existsSync6,
13917
13917
  mkdirSync as mkdirSync7,
13918
- readdirSync as readdirSync3,
13919
- readFileSync as readFileSync8,
13918
+ readdirSync as readdirSync4,
13919
+ readFileSync as readFileSync9,
13920
13920
  renameSync as renameSync3,
13921
13921
  rmSync,
13922
13922
  statSync,
13923
13923
  unlinkSync as unlinkSync3,
13924
13924
  watch,
13925
- writeFileSync as writeFileSync7
13925
+ writeFileSync as writeFileSync8
13926
13926
  } from "fs";
13927
13927
  import { homedir as homedir4 } from "os";
13928
- import { join as join11, resolve as resolvePath2 } from "path";
13928
+ import { join as join12, resolve as resolvePath2 } from "path";
13929
13929
  import { basename } from "path";
13930
13930
 
13931
13931
  // ../core/dist/channels/msteams-api.js
@@ -14315,6 +14315,26 @@ function resolveGhostReplyMode(opts) {
14315
14315
  if (cached2 !== void 0) return cached2;
14316
14316
  return "off";
14317
14317
  }
14318
+ var GHOST_REPLY_NARRATION_GUARD_FLAG_KEY = "ghost-reply-narration-guard";
14319
+ function resolveGhostReplyNarrationGuardMode(opts) {
14320
+ const env = opts?.env ?? process.env;
14321
+ const parse3 = (raw) => {
14322
+ const v = typeof raw === "string" ? raw.trim().toLowerCase() : "";
14323
+ return v === "off" || v === "shadow" || v === "enforce" ? v : void 0;
14324
+ };
14325
+ const override = parse3(env["AGT_GHOST_REPLY_NARRATION_GUARD_MODE"]);
14326
+ if (override) return override;
14327
+ try {
14328
+ const path = opts?.cachePath ?? defaultFlagsCachePath(env);
14329
+ if (existsSync(path)) {
14330
+ const parsed = JSON.parse(readFileSync(path, "utf8"));
14331
+ const cached2 = parse3(parsed?.flags?.[GHOST_REPLY_NARRATION_GUARD_FLAG_KEY]);
14332
+ if (cached2) return cached2;
14333
+ }
14334
+ } catch {
14335
+ }
14336
+ return "shadow";
14337
+ }
14318
14338
 
14319
14339
  // src/reply-intent-runtime.ts
14320
14340
  import { execFile } from "child_process";
@@ -14508,6 +14528,48 @@ function shouldDeliverWithoutClassifying(text) {
14508
14528
  if (/<[@#][A-Z0-9]/.test(t)) return true;
14509
14529
  return false;
14510
14530
  }
14531
+ var STAND_DOWN_NARRATION = [
14532
+ /\bstanding by\b/i,
14533
+ /\bstaying (silent|quiet|out)\b/i,
14534
+ /\bstand(ing)? down\b/i,
14535
+ /\bnot (addressed to|for|directed at) me\b/i,
14536
+ /\bno (reply|response) (is )?(needed|required|owed)\b/i,
14537
+ /\bnot replying\b/i,
14538
+ /\breacted,? nothing else\b/i,
14539
+ /\bcard (is )?parked\b/i,
14540
+ /\bparked (in|on) (todo|waiting|backlog)\b/i
14541
+ ];
14542
+ function withoutAddress(text, name) {
14543
+ const escaped = name.replace(/[.*+?^\${}()|[\]\\]/g, "\\$&");
14544
+ return text.replace(
14545
+ new RegExp(`^\\s*(?:(?:hi|hey|hello|thanks|thank you|ok|okay|sure|yes|no),?\\s+)?${escaped}\\s*[,:!.\\-]`, "i"),
14546
+ ""
14547
+ ).replace(new RegExp(`(?:thanks|thank you|cheers),?\\s+${escaped}\\s*[.!]*\\s*$`, "i"), "").replace(new RegExp(`,\\s*${escaped}\\s*[.!]*\\s*$`, "i"), "");
14548
+ }
14549
+ function detectInternalNarration(text, addresseeName) {
14550
+ const t = String(text ?? "");
14551
+ if (!t.trim() || shouldDeliverWithoutClassifying(t)) return null;
14552
+ if (STAND_DOWN_NARRATION.some((re) => re.test(t))) return "stand_down";
14553
+ const raw = String(addresseeName ?? "").trim().split(/\s+/)[0] ?? "";
14554
+ const first = raw.charAt(0).toUpperCase() + raw.slice(1);
14555
+ if (first.length >= 3) {
14556
+ const escaped = first.replace(/[.*+?^\${}()|[\]\\]/g, "\\$&");
14557
+ if (new RegExp(`\\b${escaped}\\b`).test(withoutAddress(t, first))) {
14558
+ return "third_person_addressee";
14559
+ }
14560
+ }
14561
+ return null;
14562
+ }
14563
+ function decideNarrationGuard(opts) {
14564
+ if (!opts.match || opts.mode !== "enforce") return "publish";
14565
+ if (!opts.marker) return "publish";
14566
+ if (opts.marker.owesNoReply) return "close";
14567
+ if (!opts.marker.hasPayload || !opts.replayEnabled) return "publish";
14568
+ const mostReplays = opts.marker.maxReplayCount ?? opts.marker.replayCount;
14569
+ if (opts.match === "third_person_addressee" && mostReplays >= opts.maxReplays) return "publish";
14570
+ if (opts.marker.replayCount < opts.maxReplays) return "redeliver";
14571
+ return opts.match === "stand_down" ? "close" : "publish";
14572
+ }
14511
14573
  async function decideRecovery(text, mode, env = process.env, classify = classifyRecoveredReply) {
14512
14574
  if (shouldDeliverWithoutClassifying(text)) {
14513
14575
  return { action: "deliver", mode, verdict: "pre-gate-deliver", wouldSuppress: false };
@@ -14522,6 +14584,49 @@ function formatRecoveryDecisionLog(opts) {
14522
14584
  return `${channel}(${agent}): ghost-reply-decision mode=${decision.mode} verdict=${decision.verdict} action=${decision.action} would_suppress=${decision.wouldSuppress} ${target} text_len=${text.length} text=${JSON.stringify(text)}`;
14523
14585
  }
14524
14586
 
14587
+ // src/ack-reaction.ts
14588
+ import { readdirSync, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "fs";
14589
+ import { join as join3 } from "path";
14590
+
14591
+ // ../core/dist/channels/deflection-causes.js
14592
+ var DEFLECTION_CAUSES = [
14593
+ "integration_down",
14594
+ "session_dead",
14595
+ "wedged",
14596
+ "busy",
14597
+ "duplicate",
14598
+ // ENG-8387: an `app_mention` — the CANONICAL delivery of an @mention — dropped
14599
+ // by the fresh-ingress dedup. Split out of the generic `duplicate` bucket
14600
+ // because the two mean very different things: `duplicate` is dominated by the
14601
+ // deliberate, high-volume ENG-6378 echo drop and by routine reconnect
14602
+ // redelivery, both benign, while a dropped app_mention has the exact shape of
14603
+ // a lost mention. Conflated, the second is invisible inside the first — which
14604
+ // is how ENG-6378's silent loss ran unobserved.
14605
+ "duplicate_mention",
14606
+ "mention_echo_orphan",
14607
+ "replay_orphaned",
14608
+ "replay_exhausted",
14609
+ // ENG-9414 — see the type union above for why these two exist. Both are
14610
+ // message-loss classes the pre-existing causes were structurally unable to
14611
+ // observe, which is why four destroyed customer inbounds in one hour
14612
+ // produced zero alerts.
14613
+ "aged_out_unrecoverable",
14614
+ "marker_corrupt",
14615
+ "unknown"
14616
+ ];
14617
+ var DEFLECTION_CAUSE_SET = new Set(DEFLECTION_CAUSES);
14618
+
14619
+ // src/ack-reaction.ts
14620
+ var REPLY_WEDGED_THRESHOLD_MS = 5 * 60 * 1e3;
14621
+ var UNDELIVERABLE_NOTICE_THROTTLE_MS = 5 * 60 * 1e3;
14622
+ var BUSY_ACK_NOTICE_THROTTLE_MS = 20 * 60 * 1e3;
14623
+ var GIVE_UP_SIGNAL_MAX_AGE_MS = 30 * 60 * 1e3;
14624
+ var USAGE_LIMIT_LIVE_WINDOW_MS = 3 * 6e4;
14625
+ var BLOCKED_PROMPT_LIVE_WINDOW_MS = 3 * 6e4;
14626
+ var ORPHAN_SWEEP_INTERVAL_MS = 30 * 60 * 1e3;
14627
+ var MAX_MARKER_REPLAYS = 3;
14628
+ var PANE_FRESH_DEFER_MAX_MS = 10 * 60 * 1e3;
14629
+
14525
14630
  // src/transient-api-error.ts
14526
14631
  var CODE_KIND = {
14527
14632
  "429": "rate_limit",
@@ -14571,8 +14676,8 @@ function emitTransientApiErrorTelemetry(channel, match, original) {
14571
14676
  }
14572
14677
 
14573
14678
  // src/msteams-inbound-puller.ts
14574
- import { existsSync as existsSync3, mkdirSync as mkdirSync2, readdirSync, utimesSync, writeFileSync as writeFileSync2 } from "fs";
14575
- import { join as join3 } from "path";
14679
+ import { existsSync as existsSync3, mkdirSync as mkdirSync2, readdirSync as readdirSync2, utimesSync, writeFileSync as writeFileSync3 } from "fs";
14680
+ import { join as join4 } from "path";
14576
14681
  var REQUEST_TIMEOUT_MS = 1e4;
14577
14682
  var ACTIVE_INTERVAL_MS = 2e3;
14578
14683
  var IDLE_INTERVAL_MS = 1e4;
@@ -14581,16 +14686,16 @@ var IDLE_AFTER_EMPTY_PULLS = 5;
14581
14686
  function decideRowDelivery(row, dirs, exists) {
14582
14687
  if (row.kind === "interaction_answer") {
14583
14688
  const markerName = row.filename.replace(/\.answer\.json$/, ".json");
14584
- const markerPath = join3(dirs.pendingInteractionsDir, markerName);
14689
+ const markerPath = join4(dirs.pendingInteractionsDir, markerName);
14585
14690
  if (!exists(markerPath)) {
14586
14691
  return { action: "skip", reason: "stale_answer" };
14587
14692
  }
14588
- if (exists(join3(dirs.pendingInteractionsDir, row.filename))) {
14693
+ if (exists(join4(dirs.pendingInteractionsDir, row.filename))) {
14589
14694
  return { action: "skip", reason: "duplicate" };
14590
14695
  }
14591
14696
  return { action: "write", dir: dirs.pendingInteractionsDir };
14592
14697
  }
14593
- if (exists(join3(dirs.pendingInboundDir, row.filename)) || exists(join3(dirs.pendingInboundDir, ".processed", row.filename))) {
14698
+ if (exists(join4(dirs.pendingInboundDir, row.filename)) || exists(join4(dirs.pendingInboundDir, ".processed", row.filename))) {
14594
14699
  return { action: "skip", reason: "duplicate" };
14595
14700
  }
14596
14701
  return { action: "write", dir: dirs.pendingInboundDir };
@@ -14655,7 +14760,7 @@ function startMsteamsInboundPuller(args) {
14655
14760
  }
14656
14761
  function hasOutstandingInteraction() {
14657
14762
  try {
14658
- return readdirSync(dirs.pendingInteractionsDir).some(
14763
+ return readdirSync2(dirs.pendingInteractionsDir).some(
14659
14764
  (name) => name.endsWith(".json") && !name.endsWith(".answer.json")
14660
14765
  );
14661
14766
  } catch {
@@ -14679,8 +14784,8 @@ function startMsteamsInboundPuller(args) {
14679
14784
  const decision = decideRowDelivery(row, dirs, existsSync3);
14680
14785
  if (decision.action === "write") {
14681
14786
  mkdirSync2(decision.dir, { recursive: true });
14682
- const target = join3(decision.dir, row.filename);
14683
- writeFileSync2(target, JSON.stringify(row.payload, null, 2));
14787
+ const target = join4(decision.dir, row.filename);
14788
+ writeFileSync3(target, JSON.stringify(row.payload, null, 2));
14684
14789
  const created = new Date(row.created_at);
14685
14790
  if (!Number.isNaN(created.getTime())) {
14686
14791
  utimesSync(target, created, created);
@@ -14820,8 +14925,8 @@ function conversationalLaneMeta(expectsReply = true) {
14820
14925
  }
14821
14926
 
14822
14927
  // src/inbound-lane-telemetry.ts
14823
- import { readFileSync as readFileSync2, writeFileSync as writeFileSync3 } from "fs";
14824
- import { join as join4 } from "path";
14928
+ import { readFileSync as readFileSync3, writeFileSync as writeFileSync4 } from "fs";
14929
+ import { join as join5 } from "path";
14825
14930
  var LANE_CLASSIFICATION_COUNTER_SUFFIX = "-lane-classifications.json";
14826
14931
  var SUSPECTED_MISCLASSIFICATION_KEY = "suspected_misclassification";
14827
14932
  var HUMAN_CHANNEL_SOURCES = /* @__PURE__ */ new Set([
@@ -14838,10 +14943,10 @@ function isSuspectedMisclassification(lane, source) {
14838
14943
  }
14839
14944
  function recordLaneClassification(agentDir, channel, classification) {
14840
14945
  if (!agentDir) return;
14841
- const path = join4(agentDir, `${channel}${LANE_CLASSIFICATION_COUNTER_SUFFIX}`);
14946
+ const path = join5(agentDir, `${channel}${LANE_CLASSIFICATION_COUNTER_SUFFIX}`);
14842
14947
  let counts = {};
14843
14948
  try {
14844
- const parsed = JSON.parse(readFileSync2(path, "utf-8"));
14949
+ const parsed = JSON.parse(readFileSync3(path, "utf-8"));
14845
14950
  if (parsed && typeof parsed === "object") counts = parsed;
14846
14951
  } catch {
14847
14952
  }
@@ -14851,7 +14956,7 @@ function recordLaneClassification(agentDir, channel, classification) {
14851
14956
  counts[SUSPECTED_MISCLASSIFICATION_KEY] = (counts[SUSPECTED_MISCLASSIFICATION_KEY] ?? 0) + 1;
14852
14957
  }
14853
14958
  try {
14854
- writeFileSync3(path, JSON.stringify(counts), { mode: 384 });
14959
+ writeFileSync4(path, JSON.stringify(counts), { mode: 384 });
14855
14960
  } catch {
14856
14961
  }
14857
14962
  }
@@ -15134,7 +15239,7 @@ function parsePeerAgentModeEnv(raw) {
15134
15239
  }
15135
15240
 
15136
15241
  // src/teams-thread-store.ts
15137
- import { mkdirSync as mkdirSync3, readFileSync as readFileSync3, writeFileSync as writeFileSync4 } from "fs";
15242
+ import { mkdirSync as mkdirSync3, readFileSync as readFileSync4, writeFileSync as writeFileSync5 } from "fs";
15138
15243
  import { dirname } from "path";
15139
15244
  var FILE_VERSION = 1;
15140
15245
  var DEFAULT_TTL_DAYS = 30;
@@ -15148,7 +15253,7 @@ function loadThreadStore(filePath, opts = {}) {
15148
15253
  const ttlMs = ttlDays * 24 * 60 * 60 * 1e3;
15149
15254
  let raw;
15150
15255
  try {
15151
- raw = readFileSync3(filePath, "utf-8");
15256
+ raw = readFileSync4(filePath, "utf-8");
15152
15257
  } catch {
15153
15258
  return { threads: /* @__PURE__ */ new Map(), pruned: 0 };
15154
15259
  }
@@ -15201,7 +15306,7 @@ function createThreadPersister(opts) {
15201
15306
  const writeNow = (snap) => {
15202
15307
  try {
15203
15308
  mkdirSync3(dirname(opts.filePath), { recursive: true });
15204
- writeFileSync4(opts.filePath, serializeThreadStore(snap), "utf-8");
15309
+ writeFileSync5(opts.filePath, serializeThreadStore(snap), "utf-8");
15205
15310
  lastWriteAt = Date.now();
15206
15311
  } catch (err) {
15207
15312
  opts.onError?.(
@@ -15254,30 +15359,30 @@ function isThreadEntry(value) {
15254
15359
 
15255
15360
  // src/recovery-ledger.ts
15256
15361
  import { existsSync as existsSync4, unlinkSync } from "fs";
15257
- import { join as join5 } from "path";
15362
+ import { join as join6 } from "path";
15258
15363
  function removeRecoveryLedgerEntry(ledgerDir, markerName, unlink = (p) => {
15259
15364
  if (existsSync4(p)) unlinkSync(p);
15260
15365
  }) {
15261
15366
  if (!ledgerDir || !markerName) return;
15262
15367
  if (markerName.includes("/") || markerName.includes("\\") || markerName.includes("..")) return;
15263
15368
  try {
15264
- unlink(join5(ledgerDir, markerName));
15369
+ unlink(join6(ledgerDir, markerName));
15265
15370
  } catch {
15266
15371
  }
15267
15372
  }
15268
15373
 
15269
15374
  // src/inbound-delivery-ledger.ts
15270
- import { existsSync as existsSync5, mkdirSync as mkdirSync4, readdirSync as readdirSync2, readFileSync as readFileSync4, renameSync, writeFileSync as writeFileSync5 } from "fs";
15271
- import { join as join6 } from "path";
15375
+ import { existsSync as existsSync5, mkdirSync as mkdirSync4, readdirSync as readdirSync3, readFileSync as readFileSync5, renameSync, writeFileSync as writeFileSync6 } from "fs";
15376
+ import { join as join7 } from "path";
15272
15377
  function safeInboundId(inboundId) {
15273
15378
  return inboundId.replace(/[^A-Za-z0-9_-]/g, "_");
15274
15379
  }
15275
15380
  var defaultDeps = {
15276
15381
  mkdir: (dir) => mkdirSync4(dir, { recursive: true }),
15277
- writeFile: (path, data) => writeFileSync5(path, data, "utf8"),
15382
+ writeFile: (path, data) => writeFileSync6(path, data, "utf8"),
15278
15383
  rename: (from, to) => renameSync(from, to),
15279
- readdir: (dir) => readdirSync2(dir),
15280
- readFile: (path) => readFileSync4(path, "utf8"),
15384
+ readdir: (dir) => readdirSync3(dir),
15385
+ readFile: (path) => readFileSync5(path, "utf8"),
15281
15386
  exists: (path) => existsSync5(path)
15282
15387
  };
15283
15388
  function writeInboundDeliveryLedgerEntry(dir, record2, deps = defaultDeps) {
@@ -15286,7 +15391,7 @@ function writeInboundDeliveryLedgerEntry(dir, record2, deps = defaultDeps) {
15286
15391
  if (!safe || safe.includes("/") || safe.includes("\\") || safe.includes("..")) return;
15287
15392
  try {
15288
15393
  deps.mkdir(dir);
15289
- const final = join6(dir, `${safe}.json`);
15394
+ const final = join7(dir, `${safe}.json`);
15290
15395
  const tmp = `${final}.tmp`;
15291
15396
  deps.writeFile(tmp, JSON.stringify(record2));
15292
15397
  deps.rename(tmp, final);
@@ -15359,12 +15464,12 @@ var TEAMS_EGRESS_TOOLS = /* @__PURE__ */ new Set([
15359
15464
  ]);
15360
15465
 
15361
15466
  // src/turn-context.ts
15362
- import { mkdirSync as mkdirSync6, readFileSync as readFileSync7 } from "fs";
15467
+ import { mkdirSync as mkdirSync6, readFileSync as readFileSync8 } from "fs";
15363
15468
  import { homedir as homedir3 } from "os";
15364
- import { dirname as dirname3, join as join10 } from "path";
15469
+ import { dirname as dirname3, join as join11 } from "path";
15365
15470
 
15366
15471
  // ../core/dist/provisioning/frameworks/claudecode/agent-dir-alias.js
15367
- import { isAbsolute, join as join7, relative, sep } from "path";
15472
+ import { isAbsolute, join as join8, relative, sep } from "path";
15368
15473
  var VALID_CODE_NAME = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
15369
15474
  var VALID_AGENT_ID = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;
15370
15475
  var INITIATOR_BASENAME = ".current-turn-initiator.json";
@@ -15372,7 +15477,7 @@ function isSafeAgentSegment(segment) {
15372
15477
  return VALID_CODE_NAME.test(segment) || VALID_AGENT_ID.test(segment);
15373
15478
  }
15374
15479
  function initiatorDirSegment(initiatorFile, homeDir) {
15375
- const rel = relative(join7(homeDir, ".augmented"), initiatorFile);
15480
+ const rel = relative(join8(homeDir, ".augmented"), initiatorFile);
15376
15481
  if (!rel || isAbsolute(rel))
15377
15482
  return null;
15378
15483
  const parts = rel.split(sep);
@@ -15387,29 +15492,29 @@ function resolveAgentDirAlias(input) {
15387
15492
  const { codeName, turnInitiatorFile, agentId, homeDir } = input;
15388
15493
  const codeNameTrimmed = typeof codeName === "string" ? codeName.trim() : "";
15389
15494
  if (codeNameTrimmed && VALID_CODE_NAME.test(codeNameTrimmed)) {
15390
- return join7(homeDir, ".augmented", codeNameTrimmed);
15495
+ return join8(homeDir, ".augmented", codeNameTrimmed);
15391
15496
  }
15392
15497
  const initiator = typeof turnInitiatorFile === "string" ? turnInitiatorFile.trim() : "";
15393
15498
  if (initiator) {
15394
15499
  const segment = initiatorDirSegment(initiator, homeDir);
15395
15500
  if (segment)
15396
- return join7(homeDir, ".augmented", segment);
15501
+ return join8(homeDir, ".augmented", segment);
15397
15502
  }
15398
15503
  const agentIdTrimmed = typeof agentId === "string" ? agentId.trim() : "";
15399
15504
  if (agentIdTrimmed && VALID_AGENT_ID.test(agentIdTrimmed)) {
15400
- return join7(homeDir, ".augmented", agentIdTrimmed);
15505
+ return join8(homeDir, ".augmented", agentIdTrimmed);
15401
15506
  }
15402
15507
  return null;
15403
15508
  }
15404
15509
 
15405
15510
  // src/turn-initiator-marker.ts
15406
- import { writeFileSync as writeFileSync6, readFileSync as readFileSync5, mkdirSync as mkdirSync5, renameSync as renameSync2 } from "fs";
15407
- import { dirname as dirname2, join as join8 } from "path";
15511
+ import { writeFileSync as writeFileSync7, readFileSync as readFileSync6, mkdirSync as mkdirSync5, renameSync as renameSync2 } from "fs";
15512
+ import { dirname as dirname2, join as join9 } from "path";
15408
15513
  var TURN_INITIATOR_MAX_AGE_MS = 5 * 60 * 1e3;
15409
15514
  var TURN_INITIATOR_LEDGER_MAX_ENTRIES = 20;
15410
15515
  var TURN_INITIATOR_LEDGER_FILENAME = ".turn-initiator-ledger.json";
15411
15516
  function turnInitiatorLedgerPath(singleSlotFile) {
15412
- return join8(dirname2(singleSlotFile), TURN_INITIATOR_LEDGER_FILENAME);
15517
+ return join9(dirname2(singleSlotFile), TURN_INITIATOR_LEDGER_FILENAME);
15413
15518
  }
15414
15519
  function foldTurnInitiatorLedger(existing, marker, maxAgeMs = TURN_INITIATOR_MAX_AGE_MS, maxEntries = TURN_INITIATOR_LEDGER_MAX_ENTRIES) {
15415
15520
  const now = marker.ts;
@@ -15439,19 +15544,19 @@ function updateTurnInitiatorLedger(singleSlotFile, marker) {
15439
15544
  const ledgerFile = turnInitiatorLedgerPath(singleSlotFile);
15440
15545
  let existing = null;
15441
15546
  try {
15442
- const parsed = JSON.parse(readFileSync5(ledgerFile, "utf8"));
15547
+ const parsed = JSON.parse(readFileSync6(ledgerFile, "utf8"));
15443
15548
  if (parsed && parsed.v === 1 && Array.isArray(parsed.entries)) existing = parsed;
15444
15549
  } catch {
15445
15550
  }
15446
15551
  const next = foldTurnInitiatorLedger(existing, marker);
15447
15552
  const tmp = `${ledgerFile}.${process.pid}.${Date.now()}.tmp`;
15448
- writeFileSync6(tmp, JSON.stringify(next), "utf8");
15553
+ writeFileSync7(tmp, JSON.stringify(next), "utf8");
15449
15554
  renameSync2(tmp, ledgerFile);
15450
15555
  }
15451
15556
 
15452
15557
  // src/scheduled-turn-marker.ts
15453
- import { readFileSync as readFileSync6, unlinkSync as unlinkSync2 } from "fs";
15454
- import { join as join9 } from "path";
15558
+ import { readFileSync as readFileSync7, unlinkSync as unlinkSync2 } from "fs";
15559
+ import { join as join10 } from "path";
15455
15560
  var SCHEDULED_TURN_MAX_AGE_MS = 15 * 60 * 1e3;
15456
15561
 
15457
15562
  // src/turn-context.ts
@@ -15485,7 +15590,7 @@ function resolveTurnInitiatorFile(env = process.env, home = homedir3()) {
15485
15590
  turnInitiatorFile: null,
15486
15591
  homeDir: home
15487
15592
  });
15488
- return dir ? join10(dir, TURN_INITIATOR_MARKER_FILENAME) : null;
15593
+ return dir ? join11(dir, TURN_INITIATOR_MARKER_FILENAME) : null;
15489
15594
  }
15490
15595
 
15491
15596
  // src/teams-channel.ts
@@ -15571,7 +15676,7 @@ var ADAPTIVE_CARDS_ENABLED = process.env.MSTEAMS_ADAPTIVE_CARDS_ENABLED === "tru
15571
15676
  var ADAPTIVE_CARDS_ASK_USER_ENABLED = process.env.MSTEAMS_ADAPTIVE_CARDS_ASK_USER_ENABLED === "true";
15572
15677
  var ASK_USER_DEFAULT_TIMEOUT_SECONDS = 300;
15573
15678
  var ASK_USER_POLL_INTERVAL_MS = 1e3;
15574
- var PROJECT_DIR = AGENT_CODE_NAME ? resolvePath2(join11(homedir4(), ".augmented", AGENT_CODE_NAME, "project")) : null;
15679
+ var PROJECT_DIR = AGENT_CODE_NAME ? resolvePath2(join12(homedir4(), ".augmented", AGENT_CODE_NAME, "project")) : null;
15575
15680
  var MAX_UPLOAD_BYTES = 4 * 1024 * 1024;
15576
15681
  var AAD_TOKEN_URL = (tenantId) => `https://login.microsoftonline.com/${encodeURIComponent(tenantId)}/oauth2/v2.0/token`;
15577
15682
  var BOT_FRAMEWORK_SCOPE = "https://api.botframework.com/.default";
@@ -15693,7 +15798,7 @@ var trackedThreads = /* @__PURE__ */ new Map();
15693
15798
  var threadPersister = null;
15694
15799
  function threadStorePath() {
15695
15800
  if (!AGENT_CODE_NAME) return null;
15696
- return join11(homedir4(), ".augmented", AGENT_CODE_NAME, "msteams-tracked-threads.json");
15801
+ return join12(homedir4(), ".augmented", AGENT_CODE_NAME, "msteams-tracked-threads.json");
15697
15802
  }
15698
15803
  function loadTrackedThreads() {
15699
15804
  const path = threadStorePath();
@@ -15738,9 +15843,9 @@ function rememberThread(conversationId, serviceUrl, mode, activityId) {
15738
15843
  });
15739
15844
  threadPersister?.schedule(trackedThreads);
15740
15845
  }
15741
- var AGENT_DIR = AGENT_CODE_NAME ? join11(homedir4(), ".augmented", AGENT_CODE_NAME) : null;
15742
- var PENDING_INBOUND_DIR = AGENT_DIR ? join11(AGENT_DIR, "msteams-pending-inbound") : null;
15743
- var PROCESSED_DIR = PENDING_INBOUND_DIR ? join11(PENDING_INBOUND_DIR, ".processed") : null;
15846
+ var AGENT_DIR = AGENT_CODE_NAME ? join12(homedir4(), ".augmented", AGENT_CODE_NAME) : null;
15847
+ var PENDING_INBOUND_DIR = AGENT_DIR ? join12(AGENT_DIR, "msteams-pending-inbound") : null;
15848
+ var PROCESSED_DIR = PENDING_INBOUND_DIR ? join12(PENDING_INBOUND_DIR, ".processed") : null;
15744
15849
  function ensurePendingDirs() {
15745
15850
  if (!PENDING_INBOUND_DIR || !PROCESSED_DIR) return;
15746
15851
  try {
@@ -15756,10 +15861,10 @@ function ensurePendingDirs() {
15756
15861
  async function processPendingFile(filename) {
15757
15862
  if (!PENDING_INBOUND_DIR || !PROCESSED_DIR) return;
15758
15863
  if (!filename.endsWith(".json")) return;
15759
- const fullPath = join11(PENDING_INBOUND_DIR, filename);
15864
+ const fullPath = join12(PENDING_INBOUND_DIR, filename);
15760
15865
  let activity;
15761
15866
  try {
15762
- const raw = readFileSync8(fullPath, "utf8");
15867
+ const raw = readFileSync9(fullPath, "utf8");
15763
15868
  activity = JSON.parse(raw);
15764
15869
  } catch (err) {
15765
15870
  process.stderr.write(
@@ -15768,7 +15873,7 @@ async function processPendingFile(filename) {
15768
15873
  );
15769
15874
  if (PROCESSED_DIR) {
15770
15875
  try {
15771
- renameSync3(fullPath, join11(PROCESSED_DIR, `${filename}.invalid`));
15876
+ renameSync3(fullPath, join12(PROCESSED_DIR, `${filename}.invalid`));
15772
15877
  } catch {
15773
15878
  }
15774
15879
  }
@@ -15782,7 +15887,7 @@ async function processPendingFile(filename) {
15782
15887
  peerAgentMode: PEER_AGENT_MODE
15783
15888
  });
15784
15889
  try {
15785
- renameSync3(fullPath, join11(PROCESSED_DIR, filename));
15890
+ renameSync3(fullPath, join12(PROCESSED_DIR, filename));
15786
15891
  } catch {
15787
15892
  return;
15788
15893
  }
@@ -15939,7 +16044,7 @@ function startPendingInboundWatcher() {
15939
16044
  }
15940
16045
  ensurePendingDirs();
15941
16046
  try {
15942
- const entries = readdirSync3(PENDING_INBOUND_DIR).filter((f) => f.endsWith(".json")).map((f) => ({ f, m: safeMtimeMs(join11(PENDING_INBOUND_DIR, f)) })).sort((a, b) => a.m - b.m).map((e) => e.f);
16047
+ const entries = readdirSync4(PENDING_INBOUND_DIR).filter((f) => f.endsWith(".json")).map((f) => ({ f, m: safeMtimeMs(join12(PENDING_INBOUND_DIR, f)) })).sort((a, b) => a.m - b.m).map((e) => e.f);
15943
16048
  for (const f of entries) {
15944
16049
  void processPendingFile(f).catch((err) => {
15945
16050
  process.stderr.write(
@@ -15964,7 +16069,7 @@ function startPendingInboundWatcher() {
15964
16069
  if (!name || typeof name !== "string") return;
15965
16070
  if (!name.endsWith(".json")) return;
15966
16071
  if (name.startsWith(".")) return;
15967
- const fullPath = join11(PENDING_INBOUND_DIR, name);
16072
+ const fullPath = join12(PENDING_INBOUND_DIR, name);
15968
16073
  try {
15969
16074
  statSync(fullPath);
15970
16075
  } catch {
@@ -16400,7 +16505,7 @@ function optionalStringArg(args, key2) {
16400
16505
  function errResult(text) {
16401
16506
  return { content: [{ type: "text", text }], isError: true };
16402
16507
  }
16403
- var PENDING_INTERACTIONS_DIR = AGENT_DIR ? join11(AGENT_DIR, "msteams-pending-interactions") : null;
16508
+ var PENDING_INTERACTIONS_DIR = AGENT_DIR ? join12(AGENT_DIR, "msteams-pending-interactions") : null;
16404
16509
  function ensurePendingInteractionsDir() {
16405
16510
  if (!PENDING_INTERACTIONS_DIR) return;
16406
16511
  try {
@@ -16415,16 +16520,16 @@ function ensurePendingInteractionsDir() {
16415
16520
  function writePendingInteraction(entry) {
16416
16521
  if (!PENDING_INTERACTIONS_DIR) return;
16417
16522
  ensurePendingInteractionsDir();
16418
- writeFileSync7(
16419
- join11(PENDING_INTERACTIONS_DIR, `${entry.interaction_id}.json`),
16523
+ writeFileSync8(
16524
+ join12(PENDING_INTERACTIONS_DIR, `${entry.interaction_id}.json`),
16420
16525
  JSON.stringify(entry, null, 2)
16421
16526
  );
16422
16527
  }
16423
16528
  function readInteractionAnswer(interactionId) {
16424
16529
  if (!PENDING_INTERACTIONS_DIR) return null;
16425
- const path = join11(PENDING_INTERACTIONS_DIR, `${interactionId}.answer.json`);
16530
+ const path = join12(PENDING_INTERACTIONS_DIR, `${interactionId}.answer.json`);
16426
16531
  try {
16427
- const raw = readFileSync8(path, "utf8");
16532
+ const raw = readFileSync9(path, "utf8");
16428
16533
  const parsed = JSON.parse(raw);
16429
16534
  if (typeof parsed.value !== "string") return null;
16430
16535
  return {
@@ -16446,7 +16551,7 @@ function readInteractionAnswer(interactionId) {
16446
16551
  function clearPendingInteraction(interactionId) {
16447
16552
  if (!PENDING_INTERACTIONS_DIR) return;
16448
16553
  for (const suffix of [".json", ".answer.json"]) {
16449
- const path = join11(PENDING_INTERACTIONS_DIR, `${interactionId}${suffix}`);
16554
+ const path = join12(PENDING_INTERACTIONS_DIR, `${interactionId}${suffix}`);
16450
16555
  try {
16451
16556
  unlinkSync3(path);
16452
16557
  } catch (err) {
@@ -16610,7 +16715,7 @@ async function handleUploadFile(args) {
16610
16715
  );
16611
16716
  }
16612
16717
  try {
16613
- buffer = readFileSync8(sandboxed.resolved);
16718
+ buffer = readFileSync9(sandboxed.resolved);
16614
16719
  } catch (err) {
16615
16720
  return errResult(`Failed to read file: ${err.message}`);
16616
16721
  }
@@ -16653,10 +16758,10 @@ async function handleUploadFile(args) {
16653
16758
  return errResult(`Failed: ${err.message}`);
16654
16759
  }
16655
16760
  }
16656
- var PENDING_MARKER_DIR = PENDING_INBOUND_DIR ? join11(PENDING_INBOUND_DIR, ".markers") : null;
16657
- var RECOVERY_OUTBOX_DIR = AGENT_DIR ? join11(AGENT_DIR, "msteams-recovery-outbox") : null;
16658
- var RECOVERY_LEDGER_DIR = AGENT_DIR ? join11(AGENT_DIR, ".agt-msteams-recovery-ledger") : null;
16659
- var DELIVERY_LEDGER_DIR = AGENT_DIR ? join11(AGENT_DIR, ".agt-inbound-delivery-ledger") : null;
16761
+ var PENDING_MARKER_DIR = PENDING_INBOUND_DIR ? join12(PENDING_INBOUND_DIR, ".markers") : null;
16762
+ var RECOVERY_OUTBOX_DIR = AGENT_DIR ? join12(AGENT_DIR, "msteams-recovery-outbox") : null;
16763
+ var RECOVERY_LEDGER_DIR = AGENT_DIR ? join12(AGENT_DIR, ".agt-msteams-recovery-ledger") : null;
16764
+ var DELIVERY_LEDGER_DIR = AGENT_DIR ? join12(AGENT_DIR, ".agt-inbound-delivery-ledger") : null;
16660
16765
  var STALE_MARKER_MS = 24 * 60 * 60 * 1e3;
16661
16766
  var RECOVERY_RETRY_SCAN_INTERVAL_MS = 6e4;
16662
16767
  var RECOVERY_RETRY_BACKOFFS_MS = [6e4, 12e4, 24e4];
@@ -16683,8 +16788,8 @@ function writePendingMarker(activity) {
16683
16788
  ensureGhostReplyDirs();
16684
16789
  const name = safeMarkerName(activity.conversation.id, activity.id);
16685
16790
  try {
16686
- writeFileSync7(
16687
- join11(PENDING_MARKER_DIR, name),
16791
+ writeFileSync8(
16792
+ join12(PENDING_MARKER_DIR, name),
16688
16793
  JSON.stringify(
16689
16794
  {
16690
16795
  conversation_id: activity.conversation.id,
@@ -16713,14 +16818,14 @@ function clearPendingMarkersForConversation(conversationId) {
16713
16818
  const safe = Buffer.from(conversationId, "utf8").toString("hex").slice(0, 64);
16714
16819
  let entries;
16715
16820
  try {
16716
- entries = readdirSync3(PENDING_MARKER_DIR);
16821
+ entries = readdirSync4(PENDING_MARKER_DIR);
16717
16822
  } catch {
16718
16823
  return;
16719
16824
  }
16720
16825
  for (const f of entries) {
16721
16826
  if (f.startsWith(`${safe}--`)) {
16722
16827
  try {
16723
- unlinkSync3(join11(PENDING_MARKER_DIR, f));
16828
+ unlinkSync3(join12(PENDING_MARKER_DIR, f));
16724
16829
  } catch {
16725
16830
  }
16726
16831
  }
@@ -16730,14 +16835,14 @@ function sweepStaleMarkersOnBoot() {
16730
16835
  if (!PENDING_MARKER_DIR) return;
16731
16836
  let entries;
16732
16837
  try {
16733
- entries = readdirSync3(PENDING_MARKER_DIR);
16838
+ entries = readdirSync4(PENDING_MARKER_DIR);
16734
16839
  } catch {
16735
16840
  return;
16736
16841
  }
16737
16842
  let pruned = 0;
16738
16843
  const now = Date.now();
16739
16844
  for (const f of entries) {
16740
- const path = join11(PENDING_MARKER_DIR, f);
16845
+ const path = join12(PENDING_MARKER_DIR, f);
16741
16846
  try {
16742
16847
  const stats = statSync(path);
16743
16848
  if (now - stats.mtimeMs > STALE_MARKER_MS) {
@@ -16769,10 +16874,10 @@ function recoveryNextAttempt(filename) {
16769
16874
  }
16770
16875
  async function processRecoveryFile(filename) {
16771
16876
  if (!RECOVERY_OUTBOX_DIR) return;
16772
- const fullPath = join11(RECOVERY_OUTBOX_DIR, filename);
16877
+ const fullPath = join12(RECOVERY_OUTBOX_DIR, filename);
16773
16878
  let payload;
16774
16879
  try {
16775
- payload = JSON.parse(readFileSync8(fullPath, "utf8"));
16880
+ payload = JSON.parse(readFileSync9(fullPath, "utf8"));
16776
16881
  } catch (err) {
16777
16882
  process.stderr.write(
16778
16883
  `teams-channel: recovery file ${filename} unreadable (${err.message}) \u2014 dropping
@@ -16801,6 +16906,37 @@ async function processRecoveryFile(filename) {
16801
16906
  if (recoveredGuarded.redacted) emitToolCallMarkupRedactionTelemetry("teams");
16802
16907
  const apiErr = rewriteTransientApiError(recoveredGuarded.text);
16803
16908
  if (apiErr.rewritten) emitTransientApiErrorTelemetry("teams", apiErr.match, apiErr.original);
16909
+ const narrationGuardMode = resolveGhostReplyNarrationGuardMode();
16910
+ if (narrationGuardMode !== "off") {
16911
+ const narration = detectInternalNarration(apiErr.text, void 0);
16912
+ const spent = { hasPayload: true, owesNoReply: false, replayCount: MAX_MARKER_REPLAYS };
16913
+ const decide = (mode) => decideNarrationGuard({ match: narration, mode, marker: spent, maxReplays: MAX_MARKER_REPLAYS, replayEnabled: true });
16914
+ const narrationAction = decide(narrationGuardMode);
16915
+ if (narration) {
16916
+ process.stderr.write(
16917
+ `teams-channel(${AGENT_CODE_NAME ?? ""}): ghost-reply narration match=${narration} mode=${narrationGuardMode} action=${narrationAction} enforce_action=${decide("enforce")} conv=${payload.conversation_id.slice(0, 16)}\u2026 text_len=${apiErr.text.length}
16918
+ `
16919
+ );
16920
+ }
16921
+ if (narrationAction === "close") {
16922
+ process.stderr.write(
16923
+ `teams-channel(${AGENT_CODE_NAME ?? ""}): ghost-reply narration lost_owed_reply=1 match=${narration} conv=${payload.conversation_id.slice(0, 16)}\u2026 text_len=${apiErr.text.length}
16924
+ `
16925
+ );
16926
+ if (PENDING_MARKER_DIR && payload.marker_name) {
16927
+ try {
16928
+ unlinkSync3(join12(PENDING_MARKER_DIR, basename(payload.marker_name)));
16929
+ } catch {
16930
+ }
16931
+ }
16932
+ removeRecoveryLedgerEntry(RECOVERY_LEDGER_DIR, payload.marker_name);
16933
+ try {
16934
+ unlinkSync3(fullPath);
16935
+ } catch {
16936
+ }
16937
+ return;
16938
+ }
16939
+ }
16804
16940
  const ghostReplyMode = resolveGhostReplyMode();
16805
16941
  if (ghostReplyMode !== "off") {
16806
16942
  const decision = await decideRecovery(apiErr.text, ghostReplyMode);
@@ -16852,7 +16988,7 @@ async function processRecoveryFile(filename) {
16852
16988
  return;
16853
16989
  }
16854
16990
  try {
16855
- renameSync3(fullPath, join11(RECOVERY_OUTBOX_DIR, next.next));
16991
+ renameSync3(fullPath, join12(RECOVERY_OUTBOX_DIR, next.next));
16856
16992
  process.stderr.write(
16857
16993
  `teams-channel: recovery ${filename} \u2192 attempt ${next.attempt} (${err.message})
16858
16994
  `
@@ -16874,11 +17010,11 @@ function startRecoveryOutboxWatcher() {
16874
17010
  ensureGhostReplyDirs();
16875
17011
  const scan = () => {
16876
17012
  try {
16877
- const entries = readdirSync3(RECOVERY_OUTBOX_DIR);
17013
+ const entries = readdirSync4(RECOVERY_OUTBOX_DIR);
16878
17014
  for (const f of entries) {
16879
17015
  if (!f.endsWith(".json")) continue;
16880
17016
  if (f.startsWith(".")) continue;
16881
- const path = join11(RECOVERY_OUTBOX_DIR, f);
17017
+ const path = join12(RECOVERY_OUTBOX_DIR, f);
16882
17018
  let mtimeMs;
16883
17019
  try {
16884
17020
  mtimeMs = statSync(path).mtimeMs;
@@ -16903,7 +17039,7 @@ function startRecoveryOutboxWatcher() {
16903
17039
  if (!name || typeof name !== "string") return;
16904
17040
  if (!name.endsWith(".json")) return;
16905
17041
  if (name.startsWith(".")) return;
16906
- const path = join11(RECOVERY_OUTBOX_DIR, name);
17042
+ const path = join12(RECOVERY_OUTBOX_DIR, name);
16907
17043
  let mtimeMs;
16908
17044
  try {
16909
17045
  mtimeMs = statSync(path).mtimeMs;
@@ -16969,7 +17105,7 @@ ensureGhostReplyDirs();
16969
17105
  sweepStaleMarkersOnBoot();
16970
17106
  startPendingInboundWatcher();
16971
17107
  startRecoveryOutboxWatcher();
16972
- var NOTICE_OUTBOX_DIR = AGENT_DIR ? join11(AGENT_DIR, "msteams-notice-outbox") : null;
17108
+ var NOTICE_OUTBOX_DIR = AGENT_DIR ? join12(AGENT_DIR, "msteams-notice-outbox") : null;
16973
17109
  var NOTICE_MAX_AGE_MS = 9e4;
16974
17110
  function isNoticePayload(value) {
16975
17111
  if (!value || typeof value !== "object") return false;
@@ -16983,7 +17119,7 @@ async function processNoticeFile(filename) {
16983
17119
  if (filename.startsWith(".") || filename.endsWith(".tmp") || !filename.endsWith(".json")) return;
16984
17120
  if (NOTICE_INFLIGHT.has(filename)) return;
16985
17121
  NOTICE_INFLIGHT.add(filename);
16986
- const fullPath = join11(NOTICE_OUTBOX_DIR, filename);
17122
+ const fullPath = join12(NOTICE_OUTBOX_DIR, filename);
16987
17123
  try {
16988
17124
  let mtimeMs;
16989
17125
  try {
@@ -17000,7 +17136,7 @@ async function processNoticeFile(filename) {
17000
17136
  }
17001
17137
  let payload;
17002
17138
  try {
17003
- payload = JSON.parse(readFileSync8(fullPath, "utf8"));
17139
+ payload = JSON.parse(readFileSync9(fullPath, "utf8"));
17004
17140
  } catch {
17005
17141
  try {
17006
17142
  unlinkSync3(fullPath);
@@ -17058,13 +17194,13 @@ function startNoticeOutboxWatcher() {
17058
17194
  return;
17059
17195
  }
17060
17196
  try {
17061
- for (const f of readdirSync3(NOTICE_OUTBOX_DIR)) void processNoticeFile(f);
17197
+ for (const f of readdirSync4(NOTICE_OUTBOX_DIR)) void processNoticeFile(f);
17062
17198
  } catch {
17063
17199
  }
17064
17200
  try {
17065
17201
  const w = watch(NOTICE_OUTBOX_DIR, (_event, name) => {
17066
17202
  if (!name) return;
17067
- if (existsSync6(join11(NOTICE_OUTBOX_DIR, name))) void processNoticeFile(name);
17203
+ if (existsSync6(join12(NOTICE_OUTBOX_DIR, name))) void processNoticeFile(name);
17068
17204
  });
17069
17205
  w.unref?.();
17070
17206
  } catch (err) {