@theokit/sdk-memory 0.2.1 → 0.3.0

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 (58) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/dist/in-memory-provider.d.ts +1 -1
  3. package/dist/index.cjs +249 -309
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.d.cts +4 -0
  6. package/dist/index.d.ts +4 -0
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +233 -302
  9. package/dist/index.js.map +1 -1
  10. package/dist/internal/active-memory/active-memory-cache.d.ts +1 -1
  11. package/dist/internal/active-memory/active-memory.d.ts +2 -2
  12. package/dist/internal/active-memory/composite-scorer.d.ts +1 -1
  13. package/dist/internal/active-memory/query-analyzer.d.ts +1 -1
  14. package/dist/internal/adapter-catalog.d.ts +21 -52
  15. package/dist/internal/adapter-catalog.d.ts.map +1 -1
  16. package/dist/internal/circuit-breaker.d.ts +1 -1
  17. package/dist/internal/dreaming/dreaming-diary.d.ts +1 -1
  18. package/dist/internal/dreaming/dreaming-run.d.ts +1 -1
  19. package/dist/internal/embedding/azure-openai-embedding.d.ts +21 -0
  20. package/dist/internal/embedding/azure-openai-embedding.d.ts.map +1 -0
  21. package/dist/internal/embedding/batch-encoder.d.ts +1 -1
  22. package/dist/internal/embedding/cohere-embedding.d.ts +14 -0
  23. package/dist/internal/embedding/cohere-embedding.d.ts.map +1 -0
  24. package/dist/internal/embedding/deepinfra-embedding.d.ts +2 -9
  25. package/dist/internal/embedding/deepinfra-embedding.d.ts.map +1 -1
  26. package/dist/internal/embedding/embedding-adapter.d.ts +5 -5
  27. package/dist/internal/embedding/embedding-adapter.d.ts.map +1 -1
  28. package/dist/internal/embedding/gemini-embedding.d.ts +18 -0
  29. package/dist/internal/embedding/gemini-embedding.d.ts.map +1 -0
  30. package/dist/internal/embedding/jina-embedding.d.ts +13 -0
  31. package/dist/internal/embedding/jina-embedding.d.ts.map +1 -0
  32. package/dist/internal/embedding/mistral-embedding.d.ts +3 -10
  33. package/dist/internal/embedding/mistral-embedding.d.ts.map +1 -1
  34. package/dist/internal/embedding/ollama-embedding.d.ts +3 -10
  35. package/dist/internal/embedding/ollama-embedding.d.ts.map +1 -1
  36. package/dist/internal/embedding/openai-compatible.d.ts +24 -23
  37. package/dist/internal/embedding/openai-compatible.d.ts.map +1 -1
  38. package/dist/internal/embedding/openai-embedding.d.ts +2 -9
  39. package/dist/internal/embedding/openai-embedding.d.ts.map +1 -1
  40. package/dist/internal/embedding/openrouter-embedding.d.ts +2 -9
  41. package/dist/internal/embedding/openrouter-embedding.d.ts.map +1 -1
  42. package/dist/internal/embedding/voyage-embedding.d.ts +2 -9
  43. package/dist/internal/embedding/voyage-embedding.d.ts.map +1 -1
  44. package/dist/internal/index/index-db.d.ts +1 -1
  45. package/dist/internal/index/index-schema.d.ts +0 -5
  46. package/dist/internal/index/index-schema.d.ts.map +1 -1
  47. package/dist/internal/index/vec-index.d.ts +1 -1
  48. package/dist/internal/memory-scope.d.ts +1 -1
  49. package/dist/internal/memory-types.d.ts +4 -4
  50. package/dist/internal/store/chunk-markdown.d.ts +2 -2
  51. package/dist/internal/store/reader.d.ts +1 -1
  52. package/dist/internal/store/session-summary-writer.d.ts +1 -1
  53. package/dist/internal/store/transcript-store.d.ts +1 -1
  54. package/dist/internal/store/wiki-loader.d.ts +1 -1
  55. package/dist/internal/tools.d.ts +2 -2
  56. package/package.json +6 -6
  57. package/dist/internal/embedding/embedding-cache.d.ts +0 -16
  58. package/dist/internal/embedding/embedding-cache.d.ts.map +0 -1
@@ -33,7 +33,7 @@ interface MemoryChunk {
33
33
  }
34
34
  /**
35
35
  * Split a markdown document into semantically meaningful chunks (ADR D1 of
36
- * memory-system-openclaw-parity).
36
+ * memory-system-peer-project-parity).
37
37
  *
38
38
  * Algorithm:
39
39
  * 1. Walk lines tracking the current heading (latest `^#+ ` line).
@@ -43,7 +43,7 @@ interface MemoryChunk {
43
43
  * whitespace ≤ maxChars (word-aligned per edge-case review EC-6) —
44
44
  * never mid-word.
45
45
  *
46
- * Mirrors OpenClaw's `chunkMarkdown` from
46
+ * Mirrors peer-project's `chunkMarkdown` from
47
47
  * `packages/memory-host-sdk/src/host/chunk-markdown.ts`.
48
48
  *
49
49
  * Iter 53 (Stage 3 source-move #10): hybrid copy from sdk-core's
@@ -36,7 +36,7 @@ interface MemoryReadResult {
36
36
  /**
37
37
  * Bounded read with truncation info (ADR D5 — `memory_get` foundation).
38
38
  *
39
- * Mirrors OpenClaw's `buildMemoryReadResult` semantics:
39
+ * Mirrors peer-project's `buildMemoryReadResult` semantics:
40
40
  * - `from` is 1-indexed.
41
41
  * - `lines` defaults to 200 (`DEFAULT_MEMORY_READ_LINES`).
42
42
  * - Returns up to EOF when the requested slice extends past file end.
@@ -15,7 +15,7 @@
15
15
  * the canonical copy that the future `session-loader.ts` move will
16
16
  * compose with as a sibling (loader reads back the markdown files
17
17
  * this writer emits). Dependency chain (all resolved):
18
- * - `@theokit/sdk/internal/persistence` for `replaceFileAtomic`
18
+ * - `@theokit/sdk/persistence` for `replaceFileAtomic`
19
19
  * - sibling `./markdown-store.js` for `memoryDir` (moved iter 56)
20
20
  * - sibling `./memory-types.js` for `redactSecrets` (moved iter 52)
21
21
  *
@@ -11,7 +11,7 @@
11
11
  * copy for v1.x active-memory back-compat; sdk-memory ships the
12
12
  * canonical copy that the future `active-memory.ts` move will compose
13
13
  * with as a sibling. Dependency chain (both resolved):
14
- * - `@theokit/sdk/internal/persistence` for `atomicWriteJson`
14
+ * - `@theokit/sdk/persistence` for `atomicWriteJson`
15
15
  * - sibling `./markdown-store.js` for `memoryDir` (moved iter 56)
16
16
  *
17
17
  * @internal
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Wiki supplement discovery (ADR Phase 10 of memory-system-openclaw-parity).
2
+ * Wiki supplement discovery (ADR Phase 10 of memory-system-peer-project-parity).
3
3
  *
4
4
  * Wiki files live under `.theokit/memory/wiki/*.md`. They are READ-ONLY —
5
5
  * the SDK never writes here. Each indexed chunk carries `source="wiki"` so
@@ -1,8 +1,8 @@
1
1
  import type { MemoryIndex } from "./index/memory-index.js";
2
2
  /**
3
3
  * Memory tools (`memory_search` + `memory_get`) — ADR D5 of
4
- * memory-system-openclaw-parity. Tool schemas mirror OpenClaw
5
- * (`referencia/openclaw/extensions/memory-core/src/tools.ts:228-475`).
4
+ * memory-system-peer-project-parity. Tool schemas mirror peer-project
5
+ * (`referencia/peer-project/extensions/memory-core/src/tools.ts:228-475`).
6
6
  *
7
7
  * Each tool is exposed as a `MemoryTool` (name + description + JSON schema +
8
8
  * async execute). The agent-loop integration wires them via the existing
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@theokit/sdk-memory",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Memory subsystem for @theokit/sdk — MemoryProvider impls (markdown file store today; LanceDB + embeddings + circuit breaker next iters). Consumes the kernel-facing port from sdk-core.",
5
5
  "license": "Apache-2.0",
6
- "homepage": "https://github.com/usetheo/theokit-sdk#readme",
7
- "bugs": "https://github.com/usetheo/theokit-sdk/issues",
6
+ "homepage": "https://github.com/usetheodev/theokit-sdk#readme",
7
+ "bugs": "https://github.com/usetheodev/theokit-sdk/issues",
8
8
  "repository": {
9
9
  "type": "git",
10
- "url": "git+https://github.com/usetheo/theokit-sdk.git",
10
+ "url": "git+https://github.com/usetheodev/theokit-sdk.git",
11
11
  "directory": "packages/sdk-memory"
12
12
  },
13
13
  "type": "module",
@@ -38,7 +38,7 @@
38
38
  "LICENSE"
39
39
  ],
40
40
  "peerDependencies": {
41
- "@theokit/sdk": ">=1.7.0",
41
+ "@theokit/sdk": ">=4.0.0",
42
42
  "better-sqlite3": "^12.0.0",
43
43
  "sqlite-vec": ">=0.1.0",
44
44
  "@lancedb/lancedb": ">=0.20.0"
@@ -61,7 +61,7 @@
61
61
  "@types/better-sqlite3": "^7.6.13",
62
62
  "better-sqlite3": "^12.10.0",
63
63
  "sqlite-vec": "^0.1.6",
64
- "@theokit/sdk": "3.2.2"
64
+ "@theokit/sdk": "4.39.0"
65
65
  },
66
66
  "publishConfig": {
67
67
  "access": "public"
@@ -1,16 +0,0 @@
1
- import type { EmbeddingCache } from "./embedding-adapter.js";
2
- /**
3
- * Bounded in-memory LRU cache for embeddings, keyed by `sha256(text)` (or any
4
- * stable key the caller chooses).
5
- *
6
- * @internal
7
- */
8
- export declare class LruEmbeddingCache implements EmbeddingCache {
9
- private readonly capacity;
10
- private readonly map;
11
- constructor(capacity?: number);
12
- get(key: string): number[] | undefined;
13
- set(key: string, value: number[]): void;
14
- size(): number;
15
- }
16
- //# sourceMappingURL=embedding-cache.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"embedding-cache.d.ts","sourceRoot":"","sources":["../../../src/internal/embedding/embedding-cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D;;;;;GAKG;AACH,qBAAa,iBAAkB,YAAW,cAAc;IAG1C,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAFrC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAA+B;gBAEtB,QAAQ,GAAE,MAAa;IAEpD,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS;IAStC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI;IAUvC,IAAI,IAAI,MAAM;CAGf"}