openfox 1.6.75 → 1.6.77

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 (70) hide show
  1. package/README.md +18 -18
  2. package/dist/agent-defaults/code-reviewer.agent.md +1 -0
  3. package/dist/agent-defaults/explorer.agent.md +2 -1
  4. package/dist/agent-defaults/verifier.agent.md +4 -0
  5. package/dist/{ask-3RK5YJZE.js → ask-5SSOA6SZ.js} +2 -2
  6. package/dist/{auth-LZZX63KI.js → auth-56SIRACI.js} +3 -6
  7. package/dist/auto-compaction-GOHNI2R2.js +27 -0
  8. package/dist/{branch.api-XADFZZAA.js → branch.api-PWFW26KC.js} +2 -2
  9. package/dist/{chat-handler-KYMMXPP6.js → chat-handler-K2RDXBO6.js} +31 -29
  10. package/dist/{chunk-IA4O65CR.js → chunk-6SYNGMU4.js} +100 -68
  11. package/dist/{chunk-AFATQ5LJ.js → chunk-B5AP3RSV.js} +1 -1
  12. package/dist/{chunk-PFRQO5Z3.js → chunk-BBC46FN4.js} +61 -28
  13. package/dist/{chunk-22CTURMH.js → chunk-BJYPTN5S.js} +1 -1
  14. package/dist/{chunk-DLINTLB7.js → chunk-BSTVRSV6.js} +7 -5
  15. package/dist/{chunk-7JPKRM6M.js → chunk-CMQCO27Y.js} +22 -12
  16. package/dist/{chunk-R4HADRYO.js → chunk-CQGTEGKL.js} +1 -1
  17. package/dist/{chunk-J5DV33SS.js → chunk-CUDAT6SS.js} +46 -18
  18. package/dist/{chunk-ETIXH35K.js → chunk-EBQYRNNU.js} +535 -291
  19. package/dist/{chunk-4CQ7CUQ6.js → chunk-I7JVS7V5.js} +5 -5
  20. package/dist/{chunk-PNBH3RAX.js → chunk-K44MW7JJ.js} +1 -1
  21. package/dist/{chunk-BLNFJ22S.js → chunk-KIOUKC3Z.js} +6 -4
  22. package/dist/{chunk-CTAIXOZJ.js → chunk-NDJ6FKSP.js} +1 -1
  23. package/dist/{chunk-VIGOXEZG.js → chunk-OJBFC6ER.js} +15 -16
  24. package/dist/{chunk-GQZGIMJO.js → chunk-OXI26S7U.js} +12 -7
  25. package/dist/{chunk-NBU6KIOD.js → chunk-PBGOZMVY.js} +4 -4
  26. package/dist/{chunk-B7E3BICY.js → chunk-RGRBWDZP.js} +2 -4
  27. package/dist/{chunk-KFBIHS3S.js → chunk-STYHKCG7.js} +20 -14
  28. package/dist/{chunk-55Z3DJ7G.js → chunk-TGWEH2BC.js} +10 -11
  29. package/dist/{chunk-TYUNDOX2.js → chunk-UKMRZDWM.js} +90 -41
  30. package/dist/{chunk-5UTTLO4D.js → chunk-UVN6AKIO.js} +89 -49
  31. package/dist/{chunk-574HZVLE.js → chunk-VRGRAQDG.js} +2 -2
  32. package/dist/{chunk-JQBTYHUR.js → chunk-WR6QCJJO.js} +53 -15
  33. package/dist/{chunk-RBPOAAIZ.js → chunk-XKIEDGQF.js} +22 -18
  34. package/dist/{chunk-XIZ6B6IS.js → chunk-XSUQDB6R.js} +541 -299
  35. package/dist/cli/dev.js +2 -2
  36. package/dist/cli/index.js +2 -2
  37. package/dist/{config-6T4EHAP2.js → config-5CONAOL7.js} +7 -7
  38. package/dist/{events-LKEZ3YCW.js → events-5RIXWI5Y.js} +6 -6
  39. package/dist/{folding-JN2WT44N.js → folding-JNOUTI5Z.js} +2 -2
  40. package/dist/{inspect-proxy-Y4MRAVB7.js → inspect-proxy-Y75AXMRX.js} +3 -3
  41. package/dist/{manager-HM2J5VMW.js → manager-W7N3XQ4Q.js} +3 -3
  42. package/dist/orchestrator-TW5II347.js +43 -0
  43. package/dist/package.json +19 -3
  44. package/dist/{paths-ZRI56O63.js → paths-X46PPOI2.js} +2 -2
  45. package/dist/{processor-23O4HPSS.js → processor-MZ3QIUED.js} +15 -11
  46. package/dist/{project-creator-LASKNQPA.js → project-creator-VD7MLOWE.js} +8 -5
  47. package/dist/{projects-HEUOWNSR.js → projects-XLMSDFTQ.js} +4 -4
  48. package/dist/{protocol-5AWNGFLH.js → protocol-4CTV7OZC.js} +3 -3
  49. package/dist/{protocol-DRBnujwe.d.ts → protocol-4xbfAlGO.d.ts} +3 -0
  50. package/dist/{provider-AKN355YH.js → provider-ESEBV3LL.js} +15 -11
  51. package/dist/{pwa-GHQCMCIU.js → pwa-76XP2DY2.js} +2 -2
  52. package/dist/{runtime-config-ZCK74XKM.js → runtime-config-CBJJJGBD.js} +2 -2
  53. package/dist/{serve-TW63YCNQ.js → serve-FTTLGRAO.js} +29 -27
  54. package/dist/server/index.d.ts +6 -1
  55. package/dist/server/index.js +22 -22
  56. package/dist/server/public/__inspect__.js +163 -143
  57. package/dist/{service-74Z7JK2J.js → service-D6LC3CAM.js} +3 -2
  58. package/dist/{settings-NI4ITGV6.js → settings-TQNQB56H.js} +4 -4
  59. package/dist/shared/index.d.ts +2 -2
  60. package/dist/shared/index.js +2 -2
  61. package/dist/{store-2IF3ZSLD.js → store-OQ45KONN.js} +2 -2
  62. package/dist/{tools-RUAY6EVI.js → tools-QJ5K5IJP.js} +18 -18
  63. package/dist/{vision-fallback-AXH3BGJC.js → vision-fallback-ED27LH6C.js} +3 -3
  64. package/dist/web/__inspect__.js +178 -155
  65. package/dist/web/assets/{index-CWdKiSP8.js → index-FjLp1t6r.js} +62 -62
  66. package/dist/web/index.html +2 -2
  67. package/dist/web/sw.js +1 -1
  68. package/package.json +19 -3
  69. package/dist/auto-compaction-OW4P2QWQ.js +0 -27
  70. package/dist/orchestrator-QP4O7MUM.js +0 -43
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  getEventStore,
3
3
  updateSessionMetadata
4
- } from "./chunk-5UTTLO4D.js";
4
+ } from "./chunk-UVN6AKIO.js";
5
5
  import {
6
6
  buildMessagesFromStoredEvents,
7
7
  foldPendingConfirmations
8
- } from "./chunk-PFRQO5Z3.js";
8
+ } from "./chunk-BBC46FN4.js";
9
9
  import {
10
10
  createContextStateMessage,
11
11
  createSessionStateMessage
12
- } from "./chunk-KFBIHS3S.js";
12
+ } from "./chunk-STYHKCG7.js";
13
13
  import {
14
14
  logger
15
- } from "./chunk-PNBH3RAX.js";
15
+ } from "./chunk-K44MW7JJ.js";
16
16
 
17
17
  // src/server/utils/session-utils.ts
18
18
  function getSessionMessageCount(sessionId) {
@@ -143,4 +143,4 @@ export {
143
143
  needsNameGenerationCheck,
144
144
  applyGeneratedSessionName
145
145
  };
146
- //# sourceMappingURL=chunk-4CQ7CUQ6.js.map
146
+ //# sourceMappingURL=chunk-I7JVS7V5.js.map
@@ -51,4 +51,4 @@ export {
51
51
  setLogLevel,
52
52
  logger
53
53
  };
54
- //# sourceMappingURL=chunk-PNBH3RAX.js.map
54
+ //# sourceMappingURL=chunk-K44MW7JJ.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-PNBH3RAX.js";
3
+ } from "./chunk-K44MW7JJ.js";
4
4
 
5
5
  // src/server/db/index.ts
6
6
  import Database from "better-sqlite3";
@@ -136,7 +136,8 @@ function runMigrations(db2) {
136
136
  logger.info("Migrating sessions table: adding message_count column");
137
137
  db2.exec(`ALTER TABLE sessions ADD COLUMN message_count INTEGER NOT NULL DEFAULT 0`);
138
138
  logger.info("Backfilling message counts");
139
- const backfillResult = db2.prepare(`
139
+ const backfillResult = db2.prepare(
140
+ `
140
141
  UPDATE sessions
141
142
  SET message_count = (
142
143
  SELECT COALESCE(
@@ -152,7 +153,8 @@ function runMigrations(db2) {
152
153
  AND json_extract(e.payload, '$.role') IN ('user', 'assistant'))
153
154
  )
154
155
  )
155
- `).run();
156
+ `
157
+ ).run();
156
158
  logger.info("Backfilled message counts", { count: backfillResult.changes });
157
159
  }
158
160
  logger.info("Database migrations completed");
@@ -162,4 +164,4 @@ export {
162
164
  initDatabase,
163
165
  getDatabase
164
166
  };
165
- //# sourceMappingURL=chunk-BLNFJ22S.js.map
167
+ //# sourceMappingURL=chunk-KIOUKC3Z.js.map
@@ -26,4 +26,4 @@ export {
26
26
  isClientMessage,
27
27
  isServerMessage
28
28
  };
29
- //# sourceMappingURL=chunk-CTAIXOZJ.js.map
29
+ //# sourceMappingURL=chunk-NDJ6FKSP.js.map
@@ -32,9 +32,9 @@ Options:
32
32
  `);
33
33
  }
34
34
  async function runNetworkSetup(mode) {
35
- const { loadAuthConfig, saveAuthConfig, encryptPassword } = await import("./auth-LZZX63KI.js");
36
- const { saveGlobalConfig } = await import("./config-6T4EHAP2.js");
37
- const { getAuthKeyPath } = await import("./paths-ZRI56O63.js");
35
+ const { loadAuthConfig, saveAuthConfig, encryptPassword } = await import("./auth-56SIRACI.js");
36
+ const { saveGlobalConfig } = await import("./config-5CONAOL7.js");
37
+ const { getAuthKeyPath } = await import("./paths-X46PPOI2.js");
38
38
  const existingAuth = await loadAuthConfig(mode);
39
39
  if (existingAuth) {
40
40
  return;
@@ -94,8 +94,8 @@ async function runNetworkSetup(mode) {
94
94
  console.log("\u2713 Configuration saved!\n");
95
95
  }
96
96
  async function runConfig(mode) {
97
- const { loadGlobalConfig, getActiveProvider, getDefaultModel } = await import("./config-6T4EHAP2.js");
98
- const { getGlobalConfigPath } = await import("./paths-ZRI56O63.js");
97
+ const { loadGlobalConfig, getActiveProvider, getDefaultModel } = await import("./config-5CONAOL7.js");
98
+ const { getGlobalConfigPath } = await import("./paths-X46PPOI2.js");
99
99
  const config = await loadGlobalConfig(mode);
100
100
  const configPath = getGlobalConfigPath(mode);
101
101
  const activeProvider = getActiveProvider(config);
@@ -149,13 +149,13 @@ async function runCli(options) {
149
149
  break;
150
150
  }
151
151
  case "provider": {
152
- const { runProviderCommand } = await import("./provider-AKN355YH.js");
152
+ const { runProviderCommand } = await import("./provider-ESEBV3LL.js");
153
153
  const [, subcommand] = positionals;
154
154
  await runProviderCommand(mode, subcommand);
155
155
  break;
156
156
  }
157
157
  case "service": {
158
- const { runServiceCommand } = await import("./service-74Z7JK2J.js");
158
+ const { runServiceCommand } = await import("./service-D6LC3CAM.js");
159
159
  const [, subcommand] = positionals;
160
160
  if (subcommand === "--help" || subcommand === "-h" || values.help) {
161
161
  runServiceCommand(mode, void 0);
@@ -165,7 +165,7 @@ async function runCli(options) {
165
165
  break;
166
166
  }
167
167
  case "pwa": {
168
- const { runPwaCommand, printPwaHelp } = await import("./pwa-GHQCMCIU.js");
168
+ const { runPwaCommand, printPwaHelp } = await import("./pwa-76XP2DY2.js");
169
169
  const [, subcommand] = positionals;
170
170
  if (subcommand === "--help" || subcommand === "-h" || values.help) {
171
171
  printPwaHelp();
@@ -185,17 +185,16 @@ async function runCli(options) {
185
185
  break;
186
186
  }
187
187
  default: {
188
- const { configFileExists } = await import("./config-6T4EHAP2.js");
188
+ const { configFileExists } = await import("./config-5CONAOL7.js");
189
189
  const configExists = await configFileExists(mode);
190
190
  if (!configExists) {
191
191
  await runNetworkSetup(mode);
192
192
  }
193
- const { runServe } = await import("./serve-TW63YCNQ.js");
194
- await runServe({
195
- mode,
196
- port: values.port ? parseInt(values.port) : void 0,
197
- openBrowser: values["no-browser"] === true ? false : void 0
198
- });
193
+ const { runServe } = await import("./serve-FTTLGRAO.js");
194
+ const serveOptions = { mode };
195
+ if (values.port) serveOptions.port = parseInt(values.port);
196
+ if (values["no-browser"] === true) serveOptions.openBrowser = false;
197
+ await runServe(serveOptions);
199
198
  }
200
199
  }
201
200
  }
@@ -203,4 +202,4 @@ async function runCli(options) {
203
202
  export {
204
203
  runCli
205
204
  };
206
- //# sourceMappingURL=chunk-VIGOXEZG.js.map
205
+ //# sourceMappingURL=chunk-OJBFC6ER.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getDatabase
3
- } from "./chunk-BLNFJ22S.js";
3
+ } from "./chunk-KIOUKC3Z.js";
4
4
 
5
5
  // src/server/db/settings.ts
6
6
  var SETTINGS_KEYS = {
@@ -18,23 +18,28 @@ var SETTINGS_DEFAULTS = {
18
18
  [SETTINGS_KEYS.DISPLAY_SHOW_VERBOSE_TOOL_OUTPUT]: "true",
19
19
  [SETTINGS_KEYS.DISPLAY_SHOW_STATS]: "true",
20
20
  [SETTINGS_KEYS.DISPLAY_SHOW_AGENT_DEFINITIONS]: "true",
21
- [SETTINGS_KEYS.DISPLAY_SHOW_WORKFLOW_BARS]: "true"
21
+ [SETTINGS_KEYS.DISPLAY_SHOW_WORKFLOW_BARS]: "true",
22
+ [SETTINGS_KEYS.DISPLAY_THEME]: JSON.stringify({ preset: "dark" })
22
23
  };
23
24
  function getSetting(key) {
24
25
  const db = getDatabase();
25
- const row = db.prepare(`
26
+ const row = db.prepare(
27
+ `
26
28
  SELECT value FROM settings WHERE key = ?
27
- `).get(key);
29
+ `
30
+ ).get(key);
28
31
  return row?.value ?? null;
29
32
  }
30
33
  function setSetting(key, value) {
31
34
  const db = getDatabase();
32
35
  const now = (/* @__PURE__ */ new Date()).toISOString();
33
- db.prepare(`
36
+ db.prepare(
37
+ `
34
38
  INSERT INTO settings (key, value, updated_at)
35
39
  VALUES (?, ?, ?)
36
40
  ON CONFLICT(key) DO UPDATE SET value = excluded.value, updated_at = excluded.updated_at
37
- `).run(key, value, now);
41
+ `
42
+ ).run(key, value, now);
38
43
  }
39
44
  function deleteSetting(key) {
40
45
  const db = getDatabase();
@@ -58,4 +63,4 @@ export {
58
63
  deleteSetting,
59
64
  getAllSettings
60
65
  };
61
- //# sourceMappingURL=chunk-GQZGIMJO.js.map
66
+ //# sourceMappingURL=chunk-OXI26S7U.js.map
@@ -7,7 +7,7 @@ import {
7
7
  removeProcess,
8
8
  startProcess,
9
9
  updateStatus
10
- } from "./chunk-574HZVLE.js";
10
+ } from "./chunk-VRGRAQDG.js";
11
11
 
12
12
  // src/server/tools/background-process/manager.ts
13
13
  import { spawn } from "child_process";
@@ -136,7 +136,7 @@ async function stopProcess(processId, sessionId) {
136
136
  } catch {
137
137
  try {
138
138
  process.kill(pid, "SIGKILL");
139
- } catch (_) {
139
+ } catch {
140
140
  }
141
141
  }
142
142
  resolve();
@@ -149,7 +149,7 @@ async function stopProcess(processId, sessionId) {
149
149
  sessionId
150
150
  });
151
151
  removeProcess(processId, sessionId);
152
- } catch (_) {
152
+ } catch {
153
153
  updateStatus(processId, sessionId, "exited", 1);
154
154
  emitProcessEvent(processId, {
155
155
  type: "backgroundProcess.removed",
@@ -181,4 +181,4 @@ export {
181
181
  getSessionProcesses2 as getSessionProcesses,
182
182
  getProcessLogs
183
183
  };
184
- //# sourceMappingURL=chunk-NBU6KIOD.js.map
184
+ //# sourceMappingURL=chunk-PBGOZMVY.js.map
@@ -94,9 +94,7 @@ function buildSessionStats(messagesWithStats) {
94
94
  };
95
95
  }
96
96
  function computeSessionStats(messages) {
97
- const messagesWithStats = messages.filter(
98
- (msg) => msg.stats !== void 0 && msg.stats !== null
99
- ).sort((a, b) => new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime());
97
+ const messagesWithStats = messages.filter((msg) => msg.stats !== void 0 && msg.stats !== null).sort((a, b) => new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime());
100
98
  if (messagesWithStats.length === 0) {
101
99
  return null;
102
100
  }
@@ -125,4 +123,4 @@ function computeSessionStats(messages) {
125
123
  export {
126
124
  computeSessionStats
127
125
  };
128
- //# sourceMappingURL=chunk-B7E3BICY.js.map
126
+ //# sourceMappingURL=chunk-RGRBWDZP.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createServerMessage,
3
3
  isClientMessage
4
- } from "./chunk-CTAIXOZJ.js";
4
+ } from "./chunk-NDJ6FKSP.js";
5
5
 
6
6
  // src/server/ws/protocol.ts
7
7
  function enrichMessagesWithToolResults(messages) {
@@ -45,7 +45,11 @@ function createErrorMessage(code, message, correlationId) {
45
45
  }
46
46
  function createSessionStateMessage(session, messages, pendingConfirmations = [], correlationId) {
47
47
  const enrichedMessages = enrichMessagesWithToolResults(messages);
48
- return createServerMessage("session.state", { session, messages: enrichedMessages, pendingConfirmations }, correlationId);
48
+ return createServerMessage(
49
+ "session.state",
50
+ { session, messages: enrichedMessages, pendingConfirmations },
51
+ correlationId
52
+ );
49
53
  }
50
54
  function createSessionListMessage(sessions, correlationId) {
51
55
  return createServerMessage("session.list", { sessions }, correlationId);
@@ -65,8 +69,8 @@ function createChatDeltaMessage(messageId, content) {
65
69
  function createChatThinkingMessage(messageId, content) {
66
70
  return createServerMessage("chat.thinking", { messageId, content });
67
71
  }
68
- function createChatToolPreparingMessage(messageId, index, name) {
69
- return createServerMessage("chat.tool_preparing", { messageId, index, name });
72
+ function createChatToolPreparingMessage(messageId, index, name, args) {
73
+ return createServerMessage("chat.tool_preparing", { messageId, index, name, ...args ? { arguments: args } : {} });
70
74
  }
71
75
  function createChatToolCallMessage(messageId, callId, tool, args) {
72
76
  return createServerMessage("chat.tool_call", { messageId, callId, tool, args });
@@ -96,7 +100,12 @@ function createChatMessageUpdatedMessage(messageId, updates) {
96
100
  return createServerMessage("chat.message_updated", { messageId, updates });
97
101
  }
98
102
  function createChatDoneMessage(messageId, reason, stats, agentType) {
99
- return createServerMessage("chat.done", { messageId, reason, ...stats ? { stats } : {}, ...agentType ? { agentType } : {} });
103
+ return createServerMessage("chat.done", {
104
+ messageId,
105
+ reason,
106
+ ...stats ? { stats } : {},
107
+ ...agentType ? { agentType } : {}
108
+ });
100
109
  }
101
110
  function createChatErrorMessage(error, recoverable) {
102
111
  return createServerMessage("chat.error", { error, recoverable });
@@ -142,7 +151,9 @@ function isAskAnswerPayload(payload) {
142
151
  return typeof payload === "object" && payload !== null && "callId" in payload && "answer" in payload;
143
152
  }
144
153
  function isUIFeedbackPayload(payload) {
145
- return typeof payload === "object" && payload !== null && "sessionId" in payload && typeof payload.sessionId === "string" && "element" in payload && typeof payload === "object" && "annotation" in payload && typeof payload.annotation === "string" && "pageUrl" in payload && typeof payload.pageUrl === "string";
154
+ if (typeof payload !== "object" || payload === null) return false;
155
+ const obj = payload;
156
+ return "sessionId" in payload && typeof obj.sessionId === "string" && "element" in payload && "annotation" in payload && typeof obj.annotation === "string" && "pageUrl" in payload && typeof obj.pageUrl === "string";
146
157
  }
147
158
  function createQueueStateMessage(messages) {
148
159
  return createServerMessage("queue.state", { messages });
@@ -187,16 +198,11 @@ function storedEventToServerMessage(event) {
187
198
  }
188
199
  case "tool.preparing": {
189
200
  const data = event.data;
190
- return createChatToolPreparingMessage(data.messageId, data.index, data.name);
201
+ return createChatToolPreparingMessage(data.messageId, data.index, data.name, data.arguments);
191
202
  }
192
203
  case "tool.call": {
193
204
  const data = event.data;
194
- return createChatToolCallMessage(
195
- data.messageId,
196
- data.toolCall.id,
197
- data.toolCall.name,
198
- data.toolCall.arguments
199
- );
205
+ return createChatToolCallMessage(data.messageId, data.toolCall.id, data.toolCall.name, data.toolCall.arguments);
200
206
  }
201
207
  case "tool.output": {
202
208
  const data = event.data;
@@ -313,4 +319,4 @@ export {
313
319
  createQueueStateMessage,
314
320
  storedEventToServerMessage
315
321
  };
316
- //# sourceMappingURL=chunk-KFBIHS3S.js.map
322
+ //# sourceMappingURL=chunk-STYHKCG7.js.map
@@ -5,13 +5,13 @@ import {
5
5
  getBackendCapabilities,
6
6
  getModelProfile,
7
7
  mapFinishReason
8
- } from "./chunk-J5DV33SS.js";
8
+ } from "./chunk-CUDAT6SS.js";
9
9
  import {
10
10
  ensureVisionFallbackConfigLoaded
11
- } from "./chunk-DLINTLB7.js";
11
+ } from "./chunk-BSTVRSV6.js";
12
12
  import {
13
13
  logger
14
- } from "./chunk-PNBH3RAX.js";
14
+ } from "./chunk-K44MW7JJ.js";
15
15
 
16
16
  // src/server/llm/models.ts
17
17
  var modelCache = /* @__PURE__ */ new Map();
@@ -191,7 +191,7 @@ function createLLMClient(config, initialBackend = "unknown") {
191
191
  try {
192
192
  const shouldDisableThinking = disableThinking || request.disableThinking === true;
193
193
  await ensureVisionFallbackConfigLoaded();
194
- const { isVisionFallbackEnabled } = await import("./vision-fallback-AXH3BGJC.js");
194
+ const { isVisionFallbackEnabled } = await import("./vision-fallback-ED27LH6C.js");
195
195
  const paramsOptions = {
196
196
  model,
197
197
  request,
@@ -252,11 +252,10 @@ function createLLMClient(config, initialBackend = "unknown") {
252
252
  }
253
253
  };
254
254
  } catch (error) {
255
- logger.error("LLM complete error", { error: error.toString() });
256
- throw new LLMError(
257
- error instanceof Error ? error.message : "Unknown LLM error",
258
- { originalError: error }
259
- );
255
+ logger.error("LLM complete error", { error: String(error) });
256
+ throw new LLMError(error instanceof Error ? error.message : "Unknown LLM error", {
257
+ originalError: error instanceof Error ? error : void 0
258
+ });
260
259
  }
261
260
  },
262
261
  async *stream(request) {
@@ -269,7 +268,7 @@ function createLLMClient(config, initialBackend = "unknown") {
269
268
  });
270
269
  try {
271
270
  await ensureVisionFallbackConfigLoaded();
272
- const { isVisionFallbackEnabled } = await import("./vision-fallback-AXH3BGJC.js");
271
+ const { isVisionFallbackEnabled } = await import("./vision-fallback-ED27LH6C.js");
273
272
  const shouldDisableThinking = disableThinking || request.disableThinking === true;
274
273
  const createParams = await buildStreamingCreateParams({
275
274
  model,
@@ -483,4 +482,4 @@ export {
483
482
  setLlmStatus,
484
483
  clearModelCache
485
484
  };
486
- //# sourceMappingURL=chunk-55Z3DJ7G.js.map
485
+ //# sourceMappingURL=chunk-TGWEH2BC.js.map
@@ -1,23 +1,19 @@
1
1
  import {
2
2
  detectModel
3
- } from "./chunk-55Z3DJ7G.js";
3
+ } from "./chunk-TGWEH2BC.js";
4
4
  import {
5
5
  detectBackend
6
- } from "./chunk-J5DV33SS.js";
6
+ } from "./chunk-CUDAT6SS.js";
7
7
  import {
8
8
  getGlobalConfigPath
9
- } from "./chunk-R4HADRYO.js";
9
+ } from "./chunk-CQGTEGKL.js";
10
10
 
11
11
  // src/cli/config.ts
12
12
  import { z } from "zod";
13
13
  import { randomUUID } from "crypto";
14
14
  import { readFile, writeFile, mkdir, access } from "fs/promises";
15
15
  import { dirname } from "path";
16
- var SMART_DEFAULTS = [
17
- "http://localhost:8000",
18
- "http://localhost:11434",
19
- "http://localhost:8080"
20
- ];
16
+ var SMART_DEFAULTS = ["http://localhost:8000", "http://localhost:11434", "http://localhost:8080"];
21
17
  async function trySmartDefaults(_mode) {
22
18
  const results = await Promise.all(
23
19
  SMART_DEFAULTS.map(async (url) => {
@@ -46,7 +42,17 @@ async function configFileExists(mode) {
46
42
  return false;
47
43
  }
48
44
  }
49
- var backendSchema = z.enum(["auto", "vllm", "sglang", "ollama", "llamacpp", "openai", "anthropic", "opencode-go", "unknown"]);
45
+ var backendSchema = z.enum([
46
+ "auto",
47
+ "vllm",
48
+ "sglang",
49
+ "ollama",
50
+ "llamacpp",
51
+ "openai",
52
+ "anthropic",
53
+ "opencode-go",
54
+ "unknown"
55
+ ]);
50
56
  var modelConfigSchema = z.object({
51
57
  id: z.string(),
52
58
  contextWindow: z.number(),
@@ -138,11 +144,13 @@ function migrateConfig(raw) {
138
144
  let models = existingModels ?? [];
139
145
  if (maxContext !== void 0 && (existingModels === void 0 || existingModels.length === 0)) {
140
146
  migrationOccurred = true;
141
- models = [{
142
- id: model ?? "auto",
143
- contextWindow: maxContext,
144
- source: "user"
145
- }];
147
+ models = [
148
+ {
149
+ id: model ?? "auto",
150
+ contextWindow: maxContext,
151
+ source: "user"
152
+ }
153
+ ];
146
154
  }
147
155
  return {
148
156
  ...rest,
@@ -182,11 +190,13 @@ function migrateConfig(raw) {
182
190
  if (typeof raw === "object" && raw !== null && "llm" in raw) {
183
191
  const oldConfig = oldConfigSchema.parse(raw);
184
192
  const providerId = randomUUID();
185
- const models = [{
186
- id: oldConfig.llm.model || "auto",
187
- contextWindow: oldConfig.llm.maxContext,
188
- source: "user"
189
- }];
193
+ const models = [
194
+ {
195
+ id: oldConfig.llm.model || "auto",
196
+ contextWindow: oldConfig.llm.maxContext,
197
+ source: "user"
198
+ }
199
+ ];
190
200
  const provider = {
191
201
  id: providerId,
192
202
  name: "Default",
@@ -243,7 +253,12 @@ async function saveGlobalConfig(mode, config) {
243
253
  logging: config.logging ?? { level: "error" },
244
254
  database: config.database ?? { path: "" },
245
255
  workspace: config.workspace ?? { workdir: process.cwd() },
246
- visionFallback: config.visionFallback ?? { enabled: false, url: "http://localhost:11434", model: "qwen3-vl:2b", timeout: 120 }
256
+ visionFallback: config.visionFallback ?? {
257
+ enabled: false,
258
+ url: "http://localhost:11434",
259
+ model: "qwen3-vl:2b",
260
+ timeout: 120
261
+ }
247
262
  };
248
263
  await mkdir(dirname(configPath), { recursive: true });
249
264
  await writeFile(configPath, JSON.stringify(fullConfig, null, 2));
@@ -273,7 +288,12 @@ function setDefaultModelSelection(config, providerId, model) {
273
288
  logging: config.logging ?? { level: "error" },
274
289
  database: config.database ?? { path: "" },
275
290
  workspace: config.workspace ?? { workdir: process.cwd() },
276
- visionFallback: config.visionFallback ?? { enabled: false, url: "http://localhost:11434", model: "qwen3-vl:2b", timeout: 120 }
291
+ visionFallback: config.visionFallback ?? {
292
+ enabled: false,
293
+ url: "http://localhost:11434",
294
+ model: "qwen3-vl:2b",
295
+ timeout: 120
296
+ }
277
297
  };
278
298
  }
279
299
  function addProvider(config, provider) {
@@ -295,7 +315,12 @@ function addProvider(config, provider) {
295
315
  logging: config.logging ?? { level: "error" },
296
316
  database: config.database ?? { path: "" },
297
317
  workspace: config.workspace ?? { workdir: process.cwd() },
298
- visionFallback: config.visionFallback ?? { enabled: false, url: "http://localhost:11434", model: "qwen3-vl:2b", timeout: 120 }
318
+ visionFallback: config.visionFallback ?? {
319
+ enabled: false,
320
+ url: "http://localhost:11434",
321
+ model: "qwen3-vl:2b",
322
+ timeout: 120
323
+ }
299
324
  };
300
325
  }
301
326
  function removeProvider(config, providerId) {
@@ -320,7 +345,12 @@ function removeProvider(config, providerId) {
320
345
  logging: config.logging ?? { level: "error" },
321
346
  database: config.database ?? { path: "" },
322
347
  workspace: config.workspace ?? { workdir: process.cwd() },
323
- visionFallback: config.visionFallback ?? { enabled: false, url: "http://localhost:11434", model: "qwen3-vl:2b", timeout: 120 }
348
+ visionFallback: config.visionFallback ?? {
349
+ enabled: false,
350
+ url: "http://localhost:11434",
351
+ model: "qwen3-vl:2b",
352
+ timeout: 120
353
+ }
324
354
  };
325
355
  }
326
356
  function activateProvider(config, providerId) {
@@ -335,7 +365,12 @@ function activateProvider(config, providerId) {
335
365
  logging: config.logging ?? { level: "error" },
336
366
  database: config.database ?? { path: "" },
337
367
  workspace: config.workspace ?? { workdir: process.cwd() },
338
- visionFallback: config.visionFallback ?? { enabled: false, url: "http://localhost:11434", model: "qwen3-vl:2b", timeout: 120 }
368
+ visionFallback: config.visionFallback ?? {
369
+ enabled: false,
370
+ url: "http://localhost:11434",
371
+ model: "qwen3-vl:2b",
372
+ timeout: 120
373
+ }
339
374
  };
340
375
  }
341
376
  return {
@@ -347,26 +382,40 @@ function activateProvider(config, providerId) {
347
382
  logging: config.logging ?? { level: "error" },
348
383
  database: config.database ?? { path: "" },
349
384
  workspace: config.workspace ?? { workdir: process.cwd() },
350
- visionFallback: config.visionFallback ?? { enabled: false, url: "http://localhost:11434", model: "qwen3-vl:2b", timeout: 120 }
385
+ visionFallback: config.visionFallback ?? {
386
+ enabled: false,
387
+ url: "http://localhost:11434",
388
+ model: "qwen3-vl:2b",
389
+ timeout: 120
390
+ }
351
391
  };
352
392
  }
353
393
  function mergeConfigs(...configs) {
354
- const result = configs.reduce((acc, curr) => {
355
- if (curr.llm) {
356
- acc.llm = { ...acc.llm, ...curr.llm };
357
- }
358
- if (curr.server) {
359
- acc.server = { ...acc.server, ...curr.server };
360
- }
361
- if (curr.logging) {
362
- acc.logging = { ...acc.logging, ...curr.logging };
394
+ const result = configs.reduce(
395
+ (acc, curr) => {
396
+ if (curr.llm) {
397
+ acc.llm = { ...acc.llm, ...curr.llm };
398
+ }
399
+ if (curr.server) {
400
+ acc.server = { ...acc.server, ...curr.server };
401
+ }
402
+ if (curr.logging) {
403
+ acc.logging = { ...acc.logging, ...curr.logging };
404
+ }
405
+ return acc;
406
+ },
407
+ {
408
+ llm: {
409
+ url: "http://localhost:8000/v1",
410
+ model: "auto",
411
+ backend: "auto",
412
+ maxContext: 2e5,
413
+ disableThinking: false
414
+ },
415
+ server: { port: 10369, host: "127.0.0.1", openBrowser: true },
416
+ logging: { level: "error" }
363
417
  }
364
- return acc;
365
- }, {
366
- llm: { url: "http://localhost:8000/v1", model: "auto", backend: "auto", maxContext: 2e5, disableThinking: false },
367
- server: { port: 10369, host: "127.0.0.1", openBrowser: true },
368
- logging: { level: "error" }
369
- });
418
+ );
370
419
  return oldConfigSchema.parse(result);
371
420
  }
372
421
 
@@ -386,4 +435,4 @@ export {
386
435
  activateProvider,
387
436
  mergeConfigs
388
437
  };
389
- //# sourceMappingURL=chunk-TYUNDOX2.js.map
438
+ //# sourceMappingURL=chunk-UKMRZDWM.js.map