Skip to main content

WIT_SOURCE

Constant WIT_SOURCE 

Source
pub const WIT_SOURCE: &str = "// NAVI plugin WIT definitions (WebAssembly Component Model)\n//\n// This WIT package defines the host-plugin interface for NAVI plugins. A\n// plugin component implements `navi-plugin`, which gives the host a\n// strongly-typed view of the tool\'s name, risk, and invocation signature.\n//\n// Until wit-bindgen generates native Rust bindings (see `navi-plugin-runtime/src/component.rs`),\n// plugins use a flat memory ABI identical to the raw-module path. This\n// document is the canonical interface for component authors.\n\npackage navi:plugin@0.1.0;\n\ninterface types {\n    /// Tool risk classification.\n    variant tool-risk {\n        read-only,\n        network-read,\n        network-write,\n        write,\n    }\n\n    /// Plugin manifest exposed to the host.\n    record plugin-info {\n        id: string,\n        name: string,\n        version: string,\n        publisher: string,\n    }\n\n    /// Tool description as declared by the plugin.\n    record tool-info {\n        id: string,\n        summary: string,\n        risk: tool-risk,\n        input-schema: string,\n    }\n}\n\ninterface host {\n    use types.{tool-risk};\n\n    /// Read a project file. Returns a UTF-8 string on success, or a JSON\n    /// error document on failure.\n    fs-read: func(path: string) -> string;\n\n    /// List a project directory. Returns a JSON array of entry names.\n    fs-list: func(path: string) -> string;\n\n    /// Make an HTTP request. Input is a JSON object describing method/url/body;\n    /// output is a JSON object describing the response or an error.\n    http-request: func(input: string) -> string;\n\n    /// Get git status as a text dump.\n    git-status: func() -> string;\n\n    /// Get git diff as a text dump.\n    git-diff: func() -> string;\n}\n\ninterface plugin {\n    use types.{plugin-info, tool-info};\n    use host;\n\n    /// Returns the plugin\'s identifying metadata.\n    info: func() -> plugin-info;\n\n    /// Lists all tools the plugin implements.\n    list-tools: func() -> list<tool-info>;\n\n    /// Invokes a tool by name with a JSON input. Returns a JSON output.\n    run-tool: func(name: string, input: string) -> string;\n}\n\nworld navi-plugin {\n    export plugin;\n    import host;\n}\n";
Expand description

Canonical WIT definitions for the NAVI plugin interface.

This module exposes the raw WIT text for tooling and documentation. It does not generate code; for that, use wit-bindgen in the future when Component Model support is added to the runtime. The canonical WIT interface definition for navi-plugin.