1ccacad63281094de8a3372d5a507d38f9969e5c
14
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
4167419abf |
site: breadcrumbs in every docs page's structured data
Each docs page in en, zh and ja (98 pages, contributors left out) gets a schema.org BreadcrumbList: magpie (the language's home page) > Docs (that language's start page) > the page's h1. Search results can then show the path instead of a bare URL. The eleven pages that had no JSON-LD at all (docker, remote, intent, plugins, import, integrate, library, mcp-router, masking, start, privacy) also get a TechArticle built from their h1, meta description and canonical URL, like the other pages. zh pages' inLanguage is zh-CN everywhere, as the older pages had it. Existing JSON-LD is only appended to (the diff has no deletions besides the inLanguage fix). Run: every docs page's JSON-LD parsed with node (98 with a BreadcrumbList); mote: node --test worker.test.mjs install.test.mjs: 71 pass, 0 fail. Not tried: Google's Rich Results Test on the deployed pages. |
||
|
|
d681ad016e |
site: docs titles say what each page is for
Ten docs pages (docker, remote, intent, plugins, import, integrate, library, mcp-router, masking, start) had one-word titles like "Docker · magpie docs", in en, zh and ja. Docker and remote are among the most read docs pages, and Search Console shows searches such as "局域网远程" and "magpie docker" with no title matching them. Each <title> now names what the page does; h1, og tags and the article are unchanged. Run (mote): node --test worker.test.mjs install.test.mjs: 71 pass, 0 fail. Not tried: how Google rewrites the titles in results. |
||
|
|
025123431c |
library: add and remove a project's skills from the CLI (Sephiro_Lan on X, #5193)
magpie library project … does what the window's Library › Projects page
does, through the same library calls its page makes (AddProject,
RemoveProject, ProjectSkills, ProjectSkill, ProjectCopy):
magpie library project [--json] the projects and their skills
magpie library project add <dir>
magpie library project rm <dir> [--keep-files]
magpie library project skills <dir> [--json]
magpie library project skill add <dir> <skill…> [agents=a,b…]
magpie library project skill rm <dir> <skill…>
magpie library project skill agents <dir> <skill> <a,b…|none>
magpie library project copy <dir> on|off
<dir> may be relative or "." (library.ProjectPath / ProjectAt find the
listed project, through a link too). A skill added with no agents= goes
to the agents the page's Skills menu picks: those the project's skills
are for already, else every agent here with a project skills folder.
Each skill added says where it was placed; one that wasn't (a folder
there that isn't magpie's, left as it is) is named with why, and the
command exits 1, so a script tells "installed" from "left as it is" by
the status. --help prints the project usage; an unknown flag, command,
skill, agent or on/off value is refused, and so is rm of a skill the
project doesn't have.
Docs: the Projects row of docs/subsystems/library.md, and the site's
library page in en/zh/ja. site/public/llms-full.txt rebuilt with
`node llms-full.mjs`; it also picks up a line (Alma, Shelley) another
docs change left out of it.
Run (mote, at this tree):
- go test -count=1 -run TestLibraryProject ./internal/cli: ok; the same
on Windows (win-run, xiaomi-gpu): ok.
- go vet ./internal/cli ./internal/library for darwin, linux (-tags nogui)
and windows: ok. go test -count=1 ./internal/cli ./internal/library:
ok (45s, 99s), at this head after the rebase. site: node --test worker.test.mjs: 38 pass. gofmt -l:
clean.
- A sandbox HOME end to end with the built binary: claude and codex
installed, three library skills, a git project. add ., skill add with
no agents= (links in .claude/skills and .agents/skills, listed
in .git/info/exclude, the .gitignore left as it is), a folder of the user's in .claude/skills/pdf (named,
exit 1, untouched), agents=codex, skill agents, unknown
skill/agent/flag/command refused, skills --json, skill rm, rm .: the
links, magpie's folders and the exclude block gone, the user's
folder kept.
Broken by hand: with the not-placed exit taken out, TestLibraryProjectCmd
goes red ("a folder of the user's in the way: <nil>").
Not tried: a project's MCP servers from the CLI (the issue asks for
skills; servers stay on the page), WSL agents, and a real Linux box.
|
||
|
|
00e8242e85 |
library: Hermes folds its context with billion-context through its /bili/ prefix (Duckb7si on X)
Library › billion-context said no agent could use it on a machine where
Hermes was connected to magpie. Hermes was left out of the lanes on
purpose: bili's native Hermes plugin (hermes-plugin/__init__.py,
apply_env, billion-context 0.1.213) only sets HTTPS_PROXY, HERMES_CA_BUNDLE
and SSL_CERT_FILE. magpie's Hermes provider is http://127.0.0.1:3425/v1,
plain http on loopback, so that proxy never sees it: the plugin would add
its tools and fold nothing.
Hermes now takes the route Zed takes, bili's documented /bili/ prefix.
Turned on, magpie runs `bili start --port 8787` and sets base_url of the
magpie and magpie-anthropic providers to http://127.0.0.1:8787/bili/<gw>,
in config.yaml and in every profile that has magpie's provider
(agent.HermesThrough). Each later Sync or pick keeps a loopback prefix
with a path (hermesPrefix), and drops anything else back to the gateway.
Turning it off puts the gateway back. The empty-list string, docs (en, zh,
ja), llms-full.txt and docs/subsystems/library.md name Hermes.
The other agents bili supports that magpie wires (dsh, Kimi, ZCode, Codex,
Gemini, Qwen, ...) are #5915.
Run (mote, at the rebased head unless said):
- go test -tags nogui ./internal/library: ok (252s) at the rebased head
- go test -run 'TestHermes|TestZed|TestProxy|TestBili|Kept'
./internal/agent ./internal/library: ok before the rebase (base
|
||
|
|
97fcbe3540 |
library: billion-context's card shows the tokens it saved (Scott__D on X)
The RTK tab says what RTK saved (rtk gain); the billion-context tab said nothing of its effect. bili 0.1.213 has no command that prints its savings. Its running proxy serves its dashboard's numbers at GET /__bili/overview, summed over every session in its one store, and each bili that runs registers in <state>/instances/<id>.json ($XDG_STATE_HOME or ~/.local/state, then billion-context, on every system; read from bili's dist and its Hermes plugin's twin reader). readBiliSaved (internal/library/bili_saved.go) asks the registered bilis newest first, loopback http origins only, 3s in all, and puts the first answer on BiliView.Saved: netSavedTotal (bili's headline "net savings", after post-fold rebuilds and the summaries' cost, only with hasFoldData), grossSavedTotal (which bili calls an upper bound), foldsTotal, sessions, requests. The answer is kept in bili-saved.json in magpie's config folder and shown "as of" its time when no bili runs; a kept file that doesn't parse is no answer. magpie never starts a bili to ask (it would auto-update and start watchers). The card says "166.3k tokens saved over 7 folds in 1 session", bili's own count over every session on this computer, the gross before costs; "Nothing folded yet over N requests" before a fold; and that it shows once bili has run when no bili ever answered. zh, zh-TW, ja and de; site docs (en, zh, ja) and docs/subsystems/library.md. Run: - Real bili 0.1.213 on mote in a sandbox HOME (ACP_AUTO_UPDATE=0, 20000 token window, bili start on 18799, a fake OpenAI upstream answering usage = bytes/4): ten turns of a growing conversation through /bili/<upstream>/ gave overview net 166285, gross 166390, 7 folds, 1 session, 10 requests. That literal answer is the Go fixture (testdata/bili/overview-0.1.213.json) and the GUI test's numbers. readBiliSaved/ReadBili run on mote against that live bili with that HOME read the same numbers (Live true, Version 0.1.213). - go test -tags nogui ./internal/library ./internal/gui on mote: ok. - win-run go test -run 'TestBiliSaved|TestBiliLoopback' ./internal/library on xiaomi-gpu: ok. - library-bili, i18n-keys and i18n-en-no-cjk in chromium and webkit (every language, 1100 and 420 wide): 92 pass, 0 fail. - gofmt -l clean; go vet darwin, GOOS=linux -tags nogui and GOOS=windows for internal/library and internal/gui: ok. - site/public/llms-full.txt regenerated (node llms-full.mjs); site worker.test.mjs: 38 of 38 ok. Broken by hand: - the loopback filter taken out: TestBiliSavedFromRunningBili red (192.0.2.7 asked first, the 3s budget gone, nothing read). - net read from tokensSaved, and a kept answer marked live: TestBiliSavedFromRunningBili and TestBiliSavedOnThePage red. - the card's line taken out: library-bili 40 of 42 red (chromium). Not tried: a real agent session with a real model through bili (the upstream was a fake with made-up usage, so only the plumbing of bili's numbers is checked, not how much a real session saves); a bili with money data (hasMoneyData; its dollars are passed as usd but not shown); the card on Linux WebKitGTK. |
||
|
|
b75aff1073 |
library: billion-context for Zed through its /bili/ prefix (CoMi6818 on X)
billion-context's README lists Zed, but Library's billion-context tab offered only Pi, omp, OpenCode and Claude Code. Zed has no plugin of bili's. Upstream gives it two routes: `bili zed`, a Linux-only launcher that leaves a provider on loopback direct (so it never passes magpie's gateway), and, on every system, the /bili/ prefix its docs give any client whose model address can be edited, with `bili start` answering on 8787. Zed is now a URL lane (biliURLLanes, internal/library/bili_url.go). Switched on, magpie has bili start answer (one the user runs is used; else magpie runs its own under KeepLinked's context, logged to bili-start.log, and starts it again at magpie's start while Zed is on), then agent.ZedThrough sets the magpie provider's api_url to http://127.0.0.1:8787/bili/<gateway>/v1 and saves the key for that address in the credential store, where Zed looks it up by address. A pick and a sync keep the prefix while magpie answers through it (zedReach, #1985's proxy recognition). Off puts api_url back on the gateway and ends magpie's bili start when nothing goes through it. Zed must be on magpie first; the error says to pick a magpie model. Run: - bili 0.1.213 on mote: bili start --port N, then /bili/http://127.0.0.1:<fake magpie>/v1 forwarded GET /, GET /v1/models and POST /v1/chat/completions with Authorization kept and bili's tools injected (repro/zedroute.sh). - mote: go test -tags nogui ./internal/library ./internal/agent (full packages), go vet darwin, GOOS=linux -tags nogui, GOOS=windows. - mote: library-bili, i18n-keys, i18n-en-no-cjk GUI tests (chromium and webkit). - win-run: go test ./internal/agent ./internal/library -run 'TestZed|TestBili'. - gofmt -l clean. Broken by hand: SetBili without the URL-lane dispatch, and zedReach without the proxy keep: TestBiliZedThroughPrefix and TestZedThroughBili go red; restored, green. Not tried: a real Zed app through bili (no Zed on mote), and the real keychain write (zedCredential stubbed in tests, as before). Other clients upstream lists (Cline/Roo/Kilo, Continue, OpenHands, Void, Cursor, Warp, launcher-only lanes) are not added here. |
||
|
|
3aa55065a3 |
library: Claude Code keeps its auto-compaction beside billion-context (Kling__Lab on X)
Kling__Lab's Claude Code stopped after a little use with "Prompt is too long", every message answered at once (作業時間 0s) with nothing sent. bili's Claude Code install writes DISABLE_AUTO_COMPACT=1 into the shared ~/.claude/settings.json. A session bili doesn't fold then has nothing to keep it under the window: the Claude desktop app's Code tab runs Claude Code on that settings.json with its own ANTHROPIC_BASE_URL, past bili's proxy (bili's own #2290), and a window bili takes larger than the one magpie serves lets the session reach it first. With auto-compaction off, Claude Code blocks locally at about window-3000 and returns "Prompt is too long" without a request. magpie now writes "0" in place of bili's added "1" right after the install. bili leaves a value that isn't "1" as the user's, through its SessionStart hook and a reinstall, and its remove takes only a "1". So auto-compaction stays on as a backstop at the window magpie wrote (CLAUDE_CODE_AUTO_COMPACT_WINDOW), which bili, when it does fold, keeps the session under. A DISABLE_AUTO_COMPACT the user had before the install is left as theirs. A plugin magpie installed before this is mended from KeepLinked at start, and its bili-plugins.json record says "0" too, so switching it off still puts the file back as it was. Reproduced on mote with Claude Code 2.1.321 and billion-context 0.1.213 against a fake gateway reporting 195000 input tokens on a 200000 window: with DISABLE_AUTO_COMPACT=1 the second turn is "Prompt is too long" with no request sent; with 0 it compacts and goes on. Run (mote-run): go test -tags nogui ./internal/library -run 'TestBili|TestParseBiliList' -v, all ok, including the new TestBiliClaudeKeepsAutoCompact (on and off, the user's own value, a plugin installed before), then the whole package (go test -tags nogui ./internal/library ok, 154s). gofmt -l clean; go vet ./internal/library ./internal/gui/..., GOOS=linux -tags nogui and GOOS=windows go vet ./internal/library ok. Broken by hand: biliKeepCompact returning at once. The new test's "on and off" and "installed before" went red (DISABLE_AUTO_COMPACT = 1 after the install / after magpie started), "the user's own" stayed green. Not tried: the real Claude desktop app's Code tab, and a real bili install on a real account; the fake bili in the test copies bili 0.1.213's "1 only when absent or 1" rule, read from its source. |
||
|
|
fdc96dfe4d |
library: a billion-context tab switches its plugin on per agent and restores each file exactly
@Kling__Lab on X asked for billion-context (npm billion-context, CLI bili, github.com/ranxianglei/billion-context) beside RTK. The Library gets a billion-context tab after RTK, a card like RTK's: - No bili: its README's `npm install -g billion-context --prefix=~/.local` and Install billion-context (InstallBili; biliPath finds bili in ~/.local/bin when it isn't on PATH). - Installed: its version, a note that an agent switched on here can't also run billion-context-pi or opencode-acp, and a switch per agent that runs `bili plugin install|remove <agent>` (SetBili), read back from `bili plugin list`. - Offered for Pi, omp, OpenCode and Claude Code, the lanes that keep magpie in front: Pi/omp/OpenCode load it in process and still send to magpie; Claude Code goes through bili's proxy, which forwards to magpie's gateway. Not offered: Codex (MCP only), ZCode (routes only its own provider), Kimi Code (renames default_model to bili-kimi), dsh (its install failed through dsh's pnpm), Hermes (can't be tried in a sandbox HOME), and agents in WSL. bili's remove doesn't restore a file: it leaves `"packages": []` in Pi's settings and `extensions:` in omp's config, and after magpie rewrote Claude Code's settings.json it deleted ANTHROPIC_BASE_URL (Claude Code then went to Anthropic, not magpie) and put back DISABLE_AUTO_COMPACT. So switching on records each file before and after (bili-plugins.json in magpie's config folder), and off writes the before bytes back when the file is unchanged since, else merges JSON three ways; with no record (bili set up outside magpie) only a Claude Code ANTHROPIC_BASE_URL the remove took out is put back. bili's .bili-bak/.bili-last files go too. `GET/POST /api/library/bili`, `POST /api/library/bili/install` are named in the CLI parity list beside RTK's. Docs: site library pages (en, zh, ja) and docs/subsystems/library.md. Run: - go test ./internal/library -run 'TestBili|TestParseBiliList' on mote: ok (a fake bili mimicking pi/claude lanes, .bili-bak re-backup and claude's buggy remove; a fake npm for the install). - Full `go test -timeout 45m ./...` on mote at 16c67965f (this commit before the body was written, same tree): every package ok but internal/gateway's TestBurstTellsNoSpeed/responses_from_chat_burst (804ms burst read as a speed, load ~50 after a mote reboot); passes -count=3 alone at the same head; recorded on #2719, same test. An earlier full run at 8c8c63537 was all ok. - GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./..., go vet ./... at 16c67965f: ok. gofmt -l: nothing. - GUI at 16c67965f: library-bili, i18n-keys, i18n-en-no-cjk, library-memory, library-rtk-gain, library-pi-extensions, Chromium and WebKit (library-bili: every language, 1100 and 420 wide). 80 of 80 pass. - The whole GUI suite is still running on mote at this head, started before the tag; two earlier whole-suite runs were cut short (mote ran out of disk mid-run, then rebooted), so their reds are not a record. Its result goes in a follow-up. - Real, in a sandbox HOME (named dir, bili 0.1.213 installed there, magpie web built from this branch on 3486/3487): through magpie's API, Pi and Claude Code switched on; `claude -p` and `pi -p` each answered "pong" through magpie's gateway (Claude Code via bili's proxy on 18788 -> 127.0.0.1:3486); switched off: Pi's settings.json, Claude Code's settings.json and .claude.json byte-identical to before, no .bili-* files left, commands/acp-cache.md gone; claude -p answered again straight to the gateway. Earlier, with bili run by hand, Pi, OpenCode, omp, Claude Code and Kimi each sent a request through a recording relay with bili's tools/headers on it. Broken by hand: skipping biliRestore turned TestBiliOnOffExact, TestBiliClaudeKeepsMagpiesRoute and TestBiliOffWithoutRecord red; dropping the no-record URL fix turned TestBiliOffWithoutRecord red; removing the tab turned all 22 library-bili cases red; removing the zh note string turned the zh cases red in both engines. Each put back. Not tried: Kimi, dsh, Hermes, Codex, ZCode lanes (not offered); WSL; Windows (the %APPDATA%\npm lookup and npm without --prefix are untried on the Windows box); OpenCode and omp switched through magpie's API (switched by hand with bili before); a real npm install from the button (sandbox had bili already; the test fakes npm). |
||
|
|
8a58c0e307 |
site: a fair comparison of magpie, CC Switch and Claude Code Router (docs/alternatives, zh, ja)
New docs page in three languages: a summary of each tool, a table (agents, how it switches, protocol translation, subscription sign-ins, routing and failover, GUI and CLI, platforms, license), which one fits, and an FAQ with FAQPage JSON-LD. Linked after "Models in OpenCode" in every docs page's nav and footer, in sitemap.xml and llms.txt. CC Switch and CCR facts come only from their own READMEs (fetched raw, Nov 2026); each column is dated. Cells their README doesn't cover say "not stated": CCR subscription sign-ins, CCR macOS signing, CC Switch CLI. magpie facts from its source and llms.txt. Run: mote-run site tests (worker.test.mjs install.test.mjs), 69 of 69 pass. Generator: magpie-wt/seo-scratch/altgen.py. |
||
|
|
80ccaba641 |
site: guide to other models and subscriptions in OpenCode (en, zh, ja)
New docs/opencode-models in English, Chinese and Japanese: DeepSeek, Kimi, GLM, Qwen and Claude/ChatGPT/Copilot sign-ins in OpenCode, what magpie writes in opencode.json (internal/agent/agents.go openCodeLike, magpieProviderJSONAt), small_model, reasoning variants, cost, magpie visible, magpie opencode default. Linked from every docs page's nav and footer, sitemap.xml and llms.txt. Run: mote-run sh -c 'cd site && node --test worker.test.mjs install.test.mjs': 69 pass, 0 fail. Not tried: a real OpenCode run against the page's steps. |
||
|
|
0ac8e6634d |
site: guide to local models in Claude Code and Codex (en, zh, ja)
/docs/local-models and its zh and ja pages: Ollama, LM Studio, oMLX and MLX-Serve presets with their default addresses and the APIs magpie uses for each, which agent goes through as is and which is translated, another port or computer (Server address, the certificate switch), vLLM and llama.cpp through Custom + Detect APIs, the context window and masking. Linked from every docs page's nav and footer, the sitemap and llms.txt. Facts read from the provider presets, internal/cli/providers_cli.go's help text and i18n.js labels. Left out for lack of evidence: detecting a running Ollama, Ollama's default num_ctx, how well local models call tools, default ports for llama.cpp and vLLM. Run: mote-run sh -c 'cd site && node --test worker.test.mjs install.test.mjs' at this tree: 69 pass, 0 fail. |
||
|
|
8f74442e4d |
site: guides for other models in Gemini CLI and subscriptions in any agent
New pages, en and zh, built on the claude-code-models template (same
head, nav, footer, TechArticle + FAQPage JSON-LD, canonical, hreflang):
- /docs/gemini-cli-models: pointing Gemini CLI at the gateway's Gemini
API, the four keys magpie writes, going back to Google, subscription
models in Gemini CLI, routing.
- /docs/subscriptions: the built-in subscriptions and their model
prefixes, sign-in, using one in another agent, several accounts,
routing modes and fallback, other tools through the gateway.
Every docs page (en, zh, ja; ja links to the English URLs) gets the two
nav and footer links after the Codex guide, the 4 URLs go in
sitemap.xml and the 2 English ones in llms.txt, as
|
||
|
|
082ca55a32 |
site: guides for other models in Claude Code and Codex
Google sends 6,140 clicks in 28 days, every one on "magpie" or a misspelling of it: no one finds magpie by searching for what it does. These two guides, in English and Chinese, answer the searches it should win: "claude code deepseek", "Claude Code 接入国产模型", "codex kimi", "Codex 使用第三方模型". - docs/claude-code-models and docs/zh/claude-code-models: why Claude Code needs a gateway, the setup in the app and the CLI, how the opus/sonnet/haiku/fable tiers map, every settings.json key magpie writes and how it is undone, GPT models from a ChatGPT or Copilot sign-in, several keys, and an FAQ. - docs/codex-models and docs/zh/codex-models: the same for Codex, with /model's catalog, the two shapes of config.toml (signed in to ChatGPT or not), going back, Claude in Codex. - Each page has TechArticle and FAQPage JSON-LD, canonical, hreflang (en, zh, x-default) and og tags. Both are in every docs page's nav and footer, in the sitemap and in llms.txt. Every claim is checked against internal/agent/claude.go, codex.go, internal/codexcat, internal/provider/presets.go and the gateway, or taken from docs/start.html (Copilot models in Claude Code). No ja pages yet; the ja nav links the English ones, as it does for integrate. Run: node --test worker.test.mjs install.test.mjs on mote, 69 pass. |
||
|
|
6bef4fe043 |
docs: a Library page in en, zh and ja, linked from every docs page
luckymanjc. on Discord asked for one place that says how the Library
works underneath and how to set it up. site/public/docs/library.html
(and zh/, ja/) covers each tab: where it is kept (library.json, library/,
backups/ with the last 30), instructions and their markers, MCP servers
(per-agent files, ${NAME} variables, SSE limits, single tools off, OAuth
through /mcp/<name>, link to the MCP router page), skills (folders per
agent, links vs copies and how a copy's edit is taken back, editing,
the 12h update check, ~/.agents/skills, off here), subagents (file per
agent, which agents bind skills/MCP servers, agents with none), the
subagent model (written for Codex only, laid over the spawn; the Agents
page's Codex subagent model with Lead's pick / Same as the lead / a
model, which wins over the Library's; default_subagent_model; the
ChatGPT-sealed exception; Claude Code's own order), hooks and RTK.
Every fact was read from internal/library, internal/gateway and
internal/provider codex_subagent.go, internal/agent/codex.go and the
Library page's client.js and i18n, not guessed. The nav (toc-only) and
footer of all 32 docs pages and the sitemap link the three pages.
Run (mote, through mote-run):
- a Playwright script serving site/public, in Chromium and WebKit at
1280px and 400px, on all three pages: h1, docs.css loaded, 4 tables,
no sideways scroll (scrollWidth - innerWidth = 0), every toc and
in-page anchor has its id, no 4xx on any asset, no page errors, no
left border or gradient in the article, the language menu goes to the
sibling pages; every local link on the pages resolves to a file
(except /zh/ and /ja/, which the worker serves; checked live after
deploy), and every docs page links /docs/<lang>/library twice. ok.
Screenshots looked at for desktop en and 400px zh.
- node --test site/worker.test.mjs: 30 pass, 0 fail (it includes the
sitemap-lists-every-docs-page-with-its-own-canonical test).
Broken by hand: the first script run had a wrong toc selector and
counted the toc-only nav links as missing anchors; fixed the script,
not the page.
Not tried: no Go code changed, so no go test. The Library page's
"Copies" note still says "edits made in a copy are replaced", while
skill_edits.go takes the newest edit into the library; the docs follow
the code.
|