2.0 KiB
2.0 KiB
id, title, status, wave, depends_on, plan
| id | title | status | wave | depends_on | plan |
|---|---|---|---|---|---|
| task-01 | Plugin manifest types + validation | done | 1 | docs/plans/plugins/plan.md |
Plugin manifest types + validation
Title
Define the plugin manifest Go types and a validator, parsed from YAML.
Inputs
- Spec
docs/specs/plugins/requirements/plugins.md→ "Data model / Plugin registration" (the YAML manifest: id, api_version, version, display_name, description, author, categories, base_url, endpoints{health,events,tools,webhooks}, capabilities{events,api_read,api_write,state,secrets}, tools[], webhooks[], config_schema, ui.pages[] (NEW:key,title,path,surface)). - id pattern:
^[a-z0-9][a-z0-9._-]*$. - categories enum: connector | automation | tools | analytics.
ui.pages[].surfaceenum: settings | task-panel | main-nav.- Follow
apps/backend/AGENTS.md(package layout, small funcs, golangci limits).
Acceptance
internal/plugins/manifest/manifest.godefinesManifest,Endpoints,Capabilities,Tool,Webhook,UIPagestructs with yaml + json tags.Parse([]byte) (*Manifest, error)parses YAML;(*Manifest) Validate() errorreturns a joined/first error for: bad id pattern, missing base_url, missing required endpoints, unknown category, unknown ui surface, duplicate tool/webhook keys,api_version != 1.- Capability helpers:
HasEvent(name string) bool(supports wildcard match sotask.*matchestask.created),CanRead(resource) bool,CanWrite(resource) bool.
Files
apps/backend/internal/plugins/manifest/manifest.goapps/backend/internal/plugins/manifest/manifest_test.goapps/backend/internal/plugins/manifest/match.go(wildcard subject match) + test
Verification
go test ./internal/plugins/manifest/...fromapps/backendmake -C apps/backend lint
Output contract
Report: types added, validation rules covered by tests, wildcard match behavior,
any spec ambiguity encountered. Do not touch files outside internal/plugins/manifest/.
Dependencies
None.