diff --git a/README.md b/README.md index 1b6fc54..d8d4003 100644 --- a/README.md +++ b/README.md @@ -275,6 +275,7 @@ it off puts the config back. | [nowledge-mem-agent](packages/nowledge-mem-agent) | [Nowledge Mem / AI Now](https://mem.nowledge.co/): choose Default, AI Now and Background models through Magpie, with recovery journaling; separate from the Nowledge memory recall/capture gateway plugin | | [minimax-design](packages/minimax-design) | [MiniMax Design](https://design.minimax.io), the local multimodal creation studio: one custom-model entry in `%APPDATA%\@hilo\desktop\hub-config.json` whose model menu follows magpie's list; Windows only | | [eta](packages/eta) | [Eta](https://github.com/Lingwcy/eta): connect-only local gateway integration; choose models and routing groups in Eta’s own picker after restarting. Requires Eta 0.1.164 or later | +| [rhino9-ai](packages/rhino9-ai) | [Magpie-Rhino](https://github.com/mikidaren/Magpie-Rhino) for Rhino 9 on Windows, with Magpie models, custom groups and routing strategies through Rhino MCP. Install the companion `.yak`, restart Rhino once, then open its AI panel and choose **Magpie**; no command required | ```sh magpie plugin add @magpie-community/agent- diff --git a/packages/rhino9-ai/README.md b/packages/rhino9-ai/README.md new file mode 100644 index 0000000..09703b1 --- /dev/null +++ b/packages/rhino9-ai/README.md @@ -0,0 +1,60 @@ +# Magpie-Rhino + +Use Magpie models, custom groups and routing strategies in a native dockable +**Magpie** panel inside Rhino 9. The companion Rhino plugin runs its own agent loop +and calls Rhino's built-in MCP tools to inspect and create native geometry. + +## Install + +1. Install Rhino 9 on Windows and run Magpie. +2. Install the companion Rhino `.yak` package, or extract the companion ZIP and + run `install-panel.ps1`. Restart Rhino once. The plugin creates its detection + directory on startup without writing connection credentials. +3. Install from Magpie's Plugins page or run + `magpie plugin add @magpie-community/agent-rhino9-ai`. +4. Connect **Magpie-Rhino** in Magpie's Agents page and select a model or group. +5. Open Rhino's AI panel normally and choose **Magpie** from its agent menu. + No command is required. + +The panel follows Magpie's configured selection on each new turn. Refresh its +catalog to optionally select a different model or routing group for that panel. +Leave **跟随 Magpie 当前模型 / 自定义组** selected to follow Magpie. + +The Magpie plugin manages `model`, `baseUrl` and `apiKey` in +`~/.config/rhino9-magpie/settings.json`. Disconnect restores the previous keys. +The panel checks that file at the start of every turn. Credentials already sent +with an in-flight request remain effective for that request. + +The two installations provide the Magpie connection and Rhino UI respectively. +This descriptor has no install hook or background runtime. Requests are attributed +to the distinct `rhino9-ai` gateway identity. Keep the local connection file private. + +## 中文 + +配套 Rhino 插件在原生 AI 面板中提供 **Magpie** 入口,支持自然语言建模、Rhino MCP、 +视口图片反馈、工具确认、停止和按文档分别保留对话。 + +先安装配套 `.yak` 包,或运行 ZIP 内的 `install-panel.ps1`,然后重启 Rhino。 +Rhino 插件会自动创建检测目录,无需先选择模型。再从 Magpie 的插件页安装, +或运行 `magpie plugin add @magpie-community/agent-rhino9-ai` 并连接。 +正常打开 Rhino 的 AI 面板即可选择 **Magpie**,无需输入命令。每次发送都会读取 Magpie 当前的模型、 +自定义组和策略,组 ID 会原样传给 Magpie,由 Magpie 负责路由。 + +初次使用默认为逐次修改确认。也可开启 YOLO 自动执行,选择会跨新对话、文档和 Rhino 重启保留。 +执行偏好单独存放在 `~/.config/rhino9-magpie/panel-preferences.json`,不包含连接密钥。 +支持 Windows x64、Rhino 9 和本机 HTTP Magpie 网关。模型需要支持工具调用。 +建模结果仍需检查,复杂建筑任务和所有模型的兼容性尚需进一步验证。 + +The MCP listener started when needed remains available until its Rhino document +or session closes. Other processes on the same computer can use that local +interface to invoke Rhino tools and scripts. Listener discovery uses an internal +RhinoAI API with a public `MCPStart` fallback, so Rhino updates need a compatibility +check. + +## Checks + +Run `bun test packages/rhino9-ai` and `bun scripts/check.mjs rhino9-ai` +from the community repository root. + +Source and releases are maintained at https://github.com/mikidaren/Magpie-Rhino. +MIT. Unofficial community integration. diff --git a/packages/rhino9-ai/package.json b/packages/rhino9-ai/package.json new file mode 100644 index 0000000..19d7a2a --- /dev/null +++ b/packages/rhino9-ai/package.json @@ -0,0 +1,16 @@ +{ + "name": "@magpie-community/agent-rhino9-ai", + "version": "0.3.2", + "description": "Magpie-Rhino: Magpie models, custom groups and routing strategies in Rhino 9's AI panel through Rhino MCP", + "type": "module", + "files": ["rhino9-ai.agent.js", "README.md"], + "keywords": ["magpie-plugin", "magpie-agent", "rhino", "rhino9", "architecture"], + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/magpie-community/plugins.git", + "directory": "packages/rhino9-ai" + }, + "homepage": "https://github.com/mikidaren/Magpie-Rhino", + "magpie": { "agent": "./rhino9-ai.agent.js" } +} diff --git a/packages/rhino9-ai/rhino9-ai.agent.js b/packages/rhino9-ai/rhino9-ai.agent.js new file mode 100644 index 0000000..d48b256 --- /dev/null +++ b/packages/rhino9-ai/rhino9-ai.agent.js @@ -0,0 +1,17 @@ +export const agent = { + id: "rhino9-ai", + name: "Magpie-Rhino", + dir: "~/.config/rhino9-magpie", + config: "~/.config/rhino9-magpie/settings.json", + format: "json", + model: "model", + ua: [], + notice: "Install the companion Magpie-Rhino .yak and restart Rhino 9. Open Rhino's AI panel and choose Magpie alongside the native agents; no command is required. MagpieStandalone is the fallback. 安装配套 .yak 后重启 Rhino,直接打开 AI 面板选择 Magpie,无需输入命令。每轮跟随此处的模型、自定义组与策略。", +}; + +export function connect({ gateway, model } = {}) { + if (!gateway?.url || !gateway?.key || !model?.id) { + throw new Error("Select a Magpie model and an available gateway first."); + } + return { baseUrl: gateway.url, apiKey: gateway.key }; +} diff --git a/packages/rhino9-ai/rhino9-ai.test.mjs b/packages/rhino9-ai/rhino9-ai.test.mjs new file mode 100644 index 0000000..1d64dc3 --- /dev/null +++ b/packages/rhino9-ai/rhino9-ai.test.mjs @@ -0,0 +1,44 @@ +import { expect, test } from "bun:test"; +import { agent, connect } from "./rhino9-ai.agent.js"; + +test("owns a dedicated config, not a personal agent profile", () => { + expect(agent).toMatchObject({ + id: "rhino9-ai", + name: "Magpie-Rhino", + config: "~/.config/rhino9-magpie/settings.json", + dir: "~/.config/rhino9-magpie", + model: "model", + format: "json", + }); + expect(agent.ua).toEqual([]); +}); + +test("writes the Messages root and assigned key, without taking ownership of model aliases", () => { + expect(connect({ + gateway: { url: "http://127.0.0.1:4567", v1: "http://127.0.0.1:4567/v1", key: "test-key" }, + model: { id: "provider/model/with/slashes" }, + })).toEqual({ baseUrl: "http://127.0.0.1:4567", apiKey: "test-key" }); +}); + +test("incomplete connections cannot produce partial config", () => { + expect(() => connect()).toThrow(); + expect(() => connect({ gateway: { url: "http://127.0.0.1:3425", key: "key" } })).toThrow(); +}); + +test("package declares only an agent without a host runtime", async () => { + const pkg = await Bun.file(new URL("./package.json", import.meta.url)).json(); + expect(pkg.magpie.agent).toBe("./rhino9-ai.agent.js"); + expect(pkg.main).toBeUndefined(); + expect(pkg.dependencies).toBeUndefined(); + expect(pkg.scripts?.postinstall).toBeUndefined(); +}); + +test("publication metadata matches the community repository provenance", async () => { + const pkg = await Bun.file(new URL("./package.json", import.meta.url)).json(); + expect(pkg.repository).toEqual({ + type: "git", + url: "git+https://github.com/magpie-community/plugins.git", + directory: "packages/rhino9-ai", + }); + expect(pkg.homepage).toBe("https://github.com/mikidaren/Magpie-Rhino"); +}); diff --git a/registry.json b/registry.json index 2d4b65e..ccd070b 100644 --- a/registry.json +++ b/registry.json @@ -171,6 +171,8 @@ "summary": { "en": "Kaku (the terminal) Assistant on magpie's Agents page: one switch points it at magpie's gateway, with a routing group for each of its roles: Simple for # commands and command fixes, Deep for the Cmd+L chat and tools, and optional Memory. Switching it off restores assistant.toml byte for byte. macOS.", "zh": "把 Kaku 终端的 AI 助手加到 magpie 的 Agent 页:一个开关把它接到 magpie 网关,并给每个角色绑定一个路由分组:Simple 负责 # 命令和报错修复,Deep 负责 Cmd+L 对话和工具调用,Memory 可选。关掉即逐字节恢复 assistant.toml。仅 macOS。" } }, { "package": "@magpie-community/agent-eta", "name": "Eta", "kind": "agent", "community": true, "icon": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAx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xLjA5OSAyNzkuMDM0IDQwOC41OTAgMjc5LjAzNFEzOTMuMTYyIDI3OS4wMzQgMzQ2LjA0MyAzMzAuNzM5WiIgZmlsbD0iI2ZmZmZmZiIvPgo8L3N2Zz4=", "summary": { "en": "Use Magpie models and routing groups in Eta’s own model picker. Requires Eta 0.1.164 or later; restart Eta after connecting.", "zh": "在 Eta 自带的模型选择器中使用 Magpie 模型与路由组。需要 Eta 0.1.164 或更新版本;连接后重启 Eta。" } }, + { "package": "@magpie-community/agent-rhino9-ai", "name": "Magpie-Rhino", "kind": "agent", "community": true, + "summary": { "en": "Magpie-Rhino brings Magpie models, custom groups and strategies into Rhino 9's AI panel through Rhino MCP. Install the companion .yak, restart Rhino, then open its AI panel and choose Magpie; no command required. Local gateway only.", "zh": "Magpie-Rhino 将模型、自定义组和策略接入 Rhino 9 原生 AI 面板,通过 Rhino MCP 建模。安装配套 .yak 并重启后,直接打开 AI 面板选择 Magpie,无需输入命令。仅连接本机网关。" } }, { "package": "@magpie-community/tools-goanyapi", "name": "GoAnyAPI", "kind": "tools", "community": true, "summary": { "en": "Explore Google Trends, website traffic, domain rating (DR), keyword suggestions, SERPs, backlinks, and ads statistics for market, keyword, and competitor research.", "zh": "查询 Google 趋势、网站流量、域名权重(DR)、关键词建议、SERP、外链和广告统计,辅助市场、关键词与竞品研究。" } }, {