Skip to content

rulvar API reference


rulvar API reference / @rulvar/rulvar / OrchestratorExtensionIO

Interface: OrchestratorExtensionIO

Defined in: packages/core/dist/index.d.ts

The per-run IO the extension closes over (engine-owned effects).

Properties

PropertyModifierTypeDescriptionDefined in
admissionreadonlyAdmissionControllerThe single admission point for all spawns.packages/core/dist/index.d.ts
baseScopereadonlystringThe scope the orchestrate call runs in ('' at the top level).packages/core/dist/index.d.ts
gatesreadonlyRecord<string, unknown>The per-engine mechanical gate registry: named pure functions over AgentResult.artifacts. Typed loose at the seam exactly like profiles.packages/core/dist/index.d.ts
profilesreadonlyRecord<string, unknown>Registered agent profiles advertised to this orchestrate call.packages/core/dist/index.d.ts
runCeilingUsd?readonlynumberThe run USD ceiling (B0), when one exists.packages/core/dist/index.d.ts
runIdreadonlystring-packages/core/dist/index.d.ts

Methods

abandonBranch()

ts
abandonBranch(attempt): Promise<{
  applied: boolean;
  seq: number;
}>;

Defined in: packages/core/dist/index.d.ts

Appends the severing abandon ref-entry over a branch through the ResolutionArbiter (DEF-4/DEF-5).

Parameters

ParameterType
attempt{ authorizedBy: number; logicalTaskId?: string; nodeId?: string; reason: string; retainCheckpoint?: boolean; retainWorktree?: boolean; target: number; }
attempt.authorizedBynumber
attempt.logicalTaskId?string
attempt.nodeId?string
attempt.reasonstring
attempt.retainCheckpoint?boolean
attempt.retainWorktree?boolean
attempt.targetnumber

Returns

Promise<{ applied: boolean; seq: number; }>


append()

ts
append(input): Promise<JournalEntry>;

Defined in: packages/core/dist/index.d.ts

Total-order append; the extension owns its scopes' content keys.

Parameters

ParameterType
inputExtensionAppendInput

Returns

Promise&lt;JournalEntry&gt;


cancel()

ts
cancel(handle, reason?): Promise<{
  cancelled: boolean;
  handle: number;
}>;

Defined in: packages/core/dist/index.d.ts

Cancels an in-flight child by handle (AbortSignal).

Parameters

ParameterType
handlenumber
reason?string

Returns

Promise<{ cancelled: boolean; handle: number; }>


dispatch()

ts
dispatch(
   spec, 
   childScope, 
   identity): Promise<{
  handle: number;
}>;

Defined in: packages/core/dist/index.d.ts

Dispatches one child agent under the EXPLICIT child scope through the ordinary ctx.agent path (semaphore, budget layers, forward matching). Returns the journal-derived handle (the dispatch seq).

Parameters

ParameterType
specExtensionDispatchSpec
childScopestring
identity{ logicalTaskId: string; nodeId: string; }
identity.logicalTaskIdstring
identity.nodeIdstring

Returns

Promise<{ handle: number; }>


emit()

ts
emit(event): void;

Defined in: packages/core/dist/index.d.ts

Telemetry emission into the run event stream.

Parameters

ParameterType
event{ type: string; } & Record&lt;string, unknown&gt;

Returns

void


flush()

ts
flush(): Promise<void>;

Defined in: packages/core/dist/index.d.ts

Flushes the serialized append queue before reading back.

Returns

Promise&lt;void&gt;


mintId()

ts
mintId(): string;

Defined in: packages/core/dist/index.d.ts

ULID minting for engine-owned identifiers (NodeIds).

Returns

string


orchestratorScope()

ts
orchestratorScope(): string;

Defined in: packages/core/dist/index.d.ts

The orchestrator's child scope (agent:<seq>); throws before the loop starts.

Returns

string


priceUsd()

ts
priceUsd(servedBy, usage): number | undefined;

Defined in: packages/core/dist/index.d.ts

The engine price fold (journal facts in, USD out).

Parameters

ParameterType
servedBystring | undefined
usageUsage

Returns

number | undefined


random()

ts
random(key?): Promise<number>;

Defined in: packages/core/dist/index.d.ts

A journaled random draw in `0, 1) under the orchestrate scope: the ctx.random primitive, computed once live and replayed by match. The spot-check gate draws HERE, never Math.random.

Parameters

ParameterType
key?string

Returns

Promise&lt;number&gt;


registerAlias()

ts registerAlias(donorScope, targetScope): void;

Defined in: [packages/core/dist/index.d.ts`

Registers a node.link scope-prefix alias for forward matching (DEF-5). Idempotent; rebuilt by fold on resume.

Parameters

ParameterType
donorScopestring
targetScopestring

Returns

void


settledOf()

ts
settledOf(handle): 
  | AgentResult<unknown>
  | undefined;

Defined in: packages/core/dist/index.d.ts

The settled result of a dispatched child, when it settled.

Parameters

ParameterType
handlenumber

Returns

| AgentResult&lt;unknown&gt; | undefined


snapshot()

ts
snapshot(): readonly JournalEntry[];

Defined in: packages/core/dist/index.d.ts

The pinned journal view backing every pure fold.

Returns

readonly JournalEntry[]