#16867: plugin-sdk: export PluginLogger type for plugin use
stale
size: XS
Cluster:
Plugin Enhancements and Fixes
# PR Description: plugin-sdk export PluginLogger type
## Summary
- **Problem:** Plugins cannot reference the `PluginLogger` type from the SDK; they have to declare it locally or source the type elsewhere.
- **Why it matters:** Plugin authors need the correct type for logger parameters/variables for type safety and IDE support.
- **What changed:** Re-exported `PluginLogger` in `src/plugin-sdk/index.ts` from `../plugins/types.js` so plugins can import it from `openclaw/plugin-sdk`.
- **What did NOT change (scope boundary):** No change to logger implementation, plugin runtime behavior, or other APIs.
## Change Type (select all)
- [ ] Bug fix
- [x] 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
None. Only adds a type re-export; runtime behavior is unchanged.
## Security Impact (required)
- New permissions/capabilities? **No**
- Secrets/tokens handling changed? **No**
- New/changed network calls? **No**
- Command/tool execution surface changed? **No**
- Data access scope changed? **No**
- If any **Yes**, explain risk + mitigation: N/A
## Repro + Verification
### Environment
- OS: any
- Runtime/container: Node 22+ / Bun
- Model/provider: N/A
- Integration/channel: N/A
- Relevant config: N/A
### Steps
1. In any extension, add `import type { PluginLogger } from 'openclaw/plugin-sdk'` (or the project’s jiti alias).
2. Use the type to annotate a logger parameter or variable; confirm type-check passes and IDE shows completion.
### Expected
- Type imports and resolves; no type errors.
### Actual
- (Same as expected.)
## Evidence
- [x] Type re-export added in `plugin-sdk/index.ts` alongside existing exports (e.g. `OpenClawPluginServiceContext`). Verified by importing the type in an extension.
## Human Verification (required)
- **Verified scenarios:** Imported `PluginLogger` in a plugin/extension and confirmed the type is available.
- **Edge cases checked:** Type-only re-export; no new runtime code paths.
- **What you did not verify:** Did not run full test suite across all extensions (no runtime logic change).
## Compatibility / Migration
- Backward compatible? **Yes**
- Config/env changes? **No**
- Migration needed? **No**
- If yes, exact upgrade steps: N/A
## Failure Recovery (if this breaks)
- **How to disable/revert:** Remove `PluginLogger` from the `export type { ... }` list in `src/plugin-sdk/index.ts` and release/deploy.
- **Files/config to restore:** `src/plugin-sdk/index.ts` (single export line).
- **Known bad symptoms:** If a plugin depends on this type and the export is reverted, only type errors; runtime is unaffected.
## Risks and Mitigations
**None.** Pure type re-export; no implementation or behavior change.
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Re-exports `PluginLogger` type from `src/plugin-sdk/index.ts`, enabling plugins to import the logger type directly from `openclaw/plugin-sdk` for proper type annotations.
- Added `PluginLogger` to the type re-export list from `../plugins/types.js` in alphabetical order (line 66)
- Type was already defined in `src/plugins/types.ts` (lines 22-27) and used internally
- No runtime behavior changes, pure type-level addition
- Improves plugin developer experience by providing proper TypeScript type definitions
<h3>Confidence Score: 5/5</h3>
- Safe to merge - pure type re-export with no runtime changes
- This is a straightforward type re-export that adds no new implementation. The `PluginLogger` type already exists and is used throughout the codebase. The change is minimal (one line), properly alphabetized, and the multiple follow-up commits show careful attention to code organization.
- No files require special attention
<sub>Last reviewed commit: c49d90c</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#21732: fix(plugin-sdk): re-export missing plugin authoring types
by jylkim · 2026-02-20
79.0%
#22478: fix(diagnostics-otel): wire OTLP exporter to emit traffic to config...
by LuffySama-Dev · 2026-02-21
73.1%
#2556: fix(plugin-install): handle existing plugins and filter workspace deps
by longmaba · 2026-01-27
72.4%
#14292: fix(scripts): add js extension
by hannahhoward · 2026-02-11
71.9%
#20402: Pr/load openclaw plugins async
by ramarnat · 2026-02-18
71.9%
#22283: Plugins: expose resolveMainSessionKey in runtime system
by MegaPhoenix92 · 2026-02-21
71.1%
#18911: feat(plugins): Add registerStreamFnWrapper and updatePluginConfig APIs
by John-Rood · 2026-02-17
70.6%
#16044: plugin-sdk: expose onAgentEvent + onSessionTranscriptUpdate via Plu...
by scifantastic · 2026-02-14
70.6%
#11281: fix(logging): prevent subsystem loggers from bypassing file log lev...
by janckerchen · 2026-02-07
70.2%
#13176: fix: resolve llm-task module import for global installs
by striking · 2026-02-10
70.1%