dsh-mnemon 0.1.5 → 0.1.6
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/README.md +5 -5
- package/README.zh-CN.md +5 -5
- package/lib/client.js +353 -347
- package/lib/index.js +129 -46
- package/lib/types/activity.d.ts +2 -18
- package/lib/types/channels.d.ts +1 -4
- package/lib/types/client/MnemonLogo.d.ts +0 -1
- package/lib/types/client/MnemonPackSection.d.ts +1 -2
- package/lib/types/client/MnemonSaveAction.d.ts +1 -2
- package/lib/types/client/MnemonSettingsCard.d.ts +1 -3
- package/lib/types/client/MnemonTurnTail.d.ts +1 -2
- package/lib/types/client/MnemonView.d.ts +1 -3
- package/lib/types/client/MnemonViewAppearance.d.ts +0 -1
- package/lib/types/client/anchor.d.ts +0 -1
- package/lib/types/client/api.d.ts +1 -9
- package/lib/types/client/dsh-compat.d.ts +0 -1
- package/lib/types/client/index.d.ts +0 -1
- package/lib/types/client/locales.d.ts +4 -1
- package/lib/types/client/settings.d.ts +1 -2
- package/lib/types/client/sidebar-entry.d.ts +0 -1
- package/lib/types/client/workspace-controller.d.ts +0 -1
- package/lib/types/client/workspace-mount.d.ts +1 -3
- package/lib/types/commands.d.ts +0 -1
- package/lib/types/config-values.d.ts +0 -1
- package/lib/types/config.d.ts +6 -80
- package/lib/types/contracts.d.ts +2 -60
- package/lib/types/documents.d.ts +2 -79
- package/lib/types/guidance.d.ts +0 -1
- package/lib/types/index.d.ts +0 -1
- package/lib/types/lifecycle.d.ts +3 -45
- package/lib/types/live-runtime.d.ts +0 -1
- package/lib/types/memory-bodies.d.ts +3 -20
- package/lib/types/pack.d.ts +2 -48
- package/lib/types/process.d.ts +0 -1
- package/lib/types/review-activity.d.ts +2 -16
- package/lib/types/rpc.d.ts +0 -1
- package/lib/types/runner.d.ts +15 -11
- package/lib/types/runtime-memory.d.ts +2 -59
- package/lib/types/service.d.ts +3 -149
- package/lib/types/settings.d.ts +1 -4
- package/lib/types/shared/contracts.d.ts +609 -0
- package/lib/types/storage-scope.d.ts +2 -29
- package/lib/types/subagent.d.ts +2 -15
- package/lib/types/tools.d.ts +0 -1
- package/lib/types/version-updates.d.ts +2 -29
- package/package.json +8 -7
- package/docs/README.md +0 -8
- package/docs/assets/diagrams/en/memory-system-flow.png +0 -0
- package/docs/assets/diagrams/en/project-architecture.svg +0 -182
- package/docs/assets/diagrams/zh-CN/memory-system-flow.png +0 -0
- package/docs/assets/diagrams/zh-CN/project-architecture.svg +0 -182
- package/docs/assets/media/dsh-mnemon-memory-system-demo-poster.jpg +0 -0
- package/docs/assets/media/dsh-mnemon-memory-system-demo.gif +0 -0
- package/docs/assets/media/dsh-mnemon-memory-system-demo.mp4 +0 -0
- package/docs/assets/screenshots/conversation-memory-jump.png +0 -0
- package/docs/assets/screenshots/conversation-save-dialog.png +0 -0
- package/docs/assets/screenshots/conversation-turn-memory.png +0 -0
- package/docs/assets/screenshots/document-create-dialog.png +0 -0
- package/docs/assets/screenshots/documents-markdown.png +0 -0
- package/docs/assets/screenshots/entities-context.png +0 -0
- package/docs/assets/screenshots/memory-content.png +0 -0
- package/docs/assets/screenshots/overview-memory-graph.png +0 -0
- package/docs/assets/screenshots/recall-agent-answer.png +0 -0
- package/docs/assets/screenshots/remember-dialog.png +0 -0
- package/docs/assets/screenshots/runtime-memory-add.png +0 -0
- package/docs/assets/screenshots/runtime-memory.png +0 -0
- package/docs/assets/screenshots/settings-memory-system.png +0 -0
- package/docs/assets/screenshots/status-overview.png +0 -0
- package/docs/assets/screenshots/version-check.png +0 -0
- package/docs/en/README.md +0 -48
- package/docs/en/architecture.md +0 -133
- package/docs/en/configuration.md +0 -234
- package/docs/en/development.md +0 -198
- package/docs/en/getting-started.md +0 -199
- package/docs/en/interfaces.md +0 -181
- package/docs/en/operations.md +0 -173
- package/docs/en/project-overview.md +0 -145
- package/docs/en/roadmap.md +0 -41
- package/docs/en/storage-model.md +0 -185
- package/docs/en/ui-guide.md +0 -156
- package/docs/en/workflows.md +0 -290
- package/docs/zh-CN/README.md +0 -48
- package/docs/zh-CN/architecture.md +0 -133
- package/docs/zh-CN/configuration.md +0 -234
- package/docs/zh-CN/development.md +0 -198
- package/docs/zh-CN/getting-started.md +0 -199
- package/docs/zh-CN/interfaces.md +0 -181
- package/docs/zh-CN/operations.md +0 -173
- package/docs/zh-CN/project-overview.md +0 -145
- package/docs/zh-CN/roadmap.md +0 -41
- package/docs/zh-CN/storage-model.md +0 -185
- package/docs/zh-CN/ui-guide.md +0 -160
- package/docs/zh-CN/workflows.md +0 -290
- package/lib/client.js.map +0 -1
- package/lib/types/activity.d.ts.map +0 -1
- package/lib/types/activity.js +0 -93
- package/lib/types/activity.js.map +0 -1
- package/lib/types/channels.d.ts.map +0 -1
- package/lib/types/channels.js +0 -4
- package/lib/types/channels.js.map +0 -1
- package/lib/types/client/MnemonLogo.d.ts.map +0 -1
- package/lib/types/client/MnemonLogo.js +0 -6
- package/lib/types/client/MnemonLogo.js.map +0 -1
- package/lib/types/client/MnemonPackSection.d.ts.map +0 -1
- package/lib/types/client/MnemonPackSection.js +0 -136
- package/lib/types/client/MnemonPackSection.js.map +0 -1
- package/lib/types/client/MnemonSaveAction.d.ts.map +0 -1
- package/lib/types/client/MnemonSaveAction.js +0 -90
- package/lib/types/client/MnemonSaveAction.js.map +0 -1
- package/lib/types/client/MnemonSettingsCard.d.ts.map +0 -1
- package/lib/types/client/MnemonSettingsCard.js +0 -155
- package/lib/types/client/MnemonSettingsCard.js.map +0 -1
- package/lib/types/client/MnemonTurnTail.d.ts.map +0 -1
- package/lib/types/client/MnemonTurnTail.js +0 -56
- package/lib/types/client/MnemonTurnTail.js.map +0 -1
- package/lib/types/client/MnemonView.d.ts.map +0 -1
- package/lib/types/client/MnemonView.js +0 -1594
- package/lib/types/client/MnemonView.js.map +0 -1
- package/lib/types/client/MnemonViewAppearance.d.ts.map +0 -1
- package/lib/types/client/MnemonViewAppearance.js +0 -67
- package/lib/types/client/MnemonViewAppearance.js.map +0 -1
- package/lib/types/client/anchor.d.ts.map +0 -1
- package/lib/types/client/anchor.js +0 -46
- package/lib/types/client/anchor.js.map +0 -1
- package/lib/types/client/api.d.ts.map +0 -1
- package/lib/types/client/api.js +0 -150
- package/lib/types/client/api.js.map +0 -1
- package/lib/types/client/dsh-compat.d.ts.map +0 -1
- package/lib/types/client/dsh-compat.js +0 -2
- package/lib/types/client/dsh-compat.js.map +0 -1
- package/lib/types/client/index.d.ts.map +0 -1
- package/lib/types/client/index.js +0 -161
- package/lib/types/client/index.js.map +0 -1
- package/lib/types/client/locales.d.ts.map +0 -1
- package/lib/types/client/locales.js +0 -1172
- package/lib/types/client/locales.js.map +0 -1
- package/lib/types/client/settings.d.ts.map +0 -1
- package/lib/types/client/settings.js +0 -70
- package/lib/types/client/settings.js.map +0 -1
- package/lib/types/client/sidebar-entry.d.ts.map +0 -1
- package/lib/types/client/sidebar-entry.js +0 -134
- package/lib/types/client/sidebar-entry.js.map +0 -1
- package/lib/types/client/workspace-controller.d.ts.map +0 -1
- package/lib/types/client/workspace-controller.js +0 -21
- package/lib/types/client/workspace-controller.js.map +0 -1
- package/lib/types/client/workspace-mount.d.ts.map +0 -1
- package/lib/types/client/workspace-mount.js +0 -138
- package/lib/types/client/workspace-mount.js.map +0 -1
- package/lib/types/commands.d.ts.map +0 -1
- package/lib/types/commands.js +0 -104
- package/lib/types/commands.js.map +0 -1
- package/lib/types/config-values.d.ts.map +0 -1
- package/lib/types/config-values.js +0 -4
- package/lib/types/config-values.js.map +0 -1
- package/lib/types/config.d.ts.map +0 -1
- package/lib/types/config.js +0 -127
- package/lib/types/config.js.map +0 -1
- package/lib/types/contracts.d.ts.map +0 -1
- package/lib/types/contracts.js +0 -2
- package/lib/types/contracts.js.map +0 -1
- package/lib/types/documents.d.ts.map +0 -1
- package/lib/types/documents.js +0 -495
- package/lib/types/documents.js.map +0 -1
- package/lib/types/guidance.d.ts.map +0 -1
- package/lib/types/guidance.js +0 -34
- package/lib/types/guidance.js.map +0 -1
- package/lib/types/index.d.ts.map +0 -1
- package/lib/types/index.js +0 -55
- package/lib/types/index.js.map +0 -1
- package/lib/types/lifecycle.d.ts.map +0 -1
- package/lib/types/lifecycle.js +0 -456
- package/lib/types/lifecycle.js.map +0 -1
- package/lib/types/live-runtime.d.ts.map +0 -1
- package/lib/types/live-runtime.js +0 -146
- package/lib/types/live-runtime.js.map +0 -1
- package/lib/types/memory-bodies.d.ts.map +0 -1
- package/lib/types/memory-bodies.js +0 -186
- package/lib/types/memory-bodies.js.map +0 -1
- package/lib/types/pack.d.ts.map +0 -1
- package/lib/types/pack.js +0 -709
- package/lib/types/pack.js.map +0 -1
- package/lib/types/process.d.ts.map +0 -1
- package/lib/types/process.js +0 -65
- package/lib/types/process.js.map +0 -1
- package/lib/types/review-activity.d.ts.map +0 -1
- package/lib/types/review-activity.js +0 -37
- package/lib/types/review-activity.js.map +0 -1
- package/lib/types/rpc.d.ts.map +0 -1
- package/lib/types/rpc.js +0 -384
- package/lib/types/rpc.js.map +0 -1
- package/lib/types/runner.d.ts.map +0 -1
- package/lib/types/runner.js +0 -198
- package/lib/types/runner.js.map +0 -1
- package/lib/types/runtime-memory.d.ts.map +0 -1
- package/lib/types/runtime-memory.js +0 -415
- package/lib/types/runtime-memory.js.map +0 -1
- package/lib/types/service.d.ts.map +0 -1
- package/lib/types/service.js +0 -512
- package/lib/types/service.js.map +0 -1
- package/lib/types/settings.d.ts.map +0 -1
- package/lib/types/settings.js +0 -103
- package/lib/types/settings.js.map +0 -1
- package/lib/types/storage-scope.d.ts.map +0 -1
- package/lib/types/storage-scope.js +0 -179
- package/lib/types/storage-scope.js.map +0 -1
- package/lib/types/subagent.d.ts.map +0 -1
- package/lib/types/subagent.js +0 -624
- package/lib/types/subagent.js.map +0 -1
- package/lib/types/tools.d.ts.map +0 -1
- package/lib/types/tools.js +0 -341
- package/lib/types/tools.js.map +0 -1
- package/lib/types/version-updates.d.ts.map +0 -1
- package/lib/types/version-updates.js +0 -383
- package/lib/types/version-updates.js.map +0 -1
|
@@ -0,0 +1,609 @@
|
|
|
1
|
+
import type { ConnectionHandle as DshClientConnectionHandle } from '@deepseek-ai/dsh-client-connection/client';
|
|
2
|
+
export declare const MNEMON_READ_CHANNEL = "/dsh-mnemon-read";
|
|
3
|
+
export declare const MNEMON_WRITE_CHANNEL = "/dsh-mnemon-write";
|
|
4
|
+
export declare const MNEMON_PACK_CHANNEL = "/dsh-mnemon-pack";
|
|
5
|
+
export declare const MNEMON_SETTINGS_CHANNEL = "/dsh-mnemon-settings";
|
|
6
|
+
export declare const MNEMON_SETTINGS_NAMESPACE = "mnemon";
|
|
7
|
+
export declare const MNEMON_UI_SETTINGS_NAMESPACE = "mnemon-ui";
|
|
8
|
+
export type JsonPrimitive = string | number | boolean | null;
|
|
9
|
+
export type JsonValue = JsonPrimitive | JsonValue[] | {
|
|
10
|
+
[key: string]: JsonValue;
|
|
11
|
+
};
|
|
12
|
+
export type RpcError = {
|
|
13
|
+
code: 'bad-request';
|
|
14
|
+
message: string;
|
|
15
|
+
details: {
|
|
16
|
+
issues: JsonValue[];
|
|
17
|
+
};
|
|
18
|
+
} | {
|
|
19
|
+
code: 'settings-rejected';
|
|
20
|
+
message: string;
|
|
21
|
+
details: {
|
|
22
|
+
ns: string;
|
|
23
|
+
};
|
|
24
|
+
} | {
|
|
25
|
+
code: 'internal';
|
|
26
|
+
message: string;
|
|
27
|
+
details: Record<string, never>;
|
|
28
|
+
};
|
|
29
|
+
export type RpcResult<T = JsonValue> = {
|
|
30
|
+
ok: true;
|
|
31
|
+
value: T;
|
|
32
|
+
} | {
|
|
33
|
+
ok: false;
|
|
34
|
+
error: RpcError;
|
|
35
|
+
};
|
|
36
|
+
/** Public DSH browser RPC face; the plugin intentionally consumes no other connection state. */
|
|
37
|
+
export type ClientConnectionHandle = Pick<DshClientConnectionHandle, 'rpc'>;
|
|
38
|
+
export interface ClientSettingsSnapshot<T> {
|
|
39
|
+
status: 'loading' | 'ready' | 'unavailable';
|
|
40
|
+
value?: T;
|
|
41
|
+
base?: unknown;
|
|
42
|
+
user?: unknown;
|
|
43
|
+
revision?: number;
|
|
44
|
+
writable: boolean;
|
|
45
|
+
mode: 'host' | 'memory';
|
|
46
|
+
}
|
|
47
|
+
export interface ClientSettingsScope<T> {
|
|
48
|
+
getSnapshot(): ClientSettingsSnapshot<T>;
|
|
49
|
+
subscribe(listener: () => void): () => void;
|
|
50
|
+
set(field: string, value: unknown): Promise<void>;
|
|
51
|
+
unset(field: string): Promise<void>;
|
|
52
|
+
setPath(path: string[], value: unknown): Promise<void>;
|
|
53
|
+
unsetPath(path: string[]): Promise<void>;
|
|
54
|
+
mutate?(ops: SettingsOperation[]): Promise<void>;
|
|
55
|
+
}
|
|
56
|
+
export type SettingsOperation = {
|
|
57
|
+
op: 'set';
|
|
58
|
+
path: string[];
|
|
59
|
+
value: unknown;
|
|
60
|
+
} | {
|
|
61
|
+
op: 'unset';
|
|
62
|
+
path: string[];
|
|
63
|
+
};
|
|
64
|
+
export type StorageScopeKind = 'global' | 'workspace' | 'custom';
|
|
65
|
+
export interface CustomPackConfig {
|
|
66
|
+
id: string;
|
|
67
|
+
name: string;
|
|
68
|
+
dataDir: string;
|
|
69
|
+
}
|
|
70
|
+
export interface Config {
|
|
71
|
+
storageScope?: StorageScopeKind;
|
|
72
|
+
cliPath?: string;
|
|
73
|
+
dataDir?: string;
|
|
74
|
+
customPackId?: string;
|
|
75
|
+
customPacks?: CustomPackConfig[];
|
|
76
|
+
store?: string;
|
|
77
|
+
timeoutMs?: number;
|
|
78
|
+
defaultRecallLimit?: number;
|
|
79
|
+
routingGuidance?: boolean;
|
|
80
|
+
displayMode?: 'sidebar' | 'buildin';
|
|
81
|
+
tabEnabled?: boolean;
|
|
82
|
+
writeEnabled?: boolean;
|
|
83
|
+
lifecycleEnabled?: boolean;
|
|
84
|
+
recallMode?: 'guided' | 'off';
|
|
85
|
+
writebackMode?: 'guided' | 'off';
|
|
86
|
+
idleReviewMs?: number;
|
|
87
|
+
conversationInteraction?: {
|
|
88
|
+
toolviews?: boolean;
|
|
89
|
+
turnBar?: boolean;
|
|
90
|
+
saveAction?: boolean;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
export interface InteractionConfig {
|
|
94
|
+
turnBar?: boolean;
|
|
95
|
+
saveAction?: boolean;
|
|
96
|
+
}
|
|
97
|
+
export interface ResolvedConfig {
|
|
98
|
+
storageScope: StorageScopeKind;
|
|
99
|
+
cliPath?: string;
|
|
100
|
+
dataDir?: string;
|
|
101
|
+
store?: string;
|
|
102
|
+
timeoutMs: number;
|
|
103
|
+
defaultRecallLimit: number;
|
|
104
|
+
routingGuidance: boolean;
|
|
105
|
+
displayMode: 'sidebar' | 'buildin';
|
|
106
|
+
tabEnabled: boolean;
|
|
107
|
+
writeEnabled: boolean;
|
|
108
|
+
lifecycleEnabled: boolean;
|
|
109
|
+
recallMode: 'guided' | 'off';
|
|
110
|
+
writebackMode: 'guided' | 'off';
|
|
111
|
+
idleReviewMs: number;
|
|
112
|
+
conversationInteraction: {
|
|
113
|
+
toolviews: boolean;
|
|
114
|
+
turnBar: boolean;
|
|
115
|
+
saveAction: boolean;
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
export interface ResolvedInteractionConfig {
|
|
119
|
+
turnBar: boolean;
|
|
120
|
+
saveAction: boolean;
|
|
121
|
+
}
|
|
122
|
+
export interface MemoryBody {
|
|
123
|
+
id: string;
|
|
124
|
+
name: string;
|
|
125
|
+
description: string;
|
|
126
|
+
active: boolean;
|
|
127
|
+
dbPath: string;
|
|
128
|
+
createdAt: string;
|
|
129
|
+
updatedAt: string;
|
|
130
|
+
}
|
|
131
|
+
export interface CreateMemoryBodyRequest {
|
|
132
|
+
name: string;
|
|
133
|
+
description: string;
|
|
134
|
+
active?: boolean;
|
|
135
|
+
}
|
|
136
|
+
export interface UpdateMemoryBodyRequest {
|
|
137
|
+
name?: string;
|
|
138
|
+
description?: string;
|
|
139
|
+
active?: boolean;
|
|
140
|
+
}
|
|
141
|
+
export type Category = 'preference' | 'decision' | 'fact' | 'insight' | 'context' | 'general';
|
|
142
|
+
export declare const CATEGORIES: readonly ["preference", "decision", "fact", "insight", "context", "general"];
|
|
143
|
+
export type Source = 'user' | 'agent' | 'external';
|
|
144
|
+
export declare const SOURCES: readonly ["user", "agent", "external"];
|
|
145
|
+
export type EdgeType = 'temporal' | 'semantic' | 'causal' | 'entity';
|
|
146
|
+
export declare const EDGE_TYPES: readonly ["temporal", "semantic", "causal", "entity"];
|
|
147
|
+
export type Intent = 'WHY' | 'WHEN' | 'ENTITY' | 'GENERAL';
|
|
148
|
+
export declare const INTENTS: readonly ["WHY", "WHEN", "ENTITY", "GENERAL"];
|
|
149
|
+
export interface Insight {
|
|
150
|
+
id: string;
|
|
151
|
+
content: string;
|
|
152
|
+
category?: string;
|
|
153
|
+
importance?: number;
|
|
154
|
+
tags?: string[];
|
|
155
|
+
entities?: string[];
|
|
156
|
+
source?: string;
|
|
157
|
+
score?: number;
|
|
158
|
+
confidence?: string;
|
|
159
|
+
intent?: string;
|
|
160
|
+
matchedVia?: string;
|
|
161
|
+
createdAt?: string;
|
|
162
|
+
depth?: number;
|
|
163
|
+
edgeType?: string;
|
|
164
|
+
memoryBodyId?: string;
|
|
165
|
+
memoryBodyName?: string;
|
|
166
|
+
}
|
|
167
|
+
export interface SearchRequest {
|
|
168
|
+
query: string;
|
|
169
|
+
mode?: 'smart' | 'keyword' | 'basic';
|
|
170
|
+
limit?: number;
|
|
171
|
+
category?: Category;
|
|
172
|
+
source?: Source;
|
|
173
|
+
intent?: Intent;
|
|
174
|
+
memoryBodyIds?: string[];
|
|
175
|
+
}
|
|
176
|
+
export interface RememberRequest {
|
|
177
|
+
content: string;
|
|
178
|
+
category?: Category;
|
|
179
|
+
importance?: number;
|
|
180
|
+
tags?: string[];
|
|
181
|
+
entities?: string[];
|
|
182
|
+
source?: Source;
|
|
183
|
+
memoryBodyId?: string;
|
|
184
|
+
}
|
|
185
|
+
export interface MemoryBodyStats {
|
|
186
|
+
totalInsights: number;
|
|
187
|
+
deletedInsights: number;
|
|
188
|
+
edgeCount: number;
|
|
189
|
+
oplogCount: number;
|
|
190
|
+
dbSizeBytes: number;
|
|
191
|
+
byCategory: Record<string, number>;
|
|
192
|
+
topEntities: Array<{
|
|
193
|
+
entity: string;
|
|
194
|
+
count: number;
|
|
195
|
+
}>;
|
|
196
|
+
}
|
|
197
|
+
export interface MemoryBodyView extends MemoryBody {
|
|
198
|
+
/** True when Mnemon's persisted active-file selection points to this Store. */
|
|
199
|
+
mnemonDefault: boolean;
|
|
200
|
+
healthy: boolean;
|
|
201
|
+
error?: string;
|
|
202
|
+
stats?: MemoryBodyStats;
|
|
203
|
+
}
|
|
204
|
+
export interface MemoryBodyCatalog {
|
|
205
|
+
items: MemoryBodyView[];
|
|
206
|
+
total: number;
|
|
207
|
+
activeCount: number;
|
|
208
|
+
directory: string;
|
|
209
|
+
generatedAt: string;
|
|
210
|
+
}
|
|
211
|
+
export interface MemoryGraphNode extends Insight {
|
|
212
|
+
color: string;
|
|
213
|
+
graphId?: string;
|
|
214
|
+
kind?: 'memory' | 'entity' | 'space';
|
|
215
|
+
memoryBodyIds?: string[];
|
|
216
|
+
memoryBodyNames?: string[];
|
|
217
|
+
occurrenceCount?: number;
|
|
218
|
+
}
|
|
219
|
+
export interface MemoryGraphEdge {
|
|
220
|
+
sourceId: string;
|
|
221
|
+
targetId: string;
|
|
222
|
+
label: string;
|
|
223
|
+
color: string;
|
|
224
|
+
type?: EdgeType | 'scope';
|
|
225
|
+
}
|
|
226
|
+
export interface MemoryGraphSnapshot {
|
|
227
|
+
nodes: MemoryGraphNode[];
|
|
228
|
+
edges: MemoryGraphEdge[];
|
|
229
|
+
generatedAt: string;
|
|
230
|
+
memoryBodies?: Array<Pick<MemoryBody, 'id' | 'name' | 'active'>>;
|
|
231
|
+
}
|
|
232
|
+
export interface MemoryListRequest {
|
|
233
|
+
query?: string;
|
|
234
|
+
category?: Category;
|
|
235
|
+
limit?: number;
|
|
236
|
+
memoryBodyIds?: string[];
|
|
237
|
+
}
|
|
238
|
+
export interface MemoryListView {
|
|
239
|
+
items: MemoryGraphNode[];
|
|
240
|
+
total: number;
|
|
241
|
+
generatedAt: string;
|
|
242
|
+
}
|
|
243
|
+
export interface EntityView {
|
|
244
|
+
items: Array<{
|
|
245
|
+
entity: string;
|
|
246
|
+
count: number;
|
|
247
|
+
}>;
|
|
248
|
+
insights: Insight[];
|
|
249
|
+
selected?: string;
|
|
250
|
+
}
|
|
251
|
+
export type DocumentStatus = 'active' | 'archived';
|
|
252
|
+
export interface DocumentRecord {
|
|
253
|
+
id: string;
|
|
254
|
+
title: string;
|
|
255
|
+
description: string;
|
|
256
|
+
status: DocumentStatus;
|
|
257
|
+
filename: string;
|
|
258
|
+
relativePath: string;
|
|
259
|
+
sourcePaths: string[];
|
|
260
|
+
sessionIds: string[];
|
|
261
|
+
createdAt: string;
|
|
262
|
+
updatedAt: string;
|
|
263
|
+
lastAccessedAt: string;
|
|
264
|
+
revision: number;
|
|
265
|
+
contentHash: string;
|
|
266
|
+
sizeBytes: number;
|
|
267
|
+
archivedAt?: string;
|
|
268
|
+
archiveSummary?: string;
|
|
269
|
+
memoryBodyIds: string[];
|
|
270
|
+
}
|
|
271
|
+
export interface DocumentView extends DocumentRecord {
|
|
272
|
+
content: string;
|
|
273
|
+
}
|
|
274
|
+
export interface DocumentSnapshot {
|
|
275
|
+
workspaceRoot: string;
|
|
276
|
+
directory: string;
|
|
277
|
+
indexPath: string;
|
|
278
|
+
generatedAt: string;
|
|
279
|
+
revision: string;
|
|
280
|
+
limitBytes: number;
|
|
281
|
+
activeBytes: number;
|
|
282
|
+
activeCount: number;
|
|
283
|
+
archivedCount: number;
|
|
284
|
+
total: number;
|
|
285
|
+
documents: Array<DocumentRecord & {
|
|
286
|
+
healthy: boolean;
|
|
287
|
+
excerpt: string;
|
|
288
|
+
}>;
|
|
289
|
+
}
|
|
290
|
+
export interface DocumentSearchResult {
|
|
291
|
+
query: string;
|
|
292
|
+
includeArchived: boolean;
|
|
293
|
+
total: number;
|
|
294
|
+
generatedAt: string;
|
|
295
|
+
results: Array<DocumentView & {
|
|
296
|
+
score: number;
|
|
297
|
+
excerpt: string;
|
|
298
|
+
}>;
|
|
299
|
+
}
|
|
300
|
+
export type DocumentMutation = {
|
|
301
|
+
action: 'create';
|
|
302
|
+
title: string;
|
|
303
|
+
description?: string;
|
|
304
|
+
content: string;
|
|
305
|
+
sourcePaths?: string[];
|
|
306
|
+
sessionIds?: string[];
|
|
307
|
+
} | {
|
|
308
|
+
action: 'update';
|
|
309
|
+
id: string;
|
|
310
|
+
title?: string;
|
|
311
|
+
description?: string;
|
|
312
|
+
content?: string;
|
|
313
|
+
sourcePaths?: string[];
|
|
314
|
+
sessionIds?: string[];
|
|
315
|
+
};
|
|
316
|
+
export interface DocumentMutationResult {
|
|
317
|
+
success: true;
|
|
318
|
+
action: 'created' | 'updated' | 'archived';
|
|
319
|
+
document: DocumentView;
|
|
320
|
+
snapshot: DocumentSnapshot;
|
|
321
|
+
maintenance?: {
|
|
322
|
+
runId: string;
|
|
323
|
+
provider: string;
|
|
324
|
+
summary: string;
|
|
325
|
+
memoryBodyIds: string[];
|
|
326
|
+
archivedDocumentIds: string[];
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
export type RuntimeMemoryTarget = 'memory' | 'user';
|
|
330
|
+
export type RuntimeMemoryImportance = 'critical' | 'normal' | 'low';
|
|
331
|
+
export type RuntimeMemoryAction = 'add' | 'replace' | 'remove';
|
|
332
|
+
export interface RuntimeMemoryEntry {
|
|
333
|
+
content: string;
|
|
334
|
+
created_at: string;
|
|
335
|
+
updated_at: string;
|
|
336
|
+
target: RuntimeMemoryTarget;
|
|
337
|
+
importance: RuntimeMemoryImportance;
|
|
338
|
+
}
|
|
339
|
+
export interface RuntimeMemoryUsage {
|
|
340
|
+
used: number;
|
|
341
|
+
limit: number;
|
|
342
|
+
}
|
|
343
|
+
export interface RuntimeMemoryTargetView extends RuntimeMemoryUsage {
|
|
344
|
+
target: RuntimeMemoryTarget;
|
|
345
|
+
entryCount: number;
|
|
346
|
+
markdownPath: string;
|
|
347
|
+
}
|
|
348
|
+
export interface RuntimeMemorySnapshot {
|
|
349
|
+
directory: string;
|
|
350
|
+
sourcePath: string;
|
|
351
|
+
revision: string;
|
|
352
|
+
generatedAt: string;
|
|
353
|
+
entries: RuntimeMemoryEntry[];
|
|
354
|
+
targets: Record<RuntimeMemoryTarget, RuntimeMemoryTargetView>;
|
|
355
|
+
}
|
|
356
|
+
export interface RuntimeMemoryCompactedEntry {
|
|
357
|
+
content: string;
|
|
358
|
+
importance: RuntimeMemoryImportance;
|
|
359
|
+
}
|
|
360
|
+
export interface RuntimeMemoryMutation {
|
|
361
|
+
action: RuntimeMemoryAction;
|
|
362
|
+
target: RuntimeMemoryTarget;
|
|
363
|
+
content?: string;
|
|
364
|
+
oldText?: string;
|
|
365
|
+
importance?: RuntimeMemoryImportance;
|
|
366
|
+
}
|
|
367
|
+
export type RuntimeMemoryMutationResult = {
|
|
368
|
+
success: true;
|
|
369
|
+
message: string;
|
|
370
|
+
target: RuntimeMemoryTarget;
|
|
371
|
+
entryCount: number;
|
|
372
|
+
usage: RuntimeMemoryUsage;
|
|
373
|
+
added?: string;
|
|
374
|
+
replaced?: {
|
|
375
|
+
from: string;
|
|
376
|
+
to: string;
|
|
377
|
+
};
|
|
378
|
+
removed?: string;
|
|
379
|
+
maintenance?: {
|
|
380
|
+
kind: 'local-compaction' | 'mnemon-archive';
|
|
381
|
+
runId: string;
|
|
382
|
+
provider: string;
|
|
383
|
+
summary: string;
|
|
384
|
+
memoryBodyIds: string[];
|
|
385
|
+
};
|
|
386
|
+
};
|
|
387
|
+
export interface TurnMemoryActivity {
|
|
388
|
+
turn: number;
|
|
389
|
+
count: number;
|
|
390
|
+
names: string[];
|
|
391
|
+
recalls: number;
|
|
392
|
+
writes: number;
|
|
393
|
+
documentSearches: number;
|
|
394
|
+
inspections: number;
|
|
395
|
+
failures: number;
|
|
396
|
+
}
|
|
397
|
+
export interface TurnMemoryActivitySnapshot {
|
|
398
|
+
cursor: number;
|
|
399
|
+
activities: TurnMemoryActivity[];
|
|
400
|
+
}
|
|
401
|
+
export interface AssistantMessageText {
|
|
402
|
+
messageId: string;
|
|
403
|
+
text: string;
|
|
404
|
+
}
|
|
405
|
+
export type StorageAreaKind = 'runtime' | 'memory-bodies' | 'documents' | 'state';
|
|
406
|
+
export type StorageAreaStatus = 'ready' | 'empty' | 'missing' | 'invalid';
|
|
407
|
+
export interface StorageAreaInventory {
|
|
408
|
+
kind: StorageAreaKind;
|
|
409
|
+
path: string;
|
|
410
|
+
status: StorageAreaStatus;
|
|
411
|
+
bytes: number;
|
|
412
|
+
itemCount: number;
|
|
413
|
+
details: Record<string, number | string | boolean>;
|
|
414
|
+
issue?: string;
|
|
415
|
+
}
|
|
416
|
+
export interface StorageScopeInventory {
|
|
417
|
+
kind: StorageScopeKind;
|
|
418
|
+
root?: string;
|
|
419
|
+
configured: boolean;
|
|
420
|
+
active: boolean;
|
|
421
|
+
available: boolean;
|
|
422
|
+
totalBytes: number;
|
|
423
|
+
areas: StorageAreaInventory[];
|
|
424
|
+
issue?: string;
|
|
425
|
+
}
|
|
426
|
+
export interface StorageScopeCatalog {
|
|
427
|
+
activeKind: StorageScopeKind;
|
|
428
|
+
activeRoot: string;
|
|
429
|
+
scopes: StorageScopeInventory[];
|
|
430
|
+
generatedAt: string;
|
|
431
|
+
}
|
|
432
|
+
export interface ReviewActivity {
|
|
433
|
+
totalUserTextLength: number;
|
|
434
|
+
turnCount: number;
|
|
435
|
+
toolCallCount: number;
|
|
436
|
+
uniqueToolCount: number;
|
|
437
|
+
}
|
|
438
|
+
export interface ReviewActivityScore extends ReviewActivity {
|
|
439
|
+
textLengthScore: number;
|
|
440
|
+
turnScore: number;
|
|
441
|
+
toolCallScore: number;
|
|
442
|
+
toolDiversityScore: number;
|
|
443
|
+
score: number;
|
|
444
|
+
threshold: number;
|
|
445
|
+
eligible: boolean;
|
|
446
|
+
}
|
|
447
|
+
export interface SubagentCounters {
|
|
448
|
+
recalls: number;
|
|
449
|
+
writes: number;
|
|
450
|
+
answers: number;
|
|
451
|
+
reviews: number;
|
|
452
|
+
migrations: number;
|
|
453
|
+
compactions: number;
|
|
454
|
+
documentArchives: number;
|
|
455
|
+
failures: number;
|
|
456
|
+
lastRunId?: string;
|
|
457
|
+
lastOperation?: 'recall' | 'write' | 'review' | 'migration' | 'compaction' | 'document-archive';
|
|
458
|
+
lastAt?: string;
|
|
459
|
+
}
|
|
460
|
+
export type LifecyclePhase = 'idle' | 'prime' | 'recall' | 'writeback' | 'review' | 'supervised' | 'error';
|
|
461
|
+
export interface LifecycleCounters {
|
|
462
|
+
primes: number;
|
|
463
|
+
recallCues: number;
|
|
464
|
+
writebackCues: number;
|
|
465
|
+
supervisedRequests: number;
|
|
466
|
+
failures: number;
|
|
467
|
+
}
|
|
468
|
+
export interface LifecycleAgentSnapshot {
|
|
469
|
+
sessionId: string;
|
|
470
|
+
status: 'idle' | 'running';
|
|
471
|
+
startSource: 'startup' | 'resume' | 'clear' | 'compact' | 'adopted';
|
|
472
|
+
primePending: boolean;
|
|
473
|
+
guidedTurns: number;
|
|
474
|
+
memoryToolCalls: number;
|
|
475
|
+
idleReviewPending: boolean;
|
|
476
|
+
reviewRunning: boolean;
|
|
477
|
+
reviewActivity: ReviewActivityScore;
|
|
478
|
+
lastPhase: LifecyclePhase;
|
|
479
|
+
lastReviewAt?: string;
|
|
480
|
+
lastReviewAction?: string;
|
|
481
|
+
lastReviewScore?: number;
|
|
482
|
+
lastReviewDocumentIds?: string[];
|
|
483
|
+
lastAt?: string;
|
|
484
|
+
lastError?: string;
|
|
485
|
+
}
|
|
486
|
+
export interface LifecycleSnapshot {
|
|
487
|
+
enabled: boolean;
|
|
488
|
+
recallMode: 'guided' | 'off';
|
|
489
|
+
writebackMode: 'guided' | 'off';
|
|
490
|
+
idleReviewMs: number;
|
|
491
|
+
activeAgents: number;
|
|
492
|
+
sessionAvailable: boolean;
|
|
493
|
+
counters: LifecycleCounters;
|
|
494
|
+
subagents: SubagentCounters;
|
|
495
|
+
current?: LifecycleAgentSnapshot;
|
|
496
|
+
}
|
|
497
|
+
export interface StatusView {
|
|
498
|
+
healthy: boolean;
|
|
499
|
+
error?: string;
|
|
500
|
+
version?: string;
|
|
501
|
+
dshMnemonVersion?: string;
|
|
502
|
+
cliPath: string;
|
|
503
|
+
commandFound: boolean;
|
|
504
|
+
dataDir: string;
|
|
505
|
+
/** Legacy comma-separated DSH-enabled Store list. */
|
|
506
|
+
store: string;
|
|
507
|
+
mnemonDefaultStore: string;
|
|
508
|
+
dshActiveStores: string[];
|
|
509
|
+
writeEnabled: boolean;
|
|
510
|
+
timeoutMs: number;
|
|
511
|
+
defaultRecallLimit: number;
|
|
512
|
+
memoryBodyDirectory: string;
|
|
513
|
+
memoryBodies: MemoryBodyView[];
|
|
514
|
+
lifecycle?: LifecycleSnapshot;
|
|
515
|
+
documents?: DocumentSnapshot;
|
|
516
|
+
storage?: StorageScopeCatalog;
|
|
517
|
+
workspaceContext?: {
|
|
518
|
+
mode: StorageScopeKind;
|
|
519
|
+
selectedRoot: string;
|
|
520
|
+
effectiveRoot: string;
|
|
521
|
+
aligned: boolean;
|
|
522
|
+
selectedWorkspace?: {
|
|
523
|
+
id: string;
|
|
524
|
+
title: string;
|
|
525
|
+
path: string;
|
|
526
|
+
};
|
|
527
|
+
effectiveWorkspace?: {
|
|
528
|
+
id: string;
|
|
529
|
+
title: string;
|
|
530
|
+
path: string;
|
|
531
|
+
};
|
|
532
|
+
};
|
|
533
|
+
stats?: MemoryBodyStats & {
|
|
534
|
+
dbPath?: string;
|
|
535
|
+
};
|
|
536
|
+
}
|
|
537
|
+
export type MnemonPackComponent = 'runtime' | 'documents' | 'memory-spaces';
|
|
538
|
+
export type MnemonPackScope = 'full' | MnemonPackComponent;
|
|
539
|
+
export type MnemonPackImportMode = 'merge' | 'replace';
|
|
540
|
+
export interface MnemonPackComponentSummary {
|
|
541
|
+
component: MnemonPackComponent;
|
|
542
|
+
files: number;
|
|
543
|
+
bytes: number;
|
|
544
|
+
items: number;
|
|
545
|
+
}
|
|
546
|
+
export interface MnemonPackManifest {
|
|
547
|
+
format: 'mnemonpack';
|
|
548
|
+
version: 1;
|
|
549
|
+
scope: MnemonPackScope;
|
|
550
|
+
exportedAt: string;
|
|
551
|
+
source: {
|
|
552
|
+
plugin: 'dsh-mnemon';
|
|
553
|
+
pluginVersion: string;
|
|
554
|
+
};
|
|
555
|
+
components: MnemonPackComponent[];
|
|
556
|
+
summary: MnemonPackComponentSummary[];
|
|
557
|
+
}
|
|
558
|
+
export interface MnemonPackExport {
|
|
559
|
+
fileName: string;
|
|
560
|
+
mimeType: 'application/zip';
|
|
561
|
+
bytes: number;
|
|
562
|
+
base64: string;
|
|
563
|
+
targetRoot: string;
|
|
564
|
+
manifest: MnemonPackManifest;
|
|
565
|
+
}
|
|
566
|
+
export interface MnemonPackPreview {
|
|
567
|
+
fileName?: string;
|
|
568
|
+
archiveBytes: number;
|
|
569
|
+
expandedBytes: number;
|
|
570
|
+
targetRoot: string;
|
|
571
|
+
targetScope: StorageScopeKind;
|
|
572
|
+
manifest: MnemonPackManifest;
|
|
573
|
+
occupied: Record<MnemonPackComponent, boolean>;
|
|
574
|
+
}
|
|
575
|
+
export interface MnemonPackImportResult {
|
|
576
|
+
imported: true;
|
|
577
|
+
mode: MnemonPackImportMode;
|
|
578
|
+
targetRoot: string;
|
|
579
|
+
components: MnemonPackComponent[];
|
|
580
|
+
summary: MnemonPackComponentSummary[];
|
|
581
|
+
}
|
|
582
|
+
export type VersionComponentId = 'mnemon' | 'dsh-mnemon';
|
|
583
|
+
export type VersionInstallMode = 'homebrew' | 'go' | 'npm' | 'link' | 'manual' | 'missing';
|
|
584
|
+
export interface VersionComponentStatus {
|
|
585
|
+
id: VersionComponentId;
|
|
586
|
+
name: string;
|
|
587
|
+
executablePath?: string;
|
|
588
|
+
installPath?: string;
|
|
589
|
+
installProfile?: string;
|
|
590
|
+
current?: string;
|
|
591
|
+
latest?: string;
|
|
592
|
+
outdated: boolean;
|
|
593
|
+
installMode: VersionInstallMode;
|
|
594
|
+
updateSupported: boolean;
|
|
595
|
+
updateHint: string;
|
|
596
|
+
checkError?: string;
|
|
597
|
+
}
|
|
598
|
+
export interface VersionStatus {
|
|
599
|
+
checkedAt: string;
|
|
600
|
+
components: VersionComponentStatus[];
|
|
601
|
+
}
|
|
602
|
+
export interface VersionUpdateResult {
|
|
603
|
+
component: VersionComponentId;
|
|
604
|
+
previousVersion?: string;
|
|
605
|
+
currentVersion?: string;
|
|
606
|
+
updated: boolean;
|
|
607
|
+
restartRequired: boolean;
|
|
608
|
+
output?: string;
|
|
609
|
+
}
|
|
@@ -1,33 +1,7 @@
|
|
|
1
1
|
import type { ResolvedConfig } from './config.ts';
|
|
2
2
|
import type { MnemonRunner } from './runner.ts';
|
|
3
|
-
|
|
4
|
-
export type StorageAreaKind
|
|
5
|
-
export type StorageAreaStatus = 'ready' | 'empty' | 'missing' | 'invalid';
|
|
6
|
-
export interface StorageAreaInventory {
|
|
7
|
-
kind: StorageAreaKind;
|
|
8
|
-
path: string;
|
|
9
|
-
status: StorageAreaStatus;
|
|
10
|
-
bytes: number;
|
|
11
|
-
itemCount: number;
|
|
12
|
-
details: Record<string, number | string | boolean>;
|
|
13
|
-
issue?: string;
|
|
14
|
-
}
|
|
15
|
-
export interface StorageScopeInventory {
|
|
16
|
-
kind: StorageScopeKind;
|
|
17
|
-
root?: string;
|
|
18
|
-
configured: boolean;
|
|
19
|
-
active: boolean;
|
|
20
|
-
available: boolean;
|
|
21
|
-
totalBytes: number;
|
|
22
|
-
areas: StorageAreaInventory[];
|
|
23
|
-
issue?: string;
|
|
24
|
-
}
|
|
25
|
-
export interface StorageScopeCatalog {
|
|
26
|
-
activeKind: StorageScopeKind;
|
|
27
|
-
activeRoot: string;
|
|
28
|
-
scopes: StorageScopeInventory[];
|
|
29
|
-
generatedAt: string;
|
|
30
|
-
}
|
|
3
|
+
import type { StorageScopeCatalog } from './shared/contracts.ts';
|
|
4
|
+
export type { StorageAreaInventory, StorageAreaKind, StorageAreaStatus, StorageScopeCatalog, StorageScopeInventory, StorageScopeKind } from './shared/contracts.ts';
|
|
31
5
|
/** Read-only catalog of the three storage domains. It never creates, moves, or repairs files. */
|
|
32
6
|
export declare class StorageScopeInspector {
|
|
33
7
|
private readonly runner;
|
|
@@ -36,4 +10,3 @@ export declare class StorageScopeInspector {
|
|
|
36
10
|
catalog(workspaceRoot?: string): StorageScopeCatalog;
|
|
37
11
|
}
|
|
38
12
|
export declare function validateCustomStorageRoot(value: string): string;
|
|
39
|
-
//# sourceMappingURL=storage-scope.d.ts.map
|
package/lib/types/subagent.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import type { HostAgent, HostSubagentsService } from './contracts.ts';
|
|
|
2
2
|
import { type DocumentManager, type DocumentMutation, type DocumentMutationResult, type DocumentView } from './documents.ts';
|
|
3
3
|
import { type RuntimeMemoryController, type RuntimeMemoryMutation, type RuntimeMemoryMutationResult } from './runtime-memory.ts';
|
|
4
4
|
import type { Insight, RememberRequest, SearchRequest } from './service.ts';
|
|
5
|
+
import type { SubagentCounters } from './shared/contracts.ts';
|
|
6
|
+
export type { SubagentCounters } from './shared/contracts.ts';
|
|
5
7
|
interface AgentRuntimeSource {
|
|
6
8
|
forAgent(agent: HostAgent): {
|
|
7
9
|
runtimeMemory: RuntimeMemoryController;
|
|
@@ -10,19 +12,6 @@ interface AgentRuntimeSource {
|
|
|
10
12
|
}
|
|
11
13
|
/** Rejects schema keywords that DSH structured-output tools cannot compile. */
|
|
12
14
|
export declare function assertDshOutputSchema(schema: unknown, path?: string): void;
|
|
13
|
-
export interface SubagentCounters {
|
|
14
|
-
recalls: number;
|
|
15
|
-
writes: number;
|
|
16
|
-
answers: number;
|
|
17
|
-
reviews: number;
|
|
18
|
-
migrations: number;
|
|
19
|
-
compactions: number;
|
|
20
|
-
documentArchives: number;
|
|
21
|
-
failures: number;
|
|
22
|
-
lastRunId?: string;
|
|
23
|
-
lastOperation?: 'recall' | 'write' | 'review' | 'migration' | 'compaction' | 'document-archive';
|
|
24
|
-
lastAt?: string;
|
|
25
|
-
}
|
|
26
15
|
export interface DelegatedRecallResult {
|
|
27
16
|
query: string;
|
|
28
17
|
mode: string;
|
|
@@ -102,5 +91,3 @@ export declare class MnemonSubagentCoordinator {
|
|
|
102
91
|
private runtimeMemoryFor;
|
|
103
92
|
private documentsFor;
|
|
104
93
|
}
|
|
105
|
-
export {};
|
|
106
|
-
//# sourceMappingURL=subagent.d.ts.map
|
package/lib/types/tools.d.ts
CHANGED
|
@@ -15,4 +15,3 @@ interface AgentRuntimeSource {
|
|
|
15
15
|
/** Root calls delegate to a bounded child; memory-worker calls reach the deterministic service. */
|
|
16
16
|
export declare function registerTools(ctx: HostContextShape, serviceOrSource: MnemonService | AgentRuntimeSource, coordinator: MnemonSubagentCoordinator, runtimeMemory?: RuntimeMemoryController, documents?: DocumentManager): void;
|
|
17
17
|
export {};
|
|
18
|
-
//# sourceMappingURL=tools.d.ts.map
|