refactor(plugin-sdk): use scoped core imports for bundled channels

This commit is contained in:
Peter Steinberger
2026-03-16 00:19:21 -07:00
parent 3c62ab5c89
commit 99c501a9a7
7 changed files with 29 additions and 17 deletions

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,

View File

@@ -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";

View File

@@ -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");