Skip to content

Commit 7713364

Browse files
authored
refactor(channels): remove redundant private forwarding modules (#130348)
* refactor(channels): remove private forwarding modules * refactor(discord): consolidate config type imports
1 parent 5acfc2d commit 7713364

59 files changed

Lines changed: 153 additions & 340 deletions

Some content is hidden

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

‎extensions/discord/src/account-inspect.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Discord plugin module implements account inspect behavior.
22
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
3+
import type { DiscordAccountConfig, OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
34
import { normalizeSecretInputString } from "openclaw/plugin-sdk/secret-input";
45
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
56
import { inspectDiscordAccountTokenState } from "./account-token-inspect.js";
@@ -8,7 +9,6 @@ import {
89
resolveDefaultDiscordAccountId,
910
resolveDiscordAccountConfig,
1011
} from "./accounts.js";
11-
import type { DiscordAccountConfig, OpenClawConfig } from "./runtime-api.js";
1212
import type { DiscordCredentialStatus } from "./token.js";
1313

1414
export type InspectedDiscordAccount = {

‎extensions/discord/src/accounts.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ import {
99
normalizeChannelDmPolicy,
1010
type ChannelDmPolicy,
1111
} from "openclaw/plugin-sdk/channel-config-helpers";
12+
import { resolveConfiguredFromCredentialStatuses } from "openclaw/plugin-sdk/channel-status";
13+
import type {
14+
DiscordAccountConfig,
15+
DiscordActionConfig,
16+
OpenClawConfig,
17+
} from "openclaw/plugin-sdk/config-contracts";
1218
import { resolveAccountEntry } from "openclaw/plugin-sdk/routing";
1319
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
14-
import {
15-
resolveConfiguredFromCredentialStatuses,
16-
type DiscordAccountConfig,
17-
type DiscordActionConfig,
18-
type OpenClawConfig,
19-
} from "./runtime-api.js";
2020
import { selectDiscordRuntimeConfig } from "./runtime-config.js";
2121
import { resolveDiscordToken, type DiscordCredentialStatus } from "./token.js";
2222

‎extensions/discord/src/actions/runtime.guild.ts‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
// Discord plugin module implements runtime.guild behavior.
22
import { PermissionFlagsBits } from "discord-api-types/v10";
33
import type { AgentToolResult } from "openclaw/plugin-sdk/agent-core";
4-
import { resolveDefaultDiscordAccountId } from "../accounts.js";
5-
import { isDiscordThreadChannelType } from "../channel-type.js";
6-
import { getGateway } from "../monitor/gateway-registry.js";
7-
import { getPresence } from "../monitor/presence-cache.js";
4+
import type { ActionGate } from "openclaw/plugin-sdk/channel-actions";
85
import {
9-
type ActionGate,
106
jsonResult,
117
readNonNegativeIntegerParam,
128
readPositiveIntegerParam,
139
readStringArrayParam,
1410
readStringParam,
15-
type DiscordActionConfig,
16-
type OpenClawConfig,
17-
} from "../runtime-api.js";
11+
} from "openclaw/plugin-sdk/channel-actions";
12+
import type { DiscordActionConfig, OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
13+
import { resolveDefaultDiscordAccountId } from "../accounts.js";
14+
import { isDiscordThreadChannelType } from "../channel-type.js";
15+
import { getGateway } from "../monitor/gateway-registry.js";
16+
import { getPresence } from "../monitor/presence-cache.js";
1817
import { discordGuildActionRuntime } from "./runtime-deps.js";
1918
import {
2019
createDiscordMessagingActionContext,

‎extensions/discord/src/actions/runtime.messaging.messages.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
21
// Discord plugin module implements runtime.messaging.messages behavior.
32
import {
43
jsonResult,
54
readPositiveIntegerParam,
65
readStringArrayParam,
76
readStringParam,
8-
} from "../runtime-api.js";
7+
} from "openclaw/plugin-sdk/channel-actions";
8+
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
99
import { discordMessagingActionRuntime } from "./runtime.messaging.runtime.js";
1010
import type { DiscordMessagingActionContext } from "./runtime.messaging.shared.js";
1111

‎extensions/discord/src/actions/runtime.messaging.reactions.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
readPositiveIntegerParam,
55
readReactionParams,
66
readStringParam,
7-
} from "../runtime-api.js";
7+
} from "openclaw/plugin-sdk/channel-actions";
88
import { discordMessagingActionRuntime } from "./runtime.messaging.runtime.js";
99
import type { DiscordMessagingActionContext } from "./runtime.messaging.shared.js";
1010

‎extensions/discord/src/actions/runtime.messaging.runtime.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
12
// Discord plugin module implements runtime.messaging behavior.
23
import { readDiscordComponentSpec } from "../components.js";
3-
import type { OpenClawConfig } from "../runtime-api.js";
44
import { sendDiscordComponentMessage } from "../send.components.js";
55
import {
66
createThreadDiscord,

‎extensions/discord/src/actions/runtime.messaging.send.ts‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1+
import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";
2+
import {
3+
assertMediaNotDataUrl,
4+
jsonResult,
5+
readPositiveIntegerParam,
6+
readStringArrayParam,
7+
readStringParam,
8+
} from "openclaw/plugin-sdk/channel-actions";
19
// Discord plugin module implements runtime.messaging.send behavior.
210
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
311
import { isDiscordThreadChannelType } from "../channel-type.js";
412
import {
513
createReusableDiscordReplyReference,
614
resolveDiscordReplyReference,
715
} from "../reply-reference.js";
8-
import {
9-
assertMediaNotDataUrl,
10-
jsonResult,
11-
readBooleanParam,
12-
readPositiveIntegerParam,
13-
readStringArrayParam,
14-
readStringParam,
15-
} from "../runtime-api.js";
1616
import { DiscordThreadInitialMessageError } from "../send.js";
1717
import type { DiscordSendComponents, DiscordSendEmbeds } from "../send.shared.js";
1818
import { discordMessagingActionRuntime } from "./runtime.messaging.runtime.js";

‎extensions/discord/src/actions/runtime.messaging.shared.ts‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { ChannelType } from "discord-api-types/v10";
22
import { normalizeAccountId } from "openclaw/plugin-sdk/account-resolution";
3+
import type { ActionGate } from "openclaw/plugin-sdk/channel-actions";
4+
import { readStringParam, withNormalizedTimestamp } from "openclaw/plugin-sdk/channel-actions";
35
import type { ChannelMessageActionContext } from "openclaw/plugin-sdk/channel-contract";
6+
import type { DiscordActionConfig, OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
47
// Discord plugin module implements runtime.messaging.shared behavior.
58
import { resolveOpenProviderRuntimeGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
69
import { mergeDiscordAccountConfig, resolveDefaultDiscordAccountId } from "../accounts.js";
@@ -13,13 +16,6 @@ import {
1316
resolveDiscordChannelConfigWithFallback,
1417
type DiscordGuildEntryResolved,
1518
} from "../monitor/allow-list.js";
16-
import {
17-
type ActionGate,
18-
readStringParam,
19-
type DiscordActionConfig,
20-
type OpenClawConfig,
21-
withNormalizedTimestamp,
22-
} from "../runtime-api.js";
2319
import type { DiscordReactOpts } from "../send.types.js";
2420
import { discordMessagingActionRuntime } from "./runtime.messaging.runtime.js";
2521
import { createDiscordActionOptions } from "./runtime.shared.js";

‎extensions/discord/src/actions/runtime.messaging.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Discord plugin module implements runtime.messaging behavior.
22
import type { AgentToolResult } from "openclaw/plugin-sdk/agent-core";
3-
import type { ActionGate, DiscordActionConfig, OpenClawConfig } from "../runtime-api.js";
3+
import type { ActionGate } from "openclaw/plugin-sdk/channel-actions";
4+
import type { DiscordActionConfig, OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
45
import { handleDiscordMessageManagementAction } from "./runtime.messaging.messages.js";
56
import { handleDiscordReactionMessagingAction } from "./runtime.messaging.reactions.js";
67
import { handleDiscordMessageSendAction } from "./runtime.messaging.send.js";

‎extensions/discord/src/actions/runtime.moderation-shared.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Discord plugin module implements runtime.moderation shared behavior.
22
import { PermissionFlagsBits } from "discord-api-types/v10";
3-
import { readNonNegativeIntegerParam, readStringParam } from "../runtime-api.js";
3+
import { readNonNegativeIntegerParam, readStringParam } from "openclaw/plugin-sdk/channel-actions";
44

55
export type DiscordModerationAction = "timeout" | "kick" | "ban";
66

0 commit comments

Comments
 (0)