@integrity-labs/agt-cli 0.28.705 → 0.28.706

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.
@@ -54,7 +54,7 @@ import {
54
54
  safeWriteJsonAtomic,
55
55
  setConfigHash,
56
56
  tripClass
57
- } from "../chunk-CPR6JCAB.js";
57
+ } from "../chunk-XS5RWL77.js";
58
58
  import {
59
59
  getProjectDir as getProjectDir2,
60
60
  getReadyTasks,
@@ -112,7 +112,7 @@ import {
112
112
  takeZombieDetection,
113
113
  toOpencodeModel,
114
114
  writeEgressAllowlist
115
- } from "../chunk-ERBFMEWB.js";
115
+ } from "../chunk-326G325O.js";
116
116
  import {
117
117
  ACCOUNT_ENFORCEMENT_MARKER_FILENAME,
118
118
  AnchorSessionClient,
@@ -197,14 +197,14 @@ import {
197
197
  subagentActivityAgeSeconds,
198
198
  sumTranscriptUsageInWindow,
199
199
  transcriptActivityAgeSeconds
200
- } from "../chunk-VDHPDNC4.js";
200
+ } from "../chunk-QRGNDW6C.js";
201
201
  import {
202
202
  reapOrphanChannelMcps
203
203
  } from "../chunk-XWVM4KPK.js";
204
204
 
205
205
  // src/lib/manager-worker.ts
206
206
  import { createHash as createHash17 } from "crypto";
207
- import { readFileSync as readFileSync29, writeFileSync as writeFileSync14, mkdirSync as mkdirSync11, existsSync as existsSync17, rmSync as rmSync5, readdirSync as readdirSync10, statSync as statSync8, unlinkSync as unlinkSync6, renameSync as renameSync8, utimesSync } from "fs";
207
+ import { readFileSync as readFileSync30, writeFileSync as writeFileSync15, mkdirSync as mkdirSync11, existsSync as existsSync17, rmSync as rmSync5, readdirSync as readdirSync10, statSync as statSync8, unlinkSync as unlinkSync6, renameSync as renameSync8, utimesSync } from "fs";
208
208
 
209
209
  // src/lib/atomic-file-replace.ts
210
210
  import { copyFileSync, renameSync, unlinkSync } from "fs";
@@ -230,7 +230,7 @@ function defaultUnique() {
230
230
 
231
231
  // src/lib/manager-worker.ts
232
232
  import { execFileSync as syncExecFile } from "child_process";
233
- import { join as join38, dirname as dirname10, delimiter as pathDelimiter } from "path";
233
+ import { join as join39, dirname as dirname10, delimiter as pathDelimiter } from "path";
234
234
  import { homedir as homedir18 } from "os";
235
235
  import { fileURLToPath } from "url";
236
236
 
@@ -1241,6 +1241,48 @@ function logClaudeMdCeilingTransition(codeName, report, log2) {
1241
1241
  return line;
1242
1242
  }
1243
1243
 
1244
+ // ../../packages/core/dist/integrations/forwarded-tools-report.js
1245
+ import { readFileSync as readFileSync6, writeFileSync as writeFileSync3 } from "fs";
1246
+ import { join as join6 } from "path";
1247
+ var FORWARDED_TOOLS_REPORT_FILENAME = "forwarded-tools.json";
1248
+ function forwardedToolsReportPath(agentDir) {
1249
+ return join6(agentDir, FORWARDED_TOOLS_REPORT_FILENAME);
1250
+ }
1251
+ function readForwardedToolsReport(agentDir) {
1252
+ let raw;
1253
+ try {
1254
+ raw = readFileSync6(forwardedToolsReportPath(agentDir), "utf-8");
1255
+ } catch {
1256
+ return null;
1257
+ }
1258
+ let parsed;
1259
+ try {
1260
+ parsed = JSON.parse(raw);
1261
+ } catch {
1262
+ return null;
1263
+ }
1264
+ if (!parsed || typeof parsed !== "object")
1265
+ return null;
1266
+ const r = parsed;
1267
+ const nums = ["expected", "registered", "skipped"];
1268
+ for (const k of nums) {
1269
+ if (typeof r[k] !== "number" || !Number.isFinite(r[k]))
1270
+ return null;
1271
+ }
1272
+ if (!Array.isArray(r["failed"]) || r["failed"].some((n) => typeof n !== "string")) {
1273
+ return null;
1274
+ }
1275
+ if (typeof r["at"] !== "string" || !r["at"])
1276
+ return null;
1277
+ return {
1278
+ expected: r["expected"],
1279
+ registered: r["registered"],
1280
+ skipped: r["skipped"],
1281
+ failed: r["failed"],
1282
+ at: r["at"]
1283
+ };
1284
+ }
1285
+
1244
1286
  // src/lib/mcp-flap-dampener.ts
1245
1287
  var DEFAULT_WINDOW_MS = 6e5;
1246
1288
  var DEFAULT_MIN_TRANSITIONS = 4;
@@ -1797,9 +1839,9 @@ var DependencyRecoveryLedger = class {
1797
1839
  // src/lib/mcp-assets-ready.ts
1798
1840
  import { existsSync as nodeExistsSync, readFileSync as nodeReadFileSync } from "fs";
1799
1841
  import { homedir as homedir3 } from "os";
1800
- import { join as join6, resolve, sep as sep2 } from "path";
1842
+ import { join as join7, resolve, sep as sep2 } from "path";
1801
1843
  function getSharedMcpDir(homeDir = homedir3()) {
1802
- return join6(homeDir, ".augmented", "_mcp");
1844
+ return join7(homeDir, ".augmented", "_mcp");
1803
1845
  }
1804
1846
  function isPathInsideDir(candidate, dir) {
1805
1847
  const resolvedDir = resolve(dir);
@@ -1809,11 +1851,11 @@ function isPathInsideDir(candidate, dir) {
1809
1851
  }
1810
1852
  function findMissingMcpBundles(mcpConfigPath, deps = {}) {
1811
1853
  const existsSync18 = deps.existsSync ?? nodeExistsSync;
1812
- const readFileSync30 = deps.readFileSync ?? nodeReadFileSync;
1854
+ const readFileSync31 = deps.readFileSync ?? nodeReadFileSync;
1813
1855
  const mcpDir = deps.mcpDir ?? getSharedMcpDir();
1814
1856
  let parsed;
1815
1857
  try {
1816
- parsed = JSON.parse(readFileSync30(mcpConfigPath, "utf-8"));
1858
+ parsed = JSON.parse(readFileSync31(mcpConfigPath, "utf-8"));
1817
1859
  } catch {
1818
1860
  return [];
1819
1861
  }
@@ -1851,7 +1893,7 @@ function formatMissingMcpBundles(missing) {
1851
1893
  }
1852
1894
 
1853
1895
  // src/lib/self-update-coalesce.ts
1854
- import { readFileSync as readFileSync6, writeFileSync as writeFileSync3, mkdirSync as mkdirSync3 } from "fs";
1896
+ import { readFileSync as readFileSync7, writeFileSync as writeFileSync4, mkdirSync as mkdirSync3 } from "fs";
1855
1897
  import { dirname as dirname4 } from "path";
1856
1898
  var DEFAULT_SELF_UPDATE_COALESCE_MS = 30 * 60 * 1e3;
1857
1899
  function resolveCoalesceWindowMs(env = process.env) {
@@ -1861,7 +1903,7 @@ function resolveCoalesceWindowMs(env = process.env) {
1861
1903
  if (!Number.isFinite(parsed) || parsed < 0) return DEFAULT_SELF_UPDATE_COALESCE_MS;
1862
1904
  return Math.trunc(parsed);
1863
1905
  }
1864
- function readLastSelfUpdateAppliedMs(markerPath, now = Date.now(), read = (p) => readFileSync6(p, "utf-8")) {
1906
+ function readLastSelfUpdateAppliedMs(markerPath, now = Date.now(), read = (p) => readFileSync7(p, "utf-8")) {
1865
1907
  let raw;
1866
1908
  try {
1867
1909
  raw = read(markerPath);
@@ -1875,7 +1917,7 @@ function readLastSelfUpdateAppliedMs(markerPath, now = Date.now(), read = (p) =>
1875
1917
  }
1876
1918
  function stampLastSelfUpdateApplied(markerPath, now = Date.now(), write = (p, v) => {
1877
1919
  mkdirSync3(dirname4(p), { recursive: true });
1878
- writeFileSync3(p, v);
1920
+ writeFileSync4(p, v);
1879
1921
  }) {
1880
1922
  try {
1881
1923
  write(markerPath, String(now));
@@ -2165,11 +2207,11 @@ async function reportModelApiError(opts) {
2165
2207
  }
2166
2208
 
2167
2209
  // src/lib/claude-pid-tracker.ts
2168
- import { existsSync as existsSync2, readFileSync as readFileSync7 } from "fs";
2210
+ import { existsSync as existsSync2, readFileSync as readFileSync8 } from "fs";
2169
2211
  function readPidFile(path) {
2170
2212
  if (!existsSync2(path)) return { version: 1, spawns: [] };
2171
2213
  try {
2172
- const raw = JSON.parse(readFileSync7(path, "utf-8"));
2214
+ const raw = JSON.parse(readFileSync8(path, "utf-8"));
2173
2215
  if (raw.version !== 1 || !Array.isArray(raw.spawns)) return { version: 1, spawns: [] };
2174
2216
  const spawns = raw.spawns.filter(
2175
2217
  (s) => !!s && typeof s.pid === "number" && Number.isFinite(s.pid) && s.pid > 0
@@ -2219,14 +2261,14 @@ function formatReaperBootLine(opts) {
2219
2261
  }
2220
2262
 
2221
2263
  // src/lib/direct-chat-delivery.ts
2222
- import { join as join7 } from "path";
2264
+ import { join as join8 } from "path";
2223
2265
  var DEFAULT_DIRECT_CHAT_MAX_AGE_MS = 30 * 6e4;
2224
2266
  function directChatMaxAgeMs() {
2225
2267
  const raw = parseInt(process.env["AGT_DIRECT_CHAT_MAX_AGE_MS"] ?? "", 10);
2226
2268
  return Number.isFinite(raw) && raw >= 0 ? raw : DEFAULT_DIRECT_CHAT_MAX_AGE_MS;
2227
2269
  }
2228
2270
  function directChatDoorbellPath(agentId, home) {
2229
- return join7(home, ".augmented", agentId, "direct-chat-doorbell");
2271
+ return join8(home, ".augmented", agentId, "direct-chat-doorbell");
2230
2272
  }
2231
2273
  function isDirectChatMessageExpired(createdAt, nowMs, maxAgeMs) {
2232
2274
  if (!maxAgeMs || maxAgeMs <= 0) return false;
@@ -2238,7 +2280,7 @@ function isDirectChatMessageExpired(createdAt, nowMs, maxAgeMs) {
2238
2280
 
2239
2281
  // src/lib/id-keyed-migration.ts
2240
2282
  import { existsSync as existsSync3, lstatSync, readlinkSync, renameSync as renameSync2 } from "fs";
2241
- import { join as join8 } from "path";
2283
+ import { join as join9 } from "path";
2242
2284
  import { homedir as homedir4 } from "os";
2243
2285
  var ID_KEYED_MIGRATION_FLAG = "id-keyed-layout-migration";
2244
2286
  function agentHasActiveWhatsapp(channelConfigs, codeNameDir) {
@@ -2246,7 +2288,7 @@ function agentHasActiveWhatsapp(channelConfigs, codeNameDir) {
2246
2288
  return true;
2247
2289
  }
2248
2290
  try {
2249
- if (existsSync3(join8(codeNameDir, "whatsapp-pending-inbound"))) return true;
2291
+ if (existsSync3(join9(codeNameDir, "whatsapp-pending-inbound"))) return true;
2250
2292
  } catch {
2251
2293
  }
2252
2294
  return false;
@@ -2278,10 +2320,10 @@ function finishTranscriptMove(oldCwd, newCwd, codeName, log2) {
2278
2320
  function maybeMigrateAgentToIdKeyedLayout(agent, deps) {
2279
2321
  const home = deps.home ?? homedir4();
2280
2322
  const { code_name: codeName, agent_id: agentId } = agent;
2281
- const codeNamePath = join8(home, ".augmented", codeName);
2282
- const idPath = join8(home, ".augmented", agentId);
2283
- const oldCwd = join8(home, ".augmented", codeName, "project");
2284
- const newCwd = join8(idPath, "project");
2323
+ const codeNamePath = join9(home, ".augmented", codeName);
2324
+ const idPath = join9(home, ".augmented", agentId);
2325
+ const oldCwd = join9(home, ".augmented", codeName, "project");
2326
+ const newCwd = join9(idPath, "project");
2285
2327
  let codeNameKind;
2286
2328
  try {
2287
2329
  codeNameKind = lstatSync(codeNamePath).isSymbolicLink() ? "symlink" : "realdir";
@@ -2408,8 +2450,8 @@ function collectEnvGates(env) {
2408
2450
  }
2409
2451
 
2410
2452
  // ../../packages/core/dist/direct-chat/cursor-advance-telemetry.js
2411
- import { readFileSync as readFileSync8, writeFileSync as writeFileSync4 } from "fs";
2412
- import { join as join9 } from "path";
2453
+ import { readFileSync as readFileSync9, writeFileSync as writeFileSync5 } from "fs";
2454
+ import { join as join10 } from "path";
2413
2455
  var CURSOR_SHORTFALL_COUNTER_SUFFIX = "-cursor-advance-classifications.json";
2414
2456
  function recordCursorAdvanceOutcome(agentDir, source, route, verdict) {
2415
2457
  if (!agentDir)
@@ -2417,10 +2459,10 @@ function recordCursorAdvanceOutcome(agentDir, source, route, verdict) {
2417
2459
  const key = cursorAdvanceCounterKey(route, verdict);
2418
2460
  if (key === null)
2419
2461
  return;
2420
- const path = join9(agentDir, `${source}${CURSOR_SHORTFALL_COUNTER_SUFFIX}`);
2462
+ const path = join10(agentDir, `${source}${CURSOR_SHORTFALL_COUNTER_SUFFIX}`);
2421
2463
  const counts = {};
2422
2464
  try {
2423
- const parsed = JSON.parse(readFileSync8(path, "utf-8"));
2465
+ const parsed = JSON.parse(readFileSync9(path, "utf-8"));
2424
2466
  if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
2425
2467
  for (const [k, v] of Object.entries(parsed)) {
2426
2468
  if (typeof v === "number" && Number.isInteger(v) && v >= 0)
@@ -2431,13 +2473,13 @@ function recordCursorAdvanceOutcome(agentDir, source, route, verdict) {
2431
2473
  }
2432
2474
  counts[key] = (counts[key] ?? 0) + 1;
2433
2475
  try {
2434
- writeFileSync4(path, JSON.stringify(counts), { mode: 384 });
2476
+ writeFileSync5(path, JSON.stringify(counts), { mode: 384 });
2435
2477
  } catch {
2436
2478
  }
2437
2479
  }
2438
2480
 
2439
2481
  // src/lib/artifact-stream.ts
2440
- import { join as join10 } from "path";
2482
+ import { join as join11 } from "path";
2441
2483
  import { homedir as homedir5 } from "os";
2442
2484
  import { readdir, stat, readFile } from "fs/promises";
2443
2485
  var ARTEFACT_ENTRY_FILE = "index.html";
@@ -2523,7 +2565,7 @@ var ArtifactStreamScanner = class {
2523
2565
  return;
2524
2566
  }
2525
2567
  for (const name of names) {
2526
- const file = join10(this.artifactsDir, name, ARTEFACT_ENTRY_FILE);
2568
+ const file = join11(this.artifactsDir, name, ARTEFACT_ENTRY_FILE);
2527
2569
  const mtime = await this.fsDeps.mtimeMs(file).catch(() => null);
2528
2570
  if (mtime === null) continue;
2529
2571
  if (this.seenMtime.get(name) === mtime) continue;
@@ -2554,7 +2596,7 @@ var ArtifactStreamScanner = class {
2554
2596
  }
2555
2597
  };
2556
2598
  function artifactsDirFor(codeName) {
2557
- return join10(homedir5(), ".augmented", codeName, "artifacts");
2599
+ return join11(homedir5(), ".augmented", codeName, "artifacts");
2558
2600
  }
2559
2601
  var nodeArtifactFs = {
2560
2602
  async listArtefactNames(artifactsDir) {
@@ -2808,12 +2850,12 @@ async function maybePollHostUsage(deps) {
2808
2850
  import { createHash as createHash6 } from "crypto";
2809
2851
  import { readFile as readFile3, readdir as readdir3 } from "fs/promises";
2810
2852
  import { homedir as homedir7, platform as platform2 } from "os";
2811
- import { dirname as dirname5, join as join12 } from "path";
2853
+ import { dirname as dirname5, join as join13 } from "path";
2812
2854
 
2813
2855
  // src/lib/claude-auth-detect.ts
2814
2856
  import { readFile as readFile2, readdir as readdir2 } from "fs/promises";
2815
2857
  import { homedir as homedir6, platform } from "os";
2816
- import { join as join11 } from "path";
2858
+ import { join as join12 } from "path";
2817
2859
  import { execFile } from "child_process";
2818
2860
  import { promisify } from "util";
2819
2861
  var execFileAsync = promisify(execFile);
@@ -2828,16 +2870,16 @@ async function detectClaudeAuth() {
2828
2870
  }
2829
2871
  async function findClaudeCredentialsPaths() {
2830
2872
  const candidates = [
2831
- join11(homedir6(), ".claude", ".credentials.json"),
2832
- join11(homedir6(), ".claude", "credentials.json")
2873
+ join12(homedir6(), ".claude", ".credentials.json"),
2874
+ join12(homedir6(), ".claude", "credentials.json")
2833
2875
  ];
2834
2876
  const isLinuxRoot = platform() === "linux" && typeof process.getuid === "function" && process.getuid() === 0;
2835
2877
  if (isLinuxRoot) {
2836
2878
  try {
2837
2879
  const entries = await readdir2("/home", { withFileTypes: true });
2838
2880
  for (const entry of entries.filter((entry2) => entry2.isDirectory()).sort((a, b) => a.name.localeCompare(b.name))) {
2839
- candidates.push(join11("/home", entry.name, ".claude", ".credentials.json"));
2840
- candidates.push(join11("/home", entry.name, ".claude", "credentials.json"));
2881
+ candidates.push(join12("/home", entry.name, ".claude", ".credentials.json"));
2882
+ candidates.push(join12("/home", entry.name, ".claude", "credentials.json"));
2841
2883
  }
2842
2884
  } catch {
2843
2885
  }
@@ -2921,7 +2963,7 @@ async function candidateHomes() {
2921
2963
  try {
2922
2964
  const entries = await readdir3("/home", { withFileTypes: true });
2923
2965
  for (const entry of entries.filter((e) => e.isDirectory()).sort((a, b) => a.name.localeCompare(b.name))) {
2924
- homes.push(join12("/home", entry.name));
2966
+ homes.push(join13("/home", entry.name));
2925
2967
  }
2926
2968
  } catch {
2927
2969
  }
@@ -2941,11 +2983,11 @@ async function homeOfActiveCredentials() {
2941
2983
  async function claudeConfigCandidatePaths() {
2942
2984
  const paths = [];
2943
2985
  const configDir = process.env["CLAUDE_CONFIG_DIR"]?.trim();
2944
- if (configDir) paths.push(join12(configDir, ".claude.json"));
2986
+ if (configDir) paths.push(join13(configDir, ".claude.json"));
2945
2987
  const activeHome = await homeOfActiveCredentials();
2946
- if (activeHome) paths.push(join12(activeHome, ".claude.json"));
2988
+ if (activeHome) paths.push(join13(activeHome, ".claude.json"));
2947
2989
  for (const home of await candidateHomes()) {
2948
- const path = join12(home, ".claude.json");
2990
+ const path = join13(home, ".claude.json");
2949
2991
  if (!paths.includes(path)) paths.push(path);
2950
2992
  }
2951
2993
  return paths;
@@ -3042,11 +3084,11 @@ function diffAuthTuples(recorded, current) {
3042
3084
  }
3043
3085
 
3044
3086
  // src/lib/account-enforcement-marker.ts
3045
- import { mkdirSync as mkdirSync4, renameSync as renameSync3, rmSync as rmSync2, writeFileSync as writeFileSync5 } from "fs";
3087
+ import { mkdirSync as mkdirSync4, renameSync as renameSync3, rmSync as rmSync2, writeFileSync as writeFileSync6 } from "fs";
3046
3088
  import { homedir as homedir8 } from "os";
3047
- import { join as join13 } from "path";
3089
+ import { join as join14 } from "path";
3048
3090
  function accountEnforcementMarkerPath(codeName) {
3049
- return join13(homedir8(), ".augmented", codeName, ACCOUNT_ENFORCEMENT_MARKER_FILENAME);
3091
+ return join14(homedir8(), ".augmented", codeName, ACCOUNT_ENFORCEMENT_MARKER_FILENAME);
3050
3092
  }
3051
3093
  function syncAccountEnforcementMarker(codeName, level, log2 = (m) => process.stderr.write(`${m}
3052
3094
  `), text) {
@@ -3054,12 +3096,12 @@ function syncAccountEnforcementMarker(codeName, level, log2 = (m) => process.std
3054
3096
  clearAccountEnforcementMarker(codeName, log2);
3055
3097
  return;
3056
3098
  }
3057
- const dir = join13(homedir8(), ".augmented", codeName);
3058
- const path = join13(dir, ACCOUNT_ENFORCEMENT_MARKER_FILENAME);
3099
+ const dir = join14(homedir8(), ".augmented", codeName);
3100
+ const path = join14(dir, ACCOUNT_ENFORCEMENT_MARKER_FILENAME);
3059
3101
  const tempPath = `${path}.${process.pid}.tmp`;
3060
3102
  try {
3061
3103
  mkdirSync4(dir, { recursive: true });
3062
- writeFileSync5(tempPath, serializeAccountEnforcementMarker(level, text), "utf-8");
3104
+ writeFileSync6(tempPath, serializeAccountEnforcementMarker(level, text), "utf-8");
3063
3105
  renameSync3(tempPath, path);
3064
3106
  } catch (err) {
3065
3107
  try {
@@ -3080,8 +3122,8 @@ function clearAccountEnforcementMarker(codeName, log2 = (m) => process.stderr.wr
3080
3122
  }
3081
3123
 
3082
3124
  // src/lib/token-usage-monitor.ts
3083
- import { readdirSync as readdirSync2, readFileSync as readFileSync9, statSync } from "fs";
3084
- import { join as join14 } from "path";
3125
+ import { readdirSync as readdirSync2, readFileSync as readFileSync10, statSync } from "fs";
3126
+ import { join as join15 } from "path";
3085
3127
  var MIN_CHECK_INTERVAL_MS2 = 6e4;
3086
3128
  var TRANSCRIPT_MTIME_WINDOW_MS = 2 * 24 * 60 * 60 * 1e3;
3087
3129
  var MAX_ENTRIES_PER_POST = 200;
@@ -3110,7 +3152,7 @@ async function maybeReportTokenUsage(args) {
3110
3152
  if (!name.endsWith(".jsonl")) continue;
3111
3153
  const sessionId = name.slice(0, -".jsonl".length);
3112
3154
  if (!sessionId) continue;
3113
- const path = join14(dir, name);
3155
+ const path = join15(dir, name);
3114
3156
  let st;
3115
3157
  try {
3116
3158
  st = statSync(path);
@@ -3126,7 +3168,7 @@ async function maybeReportTokenUsage(args) {
3126
3168
  }
3127
3169
  let content;
3128
3170
  try {
3129
- content = readFileSync9(path, "utf-8");
3171
+ content = readFileSync10(path, "utf-8");
3130
3172
  } catch (err) {
3131
3173
  log2(`[token-usage] read failed for '${codeName}/${name}': ${err.message}`);
3132
3174
  continue;
@@ -3207,8 +3249,8 @@ async function maybeReportTokenUsage(args) {
3207
3249
  }
3208
3250
 
3209
3251
  // src/lib/workflow-run-reconciler.ts
3210
- import { readdirSync as readdirSync3, readFileSync as readFileSync10, statSync as statSync2 } from "fs";
3211
- import { join as join15 } from "path";
3252
+ import { readdirSync as readdirSync3, readFileSync as readFileSync11, statSync as statSync2 } from "fs";
3253
+ import { join as join16 } from "path";
3212
3254
  var MIN_CHECK_INTERVAL_MS3 = 5 * 6e4;
3213
3255
  var SETTLE_MS = 3e4;
3214
3256
  var TRANSCRIPT_MTIME_WINDOW_MS2 = 2 * 24 * 60 * 60 * 1e3;
@@ -3227,7 +3269,7 @@ function collectJsonlRecursive(dir, minMtimeMs, out, depth) {
3227
3269
  return;
3228
3270
  }
3229
3271
  for (const name of entries) {
3230
- const p = join15(dir, name);
3272
+ const p = join16(dir, name);
3231
3273
  let st;
3232
3274
  try {
3233
3275
  st = statSync2(p);
@@ -3250,7 +3292,7 @@ function enumerateTranscriptFiles(transcriptDir, nowMs, minMtimeMs = nowMs - TRA
3250
3292
  return out;
3251
3293
  }
3252
3294
  for (const name of entries) {
3253
- const path = join15(transcriptDir, name);
3295
+ const path = join16(transcriptDir, name);
3254
3296
  let st;
3255
3297
  try {
3256
3298
  st = statSync2(path);
@@ -3262,7 +3304,7 @@ function enumerateTranscriptFiles(transcriptDir, nowMs, minMtimeMs = nowMs - TRA
3262
3304
  continue;
3263
3305
  }
3264
3306
  if (st.isDirectory()) {
3265
- collectJsonlRecursive(join15(path, "subagents"), minMtimeMs, out, 0);
3307
+ collectJsonlRecursive(join16(path, "subagents"), minMtimeMs, out, 0);
3266
3308
  }
3267
3309
  }
3268
3310
  return out;
@@ -3307,7 +3349,7 @@ async function maybeReconcileWorkflowRunTokens(args) {
3307
3349
  const contents = [];
3308
3350
  for (const path of files) {
3309
3351
  try {
3310
- contents.push(readFileSync10(path, "utf-8"));
3352
+ contents.push(readFileSync11(path, "utf-8"));
3311
3353
  } catch {
3312
3354
  }
3313
3355
  }
@@ -3352,8 +3394,8 @@ async function maybeReconcileWorkflowRunTokens(args) {
3352
3394
  }
3353
3395
 
3354
3396
  // src/lib/conversation-evaluator.ts
3355
- import { readdirSync as readdirSync4, readFileSync as readFileSync11, statSync as statSync3 } from "fs";
3356
- import { join as join16 } from "path";
3397
+ import { readdirSync as readdirSync4, readFileSync as readFileSync12, statSync as statSync3 } from "fs";
3398
+ import { join as join17 } from "path";
3357
3399
  var MIN_CHECK_INTERVAL_MS4 = 5 * 6e4;
3358
3400
  var TRANSCRIPT_MTIME_WINDOW_MS3 = 7 * 24 * 60 * 60 * 1e3;
3359
3401
  var WINDOW_PAD_MS = 5 * 6e4;
@@ -3789,7 +3831,7 @@ function readRecentTurns(dir, nowMs) {
3789
3831
  return;
3790
3832
  }
3791
3833
  for (const ent of entries) {
3792
- const full = join16(d, ent.name);
3834
+ const full = join17(d, ent.name);
3793
3835
  if (ent.isDirectory()) {
3794
3836
  visit(full);
3795
3837
  continue;
@@ -3804,7 +3846,7 @@ function readRecentTurns(dir, nowMs) {
3804
3846
  if (nowMs - mtimeMs > TRANSCRIPT_MTIME_WINDOW_MS3) continue;
3805
3847
  let content;
3806
3848
  try {
3807
- content = readFileSync11(full, "utf8");
3849
+ content = readFileSync12(full, "utf8");
3808
3850
  } catch {
3809
3851
  continue;
3810
3852
  }
@@ -4095,22 +4137,22 @@ async function reportSkip2(api2, agentId, conversationId, log2, codeName) {
4095
4137
 
4096
4138
  // src/lib/tool-call-audit.ts
4097
4139
  import { homedir as homedir12 } from "os";
4098
- import { join as join21 } from "path";
4140
+ import { join as join22 } from "path";
4099
4141
 
4100
4142
  // src/lib/agent-logging-mode.ts
4101
- import { readFileSync as readFileSync12 } from "fs";
4143
+ import { readFileSync as readFileSync13 } from "fs";
4102
4144
  import { homedir as homedir9 } from "os";
4103
- import { join as join17 } from "path";
4145
+ import { join as join18 } from "path";
4104
4146
  var LOGGING_MODES = ["hash-only", "redacted", "full-local"];
4105
4147
  function charterPath(codeName, homeDir) {
4106
4148
  const home = homeDir ?? (process.env["HOME"]?.trim() || homedir9());
4107
4149
  const key = agentRuntimeKey(codeName, homeDir);
4108
- return join17(home, ".augmented", key, "provision", "CHARTER.md");
4150
+ return join18(home, ".augmented", key, "provision", "CHARTER.md");
4109
4151
  }
4110
4152
  function readAgentLoggingMode(codeName, homeDir) {
4111
4153
  let raw;
4112
4154
  try {
4113
- raw = readFileSync12(charterPath(codeName, homeDir), "utf-8");
4155
+ raw = readFileSync13(charterPath(codeName, homeDir), "utf-8");
4114
4156
  } catch {
4115
4157
  return { mode: null, reason: "no-charter" };
4116
4158
  }
@@ -4134,15 +4176,15 @@ function loggingModeWithholdsTargets(reading) {
4134
4176
 
4135
4177
  // src/lib/tool-call-path-salt.ts
4136
4178
  import { randomBytes } from "crypto";
4137
- import { existsSync as existsSync4, mkdirSync as mkdirSync5, readFileSync as readFileSync13, renameSync as renameSync4, unlinkSync as unlinkSync2, writeFileSync as writeFileSync6 } from "fs";
4179
+ import { existsSync as existsSync4, mkdirSync as mkdirSync5, readFileSync as readFileSync14, renameSync as renameSync4, unlinkSync as unlinkSync2, writeFileSync as writeFileSync7 } from "fs";
4138
4180
  import { homedir as homedir10 } from "os";
4139
- import { dirname as dirname6, join as join18 } from "path";
4181
+ import { dirname as dirname6, join as join19 } from "path";
4140
4182
  var SALT_BYTES = 32;
4141
4183
  var SALT_RE = /^[0-9a-f]{64}$/;
4142
4184
  function pathSaltPath(codeName, homeDir) {
4143
4185
  const home = homeDir ?? (process.env["HOME"]?.trim() || homedir10());
4144
4186
  const key = agentRuntimeKey(codeName, homeDir);
4145
- return join18(home, ".augmented", key, "tool-call-path-salt");
4187
+ return join19(home, ".augmented", key, "tool-call-path-salt");
4146
4188
  }
4147
4189
  function readToolCallPathSalt(codeName, homeDir) {
4148
4190
  let file;
@@ -4153,7 +4195,7 @@ function readToolCallPathSalt(codeName, homeDir) {
4153
4195
  }
4154
4196
  try {
4155
4197
  if (existsSync4(file)) {
4156
- const existing = readFileSync13(file, "utf-8").trim();
4198
+ const existing = readFileSync14(file, "utf-8").trim();
4157
4199
  if (SALT_RE.test(existing)) return existing;
4158
4200
  }
4159
4201
  } catch {
@@ -4162,7 +4204,7 @@ function readToolCallPathSalt(codeName, homeDir) {
4162
4204
  const tmp = `${file}.tmp.${process.pid}`;
4163
4205
  try {
4164
4206
  mkdirSync5(dirname6(file), { recursive: true, mode: 448 });
4165
- writeFileSync6(tmp, `${salt}
4207
+ writeFileSync7(tmp, `${salt}
4166
4208
  `, { encoding: "utf-8", mode: 384 });
4167
4209
  renameSync4(tmp, file);
4168
4210
  } catch {
@@ -4179,8 +4221,8 @@ function readToolCallPathSalt(codeName, homeDir) {
4179
4221
  import { statSync as statSync4 } from "fs";
4180
4222
 
4181
4223
  // src/lib/tool-call-extractor.ts
4182
- import { closeSync, fstatSync, openSync, readFileSync as readFileSync14, readSync, readdirSync as readdirSync5 } from "fs";
4183
- import { basename as basename2, join as join19, relative as relative2 } from "path";
4224
+ import { closeSync, fstatSync, openSync, readFileSync as readFileSync15, readSync, readdirSync as readdirSync5 } from "fs";
4225
+ import { basename as basename2, join as join20, relative as relative2 } from "path";
4184
4226
  import { StringDecoder } from "string_decoder";
4185
4227
 
4186
4228
  // src/lib/tool-call-redaction.ts
@@ -4309,7 +4351,7 @@ function redactToolTargetInner(toolName, input, ctx) {
4309
4351
  var EXTRACTOR_VERSION = "e1";
4310
4352
  function enumerateSessionTranscripts(transcriptDir, sessionId, projectsRoot) {
4311
4353
  const files = [];
4312
- const mainAbs = join19(transcriptDir, `${sessionId}.jsonl`);
4354
+ const mainAbs = join20(transcriptDir, `${sessionId}.jsonl`);
4313
4355
  files.push({
4314
4356
  absPath: mainAbs,
4315
4357
  relPath: relative2(projectsRoot, mainAbs),
@@ -4317,7 +4359,7 @@ function enumerateSessionTranscripts(transcriptDir, sessionId, projectsRoot) {
4317
4359
  isSubagent: false,
4318
4360
  subagentId: null
4319
4361
  });
4320
- const subDir = join19(transcriptDir, sessionId, "subagents");
4362
+ const subDir = join20(transcriptDir, sessionId, "subagents");
4321
4363
  let entries;
4322
4364
  try {
4323
4365
  entries = readdirSync5(subDir);
@@ -4326,7 +4368,7 @@ function enumerateSessionTranscripts(transcriptDir, sessionId, projectsRoot) {
4326
4368
  }
4327
4369
  for (const name of entries) {
4328
4370
  if (!name.endsWith(".jsonl")) continue;
4329
- const abs = join19(subDir, name);
4371
+ const abs = join20(subDir, name);
4330
4372
  const stem = basename2(name, ".jsonl");
4331
4373
  files.push({
4332
4374
  absPath: abs,
@@ -4524,9 +4566,9 @@ function extractTranscriptWindow(file, opts, from) {
4524
4566
  }
4525
4567
 
4526
4568
  // src/lib/tool-call-cursor.ts
4527
- import { existsSync as existsSync5, readFileSync as readFileSync15 } from "fs";
4569
+ import { existsSync as existsSync5, readFileSync as readFileSync16 } from "fs";
4528
4570
  import { homedir as homedir11 } from "os";
4529
- import { join as join20 } from "path";
4571
+ import { join as join21 } from "path";
4530
4572
  var COVERAGE_DISPOSITIONS = [
4531
4573
  "ok",
4532
4574
  "not_entitled",
@@ -4581,13 +4623,13 @@ function parseCursorKey(key) {
4581
4623
  function cursorStatePath(codeName, homeDir) {
4582
4624
  const home = homeDir ?? (process.env["HOME"]?.trim() || homedir11());
4583
4625
  const key = agentRuntimeKey(codeName, homeDir);
4584
- return join20(home, ".augmented", key, "tool-call-cursors.json");
4626
+ return join21(home, ".augmented", key, "tool-call-cursors.json");
4585
4627
  }
4586
4628
  function loadCursors(path) {
4587
4629
  const out = /* @__PURE__ */ new Map();
4588
4630
  if (!existsSync5(path)) return out;
4589
4631
  try {
4590
- const parsed = JSON.parse(readFileSync15(path, "utf-8"));
4632
+ const parsed = JSON.parse(readFileSync16(path, "utf-8"));
4591
4633
  if (!parsed || parsed.version !== 1 || typeof parsed.files !== "object") return out;
4592
4634
  for (const [k, v] of Object.entries(parsed.files)) {
4593
4635
  if (!v || typeof v !== "object") continue;
@@ -4994,7 +5036,7 @@ async function maybeScanToolCalls(args) {
4994
5036
  log2(`[tool-call-audit] ${codeName}: no path-hash salt available \u2014 file targets withheld`);
4995
5037
  }
4996
5038
  const home = args.homeDir ?? (process.env["HOME"]?.trim() || homedir12());
4997
- const projectsRoot = args.projectsRoot ?? join21(home, ".claude", "projects");
5039
+ const projectsRoot = args.projectsRoot ?? join22(home, ".claude", "projects");
4998
5040
  const transcriptDir = args.transcriptDir ?? sessionTranscriptDir(getProjectDir(codeName));
4999
5041
  const current = peekCurrentSession(codeName);
5000
5042
  const sessionIds = current ? [current.sessionId] : [];
@@ -5023,11 +5065,11 @@ async function maybeScanToolCalls(args) {
5023
5065
  }
5024
5066
 
5025
5067
  // src/lib/activity-cache-monitor.ts
5026
- import { existsSync as existsSync6, readFileSync as readFileSync16 } from "fs";
5068
+ import { existsSync as existsSync6, readFileSync as readFileSync17 } from "fs";
5027
5069
  import { homedir as homedir13 } from "os";
5028
- import { join as join22 } from "path";
5070
+ import { join as join23 } from "path";
5029
5071
  var MIN_CHECK_INTERVAL_MS7 = 6e4;
5030
- var STATS_CACHE_PATH = join22(homedir13(), ".claude", "stats-cache.json");
5072
+ var STATS_CACHE_PATH = join23(homedir13(), ".claude", "stats-cache.json");
5031
5073
  var ISO_DATE_RE = /^\d{4}-\d{2}-\d{2}$/;
5032
5074
  var state7 = { lastObservedDate: null, lastCheckedAt: 0 };
5033
5075
  function selectNewDailyRows(raw, lastObservedDate) {
@@ -5075,7 +5117,7 @@ async function maybeReportActivityCache(args) {
5075
5117
  }
5076
5118
  let raw;
5077
5119
  try {
5078
- raw = readFileSync16(STATS_CACHE_PATH, "utf-8");
5120
+ raw = readFileSync17(STATS_CACHE_PATH, "utf-8");
5079
5121
  } catch (err) {
5080
5122
  log2(`[activity-cache] readFileSync failed: ${err.message}`);
5081
5123
  return;
@@ -5312,18 +5354,18 @@ function computeChannelConfigHash(input) {
5312
5354
  }
5313
5355
 
5314
5356
  // src/lib/channel-hash-cache.ts
5315
- import { existsSync as existsSync7, readFileSync as readFileSync17, writeFileSync as writeFileSync7 } from "fs";
5316
- import { join as join23 } from "path";
5357
+ import { existsSync as existsSync7, readFileSync as readFileSync18, writeFileSync as writeFileSync8 } from "fs";
5358
+ import { join as join24 } from "path";
5317
5359
  var CACHE_FILENAME = "channel-hash-cache.json";
5318
5360
  function getChannelHashCacheFile(configDir) {
5319
- return join23(configDir, CACHE_FILENAME);
5361
+ return join24(configDir, CACHE_FILENAME);
5320
5362
  }
5321
5363
  function loadChannelHashCache(target, configDir) {
5322
5364
  const path = getChannelHashCacheFile(configDir);
5323
5365
  if (!existsSync7(path)) return;
5324
5366
  let parsed;
5325
5367
  try {
5326
- parsed = JSON.parse(readFileSync17(path, "utf-8"));
5368
+ parsed = JSON.parse(readFileSync18(path, "utf-8"));
5327
5369
  } catch {
5328
5370
  return;
5329
5371
  }
@@ -5337,14 +5379,14 @@ function saveChannelHashCache(source, configDir) {
5337
5379
  const obj = {};
5338
5380
  for (const [key, value] of source) obj[key] = value;
5339
5381
  try {
5340
- writeFileSync7(path, JSON.stringify(obj, null, 2));
5382
+ writeFileSync8(path, JSON.stringify(obj, null, 2));
5341
5383
  } catch {
5342
5384
  }
5343
5385
  }
5344
5386
 
5345
5387
  // src/lib/sender-policy-baseline.ts
5346
- import { existsSync as existsSync8, readFileSync as readFileSync18 } from "fs";
5347
- import { join as join24 } from "path";
5388
+ import { existsSync as existsSync8, readFileSync as readFileSync19 } from "fs";
5389
+ import { join as join25 } from "path";
5348
5390
  var BASELINE_FILENAME = "sender-policy-baseline.json";
5349
5391
  var SENDER_POLICY_BASELINE_VERSION = 1;
5350
5392
  var BASELINE_CONCERNS = ["senderPolicy", "slackBehaviour", "msteamsBehaviour"];
@@ -5356,14 +5398,14 @@ function createDeliveryBaselineMaps() {
5356
5398
  };
5357
5399
  }
5358
5400
  function getSenderPolicyBaselineFile(configDir) {
5359
- return join24(configDir, BASELINE_FILENAME);
5401
+ return join25(configDir, BASELINE_FILENAME);
5360
5402
  }
5361
5403
  function loadSenderPolicyBaseline(target, configDir, log2) {
5362
5404
  const path = getSenderPolicyBaselineFile(configDir);
5363
5405
  if (!existsSync8(path)) return;
5364
5406
  let parsed;
5365
5407
  try {
5366
- parsed = JSON.parse(readFileSync18(path, "utf-8"));
5408
+ parsed = JSON.parse(readFileSync19(path, "utf-8"));
5367
5409
  } catch (err) {
5368
5410
  log2?.(
5369
5411
  `[sender-policy] discarding corrupt ${BASELINE_FILENAME} (${err.message}) - restrictive-policy agents will take one fail-closed restart`
@@ -5412,8 +5454,8 @@ function saveSenderPolicyBaseline(source, configDir, log2) {
5412
5454
  }
5413
5455
 
5414
5456
  // src/lib/stuck-streak-store.ts
5415
- import { existsSync as existsSync9, readFileSync as readFileSync19 } from "fs";
5416
- import { join as join25 } from "path";
5457
+ import { existsSync as existsSync9, readFileSync as readFileSync20 } from "fs";
5458
+ import { join as join26 } from "path";
5417
5459
  var STORE_FILENAME = "stuck-streaks.json";
5418
5460
  var STUCK_STREAK_STORE_VERSION = 1;
5419
5461
  var STUCK_STREAK_CONCERNS = ["channelSync", "realtimeRebind"];
@@ -5421,7 +5463,7 @@ function createStuckStreakMaps() {
5421
5463
  return { channelSync: /* @__PURE__ */ new Map(), realtimeRebind: /* @__PURE__ */ new Map() };
5422
5464
  }
5423
5465
  function getStuckStreakStoreFile(configDir) {
5424
- return join25(configDir, STORE_FILENAME);
5466
+ return join26(configDir, STORE_FILENAME);
5425
5467
  }
5426
5468
  function isValidPersistedStreak(value) {
5427
5469
  if (!value || typeof value !== "object" || Array.isArray(value)) return false;
@@ -5463,7 +5505,7 @@ function loadStuckStreaks(target, configDir, log2) {
5463
5505
  if (!existsSync9(path)) return;
5464
5506
  let parsed;
5465
5507
  try {
5466
- parsed = JSON.parse(readFileSync19(path, "utf-8"));
5508
+ parsed = JSON.parse(readFileSync20(path, "utf-8"));
5467
5509
  } catch (err) {
5468
5510
  log2?.(
5469
5511
  `[stuck-streaks] discarding corrupt ${STORE_FILENAME} (${err.message}) \u2014 stuck-streak ages restart from zero and one spurious "recovered" close may follow`
@@ -5980,7 +6022,7 @@ function planGlobalSkillSync(globalSkills, prevIds, hashOf, knownHash, options)
5980
6022
  }
5981
6023
 
5982
6024
  // src/lib/manager/integration-skill-cache.ts
5983
- import { join as join26 } from "path";
6025
+ import { join as join27 } from "path";
5984
6026
  function integrationSkillHashKey(agentId, skillId) {
5985
6027
  return `plugin-skill:${agentId}:${skillId}`;
5986
6028
  }
@@ -5996,21 +6038,21 @@ function forgetIntegrationSkill(cache3, agentId, skillId) {
5996
6038
  function removeIntegrationSkillFolder(opts) {
5997
6039
  forgetIntegrationSkill(opts.cache, opts.agentId, opts.entry);
5998
6040
  for (const dir of opts.dirs) {
5999
- opts.removeDir(join26(dir, opts.entry));
6041
+ opts.removeDir(join27(dir, opts.entry));
6000
6042
  }
6001
6043
  }
6002
6044
 
6003
6045
  // src/lib/manager/managed-skill-manifest.ts
6004
- import { existsSync as existsSync10, mkdirSync as mkdirSync6, readFileSync as readFileSync20, writeFileSync as writeFileSync8 } from "fs";
6005
- import { dirname as dirname7, join as join27 } from "path";
6046
+ import { existsSync as existsSync10, mkdirSync as mkdirSync6, readFileSync as readFileSync21, writeFileSync as writeFileSync9 } from "fs";
6047
+ import { dirname as dirname7, join as join28 } from "path";
6006
6048
  var MANIFEST_VERSION = 1;
6007
6049
  function managedSkillManifestPath(agentRootDir) {
6008
- return join27(agentRootDir, "managed-skills.json");
6050
+ return join28(agentRootDir, "managed-skills.json");
6009
6051
  }
6010
6052
  function readManagedSkillManifest(path) {
6011
6053
  try {
6012
6054
  if (!existsSync10(path)) return /* @__PURE__ */ new Set();
6013
- const parsed = JSON.parse(readFileSync20(path, "utf-8"));
6055
+ const parsed = JSON.parse(readFileSync21(path, "utf-8"));
6014
6056
  const ids = Array.isArray(parsed?.globalSkillIds) ? parsed.globalSkillIds : [];
6015
6057
  return new Set(ids.filter((id) => typeof id === "string" && id.length > 0));
6016
6058
  } catch {
@@ -6024,7 +6066,7 @@ function writeManagedSkillManifest(path, ids) {
6024
6066
  version: MANIFEST_VERSION,
6025
6067
  globalSkillIds: [...ids].sort()
6026
6068
  };
6027
- writeFileSync8(path, JSON.stringify(body, null, 2));
6069
+ writeFileSync9(path, JSON.stringify(body, null, 2));
6028
6070
  } catch {
6029
6071
  }
6030
6072
  }
@@ -6137,7 +6179,7 @@ function resolveModelChain(refreshData) {
6137
6179
 
6138
6180
  // src/lib/manager/claude-auth.ts
6139
6181
  import { existsSync as existsSync11, rmSync as rmSync3 } from "fs";
6140
- import { join as join28 } from "path";
6182
+ import { join as join29 } from "path";
6141
6183
  import { homedir as homedir14 } from "os";
6142
6184
  async function applyClaudeAuthToEnv(childEnv, label) {
6143
6185
  const apiKey = getApiKey();
@@ -6150,9 +6192,9 @@ async function applyClaudeAuthToEnv(childEnv, label) {
6150
6192
  throw new Error("claude_auth_mode=api_key but /host/exchange returned no decrypted key");
6151
6193
  }
6152
6194
  childEnv.ANTHROPIC_API_KEY = exchange.anthropicApiKey;
6153
- const claudeDir = join28(homedir14(), ".claude");
6195
+ const claudeDir = join29(homedir14(), ".claude");
6154
6196
  for (const filename of [".credentials.json", "credentials.json"]) {
6155
- const p = join28(claudeDir, filename);
6197
+ const p = join29(claudeDir, filename);
6156
6198
  if (existsSync11(p)) {
6157
6199
  try {
6158
6200
  rmSync3(p, { force: true });
@@ -6234,8 +6276,8 @@ function heartbeatRuntimeAuthFields(probeVerdict) {
6234
6276
  }
6235
6277
 
6236
6278
  // src/lib/manager/kanban/parsers.ts
6237
- import { existsSync as existsSync12, readFileSync as readFileSync21 } from "fs";
6238
- import { join as join29 } from "path";
6279
+ import { existsSync as existsSync12, readFileSync as readFileSync22 } from "fs";
6280
+ import { join as join30 } from "path";
6239
6281
  var STANDUP_TEMPLATES = /* @__PURE__ */ new Set(["daily-standup", "end-of-day-summary"]);
6240
6282
  var TASK_UPDATE_TEMPLATES = /* @__PURE__ */ new Set(["hourly-status", "task-update"]);
6241
6283
  var PLAN_TEMPLATES = /* @__PURE__ */ new Set(["morning-plan"]);
@@ -6387,12 +6429,12 @@ function getBuiltInSkillContent(skillId) {
6387
6429
  if (builtInSkillCache.has(skillId)) return builtInSkillCache.get(skillId);
6388
6430
  try {
6389
6431
  const candidates = [
6390
- join29(process.cwd(), "skills", skillId, "SKILL.md"),
6391
- join29(new URL(".", import.meta.url).pathname, "..", "..", "..", "..", "..", "..", "skills", skillId, "SKILL.md")
6432
+ join30(process.cwd(), "skills", skillId, "SKILL.md"),
6433
+ join30(new URL(".", import.meta.url).pathname, "..", "..", "..", "..", "..", "..", "skills", skillId, "SKILL.md")
6392
6434
  ];
6393
6435
  for (const candidate of candidates) {
6394
6436
  if (existsSync12(candidate)) {
6395
- const content = readFileSync21(candidate, "utf-8");
6437
+ const content = readFileSync22(candidate, "utf-8");
6396
6438
  const files = [{ relativePath: "SKILL.md", content }];
6397
6439
  builtInSkillCache.set(skillId, files);
6398
6440
  return files;
@@ -6533,19 +6575,19 @@ function formatBoardForPrompt(items, template) {
6533
6575
  }
6534
6576
 
6535
6577
  // src/lib/manager/kanban/nudge-state-cache.ts
6536
- import { existsSync as existsSync13, readFileSync as readFileSync22, writeFileSync as writeFileSync9 } from "fs";
6537
- import { join as join30 } from "path";
6578
+ import { existsSync as existsSync13, readFileSync as readFileSync23, writeFileSync as writeFileSync10 } from "fs";
6579
+ import { join as join31 } from "path";
6538
6580
  var CACHE_FILENAME2 = "kanban-nudge-state.json";
6539
6581
  var KANBAN_NUDGE_STATE_VERSION = 1;
6540
6582
  function getKanbanNudgeStateFile(configDir) {
6541
- return join30(configDir, CACHE_FILENAME2);
6583
+ return join31(configDir, CACHE_FILENAME2);
6542
6584
  }
6543
6585
  function loadKanbanNudgeState(target, configDir) {
6544
6586
  const path = getKanbanNudgeStateFile(configDir);
6545
6587
  if (!existsSync13(path)) return;
6546
6588
  let parsed;
6547
6589
  try {
6548
- parsed = JSON.parse(readFileSync22(path, "utf-8"));
6590
+ parsed = JSON.parse(readFileSync23(path, "utf-8"));
6549
6591
  } catch {
6550
6592
  return;
6551
6593
  }
@@ -6577,7 +6619,7 @@ function saveKanbanNudgeState(source, configDir) {
6577
6619
  const agents = {};
6578
6620
  for (const [codeName, state9] of source) agents[codeName] = state9;
6579
6621
  try {
6580
- writeFileSync9(path, JSON.stringify({ version: KANBAN_NUDGE_STATE_VERSION, agents }, null, 2));
6622
+ writeFileSync10(path, JSON.stringify({ version: KANBAN_NUDGE_STATE_VERSION, agents }, null, 2));
6581
6623
  } catch {
6582
6624
  }
6583
6625
  }
@@ -7163,9 +7205,9 @@ function closeSessionRunForCode(codeName, outcome, reason) {
7163
7205
 
7164
7206
  // src/lib/manager/scheduler/kanban-route.ts
7165
7207
  import { createHash as createHash12 } from "crypto";
7166
- import { writeFileSync as writeFileSync10, renameSync as renameSync5, mkdirSync as mkdirSync7, readFileSync as readFileSync23, unlinkSync as unlinkSync3 } from "fs";
7208
+ import { writeFileSync as writeFileSync11, renameSync as renameSync5, mkdirSync as mkdirSync7, readFileSync as readFileSync24, unlinkSync as unlinkSync3 } from "fs";
7167
7209
  import { homedir as homedir15 } from "os";
7168
- import { join as join31, dirname as dirname8 } from "path";
7210
+ import { join as join32, dirname as dirname8 } from "path";
7169
7211
 
7170
7212
  // src/lib/manager/scheduler/notify.ts
7171
7213
  import { createHash as createHash11 } from "crypto";
@@ -7524,19 +7566,19 @@ function resolveScheduledSlackTarget(task) {
7524
7566
  }
7525
7567
  function stampScheduledTurnMarker(codeName, taskId, target) {
7526
7568
  try {
7527
- const file = join31(homedir15(), ".augmented", codeName, SCHEDULED_TURN_MARKER_FILENAME);
7569
+ const file = join32(homedir15(), ".augmented", codeName, SCHEDULED_TURN_MARKER_FILENAME);
7528
7570
  const marker = { ts: Date.now(), task_id: taskId, ...target ? { target } : {} };
7529
7571
  const tmp = `${file}.tmp`;
7530
- writeFileSync10(tmp, JSON.stringify(marker), "utf8");
7572
+ writeFileSync11(tmp, JSON.stringify(marker), "utf8");
7531
7573
  renameSync5(tmp, file);
7532
7574
  } catch (err) {
7533
7575
  log(`[scheduled-kanban] scheduled-turn marker write failed for '${codeName}': ${err.message}`);
7534
7576
  }
7535
7577
  }
7536
7578
  function clearScheduledTurnMarkerForTask(codeName, taskId) {
7537
- const file = join31(homedir15(), ".augmented", codeName, SCHEDULED_TURN_MARKER_FILENAME);
7579
+ const file = join32(homedir15(), ".augmented", codeName, SCHEDULED_TURN_MARKER_FILENAME);
7538
7580
  try {
7539
- const raw = JSON.parse(readFileSync23(file, "utf8"));
7581
+ const raw = JSON.parse(readFileSync24(file, "utf8"));
7540
7582
  if (typeof raw?.task_id !== "string" || raw.task_id !== taskId) return;
7541
7583
  unlinkSync3(file);
7542
7584
  log(`[scheduled-kanban] scheduled-turn marker cleared for '${codeName}' (task ${taskId} complete)`);
@@ -7598,7 +7640,7 @@ async function routeScheduledTaskViaKanban(codeName, agentId, task, prompt, dura
7598
7640
  try {
7599
7641
  const doorbell = directChatDoorbellPath(agentId, homedir15());
7600
7642
  mkdirSync7(dirname8(doorbell), { recursive: true });
7601
- writeFileSync10(doorbell, String(Date.now()));
7643
+ writeFileSync11(doorbell, String(Date.now()));
7602
7644
  } catch (err) {
7603
7645
  log(`[scheduled-kanban] doorbell ring failed for '${codeName}': ${err.message} (notice still queued)`);
7604
7646
  }
@@ -7749,11 +7791,11 @@ async function processClaudeTaskResult(codeName, agentId, templateId, rawOutput,
7749
7791
  // src/lib/manager/scheduler/execution.ts
7750
7792
  import { createHash as createHash13 } from "crypto";
7751
7793
  import { homedir as homedir16 } from "os";
7752
- import { join as join33 } from "path";
7794
+ import { join as join34 } from "path";
7753
7795
 
7754
7796
  // src/lib/agent-serving-probe.ts
7755
- import { readFileSync as readFileSync24, readdirSync as readdirSync6, statSync as statSync5 } from "fs";
7756
- import { join as join32 } from "path";
7797
+ import { readFileSync as readFileSync25, readdirSync as readdirSync6, statSync as statSync5 } from "fs";
7798
+ import { join as join33 } from "path";
7757
7799
  var RATE_LIMIT_WINDOW_MS = 6 * 60 * 60 * 1e3;
7758
7800
  function probeRateLimit(args) {
7759
7801
  const now = args.now ?? /* @__PURE__ */ new Date();
@@ -7769,7 +7811,7 @@ function probeRateLimit(args) {
7769
7811
  let newest = UNKNOWN_RATE_LIMIT;
7770
7812
  for (const name of entries) {
7771
7813
  if (!name.endsWith(".jsonl")) continue;
7772
- const path = join32(dir, name);
7814
+ const path = join33(dir, name);
7773
7815
  try {
7774
7816
  const st = statSync5(path);
7775
7817
  if (!st.isFile() || st.mtimeMs < startMs) continue;
@@ -7778,7 +7820,7 @@ function probeRateLimit(args) {
7778
7820
  }
7779
7821
  let content;
7780
7822
  try {
7781
- content = readFileSync24(path, "utf-8");
7823
+ content = readFileSync25(path, "utf-8");
7782
7824
  } catch {
7783
7825
  continue;
7784
7826
  }
@@ -7840,7 +7882,7 @@ function shouldLogUsageCapDeferral(site, codeName, limitedUntil) {
7840
7882
 
7841
7883
  // src/lib/manager/scheduler/execution.ts
7842
7884
  function claudePidFilePath() {
7843
- return join33(homedir16(), ".augmented", "manager-claude-pids.json");
7885
+ return join34(homedir16(), ".augmented", "manager-claude-pids.json");
7844
7886
  }
7845
7887
  var inFlightClaudePids = /* @__PURE__ */ new Map();
7846
7888
  function registerClaudeSpawn(record) {
@@ -7911,7 +7953,7 @@ async function syncAndCheckClaudeScheduler(agent, tasks, boardItems, refreshData
7911
7953
 
7912
7954
  // src/lib/occupancy-gate.ts
7913
7955
  import { closeSync as closeSync2, openSync as openSync2, readdirSync as readdirSync7, readSync as readSync2, statSync as statSync6 } from "fs";
7914
- import { join as join34 } from "path";
7956
+ import { join as join35 } from "path";
7915
7957
  function rostersMeasuredZero(mode, attested, runtimeRunning) {
7916
7958
  return mode === "enforce" && attested && runtimeRunning;
7917
7959
  }
@@ -8002,10 +8044,10 @@ function candidateTranscriptPaths(dir) {
8002
8044
  let complete = true;
8003
8045
  for (const name of top) {
8004
8046
  if (name.endsWith(".jsonl")) {
8005
- paths.push(join34(dir, name));
8047
+ paths.push(join35(dir, name));
8006
8048
  continue;
8007
8049
  }
8008
- const subDir = join34(dir, name, "subagents");
8050
+ const subDir = join35(dir, name, "subagents");
8009
8051
  let subs;
8010
8052
  try {
8011
8053
  subs = readdirSync7(subDir);
@@ -8014,7 +8056,7 @@ function candidateTranscriptPaths(dir) {
8014
8056
  continue;
8015
8057
  }
8016
8058
  for (const sub of subs) {
8017
- if (sub.endsWith(".jsonl")) paths.push(join34(subDir, sub));
8059
+ if (sub.endsWith(".jsonl")) paths.push(join35(subDir, sub));
8018
8060
  }
8019
8061
  }
8020
8062
  return { paths, complete };
@@ -8241,7 +8283,7 @@ function stopPaneOccupancySampler() {
8241
8283
 
8242
8284
  // src/lib/pid-pressure-sampler.ts
8243
8285
  import { execFileSync as execFileSync2 } from "child_process";
8244
- import { existsSync as existsSync14, readFileSync as readFileSync25 } from "fs";
8286
+ import { existsSync as existsSync14, readFileSync as readFileSync26 } from "fs";
8245
8287
  var SAMPLE_INTERVAL_MS2 = 3e4;
8246
8288
  function warnFraction() {
8247
8289
  const raw = Number(process.env.AGT_PID_PRESSURE_WARN_FRACTION);
@@ -8254,7 +8296,7 @@ function configuredCeiling() {
8254
8296
  }
8255
8297
  function readTextReal(path) {
8256
8298
  try {
8257
- return readFileSync25(path, "utf-8");
8299
+ return readFileSync26(path, "utf-8");
8258
8300
  } catch {
8259
8301
  return null;
8260
8302
  }
@@ -9562,9 +9604,9 @@ async function fireOpencodeScheduledTask(agent, task) {
9562
9604
 
9563
9605
  // src/lib/opencode-telegram-ingest.ts
9564
9606
  import { createHash as createHash16 } from "crypto";
9565
- import { existsSync as existsSync15, mkdirSync as mkdirSync8, readFileSync as readFileSync26, renameSync as renameSync6, unlinkSync as unlinkSync4, writeFileSync as writeFileSync11 } from "fs";
9607
+ import { existsSync as existsSync15, mkdirSync as mkdirSync8, readFileSync as readFileSync27, renameSync as renameSync6, unlinkSync as unlinkSync4, writeFileSync as writeFileSync12 } from "fs";
9566
9608
  import { randomUUID } from "crypto";
9567
- import { join as join35 } from "path";
9609
+ import { join as join36 } from "path";
9568
9610
 
9569
9611
  // src/lib/telegram-ingest.ts
9570
9612
  import https2 from "https";
@@ -10112,7 +10154,7 @@ function createFileOffsetStore(codeName, log2, currentBotId) {
10112
10154
  let filePath;
10113
10155
  try {
10114
10156
  dir = getFramework("opencode").getAgentDir(codeName);
10115
- filePath = join35(dir, "telegram-getupdates-offset-opencode.json");
10157
+ filePath = join36(dir, "telegram-getupdates-offset-opencode.json");
10116
10158
  } catch {
10117
10159
  dir = null;
10118
10160
  filePath = null;
@@ -10121,7 +10163,7 @@ function createFileOffsetStore(codeName, log2, currentBotId) {
10121
10163
  load() {
10122
10164
  if (!filePath) return 0;
10123
10165
  try {
10124
- const parsed = JSON.parse(readFileSync26(filePath, "utf-8"));
10166
+ const parsed = JSON.parse(readFileSync27(filePath, "utf-8"));
10125
10167
  if (currentBotId != null && typeof parsed?.bot_id === "number" && parsed.bot_id !== currentBotId) {
10126
10168
  log2(`[telegram-ingest:${codeName}] offset cursor belongs to a different bot; ignoring (bot swap)`);
10127
10169
  return 0;
@@ -10140,7 +10182,7 @@ function createFileOffsetStore(codeName, log2, currentBotId) {
10140
10182
  const tmpPath = `${filePath}.${process.pid}.${randomUUID()}.tmp`;
10141
10183
  try {
10142
10184
  mkdirSync8(dir, { recursive: true, mode: 448 });
10143
- writeFileSync11(
10185
+ writeFileSync12(
10144
10186
  tmpPath,
10145
10187
  JSON.stringify({
10146
10188
  offset,
@@ -10391,15 +10433,15 @@ function partitionActionableByPoison(actionable, states, config2) {
10391
10433
  }
10392
10434
 
10393
10435
  // src/lib/restart-flags.ts
10394
- import { existsSync as existsSync16, mkdirSync as mkdirSync9, readdirSync as readdirSync8, readFileSync as readFileSync27, renameSync as renameSync7, rmSync as rmSync4, writeFileSync as writeFileSync12 } from "fs";
10436
+ import { existsSync as existsSync16, mkdirSync as mkdirSync9, readdirSync as readdirSync8, readFileSync as readFileSync28, renameSync as renameSync7, rmSync as rmSync4, writeFileSync as writeFileSync13 } from "fs";
10395
10437
  import { homedir as homedir17 } from "os";
10396
- import { join as join36 } from "path";
10438
+ import { join as join37 } from "path";
10397
10439
  import { randomUUID as randomUUID2 } from "crypto";
10398
10440
  function restartFlagsDir() {
10399
- return join36(homedir17(), ".augmented", "restart-flags");
10441
+ return join37(homedir17(), ".augmented", "restart-flags");
10400
10442
  }
10401
10443
  function flagPath(codeName) {
10402
- return join36(restartFlagsDir(), `${codeName}.flag`);
10444
+ return join37(restartFlagsDir(), `${codeName}.flag`);
10403
10445
  }
10404
10446
  function readRestartFlags() {
10405
10447
  const dir = restartFlagsDir();
@@ -10408,7 +10450,7 @@ function readRestartFlags() {
10408
10450
  for (const entry of readdirSync8(dir)) {
10409
10451
  if (!entry.endsWith(".flag")) continue;
10410
10452
  try {
10411
- const raw = readFileSync27(join36(dir, entry), "utf8");
10453
+ const raw = readFileSync28(join37(dir, entry), "utf8");
10412
10454
  const parsed = JSON.parse(raw);
10413
10455
  if (typeof parsed.codeName !== "string" || parsed.codeName.length === 0) {
10414
10456
  parsed.codeName = entry.replace(/\.flag$/, "");
@@ -10526,8 +10568,8 @@ async function sendError(flag, opts, text) {
10526
10568
  }
10527
10569
 
10528
10570
  // src/lib/restart-context.ts
10529
- import { readdirSync as readdirSync9, readFileSync as readFileSync28, writeFileSync as writeFileSync13, mkdirSync as mkdirSync10, unlinkSync as unlinkSync5 } from "fs";
10530
- import { dirname as dirname9, join as join37 } from "path";
10571
+ import { readdirSync as readdirSync9, readFileSync as readFileSync29, writeFileSync as writeFileSync14, mkdirSync as mkdirSync10, unlinkSync as unlinkSync5 } from "fs";
10572
+ import { dirname as dirname9, join as join38 } from "path";
10531
10573
  var SLACK_PENDING_INBOUND_DIRNAME = "slack-pending-inbound";
10532
10574
  var SLACK_RESTART_CONTEXT_DIRNAME = "slack-restart-context";
10533
10575
  var MAX_TOPIC_CHARS = 140;
@@ -10539,10 +10581,10 @@ function augmentedAgentDir(codeName) {
10539
10581
  return dirname9(getProjectDir(codeName));
10540
10582
  }
10541
10583
  function slackPendingInboundDir(codeName) {
10542
- return join37(augmentedAgentDir(codeName), SLACK_PENDING_INBOUND_DIRNAME);
10584
+ return join38(augmentedAgentDir(codeName), SLACK_PENDING_INBOUND_DIRNAME);
10543
10585
  }
10544
10586
  function slackRestartContextDir(codeName) {
10545
- return join37(augmentedAgentDir(codeName), SLACK_RESTART_CONTEXT_DIRNAME);
10587
+ return join38(augmentedAgentDir(codeName), SLACK_RESTART_CONTEXT_DIRNAME);
10546
10588
  }
10547
10589
  function sanitizeTopic(raw) {
10548
10590
  const cleaned = raw.replace(/\s+/g, " ").trim().replace(/[<>]/g, " ").replace(/\s+/g, " ").trim();
@@ -10584,7 +10626,7 @@ function safeReaddir(dir) {
10584
10626
  }
10585
10627
  function readStrandedMarker(path) {
10586
10628
  try {
10587
- const parsed = JSON.parse(readFileSync28(path, "utf-8"));
10629
+ const parsed = JSON.parse(readFileSync29(path, "utf-8"));
10588
10630
  if (typeof parsed.channel === "string" && typeof parsed.thread_ts === "string") {
10589
10631
  return { channel: parsed.channel, thread_ts: parsed.thread_ts };
10590
10632
  }
@@ -10594,7 +10636,7 @@ function readStrandedMarker(path) {
10594
10636
  }
10595
10637
  function writeHintFile(path, dir, hint) {
10596
10638
  mkdirSync10(dir, { recursive: true, mode: 448 });
10597
- writeFileSync13(path, JSON.stringify(hint), { mode: 384 });
10639
+ writeFileSync14(path, JSON.stringify(hint), { mode: 384 });
10598
10640
  }
10599
10641
  function pruneHintsExcept(codeName, freshFilenames) {
10600
10642
  const ctxDir = slackRestartContextDir(codeName);
@@ -10602,7 +10644,7 @@ function pruneHintsExcept(codeName, freshFilenames) {
10602
10644
  if (!filename.endsWith(".json")) continue;
10603
10645
  if (freshFilenames.has(filename)) continue;
10604
10646
  try {
10605
- unlinkSync5(join37(ctxDir, filename));
10647
+ unlinkSync5(join38(ctxDir, filename));
10606
10648
  } catch {
10607
10649
  }
10608
10650
  }
@@ -10623,7 +10665,7 @@ function refreshSlackRestartContextHints(codeNames, opts = {}) {
10623
10665
  }
10624
10666
  const markers = [];
10625
10667
  for (const filename of markerFilenames.slice(0, cap)) {
10626
- const parsed = readStrandedMarker(join37(markerDir, filename));
10668
+ const parsed = readStrandedMarker(join38(markerDir, filename));
10627
10669
  if (parsed) markers.push({ filename, channel: parsed.channel, thread_ts: parsed.thread_ts });
10628
10670
  }
10629
10671
  if (markers.length === 0) {
@@ -10637,7 +10679,7 @@ function refreshSlackRestartContextHints(codeNames, opts = {}) {
10637
10679
  const freshFilenames = /* @__PURE__ */ new Set();
10638
10680
  for (const { filename, hint } of hints) {
10639
10681
  try {
10640
- writeHintFile(join37(ctxDir, filename), ctxDir, hint);
10682
+ writeHintFile(join38(ctxDir, filename), ctxDir, hint);
10641
10683
  freshFilenames.add(filename);
10642
10684
  } catch (err) {
10643
10685
  log2(`[restart-context] ${codeName}: hint write failed for ${filename}: ${err.message}`);
@@ -12015,7 +12057,7 @@ var pendingDayRolloverReset = /* @__PURE__ */ new Set();
12015
12057
  var dayRolloverInboundHold = /* @__PURE__ */ new Map();
12016
12058
  var INBOUND_HOLD_EPISODE_GAP_MS = 12e4;
12017
12059
  async function channelInboundActivityAgeSecondsFor(codeName) {
12018
- const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-Y7HORWZE.js");
12060
+ const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-3HITHSYU.js");
12019
12061
  const newest = newestPendingInboundActivityMtimeMs(dirname10(paneLogPath(codeName)));
12020
12062
  if (newest === null) return null;
12021
12063
  return Math.max(0, Math.floor((Date.now() - newest) / 1e3));
@@ -12265,7 +12307,7 @@ var runningChannelSecretHashes = /* @__PURE__ */ new Map();
12265
12307
  var sessionLaunchManagedStructure = /* @__PURE__ */ new Map();
12266
12308
  function projectMcpHash(_codeName, projectDir) {
12267
12309
  try {
12268
- const raw = readFileSync29(join38(projectDir, ".mcp.json"), "utf-8");
12310
+ const raw = readFileSync30(join39(projectDir, ".mcp.json"), "utf-8");
12269
12311
  return createHash17("sha256").update(canonicalJson(JSON.parse(raw))).digest("hex");
12270
12312
  } catch {
12271
12313
  return null;
@@ -12273,7 +12315,7 @@ function projectMcpHash(_codeName, projectDir) {
12273
12315
  }
12274
12316
  function projectMcpKeys(_codeName, projectDir) {
12275
12317
  try {
12276
- const raw = readFileSync29(join38(projectDir, ".mcp.json"), "utf-8");
12318
+ const raw = readFileSync30(join39(projectDir, ".mcp.json"), "utf-8");
12277
12319
  const parsed = JSON.parse(raw);
12278
12320
  const servers = parsed.mcpServers;
12279
12321
  if (!servers || typeof servers !== "object") return /* @__PURE__ */ new Set();
@@ -12291,7 +12333,7 @@ function seedSessionLaunchBaselines(codeName, projectDir) {
12291
12333
  else runningMcpServerKeys.delete(codeName);
12292
12334
  let launchStructure = null;
12293
12335
  try {
12294
- const raw = readFileSync29(join38(projectDir, ".mcp.json"), "utf-8");
12336
+ const raw = readFileSync30(join39(projectDir, ".mcp.json"), "utf-8");
12295
12337
  launchStructure = managedMcpStructureHashFromFile(
12296
12338
  JSON.parse(raw),
12297
12339
  isManagedMcpServerKey
@@ -12417,7 +12459,7 @@ async function runAgentSessionToolBindProbes(agent, integrations, projectDir, op
12417
12459
  if (result && result.rebindCandidates.length > 0 && hostFlagStore().getBoolean("session-tool-rebind")) {
12418
12460
  let mcpJsonForRebind = null;
12419
12461
  try {
12420
- mcpJsonForRebind = JSON.parse(readFileSync29(join38(projectDir, ".mcp.json"), "utf-8"));
12462
+ mcpJsonForRebind = JSON.parse(readFileSync30(join39(projectDir, ".mcp.json"), "utf-8"));
12421
12463
  } catch {
12422
12464
  mcpJsonForRebind = null;
12423
12465
  }
@@ -12565,7 +12607,7 @@ function shouldInjectChannelSecrets(agentId) {
12565
12607
  function projectChannelSecretHash(projectDir) {
12566
12608
  try {
12567
12609
  const entries = parseEnvIntegrations(
12568
- readFileSync29(join38(projectDir, ".env.integrations"), "utf-8")
12610
+ readFileSync30(join39(projectDir, ".env.integrations"), "utf-8")
12569
12611
  );
12570
12612
  return channelSecretValueHash(entries, CHANNEL_SECRET_ENV_KEYS);
12571
12613
  } catch {
@@ -12663,7 +12705,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
12663
12705
  var lastVersionCheckAt = 0;
12664
12706
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
12665
12707
  var lastResponsivenessProbeAt = 0;
12666
- var agtCliVersion = true ? "0.28.705" : "dev";
12708
+ var agtCliVersion = true ? "0.28.706" : "dev";
12667
12709
  function resolveBrewPath(execFileSync3) {
12668
12710
  try {
12669
12711
  const out = execFileSync3("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -12997,7 +13039,7 @@ function ensureClaudeManagedSettings(path = claudeManagedSettingsPath()) {
12997
13039
  try {
12998
13040
  let settings = {};
12999
13041
  if (existsSync17(path)) {
13000
- const raw = readFileSync29(path, "utf-8").trim();
13042
+ const raw = readFileSync30(path, "utf-8").trim();
13001
13043
  if (raw) {
13002
13044
  let parsed;
13003
13045
  try {
@@ -13015,7 +13057,7 @@ function ensureClaudeManagedSettings(path = claudeManagedSettingsPath()) {
13015
13057
  if (missing.length === 0) return "ok";
13016
13058
  for (const key of missing) settings[key] = true;
13017
13059
  mkdirSync11(dirname10(path), { recursive: true });
13018
- writeFileSync14(path, `${JSON.stringify(settings, null, 2)}
13060
+ writeFileSync15(path, `${JSON.stringify(settings, null, 2)}
13019
13061
  `);
13020
13062
  log(`[managed-settings] set ${missing.map((k) => `${k}:true`).join(", ")} in ${path} (ENG-5786 unblocks Claude Code channels; ENG-9223 pre-approves project MCP servers so a headless session never freezes on the trust prompt)`);
13021
13063
  return "ok";
@@ -13053,7 +13095,7 @@ async function ensureOpencodeBinary() {
13053
13095
  try {
13054
13096
  const prefix = execFileSync3("npm", ["prefix", "-g"], { encoding: "utf-8", timeout: 1e4 }).trim();
13055
13097
  if (prefix) {
13056
- const npmBin = join38(prefix, "bin");
13098
+ const npmBin = join39(prefix, "bin");
13057
13099
  const current = (process.env.PATH ?? "").split(pathDelimiter);
13058
13100
  if (!current.includes(npmBin)) {
13059
13101
  process.env.PATH = [npmBin, ...current.filter(Boolean)].join(pathDelimiter);
@@ -13170,7 +13212,7 @@ ${r.stderr}`;
13170
13212
  }
13171
13213
  var UPDATE_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
13172
13214
  function selfUpdateAppliedMarkerPath() {
13173
- return join38(homedir18(), ".augmented", ".last-self-update-applied");
13215
+ return join39(homedir18(), ".augmented", ".last-self-update-applied");
13174
13216
  }
13175
13217
  var selfUpdateUpToDateLogged = false;
13176
13218
  var selfUpdatePinnedLogged = false;
@@ -13221,7 +13263,7 @@ async function checkAndUpdateCli(opts) {
13221
13263
  const isNpmGlobal = !isBrewFormula && resolvedPath.includes("node_modules");
13222
13264
  if (!isBrewFormula && !isNpmGlobal) return "noop";
13223
13265
  const { readFileSync: readF, writeFileSync: writeF } = await import("fs");
13224
- const markerPath = join38(homedir18(), ".augmented", ".last-update-check");
13266
+ const markerPath = join39(homedir18(), ".augmented", ".last-update-check");
13225
13267
  if (!force) {
13226
13268
  try {
13227
13269
  const lastCheck = parseInt(readF(markerPath, "utf-8").trim(), 10);
@@ -13715,13 +13757,13 @@ async function checkClaudeAuth() {
13715
13757
  var evalEmptyMcpConfigPath = null;
13716
13758
  function ensureEvalEmptyMcpConfig() {
13717
13759
  if (evalEmptyMcpConfigPath && existsSync17(evalEmptyMcpConfigPath)) return evalEmptyMcpConfigPath;
13718
- const dir = join38(homedir18(), ".augmented");
13760
+ const dir = join39(homedir18(), ".augmented");
13719
13761
  try {
13720
13762
  mkdirSync11(dir, { recursive: true });
13721
13763
  } catch {
13722
13764
  }
13723
- const p = join38(dir, ".eval-empty-mcp.json");
13724
- writeFileSync14(p, JSON.stringify({ mcpServers: {} }));
13765
+ const p = join39(dir, ".eval-empty-mcp.json");
13766
+ writeFileSync15(p, JSON.stringify({ mcpServers: {} }));
13725
13767
  evalEmptyMcpConfigPath = p;
13726
13768
  return p;
13727
13769
  }
@@ -13815,10 +13857,10 @@ function resolveConversationEvalBackend() {
13815
13857
  return conversationEvalBackend;
13816
13858
  }
13817
13859
  function getStateFile() {
13818
- return join38(config?.configDir ?? join38(process.env["HOME"] ?? "/tmp", ".augmented"), "manager-state.json");
13860
+ return join39(config?.configDir ?? join39(process.env["HOME"] ?? "/tmp", ".augmented"), "manager-state.json");
13819
13861
  }
13820
13862
  function channelHashCacheDir() {
13821
- return config?.configDir ?? join38(process.env["HOME"] ?? "/tmp", ".augmented");
13863
+ return config?.configDir ?? join39(process.env["HOME"] ?? "/tmp", ".augmented");
13822
13864
  }
13823
13865
  function loadChannelHashCache2() {
13824
13866
  loadChannelHashCache(agentState.knownChannelConfigHashes, channelHashCacheDir());
@@ -14001,7 +14043,7 @@ function removeDeliveryBaselineEntries(agentId) {
14001
14043
  var _channelQuarantineStore = null;
14002
14044
  function channelQuarantineStore() {
14003
14045
  if (!_channelQuarantineStore) {
14004
- const dir = config?.configDir ?? join38(process.env["HOME"] ?? "/tmp", ".augmented");
14046
+ const dir = config?.configDir ?? join39(process.env["HOME"] ?? "/tmp", ".augmented");
14005
14047
  _channelQuarantineStore = new ChannelQuarantineStore(defaultQuarantinePath(dir));
14006
14048
  }
14007
14049
  return _channelQuarantineStore;
@@ -14015,10 +14057,14 @@ function claudeMdSizeFor(codeName) {
14015
14057
  logClaudeMdCeilingTransition(codeName, report, log);
14016
14058
  return report;
14017
14059
  }
14060
+ function forwardedToolsFor(codeName) {
14061
+ if (!config?.configDir) return null;
14062
+ return readForwardedToolsReport(join39(config.configDir, codeName));
14063
+ }
14018
14064
  var _hostFlagStore = null;
14019
14065
  function hostFlagStore() {
14020
14066
  if (!_hostFlagStore) {
14021
- const dir = config?.configDir ?? join38(process.env["HOME"] ?? "/tmp", ".augmented");
14067
+ const dir = config?.configDir ?? join39(process.env["HOME"] ?? "/tmp", ".augmented");
14022
14068
  _hostFlagStore = new HostFlagStore({ cachePath: defaultFlagsCachePath(dir), log });
14023
14069
  }
14024
14070
  return _hostFlagStore;
@@ -14091,13 +14137,13 @@ function parseSkillFrontmatter(content) {
14091
14137
  return out;
14092
14138
  }
14093
14139
  async function refreshSkillsIndexInClaudeMd(configDir, codeName, log2) {
14094
- const { readdirSync: readdirSync11, readFileSync: rfs, existsSync: ex, writeFileSync: writeFileSync15 } = await import("fs");
14095
- const skillsDir = join38(configDir, codeName, "project", ".claude", "skills");
14096
- const claudeMdPath = join38(configDir, codeName, "project", "CLAUDE.md");
14140
+ const { readdirSync: readdirSync11, readFileSync: rfs, existsSync: ex, writeFileSync: writeFileSync16 } = await import("fs");
14141
+ const skillsDir = join39(configDir, codeName, "project", ".claude", "skills");
14142
+ const claudeMdPath = join39(configDir, codeName, "project", "CLAUDE.md");
14097
14143
  if (!ex(skillsDir) || !ex(claudeMdPath)) return;
14098
14144
  const entries = [];
14099
14145
  for (const dir of readdirSync11(skillsDir).sort()) {
14100
- const skillFile = join38(skillsDir, dir, "SKILL.md");
14146
+ const skillFile = join39(skillsDir, dir, "SKILL.md");
14101
14147
  if (!ex(skillFile)) continue;
14102
14148
  try {
14103
14149
  const { name, description } = parseSkillFrontmatter(rfs(skillFile, "utf-8"));
@@ -14141,7 +14187,7 @@ ${SKILLS_INDEX_END}`;
14141
14187
  next = current.trimEnd() + "\n\n" + section + "\n";
14142
14188
  }
14143
14189
  if (next !== current) {
14144
- writeFileSync15(claudeMdPath, next, "utf-8");
14190
+ writeFileSync16(claudeMdPath, next, "utf-8");
14145
14191
  log2(
14146
14192
  injectSkillList ? `Refreshed skills index in CLAUDE.md for '${codeName}' (${entries.length} skills)` : `Refreshed CLAUDE.md managed block for '${codeName}' (skill list suppressed by claude-md-skills-index=false; ${entries.length} skills on disk)`
14147
14193
  );
@@ -14164,10 +14210,10 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
14164
14210
  if (codeNames.length === 0) return;
14165
14211
  void (async () => {
14166
14212
  try {
14167
- const { collectDiagnostics } = await import("../persistent-session-UQBJRLLZ.js");
14213
+ const { collectDiagnostics } = await import("../persistent-session-TPP35O6H.js");
14168
14214
  await api.post("/host/heartbeat", {
14169
14215
  host_id: hostId,
14170
- agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor)
14216
+ agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor)
14171
14217
  });
14172
14218
  } catch (err) {
14173
14219
  log(`[restart] post-respawn diagnostics flush failed: ${err.message}`);
@@ -14282,9 +14328,9 @@ async function pollCycleInner() {
14282
14328
  }
14283
14329
  try {
14284
14330
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
14285
- const { collectDiagnostics } = await import("../persistent-session-UQBJRLLZ.js");
14331
+ const { collectDiagnostics } = await import("../persistent-session-TPP35O6H.js");
14286
14332
  const diagCodeNames = [...agentState.persistentSessionAgents];
14287
- const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor) : void 0;
14333
+ const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor) : void 0;
14288
14334
  let tailscaleHostname;
14289
14335
  try {
14290
14336
  const { execSync: es } = await import("child_process");
@@ -14434,7 +14480,7 @@ async function pollCycleInner() {
14434
14480
  collectPanelessActivityProbes,
14435
14481
  getResponsivenessIntervalMs,
14436
14482
  occupancyQualificationClassifications
14437
- } = await import("../responsiveness-probe-Y7HORWZE.js");
14483
+ } = await import("../responsiveness-probe-3HITHSYU.js");
14438
14484
  const probeIntervalMs = getResponsivenessIntervalMs();
14439
14485
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
14440
14486
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -14544,7 +14590,7 @@ async function pollCycleInner() {
14544
14590
  collectResponsivenessProbes,
14545
14591
  livePendingInboundOldestAgeSeconds,
14546
14592
  parkPendingInbound
14547
- } = await import("../responsiveness-probe-Y7HORWZE.js");
14593
+ } = await import("../responsiveness-probe-3HITHSYU.js");
14548
14594
  const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-NDP36U7O.js");
14549
14595
  const wedgeNow = /* @__PURE__ */ new Date();
14550
14596
  const liveAgents = agentState.persistentSessionAgents;
@@ -14633,13 +14679,13 @@ async function pollCycleInner() {
14633
14679
  );
14634
14680
  if (hostFlagStore().getBoolean("wedge-transient-notice")) {
14635
14681
  try {
14636
- const paneTail = readFileSync29(paneLogPath(codeName), "utf8").slice(-65536);
14682
+ const paneTail = readFileSync30(paneLogPath(codeName), "utf8").slice(-65536);
14637
14683
  const transient = detectTransientApiErrorInLog(paneTail);
14638
14684
  if (transient) {
14639
- const wedgeHome = join38(homedir18(), ".augmented", codeName);
14685
+ const wedgeHome = join39(homedir18(), ".augmented", codeName);
14640
14686
  if (existsSync17(wedgeHome)) {
14641
14687
  atomicWriteFileSync(
14642
- join38(wedgeHome, "watchdog-give-up.json"),
14688
+ join39(wedgeHome, "watchdog-give-up.json"),
14643
14689
  JSON.stringify({
14644
14690
  gave_up_at: wedgeNow.toISOString(),
14645
14691
  reason: "transient_overload"
@@ -14700,7 +14746,7 @@ async function pollCycleInner() {
14700
14746
  }
14701
14747
  try {
14702
14748
  const { scrapeMcpFailedBannerCount } = await import("../pane-mcp-banner-scraper-JA437JIB.js");
14703
- const { probeSessionAuth } = await import("../session-auth-dead-DE4KM7PS.js");
14749
+ const { probeSessionAuth } = await import("../session-auth-dead-LY5264IN.js");
14704
14750
  const observations = [];
14705
14751
  const pendingCacheCommits = [];
14706
14752
  const modelApiErrorReportingOn = hostFlagStore().getBoolean("model-api-error-reporting");
@@ -14955,7 +15001,7 @@ async function pollCycleInner() {
14955
15001
  `[drain-flush] FAILED for '${prev.codeName}': ${err.message} \u2014 proceeding to teardown; this session was NOT shipped (ENG-9491)`
14956
15002
  );
14957
15003
  }
14958
- const agentDir = join38(adapter.getAgentDir(prev.codeName), "provision");
15004
+ const agentDir = join39(adapter.getAgentDir(prev.codeName), "provision");
14959
15005
  await cleanupAgentFiles(prev.codeName, agentDir);
14960
15006
  clearAgentCaches(prev.agentId, prev.codeName);
14961
15007
  }
@@ -15042,10 +15088,10 @@ async function pollCycleInner() {
15042
15088
  // pending-inbound marker. Best-effort: a write failure is logged by
15043
15089
  // the watchdog, never fails the poll cycle.
15044
15090
  signalGiveUp: (codeName) => {
15045
- const dir = join38(homedir18(), ".augmented", codeName);
15091
+ const dir = join39(homedir18(), ".augmented", codeName);
15046
15092
  if (!existsSync17(dir)) return;
15047
15093
  atomicWriteFileSync(
15048
- join38(dir, "watchdog-give-up.json"),
15094
+ join39(dir, "watchdog-give-up.json"),
15049
15095
  JSON.stringify({ gave_up_at: (/* @__PURE__ */ new Date()).toISOString() })
15050
15096
  );
15051
15097
  },
@@ -15066,7 +15112,7 @@ async function pollCycleInner() {
15066
15112
  const dir = getFramework("claude-code").getAgentDir(codeName);
15067
15113
  if (!existsSync17(dir)) return;
15068
15114
  atomicWriteFileSync(
15069
- join38(dir, "watchdog-give-up.json"),
15115
+ join39(dir, "watchdog-give-up.json"),
15070
15116
  JSON.stringify({
15071
15117
  gave_up_at: (/* @__PURE__ */ new Date()).toISOString(),
15072
15118
  reason: "usage_limit",
@@ -15328,7 +15374,7 @@ async function processAgent(agent, agentStates, managedToolkits) {
15328
15374
  }
15329
15375
  const now = (/* @__PURE__ */ new Date()).toISOString();
15330
15376
  const adapter = resolveAgentFramework(agent.code_name);
15331
- let agentDir = join38(adapter.getAgentDir(agent.code_name), "provision");
15377
+ let agentDir = join39(adapter.getAgentDir(agent.code_name), "provision");
15332
15378
  if (agent.status === "draft" || agent.status === "paused") {
15333
15379
  forgetChannelSyncState(agent.agent_id);
15334
15380
  if (previousKnownStatus !== agent.status) {
@@ -15503,7 +15549,7 @@ async function processAgent(agent, agentStates, managedToolkits) {
15503
15549
  const frameworkId = refreshData.agent.framework ?? DEFAULT_FRAMEWORK;
15504
15550
  agentFrameworkCache.set(agent.code_name, frameworkId);
15505
15551
  const frameworkAdapter = getFramework(frameworkId);
15506
- agentDir = join38(frameworkAdapter.getAgentDir(agent.code_name), "provision");
15552
+ agentDir = join39(frameworkAdapter.getAgentDir(agent.code_name), "provision");
15507
15553
  cacheAgentDeliveryMetadata(agent.code_name, refreshData);
15508
15554
  agentRestartTimezoneInputs.set(agent.code_name, {
15509
15555
  agentTimezone: typeof refreshData.agent.timezone === "string" ? refreshData.agent.timezone : null,
@@ -15561,7 +15607,7 @@ async function processAgent(agent, agentStates, managedToolkits) {
15561
15607
  const changedFiles = [];
15562
15608
  mkdirSync11(agentDir, { recursive: true });
15563
15609
  for (const artifact of artifacts) {
15564
- const filePath = join38(agentDir, artifact.relativePath);
15610
+ const filePath = join39(agentDir, artifact.relativePath);
15565
15611
  let existingHash;
15566
15612
  let newHash;
15567
15613
  let writeContent = artifact.content;
@@ -15580,8 +15626,8 @@ async function processAgent(agent, agentStates, managedToolkits) {
15580
15626
  };
15581
15627
  newHash = sha256(stripDynamicSections(artifact.content));
15582
15628
  try {
15583
- const projectClaudeMd = join38(config.configDir, agent.code_name, "project", "CLAUDE.md");
15584
- const existing = readFileSync29(projectClaudeMd, "utf-8");
15629
+ const projectClaudeMd = join39(config.configDir, agent.code_name, "project", "CLAUDE.md");
15630
+ const existing = readFileSync30(projectClaudeMd, "utf-8");
15585
15631
  existingHash = sha256(stripDynamicSections(existing));
15586
15632
  } catch {
15587
15633
  existingHash = null;
@@ -15599,7 +15645,7 @@ async function processAgent(agent, agentStates, managedToolkits) {
15599
15645
  const generatorKeys = Object.keys(generatorServers);
15600
15646
  let existingRaw = "";
15601
15647
  try {
15602
- existingRaw = readFileSync29(filePath, "utf-8");
15648
+ existingRaw = readFileSync30(filePath, "utf-8");
15603
15649
  } catch {
15604
15650
  }
15605
15651
  const existingServers = parseMcp(existingRaw);
@@ -15615,7 +15661,7 @@ async function processAgent(agent, agentStates, managedToolkits) {
15615
15661
  } else if (artifact.relativePath === "opencode.json") {
15616
15662
  let existingRaw = null;
15617
15663
  try {
15618
- existingRaw = readFileSync29(filePath, "utf-8");
15664
+ existingRaw = readFileSync30(filePath, "utf-8");
15619
15665
  } catch {
15620
15666
  }
15621
15667
  const mergeResult = mergeOpencodeConfigArtifact(artifact.content, existingRaw);
@@ -15631,26 +15677,26 @@ async function processAgent(agent, agentStates, managedToolkits) {
15631
15677
  }
15632
15678
  }
15633
15679
  if (changedFiles.length > 0) {
15634
- const isFirst = !existsSync17(join38(agentDir, "CHARTER.md"));
15680
+ const isFirst = !existsSync17(join39(agentDir, "CHARTER.md"));
15635
15681
  const verb = isFirst ? "Provisioning" : "Updating";
15636
15682
  const fileNames = changedFiles.map((f) => f.relativePath).join(", ");
15637
15683
  log(`${verb} '${agent.code_name}': ${fileNames}`);
15638
15684
  for (const file of changedFiles) {
15639
- const filePath = join38(agentDir, file.relativePath);
15685
+ const filePath = join39(agentDir, file.relativePath);
15640
15686
  mkdirSync11(dirname10(filePath), { recursive: true });
15641
15687
  if (file.relativePath === ".mcp.json") {
15642
15688
  safeWriteJsonAtomic(filePath, file.content, { mode: 384 });
15643
15689
  } else {
15644
- writeFileSync14(filePath, file.content);
15690
+ writeFileSync15(filePath, file.content);
15645
15691
  }
15646
15692
  }
15647
15693
  try {
15648
- const provSkillsDir = join38(agentDir, ".claude", "skills");
15694
+ const provSkillsDir = join39(agentDir, ".claude", "skills");
15649
15695
  if (existsSync17(provSkillsDir)) {
15650
15696
  for (const folder of readdirSync10(provSkillsDir)) {
15651
15697
  if (folder.startsWith("knowledge-")) {
15652
15698
  try {
15653
- rmSync5(join38(provSkillsDir, folder), { recursive: true });
15699
+ rmSync5(join39(provSkillsDir, folder), { recursive: true });
15654
15700
  } catch {
15655
15701
  }
15656
15702
  }
@@ -15663,7 +15709,7 @@ async function processAgent(agent, agentStates, managedToolkits) {
15663
15709
  const trackedFiles2 = frameworkAdapter.driftTrackedFiles();
15664
15710
  const hashes = /* @__PURE__ */ new Map();
15665
15711
  for (const file of trackedFiles2) {
15666
- const h = hashFile(join38(agentDir, file));
15712
+ const h = hashFile(join39(agentDir, file));
15667
15713
  if (h) hashes.set(file, h);
15668
15714
  }
15669
15715
  agentState.writtenHashes.set(agent.agent_id, hashes);
@@ -15681,14 +15727,14 @@ async function processAgent(agent, agentStates, managedToolkits) {
15681
15727
  }
15682
15728
  if (Array.isArray(refreshData.workflows)) {
15683
15729
  try {
15684
- const provWorkflowsDir = join38(agentDir, ".claude", "workflows");
15730
+ const provWorkflowsDir = join39(agentDir, ".claude", "workflows");
15685
15731
  if (existsSync17(provWorkflowsDir)) {
15686
15732
  const expected = new Set(refreshData.workflows.map((w) => `${w.name}.js`));
15687
15733
  for (const file of readdirSync10(provWorkflowsDir)) {
15688
15734
  if (!file.endsWith(".js")) continue;
15689
15735
  if (expected.has(file)) continue;
15690
15736
  try {
15691
- rmSync5(join38(provWorkflowsDir, file));
15737
+ rmSync5(join39(provWorkflowsDir, file));
15692
15738
  } catch {
15693
15739
  }
15694
15740
  }
@@ -15770,7 +15816,7 @@ async function processAgent(agent, agentStates, managedToolkits) {
15770
15816
  if (written && existsSync17(agentDir)) {
15771
15817
  const driftedFiles = [];
15772
15818
  for (const [file, expectedHash] of written) {
15773
- const localHash = hashFile(join38(agentDir, file));
15819
+ const localHash = hashFile(join39(agentDir, file));
15774
15820
  if (localHash && localHash !== expectedHash) {
15775
15821
  driftedFiles.push(file);
15776
15822
  }
@@ -15781,7 +15827,7 @@ async function processAgent(agent, agentStates, managedToolkits) {
15781
15827
  try {
15782
15828
  const localHashes = {};
15783
15829
  for (const file of driftedFiles) {
15784
- localHashes[file] = hashFile(join38(agentDir, file));
15830
+ localHashes[file] = hashFile(join39(agentDir, file));
15785
15831
  }
15786
15832
  await api.post("/host/drift", {
15787
15833
  agent_id: agent.agent_id,
@@ -16026,7 +16072,7 @@ async function processAgent(agent, agentStates, managedToolkits) {
16026
16072
  const addedChannels = [...restartDecision.added];
16027
16073
  const writeDmNoticeMarkers = isChannelAddRestart ? () => {
16028
16074
  try {
16029
- const agentAugmentedDir = join38(homedir18(), ".augmented", agent.code_name);
16075
+ const agentAugmentedDir = join39(homedir18(), ".augmented", agent.code_name);
16030
16076
  mkdirSync11(agentAugmentedDir, { recursive: true });
16031
16077
  const markerJson = JSON.stringify({
16032
16078
  version: 1,
@@ -16034,7 +16080,7 @@ async function processAgent(agent, agentStates, managedToolkits) {
16034
16080
  added: addedChannels
16035
16081
  });
16036
16082
  for (const file of ["slack-channel-add-restart.json", "telegram-channel-add-restart.json"]) {
16037
- atomicWriteFileSync(join38(agentAugmentedDir, file), markerJson);
16083
+ atomicWriteFileSync(join39(agentAugmentedDir, file), markerJson);
16038
16084
  }
16039
16085
  } catch (err) {
16040
16086
  log(`[hot-reload] channel-add DM-notice marker write failed for '${agent.code_name}' (non-fatal): ${err.message}`);
@@ -16223,18 +16269,18 @@ async function processAgent(agent, agentStates, managedToolkits) {
16223
16269
  if (agentSessionMode === "persistent" && (agentFrameworkCache.get(agent.code_name) ?? DEFAULT_FRAMEWORK) === "claude-code") {
16224
16270
  try {
16225
16271
  const agentProvisionDir = agentDir;
16226
- const projectDir = join38(homedir18(), ".augmented", agent.code_name, "project");
16272
+ const projectDir = join39(homedir18(), ".augmented", agent.code_name, "project");
16227
16273
  mkdirSync11(agentProvisionDir, { recursive: true });
16228
16274
  mkdirSync11(projectDir, { recursive: true });
16229
- const provisionMcpPath = join38(agentProvisionDir, ".mcp.json");
16230
- const projectMcpPath = join38(projectDir, ".mcp.json");
16275
+ const provisionMcpPath = join39(agentProvisionDir, ".mcp.json");
16276
+ const projectMcpPath = join39(projectDir, ".mcp.json");
16231
16277
  let mcpConfig = { mcpServers: {} };
16232
16278
  try {
16233
- mcpConfig = JSON.parse(readFileSync29(provisionMcpPath, "utf-8"));
16279
+ mcpConfig = JSON.parse(readFileSync30(provisionMcpPath, "utf-8"));
16234
16280
  if (!mcpConfig.mcpServers) mcpConfig.mcpServers = {};
16235
16281
  } catch {
16236
16282
  }
16237
- const localDirectChatChannel = join38(homedir18(), ".augmented", "_mcp", "direct-chat-channel.js");
16283
+ const localDirectChatChannel = join39(homedir18(), ".augmented", "_mcp", "direct-chat-channel.js");
16238
16284
  const directChatTeamSettings = refreshData.team?.settings;
16239
16285
  const directChatTz = (() => {
16240
16286
  const tz = directChatTeamSettings?.["timezone"];
@@ -16260,7 +16306,7 @@ async function processAgent(agent, agentStates, managedToolkits) {
16260
16306
  // ~/.augmented/<codeName>/.current-turn-initiator.json. Note getAgentDir
16261
16307
  // returns the agent root (NOT the /provision subdir `agentDir` points at),
16262
16308
  // so it byte-matches the broker readers' path.
16263
- AGT_TURN_INITIATOR_FILE: join38(
16309
+ AGT_TURN_INITIATOR_FILE: join39(
16264
16310
  frameworkAdapter.getAgentDir(agent.code_name),
16265
16311
  ".current-turn-initiator.json"
16266
16312
  )
@@ -16280,7 +16326,7 @@ async function processAgent(agent, agentStates, managedToolkits) {
16280
16326
  log(`Channel credentials written for '${agent.code_name}/direct-chat'`);
16281
16327
  }
16282
16328
  }
16283
- const staleChannelsPath = join38(projectDir, ".mcp-channels.json");
16329
+ const staleChannelsPath = join39(projectDir, ".mcp-channels.json");
16284
16330
  if (existsSync17(staleChannelsPath)) {
16285
16331
  try {
16286
16332
  rmSync5(staleChannelsPath, { force: true });
@@ -16370,7 +16416,7 @@ async function processAgent(agent, agentStates, managedToolkits) {
16370
16416
  }
16371
16417
  if (hostFlagStore().getBoolean("connectivity-probe")) {
16372
16418
  try {
16373
- const probeProjectDir = join38(homedir18(), ".augmented", agent.code_name, "project");
16419
+ const probeProjectDir = join39(homedir18(), ".augmented", agent.code_name, "project");
16374
16420
  let probeSet = integrations;
16375
16421
  try {
16376
16422
  const quarantined = await api.post("/host/agent-integrations/quarantined", { agent_id: agent.agent_id });
@@ -16416,7 +16462,7 @@ async function processAgent(agent, agentStates, managedToolkits) {
16416
16462
  const forceDue = attemptsLeft > 0;
16417
16463
  let probeRan = false;
16418
16464
  try {
16419
- const probeProjectDir = join38(homedir18(), ".augmented", agent.code_name, "project");
16465
+ const probeProjectDir = join39(homedir18(), ".augmented", agent.code_name, "project");
16420
16466
  probeRan = await runAgentSessionToolBindProbes(agent, integrations, probeProjectDir, { forceDue });
16421
16467
  } catch (err) {
16422
16468
  log(`Session-tool-bind probe failed for '${agent.code_name}': ${err.message}`);
@@ -16493,11 +16539,11 @@ async function processAgent(agent, agentStates, managedToolkits) {
16493
16539
  const intHash = computeIntegrationsHash(integrations);
16494
16540
  const prevIntHash = agentState.knownIntegrationHashes.get(agent.agent_id);
16495
16541
  if (intHash !== prevIntHash) {
16496
- const projectDir = join38(homedir18(), ".augmented", agent.code_name, "project");
16497
- const envIntPath = join38(projectDir, ".env.integrations");
16542
+ const projectDir = join39(homedir18(), ".augmented", agent.code_name, "project");
16543
+ const envIntPath = join39(projectDir, ".env.integrations");
16498
16544
  let preWriteEnv;
16499
16545
  try {
16500
- preWriteEnv = readFileSync29(envIntPath, "utf-8");
16546
+ preWriteEnv = readFileSync30(envIntPath, "utf-8");
16501
16547
  } catch {
16502
16548
  preWriteEnv = void 0;
16503
16549
  }
@@ -16516,9 +16562,9 @@ async function processAgent(agent, agentStates, managedToolkits) {
16516
16562
  }
16517
16563
  if (fw === "claude-code" && isSessionHealthy(agent.code_name)) {
16518
16564
  try {
16519
- const projectMcpPath = join38(projectDir, ".mcp.json");
16520
- const postWriteEnv = readFileSync29(envIntPath, "utf-8");
16521
- const mcpContent = readFileSync29(projectMcpPath, "utf-8");
16565
+ const projectMcpPath = join39(projectDir, ".mcp.json");
16566
+ const postWriteEnv = readFileSync30(envIntPath, "utf-8");
16567
+ const mcpContent = readFileSync30(projectMcpPath, "utf-8");
16522
16568
  const changedVars = diffEnvIntegrations(preWriteEnv, postWriteEnv);
16523
16569
  const mcpJsonForReap = JSON.parse(mcpContent);
16524
16570
  const affectedServerKeys = findMcpServersUsingVars(mcpJsonForReap, changedVars);
@@ -16786,12 +16832,12 @@ async function processAgent(agent, agentStates, managedToolkits) {
16786
16832
  const frameworkId2 = frameworkAdapter.id;
16787
16833
  const candidateSkillDirs = [
16788
16834
  // Claude Code — framework runtime tree
16789
- join38(homedir19(), ".augmented", agent.code_name, "skills"),
16835
+ join39(homedir19(), ".augmented", agent.code_name, "skills"),
16790
16836
  // Claude Code — project tree
16791
- join38(homedir19(), ".augmented", agent.code_name, "project", ".claude", "skills"),
16837
+ join39(homedir19(), ".augmented", agent.code_name, "project", ".claude", "skills"),
16792
16838
  // Defensive: legacy provision-side path, not currently an
16793
16839
  // install target but cheap to sweep.
16794
- join38(agentDir, ".claude", "skills")
16840
+ join39(agentDir, ".claude", "skills")
16795
16841
  ];
16796
16842
  const existingDirs = candidateSkillDirs.filter((d) => existsSync17(d));
16797
16843
  const discoveredEntries = /* @__PURE__ */ new Set();
@@ -16832,7 +16878,7 @@ async function processAgent(agent, agentStates, managedToolkits) {
16832
16878
  const sharedSkillsPayload = refreshAny.shared_skills;
16833
16879
  const desiredResolved = globalSkillsPayload !== void 0 || sharedSkillsPayload !== void 0;
16834
16880
  const manifestPath = managedSkillManifestPath(
16835
- join38(homedir18(), ".augmented", agent.code_name)
16881
+ join39(homedir18(), ".augmented", agent.code_name)
16836
16882
  );
16837
16883
  const prevIds = /* @__PURE__ */ new Set([
16838
16884
  ...agentState.knownGlobalSkillIds.get(agent.agent_id) ?? /* @__PURE__ */ new Set(),
@@ -16852,15 +16898,15 @@ async function processAgent(agent, agentStates, managedToolkits) {
16852
16898
  }
16853
16899
  if (plan.removes.length) {
16854
16900
  const globalSkillDirs = [
16855
- join38(homedir18(), ".augmented", agent.code_name, "skills"),
16856
- join38(homedir18(), ".augmented", agent.code_name, "project", ".claude", "skills"),
16857
- join38(agentDir, ".claude", "skills")
16901
+ join39(homedir18(), ".augmented", agent.code_name, "skills"),
16902
+ join39(homedir18(), ".augmented", agent.code_name, "project", ".claude", "skills"),
16903
+ join39(agentDir, ".claude", "skills")
16858
16904
  ];
16859
16905
  for (const id of plan.removes) {
16860
16906
  let prunedAny = false;
16861
16907
  for (const dir of globalSkillDirs) {
16862
- const p = join38(dir, id);
16863
- if (existsSync17(p) && existsSync17(join38(p, "SKILL.md"))) {
16908
+ const p = join39(dir, id);
16909
+ if (existsSync17(p) && existsSync17(join39(p, "SKILL.md"))) {
16864
16910
  rmSync5(p, { recursive: true, force: true });
16865
16911
  prunedAny = true;
16866
16912
  }
@@ -17096,8 +17142,8 @@ async function processAgent(agent, agentStates, managedToolkits) {
17096
17142
  const sess = getSessionState(agent.code_name);
17097
17143
  let mcpJsonParsed = null;
17098
17144
  try {
17099
- const mcpPath = join38(getProjectDir(agent.code_name), ".mcp.json");
17100
- mcpJsonParsed = JSON.parse(readFileSync29(mcpPath, "utf-8"));
17145
+ const mcpPath = join39(getProjectDir(agent.code_name), ".mcp.json");
17146
+ mcpJsonParsed = JSON.parse(readFileSync30(mcpPath, "utf-8"));
17101
17147
  } catch {
17102
17148
  }
17103
17149
  reapMissingMcpSessions({
@@ -17531,7 +17577,7 @@ Retried to the limit after repeated stalls \u2014 needs a look.`).catch(() => {
17531
17577
  if (trackedFiles.length > 0 && existsSync17(agentDir)) {
17532
17578
  const hashes = /* @__PURE__ */ new Map();
17533
17579
  for (const file of trackedFiles) {
17534
- const h = hashFile(join38(agentDir, file));
17580
+ const h = hashFile(join39(agentDir, file));
17535
17581
  if (h) hashes.set(file, h);
17536
17582
  }
17537
17583
  agentState.writtenHashes.set(agent.agent_id, hashes);
@@ -17546,7 +17592,7 @@ Retried to the limit after repeated stalls \u2014 needs a look.`).catch(() => {
17546
17592
  refreshData.agent.onboarding_state
17547
17593
  );
17548
17594
  const obStep = obState.step;
17549
- const markerPath = join38(homedir18(), ".augmented", agent.code_name, "onboarding-drive.json");
17595
+ const markerPath = join39(homedir18(), ".augmented", agent.code_name, "onboarding-drive.json");
17550
17596
  const marker = readOnboardingDriveMarker(markerPath);
17551
17597
  const obContactRaw = refreshData.agent.manager_last_contacted_at;
17552
17598
  const obContact = typeof obContactRaw === "string" && obContactRaw ? obContactRaw : null;
@@ -17648,7 +17694,7 @@ async function ensureOpencodeRuntime(agent, refreshData, agentTimezone) {
17648
17694
  }
17649
17695
  stopOpencodeSlackIngest(codeName, log);
17650
17696
  stopOpencodeTelegramIngest(codeName, log);
17651
- const opencodeProjectDir = join38(getFramework("opencode").getAgentDir(codeName), "provision");
17697
+ const opencodeProjectDir = join39(getFramework("opencode").getAgentDir(codeName), "provision");
17652
17698
  const serveEnv = {
17653
17699
  AGT_HOST: requireHost(),
17654
17700
  AGT_API_KEY: getApiKey() ?? void 0,
@@ -17703,8 +17749,8 @@ async function ensurePersistentSession(agent, tasks, boardItems, refreshData) {
17703
17749
  });
17704
17750
  }
17705
17751
  const projectDir = getProjectDir(codeName);
17706
- const mcpConfigPath = join38(projectDir, ".mcp.json");
17707
- const claudeMdPath = join38(projectDir, "CLAUDE.md");
17752
+ const mcpConfigPath = join39(projectDir, ".mcp.json");
17753
+ const claudeMdPath = join39(projectDir, "CLAUDE.md");
17708
17754
  if (restartBreaker.isTripped(codeName)) {
17709
17755
  const trip = restartBreaker.getTrip(codeName);
17710
17756
  return {
@@ -18479,10 +18525,10 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
18479
18525
  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}`));
18480
18526
  void (async () => {
18481
18527
  try {
18482
- const { collectDiagnostics } = await import("../persistent-session-UQBJRLLZ.js");
18528
+ const { collectDiagnostics } = await import("../persistent-session-TPP35O6H.js");
18483
18529
  await api.post("/host/heartbeat", {
18484
18530
  host_id: hostId,
18485
- agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor)
18531
+ agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor)
18486
18532
  });
18487
18533
  } catch (err) {
18488
18534
  log(`[restart-lane] post-respawn diagnostics flush failed for '${codeName}': ${err.message}`);
@@ -18530,10 +18576,10 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
18530
18576
  }
18531
18577
  try {
18532
18578
  const hostId = await getHostId();
18533
- const { collectDiagnostics } = await import("../persistent-session-UQBJRLLZ.js");
18579
+ const { collectDiagnostics } = await import("../persistent-session-TPP35O6H.js");
18534
18580
  await api.post("/host/heartbeat", {
18535
18581
  host_id: hostId,
18536
- agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor)
18582
+ agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor)
18537
18583
  });
18538
18584
  } catch (err) {
18539
18585
  log(`[fast-mcp-respawn] post-respawn diagnostics flush failed for '${codeName}': ${err.message}`);
@@ -18929,7 +18975,7 @@ async function processDirectChatMessage(agent, msg) {
18929
18975
  try {
18930
18976
  const doorbell = directChatDoorbellPath(agent.agentId, homedir18());
18931
18977
  mkdirSync11(dirname10(doorbell), { recursive: true });
18932
- writeFileSync14(doorbell, String(Date.now()));
18978
+ writeFileSync15(doorbell, String(Date.now()));
18933
18979
  log(`[direct-chat] Doorbell rung for '${agent.codeName}' (msg=${msg.id}) \u2014 in-session MCP will pull via the cursor`);
18934
18980
  return;
18935
18981
  } catch (err) {
@@ -19058,7 +19104,7 @@ ${formatRunMarker(run_id)}` : KANBAN_CHECK_COMMAND;
19058
19104
  try {
19059
19105
  const doorbell = directChatDoorbellPath(agentId, homedir18());
19060
19106
  mkdirSync11(dirname10(doorbell), { recursive: true });
19061
- writeFileSync14(doorbell, String(Date.now()));
19107
+ writeFileSync15(doorbell, String(Date.now()));
19062
19108
  } catch (err) {
19063
19109
  log(`[kanban] doorbell ring failed for '${codeName}': ${err.message} (notice still queued)`);
19064
19110
  }
@@ -19162,7 +19208,7 @@ async function processClaudePairSessions(agents) {
19162
19208
  killPairSession,
19163
19209
  pairTmuxSession,
19164
19210
  finalizeClaudePairOnboarding
19165
- } = await import("../claude-pair-runtime-GKB2QQCX.js");
19211
+ } = await import("../claude-pair-runtime-HPYSFXPP.js");
19166
19212
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
19167
19213
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
19168
19214
  const killed = await killPairSession(pairTmuxSession(pairId));
@@ -19387,17 +19433,17 @@ var lastDownloadHash = /* @__PURE__ */ new Map();
19387
19433
  var lastLocalFileHash = /* @__PURE__ */ new Map();
19388
19434
  var memoryManifests = /* @__PURE__ */ new Map();
19389
19435
  function memoryRetirementDir(configDir, codeName) {
19390
- return join38(configDir, "_memory-retirement", codeName);
19436
+ return join39(configDir, "_memory-retirement", codeName);
19391
19437
  }
19392
19438
  function memoryManifestPath(configDir, codeName) {
19393
- return join38(memoryRetirementDir(configDir, codeName), "manifest.json");
19439
+ return join39(memoryRetirementDir(configDir, codeName), "manifest.json");
19394
19440
  }
19395
19441
  function loadMemoryManifest(agentId, configDir, codeName) {
19396
19442
  const cached = memoryManifests.get(agentId);
19397
19443
  if (cached) return cached;
19398
19444
  let manifest = {};
19399
19445
  try {
19400
- const raw = readFileSync29(memoryManifestPath(configDir, codeName), "utf-8");
19446
+ const raw = readFileSync30(memoryManifestPath(configDir, codeName), "utf-8");
19401
19447
  const parsed = JSON.parse(raw);
19402
19448
  if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
19403
19449
  for (const [name, entry] of Object.entries(parsed)) {
@@ -19419,13 +19465,13 @@ function saveMemoryManifest(agentId, configDir, codeName) {
19419
19465
  const path = memoryManifestPath(configDir, codeName);
19420
19466
  mkdirSync11(memoryRetirementDir(configDir, codeName), { recursive: true });
19421
19467
  const tmp = `${path}.tmp`;
19422
- writeFileSync14(tmp, JSON.stringify(manifest, null, 2));
19468
+ writeFileSync15(tmp, JSON.stringify(manifest, null, 2));
19423
19469
  renameSync8(tmp, path);
19424
19470
  } catch {
19425
19471
  }
19426
19472
  }
19427
19473
  function retiredMemoryDir(configDir, codeName) {
19428
- return join38(memoryRetirementDir(configDir, codeName), "retired");
19474
+ return join39(memoryRetirementDir(configDir, codeName), "retired");
19429
19475
  }
19430
19476
  var RETIRED_MEMORY_TTL_MS = 30 * 24 * 60 * 60 * 1e3;
19431
19477
  var lastRetirementReport = /* @__PURE__ */ new Map();
@@ -19503,7 +19549,7 @@ function applyMemoryTombstones(opts) {
19503
19549
  log2(`[memory-retire] ${agent.code_name}: KEPT '${tomb.name}' \u2014 no write record, not ours to remove`);
19504
19550
  continue;
19505
19551
  }
19506
- const filePath = join38(memoryDir, entry.file);
19552
+ const filePath = join39(memoryDir, entry.file);
19507
19553
  if (!existsSync17(filePath)) {
19508
19554
  outcomes.already_gone++;
19509
19555
  delete manifest[tomb.name];
@@ -19511,7 +19557,7 @@ function applyMemoryTombstones(opts) {
19511
19557
  continue;
19512
19558
  }
19513
19559
  try {
19514
- const actual = createHash17("sha256").update(readFileSync29(filePath)).digest("hex");
19560
+ const actual = createHash17("sha256").update(readFileSync30(filePath)).digest("hex");
19515
19561
  if (actual !== entry.sha) {
19516
19562
  outcomes.kept_modified++;
19517
19563
  outcomes.unapplied.push({ name: tomb.name, reason: "kept_modified" });
@@ -19523,9 +19569,9 @@ function applyMemoryTombstones(opts) {
19523
19569
  const destDir = retiredMemoryDir(configDir, agent.code_name);
19524
19570
  mkdirSync11(destDir, { recursive: true });
19525
19571
  const stamp = Date.now();
19526
- let dest = join38(destDir, `${entry.file}.${stamp}.retired`);
19572
+ let dest = join39(destDir, `${entry.file}.${stamp}.retired`);
19527
19573
  for (let n = 1; existsSync17(dest); n++) {
19528
- dest = join38(destDir, `${entry.file}.${stamp}-${n}.retired`);
19574
+ dest = join39(destDir, `${entry.file}.${stamp}-${n}.retired`);
19529
19575
  }
19530
19576
  renameSync8(filePath, dest);
19531
19577
  try {
@@ -19564,7 +19610,7 @@ function reapRetiredMemories(configDir, codeName, log2) {
19564
19610
  try {
19565
19611
  for (const file of readdirSync10(dir)) {
19566
19612
  if (!file.endsWith(".retired")) continue;
19567
- const path = join38(dir, file);
19613
+ const path = join39(dir, file);
19568
19614
  try {
19569
19615
  if (statSync8(path).mtimeMs < cutoff) {
19570
19616
  unlinkSync6(path);
@@ -19579,8 +19625,8 @@ function reapRetiredMemories(configDir, codeName, log2) {
19579
19625
  if (reaped > 0) log2(`[memory-retire] ${codeName}: reaped ${reaped} retired memory file(s) past TTL`);
19580
19626
  }
19581
19627
  async function syncMemories(agent, configDir, log2) {
19582
- const projectDir = join38(configDir, agent.code_name, "project");
19583
- const memoryDir = join38(projectDir, "memory");
19628
+ const projectDir = join39(configDir, agent.code_name, "project");
19629
+ const memoryDir = join39(projectDir, "memory");
19584
19630
  const isFreshSync = pendingFreshMemorySync.has(agent.agent_id);
19585
19631
  if (isFreshSync) {
19586
19632
  log2(`[memory-sync] Fresh-sync requested for '${agent.code_name}' \u2014 pulling DB first`);
@@ -19611,7 +19657,7 @@ async function syncMemories(agent, configDir, log2) {
19611
19657
  for (const file of readdirSync10(memoryDir)) {
19612
19658
  if (!file.endsWith(".md")) continue;
19613
19659
  try {
19614
- const raw = readFileSync29(join38(memoryDir, file), "utf-8");
19660
+ const raw = readFileSync30(join39(memoryDir, file), "utf-8");
19615
19661
  const fileHash = createHash17("sha256").update(raw).digest("hex").slice(0, 16);
19616
19662
  currentHashes.set(file, fileHash);
19617
19663
  if (prevHashes.get(file) === fileHash) continue;
@@ -19636,7 +19682,7 @@ async function syncMemories(agent, configDir, log2) {
19636
19682
  } catch (err) {
19637
19683
  for (const mem of changedMemories) {
19638
19684
  for (const [file] of currentHashes) {
19639
- const parsed = parseMemoryFile(readFileSync29(join38(memoryDir, file), "utf-8"), file.replace(/\.md$/, ""));
19685
+ const parsed = parseMemoryFile(readFileSync30(join39(memoryDir, file), "utf-8"), file.replace(/\.md$/, ""));
19640
19686
  if (parsed?.name === mem.name) currentHashes.delete(file);
19641
19687
  }
19642
19688
  }
@@ -19687,7 +19733,7 @@ async function downloadMemories(agent, memoryDir, log2, { force, configDir }) {
19687
19733
  const rawSlug = mem.name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "").slice(0, 60);
19688
19734
  const slug = rawSlug || `memory-${i}`;
19689
19735
  const fileName = `${slug}.md`;
19690
- const filePath = join38(memoryDir, fileName);
19736
+ const filePath = join39(memoryDir, fileName);
19691
19737
  const desired = `---
19692
19738
  name: ${JSON.stringify(mem.name)}
19693
19739
  type: ${mem.type}
@@ -19707,7 +19753,7 @@ ${mem.content}
19707
19753
  if (existsSync17(filePath)) {
19708
19754
  let existing = "";
19709
19755
  try {
19710
- existing = readFileSync29(filePath, "utf-8");
19756
+ existing = readFileSync30(filePath, "utf-8");
19711
19757
  } catch {
19712
19758
  }
19713
19759
  if (existing === desired) {
@@ -19715,10 +19761,10 @@ ${mem.content}
19715
19761
  if (manifestDirty) saveMemoryManifest(agent.agent_id, configDir, agent.code_name);
19716
19762
  continue;
19717
19763
  }
19718
- writeFileSync14(filePath, desired);
19764
+ writeFileSync15(filePath, desired);
19719
19765
  overwritten++;
19720
19766
  } else {
19721
- writeFileSync14(filePath, desired);
19767
+ writeFileSync15(filePath, desired);
19722
19768
  written++;
19723
19769
  }
19724
19770
  if (record()) manifestDirty = true;
@@ -20007,7 +20053,7 @@ function startManager(opts) {
20007
20053
  try {
20008
20054
  const stateFile = getStateFile();
20009
20055
  if (existsSync17(stateFile)) {
20010
- const raw = readFileSync29(stateFile, "utf-8");
20056
+ const raw = readFileSync30(stateFile, "utf-8");
20011
20057
  const parsed = JSON.parse(raw);
20012
20058
  if (Array.isArray(parsed.agents)) {
20013
20059
  state8.agents = parsed.agents;
@@ -20034,7 +20080,7 @@ function startManager(opts) {
20034
20080
  log(`[startup] state rehydration failed (continuing with empty state): ${err.message}`);
20035
20081
  }
20036
20082
  log(
20037
- `[startup] worker pid=${process.pid} ppid=${process.ppid} node=${process.version} log=${join38(homedir18(), ".augmented", "manager.log")}`
20083
+ `[startup] worker pid=${process.pid} ppid=${process.ppid} node=${process.version} log=${join39(homedir18(), ".augmented", "manager.log")}`
20038
20084
  );
20039
20085
  deployMcpAssets();
20040
20086
  reapOrphanChannelMcps({ log });
@@ -20063,7 +20109,7 @@ async function reapOrphanedClaudePids() {
20063
20109
  const looksLikeClaude = (pid) => {
20064
20110
  if (process.platform !== "linux") return true;
20065
20111
  try {
20066
- const comm = readFileSync29(`/proc/${pid}/comm`, "utf-8").trim().toLowerCase();
20112
+ const comm = readFileSync30(`/proc/${pid}/comm`, "utf-8").trim().toLowerCase();
20067
20113
  return comm.includes("claude");
20068
20114
  } catch {
20069
20115
  return false;
@@ -20160,14 +20206,14 @@ function restartRunningChannelMcps(basenames) {
20160
20206
  }
20161
20207
  }
20162
20208
  function deployMcpAssets() {
20163
- const targetDir = join38(homedir18(), ".augmented", "_mcp");
20209
+ const targetDir = join39(homedir18(), ".augmented", "_mcp");
20164
20210
  mkdirSync11(targetDir, { recursive: true });
20165
20211
  const moduleDir = dirname10(fileURLToPath(import.meta.url));
20166
20212
  let mcpSourceDir = "";
20167
20213
  let dir = moduleDir;
20168
20214
  for (let i = 0; i < 6; i++) {
20169
- const candidate = join38(dir, "dist", "mcp");
20170
- if (existsSync17(join38(candidate, "index.js"))) {
20215
+ const candidate = join39(dir, "dist", "mcp");
20216
+ if (existsSync17(join39(candidate, "index.js"))) {
20171
20217
  mcpSourceDir = candidate;
20172
20218
  break;
20173
20219
  }
@@ -20185,7 +20231,7 @@ function deployMcpAssets() {
20185
20231
  const fileHash = (p) => {
20186
20232
  try {
20187
20233
  if (!existsSync17(p)) return null;
20188
- return createHash17("sha256").update(readFileSync29(p)).digest("hex");
20234
+ return createHash17("sha256").update(readFileSync30(p)).digest("hex");
20189
20235
  } catch {
20190
20236
  return null;
20191
20237
  }
@@ -20256,8 +20302,8 @@ function deployMcpAssets() {
20256
20302
  // needs restarting to pick up a token rotation.
20257
20303
  "xero.js"
20258
20304
  ]) {
20259
- const src = join38(mcpSourceDir, file);
20260
- const dst = join38(targetDir, file);
20305
+ const src = join39(mcpSourceDir, file);
20306
+ const dst = join39(targetDir, file);
20261
20307
  if (!existsSync17(src)) continue;
20262
20308
  attemptedFiles.push(file);
20263
20309
  const before = fileHash(dst);
@@ -20283,23 +20329,23 @@ function deployMcpAssets() {
20283
20329
  log(`[manager] Bundle(s) updated: ${changedBasenames.join(", ")} \u2014 signalling running instances to restart`);
20284
20330
  restartRunningChannelMcps(changedBasenames);
20285
20331
  }
20286
- const localMcpPath = join38(targetDir, "index.js");
20332
+ const localMcpPath = join39(targetDir, "index.js");
20287
20333
  try {
20288
- const agentsDir = join38(homedir18(), ".augmented", "agents");
20334
+ const agentsDir = join39(homedir18(), ".augmented", "agents");
20289
20335
  if (existsSync17(agentsDir)) {
20290
20336
  for (const entry of readdirSync10(agentsDir, { withFileTypes: true })) {
20291
20337
  if (!entry.isDirectory()) continue;
20292
20338
  for (const subdir of ["provision", "project"]) {
20293
- const mcpJsonPath = join38(agentsDir, entry.name, subdir, ".mcp.json");
20339
+ const mcpJsonPath = join39(agentsDir, entry.name, subdir, ".mcp.json");
20294
20340
  try {
20295
- const raw = readFileSync29(mcpJsonPath, "utf-8");
20341
+ const raw = readFileSync30(mcpJsonPath, "utf-8");
20296
20342
  if (!raw.includes("@integrity-labs/augmented-mcp")) continue;
20297
20343
  const mcpConfig = JSON.parse(raw);
20298
20344
  const augServer = mcpConfig.mcpServers?.["augmented"];
20299
20345
  if (!augServer) continue;
20300
20346
  augServer.command = "node";
20301
20347
  augServer.args = [localMcpPath];
20302
- writeFileSync14(mcpJsonPath, JSON.stringify(mcpConfig, null, 2));
20348
+ writeFileSync15(mcpJsonPath, JSON.stringify(mcpConfig, null, 2));
20303
20349
  log(`[manager] Patched ${entry.name}/${subdir}/.mcp.json: npx \u2192 node`);
20304
20350
  } catch {
20305
20351
  }