Give the Sidecar Host API one authoritative catalog in pkg/pluginproto: every host/* method's status, required permissions, handshake feature and request and result shapes. The host, pkg/pluginsdk and plugins share those types, so a field can no longer exist on one side only, and permissions come from the catalog instead of from each handler. Tests gate that every served method is catalogued, every stable catalogued method is served, and every catalogued permission is one the host recognizes. Open the interface up instead of adding consent gates. Typing a secret setting is no longer reserved for reims.agent: any plugin that holds qmp:write and that the user authorized for the VM can have the host type the plugin's own setting, which the plugin never reads back. Restoring a snapshot works on any authorized VM, a plugin names its own clones, a held key may carry modifiers, and a screenshot width outside the supported range is brought into range rather than refused. Deleting a VM stays limited to the temporary VMs a plugin created. Record the keys and pointer buttons each plugin holds per VM and lift them when the plugin's process exits, its scope is disposed, the VM stops or it stops calling, so a guest never stays stuck with a modifier down. Requests from plugins that declare pluginApi 1.3 or newer are decoded strictly and answer an undefined field with JSON-RPC -32602, while older plugins keep tolerant decoding. Add typed VM and console methods to pkg/pluginsdk so a plugin no longer needs its own JSON-RPC client. A method the contract does not catalog, or one the host did not advertise in the handshake, is refused before it is sent, and the host's JSON-RPC error code reaches the caller.
8 lines
757 B
JSON
8 lines
757 B
JSON
{
|
|
"group": "new",
|
|
"order": 1,
|
|
"authors": ["TODO-github-username"],
|
|
"zh": "`pkg/pluginsdk` 新增虚拟机与控制台方法,插件无需自写 JSON-RPC 客户端即可列出和操作虚拟机、截图、按键、键入文本与敏感设置、抬起仍按住的输入。宿主未在握手中宣告的方法会在发送前被拒绝,宿主返回的 JSON-RPC 错误码也会保留给调用方。",
|
|
"en": "Add VM and console methods to `pkg/pluginsdk`, so a plugin can list and control VMs, take screenshots, press keys, type text and secrets and release held input without writing its own JSON-RPC client. A method the host did not advertise in the handshake is refused before it is sent, and the host's JSON-RPC error code reaches the caller."
|
|
}
|