Skip to content

feat: decouple the core from Rudder (only runtime dep is zod)#6

Merged
suleimansh merged 1 commit into
mainfrom
feat/decouple-neutral-seam
Jun 25, 2026
Merged

feat: decouple the core from Rudder (only runtime dep is zod)#6
suleimansh merged 1 commit into
mainfrom
feat/decouple-neutral-seam

Conversation

@suleimansh

Copy link
Copy Markdown
Member

Closes #3 (Phase 2).

TL;DR

@gemstack/ai-sdk's only required runtime dependency is now zod. Every @rudderjs/* touchpoint is an optional peer behind an opt-in subpath, so a non-Rudder app installs and uses the SDK with zero @rudderjs/* packages.

What I found first

The package already built, typechecked, and passed all 996 tests standalone before this PR. The original Phase 2 premise ("the test suite pulls cache/storage/broadcast/queue/etc.") was a misread: those were comments, not imports. The only genuine couplings were four files.

Changes

  • Schema conversion (src/zod-to-json-schema.ts): use Zod 4's native z.toJSONSchema(schema, { io }) directly (strip the $schema key, keep the open-object fallback). Removes the @rudderjs/json-schema dependency.
  • @rudderjs/console: demoted from a hard dependency to an optional peer. Only /doctor (a value import) and /commands/make-agent (a type-only import) use it; both are opt-in subpaths.
  • @rudderjs/core (/server provider) and @rudderjs/orm (the *-orm stores) were already optional peers behind opt-in subpaths; left as-is. The neutral storage contracts (UserMemory/ConversationStore/BudgetStorage) already ship in-memory defaults.
  • CI: re-enabled typecheck + test (reverts the ci: scope to build-only until Phase 2 lands #5 build-only stopgap).
  • Changeset: minor -> 0.2.0 (0.x: the dependency-surface change lives in the minor slot).

Verification

  • pnpm build / pnpm typecheck / pnpm test all green standalone; 996/996 tests pass after the zod-native swap.
  • Final dependencies: { zod }. All peers (console/core/orm/mcp-sdk/react) optional.
  • No public API change on the main entry.

- zod-to-json-schema uses Zod 4 native z.toJSONSchema directly; drop the
  @rudderjs/json-schema dependency
- demote @rudderjs/console to an optional peer (only /doctor + the
  make:agent scaffolder use it)
- @rudderjs/core (/server) and @rudderjs/orm (*-orm stores) stay optional
  peers behind their opt-in subpaths
- re-enable typecheck + test in CI (revert the build-only stopgap); all
  996 tests pass standalone
- core dependencies are now { zod } only; a non-Rudder app installs and
  uses the SDK with zero @rudderjs/* packages

Closes #3.
@suleimansh suleimansh added enhancement New feature or request priority: medium Worth doing, not urgent labels Jun 25, 2026
@suleimansh suleimansh self-assigned this Jun 25, 2026
@suleimansh suleimansh merged commit 0453528 into main Jun 25, 2026
1 check passed
@suleimansh suleimansh deleted the feat/decouple-neutral-seam branch June 25, 2026 17:30
suleimansh added a commit that referenced this pull request Jun 25, 2026
Bump + CHANGELOG for the Rudder-decoupling (PR #6). Manual changeset
version since the repo has no release bot yet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request priority: medium Worth doing, not urgent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Phase 2: decouple @gemstack/ai-sdk from @rudderjs/core + @rudderjs/orm behind a neutral seam

1 participant