


















@@ -432,6 +432,223 @@ surface `DEFAULT_COPILOT_API_BASE_URL`,
432432Use the narrowest import that matches the job. If you cannot find an export,
433433check the source at `src/plugin-sdk/` or ask in Discord.
434434435+## Active deprecations
436+437+Narrower deprecations that apply across the plugin SDK, provider contract,
438+runtime surface, and manifest. Each one still works today but will be removed
439+in a future major release. The entry below every item maps the old API to its
440+canonical replacement.
441+442+<AccordionGroup>
443+<Accordion title="command-auth help builders → command-status">
444+**Old (`openclaw/plugin-sdk/command-auth`)**: `buildCommandsMessage`,
445+`buildCommandsMessagePaginated`, `buildHelpMessage`.
446+447+**New (`openclaw/plugin-sdk/command-status`)**: same signatures, same
448+exports — just imported from the narrower subpath. `command-auth`
449+re-exports them as compat stubs.
450+451+```typescript
452+// Before
453+import { buildHelpMessage } from "openclaw/plugin-sdk/command-auth";
454+455+// After
456+import { buildHelpMessage } from "openclaw/plugin-sdk/command-status";
457+```
458+459+</Accordion>
460+461+<Accordion title="Mention gating helpers → resolveInboundMentionDecision">
462+**Old**: `resolveInboundMentionRequirement({ facts, policy })` and
463+`shouldDropInboundForMention(...)` from
464+`openclaw/plugin-sdk/channel-inbound` or
465+`openclaw/plugin-sdk/channel-mention-gating`.
466+467+**New**: `resolveInboundMentionDecision({ facts, policy })` — returns a
468+single decision object instead of two split calls.
469+470+Downstream channel plugins (Slack, Discord, Matrix, MS Teams) have already
471+switched.
472+473+</Accordion>
474+475+<Accordion title="Channel runtime shim and channel actions helpers">
476+`openclaw/plugin-sdk/channel-runtime` is a compatibility shim for older
477+channel plugins. Do not import it from new code; use
478+`openclaw/plugin-sdk/channel-runtime-context` for registering runtime
479+objects.
480+481+`channelActions*` helpers in `openclaw/plugin-sdk/channel-actions` are
482+deprecated alongside raw "actions" channel exports. Expose capabilities
483+through the semantic `presentation` surface instead — channel plugins
484+declare what they render (cards, buttons, selects) rather than which raw
485+action names they accept.
486+487+</Accordion>
488+489+<Accordion title="Web search provider tool() helper → createTool() on the plugin">
490+**Old**: `tool()` factory from `openclaw/plugin-sdk/provider-web-search`.
491+492+**New**: implement `createTool(...)` directly on the provider plugin.
493+OpenClaw no longer needs the SDK helper to register the tool wrapper.
494+495+</Accordion>
496+497+<Accordion title="Plaintext channel envelopes → BodyForAgent">
498+**Old**: `formatInboundEnvelope(...)` (and
499+`ChannelMessageForAgent.channelEnvelope`) to build a flat plaintext prompt
500+envelope from inbound channel messages.
501+502+**New**: `BodyForAgent` plus structured user-context blocks. Channel
503+plugins attach routing metadata (thread, topic, reply-to, reactions) as
504+typed fields instead of concatenating them into a prompt string. The
505+`formatAgentEnvelope(...)` helper is still supported for synthesized
506+assistant-facing envelopes, but inbound plaintext envelopes are on the
507+way out.
508+509+Affected areas: `inbound_claim`, `message_received`, and any custom
510+channel plugin that post-processed `channelEnvelope` text.
511+512+</Accordion>
513+514+<Accordion title="Provider discovery types → provider catalog types">
515+Four discovery type aliases are now thin wrappers over the
516+catalog-era types:
517+518+| Old alias | New type |
519+| ------------------------- | ------------------------- |
520+| `ProviderDiscoveryOrder` | `ProviderCatalogOrder` |
521+| `ProviderDiscoveryContext`| `ProviderCatalogContext` |
522+| `ProviderDiscoveryResult` | `ProviderCatalogResult` |
523+| `ProviderPluginDiscovery` | `ProviderPluginCatalog` |
524+525+Plus the legacy `ProviderCapabilities` static bag — provider plugins
526+should attach capability facts through the provider runtime contract
527+rather than a static object.
528+529+</Accordion>
530+531+<Accordion title="Thinking policy hooks → resolveThinkingProfile">
532+**Old** (three separate hooks on `ProviderThinkingPolicy`):
533+`isBinaryThinking(ctx)`, `supportsXHighThinking(ctx)`, and
534+`resolveDefaultThinkingLevel(ctx)`.
535+536+**New**: a single `resolveThinkingProfile(ctx)` that returns a
537+`ProviderThinkingProfile` with the canonical `id`, optional `label`, and
538+ranked level list. OpenClaw downgrades stale stored values by profile
539+rank automatically.
540+541+Implement one hook instead of three. The legacy hooks keep working during
542+the deprecation window but are not composed with the profile result.
543+544+</Accordion>
545+546+<Accordion title="External OAuth provider fallback → contracts.externalAuthProviders">
547+**Old**: implementing `resolveExternalOAuthProfiles(...)` without
548+declaring the provider in the plugin manifest.
549+550+**New**: declare `contracts.externalAuthProviders` in the plugin manifest
551+**and** implement `resolveExternalAuthProfiles(...)`. The old "auth
552+fallback" path emits a warning at runtime and will be removed.
553+554+```json
555+{
556+ "contracts": {
557+ "externalAuthProviders": ["anthropic", "openai"]
558+ }
559+}
560+```
561+562+</Accordion>
563+564+<Accordion title="Provider env-var lookup → setup.providers[].envVars">
565+**Old** manifest field: `providerAuthEnvVars: { anthropic: ["ANTHROPIC_API_KEY"] }`.
566+567+**New**: mirror the same env-var lookup into `setup.providers[].envVars`
568+on the manifest. This consolidates setup/status env metadata in one
569+place and avoids booting the plugin runtime just to answer env-var
570+lookups.
571+572+`providerAuthEnvVars` remains supported through a compatibility adapter
573+until the deprecation window closes.
574+575+</Accordion>
576+577+<Accordion title="Memory plugin registration → registerMemoryCapability">
578+**Old**: three separate calls —
579+`api.registerMemoryPromptSection(...)`,
580+`api.registerMemoryFlushPlan(...)`,
581+`api.registerMemoryRuntime(...)`.
582+583+**New**: one call on the memory-state API —
584+`registerMemoryCapability(pluginId, { promptBuilder, flushPlanResolver, runtime })`.
585+586+Same slots, single registration call. Additive memory helpers
587+(`registerMemoryPromptSupplement`, `registerMemoryCorpusSupplement`,
588+`registerMemoryEmbeddingProvider`) are not affected.
589+590+</Accordion>
591+592+<Accordion title="Subagent session messages types renamed">
593+Two legacy type aliases still exported from `src/plugins/runtime/types.ts`:
594+595+| Old | New |
596+| ----------------------------- | ------------------------------- |
597+| `SubagentReadSessionParams` | `SubagentGetSessionMessagesParams` |
598+| `SubagentReadSessionResult` | `SubagentGetSessionMessagesResult` |
599+600+The runtime method `readSession` is deprecated in favor of
601+`getSessionMessages`. Same signature; the old method calls through to the
602+new one.
603+604+</Accordion>
605+606+<Accordion title="runtime.tasks.flow → runtime.tasks.flows">
607+**Old**: `runtime.tasks.flow` (singular) returned a live task-flow accessor.
608+609+**New**: `runtime.tasks.flows` (plural) returns DTO-based TaskFlow access,
610+which is import-safe and does not require the full task runtime to be
611+loaded.
612+613+```typescript
614+// Before
615+const flow = api.runtime.tasks.flow(ctx);
616+// After
617+const flows = api.runtime.tasks.flows(ctx);
618+```
619+620+</Accordion>
621+622+<Accordion title="Embedded extension factories → agent tool-result middleware">
623+Covered in "How to migrate → Migrate Pi tool-result extensions to
624+middleware" above. Included here for completeness: the Pi-only
625+`api.registerEmbeddedExtensionFactory(...)` path is deprecated in favor of
626+`api.registerAgentToolResultMiddleware(...)` with an explicit harness
627+list in `contracts.agentToolResultMiddleware`.
628+</Accordion>
629+630+<Accordion title="OpenClawSchemaType alias → OpenClawConfig">
631+`OpenClawSchemaType` re-exported from `openclaw/plugin-sdk` is now a
632+one-line alias for `OpenClawConfig`. Prefer the canonical name.
633+634+```typescript
635+// Before
636+import type { OpenClawSchemaType } from "openclaw/plugin-sdk";
637+// After
638+import type { OpenClawConfig } from "openclaw/plugin-sdk/config-schema";
639+```
640+641+</Accordion>
642+</AccordionGroup>
643+644+<Note>
645+Extension-level deprecations (inside bundled channel/provider plugins under
646+`extensions/`) are tracked inside their own `api.ts` and `runtime-api.ts`
647+barrels. They do not affect third-party plugin contracts and are not listed
648+here. If you consume a bundled plugin's local barrel directly, read the
649+deprecation comments in that barrel before upgrading.
650+</Note>
651+435652## Removal timeline
436653437654| When | What happens |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。