From 4c7a279ca0894c7b5213b9a6633e3b76f97b242c Mon Sep 17 00:00:00 2001 From: Suleiman Shahbari Date: Sat, 27 Jun 2026 01:24:14 +0300 Subject: [PATCH] feat(ai-sdk): export GoogleCacheRegistry + eval fixtures helpers (#46) Surface the gemstack-internal symbols that the /server provider and ai-eval CLI relocations (#39, #40) need to compile against a published @gemstack/ai-sdk: - GoogleCacheRegistry + GoogleCacheRegistryOptions + CacheStoreLike from the main entry, so a binding can construct the Gemini context-cache registry with its own CacheAdapter. - defaultFixturesDir / readFixture / writeFixture from the ./eval subpath, so an ai-eval binding can read/write recorded fixtures. Purely additive (minor). Prereq for #39 and the ai-eval part of #40. --- .changeset/ai-sdk-export-cache-registry-eval-helpers.md | 7 +++++++ packages/ai-sdk/src/eval/index.ts | 2 +- packages/ai-sdk/src/index.ts | 6 ++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 .changeset/ai-sdk-export-cache-registry-eval-helpers.md diff --git a/.changeset/ai-sdk-export-cache-registry-eval-helpers.md b/.changeset/ai-sdk-export-cache-registry-eval-helpers.md new file mode 100644 index 0000000..25a933a --- /dev/null +++ b/.changeset/ai-sdk-export-cache-registry-eval-helpers.md @@ -0,0 +1,7 @@ +--- +"@gemstack/ai-sdk": minor +--- + +Export `GoogleCacheRegistry` (+ `GoogleCacheRegistryOptions` / `CacheStoreLike`) from the main entry, and `defaultFixturesDir` / `readFixture` / `writeFixture` from the `./eval` subpath. + +These were gemstack-internal symbols that framework bindings could not reach against a published build. Surfacing them lets a binding construct the Gemini context-cache registry with its own `CacheAdapter` (`new GoogleCacheRegistry({ store })`) and lets an `ai:eval` CLI binding read/write recorded fixtures. Purely additive; unblocks relocating the `/server` provider and the `ai-eval` command to the Rudder side. diff --git a/packages/ai-sdk/src/eval/index.ts b/packages/ai-sdk/src/eval/index.ts index d9b3a22..76e7512 100644 --- a/packages/ai-sdk/src/eval/index.ts +++ b/packages/ai-sdk/src/eval/index.ts @@ -42,7 +42,7 @@ import { z } from 'zod' export { reportJson } from './json-reporter.js' export type { SuiteJson, SuiteJsonCase } from './json-reporter.js' -export { stepsFromResponse } from './fixtures.js' +export { stepsFromResponse, defaultFixturesDir, readFixture, writeFixture } from './fixtures.js' export type { EvalFixture } from './fixtures.js' export { reportHtml } from './html-reporter.js' export type { HtmlReportOptions } from './html-reporter.js' diff --git a/packages/ai-sdk/src/index.ts b/packages/ai-sdk/src/index.ts index 46cfb36..67314cf 100644 --- a/packages/ai-sdk/src/index.ts +++ b/packages/ai-sdk/src/index.ts @@ -81,6 +81,12 @@ export { AiRegistry } from './registry.js' export { AnthropicProvider, type AnthropicConfig } from './providers/anthropic.js' export { OpenAIProvider, OpenAIAdapter, type OpenAIConfig } from './providers/openai.js' export { GoogleProvider, type GoogleConfig } from './providers/google.js' +// Google context-cache registry — the runtime class that backs Gemini's +// `cachedContent` resources. Exported so framework bindings can construct +// it with their own `CacheAdapter` (`new GoogleCacheRegistry({ store })`) +// and wire it into the Google provider. +export { GoogleCacheRegistry } from './providers/google-cache-registry.js' +export type { GoogleCacheRegistryOptions, CacheStoreLike } from './providers/google-cache-registry.js' export { OllamaProvider, type OllamaConfig } from './providers/ollama.js' export { DeepSeekProvider, type DeepSeekConfig } from './providers/deepseek.js' export { XaiProvider, type XaiConfig } from './providers/xai.js'