diff --git a/extensions/discord/src/channel.ts b/extensions/discord/src/channel.ts index f83be6bbe41..88295c61880 100644 --- a/extensions/discord/src/channel.ts +++ b/extensions/discord/src/channel.ts @@ -1,9 +1,4 @@ import { Separator, TextDisplay } from "@buape/carbon"; -import { - buildAgentSessionKey, - resolveThreadSessionKeys, - type RoutePeer, -} from "openclaw/plugin-sdk"; import { createScopedChannelConfigBase } from "openclaw/plugin-sdk/compat"; import { buildAccountScopedAllowlistConfigEditor, @@ -13,6 +8,11 @@ import { createScopedAccountConfigAccessors, formatAllowFromLowercase, } from "openclaw/plugin-sdk/compat"; +import { + buildAgentSessionKey, + resolveThreadSessionKeys, + type RoutePeer, +} from "openclaw/plugin-sdk/core"; import { buildComputedAccountStatusSnapshot, buildChannelConfigSchema, diff --git a/extensions/imessage/src/channel.ts b/extensions/imessage/src/channel.ts index a4767706757..2d5b0ba9b39 100644 --- a/extensions/imessage/src/channel.ts +++ b/extensions/imessage/src/channel.ts @@ -1,9 +1,9 @@ -import { buildAgentSessionKey, type RoutePeer } from "openclaw/plugin-sdk"; import { buildAccountScopedAllowlistConfigEditor, buildAccountScopedDmSecurityPolicy, collectAllowlistProviderRestrictSendersWarnings, } from "openclaw/plugin-sdk/compat"; +import { buildAgentSessionKey, type RoutePeer } from "openclaw/plugin-sdk/core"; import { buildChannelConfigSchema, collectStatusIssuesFromLastError, diff --git a/extensions/signal/src/channel.ts b/extensions/signal/src/channel.ts index 2d7e1983972..bb65502e017 100644 --- a/extensions/signal/src/channel.ts +++ b/extensions/signal/src/channel.ts @@ -1,10 +1,10 @@ -import { buildAgentSessionKey, type RoutePeer } from "openclaw/plugin-sdk"; import { buildAccountScopedAllowlistConfigEditor, buildAccountScopedDmSecurityPolicy, createScopedAccountConfigAccessors, collectAllowlistProviderRestrictSendersWarnings, } from "openclaw/plugin-sdk/compat"; +import { buildAgentSessionKey, type RoutePeer } from "openclaw/plugin-sdk/core"; import { buildBaseAccountStatusSnapshot, buildBaseChannelStatusSummary, diff --git a/extensions/slack/src/channel.ts b/extensions/slack/src/channel.ts index 32d362be5e6..3b0e347ba24 100644 --- a/extensions/slack/src/channel.ts +++ b/extensions/slack/src/channel.ts @@ -1,8 +1,3 @@ -import { - buildAgentSessionKey, - resolveThreadSessionKeys, - type RoutePeer, -} from "openclaw/plugin-sdk"; import { createScopedChannelConfigBase } from "openclaw/plugin-sdk/compat"; import { buildAccountScopedAllowlistConfigEditor, @@ -12,6 +7,11 @@ import { createScopedAccountConfigAccessors, formatAllowFromLowercase, } from "openclaw/plugin-sdk/compat"; +import { + buildAgentSessionKey, + resolveThreadSessionKeys, + type RoutePeer, +} from "openclaw/plugin-sdk/core"; import { buildComputedAccountStatusSnapshot, buildChannelConfigSchema, diff --git a/extensions/telegram/src/channel.ts b/extensions/telegram/src/channel.ts index 1b30d43a7e0..37915fa07df 100644 --- a/extensions/telegram/src/channel.ts +++ b/extensions/telegram/src/channel.ts @@ -1,8 +1,3 @@ -import { - buildAgentSessionKey, - resolveThreadSessionKeys, - type RoutePeer, -} from "openclaw/plugin-sdk"; import { createScopedChannelConfigBase } from "openclaw/plugin-sdk/compat"; import { buildAccountScopedAllowlistConfigEditor, @@ -12,6 +7,11 @@ import { createScopedDmSecurityResolver, formatAllowFromLowercase, } from "openclaw/plugin-sdk/compat"; +import { + buildAgentSessionKey, + resolveThreadSessionKeys, + type RoutePeer, +} from "openclaw/plugin-sdk/core"; import { buildChannelConfigSchema, buildTokenChannelStatusSummary, diff --git a/src/plugin-sdk/core.ts b/src/plugin-sdk/core.ts index 1dd8ada1f6e..458a4ecfce7 100644 --- a/src/plugin-sdk/core.ts +++ b/src/plugin-sdk/core.ts @@ -138,3 +138,9 @@ export type { TailscaleStatusCommandResult, TailscaleStatusCommandRunner, } from "../shared/tailscale-status.js"; +export { + buildAgentSessionKey, + type RoutePeer, + type RoutePeerKind, +} from "../routing/resolve-route.js"; +export { resolveThreadSessionKeys } from "../routing/session-key.js"; diff --git a/src/plugin-sdk/subpaths.test.ts b/src/plugin-sdk/subpaths.test.ts index 8a57148f430..be9e2680ec5 100644 --- a/src/plugin-sdk/subpaths.test.ts +++ b/src/plugin-sdk/subpaths.test.ts @@ -1,5 +1,6 @@ import * as extensionApi from "openclaw/extension-api"; import * as compatSdk from "openclaw/plugin-sdk/compat"; +import * as coreSdk from "openclaw/plugin-sdk/core"; import * as discordSdk from "openclaw/plugin-sdk/discord"; import * as imessageSdk from "openclaw/plugin-sdk/imessage"; import * as lineSdk from "openclaw/plugin-sdk/line"; @@ -25,6 +26,11 @@ describe("plugin-sdk subpath exports", () => { expect(typeof compatSdk.resolveControlCommandGate).toBe("function"); }); + it("exports core routing helpers", () => { + expect(typeof coreSdk.buildAgentSessionKey).toBe("function"); + expect(typeof coreSdk.resolveThreadSessionKeys).toBe("function"); + }); + it("exports Discord helpers", () => { expect(typeof discordSdk.resolveDiscordAccount).toBe("function"); expect(typeof discordSdk.inspectDiscordAccount).toBe("function");