@codesoul-co/hypha-testing / replay
- Package index:
@codesoul-co/hypha-testing - Source:
packages/testing/src/replay.ts - Exports: 16
Using this module
Use the Replay module for using the public contracts and operations for this capability boundary. It exports 3 classes, 3 functions, 10 interfaces.
Import from the package entrypoint
import {
FileReplayFixtureStore,
InMemoryReplayFixtureStore,
ReplayEngine,
diffStringSequences,
normalizeEvents,
projectReplay,
} from '@codesoul-co/hypha-testing';
import type {
FileReplayFixtureStoreOptions,
ReplayCaptureInput,
ReplayEngineOptions,
ReplayFixture,
ReplayFixtureStore,
ReplayProjection,
ReplayResult,
TraceDiff,
} from '@codesoul-co/hypha-testing';
// The complete export list is documented below.Usage patterns
- Use the 10 type/interface exports as static contracts in application code, adapters, or tests. Import them with
import type; they do not exist at runtime. - The module exposes 3 classes as constructable runtime implementations. Each symbol entry lists its constructor and public methods.
- The module exposes 3 functions as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.
Public exports
| Symbol | Kind | Signature | Description |
|---|---|---|---|
FileReplayFixtureStore | class | new FileReplayFixtureStore(options: FileReplayFixtureStoreOptions): FileReplayFixtureStore | File Replay Fixture Store class with 4 public constructor or member entries; its exact declarations are listed below. |
InMemoryReplayFixtureStore | class | new InMemoryReplayFixtureStore(): InMemoryReplayFixtureStore | In Memory Replay Fixture Store class with 4 public constructor or member entries; its exact declarations are listed below. |
ReplayEngine | class | new ReplayEngine(options?: ReplayEngineOptions): ReplayEngine | Replay Engine class with 6 public constructor or member entries; its exact declarations are listed below. |
diffStringSequences | function | diffStringSequences(expected: string[], actual: string[]): TraceSequenceDiff | Diff String Sequences function with 1 public call signature; parameters and return types are listed below. |
normalizeEvents | function | normalizeEvents(events: FrameworkEvent[]): FrameworkEvent[] | Normalize Events function with 1 public call signature; parameters and return types are listed below. |
projectReplay | function | projectReplay(events: FrameworkEvent[]): ReplayProjection | Project Replay function with 1 public call signature; parameters and return types are listed below. |
FileReplayFixtureStoreOptions | interface | interface FileReplayFixtureStoreOptions | File Replay Fixture Store Options interface with 2 public fields or methods. |
ReplayCaptureInput | interface | interface ReplayCaptureInput | Replay Capture Input interface with 7 public fields or methods. |
ReplayEngineOptions | interface | interface ReplayEngineOptions | Replay Engine Options interface with 8 public fields or methods. |
ReplayFixture | interface | interface ReplayFixture | Replay Fixture interface with 15 public fields or methods. |
ReplayFixtureStore | interface | interface ReplayFixtureStore | Replay Fixture Store interface with 3 public fields or methods. |
ReplayProjection | interface | interface ReplayProjection | Replay Projection interface with 9 public fields or methods. |
ReplayResult | interface | interface ReplayResult | Replay Result interface with 3 public fields or methods. |
TraceDiff | interface | interface TraceDiff | Trace Diff interface with 8 public fields or methods. |
TraceSequenceDiff | interface | interface TraceSequenceDiff | Trace Sequence Diff interface with 6 public fields or methods. |
TraceValueDiff | interface | interface TraceValueDiff | Trace Value Diff interface with 3 public fields or methods. |
FileReplayFixtureStore
File Replay Fixture Store class with 4 public constructor or member entries; its exact declarations are listed below.
- Kind: class
- Import:
import { FileReplayFixtureStore } from '@codesoul-co/hypha-testing'; - Source module:
replay
Declaration
export declare class FileReplayFixtureStore implements ReplayFixtureStore {
constructor(options: FileReplayFixtureStoreOptions);
save(fixture: ReplayFixture): Promise<void>;
get(id: string): Promise<ReplayFixture | null>;
list(): Promise<ReplayFixture[]>;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
constructor | constructor | (options: FileReplayFixtureStoreOptions): FileReplayFixtureStore | Creates an instance of this class. |
get | method | get(id: string): Promise<ReplayFixture | null> | Public method; parameters and return type are shown in the signature. |
list | method | list(): Promise<ReplayFixture[]> | Public method; parameters and return type are shown in the signature. |
save | method | save(fixture: ReplayFixture): Promise<void> | Public method; parameters and return type are shown in the signature. |
InMemoryReplayFixtureStore
In Memory Replay Fixture Store class with 4 public constructor or member entries; its exact declarations are listed below.
- Kind: class
- Import:
import { InMemoryReplayFixtureStore } from '@codesoul-co/hypha-testing'; - Source module:
replay
Declaration
export declare class InMemoryReplayFixtureStore implements ReplayFixtureStore {
save(fixture: ReplayFixture): Promise<void>;
get(id: string): Promise<ReplayFixture | null>;
list(): Promise<ReplayFixture[]>;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
constructor | constructor | (): InMemoryReplayFixtureStore | Creates an instance of this class. |
get | method | get(id: string): Promise<ReplayFixture | null> | Public method; parameters and return type are shown in the signature. |
list | method | list(): Promise<ReplayFixture[]> | Public method; parameters and return type are shown in the signature. |
save | method | save(fixture: ReplayFixture): Promise<void> | Public method; parameters and return type are shown in the signature. |
ReplayEngine
Replay Engine class with 6 public constructor or member entries; its exact declarations are listed below.
- Kind: class
- Import:
import { ReplayEngine } from '@codesoul-co/hypha-testing'; - Source module:
replay
Declaration
export declare class ReplayEngine {
constructor(options?: ReplayEngineOptions);
capture(input: ReplayCaptureInput): Promise<ReplayFixture>;
replay(fixture: ReplayFixture): ReplayResult;
compare(expected: ReplayFixture, actual: ReplayFixture | FrameworkEvent[]): TraceDiff;
getFixture(id: string): Promise<ReplayFixture | null>;
listFixtures(): Promise<ReplayFixture[]>;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
capture | method | capture(input: ReplayCaptureInput): Promise<ReplayFixture> | Public method; parameters and return type are shown in the signature. |
compare | method | compare(expected: ReplayFixture, actual: ReplayFixture | FrameworkEvent[]): TraceDiff | Public method; parameters and return type are shown in the signature. |
constructor | constructor | (options?: ReplayEngineOptions): ReplayEngine | Creates an instance of this class. |
getFixture | method | getFixture(id: string): Promise<ReplayFixture | null> | Public method; parameters and return type are shown in the signature. |
listFixtures | method | listFixtures(): Promise<ReplayFixture[]> | Public method; parameters and return type are shown in the signature. |
replay | method | replay(fixture: ReplayFixture): ReplayResult | Public method; parameters and return type are shown in the signature. |
diffStringSequences
Diff String Sequences function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { diffStringSequences } from '@codesoul-co/hypha-testing'; - Source module:
replay
Declaration
export declare function diffStringSequences(expected: string[], actual: string[]): TraceSequenceDiff;Call signature
diffStringSequences(expected: string[], actual: string[]): TraceSequenceDiffParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
expected | string[] | Yes | Required parameter; accepted values are defined by the type column. |
actual | string[] | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
TraceSequenceDiff - Description: The return contract is defined by the type shown above.
normalizeEvents
Normalize Events function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { normalizeEvents } from '@codesoul-co/hypha-testing'; - Source module:
replay
Declaration
export declare function normalizeEvents(events: FrameworkEvent[]): FrameworkEvent[];Call signature
normalizeEvents(events: FrameworkEvent[]): FrameworkEvent[]Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
events | FrameworkEvent<unknown>[] | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
FrameworkEvent<unknown>[] - Description: The return contract is defined by the type shown above.
projectReplay
Project Replay function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { projectReplay } from '@codesoul-co/hypha-testing'; - Source module:
replay
Declaration
export declare function projectReplay(events: FrameworkEvent[]): ReplayProjection;Call signature
projectReplay(events: FrameworkEvent[]): ReplayProjectionParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
events | FrameworkEvent<unknown>[] | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
ReplayProjection - Description: The return contract is defined by the type shown above.
FileReplayFixtureStoreOptions
File Replay Fixture Store Options interface with 2 public fields or methods.
- Kind: interface
- Import:
import type { FileReplayFixtureStoreOptions } from '@codesoul-co/hypha-testing'; - Source module:
replay
Declaration
export interface FileReplayFixtureStoreOptions {
directory: string;
extension?: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
directory | property | directory: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
extension | property | extension?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
ReplayCaptureInput
Replay Capture Input interface with 7 public fields or methods.
- Kind: interface
- Import:
import type { ReplayCaptureInput } from '@codesoul-co/hypha-testing'; - Source module:
replay
Declaration
export interface ReplayCaptureInput {
id: string;
version: string;
runId: string;
events?: FrameworkEvent[];
replaySpec?: ReplaySpec;
outputContract?: OutputContractSpec;
metadata?: Record<string, unknown>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
events | property | events?: FrameworkEvent<unknown>[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
id | property | id: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
metadata | property | metadata?: Record<string, unknown> | Public property; its type, readonly modifier and optionality are shown in the signature. |
outputContract | property | outputContract?: OutputContractSpec | Public property; its type, readonly modifier and optionality are shown in the signature. |
replaySpec | property | replaySpec?: ReplaySpec | Public property; its type, readonly modifier and optionality are shown in the signature. |
runId | property | runId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
version | property | version: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
ReplayEngineOptions
Replay Engine Options interface with 8 public fields or methods.
- Kind: interface
- Import:
import type { ReplayEngineOptions } from '@codesoul-co/hypha-testing'; - Source module:
replay
Declaration
export interface ReplayEngineOptions {
eventStore?: EventStore;
fixtureStore?: ReplayFixtureStore;
now?: () => string;
trace?: TraceRecorder;
sessionId?: string;
workspaceId?: string;
agentId?: string;
metadata?: Record<string, unknown>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
agentId | property | agentId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
eventStore | property | eventStore?: EventStore | Public property; its type, readonly modifier and optionality are shown in the signature. |
fixtureStore | property | fixtureStore?: ReplayFixtureStore | Public property; its type, readonly modifier and optionality are shown in the signature. |
metadata | property | metadata?: Record<string, unknown> | Public property; its type, readonly modifier and optionality are shown in the signature. |
now | method | now?(): string | Public method; parameters and return type are shown in the signature. |
sessionId | property | sessionId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
trace | property | trace?: TraceRecorder | Public property; its type, readonly modifier and optionality are shown in the signature. |
workspaceId | property | workspaceId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
ReplayFixture
Replay Fixture interface with 15 public fields or methods.
- Kind: interface
- Import:
import type { ReplayFixture } from '@codesoul-co/hypha-testing'; - Source module:
replay
Declaration
export interface ReplayFixture {
id: string;
version: string;
runId: string;
createdAt: string;
replaySpecRef?: SpecRef;
events: FrameworkEvent[];
eventTypes: string[];
statePath: string[];
finalOutput?: unknown;
toolCalls: string[];
modelCalls: string[];
policyDecisions: string[];
memoryReadSet: string[];
outputContract?: OutputContractSpec;
metadata?: Record<string, unknown>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
createdAt | property | createdAt: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
events | property | events: FrameworkEvent<unknown>[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
eventTypes | property | eventTypes: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
finalOutput | property | finalOutput?: unknown | Public property; its type, readonly modifier and optionality are shown in the signature. |
id | property | id: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
memoryReadSet | property | memoryReadSet: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
metadata | property | metadata?: Record<string, unknown> | Public property; its type, readonly modifier and optionality are shown in the signature. |
modelCalls | property | modelCalls: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
outputContract | property | outputContract?: OutputContractSpec | Public property; its type, readonly modifier and optionality are shown in the signature. |
policyDecisions | property | policyDecisions: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
replaySpecRef | property | replaySpecRef?: SpecRef | Public property; its type, readonly modifier and optionality are shown in the signature. |
runId | property | runId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
statePath | property | statePath: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
toolCalls | property | toolCalls: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
version | property | version: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
ReplayFixtureStore
Replay Fixture Store interface with 3 public fields or methods.
- Kind: interface
- Import:
import type { ReplayFixtureStore } from '@codesoul-co/hypha-testing'; - Source module:
replay
Declaration
export interface ReplayFixtureStore {
save(fixture: ReplayFixture): Promise<void>;
get(id: string): Promise<ReplayFixture | null>;
list(): Promise<ReplayFixture[]>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
get | method | get(id: string): Promise<ReplayFixture | null> | Public method; parameters and return type are shown in the signature. |
list | method | list(): Promise<ReplayFixture[]> | Public method; parameters and return type are shown in the signature. |
save | method | save(fixture: ReplayFixture): Promise<void> | Public method; parameters and return type are shown in the signature. |
ReplayProjection
Replay Projection interface with 9 public fields or methods.
- Kind: interface
- Import:
import type { ReplayProjection } from '@codesoul-co/hypha-testing'; - Source module:
replay
Declaration
export interface ReplayProjection {
runId: string;
events: FrameworkEvent[];
eventTypes: string[];
statePath: string[];
finalOutput?: unknown;
toolCalls: string[];
policyDecisions: string[];
memoryReadSet: string[];
modelCalls: string[];
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
events | property | events: FrameworkEvent<unknown>[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
eventTypes | property | eventTypes: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
finalOutput | property | finalOutput?: unknown | Public property; its type, readonly modifier and optionality are shown in the signature. |
memoryReadSet | property | memoryReadSet: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
modelCalls | property | modelCalls: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
policyDecisions | property | policyDecisions: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
runId | property | runId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
statePath | property | statePath: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
toolCalls | property | toolCalls: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
ReplayResult
Replay Result interface with 3 public fields or methods.
- Kind: interface
- Import:
import type { ReplayResult } from '@codesoul-co/hypha-testing'; - Source module:
replay
Declaration
export interface ReplayResult {
fixtureId: string;
runId: string;
projection: ReplayProjection;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
fixtureId | property | fixtureId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
projection | property | projection: ReplayProjection | Public property; its type, readonly modifier and optionality are shown in the signature. |
runId | property | runId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
TraceDiff
Trace Diff interface with 8 public fields or methods.
- Kind: interface
- Import:
import type { TraceDiff } from '@codesoul-co/hypha-testing'; - Source module:
replay
Declaration
export interface TraceDiff {
passed: boolean;
eventTypes: TraceSequenceDiff;
statePath: TraceSequenceDiff;
toolCalls: TraceSequenceDiff;
modelCalls: TraceSequenceDiff;
policyDecisions: TraceSequenceDiff;
memoryReadSet: TraceSequenceDiff;
output: TraceValueDiff;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
eventTypes | property | eventTypes: TraceSequenceDiff | Public property; its type, readonly modifier and optionality are shown in the signature. |
memoryReadSet | property | memoryReadSet: TraceSequenceDiff | Public property; its type, readonly modifier and optionality are shown in the signature. |
modelCalls | property | modelCalls: TraceSequenceDiff | Public property; its type, readonly modifier and optionality are shown in the signature. |
output | property | output: TraceValueDiff | Public property; its type, readonly modifier and optionality are shown in the signature. |
passed | property | passed: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
policyDecisions | property | policyDecisions: TraceSequenceDiff | Public property; its type, readonly modifier and optionality are shown in the signature. |
statePath | property | statePath: TraceSequenceDiff | Public property; its type, readonly modifier and optionality are shown in the signature. |
toolCalls | property | toolCalls: TraceSequenceDiff | Public property; its type, readonly modifier and optionality are shown in the signature. |
TraceSequenceDiff
Trace Sequence Diff interface with 6 public fields or methods.
- Kind: interface
- Import:
import type { TraceSequenceDiff } from '@codesoul-co/hypha-testing'; - Source module:
replay
Declaration
export interface TraceSequenceDiff {
passed: boolean;
expected: string[];
actual: string[];
missing: string[];
extra: string[];
mismatches: Array<{
index: number;
expected?: string;
actual?: string;
}>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
actual | property | actual: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
expected | property | expected: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
extra | property | extra: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
mismatches | property | mismatches: { index: number; expected?: string; actual?: string; }[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
missing | property | missing: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
passed | property | passed: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
TraceValueDiff
Trace Value Diff interface with 3 public fields or methods.
- Kind: interface
- Import:
import type { TraceValueDiff } from '@codesoul-co/hypha-testing'; - Source module:
replay
Declaration
export interface TraceValueDiff {
passed: boolean;
expected?: unknown;
actual?: unknown;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
actual | property | actual?: unknown | Public property; its type, readonly modifier and optionality are shown in the signature. |
expected | property | expected?: unknown | Public property; its type, readonly modifier and optionality are shown in the signature. |
passed | property | passed: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
