begin(Start a provisional streaming direct turn, with no writes or tools until commitment. Parametersinput,options?):HarnessSpeculativeTurn<HarnessTurnResult<HarnessParsedOutput<OutputDefinition>>>
Returns
HarnessSpeculativeTurn<HarnessTurnResult<HarnessParsedOutput<OutputDefinition>>>
HarnessSpeculativeTurn
One speculative direct turn. Text is provisional until commit succeeds. Type Parameters
Properties
result
Observed internally even when a caller discards without awaiting it. textStreamreadonlyresult:Promise<Result>
Single-consumer, provisional text. Consuming it must not cause persistent effects. Methods commit()readonlytextStream:AsyncIterable<string>
commit(First decision wins. Same text returns the same promise; different text rejects. Parametersconfirmed):Promise<Result>
Returns
Promise<Result>
discard()
discard(): boolean
True for a discarded turn (including repeats), false after commit won.
Returns
boolean
HarnessSpeculationConflictError
In-memory ownership and commitment; never opens a storage transaction. Constructors Constructor
new HarnessSpeculationConflictError(): HarnessSpeculationConflictError
Returns
HarnessSpeculationConflictError
Properties
cause?
codeoptionalcause?:unknown
messagereadonlycode:"HARNESS_SPECULATION_CONFLICT"
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
HarnessSpeculationUnsupportedError
Constructors Constructornew HarnessSpeculationUnsupportedError(Parametersdetail):HarnessSpeculationUnsupportedError
Returns
HarnessSpeculationUnsupportedError
Properties
cause?
codeoptionalcause?:unknown
messagereadonlycode:"HARNESS_SPECULATION_UNSUPPORTED"
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