@runeya/runeya 2.0.65 → 2.0.66

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.
package/index.js CHANGED
@@ -270,7 +270,7 @@ function listenWithRetry(server, port, host, wss, maxRetries = 20, delay = 500)
270
270
  });
271
271
  }
272
272
  async function main() {
273
- const { createLocalServer, pullEnv, PullEnvError, registerInstance } = await import("./src-YPQEXOFN.js");
273
+ const { createLocalServer, pullEnv, PullEnvError, registerInstance } = await import("./src-ETRPQHFP.js");
274
274
  if (isPullEnv) {
275
275
  if (!serviceArg) {
276
276
  console.error("Error: --service (-s) is required with --pull-env");
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Comment brancher le serveur MCP Runeya sur un CLI d'IA.
3
+ *
4
+ * Runeya n'installe rien dans la configuration de la machine : il passe sa
5
+ * config MCP en ligne de commande, au moment où il lance lui-même le CLI. Le
6
+ * `~/.claude.json` ou le `~/.codex/config.toml` de l'utilisateur reste intact,
7
+ * et un CLI lancé à la main depuis un terminal ne voit pas ce serveur.
8
+ *
9
+ * Chaque CLI a sa syntaxe — d'où ce module, seule source de vérité partagée par
10
+ * les deux points de lancement (l'agent, et le serveur en mode local).
11
+ */
12
+ /** Variables d'environnement que le serveur MCP attend pour joindre Runeya. */
13
+ interface RuneyaMcpEnv {
14
+ RUNEYA_BASE_URL?: string;
15
+ RUNEYA_API_TOKEN?: string;
16
+ }
17
+ /**
18
+ * Chemin du point d'entrée du serveur MCP, à lancer avec `node`.
19
+ *
20
+ * Ne PAS se fier à `import.meta.url` pour viser `./index.js` : ce module est
21
+ * bundlé dans l'agent et dans le serveur (tsup y bundle les paquets @runeya
22
+ * via `noExternal`), donc
23
+ * `import.meta.url` y désigne le bundle hôte, pas ce paquet. On résout donc le
24
+ * paquet, puis on sonde les emplacements de la version packagée, où les liens
25
+ * symboliques de l'espace de travail n'existent plus.
26
+ */
27
+ declare function resolveMcpServerPath(): string;
28
+ /**
29
+ * Arguments `--mcp-config` pour le CLI `claude`, qui attend du JSON.
30
+ *
31
+ * Volontairement non strict : le CLI démarre aussi les serveurs MCP de la
32
+ * machine. Cela coûte quelques secondes par lancement, mais l'utilisateur garde
33
+ * ses propres outils.
34
+ */
35
+ declare function claudeMcpArgs(env: RuneyaMcpEnv): string[];
36
+ /**
37
+ * Arguments `-c` pour le CLI `codex`, qui attend du TOML.
38
+ *
39
+ * Codex n'a pas d'équivalent de `--mcp-config` : il expose des surcharges de
40
+ * configuration en TOML (`-c chemin.pointé=valeur`), à placer AVANT la
41
+ * sous-commande. Une table inline décrit le serveur en une seule surcharge.
42
+ */
43
+ declare function codexMcpArgs(env: RuneyaMcpEnv): string[];
44
+
45
+ export { type RuneyaMcpEnv, claudeMcpArgs, codexMcpArgs, resolveMcpServerPath };
@@ -0,0 +1,65 @@
1
+ // src/launch.ts
2
+ import { fileURLToPath } from "url";
3
+ import { createRequire } from "module";
4
+ import { existsSync } from "fs";
5
+ function resolveMcpServerPath() {
6
+ try {
7
+ const req = createRequire(import.meta.url);
8
+ return req.resolve("@runeya/packages-mcp-server");
9
+ } catch {
10
+ }
11
+ const candidates = [
12
+ // Build packagé du CLI : dist/agent/index.js et dist/index.js côtoient
13
+ // dist/mcp-server/, copié là par le post-build.
14
+ new URL("../mcp-server/index.js", import.meta.url),
15
+ new URL("./mcp-server/index.js", import.meta.url),
16
+ // Monorepo, depuis un dist d'app.
17
+ new URL("../../../packages/mcp-server/dist/index.js", import.meta.url),
18
+ new URL("../../../../packages/mcp-server/dist/index.js", import.meta.url)
19
+ ];
20
+ for (const c of candidates) {
21
+ const p = fileURLToPath(c);
22
+ if (existsSync(p)) return p;
23
+ }
24
+ throw new Error("Could not locate @runeya/packages-mcp-server (built dist not found)");
25
+ }
26
+ function pickEnv(env) {
27
+ return {
28
+ ...env.RUNEYA_BASE_URL ? { RUNEYA_BASE_URL: env.RUNEYA_BASE_URL } : {},
29
+ ...env.RUNEYA_API_TOKEN ? { RUNEYA_API_TOKEN: env.RUNEYA_API_TOKEN } : {}
30
+ };
31
+ }
32
+ function claudeMcpArgs(env) {
33
+ const config = JSON.stringify({
34
+ mcpServers: {
35
+ runeya: {
36
+ command: "node",
37
+ args: [resolveMcpServerPath()],
38
+ env: pickEnv(env)
39
+ }
40
+ }
41
+ });
42
+ return ["--mcp-config", config];
43
+ }
44
+ function codexMcpArgs(env) {
45
+ const fields = [
46
+ `command=${tomlString("node")}`,
47
+ `args=[${tomlString(resolveMcpServerPath())}]`
48
+ ];
49
+ const entries = Object.entries(pickEnv(env));
50
+ if (entries.length > 0) {
51
+ const inline = entries.map(([k, v]) => `${k}=${tomlString(v)}`).join(",");
52
+ fields.push(`env={${inline}}`);
53
+ }
54
+ return ["-c", `mcp_servers.runeya={${fields.join(",")}}`];
55
+ }
56
+ function tomlString(value) {
57
+ const escaped = value.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/[\u0000-\u001f\u007f]/g, (c) => `\\u${c.charCodeAt(0).toString(16).padStart(4, "0")}`);
58
+ return `"${escaped}"`;
59
+ }
60
+ export {
61
+ claudeMcpArgs,
62
+ codexMcpArgs,
63
+ resolveMcpServerPath
64
+ };
65
+ //# sourceMappingURL=launch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/launch.ts"],"sourcesContent":["import { fileURLToPath } from 'node:url';\nimport { createRequire } from 'node:module';\nimport { existsSync } from 'node:fs';\n\n/**\n * Comment brancher le serveur MCP Runeya sur un CLI d'IA.\n *\n * Runeya n'installe rien dans la configuration de la machine : il passe sa\n * config MCP en ligne de commande, au moment où il lance lui-même le CLI. Le\n * `~/.claude.json` ou le `~/.codex/config.toml` de l'utilisateur reste intact,\n * et un CLI lancé à la main depuis un terminal ne voit pas ce serveur.\n *\n * Chaque CLI a sa syntaxe — d'où ce module, seule source de vérité partagée par\n * les deux points de lancement (l'agent, et le serveur en mode local).\n */\n\n/** Variables d'environnement que le serveur MCP attend pour joindre Runeya. */\nexport interface RuneyaMcpEnv {\n RUNEYA_BASE_URL?: string;\n RUNEYA_API_TOKEN?: string;\n}\n\n/**\n * Chemin du point d'entrée du serveur MCP, à lancer avec `node`.\n *\n * Ne PAS se fier à `import.meta.url` pour viser `./index.js` : ce module est\n * bundlé dans l'agent et dans le serveur (tsup y bundle les paquets @runeya\n * via `noExternal`), donc\n * `import.meta.url` y désigne le bundle hôte, pas ce paquet. On résout donc le\n * paquet, puis on sonde les emplacements de la version packagée, où les liens\n * symboliques de l'espace de travail n'existent plus.\n */\nexport function resolveMcpServerPath(): string {\n try {\n const req = createRequire(import.meta.url);\n return req.resolve('@runeya/packages-mcp-server');\n } catch { /* pas de node_modules résolvable : on sonde le disque */ }\n\n const candidates = [\n // Build packagé du CLI : dist/agent/index.js et dist/index.js côtoient\n // dist/mcp-server/, copié là par le post-build.\n new URL('../mcp-server/index.js', import.meta.url),\n new URL('./mcp-server/index.js', import.meta.url),\n // Monorepo, depuis un dist d'app.\n new URL('../../../packages/mcp-server/dist/index.js', import.meta.url),\n new URL('../../../../packages/mcp-server/dist/index.js', import.meta.url),\n ];\n for (const c of candidates) {\n const p = fileURLToPath(c);\n if (existsSync(p)) return p;\n }\n throw new Error('Could not locate @runeya/packages-mcp-server (built dist not found)');\n}\n\n/** Ne garde que les variables renseignées : une valeur vide n'aide personne. */\nfunction pickEnv(env: RuneyaMcpEnv): Record<string, string> {\n return {\n ...(env.RUNEYA_BASE_URL ? { RUNEYA_BASE_URL: env.RUNEYA_BASE_URL } : {}),\n ...(env.RUNEYA_API_TOKEN ? { RUNEYA_API_TOKEN: env.RUNEYA_API_TOKEN } : {}),\n };\n}\n\n/**\n * Arguments `--mcp-config` pour le CLI `claude`, qui attend du JSON.\n *\n * Volontairement non strict : le CLI démarre aussi les serveurs MCP de la\n * machine. Cela coûte quelques secondes par lancement, mais l'utilisateur garde\n * ses propres outils.\n */\nexport function claudeMcpArgs(env: RuneyaMcpEnv): string[] {\n const config = JSON.stringify({\n mcpServers: {\n runeya: {\n command: 'node',\n args: [resolveMcpServerPath()],\n env: pickEnv(env),\n },\n },\n });\n return ['--mcp-config', config];\n}\n\n/**\n * Arguments `-c` pour le CLI `codex`, qui attend du TOML.\n *\n * Codex n'a pas d'équivalent de `--mcp-config` : il expose des surcharges de\n * configuration en TOML (`-c chemin.pointé=valeur`), à placer AVANT la\n * sous-commande. Une table inline décrit le serveur en une seule surcharge.\n */\nexport function codexMcpArgs(env: RuneyaMcpEnv): string[] {\n const fields = [\n `command=${tomlString('node')}`,\n `args=[${tomlString(resolveMcpServerPath())}]`,\n ];\n\n const entries = Object.entries(pickEnv(env));\n if (entries.length > 0) {\n const inline = entries.map(([k, v]) => `${k}=${tomlString(v)}`).join(',');\n fields.push(`env={${inline}}`);\n }\n\n return ['-c', `mcp_servers.runeya={${fields.join(',')}}`];\n}\n\n/**\n * Chaîne TOML de base : seuls la contre-oblique et le guillemet doivent être\n * échappés. Les caractères de contrôle, eux, sont interdits par le format — un\n * chemin ou un jeton qui en contiendrait casserait la config en silence.\n */\nfunction tomlString(value: string): string {\n const escaped = value\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/\"/g, '\\\\\"')\n .replace(/[\\u0000-\\u001f\\u007f]/g, (c) => `\\\\u${c.charCodeAt(0).toString(16).padStart(4, '0')}`);\n return `\"${escaped}\"`;\n}\n"],"mappings":";AAAA,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,kBAAkB;AA8BpB,SAAS,uBAA+B;AAC7C,MAAI;AACF,UAAM,MAAM,cAAc,YAAY,GAAG;AACzC,WAAO,IAAI,QAAQ,6BAA6B;AAAA,EAClD,QAAQ;AAAA,EAA4D;AAEpE,QAAM,aAAa;AAAA;AAAA;AAAA,IAGjB,IAAI,IAAI,0BAA0B,YAAY,GAAG;AAAA,IACjD,IAAI,IAAI,yBAAyB,YAAY,GAAG;AAAA;AAAA,IAEhD,IAAI,IAAI,8CAA8C,YAAY,GAAG;AAAA,IACrE,IAAI,IAAI,iDAAiD,YAAY,GAAG;AAAA,EAC1E;AACA,aAAW,KAAK,YAAY;AAC1B,UAAM,IAAI,cAAc,CAAC;AACzB,QAAI,WAAW,CAAC,EAAG,QAAO;AAAA,EAC5B;AACA,QAAM,IAAI,MAAM,qEAAqE;AACvF;AAGA,SAAS,QAAQ,KAA2C;AAC1D,SAAO;AAAA,IACL,GAAI,IAAI,kBAAkB,EAAE,iBAAiB,IAAI,gBAAgB,IAAI,CAAC;AAAA,IACtE,GAAI,IAAI,mBAAmB,EAAE,kBAAkB,IAAI,iBAAiB,IAAI,CAAC;AAAA,EAC3E;AACF;AASO,SAAS,cAAc,KAA6B;AACzD,QAAM,SAAS,KAAK,UAAU;AAAA,IAC5B,YAAY;AAAA,MACV,QAAQ;AAAA,QACN,SAAS;AAAA,QACT,MAAM,CAAC,qBAAqB,CAAC;AAAA,QAC7B,KAAK,QAAQ,GAAG;AAAA,MAClB;AAAA,IACF;AAAA,EACF,CAAC;AACD,SAAO,CAAC,gBAAgB,MAAM;AAChC;AASO,SAAS,aAAa,KAA6B;AACxD,QAAM,SAAS;AAAA,IACb,WAAW,WAAW,MAAM,CAAC;AAAA,IAC7B,SAAS,WAAW,qBAAqB,CAAC,CAAC;AAAA,EAC7C;AAEA,QAAM,UAAU,OAAO,QAAQ,QAAQ,GAAG,CAAC;AAC3C,MAAI,QAAQ,SAAS,GAAG;AACtB,UAAM,SAAS,QAAQ,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,WAAW,CAAC,CAAC,EAAE,EAAE,KAAK,GAAG;AACxE,WAAO,KAAK,QAAQ,MAAM,GAAG;AAAA,EAC/B;AAEA,SAAO,CAAC,MAAM,uBAAuB,OAAO,KAAK,GAAG,CAAC,GAAG;AAC1D;AAOA,SAAS,WAAW,OAAuB;AACzC,QAAM,UAAU,MACb,QAAQ,OAAO,MAAM,EACrB,QAAQ,MAAM,KAAK,EACnB,QAAQ,0BAA0B,CAAC,MAAM,MAAM,EAAE,WAAW,CAAC,EAAE,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC,EAAE;AACjG,SAAO,IAAI,OAAO;AACpB;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runeya/runeya",
3
- "version": "2.0.65",
3
+ "version": "2.0.66",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "runeya": "./index.js"
@@ -5134,7 +5134,7 @@ import Anthropic2 from "@anthropic-ai/sdk";
5134
5134
  import OpenAI2 from "openai";
5135
5135
  import { execFile as execFile3 } from "child_process";
5136
5136
  import { promisify as promisify2 } from "util";
5137
- import { fileURLToPath } from "url";
5137
+ import { fileURLToPath as fileURLToPath2 } from "url";
5138
5138
 
5139
5139
  // ../../packages/ai-capabilities/src/capabilities.ts
5140
5140
  var RUNEYA_CAPABILITIES = [
@@ -8278,6 +8278,68 @@ var ClaudeCodeRunner = class {
8278
8278
  import { spawn as spawn3 } from "child_process";
8279
8279
  import { createInterface } from "readline";
8280
8280
  import { EventEmitter as EventEmitter3 } from "events";
8281
+
8282
+ // ../../packages/mcp-server/src/launch.ts
8283
+ import { fileURLToPath } from "url";
8284
+ import { createRequire } from "module";
8285
+ import { existsSync as existsSync2 } from "fs";
8286
+ function resolveMcpServerPath() {
8287
+ try {
8288
+ const req = createRequire(import.meta.url);
8289
+ return req.resolve("@runeya/packages-mcp-server");
8290
+ } catch {
8291
+ }
8292
+ const candidates = [
8293
+ // Build packagé du CLI : dist/agent/index.js et dist/index.js côtoient
8294
+ // dist/mcp-server/, copié là par le post-build.
8295
+ new URL("../mcp-server/index.js", import.meta.url),
8296
+ new URL("./mcp-server/index.js", import.meta.url),
8297
+ // Monorepo, depuis un dist d'app.
8298
+ new URL("../../../packages/mcp-server/dist/index.js", import.meta.url),
8299
+ new URL("../../../../packages/mcp-server/dist/index.js", import.meta.url)
8300
+ ];
8301
+ for (const c of candidates) {
8302
+ const p = fileURLToPath(c);
8303
+ if (existsSync2(p)) return p;
8304
+ }
8305
+ throw new Error("Could not locate @runeya/packages-mcp-server (built dist not found)");
8306
+ }
8307
+ function pickEnv(env2) {
8308
+ return {
8309
+ ...env2.RUNEYA_BASE_URL ? { RUNEYA_BASE_URL: env2.RUNEYA_BASE_URL } : {},
8310
+ ...env2.RUNEYA_API_TOKEN ? { RUNEYA_API_TOKEN: env2.RUNEYA_API_TOKEN } : {}
8311
+ };
8312
+ }
8313
+ function codexMcpArgs(env2) {
8314
+ const fields = [
8315
+ `command=${tomlString("node")}`,
8316
+ `args=[${tomlString(resolveMcpServerPath())}]`
8317
+ ];
8318
+ const entries2 = Object.entries(pickEnv(env2));
8319
+ if (entries2.length > 0) {
8320
+ const inline = entries2.map(([k, v]) => `${k}=${tomlString(v)}`).join(",");
8321
+ fields.push(`env={${inline}}`);
8322
+ }
8323
+ return ["-c", `mcp_servers.runeya={${fields.join(",")}}`];
8324
+ }
8325
+ function tomlString(value) {
8326
+ const escaped = value.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/[\u0000-\u001f\u007f]/g, (c) => `\\u${c.charCodeAt(0).toString(16).padStart(4, "0")}`);
8327
+ return `"${escaped}"`;
8328
+ }
8329
+
8330
+ // ../server/src/services/ai-runners/codex-app-server-client.ts
8331
+ function resolveMcpArgs(env2) {
8332
+ if (!env2["RUNEYA_API_TOKEN"]) return [];
8333
+ try {
8334
+ return codexMcpArgs({
8335
+ RUNEYA_BASE_URL: env2["RUNEYA_BASE_URL"],
8336
+ RUNEYA_API_TOKEN: env2["RUNEYA_API_TOKEN"]
8337
+ });
8338
+ } catch (err) {
8339
+ console.warn("[codex-app-server] Failed to resolve MCP server path:", err.message);
8340
+ return [];
8341
+ }
8342
+ }
8281
8343
  var CodexAppServerClient = class extends EventEmitter3 {
8282
8344
  proc = null;
8283
8345
  rl = null;
@@ -8290,11 +8352,18 @@ var CodexAppServerClient = class extends EventEmitter3 {
8290
8352
  super();
8291
8353
  this.requestTimeoutMs = opts?.requestTimeoutMs ?? 12e4;
8292
8354
  }
8293
- /** Spawn codex app-server, perform initialize handshake, return server info. */
8294
- async connect() {
8295
- this.proc = spawn3("codex", ["app-server"], {
8355
+ /**
8356
+ * Spawn codex app-server, perform initialize handshake, return server info.
8357
+ *
8358
+ * `runeyaEnv` porte les identifiants Runeya : ils vont à la fois dans l'env du
8359
+ * process (le CLI y résout `$RUNEYA_API_TOKEN`) et dans la config du serveur
8360
+ * MCP dérivée de cet env — un seul canal, comme côté agent.
8361
+ */
8362
+ async connect(runeyaEnv) {
8363
+ const env2 = { ...process.env, ...runeyaEnv };
8364
+ this.proc = spawn3("codex", [...resolveMcpArgs(env2), "app-server"], {
8296
8365
  stdio: ["pipe", "pipe", "pipe"],
8297
- env: { ...process.env }
8366
+ env: env2
8298
8367
  });
8299
8368
  this.rl = createInterface({ input: this.proc.stdout });
8300
8369
  this.rl.on("line", (line) => this.handleLine(line));
@@ -8421,14 +8490,14 @@ var CodexAppServerClient = class extends EventEmitter3 {
8421
8490
  // ../server/src/services/ai-runners/codex-runner.ts
8422
8491
  var appServerClient = null;
8423
8492
  var appServerConnecting = null;
8424
- async function getAppServerClient() {
8493
+ async function getAppServerClient(runeyaEnv) {
8425
8494
  if (appServerClient) return appServerClient;
8426
8495
  if (appServerConnecting) {
8427
8496
  await appServerConnecting;
8428
8497
  return appServerClient;
8429
8498
  }
8430
8499
  const client = new CodexAppServerClient({ requestTimeoutMs: 3e5 });
8431
- appServerConnecting = client.connect().then(() => {
8500
+ appServerConnecting = client.connect(runeyaEnv).then(() => {
8432
8501
  appServerClient = client;
8433
8502
  appServerConnecting = null;
8434
8503
  }).catch((err) => {
@@ -8526,7 +8595,11 @@ var CodexRunner = class {
8526
8595
  }
8527
8596
  params.onStatus("\u{1F527} Codex en cours\u2026");
8528
8597
  params.onCommand?.("codex app-server (agent JSON-RPC)");
8529
- const codexEnv = injectedEnv && Object.keys(injectedEnv).length > 0 || apiToken ? { ...injectedEnv, ...apiToken ? { RUNEYA_API_TOKEN: apiToken } : {} } : void 0;
8598
+ const codexEnv = injectedEnv && Object.keys(injectedEnv).length > 0 || apiToken ? {
8599
+ ...injectedEnv,
8600
+ ...apiToken ? { RUNEYA_API_TOKEN: apiToken } : {},
8601
+ ...apiToken && apiBaseUrl ? { RUNEYA_BASE_URL: apiBaseUrl } : {}
8602
+ } : void 0;
8530
8603
  let threadId;
8531
8604
  if (isResume && this.lastThreadId) {
8532
8605
  const res = await agentMgr.agentMutation(agentId, "ai.codexRequest", {
@@ -8724,7 +8797,10 @@ ${prompt}`;
8724
8797
  }
8725
8798
  params.onStatus("\u{1F527} Codex en cours\u2026");
8726
8799
  params.onCommand?.("codex app-server (JSON-RPC)");
8727
- const client = await getAppServerClient();
8800
+ const client = await getAppServerClient({
8801
+ ...apiBaseUrl ? { RUNEYA_BASE_URL: apiBaseUrl } : {},
8802
+ ...apiToken ? { RUNEYA_API_TOKEN: apiToken } : {}
8803
+ });
8728
8804
  let threadId;
8729
8805
  if (isResume && this.lastThreadId) {
8730
8806
  const res = await client.sendRequest("thread/resume", { threadId: this.lastThreadId });
@@ -9164,7 +9240,7 @@ async function startClaudeCodeSession(convId, prompt, opts = {}) {
9164
9240
  conversationStore.update(conv.id, { messages: conv.messages }, { silent: true }).catch(() => {
9165
9241
  });
9166
9242
  const systemContext = await buildCliSystemContext(conv, opts.jwt);
9167
- const mcpServerPath = fileURLToPath(new URL("../mcp-server/index.js", import.meta.url));
9243
+ const mcpServerPath = fileURLToPath2(new URL("../mcp-server/index.js", import.meta.url));
9168
9244
  const mcpConfig = JSON.stringify({
9169
9245
  mcpServers: {
9170
9246
  runeya: {
@@ -9604,7 +9680,7 @@ ${input.prompt}` : input.prompt;
9604
9680
  systemContext += "\n\n" + (conv.kanbanCardId ? await buildKanbanCardPrompt(kanbanBoard, conv.kanbanCardId) : generateKanbanPopulatePrompt(kanbanBoard));
9605
9681
  }
9606
9682
  }
9607
- const mcpServerPath = fileURLToPath(new URL("../mcp-server/index.js", import.meta.url));
9683
+ const mcpServerPath = fileURLToPath2(new URL("../mcp-server/index.js", import.meta.url));
9608
9684
  const mcpConfig = JSON.stringify({
9609
9685
  mcpServers: {
9610
9686
  runeya: {
@@ -10237,7 +10313,7 @@ Context:
10237
10313
  const agentId = input.agentId ?? agentManager.getDefaultAgentId();
10238
10314
  if (!agentId) throw new TRPCError11({ code: "PRECONDITION_FAILED", message: "No agent available" });
10239
10315
  const stressSessionId = `${input.sessionId}-stress-${Date.now().toString(36)}`;
10240
- const { existsSync: existsSync3 } = await import("fs");
10316
+ const { existsSync: existsSync4 } = await import("fs");
10241
10317
  const candidates = [
10242
10318
  new URL("../../../../scripts/pty-stress-gen.mjs", import.meta.url),
10243
10319
  new URL("../../../../../scripts/pty-stress-gen.mjs", import.meta.url),
@@ -10245,8 +10321,8 @@ Context:
10245
10321
  ];
10246
10322
  let scriptPath = null;
10247
10323
  for (const c of candidates) {
10248
- const p = fileURLToPath(c);
10249
- if (existsSync3(p)) {
10324
+ const p = fileURLToPath2(c);
10325
+ if (existsSync4(p)) {
10250
10326
  scriptPath = p;
10251
10327
  break;
10252
10328
  }
@@ -10254,7 +10330,7 @@ Context:
10254
10330
  if (!scriptPath) {
10255
10331
  throw new TRPCError11({
10256
10332
  code: "INTERNAL_SERVER_ERROR",
10257
- message: `pty-stress-gen.mjs not found near ${fileURLToPath(import.meta.url)}`
10333
+ message: `pty-stress-gen.mjs not found near ${fileURLToPath2(import.meta.url)}`
10258
10334
  });
10259
10335
  }
10260
10336
  const res = await agentManager.agentMutation(
@@ -15235,7 +15311,7 @@ async function migrateSettingsIntoVaults() {
15235
15311
  }
15236
15312
 
15237
15313
  // ../server/src/migrations/migrate-from-legacy.ts
15238
- import { createRequire } from "module";
15314
+ import { createRequire as createRequire2 } from "module";
15239
15315
  import { randomBytes as randomBytes6, createCipheriv as createCipheriv3, createDecipheriv as createDecipheriv3 } from "crypto";
15240
15316
  import { randomUUID as randomUUID12 } from "crypto";
15241
15317
  import {
@@ -15247,7 +15323,7 @@ import {
15247
15323
  readdir as readdir11
15248
15324
  } from "fs/promises";
15249
15325
  import { join as join27, dirname as dirname10 } from "path";
15250
- var _require = createRequire(import.meta.url);
15326
+ var _require = createRequire2(import.meta.url);
15251
15327
  var PARSER_ID_MAP = {
15252
15328
  "stack-monitor-parser-jsons": "native:json",
15253
15329
  "stack-monitor-parser-debug": "native:debug",
@@ -16352,7 +16428,7 @@ function getOpenApiDocument() {
16352
16428
 
16353
16429
  // ../server/src/create-server.ts
16354
16430
  import rateLimit from "express-rate-limit";
16355
- import { existsSync as existsSync2, createReadStream } from "fs";
16431
+ import { existsSync as existsSync3, createReadStream } from "fs";
16356
16432
  import multer from "multer";
16357
16433
 
16358
16434
  // ../server/src/services/image-cleanup.service.ts
@@ -16463,7 +16539,7 @@ async function createLocalServer() {
16463
16539
  const absoluteDataDir = resolve6(env.DATA_DIR);
16464
16540
  console.log(`[server] Local project directory: ${absoluteDataDir}`);
16465
16541
  console.log(`[server] Machine directory: ${machineRoot()}`);
16466
- if (existsSync2(env.DATA_DIR)) {
16542
+ if (existsSync3(env.DATA_DIR)) {
16467
16543
  await ensureDataGitignore(env.DATA_DIR);
16468
16544
  }
16469
16545
  await settingsManager.getSettings();
@@ -17291,4 +17367,4 @@ export {
17291
17367
  pullEnv,
17292
17368
  registerInstance
17293
17369
  };
17294
- //# sourceMappingURL=src-YPQEXOFN.js.map
17370
+ //# sourceMappingURL=src-ETRPQHFP.js.map