dsh-mnemon 0.1.6 → 0.2.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.
- package/README.md +125 -104
- package/README.zh-CN.md +130 -109
- package/THIRD_PARTY_NOTICES.md +7 -0
- package/lib/client.js +3889 -830
- package/lib/index.js +4232 -289
- package/lib/types/client/GlobalLocationSetting.d.ts +19 -0
- package/lib/types/client/MnemonPackSection.d.ts +4 -1
- package/lib/types/client/MnemonSettingsCard.d.ts +4 -1
- package/lib/types/client/ProviderIcon.d.ts +8 -0
- package/lib/types/client/ProviderSettingsSection.d.ts +16 -0
- package/lib/types/client/api.d.ts +12 -11
- package/lib/types/client/locales.d.ts +548 -0
- package/lib/types/client/settings.d.ts +3 -1
- package/lib/types/contracts.d.ts +36 -2
- package/lib/types/lifecycle.d.ts +30 -3
- package/lib/types/memory-bodies.d.ts +25 -4
- package/lib/types/process.d.ts +4 -1
- package/lib/types/provider-placement.d.ts +26 -0
- package/lib/types/providers/byterover.d.ts +31 -0
- package/lib/types/providers/catalog.d.ts +23 -0
- package/lib/types/providers/hindsight.d.ts +19 -0
- package/lib/types/providers/holographic.d.ts +22 -0
- package/lib/types/providers/honcho.d.ts +18 -0
- package/lib/types/providers/http.d.ts +32 -0
- package/lib/types/providers/mem0.d.ts +17 -0
- package/lib/types/providers/openviking.d.ts +31 -0
- package/lib/types/providers/provider.d.ts +38 -0
- package/lib/types/providers/retaindb.d.ts +16 -0
- package/lib/types/providers/supermemory.d.ts +16 -0
- package/lib/types/rpc.d.ts +1 -1
- package/lib/types/service.d.ts +54 -6
- package/lib/types/shared/contracts.d.ts +261 -1
- package/lib/types/subagent.d.ts +10 -2
- package/package.json +17 -4
package/lib/types/service.d.ts
CHANGED
|
@@ -2,24 +2,50 @@ import type { JsonValue } from './contracts.ts';
|
|
|
2
2
|
import type { ResolvedConfig } from './config.ts';
|
|
3
3
|
import { MemoryBodyRegistry, type CreateMemoryBodyRequest, type MemoryBody, type UpdateMemoryBodyRequest } from './memory-bodies.ts';
|
|
4
4
|
import type { MnemonRunner } from './runner.ts';
|
|
5
|
-
import { type
|
|
5
|
+
import { type LlmMemoryPlacementSelection, type PreparedMemoryPlacement } from './provider-placement.ts';
|
|
6
|
+
import { type EdgeType, type EntityView, type Insight, type MemoryBodyCatalog, type MemoryBodyMetadataUpdate, type MemoryBodyView, type MemoryGraphSnapshot, type MemoryListRequest, type MemoryListView, type MemoryPlacementDecision, type MemoryReadSource, type RememberRequest, type SearchRequest, type StatusView } from './shared/contracts.ts';
|
|
6
7
|
export { CATEGORIES, EDGE_TYPES, INTENTS, SOURCES } from './shared/contracts.ts';
|
|
7
|
-
export type { Category, EdgeType, EntityView, Insight, Intent, MemoryBodyCatalog, MemoryBodyStats, MemoryBodyView, MemoryGraphEdge, MemoryGraphNode, MemoryGraphSnapshot, MemoryListRequest, MemoryListView, RememberRequest, SearchRequest, Source, StatusView, } from './shared/contracts.ts';
|
|
8
|
+
export type { Category, EdgeType, EntityView, Insight, Intent, MemoryBodyCatalog, MemoryBodyStats, MemoryBodyView, MemoryGraphEdge, MemoryGraphNode, MemoryGraphSnapshot, MemoryListRequest, MemoryListView, MemoryReadSource, RememberRequest, SearchRequest, Source, StatusView, } from './shared/contracts.ts';
|
|
9
|
+
export interface MemoryBodyMetadataSample {
|
|
10
|
+
memoryBodyId: string;
|
|
11
|
+
name: string;
|
|
12
|
+
description: string;
|
|
13
|
+
providerId: MemoryBody['provider']['id'];
|
|
14
|
+
providerLabel: string;
|
|
15
|
+
method: 'native-basic' | 'browse' | 'search';
|
|
16
|
+
evidence: Array<Pick<Insight, 'content' | 'category' | 'entities'>>;
|
|
17
|
+
}
|
|
8
18
|
/** Parse the official Mnemon vis.js export without executing its HTML or loading its CDN script. */
|
|
9
19
|
export declare function parseMemoryGraph(html: string, now?: Date): MemoryGraphSnapshot;
|
|
10
20
|
export declare class MnemonService {
|
|
11
21
|
readonly runner: MnemonRunner;
|
|
12
22
|
readonly config: ResolvedConfig;
|
|
13
23
|
readonly memoryBodies: MemoryBodyRegistry;
|
|
24
|
+
private readonly providers;
|
|
25
|
+
private bodiesInFlight;
|
|
14
26
|
constructor(runner: MnemonRunner, config: ResolvedConfig, memoryBodies?: MemoryBodyRegistry);
|
|
15
27
|
bodies(signal?: AbortSignal): Promise<MemoryBodyCatalog>;
|
|
28
|
+
/** Coalesce simultaneous Status/Memory-page probes without caching mutations. */
|
|
29
|
+
private collectBodies;
|
|
30
|
+
/** Return the control-plane directory without waiting for provider I/O. */
|
|
31
|
+
bodyDirectory(): MemoryBodyCatalog;
|
|
32
|
+
/** Return a usable system snapshot without waiting for any Provider I/O. */
|
|
33
|
+
statusSummary(): StatusView;
|
|
16
34
|
status(signal?: AbortSignal): Promise<StatusView>;
|
|
35
|
+
reconnectBody(id: string, signal?: AbortSignal): Promise<MemoryBodyView>;
|
|
17
36
|
search(request: SearchRequest, signal?: AbortSignal): Promise<{
|
|
18
37
|
query: string;
|
|
19
38
|
mode: string;
|
|
20
39
|
results: Insight[];
|
|
21
40
|
hint?: string;
|
|
41
|
+
sources: MemoryReadSource[];
|
|
22
42
|
}>;
|
|
43
|
+
/**
|
|
44
|
+
* Read a deliberately small metadata sample through the cheapest useful path
|
|
45
|
+
* exposed by the owning Provider. This avoids federated ranking, graph
|
|
46
|
+
* expansion, and large browse projections before an LLM metadata pass.
|
|
47
|
+
*/
|
|
48
|
+
metadataSample(memoryBodyId: string, signal?: AbortSignal): Promise<MemoryBodyMetadataSample>;
|
|
23
49
|
graph(signal?: AbortSignal, memoryBodyIds?: string[]): Promise<MemoryGraphSnapshot>;
|
|
24
50
|
list(request?: MemoryListRequest, signal?: AbortSignal): Promise<MemoryListView>;
|
|
25
51
|
entities(entity?: string, limit?: number, signal?: AbortSignal): Promise<EntityView>;
|
|
@@ -27,14 +53,36 @@ export declare class MnemonService {
|
|
|
27
53
|
related(id: string, depth?: number, edge?: EdgeType, signal?: AbortSignal, memoryBodyId?: string): Promise<Insight[]>;
|
|
28
54
|
link(sourceId: string, targetId: string, type?: EdgeType, weight?: number, reason?: string, signal?: AbortSignal, memoryBodyId?: string): Promise<JsonValue>;
|
|
29
55
|
forget(id: string, signal?: AbortSignal, memoryBodyId?: string): Promise<JsonValue>;
|
|
30
|
-
|
|
56
|
+
prepareBodyPlacement(request: CreateMemoryBodyRequest): PreparedMemoryPlacement;
|
|
57
|
+
createBody(request: CreateMemoryBodyRequest, signal?: AbortSignal, placement?: MemoryPlacementDecision): Promise<MemoryBody>;
|
|
58
|
+
/**
|
|
59
|
+
* Create a Memory Space from the configured distillation policy. The model
|
|
60
|
+
* may choose only among candidates already filtered by the host; manual mode
|
|
61
|
+
* ignores model preference and always uses the configured fixed provider.
|
|
62
|
+
*/
|
|
63
|
+
createBodyForPersistence(body: {
|
|
64
|
+
name: string;
|
|
65
|
+
description: string;
|
|
66
|
+
}, selection: LlmMemoryPlacementSelection | undefined, signal?: AbortSignal, delegation?: {
|
|
67
|
+
runId: string;
|
|
68
|
+
provider: string;
|
|
69
|
+
}): Promise<MemoryBody>;
|
|
70
|
+
updateProviderService(providerId: MemoryBody['provider']['id'], settings: Record<string, string | number | boolean>, clearSecrets?: readonly string[], enabled?: boolean, signal?: AbortSignal): Promise<import("./shared/contracts.ts").MemoryProviderServiceView>;
|
|
31
71
|
updateBody(id: string, request: UpdateMemoryBodyRequest): MemoryBody;
|
|
72
|
+
updateBodyMetadata(updates: readonly MemoryBodyMetadataUpdate[]): MemoryBody[];
|
|
32
73
|
deleteBody(id: string, signal?: AbortSignal): Promise<MemoryBody>;
|
|
33
74
|
mergeBodies(targetBodyId: string, sourceBodyIds: string[], deactivateSources?: boolean, signal?: AbortSignal): Promise<JsonValue>;
|
|
34
|
-
private
|
|
75
|
+
private nativeBodyStatus;
|
|
35
76
|
private parseStats;
|
|
36
|
-
private
|
|
37
|
-
private
|
|
77
|
+
private nativeGraph;
|
|
78
|
+
private allNativeInsights;
|
|
79
|
+
private nativeMetadataSample;
|
|
80
|
+
private nativeSearch;
|
|
81
|
+
private nativeRemember;
|
|
82
|
+
private nativeRelated;
|
|
83
|
+
private nativeLink;
|
|
84
|
+
private nativeForget;
|
|
85
|
+
private providerFor;
|
|
38
86
|
private readBodies;
|
|
39
87
|
private readBody;
|
|
40
88
|
private writeBody;
|
|
@@ -89,6 +89,48 @@ export interface Config {
|
|
|
89
89
|
turnBar?: boolean;
|
|
90
90
|
saveAction?: boolean;
|
|
91
91
|
};
|
|
92
|
+
/** Provider policy used when an Agent must create a new Memory Space while distilling memory. */
|
|
93
|
+
persistenceStrategy?: MemoryPersistenceStrategy;
|
|
94
|
+
/** Model route used by clean, session-independent maintenance Agents. */
|
|
95
|
+
taskAgentModel?: TaskAgentModelConfig;
|
|
96
|
+
}
|
|
97
|
+
export interface TaskAgentModelConfig {
|
|
98
|
+
mode?: 'inherit' | 'fixed';
|
|
99
|
+
provider?: string;
|
|
100
|
+
model?: string;
|
|
101
|
+
}
|
|
102
|
+
export interface ResolvedTaskAgentModelConfig {
|
|
103
|
+
mode: 'inherit' | 'fixed';
|
|
104
|
+
provider?: string;
|
|
105
|
+
model?: string;
|
|
106
|
+
}
|
|
107
|
+
export interface TaskAgentModelCatalogModel {
|
|
108
|
+
id: string;
|
|
109
|
+
name: string;
|
|
110
|
+
description?: string;
|
|
111
|
+
}
|
|
112
|
+
export interface TaskAgentModelCatalogGroup {
|
|
113
|
+
id: string;
|
|
114
|
+
name: string;
|
|
115
|
+
models: TaskAgentModelCatalogModel[];
|
|
116
|
+
}
|
|
117
|
+
export interface TaskAgentModelCatalogFailure {
|
|
118
|
+
id: string;
|
|
119
|
+
name: string;
|
|
120
|
+
message: string;
|
|
121
|
+
}
|
|
122
|
+
export interface TaskAgentModelCatalog {
|
|
123
|
+
effective?: {
|
|
124
|
+
provider: string;
|
|
125
|
+
model: string;
|
|
126
|
+
source: 'fixed' | 'dsh-default' | 'active-agent';
|
|
127
|
+
};
|
|
128
|
+
defaultSelection?: {
|
|
129
|
+
provider: string;
|
|
130
|
+
model: string;
|
|
131
|
+
};
|
|
132
|
+
groups: TaskAgentModelCatalogGroup[];
|
|
133
|
+
failures: TaskAgentModelCatalogFailure[];
|
|
92
134
|
}
|
|
93
135
|
export interface InteractionConfig {
|
|
94
136
|
turnBar?: boolean;
|
|
@@ -114,17 +156,167 @@ export interface ResolvedConfig {
|
|
|
114
156
|
turnBar: boolean;
|
|
115
157
|
saveAction: boolean;
|
|
116
158
|
};
|
|
159
|
+
persistenceStrategy: ResolvedMemoryPersistenceStrategy;
|
|
160
|
+
taskAgentModel: ResolvedTaskAgentModelConfig;
|
|
117
161
|
}
|
|
118
162
|
export interface ResolvedInteractionConfig {
|
|
119
163
|
turnBar: boolean;
|
|
120
164
|
saveAction: boolean;
|
|
121
165
|
}
|
|
166
|
+
export type MemoryProviderId = 'mnemon-native' | 'openviking' | 'honcho' | 'mem0' | 'hindsight' | 'holographic' | 'retaindb' | 'byterover' | 'supermemory';
|
|
167
|
+
export type MemoryProviderConnectionValue = string | number | boolean;
|
|
168
|
+
export type MemoryProviderConnection = Record<string, MemoryProviderConnectionValue>;
|
|
169
|
+
export interface MemoryProviderConfigField {
|
|
170
|
+
key: string;
|
|
171
|
+
label: string;
|
|
172
|
+
/** Service fields are configured once in Settings; memory fields belong to each Memory Space. */
|
|
173
|
+
scope: 'service' | 'memory';
|
|
174
|
+
/** A reusable local data location presented with the same default/custom scope UI as Mnemon Native. */
|
|
175
|
+
role?: 'global-location';
|
|
176
|
+
input: 'text' | 'url' | 'secret' | 'number' | 'boolean' | 'select' | 'path';
|
|
177
|
+
required: boolean;
|
|
178
|
+
defaultValue?: MemoryProviderConnectionValue;
|
|
179
|
+
placeholder?: string;
|
|
180
|
+
help?: string;
|
|
181
|
+
options?: Array<{
|
|
182
|
+
value: string;
|
|
183
|
+
label: string;
|
|
184
|
+
}>;
|
|
185
|
+
}
|
|
186
|
+
export type MemoryPlacementCapability = 'graph' | 'entities' | 'related' | 'exact-write' | 'link' | 'forget';
|
|
187
|
+
export type MemoryPlacementPreference = 'balanced' | 'local-first' | 'shared-first';
|
|
188
|
+
export interface MemoryPlacementRules {
|
|
189
|
+
allowedProviderIds?: MemoryProviderId[];
|
|
190
|
+
dataBoundary?: 'allow-remote' | 'local-only';
|
|
191
|
+
requiredCapabilities?: MemoryPlacementCapability[];
|
|
192
|
+
preference?: MemoryPlacementPreference;
|
|
193
|
+
}
|
|
194
|
+
/** Persistent policy for provider selection during Agent-supervised memory distillation. */
|
|
195
|
+
export interface MemoryPersistenceStrategy {
|
|
196
|
+
mode?: 'manual' | 'automatic';
|
|
197
|
+
/** Fixed provider in manual mode. */
|
|
198
|
+
providerId?: MemoryProviderId;
|
|
199
|
+
/** User-authored guidance used only after hard rules have filtered automatic candidates. */
|
|
200
|
+
prompt?: string;
|
|
201
|
+
rules?: MemoryPlacementRules;
|
|
202
|
+
/** Memory-level connection values for providers that may be selected by the policy. */
|
|
203
|
+
providerConnections?: Partial<Record<MemoryProviderId, MemoryProviderConnection>>;
|
|
204
|
+
}
|
|
205
|
+
export interface ResolvedMemoryPersistenceStrategy {
|
|
206
|
+
mode: 'manual' | 'automatic';
|
|
207
|
+
providerId: MemoryProviderId;
|
|
208
|
+
prompt: string;
|
|
209
|
+
rules: {
|
|
210
|
+
allowedProviderIds: MemoryProviderId[];
|
|
211
|
+
dataBoundary: 'allow-remote' | 'local-only';
|
|
212
|
+
requiredCapabilities: MemoryPlacementCapability[];
|
|
213
|
+
preference: MemoryPlacementPreference;
|
|
214
|
+
};
|
|
215
|
+
providerConnections: Partial<Record<MemoryProviderId, MemoryProviderConnection>>;
|
|
216
|
+
}
|
|
217
|
+
export interface AutomaticMemoryPlacementRequest {
|
|
218
|
+
mode: 'automatic';
|
|
219
|
+
/** User-authored routing guidance. Hard rules above always take precedence. */
|
|
220
|
+
prompt?: string;
|
|
221
|
+
rules?: MemoryPlacementRules;
|
|
222
|
+
}
|
|
223
|
+
export interface MemoryPlacementDecision {
|
|
224
|
+
mode: 'automatic';
|
|
225
|
+
providerId: MemoryProviderId;
|
|
226
|
+
decidedBy: 'rules' | 'llm';
|
|
227
|
+
reason: string;
|
|
228
|
+
confidence: 'high' | 'medium' | 'low';
|
|
229
|
+
candidateProviderIds: MemoryProviderId[];
|
|
230
|
+
appliedRules: string[];
|
|
231
|
+
decidedAt: string;
|
|
232
|
+
runId?: string;
|
|
233
|
+
subagentProvider?: string;
|
|
234
|
+
}
|
|
235
|
+
export interface MemoryProviderCapabilities {
|
|
236
|
+
search: boolean;
|
|
237
|
+
browse: boolean;
|
|
238
|
+
graph: boolean;
|
|
239
|
+
entities: boolean;
|
|
240
|
+
related: boolean;
|
|
241
|
+
remember: boolean;
|
|
242
|
+
link: boolean;
|
|
243
|
+
forget: boolean;
|
|
244
|
+
writeMode: 'exact' | 'async-extracting';
|
|
245
|
+
deletionMode: 'soft' | 'hard' | 'unsupported';
|
|
246
|
+
}
|
|
247
|
+
export interface MemoryProviderDescriptor {
|
|
248
|
+
id: MemoryProviderId;
|
|
249
|
+
label: string;
|
|
250
|
+
kind: 'local' | 'remote';
|
|
251
|
+
/** How the provider data scope reacts when DSH switches workspaces. */
|
|
252
|
+
workspaceBinding: 'automatic' | 'optional-override' | 'provider-global';
|
|
253
|
+
summary: string;
|
|
254
|
+
origin: 'native' | 'third-party';
|
|
255
|
+
capabilities: MemoryProviderCapabilities;
|
|
256
|
+
fields: MemoryProviderConfigField[];
|
|
257
|
+
/** Runtime projection: whether this scope has a usable saved service configuration. */
|
|
258
|
+
serviceConfigured?: boolean;
|
|
259
|
+
}
|
|
260
|
+
export interface MemoryProviderServiceView {
|
|
261
|
+
providerId: MemoryProviderId;
|
|
262
|
+
enabled: boolean;
|
|
263
|
+
configured: boolean;
|
|
264
|
+
settings: MemoryProviderConnection;
|
|
265
|
+
configuredSecrets: string[];
|
|
266
|
+
/** Present only on the settings RPC so its password inputs can use native reveal/hide behavior. */
|
|
267
|
+
secretValues?: MemoryProviderConnection;
|
|
268
|
+
}
|
|
269
|
+
export interface MemoryProviderServiceCatalog {
|
|
270
|
+
providers: MemoryProviderDescriptor[];
|
|
271
|
+
items: MemoryProviderServiceView[];
|
|
272
|
+
generatedAt: string;
|
|
273
|
+
}
|
|
274
|
+
export interface UpdateMemoryProviderServiceRequest {
|
|
275
|
+
providerId: MemoryProviderId;
|
|
276
|
+
settings: MemoryProviderConnection;
|
|
277
|
+
enabled?: boolean;
|
|
278
|
+
clearSecrets?: string[];
|
|
279
|
+
}
|
|
280
|
+
export interface MemoryProviderRuntimeStatus {
|
|
281
|
+
providerId: MemoryProviderId;
|
|
282
|
+
label: string;
|
|
283
|
+
enabled: boolean;
|
|
284
|
+
configured: boolean;
|
|
285
|
+
status: 'disabled' | 'idle' | 'healthy' | 'unhealthy';
|
|
286
|
+
memoryBodyCount: number;
|
|
287
|
+
activeMemoryBodyCount: number;
|
|
288
|
+
error?: string;
|
|
289
|
+
}
|
|
290
|
+
export interface MemoryBodyProvider {
|
|
291
|
+
id: MemoryProviderId;
|
|
292
|
+
label: string;
|
|
293
|
+
kind: 'local' | 'remote';
|
|
294
|
+
location: string;
|
|
295
|
+
targetUri?: string;
|
|
296
|
+
account?: string;
|
|
297
|
+
user?: string;
|
|
298
|
+
actorPeerId?: string;
|
|
299
|
+
apiKeyConfigured: boolean;
|
|
300
|
+
settings: MemoryProviderConnection;
|
|
301
|
+
configuredSecrets: string[];
|
|
302
|
+
capabilities: MemoryProviderCapabilities;
|
|
303
|
+
}
|
|
304
|
+
export interface OpenVikingBodyConnection {
|
|
305
|
+
endpoint: string;
|
|
306
|
+
targetUri: string;
|
|
307
|
+
apiKey?: string;
|
|
308
|
+
account?: string;
|
|
309
|
+
user?: string;
|
|
310
|
+
actorPeerId?: string;
|
|
311
|
+
}
|
|
122
312
|
export interface MemoryBody {
|
|
123
313
|
id: string;
|
|
124
314
|
name: string;
|
|
125
315
|
description: string;
|
|
126
316
|
active: boolean;
|
|
127
317
|
dbPath: string;
|
|
318
|
+
provider: MemoryBodyProvider;
|
|
319
|
+
placement?: MemoryPlacementDecision;
|
|
128
320
|
createdAt: string;
|
|
129
321
|
updatedAt: string;
|
|
130
322
|
}
|
|
@@ -132,11 +324,34 @@ export interface CreateMemoryBodyRequest {
|
|
|
132
324
|
name: string;
|
|
133
325
|
description: string;
|
|
134
326
|
active?: boolean;
|
|
327
|
+
providerId?: MemoryProviderId;
|
|
328
|
+
connection?: MemoryProviderConnection;
|
|
329
|
+
/** Candidate-specific settings used only while resolving automatic placement. */
|
|
330
|
+
providerConnections?: Partial<Record<MemoryProviderId, MemoryProviderConnection>>;
|
|
331
|
+
openViking?: OpenVikingBodyConnection;
|
|
332
|
+
placement?: AutomaticMemoryPlacementRequest;
|
|
135
333
|
}
|
|
136
334
|
export interface UpdateMemoryBodyRequest {
|
|
137
335
|
name?: string;
|
|
138
336
|
description?: string;
|
|
139
337
|
active?: boolean;
|
|
338
|
+
connection?: MemoryProviderConnection;
|
|
339
|
+
clearSecrets?: string[];
|
|
340
|
+
openViking?: Partial<OpenVikingBodyConnection> & {
|
|
341
|
+
clearApiKey?: boolean;
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
export interface MemoryBodyMetadataUpdate {
|
|
345
|
+
memoryBodyId: string;
|
|
346
|
+
title: string;
|
|
347
|
+
description: string;
|
|
348
|
+
}
|
|
349
|
+
export interface MemoryBodyMetadataMaintenanceResult {
|
|
350
|
+
delegated: true;
|
|
351
|
+
runId: string;
|
|
352
|
+
provider: string;
|
|
353
|
+
summary: string;
|
|
354
|
+
updates: MemoryBodyMetadataUpdate[];
|
|
140
355
|
}
|
|
141
356
|
export type Category = 'preference' | 'decision' | 'fact' | 'insight' | 'context' | 'general';
|
|
142
357
|
export declare const CATEGORIES: readonly ["preference", "decision", "fact", "insight", "context", "general"];
|
|
@@ -155,6 +370,8 @@ export interface Insight {
|
|
|
155
370
|
entities?: string[];
|
|
156
371
|
source?: string;
|
|
157
372
|
score?: number;
|
|
373
|
+
/** Comparable rank score only when results were fused across providers. */
|
|
374
|
+
federatedScore?: number;
|
|
158
375
|
confidence?: string;
|
|
159
376
|
intent?: string;
|
|
160
377
|
matchedVia?: string;
|
|
@@ -163,6 +380,10 @@ export interface Insight {
|
|
|
163
380
|
edgeType?: string;
|
|
164
381
|
memoryBodyId?: string;
|
|
165
382
|
memoryBodyName?: string;
|
|
383
|
+
memoryProviderId?: MemoryProviderId;
|
|
384
|
+
/** Owning Provider capabilities at read time; safe to expose to clients. */
|
|
385
|
+
memoryCapabilities?: MemoryProviderCapabilities;
|
|
386
|
+
externalUri?: string;
|
|
166
387
|
}
|
|
167
388
|
export interface SearchRequest {
|
|
168
389
|
query: string;
|
|
@@ -197,12 +418,19 @@ export interface MemoryBodyStats {
|
|
|
197
418
|
export interface MemoryBodyView extends MemoryBody {
|
|
198
419
|
/** True when Mnemon's persisted active-file selection points to this Store. */
|
|
199
420
|
mnemonDefault: boolean;
|
|
421
|
+
/** False when an external provider is disabled while its Memory Space registration remains preserved. */
|
|
422
|
+
providerEnabled?: boolean;
|
|
200
423
|
healthy: boolean;
|
|
424
|
+
/** A fast directory response is visible while provider health resolves independently. */
|
|
425
|
+
statusLoading?: boolean;
|
|
201
426
|
error?: string;
|
|
202
427
|
stats?: MemoryBodyStats;
|
|
203
428
|
}
|
|
204
429
|
export interface MemoryBodyCatalog {
|
|
205
430
|
items: MemoryBodyView[];
|
|
431
|
+
providers: MemoryProviderDescriptor[];
|
|
432
|
+
/** Sanitized policy exposed to memory workers; provider connection values are never included. */
|
|
433
|
+
persistenceStrategy?: Omit<ResolvedMemoryPersistenceStrategy, 'providerConnections'>;
|
|
206
434
|
total: number;
|
|
207
435
|
activeCount: number;
|
|
208
436
|
directory: string;
|
|
@@ -228,6 +456,29 @@ export interface MemoryGraphSnapshot {
|
|
|
228
456
|
edges: MemoryGraphEdge[];
|
|
229
457
|
generatedAt: string;
|
|
230
458
|
memoryBodies?: Array<Pick<MemoryBody, 'id' | 'name' | 'active'>>;
|
|
459
|
+
/** Per-space observation state for capability-aware overview rendering. */
|
|
460
|
+
sources?: MemoryReadSource[];
|
|
461
|
+
}
|
|
462
|
+
export type MemoryReadMode = 'search' | 'graph' | 'projection' | 'enumerable' | 'query-only' | 'entities' | 'unsupported';
|
|
463
|
+
export type MemoryReadStatus = 'ready' | 'empty' | 'query-required' | 'unsupported' | 'unavailable';
|
|
464
|
+
/**
|
|
465
|
+
* One provider-backed Memory Space participating in a read surface.
|
|
466
|
+
*
|
|
467
|
+
* The mode describes what the provider can truthfully expose; status describes
|
|
468
|
+
* the result of this particular read. Keeping those dimensions separate lets
|
|
469
|
+
* the UI distinguish an empty graph from a flat projection, a query-only
|
|
470
|
+
* engine, and an unavailable connection.
|
|
471
|
+
*/
|
|
472
|
+
export interface MemoryReadSource {
|
|
473
|
+
memoryBodyId: string;
|
|
474
|
+
memoryBodyName: string;
|
|
475
|
+
providerId: MemoryProviderId;
|
|
476
|
+
providerLabel: string;
|
|
477
|
+
mode: MemoryReadMode;
|
|
478
|
+
status: MemoryReadStatus;
|
|
479
|
+
itemCount: number;
|
|
480
|
+
edgeCount?: number;
|
|
481
|
+
hint?: string;
|
|
231
482
|
}
|
|
232
483
|
export interface MemoryListRequest {
|
|
233
484
|
query?: string;
|
|
@@ -239,6 +490,8 @@ export interface MemoryListView {
|
|
|
239
490
|
items: MemoryGraphNode[];
|
|
240
491
|
total: number;
|
|
241
492
|
generatedAt: string;
|
|
493
|
+
/** Omitted only when talking to a pre-provider-aware Host. */
|
|
494
|
+
sources?: MemoryReadSource[];
|
|
242
495
|
}
|
|
243
496
|
export interface EntityView {
|
|
244
497
|
items: Array<{
|
|
@@ -247,6 +500,8 @@ export interface EntityView {
|
|
|
247
500
|
}>;
|
|
248
501
|
insights: Insight[];
|
|
249
502
|
selected?: string;
|
|
503
|
+
/** Omitted only when talking to a pre-provider-aware Host. */
|
|
504
|
+
sources?: MemoryReadSource[];
|
|
250
505
|
}
|
|
251
506
|
export type DocumentStatus = 'active' | 'archived';
|
|
252
507
|
export interface DocumentRecord {
|
|
@@ -449,12 +704,14 @@ export interface SubagentCounters {
|
|
|
449
704
|
writes: number;
|
|
450
705
|
answers: number;
|
|
451
706
|
reviews: number;
|
|
707
|
+
placements: number;
|
|
452
708
|
migrations: number;
|
|
453
709
|
compactions: number;
|
|
454
710
|
documentArchives: number;
|
|
711
|
+
metadataMaintenances: number;
|
|
455
712
|
failures: number;
|
|
456
713
|
lastRunId?: string;
|
|
457
|
-
lastOperation?: 'recall' | 'write' | 'review' | 'migration' | 'compaction' | 'document-archive';
|
|
714
|
+
lastOperation?: 'recall' | 'write' | 'review' | 'placement' | 'migration' | 'compaction' | 'document-archive' | 'metadata-maintenance';
|
|
458
715
|
lastAt?: string;
|
|
459
716
|
}
|
|
460
717
|
export type LifecyclePhase = 'idle' | 'prime' | 'recall' | 'writeback' | 'review' | 'supervised' | 'error';
|
|
@@ -490,6 +747,8 @@ export interface LifecycleSnapshot {
|
|
|
490
747
|
idleReviewMs: number;
|
|
491
748
|
activeAgents: number;
|
|
492
749
|
sessionAvailable: boolean;
|
|
750
|
+
/** A session-independent task Agent can be created for WebUI maintenance. */
|
|
751
|
+
taskAgentAvailable: boolean;
|
|
493
752
|
counters: LifecycleCounters;
|
|
494
753
|
subagents: SubagentCounters;
|
|
495
754
|
current?: LifecycleAgentSnapshot;
|
|
@@ -511,6 +770,7 @@ export interface StatusView {
|
|
|
511
770
|
defaultRecallLimit: number;
|
|
512
771
|
memoryBodyDirectory: string;
|
|
513
772
|
memoryBodies: MemoryBodyView[];
|
|
773
|
+
providerServices?: MemoryProviderRuntimeStatus[];
|
|
514
774
|
lifecycle?: LifecycleSnapshot;
|
|
515
775
|
documents?: DocumentSnapshot;
|
|
516
776
|
storage?: StorageScopeCatalog;
|
package/lib/types/subagent.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
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
|
-
import type { Insight, RememberRequest, SearchRequest } from './service.ts';
|
|
5
|
-
import type
|
|
4
|
+
import type { Insight, MnemonService, RememberRequest, SearchRequest } from './service.ts';
|
|
5
|
+
import { type PreparedMemoryPlacement } from './provider-placement.ts';
|
|
6
|
+
import type { MemoryBodyMetadataMaintenanceResult, MemoryPlacementDecision, SubagentCounters } from './shared/contracts.ts';
|
|
6
7
|
export type { SubagentCounters } from './shared/contracts.ts';
|
|
7
8
|
interface AgentRuntimeSource {
|
|
8
9
|
forAgent(agent: HostAgent): {
|
|
10
|
+
service: MnemonService;
|
|
9
11
|
runtimeMemory: RuntimeMemoryController;
|
|
10
12
|
documents: DocumentManager;
|
|
11
13
|
};
|
|
@@ -74,6 +76,11 @@ export declare class MnemonSubagentCoordinator {
|
|
|
74
76
|
documentSearch(parent: HostAgent, query: string, includeArchived?: boolean, limit?: number): Promise<import("./documents.ts").DocumentSearchResult>;
|
|
75
77
|
recall(parent: HostAgent, request: SearchRequest, signal: AbortSignal): Promise<DelegatedRecallResult>;
|
|
76
78
|
related(parent: HostAgent, id: string, memoryBodyId: string | undefined, signal: AbortSignal): Promise<DelegatedRecallResult>;
|
|
79
|
+
placeProvider(parent: HostAgent, body: {
|
|
80
|
+
name: string;
|
|
81
|
+
description: string;
|
|
82
|
+
}, prepared: PreparedMemoryPlacement, signal: AbortSignal): Promise<MemoryPlacementDecision>;
|
|
83
|
+
maintainMetadata(parent: HostAgent, memoryBodyIds: readonly string[], signal: AbortSignal): Promise<MemoryBodyMetadataMaintenanceResult>;
|
|
77
84
|
remember(parent: HostAgent, request: RememberRequest, signal: AbortSignal): Promise<DelegatedWriteResult>;
|
|
78
85
|
runtime(parent: HostAgent, request: RuntimeMemoryMutation, signal: AbortSignal): Promise<CoordinatedRuntimeMemoryResult>;
|
|
79
86
|
document(parent: HostAgent, request: DocumentMutation, signal: AbortSignal): Promise<CoordinatedDocumentResult>;
|
|
@@ -89,5 +96,6 @@ export declare class MnemonSubagentCoordinator {
|
|
|
89
96
|
private delegate;
|
|
90
97
|
private provider;
|
|
91
98
|
private runtimeMemoryFor;
|
|
99
|
+
private serviceFor;
|
|
92
100
|
private documentsFor;
|
|
93
101
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mnemon",
|
|
3
|
-
"version": "0.1
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "Three-tier memory system for DeepSeek Harness with nine pluggable providers, smart routing, independent task Agents, WebUI, and headless tools.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek-harness",
|
|
7
7
|
"deepseek-harness-plugin",
|
|
8
8
|
"dsh",
|
|
9
9
|
"dsh-plugin",
|
|
10
10
|
"mnemon",
|
|
11
|
+
"openviking",
|
|
12
|
+
"honcho",
|
|
13
|
+
"mem0",
|
|
14
|
+
"hindsight",
|
|
15
|
+
"holographic-memory",
|
|
16
|
+
"retaindb",
|
|
17
|
+
"byterover",
|
|
18
|
+
"supermemory",
|
|
19
|
+
"memory-provider",
|
|
11
20
|
"memory-system",
|
|
12
21
|
"memory-plugin",
|
|
13
22
|
"agent-memory",
|
|
@@ -25,7 +34,7 @@
|
|
|
25
34
|
"semantic-recall",
|
|
26
35
|
"memory-space",
|
|
27
36
|
"workspace-memory",
|
|
28
|
-
"
|
|
37
|
+
"task-agent",
|
|
29
38
|
"knowledge-graph",
|
|
30
39
|
"ai-agent",
|
|
31
40
|
"llm-agent",
|
|
@@ -35,6 +44,7 @@
|
|
|
35
44
|
"typescript",
|
|
36
45
|
"cordis",
|
|
37
46
|
"web-ui",
|
|
47
|
+
"headless",
|
|
38
48
|
"sidebar"
|
|
39
49
|
],
|
|
40
50
|
"repository": {
|
|
@@ -71,6 +81,7 @@
|
|
|
71
81
|
"cordis.patch.yml",
|
|
72
82
|
"README.md",
|
|
73
83
|
"README.zh-CN.md",
|
|
84
|
+
"THIRD_PARTY_NOTICES.md",
|
|
74
85
|
"SECURITY.md",
|
|
75
86
|
"LICENSE"
|
|
76
87
|
],
|
|
@@ -97,8 +108,9 @@
|
|
|
97
108
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
98
109
|
"test": "vitest run",
|
|
99
110
|
"verify:build": "node scripts/verify-deterministic-build.mjs",
|
|
111
|
+
"verify:headless": "node scripts/verify-headless-profile.mjs",
|
|
100
112
|
"verify:package": "node scripts/verify-package-contents.mjs && pnpm run lint:package",
|
|
101
|
-
"verify": "pnpm run typecheck && pnpm run test && pnpm run verify:build && pnpm run verify:package"
|
|
113
|
+
"verify": "pnpm run typecheck && pnpm run test && pnpm run verify:build && pnpm run verify:headless && pnpm run verify:package"
|
|
102
114
|
},
|
|
103
115
|
"dependencies": {
|
|
104
116
|
"fflate": "^0.8.3",
|
|
@@ -122,6 +134,7 @@
|
|
|
122
134
|
"@deepseek-ai/dsh-client-ui-settings": "0.1.0-rc.6",
|
|
123
135
|
"@deepseek-ai/dsh-client-ui-slots": "0.1.0-rc.6",
|
|
124
136
|
"@deepseek-ai/dsh-client-ui-tool": "0.1.0-rc.6",
|
|
137
|
+
"@deepseek-ai/dsh-system-prompt": "0.1.0-rc.6",
|
|
125
138
|
"@testing-library/react": "^16.3.0",
|
|
126
139
|
"@types/node": "^22.0.0",
|
|
127
140
|
"@types/react": "^18.3.0",
|