mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-18 05:20:48 +00:00
refactor: finalize plugin sdk legacy boundary cleanup
This commit is contained in:
@@ -920,8 +920,16 @@ Notes:
|
||||
Use SDK subpaths instead of the monolithic `openclaw/plugin-sdk` import when
|
||||
authoring plugins:
|
||||
|
||||
- `openclaw/plugin-sdk/core` for generic plugin APIs, provider auth types, and shared helpers such as routing/session utilities and logger-backed runtimes.
|
||||
- `openclaw/plugin-sdk/compat` for bundled/internal plugin code that needs broader shared runtime helpers than `core`.
|
||||
- `openclaw/plugin-sdk/core` for the smallest generic plugin-facing contract.
|
||||
- Domain subpaths such as `openclaw/plugin-sdk/channel-config-helpers`,
|
||||
`openclaw/plugin-sdk/channel-config-schema`,
|
||||
`openclaw/plugin-sdk/channel-policy`,
|
||||
`openclaw/plugin-sdk/reply-history`,
|
||||
`openclaw/plugin-sdk/routing`,
|
||||
`openclaw/plugin-sdk/runtime-store`, and
|
||||
`openclaw/plugin-sdk/directory-runtime` for shared runtime/config helpers.
|
||||
- `openclaw/plugin-sdk/compat` remains as a legacy migration surface for older
|
||||
external plugins. Bundled plugins should not use it.
|
||||
- `openclaw/plugin-sdk/telegram` for Telegram channel plugin types and shared channel-facing helpers. Built-in Telegram implementation internals stay private to the bundled extension.
|
||||
- `openclaw/plugin-sdk/discord` for Discord channel plugin types and shared channel-facing helpers. Built-in Discord implementation internals stay private to the bundled extension.
|
||||
- `openclaw/plugin-sdk/slack` for Slack channel plugin types and shared channel-facing helpers. Built-in Slack implementation internals stay private to the bundled extension.
|
||||
@@ -982,8 +990,8 @@ Compatibility note:
|
||||
|
||||
- `openclaw/plugin-sdk` remains supported for existing external plugins.
|
||||
- New and migrated bundled plugins should use channel or extension-specific
|
||||
subpaths; use `core` for generic surfaces and `compat` only when broader
|
||||
shared helpers are required.
|
||||
subpaths; use `core` plus explicit domain subpaths for generic surfaces, and
|
||||
treat `compat` as migration-only.
|
||||
|
||||
## Read-only channel inspection
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { formatNormalizedAllowFromEntries } from "openclaw/plugin-sdk/allow-from";
|
||||
import type { ChannelAccountSnapshot, ChannelPlugin } from "openclaw/plugin-sdk/bluebubbles";
|
||||
import {
|
||||
buildChannelConfigSchema,
|
||||
@@ -11,13 +12,12 @@ import {
|
||||
resolveBlueBubblesGroupToolPolicy,
|
||||
setAccountEnabledInConfigSection,
|
||||
} from "openclaw/plugin-sdk/bluebubbles";
|
||||
import { mapAllowFromEntries } from "openclaw/plugin-sdk/channel-config-helpers";
|
||||
import { createAccountStatusSink } from "openclaw/plugin-sdk/channel-lifecycle";
|
||||
import {
|
||||
buildAccountScopedDmSecurityPolicy,
|
||||
collectOpenGroupPolicyRestrictSendersWarnings,
|
||||
createAccountStatusSink,
|
||||
formatNormalizedAllowFromEntries,
|
||||
mapAllowFromEntries,
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
} from "openclaw/plugin-sdk/channel-policy";
|
||||
import {
|
||||
listBlueBubblesAccountIds,
|
||||
type ResolvedBlueBubblesAccount,
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
buildCatchallMultiAccountChannelSchema,
|
||||
DmPolicySchema,
|
||||
GroupPolicySchema,
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
} from "openclaw/plugin-sdk/channel-config-schema";
|
||||
import { z } from "zod";
|
||||
import { buildSecretInputSchema, hasConfiguredSecretInput } from "./secret-input.js";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { PluginRuntime } from "openclaw/plugin-sdk/bluebubbles";
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/compat";
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
||||
|
||||
const runtimeStore = createPluginRuntimeStore<PluginRuntime>("BlueBubbles runtime not initialized");
|
||||
type LegacyRuntimeLogShape = { log?: (message: string) => void };
|
||||
|
||||
@@ -10,11 +10,6 @@ import {
|
||||
} from "openclaw/plugin-sdk/channel-config-helpers";
|
||||
import { resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-runtime";
|
||||
import { normalizeMessageChannel } from "openclaw/plugin-sdk/channel-runtime";
|
||||
import {
|
||||
buildAgentSessionKey,
|
||||
resolveThreadSessionKeys,
|
||||
type RoutePeer,
|
||||
} from "openclaw/plugin-sdk/core";
|
||||
import {
|
||||
buildComputedAccountStatusSnapshot,
|
||||
buildChannelConfigSchema,
|
||||
@@ -33,6 +28,11 @@ import {
|
||||
type ChannelPlugin,
|
||||
type OpenClawConfig,
|
||||
} from "openclaw/plugin-sdk/discord";
|
||||
import {
|
||||
buildAgentSessionKey,
|
||||
resolveThreadSessionKeys,
|
||||
type RoutePeer,
|
||||
} from "openclaw/plugin-sdk/routing";
|
||||
import {
|
||||
listDiscordAccountIds,
|
||||
resolveDiscordAccount,
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export { transcribeFirstAudio } from "openclaw/plugin-sdk/media-runtime";
|
||||
@@ -50,7 +50,7 @@ export async function resolveDiscordPreflightAudioMentionContext(params: {
|
||||
};
|
||||
}
|
||||
try {
|
||||
const { transcribeFirstAudio } = await import("openclaw/plugin-sdk/media-runtime");
|
||||
const { transcribeFirstAudio } = await import("./preflight-audio.runtime.js");
|
||||
if (params.abortSignal?.aborted) {
|
||||
return {
|
||||
hasAudioAttachment,
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import { createScopedChannelConfigBase } from "openclaw/plugin-sdk/compat";
|
||||
import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
|
||||
import {
|
||||
createScopedAccountConfigAccessors,
|
||||
formatAllowFromLowercase,
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
import { buildChannelConfigSchema } from "../../../src/channels/plugins/config-schema.js";
|
||||
import type { ChannelPlugin } from "../../../src/channels/plugins/types.plugin.js";
|
||||
import { getChatChannelMeta } from "../../../src/channels/registry.js";
|
||||
import { DiscordConfigSchema } from "../../../src/config/zod-schema.providers-core.js";
|
||||
createScopedChannelConfigBase,
|
||||
} from "openclaw/plugin-sdk/channel-config-helpers";
|
||||
import {
|
||||
buildChannelConfigSchema,
|
||||
DiscordConfigSchema,
|
||||
getChatChannelMeta,
|
||||
type ChannelPlugin,
|
||||
} from "openclaw/plugin-sdk/discord";
|
||||
import { inspectDiscordAccount } from "./account-inspect.js";
|
||||
import {
|
||||
listDiscordAccountIds,
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import {
|
||||
collectAllowlistProviderRestrictSendersWarnings,
|
||||
formatAllowFromLowercase,
|
||||
mapAllowFromEntries,
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
|
||||
import { mapAllowFromEntries } from "openclaw/plugin-sdk/channel-config-helpers";
|
||||
import { collectAllowlistProviderRestrictSendersWarnings } from "openclaw/plugin-sdk/channel-policy";
|
||||
import type { ChannelMeta, ChannelPlugin, ClawdbotConfig } from "openclaw/plugin-sdk/feishu";
|
||||
import {
|
||||
buildChannelConfigSchema,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {
|
||||
listDirectoryGroupEntriesFromMapKeysAndAllowFrom,
|
||||
listDirectoryUserEntriesFromAllowFromAndMapKeys,
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
} from "openclaw/plugin-sdk/directory-runtime";
|
||||
import type { ClawdbotConfig } from "openclaw/plugin-sdk/feishu";
|
||||
import { resolveFeishuAccount } from "./accounts.js";
|
||||
import { normalizeFeishuTarget } from "./targets.js";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/compat";
|
||||
import type { PluginRuntime } from "openclaw/plugin-sdk/feishu";
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
||||
|
||||
const { setRuntime: setFeishuRuntime, getRuntime: getFeishuRuntime } =
|
||||
createPluginRuntimeStore<PluginRuntime>("Feishu runtime not initialized");
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { buildOauthProviderAuthResult } from "openclaw/plugin-sdk/core";
|
||||
import type {
|
||||
OpenClawPluginApi,
|
||||
ProviderAuthContext,
|
||||
ProviderFetchUsageSnapshotContext,
|
||||
} from "openclaw/plugin-sdk/core";
|
||||
import { buildOauthProviderAuthResult } from "openclaw/plugin-sdk/provider-auth";
|
||||
import { fetchGeminiUsage } from "openclaw/plugin-sdk/provider-usage";
|
||||
import { loginGeminiCliOAuth } from "./oauth.js";
|
||||
import { isModernGoogleModel, resolveGoogle31ForwardCompatModel } from "./provider-models.js";
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import { createScopedChannelConfigBase } from "openclaw/plugin-sdk/compat";
|
||||
import { formatNormalizedAllowFromEntries } from "openclaw/plugin-sdk/allow-from";
|
||||
import {
|
||||
createScopedAccountConfigAccessors,
|
||||
createScopedChannelConfigBase,
|
||||
createScopedDmSecurityResolver,
|
||||
} from "openclaw/plugin-sdk/channel-config-helpers";
|
||||
import {
|
||||
buildOpenGroupPolicyConfigureRouteAllowlistWarning,
|
||||
collectAllowlistProviderGroupPolicyWarnings,
|
||||
createScopedAccountConfigAccessors,
|
||||
createScopedDmSecurityResolver,
|
||||
formatNormalizedAllowFromEntries,
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
} from "openclaw/plugin-sdk/channel-policy";
|
||||
import {
|
||||
buildComputedAccountStatusSnapshot,
|
||||
buildChannelConfigSchema,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/compat";
|
||||
import type { PluginRuntime } from "openclaw/plugin-sdk/googlechat";
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
||||
|
||||
const { setRuntime: setGoogleChatRuntime, getRuntime: getGoogleChatRuntime } =
|
||||
createPluginRuntimeStore<PluginRuntime>("Google Chat runtime not initialized");
|
||||
|
||||
@@ -3,7 +3,8 @@ import {
|
||||
buildAccountScopedDmSecurityPolicy,
|
||||
collectAllowlistProviderRestrictSendersWarnings,
|
||||
} from "openclaw/plugin-sdk/channel-config-helpers";
|
||||
import { buildAgentSessionKey, type RoutePeer } from "openclaw/plugin-sdk/core";
|
||||
import { resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-runtime";
|
||||
import { resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-runtime";
|
||||
import {
|
||||
collectStatusIssuesFromLastError,
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
@@ -14,6 +15,7 @@ import {
|
||||
resolveIMessageGroupToolPolicy,
|
||||
type ChannelPlugin,
|
||||
} from "openclaw/plugin-sdk/imessage";
|
||||
import { buildAgentSessionKey, type RoutePeer } from "openclaw/plugin-sdk/routing";
|
||||
import { buildPassiveProbedChannelStatusSummary } from "../../shared/channel-status-summary.js";
|
||||
import { resolveIMessageAccount, type ResolvedIMessageAccount } from "./accounts.js";
|
||||
import { getIMessageRuntime } from "./runtime.js";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {
|
||||
buildAccountScopedDmSecurityPolicy,
|
||||
collectAllowlistProviderRestrictSendersWarnings,
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
} from "openclaw/plugin-sdk/channel-policy";
|
||||
import {
|
||||
deleteAccountFromConfigSection,
|
||||
setAccountEnabledInConfigSection,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
||||
import { tryReadSecretFileSync } from "openclaw/plugin-sdk/core";
|
||||
import { tryReadSecretFileSync } from "openclaw/plugin-sdk/infra-runtime";
|
||||
import {
|
||||
createAccountListHelpers,
|
||||
normalizeResolvedSecretInputString,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { formatNormalizedAllowFromEntries } from "openclaw/plugin-sdk/allow-from";
|
||||
import { createScopedAccountConfigAccessors } from "openclaw/plugin-sdk/channel-config-helpers";
|
||||
import {
|
||||
buildAccountScopedDmSecurityPolicy,
|
||||
buildOpenGroupPolicyWarning,
|
||||
collectAllowlistProviderGroupPolicyWarnings,
|
||||
createScopedAccountConfigAccessors,
|
||||
formatNormalizedAllowFromEntries,
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
} from "openclaw/plugin-sdk/channel-policy";
|
||||
import {
|
||||
buildBaseAccountStatusSnapshot,
|
||||
buildBaseChannelStatusSummary,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/compat";
|
||||
import type { PluginRuntime } from "openclaw/plugin-sdk/irc";
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
||||
|
||||
const { setRuntime: setIrcRuntime, getRuntime: getIrcRuntime } =
|
||||
createPluginRuntimeStore<PluginRuntime>("IRC runtime not initialized");
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import {
|
||||
collectAllowlistProviderRestrictSendersWarnings,
|
||||
createScopedAccountConfigAccessors,
|
||||
createScopedChannelConfigBase,
|
||||
createScopedDmSecurityResolver,
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
} from "openclaw/plugin-sdk/channel-config-helpers";
|
||||
import { collectAllowlistProviderRestrictSendersWarnings } from "openclaw/plugin-sdk/channel-policy";
|
||||
import {
|
||||
buildChannelConfigSchema,
|
||||
buildComputedAccountStatusSnapshot,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/compat";
|
||||
import type { PluginRuntime } from "openclaw/plugin-sdk/line";
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
||||
|
||||
const { setRuntime: setLineRuntime, getRuntime: getLineRuntime } =
|
||||
createPluginRuntimeStore<PluginRuntime>("LINE runtime not initialized - plugin not registered");
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import {
|
||||
buildOpenGroupPolicyWarning,
|
||||
collectAllowlistProviderGroupPolicyWarnings,
|
||||
createScopedAccountConfigAccessors,
|
||||
createScopedChannelConfigBase,
|
||||
createScopedDmSecurityResolver,
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
} from "openclaw/plugin-sdk/channel-config-helpers";
|
||||
import {
|
||||
buildOpenGroupPolicyWarning,
|
||||
collectAllowlistProviderGroupPolicyWarnings,
|
||||
} from "openclaw/plugin-sdk/channel-policy";
|
||||
import {
|
||||
buildChannelConfigSchema,
|
||||
buildProbeChannelStatusSummary,
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
buildNestedDmConfigSchema,
|
||||
DmPolicySchema,
|
||||
GroupPolicySchema,
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
} from "openclaw/plugin-sdk/channel-config-schema";
|
||||
import { MarkdownConfigSchema, ToolPolicySchema } from "openclaw/plugin-sdk/matrix";
|
||||
import { z } from "zod";
|
||||
import { buildSecretInputSchema } from "./secret-input.js";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { mapAllowlistResolutionInputs } from "openclaw/plugin-sdk/compat";
|
||||
import { mapAllowlistResolutionInputs } from "openclaw/plugin-sdk/allowlist-resolution";
|
||||
import type {
|
||||
ChannelDirectoryEntry,
|
||||
ChannelResolveKind,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/compat";
|
||||
import type { PluginRuntime } from "openclaw/plugin-sdk/matrix";
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
||||
|
||||
const { setRuntime: setMatrixRuntime, getRuntime: getMatrixRuntime } =
|
||||
createPluginRuntimeStore<PluginRuntime>("Matrix runtime not initialized");
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { formatNormalizedAllowFromEntries } from "openclaw/plugin-sdk/allow-from";
|
||||
import { createScopedAccountConfigAccessors } from "openclaw/plugin-sdk/channel-config-helpers";
|
||||
import {
|
||||
buildAccountScopedDmSecurityPolicy,
|
||||
collectAllowlistProviderRestrictSendersWarnings,
|
||||
createScopedAccountConfigAccessors,
|
||||
formatNormalizedAllowFromEntries,
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
} from "openclaw/plugin-sdk/channel-policy";
|
||||
import {
|
||||
buildComputedAccountStatusSnapshot,
|
||||
buildChannelConfigSchema,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { resolveChannelGroupRequireMention } from "openclaw/plugin-sdk/compat";
|
||||
import { resolveChannelGroupRequireMention } from "openclaw/plugin-sdk/channel-policy";
|
||||
import type { ChannelGroupContext } from "openclaw/plugin-sdk/mattermost";
|
||||
import { resolveMattermostAccount } from "./mattermost/accounts.js";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/compat";
|
||||
import type { PluginRuntime } from "openclaw/plugin-sdk/mattermost";
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
||||
|
||||
const { setRuntime: setMattermostRuntime, getRuntime: getMattermostRuntime } =
|
||||
createPluginRuntimeStore<PluginRuntime>("Mattermost runtime not initialized");
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import {
|
||||
collectAllowlistProviderRestrictSendersWarnings,
|
||||
formatAllowFromLowercase,
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
|
||||
import { collectAllowlistProviderRestrictSendersWarnings } from "openclaw/plugin-sdk/channel-policy";
|
||||
import type {
|
||||
ChannelMessageActionName,
|
||||
ChannelPlugin,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { mapAllowlistResolutionInputs } from "openclaw/plugin-sdk/compat";
|
||||
import { mapAllowlistResolutionInputs } from "openclaw/plugin-sdk/allowlist-resolution";
|
||||
import { searchGraphUsers } from "./graph-users.js";
|
||||
import {
|
||||
listChannelsForTeam,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/compat";
|
||||
import type { PluginRuntime } from "openclaw/plugin-sdk/msteams";
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
||||
|
||||
const { setRuntime: setMSTeamsRuntime, getRuntime: getMSTeamsRuntime } =
|
||||
createPluginRuntimeStore<PluginRuntime>("MSTeams runtime not initialized");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { tryReadSecretFileSync } from "openclaw/plugin-sdk/core";
|
||||
import { tryReadSecretFileSync } from "openclaw/plugin-sdk/infra-runtime";
|
||||
import {
|
||||
createAccountListHelpers,
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
|
||||
import { mapAllowFromEntries } from "openclaw/plugin-sdk/channel-config-helpers";
|
||||
import { createAccountStatusSink } from "openclaw/plugin-sdk/channel-lifecycle";
|
||||
import {
|
||||
buildAccountScopedDmSecurityPolicy,
|
||||
collectAllowlistProviderGroupPolicyWarnings,
|
||||
collectOpenGroupPolicyRouteAllowlistWarnings,
|
||||
createAccountStatusSink,
|
||||
formatAllowFromLowercase,
|
||||
mapAllowFromEntries,
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
} from "openclaw/plugin-sdk/channel-policy";
|
||||
import {
|
||||
buildBaseChannelStatusSummary,
|
||||
buildChannelConfigSchema,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/compat";
|
||||
import type { PluginRuntime } from "openclaw/plugin-sdk/nextcloud-talk";
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
||||
|
||||
const { setRuntime: setNextcloudTalkRuntime, getRuntime: getNextcloudTalkRuntime } =
|
||||
createPluginRuntimeStore<PluginRuntime>("Nextcloud Talk runtime not initialized");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { AllowFromListSchema, DmPolicySchema } from "openclaw/plugin-sdk/compat";
|
||||
import { AllowFromListSchema, DmPolicySchema } from "openclaw/plugin-sdk/channel-config-schema";
|
||||
import { MarkdownConfigSchema, buildChannelConfigSchema } from "openclaw/plugin-sdk/nostr";
|
||||
import { z } from "zod";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/compat";
|
||||
import type { PluginRuntime } from "openclaw/plugin-sdk/nostr";
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
||||
|
||||
const { setRuntime: setNostrRuntime, getRuntime: getNostrRuntime } =
|
||||
createPluginRuntimeStore<PluginRuntime>("Nostr runtime not initialized");
|
||||
|
||||
@@ -4,7 +4,7 @@ import type {
|
||||
ProviderResolveDynamicModelContext,
|
||||
ProviderRuntimeModel,
|
||||
} from "openclaw/plugin-sdk/core";
|
||||
import { buildOauthProviderAuthResult } from "openclaw/plugin-sdk/core";
|
||||
import { buildOauthProviderAuthResult } from "openclaw/plugin-sdk/provider-auth";
|
||||
import {
|
||||
CODEX_CLI_PROFILE_ID,
|
||||
ensureAuthProfileStore,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { runPassiveAccountLifecycle } from "openclaw/plugin-sdk/core";
|
||||
import { runPassiveAccountLifecycle } from "openclaw/plugin-sdk/channel-runtime";
|
||||
|
||||
type StoppableMonitor = {
|
||||
stop: () => void;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createLoggerBackedRuntime } from "openclaw/plugin-sdk/core";
|
||||
import { createLoggerBackedRuntime } from "openclaw/plugin-sdk/runtime";
|
||||
|
||||
export function resolveLoggerBackedRuntime<TRuntime>(
|
||||
runtime: TRuntime | undefined,
|
||||
|
||||
@@ -5,8 +5,8 @@ import {
|
||||
} from "openclaw/plugin-sdk/channel-config-helpers";
|
||||
import { resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-runtime";
|
||||
import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/config-runtime";
|
||||
import { buildAgentSessionKey, type RoutePeer } from "openclaw/plugin-sdk/core";
|
||||
import { resolveTextChunkLimit } from "openclaw/plugin-sdk/reply-runtime";
|
||||
import { buildAgentSessionKey, type RoutePeer } from "openclaw/plugin-sdk/routing";
|
||||
import {
|
||||
buildBaseAccountStatusSnapshot,
|
||||
buildBaseChannelStatusSummary,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { createScopedAccountConfigAccessors } from "openclaw/plugin-sdk/channel-config-helpers";
|
||||
import {
|
||||
buildAccountScopedDmSecurityPolicy,
|
||||
collectAllowlistProviderRestrictSendersWarnings,
|
||||
createScopedAccountConfigAccessors,
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
} from "openclaw/plugin-sdk/channel-policy";
|
||||
import {
|
||||
deleteAccountFromConfigSection,
|
||||
setAccountEnabledInConfigSection,
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
buildAgentSessionKey,
|
||||
resolveThreadSessionKeys,
|
||||
type RoutePeer,
|
||||
} from "openclaw/plugin-sdk/core";
|
||||
} from "openclaw/plugin-sdk/routing";
|
||||
import {
|
||||
buildComputedAccountStatusSnapshot,
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/compat";
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
||||
import type { PluginRuntime } from "openclaw/plugin-sdk/synology-chat";
|
||||
|
||||
const { setRuntime: setSynologyRuntime, getRuntime: getSynologyRuntime } =
|
||||
|
||||
@@ -179,7 +179,7 @@ export async function resolveTelegramInboundBody(params: {
|
||||
|
||||
if (needsPreflightTranscription) {
|
||||
try {
|
||||
const { transcribeFirstAudio } = await import("openclaw/plugin-sdk/media-runtime");
|
||||
const { transcribeFirstAudio } = await import("./media-understanding.runtime.js");
|
||||
const tempCtx: MsgContext = {
|
||||
MediaPaths: allMedia.length > 0 ? allMedia.map((m) => m.path) : undefined,
|
||||
MediaTypes:
|
||||
|
||||
@@ -6,13 +6,13 @@ import {
|
||||
} from "openclaw/plugin-sdk/channel-config-helpers";
|
||||
import { type OutboundSendDeps, resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-runtime";
|
||||
import { normalizeMessageChannel } from "openclaw/plugin-sdk/channel-runtime";
|
||||
import { resolveExecApprovalCommandDisplay } from "openclaw/plugin-sdk/infra-runtime";
|
||||
import { buildExecApprovalPendingReplyPayload } from "openclaw/plugin-sdk/infra-runtime";
|
||||
import {
|
||||
buildAgentSessionKey,
|
||||
resolveThreadSessionKeys,
|
||||
type RoutePeer,
|
||||
} from "openclaw/plugin-sdk/core";
|
||||
import { resolveExecApprovalCommandDisplay } from "openclaw/plugin-sdk/infra-runtime";
|
||||
import { buildExecApprovalPendingReplyPayload } from "openclaw/plugin-sdk/infra-runtime";
|
||||
} from "openclaw/plugin-sdk/routing";
|
||||
import { parseTelegramTopicConversation } from "openclaw/plugin-sdk/telegram";
|
||||
import {
|
||||
buildTokenChannelStatusSummary,
|
||||
|
||||
1
extensions/telegram/src/media-understanding.runtime.ts
Normal file
1
extensions/telegram/src/media-understanding.runtime.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { describeImageWithModel, transcribeFirstAudio } from "openclaw/plugin-sdk/media-runtime";
|
||||
@@ -1,14 +1,16 @@
|
||||
import { createScopedChannelConfigBase } from "openclaw/plugin-sdk/compat";
|
||||
import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
|
||||
import {
|
||||
createScopedAccountConfigAccessors,
|
||||
formatAllowFromLowercase,
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
import { buildChannelConfigSchema } from "../../../src/channels/plugins/config-schema.js";
|
||||
import type { ChannelPlugin } from "../../../src/channels/plugins/types.plugin.js";
|
||||
import { getChatChannelMeta } from "../../../src/channels/registry.js";
|
||||
import type { OpenClawConfig } from "../../../src/config/config.js";
|
||||
import { TelegramConfigSchema } from "../../../src/config/zod-schema.providers-core.js";
|
||||
import { normalizeAccountId } from "../../../src/routing/session-key.js";
|
||||
createScopedChannelConfigBase,
|
||||
} from "openclaw/plugin-sdk/channel-config-helpers";
|
||||
import {
|
||||
buildChannelConfigSchema,
|
||||
getChatChannelMeta,
|
||||
normalizeAccountId,
|
||||
TelegramConfigSchema,
|
||||
type ChannelPlugin,
|
||||
type OpenClawConfig,
|
||||
} from "openclaw/plugin-sdk/telegram";
|
||||
import { inspectTelegramAccount } from "./account-inspect.js";
|
||||
import {
|
||||
listTelegramAccountIds,
|
||||
|
||||
@@ -143,10 +143,10 @@ export function getCacheStats(): { count: number; oldestAt?: string; newestAt?:
|
||||
|
||||
const STICKER_DESCRIPTION_PROMPT =
|
||||
"Describe this sticker image in 1-2 sentences. Focus on what the sticker depicts (character, object, action, emotion). Be concise and objective.";
|
||||
let imageRuntimePromise: Promise<typeof import("openclaw/plugin-sdk/media-runtime")> | null = null;
|
||||
let imageRuntimePromise: Promise<typeof import("./media-understanding.runtime.js")> | null = null;
|
||||
|
||||
function loadImageRuntime() {
|
||||
imageRuntimePromise ??= import("openclaw/plugin-sdk/media-runtime");
|
||||
imageRuntimePromise ??= import("./media-understanding.runtime.js");
|
||||
return imageRuntimePromise;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/compat";
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
||||
import type { PluginRuntime } from "openclaw/plugin-sdk/tlon";
|
||||
|
||||
const { setRuntime: setTlonRuntime, getRuntime: getTlonRuntime } =
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/compat";
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
||||
import type { PluginRuntime } from "openclaw/plugin-sdk/twitch";
|
||||
|
||||
const { setRuntime: setTwitchRuntime, getRuntime: getTwitchRuntime } =
|
||||
|
||||
@@ -3,6 +3,7 @@ import {
|
||||
createActionGate,
|
||||
createWhatsAppOutboundBase,
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
formatWhatsAppConfigAllowFromEntries,
|
||||
listWhatsAppDirectoryGroupsFromConfig,
|
||||
listWhatsAppDirectoryPeersFromConfig,
|
||||
readStringParam,
|
||||
@@ -25,6 +26,7 @@ import {
|
||||
WHATSAPP_CHANNEL,
|
||||
} from "./shared.js";
|
||||
import { collectWhatsAppStatusIssues } from "./status-issues.js";
|
||||
|
||||
function normalizeWhatsAppPayloadText(text: string | undefined): string {
|
||||
return (text ?? "").replace(/^(?:[ \t]*\r?\n)+/, "");
|
||||
}
|
||||
@@ -165,9 +167,12 @@ export const whatsappPlugin: ChannelPlugin<ResolvedWhatsAppAccount> = {
|
||||
auth: {
|
||||
login: async ({ cfg, accountId, runtime, verbose }) => {
|
||||
const resolvedAccountId = accountId?.trim() || whatsappPlugin.config.defaultAccountId(cfg);
|
||||
await (
|
||||
await loadWhatsAppChannelRuntime()
|
||||
).loginWeb(Boolean(verbose), undefined, runtime, resolvedAccountId);
|
||||
await (await loadWhatsAppChannelRuntime()).loginWeb(
|
||||
Boolean(verbose),
|
||||
undefined,
|
||||
runtime,
|
||||
resolvedAccountId,
|
||||
);
|
||||
},
|
||||
},
|
||||
heartbeat: {
|
||||
@@ -176,9 +181,9 @@ export const whatsappPlugin: ChannelPlugin<ResolvedWhatsAppAccount> = {
|
||||
return { ok: false, reason: "whatsapp-disabled" };
|
||||
}
|
||||
const account = resolveWhatsAppAccount({ cfg, accountId });
|
||||
const authExists = await (
|
||||
deps?.webAuthExists ?? (await loadWhatsAppChannelRuntime()).webAuthExists
|
||||
)(account.authDir);
|
||||
const authExists = await (deps?.webAuthExists ?? (await loadWhatsAppChannelRuntime()).webAuthExists)(
|
||||
account.authDir,
|
||||
);
|
||||
if (!authExists) {
|
||||
return { ok: false, reason: "whatsapp-not-linked" };
|
||||
}
|
||||
@@ -214,7 +219,9 @@ export const whatsappPlugin: ChannelPlugin<ResolvedWhatsAppAccount> = {
|
||||
? await (await loadWhatsAppChannelRuntime()).webAuthExists(authDir)
|
||||
: false;
|
||||
const authAgeMs =
|
||||
linked && authDir ? (await loadWhatsAppChannelRuntime()).getWebAuthAgeMs(authDir) : null;
|
||||
linked && authDir
|
||||
? (await loadWhatsAppChannelRuntime()).getWebAuthAgeMs(authDir)
|
||||
: null;
|
||||
const self =
|
||||
linked && authDir
|
||||
? (await loadWhatsAppChannelRuntime()).readWebSelfId(authDir)
|
||||
@@ -281,9 +288,7 @@ export const whatsappPlugin: ChannelPlugin<ResolvedWhatsAppAccount> = {
|
||||
);
|
||||
},
|
||||
loginWithQrStart: async ({ accountId, force, timeoutMs, verbose }) =>
|
||||
await (
|
||||
await loadWhatsAppChannelRuntime()
|
||||
).startWebLoginWithQr({
|
||||
await (await loadWhatsAppChannelRuntime()).startWebLoginWithQr({
|
||||
accountId,
|
||||
force,
|
||||
timeoutMs,
|
||||
@@ -292,9 +297,7 @@ export const whatsappPlugin: ChannelPlugin<ResolvedWhatsAppAccount> = {
|
||||
loginWithQrWait: async ({ accountId, timeoutMs }) =>
|
||||
await (await loadWhatsAppChannelRuntime()).waitForWebLogin({ accountId, timeoutMs }),
|
||||
logoutAccount: async ({ account, runtime }) => {
|
||||
const cleared = await (
|
||||
await loadWhatsAppChannelRuntime()
|
||||
).logoutWeb({
|
||||
const cleared = await (await loadWhatsAppChannelRuntime()).logoutWeb({
|
||||
authDir: account.authDir,
|
||||
isLegacyAuthDir: account.isLegacyAuthDir,
|
||||
runtime,
|
||||
|
||||
@@ -1,24 +1,20 @@
|
||||
import {
|
||||
buildAccountScopedDmSecurityPolicy,
|
||||
buildChannelConfigSchema,
|
||||
collectAllowlistProviderGroupPolicyWarnings,
|
||||
collectOpenGroupPolicyRouteAllowlistWarnings,
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
import { buildChannelConfigSchema } from "../../../src/channels/plugins/config-schema.js";
|
||||
import {
|
||||
resolveWhatsAppGroupRequireMention,
|
||||
resolveWhatsAppGroupToolPolicy,
|
||||
} from "../../../src/channels/plugins/group-mentions.js";
|
||||
import type { ChannelPlugin } from "../../../src/channels/plugins/types.plugin.js";
|
||||
import { resolveWhatsAppGroupIntroHint } from "../../../src/channels/plugins/whatsapp-shared.js";
|
||||
import { getChatChannelMeta } from "../../../src/channels/registry.js";
|
||||
import { WhatsAppConfigSchema } from "../../../src/config/zod-schema.providers-whatsapp.js";
|
||||
import {
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
formatWhatsAppConfigAllowFromEntries,
|
||||
getChatChannelMeta,
|
||||
normalizeE164,
|
||||
resolveWhatsAppConfigAllowFrom,
|
||||
resolveWhatsAppConfigDefaultTo,
|
||||
} from "../../../src/plugin-sdk/channel-config-helpers.js";
|
||||
import { DEFAULT_ACCOUNT_ID } from "../../../src/routing/session-key.js";
|
||||
import { normalizeE164 } from "../../../src/utils.js";
|
||||
resolveWhatsAppGroupIntroHint,
|
||||
resolveWhatsAppGroupRequireMention,
|
||||
resolveWhatsAppGroupToolPolicy,
|
||||
WhatsAppConfigSchema,
|
||||
type ChannelPlugin,
|
||||
} from "openclaw/plugin-sdk/whatsapp";
|
||||
import {
|
||||
listWhatsAppAccountIds,
|
||||
resolveDefaultWhatsAppAccountId,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createAccountStatusSink } from "openclaw/plugin-sdk/compat";
|
||||
import { createAccountStatusSink } from "openclaw/plugin-sdk/channel-lifecycle";
|
||||
import { PAIRING_APPROVED_MESSAGE } from "openclaw/plugin-sdk/zalo";
|
||||
import { probeZalo } from "./probe.js";
|
||||
import { resolveZaloProxyFetch } from "./proxy.js";
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { mapAllowFromEntries } from "openclaw/plugin-sdk/channel-config-helpers";
|
||||
import {
|
||||
buildAccountScopedDmSecurityPolicy,
|
||||
buildOpenGroupPolicyRestrictSendersWarning,
|
||||
buildOpenGroupPolicyWarning,
|
||||
collectOpenProviderGroupPolicyWarnings,
|
||||
mapAllowFromEntries,
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
} from "openclaw/plugin-sdk/channel-policy";
|
||||
import type {
|
||||
ChannelAccountSnapshot,
|
||||
ChannelPlugin,
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
buildCatchallMultiAccountChannelSchema,
|
||||
DmPolicySchema,
|
||||
GroupPolicySchema,
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
} from "openclaw/plugin-sdk/channel-config-schema";
|
||||
import { MarkdownConfigSchema } from "openclaw/plugin-sdk/zalo";
|
||||
import { z } from "zod";
|
||||
import { buildSecretInputSchema } from "./secret-input.js";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/compat";
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
||||
import type { PluginRuntime } from "openclaw/plugin-sdk/zalo";
|
||||
|
||||
const { setRuntime: setZaloRuntime, getRuntime: getZaloRuntime } =
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
||||
import { tryReadSecretFileSync } from "openclaw/plugin-sdk/core";
|
||||
import { tryReadSecretFileSync } from "openclaw/plugin-sdk/infra-runtime";
|
||||
import type { BaseTokenResolution } from "openclaw/plugin-sdk/zalo";
|
||||
import { normalizeResolvedSecretInputString, normalizeSecretInputString } from "./secret-input.js";
|
||||
import type { ZaloConfig } from "./types.js";
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import {
|
||||
buildAccountScopedDmSecurityPolicy,
|
||||
createAccountStatusSink,
|
||||
mapAllowFromEntries,
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
import { mapAllowFromEntries } from "openclaw/plugin-sdk/channel-config-helpers";
|
||||
import { createAccountStatusSink } from "openclaw/plugin-sdk/channel-lifecycle";
|
||||
import { buildAccountScopedDmSecurityPolicy } from "openclaw/plugin-sdk/channel-policy";
|
||||
import type {
|
||||
ChannelAccountSnapshot,
|
||||
ChannelDirectoryEntry,
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
buildCatchallMultiAccountChannelSchema,
|
||||
DmPolicySchema,
|
||||
GroupPolicySchema,
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
} from "openclaw/plugin-sdk/channel-config-schema";
|
||||
import { MarkdownConfigSchema, ToolPolicySchema } from "openclaw/plugin-sdk/zalouser";
|
||||
import { z } from "zod";
|
||||
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
import {
|
||||
DM_GROUP_ACCESS_REASON,
|
||||
resolveDmGroupAccessWithLists,
|
||||
} from "openclaw/plugin-sdk/channel-policy";
|
||||
import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue";
|
||||
import {
|
||||
DEFAULT_GROUP_HISTORY_LIMIT,
|
||||
type HistoryEntry,
|
||||
KeyedAsyncQueue,
|
||||
buildPendingHistoryContextFromMap,
|
||||
clearHistoryEntriesIfEnabled,
|
||||
recordPendingHistoryEntryIfEnabled,
|
||||
resolveDmGroupAccessWithLists,
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
} from "openclaw/plugin-sdk/reply-history";
|
||||
import type {
|
||||
MarkdownTableMode,
|
||||
OpenClawConfig,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/compat";
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
||||
import type { PluginRuntime } from "openclaw/plugin-sdk/zalouser";
|
||||
|
||||
const { setRuntime: setZalouserRuntime, getRuntime: getZalouserRuntime } =
|
||||
|
||||
20
package.json
20
package.json
@@ -310,6 +310,10 @@
|
||||
"types": "./dist/plugin-sdk/allow-from.d.ts",
|
||||
"default": "./dist/plugin-sdk/allow-from.js"
|
||||
},
|
||||
"./plugin-sdk/allowlist-resolution": {
|
||||
"types": "./dist/plugin-sdk/allowlist-resolution.d.ts",
|
||||
"default": "./dist/plugin-sdk/allowlist-resolution.js"
|
||||
},
|
||||
"./plugin-sdk/allowlist-config-edit": {
|
||||
"types": "./dist/plugin-sdk/allowlist-config-edit.d.ts",
|
||||
"default": "./dist/plugin-sdk/allowlist-config-edit.js"
|
||||
@@ -322,10 +326,22 @@
|
||||
"types": "./dist/plugin-sdk/channel-config-helpers.d.ts",
|
||||
"default": "./dist/plugin-sdk/channel-config-helpers.js"
|
||||
},
|
||||
"./plugin-sdk/channel-config-schema": {
|
||||
"types": "./dist/plugin-sdk/channel-config-schema.d.ts",
|
||||
"default": "./dist/plugin-sdk/channel-config-schema.js"
|
||||
},
|
||||
"./plugin-sdk/channel-policy": {
|
||||
"types": "./dist/plugin-sdk/channel-policy.d.ts",
|
||||
"default": "./dist/plugin-sdk/channel-policy.js"
|
||||
},
|
||||
"./plugin-sdk/group-access": {
|
||||
"types": "./dist/plugin-sdk/group-access.d.ts",
|
||||
"default": "./dist/plugin-sdk/group-access.js"
|
||||
},
|
||||
"./plugin-sdk/directory-runtime": {
|
||||
"types": "./dist/plugin-sdk/directory-runtime.d.ts",
|
||||
"default": "./dist/plugin-sdk/directory-runtime.js"
|
||||
},
|
||||
"./plugin-sdk/json-store": {
|
||||
"types": "./dist/plugin-sdk/json-store.d.ts",
|
||||
"default": "./dist/plugin-sdk/json-store.js"
|
||||
@@ -362,6 +378,10 @@
|
||||
"types": "./dist/plugin-sdk/provider-web-search.d.ts",
|
||||
"default": "./dist/plugin-sdk/provider-web-search.js"
|
||||
},
|
||||
"./plugin-sdk/reply-history": {
|
||||
"types": "./dist/plugin-sdk/reply-history.d.ts",
|
||||
"default": "./dist/plugin-sdk/reply-history.js"
|
||||
},
|
||||
"./plugin-sdk/media-understanding": {
|
||||
"types": "./dist/plugin-sdk/media-understanding.d.ts",
|
||||
"default": "./dist/plugin-sdk/media-understanding.js"
|
||||
|
||||
@@ -5,14 +5,14 @@ import { discoverOpenClawPlugins } from "../src/plugins/discovery.js";
|
||||
// Match exact monolithic-root specifier in any code path:
|
||||
// imports/exports, require/dynamic import, and test mocks (vi.mock/jest.mock).
|
||||
const ROOT_IMPORT_PATTERN = /["']openclaw\/plugin-sdk["']/;
|
||||
const LEGACY_ROUTING_IMPORT_PATTERN = /["']openclaw\/plugin-sdk\/routing["']/;
|
||||
const LEGACY_COMPAT_IMPORT_PATTERN = /["']openclaw\/plugin-sdk\/compat["']/;
|
||||
|
||||
function hasMonolithicRootImport(content: string): boolean {
|
||||
return ROOT_IMPORT_PATTERN.test(content);
|
||||
}
|
||||
|
||||
function hasLegacyRoutingImport(content: string): boolean {
|
||||
return LEGACY_ROUTING_IMPORT_PATTERN.test(content);
|
||||
function hasLegacyCompatImport(content: string): boolean {
|
||||
return LEGACY_COMPAT_IMPORT_PATTERN.test(content);
|
||||
}
|
||||
|
||||
function isSourceFile(filePath: string): boolean {
|
||||
@@ -83,7 +83,7 @@ function main() {
|
||||
}
|
||||
|
||||
const monolithicOffenders: string[] = [];
|
||||
const legacyRoutingOffenders: string[] = [];
|
||||
const legacyCompatOffenders: string[] = [];
|
||||
for (const entryFile of filesToCheck) {
|
||||
let content = "";
|
||||
try {
|
||||
@@ -94,12 +94,12 @@ function main() {
|
||||
if (hasMonolithicRootImport(content)) {
|
||||
monolithicOffenders.push(entryFile);
|
||||
}
|
||||
if (hasLegacyRoutingImport(content)) {
|
||||
legacyRoutingOffenders.push(entryFile);
|
||||
if (hasLegacyCompatImport(content)) {
|
||||
legacyCompatOffenders.push(entryFile);
|
||||
}
|
||||
}
|
||||
|
||||
if (monolithicOffenders.length > 0 || legacyRoutingOffenders.length > 0) {
|
||||
if (monolithicOffenders.length > 0 || legacyCompatOffenders.length > 0) {
|
||||
if (monolithicOffenders.length > 0) {
|
||||
console.error("Bundled plugin source files must not import monolithic openclaw/plugin-sdk.");
|
||||
for (const file of monolithicOffenders.toSorted()) {
|
||||
@@ -107,18 +107,18 @@ function main() {
|
||||
console.error(`- ${relative}`);
|
||||
}
|
||||
}
|
||||
if (legacyRoutingOffenders.length > 0) {
|
||||
if (legacyCompatOffenders.length > 0) {
|
||||
console.error(
|
||||
"Bundled plugin source files must not import legacy openclaw/plugin-sdk/routing.",
|
||||
"Bundled plugin source files must not import legacy openclaw/plugin-sdk/compat.",
|
||||
);
|
||||
for (const file of legacyRoutingOffenders.toSorted()) {
|
||||
for (const file of legacyCompatOffenders.toSorted()) {
|
||||
const relative = path.relative(process.cwd(), file) || file;
|
||||
console.error(`- ${relative}`);
|
||||
}
|
||||
}
|
||||
if (monolithicOffenders.length > 0 || legacyRoutingOffenders.length > 0) {
|
||||
if (monolithicOffenders.length > 0 || legacyCompatOffenders.length > 0) {
|
||||
console.error(
|
||||
"Use openclaw/plugin-sdk/<channel> for channel plugins, /core for shared routing and startup surfaces, or /compat for broader internals.",
|
||||
"Use openclaw/plugin-sdk/<domain> or openclaw/plugin-sdk/<channel> subpaths for bundled plugins; root and compat are legacy surfaces only.",
|
||||
);
|
||||
}
|
||||
process.exit(1);
|
||||
|
||||
@@ -67,10 +67,14 @@
|
||||
"account-id",
|
||||
"account-resolution",
|
||||
"allow-from",
|
||||
"allowlist-resolution",
|
||||
"allowlist-config-edit",
|
||||
"boolean-param",
|
||||
"channel-config-helpers",
|
||||
"channel-config-schema",
|
||||
"channel-policy",
|
||||
"group-access",
|
||||
"directory-runtime",
|
||||
"json-store",
|
||||
"keyed-async-queue",
|
||||
"provider-auth",
|
||||
@@ -80,6 +84,7 @@
|
||||
"provider-stream",
|
||||
"provider-usage",
|
||||
"provider-web-search",
|
||||
"reply-history",
|
||||
"media-understanding",
|
||||
"google",
|
||||
"request-url",
|
||||
|
||||
@@ -5,7 +5,7 @@ import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
MOONSHOT_BASE_URL as MOONSHOT_AI_BASE_URL,
|
||||
MOONSHOT_CN_BASE_URL,
|
||||
} from "../plugins/provider-model-definitions.js";
|
||||
} from "../plugin-sdk/provider-models.js";
|
||||
import { captureEnv } from "../test-utils/env.js";
|
||||
import { resolveImplicitProvidersForTest } from "./models-config.e2e-harness.js";
|
||||
import { applyNativeStreamingUsageCompat } from "./models-config.providers.js";
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { CHAT_CHANNEL_ORDER } from "../../channels/registry.js";
|
||||
import { normalizeAtHashSlug } from "../../shared/string-normalization.js";
|
||||
import { INTERNAL_MESSAGE_CHANNEL } from "../../utils/message-channel.js";
|
||||
|
||||
export type ExplicitElevatedAllowField = "id" | "from" | "e164" | "name" | "username" | "tag";
|
||||
const INTERNAL_ALLOWLIST_CHANNEL = "webchat";
|
||||
|
||||
const EXPLICIT_ELEVATED_ALLOW_FIELDS = new Set<ExplicitElevatedAllowField>([
|
||||
"id",
|
||||
@@ -15,7 +15,7 @@ const EXPLICIT_ELEVATED_ALLOW_FIELDS = new Set<ExplicitElevatedAllowField>([
|
||||
|
||||
const SENDER_PREFIXES = [
|
||||
...CHAT_CHANNEL_ORDER,
|
||||
INTERNAL_MESSAGE_CHANNEL,
|
||||
INTERNAL_ALLOWLIST_CHANNEL,
|
||||
"user",
|
||||
"group",
|
||||
"channel",
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { requireActivePluginRegistry } from "../plugins/runtime.js";
|
||||
import { CHANNEL_IDS, CHAT_CHANNEL_ORDER, type ChatChannelId } from "./ids.js";
|
||||
import type { ChannelMeta } from "./plugins/types.js";
|
||||
import type { ChannelId } from "./plugins/types.js";
|
||||
@@ -8,6 +7,21 @@ export type { ChatChannelId } from "./ids.js";
|
||||
export type ChatChannelMeta = ChannelMeta;
|
||||
|
||||
const WEBSITE_URL = "https://openclaw.ai";
|
||||
const REGISTRY_STATE = Symbol.for("openclaw.pluginRegistryState");
|
||||
|
||||
type RegisteredChannelPluginEntry = {
|
||||
plugin: {
|
||||
id?: string | null;
|
||||
meta?: { aliases?: string[] | null } | null;
|
||||
};
|
||||
};
|
||||
|
||||
function listRegisteredChannelPluginEntries(): RegisteredChannelPluginEntry[] {
|
||||
const globalState = globalThis as typeof globalThis & {
|
||||
[REGISTRY_STATE]?: { registry?: { channels?: RegisteredChannelPluginEntry[] | null } | null };
|
||||
};
|
||||
return globalState[REGISTRY_STATE]?.registry?.channels ?? [];
|
||||
}
|
||||
|
||||
const CHAT_CHANNEL_META: Record<ChatChannelId, ChannelMeta> = {
|
||||
telegram: {
|
||||
@@ -154,15 +168,14 @@ export function normalizeAnyChannelId(raw?: string | null): ChannelId | null {
|
||||
return null;
|
||||
}
|
||||
|
||||
const registry = requireActivePluginRegistry();
|
||||
const hit = registry.channels.find((entry) => {
|
||||
const hit = listRegisteredChannelPluginEntries().find((entry) => {
|
||||
const id = String(entry.plugin.id ?? "")
|
||||
.trim()
|
||||
.toLowerCase();
|
||||
if (id && id === key) {
|
||||
return true;
|
||||
}
|
||||
return (entry.plugin.meta.aliases ?? []).some((alias) => alias.trim().toLowerCase() === key);
|
||||
return (entry.plugin.meta?.aliases ?? []).some((alias) => alias.trim().toLowerCase() === key);
|
||||
});
|
||||
return hit?.plugin.id ?? null;
|
||||
}
|
||||
|
||||
@@ -19,32 +19,32 @@ const sendFns = vi.hoisted(() => ({
|
||||
imessage: vi.fn(async () => ({ messageId: "i1", chatId: "imessage:1" })),
|
||||
}));
|
||||
|
||||
vi.mock("../plugin-sdk-internal/whatsapp.js", () => {
|
||||
vi.mock("./send-runtime/whatsapp.js", () => {
|
||||
moduleLoads.whatsapp();
|
||||
return { sendMessageWhatsApp: sendFns.whatsapp };
|
||||
});
|
||||
|
||||
vi.mock("../plugin-sdk-internal/telegram.js", () => {
|
||||
vi.mock("./send-runtime/telegram.js", () => {
|
||||
moduleLoads.telegram();
|
||||
return { sendMessageTelegram: sendFns.telegram };
|
||||
});
|
||||
|
||||
vi.mock("../plugin-sdk-internal/discord.js", () => {
|
||||
vi.mock("./send-runtime/discord.js", () => {
|
||||
moduleLoads.discord();
|
||||
return { sendMessageDiscord: sendFns.discord };
|
||||
});
|
||||
|
||||
vi.mock("../plugin-sdk-internal/slack.js", () => {
|
||||
vi.mock("./send-runtime/slack.js", () => {
|
||||
moduleLoads.slack();
|
||||
return { sendMessageSlack: sendFns.slack };
|
||||
});
|
||||
|
||||
vi.mock("../plugin-sdk-internal/signal.js", () => {
|
||||
vi.mock("./send-runtime/signal.js", () => {
|
||||
moduleLoads.signal();
|
||||
return { sendMessageSignal: sendFns.signal };
|
||||
});
|
||||
|
||||
vi.mock("../plugin-sdk-internal/imessage.js", () => {
|
||||
vi.mock("./send-runtime/imessage.js", () => {
|
||||
moduleLoads.imessage();
|
||||
return { sendMessageIMessage: sendFns.imessage };
|
||||
});
|
||||
|
||||
@@ -35,32 +35,32 @@ export function createDefaultDeps(): CliDeps {
|
||||
return {
|
||||
whatsapp: createLazySender(
|
||||
"whatsapp",
|
||||
() => import("../plugin-sdk/whatsapp.js") as Promise<Record<string, unknown>>,
|
||||
() => import("./send-runtime/whatsapp.js") as Promise<Record<string, unknown>>,
|
||||
"sendMessageWhatsApp",
|
||||
),
|
||||
telegram: createLazySender(
|
||||
"telegram",
|
||||
() => import("../plugin-sdk/telegram.js") as Promise<Record<string, unknown>>,
|
||||
() => import("./send-runtime/telegram.js") as Promise<Record<string, unknown>>,
|
||||
"sendMessageTelegram",
|
||||
),
|
||||
discord: createLazySender(
|
||||
"discord",
|
||||
() => import("../plugin-sdk/discord.js") as Promise<Record<string, unknown>>,
|
||||
() => import("./send-runtime/discord.js") as Promise<Record<string, unknown>>,
|
||||
"sendMessageDiscord",
|
||||
),
|
||||
slack: createLazySender(
|
||||
"slack",
|
||||
() => import("../plugin-sdk/slack.js") as Promise<Record<string, unknown>>,
|
||||
() => import("./send-runtime/slack.js") as Promise<Record<string, unknown>>,
|
||||
"sendMessageSlack",
|
||||
),
|
||||
signal: createLazySender(
|
||||
"signal",
|
||||
() => import("../plugin-sdk/signal.js") as Promise<Record<string, unknown>>,
|
||||
() => import("./send-runtime/signal.js") as Promise<Record<string, unknown>>,
|
||||
"sendMessageSignal",
|
||||
),
|
||||
imessage: createLazySender(
|
||||
"imessage",
|
||||
() => import("../plugin-sdk/imessage.js") as Promise<Record<string, unknown>>,
|
||||
() => import("./send-runtime/imessage.js") as Promise<Record<string, unknown>>,
|
||||
"sendMessageIMessage",
|
||||
),
|
||||
};
|
||||
|
||||
1
src/cli/send-runtime/discord.ts
Normal file
1
src/cli/send-runtime/discord.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { sendMessageDiscord } from "../../plugin-sdk/discord.js";
|
||||
1
src/cli/send-runtime/imessage.ts
Normal file
1
src/cli/send-runtime/imessage.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { sendMessageIMessage } from "../../plugin-sdk/imessage.js";
|
||||
1
src/cli/send-runtime/signal.ts
Normal file
1
src/cli/send-runtime/signal.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { sendMessageSignal } from "../../plugin-sdk/signal.js";
|
||||
1
src/cli/send-runtime/slack.ts
Normal file
1
src/cli/send-runtime/slack.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { sendMessageSlack } from "../../plugin-sdk/slack.js";
|
||||
1
src/cli/send-runtime/telegram.ts
Normal file
1
src/cli/send-runtime/telegram.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { sendMessageTelegram } from "../../plugin-sdk/telegram.js";
|
||||
1
src/cli/send-runtime/whatsapp.ts
Normal file
1
src/cli/send-runtime/whatsapp.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { sendMessageWhatsApp } from "../../plugin-sdk/whatsapp.js";
|
||||
@@ -30,7 +30,7 @@ import {
|
||||
MINIMAX_CN_API_BASE_URL,
|
||||
ZAI_CODING_CN_BASE_URL,
|
||||
ZAI_CODING_GLOBAL_BASE_URL,
|
||||
} from "../plugins/provider-model-definitions.js";
|
||||
} from "../plugin-sdk/provider-models.js";
|
||||
import type { ProviderPlugin } from "../plugins/types.js";
|
||||
import { registerProviderPlugins } from "../test-utils/plugin-registration.js";
|
||||
import type { WizardPrompter } from "../wizard/prompts.js";
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
KILOCODE_DEFAULT_CONTEXT_WINDOW,
|
||||
KILOCODE_DEFAULT_MAX_TOKENS,
|
||||
KILOCODE_DEFAULT_COST,
|
||||
} from "../plugins/provider-model-definitions.js";
|
||||
} from "../plugin-sdk/provider-models.js";
|
||||
import { captureEnv } from "../test-utils/env.js";
|
||||
|
||||
const emptyCfg: OpenClawConfig = {};
|
||||
|
||||
@@ -42,17 +42,17 @@ import {
|
||||
resolveAgentModelPrimaryValue,
|
||||
} from "../config/model-input.js";
|
||||
import type { ModelApi } from "../config/types.models.js";
|
||||
import {
|
||||
MISTRAL_DEFAULT_MODEL_REF,
|
||||
ZAI_CODING_CN_BASE_URL,
|
||||
ZAI_GLOBAL_BASE_URL,
|
||||
} from "../plugin-sdk/provider-models.js";
|
||||
import { applyAuthProfileConfig } from "../plugins/provider-auth-helpers.js";
|
||||
import {
|
||||
OPENROUTER_DEFAULT_MODEL_REF,
|
||||
setMinimaxApiKey,
|
||||
writeOAuthCredentials,
|
||||
} from "../plugins/provider-auth-storage.js";
|
||||
import {
|
||||
MISTRAL_DEFAULT_MODEL_REF,
|
||||
ZAI_CODING_CN_BASE_URL,
|
||||
ZAI_GLOBAL_BASE_URL,
|
||||
} from "../plugins/provider-model-definitions.js";
|
||||
import { applyLitellmProviderConfig } from "./onboard-auth.config-litellm.js";
|
||||
import {
|
||||
createAuthTestLifecycle,
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
ZAI_CODING_CN_BASE_URL,
|
||||
ZAI_CODING_GLOBAL_BASE_URL,
|
||||
ZAI_GLOBAL_BASE_URL,
|
||||
} from "../plugins/provider-model-definitions.js";
|
||||
} from "../plugin-sdk/provider-models.js";
|
||||
import { makeTempWorkspace } from "../test-helpers/workspace.js";
|
||||
import { withEnvAsync } from "../test-utils/env.js";
|
||||
import {
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
export type { OpenClawConfig } from "../config/config.js";
|
||||
|
||||
export { createAccountActionGate } from "../channels/plugins/account-action-gate.js";
|
||||
export { createAccountListHelpers } from "../channels/plugins/account-helpers.js";
|
||||
export { normalizeChatType } from "../channels/chat-type.js";
|
||||
export {
|
||||
listConfiguredAccountIds,
|
||||
resolveAccountWithDefaultFallback,
|
||||
} from "../plugin-sdk/account-resolution.js";
|
||||
export { resolveAccountEntry } from "../routing/account-lookup.js";
|
||||
export { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../routing/session-key.js";
|
||||
export { normalizeE164, pathExists, resolveUserPath } from "../utils.js";
|
||||
@@ -1,17 +0,0 @@
|
||||
// Private bridge for bundled channel plugins. These config helpers are shared
|
||||
// internally, but do not belong on the public compat surface.
|
||||
export { buildAccountScopedAllowlistConfigEditor } from "../plugin-sdk/allowlist-config-edit.js";
|
||||
export { formatAllowFromLowercase } from "../plugin-sdk/allow-from.js";
|
||||
export {
|
||||
createScopedAccountConfigAccessors,
|
||||
createScopedChannelConfigBase,
|
||||
createScopedDmSecurityResolver,
|
||||
} from "../plugin-sdk/channel-config-helpers.js";
|
||||
export {
|
||||
collectAllowlistProviderGroupPolicyWarnings,
|
||||
collectAllowlistProviderRestrictSendersWarnings,
|
||||
collectOpenGroupPolicyConfiguredRouteWarnings,
|
||||
collectOpenGroupPolicyRouteAllowlistWarnings,
|
||||
collectOpenProviderGroupPolicyWarnings,
|
||||
} from "../channels/plugins/group-policy-warnings.js";
|
||||
export { buildAccountScopedDmSecurityPolicy } from "../channels/plugins/helpers.js";
|
||||
@@ -1,14 +0,0 @@
|
||||
// Private bridge for bundled channel plugins. Keep public sdk/core slim for
|
||||
// third-party plugins; bundled channels can reach shared runtime helpers here.
|
||||
export type {
|
||||
ChannelMessageActionContext,
|
||||
OpenClawPluginApi,
|
||||
PluginRuntime,
|
||||
} from "../plugin-sdk/channel-plugin-common.js";
|
||||
export { createPluginRuntimeStore } from "../plugin-sdk/runtime-store.js";
|
||||
export {
|
||||
buildAgentSessionKey,
|
||||
type RoutePeer,
|
||||
type RoutePeerKind,
|
||||
} from "../routing/resolve-route.js";
|
||||
export { resolveThreadSessionKeys } from "../routing/session-key.js";
|
||||
@@ -1,115 +0,0 @@
|
||||
export type { ChannelMessageActionAdapter } from "../channels/plugins/types.js";
|
||||
export type { OpenClawConfig } from "../config/config.js";
|
||||
export type { DiscordAccountConfig, DiscordActionConfig } from "../config/types.js";
|
||||
export type { InspectedDiscordAccount } from "../../extensions/discord/src/account-inspect.js";
|
||||
export type { ResolvedDiscordAccount } from "../../extensions/discord/src/accounts.js";
|
||||
export type {
|
||||
DiscordSendComponents,
|
||||
DiscordSendEmbeds,
|
||||
} from "../../extensions/discord/src/send.shared.js";
|
||||
export * from "../plugin-sdk/channel-plugin-common.js";
|
||||
|
||||
export {
|
||||
createDiscordActionGate,
|
||||
listDiscordAccountIds,
|
||||
resolveDefaultDiscordAccountId,
|
||||
resolveDiscordAccount,
|
||||
} from "../../extensions/discord/src/accounts.js";
|
||||
export { inspectDiscordAccount } from "../../extensions/discord/src/account-inspect.js";
|
||||
export {
|
||||
projectCredentialSnapshotFields,
|
||||
resolveConfiguredFromCredentialStatuses,
|
||||
} from "../channels/account-snapshot-fields.js";
|
||||
export {
|
||||
listDiscordDirectoryGroupsFromConfig,
|
||||
listDiscordDirectoryPeersFromConfig,
|
||||
} from "../channels/plugins/directory-config.js";
|
||||
export {
|
||||
looksLikeDiscordTargetId,
|
||||
normalizeDiscordMessagingTarget,
|
||||
normalizeDiscordOutboundTarget,
|
||||
} from "../../extensions/discord/src/normalize.js";
|
||||
export { collectDiscordAuditChannelIds } from "../../extensions/discord/src/audit.js";
|
||||
export { collectDiscordStatusIssues } from "../../extensions/discord/src/status-issues.js";
|
||||
export {
|
||||
DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS,
|
||||
DISCORD_DEFAULT_LISTENER_TIMEOUT_MS,
|
||||
} from "../../extensions/discord/src/monitor/timeouts.js";
|
||||
export { normalizeExplicitDiscordSessionKey } from "../../extensions/discord/src/session-key-normalization.js";
|
||||
export type { DiscordPluralKitConfig } from "../../extensions/discord/src/pluralkit.js";
|
||||
|
||||
export {
|
||||
resolveDefaultGroupPolicy,
|
||||
resolveOpenProviderRuntimeGroupPolicy,
|
||||
} from "../config/runtime-group-policy.js";
|
||||
export {
|
||||
resolveDiscordGroupRequireMention,
|
||||
resolveDiscordGroupToolPolicy,
|
||||
} from "../channels/plugins/group-mentions.js";
|
||||
export { discordSetupWizard } from "../../extensions/discord/src/plugin-shared.js";
|
||||
export { DiscordConfigSchema } from "../config/zod-schema.providers-core.js";
|
||||
|
||||
export {
|
||||
autoBindSpawnedDiscordSubagent,
|
||||
listThreadBindingsBySessionKey,
|
||||
unbindThreadBindingsBySessionKey,
|
||||
} from "../../extensions/discord/src/monitor/thread-bindings.js";
|
||||
export { getGateway } from "../../extensions/discord/src/monitor/gateway-registry.js";
|
||||
export { getPresence } from "../../extensions/discord/src/monitor/presence-cache.js";
|
||||
export { readDiscordComponentSpec } from "../../extensions/discord/src/components.js";
|
||||
export { resolveDiscordChannelId } from "../../extensions/discord/src/targets.js";
|
||||
export {
|
||||
addRoleDiscord,
|
||||
banMemberDiscord,
|
||||
createChannelDiscord,
|
||||
createScheduledEventDiscord,
|
||||
createThreadDiscord,
|
||||
deleteChannelDiscord,
|
||||
deleteMessageDiscord,
|
||||
editChannelDiscord,
|
||||
editMessageDiscord,
|
||||
fetchChannelInfoDiscord,
|
||||
fetchChannelPermissionsDiscord,
|
||||
fetchMemberInfoDiscord,
|
||||
fetchMessageDiscord,
|
||||
fetchReactionsDiscord,
|
||||
fetchRoleInfoDiscord,
|
||||
fetchVoiceStatusDiscord,
|
||||
hasAnyGuildPermissionDiscord,
|
||||
kickMemberDiscord,
|
||||
listGuildChannelsDiscord,
|
||||
listGuildEmojisDiscord,
|
||||
listPinsDiscord,
|
||||
listScheduledEventsDiscord,
|
||||
listThreadsDiscord,
|
||||
moveChannelDiscord,
|
||||
pinMessageDiscord,
|
||||
reactMessageDiscord,
|
||||
readMessagesDiscord,
|
||||
removeChannelPermissionDiscord,
|
||||
removeOwnReactionsDiscord,
|
||||
removeReactionDiscord,
|
||||
removeRoleDiscord,
|
||||
searchMessagesDiscord,
|
||||
sendDiscordComponentMessage,
|
||||
sendMessageDiscord,
|
||||
sendPollDiscord,
|
||||
sendStickerDiscord,
|
||||
sendVoiceMessageDiscord,
|
||||
setChannelPermissionDiscord,
|
||||
timeoutMemberDiscord,
|
||||
unpinMessageDiscord,
|
||||
uploadEmojiDiscord,
|
||||
uploadStickerDiscord,
|
||||
} from "../../extensions/discord/src/send.js";
|
||||
export { discordMessageActions } from "../../extensions/discord/src/channel-actions.js";
|
||||
export type {
|
||||
ThreadBindingManager,
|
||||
ThreadBindingRecord,
|
||||
ThreadBindingTargetKind,
|
||||
} from "../../extensions/discord/src/monitor/thread-bindings.js";
|
||||
|
||||
export {
|
||||
buildComputedAccountStatusSnapshot,
|
||||
buildTokenChannelStatusSummary,
|
||||
} from "../plugin-sdk/status-helpers.js";
|
||||
@@ -1,46 +0,0 @@
|
||||
export type { ResolvedIMessageAccount } from "../../extensions/imessage/src/accounts.js";
|
||||
export type { IMessageAccountConfig } from "../config/types.js";
|
||||
export * from "../plugin-sdk/channel-plugin-common.js";
|
||||
export {
|
||||
listIMessageAccountIds,
|
||||
resolveDefaultIMessageAccountId,
|
||||
resolveIMessageAccount,
|
||||
} from "../../extensions/imessage/src/accounts.js";
|
||||
export {
|
||||
formatTrimmedAllowFromEntries,
|
||||
resolveIMessageConfigAllowFrom,
|
||||
resolveIMessageConfigDefaultTo,
|
||||
} from "../plugin-sdk/channel-config-helpers.js";
|
||||
export { isAllowedParsedChatSender } from "../plugin-sdk/allow-from.js";
|
||||
export {
|
||||
looksLikeIMessageTargetId,
|
||||
normalizeIMessageMessagingTarget,
|
||||
} from "../channels/plugins/normalize/imessage.js";
|
||||
export {
|
||||
createAllowedChatSenderMatcher,
|
||||
parseChatAllowTargetPrefixes,
|
||||
parseChatTargetPrefixesOrThrow,
|
||||
resolveServicePrefixedChatTarget,
|
||||
resolveServicePrefixedAllowTarget,
|
||||
resolveServicePrefixedOrChatAllowTarget,
|
||||
resolveServicePrefixedTarget,
|
||||
} from "../../extensions/imessage/src/target-parsing-helpers.js";
|
||||
export type {
|
||||
ChatSenderAllowParams,
|
||||
ParsedChatTarget,
|
||||
} from "../../extensions/imessage/src/target-parsing-helpers.js";
|
||||
export { sendMessageIMessage } from "../../extensions/imessage/src/send.js";
|
||||
|
||||
export {
|
||||
resolveAllowlistProviderRuntimeGroupPolicy,
|
||||
resolveDefaultGroupPolicy,
|
||||
} from "../config/runtime-group-policy.js";
|
||||
export {
|
||||
resolveIMessageGroupRequireMention,
|
||||
resolveIMessageGroupToolPolicy,
|
||||
} from "../channels/plugins/group-mentions.js";
|
||||
export { imessageSetupWizard } from "../../extensions/imessage/src/plugin-shared.js";
|
||||
export { IMessageConfigSchema } from "../config/zod-schema.providers-core.js";
|
||||
|
||||
export { resolveChannelMediaMaxBytes } from "../channels/plugins/media-limits.js";
|
||||
export { collectStatusIssuesFromLastError } from "../plugin-sdk/status-helpers.js";
|
||||
@@ -1,38 +0,0 @@
|
||||
export type { OpenClawConfig } from "../config/config.js";
|
||||
export type { DmPolicy } from "../config/types.js";
|
||||
export type { WizardPrompter } from "../wizard/prompts.js";
|
||||
export type { ChannelSetupAdapter } from "../channels/plugins/types.adapters.js";
|
||||
export type { ChannelSetupDmPolicy } from "../channels/plugins/setup-wizard-types.js";
|
||||
export type {
|
||||
ChannelSetupWizard,
|
||||
ChannelSetupWizardAllowFromEntry,
|
||||
} from "../channels/plugins/setup-wizard.js";
|
||||
|
||||
export { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../routing/session-key.js";
|
||||
export {
|
||||
applyAccountNameToChannelSection,
|
||||
migrateBaseNameToDefaultAccount,
|
||||
} from "../channels/plugins/setup-helpers.js";
|
||||
export {
|
||||
normalizeAllowFromEntries,
|
||||
noteChannelLookupFailure,
|
||||
noteChannelLookupSummary,
|
||||
parseMentionOrPrefixedId,
|
||||
parseSetupEntriesAllowingWildcard,
|
||||
patchChannelConfigForAccount,
|
||||
promptLegacyChannelAllowFrom,
|
||||
promptParsedAllowFromForScopedChannel,
|
||||
promptResolvedAllowFrom,
|
||||
resolveSetupAccountId,
|
||||
setAccountGroupPolicyForChannel,
|
||||
setChannelDmPolicyWithAllowFrom,
|
||||
setLegacyChannelDmPolicyWithAllowFrom,
|
||||
setSetupChannelEnabled,
|
||||
splitSetupEntries,
|
||||
} from "../channels/plugins/setup-wizard-helpers.js";
|
||||
export { detectBinary } from "../plugins/setup-binary.js";
|
||||
export { installSignalCli } from "../plugins/signal-cli-install.js";
|
||||
export { formatCliCommand } from "../cli/command-format.js";
|
||||
export { formatDocsLink } from "../terminal/links.js";
|
||||
export { hasConfiguredSecretInput } from "../config/types.secrets.js";
|
||||
export { normalizeE164, pathExists } from "../utils.js";
|
||||
@@ -1,39 +0,0 @@
|
||||
export type { ChannelMessageActionAdapter } from "../channels/plugins/types.js";
|
||||
export type { OpenClawConfig } from "../config/config.js";
|
||||
export type { ResolvedSignalAccount } from "../../extensions/signal/src/accounts.js";
|
||||
export type { SignalAccountConfig } from "../config/types.js";
|
||||
export * from "../plugin-sdk/channel-plugin-common.js";
|
||||
export {
|
||||
listEnabledSignalAccounts,
|
||||
listSignalAccountIds,
|
||||
resolveDefaultSignalAccountId,
|
||||
resolveSignalAccount,
|
||||
} from "../../extensions/signal/src/accounts.js";
|
||||
export { resolveSignalReactionLevel } from "../../extensions/signal/src/reaction-level.js";
|
||||
export {
|
||||
removeReactionSignal,
|
||||
sendReactionSignal,
|
||||
} from "../../extensions/signal/src/send-reactions.js";
|
||||
export { sendMessageSignal } from "../../extensions/signal/src/send.js";
|
||||
export {
|
||||
looksLikeSignalTargetId,
|
||||
normalizeSignalMessagingTarget,
|
||||
} from "../channels/plugins/normalize/signal.js";
|
||||
|
||||
export {
|
||||
resolveAllowlistProviderRuntimeGroupPolicy,
|
||||
resolveDefaultGroupPolicy,
|
||||
} from "../config/runtime-group-policy.js";
|
||||
export { evaluateSenderGroupAccessForPolicy } from "../plugin-sdk/group-access.js";
|
||||
export { signalSetupWizard } from "../../extensions/signal/src/plugin-shared.js";
|
||||
export { SignalConfigSchema } from "../config/zod-schema.providers-core.js";
|
||||
|
||||
export { normalizeE164 } from "../utils.js";
|
||||
export { resolveChannelMediaMaxBytes } from "../channels/plugins/media-limits.js";
|
||||
|
||||
export {
|
||||
buildBaseAccountStatusSnapshot,
|
||||
buildBaseChannelStatusSummary,
|
||||
collectStatusIssuesFromLastError,
|
||||
createDefaultChannelRuntimeState,
|
||||
} from "../plugin-sdk/status-helpers.js";
|
||||
@@ -1,67 +0,0 @@
|
||||
export type { OpenClawConfig } from "../config/config.js";
|
||||
export type { SlackAccountConfig } from "../config/types.slack.js";
|
||||
export type { InspectedSlackAccount } from "../../extensions/slack/src/account-inspect.js";
|
||||
export type { ResolvedSlackAccount } from "../../extensions/slack/src/accounts.js";
|
||||
export * from "../plugin-sdk/channel-plugin-common.js";
|
||||
export {
|
||||
listEnabledSlackAccounts,
|
||||
listSlackAccountIds,
|
||||
resolveDefaultSlackAccountId,
|
||||
resolveSlackAccount,
|
||||
resolveSlackReplyToMode,
|
||||
} from "../../extensions/slack/src/accounts.js";
|
||||
export { isSlackInteractiveRepliesEnabled } from "../../extensions/slack/src/interactive-replies.js";
|
||||
export { inspectSlackAccount } from "../../extensions/slack/src/account-inspect.js";
|
||||
export {
|
||||
projectCredentialSnapshotFields,
|
||||
resolveConfiguredFromCredentialStatuses,
|
||||
resolveConfiguredFromRequiredCredentialStatuses,
|
||||
} from "../channels/account-snapshot-fields.js";
|
||||
export {
|
||||
listSlackDirectoryGroupsFromConfig,
|
||||
listSlackDirectoryPeersFromConfig,
|
||||
} from "../channels/plugins/directory-config.js";
|
||||
export {
|
||||
looksLikeSlackTargetId,
|
||||
normalizeSlackMessagingTarget,
|
||||
} from "../channels/plugins/normalize/slack.js";
|
||||
export { parseSlackTarget, resolveSlackChannelId } from "../plugin-sdk/slack-targets.js";
|
||||
export {
|
||||
extractSlackToolSend,
|
||||
listSlackMessageActions,
|
||||
} from "../../extensions/slack/src/message-actions.js";
|
||||
export { buildSlackThreadingToolContext } from "../../extensions/slack/src/threading-tool-context.js";
|
||||
export { parseSlackBlocksInput } from "../../extensions/slack/src/blocks-input.js";
|
||||
export { handleSlackHttpRequest } from "../../extensions/slack/src/http/index.js";
|
||||
export { sendMessageSlack } from "../../extensions/slack/src/send.js";
|
||||
export {
|
||||
deleteSlackMessage,
|
||||
downloadSlackFile,
|
||||
editSlackMessage,
|
||||
getSlackMemberInfo,
|
||||
listSlackEmojis,
|
||||
listSlackPins,
|
||||
listSlackReactions,
|
||||
pinSlackMessage,
|
||||
reactSlackMessage,
|
||||
readSlackMessages,
|
||||
removeOwnSlackReactions,
|
||||
removeSlackReaction,
|
||||
sendSlackMessage,
|
||||
unpinSlackMessage,
|
||||
} from "../../extensions/slack/src/actions.js";
|
||||
export { recordSlackThreadParticipation } from "../../extensions/slack/src/sent-thread-cache.js";
|
||||
export { buildComputedAccountStatusSnapshot } from "../plugin-sdk/status-helpers.js";
|
||||
|
||||
export {
|
||||
resolveDefaultGroupPolicy,
|
||||
resolveOpenProviderRuntimeGroupPolicy,
|
||||
} from "../config/runtime-group-policy.js";
|
||||
export {
|
||||
resolveSlackGroupRequireMention,
|
||||
resolveSlackGroupToolPolicy,
|
||||
} from "../channels/plugins/group-mentions.js";
|
||||
export { slackSetupWizard } from "../../extensions/slack/src/plugin-shared.js";
|
||||
export { SlackConfigSchema } from "../config/zod-schema.providers-core.js";
|
||||
|
||||
export { handleSlackMessageAction } from "../plugin-sdk/slack-message-actions.js";
|
||||
@@ -1,120 +0,0 @@
|
||||
export type {
|
||||
ChannelAccountSnapshot,
|
||||
ChannelGatewayContext,
|
||||
ChannelMessageActionAdapter,
|
||||
} from "../channels/plugins/types.js";
|
||||
export type { ChannelPlugin } from "../channels/plugins/types.plugin.js";
|
||||
export type { OpenClawConfig } from "../config/config.js";
|
||||
export type { PluginRuntime } from "../plugins/runtime/types.js";
|
||||
export type { OpenClawPluginApi } from "../plugins/types.js";
|
||||
export type {
|
||||
TelegramAccountConfig,
|
||||
TelegramActionConfig,
|
||||
TelegramNetworkConfig,
|
||||
} from "../config/types.js";
|
||||
export type { InspectedTelegramAccount } from "../../extensions/telegram/src/account-inspect.js";
|
||||
export type { ResolvedTelegramAccount } from "../../extensions/telegram/src/accounts.js";
|
||||
export type { TelegramProbe } from "../../extensions/telegram/src/probe.js";
|
||||
export type {
|
||||
TelegramButtonStyle,
|
||||
TelegramInlineButtons,
|
||||
} from "../../extensions/telegram/src/button-types.js";
|
||||
|
||||
export { emptyPluginConfigSchema } from "../plugins/config-schema.js";
|
||||
|
||||
export { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../routing/session-key.js";
|
||||
|
||||
export {
|
||||
applyAccountNameToChannelSection,
|
||||
migrateBaseNameToDefaultAccount,
|
||||
} from "../channels/plugins/setup-helpers.js";
|
||||
export { buildChannelConfigSchema } from "../channels/plugins/config-schema.js";
|
||||
export {
|
||||
deleteAccountFromConfigSection,
|
||||
clearAccountEntryFields,
|
||||
setAccountEnabledInConfigSection,
|
||||
} from "../channels/plugins/config-helpers.js";
|
||||
export { formatPairingApproveHint } from "../channels/plugins/helpers.js";
|
||||
export { PAIRING_APPROVED_MESSAGE } from "../channels/plugins/pairing-message.js";
|
||||
|
||||
export { getChatChannelMeta } from "../channels/registry.js";
|
||||
|
||||
export {
|
||||
createTelegramActionGate,
|
||||
listTelegramAccountIds,
|
||||
resolveDefaultTelegramAccountId,
|
||||
resolveTelegramPollActionGateState,
|
||||
resolveTelegramAccount,
|
||||
} from "../../extensions/telegram/src/accounts.js";
|
||||
export { inspectTelegramAccount } from "../../extensions/telegram/src/account-inspect.js";
|
||||
export {
|
||||
projectCredentialSnapshotFields,
|
||||
resolveConfiguredFromCredentialStatuses,
|
||||
} from "../channels/account-snapshot-fields.js";
|
||||
export {
|
||||
listTelegramDirectoryGroupsFromConfig,
|
||||
listTelegramDirectoryPeersFromConfig,
|
||||
} from "../channels/plugins/directory-config.js";
|
||||
export {
|
||||
looksLikeTelegramTargetId,
|
||||
normalizeTelegramMessagingTarget,
|
||||
} from "../../extensions/telegram/src/normalize.js";
|
||||
export {
|
||||
parseTelegramReplyToMessageId,
|
||||
parseTelegramThreadId,
|
||||
} from "../../extensions/telegram/src/outbound-params.js";
|
||||
export {
|
||||
isNumericTelegramUserId,
|
||||
normalizeTelegramAllowFromEntry,
|
||||
} from "../../extensions/telegram/src/allow-from.js";
|
||||
export { fetchTelegramChatId } from "../../extensions/telegram/src/api-fetch.js";
|
||||
export {
|
||||
resolveTelegramInlineButtonsScope,
|
||||
resolveTelegramTargetChatType,
|
||||
} from "../../extensions/telegram/src/inline-buttons.js";
|
||||
export { resolveTelegramReactionLevel } from "../../extensions/telegram/src/reaction-level.js";
|
||||
export {
|
||||
createForumTopicTelegram,
|
||||
deleteMessageTelegram,
|
||||
editForumTopicTelegram,
|
||||
editMessageTelegram,
|
||||
reactMessageTelegram,
|
||||
sendMessageTelegram,
|
||||
sendPollTelegram,
|
||||
sendStickerTelegram,
|
||||
} from "../../extensions/telegram/src/send.js";
|
||||
export { getCacheStats, searchStickers } from "../../extensions/telegram/src/sticker-cache.js";
|
||||
export { resolveTelegramToken } from "../../extensions/telegram/src/token.js";
|
||||
export { telegramMessageActions } from "../../extensions/telegram/src/channel-actions.js";
|
||||
export { collectTelegramStatusIssues } from "../../extensions/telegram/src/status-issues.js";
|
||||
export { sendTelegramPayloadMessages } from "../../extensions/telegram/src/outbound-adapter.js";
|
||||
export {
|
||||
buildBrowseProvidersButton,
|
||||
buildModelsKeyboard,
|
||||
buildProviderKeyboard,
|
||||
calculateTotalPages,
|
||||
getModelsPageSize,
|
||||
type ProviderInfo,
|
||||
} from "../../extensions/telegram/src/model-buttons.js";
|
||||
export {
|
||||
isTelegramExecApprovalApprover,
|
||||
isTelegramExecApprovalClientEnabled,
|
||||
} from "../../extensions/telegram/src/exec-approvals.js";
|
||||
export type { StickerMetadata } from "../../extensions/telegram/src/bot/types.js";
|
||||
|
||||
export {
|
||||
resolveAllowlistProviderRuntimeGroupPolicy,
|
||||
resolveDefaultGroupPolicy,
|
||||
} from "../config/runtime-group-policy.js";
|
||||
export { readBooleanParam } from "../plugin-sdk/boolean-param.js";
|
||||
export { evaluateMatchedGroupAccessForPolicy } from "../plugin-sdk/group-access.js";
|
||||
export { extractToolSend } from "../plugin-sdk/tool-send.js";
|
||||
export {
|
||||
resolveTelegramGroupRequireMention,
|
||||
resolveTelegramGroupToolPolicy,
|
||||
} from "../channels/plugins/group-mentions.js";
|
||||
export { telegramSetupWizard } from "../../extensions/telegram/src/setup-surface.js";
|
||||
export { telegramSetupAdapter } from "../../extensions/telegram/src/setup-core.js";
|
||||
export { TelegramConfigSchema } from "../config/zod-schema.providers-core.js";
|
||||
|
||||
export { buildTokenChannelStatusSummary } from "../plugin-sdk/status-helpers.js";
|
||||
@@ -1,108 +0,0 @@
|
||||
export type { ChannelMessageActionName } from "../channels/plugins/types.js";
|
||||
export type { ChannelPlugin } from "../channels/plugins/types.plugin.js";
|
||||
export type { OpenClawConfig } from "../config/config.js";
|
||||
export type { DmPolicy, GroupPolicy, WhatsAppAccountConfig } from "../config/types.js";
|
||||
export type { PluginRuntime } from "../plugins/runtime/types.js";
|
||||
export type { OpenClawPluginApi } from "../plugins/types.js";
|
||||
|
||||
export { emptyPluginConfigSchema } from "../plugins/config-schema.js";
|
||||
|
||||
export { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../routing/session-key.js";
|
||||
|
||||
export {
|
||||
applyAccountNameToChannelSection,
|
||||
migrateBaseNameToDefaultAccount,
|
||||
} from "../channels/plugins/setup-helpers.js";
|
||||
export { buildChannelConfigSchema } from "../channels/plugins/config-schema.js";
|
||||
export { formatPairingApproveHint } from "../channels/plugins/helpers.js";
|
||||
|
||||
export { getChatChannelMeta } from "../channels/registry.js";
|
||||
export {
|
||||
formatWhatsAppConfigAllowFromEntries,
|
||||
resolveWhatsAppConfigAllowFrom,
|
||||
resolveWhatsAppConfigDefaultTo,
|
||||
} from "../plugin-sdk/channel-config-helpers.js";
|
||||
export {
|
||||
listWhatsAppDirectoryGroupsFromConfig,
|
||||
listWhatsAppDirectoryPeersFromConfig,
|
||||
} from "../channels/plugins/directory-config.js";
|
||||
export {
|
||||
hasAnyWhatsAppAuth,
|
||||
listEnabledWhatsAppAccounts,
|
||||
resolveWhatsAppAccount,
|
||||
} from "../../extensions/whatsapp/src/accounts.js";
|
||||
export {
|
||||
WA_WEB_AUTH_DIR,
|
||||
logWebSelfId,
|
||||
logoutWeb,
|
||||
pickWebChannel,
|
||||
webAuthExists,
|
||||
} from "../../extensions/whatsapp/src/auth-store.js";
|
||||
export {
|
||||
DEFAULT_WEB_MEDIA_BYTES,
|
||||
HEARTBEAT_PROMPT,
|
||||
HEARTBEAT_TOKEN,
|
||||
monitorWebChannel,
|
||||
resolveHeartbeatRecipients,
|
||||
runWebHeartbeatOnce,
|
||||
} from "../../extensions/whatsapp/src/auto-reply.js";
|
||||
export type {
|
||||
WebChannelStatus,
|
||||
WebMonitorTuning,
|
||||
} from "../../extensions/whatsapp/src/auto-reply.js";
|
||||
export {
|
||||
extractMediaPlaceholder,
|
||||
extractText,
|
||||
monitorWebInbox,
|
||||
} from "../../extensions/whatsapp/src/inbound.js";
|
||||
export type {
|
||||
WebInboundMessage,
|
||||
WebListenerCloseReason,
|
||||
} from "../../extensions/whatsapp/src/inbound.js";
|
||||
export { loginWeb } from "../../extensions/whatsapp/src/login.js";
|
||||
export {
|
||||
getDefaultLocalRoots,
|
||||
loadWebMedia,
|
||||
loadWebMediaRaw,
|
||||
optimizeImageToJpeg,
|
||||
} from "../../extensions/whatsapp/src/media.js";
|
||||
export {
|
||||
sendMessageWhatsApp,
|
||||
sendPollWhatsApp,
|
||||
sendReactionWhatsApp,
|
||||
} from "../../extensions/whatsapp/src/send.js";
|
||||
export {
|
||||
createWaSocket,
|
||||
formatError,
|
||||
getStatusCode,
|
||||
waitForWaConnection,
|
||||
} from "../../extensions/whatsapp/src/session.js";
|
||||
export { createWhatsAppLoginTool } from "../../extensions/whatsapp/src/agent-tools-login.js";
|
||||
export { normalizeWhatsAppAllowFromEntries } from "../channels/plugins/normalize/whatsapp.js";
|
||||
export {
|
||||
collectAllowlistProviderGroupPolicyWarnings,
|
||||
collectOpenGroupPolicyRouteAllowlistWarnings,
|
||||
} from "../channels/plugins/group-policy-warnings.js";
|
||||
export { buildAccountScopedDmSecurityPolicy } from "../channels/plugins/helpers.js";
|
||||
export { resolveWhatsAppOutboundTarget } from "../whatsapp/resolve-outbound-target.js";
|
||||
|
||||
export {
|
||||
resolveAllowlistProviderRuntimeGroupPolicy,
|
||||
resolveDefaultGroupPolicy,
|
||||
} from "../config/runtime-group-policy.js";
|
||||
export {
|
||||
resolveWhatsAppGroupRequireMention,
|
||||
resolveWhatsAppGroupToolPolicy,
|
||||
} from "../channels/plugins/group-mentions.js";
|
||||
export {
|
||||
createWhatsAppOutboundBase,
|
||||
resolveWhatsAppGroupIntroHint,
|
||||
resolveWhatsAppMentionStripRegexes,
|
||||
} from "../channels/plugins/whatsapp-shared.js";
|
||||
export { resolveWhatsAppHeartbeatRecipients } from "../channels/plugins/whatsapp-heartbeat.js";
|
||||
export { WhatsAppConfigSchema } from "../config/zod-schema.providers-whatsapp.js";
|
||||
|
||||
export { createActionGate, readStringParam } from "../agents/tools/common.js";
|
||||
export { createPluginRuntimeStore } from "../plugin-sdk/runtime-store.js";
|
||||
|
||||
export { normalizeE164 } from "../utils.js";
|
||||
7
src/plugin-sdk/channel-config-schema.ts
Normal file
7
src/plugin-sdk/channel-config-schema.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
/** Shared config-schema primitives for channel plugins with DM/group policy knobs. */
|
||||
export {
|
||||
AllowFromListSchema,
|
||||
buildCatchallMultiAccountChannelSchema,
|
||||
buildNestedDmConfigSchema,
|
||||
} from "../channels/plugins/config-schema.js";
|
||||
export { DmPolicySchema, GroupPolicySchema } from "../config/zod-schema.core.js";
|
||||
19
src/plugin-sdk/channel-policy.ts
Normal file
19
src/plugin-sdk/channel-policy.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
/** Shared policy warnings and DM/group policy helpers for channel plugins. */
|
||||
export {
|
||||
buildOpenGroupPolicyConfigureRouteAllowlistWarning,
|
||||
buildOpenGroupPolicyRestrictSendersWarning,
|
||||
buildOpenGroupPolicyWarning,
|
||||
collectAllowlistProviderGroupPolicyWarnings,
|
||||
collectAllowlistProviderRestrictSendersWarnings,
|
||||
collectOpenGroupPolicyRestrictSendersWarnings,
|
||||
collectOpenGroupPolicyRouteAllowlistWarnings,
|
||||
collectOpenProviderGroupPolicyWarnings,
|
||||
} from "../channels/plugins/group-policy-warnings.js";
|
||||
export { buildAccountScopedDmSecurityPolicy } from "../channels/plugins/helpers.js";
|
||||
export { resolveChannelGroupRequireMention } from "../config/group-policy.js";
|
||||
export {
|
||||
DM_GROUP_ACCESS_REASON,
|
||||
readStoreAllowFromForDmPolicy,
|
||||
resolveDmGroupAccessWithLists,
|
||||
resolveEffectiveAllowFromLists,
|
||||
} from "../security/dm-policy-shared.js";
|
||||
@@ -42,6 +42,7 @@ export * from "../channels/plugins/status-issues/shared.js";
|
||||
export * from "../channels/plugins/whatsapp-heartbeat.js";
|
||||
export * from "../infra/outbound/send-deps.js";
|
||||
export * from "../utils/message-channel.js";
|
||||
export * from "./channel-lifecycle.js";
|
||||
export type {
|
||||
InteractiveButtonStyle,
|
||||
InteractiveReplyButton,
|
||||
|
||||
@@ -1 +1,28 @@
|
||||
export * from "./index.js";
|
||||
// Legacy compat surface for external plugins that still depend on older
|
||||
// broad plugin-sdk imports. Keep this file intentionally small.
|
||||
|
||||
export { emptyPluginConfigSchema } from "../plugins/config-schema.js";
|
||||
export { resolveControlCommandGate } from "../channels/command-gating.js";
|
||||
|
||||
export { createAccountStatusSink } from "./channel-lifecycle.js";
|
||||
export { createPluginRuntimeStore } from "./runtime-store.js";
|
||||
export { KeyedAsyncQueue } from "./keyed-async-queue.js";
|
||||
|
||||
export {
|
||||
createScopedAccountConfigAccessors,
|
||||
createScopedChannelConfigBase,
|
||||
createScopedDmSecurityResolver,
|
||||
mapAllowFromEntries,
|
||||
} from "./channel-config-helpers.js";
|
||||
export { formatAllowFromLowercase, formatNormalizedAllowFromEntries } from "./allow-from.js";
|
||||
export * from "./channel-config-schema.js";
|
||||
export * from "./channel-policy.js";
|
||||
export * from "./reply-history.js";
|
||||
export * from "./directory-runtime.js";
|
||||
export { mapAllowlistResolutionInputs } from "./allowlist-resolution.js";
|
||||
|
||||
export {
|
||||
resolveBlueBubblesGroupRequireMention,
|
||||
resolveBlueBubblesGroupToolPolicy,
|
||||
} from "../channels/plugins/group-mentions.js";
|
||||
export { collectBlueBubblesStatusIssues } from "../channels/plugins/status-issues/bluebubbles.js";
|
||||
|
||||
@@ -39,36 +39,9 @@ export type {
|
||||
UsageProviderId,
|
||||
UsageWindow,
|
||||
} from "../infra/provider-usage.types.js";
|
||||
export type {
|
||||
ChannelMessageActionContext,
|
||||
ChannelPlugin,
|
||||
OpenClawPluginApi,
|
||||
PluginRuntime,
|
||||
} from "./channel-plugin-common.js";
|
||||
export type { ChannelMessageActionContext } from "../channels/plugins/types.js";
|
||||
export type { ChannelPlugin } from "../channels/plugins/types.plugin.js";
|
||||
export type { OpenClawPluginApi } from "../plugins/types.js";
|
||||
export type { PluginRuntime } from "../plugins/runtime/types.js";
|
||||
|
||||
export { emptyPluginConfigSchema } from "./channel-plugin-common.js";
|
||||
export { buildOauthProviderAuthResult } from "./provider-auth-result.js";
|
||||
export {
|
||||
DEFAULT_SECRET_FILE_MAX_BYTES,
|
||||
loadSecretFileSync,
|
||||
readSecretFileSync,
|
||||
tryReadSecretFileSync,
|
||||
} from "../infra/secret-file.js";
|
||||
export type { SecretFileReadOptions, SecretFileReadResult } from "../infra/secret-file.js";
|
||||
|
||||
export { resolveGatewayBindUrl } from "../shared/gateway-bind-url.js";
|
||||
export type { GatewayBindUrlResult } from "../shared/gateway-bind-url.js";
|
||||
|
||||
export { resolveTailnetHostWithRunner } from "../shared/tailscale-status.js";
|
||||
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";
|
||||
export { runPassiveAccountLifecycle } from "./channel-lifecycle.js";
|
||||
export { createLoggerBackedRuntime } from "./runtime.js";
|
||||
export { emptyPluginConfigSchema } from "../plugins/config-schema.js";
|
||||
|
||||
9
src/plugin-sdk/directory-runtime.ts
Normal file
9
src/plugin-sdk/directory-runtime.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
/** Shared directory listing helpers for plugins that derive users/groups from config maps. */
|
||||
export {
|
||||
applyDirectoryQueryAndLimit,
|
||||
listDirectoryGroupEntriesFromMapKeys,
|
||||
listDirectoryGroupEntriesFromMapKeysAndAllowFrom,
|
||||
listDirectoryUserEntriesFromAllowFrom,
|
||||
listDirectoryUserEntriesFromAllowFromAndMapKeys,
|
||||
toDirectoryEntries,
|
||||
} from "../channels/plugins/directory-config-helpers.js";
|
||||
@@ -58,62 +58,11 @@ describe("plugin-sdk exports", () => {
|
||||
}
|
||||
});
|
||||
|
||||
// Verify critical functions that extensions depend on are exported and callable.
|
||||
// Regression guard for #27569 where isDangerousNameMatchingEnabled was missing
|
||||
// from the compiled output, breaking mattermost/googlechat/msteams/irc plugins.
|
||||
it("exports critical functions used by channel extensions", () => {
|
||||
const requiredFunctions = [
|
||||
"isDangerousNameMatchingEnabled",
|
||||
"createAccountListHelpers",
|
||||
"buildAgentMediaPayload",
|
||||
"createReplyPrefixOptions",
|
||||
"createTypingCallbacks",
|
||||
"logInboundDrop",
|
||||
"logTypingFailure",
|
||||
"buildPendingHistoryContextFromMap",
|
||||
"clearHistoryEntriesIfEnabled",
|
||||
"recordPendingHistoryEntryIfEnabled",
|
||||
"resolveControlCommandGate",
|
||||
"resolveDmGroupAccessWithLists",
|
||||
"resolveAllowlistProviderRuntimeGroupPolicy",
|
||||
"resolveDefaultGroupPolicy",
|
||||
"resolveChannelMediaMaxBytes",
|
||||
"warnMissingProviderGroupPolicyFallbackOnce",
|
||||
"createDedupeCache",
|
||||
"formatInboundFromLabel",
|
||||
"resolveRuntimeGroupPolicy",
|
||||
"emptyPluginConfigSchema",
|
||||
"normalizePluginHttpPath",
|
||||
"registerPluginHttpRoute",
|
||||
"buildBaseAccountStatusSnapshot",
|
||||
"buildBaseChannelStatusSummary",
|
||||
"buildTokenChannelStatusSummary",
|
||||
"collectStatusIssuesFromLastError",
|
||||
"createDefaultChannelRuntimeState",
|
||||
"resolveChannelEntryMatch",
|
||||
"resolveChannelEntryMatchWithFallback",
|
||||
"normalizeChannelSlug",
|
||||
"buildChannelKeyCandidates",
|
||||
];
|
||||
|
||||
for (const key of requiredFunctions) {
|
||||
expect(sdk).toHaveProperty(key);
|
||||
expect(typeof (sdk as Record<string, unknown>)[key]).toBe("function");
|
||||
}
|
||||
});
|
||||
|
||||
// Verify critical constants that extensions depend on are exported.
|
||||
it("exports critical constants used by channel extensions", () => {
|
||||
const requiredConstants = [
|
||||
"DEFAULT_GROUP_HISTORY_LIMIT",
|
||||
"DEFAULT_ACCOUNT_ID",
|
||||
"SILENT_REPLY_TOKEN",
|
||||
"PAIRING_APPROVED_MESSAGE",
|
||||
];
|
||||
|
||||
for (const key of requiredConstants) {
|
||||
expect(sdk).toHaveProperty(key);
|
||||
}
|
||||
it("keeps the root runtime surface intentionally small", () => {
|
||||
expect(typeof sdk.emptyPluginConfigSchema).toBe("function");
|
||||
expect(Object.prototype.hasOwnProperty.call(sdk, "resolveControlCommandGate")).toBe(false);
|
||||
expect(Object.prototype.hasOwnProperty.call(sdk, "buildAgentSessionKey")).toBe(false);
|
||||
expect(Object.prototype.hasOwnProperty.call(sdk, "isDangerousNameMatchingEnabled")).toBe(false);
|
||||
});
|
||||
|
||||
it("emits importable bundled subpath entries", { timeout: 240_000 }, async () => {
|
||||
|
||||
@@ -1,829 +1,49 @@
|
||||
export { createAccountListHelpers } from "../channels/plugins/account-helpers.js";
|
||||
export { createAccountActionGate } from "../channels/plugins/account-action-gate.js";
|
||||
export { CHANNEL_MESSAGE_ACTION_NAMES } from "../channels/plugins/message-action-names.js";
|
||||
export {
|
||||
BLUEBUBBLES_ACTIONS,
|
||||
BLUEBUBBLES_ACTION_NAMES,
|
||||
BLUEBUBBLES_GROUP_ACTIONS,
|
||||
} from "../channels/plugins/bluebubbles-actions.js";
|
||||
// Shared root plugin-sdk surface.
|
||||
// Keep this entry intentionally tiny. Channel/provider helpers belong on
|
||||
// dedicated subpaths or, for legacy consumers, the compat surface.
|
||||
|
||||
export type {
|
||||
ChannelAccountSnapshot,
|
||||
ChannelAccountState,
|
||||
ChannelAgentTool,
|
||||
ChannelAgentToolFactory,
|
||||
ChannelAuthAdapter,
|
||||
ChannelCapabilities,
|
||||
ChannelCommandAdapter,
|
||||
ChannelConfigAdapter,
|
||||
ChannelDirectoryAdapter,
|
||||
ChannelDirectoryEntry,
|
||||
ChannelDirectoryEntryKind,
|
||||
ChannelElevatedAdapter,
|
||||
ChannelGatewayAdapter,
|
||||
ChannelGatewayContext,
|
||||
ChannelGroupAdapter,
|
||||
ChannelGroupContext,
|
||||
ChannelHeartbeatAdapter,
|
||||
ChannelHeartbeatDeps,
|
||||
ChannelId,
|
||||
ChannelLogSink,
|
||||
ChannelLoginWithQrStartResult,
|
||||
ChannelLoginWithQrWaitResult,
|
||||
ChannelLogoutContext,
|
||||
ChannelLogoutResult,
|
||||
ChannelMentionAdapter,
|
||||
ChannelMessageActionAdapter,
|
||||
ChannelMessageActionContext,
|
||||
ChannelMessageActionName,
|
||||
ChannelMessagingAdapter,
|
||||
ChannelMeta,
|
||||
ChannelOutboundAdapter,
|
||||
ChannelOutboundContext,
|
||||
ChannelOutboundTargetMode,
|
||||
ChannelPairingAdapter,
|
||||
ChannelPollContext,
|
||||
ChannelPollResult,
|
||||
ChannelResolveKind,
|
||||
ChannelResolveResult,
|
||||
ChannelResolverAdapter,
|
||||
ChannelSecurityAdapter,
|
||||
ChannelSecurityContext,
|
||||
ChannelSecurityDmPolicy,
|
||||
ChannelSetupAdapter,
|
||||
ChannelSetupInput,
|
||||
ChannelStatusAdapter,
|
||||
ChannelStatusIssue,
|
||||
ChannelStreamingAdapter,
|
||||
ChannelThreadingAdapter,
|
||||
ChannelThreadingContext,
|
||||
ChannelThreadingToolContext,
|
||||
ChannelToolSend,
|
||||
BaseProbeResult,
|
||||
BaseTokenResolution,
|
||||
} from "../channels/plugins/types.js";
|
||||
export type { ChannelConfigSchema, ChannelPlugin } from "../channels/plugins/types.plugin.js";
|
||||
export type {
|
||||
ChannelSetupConfigureContext,
|
||||
ChannelSetupDmPolicy,
|
||||
ChannelSetupInteractiveContext,
|
||||
ChannelSetupPlugin,
|
||||
ChannelSetupResult,
|
||||
ChannelSetupStatus,
|
||||
ChannelSetupStatusContext,
|
||||
ChannelSetupWizardAdapter,
|
||||
} from "../channels/plugins/setup-wizard-types.js";
|
||||
export type { ChannelSetupAdapter, ChannelSetupInput } from "../channels/plugins/types.js";
|
||||
export type {
|
||||
ChannelSetupWizard,
|
||||
ChannelSetupWizardAllowFromEntry,
|
||||
ChannelSetupWizardCredential,
|
||||
ChannelSetupWizardCredentialState,
|
||||
ChannelSetupWizardFinalize,
|
||||
ChannelSetupWizardGroupAccess,
|
||||
ChannelSetupWizardPrepare,
|
||||
ChannelSetupWizardStatus,
|
||||
ChannelSetupWizardTextInput,
|
||||
} from "../channels/plugins/setup-wizard.js";
|
||||
export type {
|
||||
AcpRuntimeCapabilities,
|
||||
AcpRuntimeControl,
|
||||
AcpRuntimeDoctorReport,
|
||||
AcpRuntime,
|
||||
AcpRuntimeEnsureInput,
|
||||
AcpRuntimeEvent,
|
||||
AcpRuntimeHandle,
|
||||
AcpRuntimePromptMode,
|
||||
AcpSessionUpdateTag,
|
||||
AcpRuntimeSessionMode,
|
||||
AcpRuntimeStatus,
|
||||
AcpRuntimeTurnInput,
|
||||
} from "../acp/runtime/types.js";
|
||||
export type { AcpRuntimeBackend } from "../acp/runtime/registry.js";
|
||||
export {
|
||||
getAcpRuntimeBackend,
|
||||
registerAcpRuntimeBackend,
|
||||
requireAcpRuntimeBackend,
|
||||
unregisterAcpRuntimeBackend,
|
||||
} from "../acp/runtime/registry.js";
|
||||
export { ACP_ERROR_CODES, AcpRuntimeError } from "../acp/runtime/errors.js";
|
||||
export type { AcpRuntimeErrorCode } from "../acp/runtime/errors.js";
|
||||
export type {
|
||||
AnyAgentTool,
|
||||
MediaUnderstandingProviderPlugin,
|
||||
OpenClawPluginConfigSchema,
|
||||
OpenClawPluginApi,
|
||||
OpenClawPluginService,
|
||||
OpenClawPluginServiceContext,
|
||||
PluginHookInboundClaimContext,
|
||||
PluginHookInboundClaimEvent,
|
||||
PluginHookInboundClaimResult,
|
||||
PluginInteractiveDiscordHandlerContext,
|
||||
PluginInteractiveHandlerRegistration,
|
||||
PluginInteractiveSlackHandlerContext,
|
||||
PluginInteractiveTelegramHandlerContext,
|
||||
OpenClawPluginConfigSchema,
|
||||
PluginLogger,
|
||||
ProviderAuthContext,
|
||||
ProviderAuthDoctorHintContext,
|
||||
ProviderAuthResult,
|
||||
ProviderAugmentModelCatalogContext,
|
||||
ProviderBuiltInModelSuppressionContext,
|
||||
ProviderBuiltInModelSuppressionResult,
|
||||
ProviderBuildMissingAuthMessageContext,
|
||||
ProviderCacheTtlEligibilityContext,
|
||||
ProviderDefaultThinkingPolicyContext,
|
||||
ProviderFetchUsageSnapshotContext,
|
||||
ProviderModernModelPolicyContext,
|
||||
ProviderPreparedRuntimeAuth,
|
||||
ProviderResolvedUsageAuth,
|
||||
ProviderPrepareExtraParamsContext,
|
||||
ProviderPrepareDynamicModelContext,
|
||||
ProviderPrepareRuntimeAuthContext,
|
||||
ProviderResolveUsageAuthContext,
|
||||
ProviderResolveDynamicModelContext,
|
||||
ProviderNormalizeResolvedModelContext,
|
||||
ProviderRuntimeModel,
|
||||
SpeechProviderPlugin,
|
||||
ProviderThinkingPolicyContext,
|
||||
ProviderWrapStreamFnContext,
|
||||
} from "../plugins/types.js";
|
||||
export type {
|
||||
ProviderUsageSnapshot,
|
||||
UsageProviderId,
|
||||
UsageWindow,
|
||||
} from "../infra/provider-usage.types.js";
|
||||
export type {
|
||||
ConversationRef,
|
||||
SessionBindingBindInput,
|
||||
SessionBindingCapabilities,
|
||||
SessionBindingRecord,
|
||||
SessionBindingService,
|
||||
SessionBindingUnbindInput,
|
||||
} from "../infra/outbound/session-binding-service.js";
|
||||
export type {
|
||||
GatewayRequestHandler,
|
||||
GatewayRequestHandlerOptions,
|
||||
RespondFn,
|
||||
} from "../gateway/server-methods/types.js";
|
||||
export type {
|
||||
PluginRuntime,
|
||||
RuntimeLogger,
|
||||
SubagentRunParams,
|
||||
SubagentRunResult,
|
||||
SubagentWaitParams,
|
||||
SubagentWaitResult,
|
||||
SubagentGetSessionMessagesParams,
|
||||
SubagentGetSessionMessagesResult,
|
||||
SubagentGetSessionParams,
|
||||
SubagentGetSessionResult,
|
||||
SubagentDeleteSessionParams,
|
||||
} from "../plugins/runtime/types.js";
|
||||
export { normalizePluginHttpPath } from "../plugins/http-path.js";
|
||||
export { registerPluginHttpRoute } from "../plugins/http-registry.js";
|
||||
export { emptyPluginConfigSchema } from "../plugins/config-schema.js";
|
||||
export type { OpenClawConfig } from "../config/config.js";
|
||||
/** @deprecated Use OpenClawConfig instead */
|
||||
export type { OpenClawConfig as ClawdbotConfig } from "../config/config.js";
|
||||
export { isDangerousNameMatchingEnabled } from "../config/dangerous-name-matching.js";
|
||||
export * from "./speech.js";
|
||||
|
||||
export type { FileLockHandle, FileLockOptions } from "./file-lock.js";
|
||||
export { acquireFileLock, withFileLock } from "./file-lock.js";
|
||||
export * from "./media-understanding.js";
|
||||
export {
|
||||
mapAllowlistResolutionInputs,
|
||||
mapBasicAllowlistResolutionEntries,
|
||||
type BasicAllowlistResolutionEntry,
|
||||
} from "./allowlist-resolution.js";
|
||||
export * from "./provider-web-search.js";
|
||||
export { resolveRequestUrl } from "./request-url.js";
|
||||
export {
|
||||
buildDiscordSendMediaOptions,
|
||||
buildDiscordSendOptions,
|
||||
tagDiscordChannelResult,
|
||||
} from "./discord-send.js";
|
||||
export type { KeyedAsyncQueueHooks } from "./keyed-async-queue.js";
|
||||
export { enqueueKeyedTask, KeyedAsyncQueue } from "./keyed-async-queue.js";
|
||||
export { normalizeWebhookPath, resolveWebhookPath } from "./webhook-path.js";
|
||||
export {
|
||||
registerWebhookTarget,
|
||||
registerWebhookTargetWithPluginRoute,
|
||||
rejectNonPostWebhookRequest,
|
||||
resolveWebhookTargetWithAuthOrReject,
|
||||
resolveWebhookTargetWithAuthOrRejectSync,
|
||||
resolveSingleWebhookTarget,
|
||||
resolveSingleWebhookTargetAsync,
|
||||
resolveWebhookTargets,
|
||||
withResolvedWebhookRequestPipeline,
|
||||
} from "./webhook-targets.js";
|
||||
export type {
|
||||
RegisterWebhookPluginRouteOptions,
|
||||
RegisterWebhookTargetOptions,
|
||||
WebhookTargetMatchResult,
|
||||
} from "./webhook-targets.js";
|
||||
export {
|
||||
applyBasicWebhookRequestGuards,
|
||||
beginWebhookRequestPipelineOrReject,
|
||||
createWebhookInFlightLimiter,
|
||||
isJsonContentType,
|
||||
readWebhookBodyOrReject,
|
||||
readJsonWebhookBodyOrReject,
|
||||
WEBHOOK_BODY_READ_DEFAULTS,
|
||||
WEBHOOK_IN_FLIGHT_DEFAULTS,
|
||||
} from "./webhook-request-guards.js";
|
||||
export type { WebhookBodyReadProfile, WebhookInFlightLimiter } from "./webhook-request-guards.js";
|
||||
export {
|
||||
createAccountStatusSink,
|
||||
keepHttpServerTaskAlive,
|
||||
runPassiveAccountLifecycle,
|
||||
waitUntilAbort,
|
||||
} from "./channel-lifecycle.js";
|
||||
export type { AgentMediaPayload } from "./agent-media-payload.js";
|
||||
export { buildAgentMediaPayload } from "./agent-media-payload.js";
|
||||
export {
|
||||
buildBaseAccountStatusSnapshot,
|
||||
buildBaseChannelStatusSummary,
|
||||
buildComputedAccountStatusSnapshot,
|
||||
buildProbeChannelStatusSummary,
|
||||
buildRuntimeAccountStatusSnapshot,
|
||||
buildTokenChannelStatusSummary,
|
||||
collectStatusIssuesFromLastError,
|
||||
createDefaultChannelRuntimeState,
|
||||
} from "./status-helpers.js";
|
||||
export {
|
||||
normalizeAllowFromEntries,
|
||||
noteChannelLookupFailure,
|
||||
noteChannelLookupSummary,
|
||||
parseMentionOrPrefixedId,
|
||||
parseSetupEntriesAllowingWildcard,
|
||||
patchChannelConfigForAccount,
|
||||
promptLegacyChannelAllowFrom,
|
||||
promptParsedAllowFromForScopedChannel,
|
||||
promptResolvedAllowFrom,
|
||||
resolveSetupAccountId,
|
||||
setAccountGroupPolicyForChannel,
|
||||
setChannelDmPolicyWithAllowFrom,
|
||||
setLegacyChannelDmPolicyWithAllowFrom,
|
||||
setSetupChannelEnabled,
|
||||
splitSetupEntries,
|
||||
promptSingleChannelSecretInput,
|
||||
type SingleChannelSecretInputPromptResult,
|
||||
} from "../channels/plugins/setup-wizard-helpers.js";
|
||||
export { buildOauthProviderAuthResult } from "./provider-auth-result.js";
|
||||
export { formatResolvedUnresolvedNote } from "./resolution-notes.js";
|
||||
export { buildChannelSendResult } from "./channel-send-result.js";
|
||||
export type { ChannelSendRawResult } from "./channel-send-result.js";
|
||||
export { createPluginRuntimeStore } from "./runtime-store.js";
|
||||
export { createScopedChannelConfigBase } from "./channel-config-helpers.js";
|
||||
export {
|
||||
buildAccountScopedAllowlistConfigEditor,
|
||||
resolveLegacyDmAllowlistConfigPaths,
|
||||
} from "./allowlist-config-edit.js";
|
||||
export {
|
||||
AllowFromEntrySchema,
|
||||
AllowFromListSchema,
|
||||
buildNestedDmConfigSchema,
|
||||
buildCatchallMultiAccountChannelSchema,
|
||||
} from "../channels/plugins/config-schema.js";
|
||||
export { getChatChannelMeta } from "../channels/registry.js";
|
||||
export {
|
||||
compileAllowlist,
|
||||
resolveAllowlistCandidates,
|
||||
resolveAllowlistMatchByCandidates,
|
||||
} from "../channels/allowlist-match.js";
|
||||
export type {
|
||||
BlockStreamingCoalesceConfig,
|
||||
DmPolicy,
|
||||
DmConfig,
|
||||
GroupPolicy,
|
||||
GroupToolPolicyConfig,
|
||||
GroupToolPolicyBySenderConfig,
|
||||
MarkdownConfig,
|
||||
MarkdownTableMode,
|
||||
GoogleChatAccountConfig,
|
||||
GoogleChatConfig,
|
||||
GoogleChatDmConfig,
|
||||
GoogleChatGroupConfig,
|
||||
GoogleChatActionConfig,
|
||||
MSTeamsChannelConfig,
|
||||
MSTeamsConfig,
|
||||
MSTeamsReplyStyle,
|
||||
MSTeamsTeamConfig,
|
||||
} from "../config/types.js";
|
||||
export {
|
||||
GROUP_POLICY_BLOCKED_LABEL,
|
||||
resetMissingProviderGroupPolicyFallbackWarningsForTesting,
|
||||
resolveAllowlistProviderRuntimeGroupPolicy,
|
||||
resolveDefaultGroupPolicy,
|
||||
resolveOpenProviderRuntimeGroupPolicy,
|
||||
resolveRuntimeGroupPolicy,
|
||||
type GroupPolicyDefaultsConfig,
|
||||
type RuntimeGroupPolicyResolution,
|
||||
type RuntimeGroupPolicyParams,
|
||||
type ResolveProviderRuntimeGroupPolicyParams,
|
||||
warnMissingProviderGroupPolicyFallbackOnce,
|
||||
} from "../config/runtime-group-policy.js";
|
||||
export {
|
||||
DiscordConfigSchema,
|
||||
GoogleChatConfigSchema,
|
||||
IMessageConfigSchema,
|
||||
MSTeamsConfigSchema,
|
||||
SignalConfigSchema,
|
||||
SlackConfigSchema,
|
||||
TelegramConfigSchema,
|
||||
} from "../config/zod-schema.providers-core.js";
|
||||
export { WhatsAppConfigSchema } from "../config/zod-schema.providers-whatsapp.js";
|
||||
export {
|
||||
BlockStreamingCoalesceSchema,
|
||||
DmConfigSchema,
|
||||
DmPolicySchema,
|
||||
GroupPolicySchema,
|
||||
MarkdownConfigSchema,
|
||||
MarkdownTableModeSchema,
|
||||
normalizeAllowFrom,
|
||||
ReplyRuntimeConfigSchemaShape,
|
||||
requireOpenAllowFrom,
|
||||
SecretInputSchema,
|
||||
TtsAutoSchema,
|
||||
TtsConfigSchema,
|
||||
TtsModeSchema,
|
||||
TtsProviderSchema,
|
||||
} from "../config/zod-schema.core.js";
|
||||
export {
|
||||
assertSecretInputResolved,
|
||||
hasConfiguredSecretInput,
|
||||
isSecretRef,
|
||||
normalizeResolvedSecretInputString,
|
||||
normalizeSecretInputString,
|
||||
} from "../config/types.secrets.js";
|
||||
export type { SecretInput, SecretRef } from "../config/types.secrets.js";
|
||||
export { ToolPolicySchema } from "../config/zod-schema.agent-runtime.js";
|
||||
export type { RuntimeEnv } from "../runtime.js";
|
||||
export type { WizardPrompter } from "../wizard/prompts.js";
|
||||
export {
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
normalizeAccountId,
|
||||
normalizeAgentId,
|
||||
resolveThreadSessionKeys,
|
||||
} from "../routing/session-key.js";
|
||||
export { buildAgentSessionKey, type RoutePeer } from "../routing/resolve-route.js";
|
||||
export {
|
||||
formatAllowFromLowercase,
|
||||
formatNormalizedAllowFromEntries,
|
||||
isAllowedParsedChatSender,
|
||||
isNormalizedSenderAllowed,
|
||||
} from "./allow-from.js";
|
||||
export {
|
||||
evaluateGroupRouteAccessForPolicy,
|
||||
evaluateMatchedGroupAccessForPolicy,
|
||||
evaluateSenderGroupAccess,
|
||||
evaluateSenderGroupAccessForPolicy,
|
||||
resolveSenderScopedGroupPolicy,
|
||||
type GroupRouteAccessDecision,
|
||||
type GroupRouteAccessReason,
|
||||
type MatchedGroupAccessDecision,
|
||||
type MatchedGroupAccessReason,
|
||||
type SenderGroupAccessDecision,
|
||||
type SenderGroupAccessReason,
|
||||
} from "./group-access.js";
|
||||
export {
|
||||
resolveDirectDmAuthorizationOutcome,
|
||||
resolveSenderCommandAuthorization,
|
||||
resolveSenderCommandAuthorizationWithRuntime,
|
||||
} from "./command-auth.js";
|
||||
export type { CommandAuthorizationRuntime } from "./command-auth.js";
|
||||
export { createScopedPairingAccess } from "./pairing-access.js";
|
||||
export {
|
||||
createInboundEnvelopeBuilder,
|
||||
resolveInboundRouteEnvelopeBuilder,
|
||||
resolveInboundRouteEnvelopeBuilderWithRuntime,
|
||||
} from "./inbound-envelope.js";
|
||||
export { resolveInboundSessionEnvelopeContext } from "../channels/session-envelope.js";
|
||||
export {
|
||||
listConfiguredAccountIds,
|
||||
resolveAccountWithDefaultFallback,
|
||||
} from "./account-resolution.js";
|
||||
export { resolveAccountEntry } from "../routing/account-lookup.js";
|
||||
export { issuePairingChallenge } from "../pairing/pairing-challenge.js";
|
||||
export { handleSlackMessageAction } from "./slack-message-actions.js";
|
||||
export { extractToolSend } from "./tool-send.js";
|
||||
export {
|
||||
createNormalizedOutboundDeliverer,
|
||||
formatTextWithAttachmentLinks,
|
||||
isNumericTargetId,
|
||||
normalizeOutboundReplyPayload,
|
||||
resolveOutboundMediaUrls,
|
||||
sendPayloadWithChunkedTextAndMedia,
|
||||
sendMediaWithLeadingCaption,
|
||||
} from "./reply-payload.js";
|
||||
export type { OutboundReplyPayload } from "./reply-payload.js";
|
||||
export {
|
||||
buildInboundReplyDispatchBase,
|
||||
dispatchInboundReplyWithBase,
|
||||
dispatchReplyFromConfigWithSettledDispatcher,
|
||||
recordInboundSessionAndDispatchReply,
|
||||
} from "./inbound-reply-dispatch.js";
|
||||
export type { OutboundMediaLoadOptions } from "./outbound-media.js";
|
||||
export { loadOutboundMediaFromUrl } from "./outbound-media.js";
|
||||
export { resolveChannelAccountConfigBasePath } from "./config-paths.js";
|
||||
export { buildMediaPayload } from "../channels/plugins/media-payload.js";
|
||||
export type { MediaPayload, MediaPayloadInput } from "../channels/plugins/media-payload.js";
|
||||
export {
|
||||
createLoggerBackedRuntime,
|
||||
resolveRuntimeEnv,
|
||||
resolveRuntimeEnvWithUnavailableExit,
|
||||
} from "./runtime.js";
|
||||
export { detectBinary } from "../plugins/setup-binary.js";
|
||||
export { installSignalCli } from "../plugins/signal-cli-install.js";
|
||||
export { chunkTextForOutbound } from "./text-chunking.js";
|
||||
export { resolveTextChunkLimit } from "../auto-reply/chunk.js";
|
||||
export { readBooleanParam } from "./boolean-param.js";
|
||||
export { readJsonFileWithFallback, writeJsonFileAtomically } from "./json-store.js";
|
||||
export { generatePkceVerifierChallenge, toFormUrlEncoded } from "./oauth-utils.js";
|
||||
export { buildRandomTempFilePath, withTempDownloadPath } from "./temp-path.js";
|
||||
export {
|
||||
applyWindowsSpawnProgramPolicy,
|
||||
materializeWindowsSpawnProgram,
|
||||
resolveWindowsExecutablePath,
|
||||
resolveWindowsSpawnProgramCandidate,
|
||||
resolveWindowsSpawnProgram,
|
||||
} from "./windows-spawn.js";
|
||||
export type {
|
||||
ResolveWindowsSpawnProgramCandidateParams,
|
||||
ResolveWindowsSpawnProgramParams,
|
||||
WindowsSpawnCandidateResolution,
|
||||
WindowsSpawnInvocation,
|
||||
WindowsSpawnProgramCandidate,
|
||||
WindowsSpawnProgram,
|
||||
WindowsSpawnResolution,
|
||||
} from "./windows-spawn.js";
|
||||
export { resolvePreferredOpenClawTmpDir } from "../infra/tmp-openclaw-dir.js";
|
||||
export {
|
||||
runPluginCommandWithTimeout,
|
||||
type PluginCommandRunOptions,
|
||||
type PluginCommandRunResult,
|
||||
} from "./run-command.js";
|
||||
export { resolveGatewayBindUrl } from "../shared/gateway-bind-url.js";
|
||||
export type { GatewayBindUrlResult } from "../shared/gateway-bind-url.js";
|
||||
export { resolveTailnetHostWithRunner } from "../shared/tailscale-status.js";
|
||||
export type {
|
||||
TailscaleStatusCommandResult,
|
||||
TailscaleStatusCommandRunner,
|
||||
} from "../shared/tailscale-status.js";
|
||||
export type { ChatType } from "../channels/chat-type.js";
|
||||
export { normalizeChatType } from "../channels/chat-type.js";
|
||||
/** @deprecated Use ChatType instead */
|
||||
export type { RoutePeerKind } from "../routing/resolve-route.js";
|
||||
export { resolveAckReaction } from "../agents/identity.js";
|
||||
export type { ReplyPayload } from "../auto-reply/types.js";
|
||||
export type { ChunkMode } from "../auto-reply/chunk.js";
|
||||
export { SILENT_REPLY_TOKEN, isSilentReplyText } from "../auto-reply/tokens.js";
|
||||
export { formatInboundFromLabel } from "../auto-reply/envelope.js";
|
||||
export {
|
||||
createScopedAccountConfigAccessors,
|
||||
formatTrimmedAllowFromEntries,
|
||||
mapAllowFromEntries,
|
||||
resolveOptionalConfigString,
|
||||
createScopedDmSecurityResolver,
|
||||
formatWhatsAppConfigAllowFromEntries,
|
||||
resolveIMessageConfigAllowFrom,
|
||||
resolveIMessageConfigDefaultTo,
|
||||
resolveWhatsAppConfigAllowFrom,
|
||||
resolveWhatsAppConfigDefaultTo,
|
||||
} from "./channel-config-helpers.js";
|
||||
export {
|
||||
approveDevicePairing,
|
||||
listDevicePairing,
|
||||
rejectDevicePairing,
|
||||
} from "../infra/device-pairing.js";
|
||||
export { createDedupeCache } from "../infra/dedupe.js";
|
||||
export type { DedupeCache } from "../infra/dedupe.js";
|
||||
export { createPersistentDedupe } from "./persistent-dedupe.js";
|
||||
export type {
|
||||
PersistentDedupe,
|
||||
PersistentDedupeCheckOptions,
|
||||
PersistentDedupeOptions,
|
||||
} from "./persistent-dedupe.js";
|
||||
export { formatErrorMessage } from "../infra/errors.js";
|
||||
export { resolveFetch } from "../infra/fetch.js";
|
||||
export {
|
||||
formatUtcTimestamp,
|
||||
formatZonedTimestamp,
|
||||
resolveTimezone,
|
||||
} from "../infra/format-time/format-datetime.js";
|
||||
export {
|
||||
DEFAULT_WEBHOOK_BODY_TIMEOUT_MS,
|
||||
DEFAULT_WEBHOOK_MAX_BODY_BYTES,
|
||||
RequestBodyLimitError,
|
||||
installRequestBodyLimitGuard,
|
||||
isRequestBodyLimitError,
|
||||
readJsonBodyWithLimit,
|
||||
readRequestBodyWithLimit,
|
||||
requestBodyErrorToText,
|
||||
} from "../infra/http-body.js";
|
||||
export {
|
||||
WEBHOOK_ANOMALY_COUNTER_DEFAULTS,
|
||||
WEBHOOK_ANOMALY_STATUS_CODES,
|
||||
WEBHOOK_RATE_LIMIT_DEFAULTS,
|
||||
createBoundedCounter,
|
||||
createFixedWindowRateLimiter,
|
||||
createWebhookAnomalyTracker,
|
||||
} from "./webhook-memory-guards.js";
|
||||
export type {
|
||||
BoundedCounter,
|
||||
FixedWindowRateLimiter,
|
||||
WebhookAnomalyTracker,
|
||||
} from "./webhook-memory-guards.js";
|
||||
|
||||
export { fetchWithSsrFGuard } from "../infra/net/fetch-guard.js";
|
||||
export {
|
||||
SsrFBlockedError,
|
||||
isBlockedHostname,
|
||||
isBlockedHostnameOrIp,
|
||||
isPrivateIpAddress,
|
||||
} from "../infra/net/ssrf.js";
|
||||
export type { LookupFn, SsrFPolicy } from "../infra/net/ssrf.js";
|
||||
export {
|
||||
buildHostnameAllowlistPolicyFromSuffixAllowlist,
|
||||
isHttpsUrlAllowedByHostnameSuffixAllowlist,
|
||||
normalizeHostnameSuffixAllowlist,
|
||||
} from "./ssrf-policy.js";
|
||||
export { fetchWithBearerAuthScopeFallback } from "./fetch-auth.js";
|
||||
export type { ScopeTokenProvider } from "./fetch-auth.js";
|
||||
export { rawDataToString } from "../infra/ws.js";
|
||||
export { isWSLSync, isWSL2Sync, isWSLEnv } from "../infra/wsl.js";
|
||||
export { isTruthyEnvValue } from "../infra/env.js";
|
||||
export { resolveChannelGroupRequireMention, resolveToolsBySender } from "../config/group-policy.js";
|
||||
export {
|
||||
buildPendingHistoryContextFromMap,
|
||||
clearHistoryEntries,
|
||||
clearHistoryEntriesIfEnabled,
|
||||
DEFAULT_GROUP_HISTORY_LIMIT,
|
||||
evictOldHistoryKeys,
|
||||
recordPendingHistoryEntry,
|
||||
recordPendingHistoryEntryIfEnabled,
|
||||
} from "../auto-reply/reply/history.js";
|
||||
export type { HistoryEntry } from "../auto-reply/reply/history.js";
|
||||
export { mergeAllowlist, summarizeMapping } from "../channels/allowlists/resolve-utils.js";
|
||||
export {
|
||||
resolveMentionGating,
|
||||
resolveMentionGatingWithBypass,
|
||||
} from "../channels/mention-gating.js";
|
||||
export type {
|
||||
AckReactionGateParams,
|
||||
AckReactionScope,
|
||||
WhatsAppAckReactionMode,
|
||||
} from "../channels/ack-reactions.js";
|
||||
export {
|
||||
removeAckReactionAfterReply,
|
||||
shouldAckReaction,
|
||||
shouldAckReactionForWhatsApp,
|
||||
} from "../channels/ack-reactions.js";
|
||||
export { createTypingCallbacks } from "../channels/typing.js";
|
||||
export { createReplyPrefixContext, createReplyPrefixOptions } from "../channels/reply-prefix.js";
|
||||
export { logAckFailure, logInboundDrop, logTypingFailure } from "../channels/logging.js";
|
||||
export { resolveChannelMediaMaxBytes } from "../channels/plugins/media-limits.js";
|
||||
export type { NormalizedLocation } from "../channels/location.js";
|
||||
export { formatLocationText, toLocationContext } from "../channels/location.js";
|
||||
export { resolveControlCommandGate } from "../channels/command-gating.js";
|
||||
export {
|
||||
resolveBlueBubblesGroupRequireMention,
|
||||
resolveDiscordGroupRequireMention,
|
||||
resolveGoogleChatGroupRequireMention,
|
||||
resolveIMessageGroupRequireMention,
|
||||
resolveSlackGroupRequireMention,
|
||||
resolveTelegramGroupRequireMention,
|
||||
resolveWhatsAppGroupRequireMention,
|
||||
resolveBlueBubblesGroupToolPolicy,
|
||||
resolveDiscordGroupToolPolicy,
|
||||
resolveGoogleChatGroupToolPolicy,
|
||||
resolveIMessageGroupToolPolicy,
|
||||
resolveSlackGroupToolPolicy,
|
||||
resolveTelegramGroupToolPolicy,
|
||||
resolveWhatsAppGroupToolPolicy,
|
||||
} from "../channels/plugins/group-mentions.js";
|
||||
export { recordInboundSession } from "../channels/session.js";
|
||||
export {
|
||||
buildChannelKeyCandidates,
|
||||
normalizeChannelSlug,
|
||||
resolveChannelEntryMatch,
|
||||
resolveChannelEntryMatchWithFallback,
|
||||
resolveNestedAllowlistDecision,
|
||||
} from "../channels/plugins/channel-config.js";
|
||||
export {
|
||||
listDiscordDirectoryGroupsFromConfig,
|
||||
listDiscordDirectoryPeersFromConfig,
|
||||
listSlackDirectoryGroupsFromConfig,
|
||||
listSlackDirectoryPeersFromConfig,
|
||||
listTelegramDirectoryGroupsFromConfig,
|
||||
listTelegramDirectoryPeersFromConfig,
|
||||
listWhatsAppDirectoryGroupsFromConfig,
|
||||
listWhatsAppDirectoryPeersFromConfig,
|
||||
} from "../channels/plugins/directory-config.js";
|
||||
export type { AllowlistMatch } from "../channels/plugins/allowlist-match.js";
|
||||
export {
|
||||
formatAllowlistMatchMeta,
|
||||
resolveAllowlistMatchSimple,
|
||||
} from "../channels/plugins/allowlist-match.js";
|
||||
export { optionalStringEnum, stringEnum } from "../agents/schema/typebox.js";
|
||||
export type { PollInput } from "../polls.js";
|
||||
|
||||
export { buildChannelConfigSchema } from "../channels/plugins/config-schema.js";
|
||||
export {
|
||||
listDirectoryGroupEntriesFromMapKeys,
|
||||
listDirectoryGroupEntriesFromMapKeysAndAllowFrom,
|
||||
listDirectoryUserEntriesFromAllowFrom,
|
||||
listDirectoryUserEntriesFromAllowFromAndMapKeys,
|
||||
} from "../channels/plugins/directory-config-helpers.js";
|
||||
export {
|
||||
clearAccountEntryFields,
|
||||
deleteAccountFromConfigSection,
|
||||
setAccountEnabledInConfigSection,
|
||||
} from "../channels/plugins/config-helpers.js";
|
||||
export {
|
||||
applyAccountNameToChannelSection,
|
||||
applySetupAccountConfigPatch,
|
||||
migrateBaseNameToDefaultAccount,
|
||||
patchScopedAccountConfig,
|
||||
} from "../channels/plugins/setup-helpers.js";
|
||||
export {
|
||||
buildOpenGroupPolicyConfigureRouteAllowlistWarning,
|
||||
buildOpenGroupPolicyNoRouteAllowlistWarning,
|
||||
buildOpenGroupPolicyRestrictSendersWarning,
|
||||
buildOpenGroupPolicyWarning,
|
||||
collectAllowlistProviderGroupPolicyWarnings,
|
||||
collectAllowlistProviderRestrictSendersWarnings,
|
||||
collectOpenProviderGroupPolicyWarnings,
|
||||
collectOpenGroupPolicyConfiguredRouteWarnings,
|
||||
collectOpenGroupPolicyRestrictSendersWarnings,
|
||||
collectOpenGroupPolicyRouteAllowlistWarnings,
|
||||
} from "../channels/plugins/group-policy-warnings.js";
|
||||
export {
|
||||
buildAccountScopedDmSecurityPolicy,
|
||||
formatPairingApproveHint,
|
||||
} from "../channels/plugins/helpers.js";
|
||||
export { PAIRING_APPROVED_MESSAGE } from "../channels/plugins/pairing-message.js";
|
||||
|
||||
export {
|
||||
createActionGate,
|
||||
jsonResult,
|
||||
readNumberParam,
|
||||
readReactionParams,
|
||||
readStringParam,
|
||||
} from "../agents/tools/common.js";
|
||||
export { formatDocsLink } from "../terminal/links.js";
|
||||
export { formatCliCommand } from "../cli/command-format.js";
|
||||
export {
|
||||
DM_GROUP_ACCESS_REASON,
|
||||
readStoreAllowFromForDmPolicy,
|
||||
resolveDmAllowState,
|
||||
resolveDmGroupAccessDecision,
|
||||
resolveDmGroupAccessWithCommandGate,
|
||||
resolveDmGroupAccessWithLists,
|
||||
resolveEffectiveAllowFromLists,
|
||||
} from "../security/dm-policy-shared.js";
|
||||
export type { DmGroupAccessReasonCode } from "../security/dm-policy-shared.js";
|
||||
export type { HookEntry } from "../hooks/types.js";
|
||||
export {
|
||||
clamp,
|
||||
escapeRegExp,
|
||||
isRecord,
|
||||
normalizeE164,
|
||||
pathExists,
|
||||
resolveUserPath,
|
||||
safeParseJson,
|
||||
sleep,
|
||||
} from "../utils.js";
|
||||
export { fetchWithTimeout } from "../utils/fetch-timeout.js";
|
||||
export {
|
||||
DEFAULT_SECRET_FILE_MAX_BYTES,
|
||||
loadSecretFileSync,
|
||||
readSecretFileSync,
|
||||
tryReadSecretFileSync,
|
||||
} from "../infra/secret-file.js";
|
||||
export { stripAnsi } from "../terminal/ansi.js";
|
||||
export { missingTargetError } from "../infra/outbound/target-errors.js";
|
||||
export { registerLogTransport } from "../logging/logger.js";
|
||||
export type { LogTransport, LogTransportRecord } from "../logging/logger.js";
|
||||
export {
|
||||
emitDiagnosticEvent,
|
||||
isDiagnosticsEnabled,
|
||||
onDiagnosticEvent,
|
||||
} from "../infra/diagnostic-events.js";
|
||||
export type {
|
||||
DiagnosticEventPayload,
|
||||
DiagnosticHeartbeatEvent,
|
||||
DiagnosticLaneDequeueEvent,
|
||||
DiagnosticLaneEnqueueEvent,
|
||||
DiagnosticMessageProcessedEvent,
|
||||
DiagnosticMessageQueuedEvent,
|
||||
DiagnosticRunAttemptEvent,
|
||||
DiagnosticSessionState,
|
||||
DiagnosticSessionStateEvent,
|
||||
DiagnosticSessionStuckEvent,
|
||||
DiagnosticUsageEvent,
|
||||
DiagnosticWebhookErrorEvent,
|
||||
DiagnosticWebhookProcessedEvent,
|
||||
DiagnosticWebhookReceivedEvent,
|
||||
} from "../infra/diagnostic-events.js";
|
||||
export { loadConfig } from "../config/config.js";
|
||||
export { runCommandWithTimeout } from "../process/exec.js";
|
||||
export { detectMime, extensionForMime, getFileExtension } from "../media/mime.js";
|
||||
export { extractOriginalFilename } from "../media/store.js";
|
||||
export { listSkillCommandsForAgents } from "../auto-reply/skill-commands.js";
|
||||
export type { SkillCommandSpec } from "../agents/skills.js";
|
||||
export type { ReplyPayload } from "../auto-reply/types.js";
|
||||
export type { WizardPrompter } from "../wizard/prompts.js";
|
||||
|
||||
// Channel: WhatsApp — WhatsApp-specific exports moved to extensions/whatsapp/src/
|
||||
export { isWhatsAppGroupJid, normalizeWhatsAppTarget } from "../whatsapp/normalize.js";
|
||||
export { resolveWhatsAppOutboundTarget } from "../whatsapp/resolve-outbound-target.js";
|
||||
|
||||
// Channel: BlueBubbles
|
||||
export { collectBlueBubblesStatusIssues } from "../channels/plugins/status-issues/bluebubbles.js";
|
||||
|
||||
// Channel: LINE
|
||||
export {
|
||||
listLineAccountIds,
|
||||
lineSetupAdapter,
|
||||
lineSetupWizard,
|
||||
normalizeAccountId as normalizeLineAccountId,
|
||||
resolveDefaultLineAccountId,
|
||||
resolveLineAccount,
|
||||
LineConfigSchema,
|
||||
} from "./line.js";
|
||||
export type {
|
||||
LineConfig,
|
||||
LineAccountConfig,
|
||||
ResolvedLineAccount,
|
||||
LineChannelData,
|
||||
} from "../line/types.js";
|
||||
export {
|
||||
createInfoCard,
|
||||
createListCard,
|
||||
createImageCard,
|
||||
createActionCard,
|
||||
createReceiptCard,
|
||||
type CardAction,
|
||||
type ListItem,
|
||||
} from "../line/flex-templates.js";
|
||||
export {
|
||||
processLineMessage,
|
||||
hasMarkdownToConvert,
|
||||
stripMarkdown,
|
||||
} from "../line/markdown-to-line.js";
|
||||
export type { ProcessedLineMessage } from "../line/markdown-to-line.js";
|
||||
|
||||
// Media utilities
|
||||
export { loadWebMedia, type WebMediaResult } from "./web-media.js";
|
||||
|
||||
// Context engine
|
||||
export type {
|
||||
ContextEngine,
|
||||
ContextEngineInfo,
|
||||
AssembleResult,
|
||||
CompactResult,
|
||||
IngestResult,
|
||||
IngestBatchResult,
|
||||
BootstrapResult,
|
||||
SubagentSpawnPreparation,
|
||||
SubagentEndReason,
|
||||
} from "../context-engine/types.js";
|
||||
export { registerContextEngine } from "../context-engine/registry.js";
|
||||
export type { ContextEngineFactory } from "../context-engine/registry.js";
|
||||
|
||||
// Model authentication types for plugins.
|
||||
// Plugins should use runtime.modelAuth (which strips unsafe overrides like
|
||||
// agentDir/store) rather than importing raw helpers directly.
|
||||
export { requireApiKey } from "../agents/model-auth.js";
|
||||
export type { ResolvedProviderAuth } from "../agents/model-auth.js";
|
||||
export type {
|
||||
ProviderCatalogContext,
|
||||
ProviderCatalogResult,
|
||||
ProviderDiscoveryContext,
|
||||
} from "../plugins/types.js";
|
||||
export {
|
||||
applyProviderDefaultModel,
|
||||
promptAndConfigureOpenAICompatibleSelfHostedProvider,
|
||||
SELF_HOSTED_DEFAULT_CONTEXT_WINDOW,
|
||||
SELF_HOSTED_DEFAULT_COST,
|
||||
SELF_HOSTED_DEFAULT_MAX_TOKENS,
|
||||
} from "../plugins/provider-self-hosted-setup.js";
|
||||
export {
|
||||
OLLAMA_DEFAULT_BASE_URL,
|
||||
OLLAMA_DEFAULT_MODEL,
|
||||
configureOllamaNonInteractive,
|
||||
ensureOllamaModelPulled,
|
||||
promptAndConfigureOllama,
|
||||
} from "../plugins/provider-ollama-setup.js";
|
||||
export {
|
||||
VLLM_DEFAULT_BASE_URL,
|
||||
VLLM_DEFAULT_CONTEXT_WINDOW,
|
||||
VLLM_DEFAULT_COST,
|
||||
VLLM_DEFAULT_MAX_TOKENS,
|
||||
promptAndConfigureVllm,
|
||||
} from "../plugins/provider-vllm-setup.js";
|
||||
export {
|
||||
buildOllamaProvider,
|
||||
buildSglangProvider,
|
||||
buildVllmProvider,
|
||||
} from "../agents/models-config.providers.discovery.js";
|
||||
|
||||
// Security utilities
|
||||
export { redactSensitiveText } from "../logging/redact.js";
|
||||
export { emptyPluginConfigSchema } from "../plugins/config-schema.js";
|
||||
|
||||
@@ -4,6 +4,7 @@ export type { OpenClawConfig } from "../config/config.js";
|
||||
export type { SecretInput } from "../config/types.secrets.js";
|
||||
export type { ProviderAuthResult } from "../plugins/types.js";
|
||||
export type { AuthProfileStore, OAuthCredential } from "../agents/auth-profiles/types.js";
|
||||
export { buildOauthProviderAuthResult } from "./provider-auth-result.js";
|
||||
|
||||
export {
|
||||
CLAUDE_CLI_PROFILE_ID,
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
// Public model/catalog helpers for provider plugins.
|
||||
|
||||
export type {
|
||||
ModelApi,
|
||||
ModelDefinitionConfig,
|
||||
ModelProviderConfig,
|
||||
} from "../config/types.models.js";
|
||||
import type { ModelDefinitionConfig } from "../config/types.models.js";
|
||||
import {
|
||||
KILOCODE_DEFAULT_CONTEXT_WINDOW,
|
||||
KILOCODE_DEFAULT_COST,
|
||||
KILOCODE_DEFAULT_MAX_TOKENS,
|
||||
KILOCODE_DEFAULT_MODEL_ID,
|
||||
KILOCODE_DEFAULT_MODEL_NAME,
|
||||
} from "../providers/kilocode-shared.js";
|
||||
|
||||
export type { ModelApi, ModelProviderConfig } from "../config/types.models.js";
|
||||
export type { ModelDefinitionConfig } from "../config/types.models.js";
|
||||
export type { ProviderPlugin } from "../plugins/types.js";
|
||||
|
||||
export { DEFAULT_CONTEXT_TOKENS } from "../agents/defaults.js";
|
||||
@@ -19,8 +25,48 @@ export { applyOpenAIConfig, OPENAI_DEFAULT_MODEL } from "../plugins/provider-mod
|
||||
export { OPENCODE_GO_DEFAULT_MODEL_REF } from "../plugins/provider-model-defaults.js";
|
||||
export { OPENCODE_ZEN_DEFAULT_MODEL } from "../plugins/provider-model-defaults.js";
|
||||
export { OPENCODE_ZEN_DEFAULT_MODEL_REF } from "../agents/opencode-zen-models.js";
|
||||
|
||||
export * from "../plugins/provider-model-definitions.js";
|
||||
export {
|
||||
buildMinimaxApiModelDefinition,
|
||||
DEFAULT_MINIMAX_BASE_URL,
|
||||
MINIMAX_API_BASE_URL,
|
||||
MINIMAX_CN_API_BASE_URL,
|
||||
MINIMAX_HOSTED_COST,
|
||||
MINIMAX_HOSTED_MODEL_ID,
|
||||
MINIMAX_HOSTED_MODEL_REF,
|
||||
MINIMAX_LM_STUDIO_COST,
|
||||
} from "../../extensions/minimax/model-definitions.js";
|
||||
export {
|
||||
buildMistralModelDefinition,
|
||||
MISTRAL_BASE_URL,
|
||||
MISTRAL_DEFAULT_MODEL_ID,
|
||||
MISTRAL_DEFAULT_MODEL_REF,
|
||||
} from "../../extensions/mistral/model-definitions.js";
|
||||
export {
|
||||
buildModelStudioDefaultModelDefinition,
|
||||
buildModelStudioModelDefinition,
|
||||
MODELSTUDIO_CN_BASE_URL,
|
||||
MODELSTUDIO_DEFAULT_MODEL_ID,
|
||||
MODELSTUDIO_DEFAULT_MODEL_REF,
|
||||
MODELSTUDIO_GLOBAL_BASE_URL,
|
||||
} from "../../extensions/modelstudio/model-definitions.js";
|
||||
export { MOONSHOT_BASE_URL } from "../../extensions/moonshot/provider-catalog.js";
|
||||
export { MOONSHOT_CN_BASE_URL } from "../../extensions/moonshot/onboard.js";
|
||||
export {
|
||||
buildXaiModelDefinition,
|
||||
XAI_BASE_URL,
|
||||
XAI_DEFAULT_MODEL_ID,
|
||||
XAI_DEFAULT_MODEL_REF,
|
||||
} from "../../extensions/xai/model-definitions.js";
|
||||
export {
|
||||
buildZaiModelDefinition,
|
||||
resolveZaiBaseUrl,
|
||||
ZAI_CODING_CN_BASE_URL,
|
||||
ZAI_CODING_GLOBAL_BASE_URL,
|
||||
ZAI_CN_BASE_URL,
|
||||
ZAI_DEFAULT_MODEL_ID,
|
||||
ZAI_DEFAULT_MODEL_REF,
|
||||
ZAI_GLOBAL_BASE_URL,
|
||||
} from "../../extensions/zai/model-definitions.js";
|
||||
|
||||
export {
|
||||
buildCloudflareAiGatewayModelDefinition,
|
||||
@@ -84,3 +130,15 @@ export {
|
||||
discoverVercelAiGatewayModels,
|
||||
VERCEL_AI_GATEWAY_BASE_URL,
|
||||
} from "../agents/vercel-ai-gateway.js";
|
||||
|
||||
export function buildKilocodeModelDefinition(): ModelDefinitionConfig {
|
||||
return {
|
||||
id: KILOCODE_DEFAULT_MODEL_ID,
|
||||
name: KILOCODE_DEFAULT_MODEL_NAME,
|
||||
reasoning: true,
|
||||
input: ["text", "image"],
|
||||
cost: KILOCODE_DEFAULT_COST,
|
||||
contextWindow: KILOCODE_DEFAULT_CONTEXT_WINDOW,
|
||||
maxTokens: KILOCODE_DEFAULT_MAX_TOKENS,
|
||||
};
|
||||
}
|
||||
|
||||
14
src/plugin-sdk/reply-history.ts
Normal file
14
src/plugin-sdk/reply-history.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
/** Shared reply-history helpers for plugins that keep short per-thread context windows. */
|
||||
export type { HistoryEntry } from "../auto-reply/reply/history.js";
|
||||
export {
|
||||
DEFAULT_GROUP_HISTORY_LIMIT,
|
||||
buildHistoryContext,
|
||||
buildHistoryContextFromEntries,
|
||||
buildHistoryContextFromMap,
|
||||
buildPendingHistoryContextFromMap,
|
||||
clearHistoryEntries,
|
||||
clearHistoryEntriesIfEnabled,
|
||||
evictOldHistoryKeys,
|
||||
recordPendingHistoryEntry,
|
||||
recordPendingHistoryEntryIfEnabled,
|
||||
} from "../auto-reply/reply/history.js";
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user