rulvar API reference / @rulvar/core / Engine
Interface: Engine
Defined in: packages/core/src/engine/engine.ts:239
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
stores | readonly | { journal: JournalStore; transcripts: TranscriptStore; } | The engine's configured stores, exposed for shells and hosts (M8 entry amendment: the journal store comes from the engine). Exactly the instances createEngine received, or the defaults it built; no store contract widens through this accessor. With a serialization hook configured these are the HOOKED wrappers, so every reader passes the one policy point (M8-T04). | packages/core/src/engine/engine.ts:271 |
stores.journal | public | JournalStore | - | packages/core/src/engine/engine.ts:271 |
stores.transcripts | public | TranscriptStore | - | packages/core/src/engine/engine.ts:271 |
Methods
deleteRun()
deleteRun(runId): Promise<void>;Defined in: packages/core/src/engine/engine.ts:277
Retention (OQ-20 executed at M8-T04): deletes every blob transcripts.list(runId) returns, then the journal; no orphan blobs survive. The caller owns the decision that the run is done.
Parameters
| Parameter | Type |
|---|---|
runId | string |
Returns
Promise<void>
profileCard()
profileCard(names?): string;Defined in: packages/core/src/engine/engine.ts:261
Renders the registered agent profiles into the shared vocabulary card, optionally filtered to names; the registry itself stays private to the engine (M6-T05 amendment). Unknown names are ignored.
Parameters
| Parameter | Type |
|---|---|
names? | readonly string[] |
Returns
string
pruneRun()
pruneRun(runId): Promise<number>;Defined in: packages/core/src/engine/engine.ts:285
Checkpoint pruning (OQ-20 executed at M8-T04): deletes checkpoint blobs of ok-terminal attempts that no other entry references; returns the count. Parked, cancelled, escalated, and hanging attempts keep theirs (park/unpark, DEF-5 retention, and dangling redispatch boot from them).
Parameters
| Parameter | Type |
|---|---|
runId | string |
Returns
Promise<number>
resume()
resume<A, R>(
runId,
wf?,
options?): ResumeHandle<R>;Defined in: packages/core/src/engine/engine.ts:251
Rebinds a journal to a workflow definition and resumes. Requires wf for in-process workflows; a name mismatch is a typed ConfigError; a body-hash mismatch warns loudly and proceeds (the journal decides replay per content keys). A compiled run resumes WITHOUT wf: the engine rehydrates the persisted source pinned by workflowHash; supplying a compiled wf whose source hash differs from the recorded one is a typed ConfigError (M6-T02).
Type Parameters
| Type Parameter |
|---|
A |
R |
Parameters
| Parameter | Type |
|---|---|
runId | string |
wf? | | CompiledWorkflow | Workflow<A, R> |
options? | ResumeOptions |
Returns
ResumeHandle<R>
run()
run<A, R>(
wf,
args,
opts?): RunHandle<R>;Defined in: packages/core/src/engine/engine.ts:240
Type Parameters
| Type Parameter |
|---|
A |
R |
Parameters
| Parameter | Type |
|---|---|
wf | | CompiledWorkflow | Workflow<A, R> |
args | A |
opts? | RunOptions |
Returns
RunHandle<R>