Plugin SDK: manifest schema, validation, and RPC protocol #70
Labels
No Label
area:auth
area:docs
area:export
area:ops
area:storage
area:supply-chain
auth
backend
blocked
collab
deployment
docs
effort:L
effort:M
effort:S
frontend
plugins
qa
vs-nfd
vs-nfd:blocker
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: stwaidele/dorfteich#70
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
The SDK is the contract between host and plugins; everything else in M7 builds on it (ADR 0008, plugin-architecture.md).
Scope
Implement
packages/plugin-sdk: Zod manifest schema (id, name, version, apiVersion, kind, extensionPoints, permissions, fallback, license, i18n refs) with validation + precise error messages; the typed postMessage RPC protocol (request/response with ids, timeouts, capability names) as host-side and plugin-side helpers (createPlugin, host router); protocol documentation in the package README with a sequence diagram.Acceptance criteria
Technical notes
Dependencies
Depends on #1.
Size: ~1.5 days
Conventions: English code/comments, clear human-readable code, no hard-coded UI strings (ADR 0012, add
deanden), permission checks only via the shared guard (docs/architecture/permissions.md). Read the referenced ADRs before starting.Done in
ec6ca80— pipeline green (all 8 contexts; Promote to Int is skipped viaRUN_INT_DEPLOY=false, INT stays down by design).New standalone package
@dorfteich/plugin-sdk(onlyzod), the contract every other M7 story builds on (ADR 0008, plugin-architecture.md).Acceptance criteria
{ path, message }errors — each asserted individually, plus spot-checks on path/messageMessageChanneltest: request/response, arg passing, timeout, unknown-method, undeclared-capability rejection, disposecheckApiVersioncompatibility helper with testsContents
manifest.ts— Zod schema +validateManifest/parseManifest; cross-field rules (extension-point↔kind match, unique ids,section_styledeclares no permissions).api-version.ts—checkApiVersionagainst the host's supported major range.capabilities.ts— capability names + method→capability map (single source of truth for the permission gate).rpc.ts— transport-agnosticcreateRpcEndpoint(ids, per-request timeouts,unknown_method/endpoint_disposed) +windowTransportadapter.host.ts—createHostBridge: routes plugin calls through the manifest permission gate; drivesrender/edit/destroy.plugin.ts—createPlugin: answers lifecycle calls, exposes a typedhostproxy.README.md— protocol doc with a mermaid sequence diagram.51 tests green; repo-wide typecheck + lint clean. Next: the install/storage path (#71) and the sandbox host runtime (#73) consume this SDK.