plugin: a page with its own service module is a page on the GitHub list (plugins#1226)

xiaopeng66/magpie-model-lab is a page plugin whose page talks to a
local service it ships as its main (magpie.page.service). readTagged
called any package with a main or exports a provider, so the GitHub
list showed it under Providers. Dropping the !runs check alone would
make every provider that ships a settings page (atomcode's
diagnostics page, for one) a page, so the rule is narrower: a package
with magpie.page.file and a module of its own is a page when its
keywords say "magpie-page", as every page with a main in the plugins
repository does (agent-console, amp-usage, chat, fingerprint,
free-tokens, page-model-quota, page-usage-board, page-usage-tree,
window-warmup). No provider or middleware there says it. The file
looked for in the repository is still its main. Kind only decides the
card's chip and filter; what an install loads is unchanged.

The fixture is model-lab's package.json as it is, without its 900KB
icon; a provider with a page and no keyword stays a provider.

Run (mote):
- go test -count=1 ./internal/plugin: ok (157.9s).
- go vet ./internal/plugin: ok. gofmt -l: clean.

Broken by hand: the old !runs rule with the new test: "a page with a
main: kind """, red.

Not tried: installing model-lab from the GitHub list in the real app.
This commit is contained in:
yetone
2026-11-16 22:23:54 +08:00
parent a24a5f6af4
commit 50a38371df
7 changed files with 176 additions and 2 deletions
@@ -0,0 +1 @@
export default {}
@@ -0,0 +1,9 @@
{
"name": "opencode-provider-with-page",
"version": "0.1.0",
"main": "./index.mjs",
"keywords": ["opencode", "opencode-plugin"],
"magpie": {
"page": { "file": "page/index.html", "service": { "port": 3478, "option": "diagnosticsPort" } }
}
}
@@ -0,0 +1,2 @@
// fixture: magpie-model-lab's module (its page service)
export default {}
@@ -0,0 +1,76 @@
{
"name": "magpie-pelican-bench",
"version": "1.0.0",
"description": "Model Lab for Magpie: compare HTML animations, model fingerprints and candy reasoning, with per-model scheduled tests. 模型实验室:动画、指纹、糖果与自动测试。",
"type": "module",
"main": "index.mjs",
"license": "MIT",
"engines": {
"node": ">=22",
"magpie": ">=0.1.2905"
},
"files": [
"index.mjs",
"serve.mjs",
"lib",
"page",
"ui",
"vendor",
"docs/usage.md",
"docs/favorites-guide.md",
"docs/publishing.md",
"CHANGELOG.md",
"README.md",
"LICENSE",
"THIRD_PARTY_NOTICES.md"
],
"keywords": [
"magpie",
"magpie-plugin",
"magpie-page",
"model-lab",
"llm",
"benchmark",
"pelican",
"html",
"fingerprint",
"candy",
"scheduled-testing",
"模型实验室"
],
"magpie": {
"name": "模型实验室",
"summary": {
"zh": "比较鹈鹕动画、模型指纹与糖果推理;按模型设置自动测试,查看成功率、动画长廊和批次历史。",
"en": "Compare HTML animations, model fingerprints and candy reasoning. Schedule each model and review success rates, animation galleries and batch history."
},
"page": {
"title": "Model Lab",
"titles": {
"zh": "模型实验室",
"zh-TW": "模型實驗室"
},
"file": "page/index.html",
"icon": "page/icon.png",
"service": {
"port": 3489,
"option": "port"
},
"keepAlive": true
},
"actions": [
{
"id": "fingerprint",
"menu": "provider",
"title": "Fingerprint",
"titles": {
"zh": "检测指纹",
"zh-TW": "檢測指紋"
}
}
],
"options": {
"port": 3489
}
}
}
@@ -0,0 +1 @@
<!doctype html><title>Model Lab</title>