c53f699714
- go plugin backends ship as release tarballs (per-platform binaries, checksums) that kandev installs from url/upload or filesystem sideload+sync, then spawns and supervises via hashicorp/go-plugin (unix socket / loopback tcp+automtls) - strict typed grpc contract (kandev.plugin.v1): DeliverEvent/InvokeTool/HandleWebhook plus a capability-gated host service (state, secrets, emit); author sdk in pkg/pluginsdk; packaging cli in cmd/plugin-pack - native frontend bundles: window.registerKandevPlugin + registry/host loader with dynamic routes, nav items, slots and ws handlers; plugins settings page with install dialog, sync button and enable/disable/uninstall - gated behind the plugins feature flag (prod off, dev/e2e on); covered by unit and integration tests plus playwright e2e against a real packaged fixture plugin Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2.4 KiB
2.4 KiB
id, title, status, wave, depends_on, plan
| id | title | status | wave | depends_on | plan | |||
|---|---|---|---|---|---|---|---|---|
| task-05 | Registry + service + lifecycle state machine + Provide | pending | 2 |
|
docs/plans/plugins/plan.md |
Registry + service + lifecycle state machine + Provide
Title
The core plugin Service: in-memory registry loaded from the FS store, lifecycle
state machine, and a Provide(...) constructor following the repo provider pattern.
Inputs
- Spec
docs/specs/plugins/spec.md→ "State machine" (registered→active→ disabled→uninstalled, error branch), "Permissions", registration flow. - Depends on:
internal/plugins/manifest(task-01),internal/plugins/store(task-02),internal/plugins/state(task-03). - Provider pattern reference:
internal/jira/provider.goProvide(...) (*Service, cleanup, error)and howinternal/backendapp/services.goinitJiraServicecalls it.
Acceptance
internal/plugins/registry.go:Registrywrappingmap[string]*store.Recordwith mutex;Load()from FS store,Get,List,Add,Remove,SetStatus.internal/plugins/service.go:Servicewith methodsRegister(manifest) (*store.Record, store.Credentials, error),List(),Get(id),UpdateConfig(id, map),Uninstall(id),Enable(id),Disable(id),SetStatus(id, status),AuthenticatePlugin(apiKey) (*store.Record, error). Status transitions enforce the spec state machine (reject invalid transitions with a typed error).internal/plugins/provider.go:Provide(cfg, stateDB, secretAdapter, eventBus, log) (*Service, func() error, error)constructing FS store (dir~/.kandev/plugins, overridable via cfg/env for tests), state store, registry (Load on startup). Health poller + delivery are wired in later tasks — expose setters/fields so task-06/07 can attach.- Status enum +
Statustype ininternal/plugins/types.go.
Files
apps/backend/internal/plugins/types.goapps/backend/internal/plugins/registry.go+registry_test.goapps/backend/internal/plugins/service.go+service_test.goapps/backend/internal/plugins/provider.go+provider_test.go
Verification
go test ./internal/plugins/...fromapps/backendmake -C apps/backend lint
Output contract
Report: state-machine transition table implemented, Provide signature (so wiring task-09 matches), extension points left for delivery/health. Do not edit manifest/store/state packages (import only).
Dependencies
task-01, task-02, task-03.