#21732: fix(plugin-sdk): re-export missing plugin authoring types
size: XS
Cluster:
Plugin Enhancements and Fixes
## Summary
Describe the problem and fix in 2–5 bullets:
- Problem: The `openclaw/plugin-sdk` barrel did not re-export key plugin authoring types (`OpenClawPluginDefinition`, `OpenClawPluginToolContext`, etc.), so they were not importable from the public SDK path.
- Why it matters: Plugin authors could not reference default plugin definition and tool factory/context types from the official SDK entrypoint, which hurts type-safe plugin development DX.
- What changed: Added 5 missing type re-exports to `src/plugin-sdk/index.ts` from `../plugins/types.js`, and added a type re-export smoke test in `src/plugin-sdk/index.test.ts`.
- What did NOT change (scope boundary): No runtime logic changes in plugin loading/execution, no config schema changes, and no protocol behavior changes.
## Change Type (select all)
- [x] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Docs
- [ ] Security hardening
- [ ] Chore/infra
## Scope (select all touched areas)
- [ ] Gateway / orchestration
- [ ] Skills / tool execution
- [ ] Auth / tokens
- [ ] Memory / storage
- [ ] Integrations
- [x] API / contracts
- [ ] UI / DX
- [ ] CI/CD / infra
## Linked Issue/PR
- Closes #
- Related #
## User-visible / Behavior Changes
Plugin authors can now import the following types directly from `openclaw/plugin-sdk`:
`OpenClawPluginDefinition`, `OpenClawPluginToolContext`, `OpenClawPluginToolFactory`, `OpenClawPluginToolOptions`, `OpenClawPluginModule`.
## Security Impact (required)
- New permissions/capabilities? (`Yes/No`): No
- Secrets/tokens handling changed? (`Yes/No`): No
- New/changed network calls? (`Yes/No`): No
- Command/tool execution surface changed? (`Yes/No`): No
- Data access scope changed? (`Yes/No`): No
- If any `Yes`, explain risk + mitigation:
## Repro + Verification
### Environment
- OS: macOS (local dev)
- Runtime/container: Node 22+, pnpm
- Model/provider: N/A
- Integration/channel (if any): N/A
- Relevant config (redacted): N/A
### Steps
1. `pnpm build:plugin-sdk:dts`
2. `pnpm test src/plugin-sdk/index.test.ts`
3. `pnpm check`
4. `pnpm build`
### Expected
- `dist/plugin-sdk/plugin-sdk/index.d.ts` re-exports the previously missing plugin authoring types.
- plugin-sdk export tests pass.
### Actual
- Matches expectation.
## Evidence
Attach at least one:
- [ ] Failing test/log before + passing after
- [x] Trace/log snippets
- [ ] Screenshot/recording
- [ ] Perf numbers (if relevant)
Generated `dist/plugin-sdk/plugin-sdk/index.d.ts` snippet:
```ts
export type { AnyAgentTool, OpenClawPluginApi, OpenClawPluginDefinition, OpenClawPluginModule, OpenClawPluginService, OpenClawPluginServiceContext, OpenClawPluginToolContext, OpenClawPluginToolFactory, OpenClawPluginToolOptions, ProviderAuthContext, ProviderAuthResult, } from "../plugins/types.js";
```
## Human Verification (required)
What you personally verified (not just CI), and how:
- Verified scenarios: Confirmed the 5 missing types are exported from the `openclaw/plugin-sdk` barrel in source and generated declaration output.
- Edge cases checked: Confirmed existing runtime export guard test (`does not expose runtime modules`) still passes.
- What you did **not** verify: Full `pnpm test` is not green due to unrelated pre-existing/environmental failures (for example loopback bind `EPERM` in this sandbox).
## Compatibility / Migration
- Backward compatible? (`Yes/No`): Yes
- Config/env changes? (`Yes/No`): No
- Migration needed? (`Yes/No`): No
- If yes, exact upgrade steps:
## Failure Recovery (if this breaks)
- How to disable/revert this change quickly: Revert this PR to restore the prior export surface.
- Files/config to restore: `src/plugin-sdk/index.ts`, `src/plugin-sdk/index.test.ts`
- Known bad symptoms reviewers should watch for: Type import failures for the newly exposed plugin types from `openclaw/plugin-sdk`.
## Risks and Mitigations
List only real risks for this PR. Add/remove entries as needed. If none, write `None`.
- Risk: Slight increase in public SDK type surface to maintain.
- Mitigation: Type-only re-exports (no runtime impact) plus smoke test coverage for regression prevention.
Most Similar PRs
#16867: plugin-sdk: export PluginLogger type for plugin use
by fsdwen · 2026-02-15
79.0%
#20415: fix(extensions): use dist/ import paths for bundled extensions
by 88plug · 2026-02-18
76.0%
#18791: docs: add FogClaw plugin docs for official OpenClaw listing
by sidmohan0 · 2026-02-17
70.3%
#13176: fix: resolve llm-task module import for global installs
by striking · 2026-02-10
69.5%
#22283: Plugins: expose resolveMainSessionKey in runtime system
by MegaPhoenix92 · 2026-02-21
69.4%
#20402: Pr/load openclaw plugins async
by ramarnat · 2026-02-18
69.1%
#19807: fix: apply #19779 Docker/TS strict-build fixes
by dalefrieswthat · 2026-02-18
67.5%
#23680: fix(types): add missing config and agentDir params to maybeMarkAuth...
by NewdlDewdl · 2026-02-22
67.0%
#22577: fix(feishu): use senderKey fallback for DM session isolation
by leesonchen · 2026-02-21
67.0%
#23625: feat(plugin-sdk): Add channel development helpers and discovery met...
by guxiaobo · 2026-02-22
66.5%