dsh-mnemon-source-runtime 0.5.0-rc.1

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.
@@ -0,0 +1,86 @@
1
+ //#region src/contracts.d.ts
2
+ type RuntimeMemoryTarget = 'memory' | 'user';
3
+ type RuntimeMemoryImportance = 'critical' | 'normal' | 'low';
4
+ type RuntimeMemoryAction = 'add' | 'replace' | 'remove';
5
+ interface RuntimeMemoryEntry {
6
+ content: string;
7
+ created_at: string;
8
+ updated_at: string;
9
+ target: RuntimeMemoryTarget;
10
+ importance: RuntimeMemoryImportance;
11
+ /** Optional git branch names that limit where this entry is projected. Absent means every branch. */
12
+ branches?: string[];
13
+ }
14
+ interface RuntimeMemoryUsage {
15
+ used: number;
16
+ limit: number;
17
+ }
18
+ interface RuntimeMemoryTargetView extends RuntimeMemoryUsage {
19
+ target: RuntimeMemoryTarget;
20
+ entryCount: number;
21
+ markdownPath: string;
22
+ }
23
+ interface RuntimeMemorySnapshot {
24
+ directory: string;
25
+ sourcePath: string;
26
+ revision: string;
27
+ generatedAt: string;
28
+ entries: RuntimeMemoryEntry[];
29
+ targets: Record<RuntimeMemoryTarget, RuntimeMemoryTargetView>;
30
+ }
31
+ interface RuntimeMemoryCompactedEntry {
32
+ content: string;
33
+ importance: RuntimeMemoryImportance;
34
+ /** Branch scope carried through compaction; absent means the entry is visible on every branch. */
35
+ branches?: string[];
36
+ }
37
+ interface RuntimeMemoryMutation {
38
+ action: RuntimeMemoryAction;
39
+ target: RuntimeMemoryTarget;
40
+ content?: string;
41
+ oldText?: string;
42
+ importance?: RuntimeMemoryImportance;
43
+ /** Git branch names limiting where a target=memory entry is projected. Absent keeps the current scope on replace; an empty list clears it. */
44
+ branches?: string[];
45
+ }
46
+ type RuntimeMemoryMutationResult = {
47
+ success: true;
48
+ message: string;
49
+ target: RuntimeMemoryTarget;
50
+ entryCount: number;
51
+ usage: RuntimeMemoryUsage;
52
+ added?: string;
53
+ replaced?: {
54
+ from: string;
55
+ to: string;
56
+ };
57
+ removed?: string;
58
+ maintenance?: {
59
+ kind: 'local-compaction' | 'mnemon-archive';
60
+ runId: string;
61
+ provider: string;
62
+ summary: string;
63
+ memoryBodyIds: string[];
64
+ };
65
+ };
66
+ interface RuntimeMemoryMaintenancePlan {
67
+ revision: string;
68
+ action: RuntimeMemoryAction;
69
+ target: RuntimeMemoryTarget;
70
+ entries: RuntimeMemoryEntry[];
71
+ pending?: RuntimeMemoryCompactedEntry;
72
+ excluded?: RuntimeMemoryEntry;
73
+ used: number;
74
+ projected: number;
75
+ limit: number;
76
+ requiresMaintenance: boolean;
77
+ }
78
+ declare const RUNTIME_MEMORY_VERSION = 1;
79
+ declare const RUNTIME_ENTRY_DELIMITER = "\n§\n";
80
+ interface RuntimeMemoryLimits {
81
+ readonly memory: number;
82
+ readonly user: number;
83
+ }
84
+ declare const RUNTIME_MEMORY_LIMITS: RuntimeMemoryLimits;
85
+ //#endregion
86
+ export { RUNTIME_ENTRY_DELIMITER, RUNTIME_MEMORY_LIMITS, RUNTIME_MEMORY_VERSION, RuntimeMemoryAction, RuntimeMemoryCompactedEntry, RuntimeMemoryEntry, RuntimeMemoryImportance, RuntimeMemoryLimits, RuntimeMemoryMaintenancePlan, RuntimeMemoryMutation, RuntimeMemoryMutationResult, RuntimeMemorySnapshot, RuntimeMemoryTarget, RuntimeMemoryTargetView, RuntimeMemoryUsage };
@@ -0,0 +1,2 @@
1
+ import { n as RUNTIME_MEMORY_LIMITS, r as RUNTIME_MEMORY_VERSION, t as RUNTIME_ENTRY_DELIMITER } from "./contracts-BqaPCrGD.js";
2
+ export { RUNTIME_ENTRY_DELIMITER, RUNTIME_MEMORY_LIMITS, RUNTIME_MEMORY_VERSION };
package/lib/index.d.ts ADDED
@@ -0,0 +1,24 @@
1
+ import { RUNTIME_ENTRY_DELIMITER, RUNTIME_MEMORY_LIMITS, RUNTIME_MEMORY_VERSION, RuntimeMemoryAction, RuntimeMemoryCompactedEntry, RuntimeMemoryEntry, RuntimeMemoryImportance, RuntimeMemoryLimits, RuntimeMemoryMaintenancePlan, RuntimeMemoryMutation, RuntimeMemoryMutationResult, RuntimeMemorySnapshot, RuntimeMemoryTarget, RuntimeMemoryTargetView, RuntimeMemoryUsage } from "./contracts.js";
2
+ import z from "schemastery";
3
+ import { MemorySourceDefinition } from "dsh-mnemon/contracts";
4
+ import { Context } from "@deepseek-ai/cordis";
5
+ //#region src/config.d.ts
6
+ interface Config {
7
+ dataDir?: string;
8
+ userDataDir?: string;
9
+ memoryLimitBytes?: number;
10
+ userLimitBytes?: number;
11
+ }
12
+ declare const Config: z<Config>;
13
+ //#endregion
14
+ //#region src/source.d.ts
15
+ declare function createRuntimeMemorySource(config?: Config): MemorySourceDefinition;
16
+ declare const RUNTIME_MEMORY_SOURCE: MemorySourceDefinition;
17
+ //#endregion
18
+ //#region src/index.d.ts
19
+ declare const name = "dsh-mnemon-source-runtime";
20
+ declare const inject: string[];
21
+ declare const memoryPlugin: import("dsh-mnemon/extension-sdk").MemoryPluginDescriptor;
22
+ declare function apply(ctx: Context, config?: Config): void;
23
+ //#endregion
24
+ export { Config, type RUNTIME_ENTRY_DELIMITER, type RUNTIME_MEMORY_LIMITS, RUNTIME_MEMORY_SOURCE, type RUNTIME_MEMORY_VERSION, type RuntimeMemoryAction, type RuntimeMemoryCompactedEntry, type RuntimeMemoryEntry, type RuntimeMemoryImportance, type RuntimeMemoryLimits, type RuntimeMemoryMaintenancePlan, type RuntimeMemoryMutation, type RuntimeMemoryMutationResult, type RuntimeMemorySnapshot, type RuntimeMemoryTarget, type RuntimeMemoryTargetView, type RuntimeMemoryUsage, apply, createRuntimeMemorySource, inject, memoryPlugin, name };