@theokit/sdk-memory 0.5.3 → 0.6.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 +45 -0
- package/dist/in-memory-provider.d.ts +21 -1
- package/dist/in-memory-provider.d.ts.map +1 -1
- package/dist/index.cjs +42 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +36 -8
- package/dist/index.js.map +1 -1
- package/dist/internal/dreaming/dreaming-phases.d.ts +6 -3
- package/dist/internal/dreaming/dreaming-phases.d.ts.map +1 -1
- package/dist/internal/dreaming/dreaming-run.d.ts +5 -0
- package/dist/internal/dreaming/dreaming-run.d.ts.map +1 -1
- package/dist/internal/store/markdown-store.d.ts +1 -1
- package/dist/internal/store/markdown-store.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -38,12 +38,15 @@ export interface Cluster {
|
|
|
38
38
|
members: ReadonlyArray<MemoryFact>;
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
|
-
* What {@link remPhase} produced. Every input fact
|
|
42
|
-
* cluster, so a fact related to nothing comes back as a
|
|
43
|
-
* count is not a count of *interesting* groupings.
|
|
41
|
+
* What {@link remPhase} produced. Every input fact inside the per-sweep cap
|
|
42
|
+
* appears in exactly one cluster, so a fact related to nothing comes back as a
|
|
43
|
+
* cluster of one — the count is not a count of *interesting* groupings. Facts
|
|
44
|
+
* past the cap are counted in `factsLeftOut` and appear in no cluster.
|
|
44
45
|
*/
|
|
45
46
|
export interface ClusterResult {
|
|
46
47
|
clusters: Cluster[];
|
|
48
|
+
/** How many input facts past the per-sweep cap were not clustered; 0 when none were. */
|
|
49
|
+
factsLeftOut: number;
|
|
47
50
|
}
|
|
48
51
|
/** Light phase — drop facts whose embedding is too similar to one already kept. */
|
|
49
52
|
export declare function lightPhase(facts: ReadonlyArray<MemoryFact>, embedding: EmbeddingRuntime, threshold?: number): Promise<DedupResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dreaming-phases.d.ts","sourceRoot":"","sources":["../../../src/internal/dreaming/dreaming-phases.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;GAKG;AACH,MAAM,WAAW,OAAO;IACtB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,OAAO,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;CACpC;AAED
|
|
1
|
+
{"version":3,"file":"dreaming-phases.d.ts","sourceRoot":"","sources":["../../../src/internal/dreaming/dreaming-phases.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;GAKG;AACH,MAAM,WAAW,OAAO;IACtB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,OAAO,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;CACpC;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,wFAAwF;IACxF,YAAY,EAAE,MAAM,CAAC;CACtB;AAKD,mFAAmF;AACnF,wBAAsB,UAAU,CAC9B,KAAK,EAAE,aAAa,CAAC,UAAU,CAAC,EAChC,SAAS,EAAE,gBAAgB,EAC3B,SAAS,GAAE,MAAgC,GAC1C,OAAO,CAAC,WAAW,CAAC,CActB;AAWD,6EAA6E;AAC7E,wBAAsB,QAAQ,CAC5B,KAAK,EAAE,aAAa,CAAC,UAAU,CAAC,EAChC,SAAS,EAAE,gBAAgB,EAC3B,SAAS,GAAE,MAAkC,EAC7C,gBAAgB,GAAE,MAAoC,GACrD,OAAO,CAAC,aAAa,CAAC,CAWxB;AAoCD,sEAAsE;AACtE,wBAAgB,SAAS,CAAC,QAAQ,EAAE,aAAa,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAavF"}
|
|
@@ -60,6 +60,11 @@ export interface DreamingResult {
|
|
|
60
60
|
clustersCreated: number;
|
|
61
61
|
notesWritten: number;
|
|
62
62
|
diaryEntryHash: string | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* Deduplicated facts past the per-sweep cap that were not clustered. Set on `"ok"`, 0 on
|
|
65
|
+
* `"skipped"`, and absent on `"error"`, where the sweep cannot say how many it left out.
|
|
66
|
+
*/
|
|
67
|
+
factsLeftOut?: number;
|
|
63
68
|
}
|
|
64
69
|
/**
|
|
65
70
|
* Run one consolidation sweep over `MEMORY.md`: drop near-duplicate facts,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dreaming-run.d.ts","sourceRoot":"","sources":["../../../src/internal/dreaming/dreaming-run.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAK1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,gBAAgB,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,+CAA+C;IAC/C,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB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
18
|
*
|
|
19
19
|
* @internal
|
|
20
20
|
*/
|
|
21
|
-
export { appendFact, appendFactToMarkdown, asMemoryRoot, claudeProjectMemoryDir, collectMarkdownFiles, type DiscoveredFile, defaultIndexPath, indexBudgetWarning, lanceStoragePath, MEMORY_INDEX_MAX_BYTES, MEMORY_INDEX_MAX_LINES, type MemoryLocationConfig, type MemoryRoot, memoryIndexRoot, memoryMdPath, memoryReadRoots, notesDir, projectMemoryDir, readAllSqliteFacts, readFacts, readFactsFromMarkdown, resolveMemoryRoot, type SqliteFactRow, } from "@theokit/sdk/internal/memory-store";
|
|
21
|
+
export { appendFact, appendFactToMarkdown, asMemoryRoot, ceilingReachedError, claudeProjectMemoryDir, collectMarkdownFiles, type DiscoveredFile, defaultIndexPath, indexBudgetWarning, lanceStoragePath, MEMORY_INDEX_MAX_BYTES, MEMORY_INDEX_MAX_LINES, type MemoryLocationConfig, type MemoryRoot, memoryIndexRoot, memoryMdPath, memoryReadRoots, notesDir, projectMemoryDir, readAllSqliteFacts, readFacts, readFactsFromMarkdown, resolveMaxFacts, resolveMemoryRoot, type SqliteFactRow, } from "@theokit/sdk/internal/memory-store";
|
|
22
22
|
/** One note discovered under `notes/`: its file name without the `.md` suffix, and its absolute path. */
|
|
23
23
|
export interface NoteFile {
|
|
24
24
|
slug: string;
|
|
@@ -1 +1 @@
|
|
|
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,YAAY,EACZ,sBAAsB,EACtB,oBAAoB,EACpB,KAAK,cAAc,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,EACtB,KAAK,oBAAoB,EACzB,KAAK,UAAU,EACf,eAAe,EACf,YAAY,EACZ,eAAe,EACf,QAAQ,EACR,gBAAgB,EAChB,kBAAkB,EAClB,SAAS,EACT,qBAAqB,EACrB,iBAAiB,EACjB,KAAK,aAAa,GACnB,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,CAahE"}
|
|
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,YAAY,EACZ,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,KAAK,cAAc,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,EACtB,KAAK,oBAAoB,EACzB,KAAK,UAAU,EACf,eAAe,EACf,YAAY,EACZ,eAAe,EACf,QAAQ,EACR,gBAAgB,EAChB,kBAAkB,EAClB,SAAS,EACT,qBAAqB,EACrB,eAAe,EACf,iBAAiB,EACjB,KAAK,aAAa,GACnB,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,CAahE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theokit/sdk-memory",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.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,10 +38,10 @@
|
|
|
38
38
|
"LICENSE"
|
|
39
39
|
],
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@theokit/sdk": ">=5.0.0-next.1",
|
|
42
41
|
"better-sqlite3": "^12.0.0",
|
|
43
42
|
"sqlite-vec": ">=0.1.0",
|
|
44
|
-
"@lancedb/lancedb": ">=0.20.0"
|
|
43
|
+
"@lancedb/lancedb": ">=0.20.0",
|
|
44
|
+
"@theokit/sdk": "^5.10.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependenciesMeta": {
|
|
47
47
|
"better-sqlite3": {
|
|
@@ -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": "5.0
|
|
64
|
+
"@theokit/sdk": "5.10.0"
|
|
65
65
|
},
|
|
66
66
|
"publishConfig": {
|
|
67
67
|
"provenance": true,
|