rulvar API reference / @rulvar/planner
@rulvar/planner
Classes
| Class | Description |
|---|---|
| WorkerSandboxRunner | Accepts CompiledWorkflow ONLY: feeding a closure is a type error. |
Interfaces
| Interface | Description |
|---|---|
| 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. |
| M6CassetteFixture | The cassette file shape shared with the M3 sets. |
| PlanDiagnostic | One repair-loop diagnostic: lint and compile findings share the shape. |
| PlanOptions | - |
| PlanResult | - |
| ScriptDiagnostic | One machine-readable compileScript diagnostic (carried by ScriptRejected). |
| WorkerSandboxRunnerOptions | - |
Variables
| Variable | Description |
|---|---|
| DEFAULT_SANDBOX_MEMORY_MB | - |
| DEFAULT_SANDBOX_TIMEOUT_MS | - |
| SANDBOX_DETERMINISM_RUN_ID | - |
| SANDBOX_DETERMINISM_SOURCE | A script exercising agents, parallel, step, and every seeded shim. |
| SANDBOX_GLOBALS | The 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_DRAFT | The failing first draft: bare Date.now trips rulvar/no-bare-date. |
| SELF_REPAIR_GOAL | - |
| SELF_REPAIR_GOOD_DRAFT | The repaired draft the fake planner returns once diagnostics arrive. |
| SELF_REPAIR_RUN_ID | - |
Functions
| Function | Description |
|---|---|
| apiCard | Renders 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. |
| extractScript | The model may fence the script; the extractor takes the first fenced block when one exists, else the whole reply, and is deterministic. |
| lintScript | Lints 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. |
| normalizeCassetteEntries | The M3-convention cassette normalization: wall clock and spans only. |
| plan | - |
| planRunIdOf | The deterministic planner runId: one goal, one journal. |
| runPlanned | plan-then-run in one call (amended during M6-T05: the composition is async because planning itself is a run). |
| runPlannerSelfRepair | One 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. |
| runSandboxDeterminism | One 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. |