open-agents-ai 0.103.16 → 0.103.18

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 (2) hide show
  1. package/dist/index.js +856 -419
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -39,7 +39,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
39
39
  mod
40
40
  ));
41
41
 
42
- // packages/cli/dist/config.js
42
+ // ../packages/cli/dist/config.js
43
43
  import { readFileSync, existsSync, mkdirSync, writeFileSync } from "node:fs";
44
44
  import { homedir } from "node:os";
45
45
  import { join } from "node:path";
@@ -126,7 +126,7 @@ function coerceConfigValue(key, value) {
126
126
  }
127
127
  var DEFAULT_CONFIG, VALID_BACKEND_TYPES;
128
128
  var init_config = __esm({
129
- "packages/cli/dist/config.js"() {
129
+ "../packages/cli/dist/config.js"() {
130
130
  "use strict";
131
131
  DEFAULT_CONFIG = Object.freeze({
132
132
  backendUrl: "http://127.0.0.1:11434",
@@ -143,7 +143,7 @@ var init_config = __esm({
143
143
  }
144
144
  });
145
145
 
146
- // packages/cli/dist/ui/output.js
146
+ // ../packages/cli/dist/ui/output.js
147
147
  function ansi(code, text, tty) {
148
148
  return tty ? `\x1B[${code}m${text}\x1B[0m` : text;
149
149
  }
@@ -222,7 +222,7 @@ function printReport(opts) {
222
222
  }
223
223
  var isTTY, isStderrTTY, c, STATUS_ICON, STATUS_COLOR;
224
224
  var init_output = __esm({
225
- "packages/cli/dist/ui/output.js"() {
225
+ "../packages/cli/dist/ui/output.js"() {
226
226
  "use strict";
227
227
  isTTY = process.stdout.isTTY;
228
228
  isStderrTTY = process.stderr.isTTY;
@@ -254,7 +254,7 @@ var init_output = __esm({
254
254
  }
255
255
  });
256
256
 
257
- // packages/cli/dist/updater.js
257
+ // ../packages/cli/dist/updater.js
258
258
  import { execSync } from "node:child_process";
259
259
  import { existsSync as existsSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
260
260
  import { join as join2 } from "node:path";
@@ -362,7 +362,7 @@ function formatUpdateBanner(info) {
362
362
  }
363
363
  var PACKAGE_NAME, CHECK_INTERVAL_MS, CACHE_DIR, CACHE_FILE;
364
364
  var init_updater = __esm({
365
- "packages/cli/dist/updater.js"() {
365
+ "../packages/cli/dist/updater.js"() {
366
366
  "use strict";
367
367
  PACKAGE_NAME = "open-agents-ai";
368
368
  CHECK_INTERVAL_MS = 60 * 60 * 1e3;
@@ -371,10 +371,10 @@ var init_updater = __esm({
371
371
  }
372
372
  });
373
373
 
374
- // packages/cli/dist/ui/spinner.js
374
+ // ../packages/cli/dist/ui/spinner.js
375
375
  var FRAMES, INTERVAL_MS, Spinner;
376
376
  var init_spinner = __esm({
377
- "packages/cli/dist/ui/spinner.js"() {
377
+ "../packages/cli/dist/ui/spinner.js"() {
378
378
  "use strict";
379
379
  FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
380
380
  INTERVAL_MS = 80;
@@ -472,10 +472,10 @@ var init_spinner = __esm({
472
472
  }
473
473
  });
474
474
 
475
- // packages/backend-vllm/dist/sleep.js
475
+ // ../packages/backend-vllm/dist/sleep.js
476
476
  var SleepManager;
477
477
  var init_sleep = __esm({
478
- "packages/backend-vllm/dist/sleep.js"() {
478
+ "../packages/backend-vllm/dist/sleep.js"() {
479
479
  "use strict";
480
480
  SleepManager = class {
481
481
  baseUrl;
@@ -551,7 +551,7 @@ var init_sleep = __esm({
551
551
  }
552
552
  });
553
553
 
554
- // packages/backend-vllm/dist/normalizeUrl.js
554
+ // ../packages/backend-vllm/dist/normalizeUrl.js
555
555
  function normalizeBaseUrl(url) {
556
556
  let u = url.trim();
557
557
  u = u.replace(/\/+$/, "");
@@ -583,7 +583,7 @@ function detectProvider(url) {
583
583
  }
584
584
  var PROVIDERS;
585
585
  var init_normalizeUrl = __esm({
586
- "packages/backend-vllm/dist/normalizeUrl.js"() {
586
+ "../packages/backend-vllm/dist/normalizeUrl.js"() {
587
587
  "use strict";
588
588
  PROVIDERS = [
589
589
  // --- Cloud providers (specific domains) ---
@@ -652,7 +652,7 @@ var init_normalizeUrl = __esm({
652
652
  }
653
653
  });
654
654
 
655
- // packages/backend-vllm/dist/VllmBackend.js
655
+ // ../packages/backend-vllm/dist/VllmBackend.js
656
656
  function agentMessageToChatMessage(msg) {
657
657
  return {
658
658
  role: msg.role,
@@ -664,7 +664,7 @@ function buildEmptyUsage() {
664
664
  }
665
665
  var VllmBackend;
666
666
  var init_VllmBackend = __esm({
667
- "packages/backend-vllm/dist/VllmBackend.js"() {
667
+ "../packages/backend-vllm/dist/VllmBackend.js"() {
668
668
  "use strict";
669
669
  init_sleep();
670
670
  init_normalizeUrl();
@@ -807,7 +807,7 @@ var init_VllmBackend = __esm({
807
807
  }
808
808
  });
809
809
 
810
- // packages/backend-vllm/dist/OllamaBackend.js
810
+ // ../packages/backend-vllm/dist/OllamaBackend.js
811
811
  function agentMessageToChatMessage2(msg) {
812
812
  return {
813
813
  role: msg.role,
@@ -819,7 +819,7 @@ function buildEmptyUsage2() {
819
819
  }
820
820
  var OllamaBackend;
821
821
  var init_OllamaBackend = __esm({
822
- "packages/backend-vllm/dist/OllamaBackend.js"() {
822
+ "../packages/backend-vllm/dist/OllamaBackend.js"() {
823
823
  "use strict";
824
824
  init_normalizeUrl();
825
825
  OllamaBackend = class _OllamaBackend {
@@ -998,7 +998,7 @@ var init_OllamaBackend = __esm({
998
998
  }
999
999
  });
1000
1000
 
1001
- // packages/backend-vllm/dist/FakeBackend.js
1001
+ // ../packages/backend-vllm/dist/FakeBackend.js
1002
1002
  function fnv1a32(input) {
1003
1003
  const FNV_PRIME = 16777619;
1004
1004
  const FNV_OFFSET_BASIS = 2166136261;
@@ -1011,7 +1011,7 @@ function fnv1a32(input) {
1011
1011
  }
1012
1012
  var FakeBackend;
1013
1013
  var init_FakeBackend = __esm({
1014
- "packages/backend-vllm/dist/FakeBackend.js"() {
1014
+ "../packages/backend-vllm/dist/FakeBackend.js"() {
1015
1015
  "use strict";
1016
1016
  FakeBackend = class {
1017
1017
  options;
@@ -1111,7 +1111,7 @@ var init_FakeBackend = __esm({
1111
1111
  }
1112
1112
  });
1113
1113
 
1114
- // packages/backend-vllm/dist/backendFactory.js
1114
+ // ../packages/backend-vllm/dist/backendFactory.js
1115
1115
  function detectBackendType(baseUrl) {
1116
1116
  if (!baseUrl) {
1117
1117
  return "ollama";
@@ -1150,7 +1150,7 @@ function createBackend(opts) {
1150
1150
  }
1151
1151
  }
1152
1152
  var init_backendFactory = __esm({
1153
- "packages/backend-vllm/dist/backendFactory.js"() {
1153
+ "../packages/backend-vllm/dist/backendFactory.js"() {
1154
1154
  "use strict";
1155
1155
  init_OllamaBackend();
1156
1156
  init_VllmBackend();
@@ -1158,7 +1158,7 @@ var init_backendFactory = __esm({
1158
1158
  }
1159
1159
  });
1160
1160
 
1161
- // packages/backend-vllm/dist/metrics.js
1161
+ // ../packages/backend-vllm/dist/metrics.js
1162
1162
  function parseMetricValue(prometheusText, metricName) {
1163
1163
  const lines = prometheusText.split("\n");
1164
1164
  for (const line of lines) {
@@ -1179,7 +1179,7 @@ function parseMetricValue(prometheusText, metricName) {
1179
1179
  }
1180
1180
  var MetricsCollector;
1181
1181
  var init_metrics = __esm({
1182
- "packages/backend-vllm/dist/metrics.js"() {
1182
+ "../packages/backend-vllm/dist/metrics.js"() {
1183
1183
  "use strict";
1184
1184
  MetricsCollector = class {
1185
1185
  metricsUrl;
@@ -1234,16 +1234,16 @@ var init_metrics = __esm({
1234
1234
  }
1235
1235
  });
1236
1236
 
1237
- // packages/backend-vllm/dist/routing.js
1237
+ // ../packages/backend-vllm/dist/routing.js
1238
1238
  var init_routing = __esm({
1239
- "packages/backend-vllm/dist/routing.js"() {
1239
+ "../packages/backend-vllm/dist/routing.js"() {
1240
1240
  "use strict";
1241
1241
  }
1242
1242
  });
1243
1243
 
1244
- // packages/backend-vllm/dist/index.js
1244
+ // ../packages/backend-vllm/dist/index.js
1245
1245
  var init_dist = __esm({
1246
- "packages/backend-vllm/dist/index.js"() {
1246
+ "../packages/backend-vllm/dist/index.js"() {
1247
1247
  "use strict";
1248
1248
  init_VllmBackend();
1249
1249
  init_OllamaBackend();
@@ -1256,18 +1256,18 @@ var init_dist = __esm({
1256
1256
  }
1257
1257
  });
1258
1258
 
1259
- // packages/execution/dist/tool-executor.js
1259
+ // ../packages/execution/dist/tool-executor.js
1260
1260
  var init_tool_executor = __esm({
1261
- "packages/execution/dist/tool-executor.js"() {
1261
+ "../packages/execution/dist/tool-executor.js"() {
1262
1262
  "use strict";
1263
1263
  }
1264
1264
  });
1265
1265
 
1266
- // packages/execution/dist/tools/shell.js
1266
+ // ../packages/execution/dist/tools/shell.js
1267
1267
  import { spawn } from "node:child_process";
1268
1268
  var PERMISSION_ERROR_RE, ShellTool;
1269
1269
  var init_shell = __esm({
1270
- "packages/execution/dist/tools/shell.js"() {
1270
+ "../packages/execution/dist/tools/shell.js"() {
1271
1271
  "use strict";
1272
1272
  PERMISSION_ERROR_RE = /Permission denied|Operation not permitted|EACCES|EPERM|PermissionError|sudo:|not permitted|password is required|authentication failure/i;
1273
1273
  ShellTool = class {
@@ -1464,7 +1464,7 @@ ${stderr}` : ""),
1464
1464
  }
1465
1465
  });
1466
1466
 
1467
- // packages/execution/dist/tools/file-read.js
1467
+ // ../packages/execution/dist/tools/file-read.js
1468
1468
  import { readFile } from "node:fs/promises";
1469
1469
  import { resolve } from "node:path";
1470
1470
  function extractPath(args) {
@@ -1493,7 +1493,7 @@ function extractPath(args) {
1493
1493
  }
1494
1494
  var FileReadTool;
1495
1495
  var init_file_read = __esm({
1496
- "packages/execution/dist/tools/file-read.js"() {
1496
+ "../packages/execution/dist/tools/file-read.js"() {
1497
1497
  "use strict";
1498
1498
  FileReadTool = class {
1499
1499
  name = "file_read";
@@ -1581,7 +1581,7 @@ var init_file_read = __esm({
1581
1581
  }
1582
1582
  });
1583
1583
 
1584
- // packages/execution/dist/tools/file-write.js
1584
+ // ../packages/execution/dist/tools/file-write.js
1585
1585
  import { writeFile, mkdir } from "node:fs/promises";
1586
1586
  import { resolve as resolve2, dirname } from "node:path";
1587
1587
  function extractWritePath(args) {
@@ -1594,7 +1594,7 @@ function extractWritePath(args) {
1594
1594
  }
1595
1595
  var FileWriteTool;
1596
1596
  var init_file_write = __esm({
1597
- "packages/execution/dist/tools/file-write.js"() {
1597
+ "../packages/execution/dist/tools/file-write.js"() {
1598
1598
  "use strict";
1599
1599
  FileWriteTool = class {
1600
1600
  name = "file_write";
@@ -1653,13 +1653,13 @@ var init_file_write = __esm({
1653
1653
  }
1654
1654
  });
1655
1655
 
1656
- // packages/execution/dist/tools/grep-search.js
1656
+ // ../packages/execution/dist/tools/grep-search.js
1657
1657
  import { execFile } from "node:child_process";
1658
1658
  import { promisify } from "node:util";
1659
1659
  import { resolve as resolve3 } from "node:path";
1660
1660
  var execFileAsync, MAX_OUTPUT_LINES, GrepSearchTool;
1661
1661
  var init_grep_search = __esm({
1662
- "packages/execution/dist/tools/grep-search.js"() {
1662
+ "../packages/execution/dist/tools/grep-search.js"() {
1663
1663
  "use strict";
1664
1664
  execFileAsync = promisify(execFile);
1665
1665
  MAX_OUTPUT_LINES = 100;
@@ -1758,13 +1758,13 @@ var init_grep_search = __esm({
1758
1758
  }
1759
1759
  });
1760
1760
 
1761
- // packages/execution/dist/tools/glob-find.js
1761
+ // ../packages/execution/dist/tools/glob-find.js
1762
1762
  import { execFile as execFile2 } from "node:child_process";
1763
1763
  import { promisify as promisify2 } from "node:util";
1764
1764
  import { resolve as resolve4 } from "node:path";
1765
1765
  var execFileAsync2, MAX_RESULTS, GlobFindTool;
1766
1766
  var init_glob_find = __esm({
1767
- "packages/execution/dist/tools/glob-find.js"() {
1767
+ "../packages/execution/dist/tools/glob-find.js"() {
1768
1768
  "use strict";
1769
1769
  execFileAsync2 = promisify2(execFile2);
1770
1770
  MAX_RESULTS = 50;
@@ -1835,10 +1835,10 @@ var init_glob_find = __esm({
1835
1835
  }
1836
1836
  });
1837
1837
 
1838
- // packages/execution/dist/tools/web-fetch.js
1838
+ // ../packages/execution/dist/tools/web-fetch.js
1839
1839
  var DEFAULT_MAX_LENGTH, WebFetchTool;
1840
1840
  var init_web_fetch = __esm({
1841
- "packages/execution/dist/tools/web-fetch.js"() {
1841
+ "../packages/execution/dist/tools/web-fetch.js"() {
1842
1842
  "use strict";
1843
1843
  DEFAULT_MAX_LENGTH = 5e3;
1844
1844
  WebFetchTool = class {
@@ -1910,7 +1910,7 @@ var init_web_fetch = __esm({
1910
1910
  }
1911
1911
  });
1912
1912
 
1913
- // packages/execution/dist/tools/web-search.js
1913
+ // ../packages/execution/dist/tools/web-search.js
1914
1914
  function detectSearchProvider() {
1915
1915
  if (process.env["TAVILY_API_KEY"])
1916
1916
  return "tavily";
@@ -1920,7 +1920,7 @@ function detectSearchProvider() {
1920
1920
  }
1921
1921
  var DEFAULT_NUM_RESULTS, DUCKDUCKGO_HTML_URL, TAVILY_API_URL, JINA_SEARCH_URL, WebSearchTool;
1922
1922
  var init_web_search = __esm({
1923
- "packages/execution/dist/tools/web-search.js"() {
1923
+ "../packages/execution/dist/tools/web-search.js"() {
1924
1924
  "use strict";
1925
1925
  DEFAULT_NUM_RESULTS = 5;
1926
1926
  DUCKDUCKGO_HTML_URL = "https://html.duckduckgo.com/html/";
@@ -2184,14 +2184,14 @@ ${formatted}`,
2184
2184
  }
2185
2185
  });
2186
2186
 
2187
- // packages/execution/dist/tools/web-crawl.js
2187
+ // ../packages/execution/dist/tools/web-crawl.js
2188
2188
  import { execFile as execFile3 } from "node:child_process";
2189
2189
  import { dirname as dirname2, join as join3 } from "node:path";
2190
2190
  import { fileURLToPath } from "node:url";
2191
2191
  import { existsSync as existsSync3 } from "node:fs";
2192
2192
  var DEFAULT_MAX_LENGTH2, WebCrawlTool;
2193
2193
  var init_web_crawl = __esm({
2194
- "packages/execution/dist/tools/web-crawl.js"() {
2194
+ "../packages/execution/dist/tools/web-crawl.js"() {
2195
2195
  "use strict";
2196
2196
  DEFAULT_MAX_LENGTH2 = 8e3;
2197
2197
  WebCrawlTool = class {
@@ -2465,7 +2465,7 @@ Meta: ${metaKeys.map((k) => `${k}="${meta[k]?.slice(0, 80)}"`).join(", ")}`);
2465
2465
  }
2466
2466
  });
2467
2467
 
2468
- // packages/execution/dist/tools/file-edit.js
2468
+ // ../packages/execution/dist/tools/file-edit.js
2469
2469
  import { readFile as readFile2, writeFile as writeFile2 } from "node:fs/promises";
2470
2470
  import { resolve as resolve5 } from "node:path";
2471
2471
  function extractEditPath(args) {
@@ -2500,7 +2500,7 @@ function replaceAllOccurrences(haystack, needle, replacement) {
2500
2500
  }
2501
2501
  var FileEditTool;
2502
2502
  var init_file_edit = __esm({
2503
- "packages/execution/dist/tools/file-edit.js"() {
2503
+ "../packages/execution/dist/tools/file-edit.js"() {
2504
2504
  "use strict";
2505
2505
  FileEditTool = class {
2506
2506
  name = "file_edit";
@@ -2610,12 +2610,12 @@ var init_file_edit = __esm({
2610
2610
  }
2611
2611
  });
2612
2612
 
2613
- // packages/execution/dist/tools/memory-read.js
2613
+ // ../packages/execution/dist/tools/memory-read.js
2614
2614
  import { readFile as readFile3 } from "node:fs/promises";
2615
2615
  import { resolve as resolve6, join as join4 } from "node:path";
2616
2616
  var MemoryReadTool;
2617
2617
  var init_memory_read = __esm({
2618
- "packages/execution/dist/tools/memory-read.js"() {
2618
+ "../packages/execution/dist/tools/memory-read.js"() {
2619
2619
  "use strict";
2620
2620
  MemoryReadTool = class {
2621
2621
  name = "memory_read";
@@ -2705,13 +2705,13 @@ ${JSON.stringify(entries, null, 2)}`,
2705
2705
  }
2706
2706
  });
2707
2707
 
2708
- // packages/execution/dist/tools/memory-write.js
2708
+ // ../packages/execution/dist/tools/memory-write.js
2709
2709
  import { readFile as readFile4, writeFile as writeFile3, mkdir as mkdir2 } from "node:fs/promises";
2710
2710
  import { resolve as resolve7, join as join5 } from "node:path";
2711
2711
  import { randomBytes } from "node:crypto";
2712
2712
  var MemoryWriteTool;
2713
2713
  var init_memory_write = __esm({
2714
- "packages/execution/dist/tools/memory-write.js"() {
2714
+ "../packages/execution/dist/tools/memory-write.js"() {
2715
2715
  "use strict";
2716
2716
  MemoryWriteTool = class {
2717
2717
  name = "memory_write";
@@ -2796,7 +2796,7 @@ var init_memory_write = __esm({
2796
2796
  }
2797
2797
  });
2798
2798
 
2799
- // packages/execution/dist/tools/memory-search.js
2799
+ // ../packages/execution/dist/tools/memory-search.js
2800
2800
  import { readFile as readFile5, readdir } from "node:fs/promises";
2801
2801
  import { resolve as resolve8, join as join6, basename } from "node:path";
2802
2802
  import { existsSync as existsSync4 } from "node:fs";
@@ -2902,7 +2902,7 @@ function tokenize(text) {
2902
2902
  }
2903
2903
  var MemorySearchTool;
2904
2904
  var init_memory_search = __esm({
2905
- "packages/execution/dist/tools/memory-search.js"() {
2905
+ "../packages/execution/dist/tools/memory-search.js"() {
2906
2906
  "use strict";
2907
2907
  MemorySearchTool = class {
2908
2908
  name = "memory_search";
@@ -3026,10 +3026,10 @@ Try broader terms or use memory_read with a specific topic.`,
3026
3026
  }
3027
3027
  });
3028
3028
 
3029
- // packages/execution/dist/tools/explore-tools.js
3029
+ // ../packages/execution/dist/tools/explore-tools.js
3030
3030
  var TOOL_CATALOG, ExploreToolsTool;
3031
3031
  var init_explore_tools = __esm({
3032
- "packages/execution/dist/tools/explore-tools.js"() {
3032
+ "../packages/execution/dist/tools/explore-tools.js"() {
3033
3033
  "use strict";
3034
3034
  TOOL_CATALOG = {
3035
3035
  grep_search: "Search file contents with regex patterns",
@@ -3193,12 +3193,12 @@ Examples:`);
3193
3193
  }
3194
3194
  });
3195
3195
 
3196
- // packages/execution/dist/tools/list-directory.js
3196
+ // ../packages/execution/dist/tools/list-directory.js
3197
3197
  import { readdirSync, statSync } from "node:fs";
3198
3198
  import { resolve as resolve9, join as join7 } from "node:path";
3199
3199
  var EXCLUDED, MAX_ENTRIES, ListDirectoryTool;
3200
3200
  var init_list_directory = __esm({
3201
- "packages/execution/dist/tools/list-directory.js"() {
3201
+ "../packages/execution/dist/tools/list-directory.js"() {
3202
3202
  "use strict";
3203
3203
  EXCLUDED = /* @__PURE__ */ new Set(["node_modules", ".git"]);
3204
3204
  MAX_ENTRIES = 100;
@@ -3280,11 +3280,11 @@ var init_list_directory = __esm({
3280
3280
  }
3281
3281
  });
3282
3282
 
3283
- // packages/execution/dist/tools/aiwg-setup.js
3283
+ // ../packages/execution/dist/tools/aiwg-setup.js
3284
3284
  import { execSync as execSync2 } from "node:child_process";
3285
3285
  var AiwgSetupTool;
3286
3286
  var init_aiwg_setup = __esm({
3287
- "packages/execution/dist/tools/aiwg-setup.js"() {
3287
+ "../packages/execution/dist/tools/aiwg-setup.js"() {
3288
3288
  "use strict";
3289
3289
  AiwgSetupTool = class {
3290
3290
  name = "aiwg_setup";
@@ -3358,13 +3358,13 @@ ${output}`,
3358
3358
  }
3359
3359
  });
3360
3360
 
3361
- // packages/execution/dist/tools/aiwg-health.js
3361
+ // ../packages/execution/dist/tools/aiwg-health.js
3362
3362
  import { execSync as execSync3 } from "node:child_process";
3363
3363
  import { existsSync as existsSync5, readdirSync as readdirSync2, readFileSync as readFileSync3, statSync as statSync2 } from "node:fs";
3364
3364
  import { join as join8 } from "node:path";
3365
3365
  var AiwgHealthTool;
3366
3366
  var init_aiwg_health = __esm({
3367
- "packages/execution/dist/tools/aiwg-health.js"() {
3367
+ "../packages/execution/dist/tools/aiwg-health.js"() {
3368
3368
  "use strict";
3369
3369
  AiwgHealthTool = class {
3370
3370
  name = "aiwg_health";
@@ -3570,11 +3570,11 @@ var init_aiwg_health = __esm({
3570
3570
  }
3571
3571
  });
3572
3572
 
3573
- // packages/execution/dist/tools/aiwg-workflow.js
3573
+ // ../packages/execution/dist/tools/aiwg-workflow.js
3574
3574
  import { execSync as execSync4 } from "node:child_process";
3575
3575
  var AiwgWorkflowTool;
3576
3576
  var init_aiwg_workflow = __esm({
3577
- "packages/execution/dist/tools/aiwg-workflow.js"() {
3577
+ "../packages/execution/dist/tools/aiwg-workflow.js"() {
3578
3578
  "use strict";
3579
3579
  AiwgWorkflowTool = class {
3580
3580
  name = "aiwg_workflow";
@@ -3655,7 +3655,7 @@ var init_aiwg_workflow = __esm({
3655
3655
  }
3656
3656
  });
3657
3657
 
3658
- // packages/execution/dist/tools/batch-edit.js
3658
+ // ../packages/execution/dist/tools/batch-edit.js
3659
3659
  import { readFile as readFile6, writeFile as writeFile4 } from "node:fs/promises";
3660
3660
  import { resolve as resolve10 } from "node:path";
3661
3661
  function countOccurrences2(haystack, needle) {
@@ -3669,7 +3669,7 @@ function countOccurrences2(haystack, needle) {
3669
3669
  }
3670
3670
  var BatchEditTool;
3671
3671
  var init_batch_edit = __esm({
3672
- "packages/execution/dist/tools/batch-edit.js"() {
3672
+ "../packages/execution/dist/tools/batch-edit.js"() {
3673
3673
  "use strict";
3674
3674
  BatchEditTool = class {
3675
3675
  name = "batch_edit";
@@ -3781,12 +3781,12 @@ ${results.join("\n")}`,
3781
3781
  }
3782
3782
  });
3783
3783
 
3784
- // packages/execution/dist/tools/file-patch.js
3784
+ // ../packages/execution/dist/tools/file-patch.js
3785
3785
  import { readFile as readFile7, writeFile as writeFile5, copyFile } from "node:fs/promises";
3786
3786
  import { resolve as resolve11 } from "node:path";
3787
3787
  var FilePatchTool;
3788
3788
  var init_file_patch = __esm({
3789
- "packages/execution/dist/tools/file-patch.js"() {
3789
+ "../packages/execution/dist/tools/file-patch.js"() {
3790
3790
  "use strict";
3791
3791
  FilePatchTool = class {
3792
3792
  name = "file_patch";
@@ -3953,12 +3953,12 @@ ${diff}`,
3953
3953
  }
3954
3954
  });
3955
3955
 
3956
- // packages/execution/dist/tools/codebase-map.js
3956
+ // ../packages/execution/dist/tools/codebase-map.js
3957
3957
  import { readdirSync as readdirSync3, statSync as statSync3, readFileSync as readFileSync4, existsSync as existsSync6 } from "node:fs";
3958
3958
  import { join as join9, relative, extname } from "node:path";
3959
3959
  var CodebaseMapTool;
3960
3960
  var init_codebase_map = __esm({
3961
- "packages/execution/dist/tools/codebase-map.js"() {
3961
+ "../packages/execution/dist/tools/codebase-map.js"() {
3962
3962
  "use strict";
3963
3963
  CodebaseMapTool = class {
3964
3964
  name = "codebase_map";
@@ -4241,13 +4241,13 @@ var init_codebase_map = __esm({
4241
4241
  }
4242
4242
  });
4243
4243
 
4244
- // packages/execution/dist/tools/diagnostic.js
4244
+ // ../packages/execution/dist/tools/diagnostic.js
4245
4245
  import { execSync as execSync5 } from "node:child_process";
4246
4246
  import { existsSync as existsSync7, readFileSync as readFileSync5 } from "node:fs";
4247
4247
  import { join as join10 } from "node:path";
4248
4248
  var DiagnosticTool;
4249
4249
  var init_diagnostic = __esm({
4250
- "packages/execution/dist/tools/diagnostic.js"() {
4250
+ "../packages/execution/dist/tools/diagnostic.js"() {
4251
4251
  "use strict";
4252
4252
  DiagnosticTool = class {
4253
4253
  name = "diagnostic";
@@ -4386,13 +4386,13 @@ ${err.stderr ?? ""}`.trim(),
4386
4386
  }
4387
4387
  });
4388
4388
 
4389
- // packages/execution/dist/tools/git-info.js
4389
+ // ../packages/execution/dist/tools/git-info.js
4390
4390
  import { execSync as execSync6 } from "node:child_process";
4391
4391
  import { existsSync as existsSync8 } from "node:fs";
4392
4392
  import { join as join11 } from "node:path";
4393
4393
  var GitInfoTool;
4394
4394
  var init_git_info = __esm({
4395
- "packages/execution/dist/tools/git-info.js"() {
4395
+ "../packages/execution/dist/tools/git-info.js"() {
4396
4396
  "use strict";
4397
4397
  GitInfoTool = class {
4398
4398
  name = "git_info";
@@ -4517,7 +4517,7 @@ var init_git_info = __esm({
4517
4517
  }
4518
4518
  });
4519
4519
 
4520
- // packages/execution/dist/tools/background-task.js
4520
+ // ../packages/execution/dist/tools/background-task.js
4521
4521
  import { spawn as spawn2 } from "node:child_process";
4522
4522
  function toInfo(entry) {
4523
4523
  return {
@@ -4533,7 +4533,7 @@ function toInfo(entry) {
4533
4533
  }
4534
4534
  var BackgroundTaskManager, BackgroundRunTool, TaskStatusTool, TaskOutputTool, TaskStopTool;
4535
4535
  var init_background_task = __esm({
4536
- "packages/execution/dist/tools/background-task.js"() {
4536
+ "../packages/execution/dist/tools/background-task.js"() {
4537
4537
  "use strict";
4538
4538
  BackgroundTaskManager = class {
4539
4539
  tasks = /* @__PURE__ */ new Map();
@@ -4805,7 +4805,7 @@ Exit code: ${task.exitCode ?? "N/A"}`,
4805
4805
  }
4806
4806
  });
4807
4807
 
4808
- // packages/execution/dist/system-deps.js
4808
+ // ../packages/execution/dist/system-deps.js
4809
4809
  import { execSync as execSync7 } from "node:child_process";
4810
4810
  function detectPackageManager() {
4811
4811
  if (_detectedPkgManager !== void 0)
@@ -4946,7 +4946,7 @@ function ensureCommand(command) {
4946
4946
  }
4947
4947
  var DESKTOP_DEPS, _detectedPkgManager, _cache, _sudoPassword;
4948
4948
  var init_system_deps = __esm({
4949
- "packages/execution/dist/system-deps.js"() {
4949
+ "../packages/execution/dist/system-deps.js"() {
4950
4950
  "use strict";
4951
4951
  DESKTOP_DEPS = [
4952
4952
  {
@@ -4997,7 +4997,7 @@ var init_system_deps = __esm({
4997
4997
  }
4998
4998
  });
4999
4999
 
5000
- // packages/execution/dist/tools/image.js
5000
+ // ../packages/execution/dist/tools/image.js
5001
5001
  import { existsSync as existsSync9, readFileSync as readFileSync6, statSync as statSync4 } from "node:fs";
5002
5002
  import { resolve as resolve12, extname as extname2, basename as basename2 } from "node:path";
5003
5003
  import { execSync as execSync8 } from "node:child_process";
@@ -5086,7 +5086,7 @@ function runOCR(filePath) {
5086
5086
  }
5087
5087
  var IMAGE_EXTENSIONS, ImageReadTool, ScreenshotTool, OCRTool;
5088
5088
  var init_image = __esm({
5089
- "packages/execution/dist/tools/image.js"() {
5089
+ "../packages/execution/dist/tools/image.js"() {
5090
5090
  "use strict";
5091
5091
  init_system_deps();
5092
5092
  IMAGE_EXTENSIONS = /* @__PURE__ */ new Set([
@@ -5376,7 +5376,7 @@ ${text}`,
5376
5376
  }
5377
5377
  });
5378
5378
 
5379
- // packages/execution/dist/tools/custom-tool.js
5379
+ // ../packages/execution/dist/tools/custom-tool.js
5380
5380
  var custom_tool_exports = {};
5381
5381
  __export(custom_tool_exports, {
5382
5382
  CustomTool: () => CustomTool,
@@ -5479,7 +5479,7 @@ function loadFromDirectory(dir) {
5479
5479
  }
5480
5480
  var CustomTool;
5481
5481
  var init_custom_tool = __esm({
5482
- "packages/execution/dist/tools/custom-tool.js"() {
5482
+ "../packages/execution/dist/tools/custom-tool.js"() {
5483
5483
  "use strict";
5484
5484
  CustomTool = class {
5485
5485
  name;
@@ -5588,10 +5588,10 @@ ${stderr}` : ""),
5588
5588
  }
5589
5589
  });
5590
5590
 
5591
- // packages/execution/dist/tools/tool-creator.js
5591
+ // ../packages/execution/dist/tools/tool-creator.js
5592
5592
  var CreateToolTool, ManageToolsTool;
5593
5593
  var init_tool_creator = __esm({
5594
- "packages/execution/dist/tools/tool-creator.js"() {
5594
+ "../packages/execution/dist/tools/tool-creator.js"() {
5595
5595
  "use strict";
5596
5596
  init_custom_tool();
5597
5597
  CreateToolTool = class {
@@ -5882,7 +5882,7 @@ var init_tool_creator = __esm({
5882
5882
  }
5883
5883
  });
5884
5884
 
5885
- // packages/execution/dist/tools/skill-tools.js
5885
+ // ../packages/execution/dist/tools/skill-tools.js
5886
5886
  import { existsSync as existsSync11, readdirSync as readdirSync5, readFileSync as readFileSync8 } from "node:fs";
5887
5887
  import { join as join14, basename as basename3, dirname as dirname3 } from "node:path";
5888
5888
  import { homedir as homedir5 } from "node:os";
@@ -6197,7 +6197,7 @@ function parseTriggers(filePath) {
6197
6197
  }
6198
6198
  var _cachedAiwgPkgRoot, SkillListTool, SkillExecuteTool;
6199
6199
  var init_skill_tools = __esm({
6200
- "packages/execution/dist/tools/skill-tools.js"() {
6200
+ "../packages/execution/dist/tools/skill-tools.js"() {
6201
6201
  "use strict";
6202
6202
  SkillListTool = class {
6203
6203
  name = "skill_list";
@@ -6322,7 +6322,7 @@ ${content}`,
6322
6322
  }
6323
6323
  });
6324
6324
 
6325
- // packages/execution/dist/tools/skill-builder.js
6325
+ // ../packages/execution/dist/tools/skill-builder.js
6326
6326
  import { existsSync as existsSync12, mkdirSync as mkdirSync4, readFileSync as readFileSync9, writeFileSync as writeFileSync4 } from "node:fs";
6327
6327
  import { join as join15, dirname as dirname4 } from "node:path";
6328
6328
  function loadBuilderPrompt(name, vars) {
@@ -6360,7 +6360,7 @@ function extractJSON(text) {
6360
6360
  }
6361
6361
  var SkillBuildTool;
6362
6362
  var init_skill_builder = __esm({
6363
- "packages/execution/dist/tools/skill-builder.js"() {
6363
+ "../packages/execution/dist/tools/skill-builder.js"() {
6364
6364
  "use strict";
6365
6365
  SkillBuildTool = class {
6366
6366
  name = "skill_build";
@@ -6567,7 +6567,7 @@ ${content}`
6567
6567
  }
6568
6568
  });
6569
6569
 
6570
- // packages/execution/dist/tools/transcribe-tool.js
6570
+ // ../packages/execution/dist/tools/transcribe-tool.js
6571
6571
  import { existsSync as existsSync13, mkdirSync as mkdirSync5, writeFileSync as writeFileSync5, readFileSync as readFileSync10, unlinkSync } from "node:fs";
6572
6572
  import { join as join16, basename as basename4, extname as extname3, resolve as resolve13 } from "node:path";
6573
6573
  import { homedir as homedir6 } from "node:os";
@@ -6598,8 +6598,8 @@ async function loadTranscribeCli() {
6598
6598
  const nvmBase = join16(homedir6(), ".nvm", "versions", "node");
6599
6599
  if (existsSync13(nvmBase)) {
6600
6600
  try {
6601
- const { readdirSync: readdirSync15 } = await import("node:fs");
6602
- for (const ver of readdirSync15(nvmBase)) {
6601
+ const { readdirSync: readdirSync16 } = await import("node:fs");
6602
+ for (const ver of readdirSync16(nvmBase)) {
6603
6603
  const tcPath = join16(nvmBase, ver, "lib", "node_modules", "transcribe-cli");
6604
6604
  if (existsSync13(join16(tcPath, "dist", "index.js"))) {
6605
6605
  const { createRequire: createRequire4 } = await import("node:module");
@@ -6620,7 +6620,7 @@ function formatTime(seconds) {
6620
6620
  }
6621
6621
  var AUDIO_EXTS, VIDEO_EXTS, _tcModule, _tcChecked, TranscribeFileTool, TranscribeUrlTool;
6622
6622
  var init_transcribe_tool = __esm({
6623
- "packages/execution/dist/tools/transcribe-tool.js"() {
6623
+ "../packages/execution/dist/tools/transcribe-tool.js"() {
6624
6624
  "use strict";
6625
6625
  AUDIO_EXTS = /* @__PURE__ */ new Set([
6626
6626
  ".mp3",
@@ -6861,7 +6861,7 @@ ${result.output}`,
6861
6861
  }
6862
6862
  });
6863
6863
 
6864
- // packages/execution/dist/tools/structured-file.js
6864
+ // ../packages/execution/dist/tools/structured-file.js
6865
6865
  import { writeFile as writeFile6, mkdir as mkdir3 } from "node:fs/promises";
6866
6866
  import { resolve as resolve14, dirname as dirname5, extname as extname4 } from "node:path";
6867
6867
  function jsonToCSV(data, separator = ",") {
@@ -6898,7 +6898,7 @@ function jsonToMarkdownTable(data) {
6898
6898
  }
6899
6899
  var StructuredFileTool;
6900
6900
  var init_structured_file = __esm({
6901
- "packages/execution/dist/tools/structured-file.js"() {
6901
+ "../packages/execution/dist/tools/structured-file.js"() {
6902
6902
  "use strict";
6903
6903
  StructuredFileTool = class {
6904
6904
  name = "create_structured_file";
@@ -7041,7 +7041,7 @@ var init_structured_file = __esm({
7041
7041
  }
7042
7042
  });
7043
7043
 
7044
- // packages/execution/dist/tools/code-sandbox.js
7044
+ // ../packages/execution/dist/tools/code-sandbox.js
7045
7045
  import { spawn as spawn5 } from "node:child_process";
7046
7046
  import { writeFile as writeFile7, mkdtemp, rm, readdir as readdir2, stat } from "node:fs/promises";
7047
7047
  import { join as join17 } from "node:path";
@@ -7122,7 +7122,7 @@ async function listCreatedFiles(dir) {
7122
7122
  }
7123
7123
  var LANGUAGE_CONFIG, CodeSandboxTool;
7124
7124
  var init_code_sandbox = __esm({
7125
- "packages/execution/dist/tools/code-sandbox.js"() {
7125
+ "../packages/execution/dist/tools/code-sandbox.js"() {
7126
7126
  "use strict";
7127
7127
  LANGUAGE_CONFIG = {
7128
7128
  javascript: { ext: ".js", cmd: "node", args: (f) => [f] },
@@ -7294,7 +7294,7 @@ ${result.filesCreated.join("\n")}`);
7294
7294
  }
7295
7295
  });
7296
7296
 
7297
- // packages/execution/dist/tools/structured-read.js
7297
+ // ../packages/execution/dist/tools/structured-read.js
7298
7298
  import { readFile as readFile8, stat as stat2 } from "node:fs/promises";
7299
7299
  import { resolve as resolve15, extname as extname5 } from "node:path";
7300
7300
  function parseCSV(text, separator = ",") {
@@ -7402,7 +7402,7 @@ function detectBinaryFormat(buffer) {
7402
7402
  }
7403
7403
  var StructuredReadTool;
7404
7404
  var init_structured_read = __esm({
7405
- "packages/execution/dist/tools/structured-read.js"() {
7405
+ "../packages/execution/dist/tools/structured-read.js"() {
7406
7406
  "use strict";
7407
7407
  StructuredReadTool = class {
7408
7408
  name = "read_structured_file";
@@ -7629,7 +7629,7 @@ ${parts.join("\n\n")}`,
7629
7629
  }
7630
7630
  });
7631
7631
 
7632
- // packages/execution/dist/tools/vision.js
7632
+ // ../packages/execution/dist/tools/vision.js
7633
7633
  import { readFileSync as readFileSync11, existsSync as existsSync14, statSync as statSync5 } from "node:fs";
7634
7634
  import { execSync as execSync11, spawn as spawn6 } from "node:child_process";
7635
7635
  import { resolve as resolve16, extname as extname6, basename as basename5, dirname as dirname6, join as join18 } from "node:path";
@@ -7776,7 +7776,7 @@ function loadImageBuffer(workingDir, rawPath) {
7776
7776
  }
7777
7777
  var moondreamClient, moondreamError, stationProcess, IMAGE_EXTENSIONS2, VisionTool;
7778
7778
  var init_vision = __esm({
7779
- "packages/execution/dist/tools/vision.js"() {
7779
+ "../packages/execution/dist/tools/vision.js"() {
7780
7780
  "use strict";
7781
7781
  moondreamClient = null;
7782
7782
  moondreamError = null;
@@ -7999,7 +7999,7 @@ ${response}`, durationMs: performance.now() - start };
7999
7999
  }
8000
8000
  });
8001
8001
 
8002
- // packages/execution/dist/tools/desktop-click.js
8002
+ // ../packages/execution/dist/tools/desktop-click.js
8003
8003
  import { readFileSync as readFileSync12, existsSync as existsSync15 } from "node:fs";
8004
8004
  import { execSync as execSync12 } from "node:child_process";
8005
8005
  import { tmpdir as tmpdir3 } from "node:os";
@@ -8152,7 +8152,7 @@ for i in range(${clicks}):
8152
8152
  }
8153
8153
  var __dirname2, DesktopClickTool, DesktopDescribeTool;
8154
8154
  var init_desktop_click = __esm({
8155
- "packages/execution/dist/tools/desktop-click.js"() {
8155
+ "../packages/execution/dist/tools/desktop-click.js"() {
8156
8156
  "use strict";
8157
8157
  init_system_deps();
8158
8158
  __dirname2 = dirname7(fileURLToPath3(import.meta.url));
@@ -8508,13 +8508,13 @@ Screen: ${dims.width}x${dims.height}`);
8508
8508
  }
8509
8509
  });
8510
8510
 
8511
- // packages/execution/dist/tools/ocr-pdf.js
8511
+ // ../packages/execution/dist/tools/ocr-pdf.js
8512
8512
  import { existsSync as existsSync16, statSync as statSync6 } from "node:fs";
8513
8513
  import { resolve as resolve17, basename as basename6 } from "node:path";
8514
8514
  import { execSync as execSync13 } from "node:child_process";
8515
8515
  var OcrPdfTool;
8516
8516
  var init_ocr_pdf = __esm({
8517
- "packages/execution/dist/tools/ocr-pdf.js"() {
8517
+ "../packages/execution/dist/tools/ocr-pdf.js"() {
8518
8518
  "use strict";
8519
8519
  init_system_deps();
8520
8520
  OcrPdfTool = class {
@@ -8631,14 +8631,14 @@ Language: ${language}
8631
8631
  }
8632
8632
  });
8633
8633
 
8634
- // packages/execution/dist/tools/pdf-to-text.js
8634
+ // ../packages/execution/dist/tools/pdf-to-text.js
8635
8635
  import { existsSync as existsSync17, statSync as statSync7, readFileSync as readFileSync13, unlinkSync as unlinkSync2 } from "node:fs";
8636
8636
  import { resolve as resolve18, basename as basename7, join as join20 } from "node:path";
8637
8637
  import { execSync as execSync14 } from "node:child_process";
8638
8638
  import { tmpdir as tmpdir4 } from "node:os";
8639
8639
  var PdfToTextTool;
8640
8640
  var init_pdf_to_text = __esm({
8641
- "packages/execution/dist/tools/pdf-to-text.js"() {
8641
+ "../packages/execution/dist/tools/pdf-to-text.js"() {
8642
8642
  "use strict";
8643
8643
  init_system_deps();
8644
8644
  PdfToTextTool = class {
@@ -8816,7 +8816,7 @@ ${text}`,
8816
8816
  }
8817
8817
  });
8818
8818
 
8819
- // packages/execution/dist/tools/ocr-image-advanced.js
8819
+ // ../packages/execution/dist/tools/ocr-image-advanced.js
8820
8820
  import { existsSync as existsSync18, statSync as statSync8 } from "node:fs";
8821
8821
  import { resolve as resolve19, basename as basename8, dirname as dirname8, join as join21 } from "node:path";
8822
8822
  import { execSync as execSync15 } from "node:child_process";
@@ -8859,7 +8859,7 @@ function findPython() {
8859
8859
  }
8860
8860
  var OcrImageAdvancedTool;
8861
8861
  var init_ocr_image_advanced = __esm({
8862
- "packages/execution/dist/tools/ocr-image-advanced.js"() {
8862
+ "../packages/execution/dist/tools/ocr-image-advanced.js"() {
8863
8863
  "use strict";
8864
8864
  init_system_deps();
8865
8865
  OcrImageAdvancedTool = class {
@@ -9119,7 +9119,7 @@ Note: Advanced Python pipeline not available \u2014 install pytesseract, opencv-
9119
9119
  }
9120
9120
  });
9121
9121
 
9122
- // packages/execution/dist/tools/browser-action.js
9122
+ // ../packages/execution/dist/tools/browser-action.js
9123
9123
  import { execSync as execSync16, spawn as spawn7 } from "node:child_process";
9124
9124
  import { existsSync as existsSync19, readFileSync as readFileSync14 } from "node:fs";
9125
9125
  import { join as join22, dirname as dirname9 } from "node:path";
@@ -9211,7 +9211,7 @@ async function apiCall(endpoint, method = "POST", body) {
9211
9211
  }
9212
9212
  var __dirname3, SCRAPE_SCRIPT, DEFAULT_PORT, BASE_URL, serviceProcess, activeSessionId, BrowserActionTool;
9213
9213
  var init_browser_action = __esm({
9214
- "packages/execution/dist/tools/browser-action.js"() {
9214
+ "../packages/execution/dist/tools/browser-action.js"() {
9215
9215
  "use strict";
9216
9216
  __dirname3 = dirname9(fileURLToPath5(import.meta.url));
9217
9217
  SCRAPE_SCRIPT = join22(__dirname3, "..", "..", "scripts", "web_scrape.py");
@@ -9372,7 +9372,7 @@ var init_browser_action = __esm({
9372
9372
  }
9373
9373
  });
9374
9374
 
9375
- // packages/execution/dist/tools/autoresearch.js
9375
+ // ../packages/execution/dist/tools/autoresearch.js
9376
9376
  import { execSync as execSync17, spawn as spawn8 } from "node:child_process";
9377
9377
  import { existsSync as existsSync20, readFileSync as readFileSync15, writeFileSync as writeFileSync6, mkdirSync as mkdirSync6, appendFileSync, copyFileSync } from "node:fs";
9378
9378
  import { join as join23, resolve as resolve20, dirname as dirname10 } from "node:path";
@@ -9415,7 +9415,7 @@ function parseRunLog(logContent) {
9415
9415
  }
9416
9416
  var AutoresearchTool;
9417
9417
  var init_autoresearch = __esm({
9418
- "packages/execution/dist/tools/autoresearch.js"() {
9418
+ "../packages/execution/dist/tools/autoresearch.js"() {
9419
9419
  "use strict";
9420
9420
  AutoresearchTool = class {
9421
9421
  repoRoot;
@@ -9892,7 +9892,7 @@ train.py reverted to last kept state. Ready for next experiment.`,
9892
9892
  }
9893
9893
  });
9894
9894
 
9895
- // packages/execution/dist/tools/scheduler.js
9895
+ // ../packages/execution/dist/tools/scheduler.js
9896
9896
  import { execSync as execSync18, exec as execCb } from "node:child_process";
9897
9897
  import { readFile as readFile9, writeFile as writeFile8, mkdir as mkdir4 } from "node:fs/promises";
9898
9898
  import { resolve as resolve21, join as join24 } from "node:path";
@@ -10027,7 +10027,7 @@ async function saveStore(workingDir, store) {
10027
10027
  }
10028
10028
  var SCHEDULE_PRESETS, CRON_MARKER, SchedulerTool;
10029
10029
  var init_scheduler = __esm({
10030
- "packages/execution/dist/tools/scheduler.js"() {
10030
+ "../packages/execution/dist/tools/scheduler.js"() {
10031
10031
  "use strict";
10032
10032
  SCHEDULE_PRESETS = {
10033
10033
  "every minute": "* * * * *",
@@ -10255,7 +10255,7 @@ ${truncated}`, durationMs: performance.now() - start };
10255
10255
  }
10256
10256
  });
10257
10257
 
10258
- // packages/execution/dist/tools/reminder.js
10258
+ // ../packages/execution/dist/tools/reminder.js
10259
10259
  import { readFile as readFile10, writeFile as writeFile9, mkdir as mkdir5 } from "node:fs/promises";
10260
10260
  import { resolve as resolve22, join as join25 } from "node:path";
10261
10261
  import { randomBytes as randomBytes3 } from "node:crypto";
@@ -10349,7 +10349,7 @@ async function markRemindersSeen(workingDir, ids) {
10349
10349
  }
10350
10350
  var STORE_FILE, ReminderTool;
10351
10351
  var init_reminder = __esm({
10352
- "packages/execution/dist/tools/reminder.js"() {
10352
+ "../packages/execution/dist/tools/reminder.js"() {
10353
10353
  "use strict";
10354
10354
  STORE_FILE = "reminders.json";
10355
10355
  ReminderTool = class {
@@ -10568,7 +10568,7 @@ var init_reminder = __esm({
10568
10568
  }
10569
10569
  });
10570
10570
 
10571
- // packages/execution/dist/tools/agenda.js
10571
+ // ../packages/execution/dist/tools/agenda.js
10572
10572
  import { readFile as readFile11, writeFile as writeFile10, mkdir as mkdir6 } from "node:fs/promises";
10573
10573
  import { resolve as resolve23, join as join26 } from "node:path";
10574
10574
  import { randomBytes as randomBytes4 } from "node:crypto";
@@ -10603,7 +10603,7 @@ async function getActiveAttentionItems(workingDir) {
10603
10603
  }
10604
10604
  var AgendaTool;
10605
10605
  var init_agenda = __esm({
10606
- "packages/execution/dist/tools/agenda.js"() {
10606
+ "../packages/execution/dist/tools/agenda.js"() {
10607
10607
  "use strict";
10608
10608
  init_reminder();
10609
10609
  AgendaTool = class {
@@ -10892,7 +10892,7 @@ ${sections.join("\n")}`,
10892
10892
  }
10893
10893
  });
10894
10894
 
10895
- // packages/execution/dist/tools/opencode.js
10895
+ // ../packages/execution/dist/tools/opencode.js
10896
10896
  import { execSync as execSync19, spawn as spawn9 } from "node:child_process";
10897
10897
  import { existsSync as existsSync21 } from "node:fs";
10898
10898
  import { join as join27, resolve as resolve24 } from "node:path";
@@ -10953,7 +10953,7 @@ function installOpencode() {
10953
10953
  }
10954
10954
  var OpenCodeTool;
10955
10955
  var init_opencode = __esm({
10956
- "packages/execution/dist/tools/opencode.js"() {
10956
+ "../packages/execution/dist/tools/opencode.js"() {
10957
10957
  "use strict";
10958
10958
  OpenCodeTool = class {
10959
10959
  name = "opencode";
@@ -11166,7 +11166,7 @@ var init_opencode = __esm({
11166
11166
  }
11167
11167
  });
11168
11168
 
11169
- // packages/execution/dist/tools/factory.js
11169
+ // ../packages/execution/dist/tools/factory.js
11170
11170
  import { execSync as execSync20, spawn as spawn10 } from "node:child_process";
11171
11171
  import { existsSync as existsSync22 } from "node:fs";
11172
11172
  import { join as join28 } from "node:path";
@@ -11227,7 +11227,7 @@ function installDroid() {
11227
11227
  }
11228
11228
  var FactoryTool;
11229
11229
  var init_factory = __esm({
11230
- "packages/execution/dist/tools/factory.js"() {
11230
+ "../packages/execution/dist/tools/factory.js"() {
11231
11231
  "use strict";
11232
11232
  FactoryTool = class {
11233
11233
  name = "factory";
@@ -11475,7 +11475,7 @@ var init_factory = __esm({
11475
11475
  }
11476
11476
  });
11477
11477
 
11478
- // packages/execution/dist/tools/cron-agent.js
11478
+ // ../packages/execution/dist/tools/cron-agent.js
11479
11479
  import { execSync as execSync21 } from "node:child_process";
11480
11480
  import { readFile as readFile12, writeFile as writeFile11, mkdir as mkdir7 } from "node:fs/promises";
11481
11481
  import { resolve as resolve25, join as join29 } from "node:path";
@@ -11609,7 +11609,7 @@ async function saveStore2(workingDir, store) {
11609
11609
  }
11610
11610
  var LONG_HORIZON_PRESETS, CRON_AGENT_MARKER, CronAgentTool;
11611
11611
  var init_cron_agent = __esm({
11612
- "packages/execution/dist/tools/cron-agent.js"() {
11612
+ "../packages/execution/dist/tools/cron-agent.js"() {
11613
11613
  "use strict";
11614
11614
  LONG_HORIZON_PRESETS = {
11615
11615
  "every hour": "0 * * * *",
@@ -11940,7 +11940,7 @@ ${truncated}`, durationMs: performance.now() - start };
11940
11940
  }
11941
11941
  });
11942
11942
 
11943
- // packages/execution/dist/tools/nexus.js
11943
+ // ../packages/execution/dist/tools/nexus.js
11944
11944
  import { readFile as readFile13, writeFile as writeFile12, mkdir as mkdir8, chmod, unlink, readdir as readdir3, open as fsOpen } from "node:fs/promises";
11945
11945
  import { existsSync as existsSync23, readFileSync as readFileSync16 } from "node:fs";
11946
11946
  import { resolve as resolve26, join as join30 } from "node:path";
@@ -11956,7 +11956,7 @@ function containsKeyMaterial(input) {
11956
11956
  }
11957
11957
  var DAEMON_SCRIPT, KEY_PATTERNS, NexusTool;
11958
11958
  var init_nexus = __esm({
11959
- "packages/execution/dist/tools/nexus.js"() {
11959
+ "../packages/execution/dist/tools/nexus.js"() {
11960
11960
  "use strict";
11961
11961
  DAEMON_SCRIPT = `#!/usr/bin/env node
11962
11962
  /**
@@ -13062,7 +13062,7 @@ process.on('SIGINT', () => process.emit('SIGTERM'));
13062
13062
  result = await this.sendDaemonCmd("room_members", args);
13063
13063
  break;
13064
13064
  case "expose":
13065
- result = await this.sendDaemonCmd("expose", args, 3e4);
13065
+ result = await this.sendDaemonCmd("expose", args, 6e4);
13066
13066
  break;
13067
13067
  case "pricing_menu":
13068
13068
  result = await this.sendDaemonCmd("pricing_menu", args);
@@ -14064,71 +14064,71 @@ process.on('SIGINT', () => process.emit('SIGTERM'));
14064
14064
  }
14065
14065
  });
14066
14066
 
14067
- // packages/execution/dist/shellRunner.js
14067
+ // ../packages/execution/dist/shellRunner.js
14068
14068
  var init_shellRunner = __esm({
14069
- "packages/execution/dist/shellRunner.js"() {
14069
+ "../packages/execution/dist/shellRunner.js"() {
14070
14070
  "use strict";
14071
14071
  }
14072
14072
  });
14073
14073
 
14074
- // packages/execution/dist/gitWorktree.js
14074
+ // ../packages/execution/dist/gitWorktree.js
14075
14075
  var init_gitWorktree = __esm({
14076
- "packages/execution/dist/gitWorktree.js"() {
14076
+ "../packages/execution/dist/gitWorktree.js"() {
14077
14077
  "use strict";
14078
14078
  init_shellRunner();
14079
14079
  }
14080
14080
  });
14081
14081
 
14082
- // packages/execution/dist/patchApplier.js
14082
+ // ../packages/execution/dist/patchApplier.js
14083
14083
  var init_patchApplier = __esm({
14084
- "packages/execution/dist/patchApplier.js"() {
14084
+ "../packages/execution/dist/patchApplier.js"() {
14085
14085
  "use strict";
14086
14086
  }
14087
14087
  });
14088
14088
 
14089
- // packages/execution/dist/formatterRunner.js
14089
+ // ../packages/execution/dist/formatterRunner.js
14090
14090
  var init_formatterRunner = __esm({
14091
- "packages/execution/dist/formatterRunner.js"() {
14091
+ "../packages/execution/dist/formatterRunner.js"() {
14092
14092
  "use strict";
14093
14093
  init_shellRunner();
14094
14094
  }
14095
14095
  });
14096
14096
 
14097
- // packages/execution/dist/linterRunner.js
14097
+ // ../packages/execution/dist/linterRunner.js
14098
14098
  var init_linterRunner = __esm({
14099
- "packages/execution/dist/linterRunner.js"() {
14099
+ "../packages/execution/dist/linterRunner.js"() {
14100
14100
  "use strict";
14101
14101
  init_shellRunner();
14102
14102
  }
14103
14103
  });
14104
14104
 
14105
- // packages/execution/dist/typecheckRunner.js
14105
+ // ../packages/execution/dist/typecheckRunner.js
14106
14106
  var init_typecheckRunner = __esm({
14107
- "packages/execution/dist/typecheckRunner.js"() {
14107
+ "../packages/execution/dist/typecheckRunner.js"() {
14108
14108
  "use strict";
14109
14109
  init_shellRunner();
14110
14110
  }
14111
14111
  });
14112
14112
 
14113
- // packages/execution/dist/testRunner.js
14113
+ // ../packages/execution/dist/testRunner.js
14114
14114
  var init_testRunner = __esm({
14115
- "packages/execution/dist/testRunner.js"() {
14115
+ "../packages/execution/dist/testRunner.js"() {
14116
14116
  "use strict";
14117
14117
  init_shellRunner();
14118
14118
  }
14119
14119
  });
14120
14120
 
14121
- // packages/execution/dist/buildRunner.js
14121
+ // ../packages/execution/dist/buildRunner.js
14122
14122
  var init_buildRunner = __esm({
14123
- "packages/execution/dist/buildRunner.js"() {
14123
+ "../packages/execution/dist/buildRunner.js"() {
14124
14124
  "use strict";
14125
14125
  init_shellRunner();
14126
14126
  }
14127
14127
  });
14128
14128
 
14129
- // packages/execution/dist/validationPipeline.js
14129
+ // ../packages/execution/dist/validationPipeline.js
14130
14130
  var init_validationPipeline = __esm({
14131
- "packages/execution/dist/validationPipeline.js"() {
14131
+ "../packages/execution/dist/validationPipeline.js"() {
14132
14132
  "use strict";
14133
14133
  init_formatterRunner();
14134
14134
  init_linterRunner();
@@ -14138,9 +14138,9 @@ var init_validationPipeline = __esm({
14138
14138
  }
14139
14139
  });
14140
14140
 
14141
- // packages/execution/dist/index.js
14141
+ // ../packages/execution/dist/index.js
14142
14142
  var init_dist2 = __esm({
14143
- "packages/execution/dist/index.js"() {
14143
+ "../packages/execution/dist/index.js"() {
14144
14144
  "use strict";
14145
14145
  init_tool_executor();
14146
14146
  init_shell();
@@ -14202,9 +14202,9 @@ var init_dist2 = __esm({
14202
14202
  }
14203
14203
  });
14204
14204
 
14205
- // packages/orchestrator/dist/agent-loop.js
14205
+ // ../packages/orchestrator/dist/agent-loop.js
14206
14206
  var init_agent_loop = __esm({
14207
- "packages/orchestrator/dist/agent-loop.js"() {
14207
+ "../packages/orchestrator/dist/agent-loop.js"() {
14208
14208
  "use strict";
14209
14209
  init_dist();
14210
14210
  init_dist2();
@@ -14212,11 +14212,11 @@ var init_agent_loop = __esm({
14212
14212
  }
14213
14213
  });
14214
14214
 
14215
- // packages/schemas/dist/messages.js
14215
+ // ../packages/schemas/dist/messages.js
14216
14216
  import { z } from "zod";
14217
14217
  var AgentMessageSchema;
14218
14218
  var init_messages = __esm({
14219
- "packages/schemas/dist/messages.js"() {
14219
+ "../packages/schemas/dist/messages.js"() {
14220
14220
  "use strict";
14221
14221
  AgentMessageSchema = z.object({
14222
14222
  id: z.string().uuid(),
@@ -14229,11 +14229,11 @@ var init_messages = __esm({
14229
14229
  }
14230
14230
  });
14231
14231
 
14232
- // packages/schemas/dist/tools.js
14232
+ // ../packages/schemas/dist/tools.js
14233
14233
  import { z as z2 } from "zod";
14234
14234
  var ToolCallSchema;
14235
14235
  var init_tools = __esm({
14236
- "packages/schemas/dist/tools.js"() {
14236
+ "../packages/schemas/dist/tools.js"() {
14237
14237
  "use strict";
14238
14238
  ToolCallSchema = z2.object({
14239
14239
  id: z2.string().uuid(),
@@ -14247,11 +14247,11 @@ var init_tools = __esm({
14247
14247
  }
14248
14248
  });
14249
14249
 
14250
- // packages/schemas/dist/session.js
14250
+ // ../packages/schemas/dist/session.js
14251
14251
  import { z as z3 } from "zod";
14252
14252
  var SessionSchema;
14253
14253
  var init_session = __esm({
14254
- "packages/schemas/dist/session.js"() {
14254
+ "../packages/schemas/dist/session.js"() {
14255
14255
  "use strict";
14256
14256
  SessionSchema = z3.object({
14257
14257
  id: z3.string().uuid(),
@@ -14265,11 +14265,11 @@ var init_session = __esm({
14265
14265
  }
14266
14266
  });
14267
14267
 
14268
- // packages/schemas/dist/task.js
14268
+ // ../packages/schemas/dist/task.js
14269
14269
  import { z as z4 } from "zod";
14270
14270
  var TaskClassSchema, UrgencySchema, NormalizedTaskSchema, TaskStatusSchema;
14271
14271
  var init_task = __esm({
14272
- "packages/schemas/dist/task.js"() {
14272
+ "../packages/schemas/dist/task.js"() {
14273
14273
  "use strict";
14274
14274
  TaskClassSchema = z4.enum([
14275
14275
  "bugfix",
@@ -14314,11 +14314,11 @@ var init_task = __esm({
14314
14314
  }
14315
14315
  });
14316
14316
 
14317
- // packages/schemas/dist/plan.js
14317
+ // ../packages/schemas/dist/plan.js
14318
14318
  import { z as z5 } from "zod";
14319
14319
  var SubtaskKindSchema, SubtaskSchema, PlanSchema;
14320
14320
  var init_plan = __esm({
14321
- "packages/schemas/dist/plan.js"() {
14321
+ "../packages/schemas/dist/plan.js"() {
14322
14322
  "use strict";
14323
14323
  SubtaskKindSchema = z5.enum([
14324
14324
  "inspect",
@@ -14352,11 +14352,11 @@ var init_plan = __esm({
14352
14352
  }
14353
14353
  });
14354
14354
 
14355
- // packages/schemas/dist/patch.js
14355
+ // ../packages/schemas/dist/patch.js
14356
14356
  import { z as z6 } from "zod";
14357
14357
  var EditOperationSchema, FileEditSchema, NeedsMoreContextSchema, PatchProposalSchema;
14358
14358
  var init_patch = __esm({
14359
- "packages/schemas/dist/patch.js"() {
14359
+ "../packages/schemas/dist/patch.js"() {
14360
14360
  "use strict";
14361
14361
  EditOperationSchema = z6.enum([
14362
14362
  "diff",
@@ -14395,11 +14395,11 @@ var init_patch = __esm({
14395
14395
  }
14396
14396
  });
14397
14397
 
14398
- // packages/schemas/dist/verification.js
14398
+ // ../packages/schemas/dist/verification.js
14399
14399
  import { z as z7 } from "zod";
14400
14400
  var VerificationStatusSchema, VerificationNextActionSchema, VerificationDecisionSchema;
14401
14401
  var init_verification = __esm({
14402
- "packages/schemas/dist/verification.js"() {
14402
+ "../packages/schemas/dist/verification.js"() {
14403
14403
  "use strict";
14404
14404
  VerificationStatusSchema = z7.enum(["pass", "fail", "partial"]);
14405
14405
  VerificationNextActionSchema = z7.enum([
@@ -14424,11 +14424,11 @@ var init_verification = __esm({
14424
14424
  }
14425
14425
  });
14426
14426
 
14427
- // packages/schemas/dist/repoProfile.js
14427
+ // ../packages/schemas/dist/repoProfile.js
14428
14428
  import { z as z8 } from "zod";
14429
14429
  var LanguageSchema, PackageManagerSchema, BuildSystemSchema, MigrationSystemSchema, RepoProfileSchema;
14430
14430
  var init_repoProfile = __esm({
14431
- "packages/schemas/dist/repoProfile.js"() {
14431
+ "../packages/schemas/dist/repoProfile.js"() {
14432
14432
  "use strict";
14433
14433
  LanguageSchema = z8.enum([
14434
14434
  "typescript",
@@ -14506,11 +14506,11 @@ var init_repoProfile = __esm({
14506
14506
  }
14507
14507
  });
14508
14508
 
14509
- // packages/schemas/dist/retrieval.js
14509
+ // ../packages/schemas/dist/retrieval.js
14510
14510
  import { z as z9 } from "zod";
14511
14511
  var RetrievalRequestSchema, SnippetSchema, RetrievalPacketSchema;
14512
14512
  var init_retrieval = __esm({
14513
- "packages/schemas/dist/retrieval.js"() {
14513
+ "../packages/schemas/dist/retrieval.js"() {
14514
14514
  "use strict";
14515
14515
  RetrievalRequestSchema = z9.object({
14516
14516
  /** Natural language description of what information is needed */
@@ -14558,11 +14558,11 @@ var init_retrieval = __esm({
14558
14558
  }
14559
14559
  });
14560
14560
 
14561
- // packages/schemas/dist/dispatch.js
14561
+ // ../packages/schemas/dist/dispatch.js
14562
14562
  import { z as z10 } from "zod";
14563
14563
  var DispatchModeSchema, TaskComplexitySchema, AgentRoleSchema, BudgetsSchema, DispatchDecisionSchema;
14564
14564
  var init_dispatch = __esm({
14565
- "packages/schemas/dist/dispatch.js"() {
14565
+ "../packages/schemas/dist/dispatch.js"() {
14566
14566
  "use strict";
14567
14567
  DispatchModeSchema = z10.enum([
14568
14568
  "single_pass",
@@ -14596,11 +14596,11 @@ var init_dispatch = __esm({
14596
14596
  }
14597
14597
  });
14598
14598
 
14599
- // packages/schemas/dist/memory.js
14599
+ // ../packages/schemas/dist/memory.js
14600
14600
  import { z as z11 } from "zod";
14601
14601
  var RiskLevelSchema, FileSummarySchema, FailureCategorySchema, FailureFingerprintSchema, TaskMemorySchema;
14602
14602
  var init_memory = __esm({
14603
- "packages/schemas/dist/memory.js"() {
14603
+ "../packages/schemas/dist/memory.js"() {
14604
14604
  "use strict";
14605
14605
  RiskLevelSchema = z11.enum(["low", "medium", "high", "critical"]);
14606
14606
  FileSummarySchema = z11.object({
@@ -14676,11 +14676,11 @@ var init_memory = __esm({
14676
14676
  }
14677
14677
  });
14678
14678
 
14679
- // packages/schemas/dist/backend.js
14679
+ // ../packages/schemas/dist/backend.js
14680
14680
  import { z as z12 } from "zod";
14681
14681
  var MessageRoleSchema, ChatMessageSchema, CompletionRequestSchema, TokenUsageSchema, CompletionResponseSchema, StructuredCompletionRequestSchema, BackendHealthSchema, BackendMetricsSchema;
14682
14682
  var init_backend = __esm({
14683
- "packages/schemas/dist/backend.js"() {
14683
+ "../packages/schemas/dist/backend.js"() {
14684
14684
  "use strict";
14685
14685
  MessageRoleSchema = z12.enum([
14686
14686
  "system",
@@ -14765,11 +14765,11 @@ var init_backend = __esm({
14765
14765
  }
14766
14766
  });
14767
14767
 
14768
- // packages/schemas/dist/config.js
14768
+ // ../packages/schemas/dist/config.js
14769
14769
  import { z as z13 } from "zod";
14770
14770
  var AgentConfigSchema;
14771
14771
  var init_config2 = __esm({
14772
- "packages/schemas/dist/config.js"() {
14772
+ "../packages/schemas/dist/config.js"() {
14773
14773
  "use strict";
14774
14774
  AgentConfigSchema = z13.object({
14775
14775
  // -----------------------------------------------------------------------
@@ -14828,11 +14828,11 @@ var init_config2 = __esm({
14828
14828
  }
14829
14829
  });
14830
14830
 
14831
- // packages/schemas/dist/queue.js
14831
+ // ../packages/schemas/dist/queue.js
14832
14832
  import { z as z14 } from "zod";
14833
14833
  var QueueClassSchema;
14834
14834
  var init_queue = __esm({
14835
- "packages/schemas/dist/queue.js"() {
14835
+ "../packages/schemas/dist/queue.js"() {
14836
14836
  "use strict";
14837
14837
  QueueClassSchema = z14.enum([
14838
14838
  /** CLI and direct user-facing requests; lowest latency target */
@@ -14851,9 +14851,9 @@ var init_queue = __esm({
14851
14851
  }
14852
14852
  });
14853
14853
 
14854
- // packages/schemas/dist/index.js
14854
+ // ../packages/schemas/dist/index.js
14855
14855
  var init_dist3 = __esm({
14856
- "packages/schemas/dist/index.js"() {
14856
+ "../packages/schemas/dist/index.js"() {
14857
14857
  "use strict";
14858
14858
  init_messages();
14859
14859
  init_tools();
@@ -14872,7 +14872,7 @@ var init_dist3 = __esm({
14872
14872
  }
14873
14873
  });
14874
14874
 
14875
- // packages/orchestrator/dist/promptLoader.js
14875
+ // ../packages/orchestrator/dist/promptLoader.js
14876
14876
  import { readFileSync as readFileSync17, existsSync as existsSync24 } from "node:fs";
14877
14877
  import { join as join31, dirname as dirname11 } from "node:path";
14878
14878
  import { fileURLToPath as fileURLToPath7 } from "node:url";
@@ -14892,7 +14892,7 @@ function loadPrompt(promptPath, vars) {
14892
14892
  }
14893
14893
  var __filename, __dirname4, PROMPTS_DIR, cache;
14894
14894
  var init_promptLoader = __esm({
14895
- "packages/orchestrator/dist/promptLoader.js"() {
14895
+ "../packages/orchestrator/dist/promptLoader.js"() {
14896
14896
  "use strict";
14897
14897
  __filename = fileURLToPath7(import.meta.url);
14898
14898
  __dirname4 = dirname11(__filename);
@@ -14901,7 +14901,7 @@ var init_promptLoader = __esm({
14901
14901
  }
14902
14902
  });
14903
14903
 
14904
- // packages/orchestrator/dist/taskNormalizer.js
14904
+ // ../packages/orchestrator/dist/taskNormalizer.js
14905
14905
  function parseJsonFromContent(content) {
14906
14906
  const fencedMatch = content.match(/```(?:json)?\s*([\s\S]*?)```/);
14907
14907
  const raw = fencedMatch ? fencedMatch[1] : content;
@@ -14916,7 +14916,7 @@ function normalizationPrompt(rawRequest, repoRoot) {
14916
14916
  }
14917
14917
  var TaskNormalizer;
14918
14918
  var init_taskNormalizer = __esm({
14919
- "packages/orchestrator/dist/taskNormalizer.js"() {
14919
+ "../packages/orchestrator/dist/taskNormalizer.js"() {
14920
14920
  "use strict";
14921
14921
  init_dist3();
14922
14922
  init_promptLoader();
@@ -14968,7 +14968,7 @@ var init_taskNormalizer = __esm({
14968
14968
  }
14969
14969
  });
14970
14970
 
14971
- // packages/orchestrator/dist/dispatcher.js
14971
+ // ../packages/orchestrator/dist/dispatcher.js
14972
14972
  function estimateComplexity(task) {
14973
14973
  const text = `${task.goal} ${task.constraints.join(" ")} ${task.successCriteria.join(" ")}`;
14974
14974
  const wordCount = text.split(/\s+/).length;
@@ -15035,7 +15035,7 @@ function parseJsonFromContent2(content) {
15035
15035
  }
15036
15036
  var Dispatcher;
15037
15037
  var init_dispatcher = __esm({
15038
- "packages/orchestrator/dist/dispatcher.js"() {
15038
+ "../packages/orchestrator/dist/dispatcher.js"() {
15039
15039
  "use strict";
15040
15040
  init_dist3();
15041
15041
  init_promptLoader();
@@ -15095,7 +15095,7 @@ var init_dispatcher = __esm({
15095
15095
  }
15096
15096
  });
15097
15097
 
15098
- // packages/orchestrator/dist/plannerRunner.js
15098
+ // ../packages/orchestrator/dist/plannerRunner.js
15099
15099
  function plannerPrompt(task, repoProfile, retrievalPacket) {
15100
15100
  const profileSection = repoProfile ? `REPOSITORY PROFILE:
15101
15101
  ${JSON.stringify(repoProfile, null, 2)}` : "REPOSITORY PROFILE: (not available)";
@@ -15116,7 +15116,7 @@ function parseJsonFromContent3(content) {
15116
15116
  }
15117
15117
  var PlannerRunner;
15118
15118
  var init_plannerRunner = __esm({
15119
- "packages/orchestrator/dist/plannerRunner.js"() {
15119
+ "../packages/orchestrator/dist/plannerRunner.js"() {
15120
15120
  "use strict";
15121
15121
  init_dist3();
15122
15122
  init_promptLoader();
@@ -15169,12 +15169,12 @@ var init_plannerRunner = __esm({
15169
15169
  }
15170
15170
  });
15171
15171
 
15172
- // packages/retrieval/dist/grep-search.js
15172
+ // ../packages/retrieval/dist/grep-search.js
15173
15173
  import { execFile as execFile4 } from "node:child_process";
15174
15174
  import { promisify as promisify3 } from "node:util";
15175
15175
  var execFileAsync3, GrepSearch;
15176
15176
  var init_grep_search2 = __esm({
15177
- "packages/retrieval/dist/grep-search.js"() {
15177
+ "../packages/retrieval/dist/grep-search.js"() {
15178
15178
  "use strict";
15179
15179
  execFileAsync3 = promisify3(execFile4);
15180
15180
  GrepSearch = class {
@@ -15231,10 +15231,10 @@ var init_grep_search2 = __esm({
15231
15231
  }
15232
15232
  });
15233
15233
 
15234
- // packages/retrieval/dist/code-retriever.js
15234
+ // ../packages/retrieval/dist/code-retriever.js
15235
15235
  var DEFAULT_CONFIG2, CodeRetriever;
15236
15236
  var init_code_retriever = __esm({
15237
- "packages/retrieval/dist/code-retriever.js"() {
15237
+ "../packages/retrieval/dist/code-retriever.js"() {
15238
15238
  "use strict";
15239
15239
  init_grep_search2();
15240
15240
  DEFAULT_CONFIG2 = {
@@ -15272,7 +15272,7 @@ var init_code_retriever = __esm({
15272
15272
  }
15273
15273
  });
15274
15274
 
15275
- // packages/retrieval/dist/lexicalSearch.js
15275
+ // ../packages/retrieval/dist/lexicalSearch.js
15276
15276
  import { execFile as execFile5 } from "node:child_process";
15277
15277
  import { promisify as promisify4 } from "node:util";
15278
15278
  import { readFile as readFile14, readdir as readdir4, stat as stat3 } from "node:fs/promises";
@@ -15450,7 +15450,7 @@ function matchesGlob(filePath, glob2) {
15450
15450
  }
15451
15451
  var execFileAsync4, DEFAULT_INCLUDE_GLOBS, DEFAULT_EXCLUDE_GLOBS, DEFAULT_MAX_MATCHES, ALWAYS_SKIP, ALL_CODE_EXTS;
15452
15452
  var init_lexicalSearch = __esm({
15453
- "packages/retrieval/dist/lexicalSearch.js"() {
15453
+ "../packages/retrieval/dist/lexicalSearch.js"() {
15454
15454
  "use strict";
15455
15455
  execFileAsync4 = promisify4(execFile5);
15456
15456
  DEFAULT_INCLUDE_GLOBS = ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx", "**/*.py"];
@@ -15461,7 +15461,7 @@ var init_lexicalSearch = __esm({
15461
15461
  }
15462
15462
  });
15463
15463
 
15464
- // packages/retrieval/dist/semanticSearch.js
15464
+ // ../packages/retrieval/dist/semanticSearch.js
15465
15465
  function parseTagFilter(query) {
15466
15466
  const required = [];
15467
15467
  const anyOf = [];
@@ -15538,7 +15538,7 @@ function makePlaceholderSummary(filePath) {
15538
15538
  }
15539
15539
  var StubSemanticSearchEngine, IndexBackedSemanticSearchEngine, LazySemanticSearchEngine;
15540
15540
  var init_semanticSearch = __esm({
15541
- "packages/retrieval/dist/semanticSearch.js"() {
15541
+ "../packages/retrieval/dist/semanticSearch.js"() {
15542
15542
  "use strict";
15543
15543
  StubSemanticSearchEngine = class {
15544
15544
  isAvailable = false;
@@ -15658,7 +15658,7 @@ var init_semanticSearch = __esm({
15658
15658
  }
15659
15659
  });
15660
15660
 
15661
- // packages/retrieval/dist/graphExpand.js
15661
+ // ../packages/retrieval/dist/graphExpand.js
15662
15662
  function expandGraph(seeds, graph, opts = {}) {
15663
15663
  const { direction = "both", maxHops = 1, maxNeighbors = 20, includeSeeds = false } = opts;
15664
15664
  const seedSet = new Set(seeds);
@@ -15718,12 +15718,12 @@ function bfsExpand(seeds, adjacency, maxHops, maxNeighbors, excludeSet, result)
15718
15718
  }
15719
15719
  }
15720
15720
  var init_graphExpand = __esm({
15721
- "packages/retrieval/dist/graphExpand.js"() {
15721
+ "../packages/retrieval/dist/graphExpand.js"() {
15722
15722
  "use strict";
15723
15723
  }
15724
15724
  });
15725
15725
 
15726
- // packages/retrieval/dist/snippetPacker.js
15726
+ // ../packages/retrieval/dist/snippetPacker.js
15727
15727
  import { readFile as readFile15 } from "node:fs/promises";
15728
15728
  import { join as join33 } from "node:path";
15729
15729
  async function packSnippets(requests, opts = {}) {
@@ -15786,7 +15786,7 @@ async function packFiles(filePaths, repoRoot, maxTokens = DEFAULT_MAX_TOKENS) {
15786
15786
  }
15787
15787
  var DEFAULT_MAX_TOKENS, DEFAULT_CONTEXT_LINES, CHARS_PER_TOKEN;
15788
15788
  var init_snippetPacker = __esm({
15789
- "packages/retrieval/dist/snippetPacker.js"() {
15789
+ "../packages/retrieval/dist/snippetPacker.js"() {
15790
15790
  "use strict";
15791
15791
  DEFAULT_MAX_TOKENS = 32e3;
15792
15792
  DEFAULT_CONTEXT_LINES = 2;
@@ -15794,7 +15794,7 @@ var init_snippetPacker = __esm({
15794
15794
  }
15795
15795
  });
15796
15796
 
15797
- // packages/retrieval/dist/contextAssembler.js
15797
+ // ../packages/retrieval/dist/contextAssembler.js
15798
15798
  async function assembleContext(request, opts) {
15799
15799
  const { repoRoot, graph, semanticEngine, summaryMap, maxFiles = 8, maxSnippets = 20, maxLogs = 3, maxTokens = 24e3, expandNeighbors = true, architectureNote, priorAttemptNote } = opts;
15800
15800
  const lexOpts = {
@@ -15950,7 +15950,7 @@ function estimatePacketTokens(packet) {
15950
15950
  return fileTokens + snippetTokens;
15951
15951
  }
15952
15952
  var init_contextAssembler = __esm({
15953
- "packages/retrieval/dist/contextAssembler.js"() {
15953
+ "../packages/retrieval/dist/contextAssembler.js"() {
15954
15954
  "use strict";
15955
15955
  init_lexicalSearch();
15956
15956
  init_graphExpand();
@@ -15958,7 +15958,7 @@ var init_contextAssembler = __esm({
15958
15958
  }
15959
15959
  });
15960
15960
 
15961
- // packages/retrieval/dist/index.js
15961
+ // ../packages/retrieval/dist/index.js
15962
15962
  var dist_exports = {};
15963
15963
  __export(dist_exports, {
15964
15964
  CodeRetriever: () => CodeRetriever,
@@ -15983,7 +15983,7 @@ __export(dist_exports, {
15983
15983
  testsForFiles: () => testsForFiles
15984
15984
  });
15985
15985
  var init_dist4 = __esm({
15986
- "packages/retrieval/dist/index.js"() {
15986
+ "../packages/retrieval/dist/index.js"() {
15987
15987
  "use strict";
15988
15988
  init_code_retriever();
15989
15989
  init_grep_search2();
@@ -15995,7 +15995,7 @@ var init_dist4 = __esm({
15995
15995
  }
15996
15996
  });
15997
15997
 
15998
- // packages/orchestrator/dist/scoutRunner.js
15998
+ // ../packages/orchestrator/dist/scoutRunner.js
15999
15999
  async function loadCodeRetriever(rootDir) {
16000
16000
  const mod = await Promise.resolve().then(() => (init_dist4(), dist_exports));
16001
16001
  return new mod.CodeRetriever({ rootDir });
@@ -16026,7 +16026,7 @@ function scoutPrompt(task, repoProfile, candidateFiles, subtasks) {
16026
16026
  }
16027
16027
  var ScoutRunner;
16028
16028
  var init_scoutRunner = __esm({
16029
- "packages/orchestrator/dist/scoutRunner.js"() {
16029
+ "../packages/orchestrator/dist/scoutRunner.js"() {
16030
16030
  "use strict";
16031
16031
  init_dist3();
16032
16032
  init_promptLoader();
@@ -16132,7 +16132,7 @@ var init_scoutRunner = __esm({
16132
16132
  }
16133
16133
  });
16134
16134
 
16135
- // packages/orchestrator/dist/editorRunner.js
16135
+ // ../packages/orchestrator/dist/editorRunner.js
16136
16136
  function editorPrompt(task, subtask, retrievalPacket, previousVerification, retryNumber) {
16137
16137
  const filesSection = Object.entries(retrievalPacket.files).map(([path, content]) => `=== ${path} ===
16138
16138
  ${content}`).join("\n\n");
@@ -16160,7 +16160,7 @@ function parseJsonFromContent5(content) {
16160
16160
  }
16161
16161
  var EditorRunner;
16162
16162
  var init_editorRunner = __esm({
16163
- "packages/orchestrator/dist/editorRunner.js"() {
16163
+ "../packages/orchestrator/dist/editorRunner.js"() {
16164
16164
  "use strict";
16165
16165
  init_dist3();
16166
16166
  init_promptLoader();
@@ -16218,7 +16218,7 @@ var init_editorRunner = __esm({
16218
16218
  }
16219
16219
  });
16220
16220
 
16221
- // packages/orchestrator/dist/verifierRunner.js
16221
+ // ../packages/orchestrator/dist/verifierRunner.js
16222
16222
  function verifierPrompt(task, subtask, patch, toolOutput) {
16223
16223
  const toolSection = toolOutput ? `TOOL EXECUTION OUTPUT:
16224
16224
  ${toolOutput}` : "TOOL EXECUTION OUTPUT: (not executed)";
@@ -16246,7 +16246,7 @@ function parseJsonFromContent6(content) {
16246
16246
  }
16247
16247
  var VerifierRunner;
16248
16248
  var init_verifierRunner = __esm({
16249
- "packages/orchestrator/dist/verifierRunner.js"() {
16249
+ "../packages/orchestrator/dist/verifierRunner.js"() {
16250
16250
  "use strict";
16251
16251
  init_dist3();
16252
16252
  init_promptLoader();
@@ -16341,10 +16341,10 @@ FAILED: ${execError.stderr ?? execError.stdout ?? execError.message ?? "unknown
16341
16341
  }
16342
16342
  });
16343
16343
 
16344
- // packages/orchestrator/dist/mergeRunner.js
16344
+ // ../packages/orchestrator/dist/mergeRunner.js
16345
16345
  var MergeRunner;
16346
16346
  var init_mergeRunner = __esm({
16347
- "packages/orchestrator/dist/mergeRunner.js"() {
16347
+ "../packages/orchestrator/dist/mergeRunner.js"() {
16348
16348
  "use strict";
16349
16349
  init_promptLoader();
16350
16350
  MergeRunner = class {
@@ -16429,10 +16429,10 @@ var init_mergeRunner = __esm({
16429
16429
  }
16430
16430
  });
16431
16431
 
16432
- // packages/orchestrator/dist/retryController.js
16432
+ // ../packages/orchestrator/dist/retryController.js
16433
16433
  var RetryController;
16434
16434
  var init_retryController = __esm({
16435
- "packages/orchestrator/dist/retryController.js"() {
16435
+ "../packages/orchestrator/dist/retryController.js"() {
16436
16436
  "use strict";
16437
16437
  RetryController = class {
16438
16438
  maxRetries;
@@ -16529,7 +16529,7 @@ var init_retryController = __esm({
16529
16529
  }
16530
16530
  });
16531
16531
 
16532
- // packages/orchestrator/dist/ralphLoop.js
16532
+ // ../packages/orchestrator/dist/ralphLoop.js
16533
16533
  function isoNow() {
16534
16534
  return (/* @__PURE__ */ new Date()).toISOString();
16535
16535
  }
@@ -16577,7 +16577,7 @@ function deriveTerminalStatus(executions) {
16577
16577
  }
16578
16578
  var RalphLoop;
16579
16579
  var init_ralphLoop = __esm({
16580
- "packages/orchestrator/dist/ralphLoop.js"() {
16580
+ "../packages/orchestrator/dist/ralphLoop.js"() {
16581
16581
  "use strict";
16582
16582
  init_taskNormalizer();
16583
16583
  init_dispatcher();
@@ -16860,7 +16860,7 @@ var init_ralphLoop = __esm({
16860
16860
  }
16861
16861
  });
16862
16862
 
16863
- // packages/orchestrator/dist/personality.js
16863
+ // ../packages/orchestrator/dist/personality.js
16864
16864
  function compilePersonalityPrompt(profile, presetName) {
16865
16865
  if (presetName === "stark") {
16866
16866
  return loadPrompt("personality/level-stark.md");
@@ -16888,7 +16888,7 @@ function getPreset(name) {
16888
16888
  }
16889
16889
  var PERSONALITY_PRESETS, PRESET_NAMES;
16890
16890
  var init_personality = __esm({
16891
- "packages/orchestrator/dist/personality.js"() {
16891
+ "../packages/orchestrator/dist/personality.js"() {
16892
16892
  "use strict";
16893
16893
  init_promptLoader();
16894
16894
  PERSONALITY_PRESETS = {
@@ -16909,7 +16909,7 @@ var init_personality = __esm({
16909
16909
  }
16910
16910
  });
16911
16911
 
16912
- // packages/orchestrator/dist/agenticRunner.js
16912
+ // ../packages/orchestrator/dist/agenticRunner.js
16913
16913
  function repairJson(raw) {
16914
16914
  if (!raw || typeof raw !== "string")
16915
16915
  return null;
@@ -16975,7 +16975,7 @@ function getSystemPromptForTier(tier) {
16975
16975
  }
16976
16976
  var SYSTEM_PROMPT, SYSTEM_PROMPT_MEDIUM, SYSTEM_PROMPT_SMALL, AgenticRunner, OllamaAgenticBackend;
16977
16977
  var init_agenticRunner = __esm({
16978
- "packages/orchestrator/dist/agenticRunner.js"() {
16978
+ "../packages/orchestrator/dist/agenticRunner.js"() {
16979
16979
  "use strict";
16980
16980
  init_dist();
16981
16981
  init_personality();
@@ -19506,10 +19506,10 @@ ${transcript}`
19506
19506
  }
19507
19507
  });
19508
19508
 
19509
- // packages/orchestrator/dist/nexusBackend.js
19509
+ // ../packages/orchestrator/dist/nexusBackend.js
19510
19510
  var NexusAgenticBackend;
19511
19511
  var init_nexusBackend = __esm({
19512
- "packages/orchestrator/dist/nexusBackend.js"() {
19512
+ "../packages/orchestrator/dist/nexusBackend.js"() {
19513
19513
  "use strict";
19514
19514
  NexusAgenticBackend = class {
19515
19515
  sendFn;
@@ -19664,10 +19664,10 @@ var init_nexusBackend = __esm({
19664
19664
  }
19665
19665
  });
19666
19666
 
19667
- // packages/orchestrator/dist/flowstatePrompt.js
19667
+ // ../packages/orchestrator/dist/flowstatePrompt.js
19668
19668
  var FLOWSTATE_PROMPT;
19669
19669
  var init_flowstatePrompt = __esm({
19670
- "packages/orchestrator/dist/flowstatePrompt.js"() {
19670
+ "../packages/orchestrator/dist/flowstatePrompt.js"() {
19671
19671
  "use strict";
19672
19672
  FLOWSTATE_PROMPT = `## FlowState Protocol (Active)
19673
19673
 
@@ -19718,10 +19718,10 @@ Constrain your context. Clarify your target. Focus your tools. Flow will follow.
19718
19718
  }
19719
19719
  });
19720
19720
 
19721
- // packages/orchestrator/dist/costTracker.js
19721
+ // ../packages/orchestrator/dist/costTracker.js
19722
19722
  var DEFAULT_PRICING, CostTracker;
19723
19723
  var init_costTracker = __esm({
19724
- "packages/orchestrator/dist/costTracker.js"() {
19724
+ "../packages/orchestrator/dist/costTracker.js"() {
19725
19725
  "use strict";
19726
19726
  DEFAULT_PRICING = [
19727
19727
  // Cloud providers — typical pricing tiers
@@ -19869,7 +19869,7 @@ var init_costTracker = __esm({
19869
19869
  }
19870
19870
  });
19871
19871
 
19872
- // packages/orchestrator/dist/workEvaluator.js
19872
+ // ../packages/orchestrator/dist/workEvaluator.js
19873
19873
  function detectTaskType(taskDescription) {
19874
19874
  let bestType = "general";
19875
19875
  let bestScore = 0;
@@ -19904,7 +19904,7 @@ function buildEvaluationPrompt(task, summary, rubric) {
19904
19904
  }
19905
19905
  var RUBRICS, TASK_TYPE_PATTERNS, WorkEvaluator;
19906
19906
  var init_workEvaluator = __esm({
19907
- "packages/orchestrator/dist/workEvaluator.js"() {
19907
+ "../packages/orchestrator/dist/workEvaluator.js"() {
19908
19908
  "use strict";
19909
19909
  init_promptLoader();
19910
19910
  RUBRICS = {
@@ -20075,10 +20075,10 @@ var init_workEvaluator = __esm({
20075
20075
  }
20076
20076
  });
20077
20077
 
20078
- // packages/orchestrator/dist/sessionMetrics.js
20078
+ // ../packages/orchestrator/dist/sessionMetrics.js
20079
20079
  var SessionMetrics;
20080
20080
  var init_sessionMetrics = __esm({
20081
- "packages/orchestrator/dist/sessionMetrics.js"() {
20081
+ "../packages/orchestrator/dist/sessionMetrics.js"() {
20082
20082
  "use strict";
20083
20083
  SessionMetrics = class {
20084
20084
  sessionStart;
@@ -20175,16 +20175,16 @@ var init_sessionMetrics = __esm({
20175
20175
  }
20176
20176
  });
20177
20177
 
20178
- // packages/orchestrator/dist/taskLearning.js
20178
+ // ../packages/orchestrator/dist/taskLearning.js
20179
20179
  var init_taskLearning = __esm({
20180
- "packages/orchestrator/dist/taskLearning.js"() {
20180
+ "../packages/orchestrator/dist/taskLearning.js"() {
20181
20181
  "use strict";
20182
20182
  }
20183
20183
  });
20184
20184
 
20185
- // packages/orchestrator/dist/index.js
20185
+ // ../packages/orchestrator/dist/index.js
20186
20186
  var init_dist5 = __esm({
20187
- "packages/orchestrator/dist/index.js"() {
20187
+ "../packages/orchestrator/dist/index.js"() {
20188
20188
  "use strict";
20189
20189
  init_agent_loop();
20190
20190
  init_ralphLoop();
@@ -20207,7 +20207,7 @@ var init_dist5 = __esm({
20207
20207
  }
20208
20208
  });
20209
20209
 
20210
- // packages/cli/dist/tui/listen.js
20210
+ // ../packages/cli/dist/tui/listen.js
20211
20211
  var listen_exports = {};
20212
20212
  __export(listen_exports, {
20213
20213
  ListenEngine: () => ListenEngine,
@@ -20387,7 +20387,7 @@ function getListenEngine(config) {
20387
20387
  }
20388
20388
  var AUDIO_EXTENSIONS, VIDEO_EXTENSIONS, WhisperFallbackTranscriber, ListenEngine, _bgInstallPromise, _engine;
20389
20389
  var init_listen = __esm({
20390
- "packages/cli/dist/tui/listen.js"() {
20390
+ "../packages/cli/dist/tui/listen.js"() {
20391
20391
  "use strict";
20392
20392
  AUDIO_EXTENSIONS = /* @__PURE__ */ new Set([
20393
20393
  ".mp3",
@@ -20590,8 +20590,8 @@ var init_listen = __esm({
20590
20590
  const nvmBase = join34(homedir8(), ".nvm", "versions", "node");
20591
20591
  if (existsSync25(nvmBase)) {
20592
20592
  try {
20593
- const { readdirSync: readdirSync15 } = await import("node:fs");
20594
- for (const ver of readdirSync15(nvmBase)) {
20593
+ const { readdirSync: readdirSync16 } = await import("node:fs");
20594
+ for (const ver of readdirSync16(nvmBase)) {
20595
20595
  const tcPath = join34(nvmBase, ver, "lib", "node_modules", "transcribe-cli");
20596
20596
  if (existsSync25(join34(tcPath, "dist", "index.js"))) {
20597
20597
  const { createRequire: createRequire4 } = await import("node:module");
@@ -20926,9 +20926,9 @@ transcribe-cli error: ${transcribeCliError}` : "";
20926
20926
  }
20927
20927
  });
20928
20928
 
20929
- // node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/constants.js
20929
+ // ../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/constants.js
20930
20930
  var require_constants = __commonJS({
20931
- "node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/constants.js"(exports, module) {
20931
+ "../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/constants.js"(exports, module) {
20932
20932
  "use strict";
20933
20933
  var BINARY_TYPES = ["nodebuffer", "arraybuffer", "fragments"];
20934
20934
  var hasBlob = typeof Blob !== "undefined";
@@ -20949,9 +20949,9 @@ var require_constants = __commonJS({
20949
20949
  }
20950
20950
  });
20951
20951
 
20952
- // node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/buffer-util.js
20952
+ // ../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/buffer-util.js
20953
20953
  var require_buffer_util = __commonJS({
20954
- "node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/buffer-util.js"(exports, module) {
20954
+ "../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/buffer-util.js"(exports, module) {
20955
20955
  "use strict";
20956
20956
  var { EMPTY_BUFFER } = require_constants();
20957
20957
  var FastBuffer = Buffer[Symbol.species];
@@ -21024,9 +21024,9 @@ var require_buffer_util = __commonJS({
21024
21024
  }
21025
21025
  });
21026
21026
 
21027
- // node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/limiter.js
21027
+ // ../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/limiter.js
21028
21028
  var require_limiter = __commonJS({
21029
- "node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/limiter.js"(exports, module) {
21029
+ "../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/limiter.js"(exports, module) {
21030
21030
  "use strict";
21031
21031
  var kDone = /* @__PURE__ */ Symbol("kDone");
21032
21032
  var kRun = /* @__PURE__ */ Symbol("kRun");
@@ -21074,9 +21074,9 @@ var require_limiter = __commonJS({
21074
21074
  }
21075
21075
  });
21076
21076
 
21077
- // node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/permessage-deflate.js
21077
+ // ../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/permessage-deflate.js
21078
21078
  var require_permessage_deflate = __commonJS({
21079
- "node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/permessage-deflate.js"(exports, module) {
21079
+ "../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/permessage-deflate.js"(exports, module) {
21080
21080
  "use strict";
21081
21081
  var zlib = __require("zlib");
21082
21082
  var bufferUtil = require_buffer_util();
@@ -21457,9 +21457,9 @@ var require_permessage_deflate = __commonJS({
21457
21457
  }
21458
21458
  });
21459
21459
 
21460
- // node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/validation.js
21460
+ // ../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/validation.js
21461
21461
  var require_validation = __commonJS({
21462
- "node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/validation.js"(exports, module) {
21462
+ "../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/validation.js"(exports, module) {
21463
21463
  "use strict";
21464
21464
  var { isUtf8 } = __require("buffer");
21465
21465
  var { hasBlob } = require_constants();
@@ -21658,9 +21658,9 @@ var require_validation = __commonJS({
21658
21658
  }
21659
21659
  });
21660
21660
 
21661
- // node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/receiver.js
21661
+ // ../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/receiver.js
21662
21662
  var require_receiver = __commonJS({
21663
- "node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/receiver.js"(exports, module) {
21663
+ "../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/receiver.js"(exports, module) {
21664
21664
  "use strict";
21665
21665
  var { Writable: Writable2 } = __require("stream");
21666
21666
  var PerMessageDeflate = require_permessage_deflate();
@@ -22250,9 +22250,9 @@ var require_receiver = __commonJS({
22250
22250
  }
22251
22251
  });
22252
22252
 
22253
- // node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/sender.js
22253
+ // ../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/sender.js
22254
22254
  var require_sender = __commonJS({
22255
- "node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/sender.js"(exports, module) {
22255
+ "../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/sender.js"(exports, module) {
22256
22256
  "use strict";
22257
22257
  var { Duplex } = __require("stream");
22258
22258
  var { randomFillSync } = __require("crypto");
@@ -22738,9 +22738,9 @@ var require_sender = __commonJS({
22738
22738
  }
22739
22739
  });
22740
22740
 
22741
- // node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/event-target.js
22741
+ // ../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/event-target.js
22742
22742
  var require_event_target = __commonJS({
22743
- "node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/event-target.js"(exports, module) {
22743
+ "../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/event-target.js"(exports, module) {
22744
22744
  "use strict";
22745
22745
  var { kForOnEventAttribute, kListener } = require_constants();
22746
22746
  var kCode = /* @__PURE__ */ Symbol("kCode");
@@ -22967,9 +22967,9 @@ var require_event_target = __commonJS({
22967
22967
  }
22968
22968
  });
22969
22969
 
22970
- // node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/extension.js
22970
+ // ../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/extension.js
22971
22971
  var require_extension = __commonJS({
22972
- "node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/extension.js"(exports, module) {
22972
+ "../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/extension.js"(exports, module) {
22973
22973
  "use strict";
22974
22974
  var { tokenChars } = require_validation();
22975
22975
  function push(dest, name, elem) {
@@ -23120,9 +23120,9 @@ var require_extension = __commonJS({
23120
23120
  }
23121
23121
  });
23122
23122
 
23123
- // node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/websocket.js
23123
+ // ../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/websocket.js
23124
23124
  var require_websocket = __commonJS({
23125
- "node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/websocket.js"(exports, module) {
23125
+ "../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/websocket.js"(exports, module) {
23126
23126
  "use strict";
23127
23127
  var EventEmitter7 = __require("events");
23128
23128
  var https = __require("https");
@@ -24006,9 +24006,9 @@ var require_websocket = __commonJS({
24006
24006
  }
24007
24007
  });
24008
24008
 
24009
- // node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/stream.js
24009
+ // ../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/stream.js
24010
24010
  var require_stream = __commonJS({
24011
- "node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/stream.js"(exports, module) {
24011
+ "../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/stream.js"(exports, module) {
24012
24012
  "use strict";
24013
24013
  var WebSocket2 = require_websocket();
24014
24014
  var { Duplex } = __require("stream");
@@ -24104,9 +24104,9 @@ var require_stream = __commonJS({
24104
24104
  }
24105
24105
  });
24106
24106
 
24107
- // node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/subprotocol.js
24107
+ // ../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/subprotocol.js
24108
24108
  var require_subprotocol = __commonJS({
24109
- "node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/subprotocol.js"(exports, module) {
24109
+ "../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/subprotocol.js"(exports, module) {
24110
24110
  "use strict";
24111
24111
  var { tokenChars } = require_validation();
24112
24112
  function parse(header) {
@@ -24149,9 +24149,9 @@ var require_subprotocol = __commonJS({
24149
24149
  }
24150
24150
  });
24151
24151
 
24152
- // node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/websocket-server.js
24152
+ // ../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/websocket-server.js
24153
24153
  var require_websocket_server = __commonJS({
24154
- "node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/websocket-server.js"(exports, module) {
24154
+ "../node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/websocket-server.js"(exports, module) {
24155
24155
  "use strict";
24156
24156
  var EventEmitter7 = __require("events");
24157
24157
  var http = __require("http");
@@ -24542,10 +24542,10 @@ var require_websocket_server = __commonJS({
24542
24542
  }
24543
24543
  });
24544
24544
 
24545
- // node_modules/.pnpm/ws@8.19.0/node_modules/ws/wrapper.mjs
24545
+ // ../node_modules/.pnpm/ws@8.19.0/node_modules/ws/wrapper.mjs
24546
24546
  var import_stream, import_receiver, import_sender, import_websocket, import_websocket_server;
24547
24547
  var init_wrapper = __esm({
24548
- "node_modules/.pnpm/ws@8.19.0/node_modules/ws/wrapper.mjs"() {
24548
+ "../node_modules/.pnpm/ws@8.19.0/node_modules/ws/wrapper.mjs"() {
24549
24549
  import_stream = __toESM(require_stream(), 1);
24550
24550
  import_receiver = __toESM(require_receiver(), 1);
24551
24551
  import_sender = __toESM(require_sender(), 1);
@@ -24554,7 +24554,7 @@ var init_wrapper = __esm({
24554
24554
  }
24555
24555
  });
24556
24556
 
24557
- // packages/cli/dist/tui/render.js
24557
+ // ../packages/cli/dist/tui/render.js
24558
24558
  function ansi2(code, text) {
24559
24559
  return isTTY2 ? `\x1B[${code}m${text}\x1B[0m` : text;
24560
24560
  }
@@ -25243,7 +25243,7 @@ function formatDuration2(ms) {
25243
25243
  }
25244
25244
  var isTTY2, c2, pastel, _emojisEnabled, _colorsEnabled, MD, TOOL_ICONS, TOOL_LABELS, TOOL_COLORS, _contentWriteHook, HINTS, TOOL_NAMES, COMMAND_NAMES;
25245
25245
  var init_render = __esm({
25246
- "packages/cli/dist/tui/render.js"() {
25246
+ "../packages/cli/dist/tui/render.js"() {
25247
25247
  "use strict";
25248
25248
  isTTY2 = process.stdout.isTTY ?? false;
25249
25249
  c2 = {
@@ -25468,7 +25468,7 @@ var init_render = __esm({
25468
25468
  }
25469
25469
  });
25470
25470
 
25471
- // packages/cli/dist/tui/voice-session.js
25471
+ // ../packages/cli/dist/tui/voice-session.js
25472
25472
  import { createServer } from "node:http";
25473
25473
  import { spawn as spawn13, execSync as execSync24 } from "node:child_process";
25474
25474
  import { EventEmitter as EventEmitter2 } from "node:events";
@@ -25849,7 +25849,7 @@ function renderVoiceSessionTranscript(speaker, text) {
25849
25849
  }
25850
25850
  var VoiceSession;
25851
25851
  var init_voice_session = __esm({
25852
- "packages/cli/dist/tui/voice-session.js"() {
25852
+ "../packages/cli/dist/tui/voice-session.js"() {
25853
25853
  "use strict";
25854
25854
  init_wrapper();
25855
25855
  init_render();
@@ -26196,14 +26196,14 @@ var init_voice_session = __esm({
26196
26196
  }
26197
26197
  });
26198
26198
 
26199
- // packages/cli/dist/tui/expose.js
26199
+ // ../packages/cli/dist/tui/expose.js
26200
26200
  import { createServer as createServer2, request as httpRequest } from "node:http";
26201
26201
  import { spawn as spawn14, exec } from "node:child_process";
26202
26202
  import { EventEmitter as EventEmitter3 } from "node:events";
26203
26203
  import { randomBytes as randomBytes7 } from "node:crypto";
26204
26204
  import { URL as URL2 } from "node:url";
26205
26205
  import { loadavg, cpus, totalmem, freemem } from "node:os";
26206
- import { existsSync as existsSync26, readFileSync as readFileSync18, writeFileSync as writeFileSync8, unlinkSync as unlinkSync3, mkdirSync as mkdirSync8 } from "node:fs";
26206
+ import { existsSync as existsSync26, readFileSync as readFileSync18, writeFileSync as writeFileSync8, unlinkSync as unlinkSync3, mkdirSync as mkdirSync8, readdirSync as readdirSync7 } from "node:fs";
26207
26207
  import { join as join35 } from "node:path";
26208
26208
  function cleanForwardHeaders(raw, targetHost) {
26209
26209
  const out = {};
@@ -26313,9 +26313,9 @@ async function collectSystemMetricsAsync() {
26313
26313
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
26314
26314
  };
26315
26315
  }
26316
- var HOP_BY_HOP_HEADERS, CF_HEADERS_PREFIX, DEFAULT_TARGETS, STATE_FILE_NAME, ExposeGateway;
26316
+ var HOP_BY_HOP_HEADERS, CF_HEADERS_PREFIX, DEFAULT_TARGETS, STATE_FILE_NAME, ExposeGateway, ExposeP2PGateway;
26317
26317
  var init_expose = __esm({
26318
- "packages/cli/dist/tui/expose.js"() {
26318
+ "../packages/cli/dist/tui/expose.js"() {
26319
26319
  "use strict";
26320
26320
  init_render();
26321
26321
  HOP_BY_HOP_HEADERS = /* @__PURE__ */ new Set([
@@ -26951,28 +26951,333 @@ ${this.formatConnectionInfo()}`);
26951
26951
  return lines.join("\n");
26952
26952
  }
26953
26953
  };
26954
+ ExposeP2PGateway = class extends EventEmitter3 {
26955
+ _nexusTool;
26956
+ // NexusTool instance
26957
+ _kind;
26958
+ _targetUrl;
26959
+ _authKey;
26960
+ _peerId = null;
26961
+ _capabilities = [];
26962
+ _exposedModels = 0;
26963
+ _stateDir;
26964
+ _margin;
26965
+ _pollTimer = null;
26966
+ _stats = {
26967
+ status: "standby",
26968
+ totalRequests: 0,
26969
+ activeConnections: 0,
26970
+ errors: 0,
26971
+ totalTokensIn: 0,
26972
+ totalTokensOut: 0,
26973
+ startedAt: Date.now(),
26974
+ modelUsage: /* @__PURE__ */ new Map(),
26975
+ users: /* @__PURE__ */ new Map()
26976
+ };
26977
+ get peerId() {
26978
+ return this._peerId;
26979
+ }
26980
+ get authKey() {
26981
+ return this._authKey;
26982
+ }
26983
+ get stats() {
26984
+ return this._stats;
26985
+ }
26986
+ get kind() {
26987
+ return this._kind;
26988
+ }
26989
+ get isActive() {
26990
+ return this._stats.status === "active";
26991
+ }
26992
+ get transport() {
26993
+ return "libp2p";
26994
+ }
26995
+ _onInfo;
26996
+ _onError;
26997
+ constructor(options, nexusTool) {
26998
+ super();
26999
+ this._nexusTool = nexusTool;
27000
+ this._kind = options.kind;
27001
+ this._targetUrl = options.targetUrl ?? DEFAULT_TARGETS[options.kind];
27002
+ this._stateDir = options.stateDir ?? null;
27003
+ this._margin = options.margin ?? 0.5;
27004
+ this._onInfo = options.onInfo;
27005
+ this._onError = options.onError;
27006
+ if (options.authKey === void 0 || options.authKey === "") {
27007
+ this._authKey = randomBytes7(24).toString("base64url");
27008
+ } else {
27009
+ this._authKey = options.authKey;
27010
+ }
27011
+ }
27012
+ async start() {
27013
+ this._onInfo?.("Connecting to nexus P2P network...");
27014
+ const connectResult = await this._nexusTool.execute({
27015
+ action: "connect",
27016
+ agent_name: "open-agents-node",
27017
+ agent_type: "general"
27018
+ });
27019
+ if (!connectResult.success) {
27020
+ throw new Error(`Nexus daemon connect failed: ${connectResult.error}`);
27021
+ }
27022
+ await new Promise((r) => setTimeout(r, 2e3));
27023
+ this._onInfo?.("Registering inference capabilities...");
27024
+ let exposeResult = await this._nexusTool.execute({
27025
+ action: "expose",
27026
+ ollama_url: this._targetUrl,
27027
+ margin: String(this._margin)
27028
+ });
27029
+ if (!exposeResult.success && exposeResult.error?.includes("not running")) {
27030
+ await new Promise((r) => setTimeout(r, 3e3));
27031
+ exposeResult = await this._nexusTool.execute({
27032
+ action: "expose",
27033
+ ollama_url: this._targetUrl,
27034
+ margin: String(this._margin)
27035
+ });
27036
+ }
27037
+ if (!exposeResult.success) {
27038
+ throw new Error(`Expose failed: ${exposeResult.error}`);
27039
+ }
27040
+ const nexusDir = this._nexusTool.getNexusDir();
27041
+ const statusPath = join35(nexusDir, "status.json");
27042
+ for (let i = 0; i < 60; i++) {
27043
+ try {
27044
+ const raw = readFileSync18(statusPath, "utf8");
27045
+ if (raw.length > 10) {
27046
+ const status = JSON.parse(raw);
27047
+ if (status.connected && status.peerId) {
27048
+ this._peerId = status.peerId;
27049
+ this._capabilities = status.capabilities || [];
27050
+ this._exposedModels = status.exposedModels || 0;
27051
+ break;
27052
+ }
27053
+ }
27054
+ } catch {
27055
+ }
27056
+ await new Promise((r) => setTimeout(r, 500));
27057
+ }
27058
+ this._stats.status = "active";
27059
+ this._stats.startedAt = Date.now();
27060
+ this.emitStats();
27061
+ this.startMeteringPoll(nexusDir);
27062
+ return this._peerId ?? "connected (peer ID pending)";
27063
+ }
27064
+ async stop() {
27065
+ this.stopMeteringPoll();
27066
+ this._stats.status = "standby";
27067
+ this._stats.activeConnections = 0;
27068
+ this.emitStats();
27069
+ }
27070
+ /** Poll the daemon's metering.jsonl and status.json for stats */
27071
+ startMeteringPoll(nexusDir) {
27072
+ this.stopMeteringPoll();
27073
+ let lastMeteringSize = 0;
27074
+ this._pollTimer = setInterval(() => {
27075
+ try {
27076
+ const statusPath = join35(nexusDir, "status.json");
27077
+ if (existsSync26(statusPath)) {
27078
+ const status = JSON.parse(readFileSync18(statusPath, "utf8"));
27079
+ if (status.peerId && !this._peerId) {
27080
+ this._peerId = status.peerId;
27081
+ }
27082
+ this._capabilities = status.capabilities || [];
27083
+ }
27084
+ } catch {
27085
+ }
27086
+ try {
27087
+ const invocDir = join35(nexusDir, "invocations");
27088
+ if (existsSync26(invocDir)) {
27089
+ const files = readdirSync7(invocDir);
27090
+ const invocCount = files.filter((f) => f.endsWith(".json")).length;
27091
+ if (invocCount > this._stats.totalRequests) {
27092
+ this._stats.totalRequests = invocCount;
27093
+ this.emitStats();
27094
+ }
27095
+ }
27096
+ } catch {
27097
+ }
27098
+ try {
27099
+ const meteringFile = join35(nexusDir, "metering.jsonl");
27100
+ if (existsSync26(meteringFile)) {
27101
+ const content = readFileSync18(meteringFile, "utf8");
27102
+ if (content.length > lastMeteringSize) {
27103
+ const newContent = content.slice(lastMeteringSize);
27104
+ lastMeteringSize = content.length;
27105
+ for (const line of newContent.split("\n")) {
27106
+ if (!line.trim())
27107
+ continue;
27108
+ try {
27109
+ const record = JSON.parse(line);
27110
+ if (record.tokens) {
27111
+ this._stats.totalTokensIn += record.tokens.input || 0;
27112
+ this._stats.totalTokensOut += record.tokens.output || 0;
27113
+ }
27114
+ const peerId = record.from || record.peerId || "unknown";
27115
+ const shortPeer = peerId.length > 16 ? peerId.slice(0, 16) + "..." : peerId;
27116
+ let user = this._stats.users.get(shortPeer);
27117
+ if (!user) {
27118
+ user = {
27119
+ ip: shortPeer,
27120
+ firstSeen: Date.now(),
27121
+ lastSeen: Date.now(),
27122
+ requests: 0,
27123
+ tokensIn: 0,
27124
+ tokensOut: 0,
27125
+ activeRequests: 0,
27126
+ models: /* @__PURE__ */ new Map()
27127
+ };
27128
+ this._stats.users.set(shortPeer, user);
27129
+ }
27130
+ user.requests++;
27131
+ user.lastSeen = Date.now();
27132
+ if (record.tokens) {
27133
+ user.tokensIn += record.tokens.input || 0;
27134
+ user.tokensOut += record.tokens.output || 0;
27135
+ }
27136
+ if (record.model || record.capability) {
27137
+ const modelName = record.model || record.capability.replace("inference:", "") || "unknown";
27138
+ this._stats.modelUsage.set(modelName, (this._stats.modelUsage.get(modelName) ?? 0) + 1);
27139
+ let mm = user.models.get(modelName);
27140
+ if (!mm) {
27141
+ mm = { requests: 0, tokensIn: 0, tokensOut: 0, lastUsed: Date.now() };
27142
+ user.models.set(modelName, mm);
27143
+ }
27144
+ mm.requests++;
27145
+ mm.lastUsed = Date.now();
27146
+ if (record.tokens) {
27147
+ mm.tokensIn += record.tokens.input || 0;
27148
+ mm.tokensOut += record.tokens.output || 0;
27149
+ }
27150
+ }
27151
+ } catch {
27152
+ }
27153
+ }
27154
+ this.emitStats();
27155
+ }
27156
+ }
27157
+ } catch {
27158
+ }
27159
+ }, 5e3);
27160
+ this._pollTimer.unref();
27161
+ }
27162
+ stopMeteringPoll() {
27163
+ if (this._pollTimer) {
27164
+ clearInterval(this._pollTimer);
27165
+ this._pollTimer = null;
27166
+ }
27167
+ }
27168
+ emitStats() {
27169
+ this.emit("stats", {
27170
+ ...this._stats,
27171
+ modelUsage: new Map(this._stats.modelUsage),
27172
+ users: new Map(this._stats.users)
27173
+ });
27174
+ }
27175
+ /** Format connection info for display */
27176
+ formatConnectionInfo() {
27177
+ const endpointCmd = `/endpoint ${this._peerId ?? "<peer-id>"} --auth ${this._authKey}`;
27178
+ const lines = [];
27179
+ lines.push(` ${c2.green("\u25CF")} Expose gateway active ${c2.dim("(libp2p)")}`);
27180
+ lines.push(` ${c2.cyan("Backend".padEnd(12))} ${this._kind} (${this._targetUrl})`);
27181
+ lines.push(` ${c2.cyan("Transport".padEnd(12))} ${c2.bold("libp2p")} (DHT + mDNS + NATS relay)`);
27182
+ lines.push(` ${c2.cyan("Peer ID".padEnd(12))} ${c2.bold(this._peerId ?? "connecting...")}`);
27183
+ lines.push(` ${c2.cyan("Auth Key".padEnd(12))} ${c2.bold(this._authKey)}`);
27184
+ lines.push(` ${c2.cyan("Models".padEnd(12))} ${this._exposedModels || this._capabilities.filter((cap) => cap.startsWith("inference:")).length} exposed`);
27185
+ lines.push("");
27186
+ lines.push(` ${c2.dim("Remote consumers connect with:")}`);
27187
+ lines.push(` ${c2.bold(endpointCmd)}`);
27188
+ lines.push("");
27189
+ lines.push(` ${c2.yellow("!")} ${c2.dim("Keep this key secure \u2014 it grants full access to your models.")}`);
27190
+ if ((process.stdout.isTTY ?? false) && this._peerId) {
27191
+ const b64 = Buffer.from(endpointCmd).toString("base64");
27192
+ lines.push(`\x1B]52;c;${b64}\x07`);
27193
+ lines.push(` ${c2.dim("(copied to clipboard)")}`);
27194
+ }
27195
+ const infCaps = this._capabilities.filter((cap) => cap.startsWith("inference:"));
27196
+ if (infCaps.length > 0) {
27197
+ lines.push("");
27198
+ lines.push(` ${c2.bold("Exposed capabilities:")}`);
27199
+ for (const cap of infCaps) {
27200
+ lines.push(` ${c2.cyan(cap)}`);
27201
+ }
27202
+ }
27203
+ return lines.join("\n");
27204
+ }
27205
+ /** Format usage stats for display */
27206
+ formatStats() {
27207
+ const s = this._stats;
27208
+ const lines = [];
27209
+ const uptimeSec = Math.floor((Date.now() - s.startedAt) / 1e3);
27210
+ const uptimeStr = uptimeSec < 60 ? `${uptimeSec}s` : uptimeSec < 3600 ? `${Math.floor(uptimeSec / 60)}m ${uptimeSec % 60}s` : `${Math.floor(uptimeSec / 3600)}h ${Math.floor(uptimeSec % 3600 / 60)}m`;
27211
+ lines.push(` ${c2.bold("Expose Gateway Stats")} ${c2.dim("(libp2p)")}`);
27212
+ lines.push(` ${c2.cyan("Status".padEnd(18))} ${s.status === "active" ? c2.green("active") : s.status === "error" ? c2.red("error") : c2.yellow("standby")}`);
27213
+ lines.push(` ${c2.cyan("Transport".padEnd(18))} libp2p`);
27214
+ lines.push(` ${c2.cyan("Peer ID".padEnd(18))} ${this._peerId ?? "n/a"}`);
27215
+ lines.push(` ${c2.cyan("Uptime".padEnd(18))} ${uptimeStr}`);
27216
+ lines.push(` ${c2.cyan("Total requests".padEnd(18))} ${s.totalRequests}`);
27217
+ lines.push(` ${c2.cyan("Active conns".padEnd(18))} ${s.activeConnections}`);
27218
+ lines.push(` ${c2.cyan("Errors".padEnd(18))} ${s.errors}`);
27219
+ lines.push(` ${c2.cyan("Tokens in".padEnd(18))} ${fmtTokens(s.totalTokensIn)}`);
27220
+ lines.push(` ${c2.cyan("Tokens out".padEnd(18))} ${fmtTokens(s.totalTokensOut)}`);
27221
+ if (s.modelUsage.size > 0) {
27222
+ lines.push("");
27223
+ lines.push(` ${c2.bold("Models")}`);
27224
+ for (const [model, count] of s.modelUsage) {
27225
+ let mIn = 0, mOut = 0;
27226
+ for (const user of s.users.values()) {
27227
+ const mm = user.models.get(model);
27228
+ if (mm) {
27229
+ mIn += mm.tokensIn;
27230
+ mOut += mm.tokensOut;
27231
+ }
27232
+ }
27233
+ lines.push(` ${c2.cyan(model.padEnd(30))} ${count} reqs ${c2.dim(`in:${fmtTokens(mIn)} out:${fmtTokens(mOut)}`)}`);
27234
+ }
27235
+ }
27236
+ if (s.users.size > 0) {
27237
+ lines.push("");
27238
+ lines.push(` ${c2.bold("Active Peers")} (${s.users.size})`);
27239
+ for (const user of s.users.values()) {
27240
+ const ageSec = Math.floor((Date.now() - user.firstSeen) / 1e3);
27241
+ const ageStr = ageSec < 60 ? `${ageSec}s` : ageSec < 3600 ? `${Math.floor(ageSec / 60)}m` : `${Math.floor(ageSec / 3600)}h ${Math.floor(ageSec % 3600 / 60)}m`;
27242
+ const lastSec = Math.floor((Date.now() - user.lastSeen) / 1e3);
27243
+ const lastStr = lastSec < 5 ? "now" : lastSec < 60 ? `${lastSec}s ago` : `${Math.floor(lastSec / 60)}m ago`;
27244
+ lines.push(` ${c2.bold(user.ip)}`);
27245
+ lines.push(` ${c2.dim("Session:")} ${ageStr} ${c2.dim("Last seen:")} ${lastStr} ${c2.dim("Requests:")} ${user.requests}`);
27246
+ lines.push(` ${c2.dim("Tokens:")} in:${fmtTokens(user.tokensIn)} out:${fmtTokens(user.tokensOut)}`);
27247
+ if (user.models.size > 0) {
27248
+ const modelParts = [];
27249
+ for (const [m, mm] of user.models) {
27250
+ modelParts.push(`${m} (${mm.requests} reqs, ${fmtTokens(mm.tokensIn + mm.tokensOut)} tokens)`);
27251
+ }
27252
+ lines.push(` ${c2.dim("Models:")} ${modelParts.join(", ")}`);
27253
+ }
27254
+ }
27255
+ }
27256
+ return lines.join("\n");
27257
+ }
27258
+ };
26954
27259
  }
26955
27260
  });
26956
27261
 
26957
- // packages/cli/dist/tui/p2p/types.js
27262
+ // ../packages/cli/dist/tui/p2p/types.js
26958
27263
  function trustLevel(tier) {
26959
27264
  return TRUST_ORDER.indexOf(tier);
26960
27265
  }
26961
27266
  var TRUST_ORDER;
26962
27267
  var init_types = __esm({
26963
- "packages/cli/dist/tui/p2p/types.js"() {
27268
+ "../packages/cli/dist/tui/p2p/types.js"() {
26964
27269
  "use strict";
26965
27270
  TRUST_ORDER = ["public", "verified", "tee", "local"];
26966
27271
  }
26967
27272
  });
26968
27273
 
26969
- // packages/cli/dist/tui/p2p/secret-vault.js
27274
+ // ../packages/cli/dist/tui/p2p/secret-vault.js
26970
27275
  import { createCipheriv as createCipheriv2, createDecipheriv as createDecipheriv2, randomBytes as randomBytes8, scryptSync as scryptSync2, createHash as createHash2 } from "node:crypto";
26971
27276
  import { readFileSync as readFileSync19, writeFileSync as writeFileSync9, existsSync as existsSync27, mkdirSync as mkdirSync9 } from "node:fs";
26972
27277
  import { join as join36, dirname as dirname13 } from "node:path";
26973
27278
  var PLACEHOLDER_PREFIX, PLACEHOLDER_SUFFIX, CIPHER_ALGO, SALT_LEN, IV_LEN, KEY_LEN, SecretVault;
26974
27279
  var init_secret_vault = __esm({
26975
- "packages/cli/dist/tui/p2p/secret-vault.js"() {
27280
+ "../packages/cli/dist/tui/p2p/secret-vault.js"() {
26976
27281
  "use strict";
26977
27282
  init_types();
26978
27283
  PLACEHOLDER_PREFIX = "{{OA_VAR_";
@@ -27230,13 +27535,13 @@ var init_secret_vault = __esm({
27230
27535
  }
27231
27536
  });
27232
27537
 
27233
- // packages/cli/dist/tui/p2p/peer-mesh.js
27538
+ // ../packages/cli/dist/tui/p2p/peer-mesh.js
27234
27539
  import { EventEmitter as EventEmitter4 } from "node:events";
27235
27540
  import { createServer as createServer3 } from "node:http";
27236
27541
  import { randomBytes as randomBytes9, createHash as createHash3, generateKeyPairSync } from "node:crypto";
27237
27542
  var PING_INTERVAL_MS, PEER_TIMEOUT_MS, GOSSIP_INTERVAL_MS, MAX_PEERS, PeerMesh;
27238
27543
  var init_peer_mesh = __esm({
27239
- "packages/cli/dist/tui/p2p/peer-mesh.js"() {
27544
+ "../packages/cli/dist/tui/p2p/peer-mesh.js"() {
27240
27545
  "use strict";
27241
27546
  init_wrapper();
27242
27547
  PING_INTERVAL_MS = 3e4;
@@ -27695,11 +28000,11 @@ var init_peer_mesh = __esm({
27695
28000
  }
27696
28001
  });
27697
28002
 
27698
- // packages/cli/dist/tui/p2p/inference-router.js
28003
+ // ../packages/cli/dist/tui/p2p/inference-router.js
27699
28004
  import { EventEmitter as EventEmitter5 } from "node:events";
27700
28005
  var TRUST_WEIGHTS, InferenceRouter;
27701
28006
  var init_inference_router = __esm({
27702
- "packages/cli/dist/tui/p2p/inference-router.js"() {
28007
+ "../packages/cli/dist/tui/p2p/inference-router.js"() {
27703
28008
  "use strict";
27704
28009
  init_types();
27705
28010
  TRUST_WEIGHTS = {
@@ -27893,9 +28198,9 @@ var init_inference_router = __esm({
27893
28198
  }
27894
28199
  });
27895
28200
 
27896
- // packages/cli/dist/tui/p2p/index.js
28201
+ // ../packages/cli/dist/tui/p2p/index.js
27897
28202
  var init_p2p = __esm({
27898
- "packages/cli/dist/tui/p2p/index.js"() {
28203
+ "../packages/cli/dist/tui/p2p/index.js"() {
27899
28204
  "use strict";
27900
28205
  init_secret_vault();
27901
28206
  init_peer_mesh();
@@ -27904,7 +28209,7 @@ var init_p2p = __esm({
27904
28209
  }
27905
28210
  });
27906
28211
 
27907
- // packages/cli/dist/tui/call-agent.js
28212
+ // ../packages/cli/dist/tui/call-agent.js
27908
28213
  import { EventEmitter as EventEmitter6 } from "node:events";
27909
28214
  import crypto2 from "node:crypto";
27910
28215
  function adaptTool(tool) {
@@ -27928,7 +28233,7 @@ function generateSessionKey() {
27928
28233
  }
27929
28234
  var ActivityFeed, _globalFeed, CallSubAgent;
27930
28235
  var init_call_agent = __esm({
27931
- "packages/cli/dist/tui/call-agent.js"() {
28236
+ "../packages/cli/dist/tui/call-agent.js"() {
27932
28237
  "use strict";
27933
28238
  init_dist5();
27934
28239
  init_dist2();
@@ -28186,7 +28491,7 @@ ${activitySummary}
28186
28491
  }
28187
28492
  });
28188
28493
 
28189
- // packages/cli/dist/tui/model-picker.js
28494
+ // ../packages/cli/dist/tui/model-picker.js
28190
28495
  async function fetchOllamaModels(baseUrl) {
28191
28496
  const url = `${normalizeBaseUrl(baseUrl)}/api/tags`;
28192
28497
  const resp = await fetch(url, {
@@ -28391,27 +28696,27 @@ function formatRelativeTime(iso) {
28391
28696
  return `${months}mo ago`;
28392
28697
  }
28393
28698
  var init_model_picker = __esm({
28394
- "packages/cli/dist/tui/model-picker.js"() {
28699
+ "../packages/cli/dist/tui/model-picker.js"() {
28395
28700
  "use strict";
28396
28701
  init_dist();
28397
28702
  }
28398
28703
  });
28399
28704
 
28400
- // packages/prompts/dist/loader.js
28705
+ // ../packages/prompts/dist/loader.js
28401
28706
  var init_loader = __esm({
28402
- "packages/prompts/dist/loader.js"() {
28707
+ "../packages/prompts/dist/loader.js"() {
28403
28708
  "use strict";
28404
28709
  }
28405
28710
  });
28406
28711
 
28407
- // packages/prompts/dist/render.js
28712
+ // ../packages/prompts/dist/render.js
28408
28713
  var init_render2 = __esm({
28409
- "packages/prompts/dist/render.js"() {
28714
+ "../packages/prompts/dist/render.js"() {
28410
28715
  "use strict";
28411
28716
  }
28412
28717
  });
28413
28718
 
28414
- // packages/prompts/dist/promptLoader.js
28719
+ // ../packages/prompts/dist/promptLoader.js
28415
28720
  import { readFileSync as readFileSync20, existsSync as existsSync28 } from "node:fs";
28416
28721
  import { join as join37, dirname as dirname14 } from "node:path";
28417
28722
  import { fileURLToPath as fileURLToPath9 } from "node:url";
@@ -28431,7 +28736,7 @@ function loadPrompt2(promptPath, vars) {
28431
28736
  }
28432
28737
  var __filename2, __dirname5, devPath, publishedPath, PROMPTS_DIR2, cache2;
28433
28738
  var init_promptLoader2 = __esm({
28434
- "packages/prompts/dist/promptLoader.js"() {
28739
+ "../packages/prompts/dist/promptLoader.js"() {
28435
28740
  "use strict";
28436
28741
  __filename2 = fileURLToPath9(import.meta.url);
28437
28742
  __dirname5 = dirname14(__filename2);
@@ -28442,7 +28747,7 @@ var init_promptLoader2 = __esm({
28442
28747
  }
28443
28748
  });
28444
28749
 
28445
- // packages/prompts/dist/task-templates.js
28750
+ // ../packages/prompts/dist/task-templates.js
28446
28751
  function getTaskTemplate(type) {
28447
28752
  return TEMPLATES[type];
28448
28753
  }
@@ -28458,7 +28763,7 @@ ${template.outputGuidance}`;
28458
28763
  }
28459
28764
  var TEMPLATES;
28460
28765
  var init_task_templates = __esm({
28461
- "packages/prompts/dist/task-templates.js"() {
28766
+ "../packages/prompts/dist/task-templates.js"() {
28462
28767
  "use strict";
28463
28768
  init_promptLoader2();
28464
28769
  TEMPLATES = {
@@ -28547,12 +28852,12 @@ var init_task_templates = __esm({
28547
28852
  }
28548
28853
  });
28549
28854
 
28550
- // packages/prompts/dist/index.js
28855
+ // ../packages/prompts/dist/index.js
28551
28856
  import { join as join38, dirname as dirname15 } from "node:path";
28552
28857
  import { fileURLToPath as fileURLToPath10 } from "node:url";
28553
28858
  var _dir, _packageRoot;
28554
28859
  var init_dist6 = __esm({
28555
- "packages/prompts/dist/index.js"() {
28860
+ "../packages/prompts/dist/index.js"() {
28556
28861
  "use strict";
28557
28862
  init_loader();
28558
28863
  init_render2();
@@ -28563,8 +28868,8 @@ var init_dist6 = __esm({
28563
28868
  }
28564
28869
  });
28565
28870
 
28566
- // packages/cli/dist/tui/oa-directory.js
28567
- import { existsSync as existsSync29, mkdirSync as mkdirSync10, readFileSync as readFileSync21, writeFileSync as writeFileSync10, readdirSync as readdirSync7, statSync as statSync9, unlinkSync as unlinkSync4 } from "node:fs";
28871
+ // ../packages/cli/dist/tui/oa-directory.js
28872
+ import { existsSync as existsSync29, mkdirSync as mkdirSync10, readFileSync as readFileSync21, writeFileSync as writeFileSync10, readdirSync as readdirSync8, statSync as statSync9, unlinkSync as unlinkSync4 } from "node:fs";
28568
28873
  import { join as join39, relative as relative2, basename as basename9, extname as extname8 } from "node:path";
28569
28874
  import { homedir as homedir9 } from "node:os";
28570
28875
  function initOaDirectory(repoRoot) {
@@ -28756,7 +29061,7 @@ function loadRecentSessions(repoRoot, limit = 5) {
28756
29061
  if (!existsSync29(historyDir))
28757
29062
  return [];
28758
29063
  try {
28759
- const files = readdirSync7(historyDir).filter((f) => f.endsWith(".json") && f !== "pending-task.json").map((f) => {
29064
+ const files = readdirSync8(historyDir).filter((f) => f.endsWith(".json") && f !== "pending-task.json").map((f) => {
28760
29065
  const stat5 = statSync9(join39(historyDir, f));
28761
29066
  return { file: f, mtime: stat5.mtimeMs };
28762
29067
  }).sort((a, b) => b.mtime - a.mtime).slice(0, limit);
@@ -28909,7 +29214,7 @@ function buildDirTree(root, maxDepth, prefix = "", depth = 0) {
28909
29214
  return "";
28910
29215
  let result = "";
28911
29216
  try {
28912
- const entries = readdirSync7(root, { withFileTypes: true }).filter((e) => !e.name.startsWith(".") || e.name === ".github").filter((e) => !SKIP_DIRS.has(e.name)).sort((a, b) => {
29217
+ const entries = readdirSync8(root, { withFileTypes: true }).filter((e) => !e.name.startsWith(".") || e.name === ".github").filter((e) => !SKIP_DIRS.has(e.name)).sort((a, b) => {
28913
29218
  if (a.isDirectory() && !b.isDirectory())
28914
29219
  return -1;
28915
29220
  if (!a.isDirectory() && b.isDirectory())
@@ -28924,7 +29229,7 @@ function buildDirTree(root, maxDepth, prefix = "", depth = 0) {
28924
29229
  if (entry.isDirectory()) {
28925
29230
  let fileCount = 0;
28926
29231
  try {
28927
- fileCount = readdirSync7(join39(root, entry.name)).filter((f) => !f.startsWith(".")).length;
29232
+ fileCount = readdirSync8(join39(root, entry.name)).filter((f) => !f.startsWith(".")).length;
28928
29233
  } catch {
28929
29234
  }
28930
29235
  result += `${prefix}${connector}${entry.name}/ (${fileCount})
@@ -29011,7 +29316,7 @@ function loadUsageHistory(kind, repoRoot) {
29011
29316
  }
29012
29317
  var OA_DIR, SUBDIRS, CONTEXT_FILES, PENDING_TASK_FILE, CONTEXT_SAVE_FILE, MAX_CONTEXT_ENTRIES, SKIP_DIRS, USAGE_HISTORY_FILE, MAX_HISTORY_RECORDS;
29013
29318
  var init_oa_directory = __esm({
29014
- "packages/cli/dist/tui/oa-directory.js"() {
29319
+ "../packages/cli/dist/tui/oa-directory.js"() {
29015
29320
  "use strict";
29016
29321
  OA_DIR = ".oa";
29017
29322
  SUBDIRS = ["memory", "index", "context", "history", "notes", "embedded", "provenance", "tools", "dreams"];
@@ -29052,7 +29357,7 @@ var init_oa_directory = __esm({
29052
29357
  }
29053
29358
  });
29054
29359
 
29055
- // packages/cli/dist/tui/setup.js
29360
+ // ../packages/cli/dist/tui/setup.js
29056
29361
  import * as readline from "node:readline";
29057
29362
  import { execSync as execSync25, spawn as spawn15, exec as exec2 } from "node:child_process";
29058
29363
  import { promisify as promisify5 } from "node:util";
@@ -30581,7 +30886,7 @@ async function ensureExpandedContext(modelName, backendUrl) {
30581
30886
  }
30582
30887
  var execAsync, QWEN_VARIANTS, TOOL_CALLING_MODELS, _cloudflaredInstallPromise;
30583
30888
  var init_setup = __esm({
30584
- "packages/cli/dist/tui/setup.js"() {
30889
+ "../packages/cli/dist/tui/setup.js"() {
30585
30890
  "use strict";
30586
30891
  init_model_picker();
30587
30892
  init_render();
@@ -30616,7 +30921,7 @@ var init_setup = __esm({
30616
30921
  }
30617
30922
  });
30618
30923
 
30619
- // packages/cli/dist/tui/tui-select.js
30924
+ // ../packages/cli/dist/tui/tui-select.js
30620
30925
  function ansi3(code, text) {
30621
30926
  return isTTY3 ? `\x1B[${code}m${text}\x1B[0m` : text;
30622
30927
  }
@@ -30926,7 +31231,7 @@ function tuiSelect(opts) {
30926
31231
  }
30927
31232
  var isTTY3, selectColors;
30928
31233
  var init_tui_select = __esm({
30929
- "packages/cli/dist/tui/tui-select.js"() {
31234
+ "../packages/cli/dist/tui/tui-select.js"() {
30930
31235
  "use strict";
30931
31236
  isTTY3 = process.stdout.isTTY ?? false;
30932
31237
  selectColors = {
@@ -30943,7 +31248,7 @@ var init_tui_select = __esm({
30943
31248
  }
30944
31249
  });
30945
31250
 
30946
- // packages/cli/dist/tui/commands.js
31251
+ // ../packages/cli/dist/tui/commands.js
30947
31252
  async function handleSlashCommand(input, ctx) {
30948
31253
  const trimmed = input.trim();
30949
31254
  if (!trimmed.startsWith("/"))
@@ -31540,15 +31845,17 @@ async function handleSlashCommand(input, ctx) {
31540
31845
  if (info && ctx.isExposeActive?.()) {
31541
31846
  process.stdout.write("\n" + info.stats + "\n\n");
31542
31847
  } else {
31543
- renderInfo("Usage: /expose <backend> [--key <auth-key>]");
31544
- renderInfo(" /expose ollama Expose local Ollama (11434)");
31848
+ renderInfo("Usage: /expose <backend> [options]");
31849
+ renderInfo(" /expose ollama Expose local Ollama via libp2p (default)");
31850
+ renderInfo(" /expose ollama --tunnel Expose via cloudflared tunnel");
31851
+ renderInfo(" /expose ollama --libp2p Expose via libp2p (explicit)");
31545
31852
  renderInfo(" /expose vllm Expose local vLLM (8000)");
31546
31853
  renderInfo(" /expose llvm Expose local LLVM (8080)");
31547
31854
  renderInfo(" /expose host:port Expose custom address");
31548
31855
  renderInfo(" /expose stop Stop the gateway");
31549
31856
  renderInfo(" /expose status Show usage stats");
31550
- renderInfo(" --key <key> Use specific auth key");
31551
- renderInfo(" --key Auto-generate auth key");
31857
+ renderInfo(" --key <key> Use specific auth key (tunnel mode)");
31858
+ renderInfo(" --key Auto-generate auth key (tunnel mode)");
31552
31859
  }
31553
31860
  return "handled";
31554
31861
  }
@@ -31558,12 +31865,18 @@ async function handleSlashCommand(input, ctx) {
31558
31865
  const exposeParts = arg.split(/\s+/);
31559
31866
  const kindOrUrl = exposeParts[0];
31560
31867
  let exposeAuthKey;
31868
+ let exposeTransport;
31561
31869
  const keyIdx = exposeParts.indexOf("--key");
31562
31870
  if (keyIdx !== -1) {
31563
31871
  exposeAuthKey = exposeParts[keyIdx + 1] ?? "";
31564
31872
  }
31873
+ if (exposeParts.includes("--tunnel")) {
31874
+ exposeTransport = "tunnel";
31875
+ } else if (exposeParts.includes("--libp2p")) {
31876
+ exposeTransport = "libp2p";
31877
+ }
31565
31878
  try {
31566
- const tunnelUrl = await ctx.exposeStart(kindOrUrl, exposeAuthKey);
31879
+ const tunnelUrl = await ctx.exposeStart(kindOrUrl, exposeAuthKey, exposeTransport);
31567
31880
  if (tunnelUrl) {
31568
31881
  const info = ctx.getExposeInfo?.();
31569
31882
  if (info) {
@@ -32323,6 +32636,10 @@ async function handleEndpoint(arg, ctx, local = false) {
32323
32636
  if (authIdx !== -1 && parts[authIdx + 1]) {
32324
32637
  apiKey = parts[authIdx + 1];
32325
32638
  }
32639
+ if (url.startsWith("12D3KooW") && url.length > 40 && !url.includes("://")) {
32640
+ await handlePeerEndpoint(url, apiKey, ctx, local);
32641
+ return;
32642
+ }
32326
32643
  try {
32327
32644
  new URL(url);
32328
32645
  } catch {
@@ -32446,6 +32763,71 @@ async function handleEndpoint(arg, ctx, local = false) {
32446
32763
  renderWarning(`Could not verify model availability on ${provider.label}. If inference fails, use /model to switch.`);
32447
32764
  }
32448
32765
  }
32766
+ async function handlePeerEndpoint(peerId, authKey, ctx, local) {
32767
+ process.stdout.write(`
32768
+ ${c2.dim("Detected:")} ${c2.bold("libp2p peer")}
32769
+ `);
32770
+ process.stdout.write(` ${c2.cyan("Peer ID".padEnd(12))} ${peerId}
32771
+ `);
32772
+ if (authKey) {
32773
+ process.stdout.write(` ${c2.cyan("Auth Key".padEnd(12))} ${authKey.slice(0, 8)}...
32774
+ `);
32775
+ }
32776
+ process.stdout.write(` ${c2.dim("Connecting to nexus network...")} `);
32777
+ try {
32778
+ if (!ctx.nexusConnect) {
32779
+ throw new Error("Nexus not available \u2014 run /nexus connect first");
32780
+ }
32781
+ const connectMsg = await ctx.nexusConnect();
32782
+ process.stdout.write(`${c2.green("\u2714")} Connected
32783
+ `);
32784
+ } catch (err) {
32785
+ process.stdout.write(`${c2.yellow("\u26A0")} ${err instanceof Error ? err.message : String(err)}
32786
+ `);
32787
+ renderInfo("Setting peer endpoint anyway \u2014 nexus may connect later.");
32788
+ }
32789
+ const peerUrl = `peer://${peerId}`;
32790
+ ctx.setEndpoint(peerUrl, "vllm", authKey);
32791
+ const endpointSettings = { backendUrl: peerUrl, backendType: "vllm", ...authKey ? { apiKey: authKey } : {} };
32792
+ if (local) {
32793
+ ctx.saveLocalSettings(endpointSettings);
32794
+ } else {
32795
+ setConfigValue("backendUrl", peerUrl);
32796
+ setConfigValue("backendType", "vllm");
32797
+ if (authKey)
32798
+ setConfigValue("apiKey", authKey);
32799
+ ctx.saveSettings(endpointSettings);
32800
+ }
32801
+ recordUsage("endpoint", peerUrl, {
32802
+ repoRoot: local ? ctx.repoRoot : void 0,
32803
+ local,
32804
+ meta: {
32805
+ provider: "libp2p-peer",
32806
+ backendType: "vllm",
32807
+ peerId,
32808
+ ...authKey ? { authHint: authKey.slice(0, 4) + "..." } : {}
32809
+ }
32810
+ });
32811
+ process.stdout.write(`
32812
+ ${c2.green("\u2714")} Endpoint set to libp2p peer${local ? " (project-local)" : ""}:
32813
+ `);
32814
+ process.stdout.write(` ${c2.cyan("Transport".padEnd(12))} libp2p (DHT + mDNS + NATS relay)
32815
+ `);
32816
+ process.stdout.write(` ${c2.cyan("Peer ID".padEnd(12))} ${peerId}
32817
+ `);
32818
+ if (authKey) {
32819
+ process.stdout.write(` ${c2.cyan("Auth".padEnd(12))} ${authKey.slice(0, 8)}...
32820
+ `);
32821
+ }
32822
+ process.stdout.write(`
32823
+ ${c2.dim("Inference requests will be routed via nexus P2P network.")}
32824
+
32825
+ `);
32826
+ if (ctx.hasActiveTask?.()) {
32827
+ ctx.abortActiveTask?.();
32828
+ renderWarning("Active task aborted \u2014 endpoint changed. Send a new prompt to continue.");
32829
+ }
32830
+ }
32449
32831
  async function handleUpdate(subcommand, ctx) {
32450
32832
  const repoRoot = ctx.repoRoot;
32451
32833
  if (subcommand === "auto") {
@@ -32743,7 +33125,7 @@ async function switchModel(query, ctx, local = false) {
32743
33125
  }
32744
33126
  }
32745
33127
  var init_commands = __esm({
32746
- "packages/cli/dist/tui/commands.js"() {
33128
+ "../packages/cli/dist/tui/commands.js"() {
32747
33129
  "use strict";
32748
33130
  init_model_picker();
32749
33131
  init_render();
@@ -32760,8 +33142,8 @@ var init_commands = __esm({
32760
33142
  }
32761
33143
  });
32762
33144
 
32763
- // packages/cli/dist/tui/project-context.js
32764
- import { existsSync as existsSync31, readFileSync as readFileSync22, readdirSync as readdirSync8 } from "node:fs";
33145
+ // ../packages/cli/dist/tui/project-context.js
33146
+ import { existsSync as existsSync31, readFileSync as readFileSync22, readdirSync as readdirSync9 } from "node:fs";
32765
33147
  import { join as join41, basename as basename10 } from "node:path";
32766
33148
  import { execSync as execSync26 } from "node:child_process";
32767
33149
  import { homedir as homedir11, platform as platform2, release } from "node:os";
@@ -32862,7 +33244,7 @@ function loadMemoryDir(memDir, scope) {
32862
33244
  return "";
32863
33245
  const lines = [];
32864
33246
  try {
32865
- const files = readdirSync8(memDir).filter((f) => f.endsWith(".json"));
33247
+ const files = readdirSync9(memDir).filter((f) => f.endsWith(".json"));
32866
33248
  for (const file of files.slice(0, 10)) {
32867
33249
  try {
32868
33250
  const raw = readFileSync22(join41(memDir, file), "utf-8");
@@ -33065,14 +33447,14 @@ These patterns have been repeated 3+ times. Consider using create_tool to automa
33065
33447
  return sections.join("\n\n");
33066
33448
  }
33067
33449
  var init_project_context = __esm({
33068
- "packages/cli/dist/tui/project-context.js"() {
33450
+ "../packages/cli/dist/tui/project-context.js"() {
33069
33451
  "use strict";
33070
33452
  init_oa_directory();
33071
33453
  init_dist2();
33072
33454
  }
33073
33455
  });
33074
33456
 
33075
- // packages/memory/dist/db.js
33457
+ // ../packages/memory/dist/db.js
33076
33458
  import Database from "better-sqlite3";
33077
33459
  function initDb(dbPath) {
33078
33460
  const db = new Database(dbPath);
@@ -33227,26 +33609,26 @@ function runMigrations(db) {
33227
33609
  `);
33228
33610
  }
33229
33611
  var init_db = __esm({
33230
- "packages/memory/dist/db.js"() {
33612
+ "../packages/memory/dist/db.js"() {
33231
33613
  "use strict";
33232
33614
  }
33233
33615
  });
33234
33616
 
33235
- // packages/memory/dist/repoProfileStore.js
33617
+ // ../packages/memory/dist/repoProfileStore.js
33236
33618
  var init_repoProfileStore = __esm({
33237
- "packages/memory/dist/repoProfileStore.js"() {
33619
+ "../packages/memory/dist/repoProfileStore.js"() {
33238
33620
  "use strict";
33239
33621
  }
33240
33622
  });
33241
33623
 
33242
- // packages/memory/dist/fileSummaryStore.js
33624
+ // ../packages/memory/dist/fileSummaryStore.js
33243
33625
  var init_fileSummaryStore = __esm({
33244
- "packages/memory/dist/fileSummaryStore.js"() {
33626
+ "../packages/memory/dist/fileSummaryStore.js"() {
33245
33627
  "use strict";
33246
33628
  }
33247
33629
  });
33248
33630
 
33249
- // packages/memory/dist/taskMemoryStore.js
33631
+ // ../packages/memory/dist/taskMemoryStore.js
33250
33632
  import { randomUUID } from "node:crypto";
33251
33633
  function rowToTask(row) {
33252
33634
  return {
@@ -33265,7 +33647,7 @@ function rowToTask(row) {
33265
33647
  }
33266
33648
  var TaskMemoryStore;
33267
33649
  var init_taskMemoryStore = __esm({
33268
- "packages/memory/dist/taskMemoryStore.js"() {
33650
+ "../packages/memory/dist/taskMemoryStore.js"() {
33269
33651
  "use strict";
33270
33652
  TaskMemoryStore = class {
33271
33653
  db;
@@ -33316,14 +33698,14 @@ var init_taskMemoryStore = __esm({
33316
33698
  }
33317
33699
  });
33318
33700
 
33319
- // packages/memory/dist/patchHistoryStore.js
33701
+ // ../packages/memory/dist/patchHistoryStore.js
33320
33702
  var init_patchHistoryStore = __esm({
33321
- "packages/memory/dist/patchHistoryStore.js"() {
33703
+ "../packages/memory/dist/patchHistoryStore.js"() {
33322
33704
  "use strict";
33323
33705
  }
33324
33706
  });
33325
33707
 
33326
- // packages/memory/dist/failureStore.js
33708
+ // ../packages/memory/dist/failureStore.js
33327
33709
  import { randomUUID as randomUUID2 } from "node:crypto";
33328
33710
  function rowToFailure(row) {
33329
33711
  return {
@@ -33344,7 +33726,7 @@ function rowToFailure(row) {
33344
33726
  }
33345
33727
  var FailureStore;
33346
33728
  var init_failureStore = __esm({
33347
- "packages/memory/dist/failureStore.js"() {
33729
+ "../packages/memory/dist/failureStore.js"() {
33348
33730
  "use strict";
33349
33731
  FailureStore = class {
33350
33732
  db;
@@ -33399,18 +33781,18 @@ var init_failureStore = __esm({
33399
33781
  }
33400
33782
  });
33401
33783
 
33402
- // packages/memory/dist/validationStore.js
33784
+ // ../packages/memory/dist/validationStore.js
33403
33785
  var init_validationStore = __esm({
33404
- "packages/memory/dist/validationStore.js"() {
33786
+ "../packages/memory/dist/validationStore.js"() {
33405
33787
  "use strict";
33406
33788
  }
33407
33789
  });
33408
33790
 
33409
- // packages/memory/dist/toolPatternStore.js
33791
+ // ../packages/memory/dist/toolPatternStore.js
33410
33792
  import { randomUUID as randomUUID3 } from "node:crypto";
33411
33793
  var ToolPatternStore;
33412
33794
  var init_toolPatternStore = __esm({
33413
- "packages/memory/dist/toolPatternStore.js"() {
33795
+ "../packages/memory/dist/toolPatternStore.js"() {
33414
33796
  "use strict";
33415
33797
  ToolPatternStore = class {
33416
33798
  db;
@@ -33589,9 +33971,9 @@ var init_toolPatternStore = __esm({
33589
33971
  }
33590
33972
  });
33591
33973
 
33592
- // packages/memory/dist/index.js
33974
+ // ../packages/memory/dist/index.js
33593
33975
  var init_dist7 = __esm({
33594
- "packages/memory/dist/index.js"() {
33976
+ "../packages/memory/dist/index.js"() {
33595
33977
  "use strict";
33596
33978
  init_db();
33597
33979
  init_repoProfileStore();
@@ -33604,7 +33986,7 @@ var init_dist7 = __esm({
33604
33986
  }
33605
33987
  });
33606
33988
 
33607
- // packages/cli/dist/tui/carousel.js
33989
+ // ../packages/cli/dist/tui/carousel.js
33608
33990
  function fg(code, text) {
33609
33991
  return isTTY4 ? `\x1B[38;5;${code}m${text}\x1B[0m` : text;
33610
33992
  }
@@ -33646,7 +34028,7 @@ function createRow(phraseIndices, speed, direction, bank) {
33646
34028
  }
33647
34029
  var isTTY4, PHRASES, Carousel;
33648
34030
  var init_carousel = __esm({
33649
- "packages/cli/dist/tui/carousel.js"() {
34031
+ "../packages/cli/dist/tui/carousel.js"() {
33650
34032
  "use strict";
33651
34033
  isTTY4 = process.stdout.isTTY ?? false;
33652
34034
  PHRASES = [
@@ -33887,8 +34269,8 @@ var init_carousel = __esm({
33887
34269
  }
33888
34270
  });
33889
34271
 
33890
- // packages/cli/dist/tui/carousel-descriptors.js
33891
- import { existsSync as existsSync32, readFileSync as readFileSync23, writeFileSync as writeFileSync12, mkdirSync as mkdirSync12, readdirSync as readdirSync9 } from "node:fs";
34272
+ // ../packages/cli/dist/tui/carousel-descriptors.js
34273
+ import { existsSync as existsSync32, readFileSync as readFileSync23, writeFileSync as writeFileSync12, mkdirSync as mkdirSync12, readdirSync as readdirSync10 } from "node:fs";
33892
34274
  import { join as join42, basename as basename11 } from "node:path";
33893
34275
  function loadToolProfile(repoRoot) {
33894
34276
  const filePath = join42(repoRoot, OA_DIR, "context", TOOL_PROFILE_FILE);
@@ -34101,7 +34483,7 @@ function extractFromMemory(repoRoot, tags) {
34101
34483
  try {
34102
34484
  if (!existsSync32(memoryDir))
34103
34485
  return;
34104
- const files = readdirSync9(memoryDir).filter((f) => f.endsWith(".json"));
34486
+ const files = readdirSync10(memoryDir).filter((f) => f.endsWith(".json"));
34105
34487
  for (const file of files) {
34106
34488
  const topic = file.replace(/\.json$/, "").replace(/[-_]/g, " ");
34107
34489
  tags.push(topic);
@@ -34134,7 +34516,7 @@ function extractFromToolProfile(profile, tags) {
34134
34516
  }
34135
34517
  var TOOL_CATEGORIES, TOOL_PROFILE_FILE, DESCRIPTOR_FILE, CATEGORY_LABELS, STOP_WORDS;
34136
34518
  var init_carousel_descriptors = __esm({
34137
- "packages/cli/dist/tui/carousel-descriptors.js"() {
34519
+ "../packages/cli/dist/tui/carousel-descriptors.js"() {
34138
34520
  "use strict";
34139
34521
  init_oa_directory();
34140
34522
  TOOL_CATEGORIES = [
@@ -34240,7 +34622,7 @@ var init_carousel_descriptors = __esm({
34240
34622
  }
34241
34623
  });
34242
34624
 
34243
- // packages/cli/dist/tui/voice.js
34625
+ // ../packages/cli/dist/tui/voice.js
34244
34626
  import { existsSync as existsSync33, mkdirSync as mkdirSync13, writeFileSync as writeFileSync13, readFileSync as readFileSync24, unlinkSync as unlinkSync5 } from "node:fs";
34245
34627
  import { join as join43 } from "node:path";
34246
34628
  import { homedir as homedir12, tmpdir as tmpdir6, platform as platform3 } from "node:os";
@@ -34711,7 +35093,7 @@ function formatBytes2(bytes) {
34711
35093
  }
34712
35094
  var VOICE_MODELS, VoiceEngine, narration, FILE_READ_VARIANTS, FILE_WRITE_VARIANTS, FILE_EDIT_VARIANTS, GREP_VARIANTS, WEB_SEARCH_VARIANTS, WEB_FETCH_VARIANTS, MEMORY_READ_VARIANTS, MEMORY_WRITE_VARIANTS, SUB_AGENT_VARIANTS, SHELL_VARIANTS, RESULT_SUCCESS_VARIANTS, RESULT_FAIL_VARIANTS, RESULT_MULTI_FAIL_VARIANTS, TASK_COMPLETE_VARIANTS, TASK_INCOMPLETE_VARIANTS;
34713
35095
  var init_voice = __esm({
34714
- "packages/cli/dist/tui/voice.js"() {
35096
+ "../packages/cli/dist/tui/voice.js"() {
34715
35097
  "use strict";
34716
35098
  init_render();
34717
35099
  VOICE_MODELS = {
@@ -36028,7 +36410,7 @@ Error: ${err instanceof Error ? err.message : String(err)}`);
36028
36410
  }
36029
36411
  });
36030
36412
 
36031
- // packages/cli/dist/tui/stream-renderer.js
36413
+ // ../packages/cli/dist/tui/stream-renderer.js
36032
36414
  function fg2563(code, text) {
36033
36415
  return isTTY5 ? `\x1B[38;5;${code}m${text}\x1B[0m` : text;
36034
36416
  }
@@ -36046,7 +36428,7 @@ function boldText(text) {
36046
36428
  }
36047
36429
  var isTTY5, PASTEL, StreamRenderer;
36048
36430
  var init_stream_renderer = __esm({
36049
- "packages/cli/dist/tui/stream-renderer.js"() {
36431
+ "../packages/cli/dist/tui/stream-renderer.js"() {
36050
36432
  "use strict";
36051
36433
  isTTY5 = process.stdout.isTTY ?? false;
36052
36434
  PASTEL = {
@@ -36515,7 +36897,7 @@ var init_stream_renderer = __esm({
36515
36897
  }
36516
36898
  });
36517
36899
 
36518
- // packages/cli/dist/tui/edit-history.js
36900
+ // ../packages/cli/dist/tui/edit-history.js
36519
36901
  import { appendFileSync as appendFileSync2, mkdirSync as mkdirSync14 } from "node:fs";
36520
36902
  import { join as join44 } from "node:path";
36521
36903
  function createEditHistoryLogger(repoRoot, sessionId) {
@@ -36619,7 +37001,7 @@ function sanitizeArgs(tool, args) {
36619
37001
  }
36620
37002
  var EDIT_TOOLS;
36621
37003
  var init_edit_history = __esm({
36622
- "packages/cli/dist/tui/edit-history.js"() {
37004
+ "../packages/cli/dist/tui/edit-history.js"() {
36623
37005
  "use strict";
36624
37006
  EDIT_TOOLS = /* @__PURE__ */ new Set([
36625
37007
  "file_edit",
@@ -36630,7 +37012,7 @@ var init_edit_history = __esm({
36630
37012
  }
36631
37013
  });
36632
37014
 
36633
- // packages/cli/dist/tui/promptLoader.js
37015
+ // ../packages/cli/dist/tui/promptLoader.js
36634
37016
  import { readFileSync as readFileSync25, existsSync as existsSync34 } from "node:fs";
36635
37017
  import { join as join45, dirname as dirname16 } from "node:path";
36636
37018
  import { fileURLToPath as fileURLToPath11 } from "node:url";
@@ -36650,7 +37032,7 @@ function loadPrompt3(promptPath, vars) {
36650
37032
  }
36651
37033
  var __filename3, __dirname6, devPath2, publishedPath2, PROMPTS_DIR3, cache3;
36652
37034
  var init_promptLoader3 = __esm({
36653
- "packages/cli/dist/tui/promptLoader.js"() {
37035
+ "../packages/cli/dist/tui/promptLoader.js"() {
36654
37036
  "use strict";
36655
37037
  __filename3 = fileURLToPath11(import.meta.url);
36656
37038
  __dirname6 = dirname16(__filename3);
@@ -36661,8 +37043,8 @@ var init_promptLoader3 = __esm({
36661
37043
  }
36662
37044
  });
36663
37045
 
36664
- // packages/cli/dist/tui/dream-engine.js
36665
- import { mkdirSync as mkdirSync15, writeFileSync as writeFileSync14, readFileSync as readFileSync26, existsSync as existsSync35, cpSync, rmSync, readdirSync as readdirSync10 } from "node:fs";
37046
+ // ../packages/cli/dist/tui/dream-engine.js
37047
+ import { mkdirSync as mkdirSync15, writeFileSync as writeFileSync14, readFileSync as readFileSync26, existsSync as existsSync35, cpSync, rmSync, readdirSync as readdirSync11 } from "node:fs";
36666
37048
  import { join as join46, basename as basename12 } from "node:path";
36667
37049
  import { execSync as execSync28 } from "node:child_process";
36668
37050
  function loadAutoresearchMemory(repoRoot) {
@@ -36824,7 +37206,7 @@ function renderSwarmComplete(workspace) {
36824
37206
  }
36825
37207
  var SWARM_ROLE_CONFIG, AutoresearchFileWriteTool, AutoresearchFileEditTool, AUTORESEARCH_MEMORY_KEYS, SLEEP_STAGES, DreamFileWriteTool, DreamFileEditTool, DreamShellTool, DreamEngine;
36826
37208
  var init_dream_engine = __esm({
36827
- "packages/cli/dist/tui/dream-engine.js"() {
37209
+ "../packages/cli/dist/tui/dream-engine.js"() {
36828
37210
  "use strict";
36829
37211
  init_dist5();
36830
37212
  init_dist2();
@@ -37868,7 +38250,7 @@ Each proposal includes implementation entrypoints and estimated effort.
37868
38250
  /** Update the master proposal index */
37869
38251
  updateProposalIndex() {
37870
38252
  try {
37871
- const files = readdirSync10(this.dreamsDir).filter((f) => f.endsWith(".md") && f !== "PROPOSAL-INDEX.md" && f !== "dream-state.json").sort();
38253
+ const files = readdirSync11(this.dreamsDir).filter((f) => f.endsWith(".md") && f !== "PROPOSAL-INDEX.md" && f !== "dream-state.json").sort();
37872
38254
  const index = `# Dream Proposals Index
37873
38255
 
37874
38256
  **Last updated**: ${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}
@@ -37904,7 +38286,7 @@ ${files.map((f) => `- [\`${f}\`](./${f})`).join("\n")}
37904
38286
  }
37905
38287
  });
37906
38288
 
37907
- // packages/cli/dist/tui/priority-ingress.js
38289
+ // ../packages/cli/dist/tui/priority-ingress.js
37908
38290
  function classifyPriority(prompt, source, origin) {
37909
38291
  for (const rule of CLASSIFICATION_RULES) {
37910
38292
  if (rule.sourceType !== "any" && rule.sourceType !== source)
@@ -37929,7 +38311,7 @@ function classifyPriority(prompt, source, origin) {
37929
38311
  }
37930
38312
  var PRIORITY_WEIGHT, PRIORITY_POLICIES, CLASSIFICATION_RULES, PriorityIngressEngine;
37931
38313
  var init_priority_ingress = __esm({
37932
- "packages/cli/dist/tui/priority-ingress.js"() {
38314
+ "../packages/cli/dist/tui/priority-ingress.js"() {
37933
38315
  "use strict";
37934
38316
  PRIORITY_WEIGHT = {
37935
38317
  critical: 100,
@@ -38114,7 +38496,7 @@ var init_priority_ingress = __esm({
38114
38496
  }
38115
38497
  });
38116
38498
 
38117
- // packages/cli/dist/tui/bless-engine.js
38499
+ // ../packages/cli/dist/tui/bless-engine.js
38118
38500
  function renderBlessStart() {
38119
38501
  process.stdout.write(`
38120
38502
  ${c2.green("\u26A1")} ${c2.bold("BLESSED")} \u2014 Infinite warm loop activated
@@ -38138,7 +38520,7 @@ function renderBlessStop(state) {
38138
38520
  }
38139
38521
  var BlessEngine;
38140
38522
  var init_bless_engine = __esm({
38141
- "packages/cli/dist/tui/bless-engine.js"() {
38523
+ "../packages/cli/dist/tui/bless-engine.js"() {
38142
38524
  "use strict";
38143
38525
  init_render();
38144
38526
  init_dist2();
@@ -38269,8 +38651,8 @@ var init_bless_engine = __esm({
38269
38651
  }
38270
38652
  });
38271
38653
 
38272
- // packages/cli/dist/tui/dmn-engine.js
38273
- import { existsSync as existsSync36, readFileSync as readFileSync27, writeFileSync as writeFileSync15, mkdirSync as mkdirSync16, readdirSync as readdirSync11, unlinkSync as unlinkSync6 } from "node:fs";
38654
+ // ../packages/cli/dist/tui/dmn-engine.js
38655
+ import { existsSync as existsSync36, readFileSync as readFileSync27, writeFileSync as writeFileSync15, mkdirSync as mkdirSync16, readdirSync as readdirSync12, unlinkSync as unlinkSync6 } from "node:fs";
38274
38656
  import { join as join47, basename as basename13 } from "node:path";
38275
38657
  function buildDMNGatherPrompt(recentTaskSummaries, dueReminders, attentionItems, memoryTopics, capabilities, competence, reflectionBuffer) {
38276
38658
  const competenceReport = competence.length > 0 ? competence.map((c3) => {
@@ -38357,7 +38739,7 @@ function renderDMNResting(consecutiveNulls) {
38357
38739
  }
38358
38740
  var DMNEngine;
38359
38741
  var init_dmn_engine = __esm({
38360
- "packages/cli/dist/tui/dmn-engine.js"() {
38742
+ "../packages/cli/dist/tui/dmn-engine.js"() {
38361
38743
  "use strict";
38362
38744
  init_dist5();
38363
38745
  init_dist2();
@@ -38982,7 +39364,7 @@ OUTPUT: Call task_complete with JSON:
38982
39364
  if (!existsSync36(dir))
38983
39365
  continue;
38984
39366
  try {
38985
- const files = readdirSync11(dir).filter((f) => f.endsWith(".json"));
39367
+ const files = readdirSync12(dir).filter((f) => f.endsWith(".json"));
38986
39368
  for (const f of files) {
38987
39369
  const topic = basename13(f, ".json");
38988
39370
  if (!topics.includes(topic))
@@ -39013,7 +39395,7 @@ OUTPUT: Call task_complete with JSON:
39013
39395
  try {
39014
39396
  const filename = `cycle-${result.cycleNumber}-${Date.now()}.json`;
39015
39397
  writeFileSync15(join47(this.historyDir, filename), JSON.stringify(result, null, 2) + "\n", "utf-8");
39016
- const files = readdirSync11(this.historyDir).filter((f) => f.startsWith("cycle-") && f.endsWith(".json")).sort();
39398
+ const files = readdirSync12(this.historyDir).filter((f) => f.startsWith("cycle-") && f.endsWith(".json")).sort();
39017
39399
  if (files.length > 50) {
39018
39400
  for (const old of files.slice(0, files.length - 50)) {
39019
39401
  try {
@@ -39029,8 +39411,8 @@ OUTPUT: Call task_complete with JSON:
39029
39411
  }
39030
39412
  });
39031
39413
 
39032
- // packages/cli/dist/tui/snr-engine.js
39033
- import { existsSync as existsSync37, readdirSync as readdirSync12, readFileSync as readFileSync28 } from "node:fs";
39414
+ // ../packages/cli/dist/tui/snr-engine.js
39415
+ import { existsSync as existsSync37, readdirSync as readdirSync13, readFileSync as readFileSync28 } from "node:fs";
39034
39416
  import { join as join48, basename as basename14 } from "node:path";
39035
39417
  function computeDPrime(signalScores, noiseScores) {
39036
39418
  if (signalScores.length === 0 || noiseScores.length === 0)
@@ -39089,7 +39471,7 @@ function adaptTool4(tool) {
39089
39471
  }
39090
39472
  var SNREngine;
39091
39473
  var init_snr_engine = __esm({
39092
- "packages/cli/dist/tui/snr-engine.js"() {
39474
+ "../packages/cli/dist/tui/snr-engine.js"() {
39093
39475
  "use strict";
39094
39476
  init_dist5();
39095
39477
  init_dist2();
@@ -39278,7 +39660,7 @@ Call task_complete with the JSON array when done.`, onEvent)
39278
39660
  if (!existsSync37(dir))
39279
39661
  continue;
39280
39662
  try {
39281
- const files = readdirSync12(dir).filter((f) => f.endsWith(".json"));
39663
+ const files = readdirSync13(dir).filter((f) => f.endsWith(".json"));
39282
39664
  for (const f of files) {
39283
39665
  const topic = basename14(f, ".json");
39284
39666
  if (topics.length > 0 && !topics.includes(topic))
@@ -39364,7 +39746,7 @@ Call task_complete with the JSON array when done.`, onEvent)
39364
39746
  }
39365
39747
  });
39366
39748
 
39367
- // packages/cli/dist/tui/emotion-engine.js
39749
+ // ../packages/cli/dist/tui/emotion-engine.js
39368
39750
  function labelFromCoordinates(valence, arousal) {
39369
39751
  if (valence > 0.6 && arousal > 0.6)
39370
39752
  return { label: "exhilarated", emoji: "\u{1F929}" };
@@ -39425,7 +39807,7 @@ function clamp(value, min, max) {
39425
39807
  }
39426
39808
  var BASELINE_VALENCE, BASELINE_AROUSAL, DECAY_HALF_LIFE_MS, LABEL_UPDATE_INTERVAL_MS, EXCITEMENT_THRESHOLD, DISTRESS_THRESHOLD, OUTREACH_COOLDOWN_MS, OUTREACH_MIN_STREAK, LABEL_REGEN_THRESHOLD, EmotionEngine;
39427
39809
  var init_emotion_engine = __esm({
39428
- "packages/cli/dist/tui/emotion-engine.js"() {
39810
+ "../packages/cli/dist/tui/emotion-engine.js"() {
39429
39811
  "use strict";
39430
39812
  init_dist5();
39431
39813
  init_promptLoader3();
@@ -39771,7 +40153,7 @@ var init_emotion_engine = __esm({
39771
40153
  }
39772
40154
  });
39773
40155
 
39774
- // packages/cli/dist/tui/tool-policy.js
40156
+ // ../packages/cli/dist/tui/tool-policy.js
39775
40157
  function getDefaultPolicy(context) {
39776
40158
  switch (context) {
39777
40159
  case "terminal":
@@ -39821,7 +40203,7 @@ function applyToolPolicy(tools, context, userConfig) {
39821
40203
  }
39822
40204
  var SAFE_PUBLIC_TOOLS, SAFE_GROUP_ADMIN_TOOLS;
39823
40205
  var init_tool_policy = __esm({
39824
- "packages/cli/dist/tui/tool-policy.js"() {
40206
+ "../packages/cli/dist/tui/tool-policy.js"() {
39825
40207
  "use strict";
39826
40208
  SAFE_PUBLIC_TOOLS = /* @__PURE__ */ new Set([
39827
40209
  "memory_read",
@@ -39850,8 +40232,8 @@ var init_tool_policy = __esm({
39850
40232
  }
39851
40233
  });
39852
40234
 
39853
- // packages/cli/dist/tui/telegram-bridge.js
39854
- import { mkdirSync as mkdirSync17, existsSync as existsSync38, unlinkSync as unlinkSync7, readdirSync as readdirSync13, statSync as statSync10 } from "node:fs";
40235
+ // ../packages/cli/dist/tui/telegram-bridge.js
40236
+ import { mkdirSync as mkdirSync17, existsSync as existsSync38, unlinkSync as unlinkSync7, readdirSync as readdirSync14, statSync as statSync10 } from "node:fs";
39855
40237
  import { join as join49, resolve as resolve27 } from "node:path";
39856
40238
  import { writeFile as writeFileAsync } from "node:fs/promises";
39857
40239
  function convertMarkdownToTelegramHTML(md) {
@@ -39987,7 +40369,7 @@ function renderTelegramSubAgentError(username, error) {
39987
40369
  }
39988
40370
  var TELEGRAM_SAFETY_PROMPT, ADMIN_DM_PROMPT, ADMIN_GROUP_PROMPT, GROUP_REPLY_DISCRETION_PROMPT, MEDIA_CACHE_TTL_MS, TelegramBridge;
39989
40371
  var init_telegram_bridge = __esm({
39990
- "packages/cli/dist/tui/telegram-bridge.js"() {
40372
+ "../packages/cli/dist/tui/telegram-bridge.js"() {
39991
40373
  "use strict";
39992
40374
  init_dist5();
39993
40375
  init_dist2();
@@ -41026,7 +41408,7 @@ ${caption}\r
41026
41408
  }
41027
41409
  });
41028
41410
 
41029
- // packages/cli/dist/tui/braille-spinner.js
41411
+ // ../packages/cli/dist/tui/braille-spinner.js
41030
41412
  function buildColorRamp(ramp) {
41031
41413
  return [...ramp, ...ramp.slice(1, -1).reverse()];
41032
41414
  }
@@ -41068,7 +41450,7 @@ function themeForTool(toolName) {
41068
41450
  }
41069
41451
  var DENSITY, WAVE, THEME_DEFAULT, THEME_FILE, THEME_SHELL, THEME_WEB, THEME_SEARCH, THEME_MEMORY, THEME_SKILL, THEME_TOOL_CREATE, THEME_DREAM, DEFAULT_METRICS, BrailleSpinner;
41070
41452
  var init_braille_spinner = __esm({
41071
- "packages/cli/dist/tui/braille-spinner.js"() {
41453
+ "../packages/cli/dist/tui/braille-spinner.js"() {
41072
41454
  "use strict";
41073
41455
  DENSITY = [
41074
41456
  "\u2800",
@@ -41265,10 +41647,10 @@ var init_braille_spinner = __esm({
41265
41647
  }
41266
41648
  });
41267
41649
 
41268
- // packages/cli/dist/tui/status-bar.js
41650
+ // ../packages/cli/dist/tui/status-bar.js
41269
41651
  var EXPERT_TOOL_BASELINES, CONTEXT_SWITCH_OVERHEAD, TURN_PLANNING_OVERHEAD, DEFAULT_TOOL_BASELINE, CODE_READ_CHARS_PER_SEC, PROSE_READ_CHARS_PER_SEC, MIN_CONTENT_FOR_READING, CODE_CONTENT_TOOLS, PROSE_CONTENT_TOOLS, HumanSpeedTracker, StatusBar;
41270
41652
  var init_status_bar = __esm({
41271
- "packages/cli/dist/tui/status-bar.js"() {
41653
+ "../packages/cli/dist/tui/status-bar.js"() {
41272
41654
  "use strict";
41273
41655
  init_render();
41274
41656
  init_braille_spinner();
@@ -42446,14 +42828,14 @@ var init_status_bar = __esm({
42446
42828
  }
42447
42829
  });
42448
42830
 
42449
- // packages/cli/dist/tui/interactive.js
42831
+ // ../packages/cli/dist/tui/interactive.js
42450
42832
  import * as readline2 from "node:readline";
42451
42833
  import { Writable } from "node:stream";
42452
42834
  import { cwd } from "node:process";
42453
42835
  import { resolve as resolve28, join as join50, dirname as dirname17, extname as extname9 } from "node:path";
42454
42836
  import { createRequire as createRequire2 } from "node:module";
42455
42837
  import { fileURLToPath as fileURLToPath12 } from "node:url";
42456
- import { readFileSync as readFileSync29, writeFileSync as writeFileSync16, appendFileSync as appendFileSync3, rmSync as rmSync2, readdirSync as readdirSync14, mkdirSync as mkdirSync18 } from "node:fs";
42838
+ import { readFileSync as readFileSync29, writeFileSync as writeFileSync16, appendFileSync as appendFileSync3, rmSync as rmSync2, readdirSync as readdirSync15, mkdirSync as mkdirSync18 } from "node:fs";
42457
42839
  import { existsSync as existsSync39 } from "node:fs";
42458
42840
  import { homedir as homedir13 } from "node:os";
42459
42841
  function formatTimeAgo(date) {
@@ -42692,7 +43074,7 @@ function gatherMemorySnippets(root) {
42692
43074
  if (!existsSync39(dir))
42693
43075
  continue;
42694
43076
  try {
42695
- for (const f of readdirSync14(dir).filter((f2) => f2.endsWith(".json"))) {
43077
+ for (const f of readdirSync15(dir).filter((f2) => f2.endsWith(".json"))) {
42696
43078
  const data = JSON.parse(readFileSync29(join50(dir, f), "utf-8"));
42697
43079
  for (const val of Object.values(data)) {
42698
43080
  const v = typeof val === "object" && val !== null && "value" in val ? String(val.value) : String(val);
@@ -44419,7 +44801,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
44419
44801
  getCallUrl() {
44420
44802
  return voiceSession?.tunnelUrl ?? null;
44421
44803
  },
44422
- async exposeStart(kindOrUrl, authKey) {
44804
+ async exposeStart(kindOrUrl, authKey, transport) {
44423
44805
  const knownKinds = ["ollama", "vllm", "llvm"];
44424
44806
  let kind;
44425
44807
  let targetUrl;
@@ -44429,8 +44811,43 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
44429
44811
  kind = "custom";
44430
44812
  targetUrl = kindOrUrl.includes("://") ? kindOrUrl : `http://${kindOrUrl}`;
44431
44813
  }
44432
- exposeGateway = new ExposeGateway({ kind, targetUrl, authKey, stateDir: join50(repoRoot, ".oa") });
44433
- exposeGateway.on("stats", (stats) => {
44814
+ const effectiveTransport = transport ?? "libp2p";
44815
+ if (effectiveTransport === "libp2p") {
44816
+ const nexusTool = new NexusTool(repoRoot);
44817
+ const p2pGateway = new ExposeP2PGateway({
44818
+ kind,
44819
+ targetUrl,
44820
+ authKey,
44821
+ stateDir: join50(repoRoot, ".oa")
44822
+ }, nexusTool);
44823
+ p2pGateway.on("stats", (stats) => {
44824
+ statusBar.setExposeStatus({
44825
+ status: stats.status,
44826
+ totalRequests: stats.totalRequests,
44827
+ activeConnections: stats.activeConnections,
44828
+ modelUsage: stats.modelUsage
44829
+ });
44830
+ });
44831
+ try {
44832
+ const peerId = await p2pGateway.start();
44833
+ exposeGateway = p2pGateway;
44834
+ writeContent(() => {
44835
+ process.stdout.write("\n" + p2pGateway.formatConnectionInfo() + "\n\n");
44836
+ });
44837
+ return peerId;
44838
+ } catch (err) {
44839
+ if (!transport) {
44840
+ writeContent(() => {
44841
+ renderWarning(`libp2p expose failed: ${err instanceof Error ? err.message : String(err)}`);
44842
+ renderInfo("Falling back to cloudflared tunnel...");
44843
+ });
44844
+ } else {
44845
+ throw err;
44846
+ }
44847
+ }
44848
+ }
44849
+ const tunnelGateway = new ExposeGateway({ kind, targetUrl, authKey, stateDir: join50(repoRoot, ".oa") });
44850
+ tunnelGateway.on("stats", (stats) => {
44434
44851
  statusBar.setExposeStatus({
44435
44852
  status: stats.status,
44436
44853
  totalRequests: stats.totalRequests,
@@ -44439,9 +44856,10 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
44439
44856
  });
44440
44857
  });
44441
44858
  try {
44442
- const url = await exposeGateway.start();
44859
+ const url = await tunnelGateway.start();
44860
+ exposeGateway = tunnelGateway;
44443
44861
  writeContent(() => {
44444
- process.stdout.write("\n" + exposeGateway.formatConnectionInfo() + "\n\n");
44862
+ process.stdout.write("\n" + tunnelGateway.formatConnectionInfo() + "\n\n");
44445
44863
  });
44446
44864
  return url;
44447
44865
  } catch (err) {
@@ -44462,12 +44880,31 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
44462
44880
  getExposeInfo() {
44463
44881
  if (!exposeGateway)
44464
44882
  return null;
44883
+ if (exposeGateway instanceof ExposeP2PGateway) {
44884
+ return {
44885
+ tunnelUrl: exposeGateway.peerId,
44886
+ authKey: exposeGateway.authKey,
44887
+ stats: exposeGateway.formatStats()
44888
+ };
44889
+ }
44465
44890
  return {
44466
44891
  tunnelUrl: exposeGateway.tunnelUrl,
44467
44892
  authKey: exposeGateway.authKey,
44468
44893
  stats: exposeGateway.formatStats()
44469
44894
  };
44470
44895
  },
44896
+ // ── Nexus daemon connect ──────────────────────────────────────────────
44897
+ async nexusConnect() {
44898
+ const nexusTool = new NexusTool(repoRoot);
44899
+ const result = await nexusTool.execute({
44900
+ action: "connect",
44901
+ agent_name: "open-agents-node",
44902
+ agent_type: "general"
44903
+ });
44904
+ if (!result.success)
44905
+ throw new Error(result.error || "Connect failed");
44906
+ return result.output;
44907
+ },
44471
44908
  // ── P2P mesh controls ────────────────────────────────────────────────
44472
44909
  async p2pStart(bootstrapPeers) {
44473
44910
  if (peerMesh)
@@ -45396,7 +45833,7 @@ async function runWithTUI(task, config, repoPath) {
45396
45833
  }
45397
45834
  var taskManager;
45398
45835
  var init_interactive = __esm({
45399
- "packages/cli/dist/tui/interactive.js"() {
45836
+ "../packages/cli/dist/tui/interactive.js"() {
45400
45837
  "use strict";
45401
45838
  init_dist5();
45402
45839
  init_dist5();
@@ -45433,7 +45870,7 @@ var init_interactive = __esm({
45433
45870
  }
45434
45871
  });
45435
45872
 
45436
- // packages/cli/dist/commands/run.js
45873
+ // ../packages/cli/dist/commands/run.js
45437
45874
  var run_exports = {};
45438
45875
  __export(run_exports, {
45439
45876
  runCommand: () => runCommand
@@ -45453,13 +45890,13 @@ async function runCommand(opts, config) {
45453
45890
  }
45454
45891
  }
45455
45892
  var init_run = __esm({
45456
- "packages/cli/dist/commands/run.js"() {
45893
+ "../packages/cli/dist/commands/run.js"() {
45457
45894
  "use strict";
45458
45895
  init_interactive();
45459
45896
  }
45460
45897
  });
45461
45898
 
45462
- // packages/indexer/dist/codebase-indexer.js
45899
+ // ../packages/indexer/dist/codebase-indexer.js
45463
45900
  import { glob } from "glob";
45464
45901
  import ignore from "ignore";
45465
45902
  import { readFile as readFile16, stat as stat4 } from "node:fs/promises";
@@ -45467,7 +45904,7 @@ import { createHash as createHash4 } from "node:crypto";
45467
45904
  import { join as join51, relative as relative3, extname as extname10, basename as basename15 } from "node:path";
45468
45905
  var DEFAULT_EXCLUDE, LANGUAGE_MAP, CodebaseIndexer;
45469
45906
  var init_codebase_indexer = __esm({
45470
- "packages/indexer/dist/codebase-indexer.js"() {
45907
+ "../packages/indexer/dist/codebase-indexer.js"() {
45471
45908
  "use strict";
45472
45909
  DEFAULT_EXCLUDE = [
45473
45910
  "node_modules",
@@ -45585,25 +46022,25 @@ var init_codebase_indexer = __esm({
45585
46022
  }
45586
46023
  });
45587
46024
 
45588
- // packages/indexer/dist/repoScanner.js
46025
+ // ../packages/indexer/dist/repoScanner.js
45589
46026
  import ignore2 from "ignore";
45590
46027
  var init_repoScanner = __esm({
45591
- "packages/indexer/dist/repoScanner.js"() {
46028
+ "../packages/indexer/dist/repoScanner.js"() {
45592
46029
  "use strict";
45593
46030
  }
45594
46031
  });
45595
46032
 
45596
- // packages/indexer/dist/symbolExtractor.js
46033
+ // ../packages/indexer/dist/symbolExtractor.js
45597
46034
  var init_symbolExtractor = __esm({
45598
- "packages/indexer/dist/symbolExtractor.js"() {
46035
+ "../packages/indexer/dist/symbolExtractor.js"() {
45599
46036
  "use strict";
45600
46037
  }
45601
46038
  });
45602
46039
 
45603
- // packages/indexer/dist/graphBuilder.js
46040
+ // ../packages/indexer/dist/graphBuilder.js
45604
46041
  var TS_EXTENSIONS, JS_EXTENSIONS, ALL_EXTENSIONS;
45605
46042
  var init_graphBuilder = __esm({
45606
- "packages/indexer/dist/graphBuilder.js"() {
46043
+ "../packages/indexer/dist/graphBuilder.js"() {
45607
46044
  "use strict";
45608
46045
  TS_EXTENSIONS = [".ts", ".tsx", ".mts", ".cts"];
45609
46046
  JS_EXTENSIONS = [".js", ".jsx", ".mjs", ".cjs"];
@@ -45611,30 +46048,30 @@ var init_graphBuilder = __esm({
45611
46048
  }
45612
46049
  });
45613
46050
 
45614
- // packages/indexer/dist/fileSummarizer.js
46051
+ // ../packages/indexer/dist/fileSummarizer.js
45615
46052
  var init_fileSummarizer = __esm({
45616
- "packages/indexer/dist/fileSummarizer.js"() {
46053
+ "../packages/indexer/dist/fileSummarizer.js"() {
45617
46054
  "use strict";
45618
46055
  }
45619
46056
  });
45620
46057
 
45621
- // packages/indexer/dist/embeddings.js
46058
+ // ../packages/indexer/dist/embeddings.js
45622
46059
  var init_embeddings = __esm({
45623
- "packages/indexer/dist/embeddings.js"() {
46060
+ "../packages/indexer/dist/embeddings.js"() {
45624
46061
  "use strict";
45625
46062
  }
45626
46063
  });
45627
46064
 
45628
- // packages/indexer/dist/ollamaEmbeddings.js
46065
+ // ../packages/indexer/dist/ollamaEmbeddings.js
45629
46066
  var init_ollamaEmbeddings = __esm({
45630
- "packages/indexer/dist/ollamaEmbeddings.js"() {
46067
+ "../packages/indexer/dist/ollamaEmbeddings.js"() {
45631
46068
  "use strict";
45632
46069
  }
45633
46070
  });
45634
46071
 
45635
- // packages/indexer/dist/index.js
46072
+ // ../packages/indexer/dist/index.js
45636
46073
  var init_dist8 = __esm({
45637
- "packages/indexer/dist/index.js"() {
46074
+ "../packages/indexer/dist/index.js"() {
45638
46075
  "use strict";
45639
46076
  init_codebase_indexer();
45640
46077
  init_repoScanner();
@@ -45646,7 +46083,7 @@ var init_dist8 = __esm({
45646
46083
  }
45647
46084
  });
45648
46085
 
45649
- // packages/cli/dist/commands/index-repo.js
46086
+ // ../packages/cli/dist/commands/index-repo.js
45650
46087
  var index_repo_exports = {};
45651
46088
  __export(index_repo_exports, {
45652
46089
  indexRepoCommand: () => indexRepoCommand
@@ -45739,7 +46176,7 @@ async function indexRepoCommand(opts, _config) {
45739
46176
  printSuccess("Repository indexed successfully");
45740
46177
  }
45741
46178
  var init_index_repo = __esm({
45742
- "packages/cli/dist/commands/index-repo.js"() {
46179
+ "../packages/cli/dist/commands/index-repo.js"() {
45743
46180
  "use strict";
45744
46181
  init_dist8();
45745
46182
  init_spinner();
@@ -45747,7 +46184,7 @@ var init_index_repo = __esm({
45747
46184
  }
45748
46185
  });
45749
46186
 
45750
- // packages/cli/dist/commands/status.js
46187
+ // ../packages/cli/dist/commands/status.js
45751
46188
  var status_exports = {};
45752
46189
  __export(status_exports, {
45753
46190
  statusCommand: () => statusCommand
@@ -45897,7 +46334,7 @@ async function statusVllm(opts, config) {
45897
46334
  printSuccess("vLLM backend is operational");
45898
46335
  }
45899
46336
  var init_status = __esm({
45900
- "packages/cli/dist/commands/status.js"() {
46337
+ "../packages/cli/dist/commands/status.js"() {
45901
46338
  "use strict";
45902
46339
  init_dist();
45903
46340
  init_spinner();
@@ -45905,7 +46342,7 @@ var init_status = __esm({
45905
46342
  }
45906
46343
  });
45907
46344
 
45908
- // packages/cli/dist/commands/config.js
46345
+ // ../packages/cli/dist/commands/config.js
45909
46346
  var config_exports = {};
45910
46347
  __export(config_exports, {
45911
46348
  configCommand: () => configCommand
@@ -46080,7 +46517,7 @@ function handleKeys() {
46080
46517
  }
46081
46518
  var CONFIG_KEYS, SENSITIVE_KEYS, INT_KEYS, BOOL_KEYS, ENUM_KEYS;
46082
46519
  var init_config3 = __esm({
46083
- "packages/cli/dist/commands/config.js"() {
46520
+ "../packages/cli/dist/commands/config.js"() {
46084
46521
  "use strict";
46085
46522
  init_config();
46086
46523
  init_oa_directory();
@@ -46127,7 +46564,7 @@ var init_config3 = __esm({
46127
46564
  }
46128
46565
  });
46129
46566
 
46130
- // packages/cli/dist/commands/serve.js
46567
+ // ../packages/cli/dist/commands/serve.js
46131
46568
  var serve_exports = {};
46132
46569
  __export(serve_exports, {
46133
46570
  serveCommand: () => serveCommand
@@ -46277,14 +46714,14 @@ async function runVllmServer(args, verbose) {
46277
46714
  });
46278
46715
  }
46279
46716
  var init_serve = __esm({
46280
- "packages/cli/dist/commands/serve.js"() {
46717
+ "../packages/cli/dist/commands/serve.js"() {
46281
46718
  "use strict";
46282
46719
  init_dist();
46283
46720
  init_output();
46284
46721
  }
46285
46722
  });
46286
46723
 
46287
- // packages/cli/dist/commands/eval.js
46724
+ // ../packages/cli/dist/commands/eval.js
46288
46725
  var eval_exports = {};
46289
46726
  __export(eval_exports, {
46290
46727
  evalCommand: () => evalCommand
@@ -46423,7 +46860,7 @@ function createTempEvalRepo() {
46423
46860
  }
46424
46861
  var BASIC_SUITE, FULL_SUITE, SUITES;
46425
46862
  var init_eval = __esm({
46426
- "packages/cli/dist/commands/eval.js"() {
46863
+ "../packages/cli/dist/commands/eval.js"() {
46427
46864
  "use strict";
46428
46865
  init_dist5();
46429
46866
  init_dist();
@@ -46471,7 +46908,7 @@ var init_eval = __esm({
46471
46908
  }
46472
46909
  });
46473
46910
 
46474
- // packages/cli/dist/index.js
46911
+ // ../packages/cli/dist/index.js
46475
46912
  init_config();
46476
46913
  init_output();
46477
46914
  init_updater();
@@ -46480,7 +46917,7 @@ import { createRequire as createRequire3 } from "node:module";
46480
46917
  import { fileURLToPath as fileURLToPath13 } from "node:url";
46481
46918
  import { dirname as dirname18, join as join54 } from "node:path";
46482
46919
 
46483
- // packages/cli/dist/cli.js
46920
+ // ../packages/cli/dist/cli.js
46484
46921
  import { createInterface } from "node:readline";
46485
46922
  function createCli(options) {
46486
46923
  return {
@@ -46519,10 +46956,10 @@ function createCli(options) {
46519
46956
  };
46520
46957
  }
46521
46958
 
46522
- // packages/cli/dist/args.js
46959
+ // ../packages/cli/dist/args.js
46523
46960
  import { parseArgs as nodeParseArgs } from "node:util";
46524
46961
 
46525
- // packages/cli/dist/types.js
46962
+ // ../packages/cli/dist/types.js
46526
46963
  var DEFAULT_OPTIONS = {
46527
46964
  model: "qwen-2.5-coder-32b",
46528
46965
  backendUrl: "http://localhost:8000/v1",
@@ -46532,7 +46969,7 @@ var DEFAULT_OPTIONS = {
46532
46969
  verbose: false
46533
46970
  };
46534
46971
 
46535
- // packages/cli/dist/args.js
46972
+ // ../packages/cli/dist/args.js
46536
46973
  function parseArgs(argv) {
46537
46974
  const { values } = nodeParseArgs({
46538
46975
  args: argv.slice(2),
@@ -46578,7 +47015,7 @@ Options:
46578
47015
  console.log(help.trim());
46579
47016
  }
46580
47017
 
46581
- // packages/cli/dist/index.js
47018
+ // ../packages/cli/dist/index.js
46582
47019
  init_config();
46583
47020
  init_spinner();
46584
47021
  init_output();