refactor: dedupe cli config cron and install flows

This commit is contained in:
Peter Steinberger
2026-03-02 19:48:38 +00:00
parent 9d30159fcd
commit b1c30f0ba9
80 changed files with 1379 additions and 2027 deletions

View File

@@ -7,6 +7,7 @@
*/
import { beforeEach, describe, expect, it } from "vitest";
import { createHookRunner } from "./hooks.js";
import { addTestHook, TEST_PLUGIN_AGENT_CTX } from "./hooks.test-helpers.js";
import { createEmptyPluginRegistry, type PluginRegistry } from "./registry.js";
import type { PluginHookBeforeAgentStartResult, PluginHookRegistration } from "./types.js";
@@ -16,21 +17,16 @@ function addBeforeAgentStartHook(
handler: () => PluginHookBeforeAgentStartResult | Promise<PluginHookBeforeAgentStartResult>,
priority?: number,
) {
registry.typedHooks.push({
addTestHook({
registry,
pluginId,
hookName: "before_agent_start",
handler,
handler: handler as PluginHookRegistration["handler"],
priority,
source: "test",
} as PluginHookRegistration);
});
}
const stubCtx = {
agentId: "test-agent",
sessionKey: "sk",
sessionId: "sid",
workspaceDir: "/tmp",
};
const stubCtx = TEST_PLUGIN_AGENT_CTX;
describe("before_agent_start hook merger", () => {
let registry: PluginRegistry;