dsh-mnemon 0.2.2 → 0.2.3
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/cordis.patch.yml +1 -0
- package/lib/index.js +12 -9
- package/lib/types/contracts.d.ts +2 -1
- package/lib/types/rpc.d.ts +4 -4
- package/lib/types/settings.d.ts +2 -2
- package/lib/types/shared/contracts.d.ts +3 -0
- package/package.json +18 -31
package/cordis.patch.yml
CHANGED
package/lib/index.js
CHANGED
|
@@ -81,6 +81,7 @@ const Config = z.object({
|
|
|
81
81
|
displayMode: z.union(["sidebar", "buildin"]).default("sidebar"),
|
|
82
82
|
tabEnabled: z.boolean().default(true),
|
|
83
83
|
writeEnabled: z.boolean().default(true),
|
|
84
|
+
remoteAccess: z.union(["read-only", "trusted-host"]).default("read-only"),
|
|
84
85
|
lifecycleEnabled: z.boolean().default(true),
|
|
85
86
|
recallMode: z.union(["guided", "off"]).default("guided"),
|
|
86
87
|
writebackMode: z.union(["guided", "off"]).default("guided"),
|
|
@@ -226,6 +227,7 @@ function resolveConfig(config = {}) {
|
|
|
226
227
|
displayMode: config.displayMode ?? "sidebar",
|
|
227
228
|
tabEnabled: config.tabEnabled ?? true,
|
|
228
229
|
writeEnabled: config.writeEnabled ?? true,
|
|
230
|
+
remoteAccess: config.remoteAccess ?? "read-only",
|
|
229
231
|
lifecycleEnabled: config.lifecycleEnabled ?? true,
|
|
230
232
|
recallMode: config.recallMode ?? "guided",
|
|
231
233
|
writebackMode: config.writebackMode ?? "guided",
|
|
@@ -9433,7 +9435,7 @@ function createWriteHandler(input, lifecycle, runtimeMemory, versions) {
|
|
|
9433
9435
|
}
|
|
9434
9436
|
};
|
|
9435
9437
|
}
|
|
9436
|
-
/** Backup payloads contain private memory and
|
|
9438
|
+
/** Backup payloads contain private memory and use the deployment's management authority. */
|
|
9437
9439
|
function createPackHandler(input, writeEnabled = true) {
|
|
9438
9440
|
return async (endpoint, rawPayload) => {
|
|
9439
9441
|
try {
|
|
@@ -9452,15 +9454,15 @@ function createPackHandler(input, writeEnabled = true) {
|
|
|
9452
9454
|
}
|
|
9453
9455
|
};
|
|
9454
9456
|
}
|
|
9455
|
-
/**
|
|
9456
|
-
function registerRpc(connection, input, lifecycle, runtimeMemory, storage, packs, versions) {
|
|
9457
|
+
/** Reads and activation use trusted hosts; other privileged channels require explicit promotion. */
|
|
9458
|
+
function registerRpc(connection, input, lifecycle, runtimeMemory, storage, packs, versions, managementAuthority = "loopback") {
|
|
9457
9459
|
const versionManager = versions ?? new VersionUpdateManager({ mnemonCliPath: () => findVersionCli(input) });
|
|
9458
9460
|
connection.rpc.handle(MNEMON_READ_CHANNEL, createReadHandler(input, lifecycle, runtimeMemory, storage, versionManager), { authority: "trusted-host" });
|
|
9459
9461
|
connection.rpc.handle(MNEMON_ACTIVATION_CHANNEL, createActivationHandler(input), { authority: "trusted-host" });
|
|
9460
|
-
connection.rpc.handle(MNEMON_WRITE_CHANNEL, createWriteHandler(input, lifecycle, runtimeMemory, versionManager), { authority:
|
|
9462
|
+
connection.rpc.handle(MNEMON_WRITE_CHANNEL, createWriteHandler(input, lifecycle, runtimeMemory, versionManager), { authority: managementAuthority });
|
|
9461
9463
|
const packManager = isRoutedRuntime(input) ? input : packs;
|
|
9462
9464
|
const config = input.config;
|
|
9463
|
-
if (packManager !== void 0) connection.rpc.handle(MNEMON_PACK_CHANNEL, createPackHandler(packManager, () => config.writeEnabled), { authority:
|
|
9465
|
+
if (packManager !== void 0) connection.rpc.handle(MNEMON_PACK_CHANNEL, createPackHandler(packManager, () => config.writeEnabled), { authority: managementAuthority });
|
|
9464
9466
|
}
|
|
9465
9467
|
function findVersionCli(input) {
|
|
9466
9468
|
return input.config.cliPath;
|
|
@@ -9577,8 +9579,8 @@ function createSettingsHandler(settings) {
|
|
|
9577
9579
|
}
|
|
9578
9580
|
};
|
|
9579
9581
|
}
|
|
9580
|
-
function registerSettingsRpc(connection, settings) {
|
|
9581
|
-
connection.rpc.handle(MNEMON_SETTINGS_CHANNEL, createSettingsHandler(settings), { authority
|
|
9582
|
+
function registerSettingsRpc(connection, settings, authority = "loopback") {
|
|
9583
|
+
connection.rpc.handle(MNEMON_SETTINGS_CHANNEL, createSettingsHandler(settings), { authority });
|
|
9582
9584
|
}
|
|
9583
9585
|
//#endregion
|
|
9584
9586
|
//#region src/tools.ts
|
|
@@ -10284,8 +10286,9 @@ function apply(rawContext, config = {}) {
|
|
|
10284
10286
|
registerRuntimeMemoryContext(ctx, runtime.runtimeMemory);
|
|
10285
10287
|
ctx.inject(["connection"], (webContext) => {
|
|
10286
10288
|
if (webContext.connection === void 0) return;
|
|
10287
|
-
|
|
10288
|
-
|
|
10289
|
+
const managementAuthority = resolved.remoteAccess === "trusted-host" ? "trusted-host" : "loopback";
|
|
10290
|
+
registerRpc(webContext.connection, runtime, lifecycle, void 0, void 0, void 0, void 0, managementAuthority);
|
|
10291
|
+
registerSettingsRpc(webContext.connection, ctx.settings, managementAuthority);
|
|
10289
10292
|
});
|
|
10290
10293
|
}
|
|
10291
10294
|
//#endregion
|
package/lib/types/contracts.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { RpcResult, SettingsOperation } from './shared/contracts.ts';
|
|
2
2
|
export type { ClientConnectionHandle, ClientSettingsScope, ClientSettingsSnapshot, JsonPrimitive, JsonValue, RpcError, RpcResult, SettingsOperation, } from './shared/contracts.ts';
|
|
3
3
|
export type HostRpcHandler = (endpoint: string, payload: unknown) => Promise<RpcResult<unknown>>;
|
|
4
|
+
export type HostRpcAuthority = 'trusted-host' | 'loopback';
|
|
4
5
|
export interface HostConnectionHandle {
|
|
5
6
|
rpc: {
|
|
6
7
|
handle(channel: string, handler: HostRpcHandler, options: {
|
|
7
|
-
authority:
|
|
8
|
+
authority: HostRpcAuthority;
|
|
8
9
|
}): unknown;
|
|
9
10
|
};
|
|
10
11
|
}
|
package/lib/types/rpc.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { HostConnectionHandle, HostRpcHandler } from './contracts.ts';
|
|
1
|
+
import type { HostConnectionHandle, HostRpcAuthority, HostRpcHandler } from './contracts.ts';
|
|
2
2
|
import type { MnemonLifecycle } from './lifecycle.ts';
|
|
3
3
|
import type { RuntimeMemoryController } from './runtime-memory.ts';
|
|
4
4
|
import type { MnemonService } from './service.ts';
|
|
@@ -16,7 +16,7 @@ export declare function createReadHandler(input: RuntimeInput, lifecycle?: Mnemo
|
|
|
16
16
|
*/
|
|
17
17
|
export declare function createActivationHandler(input: RuntimeInput): HostRpcHandler;
|
|
18
18
|
export declare function createWriteHandler(input: RuntimeInput, lifecycle?: MnemonLifecycle, runtimeMemory?: RuntimeMemoryController, versions?: VersionUpdateManager): HostRpcHandler;
|
|
19
|
-
/** Backup payloads contain private memory and
|
|
19
|
+
/** Backup payloads contain private memory and use the deployment's management authority. */
|
|
20
20
|
export declare function createPackHandler(input: MnemonPackManager | LiveMnemonRuntime, writeEnabled?: boolean | (() => boolean)): HostRpcHandler;
|
|
21
|
-
/**
|
|
22
|
-
export declare function registerRpc(connection: HostConnectionHandle, input: RuntimeInput, lifecycle?: MnemonLifecycle, runtimeMemory?: RuntimeMemoryController, storage?: StorageScopeInspector, packs?: MnemonPackManager, versions?: VersionUpdateManager): void;
|
|
21
|
+
/** Reads and activation use trusted hosts; other privileged channels require explicit promotion. */
|
|
22
|
+
export declare function registerRpc(connection: HostConnectionHandle, input: RuntimeInput, lifecycle?: MnemonLifecycle, runtimeMemory?: RuntimeMemoryController, storage?: StorageScopeInspector, packs?: MnemonPackManager, versions?: VersionUpdateManager, managementAuthority?: HostRpcAuthority): void;
|
package/lib/types/settings.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { HostConnectionHandle, HostRpcHandler, HostSettingsService } from './contracts.ts';
|
|
1
|
+
import type { HostConnectionHandle, HostRpcAuthority, HostRpcHandler, HostSettingsService } from './contracts.ts';
|
|
2
2
|
export { MNEMON_SETTINGS_CHANNEL, MNEMON_SETTINGS_NAMESPACE, MNEMON_UI_SETTINGS_NAMESPACE } from './shared/contracts.ts';
|
|
3
3
|
export declare function createSettingsHandler(settings: HostSettingsService): HostRpcHandler;
|
|
4
|
-
export declare function registerSettingsRpc(connection: HostConnectionHandle, settings: HostSettingsService): void;
|
|
4
|
+
export declare function registerSettingsRpc(connection: HostConnectionHandle, settings: HostSettingsService, authority?: HostRpcAuthority): void;
|
|
@@ -81,6 +81,8 @@ export interface Config {
|
|
|
81
81
|
displayMode?: 'sidebar' | 'buildin';
|
|
82
82
|
tabEnabled?: boolean;
|
|
83
83
|
writeEnabled?: boolean;
|
|
84
|
+
/** Remote Web policy for privileged Mnemon RPC. This boundary is sampled at Host startup. */
|
|
85
|
+
remoteAccess?: 'read-only' | 'trusted-host';
|
|
84
86
|
lifecycleEnabled?: boolean;
|
|
85
87
|
recallMode?: 'guided' | 'off';
|
|
86
88
|
writebackMode?: 'guided' | 'off';
|
|
@@ -148,6 +150,7 @@ export interface ResolvedConfig {
|
|
|
148
150
|
displayMode: 'sidebar' | 'buildin';
|
|
149
151
|
tabEnabled: boolean;
|
|
150
152
|
writeEnabled: boolean;
|
|
153
|
+
remoteAccess: 'read-only' | 'trusted-host';
|
|
151
154
|
lifecycleEnabled: boolean;
|
|
152
155
|
recallMode: 'guided' | 'off';
|
|
153
156
|
writebackMode: 'guided' | 'off';
|
package/package.json
CHANGED
|
@@ -1,51 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mnemon",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "Three-tier memory
|
|
3
|
+
"version": "0.2.3",
|
|
4
|
+
"description": "Three-tier memory control plane for DeepSeek Harness: persistent runtime context, searchable project documents, pluggable long-term memory, smart routing, supervised agent workflows, WebUI, and headless tools.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek-harness",
|
|
7
7
|
"deepseek-harness-plugin",
|
|
8
|
-
"dsh",
|
|
9
8
|
"dsh-plugin",
|
|
10
|
-
"mnemon",
|
|
11
|
-
"openviking",
|
|
12
|
-
"honcho",
|
|
13
|
-
"mem0",
|
|
14
|
-
"hindsight",
|
|
15
|
-
"holographic-memory",
|
|
16
|
-
"retaindb",
|
|
17
|
-
"byterover",
|
|
18
|
-
"supermemory",
|
|
19
|
-
"memory-provider",
|
|
20
|
-
"memory-system",
|
|
21
|
-
"memory-plugin",
|
|
22
9
|
"agent-memory",
|
|
23
|
-
"cross-agent-memory",
|
|
24
|
-
"shared-agent-memory",
|
|
25
|
-
"multi-agent-memory",
|
|
26
10
|
"llm-memory",
|
|
27
11
|
"persistent-memory",
|
|
28
12
|
"long-term-memory",
|
|
29
13
|
"runtime-memory",
|
|
30
14
|
"working-memory",
|
|
15
|
+
"cross-session-memory",
|
|
16
|
+
"multi-agent-memory",
|
|
17
|
+
"shared-agent-memory",
|
|
18
|
+
"memory-orchestration",
|
|
19
|
+
"memory-provider",
|
|
20
|
+
"pluggable-memory",
|
|
21
|
+
"context-management",
|
|
31
22
|
"project-memory",
|
|
32
23
|
"project-documents",
|
|
33
24
|
"document-search",
|
|
34
25
|
"semantic-recall",
|
|
35
|
-
"memory-space",
|
|
36
|
-
"workspace-memory",
|
|
37
|
-
"task-agent",
|
|
38
|
-
"knowledge-graph",
|
|
39
|
-
"ai-agent",
|
|
40
|
-
"llm-agent",
|
|
41
|
-
"external-memory",
|
|
42
26
|
"local-first",
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
27
|
+
"mnemon",
|
|
28
|
+
"openviking",
|
|
29
|
+
"honcho",
|
|
30
|
+
"mem0",
|
|
31
|
+
"hindsight",
|
|
32
|
+
"holographic-memory",
|
|
33
|
+
"retaindb",
|
|
34
|
+
"byterover",
|
|
35
|
+
"supermemory"
|
|
49
36
|
],
|
|
50
37
|
"repository": {
|
|
51
38
|
"type": "git",
|