Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Packages are organized by author under `plugins/<github-username>/<plugin-id>/`.
| --- | --- | --- |
| [Token Usage Board](plugins/amszuidas/mcode-token-usage-board/) | Explore local Token usage by date, model, and session, including input, output, and cache usage | [amszuidas](https://github.com/amszuidas) |
| [Token Usage Board](plugins/yanhy2000/mcode-usage-monitor/) | Watch local Token usage, output speed, and cache hit rate in near real time; filter by time range, model, and session | [yanhy2000](https://github.com/yanhy2000) |
| [Model Manager](plugins/ocoomber/openrouter-model-manager/) | Browse, search, and enable/disable models in your `~/.minimax/config.yaml` with instant save, bulk actions, one-click undo, and automatic backups | [ocoomber](https://github.com/ocoomber) |
| [Self-drive Route Planner](plugins/hanzijie/self-drive-route-planner/) | 【Offical Plugin】Plan driving routes with place search, route alternatives, demo mode, and Xiaohongshu 3:4 itinerary cards | [HanZijie](https://github.com/HanZijie) |

<details>
Expand Down
1 change: 1 addition & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
| --- | --- | --- |
| [Token 用量看板](plugins/amszuidas/mcode-token-usage-board/README.zh-CN.md) | 按时间、模型和会话查看本机 Token 用量,包含输入、输出和缓存用量 | [amszuidas](https://github.com/amszuidas) |
| [Token 用量看板](plugins/yanhy2000/mcode-usage-monitor/README.zh-CN.md) | 近实时查看本机 Token 用量、输出速度与缓存命中率,可按时间范围、模型和会话筛选 | [yanhy2000](https://github.com/yanhy2000) |
| [模型管理器](plugins/ocoomber/openrouter-model-manager/README.zh-CN.md) | 浏览、搜索并启用/停用 `~/.minimax/config.yaml` 中的模型,支持即时保存、批量操作、一键撤销和自动备份 | [ocoomber](https://github.com/ocoomber) |
| [自驾规划](plugins/hanzijie/self-drive-route-planner/README.zh-CN.md) | 【官方插件】规划自驾路线、地点搜索、候选算路与小红书 3:4 行程图;支持演示模式 | [HanZijie](https://github.com/HanZijie) |

<details>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"schemaVersion": 1,
"name": "openrouter-model-manager",
"displayName": "Model Manager",
"version": "1.2.4",
"description": "Browse, search, and enable/disable the models in your MiniMax Code config.yaml — works with any provider (OpenRouter, custom, locally hosted), with bulk actions, one-level undo, and OpenRouter links.",
"author": "ocoomber",
"icon": "icon.png",
"category": "Other",
"exampleQueries": ["Open Model Manager", "打开模型管理器"],
"apps": [],
"mcpServers": [],
"skills": []
}
21 changes: 21 additions & 0 deletions plugins/ocoomber/openrouter-model-manager/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 ocoomber

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
74 changes: 74 additions & 0 deletions plugins/ocoomber/openrouter-model-manager/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Model Manager (`openrouter-model-manager`)

English | [简体中文](README.zh-CN.md)

A [MiniMax Code](https://github.com/MiniMax-AI) Mini App for browsing, searching, and enabling/disabling the models in your MiniMax Code `config.yaml` — no more find-and-replace in Notepad.

Author: [ocoomber](https://github.com/ocoomber) · Version: `1.2.4`

> The plugin ID `openrouter-model-manager` is kept for stability, but the app is **not** OpenRouter-specific — it works with any provider (see *What it does*).

## What it does

- **Works with any provider** — OpenRouter, custom providers, and locally hosted endpoints (Ollama, LM Studio). Every model block in your config is picked up automatically — all models appear in one list grouped by family, with no provider switching.
- **Restart reminder** — a banner appears as soon as you change anything, reminding you to restart MiniMax Code (mini apps can't restart the host app for you).
- **Search** across model IDs and display names.
- **Instant save** — every toggle writes to your config immediately; no save button.
- **Filter chips** — All / Enabled only / Disabled only.
- **Bulk actions** — *Enable matching* / *Disable matching* apply only to the current search results, and each model family has its own enable/disable buttons.
- **One-level Undo** — made a mistake with "enable all"? One click restores the previous config. If the file changed outside the app in the meantime, Undo refuses instead of clobbering your edits. A multi-provider bulk action is reverted as one operation — not provider-by-provider.
- **Automatic backups** — before every bulk change, a timestamped copy of your config is written to `backups/` under the Mini App's own data directory (per Mini App runtime guidance), pruned to the newest 20.
- **Collapsible families** — models are grouped by the prefix before the `/` in their ID.
- **OpenRouter links** — every model row can link to its OpenRouter page (shown only for OpenRouter providers). Right-click a link to choose the external browser, the built-in browser, or copy the URL.
- **Context-limit badges** — read straight from your config.

## Tested environment

- **Windows 11** (build 10.0.26200), **MiniMax Code 3.0.73**, plugin `1.2.4` — tested by the author end to end (toggles, bulk actions, undo, restart flow).
- **macOS / Linux** use the same code paths but have **not been tested** by the author — feedback and reports are very welcome.

## Install

Copy (or clone) this folder into your MiniMax Code plugins directory:

```
~/.minimax/plugins/openrouter-model-manager/
```

Then restart MiniMax Code and open the **Model Manager** mini app.

> Note: after toggling models, restart MiniMax Code itself for the change to take effect — the config is read at startup.

## How it works

The Node runtime reads your `config.yaml` line by line (no YAML library) and finds every `models:` block that has `enabled:` flags. Toggling a model rewrites only that model's `enabled:` line. All writes are atomic (a temp file `.config.yaml.mm-tmp` is written next to your config, then renamed; it is removed if anything fails), your file's existing indentation and line endings are preserved, and concurrent edits are serialized so overlapping clicks can't clobber each other.

Capabilities such as vision support are intentionally **not** fetched from external APIs — your config file is the single source of truth.

## Data & access

- The UI never sees your secrets: the server returns only model **id / name / enabled / contextLimit**. API keys in the config are never read into the UI, returned by the API, or displayed.
- The app makes **no outbound network requests** of its own.
- **Process spawning (disclosed):** the only OS-level action is opening an OpenRouter model page in *your own* browser, via `rundll32`/`cmd`/`explorer` on Windows, `open` on macOS, or `xdg-open` on Linux. Only `https://openrouter.ai/...` URLs are accepted; anything else is rejected by the server.
- Config location: the runtime walks ancestors of its injected data directory looking for `config.yaml` (the Host hands each Mini App a plugin-owned subdirectory several levels below the data root, and the MiniMax Code config lives at the data root or one of its ancestors in the current Host layout). If nothing is found along that walk, it falls back to `~/.minimax/config.yaml`. The parent walk matches an implementation detail of the current Host layout, not a guaranteed API, so the default fallback is what protects non-default installs.

## Files

```
.minimax-plugin/plugin.json Plugin manifest
package.json Mini app bootstrap
miniapp/miniapp.json Mini app surface/runtime config
miniapp/client/index.html UI (light/dark aware)
miniapp/node/server.mjs Node runtime + REST API
miniapp/node/miniapp-api.ts Type declarations for the runtime API
icon.png Plugin icon
tests/api-set.test.mjs
tests/parser.test.mjs
tests/resolveConfigPath.test.mjs
```

`tests/` lives outside the Host's runtime payload roots (`miniapp/client`, `miniapp/node`), so the app never loads it — it just rides along if you copy the directory. Run with `node --test` from the plugin root.

## License

[MIT](./LICENSE)
74 changes: 74 additions & 0 deletions plugins/ocoomber/openrouter-model-manager/README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# 模型管理器(`openrouter-model-manager`)

[English](README.md) | 简体中文

一个 [MiniMax Code](https://github.com/MiniMax-AI) Mini App,用于浏览、搜索并启用/停用 MiniMax Code `config.yaml` 中的模型 —— 不用再在记事本里查找替换了。

作者:[ocoomber](https://github.com/ocoomber) · 版本:`1.2.4`

> 插件 ID `openrouter-model-manager` 为保持稳定而保留,但本应用**并非** OpenRouter 专用 —— 支持任意提供商(见"功能")。

## 功能

- **支持任意提供商** —— OpenRouter、自定义提供商,以及本地服务(Ollama、LM Studio)。自动读取配置中的所有模型块 —— 全部模型合并为一个列表,按模型家族分组,无需任何切换操作。
- **重启提醒** —— 一旦有任何改动,页面会出现醒目的横幅,提醒你需要重启 MiniMax Code(Mini App 无法代替你重启宿主程序)。
- **搜索** —— 同时匹配模型 ID 和显示名称。
- **即时保存** —— 每次切换立即写入配置,没有保存按钮。
- **筛选** —— 全部 / 仅启用 / 仅停用。
- **批量操作** —— "启用匹配项 / 停用匹配项"只作用于当前搜索结果;每个模型家族也有自己的启用/停用按钮。
- **一步撤销** —— 批量开启后后悔了?点一下即可恢复上一个配置。若期间配置在应用之外被修改过,撤销会拒绝执行,而不会覆盖你的改动。跨提供商的批量操作会作为一个整体被撤销,不会出现"只回滚最后一个提供商"的情况。
- **自动备份** —— 每次批量改动前,都会在 Mini App 自己的数据目录下的 `backups/` 里保存一份带时间戳的副本(遵循 Mini App 运行时"将持久状态存放到注入的 dataDir"的原则),最多保留最新 20 份。
- **可折叠的模型家族** —— 模型按 ID 中 `/` 之前的前缀分组;家族内有已启用的模型时,折叠状态会显示绿点。
- **OpenRouter 链接** —— 每个模型行可跳转到 OpenRouter 页面(仅 OpenRouter 提供商显示)。右键链接可选择外部浏览器、内置浏览器或复制网址。
- **上下文长度徽标** —— 直接读取自你的配置。

## 测试环境

- **Windows 11**(build 10.0.26200)、**MiniMax Code 3.0.73**、插件 `1.2.4` —— 作者已完成端到端实测(切换、批量操作、撤销、重启生效流程)。
- **macOS / Linux** 走相同代码路径,但**未经作者实测** —— 欢迎反馈问题。

## 安装

将本目录完整复制(或克隆)到 MiniMax Code 的插件目录:

```
~/.minimax/plugins/openrouter-model-manager/
```

保留 `.minimax-plugin` 隐藏目录。重启 MiniMax Code,确认插件已被识别,然后打开"模型管理器",或在对话中说"打开模型管理器"。

> 注意:切换模型之后,需要重启 MiniMax Code 本体才能生效 —— 配置是在启动时读取的。

## 工作原理

Node 运行时逐行读取 `config.yaml`(不依赖 YAML 库),找出所有带 `enabled:` 开关的 `models:` 块。切换某个模型时只改写该模型的 `enabled:` 一行。所有写入都是原子性的(先在你的配置文件旁边写临时文件 `.config.yaml.mm-tmp` 再重命名,失败时会删除临时文件),完整保留你文件原有的缩进和换行符,并且并发修改会被串行化,多次快速点击不会互相覆盖。模型 ID 解析兼容 `llama3.1:latest`、`:free` 这类带冒号的写法。

视觉支持等模型能力刻意不从外部 API 获取 —— 配置文件是唯一数据来源。

## 隐私与数据安全

- 界面永远接触不到你的密钥:服务端只返回模型的 **id / name / enabled / contextLimit**。配置中的 API Key 不会被读入界面、不会通过 API 返回、也不会显示。
- 应用自身**不发起任何网络请求**。
- **进程启动(主动披露)**:唯一涉及操作系统层面的动作,是用你自己的浏览器打开 OpenRouter 模型页面 —— Windows 上通过 `rundll32`/`cmd`/`explorer`,macOS 上 `open`,Linux 上 `xdg-open`。仅接受 `https://openrouter.ai/...` 格式的网址,其余一律被服务端拒绝。
- 配置位置:运行时从被注入的数据目录向上逐级查找 `config.yaml`(Host 给每个 Mini App 注入的是一个位于数据根目录下方若干层的、由插件自有的子目录,MiniMax Code 的配置在当前 Host 布局下位于数据根目录或其某个上层目录里)。若沿这条路径没找到,则回退到默认的 `~/.minimax/config.yaml`。向上查找对应的是当前 Host 的实现细节,不是保证稳定的 API,所以默认回退才是保护非默认安装的关键。

## 文件结构

```
.minimax-plugin/plugin.json 插件清单
package.json Mini App 引导文件
miniapp/miniapp.json Mini App 界面/运行时配置
miniapp/client/index.html 界面(自动适配亮/暗色)
miniapp/node/server.mjs Node 运行时 + REST API
miniapp/node/miniapp-api.ts 运行时 API 类型声明
icon.png 插件图标
tests/api-set.test.mjs
tests/parser.test.mjs
tests/resolveConfigPath.test.mjs
```

`tests/` 目录位于 Host 运行时负载根目录(`miniapp/client`、`miniapp/node`)之外,因此应用本身不会加载它 —— 你如果整体复制插件目录就会带上它。在插件根目录执行 `node --test` 即可运行。

## 许可证

[MIT](./LICENSE)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading