mirror of
https://github.com/Heretek-AI/openclaw.git
synced 2026-07-01 01:37:55 -04:00
fix: migrate remaining openclaw/plugin-sdk dynamic imports to @heretek-ai/openclaw/plugin-sdk
Fixed Cannot find module 'openclaw/plugin-sdk/...' errors in extension source and test-harness files by updating dynamic import() type references from 'openclaw/plugin-sdk' to '@heretek-ai/openclaw/plugin-sdk'. Files updated (24 files across discord, slack, telegram, whatsapp, ollama, sglang, twitch, vllm, signal extensions).
This commit is contained in:
@@ -8,8 +8,6 @@ import {
|
||||
type StringSelectMenuInteraction,
|
||||
type UserSelectMenuInteraction,
|
||||
} from "@buape/carbon";
|
||||
import type { APIStringSelectComponent } from "discord-api-types/v10";
|
||||
import { ChannelType } from "discord-api-types/v10";
|
||||
import { createChannelPairingChallengeIssuer } from "@heretek-ai/openclaw/plugin-sdk/channel-pairing";
|
||||
import { resolveCommandAuthorizedFromAuthorizers } from "@heretek-ai/openclaw/plugin-sdk/command-auth";
|
||||
import type { OpenClawConfig } from "@heretek-ai/openclaw/plugin-sdk/config-runtime";
|
||||
@@ -23,6 +21,8 @@ import {
|
||||
resolvePinnedMainDmOwnerFromAllowlist,
|
||||
} from "@heretek-ai/openclaw/plugin-sdk/security-runtime";
|
||||
import { logError } from "@heretek-ai/openclaw/plugin-sdk/text-runtime";
|
||||
import type { APIStringSelectComponent } from "discord-api-types/v10";
|
||||
import { ChannelType } from "discord-api-types/v10";
|
||||
import {
|
||||
createDiscordFormModal,
|
||||
parseDiscordComponentCustomId,
|
||||
@@ -71,7 +71,7 @@ export type AgentComponentContext = {
|
||||
cfg: OpenClawConfig;
|
||||
accountId: string;
|
||||
discordConfig?: DiscordAccountConfig;
|
||||
runtime?: import("openclaw/plugin-sdk/runtime-env").RuntimeEnv;
|
||||
runtime?: import("@heretek-ai/openclaw/plugin-sdk/runtime-env").RuntimeEnv;
|
||||
token?: string;
|
||||
guildEntries?: Record<string, DiscordGuildEntryResolved>;
|
||||
allowFrom?: string[];
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { GatewayIntents, GatewayPlugin } from "@buape/carbon/gateway";
|
||||
import type { APIGatewayBotInfo } from "discord-api-types/v10";
|
||||
import { HttpsProxyAgent } from "https-proxy-agent";
|
||||
import type { DiscordAccountConfig } from "@heretek-ai/openclaw/plugin-sdk/config-runtime";
|
||||
import { danger } from "@heretek-ai/openclaw/plugin-sdk/runtime-env";
|
||||
import type { RuntimeEnv } from "@heretek-ai/openclaw/plugin-sdk/runtime-env";
|
||||
import type { APIGatewayBotInfo } from "discord-api-types/v10";
|
||||
import { HttpsProxyAgent } from "https-proxy-agent";
|
||||
import { ProxyAgent, fetch as undiciFetch } from "undici";
|
||||
import WebSocket from "ws";
|
||||
|
||||
@@ -23,7 +23,7 @@ type DiscordGatewayFetch = (
|
||||
type DiscordGatewayMetadataError = Error & { transient?: boolean };
|
||||
|
||||
export function resolveDiscordGatewayIntents(
|
||||
intentsConfig?: import("openclaw/plugin-sdk/config-runtime").DiscordIntentsConfig,
|
||||
intentsConfig?: import("@heretek-ai/openclaw/plugin-sdk/config-runtime").DiscordIntentsConfig,
|
||||
): number {
|
||||
let intents =
|
||||
GatewayIntents.Guilds |
|
||||
|
||||
@@ -36,9 +36,13 @@ import { isThreadArchived } from "./thread-bindings.discord-api.js";
|
||||
import { closeDiscordThreadSessions } from "./thread-session-close.js";
|
||||
import { normalizeDiscordListenerTimeoutMs, runDiscordTaskWithTimeout } from "./timeouts.js";
|
||||
|
||||
type LoadedConfig = ReturnType<typeof import("openclaw/plugin-sdk/config-runtime").loadConfig>;
|
||||
type RuntimeEnv = import("openclaw/plugin-sdk/runtime-env").RuntimeEnv;
|
||||
type Logger = ReturnType<typeof import("openclaw/plugin-sdk/runtime-env").createSubsystemLogger>;
|
||||
type LoadedConfig = ReturnType<
|
||||
typeof import("@heretek-ai/openclaw/plugin-sdk/config-runtime").loadConfig
|
||||
>;
|
||||
type RuntimeEnv = import("@heretek-ai/openclaw/plugin-sdk/runtime-env").RuntimeEnv;
|
||||
type Logger = ReturnType<
|
||||
typeof import("@heretek-ai/openclaw/plugin-sdk/runtime-env").createSubsystemLogger
|
||||
>;
|
||||
|
||||
export type DiscordMessageEvent = Parameters<MessageCreateListener["handle"]>[0];
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ export function createDiscordPreflightArgs(params: {
|
||||
discordConfig: params.discordConfig,
|
||||
accountId: "default",
|
||||
token: "token",
|
||||
runtime: {} as import("openclaw/plugin-sdk/runtime-env").RuntimeEnv,
|
||||
runtime: {} as import("@heretek-ai/openclaw/plugin-sdk/runtime-env").RuntimeEnv,
|
||||
botUserId: params.botUserId ?? "openclaw-bot",
|
||||
guildHistories: new Map(),
|
||||
historyLimit: 0,
|
||||
|
||||
@@ -12,16 +12,16 @@ export type { DiscordSenderIdentity } from "./sender-identity.js";
|
||||
import type { DiscordThreadChannel } from "./threading.js";
|
||||
|
||||
export type LoadedConfig = ReturnType<
|
||||
typeof import("openclaw/plugin-sdk/config-runtime").loadConfig
|
||||
typeof import("@heretek-ai/openclaw/plugin-sdk/config-runtime").loadConfig
|
||||
>;
|
||||
export type RuntimeEnv = import("openclaw/plugin-sdk/runtime-env").RuntimeEnv;
|
||||
export type RuntimeEnv = import("@heretek-ai/openclaw/plugin-sdk/runtime-env").RuntimeEnv;
|
||||
|
||||
export type DiscordMessageEvent = import("./listeners.js").DiscordMessageEvent;
|
||||
|
||||
type DiscordMessagePreflightSharedFields = {
|
||||
cfg: LoadedConfig;
|
||||
discordConfig: NonNullable<
|
||||
import("openclaw/plugin-sdk/config-runtime").OpenClawConfig["channels"]
|
||||
import("@heretek-ai/openclaw/plugin-sdk/config-runtime").OpenClawConfig["channels"]
|
||||
>["discord"];
|
||||
accountId: string;
|
||||
token: string;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { transcribeFirstAudio as transcribeFirstAudioImpl } from "@heretek-ai/openclaw/plugin-sdk/media-runtime";
|
||||
|
||||
type TranscribeFirstAudio = typeof import("openclaw/plugin-sdk/media-runtime").transcribeFirstAudio;
|
||||
type TranscribeFirstAudio =
|
||||
typeof import("@heretek-ai/openclaw/plugin-sdk/media-runtime").transcribeFirstAudio;
|
||||
|
||||
export async function transcribeFirstAudio(
|
||||
...args: Parameters<TranscribeFirstAudio>
|
||||
|
||||
@@ -10,7 +10,6 @@ import {
|
||||
} from "@buape/carbon";
|
||||
import { GatewayCloseCodes, type GatewayPlugin } from "@buape/carbon/gateway";
|
||||
import { VoicePlugin } from "@buape/carbon/voice";
|
||||
import { Routes } from "discord-api-types/v10";
|
||||
import {
|
||||
listNativeCommandSpecsForConfig,
|
||||
listSkillCommandsForAgents,
|
||||
@@ -42,8 +41,12 @@ import {
|
||||
warn,
|
||||
} from "@heretek-ai/openclaw/plugin-sdk/runtime-env";
|
||||
import { createSubsystemLogger } from "@heretek-ai/openclaw/plugin-sdk/runtime-env";
|
||||
import { createNonExitingRuntime, type RuntimeEnv } from "@heretek-ai/openclaw/plugin-sdk/runtime-env";
|
||||
import {
|
||||
createNonExitingRuntime,
|
||||
type RuntimeEnv,
|
||||
} from "@heretek-ai/openclaw/plugin-sdk/runtime-env";
|
||||
import { summarizeStringEntries } from "@heretek-ai/openclaw/plugin-sdk/text-runtime";
|
||||
import { Routes } from "discord-api-types/v10";
|
||||
import { resolveDiscordAccount } from "../accounts.js";
|
||||
import { getDiscordGatewayEmitter } from "../monitor.gateway.js";
|
||||
import { fetchDiscordApplicationId } from "../probe.js";
|
||||
@@ -848,7 +851,7 @@ export async function monitorDiscordProvider(opts: MonitorDiscordOpts = {}) {
|
||||
const logger = createSubsystemLogger("discord/monitor");
|
||||
const guildHistories = new Map<
|
||||
string,
|
||||
import("openclaw/plugin-sdk/reply-history").HistoryEntry[]
|
||||
import("@heretek-ai/openclaw/plugin-sdk/reply-history").HistoryEntry[]
|
||||
>();
|
||||
let botUserId: string | undefined;
|
||||
let botUserName: string | undefined;
|
||||
|
||||
@@ -6,13 +6,16 @@ import {
|
||||
type ProviderAuthResult,
|
||||
type ProviderDiscoveryContext,
|
||||
} from "@heretek-ai/openclaw/plugin-sdk/plugin-entry";
|
||||
import { OLLAMA_DEFAULT_BASE_URL, resolveOllamaApiBase } from "@heretek-ai/openclaw/plugin-sdk/provider-models";
|
||||
import {
|
||||
OLLAMA_DEFAULT_BASE_URL,
|
||||
resolveOllamaApiBase,
|
||||
} from "@heretek-ai/openclaw/plugin-sdk/provider-models";
|
||||
|
||||
const PROVIDER_ID = "ollama";
|
||||
const DEFAULT_API_KEY = "ollama-local";
|
||||
|
||||
async function loadProviderSetup() {
|
||||
return await import("openclaw/plugin-sdk/ollama-setup");
|
||||
return await import("@heretek-ai/openclaw/plugin-sdk/ollama-setup");
|
||||
}
|
||||
|
||||
export default definePluginEntry({
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
const PROVIDER_ID = "sglang";
|
||||
|
||||
async function loadProviderSetup() {
|
||||
return await import("openclaw/plugin-sdk/self-hosted-provider-setup");
|
||||
return await import("@heretek-ai/openclaw/plugin-sdk/self-hosted-provider-setup");
|
||||
}
|
||||
|
||||
export default definePluginEntry({
|
||||
|
||||
@@ -72,9 +72,9 @@ export function createMockSignalDaemonHandle(
|
||||
// Use importActual so shared-worker mocks from earlier test files do not leak
|
||||
// into this harness's partial overrides.
|
||||
vi.mock("openclaw/plugin-sdk/config-runtime", async () => {
|
||||
const actual = await vi.importActual<typeof import("openclaw/plugin-sdk/config-runtime")>(
|
||||
"openclaw/plugin-sdk/config-runtime",
|
||||
);
|
||||
const actual = await vi.importActual<
|
||||
typeof import("@heretek-ai/openclaw/plugin-sdk/config-runtime")
|
||||
>("openclaw/plugin-sdk/config-runtime");
|
||||
return {
|
||||
...actual,
|
||||
loadConfig: () => config,
|
||||
@@ -86,9 +86,9 @@ vi.mock("openclaw/plugin-sdk/config-runtime", async () => {
|
||||
});
|
||||
|
||||
vi.mock("openclaw/plugin-sdk/reply-runtime", async () => {
|
||||
const actual = await vi.importActual<typeof import("openclaw/plugin-sdk/reply-runtime")>(
|
||||
"openclaw/plugin-sdk/reply-runtime",
|
||||
);
|
||||
const actual = await vi.importActual<
|
||||
typeof import("@heretek-ai/openclaw/plugin-sdk/reply-runtime")
|
||||
>("openclaw/plugin-sdk/reply-runtime");
|
||||
return {
|
||||
...actual,
|
||||
getReplyFromConfig: (...args: unknown[]) => replyMock(...args),
|
||||
@@ -124,9 +124,9 @@ vi.mock("./send.js", async () => {
|
||||
});
|
||||
|
||||
vi.mock("openclaw/plugin-sdk/conversation-runtime", async () => {
|
||||
const actual = await vi.importActual<typeof import("openclaw/plugin-sdk/conversation-runtime")>(
|
||||
"openclaw/plugin-sdk/conversation-runtime",
|
||||
);
|
||||
const actual = await vi.importActual<
|
||||
typeof import("@heretek-ai/openclaw/plugin-sdk/conversation-runtime")
|
||||
>("openclaw/plugin-sdk/conversation-runtime");
|
||||
return {
|
||||
...actual,
|
||||
readChannelAllowFromStore: (...args: unknown[]) => readAllowFromStoreMock(...args),
|
||||
@@ -135,9 +135,9 @@ vi.mock("openclaw/plugin-sdk/conversation-runtime", async () => {
|
||||
});
|
||||
|
||||
vi.mock("openclaw/plugin-sdk/security-runtime", async () => {
|
||||
const actual = await vi.importActual<typeof import("openclaw/plugin-sdk/security-runtime")>(
|
||||
"openclaw/plugin-sdk/security-runtime",
|
||||
);
|
||||
const actual = await vi.importActual<
|
||||
typeof import("@heretek-ai/openclaw/plugin-sdk/security-runtime")
|
||||
>("openclaw/plugin-sdk/security-runtime");
|
||||
return {
|
||||
...actual,
|
||||
readStoreAllowFromForDmPolicy: (...args: unknown[]) => readAllowFromStoreMock(...args),
|
||||
@@ -159,9 +159,9 @@ vi.mock("./daemon.js", async () => {
|
||||
});
|
||||
|
||||
vi.mock("openclaw/plugin-sdk/infra-runtime", async () => {
|
||||
const actual = await vi.importActual<typeof import("openclaw/plugin-sdk/infra-runtime")>(
|
||||
"openclaw/plugin-sdk/infra-runtime",
|
||||
);
|
||||
const actual = await vi.importActual<
|
||||
typeof import("@heretek-ai/openclaw/plugin-sdk/infra-runtime")
|
||||
>("openclaw/plugin-sdk/infra-runtime");
|
||||
return {
|
||||
...actual,
|
||||
waitForTransportReady: (...args: unknown[]) => waitForTransportReadyMock(...args),
|
||||
@@ -175,8 +175,8 @@ vi.mock("openclaw/plugin-sdk/infra-runtime", async () => {
|
||||
export function installSignalToolResultTestHooks() {
|
||||
beforeEach(async () => {
|
||||
const [{ resetInboundDedupe }, { resetSystemEventsForTest }] = await Promise.all([
|
||||
import("openclaw/plugin-sdk/reply-runtime"),
|
||||
import("openclaw/plugin-sdk/infra-runtime"),
|
||||
import("@heretek-ai/openclaw/plugin-sdk/reply-runtime"),
|
||||
import("@heretek-ai/openclaw/plugin-sdk/infra-runtime"),
|
||||
]);
|
||||
resetInboundDedupe();
|
||||
config = {
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import type { App } from "@slack/bolt";
|
||||
import { formatAllowlistMatchMeta } from "@heretek-ai/openclaw/plugin-sdk/allow-from";
|
||||
import type {
|
||||
OpenClawConfig,
|
||||
SlackReactionNotificationMode,
|
||||
} from "@heretek-ai/openclaw/plugin-sdk/config-runtime";
|
||||
import { resolveSessionKey, type SessionScope } from "@heretek-ai/openclaw/plugin-sdk/config-runtime";
|
||||
import {
|
||||
resolveSessionKey,
|
||||
type SessionScope,
|
||||
} from "@heretek-ai/openclaw/plugin-sdk/config-runtime";
|
||||
import type { DmPolicy, GroupPolicy } from "@heretek-ai/openclaw/plugin-sdk/config-runtime";
|
||||
import { createDedupeCache } from "@heretek-ai/openclaw/plugin-sdk/infra-runtime";
|
||||
import type { HistoryEntry } from "@heretek-ai/openclaw/plugin-sdk/reply-history";
|
||||
@@ -12,6 +14,7 @@ import { resolveAgentRoute } from "@heretek-ai/openclaw/plugin-sdk/routing";
|
||||
import { logVerbose } from "@heretek-ai/openclaw/plugin-sdk/runtime-env";
|
||||
import { getChildLogger } from "@heretek-ai/openclaw/plugin-sdk/runtime-env";
|
||||
import type { RuntimeEnv } from "@heretek-ai/openclaw/plugin-sdk/runtime-env";
|
||||
import type { App } from "@slack/bolt";
|
||||
import type { SlackMessageEvent } from "../types.js";
|
||||
import { normalizeAllowList, normalizeAllowListLower, normalizeSlackSlug } from "./allow-list.js";
|
||||
import type { SlackChannelConfigEntries } from "./channel-config.js";
|
||||
@@ -53,7 +56,9 @@ export type SlackMonitorContext = {
|
||||
replyToMode: "off" | "first" | "all";
|
||||
threadHistoryScope: "thread" | "channel";
|
||||
threadInheritParent: boolean;
|
||||
slashCommand: Required<import("openclaw/plugin-sdk/config-runtime").SlackSlashCommandConfig>;
|
||||
slashCommand: Required<
|
||||
import("@heretek-ai/openclaw/plugin-sdk/config-runtime").SlackSlashCommandConfig
|
||||
>;
|
||||
textLimit: number;
|
||||
ackReactionScope: string;
|
||||
typingReaction: string;
|
||||
|
||||
@@ -30,7 +30,7 @@ export async function resolveSlackThreadContextData(params: {
|
||||
storePath: string;
|
||||
sessionKey: string;
|
||||
envelopeOptions: ReturnType<
|
||||
typeof import("openclaw/plugin-sdk/channel-inbound").resolveEnvelopeFormatOptions
|
||||
typeof import("@heretek-ai/openclaw/plugin-sdk/channel-inbound").resolveEnvelopeFormatOptions
|
||||
>;
|
||||
effectiveDirectMedia: SlackMediaResult[] | null;
|
||||
}): Promise<SlackThreadContextData> {
|
||||
|
||||
@@ -7,14 +7,15 @@ import {
|
||||
} from "@heretek-ai/openclaw/plugin-sdk/command-auth";
|
||||
|
||||
type BuildCommandTextFromArgs =
|
||||
typeof import("openclaw/plugin-sdk/command-auth").buildCommandTextFromArgs;
|
||||
typeof import("@heretek-ai/openclaw/plugin-sdk/command-auth").buildCommandTextFromArgs;
|
||||
type FindCommandByNativeName =
|
||||
typeof import("openclaw/plugin-sdk/command-auth").findCommandByNativeName;
|
||||
typeof import("@heretek-ai/openclaw/plugin-sdk/command-auth").findCommandByNativeName;
|
||||
type ListNativeCommandSpecsForConfig =
|
||||
typeof import("openclaw/plugin-sdk/command-auth").listNativeCommandSpecsForConfig;
|
||||
type ParseCommandArgs = typeof import("openclaw/plugin-sdk/command-auth").parseCommandArgs;
|
||||
typeof import("@heretek-ai/openclaw/plugin-sdk/command-auth").listNativeCommandSpecsForConfig;
|
||||
type ParseCommandArgs =
|
||||
typeof import("@heretek-ai/openclaw/plugin-sdk/command-auth").parseCommandArgs;
|
||||
type ResolveCommandArgMenu =
|
||||
typeof import("openclaw/plugin-sdk/command-auth").resolveCommandArgMenu;
|
||||
typeof import("@heretek-ai/openclaw/plugin-sdk/command-auth").resolveCommandArgMenu;
|
||||
|
||||
export function buildCommandTextFromArgs(
|
||||
...args: Parameters<BuildCommandTextFromArgs>
|
||||
|
||||
@@ -11,18 +11,19 @@ import {
|
||||
import { resolveAgentRoute as resolveAgentRouteImpl } from "@heretek-ai/openclaw/plugin-sdk/routing";
|
||||
import { deliverSlackSlashReplies as deliverSlackSlashRepliesImpl } from "./replies.js";
|
||||
|
||||
type ResolveChunkMode = typeof import("openclaw/plugin-sdk/reply-runtime").resolveChunkMode;
|
||||
type ResolveChunkMode =
|
||||
typeof import("@heretek-ai/openclaw/plugin-sdk/reply-runtime").resolveChunkMode;
|
||||
type FinalizeInboundContext =
|
||||
typeof import("openclaw/plugin-sdk/reply-runtime").finalizeInboundContext;
|
||||
typeof import("@heretek-ai/openclaw/plugin-sdk/reply-runtime").finalizeInboundContext;
|
||||
type DispatchReplyWithDispatcher =
|
||||
typeof import("openclaw/plugin-sdk/reply-runtime").dispatchReplyWithDispatcher;
|
||||
typeof import("@heretek-ai/openclaw/plugin-sdk/reply-runtime").dispatchReplyWithDispatcher;
|
||||
type ResolveConversationLabel =
|
||||
typeof import("openclaw/plugin-sdk/conversation-runtime").resolveConversationLabel;
|
||||
typeof import("@heretek-ai/openclaw/plugin-sdk/conversation-runtime").resolveConversationLabel;
|
||||
type RecordInboundSessionMetaSafe =
|
||||
typeof import("openclaw/plugin-sdk/conversation-runtime").recordInboundSessionMetaSafe;
|
||||
typeof import("@heretek-ai/openclaw/plugin-sdk/conversation-runtime").recordInboundSessionMetaSafe;
|
||||
type ResolveMarkdownTableMode =
|
||||
typeof import("openclaw/plugin-sdk/config-runtime").resolveMarkdownTableMode;
|
||||
type ResolveAgentRoute = typeof import("openclaw/plugin-sdk/routing").resolveAgentRoute;
|
||||
typeof import("@heretek-ai/openclaw/plugin-sdk/config-runtime").resolveMarkdownTableMode;
|
||||
type ResolveAgentRoute = typeof import("@heretek-ai/openclaw/plugin-sdk/routing").resolveAgentRoute;
|
||||
type DeliverSlackSlashReplies = typeof import("./replies.js").deliverSlackSlashReplies;
|
||||
|
||||
export function resolveChunkMode(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { listSkillCommandsForAgents as listSkillCommandsForAgentsImpl } from "@heretek-ai/openclaw/plugin-sdk/command-auth";
|
||||
|
||||
type ListSkillCommandsForAgents =
|
||||
typeof import("openclaw/plugin-sdk/command-auth").listSkillCommandsForAgents;
|
||||
typeof import("@heretek-ai/openclaw/plugin-sdk/command-auth").listSkillCommandsForAgents;
|
||||
|
||||
export function listSkillCommandsForAgents(
|
||||
...args: Parameters<ListSkillCommandsForAgents>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import type { Bot } from "grammy";
|
||||
import type { OpenClawConfig } from "@heretek-ai/openclaw/plugin-sdk/config-runtime";
|
||||
import type {
|
||||
DmPolicy,
|
||||
@@ -7,6 +6,7 @@ import type {
|
||||
TelegramTopicConfig,
|
||||
} from "@heretek-ai/openclaw/plugin-sdk/config-runtime";
|
||||
import type { HistoryEntry } from "@heretek-ai/openclaw/plugin-sdk/reply-history";
|
||||
import type { Bot } from "grammy";
|
||||
import type { StickerMetadata, TelegramContext } from "./bot/types.js";
|
||||
|
||||
export type TelegramMediaRef = {
|
||||
@@ -63,7 +63,7 @@ export type BuildTelegramMessageContextParams = {
|
||||
resolveGroupRequireMention: ResolveGroupRequireMention;
|
||||
resolveTelegramGroupConfig: ResolveTelegramGroupConfig;
|
||||
loadFreshConfig?: () => OpenClawConfig;
|
||||
upsertPairingRequest?: typeof import("openclaw/plugin-sdk/conversation-runtime").upsertChannelPairingRequest;
|
||||
upsertPairingRequest?: typeof import("@heretek-ai/openclaw/plugin-sdk/conversation-runtime").upsertChannelPairingRequest;
|
||||
/** Global (per-account) handler for sendChatAction 401 backoff (#27092). */
|
||||
sendChatActionHandler: import("./sendchataction-401-backoff.js").TelegramSendChatActionHandler;
|
||||
};
|
||||
|
||||
@@ -12,17 +12,18 @@ import type { RegisterTelegramNativeCommandsParams } from "./bot-native-commands
|
||||
import { registerTelegramNativeCommands } from "./bot-native-commands.js";
|
||||
|
||||
type GetPluginCommandSpecsFn =
|
||||
typeof import("openclaw/plugin-sdk/plugin-runtime").getPluginCommandSpecs;
|
||||
type MatchPluginCommandFn = typeof import("openclaw/plugin-sdk/plugin-runtime").matchPluginCommand;
|
||||
typeof import("@heretek-ai/openclaw/plugin-sdk/plugin-runtime").getPluginCommandSpecs;
|
||||
type MatchPluginCommandFn =
|
||||
typeof import("@heretek-ai/openclaw/plugin-sdk/plugin-runtime").matchPluginCommand;
|
||||
type ExecutePluginCommandFn =
|
||||
typeof import("openclaw/plugin-sdk/plugin-runtime").executePluginCommand;
|
||||
typeof import("@heretek-ai/openclaw/plugin-sdk/plugin-runtime").executePluginCommand;
|
||||
type DispatchReplyWithBufferedBlockDispatcherFn =
|
||||
typeof import("openclaw/plugin-sdk/reply-runtime").dispatchReplyWithBufferedBlockDispatcher;
|
||||
typeof import("@heretek-ai/openclaw/plugin-sdk/reply-runtime").dispatchReplyWithBufferedBlockDispatcher;
|
||||
type DispatchReplyWithBufferedBlockDispatcherResult = Awaited<
|
||||
ReturnType<DispatchReplyWithBufferedBlockDispatcherFn>
|
||||
>;
|
||||
type RecordInboundSessionMetaSafeFn =
|
||||
typeof import("openclaw/plugin-sdk/conversation-runtime").recordInboundSessionMetaSafe;
|
||||
typeof import("@heretek-ai/openclaw/plugin-sdk/conversation-runtime").recordInboundSessionMetaSafe;
|
||||
type AnyMock = MockFn<(...args: unknown[]) => unknown>;
|
||||
type AnyAsyncMock = MockFn<(...args: unknown[]) => Promise<unknown>>;
|
||||
type NativeCommandHarness = {
|
||||
@@ -66,7 +67,8 @@ export const dispatchReplyWithBufferedBlockDispatcher =
|
||||
replyPipelineMocks.dispatchReplyWithBufferedBlockDispatcher;
|
||||
|
||||
vi.mock("openclaw/plugin-sdk/reply-runtime", async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import("openclaw/plugin-sdk/reply-runtime")>();
|
||||
const actual =
|
||||
await importOriginal<typeof import("@heretek-ai/openclaw/plugin-sdk/reply-runtime")>();
|
||||
return {
|
||||
...actual,
|
||||
finalizeInboundContext: replyPipelineMocks.finalizeInboundContext,
|
||||
@@ -75,7 +77,8 @@ vi.mock("openclaw/plugin-sdk/reply-runtime", async (importOriginal) => {
|
||||
};
|
||||
});
|
||||
vi.mock("openclaw/plugin-sdk/conversation-runtime", async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import("openclaw/plugin-sdk/conversation-runtime")>();
|
||||
const actual =
|
||||
await importOriginal<typeof import("@heretek-ai/openclaw/plugin-sdk/conversation-runtime")>();
|
||||
return {
|
||||
...actual,
|
||||
recordInboundSessionMetaSafe: replyPipelineMocks.recordInboundSessionMetaSafe,
|
||||
@@ -84,7 +87,7 @@ vi.mock("openclaw/plugin-sdk/conversation-runtime", async (importOriginal) => {
|
||||
});
|
||||
vi.mock("openclaw/plugin-sdk/channel-reply-pipeline", async (importOriginal) => {
|
||||
const actual =
|
||||
await importOriginal<typeof import("openclaw/plugin-sdk/channel-reply-pipeline")>();
|
||||
await importOriginal<typeof import("@heretek-ai/openclaw/plugin-sdk/channel-reply-pipeline")>();
|
||||
return {
|
||||
...actual,
|
||||
createChannelReplyPipeline: replyPipelineMocks.createChannelReplyPipeline,
|
||||
|
||||
@@ -10,13 +10,14 @@ import type { TelegramBotDeps } from "./bot-deps.js";
|
||||
|
||||
type AnyMock = ReturnType<typeof vi.fn>;
|
||||
type AnyAsyncMock = ReturnType<typeof vi.fn>;
|
||||
type LoadConfigFn = typeof import("openclaw/plugin-sdk/config-runtime").loadConfig;
|
||||
type ResolveStorePathFn = typeof import("openclaw/plugin-sdk/config-runtime").resolveStorePath;
|
||||
type LoadConfigFn = typeof import("@heretek-ai/openclaw/plugin-sdk/config-runtime").loadConfig;
|
||||
type ResolveStorePathFn =
|
||||
typeof import("@heretek-ai/openclaw/plugin-sdk/config-runtime").resolveStorePath;
|
||||
type TelegramBotRuntimeForTest = NonNullable<
|
||||
Parameters<typeof import("./bot.js").setTelegramBotRuntimeForTest>[0]
|
||||
>;
|
||||
type DispatchReplyWithBufferedBlockDispatcherFn =
|
||||
typeof import("openclaw/plugin-sdk/reply-runtime").dispatchReplyWithBufferedBlockDispatcher;
|
||||
typeof import("@heretek-ai/openclaw/plugin-sdk/reply-runtime").dispatchReplyWithBufferedBlockDispatcher;
|
||||
type DispatchReplyWithBufferedBlockDispatcherResult = Awaited<
|
||||
ReturnType<DispatchReplyWithBufferedBlockDispatcherFn>
|
||||
>;
|
||||
@@ -63,7 +64,8 @@ export function getLoadConfigMock(): AnyMock {
|
||||
return loadConfig;
|
||||
}
|
||||
vi.doMock("openclaw/plugin-sdk/config-runtime", async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import("openclaw/plugin-sdk/config-runtime")>();
|
||||
const actual =
|
||||
await importOriginal<typeof import("@heretek-ai/openclaw/plugin-sdk/config-runtime")>();
|
||||
return {
|
||||
...actual,
|
||||
loadConfig,
|
||||
@@ -93,7 +95,8 @@ export function getUpsertChannelPairingRequestMock(): AnyAsyncMock {
|
||||
}
|
||||
|
||||
vi.doMock("openclaw/plugin-sdk/conversation-runtime", async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import("openclaw/plugin-sdk/conversation-runtime")>();
|
||||
const actual =
|
||||
await importOriginal<typeof import("@heretek-ai/openclaw/plugin-sdk/conversation-runtime")>();
|
||||
return {
|
||||
...actual,
|
||||
readChannelAllowFromStore,
|
||||
@@ -101,7 +104,8 @@ vi.doMock("openclaw/plugin-sdk/conversation-runtime", async (importOriginal) =>
|
||||
};
|
||||
});
|
||||
vi.doMock("openclaw/plugin-sdk/conversation-runtime.js", async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import("openclaw/plugin-sdk/conversation-runtime")>();
|
||||
const actual =
|
||||
await importOriginal<typeof import("@heretek-ai/openclaw/plugin-sdk/conversation-runtime")>();
|
||||
return {
|
||||
...actual,
|
||||
readChannelAllowFromStore,
|
||||
@@ -231,7 +235,8 @@ function createModelsProviderDataFromConfig(cfg: OpenClawConfig): {
|
||||
}
|
||||
|
||||
vi.doMock("openclaw/plugin-sdk/command-auth", async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import("openclaw/plugin-sdk/command-auth")>();
|
||||
const actual =
|
||||
await importOriginal<typeof import("@heretek-ai/openclaw/plugin-sdk/command-auth")>();
|
||||
return {
|
||||
...actual,
|
||||
listSkillCommandsForAgents: skillCommandListHoisted.listSkillCommandsForAgents,
|
||||
@@ -239,7 +244,8 @@ vi.doMock("openclaw/plugin-sdk/command-auth", async (importOriginal) => {
|
||||
};
|
||||
});
|
||||
vi.doMock("openclaw/plugin-sdk/command-auth.js", async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import("openclaw/plugin-sdk/command-auth")>();
|
||||
const actual =
|
||||
await importOriginal<typeof import("@heretek-ai/openclaw/plugin-sdk/command-auth")>();
|
||||
return {
|
||||
...actual,
|
||||
listSkillCommandsForAgents: skillCommandListHoisted.listSkillCommandsForAgents,
|
||||
@@ -247,7 +253,8 @@ vi.doMock("openclaw/plugin-sdk/command-auth.js", async (importOriginal) => {
|
||||
};
|
||||
});
|
||||
vi.doMock("openclaw/plugin-sdk/reply-runtime", async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import("openclaw/plugin-sdk/reply-runtime")>();
|
||||
const actual =
|
||||
await importOriginal<typeof import("@heretek-ai/openclaw/plugin-sdk/reply-runtime")>();
|
||||
return {
|
||||
...actual,
|
||||
getReplyFromConfig: replySpyHoisted.replySpy,
|
||||
@@ -257,7 +264,8 @@ vi.doMock("openclaw/plugin-sdk/reply-runtime", async (importOriginal) => {
|
||||
};
|
||||
});
|
||||
vi.doMock("openclaw/plugin-sdk/reply-runtime.js", async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import("openclaw/plugin-sdk/reply-runtime")>();
|
||||
const actual =
|
||||
await importOriginal<typeof import("@heretek-ai/openclaw/plugin-sdk/reply-runtime")>();
|
||||
return {
|
||||
...actual,
|
||||
getReplyFromConfig: replySpyHoisted.replySpy,
|
||||
@@ -274,7 +282,8 @@ export const enqueueSystemEventSpy: MockFn<TelegramBotDeps["enqueueSystemEvent"]
|
||||
systemEventsHoisted.enqueueSystemEventSpy;
|
||||
|
||||
vi.doMock("openclaw/plugin-sdk/infra-runtime", async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import("openclaw/plugin-sdk/infra-runtime")>();
|
||||
const actual =
|
||||
await importOriginal<typeof import("@heretek-ai/openclaw/plugin-sdk/infra-runtime")>();
|
||||
return {
|
||||
...actual,
|
||||
enqueueSystemEvent: systemEventsHoisted.enqueueSystemEventSpy,
|
||||
|
||||
@@ -9,9 +9,10 @@ type TelegramBotRuntimeForTest = NonNullable<
|
||||
Parameters<typeof import("./bot.js").setTelegramBotRuntimeForTest>[0]
|
||||
>;
|
||||
type DispatchReplyWithBufferedBlockDispatcherFn =
|
||||
typeof import("openclaw/plugin-sdk/reply-runtime").dispatchReplyWithBufferedBlockDispatcher;
|
||||
typeof import("@heretek-ai/openclaw/plugin-sdk/reply-runtime").dispatchReplyWithBufferedBlockDispatcher;
|
||||
type DispatchReplyHarnessParams = Parameters<DispatchReplyWithBufferedBlockDispatcherFn>[0];
|
||||
type FetchRemoteMediaFn = typeof import("openclaw/plugin-sdk/media-runtime").fetchRemoteMedia;
|
||||
type FetchRemoteMediaFn =
|
||||
typeof import("@heretek-ai/openclaw/plugin-sdk/media-runtime").fetchRemoteMedia;
|
||||
|
||||
export const useSpy: Mock = vi.fn();
|
||||
export const middlewareUseSpy: Mock = vi.fn();
|
||||
@@ -185,7 +186,7 @@ vi.mock("undici", async (importOriginal) => {
|
||||
});
|
||||
|
||||
export async function mockMediaRuntimeModuleForTest(
|
||||
importOriginal: () => Promise<typeof import("openclaw/plugin-sdk/media-runtime")>,
|
||||
importOriginal: () => Promise<typeof import("@heretek-ai/openclaw/plugin-sdk/media-runtime")>,
|
||||
) {
|
||||
const actual = await importOriginal();
|
||||
const mockModule = Object.create(null) as Record<string, unknown>;
|
||||
@@ -208,7 +209,8 @@ export async function mockMediaRuntimeModuleForTest(
|
||||
vi.mock("openclaw/plugin-sdk/media-runtime", mockMediaRuntimeModuleForTest);
|
||||
|
||||
vi.doMock("openclaw/plugin-sdk/config-runtime", async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import("openclaw/plugin-sdk/config-runtime")>();
|
||||
const actual =
|
||||
await importOriginal<typeof import("@heretek-ai/openclaw/plugin-sdk/config-runtime")>();
|
||||
return {
|
||||
...actual,
|
||||
loadConfig: telegramBotDepsForTest.loadConfig,
|
||||
@@ -217,7 +219,8 @@ vi.doMock("openclaw/plugin-sdk/config-runtime", async (importOriginal) => {
|
||||
});
|
||||
|
||||
vi.doMock("openclaw/plugin-sdk/agent-runtime", async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import("openclaw/plugin-sdk/agent-runtime")>();
|
||||
const actual =
|
||||
await importOriginal<typeof import("@heretek-ai/openclaw/plugin-sdk/agent-runtime")>();
|
||||
return {
|
||||
...actual,
|
||||
findModelInCatalog: vi.fn(() => undefined),
|
||||
@@ -231,7 +234,8 @@ vi.doMock("openclaw/plugin-sdk/agent-runtime", async (importOriginal) => {
|
||||
});
|
||||
|
||||
vi.doMock("openclaw/plugin-sdk/conversation-runtime", async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import("openclaw/plugin-sdk/conversation-runtime")>();
|
||||
const actual =
|
||||
await importOriginal<typeof import("@heretek-ai/openclaw/plugin-sdk/conversation-runtime")>();
|
||||
return {
|
||||
...actual,
|
||||
readChannelAllowFromStore: telegramBotDepsForTest.readChannelAllowFromStore,
|
||||
@@ -243,7 +247,8 @@ vi.doMock("openclaw/plugin-sdk/conversation-runtime", async (importOriginal) =>
|
||||
});
|
||||
|
||||
vi.doMock("openclaw/plugin-sdk/reply-runtime", async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import("openclaw/plugin-sdk/reply-runtime")>();
|
||||
const actual =
|
||||
await importOriginal<typeof import("@heretek-ai/openclaw/plugin-sdk/reply-runtime")>();
|
||||
return {
|
||||
...actual,
|
||||
getReplyFromConfig: mediaHarnessReplySpy,
|
||||
|
||||
@@ -132,7 +132,7 @@ async function loadTelegramBotHarness() {
|
||||
...opts,
|
||||
telegramDeps: harness.telegramBotDepsForTest,
|
||||
});
|
||||
const replyModule = await import("openclaw/plugin-sdk/reply-runtime");
|
||||
const replyModule = await import("@heretek-ai/openclaw/plugin-sdk/reply-runtime");
|
||||
replySpyRef = (replyModule as unknown as { __replySpy: ReturnType<typeof vi.fn> }).__replySpy;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,8 +4,9 @@ import {
|
||||
} from "@heretek-ai/openclaw/plugin-sdk/media-runtime";
|
||||
|
||||
type DescribeImageWithModel =
|
||||
typeof import("openclaw/plugin-sdk/media-runtime").describeImageWithModel;
|
||||
type TranscribeFirstAudio = typeof import("openclaw/plugin-sdk/media-runtime").transcribeFirstAudio;
|
||||
typeof import("@heretek-ai/openclaw/plugin-sdk/media-runtime").describeImageWithModel;
|
||||
type TranscribeFirstAudio =
|
||||
typeof import("@heretek-ai/openclaw/plugin-sdk/media-runtime").transcribeFirstAudio;
|
||||
|
||||
export async function describeImageWithModel(
|
||||
...args: Parameters<DescribeImageWithModel>
|
||||
|
||||
@@ -128,7 +128,7 @@ export const twitchPlugin: ChannelPlugin<ResolvedTwitchAccount> =
|
||||
accountId?: string | null;
|
||||
inputs: string[];
|
||||
kind: ChannelResolveKind;
|
||||
runtime: import("openclaw/plugin-sdk/runtime-env").RuntimeEnv;
|
||||
runtime: import("@heretek-ai/openclaw/plugin-sdk/runtime-env").RuntimeEnv;
|
||||
}): Promise<ChannelResolveResult[]> => {
|
||||
const account = getAccountConfig(cfg, accountId ?? DEFAULT_ACCOUNT_ID);
|
||||
if (!account) {
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
const PROVIDER_ID = "vllm";
|
||||
|
||||
async function loadProviderSetup() {
|
||||
return await import("openclaw/plugin-sdk/self-hosted-provider-setup");
|
||||
return await import("@heretek-ai/openclaw/plugin-sdk/self-hosted-provider-setup");
|
||||
}
|
||||
|
||||
export default definePluginEntry({
|
||||
|
||||
@@ -26,7 +26,9 @@ export function createWebOnMessageHandler(params: {
|
||||
echoTracker: EchoTracker;
|
||||
backgroundTasks: Set<Promise<unknown>>;
|
||||
replyResolver: typeof getReplyFromConfig;
|
||||
replyLogger: ReturnType<(typeof import("openclaw/plugin-sdk/runtime-env"))["getChildLogger"]>;
|
||||
replyLogger: ReturnType<
|
||||
(typeof import("@heretek-ai/openclaw/plugin-sdk/runtime-env"))["getChildLogger"]
|
||||
>;
|
||||
baseMentionConfig: MentionConfig;
|
||||
account: { authDir?: string; accountId?: string };
|
||||
}) {
|
||||
|
||||
Reference in New Issue
Block a user