dsh-mnemon 0.2.16 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -8
- package/README.zh-CN.md +16 -8
- package/SECURITY.md +12 -5
- package/lib/client.js +294 -33
- package/lib/contracts.js +36 -0
- package/lib/extension-sdk.js +238 -0
- package/lib/index.js +1944 -2865
- package/lib/kernel.js +1126 -0
- package/lib/layers/documents.js +31 -0
- package/lib/layers/memory-spaces.js +34 -0
- package/lib/layers/runtime.js +27 -0
- package/lib/provider-sdk.js +2 -0
- package/lib/registry-B9SdBRLo.js +2423 -0
- package/lib/strategy-default-three-tier.js +99 -0
- package/lib/strategy-sdk.js +56 -0
- package/lib/types/packages/contracts/src/index.d.ts +221 -0
- package/lib/types/packages/extension-sdk/src/index.d.ts +54 -0
- package/lib/types/packages/kernel/src/access.d.ts +14 -0
- package/lib/types/packages/kernel/src/catalog.d.ts +42 -0
- package/lib/types/packages/kernel/src/index.d.ts +5 -0
- package/lib/types/packages/kernel/src/kernel.d.ts +46 -0
- package/lib/types/packages/kernel/src/topology.d.ts +25 -0
- package/lib/types/packages/kernel/src/view.d.ts +78 -0
- package/lib/types/packages/layer-documents/src/index.d.ts +4 -0
- package/lib/types/packages/layer-memory-spaces/src/index.d.ts +4 -0
- package/lib/types/packages/layer-runtime/src/index.d.ts +4 -0
- package/lib/types/packages/provider-sdk/src/index.d.ts +19 -0
- package/lib/types/packages/strategy-default-three-tier/src/index.d.ts +7 -0
- package/lib/types/packages/strategy-sdk/src/index.d.ts +35 -0
- package/lib/types/{client → src/client}/api.d.ts +2 -1
- package/lib/types/{client → src/client}/locales.d.ts +38 -0
- package/lib/types/{contracts.d.ts → src/contracts.d.ts} +3 -0
- package/lib/types/{documents.d.ts → src/documents.d.ts} +7 -2
- package/lib/types/src/guidance.d.ts +23 -0
- package/lib/types/{index.d.ts → src/index.d.ts} +3 -1
- package/lib/types/{lifecycle.d.ts → src/lifecycle.d.ts} +5 -9
- package/lib/types/{live-runtime.d.ts → src/live-runtime.d.ts} +30 -3
- package/lib/types/{memory-bodies.d.ts → src/memory-bodies.d.ts} +3 -0
- package/lib/types/src/memory-receipts.d.ts +21 -0
- package/lib/types/src/memory-system/access.d.ts +2 -0
- package/lib/types/src/memory-system/catalog.d.ts +2 -0
- package/lib/types/src/memory-system/contracts.d.ts +2 -0
- package/lib/types/src/memory-system/defaults.d.ts +6 -0
- package/lib/types/src/memory-system/index.d.ts +7 -0
- package/lib/types/src/memory-system/kernel.d.ts +2 -0
- package/lib/types/src/memory-system/topology.d.ts +2 -0
- package/lib/types/src/memory-system/view.d.ts +2 -0
- package/lib/types/src/memory-view.d.ts +15 -0
- package/lib/types/src/provider-sdk.d.ts +4 -0
- package/lib/types/src/providers/memory-system.d.ts +6 -0
- package/lib/types/src/providers/registry.d.ts +23 -0
- package/lib/types/{runtime-memory.d.ts → src/runtime-memory.d.ts} +14 -5
- package/lib/types/src/search-tokens.d.ts +5 -0
- package/lib/types/{service.d.ts → src/service.d.ts} +9 -1
- package/lib/types/{shared → src/shared}/contracts.d.ts +25 -0
- package/lib/types/{subagent.d.ts → src/subagent.d.ts} +29 -21
- package/lib/types/{tools.d.ts → src/tools.d.ts} +2 -9
- package/package.json +42 -6
- package/lib/types/guidance.d.ts +0 -11
- /package/lib/types/{activity.d.ts → src/activity.d.ts} +0 -0
- /package/lib/types/{channels.d.ts → src/channels.d.ts} +0 -0
- /package/lib/types/{client → src/client}/GlobalLocationSetting.d.ts +0 -0
- /package/lib/types/{client → src/client}/MnemonDialog.d.ts +0 -0
- /package/lib/types/{client → src/client}/MnemonLogo.d.ts +0 -0
- /package/lib/types/{client → src/client}/MnemonPackSection.d.ts +0 -0
- /package/lib/types/{client → src/client}/MnemonSaveAction.d.ts +0 -0
- /package/lib/types/{client → src/client}/MnemonSettingsCard.d.ts +0 -0
- /package/lib/types/{client → src/client}/MnemonTurnTail.d.ts +0 -0
- /package/lib/types/{client → src/client}/MnemonView.d.ts +0 -0
- /package/lib/types/{client → src/client}/MnemonViewAppearance.d.ts +0 -0
- /package/lib/types/{client → src/client}/ProviderIcon.d.ts +0 -0
- /package/lib/types/{client → src/client}/ProviderSettingsSection.d.ts +0 -0
- /package/lib/types/{client → src/client}/anchor.d.ts +0 -0
- /package/lib/types/{client → src/client}/dsh-compat.d.ts +0 -0
- /package/lib/types/{client → src/client}/index.d.ts +0 -0
- /package/lib/types/{client → src/client}/settings.d.ts +0 -0
- /package/lib/types/{client → src/client}/sidebar-entry.d.ts +0 -0
- /package/lib/types/{client → src/client}/use-request-version.d.ts +0 -0
- /package/lib/types/{client → src/client}/workspace-controller.d.ts +0 -0
- /package/lib/types/{client → src/client}/workspace-mount.d.ts +0 -0
- /package/lib/types/{commands.d.ts → src/commands.d.ts} +0 -0
- /package/lib/types/{config-values.d.ts → src/config-values.d.ts} +0 -0
- /package/lib/types/{config.d.ts → src/config.d.ts} +0 -0
- /package/lib/types/{pack.d.ts → src/pack.d.ts} +0 -0
- /package/lib/types/{process.d.ts → src/process.d.ts} +0 -0
- /package/lib/types/{provider-placement.d.ts → src/provider-placement.d.ts} +0 -0
- /package/lib/types/{providers → src/providers}/byterover.d.ts +0 -0
- /package/lib/types/{providers → src/providers}/catalog.d.ts +0 -0
- /package/lib/types/{providers → src/providers}/hindsight.d.ts +0 -0
- /package/lib/types/{providers → src/providers}/holographic.d.ts +0 -0
- /package/lib/types/{providers → src/providers}/honcho.d.ts +0 -0
- /package/lib/types/{providers → src/providers}/http.d.ts +0 -0
- /package/lib/types/{providers → src/providers}/mem0.d.ts +0 -0
- /package/lib/types/{providers → src/providers}/openviking.d.ts +0 -0
- /package/lib/types/{providers → src/providers}/provider.d.ts +0 -0
- /package/lib/types/{providers → src/providers}/retaindb.d.ts +0 -0
- /package/lib/types/{providers → src/providers}/supermemory.d.ts +0 -0
- /package/lib/types/{recall-quality → src/recall-quality}/contracts.d.ts +0 -0
- /package/lib/types/{recall-quality → src/recall-quality}/engine.d.ts +0 -0
- /package/lib/types/{recall-quality → src/recall-quality}/index.d.ts +0 -0
- /package/lib/types/{recall-quality → src/recall-quality}/policies.d.ts +0 -0
- /package/lib/types/{recall-quality → src/recall-quality}/registry.d.ts +0 -0
- /package/lib/types/{review-activity.d.ts → src/review-activity.d.ts} +0 -0
- /package/lib/types/{rpc.d.ts → src/rpc.d.ts} +0 -0
- /package/lib/types/{runner.d.ts → src/runner.d.ts} +0 -0
- /package/lib/types/{settings.d.ts → src/settings.d.ts} +0 -0
- /package/lib/types/{storage-scope.d.ts → src/storage-scope.d.ts} +0 -0
- /package/lib/types/{version-updates.d.ts → src/version-updates.d.ts} +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { MemoryAdapterDescriptor } from '../../contracts/src/index.ts';
|
|
2
|
+
export interface MemoryAdapterFactory<Id extends string, Context, Adapter extends {
|
|
3
|
+
readonly id: Id;
|
|
4
|
+
}> {
|
|
5
|
+
readonly id: Id;
|
|
6
|
+
create(context: Context): Adapter;
|
|
7
|
+
}
|
|
8
|
+
/** Lifecycle-owned factory directory used by Provider plugins and the Host. */
|
|
9
|
+
export declare class MemoryAdapterFactoryRegistry<Id extends string, Context, Adapter extends {
|
|
10
|
+
readonly id: Id;
|
|
11
|
+
}> {
|
|
12
|
+
private readonly factories;
|
|
13
|
+
constructor(factories?: readonly MemoryAdapterFactory<Id, Context, Adapter>[]);
|
|
14
|
+
register(factory: MemoryAdapterFactory<Id, Context, Adapter>): () => void;
|
|
15
|
+
create(context: Context): Map<Id, Adapter>;
|
|
16
|
+
ids(): Id[];
|
|
17
|
+
}
|
|
18
|
+
export declare function defineMemoryAdapterDescriptor<T extends MemoryAdapterDescriptor>(descriptor: T): T;
|
|
19
|
+
export type { MemoryAdapterDescriptor, MemoryAdapterLocality, MemoryAdapterScope, MemoryCapability, MemoryJsonValue, } from '../../contracts/src/index.ts';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { MemoryCatalog, MemoryLayerRegistration, MemoryStrategyRegistration } from '../../kernel/src/index.ts';
|
|
2
|
+
import type { MemoryLayerParticipation, MemoryTopologyDefinition } from '../../contracts/src/index.ts';
|
|
3
|
+
export declare const BUILTIN_MEMORY_LAYERS: readonly [Readonly<import("../../contracts/src/index.ts").MemoryLayerDescriptor>, Readonly<import("../../contracts/src/index.ts").MemoryLayerDescriptor>, Readonly<import("../../contracts/src/index.ts").MemoryLayerDescriptor>];
|
|
4
|
+
export declare const DEFAULT_LAYER_PARTICIPATION: Readonly<MemoryLayerParticipation>;
|
|
5
|
+
export declare const DEFAULT_THREE_TIER_TOPOLOGY: Readonly<MemoryTopologyDefinition>;
|
|
6
|
+
export declare const DEFAULT_THREE_TIER_STRATEGY: MemoryStrategyRegistration;
|
|
7
|
+
export declare function registerDefaultMemorySystem(catalog: MemoryCatalog, layers?: Partial<Record<string, Omit<MemoryLayerRegistration, 'descriptor'>>>): () => void;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { MemoryPlanProposal, MemoryPlanRequest, MemorySystemDescriptor } from '../../contracts/src/index.ts';
|
|
2
|
+
import type { MemoryStrategyRegistration } from '../../kernel/src/index.ts';
|
|
3
|
+
export declare const MEMORY_STRATEGY_PLUGIN_API_VERSION: "dsh-mnemon/v1alpha1";
|
|
4
|
+
export interface MemoryStrategyPluginManifest {
|
|
5
|
+
apiVersion: typeof MEMORY_STRATEGY_PLUGIN_API_VERSION;
|
|
6
|
+
kind: 'MemoryStrategyPlugin';
|
|
7
|
+
metadata: {
|
|
8
|
+
id: string;
|
|
9
|
+
version: string;
|
|
10
|
+
label: string;
|
|
11
|
+
description: string;
|
|
12
|
+
};
|
|
13
|
+
permissions: {
|
|
14
|
+
layerIds: string[];
|
|
15
|
+
adapterIds: string[];
|
|
16
|
+
capabilities: MemoryPlanRequest['capability'][];
|
|
17
|
+
maxSteps: number;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface MemoryStrategyPlugin {
|
|
21
|
+
manifest: MemoryStrategyPluginManifest;
|
|
22
|
+
strategy: MemoryStrategyRegistration;
|
|
23
|
+
}
|
|
24
|
+
/** Define an immutable, declarative strategy package; the Kernel remains authoritative. */
|
|
25
|
+
export declare function defineMemoryStrategyPlugin(plugin: MemoryStrategyPlugin): Readonly<MemoryStrategyPlugin>;
|
|
26
|
+
export interface MemoryStrategyReplayCase {
|
|
27
|
+
request: MemoryPlanRequest;
|
|
28
|
+
descriptor: MemorySystemDescriptor;
|
|
29
|
+
assert(proposal: MemoryPlanProposal): void | Promise<void>;
|
|
30
|
+
}
|
|
31
|
+
/** Deterministic replay primitive for generated and hand-written strategies. */
|
|
32
|
+
export declare function replayMemoryStrategy(strategy: MemoryStrategyRegistration, cases: readonly MemoryStrategyReplayCase[]): Promise<void>;
|
|
33
|
+
export declare function defineMemoryStrategy<T extends MemoryStrategyRegistration>(strategy: T): T;
|
|
34
|
+
export type { MemoryPlanProposal, MemoryPlanRequest, MemoryStrategyDescriptor, MemoryStrategyHook, MemorySystemDescriptor, } from '../../contracts/src/index.ts';
|
|
35
|
+
export type { MemoryStrategyContext, MemoryStrategyRegistration } from '../../kernel/src/index.ts';
|
|
@@ -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 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 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
|
+
memorySystem(): Promise<MemorySystemDescriptor>;
|
|
27
28
|
taskAgentModels(includeCatalog?: boolean): Promise<TaskAgentModelCatalog>;
|
|
28
29
|
versions(): Promise<VersionStatus>;
|
|
29
30
|
updateVersion(component: VersionComponentId): Promise<VersionUpdateResult>;
|
|
@@ -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;
|
|
@@ -704,6 +706,23 @@ export declare const zh: {
|
|
|
704
706
|
'config.customHintShort': string;
|
|
705
707
|
'config.customSelected': string;
|
|
706
708
|
'config.globalScopeHint': string;
|
|
709
|
+
'config.topologyTitle': string;
|
|
710
|
+
'config.topologyDescription': string;
|
|
711
|
+
'config.topologyLoading': string;
|
|
712
|
+
'config.topologyUnavailable': string;
|
|
713
|
+
'config.topologyEnabled': string;
|
|
714
|
+
'config.topologyDisabled': string;
|
|
715
|
+
'config.topologyLayerToggle': string;
|
|
716
|
+
'layers.runtimeLabel': string;
|
|
717
|
+
'layers.runtimeDescription': string;
|
|
718
|
+
'layers.documentsLabel': string;
|
|
719
|
+
'layers.documentsDescription': string;
|
|
720
|
+
'layers.memorySpacesLabel': string;
|
|
721
|
+
'layers.memorySpacesDescription': string;
|
|
722
|
+
'layers.disabledBadge': string;
|
|
723
|
+
'layers.disabledTitle': string;
|
|
724
|
+
'layers.disabledDescription': string;
|
|
725
|
+
'layers.disabledText': string;
|
|
707
726
|
'config.providersTitle': string;
|
|
708
727
|
'config.providersDescription': string;
|
|
709
728
|
'config.nativeSummary': string;
|
|
@@ -1344,7 +1363,9 @@ export declare const en: {
|
|
|
1344
1363
|
'entities.action': string;
|
|
1345
1364
|
'entities.top': string;
|
|
1346
1365
|
'entities.frequency': string;
|
|
1366
|
+
'entities.filterHint': string;
|
|
1347
1367
|
'entities.emptyRail': string;
|
|
1368
|
+
'entities.filterEmpty': string;
|
|
1348
1369
|
'entities.loading': string;
|
|
1349
1370
|
'entities.selectTitle': string;
|
|
1350
1371
|
'entities.selectText': string;
|
|
@@ -1563,6 +1584,23 @@ export declare const en: {
|
|
|
1563
1584
|
'config.customHintShort': string;
|
|
1564
1585
|
'config.customSelected': string;
|
|
1565
1586
|
'config.globalScopeHint': string;
|
|
1587
|
+
'config.topologyTitle': string;
|
|
1588
|
+
'config.topologyDescription': string;
|
|
1589
|
+
'config.topologyLoading': string;
|
|
1590
|
+
'config.topologyUnavailable': string;
|
|
1591
|
+
'config.topologyEnabled': string;
|
|
1592
|
+
'config.topologyDisabled': string;
|
|
1593
|
+
'config.topologyLayerToggle': string;
|
|
1594
|
+
'layers.runtimeLabel': string;
|
|
1595
|
+
'layers.runtimeDescription': string;
|
|
1596
|
+
'layers.documentsLabel': string;
|
|
1597
|
+
'layers.documentsDescription': string;
|
|
1598
|
+
'layers.memorySpacesLabel': string;
|
|
1599
|
+
'layers.memorySpacesDescription': string;
|
|
1600
|
+
'layers.disabledBadge': string;
|
|
1601
|
+
'layers.disabledTitle': string;
|
|
1602
|
+
'layers.disabledDescription': string;
|
|
1603
|
+
'layers.disabledText': string;
|
|
1566
1604
|
'config.providersTitle': string;
|
|
1567
1605
|
'config.providersDescription': string;
|
|
1568
1606
|
'config.nativeSummary': string;
|
|
@@ -145,6 +145,7 @@ export interface HostAgent {
|
|
|
145
145
|
session: {
|
|
146
146
|
header?: {
|
|
147
147
|
origin?: 'subagent';
|
|
148
|
+
parentSession?: string;
|
|
148
149
|
delegationDepth?: number;
|
|
149
150
|
cwd?: string;
|
|
150
151
|
agentPreset?: string;
|
|
@@ -266,6 +267,8 @@ export interface HostContextShape {
|
|
|
266
267
|
/** Web workbench catalog; Agent execution routes by session cwd without it. */
|
|
267
268
|
workspaceRegistry?: HostWorkspaceRegistry;
|
|
268
269
|
get(name: string): unknown;
|
|
270
|
+
/** Cordis service publication; optional only for narrow test/headless shims. */
|
|
271
|
+
provide?(name: string, value?: unknown, check?: () => boolean): unknown;
|
|
269
272
|
inject(services: string[], callback: (ctx: HostContextShape) => void): unknown;
|
|
270
273
|
on(name: string, listener: (...args: never[]) => unknown): () => unknown;
|
|
271
274
|
effect(callback: () => (() => unknown) | void, label?: string): () => unknown;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { HostAgent } from './contracts.ts';
|
|
2
2
|
import type { DocumentMutation, DocumentMutationResult, DocumentRecord, DocumentSearchResult, DocumentSnapshot, DocumentView } from './shared/contracts.ts';
|
|
3
|
+
import type { AuthorityCommitRecorder } from './memory-receipts.ts';
|
|
4
|
+
import type { MemoryMigrationLineage } from '../packages/contracts/src/index.ts';
|
|
3
5
|
export type { DocumentMutation, DocumentMutationResult, DocumentRecord, DocumentSearchResult, DocumentSnapshot, DocumentStatus, DocumentView } from './shared/contracts.ts';
|
|
4
6
|
export declare const DOCUMENTS_VERSION = 1;
|
|
5
7
|
export declare const DOCUMENTS_ACTIVE_LIMIT_BYTES: number;
|
|
@@ -22,6 +24,7 @@ export declare class DocumentConflictError extends Error {
|
|
|
22
24
|
export declare class DocumentController {
|
|
23
25
|
readonly limitBytes: number;
|
|
24
26
|
private readonly now;
|
|
27
|
+
private readonly recordCommit?;
|
|
25
28
|
readonly workspaceRoot: string;
|
|
26
29
|
readonly storageRoot: string;
|
|
27
30
|
readonly directory: string;
|
|
@@ -31,7 +34,7 @@ export declare class DocumentController {
|
|
|
31
34
|
readonly lockPath: string;
|
|
32
35
|
private readonly managedRelativePrefix;
|
|
33
36
|
private queue;
|
|
34
|
-
constructor(workspaceRoot: string, limitBytes?: number, now?: () => Date, storageRoot?: string);
|
|
37
|
+
constructor(workspaceRoot: string, limitBytes?: number, now?: () => Date, storageRoot?: string, recordCommit?: AuthorityCommitRecorder | undefined);
|
|
35
38
|
snapshot(): DocumentSnapshot;
|
|
36
39
|
get(id: string): DocumentView;
|
|
37
40
|
capacityPlan(request: DocumentMutation): DocumentCapacityPlan;
|
|
@@ -43,6 +46,7 @@ export declare class DocumentController {
|
|
|
43
46
|
archive(id: string, expectedRevision: number, details: {
|
|
44
47
|
summary: string;
|
|
45
48
|
memoryBodyIds: string[];
|
|
49
|
+
lineage?: readonly MemoryMigrationLineage[];
|
|
46
50
|
}): Promise<DocumentMutationResult>;
|
|
47
51
|
private mutateLocked;
|
|
48
52
|
private initialize;
|
|
@@ -65,8 +69,9 @@ export declare class DocumentManager {
|
|
|
65
69
|
private readonly limitBytes;
|
|
66
70
|
private readonly now;
|
|
67
71
|
private readonly storageRoot?;
|
|
72
|
+
private readonly recordCommit?;
|
|
68
73
|
private readonly controllers;
|
|
69
|
-
constructor(limitBytes?: number, now?: () => Date, storageRoot?: (() => string) | undefined);
|
|
74
|
+
constructor(limitBytes?: number, now?: () => Date, storageRoot?: (() => string) | undefined, recordCommit?: AuthorityCommitRecorder | undefined);
|
|
70
75
|
forWorkspace(workspaceRoot: string): DocumentController;
|
|
71
76
|
forAgent(agent: HostAgent): DocumentController;
|
|
72
77
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { HostAgent, HostContextShape } from './contracts.ts';
|
|
2
|
+
import type { ResolvedConfig } from './config.ts';
|
|
3
|
+
import type { RuntimeMemoryController } from './runtime-memory.ts';
|
|
4
|
+
import type { MemoryWake } from '../packages/contracts/src/index.ts';
|
|
5
|
+
export declare const GUIDANCE_SECTION_NAME = "mnemon:routing";
|
|
6
|
+
export declare const RUNTIME_MEMORY_CONTEXT_NAME = "mnemon:runtime-memory";
|
|
7
|
+
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
|
+
export declare function applyAgentMemoryViewWake<T extends {
|
|
10
|
+
contexts: Array<{
|
|
11
|
+
name: string;
|
|
12
|
+
text: string;
|
|
13
|
+
}>;
|
|
14
|
+
}>(assembly: T, wake: MemoryWake | undefined): T;
|
|
15
|
+
/** Register the non-recursive escape used by both legacy Runtime and View Wake contexts. */
|
|
16
|
+
export declare function registerMemoryPromptInterpolation(ctx: HostContextShape): void;
|
|
17
|
+
export declare function registerGuidance(ctx: HostContextShape, config?: Pick<ResolvedConfig, 'routingGuidance'>): void;
|
|
18
|
+
/** Project the latest committed USER.md/MEMORY.md as DSH's durable runtime-context snapshot. */
|
|
19
|
+
export declare function registerRuntimeMemoryContext(ctx: HostContextShape, runtimeMemory: RuntimeMemoryController, enabled?: () => boolean): void;
|
|
20
|
+
/** Shadow the global fallback with the current Agent workspace's hot memory. */
|
|
21
|
+
export declare function registerAgentRuntimeMemoryContext(agent: HostAgent, runtimeMemory: () => RuntimeMemoryController, enabled?: () => boolean): () => void;
|
|
22
|
+
/** Project only the immutable Wake pinned by the root Agent lifecycle. */
|
|
23
|
+
export declare function registerAgentMemoryViewContext(agent: HostAgent, wake: () => MemoryWake | undefined): () => void;
|
|
@@ -9,11 +9,13 @@ import { MnemonSubagentCoordinator } from './subagent.ts';
|
|
|
9
9
|
import { StorageScopeInspector } from './storage-scope.ts';
|
|
10
10
|
import { MnemonPackManager } from './pack.ts';
|
|
11
11
|
import { VersionUpdateManager } from './version-updates.ts';
|
|
12
|
+
import { MemoryBoot, MemoryExtensionHost } from '../packages/extension-sdk/src/index.ts';
|
|
12
13
|
export { BALANCED_RECALL_QUALITY_POLICY, EXHAUSTIVE_RECALL_QUALITY_POLICY, RecallQualityPolicyRegistry, STRICT_RECALL_QUALITY_POLICY, recallQualityPolicies, registerRecallQualityPolicy, } from './recall-quality/index.ts';
|
|
13
14
|
export type { RecallQualityCandidate, RecallQualityDecision, RecallQualityPolicy, RecallQualityPolicyContext, } from './recall-quality/index.ts';
|
|
14
15
|
export declare const name = "dsh-mnemon";
|
|
16
|
+
export declare const provide: string[];
|
|
15
17
|
export declare const inject: string[];
|
|
16
|
-
export { Config, InteractionConfig, resolveConfig, resolveInteractionConfig, DocumentManager, LiveMnemonRuntime, MnemonLifecycle, MnemonService, MnemonSubagentCoordinator, RuntimeMemoryController, StorageScopeInspector, MnemonPackManager, VersionUpdateManager, createRunner, createRuntimeGraph };
|
|
18
|
+
export { Config, InteractionConfig, resolveConfig, resolveInteractionConfig, DocumentManager, LiveMnemonRuntime, MemoryBoot, MemoryExtensionHost, MnemonLifecycle, MnemonService, MnemonSubagentCoordinator, RuntimeMemoryController, StorageScopeInspector, MnemonPackManager, VersionUpdateManager, createRunner, createRuntimeGraph };
|
|
17
19
|
export type { MnemonConfig };
|
|
18
20
|
/** Mount native model tools on every DSH surface and UI RPC only when Web connection exists. */
|
|
19
21
|
export declare function apply(rawContext: unknown, config?: MnemonConfig): void;
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import type { ResolvedConfig } from './config.ts';
|
|
2
|
-
import type {
|
|
2
|
+
import type { HostContextShape } from './contracts.ts';
|
|
3
3
|
import type { Insight, RememberRequest, SearchRequest } from './service.ts';
|
|
4
4
|
import type { RuntimeMemoryMutation } from './runtime-memory.ts';
|
|
5
5
|
import type { DocumentMutation } from './documents.ts';
|
|
6
6
|
import { MnemonSubagentCoordinator, type DelegatedWriteResult } from './subagent.ts';
|
|
7
7
|
import { type TurnMemoryActivitySnapshot } from './activity.ts';
|
|
8
|
-
import type { RuntimeMemoryController } from './runtime-memory.ts';
|
|
9
8
|
import type { AssistantMessageText, LifecycleSnapshot, TaskAgentModelCatalog } from './shared/contracts.ts';
|
|
10
9
|
import type { PreparedMemoryPlacement } from './provider-placement.ts';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
runtimeMemory: RuntimeMemoryController;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
10
|
+
import type { MnemonAgentRuntimeSource } from './live-runtime.ts';
|
|
11
|
+
type AgentRuntimeSource = Pick<MnemonAgentRuntimeSource, 'forAgent' | 'bindAgentRuntime'>;
|
|
16
12
|
export type { TurnMemoryActivity, TurnMemoryActivitySnapshot } from './activity.ts';
|
|
17
13
|
export type { AssistantMessageText, LifecycleAgentSnapshot, LifecycleCounters, LifecyclePhase, LifecycleSnapshot } from './shared/contracts.ts';
|
|
18
14
|
export declare const MNEMON_PLUGIN_SOURCE = "dsh-mnemon";
|
|
@@ -42,8 +38,8 @@ export declare class MnemonLifecycle {
|
|
|
42
38
|
turnActivities(sessionId: string): TurnMemoryActivitySnapshot;
|
|
43
39
|
/** Plain text of one finalized assistant message, resolved per session; null while absent. */
|
|
44
40
|
assistantMessage(sessionId: string, messageId: string): AssistantMessageText | null;
|
|
45
|
-
recall(sessionId: string, request: SearchRequest, signal?: AbortSignal): Promise<import("./subagent.ts").
|
|
46
|
-
related(sessionId: string, id: string, memoryBodyId?: string, signal?: AbortSignal): Promise<import("./subagent.ts").
|
|
41
|
+
recall(sessionId: string, request: SearchRequest, signal?: AbortSignal): Promise<import("./subagent.ts").RecallResult>;
|
|
42
|
+
related(sessionId: string, id: string, memoryBodyId?: string, signal?: AbortSignal): Promise<import("./subagent.ts").RecallResult>;
|
|
47
43
|
answer(sessionId: string, query: string, evidence: Insight[], signal?: AbortSignal): Promise<import("./subagent.ts").DelegatedAnswerResult>;
|
|
48
44
|
/** Synthesize a Web Agent Query without borrowing a conversation Agent or its history. */
|
|
49
45
|
answerTask(sessionId: string, query: string, evidence: Insight[], workspaceRoot?: string, signal?: AbortSignal): Promise<import("./subagent.ts").DelegatedAnswerResult>;
|
|
@@ -6,6 +6,11 @@ import { type MnemonRunner } from './runner.ts';
|
|
|
6
6
|
import { RuntimeMemoryController } from './runtime-memory.ts';
|
|
7
7
|
import { MnemonService } from './service.ts';
|
|
8
8
|
import { StorageScopeInspector } from './storage-scope.ts';
|
|
9
|
+
import { MemoryCatalog } from './memory-system/catalog.ts';
|
|
10
|
+
import { MemoryKernel } from './memory-system/kernel.ts';
|
|
11
|
+
import { MemoryTopologyManager } from './memory-system/topology.ts';
|
|
12
|
+
import type { MemoryBoot } from '../packages/extension-sdk/src/index.ts';
|
|
13
|
+
import type { MemoryTurnViewManager } from '../packages/kernel/src/index.ts';
|
|
9
14
|
export interface MnemonRuntimeGraph {
|
|
10
15
|
config: ResolvedConfig;
|
|
11
16
|
runner: MnemonRunner;
|
|
@@ -14,24 +19,39 @@ export interface MnemonRuntimeGraph {
|
|
|
14
19
|
documents: DocumentManager;
|
|
15
20
|
storage: StorageScopeInspector;
|
|
16
21
|
packs: MnemonPackManager;
|
|
22
|
+
memoryCatalog: MemoryCatalog;
|
|
23
|
+
memoryTopology: MemoryTopologyManager;
|
|
24
|
+
memoryKernel: MemoryKernel;
|
|
25
|
+
memoryViews: MemoryTurnViewManager;
|
|
26
|
+
/** Detach this generation from future Host-global extension changes. */
|
|
27
|
+
dispose(): void;
|
|
28
|
+
}
|
|
29
|
+
export interface MnemonAgentRuntimeSource {
|
|
30
|
+
readonly config: ResolvedConfig;
|
|
31
|
+
forAgent(agent: HostAgent): MnemonRuntimeGraph;
|
|
32
|
+
/** Pin every tool in one Agent turn to the same immutable runtime generation. */
|
|
33
|
+
bindAgentRuntime(agentId: string, graph: MnemonRuntimeGraph): () => void;
|
|
17
34
|
}
|
|
18
35
|
/**
|
|
19
36
|
* Build a complete generation before it can become visible. Constructors also
|
|
20
37
|
* validate and initialize the selected storage root, so a failed candidate is
|
|
21
38
|
* rejected by DSH settings validation without disturbing the active graph.
|
|
22
39
|
*/
|
|
23
|
-
export declare function createRuntimeGraph(config: ResolvedConfig, workspaceRoot?: string): MnemonRuntimeGraph;
|
|
40
|
+
export declare function createRuntimeGraph(config: ResolvedConfig, workspaceRoot?: string, extensions?: MemoryBoot): MnemonRuntimeGraph;
|
|
24
41
|
/**
|
|
25
42
|
* Stable faces handed to DSH registrations. `swap` is synchronous and contains
|
|
26
43
|
* no user code, so all faces move to the same prevalidated generation in one
|
|
27
44
|
* JavaScript turn. A method obtained before the swap stays bound to its old
|
|
28
45
|
* generation until that invocation settles.
|
|
29
46
|
*/
|
|
30
|
-
export declare class LiveMnemonRuntime {
|
|
47
|
+
export declare class LiveMnemonRuntime implements MnemonAgentRuntimeSource {
|
|
31
48
|
private readonly workspaceRegistry?;
|
|
32
49
|
private readonly agents?;
|
|
50
|
+
private readonly extensions?;
|
|
33
51
|
private current;
|
|
34
52
|
private readonly workspaceGraphs;
|
|
53
|
+
private readonly agentGraphs;
|
|
54
|
+
private closed;
|
|
35
55
|
readonly config: ResolvedConfig;
|
|
36
56
|
readonly runner: MnemonRunner;
|
|
37
57
|
readonly service: MnemonService;
|
|
@@ -39,9 +59,15 @@ export declare class LiveMnemonRuntime {
|
|
|
39
59
|
readonly documents: DocumentManager;
|
|
40
60
|
readonly storage: StorageScopeInspector;
|
|
41
61
|
readonly packs: MnemonPackManager;
|
|
42
|
-
|
|
62
|
+
readonly memoryCatalog: MemoryCatalog;
|
|
63
|
+
readonly memoryTopology: MemoryTopologyManager;
|
|
64
|
+
readonly memoryKernel: MemoryKernel;
|
|
65
|
+
readonly memoryViews: MemoryTurnViewManager;
|
|
66
|
+
constructor(initial: MnemonRuntimeGraph, workspaceRegistry?: HostWorkspaceRegistry | undefined, agents?: HostAgentsService | undefined, extensions?: MemoryBoot | undefined);
|
|
43
67
|
swap(next: MnemonRuntimeGraph): void;
|
|
44
68
|
snapshot(): MnemonRuntimeGraph;
|
|
69
|
+
bindAgentRuntime(agentId: string, graph: MnemonRuntimeGraph): () => void;
|
|
70
|
+
dispose(): void;
|
|
45
71
|
/** Resolve the runtime that must serve one Agent execution. */
|
|
46
72
|
forAgent(agent: HostAgent): MnemonRuntimeGraph;
|
|
47
73
|
/** Resolve an authorized DSH workspace selected by the Web workbench. */
|
|
@@ -59,6 +85,7 @@ export declare class LiveMnemonRuntime {
|
|
|
59
85
|
aligned: boolean;
|
|
60
86
|
};
|
|
61
87
|
private forWorkspacePath;
|
|
88
|
+
private assertOpen;
|
|
62
89
|
private agent;
|
|
63
90
|
private requireWorkspace;
|
|
64
91
|
private workspaceForPath;
|
|
@@ -43,11 +43,14 @@ export declare class MemoryBodyRegistry {
|
|
|
43
43
|
updateMetadata(updates: readonly MemoryBodyMetadataUpdate[]): MemoryBody[];
|
|
44
44
|
remove(id: string, signal?: AbortSignal): Promise<MemoryBody>;
|
|
45
45
|
setActive(id: string, active: boolean): MemoryBody;
|
|
46
|
+
/** Advance the safe catalog checkpoint after provider-backed content changes. */
|
|
47
|
+
touch(id: string): MemoryBody;
|
|
46
48
|
/** Refresh metadata after an atomic Pack import replaced the data component. */
|
|
47
49
|
reload(): void;
|
|
48
50
|
private loadAndReconcile;
|
|
49
51
|
private reconcileDiscoveredStores;
|
|
50
52
|
private nativeStoreIds;
|
|
53
|
+
private nextTimestamp;
|
|
51
54
|
private view;
|
|
52
55
|
private save;
|
|
53
56
|
private writeRegistry;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { MemoryCapability, MemoryJsonValue, MemoryReceipt } from '../packages/contracts/src/index.ts';
|
|
2
|
+
import type { MemoryKernel, MemoryReceiptSink } from '../packages/kernel/src/index.ts';
|
|
3
|
+
import type { MemoryTurnViewManager } from '../packages/kernel/src/index.ts';
|
|
4
|
+
export interface CommittedAuthorityOperation {
|
|
5
|
+
layerId: string;
|
|
6
|
+
capability: MemoryCapability;
|
|
7
|
+
operation: string;
|
|
8
|
+
adapterId?: string;
|
|
9
|
+
checkpoint?: MemoryJsonValue;
|
|
10
|
+
}
|
|
11
|
+
export type AuthorityCommitRecorder = (operation: CommittedAuthorityOperation) => MemoryReceipt;
|
|
12
|
+
/** Converts already-committed compatibility-controller writes into the one receipt contract. */
|
|
13
|
+
export declare class MemoryReceiptBridge implements MemoryReceiptSink {
|
|
14
|
+
private readonly kernel;
|
|
15
|
+
private readonly views;
|
|
16
|
+
private readonly now;
|
|
17
|
+
private readonly id;
|
|
18
|
+
constructor(kernel: Pick<MemoryKernel, 'descriptor' | 'guardGeneration'>, views: Pick<MemoryTurnViewManager, 'apply'>, now?: () => Date, id?: () => string);
|
|
19
|
+
append(receipt: MemoryReceipt): void;
|
|
20
|
+
record(operation: CommittedAuthorityOperation): MemoryReceipt;
|
|
21
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** @deprecated Internal compatibility facade. Import from `dsh-mnemon/strategy-default-three-tier`. */
|
|
2
|
+
export * from '../../packages/layer-runtime/src/index.ts';
|
|
3
|
+
export * from '../../packages/layer-documents/src/index.ts';
|
|
4
|
+
export * from '../../packages/layer-memory-spaces/src/index.ts';
|
|
5
|
+
export * from '../../packages/strategy-default-three-tier/src/index.ts';
|
|
6
|
+
export { participationChannel } from '../../packages/kernel/src/index.ts';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MemoryTurnViewManager } from '../packages/kernel/src/index.ts';
|
|
2
|
+
import type { DocumentManager } from './documents.ts';
|
|
3
|
+
import type { MemoryKernel } from './memory-system/kernel.ts';
|
|
4
|
+
import type { RuntimeMemoryController } from './runtime-memory.ts';
|
|
5
|
+
import type { MnemonService } from './service.ts';
|
|
6
|
+
export interface DefaultMemorySources {
|
|
7
|
+
runtimeMemory: RuntimeMemoryController;
|
|
8
|
+
documents: DocumentManager;
|
|
9
|
+
service: MnemonService;
|
|
10
|
+
}
|
|
11
|
+
/** Compatibility name for the v0.3 pre-release API. */
|
|
12
|
+
export type DefaultMemoryViewSources = DefaultMemorySources;
|
|
13
|
+
export declare function createDefaultMemoryTurnViewManager(kernel: MemoryKernel, sources: DefaultMemorySources): MemoryTurnViewManager;
|
|
14
|
+
/** Compatibility name for the v0.3 pre-release API. */
|
|
15
|
+
export declare const createDefaultMemoryViewManager: typeof createDefaultMemoryTurnViewManager;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export * from '../packages/provider-sdk/src/index.ts';
|
|
2
|
+
export { MemoryProviderAdapterRegistry, createBuiltinMemoryProviderAdapterRegistry, memoryProviderAdapterFactories, registerMemoryProviderAdapterFactory, } from './providers/registry.ts';
|
|
3
|
+
export type { MemoryProviderAdapterFactory, MemoryProviderAdapterFactoryContext } from './providers/registry.ts';
|
|
4
|
+
export type { MemoryProviderAdapter, ProviderBodyStatus, ProviderMemorySpace, ProviderScoreSemantics, ProviderSearchResult, } from './providers/provider.ts';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { MemoryCatalog } from '../memory-system/catalog.ts';
|
|
2
|
+
import type { MemoryAdapterDescriptor, MemoryCapability } from '../memory-system/contracts.ts';
|
|
3
|
+
import type { MemoryProviderDescriptor } from '../shared/contracts.ts';
|
|
4
|
+
export declare function providerMemoryCapabilities(provider: MemoryProviderDescriptor): MemoryCapability[];
|
|
5
|
+
export declare function providerMemoryAdapterDescriptor(provider: MemoryProviderDescriptor): MemoryAdapterDescriptor;
|
|
6
|
+
export declare function registerBuiltinMemoryAdapters(catalog: MemoryCatalog): () => void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ResolvedConfig } from '../config.ts';
|
|
2
|
+
import type { MemoryBodyRegistry } from '../memory-bodies.ts';
|
|
3
|
+
import type { MemoryProviderAdapter } from './provider.ts';
|
|
4
|
+
import { MemoryAdapterFactoryRegistry, type MemoryAdapterFactory } from '../../packages/provider-sdk/src/index.ts';
|
|
5
|
+
export interface MemoryProviderAdapterFactoryContext {
|
|
6
|
+
memoryBodies: MemoryBodyRegistry;
|
|
7
|
+
config: Pick<ResolvedConfig, 'timeoutMs'>;
|
|
8
|
+
nativeAdapter: MemoryProviderAdapter;
|
|
9
|
+
}
|
|
10
|
+
export interface MemoryProviderAdapterFactory extends MemoryAdapterFactory<MemoryProviderAdapter['id'], MemoryProviderAdapterFactoryContext, MemoryProviderAdapter> {
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Runtime adapter factory seam. The control plane owns registration and
|
|
14
|
+
* provider implementations own construction; MnemonService depends only on
|
|
15
|
+
* the resulting adapter contract.
|
|
16
|
+
*/
|
|
17
|
+
export declare class MemoryProviderAdapterRegistry extends MemoryAdapterFactoryRegistry<MemoryProviderAdapter['id'], MemoryProviderAdapterFactoryContext, MemoryProviderAdapter> {
|
|
18
|
+
}
|
|
19
|
+
export declare const BUILTIN_MEMORY_PROVIDER_ADAPTER_FACTORIES: readonly MemoryProviderAdapterFactory[];
|
|
20
|
+
export declare function createBuiltinMemoryProviderAdapterRegistry(): MemoryProviderAdapterRegistry;
|
|
21
|
+
/** Global extension registry sampled when a runtime generation is constructed. */
|
|
22
|
+
export declare const memoryProviderAdapterFactories: MemoryProviderAdapterRegistry;
|
|
23
|
+
export declare function registerMemoryProviderAdapterFactory(factory: MemoryProviderAdapterFactory): () => void;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { MnemonRunner } from './runner.ts';
|
|
2
|
+
import type { AuthorityCommitRecorder } from './memory-receipts.ts';
|
|
3
|
+
import type { MemoryMigrationLineage } from '../packages/contracts/src/index.ts';
|
|
2
4
|
import type { RuntimeMemoryAction, RuntimeMemoryCompactedEntry, RuntimeMemoryEntry, RuntimeMemoryMutation, RuntimeMemoryMutationResult, RuntimeMemorySnapshot, RuntimeMemoryTarget } from './shared/contracts.ts';
|
|
3
5
|
export type { RuntimeMemoryAction, RuntimeMemoryCompactedEntry, RuntimeMemoryEntry, RuntimeMemoryImportance, RuntimeMemoryMutation, RuntimeMemoryMutationResult, RuntimeMemorySnapshot, RuntimeMemoryTarget, RuntimeMemoryTargetView, RuntimeMemoryUsage, } from './shared/contracts.ts';
|
|
4
6
|
export declare const RUNTIME_MEMORY_VERSION = 1;
|
|
@@ -7,7 +9,11 @@ export declare const RUNTIME_MEMORY_LIMITS: {
|
|
|
7
9
|
readonly memory: number;
|
|
8
10
|
readonly user: number;
|
|
9
11
|
};
|
|
10
|
-
|
|
12
|
+
export interface RuntimeMemoryContextProjection {
|
|
13
|
+
revision: string;
|
|
14
|
+
text: string;
|
|
15
|
+
}
|
|
16
|
+
/** Host-only plan for capacity maintenance; this is not exposed as a Tool or RPC action. */
|
|
11
17
|
export interface RuntimeMemoryMaintenancePlan {
|
|
12
18
|
revision: string;
|
|
13
19
|
action: RuntimeMemoryAction;
|
|
@@ -36,22 +42,25 @@ export declare class RuntimeMemoryConflictError extends Error {
|
|
|
36
42
|
*/
|
|
37
43
|
export declare class RuntimeMemoryController {
|
|
38
44
|
private readonly now;
|
|
45
|
+
private readonly recordCommit?;
|
|
39
46
|
readonly directory: string;
|
|
40
47
|
readonly sourcePath: string;
|
|
41
48
|
readonly memoryPath: string;
|
|
42
49
|
readonly userPath: string;
|
|
43
50
|
readonly lockPath: string;
|
|
44
51
|
private queue;
|
|
45
|
-
constructor(runner: Pick<MnemonRunner, 'effectiveDataDir'>, now?: () => Date);
|
|
52
|
+
constructor(runner: Pick<MnemonRunner, 'effectiveDataDir'>, now?: () => Date, recordCommit?: AuthorityCommitRecorder | undefined);
|
|
46
53
|
snapshot(): RuntimeMemorySnapshot;
|
|
47
54
|
contextText(): string;
|
|
55
|
+
/** Read the exact Runtime revision and its prompt projection under one lock. */
|
|
56
|
+
contextProjection(): RuntimeMemoryContextProjection;
|
|
48
57
|
mutate(request: RuntimeMemoryMutation): Promise<RuntimeMemoryMutationResult>;
|
|
49
58
|
/** Resolve exactly which committed entries survive a blocked mutation and are safe to compact. */
|
|
50
59
|
planMaintenance(request: RuntimeMemoryMutation): Promise<RuntimeMemoryMaintenancePlan>;
|
|
51
|
-
/** Commit
|
|
52
|
-
compactAndMutate(expectedRevision: string, request: RuntimeMemoryMutation, compacted: RuntimeMemoryCompactedEntry[], maxCompactedBytes?: number): Promise<RuntimeMemoryMutationResult>;
|
|
60
|
+
/** Commit semantic compaction and the original mutation together, or leave every local file unchanged. */
|
|
61
|
+
compactAndMutate(expectedRevision: string, request: RuntimeMemoryMutation, compacted: RuntimeMemoryCompactedEntry[], maxCompactedBytes?: number, lineage?: readonly MemoryMigrationLineage[]): Promise<RuntimeMemoryMutationResult>;
|
|
53
62
|
/** Apply an LLM-produced compaction only to the exact snapshot it reviewed. */
|
|
54
|
-
compactTarget(expectedRevision: string, target: RuntimeMemoryTarget, compacted: RuntimeMemoryCompactedEntry[], maxBytes?: number): Promise<RuntimeMemorySnapshot>;
|
|
63
|
+
compactTarget(expectedRevision: string, target: RuntimeMemoryTarget, compacted: RuntimeMemoryCompactedEntry[], maxBytes?: number, lineage?: readonly MemoryMigrationLineage[]): Promise<RuntimeMemorySnapshot>;
|
|
55
64
|
private initialize;
|
|
56
65
|
private mutateLocked;
|
|
57
66
|
private result;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Small deterministic tokenizer shared by local Document and Native recovery. */
|
|
2
|
+
export declare function lexicalSearchTokens(value: string, maximum?: number): string[];
|
|
3
|
+
export declare function lexicalTokenMatchCount(value: string, tokens: readonly string[]): number;
|
|
4
|
+
/** Require broader coverage only after a query is focused enough to support it. */
|
|
5
|
+
export declare function lexicalRequiredMatchCount(tokens: readonly string[]): number;
|
|
@@ -2,7 +2,9 @@ import type { JsonValue } from './contracts.ts';
|
|
|
2
2
|
import type { ResolvedConfig } from './config.ts';
|
|
3
3
|
import { MemoryBodyRegistry, type CreateMemoryBodyRequest, type MemoryBody, type UpdateMemoryBodyRequest } from './memory-bodies.ts';
|
|
4
4
|
import type { MnemonRunner } from './runner.ts';
|
|
5
|
+
import type { AuthorityCommitRecorder } from './memory-receipts.ts';
|
|
5
6
|
import { type LlmMemoryPlacementSelection, type PreparedMemoryPlacement } from './provider-placement.ts';
|
|
7
|
+
import { type MemoryProviderAdapterRegistry } from './providers/registry.ts';
|
|
6
8
|
import { type RecallQualityPolicyRegistry } from './recall-quality/index.ts';
|
|
7
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';
|
|
8
10
|
export { CATEGORIES, EDGE_TYPES, INTENTS, SOURCES } from './shared/contracts.ts';
|
|
@@ -18,19 +20,24 @@ export interface MemoryBodyMetadataSample {
|
|
|
18
20
|
}
|
|
19
21
|
/** Parse the official Mnemon vis.js export without executing its HTML or loading its CDN script. */
|
|
20
22
|
export declare function parseMemoryGraph(html: string, now?: Date): MemoryGraphSnapshot;
|
|
23
|
+
/** A provider mutation is authoritative only after it reports an explicit durable terminal state. */
|
|
24
|
+
export declare function mutationResultCommitted(result: unknown): boolean;
|
|
21
25
|
export declare class MnemonService {
|
|
22
26
|
readonly runner: MnemonRunner;
|
|
23
27
|
readonly config: ResolvedConfig;
|
|
28
|
+
private readonly recordCommit?;
|
|
24
29
|
readonly memoryBodies: MemoryBodyRegistry;
|
|
25
30
|
private readonly providers;
|
|
26
31
|
private readonly recallQualityPolicy;
|
|
27
32
|
private bodiesInFlight;
|
|
28
|
-
constructor(runner: MnemonRunner, config: ResolvedConfig, memoryBodies?: MemoryBodyRegistry, recallQualityPolicyRegistry?: RecallQualityPolicyRegistry);
|
|
33
|
+
constructor(runner: MnemonRunner, config: ResolvedConfig, memoryBodies?: MemoryBodyRegistry, recallQualityPolicyRegistry?: RecallQualityPolicyRegistry, providerAdapterRegistry?: MemoryProviderAdapterRegistry, recordCommit?: AuthorityCommitRecorder | undefined);
|
|
29
34
|
bodies(signal?: AbortSignal): Promise<MemoryBodyCatalog>;
|
|
30
35
|
/** Coalesce simultaneous Status/Memory-page probes without caching mutations. */
|
|
31
36
|
private collectBodies;
|
|
32
37
|
/** Return the control-plane directory without waiting for provider I/O. */
|
|
33
38
|
bodyDirectory(): MemoryBodyCatalog;
|
|
39
|
+
/** Stable, secret-free checkpoint for the projected Memory Space authority. */
|
|
40
|
+
memoryRevision(): string;
|
|
34
41
|
/** Return a usable system snapshot without waiting for any Provider I/O. */
|
|
35
42
|
statusSummary(): StatusView;
|
|
36
43
|
status(signal?: AbortSignal): Promise<StatusView>;
|
|
@@ -91,5 +98,6 @@ export declare class MnemonService {
|
|
|
91
98
|
private annotate;
|
|
92
99
|
private annotateResult;
|
|
93
100
|
private activateAfterWrite;
|
|
101
|
+
private recordMemoryCommit;
|
|
94
102
|
private assertWritable;
|
|
95
103
|
}
|