Repository navigation
refactor(plugins): split plugin type contracts - #108416
Conversation
bef5d6f to
83b4f24
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 83b4f242d9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // leaf contract surface instead of pulling the full plugin runtime barrel. | ||
| /* oxlint-disable max-lines -- TODO: split this grandfathered oversized file. */ | ||
| export { WorkerProviderError } from "./capability-provider.types.js"; | ||
| export type * from "./capability-provider.types.js"; |
There was a problem hiding this comment.
Track split plugin types in DTS invalidation
This re-export moves the public SDK contracts into new leaf files, but the boundary declaration generator still treats only src/plugins/types.ts as the plugin-contract input (scripts/prepare-extension-package-boundary-artifacts.mjs's PLUGIN_SDK_TYPE_INPUTS), and the CI cache key has the same src/plugins/types.ts-only dependency. After this lands, a later change to src/plugins/provider-plugin.types.ts or another leaf that does not touch the facade can reuse a fresh .boundary-dts.stamp/cache and skip rebuilding the flat openclaw/plugin-sdk declarations, leaving shipped plugin SDK types stale. Please include the new leaf files or src/plugins/*.types.ts in those invalidation inputs.
Useful? React with 👍 / 👎.
1ce1ff7 to
c5cef83
Compare
c5cef83 to
c175af3
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c175af3d25
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| export { WorkerProviderError } from "./capability-provider.types.js"; | ||
| export type * from "./capability-provider.types.js"; | ||
| export type * from "./migration-provider.types.js"; | ||
| export type * from "./plugin-api.types.js"; |
There was a problem hiding this comment.
Keep split plugin contracts in CodeQL checks
This split moves the public plugin API contract out of the only file that the CodeQL plugin-boundary workflow recognizes. I checked .github/workflows/codeql-critical-quality.yml and its PR shard detector only sets plugin=true for the explicit src/plugins/...|src/plugins/types.ts|... list, while .github/codeql/codeql-plugin-boundary-critical-quality.yml also lists only src/plugins/types.ts; a later PR that edits only src/plugins/plugin-api.types.ts or another non-provider leaf will skip/filter the plugin-boundary analysis. Please add the new leaf contracts, or a src/plugins/*.types.ts pattern, to those lists.
Useful? React with 👍 / 👎.
|
Merged via squash.
|
* refactor(plugins): split plugin type contracts * refactor(plugins): split provider type contracts * refactor(plugins): extract plugin definition contract
* refactor(plugins): split plugin type contracts * refactor(plugins): split provider type contracts * refactor(plugins): extract plugin definition contract
What Problem This Solves
src/plugins/types.tscombined provider auth, provider runtime, capability providers, commands, registration, migrations, and the main plugin API in one 3,051-line contract file. The mixed ownership made focused changes harder to navigate and required a grandfathered max-lines suppression.Why This Change Was Made
Keep
src/plugins/types.tsas the stable public facade while moving definitions into thirteen focused domain modules. Provider contracts are separated into catalog, runtime, replay, transport, authentication, and final plugin composition surfaces. Plugin definitions get a leaf contract so the API and registration modules remain acyclic. Every resulting module stays below 700 physical lines. Preserve every named export and both runtime values, refresh generated SDK source-link hashes, and remove the stale max-lines baseline entry. No plugin API names or signatures change.User Impact
No user-visible or runtime behavior change. Plugin authors keep importing the same public SDK contracts; maintainers gain narrower ownership and review surfaces.
Evidence
pnpm check:changedon Blacksmith Testbox: passed core production and test typechecks, all lint shards, architecture guards, max-lines ratchet, API baseline, and dependency checks.pnpm plugin-sdk:surface:check: passed with 345 entrypoints and 11,020 exports.AI-assisted. I reviewed the ownership split, preserved facade contract, generated SDK metadata change, and validation results.