Files
nyaterm/crates/nyaterm-plugin-api/wit/plugin.wit
T
Kang 2ffbaf995d feat(plugins): introduce V1 plugin system with manifest and invocation support
Add a new plugin architecture allowing for dynamic plugin management and execution. This includes the implementation of plugin manifests, action validation, and parameter handling. Introduced new modules for plugin invocation, manifest parsing, and preferences management. Updated the core library to support plugin integration and added tests for plugin functionality. Localization updates for plugin management UI in multiple languages were also included.
2026-10-04 15:42:04 +08:00

22 lines
950 B
Plaintext

package nyaterm:plugin@1.0.0;
interface types {
record version { major: u32, minor: u32, patch: u32 }
record identity { id: string, version: string }
variant value { text(string), integer(s64), boolean(bool) }
record argument { name: string, value: value }
record action-input { action: string, arguments: list<argument>, text: option<string> }
record command-draft { title: string, command: string }
variant action-result { command(command-draft), text(string) }
enum error-kind { invalid-input, unsupported-action, failed }
record plugin-error { kind: error-kind, message: string }
}
world plugin {
use types.{version, identity, action-input, action-result, plugin-error};
export api-version: func() -> version;
export initialize: func(plugin: identity) -> result<_, plugin-error>;
export invoke: func(input: action-input) -> result<action-result, plugin-error>;
export shutdown: func();
}