openfox 1.6.19 → 1.6.21

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 (36) hide show
  1. package/dist/{auto-compaction-A657A2UQ.js → auto-compaction-U75EINMB.js} +4 -4
  2. package/dist/{chat-handler-2NXHPPMS.js → chat-handler-JEMPI5UF.js} +6 -6
  3. package/dist/{chunk-IN5EP4ZB.js → chunk-6NPMZFMP.js} +2 -2
  4. package/dist/{chunk-KCJC3VBS.js → chunk-AU33PQAB.js} +2 -2
  5. package/dist/{chunk-QY7BMXWT.js → chunk-B7E3BICY.js} +6 -2
  6. package/dist/{chunk-OVLFEBRR.js → chunk-FX4SUY2S.js} +27 -373
  7. package/dist/{chunk-N2V2K5QV.js → chunk-HWOYZ245.js} +6 -6
  8. package/dist/{chunk-6TWWJIFP.js → chunk-HZP2V5Z6.js} +63 -15
  9. package/dist/{chunk-7IOZFJBW.js → chunk-RN2O6JK7.js} +15 -2
  10. package/dist/{chunk-AE7FYMCR.js → chunk-SJVEX2NR.js} +45 -27
  11. package/dist/{chunk-KOUMYBYM.js → chunk-WINI5HX7.js} +54 -3
  12. package/dist/{chunk-ZDNXCVW4.js → chunk-XRGMFOVG.js} +11 -5
  13. package/dist/chunk-XYD5JXRM.js +483 -0
  14. package/dist/cli/dev.js +1 -1
  15. package/dist/cli/index.js +1 -1
  16. package/dist/{config-67AX6CNS.js → config-SWDAJMQ3.js} +5 -5
  17. package/dist/{orchestrator-VWMGHSCG.js → orchestrator-T2IPRZ7B.js} +5 -5
  18. package/dist/package.json +1 -1
  19. package/dist/{processor-7TH3ATDK.js → processor-VKFEOK46.js} +2 -2
  20. package/dist/{protocol-I7rn7Msg.d.ts → protocol-BYM6rZvW.d.ts} +12 -0
  21. package/dist/{provider-DKGBQHUS.js → provider-CDM4LQAC.js} +9 -8
  22. package/dist/{serve-CJKXYYIA.js → serve-X3PKC27B.js} +11 -11
  23. package/dist/server/index.d.ts +24 -1
  24. package/dist/server/index.js +9 -9
  25. package/dist/{settings-NCLN4JDZ.js → settings-3K6P2JN6.js} +4 -2
  26. package/dist/shared/index.d.ts +2 -2
  27. package/dist/shared/index.js +1 -1
  28. package/dist/{tools-F7RWE4YI.js → tools-4ODVFMW7.js} +4 -4
  29. package/dist/{vision-fallback-ADYRFFD4.js → vision-fallback-VXGCQKLA.js} +2 -2
  30. package/dist/web/assets/{index-CcnXf371.css → index-B9-lT3Kc.css} +1 -1
  31. package/dist/web/assets/index-DHP3d5Cl.js +151 -0
  32. package/dist/web/index.html +2 -2
  33. package/dist/web/sw.js +1 -1
  34. package/package.json +1 -1
  35. package/dist/chunk-55N6FAAZ.js +0 -117
  36. package/dist/web/assets/index-CLd1Kqv-.js +0 -151
@@ -12,8 +12,10 @@ import {
12
12
  getSessionProcessCount
13
13
  } from "./chunk-574HZVLE.js";
14
14
  import {
15
+ getBackendCapabilities,
16
+ getModelProfile,
15
17
  streamWithSegments
16
- } from "./chunk-55N6FAAZ.js";
18
+ } from "./chunk-XYD5JXRM.js";
17
19
  import {
18
20
  getContextMessages,
19
21
  getCurrentContextWindowId,
@@ -37,7 +39,7 @@ import {
37
39
  deleteSetting,
38
40
  getSetting,
39
41
  setSetting
40
- } from "./chunk-7IOZFJBW.js";
42
+ } from "./chunk-RN2O6JK7.js";
41
43
  import {
42
44
  getProject
43
45
  } from "./chunk-XKFPU2FA.js";
@@ -515,7 +517,7 @@ function computeAggregatedStats(input) {
515
517
  }
516
518
 
517
519
  // src/server/chat/stream-pure.ts
518
- function createEmptyStreamResult(aborted, xmlFormatError) {
520
+ function createEmptyStreamResult(aborted, xmlFormatError, modelParams) {
519
521
  return {
520
522
  content: "",
521
523
  toolCalls: [],
@@ -523,12 +525,43 @@ function createEmptyStreamResult(aborted, xmlFormatError) {
523
525
  usage: { promptTokens: 0, completionTokens: 0 },
524
526
  timing: { ttft: 0, completionTime: 0, tps: 0, prefillTps: 0 },
525
527
  aborted,
526
- xmlFormatError
528
+ xmlFormatError,
529
+ modelParams
527
530
  };
528
531
  }
529
532
  async function* streamLLMPure(options) {
530
533
  const { messageId, systemPrompt, llmClient, messages, tools, toolChoice, signal, disableThinking, onVisionFallbackStart, onVisionFallbackDone } = options;
531
534
  const llmMessages = [{ role: "system", content: systemPrompt }, ...messages];
535
+ const profile = getModelProfile(llmClient.getModel());
536
+ const backend = getBackendCapabilities(llmClient.getBackend());
537
+ const userTemp = options.modelSettings?.temperature;
538
+ const userTopP = options.modelSettings?.topP;
539
+ const userTopK = options.modelSettings?.topK;
540
+ const userMaxTokens = options.modelSettings?.maxTokens;
541
+ const temperature = userTemp ?? profile.temperature;
542
+ const maxTokens = userMaxTokens ?? profile.defaultMaxTokens;
543
+ const topP = userTopP ?? profile.topP;
544
+ const topK = userTopK ?? (backend.supportsTopK ? profile.topK : void 0);
545
+ const modelParams = {
546
+ ...temperature !== void 0 && { temperature },
547
+ ...topP !== void 0 && { topP },
548
+ ...topK !== void 0 && { topK },
549
+ ...maxTokens !== void 0 && { maxTokens }
550
+ };
551
+ logger.debug("LLM request settings", {
552
+ model: llmClient.getModel(),
553
+ profile: profile.name,
554
+ temperature,
555
+ maxTokens,
556
+ topP,
557
+ topK,
558
+ userConfigured: {
559
+ temperature: userTemp !== void 0 ? `user:${userTemp}` : "default",
560
+ topP: userTopP !== void 0 ? `user:${userTopP}` : "default",
561
+ topK: userTopK !== void 0 ? `user:${userTopK}` : "default",
562
+ maxTokens: userMaxTokens !== void 0 ? `user:${userMaxTokens}` : "default"
563
+ }
564
+ });
532
565
  const stream = buildStreamRequest(llmClient, {
533
566
  messages: llmMessages,
534
567
  tools,
@@ -636,7 +669,7 @@ async function* streamLLMPure(options) {
636
669
  }
637
670
  }
638
671
  if (!result) {
639
- return createEmptyStreamResult(aborted, xmlFormatError);
672
+ return createEmptyStreamResult(aborted, xmlFormatError, modelParams);
640
673
  }
641
674
  const baseResult = {
642
675
  content: result.content,
@@ -648,7 +681,8 @@ async function* streamLLMPure(options) {
648
681
  },
649
682
  timing: result.timing,
650
683
  aborted,
651
- xmlFormatError
684
+ xmlFormatError,
685
+ modelParams
652
686
  };
653
687
  if (result.thinkingContent) {
654
688
  baseResult.thinkingContent = result.thinkingContent;
@@ -666,16 +700,20 @@ var TurnMetrics = class {
666
700
  totalToolTime = 0;
667
701
  // seconds
668
702
  llmCalls = [];
703
+ modelParams = {};
669
704
  constructor() {
670
705
  this.startTime = performance.now();
671
706
  }
672
707
  /** Add metrics from an LLM call */
673
- addLLMCall(timing, promptTokens, completionTokens) {
708
+ addLLMCall(timing, promptTokens, completionTokens, modelParams) {
674
709
  const callIndex = this.llmCalls.length + 1;
675
710
  this.totalPrefillTokens += promptTokens;
676
711
  this.totalPrefillTime += timing.ttft;
677
712
  this.totalGenTokens += completionTokens;
678
713
  this.totalGenTime += timing.completionTime;
714
+ if (modelParams) {
715
+ this.modelParams = modelParams;
716
+ }
679
717
  this.llmCalls = [
680
718
  ...this.llmCalls,
681
719
  {
@@ -687,10 +725,18 @@ var TurnMetrics = class {
687
725
  prefillSpeed: timing.ttft > 0 ? Math.round(promptTokens / timing.ttft * 10) / 10 : 0,
688
726
  generationSpeed: timing.completionTime > 0 ? Math.round(completionTokens / timing.completionTime * 10) / 10 : 0,
689
727
  totalTime: Math.round((timing.ttft + timing.completionTime) * 10) / 10,
690
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
728
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
729
+ ...this.modelParams.temperature !== void 0 && { temperature: this.modelParams.temperature },
730
+ ...this.modelParams.topP !== void 0 && { topP: this.modelParams.topP },
731
+ ...this.modelParams.topK !== void 0 && { topK: this.modelParams.topK },
732
+ ...this.modelParams.maxTokens !== void 0 && { maxTokens: this.modelParams.maxTokens }
691
733
  }
692
734
  ];
693
735
  }
736
+ /** Set model parameters for tracking */
737
+ setModelParams(params) {
738
+ this.modelParams = params;
739
+ }
694
740
  /** Add tool execution time (in milliseconds) */
695
741
  addToolTime(durationMs) {
696
742
  this.totalToolTime += durationMs / 1e3;
@@ -802,7 +848,7 @@ async function consumeStreamWithToolLoop(options) {
802
848
  let iterations = 0;
803
849
  for (; ; ) {
804
850
  if (signal?.aborted) {
805
- return createEmptyStreamResult(true, false);
851
+ return createEmptyStreamResult(true, false, {});
806
852
  }
807
853
  if (++iterations > MAX_TOOL_LOOP_ITERATIONS) {
808
854
  throw new Error("Max tool loop iterations exceeded during compaction");
@@ -826,7 +872,7 @@ async function consumeStreamWithToolLoop(options) {
826
872
  currentMessages = [...currentMessages, correctionMsg];
827
873
  continue;
828
874
  }
829
- turnMetrics.addLLMCall(result.timing, result.usage.promptTokens, result.usage.completionTokens);
875
+ turnMetrics.addLLMCall(result.timing, result.usage.promptTokens, result.usage.completionTokens, result.modelParams);
830
876
  if (result.toolCalls.length > 0) {
831
877
  const stats = turnMetrics.buildStats(statsIdentity, "compaction");
832
878
  onEvent(createMessageDoneEvent(messageId, {
@@ -2850,6 +2896,7 @@ async function runTopLevelAgentLoop(config, turnMetrics) {
2850
2896
  });
2851
2897
  doOnMessage(createChatVisionFallbackMessage({ type: "done", messageId: assistantMsgId, attachmentId, description }));
2852
2898
  };
2899
+ const modelSettings = sessionManager.getCurrentModelSettings();
2853
2900
  const streamGen = streamLLMPure({
2854
2901
  messageId: assistantMsgId,
2855
2902
  systemPrompt: assembledRequest.systemPrompt,
@@ -2859,7 +2906,8 @@ async function runTopLevelAgentLoop(config, turnMetrics) {
2859
2906
  toolChoice: "auto",
2860
2907
  signal,
2861
2908
  onVisionFallbackStart,
2862
- onVisionFallbackDone
2909
+ onVisionFallbackDone,
2910
+ ...modelSettings && { modelSettings }
2863
2911
  });
2864
2912
  const result = await consumeStreamGenerator(streamGen, (event) => {
2865
2913
  eventStore.append(sessionId, event);
@@ -2881,7 +2929,7 @@ async function runTopLevelAgentLoop(config, turnMetrics) {
2881
2929
  emitPartialDoneEvents(sessionId, assistantMsgId, statsIdentity, mode, turnMetrics, assembledRequest.promptContext, eventStore);
2882
2930
  throw new Error("Aborted");
2883
2931
  }
2884
- turnMetrics.addLLMCall(result.timing, result.usage.promptTokens, result.usage.completionTokens);
2932
+ turnMetrics.addLLMCall(result.timing, result.usage.promptTokens, result.usage.completionTokens, result.modelParams);
2885
2933
  sessionManager.setCurrentContextSize(sessionId, result.usage.promptTokens);
2886
2934
  if (result.toolCalls.length > 0) {
2887
2935
  eventStore.append(sessionId, createMessageDoneEvent(assistantMsgId, {
@@ -3135,7 +3183,7 @@ async function executeSubAgent(options) {
3135
3183
  eventStore.append(sessionId, createChatDoneEvent(assistantMsgId, "stopped", stats));
3136
3184
  throw new Error("Aborted");
3137
3185
  }
3138
- turnMetrics.addLLMCall(result.timing, result.usage.promptTokens, result.usage.completionTokens);
3186
+ turnMetrics.addLLMCall(result.timing, result.usage.promptTokens, result.usage.completionTokens, result.modelParams);
3139
3187
  sessionManager.setCurrentContextSize(sessionId, result.usage.promptTokens, subAgentId);
3140
3188
  finalContent = result.content;
3141
3189
  customMessages.push({
@@ -3303,7 +3351,7 @@ var callSubAgentTool = {
3303
3351
  };
3304
3352
  }
3305
3353
  try {
3306
- const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-F7RWE4YI.js");
3354
+ const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-4ODVFMW7.js");
3307
3355
  const toolRegistry = getToolRegistryForAgent2(agentDef);
3308
3356
  const turnMetrics = new TurnMetrics();
3309
3357
  const result = await executeSubAgent({
@@ -4432,4 +4480,4 @@ export {
4432
4480
  getToolRegistryForAgent,
4433
4481
  createToolRegistry
4434
4482
  };
4435
- //# sourceMappingURL=chunk-6TWWJIFP.js.map
4483
+ //# sourceMappingURL=chunk-HZP2V5Z6.js.map
@@ -4,7 +4,19 @@ import {
4
4
 
5
5
  // src/server/db/settings.ts
6
6
  var SETTINGS_KEYS = {
7
- GLOBAL_INSTRUCTIONS: "global_instructions"
7
+ GLOBAL_INSTRUCTIONS: "global_instructions",
8
+ DISPLAY_SHOW_THINKING: "display.showThinking",
9
+ DISPLAY_SHOW_VERBOSE_TOOL_OUTPUT: "display.showVerboseToolOutput",
10
+ DISPLAY_SHOW_STATS: "display.showStats",
11
+ DISPLAY_SHOW_AGENT_DEFINITIONS: "display.showAgentDefinitions",
12
+ DISPLAY_SHOW_WORKFLOW_BARS: "display.showWorkflowBars"
13
+ };
14
+ var SETTINGS_DEFAULTS = {
15
+ [SETTINGS_KEYS.DISPLAY_SHOW_THINKING]: "true",
16
+ [SETTINGS_KEYS.DISPLAY_SHOW_VERBOSE_TOOL_OUTPUT]: "true",
17
+ [SETTINGS_KEYS.DISPLAY_SHOW_STATS]: "true",
18
+ [SETTINGS_KEYS.DISPLAY_SHOW_AGENT_DEFINITIONS]: "true",
19
+ [SETTINGS_KEYS.DISPLAY_SHOW_WORKFLOW_BARS]: "true"
8
20
  };
9
21
  function getSetting(key) {
10
22
  const db = getDatabase();
@@ -38,9 +50,10 @@ function getAllSettings() {
38
50
 
39
51
  export {
40
52
  SETTINGS_KEYS,
53
+ SETTINGS_DEFAULTS,
41
54
  getSetting,
42
55
  setSetting,
43
56
  deleteSetting,
44
57
  getAllSettings
45
58
  };
46
- //# sourceMappingURL=chunk-7IOZFJBW.js.map
59
+ //# sourceMappingURL=chunk-RN2O6JK7.js.map
@@ -6,7 +6,7 @@ import {
6
6
  createVerifierNudgeConfig,
7
7
  runBuilderTurn,
8
8
  runChatTurn
9
- } from "./chunk-KCJC3VBS.js";
9
+ } from "./chunk-AU33PQAB.js";
10
10
  import {
11
11
  TurnMetrics,
12
12
  agentExists,
@@ -47,7 +47,7 @@ import {
47
47
  setSkillEnabled,
48
48
  skillExists,
49
49
  spawnShellProcess
50
- } from "./chunk-6TWWJIFP.js";
50
+ } from "./chunk-HZP2V5Z6.js";
51
51
  import {
52
52
  getPathSeparator,
53
53
  getPlatformShell,
@@ -57,16 +57,18 @@ import {
57
57
  import {
58
58
  createProviderManager,
59
59
  parseDefaultModelSelection
60
- } from "./chunk-KOUMYBYM.js";
60
+ } from "./chunk-WINI5HX7.js";
61
61
  import {
62
62
  SessionNotFoundError,
63
63
  createLLMClient,
64
- detectBackend,
65
64
  detectModel,
65
+ getLlmStatus
66
+ } from "./chunk-FX4SUY2S.js";
67
+ import {
68
+ detectBackend,
66
69
  getBackendDisplayName,
67
- getLlmStatus,
68
70
  getModelProfile
69
- } from "./chunk-OVLFEBRR.js";
71
+ } from "./chunk-XYD5JXRM.js";
70
72
  import {
71
73
  createSession,
72
74
  deleteSession,
@@ -127,7 +129,7 @@ import {
127
129
  } from "./chunk-3EHGGBWE.js";
128
130
  import {
129
131
  computeSessionStats
130
- } from "./chunk-QY7BMXWT.js";
132
+ } from "./chunk-B7E3BICY.js";
131
133
  import {
132
134
  createServerMessage
133
135
  } from "./chunk-Y6HBEACI.js";
@@ -4170,6 +4172,11 @@ var SessionManager = class {
4170
4172
  constructor(providerManager) {
4171
4173
  this.providerManager = providerManager;
4172
4174
  }
4175
+ getCurrentModelSettings() {
4176
+ const model = this.providerManager.getCurrentModel();
4177
+ if (!model) return void 0;
4178
+ return this.providerManager.getModelSettings(model);
4179
+ }
4173
4180
  // ============================================================================
4174
4181
  // Session Lifecycle
4175
4182
  // ============================================================================
@@ -5472,7 +5479,7 @@ function createTerminalRoutes() {
5472
5479
  }
5473
5480
 
5474
5481
  // src/constants.ts
5475
- var VERSION = "1.6.19";
5482
+ var VERSION = "1.6.21";
5476
5483
 
5477
5484
  // src/server/index.ts
5478
5485
  var __dirname2 = dirname5(fileURLToPath4(import.meta.url));
@@ -5709,7 +5716,7 @@ async function createServerHandle(config) {
5709
5716
  return res.status(400).json({ error: "providerId is required" });
5710
5717
  }
5711
5718
  sessionManager.setSessionProvider(sessionId, providerId, model ?? "auto");
5712
- const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-67AX6CNS.js");
5719
+ const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-SWDAJMQ3.js");
5713
5720
  const globalConfig = await loadGlobalConfig(config.mode ?? "production");
5714
5721
  const updatedConfig = setDefaultModelSelection(globalConfig, providerId, model ?? "auto");
5715
5722
  await saveGlobalConfig(config.mode ?? "production", updatedConfig);
@@ -5774,7 +5781,7 @@ async function createServerHandle(config) {
5774
5781
  if (!callId || approved === void 0) {
5775
5782
  return res.status(400).json({ error: "callId and approved are required" });
5776
5783
  }
5777
- const { providePathConfirmation: providePathConfirmation2 } = await import("./tools-F7RWE4YI.js");
5784
+ const { providePathConfirmation: providePathConfirmation2 } = await import("./tools-4ODVFMW7.js");
5778
5785
  const result = providePathConfirmation2(callId, approved, alwaysAllow);
5779
5786
  if (!result.found) {
5780
5787
  return res.status(404).json({ error: "No pending path confirmation with that ID" });
@@ -5799,7 +5806,7 @@ async function createServerHandle(config) {
5799
5806
  if (!callId || !answer) {
5800
5807
  return res.status(400).json({ error: "callId and answer are required" });
5801
5808
  }
5802
- const { provideAnswer: provideAnswer2 } = await import("./tools-F7RWE4YI.js");
5809
+ const { provideAnswer: provideAnswer2 } = await import("./tools-4ODVFMW7.js");
5803
5810
  const found = provideAnswer2(callId, answer);
5804
5811
  if (!found) {
5805
5812
  return res.status(404).json({ error: "No pending question with that ID" });
@@ -5835,8 +5842,8 @@ async function createServerHandle(config) {
5835
5842
  if (!session) {
5836
5843
  return res.status(404).json({ error: "Session not found" });
5837
5844
  }
5838
- const { stopSessionExecution } = await import("./chat-handler-2NXHPPMS.js");
5839
- const { cancelQuestionsForSession: cancelQuestionsForSession2, cancelPathConfirmationsForSession: cancelPathConfirmationsForSession2 } = await import("./tools-F7RWE4YI.js");
5845
+ const { stopSessionExecution } = await import("./chat-handler-JEMPI5UF.js");
5846
+ const { cancelQuestionsForSession: cancelQuestionsForSession2, cancelPathConfirmationsForSession: cancelPathConfirmationsForSession2 } = await import("./tools-4ODVFMW7.js");
5840
5847
  stopSessionExecution(sessionId, sessionManager);
5841
5848
  abortSession(sessionId);
5842
5849
  cancelQuestionsForSession2(sessionId, "Session stopped by user");
@@ -5873,13 +5880,13 @@ async function createServerHandle(config) {
5873
5880
  res.json({ accepted: true });
5874
5881
  });
5875
5882
  app.get("/api/settings/:key", async (req, res) => {
5876
- const { getSetting } = await import("./settings-NCLN4JDZ.js");
5883
+ const { getSetting, SETTINGS_DEFAULTS } = await import("./settings-3K6P2JN6.js");
5877
5884
  const key = req.params.key;
5878
- const value = getSetting(key);
5885
+ const value = getSetting(key) ?? SETTINGS_DEFAULTS[key] ?? null;
5879
5886
  res.json({ key, value });
5880
5887
  });
5881
5888
  app.put("/api/settings/:key", async (req, res) => {
5882
- const { setSetting } = await import("./settings-NCLN4JDZ.js");
5889
+ const { setSetting } = await import("./settings-3K6P2JN6.js");
5883
5890
  const key = req.params.key;
5884
5891
  const { value } = req.body;
5885
5892
  if (value === void 0) {
@@ -5894,7 +5901,7 @@ async function createServerHandle(config) {
5894
5901
  let visionFallback;
5895
5902
  let globalWorkdir;
5896
5903
  try {
5897
- const { loadGlobalConfig, getVisionFallback } = await import("./config-67AX6CNS.js");
5904
+ const { loadGlobalConfig, getVisionFallback } = await import("./config-SWDAJMQ3.js");
5898
5905
  const globalConfig = await loadGlobalConfig(config.mode ?? "production");
5899
5906
  const fallback = getVisionFallback(globalConfig);
5900
5907
  if (fallback) {
@@ -5973,7 +5980,7 @@ async function createServerHandle(config) {
5973
5980
  return res.status(400).json({ error: "name, url, and backend are required" });
5974
5981
  }
5975
5982
  try {
5976
- const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-67AX6CNS.js");
5983
+ const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-SWDAJMQ3.js");
5977
5984
  const globalConfig = await loadGlobalConfig(config.mode ?? "production");
5978
5985
  const providerBackend = backend;
5979
5986
  const configWithProvider = addProvider(globalConfig, {
@@ -6006,7 +6013,7 @@ async function createServerHandle(config) {
6006
6013
  app.post("/api/init/config", async (req, res) => {
6007
6014
  const { workdir, visionFallback } = req.body;
6008
6015
  try {
6009
- const { loadGlobalConfig, saveGlobalConfig } = await import("./config-67AX6CNS.js");
6016
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-SWDAJMQ3.js");
6010
6017
  const globalConfig = await loadGlobalConfig(config.mode ?? "production");
6011
6018
  const updatedConfig = {
6012
6019
  ...globalConfig,
@@ -6034,7 +6041,7 @@ async function createServerHandle(config) {
6034
6041
  });
6035
6042
  app.delete("/api/providers/:id", async (req, res) => {
6036
6043
  const { id } = req.params;
6037
- const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-67AX6CNS.js");
6044
+ const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-SWDAJMQ3.js");
6038
6045
  const globalConfig = await loadGlobalConfig(config.mode ?? "production");
6039
6046
  const updatedConfig = removeProvider(globalConfig, id);
6040
6047
  await saveGlobalConfig(config.mode ?? "production", updatedConfig);
@@ -6054,7 +6061,7 @@ async function createServerHandle(config) {
6054
6061
  return res.status(400).json({ error: result.error });
6055
6062
  }
6056
6063
  const llmClient = getLLMClient();
6057
- const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-67AX6CNS.js");
6064
+ const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-SWDAJMQ3.js");
6058
6065
  const globalConfig = await loadGlobalConfig(config.mode ?? "production");
6059
6066
  const updatedConfig = setDefaultModelSelection(globalConfig, id, llmClient.getModel());
6060
6067
  await saveGlobalConfig(config.mode ?? "production", updatedConfig);
@@ -6068,14 +6075,24 @@ async function createServerHandle(config) {
6068
6075
  app.post("/api/providers/:id/models/:modelId", async (req, res) => {
6069
6076
  const { id, modelId } = req.params;
6070
6077
  const body = req.body;
6071
- if (!body.contextWindow) {
6072
- return res.status(400).json({ error: "contextWindow is required" });
6078
+ logger.info("API: POST /api/providers/:id/models/:modelId", {
6079
+ providerId: id,
6080
+ modelId,
6081
+ body
6082
+ });
6083
+ const hasFullSettings = body.temperature !== void 0 || body.topP !== void 0 || body.topK !== void 0 || body.maxTokens !== void 0;
6084
+ let result;
6085
+ if (hasFullSettings) {
6086
+ result = await providerManager.updateModelSettings(id, modelId, body);
6087
+ } else if (body.contextWindow) {
6088
+ result = await providerManager.updateModelContext(id, modelId, body.contextWindow);
6089
+ } else {
6090
+ return res.status(400).json({ error: "contextWindow or full settings required" });
6073
6091
  }
6074
- const result = await providerManager.updateModelContext(id, modelId, body.contextWindow);
6075
6092
  if (!result.success) {
6076
6093
  return res.status(400).json({ error: result.error });
6077
6094
  }
6078
- const { loadGlobalConfig, saveGlobalConfig } = await import("./config-67AX6CNS.js");
6095
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-SWDAJMQ3.js");
6079
6096
  const globalConfig = await loadGlobalConfig(config.mode ?? "production");
6080
6097
  const updatedProviders = providerManager.getProviders();
6081
6098
  const updatedConfig = {
@@ -6101,6 +6118,7 @@ async function createServerHandle(config) {
6101
6118
  providerId: id,
6102
6119
  modelId,
6103
6120
  contextWindow: body.contextWindow,
6121
+ model: result.model,
6104
6122
  contextState
6105
6123
  });
6106
6124
  });
@@ -6284,7 +6302,7 @@ async function createServerHandle(config) {
6284
6302
  providerManager
6285
6303
  );
6286
6304
  const wss = wssExports.wss;
6287
- const { QueueProcessor } = await import("./processor-7TH3ATDK.js");
6305
+ const { QueueProcessor } = await import("./processor-VKFEOK46.js");
6288
6306
  const queueProcessor = new QueueProcessor({
6289
6307
  sessionManager,
6290
6308
  providerManager,
@@ -6357,4 +6375,4 @@ export {
6357
6375
  createServerHandle,
6358
6376
  createServer
6359
6377
  };
6360
- //# sourceMappingURL=chunk-AE7FYMCR.js.map
6378
+ //# sourceMappingURL=chunk-SJVEX2NR.js.map
@@ -1,10 +1,12 @@
1
1
  import {
2
2
  clearModelCache,
3
3
  createLLMClient,
4
- detectBackend,
5
4
  detectModel,
6
5
  setLlmStatus
7
- } from "./chunk-OVLFEBRR.js";
6
+ } from "./chunk-FX4SUY2S.js";
7
+ import {
8
+ detectBackend
9
+ } from "./chunk-XYD5JXRM.js";
8
10
  import {
9
11
  logger
10
12
  } from "./chunk-PNBH3RAX.js";
@@ -363,6 +365,55 @@ function createProviderManager(config) {
363
365
  logger.info("Model context updated", { providerId, modelId, contextWindow });
364
366
  return { success: true };
365
367
  },
368
+ async updateModelSettings(providerId, modelId, settings) {
369
+ const provider = providers.find((p) => p.id === providerId);
370
+ if (!provider) {
371
+ return { success: false, error: "Provider not found" };
372
+ }
373
+ const existingModel = provider.models.find((m) => m.id === modelId);
374
+ const finalTemp = settings.temperature !== void 0 && settings.temperature !== null ? settings.temperature : existingModel?.temperature;
375
+ const finalTopP = settings.topP !== void 0 && settings.topP !== null ? settings.topP : existingModel?.topP;
376
+ const finalTopK = settings.topK !== void 0 && settings.topK !== null ? settings.topK : existingModel?.topK;
377
+ const finalMaxTokens = settings.maxTokens !== void 0 && settings.maxTokens !== null ? settings.maxTokens : existingModel?.maxTokens;
378
+ logger.info("Updating model settings", {
379
+ providerId,
380
+ modelId,
381
+ existing: existingModel,
382
+ incoming: settings,
383
+ final: { temperature: finalTemp, topP: finalTopP, topK: finalTopK, maxTokens: finalMaxTokens }
384
+ });
385
+ const updatedModel = {
386
+ id: modelId,
387
+ contextWindow: settings.contextWindow ?? existingModel?.contextWindow ?? 2e5,
388
+ source: "user",
389
+ ...finalTemp !== void 0 && { temperature: finalTemp },
390
+ ...finalTopP !== void 0 && { topP: finalTopP },
391
+ ...finalTopK !== void 0 && { topK: finalTopK },
392
+ ...finalMaxTokens !== void 0 && { maxTokens: finalMaxTokens }
393
+ };
394
+ if (existingModel) {
395
+ providers = providers.map(
396
+ (p) => p.id === providerId ? { ...p, models: p.models.map((m) => m.id === modelId ? updatedModel : m) } : p
397
+ );
398
+ } else {
399
+ providers = providers.map(
400
+ (p) => p.id === providerId ? { ...p, models: [...p.models, updatedModel] } : p
401
+ );
402
+ }
403
+ logger.info("Model settings updated", { providerId, modelId, final: updatedModel });
404
+ return { success: true, model: updatedModel };
405
+ },
406
+ getModelSettings(modelId) {
407
+ const provider = providers.find((p) => p.models.some((m) => m.id === modelId));
408
+ const model = provider?.models.find((m) => m.id === modelId);
409
+ if (!model) return void 0;
410
+ return {
411
+ ...model.temperature !== void 0 && { temperature: model.temperature },
412
+ ...model.topP !== void 0 && { topP: model.topP },
413
+ ...model.topK !== void 0 && { topK: model.topK },
414
+ ...model.maxTokens !== void 0 && { maxTokens: model.maxTokens }
415
+ };
416
+ },
366
417
  async refreshProviderModels(providerId) {
367
418
  const provider = providers.find((p) => p.id === providerId);
368
419
  if (!provider) {
@@ -406,4 +457,4 @@ export {
406
457
  parseDefaultModelSelection,
407
458
  createProviderManager
408
459
  };
409
- //# sourceMappingURL=chunk-KOUMYBYM.js.map
460
+ //# sourceMappingURL=chunk-WINI5HX7.js.map
@@ -1,7 +1,9 @@
1
1
  import {
2
- detectBackend,
3
2
  detectModel
4
- } from "./chunk-OVLFEBRR.js";
3
+ } from "./chunk-FX4SUY2S.js";
4
+ import {
5
+ detectBackend
6
+ } from "./chunk-XYD5JXRM.js";
5
7
  import {
6
8
  getGlobalConfigPath
7
9
  } from "./chunk-R4HADRYO.js";
@@ -48,8 +50,12 @@ var backendSchema = z.enum(["auto", "vllm", "sglang", "ollama", "llamacpp", "ope
48
50
  var modelConfigSchema = z.object({
49
51
  id: z.string(),
50
52
  contextWindow: z.number(),
51
- source: z.enum(["backend", "user", "default"])
52
- });
53
+ source: z.enum(["backend", "user", "default"]),
54
+ temperature: z.number().optional(),
55
+ topP: z.number().optional(),
56
+ topK: z.number().optional(),
57
+ maxTokens: z.number().optional()
58
+ }).passthrough();
53
59
  var providerSchema = z.object({
54
60
  id: z.string(),
55
61
  name: z.string(),
@@ -380,4 +386,4 @@ export {
380
386
  activateProvider,
381
387
  mergeConfigs
382
388
  };
383
- //# sourceMappingURL=chunk-ZDNXCVW4.js.map
389
+ //# sourceMappingURL=chunk-XRGMFOVG.js.map