|
|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
import { Type } from "@sinclair/typebox";
|
|
|
|
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
|
|
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
|
|
|
|
import type { ChannelMessageCapability } from "../../channels/plugins/message-capabilities.js";
|
|
|
|
|
import type { ChannelMessageActionName, ChannelPlugin } from "../../channels/plugins/types.js";
|
|
|
|
|
import type { MessageActionRunResult } from "../../infra/outbound/message-action-runner.js";
|
|
|
|
|
@ -86,17 +86,19 @@ function getActionEnum(properties: Record<string, unknown>) {
|
|
|
|
|
return (properties.action as { enum?: string[] } | undefined)?.enum ?? [];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
beforeEach(async () => {
|
|
|
|
|
vi.resetModules();
|
|
|
|
|
beforeAll(async () => {
|
|
|
|
|
({ setActivePluginRegistry } = await import("../../plugins/runtime.js"));
|
|
|
|
|
({ createTestRegistry } = await import("../../test-utils/channel-plugins.js"));
|
|
|
|
|
({ createMessageTool } = await import("./message-tool.js"));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
|
mocks.runMessageAction.mockReset();
|
|
|
|
|
mocks.loadConfig.mockReset().mockReturnValue({});
|
|
|
|
|
mocks.resolveCommandSecretRefsViaGateway.mockReset().mockImplementation(async ({ config }) => ({
|
|
|
|
|
resolvedConfig: config,
|
|
|
|
|
diagnostics: [],
|
|
|
|
|
}));
|
|
|
|
|
({ setActivePluginRegistry } = await import("../../plugins/runtime.js"));
|
|
|
|
|
({ createTestRegistry } = await import("../../test-utils/channel-plugins.js"));
|
|
|
|
|
({ createMessageTool } = await import("./message-tool.js"));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function createChannelPlugin(params: {
|
|
|
|
|
|