openclaw-plugin-model-fetch 0.0.0-stage → 0.2.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ado Shan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,281 @@
1
- # Temporary Holding Version
1
+ # OpenClaw Model Fetch
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![CI](https://github.com/AdoShan/OpenClaw-ModelFetch/actions/workflows/ci.yml/badge.svg)](https://github.com/AdoShan/OpenClaw-ModelFetch/actions/workflows/ci.yml)
4
+ [![npm version](https://img.shields.io/npm/v/openclaw-plugin-model-fetch.svg)](https://www.npmjs.com/package/openclaw-plugin-model-fetch)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
6
+
7
+ 在 OpenClaw Control UI 中获取指定 Provider 的远端模型,按 Provider 独立配置包含正则、排除正则和手动白名单,再将确认后的模型列表写入 `models.providers.<providerId>.models`,供 WebUI 选用。
8
+
9
+ ## 功能
10
+
11
+ - 支持 OpenAI 兼容 Provider、Anthropic 兼容 Provider、Ollama 和 OpenRouter。
12
+ - 支持“获取远端模型”和“应用策略到配置”两个独立步骤,获取操作不会修改配置。
13
+ - 每个 Provider 独立保存筛选策略,切换 Provider 不会混用正则或白名单。
14
+ - 包含正则、排除正则和手动白名单可以组合使用;手动勾选的模型不会被排除正则删除。
15
+ - 正则输入框失焦或按 Enter 后更新筛选结果,非法正则会阻止保存和应用。
16
+ - 应用策略前自动重新获取模型并生成删除清单;确认期间列表或配置发生变化时取消写入。
17
+ - 默认使用替换模式,最终配置只保留当前策略选中的远端模型和已手动选择的模型。
18
+ - 已有模型 ID 会保留原有的名称、价格、模态等扩展字段,不暴露 Provider API Key。
19
+ - 选择“覆盖 Agent”后,应用策略会同步该 Agent 的 allowlist 与模型映射:新增本次选中的模型,并移除该 Provider 下已取消选择的精确条目,避免 WebUI 继续显示过期模型。
20
+
21
+ ## 环境要求
22
+
23
+ - Node.js 24.16 或更新版本
24
+ - OpenClaw `2026.10.5` 或更新版本
25
+ - 已配置至少一个 `models.providers.<providerId>`,并完成该 Provider 的认证
26
+
27
+ ## 安装
28
+
29
+ 在仓库目录构建并检查插件:
30
+
31
+ ```bash
32
+ npm install
33
+ npm run plugin:build
34
+ npm run plugin:validate
35
+ ```
36
+
37
+ 从当前目录安装:
38
+
39
+ ```bash
40
+ openclaw plugins install /absolute/path/to/OpenClaw-ModelFetch
41
+ ```
42
+
43
+ 本地开发时建议使用链接安装,修改后重新构建:
44
+
45
+ ```bash
46
+ openclaw plugins install /absolute/path/to/OpenClaw-ModelFetch --link
47
+ npm run plugin:build
48
+ ```
49
+
50
+ 可用以下命令检查插件状态:
51
+
52
+ ```bash
53
+ openclaw plugins list
54
+ openclaw plugins doctor
55
+ ```
56
+
57
+ ## 开启设置界面
58
+
59
+ 自定义插件 UI 默认关闭。打开与 Gateway 同源的 Control UI 后,进入:
60
+
61
+ **Settings → Labs → Custom plugin UI**
62
+
63
+ 开启后刷新浏览器页面,Control UI 侧边栏会出现 **Model Fetch**。如果使用已安装的本地插件但没有看到菜单,请依次确认:
64
+
65
+ 1. `openclaw plugins list` 中插件已启用且没有配置错误。
66
+ 2. Custom plugin UI 已开启。
67
+ 3. 已经运行 `npm run plugin:build`,并刷新 Control UI。
68
+ 4. Control UI 与 Gateway 同源,且使用 HTTPS 或浏览器可信的 loopback 地址。
69
+
70
+ 等价的配置项是:
71
+
72
+ ```json5
73
+ {
74
+ gateway: {
75
+ controlUi: {
76
+ experimental: {
77
+ customPlugins: true,
78
+ },
79
+ },
80
+ },
81
+ }
82
+ ```
83
+
84
+ 插件不自行绘制 OpenClaw 的应用侧边栏;页面和导航由 Control UI 宿主管理。
85
+
86
+ ### 常见问题:安装后看不到 Model Fetch 设置页
87
+
88
+ 可按以下顺序排查:
89
+
90
+ 1. 确认插件已安装并启用:
91
+
92
+ ```bash
93
+ openclaw plugins list
94
+ openclaw plugins doctor
95
+ ```
96
+
97
+ 2. 确认已经重新构建并让 Gateway 读取到最新 `openclaw.plugin.json`:
98
+
99
+ ```bash
100
+ npm run plugin:build
101
+ ```
102
+
103
+ 3. 重启 Gateway 或刷新 Control UI 页面,再进入:
104
+
105
+ - 设置页入口:`/settings/plugins/model-fetch?view=settings`
106
+ - 插件页面入口:`/plugin?plugin=model-fetch&id=model-fetch`
107
+
108
+ 4. 若页面可打开但无功能,请检查浏览器控制台是否有报错,并优先确认插件 session action 返回值是 JSON 兼容对象(本插件当前实现已按 JSON 兼容返回)。
109
+
110
+ ## 使用流程
111
+
112
+ 1. 打开 **Model Fetch**,在当前 Provider 下拉框中选择目标 Provider。
113
+ 2. 点击 **获取远端模型**。这一步只读取远端模型列表,不写入配置。
114
+ 3. 设置包含正则、排除正则,或勾选白名单模型。勾选只会把模型加入白名单,不会立即修改 OpenClaw 配置。
115
+ 4. 在“覆盖 Agent”里勾选要同步 allowlist 的 agent(仅对已配置 modelPolicy.allow 的 agent 生效)。
116
+ 5. 点击 **保存策略**,保存当前 Provider 的独立筛选配置与目标 agent。
117
+ 6. 点击 **应用策略到配置**。插件会重新获取远端模型并检查配置。
118
+ 7. 如果这次操作会删除已有模型,确认弹窗会逐项列出即将删除的模型。确认后才会写入。
119
+ 8. 回到 OpenClaw 的 Models 页面,即可选用新写入的模型。
120
+
121
+ 如果你启用了模型策略 allowlist(`agents.defaults.modelPolicy.allow` 或 `agents.entries.<agent>.modelPolicy.allow` 非空),插件在应用策略时会同步本次写入的 `provider/model`。对“覆盖 Agent”中选中的 Agent,同步会移除该 Provider 下已取消选择的精确模型条目;其他 Provider、通配规则(如 `provider/*`)和保留模型的自定义 Agent 配置不会被删除。
122
+
123
+ 应用默认采用替换模式:当前 Provider 中未被策略选中的模型会被删除。若预览后远端列表、筛选策略或配置中的模型发生变化,本次写入会中止并要求重新预览。
124
+
125
+ ## 筛选规则
126
+
127
+ - `includeRegex`:仅选择模型 ID 匹配该 JavaScript 正则的模型。留空时不按正则限制。
128
+ - `excludeRegex`:从正则选择结果中排除匹配的模型。
129
+ - `manualIds`:精确手动白名单。存在白名单且 `includeRegex` 为空时,只选择白名单模型。
130
+ - 手动白名单优先:白名单中的模型即使匹配排除正则,仍会被选择。
131
+ - 手动白名单中的模型如果仍存在于配置中,会继续保留,即使远端这次没有返回它。
132
+ - `replace`:插件默认使用 `true`。设置界面始终按替换模式运行;Agent 工具调用可显式传入 `false`,只增加模型而不删除旧模型。
133
+ - 非法正则不会被保存或应用。
134
+
135
+ Provider 策略保存在插件配置中:
136
+
137
+ ```json
138
+ {
139
+ "plugins": {
140
+ "entries": {
141
+ "model-fetch": {
142
+ "config": {
143
+ "providers": {
144
+ "openrouter": {
145
+ "filter": {
146
+ "includeRegex": "^(openai|anthropic)/",
147
+ "excludeRegex": "(embed|rerank)",
148
+ "manualIds": ["openai/gpt-4o-mini"],
149
+ "replace": true
150
+ }
151
+ },
152
+ "ollama": {
153
+ "filter": {
154
+ "manualIds": ["qwen3:latest", "llama3.1:8b"],
155
+ "replace": true
156
+ }
157
+ }
158
+ }
159
+ }
160
+ }
161
+ }
162
+ }
163
+ }
164
+ ```
165
+
166
+ ## Agent 工具
167
+
168
+ 工具名称为 `model_fetch`。只使用已保存策略刷新并写入配置:
169
+
170
+ ```json
171
+ {
172
+ "provider": "openrouter"
173
+ }
174
+ ```
175
+
176
+ 使用临时筛选做 dry run,不写配置:
177
+
178
+ ```json
179
+ {
180
+ "provider": "openrouter",
181
+ "includeRegex": "anthropic/",
182
+ "dryRun": true
183
+ }
184
+ ```
185
+
186
+ 临时手动选择模型:
187
+
188
+ ```json
189
+ {
190
+ "provider": "ollama",
191
+ "manualIds": ["qwen3:latest", "llama3.1:8b"]
192
+ }
193
+ ```
194
+
195
+ 工具结果包含 Provider、远端模型数、最终选中的模型 ID、新增/未变/删除数量、配置路径以及是否已持久化。
196
+
197
+ ## Provider 示例
198
+
199
+ ```json
200
+ {
201
+ "models": {
202
+ "providers": {
203
+ "openrouter": {
204
+ "baseUrl": "https://openrouter.ai/api/v1",
205
+ "api": "openai-responses",
206
+ "models": []
207
+ }
208
+ }
209
+ }
210
+ }
211
+ ```
212
+
213
+ Ollama 或其他本地地址需要显式允许私有网络访问:
214
+
215
+ ```json
216
+ {
217
+ "models": {
218
+ "providers": {
219
+ "ollama": {
220
+ "baseUrl": "http://127.0.0.1:11434",
221
+ "api": "ollama",
222
+ "request": {
223
+ "allowPrivateNetwork": true
224
+ },
225
+ "models": []
226
+ }
227
+ }
228
+ }
229
+ }
230
+ ```
231
+
232
+ ## 开发
233
+
234
+ ```bash
235
+ npm test
236
+ npm run typecheck
237
+ npm run plugin:build
238
+ npm run plugin:validate
239
+ ```
240
+
241
+ 浏览器界面源文件是 `src/control-ui.ts` 和 `src/settings-view.ts`。`npm run plugin:build` 会生成带内容哈希的 `dist/control-ui/` 资源,并更新 `openclaw.plugin.json.controlUi`。
242
+
243
+ ## 发布到 npm
244
+
245
+ 发布走 GitHub Actions 的 **Trusted Publishing(OIDC)**,仓库里不保存任何长期 token。
246
+
247
+ ### 一次性引导
248
+
249
+ 1. 本地登录并发布首版(走你自己的 2FA,不产生任何 token):
250
+
251
+ ```bash
252
+ npm login
253
+ npm publish
254
+ ```
255
+
256
+ 2. 在包设置页配置可信发布者:
257
+ <https://www.npmjs.com/package/openclaw-plugin-model-fetch/settings>
258
+
259
+ | 字段 | 值 |
260
+ |---|---|
261
+ | Provider | GitHub Actions |
262
+ | Organization / user | AdoShan |
263
+ | Repository | OpenClaw-ModelFetch |
264
+ | Workflow filename | `publish.yml` |
265
+
266
+ ### 之后每次发布
267
+
268
+ ```bash
269
+ npm version 0.3.0
270
+ git push --follow-tags
271
+ ```
272
+
273
+ `v*` tag 触发 `.github/workflows/publish.yml`:先校验 tag 与 `package.json` 版本一致(不一致直接失败),
274
+ 再跑 typecheck → test → build → validate,最后 `npm publish --provenance`。
275
+
276
+ ### 持续集成
277
+
278
+ `.github/workflows/ci.yml` 在 push 到 `main` 和 PR 时运行同一套校验(不含发布),
279
+ 并附一次 `npm publish --dry-run` 预览实际会打进 npm 包的产物。
280
+
281
+ > 注意:某个版本号首次发布后不可撤回,`npm unpublish` 需等 24 小时且仅对无人安装过的版本生效。
@@ -0,0 +1,158 @@
1
+ export declare const modelFetchContract: {
2
+ readonly pluginId: "model-fetch";
3
+ readonly operations: {
4
+ readonly "providers.list": {
5
+ readonly kind: "query";
6
+ readonly description: "List configured model providers and their independent fetch filters.";
7
+ readonly input: import("typebox").TObject<{}>;
8
+ readonly output: import("typebox").TObject<{
9
+ providers: import("typebox").TArray<import("typebox").TObject<{
10
+ id: import("typebox").TString;
11
+ label: import("typebox").TString;
12
+ api: import("typebox").TString;
13
+ baseUrl: import("typebox").TString;
14
+ configPath: import("typebox").TString;
15
+ filter: import("typebox").TObject<{
16
+ includeRegex: import("typebox").TOptional<import("typebox").TString>;
17
+ excludeRegex: import("typebox").TOptional<import("typebox").TString>;
18
+ manualIds: import("typebox").TOptional<import("typebox").TArray<import("typebox").TString>>;
19
+ replace: import("typebox").TOptional<import("typebox").TBoolean>;
20
+ }>;
21
+ targetAgents: import("typebox").TArray<import("typebox").TString>;
22
+ configuredModels: import("typebox").TArray<import("typebox").TObject<{
23
+ id: import("typebox").TString;
24
+ name: import("typebox").TString;
25
+ contextWindow: import("typebox").TOptional<import("typebox").TInteger>;
26
+ }>>;
27
+ }>>;
28
+ agents: import("typebox").TArray<import("typebox").TObject<{
29
+ id: import("typebox").TString;
30
+ hasModelAllowlist: import("typebox").TBoolean;
31
+ }>>;
32
+ }>;
33
+ };
34
+ readonly "models.fetch": {
35
+ readonly kind: "query";
36
+ readonly description: "Fetch a provider's current remote model list without changing OpenClaw config.";
37
+ readonly input: import("typebox").TObject<{
38
+ provider: import("typebox").TString;
39
+ }>;
40
+ readonly output: import("typebox").TObject<{
41
+ provider: import("typebox").TString;
42
+ fetchedAt: import("typebox").TString;
43
+ models: import("typebox").TArray<import("typebox").TObject<{
44
+ id: import("typebox").TString;
45
+ name: import("typebox").TString;
46
+ contextWindow: import("typebox").TOptional<import("typebox").TInteger>;
47
+ }>>;
48
+ }>;
49
+ };
50
+ readonly "strategy.save": {
51
+ readonly kind: "action";
52
+ readonly description: "Save one provider's independent model selection strategy.";
53
+ readonly input: import("typebox").TObject<{
54
+ provider: import("typebox").TString;
55
+ filter: import("typebox").TObject<{
56
+ includeRegex: import("typebox").TOptional<import("typebox").TString>;
57
+ excludeRegex: import("typebox").TOptional<import("typebox").TString>;
58
+ manualIds: import("typebox").TOptional<import("typebox").TArray<import("typebox").TString>>;
59
+ replace: import("typebox").TOptional<import("typebox").TBoolean>;
60
+ }>;
61
+ targetAgents: import("typebox").TOptional<import("typebox").TArray<import("typebox").TString>>;
62
+ }>;
63
+ readonly output: import("typebox").TObject<{
64
+ provider: import("typebox").TString;
65
+ savedAt: import("typebox").TString;
66
+ configPath: import("typebox").TString;
67
+ filter: import("typebox").TObject<{
68
+ includeRegex: import("typebox").TOptional<import("typebox").TString>;
69
+ excludeRegex: import("typebox").TOptional<import("typebox").TString>;
70
+ manualIds: import("typebox").TOptional<import("typebox").TArray<import("typebox").TString>>;
71
+ replace: import("typebox").TOptional<import("typebox").TBoolean>;
72
+ }>;
73
+ targetAgents: import("typebox").TArray<import("typebox").TString>;
74
+ }>;
75
+ };
76
+ readonly "strategy.preview": {
77
+ readonly kind: "action";
78
+ readonly description: "Fetch the provider again, apply its saved strategy, and return the exact pending config changes.";
79
+ readonly input: import("typebox").TObject<{
80
+ provider: import("typebox").TString;
81
+ }>;
82
+ readonly output: import("typebox").TObject<{
83
+ provider: import("typebox").TString;
84
+ plan: import("typebox").TObject<{
85
+ fingerprint: import("typebox").TString;
86
+ fetchedAt: import("typebox").TString;
87
+ fetchedCount: import("typebox").TInteger;
88
+ addedIds: import("typebox").TArray<import("typebox").TString>;
89
+ removedIds: import("typebox").TArray<import("typebox").TString>;
90
+ selectedIds: import("typebox").TArray<import("typebox").TString>;
91
+ unchangedCount: import("typebox").TInteger;
92
+ }>;
93
+ models: import("typebox").TArray<import("typebox").TObject<{
94
+ id: import("typebox").TString;
95
+ name: import("typebox").TString;
96
+ contextWindow: import("typebox").TOptional<import("typebox").TInteger>;
97
+ }>>;
98
+ }>;
99
+ };
100
+ readonly "strategy.apply": {
101
+ readonly kind: "action";
102
+ readonly description: "Re-fetch a provider, verify the confirmed deletion list, and replace its configured models.";
103
+ readonly input: import("typebox").TObject<{
104
+ provider: import("typebox").TString;
105
+ fingerprint: import("typebox").TString;
106
+ expectedRemovals: import("typebox").TArray<import("typebox").TString>;
107
+ targetAgents: import("typebox").TOptional<import("typebox").TArray<import("typebox").TString>>;
108
+ }>;
109
+ readonly output: import("typebox").TObject<{
110
+ provider: import("typebox").TString;
111
+ persisted: import("typebox").TBoolean;
112
+ configPath: import("typebox").TString;
113
+ fetchedAt: import("typebox").TString;
114
+ fetchedCount: import("typebox").TInteger;
115
+ added: import("typebox").TInteger;
116
+ unchanged: import("typebox").TInteger;
117
+ removed: import("typebox").TInteger;
118
+ selectedIds: import("typebox").TArray<import("typebox").TString>;
119
+ targetAgents: import("typebox").TArray<import("typebox").TString>;
120
+ syncedAgents: import("typebox").TArray<import("typebox").TString>;
121
+ models: import("typebox").TArray<import("typebox").TObject<{
122
+ id: import("typebox").TString;
123
+ name: import("typebox").TString;
124
+ contextWindow: import("typebox").TOptional<import("typebox").TInteger>;
125
+ }>>;
126
+ }>;
127
+ };
128
+ readonly "provider.refresh": {
129
+ readonly kind: "action";
130
+ readonly description: "Fetch a configured provider's models, apply its independent strategy, and persist the replacement model list.";
131
+ readonly input: import("typebox").TObject<{
132
+ provider: import("typebox").TString;
133
+ includeRegex: import("typebox").TOptional<import("typebox").TString>;
134
+ excludeRegex: import("typebox").TOptional<import("typebox").TString>;
135
+ manualIds: import("typebox").TOptional<import("typebox").TArray<import("typebox").TString>>;
136
+ replace: import("typebox").TOptional<import("typebox").TBoolean>;
137
+ dryRun: import("typebox").TOptional<import("typebox").TBoolean>;
138
+ }>;
139
+ readonly output: import("typebox").TObject<{
140
+ provider: import("typebox").TString;
141
+ fetched: import("typebox").TInteger;
142
+ selected: import("typebox").TArray<import("typebox").TString>;
143
+ added: import("typebox").TInteger;
144
+ unchanged: import("typebox").TInteger;
145
+ removed: import("typebox").TInteger;
146
+ replace: import("typebox").TBoolean;
147
+ dryRun: import("typebox").TBoolean;
148
+ configPath: import("typebox").TString;
149
+ persisted: import("typebox").TBoolean;
150
+ }>;
151
+ readonly tool: {
152
+ readonly name: "model_fetch";
153
+ readonly label: "Fetch Provider Models";
154
+ };
155
+ };
156
+ };
157
+ readonly events: {};
158
+ };
@@ -0,0 +1,48 @@
1
+ import { defineFeatureContract } from "openclaw/plugin-sdk/feature-contract";
2
+ import { applyStrategyInputSchema, applyStrategyOutputSchema, emptyInputSchema, fetchModelsOutputSchema, listProvidersOutputSchema, modelFetchParameters, modelFetchResultSchema, previewApplyOutputSchema, providerInputSchema, saveStrategyInputSchema, saveStrategyOutputSchema, } from "./schemas.js";
3
+ export const modelFetchContract = defineFeatureContract({
4
+ pluginId: "model-fetch",
5
+ operations: {
6
+ "providers.list": {
7
+ kind: "query",
8
+ description: "List configured model providers and their independent fetch filters.",
9
+ input: emptyInputSchema,
10
+ output: listProvidersOutputSchema,
11
+ },
12
+ "models.fetch": {
13
+ kind: "query",
14
+ description: "Fetch a provider's current remote model list without changing OpenClaw config.",
15
+ input: providerInputSchema,
16
+ output: fetchModelsOutputSchema,
17
+ },
18
+ "strategy.save": {
19
+ kind: "action",
20
+ description: "Save one provider's independent model selection strategy.",
21
+ input: saveStrategyInputSchema,
22
+ output: saveStrategyOutputSchema,
23
+ },
24
+ "strategy.preview": {
25
+ kind: "action",
26
+ description: "Fetch the provider again, apply its saved strategy, and return the exact pending config changes.",
27
+ input: providerInputSchema,
28
+ output: previewApplyOutputSchema,
29
+ },
30
+ "strategy.apply": {
31
+ kind: "action",
32
+ description: "Re-fetch a provider, verify the confirmed deletion list, and replace its configured models.",
33
+ input: applyStrategyInputSchema,
34
+ output: applyStrategyOutputSchema,
35
+ },
36
+ "provider.refresh": {
37
+ kind: "action",
38
+ description: "Fetch a configured provider's models, apply its independent strategy, and persist the replacement model list.",
39
+ input: modelFetchParameters,
40
+ output: modelFetchResultSchema,
41
+ tool: {
42
+ name: "model_fetch",
43
+ label: "Fetch Provider Models",
44
+ },
45
+ },
46
+ },
47
+ events: {},
48
+ });
@@ -0,0 +1 @@
1
+ .mf-page{--mf-surface: var(--card, var(--bg-elevated, #ffffff));--mf-surface-muted: var(--bg-elevated, #f7f8f8);--mf-text: var(--text-strong, var(--text, #1b2429));--mf-muted: var(--muted, #657078);--mf-border: var(--border, #d9e0e3);--mf-border-strong: var(--border-strong, #bcc8cc);--mf-accent: var(--accent, #176b62);--mf-accent-text: var(--accent-foreground, #ffffff);--mf-success: var(--ok, #256d45);--mf-warning: var(--warn, #9a5b0a);--mf-danger: var(--danger, #b33a3a);--mf-radius: var(--radius-md, 8px);box-sizing:border-box;width:min(100%,1080px);min-width:0;margin:0 auto;padding:24px 24px 112px;color:var(--mf-text);font-family:var(--font-body, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif)}.mf-page *,.mf-page *:before,.mf-page *:after{box-sizing:border-box}.mf-page button,.mf-page input,.mf-page select{font:inherit}.mf-page button{cursor:pointer}.mf-header{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;padding-bottom:18px}.mf-heading{min-width:0}.mf-eyebrow{margin:0 0 5px;color:var(--mf-accent);font-size:11px;font-weight:700;letter-spacing:0;text-transform:uppercase}.mf-title{margin:0;color:var(--mf-text);font-size:25px;font-weight:650;letter-spacing:0;line-height:1.2}.mf-subhead{max-width:680px;margin:6px 0 0;color:var(--mf-muted);font-size:14px;line-height:1.5}.mf-provider-area{flex:0 0 auto;display:grid;justify-items:end;gap:7px;min-width:210px}.mf-provider-picker{display:grid;gap:5px;width:100%}.mf-provider-picker>span{color:var(--mf-muted);font-size:10px;font-weight:650;letter-spacing:0;text-transform:uppercase}.mf-select,.mf-input,.mf-search{width:100%;min-height:36px;border:1px solid var(--mf-border-strong);border-radius:6px;outline:none;background:var(--mf-surface);color:var(--mf-text);padding:7px 10px}.mf-select:focus,.mf-input:focus,.mf-search:focus{border-color:var(--mf-accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--mf-accent) 14%,transparent)}.mf-input[aria-invalid=true]{border-color:var(--mf-danger)}.mf-connection{display:inline-flex;align-items:center;gap:7px;min-height:28px;border:1px solid var(--mf-border);border-radius:999px;background:var(--mf-surface);color:var(--mf-muted);padding:0 10px;font-size:11px;white-space:nowrap}.mf-connection-dot{width:7px;height:7px;border-radius:999px;background:var(--mf-success)}.mf-connection.is-offline .mf-connection-dot{background:var(--mf-warning)}.mf-config-path{max-width:320px;color:var(--mf-muted);font-family:var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);font-size:10px;line-height:1.4;overflow-wrap:anywhere;text-align:right}.mf-summary{display:flex;align-items:stretch;min-height:66px;margin-bottom:18px;overflow:hidden;border:1px solid var(--mf-border);border-radius:var(--mf-radius);background:var(--mf-surface)}.mf-stat{min-width:0;display:flex;align-items:center;gap:8px;padding:10px 16px}.mf-stat+.mf-stat{border-left:1px solid var(--mf-border)}.mf-stat-label,.mf-stat-note{color:var(--mf-muted);font-size:10px;white-space:nowrap}.mf-stat-value{color:var(--mf-text);font-size:18px;font-variant-numeric:tabular-nums;font-weight:650}.mf-summary-action{display:flex;align-items:center;margin-left:auto;border-left:1px solid var(--mf-border);background:var(--mf-surface-muted);padding:9px 12px}.mf-panel{overflow:hidden;border:1px solid var(--mf-border);border-radius:var(--mf-radius);background:var(--mf-surface)}.mf-panel+.mf-panel{margin-top:18px}.mf-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;border-bottom:1px solid var(--mf-border);padding:17px 20px 14px}.mf-panel-title{margin:0;color:var(--mf-text);font-size:15px;font-weight:650;line-height:1.3}.mf-panel-copy{margin:4px 0 0;color:var(--mf-muted);font-size:12px;line-height:1.45}.mf-panel-actions{flex:0 0 auto;display:flex;align-items:center;gap:8px}.mf-filter-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;padding:18px 20px 0}.mf-field{display:grid;gap:6px;min-width:0}.mf-field-label{display:flex;justify-content:space-between;gap:10px;color:var(--mf-text);font-size:12px;font-weight:650}.mf-field-label code{color:var(--mf-muted);font-family:var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);font-size:10px;font-weight:400}.mf-field-note{min-height:16px;color:var(--mf-muted);font-size:11px;line-height:1.45}.mf-field-note.is-error{color:var(--mf-danger)}.mf-filter-lower{display:grid;gap:12px;padding:17px 20px 20px}.mf-section-label{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:7px;color:var(--mf-text);font-size:12px;font-weight:650}.mf-count{min-width:22px;height:20px;display:inline-grid;place-items:center;border-radius:999px;background:color-mix(in srgb,var(--mf-accent) 10%,transparent);color:var(--mf-accent);padding:0 7px;font-size:11px;font-variant-numeric:tabular-nums}.mf-chip-box{min-height:50px;display:flex;flex-wrap:wrap;align-content:flex-start;gap:6px;border:1px dashed var(--mf-border-strong);border-radius:6px;background:var(--mf-surface-muted);padding:8px}.mf-agent-box{min-height:44px;display:grid;gap:6px;border:1px dashed var(--mf-border-strong);border-radius:6px;background:var(--mf-surface-muted);padding:8px}.mf-agent-item{min-height:26px;display:inline-flex;align-items:center;gap:7px;color:var(--mf-text);font-size:12px}.mf-agent-item .mf-model-check{flex:0 0 auto}.mf-chip-empty{color:var(--mf-muted);padding:7px 4px;font-size:12px}.mf-chip{max-width:100%;height:26px;display:inline-flex;align-items:center;gap:5px;border:1px solid color-mix(in srgb,var(--mf-accent) 28%,var(--mf-border));border-radius:999px;background:color-mix(in srgb,var(--mf-accent) 9%,var(--mf-surface));color:var(--mf-accent);padding:0 5px 0 9px;font-family:var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);font-size:10px}.mf-chip>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mf-chip button{width:19px;height:19px;display:grid;place-items:center;border:0;border-radius:999px;background:transparent;color:inherit;padding:0;font-size:14px;line-height:1}.mf-chip button:hover{background:color-mix(in srgb,var(--mf-accent) 13%,transparent)}.mf-replace-note{display:flex;align-items:flex-start;gap:9px;border:1px solid color-mix(in srgb,var(--mf-warning) 32%,var(--mf-border));border-radius:6px;background:color-mix(in srgb,var(--mf-warning) 8%,var(--mf-surface));color:color-mix(in srgb,var(--mf-warning) 80%,var(--mf-text));padding:10px 12px;font-size:11px;line-height:1.45}.mf-replace-note:before{content:"!";flex:0 0 auto;width:17px;height:17px;display:grid;place-items:center;border:1px solid var(--mf-warning);border-radius:999px;color:var(--mf-warning);font-weight:700;line-height:1}.mf-replace-note strong{display:block;margin-bottom:1px;color:var(--mf-text);font-size:12px}.mf-search-wrap{position:relative;width:min(280px,40vw);min-width:210px}.mf-search{padding-left:30px}.mf-search-icon{position:absolute;top:50%;left:10px;width:12px;height:12px;border:1.5px solid var(--mf-muted);border-radius:999px;pointer-events:none;transform:translateY(-50%)}.mf-search-icon:after{content:"";position:absolute;right:-4px;bottom:-2px;width:5px;height:1.5px;background:var(--mf-muted);transform:rotate(45deg)}.mf-table-wrap{overflow-x:auto}.mf-table{width:100%;min-width:720px;border-collapse:collapse}.mf-table th,.mf-table td{border-bottom:1px solid var(--mf-border);padding:10px 14px;text-align:left;vertical-align:middle}.mf-table th{background:var(--mf-surface-muted);color:var(--mf-muted);font-size:11px;font-weight:600;white-space:nowrap}.mf-table tr:last-child td{border-bottom:0}.mf-table tbody tr:hover{background:color-mix(in srgb,var(--mf-text) 2.5%,transparent)}.mf-check-cell{width:54px;text-align:center!important}.mf-model-check{width:16px;height:16px;accent-color:var(--mf-accent)}.mf-model-id{color:var(--mf-text);font-family:var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);font-size:12px;overflow-wrap:anywhere}.mf-model-name,.mf-model-context{color:var(--mf-muted);font-size:12px}.mf-model-context{white-space:nowrap;font-variant-numeric:tabular-nums}.mf-badge{display:inline-flex;align-items:center;min-height:22px;border-radius:999px;padding:0 8px;font-size:10px;font-weight:600;white-space:nowrap}.mf-badge.is-selected{background:color-mix(in srgb,var(--mf-success) 11%,transparent);color:var(--mf-success)}.mf-badge.is-manual{background:color-mix(in srgb,var(--mf-accent) 10%,transparent);color:var(--mf-accent)}.mf-badge.is-muted{background:color-mix(in srgb,var(--mf-muted) 10%,transparent);color:var(--mf-muted)}.mf-badge.is-removed{background:color-mix(in srgb,var(--mf-danger) 10%,transparent);color:var(--mf-danger)}.mf-empty{color:var(--mf-muted);padding:36px 18px;font-size:13px;text-align:center}.mf-error{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px;border:1px solid color-mix(in srgb,var(--mf-danger) 32%,var(--mf-border));border-radius:7px;background:color-mix(in srgb,var(--mf-danger) 7%,var(--mf-surface));color:var(--mf-danger);padding:10px 12px;font-size:12px;line-height:1.5}.mf-error[hidden]{display:none}.mf-action-bar{position:sticky;bottom:0;z-index:4;display:flex;align-items:center;justify-content:space-between;gap:20px;margin:18px -24px -112px;border-top:1px solid var(--mf-border);background:color-mix(in srgb,var(--mf-surface) 96%,transparent);padding:13px 24px;backdrop-filter:blur(8px)}.mf-save-state{color:var(--mf-muted);font-size:12px;line-height:1.45}.mf-save-state.is-dirty{color:var(--mf-warning)}.mf-actions{display:flex;gap:8px}.mf-button{min-height:36px;border:1px solid var(--mf-border-strong);border-radius:6px;background:var(--mf-surface);color:var(--mf-text);padding:0 14px;font-weight:600;line-height:1.3}.mf-button:hover:not(:disabled){background:var(--mf-surface-muted)}.mf-button.is-primary{border-color:var(--mf-accent);background:var(--mf-accent);color:var(--mf-accent-text)}.mf-button.is-primary:hover:not(:disabled){background:color-mix(in srgb,var(--mf-accent) 88%,#000000)}.mf-button.is-danger{border-color:var(--mf-danger);background:var(--mf-danger);color:#fff}.mf-button.is-small{min-height:30px;padding:0 10px;font-size:12px}.mf-button:disabled{cursor:not-allowed;opacity:.5}.mf-dialog{width:min(560px,calc(100vw - 32px));max-height:min(720px,calc(100dvh - 32px));overflow:auto;border:1px solid var(--mf-border);border-radius:8px;background:var(--mf-surface);color:var(--mf-text);padding:0;box-shadow:var(--shadow-xl, 0 24px 64px rgba(27, 36, 41, .22))}.mf-dialog::backdrop{background:#0f121485}.mf-dialog-head{border-bottom:1px solid var(--mf-border);padding:19px 20px 14px}.mf-dialog-head h3{margin:0;color:var(--mf-text);font-size:17px;font-weight:650;line-height:1.3}.mf-dialog-head p,.mf-dialog-body>p{margin:5px 0 0;color:var(--mf-muted);font-size:12px;line-height:1.5}.mf-dialog-body{padding:16px 20px}.mf-dialog-body>p{margin:0 0 10px}.mf-delete-list{max-height:260px;overflow:auto;display:grid;gap:2px;border:1px solid var(--mf-border);border-radius:6px;background:color-mix(in srgb,var(--mf-danger) 6%,var(--mf-surface));padding:7px}.mf-delete-list code{color:var(--mf-danger);padding:6px 7px;font-family:var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);font-size:11px;overflow-wrap:anywhere}.mf-dialog-actions{display:flex;justify-content:flex-end;gap:8px;border-top:1px solid var(--mf-border);padding:13px 20px}.mf-loading{min-height:240px;display:grid;place-items:center;color:var(--mf-muted);font-size:13px}.mf-visually-hidden{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important}@media(max-width:900px){.mf-page{padding:20px 16px 112px}.mf-stat{padding:9px 12px}.mf-stat-note{display:none}.mf-action-bar{margin-inline:-16px;padding-inline:16px}}@media(max-width:680px){.mf-header,.mf-panel-head{flex-direction:column;gap:12px}.mf-provider-area{width:100%;justify-items:stretch}.mf-config-path{max-width:none;text-align:left}.mf-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.mf-stat:nth-child(3){border-top:1px solid var(--mf-border);border-left:0}.mf-stat:nth-child(4){border-top:1px solid var(--mf-border)}.mf-summary-action{grid-column:1 / -1;width:100%;justify-content:flex-end;border-top:1px solid var(--mf-border);border-left:0}.mf-panel-actions,.mf-search-wrap{width:100%}.mf-panel-actions{justify-content:flex-end}.mf-search-wrap{min-width:0}.mf-filter-grid{grid-template-columns:1fr}.mf-action-bar{align-items:stretch;flex-direction:column;gap:8px}.mf-actions{width:100%}.mf-actions .mf-button{flex:1}}@media(max-width:420px){.mf-page{padding-inline:12px}.mf-action-bar{margin-inline:-12px;padding-inline:12px}.mf-summary-action .mf-button{width:100%}.mf-dialog-actions{align-items:stretch;flex-direction:column-reverse}.mf-dialog-actions .mf-button{width:100%}}