openfox 2.0.118 → 2.0.120

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 (57) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/CHANGELOG.md +34 -0
  3. package/dist/agent-defaults/code-reviewer.agent.md +8 -3
  4. package/dist/{auto-config-AAUO4PKW.js → auto-config-YXNCBYEY.js} +125 -11
  5. package/dist/{chat-handler-KNBP6WVI.js → chat-handler-TIR5CMWE.js} +12 -11
  6. package/dist/{chunk-RXIDGWNV.js → chunk-54FTLSWS.js} +102 -55
  7. package/dist/{chunk-CIYA6BNB.js → chunk-A5JAVQKG.js} +2 -2
  8. package/dist/{chunk-HZSKKJHQ.js → chunk-AS7KAH66.js} +28 -9
  9. package/dist/{chunk-5ZR5O5GC.js → chunk-CYXAMXN5.js} +4 -4
  10. package/dist/{chunk-W7VIYHPQ.js → chunk-GJL3QSMP.js} +3 -2
  11. package/dist/{chunk-CX7UJZA5.js → chunk-HWHWXLM5.js} +4 -4
  12. package/dist/{chunk-NP2SV2CX.js → chunk-IQFPRQWM.js} +10 -4
  13. package/dist/{chunk-5E5G3DLI.js → chunk-IW46BUOP.js} +3 -3
  14. package/dist/{chunk-45OS4H3L.js → chunk-JDBIR2J7.js} +7 -7
  15. package/dist/{chunk-IDUXGSQV.js → chunk-JDWJ2PJJ.js} +16 -12
  16. package/dist/chunk-K2QKX4ZJ.js +31 -0
  17. package/dist/{chunk-MKWS7TQH.js → chunk-KFQKBXLO.js} +22 -16
  18. package/dist/{chunk-TOKQ2UVG.js → chunk-MIPQOHWS.js} +20 -6
  19. package/dist/{chunk-Y6WWEQPC.js → chunk-PI4X3Y6H.js} +11 -11
  20. package/dist/chunk-PXEWE5YP.js +7 -0
  21. package/dist/{chunk-MTFLMNLN.js → chunk-USNG72WA.js} +2 -2
  22. package/dist/{chunk-GZTMCTUS.js → chunk-WN76RDRU.js} +18 -22
  23. package/dist/cli/dev.js +1 -1
  24. package/dist/cli/index.js +1 -1
  25. package/dist/{client-KCNTDTIR.js → client-GXRHODRQ.js} +4 -4
  26. package/dist/{client-pure-B5DHEKQJ.js → client-pure-QSY7TJGK.js} +2 -2
  27. package/dist/{compactor-5ATICQ2A.js → compactor-TI352G7B.js} +5 -5
  28. package/dist/{dynamic-context-4SKLIPJ4.js → dynamic-context-C6HGUQTR.js} +2 -2
  29. package/dist/{launch-Q6GUJ22H.js → launch-SRSMTDEM.js} +12 -11
  30. package/dist/{orchestrator-DVCGWWNA.js → orchestrator-SCH2T4JB.js} +11 -10
  31. package/dist/package.json +1 -1
  32. package/dist/{processor-G6UJGA2K.js → processor-GM4D26E6.js} +11 -10
  33. package/dist/{profiles-GYHXBWPV.js → profiles-3YLLEJ2B.js} +2 -2
  34. package/dist/{protocol-DzJrspsl.d.ts → protocol-D5kJLGWy.d.ts} +1 -1
  35. package/dist/provider/index.d.ts +4 -4
  36. package/dist/{provider-Q7J4UFTS.js → provider-5V6RDVU2.js} +6 -5
  37. package/dist/{provider-manager-TMBO4DFG.js → provider-manager-7QD5HAOL.js} +6 -5
  38. package/dist/{serve-23YIIMXH.js → serve-M7I3HWVQ.js} +17 -16
  39. package/dist/server/index.d.ts +22 -5
  40. package/dist/server/index.js +16 -15
  41. package/dist/{server-IDXIAC5L.js → server-F72WN4KP.js} +15 -14
  42. package/dist/{service-M7XJHAK4.js → service-A3YLLXW3.js} +7 -6
  43. package/dist/session-status-6Q5B5PEN.js +35 -0
  44. package/dist/shared/index.d.ts +3 -3
  45. package/dist/{tasks-X5H5HM4J.js → tasks-X5U7DWZR.js} +9 -7
  46. package/dist/{tools-GOGLGTNV.js → tools-GCBDO7TU.js} +9 -8
  47. package/dist/{types-CIVhQMvD.d.ts → types-B5CI_Ql3.d.ts} +3 -1
  48. package/dist/{types-Df7NM9b5.d.ts → types-CZlj7ufS.d.ts} +2 -0
  49. package/dist/{update-T3YMIWQO.js → update-TUGN3JJE.js} +2 -2
  50. package/dist/web/assets/index-BlYcAqzD.js +324 -0
  51. package/dist/web/assets/{index-XTp1QlHA.css → index-D9sfxcRH.css} +1 -1
  52. package/dist/web/index.html +2 -2
  53. package/dist/web/sw.js +1 -1
  54. package/dist/workflow-defaults/default.workflow.json +1 -1
  55. package/package.json +1 -1
  56. package/dist/chunk-BSULZIPW.js +0 -7
  57. package/dist/web/assets/index-BgENxR9h.js +0 -324
@@ -18,7 +18,7 @@ import {
18
18
  recordLLMFailure,
19
19
  sleepThroughRetryBackoff,
20
20
  streamLLMPure
21
- } from "./chunk-NP2SV2CX.js";
21
+ } from "./chunk-IQFPRQWM.js";
22
22
  import {
23
23
  COMPACTION_PROMPT,
24
24
  buildBasePrompt,
@@ -61,7 +61,7 @@ import {
61
61
  getGateConfig,
62
62
  isTaskConflictError,
63
63
  isTaskGateError
64
- } from "./chunk-HZSKKJHQ.js";
64
+ } from "./chunk-AS7KAH66.js";
65
65
  import {
66
66
  getSessionDisabledServers
67
67
  } from "./chunk-EQ5CGNOT.js";
@@ -111,7 +111,7 @@ import {
111
111
  } from "./chunk-LNNBLB6G.js";
112
112
  import {
113
113
  modelSupportsVision
114
- } from "./chunk-W7VIYHPQ.js";
114
+ } from "./chunk-GJL3QSMP.js";
115
115
  import {
116
116
  OUTPUT_LIMITS,
117
117
  cacheSet,
@@ -122,7 +122,7 @@ import {
122
122
  formatPdfErrorMessage,
123
123
  isPdfBuffer,
124
124
  processPdfContent
125
- } from "./chunk-TOKQ2UVG.js";
125
+ } from "./chunk-MIPQOHWS.js";
126
126
  import {
127
127
  SETTINGS_KEYS,
128
128
  getSetting
@@ -1805,6 +1805,7 @@ function emitDoneAndBreak(assistantMsgId, segments, statsIdentity, mode, turnMet
1805
1805
  }
1806
1806
  }
1807
1807
  var MAX_TRUNCATION_RETRIES = 3;
1808
+ var OUTPUT_RESERVE_TOKENS = 2048;
1808
1809
  var CONTINUE_PROMPT = "Continue your previous response. Do NOT repeat what you already wrote.";
1809
1810
  var CONTINUE_AFTER_STREAM_ERROR_PROMPT = "The LLM stream was interrupted mid-response. Continue exactly where you left off \u2014 do not repeat what was already written.";
1810
1811
  async function runTopLevelAgentLoop(config, turnMetrics) {
@@ -1915,8 +1916,8 @@ ${CONTINUE_PROMPT}` : CONTINUE_PROMPT;
1915
1916
  };
1916
1917
  const contextState = sessionManager.getContextState(sessionId);
1917
1918
  previousContextTokens = contextState.currentTokens;
1918
- const contextWindow = sessionManager.getCurrentModelContext();
1919
- const availableForOutput = Math.max(256, contextWindow - contextState.currentTokens);
1919
+ const contextWindow = sessionManager.getCurrentModelContext(sessionId);
1920
+ const availableForOutput = Math.max(256, contextWindow - contextState.currentTokens - OUTPUT_RESERVE_TOKENS);
1920
1921
  let modelSettings = config.modelSettings ?? (currentMaxTokensOverride !== void 0 ? { ...sessionManager.getCurrentModelSettings(sessionId), maxTokens: currentMaxTokensOverride } : sessionManager.getCurrentModelSettings(sessionId));
1921
1922
  if (modelSettings) {
1922
1923
  const requestedMaxTokens = modelSettings.maxTokens ?? 16384;
@@ -2039,7 +2040,7 @@ ${CONTINUE_PROMPT}` : CONTINUE_PROMPT;
2039
2040
  );
2040
2041
  if (!compacting) {
2041
2042
  const contextState = sessionManager.getContextState(sessionId);
2042
- const { shouldCompact, appendCompactionPrompt } = await import("./compactor-5ATICQ2A.js");
2043
+ const { shouldCompact, appendCompactionPrompt } = await import("./compactor-TI352G7B.js");
2043
2044
  if (shouldCompact(
2044
2045
  contextState.currentTokens,
2045
2046
  contextState.maxTokens,
@@ -2055,8 +2056,11 @@ ${CONTINUE_PROMPT}` : CONTINUE_PROMPT;
2055
2056
  truncationRetryCount += 1;
2056
2057
  const currentMaxTokens = result.modelParams?.maxTokens ?? 16384;
2057
2058
  const promptTokens = result.usage.promptTokens;
2058
- const contextWindow = sessionManager.getCurrentModelContext();
2059
- const newMaxTokens = Math.min(Math.floor(currentMaxTokens * 1.5), contextWindow - promptTokens - 2048);
2059
+ const contextWindow = sessionManager.getCurrentModelContext(sessionId);
2060
+ const newMaxTokens = Math.min(
2061
+ Math.floor(currentMaxTokens * 1.5),
2062
+ Math.max(256, contextWindow - promptTokens - OUTPUT_RESERVE_TOKENS)
2063
+ );
2060
2064
  currentMaxTokensOverride = newMaxTokens;
2061
2065
  const interimStats = turnMetrics.buildStats(statsIdentity, mode);
2062
2066
  append(
@@ -3029,7 +3033,7 @@ var callSubAgentTool = {
3029
3033
  };
3030
3034
  }
3031
3035
  try {
3032
- const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-GOGLGTNV.js");
3036
+ const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-GCBDO7TU.js");
3033
3037
  const toolRegistry = getToolRegistryForAgent2(agentDef);
3034
3038
  const turnMetrics = new TurnMetrics();
3035
3039
  const result = await executeSubAgent({
@@ -4051,7 +4055,7 @@ var mcpConfigTool = createTool(
4051
4055
  mcpNotifyChanged?.(sessionId);
4052
4056
  }
4053
4057
  async function rebuildTools() {
4054
- const { setMcpTools: setMcpTools2 } = await import("./tools-GOGLGTNV.js");
4058
+ const { setMcpTools: setMcpTools2 } = await import("./tools-GCBDO7TU.js");
4055
4059
  const mcpTools = createMcpTools(mcpManagerForTools);
4056
4060
  setMcpTools2(mcpTools);
4057
4061
  }
@@ -4935,4 +4939,4 @@ export {
4935
4939
  getToolRegistryForAgent,
4936
4940
  createToolRegistry
4937
4941
  };
4938
- //# sourceMappingURL=chunk-IDUXGSQV.js.map
4942
+ //# sourceMappingURL=chunk-JDWJ2PJJ.js.map
@@ -0,0 +1,31 @@
1
+ // src/server/providers/lmstudio.ts
2
+ function unwrap(raw) {
3
+ if (Array.isArray(raw)) return raw;
4
+ if (raw && typeof raw === "object") {
5
+ const record = raw;
6
+ if (Array.isArray(record.models)) return record.models;
7
+ if (Array.isArray(record.data)) return record.data;
8
+ }
9
+ return [];
10
+ }
11
+ function parseLmStudioModels(raw) {
12
+ return unwrap(raw).map((model) => {
13
+ const id = model.key ?? model.id ?? "";
14
+ const loaded = model.loaded_instances?.[0]?.config?.context_length;
15
+ const contextWindow = loaded ?? model.max_context_length;
16
+ return {
17
+ id,
18
+ ...contextWindow ? { contextWindow } : {},
19
+ supportsVision: model.capabilities?.vision ?? false
20
+ };
21
+ }).filter((model) => model.id !== "");
22
+ }
23
+ function findLmStudioModel(raw, modelId) {
24
+ return parseLmStudioModels(raw).find((model) => model.id === modelId);
25
+ }
26
+
27
+ export {
28
+ parseLmStudioModels,
29
+ findLmStudioModel
30
+ };
31
+ //# sourceMappingURL=chunk-K2QKX4ZJ.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getModelProfile
3
- } from "./chunk-W7VIYHPQ.js";
3
+ } from "./chunk-GJL3QSMP.js";
4
4
  import {
5
5
  getBackendCapabilities
6
6
  } from "./chunk-AZHWLLPP.js";
@@ -13,7 +13,7 @@ import {
13
13
  getThinking,
14
14
  mapFinishReason,
15
15
  parseToolArguments
16
- } from "./chunk-TOKQ2UVG.js";
16
+ } from "./chunk-MIPQOHWS.js";
17
17
  import {
18
18
  LLMError,
19
19
  OpenAIHttpClient
@@ -169,15 +169,6 @@ function createLLMClient(config, initialBackend = "unknown") {
169
169
  ...buildExtraParams(resolvedEffort)
170
170
  });
171
171
  const { params: streamingParams } = createParams;
172
- const stream = httpClient.createChatCompletionStream(streamingParams, {
173
- signal: request.signal
174
- });
175
- let fullContent = "";
176
- let fullThinking = "";
177
- const toolCalls = /* @__PURE__ */ new Map();
178
- let finishReason = "stop";
179
- let usage = { promptTokens: 0, completionTokens: 0, totalTokens: 0 };
180
- let responseId = "";
181
172
  let lastChunkTime = Date.now();
182
173
  const idleTimeoutController = new AbortController();
183
174
  const idleTimer = setInterval(() => {
@@ -187,6 +178,16 @@ function createLLMClient(config, initialBackend = "unknown") {
187
178
  idleTimeoutController.abort();
188
179
  }
189
180
  }, 100);
181
+ const streamSignal = request.signal ? AbortSignal.any([request.signal, idleTimeoutController.signal]) : idleTimeoutController.signal;
182
+ const stream = httpClient.createChatCompletionStream(streamingParams, {
183
+ signal: streamSignal
184
+ });
185
+ let fullContent = "";
186
+ let fullThinking = "";
187
+ const toolCalls = /* @__PURE__ */ new Map();
188
+ let finishReason = "stop";
189
+ let usage = { promptTokens: 0, completionTokens: 0, totalTokens: 0 };
190
+ let responseId = "";
190
191
  const onAbort = () => clearInterval(idleTimer);
191
192
  request.signal?.addEventListener("abort", onAbort, { once: true });
192
193
  try {
@@ -203,9 +204,9 @@ function createLLMClient(config, initialBackend = "unknown") {
203
204
  responseId = chunk.id;
204
205
  if (chunk.usage) {
205
206
  usage = {
206
- promptTokens: chunk.usage.prompt_tokens,
207
- completionTokens: chunk.usage.completion_tokens,
208
- totalTokens: chunk.usage.total_tokens
207
+ promptTokens: chunk.usage.prompt_tokens ?? usage.promptTokens,
208
+ completionTokens: chunk.usage.completion_tokens ?? usage.completionTokens,
209
+ totalTokens: chunk.usage.total_tokens ?? usage.totalTokens
209
210
  };
210
211
  }
211
212
  const choice = chunk.choices[0];
@@ -259,6 +260,11 @@ function createLLMClient(config, initialBackend = "unknown") {
259
260
  }
260
261
  }
261
262
  }
263
+ } catch (error) {
264
+ if (idleTimeoutController.signal.aborted && !request.signal?.aborted) {
265
+ throw new Error(`LLM stream idle timeout: no chunks received for ${idleTimeout}ms`);
266
+ }
267
+ throw error;
262
268
  } finally {
263
269
  clearInterval(idleTimer);
264
270
  request.signal?.removeEventListener("abort", onAbort);
@@ -297,7 +303,7 @@ function createLLMClient(config, initialBackend = "unknown") {
297
303
  }
298
304
  };
299
305
  } catch (error) {
300
- logger.error("LLM stream error", { error });
306
+ logger.error("LLM stream error", { error: String(error) });
301
307
  yield {
302
308
  type: "error",
303
309
  error: error instanceof Error ? error.message : "Unknown LLM error"
@@ -310,4 +316,4 @@ function createLLMClient(config, initialBackend = "unknown") {
310
316
  export {
311
317
  createLLMClient
312
318
  };
313
- //# sourceMappingURL=chunk-MKWS7TQH.js.map
319
+ //# sourceMappingURL=chunk-KFQKBXLO.js.map
@@ -463,11 +463,12 @@ function parseToolArguments(raw, _meta) {
463
463
  }
464
464
  }
465
465
  function buildModelParams(params) {
466
+ const isOmitted = (key) => params.omitParams?.includes(key) ?? false;
466
467
  return {
467
- ...params.temperature !== void 0 && { temperature: params.temperature },
468
- ...params.topP !== void 0 && { topP: params.topP },
469
- ...params.topK !== void 0 && { topK: params.topK },
470
- ...params.maxTokens !== void 0 && { maxTokens: params.maxTokens }
468
+ ...!isOmitted("temperature") && params.temperature !== void 0 && { temperature: params.temperature },
469
+ ...!isOmitted("top_p") && params.topP !== void 0 && { topP: params.topP },
470
+ ...!isOmitted("top_k") && params.topK !== void 0 && { topK: params.topK },
471
+ ...!isOmitted("max_tokens") && params.maxTokens !== void 0 && { maxTokens: params.maxTokens }
471
472
  };
472
473
  }
473
474
  async function buildAttachmentContent(msgContent, attachments, modelSupportsVision) {
@@ -644,7 +645,20 @@ async function buildChatCompletionCreateParams(model, request, profile, capabili
644
645
  };
645
646
  }
646
647
  }
647
- const modelParams = buildModelParams({ temperature, topP, topK, maxTokens });
648
+ const omitParams = request.modelSettings?.omitParams;
649
+ if (omitParams && omitParams.length > 0) {
650
+ const paramRecord = params;
651
+ for (const key of omitParams) {
652
+ delete paramRecord[key];
653
+ }
654
+ }
655
+ const modelParams = buildModelParams({
656
+ temperature,
657
+ topP,
658
+ topK,
659
+ maxTokens,
660
+ ...omitParams !== void 0 && { omitParams }
661
+ });
648
662
  return { params, modelParams };
649
663
  }
650
664
  async function buildCreateParamsFromInput(input, isStreaming) {
@@ -697,4 +711,4 @@ export {
697
711
  buildStreamingCreateParams,
698
712
  mapFinishReason
699
713
  };
700
- //# sourceMappingURL=chunk-TOKQ2UVG.js.map
714
+ //# sourceMappingURL=chunk-MIPQOHWS.js.map
@@ -2,28 +2,28 @@ import {
2
2
  generateSessionNameForSession,
3
3
  getSessionMessageCount,
4
4
  needsNameGeneration
5
- } from "./chunk-MTFLMNLN.js";
5
+ } from "./chunk-USNG72WA.js";
6
6
  import {
7
7
  launchWorkflowRun
8
- } from "./chunk-45OS4H3L.js";
8
+ } from "./chunk-JDBIR2J7.js";
9
9
  import {
10
10
  runChatTurn
11
- } from "./chunk-CX7UJZA5.js";
11
+ } from "./chunk-HWHWXLM5.js";
12
12
  import {
13
13
  devServerManager
14
- } from "./chunk-IDUXGSQV.js";
14
+ } from "./chunk-JDWJ2PJJ.js";
15
15
  import {
16
16
  applyDynamicContext,
17
17
  computeSessionHash,
18
18
  computeUnifiedDiff
19
- } from "./chunk-5E5G3DLI.js";
19
+ } from "./chunk-IW46BUOP.js";
20
20
  import {
21
21
  appendCompactionPrompt
22
- } from "./chunk-CIYA6BNB.js";
22
+ } from "./chunk-A5JAVQKG.js";
23
23
  import {
24
24
  hasRecentLLMFailure,
25
25
  interruptLLMRetryWait
26
- } from "./chunk-NP2SV2CX.js";
26
+ } from "./chunk-IQFPRQWM.js";
27
27
  import {
28
28
  onProcessEvent
29
29
  } from "./chunk-ZTOG6LJD.js";
@@ -493,13 +493,13 @@ function hashContent(content) {
493
493
  function moduleGitDiff(cwd) {
494
494
  return new Promise((resolve) => {
495
495
  const env = gitSpawnEnv();
496
- const diffProc = spawn2("git", ["diff", "--name-status", "HEAD"], {
496
+ const diffProc = spawn2("git", ["diff", "--ignore-submodules=none", "--name-status", "HEAD"], {
497
497
  cwd,
498
498
  env,
499
499
  stdio: ["ignore", "pipe", "pipe"],
500
500
  windowsHide: true
501
501
  });
502
- const statusProc = spawn2("git", ["status", "--porcelain"], {
502
+ const statusProc = spawn2("git", ["status", "--porcelain", "--ignore-submodules=none"], {
503
503
  cwd,
504
504
  env,
505
505
  stdio: ["ignore", "pipe", "pipe"],
@@ -1281,7 +1281,7 @@ async function handleClientMessage(ws, client, message, _getLLMClient, _getActiv
1281
1281
  }
1282
1282
  const session = sessionManager.requireSession(sessionId);
1283
1283
  try {
1284
- const { buildCachedPrompt } = await import("./dynamic-context-4SKLIPJ4.js");
1284
+ const { buildCachedPrompt } = await import("./dynamic-context-C6HGUQTR.js");
1285
1285
  const allAgents = await import("./registry-5QL3BOWN.js");
1286
1286
  const agentDef = allAgents.findAgentById(session.mode, await allAgents.loadAllAgentsDefault()) ?? allAgents.findAgentById("planner", await allAgents.loadAllAgentsDefault());
1287
1287
  const modelName = session.providerModel ?? _providerManager?.getCurrentModel();
@@ -1606,4 +1606,4 @@ export {
1606
1606
  signalMcpReady,
1607
1607
  createWebSocketServer
1608
1608
  };
1609
- //# sourceMappingURL=chunk-Y6WWEQPC.js.map
1609
+ //# sourceMappingURL=chunk-PI4X3Y6H.js.map
@@ -0,0 +1,7 @@
1
+ // src/constants.ts
2
+ var VERSION = "2.0.120";
3
+
4
+ export {
5
+ VERSION
6
+ };
7
+ //# sourceMappingURL=chunk-PXEWE5YP.js.map
@@ -156,7 +156,7 @@ async function generateSessionNameForSession(sessionId, userMessage, deps, signa
156
156
  client = deps.getLLMClient();
157
157
  client.setModel(providerConfig.model);
158
158
  } else if (providerConfig) {
159
- const { createLLMClient } = await import("./client-KCNTDTIR.js");
159
+ const { createLLMClient } = await import("./client-GXRHODRQ.js");
160
160
  client = createLLMClient({
161
161
  llm: {
162
162
  baseUrl: providerConfig.baseUrl,
@@ -207,4 +207,4 @@ export {
207
207
  needsNameGeneration,
208
208
  generateSessionNameForSession
209
209
  };
210
- //# sourceMappingURL=chunk-MTFLMNLN.js.map
210
+ //# sourceMappingURL=chunk-USNG72WA.js.map
@@ -1,9 +1,12 @@
1
+ import {
2
+ parseLmStudioModels
3
+ } from "./chunk-K2QKX4ZJ.js";
1
4
  import {
2
5
  createLLMClient
3
- } from "./chunk-MKWS7TQH.js";
6
+ } from "./chunk-KFQKBXLO.js";
4
7
  import {
5
8
  getModelProfile
6
- } from "./chunk-W7VIYHPQ.js";
9
+ } from "./chunk-GJL3QSMP.js";
7
10
  import {
8
11
  getBackendCapabilities
9
12
  } from "./chunk-AZHWLLPP.js";
@@ -14,7 +17,7 @@ import {
14
17
  } from "./chunk-HNCM3D7Y.js";
15
18
  import {
16
19
  resolveAttachmentsInMessages
17
- } from "./chunk-TOKQ2UVG.js";
20
+ } from "./chunk-MIPQOHWS.js";
18
21
  import {
19
22
  logger
20
23
  } from "./chunk-K44MW7JJ.js";
@@ -328,29 +331,18 @@ async function fetchLmStudioModelsWithContext(baseUrl, _apiKey) {
328
331
  logger.info("LM Studio native endpoint returned error", { url: nativeUrl, status: response.status });
329
332
  return [];
330
333
  }
331
- const raw = await response.json();
332
- const rawArray = Array.isArray(raw) ? raw : Array.isArray(raw.models) ? raw.models : Array.isArray(raw.data) ? raw.data : [];
333
- const modelList = rawArray;
334
+ const modelList = parseLmStudioModels(await response.json());
334
335
  if (modelList.length === 0) {
335
336
  logger.info("LM Studio native endpoint returned no models", { url: nativeUrl });
336
337
  return [];
337
338
  }
338
339
  logger.info("LM Studio native models found", { count: modelList.length });
339
340
  return modelList.map((model) => {
340
- const modelId = model.key ?? model.id ?? "";
341
- const loadedContext = model.loaded_instances?.[0]?.config?.context_length;
342
- const maxContext = model.max_context_length;
343
- const contextWindow = loadedContext ?? maxContext ?? 2e5;
344
- logger.info("LM Studio model detected", {
345
- modelId,
346
- loadedContext,
347
- maxContext,
348
- contextWindow
349
- });
341
+ logger.info("LM Studio model detected", { modelId: model.id, contextWindow: model.contextWindow });
350
342
  return {
351
- id: modelId,
352
- contextWindow,
353
- source: loadedContext || maxContext ? "backend" : "default"
343
+ id: model.id,
344
+ contextWindow: model.contextWindow ?? 2e5,
345
+ source: model.contextWindow ? "backend" : "default"
354
346
  };
355
347
  });
356
348
  } catch (error) {
@@ -703,7 +695,8 @@ function createProviderManager(config, options = {}) {
703
695
  ...settings.thinkingExtraKwargs !== void 0 ? { thinkingExtraKwargs: settings.thinkingExtraKwargs } : existingModel?.thinkingExtraKwargs !== void 0 ? { thinkingExtraKwargs: existingModel.thinkingExtraKwargs } : {},
704
696
  ...settings.nonThinkingExtraKwargs !== void 0 ? { nonThinkingExtraKwargs: settings.nonThinkingExtraKwargs } : existingModel?.nonThinkingExtraKwargs !== void 0 ? { nonThinkingExtraKwargs: existingModel.nonThinkingExtraKwargs } : {},
705
697
  ...settings.thinkingQueryParams !== void 0 ? { thinkingQueryParams: settings.thinkingQueryParams } : existingModel?.thinkingQueryParams !== void 0 ? { thinkingQueryParams: existingModel.thinkingQueryParams } : {},
706
- ...settings.nonThinkingQueryParams !== void 0 ? { nonThinkingQueryParams: settings.nonThinkingQueryParams } : existingModel?.nonThinkingQueryParams !== void 0 ? { nonThinkingQueryParams: existingModel.nonThinkingQueryParams } : {}
698
+ ...settings.nonThinkingQueryParams !== void 0 ? { nonThinkingQueryParams: settings.nonThinkingQueryParams } : existingModel?.nonThinkingQueryParams !== void 0 ? { nonThinkingQueryParams: existingModel.nonThinkingQueryParams } : {},
699
+ ...settings.omitParams !== void 0 ? { omitParams: settings.omitParams } : existingModel?.omitParams !== void 0 ? { omitParams: existingModel.omitParams } : {}
707
700
  });
708
701
  if (existingModel) {
709
702
  providers = providers.map(
@@ -725,6 +718,7 @@ function createProviderManager(config, options = {}) {
725
718
  if (model["topK"] !== void 0) baseSettings["topK"] = model["topK"];
726
719
  if (model["maxTokens"] !== void 0) baseSettings["maxTokens"] = model["maxTokens"];
727
720
  if (model["supportsVision"] !== void 0) baseSettings["supportsVision"] = model["supportsVision"];
721
+ if (model["omitParams"] !== void 0) baseSettings["omitParams"] = model["omitParams"];
728
722
  const rawQueryParams = mode === "thinking" ? model.thinkingQueryParams : model.nonThinkingQueryParams;
729
723
  if (rawQueryParams) {
730
724
  return { ...baseSettings, queryParams: JSON.parse(rawQueryParams) };
@@ -740,6 +734,7 @@ function createProviderManager(config, options = {}) {
740
734
  if (fallbackRawQP) {
741
735
  return { ...baseSettings, queryParams: JSON.parse(fallbackRawQP) };
742
736
  }
737
+ if (model["omitParams"] !== void 0) return baseSettings;
743
738
  return void 0;
744
739
  },
745
740
  async refreshProviderModels(providerId) {
@@ -762,8 +757,8 @@ function createProviderManager(config, options = {}) {
762
757
  backendModelsCount: modelsWithContext.length
763
758
  });
764
759
  if (modelsWithContext.length === 0) {
765
- providerStatus.set(providerId, "disconnected");
766
760
  if (userModels.length > 0) {
761
+ providerStatus.set(providerId, "unknown");
767
762
  logger.debug("Backend unavailable, preserving user models", {
768
763
  providerId,
769
764
  userModels: userModels.map((m) => ({ id: m.id, contextWindow: m.contextWindow }))
@@ -771,6 +766,7 @@ function createProviderManager(config, options = {}) {
771
766
  providers = providers.map((p) => p.id === providerId ? { ...p, models: userModels } : p);
772
767
  return { success: true };
773
768
  }
769
+ providerStatus.set(providerId, "disconnected");
774
770
  return { success: false, error: "No models returned from backend" };
775
771
  }
776
772
  providerStatus.set(providerId, "connected");
@@ -803,4 +799,4 @@ export {
803
799
  parseDefaultModelSelection,
804
800
  createProviderManager
805
801
  };
806
- //# sourceMappingURL=chunk-GZTMCTUS.js.map
802
+ //# sourceMappingURL=chunk-WN76RDRU.js.map
package/dist/cli/dev.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runCli
4
- } from "../chunk-5ZR5O5GC.js";
4
+ } from "../chunk-CYXAMXN5.js";
5
5
  import "../chunk-AGXJ5O63.js";
6
6
  import {
7
7
  logger
package/dist/cli/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runCli
4
- } from "../chunk-5ZR5O5GC.js";
4
+ } from "../chunk-CYXAMXN5.js";
5
5
  import "../chunk-AGXJ5O63.js";
6
6
  import {
7
7
  logger
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  createLLMClient
3
- } from "./chunk-MKWS7TQH.js";
4
- import "./chunk-W7VIYHPQ.js";
3
+ } from "./chunk-KFQKBXLO.js";
4
+ import "./chunk-GJL3QSMP.js";
5
5
  import "./chunk-AZHWLLPP.js";
6
6
  import "./chunk-HNCM3D7Y.js";
7
- import "./chunk-TOKQ2UVG.js";
7
+ import "./chunk-MIPQOHWS.js";
8
8
  import "./chunk-LTYL6ZGH.js";
9
9
  import "./chunk-HD6Y77RO.js";
10
10
  import "./chunk-5PT4UMRR.js";
@@ -13,4 +13,4 @@ import "./chunk-YLJ4XMA6.js";
13
13
  export {
14
14
  createLLMClient
15
15
  };
16
- //# sourceMappingURL=client-KCNTDTIR.js.map
16
+ //# sourceMappingURL=client-GXRHODRQ.js.map
@@ -8,7 +8,7 @@ import {
8
8
  mapFinishReason,
9
9
  parseToolArguments,
10
10
  resolveAttachmentsInMessages
11
- } from "./chunk-TOKQ2UVG.js";
11
+ } from "./chunk-MIPQOHWS.js";
12
12
  import "./chunk-YLJ4XMA6.js";
13
13
  export {
14
14
  buildModelParams,
@@ -21,4 +21,4 @@ export {
21
21
  parseToolArguments,
22
22
  resolveAttachmentsInMessages
23
23
  };
24
- //# sourceMappingURL=client-pure-B5DHEKQJ.js.map
24
+ //# sourceMappingURL=client-pure-QSY7TJGK.js.map
@@ -3,8 +3,8 @@ import {
3
3
  COMPACTION_MAX_RATIO,
4
4
  appendCompactionPrompt,
5
5
  shouldCompact
6
- } from "./chunk-CIYA6BNB.js";
7
- import "./chunk-NP2SV2CX.js";
6
+ } from "./chunk-A5JAVQKG.js";
7
+ import "./chunk-IQFPRQWM.js";
8
8
  import "./chunk-27NABDXB.js";
9
9
  import "./chunk-JOCR4CF4.js";
10
10
  import "./chunk-KLQEL2DZ.js";
@@ -15,9 +15,9 @@ import "./chunk-LNNBLB6G.js";
15
15
  import "./chunk-OSXPQSLW.js";
16
16
  import "./chunk-3PG65AXG.js";
17
17
  import "./chunk-J2GP3J3X.js";
18
- import "./chunk-W7VIYHPQ.js";
18
+ import "./chunk-GJL3QSMP.js";
19
19
  import "./chunk-AZHWLLPP.js";
20
- import "./chunk-TOKQ2UVG.js";
20
+ import "./chunk-MIPQOHWS.js";
21
21
  import "./chunk-HD6Y77RO.js";
22
22
  import "./chunk-5PT4UMRR.js";
23
23
  import "./chunk-K44MW7JJ.js";
@@ -29,4 +29,4 @@ export {
29
29
  appendCompactionPrompt,
30
30
  shouldCompact
31
31
  };
32
- //# sourceMappingURL=compactor-5ATICQ2A.js.map
32
+ //# sourceMappingURL=compactor-TI352G7B.js.map
@@ -5,7 +5,7 @@ import {
5
5
  computeSessionHash,
6
6
  computeUnifiedDiff,
7
7
  getToolFingerprint
8
- } from "./chunk-5E5G3DLI.js";
8
+ } from "./chunk-IW46BUOP.js";
9
9
  import "./chunk-2FCLCUVR.js";
10
10
  import "./chunk-27NABDXB.js";
11
11
  import "./chunk-AESOGRFK.js";
@@ -25,4 +25,4 @@ export {
25
25
  computeUnifiedDiff,
26
26
  getToolFingerprint
27
27
  };
28
- //# sourceMappingURL=dynamic-context-4SKLIPJ4.js.map
28
+ //# sourceMappingURL=dynamic-context-C6HGUQTR.js.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  abortRunnerRun,
3
3
  launchWorkflowRun
4
- } from "./chunk-45OS4H3L.js";
5
- import "./chunk-CX7UJZA5.js";
6
- import "./chunk-IDUXGSQV.js";
7
- import "./chunk-5E5G3DLI.js";
4
+ } from "./chunk-JDBIR2J7.js";
5
+ import "./chunk-HWHWXLM5.js";
6
+ import "./chunk-JDWJ2PJJ.js";
7
+ import "./chunk-IW46BUOP.js";
8
8
  import "./chunk-2FCLCUVR.js";
9
- import "./chunk-NP2SV2CX.js";
9
+ import "./chunk-IQFPRQWM.js";
10
10
  import "./chunk-27NABDXB.js";
11
11
  import "./chunk-M6X6AIEG.js";
12
12
  import "./chunk-ZTOG6LJD.js";
@@ -15,7 +15,7 @@ import "./chunk-JE7LW7Y6.js";
15
15
  import "./chunk-OAN4BXEW.js";
16
16
  import "./chunk-O6DU226D.js";
17
17
  import "./chunk-J7GAZGZT.js";
18
- import "./chunk-HZSKKJHQ.js";
18
+ import "./chunk-AS7KAH66.js";
19
19
  import "./chunk-EQ5CGNOT.js";
20
20
  import "./chunk-XZGQZ42D.js";
21
21
  import "./chunk-JOCR4CF4.js";
@@ -29,13 +29,14 @@ import "./chunk-LCLH6ZUL.js";
29
29
  import "./chunk-LNNBLB6G.js";
30
30
  import "./chunk-OSXPQSLW.js";
31
31
  import "./chunk-3PG65AXG.js";
32
- import "./chunk-GZTMCTUS.js";
32
+ import "./chunk-WN76RDRU.js";
33
+ import "./chunk-K2QKX4ZJ.js";
33
34
  import "./chunk-J2GP3J3X.js";
34
- import "./chunk-MKWS7TQH.js";
35
- import "./chunk-W7VIYHPQ.js";
35
+ import "./chunk-KFQKBXLO.js";
36
+ import "./chunk-GJL3QSMP.js";
36
37
  import "./chunk-AZHWLLPP.js";
37
38
  import "./chunk-HNCM3D7Y.js";
38
- import "./chunk-TOKQ2UVG.js";
39
+ import "./chunk-MIPQOHWS.js";
39
40
  import "./chunk-LTYL6ZGH.js";
40
41
  import "./chunk-HD6Y77RO.js";
41
42
  import "./chunk-5PT4UMRR.js";
@@ -49,4 +50,4 @@ export {
49
50
  abortRunnerRun,
50
51
  launchWorkflowRun
51
52
  };
52
- //# sourceMappingURL=launch-Q6GUJ22H.js.map
53
+ //# sourceMappingURL=launch-SRSMTDEM.js.map