dsh-mnemon 0.1.5 → 0.2.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 +125 -104
- package/README.zh-CN.md +130 -109
- package/THIRD_PARTY_NOTICES.md +7 -0
- package/lib/client.js +4193 -1128
- package/lib/index.js +4326 -307
- package/lib/types/activity.d.ts +2 -18
- package/lib/types/channels.d.ts +1 -4
- package/lib/types/client/GlobalLocationSetting.d.ts +19 -0
- package/lib/types/client/MnemonLogo.d.ts +0 -1
- package/lib/types/client/MnemonPackSection.d.ts +5 -3
- package/lib/types/client/MnemonSaveAction.d.ts +1 -2
- package/lib/types/client/MnemonSettingsCard.d.ts +5 -4
- 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/ProviderIcon.d.ts +8 -0
- package/lib/types/client/ProviderSettingsSection.d.ts +16 -0
- package/lib/types/client/anchor.d.ts +0 -1
- package/lib/types/client/api.d.ts +12 -19
- 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 +552 -1
- package/lib/types/client/settings.d.ts +4 -3
- 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 +38 -62
- 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 +32 -47
- package/lib/types/live-runtime.d.ts +0 -1
- package/lib/types/memory-bodies.d.ts +27 -23
- package/lib/types/pack.d.ts +2 -48
- package/lib/types/process.d.ts +4 -2
- 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/review-activity.d.ts +2 -16
- package/lib/types/rpc.d.ts +1 -2
- package/lib/types/runner.d.ts +15 -11
- package/lib/types/runtime-memory.d.ts +2 -59
- package/lib/types/service.d.ts +54 -152
- package/lib/types/settings.d.ts +1 -4
- package/lib/types/shared/contracts.d.ts +869 -0
- package/lib/types/storage-scope.d.ts +2 -29
- package/lib/types/subagent.d.ts +11 -16
- package/lib/types/tools.d.ts +0 -1
- package/lib/types/version-updates.d.ts +2 -29
- package/package.json +22 -9
- 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,869 @@
|
|
|
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
|
+
/** 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[];
|
|
134
|
+
}
|
|
135
|
+
export interface InteractionConfig {
|
|
136
|
+
turnBar?: boolean;
|
|
137
|
+
saveAction?: boolean;
|
|
138
|
+
}
|
|
139
|
+
export interface ResolvedConfig {
|
|
140
|
+
storageScope: StorageScopeKind;
|
|
141
|
+
cliPath?: string;
|
|
142
|
+
dataDir?: string;
|
|
143
|
+
store?: string;
|
|
144
|
+
timeoutMs: number;
|
|
145
|
+
defaultRecallLimit: number;
|
|
146
|
+
routingGuidance: boolean;
|
|
147
|
+
displayMode: 'sidebar' | 'buildin';
|
|
148
|
+
tabEnabled: boolean;
|
|
149
|
+
writeEnabled: boolean;
|
|
150
|
+
lifecycleEnabled: boolean;
|
|
151
|
+
recallMode: 'guided' | 'off';
|
|
152
|
+
writebackMode: 'guided' | 'off';
|
|
153
|
+
idleReviewMs: number;
|
|
154
|
+
conversationInteraction: {
|
|
155
|
+
toolviews: boolean;
|
|
156
|
+
turnBar: boolean;
|
|
157
|
+
saveAction: boolean;
|
|
158
|
+
};
|
|
159
|
+
persistenceStrategy: ResolvedMemoryPersistenceStrategy;
|
|
160
|
+
taskAgentModel: ResolvedTaskAgentModelConfig;
|
|
161
|
+
}
|
|
162
|
+
export interface ResolvedInteractionConfig {
|
|
163
|
+
turnBar: boolean;
|
|
164
|
+
saveAction: boolean;
|
|
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
|
+
}
|
|
312
|
+
export interface MemoryBody {
|
|
313
|
+
id: string;
|
|
314
|
+
name: string;
|
|
315
|
+
description: string;
|
|
316
|
+
active: boolean;
|
|
317
|
+
dbPath: string;
|
|
318
|
+
provider: MemoryBodyProvider;
|
|
319
|
+
placement?: MemoryPlacementDecision;
|
|
320
|
+
createdAt: string;
|
|
321
|
+
updatedAt: string;
|
|
322
|
+
}
|
|
323
|
+
export interface CreateMemoryBodyRequest {
|
|
324
|
+
name: string;
|
|
325
|
+
description: string;
|
|
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;
|
|
333
|
+
}
|
|
334
|
+
export interface UpdateMemoryBodyRequest {
|
|
335
|
+
name?: string;
|
|
336
|
+
description?: string;
|
|
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[];
|
|
355
|
+
}
|
|
356
|
+
export type Category = 'preference' | 'decision' | 'fact' | 'insight' | 'context' | 'general';
|
|
357
|
+
export declare const CATEGORIES: readonly ["preference", "decision", "fact", "insight", "context", "general"];
|
|
358
|
+
export type Source = 'user' | 'agent' | 'external';
|
|
359
|
+
export declare const SOURCES: readonly ["user", "agent", "external"];
|
|
360
|
+
export type EdgeType = 'temporal' | 'semantic' | 'causal' | 'entity';
|
|
361
|
+
export declare const EDGE_TYPES: readonly ["temporal", "semantic", "causal", "entity"];
|
|
362
|
+
export type Intent = 'WHY' | 'WHEN' | 'ENTITY' | 'GENERAL';
|
|
363
|
+
export declare const INTENTS: readonly ["WHY", "WHEN", "ENTITY", "GENERAL"];
|
|
364
|
+
export interface Insight {
|
|
365
|
+
id: string;
|
|
366
|
+
content: string;
|
|
367
|
+
category?: string;
|
|
368
|
+
importance?: number;
|
|
369
|
+
tags?: string[];
|
|
370
|
+
entities?: string[];
|
|
371
|
+
source?: string;
|
|
372
|
+
score?: number;
|
|
373
|
+
/** Comparable rank score only when results were fused across providers. */
|
|
374
|
+
federatedScore?: number;
|
|
375
|
+
confidence?: string;
|
|
376
|
+
intent?: string;
|
|
377
|
+
matchedVia?: string;
|
|
378
|
+
createdAt?: string;
|
|
379
|
+
depth?: number;
|
|
380
|
+
edgeType?: string;
|
|
381
|
+
memoryBodyId?: string;
|
|
382
|
+
memoryBodyName?: string;
|
|
383
|
+
memoryProviderId?: MemoryProviderId;
|
|
384
|
+
/** Owning Provider capabilities at read time; safe to expose to clients. */
|
|
385
|
+
memoryCapabilities?: MemoryProviderCapabilities;
|
|
386
|
+
externalUri?: string;
|
|
387
|
+
}
|
|
388
|
+
export interface SearchRequest {
|
|
389
|
+
query: string;
|
|
390
|
+
mode?: 'smart' | 'keyword' | 'basic';
|
|
391
|
+
limit?: number;
|
|
392
|
+
category?: Category;
|
|
393
|
+
source?: Source;
|
|
394
|
+
intent?: Intent;
|
|
395
|
+
memoryBodyIds?: string[];
|
|
396
|
+
}
|
|
397
|
+
export interface RememberRequest {
|
|
398
|
+
content: string;
|
|
399
|
+
category?: Category;
|
|
400
|
+
importance?: number;
|
|
401
|
+
tags?: string[];
|
|
402
|
+
entities?: string[];
|
|
403
|
+
source?: Source;
|
|
404
|
+
memoryBodyId?: string;
|
|
405
|
+
}
|
|
406
|
+
export interface MemoryBodyStats {
|
|
407
|
+
totalInsights: number;
|
|
408
|
+
deletedInsights: number;
|
|
409
|
+
edgeCount: number;
|
|
410
|
+
oplogCount: number;
|
|
411
|
+
dbSizeBytes: number;
|
|
412
|
+
byCategory: Record<string, number>;
|
|
413
|
+
topEntities: Array<{
|
|
414
|
+
entity: string;
|
|
415
|
+
count: number;
|
|
416
|
+
}>;
|
|
417
|
+
}
|
|
418
|
+
export interface MemoryBodyView extends MemoryBody {
|
|
419
|
+
/** True when Mnemon's persisted active-file selection points to this Store. */
|
|
420
|
+
mnemonDefault: boolean;
|
|
421
|
+
/** False when an external provider is disabled while its Memory Space registration remains preserved. */
|
|
422
|
+
providerEnabled?: boolean;
|
|
423
|
+
healthy: boolean;
|
|
424
|
+
/** A fast directory response is visible while provider health resolves independently. */
|
|
425
|
+
statusLoading?: boolean;
|
|
426
|
+
error?: string;
|
|
427
|
+
stats?: MemoryBodyStats;
|
|
428
|
+
}
|
|
429
|
+
export interface MemoryBodyCatalog {
|
|
430
|
+
items: MemoryBodyView[];
|
|
431
|
+
providers: MemoryProviderDescriptor[];
|
|
432
|
+
/** Sanitized policy exposed to memory workers; provider connection values are never included. */
|
|
433
|
+
persistenceStrategy?: Omit<ResolvedMemoryPersistenceStrategy, 'providerConnections'>;
|
|
434
|
+
total: number;
|
|
435
|
+
activeCount: number;
|
|
436
|
+
directory: string;
|
|
437
|
+
generatedAt: string;
|
|
438
|
+
}
|
|
439
|
+
export interface MemoryGraphNode extends Insight {
|
|
440
|
+
color: string;
|
|
441
|
+
graphId?: string;
|
|
442
|
+
kind?: 'memory' | 'entity' | 'space';
|
|
443
|
+
memoryBodyIds?: string[];
|
|
444
|
+
memoryBodyNames?: string[];
|
|
445
|
+
occurrenceCount?: number;
|
|
446
|
+
}
|
|
447
|
+
export interface MemoryGraphEdge {
|
|
448
|
+
sourceId: string;
|
|
449
|
+
targetId: string;
|
|
450
|
+
label: string;
|
|
451
|
+
color: string;
|
|
452
|
+
type?: EdgeType | 'scope';
|
|
453
|
+
}
|
|
454
|
+
export interface MemoryGraphSnapshot {
|
|
455
|
+
nodes: MemoryGraphNode[];
|
|
456
|
+
edges: MemoryGraphEdge[];
|
|
457
|
+
generatedAt: string;
|
|
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;
|
|
482
|
+
}
|
|
483
|
+
export interface MemoryListRequest {
|
|
484
|
+
query?: string;
|
|
485
|
+
category?: Category;
|
|
486
|
+
limit?: number;
|
|
487
|
+
memoryBodyIds?: string[];
|
|
488
|
+
}
|
|
489
|
+
export interface MemoryListView {
|
|
490
|
+
items: MemoryGraphNode[];
|
|
491
|
+
total: number;
|
|
492
|
+
generatedAt: string;
|
|
493
|
+
/** Omitted only when talking to a pre-provider-aware Host. */
|
|
494
|
+
sources?: MemoryReadSource[];
|
|
495
|
+
}
|
|
496
|
+
export interface EntityView {
|
|
497
|
+
items: Array<{
|
|
498
|
+
entity: string;
|
|
499
|
+
count: number;
|
|
500
|
+
}>;
|
|
501
|
+
insights: Insight[];
|
|
502
|
+
selected?: string;
|
|
503
|
+
/** Omitted only when talking to a pre-provider-aware Host. */
|
|
504
|
+
sources?: MemoryReadSource[];
|
|
505
|
+
}
|
|
506
|
+
export type DocumentStatus = 'active' | 'archived';
|
|
507
|
+
export interface DocumentRecord {
|
|
508
|
+
id: string;
|
|
509
|
+
title: string;
|
|
510
|
+
description: string;
|
|
511
|
+
status: DocumentStatus;
|
|
512
|
+
filename: string;
|
|
513
|
+
relativePath: string;
|
|
514
|
+
sourcePaths: string[];
|
|
515
|
+
sessionIds: string[];
|
|
516
|
+
createdAt: string;
|
|
517
|
+
updatedAt: string;
|
|
518
|
+
lastAccessedAt: string;
|
|
519
|
+
revision: number;
|
|
520
|
+
contentHash: string;
|
|
521
|
+
sizeBytes: number;
|
|
522
|
+
archivedAt?: string;
|
|
523
|
+
archiveSummary?: string;
|
|
524
|
+
memoryBodyIds: string[];
|
|
525
|
+
}
|
|
526
|
+
export interface DocumentView extends DocumentRecord {
|
|
527
|
+
content: string;
|
|
528
|
+
}
|
|
529
|
+
export interface DocumentSnapshot {
|
|
530
|
+
workspaceRoot: string;
|
|
531
|
+
directory: string;
|
|
532
|
+
indexPath: string;
|
|
533
|
+
generatedAt: string;
|
|
534
|
+
revision: string;
|
|
535
|
+
limitBytes: number;
|
|
536
|
+
activeBytes: number;
|
|
537
|
+
activeCount: number;
|
|
538
|
+
archivedCount: number;
|
|
539
|
+
total: number;
|
|
540
|
+
documents: Array<DocumentRecord & {
|
|
541
|
+
healthy: boolean;
|
|
542
|
+
excerpt: string;
|
|
543
|
+
}>;
|
|
544
|
+
}
|
|
545
|
+
export interface DocumentSearchResult {
|
|
546
|
+
query: string;
|
|
547
|
+
includeArchived: boolean;
|
|
548
|
+
total: number;
|
|
549
|
+
generatedAt: string;
|
|
550
|
+
results: Array<DocumentView & {
|
|
551
|
+
score: number;
|
|
552
|
+
excerpt: string;
|
|
553
|
+
}>;
|
|
554
|
+
}
|
|
555
|
+
export type DocumentMutation = {
|
|
556
|
+
action: 'create';
|
|
557
|
+
title: string;
|
|
558
|
+
description?: string;
|
|
559
|
+
content: string;
|
|
560
|
+
sourcePaths?: string[];
|
|
561
|
+
sessionIds?: string[];
|
|
562
|
+
} | {
|
|
563
|
+
action: 'update';
|
|
564
|
+
id: string;
|
|
565
|
+
title?: string;
|
|
566
|
+
description?: string;
|
|
567
|
+
content?: string;
|
|
568
|
+
sourcePaths?: string[];
|
|
569
|
+
sessionIds?: string[];
|
|
570
|
+
};
|
|
571
|
+
export interface DocumentMutationResult {
|
|
572
|
+
success: true;
|
|
573
|
+
action: 'created' | 'updated' | 'archived';
|
|
574
|
+
document: DocumentView;
|
|
575
|
+
snapshot: DocumentSnapshot;
|
|
576
|
+
maintenance?: {
|
|
577
|
+
runId: string;
|
|
578
|
+
provider: string;
|
|
579
|
+
summary: string;
|
|
580
|
+
memoryBodyIds: string[];
|
|
581
|
+
archivedDocumentIds: string[];
|
|
582
|
+
};
|
|
583
|
+
}
|
|
584
|
+
export type RuntimeMemoryTarget = 'memory' | 'user';
|
|
585
|
+
export type RuntimeMemoryImportance = 'critical' | 'normal' | 'low';
|
|
586
|
+
export type RuntimeMemoryAction = 'add' | 'replace' | 'remove';
|
|
587
|
+
export interface RuntimeMemoryEntry {
|
|
588
|
+
content: string;
|
|
589
|
+
created_at: string;
|
|
590
|
+
updated_at: string;
|
|
591
|
+
target: RuntimeMemoryTarget;
|
|
592
|
+
importance: RuntimeMemoryImportance;
|
|
593
|
+
}
|
|
594
|
+
export interface RuntimeMemoryUsage {
|
|
595
|
+
used: number;
|
|
596
|
+
limit: number;
|
|
597
|
+
}
|
|
598
|
+
export interface RuntimeMemoryTargetView extends RuntimeMemoryUsage {
|
|
599
|
+
target: RuntimeMemoryTarget;
|
|
600
|
+
entryCount: number;
|
|
601
|
+
markdownPath: string;
|
|
602
|
+
}
|
|
603
|
+
export interface RuntimeMemorySnapshot {
|
|
604
|
+
directory: string;
|
|
605
|
+
sourcePath: string;
|
|
606
|
+
revision: string;
|
|
607
|
+
generatedAt: string;
|
|
608
|
+
entries: RuntimeMemoryEntry[];
|
|
609
|
+
targets: Record<RuntimeMemoryTarget, RuntimeMemoryTargetView>;
|
|
610
|
+
}
|
|
611
|
+
export interface RuntimeMemoryCompactedEntry {
|
|
612
|
+
content: string;
|
|
613
|
+
importance: RuntimeMemoryImportance;
|
|
614
|
+
}
|
|
615
|
+
export interface RuntimeMemoryMutation {
|
|
616
|
+
action: RuntimeMemoryAction;
|
|
617
|
+
target: RuntimeMemoryTarget;
|
|
618
|
+
content?: string;
|
|
619
|
+
oldText?: string;
|
|
620
|
+
importance?: RuntimeMemoryImportance;
|
|
621
|
+
}
|
|
622
|
+
export type RuntimeMemoryMutationResult = {
|
|
623
|
+
success: true;
|
|
624
|
+
message: string;
|
|
625
|
+
target: RuntimeMemoryTarget;
|
|
626
|
+
entryCount: number;
|
|
627
|
+
usage: RuntimeMemoryUsage;
|
|
628
|
+
added?: string;
|
|
629
|
+
replaced?: {
|
|
630
|
+
from: string;
|
|
631
|
+
to: string;
|
|
632
|
+
};
|
|
633
|
+
removed?: string;
|
|
634
|
+
maintenance?: {
|
|
635
|
+
kind: 'local-compaction' | 'mnemon-archive';
|
|
636
|
+
runId: string;
|
|
637
|
+
provider: string;
|
|
638
|
+
summary: string;
|
|
639
|
+
memoryBodyIds: string[];
|
|
640
|
+
};
|
|
641
|
+
};
|
|
642
|
+
export interface TurnMemoryActivity {
|
|
643
|
+
turn: number;
|
|
644
|
+
count: number;
|
|
645
|
+
names: string[];
|
|
646
|
+
recalls: number;
|
|
647
|
+
writes: number;
|
|
648
|
+
documentSearches: number;
|
|
649
|
+
inspections: number;
|
|
650
|
+
failures: number;
|
|
651
|
+
}
|
|
652
|
+
export interface TurnMemoryActivitySnapshot {
|
|
653
|
+
cursor: number;
|
|
654
|
+
activities: TurnMemoryActivity[];
|
|
655
|
+
}
|
|
656
|
+
export interface AssistantMessageText {
|
|
657
|
+
messageId: string;
|
|
658
|
+
text: string;
|
|
659
|
+
}
|
|
660
|
+
export type StorageAreaKind = 'runtime' | 'memory-bodies' | 'documents' | 'state';
|
|
661
|
+
export type StorageAreaStatus = 'ready' | 'empty' | 'missing' | 'invalid';
|
|
662
|
+
export interface StorageAreaInventory {
|
|
663
|
+
kind: StorageAreaKind;
|
|
664
|
+
path: string;
|
|
665
|
+
status: StorageAreaStatus;
|
|
666
|
+
bytes: number;
|
|
667
|
+
itemCount: number;
|
|
668
|
+
details: Record<string, number | string | boolean>;
|
|
669
|
+
issue?: string;
|
|
670
|
+
}
|
|
671
|
+
export interface StorageScopeInventory {
|
|
672
|
+
kind: StorageScopeKind;
|
|
673
|
+
root?: string;
|
|
674
|
+
configured: boolean;
|
|
675
|
+
active: boolean;
|
|
676
|
+
available: boolean;
|
|
677
|
+
totalBytes: number;
|
|
678
|
+
areas: StorageAreaInventory[];
|
|
679
|
+
issue?: string;
|
|
680
|
+
}
|
|
681
|
+
export interface StorageScopeCatalog {
|
|
682
|
+
activeKind: StorageScopeKind;
|
|
683
|
+
activeRoot: string;
|
|
684
|
+
scopes: StorageScopeInventory[];
|
|
685
|
+
generatedAt: string;
|
|
686
|
+
}
|
|
687
|
+
export interface ReviewActivity {
|
|
688
|
+
totalUserTextLength: number;
|
|
689
|
+
turnCount: number;
|
|
690
|
+
toolCallCount: number;
|
|
691
|
+
uniqueToolCount: number;
|
|
692
|
+
}
|
|
693
|
+
export interface ReviewActivityScore extends ReviewActivity {
|
|
694
|
+
textLengthScore: number;
|
|
695
|
+
turnScore: number;
|
|
696
|
+
toolCallScore: number;
|
|
697
|
+
toolDiversityScore: number;
|
|
698
|
+
score: number;
|
|
699
|
+
threshold: number;
|
|
700
|
+
eligible: boolean;
|
|
701
|
+
}
|
|
702
|
+
export interface SubagentCounters {
|
|
703
|
+
recalls: number;
|
|
704
|
+
writes: number;
|
|
705
|
+
answers: number;
|
|
706
|
+
reviews: number;
|
|
707
|
+
placements: number;
|
|
708
|
+
migrations: number;
|
|
709
|
+
compactions: number;
|
|
710
|
+
documentArchives: number;
|
|
711
|
+
metadataMaintenances: number;
|
|
712
|
+
failures: number;
|
|
713
|
+
lastRunId?: string;
|
|
714
|
+
lastOperation?: 'recall' | 'write' | 'review' | 'placement' | 'migration' | 'compaction' | 'document-archive' | 'metadata-maintenance';
|
|
715
|
+
lastAt?: string;
|
|
716
|
+
}
|
|
717
|
+
export type LifecyclePhase = 'idle' | 'prime' | 'recall' | 'writeback' | 'review' | 'supervised' | 'error';
|
|
718
|
+
export interface LifecycleCounters {
|
|
719
|
+
primes: number;
|
|
720
|
+
recallCues: number;
|
|
721
|
+
writebackCues: number;
|
|
722
|
+
supervisedRequests: number;
|
|
723
|
+
failures: number;
|
|
724
|
+
}
|
|
725
|
+
export interface LifecycleAgentSnapshot {
|
|
726
|
+
sessionId: string;
|
|
727
|
+
status: 'idle' | 'running';
|
|
728
|
+
startSource: 'startup' | 'resume' | 'clear' | 'compact' | 'adopted';
|
|
729
|
+
primePending: boolean;
|
|
730
|
+
guidedTurns: number;
|
|
731
|
+
memoryToolCalls: number;
|
|
732
|
+
idleReviewPending: boolean;
|
|
733
|
+
reviewRunning: boolean;
|
|
734
|
+
reviewActivity: ReviewActivityScore;
|
|
735
|
+
lastPhase: LifecyclePhase;
|
|
736
|
+
lastReviewAt?: string;
|
|
737
|
+
lastReviewAction?: string;
|
|
738
|
+
lastReviewScore?: number;
|
|
739
|
+
lastReviewDocumentIds?: string[];
|
|
740
|
+
lastAt?: string;
|
|
741
|
+
lastError?: string;
|
|
742
|
+
}
|
|
743
|
+
export interface LifecycleSnapshot {
|
|
744
|
+
enabled: boolean;
|
|
745
|
+
recallMode: 'guided' | 'off';
|
|
746
|
+
writebackMode: 'guided' | 'off';
|
|
747
|
+
idleReviewMs: number;
|
|
748
|
+
activeAgents: number;
|
|
749
|
+
sessionAvailable: boolean;
|
|
750
|
+
/** A session-independent task Agent can be created for WebUI maintenance. */
|
|
751
|
+
taskAgentAvailable: boolean;
|
|
752
|
+
counters: LifecycleCounters;
|
|
753
|
+
subagents: SubagentCounters;
|
|
754
|
+
current?: LifecycleAgentSnapshot;
|
|
755
|
+
}
|
|
756
|
+
export interface StatusView {
|
|
757
|
+
healthy: boolean;
|
|
758
|
+
error?: string;
|
|
759
|
+
version?: string;
|
|
760
|
+
dshMnemonVersion?: string;
|
|
761
|
+
cliPath: string;
|
|
762
|
+
commandFound: boolean;
|
|
763
|
+
dataDir: string;
|
|
764
|
+
/** Legacy comma-separated DSH-enabled Store list. */
|
|
765
|
+
store: string;
|
|
766
|
+
mnemonDefaultStore: string;
|
|
767
|
+
dshActiveStores: string[];
|
|
768
|
+
writeEnabled: boolean;
|
|
769
|
+
timeoutMs: number;
|
|
770
|
+
defaultRecallLimit: number;
|
|
771
|
+
memoryBodyDirectory: string;
|
|
772
|
+
memoryBodies: MemoryBodyView[];
|
|
773
|
+
providerServices?: MemoryProviderRuntimeStatus[];
|
|
774
|
+
lifecycle?: LifecycleSnapshot;
|
|
775
|
+
documents?: DocumentSnapshot;
|
|
776
|
+
storage?: StorageScopeCatalog;
|
|
777
|
+
workspaceContext?: {
|
|
778
|
+
mode: StorageScopeKind;
|
|
779
|
+
selectedRoot: string;
|
|
780
|
+
effectiveRoot: string;
|
|
781
|
+
aligned: boolean;
|
|
782
|
+
selectedWorkspace?: {
|
|
783
|
+
id: string;
|
|
784
|
+
title: string;
|
|
785
|
+
path: string;
|
|
786
|
+
};
|
|
787
|
+
effectiveWorkspace?: {
|
|
788
|
+
id: string;
|
|
789
|
+
title: string;
|
|
790
|
+
path: string;
|
|
791
|
+
};
|
|
792
|
+
};
|
|
793
|
+
stats?: MemoryBodyStats & {
|
|
794
|
+
dbPath?: string;
|
|
795
|
+
};
|
|
796
|
+
}
|
|
797
|
+
export type MnemonPackComponent = 'runtime' | 'documents' | 'memory-spaces';
|
|
798
|
+
export type MnemonPackScope = 'full' | MnemonPackComponent;
|
|
799
|
+
export type MnemonPackImportMode = 'merge' | 'replace';
|
|
800
|
+
export interface MnemonPackComponentSummary {
|
|
801
|
+
component: MnemonPackComponent;
|
|
802
|
+
files: number;
|
|
803
|
+
bytes: number;
|
|
804
|
+
items: number;
|
|
805
|
+
}
|
|
806
|
+
export interface MnemonPackManifest {
|
|
807
|
+
format: 'mnemonpack';
|
|
808
|
+
version: 1;
|
|
809
|
+
scope: MnemonPackScope;
|
|
810
|
+
exportedAt: string;
|
|
811
|
+
source: {
|
|
812
|
+
plugin: 'dsh-mnemon';
|
|
813
|
+
pluginVersion: string;
|
|
814
|
+
};
|
|
815
|
+
components: MnemonPackComponent[];
|
|
816
|
+
summary: MnemonPackComponentSummary[];
|
|
817
|
+
}
|
|
818
|
+
export interface MnemonPackExport {
|
|
819
|
+
fileName: string;
|
|
820
|
+
mimeType: 'application/zip';
|
|
821
|
+
bytes: number;
|
|
822
|
+
base64: string;
|
|
823
|
+
targetRoot: string;
|
|
824
|
+
manifest: MnemonPackManifest;
|
|
825
|
+
}
|
|
826
|
+
export interface MnemonPackPreview {
|
|
827
|
+
fileName?: string;
|
|
828
|
+
archiveBytes: number;
|
|
829
|
+
expandedBytes: number;
|
|
830
|
+
targetRoot: string;
|
|
831
|
+
targetScope: StorageScopeKind;
|
|
832
|
+
manifest: MnemonPackManifest;
|
|
833
|
+
occupied: Record<MnemonPackComponent, boolean>;
|
|
834
|
+
}
|
|
835
|
+
export interface MnemonPackImportResult {
|
|
836
|
+
imported: true;
|
|
837
|
+
mode: MnemonPackImportMode;
|
|
838
|
+
targetRoot: string;
|
|
839
|
+
components: MnemonPackComponent[];
|
|
840
|
+
summary: MnemonPackComponentSummary[];
|
|
841
|
+
}
|
|
842
|
+
export type VersionComponentId = 'mnemon' | 'dsh-mnemon';
|
|
843
|
+
export type VersionInstallMode = 'homebrew' | 'go' | 'npm' | 'link' | 'manual' | 'missing';
|
|
844
|
+
export interface VersionComponentStatus {
|
|
845
|
+
id: VersionComponentId;
|
|
846
|
+
name: string;
|
|
847
|
+
executablePath?: string;
|
|
848
|
+
installPath?: string;
|
|
849
|
+
installProfile?: string;
|
|
850
|
+
current?: string;
|
|
851
|
+
latest?: string;
|
|
852
|
+
outdated: boolean;
|
|
853
|
+
installMode: VersionInstallMode;
|
|
854
|
+
updateSupported: boolean;
|
|
855
|
+
updateHint: string;
|
|
856
|
+
checkError?: string;
|
|
857
|
+
}
|
|
858
|
+
export interface VersionStatus {
|
|
859
|
+
checkedAt: string;
|
|
860
|
+
components: VersionComponentStatus[];
|
|
861
|
+
}
|
|
862
|
+
export interface VersionUpdateResult {
|
|
863
|
+
component: VersionComponentId;
|
|
864
|
+
previousVersion?: string;
|
|
865
|
+
currentVersion?: string;
|
|
866
|
+
updated: boolean;
|
|
867
|
+
restartRequired: boolean;
|
|
868
|
+
output?: string;
|
|
869
|
+
}
|