Skip to content

Commit 4eea0d3

Browse files
authored
refactor(channels): remove redundant private runtime facades (#130186)
* refactor(channels): remove private runtime facades * test(channels): refresh retired facade contract guards
1 parent 4cfadd6 commit 4eea0d3

84 files changed

Lines changed: 295 additions & 648 deletions

File tree

Some content is hidden

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

‎extensions/feishu/src/agent-config.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Feishu helper module supports agent config behavior.
22
import { resolveAgentConfig } from "openclaw/plugin-sdk/agent-scope-runtime";
3-
import type { ClawdbotConfig } from "./bot-runtime-api.js";
3+
import type { ClawdbotConfig } from "../runtime-api.js";
44

55
type ReasoningDefault = "on" | "stream" | "off";
66

‎extensions/feishu/src/bot-broadcast.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { ChannelReplayClaimHandle } from "openclaw/plugin-sdk/persistent-dedupe";
2-
import type { ClawdbotConfig } from "./bot-runtime-api.js";
2+
import type { ClawdbotConfig } from "../runtime-api.js";
33
import type { FeishuIngressLifecycle } from "./feishu-ingress.js";
44

55
export function createFeishuBroadcastIngressSettlement(params: {

‎extensions/feishu/src/bot-runtime-api.ts‎

Lines changed: 0 additions & 8 deletions
This file was deleted.

‎extensions/feishu/src/bot.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ import { resolvePinnedMainDmOwnerFromAllowlist } from "openclaw/plugin-sdk/secur
3131
import { resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
3232
import { normalizeOptionalString, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
3333
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
34+
import {
35+
evaluateSupplementalContextVisibility,
36+
normalizeAgentId,
37+
resolveChannelContextVisibilityMode,
38+
} from "../runtime-api.js";
39+
import type { ClawdbotConfig, RuntimeEnv } from "../runtime-api.js";
3440
import { resolveFeishuRuntimeAccount } from "./accounts.js";
3541
import { buildFeishuAgentBody } from "./bot-agent-body.js";
3642
import {
@@ -49,12 +55,6 @@ import {
4955
} from "./bot-content.js";
5056
import { resolveGroupName } from "./bot-group-name.js";
5157
import { resolveFeishuBotName } from "./bot-name.js";
52-
import {
53-
evaluateSupplementalContextVisibility,
54-
normalizeAgentId,
55-
resolveChannelContextVisibilityMode,
56-
} from "./bot-runtime-api.js";
57-
import type { ClawdbotConfig, RuntimeEnv } from "./bot-runtime-api.js";
5858
import { resolveFeishuSenderName, type FeishuPermissionError } from "./bot-sender-name.js";
5959
import { createFeishuClient } from "./client.js";
6060
import { resolveConfiguredFeishuGroupSessionScope } from "./conversation-id.js";

‎extensions/feishu/src/channel-runtime-api.ts‎

Lines changed: 0 additions & 15 deletions
This file was deleted.

‎extensions/feishu/src/channel.ts‎

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
// Feishu plugin module implements channel behavior.
22
import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
3+
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-resolution";
34
import { resolveAgentConfig } from "openclaw/plugin-sdk/agent-scope-runtime";
45
import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
5-
import { ToolAuthorizationError } from "openclaw/plugin-sdk/channel-actions";
6+
import { createActionGate, ToolAuthorizationError } from "openclaw/plugin-sdk/channel-actions";
67
import {
78
adaptScopedAccountAccessor,
89
createHybridChannelConfigAdapter,
@@ -25,6 +26,7 @@ import {
2526
createAllowlistProviderGroupPolicyWarningCollector,
2627
createConditionalWarningCollector,
2728
} from "openclaw/plugin-sdk/channel-policy";
29+
import { PAIRING_APPROVED_MESSAGE } from "openclaw/plugin-sdk/channel-status";
2830
import { getSessionBindingService } from "openclaw/plugin-sdk/conversation-runtime";
2931
import {
3032
createChannelDirectoryAdapter,
@@ -34,14 +36,24 @@ import { PlatformMessageNotDispatchedError } from "openclaw/plugin-sdk/error-run
3436
import { resolveLegacyInteractiveTextFallback } from "openclaw/plugin-sdk/interactive-runtime";
3537
import { createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
3638
import { parseStrictPositiveInteger } from "openclaw/plugin-sdk/number-runtime";
37-
import { createComputedAccountStatusAdapter } from "openclaw/plugin-sdk/status-helpers";
39+
import {
40+
buildProbeChannelStatusSummary,
41+
createComputedAccountStatusAdapter,
42+
createDefaultChannelRuntimeState,
43+
} from "openclaw/plugin-sdk/status-helpers";
3844
import {
3945
isRecord,
4046
normalizeLowercaseStringOrEmpty,
4147
normalizeOptionalString,
4248
} from "openclaw/plugin-sdk/string-coerce-runtime";
4349
import { sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-chunking";
44-
import type { PluginRuntime } from "../runtime-api.js";
50+
import type {
51+
ChannelMessageActionName,
52+
ChannelMeta,
53+
ChannelPlugin,
54+
ClawdbotConfig,
55+
PluginRuntime,
56+
} from "../runtime-api.js";
4557
import {
4658
inspectFeishuCredentials,
4759
listEnabledFeishuAccounts,
@@ -52,19 +64,6 @@ import {
5264
} from "./accounts.js";
5365
import { feishuApprovalAuth } from "./approval-auth.js";
5466
import { FEISHU_CARD_INTERACTION_VERSION } from "./card-interaction.js";
55-
import type {
56-
ChannelMessageActionName,
57-
ChannelMeta,
58-
ChannelPlugin,
59-
ClawdbotConfig,
60-
} from "./channel-runtime-api.js";
61-
import {
62-
buildProbeChannelStatusSummary,
63-
createActionGate,
64-
createDefaultChannelRuntimeState,
65-
DEFAULT_ACCOUNT_ID,
66-
PAIRING_APPROVED_MESSAGE,
67-
} from "./channel-runtime-api.js";
6867
import { normalizeFeishuChatType, resolveFeishuChatType } from "./chat-type.js";
6968
import { FeishuChannelConfigSchema } from "./config-schema.js";
7069
import {

‎extensions/feishu/src/comment-dispatcher-runtime-api.ts‎

Lines changed: 0 additions & 7 deletions
This file was deleted.

‎extensions/feishu/src/comment-dispatcher.test.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ vi.mock("./client.js", () => ({
2929
createFeishuClient: createFeishuClientMock,
3030
}));
3131

32-
vi.mock("./comment-dispatcher-runtime-api.js", () => ({
32+
vi.mock("openclaw/plugin-sdk/channel-outbound", async (importOriginal) => ({
33+
...(await importOriginal<typeof import("openclaw/plugin-sdk/channel-outbound")>()),
3334
createReplyPrefixContext: createReplyPrefixContextMock,
3435
}));
3536

@@ -59,7 +60,7 @@ describe("createFeishuCommentReplyDispatcher", () => {
5960
afterAll(() => {
6061
vi.doUnmock("./accounts.js");
6162
vi.doUnmock("./client.js");
62-
vi.doUnmock("./comment-dispatcher-runtime-api.js");
63+
vi.doUnmock("openclaw/plugin-sdk/channel-outbound");
6364
vi.doUnmock("./comment-reaction.js");
6465
vi.doUnmock("./drive.js");
6566
vi.doUnmock("./runtime.js");

‎extensions/feishu/src/comment-dispatcher.ts‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
// Feishu plugin module implements comment dispatcher behavior.
22
import { resolveHumanDelayConfig } from "openclaw/plugin-sdk/agent-runtime";
33
import type { ChannelInboundTurnPlan } from "openclaw/plugin-sdk/channel-inbound";
4+
import { createReplyPrefixContext } from "openclaw/plugin-sdk/channel-outbound";
45
import { resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
6+
import type { ClawdbotConfig, ReplyPayload, RuntimeEnv } from "../runtime-api.js";
57
import { resolveFeishuRuntimeAccount } from "./accounts.js";
68
import { createFeishuClient } from "./client.js";
7-
import {
8-
createReplyPrefixContext,
9-
type ClawdbotConfig,
10-
type ReplyPayload,
11-
type RuntimeEnv,
12-
} from "./comment-dispatcher-runtime-api.js";
139
import { createCommentTypingReactionLifecycle } from "./comment-reaction.js";
1410
import type { CommentFileType } from "./comment-target.js";
1511
import { deliverCommentThreadText } from "./drive.js";

‎extensions/feishu/src/comment-handler-runtime-api.ts‎

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)