gatelineAPI reference
interface AgentOptions {
    adapter: string;
    controlPlane: string;
    createWorkspaceImpl?: (opts: CreateWorkspaceOptions) => Promise<Workspace>;
    fetchImpl?: (
        input: string | Request | URL,
        init?: RequestInit,
    ) => Promise<Response>;
    getHeadImpl?: (ws: Workspace) => Promise<string>;
    harvestAndPushImpl?: (
        ws: Workspace,
        branch: string,
        pathspecs: string[],
        base: string,
        identity: { email: string; name: string },
        slug: string,
        role: string,
    ) => Promise<HarvestResult>;
    log?: (line: string) => void;
    manifestLoaderImpl?: (
        repoDir: string,
        adapter: string,
        prefixHint?: string,
    ) => Promise<HeadlessManifest>;
    maxCycles?: number;
    pollIntervalMs: number;
    prefixHint?: string;
    repoUrl?: string;
    resolveFrameworkRootsImpl?: (
        repoDir: string,
        prefixHint?: string,
    ) => Promise<FrameworkRoots>;
    runCommandImpl?: (
        cmd: string,
        args: string[],
        cwd: string,
        timeoutMs: number,
    ) => Promise<RunResult>;
    sleep?: (ms: number) => Promise<void>;
    token: string;
    workDir: string;
}

Properties

adapter: string

Which adapter's manifest.json governs the command this agent runs — the sole source of adapter identity (R8, AC8.2): pointing this option at a different adapter changes what command runs with zero code changes here.

controlPlane: string
createWorkspaceImpl?: (opts: CreateWorkspaceOptions) => Promise<Workspace>
fetchImpl?: (
    input: string | Request | URL,
    init?: RequestInit,
) => Promise<Response>

Injection seams for tests — production callers never set these.

getHeadImpl?: (ws: Workspace) => Promise<string>

Type declaration

    • (ws: Workspace): Promise<string>
    • The workspace's current HEAD — callers capture this before the harness runs (review-04.md round-2 F8: base must be the pre-harness commit, not post, since the harness itself is instructed to commit its own work).

      Parameters

      • ws: Workspace

      Returns Promise<string>

harvestAndPushImpl?: (
    ws: Workspace,
    branch: string,
    pathspecs: string[],
    base: string,
    identity: { email: string; name: string },
    slug: string,
    role: string,
) => Promise<HarvestResult>

Type declaration

    • (
          ws: Workspace,
          branch: string,
          pathspecs: string[],
          base: string,
          identity: { email: string; name: string },
          slug: string,
          role: string,
      ): Promise<HarvestResult>
    • Harvest-then-dispose (run "runner-agent" ADR-3; review-04.md round-2 F8): base is the workspace's HEAD before the harness ran (the caller captures it at that point — every dispatch prompt instructs the harness to commit its own work, so by the time this runs HEAD may already be past base). This sweeps up any of the role's own pathspecs the harness left uncommitted into one more commit, then pushes whatever's reachable from HEAD back to base — the harness's own commit(s) included — to branch, never the run branch itself, which stays the control plane's alone to write. Nothing to push (HEAD never moved past base, and nothing matched the sweep) resolves pushed: false, not an error. A push failure throws: the caller is expected to keep the workspace rather than dispose of completed, paid work it could not deliver (ADR-3's ordering — disposal is gated on the push landing, never on the harness returning).

      Parameters

      • ws: Workspace
      • branch: string
      • pathspecs: string[]
      • base: string
      • identity: { email: string; name: string }
      • slug: string
      • role: string

      Returns Promise<HarvestResult>

log?: (line: string) => void
manifestLoaderImpl?: (
    repoDir: string,
    adapter: string,
    prefixHint?: string,
) => Promise<HeadlessManifest>
maxCycles?: number

Stop after this many poll cycles instead of running forever (tests only).

pollIntervalMs: number
prefixHint?: string
repoUrl?: string

Fallback remote URL, used only when the control plane's own repoUrl (served alongside intents) is null.

resolveFrameworkRootsImpl?: (
    repoDir: string,
    prefixHint?: string,
) => Promise<FrameworkRoots>

Type declaration

    • (repoDir: string, prefixHint?: string): Promise<FrameworkRoots>
    • Same resolution, but from a live checkout on disk — for the orchestrator's adapter manifests, which it shells out to as installed files rather than reading through git history.

      Parameters

      • repoDir: string
      • OptionalprefixHint: string

      Returns Promise<FrameworkRoots>

runCommandImpl?: (
    cmd: string,
    args: string[],
    cwd: string,
    timeoutMs: number,
) => Promise<RunResult>
sleep?: (ms: number) => Promise<void>

Poll-interval sleep, overridable so tests need no real timers.

token: string
workDir: string