mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-24 07:31:44 +00:00
1.8 KiB
1.8 KiB
Channels Boundary
src/channels/** is core channel implementation. Plugin authors should not
import from this tree directly.
Public Contracts
- Docs:
docs/plugins/sdk-channel-plugins.mddocs/plugins/architecture.mddocs/plugins/sdk-overview.md
- Definition files:
src/channels/plugins/types.plugin.tssrc/channels/plugins/types.core.tssrc/channels/plugins/types.adapters.tssrc/plugin-sdk/core.tssrc/plugin-sdk/channel-contract.ts
Boundary Rules
- Keep extension-facing channel surfaces flowing through
openclaw/plugin-sdk/*instead of direct imports fromsrc/channels/**. - When a bundled or third-party channel needs a new seam, add a typed SDK contract or facade first.
- Treat channel entrypoints such as
channel.ts,shared.ts,channel.setup.ts,gateway.ts, andoutbound.tsas hot import paths. Do not statically pull async-only surfaces like send, monitor, probe, directory-live, setup/login flows, or largeruntime-api.tsbarrels into those files unless startup truly needs them. - Prefer a small local seam such as
channel-api.ts,*.runtime.ts, or*.runtime-api.tsto keep heavy runtime code off the hot path. - Do not mix static and dynamic imports for the same heavy module family across a channel boundary change. If the path should stay lazy, keep it lazy end to end.
- Remember that shared channel changes affect both built-in and extension channels. Check routing, pairing, allowlists, command gating, onboarding, and reply behavior across the full set.
Verification
- If you touch hot channel entrypoints or lazy-loading seams, run
pnpm build. - For bundled plugin channel changes that can affect startup/import cost, run:
OPENCLAW_LOCAL_CHECK=0 node scripts/profile-extension-memory.mjs --extension <id> --skip-combined --concurrency 1