feat(rkd): Allow / Deny buttons on permission prompts #9
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/1097-permission-buttons"
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
Ports the permission relay to RKD's new
components/v1buttons (nanoya-biz/rkd#991, server side merged in rkd PR #1099). A channel prompt now carries Allow / Deny buttons; the owner clicks instead of reacting. This is the plugin third of nanoya-biz/rkd#1097.Part of nanoya-biz/rkd#1097
What it does
extras: [{kind: "components", blocks: [Allow, Deny]}](action idsperm:allow:<request id>/perm:deny:<request id>). Reactions and yes / no keep working there too.AppInteraction.rkd-ws.tshands clicks toBridge.handleInteractionand gainsack(interactionId, error?)(theAppAckclient event). Only the owner's click decides. Anyone else getsAppAckwith "Only can answer this", shown under the button, and nothing runs. The ack goes out before the decision, so a click never waits on Claude Code.✅ Allowed/❌ Deniedand the same buttons withdisabled: true.AppCommand. The plugin registers no slash commands. If an operator gives the App one anyway, it is refused at once ("Claude Code has no /x; mention it instead") rather than left to the 10s timeout.The install needs the
interactionsscope for clicks to reach the host. Without it the server refuses the click with its own reason, and reacting or replying still works. The README says so. Plugin 0.5.0.Before / after
Both runs use the real
Bridge,RkdApiandRkdSocketagainst a local RKD server built from rkdmain(f4d0020e). Only Claude Code's side is faked: a small driver raises onepermission_requestwhen the owner's trigger arrives. BEFORE bundles this repo'sorigin/main(fee1014); AFTER bundles this branch. Each run has a fresh channel.A non-owner (mallory) clicks Allow. The click is refused under the button, the host logs
ACK … Only dozken can answer this, and no permission notification is sent:Recordings:
before.mp4 · after.mp4
Test plan
pnpm typecheckpnpm test: 137 tests. New cases: a request answered only once when two answers race (two clicks, a click and a reaction, a repeatedyes <id>), the buttons on the prompt, owner Allow / Deny with disabled buttons, refusing a non-owner, stale and unknown clicks, disabled buttons after a reaction, DM edits staying text-only, the 400 fallback, fastAppCommandrefusal, andrkd-ws.test.tsfor frame parsing and theAppAckshapepnpm check:dist:dist/server.jsrebuilt and matchessrc/node scripts/smoke-handshake.mjstest:integrationagainst a real server with Claude Code in the loophttps://claude.ai/code/session_013PWtUXgidAXrd8w4A1pPKK