fix: deduplicate @supermemory/ai-sdk into @supermemory/tools/ai-sdk#1251
Open
rajarshidattapy wants to merge 4 commits into
Open
fix: deduplicate @supermemory/ai-sdk into @supermemory/tools/ai-sdk#1251rajarshidattapy wants to merge 4 commits into
rajarshidattapy wants to merge 4 commits into
Conversation
…#1247) — the ! marks the breaking default-scope change.
Contributor
Author
|
@ishaanxgupta can you check this? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Closes #1247.
packages/ai-sdkreimplemented whatpackages/tools/src/ai-sdk.tsalready provides, and every fix landed in the latter missed it. Rather than porting the three fixes and waiting for the next drift, this makes@supermemory/ai-sdka thin re-export of@supermemory/tools/ai-sdk— one implementation, one set of semantics.The three divergences from the issue are resolved by inheritance rather than by patch:
containerTagssilently dropped whenprojectIdis also setgetContainerTags()throws (#1214)"type": "number"rejectslimit: "5"z.coerce.number()coerces it (#1202)containerTags === undefined→ unscoped reads/writes["sm_project_default"]Changes
packages/ai-sdk/src/tools.tsandtools.test.tsdeleted;src/index.tsis nowexport * from "@supermemory/tools/ai-sdk"with a@deprecatedJSDoc. Coverage for this code already lives inpackages/tools(tools-shared.ts/tools.test.ts).packages/ai-sdk/package.json:1.0.8→2.0.0; dependencies reduced to@supermemory/toolsplus@ai-sdk/provider(satisfies the tools peer dep).turbo.json:check-typesnowdependsOn: ["^build"]. Required —tscresolves@supermemory/tools/ai-sdkthrough its exports map intodist/, so the dependency must be built first, and CI runscheck-types --filter='@supermemory/ai-sdk'..github/workflows/publish-ai-sdk.yml: build step now runsturbo run build --filter='@supermemory/ai-sdk'from the repo root, so@supermemory/toolsis built before the re-export's.d.tsis generated.@supermemory/tools/ai-sdkand listing the behavior changes.Breaking changes
Major bump to
2.0.0, as the issue anticipated. Existing@supermemory/ai-sdkusers are affected in three ways:projectIdandcontainerTagsnow throws instead of ignoringcontainerTags.["sm_project_default"]. Previously they searched and wrote across every project. Anyone depending on that must now passcontainerTagsexplicitly. This is the fix, but it will change what existing calls read and write.supermemoryTools()now returns the full@supermemory/toolsset (getProfile,documentList,documentAdd,documentDelete,memoryForget) alongsidesearchMemoriesandaddMemory. Additive, but it widens what a model can call if you spread the whole object intotools.Follow-up for a maintainer with publish rights: run
npm deprecate @supermemory/ai-sdk— that's a registry action, not something this PR can do.Verification
turbo run build check-types --filter='@supermemory/ai-sdk'passes;dist/index.jsis a single re-export line. Biome clean on the changed sources.One thing worth mentioning in the PR thread if you want to be a good citizen: building packages/tools on Windows makes tsdown's exports: true rewrite its own package.json with backslash paths ("./openai\index"). Pre-existing, unrelated to #1247 — I reverted the file, but it's a real trap for Windows contributors.