




















@@ -57,6 +57,15 @@ id, explicit `baseConversationId`, and any `parentConversationCandidates`.
5757When you return `parentConversationCandidates`, keep them ordered from the
5858narrowest parent to the broadest/base conversation.
595960+Use `openclaw/plugin-sdk/channel-route` when plugin code needs to normalize
61+route-like fields, compare a child thread with its parent route, or build a
62+stable dedupe key from `{ channel, to, accountId, threadId }`. The helper
63+normalizes numeric thread ids the same way core does, so plugins should prefer
64+it over ad hoc `String(threadId)` comparisons.
65+Plugins with provider-specific target grammar can inject their parser into
66+`resolveChannelRouteTargetWithParser(...)` and still get the same route target
67+shape and thread fallback semantics core uses.
68+6069Bundled plugins that need the same parsing before the channel registry boots
6170can also expose a top-level `session-key-api.ts` file with a matching
6271`resolveSessionConversation(...)` export. Core uses that bootstrap-safe surface
@@ -87,6 +96,8 @@ Most channel plugins do not need approval-specific code.
8796- Use `approvalCapability.describeExecApprovalSetup` when the channel wants the disabled-path reply to explain the exact config knobs needed to enable native exec approvals. The hook receives `{ channel, channelLabel, accountId }`; named-account channels should render account-scoped paths such as `channels.<channel>.accounts.<id>.execApprovals.*` instead of top-level defaults.
8897- If a channel can infer stable owner-like DM identities from existing config, use `createResolvedApproverActionAuthAdapter` from `openclaw/plugin-sdk/approval-runtime` to restrict same-chat `/approve` without adding approval-specific core logic.
8998- If a channel needs native approval delivery, keep channel code focused on target normalization plus transport/presentation facts. Use `createChannelExecApprovalProfile`, `createChannelNativeOriginTargetResolver`, `createChannelApproverDmTargetResolver`, and `createApproverRestrictedNativeApprovalCapability` from `openclaw/plugin-sdk/approval-runtime`. Put the channel-specific facts behind `approvalCapability.nativeRuntime`, ideally via `createChannelApprovalNativeRuntimeAdapter(...)` or `createLazyChannelApprovalNativeRuntimeAdapter(...)`, so core can assemble the handler and own request filtering, routing, dedupe, expiry, gateway subscription, and routed-elsewhere notices. `nativeRuntime` is split into a few smaller seams:
99+- `createChannelNativeOriginTargetResolver` uses the shared channel-route matcher by default for `{ to, accountId, threadId }` targets. Pass `targetsMatch` only when a channel has provider-specific equivalence rules, such as Slack timestamp prefix matching.
100+- Pass `normalizeTargetForMatch` to `createChannelNativeOriginTargetResolver` when the channel needs to canonicalize provider ids before the default route matcher or a custom `targetsMatch` callback runs, while preserving the original target for delivery. Use `normalizeTarget` only when the resolved delivery target itself should be canonicalized.
90101- `availability` — whether the account is configured and whether a request should be handled
91102- `presentation` — map the shared approval view model into pending/resolved/expired native payloads or final actions
92103- `transport` — prepare targets plus send/update/delete native approval messages
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。