dsh-mnemon 0.1.5 → 0.1.6
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 +5 -5
- package/README.zh-CN.md +5 -5
- package/lib/client.js +353 -347
- package/lib/index.js +129 -46
- package/lib/types/activity.d.ts +2 -18
- package/lib/types/channels.d.ts +1 -4
- package/lib/types/client/MnemonLogo.d.ts +0 -1
- package/lib/types/client/MnemonPackSection.d.ts +1 -2
- package/lib/types/client/MnemonSaveAction.d.ts +1 -2
- package/lib/types/client/MnemonSettingsCard.d.ts +1 -3
- package/lib/types/client/MnemonTurnTail.d.ts +1 -2
- package/lib/types/client/MnemonView.d.ts +1 -3
- package/lib/types/client/MnemonViewAppearance.d.ts +0 -1
- package/lib/types/client/anchor.d.ts +0 -1
- package/lib/types/client/api.d.ts +1 -9
- package/lib/types/client/dsh-compat.d.ts +0 -1
- package/lib/types/client/index.d.ts +0 -1
- package/lib/types/client/locales.d.ts +4 -1
- package/lib/types/client/settings.d.ts +1 -2
- package/lib/types/client/sidebar-entry.d.ts +0 -1
- package/lib/types/client/workspace-controller.d.ts +0 -1
- package/lib/types/client/workspace-mount.d.ts +1 -3
- package/lib/types/commands.d.ts +0 -1
- package/lib/types/config-values.d.ts +0 -1
- package/lib/types/config.d.ts +6 -80
- package/lib/types/contracts.d.ts +2 -60
- package/lib/types/documents.d.ts +2 -79
- package/lib/types/guidance.d.ts +0 -1
- package/lib/types/index.d.ts +0 -1
- package/lib/types/lifecycle.d.ts +3 -45
- package/lib/types/live-runtime.d.ts +0 -1
- package/lib/types/memory-bodies.d.ts +3 -20
- package/lib/types/pack.d.ts +2 -48
- package/lib/types/process.d.ts +0 -1
- package/lib/types/review-activity.d.ts +2 -16
- package/lib/types/rpc.d.ts +0 -1
- package/lib/types/runner.d.ts +15 -11
- package/lib/types/runtime-memory.d.ts +2 -59
- package/lib/types/service.d.ts +3 -149
- package/lib/types/settings.d.ts +1 -4
- package/lib/types/shared/contracts.d.ts +609 -0
- package/lib/types/storage-scope.d.ts +2 -29
- package/lib/types/subagent.d.ts +2 -15
- package/lib/types/tools.d.ts +0 -1
- package/lib/types/version-updates.d.ts +2 -29
- package/package.json +8 -7
- package/docs/README.md +0 -8
- package/docs/assets/diagrams/en/memory-system-flow.png +0 -0
- package/docs/assets/diagrams/en/project-architecture.svg +0 -182
- package/docs/assets/diagrams/zh-CN/memory-system-flow.png +0 -0
- package/docs/assets/diagrams/zh-CN/project-architecture.svg +0 -182
- package/docs/assets/media/dsh-mnemon-memory-system-demo-poster.jpg +0 -0
- package/docs/assets/media/dsh-mnemon-memory-system-demo.gif +0 -0
- package/docs/assets/media/dsh-mnemon-memory-system-demo.mp4 +0 -0
- package/docs/assets/screenshots/conversation-memory-jump.png +0 -0
- package/docs/assets/screenshots/conversation-save-dialog.png +0 -0
- package/docs/assets/screenshots/conversation-turn-memory.png +0 -0
- package/docs/assets/screenshots/document-create-dialog.png +0 -0
- package/docs/assets/screenshots/documents-markdown.png +0 -0
- package/docs/assets/screenshots/entities-context.png +0 -0
- package/docs/assets/screenshots/memory-content.png +0 -0
- package/docs/assets/screenshots/overview-memory-graph.png +0 -0
- package/docs/assets/screenshots/recall-agent-answer.png +0 -0
- package/docs/assets/screenshots/remember-dialog.png +0 -0
- package/docs/assets/screenshots/runtime-memory-add.png +0 -0
- package/docs/assets/screenshots/runtime-memory.png +0 -0
- package/docs/assets/screenshots/settings-memory-system.png +0 -0
- package/docs/assets/screenshots/status-overview.png +0 -0
- package/docs/assets/screenshots/version-check.png +0 -0
- package/docs/en/README.md +0 -48
- package/docs/en/architecture.md +0 -133
- package/docs/en/configuration.md +0 -234
- package/docs/en/development.md +0 -198
- package/docs/en/getting-started.md +0 -199
- package/docs/en/interfaces.md +0 -181
- package/docs/en/operations.md +0 -173
- package/docs/en/project-overview.md +0 -145
- package/docs/en/roadmap.md +0 -41
- package/docs/en/storage-model.md +0 -185
- package/docs/en/ui-guide.md +0 -156
- package/docs/en/workflows.md +0 -290
- package/docs/zh-CN/README.md +0 -48
- package/docs/zh-CN/architecture.md +0 -133
- package/docs/zh-CN/configuration.md +0 -234
- package/docs/zh-CN/development.md +0 -198
- package/docs/zh-CN/getting-started.md +0 -199
- package/docs/zh-CN/interfaces.md +0 -181
- package/docs/zh-CN/operations.md +0 -173
- package/docs/zh-CN/project-overview.md +0 -145
- package/docs/zh-CN/roadmap.md +0 -41
- package/docs/zh-CN/storage-model.md +0 -185
- package/docs/zh-CN/ui-guide.md +0 -160
- package/docs/zh-CN/workflows.md +0 -290
- package/lib/client.js.map +0 -1
- package/lib/types/activity.d.ts.map +0 -1
- package/lib/types/activity.js +0 -93
- package/lib/types/activity.js.map +0 -1
- package/lib/types/channels.d.ts.map +0 -1
- package/lib/types/channels.js +0 -4
- package/lib/types/channels.js.map +0 -1
- package/lib/types/client/MnemonLogo.d.ts.map +0 -1
- package/lib/types/client/MnemonLogo.js +0 -6
- package/lib/types/client/MnemonLogo.js.map +0 -1
- package/lib/types/client/MnemonPackSection.d.ts.map +0 -1
- package/lib/types/client/MnemonPackSection.js +0 -136
- package/lib/types/client/MnemonPackSection.js.map +0 -1
- package/lib/types/client/MnemonSaveAction.d.ts.map +0 -1
- package/lib/types/client/MnemonSaveAction.js +0 -90
- package/lib/types/client/MnemonSaveAction.js.map +0 -1
- package/lib/types/client/MnemonSettingsCard.d.ts.map +0 -1
- package/lib/types/client/MnemonSettingsCard.js +0 -155
- package/lib/types/client/MnemonSettingsCard.js.map +0 -1
- package/lib/types/client/MnemonTurnTail.d.ts.map +0 -1
- package/lib/types/client/MnemonTurnTail.js +0 -56
- package/lib/types/client/MnemonTurnTail.js.map +0 -1
- package/lib/types/client/MnemonView.d.ts.map +0 -1
- package/lib/types/client/MnemonView.js +0 -1594
- package/lib/types/client/MnemonView.js.map +0 -1
- package/lib/types/client/MnemonViewAppearance.d.ts.map +0 -1
- package/lib/types/client/MnemonViewAppearance.js +0 -67
- package/lib/types/client/MnemonViewAppearance.js.map +0 -1
- package/lib/types/client/anchor.d.ts.map +0 -1
- package/lib/types/client/anchor.js +0 -46
- package/lib/types/client/anchor.js.map +0 -1
- package/lib/types/client/api.d.ts.map +0 -1
- package/lib/types/client/api.js +0 -150
- package/lib/types/client/api.js.map +0 -1
- package/lib/types/client/dsh-compat.d.ts.map +0 -1
- package/lib/types/client/dsh-compat.js +0 -2
- package/lib/types/client/dsh-compat.js.map +0 -1
- package/lib/types/client/index.d.ts.map +0 -1
- package/lib/types/client/index.js +0 -161
- package/lib/types/client/index.js.map +0 -1
- package/lib/types/client/locales.d.ts.map +0 -1
- package/lib/types/client/locales.js +0 -1172
- package/lib/types/client/locales.js.map +0 -1
- package/lib/types/client/settings.d.ts.map +0 -1
- package/lib/types/client/settings.js +0 -70
- package/lib/types/client/settings.js.map +0 -1
- package/lib/types/client/sidebar-entry.d.ts.map +0 -1
- package/lib/types/client/sidebar-entry.js +0 -134
- package/lib/types/client/sidebar-entry.js.map +0 -1
- package/lib/types/client/workspace-controller.d.ts.map +0 -1
- package/lib/types/client/workspace-controller.js +0 -21
- package/lib/types/client/workspace-controller.js.map +0 -1
- package/lib/types/client/workspace-mount.d.ts.map +0 -1
- package/lib/types/client/workspace-mount.js +0 -138
- package/lib/types/client/workspace-mount.js.map +0 -1
- package/lib/types/commands.d.ts.map +0 -1
- package/lib/types/commands.js +0 -104
- package/lib/types/commands.js.map +0 -1
- package/lib/types/config-values.d.ts.map +0 -1
- package/lib/types/config-values.js +0 -4
- package/lib/types/config-values.js.map +0 -1
- package/lib/types/config.d.ts.map +0 -1
- package/lib/types/config.js +0 -127
- package/lib/types/config.js.map +0 -1
- package/lib/types/contracts.d.ts.map +0 -1
- package/lib/types/contracts.js +0 -2
- package/lib/types/contracts.js.map +0 -1
- package/lib/types/documents.d.ts.map +0 -1
- package/lib/types/documents.js +0 -495
- package/lib/types/documents.js.map +0 -1
- package/lib/types/guidance.d.ts.map +0 -1
- package/lib/types/guidance.js +0 -34
- package/lib/types/guidance.js.map +0 -1
- package/lib/types/index.d.ts.map +0 -1
- package/lib/types/index.js +0 -55
- package/lib/types/index.js.map +0 -1
- package/lib/types/lifecycle.d.ts.map +0 -1
- package/lib/types/lifecycle.js +0 -456
- package/lib/types/lifecycle.js.map +0 -1
- package/lib/types/live-runtime.d.ts.map +0 -1
- package/lib/types/live-runtime.js +0 -146
- package/lib/types/live-runtime.js.map +0 -1
- package/lib/types/memory-bodies.d.ts.map +0 -1
- package/lib/types/memory-bodies.js +0 -186
- package/lib/types/memory-bodies.js.map +0 -1
- package/lib/types/pack.d.ts.map +0 -1
- package/lib/types/pack.js +0 -709
- package/lib/types/pack.js.map +0 -1
- package/lib/types/process.d.ts.map +0 -1
- package/lib/types/process.js +0 -65
- package/lib/types/process.js.map +0 -1
- package/lib/types/review-activity.d.ts.map +0 -1
- package/lib/types/review-activity.js +0 -37
- package/lib/types/review-activity.js.map +0 -1
- package/lib/types/rpc.d.ts.map +0 -1
- package/lib/types/rpc.js +0 -384
- package/lib/types/rpc.js.map +0 -1
- package/lib/types/runner.d.ts.map +0 -1
- package/lib/types/runner.js +0 -198
- package/lib/types/runner.js.map +0 -1
- package/lib/types/runtime-memory.d.ts.map +0 -1
- package/lib/types/runtime-memory.js +0 -415
- package/lib/types/runtime-memory.js.map +0 -1
- package/lib/types/service.d.ts.map +0 -1
- package/lib/types/service.js +0 -512
- package/lib/types/service.js.map +0 -1
- package/lib/types/settings.d.ts.map +0 -1
- package/lib/types/settings.js +0 -103
- package/lib/types/settings.js.map +0 -1
- package/lib/types/storage-scope.d.ts.map +0 -1
- package/lib/types/storage-scope.js +0 -179
- package/lib/types/storage-scope.js.map +0 -1
- package/lib/types/subagent.d.ts.map +0 -1
- package/lib/types/subagent.js +0 -624
- package/lib/types/subagent.js.map +0 -1
- package/lib/types/tools.d.ts.map +0 -1
- package/lib/types/tools.js +0 -341
- package/lib/types/tools.js.map +0 -1
- package/lib/types/version-updates.d.ts.map +0 -1
- package/lib/types/version-updates.js +0 -383
- package/lib/types/version-updates.js.map +0 -1
package/lib/types/config.d.ts
CHANGED
|
@@ -1,86 +1,12 @@
|
|
|
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
3
|
export { DEFAULT_IDLE_REVIEW_MS, DEFAULT_RECALL_LIMIT, DEFAULT_TIMEOUT_MS } from './config-values.ts';
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
cliPath?: string;
|
|
9
|
-
/** Custom Mnemon base directory; also retained as a legacy dataDir-only scope selection. */
|
|
10
|
-
dataDir?: string;
|
|
11
|
-
/** @deprecated Migration-only selector from the former named-Pack settings UI. */
|
|
12
|
-
customPackId?: string;
|
|
13
|
-
/** @deprecated Migration-only roots from the former named-Pack settings UI. */
|
|
14
|
-
customPacks?: CustomPackConfig[];
|
|
15
|
-
/** Legacy store hint used to bootstrap or discover the initial Memory Space. */
|
|
16
|
-
store?: string;
|
|
17
|
-
/** Hard deadline for one CLI process. */
|
|
18
|
-
timeoutMs?: number;
|
|
19
|
-
/** Default number of recall results exposed to the agent and Web workspace. */
|
|
20
|
-
defaultRecallLimit?: number;
|
|
21
|
-
/** Add conservative recall/writeback guidance to the DSH system prompt. */
|
|
22
|
-
routingGuidance?: boolean;
|
|
23
|
-
/** Choose where the DSH Web memory workspace is mounted. */
|
|
24
|
-
displayMode?: 'sidebar' | 'buildin';
|
|
25
|
-
/** Register the configured DSH Web memory workspace. */
|
|
26
|
-
tabEnabled?: boolean;
|
|
27
|
-
/** Allow remember/link/forget mutations. Recall and status remain available when false. */
|
|
28
|
-
writeEnabled?: boolean;
|
|
29
|
-
/** Enable DSH agent lifecycle integration (Prime plus recall/remember cues). */
|
|
30
|
-
lifecycleEnabled?: boolean;
|
|
31
|
-
/** Recall behavior at the first step of each DSH turn. */
|
|
32
|
-
recallMode?: 'guided' | 'off';
|
|
33
|
-
/** Enable the short remember cue and the scored, debounced full-checkpoint review. */
|
|
34
|
-
writebackMode?: 'guided' | 'off';
|
|
35
|
-
/** Continuous root-agent idle time after the QoderWork activity gate is met. */
|
|
36
|
-
idleReviewMs?: number;
|
|
37
|
-
/** @deprecated Migration source for pre-0.2 settings; new writes use the live `mnemon-ui` namespace. */
|
|
38
|
-
conversationInteraction?: {
|
|
39
|
-
/** @deprecated Removed. Mnemon now uses DSH's standard tool presentation. */
|
|
40
|
-
toolviews?: boolean;
|
|
41
|
-
/** Per-turn memory activity bar under completed turns. */
|
|
42
|
-
turnBar?: boolean;
|
|
43
|
-
/** Save-to-memory action on finalized assistant messages. */
|
|
44
|
-
saveAction?: boolean;
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
export interface CustomPackConfig {
|
|
48
|
-
id: string;
|
|
49
|
-
name: string;
|
|
50
|
-
dataDir: string;
|
|
51
|
-
}
|
|
52
|
-
/** Browser-only interaction settings, registered live under `mnemon-ui`. */
|
|
53
|
-
export interface InteractionConfig {
|
|
54
|
-
turnBar?: boolean;
|
|
55
|
-
saveAction?: boolean;
|
|
56
|
-
}
|
|
4
|
+
export type Config = SharedConfig;
|
|
5
|
+
export type CustomPackConfig = SharedCustomPackConfig;
|
|
6
|
+
export type InteractionConfig = SharedInteractionConfig;
|
|
7
|
+
export type ResolvedConfig = SharedResolvedConfig;
|
|
8
|
+
export type ResolvedInteractionConfig = SharedResolvedInteractionConfig;
|
|
57
9
|
export declare const InteractionConfig: z<InteractionConfig>;
|
|
58
10
|
export declare const Config: z<Config>;
|
|
59
|
-
export interface ResolvedConfig {
|
|
60
|
-
storageScope: 'global' | 'workspace' | 'custom';
|
|
61
|
-
cliPath?: string;
|
|
62
|
-
dataDir?: string;
|
|
63
|
-
store?: string;
|
|
64
|
-
timeoutMs: number;
|
|
65
|
-
defaultRecallLimit: number;
|
|
66
|
-
routingGuidance: boolean;
|
|
67
|
-
displayMode: 'sidebar' | 'buildin';
|
|
68
|
-
tabEnabled: boolean;
|
|
69
|
-
writeEnabled: boolean;
|
|
70
|
-
lifecycleEnabled: boolean;
|
|
71
|
-
recallMode: 'guided' | 'off';
|
|
72
|
-
writebackMode: 'guided' | 'off';
|
|
73
|
-
idleReviewMs: number;
|
|
74
|
-
conversationInteraction: {
|
|
75
|
-
toolviews: boolean;
|
|
76
|
-
turnBar: boolean;
|
|
77
|
-
saveAction: boolean;
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
export interface ResolvedInteractionConfig {
|
|
81
|
-
turnBar: boolean;
|
|
82
|
-
saveAction: boolean;
|
|
83
|
-
}
|
|
84
11
|
export declare function resolveInteractionConfig(config?: InteractionConfig): ResolvedInteractionConfig;
|
|
85
12
|
export declare function resolveConfig(config?: Config): ResolvedConfig;
|
|
86
|
-
//# sourceMappingURL=config.d.ts.map
|
package/lib/types/contracts.d.ts
CHANGED
|
@@ -1,35 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type JsonPrimitive
|
|
3
|
-
export type JsonValue = JsonPrimitive | JsonValue[] | {
|
|
4
|
-
[key: string]: JsonValue;
|
|
5
|
-
};
|
|
6
|
-
/** Plugin RPC failures use only error branches accepted by DSH's closed wire schema. */
|
|
7
|
-
export type RpcError = {
|
|
8
|
-
code: 'bad-request';
|
|
9
|
-
message: string;
|
|
10
|
-
details: {
|
|
11
|
-
issues: JsonValue[];
|
|
12
|
-
};
|
|
13
|
-
} | {
|
|
14
|
-
code: 'settings-rejected';
|
|
15
|
-
message: string;
|
|
16
|
-
details: {
|
|
17
|
-
ns: string;
|
|
18
|
-
};
|
|
19
|
-
} | {
|
|
20
|
-
code: 'internal';
|
|
21
|
-
message: string;
|
|
22
|
-
details: Record<string, never>;
|
|
23
|
-
};
|
|
24
|
-
export type RpcResult<T = JsonValue> = {
|
|
25
|
-
ok: true;
|
|
26
|
-
value: T;
|
|
27
|
-
} | {
|
|
28
|
-
ok: false;
|
|
29
|
-
error: RpcError;
|
|
30
|
-
};
|
|
31
|
-
/** Public DSH browser RPC face; the plugin intentionally consumes no other connection state. */
|
|
32
|
-
export type ClientConnectionHandle = Pick<DshClientConnectionHandle, 'rpc'>;
|
|
1
|
+
import type { RpcResult, SettingsOperation } from './shared/contracts.ts';
|
|
2
|
+
export type { ClientConnectionHandle, ClientSettingsScope, ClientSettingsSnapshot, JsonPrimitive, JsonValue, RpcError, RpcResult, SettingsOperation, } from './shared/contracts.ts';
|
|
33
3
|
export type HostRpcHandler = (endpoint: string, payload: unknown) => Promise<RpcResult<unknown>>;
|
|
34
4
|
export interface HostConnectionHandle {
|
|
35
5
|
rpc: {
|
|
@@ -232,31 +202,3 @@ export interface HostContextShape {
|
|
|
232
202
|
on(name: string, listener: (...args: never[]) => unknown): () => unknown;
|
|
233
203
|
effect(callback: () => (() => unknown) | void, label?: string): () => unknown;
|
|
234
204
|
}
|
|
235
|
-
export interface ClientSettingsSnapshot<T> {
|
|
236
|
-
status: 'loading' | 'ready' | 'unavailable';
|
|
237
|
-
value?: T;
|
|
238
|
-
base?: unknown;
|
|
239
|
-
user?: unknown;
|
|
240
|
-
revision?: number;
|
|
241
|
-
writable: boolean;
|
|
242
|
-
mode: 'host' | 'memory';
|
|
243
|
-
}
|
|
244
|
-
export interface ClientSettingsScope<T> {
|
|
245
|
-
getSnapshot(): ClientSettingsSnapshot<T>;
|
|
246
|
-
subscribe(listener: () => void): () => void;
|
|
247
|
-
set(field: string, value: unknown): Promise<void>;
|
|
248
|
-
unset(field: string): Promise<void>;
|
|
249
|
-
setPath(path: string[], value: unknown): Promise<void>;
|
|
250
|
-
unsetPath(path: string[]): Promise<void>;
|
|
251
|
-
/** Commit one namespace mutation behind a single revision fence. */
|
|
252
|
-
mutate?(ops: SettingsOperation[]): Promise<void>;
|
|
253
|
-
}
|
|
254
|
-
export type SettingsOperation = {
|
|
255
|
-
op: 'set';
|
|
256
|
-
path: string[];
|
|
257
|
-
value: unknown;
|
|
258
|
-
} | {
|
|
259
|
-
op: 'unset';
|
|
260
|
-
path: string[];
|
|
261
|
-
};
|
|
262
|
-
//# sourceMappingURL=contracts.d.ts.map
|
package/lib/types/documents.d.ts
CHANGED
|
@@ -1,84 +1,8 @@
|
|
|
1
1
|
import type { HostAgent } from './contracts.ts';
|
|
2
|
+
import type { DocumentMutation, DocumentMutationResult, DocumentRecord, DocumentSearchResult, DocumentSnapshot, DocumentView } from './shared/contracts.ts';
|
|
3
|
+
export type { DocumentMutation, DocumentMutationResult, DocumentRecord, DocumentSearchResult, DocumentSnapshot, DocumentStatus, DocumentView } from './shared/contracts.ts';
|
|
2
4
|
export declare const DOCUMENTS_VERSION = 1;
|
|
3
5
|
export declare const DOCUMENTS_ACTIVE_LIMIT_BYTES: number;
|
|
4
|
-
export type DocumentStatus = 'active' | 'archived';
|
|
5
|
-
export interface DocumentRecord {
|
|
6
|
-
id: string;
|
|
7
|
-
title: string;
|
|
8
|
-
description: string;
|
|
9
|
-
status: DocumentStatus;
|
|
10
|
-
filename: string;
|
|
11
|
-
relativePath: string;
|
|
12
|
-
sourcePaths: string[];
|
|
13
|
-
sessionIds: string[];
|
|
14
|
-
createdAt: string;
|
|
15
|
-
updatedAt: string;
|
|
16
|
-
lastAccessedAt: string;
|
|
17
|
-
revision: number;
|
|
18
|
-
contentHash: string;
|
|
19
|
-
sizeBytes: number;
|
|
20
|
-
archivedAt?: string;
|
|
21
|
-
archiveSummary?: string;
|
|
22
|
-
memoryBodyIds: string[];
|
|
23
|
-
}
|
|
24
|
-
export interface DocumentView extends DocumentRecord {
|
|
25
|
-
content: string;
|
|
26
|
-
}
|
|
27
|
-
export interface DocumentSnapshot {
|
|
28
|
-
workspaceRoot: string;
|
|
29
|
-
directory: string;
|
|
30
|
-
indexPath: string;
|
|
31
|
-
generatedAt: string;
|
|
32
|
-
revision: string;
|
|
33
|
-
limitBytes: number;
|
|
34
|
-
activeBytes: number;
|
|
35
|
-
activeCount: number;
|
|
36
|
-
archivedCount: number;
|
|
37
|
-
total: number;
|
|
38
|
-
documents: Array<DocumentRecord & {
|
|
39
|
-
healthy: boolean;
|
|
40
|
-
excerpt: string;
|
|
41
|
-
}>;
|
|
42
|
-
}
|
|
43
|
-
export interface DocumentSearchResult {
|
|
44
|
-
query: string;
|
|
45
|
-
includeArchived: boolean;
|
|
46
|
-
total: number;
|
|
47
|
-
generatedAt: string;
|
|
48
|
-
results: Array<DocumentView & {
|
|
49
|
-
score: number;
|
|
50
|
-
excerpt: string;
|
|
51
|
-
}>;
|
|
52
|
-
}
|
|
53
|
-
export type DocumentMutation = {
|
|
54
|
-
action: 'create';
|
|
55
|
-
title: string;
|
|
56
|
-
description?: string;
|
|
57
|
-
content: string;
|
|
58
|
-
sourcePaths?: string[];
|
|
59
|
-
sessionIds?: string[];
|
|
60
|
-
} | {
|
|
61
|
-
action: 'update';
|
|
62
|
-
id: string;
|
|
63
|
-
title?: string;
|
|
64
|
-
description?: string;
|
|
65
|
-
content?: string;
|
|
66
|
-
sourcePaths?: string[];
|
|
67
|
-
sessionIds?: string[];
|
|
68
|
-
};
|
|
69
|
-
export interface DocumentMutationResult {
|
|
70
|
-
success: true;
|
|
71
|
-
action: 'created' | 'updated' | 'archived';
|
|
72
|
-
document: DocumentView;
|
|
73
|
-
snapshot: DocumentSnapshot;
|
|
74
|
-
maintenance?: {
|
|
75
|
-
runId: string;
|
|
76
|
-
provider: string;
|
|
77
|
-
summary: string;
|
|
78
|
-
memoryBodyIds: string[];
|
|
79
|
-
archivedDocumentIds: string[];
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
6
|
export interface DocumentCapacityPlan {
|
|
83
7
|
projected: number;
|
|
84
8
|
limit: number;
|
|
@@ -146,4 +70,3 @@ export declare class DocumentManager {
|
|
|
146
70
|
forWorkspace(workspaceRoot: string): DocumentController;
|
|
147
71
|
forAgent(agent: HostAgent): DocumentController;
|
|
148
72
|
}
|
|
149
|
-
//# sourceMappingURL=documents.d.ts.map
|
package/lib/types/guidance.d.ts
CHANGED
|
@@ -9,4 +9,3 @@ export declare function registerGuidance(ctx: HostContextShape, config?: Pick<Re
|
|
|
9
9
|
export declare function registerRuntimeMemoryContext(ctx: HostContextShape, runtimeMemory: RuntimeMemoryController): void;
|
|
10
10
|
/** Shadow the global fallback with the current Agent workspace's hot memory. */
|
|
11
11
|
export declare function registerAgentRuntimeMemoryContext(agent: HostAgent, runtimeMemory: () => RuntimeMemoryController): () => void;
|
|
12
|
-
//# sourceMappingURL=guidance.d.ts.map
|
package/lib/types/index.d.ts
CHANGED
|
@@ -15,4 +15,3 @@ export { Config, InteractionConfig, resolveConfig, resolveInteractionConfig, Doc
|
|
|
15
15
|
export type { MnemonConfig };
|
|
16
16
|
/** Mount native model tools on every DSH surface and UI RPC only when Web connection exists. */
|
|
17
17
|
export declare function apply(rawContext: unknown, config?: MnemonConfig): void;
|
|
18
|
-
//# sourceMappingURL=index.d.ts.map
|
package/lib/types/lifecycle.d.ts
CHANGED
|
@@ -3,62 +3,21 @@ import type { HostAgent, 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
|
-
import { MnemonSubagentCoordinator, type DelegatedWriteResult
|
|
7
|
-
import { type ReviewActivityScore } from './review-activity.ts';
|
|
6
|
+
import { MnemonSubagentCoordinator, type DelegatedWriteResult } from './subagent.ts';
|
|
8
7
|
import { type TurnMemoryActivitySnapshot } from './activity.ts';
|
|
9
8
|
import type { RuntimeMemoryController } from './runtime-memory.ts';
|
|
9
|
+
import type { AssistantMessageText, LifecycleSnapshot } from './shared/contracts.ts';
|
|
10
10
|
interface AgentRuntimeSource {
|
|
11
11
|
forAgent(agent: HostAgent): {
|
|
12
12
|
runtimeMemory: RuntimeMemoryController;
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
export type { TurnMemoryActivity, TurnMemoryActivitySnapshot } from './activity.ts';
|
|
16
|
+
export type { AssistantMessageText, LifecycleAgentSnapshot, LifecycleCounters, LifecyclePhase, LifecycleSnapshot } from './shared/contracts.ts';
|
|
16
17
|
export declare const MNEMON_PLUGIN_SOURCE = "dsh-mnemon";
|
|
17
|
-
export type LifecyclePhase = 'idle' | 'prime' | 'recall' | 'writeback' | 'review' | 'supervised' | 'error';
|
|
18
|
-
export interface LifecycleCounters {
|
|
19
|
-
primes: number;
|
|
20
|
-
recallCues: number;
|
|
21
|
-
writebackCues: number;
|
|
22
|
-
supervisedRequests: number;
|
|
23
|
-
failures: number;
|
|
24
|
-
}
|
|
25
|
-
export interface LifecycleAgentSnapshot {
|
|
26
|
-
sessionId: string;
|
|
27
|
-
status: 'idle' | 'running';
|
|
28
|
-
startSource: 'startup' | 'resume' | 'clear' | 'compact' | 'adopted';
|
|
29
|
-
primePending: boolean;
|
|
30
|
-
guidedTurns: number;
|
|
31
|
-
memoryToolCalls: number;
|
|
32
|
-
idleReviewPending: boolean;
|
|
33
|
-
reviewRunning: boolean;
|
|
34
|
-
reviewActivity: ReviewActivityScore;
|
|
35
|
-
lastPhase: LifecyclePhase;
|
|
36
|
-
lastReviewAt?: string;
|
|
37
|
-
lastReviewAction?: string;
|
|
38
|
-
lastReviewScore?: number;
|
|
39
|
-
lastReviewDocumentIds?: string[];
|
|
40
|
-
lastAt?: string;
|
|
41
|
-
lastError?: string;
|
|
42
|
-
}
|
|
43
|
-
export interface LifecycleSnapshot {
|
|
44
|
-
enabled: boolean;
|
|
45
|
-
recallMode: ResolvedConfig['recallMode'];
|
|
46
|
-
writebackMode: ResolvedConfig['writebackMode'];
|
|
47
|
-
idleReviewMs: number;
|
|
48
|
-
activeAgents: number;
|
|
49
|
-
sessionAvailable: boolean;
|
|
50
|
-
counters: LifecycleCounters;
|
|
51
|
-
subagents: SubagentCounters;
|
|
52
|
-
current?: LifecycleAgentSnapshot;
|
|
53
|
-
}
|
|
54
18
|
export interface SupervisedWritebackResult extends DelegatedWriteResult {
|
|
55
19
|
sessionId: string;
|
|
56
20
|
}
|
|
57
|
-
/** Extracted plain text of one finalized assistant message, when present in the session log. */
|
|
58
|
-
export interface AssistantMessageText {
|
|
59
|
-
messageId: string;
|
|
60
|
-
text: string;
|
|
61
|
-
}
|
|
62
21
|
/** DSH-native owner for per-agent Mnemon lifecycle hooks and UI-triggered LLM work. */
|
|
63
22
|
export declare class MnemonLifecycle {
|
|
64
23
|
private readonly ctx;
|
|
@@ -92,4 +51,3 @@ export declare class MnemonLifecycle {
|
|
|
92
51
|
private liveAgent;
|
|
93
52
|
private install;
|
|
94
53
|
}
|
|
95
|
-
//# sourceMappingURL=lifecycle.d.ts.map
|
|
@@ -1,23 +1,6 @@
|
|
|
1
1
|
import type { MnemonRunner } from './runner.ts';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
name: string;
|
|
5
|
-
description: string;
|
|
6
|
-
active: boolean;
|
|
7
|
-
dbPath: string;
|
|
8
|
-
createdAt: string;
|
|
9
|
-
updatedAt: string;
|
|
10
|
-
}
|
|
11
|
-
export interface CreateMemoryBodyRequest {
|
|
12
|
-
name: string;
|
|
13
|
-
description: string;
|
|
14
|
-
active?: boolean;
|
|
15
|
-
}
|
|
16
|
-
export interface UpdateMemoryBodyRequest {
|
|
17
|
-
name?: string;
|
|
18
|
-
description?: string;
|
|
19
|
-
active?: boolean;
|
|
20
|
-
}
|
|
2
|
+
import type { CreateMemoryBodyRequest, MemoryBody, UpdateMemoryBodyRequest } from './shared/contracts.ts';
|
|
3
|
+
export type { CreateMemoryBodyRequest, MemoryBody, UpdateMemoryBodyRequest } from './shared/contracts.ts';
|
|
21
4
|
export declare function validateMemoryBodyId(value: string): string;
|
|
22
5
|
/**
|
|
23
6
|
* Persistent metadata layered over Mnemon's native named stores.
|
|
@@ -44,7 +27,7 @@ export declare class MemoryBodyRegistry {
|
|
|
44
27
|
reload(): void;
|
|
45
28
|
private loadAndReconcile;
|
|
46
29
|
private reconcileDiscoveredStores;
|
|
30
|
+
private nativeStoreIds;
|
|
47
31
|
private view;
|
|
48
32
|
private save;
|
|
49
33
|
}
|
|
50
|
-
//# sourceMappingURL=memory-bodies.d.ts.map
|
package/lib/types/pack.d.ts
CHANGED
|
@@ -1,56 +1,12 @@
|
|
|
1
1
|
import type { ResolvedConfig } from './config.ts';
|
|
2
2
|
import type { MnemonRunner } from './runner.ts';
|
|
3
|
+
import type { MnemonPackComponent, MnemonPackExport, MnemonPackImportMode, MnemonPackImportResult, MnemonPackPreview, MnemonPackScope } from './shared/contracts.ts';
|
|
4
|
+
export type { MnemonPackComponent, MnemonPackComponentSummary, MnemonPackExport, MnemonPackImportMode, MnemonPackImportResult, MnemonPackManifest, MnemonPackPreview, MnemonPackScope } from './shared/contracts.ts';
|
|
3
5
|
export declare const MNEMON_PACK_FORMAT = "mnemonpack";
|
|
4
6
|
export declare const MNEMON_PACK_VERSION = 1;
|
|
5
7
|
export declare const MNEMON_PACK_MIME = "application/zip";
|
|
6
8
|
export declare const MNEMON_PACK_MAX_ARCHIVE_BYTES: number;
|
|
7
9
|
export declare const MNEMON_PACK_MAX_EXPANDED_BYTES: number;
|
|
8
|
-
declare const COMPONENT_ORDER: readonly ["runtime", "documents", "memory-spaces"];
|
|
9
|
-
export type MnemonPackComponent = typeof COMPONENT_ORDER[number];
|
|
10
|
-
export type MnemonPackScope = 'full' | MnemonPackComponent;
|
|
11
|
-
export type MnemonPackImportMode = 'merge' | 'replace';
|
|
12
|
-
export interface MnemonPackComponentSummary {
|
|
13
|
-
component: MnemonPackComponent;
|
|
14
|
-
files: number;
|
|
15
|
-
bytes: number;
|
|
16
|
-
items: number;
|
|
17
|
-
}
|
|
18
|
-
export interface MnemonPackManifest {
|
|
19
|
-
format: typeof MNEMON_PACK_FORMAT;
|
|
20
|
-
version: typeof MNEMON_PACK_VERSION;
|
|
21
|
-
scope: MnemonPackScope;
|
|
22
|
-
exportedAt: string;
|
|
23
|
-
source: {
|
|
24
|
-
plugin: 'dsh-mnemon';
|
|
25
|
-
pluginVersion: string;
|
|
26
|
-
};
|
|
27
|
-
components: MnemonPackComponent[];
|
|
28
|
-
summary: MnemonPackComponentSummary[];
|
|
29
|
-
}
|
|
30
|
-
export interface MnemonPackExport {
|
|
31
|
-
fileName: string;
|
|
32
|
-
mimeType: typeof MNEMON_PACK_MIME;
|
|
33
|
-
bytes: number;
|
|
34
|
-
base64: string;
|
|
35
|
-
targetRoot: string;
|
|
36
|
-
manifest: MnemonPackManifest;
|
|
37
|
-
}
|
|
38
|
-
export interface MnemonPackPreview {
|
|
39
|
-
fileName?: string;
|
|
40
|
-
archiveBytes: number;
|
|
41
|
-
expandedBytes: number;
|
|
42
|
-
targetRoot: string;
|
|
43
|
-
targetScope: ResolvedConfig['storageScope'];
|
|
44
|
-
manifest: MnemonPackManifest;
|
|
45
|
-
occupied: Record<MnemonPackComponent, boolean>;
|
|
46
|
-
}
|
|
47
|
-
export interface MnemonPackImportResult {
|
|
48
|
-
imported: true;
|
|
49
|
-
mode: MnemonPackImportMode;
|
|
50
|
-
targetRoot: string;
|
|
51
|
-
components: MnemonPackComponent[];
|
|
52
|
-
summary: MnemonPackComponentSummary[];
|
|
53
|
-
}
|
|
54
10
|
/** Native, checksummed import/export for the one currently effective Mnemon root. */
|
|
55
11
|
export declare class MnemonPackManager {
|
|
56
12
|
private readonly runner;
|
|
@@ -70,5 +26,3 @@ export declare class MnemonPackManager {
|
|
|
70
26
|
components?: MnemonPackComponent[];
|
|
71
27
|
}): Promise<MnemonPackImportResult>;
|
|
72
28
|
}
|
|
73
|
-
export {};
|
|
74
|
-
//# sourceMappingURL=pack.d.ts.map
|
package/lib/types/process.d.ts
CHANGED
|
@@ -11,4 +11,3 @@ export interface ProcessOptions {
|
|
|
11
11
|
export type ProcessRunner = (command: string, args: readonly string[], options: ProcessOptions) => Promise<ProcessResult>;
|
|
12
12
|
/** Spawn without a shell, with bounded output and cooperative cancellation. */
|
|
13
13
|
export declare const runProcess: ProcessRunner;
|
|
14
|
-
//# sourceMappingURL=process.d.ts.map
|
|
@@ -14,20 +14,6 @@ export declare const QODERWORK_REVIEW_POLICY: Readonly<{
|
|
|
14
14
|
toolDiversityScoreCap: 2;
|
|
15
15
|
turnScore: 1;
|
|
16
16
|
}>;
|
|
17
|
-
export interface ReviewActivity {
|
|
18
|
-
totalUserTextLength: number;
|
|
19
|
-
turnCount: number;
|
|
20
|
-
toolCallCount: number;
|
|
21
|
-
uniqueToolCount: number;
|
|
22
|
-
}
|
|
23
|
-
export interface ReviewActivityScore extends ReviewActivity {
|
|
24
|
-
textLengthScore: number;
|
|
25
|
-
turnScore: number;
|
|
26
|
-
toolCallScore: number;
|
|
27
|
-
toolDiversityScore: number;
|
|
28
|
-
score: number;
|
|
29
|
-
threshold: number;
|
|
30
|
-
eligible: boolean;
|
|
31
|
-
}
|
|
32
17
|
export declare function scoreReviewActivity(activity: ReviewActivity): ReviewActivityScore;
|
|
33
|
-
|
|
18
|
+
import type { ReviewActivity, ReviewActivityScore } from './shared/contracts.ts';
|
|
19
|
+
export type { ReviewActivity, ReviewActivityScore } from './shared/contracts.ts';
|
package/lib/types/rpc.d.ts
CHANGED
|
@@ -14,4 +14,3 @@ export declare function createWriteHandler(input: RuntimeInput, lifecycle?: Mnem
|
|
|
14
14
|
export declare function createPackHandler(manager: MnemonPackManager, writeEnabled?: boolean | (() => boolean)): HostRpcHandler;
|
|
15
15
|
/** Read operations are available to trusted Web hosts; local mutations stay loopback-only. */
|
|
16
16
|
export declare function registerRpc(connection: HostConnectionHandle, input: RuntimeInput, lifecycle?: MnemonLifecycle, runtimeMemory?: RuntimeMemoryController, storage?: StorageScopeInspector, packs?: MnemonPackManager, versions?: VersionUpdateManager): void;
|
|
17
|
-
//# sourceMappingURL=rpc.d.ts.map
|
package/lib/types/runner.d.ts
CHANGED
|
@@ -14,24 +14,28 @@ export declare class MnemonCliError extends Error {
|
|
|
14
14
|
readonly stderr: string;
|
|
15
15
|
constructor(message: string, exitCode?: number | null, stderr?: string);
|
|
16
16
|
}
|
|
17
|
+
export interface MnemonRunOptions {
|
|
18
|
+
signal?: AbortSignal;
|
|
19
|
+
globalFlags?: boolean;
|
|
20
|
+
store?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface MnemonTextCommand {
|
|
23
|
+
args: readonly string[];
|
|
24
|
+
options?: MnemonRunOptions;
|
|
25
|
+
}
|
|
17
26
|
export interface MnemonRunner {
|
|
18
27
|
readonly command: string;
|
|
19
28
|
readonly commandFound: boolean;
|
|
20
29
|
readonly config: ResolvedConfig;
|
|
21
|
-
runJson(args: readonly string[], options?:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}): Promise<JsonValue>;
|
|
26
|
-
runText(args: readonly string[], options?: {
|
|
27
|
-
signal?: AbortSignal;
|
|
28
|
-
globalFlags?: boolean;
|
|
29
|
-
store?: string;
|
|
30
|
-
}): Promise<string>;
|
|
30
|
+
runJson(args: readonly string[], options?: MnemonRunOptions): Promise<JsonValue>;
|
|
31
|
+
runText(args: readonly string[], options?: MnemonRunOptions): Promise<string>;
|
|
32
|
+
/** Run related CLI commands consecutively without allowing queued work between them. */
|
|
33
|
+
runTextBatch(commands: readonly MnemonTextCommand[]): Promise<string[]>;
|
|
31
34
|
/** Run one operation after all CLI work and hold the same queue until it settles. */
|
|
32
35
|
withExclusive<T>(operation: () => T | Promise<T>): Promise<T>;
|
|
33
36
|
effectiveDataDir(): string;
|
|
37
|
+
/** Read Mnemon's persisted active-file selection, ignoring config and environment overrides. */
|
|
38
|
+
persistedStore(): string;
|
|
34
39
|
effectiveStore(): string;
|
|
35
40
|
}
|
|
36
41
|
export declare function createRunner(config: ResolvedConfig, processRunner?: ProcessRunner, workspaceRoot?: string): MnemonRunner;
|
|
37
|
-
//# sourceMappingURL=runner.d.ts.map
|
|
@@ -1,68 +1,12 @@
|
|
|
1
1
|
import type { MnemonRunner } from './runner.ts';
|
|
2
|
+
import type { RuntimeMemoryCompactedEntry, RuntimeMemoryMutation, RuntimeMemoryMutationResult, RuntimeMemorySnapshot, RuntimeMemoryTarget } from './shared/contracts.ts';
|
|
3
|
+
export type { RuntimeMemoryAction, RuntimeMemoryCompactedEntry, RuntimeMemoryEntry, RuntimeMemoryImportance, RuntimeMemoryMutation, RuntimeMemoryMutationResult, RuntimeMemorySnapshot, RuntimeMemoryTarget, RuntimeMemoryTargetView, RuntimeMemoryUsage, } from './shared/contracts.ts';
|
|
2
4
|
export declare const RUNTIME_MEMORY_VERSION = 1;
|
|
3
5
|
export declare const RUNTIME_ENTRY_DELIMITER = "\n\u00A7\n";
|
|
4
6
|
export declare const RUNTIME_MEMORY_LIMITS: {
|
|
5
7
|
readonly memory: number;
|
|
6
8
|
readonly user: number;
|
|
7
9
|
};
|
|
8
|
-
export type RuntimeMemoryTarget = keyof typeof RUNTIME_MEMORY_LIMITS;
|
|
9
|
-
export type RuntimeMemoryImportance = 'critical' | 'normal' | 'low';
|
|
10
|
-
export type RuntimeMemoryAction = 'add' | 'replace' | 'remove';
|
|
11
|
-
export interface RuntimeMemoryEntry {
|
|
12
|
-
content: string;
|
|
13
|
-
created_at: string;
|
|
14
|
-
updated_at: string;
|
|
15
|
-
target: RuntimeMemoryTarget;
|
|
16
|
-
importance: RuntimeMemoryImportance;
|
|
17
|
-
}
|
|
18
|
-
export interface RuntimeMemoryUsage {
|
|
19
|
-
used: number;
|
|
20
|
-
limit: number;
|
|
21
|
-
}
|
|
22
|
-
export interface RuntimeMemoryTargetView extends RuntimeMemoryUsage {
|
|
23
|
-
target: RuntimeMemoryTarget;
|
|
24
|
-
entryCount: number;
|
|
25
|
-
markdownPath: string;
|
|
26
|
-
}
|
|
27
|
-
export interface RuntimeMemorySnapshot {
|
|
28
|
-
directory: string;
|
|
29
|
-
sourcePath: string;
|
|
30
|
-
revision: string;
|
|
31
|
-
generatedAt: string;
|
|
32
|
-
entries: RuntimeMemoryEntry[];
|
|
33
|
-
targets: Record<RuntimeMemoryTarget, RuntimeMemoryTargetView>;
|
|
34
|
-
}
|
|
35
|
-
export interface RuntimeMemoryCompactedEntry {
|
|
36
|
-
content: string;
|
|
37
|
-
importance: RuntimeMemoryImportance;
|
|
38
|
-
}
|
|
39
|
-
export interface RuntimeMemoryMutation {
|
|
40
|
-
action: RuntimeMemoryAction;
|
|
41
|
-
target: RuntimeMemoryTarget;
|
|
42
|
-
content?: string;
|
|
43
|
-
oldText?: string;
|
|
44
|
-
importance?: RuntimeMemoryImportance;
|
|
45
|
-
}
|
|
46
|
-
export type RuntimeMemoryMutationResult = {
|
|
47
|
-
success: true;
|
|
48
|
-
message: string;
|
|
49
|
-
target: RuntimeMemoryTarget;
|
|
50
|
-
entryCount: number;
|
|
51
|
-
usage: RuntimeMemoryUsage;
|
|
52
|
-
added?: string;
|
|
53
|
-
replaced?: {
|
|
54
|
-
from: string;
|
|
55
|
-
to: string;
|
|
56
|
-
};
|
|
57
|
-
removed?: string;
|
|
58
|
-
maintenance?: {
|
|
59
|
-
kind: 'local-compaction' | 'mnemon-archive';
|
|
60
|
-
runId: string;
|
|
61
|
-
provider: string;
|
|
62
|
-
summary: string;
|
|
63
|
-
memoryBodyIds: string[];
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
10
|
export declare class RuntimeMemoryCapacityError extends Error {
|
|
67
11
|
readonly target: RuntimeMemoryTarget;
|
|
68
12
|
readonly used: number;
|
|
@@ -101,4 +45,3 @@ export declare class RuntimeMemoryController {
|
|
|
101
45
|
private repairProjections;
|
|
102
46
|
private withLock;
|
|
103
47
|
}
|
|
104
|
-
//# sourceMappingURL=runtime-memory.d.ts.map
|