openfox 2.0.128 → 2.0.130

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 (101) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.md +2 -0
  3. package/dist/CHANGELOG.md +43 -0
  4. package/dist/auth-D3WLIBTG.js +19 -0
  5. package/dist/{auto-config-454YE6KC.js → auto-config-5VSNLVNI.js} +6 -5
  6. package/dist/{backend-4YPEC3J2.js → backend-NDBY3DAQ.js} +4 -2
  7. package/dist/{chat-handler-3O6AIOID.js → chat-handler-4WCKNCQV.js} +32 -32
  8. package/dist/chunk-25DAVVTP.js +395 -0
  9. package/dist/{chunk-ISE55FOR.js → chunk-2AI7VYPN.js} +11 -1
  10. package/dist/{chunk-VHMZBKWY.js → chunk-2OMXXCJJ.js} +24 -24
  11. package/dist/{chunk-JEMPUHAA.js → chunk-35GQEIH2.js} +13 -13
  12. package/dist/{chunk-N2Q3KYWM.js → chunk-3DZSHRXE.js} +7 -2
  13. package/dist/chunk-3OBZ55SX.js +7 -0
  14. package/dist/{chunk-ZIL6VKLU.js → chunk-64N4CZFT.js} +2 -2
  15. package/dist/{chunk-66MG44TF.js → chunk-6QZVAOSA.js} +2 -2
  16. package/dist/{chunk-VJRLIKLE.js → chunk-7ET46SNE.js} +4 -4
  17. package/dist/{chunk-YJD5A375.js → chunk-AYCB32NI.js} +5 -5
  18. package/dist/{chunk-GIJUWPRQ.js → chunk-CGCEAKG5.js} +2 -2
  19. package/dist/{auth-GTGIGX5X.js → chunk-CQGJ5RWB.js} +4 -4
  20. package/dist/{chunk-B2RPFZ3U.js → chunk-CYQUM42E.js} +76 -32
  21. package/dist/{chunk-D5QVV3LT.js → chunk-DHDIKVRT.js} +278 -16
  22. package/dist/{chunk-4MXY7ELN.js → chunk-DI5GTIAU.js} +1154 -196
  23. package/dist/chunk-DQTN4B33.js +235 -0
  24. package/dist/{chunk-RV5G7QQU.js → chunk-DQTXXHD2.js} +3 -3
  25. package/dist/{chunk-OWCJRSOU.js → chunk-DYIDDGMN.js} +54 -36
  26. package/dist/{chunk-KAZWU73N.js → chunk-EUOWCVU6.js} +20 -7
  27. package/dist/{chunk-CQW4QASE.js → chunk-EVVWDRM5.js} +45 -16
  28. package/dist/{chunk-KSDWQ6IZ.js → chunk-HCYSGLY2.js} +1 -1
  29. package/dist/{chunk-KBESUA3W.js → chunk-JHA2SPCU.js} +2 -2
  30. package/dist/{chunk-ZIYETXOW.js → chunk-JKRMMNUR.js} +4 -4
  31. package/dist/{chunk-FYXZRVOL.js → chunk-JSONBGSY.js} +24 -4
  32. package/dist/{chunk-LWDL7HWL.js → chunk-KHKRHGA6.js} +15 -5
  33. package/dist/{chunk-K2QKX4ZJ.js → chunk-OA2FURC3.js} +8 -2
  34. package/dist/{chunk-ZFNBATE3.js → chunk-OXMOKQPW.js} +3 -2
  35. package/dist/{chunk-XAAEP5XM.js → chunk-P57IBMK4.js} +6 -2
  36. package/dist/{session-status-6Q5B5PEN.js → chunk-T3S5MTMD.js} +2 -3
  37. package/dist/{chunk-7ZMOP5LS.js → chunk-TS5WKTFB.js} +18 -1
  38. package/dist/{chunk-PBFGJFGC.js → chunk-UV6IH6HK.js} +32 -10
  39. package/dist/{chunk-KD4W3I6C.js → chunk-VJNA5AOB.js} +39 -7
  40. package/dist/{chunk-S6ATKIT2.js → chunk-VUIXQ6X4.js} +4 -4
  41. package/dist/{chunk-53R7QNZG.js → chunk-X24XN2M2.js} +97 -57
  42. package/dist/{chunk-AQBRI7TM.js → chunk-X3FHIDLT.js} +2 -2
  43. package/dist/chunk-YNMP647F.js +24 -0
  44. package/dist/{chunk-7YP4O4XE.js → chunk-ZRCRGPGT.js} +2 -2
  45. package/dist/cli/dev.js +1 -1
  46. package/dist/cli/index.js +1 -1
  47. package/dist/client-26RSMUAX.js +16 -0
  48. package/dist/{client-pure-CJKM3ACP.js → client-pure-FLKP6PTI.js} +2 -2
  49. package/dist/{compactor-B6IVMDES.js → compactor-HYBSSFKP.js} +14 -14
  50. package/dist/dynamic-context-2VLACYK4.js +50 -0
  51. package/dist/{events-GMHRX4LF.js → events-D33QXGSX.js} +7 -7
  52. package/dist/{folding-7K2GRPF4.js → folding-QOKBKUU6.js} +5 -5
  53. package/dist/{http-client-ROVNSHF6.js → http-client-MGAJTGPR.js} +3 -3
  54. package/dist/launch-KFENN5GS.js +53 -0
  55. package/dist/{manager-NOKJQTTF.js → manager-VRHX7BVI.js} +4 -4
  56. package/dist/mcp-YU7AM3UV.js +120 -0
  57. package/dist/{model-catalog-ZLOWTQA7.js → model-catalog-2PCKTYGW.js} +2 -2
  58. package/dist/{oauth-provider-DGBC2YM6.js → oauth-provider-VHUS2KEG.js} +8 -2
  59. package/dist/{orchestrator-WLNW7TS7.js → orchestrator-PLTAEOMR.js} +30 -30
  60. package/dist/package.json +1 -1
  61. package/dist/{path-security-YTPZ35SL.js → path-security-4WQJGU3Z.js} +11 -11
  62. package/dist/{platform-EMKWQTZX.js → platform-MWWJ6OKV.js} +3 -3
  63. package/dist/plugins-registry.json +12 -0
  64. package/dist/{processor-ZMXU5MOT.js → processor-K4WHZKE6.js} +31 -31
  65. package/dist/{profiles-HXGJIPF2.js → profiles-EBCVFYG7.js} +2 -2
  66. package/dist/{protocol-DCMH9Ufp.d.ts → protocol-BMUoqwYH.d.ts} +8 -3
  67. package/dist/{protocol-TLODRZSB.js → protocol-Y7MRKRUO.js} +5 -3
  68. package/dist/provider/index.d.ts +4 -4
  69. package/dist/{provider-QIOTESLB.js → provider-CVM33XHW.js} +10 -10
  70. package/dist/{provider-manager-FVI22EWM.js → provider-manager-7NL5EQLG.js} +10 -10
  71. package/dist/{registry-Z4GVYFTV.js → registry-KFFZFIZT.js} +3 -3
  72. package/dist/{serve-7M4HCERR.js → serve-KQAPXO5X.js} +42 -40
  73. package/dist/server/index.d.ts +18 -3
  74. package/dist/server/index.js +39 -37
  75. package/dist/server-RPKVKMDD.js +56 -0
  76. package/dist/{service-F4TWYTKE.js → service-7TLOSFAO.js} +12 -12
  77. package/dist/{session-overrides-4WAD3X5Q.js → session-overrides-U573CU2V.js} +5 -5
  78. package/dist/session-status-UFO5IFI7.js +10 -0
  79. package/dist/{sessions-D7VRCHQY.js → sessions-LUVWWRFO.js} +4 -4
  80. package/dist/{settings-VOWWO4VG.js → settings-LMAMF2X7.js} +2 -2
  81. package/dist/shared/index.d.ts +3 -3
  82. package/dist/shared/index.js +1 -1
  83. package/dist/skill-defaults/browser/SKILL.md +20 -1
  84. package/dist/{tasks-36WHYN3H.js → tasks-FA6Z52H2.js} +12 -12
  85. package/dist/{tools-WAUWG4PE.js → tools-SSPC3UQZ.js} +34 -34
  86. package/dist/{types-PAKlAzp9.d.ts → types-BIkpxjaj.d.ts} +11 -2
  87. package/dist/{types-BWuVnaBw.d.ts → types-CoY8Ka1C.d.ts} +1 -1
  88. package/dist/{update-AIVWCRXR.js → update-QRGK67DB.js} +2 -2
  89. package/dist/web/assets/{index-DtQsFnyQ.js → index-0PVQNOfW.js} +88 -88
  90. package/dist/web/assets/{index-CbX8veVW.css → index-Ds94aclE.css} +1 -1
  91. package/dist/web/index.html +2 -2
  92. package/dist/web/sw.js +1 -1
  93. package/package.json +1 -1
  94. package/plugins-registry.json +12 -0
  95. package/dist/chunk-BQNQJE57.js +0 -151
  96. package/dist/chunk-ES5635OP.js +0 -7
  97. package/dist/chunk-RSB4AR2A.js +0 -108
  98. package/dist/client-VDXO7IIV.js +0 -16
  99. package/dist/dynamic-context-4WVMNJTZ.js +0 -28
  100. package/dist/launch-AKIMGAGC.js +0 -53
  101. package/dist/server-RX5JM7IT.js +0 -56
@@ -22,6 +22,15 @@ function resolveEffortForModel({
22
22
  if (override) return override;
23
23
  return defaultEffort && reasoningEfforts.includes(defaultEffort) ? defaultEffort : void 0;
24
24
  }
25
+ var MODE_SUFFIXES = ["low", "medium", "high", "xhigh", "max"];
26
+ var MODE_SUFFIX_REGEX = new RegExp(`-(${MODE_SUFFIXES.join("|")})$`);
27
+ function resolveModeModelId(modes, effort, fallbackApiModelId, modelId) {
28
+ const modeEntry = modes?.find((mode) => mode.level === effort);
29
+ if (modeEntry) {
30
+ return { modelId: modeEntry.apiModelId, suppressEffort: true };
31
+ }
32
+ return { modelId: fallbackApiModelId ?? modelId, suppressEffort: false };
33
+ }
25
34
 
26
35
  // src/server/providers/model-catalog.ts
27
36
  var CATALOG = [
@@ -83,7 +92,8 @@ export {
83
92
  REASONING_EFFORT_VALUES,
84
93
  isReasoningEffortValue,
85
94
  resolveEffortForModel,
95
+ resolveModeModelId,
86
96
  getCatalogEntry,
87
97
  getCatalogDefaultEffort
88
98
  };
89
- //# sourceMappingURL=chunk-ISE55FOR.js.map
99
+ //# sourceMappingURL=chunk-2AI7VYPN.js.map
@@ -1,22 +1,10 @@
1
1
  import {
2
2
  runAgentTurn
3
- } from "./chunk-CQW4QASE.js";
3
+ } from "./chunk-EVVWDRM5.js";
4
4
  import {
5
5
  executeSubAgent,
6
6
  getToolRegistryForAgent
7
- } from "./chunk-53R7QNZG.js";
8
- import {
9
- TurnMetrics,
10
- createMessageStartEvent
11
- } from "./chunk-VJRLIKLE.js";
12
- import {
13
- checkAborted,
14
- decodeUtf8,
15
- spawnShellProcess
16
- } from "./chunk-RV5G7QQU.js";
17
- import {
18
- terminateProcessTree
19
- } from "./chunk-I72ACQ6R.js";
7
+ } from "./chunk-X24XN2M2.js";
20
8
  import {
21
9
  gitSpawnEnv
22
10
  } from "./chunk-J7GAZGZT.js";
@@ -27,24 +15,36 @@ import {
27
15
  loadProjectWorkflows,
28
16
  loadUserWorkflows,
29
17
  normalizeWorkflowScope
30
- } from "./chunk-FYXZRVOL.js";
18
+ } from "./chunk-JSONBGSY.js";
19
+ import {
20
+ TurnMetrics,
21
+ createMessageStartEvent
22
+ } from "./chunk-7ET46SNE.js";
23
+ import {
24
+ checkAborted,
25
+ decodeUtf8,
26
+ spawnShellProcess
27
+ } from "./chunk-DQTXXHD2.js";
28
+ import {
29
+ terminateProcessTree
30
+ } from "./chunk-I72ACQ6R.js";
31
31
  import {
32
32
  getCurrentContextWindowId,
33
33
  getEventStore
34
- } from "./chunk-YJD5A375.js";
35
- import {
36
- createChatMessageMessage,
37
- createSessionRunningMessage
38
- } from "./chunk-XAAEP5XM.js";
34
+ } from "./chunk-AYCB32NI.js";
39
35
  import {
40
36
  findAgentById,
41
37
  getRuntimeConfig,
42
38
  loadAllAgentsDefault,
43
39
  resolveDefaultAgentId
44
- } from "./chunk-KBESUA3W.js";
40
+ } from "./chunk-JHA2SPCU.js";
41
+ import {
42
+ createChatMessageMessage,
43
+ createSessionRunningMessage
44
+ } from "./chunk-P57IBMK4.js";
45
45
  import {
46
46
  LLMError
47
- } from "./chunk-ZFNBATE3.js";
47
+ } from "./chunk-OXMOKQPW.js";
48
48
  import {
49
49
  logger
50
50
  } from "./chunk-K44MW7JJ.js";
@@ -53,7 +53,7 @@ import {
53
53
  } from "./chunk-7OHXF5GW.js";
54
54
  import {
55
55
  createServerMessage
56
- } from "./chunk-KSDWQ6IZ.js";
56
+ } from "./chunk-HCYSGLY2.js";
57
57
  import {
58
58
  getGlobalConfigDir
59
59
  } from "./chunk-CQGTEGKL.js";
@@ -1002,4 +1002,4 @@ export {
1002
1002
  abortRunnerRun,
1003
1003
  launchWorkflowRun
1004
1004
  };
1005
- //# sourceMappingURL=chunk-VHMZBKWY.js.map
1005
+ //# sourceMappingURL=chunk-2OMXXCJJ.js.map
@@ -1,27 +1,27 @@
1
+ import {
2
+ getPendingQuestionsForSession
3
+ } from "./chunk-JURM3RPZ.js";
1
4
  import {
2
5
  combineEventsWithSnapshot,
3
6
  getEventStore
4
- } from "./chunk-YJD5A375.js";
7
+ } from "./chunk-AYCB32NI.js";
5
8
  import {
6
9
  buildMessagesFromStoredEvents,
7
10
  foldPendingConfirmations
8
- } from "./chunk-ZIYETXOW.js";
11
+ } from "./chunk-JKRMMNUR.js";
9
12
  import {
10
13
  updateSessionMetadata
11
- } from "./chunk-AQBRI7TM.js";
14
+ } from "./chunk-X3FHIDLT.js";
15
+ import {
16
+ getRuntimeConfig
17
+ } from "./chunk-JHA2SPCU.js";
12
18
  import {
13
19
  createContextStateMessage,
14
20
  createSessionStateMessage
15
- } from "./chunk-XAAEP5XM.js";
16
- import {
17
- getPendingQuestionsForSession
18
- } from "./chunk-JURM3RPZ.js";
19
- import {
20
- getRuntimeConfig
21
- } from "./chunk-KBESUA3W.js";
21
+ } from "./chunk-P57IBMK4.js";
22
22
  import {
23
23
  getMaxVisibleItems
24
- } from "./chunk-N2Q3KYWM.js";
24
+ } from "./chunk-3DZSHRXE.js";
25
25
  import {
26
26
  logger
27
27
  } from "./chunk-K44MW7JJ.js";
@@ -162,7 +162,7 @@ async function generateSessionNameForSession(sessionId, userMessage, deps, signa
162
162
  client = deps.getLLMClient();
163
163
  client.setModel(providerConfig.model);
164
164
  } else if (providerConfig) {
165
- const { createLLMClient } = await import("./client-VDXO7IIV.js");
165
+ const { createLLMClient } = await import("./client-26RSMUAX.js");
166
166
  client = createLLMClient(
167
167
  {
168
168
  llm: {
@@ -216,4 +216,4 @@ export {
216
216
  needsNameGeneration,
217
217
  generateSessionNameForSession
218
218
  };
219
- //# sourceMappingURL=chunk-JEMPUHAA.js.map
219
+ //# sourceMappingURL=chunk-35GQEIH2.js.map
@@ -119,7 +119,12 @@ function getAllSettings() {
119
119
  }
120
120
  function getMaxVisibleItems() {
121
121
  const setting = getSetting(SETTINGS_KEYS.DISPLAY_MAX_VISIBLE_ITEMS);
122
- return setting ? parseInt(setting, 10) : 0;
122
+ const defaultValue = Number(SETTINGS_DEFAULTS[SETTINGS_KEYS.DISPLAY_MAX_VISIBLE_ITEMS]);
123
+ if (setting === null || setting.trim() === "") {
124
+ return defaultValue;
125
+ }
126
+ const value = Number(setting);
127
+ return Number.isInteger(value) && value >= 0 ? value : defaultValue;
123
128
  }
124
129
 
125
130
  export {
@@ -131,4 +136,4 @@ export {
131
136
  getAllSettings,
132
137
  getMaxVisibleItems
133
138
  };
134
- //# sourceMappingURL=chunk-N2Q3KYWM.js.map
139
+ //# sourceMappingURL=chunk-3DZSHRXE.js.map
@@ -0,0 +1,7 @@
1
+ // src/constants.ts
2
+ var VERSION = "2.0.130";
3
+
4
+ export {
5
+ VERSION
6
+ };
7
+ //# sourceMappingURL=chunk-3OBZ55SX.js.map
@@ -11,7 +11,7 @@ import {
11
11
  deleteSetting,
12
12
  getSetting,
13
13
  setSetting
14
- } from "./chunk-N2Q3KYWM.js";
14
+ } from "./chunk-3DZSHRXE.js";
15
15
 
16
16
  // src/server/context/instructions.ts
17
17
  import { readFile, access } from "fs/promises";
@@ -440,4 +440,4 @@ export {
440
440
  deleteSkill,
441
441
  deleteProjectSkill
442
442
  };
443
- //# sourceMappingURL=chunk-ZIL6VKLU.js.map
443
+ //# sourceMappingURL=chunk-64N4CZFT.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SETTINGS_KEYS,
3
3
  getSetting
4
- } from "./chunk-N2Q3KYWM.js";
4
+ } from "./chunk-3DZSHRXE.js";
5
5
 
6
6
  // src/server/utils/platform.ts
7
7
  import os from "os";
@@ -63,4 +63,4 @@ export {
63
63
  isWindowsPath,
64
64
  isAbsolutePath
65
65
  };
66
- //# sourceMappingURL=chunk-66MG44TF.js.map
66
+ //# sourceMappingURL=chunk-6QZVAOSA.js.map
@@ -3,13 +3,13 @@ import {
3
3
  } from "./chunk-J2GP3J3X.js";
4
4
  import {
5
5
  getModelProfile
6
- } from "./chunk-7ZMOP5LS.js";
6
+ } from "./chunk-TS5WKTFB.js";
7
7
  import {
8
8
  getBackendCapabilities
9
- } from "./chunk-PBFGJFGC.js";
9
+ } from "./chunk-UV6IH6HK.js";
10
10
  import {
11
11
  buildModelParams
12
- } from "./chunk-KAZWU73N.js";
12
+ } from "./chunk-EUOWCVU6.js";
13
13
  import {
14
14
  logger
15
15
  } from "./chunk-K44MW7JJ.js";
@@ -518,4 +518,4 @@ export {
518
518
  createChatDoneEvent,
519
519
  consumeStreamGenerator
520
520
  };
521
- //# sourceMappingURL=chunk-VJRLIKLE.js.map
521
+ //# sourceMappingURL=chunk-7ET46SNE.js.map
@@ -6,16 +6,16 @@ import {
6
6
  foldSessionState,
7
7
  spreadOptionalMessageFields,
8
8
  trimSnapshotStreamingOutput
9
- } from "./chunk-ZIYETXOW.js";
9
+ } from "./chunk-JKRMMNUR.js";
10
10
  import {
11
11
  updateSessionMessageCount
12
- } from "./chunk-AQBRI7TM.js";
12
+ } from "./chunk-X3FHIDLT.js";
13
13
  import {
14
14
  getRuntimeConfig
15
- } from "./chunk-KBESUA3W.js";
15
+ } from "./chunk-JHA2SPCU.js";
16
16
  import {
17
17
  SETTINGS_KEYS
18
- } from "./chunk-N2Q3KYWM.js";
18
+ } from "./chunk-3DZSHRXE.js";
19
19
  import {
20
20
  logger
21
21
  } from "./chunk-K44MW7JJ.js";
@@ -1465,4 +1465,4 @@ export {
1465
1465
  truncateSessionMessages,
1466
1466
  getRecentUserPromptsForSession
1467
1467
  };
1468
- //# sourceMappingURL=chunk-YJD5A375.js.map
1468
+ //# sourceMappingURL=chunk-AYCB32NI.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getPlatformShell
3
- } from "./chunk-66MG44TF.js";
3
+ } from "./chunk-6QZVAOSA.js";
4
4
 
5
5
  // src/server/tools/tool-policy.ts
6
6
  var ALWAYS_ALLOWED = /* @__PURE__ */ new Set(["step_done"]);
@@ -246,4 +246,4 @@ export {
246
246
  buildAgentSmallReminder,
247
247
  COMPACTION_PROMPT
248
248
  };
249
- //# sourceMappingURL=chunk-GIJUWPRQ.js.map
249
+ //# sourceMappingURL=chunk-CGCEAKG5.js.map
@@ -1,7 +1,6 @@
1
1
  import {
2
2
  getAuthConfigPath
3
3
  } from "./chunk-CQGTEGKL.js";
4
- import "./chunk-YLJ4XMA6.js";
5
4
 
6
5
  // src/cli/auth.ts
7
6
  import { readFile, writeFile, mkdir, access } from "fs/promises";
@@ -40,12 +39,13 @@ function hashPassword(password) {
40
39
  function verifyPassword(password, hash) {
41
40
  return hashPassword(password) === hash;
42
41
  }
42
+
43
43
  export {
44
+ saveAuthConfig,
45
+ loadAuthConfig,
44
46
  authConfigExists,
45
47
  encryptPassword,
46
48
  hashPassword,
47
- loadAuthConfig,
48
- saveAuthConfig,
49
49
  verifyPassword
50
50
  };
51
- //# sourceMappingURL=auth-GTGIGX5X.js.map
51
+ //# sourceMappingURL=chunk-CQGJ5RWB.js.map
@@ -1,15 +1,17 @@
1
1
  import {
2
+ hasVisionEvidence,
2
3
  parseLmStudioModels
3
- } from "./chunk-K2QKX4ZJ.js";
4
+ } from "./chunk-OA2FURC3.js";
4
5
  import {
5
6
  createLLMClient
6
- } from "./chunk-D5QVV3LT.js";
7
+ } from "./chunk-DHDIKVRT.js";
7
8
  import {
8
9
  getModelProfile
9
- } from "./chunk-7ZMOP5LS.js";
10
+ } from "./chunk-TS5WKTFB.js";
10
11
  import {
12
+ detectBackendFromUrl,
11
13
  getBackendCapabilities
12
- } from "./chunk-PBFGJFGC.js";
14
+ } from "./chunk-UV6IH6HK.js";
13
15
  import {
14
16
  buildModelsUrl,
15
17
  ensureVersionPrefix,
@@ -17,11 +19,12 @@ import {
17
19
  } from "./chunk-HNCM3D7Y.js";
18
20
  import {
19
21
  resolveAttachmentsInMessages
20
- } from "./chunk-KAZWU73N.js";
22
+ } from "./chunk-EUOWCVU6.js";
21
23
  import {
22
24
  getCatalogEntry,
23
- resolveEffortForModel
24
- } from "./chunk-ISE55FOR.js";
25
+ resolveEffortForModel,
26
+ resolveModeModelId
27
+ } from "./chunk-2AI7VYPN.js";
25
28
  import {
26
29
  logger
27
30
  } from "./chunk-K44MW7JJ.js";
@@ -45,11 +48,12 @@ function createTransportLLMClient(provider, modelId, transport, reasoningEffort)
45
48
  };
46
49
  let profile = profileFor(model);
47
50
  void getBackendCapabilities(backend);
48
- const context = () => {
51
+ const context = (resolvedEffort) => {
49
52
  const configured = provider.models.find((item) => item.id === model);
53
+ const send = resolveModeModelId(configured?.modes, resolvedEffort, configured?.apiModelId, model);
50
54
  return {
51
55
  providerId: provider.id,
52
- model: configured?.apiModelId ?? model,
56
+ model: send.modelId,
53
57
  catalogModel: model,
54
58
  ...configured?.requestBody && { requestBody: configured.requestBody },
55
59
  ...provider.credentialRef && { credentialRef: provider.credentialRef }
@@ -69,10 +73,15 @@ function createTransportLLMClient(provider, modelId, transport, reasoningEffort)
69
73
  const resolveRequest = async (request) => {
70
74
  const supportsVision = request.modelSettings?.supportsVision ?? profile.supportsVision ?? false;
71
75
  const resolvedEffort = resolveEffort(request);
76
+ const configured = provider.models.find((item) => item.id === model);
77
+ const send = resolveModeModelId(configured?.modes, resolvedEffort, configured?.apiModelId, model);
72
78
  return {
73
- ...request,
74
- messages: await resolveAttachmentsInMessages(request.messages, supportsVision),
75
- ...resolvedEffort ? { reasoningEffort: resolvedEffort } : {}
79
+ request: {
80
+ ...request,
81
+ messages: await resolveAttachmentsInMessages(request.messages, supportsVision),
82
+ ...resolvedEffort && !send.suppressEffort ? { reasoningEffort: resolvedEffort } : {}
83
+ },
84
+ effort: resolvedEffort
76
85
  };
77
86
  };
78
87
  return {
@@ -87,9 +96,13 @@ function createTransportLLMClient(provider, modelId, transport, reasoningEffort)
87
96
  backend = next;
88
97
  },
89
98
  getReasoningEffort: () => resolveEffort({}),
90
- complete: async (request) => transport.complete(await resolveRequest(request), context()),
99
+ complete: async (request) => {
100
+ const resolved = await resolveRequest(request);
101
+ return transport.complete(resolved.request, context(resolved.effort));
102
+ },
91
103
  stream: async function* (request) {
92
- yield* transport.stream(await resolveRequest(request), context());
104
+ const resolved = await resolveRequest(request);
105
+ yield* transport.stream(resolved.request, context(resolved.effort));
93
106
  }
94
107
  };
95
108
  }
@@ -213,7 +226,8 @@ async function fetchModelsFromBackend(url, apiKey) {
213
226
  if (data.data && Array.isArray(data.data)) {
214
227
  return data.data.map((m) => ({
215
228
  id: m.id,
216
- contextWindow: m.max_model_len ?? void 0
229
+ contextWindow: m.max_model_len ?? m.context_length ?? void 0,
230
+ supportsVision: m.capabilities?.vision || m.input_modalities?.includes("image") ? true : void 0
217
231
  }));
218
232
  }
219
233
  return [];
@@ -226,6 +240,10 @@ function enrichWithProfileDefaults(model) {
226
240
  const profile = getModelProfile(model.id);
227
241
  return {
228
242
  ...model,
243
+ // Only fill supportsVision from the profile when the model lacks it —
244
+ // a backend-detected value (e.g. Ollama /api/show, a transport plugin's
245
+ // listModels) must win over the static profile default.
246
+ ...model.supportsVision !== void 0 ? {} : profile.supportsVision !== void 0 ? { supportsVision: profile.supportsVision } : {},
229
247
  defaultTemperature: profile.temperature,
230
248
  defaultTopP: profile.topP,
231
249
  ...profile.topK !== void 0 && { defaultTopK: profile.topK },
@@ -244,7 +262,15 @@ function enrichWithCatalogDefaults(model) {
244
262
  }
245
263
  function mergeModelsWithUserOverrides(backendModels, userModels, preserveMissingUserModels = true) {
246
264
  const normalizedUserIdMap = new Map(userModels.map((m) => [normalizeModelId(m.id), m]));
247
- const updatedModels = backendModels.map((backendModel) => {
265
+ const claimedByMergedModes = /* @__PURE__ */ new Set();
266
+ for (const userModel of userModels) {
267
+ if (!userModel.modes?.length) continue;
268
+ for (const mode of userModel.modes) {
269
+ if (mode.apiModelId) claimedByMergedModes.add(normalizeModelId(mode.apiModelId));
270
+ }
271
+ }
272
+ const filteredBackendModels = backendModels.filter((m) => !claimedByMergedModes.has(normalizeModelId(m.id)));
273
+ const updatedModels = filteredBackendModels.map((backendModel) => {
248
274
  const existingUserModel = normalizedUserIdMap.get(normalizeModelId(backendModel.id));
249
275
  if (existingUserModel) {
250
276
  return enrichWithProfileDefaults({ ...backendModel, ...existingUserModel, id: backendModel.id });
@@ -252,7 +278,7 @@ function mergeModelsWithUserOverrides(backendModels, userModels, preserveMissing
252
278
  return enrichWithProfileDefaults(backendModel);
253
279
  });
254
280
  if (preserveMissingUserModels) {
255
- const normalizedBackendIds = new Set(backendModels.map((m) => normalizeModelId(m.id)));
281
+ const normalizedBackendIds = new Set(filteredBackendModels.map((m) => normalizeModelId(m.id)));
256
282
  for (const userModel of userModels) {
257
283
  if (!normalizedBackendIds.has(normalizeModelId(userModel.id))) {
258
284
  updatedModels.push(enrichWithProfileDefaults(userModel));
@@ -286,6 +312,7 @@ async function fetchModelsWithContext(baseUrl, apiKey, backend) {
286
312
  return models.map((m) => ({
287
313
  id: m.id,
288
314
  contextWindow: m.contextWindow ?? 2e5,
315
+ ...m.supportsVision !== void 0 && { supportsVision: m.supportsVision },
289
316
  source: m.contextWindow ? "backend" : "default"
290
317
  }));
291
318
  }
@@ -315,10 +342,13 @@ async function fetchOllamaModelsWithContext(baseUrl, _apiKey) {
315
342
  });
316
343
  if (showResponse.ok) {
317
344
  const showData = await showResponse.json();
318
- const contextLength = showData.model_info?.llama?.context_length ?? showData.model_info?.context_length ?? 2e5;
345
+ const mi = showData.model_info;
346
+ const contextLength = mi?.llama?.context_length ?? mi?.context_length ?? 2e5;
347
+ const isVisionModel = hasVisionEvidence(mi ?? {});
319
348
  modelsWithContext.push({
320
349
  id: model.name,
321
350
  contextWindow: contextLength,
351
+ ...isVisionModel ? { supportsVision: true } : {},
322
352
  source: contextLength !== 2e5 ? "backend" : "default"
323
353
  });
324
354
  } else {
@@ -421,20 +451,31 @@ function createProviderManager(config, options = {}) {
421
451
  }
422
452
  function createConfigForProvider(provider, model, reasoningEffort) {
423
453
  const modelThinking = resolveModelThinkingConfig(provider, model, reasoningEffort);
454
+ const configureModel = provider.models.find((m) => m.id === model);
455
+ const send = resolveModeModelId(
456
+ configureModel?.modes,
457
+ modelThinking.reasoningEffort,
458
+ configureModel?.apiModelId,
459
+ model
460
+ );
424
461
  return {
425
462
  ...config,
426
463
  llm: {
427
464
  ...config.llm,
428
465
  baseUrl: ensureVersionPrefix(provider.url),
429
- model,
430
- backend: provider.backend,
466
+ model: send.modelId,
467
+ backend: resolveBackend(provider),
431
468
  ...provider.apiKey && { apiKey: provider.apiKey },
432
469
  ...provider.thinkingField && { thinkingField: provider.thinkingField },
433
470
  ...provider.sendReasoningInMessages !== void 0 ? { sendReasoningInMessages: provider.sendReasoningInMessages } : {},
434
- ...modelThinking.reasoningEffort && { reasoningEffort: modelThinking.reasoningEffort }
471
+ ...modelThinking.reasoningEffort && !send.suppressEffort && { reasoningEffort: modelThinking.reasoningEffort }
435
472
  }
436
473
  };
437
474
  }
475
+ function resolveBackend(provider) {
476
+ if (provider.backend !== "unknown") return provider.backend;
477
+ return detectBackendFromUrl(provider.url) ?? "unknown";
478
+ }
438
479
  function resolveTransportAdapter(provider) {
439
480
  if (provider.transportAdapter) return provider.transportAdapter;
440
481
  return void 0;
@@ -456,10 +497,7 @@ function createProviderManager(config, options = {}) {
456
497
  function createClientForProvider(provider, model, reasoningEffort) {
457
498
  const resolvedModel = resolveProviderModel(provider, model);
458
499
  const transport = options.adapters?.getTransport(resolveTransportAdapter(provider));
459
- return transport ? createTransportLLMClient(provider, resolvedModel, transport, reasoningEffort) : createLLMClient(
460
- createConfigForProvider(provider, resolvedModel, reasoningEffort),
461
- provider.backend
462
- );
500
+ return transport ? createTransportLLMClient(provider, resolvedModel, transport, reasoningEffort) : createLLMClient(createConfigForProvider(provider, resolvedModel, reasoningEffort), resolveBackend(provider));
463
501
  }
464
502
  async function fetchProviderModels(provider) {
465
503
  const transport = options.adapters?.getTransport(resolveTransportAdapter(provider));
@@ -469,7 +507,7 @@ function createProviderManager(config, options = {}) {
469
507
  ...provider.credentialRef && { credentialRef: provider.credentialRef }
470
508
  });
471
509
  }
472
- const backend = provider.backend;
510
+ const backend = resolveBackend(provider);
473
511
  return fetchModelsWithContext(provider.url, provider.apiKey, backend);
474
512
  }
475
513
  const { providerId: activeProviderId, model: activeModel } = parseDefaultModelSelection(defaultModelSelection);
@@ -727,6 +765,9 @@ function createProviderManager(config, options = {}) {
727
765
  id: modelId,
728
766
  contextWindow: settings.contextWindow ?? existingModel?.contextWindow ?? 2e5,
729
767
  source: "user",
768
+ ...existingModel?.name !== void 0 && { name: existingModel.name },
769
+ ...existingModel?.apiModelId !== void 0 && { apiModelId: existingModel.apiModelId },
770
+ ...existingModel?.modes !== void 0 && { modes: existingModel.modes },
730
771
  ...finalTemp !== void 0 && { temperature: finalTemp },
731
772
  ...finalTopP !== void 0 && { topP: finalTopP },
732
773
  ...finalTopK !== void 0 && { topK: finalTopK },
@@ -756,7 +797,7 @@ function createProviderManager(config, options = {}) {
756
797
  getModelSettings(providerId, modelId, mode = "thinking") {
757
798
  const provider = providers.find((p) => p.id === providerId);
758
799
  const model = provider?.models.find((m) => m.id === modelId);
759
- if (!model) return void 0;
800
+ if (!provider || !model) return void 0;
760
801
  const baseSettings = {};
761
802
  if (model["temperature"] !== void 0) baseSettings["temperature"] = model["temperature"];
762
803
  if (model["topP"] !== void 0) baseSettings["topP"] = model["topP"];
@@ -772,10 +813,13 @@ function createProviderManager(config, options = {}) {
772
813
  }
773
814
  const modeEnabled = mode === "thinking" ? model.thinkingEnabled : model.nonThinkingEnabled;
774
815
  if (modeEnabled) {
775
- return {
776
- ...baseSettings,
777
- chatTemplateKwargs: mode === "thinking" ? { enable_thinking: true } : { enable_thinking: false }
778
- };
816
+ const capabilities = getBackendCapabilities(resolveBackend(provider));
817
+ if (capabilities.supportsChatTemplateKwargs) {
818
+ return {
819
+ ...baseSettings,
820
+ chatTemplateKwargs: mode === "thinking" ? { enable_thinking: true } : { enable_thinking: false }
821
+ };
822
+ }
779
823
  }
780
824
  const fallbackRawQP = mode === "thinking" ? model.nonThinkingQueryParams : model.thinkingQueryParams;
781
825
  if (fallbackRawQP) {
@@ -851,4 +895,4 @@ export {
851
895
  parseDefaultModelSelection,
852
896
  createProviderManager
853
897
  };
854
- //# sourceMappingURL=chunk-B2RPFZ3U.js.map
898
+ //# sourceMappingURL=chunk-CYQUM42E.js.map