Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
71 lines
2.1 KiB
TypeScript
71 lines
2.1 KiB
TypeScript
import { describe, expect, it, vi } from "vitest";
|
|
import {
|
|
createAgentConversationRailRuntime,
|
|
type AgentConversationRailRuntimeSource
|
|
} from "./agentConversationRailRuntime";
|
|
|
|
describe("createAgentConversationRailRuntime", () => {
|
|
it("forwards exact query and mutation inputs to the host source", async () => {
|
|
const source = createSource();
|
|
const runtime = createAgentConversationRailRuntime(source);
|
|
const candidateInput = {
|
|
agentTargetId: "target-1",
|
|
excludePinned: true,
|
|
sectionKey: "project:workspace-1:/repo",
|
|
workspaceId: "workspace-1"
|
|
};
|
|
const deleteInput = {
|
|
sessionIds: ["session-1", "session-2"],
|
|
workspaceId: "workspace-1"
|
|
};
|
|
|
|
await runtime.listSessionSectionDeletionCandidates(candidateInput);
|
|
await runtime.deleteSessionsBatch(deleteInput);
|
|
|
|
expect(source.listSessionSectionDeletionCandidates).toHaveBeenCalledWith(
|
|
candidateInput
|
|
);
|
|
expect(source.deleteSessionsBatch).toHaveBeenCalledWith(deleteInput);
|
|
});
|
|
});
|
|
|
|
function createSource() {
|
|
const source = {
|
|
deleteSessionsBatch: vi.fn(async () => ({
|
|
cleanupFailedSessionIds: [],
|
|
removedMessages: 0,
|
|
removedSessionIds: [],
|
|
removedSessions: 0
|
|
})),
|
|
listPinnedSessionsPage: vi.fn(async (input) => ({
|
|
hasMore: false,
|
|
sessions: [],
|
|
totalCount: 0,
|
|
workspaceId: input.workspaceId
|
|
})),
|
|
listSessionSectionDeletionCandidates: vi.fn(async (input) => ({
|
|
excludePinned: input.excludePinned,
|
|
sectionKey: input.sectionKey,
|
|
sessionIds: [],
|
|
workspaceId: input.workspaceId
|
|
})),
|
|
listSessionSectionPage: vi.fn(async (input) => ({
|
|
hasMore: false,
|
|
kind: "project" as const,
|
|
sectionKey: input.sectionKey,
|
|
sessions: [],
|
|
totalCount: 0
|
|
})),
|
|
listSessionSections: vi.fn(async (input) => ({
|
|
sections: [],
|
|
workspaceId: input.workspaceId
|
|
})),
|
|
listSessionsPage: vi.fn(async (input) => ({
|
|
hasMore: false,
|
|
sessions: [],
|
|
workspaceId: input.workspaceId
|
|
}))
|
|
} satisfies AgentConversationRailRuntimeSource;
|
|
return source;
|
|
}
|