dsh-mnemon-strategy-general 0.5.1 → 0.5.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 +2 -1
- package/lib/index.js +3 -1
- package/package.json +3 -3
package/lib/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as projectionSDK from "dsh-mnemon/extension-sdk";
|
|
1
2
|
import { MemoryStrategyDefinition } from "dsh-mnemon/contracts";
|
|
2
3
|
import { Context } from "@deepseek-ai/cordis";
|
|
3
4
|
//#region src/strategy.d.ts
|
|
@@ -10,7 +11,7 @@ interface GeneralStrategyConfig {
|
|
|
10
11
|
}
|
|
11
12
|
/** Role-agnostic composition: every available Source, one shared budget, and the model decides. */
|
|
12
13
|
declare function createGeneralStrategy(config?: GeneralStrategyConfig): MemoryStrategyDefinition;
|
|
13
|
-
declare const GENERAL_VIEW_STRATEGY: MemoryStrategyDefinition;
|
|
14
|
+
declare const GENERAL_VIEW_STRATEGY: projectionSDK.MemoryStrategyDefinition;
|
|
14
15
|
//#endregion
|
|
15
16
|
//#region src/index.d.ts
|
|
16
17
|
type Config = GeneralStrategyConfig;
|
package/lib/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as projectionSDK from "dsh-mnemon/extension-sdk";
|
|
1
2
|
import { defineMemoryPlugin, defineMemoryStrategy, defineMemoryStrategyConfiguration, installMemory, memoryInputText, memoryViewExtensionValues } from "dsh-mnemon/extension-sdk";
|
|
2
3
|
import { ANY_MEMORY_SOURCE_ROLE, COMPOSABLE_MEMORY_API_VERSION, MEMORY_VIEW_EXTENSION_SLOTS } from "dsh-mnemon/contracts";
|
|
3
4
|
//#region src/strategy.ts
|
|
@@ -111,7 +112,8 @@ function createGeneralStrategy(config = {}) {
|
|
|
111
112
|
].filter(Boolean).join("\n\n"),
|
|
112
113
|
routing: lines.length === 0 ? "No memory Source is currently admitted; continue without memory." : "Admitted memory Sources:\n" + lines.join("\n")
|
|
113
114
|
};
|
|
114
|
-
|
|
115
|
+
if (typeof projectionSDK.reserveMemoryProjection !== "function" && sources.some((source) => source.hints && typeof source.hints === "object" && !Array.isArray(source.hints) && Number(source.hints.minimumProjectionCharacters) > 0)) throw new Error("Pinned Runtime requires a newer dsh-mnemon Host; update the Host and official Strategies together.");
|
|
116
|
+
return projectionSDK.reserveMemoryProjection?.(spec, sources, characters) ?? spec;
|
|
115
117
|
}
|
|
116
118
|
});
|
|
117
119
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mnemon-strategy-general",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "Role-agnostic main Strategy for Mnemon: every available Source, one shared budget, and the model decides how to use each one.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
37
|
-
"dsh-mnemon": "^0.5.
|
|
37
|
+
"dsh-mnemon": "^0.5.43"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/node": "^22.0.0",
|
|
41
|
-
"dsh-mnemon": "^0.5.
|
|
41
|
+
"dsh-mnemon": "^0.5.43",
|
|
42
42
|
"tsdown": "^0.22.0",
|
|
43
43
|
"typescript": "^5.9.0",
|
|
44
44
|
"vitest": "^3.2.0"
|