@vitest-agent/sdk
v1.3.4
Published
Shared Effect Schema, SQLite migrations, data layer, services, formatters, and utilities for vitest-agent packages.
Downloads
2,761
Maintainers
Readme
@vitest-agent/sdk
Part of the vitest-agent ecosystem. Most users want @vitest-agent/plugin, which pulls this package in automatically. Install
@vitest-agent/sdkdirectly only if you build tooling on the shared schemas or data layer.
The no-internal-deps base for the vitest-agent ecosystem. Carries the Effect Schemas, SQLite migrations and data layer, services and live layers, formatters, XDG path resolution, the public reporter and dispatcher contract types, and testing utilities.
Features
- Effect Schemas — all domain types (
RunEvent,RenderState,CoverageTargets,TurnPayload, identity types) defined with Effect Schema; runtime validation and TypeScript types from one source - SQLite data layer —
DataStoreandDataReaderEffect services with live and:memory:test layers;ensureMigratedfor safe multi-project setups - XDG path resolution — deterministic
dbPathderivation from workspace identity with a five-source fallback chain - Reporter and dispatcher contracts —
VitestAgentReporterFactory,ReporterKit,ResolvedReporterConfig,DispatchInputsand the types consumed by every other package - Sidecar dispatch core —
dispatch,injectEnvandexitCodeForTagon the@vitest-agent/sdk/dispatchsub-path for a minimal SEA bundle - Test utilities —
makeTestLayer,DataStoreTestLayerand five preset factory functions on the@vitest-agent/sdk/testingsub-path
Install
npm install @vitest-agent/sdk
# or
pnpm add @vitest-agent/sdkQuick start
import { Effect } from "effect";
import { DataReader } from "@vitest-agent/sdk";
import { singlePassingRun } from "@vitest-agent/sdk/testing";
const layer = singlePassingRun(":memory:");
await Effect.runPromise(
Effect.provide(
Effect.flatMap(DataReader, (r) => r.getLatestRun("default", null)),
layer,
),
);
// returns the seeded run rowDocumentation
Package reference at vitest-agent.dev/sdk.
