@oh-my-dsh/dsh-better-subagent 0.5.0 → 0.5.1
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/package.json +1 -1
- package/src/client.js +387 -334
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oh-my-dsh/dsh-better-subagent",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Standalone DSH plugin: Codex/Claude continuable CLI subagents, wait_subagent, child exit guard and model tiers. Pure ESM, no build step.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
package/src/client.js
CHANGED
|
@@ -55,10 +55,25 @@ window.__ModuleLoader__.load({
|
|
|
55
55
|
const BACKENDS = [CODEX, CLAUDE];
|
|
56
56
|
|
|
57
57
|
const zh = {
|
|
58
|
+
modelRecommendations: "主代理按任务参考这两档模型;「沿用」使用主会话模型。",
|
|
59
|
+
routingTitle: "模型路由",
|
|
60
|
+
mainAgent: "主代理",
|
|
61
|
+
mainAgentNote: "当前会话使用的模型",
|
|
62
|
+
routingNote: "这两档只是工程预设的推荐,不做强制限制;实际调用仍需使用允许使用的模型。",
|
|
63
|
+
backendsTitle: "本机代理",
|
|
64
|
+
expertSettings: "专家设置",
|
|
65
|
+
expertDefault: "默认启动命令",
|
|
66
|
+
expertCurrent: "{executable} · 配置 {profile}",
|
|
67
|
+
trustedHostsAdvanced: "反向代理信任主机",
|
|
68
|
+
readonlyShort: "只读",
|
|
69
|
+
chooseModel: "选择模型",
|
|
70
|
+
changeModel: "更改模型",
|
|
71
|
+
backendsIntro: "通过本机安装的 Codex 或 Claude 运行子代理,使用各自的默认模型与权限。",
|
|
72
|
+
effortHint: "思考强度决定模型的推理投入,留空使用模型默认值。",
|
|
58
73
|
advanced: "高级",
|
|
59
74
|
configureBackend: '配置 {backend}',
|
|
60
75
|
modelsEmptyTitle: '配置第一个模型',
|
|
61
|
-
effortsFirst:
|
|
76
|
+
effortsFirst: "先填写可选思考强度",
|
|
62
77
|
trustedCount: '{count} 个主机',
|
|
63
78
|
behaviorTitle: '行为',
|
|
64
79
|
defaults: "默认",
|
|
@@ -67,12 +82,11 @@ window.__ModuleLoader__.load({
|
|
|
67
82
|
draftPreview: "草稿预览",
|
|
68
83
|
changeCount: "{count} 项改动",
|
|
69
84
|
resetConfirm: "再次点击放弃",
|
|
70
|
-
backendOff: "
|
|
71
|
-
routingPreview: "
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
profileChoose: "使用 Profile {profile}",
|
|
85
|
+
backendOff: "启用后可选择默认模型与操作权限。",
|
|
86
|
+
routingPreview: "选择子代理使用的模型",
|
|
87
|
+
tierFastTask: "快速档 · 探索与批量检查",
|
|
88
|
+
tierQualityTask: "质量档 · 实现、调试与审查",
|
|
89
|
+
profileChoose: "使用 Codex 配置 {profile}",
|
|
76
90
|
permissionReadOnly: "只读检查,不写入文件。",
|
|
77
91
|
permissionWrite: "可修改工作区文件,外部访问仍受限。",
|
|
78
92
|
permissionFull: "可修改文件并访问外部资源,跳过权限确认。",
|
|
@@ -82,12 +96,12 @@ window.__ModuleLoader__.load({
|
|
|
82
96
|
permissionAcceptEdits: "自动允许文件修改,其它操作仍需确认。",
|
|
83
97
|
permissionAuto: "由 Claude 自动评估操作权限。",
|
|
84
98
|
permissionBypass: "跳过所有权限确认。",
|
|
85
|
-
trustedDefault: "
|
|
99
|
+
trustedDefault: "仅本机(localhost)",
|
|
86
100
|
modelCatalog: "模型目录",
|
|
87
101
|
diagnosticsLink: "查看连接诊断",
|
|
88
102
|
tabGeneral: "概览",
|
|
89
|
-
tabCli: "
|
|
90
|
-
tabTiers: "
|
|
103
|
+
tabCli: "本机代理",
|
|
104
|
+
tabTiers: "模型选择",
|
|
91
105
|
tabConnection: "连接",
|
|
92
106
|
details: "说明",
|
|
93
107
|
configured: "已启用",
|
|
@@ -95,69 +109,70 @@ window.__ModuleLoader__.load({
|
|
|
95
109
|
scopeInactive: "范围已关闭",
|
|
96
110
|
unsaved: "未保存",
|
|
97
111
|
upToDate: "已同步",
|
|
98
|
-
trustedHostsLabel: "
|
|
99
|
-
trustedHostsHint: "
|
|
112
|
+
trustedHostsLabel: "允许访问的主机",
|
|
113
|
+
trustedHostsHint: "每行填写主机名或主机名:端口,不含协议和路径;留空仅允许本机访问模型与检测信息,不授予设置写入权限。",
|
|
100
114
|
invalidTrustedHosts: "受信主机格式有误,请填写主机名或 host:port。",
|
|
101
115
|
connectionMode: "配置连接",
|
|
102
116
|
connectionWritable: "可写",
|
|
103
117
|
connectionReadonly: "只读",
|
|
104
118
|
capabilitiesLabel: "CLI 探测",
|
|
105
|
-
routesLabel: "
|
|
119
|
+
routesLabel: "允许使用的模型",
|
|
106
120
|
refresh: "刷新探测",
|
|
107
121
|
ready: "可用",
|
|
108
122
|
failed: "读取失败",
|
|
109
123
|
modelCount: "{count} 个模型",
|
|
110
|
-
saveBeforeDiscover: "
|
|
124
|
+
saveBeforeDiscover: "先保存启动命令或 Codex 配置,再检测或查找模型。",
|
|
111
125
|
permissionElevated: "此权限档允许绕过 CLI 的权限确认。",
|
|
112
|
-
invalidTierEffort: "{backend}
|
|
113
|
-
route: "
|
|
114
|
-
effort: "
|
|
115
|
-
globalOverrides: "
|
|
116
|
-
summary:
|
|
126
|
+
invalidTierEffort: "{backend}所选思考强度不适用于当前模型,请重新选择。",
|
|
127
|
+
route: "模型",
|
|
128
|
+
effort: "思考强度",
|
|
129
|
+
globalOverrides: "所有预设已包含工程预设。",
|
|
130
|
+
summary: "子代理模型、本机 Codex / Claude 与运行设置",
|
|
117
131
|
title: '子代理',
|
|
118
|
-
intro:
|
|
119
|
-
loading:
|
|
120
|
-
waitingForm:
|
|
121
|
-
noFormHint:
|
|
122
|
-
unavailable:
|
|
123
|
-
readonly:
|
|
124
|
-
childExitGuardLabel:
|
|
125
|
-
childExitGuardHint:
|
|
126
|
-
tiersTitle:
|
|
127
|
-
tiersIntro:
|
|
132
|
+
intro: "保存后即时生效。",
|
|
133
|
+
loading: "正在加载设置…",
|
|
134
|
+
waitingForm: "正在加载设置…",
|
|
135
|
+
noFormHint: "暂时无法加载设置,请刷新页面或检查连接。",
|
|
136
|
+
unavailable: "当前连接无法访问设置,请在运行 DSH 的电脑上通过 localhost 打开,或联系管理员。",
|
|
137
|
+
readonly: "当前连接仅供查看,无法保存设置。",
|
|
138
|
+
childExitGuardLabel: "等待子代理完成",
|
|
139
|
+
childExitGuardHint: "子代理仍在运行时继续等待;按 Esc 仍可中断。",
|
|
140
|
+
tiersTitle: "子代理模型选择",
|
|
141
|
+
tiersIntro: "为工程预设推荐子代理模型;实际调用仍需符合允许使用的模型范围。",
|
|
128
142
|
tierFast: '快速档',
|
|
129
143
|
tierQuality: '质量档',
|
|
130
|
-
tierFastHint:
|
|
131
|
-
tierQualityHint:
|
|
132
|
-
tierInherit:
|
|
144
|
+
tierFastHint: "探索、检索与批量检查时优先推荐。",
|
|
145
|
+
tierQualityHint: "实现、调试、评审与设计时优先推荐。",
|
|
146
|
+
tierInherit: "沿用主会话模型",
|
|
133
147
|
tierEffortDefault: '模型默认',
|
|
134
|
-
tierRouteLabel:
|
|
135
|
-
tierEffortLabel:
|
|
136
|
-
tierOffList:
|
|
137
|
-
tiersInactive:
|
|
138
|
-
routesLoading:
|
|
139
|
-
routesError:
|
|
140
|
-
invalidTierRoute:
|
|
141
|
-
scopeTitle:
|
|
142
|
-
scopeEng:
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
148
|
+
tierRouteLabel: "{tier}模型",
|
|
149
|
+
tierEffortLabel: "{tier}思考强度",
|
|
150
|
+
tierOffList: "(不可用) {route}",
|
|
151
|
+
tiersInactive: "请先在「插件 → 子代理 → 模型选择」启用并添加可用模型;当前仍可沿用主会话模型。",
|
|
152
|
+
routesLoading: "正在读取可用模型…",
|
|
153
|
+
routesError: "暂时无法读取可用模型,请刷新重试。",
|
|
154
|
+
invalidTierRoute: "{backend}所选模型不可用,请改选或沿用主会话模型。",
|
|
155
|
+
scopeTitle: "本机代理可用范围",
|
|
156
|
+
scopeEng: "仅工程预设",
|
|
157
|
+
scopeEngIncluded: "工程预设(已包含)",
|
|
158
|
+
scopeEngHint: "在 eng 和 eng-ptc 会话中提供已启用的 Codex / Claude。",
|
|
159
|
+
scopeGlobal: "所有预设",
|
|
160
|
+
scopeGlobalHint: "在所有会话中提供已启用的 Codex / Claude,包含工程预设。",
|
|
161
|
+
scopeNone: "未选择可用范围,所有会话都无法使用这些本机代理。",
|
|
162
|
+
codexTitle: "Codex 本机代理",
|
|
163
|
+
claudeTitle: "Claude 本机代理",
|
|
149
164
|
backendEnable: '启用',
|
|
150
|
-
executableLabel:
|
|
151
|
-
executableHint:
|
|
152
|
-
profileLabel:
|
|
153
|
-
profileHint:
|
|
165
|
+
executableLabel: "启动命令",
|
|
166
|
+
executableHint: "填写命令名或完整路径,例如 codex 或 /usr/local/bin/codex。",
|
|
167
|
+
profileLabel: "Codex 配置",
|
|
168
|
+
profileHint: "选择已有的 Codex 配置,留空使用默认配置。",
|
|
154
169
|
profileNone: '(不指定)',
|
|
155
|
-
permissionLabel:
|
|
156
|
-
permissionHint:
|
|
170
|
+
permissionLabel: "文件与操作权限",
|
|
171
|
+
permissionHint: "本机代理使用此处权限,不沿用主会话权限。",
|
|
157
172
|
defaultModelLabel: '默认模型',
|
|
158
173
|
defaultModelNone: '(未指定)',
|
|
159
|
-
modelsLabel:
|
|
160
|
-
modelsHint:
|
|
174
|
+
modelsLabel: "模型与思考强度",
|
|
175
|
+
modelsHint: "思考强度控制模型的推理投入;每行填写模型 ID、可选值和默认值。",
|
|
161
176
|
modelsEmpty: '还没有配置模型;启用后端前至少加一个模型。',
|
|
162
177
|
discover: '自动发现模型',
|
|
163
178
|
discovering: '正在发现…',
|
|
@@ -176,7 +191,7 @@ window.__ModuleLoader__.load({
|
|
|
176
191
|
discoverReasonTooLarge: '返回内容过大',
|
|
177
192
|
modelIdPlaceholder: '模型 id',
|
|
178
193
|
modelEffortsPlaceholder: 'low, medium, high',
|
|
179
|
-
modelDefaultEffort:
|
|
194
|
+
modelDefaultEffort: "默认思考强度",
|
|
180
195
|
modelEffortNone: '(无默认)',
|
|
181
196
|
modelAdd: '添加模型',
|
|
182
197
|
modelRemove: '移除',
|
|
@@ -189,23 +204,37 @@ window.__ModuleLoader__.load({
|
|
|
189
204
|
saving: '保存中…',
|
|
190
205
|
reset: '放弃改动',
|
|
191
206
|
saved: '已保存,即时生效。',
|
|
192
|
-
conflict:
|
|
207
|
+
conflict: "未能保存,已重新读取当前设置;请检查后重试。",
|
|
193
208
|
saveFailed: '保存失败:',
|
|
194
209
|
invalidEmptyId: '{backend}里有模型缺少 id,请补齐后再保存。',
|
|
195
210
|
invalidDuplicateId: '{backend}的模型 id 不能重复。',
|
|
196
211
|
invalidNoModels: '{backend}已启用,但还没有配置任何模型。',
|
|
197
212
|
invalidDefaultModel: '{backend}已启用,请把默认模型设为模型列表里的一个。',
|
|
198
213
|
invalidDefaultEffort: '{backend}的默认模型需要 effort 列表,并指定一个属于它的默认 effort。',
|
|
199
|
-
readonlyShort: '只读',
|
|
200
214
|
readonlyNote: '只读:当前无法写入宿主配置。',
|
|
201
215
|
unavailableNote: '不可写:当前连接下该配置不可用。',
|
|
202
216
|
};
|
|
203
217
|
|
|
204
218
|
const en = {
|
|
219
|
+
modelRecommendations: "The main agent uses these tiers as recommendations. Inherit uses the main conversation’s provider and model.",
|
|
220
|
+
routingTitle: "Model routing",
|
|
221
|
+
mainAgent: "Main agent",
|
|
222
|
+
mainAgentNote: "The model used by this conversation",
|
|
223
|
+
routingNote: "These tiers are recommendations for engineering presets, not enforcement; every call must still use a permitted model.",
|
|
224
|
+
backendsTitle: "Local agents",
|
|
225
|
+
expertSettings: "Expert settings",
|
|
226
|
+
expertDefault: "Default command",
|
|
227
|
+
expertCurrent: "{executable} · profile {profile}",
|
|
228
|
+
trustedHostsAdvanced: "Reverse-proxy trusted hosts",
|
|
229
|
+
readonlyShort: "Read-only",
|
|
230
|
+
chooseModel: "Choose model",
|
|
231
|
+
changeModel: "Change model",
|
|
232
|
+
backendsIntro: "Run subagents through Codex or Claude installed on this computer, with their own default model and permissions.",
|
|
233
|
+
effortHint: "Thinking effort controls how much reasoning the model uses. Leave blank for the model default.",
|
|
205
234
|
advanced: "Advanced",
|
|
206
235
|
configureBackend: 'Configure {backend}',
|
|
207
236
|
modelsEmptyTitle: 'Set up your first model',
|
|
208
|
-
effortsFirst:
|
|
237
|
+
effortsFirst: "Add effort options first",
|
|
209
238
|
trustedCount: '{count} hosts',
|
|
210
239
|
behaviorTitle: 'Behavior',
|
|
211
240
|
defaults: "Default",
|
|
@@ -214,12 +243,11 @@ window.__ModuleLoader__.load({
|
|
|
214
243
|
draftPreview: "Draft preview",
|
|
215
244
|
changeCount: "{count} changes",
|
|
216
245
|
resetConfirm: "Click again to discard",
|
|
217
|
-
backendOff: "Enable to
|
|
218
|
-
routingPreview: "
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
profileChoose: "Use Profile {profile}",
|
|
246
|
+
backendOff: "Enable to choose its default model and operation permissions.",
|
|
247
|
+
routingPreview: "Choose models for subagents",
|
|
248
|
+
tierFastTask: "Fast tier · Explore and check",
|
|
249
|
+
tierQualityTask: "Quality tier · Build, debug and review",
|
|
250
|
+
profileChoose: "Use Codex configuration {profile}",
|
|
223
251
|
permissionReadOnly: "Inspect files without writing.",
|
|
224
252
|
permissionWrite: "Edit workspace files with restricted external access.",
|
|
225
253
|
permissionFull: "Edit files and access external resources without approval prompts.",
|
|
@@ -229,12 +257,12 @@ window.__ModuleLoader__.load({
|
|
|
229
257
|
permissionAcceptEdits: "Allow file edits; other operations still require approval.",
|
|
230
258
|
permissionAuto: "Let Claude assess operation permissions.",
|
|
231
259
|
permissionBypass: "Skip all permission prompts.",
|
|
232
|
-
trustedDefault: "
|
|
260
|
+
trustedDefault: "This computer only (localhost)",
|
|
233
261
|
modelCatalog: "Model catalog",
|
|
234
262
|
diagnosticsLink: "View connection diagnostics",
|
|
235
263
|
tabGeneral: "Overview",
|
|
236
|
-
tabCli: "
|
|
237
|
-
tabTiers: "Model
|
|
264
|
+
tabCli: "Local agents",
|
|
265
|
+
tabTiers: "Model selection",
|
|
238
266
|
tabConnection: "Connection",
|
|
239
267
|
details: "Details",
|
|
240
268
|
configured: "Enabled",
|
|
@@ -242,69 +270,70 @@ window.__ModuleLoader__.load({
|
|
|
242
270
|
scopeInactive: "Scope off",
|
|
243
271
|
unsaved: "Unsaved changes",
|
|
244
272
|
upToDate: "Up to date",
|
|
245
|
-
trustedHostsLabel: "
|
|
246
|
-
trustedHostsHint: "
|
|
273
|
+
trustedHostsLabel: "Allowed hosts",
|
|
274
|
+
trustedHostsHint: "Enter a hostname or host:port per line, without a scheme or path. Blank allows only this computer to read model and detection information; this does not grant settings write access.",
|
|
247
275
|
invalidTrustedHosts: "Enter a hostname or host:port for each trusted host.",
|
|
248
276
|
connectionMode: "Settings connection",
|
|
249
277
|
connectionWritable: "Writable",
|
|
250
278
|
connectionReadonly: "Read-only",
|
|
251
279
|
capabilitiesLabel: "CLI detection",
|
|
252
|
-
routesLabel: "
|
|
280
|
+
routesLabel: "Permitted models",
|
|
253
281
|
refresh: "Refresh detection",
|
|
254
282
|
ready: "Available",
|
|
255
283
|
failed: "Request failed",
|
|
256
284
|
modelCount: "{count} models",
|
|
257
|
-
saveBeforeDiscover: "Save the
|
|
285
|
+
saveBeforeDiscover: "Save the launch command or Codex configuration before detecting agents or finding models.",
|
|
258
286
|
permissionElevated: "This permission mode can bypass CLI approval prompts.",
|
|
259
|
-
invalidTierEffort: "The {backend} effort is unavailable for this model. Select another.",
|
|
260
|
-
route: "
|
|
261
|
-
effort: "
|
|
262
|
-
globalOverrides: "All presets includes
|
|
263
|
-
summary:
|
|
287
|
+
invalidTierEffort: "The {backend} thinking effort is unavailable for this model. Select another.",
|
|
288
|
+
route: "Model",
|
|
289
|
+
effort: "Thinking effort",
|
|
290
|
+
globalOverrides: "All presets already includes engineering presets.",
|
|
291
|
+
summary: "Subagent models, local Codex / Claude and run settings",
|
|
264
292
|
title: 'Subagents',
|
|
265
|
-
intro:
|
|
266
|
-
loading:
|
|
267
|
-
waitingForm:
|
|
268
|
-
noFormHint:
|
|
269
|
-
unavailable:
|
|
270
|
-
readonly:
|
|
271
|
-
childExitGuardLabel:
|
|
272
|
-
childExitGuardHint:
|
|
273
|
-
tiersTitle:
|
|
274
|
-
tiersIntro:
|
|
293
|
+
intro: "Changes apply after saving.",
|
|
294
|
+
loading: "Loading settings…",
|
|
295
|
+
waitingForm: "Loading settings…",
|
|
296
|
+
noFormHint: "Settings are not loading. Refresh the page or check your connection.",
|
|
297
|
+
unavailable: "Settings are unavailable on this connection. Open DSH through localhost on the computer running it, or contact your administrator.",
|
|
298
|
+
readonly: "This connection is view-only. Settings cannot be saved.",
|
|
299
|
+
childExitGuardLabel: "Wait for subagents to finish",
|
|
300
|
+
childExitGuardHint: "Keep waiting while subagents run. You can still interrupt with Esc.",
|
|
301
|
+
tiersTitle: "Subagent model selection",
|
|
302
|
+
tiersIntro: "Recommend subagent models in engineering presets; calls must still use a permitted model.",
|
|
275
303
|
tierFast: 'Fast tier',
|
|
276
304
|
tierQuality: 'Quality tier',
|
|
277
|
-
tierFastHint:
|
|
278
|
-
tierQualityHint:
|
|
279
|
-
tierInherit:
|
|
305
|
+
tierFastHint: "Recommended for exploration, search and batch checks.",
|
|
306
|
+
tierQualityHint: "Recommended for implementation, debugging, review and design.",
|
|
307
|
+
tierInherit: "Use main conversation model",
|
|
280
308
|
tierEffortDefault: 'Model default',
|
|
281
|
-
tierRouteLabel:
|
|
282
|
-
tierEffortLabel:
|
|
283
|
-
tierOffList:
|
|
284
|
-
tiersInactive:
|
|
285
|
-
routesLoading:
|
|
286
|
-
routesError:
|
|
287
|
-
invalidTierRoute:
|
|
288
|
-
scopeTitle:
|
|
289
|
-
scopeEng:
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
309
|
+
tierRouteLabel: "{tier} model",
|
|
310
|
+
tierEffortLabel: "{tier} thinking effort",
|
|
311
|
+
tierOffList: "(unavailable) {route}",
|
|
312
|
+
tiersInactive: "Enable and add models in Plugins → Subagent → Model selection first. You can still use the main conversation model.",
|
|
313
|
+
routesLoading: "Loading available models…",
|
|
314
|
+
routesError: "Available models could not be loaded. Refresh to try again.",
|
|
315
|
+
invalidTierRoute: "The {backend} model is unavailable. Choose another or use the main conversation model.",
|
|
316
|
+
scopeTitle: "Where local agents are available",
|
|
317
|
+
scopeEng: "Engineering presets only",
|
|
318
|
+
scopeEngIncluded: "Engineering presets (included)",
|
|
319
|
+
scopeEngHint: "Offer enabled Codex / Claude agents in eng and eng-ptc conversations.",
|
|
320
|
+
scopeGlobal: "All presets",
|
|
321
|
+
scopeGlobalHint: "Offer enabled Codex / Claude agents in every conversation, including engineering presets.",
|
|
322
|
+
scopeNone: "No scope is selected. These local agents are unavailable in all conversations.",
|
|
323
|
+
codexTitle: "Local Codex agent",
|
|
324
|
+
claudeTitle: "Local Claude agent",
|
|
296
325
|
backendEnable: 'Enabled',
|
|
297
|
-
executableLabel:
|
|
298
|
-
executableHint:
|
|
299
|
-
profileLabel:
|
|
300
|
-
profileHint:
|
|
326
|
+
executableLabel: "Launch command",
|
|
327
|
+
executableHint: "Enter a command name or full path, such as codex or /usr/local/bin/codex.",
|
|
328
|
+
profileLabel: "Codex configuration",
|
|
329
|
+
profileHint: "Choose an existing Codex configuration, or leave blank to use its default.",
|
|
301
330
|
profileNone: '(none)',
|
|
302
|
-
permissionLabel:
|
|
303
|
-
permissionHint:
|
|
331
|
+
permissionLabel: "File and operation permissions",
|
|
332
|
+
permissionHint: "Local agents use these permissions, independently of the main conversation.",
|
|
304
333
|
defaultModelLabel: 'Default model',
|
|
305
334
|
defaultModelNone: '(unset)',
|
|
306
|
-
modelsLabel:
|
|
307
|
-
modelsHint:
|
|
335
|
+
modelsLabel: "Models and thinking effort",
|
|
336
|
+
modelsHint: "Thinking effort controls how much reasoning a model uses. Enter its ID, effort options and default on each row.",
|
|
308
337
|
modelsEmpty: 'No model yet; add at least one before enabling the backend.',
|
|
309
338
|
discover: 'Discover models',
|
|
310
339
|
discovering: 'Discovering…',
|
|
@@ -323,7 +352,7 @@ window.__ModuleLoader__.load({
|
|
|
323
352
|
discoverReasonTooLarge: 'the reply is too large',
|
|
324
353
|
modelIdPlaceholder: 'model id',
|
|
325
354
|
modelEffortsPlaceholder: 'low, medium, high',
|
|
326
|
-
modelDefaultEffort:
|
|
355
|
+
modelDefaultEffort: "Default thinking effort",
|
|
327
356
|
modelEffortNone: '(none)',
|
|
328
357
|
modelAdd: 'Add model',
|
|
329
358
|
modelRemove: 'Remove',
|
|
@@ -336,14 +365,13 @@ window.__ModuleLoader__.load({
|
|
|
336
365
|
saving: 'Saving…',
|
|
337
366
|
reset: 'Discard',
|
|
338
367
|
saved: 'Saved and applied.',
|
|
339
|
-
conflict:
|
|
368
|
+
conflict: "Could not save. Current settings were reloaded; review them and try again.",
|
|
340
369
|
saveFailed: 'Save failed: ',
|
|
341
370
|
invalidEmptyId: 'Every model in {backend} needs an id before saving.',
|
|
342
371
|
invalidDuplicateId: 'Model ids in {backend} must be unique.',
|
|
343
372
|
invalidNoModels: '{backend} is enabled but has no model configured.',
|
|
344
373
|
invalidDefaultModel: '{backend} is enabled: set the default model to one of its model ids.',
|
|
345
374
|
invalidDefaultEffort: '{backend}’s default model needs an effort list and a default effort from that list.',
|
|
346
|
-
readonlyShort: 'Read-only',
|
|
347
375
|
readonlyNote: 'Read-only: host configuration cannot be written.',
|
|
348
376
|
unavailableNote: 'Not writable: this configuration is unavailable on the current connection.',
|
|
349
377
|
};
|
|
@@ -373,152 +401,148 @@ window.__ModuleLoader__.load({
|
|
|
373
401
|
// ── 样式(组件树内的 <style>;复用 DSH 设计令牌,与官方设置页同观感)──────────
|
|
374
402
|
|
|
375
403
|
const STYLE_ID = '@oh-my-dsh/dsh-better-subagent/settings.css';
|
|
376
|
-
const CSS = `.bs-root{--cfg-accent
|
|
377
|
-
|
|
378
|
-
.bs-root,.bs-root *{box-sizing:border-box}
|
|
404
|
+
const CSS = `.bs-root{--cfg-accent:var(--dsw-alias-state-business-primary,#4176e6);--cfg-accent-solid:var(--dsw-alias-button-primary-fill,#0f1115);--cfg-accent-fg:var(--dsw-alias-label-primary-foreground,#fff);--cfg-accent-text:color-mix(in srgb,var(--cfg-accent) 72%,var(--cfg-ink));--cfg-accent-hover:color-mix(in srgb,var(--cfg-accent-solid) 88%,var(--cfg-bg));--cfg-accent-soft:color-mix(in srgb,var(--cfg-accent) 10%,transparent);--cfg-bg:var(--dsw-alias-bg-layer-1);--cfg-raised:var(--dsw-alias-bg-layer-2);--cfg-overlay:var(--dsw-alias-bg-layer-3);--cfg-sunken:color-mix(in srgb,var(--dsw-alias-label-primary) 4%,var(--dsw-alias-bg-layer-1));--cfg-ink:var(--dsw-alias-label-primary);--cfg-muted:var(--dsw-alias-label-secondary);--cfg-dim:color-mix(in srgb,var(--dsw-alias-label-tertiary) 80%,var(--cfg-ink));--cfg-line:var(--dsw-alias-border-l2);--cfg-line-strong:var(--dsw-alias-border-l3);--cfg-hover:var(--dsw-alias-interactive-bg-hover);--cfg-danger:var(--dsw-alias-state-error-primary);--cfg-warn:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 60%,var(--cfg-ink));--cfg-success:color-mix(in srgb,var(--dsw-alias-state-success-primary) 60%,var(--cfg-ink));--cfg-mono:var(--dsw-font-family-mono,ui-monospace,SFMono-Regular,Menlo,Consolas,monospace);color:var(--cfg-ink);font:inherit;font-size:13px;line-height:20px;font-variant-numeric:tabular-nums;min-width:0;width:100%;--bs-action-size:32px;container:bs-settings / inline-size}
|
|
405
|
+
.bs-root *{box-sizing:border-box}
|
|
379
406
|
.bs-root [hidden]{display:none!important}
|
|
380
|
-
.bs-cfg{display:flex;flex-direction:column;gap:
|
|
381
|
-
.bs-header{display:flex;align-items:
|
|
382
|
-
.bs-
|
|
383
|
-
.bs-
|
|
384
|
-
.bs-
|
|
385
|
-
.bs-
|
|
386
|
-
.bs-
|
|
387
|
-
.bs-
|
|
388
|
-
.bs-
|
|
389
|
-
.bs-
|
|
407
|
+
.bs-cfg{display:flex;flex-direction:column;gap:20px;max-width:960px;width:100%;margin:0 auto;min-width:0}
|
|
408
|
+
.bs-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;min-height:32px}
|
|
409
|
+
.bs-headerMain{display:flex;flex-direction:column;gap:2px;min-width:0}
|
|
410
|
+
.bs-headerIntro{color:var(--cfg-dim);font-size:12px;line-height:18px}
|
|
411
|
+
.bs-headerMeta{display:flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:flex-end}
|
|
412
|
+
.bs-title{margin:0;font-size:12px;line-height:18px;font-weight:500;color:var(--cfg-dim)}
|
|
413
|
+
.bs-header .bs-title{font-size:20px;line-height:28px;letter-spacing:-.01em;color:var(--cfg-ink)}
|
|
414
|
+
.bs-sectionTitle{margin:0;font-size:12px;line-height:18px;font-weight:500;color:var(--cfg-dim)}
|
|
415
|
+
.bs-cardTitle{margin:0;font-size:13px;line-height:20px;font-weight:500;color:var(--cfg-ink)}
|
|
416
|
+
.bs-hint,.bs-status{margin:0;color:var(--cfg-dim);font-size:12px;line-height:18px}
|
|
417
|
+
.bs-hintWarn{color:var(--cfg-warn)}
|
|
418
|
+
.bs-note{margin:0;padding:8px 10px;border:1px solid var(--cfg-line);border-radius:8px;background:var(--cfg-sunken);color:var(--cfg-muted);font-size:12px;line-height:18px}
|
|
390
419
|
.bs-note[data-tone=error],.bs-hint[data-tone=error],.bs-status[data-tone=error]{color:var(--cfg-danger)}
|
|
391
|
-
.bs-
|
|
392
|
-
.bs-
|
|
393
|
-
.bs-tabs
|
|
394
|
-
.bs-tab{appearance:none;position:relative;display:inline-flex;align-items:center;justify-content:center;gap:
|
|
395
|
-
.bs-tab:hover{
|
|
396
|
-
.bs-tab[aria-selected=true]{
|
|
397
|
-
.bs-tab
|
|
398
|
-
.bs-subtabs{
|
|
399
|
-
.bs-subtabs .bs-tab{height:
|
|
400
|
-
.bs-
|
|
401
|
-
.bs-
|
|
402
|
-
.bs-
|
|
403
|
-
.bs-
|
|
404
|
-
.bs-sectionHead{
|
|
405
|
-
.bs-
|
|
406
|
-
.bs-
|
|
407
|
-
.bs-
|
|
408
|
-
.bs-
|
|
409
|
-
.bs-
|
|
410
|
-
.bs-
|
|
411
|
-
.bs-
|
|
420
|
+
.bs-note[data-tone=warn]{border-color:var(--cfg-warn);color:var(--cfg-warn)}
|
|
421
|
+
.bs-hint[data-tone=ok],.bs-status[data-tone=ok]{color:var(--cfg-success)}
|
|
422
|
+
.bs-tabs{display:flex;gap:20px;padding:0;border-bottom:1px solid var(--cfg-line);overflow-x:auto;scrollbar-width:thin}
|
|
423
|
+
.bs-tab{appearance:none;position:relative;flex:none;display:inline-flex;align-items:center;justify-content:center;gap:7px;height:32px;padding:0 0 8px;border:0;border-radius:0;background:transparent;color:var(--cfg-muted);font:inherit;font-weight:500;cursor:pointer;white-space:nowrap}
|
|
424
|
+
.bs-tab:hover{color:var(--cfg-ink)}
|
|
425
|
+
.bs-tab[aria-selected=true]{color:var(--cfg-ink)}
|
|
426
|
+
.bs-tab[aria-selected=true]::after{content:"";position:absolute;inset-inline:0;bottom:0;height:1px;background:var(--cfg-accent)}
|
|
427
|
+
.bs-subtabs{align-self:flex-start;gap:16px;padding:0;border:0;border-bottom:1px solid var(--cfg-line);border-radius:0;background:transparent}
|
|
428
|
+
.bs-subtabs .bs-tab{height:32px;padding:0 0 7px;border:0;border-radius:0;font-weight:400}
|
|
429
|
+
.bs-subtabs .bs-tab:hover{background:transparent;color:var(--cfg-ink)}
|
|
430
|
+
.bs-subtabs .bs-tab[aria-selected=true]{background:transparent;border:0;color:var(--cfg-ink);font-weight:500}
|
|
431
|
+
.bs-tabpanel{display:flex;flex-direction:column;gap:20px;min-width:0}
|
|
432
|
+
.bs-section{display:flex;flex-direction:column;gap:6px;min-width:0}
|
|
433
|
+
.bs-sectionHead,.bs-cardHead{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:28px}
|
|
434
|
+
.bs-toolbar{display:flex;align-items:center;gap:8px;min-width:0}
|
|
435
|
+
.bs-card{display:flex;flex-direction:column;gap:8px;min-width:0;padding:12px 14px;border:1px solid var(--cfg-line);border-radius:8px;background:var(--cfg-raised)}
|
|
436
|
+
.bs-cardBody{display:flex;flex-direction:column;gap:8px;min-width:0}
|
|
437
|
+
.bs-cardHead .bs-switchRow{padding:0;gap:10px}
|
|
438
|
+
.bs-cardHead .bs-switchLabel{color:var(--cfg-muted);font-weight:400}
|
|
439
|
+
.bs-field{display:grid;grid-template-columns:140px minmax(0,1fr);gap:6px 16px;padding:4px 0;align-items:start}
|
|
440
|
+
.bs-fieldLabel{display:flex;align-items:center;gap:5px;padding-top:5px;font-weight:500}
|
|
441
|
+
.bs-fieldBody{display:flex;flex-direction:column;gap:4px;min-width:0;width:100%}
|
|
442
|
+
.bs-fieldWide{grid-template-columns:minmax(0,1fr);padding-top:4px}
|
|
412
443
|
.bs-fieldWide>.bs-fieldLabel{padding:0}
|
|
413
|
-
.bs-fieldGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:
|
|
414
|
-
.bs-fieldGrid .bs-field{
|
|
415
|
-
.bs-fieldGrid .bs-fieldLabel{padding:0
|
|
416
|
-
.bs-
|
|
417
|
-
.bs-
|
|
418
|
-
.bs-
|
|
419
|
-
.bs-input,.bs-select,.bs-textarea{appearance:none;width:100%;min-width:0;height:32px;padding:0 10px;border:1px solid var(--cfg-line-strong);border-radius:8px;background:var(--cfg-raised);color:var(--cfg-ink);font:inherit;font-size:13px;line-height:20px;transition:border-color 140ms ease,box-shadow 140ms ease,background-color 140ms ease}
|
|
420
|
-
.bs-textarea{height:auto;min-height:88px;max-height:220px;padding:8px 10px;resize:vertical}
|
|
421
|
-
.bs-input:hover:not(:disabled),.bs-select:hover:not(:disabled),.bs-textarea:hover:not(:disabled){border-color:var(--cfg-muted)}
|
|
422
|
-
.bs-input:focus-visible,.bs-select:focus-visible,.bs-textarea:focus-visible{outline:none;border-color:var(--cfg-accent);box-shadow:0 0 0 2px var(--cfg-accent-soft)}
|
|
423
|
-
.bs-root [aria-invalid=true]{border-color:var(--cfg-danger)}
|
|
444
|
+
.bs-fieldGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:2px 20px;align-items:start;min-width:0}
|
|
445
|
+
.bs-fieldGrid .bs-field{grid-template-columns:minmax(0,1fr);gap:4px;padding:2px 0}
|
|
446
|
+
.bs-fieldGrid .bs-fieldLabel{padding:0}
|
|
447
|
+
.bs-input,.bs-select,.bs-textarea{appearance:none;width:100%;min-width:0;height:32px;padding:5px 10px;border:1px solid var(--cfg-line);border-radius:6px;background:var(--cfg-bg);color:var(--cfg-ink);font:inherit;line-height:20px}
|
|
448
|
+
.bs-textarea{height:auto;min-height:72px;max-height:240px;padding:8px 10px;resize:vertical}
|
|
449
|
+
.bs-input:hover:not(:disabled),.bs-select:hover:not(:disabled),.bs-textarea:hover:not(:disabled){border-color:var(--cfg-line-strong)}
|
|
424
450
|
.bs-input::placeholder,.bs-textarea::placeholder{color:var(--cfg-dim)}
|
|
425
|
-
.bs-
|
|
426
|
-
.bs-
|
|
451
|
+
.bs-root [aria-invalid=true]{border-color:var(--cfg-danger)}
|
|
452
|
+
.bs-root :is(input,textarea,button,summary,a,[role=combobox]):focus-visible{outline:2px solid var(--cfg-accent);outline-offset:1px}
|
|
453
|
+
.bs-root :is(input,textarea,button):disabled{opacity:.4;cursor:not-allowed}
|
|
454
|
+
.bs-mono,.bs-model .bs-input,.bs-textarea{font-family:var(--cfg-mono);font-variant-numeric:tabular-nums}
|
|
427
455
|
.bs-mono{overflow-wrap:anywhere}
|
|
428
456
|
.bs-selectWrap{position:relative;min-width:0}
|
|
429
457
|
.bs-select{display:flex;align-items:center;justify-content:space-between;gap:8px;text-align:left;cursor:pointer}
|
|
430
458
|
.bs-selectValue{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
431
459
|
.bs-select svg{flex:none;color:var(--cfg-dim)}
|
|
432
|
-
.bs-selectMenu{position:absolute;inset-inline:0;top:calc(100% + 4px);z-index:
|
|
460
|
+
.bs-selectMenu{position:absolute;inset-inline:0;top:calc(100% + 4px);z-index:20;min-width:0;max-height:240px;overflow:auto;padding:4px;border:1px solid var(--cfg-line-strong);border-radius:10px;background:var(--cfg-overlay)}
|
|
433
461
|
.bs-selectMenu[data-side=top]{top:auto;bottom:calc(100% + 4px)}
|
|
434
|
-
.bs-option{display:flex;align-items:center;gap:8px;min-height:30px;padding:
|
|
462
|
+
.bs-option{display:flex;align-items:center;gap:8px;min-height:30px;padding:4px 8px;border-radius:6px;color:var(--cfg-ink);cursor:pointer;overflow-wrap:anywhere}
|
|
435
463
|
.bs-option[data-active=true]{background:var(--cfg-hover)}
|
|
436
|
-
.bs-option[aria-selected=true]{
|
|
437
|
-
.bs-optionCheck{width:12px;flex:none
|
|
464
|
+
.bs-option[aria-selected=true]{color:var(--cfg-accent-text);background:var(--cfg-accent-soft)}
|
|
465
|
+
.bs-optionCheck{width:12px;flex:none}
|
|
438
466
|
.bs-optionLabel{min-width:0}
|
|
439
|
-
.bs-switchRow{position:relative;display:flex;align-items:center;justify-content:space-between;gap:16px;
|
|
440
|
-
.bs-switchRow:last-child{border-bottom:0}
|
|
467
|
+
.bs-switchRow{position:relative;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:4px 0}
|
|
441
468
|
.bs-switchMain{flex:1;min-width:0}
|
|
442
|
-
.bs-switchLabel{font-
|
|
443
|
-
.bs-
|
|
444
|
-
.bs-
|
|
445
|
-
.bs-switch{appearance:none;position:relative;display:inline-flex;align-items:center;justify-content:center;flex:none;width:34px;height:20px;padding:0;border:0;border-radius:999px;background:transparent;cursor:pointer}
|
|
446
|
-
.bs-switchTrack{display:block;width:34px;height:20px;padding:2px;border:1px solid var(--cfg-line-strong);border-radius:999px;background:var(--cfg-sunken);transition:background-color 140ms ease,border-color 140ms ease}
|
|
469
|
+
.bs-switchLabel{font-weight:500}
|
|
470
|
+
.bs-switch{appearance:none;display:flex;align-items:center;justify-content:center;flex:none;width:32px;height:32px;padding:0;border:0;border-radius:6px;background:transparent;cursor:pointer}
|
|
471
|
+
.bs-switchTrack{display:block;width:32px;height:18px;padding:2px;border:1px solid var(--cfg-line-strong);border-radius:9px;background:var(--cfg-sunken)}
|
|
447
472
|
.bs-switch:hover:not(:disabled) .bs-switchTrack{border-color:var(--cfg-muted)}
|
|
448
473
|
.bs-switch[aria-checked=true] .bs-switchTrack{background:var(--cfg-accent-solid);border-color:var(--cfg-accent-solid)}
|
|
449
|
-
.bs-switchThumb{display:block;width:
|
|
474
|
+
.bs-switchThumb{display:block;width:12px;height:12px;border-radius:50%;background:var(--cfg-muted);transition:transform 150ms ease}
|
|
450
475
|
.bs-switch[aria-checked=true] .bs-switchThumb{transform:translateX(14px);background:var(--cfg-accent-fg)}
|
|
451
|
-
.bs-
|
|
452
|
-
.bs-
|
|
453
|
-
.bs-
|
|
454
|
-
.bs-
|
|
476
|
+
.bs-srOnly{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
|
|
477
|
+
.bs-advanced{display:flex;flex-direction:column;min-width:0}
|
|
478
|
+
.bs-advanced>summary{appearance:none;display:flex;align-items:center;gap:8px;min-height:32px;padding:4px 6px;margin-inline:-6px;list-style:none;border-radius:6px;cursor:pointer;font-weight:500;color:var(--cfg-muted)}
|
|
479
|
+
.bs-advanced>summary:hover{background:var(--cfg-hover);color:var(--cfg-ink)}
|
|
480
|
+
.bs-advanced>summary::-webkit-details-marker{display:none}
|
|
481
|
+
.bs-advanced>summary::before{content:"";flex:none;width:6px;height:6px;border-right:1px solid currentColor;border-bottom:1px solid currentColor;transform:rotate(-45deg);margin:0 3px}
|
|
482
|
+
.bs-advanced[open]>summary::before{transform:rotate(45deg)}
|
|
483
|
+
.bs-advanced[open]>summary{margin-bottom:4px}
|
|
484
|
+
.bs-advancedSummary{margin-inline-start:auto;color:var(--cfg-dim);font-weight:400;font-size:.92em;overflow-wrap:anywhere}
|
|
485
|
+
.bs-profileChoices{display:flex;gap:4px;flex-wrap:wrap}
|
|
486
|
+
.bs-actions{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
|
|
487
|
+
.bs-button,.bs-iconButton{appearance:none;display:inline-flex;align-items:center;justify-content:center;gap:6px;height:32px;padding:5px 12px;border:1px solid transparent;border-radius:6px;font:inherit;line-height:20px;font-weight:500;color:var(--cfg-ink);background:transparent;cursor:pointer}
|
|
488
|
+
.bs-button[data-variant=outline]{border-color:var(--cfg-line-strong)}
|
|
455
489
|
.bs-button:hover:not(:disabled),.bs-iconButton:hover:not(:disabled){background:var(--cfg-hover)}
|
|
456
|
-
.bs-button
|
|
490
|
+
.bs-button:active:not(:disabled){background:var(--cfg-overlay)}
|
|
491
|
+
.bs-button[data-variant=primary]{height:32px;min-width:80px;background:var(--cfg-accent-solid);color:var(--cfg-accent-fg)}
|
|
457
492
|
.bs-button[data-variant=primary]:hover:not(:disabled){background:var(--cfg-accent-hover)}
|
|
458
|
-
.bs-iconButton{width:
|
|
493
|
+
.bs-iconButton{width:32px;flex:none;padding:5px;color:var(--cfg-muted)}
|
|
459
494
|
.bs-iconButton[data-danger]:hover:not(:disabled){color:var(--cfg-danger)}
|
|
460
|
-
.bs-
|
|
461
|
-
.bs-
|
|
462
|
-
.bs-
|
|
463
|
-
.bs-model
|
|
464
|
-
.bs-
|
|
465
|
-
.bs-
|
|
466
|
-
.bs-
|
|
467
|
-
.bs-
|
|
468
|
-
.bs-
|
|
469
|
-
.bs-
|
|
470
|
-
.bs-tierInherit{grid-template-columns:minmax(0,1fr)}
|
|
471
|
-
.bs-tierPurpose{grid-column:1/-1;color:var(--cfg-muted);font-size:12px;line-height:18px}
|
|
472
|
-
.bs-controlLabel{font-size:12px;line-height:18px;color:var(--cfg-muted)}
|
|
473
|
-
.bs-badge{display:inline-flex;align-items:center;gap:6px;height:20px;padding:0 8px;border:1px solid var(--cfg-line);border-radius:999px;background:var(--cfg-raised);color:var(--cfg-muted);font-size:11px;line-height:18px;font-weight:400;white-space:nowrap}
|
|
495
|
+
.bs-modelsBlock{display:flex;flex-direction:column;gap:6px;min-width:0}
|
|
496
|
+
.bs-models{display:flex;flex-direction:column;gap:2px;min-width:0}
|
|
497
|
+
.bs-model,.bs-modelHead{display:grid;grid-template-columns:minmax(100px,1.2fr) minmax(100px,1.2fr) minmax(100px,.8fr) var(--bs-action-size);gap:8px;align-items:start}
|
|
498
|
+
.bs-model{padding:4px 6px;margin-inline:-6px;border-radius:6px}
|
|
499
|
+
.bs-model:hover{background:var(--cfg-hover)}
|
|
500
|
+
.bs-modelHead{padding:0 6px 2px;color:var(--cfg-dim);font-size:.92em}
|
|
501
|
+
.bs-modelCell{display:flex;flex-direction:column;gap:4px;min-width:0}
|
|
502
|
+
.bs-cellLabel{display:none;color:var(--cfg-muted)}
|
|
503
|
+
.bs-badge{display:inline-flex;align-items:center;gap:6px;padding:1px 6px;border:1px solid var(--cfg-line);border-radius:6px;line-height:18px;font-weight:400;color:var(--cfg-muted);white-space:nowrap;font-size:.92em}
|
|
504
|
+
.bs-badge[data-active=true]{border-color:var(--cfg-accent);color:var(--cfg-accent-text)}
|
|
474
505
|
.bs-dot{width:6px;height:6px;flex:none;border-radius:50%;background:var(--cfg-dim)}
|
|
475
506
|
.bs-dot[data-active=true]{background:var(--cfg-accent)}
|
|
476
|
-
.bs-overview{display:flex;flex-direction:column;
|
|
477
|
-
.bs-
|
|
478
|
-
.bs-
|
|
479
|
-
.bs-overviewRow:
|
|
480
|
-
.bs-overviewRow:
|
|
481
|
-
.bs-overviewGlyph{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex:none;border:1px solid var(--cfg-line);border-radius:6px;background:var(--cfg-sunken);color:var(--cfg-muted)}
|
|
507
|
+
.bs-overview{display:flex;flex-direction:column;gap:2px}
|
|
508
|
+
.bs-overviewGlyph{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;flex:none;border:1px solid var(--cfg-line);border-radius:6px;background:var(--cfg-raised);color:var(--cfg-muted)}
|
|
509
|
+
.bs-overviewMeta{font-size:12px;line-height:18px;color:var(--cfg-dim);overflow-wrap:anywhere}
|
|
510
|
+
.bs-overviewRow{appearance:none;display:flex;align-items:center;gap:12px;width:100%;padding:8px 6px;margin-inline:-6px;border:0;border-radius:6px;background:transparent;color:inherit;font:inherit;cursor:pointer;text-align:left}
|
|
511
|
+
.bs-overviewRow:hover,.bs-overviewRow:active{background:var(--cfg-hover)}
|
|
482
512
|
.bs-overviewName{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}
|
|
483
513
|
.bs-overviewName>span:first-child{font-weight:500}
|
|
484
|
-
.bs-overviewMeta{display:inline-flex;align-items:center;gap:6px;min-width:0;color:var(--cfg-muted);font-size:12px;line-height:18px;overflow-wrap:anywhere}
|
|
485
514
|
.bs-overviewRow>svg{color:var(--cfg-dim);flex:none}
|
|
486
|
-
.bs-
|
|
487
|
-
.bs-
|
|
488
|
-
.bs-
|
|
489
|
-
.bs-
|
|
490
|
-
.bs-
|
|
491
|
-
.bs-
|
|
492
|
-
.bs-
|
|
493
|
-
.bs-
|
|
494
|
-
.bs-
|
|
495
|
-
.bs-
|
|
496
|
-
.bs-
|
|
497
|
-
.bs-
|
|
498
|
-
.bs-
|
|
499
|
-
.bs-
|
|
500
|
-
.bs-
|
|
501
|
-
.bs-
|
|
502
|
-
.bs-
|
|
503
|
-
.bs-
|
|
504
|
-
.bs-
|
|
505
|
-
.bs-
|
|
506
|
-
.bs-
|
|
507
|
-
.bs-
|
|
508
|
-
.bs-
|
|
509
|
-
.bs-
|
|
510
|
-
.bs-
|
|
511
|
-
.bs-status{flex:1;min-width:140px}
|
|
512
|
-
.bs-feedback{display:flex;align-items:center;gap:8px;min-width:0;padding:8px 0 0;border-top:1px solid var(--cfg-line);font-size:12px}
|
|
513
|
-
.bs-errorLink{height:auto;min-height:28px;padding:0;border:0;color:var(--cfg-danger);font-size:12px;font-weight:400;text-align:left;white-space:normal}
|
|
514
|
-
.bs-errorLink:hover:not(:disabled){background:transparent;color:var(--cfg-danger)}
|
|
515
|
-
.bs-srOnly{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
|
|
516
|
-
.bs-spinner{width:12px;height:12px;flex:none;border:1px solid currentColor;border-right-color:transparent;border-radius:50%;animation:bs-spin .7s linear infinite}
|
|
515
|
+
.bs-routingDiagram{display:flex;flex-direction:column;gap:2px;padding:2px 0 0;min-width:0}
|
|
516
|
+
.bs-routingSource{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:6px 8px;border:1px solid var(--cfg-line);border-radius:8px;background:var(--cfg-sunken);min-width:0}
|
|
517
|
+
.bs-routingSourceLabel{display:inline-flex;align-items:center;gap:6px;font-weight:500}
|
|
518
|
+
.bs-routingSourceLabel::before{content:"";width:6px;height:6px;flex:none;border-radius:50%;background:var(--cfg-accent)}
|
|
519
|
+
.bs-routing{display:grid;grid-template-columns:auto minmax(0,1fr) minmax(0,1.1fr) auto;gap:8px 12px;align-items:center;padding:8px 8px 8px 12px;border:0;border-radius:8px;min-width:0}
|
|
520
|
+
.bs-routing:hover{background:var(--cfg-hover)}
|
|
521
|
+
.bs-routingBranchGlyph{color:var(--cfg-dim);font-family:var(--cfg-mono)}
|
|
522
|
+
.bs-routingLabel{font-weight:500}
|
|
523
|
+
.bs-routingModel{font-size:12px;line-height:18px;color:var(--cfg-muted);overflow-wrap:anywhere}
|
|
524
|
+
.bs-routingNote{margin:2px 0 0}
|
|
525
|
+
.bs-tierGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:start;min-width:0}
|
|
526
|
+
.bs-tierCard{min-width:0}
|
|
527
|
+
.bs-tierHead{display:flex;flex-direction:column;gap:2px;min-width:0}
|
|
528
|
+
.bs-empty{display:flex;flex-direction:column;gap:4px;padding:8px 10px;border:1px solid var(--cfg-line);border-radius:6px;background:var(--cfg-sunken)}
|
|
529
|
+
.bs-connectionRow{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:32px;padding:2px 0}
|
|
530
|
+
.bs-connectionRow .bs-hint{text-align:end}
|
|
531
|
+
.bs-metricGrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
|
|
532
|
+
.bs-metric{display:flex;flex-direction:column;gap:2px;min-width:0;padding:8px 10px;border:1px solid var(--cfg-line);border-radius:6px;background:var(--cfg-sunken)}
|
|
533
|
+
.bs-metricLabel{font-size:12px;line-height:18px;color:var(--cfg-dim)}
|
|
534
|
+
.bs-metricValue{font-size:13px;line-height:20px;font-weight:500;overflow-wrap:anywhere}
|
|
535
|
+
.bs-footer{position:sticky;bottom:0;z-index:10;display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:10px 0;border-top:1px solid var(--cfg-line);background:var(--cfg-bg)}
|
|
536
|
+
.bs-footer .bs-status{flex:1;min-width:140px;font-size:12px;line-height:18px;color:var(--cfg-dim)}
|
|
537
|
+
.bs-errorLink{color:var(--cfg-danger);text-align:left;white-space:normal;height:auto;min-height:28px}
|
|
538
|
+
.bs-feedback{min-height:20px}
|
|
539
|
+
.bs-spinner{width:12px;height:12px;flex:none;border:1.5px solid currentColor;border-right-color:transparent;border-radius:50%;animation:bs-spin .7s linear infinite}
|
|
517
540
|
@keyframes bs-spin{to{transform:rotate(360deg)}}
|
|
518
541
|
.bs-pulse{animation:bs-pulse 2s ease infinite}
|
|
519
542
|
@keyframes bs-pulse{50%{opacity:.55}}
|
|
520
|
-
@
|
|
521
|
-
@
|
|
543
|
+
@container bs-settings (max-width:760px){.bs-fieldGrid,.bs-tierGrid{grid-template-columns:minmax(0,1fr)}.bs-metricGrid{grid-template-columns:repeat(2,minmax(0,1fr))}}
|
|
544
|
+
@container bs-settings (max-width:640px){.bs-header .bs-title{font-size:18px}.bs-sectionHead,.bs-cardHead,.bs-toolbar{flex-wrap:wrap}.bs-field{grid-template-columns:minmax(0,1fr);gap:4px}.bs-fieldLabel{padding:0}.bs-modelHead{display:none}.bs-model{grid-template-columns:minmax(0,1fr) var(--bs-action-size);gap:8px}.bs-modelCell{grid-column:1}.bs-cellLabel{display:block;font-size:12px;line-height:18px}.bs-model .bs-iconButton{grid-column:2;grid-row:1}.bs-footer .bs-status{flex-basis:100%}.bs-connectionRow{align-items:flex-start;flex-direction:column;gap:4px;padding:6px 0}.bs-connectionRow .bs-hint{text-align:start}.bs-routing{grid-template-columns:minmax(0,1fr);gap:4px;padding:8px}.bs-routingBranchGlyph{display:none}.bs-overviewRow{flex-wrap:wrap}.bs-overviewRow>.bs-badge{white-space:normal}.bs-advancedSummary{white-space:normal}}
|
|
545
|
+
@media(pointer:coarse),(max-width:640px){.bs-root{--bs-action-size:44px}.bs-input,.bs-select,.bs-button,.bs-iconButton,.bs-switch,.bs-tab,.bs-subtabs .bs-tab{height:44px;min-height:44px}.bs-textarea{min-height:88px}.bs-switch,.bs-iconButton{width:44px}.bs-option,.bs-advanced>summary{min-height:44px}}
|
|
522
546
|
@media(prefers-reduced-motion:reduce){.bs-root *{animation:none!important;transition:none!important}}`;
|
|
523
547
|
|
|
524
548
|
|
|
@@ -880,7 +904,7 @@ window.__ModuleLoader__.load({
|
|
|
880
904
|
}, item.active === undefined ? null : h('span', { className: 'bs-dot', 'data-active': item.active, 'aria-hidden': true }), item.label)));
|
|
881
905
|
}
|
|
882
906
|
|
|
883
|
-
function Field({ id, label, hint, showHint, wide, children }) {
|
|
907
|
+
function Field({ id, label, hint, showHint = true, wide, children }) {
|
|
884
908
|
const hintId = 'bs-hint-' + useId().replace(/[^a-zA-Z0-9_-]/g, '');
|
|
885
909
|
const control = hint === undefined || children === null || typeof children !== 'object'
|
|
886
910
|
? children
|
|
@@ -900,7 +924,7 @@ window.__ModuleLoader__.load({
|
|
|
900
924
|
return h('div', { className: 'bs-switchRow' },
|
|
901
925
|
h('div', { className: 'bs-switchMain' },
|
|
902
926
|
h('label', { className: 'bs-switchLabel', id: labelId, htmlFor: id }, label),
|
|
903
|
-
hint === undefined ? null : h('p', { className: 'bs-
|
|
927
|
+
hint === undefined ? null : h('p', { className: 'bs-hint', id: hintId }, hint)),
|
|
904
928
|
h('button', {
|
|
905
929
|
type: 'button', id, role: 'switch', className: 'bs-switch',
|
|
906
930
|
'aria-checked': checked === true, 'aria-labelledby': labelId, 'aria-describedby': hintId,
|
|
@@ -998,7 +1022,7 @@ window.__ModuleLoader__.load({
|
|
|
998
1022
|
}
|
|
999
1023
|
|
|
1000
1024
|
/**
|
|
1001
|
-
*
|
|
1025
|
+
* 一个分档:一张可见的模型卡(用途 + 模型下拉 + 思考强度),主选项不藏进折叠区。
|
|
1002
1026
|
* 已保存但不在白名单里的路由仍作为选项保留(白名单读到时标注出来),不被静默改掉。
|
|
1003
1027
|
*/
|
|
1004
1028
|
function TierRow({ tier, value, allowed, disabled, t: translate, onPatch }) {
|
|
@@ -1025,24 +1049,27 @@ window.__ModuleLoader__.load({
|
|
|
1025
1049
|
disabled: disabled || current === '',
|
|
1026
1050
|
onChange: (event) => onPatch({ reasoningEffort: event.target.value }),
|
|
1027
1051
|
}, optionNodes(selected.efforts, value.reasoningEffort, translate('tierEffortDefault')))
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
return h(
|
|
1041
|
-
h('div', { className:
|
|
1042
|
-
h('
|
|
1043
|
-
|
|
1044
|
-
h('
|
|
1045
|
-
|
|
1052
|
+
: h('input', {
|
|
1053
|
+
className: 'bs-input',
|
|
1054
|
+
type: 'text',
|
|
1055
|
+
id: 'bs-tier-' + tier + '-effort',
|
|
1056
|
+
'aria-label': effortLabel,
|
|
1057
|
+
value: value.reasoningEffort,
|
|
1058
|
+
placeholder: translate('tierEffortDefault'),
|
|
1059
|
+
spellCheck: false,
|
|
1060
|
+
autoComplete: 'off',
|
|
1061
|
+
disabled: disabled || current === '',
|
|
1062
|
+
onChange: (event) => onPatch({ reasoningEffort: event.target.value.trim() }),
|
|
1063
|
+
});
|
|
1064
|
+
return h('section', { className: 'bs-card bs-tierCard', 'aria-label': title },
|
|
1065
|
+
h('div', { className: 'bs-cardHead' },
|
|
1066
|
+
h('div', { className: 'bs-tierHead' },
|
|
1067
|
+
h('h3', { className: 'bs-cardTitle' }, title),
|
|
1068
|
+
h('p', { className: 'bs-hint' }, translate(TIER_HINT_KEYS[tier]))),
|
|
1069
|
+
h('span', { className: 'bs-badge', 'data-active': current !== '' },
|
|
1070
|
+
current === '' ? translate('tierInherit') : (selected?.model ?? value.model))),
|
|
1071
|
+
h(Field, { id: 'bs-tier-' + tier + '-route', label: translate('route') },
|
|
1072
|
+
h(Select, {
|
|
1046
1073
|
className: 'bs-select',
|
|
1047
1074
|
id: 'bs-tier-' + tier + '-route',
|
|
1048
1075
|
'aria-label': translate('tierRouteLabel', { tier: title }),
|
|
@@ -1051,10 +1078,13 @@ window.__ModuleLoader__.load({
|
|
|
1051
1078
|
// 换路由即清空 effort(旧值未必属于新模型)。
|
|
1052
1079
|
onChange: (event) => onPatch({ ...parseRouteKey(event.target.value), reasoningEffort: '' }),
|
|
1053
1080
|
}, routeOptions)),
|
|
1054
|
-
|
|
1081
|
+
current === '' ? null : h(Field, { id: 'bs-tier-' + tier + '-effort', label: translate('effort'), hint: translate('effortHint') }, effort));
|
|
1055
1082
|
}
|
|
1056
1083
|
|
|
1057
|
-
/**
|
|
1084
|
+
/**
|
|
1085
|
+
* 本机代理卡:启用、默认模型、权限后果与模型列表都在明面;
|
|
1086
|
+
* 折叠区只放真正需要专家的启动命令与 Codex 配置。
|
|
1087
|
+
*/
|
|
1058
1088
|
function BackendCard({ spec, backend, disabled, capabilities, discovery, discoveryMatches, scopeActive, t: translate, onPatch, onModelPatch, onModelAdd, onModelRemove, onDiscover, onDiagnostics, generation }) {
|
|
1059
1089
|
const title = spec.cli === 'codex' ? 'Codex' : 'Claude';
|
|
1060
1090
|
const status = discovery[spec.cli];
|
|
@@ -1065,21 +1095,23 @@ window.__ModuleLoader__.load({
|
|
|
1065
1095
|
plan: 'permissionPlan', manual: 'permissionManual', dontAsk: 'permissionDontAsk', acceptEdits: 'permissionAcceptEdits', auto: 'permissionAuto', bypassPermissions: 'permissionBypass' };
|
|
1066
1096
|
const elevated = ['danger-full-access', 'bypassPermissions'].includes(backend.permissionMode);
|
|
1067
1097
|
const modelListRef = useRef(null);
|
|
1068
|
-
const advancedRef = useRef(null);
|
|
1069
1098
|
const focusNewModel = useRef(false);
|
|
1070
1099
|
useEffect(() => {
|
|
1071
1100
|
if (!focusNewModel.current) return;
|
|
1072
1101
|
focusNewModel.current = false;
|
|
1073
1102
|
const inputs = modelListRef.current?.querySelectorAll('input[data-model-id]');
|
|
1074
|
-
inputs?.[inputs.length - 1]?.focus();
|
|
1103
|
+
inputs?.[inputs.length - 1]?.focus?.();
|
|
1075
1104
|
}, [backend.models.length]);
|
|
1076
|
-
const
|
|
1105
|
+
const expertSummary = backend.profile
|
|
1106
|
+
? translate('expertCurrent', { executable: backend.executable, profile: backend.profile })
|
|
1107
|
+
: translate('expertDefault');
|
|
1077
1108
|
return h('section', { className: 'bs-card', 'aria-label': title },
|
|
1078
1109
|
h('div', { className: 'bs-cardHead' },
|
|
1079
1110
|
h('h3', { className: 'bs-cardTitle' }, title),
|
|
1080
1111
|
h(SwitchRow, { id: 'bs-' + spec.cli + '-enabled', label: translate('backendEnable'),
|
|
1081
1112
|
checked: backend.enabled, disabled, onChange: (enabled) => onPatch({ enabled }) })),
|
|
1082
|
-
!backend.enabled ? h('p', { className: 'bs-
|
|
1113
|
+
!backend.enabled ? h('p', { className: 'bs-hint' }, translate('backendOff')) : h('div', { className: 'bs-cardBody' },
|
|
1114
|
+
!scopeActive ? h('p', { className: 'bs-note', 'data-tone': 'warn' }, translate('scopeNone')) : null,
|
|
1083
1115
|
h('div', { className: 'bs-fieldGrid' },
|
|
1084
1116
|
h(Field, { id: 'bs-' + spec.cli + '-default-model', label: translate('defaultModelLabel') },
|
|
1085
1117
|
h(Select, { className: 'bs-select', id: 'bs-' + spec.cli + '-default-model', value: backend.defaultModel,
|
|
@@ -1089,20 +1121,29 @@ window.__ModuleLoader__.load({
|
|
|
1089
1121
|
h(Select, { className: 'bs-select', id: 'bs-' + spec.cli + '-permission', value: backend.permissionMode, disabled,
|
|
1090
1122
|
onChange: (event) => onPatch({ permissionMode: event.target.value }) }, optionNodes(spec.permissions, backend.permissionMode)),
|
|
1091
1123
|
h('p', { className: elevated ? 'bs-hint bs-hintWarn' : 'bs-hint' }, translate(permissionKeys[backend.permissionMode])))),
|
|
1092
|
-
|
|
1093
|
-
h('
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1124
|
+
h('div', { className: 'bs-modelsBlock' },
|
|
1125
|
+
h('div', { className: 'bs-cardHead' },
|
|
1126
|
+
h('h4', { className: 'bs-cardTitle' }, translate('modelsLabel')),
|
|
1127
|
+
h('div', { className: 'bs-actions' },
|
|
1128
|
+
h('button', { type: 'button', id: 'bs-' + spec.cli + '-discover', className: 'bs-button', 'data-variant': 'outline',
|
|
1129
|
+
disabled: disabled || !discoveryMatches || status?.status === 'loading', 'aria-busy': status?.status === 'loading', onClick: onDiscover },
|
|
1130
|
+
status?.status === 'loading' ? h('span', { className: 'bs-spinner', 'aria-hidden': true }) : null,
|
|
1131
|
+
status?.status === 'loading' ? translate('discovering') : translate('discover')),
|
|
1132
|
+
h('button', { type: 'button', id: 'bs-' + spec.cli + '-add-model', className: 'bs-button', 'data-variant': 'outline', disabled,
|
|
1133
|
+
onClick: () => { focusNewModel.current = true; onModelAdd(); } },
|
|
1134
|
+
h('svg', { width: 14, height: 14, viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', 'aria-hidden': true }, h('path', { d: 'M12 5v14M5 12h14' })), translate('modelAdd')),
|
|
1135
|
+
h('button', { type: 'button', className: 'bs-button', onClick: onDiagnostics }, translate('diagnosticsLink')))),
|
|
1136
|
+
h('p', { className: 'bs-hint' }, translate('modelsHint') + ' ' + translate('discoverHint')),
|
|
1137
|
+
!discoveryMatches ? h('p', { className: 'bs-hint' }, translate('saveBeforeDiscover')) : null,
|
|
1138
|
+
status?.text ? h('p', { className: 'bs-hint', role: status.status === 'error' ? 'alert' : 'status', 'data-tone': status.status === 'error' ? 'error' : 'ok' }, status.text) : null,
|
|
1139
|
+
backend.models.length === 0
|
|
1140
|
+
? h('div', { className: 'bs-empty', id: 'bs-' + spec.cli + '-models-empty' }, h('p', { className: 'bs-hint' }, translate('modelsEmpty')))
|
|
1141
|
+
: h('div', { className: 'bs-models', id: 'bs-' + spec.cli + '-models', ref: modelListRef },
|
|
1142
|
+
h('div', { className: 'bs-modelHead', 'aria-hidden': true }, h('span', null, translate('modelIdPlaceholder')), h('span', null, translate('effort')), h('span', null, translate('modelDefaultEffort')), h('span')),
|
|
1143
|
+
backend.models.map((model, index) => h(ModelRow, { key: generation + ':' + index, model, index, disabled,
|
|
1144
|
+
requiredDefault: model.id.trim() === backend.defaultModel.trim(), t: translate,
|
|
1145
|
+
onPatch: (patch) => onModelPatch(index, patch), onRemove: () => onModelRemove(index) })))),
|
|
1146
|
+
h(Advanced, { label: translate('expertSettings'), summary: expertSummary },
|
|
1106
1147
|
h(Field, { id: 'bs-' + spec.cli + '-executable', label: translate('executableLabel'), hint: translate('executableHint') },
|
|
1107
1148
|
h('input', { className: 'bs-input bs-mono', type: 'text', id: 'bs-' + spec.cli + '-executable',
|
|
1108
1149
|
value: backend.executable, placeholder: spec.executable, spellCheck: false, autoComplete: 'off', disabled,
|
|
@@ -1113,16 +1154,9 @@ window.__ModuleLoader__.load({
|
|
|
1113
1154
|
h('div', { className: 'bs-profileChoices', id: 'bs-' + spec.cli + '-profiles' }, profileNames.map((profile) => h('button', {
|
|
1114
1155
|
key: profile, type: 'button', className: 'bs-button bs-mono', disabled, 'aria-label': translate('profileChoose', { profile }),
|
|
1115
1156
|
'aria-pressed': backend.profile === profile, onClick: () => onPatch({ profile }),
|
|
1116
|
-
}, profile)))) : null
|
|
1117
|
-
h(Field, { wide: true, label: translate('modelsLabel'), hint: translate('modelsHint') + ' ' + translate('discoverHint') },
|
|
1118
|
-
backend.models.length === 0 ? null : h('div', { className: 'bs-models', ref: modelListRef },
|
|
1119
|
-
h('div', { className: 'bs-modelHead', 'aria-hidden': true }, h('span', null, translate('modelIdPlaceholder')), h('span', null, translate('effort')), h('span', null, translate('modelDefaultEffort')), h('span')),
|
|
1120
|
-
backend.models.map((model, index) => h(ModelRow, { key: generation + ':' + index, model, index, disabled,
|
|
1121
|
-
requiredDefault: model.id.trim() === backend.defaultModel.trim(), t: translate,
|
|
1122
|
-
onPatch: (patch) => onModelPatch(index, patch), onRemove: () => onModelRemove(index) })))))));
|
|
1157
|
+
}, profile)))) : null)));
|
|
1123
1158
|
}
|
|
1124
1159
|
|
|
1125
|
-
|
|
1126
1160
|
/** 行配置页面主体。 */
|
|
1127
1161
|
function BetterSubagentConfigPage({ form, t: translate }) {
|
|
1128
1162
|
const state = form?.state;
|
|
@@ -1161,7 +1195,8 @@ window.__ModuleLoader__.load({
|
|
|
1161
1195
|
// 官方页面在镜像读到该命名空间前不传 form:这是正常加载窗口,
|
|
1162
1196
|
// 长期停在这里才说明本部署缺少 settings/config-editor。
|
|
1163
1197
|
return h('div', { className: 'bs-cfg' },
|
|
1164
|
-
h('p', { className: 'bs-note bs-pulse', role: 'status'
|
|
1198
|
+
h('p', { className: 'bs-note bs-pulse', role: 'status' }, translate('waitingForm')),
|
|
1199
|
+
h('p', { className: 'bs-hint' }, translate('noFormHint')));
|
|
1165
1200
|
}
|
|
1166
1201
|
if (state.status === 'loading') {
|
|
1167
1202
|
return h('div', { className: 'bs-cfg' },
|
|
@@ -1350,47 +1385,53 @@ window.__ModuleLoader__.load({
|
|
|
1350
1385
|
const panelProps = (name) => ({ id: 'bs-settings-panel-' + name, className: 'bs-tabpanel', role: 'tabpanel',
|
|
1351
1386
|
'aria-labelledby': 'bs-settings-tab-' + name, tabIndex: 0, hidden: tab !== name });
|
|
1352
1387
|
return h('div', { className: 'bs-cfg', 'data-settings-dirty': dirty, 'data-settings-busy': busy },
|
|
1353
|
-
h('div', { className: 'bs-header' },
|
|
1354
|
-
|
|
1388
|
+
h('div', { className: 'bs-header' },
|
|
1389
|
+
h('div', { className: 'bs-headerMain' },
|
|
1390
|
+
h('h2', { className: 'bs-title' }, translate('title')),
|
|
1391
|
+
h('span', { className: 'bs-headerIntro' }, translate('intro'))),
|
|
1392
|
+
h('div', { className: 'bs-headerMeta' },
|
|
1393
|
+
dirty ? h('span', { className: 'bs-badge' }, translate('draftPreview')) : null,
|
|
1394
|
+
writable ? null : h('span', { className: 'bs-badge', role: 'status', title: translate('readonly') }, translate('readonlyShort')))),
|
|
1355
1395
|
h(Tabs, { id: 'bs-settings', label: translate('title'), value: tab, onChange: setTab, tabRefs: navigationTabs, items: [
|
|
1356
1396
|
{ id: 'general', label: translate('tabGeneral') }, { id: 'cli', label: translate('tabCli') },
|
|
1357
1397
|
{ id: 'tiers', label: translate('tabTiers') }, { id: 'connection', label: translate('tabConnection') }] }),
|
|
1358
1398
|
h('div', panelProps('general'),
|
|
1399
|
+
h('section', { className: 'bs-section', 'aria-label': translate('routingTitle') },
|
|
1400
|
+
h('div', { className: 'bs-sectionHead' }, h('h3', { className: 'bs-sectionTitle' }, translate('routingTitle'))),
|
|
1401
|
+
h('p', { className: 'bs-hint' }, translate('modelRecommendations')),
|
|
1402
|
+
h('div', { className: 'bs-routingDiagram', 'data-routing': 'main-agent' },
|
|
1403
|
+
h('div', { className: 'bs-routingSource', id: 'bs-routing-source' },
|
|
1404
|
+
h('span', { className: 'bs-routingSourceLabel' }, translate('mainAgent')),
|
|
1405
|
+
h('span', { className: 'bs-hint' }, translate('mainAgentNote'))),
|
|
1406
|
+
...TIERS.map((tier) => {
|
|
1407
|
+
const value = live.tiers[tier];
|
|
1408
|
+
const current = routeKey(value);
|
|
1409
|
+
const title = translate(TIER_TITLE_KEYS[tier]);
|
|
1410
|
+
return h('div', { key: tier, className: 'bs-routing' },
|
|
1411
|
+
h('span', { className: 'bs-routingBranchGlyph', 'aria-hidden': true }, '↳'),
|
|
1412
|
+
h('div', { className: 'bs-overviewName' },
|
|
1413
|
+
h('span', { className: 'bs-routingLabel' }, title),
|
|
1414
|
+
h('span', { className: 'bs-overviewMeta' }, translate(TIER_HINT_KEYS[tier]))),
|
|
1415
|
+
h('span', { className: 'bs-routingModel bs-mono' }, current === '' ? translate('tierInherit') : current),
|
|
1416
|
+
h('button', { type: 'button', id: 'bs-tier-' + tier + '-change', className: 'bs-button', 'data-variant': 'outline',
|
|
1417
|
+
'data-tier-change': tier, onClick: () => navigate('tiers') },
|
|
1418
|
+
translate(current === '' ? 'chooseModel' : 'changeModel')));
|
|
1419
|
+
})),
|
|
1420
|
+
h('p', { className: 'bs-hint bs-routingNote' }, translate('routingNote'))),
|
|
1359
1421
|
h('section', { className: 'bs-section' },
|
|
1360
|
-
h('div', { className: 'bs-sectionHead' }, h('h3', { className: 'bs-
|
|
1361
|
-
|
|
1362
|
-
h('span', { className: 'bs-routingLabel' }, translate(tier === 'fast' ? 'tierFastTask' : 'tierQualityTask')),
|
|
1363
|
-
h('span', { className: 'bs-routingArrow', 'aria-hidden': true }, '→'),
|
|
1364
|
-
h('button', { type: 'button', className: 'bs-routingTarget bs-mono', onClick: () => navigate('tiers') },
|
|
1365
|
-
routeKey(live.tiers[tier]) || translate('tierInherit'))))),
|
|
1366
|
-
h('section', { className: 'bs-section' },
|
|
1367
|
-
h('div', { className: 'bs-sectionHead' }, h('h3', { className: 'bs-title bs-sectionTitle' }, translate('backendsTitle'))),
|
|
1422
|
+
h('div', { className: 'bs-sectionHead' }, h('h3', { className: 'bs-sectionTitle' }, translate('backendsTitle'))),
|
|
1423
|
+
h('p', { className: 'bs-hint' }, translate('backendsIntro')),
|
|
1368
1424
|
h('div', { className: 'bs-overview' }, BACKENDS.map((spec) => {
|
|
1369
1425
|
const backend = live.subagents[spec.cli];
|
|
1370
1426
|
const title = spec.cli === 'codex' ? 'Codex' : 'Claude';
|
|
1371
1427
|
return h('button', { key: spec.cli, type: 'button', id: 'bs-open-' + spec.cli, className: 'bs-overviewRow',
|
|
1372
1428
|
'aria-label': translate('configureBackend', { backend: title }), onClick: () => navigate('cli', spec.cli) },
|
|
1373
1429
|
h('span', { className: 'bs-overviewGlyph', 'aria-hidden': true }, h('svg', { width: 16, height: 16, viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', strokeWidth: 1.5, strokeLinecap: 'round', strokeLinejoin: 'round' }, h('path', { d: 'M4 5h16v14H4Zm4 5 2 2-2 2m5 0h3' }))),
|
|
1374
|
-
h('span', { className: 'bs-overviewName' },
|
|
1375
|
-
h('span',
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
backend.enabled && backend.defaultModel ? h('span', { className: 'bs-mono' }, ' · ' + backend.defaultModel) : null)),
|
|
1380
|
-
h(Chevron));
|
|
1381
|
-
}))),
|
|
1382
|
-
h('section', { className: 'bs-section' },
|
|
1383
|
-
h('div', { className: 'bs-sectionHead' }, h('h3', { className: 'bs-title bs-sectionTitle' }, translate('scopeTitle'))),
|
|
1384
|
-
h(SwitchRow, { id: 'bs-scope-eng', label: translate('scopeEng'), hint: translate('scopeEngHint'),
|
|
1385
|
-
checked: live.subagents.global ? true : live.subagents.eng, disabled: !writable || busy || live.subagents.global,
|
|
1386
|
-
onChange: (eng) => edit((current) => ({ ...current, subagents: { ...current.subagents, eng } })) }),
|
|
1387
|
-
h(SwitchRow, { id: 'bs-scope-global', label: translate('scopeGlobal'), hint: translate('scopeGlobalHint'), checked: live.subagents.global,
|
|
1388
|
-
disabled: !writable || busy, onChange: (global) => edit((current) => ({ ...current, subagents: { ...current.subagents, global } })) }),
|
|
1389
|
-
!scopeActive ? h('p', { className: 'bs-note', 'data-tone': 'warn' }, translate('scopeNone')) : null),
|
|
1390
|
-
h('section', { className: 'bs-section' },
|
|
1391
|
-
h('div', { className: 'bs-sectionHead' }, h('h3', { className: 'bs-title bs-sectionTitle' }, translate('behaviorTitle'))),
|
|
1392
|
-
h(SwitchRow, { id: 'bs-child-exit-guard', label: translate('childExitGuardLabel'), hint: translate('childExitGuardHint'),
|
|
1393
|
-
checked: live.childExitGuard, disabled: !writable || busy, onChange: (childExitGuard) => edit((current) => ({ ...current, childExitGuard })) }))),
|
|
1430
|
+
h('span', { className: 'bs-overviewName' }, h('span', null, title),
|
|
1431
|
+
h('span', { className: 'bs-overviewMeta bs-mono' }, backend.enabled ? (translate('modelCount', { count: backend.models.length }) + (backend.defaultModel ? ' · ' + backend.defaultModel : '')) : '')),
|
|
1432
|
+
h('span', { className: 'bs-badge', 'data-active': backend.enabled && scopeActive }, h('span', { className: 'bs-dot', 'data-active': backend.enabled && scopeActive, 'aria-hidden': true }),
|
|
1433
|
+
translate(!backend.enabled ? 'inactive' : !scopeActive ? 'scopeInactive' : 'configured')), h(Chevron));
|
|
1434
|
+
})))),
|
|
1394
1435
|
h('div', panelProps('cli'),
|
|
1395
1436
|
h(Tabs, { id: 'bs-backend', label: translate('tabCli'), compact: true, value: backendTab, onChange: setBackendTab,
|
|
1396
1437
|
items: BACKENDS.map((spec) => ({ id: spec.cli, label: spec.cli === 'codex' ? 'Codex' : 'Claude', active: live.subagents[spec.cli].enabled && scopeActive })) }),
|
|
@@ -1402,36 +1443,48 @@ window.__ModuleLoader__.load({
|
|
|
1402
1443
|
onModelAdd: () => addModel(spec), onModelRemove: (index) => removeModel(spec, index), onDiscover: () => discoverModels(spec), onDiagnostics: () => navigate('connection') })))),
|
|
1403
1444
|
h('div', panelProps('tiers'),
|
|
1404
1445
|
h('section', { className: 'bs-section' },
|
|
1446
|
+
h('div', { className: 'bs-sectionHead' }, h('h3', { className: 'bs-sectionTitle' }, translate('tiersTitle'))),
|
|
1447
|
+
h('p', { className: 'bs-hint' }, translate('tiersIntro')),
|
|
1405
1448
|
routesState.status === 'loading' ? h('p', { className: 'bs-hint', role: 'status' }, translate('routesLoading'))
|
|
1406
1449
|
: allowed === null ? h('p', { className: 'bs-note', 'data-tone': 'warn' }, translate('routesError'))
|
|
1407
1450
|
: !allowed.enabled || allowed.routes.length === 0 ? h('p', { className: 'bs-note', 'data-tone': 'warn' }, translate('tiersInactive')) : null,
|
|
1408
|
-
h('div', { className: 'bs-tierGrid' },
|
|
1409
|
-
|
|
1410
|
-
t: translate, onPatch: (patch) => patchTier(tier, patch) }))))),
|
|
1451
|
+
h('div', { className: 'bs-tierGrid' }, ...TIERS.map((tier) => h(TierRow, { key: tier, tier, value: live.tiers[tier], allowed, disabled: !writable || busy,
|
|
1452
|
+
t: translate, onPatch: (patch) => patchTier(tier, patch) }))))),
|
|
1411
1453
|
h('div', panelProps('connection'),
|
|
1412
1454
|
h('section', { className: 'bs-section' },
|
|
1413
|
-
h(
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1455
|
+
h('div', { className: 'bs-sectionHead' }, h('h3', { className: 'bs-sectionTitle' }, translate('scopeTitle'))),
|
|
1456
|
+
h(SwitchRow, { id: 'bs-scope-eng', label: live.subagents.global ? translate('scopeEngIncluded') : translate('scopeEng'),
|
|
1457
|
+
hint: live.subagents.global ? translate('globalOverrides') : translate('scopeEngHint'),
|
|
1458
|
+
checked: live.subagents.global ? true : live.subagents.eng, disabled: !writable || busy || live.subagents.global,
|
|
1459
|
+
onChange: (eng) => edit((current) => ({ ...current, subagents: { ...current.subagents, eng } })) }),
|
|
1460
|
+
h(SwitchRow, { id: 'bs-scope-global', label: translate('scopeGlobal'), hint: translate('scopeGlobalHint'), checked: live.subagents.global,
|
|
1461
|
+
disabled: !writable || busy, onChange: (global) => edit((current) => ({ ...current, subagents: { ...current.subagents, global } })) }),
|
|
1462
|
+
!scopeActive ? h('p', { className: 'bs-note', 'data-tone': 'warn' }, translate('scopeNone')) : null),
|
|
1463
|
+
h('section', { className: 'bs-section' },
|
|
1464
|
+
h('div', { className: 'bs-sectionHead' }, h('h3', { className: 'bs-sectionTitle' }, translate('behaviorTitle'))),
|
|
1465
|
+
h(SwitchRow, { id: 'bs-child-exit-guard', label: translate('childExitGuardLabel'), hint: translate('childExitGuardHint'),
|
|
1466
|
+
checked: live.childExitGuard, disabled: !writable || busy, onChange: (childExitGuard) => edit((current) => ({ ...current, childExitGuard })) })),
|
|
1417
1467
|
h('section', { className: 'bs-section', 'aria-label': translate('readonlyDiagnostics') },
|
|
1418
|
-
h('div', { className: 'bs-sectionHead' },
|
|
1419
|
-
h('div', { className: 'bs-toolbar' }, h('h3', { className: 'bs-title bs-sectionTitle' }, translate('readonlyDiagnostics'))),
|
|
1468
|
+
h('div', { className: 'bs-sectionHead' }, h('h3', { className: 'bs-sectionTitle' }, translate('readonlyDiagnostics')),
|
|
1420
1469
|
h('button', { type: 'button', id: 'bs-refresh', className: 'bs-button', 'data-variant': 'outline',
|
|
1421
1470
|
disabled: capabilities.status === 'loading' || routesState.status === 'loading', 'aria-busy': capabilities.status === 'loading' || routesState.status === 'loading',
|
|
1422
1471
|
onClick: () => { capabilities.reload(); routesState.reload(); } }, translate('refresh'))),
|
|
1423
|
-
h('div', { className: 'bs-
|
|
1472
|
+
h('div', { className: 'bs-metricGrid' },
|
|
1424
1473
|
h('div', { className: 'bs-metric' }, h('span', { className: 'bs-metricLabel' }, translate('connectionMode')),
|
|
1425
1474
|
h('span', { className: 'bs-metricValue' }, translate(writable ? 'connectionWritable' : 'connectionReadonly'))),
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
h('
|
|
1434
|
-
|
|
1475
|
+
h('div', { className: 'bs-metric' }, h('span', { className: 'bs-metricLabel' }, translate('capabilitiesLabel')),
|
|
1476
|
+
h('span', { className: 'bs-metricValue', role: 'status' }, capabilities.status === 'ready' ? translate('ready') : capabilities.status === 'loading' ? translate('loading') : translate('failed'))),
|
|
1477
|
+
h('div', { className: 'bs-metric' }, h('span', { className: 'bs-metricLabel' }, translate('routesLabel')),
|
|
1478
|
+
h('span', { className: 'bs-metricValue', role: 'status' }, routesState.status === 'loading' ? translate('loading')
|
|
1479
|
+
: allowed === null ? translate('failed') : !allowed.enabled ? translate('inactive') : translate('modelCount', { count: allowed.routes.length })))),
|
|
1480
|
+
...BACKENDS.map((spec) => h('div', { key: spec.cli, className: 'bs-connectionRow', 'data-backend': spec.cli },
|
|
1481
|
+
h('span', null, spec.cli === 'codex' ? 'Codex' : 'Claude'),
|
|
1482
|
+
h('p', { className: 'bs-hint bs-mono', role: 'status' }, detectionOf(capabilities, spec, host.subagents[spec.cli], translate))))),
|
|
1483
|
+
h('section', { className: 'bs-section' },
|
|
1484
|
+
h(Advanced, { label: translate('trustedHostsAdvanced'), summary: live.trustedHosts.length ? translate('trustedCount', { count: live.trustedHosts.length }) : translate('trustedDefault') },
|
|
1485
|
+
h(Field, { id: 'bs-trusted-hosts', label: translate('trustedHostsLabel'), hint: translate('trustedHostsHint') },
|
|
1486
|
+
h(HostList, { key: generation, hosts: live.trustedHosts, disabled: !writable || busy, t: translate,
|
|
1487
|
+
onChange: (trustedHosts) => edit((current) => ({ ...current, trustedHosts })) }))))),
|
|
1435
1488
|
notice !== null || invalid !== null ? h('div', { className: 'bs-feedback' }, status) : null,
|
|
1436
1489
|
dirty ? h('div', { className: 'bs-footer' },
|
|
1437
1490
|
h('span', { className: 'bs-status' }, translate('changeCount', { count: changeCount })),
|