Header menu logo Nao

DefinitionBuilder Module

Builds runnable domain objects from parsed definitions

Functions and values

Function or value Description

buildAgent provider tools subAgents def

Full Usage: buildAgent provider tools subAgents def

Parameters:
Returns: IAgent

Build an IAgent from an AgentDef using the provided factory (or default Orchestrator).

provider : ILlmProvider
tools : Tool list
subAgents : IAgent list
def : AgentDef
Returns: IAgent

buildAgentWithFactory factory provider tools subAgents bus scope context memory def

Full Usage: buildAgentWithFactory factory provider tools subAgents bus scope context memory def

Parameters:
Returns: IAgent

Build an IAgent from an AgentDef using a custom factory.

factory : IOrchestratorFactory
provider : ILlmProvider
tools : Tool list
subAgents : IAgent list
bus : IEventBus
scope : EventScope
context : ToolContext
memory : OrchestratorMemoryConfig
def : AgentDef
Returns: IAgent

buildConstitution def

Full Usage: buildConstitution def

Parameters:
Returns: Constitution

Build a Constitution from a ConstitutionDef

def : ConstitutionDef
Returns: Constitution

buildConstitutionRule def

Full Usage: buildConstitutionRule def

Parameters:
Returns: ConstitutionRule

Build a ConstitutionRule from a ConstitutionRuleDef. The Pattern field becomes a regex-based Check function.

def : ConstitutionRuleDef
Returns: ConstitutionRule

buildEvalDataset def

Full Usage: buildEvalDataset def

Parameters:
Returns: EvalDataset

Build an EvalDataset from an EvalSuiteDef

def : EvalSuiteDef
Returns: EvalDataset

buildMergedConstitution defs

Full Usage: buildMergedConstitution defs

Parameters:
Returns: Constitution option

Build a merged Constitution from multiple ConstitutionDefs

defs : ConstitutionDef list
Returns: Constitution option

buildOrchestratorConfig provider tools subAgents def

Full Usage: buildOrchestratorConfig provider tools subAgents def

Parameters:
Returns: OrchestratorConfig

Build an OrchestratorConfig from an AgentDef

provider : ILlmProvider
tools : Tool list
subAgents : IAgent list
def : AgentDef
Returns: OrchestratorConfig

buildPromptTool provider def prompt

Full Usage: buildPromptTool provider def prompt

Parameters:
Returns: Tool

Build a prompt-defined Tool: invoking the tool completes its prompt against the given LLM provider. The caller is responsible for any conversation/memory context (the runtime prepends it to the input before invoking the tool).

provider : ILlmProvider
def : ToolDef
prompt : Prompt
Returns: Tool

buildTool def

Full Usage: buildTool def

Parameters:
Returns: Tool

Build a Tool from a ToolDef using the host-default runtime policy (each tool uses its own declared runtime, executed on the host).

def : ToolDef
Returns: Tool

buildToolWith policy def

Full Usage: buildToolWith policy def

Parameters:
Returns: Tool

Build a Tool from a ToolDef, applying the given session runtime policy. Only executable tools are built here; prompt tools require an LLM provider and must be built via `buildPromptTool`. Async executable tools are built inline (the async wrapping is layered on separately by `wrapAsyncTool`).

policy : RuntimePolicy
def : ToolDef
Returns: Tool

registerExecutor name executor

Full Usage: registerExecutor name executor

Parameters:

Register a custom tool executor by name

name : string
executor : IToolExecutor

removeExecutor name

Full Usage: removeExecutor name

Parameters:
    name : string

Remove a custom tool executor

name : string

resolveProcessLauncher policy toolRuntime cmd

Full Usage: resolveProcessLauncher policy toolRuntime cmd

Parameters:
Returns: string * string list
 Compute the actual launcher command and leading arguments for a process tool,
 applying the tool's declared runtime and the session runtime policy.

 The resolution order is:
   1. A session `ForceRuntime` overrides the tool's declared runtime.
   2. The (effective) runtime wraps the raw command, e.g.
      deno -> `deno run -A `; native -> `` unchanged.
   3. A `Containerized` policy wraps the whole thing in
      `docker run --rm -v :/work -w /work  `.

 Returns (launcherExecutable, leadingArgs) — the tool's own fixed args and the
 per-call input are appended to leadingArgs by the caller.
policy : RuntimePolicy
toolRuntime : string
cmd : string
Returns: string * string list

wrapAsyncTool def inlineTool

Full Usage: wrapAsyncTool def inlineTool

Parameters:
Returns: Tool

Layer asynchronous execution onto an already-built (inline) executable tool. When a session task host is available on the ambient `SessionExecution` scope, invoking the tool spawns a background "tool" task and immediately returns a tracking token instead of blocking; otherwise it falls back to running the tool inline.

def : ToolDef
inlineTool : Tool
Returns: Tool

Type something to start searching.