Skip to main content
createNodeAgentHarnessPorts<State>(options): NodeAgentHarnessPorts<State>
Construct a deterministic plain-Node ports adapter. Type Parameters Parameters Returns NodeAgentHarnessPorts<State>

NodeAgentHarnessPorts

Deterministic plain-Node implementation of AgentHarnessPorts v2. KV-like data is in memory and survives reopen() only; SQL is file-backed through Node’s experimental node:sqlite API and requires Node 22.13 or newer without runtime flags. This is a contract-test host, not a production persistence claim. Type Parameters Constructors Constructor
new NodeAgentHarnessPorts<State>(options, backing?): NodeAgentHarnessPorts<State>
Parameters Returns NodeAgentHarnessPorts<State> Properties activation
readonly activation: Readonly<{ }>
Opaque host-owned token stable for one live actor activation. Implementation of AgentHarnessPorts.activation authorization
readonly authorization: HarnessAuthorizationPort | undefined
Omitted until a host supplies the production gateway-attested provider. Approval paths fail closed. Implementation of AgentHarnessPorts.authorization clock
readonly clock: Readonly<{ now(): number; }>
Implementation of AgentHarnessPorts.clock environment
readonly environment: Readonly<Record<string, unknown>>
Implementation of AgentHarnessPorts.environment events
readonly events: AgentHarnessEventPort
Implementation of AgentHarnessPorts.events identity
readonly identity: Readonly<{ id: string; }>
Implementation of AgentHarnessPorts.identity messages
readonly messages: AgentHarnessMessagePort
Implementation of AgentHarnessPorts.messages sql
readonly sql: AgentHarnessSqlPort
Implementation of AgentHarnessPorts.sql state
readonly state: AgentHarnessStatePort<State>
Implementation of AgentHarnessPorts.state tasks
readonly tasks: AgentHarnessTaskPort
Implementation of AgentHarnessPorts.tasks version
readonly version: 2
Implementation of AgentHarnessPorts.version Methods close()
close(): void
Close the fixture-owned SQLite database. Idempotent. Returns void reopen()
reopen(): NodeAgentHarnessPorts<State>
Reconstruct the adapter while retaining its in-process persistent backing. Returns NodeAgentHarnessPorts<State> runDue()
runDue(dispatch): Promise<number>
Pump due tasks for deterministic Node tests. This is a host control, not an AgentHarnessPorts method or a persistent run-status API. Parameters Returns Promise<number>

NodeAgentHarnessPortsOptions

Options for the deterministic plain-Node adapter. Type Parameters Properties authorization?
optional authorization?: HarnessAuthorizationPort
Deterministic authorization adapter for tests; production hosts provide an attested gateway provider. databasePath
databasePath: string
environment?
optional environment?: Readonly<Record<string, unknown>>
id
id: string
initialState
initialState: () => State
Returns State now
now: () => number
Returns number onStateChanged?
optional onStateChanged?: (next, prev) => void | Promise<void>
Optional Agent-compatible hook fired after a state merge or replacement is committed. A rejection propagates without rolling the committed state back. Parameters Returns void | Promise<void>