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.
Files changed (136) hide show
  1. package/README.md +10 -20
  2. package/README.zh-CN.md +10 -20
  3. package/SECURITY.md +8 -8
  4. package/cordis.patch.yml +42 -0
  5. package/lib/client.js +2360 -6843
  6. package/lib/contracts.js +16 -17
  7. package/lib/core.js +11 -0
  8. package/lib/definitions-j0FLgE0-.js +251 -0
  9. package/lib/extension-sdk.js +93 -229
  10. package/lib/index.js +3730 -6330
  11. package/lib/runtime-AtIOTeP1.js +1316 -0
  12. package/lib/storage-lock-Bqrhkyag.js +20 -0
  13. package/lib/testing.js +231 -0
  14. package/lib/types/src/client/extension-sdk.d.ts +10 -0
  15. package/lib/types/src/client/index.d.ts +1 -0
  16. package/lib/types/src/client/locales.d.ts +84 -0
  17. package/lib/types/src/client/page-client.d.ts +15 -0
  18. package/lib/types/src/client/page-kit.d.ts +40 -0
  19. package/lib/types/src/client/source-contracts.d.ts +46 -0
  20. package/lib/types/src/client/source-pages.d.ts +83 -0
  21. package/lib/types/src/core/contracts/index.d.ts +40 -0
  22. package/lib/types/src/core/contracts/plugin.d.ts +32 -0
  23. package/lib/types/src/core/contracts/view.d.ts +416 -0
  24. package/lib/types/src/core/definitions.d.ts +16 -0
  25. package/lib/types/src/core/plugin.d.ts +6 -0
  26. package/lib/types/src/{config-values.d.ts → host/config-values.d.ts} +7 -7
  27. package/lib/types/src/{config.d.ts → host/config.d.ts} +4 -1
  28. package/lib/types/src/{shared → host}/display-mode.d.ts +1 -1
  29. package/lib/types/src/host/plugin.d.ts +8 -0
  30. package/lib/types/src/host/protocol.d.ts +549 -0
  31. package/lib/types/src/host/view-protocol.d.ts +123 -0
  32. package/lib/types/src/index.d.ts +2 -21
  33. package/lib/types/src/sdk/index.d.ts +9 -0
  34. package/lib/types/src/sdk/input.d.ts +11 -0
  35. package/lib/types/src/sdk/install.d.ts +7 -0
  36. package/lib/types/src/sdk/service.d.ts +31 -0
  37. package/lib/types/src/sdk/storage-lock.d.ts +6 -0
  38. package/lib/types/src/sdk/strategy-configuration.d.ts +31 -0
  39. package/lib/types/src/sdk/testing.d.ts +70 -0
  40. package/package.json +46 -35
  41. package/lib/kernel.js +0 -1173
  42. package/lib/layers/documents.js +0 -31
  43. package/lib/layers/memory-spaces.js +0 -34
  44. package/lib/layers/runtime.js +0 -27
  45. package/lib/provider-sdk.js +0 -2
  46. package/lib/registry-B9SdBRLo.js +0 -2423
  47. package/lib/strategy-default-three-tier.js +0 -99
  48. package/lib/strategy-sdk.js +0 -56
  49. package/lib/types/packages/contracts/src/index.d.ts +0 -221
  50. package/lib/types/packages/extension-sdk/src/index.d.ts +0 -54
  51. package/lib/types/packages/kernel/src/access.d.ts +0 -14
  52. package/lib/types/packages/kernel/src/catalog.d.ts +0 -42
  53. package/lib/types/packages/kernel/src/index.d.ts +0 -5
  54. package/lib/types/packages/kernel/src/kernel.d.ts +0 -46
  55. package/lib/types/packages/kernel/src/topology.d.ts +0 -25
  56. package/lib/types/packages/kernel/src/view.d.ts +0 -89
  57. package/lib/types/packages/layer-documents/src/index.d.ts +0 -4
  58. package/lib/types/packages/layer-memory-spaces/src/index.d.ts +0 -4
  59. package/lib/types/packages/layer-runtime/src/index.d.ts +0 -4
  60. package/lib/types/packages/provider-sdk/src/index.d.ts +0 -19
  61. package/lib/types/packages/strategy-default-three-tier/src/index.d.ts +0 -7
  62. package/lib/types/packages/strategy-sdk/src/index.d.ts +0 -35
  63. package/lib/types/src/activity.d.ts +0 -16
  64. package/lib/types/src/agent-memory-turn.d.ts +0 -42
  65. package/lib/types/src/channels.d.ts +0 -1
  66. package/lib/types/src/client/GlobalLocationSetting.d.ts +0 -19
  67. package/lib/types/src/client/MnemonPackSection.d.ts +0 -13
  68. package/lib/types/src/client/MnemonSaveAction.d.ts +0 -13
  69. package/lib/types/src/client/MnemonSettingsCard.d.ts +0 -16
  70. package/lib/types/src/client/MnemonTurnTail.d.ts +0 -21
  71. package/lib/types/src/client/MnemonView.d.ts +0 -26
  72. package/lib/types/src/client/ProviderIcon.d.ts +0 -8
  73. package/lib/types/src/client/ProviderSettingsSection.d.ts +0 -16
  74. package/lib/types/src/client/anchor.d.ts +0 -27
  75. package/lib/types/src/client/api.d.ts +0 -83
  76. package/lib/types/src/client/better-sidebar.d.ts +0 -13
  77. package/lib/types/src/client/dsh-compat.d.ts +0 -51
  78. package/lib/types/src/client/settings.d.ts +0 -23
  79. package/lib/types/src/client/sidebar-entry.d.ts +0 -5
  80. package/lib/types/src/client/subagent-token-usage.d.ts +0 -23
  81. package/lib/types/src/client/workspace-controller.d.ts +0 -14
  82. package/lib/types/src/client/workspace-mount.d.ts +0 -20
  83. package/lib/types/src/commands.d.ts +0 -13
  84. package/lib/types/src/contracts.d.ts +0 -316
  85. package/lib/types/src/documents.d.ts +0 -77
  86. package/lib/types/src/git-branch.d.ts +0 -6
  87. package/lib/types/src/guidance.d.ts +0 -29
  88. package/lib/types/src/lifecycle.d.ts +0 -80
  89. package/lib/types/src/live-runtime.d.ts +0 -92
  90. package/lib/types/src/memory-bodies.d.ts +0 -57
  91. package/lib/types/src/memory-receipts.d.ts +0 -21
  92. package/lib/types/src/memory-system/access.d.ts +0 -2
  93. package/lib/types/src/memory-system/catalog.d.ts +0 -2
  94. package/lib/types/src/memory-system/contracts.d.ts +0 -2
  95. package/lib/types/src/memory-system/defaults.d.ts +0 -6
  96. package/lib/types/src/memory-system/index.d.ts +0 -7
  97. package/lib/types/src/memory-system/kernel.d.ts +0 -2
  98. package/lib/types/src/memory-system/topology.d.ts +0 -2
  99. package/lib/types/src/memory-system/view.d.ts +0 -2
  100. package/lib/types/src/memory-view.d.ts +0 -21
  101. package/lib/types/src/pack.d.ts +0 -29
  102. package/lib/types/src/process.d.ts +0 -16
  103. package/lib/types/src/provider-placement.d.ts +0 -26
  104. package/lib/types/src/provider-sdk.d.ts +0 -4
  105. package/lib/types/src/providers/byterover.d.ts +0 -32
  106. package/lib/types/src/providers/catalog.d.ts +0 -23
  107. package/lib/types/src/providers/hindsight.d.ts +0 -20
  108. package/lib/types/src/providers/holographic.d.ts +0 -23
  109. package/lib/types/src/providers/honcho.d.ts +0 -18
  110. package/lib/types/src/providers/http.d.ts +0 -32
  111. package/lib/types/src/providers/mem0.d.ts +0 -18
  112. package/lib/types/src/providers/memory-system.d.ts +0 -6
  113. package/lib/types/src/providers/openviking.d.ts +0 -32
  114. package/lib/types/src/providers/provider.d.ts +0 -46
  115. package/lib/types/src/providers/registry.d.ts +0 -23
  116. package/lib/types/src/providers/retaindb.d.ts +0 -17
  117. package/lib/types/src/providers/supermemory.d.ts +0 -17
  118. package/lib/types/src/recall-quality/contracts.d.ts +0 -32
  119. package/lib/types/src/recall-quality/engine.d.ts +0 -13
  120. package/lib/types/src/recall-quality/index.d.ts +0 -4
  121. package/lib/types/src/recall-quality/policies.d.ts +0 -5
  122. package/lib/types/src/recall-quality/registry.d.ts +0 -10
  123. package/lib/types/src/review-activity.d.ts +0 -19
  124. package/lib/types/src/rpc.d.ts +0 -22
  125. package/lib/types/src/runner.d.ts +0 -41
  126. package/lib/types/src/runtime-memory.d.ts +0 -90
  127. package/lib/types/src/search-tokens.d.ts +0 -5
  128. package/lib/types/src/service.d.ts +0 -113
  129. package/lib/types/src/session-events.d.ts +0 -8
  130. package/lib/types/src/settings.d.ts +0 -6
  131. package/lib/types/src/shared/contracts.d.ts +0 -1008
  132. package/lib/types/src/storage-scope.d.ts +0 -12
  133. package/lib/types/src/subagent-token-usage.d.ts +0 -53
  134. package/lib/types/src/subagent.d.ts +0 -124
  135. package/lib/types/src/tools.d.ts +0 -10
  136. package/lib/types/src/version-updates.d.ts +0 -37
@@ -0,0 +1,416 @@
1
+ /**
2
+ * Public narrow waist for Composable View Memory plugins.
3
+ *
4
+ * Definitions contain executable factories and remain inside the Host realm.
5
+ * Every manifest, fact, spec, View, Evidence, and Receipt crossing that
6
+ * boundary is JSON-safe and can therefore be validated, digested, and replayed.
7
+ */
8
+ import type { MemoryCapability, MemoryJsonValue, MemoryOperationScope, MemoryReceiptStatus, MemorySourceMode } from './index.ts';
9
+ export declare const COMPOSABLE_MEMORY_API_VERSION: "dsh-mnemon/v1";
10
+ /** Persistence truth, not a taxonomy of memory operations. */
11
+ export type MemoryMutationCompletion = 'accepted' | 'candidate' | 'committed' | 'partial' | 'failed' | 'unknown';
12
+ export type MemoryContributionKind = 'source' | 'strategy' | 'strategy-extension';
13
+ export type MemorySourceAvailability = 'ready' | 'degraded' | 'unavailable';
14
+ export type MemoryViewConsistencyMode = 'exact-snapshot' | 'namespace-pinned-live-read';
15
+ export interface MemoryPackageProvenance {
16
+ /** npm package name or another stable artifact namespace. */
17
+ packageName: string;
18
+ /** Stable Loader Entry id (or an explicit id for direct ctx.plugin mounts). */
19
+ entryId: string;
20
+ /** Optional immutable package artifact digest supplied by an installer. */
21
+ artifactDigest?: string;
22
+ }
23
+ export interface MemoryManagementField {
24
+ key: string;
25
+ label: string;
26
+ description?: string;
27
+ input: 'text' | 'number' | 'boolean' | 'url' | 'secret' | 'select';
28
+ required: boolean;
29
+ secret?: boolean;
30
+ options?: Array<{
31
+ value: string;
32
+ label: string;
33
+ }>;
34
+ }
35
+ /** JSON-safe presentation metadata. It never contains a React component. */
36
+ export interface MemoryManagementDescriptor {
37
+ label: string;
38
+ description: string;
39
+ fields?: MemoryManagementField[];
40
+ diagnostics?: string[];
41
+ }
42
+ export type MemorySourceManagementMode = 'read' | 'mutate';
43
+ /**
44
+ * Authenticated human-management request delivered to one Serving Source.
45
+ * It is deliberately separate from model Routes and ActionOffers: no View
46
+ * grant crosses into the browser management plane.
47
+ */
48
+ export interface MemorySourceManagementRequest {
49
+ scope: MemoryOperationScope;
50
+ sourceInstanceKey: string;
51
+ mode: MemorySourceManagementMode;
52
+ operation: string;
53
+ input: MemoryJsonValue;
54
+ /** Mutations are revision-fenced by the caller and rechecked by the Source. */
55
+ expectedRevision?: string;
56
+ /** The Host only forwards mutations after an explicit confirmation. */
57
+ confirmed: boolean;
58
+ signal?: AbortSignal;
59
+ }
60
+ /** JSON-safe management projection or mutation result from one Source. */
61
+ export interface MemorySourceManagementResult {
62
+ revision: string;
63
+ value: MemoryJsonValue;
64
+ }
65
+ /** Sanitized Source instance descriptor returned to authenticated clients. */
66
+ export interface MemorySourceManagementInstance {
67
+ sourceInstanceKey: string;
68
+ sourceTypeId: string;
69
+ packageName: string;
70
+ role: string;
71
+ availability: MemorySourceAvailability;
72
+ revision: string;
73
+ capabilities: MemoryCapability[];
74
+ management: MemoryManagementDescriptor;
75
+ hints?: MemoryJsonValue;
76
+ }
77
+ export interface MemorySourceManagementCatalog {
78
+ generationId: string;
79
+ sources: MemorySourceManagementInstance[];
80
+ diagnostics?: MemoryCompositionDiagnostic[];
81
+ }
82
+ export interface MemorySourceRouteManifest {
83
+ /** Stable within one Source type. Runtime prefixes it with the instance key. */
84
+ id: string;
85
+ description: string;
86
+ capability: MemoryCapability;
87
+ inputSchema: MemoryJsonValue;
88
+ maxCalls: number;
89
+ maxResults?: number;
90
+ maxCharacters?: number;
91
+ }
92
+ export interface MemorySourceActionManifest {
93
+ /** Stable within one Source type. Runtime prefixes it with the instance key. */
94
+ id: string;
95
+ description: string;
96
+ capability: MemoryCapability;
97
+ inputSchema: MemoryJsonValue;
98
+ /** High-risk non-memory actions must name an external authority. */
99
+ authority?: string;
100
+ }
101
+ export interface MemorySourceManifest {
102
+ apiVersion: typeof COMPOSABLE_MEMORY_API_VERSION;
103
+ kind: 'source';
104
+ typeId: string;
105
+ packageName: string;
106
+ role: string;
107
+ capabilities: MemoryCapability[];
108
+ consistency: MemoryViewConsistencyMode;
109
+ routes?: MemorySourceRouteManifest[];
110
+ actions?: MemorySourceActionManifest[];
111
+ management?: MemoryManagementDescriptor;
112
+ }
113
+ export interface MemoryStrategyManifest {
114
+ apiVersion: typeof COMPOSABLE_MEMORY_API_VERSION;
115
+ kind: 'strategy';
116
+ typeId: string;
117
+ packageName: string;
118
+ deterministic: true;
119
+ supportedSourceRoles: string[];
120
+ maxSources: number;
121
+ maxRoutes: number;
122
+ maxActions: number;
123
+ /** Exclusive contribution slots owned by this Strategy, not Core vocabulary. */
124
+ extensionSlots?: string[];
125
+ }
126
+ /** An additive plugin targets one explicit Strategy contract, never replaces it. */
127
+ export interface MemoryStrategyExtensionManifest {
128
+ apiVersion: typeof COMPOSABLE_MEMORY_API_VERSION;
129
+ kind: 'strategy-extension';
130
+ typeId: string;
131
+ packageName: string;
132
+ strategyTypeId: string;
133
+ slot: string;
134
+ deterministic: true;
135
+ }
136
+ export interface MemoryStrategyExtensionDefinition {
137
+ manifest: MemoryStrategyExtensionManifest;
138
+ /** Pure, bounded JSON proposal; no Source handles, write callbacks or credentials. */
139
+ contribute(request: MemoryViewRequest, sources: readonly MemoryAvailableSource[]): MemoryJsonValue;
140
+ }
141
+ /** The owning Strategy interprets value using its public, slot-specific contract. */
142
+ export interface MemoryStrategyContribution {
143
+ instanceKey: string;
144
+ typeId: string;
145
+ slot: string;
146
+ value: MemoryJsonValue;
147
+ }
148
+ export interface MemorySourceFacts {
149
+ sourceInstanceKey: string;
150
+ sourceTypeId: string;
151
+ role: string;
152
+ availability: MemorySourceAvailability;
153
+ revision: string;
154
+ capabilities: MemoryCapability[];
155
+ routeIds: string[];
156
+ actionIds: string[];
157
+ /** Coarse, non-sensitive hints only; never raw Authority data or credentials. */
158
+ hints?: MemoryJsonValue;
159
+ }
160
+ export interface MemoryViewBudget {
161
+ maxProjectionCharacters: number;
162
+ maxRoutes: number;
163
+ maxActions: number;
164
+ maxEvidenceResults: number;
165
+ maxEvidenceCharacters: number;
166
+ }
167
+ /** Manifest operations filtered by live availability and Host permissions. */
168
+ export interface MemoryAvailableSource extends MemorySourceFacts {
169
+ routes: MemorySourceRouteManifest[];
170
+ actions: MemorySourceActionManifest[];
171
+ }
172
+ export declare const DEFAULT_MEMORY_VIEW_BUDGET: Readonly<MemoryViewBudget>;
173
+ export interface MemoryViewRequest {
174
+ scope: MemoryOperationScope;
175
+ scenario: string;
176
+ budget: MemoryViewBudget;
177
+ }
178
+ export interface MemoryViewSourceSpec {
179
+ sourceInstanceKey: string;
180
+ /** Defaults to true. An explicitly optional Source may be omitted on read failure. */
181
+ required?: boolean;
182
+ projection?: {
183
+ mode: MemorySourceMode;
184
+ maxCharacters: number;
185
+ };
186
+ /** Source-local route ids declared by its manifest/facts. */
187
+ routeIds?: string[];
188
+ /** Source-local action ids declared by its manifest/facts. */
189
+ actionIds?: string[];
190
+ }
191
+ /** Pure Strategy output. Runtime treats it as a proposal, never as authority. */
192
+ export interface MemoryViewSpec {
193
+ strategyTypeId: string;
194
+ sources: MemoryViewSourceSpec[];
195
+ explanation: string;
196
+ /** Trusted Strategy instructions, separate from quoted Source data. */
197
+ guidance?: MemoryViewGuidance;
198
+ }
199
+ export interface MemoryViewGuidance {
200
+ system?: string;
201
+ routing?: string;
202
+ reminders?: {
203
+ read?: string;
204
+ write?: string;
205
+ both?: string;
206
+ };
207
+ }
208
+ export interface MemoryProjectionRequest {
209
+ scope: MemoryOperationScope;
210
+ sourceInstanceKey: string;
211
+ /** Facts revision selected by the Strategy; the Source owns its snapshot consistency. */
212
+ expectedRevision: string;
213
+ includeProjection: boolean;
214
+ mode: MemorySourceMode;
215
+ maxCharacters: number;
216
+ }
217
+ export interface MemoryViewFragment {
218
+ id: string;
219
+ sourceInstanceKey: string;
220
+ mode: MemorySourceMode;
221
+ text: string;
222
+ revision: string;
223
+ provenance?: MemoryJsonValue;
224
+ }
225
+ /**
226
+ * Bounded, Source-authored human presentation for one item in a View.
227
+ * It is descriptive only: Core never treats it as Evidence, authority, or
228
+ * model instructions, and the Host never renders executable UI from it.
229
+ */
230
+ export interface MemorySourcePresentationItem {
231
+ id: string;
232
+ title: string;
233
+ excerpt?: string;
234
+ }
235
+ /**
236
+ * Optional browser-safe description of the items represented by a Source.
237
+ * `visibleItems` is the number in this View scope; `items` may be a bounded
238
+ * preview subset. `totalItems` may include inactive or out-of-scope items.
239
+ */
240
+ export interface MemorySourcePresentation {
241
+ visibleItems: number;
242
+ totalItems?: number;
243
+ items?: MemorySourcePresentationItem[];
244
+ }
245
+ /** Source presentation after Core binds it to the selected mode and instance. */
246
+ export interface MemoryViewSourcePresentation extends MemorySourcePresentation {
247
+ sourceInstanceKey: string;
248
+ mode: MemorySourceMode;
249
+ }
250
+ export interface MemoryReadGrant {
251
+ id: string;
252
+ sourceInstanceKey: string;
253
+ schema: string;
254
+ value: MemoryJsonValue;
255
+ revision: string;
256
+ consistency: MemoryViewConsistencyMode;
257
+ }
258
+ export interface MemoryViewContribution {
259
+ fragments: MemoryViewFragment[];
260
+ readGrant?: MemoryReadGrant;
261
+ /** Optional non-authoritative presentation; old Sources may omit it. */
262
+ presentation?: MemorySourcePresentation;
263
+ }
264
+ export interface MemoryViewRoute {
265
+ id: string;
266
+ sourceInstanceKey: string;
267
+ sourceRouteId: string;
268
+ description: string;
269
+ capability: MemoryCapability;
270
+ inputSchema: MemoryJsonValue;
271
+ readGrantId: string;
272
+ maxCalls: number;
273
+ maxResults?: number;
274
+ maxCharacters?: number;
275
+ }
276
+ export interface MemoryActionOffer {
277
+ id: string;
278
+ sourceInstanceKey: string;
279
+ sourceActionId: string;
280
+ description: string;
281
+ capability: MemoryCapability;
282
+ inputSchema: MemoryJsonValue;
283
+ authority?: string;
284
+ }
285
+ export interface MemoryViewConsistency {
286
+ mode: 'mixed' | MemoryViewConsistencyMode;
287
+ sourceRevisions: Record<string, string>;
288
+ }
289
+ /** Complete Host-side safety envelope. Read grants are never model-rendered. */
290
+ export interface ComposableMemoryView {
291
+ id: string;
292
+ digest: string;
293
+ runtimeGeneration: string;
294
+ strategyInstanceKey: string;
295
+ strategyTypeId: string;
296
+ /** Auditable active contributions, without publishing their configuration to the LLM. */
297
+ strategyExtensions?: Array<{
298
+ instanceKey: string;
299
+ typeId: string;
300
+ slot: string;
301
+ digest: string;
302
+ }>;
303
+ createdAt: string;
304
+ scope: MemoryOperationScope;
305
+ projection: MemoryViewFragment[];
306
+ /** Optional Source-authored browser presentation; never model-rendered. */
307
+ sourcePresentations?: MemoryViewSourcePresentation[];
308
+ routes: MemoryViewRoute[];
309
+ readGrants: MemoryReadGrant[];
310
+ actionOffers: MemoryActionOffer[];
311
+ consistency: MemoryViewConsistency;
312
+ explanation: string;
313
+ guidance?: MemoryViewGuidance;
314
+ /** Sanitized, turn-local availability failures; never raw provider errors. */
315
+ diagnostics?: MemoryCompositionDiagnostic[];
316
+ }
317
+ export interface MemoryEvidenceItem {
318
+ id: string;
319
+ text: string;
320
+ provenance: MemoryJsonValue;
321
+ score?: number;
322
+ revision?: string;
323
+ }
324
+ export interface MemoryEvidence {
325
+ id: string;
326
+ viewId: string;
327
+ routeId: string;
328
+ sourceInstanceKey: string;
329
+ observedAt: string;
330
+ items: MemoryEvidenceItem[];
331
+ truncated: boolean;
332
+ unavailable?: string;
333
+ /** Source-owned read metadata; never authority or credentials. */
334
+ metadata?: MemoryJsonValue;
335
+ /** Strategy-owned model presentation. Host audit retains the evidence separately. */
336
+ output?: MemoryJsonValue;
337
+ }
338
+ export interface MemoryMutationReceipt {
339
+ id: string;
340
+ viewId: string;
341
+ offerId: string;
342
+ sourceInstanceKey: string;
343
+ status: MemoryReceiptStatus;
344
+ completion: MemoryMutationCompletion;
345
+ /** Only an explicitly confirmed commit may carry this timestamp. */
346
+ committedAt?: string;
347
+ revision?: string;
348
+ details?: MemoryJsonValue;
349
+ }
350
+ export interface MemorySourceRuntimeContext {
351
+ sourceInstanceKey: string;
352
+ provenance: MemoryPackageProvenance;
353
+ /** Immutable, JSON-only Host/scope defaults; never business objects or clients. */
354
+ configuration?: Readonly<Record<string, MemoryJsonValue>>;
355
+ }
356
+ /** Operation identity only; never the complete View or another Source's data. */
357
+ export interface MemorySourceViewContext {
358
+ id: string;
359
+ scope: MemoryOperationScope;
360
+ }
361
+ export interface MemorySourceRuntime {
362
+ /** Lightweight metadata. Honor cancellation; do not perform writes here. */
363
+ facts(request: MemoryViewRequest, signal?: AbortSignal): MemorySourceFacts | Promise<MemorySourceFacts>;
364
+ project(request: MemoryProjectionRequest, signal?: AbortSignal): MemoryViewContribution | Promise<MemoryViewContribution>;
365
+ manage?(request: MemorySourceManagementRequest): MemorySourceManagementResult | Promise<MemorySourceManagementResult>;
366
+ query?(request: {
367
+ view: MemorySourceViewContext;
368
+ route: MemoryViewRoute;
369
+ grant: MemoryReadGrant;
370
+ input: MemoryJsonValue;
371
+ signal?: AbortSignal;
372
+ }): MemoryEvidence | Promise<MemoryEvidence>;
373
+ mutate?(request: {
374
+ view: MemorySourceViewContext;
375
+ offer: MemoryActionOffer;
376
+ /** This Source's own pinned read scope, when it contributed one. Not write authorization. */
377
+ grant?: MemoryReadGrant;
378
+ input: MemoryJsonValue;
379
+ signal?: AbortSignal;
380
+ }): MemoryMutationReceipt | Promise<MemoryMutationReceipt>;
381
+ dispose?(): void | Promise<void>;
382
+ }
383
+ export interface MemorySourceDefinition {
384
+ manifest: MemorySourceManifest;
385
+ create(context: MemorySourceRuntimeContext): MemorySourceRuntime;
386
+ }
387
+ export interface MemoryStrategyDefinition {
388
+ manifest: MemoryStrategyManifest;
389
+ compose(request: MemoryViewRequest, sources: readonly MemoryAvailableSource[], contributions?: readonly MemoryStrategyContribution[]): MemoryViewSpec;
390
+ /** Optional execution policy, instantiated once for each executing turn, never during compose. */
391
+ createTurn?(view: ComposableMemoryView): MemoryStrategyTurn;
392
+ }
393
+ export interface MemoryStrategyReadRequest {
394
+ route: MemoryViewRoute;
395
+ input: MemoryJsonValue;
396
+ signal?: AbortSignal;
397
+ }
398
+ export interface MemoryStrategyTurn {
399
+ /** The continuation can read only this offered Route, with the same grant and ceilings. */
400
+ query(request: MemoryStrategyReadRequest, read: MemoryStrategyRead): Promise<MemoryEvidence>;
401
+ }
402
+ export type MemoryStrategyRead = (input: MemoryJsonValue, limits?: Partial<Pick<MemoryViewRoute, 'maxResults' | 'maxCharacters'>>) => Promise<MemoryEvidence>;
403
+ export interface MemoryCompositionDiagnostic {
404
+ code: string;
405
+ message: string;
406
+ contributionInstanceKey?: string;
407
+ }
408
+ export interface MemoryCompositionEvaluationReport {
409
+ state: 'ready' | 'incomplete' | 'rejected';
410
+ contributionRevision: number;
411
+ generationId?: string;
412
+ strategyInstanceKey?: string;
413
+ strategyExtensionInstanceKeys?: string[];
414
+ sourceInstanceKeys: string[];
415
+ diagnostics: MemoryCompositionDiagnostic[];
416
+ }
@@ -0,0 +1,16 @@
1
+ import type { MemoryPackageProvenance, MemoryPluginDescriptor, MemorySourceDefinition, MemorySourceManifest, MemoryStrategyDefinition, MemoryStrategyExtensionDefinition } from './contracts/index.ts';
2
+ export declare function requiredText(value: unknown, label: string, maximum?: number): string;
3
+ export declare function id(value: unknown, label: string): string;
4
+ export declare function positiveInteger(value: unknown, label: string, maximum?: number): number;
5
+ /** Canonical JSON representation shared by validation, digest, and replay. */
6
+ export declare function canonicalMemoryJson(value: unknown, label?: string, ancestors?: Set<object>, depth?: number): string;
7
+ export declare function deepFreeze<T>(value: T): T;
8
+ export declare function jsonClone<T>(value: T, label: string): T;
9
+ export declare function uniqueIds(values: readonly string[], label: string): string[];
10
+ export declare function validateProvenance(value: MemoryPackageProvenance, expectedPackage: string): MemoryPackageProvenance;
11
+ export declare function validateCapabilities(values: readonly string[], label: string): MemorySourceManifest['capabilities'];
12
+ /** Validate a plugin node independently of whether its Fiber is active. */
13
+ export declare function defineMemoryPlugin(value: Omit<MemoryPluginDescriptor, 'apiVersion'> | MemoryPluginDescriptor): MemoryPluginDescriptor;
14
+ export declare function defineMemorySource<T extends MemorySourceDefinition>(definition: T): T;
15
+ export declare function defineMemoryStrategy<T extends MemoryStrategyDefinition>(definition: T): T;
16
+ export declare function defineMemoryStrategyExtension<T extends MemoryStrategyExtensionDefinition>(definition: T): T;
@@ -0,0 +1,6 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ export declare const name = "dsh-mnemon-core";
3
+ export declare const provide: string[];
4
+ export declare const inject: string[];
5
+ /** No built-in Source, Provider, filesystem, settings, tools, or Web dependency. */
6
+ export declare function apply(context: Context): void;
@@ -1,15 +1,15 @@
1
+ export declare const DEFAULT_IDLE_REVIEW_MS = 30000;
2
+ export declare const DEFAULT_RUNTIME_MEMORY_LIMIT_BYTES: number;
3
+ export declare const DEFAULT_RUNTIME_USER_LIMIT_BYTES: number;
4
+ export declare const MAX_RUNTIME_MEMORY_LIMIT_BYTES: number;
5
+ export declare const DEFAULT_RUNTIME_MAINTENANCE_MAX_TOKENS = 8192;
6
+ export declare const MAX_RUNTIME_MAINTENANCE_MAX_TOKENS = 1000000;
7
+ export { DEFAULT_EMBEDDING_ENDPOINT, DEFAULT_EMBEDDING_MODEL, DEFAULT_EMBEDDING_PROTOCOL, MNEMON_EMBEDDING_PROTOCOLS } from "./protocol.ts";
1
8
  export declare const DEFAULT_TIMEOUT_MS = 10000;
2
9
  export declare const DEFAULT_RECALL_LIMIT = 10;
3
- export declare const DEFAULT_IDLE_REVIEW_MS = 30000;
4
10
  export declare const DEFAULT_RECALL_QUALITY_POLICY = "strict-v1";
5
11
  export declare const DEFAULT_RECALL_LOW_SCORE_THRESHOLD = 0.25;
6
12
  export declare const DEFAULT_RECALL_HIGH_SCORE_THRESHOLD = 0.6;
7
13
  export declare const DEFAULT_RECALL_CANDIDATE_MULTIPLIER = 3;
8
14
  export declare const DEFAULT_RECALL_MAX_MEDIUM_RESULTS = 4;
9
15
  export declare const DEFAULT_RECALL_MAX_UNKNOWN_RESULTS = 2;
10
- export declare const DEFAULT_RUNTIME_MEMORY_LIMIT_BYTES: number;
11
- export declare const DEFAULT_RUNTIME_USER_LIMIT_BYTES: number;
12
- export declare const DEFAULT_RUNTIME_MAINTENANCE_MAX_TOKENS = 8192;
13
- export declare const MAX_RUNTIME_MEMORY_LIMIT_BYTES: number;
14
- export declare const MAX_RUNTIME_MAINTENANCE_MAX_TOKENS = 1000000;
15
- export { DEFAULT_EMBEDDING_ENDPOINT, DEFAULT_EMBEDDING_MODEL, DEFAULT_EMBEDDING_PROTOCOL, MNEMON_EMBEDDING_PROTOCOLS } from './shared/contracts.ts';
@@ -1,5 +1,5 @@
1
1
  import z from 'schemastery';
2
- import type { Config as SharedConfig, CustomPackConfig as SharedCustomPackConfig, InteractionConfig as SharedInteractionConfig, ResolvedConfig as SharedResolvedConfig, ResolvedInteractionConfig as SharedResolvedInteractionConfig } from './shared/contracts.ts';
2
+ import type { Config as SharedConfig, CustomPackConfig as SharedCustomPackConfig, InteractionConfig as SharedInteractionConfig, MemoryPersistenceStrategy, RecallQualityConfig, ResolvedConfig as SharedResolvedConfig, ResolvedInteractionConfig as SharedResolvedInteractionConfig } from "./protocol.ts";
3
3
  export { DEFAULT_IDLE_REVIEW_MS, DEFAULT_EMBEDDING_ENDPOINT, DEFAULT_EMBEDDING_MODEL, DEFAULT_EMBEDDING_PROTOCOL, 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_RUNTIME_MAINTENANCE_MAX_TOKENS, DEFAULT_RUNTIME_MEMORY_LIMIT_BYTES, DEFAULT_RUNTIME_USER_LIMIT_BYTES, DEFAULT_TIMEOUT_MS, MAX_RUNTIME_MAINTENANCE_MAX_TOKENS, MAX_RUNTIME_MEMORY_LIMIT_BYTES, } from './config-values.ts';
4
4
  export type Config = SharedConfig;
5
5
  export type CustomPackConfig = SharedCustomPackConfig;
@@ -9,4 +9,7 @@ export type ResolvedInteractionConfig = SharedResolvedInteractionConfig;
9
9
  export declare const InteractionConfig: z<InteractionConfig>;
10
10
  export declare const Config: z<Config>;
11
11
  export declare function resolveInteractionConfig(config?: InteractionConfig): ResolvedInteractionConfig;
12
+ export declare function resolvePersistenceStrategy(value: MemoryPersistenceStrategy | undefined): ResolvedConfig['persistenceStrategy'];
13
+ export declare function resolveEmbedding(value: Config['embedding']): ResolvedConfig['embedding'];
14
+ export declare function resolveRecallQuality(value: RecallQualityConfig | undefined): ResolvedConfig['recallQuality'];
12
15
  export declare function resolveConfig(config?: Config): ResolvedConfig;
@@ -1,3 +1,3 @@
1
- import type { MnemonDisplayMode } from './contracts.ts';
1
+ import type { MnemonDisplayMode } from './protocol.ts';
2
2
  /** Keep the historical misspelling at input boundaries, never in UI or runtime state. */
3
3
  export declare function normalizeDisplayMode(value: unknown): MnemonDisplayMode;
@@ -0,0 +1,8 @@
1
+ import { Config, type Config as MnemonConfig } from './config.ts';
2
+ export declare const name = "dsh-mnemon";
3
+ export declare const provide: string[];
4
+ export declare const inject: string[];
5
+ export { Config };
6
+ export type { MnemonConfig };
7
+ /** DSH owns assembly; this Host only wires scope, phases and user preferences. */
8
+ export declare function apply(rawContext: unknown, config?: MnemonConfig): void;