Polyman Documentation - v3.1.0
    Preparing search index...

    Implements AgentSessionApi with scripted turns.

    Implements

    Index
    history: Message[] = []
    scale: number
    turn: number = 0
    ids: number = 0
    abort: AbortController | null = null
    waiting: Map<string, (decision: ApprovalDecision) => void> = ...
    • Waits ms (times the scale), or throws when the turn is cancelled.

      Parameters

      • ms: number
      • signal: AbortSignal

      Returns Promise<void>

    • Streams text in small chunks, like a model.

      Parameters

      • text: string
      • signal: AbortSignal

      Returns Promise<void>

    • Emits approval_needed (or the plan approval) and waits for the answer.

      Parameters

      • approval:
            | {
                type: "approval_needed";
                approvalId: string;
                callId: string;
                title: string;
                command?: string;
                preview?: string;
            }
            | { type: "plan_approval_needed"; approvalId: string; plan: Plan }
      • signal: AbortSignal

      Returns Promise<ApprovalDecision>

    • Parameters

      • input: number
      • output: number
      • costUsd: number

      Returns void

    • Runs the script of one turn and returns the last answer text.

      Parameters

      • turn: number
      • text: string
      • signal: AbortSignal

      Returns Promise<string>

    • An answer with headings and a code block, to see the markdown look.

      Parameters

      • signal: AbortSignal

      Returns Promise<string>

    • Parameters

      • callId: string
      • passed: boolean
      • signal: AbortSignal

      Returns Promise<void>

    • The scripted prove_idea run: it finds a wrong sample.

      Parameters

      • signal: AbortSignal

      Returns Promise<string>

    • The scripted find_ideas run, with no approval: it only thinks.

      Parameters

      • signal: AbortSignal

      Returns Promise<string>