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
|
@@ -1,1008 +0,0 @@
|
|
|
1
|
-
import type { ConnectionHandle as DshClientConnectionHandle } from '@deepseek-ai/dsh-client-connection/client';
|
|
2
|
-
import type { MemoryLayerParticipation, MemorySystemDescriptor } from '../memory-system/contracts.ts';
|
|
3
|
-
export type { MemoryLayerParticipation, MemoryParticipationChannel, MemoryParticipationMode, MemorySystemDescriptor, MemoryTopologyDefinition, } from '../memory-system/contracts.ts';
|
|
4
|
-
export declare const MNEMON_READ_CHANNEL = "/dsh-mnemon-read";
|
|
5
|
-
export declare const MNEMON_ACTIVATION_CHANNEL = "/dsh-mnemon-activation";
|
|
6
|
-
export declare const MNEMON_WRITE_CHANNEL = "/dsh-mnemon-write";
|
|
7
|
-
export declare const MNEMON_PACK_CHANNEL = "/dsh-mnemon-pack";
|
|
8
|
-
export declare const MNEMON_SETTINGS_CHANNEL = "/dsh-mnemon-settings";
|
|
9
|
-
export declare const MNEMON_SETTINGS_NAMESPACE = "mnemon";
|
|
10
|
-
export declare const MNEMON_UI_SETTINGS_NAMESPACE = "mnemon-ui";
|
|
11
|
-
export declare const DEFAULT_EMBEDDING_ENDPOINT = "http://localhost:11434";
|
|
12
|
-
export declare const DEFAULT_EMBEDDING_MODEL = "nomic-embed-text";
|
|
13
|
-
export declare const EMBEDDING_PROTOCOL_AUTO = "auto";
|
|
14
|
-
export declare const EMBEDDING_PROTOCOL_OLLAMA = "ollama";
|
|
15
|
-
export declare const EMBEDDING_PROTOCOL_OPENAI = "openai";
|
|
16
|
-
/** Default protocol defers to Mnemon's /v1 auto-detection. */
|
|
17
|
-
export declare const DEFAULT_EMBEDDING_PROTOCOL = "auto";
|
|
18
|
-
/** Wire protocols accepted by the embedding protocol override; single source for schema, resolver, and UI validation. */
|
|
19
|
-
export declare const MNEMON_EMBEDDING_PROTOCOLS: readonly ["auto", "ollama", "openai"];
|
|
20
|
-
export type JsonPrimitive = string | number | boolean | null;
|
|
21
|
-
export type JsonValue = JsonPrimitive | JsonValue[] | {
|
|
22
|
-
[key: string]: JsonValue;
|
|
23
|
-
};
|
|
24
|
-
export type RpcError = {
|
|
25
|
-
code: 'bad-request';
|
|
26
|
-
message: string;
|
|
27
|
-
details: {
|
|
28
|
-
issues: JsonValue[];
|
|
29
|
-
};
|
|
30
|
-
} | {
|
|
31
|
-
code: 'settings-rejected';
|
|
32
|
-
message: string;
|
|
33
|
-
details: {
|
|
34
|
-
ns: string;
|
|
35
|
-
};
|
|
36
|
-
} | {
|
|
37
|
-
code: 'internal';
|
|
38
|
-
message: string;
|
|
39
|
-
details: Record<string, never>;
|
|
40
|
-
};
|
|
41
|
-
export type RpcResult<T = JsonValue> = {
|
|
42
|
-
ok: true;
|
|
43
|
-
value: T;
|
|
44
|
-
} | {
|
|
45
|
-
ok: false;
|
|
46
|
-
error: RpcError;
|
|
47
|
-
};
|
|
48
|
-
/** Public DSH browser RPC face plus the transport boundary needed to gate local-only writes. */
|
|
49
|
-
export type ClientConnectionHandle = Pick<DshClientConnectionHandle, 'rpc'> & Partial<Pick<DshClientConnectionHandle, 'isLoopback'>>;
|
|
50
|
-
export interface ClientSettingsSnapshot<T> {
|
|
51
|
-
status: 'loading' | 'ready' | 'unavailable';
|
|
52
|
-
value?: T;
|
|
53
|
-
base?: unknown;
|
|
54
|
-
user?: unknown;
|
|
55
|
-
revision?: number;
|
|
56
|
-
writable: boolean;
|
|
57
|
-
mode: 'host' | 'memory';
|
|
58
|
-
}
|
|
59
|
-
export interface ClientSettingsScope<T> {
|
|
60
|
-
getSnapshot(): ClientSettingsSnapshot<T>;
|
|
61
|
-
subscribe(listener: () => void): () => void;
|
|
62
|
-
set(field: string, value: unknown): Promise<void>;
|
|
63
|
-
unset(field: string): Promise<void>;
|
|
64
|
-
setPath(path: string[], value: unknown): Promise<void>;
|
|
65
|
-
unsetPath(path: string[]): Promise<void>;
|
|
66
|
-
mutate?(ops: SettingsOperation[]): Promise<void>;
|
|
67
|
-
}
|
|
68
|
-
export type SettingsOperation = {
|
|
69
|
-
op: 'set';
|
|
70
|
-
path: string[];
|
|
71
|
-
value: unknown;
|
|
72
|
-
} | {
|
|
73
|
-
op: 'unset';
|
|
74
|
-
path: string[];
|
|
75
|
-
};
|
|
76
|
-
export type StorageScopeKind = 'global' | 'workspace' | 'custom';
|
|
77
|
-
export interface MemoryLayerConfig {
|
|
78
|
-
enabled?: boolean;
|
|
79
|
-
participation?: Partial<MemoryLayerParticipation>;
|
|
80
|
-
adapterIds?: string[];
|
|
81
|
-
}
|
|
82
|
-
export interface MemoryTopologyConfig {
|
|
83
|
-
id?: string;
|
|
84
|
-
strategyId?: string;
|
|
85
|
-
layers?: Record<string, MemoryLayerConfig>;
|
|
86
|
-
}
|
|
87
|
-
export interface ResolvedMemoryLayerConfig {
|
|
88
|
-
enabled: boolean;
|
|
89
|
-
participation: MemoryLayerParticipation;
|
|
90
|
-
adapterIds: string[];
|
|
91
|
-
}
|
|
92
|
-
export interface ResolvedMemoryTopologyConfig {
|
|
93
|
-
id: string;
|
|
94
|
-
strategyId: string;
|
|
95
|
-
layers: Record<string, ResolvedMemoryLayerConfig>;
|
|
96
|
-
}
|
|
97
|
-
export interface CustomPackConfig {
|
|
98
|
-
id: string;
|
|
99
|
-
name: string;
|
|
100
|
-
dataDir: string;
|
|
101
|
-
}
|
|
102
|
-
export interface RecallQualityConfig {
|
|
103
|
-
/** Registered deterministic policy id. */
|
|
104
|
-
policy?: string;
|
|
105
|
-
lowScoreThreshold?: number;
|
|
106
|
-
highScoreThreshold?: number;
|
|
107
|
-
/** Provider candidate expansion before quality filtering, from 1 through 5. */
|
|
108
|
-
candidateMultiplier?: number;
|
|
109
|
-
/** Maximum medium-relevance rows admitted by the strict policy. */
|
|
110
|
-
maxMediumResults?: number;
|
|
111
|
-
/** Maximum unknown-scale or unscored rows admitted by the strict policy. */
|
|
112
|
-
maxUnknownResults?: number;
|
|
113
|
-
}
|
|
114
|
-
export interface RuntimeMemoryConfig {
|
|
115
|
-
/** Maximum UTF-8 bytes projected into MEMORY.md. */
|
|
116
|
-
memoryLimitBytes?: number;
|
|
117
|
-
/** Maximum UTF-8 bytes projected into USER.md. */
|
|
118
|
-
userLimitBytes?: number;
|
|
119
|
-
/** Completion-token budget for Runtime migration and compaction workers. */
|
|
120
|
-
maintenanceMaxTokens?: number;
|
|
121
|
-
}
|
|
122
|
-
export interface ResolvedRuntimeMemoryConfig {
|
|
123
|
-
memoryLimitBytes: number;
|
|
124
|
-
userLimitBytes: number;
|
|
125
|
-
maintenanceMaxTokens: number;
|
|
126
|
-
}
|
|
127
|
-
export interface ResolvedRecallQualityConfig {
|
|
128
|
-
policy: string;
|
|
129
|
-
lowScoreThreshold: number;
|
|
130
|
-
highScoreThreshold: number;
|
|
131
|
-
candidateMultiplier: number;
|
|
132
|
-
maxMediumResults: number;
|
|
133
|
-
maxUnknownResults: number;
|
|
134
|
-
}
|
|
135
|
-
export { normalizeDisplayMode } from './display-mode.ts';
|
|
136
|
-
export type MnemonDisplayMode = 'sidebar' | 'builtin';
|
|
137
|
-
export interface Config {
|
|
138
|
-
storageScope?: StorageScopeKind;
|
|
139
|
-
/** Whether USER.md follows the selected storage root or stays in the global root. */
|
|
140
|
-
runtimeUserScope?: 'storage' | 'global';
|
|
141
|
-
cliPath?: string;
|
|
142
|
-
dataDir?: string;
|
|
143
|
-
customPackId?: string;
|
|
144
|
-
customPacks?: CustomPackConfig[];
|
|
145
|
-
store?: string;
|
|
146
|
-
timeoutMs?: number;
|
|
147
|
-
defaultRecallLimit?: number;
|
|
148
|
-
runtimeMemory?: RuntimeMemoryConfig;
|
|
149
|
-
/** Optional DSH-owned overrides injected into every Mnemon CLI process. */
|
|
150
|
-
embedding?: MnemonEmbeddingConfig;
|
|
151
|
-
memoryTopology?: MemoryTopologyConfig;
|
|
152
|
-
recallQuality?: RecallQualityConfig;
|
|
153
|
-
routingGuidance?: boolean;
|
|
154
|
-
/** Entry placement only. Legacy `buildin` input is migrated to `builtin`. */
|
|
155
|
-
displayMode?: MnemonDisplayMode | 'buildin';
|
|
156
|
-
tabEnabled?: boolean;
|
|
157
|
-
writeEnabled?: boolean;
|
|
158
|
-
/** DSH rc.2 management-channel authority; ignored by DSH 0.1.2-alpha.1. */
|
|
159
|
-
remoteAccess?: 'read-only' | 'trusted-host';
|
|
160
|
-
lifecycleEnabled?: boolean;
|
|
161
|
-
recallMode?: 'guided' | 'off';
|
|
162
|
-
writebackMode?: 'guided' | 'off';
|
|
163
|
-
idleReviewMs?: number;
|
|
164
|
-
conversationInteraction?: {
|
|
165
|
-
toolviews?: boolean;
|
|
166
|
-
turnBar?: boolean;
|
|
167
|
-
saveAction?: boolean;
|
|
168
|
-
};
|
|
169
|
-
/** Provider policy used when an Agent must create a new Memory Space while distilling memory. */
|
|
170
|
-
persistenceStrategy?: MemoryPersistenceStrategy;
|
|
171
|
-
/** Model route used by clean, session-independent maintenance Agents. */
|
|
172
|
-
taskAgentModel?: TaskAgentModelConfig;
|
|
173
|
-
}
|
|
174
|
-
export type MnemonEmbeddingProtocol = (typeof MNEMON_EMBEDDING_PROTOCOLS)[number];
|
|
175
|
-
export interface MnemonEmbeddingConfig {
|
|
176
|
-
/** When false or omitted, Mnemon keeps its inherited environment and built-in defaults. */
|
|
177
|
-
enabled?: boolean;
|
|
178
|
-
endpoint?: string;
|
|
179
|
-
model?: string;
|
|
180
|
-
/** Optional Bearer token forwarded as MNEMON_EMBED_API_KEY for OpenAI-compatible endpoints. */
|
|
181
|
-
apiKey?: string;
|
|
182
|
-
/** Explicit wire-protocol override; 'auto' keeps Mnemon's /v1 auto-detection. */
|
|
183
|
-
protocol?: MnemonEmbeddingProtocol;
|
|
184
|
-
}
|
|
185
|
-
export interface ResolvedMnemonEmbeddingConfig {
|
|
186
|
-
enabled: boolean;
|
|
187
|
-
endpoint: string;
|
|
188
|
-
model: string;
|
|
189
|
-
apiKey: string;
|
|
190
|
-
protocol: MnemonEmbeddingProtocol;
|
|
191
|
-
}
|
|
192
|
-
export interface TaskAgentModelConfig {
|
|
193
|
-
mode?: 'inherit' | 'fixed';
|
|
194
|
-
provider?: string;
|
|
195
|
-
model?: string;
|
|
196
|
-
}
|
|
197
|
-
export interface ResolvedTaskAgentModelConfig {
|
|
198
|
-
mode: 'inherit' | 'fixed';
|
|
199
|
-
provider?: string;
|
|
200
|
-
model?: string;
|
|
201
|
-
}
|
|
202
|
-
export interface TaskAgentModelCatalogModel {
|
|
203
|
-
id: string;
|
|
204
|
-
name: string;
|
|
205
|
-
description?: string;
|
|
206
|
-
/** DSH's merge-extensible model modality ids; absent means capability is unknown. */
|
|
207
|
-
inputModalities?: string[];
|
|
208
|
-
}
|
|
209
|
-
export interface TaskAgentModelCatalogGroup {
|
|
210
|
-
id: string;
|
|
211
|
-
name: string;
|
|
212
|
-
models: TaskAgentModelCatalogModel[];
|
|
213
|
-
}
|
|
214
|
-
export interface TaskAgentModelCatalogFailure {
|
|
215
|
-
id: string;
|
|
216
|
-
name: string;
|
|
217
|
-
message: string;
|
|
218
|
-
}
|
|
219
|
-
export interface TaskAgentModelCatalog {
|
|
220
|
-
effective?: {
|
|
221
|
-
provider: string;
|
|
222
|
-
model: string;
|
|
223
|
-
source: 'fixed' | 'dsh-default' | 'active-agent';
|
|
224
|
-
};
|
|
225
|
-
defaultSelection?: {
|
|
226
|
-
provider: string;
|
|
227
|
-
model: string;
|
|
228
|
-
};
|
|
229
|
-
groups: TaskAgentModelCatalogGroup[];
|
|
230
|
-
failures: TaskAgentModelCatalogFailure[];
|
|
231
|
-
}
|
|
232
|
-
export interface InteractionConfig {
|
|
233
|
-
turnBar?: boolean;
|
|
234
|
-
saveAction?: boolean;
|
|
235
|
-
}
|
|
236
|
-
export interface ResolvedConfig {
|
|
237
|
-
storageScope: StorageScopeKind;
|
|
238
|
-
runtimeUserScope: 'storage' | 'global';
|
|
239
|
-
cliPath?: string;
|
|
240
|
-
dataDir?: string;
|
|
241
|
-
store?: string;
|
|
242
|
-
timeoutMs: number;
|
|
243
|
-
defaultRecallLimit: number;
|
|
244
|
-
runtimeMemory: ResolvedRuntimeMemoryConfig;
|
|
245
|
-
embedding: ResolvedMnemonEmbeddingConfig;
|
|
246
|
-
memoryTopology: ResolvedMemoryTopologyConfig;
|
|
247
|
-
recallQuality: ResolvedRecallQualityConfig;
|
|
248
|
-
routingGuidance: boolean;
|
|
249
|
-
displayMode: MnemonDisplayMode;
|
|
250
|
-
tabEnabled: boolean;
|
|
251
|
-
writeEnabled: boolean;
|
|
252
|
-
/** DSH rc.2 management-channel authority; ignored by DSH 0.1.2-alpha.1. */
|
|
253
|
-
remoteAccess: 'read-only' | 'trusted-host';
|
|
254
|
-
lifecycleEnabled: boolean;
|
|
255
|
-
recallMode: 'guided' | 'off';
|
|
256
|
-
writebackMode: 'guided' | 'off';
|
|
257
|
-
idleReviewMs: number;
|
|
258
|
-
conversationInteraction: {
|
|
259
|
-
toolviews: boolean;
|
|
260
|
-
turnBar: boolean;
|
|
261
|
-
saveAction: boolean;
|
|
262
|
-
};
|
|
263
|
-
persistenceStrategy: ResolvedMemoryPersistenceStrategy;
|
|
264
|
-
taskAgentModel: ResolvedTaskAgentModelConfig;
|
|
265
|
-
}
|
|
266
|
-
export interface MnemonEmbeddingStatus {
|
|
267
|
-
available: boolean;
|
|
268
|
-
model: string;
|
|
269
|
-
/** Protocol Mnemon resolved for the embedding endpoint; omitted when the CLI does not report one. */
|
|
270
|
-
protocol?: string;
|
|
271
|
-
totalInsights: number;
|
|
272
|
-
embedded: number;
|
|
273
|
-
coverage: string;
|
|
274
|
-
}
|
|
275
|
-
export interface ResolvedInteractionConfig {
|
|
276
|
-
turnBar: boolean;
|
|
277
|
-
saveAction: boolean;
|
|
278
|
-
}
|
|
279
|
-
export type MemoryProviderId = 'mnemon-native' | 'openviking' | 'honcho' | 'mem0' | 'hindsight' | 'holographic' | 'retaindb' | 'byterover' | 'supermemory';
|
|
280
|
-
export type MemoryProviderConnectionValue = string | number | boolean;
|
|
281
|
-
export type MemoryProviderConnection = Record<string, MemoryProviderConnectionValue>;
|
|
282
|
-
export interface MemoryProviderConfigField {
|
|
283
|
-
key: string;
|
|
284
|
-
label: string;
|
|
285
|
-
/** Service fields are configured once in Settings; memory fields belong to each Memory Space. */
|
|
286
|
-
scope: 'service' | 'memory';
|
|
287
|
-
/** A reusable local data location presented with the same default/custom scope UI as Mnemon Native. */
|
|
288
|
-
role?: 'global-location';
|
|
289
|
-
input: 'text' | 'url' | 'secret' | 'number' | 'boolean' | 'select' | 'path';
|
|
290
|
-
required: boolean;
|
|
291
|
-
defaultValue?: MemoryProviderConnectionValue;
|
|
292
|
-
placeholder?: string;
|
|
293
|
-
help?: string;
|
|
294
|
-
options?: Array<{
|
|
295
|
-
value: string;
|
|
296
|
-
label: string;
|
|
297
|
-
}>;
|
|
298
|
-
}
|
|
299
|
-
export type MemoryPlacementCapability = 'graph' | 'entities' | 'related' | 'exact-write' | 'link' | 'forget';
|
|
300
|
-
export type MemoryPlacementPreference = 'balanced' | 'local-first' | 'shared-first';
|
|
301
|
-
export interface MemoryPlacementRules {
|
|
302
|
-
allowedProviderIds?: MemoryProviderId[];
|
|
303
|
-
dataBoundary?: 'allow-remote' | 'local-only';
|
|
304
|
-
requiredCapabilities?: MemoryPlacementCapability[];
|
|
305
|
-
preference?: MemoryPlacementPreference;
|
|
306
|
-
}
|
|
307
|
-
/** Persistent policy for provider selection during Agent-supervised memory distillation. */
|
|
308
|
-
export interface MemoryPersistenceStrategy {
|
|
309
|
-
mode?: 'manual' | 'automatic';
|
|
310
|
-
/** Fixed provider in manual mode. */
|
|
311
|
-
providerId?: MemoryProviderId;
|
|
312
|
-
/** User-authored guidance used only after hard rules have filtered automatic candidates. */
|
|
313
|
-
prompt?: string;
|
|
314
|
-
rules?: MemoryPlacementRules;
|
|
315
|
-
/** Memory-level connection values for providers that may be selected by the policy. */
|
|
316
|
-
providerConnections?: Partial<Record<MemoryProviderId, MemoryProviderConnection>>;
|
|
317
|
-
}
|
|
318
|
-
export interface ResolvedMemoryPersistenceStrategy {
|
|
319
|
-
mode: 'manual' | 'automatic';
|
|
320
|
-
providerId: MemoryProviderId;
|
|
321
|
-
prompt: string;
|
|
322
|
-
rules: {
|
|
323
|
-
allowedProviderIds: MemoryProviderId[];
|
|
324
|
-
dataBoundary: 'allow-remote' | 'local-only';
|
|
325
|
-
requiredCapabilities: MemoryPlacementCapability[];
|
|
326
|
-
preference: MemoryPlacementPreference;
|
|
327
|
-
};
|
|
328
|
-
providerConnections: Partial<Record<MemoryProviderId, MemoryProviderConnection>>;
|
|
329
|
-
}
|
|
330
|
-
export interface AutomaticMemoryPlacementRequest {
|
|
331
|
-
mode: 'automatic';
|
|
332
|
-
/** User-authored routing guidance. Hard rules above always take precedence. */
|
|
333
|
-
prompt?: string;
|
|
334
|
-
rules?: MemoryPlacementRules;
|
|
335
|
-
}
|
|
336
|
-
export interface MemoryPlacementDecision {
|
|
337
|
-
mode: 'automatic';
|
|
338
|
-
providerId: MemoryProviderId;
|
|
339
|
-
decidedBy: 'rules' | 'llm';
|
|
340
|
-
reason: string;
|
|
341
|
-
confidence: 'high' | 'medium' | 'low';
|
|
342
|
-
candidateProviderIds: MemoryProviderId[];
|
|
343
|
-
appliedRules: string[];
|
|
344
|
-
decidedAt: string;
|
|
345
|
-
runId?: string;
|
|
346
|
-
subagentProvider?: string;
|
|
347
|
-
}
|
|
348
|
-
export interface MemoryProviderCapabilities {
|
|
349
|
-
search: boolean;
|
|
350
|
-
browse: boolean;
|
|
351
|
-
graph: boolean;
|
|
352
|
-
entities: boolean;
|
|
353
|
-
related: boolean;
|
|
354
|
-
remember: boolean;
|
|
355
|
-
link: boolean;
|
|
356
|
-
forget: boolean;
|
|
357
|
-
writeMode: 'exact' | 'async-extracting';
|
|
358
|
-
deletionMode: 'soft' | 'hard' | 'unsupported';
|
|
359
|
-
}
|
|
360
|
-
export interface MemoryProviderDescriptor {
|
|
361
|
-
id: MemoryProviderId;
|
|
362
|
-
label: string;
|
|
363
|
-
kind: 'local' | 'remote';
|
|
364
|
-
/** How the provider data scope reacts when DSH switches workspaces. */
|
|
365
|
-
workspaceBinding: 'automatic' | 'optional-override' | 'provider-global';
|
|
366
|
-
summary: string;
|
|
367
|
-
origin: 'native' | 'third-party';
|
|
368
|
-
capabilities: MemoryProviderCapabilities;
|
|
369
|
-
fields: MemoryProviderConfigField[];
|
|
370
|
-
/** Runtime projection: whether this scope has a usable saved service configuration. */
|
|
371
|
-
serviceConfigured?: boolean;
|
|
372
|
-
}
|
|
373
|
-
export interface MemoryProviderServiceView {
|
|
374
|
-
providerId: MemoryProviderId;
|
|
375
|
-
enabled: boolean;
|
|
376
|
-
configured: boolean;
|
|
377
|
-
settings: MemoryProviderConnection;
|
|
378
|
-
configuredSecrets: string[];
|
|
379
|
-
/** Present only on the settings RPC so its password inputs can use native reveal/hide behavior. */
|
|
380
|
-
secretValues?: MemoryProviderConnection;
|
|
381
|
-
}
|
|
382
|
-
export interface MemoryProviderServiceCatalog {
|
|
383
|
-
providers: MemoryProviderDescriptor[];
|
|
384
|
-
items: MemoryProviderServiceView[];
|
|
385
|
-
generatedAt: string;
|
|
386
|
-
}
|
|
387
|
-
export interface UpdateMemoryProviderServiceRequest {
|
|
388
|
-
providerId: MemoryProviderId;
|
|
389
|
-
settings: MemoryProviderConnection;
|
|
390
|
-
enabled?: boolean;
|
|
391
|
-
clearSecrets?: string[];
|
|
392
|
-
}
|
|
393
|
-
export interface MemoryProviderRuntimeStatus {
|
|
394
|
-
providerId: MemoryProviderId;
|
|
395
|
-
label: string;
|
|
396
|
-
enabled: boolean;
|
|
397
|
-
configured: boolean;
|
|
398
|
-
status: 'disabled' | 'idle' | 'healthy' | 'unhealthy';
|
|
399
|
-
memoryBodyCount: number;
|
|
400
|
-
activeMemoryBodyCount: number;
|
|
401
|
-
error?: string;
|
|
402
|
-
}
|
|
403
|
-
export interface MemoryBodyProvider {
|
|
404
|
-
id: MemoryProviderId;
|
|
405
|
-
label: string;
|
|
406
|
-
kind: 'local' | 'remote';
|
|
407
|
-
location: string;
|
|
408
|
-
targetUri?: string;
|
|
409
|
-
account?: string;
|
|
410
|
-
user?: string;
|
|
411
|
-
actorPeerId?: string;
|
|
412
|
-
apiKeyConfigured: boolean;
|
|
413
|
-
settings: MemoryProviderConnection;
|
|
414
|
-
configuredSecrets: string[];
|
|
415
|
-
capabilities: MemoryProviderCapabilities;
|
|
416
|
-
}
|
|
417
|
-
export interface OpenVikingBodyConnection {
|
|
418
|
-
endpoint: string;
|
|
419
|
-
targetUri: string;
|
|
420
|
-
apiKey?: string;
|
|
421
|
-
account?: string;
|
|
422
|
-
user?: string;
|
|
423
|
-
actorPeerId?: string;
|
|
424
|
-
}
|
|
425
|
-
export interface MemoryBody {
|
|
426
|
-
id: string;
|
|
427
|
-
name: string;
|
|
428
|
-
description: string;
|
|
429
|
-
active: boolean;
|
|
430
|
-
dbPath: string;
|
|
431
|
-
provider: MemoryBodyProvider;
|
|
432
|
-
placement?: MemoryPlacementDecision;
|
|
433
|
-
createdAt: string;
|
|
434
|
-
updatedAt: string;
|
|
435
|
-
}
|
|
436
|
-
export interface CreateMemoryBodyRequest {
|
|
437
|
-
name: string;
|
|
438
|
-
description: string;
|
|
439
|
-
active?: boolean;
|
|
440
|
-
providerId?: MemoryProviderId;
|
|
441
|
-
connection?: MemoryProviderConnection;
|
|
442
|
-
/** Candidate-specific settings used only while resolving automatic placement. */
|
|
443
|
-
providerConnections?: Partial<Record<MemoryProviderId, MemoryProviderConnection>>;
|
|
444
|
-
openViking?: OpenVikingBodyConnection;
|
|
445
|
-
placement?: AutomaticMemoryPlacementRequest;
|
|
446
|
-
}
|
|
447
|
-
export interface UpdateMemoryBodyRequest {
|
|
448
|
-
name?: string;
|
|
449
|
-
description?: string;
|
|
450
|
-
active?: boolean;
|
|
451
|
-
connection?: MemoryProviderConnection;
|
|
452
|
-
clearSecrets?: string[];
|
|
453
|
-
openViking?: Partial<OpenVikingBodyConnection> & {
|
|
454
|
-
clearApiKey?: boolean;
|
|
455
|
-
};
|
|
456
|
-
}
|
|
457
|
-
export interface MemoryBodyMetadataUpdate {
|
|
458
|
-
memoryBodyId: string;
|
|
459
|
-
title: string;
|
|
460
|
-
description: string;
|
|
461
|
-
}
|
|
462
|
-
export interface MemoryBodyMetadataMaintenanceResult {
|
|
463
|
-
delegated: true;
|
|
464
|
-
runId: string;
|
|
465
|
-
provider: string;
|
|
466
|
-
summary: string;
|
|
467
|
-
updates: MemoryBodyMetadataUpdate[];
|
|
468
|
-
}
|
|
469
|
-
export type Category = 'preference' | 'decision' | 'fact' | 'insight' | 'context' | 'general';
|
|
470
|
-
export declare const CATEGORIES: readonly ["preference", "decision", "fact", "insight", "context", "general"];
|
|
471
|
-
export type Source = 'user' | 'agent' | 'external';
|
|
472
|
-
export declare const SOURCES: readonly ["user", "agent", "external"];
|
|
473
|
-
export type EdgeType = 'temporal' | 'semantic' | 'causal' | 'entity';
|
|
474
|
-
export declare const EDGE_TYPES: readonly ["temporal", "semantic", "causal", "entity"];
|
|
475
|
-
export type Intent = 'WHY' | 'WHEN' | 'ENTITY' | 'GENERAL';
|
|
476
|
-
export declare const INTENTS: readonly ["WHY", "WHEN", "ENTITY", "GENERAL"];
|
|
477
|
-
export type RecallRelevanceTier = 'high' | 'medium' | 'low' | 'unknown';
|
|
478
|
-
export interface Insight {
|
|
479
|
-
id: string;
|
|
480
|
-
content: string;
|
|
481
|
-
category?: string;
|
|
482
|
-
importance?: number;
|
|
483
|
-
tags?: string[];
|
|
484
|
-
entities?: string[];
|
|
485
|
-
source?: string;
|
|
486
|
-
score?: number;
|
|
487
|
-
/** Policy-normalized query relevance; absent for unknown Provider score scales. */
|
|
488
|
-
normalizedScore?: number;
|
|
489
|
-
/** Query relevance assigned by the active deterministic recall quality policy. */
|
|
490
|
-
relevanceTier?: RecallRelevanceTier;
|
|
491
|
-
/** Comparable rank score only when results were fused across providers. */
|
|
492
|
-
federatedScore?: number;
|
|
493
|
-
confidence?: string;
|
|
494
|
-
intent?: string;
|
|
495
|
-
matchedVia?: string;
|
|
496
|
-
createdAt?: string;
|
|
497
|
-
depth?: number;
|
|
498
|
-
edgeType?: string;
|
|
499
|
-
memoryBodyId?: string;
|
|
500
|
-
memoryBodyName?: string;
|
|
501
|
-
memoryProviderId?: MemoryProviderId;
|
|
502
|
-
/** Owning Provider capabilities at read time; safe to expose to clients. */
|
|
503
|
-
memoryCapabilities?: MemoryProviderCapabilities;
|
|
504
|
-
externalUri?: string;
|
|
505
|
-
}
|
|
506
|
-
export interface SearchRequest {
|
|
507
|
-
query: string;
|
|
508
|
-
mode?: 'smart' | 'keyword' | 'basic';
|
|
509
|
-
limit?: number;
|
|
510
|
-
category?: Category;
|
|
511
|
-
source?: Source;
|
|
512
|
-
intent?: Intent;
|
|
513
|
-
memoryBodyIds?: string[];
|
|
514
|
-
}
|
|
515
|
-
export interface RememberRequest {
|
|
516
|
-
content: string;
|
|
517
|
-
category?: Category;
|
|
518
|
-
importance?: number;
|
|
519
|
-
tags?: string[];
|
|
520
|
-
entities?: string[];
|
|
521
|
-
source?: Source;
|
|
522
|
-
memoryBodyId?: string;
|
|
523
|
-
}
|
|
524
|
-
export interface MemoryBodyStats {
|
|
525
|
-
totalInsights: number;
|
|
526
|
-
deletedInsights: number;
|
|
527
|
-
edgeCount: number;
|
|
528
|
-
oplogCount: number;
|
|
529
|
-
dbSizeBytes: number;
|
|
530
|
-
byCategory: Record<string, number>;
|
|
531
|
-
topEntities: Array<{
|
|
532
|
-
entity: string;
|
|
533
|
-
count: number;
|
|
534
|
-
}>;
|
|
535
|
-
}
|
|
536
|
-
export interface MemoryBodyView extends MemoryBody {
|
|
537
|
-
/** True when Mnemon's persisted active-file selection points to this Store. */
|
|
538
|
-
mnemonDefault: boolean;
|
|
539
|
-
/** False when an external provider is disabled while its Memory Space registration remains preserved. */
|
|
540
|
-
providerEnabled?: boolean;
|
|
541
|
-
healthy: boolean;
|
|
542
|
-
/** A fast directory response is visible while provider health resolves independently. */
|
|
543
|
-
statusLoading?: boolean;
|
|
544
|
-
error?: string;
|
|
545
|
-
stats?: MemoryBodyStats;
|
|
546
|
-
}
|
|
547
|
-
export interface MemoryBodyCatalog {
|
|
548
|
-
items: MemoryBodyView[];
|
|
549
|
-
providers: MemoryProviderDescriptor[];
|
|
550
|
-
/** Sanitized policy exposed to memory workers; provider connection values are never included. */
|
|
551
|
-
persistenceStrategy?: Omit<ResolvedMemoryPersistenceStrategy, 'providerConnections'>;
|
|
552
|
-
total: number;
|
|
553
|
-
activeCount: number;
|
|
554
|
-
directory: string;
|
|
555
|
-
generatedAt: string;
|
|
556
|
-
}
|
|
557
|
-
export interface MemoryGraphNode extends Insight {
|
|
558
|
-
color: string;
|
|
559
|
-
graphId?: string;
|
|
560
|
-
kind?: 'memory' | 'entity' | 'space';
|
|
561
|
-
memoryBodyIds?: string[];
|
|
562
|
-
memoryBodyNames?: string[];
|
|
563
|
-
occurrenceCount?: number;
|
|
564
|
-
}
|
|
565
|
-
export interface MemoryGraphEdge {
|
|
566
|
-
sourceId: string;
|
|
567
|
-
targetId: string;
|
|
568
|
-
label: string;
|
|
569
|
-
color: string;
|
|
570
|
-
type?: EdgeType | 'scope';
|
|
571
|
-
}
|
|
572
|
-
export interface MemoryGraphSnapshot {
|
|
573
|
-
nodes: MemoryGraphNode[];
|
|
574
|
-
edges: MemoryGraphEdge[];
|
|
575
|
-
generatedAt: string;
|
|
576
|
-
memoryBodies?: Array<Pick<MemoryBody, 'id' | 'name' | 'active'>>;
|
|
577
|
-
/** Per-space observation state for capability-aware overview rendering. */
|
|
578
|
-
sources?: MemoryReadSource[];
|
|
579
|
-
}
|
|
580
|
-
export type MemoryReadMode = 'search' | 'graph' | 'projection' | 'enumerable' | 'query-only' | 'entities' | 'unsupported';
|
|
581
|
-
export type MemoryReadStatus = 'ready' | 'empty' | 'query-required' | 'unsupported' | 'unavailable';
|
|
582
|
-
/**
|
|
583
|
-
* One provider-backed Memory Space participating in a read surface.
|
|
584
|
-
*
|
|
585
|
-
* The mode describes what the provider can truthfully expose; status describes
|
|
586
|
-
* the result of this particular read. Keeping those dimensions separate lets
|
|
587
|
-
* the UI distinguish an empty graph from a flat projection, a query-only
|
|
588
|
-
* engine, and an unavailable connection.
|
|
589
|
-
*/
|
|
590
|
-
export interface MemoryReadSource {
|
|
591
|
-
memoryBodyId: string;
|
|
592
|
-
memoryBodyName: string;
|
|
593
|
-
providerId: MemoryProviderId;
|
|
594
|
-
providerLabel: string;
|
|
595
|
-
mode: MemoryReadMode;
|
|
596
|
-
status: MemoryReadStatus;
|
|
597
|
-
itemCount: number;
|
|
598
|
-
edgeCount?: number;
|
|
599
|
-
hint?: string;
|
|
600
|
-
quality?: RecallQualityStats;
|
|
601
|
-
}
|
|
602
|
-
export interface RecallQualityStats {
|
|
603
|
-
policyId: string;
|
|
604
|
-
fallbackFrom?: string;
|
|
605
|
-
fetched: number;
|
|
606
|
-
retained: number;
|
|
607
|
-
selected: number;
|
|
608
|
-
droppedLowScore: number;
|
|
609
|
-
droppedNonPositiveScore: number;
|
|
610
|
-
droppedInvalidScore: number;
|
|
611
|
-
unscored: number;
|
|
612
|
-
unscaled: number;
|
|
613
|
-
}
|
|
614
|
-
export interface MemoryListRequest {
|
|
615
|
-
query?: string;
|
|
616
|
-
category?: Category;
|
|
617
|
-
limit?: number;
|
|
618
|
-
memoryBodyIds?: string[];
|
|
619
|
-
}
|
|
620
|
-
export interface MemoryListView {
|
|
621
|
-
items: MemoryGraphNode[];
|
|
622
|
-
total: number;
|
|
623
|
-
generatedAt: string;
|
|
624
|
-
/** Omitted only when talking to a pre-provider-aware Host. */
|
|
625
|
-
sources?: MemoryReadSource[];
|
|
626
|
-
}
|
|
627
|
-
export interface EntityView {
|
|
628
|
-
items: Array<{
|
|
629
|
-
entity: string;
|
|
630
|
-
count: number;
|
|
631
|
-
}>;
|
|
632
|
-
insights: Insight[];
|
|
633
|
-
selected?: string;
|
|
634
|
-
/** Omitted only when talking to a pre-provider-aware Host. */
|
|
635
|
-
sources?: MemoryReadSource[];
|
|
636
|
-
}
|
|
637
|
-
export type DocumentStatus = 'active' | 'archived';
|
|
638
|
-
export interface DocumentRecord {
|
|
639
|
-
id: string;
|
|
640
|
-
title: string;
|
|
641
|
-
description: string;
|
|
642
|
-
status: DocumentStatus;
|
|
643
|
-
filename: string;
|
|
644
|
-
relativePath: string;
|
|
645
|
-
sourcePaths: string[];
|
|
646
|
-
sessionIds: string[];
|
|
647
|
-
createdAt: string;
|
|
648
|
-
updatedAt: string;
|
|
649
|
-
lastAccessedAt: string;
|
|
650
|
-
revision: number;
|
|
651
|
-
contentHash: string;
|
|
652
|
-
sizeBytes: number;
|
|
653
|
-
archivedAt?: string;
|
|
654
|
-
archiveSummary?: string;
|
|
655
|
-
memoryBodyIds: string[];
|
|
656
|
-
}
|
|
657
|
-
export interface DocumentView extends DocumentRecord {
|
|
658
|
-
content: string;
|
|
659
|
-
}
|
|
660
|
-
export interface DocumentSnapshot {
|
|
661
|
-
workspaceRoot: string;
|
|
662
|
-
directory: string;
|
|
663
|
-
indexPath: string;
|
|
664
|
-
generatedAt: string;
|
|
665
|
-
revision: string;
|
|
666
|
-
limitBytes: number;
|
|
667
|
-
activeBytes: number;
|
|
668
|
-
activeCount: number;
|
|
669
|
-
archivedCount: number;
|
|
670
|
-
total: number;
|
|
671
|
-
documents: Array<DocumentRecord & {
|
|
672
|
-
healthy: boolean;
|
|
673
|
-
excerpt: string;
|
|
674
|
-
}>;
|
|
675
|
-
}
|
|
676
|
-
export interface DocumentSearchResult {
|
|
677
|
-
query: string;
|
|
678
|
-
includeArchived: boolean;
|
|
679
|
-
total: number;
|
|
680
|
-
generatedAt: string;
|
|
681
|
-
results: Array<DocumentView & {
|
|
682
|
-
score: number;
|
|
683
|
-
excerpt: string;
|
|
684
|
-
}>;
|
|
685
|
-
}
|
|
686
|
-
export type DocumentMutation = {
|
|
687
|
-
action: 'create';
|
|
688
|
-
title: string;
|
|
689
|
-
description?: string;
|
|
690
|
-
content: string;
|
|
691
|
-
sourcePaths?: string[];
|
|
692
|
-
sessionIds?: string[];
|
|
693
|
-
} | {
|
|
694
|
-
action: 'update';
|
|
695
|
-
id: string;
|
|
696
|
-
title?: string;
|
|
697
|
-
description?: string;
|
|
698
|
-
content?: string;
|
|
699
|
-
sourcePaths?: string[];
|
|
700
|
-
sessionIds?: string[];
|
|
701
|
-
};
|
|
702
|
-
export interface DocumentMutationResult {
|
|
703
|
-
success: true;
|
|
704
|
-
action: 'created' | 'updated' | 'archived';
|
|
705
|
-
document: DocumentView;
|
|
706
|
-
snapshot: DocumentSnapshot;
|
|
707
|
-
maintenance?: {
|
|
708
|
-
runId: string;
|
|
709
|
-
provider: string;
|
|
710
|
-
summary: string;
|
|
711
|
-
memoryBodyIds: string[];
|
|
712
|
-
archivedDocumentIds: string[];
|
|
713
|
-
};
|
|
714
|
-
}
|
|
715
|
-
export type RuntimeMemoryTarget = 'memory' | 'user';
|
|
716
|
-
export type RuntimeMemoryImportance = 'critical' | 'normal' | 'low';
|
|
717
|
-
export type RuntimeMemoryAction = 'add' | 'replace' | 'remove';
|
|
718
|
-
export interface RuntimeMemoryEntry {
|
|
719
|
-
content: string;
|
|
720
|
-
created_at: string;
|
|
721
|
-
updated_at: string;
|
|
722
|
-
target: RuntimeMemoryTarget;
|
|
723
|
-
importance: RuntimeMemoryImportance;
|
|
724
|
-
/** Optional git branch names that limit where this entry is projected. Absent means every branch. */
|
|
725
|
-
branches?: string[];
|
|
726
|
-
}
|
|
727
|
-
export interface RuntimeMemoryUsage {
|
|
728
|
-
used: number;
|
|
729
|
-
limit: number;
|
|
730
|
-
}
|
|
731
|
-
export interface RuntimeMemoryTargetView extends RuntimeMemoryUsage {
|
|
732
|
-
target: RuntimeMemoryTarget;
|
|
733
|
-
entryCount: number;
|
|
734
|
-
markdownPath: string;
|
|
735
|
-
}
|
|
736
|
-
export interface RuntimeMemorySnapshot {
|
|
737
|
-
directory: string;
|
|
738
|
-
sourcePath: string;
|
|
739
|
-
revision: string;
|
|
740
|
-
generatedAt: string;
|
|
741
|
-
entries: RuntimeMemoryEntry[];
|
|
742
|
-
targets: Record<RuntimeMemoryTarget, RuntimeMemoryTargetView>;
|
|
743
|
-
}
|
|
744
|
-
export interface RuntimeMemoryCompactedEntry {
|
|
745
|
-
content: string;
|
|
746
|
-
importance: RuntimeMemoryImportance;
|
|
747
|
-
/** Branch scope carried through compaction; absent means the entry is visible on every branch. */
|
|
748
|
-
branches?: string[];
|
|
749
|
-
}
|
|
750
|
-
export interface RuntimeMemoryMutation {
|
|
751
|
-
action: RuntimeMemoryAction;
|
|
752
|
-
target: RuntimeMemoryTarget;
|
|
753
|
-
content?: string;
|
|
754
|
-
oldText?: string;
|
|
755
|
-
importance?: RuntimeMemoryImportance;
|
|
756
|
-
/** Git branch names limiting where a target=memory entry is projected. Absent keeps the current scope on replace; an empty list clears it. */
|
|
757
|
-
branches?: string[];
|
|
758
|
-
}
|
|
759
|
-
export type RuntimeMemoryMutationResult = {
|
|
760
|
-
success: true;
|
|
761
|
-
message: string;
|
|
762
|
-
target: RuntimeMemoryTarget;
|
|
763
|
-
entryCount: number;
|
|
764
|
-
usage: RuntimeMemoryUsage;
|
|
765
|
-
added?: string;
|
|
766
|
-
replaced?: {
|
|
767
|
-
from: string;
|
|
768
|
-
to: string;
|
|
769
|
-
};
|
|
770
|
-
removed?: string;
|
|
771
|
-
maintenance?: {
|
|
772
|
-
kind: 'local-compaction' | 'mnemon-archive';
|
|
773
|
-
runId: string;
|
|
774
|
-
provider: string;
|
|
775
|
-
summary: string;
|
|
776
|
-
memoryBodyIds: string[];
|
|
777
|
-
};
|
|
778
|
-
};
|
|
779
|
-
export interface TurnMemoryActivity {
|
|
780
|
-
turn: number;
|
|
781
|
-
count: number;
|
|
782
|
-
names: string[];
|
|
783
|
-
recalls: number;
|
|
784
|
-
writes: number;
|
|
785
|
-
documentSearches: number;
|
|
786
|
-
inspections: number;
|
|
787
|
-
failures: number;
|
|
788
|
-
}
|
|
789
|
-
export interface TurnMemoryActivitySnapshot {
|
|
790
|
-
cursor: number;
|
|
791
|
-
activities: TurnMemoryActivity[];
|
|
792
|
-
}
|
|
793
|
-
export interface AssistantMessageText {
|
|
794
|
-
messageId: string;
|
|
795
|
-
text: string;
|
|
796
|
-
}
|
|
797
|
-
export type StorageAreaKind = 'runtime' | 'memory-bodies' | 'documents' | 'state';
|
|
798
|
-
export type StorageAreaStatus = 'ready' | 'empty' | 'missing' | 'invalid';
|
|
799
|
-
export interface StorageAreaInventory {
|
|
800
|
-
kind: StorageAreaKind;
|
|
801
|
-
path: string;
|
|
802
|
-
status: StorageAreaStatus;
|
|
803
|
-
bytes: number;
|
|
804
|
-
itemCount: number;
|
|
805
|
-
details: Record<string, number | string | boolean>;
|
|
806
|
-
issue?: string;
|
|
807
|
-
}
|
|
808
|
-
export interface StorageScopeInventory {
|
|
809
|
-
kind: StorageScopeKind;
|
|
810
|
-
root?: string;
|
|
811
|
-
configured: boolean;
|
|
812
|
-
active: boolean;
|
|
813
|
-
available: boolean;
|
|
814
|
-
totalBytes: number;
|
|
815
|
-
areas: StorageAreaInventory[];
|
|
816
|
-
issue?: string;
|
|
817
|
-
}
|
|
818
|
-
export interface StorageScopeCatalog {
|
|
819
|
-
activeKind: StorageScopeKind;
|
|
820
|
-
activeRoot: string;
|
|
821
|
-
scopes: StorageScopeInventory[];
|
|
822
|
-
generatedAt: string;
|
|
823
|
-
}
|
|
824
|
-
export interface ReviewActivity {
|
|
825
|
-
totalUserTextLength: number;
|
|
826
|
-
turnCount: number;
|
|
827
|
-
toolCallCount: number;
|
|
828
|
-
uniqueToolCount: number;
|
|
829
|
-
}
|
|
830
|
-
export interface ReviewActivityScore extends ReviewActivity {
|
|
831
|
-
textLengthScore: number;
|
|
832
|
-
turnScore: number;
|
|
833
|
-
toolCallScore: number;
|
|
834
|
-
toolDiversityScore: number;
|
|
835
|
-
score: number;
|
|
836
|
-
threshold: number;
|
|
837
|
-
eligible: boolean;
|
|
838
|
-
}
|
|
839
|
-
export interface SubagentCounters {
|
|
840
|
-
recalls: number;
|
|
841
|
-
writes: number;
|
|
842
|
-
answers: number;
|
|
843
|
-
reviews: number;
|
|
844
|
-
placements: number;
|
|
845
|
-
migrations: number;
|
|
846
|
-
compactions: number;
|
|
847
|
-
documentArchives: number;
|
|
848
|
-
metadataMaintenances: number;
|
|
849
|
-
failures: number;
|
|
850
|
-
lastRunId?: string;
|
|
851
|
-
lastOperation?: 'recall' | 'write' | 'review' | 'placement' | 'migration' | 'compaction' | 'document-archive' | 'metadata-maintenance';
|
|
852
|
-
lastAt?: string;
|
|
853
|
-
}
|
|
854
|
-
export type LifecyclePhase = 'idle' | 'prime' | 'recall' | 'writeback' | 'review' | 'supervised' | 'error';
|
|
855
|
-
export interface LifecycleCounters {
|
|
856
|
-
primes: number;
|
|
857
|
-
recallCues: number;
|
|
858
|
-
writebackCues: number;
|
|
859
|
-
supervisedRequests: number;
|
|
860
|
-
failures: number;
|
|
861
|
-
}
|
|
862
|
-
export interface LifecycleAgentSnapshot {
|
|
863
|
-
sessionId: string;
|
|
864
|
-
status: 'idle' | 'running';
|
|
865
|
-
startSource: 'startup' | 'resume' | 'clear' | 'compact' | 'adopted';
|
|
866
|
-
primePending: boolean;
|
|
867
|
-
guidedTurns: number;
|
|
868
|
-
memoryToolCalls: number;
|
|
869
|
-
idleReviewPending: boolean;
|
|
870
|
-
reviewRunning: boolean;
|
|
871
|
-
reviewActivity: ReviewActivityScore;
|
|
872
|
-
lastPhase: LifecyclePhase;
|
|
873
|
-
lastReviewAt?: string;
|
|
874
|
-
lastReviewAction?: string;
|
|
875
|
-
lastReviewScore?: number;
|
|
876
|
-
lastReviewDocumentIds?: string[];
|
|
877
|
-
lastAt?: string;
|
|
878
|
-
lastError?: string;
|
|
879
|
-
}
|
|
880
|
-
export interface LifecycleSnapshot {
|
|
881
|
-
enabled: boolean;
|
|
882
|
-
recallMode: 'guided' | 'off';
|
|
883
|
-
writebackMode: 'guided' | 'off';
|
|
884
|
-
idleReviewMs: number;
|
|
885
|
-
activeAgents: number;
|
|
886
|
-
sessionAvailable: boolean;
|
|
887
|
-
/** A session-independent task Agent can be created for WebUI maintenance. */
|
|
888
|
-
taskAgentAvailable: boolean;
|
|
889
|
-
counters: LifecycleCounters;
|
|
890
|
-
subagents: SubagentCounters;
|
|
891
|
-
current?: LifecycleAgentSnapshot;
|
|
892
|
-
}
|
|
893
|
-
export interface StatusView {
|
|
894
|
-
healthy: boolean;
|
|
895
|
-
error?: string;
|
|
896
|
-
version?: string;
|
|
897
|
-
dshMnemonVersion?: string;
|
|
898
|
-
cliPath: string;
|
|
899
|
-
commandFound: boolean;
|
|
900
|
-
dataDir: string;
|
|
901
|
-
/** Legacy comma-separated DSH-enabled Store list. */
|
|
902
|
-
store: string;
|
|
903
|
-
mnemonDefaultStore: string;
|
|
904
|
-
dshActiveStores: string[];
|
|
905
|
-
writeEnabled: boolean;
|
|
906
|
-
timeoutMs: number;
|
|
907
|
-
defaultRecallLimit: number;
|
|
908
|
-
recallQuality: ResolvedRecallQualityConfig;
|
|
909
|
-
memoryBodyDirectory: string;
|
|
910
|
-
memoryBodies: MemoryBodyView[];
|
|
911
|
-
providerServices?: MemoryProviderRuntimeStatus[];
|
|
912
|
-
memorySystem?: MemorySystemDescriptor;
|
|
913
|
-
lifecycle?: LifecycleSnapshot;
|
|
914
|
-
documents?: DocumentSnapshot;
|
|
915
|
-
storage?: StorageScopeCatalog;
|
|
916
|
-
workspaceContext?: {
|
|
917
|
-
mode: StorageScopeKind;
|
|
918
|
-
selectedRoot: string;
|
|
919
|
-
effectiveRoot: string;
|
|
920
|
-
aligned: boolean;
|
|
921
|
-
selectedWorkspace?: {
|
|
922
|
-
id: string;
|
|
923
|
-
title: string;
|
|
924
|
-
path: string;
|
|
925
|
-
};
|
|
926
|
-
effectiveWorkspace?: {
|
|
927
|
-
id: string;
|
|
928
|
-
title: string;
|
|
929
|
-
path: string;
|
|
930
|
-
};
|
|
931
|
-
};
|
|
932
|
-
stats?: MemoryBodyStats & {
|
|
933
|
-
dbPath?: string;
|
|
934
|
-
};
|
|
935
|
-
}
|
|
936
|
-
export type MnemonPackComponent = 'runtime' | 'documents' | 'memory-spaces';
|
|
937
|
-
export type MnemonPackScope = 'full' | MnemonPackComponent;
|
|
938
|
-
export type MnemonPackImportMode = 'merge' | 'replace';
|
|
939
|
-
export interface MnemonPackComponentSummary {
|
|
940
|
-
component: MnemonPackComponent;
|
|
941
|
-
files: number;
|
|
942
|
-
bytes: number;
|
|
943
|
-
items: number;
|
|
944
|
-
}
|
|
945
|
-
export interface MnemonPackManifest {
|
|
946
|
-
format: 'mnemonpack';
|
|
947
|
-
version: 1;
|
|
948
|
-
scope: MnemonPackScope;
|
|
949
|
-
exportedAt: string;
|
|
950
|
-
source: {
|
|
951
|
-
plugin: 'dsh-mnemon';
|
|
952
|
-
pluginVersion: string;
|
|
953
|
-
};
|
|
954
|
-
components: MnemonPackComponent[];
|
|
955
|
-
summary: MnemonPackComponentSummary[];
|
|
956
|
-
}
|
|
957
|
-
export interface MnemonPackExport {
|
|
958
|
-
fileName: string;
|
|
959
|
-
mimeType: 'application/zip';
|
|
960
|
-
bytes: number;
|
|
961
|
-
base64: string;
|
|
962
|
-
targetRoot: string;
|
|
963
|
-
manifest: MnemonPackManifest;
|
|
964
|
-
}
|
|
965
|
-
export interface MnemonPackPreview {
|
|
966
|
-
fileName?: string;
|
|
967
|
-
archiveBytes: number;
|
|
968
|
-
expandedBytes: number;
|
|
969
|
-
targetRoot: string;
|
|
970
|
-
targetScope: StorageScopeKind;
|
|
971
|
-
manifest: MnemonPackManifest;
|
|
972
|
-
occupied: Record<MnemonPackComponent, boolean>;
|
|
973
|
-
}
|
|
974
|
-
export interface MnemonPackImportResult {
|
|
975
|
-
imported: true;
|
|
976
|
-
mode: MnemonPackImportMode;
|
|
977
|
-
targetRoot: string;
|
|
978
|
-
components: MnemonPackComponent[];
|
|
979
|
-
summary: MnemonPackComponentSummary[];
|
|
980
|
-
}
|
|
981
|
-
export type VersionComponentId = 'mnemon' | 'dsh-mnemon';
|
|
982
|
-
export type VersionInstallMode = 'homebrew' | 'go' | 'npm' | 'link' | 'manual' | 'missing';
|
|
983
|
-
export interface VersionComponentStatus {
|
|
984
|
-
id: VersionComponentId;
|
|
985
|
-
name: string;
|
|
986
|
-
executablePath?: string;
|
|
987
|
-
installPath?: string;
|
|
988
|
-
installProfile?: string;
|
|
989
|
-
current?: string;
|
|
990
|
-
latest?: string;
|
|
991
|
-
outdated: boolean;
|
|
992
|
-
installMode: VersionInstallMode;
|
|
993
|
-
updateSupported: boolean;
|
|
994
|
-
updateHint: string;
|
|
995
|
-
checkError?: string;
|
|
996
|
-
}
|
|
997
|
-
export interface VersionStatus {
|
|
998
|
-
checkedAt: string;
|
|
999
|
-
components: VersionComponentStatus[];
|
|
1000
|
-
}
|
|
1001
|
-
export interface VersionUpdateResult {
|
|
1002
|
-
component: VersionComponentId;
|
|
1003
|
-
previousVersion?: string;
|
|
1004
|
-
currentVersion?: string;
|
|
1005
|
-
updated: boolean;
|
|
1006
|
-
restartRequired: boolean;
|
|
1007
|
-
output?: string;
|
|
1008
|
-
}
|