docs: refresh provider package barrel refs

This commit is contained in:
Peter Steinberger
2026-04-04 12:51:31 +01:00
parent e5b48ea2b4
commit 120b1d2ed2
3 changed files with 25 additions and 0 deletions

View File

@@ -1072,6 +1072,15 @@ authoring plugins:
`<plugin-package-root>/runtime-api.js` is the runtime-only barrel,
`<plugin-package-root>/index.js` is the bundled plugin entry,
and `<plugin-package-root>/setup-entry.js` is the setup plugin entry.
- Current bundled provider examples:
- Anthropic uses `api.js` / `contract-api.js` for Claude stream helpers such
as `wrapAnthropicProviderStream`, beta-header helpers, and `service_tier`
parsing.
- OpenAI uses `api.js` for provider builders, default-model helpers, and
realtime provider builders.
- OpenRouter uses `api.js` for its provider builder plus onboarding/config
helpers, while `register.runtime.js` can still re-export generic
`plugin-sdk/provider-stream` helpers for repo-local use.
- Facade-loaded public entry points prefer the active runtime config snapshot
when one exists, then fall back to the resolved config file on disk when
OpenClaw is not yet serving a runtime snapshot.

View File

@@ -238,6 +238,13 @@ For the full subpath reference, see [SDK Overview](/plugins/sdk-overview).
Within your plugin, use local barrel files (`api.ts`, `runtime-api.ts`) for
internal imports — never import your own plugin through its SDK path.
For provider plugins, keep provider-specific helpers in those package-root
barrels unless the seam is truly generic. Current bundled examples:
- Anthropic: Claude stream wrappers and `service_tier` / beta helpers
- OpenAI: provider builders, default-model helpers, realtime providers
- OpenRouter: provider builder plus onboarding/config helpers
## Pre-submission checklist
<Check>**package.json** has correct `openclaw` metadata</Check>

View File

@@ -54,6 +54,15 @@ stable plugin contracts. Use narrow generic SDK subpaths instead. Inside the
bundled plugin workspace, keep provider-owned helpers in that plugin's own
`api.ts` or `runtime-api.ts`.
Current bundled provider examples:
- Anthropic keeps Claude-specific stream helpers in its own `api.ts` /
`contract-api.ts` seam
- OpenAI keeps provider builders, default-model helpers, and realtime provider
builders in its own `api.ts`
- OpenRouter keeps provider builder and onboarding/config helpers in its own
`api.ts`
## How to migrate
<Steps>