mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-04 18:00:22 +00:00
refactor: enforce plugin boundary seams
This commit is contained in:
@@ -6,8 +6,8 @@ import {
|
||||
readNumberParam,
|
||||
readStringArrayParam,
|
||||
readStringParam,
|
||||
} from "../../../../src/agents/tools/common.js";
|
||||
import type { DiscordActionConfig } from "../../../../src/config/types.discord.js";
|
||||
type DiscordActionConfig,
|
||||
} from "openclaw/plugin-sdk/discord-core";
|
||||
import { getPresence } from "../monitor/presence-cache.js";
|
||||
import {
|
||||
addRoleDiscord,
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import type { AgentToolResult } from "@mariozechner/pi-agent-core";
|
||||
import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";
|
||||
import { withNormalizedTimestamp } from "../../../../src/agents/date-time.js";
|
||||
import { assertMediaNotDataUrl } from "../../../../src/agents/sandbox-paths.js";
|
||||
import {
|
||||
type ActionGate,
|
||||
assertMediaNotDataUrl,
|
||||
jsonResult,
|
||||
readNumberParam,
|
||||
readReactionParams,
|
||||
readStringArrayParam,
|
||||
readStringParam,
|
||||
} from "../../../../src/agents/tools/common.js";
|
||||
import type { OpenClawConfig } from "../../../../src/config/config.js";
|
||||
import type { DiscordActionConfig } from "../../../../src/config/types.discord.js";
|
||||
import { resolvePollMaxSelections } from "../../../../src/polls.js";
|
||||
resolvePollMaxSelections,
|
||||
type DiscordActionConfig,
|
||||
type OpenClawConfig,
|
||||
withNormalizedTimestamp,
|
||||
} from "openclaw/plugin-sdk/discord-core";
|
||||
import { readDiscordComponentSpec } from "../components.js";
|
||||
import {
|
||||
createThreadDiscord,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { PermissionFlagsBits } from "discord-api-types/v10";
|
||||
import { readNumberParam, readStringParam } from "../../../../src/agents/tools/common.js";
|
||||
import { readNumberParam, readStringParam } from "openclaw/plugin-sdk/discord-core";
|
||||
|
||||
export type DiscordModerationAction = "timeout" | "kick" | "ban";
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ import {
|
||||
type ActionGate,
|
||||
jsonResult,
|
||||
readStringParam,
|
||||
} from "../../../../src/agents/tools/common.js";
|
||||
import type { DiscordActionConfig } from "../../../../src/config/types.discord.js";
|
||||
type DiscordActionConfig,
|
||||
} from "openclaw/plugin-sdk/discord-core";
|
||||
import {
|
||||
banMemberDiscord,
|
||||
hasAnyGuildPermissionDiscord,
|
||||
|
||||
@@ -4,8 +4,8 @@ import {
|
||||
type ActionGate,
|
||||
jsonResult,
|
||||
readStringParam,
|
||||
} from "../../../../src/agents/tools/common.js";
|
||||
import type { DiscordActionConfig } from "../../../../src/config/types.discord.js";
|
||||
type DiscordActionConfig,
|
||||
} from "openclaw/plugin-sdk/discord-core";
|
||||
import { getGateway } from "../monitor/gateway-registry.js";
|
||||
|
||||
const ACTIVITY_TYPE_MAP: Record<string, number> = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { readStringParam } from "../../../../src/agents/tools/common.js";
|
||||
import { readStringParam } from "openclaw/plugin-sdk/discord-core";
|
||||
|
||||
export function readDiscordParentIdParam(
|
||||
params: Record<string, unknown>,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type { AgentToolResult } from "@mariozechner/pi-agent-core";
|
||||
import { readStringParam } from "../../../../src/agents/tools/common.js";
|
||||
import type { OpenClawConfig } from "../../../../src/config/config.js";
|
||||
import { readStringParam, type OpenClawConfig } from "openclaw/plugin-sdk/discord-core";
|
||||
import { createDiscordActionGate } from "../accounts.js";
|
||||
import { handleDiscordGuildAction } from "./runtime.guild.js";
|
||||
import { handleDiscordMessagingAction } from "./runtime.messaging.js";
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
export * from "openclaw/plugin-sdk/line";
|
||||
export * from "./src/setup-core.js";
|
||||
export * from "./src/setup-surface.js";
|
||||
export * from "./setup-api.js";
|
||||
|
||||
2
extensions/line/setup-api.ts
Normal file
2
extensions/line/setup-api.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export { lineSetupAdapter } from "./src/setup-core.js";
|
||||
export { lineSetupWizard } from "./src/setup-surface.js";
|
||||
@@ -1,7 +1,11 @@
|
||||
import type { ChannelSetupAdapter, OpenClawConfig } from "openclaw/plugin-sdk/setup";
|
||||
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/setup";
|
||||
import { normalizeAccountId, resolveLineAccount } from "../../../src/line/accounts.js";
|
||||
import type { LineConfig } from "../../../src/line/types.js";
|
||||
import {
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
normalizeAccountId,
|
||||
resolveLineAccount,
|
||||
type ChannelSetupAdapter,
|
||||
type LineConfig,
|
||||
type OpenClawConfig,
|
||||
} from "openclaw/plugin-sdk/line-core";
|
||||
|
||||
const channel = "line" as const;
|
||||
|
||||
@@ -154,4 +158,4 @@ export const lineSetupAdapter: ChannelSetupAdapter = {
|
||||
},
|
||||
};
|
||||
|
||||
export { listLineAccountIds } from "../../../src/line/accounts.js";
|
||||
export { listLineAccountIds } from "openclaw/plugin-sdk/line-core";
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import {
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
formatDocsLink,
|
||||
resolveLineAccount,
|
||||
setSetupChannelEnabled,
|
||||
setTopLevelChannelDmPolicyWithAllowFrom,
|
||||
splitSetupEntries,
|
||||
type ChannelSetupDmPolicy,
|
||||
type ChannelSetupWizard,
|
||||
} from "openclaw/plugin-sdk/setup";
|
||||
import { resolveLineAccount } from "../../../src/line/accounts.js";
|
||||
} from "openclaw/plugin-sdk/line-core";
|
||||
import {
|
||||
isLineConfigured,
|
||||
listLineAccountIds,
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
export * from "openclaw/plugin-sdk/nostr";
|
||||
export * from "./src/setup-surface.js";
|
||||
export * from "./setup-api.js";
|
||||
|
||||
1
extensions/nostr/setup-api.ts
Normal file
1
extensions/nostr/setup-api.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { nostrSetupAdapter, nostrSetupWizard } from "./src/setup-surface.js";
|
||||
@@ -1,5 +1,4 @@
|
||||
import type { AgentToolResult } from "@mariozechner/pi-agent-core";
|
||||
import { withNormalizedTimestamp } from "../../../src/agents/date-time.js";
|
||||
import {
|
||||
createActionGate,
|
||||
imageResultFromFile,
|
||||
@@ -7,8 +6,9 @@ import {
|
||||
readNumberParam,
|
||||
readReactionParams,
|
||||
readStringParam,
|
||||
} from "../../../src/agents/tools/common.js";
|
||||
import type { OpenClawConfig } from "../../../src/config/config.js";
|
||||
type OpenClawConfig,
|
||||
withNormalizedTimestamp,
|
||||
} from "openclaw/plugin-sdk/slack-core";
|
||||
import { resolveSlackAccount } from "./accounts.js";
|
||||
import {
|
||||
deleteSlackMessage,
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
export * from "openclaw/plugin-sdk/synology-chat";
|
||||
export * from "./src/setup-surface.js";
|
||||
export * from "./setup-api.js";
|
||||
|
||||
1
extensions/synology-chat/setup-api.ts
Normal file
1
extensions/synology-chat/setup-api.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { synologyChatSetupAdapter, synologyChatSetupWizard } from "./src/setup-surface.js";
|
||||
@@ -7,10 +7,10 @@ import {
|
||||
readStringArrayParam,
|
||||
readStringOrNumberParam,
|
||||
readStringParam,
|
||||
} from "../../../src/agents/tools/common.js";
|
||||
import type { OpenClawConfig } from "../../../src/config/config.js";
|
||||
import type { TelegramActionConfig } from "../../../src/config/types.telegram.js";
|
||||
import { resolvePollMaxSelections } from "../../../src/polls.js";
|
||||
resolvePollMaxSelections,
|
||||
type OpenClawConfig,
|
||||
type TelegramActionConfig,
|
||||
} from "openclaw/plugin-sdk/telegram-core";
|
||||
import { createTelegramActionGate, resolveTelegramPollActionGateState } from "./accounts.js";
|
||||
import type { TelegramButtonStyle, TelegramInlineButtons } from "./button-types.js";
|
||||
import {
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
export * from "openclaw/plugin-sdk/tlon";
|
||||
export * from "./src/setup-core.js";
|
||||
export * from "./src/setup-surface.js";
|
||||
export * from "./setup-api.js";
|
||||
|
||||
2
extensions/tlon/setup-api.ts
Normal file
2
extensions/tlon/setup-api.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export { tlonSetupAdapter } from "./src/setup-core.js";
|
||||
export { tlonSetupWizard } from "./src/setup-surface.js";
|
||||
@@ -1,6 +1,8 @@
|
||||
import { ToolAuthorizationError } from "../../../src/agents/tools/common.js";
|
||||
import type { OpenClawConfig } from "../../../src/config/config.js";
|
||||
import { resolveWhatsAppOutboundTarget } from "../../../src/whatsapp/resolve-outbound-target.js";
|
||||
import {
|
||||
ToolAuthorizationError,
|
||||
resolveWhatsAppOutboundTarget,
|
||||
type OpenClawConfig,
|
||||
} from "openclaw/plugin-sdk/whatsapp-core";
|
||||
import { resolveWhatsAppAccount } from "./accounts.js";
|
||||
|
||||
export function resolveAuthorizedWhatsAppOutboundTarget(params: {
|
||||
|
||||
@@ -4,8 +4,8 @@ import {
|
||||
jsonResult,
|
||||
readReactionParams,
|
||||
readStringParam,
|
||||
} from "../../../src/agents/tools/common.js";
|
||||
import type { OpenClawConfig } from "../../../src/config/config.js";
|
||||
type OpenClawConfig,
|
||||
} from "openclaw/plugin-sdk/whatsapp-core";
|
||||
import { resolveAuthorizedWhatsAppOutboundTarget } from "./action-runtime-target-auth.js";
|
||||
import { sendReactionWhatsApp } from "./send.js";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user