@adonis-agora/agent
Version:
Governed, durable-backed AI agent (chat + tool-calling + governance) for AdonisJS — part of the Agora ecosystem.
26 lines • 1.19 kB
TypeScript
import type { AgentStore } from '../spi/agent-store.js';
import type { ChatQueueStore } from '../spi/chat-queue.js';
/** A store under test, with one thread already created for `actorRef`. */
export interface ChatQueueContractSubject {
store: AgentStore & ChatQueueStore;
threadId: string;
}
/** One behaviour every {@link ChatQueueStore} must have. `run` throws on the first mismatch. */
export interface ChatQueueContractCase {
name: string;
run: (subject: ChatQueueContractSubject) => Promise<void>;
}
/**
* The behaviours a {@link ChatQueueStore} adapter owes the queue: FIFO order with head inserts,
* round-tripping every field, edits, moves, conditional removal, the pause, and the
* compare-and-set admission the drain relies on. Framework-agnostic — each case throws — so a store
* outside this repo (a host's own) can run it from any test runner:
*
* ```ts
* for (const contractCase of CHAT_QUEUE_STORE_CONTRACT) {
* it(contractCase.name, async () => contractCase.run(await freshSubject()));
* }
* ```
*/
export declare const CHAT_QUEUE_STORE_CONTRACT: readonly ChatQueueContractCase[];
//# sourceMappingURL=chat-queue-store-contract.d.ts.map