refactor(plugin-sdk): narrow config runtime imports

This commit is contained in:
Peter Steinberger
2026-04-27 14:57:48 +01:00
parent f3e8a8a319
commit 4336a7f3a9
573 changed files with 1066 additions and 860 deletions

View File

@@ -129,6 +129,25 @@ releases.
must receive config from their boundary, and long-lived runtime modules have
zero allowed ambient `loadConfig()` calls.
New plugin code should also avoid importing the broad
`openclaw/plugin-sdk/config-runtime` compatibility barrel. Use the narrow
SDK subpath that matches the job:
| Need | Import |
| --- | --- |
| Config types such as `OpenClawConfig` | `openclaw/plugin-sdk/config-types` |
| Already-loaded config assertions and plugin-entry config lookup | `openclaw/plugin-sdk/plugin-config-runtime` |
| Current runtime snapshot reads | `openclaw/plugin-sdk/runtime-config-snapshot` |
| Config writes | `openclaw/plugin-sdk/config-mutation` |
| Session store helpers | `openclaw/plugin-sdk/session-store-runtime` |
| Markdown table config | `openclaw/plugin-sdk/markdown-table-runtime` |
| Group policy runtime helpers | `openclaw/plugin-sdk/runtime-group-policy` |
| Secret input resolution | `openclaw/plugin-sdk/secret-input-runtime` |
| Model/session overrides | `openclaw/plugin-sdk/model-session-runtime` |
Bundled production plugins are scanner-guarded against the broad barrel so
imports stay local to the behavior they need.
</Step>
<Step title="Migrate Pi tool-result extensions to middleware">