Skip to content

@codesoul-co/hypha-harness / index

Using this module

Aggregates the public entrypoint exports for @codesoul-co/hypha-harness; applications import these symbols from the package entrypoint instead of internal file paths.

Import from the package entrypoint

ts
import {
  InMemoryTraceRecorder,
  SessionProjector,
  UserScopedSessionQueue,
  createRunStartedEvent,
} from '@codesoul-co/hypha-harness';

import type {
  QueueTask,
  RegressionCase,
  ReplayFixture,
  RunRecord,
  SessionView,
} from '@codesoul-co/hypha-harness';

Usage patterns

  • Use the 5 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 1 function as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.

Public exports

SymbolKindSignatureDescription
InMemoryTraceRecorderclassnew InMemoryTraceRecorder(): InMemoryTraceRecorderIn Memory Trace Recorder class with 3 public constructor or member entries; its exact declarations are listed below.
SessionProjectorclassnew SessionProjector(): SessionProjectorSession Projector class with 2 public constructor or member entries; its exact declarations are listed below.
UserScopedSessionQueueclassnew UserScopedSessionQueue<T = unknown>(): UserScopedSessionQueue<T>User Scoped Session Queue class with 4 public constructor or member entries; its exact declarations are listed below.
createRunStartedEventfunctioncreateRunStartedEvent(run: RunRecord): FrameworkEventCreate Run Started Event function with 1 public call signature; parameters and return types are listed below.
QueueTaskinterfaceinterface QueueTaskQueue Task interface with 4 public fields or methods.
RegressionCaseinterfaceinterface RegressionCaseRegression Case interface with 6 public fields or methods.
ReplayFixtureinterfaceinterface ReplayFixtureReplay Fixture interface with 15 public fields or methods.
RunRecordinterfaceinterface RunRecordRun Record interface with 10 public fields or methods.
SessionViewinterfaceinterface SessionViewSession View interface with 5 public fields or methods.

InMemoryTraceRecorder

In Memory Trace Recorder class with 3 public constructor or member entries; its exact declarations are listed below.

  • Kind: class
  • Import: import { InMemoryTraceRecorder } from '@codesoul-co/hypha-harness';
  • Source module: index

Declaration

text
export declare class InMemoryTraceRecorder implements TraceRecorder {
    record(event: FrameworkEvent): Promise<void>;
    list(filter?: EventFilter): Promise<FrameworkEvent[]>;
}

Public members

MemberKindSignatureDescription
constructorconstructor(): InMemoryTraceRecorderCreates an instance of this class.
listmethodlist(filter?: EventFilter): Promise<FrameworkEvent[]>Public method; parameters and return type are shown in the signature.
recordmethodrecord(event: FrameworkEvent): Promise<void>Public method; parameters and return type are shown in the signature.

SessionProjector

Session Projector class with 2 public constructor or member entries; its exact declarations are listed below.

  • Kind: class
  • Import: import { SessionProjector } from '@codesoul-co/hypha-harness';
  • Source module: index

Declaration

text
export declare class SessionProjector {
    project(events: FrameworkEvent[]): SessionView[];
}

Public members

MemberKindSignatureDescription
constructorconstructor(): SessionProjectorCreates an instance of this class.
projectmethodproject(events: FrameworkEvent[]): SessionView[]Public method; parameters and return type are shown in the signature.

UserScopedSessionQueue

User Scoped Session Queue class with 4 public constructor or member entries; its exact declarations are listed below.

  • Kind: class
  • Import: import { UserScopedSessionQueue } from '@codesoul-co/hypha-harness';
  • Source module: index

Declaration

text
export declare class UserScopedSessionQueue<T = unknown> {
    enqueue(task: QueueTask<T>): number;
    dequeue(userId: string, sessionId: string): QueueTask<T> | null;
    size(userId: string, sessionId: string): number;
}

Public members

MemberKindSignatureDescription
constructorconstructor<T = unknown>(): UserScopedSessionQueue<T>Creates an instance of this class.
dequeuemethoddequeue(userId: string, sessionId: string): QueueTask<T> | nullPublic method; parameters and return type are shown in the signature.
enqueuemethodenqueue(task: QueueTask<T>): numberPublic method; parameters and return type are shown in the signature.
sizemethodsize(userId: string, sessionId: string): numberPublic method; parameters and return type are shown in the signature.

createRunStartedEvent

Create Run Started Event function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { createRunStartedEvent } from '@codesoul-co/hypha-harness';
  • Source module: index

Declaration

text
export declare function createRunStartedEvent(run: RunRecord): FrameworkEvent;

Call signature

text
createRunStartedEvent(run: RunRecord): FrameworkEvent

Parameters

ParameterTypeRequiredDescription
runRunRecord<unknown, unknown>YesRequired parameter; accepted values are defined by the type column.

Returns

  • Type: FrameworkEvent<unknown>
  • Description: The return contract is defined by the type shown above.

QueueTask

Queue Task interface with 4 public fields or methods.

  • Kind: interface
  • Import: import type { QueueTask } from '@codesoul-co/hypha-harness';
  • Source module: index

Declaration

text
export interface QueueTask<T = unknown> {
    id: string;
    userId: string;
    sessionId: string;
    payload: T;
}

Contract members

MemberKindSignatureDescription
idpropertyid: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
payloadpropertypayload: TPublic property; its type, readonly modifier and optionality are shown in the signature.
sessionIdpropertysessionId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
userIdpropertyuserId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

RegressionCase

Regression Case interface with 6 public fields or methods.

  • Kind: interface
  • Import: import type { RegressionCase } from '@codesoul-co/hypha-harness';
  • Source module: index

Declaration

text
export interface RegressionCase {
    id: string;
    fixture: ReplayFixture;
    actualEvents?: FrameworkEvent[];
    requiredChecks?: Array<'event_types' | 'state_path' | 'tool_calls' | 'policy_decisions' | 'output_contract'>;
    outputContract?: OutputContractSpec;
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
actualEventspropertyactualEvents?: FrameworkEvent<unknown>[]Public property; its type, readonly modifier and optionality are shown in the signature.
fixturepropertyfixture: ReplayFixturePublic property; its type, readonly modifier and optionality are shown in the signature.
idpropertyid: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
metadatapropertymetadata?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
outputContractpropertyoutputContract?: OutputContractSpecPublic property; its type, readonly modifier and optionality are shown in the signature.
requiredCheckspropertyrequiredChecks?: ("output_contract" | "state_path" | "event_types" | "tool_calls" | "policy_decisions")[]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-harness';
  • Source module: index

Declaration

text
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

MemberKindSignatureDescription
createdAtpropertycreatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
eventspropertyevents: FrameworkEvent<unknown>[]Public property; its type, readonly modifier and optionality are shown in the signature.
eventTypespropertyeventTypes?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
finalOutputpropertyfinalOutput?: unknownPublic property; its type, readonly modifier and optionality are shown in the signature.
idpropertyid: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
memoryReadSetpropertymemoryReadSet?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
metadatapropertymetadata?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
modelCallspropertymodelCalls?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
outputContractpropertyoutputContract?: OutputContractSpecPublic property; its type, readonly modifier and optionality are shown in the signature.
policyDecisionspropertypolicyDecisions?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
replaySpecRefpropertyreplaySpecRef?: SpecRefPublic property; its type, readonly modifier and optionality are shown in the signature.
runIdpropertyrunId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
statePathpropertystatePath: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
toolCallspropertytoolCalls?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
versionpropertyversion: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

RunRecord

Run Record interface with 10 public fields or methods.

  • Kind: interface
  • Import: import type { RunRecord } from '@codesoul-co/hypha-harness';
  • Source module: index

Declaration

text
export interface RunRecord<TInput = unknown, TOutput = unknown> {
    id: string;
    sessionId?: string;
    userId?: string;
    agentSystemId: string;
    status: 'queued' | 'running' | 'waiting_human' | 'completed' | 'failed' | 'cancelled';
    input: TInput;
    output?: TOutput;
    fsmSnapshot?: FSMSnapshot;
    createdAt: string;
    completedAt?: string;
}

Contract members

MemberKindSignatureDescription
agentSystemIdpropertyagentSystemId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
completedAtpropertycompletedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
createdAtpropertycreatedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
fsmSnapshotpropertyfsmSnapshot?: FSMSnapshotPublic property; its type, readonly modifier and optionality are shown in the signature.
idpropertyid: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
inputpropertyinput: TInputPublic property; its type, readonly modifier and optionality are shown in the signature.
outputpropertyoutput?: TOutputPublic property; its type, readonly modifier and optionality are shown in the signature.
sessionIdpropertysessionId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
statuspropertystatus: "completed" | "queued" | "running" | "cancelled" | "failed" | "waiting_human"Public property; its type, readonly modifier and optionality are shown in the signature.
userIdpropertyuserId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

SessionView

Session View interface with 5 public fields or methods.

  • Kind: interface
  • Import: import type { SessionView } from '@codesoul-co/hypha-harness';
  • Source module: index

Declaration

text
export interface SessionView {
    id: string;
    userId: string;
    runIds: string[];
    status: 'active' | 'closed';
    updatedAt: string;
}

Contract members

MemberKindSignatureDescription
idpropertyid: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
runIdspropertyrunIds: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
statuspropertystatus: "active" | "closed"Public property; its type, readonly modifier and optionality are shown in the signature.
updatedAtpropertyupdatedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
userIdpropertyuserId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.