Skip to content

WarrenClient

Defined in: .upstream/src/client/client.ts:70

Public re-exports for the warren-client facade. Internal and external modules can import from here so the file layout under client/ can move without touching call sites.

new WarrenClient(opts): WarrenClient

Defined in: .upstream/src/client/client.ts:74

WarrenClientOptions

WarrenClient

readonly config: WarrenClientConfig

Defined in: .upstream/src/client/client.ts:71

cancelPlanRun(planRunId): Promise<CancelPlanRunResponse>

Defined in: .upstream/src/client/client.ts:345

POST /plan-runs/:id/cancel — flip the plan-run to cancelled and best-effort cancel its in-flight child run. Idempotent: a plan-run already in a terminal state returns { alreadyTerminal: true, cancelledChild: null } without firing a second cancel.

string

Promise<CancelPlanRunResponse>


close(): Promise<void>

Defined in: .upstream/src/client/client.ts:394

Promise<void>


createPlanRun(input): Promise<CreatePlanRunResponse>

Defined in: .upstream/src/client/client.ts:310

POST /plan-runs — dispatch a serial plan execution against a seeds plan. Walks the plan’s children one at a time, gating each on the previous PR merging. Re-dispatching the same planId after children land resumes from the next open child (idempotent resume contract).

CreatePlanRunInput

Promise<CreatePlanRunResponse>


createProject(input): Promise<ProjectRow>

Defined in: .upstream/src/client/client.ts:137

CreateProjectInput

Promise<ProjectRow>


createRun(input): Promise<SpawnRunResponse>

Defined in: .upstream/src/client/client.ts:186

CreateRunInput

Promise<SpawnRunResponse>


dispatch(input): Promise<SpawnRunResponse>

Defined in: .upstream/src/client/client.ts:195

POST /runs with ergonomic warren run field names. Wraps createRun.

DispatchRunInput

Promise<SpawnRunResponse>


getAgent(name, query?): Promise<AgentRow>

Defined in: .upstream/src/client/client.ts:174

string

ListAgentsQuery = {}

Promise<AgentRow>


getPlanRun(planRunId): Promise<PlanRunDetailResponse>

Defined in: .upstream/src/client/client.ts:324

GET /plan-runs/:id — full plan-run status: row + children + fanned-out child RunRow[] (excludes children whose runId is still null) so callers can render a detail view in one round-trip.

string

Promise<PlanRunDetailResponse>


getProject(projectId): Promise<ProjectRow>

Defined in: .upstream/src/client/client.ts:123

string

Promise<ProjectRow>


getRun(runId): Promise<RunRow>

Defined in: .upstream/src/client/client.ts:231

string

Promise<RunRow>


listAgents(query?): Promise<ListAgentsResponse>

Defined in: .upstream/src/client/client.ts:166

ListAgentsQuery = {}

Promise<ListAgentsResponse>


listPlanRuns(filter?): Promise<ListPlanRunsResponse>

Defined in: .upstream/src/client/client.ts:329

GET /plan-runs[?project=&state=] — list plan-runs, optionally filtered.

ListPlanRunsFilter = {}

Promise<ListPlanRunsResponse>


listProjects(): Promise<ListProjectsResponse>

Defined in: .upstream/src/client/client.ts:127

Promise<ListProjectsResponse>


listReadyPlans(projectId, signal?): Promise<ListReadyPlansResponse>

Defined in: .upstream/src/client/client.ts:132

GET /projects/:id/ready-plans — approved, undispatched plans with an open child (warren-7937).

string

AbortSignal

Promise<ListReadyPlansResponse>


listRuns(): Promise<ListRunsResponse>

Defined in: .upstream/src/client/client.ts:235

Promise<ListRunsResponse>


probe(timeoutMs?): Promise<void>

Defined in: .upstream/src/client/client.ts:88

Hit /healthz with a timeout and convert transport-layer failures into WarrenUnreachableError. /healthz is auth-exempt.

number = DEFAULT_PROBE_TIMEOUT_MS

Promise<void>


refreshAgents(): Promise<RefreshAgentsResponse>

Defined in: .upstream/src/client/client.ts:182

Promise<RefreshAgentsResponse>


refreshProject(projectId, input?): Promise<RefreshProjectResponse>

Defined in: .upstream/src/client/client.ts:145

string

RefreshProjectInput = {}

Promise<RefreshProjectResponse>


refreshProjectAgents(projectId): Promise<RefreshProjectAgentsResult>

Defined in: .upstream/src/client/client.ts:159

string

Promise<RefreshProjectAgentsResult>


request<T>(path, init?): Promise<T>

Defined in: .upstream/src/client/client.ts:111

Helper to send requests and handle common things like bearer token auth, URL concatenation, and response deserialization.

T

string

RequestInit = {}

Promise<T>


steer(runId, input): Promise<SteerRunResponse>

Defined in: .upstream/src/client/client.ts:220

POST /runs/:id/steer — mid-run steering. Forwards an operator message into the burrow inbox; valid only while the run is non-terminal AND a burrow is attached (else ValidationError). Batch runs get nudges here; src/runs/pause.ts drives the blocking-question pause ↔ resume cycle server-side — no explicit “resume” needed after a steer.

string

SteerRunInput

Promise<SteerRunResponse>


streamPlanRunEvents(planRunId, opts?): AsyncGenerator<RunEvent, void, void>

Defined in: .upstream/src/client/client.ts:367

Async iterator over GET /plan-runs/:id/events (NDJSON tail). One yield per child-run event row, parsed as RunEvent. Shares the same wire shape and reader as streamRunEvents; each envelope carries its originating runId discriminator.

  • follow: true keeps the connection open until the client disconnects or the plan-run reaches a terminal state; without it the server replays the current snapshot then closes.
  • signal aborts the underlying fetch.

There is no sinceSeq — the endpoint replays the full union snapshot from the top on every (re)open. On reconnect, dedupe client-side by (runId, seq) to drop events already seen.

string

StreamPlanRunEventsOptions = {}

AsyncGenerator<RunEvent, void, void>


streamRunEvents(runId, opts?): AsyncGenerator<RunEvent, void, void>

Defined in: .upstream/src/client/client.ts:274

Async iterator over GET /runs/:id/events (NDJSON tail). One yield per event row, parsed as RunEvent. The wire format is NDJSON, not SSE — each line is a JSON envelope terminated by \n.

  • follow: true keeps the connection open so new events stream as the run progresses. Without it, the server closes once the current backlog is drained.
  • sinceSeq replays only events with burrowEventSeq > sinceSeq, matching the server’s ?since= semantics.
  • signal aborts the underlying fetch so callers can tear the connection down on unmount / cancel.

Malformed lines are dropped silently — the stream is best-effort by design, mirroring the UI consumer in src/ui/src/api/client.ts.

string

StreamRunEventsOptions = {}

AsyncGenerator<RunEvent, void, void>


waitForPlanRun(planRunId, opts?): Promise<PlanRunRow>

Defined in: .upstream/src/client/client.ts:383

Poll GET /plan-runs/:id until the plan-run reaches a terminal state (succeeded | failed | cancelled) or the timeout/abort fires. Mirrors waitForRun for serial plan executions.

string

WaitForPlanRunOptions = {}

Promise<PlanRunRow>


waitForRun(runId, opts?): Promise<RunRow>

Defined in: .upstream/src/client/client.ts:247

Poll GET /runs/:id until the run reaches a terminal state (succeeded | failed | cancelled) or the timeout/abort fires.

Polling — not SSE — is the right primitive for short-lived external callers that just want a final state without holding an open connection.

string

WaitForRunOptions = {}

Promise<RunRow>


static fromEnv(env?, fetchImpl?): WarrenClient

Defined in: .upstream/src/client/client.ts:79

EnvLike = process.env

typeof fetch

WarrenClient