run.result() resolves once with how the run ended, including a pause.
check() returns the engine’s local findings report, or the server’s typed
acknowledgement or refusal for a served name. run.cancel() may acknowledge a
pending request; it never replaces run.result(). Methods that need a server
throw NikaCompatibilityError on the local transport. The three artifact
methods reject the same way, before any request, on a server whose /health
does not list artifacts; attachRun() handles have them too, and artifact
is a manifest name or the entry itself. The run-handle methods
are bound to their run; only the deprecated facade wrappers
(nika.events(run), nika.cancel(run), nika.status(run)) check that a run
belongs to this client, with NikaRunOwnershipError.
compile() asks the engine for a candidate workflow and runs nothing:
ready, incomplete and refused all resolve as data. A ready candidate
is ordinary .nika source; write it to a file and run(path) admits it
again. Over HTTP it calls POST /v1/compile when the server’s /health
lists compile. A provider round is opt-in: cognition: 'explicitProvider'
on a server that lists compileNativeV2, or authoringModel on a local
engine. nextCompileRequest(request, outcome, answers) builds the next round
from the outcome’s questions, and isNikaCompileHeld(outcome) tells a
candidate the verifier held, a preview never to run. The package’s
compile guide
covers both doors.
Two functions read a frame instead of calling the engine. From 0.124.2,
readNikaAccessRequirement(event) returns the access contract a workflow file
declares (NikaAccessRequirement) and readNikaAccessSelection(event) the
per-call receipt of what the route did with it (NikaAccessSelection). Both
take a NikaRunEvent or the engine frame it wraps, return undefined when
the frame carries no such row, and throw NikaProtocolError on a row that is
present and malformed.
Read the access contract and its receipt
shows them on a run.
From 0.124.3, accessOffer(workflow) asks a nika serve what the sessions
of a served workflow’s own declared ACP route offer now: the models, the
exact reasoning efforts and the service tiers, read without a prompt. It
needs a server whose /health lists accessSessionOffer; on another server,
and on the local transport, it rejects with NikaCompatibilityError before
any request. The answer authorizes nothing: run() is admitted as before.
Compatibility aliases
Compatibility aliases
nika.events(run), nika.cancel(run), nika.status(run) and run.done
remain as deprecated aliases through the compatibility window. run.done
is the same promise as run.result(); the facade wrappers forward to the
handle methods unchanged.Configuration
Constructor and operation options.
Types
Expand the public projections.