mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-05-22 19:36:04 +00:00
Addresses review feedback about ES private fields breaking with Object.create + Object.defineProperties approach: Source changes (packages/tools/src/vercel/index.ts): - Replace Object.create/Object.defineProperties with a Proxy that delegates property access to the original model instance. This preserves prototype getters, ES private fields (#field), and instance brand checks since 'this' inside getters remains the real model instance. - Extract doGenerate/doStream overrides into named functions (wrappedDoGenerate/wrappedDoStream) for clarity. - Remove one-use 'descriptors' intermediate variable (inlined). Test changes (packages/tools/test/with-supermemory/unit.test.ts): - Remove duplicate test 'should preserve all V3 metadata after wrapping' (strict subset of prototype getter test). - Add MockLanguageModelV3WithPrivateFields class using true ES private fields (#config) to catch TypeError that would occur with Object.create-based wrapping. - Add test 'should handle V3 models with ES private fields' that verifies the Proxy approach works with private field access. - Clean up 'valid API key' test to be intentionally minimal (property preservation covered by dedicated V2/V3 suites). |
||
|---|---|---|
| .. | ||
| agent-framework-python | ||
| ai-sdk | ||
| cartesia-sdk-python | ||
| docs-test | ||
| hooks | ||
| lib | ||
| memory-graph | ||
| openai-sdk-python | ||
| pipecat-sdk-python | ||
| tools | ||
| ui | ||
| validation | ||