@theokit/sdk-memory 0.2.2 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/dist/index.cjs +248 -308
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +4 -0
  5. package/dist/index.d.ts +4 -0
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +232 -301
  8. package/dist/index.js.map +1 -1
  9. package/dist/internal/active-memory/active-memory-cache.d.ts +1 -1
  10. package/dist/internal/active-memory/active-memory.d.ts +2 -2
  11. package/dist/internal/active-memory/composite-scorer.d.ts +1 -1
  12. package/dist/internal/active-memory/query-analyzer.d.ts +1 -1
  13. package/dist/internal/adapter-catalog.d.ts +21 -52
  14. package/dist/internal/adapter-catalog.d.ts.map +1 -1
  15. package/dist/internal/circuit-breaker.d.ts +1 -1
  16. package/dist/internal/dreaming/dreaming-run.d.ts +1 -1
  17. package/dist/internal/embedding/azure-openai-embedding.d.ts +21 -0
  18. package/dist/internal/embedding/azure-openai-embedding.d.ts.map +1 -0
  19. package/dist/internal/embedding/batch-encoder.d.ts +1 -1
  20. package/dist/internal/embedding/cohere-embedding.d.ts +14 -0
  21. package/dist/internal/embedding/cohere-embedding.d.ts.map +1 -0
  22. package/dist/internal/embedding/deepinfra-embedding.d.ts +2 -9
  23. package/dist/internal/embedding/deepinfra-embedding.d.ts.map +1 -1
  24. package/dist/internal/embedding/embedding-adapter.d.ts +5 -5
  25. package/dist/internal/embedding/embedding-adapter.d.ts.map +1 -1
  26. package/dist/internal/embedding/gemini-embedding.d.ts +18 -0
  27. package/dist/internal/embedding/gemini-embedding.d.ts.map +1 -0
  28. package/dist/internal/embedding/jina-embedding.d.ts +13 -0
  29. package/dist/internal/embedding/jina-embedding.d.ts.map +1 -0
  30. package/dist/internal/embedding/mistral-embedding.d.ts +3 -10
  31. package/dist/internal/embedding/mistral-embedding.d.ts.map +1 -1
  32. package/dist/internal/embedding/ollama-embedding.d.ts +3 -10
  33. package/dist/internal/embedding/ollama-embedding.d.ts.map +1 -1
  34. package/dist/internal/embedding/openai-compatible.d.ts +24 -23
  35. package/dist/internal/embedding/openai-compatible.d.ts.map +1 -1
  36. package/dist/internal/embedding/openai-embedding.d.ts +2 -9
  37. package/dist/internal/embedding/openai-embedding.d.ts.map +1 -1
  38. package/dist/internal/embedding/openrouter-embedding.d.ts +2 -9
  39. package/dist/internal/embedding/openrouter-embedding.d.ts.map +1 -1
  40. package/dist/internal/embedding/voyage-embedding.d.ts +2 -9
  41. package/dist/internal/embedding/voyage-embedding.d.ts.map +1 -1
  42. package/dist/internal/index/index-schema.d.ts +0 -5
  43. package/dist/internal/index/index-schema.d.ts.map +1 -1
  44. package/dist/internal/index/memory-index.d.ts +1 -1
  45. package/dist/internal/index/vec-index.d.ts +1 -1
  46. package/dist/internal/memory-scope.d.ts +1 -1
  47. package/dist/internal/memory-types.d.ts +4 -4
  48. package/dist/internal/store/chunk-markdown.d.ts +2 -2
  49. package/dist/internal/store/reader.d.ts +1 -1
  50. package/dist/internal/store/wiki-loader.d.ts +1 -1
  51. package/dist/internal/tools.d.ts +2 -2
  52. package/package.json +5 -5
  53. package/dist/internal/embedding/embedding-cache.d.ts +0 -16
  54. package/dist/internal/embedding/embedding-cache.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,76 @@
1
1
  # Changelog — @theokit/sdk-memory
2
2
 
3
+ ## 0.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 8790f70: Refuse a `workspace:` range before it can reach npm.
8
+
9
+ Five of this repo's twelve publishable packages declare internal dependencies as `workspace:^`, which
10
+ is correct on disk and becomes an unrecoverable defect if the publish goes out through a tool that
11
+ does not rewrite it: `pnpm` resolves the protocol while packing, `npm` ships the manifest verbatim.
12
+ A version published that way fails to install for everyone and cannot be corrected — only
13
+ deprecated.
14
+
15
+ Every publishable package now runs the guard in `prepublishOnly`, so it fires whichever way the
16
+ publish is invoked, and `pnpm release` runs it once across the repo before `changeset publish`.
17
+
18
+ Note for anyone reading a published manifest: the `prepublishOnly` entry points at a path inside
19
+ this repository. It never runs for a consumer — the hook only fires when the package itself is
20
+ published — and guarding the entry point that a hand-run `npm publish` actually uses was worth the
21
+ cosmetic wart of shipping the line.
22
+
23
+ ## 0.3.0
24
+
25
+ ### Minor Changes
26
+
27
+ - a4a9920: `@theokit/sdk-memory` now uses the SDK's embedding runtime instead of its own copy (theokit#160).
28
+
29
+ The two packages each carried a full copy of `createOpenAiCompatibleRuntime`, and the satellite's
30
+ catalog replaces the SDK's at runtime when installed — so the copy that ran was not the copy most
31
+ people read. That duplication is what produced the two-month adapter gap fixed in theokit#128, and
32
+ every fix since had to be applied to both files by hand.
33
+
34
+ There is now one implementation, imported from `@theokit/sdk/internal/memory-adapters` — a
35
+ semver-exempt sub-path in the same family as `internal/persistence` and `internal/security`, which
36
+ exist for exactly this reason.
37
+
38
+ **Behaviour change for `@theokit/sdk-memory` consumers:** embedding batches now run with bounded
39
+ parallelism instead of serially, and the embedding cache is process-wide instead of per-adapter.
40
+ Both are what the SDK already did; the satellite had silently missed both improvements.
41
+
42
+ - 0308f9f: `@theokit/sdk-memory` now serves every embedding provider the SDK advertises (theokit#128).
43
+
44
+ `azure-openai`, `cohere`, `jina` and `gemini` landed in the SDK core catalog in June 2026 and the
45
+ satellite never picked them up. That was not cosmetic drift: when `@theokit/sdk-memory` is
46
+ installed, its catalog _replaces_ core's in the routing path, while `Theokit.inspect.embeddingAdapters()`
47
+ kept listing all ten — so asking for one of the four got an "unknown provider" error from a provider
48
+ the SDK itself had just advertised. A cross-package test now fails the build if core ever advertises
49
+ a provider the peer cannot serve.
50
+
51
+ Also fixes the Azure OpenAI endpoint in both packages. Azure addresses the deployment in the URL
52
+ path (`/openai/deployments/{deployment}/embeddings`), and the placeholder was never substituted —
53
+ every Azure embedding request went to a URL containing the literal text `{model}` and could only 404. Providers with a static path are unaffected.
54
+
55
+ - 0bd082f: Three advertised embedding providers now actually work (theokit#159).
56
+
57
+ `azure-openai`, `cohere` and `gemini` were in the catalog and rejected on every call. The shared
58
+ runtime spoke exactly one wire — `Authorization: Bearer`, a `{ model, input }` body, a
59
+ `{ data: [{ embedding }] }` response — and none of the three speak it:
60
+
61
+ - **Azure** authenticates an API key with the `api-key` header (`Bearer` carries an Entra ID token,
62
+ not the key from `AZURE_OPENAI_API_KEY`), and the deployment is already in the URL path, so
63
+ `model` does not belong in the body.
64
+ - **Cohere**'s `/v2/embed` names the payload `texts`, requires `input_type`, and answers
65
+ `{ embeddings: { float } }`.
66
+ - **Gemini**'s OpenAI-compatible surface is at `/v1beta/openai/embeddings`, not `/v1/embeddings`.
67
+
68
+ The runtime gained three optional per-provider hooks — auth headers, request body, response reader —
69
+ whose defaults are exactly the previous behaviour, so the seven providers that were already correct
70
+ are untouched. Each divergence is asserted by a test that records the real request.
71
+
72
+ Advertising a provider that cannot work is worse than not advertising it; that is what this closes.
73
+
3
74
  ## 0.2.2
4
75
 
5
76
  ### Patch Changes