feat(acp): add experimental ACP support

Co-authored-by: Jonathan Taylor <visionik@pobox.com>
This commit is contained in:
Peter Steinberger
2026-01-18 08:02:42 +00:00
parent efaa73f543
commit de3b68740a
25 changed files with 1528 additions and 29 deletions

26
src/acp/session.test.ts Normal file
View File

@@ -0,0 +1,26 @@
import { describe, expect, it, afterEach } from "vitest";
import { createInMemorySessionStore } from "./session.js";
describe("acp session manager", () => {
const store = createInMemorySessionStore();
afterEach(() => {
store.clearAllSessionsForTest();
});
it("tracks active runs and clears on cancel", () => {
const session = store.createSession({
sessionKey: "acp:test",
cwd: "/tmp",
});
const controller = new AbortController();
store.setActiveRun(session.sessionId, "run-1", controller);
expect(store.getSessionByRunId("run-1")?.sessionId).toBe(session.sessionId);
const cancelled = store.cancelActiveRun(session.sessionId);
expect(cancelled).toBe(true);
expect(store.getSessionByRunId("run-1")).toBeUndefined();
});
});