Skip to main content

Architecture

Workloom separates product semantics from file movement:

Registry packages define the canonical assets.
Workspace revisions choose which packages apply where.
Renderers produce provider-specific file plans.
Sync applies only approved, safe, Workloom-owned outputs.
Drift checks prove local state still matches desired state.

Repository Packages​

PackageRole
packages/coreShared providers, policies, diagnostics, and errors.
packages/manifestZod schemas for packages and workspaces.
packages/registry-clientFixture-backed and HTTP-based registry client boundary.
packages/registry-serverHono-based API server with OpenAPI spec generation for packages, workspaces, auth, objects, audit, and telemetry.
packages/fetch-clientNative fetch() wrapper with Bearer token injection, error normalization, and timeout handling.
packages/react-queryLean @tanstack/react-query v5 re-export with useRetryDisable and getCombinedStatus.
packages/workloom-apiKubb-generated typed client functions, React Query hooks, and Zod schemas from the OpenAPI spec.
packages/persistenceSQLite snapshot store for durable registry state.
packages/githubGitHub REST automation for Copilot instructions and coding-agent repository policy.
packages/rendererCentral deterministic render-plan implementation.
packages/syncPath normalization, hashing, approval gates, and writes.
packages/driftFixture-driven drift classification.
packages/telemetryForbidden-field scan for telemetry payloads.

Applications​

ApplicationRole
apps/apiHono server exposing the registry API on port 4050. Serves GET /v1/openapi.json for the auto-generated OpenAPI 3.1 spec.
apps/webReact SPA (Vite, port 3050) consuming generated hooks via @workloom/workloom-api. API-mediated Supabase OIDC auth.
apps/docsDocusaurus documentation site.

API Generation Pipeline​

The API layer follows an OpenAPI-first generation pipeline:

Hono routes + @hono/zod-openapi
-> /v1/openapi.json (auto-generated spec)
-> kubb v4.37.8 code generation
-> @workloom/workloom-api (types, client functions, React Query hooks, Zod schemas)
-> apps/web consumes generated hooks

Generated code in @workloom/workloom-api is committed to the repo for IDE support and CI diffing, but is fully derivable from the OpenAPI spec. Manual edits to generated files are overwritten on the next generation run.

Authentication Architecture​

Supabase OAuth server (IdP)
-> API brokers authorize/consent/callback (/v1/auth/oidc/*, PKCE, ES256)
-> API issues a wl_ session token
-> custom AuthProvider stores it; useAccessToken() exposes the Bearer token
-> setAuthToken() in @workloom/fetch-client (transport-level injection)
-> all API requests carry Authorization header

Alternative auth paths: device login flow (CLI) and CI tokens. (SAML and service accounts were removed.)

Transport Model​

The transport model is HTTPS/object sync, not SSH or rsync. Content-addressed objects use sha256 verification, signed upload/download URLs, ETags, and range downloads.