Skip to content
Français

createAgent

import { createAgent } from "@elie-laloum/outpost";

Compose a harness and a model into a frozen agent, without starting a process or making a network request. A reasoning level or maxOutputTokens the harness cannot apply throws code configuration at once. Without a model, a CLI harness keeps its native default; the built-in harness throws.

Complete example and detailed rules.

The fields below cover all variants; the signature specifies their allowed combinations.

  • optionsRequired
    CliAgentOptions | CustomAgentOptions | AgentOptions
    Harness and model selection to bind into one executable agent.
  • options.harnessRequired
    CliHarness | Harness | CliHarness | Harness
    CLI preset, such as createCodexHarness(), bound to model when the agent is created.
  • options.modelVariant-dependent
    ModelSpec | undefined | ModelSpec | ModelSpec | undefined | ModelSpec
    Model name or { name, reasoning, maxOutputTokens }; the preset rejects unsupported reasoning or maxOutputTokens here. Omitted, the CLI uses its default model, except that Kimi usage authentication and a Codex modelProvider require one.

CliAgent · CustomAgent · Agent

export declare function createAgent(options: CliAgentOptions): CliAgent;