Skip to content
Français

createAgent

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

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.

  • optionsRequired
    CliAgentOptions
    Harness and model selection to bind into one executable agent.
  • options.harnessRequired
    CliHarness
    CLI preset, such as createCodexHarness(), bound to model when the agent is created.
  • options.modelOptional
    ModelSpec | undefined
    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.
  • optionsRequired
    CustomAgentOptions
    Harness and model selection to bind into one executable agent.
  • options.harnessRequired
    Harness
    Built-in Outpost harness with its configured model provider.
  • options.modelRequired
    ModelSpec
    Model name or { name, reasoning, maxOutputTokens }. The model provider rejects unsupported reasoning or output limits here; the service checks the model name when it is called.

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

  • optionsRequired
    AgentOptions
    Harness and model selection to bind into one executable agent.
  • options.harnessRequired
    CliHarness | Harness
    CLI preset, such as createCodexHarness(), bound to model when the agent is created.
  • options.modelVariant-dependent
    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;

export declare function createAgent(options: CustomAgentOptions): CustomAgent;

export declare function createAgent(options: AgentOptions): Agent;