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/index.js
CHANGED
|
@@ -6,11 +6,11 @@ import { homedir, tmpdir } from "node:os";
|
|
|
6
6
|
import { strToU8, unzipSync, zipSync } from "fflate";
|
|
7
7
|
import { spawn } from "node:child_process";
|
|
8
8
|
import { fileURLToPath } from "node:url";
|
|
9
|
-
//#region
|
|
9
|
+
//#region src/config-values.ts
|
|
10
10
|
const DEFAULT_TIMEOUT_MS = 1e4;
|
|
11
11
|
const DEFAULT_IDLE_REVIEW_MS = 3e4;
|
|
12
12
|
//#endregion
|
|
13
|
-
//#region
|
|
13
|
+
//#region src/config.ts
|
|
14
14
|
const InteractionConfig = z.object({
|
|
15
15
|
turnBar: z.boolean().default(true),
|
|
16
16
|
saveAction: z.boolean().default(true)
|
|
@@ -132,7 +132,7 @@ function resolveConfig(config = {}) {
|
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
134
|
//#endregion
|
|
135
|
-
//#region
|
|
135
|
+
//#region src/commands.ts
|
|
136
136
|
function isAgentServiceSource(value) {
|
|
137
137
|
return "forAgent" in value && typeof value.forAgent === "function";
|
|
138
138
|
}
|
|
@@ -185,7 +185,8 @@ async function execute(serviceOrSource, coordinator, invocation) {
|
|
|
185
185
|
return {
|
|
186
186
|
kind: "success",
|
|
187
187
|
text: [
|
|
188
|
-
`Mnemon ${status.version ?? ""} ·
|
|
188
|
+
`Mnemon ${status.version ?? ""} · default=${status.mnemonDefaultStore}`.trim(),
|
|
189
|
+
`DSH 已激活: ${status.dshActiveStores.join(", ") || "none"}`,
|
|
189
190
|
`CLI: ${status.cliPath}`,
|
|
190
191
|
`数据目录: ${status.dataDir}`,
|
|
191
192
|
`有效记忆: ${stats?.totalInsights ?? 0} · 连接: ${stats?.edgeCount ?? 0} · 已删除: ${stats?.deletedInsights ?? 0}`,
|
|
@@ -783,7 +784,7 @@ var DocumentManager = class {
|
|
|
783
784
|
}
|
|
784
785
|
};
|
|
785
786
|
//#endregion
|
|
786
|
-
//#region
|
|
787
|
+
//#region src/guidance.ts
|
|
787
788
|
const GUIDANCE_SECTION_NAME = "mnemon:routing";
|
|
788
789
|
const RUNTIME_MEMORY_SECTION_NAME = "mnemon:runtime-memory";
|
|
789
790
|
const ROUTING_GUIDANCE = "Use memory only by need. For substantial project records, search active Mnemon Documents before deep recall. Call mnemon_recall when durable history may matter or an exact prior detail is missing; never infer a missing historical rule. New explicit reusable facts normally go to mnemon_runtime_memory. A write completes only with a tool receipt.";
|
|
@@ -1249,7 +1250,7 @@ IMPORTANT: USER.md and MEMORY.md above are always relevant when applicable. Foll
|
|
|
1249
1250
|
}
|
|
1250
1251
|
};
|
|
1251
1252
|
//#endregion
|
|
1252
|
-
//#region
|
|
1253
|
+
//#region src/pack.ts
|
|
1253
1254
|
const MNEMON_PACK_FORMAT = "mnemonpack";
|
|
1254
1255
|
const MNEMON_PACK_MIME = "application/zip";
|
|
1255
1256
|
const MAX_FILE_BYTES = 134217728;
|
|
@@ -1807,6 +1808,27 @@ function mergeRegistry(root, pack) {
|
|
|
1807
1808
|
}
|
|
1808
1809
|
return current;
|
|
1809
1810
|
}
|
|
1811
|
+
function persistedStore(root) {
|
|
1812
|
+
try {
|
|
1813
|
+
const value = readFileSync(join(root, "active"), "utf8").trim();
|
|
1814
|
+
if (BODY_ID.test(value)) return value;
|
|
1815
|
+
} catch {}
|
|
1816
|
+
return "default";
|
|
1817
|
+
}
|
|
1818
|
+
function reconcilePersistedStore(root) {
|
|
1819
|
+
const current = readCurrentRegistry(root).registry.bodies;
|
|
1820
|
+
const ids = new Set(current.map((body) => body.id));
|
|
1821
|
+
const selected = persistedStore(root);
|
|
1822
|
+
if (ids.has(selected)) return;
|
|
1823
|
+
const replacement = ids.has("default") ? "default" : current.filter((body) => body.active).map((body) => body.id).sort()[0] ?? [...ids].sort()[0] ?? "default";
|
|
1824
|
+
const temporary = join(root, `.active-${process.pid}-${randomUUID()}.tmp`);
|
|
1825
|
+
try {
|
|
1826
|
+
writeFileSync(temporary, `${replacement}\n`, { mode: 384 });
|
|
1827
|
+
renameSync(temporary, join(root, "active"));
|
|
1828
|
+
} finally {
|
|
1829
|
+
rmSync(temporary, { force: true });
|
|
1830
|
+
}
|
|
1831
|
+
}
|
|
1810
1832
|
function stageImport(root, pack, components, mode) {
|
|
1811
1833
|
const staging = join(root, `.dsh-pack-stage-${randomUUID()}`);
|
|
1812
1834
|
mkdirSync(staging, {
|
|
@@ -1824,6 +1846,7 @@ function stageImport(root, pack, components, mode) {
|
|
|
1824
1846
|
}
|
|
1825
1847
|
if (components.includes("memory-spaces")) {
|
|
1826
1848
|
const memory = mode === "merge" ? mergeRegistry(root, pack) : archiveRegistry(pack);
|
|
1849
|
+
if (mode === "replace" && readCurrentRegistry(root).registry.bodies.length > 0 && memory.registry.bodies.length === 0) throw new Error("cannot replace the last Mnemon Store with an empty Memory Space set");
|
|
1827
1850
|
writeRegistry(join(staging, "data"), memory.registry, memory.databases);
|
|
1828
1851
|
}
|
|
1829
1852
|
return staging;
|
|
@@ -1843,6 +1866,8 @@ function commitStaging(root, staging, components) {
|
|
|
1843
1866
|
});
|
|
1844
1867
|
const committed = [];
|
|
1845
1868
|
const replacementLocks = components.flatMap((component) => component === "runtime" ? [join(staging, "runtime", ".memories.lock")] : component === "documents" ? [join(staging, "documents", ".index.lock")] : []);
|
|
1869
|
+
const activePath = join(root, "active");
|
|
1870
|
+
const previousActive = existsSync(activePath) ? readFileSync(activePath) : void 0;
|
|
1846
1871
|
try {
|
|
1847
1872
|
for (const lock of replacementLocks) writeFileSync(lock, "pack-import\n", { mode: 384 });
|
|
1848
1873
|
for (const component of components) {
|
|
@@ -1862,6 +1887,7 @@ function commitStaging(root, staging, components) {
|
|
|
1862
1887
|
hadPrevious
|
|
1863
1888
|
});
|
|
1864
1889
|
}
|
|
1890
|
+
if (components.includes("memory-spaces")) reconcilePersistedStore(root);
|
|
1865
1891
|
if (components.includes("runtime")) rmSync(join(root, "runtime", ".memories.lock"), { force: true });
|
|
1866
1892
|
if (components.includes("documents")) rmSync(join(root, "documents", ".index.lock"), { force: true });
|
|
1867
1893
|
} catch (error) {
|
|
@@ -1873,6 +1899,10 @@ function commitStaging(root, staging, components) {
|
|
|
1873
1899
|
});
|
|
1874
1900
|
if (entry.hadPrevious) renameSync(join(backup, entry.directory), target);
|
|
1875
1901
|
}
|
|
1902
|
+
if (components.includes("memory-spaces")) {
|
|
1903
|
+
if (previousActive === void 0) rmSync(activePath, { force: true });
|
|
1904
|
+
else writeFileSync(activePath, previousActive, { mode: 384 });
|
|
1905
|
+
}
|
|
1876
1906
|
throw error;
|
|
1877
1907
|
} finally {
|
|
1878
1908
|
rmSync(staging, {
|
|
@@ -2005,7 +2035,7 @@ var MnemonPackManager = class {
|
|
|
2005
2035
|
}
|
|
2006
2036
|
};
|
|
2007
2037
|
//#endregion
|
|
2008
|
-
//#region
|
|
2038
|
+
//#region src/process.ts
|
|
2009
2039
|
const DEFAULT_MAX_OUTPUT_BYTES = 2097152;
|
|
2010
2040
|
/** Spawn without a shell, with bounded output and cooperative cancellation. */
|
|
2011
2041
|
const runProcess = (command, args, options) => new Promise((resolve, reject) => {
|
|
@@ -2078,7 +2108,7 @@ const runProcess = (command, args, options) => new Promise((resolve, reject) =>
|
|
|
2078
2108
|
else options.signal?.addEventListener("abort", abort, { once: true });
|
|
2079
2109
|
});
|
|
2080
2110
|
//#endregion
|
|
2081
|
-
//#region
|
|
2111
|
+
//#region src/runner.ts
|
|
2082
2112
|
const UNIX_COMMON_CLI_PATHS = [
|
|
2083
2113
|
"~/.local/bin/mnemon",
|
|
2084
2114
|
"/opt/homebrew/bin/mnemon",
|
|
@@ -2170,6 +2200,14 @@ function createRunner(config, processRunner = runProcess, workspaceRoot) {
|
|
|
2170
2200
|
if (config.storageScope === "custom") return expandHome$1(config.dataDir);
|
|
2171
2201
|
return expandHome$1(process.env.MNEMON_DATA_DIR?.trim() || "~/.mnemon");
|
|
2172
2202
|
};
|
|
2203
|
+
const persistedStore = () => {
|
|
2204
|
+
const active = join(effectiveDataDir(), "active");
|
|
2205
|
+
if (existsSync(active)) try {
|
|
2206
|
+
const value = readFileSync(active, "utf8").trim();
|
|
2207
|
+
if (/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/.test(value)) return value;
|
|
2208
|
+
} catch {}
|
|
2209
|
+
return "default";
|
|
2210
|
+
};
|
|
2173
2211
|
const launch = async (args, options = {}) => {
|
|
2174
2212
|
if (options.signal?.aborted === true) throw new MnemonCliError(`mnemon command aborted: ${String(options.signal.reason ?? "cancelled")}`);
|
|
2175
2213
|
const argv = options.globalFlags === false ? [...args] : [...globalArgs(options.store), ...args];
|
|
@@ -2207,6 +2245,15 @@ function createRunner(config, processRunner = runProcess, workspaceRoot) {
|
|
|
2207
2245
|
}
|
|
2208
2246
|
},
|
|
2209
2247
|
runText: execute,
|
|
2248
|
+
runTextBatch(commands) {
|
|
2249
|
+
const result = processQueue.then(async () => {
|
|
2250
|
+
const outputs = [];
|
|
2251
|
+
for (const command of commands) outputs.push(await launch(command.args, command.options));
|
|
2252
|
+
return outputs;
|
|
2253
|
+
});
|
|
2254
|
+
processQueue = result.then(() => void 0, () => void 0);
|
|
2255
|
+
return result;
|
|
2256
|
+
},
|
|
2210
2257
|
withExclusive(operation) {
|
|
2211
2258
|
const result = processQueue.then(operation);
|
|
2212
2259
|
processQueue = result.then(() => void 0, () => void 0);
|
|
@@ -2215,21 +2262,19 @@ function createRunner(config, processRunner = runProcess, workspaceRoot) {
|
|
|
2215
2262
|
effectiveDataDir() {
|
|
2216
2263
|
return effectiveDataDir();
|
|
2217
2264
|
},
|
|
2265
|
+
persistedStore() {
|
|
2266
|
+
return persistedStore();
|
|
2267
|
+
},
|
|
2218
2268
|
effectiveStore() {
|
|
2219
2269
|
if (config.store !== void 0) return config.store;
|
|
2220
2270
|
const fromEnvironment = process.env.MNEMON_STORE?.trim();
|
|
2221
2271
|
if (fromEnvironment !== void 0 && fromEnvironment !== "") return fromEnvironment;
|
|
2222
|
-
|
|
2223
|
-
if (existsSync(active)) try {
|
|
2224
|
-
const value = readFileSync(active, "utf8").trim();
|
|
2225
|
-
if (value !== "") return value;
|
|
2226
|
-
} catch {}
|
|
2227
|
-
return "default";
|
|
2272
|
+
return persistedStore();
|
|
2228
2273
|
}
|
|
2229
2274
|
};
|
|
2230
2275
|
}
|
|
2231
2276
|
//#endregion
|
|
2232
|
-
//#region
|
|
2277
|
+
//#region src/memory-bodies.ts
|
|
2233
2278
|
const REGISTRY_VERSION = 1;
|
|
2234
2279
|
const ID_PATTERN = /^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;
|
|
2235
2280
|
function requiredText(value, label, max) {
|
|
@@ -2285,8 +2330,10 @@ var MemoryBodyRegistry = class {
|
|
|
2285
2330
|
async create(request, signal) {
|
|
2286
2331
|
const name = requiredText(request.name, "name", 100);
|
|
2287
2332
|
const description = requiredText(request.description, "description", 1e3);
|
|
2288
|
-
|
|
2289
|
-
|
|
2333
|
+
const reservedIds = new Set(this.list().map((body) => body.id));
|
|
2334
|
+
const nativeStoreIds = this.nativeStoreIds();
|
|
2335
|
+
let id = nativeStoreIds.length === 0 && !reservedIds.has("default") ? "default" : validateMemoryBodyId(randomUUID());
|
|
2336
|
+
while (reservedIds.has(id) || nativeStoreIds.includes(id)) id = validateMemoryBodyId(randomUUID());
|
|
2290
2337
|
await this.runner.runText([
|
|
2291
2338
|
"store",
|
|
2292
2339
|
"create",
|
|
@@ -2325,14 +2372,40 @@ var MemoryBodyRegistry = class {
|
|
|
2325
2372
|
}
|
|
2326
2373
|
async remove(id, signal) {
|
|
2327
2374
|
const body = this.get(id);
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2375
|
+
const nativeStoreIds = this.nativeStoreIds();
|
|
2376
|
+
if (nativeStoreIds.includes(body.id) && nativeStoreIds.length === 1) throw new Error(`cannot delete the last Mnemon Store "${body.id}"; disable it for DSH or create another Memory Space first`);
|
|
2377
|
+
const persistedStore = this.runner.persistedStore();
|
|
2378
|
+
const commands = [];
|
|
2379
|
+
let commandStore = persistedStore;
|
|
2380
|
+
if (persistedStore === body.id) {
|
|
2381
|
+
const nativeIds = new Set(nativeStoreIds);
|
|
2382
|
+
const replacement = this.list().filter((candidate) => candidate.id !== body.id && nativeIds.has(candidate.id)).sort((left, right) => Number(right.active) - Number(left.active) || left.id.localeCompare(right.id))[0]?.id ?? nativeStoreIds.filter((candidate) => candidate !== body.id).sort()[0];
|
|
2383
|
+
if (replacement === void 0) throw new Error(`cannot switch away from Mnemon Store "${body.id}" before deleting it`);
|
|
2384
|
+
commandStore = replacement;
|
|
2385
|
+
commands.push({
|
|
2386
|
+
args: [
|
|
2387
|
+
"store",
|
|
2388
|
+
"set",
|
|
2389
|
+
replacement
|
|
2390
|
+
],
|
|
2391
|
+
options: {
|
|
2392
|
+
...signal === void 0 ? {} : { signal },
|
|
2393
|
+
store: replacement
|
|
2394
|
+
}
|
|
2395
|
+
});
|
|
2396
|
+
}
|
|
2397
|
+
commands.push({
|
|
2398
|
+
args: [
|
|
2399
|
+
"store",
|
|
2400
|
+
"remove",
|
|
2401
|
+
body.id
|
|
2402
|
+
],
|
|
2403
|
+
options: {
|
|
2404
|
+
...signal === void 0 ? {} : { signal },
|
|
2405
|
+
store: commandStore
|
|
2406
|
+
}
|
|
2335
2407
|
});
|
|
2408
|
+
await this.runner.runTextBatch(commands);
|
|
2336
2409
|
this.bodies = this.bodies.filter((entry) => entry.id !== body.id);
|
|
2337
2410
|
this.save();
|
|
2338
2411
|
return body;
|
|
@@ -2387,6 +2460,10 @@ var MemoryBodyRegistry = class {
|
|
|
2387
2460
|
}
|
|
2388
2461
|
if (changed) this.save();
|
|
2389
2462
|
}
|
|
2463
|
+
nativeStoreIds() {
|
|
2464
|
+
if (!existsSync(this.directory)) return [];
|
|
2465
|
+
return readdirSync(this.directory, { withFileTypes: true }).filter((entry) => entry.isDirectory() && ID_PATTERN.test(entry.name)).map((entry) => entry.name).sort();
|
|
2466
|
+
}
|
|
2390
2467
|
view(body) {
|
|
2391
2468
|
return {
|
|
2392
2469
|
...body,
|
|
@@ -2409,7 +2486,12 @@ var MemoryBodyRegistry = class {
|
|
|
2409
2486
|
}
|
|
2410
2487
|
};
|
|
2411
2488
|
//#endregion
|
|
2412
|
-
//#region
|
|
2489
|
+
//#region src/shared/contracts.ts
|
|
2490
|
+
const MNEMON_READ_CHANNEL = "/dsh-mnemon-read";
|
|
2491
|
+
const MNEMON_WRITE_CHANNEL = "/dsh-mnemon-write";
|
|
2492
|
+
const MNEMON_PACK_CHANNEL = "/dsh-mnemon-pack";
|
|
2493
|
+
const MNEMON_SETTINGS_CHANNEL = "/dsh-mnemon-settings";
|
|
2494
|
+
const MNEMON_SETTINGS_NAMESPACE = "mnemon";
|
|
2413
2495
|
const CATEGORIES = [
|
|
2414
2496
|
"preference",
|
|
2415
2497
|
"decision",
|
|
@@ -2435,6 +2517,8 @@ const INTENTS = [
|
|
|
2435
2517
|
"ENTITY",
|
|
2436
2518
|
"GENERAL"
|
|
2437
2519
|
];
|
|
2520
|
+
//#endregion
|
|
2521
|
+
//#region src/service.ts
|
|
2438
2522
|
function record$1(value) {
|
|
2439
2523
|
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
2440
2524
|
}
|
|
@@ -2563,7 +2647,8 @@ var MnemonService = class {
|
|
|
2563
2647
|
}
|
|
2564
2648
|
async bodies(signal) {
|
|
2565
2649
|
const items = [];
|
|
2566
|
-
|
|
2650
|
+
const mnemonDefaultStore = this.runner.persistedStore();
|
|
2651
|
+
for (const body of this.memoryBodies.list()) items.push(await this.bodyStatus(body, body.id === mnemonDefaultStore, signal));
|
|
2567
2652
|
return {
|
|
2568
2653
|
items,
|
|
2569
2654
|
total: items.length,
|
|
@@ -2575,11 +2660,14 @@ var MnemonService = class {
|
|
|
2575
2660
|
async status(signal) {
|
|
2576
2661
|
const catalog = await this.bodies(signal);
|
|
2577
2662
|
const active = catalog.items.filter((body) => body.active);
|
|
2663
|
+
const dshActiveStores = active.map((body) => body.id);
|
|
2578
2664
|
const base = {
|
|
2579
2665
|
cliPath: this.runner.command,
|
|
2580
2666
|
commandFound: this.runner.commandFound,
|
|
2581
2667
|
dataDir: this.runner.effectiveDataDir(),
|
|
2582
|
-
store:
|
|
2668
|
+
store: dshActiveStores.join(", ") || "none",
|
|
2669
|
+
mnemonDefaultStore: this.runner.persistedStore(),
|
|
2670
|
+
dshActiveStores,
|
|
2583
2671
|
writeEnabled: this.config.writeEnabled,
|
|
2584
2672
|
timeoutMs: this.config.timeoutMs,
|
|
2585
2673
|
defaultRecallLimit: this.config.defaultRecallLimit,
|
|
@@ -2899,7 +2987,7 @@ var MnemonService = class {
|
|
|
2899
2987
|
});
|
|
2900
2988
|
}
|
|
2901
2989
|
}
|
|
2902
|
-
async bodyStatus(body, signal) {
|
|
2990
|
+
async bodyStatus(body, mnemonDefault, signal) {
|
|
2903
2991
|
try {
|
|
2904
2992
|
const status = record$1(await this.runner.runJson(["status"], {
|
|
2905
2993
|
...signal === void 0 ? {} : { signal },
|
|
@@ -2908,12 +2996,14 @@ var MnemonService = class {
|
|
|
2908
2996
|
if (status === void 0) throw new Error("mnemon status returned an unexpected payload");
|
|
2909
2997
|
return {
|
|
2910
2998
|
...body,
|
|
2999
|
+
mnemonDefault,
|
|
2911
3000
|
healthy: true,
|
|
2912
3001
|
stats: this.parseStats(status)
|
|
2913
3002
|
};
|
|
2914
3003
|
} catch (error) {
|
|
2915
3004
|
return {
|
|
2916
3005
|
...body,
|
|
3006
|
+
mnemonDefault,
|
|
2917
3007
|
healthy: false,
|
|
2918
3008
|
error: error instanceof Error ? error.message : String(error)
|
|
2919
3009
|
};
|
|
@@ -3031,7 +3121,7 @@ var MnemonService = class {
|
|
|
3031
3121
|
}
|
|
3032
3122
|
};
|
|
3033
3123
|
//#endregion
|
|
3034
|
-
//#region
|
|
3124
|
+
//#region src/storage-scope.ts
|
|
3035
3125
|
function expandHome(path) {
|
|
3036
3126
|
if (path === "~") return homedir();
|
|
3037
3127
|
return path.startsWith("~/") ? join(homedir(), path.slice(2)) : path;
|
|
@@ -3269,7 +3359,7 @@ var StorageScopeInspector = class {
|
|
|
3269
3359
|
}
|
|
3270
3360
|
};
|
|
3271
3361
|
//#endregion
|
|
3272
|
-
//#region
|
|
3362
|
+
//#region src/live-runtime.ts
|
|
3273
3363
|
/**
|
|
3274
3364
|
* Build a complete generation before it can become visible. Constructors also
|
|
3275
3365
|
* validate and initialize the selected storage root, so a failed candidate is
|
|
@@ -3407,7 +3497,7 @@ var LiveMnemonRuntime = class {
|
|
|
3407
3497
|
}
|
|
3408
3498
|
};
|
|
3409
3499
|
//#endregion
|
|
3410
|
-
//#region
|
|
3500
|
+
//#region src/subagent.ts
|
|
3411
3501
|
function isAgentRuntimeSource$1(value) {
|
|
3412
3502
|
return typeof value === "object" && value !== null && "forAgent" in value && typeof value.forAgent === "function";
|
|
3413
3503
|
}
|
|
@@ -4166,7 +4256,7 @@ ${indentedText(request.content ?? "")}`;
|
|
|
4166
4256
|
}
|
|
4167
4257
|
};
|
|
4168
4258
|
//#endregion
|
|
4169
|
-
//#region
|
|
4259
|
+
//#region src/review-activity.ts
|
|
4170
4260
|
/**
|
|
4171
4261
|
* QoderWork 0.9.12's deterministic post-turn review gate.
|
|
4172
4262
|
*
|
|
@@ -4202,7 +4292,7 @@ function scoreReviewActivity(activity) {
|
|
|
4202
4292
|
};
|
|
4203
4293
|
}
|
|
4204
4294
|
//#endregion
|
|
4205
|
-
//#region
|
|
4295
|
+
//#region src/activity.ts
|
|
4206
4296
|
const RECALL_TOOLS = /* @__PURE__ */ new Set(["mnemon_recall", "mnemon_related"]);
|
|
4207
4297
|
const INSPECTION_TOOLS = /* @__PURE__ */ new Set(["mnemon_status", "mnemon_memory_bodies"]);
|
|
4208
4298
|
const WRITE_TOOLS = /* @__PURE__ */ new Set([
|
|
@@ -4298,7 +4388,7 @@ var TurnActivityProjection = class {
|
|
|
4298
4388
|
}
|
|
4299
4389
|
};
|
|
4300
4390
|
//#endregion
|
|
4301
|
-
//#region
|
|
4391
|
+
//#region src/lifecycle.ts
|
|
4302
4392
|
const MNEMON_PLUGIN_SOURCE = "dsh-mnemon";
|
|
4303
4393
|
function createPluginMessage(text, form, summary) {
|
|
4304
4394
|
return structuredClone({
|
|
@@ -4722,7 +4812,7 @@ var MnemonLifecycle = class {
|
|
|
4722
4812
|
}
|
|
4723
4813
|
};
|
|
4724
4814
|
//#endregion
|
|
4725
|
-
//#region
|
|
4815
|
+
//#region src/version-updates.ts
|
|
4726
4816
|
const DSH_MNEMON_PACKAGE = "dsh-mnemon";
|
|
4727
4817
|
const MNEMON_MODULE = "github.com/mnemon-dev/mnemon";
|
|
4728
4818
|
const PACKAGE_MANIFEST_PATH = fileURLToPath(new URL("../package.json", import.meta.url));
|
|
@@ -5116,12 +5206,7 @@ var VersionUpdateManager = class {
|
|
|
5116
5206
|
}
|
|
5117
5207
|
};
|
|
5118
5208
|
//#endregion
|
|
5119
|
-
//#region
|
|
5120
|
-
const MNEMON_READ_CHANNEL = "/dsh-mnemon-read";
|
|
5121
|
-
const MNEMON_WRITE_CHANNEL = "/dsh-mnemon-write";
|
|
5122
|
-
const MNEMON_PACK_CHANNEL = "/dsh-mnemon-pack";
|
|
5123
|
-
//#endregion
|
|
5124
|
-
//#region lib/types/rpc.js
|
|
5209
|
+
//#region src/rpc.ts
|
|
5125
5210
|
function isRoutedRuntime(value) {
|
|
5126
5211
|
return "route" in value && typeof value.route === "function";
|
|
5127
5212
|
}
|
|
@@ -5449,9 +5534,7 @@ function findVersionCli(input) {
|
|
|
5449
5534
|
return input.config.cliPath;
|
|
5450
5535
|
}
|
|
5451
5536
|
//#endregion
|
|
5452
|
-
//#region
|
|
5453
|
-
const MNEMON_SETTINGS_CHANNEL = "/dsh-mnemon-settings";
|
|
5454
|
-
const MNEMON_SETTINGS_NAMESPACE = "mnemon";
|
|
5537
|
+
//#region src/settings.ts
|
|
5455
5538
|
function success(value) {
|
|
5456
5539
|
return {
|
|
5457
5540
|
ok: true,
|
|
@@ -5565,7 +5648,7 @@ function registerSettingsRpc(connection, settings) {
|
|
|
5565
5648
|
connection.rpc.handle(MNEMON_SETTINGS_CHANNEL, createSettingsHandler(settings), { authority: "loopback" });
|
|
5566
5649
|
}
|
|
5567
5650
|
//#endregion
|
|
5568
|
-
//#region
|
|
5651
|
+
//#region src/tools.ts
|
|
5569
5652
|
const text = (value) => [{
|
|
5570
5653
|
type: "text",
|
|
5571
5654
|
text: typeof value === "string" ? value : JSON.stringify(value, null, 2)
|
|
@@ -6186,7 +6269,7 @@ function registerTools(ctx, serviceOrSource, coordinator, runtimeMemory, documen
|
|
|
6186
6269
|
}));
|
|
6187
6270
|
}
|
|
6188
6271
|
//#endregion
|
|
6189
|
-
//#region
|
|
6272
|
+
//#region src/index.ts
|
|
6190
6273
|
const name = "dsh-mnemon";
|
|
6191
6274
|
const inject = [
|
|
6192
6275
|
"tools",
|
package/lib/types/activity.d.ts
CHANGED
|
@@ -1,21 +1,6 @@
|
|
|
1
1
|
import type { HostSessionEvent } from './contracts.ts';
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
turn: number;
|
|
5
|
-
/** Successful and failed settled Mnemon calls. Running calls are excluded. */
|
|
6
|
-
count: number;
|
|
7
|
-
names: string[];
|
|
8
|
-
recalls: number;
|
|
9
|
-
writes: number;
|
|
10
|
-
documentSearches: number;
|
|
11
|
-
inspections: number;
|
|
12
|
-
failures: number;
|
|
13
|
-
}
|
|
14
|
-
export interface TurnMemoryActivitySnapshot {
|
|
15
|
-
/** Last durable event represented by this snapshot. */
|
|
16
|
-
cursor: number;
|
|
17
|
-
activities: TurnMemoryActivity[];
|
|
18
|
-
}
|
|
2
|
+
import type { TurnMemoryActivitySnapshot } from './shared/contracts.ts';
|
|
3
|
+
export type { TurnMemoryActivity, TurnMemoryActivitySnapshot } from './shared/contracts.ts';
|
|
19
4
|
/**
|
|
20
5
|
* Incremental durable-log projection. Repeated UI reads process only events
|
|
21
6
|
* appended since the previous snapshot instead of rescanning the full session.
|
|
@@ -29,4 +14,3 @@ export declare class TurnActivityProjection {
|
|
|
29
14
|
snapshot(events: readonly HostSessionEvent[]): TurnMemoryActivitySnapshot;
|
|
30
15
|
private consume;
|
|
31
16
|
}
|
|
32
|
-
//# sourceMappingURL=activity.d.ts.map
|
package/lib/types/channels.d.ts
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export declare const MNEMON_WRITE_CHANNEL = "/dsh-mnemon-write";
|
|
3
|
-
export declare const MNEMON_PACK_CHANNEL = "/dsh-mnemon-pack";
|
|
4
|
-
//# sourceMappingURL=channels.d.ts.map
|
|
1
|
+
export { MNEMON_PACK_CHANNEL, MNEMON_READ_CHANNEL, MNEMON_WRITE_CHANNEL } from './shared/contracts.ts';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type JSX } from 'react';
|
|
2
|
-
import type { ClientConnectionHandle } from '../contracts.ts';
|
|
2
|
+
import type { ClientConnectionHandle } from '../shared/contracts.ts';
|
|
3
3
|
import type { MnemonTranslate } from './locales.ts';
|
|
4
4
|
interface MnemonPackSectionProps {
|
|
5
5
|
connection?: ClientConnectionHandle;
|
|
@@ -8,4 +8,3 @@ interface MnemonPackSectionProps {
|
|
|
8
8
|
}
|
|
9
9
|
export declare function MnemonPackSection({ connection, refreshKey, t }: MnemonPackSectionProps): JSX.Element;
|
|
10
10
|
export {};
|
|
11
|
-
//# sourceMappingURL=MnemonPackSection.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ClientConnectionHandle } from '../contracts.ts';
|
|
1
|
+
import type { ClientConnectionHandle } from '../shared/contracts.ts';
|
|
2
2
|
import type { MnemonKey } from './locales.ts';
|
|
3
3
|
export interface MnemonSaveActionProps {
|
|
4
4
|
/** Stable identity of the finalized assistant message this action addresses. */
|
|
@@ -10,4 +10,3 @@ export interface MnemonSaveActionProps {
|
|
|
10
10
|
}
|
|
11
11
|
/** Save-to-memory action on finalized assistant messages, routed through the supervised writeback gate. */
|
|
12
12
|
export declare const MnemonSaveAction: import("react").NamedExoticComponent<MnemonSaveActionProps>;
|
|
13
|
-
//# sourceMappingURL=MnemonSaveAction.d.ts.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type JSX } from 'react';
|
|
2
|
-
import type { Config, InteractionConfig } from '../
|
|
3
|
-
import type { ClientConnectionHandle, ClientSettingsScope } from '../contracts.ts';
|
|
2
|
+
import type { ClientConnectionHandle, ClientSettingsScope, Config, InteractionConfig } from '../shared/contracts.ts';
|
|
4
3
|
import { type MnemonTranslate } from './locales.ts';
|
|
5
4
|
export interface MnemonSettingsCardProps {
|
|
6
5
|
scope: ClientSettingsScope<Config>;
|
|
@@ -12,4 +11,3 @@ export interface MnemonSettingsCardProps {
|
|
|
12
11
|
}
|
|
13
12
|
/** Dedicated Mnemon page contributed directly to DSH's settings navigation. */
|
|
14
13
|
export declare function MnemonSettingsCard({ scope, interactionScope: suppliedInteractionScope, connection, t }: MnemonSettingsCardProps): JSX.Element | null;
|
|
15
|
-
//# sourceMappingURL=MnemonSettingsCard.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ClientConnectionHandle } from '../contracts.ts';
|
|
1
|
+
import type { ClientConnectionHandle } from '../shared/contracts.ts';
|
|
2
2
|
import type { TurnTailOwnerProps } from '@deepseek-ai/dsh-client-ui-conversation/client';
|
|
3
3
|
import { type MnemonAnchorPage } from './anchor.ts';
|
|
4
4
|
import type { MnemonKey } from './locales.ts';
|
|
@@ -18,4 +18,3 @@ export declare function memoryPageForTool(name: string): MnemonAnchorPage;
|
|
|
18
18
|
export declare function selectMnemonTurnTail(owner: TurnTailOwnerProps): Record<string, never> | null;
|
|
19
19
|
/** One-line memory-activity bar under a completed turn; hides when the turn touched no memory. */
|
|
20
20
|
export declare const MnemonTurnTail: import("react").NamedExoticComponent<MnemonTurnTailProps>;
|
|
21
|
-
//# sourceMappingURL=MnemonTurnTail.d.ts.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type { Config } from '../config.ts';
|
|
1
|
+
import { type ClientConnectionHandle, type ClientSettingsScope, type Config } from '../shared/contracts.ts';
|
|
3
2
|
import { type MnemonTranslate } from './locales.ts';
|
|
4
3
|
import { type MnemonViewSurface } from './MnemonViewAppearance.tsx';
|
|
5
4
|
export interface MnemonViewProps {
|
|
@@ -25,4 +24,3 @@ export interface MnemonWorkspaceSelection {
|
|
|
25
24
|
onAlign(): void;
|
|
26
25
|
}
|
|
27
26
|
export declare function MnemonView(props: MnemonViewProps): JSX.Element;
|
|
28
|
-
//# sourceMappingURL=MnemonView.d.ts.map
|
|
@@ -18,4 +18,3 @@ export declare const MnemonViewAppearanceProvider: import("react").Provider<Mnem
|
|
|
18
18
|
export declare function useMnemonViewAppearance(): MnemonViewAppearance;
|
|
19
19
|
export declare function appearanceClass(base: string | undefined, variant: string | undefined): string;
|
|
20
20
|
export {};
|
|
21
|
-
//# sourceMappingURL=MnemonViewAppearance.d.ts.map
|
|
@@ -25,4 +25,3 @@ export declare function dispatchMnemonAnchor(anchor: MnemonAnchor): void;
|
|
|
25
25
|
export declare function consumeMnemonAnchor(sessionId?: string): MnemonAnchor | null;
|
|
26
26
|
/** Subscribe to anchors addressed to this session; returns an unsubscribe. */
|
|
27
27
|
export declare function subscribeMnemonAnchor(sessionId: string | undefined, onAnchor: (anchor: MnemonAnchor) => void): () => void;
|
|
28
|
-
//# sourceMappingURL=anchor.d.ts.map
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type { MemoryBody } from '../memory-bodies.ts';
|
|
3
|
-
import type { DocumentMutation, DocumentMutationResult, DocumentSearchResult, DocumentSnapshot, DocumentView } from '../documents.ts';
|
|
4
|
-
import type { RuntimeMemoryImportance, RuntimeMemoryMutationResult, RuntimeMemorySnapshot, RuntimeMemoryTarget } from '../runtime-memory.ts';
|
|
5
|
-
import type { EntityView, Insight, MemoryBodyCatalog, MemoryGraphSnapshot, MemoryListRequest, MemoryListView, RememberRequest, SearchRequest, StatusView } from '../service.ts';
|
|
6
|
-
import type { AssistantMessageText, TurnMemoryActivity } from '../lifecycle.ts';
|
|
7
|
-
import type { MnemonPackExport, MnemonPackImportResult, MnemonPackPreview } from '../pack.ts';
|
|
8
|
-
import type { VersionComponentId, VersionStatus, VersionUpdateResult } from '../version-updates.ts';
|
|
1
|
+
import { type AssistantMessageText, type ClientConnectionHandle, type DocumentMutation, type DocumentMutationResult, type DocumentSearchResult, type DocumentSnapshot, type DocumentView, type EntityView, type Insight, type MemoryBody, type MemoryBodyCatalog, type MemoryGraphSnapshot, type MemoryListRequest, type MemoryListView, type MnemonPackExport, type MnemonPackImportResult, type MnemonPackPreview, type RememberRequest, type RuntimeMemoryImportance, type RuntimeMemoryMutationResult, type RuntimeMemorySnapshot, type RuntimeMemoryTarget, type SearchRequest, type StatusView, type TurnMemoryActivity, type VersionComponentId, type VersionStatus, type VersionUpdateResult } from '../shared/contracts.ts';
|
|
9
2
|
export interface SearchResponse {
|
|
10
3
|
query: string;
|
|
11
4
|
mode: string;
|
|
@@ -84,4 +77,3 @@ export declare class MnemonClient {
|
|
|
84
77
|
inspectPack(base64: string, fileName?: string): Promise<MnemonPackPreview>;
|
|
85
78
|
importPack(base64: string): Promise<MnemonPackImportResult>;
|
|
86
79
|
}
|
|
87
|
-
//# sourceMappingURL=api.d.ts.map
|
|
@@ -87,6 +87,7 @@ export declare const zh: {
|
|
|
87
87
|
'overview.directory.unsyncedBadge': string;
|
|
88
88
|
'overview.storageHealthy': string;
|
|
89
89
|
'overview.storageUnhealthy': string;
|
|
90
|
+
'overview.mnemonDefault': string;
|
|
90
91
|
'overview.toggleAria': string;
|
|
91
92
|
'overview.toggling': string;
|
|
92
93
|
'overview.noDescription': string;
|
|
@@ -118,6 +119,7 @@ export declare const zh: {
|
|
|
118
119
|
'overview.deleteBodyAria': string;
|
|
119
120
|
'overview.deleteTitle': string;
|
|
120
121
|
'overview.deleteWarning': string;
|
|
122
|
+
'overview.lastStoreDeleteHint': string;
|
|
121
123
|
'overview.deleteAction': string;
|
|
122
124
|
'overview.deletingBody': string;
|
|
123
125
|
'overview.snapshot': string;
|
|
@@ -667,6 +669,7 @@ export declare const en: {
|
|
|
667
669
|
'overview.directory.unsyncedBadge': string;
|
|
668
670
|
'overview.storageHealthy': string;
|
|
669
671
|
'overview.storageUnhealthy': string;
|
|
672
|
+
'overview.mnemonDefault': string;
|
|
670
673
|
'overview.toggleAria': string;
|
|
671
674
|
'overview.toggling': string;
|
|
672
675
|
'overview.noDescription': string;
|
|
@@ -698,6 +701,7 @@ export declare const en: {
|
|
|
698
701
|
'overview.deleteBodyAria': string;
|
|
699
702
|
'overview.deleteTitle': string;
|
|
700
703
|
'overview.deleteWarning': string;
|
|
704
|
+
'overview.lastStoreDeleteHint': string;
|
|
701
705
|
'overview.deleteAction': string;
|
|
702
706
|
'overview.deletingBody': string;
|
|
703
707
|
'overview.snapshot': string;
|
|
@@ -1161,4 +1165,3 @@ export declare const en: {
|
|
|
1161
1165
|
export type MnemonTranslate = (key: MnemonKey, params?: Record<string, unknown>) => string;
|
|
1162
1166
|
export declare function translateZh(key: MnemonKey, params?: Record<string, unknown>): string;
|
|
1163
1167
|
export declare function translateEn(key: MnemonKey, params?: Record<string, unknown>): string;
|
|
1164
|
-
//# sourceMappingURL=locales.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ClientConnectionHandle, type ClientSettingsScope, type ClientSettingsSnapshot, type SettingsOperation } from '../shared/contracts.ts';
|
|
2
2
|
export declare class MnemonSettingsScope<T extends object> implements ClientSettingsScope<T> {
|
|
3
3
|
private readonly connection;
|
|
4
4
|
private readonly namespace;
|
|
@@ -19,4 +19,3 @@ export declare class MnemonSettingsScope<T extends object> implements ClientSett
|
|
|
19
19
|
private write;
|
|
20
20
|
private publish;
|
|
21
21
|
}
|
|
22
|
-
//# sourceMappingURL=settings.d.ts.map
|
|
@@ -3,4 +3,3 @@ import type { MnemonWorkspaceController } from './workspace-controller.ts';
|
|
|
3
3
|
export declare const MNEMON_ENTRY_SELECTOR = "[data-dsh-mnemon-entry]";
|
|
4
4
|
/** Mount a self-healing official-style entry under the New Session row. */
|
|
5
5
|
export declare function mountMnemonSidebarEntry(controller: MnemonWorkspaceController, t: MnemonTranslate, subscribeLocale?: (listener: () => void) => () => void): () => void;
|
|
6
|
-
//# sourceMappingURL=sidebar-entry.d.ts.map
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import type { Config } from '../
|
|
2
|
-
import type { ClientSettingsScope } from '../contracts.ts';
|
|
1
|
+
import type { ClientSettingsScope, Config } from '../shared/contracts.ts';
|
|
3
2
|
import type { MnemonClientContext } from './dsh-compat.ts';
|
|
4
3
|
import type { MnemonTranslate } from './locales.ts';
|
|
5
4
|
export declare const MNEMON_VIEW_SELECTOR = "[data-dsh-mnemon-view]";
|
|
6
5
|
/** Mount the sidebar row and its stateful center-column workspace as one unit. */
|
|
7
6
|
export declare function mountMnemonWorkspace(ctx: MnemonClientContext, settings: ClientSettingsScope<Config>, t: MnemonTranslate): () => void;
|
|
8
|
-
//# sourceMappingURL=workspace-mount.d.ts.map
|
package/lib/types/commands.d.ts
CHANGED
|
@@ -11,4 +11,3 @@ interface AgentServiceSource {
|
|
|
11
11
|
export declare function createMnemonCommand(service: MnemonService | AgentServiceSource, coordinator: MnemonSubagentCoordinator): CommandDefinition;
|
|
12
12
|
export declare function registerCommands(commands: CommandService, service: MnemonService | AgentServiceSource, coordinator: MnemonSubagentCoordinator): void;
|
|
13
13
|
export {};
|
|
14
|
-
//# sourceMappingURL=commands.d.ts.map
|