mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-28 05:16:23 -06:00
improve(telegram): cut cold channel setup import latency (#122955)
* perf(telegram): keep setup entry on light graph * fix(plugin-sdk): complete private UI hint boundaries
This commit is contained in:
committed by
GitHub
parent
7235943790
commit
ccc1920068
@@ -0,0 +1,57 @@
|
||||
// Telegram plugin module composes the setup-safe channel surface.
|
||||
import type { ChannelPlugin } from "openclaw/plugin-sdk/channel-core";
|
||||
import { getChatChannelMeta } from "openclaw/plugin-sdk/channel-plugin-common";
|
||||
import type { ResolvedTelegramAccount } from "./accounts.js";
|
||||
import { createTelegramPluginConfig } from "./config-adapter.js";
|
||||
import { TelegramChannelConfigSchema } from "./config-schema.js";
|
||||
import { collectRuntimeConfigAssignments, secretTargetRegistryEntries } from "./secret-contract.js";
|
||||
|
||||
const TELEGRAM_CHANNEL = "telegram" as const;
|
||||
|
||||
export function createTelegramSetupPluginBase(params: {
|
||||
setupWizard: NonNullable<ChannelPlugin<ResolvedTelegramAccount>["setupWizard"]>;
|
||||
setupContract: NonNullable<ChannelPlugin<ResolvedTelegramAccount>["setupContract"]>;
|
||||
}): Pick<
|
||||
ChannelPlugin<ResolvedTelegramAccount>,
|
||||
| "id"
|
||||
| "meta"
|
||||
| "setupWizard"
|
||||
| "capabilities"
|
||||
| "reload"
|
||||
| "configSchema"
|
||||
| "config"
|
||||
| "setupContract"
|
||||
| "secrets"
|
||||
> {
|
||||
return {
|
||||
id: TELEGRAM_CHANNEL,
|
||||
setupContract: params.setupContract,
|
||||
meta: {
|
||||
...getChatChannelMeta(TELEGRAM_CHANNEL),
|
||||
quickstartAllowFrom: true,
|
||||
},
|
||||
setupWizard: params.setupWizard,
|
||||
capabilities: {
|
||||
chatTypes: ["direct", "group", "channel", "thread"],
|
||||
reactions: true,
|
||||
threads: true,
|
||||
media: true,
|
||||
tts: {
|
||||
voice: {
|
||||
synthesisTarget: "voice-note",
|
||||
captionedFinalText: true,
|
||||
},
|
||||
},
|
||||
polls: true,
|
||||
nativeCommands: true,
|
||||
blockStreaming: true,
|
||||
},
|
||||
reload: { configPrefixes: ["channels.telegram"] },
|
||||
configSchema: TelegramChannelConfigSchema,
|
||||
config: createTelegramPluginConfig(),
|
||||
secrets: {
|
||||
secretTargetRegistryEntries,
|
||||
collectRuntimeConfigAssignments,
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user