open-agents-ai 0.103.12 → 0.103.14

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 +968 -740
  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,
@@ -5422,8 +5422,8 @@ function deleteCustomToolDefinition(name, scope, repoRoot) {
5422
5422
  const dir = scope === "project" && repoRoot ? projectToolsDir(repoRoot) : globalToolsDir();
5423
5423
  const filePath = join13(dir, `${name}.json`);
5424
5424
  if (existsSync10(filePath)) {
5425
- const { unlinkSync: unlinkSync7 } = __require("node:fs");
5426
- unlinkSync7(filePath);
5425
+ const { unlinkSync: unlinkSync8 } = __require("node:fs");
5426
+ unlinkSync8(filePath);
5427
5427
  return true;
5428
5428
  }
5429
5429
  return false;
@@ -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";
@@ -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
  /**
@@ -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();
@@ -16290,8 +16290,8 @@ var init_verifierRunner = __esm({
16290
16290
  if (patch.testsToRun.length === 0)
16291
16291
  return "(no tests specified)";
16292
16292
  const { execFile: execFile6 } = await import("node:child_process");
16293
- const { promisify: promisify5 } = await import("node:util");
16294
- const execFileAsync5 = promisify5(execFile6);
16293
+ const { promisify: promisify6 } = await import("node:util");
16294
+ const execFileAsync5 = promisify6(execFile6);
16295
16295
  const outputs = [];
16296
16296
  const workDir = this.options.workingDir || repoRoot;
16297
16297
  for (const cmd of patch.testsToRun.slice(0, 3)) {
@@ -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();
@@ -18258,9 +18258,9 @@ ${marker}` : marker);
18258
18258
  if (!this._workingDirectory)
18259
18259
  return;
18260
18260
  try {
18261
- const { mkdirSync: mkdirSync19, writeFileSync: writeFileSync17 } = __require("node:fs");
18262
- const { join: join54 } = __require("node:path");
18263
- const sessionDir = join54(this._workingDirectory, ".oa", "session", this._sessionId);
18261
+ const { mkdirSync: mkdirSync19, writeFileSync: writeFileSync18 } = __require("node:fs");
18262
+ const { join: join55 } = __require("node:path");
18263
+ const sessionDir = join55(this._workingDirectory, ".oa", "session", this._sessionId);
18264
18264
  mkdirSync19(sessionDir, { recursive: true });
18265
18265
  const checkpoint = {
18266
18266
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
@@ -18273,7 +18273,7 @@ ${marker}` : marker);
18273
18273
  memexEntryCount: this._memexArchive.size,
18274
18274
  fileRegistrySize: this._fileRegistry.size
18275
18275
  };
18276
- writeFileSync17(join54(sessionDir, "checkpoint.json"), JSON.stringify(checkpoint, null, 2));
18276
+ writeFileSync18(join55(sessionDir, "checkpoint.json"), JSON.stringify(checkpoint, null, 2));
18277
18277
  } catch {
18278
18278
  }
18279
18279
  }
@@ -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,
@@ -20362,9 +20362,9 @@ function ensureTranscribeCliBackground() {
20362
20362
  } catch {
20363
20363
  }
20364
20364
  try {
20365
- const { exec: exec2 } = await import("node:child_process");
20365
+ const { exec: exec3 } = await import("node:child_process");
20366
20366
  return new Promise((resolve31) => {
20367
- exec2("npm i -g transcribe-cli", { timeout: 18e4 }, (err) => {
20367
+ exec3("npm i -g transcribe-cli", { timeout: 18e4 }, (err) => {
20368
20368
  resolve31(!err);
20369
20369
  });
20370
20370
  });
@@ -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",
@@ -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,13 +26196,15 @@ 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 } from "node:fs";
26207
+ import { join as join35 } from "node:path";
26206
26208
  function cleanForwardHeaders(raw, targetHost) {
26207
26209
  const out = {};
26208
26210
  for (const [key, value] of Object.entries(raw)) {
@@ -26221,6 +26223,40 @@ function cleanForwardHeaders(raw, targetHost) {
26221
26223
  out.host = targetHost;
26222
26224
  return out;
26223
26225
  }
26226
+ function readExposeState(stateDir) {
26227
+ try {
26228
+ const path = join35(stateDir, STATE_FILE_NAME);
26229
+ if (!existsSync26(path))
26230
+ return null;
26231
+ const raw = readFileSync18(path, "utf8");
26232
+ const data = JSON.parse(raw);
26233
+ if (!data.pid || !data.tunnelUrl || !data.authKey || !data.proxyPort)
26234
+ return null;
26235
+ return data;
26236
+ } catch {
26237
+ return null;
26238
+ }
26239
+ }
26240
+ function writeExposeState(stateDir, state) {
26241
+ try {
26242
+ writeFileSync8(join35(stateDir, STATE_FILE_NAME), JSON.stringify(state, null, 2));
26243
+ } catch {
26244
+ }
26245
+ }
26246
+ function removeExposeState(stateDir) {
26247
+ try {
26248
+ unlinkSync3(join35(stateDir, STATE_FILE_NAME));
26249
+ } catch {
26250
+ }
26251
+ }
26252
+ function isProcessAlive(pid) {
26253
+ try {
26254
+ process.kill(pid, 0);
26255
+ return true;
26256
+ } catch {
26257
+ return false;
26258
+ }
26259
+ }
26224
26260
  async function collectSystemMetricsAsync() {
26225
26261
  const [l1, l5, l15] = loadavg();
26226
26262
  const cores = cpus().length;
@@ -26269,9 +26305,9 @@ async function collectSystemMetricsAsync() {
26269
26305
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
26270
26306
  };
26271
26307
  }
26272
- var HOP_BY_HOP_HEADERS, CF_HEADERS_PREFIX, DEFAULT_TARGETS, ExposeGateway;
26308
+ var HOP_BY_HOP_HEADERS, CF_HEADERS_PREFIX, DEFAULT_TARGETS, STATE_FILE_NAME, ExposeGateway;
26273
26309
  var init_expose = __esm({
26274
- "../packages/cli/dist/tui/expose.js"() {
26310
+ "packages/cli/dist/tui/expose.js"() {
26275
26311
  "use strict";
26276
26312
  init_render();
26277
26313
  HOP_BY_HOP_HEADERS = /* @__PURE__ */ new Set([
@@ -26291,14 +26327,18 @@ var init_expose = __esm({
26291
26327
  llvm: "http://127.0.0.1:8080",
26292
26328
  custom: "http://127.0.0.1:11434"
26293
26329
  };
26294
- ExposeGateway = class extends EventEmitter3 {
26330
+ STATE_FILE_NAME = "expose-state.json";
26331
+ ExposeGateway = class _ExposeGateway extends EventEmitter3 {
26295
26332
  options;
26296
26333
  server = null;
26297
26334
  cloudflaredProcess = null;
26335
+ /** PID of detached cloudflared (for killing on stop, even across OA restarts) */
26336
+ _cloudflaredPid = null;
26298
26337
  _tunnelUrl = null;
26299
26338
  _authKey;
26300
26339
  _targetUrl;
26301
26340
  _kind;
26341
+ _stateDir;
26302
26342
  _stats = {
26303
26343
  status: "standby",
26304
26344
  totalRequests: 0,
@@ -26326,6 +26366,7 @@ var init_expose = __esm({
26326
26366
  this.options = options;
26327
26367
  this._kind = options.kind;
26328
26368
  this._targetUrl = options.targetUrl ?? DEFAULT_TARGETS[options.kind];
26369
+ this._stateDir = options.stateDir ?? null;
26329
26370
  if (options.authKey === void 0 || options.authKey === "") {
26330
26371
  this._authKey = randomBytes7(24).toString("base64url");
26331
26372
  } else {
@@ -26345,24 +26386,101 @@ var init_expose = __esm({
26345
26386
  this._tunnelUrl = await this.startCloudflared(port);
26346
26387
  this._stats.status = "active";
26347
26388
  this.emitStats();
26389
+ if (this._stateDir) {
26390
+ writeExposeState(this._stateDir, {
26391
+ pid: this._cloudflaredPid,
26392
+ tunnelUrl: this._tunnelUrl,
26393
+ authKey: this._authKey,
26394
+ proxyPort: port,
26395
+ targetUrl: this._targetUrl,
26396
+ kind: this._kind,
26397
+ startedAt: (/* @__PURE__ */ new Date()).toISOString()
26398
+ });
26399
+ }
26400
+ return this._tunnelUrl;
26401
+ }
26402
+ /**
26403
+ * Reconnect to an existing detached cloudflared tunnel from a previous
26404
+ * OA session. Starts the proxy on the same port so cloudflared routes
26405
+ * traffic to it seamlessly.
26406
+ */
26407
+ async reconnect(state) {
26408
+ if (this.server)
26409
+ throw new Error("Gateway already running");
26410
+ if (!isProcessAlive(state.pid)) {
26411
+ if (this._stateDir)
26412
+ removeExposeState(this._stateDir);
26413
+ throw new Error("Cloudflared process is no longer running");
26414
+ }
26415
+ this._tunnelUrl = state.tunnelUrl;
26416
+ this._authKey = state.authKey;
26417
+ this._targetUrl = state.targetUrl;
26418
+ this._kind = state.kind;
26419
+ this._cloudflaredPid = state.pid;
26420
+ this._proxyPort = state.proxyPort;
26421
+ this.server = this.createProxyServer(state.proxyPort);
26422
+ await new Promise((resolve31, reject) => {
26423
+ this.server.listen(state.proxyPort, "127.0.0.1", () => resolve31());
26424
+ this.server.on("error", reject);
26425
+ });
26426
+ this._stats.status = "active";
26427
+ this.emitStats();
26348
26428
  return this._tunnelUrl;
26349
26429
  }
26350
26430
  async stop() {
26431
+ if (this._cloudflaredPid && isProcessAlive(this._cloudflaredPid)) {
26432
+ try {
26433
+ process.kill(this._cloudflaredPid, "SIGTERM");
26434
+ } catch {
26435
+ }
26436
+ }
26351
26437
  if (this.cloudflaredProcess) {
26352
- this.cloudflaredProcess.kill("SIGTERM");
26438
+ try {
26439
+ this.cloudflaredProcess.kill("SIGTERM");
26440
+ } catch {
26441
+ }
26353
26442
  this.cloudflaredProcess = null;
26354
26443
  }
26444
+ this._cloudflaredPid = null;
26355
26445
  if (this.server) {
26356
26446
  await new Promise((resolve31) => {
26357
26447
  this.server.close(() => resolve31());
26358
26448
  });
26359
26449
  this.server = null;
26360
26450
  }
26451
+ if (this._stateDir)
26452
+ removeExposeState(this._stateDir);
26361
26453
  this._tunnelUrl = null;
26362
26454
  this._stats.status = "standby";
26363
26455
  this._stats.activeConnections = 0;
26364
26456
  this.emitStats();
26365
26457
  }
26458
+ /**
26459
+ * Check for and reconnect to a surviving expose tunnel from a previous session.
26460
+ * Returns the gateway if reconnection succeeded, or null if no valid state found.
26461
+ */
26462
+ static async checkAndReconnect(stateDir, options) {
26463
+ const state = readExposeState(stateDir);
26464
+ if (!state)
26465
+ return null;
26466
+ if (!isProcessAlive(state.pid)) {
26467
+ removeExposeState(stateDir);
26468
+ return null;
26469
+ }
26470
+ const gateway = new _ExposeGateway({
26471
+ kind: state.kind,
26472
+ targetUrl: state.targetUrl,
26473
+ authKey: state.authKey,
26474
+ stateDir,
26475
+ ...options
26476
+ });
26477
+ try {
26478
+ await gateway.reconnect(state);
26479
+ return gateway;
26480
+ } catch {
26481
+ return null;
26482
+ }
26483
+ }
26366
26484
  // ── Proxy server ────────────────────────────────────────────────────────
26367
26485
  createProxyServer(localPort) {
26368
26486
  const target = new URL2(this._targetUrl);
@@ -26539,8 +26657,10 @@ var init_expose = __esm({
26539
26657
  "--proxy-keepalive-timeout",
26540
26658
  "300s"
26541
26659
  ], {
26660
+ detached: true,
26542
26661
  stdio: ["ignore", "pipe", "pipe"]
26543
26662
  });
26663
+ this._cloudflaredPid = this.cloudflaredProcess.pid ?? null;
26544
26664
  let urlFound = false;
26545
26665
  const handleOutput = (data) => {
26546
26666
  const text = data.toString();
@@ -26548,6 +26668,9 @@ var init_expose = __esm({
26548
26668
  if (urlMatch && !urlFound) {
26549
26669
  urlFound = true;
26550
26670
  clearTimeout(timeout);
26671
+ this.cloudflaredProcess?.unref();
26672
+ this.cloudflaredProcess?.stdout?.destroy();
26673
+ this.cloudflaredProcess?.stderr?.destroy();
26551
26674
  resolve31(urlMatch[0]);
26552
26675
  }
26553
26676
  };
@@ -26580,6 +26703,17 @@ var init_expose = __esm({
26580
26703
  this._stats.status = "active";
26581
26704
  this.emitStats();
26582
26705
  this.options.onInfo?.(`Tunnel restarted: ${this._tunnelUrl}`);
26706
+ if (this._stateDir) {
26707
+ writeExposeState(this._stateDir, {
26708
+ pid: this._cloudflaredPid,
26709
+ tunnelUrl: this._tunnelUrl,
26710
+ authKey: this._authKey,
26711
+ proxyPort: this._proxyPort,
26712
+ targetUrl: this._targetUrl,
26713
+ kind: this._kind,
26714
+ startedAt: (/* @__PURE__ */ new Date()).toISOString()
26715
+ });
26716
+ }
26583
26717
  } catch (err) {
26584
26718
  this.options.onError?.(`Tunnel restart failed: ${err instanceof Error ? err.message : String(err)}`);
26585
26719
  }
@@ -26605,6 +26739,7 @@ var init_expose = __esm({
26605
26739
  }
26606
26740
  /** Format connection info for display */
26607
26741
  formatConnectionInfo() {
26742
+ const endpointCmd = `/endpoint ${this._tunnelUrl ?? "<tunnel-url>"} --auth ${this._authKey}`;
26608
26743
  const lines = [];
26609
26744
  lines.push(` ${c2.green("\u25CF")} Expose gateway active`);
26610
26745
  lines.push(` ${c2.cyan("Backend".padEnd(12))} ${this._kind} (${this._targetUrl})`);
@@ -26612,9 +26747,14 @@ var init_expose = __esm({
26612
26747
  lines.push(` ${c2.cyan("Auth Key".padEnd(12))} ${c2.bold(this._authKey)}`);
26613
26748
  lines.push("");
26614
26749
  lines.push(` ${c2.dim("Remote users connect with:")}`);
26615
- lines.push(` ${c2.bold(`/endpoint ${this._tunnelUrl ?? "<tunnel-url>"} --auth ${this._authKey}`)}`);
26750
+ lines.push(` ${c2.bold(endpointCmd)}`);
26616
26751
  lines.push("");
26617
26752
  lines.push(` ${c2.yellow("!")} ${c2.dim("Keep this key secure \u2014 it grants full access to your models.")}`);
26753
+ if ((process.stdout.isTTY ?? false) && this._tunnelUrl) {
26754
+ const b64 = Buffer.from(endpointCmd).toString("base64");
26755
+ lines.push(`\x1B]52;c;${b64}\x07`);
26756
+ lines.push(` ${c2.dim("(copied to clipboard)")}`);
26757
+ }
26618
26758
  return lines.join("\n");
26619
26759
  }
26620
26760
  /** Format usage stats for display */
@@ -26638,25 +26778,25 @@ var init_expose = __esm({
26638
26778
  }
26639
26779
  });
26640
26780
 
26641
- // ../packages/cli/dist/tui/p2p/types.js
26781
+ // packages/cli/dist/tui/p2p/types.js
26642
26782
  function trustLevel(tier) {
26643
26783
  return TRUST_ORDER.indexOf(tier);
26644
26784
  }
26645
26785
  var TRUST_ORDER;
26646
26786
  var init_types = __esm({
26647
- "../packages/cli/dist/tui/p2p/types.js"() {
26787
+ "packages/cli/dist/tui/p2p/types.js"() {
26648
26788
  "use strict";
26649
26789
  TRUST_ORDER = ["public", "verified", "tee", "local"];
26650
26790
  }
26651
26791
  });
26652
26792
 
26653
- // ../packages/cli/dist/tui/p2p/secret-vault.js
26793
+ // packages/cli/dist/tui/p2p/secret-vault.js
26654
26794
  import { createCipheriv as createCipheriv2, createDecipheriv as createDecipheriv2, randomBytes as randomBytes8, scryptSync as scryptSync2, createHash as createHash2 } from "node:crypto";
26655
- import { readFileSync as readFileSync18, writeFileSync as writeFileSync8, existsSync as existsSync26, mkdirSync as mkdirSync8 } from "node:fs";
26656
- import { join as join35, dirname as dirname13 } from "node:path";
26795
+ import { readFileSync as readFileSync19, writeFileSync as writeFileSync9, existsSync as existsSync27, mkdirSync as mkdirSync8 } from "node:fs";
26796
+ import { join as join36, dirname as dirname13 } from "node:path";
26657
26797
  var PLACEHOLDER_PREFIX, PLACEHOLDER_SUFFIX, CIPHER_ALGO, SALT_LEN, IV_LEN, KEY_LEN, SecretVault;
26658
26798
  var init_secret_vault = __esm({
26659
- "../packages/cli/dist/tui/p2p/secret-vault.js"() {
26799
+ "packages/cli/dist/tui/p2p/secret-vault.js"() {
26660
26800
  "use strict";
26661
26801
  init_types();
26662
26802
  PLACEHOLDER_PREFIX = "{{OA_VAR_";
@@ -26865,18 +27005,18 @@ var init_secret_vault = __esm({
26865
27005
  const tag = cipher.getAuthTag();
26866
27006
  const blob = Buffer.concat([salt, iv, tag, encrypted]);
26867
27007
  const dir = dirname13(this.storePath);
26868
- if (!existsSync26(dir))
27008
+ if (!existsSync27(dir))
26869
27009
  mkdirSync8(dir, { recursive: true });
26870
- writeFileSync8(this.storePath, blob, { mode: 384 });
27010
+ writeFileSync9(this.storePath, blob, { mode: 384 });
26871
27011
  }
26872
27012
  /**
26873
27013
  * Load vault from disk, decrypting with the given passphrase.
26874
27014
  * Returns the number of secrets loaded.
26875
27015
  */
26876
27016
  load(passphrase) {
26877
- if (!this.storePath || !existsSync26(this.storePath))
27017
+ if (!this.storePath || !existsSync27(this.storePath))
26878
27018
  return 0;
26879
- const blob = readFileSync18(this.storePath);
27019
+ const blob = readFileSync19(this.storePath);
26880
27020
  if (blob.length < SALT_LEN + IV_LEN + 16) {
26881
27021
  throw new Error("Vault file is corrupted (too small)");
26882
27022
  }
@@ -26914,13 +27054,13 @@ var init_secret_vault = __esm({
26914
27054
  }
26915
27055
  });
26916
27056
 
26917
- // ../packages/cli/dist/tui/p2p/peer-mesh.js
27057
+ // packages/cli/dist/tui/p2p/peer-mesh.js
26918
27058
  import { EventEmitter as EventEmitter4 } from "node:events";
26919
27059
  import { createServer as createServer3 } from "node:http";
26920
27060
  import { randomBytes as randomBytes9, createHash as createHash3, generateKeyPairSync } from "node:crypto";
26921
27061
  var PING_INTERVAL_MS, PEER_TIMEOUT_MS, GOSSIP_INTERVAL_MS, MAX_PEERS, PeerMesh;
26922
27062
  var init_peer_mesh = __esm({
26923
- "../packages/cli/dist/tui/p2p/peer-mesh.js"() {
27063
+ "packages/cli/dist/tui/p2p/peer-mesh.js"() {
26924
27064
  "use strict";
26925
27065
  init_wrapper();
26926
27066
  PING_INTERVAL_MS = 3e4;
@@ -27379,11 +27519,11 @@ var init_peer_mesh = __esm({
27379
27519
  }
27380
27520
  });
27381
27521
 
27382
- // ../packages/cli/dist/tui/p2p/inference-router.js
27522
+ // packages/cli/dist/tui/p2p/inference-router.js
27383
27523
  import { EventEmitter as EventEmitter5 } from "node:events";
27384
27524
  var TRUST_WEIGHTS, InferenceRouter;
27385
27525
  var init_inference_router = __esm({
27386
- "../packages/cli/dist/tui/p2p/inference-router.js"() {
27526
+ "packages/cli/dist/tui/p2p/inference-router.js"() {
27387
27527
  "use strict";
27388
27528
  init_types();
27389
27529
  TRUST_WEIGHTS = {
@@ -27577,9 +27717,9 @@ var init_inference_router = __esm({
27577
27717
  }
27578
27718
  });
27579
27719
 
27580
- // ../packages/cli/dist/tui/p2p/index.js
27720
+ // packages/cli/dist/tui/p2p/index.js
27581
27721
  var init_p2p = __esm({
27582
- "../packages/cli/dist/tui/p2p/index.js"() {
27722
+ "packages/cli/dist/tui/p2p/index.js"() {
27583
27723
  "use strict";
27584
27724
  init_secret_vault();
27585
27725
  init_peer_mesh();
@@ -27588,7 +27728,7 @@ var init_p2p = __esm({
27588
27728
  }
27589
27729
  });
27590
27730
 
27591
- // ../packages/cli/dist/tui/call-agent.js
27731
+ // packages/cli/dist/tui/call-agent.js
27592
27732
  import { EventEmitter as EventEmitter6 } from "node:events";
27593
27733
  import crypto2 from "node:crypto";
27594
27734
  function adaptTool(tool) {
@@ -27612,7 +27752,7 @@ function generateSessionKey() {
27612
27752
  }
27613
27753
  var ActivityFeed, _globalFeed, CallSubAgent;
27614
27754
  var init_call_agent = __esm({
27615
- "../packages/cli/dist/tui/call-agent.js"() {
27755
+ "packages/cli/dist/tui/call-agent.js"() {
27616
27756
  "use strict";
27617
27757
  init_dist5();
27618
27758
  init_dist2();
@@ -27870,7 +28010,7 @@ ${activitySummary}
27870
28010
  }
27871
28011
  });
27872
28012
 
27873
- // ../packages/cli/dist/tui/model-picker.js
28013
+ // packages/cli/dist/tui/model-picker.js
27874
28014
  async function fetchOllamaModels(baseUrl) {
27875
28015
  const url = `${normalizeBaseUrl(baseUrl)}/api/tags`;
27876
28016
  const resp = await fetch(url, {
@@ -28075,38 +28215,38 @@ function formatRelativeTime(iso) {
28075
28215
  return `${months}mo ago`;
28076
28216
  }
28077
28217
  var init_model_picker = __esm({
28078
- "../packages/cli/dist/tui/model-picker.js"() {
28218
+ "packages/cli/dist/tui/model-picker.js"() {
28079
28219
  "use strict";
28080
28220
  init_dist();
28081
28221
  }
28082
28222
  });
28083
28223
 
28084
- // ../packages/prompts/dist/loader.js
28224
+ // packages/prompts/dist/loader.js
28085
28225
  var init_loader = __esm({
28086
- "../packages/prompts/dist/loader.js"() {
28226
+ "packages/prompts/dist/loader.js"() {
28087
28227
  "use strict";
28088
28228
  }
28089
28229
  });
28090
28230
 
28091
- // ../packages/prompts/dist/render.js
28231
+ // packages/prompts/dist/render.js
28092
28232
  var init_render2 = __esm({
28093
- "../packages/prompts/dist/render.js"() {
28233
+ "packages/prompts/dist/render.js"() {
28094
28234
  "use strict";
28095
28235
  }
28096
28236
  });
28097
28237
 
28098
- // ../packages/prompts/dist/promptLoader.js
28099
- import { readFileSync as readFileSync19, existsSync as existsSync27 } from "node:fs";
28100
- import { join as join36, dirname as dirname14 } from "node:path";
28238
+ // packages/prompts/dist/promptLoader.js
28239
+ import { readFileSync as readFileSync20, existsSync as existsSync28 } from "node:fs";
28240
+ import { join as join37, dirname as dirname14 } from "node:path";
28101
28241
  import { fileURLToPath as fileURLToPath9 } from "node:url";
28102
28242
  function loadPrompt2(promptPath, vars) {
28103
28243
  let content = cache2.get(promptPath);
28104
28244
  if (content === void 0) {
28105
- const fullPath = join36(PROMPTS_DIR2, promptPath);
28106
- if (!existsSync27(fullPath)) {
28245
+ const fullPath = join37(PROMPTS_DIR2, promptPath);
28246
+ if (!existsSync28(fullPath)) {
28107
28247
  throw new Error(`Prompt file not found: ${fullPath}`);
28108
28248
  }
28109
- content = readFileSync19(fullPath, "utf-8");
28249
+ content = readFileSync20(fullPath, "utf-8");
28110
28250
  cache2.set(promptPath, content);
28111
28251
  }
28112
28252
  if (!vars)
@@ -28115,18 +28255,18 @@ function loadPrompt2(promptPath, vars) {
28115
28255
  }
28116
28256
  var __filename2, __dirname5, devPath, publishedPath, PROMPTS_DIR2, cache2;
28117
28257
  var init_promptLoader2 = __esm({
28118
- "../packages/prompts/dist/promptLoader.js"() {
28258
+ "packages/prompts/dist/promptLoader.js"() {
28119
28259
  "use strict";
28120
28260
  __filename2 = fileURLToPath9(import.meta.url);
28121
28261
  __dirname5 = dirname14(__filename2);
28122
- devPath = join36(__dirname5, "..", "templates");
28123
- publishedPath = join36(__dirname5, "..", "prompts", "templates");
28124
- PROMPTS_DIR2 = existsSync27(devPath) ? devPath : publishedPath;
28262
+ devPath = join37(__dirname5, "..", "templates");
28263
+ publishedPath = join37(__dirname5, "..", "prompts", "templates");
28264
+ PROMPTS_DIR2 = existsSync28(devPath) ? devPath : publishedPath;
28125
28265
  cache2 = /* @__PURE__ */ new Map();
28126
28266
  }
28127
28267
  });
28128
28268
 
28129
- // ../packages/prompts/dist/task-templates.js
28269
+ // packages/prompts/dist/task-templates.js
28130
28270
  function getTaskTemplate(type) {
28131
28271
  return TEMPLATES[type];
28132
28272
  }
@@ -28142,7 +28282,7 @@ ${template.outputGuidance}`;
28142
28282
  }
28143
28283
  var TEMPLATES;
28144
28284
  var init_task_templates = __esm({
28145
- "../packages/prompts/dist/task-templates.js"() {
28285
+ "packages/prompts/dist/task-templates.js"() {
28146
28286
  "use strict";
28147
28287
  init_promptLoader2();
28148
28288
  TEMPLATES = {
@@ -28231,38 +28371,38 @@ var init_task_templates = __esm({
28231
28371
  }
28232
28372
  });
28233
28373
 
28234
- // ../packages/prompts/dist/index.js
28235
- import { join as join37, dirname as dirname15 } from "node:path";
28374
+ // packages/prompts/dist/index.js
28375
+ import { join as join38, dirname as dirname15 } from "node:path";
28236
28376
  import { fileURLToPath as fileURLToPath10 } from "node:url";
28237
28377
  var _dir, _packageRoot;
28238
28378
  var init_dist6 = __esm({
28239
- "../packages/prompts/dist/index.js"() {
28379
+ "packages/prompts/dist/index.js"() {
28240
28380
  "use strict";
28241
28381
  init_loader();
28242
28382
  init_render2();
28243
28383
  init_task_templates();
28244
28384
  init_render2();
28245
28385
  _dir = dirname15(fileURLToPath10(import.meta.url));
28246
- _packageRoot = join37(_dir, "..");
28386
+ _packageRoot = join38(_dir, "..");
28247
28387
  }
28248
28388
  });
28249
28389
 
28250
- // ../packages/cli/dist/tui/oa-directory.js
28251
- import { existsSync as existsSync28, mkdirSync as mkdirSync9, readFileSync as readFileSync20, writeFileSync as writeFileSync9, readdirSync as readdirSync7, statSync as statSync9, unlinkSync as unlinkSync3 } from "node:fs";
28252
- import { join as join38, relative as relative2, basename as basename9, extname as extname8 } from "node:path";
28390
+ // packages/cli/dist/tui/oa-directory.js
28391
+ import { existsSync as existsSync29, mkdirSync as mkdirSync9, readFileSync as readFileSync21, writeFileSync as writeFileSync10, readdirSync as readdirSync7, statSync as statSync9, unlinkSync as unlinkSync4 } from "node:fs";
28392
+ import { join as join39, relative as relative2, basename as basename9, extname as extname8 } from "node:path";
28253
28393
  import { homedir as homedir9 } from "node:os";
28254
28394
  function initOaDirectory(repoRoot) {
28255
- const oaPath = join38(repoRoot, OA_DIR);
28395
+ const oaPath = join39(repoRoot, OA_DIR);
28256
28396
  for (const sub of SUBDIRS) {
28257
- mkdirSync9(join38(oaPath, sub), { recursive: true });
28397
+ mkdirSync9(join39(oaPath, sub), { recursive: true });
28258
28398
  }
28259
28399
  try {
28260
- const gitignorePath = join38(repoRoot, ".gitignore");
28400
+ const gitignorePath = join39(repoRoot, ".gitignore");
28261
28401
  const settingsPattern = ".oa/settings.json";
28262
- if (existsSync28(gitignorePath)) {
28263
- const content = readFileSync20(gitignorePath, "utf-8");
28402
+ if (existsSync29(gitignorePath)) {
28403
+ const content = readFileSync21(gitignorePath, "utf-8");
28264
28404
  if (!content.includes(settingsPattern)) {
28265
- writeFileSync9(gitignorePath, content.trimEnd() + "\n" + settingsPattern + "\n", "utf-8");
28405
+ writeFileSync10(gitignorePath, content.trimEnd() + "\n" + settingsPattern + "\n", "utf-8");
28266
28406
  }
28267
28407
  }
28268
28408
  } catch {
@@ -28270,41 +28410,41 @@ function initOaDirectory(repoRoot) {
28270
28410
  return oaPath;
28271
28411
  }
28272
28412
  function hasOaDirectory(repoRoot) {
28273
- return existsSync28(join38(repoRoot, OA_DIR, "index"));
28413
+ return existsSync29(join39(repoRoot, OA_DIR, "index"));
28274
28414
  }
28275
28415
  function loadProjectSettings(repoRoot) {
28276
- const settingsPath = join38(repoRoot, OA_DIR, "settings.json");
28416
+ const settingsPath = join39(repoRoot, OA_DIR, "settings.json");
28277
28417
  try {
28278
- if (existsSync28(settingsPath)) {
28279
- return JSON.parse(readFileSync20(settingsPath, "utf-8"));
28418
+ if (existsSync29(settingsPath)) {
28419
+ return JSON.parse(readFileSync21(settingsPath, "utf-8"));
28280
28420
  }
28281
28421
  } catch {
28282
28422
  }
28283
28423
  return {};
28284
28424
  }
28285
28425
  function saveProjectSettings(repoRoot, settings) {
28286
- const oaPath = join38(repoRoot, OA_DIR);
28426
+ const oaPath = join39(repoRoot, OA_DIR);
28287
28427
  mkdirSync9(oaPath, { recursive: true });
28288
28428
  const existing = loadProjectSettings(repoRoot);
28289
28429
  const merged = { ...existing, ...settings };
28290
- writeFileSync9(join38(oaPath, "settings.json"), JSON.stringify(merged, null, 2) + "\n", { encoding: "utf-8", mode: 384 });
28430
+ writeFileSync10(join39(oaPath, "settings.json"), JSON.stringify(merged, null, 2) + "\n", { encoding: "utf-8", mode: 384 });
28291
28431
  }
28292
28432
  function loadGlobalSettings() {
28293
- const settingsPath = join38(homedir9(), ".open-agents", "settings.json");
28433
+ const settingsPath = join39(homedir9(), ".open-agents", "settings.json");
28294
28434
  try {
28295
- if (existsSync28(settingsPath)) {
28296
- return JSON.parse(readFileSync20(settingsPath, "utf-8"));
28435
+ if (existsSync29(settingsPath)) {
28436
+ return JSON.parse(readFileSync21(settingsPath, "utf-8"));
28297
28437
  }
28298
28438
  } catch {
28299
28439
  }
28300
28440
  return {};
28301
28441
  }
28302
28442
  function saveGlobalSettings(settings) {
28303
- const dir = join38(homedir9(), ".open-agents");
28443
+ const dir = join39(homedir9(), ".open-agents");
28304
28444
  mkdirSync9(dir, { recursive: true });
28305
28445
  const existing = loadGlobalSettings();
28306
28446
  const merged = { ...existing, ...settings };
28307
- writeFileSync9(join38(dir, "settings.json"), JSON.stringify(merged, null, 2) + "\n", { encoding: "utf-8", mode: 384 });
28447
+ writeFileSync10(join39(dir, "settings.json"), JSON.stringify(merged, null, 2) + "\n", { encoding: "utf-8", mode: 384 });
28308
28448
  }
28309
28449
  function resolveSettings(repoRoot) {
28310
28450
  const global = loadGlobalSettings();
@@ -28319,12 +28459,12 @@ function discoverContextFiles(repoRoot, maxContentLen = 8e3) {
28319
28459
  while (dir && !visited.has(dir)) {
28320
28460
  visited.add(dir);
28321
28461
  for (const name of CONTEXT_FILES) {
28322
- const filePath = join38(dir, name);
28462
+ const filePath = join39(dir, name);
28323
28463
  const normalizedName = name.toLowerCase();
28324
- if (existsSync28(filePath) && !seen.has(filePath)) {
28464
+ if (existsSync29(filePath) && !seen.has(filePath)) {
28325
28465
  seen.add(filePath);
28326
28466
  try {
28327
- let content = readFileSync20(filePath, "utf-8");
28467
+ let content = readFileSync21(filePath, "utf-8");
28328
28468
  if (content.length > maxContentLen) {
28329
28469
  content = content.slice(0, maxContentLen) + "\n\n...(truncated)";
28330
28470
  }
@@ -28338,11 +28478,11 @@ function discoverContextFiles(repoRoot, maxContentLen = 8e3) {
28338
28478
  }
28339
28479
  }
28340
28480
  }
28341
- const projectMap = join38(dir, OA_DIR, "context", "project-map.md");
28342
- if (existsSync28(projectMap) && !seen.has(projectMap)) {
28481
+ const projectMap = join39(dir, OA_DIR, "context", "project-map.md");
28482
+ if (existsSync29(projectMap) && !seen.has(projectMap)) {
28343
28483
  seen.add(projectMap);
28344
28484
  try {
28345
- let content = readFileSync20(projectMap, "utf-8");
28485
+ let content = readFileSync21(projectMap, "utf-8");
28346
28486
  if (content.length > maxContentLen) {
28347
28487
  content = content.slice(0, maxContentLen) + "\n\n...(truncated)";
28348
28488
  }
@@ -28354,7 +28494,7 @@ function discoverContextFiles(repoRoot, maxContentLen = 8e3) {
28354
28494
  } catch {
28355
28495
  }
28356
28496
  }
28357
- const parent = join38(dir, "..");
28497
+ const parent = join39(dir, "..");
28358
28498
  if (parent === dir)
28359
28499
  break;
28360
28500
  dir = parent;
@@ -28372,9 +28512,9 @@ function discoverContextFiles(repoRoot, maxContentLen = 8e3) {
28372
28512
  return found;
28373
28513
  }
28374
28514
  function readIndexMeta(repoRoot) {
28375
- const metaPath = join38(repoRoot, OA_DIR, "index", "meta.json");
28515
+ const metaPath = join39(repoRoot, OA_DIR, "index", "meta.json");
28376
28516
  try {
28377
- return JSON.parse(readFileSync20(metaPath, "utf-8"));
28517
+ return JSON.parse(readFileSync21(metaPath, "utf-8"));
28378
28518
  } catch {
28379
28519
  return null;
28380
28520
  }
@@ -28425,28 +28565,28 @@ ${tree}\`\`\`
28425
28565
  sections.push("");
28426
28566
  }
28427
28567
  const content = sections.join("\n");
28428
- const contextDir = join38(repoRoot, OA_DIR, "context");
28568
+ const contextDir = join39(repoRoot, OA_DIR, "context");
28429
28569
  mkdirSync9(contextDir, { recursive: true });
28430
- writeFileSync9(join38(contextDir, "project-map.md"), content, "utf-8");
28570
+ writeFileSync10(join39(contextDir, "project-map.md"), content, "utf-8");
28431
28571
  return content;
28432
28572
  }
28433
28573
  function saveSession(repoRoot, session) {
28434
- const historyDir = join38(repoRoot, OA_DIR, "history");
28574
+ const historyDir = join39(repoRoot, OA_DIR, "history");
28435
28575
  mkdirSync9(historyDir, { recursive: true });
28436
- writeFileSync9(join38(historyDir, `${session.id}.json`), JSON.stringify(session, null, 2), "utf-8");
28576
+ writeFileSync10(join39(historyDir, `${session.id}.json`), JSON.stringify(session, null, 2), "utf-8");
28437
28577
  }
28438
28578
  function loadRecentSessions(repoRoot, limit = 5) {
28439
- const historyDir = join38(repoRoot, OA_DIR, "history");
28440
- if (!existsSync28(historyDir))
28579
+ const historyDir = join39(repoRoot, OA_DIR, "history");
28580
+ if (!existsSync29(historyDir))
28441
28581
  return [];
28442
28582
  try {
28443
28583
  const files = readdirSync7(historyDir).filter((f) => f.endsWith(".json") && f !== "pending-task.json").map((f) => {
28444
- const stat5 = statSync9(join38(historyDir, f));
28584
+ const stat5 = statSync9(join39(historyDir, f));
28445
28585
  return { file: f, mtime: stat5.mtimeMs };
28446
28586
  }).sort((a, b) => b.mtime - a.mtime).slice(0, limit);
28447
28587
  return files.map((f) => {
28448
28588
  try {
28449
- return JSON.parse(readFileSync20(join38(historyDir, f.file), "utf-8"));
28589
+ return JSON.parse(readFileSync21(join39(historyDir, f.file), "utf-8"));
28450
28590
  } catch {
28451
28591
  return null;
28452
28592
  }
@@ -28456,18 +28596,18 @@ function loadRecentSessions(repoRoot, limit = 5) {
28456
28596
  }
28457
28597
  }
28458
28598
  function savePendingTask(repoRoot, task) {
28459
- const historyDir = join38(repoRoot, OA_DIR, "history");
28599
+ const historyDir = join39(repoRoot, OA_DIR, "history");
28460
28600
  mkdirSync9(historyDir, { recursive: true });
28461
- writeFileSync9(join38(historyDir, PENDING_TASK_FILE), JSON.stringify(task, null, 2) + "\n", "utf-8");
28601
+ writeFileSync10(join39(historyDir, PENDING_TASK_FILE), JSON.stringify(task, null, 2) + "\n", "utf-8");
28462
28602
  }
28463
28603
  function loadPendingTask(repoRoot) {
28464
- const filePath = join38(repoRoot, OA_DIR, "history", PENDING_TASK_FILE);
28604
+ const filePath = join39(repoRoot, OA_DIR, "history", PENDING_TASK_FILE);
28465
28605
  try {
28466
- if (!existsSync28(filePath))
28606
+ if (!existsSync29(filePath))
28467
28607
  return null;
28468
- const data = JSON.parse(readFileSync20(filePath, "utf-8"));
28608
+ const data = JSON.parse(readFileSync21(filePath, "utf-8"));
28469
28609
  try {
28470
- unlinkSync3(filePath);
28610
+ unlinkSync4(filePath);
28471
28611
  } catch {
28472
28612
  }
28473
28613
  return data;
@@ -28476,13 +28616,13 @@ function loadPendingTask(repoRoot) {
28476
28616
  }
28477
28617
  }
28478
28618
  function saveSessionContext(repoRoot, entry) {
28479
- const contextDir = join38(repoRoot, OA_DIR, "context");
28619
+ const contextDir = join39(repoRoot, OA_DIR, "context");
28480
28620
  mkdirSync9(contextDir, { recursive: true });
28481
- const filePath = join38(contextDir, CONTEXT_SAVE_FILE);
28621
+ const filePath = join39(contextDir, CONTEXT_SAVE_FILE);
28482
28622
  let ctx;
28483
28623
  try {
28484
- if (existsSync28(filePath)) {
28485
- ctx = JSON.parse(readFileSync20(filePath, "utf-8"));
28624
+ if (existsSync29(filePath)) {
28625
+ ctx = JSON.parse(readFileSync21(filePath, "utf-8"));
28486
28626
  } else {
28487
28627
  ctx = { entries: [], maxEntries: MAX_CONTEXT_ENTRIES, updatedAt: "" };
28488
28628
  }
@@ -28494,14 +28634,14 @@ function saveSessionContext(repoRoot, entry) {
28494
28634
  ctx.entries = ctx.entries.slice(-ctx.maxEntries);
28495
28635
  }
28496
28636
  ctx.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
28497
- writeFileSync9(filePath, JSON.stringify(ctx, null, 2) + "\n", "utf-8");
28637
+ writeFileSync10(filePath, JSON.stringify(ctx, null, 2) + "\n", "utf-8");
28498
28638
  }
28499
28639
  function loadSessionContext(repoRoot) {
28500
- const filePath = join38(repoRoot, OA_DIR, "context", CONTEXT_SAVE_FILE);
28640
+ const filePath = join39(repoRoot, OA_DIR, "context", CONTEXT_SAVE_FILE);
28501
28641
  try {
28502
- if (!existsSync28(filePath))
28642
+ if (!existsSync29(filePath))
28503
28643
  return null;
28504
- return JSON.parse(readFileSync20(filePath, "utf-8"));
28644
+ return JSON.parse(readFileSync21(filePath, "utf-8"));
28505
28645
  } catch {
28506
28646
  return null;
28507
28647
  }
@@ -28548,12 +28688,12 @@ function detectManifests(repoRoot) {
28548
28688
  { file: "docker-compose.yaml", type: "Docker Compose" }
28549
28689
  ];
28550
28690
  for (const check of checks) {
28551
- const filePath = join38(repoRoot, check.file);
28552
- if (existsSync28(filePath)) {
28691
+ const filePath = join39(repoRoot, check.file);
28692
+ if (existsSync29(filePath)) {
28553
28693
  let name;
28554
28694
  if (check.nameField) {
28555
28695
  try {
28556
- const data = JSON.parse(readFileSync20(filePath, "utf-8"));
28696
+ const data = JSON.parse(readFileSync21(filePath, "utf-8"));
28557
28697
  name = data[check.nameField];
28558
28698
  } catch {
28559
28699
  }
@@ -28582,7 +28722,7 @@ function findKeyFiles(repoRoot) {
28582
28722
  { pattern: "CLAUDE.md", description: "Claude Code context" }
28583
28723
  ];
28584
28724
  for (const check of checks) {
28585
- if (existsSync28(join38(repoRoot, check.pattern))) {
28725
+ if (existsSync29(join39(repoRoot, check.pattern))) {
28586
28726
  keyFiles.push({ path: check.pattern, description: check.description });
28587
28727
  }
28588
28728
  }
@@ -28608,12 +28748,12 @@ function buildDirTree(root, maxDepth, prefix = "", depth = 0) {
28608
28748
  if (entry.isDirectory()) {
28609
28749
  let fileCount = 0;
28610
28750
  try {
28611
- fileCount = readdirSync7(join38(root, entry.name)).filter((f) => !f.startsWith(".")).length;
28751
+ fileCount = readdirSync7(join39(root, entry.name)).filter((f) => !f.startsWith(".")).length;
28612
28752
  } catch {
28613
28753
  }
28614
28754
  result += `${prefix}${connector}${entry.name}/ (${fileCount})
28615
28755
  `;
28616
- result += buildDirTree(join38(root, entry.name), maxDepth, childPrefix, depth + 1);
28756
+ result += buildDirTree(join39(root, entry.name), maxDepth, childPrefix, depth + 1);
28617
28757
  } else if (depth < maxDepth) {
28618
28758
  result += `${prefix}${connector}${entry.name}
28619
28759
  `;
@@ -28625,17 +28765,17 @@ function buildDirTree(root, maxDepth, prefix = "", depth = 0) {
28625
28765
  }
28626
28766
  function loadUsageFile(filePath) {
28627
28767
  try {
28628
- if (existsSync28(filePath)) {
28629
- return JSON.parse(readFileSync20(filePath, "utf-8"));
28768
+ if (existsSync29(filePath)) {
28769
+ return JSON.parse(readFileSync21(filePath, "utf-8"));
28630
28770
  }
28631
28771
  } catch {
28632
28772
  }
28633
28773
  return { records: [] };
28634
28774
  }
28635
28775
  function saveUsageFile(filePath, data) {
28636
- const dir = join38(filePath, "..");
28776
+ const dir = join39(filePath, "..");
28637
28777
  mkdirSync9(dir, { recursive: true });
28638
- writeFileSync9(filePath, JSON.stringify(data, null, 2) + "\n", { encoding: "utf-8", mode: 384 });
28778
+ writeFileSync10(filePath, JSON.stringify(data, null, 2) + "\n", { encoding: "utf-8", mode: 384 });
28639
28779
  }
28640
28780
  function recordUsage(kind, value, opts) {
28641
28781
  const now = (/* @__PURE__ */ new Date()).toISOString();
@@ -28663,15 +28803,15 @@ function recordUsage(kind, value, opts) {
28663
28803
  }
28664
28804
  saveUsageFile(filePath, data);
28665
28805
  };
28666
- update(join38(homedir9(), ".open-agents", USAGE_HISTORY_FILE));
28806
+ update(join39(homedir9(), ".open-agents", USAGE_HISTORY_FILE));
28667
28807
  if (opts?.repoRoot) {
28668
- update(join38(opts.repoRoot, OA_DIR, USAGE_HISTORY_FILE));
28808
+ update(join39(opts.repoRoot, OA_DIR, USAGE_HISTORY_FILE));
28669
28809
  }
28670
28810
  }
28671
28811
  function loadUsageHistory(kind, repoRoot) {
28672
- const globalPath = join38(homedir9(), ".open-agents", USAGE_HISTORY_FILE);
28812
+ const globalPath = join39(homedir9(), ".open-agents", USAGE_HISTORY_FILE);
28673
28813
  const globalData = loadUsageFile(globalPath);
28674
- const localData = repoRoot ? loadUsageFile(join38(repoRoot, OA_DIR, USAGE_HISTORY_FILE)) : { records: [] };
28814
+ const localData = repoRoot ? loadUsageFile(join39(repoRoot, OA_DIR, USAGE_HISTORY_FILE)) : { records: [] };
28675
28815
  const map = /* @__PURE__ */ new Map();
28676
28816
  for (const r of globalData.records) {
28677
28817
  if (r.kind !== kind)
@@ -28695,7 +28835,7 @@ function loadUsageHistory(kind, repoRoot) {
28695
28835
  }
28696
28836
  var OA_DIR, SUBDIRS, CONTEXT_FILES, PENDING_TASK_FILE, CONTEXT_SAVE_FILE, MAX_CONTEXT_ENTRIES, SKIP_DIRS, USAGE_HISTORY_FILE, MAX_HISTORY_RECORDS;
28697
28837
  var init_oa_directory = __esm({
28698
- "../packages/cli/dist/tui/oa-directory.js"() {
28838
+ "packages/cli/dist/tui/oa-directory.js"() {
28699
28839
  "use strict";
28700
28840
  OA_DIR = ".oa";
28701
28841
  SUBDIRS = ["memory", "index", "context", "history", "notes", "embedded", "provenance", "tools", "dreams"];
@@ -28736,11 +28876,12 @@ var init_oa_directory = __esm({
28736
28876
  }
28737
28877
  });
28738
28878
 
28739
- // ../packages/cli/dist/tui/setup.js
28879
+ // packages/cli/dist/tui/setup.js
28740
28880
  import * as readline from "node:readline";
28741
- import { execSync as execSync25, spawn as spawn15 } from "node:child_process";
28742
- import { existsSync as existsSync29, writeFileSync as writeFileSync10, mkdirSync as mkdirSync10 } from "node:fs";
28743
- import { join as join39 } from "node:path";
28881
+ import { execSync as execSync25, spawn as spawn15, exec as exec2 } from "node:child_process";
28882
+ import { promisify as promisify5 } from "node:util";
28883
+ import { existsSync as existsSync30, writeFileSync as writeFileSync11, mkdirSync as mkdirSync10 } from "node:fs";
28884
+ import { join as join40 } from "node:path";
28744
28885
  import { homedir as homedir10, platform } from "node:os";
28745
28886
  function detectSystemSpecs() {
28746
28887
  let totalRamGB = 0;
@@ -28789,6 +28930,50 @@ function detectSystemSpecs() {
28789
28930
  gpuName
28790
28931
  };
28791
28932
  }
28933
+ async function detectSystemSpecsAsync() {
28934
+ let totalRamGB = 0;
28935
+ let availableRamGB = 0;
28936
+ let gpuVramGB = 0;
28937
+ let gpuName = "";
28938
+ try {
28939
+ const { stdout: memInfo } = await execAsync("free -b 2>/dev/null || sysctl -n hw.memsize 2>/dev/null", { timeout: 5e3 });
28940
+ if (memInfo.includes("Mem:")) {
28941
+ const match = memInfo.match(/^Mem:\s+(\d+)\s+\d+\s+\d+\s+\d+\s+\d+\s+(\d+)/m);
28942
+ if (match) {
28943
+ totalRamGB = parseInt(match[1], 10) / 1024 ** 3;
28944
+ availableRamGB = parseInt(match[2], 10) / 1024 ** 3;
28945
+ }
28946
+ } else {
28947
+ const bytes = parseInt(memInfo.trim(), 10);
28948
+ if (!isNaN(bytes)) {
28949
+ totalRamGB = bytes / 1024 ** 3;
28950
+ availableRamGB = totalRamGB * 0.7;
28951
+ }
28952
+ }
28953
+ } catch {
28954
+ }
28955
+ try {
28956
+ const { stdout: nvidiaSmi } = await execAsync("nvidia-smi --query-gpu=memory.total,name --format=csv,noheader,nounits 2>/dev/null", { timeout: 5e3 });
28957
+ const lines = nvidiaSmi.trim().split("\n");
28958
+ if (lines.length > 0) {
28959
+ for (const line of lines) {
28960
+ const parts = line.split(",").map((s) => s.trim());
28961
+ const vramMB = parseInt(parts[0] ?? "0", 10);
28962
+ if (!isNaN(vramMB))
28963
+ gpuVramGB += vramMB / 1024;
28964
+ if (!gpuName && parts[1])
28965
+ gpuName = parts[1];
28966
+ }
28967
+ }
28968
+ } catch {
28969
+ }
28970
+ return {
28971
+ totalRamGB: Math.round(totalRamGB * 10) / 10,
28972
+ availableRamGB: Math.round(availableRamGB * 10) / 10,
28973
+ gpuVramGB: Math.round(gpuVramGB * 10) / 10,
28974
+ gpuName
28975
+ };
28976
+ }
28792
28977
  function recommendModel(specs) {
28793
28978
  const effectiveGB = Math.max(specs.gpuVramGB, specs.availableRamGB);
28794
28979
  const budget = effectiveGB * 0.8;
@@ -28973,7 +29158,7 @@ async function installOllamaMac(_rl) {
28973
29158
  execSync25('/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"', { stdio: "inherit", timeout: 6e5 });
28974
29159
  if (!hasCmd("brew")) {
28975
29160
  try {
28976
- const brewPrefix = existsSync29("/opt/homebrew/bin/brew") ? "/opt/homebrew" : "/usr/local";
29161
+ const brewPrefix = existsSync30("/opt/homebrew/bin/brew") ? "/opt/homebrew" : "/usr/local";
28977
29162
  process.env["PATH"] = `${brewPrefix}/bin:${process.env["PATH"]}`;
28978
29163
  } catch {
28979
29164
  }
@@ -29727,10 +29912,10 @@ async function doSetup(config, rl) {
29727
29912
  `PARAMETER num_predict ${numPredict}`,
29728
29913
  `PARAMETER stop "<|endoftext|>"`
29729
29914
  ].join("\n");
29730
- const modelDir2 = join39(homedir10(), ".open-agents", "models");
29915
+ const modelDir2 = join40(homedir10(), ".open-agents", "models");
29731
29916
  mkdirSync10(modelDir2, { recursive: true });
29732
- const modelfilePath = join39(modelDir2, `Modelfile.${customName}`);
29733
- writeFileSync10(modelfilePath, modelfileContent + "\n", "utf8");
29917
+ const modelfilePath = join40(modelDir2, `Modelfile.${customName}`);
29918
+ writeFileSync11(modelfilePath, modelfileContent + "\n", "utf8");
29734
29919
  process.stdout.write(` ${c2.dim("Creating model...")} `);
29735
29920
  execSync25(`ollama create ${customName} -f ${modelfilePath}`, {
29736
29921
  stdio: "pipe",
@@ -29775,7 +29960,7 @@ async function isModelAvailable(config) {
29775
29960
  }
29776
29961
  function isFirstRun() {
29777
29962
  try {
29778
- return !existsSync29(join39(homedir10(), ".open-agents", "config.json"));
29963
+ return !existsSync30(join40(homedir10(), ".open-agents", "config.json"));
29779
29964
  } catch {
29780
29965
  return true;
29781
29966
  }
@@ -29812,7 +29997,7 @@ function detectPkgManager() {
29812
29997
  return null;
29813
29998
  }
29814
29999
  function getVenvDir() {
29815
- return join39(homedir10(), ".open-agents", "venv");
30000
+ return join40(homedir10(), ".open-agents", "venv");
29816
30001
  }
29817
30002
  function hasVenvModule() {
29818
30003
  try {
@@ -29824,8 +30009,8 @@ function hasVenvModule() {
29824
30009
  }
29825
30010
  function ensureVenv(log) {
29826
30011
  const venvDir = getVenvDir();
29827
- const venvPip = join39(venvDir, "bin", "pip");
29828
- if (existsSync29(venvPip))
30012
+ const venvPip = join40(venvDir, "bin", "pip");
30013
+ if (existsSync30(venvPip))
29829
30014
  return venvDir;
29830
30015
  log("Creating Python venv for vision deps...");
29831
30016
  if (!hasCmd("python3")) {
@@ -29837,9 +30022,9 @@ function ensureVenv(log) {
29837
30022
  return null;
29838
30023
  }
29839
30024
  try {
29840
- mkdirSync10(join39(homedir10(), ".open-agents"), { recursive: true });
30025
+ mkdirSync10(join40(homedir10(), ".open-agents"), { recursive: true });
29841
30026
  execSync25(`python3 -m venv "${venvDir}"`, { stdio: "pipe", timeout: 3e4 });
29842
- execSync25(`"${join39(venvDir, "bin", "pip")}" install --upgrade pip`, {
30027
+ execSync25(`"${join40(venvDir, "bin", "pip")}" install --upgrade pip`, {
29843
30028
  stdio: "pipe",
29844
30029
  timeout: 6e4
29845
30030
  });
@@ -30030,15 +30215,15 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
30030
30215
  }
30031
30216
  }
30032
30217
  const venvDir = getVenvDir();
30033
- const venvBin = join39(venvDir, "bin");
30034
- const venvMoondream = join39(venvBin, "moondream-station");
30218
+ const venvBin = join40(venvDir, "bin");
30219
+ const venvMoondream = join40(venvBin, "moondream-station");
30035
30220
  const venv = ensureVenv(log);
30036
- if (venv && !hasCmd("moondream-station") && !existsSync29(venvMoondream)) {
30037
- const venvPip = join39(venvBin, "pip");
30221
+ if (venv && !hasCmd("moondream-station") && !existsSync30(venvMoondream)) {
30222
+ const venvPip = join40(venvBin, "pip");
30038
30223
  log("Installing moondream-station in ~/.open-agents/venv...");
30039
30224
  try {
30040
30225
  execSync25(`"${venvPip}" install moondream-station`, { stdio: "pipe", timeout: 3e5 });
30041
- if (existsSync29(venvMoondream)) {
30226
+ if (existsSync30(venvMoondream)) {
30042
30227
  log("moondream-station installed successfully.");
30043
30228
  } else {
30044
30229
  try {
@@ -30055,8 +30240,8 @@ async function ensureVisionDeps(onInfo, getSudoPassword) {
30055
30240
  }
30056
30241
  }
30057
30242
  if (venv) {
30058
- const venvPython = join39(venvBin, "python");
30059
- const venvPip2 = join39(venvBin, "pip");
30243
+ const venvPython = join40(venvBin, "python");
30244
+ const venvPip2 = join40(venvBin, "pip");
30060
30245
  let ocrStackInstalled = false;
30061
30246
  try {
30062
30247
  execSync25(`"${venvPython}" -c "import cv2, pytesseract, numpy, PIL"`, { stdio: "pipe", timeout: 1e4 });
@@ -30157,7 +30342,7 @@ function modelSizeGB(models, modelName) {
30157
30342
  const known = QWEN_VARIANTS.find((v) => modelName.includes(v.tag.split(":")[1] ?? ""));
30158
30343
  return known?.sizeGB ?? 4;
30159
30344
  }
30160
- function createExpandedVariant(baseModel, specs, sizeGB) {
30345
+ async function createExpandedVariantAsync(baseModel, specs, sizeGB) {
30161
30346
  const customName = expandedModelName(baseModel);
30162
30347
  const ctx = calculateContextWindow(specs, sizeGB);
30163
30348
  try {
@@ -30169,12 +30354,11 @@ function createExpandedVariant(baseModel, specs, sizeGB) {
30169
30354
  `PARAMETER num_predict ${numPredict}`,
30170
30355
  `PARAMETER stop "<|endoftext|>"`
30171
30356
  ].join("\n");
30172
- const modelDir2 = join39(homedir10(), ".open-agents", "models");
30357
+ const modelDir2 = join40(homedir10(), ".open-agents", "models");
30173
30358
  mkdirSync10(modelDir2, { recursive: true });
30174
- const modelfilePath = join39(modelDir2, `Modelfile.${customName}`);
30175
- writeFileSync10(modelfilePath, modelfileContent + "\n", "utf8");
30176
- execSync25(`ollama create ${customName} -f ${modelfilePath}`, {
30177
- stdio: "pipe",
30359
+ const modelfilePath = join40(modelDir2, `Modelfile.${customName}`);
30360
+ writeFileSync11(modelfilePath, modelfileContent + "\n", "utf8");
30361
+ await execAsync(`ollama create ${customName} -f ${modelfilePath}`, {
30178
30362
  timeout: 12e4
30179
30363
  });
30180
30364
  return customName;
@@ -30184,7 +30368,7 @@ function createExpandedVariant(baseModel, specs, sizeGB) {
30184
30368
  }
30185
30369
  async function ensureExpandedContext(modelName, backendUrl) {
30186
30370
  if (modelName.startsWith("open-agents-")) {
30187
- const specs2 = detectSystemSpecs();
30371
+ const specs2 = await detectSystemSpecsAsync();
30188
30372
  const ctx2 = calculateContextWindow(specs2, 4);
30189
30373
  return { model: modelName, created: false, contextLabel: ctx2.label, numCtx: ctx2.numCtx };
30190
30374
  }
@@ -30195,7 +30379,7 @@ async function ensureExpandedContext(modelName, backendUrl) {
30195
30379
  if (existing === null) {
30196
30380
  return { model: modelName, created: false, contextLabel: "", numCtx: 0 };
30197
30381
  }
30198
- const specs = detectSystemSpecs();
30382
+ const specs = await detectSystemSpecsAsync();
30199
30383
  if (typeof existing === "string") {
30200
30384
  let sizeGB2 = 4;
30201
30385
  try {
@@ -30213,20 +30397,21 @@ async function ensureExpandedContext(modelName, backendUrl) {
30213
30397
  } catch {
30214
30398
  }
30215
30399
  const ctx = calculateContextWindow(specs, sizeGB);
30216
- const created = createExpandedVariant(modelName, specs, sizeGB);
30400
+ const created = await createExpandedVariantAsync(modelName, specs, sizeGB);
30217
30401
  if (created) {
30218
30402
  return { model: created, created: true, contextLabel: ctx.label, numCtx: ctx.numCtx };
30219
30403
  }
30220
30404
  return { model: modelName, created: false, contextLabel: ctx.label, numCtx: ctx.numCtx };
30221
30405
  }
30222
- var QWEN_VARIANTS, TOOL_CALLING_MODELS, _cloudflaredInstallPromise;
30406
+ var execAsync, QWEN_VARIANTS, TOOL_CALLING_MODELS, _cloudflaredInstallPromise;
30223
30407
  var init_setup = __esm({
30224
- "../packages/cli/dist/tui/setup.js"() {
30408
+ "packages/cli/dist/tui/setup.js"() {
30225
30409
  "use strict";
30226
30410
  init_model_picker();
30227
30411
  init_render();
30228
30412
  init_config();
30229
30413
  init_dist();
30414
+ execAsync = promisify5(exec2);
30230
30415
  QWEN_VARIANTS = [
30231
30416
  { tag: "qwen3.5:0.8b", sizeGB: 1, label: "0.8B params (1.0 GB)", cloud: false },
30232
30417
  { tag: "qwen3.5:2b", sizeGB: 2.7, label: "2B params (2.7 GB)", cloud: false },
@@ -30255,7 +30440,7 @@ var init_setup = __esm({
30255
30440
  }
30256
30441
  });
30257
30442
 
30258
- // ../packages/cli/dist/tui/tui-select.js
30443
+ // packages/cli/dist/tui/tui-select.js
30259
30444
  function ansi3(code, text) {
30260
30445
  return isTTY3 ? `\x1B[${code}m${text}\x1B[0m` : text;
30261
30446
  }
@@ -30565,7 +30750,7 @@ function tuiSelect(opts) {
30565
30750
  }
30566
30751
  var isTTY3, selectColors;
30567
30752
  var init_tui_select = __esm({
30568
- "../packages/cli/dist/tui/tui-select.js"() {
30753
+ "packages/cli/dist/tui/tui-select.js"() {
30569
30754
  "use strict";
30570
30755
  isTTY3 = process.stdout.isTTY ?? false;
30571
30756
  selectColors = {
@@ -30582,7 +30767,7 @@ var init_tui_select = __esm({
30582
30767
  }
30583
30768
  });
30584
30769
 
30585
- // ../packages/cli/dist/tui/commands.js
30770
+ // packages/cli/dist/tui/commands.js
30586
30771
  async function handleSlashCommand(input, ctx) {
30587
30772
  const trimmed = input.trim();
30588
30773
  if (!trimmed.startsWith("/"))
@@ -32105,17 +32290,17 @@ async function handleUpdate(subcommand, ctx) {
32105
32290
  try {
32106
32291
  const { createRequire: createRequire4 } = await import("node:module");
32107
32292
  const { fileURLToPath: fileURLToPath14 } = await import("node:url");
32108
- const { dirname: dirname19, join: join54 } = await import("node:path");
32109
- const { existsSync: existsSync40 } = await import("node:fs");
32293
+ const { dirname: dirname19, join: join55 } = await import("node:path");
32294
+ const { existsSync: existsSync41 } = await import("node:fs");
32110
32295
  const req = createRequire4(import.meta.url);
32111
32296
  const thisDir = dirname19(fileURLToPath14(import.meta.url));
32112
32297
  const candidates = [
32113
- join54(thisDir, "..", "package.json"),
32114
- join54(thisDir, "..", "..", "package.json"),
32115
- join54(thisDir, "..", "..", "..", "package.json")
32298
+ join55(thisDir, "..", "package.json"),
32299
+ join55(thisDir, "..", "..", "package.json"),
32300
+ join55(thisDir, "..", "..", "..", "package.json")
32116
32301
  ];
32117
32302
  for (const pkgPath of candidates) {
32118
- if (existsSync40(pkgPath)) {
32303
+ if (existsSync41(pkgPath)) {
32119
32304
  const pkg = req(pkgPath);
32120
32305
  if (pkg.name === "open-agents-ai" || pkg.name === "@open-agents/cli") {
32121
32306
  currentVersion = pkg.version ?? "0.0.0";
@@ -32151,7 +32336,7 @@ async function handleUpdate(subcommand, ctx) {
32151
32336
  return;
32152
32337
  }
32153
32338
  checkSpinner.stop(`Update available: v${info.currentVersion} \u2192 v${c2.bold(c2.green(info.latestVersion))}`);
32154
- const { exec: exec2, execSync: es2 } = await import("node:child_process");
32339
+ const { exec: exec3, execSync: es2 } = await import("node:child_process");
32155
32340
  let needsSudo = false;
32156
32341
  try {
32157
32342
  const prefix = es2("npm prefix -g", { encoding: "utf8", timeout: 5e3 }).trim();
@@ -32180,7 +32365,7 @@ async function handleUpdate(subcommand, ctx) {
32180
32365
  let installOk = false;
32181
32366
  let installError = "";
32182
32367
  const runInstall2 = (cmd) => new Promise((resolve31) => {
32183
- const child = exec2(cmd, { timeout: 18e4 }, (err, _stdout, stderr) => {
32368
+ const child = exec3(cmd, { timeout: 18e4 }, (err, _stdout, stderr) => {
32184
32369
  if (err)
32185
32370
  installError = (stderr || err.message || "").trim();
32186
32371
  resolve31(!err);
@@ -32218,7 +32403,7 @@ async function handleUpdate(subcommand, ctx) {
32218
32403
  installSpinner.stop(`Update installed (v${info.latestVersion}).`);
32219
32404
  const rebuildSpinner = startInlineSpinner("Rebuilding native modules");
32220
32405
  const rebuildOk = await new Promise((resolve31) => {
32221
- const child = exec2(`${sudoPrefix}npm rebuild -g open-agents-ai 2>/dev/null || true`, { timeout: 12e4 }, () => resolve31(true));
32406
+ const child = exec3(`${sudoPrefix}npm rebuild -g open-agents-ai 2>/dev/null || true`, { timeout: 12e4 }, () => resolve31(true));
32222
32407
  child.stdout?.resume();
32223
32408
  child.stderr?.resume();
32224
32409
  });
@@ -32251,7 +32436,7 @@ async function handleUpdate(subcommand, ctx) {
32251
32436
  if (fsExists(venvPip)) {
32252
32437
  const pySpinner = startInlineSpinner("Upgrading Python venv packages");
32253
32438
  const pyOk = await new Promise((resolve31) => {
32254
- const child = exec2(`"${venvPip}" install --upgrade moondream-station pytesseract Pillow opencv-python-headless numpy 2>/dev/null || true`, { timeout: 3e5 }, (err) => resolve31(!err));
32439
+ const child = exec3(`"${venvPip}" install --upgrade moondream-station pytesseract Pillow opencv-python-headless numpy 2>/dev/null || true`, { timeout: 3e5 }, (err) => resolve31(!err));
32255
32440
  child.stdout?.resume();
32256
32441
  child.stderr?.resume();
32257
32442
  });
@@ -32382,7 +32567,7 @@ async function switchModel(query, ctx, local = false) {
32382
32567
  }
32383
32568
  }
32384
32569
  var init_commands = __esm({
32385
- "../packages/cli/dist/tui/commands.js"() {
32570
+ "packages/cli/dist/tui/commands.js"() {
32386
32571
  "use strict";
32387
32572
  init_model_picker();
32388
32573
  init_render();
@@ -32399,9 +32584,9 @@ var init_commands = __esm({
32399
32584
  }
32400
32585
  });
32401
32586
 
32402
- // ../packages/cli/dist/tui/project-context.js
32403
- import { existsSync as existsSync30, readFileSync as readFileSync21, readdirSync as readdirSync8 } from "node:fs";
32404
- import { join as join40, basename as basename10 } from "node:path";
32587
+ // packages/cli/dist/tui/project-context.js
32588
+ import { existsSync as existsSync31, readFileSync as readFileSync22, readdirSync as readdirSync8 } from "node:fs";
32589
+ import { join as join41, basename as basename10 } from "node:path";
32405
32590
  import { execSync as execSync26 } from "node:child_process";
32406
32591
  import { homedir as homedir11, platform as platform2, release } from "node:os";
32407
32592
  function getModelTier(modelName) {
@@ -32436,10 +32621,10 @@ function loadProjectMap(repoRoot) {
32436
32621
  if (!hasOaDirectory(repoRoot)) {
32437
32622
  initOaDirectory(repoRoot);
32438
32623
  }
32439
- const mapPath = join40(repoRoot, OA_DIR, "context", "project-map.md");
32440
- if (existsSync30(mapPath)) {
32624
+ const mapPath = join41(repoRoot, OA_DIR, "context", "project-map.md");
32625
+ if (existsSync31(mapPath)) {
32441
32626
  try {
32442
- const content = readFileSync21(mapPath, "utf-8");
32627
+ const content = readFileSync22(mapPath, "utf-8");
32443
32628
  return content;
32444
32629
  } catch {
32445
32630
  }
@@ -32480,31 +32665,31 @@ ${log}`);
32480
32665
  }
32481
32666
  function loadMemoryContext(repoRoot) {
32482
32667
  const sections = [];
32483
- const oaMemDir = join40(repoRoot, OA_DIR, "memory");
32668
+ const oaMemDir = join41(repoRoot, OA_DIR, "memory");
32484
32669
  const oaEntries = loadMemoryDir(oaMemDir, "project");
32485
32670
  if (oaEntries)
32486
32671
  sections.push(oaEntries);
32487
- const legacyMemDir = join40(repoRoot, ".open-agents", "memory");
32488
- if (legacyMemDir !== oaMemDir && existsSync30(legacyMemDir)) {
32672
+ const legacyMemDir = join41(repoRoot, ".open-agents", "memory");
32673
+ if (legacyMemDir !== oaMemDir && existsSync31(legacyMemDir)) {
32489
32674
  const legacyEntries = loadMemoryDir(legacyMemDir, "project/legacy");
32490
32675
  if (legacyEntries)
32491
32676
  sections.push(legacyEntries);
32492
32677
  }
32493
- const globalMemDir = join40(homedir11(), ".open-agents", "memory");
32678
+ const globalMemDir = join41(homedir11(), ".open-agents", "memory");
32494
32679
  const globalEntries = loadMemoryDir(globalMemDir, "global");
32495
32680
  if (globalEntries)
32496
32681
  sections.push(globalEntries);
32497
32682
  return sections.join("\n\n");
32498
32683
  }
32499
32684
  function loadMemoryDir(memDir, scope) {
32500
- if (!existsSync30(memDir))
32685
+ if (!existsSync31(memDir))
32501
32686
  return "";
32502
32687
  const lines = [];
32503
32688
  try {
32504
32689
  const files = readdirSync8(memDir).filter((f) => f.endsWith(".json"));
32505
32690
  for (const file of files.slice(0, 10)) {
32506
32691
  try {
32507
- const raw = readFileSync21(join40(memDir, file), "utf-8");
32692
+ const raw = readFileSync22(join41(memDir, file), "utf-8");
32508
32693
  const entries = JSON.parse(raw);
32509
32694
  const topic = basename10(file, ".json");
32510
32695
  const keys = Object.keys(entries);
@@ -32704,14 +32889,14 @@ These patterns have been repeated 3+ times. Consider using create_tool to automa
32704
32889
  return sections.join("\n\n");
32705
32890
  }
32706
32891
  var init_project_context = __esm({
32707
- "../packages/cli/dist/tui/project-context.js"() {
32892
+ "packages/cli/dist/tui/project-context.js"() {
32708
32893
  "use strict";
32709
32894
  init_oa_directory();
32710
32895
  init_dist2();
32711
32896
  }
32712
32897
  });
32713
32898
 
32714
- // ../packages/memory/dist/db.js
32899
+ // packages/memory/dist/db.js
32715
32900
  import Database from "better-sqlite3";
32716
32901
  function initDb(dbPath) {
32717
32902
  const db = new Database(dbPath);
@@ -32866,26 +33051,26 @@ function runMigrations(db) {
32866
33051
  `);
32867
33052
  }
32868
33053
  var init_db = __esm({
32869
- "../packages/memory/dist/db.js"() {
33054
+ "packages/memory/dist/db.js"() {
32870
33055
  "use strict";
32871
33056
  }
32872
33057
  });
32873
33058
 
32874
- // ../packages/memory/dist/repoProfileStore.js
33059
+ // packages/memory/dist/repoProfileStore.js
32875
33060
  var init_repoProfileStore = __esm({
32876
- "../packages/memory/dist/repoProfileStore.js"() {
33061
+ "packages/memory/dist/repoProfileStore.js"() {
32877
33062
  "use strict";
32878
33063
  }
32879
33064
  });
32880
33065
 
32881
- // ../packages/memory/dist/fileSummaryStore.js
33066
+ // packages/memory/dist/fileSummaryStore.js
32882
33067
  var init_fileSummaryStore = __esm({
32883
- "../packages/memory/dist/fileSummaryStore.js"() {
33068
+ "packages/memory/dist/fileSummaryStore.js"() {
32884
33069
  "use strict";
32885
33070
  }
32886
33071
  });
32887
33072
 
32888
- // ../packages/memory/dist/taskMemoryStore.js
33073
+ // packages/memory/dist/taskMemoryStore.js
32889
33074
  import { randomUUID } from "node:crypto";
32890
33075
  function rowToTask(row) {
32891
33076
  return {
@@ -32904,7 +33089,7 @@ function rowToTask(row) {
32904
33089
  }
32905
33090
  var TaskMemoryStore;
32906
33091
  var init_taskMemoryStore = __esm({
32907
- "../packages/memory/dist/taskMemoryStore.js"() {
33092
+ "packages/memory/dist/taskMemoryStore.js"() {
32908
33093
  "use strict";
32909
33094
  TaskMemoryStore = class {
32910
33095
  db;
@@ -32955,14 +33140,14 @@ var init_taskMemoryStore = __esm({
32955
33140
  }
32956
33141
  });
32957
33142
 
32958
- // ../packages/memory/dist/patchHistoryStore.js
33143
+ // packages/memory/dist/patchHistoryStore.js
32959
33144
  var init_patchHistoryStore = __esm({
32960
- "../packages/memory/dist/patchHistoryStore.js"() {
33145
+ "packages/memory/dist/patchHistoryStore.js"() {
32961
33146
  "use strict";
32962
33147
  }
32963
33148
  });
32964
33149
 
32965
- // ../packages/memory/dist/failureStore.js
33150
+ // packages/memory/dist/failureStore.js
32966
33151
  import { randomUUID as randomUUID2 } from "node:crypto";
32967
33152
  function rowToFailure(row) {
32968
33153
  return {
@@ -32983,7 +33168,7 @@ function rowToFailure(row) {
32983
33168
  }
32984
33169
  var FailureStore;
32985
33170
  var init_failureStore = __esm({
32986
- "../packages/memory/dist/failureStore.js"() {
33171
+ "packages/memory/dist/failureStore.js"() {
32987
33172
  "use strict";
32988
33173
  FailureStore = class {
32989
33174
  db;
@@ -33038,18 +33223,18 @@ var init_failureStore = __esm({
33038
33223
  }
33039
33224
  });
33040
33225
 
33041
- // ../packages/memory/dist/validationStore.js
33226
+ // packages/memory/dist/validationStore.js
33042
33227
  var init_validationStore = __esm({
33043
- "../packages/memory/dist/validationStore.js"() {
33228
+ "packages/memory/dist/validationStore.js"() {
33044
33229
  "use strict";
33045
33230
  }
33046
33231
  });
33047
33232
 
33048
- // ../packages/memory/dist/toolPatternStore.js
33233
+ // packages/memory/dist/toolPatternStore.js
33049
33234
  import { randomUUID as randomUUID3 } from "node:crypto";
33050
33235
  var ToolPatternStore;
33051
33236
  var init_toolPatternStore = __esm({
33052
- "../packages/memory/dist/toolPatternStore.js"() {
33237
+ "packages/memory/dist/toolPatternStore.js"() {
33053
33238
  "use strict";
33054
33239
  ToolPatternStore = class {
33055
33240
  db;
@@ -33228,9 +33413,9 @@ var init_toolPatternStore = __esm({
33228
33413
  }
33229
33414
  });
33230
33415
 
33231
- // ../packages/memory/dist/index.js
33416
+ // packages/memory/dist/index.js
33232
33417
  var init_dist7 = __esm({
33233
- "../packages/memory/dist/index.js"() {
33418
+ "packages/memory/dist/index.js"() {
33234
33419
  "use strict";
33235
33420
  init_db();
33236
33421
  init_repoProfileStore();
@@ -33243,7 +33428,7 @@ var init_dist7 = __esm({
33243
33428
  }
33244
33429
  });
33245
33430
 
33246
- // ../packages/cli/dist/tui/carousel.js
33431
+ // packages/cli/dist/tui/carousel.js
33247
33432
  function fg(code, text) {
33248
33433
  return isTTY4 ? `\x1B[38;5;${code}m${text}\x1B[0m` : text;
33249
33434
  }
@@ -33285,7 +33470,7 @@ function createRow(phraseIndices, speed, direction, bank) {
33285
33470
  }
33286
33471
  var isTTY4, PHRASES, Carousel;
33287
33472
  var init_carousel = __esm({
33288
- "../packages/cli/dist/tui/carousel.js"() {
33473
+ "packages/cli/dist/tui/carousel.js"() {
33289
33474
  "use strict";
33290
33475
  isTTY4 = process.stdout.isTTY ?? false;
33291
33476
  PHRASES = [
@@ -33408,11 +33593,7 @@ var init_carousel = __esm({
33408
33593
  process.stdout.write(`\x1B[${this.reservedRows + 1};1H`);
33409
33594
  this.resizeHandler = () => {
33410
33595
  this.width = process.stdout.columns ?? 80;
33411
- const newRows = process.stdout.rows ?? 24;
33412
33596
  this.rebuildRibbons();
33413
- if (this.started) {
33414
- process.stdout.write(`\x1B[${this.reservedRows + 1};${newRows}r`);
33415
- }
33416
33597
  };
33417
33598
  process.stdout.on("resize", this.resizeHandler);
33418
33599
  this.renderFrame();
@@ -33530,23 +33711,23 @@ var init_carousel = __esm({
33530
33711
  }
33531
33712
  });
33532
33713
 
33533
- // ../packages/cli/dist/tui/carousel-descriptors.js
33534
- import { existsSync as existsSync31, readFileSync as readFileSync22, writeFileSync as writeFileSync11, mkdirSync as mkdirSync11, readdirSync as readdirSync9 } from "node:fs";
33535
- import { join as join41, basename as basename11 } from "node:path";
33714
+ // packages/cli/dist/tui/carousel-descriptors.js
33715
+ import { existsSync as existsSync32, readFileSync as readFileSync23, writeFileSync as writeFileSync12, mkdirSync as mkdirSync11, readdirSync as readdirSync9 } from "node:fs";
33716
+ import { join as join42, basename as basename11 } from "node:path";
33536
33717
  function loadToolProfile(repoRoot) {
33537
- const filePath = join41(repoRoot, OA_DIR, "context", TOOL_PROFILE_FILE);
33718
+ const filePath = join42(repoRoot, OA_DIR, "context", TOOL_PROFILE_FILE);
33538
33719
  try {
33539
- if (!existsSync31(filePath))
33720
+ if (!existsSync32(filePath))
33540
33721
  return null;
33541
- return JSON.parse(readFileSync22(filePath, "utf-8"));
33722
+ return JSON.parse(readFileSync23(filePath, "utf-8"));
33542
33723
  } catch {
33543
33724
  return null;
33544
33725
  }
33545
33726
  }
33546
33727
  function saveToolProfile(repoRoot, profile) {
33547
- const contextDir = join41(repoRoot, OA_DIR, "context");
33728
+ const contextDir = join42(repoRoot, OA_DIR, "context");
33548
33729
  mkdirSync11(contextDir, { recursive: true });
33549
- writeFileSync11(join41(contextDir, TOOL_PROFILE_FILE), JSON.stringify(profile, null, 2), "utf-8");
33730
+ writeFileSync12(join42(contextDir, TOOL_PROFILE_FILE), JSON.stringify(profile, null, 2), "utf-8");
33550
33731
  }
33551
33732
  function categorizeToolCall(toolName) {
33552
33733
  for (const cat of TOOL_CATEGORIES) {
@@ -33604,25 +33785,25 @@ function weightedColor(profile) {
33604
33785
  return selectedCat.colors[Math.floor(Math.random() * selectedCat.colors.length)];
33605
33786
  }
33606
33787
  function loadCachedDescriptors(repoRoot) {
33607
- const filePath = join41(repoRoot, OA_DIR, "context", DESCRIPTOR_FILE);
33788
+ const filePath = join42(repoRoot, OA_DIR, "context", DESCRIPTOR_FILE);
33608
33789
  try {
33609
- if (!existsSync31(filePath))
33790
+ if (!existsSync32(filePath))
33610
33791
  return null;
33611
- const cached = JSON.parse(readFileSync22(filePath, "utf-8"));
33792
+ const cached = JSON.parse(readFileSync23(filePath, "utf-8"));
33612
33793
  return cached.phrases.length > 0 ? cached.phrases : null;
33613
33794
  } catch {
33614
33795
  return null;
33615
33796
  }
33616
33797
  }
33617
33798
  function saveCachedDescriptors(repoRoot, phrases, sourceHash) {
33618
- const contextDir = join41(repoRoot, OA_DIR, "context");
33799
+ const contextDir = join42(repoRoot, OA_DIR, "context");
33619
33800
  mkdirSync11(contextDir, { recursive: true });
33620
33801
  const cached = {
33621
33802
  phrases,
33622
33803
  generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
33623
33804
  sourceHash
33624
33805
  };
33625
- writeFileSync11(join41(contextDir, DESCRIPTOR_FILE), JSON.stringify(cached, null, 2), "utf-8");
33806
+ writeFileSync12(join42(contextDir, DESCRIPTOR_FILE), JSON.stringify(cached, null, 2), "utf-8");
33626
33807
  }
33627
33808
  function generateDescriptors(repoRoot) {
33628
33809
  const profile = loadToolProfile(repoRoot);
@@ -33670,11 +33851,11 @@ function generateDescriptors(repoRoot) {
33670
33851
  return phrases;
33671
33852
  }
33672
33853
  function extractFromPackageJson(repoRoot, tags) {
33673
- const pkgPath = join41(repoRoot, "package.json");
33854
+ const pkgPath = join42(repoRoot, "package.json");
33674
33855
  try {
33675
- if (!existsSync31(pkgPath))
33856
+ if (!existsSync32(pkgPath))
33676
33857
  return;
33677
- const pkg = JSON.parse(readFileSync22(pkgPath, "utf-8"));
33858
+ const pkg = JSON.parse(readFileSync23(pkgPath, "utf-8"));
33678
33859
  if (pkg.name && typeof pkg.name === "string") {
33679
33860
  const parts = pkg.name.replace(/^@/, "").split("/");
33680
33861
  for (const p of parts)
@@ -33718,7 +33899,7 @@ function extractFromManifests(repoRoot, tags) {
33718
33899
  { file: ".github/workflows", tag: "ci/cd" }
33719
33900
  ];
33720
33901
  for (const check of manifestChecks) {
33721
- if (existsSync31(join41(repoRoot, check.file))) {
33902
+ if (existsSync32(join42(repoRoot, check.file))) {
33722
33903
  tags.push(check.tag);
33723
33904
  }
33724
33905
  }
@@ -33740,16 +33921,16 @@ function extractFromSessions(repoRoot, tags) {
33740
33921
  }
33741
33922
  }
33742
33923
  function extractFromMemory(repoRoot, tags) {
33743
- const memoryDir = join41(repoRoot, OA_DIR, "memory");
33924
+ const memoryDir = join42(repoRoot, OA_DIR, "memory");
33744
33925
  try {
33745
- if (!existsSync31(memoryDir))
33926
+ if (!existsSync32(memoryDir))
33746
33927
  return;
33747
33928
  const files = readdirSync9(memoryDir).filter((f) => f.endsWith(".json"));
33748
33929
  for (const file of files) {
33749
33930
  const topic = file.replace(/\.json$/, "").replace(/[-_]/g, " ");
33750
33931
  tags.push(topic);
33751
33932
  try {
33752
- const data = JSON.parse(readFileSync22(join41(memoryDir, file), "utf-8"));
33933
+ const data = JSON.parse(readFileSync23(join42(memoryDir, file), "utf-8"));
33753
33934
  if (data && typeof data === "object") {
33754
33935
  const keys = Object.keys(data).slice(0, 3);
33755
33936
  for (const key of keys) {
@@ -33777,7 +33958,7 @@ function extractFromToolProfile(profile, tags) {
33777
33958
  }
33778
33959
  var TOOL_CATEGORIES, TOOL_PROFILE_FILE, DESCRIPTOR_FILE, CATEGORY_LABELS, STOP_WORDS;
33779
33960
  var init_carousel_descriptors = __esm({
33780
- "../packages/cli/dist/tui/carousel-descriptors.js"() {
33961
+ "packages/cli/dist/tui/carousel-descriptors.js"() {
33781
33962
  "use strict";
33782
33963
  init_oa_directory();
33783
33964
  TOOL_CATEGORIES = [
@@ -33883,26 +34064,26 @@ var init_carousel_descriptors = __esm({
33883
34064
  }
33884
34065
  });
33885
34066
 
33886
- // ../packages/cli/dist/tui/voice.js
33887
- import { existsSync as existsSync32, mkdirSync as mkdirSync12, writeFileSync as writeFileSync12, readFileSync as readFileSync23, unlinkSync as unlinkSync4 } from "node:fs";
33888
- import { join as join42 } from "node:path";
34067
+ // packages/cli/dist/tui/voice.js
34068
+ import { existsSync as existsSync33, mkdirSync as mkdirSync12, writeFileSync as writeFileSync13, readFileSync as readFileSync24, unlinkSync as unlinkSync5 } from "node:fs";
34069
+ import { join as join43 } from "node:path";
33889
34070
  import { homedir as homedir12, tmpdir as tmpdir6, platform as platform3 } from "node:os";
33890
34071
  import { execSync as execSync27, spawn as nodeSpawn } from "node:child_process";
33891
34072
  import { createRequire } from "node:module";
33892
34073
  function voiceDir() {
33893
- return join42(homedir12(), ".open-agents", "voice");
34074
+ return join43(homedir12(), ".open-agents", "voice");
33894
34075
  }
33895
34076
  function modelsDir() {
33896
- return join42(voiceDir(), "models");
34077
+ return join43(voiceDir(), "models");
33897
34078
  }
33898
34079
  function modelDir(id) {
33899
- return join42(modelsDir(), id);
34080
+ return join43(modelsDir(), id);
33900
34081
  }
33901
34082
  function modelOnnxPath(id) {
33902
- return join42(modelDir(id), "model.onnx");
34083
+ return join43(modelDir(id), "model.onnx");
33903
34084
  }
33904
34085
  function modelConfigPath(id) {
33905
- return join42(modelDir(id), "config.json");
34086
+ return join43(modelDir(id), "config.json");
33906
34087
  }
33907
34088
  function emotionToPitchBias(emotion, stark = false, autist = false) {
33908
34089
  if (autist)
@@ -34354,7 +34535,7 @@ function formatBytes2(bytes) {
34354
34535
  }
34355
34536
  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;
34356
34537
  var init_voice = __esm({
34357
- "../packages/cli/dist/tui/voice.js"() {
34538
+ "packages/cli/dist/tui/voice.js"() {
34358
34539
  "use strict";
34359
34540
  init_render();
34360
34541
  VOICE_MODELS = {
@@ -34762,11 +34943,11 @@ var init_voice = __esm({
34762
34943
  }
34763
34944
  this.onPCMOutput(Buffer.from(int16.buffer), sampleRate);
34764
34945
  }
34765
- const wavPath = join42(tmpdir6(), `oa-voice-${Date.now()}.wav`);
34946
+ const wavPath = join43(tmpdir6(), `oa-voice-${Date.now()}.wav`);
34766
34947
  this.writeWav(audioData, sampleRate, wavPath);
34767
34948
  await this.playWav(wavPath);
34768
34949
  try {
34769
- unlinkSync4(wavPath);
34950
+ unlinkSync5(wavPath);
34770
34951
  } catch {
34771
34952
  }
34772
34953
  }
@@ -34894,7 +35075,7 @@ var init_voice = __esm({
34894
35075
  return buffer;
34895
35076
  }
34896
35077
  writeWav(samples, sampleRate, path) {
34897
- writeFileSync12(path, this.buildWavBuffer(samples, sampleRate));
35078
+ writeFileSync13(path, this.buildWavBuffer(samples, sampleRate));
34898
35079
  }
34899
35080
  // -------------------------------------------------------------------------
34900
35081
  // Audio playback (system default speakers)
@@ -35053,7 +35234,7 @@ Error: ${err2 instanceof Error ? err2.message : String(err2)}`);
35053
35234
  const mlxModelId = model.mlxModelId ?? "mlx-community/Kokoro-82M-bf16";
35054
35235
  const mlxVoice = model.mlxVoice ?? "af_heart";
35055
35236
  const mlxLangCode = model.mlxLangCode ?? "a";
35056
- const wavPath = join42(tmpdir6(), `oa-mlx-${Date.now()}.wav`);
35237
+ const wavPath = join43(tmpdir6(), `oa-mlx-${Date.now()}.wav`);
35057
35238
  const pyScript = [
35058
35239
  "import sys, json",
35059
35240
  "from mlx_audio.tts import generate as tts_gen",
@@ -35070,11 +35251,11 @@ Error: ${err2 instanceof Error ? err2.message : String(err2)}`);
35070
35251
  return;
35071
35252
  }
35072
35253
  }
35073
- if (!existsSync32(wavPath))
35254
+ if (!existsSync33(wavPath))
35074
35255
  return;
35075
35256
  if (volume !== 1) {
35076
35257
  try {
35077
- const wavData = readFileSync23(wavPath);
35258
+ const wavData = readFileSync24(wavPath);
35078
35259
  if (wavData.length > 44) {
35079
35260
  const header = wavData.subarray(0, 44);
35080
35261
  const samples = new Int16Array(wavData.buffer, wavData.byteOffset + 44, (wavData.length - 44) / 2);
@@ -35082,14 +35263,14 @@ Error: ${err2 instanceof Error ? err2.message : String(err2)}`);
35082
35263
  samples[i] = Math.round(samples[i] * volume);
35083
35264
  }
35084
35265
  const scaled = Buffer.concat([header, Buffer.from(samples.buffer, samples.byteOffset, samples.byteLength)]);
35085
- writeFileSync12(wavPath, scaled);
35266
+ writeFileSync13(wavPath, scaled);
35086
35267
  }
35087
35268
  } catch {
35088
35269
  }
35089
35270
  }
35090
35271
  if (this.onPCMOutput) {
35091
35272
  try {
35092
- const wavData = readFileSync23(wavPath);
35273
+ const wavData = readFileSync24(wavPath);
35093
35274
  if (wavData.length > 44) {
35094
35275
  const pcm = Buffer.from(wavData.buffer, wavData.byteOffset + 44, wavData.length - 44);
35095
35276
  const sampleRate = wavData.readUInt32LE(24);
@@ -35100,7 +35281,7 @@ Error: ${err2 instanceof Error ? err2.message : String(err2)}`);
35100
35281
  }
35101
35282
  await this.playWav(wavPath);
35102
35283
  try {
35103
- unlinkSync4(wavPath);
35284
+ unlinkSync5(wavPath);
35104
35285
  } catch {
35105
35286
  }
35106
35287
  }
@@ -35121,7 +35302,7 @@ Error: ${err2 instanceof Error ? err2.message : String(err2)}`);
35121
35302
  const mlxModelId = model.mlxModelId ?? "mlx-community/Kokoro-82M-bf16";
35122
35303
  const mlxVoice = model.mlxVoice ?? "af_heart";
35123
35304
  const mlxLangCode = model.mlxLangCode ?? "a";
35124
- const wavPath = join42(tmpdir6(), `oa-mlx-buf-${Date.now()}.wav`);
35305
+ const wavPath = join43(tmpdir6(), `oa-mlx-buf-${Date.now()}.wav`);
35125
35306
  const pyScript = [
35126
35307
  "import sys, json",
35127
35308
  "from mlx_audio.tts import generate as tts_gen",
@@ -35138,11 +35319,11 @@ Error: ${err2 instanceof Error ? err2.message : String(err2)}`);
35138
35319
  return null;
35139
35320
  }
35140
35321
  }
35141
- if (!existsSync32(wavPath))
35322
+ if (!existsSync33(wavPath))
35142
35323
  return null;
35143
35324
  try {
35144
- const data = readFileSync23(wavPath);
35145
- unlinkSync4(wavPath);
35325
+ const data = readFileSync24(wavPath);
35326
+ unlinkSync5(wavPath);
35146
35327
  return data;
35147
35328
  } catch {
35148
35329
  return null;
@@ -35156,40 +35337,40 @@ Error: ${err2 instanceof Error ? err2.message : String(err2)}`);
35156
35337
  return;
35157
35338
  const arch = process.arch;
35158
35339
  mkdirSync12(voiceDir(), { recursive: true });
35159
- const pkgPath = join42(voiceDir(), "package.json");
35340
+ const pkgPath = join43(voiceDir(), "package.json");
35160
35341
  const expectedDeps = {
35161
35342
  "onnxruntime-node": "^1.21.0",
35162
35343
  "phonemizer": "^1.2.1"
35163
35344
  };
35164
- if (existsSync32(pkgPath)) {
35345
+ if (existsSync33(pkgPath)) {
35165
35346
  try {
35166
- const existing = JSON.parse(readFileSync23(pkgPath, "utf8"));
35347
+ const existing = JSON.parse(readFileSync24(pkgPath, "utf8"));
35167
35348
  if (!existing.dependencies?.["phonemizer"]) {
35168
35349
  existing.dependencies = { ...existing.dependencies, ...expectedDeps };
35169
- writeFileSync12(pkgPath, JSON.stringify(existing, null, 2));
35350
+ writeFileSync13(pkgPath, JSON.stringify(existing, null, 2));
35170
35351
  }
35171
35352
  } catch {
35172
35353
  }
35173
35354
  }
35174
- if (!existsSync32(pkgPath)) {
35175
- writeFileSync12(pkgPath, JSON.stringify({
35355
+ if (!existsSync33(pkgPath)) {
35356
+ writeFileSync13(pkgPath, JSON.stringify({
35176
35357
  name: "open-agents-voice",
35177
35358
  private: true,
35178
35359
  dependencies: expectedDeps
35179
35360
  }, null, 2));
35180
35361
  }
35181
- const voiceRequire = createRequire(join42(voiceDir(), "index.js"));
35362
+ const voiceRequire = createRequire(join43(voiceDir(), "index.js"));
35182
35363
  const probeOnnx = () => {
35183
35364
  try {
35184
- const result = execSync27(`node -e "try { require('onnxruntime-node'); console.log('OK'); } catch(e) { console.log('FAIL:' + e.message); }"`, { cwd: voiceDir(), stdio: "pipe", timeout: 15e3, env: { ...process.env, NODE_PATH: join42(voiceDir(), "node_modules") } });
35365
+ const result = execSync27(`node -e "try { require('onnxruntime-node'); console.log('OK'); } catch(e) { console.log('FAIL:' + e.message); }"`, { cwd: voiceDir(), stdio: "pipe", timeout: 15e3, env: { ...process.env, NODE_PATH: join43(voiceDir(), "node_modules") } });
35185
35366
  const output = result.toString().trim();
35186
35367
  return output === "OK";
35187
35368
  } catch {
35188
35369
  return false;
35189
35370
  }
35190
35371
  };
35191
- const onnxNodeModules = join42(voiceDir(), "node_modules", "onnxruntime-node");
35192
- const onnxInstalled = existsSync32(onnxNodeModules);
35372
+ const onnxNodeModules = join43(voiceDir(), "node_modules", "onnxruntime-node");
35373
+ const onnxInstalled = existsSync33(onnxNodeModules);
35193
35374
  if (onnxInstalled && !probeOnnx()) {
35194
35375
  throw new Error(`Voice synthesis unavailable: ONNX runtime crashes on this CPU (${process.platform}-${arch}). This is a known issue with some ARM SoCs where the CPU vendor is not recognized. Voice feedback will be disabled but all other features work normally.`);
35195
35376
  }
@@ -35247,18 +35428,18 @@ Error: ${err instanceof Error ? err.message : String(err)}`);
35247
35428
  const dir = modelDir(id);
35248
35429
  const onnxPath = modelOnnxPath(id);
35249
35430
  const configPath = modelConfigPath(id);
35250
- if (existsSync32(onnxPath) && existsSync32(configPath))
35431
+ if (existsSync33(onnxPath) && existsSync33(configPath))
35251
35432
  return;
35252
35433
  mkdirSync12(dir, { recursive: true });
35253
- if (!existsSync32(configPath)) {
35434
+ if (!existsSync33(configPath)) {
35254
35435
  renderInfo(`Downloading ${model.label} voice config...`);
35255
35436
  const configResp = await fetch(model.configUrl);
35256
35437
  if (!configResp.ok)
35257
35438
  throw new Error(`Failed to download config: HTTP ${configResp.status}`);
35258
35439
  const configText = await configResp.text();
35259
- writeFileSync12(configPath, configText);
35440
+ writeFileSync13(configPath, configText);
35260
35441
  }
35261
- if (!existsSync32(onnxPath)) {
35442
+ if (!existsSync33(onnxPath)) {
35262
35443
  renderInfo(`Downloading ${model.label} voice model (this may take a minute)...`);
35263
35444
  const onnxResp = await fetch(model.onnxUrl);
35264
35445
  if (!onnxResp.ok)
@@ -35283,7 +35464,7 @@ Error: ${err instanceof Error ? err.message : String(err)}`);
35283
35464
  }
35284
35465
  }
35285
35466
  const fullBuffer = Buffer.concat(chunks);
35286
- writeFileSync12(onnxPath, fullBuffer);
35467
+ writeFileSync13(onnxPath, fullBuffer);
35287
35468
  renderInfo(`${model.label} model downloaded (${formatBytes2(fullBuffer.length)}).`);
35288
35469
  }
35289
35470
  }
@@ -35295,10 +35476,10 @@ Error: ${err instanceof Error ? err.message : String(err)}`);
35295
35476
  throw new Error("ONNX runtime not loaded");
35296
35477
  const onnxPath = modelOnnxPath(this.modelId);
35297
35478
  const configPath = modelConfigPath(this.modelId);
35298
- if (!existsSync32(onnxPath) || !existsSync32(configPath)) {
35479
+ if (!existsSync33(onnxPath) || !existsSync33(configPath)) {
35299
35480
  throw new Error(`Model files not found for ${this.modelId}`);
35300
35481
  }
35301
- this.config = JSON.parse(readFileSync23(configPath, "utf8"));
35482
+ this.config = JSON.parse(readFileSync24(configPath, "utf8"));
35302
35483
  this.session = await this.ort.InferenceSession.create(onnxPath, {
35303
35484
  executionProviders: ["cpu"],
35304
35485
  graphOptimizationLevel: "all"
@@ -35671,7 +35852,7 @@ Error: ${err instanceof Error ? err.message : String(err)}`);
35671
35852
  }
35672
35853
  });
35673
35854
 
35674
- // ../packages/cli/dist/tui/stream-renderer.js
35855
+ // packages/cli/dist/tui/stream-renderer.js
35675
35856
  function fg2563(code, text) {
35676
35857
  return isTTY5 ? `\x1B[38;5;${code}m${text}\x1B[0m` : text;
35677
35858
  }
@@ -35689,7 +35870,7 @@ function boldText(text) {
35689
35870
  }
35690
35871
  var isTTY5, PASTEL, StreamRenderer;
35691
35872
  var init_stream_renderer = __esm({
35692
- "../packages/cli/dist/tui/stream-renderer.js"() {
35873
+ "packages/cli/dist/tui/stream-renderer.js"() {
35693
35874
  "use strict";
35694
35875
  isTTY5 = process.stdout.isTTY ?? false;
35695
35876
  PASTEL = {
@@ -36158,12 +36339,12 @@ var init_stream_renderer = __esm({
36158
36339
  }
36159
36340
  });
36160
36341
 
36161
- // ../packages/cli/dist/tui/edit-history.js
36342
+ // packages/cli/dist/tui/edit-history.js
36162
36343
  import { appendFileSync as appendFileSync2, mkdirSync as mkdirSync13 } from "node:fs";
36163
- import { join as join43 } from "node:path";
36344
+ import { join as join44 } from "node:path";
36164
36345
  function createEditHistoryLogger(repoRoot, sessionId) {
36165
- const historyDir = join43(repoRoot, ".oa", "history");
36166
- const logPath = join43(historyDir, "edits.jsonl");
36346
+ const historyDir = join44(repoRoot, ".oa", "history");
36347
+ const logPath = join44(historyDir, "edits.jsonl");
36167
36348
  try {
36168
36349
  mkdirSync13(historyDir, { recursive: true });
36169
36350
  } catch {
@@ -36262,7 +36443,7 @@ function sanitizeArgs(tool, args) {
36262
36443
  }
36263
36444
  var EDIT_TOOLS;
36264
36445
  var init_edit_history = __esm({
36265
- "../packages/cli/dist/tui/edit-history.js"() {
36446
+ "packages/cli/dist/tui/edit-history.js"() {
36266
36447
  "use strict";
36267
36448
  EDIT_TOOLS = /* @__PURE__ */ new Set([
36268
36449
  "file_edit",
@@ -36273,18 +36454,18 @@ var init_edit_history = __esm({
36273
36454
  }
36274
36455
  });
36275
36456
 
36276
- // ../packages/cli/dist/tui/promptLoader.js
36277
- import { readFileSync as readFileSync24, existsSync as existsSync33 } from "node:fs";
36278
- import { join as join44, dirname as dirname16 } from "node:path";
36457
+ // packages/cli/dist/tui/promptLoader.js
36458
+ import { readFileSync as readFileSync25, existsSync as existsSync34 } from "node:fs";
36459
+ import { join as join45, dirname as dirname16 } from "node:path";
36279
36460
  import { fileURLToPath as fileURLToPath11 } from "node:url";
36280
36461
  function loadPrompt3(promptPath, vars) {
36281
36462
  let content = cache3.get(promptPath);
36282
36463
  if (content === void 0) {
36283
- const fullPath = join44(PROMPTS_DIR3, promptPath);
36284
- if (!existsSync33(fullPath)) {
36464
+ const fullPath = join45(PROMPTS_DIR3, promptPath);
36465
+ if (!existsSync34(fullPath)) {
36285
36466
  throw new Error(`Prompt file not found: ${fullPath}`);
36286
36467
  }
36287
- content = readFileSync24(fullPath, "utf-8");
36468
+ content = readFileSync25(fullPath, "utf-8");
36288
36469
  cache3.set(promptPath, content);
36289
36470
  }
36290
36471
  if (!vars)
@@ -36293,27 +36474,27 @@ function loadPrompt3(promptPath, vars) {
36293
36474
  }
36294
36475
  var __filename3, __dirname6, devPath2, publishedPath2, PROMPTS_DIR3, cache3;
36295
36476
  var init_promptLoader3 = __esm({
36296
- "../packages/cli/dist/tui/promptLoader.js"() {
36477
+ "packages/cli/dist/tui/promptLoader.js"() {
36297
36478
  "use strict";
36298
36479
  __filename3 = fileURLToPath11(import.meta.url);
36299
36480
  __dirname6 = dirname16(__filename3);
36300
- devPath2 = join44(__dirname6, "..", "..", "prompts");
36301
- publishedPath2 = join44(__dirname6, "..", "prompts");
36302
- PROMPTS_DIR3 = existsSync33(devPath2) ? devPath2 : publishedPath2;
36481
+ devPath2 = join45(__dirname6, "..", "..", "prompts");
36482
+ publishedPath2 = join45(__dirname6, "..", "prompts");
36483
+ PROMPTS_DIR3 = existsSync34(devPath2) ? devPath2 : publishedPath2;
36303
36484
  cache3 = /* @__PURE__ */ new Map();
36304
36485
  }
36305
36486
  });
36306
36487
 
36307
- // ../packages/cli/dist/tui/dream-engine.js
36308
- import { mkdirSync as mkdirSync14, writeFileSync as writeFileSync13, readFileSync as readFileSync25, existsSync as existsSync34, cpSync, rmSync, readdirSync as readdirSync10 } from "node:fs";
36309
- import { join as join45, basename as basename12 } from "node:path";
36488
+ // packages/cli/dist/tui/dream-engine.js
36489
+ import { mkdirSync as mkdirSync14, writeFileSync as writeFileSync14, readFileSync as readFileSync26, existsSync as existsSync35, cpSync, rmSync, readdirSync as readdirSync10 } from "node:fs";
36490
+ import { join as join46, basename as basename12 } from "node:path";
36310
36491
  import { execSync as execSync28 } from "node:child_process";
36311
36492
  function loadAutoresearchMemory(repoRoot) {
36312
- const memoryPath = join45(repoRoot, ".oa", "memory", "autoresearch.json");
36313
- if (!existsSync34(memoryPath))
36493
+ const memoryPath = join46(repoRoot, ".oa", "memory", "autoresearch.json");
36494
+ if (!existsSync35(memoryPath))
36314
36495
  return "";
36315
36496
  try {
36316
- const raw = readFileSync25(memoryPath, "utf-8");
36497
+ const raw = readFileSync26(memoryPath, "utf-8");
36317
36498
  const data = JSON.parse(raw);
36318
36499
  const sections = [];
36319
36500
  for (const key of AUTORESEARCH_MEMORY_KEYS) {
@@ -36467,7 +36648,7 @@ function renderSwarmComplete(workspace) {
36467
36648
  }
36468
36649
  var SWARM_ROLE_CONFIG, AutoresearchFileWriteTool, AutoresearchFileEditTool, AUTORESEARCH_MEMORY_KEYS, SLEEP_STAGES, DreamFileWriteTool, DreamFileEditTool, DreamShellTool, DreamEngine;
36469
36650
  var init_dream_engine = __esm({
36470
- "../packages/cli/dist/tui/dream-engine.js"() {
36651
+ "packages/cli/dist/tui/dream-engine.js"() {
36471
36652
  "use strict";
36472
36653
  init_dist5();
36473
36654
  init_dist2();
@@ -36503,14 +36684,14 @@ var init_dream_engine = __esm({
36503
36684
  const content = String(args["content"] ?? "");
36504
36685
  if (!rawPath)
36505
36686
  return { success: false, output: "", error: "path is required", durationMs: Date.now() - start };
36506
- const targetPath = rawPath.startsWith("/") || rawPath.startsWith(".oa/autoresearch") ? join45(this.autoresearchDir, basename12(rawPath)) : join45(this.autoresearchDir, rawPath);
36687
+ const targetPath = rawPath.startsWith("/") || rawPath.startsWith(".oa/autoresearch") ? join46(this.autoresearchDir, basename12(rawPath)) : join46(this.autoresearchDir, rawPath);
36507
36688
  if (!targetPath.startsWith(this.autoresearchDir)) {
36508
36689
  return { success: false, output: "", error: "Autoresearch mode: writes are confined to .oa/autoresearch/", durationMs: Date.now() - start };
36509
36690
  }
36510
36691
  try {
36511
- const dir = join45(targetPath, "..");
36692
+ const dir = join46(targetPath, "..");
36512
36693
  mkdirSync14(dir, { recursive: true });
36513
- writeFileSync13(targetPath, content, "utf-8");
36694
+ writeFileSync14(targetPath, content, "utf-8");
36514
36695
  return { success: true, output: `Wrote ${content.length} bytes to ${rawPath}`, durationMs: Date.now() - start };
36515
36696
  } catch (err) {
36516
36697
  return { success: false, output: "", error: String(err), durationMs: Date.now() - start };
@@ -36538,20 +36719,20 @@ var init_dream_engine = __esm({
36538
36719
  const rawPath = String(args["path"] ?? "");
36539
36720
  const oldStr = String(args["old_string"] ?? "");
36540
36721
  const newStr = String(args["new_string"] ?? "");
36541
- const targetPath = rawPath.startsWith("/") || rawPath.startsWith(".oa/autoresearch") ? join45(this.autoresearchDir, basename12(rawPath)) : join45(this.autoresearchDir, rawPath);
36722
+ const targetPath = rawPath.startsWith("/") || rawPath.startsWith(".oa/autoresearch") ? join46(this.autoresearchDir, basename12(rawPath)) : join46(this.autoresearchDir, rawPath);
36542
36723
  if (!targetPath.startsWith(this.autoresearchDir)) {
36543
36724
  return { success: false, output: "", error: "Autoresearch mode: edits are confined to .oa/autoresearch/", durationMs: Date.now() - start };
36544
36725
  }
36545
36726
  try {
36546
- if (!existsSync34(targetPath)) {
36727
+ if (!existsSync35(targetPath)) {
36547
36728
  return { success: false, output: "", error: `File not found: ${rawPath}`, durationMs: Date.now() - start };
36548
36729
  }
36549
- let content = readFileSync25(targetPath, "utf-8");
36730
+ let content = readFileSync26(targetPath, "utf-8");
36550
36731
  if (!content.includes(oldStr)) {
36551
36732
  return { success: false, output: "", error: "old_string not found in file", durationMs: Date.now() - start };
36552
36733
  }
36553
36734
  content = content.replace(oldStr, newStr);
36554
- writeFileSync13(targetPath, content, "utf-8");
36735
+ writeFileSync14(targetPath, content, "utf-8");
36555
36736
  return { success: true, output: `Edited ${rawPath}`, durationMs: Date.now() - start };
36556
36737
  } catch (err) {
36557
36738
  return { success: false, output: "", error: String(err), durationMs: Date.now() - start };
@@ -36592,14 +36773,14 @@ var init_dream_engine = __esm({
36592
36773
  const content = String(args["content"] ?? "");
36593
36774
  if (!rawPath)
36594
36775
  return { success: false, output: "", error: "path is required", durationMs: Date.now() - start };
36595
- const targetPath = rawPath.startsWith("/") || rawPath.startsWith(".oa/dreams") ? join45(this.dreamsDir, basename12(rawPath)) : join45(this.dreamsDir, rawPath);
36776
+ const targetPath = rawPath.startsWith("/") || rawPath.startsWith(".oa/dreams") ? join46(this.dreamsDir, basename12(rawPath)) : join46(this.dreamsDir, rawPath);
36596
36777
  if (!targetPath.startsWith(this.dreamsDir)) {
36597
36778
  return { success: false, output: "", error: "Dream mode: writes are confined to .oa/dreams/", durationMs: Date.now() - start };
36598
36779
  }
36599
36780
  try {
36600
- const dir = join45(targetPath, "..");
36781
+ const dir = join46(targetPath, "..");
36601
36782
  mkdirSync14(dir, { recursive: true });
36602
- writeFileSync13(targetPath, content, "utf-8");
36783
+ writeFileSync14(targetPath, content, "utf-8");
36603
36784
  return { success: true, output: `Wrote ${content.length} bytes to ${rawPath}`, durationMs: Date.now() - start };
36604
36785
  } catch (err) {
36605
36786
  return { success: false, output: "", error: String(err), durationMs: Date.now() - start };
@@ -36627,20 +36808,20 @@ var init_dream_engine = __esm({
36627
36808
  const rawPath = String(args["path"] ?? "");
36628
36809
  const oldStr = String(args["old_string"] ?? "");
36629
36810
  const newStr = String(args["new_string"] ?? "");
36630
- const targetPath = rawPath.startsWith("/") || rawPath.startsWith(".oa/dreams") ? join45(this.dreamsDir, basename12(rawPath)) : join45(this.dreamsDir, rawPath);
36811
+ const targetPath = rawPath.startsWith("/") || rawPath.startsWith(".oa/dreams") ? join46(this.dreamsDir, basename12(rawPath)) : join46(this.dreamsDir, rawPath);
36631
36812
  if (!targetPath.startsWith(this.dreamsDir)) {
36632
36813
  return { success: false, output: "", error: "Dream mode: edits are confined to .oa/dreams/", durationMs: Date.now() - start };
36633
36814
  }
36634
36815
  try {
36635
- if (!existsSync34(targetPath)) {
36816
+ if (!existsSync35(targetPath)) {
36636
36817
  return { success: false, output: "", error: `File not found: ${rawPath}`, durationMs: Date.now() - start };
36637
36818
  }
36638
- let content = readFileSync25(targetPath, "utf-8");
36819
+ let content = readFileSync26(targetPath, "utf-8");
36639
36820
  if (!content.includes(oldStr)) {
36640
36821
  return { success: false, output: "", error: "old_string not found in file", durationMs: Date.now() - start };
36641
36822
  }
36642
36823
  content = content.replace(oldStr, newStr);
36643
- writeFileSync13(targetPath, content, "utf-8");
36824
+ writeFileSync14(targetPath, content, "utf-8");
36644
36825
  return { success: true, output: `Edited ${rawPath}`, durationMs: Date.now() - start };
36645
36826
  } catch (err) {
36646
36827
  return { success: false, output: "", error: String(err), durationMs: Date.now() - start };
@@ -36694,7 +36875,7 @@ var init_dream_engine = __esm({
36694
36875
  constructor(config, repoRoot) {
36695
36876
  this.config = config;
36696
36877
  this.repoRoot = repoRoot;
36697
- this.dreamsDir = join45(repoRoot, ".oa", "dreams");
36878
+ this.dreamsDir = join46(repoRoot, ".oa", "dreams");
36698
36879
  this.state = {
36699
36880
  mode: "default",
36700
36881
  active: false,
@@ -36778,8 +36959,8 @@ ${result.summary}`;
36778
36959
  if (mode !== "default" || cycle === totalCycles) {
36779
36960
  renderDreamContraction(cycle);
36780
36961
  const cycleSummary = this.buildCycleSummary(cycle, previousFindings);
36781
- const summaryPath = join45(this.dreamsDir, `cycle-${cycle}-summary.md`);
36782
- writeFileSync13(summaryPath, cycleSummary, "utf-8");
36962
+ const summaryPath = join46(this.dreamsDir, `cycle-${cycle}-summary.md`);
36963
+ writeFileSync14(summaryPath, cycleSummary, "utf-8");
36783
36964
  }
36784
36965
  if (mode === "lucid" && !this.abortController.signal.aborted) {
36785
36966
  this.saveVersionCheckpoint(cycle);
@@ -36991,7 +37172,7 @@ After synthesis, call task_complete with the final prioritized summary.`, toolMo
36991
37172
  }
36992
37173
  /** Build role-specific tool sets for swarm agents */
36993
37174
  buildSwarmTools(role, _workspace) {
36994
- const autoresearchDir = join45(this.repoRoot, ".oa", "autoresearch");
37175
+ const autoresearchDir = join46(this.repoRoot, ".oa", "autoresearch");
36995
37176
  const taskComplete = this.createSwarmTaskCompleteTool(role);
36996
37177
  switch (role) {
36997
37178
  case "researcher": {
@@ -37355,7 +37536,7 @@ INSTRUCTIONS:
37355
37536
  2. Summarize the key learnings and next steps
37356
37537
 
37357
37538
  Call task_complete with a human-readable summary of the autoresearch session.`, workspace, onEvent);
37358
- const reportPath = join45(this.dreamsDir, `cycle-${cycleNum}-autoresearch-report.md`);
37539
+ const reportPath = join46(this.dreamsDir, `cycle-${cycleNum}-autoresearch-report.md`);
37359
37540
  const report = `# Autoresearch Swarm Report \u2014 Cycle ${cycleNum}
37360
37541
 
37361
37542
  **Date**: ${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}
@@ -37378,7 +37559,7 @@ ${summaryResult}
37378
37559
  `;
37379
37560
  try {
37380
37561
  mkdirSync14(this.dreamsDir, { recursive: true });
37381
- writeFileSync13(reportPath, report, "utf-8");
37562
+ writeFileSync14(reportPath, report, "utf-8");
37382
37563
  } catch {
37383
37564
  }
37384
37565
  renderSwarmComplete(workspace);
@@ -37444,7 +37625,7 @@ ${summaryResult}
37444
37625
  }
37445
37626
  /** Save workspace backup for lucid mode */
37446
37627
  saveVersionCheckpoint(cycle) {
37447
- const checkpointDir = join45(this.dreamsDir, "checkpoints", `cycle-${cycle}`);
37628
+ const checkpointDir = join46(this.dreamsDir, "checkpoints", `cycle-${cycle}`);
37448
37629
  try {
37449
37630
  mkdirSync14(checkpointDir, { recursive: true });
37450
37631
  try {
@@ -37463,10 +37644,10 @@ ${summaryResult}
37463
37644
  encoding: "utf-8",
37464
37645
  timeout: 5e3
37465
37646
  }).trim();
37466
- writeFileSync13(join45(checkpointDir, "git-status.txt"), gitStatus, "utf-8");
37467
- writeFileSync13(join45(checkpointDir, "git-diff.patch"), gitDiff, "utf-8");
37468
- writeFileSync13(join45(checkpointDir, "git-hash.txt"), gitHash, "utf-8");
37469
- writeFileSync13(join45(checkpointDir, "checkpoint.json"), JSON.stringify({
37647
+ writeFileSync14(join46(checkpointDir, "git-status.txt"), gitStatus, "utf-8");
37648
+ writeFileSync14(join46(checkpointDir, "git-diff.patch"), gitDiff, "utf-8");
37649
+ writeFileSync14(join46(checkpointDir, "git-hash.txt"), gitHash, "utf-8");
37650
+ writeFileSync14(join46(checkpointDir, "checkpoint.json"), JSON.stringify({
37470
37651
  cycle,
37471
37652
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
37472
37653
  gitHash,
@@ -37474,7 +37655,7 @@ ${summaryResult}
37474
37655
  }, null, 2), "utf-8");
37475
37656
  renderInfo(`Checkpoint saved: cycle ${cycle} (${gitHash.slice(0, 8)})`);
37476
37657
  } catch {
37477
- writeFileSync13(join45(checkpointDir, "checkpoint.json"), JSON.stringify({ cycle, timestamp: (/* @__PURE__ */ new Date()).toISOString(), mode: this.state.mode }, null, 2), "utf-8");
37658
+ writeFileSync14(join46(checkpointDir, "checkpoint.json"), JSON.stringify({ cycle, timestamp: (/* @__PURE__ */ new Date()).toISOString(), mode: this.state.mode }, null, 2), "utf-8");
37478
37659
  renderInfo(`Checkpoint saved: cycle ${cycle} (no git)`);
37479
37660
  }
37480
37661
  } catch (err) {
@@ -37532,14 +37713,14 @@ ${files.map((f) => `- [\`${f}\`](./${f})`).join("\n")}
37532
37713
  ---
37533
37714
  *Auto-generated by open-agents dream engine*
37534
37715
  `;
37535
- writeFileSync13(join45(this.dreamsDir, "PROPOSAL-INDEX.md"), index, "utf-8");
37716
+ writeFileSync14(join46(this.dreamsDir, "PROPOSAL-INDEX.md"), index, "utf-8");
37536
37717
  } catch {
37537
37718
  }
37538
37719
  }
37539
37720
  /** Save dream state for resume/inspection */
37540
37721
  saveDreamState() {
37541
37722
  try {
37542
- writeFileSync13(join45(this.dreamsDir, "dream-state.json"), JSON.stringify(this.state, null, 2) + "\n", "utf-8");
37723
+ writeFileSync14(join46(this.dreamsDir, "dream-state.json"), JSON.stringify(this.state, null, 2) + "\n", "utf-8");
37543
37724
  } catch {
37544
37725
  }
37545
37726
  }
@@ -37547,7 +37728,7 @@ ${files.map((f) => `- [\`${f}\`](./${f})`).join("\n")}
37547
37728
  }
37548
37729
  });
37549
37730
 
37550
- // ../packages/cli/dist/tui/priority-ingress.js
37731
+ // packages/cli/dist/tui/priority-ingress.js
37551
37732
  function classifyPriority(prompt, source, origin) {
37552
37733
  for (const rule of CLASSIFICATION_RULES) {
37553
37734
  if (rule.sourceType !== "any" && rule.sourceType !== source)
@@ -37572,7 +37753,7 @@ function classifyPriority(prompt, source, origin) {
37572
37753
  }
37573
37754
  var PRIORITY_WEIGHT, PRIORITY_POLICIES, CLASSIFICATION_RULES, PriorityIngressEngine;
37574
37755
  var init_priority_ingress = __esm({
37575
- "../packages/cli/dist/tui/priority-ingress.js"() {
37756
+ "packages/cli/dist/tui/priority-ingress.js"() {
37576
37757
  "use strict";
37577
37758
  PRIORITY_WEIGHT = {
37578
37759
  critical: 100,
@@ -37757,7 +37938,7 @@ var init_priority_ingress = __esm({
37757
37938
  }
37758
37939
  });
37759
37940
 
37760
- // ../packages/cli/dist/tui/bless-engine.js
37941
+ // packages/cli/dist/tui/bless-engine.js
37761
37942
  function renderBlessStart() {
37762
37943
  process.stdout.write(`
37763
37944
  ${c2.green("\u26A1")} ${c2.bold("BLESSED")} \u2014 Infinite warm loop activated
@@ -37781,7 +37962,7 @@ function renderBlessStop(state) {
37781
37962
  }
37782
37963
  var BlessEngine;
37783
37964
  var init_bless_engine = __esm({
37784
- "../packages/cli/dist/tui/bless-engine.js"() {
37965
+ "packages/cli/dist/tui/bless-engine.js"() {
37785
37966
  "use strict";
37786
37967
  init_render();
37787
37968
  init_dist2();
@@ -37912,9 +38093,9 @@ var init_bless_engine = __esm({
37912
38093
  }
37913
38094
  });
37914
38095
 
37915
- // ../packages/cli/dist/tui/dmn-engine.js
37916
- import { existsSync as existsSync35, readFileSync as readFileSync26, writeFileSync as writeFileSync14, mkdirSync as mkdirSync15, readdirSync as readdirSync11, unlinkSync as unlinkSync5 } from "node:fs";
37917
- import { join as join46, basename as basename13 } from "node:path";
38096
+ // packages/cli/dist/tui/dmn-engine.js
38097
+ import { existsSync as existsSync36, readFileSync as readFileSync27, writeFileSync as writeFileSync15, mkdirSync as mkdirSync15, readdirSync as readdirSync11, unlinkSync as unlinkSync6 } from "node:fs";
38098
+ import { join as join47, basename as basename13 } from "node:path";
37918
38099
  function buildDMNGatherPrompt(recentTaskSummaries, dueReminders, attentionItems, memoryTopics, capabilities, competence, reflectionBuffer) {
37919
38100
  const competenceReport = competence.length > 0 ? competence.map((c3) => {
37920
38101
  const rate = c3.attempts > 0 ? Math.round(c3.successes / c3.attempts * 100) : 0;
@@ -38000,7 +38181,7 @@ function renderDMNResting(consecutiveNulls) {
38000
38181
  }
38001
38182
  var DMNEngine;
38002
38183
  var init_dmn_engine = __esm({
38003
- "../packages/cli/dist/tui/dmn-engine.js"() {
38184
+ "packages/cli/dist/tui/dmn-engine.js"() {
38004
38185
  "use strict";
38005
38186
  init_dist5();
38006
38187
  init_dist2();
@@ -38027,8 +38208,8 @@ var init_dmn_engine = __esm({
38027
38208
  constructor(config, repoRoot) {
38028
38209
  this.config = config;
38029
38210
  this.repoRoot = repoRoot;
38030
- this.stateDir = join46(repoRoot, ".oa", "dmn");
38031
- this.historyDir = join46(repoRoot, ".oa", "dmn", "cycles");
38211
+ this.stateDir = join47(repoRoot, ".oa", "dmn");
38212
+ this.historyDir = join47(repoRoot, ".oa", "dmn", "cycles");
38032
38213
  mkdirSync15(this.historyDir, { recursive: true });
38033
38214
  this.loadState();
38034
38215
  }
@@ -38618,11 +38799,11 @@ OUTPUT: Call task_complete with JSON:
38618
38799
  async gatherMemoryTopics() {
38619
38800
  const topics = [];
38620
38801
  const dirs = [
38621
- join46(this.repoRoot, ".oa", "memory"),
38622
- join46(this.repoRoot, ".open-agents", "memory")
38802
+ join47(this.repoRoot, ".oa", "memory"),
38803
+ join47(this.repoRoot, ".open-agents", "memory")
38623
38804
  ];
38624
38805
  for (const dir of dirs) {
38625
- if (!existsSync35(dir))
38806
+ if (!existsSync36(dir))
38626
38807
  continue;
38627
38808
  try {
38628
38809
  const files = readdirSync11(dir).filter((f) => f.endsWith(".json"));
@@ -38638,29 +38819,29 @@ OUTPUT: Call task_complete with JSON:
38638
38819
  }
38639
38820
  // ── State persistence ─────────────────────────────────────────────────
38640
38821
  loadState() {
38641
- const path = join46(this.stateDir, "state.json");
38642
- if (existsSync35(path)) {
38822
+ const path = join47(this.stateDir, "state.json");
38823
+ if (existsSync36(path)) {
38643
38824
  try {
38644
- this.state = JSON.parse(readFileSync26(path, "utf-8"));
38825
+ this.state = JSON.parse(readFileSync27(path, "utf-8"));
38645
38826
  } catch {
38646
38827
  }
38647
38828
  }
38648
38829
  }
38649
38830
  saveState() {
38650
38831
  try {
38651
- writeFileSync14(join46(this.stateDir, "state.json"), JSON.stringify(this.state, null, 2) + "\n", "utf-8");
38832
+ writeFileSync15(join47(this.stateDir, "state.json"), JSON.stringify(this.state, null, 2) + "\n", "utf-8");
38652
38833
  } catch {
38653
38834
  }
38654
38835
  }
38655
38836
  saveCycleResult(result) {
38656
38837
  try {
38657
38838
  const filename = `cycle-${result.cycleNumber}-${Date.now()}.json`;
38658
- writeFileSync14(join46(this.historyDir, filename), JSON.stringify(result, null, 2) + "\n", "utf-8");
38839
+ writeFileSync15(join47(this.historyDir, filename), JSON.stringify(result, null, 2) + "\n", "utf-8");
38659
38840
  const files = readdirSync11(this.historyDir).filter((f) => f.startsWith("cycle-") && f.endsWith(".json")).sort();
38660
38841
  if (files.length > 50) {
38661
38842
  for (const old of files.slice(0, files.length - 50)) {
38662
38843
  try {
38663
- unlinkSync5(join46(this.historyDir, old));
38844
+ unlinkSync6(join47(this.historyDir, old));
38664
38845
  } catch {
38665
38846
  }
38666
38847
  }
@@ -38672,9 +38853,9 @@ OUTPUT: Call task_complete with JSON:
38672
38853
  }
38673
38854
  });
38674
38855
 
38675
- // ../packages/cli/dist/tui/snr-engine.js
38676
- import { existsSync as existsSync36, readdirSync as readdirSync12, readFileSync as readFileSync27 } from "node:fs";
38677
- import { join as join47, basename as basename14 } from "node:path";
38856
+ // packages/cli/dist/tui/snr-engine.js
38857
+ import { existsSync as existsSync37, readdirSync as readdirSync12, readFileSync as readFileSync28 } from "node:fs";
38858
+ import { join as join48, basename as basename14 } from "node:path";
38678
38859
  function computeDPrime(signalScores, noiseScores) {
38679
38860
  if (signalScores.length === 0 || noiseScores.length === 0)
38680
38861
  return 0;
@@ -38732,7 +38913,7 @@ function adaptTool4(tool) {
38732
38913
  }
38733
38914
  var SNREngine;
38734
38915
  var init_snr_engine = __esm({
38735
- "../packages/cli/dist/tui/snr-engine.js"() {
38916
+ "packages/cli/dist/tui/snr-engine.js"() {
38736
38917
  "use strict";
38737
38918
  init_dist5();
38738
38919
  init_dist2();
@@ -38914,11 +39095,11 @@ Call task_complete with the JSON array when done.`, onEvent)
38914
39095
  loadMemoryEntries(topics) {
38915
39096
  const entries = [];
38916
39097
  const dirs = [
38917
- join47(this.repoRoot, ".oa", "memory"),
38918
- join47(this.repoRoot, ".open-agents", "memory")
39098
+ join48(this.repoRoot, ".oa", "memory"),
39099
+ join48(this.repoRoot, ".open-agents", "memory")
38919
39100
  ];
38920
39101
  for (const dir of dirs) {
38921
- if (!existsSync36(dir))
39102
+ if (!existsSync37(dir))
38922
39103
  continue;
38923
39104
  try {
38924
39105
  const files = readdirSync12(dir).filter((f) => f.endsWith(".json"));
@@ -38927,7 +39108,7 @@ Call task_complete with the JSON array when done.`, onEvent)
38927
39108
  if (topics.length > 0 && !topics.includes(topic))
38928
39109
  continue;
38929
39110
  try {
38930
- const data = JSON.parse(readFileSync27(join47(dir, f), "utf-8"));
39111
+ const data = JSON.parse(readFileSync28(join48(dir, f), "utf-8"));
38931
39112
  for (const [key, val] of Object.entries(data)) {
38932
39113
  const value = typeof val === "object" && val !== null && "value" in val ? String(val.value) : String(val);
38933
39114
  entries.push({ topic, key, value });
@@ -39007,7 +39188,7 @@ Call task_complete with the JSON array when done.`, onEvent)
39007
39188
  }
39008
39189
  });
39009
39190
 
39010
- // ../packages/cli/dist/tui/emotion-engine.js
39191
+ // packages/cli/dist/tui/emotion-engine.js
39011
39192
  function labelFromCoordinates(valence, arousal) {
39012
39193
  if (valence > 0.6 && arousal > 0.6)
39013
39194
  return { label: "exhilarated", emoji: "\u{1F929}" };
@@ -39068,7 +39249,7 @@ function clamp(value, min, max) {
39068
39249
  }
39069
39250
  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;
39070
39251
  var init_emotion_engine = __esm({
39071
- "../packages/cli/dist/tui/emotion-engine.js"() {
39252
+ "packages/cli/dist/tui/emotion-engine.js"() {
39072
39253
  "use strict";
39073
39254
  init_dist5();
39074
39255
  init_promptLoader3();
@@ -39414,7 +39595,7 @@ var init_emotion_engine = __esm({
39414
39595
  }
39415
39596
  });
39416
39597
 
39417
- // ../packages/cli/dist/tui/tool-policy.js
39598
+ // packages/cli/dist/tui/tool-policy.js
39418
39599
  function getDefaultPolicy(context) {
39419
39600
  switch (context) {
39420
39601
  case "terminal":
@@ -39464,7 +39645,7 @@ function applyToolPolicy(tools, context, userConfig) {
39464
39645
  }
39465
39646
  var SAFE_PUBLIC_TOOLS, SAFE_GROUP_ADMIN_TOOLS;
39466
39647
  var init_tool_policy = __esm({
39467
- "../packages/cli/dist/tui/tool-policy.js"() {
39648
+ "packages/cli/dist/tui/tool-policy.js"() {
39468
39649
  "use strict";
39469
39650
  SAFE_PUBLIC_TOOLS = /* @__PURE__ */ new Set([
39470
39651
  "memory_read",
@@ -39493,9 +39674,9 @@ var init_tool_policy = __esm({
39493
39674
  }
39494
39675
  });
39495
39676
 
39496
- // ../packages/cli/dist/tui/telegram-bridge.js
39497
- import { mkdirSync as mkdirSync16, existsSync as existsSync37, unlinkSync as unlinkSync6, readdirSync as readdirSync13, statSync as statSync10 } from "node:fs";
39498
- import { join as join48, resolve as resolve27 } from "node:path";
39677
+ // packages/cli/dist/tui/telegram-bridge.js
39678
+ import { mkdirSync as mkdirSync16, existsSync as existsSync38, unlinkSync as unlinkSync7, readdirSync as readdirSync13, statSync as statSync10 } from "node:fs";
39679
+ import { join as join49, resolve as resolve27 } from "node:path";
39499
39680
  import { writeFile as writeFileAsync } from "node:fs/promises";
39500
39681
  function convertMarkdownToTelegramHTML(md) {
39501
39682
  let html = md;
@@ -39630,7 +39811,7 @@ function renderTelegramSubAgentError(username, error) {
39630
39811
  }
39631
39812
  var TELEGRAM_SAFETY_PROMPT, ADMIN_DM_PROMPT, ADMIN_GROUP_PROMPT, GROUP_REPLY_DISCRETION_PROMPT, MEDIA_CACHE_TTL_MS, TelegramBridge;
39632
39813
  var init_telegram_bridge = __esm({
39633
- "../packages/cli/dist/tui/telegram-bridge.js"() {
39814
+ "packages/cli/dist/tui/telegram-bridge.js"() {
39634
39815
  "use strict";
39635
39816
  init_dist5();
39636
39817
  init_dist2();
@@ -40260,7 +40441,7 @@ Telegram admin: @${msg.username}` : `Telegram ${isGroup ? "group" : "public"} ch
40260
40441
  return null;
40261
40442
  const buffer = Buffer.from(await res.arrayBuffer());
40262
40443
  const fileName = `${Date.now()}-${fileId.slice(0, 8)}${extension}`;
40263
- const localPath = join48(this.mediaCacheDir, fileName);
40444
+ const localPath = join49(this.mediaCacheDir, fileName);
40264
40445
  await writeFileAsync(localPath, buffer);
40265
40446
  return localPath;
40266
40447
  } catch {
@@ -40348,7 +40529,7 @@ Telegram admin: @${msg.username}` : `Telegram ${isGroup ? "group" : "public"} ch
40348
40529
  for (const [key, entry] of this.mediaCache) {
40349
40530
  if (now - entry.cachedAt > MEDIA_CACHE_TTL_MS) {
40350
40531
  try {
40351
- unlinkSync6(entry.localPath);
40532
+ unlinkSync7(entry.localPath);
40352
40533
  } catch {
40353
40534
  }
40354
40535
  this.mediaCache.delete(key);
@@ -40669,7 +40850,7 @@ ${caption}\r
40669
40850
  }
40670
40851
  });
40671
40852
 
40672
- // ../packages/cli/dist/tui/braille-spinner.js
40853
+ // packages/cli/dist/tui/braille-spinner.js
40673
40854
  function buildColorRamp(ramp) {
40674
40855
  return [...ramp, ...ramp.slice(1, -1).reverse()];
40675
40856
  }
@@ -40711,7 +40892,7 @@ function themeForTool(toolName) {
40711
40892
  }
40712
40893
  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;
40713
40894
  var init_braille_spinner = __esm({
40714
- "../packages/cli/dist/tui/braille-spinner.js"() {
40895
+ "packages/cli/dist/tui/braille-spinner.js"() {
40715
40896
  "use strict";
40716
40897
  DENSITY = [
40717
40898
  "\u2800",
@@ -40908,10 +41089,10 @@ var init_braille_spinner = __esm({
40908
41089
  }
40909
41090
  });
40910
41091
 
40911
- // ../packages/cli/dist/tui/status-bar.js
41092
+ // packages/cli/dist/tui/status-bar.js
40912
41093
  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;
40913
41094
  var init_status_bar = __esm({
40914
- "../packages/cli/dist/tui/status-bar.js"() {
41095
+ "packages/cli/dist/tui/status-bar.js"() {
40915
41096
  "use strict";
40916
41097
  init_render();
40917
41098
  init_braille_spinner();
@@ -42089,15 +42270,15 @@ var init_status_bar = __esm({
42089
42270
  }
42090
42271
  });
42091
42272
 
42092
- // ../packages/cli/dist/tui/interactive.js
42273
+ // packages/cli/dist/tui/interactive.js
42093
42274
  import * as readline2 from "node:readline";
42094
42275
  import { Writable } from "node:stream";
42095
42276
  import { cwd } from "node:process";
42096
- import { resolve as resolve28, join as join49, dirname as dirname17, extname as extname9 } from "node:path";
42277
+ import { resolve as resolve28, join as join50, dirname as dirname17, extname as extname9 } from "node:path";
42097
42278
  import { createRequire as createRequire2 } from "node:module";
42098
42279
  import { fileURLToPath as fileURLToPath12 } from "node:url";
42099
- import { readFileSync as readFileSync28, writeFileSync as writeFileSync15, appendFileSync as appendFileSync3, rmSync as rmSync2, readdirSync as readdirSync14, mkdirSync as mkdirSync17 } from "node:fs";
42100
- import { existsSync as existsSync38 } from "node:fs";
42280
+ import { readFileSync as readFileSync29, writeFileSync as writeFileSync16, appendFileSync as appendFileSync3, rmSync as rmSync2, readdirSync as readdirSync14, mkdirSync as mkdirSync17 } from "node:fs";
42281
+ import { existsSync as existsSync39 } from "node:fs";
42101
42282
  import { homedir as homedir13 } from "node:os";
42102
42283
  function formatTimeAgo(date) {
42103
42284
  const seconds = Math.floor((Date.now() - date.getTime()) / 1e3);
@@ -42117,12 +42298,12 @@ function getVersion3() {
42117
42298
  const require2 = createRequire2(import.meta.url);
42118
42299
  const thisDir = dirname17(fileURLToPath12(import.meta.url));
42119
42300
  const candidates = [
42120
- join49(thisDir, "..", "package.json"),
42121
- join49(thisDir, "..", "..", "package.json"),
42122
- join49(thisDir, "..", "..", "..", "package.json")
42301
+ join50(thisDir, "..", "package.json"),
42302
+ join50(thisDir, "..", "..", "package.json"),
42303
+ join50(thisDir, "..", "..", "..", "package.json")
42123
42304
  ];
42124
42305
  for (const pkgPath of candidates) {
42125
- if (existsSync38(pkgPath)) {
42306
+ if (existsSync39(pkgPath)) {
42126
42307
  const pkg = require2(pkgPath);
42127
42308
  if (pkg.name === "open-agents-ai" || pkg.name === "@open-agents/cli") {
42128
42309
  return pkg.version ?? "0.0.0";
@@ -42328,15 +42509,15 @@ Use task_status("${taskId}") or task_output("${taskId}") to check progress.`
42328
42509
  function gatherMemorySnippets(root) {
42329
42510
  const snippets = [];
42330
42511
  const dirs = [
42331
- join49(root, ".oa", "memory"),
42332
- join49(root, ".open-agents", "memory")
42512
+ join50(root, ".oa", "memory"),
42513
+ join50(root, ".open-agents", "memory")
42333
42514
  ];
42334
42515
  for (const dir of dirs) {
42335
- if (!existsSync38(dir))
42516
+ if (!existsSync39(dir))
42336
42517
  continue;
42337
42518
  try {
42338
42519
  for (const f of readdirSync14(dir).filter((f2) => f2.endsWith(".json"))) {
42339
- const data = JSON.parse(readFileSync28(join49(dir, f), "utf-8"));
42520
+ const data = JSON.parse(readFileSync29(join50(dir, f), "utf-8"));
42340
42521
  for (const val of Object.values(data)) {
42341
42522
  const v = typeof val === "object" && val !== null && "value" in val ? String(val.value) : String(val);
42342
42523
  if (v.length > 10)
@@ -42926,48 +43107,14 @@ async function startInteractive(config, repoPath) {
42926
43107
  setEmojisEnabled(savedSettings.emojis);
42927
43108
  if (savedSettings.colors !== void 0)
42928
43109
  setColorsEnabled(savedSettings.colors);
42929
- if (!isResumed) {
42930
- const needsSetup = isFirstRun() || !await isModelAvailable(config);
42931
- if (needsSetup && config.backendType === "ollama") {
43110
+ if (!isResumed && isFirstRun() && config.backendType === "ollama") {
43111
+ const needsSetup = !await isModelAvailable(config);
43112
+ if (needsSetup) {
42932
43113
  const setupModel = await runSetupWizard(config);
42933
43114
  const freshConfig = loadConfig();
42934
43115
  config = { ...config, ...freshConfig, model: setupModel ?? freshConfig.model };
42935
43116
  }
42936
43117
  }
42937
- if (config.backendType === "ollama" && !config.model.startsWith("open-agents-")) {
42938
- try {
42939
- const expandResult = await ensureExpandedContext(config.model, config.backendUrl);
42940
- if (expandResult.created) {
42941
- renderInfo(`Created expanded context model: ${expandResult.model} (${expandResult.contextLabel}, ${expandResult.numCtx} tokens)`);
42942
- config = { ...config, model: expandResult.model };
42943
- } else if (expandResult.model !== config.model) {
42944
- renderInfo(`Using expanded context model: ${expandResult.model} (${expandResult.contextLabel})`);
42945
- config = { ...config, model: expandResult.model };
42946
- }
42947
- } catch {
42948
- }
42949
- }
42950
- if (!isResumed) {
42951
- try {
42952
- const baseUrl = normalizeBaseUrl(config.backendUrl);
42953
- const provider2 = detectProvider(config.backendUrl);
42954
- const healthUrl = `${baseUrl}${provider2.modelsPath}`;
42955
- const headers = {};
42956
- if (config.apiKey) {
42957
- headers["Authorization"] = `Bearer ${config.apiKey}`;
42958
- }
42959
- const resp = await fetch(healthUrl, { headers, signal: AbortSignal.timeout(1e4) });
42960
- if (!resp.ok)
42961
- throw new Error(`HTTP ${resp.status}`);
42962
- } catch {
42963
- const provider2 = detectProvider(config.backendUrl);
42964
- renderWarning(`Cannot reach ${provider2.label} at ${config.backendUrl}`);
42965
- if (provider2.id === "ollama") {
42966
- renderInfo("Use /endpoint http://127.0.0.1:11434 to auto-install & start Ollama.");
42967
- }
42968
- renderInfo("Use /endpoint to configure a different backend. Starting anyway...");
42969
- }
42970
- }
42971
43118
  let carouselPhrases = null;
42972
43119
  try {
42973
43120
  carouselPhrases = loadCachedDescriptors(repoRoot) ?? generateDescriptors(repoRoot);
@@ -43102,7 +43249,7 @@ async function startInteractive(config, repoPath) {
43102
43249
  let exposeGateway = null;
43103
43250
  let peerMesh = null;
43104
43251
  let inferenceRouter = null;
43105
- const secretVault = new SecretVault(join49(repoRoot, ".oa", "vault.enc"));
43252
+ const secretVault = new SecretVault(join50(repoRoot, ".oa", "vault.enc"));
43106
43253
  let adminSessionKey = null;
43107
43254
  const callSubAgents = /* @__PURE__ */ new Map();
43108
43255
  const streamRenderer = new StreamRenderer();
@@ -43307,13 +43454,13 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
43307
43454
  const hits = allCompletions.filter((c3) => c3.toLowerCase().startsWith(lower));
43308
43455
  return [hits, line];
43309
43456
  }
43310
- const HISTORY_DIR = join49(homedir13(), ".open-agents");
43311
- const HISTORY_FILE = join49(HISTORY_DIR, "repl-history");
43457
+ const HISTORY_DIR = join50(homedir13(), ".open-agents");
43458
+ const HISTORY_FILE = join50(HISTORY_DIR, "repl-history");
43312
43459
  const MAX_HISTORY_LINES = 500;
43313
43460
  let savedHistory = [];
43314
43461
  try {
43315
- if (existsSync38(HISTORY_FILE)) {
43316
- const raw = readFileSync28(HISTORY_FILE, "utf8").trim();
43462
+ if (existsSync39(HISTORY_FILE)) {
43463
+ const raw = readFileSync29(HISTORY_FILE, "utf8").trim();
43317
43464
  if (raw)
43318
43465
  savedHistory = raw.split("\n").reverse();
43319
43466
  }
@@ -43335,9 +43482,9 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
43335
43482
  mkdirSync17(HISTORY_DIR, { recursive: true });
43336
43483
  appendFileSync3(HISTORY_FILE, line + "\n", "utf8");
43337
43484
  if (Math.random() < 0.02) {
43338
- const all = readFileSync28(HISTORY_FILE, "utf8").trim().split("\n");
43485
+ const all = readFileSync29(HISTORY_FILE, "utf8").trim().split("\n");
43339
43486
  if (all.length > MAX_HISTORY_LINES) {
43340
- writeFileSync15(HISTORY_FILE, all.slice(-MAX_HISTORY_LINES).join("\n") + "\n", "utf8");
43487
+ writeFileSync16(HISTORY_FILE, all.slice(-MAX_HISTORY_LINES).join("\n") + "\n", "utf8");
43341
43488
  }
43342
43489
  }
43343
43490
  } catch {
@@ -43358,8 +43505,11 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
43358
43505
  const termRows = process.stdout.rows ?? 24;
43359
43506
  const scrollStart = carousel.reservedRows + 1;
43360
43507
  const scrollEnd = Math.max(termRows - statusBar.reservedRows, scrollStart + 1);
43361
- process.stdout.write(`\x1B[${scrollStart};${scrollEnd}r`);
43362
- process.stdout.write(`\x1B[${scrollStart};1H\x1B[J`);
43508
+ let clearBuf = "";
43509
+ for (let r = scrollStart; r <= scrollEnd; r++) {
43510
+ clearBuf += `\x1B[${r};1H\x1B[2K`;
43511
+ }
43512
+ process.stdout.write(clearBuf);
43363
43513
  renderRichHeader({
43364
43514
  model: currentConfig.model,
43365
43515
  version,
@@ -43390,6 +43540,88 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
43390
43540
  fn();
43391
43541
  }
43392
43542
  }
43543
+ (async () => {
43544
+ if (!isResumed && !isFirstRun()) {
43545
+ try {
43546
+ const available = await isModelAvailable(config);
43547
+ if (!available && config.backendType === "ollama") {
43548
+ writeContent(() => {
43549
+ renderWarning(`Model "${config.model}" not available. Use /model to pick one.`);
43550
+ });
43551
+ }
43552
+ } catch {
43553
+ }
43554
+ }
43555
+ if (config.backendType === "ollama" && !config.model.startsWith("open-agents-")) {
43556
+ try {
43557
+ const expandResult = await ensureExpandedContext(config.model, config.backendUrl);
43558
+ if (expandResult.created) {
43559
+ config = { ...config, model: expandResult.model };
43560
+ currentConfig = { ...currentConfig, model: expandResult.model };
43561
+ statusBar.setModelName(expandResult.model);
43562
+ writeContent(() => renderInfo(`Created expanded context model: ${expandResult.model} (${expandResult.contextLabel}, ${expandResult.numCtx} tokens)`));
43563
+ } else if (expandResult.model !== config.model) {
43564
+ config = { ...config, model: expandResult.model };
43565
+ currentConfig = { ...currentConfig, model: expandResult.model };
43566
+ statusBar.setModelName(expandResult.model);
43567
+ writeContent(() => renderInfo(`Using expanded context model: ${expandResult.model} (${expandResult.contextLabel})`));
43568
+ }
43569
+ } catch {
43570
+ }
43571
+ }
43572
+ if (!isResumed) {
43573
+ try {
43574
+ const baseUrl = normalizeBaseUrl(config.backendUrl);
43575
+ const prov = detectProvider(config.backendUrl);
43576
+ const healthUrl = `${baseUrl}${prov.modelsPath}`;
43577
+ const headers = {};
43578
+ if (config.apiKey)
43579
+ headers["Authorization"] = `Bearer ${config.apiKey}`;
43580
+ const resp = await fetch(healthUrl, { headers, signal: AbortSignal.timeout(1e4) });
43581
+ if (!resp.ok)
43582
+ throw new Error(`HTTP ${resp.status}`);
43583
+ } catch {
43584
+ const prov = detectProvider(config.backendUrl);
43585
+ writeContent(() => {
43586
+ renderWarning(`Cannot reach ${prov.label} at ${config.backendUrl}`);
43587
+ if (prov.id === "ollama") {
43588
+ renderInfo("Use /endpoint http://127.0.0.1:11434 to auto-install & start Ollama.");
43589
+ }
43590
+ renderInfo("Use /endpoint to configure a different backend.");
43591
+ });
43592
+ }
43593
+ }
43594
+ try {
43595
+ const oaDir = join50(repoRoot, ".oa");
43596
+ const reconnected = await ExposeGateway.checkAndReconnect(oaDir, {
43597
+ onInfo: (msg) => writeContent(() => renderInfo(msg)),
43598
+ onError: (msg) => writeContent(() => renderWarning(msg))
43599
+ });
43600
+ if (reconnected) {
43601
+ exposeGateway = reconnected;
43602
+ reconnected.on("stats", (stats) => {
43603
+ statusBar.setExposeStatus({
43604
+ status: stats.status,
43605
+ totalRequests: stats.totalRequests,
43606
+ activeConnections: stats.activeConnections,
43607
+ modelUsage: stats.modelUsage
43608
+ });
43609
+ });
43610
+ writeContent(() => {
43611
+ renderInfo(`Reconnected to existing expose tunnel: ${reconnected.tunnelUrl}`);
43612
+ });
43613
+ }
43614
+ } catch {
43615
+ }
43616
+ try {
43617
+ const isRemote = !currentConfig.backendUrl.includes("127.0.0.1") && !currentConfig.backendUrl.includes("localhost");
43618
+ if (isRemote) {
43619
+ statusBar.startRemoteMetricsPolling(currentConfig.backendUrl, currentConfig.apiKey);
43620
+ }
43621
+ } catch {
43622
+ }
43623
+ })().catch(() => {
43624
+ });
43393
43625
  function handleSudoRequest(_command) {
43394
43626
  if (sudoPromptPending)
43395
43627
  return;
@@ -44021,7 +44253,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
44021
44253
  kind = "custom";
44022
44254
  targetUrl = kindOrUrl.includes("://") ? kindOrUrl : `http://${kindOrUrl}`;
44023
44255
  }
44024
- exposeGateway = new ExposeGateway({ kind, targetUrl, authKey });
44256
+ exposeGateway = new ExposeGateway({ kind, targetUrl, authKey, stateDir: join50(repoRoot, ".oa") });
44025
44257
  exposeGateway.on("stats", (stats) => {
44026
44258
  statusBar.setExposeStatus({
44027
44259
  status: stats.status,
@@ -44208,8 +44440,8 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
44208
44440
  return true;
44209
44441
  },
44210
44442
  destroyProject() {
44211
- const oaPath = join49(repoRoot, OA_DIR);
44212
- if (existsSync38(oaPath)) {
44443
+ const oaPath = join50(repoRoot, OA_DIR);
44444
+ if (existsSync39(oaPath)) {
44213
44445
  try {
44214
44446
  rmSync2(oaPath, { recursive: true, force: true });
44215
44447
  writeContent(() => renderInfo(`Removed ${OA_DIR}/ directory.`));
@@ -44540,13 +44772,13 @@ Execute this skill now. Follow the behavioral guidance above.`;
44540
44772
  }
44541
44773
  }
44542
44774
  const cleanPath = input.replace(/^['"]|['"]$/g, "").trim();
44543
- const isImage = isImagePath(cleanPath) && existsSync38(resolve28(repoRoot, cleanPath));
44544
- const isMedia = !isImage && isTranscribablePath(cleanPath) && existsSync38(resolve28(repoRoot, cleanPath));
44775
+ const isImage = isImagePath(cleanPath) && existsSync39(resolve28(repoRoot, cleanPath));
44776
+ const isMedia = !isImage && isTranscribablePath(cleanPath) && existsSync39(resolve28(repoRoot, cleanPath));
44545
44777
  if (activeTask) {
44546
44778
  if (isImage) {
44547
44779
  try {
44548
44780
  const imgPath = resolve28(repoRoot, cleanPath);
44549
- const imgBuffer = readFileSync28(imgPath);
44781
+ const imgBuffer = readFileSync29(imgPath);
44550
44782
  const base64 = imgBuffer.toString("base64");
44551
44783
  const ext = extname9(cleanPath).toLowerCase();
44552
44784
  const mime = ext === ".png" ? "image/png" : ext === ".gif" ? "image/gif" : ext === ".webp" ? "image/webp" : "image/jpeg";
@@ -44793,8 +45025,8 @@ NEW TASK: ${fullInput}`;
44793
45025
  try {
44794
45026
  const updateInfo = await checkForUpdate(version);
44795
45027
  if (updateInfo) {
44796
- const { exec: exec2 } = await import("node:child_process");
44797
- exec2(`npm install -g open-agents-ai@latest --prefer-online`, { timeout: 18e4 }, (err) => {
45028
+ const { exec: exec3 } = await import("node:child_process");
45029
+ exec3(`npm install -g open-agents-ai@latest --prefer-online`, { timeout: 18e4 }, (err) => {
44798
45030
  if (!err) {
44799
45031
  writeContent(() => renderInfo(`Updated to v${updateInfo.latestVersion} in background. Takes effect next session.`));
44800
45032
  }
@@ -44898,10 +45130,6 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
44898
45130
  showPrompt();
44899
45131
  }
44900
45132
  rl.on("close", () => {
44901
- if (exposeGateway?.isActive) {
44902
- exposeGateway.stop().catch(() => {
44903
- });
44904
- }
44905
45133
  if (peerMesh) {
44906
45134
  peerMesh.stop().catch(() => {
44907
45135
  });
@@ -44992,7 +45220,7 @@ async function runWithTUI(task, config, repoPath) {
44992
45220
  }
44993
45221
  var taskManager;
44994
45222
  var init_interactive = __esm({
44995
- "../packages/cli/dist/tui/interactive.js"() {
45223
+ "packages/cli/dist/tui/interactive.js"() {
44996
45224
  "use strict";
44997
45225
  init_dist5();
44998
45226
  init_dist5();
@@ -45029,7 +45257,7 @@ var init_interactive = __esm({
45029
45257
  }
45030
45258
  });
45031
45259
 
45032
- // ../packages/cli/dist/commands/run.js
45260
+ // packages/cli/dist/commands/run.js
45033
45261
  var run_exports = {};
45034
45262
  __export(run_exports, {
45035
45263
  runCommand: () => runCommand
@@ -45049,21 +45277,21 @@ async function runCommand(opts, config) {
45049
45277
  }
45050
45278
  }
45051
45279
  var init_run = __esm({
45052
- "../packages/cli/dist/commands/run.js"() {
45280
+ "packages/cli/dist/commands/run.js"() {
45053
45281
  "use strict";
45054
45282
  init_interactive();
45055
45283
  }
45056
45284
  });
45057
45285
 
45058
- // ../packages/indexer/dist/codebase-indexer.js
45286
+ // packages/indexer/dist/codebase-indexer.js
45059
45287
  import { glob } from "glob";
45060
45288
  import ignore from "ignore";
45061
45289
  import { readFile as readFile16, stat as stat4 } from "node:fs/promises";
45062
45290
  import { createHash as createHash4 } from "node:crypto";
45063
- import { join as join50, relative as relative3, extname as extname10, basename as basename15 } from "node:path";
45291
+ import { join as join51, relative as relative3, extname as extname10, basename as basename15 } from "node:path";
45064
45292
  var DEFAULT_EXCLUDE, LANGUAGE_MAP, CodebaseIndexer;
45065
45293
  var init_codebase_indexer = __esm({
45066
- "../packages/indexer/dist/codebase-indexer.js"() {
45294
+ "packages/indexer/dist/codebase-indexer.js"() {
45067
45295
  "use strict";
45068
45296
  DEFAULT_EXCLUDE = [
45069
45297
  "node_modules",
@@ -45104,7 +45332,7 @@ var init_codebase_indexer = __esm({
45104
45332
  const ig = ignore.default();
45105
45333
  if (this.config.respectGitignore) {
45106
45334
  try {
45107
- const gitignoreContent = await readFile16(join50(this.config.rootDir, ".gitignore"), "utf-8");
45335
+ const gitignoreContent = await readFile16(join51(this.config.rootDir, ".gitignore"), "utf-8");
45108
45336
  ig.add(gitignoreContent);
45109
45337
  } catch {
45110
45338
  }
@@ -45119,7 +45347,7 @@ var init_codebase_indexer = __esm({
45119
45347
  for (const relativePath of files) {
45120
45348
  if (ig.ignores(relativePath))
45121
45349
  continue;
45122
- const fullPath = join50(this.config.rootDir, relativePath);
45350
+ const fullPath = join51(this.config.rootDir, relativePath);
45123
45351
  try {
45124
45352
  const fileStat = await stat4(fullPath);
45125
45353
  if (fileStat.size > this.config.maxFileSize)
@@ -45165,7 +45393,7 @@ var init_codebase_indexer = __esm({
45165
45393
  if (!child) {
45166
45394
  child = {
45167
45395
  name: part,
45168
- path: join50(current.path, part),
45396
+ path: join51(current.path, part),
45169
45397
  type: "directory",
45170
45398
  children: []
45171
45399
  };
@@ -45181,25 +45409,25 @@ var init_codebase_indexer = __esm({
45181
45409
  }
45182
45410
  });
45183
45411
 
45184
- // ../packages/indexer/dist/repoScanner.js
45412
+ // packages/indexer/dist/repoScanner.js
45185
45413
  import ignore2 from "ignore";
45186
45414
  var init_repoScanner = __esm({
45187
- "../packages/indexer/dist/repoScanner.js"() {
45415
+ "packages/indexer/dist/repoScanner.js"() {
45188
45416
  "use strict";
45189
45417
  }
45190
45418
  });
45191
45419
 
45192
- // ../packages/indexer/dist/symbolExtractor.js
45420
+ // packages/indexer/dist/symbolExtractor.js
45193
45421
  var init_symbolExtractor = __esm({
45194
- "../packages/indexer/dist/symbolExtractor.js"() {
45422
+ "packages/indexer/dist/symbolExtractor.js"() {
45195
45423
  "use strict";
45196
45424
  }
45197
45425
  });
45198
45426
 
45199
- // ../packages/indexer/dist/graphBuilder.js
45427
+ // packages/indexer/dist/graphBuilder.js
45200
45428
  var TS_EXTENSIONS, JS_EXTENSIONS, ALL_EXTENSIONS;
45201
45429
  var init_graphBuilder = __esm({
45202
- "../packages/indexer/dist/graphBuilder.js"() {
45430
+ "packages/indexer/dist/graphBuilder.js"() {
45203
45431
  "use strict";
45204
45432
  TS_EXTENSIONS = [".ts", ".tsx", ".mts", ".cts"];
45205
45433
  JS_EXTENSIONS = [".js", ".jsx", ".mjs", ".cjs"];
@@ -45207,30 +45435,30 @@ var init_graphBuilder = __esm({
45207
45435
  }
45208
45436
  });
45209
45437
 
45210
- // ../packages/indexer/dist/fileSummarizer.js
45438
+ // packages/indexer/dist/fileSummarizer.js
45211
45439
  var init_fileSummarizer = __esm({
45212
- "../packages/indexer/dist/fileSummarizer.js"() {
45440
+ "packages/indexer/dist/fileSummarizer.js"() {
45213
45441
  "use strict";
45214
45442
  }
45215
45443
  });
45216
45444
 
45217
- // ../packages/indexer/dist/embeddings.js
45445
+ // packages/indexer/dist/embeddings.js
45218
45446
  var init_embeddings = __esm({
45219
- "../packages/indexer/dist/embeddings.js"() {
45447
+ "packages/indexer/dist/embeddings.js"() {
45220
45448
  "use strict";
45221
45449
  }
45222
45450
  });
45223
45451
 
45224
- // ../packages/indexer/dist/ollamaEmbeddings.js
45452
+ // packages/indexer/dist/ollamaEmbeddings.js
45225
45453
  var init_ollamaEmbeddings = __esm({
45226
- "../packages/indexer/dist/ollamaEmbeddings.js"() {
45454
+ "packages/indexer/dist/ollamaEmbeddings.js"() {
45227
45455
  "use strict";
45228
45456
  }
45229
45457
  });
45230
45458
 
45231
- // ../packages/indexer/dist/index.js
45459
+ // packages/indexer/dist/index.js
45232
45460
  var init_dist8 = __esm({
45233
- "../packages/indexer/dist/index.js"() {
45461
+ "packages/indexer/dist/index.js"() {
45234
45462
  "use strict";
45235
45463
  init_codebase_indexer();
45236
45464
  init_repoScanner();
@@ -45242,19 +45470,19 @@ var init_dist8 = __esm({
45242
45470
  }
45243
45471
  });
45244
45472
 
45245
- // ../packages/cli/dist/commands/index-repo.js
45473
+ // packages/cli/dist/commands/index-repo.js
45246
45474
  var index_repo_exports = {};
45247
45475
  __export(index_repo_exports, {
45248
45476
  indexRepoCommand: () => indexRepoCommand
45249
45477
  });
45250
45478
  import { resolve as resolve29 } from "node:path";
45251
- import { existsSync as existsSync39, statSync as statSync11 } from "node:fs";
45479
+ import { existsSync as existsSync40, statSync as statSync11 } from "node:fs";
45252
45480
  import { cwd as cwd2 } from "node:process";
45253
45481
  async function indexRepoCommand(opts, _config) {
45254
45482
  const repoRoot = resolve29(opts.repoPath ?? cwd2());
45255
45483
  printHeader("Index Repository");
45256
45484
  printInfo(`Indexing: ${repoRoot}`);
45257
- if (!existsSync39(repoRoot)) {
45485
+ if (!existsSync40(repoRoot)) {
45258
45486
  printError(`Path does not exist: ${repoRoot}`);
45259
45487
  process.exit(1);
45260
45488
  }
@@ -45335,7 +45563,7 @@ async function indexRepoCommand(opts, _config) {
45335
45563
  printSuccess("Repository indexed successfully");
45336
45564
  }
45337
45565
  var init_index_repo = __esm({
45338
- "../packages/cli/dist/commands/index-repo.js"() {
45566
+ "packages/cli/dist/commands/index-repo.js"() {
45339
45567
  "use strict";
45340
45568
  init_dist8();
45341
45569
  init_spinner();
@@ -45343,7 +45571,7 @@ var init_index_repo = __esm({
45343
45571
  }
45344
45572
  });
45345
45573
 
45346
- // ../packages/cli/dist/commands/status.js
45574
+ // packages/cli/dist/commands/status.js
45347
45575
  var status_exports = {};
45348
45576
  __export(status_exports, {
45349
45577
  statusCommand: () => statusCommand
@@ -45493,7 +45721,7 @@ async function statusVllm(opts, config) {
45493
45721
  printSuccess("vLLM backend is operational");
45494
45722
  }
45495
45723
  var init_status = __esm({
45496
- "../packages/cli/dist/commands/status.js"() {
45724
+ "packages/cli/dist/commands/status.js"() {
45497
45725
  "use strict";
45498
45726
  init_dist();
45499
45727
  init_spinner();
@@ -45501,12 +45729,12 @@ var init_status = __esm({
45501
45729
  }
45502
45730
  });
45503
45731
 
45504
- // ../packages/cli/dist/commands/config.js
45732
+ // packages/cli/dist/commands/config.js
45505
45733
  var config_exports = {};
45506
45734
  __export(config_exports, {
45507
45735
  configCommand: () => configCommand
45508
45736
  });
45509
- import { join as join51, resolve as resolve30 } from "node:path";
45737
+ import { join as join52, resolve as resolve30 } from "node:path";
45510
45738
  import { homedir as homedir14 } from "node:os";
45511
45739
  import { cwd as cwd3 } from "node:process";
45512
45740
  function redactIfSensitive(key, value) {
@@ -45589,7 +45817,7 @@ function handleShow(opts, config) {
45589
45817
  }
45590
45818
  }
45591
45819
  printSection("Config File");
45592
- printInfo(`~/.open-agents/config.json (${join51(homedir14(), ".open-agents", "config.json")})`);
45820
+ printInfo(`~/.open-agents/config.json (${join52(homedir14(), ".open-agents", "config.json")})`);
45593
45821
  printSection("Priority Chain");
45594
45822
  printInfo(" 1. CLI flags (--model, --backend-url, etc.)");
45595
45823
  printInfo(" 2. Project .oa/settings.json (--local)");
@@ -45628,7 +45856,7 @@ function handleSet(opts, _config) {
45628
45856
  const coerced = coerceForSettings(key, value);
45629
45857
  saveProjectSettings(repoRoot, { [key]: coerced });
45630
45858
  printSuccess(`Project override set: ${key} = ${redactIfSensitive(key, value)}`);
45631
- printInfo(`Saved to ${join51(repoRoot, ".oa", "settings.json")}`);
45859
+ printInfo(`Saved to ${join52(repoRoot, ".oa", "settings.json")}`);
45632
45860
  printInfo("This override applies only when running in this workspace.");
45633
45861
  } catch (err) {
45634
45862
  printError(`Failed to save: ${err instanceof Error ? err.message : String(err)}`);
@@ -45676,7 +45904,7 @@ function handleKeys() {
45676
45904
  }
45677
45905
  var CONFIG_KEYS, SENSITIVE_KEYS, INT_KEYS, BOOL_KEYS, ENUM_KEYS;
45678
45906
  var init_config3 = __esm({
45679
- "../packages/cli/dist/commands/config.js"() {
45907
+ "packages/cli/dist/commands/config.js"() {
45680
45908
  "use strict";
45681
45909
  init_config();
45682
45910
  init_oa_directory();
@@ -45723,7 +45951,7 @@ var init_config3 = __esm({
45723
45951
  }
45724
45952
  });
45725
45953
 
45726
- // ../packages/cli/dist/commands/serve.js
45954
+ // packages/cli/dist/commands/serve.js
45727
45955
  var serve_exports = {};
45728
45956
  __export(serve_exports, {
45729
45957
  serveCommand: () => serveCommand
@@ -45873,21 +46101,21 @@ async function runVllmServer(args, verbose) {
45873
46101
  });
45874
46102
  }
45875
46103
  var init_serve = __esm({
45876
- "../packages/cli/dist/commands/serve.js"() {
46104
+ "packages/cli/dist/commands/serve.js"() {
45877
46105
  "use strict";
45878
46106
  init_dist();
45879
46107
  init_output();
45880
46108
  }
45881
46109
  });
45882
46110
 
45883
- // ../packages/cli/dist/commands/eval.js
46111
+ // packages/cli/dist/commands/eval.js
45884
46112
  var eval_exports = {};
45885
46113
  __export(eval_exports, {
45886
46114
  evalCommand: () => evalCommand
45887
46115
  });
45888
46116
  import { tmpdir as tmpdir7 } from "node:os";
45889
- import { mkdirSync as mkdirSync18, writeFileSync as writeFileSync16 } from "node:fs";
45890
- import { join as join52 } from "node:path";
46117
+ import { mkdirSync as mkdirSync18, writeFileSync as writeFileSync17 } from "node:fs";
46118
+ import { join as join53 } from "node:path";
45891
46119
  async function evalCommand(opts, config) {
45892
46120
  const suiteName = opts.suite ?? "basic";
45893
46121
  const suite = SUITES[suiteName];
@@ -46012,14 +46240,14 @@ async function evalCommand(opts, config) {
46012
46240
  process.exit(failed > 0 ? 1 : 0);
46013
46241
  }
46014
46242
  function createTempEvalRepo() {
46015
- const dir = join52(tmpdir7(), `open-agents-eval-${Date.now()}`);
46243
+ const dir = join53(tmpdir7(), `open-agents-eval-${Date.now()}`);
46016
46244
  mkdirSync18(dir, { recursive: true });
46017
- writeFileSync16(join52(dir, "package.json"), JSON.stringify({ name: "eval-repo", version: "0.0.0" }, null, 2) + "\n", "utf8");
46245
+ writeFileSync17(join53(dir, "package.json"), JSON.stringify({ name: "eval-repo", version: "0.0.0" }, null, 2) + "\n", "utf8");
46018
46246
  return dir;
46019
46247
  }
46020
46248
  var BASIC_SUITE, FULL_SUITE, SUITES;
46021
46249
  var init_eval = __esm({
46022
- "../packages/cli/dist/commands/eval.js"() {
46250
+ "packages/cli/dist/commands/eval.js"() {
46023
46251
  "use strict";
46024
46252
  init_dist5();
46025
46253
  init_dist();
@@ -46067,16 +46295,16 @@ var init_eval = __esm({
46067
46295
  }
46068
46296
  });
46069
46297
 
46070
- // ../packages/cli/dist/index.js
46298
+ // packages/cli/dist/index.js
46071
46299
  init_config();
46072
46300
  init_output();
46073
46301
  init_updater();
46074
46302
  import { parseArgs as nodeParseArgs2 } from "node:util";
46075
46303
  import { createRequire as createRequire3 } from "node:module";
46076
46304
  import { fileURLToPath as fileURLToPath13 } from "node:url";
46077
- import { dirname as dirname18, join as join53 } from "node:path";
46305
+ import { dirname as dirname18, join as join54 } from "node:path";
46078
46306
 
46079
- // ../packages/cli/dist/cli.js
46307
+ // packages/cli/dist/cli.js
46080
46308
  import { createInterface } from "node:readline";
46081
46309
  function createCli(options) {
46082
46310
  return {
@@ -46115,10 +46343,10 @@ function createCli(options) {
46115
46343
  };
46116
46344
  }
46117
46345
 
46118
- // ../packages/cli/dist/args.js
46346
+ // packages/cli/dist/args.js
46119
46347
  import { parseArgs as nodeParseArgs } from "node:util";
46120
46348
 
46121
- // ../packages/cli/dist/types.js
46349
+ // packages/cli/dist/types.js
46122
46350
  var DEFAULT_OPTIONS = {
46123
46351
  model: "qwen-2.5-coder-32b",
46124
46352
  backendUrl: "http://localhost:8000/v1",
@@ -46128,7 +46356,7 @@ var DEFAULT_OPTIONS = {
46128
46356
  verbose: false
46129
46357
  };
46130
46358
 
46131
- // ../packages/cli/dist/args.js
46359
+ // packages/cli/dist/args.js
46132
46360
  function parseArgs(argv) {
46133
46361
  const { values } = nodeParseArgs({
46134
46362
  args: argv.slice(2),
@@ -46174,14 +46402,14 @@ Options:
46174
46402
  console.log(help.trim());
46175
46403
  }
46176
46404
 
46177
- // ../packages/cli/dist/index.js
46405
+ // packages/cli/dist/index.js
46178
46406
  init_config();
46179
46407
  init_spinner();
46180
46408
  init_output();
46181
46409
  function getVersion4() {
46182
46410
  try {
46183
46411
  const require2 = createRequire3(import.meta.url);
46184
- const pkgPath = join53(dirname18(fileURLToPath13(import.meta.url)), "..", "package.json");
46412
+ const pkgPath = join54(dirname18(fileURLToPath13(import.meta.url)), "..", "package.json");
46185
46413
  const pkg = require2(pkgPath);
46186
46414
  return pkg.version;
46187
46415
  } catch {