Skip to content
Français

defineInteractiveAgentTask

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

Declare an agent dialogue that asks humans questions between turns. Each turn runs in a new sandbox on a retained named branch and continues the captured conversation; a question leaves the task waiting-input until start() receives an answer. Requires a checkpointed run and throws with code configuration for an agent without portable capture and resume.

Complete example and detailed rules.

  • optionsRequired
    InteractiveAgentTaskOptions
    Agent, repository, authorized respondents and bounded dialogue settings.
  • options.keyRequired
    string
    Stable workflow task key; also participates in the retained branch identity.
  • options.afterOptional
    readonly Task<unknown>[] | undefined
    Dependencies that must finish successfully before the first turn.
  • options.repositoryRequired
    string
    Host Git checkout containing the retained worktree and default conversation storage; must remain accessible on resume.
  • options.agentRequired
    Agent
    Agent with portable conversation capture and resume; otherwise defineInteractiveAgentTask() throws with code configuration.
  • options.briefRequired
    string
    Literal initial instructions; human replies are supplied separately on subsequent turns.
  • options.actorsRequired
    readonly string[]
    Nonempty unique identifiers allowed to answer; the application must authenticate their users.
  • options.sandboxProviderOptional
    SandboxProvider | undefined
    Provider that allocates a new sandbox for each turn, default createDockerSandboxProvider().
  • options.bootstrapOptional
    boolean | undefined
    Whether each turn’s sandbox may install a missing CLI agent, default true.
  • options.conversationHomeOptional
    string | undefined
    Host home used to locate captured native conversations across turns.
  • options.maxTurnsOptional
    number | undefined
    Maximum completed agent turns, including the final result; defaults to 12. A question at the last turn fails instead of waiting indefinitely.
  • options.timeoutMsOptional
    number | undefined
    Cooperative deadline for each executing task attempt, excluding time waiting for a human answer.

Task<InteractiveAgentResult>

export declare function defineInteractiveAgentTask(
  options: InteractiveAgentTaskOptions,
): Task<InteractiveAgentResult>;