Skip to content

Documentation / @agentick/core / ExecutionRunner

Interface: ExecutionRunner

Defined in: core/src/app/types.ts:144

Properties

name

name: string

Defined in: core/src/app/types.ts:146

Runner identifier (e.g., "default", "repl")

Methods

executeToolCall()?

optional executeToolCall(call, tool, next): Promise<ToolResult>

Defined in: core/src/app/types.ts:182

Wrap individual tool call execution.

Called for each tool call. The next function executes the tool normally (via ToolExecutor). Runners can intercept, transform, or replace execution.

Use cases:

  • REPL: Route execute tool to sandbox, run code with tools as callable functions
  • Logging: Add runner-specific telemetry around tool execution
  • Sandboxing: Run tools in isolated contexts

Parameters

call

ToolCall

The tool call from the model

tool

The resolved executable tool (undefined if not found)

ExecutableTool<(input, ctx?) => ContentBlock[] | Promise<ContentBlock[]>> | undefined

next

() => Promise<ToolResult>

Execute the tool normally (delegates to ToolExecutor)

Returns

Promise<ToolResult>

Tool result


onDestroy()?

optional onDestroy(session): void | Promise<void>

Defined in: core/src/app/types.ts:213

Called when a session is closed/destroyed. Clean up runner resources (sandbox, temp files, etc.).

Parameters

session

SessionRef

Returns

void | Promise<void>


onPersist()?

optional onPersist(session, snapshot): SessionSnapshot | Promise<SessionSnapshot>

Defined in: core/src/app/types.ts:198

Called when a session snapshot is being created. Runner can add its own state to the snapshot.

Parameters

session

SessionRef

snapshot

SessionSnapshot

Returns

SessionSnapshot | Promise<SessionSnapshot>


onRestore()?

optional onRestore(session, snapshot): void | Promise<void>

Defined in: core/src/app/types.ts:207

Called when a session is being restored from a snapshot. Runner can restore its own state from the snapshot.

Parameters

session

SessionRef

snapshot

SessionSnapshot

Returns

void | Promise<void>


onSessionInit()?

optional onSessionInit(session): void | Promise<void>

Defined in: core/src/app/types.ts:192

Called once when the runner is first used by a session. Set up per-session runner state (sandbox, working directory, etc.).

Parameters

session

SessionRef

Returns

void | Promise<void>


transformCompiled()?

optional transformCompiled(compiled, tools): COMInput | Promise<COMInput>

Defined in: core/src/app/types.ts:164

Transform the compiled structure before it reaches the model.

Called per tick, after compilation but before the adapter's fromEngineState flattens COMInput into model-specific format. This lets runners operate on the rich semantic structure (system, timeline, sections, tools, ephemeral).

Use cases:

  • REPL: Replace tool schemas with command descriptions in a section, expose a single execute tool
  • Filtering: Remove tools the model shouldn't see in this runner

Parameters

compiled

COMInput

The COMInput from compilation (timeline, system, sections, tools, etc.)

tools

ExecutableTool<(input, ctx?) => ContentBlock[] | Promise<ContentBlock[]>>[]

The resolved executable tools

Returns

COMInput | Promise<COMInput>

Transformed COMInput (or original if no transformation needed)

Released under the ISC License.