createHarnessStepContext(Parametersports,options):HarnessStepContext
Returns
HarnessStepContext
On the Agent Runtime
The step memo is a table in the SQL port, written in transactions around the step’s function.ports.sql.exec()runs on the instance’s own SQLite database,this.ctx.storage.sql. The memo’s table sits beside the run ledger’s.ports.sql.transactionSync()isthis.ctx.storage.transactionSync(). A transaction that throws is rolled back whole.
HarnessStepContext
Properties isContinuationTrue only when this persistent run is replaying after interruption or approval. runIdreadonlyisContinuation:boolean
Private persistent run identity for harness-owned continuation state. Methods associateToolCallJournal()readonlyrunId:string
associateToolCallJournal(Associates this provider step’s correlation IDs with its already-reserved persistent positions. Parameterscalls):ReadonlyMap<string,string>
Returns
ReadonlyMap<string, string>
isCompleted()
isCompleted(True only when this exact persistent step has committed its memoized output. Parametersname,options?):boolean
Returns
boolean
nextToolCallOrdinal()
nextToolCallOrdinal(Allocates a run-scoped logical tool position independent of provider call IDs. ParameterstoolName,toolCallId):number
Returns
number
reconcileToolCallJournal()
reconcileToolCallJournal(Reconciles harness-owned journal markers with persistent message history. ParametersjournalMarkers):void
Returns
void
step()
step<Executes a named effect once per stable run/input/version identity, then persistently returns its JSON-safe output on replay. External effects are at-least-once: an interruption after the effect starts is outcome-unknown, never silently retried. Type ParametersT>(name,fn,options?):Promise<T>
Parameters
Returns
Promise<T>
HarnessStepContextOptions
Properties checkpoints?Deterministic test seam. Production callers must not use this to infer external-effect success. inputreadonlyoptionalcheckpoints?:HarnessCheckpoint
isContinuation?readonlyinput:unknown
True only when this persistent run is replaying after interruption or approval. runIdreadonlyoptionalisContinuation?:boolean
versionreadonlyrunId:string
readonlyversion:string
HarnessStepOptions
Properties beforeEffect?Private synchronous hook committed with the external effect-start fence. ReturnsreadonlyoptionalbeforeEffect?: () =>void
void
external?
Marks a call that can mutate an external system and therefore needs reconciliation after an interrupted effect. input?readonlyoptionalexternal?:boolean
JSON-safe effect input used for this step’s persistent memo fingerprint. version?readonlyoptionalinput?:unknown
Explicit effect contract version used for this step’s persistent memo identity.readonlyoptionalversion?:string
HarnessStepOutputSerializationError
Private persistent marker that never shares the tool-output value channel. Constructors Constructor
new HarnessStepOutputSerializationError(): HarnessStepOutputSerializationError
Returns
HarnessStepOutputSerializationError
Properties
cause?
messageoptionalcause?:unknown
message: string
name
name: string
stack?
stackTraceLimitoptionalstack?:string
ThestaticstackTraceLimit:number
Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.
Methods
captureStackTrace()
Creates astaticcaptureStackTrace(targetObject,constructorOpt?):void
.stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
Returns
void
prepareStackTrace()
ParametersstaticprepareStackTrace(err,stackTraces):any
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
isToolOutputSerializationFailure()
isToolOutputSerializationFailure(Parametersvalue):boolean
Returns
boolean