@drawdy/driver-protocol. This page covers the envelope, the module, and the manifest.
The envelope
Every message — command or subscription — is aProtocolCommand:
typeidentifies the command, e.g."command:camera:get-info".driverIdis your extension’s id (from the manifest).requestIdis any value unique within your driver; it pairs a response to its request.reqcarries the request payload. Commands with no input omit it.resis the response: either{ value }or{ error }.
res yourself. You issue a request — the command minus res — and receive a response — the command minus req:
response.res:
The driver module
A driver exports aDriverModule:
activateruns once when Drawdy loads the driver. Use it to register menus, panels, and subscriptions, and to issue any startup commands.issueCommandsends a command and resolves to its typed response.manifestis the registered manifest.stylingis the current theme — seeModuleStyling.generateIdmints ids for canvas elements you create.
onEventreceives every subscription event your driver is registered for.
Manifest
main is the entry bundle filename inside the .drawdyx zip. The host confirms the manifest on load; an invalid id, missing capability, or wrong apiVersion lets the host decide how to proceed.
In this section
- Commands — every command a driver can issue, with its request and response.
- Subscriptions — the events Drawdy pushes to
onEvent. - Webview API — the
acquireDrawdyApi()global inside a webview document. - Data Types — elements, schemas, styling, tool state, and CSS units.