Skip to content

rulvar API reference


rulvar API reference / @rulvar/planner

@rulvar/planner

Classes

ClassDescription
WorkerSandboxRunnerAccepts CompiledWorkflow ONLY: feeding a closure is a type error.

Interfaces

InterfaceDescription
CompileScriptOptions@rulvar/planner: rulvar flagship hybrid mode: plan agent, compileScript, WorkerSandboxRunner, self-repair loop (https://docs.rulvar.com/guide/planner). The surface lands across M6.
M6CassetteFixtureThe cassette file shape shared with the M3 sets.
PlanDiagnosticOne repair-loop diagnostic: lint and compile findings share the shape.
PlanOptions-
PlanResult-
ScriptDiagnosticOne machine-readable compileScript diagnostic (carried by ScriptRejected).
WorkerSandboxRunnerOptions-

Variables

VariableDescription
DEFAULT_SANDBOX_MEMORY_MB-
DEFAULT_SANDBOX_TIMEOUT_MS-
SANDBOX_DETERMINISM_RUN_ID-
SANDBOX_DETERMINISM_SOURCEA script exercising agents, parallel, step, and every seeded shim.
SANDBOX_GLOBALSThe exact curated sandbox global set, in canonical order. The worker binds the ctx methods as bare globals under these names and the API card teaches exactly this list.
SELF_REPAIR_BAD_DRAFTThe failing first draft: bare Date.now trips rulvar/no-bare-date.
SELF_REPAIR_GOAL-
SELF_REPAIR_GOOD_DRAFTThe repaired draft the fake planner returns once diagnostics arrive.
SELF_REPAIR_RUN_ID-

Functions

FunctionDescription
apiCardRenders the sandbox-dialect API card; pure and byte-stable.
compileScript@rulvar/planner: rulvar flagship hybrid mode: plan agent, compileScript, WorkerSandboxRunner, self-repair loop (https://docs.rulvar.com/guide/planner). The surface lands across M6.
extractScriptThe model may fence the script; the extractor takes the first fenced block when one exists, else the whole reply, and is deterministic.
lintScriptLints a script BODY with the workflows preset plus compileScript. The body is wrapped in an async function for parsing (top-level return/await are legal in the dialect); reported lines shift back so they index into the body source.
normalizeCassetteEntriesThe M3-convention cassette normalization: wall clock and spans only.
plan-
planRunIdOfThe deterministic planner runId: one goal, one journal.
runPlannedplan-then-run in one call (amended during M6-T05: the composition is async because planning itself is a run).
runPlannerSelfRepairOne planner-self-repair run: the first draft fails lint, the JSON diagnostics ride the repair prompt, the second draft compiles. Returns the normalized planning journal plus the plan result.
runSandboxDeterminismOne fresh sandbox-determinism run on a fresh store; two invocations with the same worker produce byte-identical normalized journals (the cassette assertion). The adapter factory keeps @rulvar/testing out of the planner's dependency graph.
scriptDiagnosticsOf@rulvar/planner: rulvar flagship hybrid mode: plan agent, compileScript, WorkerSandboxRunner, self-repair loop (https://docs.rulvar.com/guide/planner). The surface lands across M6.