Ordinary Kimi (agent-kimi-desktop) becomes a Library target: agent.library
names ~/.config/magpie-kimi/AGENTS.md, library-native/mcp.json (format kimi)
and library-skills. bootstrap() links library-native to Kimi's
daimon/runtime/kimi-code/home and library-skills to daimon/skills (junction on
Windows, dir symlink elsewhere); a different object at either path stops with
library_path_conflict. The adapter reads AGENTS.md on every inference request
and inserts one separate system message after the leading system/developer
ones; an unreadable or non-UTF-8 file answers 503 instructions_unavailable.
Run at the reviewed head 5b9f445 (by the reviewer, sandbox HOME, no real
credentials):
- bun test packages/kimi-desktop: 14 pass, 0 fail (95 expects), bun 1.4.2.
- bun scripts/check.mjs: every package ok (agent packages are skipped there).
- Against magpie's own Library code (origin/main e085d6e92): a throwaway Go
test in internal/library loaded this kimi-desktop.agent.js through
agentplug, ran prepareLibrary on a fake Kimi tree, then SaveInstructions,
SaveServer and InstallSkills to the kimi-desktop target. The MCP server
landed in the native runtime mcp.json beside the existing entry, the skill
in daimon/skills, library-native stayed a symlink; applyInstructions put
the written block in as a second system message. RemoveServer,
RemoveSkill and clearing the instructions left the existing MCP entry and
skill, and applyInstructions then added nothing.
- CI on the PR: test and on-npm green.
Not tried: a real Kimi desktop (the author's COMPATIBILITY.md records it on
Windows 11 and macOS). agent-kimi-desktop is not on npm yet; it is served
from the dist branch until the owner's first publish.