UNPKG

@sema-agent/core

Version:

Stateless, task-oriented AI agent core

22 lines (21 loc) • 1.48 kB
import { type PeerTaskRow, type PeerTaskStore } from "../peer-task-store.js"; import { type ContractAssertionRunner } from "./contract-harness.js"; /** Primary tenant scope used across contract cases. */ export declare const PEER_TASK_CONTRACT_SCOPE = "tenant-A"; /** Build a valid {@link PeerTaskRow} fixture; overrides adjust digest and settlement pairing unless supplied explicitly. */ export declare function createPeerTaskRowFixture(over?: Partial<PeerTaskRow>): PeerTaskRow; /** Hooks for the damaged-row clause; provide `plantRow` for persistent backends or `unplantable` with a reason. */ export interface PeerTaskStoreContractHooks { readonly plantRow?: (store: PeerTaskStore, key: { readonly task_id: string; readonly scope: string; }, raw: unknown) => Promise<PeerTaskStore>; readonly unplantable?: string; } /** * Cross-backend {@link PeerTaskStore} contract kit (vitest-free; runs under any harness or sequentially by default). * Every bundled and third-party backend must pass all cases; pass `hooks.plantRow` to include damaged-row checks. */ export declare function peerTaskStoreContract(mk: () => PeerTaskStore, runAssertion?: ContractAssertionRunner, hooks?: PeerTaskStoreContractHooks): Promise<void>; /** Optional capability contract for backends implementing {@link PeerTaskStore.listScopes}. */ export declare function peerTaskStoreScopesContract(mk: () => PeerTaskStore, runAssertion?: ContractAssertionRunner): Promise<void>;