1.0 KiB
1.0 KiB
Rust Service Plugin Template
This template targets the Component Model-only runtime (runtime.kind = "wasm-component") and exports the yoi:plugin/instance@1.0.0 world.
It demonstrates both authoring surfaces supported by a shared Plugin instance:
example_echois an ordinary request/response Tool handler.example_wsis a Service ingress handler. The host owns WebSocket receive/reconnect work and dispatches boundedwebsocket_textevents intohandle_ingress. The guest replies by returning awebsocket_sendoutput command inServiceOutput; do not run a guest-siderecv(timeout)polling loop. The manifest declareshost_api.websocketplus a matching[[websocket]]target for the example URL. Enablement grants must explicitly allow the same WebSocket target before the host will send output commands.
Build with cargo component build --release (or the project-specific build command used by your Plugin packaging flow), then run yoi plugin check / yoi plugin pack from the generated Plugin directory.