Skip to main content
  • Version 0.1.0
  • Purity browser-safe (fetch / ReadableStream / TextDecoder; no node:*)
  • Purpose One typed client for the Clawboo control plane (config, SSE, runtimes, providers, agents, onboarding), with a base-URL and auth-header seam so the same client serves the same-origin SPA and a remote-host thin client.
  • Workspace deps @clawboo/agent-registry (types only)
  • External deps none
Extracted so the dashboard does not hard-code fetch('/api/...') in dozens of components. Every call routes through apiFetch, which resolves the base URL and injects headers. The web app calls neither setter: with no base set, requests stay same-origin and behave byte-identically to the inline fetch calls this package replaced. A desktop, mobile, or npm client instead calls setApiBase(url) and setRequestHeaderProvider(fn) once at startup and reuses everything else unchanged. This package absorbed the deleted lib/sseClient.ts, lib/runtimesClient.ts, and lib/onboardingClient.ts.
The two Zustand-coupled helpers (refreshFleetFromRegistry, agentRecordToFleetState) deliberately stay in apps/web/src/lib/agentSourceClient.ts. They hydrate the SPA’s fleet store, and a framework-agnostic package cannot own React or Zustand state.

Public API

Configuration (config.ts)

The seam every other module routes through.

Server-Sent Events (sse.ts)

Runtimes (runtimes.ts)

Defensive (never-throw, typed) wrappers: fetchRuntimes, recheckRuntime, installRuntime (SSE), connectRuntime, healthcheckNativeKey, disconnectRuntime. Owns the connectable RuntimeId union ('claude-code' | 'codex' | 'hermes' | 'clawboo-native'), which features/runtimes/runtimeCatalog.ts re-exports so client and catalog share one definition. This is deliberately narrower than @clawboo/agent-registry’s open-set RuntimeId.

Providers (providers.ts)

fetchProviders, connectProvider, disconnectProvider, fetchProviderModels (stored key), fetchProviderModelsWithKey (a pasted, unsaved key, for onboarding).

Agents (agents.ts)

The AgentSource REST wrappers: listAgents, getAgentRecord, createAgentRecord, archiveAgentRecord, readAgentFile, writeAgentFile, setAgentModel, listAgentSessions, pushAgentSync, fetchRegistryHealth.

Onboarding (onboarding.ts)

seedNativeTeam, setNativeLeaderModel, and fetchOnboardingState (the aggregated first-run signals in one call; returns a defensive all-false “fresh install” shape on any error).

Used by

  • apps/web (SPA); ~35 consumers across onboarding, the Runtimes and Providers panels, the fleet, and agent detail. The web app sets no base and no header provider, so it stays same-origin.

Source

Barrel: packages/control-client/src/index.ts (re-exports ./config, ./sse, ./runtimes, ./providers, ./agents, ./onboarding).

See also

Last modified on July 15, 2026