@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.
- package/CHANGELOG.md +23 -0
- package/dist/index.cjs +80 -130
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +30 -108
- package/dist/index.js.map +1 -1
- package/dist/internal/store/markdown-store.d.ts +24 -32
- package/dist/internal/store/markdown-store.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1,43 +1,35 @@
|
|
|
1
|
-
import { type MemoryConfig, type MemoryFact } from "../memory-types.js";
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
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
|
|
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
|
-
*
|
|
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
|
-
*
|
|
40
|
-
*
|
|
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
|
|
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,
|
|
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
|
+
"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.
|
|
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.
|
|
64
|
+
"@theokit/sdk": "4.60.0"
|
|
65
65
|
},
|
|
66
66
|
"publishConfig": {
|
|
67
67
|
"provenance": true,
|