mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-11-03 02:26:43 +09:00
serverkit-gui called the agent registry directly, so its manifest permissions were decoration — the install dialog said "screenshot and capabilities" while /synthetic also asked for system:info and system:processes, neither declared. Going through plugins_sdk.agents enforces the declaration, so the first thing the retrofit needed was for the manifest to tell the truth: all four actions are now declared, in both permissions and requires_agent_actions. Per-endpoint behaviour is deliberately unchanged. /capabilities still answers 200 with the synthetic fallback when the agent can't do it, /frame still 502s a failed capture and 503s an offline agent. One case needed care. declared_permissions() reads the manifest captured in the database at install time, not plugin.json on disk, so an install predating this lists only the two gui actions and would have started 403-ing on /synthetic. That endpoint exists to render something for a host with no display, and it already degrades when the agent won't answer — so a permission this plugin hasn't been granted now lands in the same place, with a log line naming the fix. An older install keeps working with less detail instead of breaking, and regains it on update. There is a test for exactly that install. Two things improve for free: a handler failure arriving inside a transport-successful reply now reports the agent's real error instead of the vague "agent returned no frame", and a non-dict payload can no longer crash the capabilities handler. The registry index still advertises the published 0.1.0-beta.1 zip and its sha256, so it is left alone — permissions there move when the release is cut. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>