fix: avoid telegram plugin self-recursive sdk imports

This commit is contained in:
Peter Steinberger
2026-03-29 11:32:29 +01:00
parent 88ca0b2c3f
commit 270d0c5158
7 changed files with 28 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
import { resolveAccountWithDefaultFallback } from "openclaw/plugin-sdk/account-resolution";
import { resolveAccountWithDefaultFallback } from "openclaw/plugin-sdk/account-core";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
import { coerceSecretRef } from "openclaw/plugin-sdk/config-runtime";
import { tryReadSecretFileSync } from "openclaw/plugin-sdk/core";

View File

@@ -9,7 +9,7 @@ import {
resolveListedDefaultAccountId,
resolveAccountWithDefaultFallback,
type OpenClawConfig,
} from "openclaw/plugin-sdk/account-resolution";
} from "openclaw/plugin-sdk/account-core";
import {
listBoundAccountIds,
resolveDefaultAgentBoundAccountId,

View File

@@ -11,7 +11,7 @@ import {
resolvePollMaxSelections,
type OpenClawConfig,
type TelegramActionConfig,
} from "../runtime-api.js";
} from "openclaw/plugin-sdk/telegram-core";
import { createTelegramActionGate, resolveTelegramPollActionGateState } from "./accounts.js";
import type { TelegramButtonStyle, TelegramInlineButtons } from "./button-types.js";
import { resolveTelegramInlineButtons } from "./button-types.js";

View File

@@ -23,17 +23,17 @@ import {
createComputedAccountStatusAdapter,
createDefaultChannelRuntimeState,
} from "openclaw/plugin-sdk/status-helpers";
import { parseTelegramTopicConversation } from "../runtime-api.js";
import {
buildTokenChannelStatusSummary,
clearAccountEntryFields,
DEFAULT_ACCOUNT_ID,
PAIRING_APPROVED_MESSAGE,
parseTelegramTopicConversation,
projectCredentialSnapshotFields,
resolveConfiguredFromCredentialStatuses,
type ChannelMessageActionAdapter,
type OpenClawConfig,
} from "../runtime-api.js";
} from "openclaw/plugin-sdk/telegram-core";
import {
listTelegramAccountIds,
resolveTelegramAccount,

View File

@@ -1,4 +1,4 @@
import { resolveNormalizedAccountEntry } from "openclaw/plugin-sdk/account-resolution";
import { resolveNormalizedAccountEntry } from "openclaw/plugin-sdk/account-core";
import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
import {
adaptScopedAccountAccessor,
@@ -11,7 +11,7 @@ import {
normalizeAccountId,
type ChannelPlugin,
type OpenClawConfig,
} from "../runtime-api.js";
} from "openclaw/plugin-sdk/telegram-core";
import { inspectTelegramAccount } from "./account-inspect.js";
import {
listTelegramAccountIds,

View File

@@ -1,4 +1,4 @@
import { resolveNormalizedAccountEntry } from "openclaw/plugin-sdk/account-resolution";
import { resolveNormalizedAccountEntry } from "openclaw/plugin-sdk/account-core";
import type { BaseTokenResolution } from "openclaw/plugin-sdk/channel-contract";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
import { tryReadSecretFileSync } from "openclaw/plugin-sdk/core";

View File

@@ -55,6 +55,26 @@ const SAME_CHANNEL_SDK_GUARDS: GuardedSource[] = [
path: bundledPluginFile("telegram", "src/shared.ts"),
forbiddenPatterns: [/["']openclaw\/plugin-sdk\/telegram["']/, /plugin-sdk-internal\/telegram/],
},
{
path: bundledPluginFile("telegram", "src/account-inspect.ts"),
forbiddenPatterns: [/["']openclaw\/plugin-sdk\/account-resolution["']/],
},
{
path: bundledPluginFile("telegram", "src/accounts.ts"),
forbiddenPatterns: [/["']openclaw\/plugin-sdk\/account-resolution["']/],
},
{
path: bundledPluginFile("telegram", "src/token.ts"),
forbiddenPatterns: [/["']openclaw\/plugin-sdk\/account-resolution["']/],
},
{
path: bundledPluginFile("telegram", "src/channel.ts"),
forbiddenPatterns: [/["']\.\.\/runtime-api\.js["']/],
},
{
path: bundledPluginFile("telegram", "src/action-runtime.ts"),
forbiddenPatterns: [/["']\.\.\/runtime-api\.js["']/],
},
{
path: bundledPluginFile("imessage", "src/shared.ts"),
forbiddenPatterns: [/["']openclaw\/plugin-sdk\/imessage["']/, /plugin-sdk-internal\/imessage/],