dsh-mnemon 0.4.7 → 0.5.0
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 +10 -20
- package/README.zh-CN.md +10 -20
- package/SECURITY.md +8 -8
- package/cordis.patch.yml +42 -0
- package/lib/client.js +2360 -6843
- package/lib/contracts.js +16 -17
- package/lib/core.js +11 -0
- package/lib/definitions-j0FLgE0-.js +251 -0
- package/lib/extension-sdk.js +93 -229
- package/lib/index.js +3730 -6330
- package/lib/runtime-AtIOTeP1.js +1316 -0
- package/lib/storage-lock-Bqrhkyag.js +20 -0
- package/lib/testing.js +231 -0
- package/lib/types/src/client/extension-sdk.d.ts +10 -0
- package/lib/types/src/client/index.d.ts +1 -0
- package/lib/types/src/client/locales.d.ts +84 -0
- package/lib/types/src/client/page-client.d.ts +15 -0
- package/lib/types/src/client/page-kit.d.ts +40 -0
- package/lib/types/src/client/source-contracts.d.ts +46 -0
- package/lib/types/src/client/source-pages.d.ts +83 -0
- package/lib/types/src/core/contracts/index.d.ts +40 -0
- package/lib/types/src/core/contracts/plugin.d.ts +32 -0
- package/lib/types/src/core/contracts/view.d.ts +416 -0
- package/lib/types/src/core/definitions.d.ts +16 -0
- package/lib/types/src/core/plugin.d.ts +6 -0
- package/lib/types/src/{config-values.d.ts → host/config-values.d.ts} +7 -7
- package/lib/types/src/{config.d.ts → host/config.d.ts} +4 -1
- package/lib/types/src/{shared → host}/display-mode.d.ts +1 -1
- package/lib/types/src/host/plugin.d.ts +8 -0
- package/lib/types/src/host/protocol.d.ts +549 -0
- package/lib/types/src/host/view-protocol.d.ts +123 -0
- package/lib/types/src/index.d.ts +2 -21
- package/lib/types/src/sdk/index.d.ts +9 -0
- package/lib/types/src/sdk/input.d.ts +11 -0
- package/lib/types/src/sdk/install.d.ts +7 -0
- package/lib/types/src/sdk/service.d.ts +31 -0
- package/lib/types/src/sdk/storage-lock.d.ts +6 -0
- package/lib/types/src/sdk/strategy-configuration.d.ts +31 -0
- package/lib/types/src/sdk/testing.d.ts +70 -0
- package/package.json +46 -35
- package/lib/kernel.js +0 -1173
- package/lib/layers/documents.js +0 -31
- package/lib/layers/memory-spaces.js +0 -34
- package/lib/layers/runtime.js +0 -27
- package/lib/provider-sdk.js +0 -2
- package/lib/registry-B9SdBRLo.js +0 -2423
- package/lib/strategy-default-three-tier.js +0 -99
- package/lib/strategy-sdk.js +0 -56
- package/lib/types/packages/contracts/src/index.d.ts +0 -221
- package/lib/types/packages/extension-sdk/src/index.d.ts +0 -54
- package/lib/types/packages/kernel/src/access.d.ts +0 -14
- package/lib/types/packages/kernel/src/catalog.d.ts +0 -42
- package/lib/types/packages/kernel/src/index.d.ts +0 -5
- package/lib/types/packages/kernel/src/kernel.d.ts +0 -46
- package/lib/types/packages/kernel/src/topology.d.ts +0 -25
- package/lib/types/packages/kernel/src/view.d.ts +0 -89
- package/lib/types/packages/layer-documents/src/index.d.ts +0 -4
- package/lib/types/packages/layer-memory-spaces/src/index.d.ts +0 -4
- package/lib/types/packages/layer-runtime/src/index.d.ts +0 -4
- package/lib/types/packages/provider-sdk/src/index.d.ts +0 -19
- package/lib/types/packages/strategy-default-three-tier/src/index.d.ts +0 -7
- package/lib/types/packages/strategy-sdk/src/index.d.ts +0 -35
- package/lib/types/src/activity.d.ts +0 -16
- package/lib/types/src/agent-memory-turn.d.ts +0 -42
- package/lib/types/src/channels.d.ts +0 -1
- package/lib/types/src/client/GlobalLocationSetting.d.ts +0 -19
- package/lib/types/src/client/MnemonPackSection.d.ts +0 -13
- package/lib/types/src/client/MnemonSaveAction.d.ts +0 -13
- package/lib/types/src/client/MnemonSettingsCard.d.ts +0 -16
- package/lib/types/src/client/MnemonTurnTail.d.ts +0 -21
- package/lib/types/src/client/MnemonView.d.ts +0 -26
- package/lib/types/src/client/ProviderIcon.d.ts +0 -8
- package/lib/types/src/client/ProviderSettingsSection.d.ts +0 -16
- package/lib/types/src/client/anchor.d.ts +0 -27
- package/lib/types/src/client/api.d.ts +0 -83
- package/lib/types/src/client/better-sidebar.d.ts +0 -13
- package/lib/types/src/client/dsh-compat.d.ts +0 -51
- package/lib/types/src/client/settings.d.ts +0 -23
- package/lib/types/src/client/sidebar-entry.d.ts +0 -5
- package/lib/types/src/client/subagent-token-usage.d.ts +0 -23
- package/lib/types/src/client/workspace-controller.d.ts +0 -14
- package/lib/types/src/client/workspace-mount.d.ts +0 -20
- package/lib/types/src/commands.d.ts +0 -13
- package/lib/types/src/contracts.d.ts +0 -316
- package/lib/types/src/documents.d.ts +0 -77
- package/lib/types/src/git-branch.d.ts +0 -6
- package/lib/types/src/guidance.d.ts +0 -29
- package/lib/types/src/lifecycle.d.ts +0 -80
- package/lib/types/src/live-runtime.d.ts +0 -92
- package/lib/types/src/memory-bodies.d.ts +0 -57
- package/lib/types/src/memory-receipts.d.ts +0 -21
- package/lib/types/src/memory-system/access.d.ts +0 -2
- package/lib/types/src/memory-system/catalog.d.ts +0 -2
- package/lib/types/src/memory-system/contracts.d.ts +0 -2
- package/lib/types/src/memory-system/defaults.d.ts +0 -6
- package/lib/types/src/memory-system/index.d.ts +0 -7
- package/lib/types/src/memory-system/kernel.d.ts +0 -2
- package/lib/types/src/memory-system/topology.d.ts +0 -2
- package/lib/types/src/memory-system/view.d.ts +0 -2
- package/lib/types/src/memory-view.d.ts +0 -21
- package/lib/types/src/pack.d.ts +0 -29
- package/lib/types/src/process.d.ts +0 -16
- package/lib/types/src/provider-placement.d.ts +0 -26
- package/lib/types/src/provider-sdk.d.ts +0 -4
- package/lib/types/src/providers/byterover.d.ts +0 -32
- package/lib/types/src/providers/catalog.d.ts +0 -23
- package/lib/types/src/providers/hindsight.d.ts +0 -20
- package/lib/types/src/providers/holographic.d.ts +0 -23
- package/lib/types/src/providers/honcho.d.ts +0 -18
- package/lib/types/src/providers/http.d.ts +0 -32
- package/lib/types/src/providers/mem0.d.ts +0 -18
- package/lib/types/src/providers/memory-system.d.ts +0 -6
- package/lib/types/src/providers/openviking.d.ts +0 -32
- package/lib/types/src/providers/provider.d.ts +0 -46
- package/lib/types/src/providers/registry.d.ts +0 -23
- package/lib/types/src/providers/retaindb.d.ts +0 -17
- package/lib/types/src/providers/supermemory.d.ts +0 -17
- package/lib/types/src/recall-quality/contracts.d.ts +0 -32
- package/lib/types/src/recall-quality/engine.d.ts +0 -13
- package/lib/types/src/recall-quality/index.d.ts +0 -4
- package/lib/types/src/recall-quality/policies.d.ts +0 -5
- package/lib/types/src/recall-quality/registry.d.ts +0 -10
- package/lib/types/src/review-activity.d.ts +0 -19
- package/lib/types/src/rpc.d.ts +0 -22
- package/lib/types/src/runner.d.ts +0 -41
- package/lib/types/src/runtime-memory.d.ts +0 -90
- package/lib/types/src/search-tokens.d.ts +0 -5
- package/lib/types/src/service.d.ts +0 -113
- package/lib/types/src/session-events.d.ts +0 -8
- package/lib/types/src/settings.d.ts +0 -6
- package/lib/types/src/shared/contracts.d.ts +0 -1008
- package/lib/types/src/storage-scope.d.ts +0 -12
- package/lib/types/src/subagent-token-usage.d.ts +0 -53
- package/lib/types/src/subagent.d.ts +0 -124
- package/lib/types/src/tools.d.ts +0 -10
- package/lib/types/src/version-updates.d.ts +0 -37
|
@@ -0,0 +1,549 @@
|
|
|
1
|
+
/** Starter Entry ids remain reserved when DSH nests them under an include. */
|
|
2
|
+
export declare function isDefaultSourceInstance(instanceKey: string, sourceTypeId: string): boolean;
|
|
3
|
+
export type MemoryParticipationMode = 'off' | 'manual' | 'automatic';
|
|
4
|
+
export type MemoryParticipationChannel = 'recall' | 'write' | 'projection' | 'maintenance';
|
|
5
|
+
export type MemoryLayerParticipation = Record<MemoryParticipationChannel, MemoryParticipationMode>;
|
|
6
|
+
export interface MemoryTopologyDefinition {
|
|
7
|
+
id: string;
|
|
8
|
+
strategyId: string;
|
|
9
|
+
layers: Array<ResolvedMemoryLayerConfig & {
|
|
10
|
+
id: string;
|
|
11
|
+
}>;
|
|
12
|
+
}
|
|
13
|
+
export interface MemoryCompositionStatus {
|
|
14
|
+
evaluation: import('../core/contracts/index.ts').MemoryCompositionEvaluationReport;
|
|
15
|
+
sources: MemorySourceManagementInstance[];
|
|
16
|
+
configuration: ResolvedMemoryTopologyConfig;
|
|
17
|
+
}
|
|
18
|
+
import type { RecallQualityConfig, ResolvedRecallQualityConfig, MnemonEmbeddingConfig, ResolvedMnemonEmbeddingConfig } from 'dsh-mnemon-source-memory-spaces/contracts';
|
|
19
|
+
import type { MemoryPersistenceStrategy, ResolvedMemoryPersistenceStrategy, MemoryProviderRuntimeStatus, MemoryBodyStats, MemoryBodyView } from 'dsh-mnemon-source-memory-spaces/contracts';
|
|
20
|
+
import type { ConnectionHandle as DshClientConnectionHandle } from '@deepseek-ai/dsh-client-connection/client';
|
|
21
|
+
import type { DocumentSnapshot } from 'dsh-mnemon-source-documents/contracts';
|
|
22
|
+
export declare const MNEMON_READ_CHANNEL = "/dsh-mnemon-read";
|
|
23
|
+
export declare const MNEMON_ACTIVATION_CHANNEL = "/dsh-mnemon-activation";
|
|
24
|
+
export declare const MNEMON_WRITE_CHANNEL = "/dsh-mnemon-write";
|
|
25
|
+
export declare const MNEMON_PACK_CHANNEL = "/dsh-mnemon-pack";
|
|
26
|
+
export declare const MNEMON_SETTINGS_CHANNEL = "/dsh-mnemon-settings";
|
|
27
|
+
export declare const MNEMON_SETTINGS_NAMESPACE = "mnemon";
|
|
28
|
+
export declare const MNEMON_UI_SETTINGS_NAMESPACE = "mnemon-ui";
|
|
29
|
+
export * from './view-protocol.ts';
|
|
30
|
+
export type JsonPrimitive = string | number | boolean | null;
|
|
31
|
+
export type JsonValue = JsonPrimitive | JsonValue[] | {
|
|
32
|
+
[key: string]: JsonValue;
|
|
33
|
+
};
|
|
34
|
+
export interface MemorySourceManagementField {
|
|
35
|
+
key: string;
|
|
36
|
+
label: string;
|
|
37
|
+
description?: string;
|
|
38
|
+
input: 'text' | 'number' | 'boolean' | 'url' | 'secret' | 'select';
|
|
39
|
+
required: boolean;
|
|
40
|
+
secret?: boolean;
|
|
41
|
+
options?: Array<{
|
|
42
|
+
value: string;
|
|
43
|
+
label: string;
|
|
44
|
+
}>;
|
|
45
|
+
}
|
|
46
|
+
/** Browser-safe descriptor of one Source instance visible in the current scope. */
|
|
47
|
+
export interface MemorySourceManagementInstance {
|
|
48
|
+
sourceInstanceKey: string;
|
|
49
|
+
sourceTypeId: string;
|
|
50
|
+
packageName: string;
|
|
51
|
+
role: string;
|
|
52
|
+
availability: 'ready' | 'degraded' | 'unavailable';
|
|
53
|
+
revision: string;
|
|
54
|
+
capabilities: string[];
|
|
55
|
+
assistance?: readonly string[];
|
|
56
|
+
management: {
|
|
57
|
+
label: string;
|
|
58
|
+
description: string;
|
|
59
|
+
fields?: MemorySourceManagementField[];
|
|
60
|
+
diagnostics?: string[];
|
|
61
|
+
};
|
|
62
|
+
hints?: JsonValue;
|
|
63
|
+
}
|
|
64
|
+
export interface MemorySourceManagementCatalog {
|
|
65
|
+
generationId: string;
|
|
66
|
+
sources: MemorySourceManagementInstance[];
|
|
67
|
+
}
|
|
68
|
+
export interface MemorySourceManagementResult {
|
|
69
|
+
revision: string;
|
|
70
|
+
value: JsonValue;
|
|
71
|
+
}
|
|
72
|
+
export type RpcError = {
|
|
73
|
+
code: 'bad-request';
|
|
74
|
+
message: string;
|
|
75
|
+
details: {
|
|
76
|
+
issues: JsonValue[];
|
|
77
|
+
};
|
|
78
|
+
} | {
|
|
79
|
+
code: 'settings-rejected';
|
|
80
|
+
message: string;
|
|
81
|
+
details: {
|
|
82
|
+
ns: string;
|
|
83
|
+
};
|
|
84
|
+
} | {
|
|
85
|
+
code: 'internal';
|
|
86
|
+
message: string;
|
|
87
|
+
details: Record<string, never>;
|
|
88
|
+
};
|
|
89
|
+
export type RpcResult<T = JsonValue> = {
|
|
90
|
+
ok: true;
|
|
91
|
+
value: T;
|
|
92
|
+
} | {
|
|
93
|
+
ok: false;
|
|
94
|
+
error: RpcError;
|
|
95
|
+
};
|
|
96
|
+
/** Public DSH browser RPC face plus the transport boundary needed to gate local-only writes. */
|
|
97
|
+
export type ClientConnectionHandle = Pick<DshClientConnectionHandle, 'rpc'> & Partial<Pick<DshClientConnectionHandle, 'isLoopback'>>;
|
|
98
|
+
export interface ClientSettingsSnapshot<T> {
|
|
99
|
+
status: 'loading' | 'ready' | 'unavailable';
|
|
100
|
+
value?: T;
|
|
101
|
+
base?: unknown;
|
|
102
|
+
user?: unknown;
|
|
103
|
+
revision?: number;
|
|
104
|
+
writable: boolean;
|
|
105
|
+
mode: 'host' | 'memory';
|
|
106
|
+
}
|
|
107
|
+
export interface ClientSettingsScope<T> {
|
|
108
|
+
getSnapshot(): ClientSettingsSnapshot<T>;
|
|
109
|
+
subscribe(listener: () => void): () => void;
|
|
110
|
+
set(field: string, value: unknown): Promise<void>;
|
|
111
|
+
unset(field: string): Promise<void>;
|
|
112
|
+
setPath(path: string[], value: unknown): Promise<void>;
|
|
113
|
+
unsetPath(path: string[]): Promise<void>;
|
|
114
|
+
mutate?(ops: SettingsOperation[]): Promise<void>;
|
|
115
|
+
}
|
|
116
|
+
export type SettingsOperation = {
|
|
117
|
+
op: 'set';
|
|
118
|
+
path: string[];
|
|
119
|
+
value: unknown;
|
|
120
|
+
} | {
|
|
121
|
+
op: 'unset';
|
|
122
|
+
path: string[];
|
|
123
|
+
};
|
|
124
|
+
export type StorageScopeKind = 'global' | 'workspace' | 'custom';
|
|
125
|
+
export interface MemoryLayerConfig {
|
|
126
|
+
enabled?: boolean;
|
|
127
|
+
participation?: Partial<MemoryLayerParticipation>;
|
|
128
|
+
adapterIds?: string[];
|
|
129
|
+
}
|
|
130
|
+
export interface MemoryTopologyConfig {
|
|
131
|
+
id?: string;
|
|
132
|
+
strategyId?: string;
|
|
133
|
+
layers?: Record<string, MemoryLayerConfig>;
|
|
134
|
+
}
|
|
135
|
+
export interface ResolvedMemoryLayerConfig {
|
|
136
|
+
enabled: boolean;
|
|
137
|
+
participation: MemoryLayerParticipation;
|
|
138
|
+
adapterIds: string[];
|
|
139
|
+
}
|
|
140
|
+
export interface ResolvedMemoryTopologyConfig {
|
|
141
|
+
id: string;
|
|
142
|
+
strategyId: string;
|
|
143
|
+
layers: Record<string, ResolvedMemoryLayerConfig>;
|
|
144
|
+
}
|
|
145
|
+
export interface CustomPackConfig {
|
|
146
|
+
id: string;
|
|
147
|
+
name: string;
|
|
148
|
+
dataDir: string;
|
|
149
|
+
}
|
|
150
|
+
export interface RuntimeMemoryConfig {
|
|
151
|
+
/** Maximum UTF-8 bytes projected into MEMORY.md. */
|
|
152
|
+
memoryLimitBytes?: number;
|
|
153
|
+
/** Maximum UTF-8 bytes projected into USER.md. */
|
|
154
|
+
userLimitBytes?: number;
|
|
155
|
+
/** Completion-token budget for Runtime migration and compaction workers. */
|
|
156
|
+
maintenanceMaxTokens?: number;
|
|
157
|
+
}
|
|
158
|
+
export interface ResolvedRuntimeMemoryConfig {
|
|
159
|
+
memoryLimitBytes: number;
|
|
160
|
+
userLimitBytes: number;
|
|
161
|
+
maintenanceMaxTokens: number;
|
|
162
|
+
}
|
|
163
|
+
export { normalizeDisplayMode } from './display-mode.ts';
|
|
164
|
+
export type MnemonDisplayMode = 'sidebar' | 'builtin';
|
|
165
|
+
export interface Config {
|
|
166
|
+
storageScope?: StorageScopeKind;
|
|
167
|
+
/** Whether USER.md follows the selected storage root or stays in the global root. */
|
|
168
|
+
runtimeUserScope?: 'storage' | 'global';
|
|
169
|
+
cliPath?: string;
|
|
170
|
+
dataDir?: string;
|
|
171
|
+
customPackId?: string;
|
|
172
|
+
customPacks?: CustomPackConfig[];
|
|
173
|
+
store?: string;
|
|
174
|
+
timeoutMs?: number;
|
|
175
|
+
defaultRecallLimit?: number;
|
|
176
|
+
runtimeMemory?: RuntimeMemoryConfig;
|
|
177
|
+
/** Optional DSH-owned overrides injected into every Mnemon CLI process. */
|
|
178
|
+
embedding?: MnemonEmbeddingConfig;
|
|
179
|
+
memoryTopology?: MemoryTopologyConfig;
|
|
180
|
+
recallQuality?: RecallQualityConfig;
|
|
181
|
+
routingGuidance?: boolean;
|
|
182
|
+
/** Entry placement only. Legacy `buildin` input is migrated to `builtin`. */
|
|
183
|
+
displayMode?: MnemonDisplayMode | 'buildin';
|
|
184
|
+
tabEnabled?: boolean;
|
|
185
|
+
writeEnabled?: boolean;
|
|
186
|
+
/** DSH rc.2 management-channel authority; ignored by DSH 0.1.2-alpha.1. */
|
|
187
|
+
remoteAccess?: 'read-only' | 'trusted-host';
|
|
188
|
+
lifecycleEnabled?: boolean;
|
|
189
|
+
recallMode?: 'guided' | 'off';
|
|
190
|
+
writebackMode?: 'guided' | 'off';
|
|
191
|
+
idleReviewMs?: number;
|
|
192
|
+
conversationInteraction?: {
|
|
193
|
+
toolviews?: boolean;
|
|
194
|
+
turnBar?: boolean;
|
|
195
|
+
saveAction?: boolean;
|
|
196
|
+
};
|
|
197
|
+
/** Provider policy used when an Agent must create a new Memory Space while distilling memory. */
|
|
198
|
+
persistenceStrategy?: MemoryPersistenceStrategy;
|
|
199
|
+
/** Model route used by clean, session-independent maintenance Agents. */
|
|
200
|
+
taskAgentModel?: TaskAgentModelConfig;
|
|
201
|
+
}
|
|
202
|
+
export interface TaskAgentModelConfig {
|
|
203
|
+
mode?: 'inherit' | 'fixed';
|
|
204
|
+
provider?: string;
|
|
205
|
+
model?: string;
|
|
206
|
+
}
|
|
207
|
+
export interface ResolvedTaskAgentModelConfig {
|
|
208
|
+
mode: 'inherit' | 'fixed';
|
|
209
|
+
provider?: string;
|
|
210
|
+
model?: string;
|
|
211
|
+
}
|
|
212
|
+
export interface TaskAgentModelCatalogModel {
|
|
213
|
+
id: string;
|
|
214
|
+
name: string;
|
|
215
|
+
description?: string;
|
|
216
|
+
/** DSH's merge-extensible model modality ids; absent means capability is unknown. */
|
|
217
|
+
inputModalities?: string[];
|
|
218
|
+
}
|
|
219
|
+
export interface TaskAgentModelCatalogGroup {
|
|
220
|
+
id: string;
|
|
221
|
+
name: string;
|
|
222
|
+
models: TaskAgentModelCatalogModel[];
|
|
223
|
+
}
|
|
224
|
+
export interface TaskAgentModelCatalogFailure {
|
|
225
|
+
id: string;
|
|
226
|
+
name: string;
|
|
227
|
+
message: string;
|
|
228
|
+
}
|
|
229
|
+
export interface TaskAgentModelCatalog {
|
|
230
|
+
effective?: {
|
|
231
|
+
provider: string;
|
|
232
|
+
model: string;
|
|
233
|
+
source: 'fixed' | 'dsh-default' | 'active-agent';
|
|
234
|
+
};
|
|
235
|
+
defaultSelection?: {
|
|
236
|
+
provider: string;
|
|
237
|
+
model: string;
|
|
238
|
+
};
|
|
239
|
+
groups: TaskAgentModelCatalogGroup[];
|
|
240
|
+
failures: TaskAgentModelCatalogFailure[];
|
|
241
|
+
}
|
|
242
|
+
export interface InteractionConfig {
|
|
243
|
+
turnBar?: boolean;
|
|
244
|
+
saveAction?: boolean;
|
|
245
|
+
}
|
|
246
|
+
export interface ResolvedConfig {
|
|
247
|
+
storageScope: StorageScopeKind;
|
|
248
|
+
runtimeUserScope: 'storage' | 'global';
|
|
249
|
+
cliPath?: string;
|
|
250
|
+
dataDir?: string;
|
|
251
|
+
store?: string;
|
|
252
|
+
timeoutMs: number;
|
|
253
|
+
defaultRecallLimit: number;
|
|
254
|
+
runtimeMemory: ResolvedRuntimeMemoryConfig;
|
|
255
|
+
embedding: ResolvedMnemonEmbeddingConfig;
|
|
256
|
+
memoryTopology: ResolvedMemoryTopologyConfig;
|
|
257
|
+
recallQuality: ResolvedRecallQualityConfig;
|
|
258
|
+
routingGuidance: boolean;
|
|
259
|
+
displayMode: MnemonDisplayMode;
|
|
260
|
+
tabEnabled: boolean;
|
|
261
|
+
writeEnabled: boolean;
|
|
262
|
+
/** DSH rc.2 management-channel authority; ignored by DSH 0.1.2-alpha.1. */
|
|
263
|
+
remoteAccess: 'read-only' | 'trusted-host';
|
|
264
|
+
lifecycleEnabled: boolean;
|
|
265
|
+
recallMode: 'guided' | 'off';
|
|
266
|
+
writebackMode: 'guided' | 'off';
|
|
267
|
+
idleReviewMs: number;
|
|
268
|
+
conversationInteraction: {
|
|
269
|
+
toolviews: boolean;
|
|
270
|
+
turnBar: boolean;
|
|
271
|
+
saveAction: boolean;
|
|
272
|
+
};
|
|
273
|
+
persistenceStrategy: ResolvedMemoryPersistenceStrategy;
|
|
274
|
+
taskAgentModel: ResolvedTaskAgentModelConfig;
|
|
275
|
+
}
|
|
276
|
+
export interface ResolvedInteractionConfig {
|
|
277
|
+
turnBar: boolean;
|
|
278
|
+
saveAction: boolean;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Provider instance identity inside one Memory Spaces Source. Built-in ids
|
|
282
|
+
* remain stable; third-party child modules may contribute additional ids.
|
|
283
|
+
*/
|
|
284
|
+
export type * from 'dsh-mnemon-source-memory-spaces/contracts';
|
|
285
|
+
export type * from 'dsh-mnemon-source-documents/contracts';
|
|
286
|
+
export type * from 'dsh-mnemon-source-runtime/contracts';
|
|
287
|
+
export interface TurnMemoryActivity {
|
|
288
|
+
turn: number;
|
|
289
|
+
count: number;
|
|
290
|
+
names: string[];
|
|
291
|
+
recalls: number;
|
|
292
|
+
writes: number;
|
|
293
|
+
documentSearches: number;
|
|
294
|
+
inspections: number;
|
|
295
|
+
failures: number;
|
|
296
|
+
/** Successful evidence-bearing reads with tool-authored safe previews. */
|
|
297
|
+
retrieved: MemoryActivityRead[];
|
|
298
|
+
/** Only writes whose tool-authored result confirms durable commitment. */
|
|
299
|
+
writebacks: MemoryActivityWriteback[];
|
|
300
|
+
}
|
|
301
|
+
export interface MemoryActivityItem {
|
|
302
|
+
id: string;
|
|
303
|
+
title: string;
|
|
304
|
+
excerpt?: string;
|
|
305
|
+
}
|
|
306
|
+
export interface MemoryActivityRead {
|
|
307
|
+
callId: string;
|
|
308
|
+
toolName: string;
|
|
309
|
+
operationId: string;
|
|
310
|
+
reference?: string;
|
|
311
|
+
sourceTypeId?: string;
|
|
312
|
+
items: MemoryActivityItem[];
|
|
313
|
+
}
|
|
314
|
+
export interface MemoryActivityWriteback {
|
|
315
|
+
callId: string;
|
|
316
|
+
toolName: string;
|
|
317
|
+
operationId: string;
|
|
318
|
+
reference?: string;
|
|
319
|
+
sourceTypeId?: string;
|
|
320
|
+
item: MemoryActivityItem;
|
|
321
|
+
}
|
|
322
|
+
export interface TurnMemoryActivitySnapshot {
|
|
323
|
+
cursor: number;
|
|
324
|
+
activities: TurnMemoryActivity[];
|
|
325
|
+
}
|
|
326
|
+
export interface AssistantMessageText {
|
|
327
|
+
messageId: string;
|
|
328
|
+
text: string;
|
|
329
|
+
}
|
|
330
|
+
export type StorageAreaKind = 'runtime' | 'memory-bodies' | 'documents' | 'state';
|
|
331
|
+
export type StorageAreaStatus = 'ready' | 'empty' | 'missing' | 'invalid';
|
|
332
|
+
export interface StorageAreaInventory {
|
|
333
|
+
kind: StorageAreaKind;
|
|
334
|
+
path: string;
|
|
335
|
+
status: StorageAreaStatus;
|
|
336
|
+
bytes: number;
|
|
337
|
+
itemCount: number;
|
|
338
|
+
details: Record<string, number | string | boolean>;
|
|
339
|
+
issue?: string;
|
|
340
|
+
}
|
|
341
|
+
export interface StorageScopeInventory {
|
|
342
|
+
kind: StorageScopeKind;
|
|
343
|
+
root?: string;
|
|
344
|
+
configured: boolean;
|
|
345
|
+
active: boolean;
|
|
346
|
+
available: boolean;
|
|
347
|
+
totalBytes: number;
|
|
348
|
+
areas: StorageAreaInventory[];
|
|
349
|
+
issue?: string;
|
|
350
|
+
}
|
|
351
|
+
export interface StorageScopeCatalog {
|
|
352
|
+
activeKind: StorageScopeKind;
|
|
353
|
+
activeRoot: string;
|
|
354
|
+
scopes: StorageScopeInventory[];
|
|
355
|
+
generatedAt: string;
|
|
356
|
+
}
|
|
357
|
+
export interface ReviewActivity {
|
|
358
|
+
totalUserTextLength: number;
|
|
359
|
+
turnCount: number;
|
|
360
|
+
toolCallCount: number;
|
|
361
|
+
uniqueToolCount: number;
|
|
362
|
+
}
|
|
363
|
+
export interface ReviewActivityScore extends ReviewActivity {
|
|
364
|
+
textLengthScore: number;
|
|
365
|
+
turnScore: number;
|
|
366
|
+
toolCallScore: number;
|
|
367
|
+
toolDiversityScore: number;
|
|
368
|
+
score: number;
|
|
369
|
+
threshold: number;
|
|
370
|
+
eligible: boolean;
|
|
371
|
+
}
|
|
372
|
+
export interface SubagentCounters {
|
|
373
|
+
recalls: number;
|
|
374
|
+
writes: number;
|
|
375
|
+
answers: number;
|
|
376
|
+
reviews: number;
|
|
377
|
+
placements: number;
|
|
378
|
+
migrations: number;
|
|
379
|
+
compactions: number;
|
|
380
|
+
documentArchives: number;
|
|
381
|
+
metadataMaintenances: number;
|
|
382
|
+
failures: number;
|
|
383
|
+
lastRunId?: string;
|
|
384
|
+
lastOperation?: 'recall' | 'write' | 'review' | 'placement' | 'migration' | 'compaction' | 'document-archive' | 'metadata-maintenance';
|
|
385
|
+
lastAt?: string;
|
|
386
|
+
}
|
|
387
|
+
export type LifecyclePhase = 'idle' | 'prime' | 'recall' | 'writeback' | 'review' | 'supervised' | 'error';
|
|
388
|
+
export interface LifecycleCounters {
|
|
389
|
+
primes: number;
|
|
390
|
+
recallCues: number;
|
|
391
|
+
writebackCues: number;
|
|
392
|
+
supervisedRequests: number;
|
|
393
|
+
failures: number;
|
|
394
|
+
}
|
|
395
|
+
export interface LifecycleAgentSnapshot {
|
|
396
|
+
sessionId: string;
|
|
397
|
+
status: 'idle' | 'running';
|
|
398
|
+
startSource: 'startup' | 'resume' | 'clear' | 'compact' | 'adopted';
|
|
399
|
+
primePending: boolean;
|
|
400
|
+
guidedTurns: number;
|
|
401
|
+
memoryToolCalls: number;
|
|
402
|
+
idleReviewPending: boolean;
|
|
403
|
+
reviewRunning: boolean;
|
|
404
|
+
reviewActivity: ReviewActivityScore;
|
|
405
|
+
lastPhase: LifecyclePhase;
|
|
406
|
+
lastReviewAt?: string;
|
|
407
|
+
lastReviewAction?: string;
|
|
408
|
+
lastReviewScore?: number;
|
|
409
|
+
lastReviewDocumentIds?: string[];
|
|
410
|
+
lastAt?: string;
|
|
411
|
+
lastError?: string;
|
|
412
|
+
}
|
|
413
|
+
export interface LifecycleSnapshot {
|
|
414
|
+
enabled: boolean;
|
|
415
|
+
recallMode: 'guided' | 'off';
|
|
416
|
+
writebackMode: 'guided' | 'off';
|
|
417
|
+
idleReviewMs: number;
|
|
418
|
+
activeAgents: number;
|
|
419
|
+
sessionAvailable: boolean;
|
|
420
|
+
/** A session-independent task Agent can be created for WebUI maintenance. */
|
|
421
|
+
taskAgentAvailable: boolean;
|
|
422
|
+
counters: LifecycleCounters;
|
|
423
|
+
subagents: SubagentCounters;
|
|
424
|
+
current?: LifecycleAgentSnapshot;
|
|
425
|
+
}
|
|
426
|
+
export interface StatusView {
|
|
427
|
+
healthy: boolean;
|
|
428
|
+
error?: string;
|
|
429
|
+
version?: string;
|
|
430
|
+
dshMnemonVersion?: string;
|
|
431
|
+
cliPath: string;
|
|
432
|
+
commandFound: boolean;
|
|
433
|
+
dataDir: string;
|
|
434
|
+
/** Legacy comma-separated DSH-enabled Store list. */
|
|
435
|
+
store: string;
|
|
436
|
+
mnemonDefaultStore: string;
|
|
437
|
+
dshActiveStores: string[];
|
|
438
|
+
writeEnabled: boolean;
|
|
439
|
+
timeoutMs: number;
|
|
440
|
+
defaultRecallLimit: number;
|
|
441
|
+
recallQuality: ResolvedRecallQualityConfig;
|
|
442
|
+
memoryBodyDirectory: string;
|
|
443
|
+
memoryBodies: MemoryBodyView[];
|
|
444
|
+
providerServices?: MemoryProviderRuntimeStatus[];
|
|
445
|
+
memorySystem?: MemoryCompositionStatus;
|
|
446
|
+
lifecycle?: LifecycleSnapshot;
|
|
447
|
+
documents?: DocumentSnapshot;
|
|
448
|
+
storage?: StorageScopeCatalog;
|
|
449
|
+
workspaceContext?: {
|
|
450
|
+
mode: StorageScopeKind;
|
|
451
|
+
selectedRoot: string;
|
|
452
|
+
effectiveRoot: string;
|
|
453
|
+
aligned: boolean;
|
|
454
|
+
selectedWorkspace?: {
|
|
455
|
+
id: string;
|
|
456
|
+
title: string;
|
|
457
|
+
path: string;
|
|
458
|
+
};
|
|
459
|
+
effectiveWorkspace?: {
|
|
460
|
+
id: string;
|
|
461
|
+
title: string;
|
|
462
|
+
path: string;
|
|
463
|
+
};
|
|
464
|
+
};
|
|
465
|
+
stats?: MemoryBodyStats & {
|
|
466
|
+
dbPath?: string;
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
export type MnemonPackComponent = 'runtime' | 'documents' | 'memory-spaces';
|
|
470
|
+
export type MnemonPackScope = 'full' | MnemonPackComponent;
|
|
471
|
+
export type MnemonPackImportMode = 'merge' | 'replace';
|
|
472
|
+
export interface MnemonPackComponentSummary {
|
|
473
|
+
component: MnemonPackComponent;
|
|
474
|
+
files: number;
|
|
475
|
+
bytes: number;
|
|
476
|
+
items: number;
|
|
477
|
+
}
|
|
478
|
+
export interface MnemonPackManifest {
|
|
479
|
+
format: 'mnemonpack';
|
|
480
|
+
version: 1;
|
|
481
|
+
scope: MnemonPackScope;
|
|
482
|
+
exportedAt: string;
|
|
483
|
+
source: {
|
|
484
|
+
plugin: 'dsh-mnemon';
|
|
485
|
+
pluginVersion: string;
|
|
486
|
+
};
|
|
487
|
+
components: MnemonPackComponent[];
|
|
488
|
+
summary: MnemonPackComponentSummary[];
|
|
489
|
+
}
|
|
490
|
+
export interface MnemonPackExport {
|
|
491
|
+
fileName: string;
|
|
492
|
+
mimeType: 'application/zip';
|
|
493
|
+
bytes: number;
|
|
494
|
+
base64: string;
|
|
495
|
+
targetRoot: string;
|
|
496
|
+
manifest: MnemonPackManifest;
|
|
497
|
+
}
|
|
498
|
+
export interface MnemonPackPreview {
|
|
499
|
+
fileName?: string;
|
|
500
|
+
archiveBytes: number;
|
|
501
|
+
expandedBytes: number;
|
|
502
|
+
targetRoot: string;
|
|
503
|
+
targetScope: StorageScopeKind;
|
|
504
|
+
manifest: MnemonPackManifest;
|
|
505
|
+
occupied: Record<MnemonPackComponent, boolean>;
|
|
506
|
+
}
|
|
507
|
+
export interface MnemonPackImportResult {
|
|
508
|
+
imported: true;
|
|
509
|
+
mode: MnemonPackImportMode;
|
|
510
|
+
targetRoot: string;
|
|
511
|
+
components: MnemonPackComponent[];
|
|
512
|
+
summary: MnemonPackComponentSummary[];
|
|
513
|
+
}
|
|
514
|
+
export type VersionComponentId = 'mnemon' | 'dsh-mnemon';
|
|
515
|
+
export type VersionInstallMode = 'homebrew' | 'go' | 'npm' | 'link' | 'manual' | 'missing';
|
|
516
|
+
export interface VersionComponentStatus {
|
|
517
|
+
id: VersionComponentId;
|
|
518
|
+
name: string;
|
|
519
|
+
executablePath?: string;
|
|
520
|
+
installPath?: string;
|
|
521
|
+
installProfile?: string;
|
|
522
|
+
current?: string;
|
|
523
|
+
latest?: string;
|
|
524
|
+
outdated: boolean;
|
|
525
|
+
installMode: VersionInstallMode;
|
|
526
|
+
updateSupported: boolean;
|
|
527
|
+
updateHint: string;
|
|
528
|
+
checkError?: string;
|
|
529
|
+
}
|
|
530
|
+
export interface VersionStatus {
|
|
531
|
+
checkedAt: string;
|
|
532
|
+
components: VersionComponentStatus[];
|
|
533
|
+
}
|
|
534
|
+
export interface VersionUpdateResult {
|
|
535
|
+
component: VersionComponentId;
|
|
536
|
+
previousVersion?: string;
|
|
537
|
+
currentVersion?: string;
|
|
538
|
+
updated: boolean;
|
|
539
|
+
restartRequired: boolean;
|
|
540
|
+
output?: string;
|
|
541
|
+
}
|
|
542
|
+
export declare const CATEGORIES: readonly ["preference", "decision", "fact", "insight", "context", "general"];
|
|
543
|
+
export declare const SOURCES: readonly ["user", "agent", "external"];
|
|
544
|
+
export declare const EDGE_TYPES: readonly ["temporal", "semantic", "causal", "entity"];
|
|
545
|
+
export declare const INTENTS: readonly ["WHY", "WHEN", "ENTITY", "GENERAL"];
|
|
546
|
+
export declare const DEFAULT_EMBEDDING_ENDPOINT = "http://localhost:11434";
|
|
547
|
+
export declare const DEFAULT_EMBEDDING_MODEL = "nomic-embed-text";
|
|
548
|
+
export declare const DEFAULT_EMBEDDING_PROTOCOL = "auto";
|
|
549
|
+
export declare const MNEMON_EMBEDDING_PROTOCOLS: readonly ["auto", "ollama", "openai"];
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import type { MemoryJsonValue, MemoryPluginLocalizedText, MemoryPluginRole, MemoryViewGuidance, MemoryViewSourcePresentation } from '../core/contracts/index.ts';
|
|
2
|
+
import type { TurnMemoryActivity } from './protocol.ts';
|
|
3
|
+
import type { MemoryStrategyConfigurationField } from '../sdk/strategy-configuration.ts';
|
|
4
|
+
export declare const MNEMON_VIEW_CHANNEL = "/dsh-mnemon-view";
|
|
5
|
+
export declare const MNEMON_VIEW_WRITE_CHANNEL = "/dsh-mnemon-view-settings";
|
|
6
|
+
export declare const MNEMON_VIEW_SETTINGS_NAMESPACE = "mnemon-view";
|
|
7
|
+
export interface MemoryPluginPreference {
|
|
8
|
+
enabled: boolean;
|
|
9
|
+
config: Record<string, MemoryJsonValue>;
|
|
10
|
+
}
|
|
11
|
+
export interface MemoryViewPreferences {
|
|
12
|
+
strategyTypeId?: string;
|
|
13
|
+
entries: Record<string, MemoryPluginPreference>;
|
|
14
|
+
}
|
|
15
|
+
export interface MemoryPluginEntryView {
|
|
16
|
+
entryId: string;
|
|
17
|
+
packageName: string;
|
|
18
|
+
roles: MemoryPluginRole[];
|
|
19
|
+
typeId?: string;
|
|
20
|
+
strategyTypeId?: string;
|
|
21
|
+
slot?: string;
|
|
22
|
+
label: MemoryPluginLocalizedText;
|
|
23
|
+
description: MemoryPluginLocalizedText;
|
|
24
|
+
provides: Array<{
|
|
25
|
+
id: string;
|
|
26
|
+
exclusive: boolean;
|
|
27
|
+
}>;
|
|
28
|
+
requires: string[];
|
|
29
|
+
requiredBy: string[];
|
|
30
|
+
fields: readonly MemoryStrategyConfigurationField[];
|
|
31
|
+
enabled: boolean;
|
|
32
|
+
active: boolean;
|
|
33
|
+
writable: boolean;
|
|
34
|
+
config: Record<string, MemoryJsonValue>;
|
|
35
|
+
diagnostic?: string;
|
|
36
|
+
}
|
|
37
|
+
/** Browser read model, not a serialized authority envelope. No readGrants. */
|
|
38
|
+
export interface MemoryViewInspection {
|
|
39
|
+
id: string;
|
|
40
|
+
digest: string;
|
|
41
|
+
generationId: string;
|
|
42
|
+
createdAt: string;
|
|
43
|
+
turn?: number;
|
|
44
|
+
state: 'active' | 'recent' | 'preview';
|
|
45
|
+
strategyTypeId: string;
|
|
46
|
+
strategyInstanceKey: string;
|
|
47
|
+
extensions: Array<{
|
|
48
|
+
instanceKey: string;
|
|
49
|
+
typeId: string;
|
|
50
|
+
slot: string;
|
|
51
|
+
digest: string;
|
|
52
|
+
}>;
|
|
53
|
+
projection: Array<{
|
|
54
|
+
id: string;
|
|
55
|
+
sourceInstanceKey: string;
|
|
56
|
+
mode: string;
|
|
57
|
+
text: string;
|
|
58
|
+
revision: string;
|
|
59
|
+
}>;
|
|
60
|
+
sourcePresentations?: MemoryViewSourcePresentation[];
|
|
61
|
+
routes: Array<{
|
|
62
|
+
id: string;
|
|
63
|
+
sourceInstanceKey: string;
|
|
64
|
+
operationId: string;
|
|
65
|
+
description: string;
|
|
66
|
+
maxCalls: number;
|
|
67
|
+
}>;
|
|
68
|
+
actions: Array<{
|
|
69
|
+
id: string;
|
|
70
|
+
sourceInstanceKey: string;
|
|
71
|
+
operationId: string;
|
|
72
|
+
description: string;
|
|
73
|
+
}>;
|
|
74
|
+
memoryText: string;
|
|
75
|
+
guidance?: MemoryViewGuidance;
|
|
76
|
+
diagnostics: string[];
|
|
77
|
+
}
|
|
78
|
+
export interface MemoryViewDashboard {
|
|
79
|
+
revision: string;
|
|
80
|
+
writable: boolean;
|
|
81
|
+
strategyTypeId: string;
|
|
82
|
+
entries: MemoryPluginEntryView[];
|
|
83
|
+
current?: MemoryViewInspection;
|
|
84
|
+
/** Durable activity observed after the frozen current View was compiled. */
|
|
85
|
+
activity?: TurnMemoryActivity;
|
|
86
|
+
currentUnavailable?: 'no-session' | 'unaligned' | 'not-generated';
|
|
87
|
+
sources: Array<{
|
|
88
|
+
sourceInstanceKey: string;
|
|
89
|
+
sourceTypeId: string;
|
|
90
|
+
packageName: string;
|
|
91
|
+
role: string;
|
|
92
|
+
label: string;
|
|
93
|
+
}>;
|
|
94
|
+
pluginInstallation: MemoryPluginInstallationEnvironment;
|
|
95
|
+
diagnostics: string[];
|
|
96
|
+
}
|
|
97
|
+
export interface MemoryViewConfigurationRequest {
|
|
98
|
+
expectedRevision: string;
|
|
99
|
+
strategyTypeId: string;
|
|
100
|
+
entries: Record<string, MemoryPluginPreference>;
|
|
101
|
+
}
|
|
102
|
+
export type MemoryPluginKind = 'source' | 'strategy';
|
|
103
|
+
export interface MemoryPluginInstallationEnvironment {
|
|
104
|
+
supported: boolean;
|
|
105
|
+
profileName?: string;
|
|
106
|
+
reason?: 'loader-unavailable' | 'profile-unavailable' | 'cli-unavailable';
|
|
107
|
+
suggestions: string[];
|
|
108
|
+
}
|
|
109
|
+
export interface MemoryPluginInspection {
|
|
110
|
+
packageName: string;
|
|
111
|
+
version: string;
|
|
112
|
+
kind: MemoryPluginKind;
|
|
113
|
+
description?: string;
|
|
114
|
+
mnemonPeerRange: string;
|
|
115
|
+
installed: boolean;
|
|
116
|
+
}
|
|
117
|
+
export interface MemoryPluginInstallResult {
|
|
118
|
+
packageName: string;
|
|
119
|
+
version: string;
|
|
120
|
+
profileName: string;
|
|
121
|
+
installed: true;
|
|
122
|
+
restartRequired: true;
|
|
123
|
+
}
|
package/lib/types/src/index.d.ts
CHANGED
|
@@ -1,21 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { createRuntimeGraph, LiveMnemonRuntime } from './live-runtime.ts';
|
|
4
|
-
import { MnemonLifecycle } from './lifecycle.ts';
|
|
5
|
-
import { createRunner } from './runner.ts';
|
|
6
|
-
import { RuntimeMemoryController } from './runtime-memory.ts';
|
|
7
|
-
import { MnemonService } from './service.ts';
|
|
8
|
-
import { MnemonSubagentCoordinator } from './subagent.ts';
|
|
9
|
-
import { StorageScopeInspector } from './storage-scope.ts';
|
|
10
|
-
import { MnemonPackManager } from './pack.ts';
|
|
11
|
-
import { VersionUpdateManager } from './version-updates.ts';
|
|
12
|
-
import { MemoryBoot, MemoryExtensionHost } from '../packages/extension-sdk/src/index.ts';
|
|
13
|
-
export { BALANCED_RECALL_QUALITY_POLICY, EXHAUSTIVE_RECALL_QUALITY_POLICY, RecallQualityPolicyRegistry, STRICT_RECALL_QUALITY_POLICY, recallQualityPolicies, registerRecallQualityPolicy, } from './recall-quality/index.ts';
|
|
14
|
-
export type { RecallQualityCandidate, RecallQualityDecision, RecallQualityPolicy, RecallQualityPolicyContext, } from './recall-quality/index.ts';
|
|
15
|
-
export declare const name = "dsh-mnemon";
|
|
16
|
-
export declare const provide: string[];
|
|
17
|
-
export declare const inject: string[];
|
|
18
|
-
export { Config, InteractionConfig, resolveConfig, resolveInteractionConfig, DocumentManager, LiveMnemonRuntime, MemoryBoot, MemoryExtensionHost, MnemonLifecycle, MnemonService, MnemonSubagentCoordinator, RuntimeMemoryController, StorageScopeInspector, MnemonPackManager, VersionUpdateManager, createRunner, createRuntimeGraph };
|
|
19
|
-
export type { MnemonConfig };
|
|
20
|
-
/** Mount native model tools on every DSH surface and UI RPC only when Web connection exists. */
|
|
21
|
-
export declare function apply(rawContext: unknown, config?: MnemonConfig): void;
|
|
1
|
+
export { name, inject, provide, Config, apply } from './host/plugin.ts';
|
|
2
|
+
export type { MnemonConfig } from './host/plugin.ts';
|