dsh-mnemon-source-documents 0.6.1 → 0.6.2
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/lib/index.d.ts +1 -0
- package/lib/index.js +12 -2
- package/package.json +2 -2
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import { closeSync, existsSync, lstatSync, mkdirSync, openSync, readFileSync, re
|
|
|
9
9
|
//#region src/config.ts
|
|
10
10
|
const Config = z.object({
|
|
11
11
|
dataDir: z.string(),
|
|
12
|
+
bm25Recall: z.boolean(),
|
|
12
13
|
limitBytes: z.number().step(1).min(1).max(1073741824)
|
|
13
14
|
});
|
|
14
15
|
function documentsSourceConfig(value, instanceKey) {
|
|
@@ -17,7 +18,8 @@ function documentsSourceConfig(value, instanceKey) {
|
|
|
17
18
|
if (!isAbsolute(dataDir)) throw new Error("Documents Source dataDir must be absolute");
|
|
18
19
|
return {
|
|
19
20
|
dataDir,
|
|
20
|
-
limitBytes: config.limitBytes ?? 10485760
|
|
21
|
+
limitBytes: config.limitBytes ?? 10485760,
|
|
22
|
+
bm25Recall: config.bm25Recall ?? false
|
|
21
23
|
};
|
|
22
24
|
}
|
|
23
25
|
//#endregion
|
|
@@ -950,7 +952,15 @@ function createDocumentsMemorySource(config = {}) {
|
|
|
950
952
|
value: {
|
|
951
953
|
workspaceRoot: root,
|
|
952
954
|
documentIds: active.map((document) => document.id),
|
|
953
|
-
archivedDocumentIds: current.documents.filter((document) => document.status === "archived" && document.healthy).map((document) => document.id).sort()
|
|
955
|
+
archivedDocumentIds: current.documents.filter((document) => document.status === "archived" && document.healthy).map((document) => document.id).sort(),
|
|
956
|
+
...request.includeProjection && effective.bm25Recall ? { bm25: {
|
|
957
|
+
scope: createHash("sha256").update(JSON.stringify([effective.dataDir, root])).digest("hex"),
|
|
958
|
+
text: truncateMemoryText("Project Documents can be searched by title or topic.", request.maxCharacters),
|
|
959
|
+
titles: active.map((document) => ({
|
|
960
|
+
id: document.id,
|
|
961
|
+
title: document.title
|
|
962
|
+
}))
|
|
963
|
+
} } : {}
|
|
954
964
|
},
|
|
955
965
|
revision: current.revision,
|
|
956
966
|
consistency: "namespace-pinned-live-read"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mnemon-source-documents",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "Self-contained documents Source for Composable View Memory.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@types/node": "^22.0.0",
|
|
61
61
|
"@types/react": "^18.3.0",
|
|
62
62
|
"@types/react-dom": "^18.3.0",
|
|
63
|
-
"dsh-mnemon": "^0.5.
|
|
63
|
+
"dsh-mnemon": "^0.5.49",
|
|
64
64
|
"jsdom": "^26.0.0",
|
|
65
65
|
"react": "^18.2.0",
|
|
66
66
|
"react-dom": "^18.2.0",
|