Repository navigation
feat(ai-sdk): add @ebbmem/ai-sdk tools and middleware (P1-10) - #6
Merged
Merged
Conversation
Signed-off-by: Bharat Joshi <200157101+sbharatjoshi@users.noreply.github.com>
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 and Why
Adds
@ebbmem/ai-sdkunderpackages/ai-sdk/, providing Vercel AI SDK (aiv7+) tools and language-model middleware backed byebbmem-integration-core(IC-1):ebbmemTools()(src/tools.ts): exportsmemory_recall,memory_remember,memory_reinforce, andmemory_forgetusing AI SDKtool()+zodschemas, delegating scoping, secret redaction, untrusted<ebbmem_untrusted_memory_context>framing, validation, and header-only auth toEbbmemIntegrationCore.withEbbmem(model, opts)/ebbmemMiddleware(opts)(src/middleware.ts):wrapLanguageModelmiddleware (specificationVersion: "v4") supporting bothdoGenerateanddoStreamacrossLanguageModelV4/LanguageModelV3/LanguageModelV2:reinforce: false) and injects framed untrusted context into system or user messages.tool-callssteps and errored streams) with deterministic idempotency keys and automatic secret redaction.injected: false(cited-only) default andrecall_idcorrelation.failOpen: true) on recall, remember, and reinforce errors, while isolating concurrent calls via aWeakMap.packages/ai-sdk/README.md): documents installation, exports, and a two-provider Next.js App Router route example (explicitly marked untested live against external providers).Nothing published.
Acceptance & Verification Commands
Test Summary
npm run typecheck(tsc -p tsconfig.test.json --noEmit): 0 errorsnpm run build(tsc): 0 errorsnpm test(tsc -p tsconfig.test.json && node --test build/test/test/*.test.js): 13 passed, 0 failed across 2 suites (withEbbmem middleware10/10,ebbmemTools3/3) usingMockLanguageModelV4,MockLanguageModelV3, in-memoryMockEbbmemTransport, and IC-1MockEbbmemServerviaFetchTransport.pytest -v conformance/tests/test_public_compliance.py: 2 passed, 0 failedArchitecture Review Note
@ebbmem/ai-sdkpackage off freshorigin/main(8b7aaf43, 14 files underpackages/ai-sdk/, max 562 lines, zero edits topackages/typescript/, DCO sign-off, no lock-file churn).ebbmemTools()exposesmemory_recall,memory_remember,memory_reinforce, andmemory_forgetvia Vercel AI SDK v7tool()+zodschemas, delegating scoping, redaction, untrusted<ebbmem_untrusted_memory_context>framing, and header-only auth toEbbmemIntegrationCore.withEbbmem()/ebbmemMiddleware()(specificationVersion: "v4"viawrapLanguageModel) cleanly handles bothdoGenerateanddoStream, isolates concurrent turns with aWeakMap, skips premature capture/reinforce on intermediatetool-callsor stream errors, defaults tofailOpen: trueandinjected: false(cited-only reinforcement), and supportsLanguageModelV4/V3.package.json,tsconfig.json, andtsconfig.test.jsonvalidate with 0 errors against SchemaStore;npm run typecheck,npm run build,npm test(13/13 passed, including IC-1MockEbbmemServerviaFetchTransport), andconformance/tests/test_public_compliance.py(2/2) all pass. README Next.js two-provider route is clearly marked untested live; nothing published.