mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-20 14:30:57 +00:00
* ACPX: keep plugin-local runtime installs out of dist * Gateway: harden ACP startup and service PATH * ACP: reinitialize error-state configured bindings * ACP: classify pre-turn runtime failures as session init failures * Plugins: move configured ACP routing behind channel seams * Telegram tests: align startup probe assertions after rebase * Discord: harden ACP configured binding recovery * ACP: recover Discord bindings after stale runtime exits * ACPX: replace dead sessions during ensure * Discord: harden ACP binding recovery * Discord: fix review follow-ups * ACP bindings: load channel snapshots across workspaces * ACP bindings: cache snapshot channel plugin resolution * Experiments: add ACP pluginification holy grail plan * Experiments: rename ACP pluginification plan doc * Experiments: drop old ACP pluginification doc path * ACP: move configured bindings behind plugin services * Experiments: update bindings capability architecture plan * Bindings: isolate configured binding routing and targets * Discord tests: fix runtime env helper path * Tests: fix channel binding CI regressions * Tests: normalize ACP workspace assertion on Windows * Bindings: isolate configured binding registry * Bindings: finish configured binding cleanup * Bindings: finish generic cleanup * Bindings: align runtime approval callbacks * ACP: delete residual bindings barrel * Bindings: restore legacy compatibility * Revert "Bindings: restore legacy compatibility" This reverts commit ac2ed68fa2426ecc874d68278c71c71ad363fcfe. * Tests: drop ACP route legacy helper names * Discord/ACP: fix binding regressions --------- Co-authored-by: Onur <2453968+osolmaz@users.noreply.github.com>
119 lines
3.1 KiB
TypeScript
119 lines
3.1 KiB
TypeScript
import type {
|
|
ChannelCapabilities,
|
|
ChannelId,
|
|
ChannelMessagingAdapter,
|
|
ChannelOutboundAdapter,
|
|
ChannelPlugin,
|
|
} from "../channels/plugins/types.js";
|
|
import type { PluginRegistry } from "../plugins/registry.js";
|
|
|
|
type TestChannelRegistration = {
|
|
pluginId: string;
|
|
plugin: unknown;
|
|
source: string;
|
|
};
|
|
|
|
export const createTestRegistry = (channels: TestChannelRegistration[] = []): PluginRegistry => ({
|
|
plugins: [],
|
|
tools: [],
|
|
hooks: [],
|
|
typedHooks: [],
|
|
channels: channels as unknown as PluginRegistry["channels"],
|
|
channelSetups: channels.map((entry) => ({
|
|
pluginId: entry.pluginId,
|
|
plugin: entry.plugin as PluginRegistry["channelSetups"][number]["plugin"],
|
|
source: entry.source,
|
|
enabled: true,
|
|
})),
|
|
providers: [],
|
|
speechProviders: [],
|
|
mediaUnderstandingProviders: [],
|
|
imageGenerationProviders: [],
|
|
webSearchProviders: [],
|
|
gatewayHandlers: {},
|
|
httpRoutes: [],
|
|
cliRegistrars: [],
|
|
services: [],
|
|
commands: [],
|
|
conversationBindingResolvedHandlers: [],
|
|
diagnostics: [],
|
|
});
|
|
|
|
export const createChannelTestPluginBase = (params: {
|
|
id: ChannelId;
|
|
label?: string;
|
|
docsPath?: string;
|
|
capabilities?: ChannelCapabilities;
|
|
config?: Partial<ChannelPlugin["config"]>;
|
|
}): Pick<ChannelPlugin, "id" | "meta" | "capabilities" | "config"> => ({
|
|
id: params.id,
|
|
meta: {
|
|
id: params.id,
|
|
label: params.label ?? String(params.id),
|
|
selectionLabel: params.label ?? String(params.id),
|
|
docsPath: params.docsPath ?? `/channels/${params.id}`,
|
|
blurb: "test stub.",
|
|
},
|
|
capabilities: params.capabilities ?? { chatTypes: ["direct"] },
|
|
config: {
|
|
listAccountIds: () => ["default"],
|
|
resolveAccount: () => ({}),
|
|
...params.config,
|
|
},
|
|
});
|
|
|
|
export const createMSTeamsTestPluginBase = (): Pick<
|
|
ChannelPlugin,
|
|
"id" | "meta" | "capabilities" | "config"
|
|
> => {
|
|
const base = createChannelTestPluginBase({
|
|
id: "msteams",
|
|
label: "Microsoft Teams",
|
|
docsPath: "/channels/msteams",
|
|
config: { listAccountIds: () => [], resolveAccount: () => ({}) },
|
|
});
|
|
return {
|
|
...base,
|
|
meta: {
|
|
...base.meta,
|
|
selectionLabel: "Microsoft Teams (Bot Framework)",
|
|
blurb: "Bot Framework; enterprise support.",
|
|
aliases: ["teams"],
|
|
},
|
|
};
|
|
};
|
|
|
|
export const createMSTeamsTestPlugin = (params?: {
|
|
aliases?: string[];
|
|
outbound?: ChannelOutboundAdapter;
|
|
}): ChannelPlugin => {
|
|
const base = createMSTeamsTestPluginBase();
|
|
return {
|
|
...base,
|
|
meta: {
|
|
...base.meta,
|
|
...(params?.aliases ? { aliases: params.aliases } : {}),
|
|
},
|
|
...(params?.outbound ? { outbound: params.outbound } : {}),
|
|
};
|
|
};
|
|
|
|
export const createOutboundTestPlugin = (params: {
|
|
id: ChannelId;
|
|
outbound: ChannelOutboundAdapter;
|
|
messaging?: ChannelMessagingAdapter;
|
|
label?: string;
|
|
docsPath?: string;
|
|
capabilities?: ChannelCapabilities;
|
|
}): ChannelPlugin => ({
|
|
...createChannelTestPluginBase({
|
|
id: params.id,
|
|
label: params.label,
|
|
docsPath: params.docsPath,
|
|
capabilities: params.capabilities,
|
|
config: { listAccountIds: () => [] },
|
|
}),
|
|
outbound: params.outbound,
|
|
...(params.messaging ? { messaging: params.messaging } : {}),
|
|
});
|