openfox 1.6.75 → 1.6.76

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 (65) hide show
  1. package/dist/{ask-3RK5YJZE.js → ask-5SSOA6SZ.js} +2 -2
  2. package/dist/{auth-LZZX63KI.js → auth-56SIRACI.js} +3 -6
  3. package/dist/auto-compaction-V3PA77WG.js +27 -0
  4. package/dist/{branch.api-XADFZZAA.js → branch.api-PWFW26KC.js} +2 -2
  5. package/dist/{chat-handler-KYMMXPP6.js → chat-handler-7DKHGTVO.js} +31 -29
  6. package/dist/{chunk-5UTTLO4D.js → chunk-5ZD3GZTK.js} +89 -49
  7. package/dist/{chunk-AFATQ5LJ.js → chunk-B5AP3RSV.js} +1 -1
  8. package/dist/{chunk-22CTURMH.js → chunk-BJYPTN5S.js} +1 -1
  9. package/dist/{chunk-DLINTLB7.js → chunk-BSTVRSV6.js} +7 -5
  10. package/dist/{chunk-7JPKRM6M.js → chunk-CMQCO27Y.js} +22 -12
  11. package/dist/{chunk-R4HADRYO.js → chunk-CQGTEGKL.js} +1 -1
  12. package/dist/{chunk-J5DV33SS.js → chunk-CUDAT6SS.js} +46 -18
  13. package/dist/{chunk-ETIXH35K.js → chunk-H5EICXF3.js} +499 -277
  14. package/dist/{chunk-XIZ6B6IS.js → chunk-K2V7EW5F.js} +541 -299
  15. package/dist/{chunk-PNBH3RAX.js → chunk-K44MW7JJ.js} +1 -1
  16. package/dist/{chunk-BLNFJ22S.js → chunk-KIOUKC3Z.js} +6 -4
  17. package/dist/{chunk-4CQ7CUQ6.js → chunk-LCQ3MPXD.js} +5 -5
  18. package/dist/{chunk-CTAIXOZJ.js → chunk-NDJ6FKSP.js} +1 -1
  19. package/dist/{chunk-IA4O65CR.js → chunk-NHJ2GVCF.js} +100 -68
  20. package/dist/{chunk-GQZGIMJO.js → chunk-OXI26S7U.js} +12 -7
  21. package/dist/{chunk-NBU6KIOD.js → chunk-PBGOZMVY.js} +4 -4
  22. package/dist/{chunk-B7E3BICY.js → chunk-RGRBWDZP.js} +2 -4
  23. package/dist/{chunk-VIGOXEZG.js → chunk-RQ4XSKUR.js} +15 -16
  24. package/dist/{chunk-KFBIHS3S.js → chunk-STYHKCG7.js} +20 -14
  25. package/dist/{chunk-55Z3DJ7G.js → chunk-TGWEH2BC.js} +10 -11
  26. package/dist/{chunk-TYUNDOX2.js → chunk-UKMRZDWM.js} +90 -41
  27. package/dist/{chunk-PFRQO5Z3.js → chunk-VAMTEAYI.js} +49 -27
  28. package/dist/{chunk-574HZVLE.js → chunk-VRGRAQDG.js} +2 -2
  29. package/dist/{chunk-JQBTYHUR.js → chunk-WR6QCJJO.js} +53 -15
  30. package/dist/{chunk-RBPOAAIZ.js → chunk-XKIEDGQF.js} +22 -18
  31. package/dist/cli/dev.js +2 -2
  32. package/dist/cli/index.js +2 -2
  33. package/dist/{config-6T4EHAP2.js → config-5CONAOL7.js} +7 -7
  34. package/dist/{events-LKEZ3YCW.js → events-BDXQOC7F.js} +6 -6
  35. package/dist/{folding-JN2WT44N.js → folding-2HW7FIKL.js} +2 -2
  36. package/dist/{inspect-proxy-Y4MRAVB7.js → inspect-proxy-Y75AXMRX.js} +3 -3
  37. package/dist/{manager-HM2J5VMW.js → manager-W7N3XQ4Q.js} +3 -3
  38. package/dist/orchestrator-KCHEENHK.js +43 -0
  39. package/dist/package.json +19 -3
  40. package/dist/{paths-ZRI56O63.js → paths-X46PPOI2.js} +2 -2
  41. package/dist/{processor-23O4HPSS.js → processor-6TS37IYH.js} +15 -11
  42. package/dist/{project-creator-LASKNQPA.js → project-creator-VD7MLOWE.js} +8 -5
  43. package/dist/{projects-HEUOWNSR.js → projects-XLMSDFTQ.js} +4 -4
  44. package/dist/{protocol-5AWNGFLH.js → protocol-4CTV7OZC.js} +3 -3
  45. package/dist/{protocol-DRBnujwe.d.ts → protocol-4xbfAlGO.d.ts} +3 -0
  46. package/dist/{provider-AKN355YH.js → provider-ESEBV3LL.js} +15 -11
  47. package/dist/{pwa-GHQCMCIU.js → pwa-76XP2DY2.js} +2 -2
  48. package/dist/{runtime-config-ZCK74XKM.js → runtime-config-CBJJJGBD.js} +2 -2
  49. package/dist/{serve-TW63YCNQ.js → serve-OLDABBV3.js} +29 -27
  50. package/dist/server/index.d.ts +6 -1
  51. package/dist/server/index.js +22 -22
  52. package/dist/server/public/__inspect__.js +2 -1
  53. package/dist/{service-74Z7JK2J.js → service-D6LC3CAM.js} +3 -2
  54. package/dist/{settings-NI4ITGV6.js → settings-TQNQB56H.js} +4 -4
  55. package/dist/shared/index.d.ts +2 -2
  56. package/dist/shared/index.js +2 -2
  57. package/dist/{store-2IF3ZSLD.js → store-OQ45KONN.js} +2 -2
  58. package/dist/{tools-RUAY6EVI.js → tools-BHYHS3RY.js} +18 -18
  59. package/dist/{vision-fallback-AXH3BGJC.js → vision-fallback-ED27LH6C.js} +3 -3
  60. package/dist/web/assets/{index-CWdKiSP8.js → index-DAuZ02-Q.js} +57 -57
  61. package/dist/web/index.html +1 -1
  62. package/dist/web/sw.js +1 -1
  63. package/package.json +19 -3
  64. package/dist/auto-compaction-OW4P2QWQ.js +0 -27
  65. package/dist/orchestrator-QP4O7MUM.js +0 -43
@@ -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
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  getEventStore,
3
3
  updateSessionMetadata
4
- } from "./chunk-5UTTLO4D.js";
4
+ } from "./chunk-5ZD3GZTK.js";
5
5
  import {
6
6
  buildMessagesFromStoredEvents,
7
7
  foldPendingConfirmations
8
- } from "./chunk-PFRQO5Z3.js";
8
+ } from "./chunk-VAMTEAYI.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-LCQ3MPXD.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
@@ -13,17 +13,17 @@ import {
13
13
  getToolRegistryForAgent,
14
14
  loadAllAgentsDefault,
15
15
  runTopLevelAgentLoop
16
- } from "./chunk-ETIXH35K.js";
16
+ } from "./chunk-H5EICXF3.js";
17
17
  import {
18
18
  getCurrentContextWindowId,
19
19
  getEventStore
20
- } from "./chunk-5UTTLO4D.js";
20
+ } from "./chunk-5ZD3GZTK.js";
21
21
  import {
22
22
  buildSnapshotFromSessionState
23
- } from "./chunk-PFRQO5Z3.js";
23
+ } from "./chunk-VAMTEAYI.js";
24
24
  import {
25
25
  logger
26
- } from "./chunk-PNBH3RAX.js";
26
+ } from "./chunk-K44MW7JJ.js";
27
27
 
28
28
  // src/server/sub-agents/verifier-helpers.ts
29
29
  var MAX_CONSECUTIVE_VERIFIER_NUDGES = 10;
@@ -99,11 +99,19 @@ async function runChatTurn(options) {
99
99
  recoverable: false
100
100
  }
101
101
  });
102
- eventStore.append(sessionId, createMessageStartEvent(errorMsgId2, "user", `Access denied: ${error.paths.join(", ")}. If you need this file, explain why and ask the user for permission.`, {
103
- ...getCurrentWindowMessageOptions(sessionId) ?? {},
104
- isSystemGenerated: true,
105
- messageKind: "correction"
106
- }));
102
+ eventStore.append(
103
+ sessionId,
104
+ createMessageStartEvent(
105
+ errorMsgId2,
106
+ "user",
107
+ `Access denied: ${error.paths.join(", ")}. If you need this file, explain why and ask the user for permission.`,
108
+ {
109
+ ...getCurrentWindowMessageOptions(sessionId) ?? {},
110
+ isSystemGenerated: true,
111
+ messageKind: "correction"
112
+ }
113
+ )
114
+ );
107
115
  eventStore.append(sessionId, createChatDoneEvent(errorMsgId2, "error"));
108
116
  return;
109
117
  }
@@ -121,11 +129,19 @@ async function runChatTurn(options) {
121
129
  recoverable: false
122
130
  }
123
131
  });
124
- eventStore.append(sessionId, createMessageStartEvent(errorMsgId, "user", `Error: ${error instanceof Error ? error.message : "Unknown error"}`, {
125
- ...getCurrentWindowMessageOptions(sessionId) ?? {},
126
- isSystemGenerated: true,
127
- messageKind: "correction"
128
- }));
132
+ eventStore.append(
133
+ sessionId,
134
+ createMessageStartEvent(
135
+ errorMsgId,
136
+ "user",
137
+ `Error: ${error instanceof Error ? error.message : "Unknown error"}`,
138
+ {
139
+ ...getCurrentWindowMessageOptions(sessionId) ?? {},
140
+ isSystemGenerated: true,
141
+ messageKind: "correction"
142
+ }
143
+ )
144
+ );
129
145
  eventStore.append(sessionId, createChatDoneEvent(errorMsgId, "error"));
130
146
  } finally {
131
147
  eventStore.append(sessionId, { type: "running.changed", data: { isRunning: false } });
@@ -173,17 +189,20 @@ async function runGenericAgentTurn(options, turnMetrics, agentId) {
173
189
  injectModeReminderIfNeeded(options.sessionManager, options.sessionId, agentId, allAgents, options.onMessage);
174
190
  const agentDef = findAgentById(agentId, allAgents) ?? findAgentById("planner", allAgents);
175
191
  const subAgentDefs = getSubAgents(allAgents);
176
- await runTopLevelAgentLoop({
177
- mode: agentId,
178
- sessionManager: options.sessionManager,
179
- sessionId: options.sessionId,
180
- llmClient: options.llmClient,
181
- statsIdentity,
182
- signal: options.signal,
183
- onMessage: options.onMessage,
184
- assembleRequest: (input) => assembleAgentRequest({ ...input, agentDef, subAgentDefs, modelName: options.llmClient.getModel() }),
185
- getToolRegistry: () => getToolRegistryForAgent(agentDef)
186
- }, turnMetrics);
192
+ await runTopLevelAgentLoop(
193
+ {
194
+ mode: agentId,
195
+ sessionManager: options.sessionManager,
196
+ sessionId: options.sessionId,
197
+ llmClient: options.llmClient,
198
+ statsIdentity,
199
+ signal: options.signal,
200
+ onMessage: options.onMessage,
201
+ assembleRequest: (input) => assembleAgentRequest({ ...input, agentDef, subAgentDefs, modelName: options.llmClient.getModel() }),
202
+ getToolRegistry: () => getToolRegistryForAgent(agentDef)
203
+ },
204
+ turnMetrics
205
+ );
187
206
  }
188
207
  function filterToolRegistryForStepDone(baseRegistry, _injectStepDone) {
189
208
  return baseRegistry;
@@ -198,50 +217,63 @@ async function runBuilderTurn(options, turnMetrics) {
198
217
  const subAgentDefs = getSubAgents(allAgents);
199
218
  let stepDoneCalled = false;
200
219
  return {
201
- ...await runTopLevelAgentLoop({
202
- mode: "builder",
203
- sessionManager,
204
- sessionId,
205
- llmClient: options.llmClient,
206
- statsIdentity,
207
- signal: options.signal,
208
- onMessage: options.onMessage,
209
- assembleRequest: (input) => assembleAgentRequest({ ...input, agentDef: builderDef, subAgentDefs, modelName: options.llmClient.getModel() }),
210
- getToolRegistry: () => {
211
- const baseRegistry = getToolRegistryForAgent(builderDef);
212
- return filterToolRegistryForStepDone(baseRegistry, options.injectStepDone === true);
213
- },
214
- onToolExecuted: (toolCall, toolResult) => {
215
- if (toolCall.name === "step_done" && toolResult.success) {
216
- stepDoneCalled = true;
217
- }
218
- if (toolResult.success && ["write_file", "edit_file"].includes(toolCall.name)) {
219
- const path = toolCall.arguments["path"];
220
- sessionManager.addModifiedFile(sessionId, path);
220
+ ...await runTopLevelAgentLoop(
221
+ {
222
+ mode: "builder",
223
+ sessionManager,
224
+ sessionId,
225
+ llmClient: options.llmClient,
226
+ statsIdentity,
227
+ signal: options.signal,
228
+ onMessage: options.onMessage,
229
+ assembleRequest: (input) => assembleAgentRequest({
230
+ ...input,
231
+ agentDef: builderDef,
232
+ subAgentDefs,
233
+ modelName: options.llmClient.getModel()
234
+ }),
235
+ getToolRegistry: () => {
236
+ const baseRegistry = getToolRegistryForAgent(builderDef);
237
+ return filterToolRegistryForStepDone(baseRegistry, options.injectStepDone === true);
238
+ },
239
+ onToolExecuted: (toolCall, toolResult) => {
240
+ if (toolCall.name === "step_done" && toolResult.success) {
241
+ stepDoneCalled = true;
242
+ }
243
+ if (toolResult.success && ["write_file", "edit_file"].includes(toolCall.name)) {
244
+ const path = toolCall.arguments["path"];
245
+ sessionManager.addModifiedFile(sessionId, path);
246
+ }
247
+ },
248
+ injectKickoff: () => {
249
+ if (options.injectBuilderKickoff !== true) return;
250
+ const session = sessionManager.requireSession(sessionId);
251
+ const currentWindowMessageOptions = getCurrentContextWindowId(sessionId) ? { contextWindowId: getCurrentContextWindowId(sessionId) } : void 0;
252
+ const events = eventStore.getEvents(sessionId);
253
+ const hasBuilderKickoff = events.some((e) => {
254
+ if (e.type !== "message.start") return false;
255
+ const data = e.data;
256
+ return data.messageKind === "auto-prompt" && data.content?.includes("fulfil the");
257
+ });
258
+ if (!hasBuilderKickoff) {
259
+ const kickoffMsgId = crypto.randomUUID();
260
+ const kickoffContent = BUILDER_KICKOFF_PROMPT(session.criteria.length);
261
+ const msgMetadata = { type: "workflow", name: "Workflow", color: "#f59e0b" };
262
+ eventStore.append(
263
+ sessionId,
264
+ createMessageStartEvent(kickoffMsgId, "user", kickoffContent, {
265
+ ...currentWindowMessageOptions ?? {},
266
+ isSystemGenerated: true,
267
+ messageKind: "auto-prompt",
268
+ metadata: msgMetadata
269
+ })
270
+ );
271
+ eventStore.append(sessionId, { type: "message.done", data: { messageId: kickoffMsgId } });
272
+ }
221
273
  }
222
274
  },
223
- injectKickoff: () => {
224
- if (options.injectBuilderKickoff !== true) return;
225
- const session = sessionManager.requireSession(sessionId);
226
- const events = eventStore.getEvents(sessionId);
227
- const hasBuilderKickoff = events.some((e) => {
228
- if (e.type !== "message.start") return false;
229
- const data = e.data;
230
- return data.messageKind === "auto-prompt" && data.content?.includes("fulfil the");
231
- });
232
- if (!hasBuilderKickoff) {
233
- const kickoffMsgId = crypto.randomUUID();
234
- const kickoffContent = BUILDER_KICKOFF_PROMPT(session.criteria.length);
235
- eventStore.append(sessionId, createMessageStartEvent(kickoffMsgId, "user", kickoffContent, {
236
- ...getCurrentWindowMessageOptions(sessionId) ?? {},
237
- isSystemGenerated: true,
238
- messageKind: "auto-prompt",
239
- metadata: { type: "workflow", name: "Workflow", color: "#f59e0b" }
240
- }));
241
- eventStore.append(sessionId, { type: "message.done", data: { messageId: kickoffMsgId } });
242
- }
243
- }
244
- }, turnMetrics),
275
+ turnMetrics
276
+ ),
245
277
  stepDoneCalled
246
278
  };
247
279
  }
@@ -295,4 +327,4 @@ export {
295
327
  runBuilderTurn,
296
328
  runVerifierTurn
297
329
  };
298
- //# sourceMappingURL=chunk-IA4O65CR.js.map
330
+ //# sourceMappingURL=chunk-NHJ2GVCF.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
@@ -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-OLDABBV3.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-RQ4XSKUR.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