dsh-mnemon 0.3.0 → 0.3.2
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 +8 -7
- package/README.zh-CN.md +8 -7
- package/cordis.patch.yml +4 -0
- package/lib/client.js +303 -57
- package/lib/index.js +429 -202
- package/lib/types/src/client/MnemonSettingsCard.d.ts +1 -1
- package/lib/types/src/client/api.d.ts +2 -1
- package/lib/types/src/client/locales.d.ts +38 -0
- package/lib/types/src/config-values.d.ts +1 -0
- package/lib/types/src/config.d.ts +1 -1
- package/lib/types/src/guidance.d.ts +7 -2
- package/lib/types/src/providers/provider.d.ts +2 -0
- package/lib/types/src/runtime-memory.d.ts +1 -0
- package/lib/types/src/service.d.ts +12 -2
- package/lib/types/src/shared/contracts.d.ts +23 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type JSX } from 'react';
|
|
2
|
-
import type
|
|
2
|
+
import { type ClientConnectionHandle, type ClientSettingsScope, type Config, type InteractionConfig } from '../shared/contracts.ts';
|
|
3
3
|
import { type MnemonTranslate } from './locales.ts';
|
|
4
4
|
export interface MnemonSettingsCardProps {
|
|
5
5
|
scope: ClientSettingsScope<Config>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AssistantMessageText, type CreateMemoryBodyRequest, type ClientConnectionHandle, type DocumentMutation, type DocumentMutationResult, type DocumentSearchResult, type DocumentSnapshot, type DocumentView, type EntityView, type Insight, type MemoryBody, type MemoryBodyView, type MemoryBodyMetadataMaintenanceResult, type MemoryBodyCatalog, type MemoryProviderServiceCatalog, type MemoryProviderServiceView, type MemoryGraphSnapshot, type MemoryListRequest, type MemoryListView, type MemorySystemDescriptor, type MemoryReadSource, type MnemonPackExport, type MnemonPackImportResult, type MnemonPackPreview, type RememberRequest, type RuntimeMemoryImportance, type RuntimeMemoryMutationResult, type RuntimeMemorySnapshot, type RuntimeMemoryTarget, type SearchRequest, type StatusView, type TaskAgentModelCatalog, type TurnMemoryActivity, type UpdateMemoryBodyRequest, type UpdateMemoryProviderServiceRequest, type VersionComponentId, type VersionStatus, type VersionUpdateResult } from '../shared/contracts.ts';
|
|
1
|
+
import { type AssistantMessageText, type CreateMemoryBodyRequest, type ClientConnectionHandle, type DocumentMutation, type DocumentMutationResult, type DocumentSearchResult, type DocumentSnapshot, type DocumentView, type EntityView, type Insight, type MemoryBody, type MemoryBodyView, type MemoryBodyMetadataMaintenanceResult, type MemoryBodyCatalog, type MemoryProviderServiceCatalog, type MemoryProviderServiceView, type MemoryGraphSnapshot, type MemoryListRequest, type MemoryListView, type MemorySystemDescriptor, type MemoryReadSource, type MnemonPackExport, type MnemonPackImportResult, type MnemonPackPreview, type MnemonEmbeddingStatus, type RememberRequest, type RuntimeMemoryImportance, type RuntimeMemoryMutationResult, type RuntimeMemorySnapshot, type RuntimeMemoryTarget, type SearchRequest, type StatusView, type TaskAgentModelCatalog, type TurnMemoryActivity, type UpdateMemoryBodyRequest, type UpdateMemoryProviderServiceRequest, type VersionComponentId, type VersionStatus, type VersionUpdateResult } from '../shared/contracts.ts';
|
|
2
2
|
export interface SearchResponse {
|
|
3
3
|
query: string;
|
|
4
4
|
mode: string;
|
|
@@ -24,6 +24,7 @@ export declare class MnemonClient {
|
|
|
24
24
|
private scoped;
|
|
25
25
|
status(): Promise<StatusView>;
|
|
26
26
|
statusSummary(): Promise<StatusView>;
|
|
27
|
+
embeddingStatus(): Promise<MnemonEmbeddingStatus>;
|
|
27
28
|
memorySystem(): Promise<MemorySystemDescriptor>;
|
|
28
29
|
taskAgentModels(includeCatalog?: boolean): Promise<TaskAgentModelCatalog>;
|
|
29
30
|
versions(): Promise<VersionStatus>;
|
|
@@ -485,7 +485,9 @@ export declare const zh: {
|
|
|
485
485
|
'entities.action': string;
|
|
486
486
|
'entities.top': string;
|
|
487
487
|
'entities.frequency': string;
|
|
488
|
+
'entities.filterHint': string;
|
|
488
489
|
'entities.emptyRail': string;
|
|
490
|
+
'entities.filterEmpty': string;
|
|
489
491
|
'entities.loading': string;
|
|
490
492
|
'entities.selectTitle': string;
|
|
491
493
|
'entities.selectText': string;
|
|
@@ -729,6 +731,23 @@ export declare const zh: {
|
|
|
729
731
|
'config.nativeGlobalLocationHint': string;
|
|
730
732
|
'config.nativeGlobalLocationWorkspaceHint': string;
|
|
731
733
|
'config.nativeDefaultLocation': string;
|
|
734
|
+
'config.embeddingTitle': string;
|
|
735
|
+
'config.embeddingDescription': string;
|
|
736
|
+
'config.embeddingManaged': string;
|
|
737
|
+
'config.embeddingManagedHint': string;
|
|
738
|
+
'config.embeddingEndpoint': string;
|
|
739
|
+
'config.embeddingModel': string;
|
|
740
|
+
'config.embeddingEndpointInvalid': string;
|
|
741
|
+
'config.embeddingModelInvalid': string;
|
|
742
|
+
'config.embeddingSecurity': string;
|
|
743
|
+
'config.embeddingTest': string;
|
|
744
|
+
'config.embeddingNotTested': string;
|
|
745
|
+
'config.embeddingTesting': string;
|
|
746
|
+
'config.embeddingSaveBeforeTest': string;
|
|
747
|
+
'config.embeddingTestUnavailable': string;
|
|
748
|
+
'config.embeddingStatusAvailable': string;
|
|
749
|
+
'config.embeddingStatusUnavailable': string;
|
|
750
|
+
'config.embeddingStatusFailed': string;
|
|
732
751
|
'config.providerGlobalLocation': string;
|
|
733
752
|
'config.providerGlobalLocationHint': string;
|
|
734
753
|
'config.providerGlobalLocationWorkspaceHint': string;
|
|
@@ -1361,7 +1380,9 @@ export declare const en: {
|
|
|
1361
1380
|
'entities.action': string;
|
|
1362
1381
|
'entities.top': string;
|
|
1363
1382
|
'entities.frequency': string;
|
|
1383
|
+
'entities.filterHint': string;
|
|
1364
1384
|
'entities.emptyRail': string;
|
|
1385
|
+
'entities.filterEmpty': string;
|
|
1365
1386
|
'entities.loading': string;
|
|
1366
1387
|
'entities.selectTitle': string;
|
|
1367
1388
|
'entities.selectText': string;
|
|
@@ -1605,6 +1626,23 @@ export declare const en: {
|
|
|
1605
1626
|
'config.nativeGlobalLocationHint': string;
|
|
1606
1627
|
'config.nativeGlobalLocationWorkspaceHint': string;
|
|
1607
1628
|
'config.nativeDefaultLocation': string;
|
|
1629
|
+
'config.embeddingTitle': string;
|
|
1630
|
+
'config.embeddingDescription': string;
|
|
1631
|
+
'config.embeddingManaged': string;
|
|
1632
|
+
'config.embeddingManagedHint': string;
|
|
1633
|
+
'config.embeddingEndpoint': string;
|
|
1634
|
+
'config.embeddingModel': string;
|
|
1635
|
+
'config.embeddingEndpointInvalid': string;
|
|
1636
|
+
'config.embeddingModelInvalid': string;
|
|
1637
|
+
'config.embeddingSecurity': string;
|
|
1638
|
+
'config.embeddingTest': string;
|
|
1639
|
+
'config.embeddingNotTested': string;
|
|
1640
|
+
'config.embeddingTesting': string;
|
|
1641
|
+
'config.embeddingSaveBeforeTest': string;
|
|
1642
|
+
'config.embeddingTestUnavailable': string;
|
|
1643
|
+
'config.embeddingStatusAvailable': string;
|
|
1644
|
+
'config.embeddingStatusUnavailable': string;
|
|
1645
|
+
'config.embeddingStatusFailed': string;
|
|
1608
1646
|
'config.providerGlobalLocation': string;
|
|
1609
1647
|
'config.providerGlobalLocationHint': string;
|
|
1610
1648
|
'config.providerGlobalLocationWorkspaceHint': string;
|
|
@@ -7,3 +7,4 @@ export declare const DEFAULT_RECALL_HIGH_SCORE_THRESHOLD = 0.6;
|
|
|
7
7
|
export declare const DEFAULT_RECALL_CANDIDATE_MULTIPLIER = 3;
|
|
8
8
|
export declare const DEFAULT_RECALL_MAX_MEDIUM_RESULTS = 4;
|
|
9
9
|
export declare const DEFAULT_RECALL_MAX_UNKNOWN_RESULTS = 2;
|
|
10
|
+
export { DEFAULT_EMBEDDING_ENDPOINT, DEFAULT_EMBEDDING_MODEL } from './shared/contracts.ts';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import z from 'schemastery';
|
|
2
2
|
import type { Config as SharedConfig, CustomPackConfig as SharedCustomPackConfig, InteractionConfig as SharedInteractionConfig, ResolvedConfig as SharedResolvedConfig, ResolvedInteractionConfig as SharedResolvedInteractionConfig } from './shared/contracts.ts';
|
|
3
|
-
export { DEFAULT_IDLE_REVIEW_MS, DEFAULT_RECALL_CANDIDATE_MULTIPLIER, DEFAULT_RECALL_HIGH_SCORE_THRESHOLD, DEFAULT_RECALL_LIMIT, DEFAULT_RECALL_LOW_SCORE_THRESHOLD, DEFAULT_RECALL_MAX_MEDIUM_RESULTS, DEFAULT_RECALL_MAX_UNKNOWN_RESULTS, DEFAULT_RECALL_QUALITY_POLICY, DEFAULT_TIMEOUT_MS, } from './config-values.ts';
|
|
3
|
+
export { DEFAULT_IDLE_REVIEW_MS, DEFAULT_EMBEDDING_ENDPOINT, DEFAULT_EMBEDDING_MODEL, DEFAULT_RECALL_CANDIDATE_MULTIPLIER, DEFAULT_RECALL_HIGH_SCORE_THRESHOLD, DEFAULT_RECALL_LIMIT, DEFAULT_RECALL_LOW_SCORE_THRESHOLD, DEFAULT_RECALL_MAX_MEDIUM_RESULTS, DEFAULT_RECALL_MAX_UNKNOWN_RESULTS, DEFAULT_RECALL_QUALITY_POLICY, DEFAULT_TIMEOUT_MS, } from './config-values.ts';
|
|
4
4
|
export type Config = SharedConfig;
|
|
5
5
|
export type CustomPackConfig = SharedCustomPackConfig;
|
|
6
6
|
export type InteractionConfig = SharedInteractionConfig;
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import type { HostAgent, HostContextShape } from './contracts.ts';
|
|
2
2
|
import type { ResolvedConfig } from './config.ts';
|
|
3
|
-
import type
|
|
3
|
+
import { type RuntimeMemoryController } from './runtime-memory.ts';
|
|
4
4
|
import type { MemoryWake } from '../packages/contracts/src/index.ts';
|
|
5
5
|
export declare const GUIDANCE_SECTION_NAME = "mnemon:routing";
|
|
6
|
+
export declare const RUNTIME_MEMORY_PROTOCOL_SECTION_NAME = "mnemon:runtime-memory-protocol";
|
|
6
7
|
export declare const RUNTIME_MEMORY_CONTEXT_NAME = "mnemon:runtime-memory";
|
|
7
8
|
export declare const ROUTING_GUIDANCE = "Use memory only when needed. Search Mnemon Documents for substantial project records. Call mnemon_recall for durable history or exact prior details; never infer a missing historical rule. Put only new user facts or explicit save/correction requests in mnemon_runtime_memory; never cache retrieved evidence. A write exists only after its receipt.";
|
|
8
|
-
/** Replace the already-materialized Agent context with the Wake pinned during assembly. */
|
|
9
|
+
/** Replace the already-materialized Agent protocol and context with the Wake pinned during assembly. */
|
|
9
10
|
export declare function applyAgentMemoryViewWake<T extends {
|
|
11
|
+
sections: Array<{
|
|
12
|
+
name: string;
|
|
13
|
+
text: string;
|
|
14
|
+
}>;
|
|
10
15
|
contexts: Array<{
|
|
11
16
|
name: string;
|
|
12
17
|
text: string;
|
|
@@ -38,6 +38,8 @@ export interface MemoryProviderAdapter {
|
|
|
38
38
|
graph(body: MemoryBody, signal?: AbortSignal): Promise<MemoryGraphSnapshot>;
|
|
39
39
|
list(body: MemoryBody, request: MemoryListRequest, signal?: AbortSignal): Promise<Insight[]>;
|
|
40
40
|
remember(body: MemoryBody, request: RememberRequest, signal?: AbortSignal): Promise<JsonValue>;
|
|
41
|
+
/** Persist an ordered host-authorized batch and return one receipt per request. */
|
|
42
|
+
rememberMany?(body: MemoryBody, requests: readonly RememberRequest[], signal?: AbortSignal): Promise<JsonValue[]>;
|
|
41
43
|
related?(body: MemoryBody, id: string, depth: number, edge?: EdgeType, signal?: AbortSignal): Promise<Insight[]>;
|
|
42
44
|
link?(body: MemoryBody, sourceId: string, targetId: string, type: EdgeType, weight: number, reason?: string, signal?: AbortSignal): Promise<JsonValue>;
|
|
43
45
|
forget?(body: MemoryBody, id: string, signal?: AbortSignal): Promise<JsonValue>;
|
|
@@ -6,9 +6,9 @@ import type { AuthorityCommitRecorder } from './memory-receipts.ts';
|
|
|
6
6
|
import { type LlmMemoryPlacementSelection, type PreparedMemoryPlacement } from './provider-placement.ts';
|
|
7
7
|
import { type MemoryProviderAdapterRegistry } from './providers/registry.ts';
|
|
8
8
|
import { type RecallQualityPolicyRegistry } from './recall-quality/index.ts';
|
|
9
|
-
import { type EdgeType, type EntityView, type Insight, type MemoryBodyCatalog, type MemoryBodyMetadataUpdate, type MemoryBodyView, type MemoryGraphSnapshot, type MemoryListRequest, type MemoryListView, type MemoryPlacementDecision, type MemoryReadSource, type RememberRequest, type SearchRequest, type StatusView } from './shared/contracts.ts';
|
|
9
|
+
import { type EdgeType, type EntityView, type Insight, type MemoryBodyCatalog, type MemoryBodyMetadataUpdate, type MemoryBodyView, type MemoryGraphSnapshot, type MemoryListRequest, type MemoryListView, type MnemonEmbeddingStatus, type MemoryPlacementDecision, type MemoryReadSource, type RememberRequest, type SearchRequest, type StatusView } from './shared/contracts.ts';
|
|
10
10
|
export { CATEGORIES, EDGE_TYPES, INTENTS, SOURCES } from './shared/contracts.ts';
|
|
11
|
-
export type { Category, EdgeType, EntityView, Insight, Intent, MemoryBodyCatalog, MemoryBodyStats, MemoryBodyView, MemoryGraphEdge, MemoryGraphNode, MemoryGraphSnapshot, MemoryListRequest, MemoryListView, MemoryReadSource, RecallQualityStats, RememberRequest, SearchRequest, Source, StatusView, } from './shared/contracts.ts';
|
|
11
|
+
export type { Category, EdgeType, EntityView, Insight, Intent, MemoryBodyCatalog, MemoryBodyStats, MemoryBodyView, MemoryGraphEdge, MemoryGraphNode, MemoryGraphSnapshot, MemoryListRequest, MemoryListView, MnemonEmbeddingStatus, MemoryReadSource, RecallQualityStats, RememberRequest, SearchRequest, Source, StatusView, } from './shared/contracts.ts';
|
|
12
12
|
export interface MemoryBodyMetadataSample {
|
|
13
13
|
memoryBodyId: string;
|
|
14
14
|
name: string;
|
|
@@ -40,6 +40,8 @@ export declare class MnemonService {
|
|
|
40
40
|
memoryRevision(): string;
|
|
41
41
|
/** Return a usable system snapshot without waiting for any Provider I/O. */
|
|
42
42
|
statusSummary(): StatusView;
|
|
43
|
+
/** Probe the effective Mnemon embedding runtime and its default Store coverage. */
|
|
44
|
+
embeddingStatus(signal?: AbortSignal): Promise<MnemonEmbeddingStatus>;
|
|
43
45
|
status(signal?: AbortSignal): Promise<StatusView>;
|
|
44
46
|
reconnectBody(id: string, signal?: AbortSignal): Promise<MemoryBodyView>;
|
|
45
47
|
search(request: SearchRequest, signal?: AbortSignal): Promise<{
|
|
@@ -59,6 +61,12 @@ export declare class MnemonService {
|
|
|
59
61
|
list(request?: MemoryListRequest, signal?: AbortSignal): Promise<MemoryListView>;
|
|
60
62
|
entities(entity?: string, limit?: number, signal?: AbortSignal): Promise<EntityView>;
|
|
61
63
|
remember(request: RememberRequest, signal?: AbortSignal): Promise<JsonValue>;
|
|
64
|
+
/**
|
|
65
|
+
* Persist a host-authorized set of exact memories without involving a model
|
|
66
|
+
* in the data plane. Mnemon Native requests share one import per destination;
|
|
67
|
+
* other Providers retain their adapter-defined write semantics.
|
|
68
|
+
*/
|
|
69
|
+
rememberMany(requests: readonly RememberRequest[], signal?: AbortSignal): Promise<JsonValue[]>;
|
|
62
70
|
related(id: string, depth?: number, edge?: EdgeType, signal?: AbortSignal, memoryBodyId?: string): Promise<Insight[]>;
|
|
63
71
|
link(sourceId: string, targetId: string, type?: EdgeType, weight?: number, reason?: string, signal?: AbortSignal, memoryBodyId?: string): Promise<JsonValue>;
|
|
64
72
|
forget(id: string, signal?: AbortSignal, memoryBodyId?: string): Promise<JsonValue>;
|
|
@@ -88,6 +96,7 @@ export declare class MnemonService {
|
|
|
88
96
|
private nativeMetadataSample;
|
|
89
97
|
private nativeSearch;
|
|
90
98
|
private nativeRemember;
|
|
99
|
+
private nativeRememberMany;
|
|
91
100
|
private nativeRelated;
|
|
92
101
|
private nativeLink;
|
|
93
102
|
private nativeForget;
|
|
@@ -95,6 +104,7 @@ export declare class MnemonService {
|
|
|
95
104
|
private readBodies;
|
|
96
105
|
private readBody;
|
|
97
106
|
private writeBody;
|
|
107
|
+
private prepareRemember;
|
|
98
108
|
private annotate;
|
|
99
109
|
private annotateResult;
|
|
100
110
|
private activateAfterWrite;
|
|
@@ -8,6 +8,8 @@ export declare const MNEMON_PACK_CHANNEL = "/dsh-mnemon-pack";
|
|
|
8
8
|
export declare const MNEMON_SETTINGS_CHANNEL = "/dsh-mnemon-settings";
|
|
9
9
|
export declare const MNEMON_SETTINGS_NAMESPACE = "mnemon";
|
|
10
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";
|
|
11
13
|
export type JsonPrimitive = string | number | boolean | null;
|
|
12
14
|
export type JsonValue = JsonPrimitive | JsonValue[] | {
|
|
13
15
|
[key: string]: JsonValue;
|
|
@@ -119,6 +121,8 @@ export interface Config {
|
|
|
119
121
|
store?: string;
|
|
120
122
|
timeoutMs?: number;
|
|
121
123
|
defaultRecallLimit?: number;
|
|
124
|
+
/** Optional DSH-owned overrides injected into every Mnemon CLI process. */
|
|
125
|
+
embedding?: MnemonEmbeddingConfig;
|
|
122
126
|
memoryTopology?: MemoryTopologyConfig;
|
|
123
127
|
recallQuality?: RecallQualityConfig;
|
|
124
128
|
routingGuidance?: boolean;
|
|
@@ -141,6 +145,17 @@ export interface Config {
|
|
|
141
145
|
/** Model route used by clean, session-independent maintenance Agents. */
|
|
142
146
|
taskAgentModel?: TaskAgentModelConfig;
|
|
143
147
|
}
|
|
148
|
+
export interface MnemonEmbeddingConfig {
|
|
149
|
+
/** When false or omitted, Mnemon keeps its inherited environment and built-in defaults. */
|
|
150
|
+
enabled?: boolean;
|
|
151
|
+
endpoint?: string;
|
|
152
|
+
model?: string;
|
|
153
|
+
}
|
|
154
|
+
export interface ResolvedMnemonEmbeddingConfig {
|
|
155
|
+
enabled: boolean;
|
|
156
|
+
endpoint: string;
|
|
157
|
+
model: string;
|
|
158
|
+
}
|
|
144
159
|
export interface TaskAgentModelConfig {
|
|
145
160
|
mode?: 'inherit' | 'fixed';
|
|
146
161
|
provider?: string;
|
|
@@ -192,6 +207,7 @@ export interface ResolvedConfig {
|
|
|
192
207
|
store?: string;
|
|
193
208
|
timeoutMs: number;
|
|
194
209
|
defaultRecallLimit: number;
|
|
210
|
+
embedding: ResolvedMnemonEmbeddingConfig;
|
|
195
211
|
memoryTopology: ResolvedMemoryTopologyConfig;
|
|
196
212
|
recallQuality: ResolvedRecallQualityConfig;
|
|
197
213
|
routingGuidance: boolean;
|
|
@@ -211,6 +227,13 @@ export interface ResolvedConfig {
|
|
|
211
227
|
persistenceStrategy: ResolvedMemoryPersistenceStrategy;
|
|
212
228
|
taskAgentModel: ResolvedTaskAgentModelConfig;
|
|
213
229
|
}
|
|
230
|
+
export interface MnemonEmbeddingStatus {
|
|
231
|
+
available: boolean;
|
|
232
|
+
model: string;
|
|
233
|
+
totalInsights: number;
|
|
234
|
+
embedded: number;
|
|
235
|
+
coverage: string;
|
|
236
|
+
}
|
|
214
237
|
export interface ResolvedInteractionConfig {
|
|
215
238
|
turnBar: boolean;
|
|
216
239
|
saveAction: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mnemon",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Composable three-tier memory control plane for DeepSeek Harness: persistent runtime context, searchable project documents, pluggable long-term memory, guarded strategies, WebUI, and headless tools.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek-harness",
|