negotium 0.22.5 → 0.22.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/agent-helpers.js +394 -1295
  2. package/dist/agent-helpers.js.map +3 -3
  3. package/dist/background-bash.js +12 -12
  4. package/dist/background-bash.js.map +2 -2
  5. package/dist/browser-runtime.js +42 -44
  6. package/dist/browser-runtime.js.map +2 -2
  7. package/dist/canonical-mcp-bridge.js +8 -9
  8. package/dist/canonical-mcp-bridge.js.map +1 -1
  9. package/dist/{chunk-a3me2mje.js → chunk-1e0nxy7p.js} +12 -12
  10. package/dist/{chunk-a3me2mje.js.map → chunk-1e0nxy7p.js.map} +2 -2
  11. package/dist/{chunk-9zn0bkc9.js → chunk-1mba9m1j.js} +77 -116
  12. package/dist/{chunk-9zn0bkc9.js.map → chunk-1mba9m1j.js.map} +2 -2
  13. package/dist/{chunk-vh8px000.js → chunk-9a50csg6.js} +115 -119
  14. package/dist/{chunk-vh8px000.js.map → chunk-9a50csg6.js.map} +6 -6
  15. package/dist/chunk-bnyvxss3.js +77 -0
  16. package/dist/{chunk-q5djsg78.js.map → chunk-bnyvxss3.js.map} +1 -1
  17. package/dist/{chunk-7rpbcn1j.js → chunk-e59kzyvy.js} +4 -5
  18. package/dist/{chunk-7rpbcn1j.js.map → chunk-e59kzyvy.js.map} +2 -2
  19. package/dist/{chunk-f7p0h1gs.js → chunk-ww8a4ej4.js} +5 -5
  20. package/dist/{chunk-f7p0h1gs.js.map → chunk-ww8a4ej4.js.map} +2 -2
  21. package/dist/hosted-agent.js +119 -122
  22. package/dist/hosted-agent.js.map +3 -3
  23. package/dist/main.js +3303 -5132
  24. package/dist/main.js.map +5 -5
  25. package/dist/mcp-catalog.js +4 -4
  26. package/dist/mcp-catalog.js.map +1 -1
  27. package/dist/mcp-factories.js +616 -1509
  28. package/dist/mcp-factories.js.map +3 -3
  29. package/dist/mcp-servers.js +5 -5
  30. package/dist/mcp-servers.js.map +1 -1
  31. package/dist/media.js +3 -3
  32. package/dist/media.js.map +1 -1
  33. package/dist/outbox.js +15 -15
  34. package/dist/outbox.js.map +2 -2
  35. package/dist/platform-runtime.js +7 -7
  36. package/dist/platform-runtime.js.map +1 -1
  37. package/dist/prompts.js +6 -6
  38. package/dist/prompts.js.map +2 -2
  39. package/dist/query-runtime.js +16 -18
  40. package/dist/query-runtime.js.map +2 -2
  41. package/dist/registry.js +19 -20
  42. package/dist/registry.js.map +2 -2
  43. package/dist/rollout.js +41 -41
  44. package/dist/rollout.js.map +2 -2
  45. package/dist/runtime/src/topics/update.ts +20 -0
  46. package/dist/runtime/src/version.ts +1 -1
  47. package/dist/runtime-gateway.js +12 -12
  48. package/dist/runtime-gateway.js.map +2 -2
  49. package/dist/runtime-helpers.js +52 -54
  50. package/dist/runtime-helpers.js.map +2 -2
  51. package/dist/sqlite.js +3 -5
  52. package/dist/sqlite.js.map +2 -2
  53. package/dist/storage.js +4831 -4802
  54. package/dist/storage.js.map +2 -2
  55. package/dist/types/packages/core/src/version.d.ts +1 -1
  56. package/dist/vault.js +20 -22
  57. package/dist/vault.js.map +2 -2
  58. package/package.json +1 -1
  59. package/dist/chunk-2mx7fq49.js +0 -6
  60. package/dist/chunk-2mx7fq49.js.map +0 -9
  61. package/dist/chunk-q5djsg78.js +0 -200
@@ -1,51 +1,48 @@
1
1
  // @bun
2
2
  import {
3
- canonicalMcpBridgeEnv,
4
- revokeCanonicalMcpBridgeTurn
5
- } from "./chunk-f7p0h1gs.js";
6
- import {
7
- AGENT_HEALTH_SERVER,
8
- BASHRS_SPILL_ROOT,
9
- BASH_RS_BIN,
10
- BASH_RS_VERSION,
11
- BG_BASH_BASE_PORT,
12
- BG_BASH_MAX_PORT,
13
- CANONICAL_MCP_PROXY_SERVER,
14
- CLAUDE_EFFORT_VALUES,
15
- CLAUDE_EXECUTABLE,
16
- DECISION_SERVER,
17
- DM_WORKSPACE_DIR,
18
- FALLBACK_AGENT,
19
- FILE_TAG_REGEX,
20
- MODEL_FABLE,
21
- MODEL_OPUS,
22
- MODEL_SONNET,
23
- NEGOTIUM_PORT,
24
- PROJECT_ROOT,
25
- RUNTIME_MCP_SECRET,
26
- RUN_DIR,
27
- SESSION_COMM_SERVER,
28
- SESSION_WORKSPACE_DIR,
29
3
  SUPPORTED_AGENTS,
30
- SYSTEM_HEALTH_SERVER,
31
- TASK_SERVER,
32
- TOKEN_STATS_SERVER,
33
- TOPIC_WORKSPACE_DIR,
34
- TSCONFIG_PATH,
35
- TSX_LOADER,
36
- VAULT_MASTER_KEY,
37
- VAULT_SERVER,
38
- WIKI_SERVER,
39
- WORKSPACE_DIR,
40
- codexAuthFilePath,
41
- envText,
42
- logger,
4
+ CLAUDE_EFFORT_VALUES,
43
5
  resolveFallbackAgent,
44
- resolveTopicWorkspaceDir
45
- } from "./chunk-9zn0bkc9.js";
6
+ logger,
7
+ envText2,
8
+ PROJECT_ROOT2,
9
+ WORKSPACE_DIR2,
10
+ TOPIC_WORKSPACE_DIR2,
11
+ DM_WORKSPACE_DIR2,
12
+ SESSION_WORKSPACE_DIR2,
13
+ CLAUDE_EXECUTABLE2,
14
+ BASH_RS_VERSION2,
15
+ BASH_RS_BIN2,
16
+ TSX_LOADER2,
17
+ TSCONFIG_PATH2,
18
+ SESSION_COMM_SERVER2,
19
+ TASK_SERVER2,
20
+ DECISION_SERVER2,
21
+ CANONICAL_MCP_PROXY_SERVER2,
22
+ WIKI_SERVER2,
23
+ TOKEN_STATS_SERVER2,
24
+ SYSTEM_HEALTH_SERVER2,
25
+ AGENT_HEALTH_SERVER2,
26
+ VAULT_SERVER2,
27
+ BG_BASH_BASE_PORT2,
28
+ BG_BASH_MAX_PORT2,
29
+ resolveTopicWorkspaceDir2,
30
+ RUNTIME_MCP_SECRET2,
31
+ VAULT_MASTER_KEY2,
32
+ NEGOTIUM_PORT2,
33
+ RUN_DIR2,
34
+ BASHRS_SPILL_ROOT2,
35
+ FILE_TAG_REGEX2,
36
+ MODEL_SONNET2,
37
+ MODEL_OPUS2,
38
+ MODEL_FABLE2,
39
+ FALLBACK_AGENT2,
40
+ codexAuthFilePath2
41
+ } from "./chunk-1mba9m1j.js";
46
42
  import {
47
- __require
48
- } from "./chunk-2mx7fq49.js";
43
+ canonicalMcpBridgeEnv2,
44
+ revokeCanonicalMcpBridgeTurn2
45
+ } from "./chunk-ww8a4ej4.js";
49
46
 
50
47
  // ../../packages/core/src/agents/claude-provider.ts
51
48
  import { spawn as spawn2 } from "child_process";
@@ -63,12 +60,12 @@ function toDisplayPath(filePath) {
63
60
 
64
61
  // ../../packages/core/src/agents/rollout/shared.ts
65
62
  var trustedWorkspaceRoots = [
66
- WORKSPACE_DIR,
67
- DM_WORKSPACE_DIR,
68
- SESSION_WORKSPACE_DIR,
69
- TOPIC_WORKSPACE_DIR
63
+ WORKSPACE_DIR2,
64
+ DM_WORKSPACE_DIR2,
65
+ SESSION_WORKSPACE_DIR2,
66
+ TOPIC_WORKSPACE_DIR2
70
67
  ].map((root) => resolve2(root));
71
- var FIXTURES_DIR = resolve2(PROJECT_ROOT, "src", "agents", "fixtures");
68
+ var FIXTURES_DIR = resolve2(PROJECT_ROOT2, "src", "agents", "fixtures");
72
69
 
73
70
  // ../../packages/core/src/platform/jsonl.ts
74
71
  import {
@@ -154,9 +151,9 @@ function fsyncDirectoryBestEffort(dir) {
154
151
 
155
152
  // ../../packages/core/src/agents/claude-registry.ts
156
153
  var ALIAS_MAP = {
157
- sonnet: MODEL_SONNET,
158
- opus: MODEL_OPUS,
159
- fable: MODEL_FABLE
154
+ sonnet: MODEL_SONNET2,
155
+ opus: MODEL_OPUS2,
156
+ fable: MODEL_FABLE2
160
157
  };
161
158
  var VALID_ALIASES = new Set(Object.keys(ALIAS_MAP));
162
159
  var VALID_EFFORTS = new Set(CLAUDE_EFFORT_VALUES);
@@ -523,12 +520,12 @@ class McpUrlBudgetExceededError extends Error {
523
520
  this.name = "McpUrlBudgetExceededError";
524
521
  }
525
522
  }
526
- var runtimePort = NEGOTIUM_PORT;
523
+ var runtimePort = NEGOTIUM_PORT2;
527
524
  function encodeTokenPart(value) {
528
525
  return Buffer.from(JSON.stringify(value), "utf-8").toString("base64url");
529
526
  }
530
527
  function signTokenPayload(payloadPart) {
531
- return createHmac("sha256", RUNTIME_MCP_SECRET).update(payloadPart).digest("base64url");
528
+ return createHmac("sha256", RUNTIME_MCP_SECRET2).update(payloadPart).digest("base64url");
532
529
  }
533
530
  function issueRuntimeMcpToken(ctx) {
534
531
  const payloadPart = encodeTokenPart({
@@ -680,9 +677,9 @@ function createBackgroundBashManager(options = {}) {
680
677
  const knownContexts = new Map;
681
678
  const runtimeCapability = options.capability ?? randomBytes(32).toString("hex");
682
679
  const runtimeServerId = options.serverId ?? randomBytes(16).toString("hex");
683
- const bashRsBin = options.bashRsBin ?? BASH_RS_BIN;
684
- const basePort = options.basePort ?? BG_BASH_BASE_PORT;
685
- const maxPort = options.maxPort ?? BG_BASH_MAX_PORT;
680
+ const bashRsBin = options.bashRsBin ?? BASH_RS_BIN2;
681
+ const basePort = options.basePort ?? BG_BASH_BASE_PORT2;
682
+ const maxPort = options.maxPort ?? BG_BASH_MAX_PORT2;
686
683
  const fetchImpl = options.fetch ?? globalThis.fetch;
687
684
  const now = options.now ?? Date.now;
688
685
  const wait = options.delay ?? delay;
@@ -739,7 +736,7 @@ function createBackgroundBashManager(options = {}) {
739
736
  }
740
737
  async function spawnServer(key, reservedPort, excludedPorts = new Set) {
741
738
  if (!bashRsBin) {
742
- throw new Error(`background-bash requires the bash-rs ${BASH_RS_VERSION} binary; run install-bash-rs.mjs (or set NEGOTIUM_BASH_RS_BIN)`);
739
+ throw new Error(`background-bash requires the bash-rs ${BASH_RS_VERSION2} binary; run install-bash-rs.mjs (or set NEGOTIUM_BASH_RS_BIN)`);
743
740
  }
744
741
  const port = reservedPort ?? await allocatePort(excludedPorts);
745
742
  const process2 = spawnImpl(bashRsBin, [String(port)], {
@@ -752,7 +749,7 @@ function createBackgroundBashManager(options = {}) {
752
749
  NEGOTIUM_BG_BASH_SERVER_ID: runtimeServerId,
753
750
  BASHRS_HTTP_CAPABILITY: runtimeCapability,
754
751
  BASHRS_INSTANCE_ID: runtimeServerId,
755
- BASHRS_SPILL_ROOT
752
+ BASHRS_SPILL_ROOT: BASHRS_SPILL_ROOT2
756
753
  }
757
754
  });
758
755
  process2.once("error", (error) => {
@@ -839,12 +836,12 @@ function createBackgroundBashManager(options = {}) {
839
836
  usedPorts.clear();
840
837
  knownContexts.clear();
841
838
  const deadline = now() + 3000;
842
- await Promise.all(entries.map((instance) => new Promise((resolve4) => {
839
+ await Promise.all(entries.map((instance) => new Promise((resolve) => {
843
840
  if (instance.process.exitCode !== null || instance.process.killed)
844
- return resolve4();
845
- instance.process.once("exit", resolve4);
846
- instance.process.once("error", resolve4);
847
- const timer = setTimeout(resolve4, Math.max(0, deadline - now()));
841
+ return resolve();
842
+ instance.process.once("exit", resolve);
843
+ instance.process.once("error", resolve);
844
+ const timer = setTimeout(resolve, Math.max(0, deadline - now()));
848
845
  timer.unref?.();
849
846
  })));
850
847
  }
@@ -1276,7 +1273,7 @@ var SCHEMA_TRIGGERS = {
1276
1273
  };
1277
1274
  var OTIUM_TOPIC_SCOPE_IMMUTABLE_ERROR = "otium_topic_scope_immutable";
1278
1275
  function topicLinkSchemaIsCurrent(database, nodeId) {
1279
- const objects = new Map(database.query("SELECT name, sql FROM sqlite_master WHERE type IN ('table','index','trigger')").all().map((row2) => [row2.name, row2.sql ?? ""]));
1276
+ const objects = new Map(database.query("SELECT name, sql FROM sqlite_master WHERE type IN ('table','index','trigger')").all().map((row) => [row.name, row.sql ?? ""]));
1280
1277
  for (const name of [...SCHEMA_TABLES, ...SCHEMA_INDEXES, ...SCHEMA_INDEXES_TOMBSTONES]) {
1281
1278
  if (!objects.has(name))
1282
1279
  return false;
@@ -1293,7 +1290,7 @@ function topicLinkSchemaIsCurrent(database, nodeId) {
1293
1290
  return false;
1294
1291
  }
1295
1292
  const identity = database.query("SELECT node_id, epoch_id FROM api_node_identity WHERE singleton = 1").all();
1296
- if (identity.some((row2) => row2.epoch_id === null))
1293
+ if (identity.some((row) => row.epoch_id === null))
1297
1294
  return false;
1298
1295
  if (nodeId && identity[0]?.node_id !== nodeId)
1299
1296
  return false;
@@ -2112,8 +2109,8 @@ function buildStdioMcpServer(agent, serverFile, serverArgs, env) {
2112
2109
  if (agent === "codex") {
2113
2110
  return {
2114
2111
  command: "node",
2115
- args: ["--import", TSX_LOADER, serverFile, ...serverArgs],
2116
- env: { TSX_TSCONFIG_PATH: TSCONFIG_PATH, ...env }
2112
+ args: ["--import", TSX_LOADER2, serverFile, ...serverArgs],
2113
+ env: { TSX_TSCONFIG_PATH: TSCONFIG_PATH2, ...env }
2117
2114
  };
2118
2115
  }
2119
2116
  return {
@@ -2123,12 +2120,12 @@ function buildStdioMcpServer(agent, serverFile, serverArgs, env) {
2123
2120
  };
2124
2121
  }
2125
2122
  function useHostedBuiltinMcp() {
2126
- return envText("NEGOTIUM_BUILTIN_MCP_TRANSPORT") !== "stdio";
2123
+ return envText2("NEGOTIUM_BUILTIN_MCP_TRANSPORT") !== "stdio";
2127
2124
  }
2128
2125
  function buildBuiltinMcpServer(surface, ctx, stdio) {
2129
2126
  if (!useHostedBuiltinMcp())
2130
2127
  return stdio();
2131
- const agent = ctx.agent ?? FALLBACK_AGENT;
2128
+ const agent = ctx.agent ?? FALLBACK_AGENT2;
2132
2129
  return buildHostedMcpSpec(agent, surface, {
2133
2130
  userId: ctx.userId,
2134
2131
  ...ctx.actorUserId ? { actorUserId: ctx.actorUserId } : {},
@@ -2140,7 +2137,7 @@ function buildBuiltinMcpServer(surface, ctx, stdio) {
2140
2137
  ...ctx.wikiTopicId ? { wikiTopicId: ctx.wikiTopicId } : {},
2141
2138
  ...ctx.subagentParentTopicId ? { subagentParentTopicId: ctx.subagentParentTopicId } : {},
2142
2139
  ...ctx.threadRootId ? { threadRootId: ctx.threadRootId } : {},
2143
- cwd: ctx.cwd ?? (ctx.topicId ? resolveTopicWorkspaceDir(ctx.topicId) : process.cwd()),
2140
+ cwd: ctx.cwd ?? (ctx.topicId ? resolveTopicWorkspaceDir2(ctx.topicId) : process.cwd()),
2144
2141
  agent,
2145
2142
  ...ctx.model ? { model: ctx.model } : {},
2146
2143
  ...ctx.depth !== undefined ? { depth: ctx.depth } : {},
@@ -2253,7 +2250,7 @@ var MCP_CATALOG = {
2253
2250
  topicId,
2254
2251
  topicTitle: session,
2255
2252
  queryId,
2256
- cwd: cwd ?? resolveTopicWorkspaceDir(topicId),
2253
+ cwd: cwd ?? resolveTopicWorkspaceDir2(topicId),
2257
2254
  agent,
2258
2255
  model,
2259
2256
  ...switchTargets.length ? { explicitAgentSwitchTargets: switchTargets } : {},
@@ -2268,7 +2265,7 @@ var MCP_CATALOG = {
2268
2265
  "token-stats": {
2269
2266
  ...commonRuntimeMcpPolicy("token-stats"),
2270
2267
  build(ctx) {
2271
- return buildBuiltinMcpServer("token-stats", ctx, () => buildStdioMcpServer(ctx.agent, TOKEN_STATS_SERVER, [`--user-id=${ctx.userId}`]));
2268
+ return buildBuiltinMcpServer("token-stats", ctx, () => buildStdioMcpServer(ctx.agent, TOKEN_STATS_SERVER2, [`--user-id=${ctx.userId}`]));
2272
2269
  }
2273
2270
  },
2274
2271
  task: {
@@ -2278,19 +2275,19 @@ var MCP_CATALOG = {
2278
2275
  if (peerBridge) {
2279
2276
  if (!topicId || !queryId)
2280
2277
  return null;
2281
- const env = canonicalMcpBridgeEnv({
2278
+ const env = canonicalMcpBridgeEnv2({
2282
2279
  surface: "task",
2283
2280
  userId,
2284
2281
  topicId,
2285
2282
  queryId,
2286
2283
  peerBridge
2287
2284
  });
2288
- return env ? buildStdioMcpServer(agent, CANONICAL_MCP_PROXY_SERVER, ["--surface=task"], env) : null;
2285
+ return env ? buildStdioMcpServer(agent, CANONICAL_MCP_PROXY_SERVER2, ["--surface=task"], env) : null;
2289
2286
  }
2290
2287
  const args = [`--user-id=${userId}`, `--topic=${session}`];
2291
2288
  if (topicId)
2292
2289
  args.push(`--topic-id=${topicId}`);
2293
- return buildBuiltinMcpServer("task", ctx, () => buildStdioMcpServer(agent, TASK_SERVER, args));
2290
+ return buildBuiltinMcpServer("task", ctx, () => buildStdioMcpServer(agent, TASK_SERVER2, args));
2294
2291
  }
2295
2292
  },
2296
2293
  decision: {
@@ -2300,25 +2297,25 @@ var MCP_CATALOG = {
2300
2297
  if (peerBridge) {
2301
2298
  if (!topicId || !queryId)
2302
2299
  return null;
2303
- const env = canonicalMcpBridgeEnv({
2300
+ const env = canonicalMcpBridgeEnv2({
2304
2301
  surface: "decision",
2305
2302
  userId,
2306
2303
  topicId,
2307
2304
  queryId,
2308
2305
  peerBridge
2309
2306
  });
2310
- return env ? buildStdioMcpServer(agent, CANONICAL_MCP_PROXY_SERVER, ["--surface=decision"], env) : null;
2307
+ return env ? buildStdioMcpServer(agent, CANONICAL_MCP_PROXY_SERVER2, ["--surface=decision"], env) : null;
2311
2308
  }
2312
2309
  const args = [
2313
2310
  `--user-id=${userId}`,
2314
2311
  `--topic=${session}`,
2315
- `--agent=${agent ?? FALLBACK_AGENT}`
2312
+ `--agent=${agent ?? FALLBACK_AGENT2}`
2316
2313
  ];
2317
2314
  if (topicId)
2318
2315
  args.push(`--topic-id=${topicId}`);
2319
2316
  if (model)
2320
2317
  args.push(`--model=${model}`);
2321
- return buildBuiltinMcpServer("decision", ctx, () => buildStdioMcpServer(agent, DECISION_SERVER, args));
2318
+ return buildBuiltinMcpServer("decision", ctx, () => buildStdioMcpServer(agent, DECISION_SERVER2, args));
2322
2319
  }
2323
2320
  },
2324
2321
  "session-comm": {
@@ -2338,7 +2335,7 @@ var MCP_CATALOG = {
2338
2335
  threadRootId,
2339
2336
  peerBridge
2340
2337
  } = ctx;
2341
- const effectiveAgent = agent ?? FALLBACK_AGENT;
2338
+ const effectiveAgent = agent ?? FALLBACK_AGENT2;
2342
2339
  const cronSessionId = topicId ? getRegisteredCronSession(topicId, effectiveAgent)?.sessionId : undefined;
2343
2340
  const args = [
2344
2341
  `--user-id=${userId}`,
@@ -2358,7 +2355,7 @@ var MCP_CATALOG = {
2358
2355
  ...threadRootId ? [`--thread-root-id=${threadRootId}`] : [],
2359
2356
  ...peerBridge ? [`--peer-host-query-id=${peerBridge.hostQueryId}`] : []
2360
2357
  ];
2361
- return buildBuiltinMcpServer("session-comm", ctx, () => buildStdioMcpServer(effectiveAgent, SESSION_COMM_SERVER, args, peerBridge ? peerSessionBridgeIpcEnv() : undefined));
2358
+ return buildBuiltinMcpServer("session-comm", ctx, () => buildStdioMcpServer(effectiveAgent, SESSION_COMM_SERVER2, args, peerBridge ? peerSessionBridgeIpcEnv() : undefined));
2362
2359
  }
2363
2360
  },
2364
2361
  wiki: {
@@ -2368,14 +2365,14 @@ var MCP_CATALOG = {
2368
2365
  if (peerBridge) {
2369
2366
  if (!topicId || !queryId)
2370
2367
  return null;
2371
- const env = canonicalMcpBridgeEnv({
2368
+ const env = canonicalMcpBridgeEnv2({
2372
2369
  surface: "wiki",
2373
2370
  userId,
2374
2371
  topicId,
2375
2372
  queryId,
2376
2373
  peerBridge
2377
2374
  });
2378
- return env ? buildStdioMcpServer(agent, CANONICAL_MCP_PROXY_SERVER, ["--surface=wiki"], env) : null;
2375
+ return env ? buildStdioMcpServer(agent, CANONICAL_MCP_PROXY_SERVER2, ["--surface=wiki"], env) : null;
2379
2376
  }
2380
2377
  const args = [`--user-id=${userId}`];
2381
2378
  if (topicId)
@@ -2384,7 +2381,7 @@ var MCP_CATALOG = {
2384
2381
  if (resolvedWikiTopicId)
2385
2382
  args.push(`--topic-id=${resolvedWikiTopicId}`);
2386
2383
  args.push("--surface=wiki");
2387
- return buildBuiltinMcpServer("wiki", { ...ctx, wikiTopicId: resolvedWikiTopicId }, () => buildStdioMcpServer(agent, WIKI_SERVER, args));
2384
+ return buildBuiltinMcpServer("wiki", { ...ctx, wikiTopicId: resolvedWikiTopicId }, () => buildStdioMcpServer(agent, WIKI_SERVER2, args));
2388
2385
  }
2389
2386
  },
2390
2387
  skills: {
@@ -2394,13 +2391,13 @@ var MCP_CATALOG = {
2394
2391
  const args = [`--user-id=${userId}`, "--surface=skills"];
2395
2392
  if (topicId)
2396
2393
  args.push(`--topic-id=${topicId}`);
2397
- return buildBuiltinMcpServer("skills", ctx, () => buildStdioMcpServer(agent, WIKI_SERVER, args));
2394
+ return buildBuiltinMcpServer("skills", ctx, () => buildStdioMcpServer(agent, WIKI_SERVER2, args));
2398
2395
  }
2399
2396
  },
2400
2397
  "system-health": {
2401
2398
  ...commonRuntimeMcpPolicy("system-health"),
2402
2399
  build(ctx) {
2403
- return buildBuiltinMcpServer("system-health", ctx, () => buildStdioMcpServer(ctx.agent, SYSTEM_HEALTH_SERVER, []));
2400
+ return buildBuiltinMcpServer("system-health", ctx, () => buildStdioMcpServer(ctx.agent, SYSTEM_HEALTH_SERVER2, []));
2404
2401
  }
2405
2402
  },
2406
2403
  "background-bash": {
@@ -2416,7 +2413,7 @@ var MCP_CATALOG = {
2416
2413
  build(ctx) {
2417
2414
  const { userId, agent } = ctx;
2418
2415
  const args = [`--user-id=${userId}`];
2419
- return buildBuiltinMcpServer("agent-health", ctx, () => buildStdioMcpServer(agent, AGENT_HEALTH_SERVER, args));
2416
+ return buildBuiltinMcpServer("agent-health", ctx, () => buildStdioMcpServer(agent, AGENT_HEALTH_SERVER2, args));
2420
2417
  }
2421
2418
  },
2422
2419
  vault: {
@@ -2426,7 +2423,7 @@ var MCP_CATALOG = {
2426
2423
  const args = [`--user-id=${vaultUserId ?? userId}`];
2427
2424
  if (agent !== "codex")
2428
2425
  args.push("--list-only=true");
2429
- return buildBuiltinMcpServer("vault", { ...ctx, userId: vaultUserId ?? userId }, () => buildStdioMcpServer(agent, VAULT_SERVER, args));
2426
+ return buildBuiltinMcpServer("vault", { ...ctx, userId: vaultUserId ?? userId }, () => buildStdioMcpServer(agent, VAULT_SERVER2, args));
2430
2427
  }
2431
2428
  },
2432
2429
  "cua-rs": {
@@ -2775,16 +2772,16 @@ function decryptVaultValueWithKey(userId, key, storedValue, masterKey) {
2775
2772
  }
2776
2773
 
2777
2774
  // ../../packages/core/src/storage/vault-crypto.ts
2778
- function encryptVaultValue(userId, key, value, masterKey = VAULT_MASTER_KEY) {
2775
+ function encryptVaultValue(userId, key, value, masterKey = VAULT_MASTER_KEY2) {
2779
2776
  return encryptVaultValueWithKey(userId, key, value, masterKey);
2780
2777
  }
2781
- function decryptVaultValue(userId, key, storedValue, masterKey = VAULT_MASTER_KEY) {
2778
+ function decryptVaultValue(userId, key, storedValue, masterKey = VAULT_MASTER_KEY2) {
2782
2779
  return decryptVaultValueWithKey(userId, key, storedValue, masterKey);
2783
2780
  }
2784
2781
 
2785
2782
  // ../../packages/core/src/storage/vault.ts
2786
2783
  var vaultDb;
2787
- var vaultMasterKey = VAULT_MASTER_KEY;
2784
+ var vaultMasterKey = VAULT_MASTER_KEY2;
2788
2785
  function initializeVaultDatabase(database) {
2789
2786
  database.exec("PRAGMA journal_mode = WAL");
2790
2787
  database.exec("PRAGMA busy_timeout = 5000");
@@ -2924,8 +2921,8 @@ var defaultHost = {
2924
2921
  redactVaultSecrets,
2925
2922
  substituteVaultSecrets: (userId, value) => vaultSubstituteDetailed(userId, value).text,
2926
2923
  referencesRuntimeSecretStorage,
2927
- claudeCodeExecutablePath: () => CLAUDE_EXECUTABLE,
2928
- codexAuthFilePath
2924
+ claudeCodeExecutablePath: () => CLAUDE_EXECUTABLE2,
2925
+ codexAuthFilePath: codexAuthFilePath2
2929
2926
  };
2930
2927
  var hostRegistrations = [];
2931
2928
  var scopedHost = new AsyncLocalStorage;
@@ -2990,7 +2987,7 @@ function hostedCodexHomePath() {
2990
2987
 
2991
2988
  // ../../packages/core/src/media/file-events.ts
2992
2989
  function* extractFileEvents(text, source) {
2993
- const tagRegex = new RegExp(FILE_TAG_REGEX.source, "gi");
2990
+ const tagRegex = new RegExp(FILE_TAG_REGEX2.source, "gi");
2994
2991
  let match = tagRegex.exec(text);
2995
2992
  while (match !== null) {
2996
2993
  yield { type: "file", path: match[1], source, origin: "tag" };
@@ -3132,8 +3129,8 @@ var CLAUDE_ABORT_SIGKILL_DELAY_MS = 2500;
3132
3129
  var claudeProcessExitListeners = new WeakMap;
3133
3130
  function watchClaudeProcessExit(signal) {
3134
3131
  let listener;
3135
- const exited = new Promise((resolve5) => {
3136
- listener = resolve5;
3132
+ const exited = new Promise((resolve) => {
3133
+ listener = resolve;
3137
3134
  const listeners = claudeProcessExitListeners.get(signal) ?? new Set;
3138
3135
  listeners.add(listener);
3139
3136
  claudeProcessExitListeners.set(signal, listeners);
@@ -3590,7 +3587,7 @@ import { tmpdir } from "os";
3590
3587
  import { dirname as dirname5, join as join3 } from "path";
3591
3588
 
3592
3589
  // ../../packages/core/src/version.ts
3593
- var NEGOTIUM_VERSION = "0.22.5";
3590
+ var NEGOTIUM_VERSION = "0.22.6";
3594
3591
 
3595
3592
  // ../../packages/core/src/agents/codex-native-multi-agent.ts
3596
3593
  var moduleRequire = createRequire(import.meta.url);
@@ -3658,7 +3655,7 @@ async function bootstrapCodexModelCache(codexHome, cachePath) {
3658
3655
  stdio: ["pipe", "pipe", "pipe"],
3659
3656
  windowsHide: true
3660
3657
  });
3661
- const refreshed = new Promise((resolve5, reject) => {
3658
+ const refreshed = new Promise((resolve, reject) => {
3662
3659
  let settled = false;
3663
3660
  let stdoutBuffer = "";
3664
3661
  let stderr = "";
@@ -3677,7 +3674,7 @@ async function bootstrapCodexModelCache(codexHome, cachePath) {
3677
3674
  else if (!existsSync2(cachePath))
3678
3675
  reject(new Error("Codex did not create its model cache"));
3679
3676
  else
3680
- resolve5();
3677
+ resolve();
3681
3678
  };
3682
3679
  const send = (message) => {
3683
3680
  child.stdin.write(`${JSON.stringify(message)}
@@ -3744,12 +3741,12 @@ var CODEX_BOOTSTRAP_EXIT_WAIT_MS = 3000;
3744
3741
  function waitForChildExit(child, timeoutMs) {
3745
3742
  if (child.exitCode !== null || child.signalCode !== null)
3746
3743
  return Promise.resolve();
3747
- return new Promise((resolve5) => {
3748
- const timer = setTimeout(resolve5, timeoutMs);
3744
+ return new Promise((resolve) => {
3745
+ const timer = setTimeout(resolve, timeoutMs);
3749
3746
  timer.unref?.();
3750
3747
  child.once("exit", () => {
3751
3748
  clearTimeout(timer);
3752
- resolve5();
3749
+ resolve();
3753
3750
  });
3754
3751
  });
3755
3752
  }
@@ -3883,12 +3880,12 @@ function createCodexTreeManager(host, options = {}) {
3883
3880
  const previous = spawnChain;
3884
3881
  let release;
3885
3882
  let released = false;
3886
- spawnChain = new Promise((resolve5) => {
3883
+ spawnChain = new Promise((resolve) => {
3887
3884
  release = () => {
3888
3885
  if (released)
3889
3886
  return;
3890
3887
  released = true;
3891
- resolve5();
3888
+ resolve();
3892
3889
  };
3893
3890
  });
3894
3891
  await previous;
@@ -3995,7 +3992,7 @@ function createCodexTreeManager(host, options = {}) {
3995
3992
  return;
3996
3993
  const deadline = Date.now() + Math.max(0, graceMs);
3997
3994
  while (Date.now() < deadline && hasSurvivors(plan.targets)) {
3998
- await new Promise((resolve5) => setTimeout(resolve5, Math.min(100, Math.max(1, deadline - Date.now()))));
3995
+ await new Promise((resolve) => setTimeout(resolve, Math.min(100, Math.max(1, deadline - Date.now()))));
3999
3996
  }
4000
3997
  killStragglers(plan);
4001
3998
  }
@@ -4319,7 +4316,7 @@ async function createCodexVaultHookBridge(userId) {
4319
4316
  });
4320
4317
  restrictIpcEndpoint(socketPath);
4321
4318
  if (IS_WINDOWS2) {
4322
- const { BINARIES_DIR } = await import("./chunk-q5djsg78.js");
4319
+ const { BINARIES_DIR } = await import("./chunk-bnyvxss3.js");
4323
4320
  const cached = await ensureCodexWindowsWrapperExe(join5(BINARIES_DIR, "codex-hook-wrapper"));
4324
4321
  await copyFile(cached, wrapperPath);
4325
4322
  await writeFile2(join5(root, "codex-with-hooks.cfg"), [process.execPath, codexCliScriptPath(), socketPath, token].join(`
@@ -5058,9 +5055,9 @@ async function startStreamedWithTracking(thread, prompt, abortSignal, trackedPid
5058
5055
  nextP.catch(() => {});
5059
5056
  first = await Promise.race([nextP, startupTimeout]);
5060
5057
  } catch (err) {
5061
- const novel2 = findNewCodexChildren(baseline);
5062
- if (novel2.length > 0) {
5063
- killCodexTrees(novel2);
5058
+ const novel = findNewCodexChildren(baseline);
5059
+ if (novel.length > 0) {
5060
+ killCodexTrees(novel);
5064
5061
  }
5065
5062
  await closeIterator(iter);
5066
5063
  throw err;
@@ -5532,7 +5529,7 @@ function buildProviderOwnedToolBlockHook() {
5532
5529
  }
5533
5530
  };
5534
5531
  }
5535
- var MAESTRO_TOOL_OUTPUT_DIR = resolve8(RUN_DIR, "maestro-tool-outputs");
5532
+ var MAESTRO_TOOL_OUTPUT_DIR = resolve8(RUN_DIR2, "maestro-tool-outputs");
5536
5533
  function buildMaestroToolResultTruncation(opts) {
5537
5534
  if (opts.toolResultTruncation)
5538
5535
  return opts.toolResultTruncation;
@@ -5626,7 +5623,7 @@ async function* runHostedAgent(input, host) {
5626
5623
  }
5627
5624
  } finally {
5628
5625
  if (opts.userId && opts.topicId && opts.queryId && opts.peerBridge) {
5629
- revokeCanonicalMcpBridgeTurn({
5626
+ revokeCanonicalMcpBridgeTurn2({
5630
5627
  userId: opts.userId,
5631
5628
  topicId: opts.topicId,
5632
5629
  queryId: opts.queryId,
@@ -5636,17 +5633,17 @@ async function* runHostedAgent(input, host) {
5636
5633
  }
5637
5634
  }
5638
5635
  export {
5639
- toCodexMcpServers,
5640
- spawnClaudeCodeProcessWithTreeKill,
5641
- runHostedAgent,
5642
- maestroProvider,
5643
- inspectBundledClaudeRuntime,
5644
- configureAgentExecutionHost,
5645
- codexProvider,
5646
- claudeProvider,
5647
- buildMaestroToolHooks,
5636
+ buildClaudeDisallowedTools,
5648
5637
  buildMaestroDisallowedTools,
5649
- buildClaudeDisallowedTools
5638
+ buildMaestroToolHooks,
5639
+ claudeProvider,
5640
+ codexProvider,
5641
+ configureAgentExecutionHost,
5642
+ inspectBundledClaudeRuntime,
5643
+ maestroProvider,
5644
+ runHostedAgent,
5645
+ spawnClaudeCodeProcessWithTreeKill,
5646
+ toCodexMcpServers
5650
5647
  };
5651
5648
 
5652
- //# debugId=408BB69E04535D8664756E2164756E21
5649
+ //# debugId=BB59DA8C13CF133464756E2164756E21