Skip to content

Commit f2bd76c

Browse files
committed
refactor: finalize plugin sdk legacy boundary cleanup
1 parent 357ce71 commit f2bd76c

File tree

102 files changed

+418
-1647
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+418
-1647
lines changed

docs/tools/plugin.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -920,8 +920,16 @@ Notes:
920920
Use SDK subpaths instead of the monolithic `openclaw/plugin-sdk` import when
921921
authoring plugins:
922922

923-
- `openclaw/plugin-sdk/core` for generic plugin APIs, provider auth types, and shared helpers such as routing/session utilities and logger-backed runtimes.
924-
- `openclaw/plugin-sdk/compat` for bundled/internal plugin code that needs broader shared runtime helpers than `core`.
923+
- `openclaw/plugin-sdk/core` for the smallest generic plugin-facing contract.
924+
- Domain subpaths such as `openclaw/plugin-sdk/channel-config-helpers`,
925+
`openclaw/plugin-sdk/channel-config-schema`,
926+
`openclaw/plugin-sdk/channel-policy`,
927+
`openclaw/plugin-sdk/reply-history`,
928+
`openclaw/plugin-sdk/routing`,
929+
`openclaw/plugin-sdk/runtime-store`, and
930+
`openclaw/plugin-sdk/directory-runtime` for shared runtime/config helpers.
931+
- `openclaw/plugin-sdk/compat` remains as a legacy migration surface for older
932+
external plugins. Bundled plugins should not use it.
925933
- `openclaw/plugin-sdk/telegram` for Telegram channel plugin types and shared channel-facing helpers. Built-in Telegram implementation internals stay private to the bundled extension.
926934
- `openclaw/plugin-sdk/discord` for Discord channel plugin types and shared channel-facing helpers. Built-in Discord implementation internals stay private to the bundled extension.
927935
- `openclaw/plugin-sdk/slack` for Slack channel plugin types and shared channel-facing helpers. Built-in Slack implementation internals stay private to the bundled extension.
@@ -982,8 +990,8 @@ Compatibility note:
982990

983991
- `openclaw/plugin-sdk` remains supported for existing external plugins.
984992
- New and migrated bundled plugins should use channel or extension-specific
985-
subpaths; use `core` for generic surfaces and `compat` only when broader
986-
shared helpers are required.
993+
subpaths; use `core` plus explicit domain subpaths for generic surfaces, and
994+
treat `compat` as migration-only.
987995

988996
## Read-only channel inspection
989997

extensions/bluebubbles/src/channel.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { formatNormalizedAllowFromEntries } from "openclaw/plugin-sdk/allow-from";
12
import type { ChannelAccountSnapshot, ChannelPlugin } from "openclaw/plugin-sdk/bluebubbles";
23
import {
34
buildChannelConfigSchema,
@@ -11,13 +12,12 @@ import {
1112
resolveBlueBubblesGroupToolPolicy,
1213
setAccountEnabledInConfigSection,
1314
} from "openclaw/plugin-sdk/bluebubbles";
15+
import { mapAllowFromEntries } from "openclaw/plugin-sdk/channel-config-helpers";
16+
import { createAccountStatusSink } from "openclaw/plugin-sdk/channel-lifecycle";
1417
import {
1518
buildAccountScopedDmSecurityPolicy,
1619
collectOpenGroupPolicyRestrictSendersWarnings,
17-
createAccountStatusSink,
18-
formatNormalizedAllowFromEntries,
19-
mapAllowFromEntries,
20-
} from "openclaw/plugin-sdk/compat";
20+
} from "openclaw/plugin-sdk/channel-policy";
2121
import {
2222
listBlueBubblesAccountIds,
2323
type ResolvedBlueBubblesAccount,

extensions/bluebubbles/src/config-schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
buildCatchallMultiAccountChannelSchema,
55
DmPolicySchema,
66
GroupPolicySchema,
7-
} from "openclaw/plugin-sdk/compat";
7+
} from "openclaw/plugin-sdk/channel-config-schema";
88
import { z } from "zod";
99
import { buildSecretInputSchema, hasConfiguredSecretInput } from "./secret-input.js";
1010

extensions/bluebubbles/src/runtime.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { PluginRuntime } from "openclaw/plugin-sdk/bluebubbles";
2-
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/compat";
2+
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
33

44
const runtimeStore = createPluginRuntimeStore<PluginRuntime>("BlueBubbles runtime not initialized");
55
type LegacyRuntimeLogShape = { log?: (message: string) => void };

extensions/discord/src/channel.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ import {
1010
} from "openclaw/plugin-sdk/channel-config-helpers";
1111
import { resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-runtime";
1212
import { normalizeMessageChannel } from "openclaw/plugin-sdk/channel-runtime";
13-
import {
14-
buildAgentSessionKey,
15-
resolveThreadSessionKeys,
16-
type RoutePeer,
17-
} from "openclaw/plugin-sdk/core";
1813
import {
1914
buildComputedAccountStatusSnapshot,
2015
buildChannelConfigSchema,
@@ -33,6 +28,11 @@ import {
3328
type ChannelPlugin,
3429
type OpenClawConfig,
3530
} from "openclaw/plugin-sdk/discord";
31+
import {
32+
buildAgentSessionKey,
33+
resolveThreadSessionKeys,
34+
type RoutePeer,
35+
} from "openclaw/plugin-sdk/routing";
3636
import {
3737
listDiscordAccountIds,
3838
resolveDiscordAccount,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { transcribeFirstAudio } from "openclaw/plugin-sdk/media-runtime";

extensions/discord/src/monitor/preflight-audio.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export async function resolveDiscordPreflightAudioMentionContext(params: {
5050
};
5151
}
5252
try {
53-
const { transcribeFirstAudio } = await import("openclaw/plugin-sdk/media-runtime");
53+
const { transcribeFirstAudio } = await import("./preflight-audio.runtime.js");
5454
if (params.abortSignal?.aborted) {
5555
return {
5656
hasAudioAttachment,

extensions/discord/src/shared.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
import { createScopedChannelConfigBase } from "openclaw/plugin-sdk/compat";
1+
import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
22
import {
33
createScopedAccountConfigAccessors,
4-
formatAllowFromLowercase,
5-
} from "openclaw/plugin-sdk/compat";
6-
import { buildChannelConfigSchema } from "../../../src/channels/plugins/config-schema.js";
7-
import type { ChannelPlugin } from "../../../src/channels/plugins/types.plugin.js";
8-
import { getChatChannelMeta } from "../../../src/channels/registry.js";
9-
import { DiscordConfigSchema } from "../../../src/config/zod-schema.providers-core.js";
4+
createScopedChannelConfigBase,
5+
} from "openclaw/plugin-sdk/channel-config-helpers";
6+
import {
7+
buildChannelConfigSchema,
8+
DiscordConfigSchema,
9+
getChatChannelMeta,
10+
type ChannelPlugin,
11+
} from "openclaw/plugin-sdk/discord";
1012
import { inspectDiscordAccount } from "./account-inspect.js";
1113
import {
1214
listDiscordAccountIds,

extensions/feishu/src/channel.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import {
2-
collectAllowlistProviderRestrictSendersWarnings,
3-
formatAllowFromLowercase,
4-
mapAllowFromEntries,
5-
} from "openclaw/plugin-sdk/compat";
1+
import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
2+
import { mapAllowFromEntries } from "openclaw/plugin-sdk/channel-config-helpers";
3+
import { collectAllowlistProviderRestrictSendersWarnings } from "openclaw/plugin-sdk/channel-policy";
64
import type { ChannelMeta, ChannelPlugin, ClawdbotConfig } from "openclaw/plugin-sdk/feishu";
75
import {
86
buildChannelConfigSchema,

extensions/feishu/src/directory.static.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
listDirectoryGroupEntriesFromMapKeysAndAllowFrom,
33
listDirectoryUserEntriesFromAllowFromAndMapKeys,
4-
} from "openclaw/plugin-sdk/compat";
4+
} from "openclaw/plugin-sdk/directory-runtime";
55
import type { ClawdbotConfig } from "openclaw/plugin-sdk/feishu";
66
import { resolveFeishuAccount } from "./accounts.js";
77
import { normalizeFeishuTarget } from "./targets.js";

0 commit comments

Comments
 (0)