


















@@ -1,5 +1,6 @@
11import { describe, expect, it, vi } from "vitest";
22import type { ChannelPlugin } from "../channels/plugins/types.js";
3+import { makeDirectPlugin } from "../test-utils/channel-plugin-test-fixtures.js";
34import { formatConfigChannelsStatusLines } from "./channels/status-config-format.js";
4556const activeChannelPlugins = vi.hoisted(() => [] as ChannelPlugin[]);
@@ -47,29 +48,6 @@ function registerSingleTestPlugin(_pluginId: string, plugin: ChannelPlugin) {
4748activeChannelPlugins.splice(0, activeChannelPlugins.length, plugin);
4849}
495050-function makeTestPlugin(params: {
51-id: string;
52-label: string;
53-docsPath: string;
54-config: ChannelPlugin["config"];
55-}): ChannelPlugin {
56-return {
57-id: params.id,
58-meta: {
59-id: params.id,
60-label: params.label,
61-selectionLabel: params.label,
62-docsPath: params.docsPath,
63-blurb: "test",
64-},
65-capabilities: { chatTypes: ["direct"] },
66-config: params.config,
67-actions: {
68-describeMessageTool: () => ({ actions: ["send"] }),
69-},
70-};
71-}
72-7351async function formatLocalStatusSummary(
7452cfg: unknown,
7553options?: {
@@ -105,7 +83,7 @@ function tokenOnlyPluginConfig() {
10583}
1068410785function makeUnavailableTokenPlugin(): ChannelPlugin {
108-return makeTestPlugin({
86+return makeDirectPlugin({
10987id: "token-only",
11088label: "TokenOnly",
11189docsPath: "/channels/token-only",
@@ -117,7 +95,7 @@ function makeUnavailableTokenPlugin(): ChannelPlugin {
11795}
1189611997function makeResolvedTokenPlugin(): ChannelPlugin {
120-return makeTestPlugin({
98+return makeDirectPlugin({
12199id: "token-only",
122100label: "TokenOnly",
123101docsPath: "/channels/token-only",
@@ -141,16 +119,10 @@ function makeResolvedTokenPlugin(): ChannelPlugin {
141119}
142120143121function makeResolvedTokenPluginWithoutInspectAccount(): ChannelPlugin {
144-return {
122+return makeDirectPlugin({
145123id: "token-only",
146-meta: {
147-id: "token-only",
148-label: "TokenOnly",
149-selectionLabel: "TokenOnly",
150-docsPath: "/channels/token-only",
151-blurb: "test",
152-},
153-capabilities: { chatTypes: ["direct"] },
124+label: "TokenOnly",
125+docsPath: "/channels/token-only",
154126config: {
155127listAccountIds: () => ["primary"],
156128defaultAccountId: () => "primary",
@@ -170,14 +142,11 @@ function makeResolvedTokenPluginWithoutInspectAccount(): ChannelPlugin {
170142isConfigured: () => true,
171143isEnabled: () => true,
172144},
173-actions: {
174-describeMessageTool: () => ({ actions: ["send"] }),
175-},
176-};
145+});
177146}
178147179148function makeUnavailableHttpSlackPlugin(): ChannelPlugin {
180-return makeTestPlugin({
149+return makeDirectPlugin({
181150id: "slack",
182151label: "Slack",
183152docsPath: "/channels/slack",
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。