refactor(plugins): move the plugin contract to version 3

Merged
TH
7d ago
+2586-1203

Summary

The 0.22 plugin contract changes once to version 3 (ADR 0034, #3311, #4591). A plugin factory now returns apiVersion: 3 plus a contributes list of independently activated claims — provider, replay-backend, replay-execution. Each claim key is declared statically in the package's agent-device metadata, validated before import, and matched against the factory result after it runs; the registry keeps one record, setup outcome and cleanup entry per claim. Nine plugin packages migrated. Version 2 packages, including the external @nomac/agent-device, get a typed incompatible-plugin-api outcome with no compatibility shim. A platform kind lands with #4597, not here.

92 files, +2489/−1202 gross. No scope expansion beyond the contract, the nine plugins, their tests and docs, plus two packaging fixes the widened contract exposed: the contract declarations now share one published chunk with the replay contracts, and @agent-device/replay types its published declarations against agent-device/plugins as Maestro already does.

export default () => ({
  apiVersion: 3,
  contributes: [{ kind: 'provider', provider: 'example', credentials: { variables: [] }, setup }],
});

Validation

Head 38fe33365a, base 6534ef3869.

  • pnpm check:affected --run --base origin/0.22 --head 38fe33365a — passed, exactCommit: true; 42 checks passed, 28 skipped as GitHub-authoritative; 22,123 tests passed, 0 failed. Selection stayed full.
  • pnpm exec fallow audit --base origin/0.22 — no issues in the changed files, no suppressions or baseline edits.
  • pnpm run check:package — Maestro and replay package-smoke pass, including the embedded-runtime failure-isolation cases and the managed plugins add route.
  • pnpm exec vitest run scripts/__tests__/eager-closure-budgets.test.ts — no plugin entry gains an eager module.

CI owns full coverage, native builds, device lanes and provider integration. No device run beyond what CI does.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.