feat(rkd)!: run as the owner's host for the Claude Code App (#917) #3
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/app-hosts"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The plugin side of #917 plan B: this machine stops being a shared bot account and becomes its owner's host for the Claude Code integration in RKD. The server routes only that person's requests here, so pairing codes, allowlists and channel lists are gone from the plugin — RKD decides who may reach you. Also brings the easier approvals from the first commit: ✅ / ❌ reactions, a bare yes / no, "typing…" and shorter prompts.
Needs the server work in nanoya-biz/rkd#971. Until that is deployed, 0.2.0 cannot sign in.
Type of change
Test plan
Automated:
pnpm test: 83 unit tests — the classifier (only the owner's messages count, coded and bare verdicts, reactions), the REST client and the device-code sign-in (polls until approved, shows the code once, gives up when it expires, reports a consumed code), and the bridge (threading, chunking, edit throttle and edit-window fallback, credential-upload refusal, prompt routing to the owner's DM before any trigger, typing)pnpm typecheck,pnpm check:dist,claude plugin validate --strict, and the Node 20 handshake smokepnpm test:integrationagainst a real rkd-server built from #971: 7 cases — only the owner's mention is forwarded while a stranger gets the not-connected reply, replies post as the App withfor_user_id, edits and reactions land, only the owner's ✅ approves and a barenodenies, and a DM round-tripsManual, full loop on a local server:
/rkd:configure <server>started the sign-in itself and showed the code; approving it in RKD connected the machine@claude_code how many files are in this repo?→ answered in the threadrmoutside the project: prompt in the thread mentioning me, ✅ reaction approved it, prompt edited to "✅ Allowed", file goneReview checklist
console.log/ commented-out code left behind (theloginCLI prints to the terminal on purpose)@modelcontextprotocol/sdk,wsandzodunchanged and still bundled intodist/server.jsMigrations and breaking changes
BREAKING: 0.2.0 needs a server with App hosts, and the old bot-account credentials in
.envare ignored — sign in again withlogin./rkd:accessis gone;/rkd:configurecovers sign-in and status.Notes for the reviewer
Names.
rkd@rkdrepeated itself, so the marketplace is nowrkd-plugins:claude plugin install rkd@rkd-plugins, channelplugin:rkd@rkd-plugins. The plugin staysrkd(skills/rkd:configure, toolsmcp__plugin_rkd_rkd__*), liketelegram@claude-plugins-official. Anyone who installed the old marketplace name needs to re-add it.Sign-in is a skill now. No password is involved, so
/rkd:configure <server>runs the login in the background and shows the code instead of asking the user to run a version-pinned path in another terminal.src/triggers.tsis now small on purpose: the server is the boundary, and this is the second line of defence (anything not written by the owner is dropped).src/cli.ts— the device-code flow. The plugin never sees a password.The bridge still holds the prompt bookkeeping, since Claude Code's
request_idis what an answer has to name.Worth knowing for anyone testing: don't run
--plugin-dirwhile a plugin of the same name is installed. Claude Code then reportsplugin:rkd@inline · plugin not installedand the channel silently never registers — that cost an hour. Uninstall first, or add the checkout as a local marketplace (claude plugin marketplace add <path>).https://claude.ai/code/session_01GdkP2Y3vcxcGz5XCFFWW16