@theokit/sdk-memory 0.3.3 → 0.4.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.
@@ -1,43 +1,35 @@
1
- import { type MemoryConfig, type MemoryFact } from "../memory-types.js";
2
1
  /**
3
- * The memory root for a workspace: `<cwd>/.theokit/memory`. Every other path in
4
- * this package is derived from it, and `memory_get` refuses to read outside it.
5
- * Pure path computation nothing is created on disk.
6
- */
7
- export declare function memoryDir(cwd: string): string;
8
- /** Path to `MEMORY.md`, the single file holding the flat `## Facts` list. Pure path computation. */
9
- export declare function memoryMdPath(cwd: string): string;
10
- /**
11
- * Path to `<memory root>/notes`, where per-topic notes and the consolidated
12
- * notes written by a dreaming sweep live. Pure path computation — the directory
13
- * may not exist.
2
+ * Markdown-first memory storage re-exported from `@theokit/sdk`, not reimplemented here.
3
+ *
4
+ * This file used to be a full copy (iter 56, Stage 3 source-move #13). The copy went stale: `#389`
5
+ * moved the layout from bullets under `MEMORY.md ## Facts` to a file per memory, and the
6
+ * Claude Code compatibility work added two more read roots — both landed in the SDK's copy and
7
+ * neither in this one. Because `Memory.runDreamingSweep` routes through this package whenever it is
8
+ * installed, **the copy that ran was not the copy anyone had updated**: installing
9
+ * `@theokit/sdk-memory` made every memory the SDK had written unreadable, reported as
10
+ * `factsBefore: 0` a number that reads exactly like an empty store (#430).
11
+ *
12
+ * theokit#160 fixed the identical shape for the embedding runtime, in this same package pair, by
13
+ * importing one implementation instead of syncing two. Same remedy here. Re-syncing the copy would
14
+ * have fixed today's divergence and left tomorrow's free to happen.
15
+ *
16
+ * The re-exported signatures are supersets of what this package used to expose — the added
17
+ * parameters are optional — so nothing that called them before has to change.
18
+ *
19
+ * @internal
14
20
  */
15
- export declare function notesDir(cwd: string): string;
16
- /** Read facts from `MEMORY.md`'s `## Facts` section. Returns `[]` when missing. */
17
- export declare function readFactsFromMarkdown(cwd: string): Promise<MemoryFact[]>;
18
- /** Append a fact to `MEMORY.md ## Facts`. Creates the section if missing. Atomic + serialized. */
19
- export declare function appendFactToMarkdown(cwd: string, fact: MemoryFact): Promise<void>;
21
+ export { appendFact, appendFactToMarkdown, claudeProjectMemoryDir, memoryDir, memoryMdPath, memoryWriteDir, notesDir, readFacts, readFactsFromMarkdown, } from "@theokit/sdk/internal/memory-store";
20
22
  /** One note discovered under `notes/`: its file name without the `.md` suffix, and its absolute path. */
21
23
  export interface NoteFile {
22
24
  slug: string;
23
25
  path: string;
24
26
  }
25
27
  /**
26
- * List the `.md` files directly under `notes/`. Returns `[]` when the directory
27
- * does not exist, so a workspace that has never written a note is not an error.
28
- * Does not recurse into sub-directories.
29
- */
30
- export declare function listNotes(cwd: string): Promise<NoteFile[]>;
31
- /** Configuration-aware accessors honoring the existing MemoryConfig contract. */
32
- export declare function readFacts(cwd: string, config: MemoryConfig): Promise<MemoryFact[]>;
33
- /**
34
- * Append a fact, honouring the `enabled` gate on {@link MemoryConfig}: when
35
- * memory is disabled the call resolves without touching disk. This is the entry
36
- * point for configuration-aware callers; `appendFactToMarkdown` is the same
37
- * write without the gate.
28
+ * List the `.md` files directly under `notes/`. Returns `[]` when the directory does not exist, so
29
+ * a workspace that has never written a note is not an error. Does not recurse into sub-directories.
38
30
  *
39
- * The write itself is atomic and serialised per memory root, and the fact text
40
- * passes through secret redaction first.
31
+ * Stays here rather than moving to the shared store: notes are this package's concept, and only
32
+ * this package reads them.
41
33
  */
42
- export declare function appendFact(cwd: string, config: MemoryConfig, fact: MemoryFact): Promise<void>;
34
+ export declare function listNotes(cwd: string): Promise<NoteFile[]>;
43
35
  //# sourceMappingURL=markdown-store.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"markdown-store.d.ts","sourceRoot":"","sources":["../../../src/internal/store/markdown-store.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,UAAU,EAAiB,MAAM,oBAAoB,CAAC;AAqCvF;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED,oGAAoG;AACpG,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED,mFAAmF;AACnF,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAQ9E;AAED,kGAAkG;AAClG,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAcjF;AAED,yGAAyG;AACzG,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,wBAAsB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAUhE;AAsCD,iFAAiF;AACjF,wBAAsB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAGxF;AAED;;;;;;;;GAQG;AACH,wBAAsB,UAAU,CAC9B,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,YAAY,EACpB,IAAI,EAAE,UAAU,GACf,OAAO,CAAC,IAAI,CAAC,CAGf"}
1
+ {"version":3,"file":"markdown-store.d.ts","sourceRoot":"","sources":["../../../src/internal/store/markdown-store.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,sBAAsB,EACtB,SAAS,EACT,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,SAAS,EACT,qBAAqB,GACtB,MAAM,oCAAoC,CAAC;AAE5C,yGAAyG;AACzG,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;GAMG;AACH,wBAAsB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAUhE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theokit/sdk-memory",
3
- "version": "0.3.3",
3
+ "version": "0.4.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
6
  "homepage": "https://github.com/usetheokit/theokit-sdk#readme",
@@ -38,7 +38,7 @@
38
38
  "LICENSE"
39
39
  ],
40
40
  "peerDependencies": {
41
- "@theokit/sdk": ">=4.54.0",
41
+ "@theokit/sdk": ">=4.60.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": "4.59.0"
64
+ "@theokit/sdk": "4.60.0"
65
65
  },
66
66
  "publishConfig": {
67
67
  "provenance": true,