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
706 B
JSON
8 lines
706 B
JSON
{
|
|
"group": "improvements",
|
|
"order": 2,
|
|
"authors": ["TODO-github-username"],
|
|
"zh": "插件在客体里按住键或鼠标键后退出、停用或两分钟不再调用时,宿主会替它抬起,虚拟机不再卡在修饰键按下的状态。按住按键时可同时带修饰键,截图宽度超出支持范围时会被收进范围内而不是被拒绝。",
|
|
"en": "When a plugin leaves a key or a pointer button held in a guest and then exits, is disabled or stops calling for two minutes, the host lifts it, so a VM no longer stays stuck with a modifier down. A held key may carry modifiers, and a screenshot width outside the supported range is brought into range instead of being refused."
|
|
}
|