dsh-mnemon 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/README.md +103 -129
  2. package/README.zh-CN.md +173 -0
  3. package/SECURITY.md +2 -2
  4. package/docs/README.md +4 -4
  5. package/docs/assets/diagrams/en/memory-system-flow.png +0 -0
  6. package/docs/assets/diagrams/zh-CN/memory-system-flow.png +0 -0
  7. package/docs/assets/media/dsh-mnemon-memory-system-demo-poster.jpg +0 -0
  8. package/docs/assets/media/dsh-mnemon-memory-system-demo.gif +0 -0
  9. package/docs/assets/media/dsh-mnemon-memory-system-demo.mp4 +0 -0
  10. package/docs/assets/screenshots/conversation-memory-jump.png +0 -0
  11. package/docs/assets/screenshots/conversation-save-dialog.png +0 -0
  12. package/docs/assets/screenshots/conversation-turn-memory.png +0 -0
  13. package/docs/assets/screenshots/document-create-dialog.png +0 -0
  14. package/docs/assets/screenshots/documents-markdown.png +0 -0
  15. package/docs/assets/screenshots/entities-context.png +0 -0
  16. package/docs/assets/screenshots/memory-content.png +0 -0
  17. package/docs/assets/screenshots/overview-memory-graph.png +0 -0
  18. package/docs/assets/screenshots/recall-agent-answer.png +0 -0
  19. package/docs/assets/screenshots/remember-dialog.png +0 -0
  20. package/docs/assets/screenshots/runtime-memory-add.png +0 -0
  21. package/docs/assets/screenshots/runtime-memory.png +0 -0
  22. package/docs/assets/screenshots/settings-memory-system.png +0 -0
  23. package/docs/assets/screenshots/status-overview.png +0 -0
  24. package/docs/assets/screenshots/version-check.png +0 -0
  25. package/docs/en/README.md +40 -32
  26. package/docs/en/architecture.md +6 -2
  27. package/docs/en/configuration.md +15 -6
  28. package/docs/en/development.md +24 -4
  29. package/docs/en/getting-started.md +77 -87
  30. package/docs/en/interfaces.md +98 -90
  31. package/docs/en/operations.md +103 -93
  32. package/docs/en/project-overview.md +90 -194
  33. package/docs/en/storage-model.md +6 -0
  34. package/docs/en/ui-guide.md +156 -0
  35. package/docs/zh-CN/README.md +37 -29
  36. package/docs/zh-CN/architecture.md +6 -2
  37. package/docs/zh-CN/configuration.md +15 -6
  38. package/docs/zh-CN/development.md +24 -4
  39. package/docs/zh-CN/getting-started.md +70 -80
  40. package/docs/zh-CN/interfaces.md +84 -76
  41. package/docs/zh-CN/operations.md +96 -86
  42. package/docs/zh-CN/project-overview.md +86 -190
  43. package/docs/zh-CN/storage-model.md +6 -0
  44. package/docs/zh-CN/ui-guide.md +160 -0
  45. package/lib/client.js +2354 -1944
  46. package/lib/client.js.map +1 -1
  47. package/lib/index.js +446 -39
  48. package/lib/types/channels.d.ts +4 -0
  49. package/lib/types/channels.d.ts.map +1 -0
  50. package/lib/types/channels.js +4 -0
  51. package/lib/types/channels.js.map +1 -0
  52. package/lib/types/client/MnemonSaveAction.d.ts.map +1 -1
  53. package/lib/types/client/MnemonSaveAction.js +4 -55
  54. package/lib/types/client/MnemonSaveAction.js.map +1 -1
  55. package/lib/types/client/MnemonSettingsCard.d.ts.map +1 -1
  56. package/lib/types/client/MnemonSettingsCard.js +4 -5
  57. package/lib/types/client/MnemonSettingsCard.js.map +1 -1
  58. package/lib/types/client/MnemonTurnTail.d.ts +3 -0
  59. package/lib/types/client/MnemonTurnTail.d.ts.map +1 -1
  60. package/lib/types/client/MnemonTurnTail.js +15 -3
  61. package/lib/types/client/MnemonTurnTail.js.map +1 -1
  62. package/lib/types/client/MnemonView.d.ts +4 -0
  63. package/lib/types/client/MnemonView.d.ts.map +1 -1
  64. package/lib/types/client/MnemonView.js +424 -97
  65. package/lib/types/client/MnemonView.js.map +1 -1
  66. package/lib/types/client/MnemonViewAppearance.d.ts +21 -0
  67. package/lib/types/client/MnemonViewAppearance.d.ts.map +1 -0
  68. package/lib/types/client/MnemonViewAppearance.js +67 -0
  69. package/lib/types/client/MnemonViewAppearance.js.map +1 -0
  70. package/lib/types/client/anchor.d.ts +1 -1
  71. package/lib/types/client/anchor.js +1 -1
  72. package/lib/types/client/api.d.ts +4 -0
  73. package/lib/types/client/api.d.ts.map +1 -1
  74. package/lib/types/client/api.js +10 -1
  75. package/lib/types/client/api.js.map +1 -1
  76. package/lib/types/client/index.d.ts.map +1 -1
  77. package/lib/types/client/index.js +22 -25
  78. package/lib/types/client/index.js.map +1 -1
  79. package/lib/types/client/locales.d.ts +126 -294
  80. package/lib/types/client/locales.d.ts.map +1 -1
  81. package/lib/types/client/locales.js +140 -308
  82. package/lib/types/client/locales.js.map +1 -1
  83. package/lib/types/client/settings.d.ts +1 -1
  84. package/lib/types/client/settings.d.ts.map +1 -1
  85. package/lib/types/client/settings.js +1 -1
  86. package/lib/types/client/settings.js.map +1 -1
  87. package/lib/types/client/sidebar-entry.d.ts +1 -1
  88. package/lib/types/client/sidebar-entry.d.ts.map +1 -1
  89. package/lib/types/client/sidebar-entry.js +3 -1
  90. package/lib/types/client/sidebar-entry.js.map +1 -1
  91. package/lib/types/client/workspace-mount.d.ts.map +1 -1
  92. package/lib/types/client/workspace-mount.js +8 -5
  93. package/lib/types/client/workspace-mount.js.map +1 -1
  94. package/lib/types/config.d.ts +1 -3
  95. package/lib/types/config.d.ts.map +1 -1
  96. package/lib/types/config.js +10 -12
  97. package/lib/types/config.js.map +1 -1
  98. package/lib/types/index.d.ts +2 -1
  99. package/lib/types/index.d.ts.map +1 -1
  100. package/lib/types/index.js +2 -1
  101. package/lib/types/index.js.map +1 -1
  102. package/lib/types/lifecycle.js +3 -3
  103. package/lib/types/lifecycle.js.map +1 -1
  104. package/lib/types/memory-bodies.d.ts +1 -0
  105. package/lib/types/memory-bodies.d.ts.map +1 -1
  106. package/lib/types/memory-bodies.js +7 -0
  107. package/lib/types/memory-bodies.js.map +1 -1
  108. package/lib/types/rpc.d.ts +5 -7
  109. package/lib/types/rpc.d.ts.map +1 -1
  110. package/lib/types/rpc.js +28 -8
  111. package/lib/types/rpc.js.map +1 -1
  112. package/lib/types/service.d.ts +2 -0
  113. package/lib/types/service.d.ts.map +1 -1
  114. package/lib/types/service.js +4 -0
  115. package/lib/types/service.js.map +1 -1
  116. package/lib/types/settings.d.ts.map +1 -1
  117. package/lib/types/settings.js +1 -2
  118. package/lib/types/settings.js.map +1 -1
  119. package/lib/types/version-updates.d.ts +61 -0
  120. package/lib/types/version-updates.d.ts.map +1 -0
  121. package/lib/types/version-updates.js +377 -0
  122. package/lib/types/version-updates.js.map +1 -0
  123. package/package.json +23 -8
  124. package/README.en.md +0 -199
  125. package/docs/zh-CN/assets/screenshots/conversation-recall.png +0 -0
  126. package/docs/zh-CN/assets/screenshots/conversation-writeback.png +0 -0
  127. package/docs/zh-CN/assets/screenshots/documents-markdown.png +0 -0
  128. package/docs/zh-CN/assets/screenshots/entities-context.png +0 -0
  129. package/docs/zh-CN/assets/screenshots/memory-content.png +0 -0
  130. package/docs/zh-CN/assets/screenshots/overview-memory-graph.png +0 -0
  131. package/docs/zh-CN/assets/screenshots/recall-agent-answer.png +0 -0
  132. package/docs/zh-CN/assets/screenshots/runtime-memory.png +0 -0
  133. package/lib/types/client/MnemonToolviews.d.ts +0 -19
  134. package/lib/types/client/MnemonToolviews.d.ts.map +0 -1
  135. package/lib/types/client/MnemonToolviews.js +0 -172
  136. package/lib/types/client/MnemonToolviews.js.map +0 -1
  137. /package/docs/{en/assets → assets/diagrams/en}/project-architecture.svg +0 -0
  138. /package/docs/{zh-CN/assets → assets/diagrams/zh-CN}/project-architecture.svg +0 -0
package/README.en.md DELETED
@@ -1,199 +0,0 @@
1
- <h1 align="center">dsh-mnemon</h1>
2
-
3
- <p align="center"><a href="./README.md">简体中文</a> | <strong>English</strong></p>
4
-
5
- <p align="center">
6
- <a href="./docs/en/project-overview.md">
7
- <img src="./docs/assets/dsh-mnemon-memory-system-demo-poster.jpg" alt="Mnemon Memory Spaces page with the multi-space catalog, activation state, and live relationship graph" width="720">
8
- </a>
9
- </p>
10
-
11
- > **A deep integration of [Mnemon](https://github.com/mnemon-dev/mnemon) and DSH that gives DSH comprehensive memory capabilities.**
12
-
13
- `dsh-mnemon` is a local Mnemon memory plugin for DeepSeek Harness (DSH). It organizes always-available runtime memory, readable project Documents, and on-demand long-term Memory Spaces into a supervised, searchable, maintainable three-tier system.
14
-
15
- The plugin brings Mnemon's durable Memory Space capabilities into DSH and adds Runtime Memory, Documents, lifecycle integration, bounded subagents, the WebUI, commands, and permission boundaries. Current user instructions and repository facts always take precedence over historical memory.
16
-
17
- > **What's more?** More DSH-native capabilities are on the way. **Memory to View.**
18
-
19
- ## Live demo
20
-
21
- ![dsh-mnemon memory system walkthrough covering status, Runtime Memory, the multi-space graph, Documents, recall, entities, and supervised writeback](./docs/assets/dsh-mnemon-memory-system-demo.gif)
22
-
23
- ## Three memory tiers
24
-
25
- | Tier | What belongs here | How it is retained | How it reaches context |
26
- |---|---|---|---|
27
- | Runtime Memory | User preferences, stable conventions, environment facts, frequently used lessons | Explicit operations or an eligible background review update `memories.json`, then generate `USER.md` / `MEMORY.md` projections | Injected directly every turn |
28
- | Project Documents | Designs, investigations, procedures, rationale, and handoffs | Create or update managed Markdown and `index.json`; capacity maintenance creates a Mnemon cold reference before moving the original | Search active Documents first, then read full text on demand |
29
- | Memory Spaces | Cross-session facts, decisions, entities, and relationships | A bounded `spawn` worker selects the narrowest space, checks duplicates, and writes four-graph memory through Mnemon `remember` / `link` | Recalled on demand from active Memory Spaces only |
30
-
31
- ```text
32
- Reusable knowledge produced by current work
33
- |
34
- +-- Compact, stable, useful every turn
35
- | root Agent / eligible fork review
36
- | |
37
- | add | replace | remove
38
- | v
39
- | memories.json (source of truth)
40
- | |
41
- | USER.md + MEMORY.md ----------> every prompt
42
- |
43
- +-- Complete designs, research, procedures, handoffs
44
- | root Agent / eligible fork review
45
- | |
46
- | create | update
47
- | v
48
- | index.json + active/*.md ------> full text after search
49
- | |
50
- | Mnemon cold reference -> archived/*.md (maintenance)
51
- |
52
- `-- Cross-session facts, decisions, entities, relations
53
- root Agent
54
- |
55
- spawn: route / deduplicate / write
56
- v
57
- Mnemon CLI -> <space>/mnemon.db
58
- |
59
- spawn: recall active spaces only -> bounded evidence
60
- ```
61
-
62
- ## Highlights
63
-
64
- - Proactive memory routing: built-in prompts, lifecycle cues, and tool descriptions encourage the LLM to use every read/write surface when useful; explicit requests to revisit, retain, correct, forget, or document are routed to the matching tier and operation.
65
- - One `global`, `workspace`, or `custom` storage scope for all three tiers.
66
- - A Memory Space directory in which each space has a stable ID, name, routing description, activation state, and its own `mnemon.db`.
67
- - Bounded subagents: isolated `spawn` workers handle durable recall and semantic writes; a `fork` worker inherits a completed checkpoint for background review.
68
- - Safe capacity maintenance: USER memory is compacted locally, MEMORY entries are archived before compaction, and Documents are cold-indexed before migration; revision conflicts preserve the original data.
69
- - Native DSH integration through model tools, `/mnemon` commands, a bilingual Web workspace, global light/dark themes, and diagnostics.
70
- - Local-first execution: the CLI is started with argument arrays and no shell, and no remote memory service is required.
71
-
72
- ## Prerequisites
73
-
74
- - A working DSH Web profile.
75
- - A local `mnemon` CLI.
76
- - A subagent provider supporting `outputSchema`, `toolFilter`, `persona`, and `depthLimit`. Regular semantic work prefers `spawn`; the default background review also requires a provider named `fork` that inherits parent context.
77
-
78
- **Compatibility baseline**: `dsh-mnemon` 0.1.0 has been verified end-to-end on a live web profile running `@deepseek-ai/dsh` 0.1.0-rc.6 (2026-08-13 snapshot); last verified 2026-08-14. The plugin declares no fixed minimum-version matrix. DSH moves fast: before upgrading, re-run the [Getting Started](./docs/en/getting-started.md) verification steps in an isolated profile or a backed-up data directory.
79
-
80
- ## Quick start
81
-
82
- Install Mnemon:
83
-
84
- ```sh
85
- # macOS
86
- brew install --cask mnemon-dev/tap/mnemon
87
-
88
- # macOS / Linux via Go
89
- go install github.com/mnemon-dev/mnemon@latest
90
-
91
- mnemon --version
92
- ```
93
-
94
- Install the plugin and restart the DSH Web profile:
95
-
96
- ```sh
97
- dsh plugin --profile web add dsh-mnemon
98
- dsh --profile web
99
- ```
100
-
101
- Pre-release builds not yet published to npm can be installed from git:
102
-
103
- ```sh
104
- dsh plugin --profile web add "github:omdsh-dev/dsh-mnemon"
105
- ```
106
-
107
- For a local checkout, use an absolute path:
108
-
109
- ```sh
110
- dsh plugin --profile web add "link:/absolute/path/to/dsh-mnemon"
111
- ```
112
-
113
- Open the dedicated “Settings -> Memory System” page to choose both a display mode and storage scope. The default `sidebar` mode opens a dedicated “Memory System” workbench from the sidebar; switching to `buildin` restores the original conversation-area tab. Saving switches live without mounting duplicate entries. Under the `workspace` scope, the sidebar workbench selector independently chooses which DSH workspace to inspect and maintain; agents, tools, and lifecycle hooks always continue to use the current session workspace. A global banner shows both paths when they diverge and aligns them with one click. The storage root switches atomically after the new directory initializes successfully, and changing the scope never migrates, merges, or deletes old data automatically.
114
-
115
- Upgrade and uninstall (`dsh plugin` forwards to pnpm inside the profile directory):
116
-
117
- ```sh
118
- # Upgrade
119
- dsh plugin --profile web update dsh-mnemon
120
-
121
- # Uninstall (also removes its bundle registration from the profile)
122
- dsh plugin --profile web remove dsh-mnemon
123
- ```
124
-
125
- Uninstalling never deletes memory data: `global` data stays in `~/.mnemon`, and `workspace` / `custom` data stays in their directories, so reinstalling picks up where you left off. To pause automatic reads/writes without uninstalling, turn off `writebackMode` / `recallMode` / `lifecycleEnabled`; set `tabEnabled=false` to hide the currently selected Web entry (see the [configuration reference](./docs/en/configuration.md)).
126
-
127
- ## Minimal configuration
128
-
129
- Configuration lives in `$DSH_HOME/settings.yaml` (commonly `~/.dsh/settings.yaml` by default):
130
-
131
- ```yaml
132
- mnemon:
133
- displayMode: sidebar # sidebar | buildin; sidebar by default
134
- storageScope: global # global | workspace | custom
135
- ```
136
-
137
- - `global`: `MNEMON_DATA_DIR`, or `~/.mnemon` when unset.
138
- - `workspace`: `.mnemon` under each DSH workspace root; Agent execution follows the current session workspace while the Web workbench may inspect another target.
139
- - `custom`: an absolute or `~/...` path supplied through `dataDir`.
140
-
141
- See the [configuration reference](./docs/en/configuration.md) for every option, precedence rules, and read-only mode.
142
-
143
- ## Entry points
144
-
145
- The Web workspace contains Status, Runtime, Memory Spaces, Documents, Distill, Recall, Entities, and Content pages in three divider-separated groups: “Status” stands alone; “Runtime, Memory Spaces, Documents” cover the three storage tiers; “Distill, Recall, Entities, Content” are the read/write tools. Its main interface follows DSH's global Chinese/English locale.
146
-
147
- Memory also surfaces inside the conversation flow (conversation interface, **off by default**; enable each surface under Settings → Memory System → Conversation interface — changes apply live on save):
148
-
149
- - **Memory tool cards**: every `mnemon_*` tool call renders as a memory-flavoured card — recalls show the query and hit count, writes show the subject summary — expandable to the raw arguments and structured result, with a one-click jump to the matching Memory view page;
150
- - **Turn memory bar**: completed calls are separated into successful recalls, writes, document searches, and inspections, with failures reported independently; expand it for the exact tool names;
151
- - **Save to memory**: every finalized assistant reply carries a “Save to memory” action; the candidate is editable, and submission routes through the isolated memory subagent (judgment, dedupe, distillation) without filling the main conversation context.
152
-
153
- Common commands:
154
-
155
- ```text
156
- /mnemon status
157
- /mnemon recall <query>
158
- /mnemon related <full memory ID>
159
- /mnemon remember <stable, self-contained durable insight>
160
- /mnemon forget <full memory ID>
161
- ```
162
-
163
- The recommended lookup order is: hot memory -> active Documents -> active Memory Spaces -> the archived original referenced by a hit. Do not persist temporary progress, raw logs, secrets, or ordinary facts that can be recovered directly from the repository.
164
-
165
- ## Permissions & data
166
-
167
- - **Files**: reads/writes data directories through the local `mnemon` CLI — `~/.mnemon` for the `global` scope, a user-chosen directory for `workspace` / `custom`. The plugin never writes those directories directly, and the WebUI never reads SQLite directly. `sourcePaths` cannot escape the originating session workspace or point into the managed Documents directory.
168
- - **Processes**: `mnemon` is started as an argument array with shell disabled, bounded output, and `SIGTERM` then `SIGKILL` on timeout.
169
- - **Network**: the plugin and Mnemon both run locally and make no remote calls; subagent model inference uses DSH's existing provider connection.
170
- - **Credentials**: the plugin stores and reads no credentials or API keys; model credentials are fully managed by DSH and your provider.
171
- - **User data**: all memory content (user profile, project Documents, long-term memory) stays in local SQLite / JSON and is never uploaded.
172
- - **Honest disclosure**: there is no deterministic credential/secret scanner yet — do not write keys, tokens, or private keys into hot memory, Documents, or Memory Spaces. For the full boundaries (process/file/Web/model) and backup/restore, see [Operations, security, and troubleshooting](./docs/en/operations.md).
173
-
174
- ## Documentation
175
-
176
- - [Documentation hub](./docs/en/README.md)
177
- - [Project overview](./docs/en/project-overview.md)
178
- - [Getting started](./docs/en/getting-started.md)
179
- - [Architecture](./docs/en/architecture.md)
180
- - [Storage and three-tier memory model](./docs/en/storage-model.md)
181
- - [Lifecycle and workflows](./docs/en/workflows.md)
182
- - [Configuration reference](./docs/en/configuration.md)
183
- - [WebUI, tools, commands, and RPC](./docs/en/interfaces.md)
184
- - [Operations, security, and troubleshooting](./docs/en/operations.md)
185
- - [Development and verification](./docs/en/development.md)
186
- - [Roadmap](./docs/en/roadmap.md)
187
-
188
- ## Development
189
-
190
- ```sh
191
- pnpm install
192
- pnpm run verify
193
- ```
194
-
195
- `verify` runs TypeScript checks, Vitest, and the production build. Generated artifacts are written to and committed under `lib/`. See the [development guide](./docs/en/development.md) for release and real-WebUI validation procedures.
196
-
197
- ## License
198
-
199
- MIT. For security issues, please report privately through the channels in [SECURITY.md](./SECURITY.md) instead of opening a public issue.
@@ -1,19 +0,0 @@
1
- import type { MnemonKey } from './locales.ts';
2
- export interface MnemonToolViewProps {
3
- callId: string;
4
- toolName: string;
5
- /** RunningToolCall while live, ToolResultNode once settled; both are opaque wire slices. */
6
- block: unknown;
7
- openFile?: ((path: string) => void) | undefined;
8
- cwd?: string | undefined;
9
- /** Optional on older/newer DSH tool hosts; omit the action when unavailable. */
10
- inspect?: (() => void) | undefined;
11
- /** Session the call belongs to; injected by the slot host. */
12
- sessionId?: string | undefined;
13
- t: (key: MnemonKey, params?: Record<string, unknown>) => string;
14
- }
15
- /** Render one mnemon_* tool call as a memory-flavoured row with expandable evidence. */
16
- export declare const MnemonToolView: import("react").NamedExoticComponent<MnemonToolViewProps>;
17
- /** Tool name → toolview component, registered as keyed `tool.call.toolview` entries. */
18
- export declare const MNEMON_TOOLVIEW_NAMES: readonly string[];
19
- //# sourceMappingURL=MnemonToolviews.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MnemonToolviews.d.ts","sourceRoot":"","sources":["../../../src/client/MnemonToolviews.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAG7C,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,4FAA4F;IAC5F,KAAK,EAAE,OAAO,CAAA;IACd,QAAQ,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAA;IAC/C,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACxB,gFAAgF;IAChF,OAAO,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAA;IAClC,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC9B,CAAC,EAAE,CAAC,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAA;CAChE;AAqID,wFAAwF;AACxF,eAAO,MAAM,cAAc,2DAyDzB,CAAA;AAEF,wFAAwF;AACxF,eAAO,MAAM,qBAAqB,EAAkC,SAAS,MAAM,EAAE,CAAA"}
@@ -1,172 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { memo, useMemo, useState } from 'react';
3
- import { MnemonLogo } from "./MnemonLogo.js";
4
- import { dispatchMnemonAnchor } from "./anchor.js";
5
- import css from './MnemonToolviews.module.css';
6
- const READ_TOOLS = new Set(['mnemon_recall', 'mnemon_related', 'mnemon_document_search', 'mnemon_status', 'mnemon_memory_bodies']);
7
- /** Anchor destination per tool: where "open in Memory view" should land. */
8
- const ANCHOR_TARGETS = {
9
- mnemon_recall: { page: 'explore', seed: args => typeof args.query === 'string' && args.query.trim() !== '' ? args.query.trim() : undefined },
10
- mnemon_related: { page: 'explore', seed: args => typeof args.id === 'string' && args.id.trim() !== '' ? args.id.trim() : undefined },
11
- mnemon_document_search: { page: 'documents' },
12
- mnemon_status: { page: 'status' },
13
- mnemon_memory_bodies: { page: 'overview' },
14
- mnemon_runtime_memory: { page: 'runtime' },
15
- mnemon_document_manage: { page: 'documents' },
16
- mnemon_remember: { page: 'overview' },
17
- mnemon_forget: { page: 'overview' },
18
- mnemon_link: { page: 'overview' },
19
- mnemon_memory_body_create: { page: 'overview' },
20
- mnemon_memory_body_update: { page: 'overview' },
21
- mnemon_memory_body_merge: { page: 'overview' },
22
- };
23
- function isSettled(block) {
24
- return typeof block === 'object' && block !== null && 'kind' in block;
25
- }
26
- /** Parse the call's raw arguments JSON; always returns a plain object. */
27
- function argsOf(block) {
28
- const record = block;
29
- const raw = typeof record?.call?.argsRaw === 'string' ? record.call.argsRaw : typeof record?.argsRaw === 'string' ? record.argsRaw : '';
30
- if (raw === '')
31
- return {};
32
- try {
33
- const parsed = JSON.parse(raw);
34
- return typeof parsed === 'object' && parsed !== null && !Array.isArray(parsed) ? parsed : {};
35
- }
36
- catch {
37
- return {};
38
- }
39
- }
40
- /** Joined text blocks of a settled result; empty while running. */
41
- function resultText(block) {
42
- if (!isSettled(block))
43
- return '';
44
- const content = block.content;
45
- if (!Array.isArray(content))
46
- return '';
47
- return content
48
- .filter(item => typeof item === 'object' && item !== null && item.type === 'text' && typeof item.text === 'string')
49
- .map(item => String(item.text))
50
- .join('');
51
- }
52
- /** Parsed result JSON when the output is one object; otherwise null. */
53
- function outputJson(block) {
54
- const text = resultText(block);
55
- if (text === '')
56
- return null;
57
- try {
58
- const parsed = JSON.parse(text);
59
- return typeof parsed === 'object' && parsed !== null && !Array.isArray(parsed) ? parsed : null;
60
- }
61
- catch {
62
- return null;
63
- }
64
- }
65
- function truncateInline(value, max) {
66
- const normalized = value.replace(/\s+/g, ' ').trim();
67
- return normalized.length <= max ? normalized : `${normalized.slice(0, max)}…`;
68
- }
69
- function truncateBlock(value, max) {
70
- const normalized = value.trim();
71
- return normalized.length <= max ? normalized : `${normalized.slice(0, max)}\n…`;
72
- }
73
- function countOf(value) {
74
- return Array.isArray(value) ? value.length : undefined;
75
- }
76
- /** Tool-specific one-line summary from the call args and the settled output. */
77
- function summaryFor(toolName, args, out, t) {
78
- switch (toolName) {
79
- case 'mnemon_recall': {
80
- const query = typeof args.query === 'string' ? truncateInline(args.query, 56) : '';
81
- const hits = out === null ? undefined : countOf(out.results);
82
- return hits === undefined ? query : t('toolview.recallSummary', { query, count: hits });
83
- }
84
- case 'mnemon_related': {
85
- const id = typeof args.id === 'string' ? args.id : '';
86
- const hits = out === null ? undefined : countOf(out.results);
87
- return hits === undefined ? truncateInline(id, 56) : t('toolview.relatedSummary', { id: truncateInline(id, 28), count: hits });
88
- }
89
- case 'mnemon_document_search': {
90
- const query = typeof args.query === 'string' ? truncateInline(args.query, 56) : '';
91
- const hits = out === null ? undefined : countOf(out.results);
92
- return hits === undefined ? query : t('toolview.documentSearchSummary', { query, count: hits });
93
- }
94
- case 'mnemon_status':
95
- return out === null ? t('toolview.running') : out.healthy === true ? t('toolview.statusHealthy') : t('toolview.statusUnhealthy');
96
- case 'mnemon_memory_bodies':
97
- return out === null ? t('toolview.running') : t('toolview.bodiesSummary', { count: out.total ?? 0, active: out.activeCount ?? 0 });
98
- case 'mnemon_remember':
99
- return typeof args.content === 'string' ? truncateInline(args.content, 56) : t('toolview.genericSummary');
100
- case 'mnemon_runtime_memory': {
101
- const action = typeof args.action === 'string' ? args.action : '';
102
- const target = typeof args.target === 'string' ? args.target : '';
103
- const content = typeof args.content === 'string' ? truncateInline(args.content, 40) : '';
104
- return content === '' ? t('toolview.runtimeSummary', { action, target }) : t('toolview.runtimeSummaryWithContent', { action, target, content });
105
- }
106
- case 'mnemon_document_manage': {
107
- const action = typeof args.action === 'string' ? args.action : '';
108
- const title = typeof args.title === 'string' ? truncateInline(args.title, 40) : '';
109
- return title === '' ? t('toolview.documentManageSummary', { action }) : t('toolview.documentManageSummaryWithTitle', { action, title });
110
- }
111
- case 'mnemon_link': {
112
- const source = typeof args.sourceId === 'string' ? truncateInline(args.sourceId, 18) : '?';
113
- const target = typeof args.targetId === 'string' ? truncateInline(args.targetId, 18) : '?';
114
- return `${source} → ${target}`;
115
- }
116
- case 'mnemon_forget':
117
- return typeof args.id === 'string' ? truncateInline(args.id, 56) : t('toolview.genericSummary');
118
- case 'mnemon_memory_body_create':
119
- return typeof args.name === 'string' ? truncateInline(args.name, 56) : t('toolview.genericSummary');
120
- case 'mnemon_memory_body_update': {
121
- const id = typeof args.memoryBodyId === 'string' ? truncateInline(args.memoryBodyId, 32) : '';
122
- return id === '' ? t('toolview.genericSummary') : t('toolview.bodyUpdateSummary', { id });
123
- }
124
- case 'mnemon_memory_body_merge': {
125
- const target = typeof args.targetMemoryBodyId === 'string' ? truncateInline(args.targetMemoryBodyId, 24) : '?';
126
- const sources = countOf(args.sourceMemoryBodyIds) ?? 0;
127
- return t('toolview.bodyMergeSummary', { target, count: sources });
128
- }
129
- default:
130
- return t('toolview.genericSummary');
131
- }
132
- }
133
- /** Render one mnemon_* tool call as a memory-flavoured row with expandable evidence. */
134
- export const MnemonToolView = memo(function MnemonToolView({ toolName, block, inspect, sessionId, t }) {
135
- const [open, setOpen] = useState(false);
136
- const settled = isSettled(block);
137
- const record = block;
138
- const state = !settled
139
- ? 'running'
140
- : record?.error?.code === 'interrupted'
141
- ? 'stopped'
142
- : record?.isError === true
143
- ? 'error'
144
- : 'ok';
145
- const args = useMemo(() => argsOf(block), [block]);
146
- const out = useMemo(() => outputJson(block), [block]);
147
- const text = useMemo(() => resultText(block), [block]);
148
- const title = READ_TOOLS.has(toolName) ? t('toolview.recallTitle') : t('toolview.writeTitle');
149
- const summary = summaryFor(toolName, args, out, t);
150
- const target = ANCHOR_TARGETS[toolName];
151
- const seed = target?.seed?.(args);
152
- const toggle = () => setOpen(value => !value);
153
- const openView = (event) => {
154
- event.stopPropagation();
155
- if (target === undefined)
156
- return;
157
- dispatchMnemonAnchor({ page: target.page, ...(seed === undefined ? {} : { seed }), ...(sessionId === undefined ? {} : { sessionId }) });
158
- };
159
- const inspectCall = (event) => {
160
- event.stopPropagation();
161
- inspect?.();
162
- };
163
- const showArgs = Object.keys(args).length > 0;
164
- const showResult = text !== '';
165
- return (_jsxs("div", { className: css.root, "data-state": state, "data-open": open || undefined, children: [_jsxs("div", { className: css.row, role: "button", tabIndex: 0, "aria-expanded": open, "aria-label": `${title}:${summary}`, onClick: toggle, onKeyDown: event => { if (event.key === 'Enter' || event.key === ' ') {
166
- event.preventDefault();
167
- toggle();
168
- } }, children: [_jsx("span", { className: `${css.dot} ${state === 'running' ? css.dotRunning : state === 'error' ? css.dotError : state === 'stopped' ? css.dotStopped : css.dotOk}`, "aria-hidden": "true" }), _jsx(MnemonLogo, { className: css.leading, title: title }), _jsx("span", { className: css.title, children: title }), _jsx("span", { className: css.summary, children: summary }), (inspect !== undefined || target !== undefined) && (_jsxs("span", { className: css.actions, onClick: event => event.stopPropagation(), children: [target !== undefined && _jsx("button", { type: "button", className: css.actionButton, onClick: openView, title: t('toolview.openView'), children: t('toolview.openView') }), settled && inspect !== undefined && _jsx("button", { type: "button", className: css.actionButton, onClick: inspectCall, title: t('toolview.inspect'), children: t('toolview.inspect') })] })), _jsx("span", { className: `${css.chevron} ${open ? css.chevronOpen : ''}`, "aria-hidden": "true" })] }), open && (_jsxs("div", { className: css.details, onClick: event => event.stopPropagation(), children: [showArgs && _jsxs("div", { className: css.detailSection, children: [_jsx("span", { className: css.detailLabel, children: t('toolview.args') }), _jsx("pre", { className: css.detailCode, children: truncateBlock(JSON.stringify(args, null, 2), 2000) })] }), showResult && _jsxs("div", { className: css.detailSection, children: [_jsx("span", { className: css.detailLabel, children: t('toolview.result') }), _jsx("pre", { className: css.detailCode, children: truncateBlock(text, 4000) })] }), !showArgs && !showResult && _jsx("div", { className: css.detailEmpty, children: state === 'running' ? t('toolview.running') : t('toolview.noResult') })] }))] }));
169
- });
170
- /** Tool name → toolview component, registered as keyed `tool.call.toolview` entries. */
171
- export const MNEMON_TOOLVIEW_NAMES = Object.keys(ANCHOR_TARGETS);
172
- //# sourceMappingURL=MnemonToolviews.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MnemonToolviews.js","sourceRoot":"","sources":["../../../src/client/MnemonToolviews.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAgD,MAAM,OAAO,CAAA;AAC7F,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAkB,CAAA;AAC7C,OAAO,EAAE,oBAAoB,EAAyB,MAAM,aAAa,CAAA;AAEzE,OAAO,GAAG,MAAM,8BAA8B,CAAA;AAgB9C,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,eAAe,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,eAAe,EAAE,sBAAsB,CAAC,CAAC,CAAA;AAElI,4EAA4E;AAC5E,MAAM,cAAc,GAA6G;IAC/H,aAAa,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE;IAC5I,cAAc,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,OAAO,IAAI,CAAC,EAAE,KAAK,QAAQ,IAAI,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE;IACpI,sBAAsB,EAAE,EAAE,I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