@lmzhen/dsh-memory 0.3.18 → 0.3.19
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.js +6 -6
- package/lib/types/index.d.ts +6 -6
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -26,11 +26,11 @@ var MemoryRegistry = class extends Service {
|
|
|
26
26
|
if (!first) throw new Error(`memory: no provider registered${name ? ` named "${name}"` : ""}`);
|
|
27
27
|
return first;
|
|
28
28
|
}
|
|
29
|
-
read(target
|
|
30
|
-
return this.provider().read(target
|
|
29
|
+
read(target) {
|
|
30
|
+
return this.provider().read(target);
|
|
31
31
|
}
|
|
32
|
-
async applyBatch(target, operations
|
|
33
|
-
const result = await this.provider().applyBatch(target, operations
|
|
32
|
+
async applyBatch(target, operations) {
|
|
33
|
+
const result = await this.provider().applyBatch(target, operations);
|
|
34
34
|
if (result.ok) this.ctx.emit("evolution/memory-applied", {
|
|
35
35
|
target,
|
|
36
36
|
chars: result.chars,
|
|
@@ -38,8 +38,8 @@ var MemoryRegistry = class extends Service {
|
|
|
38
38
|
});
|
|
39
39
|
return result;
|
|
40
40
|
}
|
|
41
|
-
snapshot(
|
|
42
|
-
return this.provider().snapshot(
|
|
41
|
+
snapshot() {
|
|
42
|
+
return this.provider().snapshot();
|
|
43
43
|
}
|
|
44
44
|
renderContext() {
|
|
45
45
|
return this.provider().renderContext();
|
package/lib/types/index.d.ts
CHANGED
|
@@ -40,9 +40,9 @@ export interface MemorySnapshot {
|
|
|
40
40
|
}
|
|
41
41
|
export interface MemoryProvider {
|
|
42
42
|
readonly name: string;
|
|
43
|
-
read(target: MemoryTarget
|
|
44
|
-
applyBatch(target: MemoryTarget, operations: MemoryOperation[]
|
|
45
|
-
snapshot(
|
|
43
|
+
read(target: MemoryTarget): Promise<string[]>;
|
|
44
|
+
applyBatch(target: MemoryTarget, operations: MemoryOperation[]): Promise<MemoryApplyResult>;
|
|
45
|
+
snapshot(): Promise<MemorySnapshot>;
|
|
46
46
|
renderContext(): Promise<string>;
|
|
47
47
|
}
|
|
48
48
|
declare module '@deepseek-ai/cordis' {
|
|
@@ -57,9 +57,9 @@ export declare class MemoryRegistry extends Service {
|
|
|
57
57
|
/** 0.3.17 (E-73): named lookup like the io/state-storage registries; no
|
|
58
58
|
* name = first registered (backward compatible). */
|
|
59
59
|
provider(name?: string): MemoryProvider;
|
|
60
|
-
read(target: MemoryTarget
|
|
61
|
-
applyBatch(target: MemoryTarget, operations: MemoryOperation[]
|
|
62
|
-
snapshot(
|
|
60
|
+
read(target: MemoryTarget): Promise<string[]>;
|
|
61
|
+
applyBatch(target: MemoryTarget, operations: MemoryOperation[]): Promise<MemoryApplyResult>;
|
|
62
|
+
snapshot(): Promise<MemorySnapshot>;
|
|
63
63
|
renderContext(): Promise<string>;
|
|
64
64
|
}
|
|
65
65
|
export default MemoryRegistry;
|