test(ci): reduce channel contract import cost

This commit is contained in:
Peter Steinberger
2026-04-21 00:39:21 +01:00
parent 92191d37e6
commit 982b1c9464
33 changed files with 127 additions and 60 deletions

View File

@@ -0,0 +1 @@
export { feishuPlugin } from "./src/channel.js";

View File

@@ -67,7 +67,7 @@ export default defineBundledChannelEntry({
description: "Feishu/Lark channel plugin",
importMetaUrl: import.meta.url,
plugin: {
specifier: "./api.js",
specifier: "./channel-plugin-api.js",
exportName: "feishuPlugin",
},
secrets: {

View File

@@ -49,7 +49,6 @@ import {
DEFAULT_ACCOUNT_ID,
PAIRING_APPROVED_MESSAGE,
} from "./channel-runtime-api.js";
import { createFeishuClient } from "./client.js";
import { isRecord } from "./comment-shared.js";
import { FeishuConfigSchema } from "./config-schema.js";
import {
@@ -119,6 +118,11 @@ const loadFeishuChannelRuntime = createLazyRuntimeNamedExport(
"feishuChannelRuntime",
);
async function createFeishuActionClient(account: ResolvedFeishuAccount) {
const { createFeishuClient } = await import("./client.js");
return createFeishuClient(account);
}
const collectFeishuSecurityWarnings = createAllowlistProviderGroupPolicyWarningCollector<{
cfg: ClawdbotConfig;
accountId?: string | null;
@@ -841,7 +845,7 @@ export const feishuPlugin: ChannelPlugin<ResolvedFeishuAccount, FeishuProbeResul
throw new Error("Feishu channel-info requires chatId or channelId.");
}
const runtime = await loadFeishuChannelRuntime();
const client = createFeishuClient(account);
const client = await createFeishuActionClient(account);
const channel = await runtime.getChatInfo(client, chatId);
const includeMembers =
ctx.params.includeMembers === true || ctx.params.members === true;
@@ -871,7 +875,7 @@ export const feishuPlugin: ChannelPlugin<ResolvedFeishuAccount, FeishuProbeResul
if (ctx.action === "member-info") {
const runtime = await loadFeishuChannelRuntime();
const client = createFeishuClient(account);
const client = await createFeishuActionClient(account);
const memberId = resolveFeishuMemberId(ctx.params);
if (memberId) {
const member = await runtime.getFeishuMemberInfo(

View File

@@ -13,15 +13,7 @@ import {
type SecretInput,
} from "openclaw/plugin-sdk/setup";
import { inspectFeishuCredentials, resolveDefaultFeishuAccountId } from "./accounts.js";
import {
beginAppRegistration,
getAppOwnerOpenId,
initAppRegistration,
pollAppRegistration,
printQrCode,
type AppRegistrationResult,
} from "./app-registration.js";
import { probeFeishu } from "./probe.js";
import type { AppRegistrationResult } from "./app-registration.js";
import type { FeishuConfig, FeishuDomain } from "./types.js";
const channel = "feishu" as const;
@@ -254,6 +246,8 @@ function applyNewAppSecurityPolicy(
// ---------------------------------------------------------------------------
async function runScanToCreate(prompter: WizardPrompter): Promise<AppRegistrationResult | null> {
const { beginAppRegistration, initAppRegistration, pollAppRegistration, printQrCode } =
await import("./app-registration.js");
try {
await initAppRegistration("feishu");
} catch {
@@ -371,6 +365,7 @@ async function runNewAppFlow(params: {
// Fetch openId via API for manual flow.
if (appId && appSecretProbeValue) {
const { getAppOwnerOpenId } = await import("./app-registration.js");
scanOpenId = await getAppOwnerOpenId({
appId,
appSecret: appSecretProbeValue,
@@ -528,6 +523,7 @@ export const feishuSetupWizard: ChannelSetupWizard = {
let probeResult = null;
if (configured && resolvedCredentials) {
try {
const { probeFeishu } = await import("./probe.js");
probeResult = await probeFeishu(resolvedCredentials);
} catch {}
}

View File

@@ -0,0 +1 @@
export { googlechatPlugin } from "./src/channel.js";

View File

@@ -6,7 +6,7 @@ export default defineBundledChannelEntry({
description: "OpenClaw Google Chat channel plugin",
importMetaUrl: import.meta.url,
plugin: {
specifier: "./api.js",
specifier: "./channel-plugin-api.js",
exportName: "googlechatPlugin",
},
secrets: {

View File

@@ -0,0 +1 @@
export { imessagePlugin } from "./src/channel.js";

View File

@@ -6,7 +6,7 @@ export default defineBundledChannelEntry({
description: "iMessage channel plugin",
importMetaUrl: import.meta.url,
plugin: {
specifier: "./api.js",
specifier: "./channel-plugin-api.js",
exportName: "imessagePlugin",
},
runtime: {

View File

@@ -0,0 +1 @@
export { linePlugin } from "./src/channel.js";

View File

@@ -31,7 +31,7 @@ export default defineBundledChannelEntry({
description: "LINE Messaging API channel plugin",
importMetaUrl: import.meta.url,
plugin: {
specifier: "./api.js",
specifier: "./channel-plugin-api.js",
exportName: "linePlugin",
},
runtime: {

View File

@@ -0,0 +1 @@
export { msteamsPlugin } from "./src/channel.js";

View File

@@ -6,7 +6,7 @@ export default defineBundledChannelEntry({
description: "Microsoft Teams channel plugin (Bot Framework)",
importMetaUrl: import.meta.url,
plugin: {
specifier: "./api.js",
specifier: "./channel-plugin-api.js",
exportName: "msteamsPlugin",
},
secrets: {

View File

@@ -0,0 +1 @@
export { nextcloudTalkPlugin } from "./src/channel.js";

View File

@@ -6,7 +6,7 @@ export default defineBundledChannelEntry({
description: "Nextcloud Talk channel plugin",
importMetaUrl: import.meta.url,
plugin: {
specifier: "./api.js",
specifier: "./channel-plugin-api.js",
exportName: "nextcloudTalkPlugin",
},
secrets: {

View File

@@ -0,0 +1 @@
export { nostrPlugin } from "./src/channel.js";

View File

@@ -35,7 +35,7 @@ export default defineBundledChannelEntry({
description: "Nostr DM channel plugin via NIP-04",
importMetaUrl: import.meta.url,
plugin: {
specifier: "./api.js",
specifier: "./channel-plugin-api.js",
exportName: "nostrPlugin",
},
runtime: {

View File

@@ -0,0 +1 @@
export { qaChannelPlugin } from "./src/channel.js";

View File

@@ -6,7 +6,7 @@ export default defineBundledChannelEntry({
description: "Synthetic QA channel plugin",
importMetaUrl: import.meta.url,
plugin: {
specifier: "./api.js",
specifier: "./channel-plugin-api.js",
exportName: "qaChannelPlugin",
},
runtime: {

View File

@@ -0,0 +1 @@
export { qqbotPlugin } from "./src/channel.js";

View File

@@ -95,7 +95,7 @@ export default defineBundledChannelEntry({
description: "QQ Bot channel plugin",
importMetaUrl: import.meta.url,
plugin: {
specifier: "./api.js",
specifier: "./channel-plugin-api.js",
exportName: "qqbotPlugin",
},
runtime: {

View File

@@ -0,0 +1 @@
export { synologyChatPlugin } from "./src/channel.js";

View File

@@ -6,7 +6,7 @@ export default defineBundledChannelEntry({
description: "Native Synology Chat channel plugin for OpenClaw",
importMetaUrl: import.meta.url,
plugin: {
specifier: "./api.js",
specifier: "./channel-plugin-api.js",
exportName: "synologyChatPlugin",
},
runtime: {

View File

@@ -0,0 +1 @@
export { tlonPlugin } from "./src/channel.js";

View File

@@ -119,7 +119,7 @@ export default defineBundledChannelEntry({
description: "Tlon/Urbit channel plugin",
importMetaUrl: import.meta.url,
plugin: {
specifier: "./api.js",
specifier: "./channel-plugin-api.js",
exportName: "tlonPlugin",
},
runtime: {

View File

@@ -0,0 +1 @@
export { twitchPlugin } from "./src/plugin.js";

View File

@@ -6,7 +6,7 @@ export default defineBundledChannelEntry({
description: "Twitch IRC chat channel plugin",
importMetaUrl: import.meta.url,
plugin: {
specifier: "./api.js",
specifier: "./channel-plugin-api.js",
exportName: "twitchPlugin",
},
runtime: {

View File

@@ -0,0 +1 @@
export { zaloPlugin } from "./src/channel.js";

View File

@@ -6,7 +6,7 @@ export default defineBundledChannelEntry({
description: "Zalo channel plugin",
importMetaUrl: import.meta.url,
plugin: {
specifier: "./api.js",
specifier: "./channel-plugin-api.js",
exportName: "zaloPlugin",
},
secrets: {