Skip to content

feat(ai-sdk): re-export @supermemory/tools/ai-sdk - #1402

Closed
haroon0x wants to merge 1 commit into
supermemoryai:mainfrom
haroon0x:fix/ai-sdk-deduplication
Closed

feat(ai-sdk): re-export @supermemory/tools/ai-sdk#1402
haroon0x wants to merge 1 commit into
supermemoryai:mainfrom
haroon0x:fix/ai-sdk-deduplication

Conversation

@haroon0x

@haroon0x haroon0x commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Deprecate the duplicated implementation in @supermemory/ai-sdk (2.0.0). The package now re-exports @supermemory/tools/ai-sdk and inherits its container-scoping and coercion semantics. Drops the stale deps that pinned @ai-sdk/provider@2 at the root, adds it back with the v3 range (its d.ts requires v3 types), and adds a turbo edge so check-types builds tools' dist first.

Closes #1247

@supermemory/ai-sdk 2.0.0 is now a thin re-export of @supermemory/tools/ai-sdk. The duplicated implementation (src/tools.ts, ~150 lines, plus its tests) is deleted.

What changed

  • Scoping: passing both projectId and containerTags now throws; no config defaults to ["sm_project_default"].
  • Coercion: limits arrive as numbers even when the model emits strings.
  • Deps: dropped the stale pins (ai, @ai-sdk/openai, supermemory, @ai-sdk/provider@^2.0.0) that forced provider 2.x to the root. Added @ai-sdk/provider@^3.0.0 back on purpose: tools' types reference v3-only types, and pnpm resolves the tools peer to the lowest match, which broke consumer typechecks without it.
  • tools: the @ai-sdk/provider peer range is narrowed from ^2.0.0 || ^3.0.0 to ^3.0.0. The ^2 side was never typecheckable against the published .d.ts.
  • tsdown config: stable .d.ts filenames and an exports block with a types condition (hashed names broke nodenext type resolution). exports: false is explained in the config.
  • CI: check-types now builds tools' dist first via a Turbo edge. dist/** joined the build outputs so that build is cacheable. The publish workflow builds from the repo root.

Why 2.0.0

A major because the default scope and coercion semantics differ from 1.x. The export surface is a strict superset of 1.x.

Verified

  • Packed tarballs installed into fresh npm and pnpm consumers: exports, scoping, coercion, and a strict nodenext typecheck pass.
  • Repo CI gates (ai-sdk + memory-graph check-types) pass under the pinned Bun 1.3.6.

Deprecate the duplicated implementation in @supermemory/ai-sdk (2.0.0).
The package now re-exports @supermemory/tools/ai-sdk and inherits its
container-scoping and coercion semantics. Drops the stale deps that
pinned @ai-sdk/provider@2 at the root, adds it back with the v3 range
(its d.ts requires v3 types), and adds a turbo edge so check-types
builds tools' dist first.
@MaheshtheDev

Copy link
Copy Markdown
Member

Closing this one. Four PRs are open for the same consolidation, so we are keeping #1433 as the single thread since it also refreshes the tool surface.

Worth flagging for whoever picks this up: packages/ai-sdk/src/tools.ts now holds a search-limit clamp added in #1593, and packages/tools/src/ai-sdk.ts has no equivalent. Collapsing the package into a re-export today would silently drop that bound, so the clamp needs porting across first.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@supermemory/ai-sdk has drifted from @supermemory/tools and is missing its container-scoping and coercion fixes

2 participants