dsh-model-switch 0.4.68 → 0.4.70
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.
- package/CHANGELOG.md +30 -0
- package/IMPLEMENTATION_PLAN.md +12 -1
- package/PRODUCT.md +3 -3
- package/README.en.md +16 -3
- package/README.md +16 -3
- package/cordis.patch.yml +9 -0
- package/lib/auto-review-CYvvootQ.js +1079 -0
- package/lib/auto-review.js +1 -1
- package/lib/automode-compat.js +1 -1
- package/lib/client.js +503 -47
- package/lib/compaction.js +1 -1
- package/lib/index.js +26 -7
- package/lib/prime-memory-compat.js +573 -1
- package/lib/prime-memory-route-DGUVfogE.js +117 -0
- package/lib/review-timeout-FB32BcnO.js +339 -0
- package/lib/review-timeout.js +1 -1
- package/lib/session-route-CRfpxarI.js +357 -0
- package/lib/session-title.js +17 -3
- package/lib/subagent-runtime-eNKrdb2H.js +424 -0
- package/lib/subagent-runtime.js +1 -1
- package/lib/tool-allowlist-cN9Z1XKn.js +489 -0
- package/lib/types/capabilities-rpc.d.ts +7 -0
- package/lib/types/client/ModelSwitchSettings.d.ts +6 -3
- package/lib/types/client/locales.d.ts +18 -2
- package/lib/types/client-contract.d.ts +33 -1
- package/lib/types/host-settings.d.ts +11 -0
- package/lib/types/prime-memory-compat.d.ts +14 -6
- package/lib/types/prime-memory-route.d.ts +22 -0
- package/lib/types/provider-group.d.ts +31 -3
- package/lib/types/session-route.d.ts +24 -3
- package/lib/types/session-title.d.ts +12 -0
- package/lib/types/tool-allowlist.d.ts +13 -0
- package/lib/types/vision-router-compat.d.ts +62 -0
- package/lib/types/vision-router-route.d.ts +94 -0
- package/lib/vision-router-compat-B9bkgJmh.js +312 -0
- package/lib/vision-router-compat-DP81VMLW.js +312 -0
- package/lib/vision-router-compat.js +2 -0
- package/package.json +6 -1
package/lib/client.js
CHANGED
|
@@ -46,6 +46,18 @@ window.__ModuleLoader__.load({
|
|
|
46
46
|
label: "插件 · dsh-prime-memory",
|
|
47
47
|
repo: "https://github.com/drscrewdriver/dsh-prime-memory"
|
|
48
48
|
},
|
|
49
|
+
{
|
|
50
|
+
id: "dsh-vision-router",
|
|
51
|
+
kind: "plugin",
|
|
52
|
+
label: "插件 · dsh-vision-router",
|
|
53
|
+
repo: "https://github.com/ysr666/dsh-vision-router"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: "dsh-univer-office",
|
|
57
|
+
kind: "plugin",
|
|
58
|
+
label: "插件 · dsh-univer-office",
|
|
59
|
+
repo: "https://github.com/dream-num/dsh-univer-office"
|
|
60
|
+
},
|
|
49
61
|
{
|
|
50
62
|
id: "dsh-embedded-browser",
|
|
51
63
|
kind: "plugin",
|
|
@@ -58,6 +70,12 @@ window.__ModuleLoader__.load({
|
|
|
58
70
|
label: "MCP · wincu(dsh-computer-use-win)",
|
|
59
71
|
repo: "https://github.com/Yu-tao-Li/dsh-computer-use-win"
|
|
60
72
|
},
|
|
73
|
+
{
|
|
74
|
+
id: "mcp:mineru-mcp",
|
|
75
|
+
kind: "mcp",
|
|
76
|
+
label: "MCP · mineru-mcp(@vandoor2/mineru-mcp)",
|
|
77
|
+
repo: "https://gitee.com/vandoor2/mineru-mcp"
|
|
78
|
+
},
|
|
61
79
|
{
|
|
62
80
|
id: "qqbot-extension",
|
|
63
81
|
kind: "extension",
|
|
@@ -88,6 +106,7 @@ window.__ModuleLoader__.load({
|
|
|
88
106
|
"job_output",
|
|
89
107
|
"list_agents",
|
|
90
108
|
"list_mcp_resource_templates",
|
|
109
|
+
"list_subagent_models",
|
|
91
110
|
"list_mcp_resources",
|
|
92
111
|
"load_workspace_dependencies",
|
|
93
112
|
"present",
|
|
@@ -96,10 +115,13 @@ window.__ModuleLoader__.load({
|
|
|
96
115
|
"read",
|
|
97
116
|
"read_image",
|
|
98
117
|
"read_mcp_resource",
|
|
118
|
+
"run_code",
|
|
99
119
|
"schedule_create",
|
|
100
120
|
"schedule_delete",
|
|
121
|
+
"schedule_edit",
|
|
101
122
|
"schedule_list",
|
|
102
123
|
"schedule_update",
|
|
124
|
+
"schedule_view",
|
|
103
125
|
"send_message",
|
|
104
126
|
"session_event_read",
|
|
105
127
|
"session_event_search",
|
|
@@ -132,13 +154,15 @@ window.__ModuleLoader__.load({
|
|
|
132
154
|
"write"
|
|
133
155
|
]);
|
|
134
156
|
/** MCP server name → catalog id, for the servers this allowlist knows. */
|
|
135
|
-
const MCP_SERVERS = /* @__PURE__ */ new Map([["wincu", "mcp:wincu"]]);
|
|
157
|
+
const MCP_SERVERS = /* @__PURE__ */ new Map([["wincu", "mcp:wincu"], ["mineru-mcp", "mcp:mineru-mcp"]]);
|
|
136
158
|
/** Plugin identity by tool-name prefix (checked before the core catalog). */
|
|
137
159
|
const PLUGIN_PREFIXES = [
|
|
138
160
|
["bcdp_", "dsh-browser-cdp"],
|
|
139
161
|
["browser_window_", "dsh-browser-cdp"],
|
|
140
162
|
["browser_embedded_", "dsh-embedded-browser"],
|
|
141
|
-
["ops_", "dsh-ops"]
|
|
163
|
+
["ops_", "dsh-ops"],
|
|
164
|
+
["vision_", "dsh-vision-router"],
|
|
165
|
+
["univer_", "dsh-univer-office"]
|
|
142
166
|
];
|
|
143
167
|
/**
|
|
144
168
|
* Single plugin tools that carry no usable prefix.
|
|
@@ -200,6 +224,19 @@ window.__ModuleLoader__.load({
|
|
|
200
224
|
* child session seeds its preset from `permissionPresets.current(parent.session)`,
|
|
201
225
|
* and this bypass answers `'custom'` for an allowlisted call in flight — releasing
|
|
202
226
|
* them would hand the child no `auto` preset at all, i.e. no review.
|
|
227
|
+
* Beyond that rule sit the entries the user explicitly released (2026-10-24:
|
|
228
|
+
* goal/schedule/terminal creation; 2026-11-20: the vision model calls, the
|
|
229
|
+
* mineru document_parse task, todo/goal updates, and the prime-memory write
|
|
230
|
+
* tools). These do have side effects — vision calls spend the configured
|
|
231
|
+
* backend's quota and send image content to it, document_parse spawns a parse
|
|
232
|
+
* task, the memory tools mutate the memory store — but everything they enable
|
|
233
|
+
* stays inside the same session and auto preset. Releasing them only skips the
|
|
234
|
+
* reviewer; it grants no permission the preset did not already grant. The
|
|
235
|
+
* delegation spawns stay excluded regardless: a child session seeds its preset
|
|
236
|
+
* from the parent's in-flight bypass answer, so releasing them would strip the
|
|
237
|
+
* child of the auto preset entirely (see DELEGATION_SPAWNS in the tests).
|
|
238
|
+
* schedule_edit was reviewed on 2026-11-20 and deliberately kept OUT: it can
|
|
239
|
+
* modify or delete tasks other sessions created.
|
|
203
240
|
*/
|
|
204
241
|
const DEFAULT_READ_ONLY_TOOLS = [
|
|
205
242
|
"read",
|
|
@@ -284,6 +321,48 @@ window.__ModuleLoader__.load({
|
|
|
284
321
|
"mcp__wincu__windows_computer_use_tools",
|
|
285
322
|
"mcp__wincu__windows_computer_use_wait",
|
|
286
323
|
"mcp__wincu__windows_computer_use_wait_for",
|
|
324
|
+
"schedule_view",
|
|
325
|
+
"vision_colors",
|
|
326
|
+
"vision_crop",
|
|
327
|
+
"vision_trace",
|
|
328
|
+
"vision_extract_foreground",
|
|
329
|
+
"vision_materialize",
|
|
330
|
+
"vision_pixel_diff",
|
|
331
|
+
"vision_html_screenshot",
|
|
332
|
+
"vision_present",
|
|
333
|
+
"univer_status",
|
|
334
|
+
"univer_inspect",
|
|
335
|
+
"univer_lint",
|
|
336
|
+
"univer_api",
|
|
337
|
+
"mcp__mineru-mcp__get_task_progress",
|
|
338
|
+
"mcp__mineru-mcp__get_recent_logs",
|
|
339
|
+
"mcp__mineru-mcp__wait_for_task",
|
|
340
|
+
"vision_describe",
|
|
341
|
+
"vision_bootstrap",
|
|
342
|
+
"vision_ground",
|
|
343
|
+
"vision_detect",
|
|
344
|
+
"vision_ocr",
|
|
345
|
+
"vision_long_screenshot_ocr",
|
|
346
|
+
"mcp__mineru-mcp__document_parse",
|
|
347
|
+
"todo_write",
|
|
348
|
+
"update_goal",
|
|
349
|
+
"list_subagent_models",
|
|
350
|
+
"memory_write",
|
|
351
|
+
"memory_resolve_conflict",
|
|
352
|
+
"memory_room_admin",
|
|
353
|
+
"memory_room_review",
|
|
354
|
+
"memory_ruminate",
|
|
355
|
+
"memory_skill_archive",
|
|
356
|
+
"memory_skill_pin",
|
|
357
|
+
"memory_slot_close",
|
|
358
|
+
"memory_slot_write",
|
|
359
|
+
"memory_add",
|
|
360
|
+
"memory_update",
|
|
361
|
+
"memory_delete",
|
|
362
|
+
"memory_import",
|
|
363
|
+
"memory_migrate_relation",
|
|
364
|
+
"memory_reproject",
|
|
365
|
+
"memory_ruminate_cancel",
|
|
287
366
|
"sessions_list__*",
|
|
288
367
|
"bing_search__*"
|
|
289
368
|
];
|
|
@@ -472,7 +551,13 @@ window.__ModuleLoader__.load({
|
|
|
472
551
|
/** Distillation route handed to the memory plugin when it follows its own default. */
|
|
473
552
|
const MEMORY_SETTINGS_FIELDS = Object.freeze({
|
|
474
553
|
provider: "memoryProvider",
|
|
475
|
-
model: "memoryModel"
|
|
554
|
+
model: "memoryModel",
|
|
555
|
+
reasoningEffort: "memoryReasoningEffort"
|
|
556
|
+
});
|
|
557
|
+
/** Vision backend route handed to dsh-vision-router when it follows its own chain. */
|
|
558
|
+
const VISION_SETTINGS_FIELDS = Object.freeze({
|
|
559
|
+
provider: "visionProvider",
|
|
560
|
+
model: "visionModel"
|
|
476
561
|
});
|
|
477
562
|
function deriveSubagentSettings(settings) {
|
|
478
563
|
return {
|
|
@@ -515,7 +600,14 @@ window.__ModuleLoader__.load({
|
|
|
515
600
|
function deriveMemorySettings(settings) {
|
|
516
601
|
return {
|
|
517
602
|
...settings.memoryProvider === void 0 ? {} : { provider: settings.memoryProvider },
|
|
518
|
-
...settings.memoryModel === void 0 ? {} : { model: settings.memoryModel }
|
|
603
|
+
...settings.memoryModel === void 0 ? {} : { model: settings.memoryModel },
|
|
604
|
+
...settings.memoryReasoningEffort === void 0 ? {} : { reasoningEffort: settings.memoryReasoningEffort }
|
|
605
|
+
};
|
|
606
|
+
}
|
|
607
|
+
function deriveVisionSettings(settings) {
|
|
608
|
+
return {
|
|
609
|
+
...settings.visionProvider === void 0 ? {} : { provider: settings.visionProvider },
|
|
610
|
+
...settings.visionModel === void 0 ? {} : { model: settings.visionModel }
|
|
519
611
|
};
|
|
520
612
|
}
|
|
521
613
|
/** Whether both fields of a model route form a complete pair; an incomplete pair stays off. */
|
|
@@ -544,11 +636,23 @@ window.__ModuleLoader__.load({
|
|
|
544
636
|
skipped: count(row.skipped)
|
|
545
637
|
};
|
|
546
638
|
})() : void 0;
|
|
639
|
+
const adapterRow = (input) => {
|
|
640
|
+
if (input === null || typeof input !== "object" || Array.isArray(input)) return void 0;
|
|
641
|
+
const row = input;
|
|
642
|
+
return {
|
|
643
|
+
installed: row.installed === true,
|
|
644
|
+
route: route(row.route),
|
|
645
|
+
routeSkipped: route(row.routeSkipped),
|
|
646
|
+
replays: count(row.replays)
|
|
647
|
+
};
|
|
648
|
+
};
|
|
547
649
|
return {
|
|
548
650
|
held: status.held === true,
|
|
549
651
|
allowedCalls: count(status.allowedCalls),
|
|
550
652
|
skippedReadOnly: count(status.skippedReadOnly),
|
|
551
|
-
automode
|
|
653
|
+
automode,
|
|
654
|
+
primeMemory: adapterRow(status.primeMemory),
|
|
655
|
+
visionRouter: adapterRow(status.visionRouter)
|
|
552
656
|
};
|
|
553
657
|
}
|
|
554
658
|
/**
|
|
@@ -752,7 +856,10 @@ window.__ModuleLoader__.load({
|
|
|
752
856
|
"titleProvider",
|
|
753
857
|
"titleModel",
|
|
754
858
|
"memoryProvider",
|
|
755
|
-
"memoryModel"
|
|
859
|
+
"memoryModel",
|
|
860
|
+
"memoryReasoningEffort",
|
|
861
|
+
"visionProvider",
|
|
862
|
+
"visionModel"
|
|
756
863
|
]);
|
|
757
864
|
/** Own data property, so a literal '__proto__' provider id can never touch a prototype. */
|
|
758
865
|
function setKey(target, key, value) {
|
|
@@ -786,24 +893,60 @@ window.__ModuleLoader__.load({
|
|
|
786
893
|
* shapes are accepted: the stored entry array (keys live in each entry's
|
|
787
894
|
* `provider` field) and a hand-written provider → routes map (keys are the
|
|
788
895
|
* providers). All-empty entries stay: they pin a provider to every default.
|
|
896
|
+
* `-vision` twin groups fold into their base provider (see {@link foldTwinGroups}).
|
|
789
897
|
*/
|
|
790
898
|
function normalizeProviderGroups(raw) {
|
|
791
899
|
const groups = {};
|
|
792
|
-
if (Array.isArray(raw)) {
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
setKey(groups, view.provider, view.group);
|
|
797
|
-
}
|
|
798
|
-
return groups;
|
|
900
|
+
if (Array.isArray(raw)) for (const entry of raw) {
|
|
901
|
+
const view = normalizeEntry(entry);
|
|
902
|
+
if (view === void 0 || view.provider === "") continue;
|
|
903
|
+
setKey(groups, view.provider, view.group);
|
|
799
904
|
}
|
|
800
|
-
if (raw !== null && typeof raw === "object") for (const [key, value] of Object.entries(raw)) {
|
|
905
|
+
else if (raw !== null && typeof raw === "object") for (const [key, value] of Object.entries(raw)) {
|
|
801
906
|
if (key.trim() === "") continue;
|
|
802
907
|
const view = normalizeEntry(value);
|
|
803
908
|
if (view === void 0) continue;
|
|
804
909
|
setKey(groups, key, view.group);
|
|
805
910
|
}
|
|
806
|
-
return groups;
|
|
911
|
+
return foldTwinGroups(groups);
|
|
912
|
+
}
|
|
913
|
+
/**
|
|
914
|
+
* The base provider id a dsh-vision-router twin route resolves to.
|
|
915
|
+
*
|
|
916
|
+
* dsh-vision-router materializes a `${provider}-vision` twin route for every
|
|
917
|
+
* enabled text provider (its own sync skips ids ending in `-vision`), and a
|
|
918
|
+
* session with vision on runs on that twin. Groups are keyed by the base
|
|
919
|
+
* provider: one group per provider whether vision is on or off.
|
|
920
|
+
* @param provider - the provider id a session or the deployment default names.
|
|
921
|
+
* @returns the base id (one trailing `-vision` stripped when the rest is non-empty), else the input unchanged.
|
|
922
|
+
*/
|
|
923
|
+
function canonicalGroupProvider(provider) {
|
|
924
|
+
if (!provider.endsWith("-vision")) return provider;
|
|
925
|
+
const base = provider.slice(0, -7);
|
|
926
|
+
return base === "" ? provider : base;
|
|
927
|
+
}
|
|
928
|
+
/**
|
|
929
|
+
* Fold `-vision` twin groups into their base provider (read-side merge).
|
|
930
|
+
*
|
|
931
|
+
* A session with vision on keys its provider as `${base}-vision`, so a group
|
|
932
|
+
* saved under that twin id belongs to the same provider. The base entry wins
|
|
933
|
+
* on conflicts, the twin fills only fields the base leaves empty, and a twin
|
|
934
|
+
* without a base entry is rekeyed to its base. Storage converges on the next
|
|
935
|
+
* save, which re-emits entries from this normalized view.
|
|
936
|
+
*/
|
|
937
|
+
function foldTwinGroups(groups) {
|
|
938
|
+
const source = new Map(Object.entries(groups).map(([key, value]) => [key, value]));
|
|
939
|
+
for (const [key, twin] of source) {
|
|
940
|
+
const base = canonicalGroupProvider(key);
|
|
941
|
+
if (base === key) continue;
|
|
942
|
+
const existing = source.get(base);
|
|
943
|
+
if (existing === void 0) source.set(base, twin);
|
|
944
|
+
else for (const field of ROUTE_FIELDS) if (existing[field] === void 0 && twin[field] !== void 0) existing[field] = twin[field];
|
|
945
|
+
source.delete(key);
|
|
946
|
+
}
|
|
947
|
+
const folded = {};
|
|
948
|
+
for (const [key, value] of source) setKey(folded, key, value);
|
|
949
|
+
return folded;
|
|
807
950
|
}
|
|
808
951
|
/**
|
|
809
952
|
* The saved group for a provider.
|
|
@@ -829,7 +972,10 @@ window.__ModuleLoader__.load({
|
|
|
829
972
|
titleProvider: group.titleProvider ?? "",
|
|
830
973
|
titleModel: group.titleModel ?? "",
|
|
831
974
|
memoryProvider: group.memoryProvider ?? "",
|
|
832
|
-
memoryModel: group.memoryModel ?? ""
|
|
975
|
+
memoryModel: group.memoryModel ?? "",
|
|
976
|
+
memoryReasoningEffort: group.memoryReasoningEffort ?? "",
|
|
977
|
+
visionProvider: group.visionProvider ?? "",
|
|
978
|
+
visionModel: group.visionModel ?? ""
|
|
833
979
|
};
|
|
834
980
|
}
|
|
835
981
|
/**
|
|
@@ -869,6 +1015,10 @@ window.__ModuleLoader__.load({
|
|
|
869
1015
|
memory: {
|
|
870
1016
|
provider: "memoryProvider",
|
|
871
1017
|
model: "memoryModel"
|
|
1018
|
+
},
|
|
1019
|
+
vision: {
|
|
1020
|
+
provider: "visionProvider",
|
|
1021
|
+
model: "visionModel"
|
|
872
1022
|
}
|
|
873
1023
|
});
|
|
874
1024
|
/** A non-blank string; blank values behave exactly like an absent field. */
|
|
@@ -1148,10 +1298,18 @@ window.__ModuleLoader__.load({
|
|
|
1148
1298
|
* @returns catalog choices first (original order), then the missing providers.
|
|
1149
1299
|
*/
|
|
1150
1300
|
function groupProviderChoices(groups, configured, current) {
|
|
1151
|
-
const
|
|
1301
|
+
const listed = deriveRouteChoices(groups, current === void 0 || current.trim() === "" ? void 0 : { provider: current }).providers;
|
|
1302
|
+
const ids = new Set(listed.map((choice) => choice.id));
|
|
1303
|
+
const choices = listed.filter((choice) => {
|
|
1304
|
+
if (choice.id === current) return true;
|
|
1305
|
+
const base = canonicalGroupProvider(choice.id);
|
|
1306
|
+
return base === choice.id || !ids.has(base);
|
|
1307
|
+
});
|
|
1152
1308
|
const seen = new Set(choices.map((choice) => choice.id));
|
|
1153
1309
|
for (const provider of configured) {
|
|
1154
1310
|
if (provider.trim() === "" || seen.has(provider)) continue;
|
|
1311
|
+
const base = canonicalGroupProvider(provider);
|
|
1312
|
+
if (base !== provider && configured.includes(base)) continue;
|
|
1155
1313
|
seen.add(provider);
|
|
1156
1314
|
choices.push({
|
|
1157
1315
|
id: provider,
|
|
@@ -1517,6 +1675,23 @@ window.__ModuleLoader__.load({
|
|
|
1517
1675
|
strokeLinecap: "round"
|
|
1518
1676
|
})]
|
|
1519
1677
|
});
|
|
1678
|
+
if (kind === "vision") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
1679
|
+
width: "18",
|
|
1680
|
+
height: "18",
|
|
1681
|
+
viewBox: "0 0 18 18",
|
|
1682
|
+
fill: "none",
|
|
1683
|
+
"aria-hidden": "true",
|
|
1684
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
1685
|
+
d: "M9 4.5C5.9 4.5 3.6 6.7 2.5 9c1.1 2.3 3.4 4.5 6.5 4.5S14.4 11.3 15.5 9C14.4 6.7 12.1 4.5 9 4.5Z",
|
|
1686
|
+
stroke: "currentColor",
|
|
1687
|
+
strokeLinejoin: "round"
|
|
1688
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
|
|
1689
|
+
cx: "9",
|
|
1690
|
+
cy: "9",
|
|
1691
|
+
r: "2",
|
|
1692
|
+
stroke: "currentColor"
|
|
1693
|
+
})]
|
|
1694
|
+
});
|
|
1520
1695
|
return null;
|
|
1521
1696
|
}
|
|
1522
1697
|
function RouteCard({ title, summary, hint, note, icon, open, onToggle, disabled = false, badge, badgeWarn = false, trailing, expandable = true, children }) {
|
|
@@ -1596,7 +1771,7 @@ window.__ModuleLoader__.load({
|
|
|
1596
1771
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("i", {})
|
|
1597
1772
|
});
|
|
1598
1773
|
}
|
|
1599
|
-
function Field({ label, value, disabled, choices, onChange, full = false }) {
|
|
1774
|
+
function Field({ label, value, disabled, choices, onChange, full = false, emptyLabel = "—" }) {
|
|
1600
1775
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
1601
1776
|
className: cx(ModelSwitchSettings_module_css_default.field, full && ModelSwitchSettings_module_css_default.fieldFull),
|
|
1602
1777
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
@@ -1611,7 +1786,7 @@ window.__ModuleLoader__.load({
|
|
|
1611
1786
|
},
|
|
1612
1787
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1613
1788
|
value: "",
|
|
1614
|
-
children:
|
|
1789
|
+
children: emptyLabel
|
|
1615
1790
|
}), choices.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("option", {
|
|
1616
1791
|
value: option.id,
|
|
1617
1792
|
children: [option.name, option.unavailable === true ? " ⚠" : ""]
|
|
@@ -1730,6 +1905,7 @@ window.__ModuleLoader__.load({
|
|
|
1730
1905
|
const compaction = props.useCompactionSettings((value) => value);
|
|
1731
1906
|
const sessionTitle = props.useTitleSettings((value) => value);
|
|
1732
1907
|
const memory = props.useMemorySettings((value) => value);
|
|
1908
|
+
const vision = props.useVisionSettings((value) => value);
|
|
1733
1909
|
const switchSettings = props.useSwitchSettings((value) => value);
|
|
1734
1910
|
const [open, setOpen] = (0, react.useState)();
|
|
1735
1911
|
const [subagentDraft, setSubagentDraft, resetSubagent] = useDraft(subagent);
|
|
@@ -1739,6 +1915,7 @@ window.__ModuleLoader__.load({
|
|
|
1739
1915
|
const [compactionDraft, setCompactionDraft, resetCompaction] = useDraft(compaction);
|
|
1740
1916
|
const [titleDraft, setTitleDraft, resetTitle] = useDraft(sessionTitle);
|
|
1741
1917
|
const [memoryDraft, setMemoryDraft, resetMemory] = useDraft(memory);
|
|
1918
|
+
const [visionDraft, setVisionDraft, resetVision] = useDraft(vision);
|
|
1742
1919
|
const [busy, setBusy] = (0, react.useState)();
|
|
1743
1920
|
const [message, setMessage] = (0, react.useState)();
|
|
1744
1921
|
const [groupProvider, setGroupProvider] = (0, react.useState)("");
|
|
@@ -1791,6 +1968,7 @@ window.__ModuleLoader__.load({
|
|
|
1791
1968
|
compaction: capabilityGroupPins(providerGroups, "compaction"),
|
|
1792
1969
|
title: capabilityGroupPins(providerGroups, "title"),
|
|
1793
1970
|
memory: capabilityGroupPins(providerGroups, "memory"),
|
|
1971
|
+
vision: capabilityGroupPins(providerGroups, "vision"),
|
|
1794
1972
|
subagent: capabilityGroupPins(providerGroups, "subagent")
|
|
1795
1973
|
};
|
|
1796
1974
|
/**
|
|
@@ -1818,6 +1996,15 @@ window.__ModuleLoader__.load({
|
|
|
1818
1996
|
model: subagent.value.model ?? "",
|
|
1819
1997
|
reasoningEffort: subagent.value.reasoningEffort
|
|
1820
1998
|
} : void 0;
|
|
1999
|
+
const memoryPin = memory.value !== void 0 && routePairConfigured(memory.value) ? {
|
|
2000
|
+
provider: memory.value.provider ?? "",
|
|
2001
|
+
model: memory.value.model ?? "",
|
|
2002
|
+
reasoningEffort: memory.value.reasoningEffort
|
|
2003
|
+
} : void 0;
|
|
2004
|
+
const visionPin = vision.value !== void 0 && routePairConfigured(vision.value) ? {
|
|
2005
|
+
provider: vision.value.provider ?? "",
|
|
2006
|
+
model: vision.value.model ?? ""
|
|
2007
|
+
} : void 0;
|
|
1821
2008
|
return {
|
|
1822
2009
|
...compactionPin === void 0 ? {} : {
|
|
1823
2010
|
compactProvider: compactionPin.provider,
|
|
@@ -1835,6 +2022,15 @@ window.__ModuleLoader__.load({
|
|
|
1835
2022
|
subagentProvider: fixedSubagent.provider,
|
|
1836
2023
|
subagentModel: fixedSubagent.model,
|
|
1837
2024
|
...fixedSubagent.reasoningEffort === void 0 ? {} : { subagentReasoningEffort: fixedSubagent.reasoningEffort }
|
|
2025
|
+
},
|
|
2026
|
+
...memoryPin === void 0 ? {} : {
|
|
2027
|
+
memoryProvider: memoryPin.provider,
|
|
2028
|
+
memoryModel: memoryPin.model,
|
|
2029
|
+
...memoryPin.reasoningEffort === void 0 || memoryPin.reasoningEffort === "" ? {} : { memoryReasoningEffort: memoryPin.reasoningEffort }
|
|
2030
|
+
},
|
|
2031
|
+
...visionPin === void 0 ? {} : {
|
|
2032
|
+
visionProvider: visionPin.provider,
|
|
2033
|
+
visionModel: visionPin.model
|
|
1838
2034
|
}
|
|
1839
2035
|
};
|
|
1840
2036
|
};
|
|
@@ -1923,6 +2119,20 @@ window.__ModuleLoader__.load({
|
|
|
1923
2119
|
const compactionOn = routePairConfigured(compaction.value);
|
|
1924
2120
|
const titleChoices = deriveRouteChoices(groups, titleDraft);
|
|
1925
2121
|
const memoryChoices = deriveRouteChoices(groups, memoryDraft);
|
|
2122
|
+
const visionChoices = deriveRouteChoices(groups, visionDraft);
|
|
2123
|
+
const memoryCatalogModel = matchCatalogModel(groups.find((group) => group.id === memoryDraft?.provider)?.models ?? [], memoryDraft?.model);
|
|
2124
|
+
const memoryEfforts = (() => {
|
|
2125
|
+
const efforts = (memoryCatalogModel?.model.reasoning?.efforts ?? []).map((effort) => ({
|
|
2126
|
+
id: effort.id,
|
|
2127
|
+
name: effort.name
|
|
2128
|
+
}));
|
|
2129
|
+
const current = memoryDraft?.reasoningEffort;
|
|
2130
|
+
if (current !== void 0 && current !== "" && !efforts.some((option) => option.id === current)) efforts.push({
|
|
2131
|
+
id: current,
|
|
2132
|
+
name: current
|
|
2133
|
+
});
|
|
2134
|
+
return efforts;
|
|
2135
|
+
})();
|
|
1926
2136
|
const titleOn = routePairConfigured(sessionTitle.value);
|
|
1927
2137
|
const catalogSeed = firstCatalogRoute(groups);
|
|
1928
2138
|
const synced = [
|
|
@@ -2205,12 +2415,27 @@ window.__ModuleLoader__.load({
|
|
|
2205
2415
|
const groupAutoReview = groupDraft === void 0 ? void 0 : draftPair(groupDraft.autoReviewProvider, groupDraft.autoReviewModel);
|
|
2206
2416
|
const groupTitle = groupDraft === void 0 ? void 0 : draftPair(groupDraft.titleProvider, groupDraft.titleModel);
|
|
2207
2417
|
const groupMemory = groupDraft === void 0 ? void 0 : draftPair(groupDraft.memoryProvider, groupDraft.memoryModel);
|
|
2418
|
+
const groupVision = groupDraft === void 0 ? void 0 : draftPair(groupDraft.visionProvider, groupDraft.visionModel);
|
|
2208
2419
|
const groupSubagent = groupDraft === void 0 ? void 0 : draftPair(groupDraft.subagentProvider, groupDraft.subagentModel);
|
|
2209
2420
|
const groupCompactionChoices = deriveRouteChoices(groups, groupCompaction);
|
|
2210
2421
|
const groupAutoReviewChoices = deriveRouteChoices(groups, groupAutoReview);
|
|
2211
2422
|
const groupTitleChoices = deriveRouteChoices(groups, groupTitle);
|
|
2212
2423
|
const groupMemoryChoices = deriveRouteChoices(groups, groupMemory);
|
|
2424
|
+
const groupVisionChoices = deriveRouteChoices(groups, groupVision);
|
|
2213
2425
|
const groupSubagentChoices = deriveRouteChoices(groups, groupSubagent);
|
|
2426
|
+
const groupMemoryCatalogModel = matchCatalogModel(groups.find((group) => group.id === groupDraft?.memoryProvider)?.models ?? [], groupDraft?.memoryModel ?? "");
|
|
2427
|
+
const groupMemoryEfforts = (() => {
|
|
2428
|
+
const efforts = (groupMemoryCatalogModel?.model.reasoning?.efforts ?? []).map((effort) => ({
|
|
2429
|
+
id: effort.id,
|
|
2430
|
+
name: effort.name
|
|
2431
|
+
}));
|
|
2432
|
+
const current = groupDraft?.memoryReasoningEffort;
|
|
2433
|
+
if (current !== void 0 && current !== "" && !efforts.some((option) => option.id === current)) efforts.push({
|
|
2434
|
+
id: current,
|
|
2435
|
+
name: current
|
|
2436
|
+
});
|
|
2437
|
+
return efforts;
|
|
2438
|
+
})();
|
|
2214
2439
|
const groupSubMatched = matchCatalogModel(groups.find((group) => group.id === (groupDraft?.subagentProvider ?? ""))?.models ?? [], groupDraft?.subagentModel ?? "");
|
|
2215
2440
|
const groupSubEfforts = (() => {
|
|
2216
2441
|
const efforts = (groupSubMatched?.model.reasoning?.efforts ?? []).map((effort) => ({
|
|
@@ -2266,10 +2491,22 @@ window.__ModuleLoader__.load({
|
|
|
2266
2491
|
const provider = active.memoryProvider ?? catalogSeed?.provider;
|
|
2267
2492
|
const model = active.memoryModel ?? catalogSeed?.model;
|
|
2268
2493
|
if (provider === void 0 || model === void 0) return draft;
|
|
2494
|
+
const effort = active.memoryReasoningEffort;
|
|
2269
2495
|
return {
|
|
2270
2496
|
...draft,
|
|
2271
2497
|
memoryProvider: provider,
|
|
2272
|
-
memoryModel: model
|
|
2498
|
+
memoryModel: model,
|
|
2499
|
+
...effort === void 0 || effort === "" ? {} : { memoryReasoningEffort: effort }
|
|
2500
|
+
};
|
|
2501
|
+
}
|
|
2502
|
+
if (kind === "vision") {
|
|
2503
|
+
const provider = active.visionProvider ?? catalogSeed?.provider;
|
|
2504
|
+
const model = active.visionModel ?? catalogSeed?.model;
|
|
2505
|
+
if (provider === void 0 || model === void 0) return draft;
|
|
2506
|
+
return {
|
|
2507
|
+
...draft,
|
|
2508
|
+
visionProvider: provider,
|
|
2509
|
+
visionModel: model
|
|
2273
2510
|
};
|
|
2274
2511
|
}
|
|
2275
2512
|
const provider = active.subagentProvider ?? catalogSeed?.provider;
|
|
@@ -2305,7 +2542,13 @@ window.__ModuleLoader__.load({
|
|
|
2305
2542
|
if (kind === "memory") return {
|
|
2306
2543
|
...draft,
|
|
2307
2544
|
memoryProvider: "",
|
|
2308
|
-
memoryModel: ""
|
|
2545
|
+
memoryModel: "",
|
|
2546
|
+
memoryReasoningEffort: ""
|
|
2547
|
+
};
|
|
2548
|
+
if (kind === "vision") return {
|
|
2549
|
+
...draft,
|
|
2550
|
+
visionProvider: "",
|
|
2551
|
+
visionModel: ""
|
|
2309
2552
|
};
|
|
2310
2553
|
return {
|
|
2311
2554
|
...draft,
|
|
@@ -2323,6 +2566,32 @@ window.__ModuleLoader__.load({
|
|
|
2323
2566
|
if (groupProvider === "") return;
|
|
2324
2567
|
run("providerGroups", () => props.saveProviderGroup(groupProvider, void 0));
|
|
2325
2568
|
};
|
|
2569
|
+
/**
|
|
2570
|
+
* The memory adapter status line, from the same scan as the vision one: the
|
|
2571
|
+
* slow-boot case (live seam unreachable) is now visible without log diving.
|
|
2572
|
+
*/
|
|
2573
|
+
const memoryStatusRow = reviewStatus?.primeMemory;
|
|
2574
|
+
const memoryAdapterStatus = () => {
|
|
2575
|
+
if (memoryStatusRow === void 0) return "";
|
|
2576
|
+
if (memoryStatusRow.installed && memoryStatusRow.route !== void 0) return props.t("memoryLinked").replace("{route}", memoryStatusRow.route);
|
|
2577
|
+
if (memoryStatusRow.routeSkipped === "live-unavailable") return props.t("memoryLinkedUnavailable");
|
|
2578
|
+
if (memoryStatusRow.routeSkipped === "live-rejected" || memoryStatusRow.routeSkipped === "no-seam" || memoryStatusRow.routeSkipped === "no-service") return props.t("memoryLinkedRejected");
|
|
2579
|
+
if (memoryStatusRow.routeSkipped === "user-set") return props.t("memoryLinkedUserSet");
|
|
2580
|
+
if (memoryStatusRow.routeSkipped === "no-row") return props.t("memoryLinkedMissing");
|
|
2581
|
+
return props.t("memoryLinkedUnset");
|
|
2582
|
+
};
|
|
2583
|
+
/**
|
|
2584
|
+
* The vision adapter status line: what the host-side compat row last did.
|
|
2585
|
+
* Rendered only when a tool scan has delivered the live adapter state.
|
|
2586
|
+
*/
|
|
2587
|
+
const visionStatusRow = reviewStatus?.visionRouter;
|
|
2588
|
+
const visionAdapterStatus = () => {
|
|
2589
|
+
if (visionStatusRow === void 0) return "";
|
|
2590
|
+
if (visionStatusRow.installed && visionStatusRow.route !== void 0) return props.t("visionLinked").replace("{route}", visionStatusRow.route);
|
|
2591
|
+
if (visionStatusRow.routeSkipped === "no-row") return props.t("visionLinkedMissing");
|
|
2592
|
+
if (visionStatusRow.routeSkipped === "rejected") return props.t("visionLinkedRejected");
|
|
2593
|
+
return props.t("visionLinkedUnset");
|
|
2594
|
+
};
|
|
2326
2595
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("main", {
|
|
2327
2596
|
className: ModelSwitchSettings_module_css_default.section,
|
|
2328
2597
|
children: [
|
|
@@ -2806,28 +3075,116 @@ window.__ModuleLoader__.load({
|
|
|
2806
3075
|
className: ModelSwitchSettings_module_css_default.hint,
|
|
2807
3076
|
children: props.t("memoryRouteHelp")
|
|
2808
3077
|
}),
|
|
3078
|
+
reviewStatus?.primeMemory === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3079
|
+
className: ModelSwitchSettings_module_css_default.hint,
|
|
3080
|
+
children: memoryAdapterStatus()
|
|
3081
|
+
}),
|
|
3082
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3083
|
+
className: ModelSwitchSettings_module_css_default.formGrid,
|
|
3084
|
+
children: [
|
|
3085
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
|
|
3086
|
+
label: props.t("provider"),
|
|
3087
|
+
value: memoryDraft.provider ?? "",
|
|
3088
|
+
disabled: busy !== void 0 || !memory.writable,
|
|
3089
|
+
choices: memoryChoices.providers,
|
|
3090
|
+
onChange: (provider) => {
|
|
3091
|
+
const first = groups.find((group) => group.id === provider)?.models[0];
|
|
3092
|
+
setMemoryDraft({
|
|
3093
|
+
provider,
|
|
3094
|
+
...first === void 0 ? {} : { model: first.id }
|
|
3095
|
+
});
|
|
3096
|
+
}
|
|
3097
|
+
}),
|
|
3098
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
|
|
3099
|
+
label: props.t("model"),
|
|
3100
|
+
value: memoryDraft.model ?? "",
|
|
3101
|
+
disabled: busy !== void 0 || !memory.writable,
|
|
3102
|
+
choices: memoryChoices.models,
|
|
3103
|
+
onChange: (model) => {
|
|
3104
|
+
setMemoryDraft({
|
|
3105
|
+
...memoryDraft,
|
|
3106
|
+
model
|
|
3107
|
+
});
|
|
3108
|
+
}
|
|
3109
|
+
}),
|
|
3110
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
|
|
3111
|
+
label: props.t("memoryEffort"),
|
|
3112
|
+
value: memoryDraft.reasoningEffort ?? "",
|
|
3113
|
+
disabled: busy !== void 0 || !memory.writable,
|
|
3114
|
+
choices: memoryEfforts,
|
|
3115
|
+
emptyLabel: props.t("effortAuto"),
|
|
3116
|
+
onChange: (effort) => {
|
|
3117
|
+
setMemoryDraft({
|
|
3118
|
+
...memoryDraft,
|
|
3119
|
+
reasoningEffort: effort
|
|
3120
|
+
});
|
|
3121
|
+
}
|
|
3122
|
+
})
|
|
3123
|
+
]
|
|
3124
|
+
}),
|
|
3125
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Actions, {
|
|
3126
|
+
t: props.t,
|
|
3127
|
+
busy: busy === "memory",
|
|
3128
|
+
disabled: busy !== void 0 || !memory.writable,
|
|
3129
|
+
...message?.route === "memory" ? { message: message.text } : {},
|
|
3130
|
+
onCancel: () => {
|
|
3131
|
+
resetMemory();
|
|
3132
|
+
setMessage(void 0);
|
|
3133
|
+
},
|
|
3134
|
+
onSave: () => {
|
|
3135
|
+
const effort = (memoryDraft.reasoningEffort ?? "").trim();
|
|
3136
|
+
run("memory", () => props.saveMemory([...pairOps(memoryDraft), {
|
|
3137
|
+
field: "reasoningEffort",
|
|
3138
|
+
value: effort === "" ? void 0 : effort
|
|
3139
|
+
}]));
|
|
3140
|
+
}
|
|
3141
|
+
})
|
|
3142
|
+
] })
|
|
3143
|
+
}),
|
|
3144
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(RouteCard, {
|
|
3145
|
+
title: props.t("vision"),
|
|
3146
|
+
summary: visionDraft === void 0 ? props.t("loading") : routePairConfigured(visionDraft) ? routeName(groups, visionDraft) : props.t("visionFollow"),
|
|
3147
|
+
hint: props.t("visionHelp"),
|
|
3148
|
+
note: groupNote(props.t, groupPins.vision),
|
|
3149
|
+
icon: "vision",
|
|
3150
|
+
open: open === "vision",
|
|
3151
|
+
onToggle: () => {
|
|
3152
|
+
toggle("vision");
|
|
3153
|
+
},
|
|
3154
|
+
children: visionDraft === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3155
|
+
className: ModelSwitchSettings_module_css_default.hint,
|
|
3156
|
+
children: props.t("loading")
|
|
3157
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
3158
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3159
|
+
className: ModelSwitchSettings_module_css_default.hint,
|
|
3160
|
+
children: props.t("visionRouteHelp")
|
|
3161
|
+
}),
|
|
3162
|
+
reviewStatus?.visionRouter === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3163
|
+
className: ModelSwitchSettings_module_css_default.hint,
|
|
3164
|
+
children: visionAdapterStatus()
|
|
3165
|
+
}),
|
|
2809
3166
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2810
3167
|
className: ModelSwitchSettings_module_css_default.formGrid,
|
|
2811
3168
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
|
|
2812
3169
|
label: props.t("provider"),
|
|
2813
|
-
value:
|
|
2814
|
-
disabled: busy !== void 0 || !
|
|
2815
|
-
choices:
|
|
3170
|
+
value: visionDraft.provider ?? "",
|
|
3171
|
+
disabled: busy !== void 0 || !vision.writable,
|
|
3172
|
+
choices: visionChoices.providers,
|
|
2816
3173
|
onChange: (provider) => {
|
|
2817
3174
|
const first = groups.find((group) => group.id === provider)?.models[0];
|
|
2818
|
-
|
|
3175
|
+
setVisionDraft({
|
|
2819
3176
|
provider,
|
|
2820
3177
|
...first === void 0 ? {} : { model: first.id }
|
|
2821
3178
|
});
|
|
2822
3179
|
}
|
|
2823
3180
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
|
|
2824
3181
|
label: props.t("model"),
|
|
2825
|
-
value:
|
|
2826
|
-
disabled: busy !== void 0 || !
|
|
2827
|
-
choices:
|
|
3182
|
+
value: visionDraft.model ?? "",
|
|
3183
|
+
disabled: busy !== void 0 || !vision.writable,
|
|
3184
|
+
choices: visionChoices.models,
|
|
2828
3185
|
onChange: (model) => {
|
|
2829
|
-
|
|
2830
|
-
...
|
|
3186
|
+
setVisionDraft({
|
|
3187
|
+
...visionDraft,
|
|
2831
3188
|
model
|
|
2832
3189
|
});
|
|
2833
3190
|
}
|
|
@@ -2835,15 +3192,15 @@ window.__ModuleLoader__.load({
|
|
|
2835
3192
|
}),
|
|
2836
3193
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Actions, {
|
|
2837
3194
|
t: props.t,
|
|
2838
|
-
busy: busy === "
|
|
2839
|
-
disabled: busy !== void 0 || !
|
|
2840
|
-
...message?.route === "
|
|
3195
|
+
busy: busy === "vision",
|
|
3196
|
+
disabled: busy !== void 0 || !vision.writable,
|
|
3197
|
+
...message?.route === "vision" ? { message: message.text } : {},
|
|
2841
3198
|
onCancel: () => {
|
|
2842
|
-
|
|
3199
|
+
resetVision();
|
|
2843
3200
|
setMessage(void 0);
|
|
2844
3201
|
},
|
|
2845
3202
|
onSave: () => {
|
|
2846
|
-
run("
|
|
3203
|
+
run("vision", () => props.saveCapability("vision", pairOps(visionDraft)));
|
|
2847
3204
|
}
|
|
2848
3205
|
})
|
|
2849
3206
|
] })
|
|
@@ -3224,29 +3581,93 @@ window.__ModuleLoader__.load({
|
|
|
3224
3581
|
}
|
|
3225
3582
|
})]
|
|
3226
3583
|
}), groupMemory === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3584
|
+
className: ModelSwitchSettings_module_css_default.formGrid,
|
|
3585
|
+
children: [
|
|
3586
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
|
|
3587
|
+
label: props.t("provider"),
|
|
3588
|
+
value: groupMemory.provider,
|
|
3589
|
+
disabled: groupControlsDisabled,
|
|
3590
|
+
choices: groupMemoryChoices.providers,
|
|
3591
|
+
onChange: (provider) => {
|
|
3592
|
+
const first = groups.find((item) => item.id === provider)?.models[0];
|
|
3593
|
+
setGroupDraft((draft) => draft === void 0 ? draft : {
|
|
3594
|
+
...draft,
|
|
3595
|
+
memoryProvider: provider,
|
|
3596
|
+
memoryModel: first?.id ?? ""
|
|
3597
|
+
});
|
|
3598
|
+
}
|
|
3599
|
+
}),
|
|
3600
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
|
|
3601
|
+
label: props.t("model"),
|
|
3602
|
+
value: groupMemory.model,
|
|
3603
|
+
disabled: groupControlsDisabled,
|
|
3604
|
+
choices: groupMemoryChoices.models,
|
|
3605
|
+
onChange: (model) => {
|
|
3606
|
+
setGroupDraft((draft) => draft === void 0 ? draft : {
|
|
3607
|
+
...draft,
|
|
3608
|
+
memoryModel: model
|
|
3609
|
+
});
|
|
3610
|
+
}
|
|
3611
|
+
}),
|
|
3612
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
|
|
3613
|
+
label: props.t("memoryEffort"),
|
|
3614
|
+
value: groupDraft.memoryReasoningEffort ?? "",
|
|
3615
|
+
disabled: groupControlsDisabled,
|
|
3616
|
+
choices: groupMemoryEfforts,
|
|
3617
|
+
emptyLabel: props.t("effortAuto"),
|
|
3618
|
+
onChange: (effort) => {
|
|
3619
|
+
setGroupDraft((draft) => draft === void 0 ? draft : {
|
|
3620
|
+
...draft,
|
|
3621
|
+
memoryReasoningEffort: effort
|
|
3622
|
+
});
|
|
3623
|
+
}
|
|
3624
|
+
})
|
|
3625
|
+
]
|
|
3626
|
+
})] }),
|
|
3627
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3628
|
+
className: ModelSwitchSettings_module_css_default.rowCard,
|
|
3629
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3630
|
+
className: ModelSwitchSettings_module_css_default.rowCopy,
|
|
3631
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3632
|
+
className: ModelSwitchSettings_module_css_default.rowTitle,
|
|
3633
|
+
children: props.t("vision")
|
|
3634
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3635
|
+
className: ModelSwitchSettings_module_css_default.hint,
|
|
3636
|
+
children: groupVision === void 0 ? props.t("visionFollow") : routeName(groups, groupVision)
|
|
3637
|
+
})]
|
|
3638
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InstantSwitch, {
|
|
3639
|
+
checked: groupVision !== void 0,
|
|
3640
|
+
disabled: groupControlsDisabled || groupVision === void 0 && catalogSeed === void 0,
|
|
3641
|
+
label: props.t("vision"),
|
|
3642
|
+
onChange: (value) => {
|
|
3643
|
+
if (value) enableGroupCapability("vision");
|
|
3644
|
+
else disableGroupCapability("vision");
|
|
3645
|
+
}
|
|
3646
|
+
})]
|
|
3647
|
+
}), groupVision === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3227
3648
|
className: ModelSwitchSettings_module_css_default.formGrid,
|
|
3228
3649
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
|
|
3229
3650
|
label: props.t("provider"),
|
|
3230
|
-
value:
|
|
3651
|
+
value: groupVision.provider,
|
|
3231
3652
|
disabled: groupControlsDisabled,
|
|
3232
|
-
choices:
|
|
3653
|
+
choices: groupVisionChoices.providers,
|
|
3233
3654
|
onChange: (provider) => {
|
|
3234
3655
|
const first = groups.find((item) => item.id === provider)?.models[0];
|
|
3235
3656
|
setGroupDraft((draft) => draft === void 0 ? draft : {
|
|
3236
3657
|
...draft,
|
|
3237
|
-
|
|
3238
|
-
|
|
3658
|
+
visionProvider: provider,
|
|
3659
|
+
visionModel: first?.id ?? ""
|
|
3239
3660
|
});
|
|
3240
3661
|
}
|
|
3241
3662
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
|
|
3242
3663
|
label: props.t("model"),
|
|
3243
|
-
value:
|
|
3664
|
+
value: groupVision.model,
|
|
3244
3665
|
disabled: groupControlsDisabled,
|
|
3245
|
-
choices:
|
|
3666
|
+
choices: groupVisionChoices.models,
|
|
3246
3667
|
onChange: (model) => {
|
|
3247
3668
|
setGroupDraft((draft) => draft === void 0 ? draft : {
|
|
3248
3669
|
...draft,
|
|
3249
|
-
|
|
3670
|
+
visionModel: model
|
|
3250
3671
|
});
|
|
3251
3672
|
}
|
|
3252
3673
|
})]
|
|
@@ -3398,11 +3819,27 @@ window.__ModuleLoader__.load({
|
|
|
3398
3819
|
memoryFollow: "跟随记忆插件默认",
|
|
3399
3820
|
memoryHelp: "为 dsh-prime-memory 的记忆蒸馏指定路由;两个字段都留空时跟随该插件自己的默认模型。保存后立即生效(写入该插件自己的 live 设置,运行中的实例会读到);只有反复重试仍写不进去时才回落到静态路由(下次启动生效)。",
|
|
3400
3821
|
memoryRouteHelp: "按部署默认供应商的配置组解析;该供应商没有组时使用这里填写的平面默认。优先写该行的 live 设置(立即生效),不可用时写静态路由(llm.provider/llm.model),启动时生效。",
|
|
3822
|
+
memoryEffort: "思考强度",
|
|
3823
|
+
effortAuto: "自动(跟随模型)",
|
|
3824
|
+
memoryLinked: "已接管蒸馏路由:{route}。",
|
|
3825
|
+
memoryLinkedUnavailable: "记忆插件 live 接口尚未就绪(慢启动;重试预算已加长,改动任意设置可立即触发推送)。",
|
|
3826
|
+
memoryLinkedRejected: "蒸馏路由写入被拒绝,详见宿主日志。",
|
|
3827
|
+
memoryLinkedUserSet: "检测到记忆插件内自行配置的蒸馏路由,本插件让位。",
|
|
3828
|
+
memoryLinkedMissing: "未检测到 dsh-prime-memory 插件。",
|
|
3829
|
+
memoryLinkedUnset: "蒸馏路由未配置,记忆插件使用自身默认。",
|
|
3830
|
+
vision: "识图模型",
|
|
3831
|
+
visionFollow: "跟随 Vision Router 默认",
|
|
3832
|
+
visionHelp: "为 dsh-vision-router 的识图后端链指定首选路由;两个字段都留空时该插件使用自己的后端链。配置后作为链首行写入(其余行保留为降级后备),经官方 ConfigEditor 热生效、无需重启。应选择支持图片输入的模型。",
|
|
3833
|
+
visionRouteHelp: "按部署默认供应商的配置组解析;该供应商没有组时使用这里填写的平面默认。清空两个字段后,识图链路交还 Vision Router 自己管理。",
|
|
3834
|
+
visionLinked: "已接管识图路由:{route}。",
|
|
3835
|
+
visionLinkedMissing: "未检测到 dsh-vision-router 插件;安装后自动接管。",
|
|
3836
|
+
visionLinkedUnset: "识图路由未配置,Vision Router 使用自身后端链。",
|
|
3837
|
+
visionLinkedRejected: "识图后端链写入被拒绝,详见宿主日志。",
|
|
3401
3838
|
providerGroups: "供应商配置组",
|
|
3402
3839
|
providerGroupsCard: "按供应商预设路由",
|
|
3403
3840
|
providerGroupsSummary: "使用该供应商的会话自动采用对应组",
|
|
3404
|
-
providerGroupsHelp: "
|
|
3405
|
-
providerGroupsBodyHelp: "
|
|
3841
|
+
providerGroupsHelp: "为压缩、自动审查、会话命名、记忆蒸馏、识图与子代理按供应商分别保存路由。",
|
|
3842
|
+
providerGroupsBodyHelp: "每个供应商保存一组压缩、自动审查、会话命名、记忆蒸馏、识图与子代理路由。会话自身的供应商与该组一致时,这些能力按组实时解析,未固定项回落到上方卡片里的全局设置。同一供应商开/关视觉(-vision 孪生路由)共用同一个组。切换某个会话的模型不会写入任何全局设置,因此不同供应商的多个会话并行时互不影响,会话中切换供应商后下一次调用也会立即跟随新供应商的配置组。",
|
|
3406
3843
|
providerGroupPick: "选择供应商以编辑其配置组。",
|
|
3407
3844
|
providerGroupDelete: "删除该组",
|
|
3408
3845
|
groupOverridesLabel: "组覆盖:{pins};无组时用上方默认值",
|
|
@@ -3488,11 +3925,27 @@ window.__ModuleLoader__.load({
|
|
|
3488
3925
|
memoryFollow: "Follows the memory plugin default",
|
|
3489
3926
|
memoryHelp: "Pin the distillation route for dsh-prime-memory. Both fields empty keeps that plugin on its own default model. Saved changes apply immediately through that plugin’s own live settings; only after the live attempts keep failing does the static route fall back to the next start.",
|
|
3490
3927
|
memoryRouteHelp: "Resolved from the deployment default provider group; without a group the flat pair here applies. The live settings are preferred (immediate); the static route (llm.provider/llm.model) is the fallback that applies at start.",
|
|
3928
|
+
memoryEffort: "Reasoning effort",
|
|
3929
|
+
effortAuto: "Auto (follow the model)",
|
|
3930
|
+
memoryLinked: "Memory distillation route held: {route}.",
|
|
3931
|
+
memoryLinkedUnavailable: "The memory plugin’s live seam is not up yet (slow boot; the retry budget is now longer, and changing any setting triggers the push immediately).",
|
|
3932
|
+
memoryLinkedRejected: "The distillation-route write was rejected; see the host log.",
|
|
3933
|
+
memoryLinkedUserSet: "A distillation route set inside the memory plugin itself wins; this plugin stands down.",
|
|
3934
|
+
memoryLinkedMissing: "dsh-prime-memory is not installed.",
|
|
3935
|
+
memoryLinkedUnset: "No distillation route configured; the memory plugin keeps its own default.",
|
|
3936
|
+
vision: "Vision model",
|
|
3937
|
+
visionFollow: "Follows the Vision Router default",
|
|
3938
|
+
visionHelp: "Pin the preferred backend for dsh-vision-router’s vision chain; both fields empty keeps that plugin on its own chain. A configured route becomes the chain’s first row (the remaining rows stay as fallbacks), written through the official ConfigEditor and hot-applied without a restart. Pick a model that accepts image input.",
|
|
3939
|
+
visionRouteHelp: "Resolved from the deployment default provider group; without a group the flat pair here applies. Clearing both fields hands the chain back to Vision Router.",
|
|
3940
|
+
visionLinked: "Vision route held: {route}.",
|
|
3941
|
+
visionLinkedMissing: "dsh-vision-router is not installed; the takeover engages once it is.",
|
|
3942
|
+
visionLinkedUnset: "No vision route configured; Vision Router keeps its own chain.",
|
|
3943
|
+
visionLinkedRejected: "The vision backend-chain write was rejected; see the host log.",
|
|
3491
3944
|
providerGroups: "Provider groups",
|
|
3492
3945
|
providerGroupsCard: "Per-provider route presets",
|
|
3493
3946
|
providerGroupsSummary: "Sessions using that provider adopt this group",
|
|
3494
|
-
providerGroupsHelp: "Save compaction, auto-review, session-naming, and subagent routes per provider.",
|
|
3495
|
-
providerGroupsBodyHelp: "Each provider stores one route group for compaction, auto review, session naming, and subagents. A session running on that provider resolves
|
|
3947
|
+
providerGroupsHelp: "Save compaction, auto-review, session-naming, memory-distillation, vision, and subagent routes per provider.",
|
|
3948
|
+
providerGroupsBodyHelp: "Each provider stores one route group for compaction, auto review, session naming, memory distillation, vision, and subagents. A session running on that provider resolves these capabilities from the group and falls back to the cards above when a row is off. Vision on/off (-vision twin routes) share the same group per provider. Switching a session’s model writes no global setting, so parallel sessions on different providers never affect each other, and mid-session provider switches take effect on the very next call.",
|
|
3496
3949
|
providerGroupPick: "Pick a provider to edit its group.",
|
|
3497
3950
|
providerGroupDelete: "Delete group",
|
|
3498
3951
|
groupOverridesLabel: "Group overrides: {pins}; without a group the default above applies",
|
|
@@ -6215,6 +6668,7 @@ window.__ModuleLoader__.load({
|
|
|
6215
6668
|
const compaction = deriveConfigForm(owned, deriveCompactionSettings, COMPACTION_SETTINGS_FIELDS);
|
|
6216
6669
|
const sessionTitle = deriveConfigForm(owned, deriveTitleSettings, TITLE_SETTINGS_FIELDS);
|
|
6217
6670
|
const memory = deriveConfigForm(owned, deriveMemorySettings, MEMORY_SETTINGS_FIELDS);
|
|
6671
|
+
const vision = deriveConfigForm(owned, deriveVisionSettings, VISION_SETTINGS_FIELDS);
|
|
6218
6672
|
const connectionRpc = (() => {
|
|
6219
6673
|
try {
|
|
6220
6674
|
const rpc = ctx.get("connection", false)?.rpc;
|
|
@@ -6254,13 +6708,15 @@ window.__ModuleLoader__.load({
|
|
|
6254
6708
|
compactionSettings: compaction,
|
|
6255
6709
|
titleSettings: sessionTitle,
|
|
6256
6710
|
memorySettings: memory,
|
|
6711
|
+
visionSettings: vision,
|
|
6257
6712
|
switchSettings: owned
|
|
6258
6713
|
},
|
|
6259
6714
|
capabilities: RUNTIME_CAPABILITIES,
|
|
6260
6715
|
saveSubagent: (ops) => subagent.mutate(ops),
|
|
6261
6716
|
saveCapability: (route, ops) => {
|
|
6262
|
-
return (route === "search" ? search : route === "image" ? image : route === "compaction" ? compaction : route === "title" ? sessionTitle : route === "memory" ? memory : autoReview).mutate(ops);
|
|
6717
|
+
return (route === "search" ? search : route === "image" ? image : route === "compaction" ? compaction : route === "title" ? sessionTitle : route === "memory" ? memory : route === "vision" ? vision : autoReview).mutate(ops);
|
|
6263
6718
|
},
|
|
6719
|
+
saveMemory: (ops) => memory.mutate(ops),
|
|
6264
6720
|
saveReviewAllowlist: async ({ enabled, tools }) => {
|
|
6265
6721
|
if (!await owned.mutate([{
|
|
6266
6722
|
op: "set",
|