Skip to content

Initial provider-decoupling: registries, gateway adapters, workspace API, and provider packages#141

Open
Saluana wants to merge 1 commit into
or3-cloudfrom
codex/complete-provider-decoupling-task-list
Open

Initial provider-decoupling: registries, gateway adapters, workspace API, and provider packages#141
Saluana wants to merge 1 commit into
or3-cloudfrom
codex/complete-provider-decoupling-task-list

Conversation

@Saluana

@Saluana Saluana commented Feb 4, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Remove compile-time coupling to provider SDKs (Clerk/Convex) so core builds/typechecks even when provider packages or generated Convex files are absent.
  • Provide small, stable server-side contracts (token broker, workspace store, sync/storage gateway adapters) so provider implementations can live in installable Nuxt modules.
  • Keep client behavior stable (workspace UI + gateway storage) while moving provider-specific code out of Nuxt auto-included zones.

Description

  • Introduced server registries and contracts: AuthWorkspaceStore registry (server/auth/store), ProviderTokenBroker (server/auth/token-broker), SyncGatewayAdapter (server/sync/gateway), StorageGatewayAdapter (server/storage/gateway), plus rate-limit/background-job/notification registries.
  • Refactored session provisioning to use AuthWorkspaceStore and replaced direct Convex/Clerk calls with registry lookups and broker calls (server/auth/session.ts).
  • Converted all core /api/sync/* and /api/storage/* endpoints to dispatch to the configured gateway adapters instead of importing provider SDKs directly.
  • Added Workspace API boundary: WorkspaceApi types and registry, useWorkspaceApi() composable, client gateway implementation, and SSR endpoints under /api/workspaces/* to back workspace CRUD and set-active flows.
  • Made storage provider client-agnostic by adding a gateway storage provider and adapting the client transfer queue to call core /api/storage/* endpoints.
  • Reworked sync plugin to favor a gateway provider by default and updated sync provider registry usage to avoid importing Convex in core hot zones.
  • Added provider packages (Nuxt module scaffolds) under packages/: or3-provider-clerk, or3-provider-convex, or3-provider-localfs, and or3-provider-sqlite implementing provider-specific logic and registering adapters/plugins via Nitro/Nuxt runtime plugins.
  • Added local examples: a LocalFS storage adapter with upload/download endpoints and a SQLite gateway sync + AuthWorkspaceStore implementation to demonstrate self-hosted providers.
  • Replaced compile-time provider ID enums with runtime-extensible string config fields and added a startup validation plugin (server/plugins/zz.provider-validation.ts) to enforce that configured providers are registered.
  • Moved or removed many Convex/Clerk imports from core auto-included zones and relocated provider-specific code into the new packages; removed provider-only test pages from app/pages/_tests.
  • Added tooling and guard rails: scripts/check-provider-imports.ts and package.json script check:provider-imports to detect banned imports in hot zones, and or3.providers.generated.ts (wizard hook) for module inclusion.
  • Updated a range of tests and mocks to use the new gateway/registry patterns and added registry reset helpers for tests.

Testing

  • No automated test suite was executed as part of this rollout; multiple unit/integration tests and test harness files were updated to align with the new provider-agnostic architecture.
  • Added a lightweight local guard script scripts/check-provider-imports.ts and npm/bun script check:provider-imports to detect banned provider imports in Nuxt hot zones; this check was added but not run here.
  • Recommended commands to validate locally/CI: run bun install, bun run check:provider-imports, bun run test (Vitest), and bun run type-check (Nuxt typecheck). These were not executed in this change set.

Codex Task

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Feb 4, 2026

Copy link
Copy Markdown

Deploying or3-chat with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3f7d69d
Status:🚫  Build failed.

View logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant