Skip to main content
compile() asks the engine for a candidate .nika workflow and runs nothing. Every outcome is data: ready, incomplete and refused all resolve, with the candidate, the engine’s questions and its diagnostics. It works on both doors; this page uses the local engine.

Without a model

Offline, the deterministic compiler resolves the exact skeleton names nika compile --list shows, settles bounded intents (such as filtering rows of a file), and edits the constants of an existing workflow. No provider is called, whatever keys your environment holds.
compile.mts
The third request’s summary needs a model every time it runs, so the compiler asks which one (model). Its “every morning at 9” is a trigger, not a task: the engine records it as requested_trigger (cron: 0 9 * * *) for a schedule to bind later, and the candidate’s bytes carry no cadence. The trigger.* questions are not mandatory: they belong to that later schedule.

Answer the questions

nextCompileRequest(request, outcome, answers) builds the next round from an incomplete outcome, keyed by each question’s key. The deterministic compiler settles this request’s structure; only the run-time model is open:
answer.mts
compile_version: 1 means no provider was called. The answer only names the model the workflow will use when it runs; nothing is spent until you run it, with that provider’s key.

One sentence, two rounds, no model call. author.mts sends Every morning, summarize ./inbox/*.md into ./digest.md. Round 1 is incomplete: one required question, the run-time model, four optional ones, and every morning recorded as a trigger, not a task. Answering model = mock/echo through nextCompileRequest() makes round 2 ready, with no provider call; the daily schedule still requires_binding. The candidate checks clean and is kept as digest.nika: it asks to read ./inbox/**, write ./digest.md and call nika:assert, nika:glob, nika:jq, nika:read and nika:write, and nika check plans it in nine waves. Nothing runs. Recorded in a terminal from @supernovae-st/nika 0.123.0 and its bundled engine nika 0.123.0 (0bfde3765).

The candidate is source, not a run

A ready candidate is ordinary .nika text. Review it, write it to a file, then run() it: the normal admission applies again.
Locally, a request can name output to have the engine write a ready candidate for you; the outcome then reports written:
  • requested_boundary and the source-only check_preview grant no authority: nika check and nika run judge the real environment.
  • Compile creates no run, job, approval or proof. A local engine keeps its plan records under .nika/compile/; an HTTP compile writes nothing.
  • signal and timeoutMs stop only the compile request.
  • An outcome has compile_version 1 when no provider was called, 2 when one was, with its receipt in provenance.authoring.

With a model

A provider reads free intent only when the request opts in, and you choose the model:
Answer its questions with nextCompileRequest() as above. When the verifier does not accept a candidate, the outcome stays incomplete and isNikaCompileHeld(outcome) is true: that candidate is a preview, never a workflow to run. Over HTTP, cognition: 'explicitProvider' on a default server, one started without --authoring-model, throws NikaCompatibilityError (capability: 'compileNativeV2') instead of falling back.

Bounded authoring

The skeletons and bounded intents the deterministic compiler settles.

The terminal Session

The same compiler, in a conversation.

Method index

Every method and the door it needs.

Types

NikaCompileOutcome and its fields.