dsh-dejavu-memory 0.4.7 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -11,18 +11,24 @@ Connects DeepSeek Harness to **DejaVu**: session-start boot + daily briefing, pl
11
11
 
12
12
  > Port of [pi-dejavu-memory](https://github.com/RetiredPhysicist/pi-plugins/tree/main/packages/pi-dejavu-memory) — same protocol, same tool names.
13
13
 
14
+ There is also a **ChatGPT and Codex plugin**, [dejavu-memory](https://github.com/RetiredPhysicist/openai-plugins/tree/main/plugins/dejavu-memory) — the same memory server, but with an interactive knowledge graph of the tree inside the chat client. This plugin stays tool-only.
15
+
16
+ <p align="center">
17
+ <img src="assets/readme/dejavu-memory-search.webp" width="100%" alt="The DejaVu Memory plugin in Codex: an interactive graph of the memory tree with search hits highlighted and the node inspector open">
18
+ </p>
19
+
14
20
  [English](README.md) · [中文](README.zh.md)
15
21
 
16
22
  ## Tools
17
23
 
18
24
  | tool | what it does |
19
25
  |---|---|
20
- | `noc_boot` | load at session start: `system://boot`, `system://recent/5`, `system://triggers`, then best-effort `system://briefing`; afterward read `system://focus` (recent is a briefing subset — no need to re-read it after boot) |
21
- | `noc_read` | read a memory by URI (`system://…`, `noc://agent`, …) |
22
- | `noc_search` | search memories (semantic + keyword / trigger recall via `search_memory`) |
23
- | `noc_create` | create a memory node (`[Baseline]`/`[Deviation]`/`[Result]`/`[Reusable judgment]`) |
24
- | `noc_update` | full replace, patch (old_string/new_string), or append; optional `relation` |
25
- | `noc_delete` | delete a memory by URI (`delete_memory`) |
26
+ | `dejavu_boot` | load at session start: `system://boot`, `system://recent/5`, `system://triggers`, then best-effort `system://briefing`; afterward read `system://focus` (recent is a briefing subset — no need to re-read it after boot) |
27
+ | `dejavu_read` | read a memory by URI (`system://…`, `dejavu://agent`, …) |
28
+ | `dejavu_search` | search memories (semantic + keyword / trigger recall via `search_memory`) |
29
+ | `dejavu_create` | create a memory node (`[Baseline]`/`[Deviation]`/`[Result]`/`[Reusable judgment]`) |
30
+ | `dejavu_update` | full replace, patch (old_string/new_string), or append; optional `relation` |
31
+ | `dejavu_delete` | delete a memory by URI (`delete_memory`) |
26
32
 
27
33
  ## Quick start
28
34
 
@@ -60,9 +66,9 @@ For a server behind Cloudflare Access (e.g. dejavu.example.com), use the **servi
60
66
 
61
67
  > **Upgrading from dsh-noc-memory:** package renamed to `dsh-dejavu-memory`. Remove the old plugin and re-add; point config `id` at `dejavu`.
62
68
 
63
- ## Why noc_* (not DejaVu_*)?
69
+ ## Why dejavu_* (not noc_*)?
64
70
 
65
- Some agents probe `read_mcp_resource` before reaching for a memory tool, wasting a round trip ([upstream issue #32](https://github.com/Dataojitori/DejaVu_memory/issues/32)). Explicit `noc_boot` / `noc_read` naming in the tool list and boot-protocol prompt steers models straight to the right tool — no resource shim required.
71
+ Some agents probe `read_mcp_resource` before reaching for a memory tool, wasting a round trip ([upstream issue #32](https://github.com/Dataojitori/nocturne_memory/issues/32)). Explicit `dejavu_boot` / `dejavu_read` naming in the tool list and boot-protocol prompt steers models straight to the right tool — no resource shim required.
66
72
 
67
73
  ## License
68
74
 
@@ -71,5 +77,6 @@ MIT
71
77
  ## Related
72
78
 
73
79
  - [DejaVu](https://github.com/RealAlexandreAI/DejaVu) — the Cloudflare MCP memory server this plugin talks to
80
+ - [dejavu-memory for ChatGPT and Codex](https://github.com/RetiredPhysicist/openai-plugins/tree/main/plugins/dejavu-memory) — same memory server, with an interactive knowledge graph
74
81
  - [pi-dejavu-memory](https://github.com/RetiredPhysicist/pi-plugins/tree/main/packages/pi-dejavu-memory) — same memory tools for Pi
75
82
  - [DejaVu_memory](https://github.com/Dataojitori/DejaVu_memory) — upstream project
package/README.zh.md CHANGED
@@ -8,18 +8,24 @@
8
8
 
9
9
  > 由 [pi-dejavu-memory](https://github.com/RetiredPhysicist/pi-plugins/tree/main/packages/pi-dejavu-memory) 移植,协议与工具名完全一致。
10
10
 
11
+ 另有 **ChatGPT / Codex 插件** [dejavu-memory](https://github.com/RetiredPhysicist/openai-plugins/tree/main/plugins/dejavu-memory),接同一个记忆服务器,但在聊天客户端里把记忆树画成可交互的知识图谱;本插件只提供工具。
12
+
13
+ <p align="center">
14
+ <img src="assets/readme/dejavu-memory-search.webp" width="100%" alt="Codex 中的 DejaVu Memory 插件:记忆树的可交互知识图谱,搜索命中高亮,节点详情面板展开">
15
+ </p>
16
+
11
17
  [English](README.md) · [中文](README.zh.md)
12
18
 
13
19
  ## 工具
14
20
 
15
21
  | 工具 | 说明 |
16
22
  |---|---|
17
- | `noc_boot` | 会话开始加载:`system://boot`、`system://recent/5`、`system://triggers`,再 best-effort 读 `system://briefing`;随后读 `system://focus`(`recent` 是 briefing 子集——boot 之后不必再单独读) |
18
- | `noc_read` | 按 URI 读记忆(`system://…`、`noc://agent`…) |
19
- | `noc_search` | 搜记忆(语义 + 关键词 / 触发词召回,服务端 `search_memory`) |
20
- | `noc_create` | 新建记忆节点(支持 `[Baseline]`/`[Deviation]`/`[Result]`/`[Reusable judgment]`) |
21
- | `noc_update` | 全文替换、patch(old_string/new_string)或 append;可选 `relation` |
22
- | `noc_delete` | 按 URI 删除记忆(`delete_memory`) |
23
+ | `dejavu_boot` | 会话开始加载:`system://boot`、`system://recent/5`、`system://triggers`,再 best-effort 读 `system://briefing`;随后读 `system://focus`(`recent` 是 briefing 子集——boot 之后不必再单独读) |
24
+ | `dejavu_read` | 按 URI 读记忆(`system://…`、`dejavu://agent`…) |
25
+ | `dejavu_search` | 搜记忆(语义 + 关键词 / 触发词召回,服务端 `search_memory`) |
26
+ | `dejavu_create` | 新建记忆节点(支持 `[Baseline]`/`[Deviation]`/`[Result]`/`[Reusable judgment]`) |
27
+ | `dejavu_update` | 全文替换、patch(old_string/new_string)或 append;可选 `relation` |
28
+ | `dejavu_delete` | 按 URI 删除记忆(`delete_memory`) |
23
29
 
24
30
  ## 快速开始
25
31
 
@@ -54,11 +60,11 @@ dsh plugin --profile web add dsh-dejavu-memory
54
60
  | `mcp_url` | 是 | 你的 DejaVu MCP 端点(Streamable HTTP) |
55
61
  | `mcp_auth` | 否 | 遗留字段;优先用 `mcp_headers` 传 Cloudflare Access service token |
56
62
 
57
- > **从 dsh-DejaVu-memory(≤0.1.x)升级:** 已改名为 `dsh-dejavu-memory`,工具名 `DejaVu_*` → `noc_*`。删除旧插件后重新添加新包;更新提示词里所有 `DejaVu_*` 工具引用。
63
+ > **从 dsh-noc-memory(≤0.1.x)升级:** 已改名为 `dsh-dejavu-memory`,工具名 `noc_*` → `dejavu_*`。删除旧插件后重新添加新包;更新提示词里所有旧工具引用。
58
64
 
59
- ## 为什么叫 noc_*(不叫 DejaVu_*)?
65
+ ## 为什么叫 dejavu_*(不叫 noc_*)?
60
66
 
61
- 部分模型会先探测 `read_mcp_resource` 再调用记忆工具,浪费一次往返([上游 issue #32](https://github.com/Dataojitori/DejaVu_memory/issues/32))。工具列表与 boot 协议提示词里显式的 `noc_boot` / `noc_read` 命名,能把模型直接引导到正确工具——无需 resource 兼容层。
67
+ 部分模型会先探测 `read_mcp_resource` 再调用记忆工具,浪费一次往返([上游 issue #32](https://github.com/Dataojitori/nocturne_memory/issues/32))。工具列表与 boot 协议提示词里显式的 `dejavu_boot` / `dejavu_read` 命名,能把模型直接引导到正确工具——无需 resource 兼容层。
62
68
 
63
69
  ## License
64
70
 
@@ -67,5 +73,6 @@ MIT
67
73
  ## 相关
68
74
 
69
75
  - [DejaVu](https://github.com/RealAlexandreAI/DejaVu) — 本插件连接的 Cloudflare MCP 记忆服务器
76
+ - [dejavu-memory(ChatGPT / Codex 版)](https://github.com/RetiredPhysicist/openai-plugins/tree/main/plugins/dejavu-memory) — 同一个记忆服务器,另有可交互的知识图谱
70
77
  - [pi-dejavu-memory](https://github.com/RetiredPhysicist/pi-plugins/tree/main/packages/pi-dejavu-memory) — 面向 Pi 的同一套记忆工具
71
78
  - [DejaVu_memory](https://github.com/Dataojitori/DejaVu_memory) — 上游项目
package/cordis.patch.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # Plugin bundle for dsh-dejavu-memory.
2
- # Registers the DejaVu memory tools (noc_boot / read / search /
3
- # create / update / delete). Configure your own DejaVu MCP server:
2
+ # Registers the DejaVu memory tools (dejavu_boot / dejavu_read / dejavu_search /
3
+ # dejavu_create / dejavu_update / dejavu_delete). Configure your own DejaVu MCP server:
4
4
  #
5
5
  # - id: dejavu
6
6
  # name: 'dsh-dejavu-memory'
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Context } from '@deepseek-ai/cordis';
2
2
  import z from '@deepseek-ai/schemastery';
3
- export declare const name = "noc-memory";
3
+ export declare const name = "dejavu-memory";
4
4
  export declare const inject: string[];
5
5
  export interface Config {
6
6
  /** Noc MCP server URL, e.g. http://localhost:PORT/mcp. Optional at load
@@ -21,7 +21,7 @@ export declare function parseStreamResponse(text: string): any;
21
21
  export declare function extractText(data: any): string;
22
22
  /** Boot resources read via read_memory (boot + recent + triggers). */
23
23
  export declare const BOOT_URIS: readonly ["system://boot", "system://recent/5", "system://triggers"];
24
- /** MCP tool names as exposed by cf-noc-mem (must stay in sync with the server). */
24
+ /** MCP tool names as exposed by the DejaVu MCP server (must stay in sync with the server). */
25
25
  export declare const MCP_TOOLS: {
26
26
  readonly read: "read_memory";
27
27
  readonly search: "search_memory";
package/dist/index.js CHANGED
@@ -4,14 +4,14 @@
4
4
  // backed by YOUR OWN Noc MCP server (mcp_url). Ported from
5
5
  // pi-dejavu-memory — same MCP protocol, same boot protocol, same tools.
6
6
  //
7
- // Tools: noc_boot (session-start memory load), noc_read,
8
- // noc_search, noc_create, noc_update, noc_delete.
7
+ // Tools: dejavu_boot (session-start memory load), dejavu_read,
8
+ // dejavu_search, dejavu_create, dejavu_update, dejavu_delete.
9
9
  //
10
10
  // Privacy: memories live on your own MCP server; the plugin is a thin
11
11
  // client. The auth token comes from the plugin config (mcp_auth) — never logged.
12
12
  import z from '@deepseek-ai/schemastery';
13
13
  import { defineTool } from '@deepseek-ai/dsh-tools';
14
- export const name = 'noc-memory';
14
+ export const name = 'dejavu-memory';
15
15
  export const inject = ['tools', 'systemPrompt'];
16
16
  export const Config = z.object({
17
17
  mcp_url: z.string().description('Noc MCP server URL, e.g. http://localhost:PORT/mcp'),
@@ -58,7 +58,7 @@ export function extractText(data) {
58
58
  const REQUEST_TIMEOUT_MS = 30_000;
59
59
  /** Boot resources read via read_memory (boot + recent + triggers). */
60
60
  export const BOOT_URIS = ['system://boot', 'system://recent/5', 'system://triggers'];
61
- /** MCP tool names as exposed by cf-noc-mem (must stay in sync with the server). */
61
+ /** MCP tool names as exposed by the DejaVu MCP server (must stay in sync with the server). */
62
62
  export const MCP_TOOLS = {
63
63
  read: 'read_memory',
64
64
  search: 'search_memory', // not search_memories
@@ -173,23 +173,23 @@ class NocClient {
173
173
  }
174
174
  export function apply(ctx, config) {
175
175
  ctx.systemPrompt.section({
176
- name: 'tool:noc-memory',
176
+ name: 'tool:dejavu-memory',
177
177
  order: 2960,
178
178
  text: 'You have long-term memory via the Noc MCP server. At the start of ' +
179
- 'substantial work call noc_boot to load system://boot, system://recent/5, ' +
179
+ 'substantial work call dejavu_boot to load system://boot, system://recent/5, ' +
180
180
  'system://triggers, and best-effort system://briefing; then ' +
181
181
  'read system://focus to resume active working trees (recent is a briefing ' +
182
- 'subset — no need to re-read it after boot); use noc_search before ' +
182
+ 'subset — no need to re-read it after boot); use dejavu_search before ' +
183
183
  'answering from memory — describe what you need in natural language, not ' +
184
184
  'just keywords (semantic recall finds memories with no shared words); ' +
185
- 'persist valuable outcomes with noc_create; revise with noc_update; remove ' +
186
- 'dead nodes with noc_delete. ' +
185
+ 'persist valuable outcomes with dejavu_create; revise with dejavu_update; remove ' +
186
+ 'dead nodes with dejavu_delete. ' +
187
187
  'Periodically (after many new memories or when you repeat a mistake) ' +
188
- 'run a memory audit: noc_read system://diagnostic/noc, then fix what it ' +
188
+ 'run a memory audit: dejavu_read system://diagnostic/dejavu, then fix what it ' +
189
189
  'flags — never-reaccessed high-priority memories (disclosure/placement), ' +
190
- 'stale or cold candidates (noc_delete if dead, demote if niche), crowded ' +
191
- 'parents (regroup), contradictions (merge via noc_update). Always ' +
192
- 'noc_read a node in full before changing it.',
190
+ 'stale or cold candidates (dejavu_delete if dead, demote if niche), crowded ' +
191
+ 'parents (regroup), contradictions (merge via dejavu_update). Always ' +
192
+ 'dejavu_read a node in full before changing it.',
193
193
  });
194
194
  const resolveAuth = async () => config.mcp_auth ?? '';
195
195
  // One client per plugin instance: the MCP session (initialize handshake +
@@ -211,7 +211,7 @@ export function apply(ctx, config) {
211
211
  ctx.tools.register(defineTool(tool));
212
212
  };
213
213
  register({
214
- name: 'noc_boot',
214
+ name: 'dejavu_boot',
215
215
  description: 'Call at session start. Loads core memories, recent context, triggers ' +
216
216
  '(system://triggers), and today\'s working-memory briefing. Self-discipline startup protocol.',
217
217
  parameters: {},
@@ -221,8 +221,8 @@ export function apply(ctx, config) {
221
221
  presentationMeta: () => ({ action: 'boot' }),
222
222
  },
223
223
  isConcurrencySafe: () => true,
224
- presentCall: presentCallFor('noc_boot', () => 'load core + recent + triggers + briefing'),
225
- presentResult: presentResultFor('noc_boot'),
224
+ presentCall: presentCallFor('dejavu_boot', () => 'load boot + recent + triggers + briefing'),
225
+ presentResult: presentResultFor('dejavu_boot'),
226
226
  async execute(_args, _exec) {
227
227
  const c = await client();
228
228
  const out = [];
@@ -248,10 +248,10 @@ export function apply(ctx, config) {
248
248
  },
249
249
  });
250
250
  register({
251
- name: 'noc_read',
252
- description: 'Read a memory by URI. Use system:// URIs or memory paths like core://agent.',
251
+ name: 'dejavu_read',
252
+ description: 'Read a memory by URI. Use system:// URIs or memory paths like dejavu://agent.',
253
253
  parameters: {
254
- uri: { type: 'string', required: true, description: 'Memory URI (e.g., core://agent, system://boot)' },
254
+ uri: { type: 'string', required: true, description: 'Memory URI (e.g., dejavu://agent, system://boot)' },
255
255
  },
256
256
  output: {
257
257
  schema: { type: 'string' },
@@ -259,8 +259,8 @@ export function apply(ctx, config) {
259
259
  presentationMeta: (args) => ({ action: 'read', uri: args.uri ?? '' }),
260
260
  },
261
261
  isConcurrencySafe: () => true,
262
- presentCall: presentCallFor('noc_read', (args) => args.uri),
263
- presentResult: presentResultFor('noc_read'),
262
+ presentCall: presentCallFor('dejavu_read', (args) => args.uri),
263
+ presentResult: presentResultFor('dejavu_read'),
264
264
  async execute(args, _exec) {
265
265
  const c = await client();
266
266
  const data = await c.call('tools/call', { name: MCP_TOOLS.read, arguments: { uri: args.uri } });
@@ -268,14 +268,14 @@ export function apply(ctx, config) {
268
268
  },
269
269
  });
270
270
  register({
271
- name: 'noc_search',
271
+ name: 'dejavu_search',
272
272
  description: 'Search memories with semantic + keyword recall (multilingual, CJK-capable). ' +
273
273
  'Describe what you are looking for in natural language — semantic search finds ' +
274
274
  'memories that share no keywords (e.g. query "部署失败" recalls a note about a broken release pipeline).',
275
275
  parameters: {
276
276
  query: { type: 'string', required: true, description: 'Concept or keywords to search for' },
277
277
  limit: { type: 'number', description: 'Max results (1-50, default 20)' },
278
- domain: { type: 'string', description: 'Domain filter (e.g., core, writer); ignored by current cf-noc-mem' },
278
+ domain: { type: 'string', description: 'Domain filter (e.g., dejavu); ignored by the current DejaVu server' },
279
279
  },
280
280
  output: {
281
281
  schema: { type: 'string' },
@@ -283,8 +283,8 @@ export function apply(ctx, config) {
283
283
  presentationMeta: (args) => ({ action: 'search', query: args.query ?? '' }),
284
284
  },
285
285
  isConcurrencySafe: () => true,
286
- presentCall: presentCallFor('noc_search', (args) => args.query),
287
- presentResult: presentResultFor('noc_search'),
286
+ presentCall: presentCallFor('dejavu_search', (args) => args.query),
287
+ presentResult: presentResultFor('dejavu_search'),
288
288
  async execute(args, _exec) {
289
289
  const c = await client();
290
290
  const arguments_ = { query: args.query };
@@ -300,10 +300,10 @@ export function apply(ctx, config) {
300
300
  },
301
301
  });
302
302
  register({
303
- name: 'noc_create',
303
+ name: 'dejavu_create',
304
304
  description: 'Create a new memory node. Include [Baseline], [Deviation], [Result], [Reusable judgment] for behavior records.',
305
305
  parameters: {
306
- parent_uri: { type: 'string', required: true, description: 'Parent URI (e.g., core://)' },
306
+ parent_uri: { type: 'string', required: true, description: 'Parent URI (e.g., dejavu://)' },
307
307
  content: { type: 'string', required: true, description: 'Memory content (Markdown supported)' },
308
308
  priority: { type: 'number', description: 'Priority (0=highest, default 2)' },
309
309
  disclosure: { type: 'string', required: true, description: "When to recall this memory (e.g., 'When discussing X')" },
@@ -315,8 +315,8 @@ export function apply(ctx, config) {
315
315
  presentationMeta: (args) => ({ action: 'create', parent_uri: args.parent_uri ?? '', title: args.title ?? '' }),
316
316
  },
317
317
  isConcurrencySafe: () => true,
318
- presentCall: presentCallFor('noc_create', (args) => args.title ?? args.parent_uri),
319
- presentResult: presentResultFor('noc_create'),
318
+ presentCall: presentCallFor('dejavu_create', (args) => args.title ?? args.parent_uri),
319
+ presentResult: presentResultFor('dejavu_create'),
320
320
  async execute(args, _exec) {
321
321
  const c = await client();
322
322
  const data = await c.call('tools/call', {
@@ -333,9 +333,9 @@ export function apply(ctx, config) {
333
333
  },
334
334
  });
335
335
  register({
336
- name: 'noc_update',
336
+ name: 'dejavu_update',
337
337
  description: 'Update existing memory. Supports full content replace, old_string/new_string patch, or append. ' +
338
- 'Must noc_read the URI first. Optional relation marks knowledge evolution: replace|enrich|confirm|challenge.',
338
+ 'Must dejavu_read the URI first. Optional relation marks knowledge evolution: replace|enrich|confirm|challenge.',
339
339
  parameters: {
340
340
  uri: { type: 'string', required: true, description: 'Memory URI to update' },
341
341
  content: { type: 'string', description: 'Full replacement content' },
@@ -357,8 +357,8 @@ export function apply(ctx, config) {
357
357
  presentationMeta: (args) => ({ action: 'update', uri: args.uri ?? '' }),
358
358
  },
359
359
  isConcurrencySafe: () => true,
360
- presentCall: presentCallFor('noc_update', (args) => args.uri),
361
- presentResult: presentResultFor('noc_update'),
360
+ presentCall: presentCallFor('dejavu_update', (args) => args.uri),
361
+ presentResult: presentResultFor('dejavu_update'),
362
362
  async execute(args, _exec) {
363
363
  const c = await client();
364
364
  const arguments_ = { uri: args.uri };
@@ -386,8 +386,8 @@ export function apply(ctx, config) {
386
386
  },
387
387
  });
388
388
  register({
389
- name: 'noc_delete',
390
- description: 'Delete a memory by URI (cuts its path). Always noc_read the full node first. ' +
389
+ name: 'dejavu_delete',
390
+ description: 'Delete a memory by URI (cuts its path). Always dejavu_read the full node first. ' +
391
391
  'If the node has children, the server may return orphans to handle first.',
392
392
  parameters: {
393
393
  uri: { type: 'string', required: true, description: 'Memory URI to delete' },
@@ -398,8 +398,8 @@ export function apply(ctx, config) {
398
398
  presentationMeta: (args) => ({ action: 'delete', uri: args.uri ?? '' }),
399
399
  },
400
400
  isConcurrencySafe: () => true,
401
- presentCall: presentCallFor('noc_delete', (args) => args.uri),
402
- presentResult: presentResultFor('noc_delete'),
401
+ presentCall: presentCallFor('dejavu_delete', (args) => args.uri),
402
+ presentResult: presentResultFor('dejavu_delete'),
403
403
  async execute(args, _exec) {
404
404
  const c = await client();
405
405
  const data = await c.call('tools/call', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-dejavu-memory",
3
- "version": "0.4.7",
3
+ "version": "0.5.0",
4
4
  "description": "DeepSeek Harness plugin: DejaVu memory client \u2014 automated long-term memory (boot/read/search/create/update/delete) backed by your own DejaVu MCP server.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",