AxAgentSharedRuntimeSession
Coordinates one runtime session across the pipeline’s distiller and
executor phases. Created per AxAgent.forward() by the pipeline, handed to
both actor runs, closed by the pipeline.
Shared mode requires a JavaScript-capable runtime (the phase boundary is an
in-session snippet). For other runtimes the pipeline keeps mode: 'fallback': each stage runs in its own session exactly as before, and the
evidence value crosses through the host into the executor’s runtime
globals — correctness preserved, zero-copy lost.
Constructors
Constructor
new AxAgentSharedRuntimeSession(options?: Readonly<{
mode?: "shared" | "fallback";
}>): AxAgentSharedRuntimeSession;Parameters
| Parameter | Type |
|---|---|
options? | Readonly<{ mode?: "shared" | "fallback"; }> |
Returns
AxAgentSharedRuntimeSession
Properties
| Property | Modifier | Type | Default value | Description |
|---|---|---|---|---|
excludeFieldDeletions | public | readonly string[] | [] | Executor-stage field deletions applied at the phase boundary. |
fallbackEvidence | public | undefined | Record<string, unknown> | undefined | Fallback mode only: the real evidence value held host-side. |
mode | readonly | "shared" | "fallback" | undefined | - |
phase | public | AxSharedSessionPhase | 'distiller' | - |
phase1ReservedNames | public | readonly string[] | [] | Phase-1 system/alias names, excluded from the executor phase’s runtime inspection so inherited context aliases don’t render as user variables. |
restoredEntries | public | | undefined | AxCodeSessionSnapshotEntry[] | undefined | Entries actually restored into the phase-1 session from restoreState, kept for the distiller’s restore notice / live-state rendering. |
restoreState | public | undefined | AxAgentState | undefined | Cross-run state (from the coordinator’s canonical executor-held AxAgentState). Variable bindings are applied once when the phase-1 session is adopted; stage-level prompt state stays with each stage. |
session | public | undefined | AxCodeSession | undefined | - |
Accessors
isShared
Get Signature
get isShared(): boolean;Returns
boolean
Methods
adoptDistillerSession()
adoptDistillerSession(session: AxCodeSession, options: Readonly<{
reservedNames: readonly string[];
signal?: AbortSignal;
}>): Promise<void>;Adopt the freshly created phase-1 session: apply cross-run variable
bindings, install the in-worker final wrapper, remember reserved names.
Parameters
| Parameter | Type |
|---|---|
session | AxCodeSession |
options | Readonly<{ reservedNames: readonly string[]; signal?: AbortSignal; }> |
Returns
Promise<void>
beginExecutorPhase()
beginExecutorPhase(options: Readonly<{
aliasNames: readonly string[];
inputs: Record<string, unknown>;
phaseGlobals: Record<string, unknown>;
signal?: AbortSignal;
}>): Promise<void>;Transition the adopted session into the executor phase. phaseGlobals
are the executor run’s host closures (final/askClarification/llmQuery/
tools/…) patched over the phase-1 bindings; inputs are the executor’s
input values merged per key.
Parameters
| Parameter | Type |
|---|---|
options | Readonly<{ aliasNames: readonly string[]; inputs: Record<string, unknown>; phaseGlobals: Record<string, unknown>; signal?: AbortSignal; }> |
Returns
Promise<void>
close()
close(): void;Returns
void
mergeInputs()
mergeInputs(inputs: Record<string, unknown>, options?: Readonly<{
signal?: AbortSignal;
}>): Promise<void>;Mid-phase per-key input sync (replaces wholesale inputs patches).
Parameters
| Parameter | Type |
|---|---|
inputs | Record<string, unknown> |
options? | Readonly<{ signal?: AbortSignal; }> |
Returns
Promise<void>
replaceSession()
replaceSession(session: AxCodeSession): void;Session-death recovery mid-phase: the runtime context recreated a fresh
session; track it so close() targets the live one. Inherited state is
gone, which matches the existing per-stage restart semantics.
Parameters
| Parameter | Type |
|---|---|
session | AxCodeSession |
Returns
void