dsh-dejavu-memory 0.5.4 → 0.5.5
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 +7 -14
- package/README.zh.md +7 -11
- package/cordis.patch.yml +3 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.js +17 -14
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -4,21 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
# dsh-dejavu-memory
|
|
6
6
|
|
|
7
|
-
> **Renamed:** former npm/GitHub package `dsh-noc-memory` → **`dsh-dejavu-memory`**. Prefer this package; deprecate the old name when publishing.
|
|
8
|
-
|
|
9
|
-
|
|
10
7
|
Connects DeepSeek Harness to **DejaVu**: session-start boot + daily briefing, plus memory read / search / create / update / delete, backed by your own DejaVu MCP server on Cloudflare.
|
|
11
8
|
|
|
12
9
|
> Port of [pi-dejavu-memory](https://github.com/RetiredPhysicist/pi-plugins/tree/main/packages/pi-dejavu-memory) — same protocol, same tool names.
|
|
13
10
|
|
|
14
|
-
|
|
11
|
+
The [OpenAI/Codex plugin](https://github.com/RetiredPhysicist/openai-plugins/tree/main/plugins/dejavu-memory) is the only client that opens the interactive memory graph. dsh uses the same server through tools only, with no graph UI and no user-facing MCP setup.
|
|
15
12
|
|
|
16
13
|
<p align="center">
|
|
17
|
-
<img src="assets/readme/dejavu-memory-graph.webp" width="100%" alt="The DejaVu Memory plugin
|
|
14
|
+
<img src="assets/readme/dejavu-memory-graph.webp" width="100%" alt="The OpenAI/Codex DejaVu Memory plugin showing the memory tree as an interactive graph">
|
|
18
15
|
</p>
|
|
19
16
|
|
|
20
17
|
<p align="center">
|
|
21
|
-
<img src="assets/readme/dejavu-memory-inspector.webp" width="100%" alt="
|
|
18
|
+
<img src="assets/readme/dejavu-memory-inspector.webp" width="100%" alt="The OpenAI/Codex DejaVu Memory plugin inspector showing a node, its metadata, body text, and subtree">
|
|
22
19
|
</p>
|
|
23
20
|
|
|
24
21
|
[English](README.md) · [中文](README.zh.md)
|
|
@@ -40,7 +37,7 @@ There is also a **ChatGPT and Codex plugin**, [dejavu-memory](https://github.com
|
|
|
40
37
|
dsh plugin --profile web add dsh-dejavu-memory
|
|
41
38
|
```
|
|
42
39
|
|
|
43
|
-
Requires your own DejaVu server
|
|
40
|
+
Requires your own DejaVu MCP server on Cloudflare.
|
|
44
41
|
|
|
45
42
|
```yaml
|
|
46
43
|
- id: dejavu
|
|
@@ -68,11 +65,9 @@ For a server behind Cloudflare Access (e.g. dejavu.example.com), use the **servi
|
|
|
68
65
|
| `mcp_auth` | no | legacy; prefer `mcp_headers` for Cloudflare Access service token |
|
|
69
66
|
| `mcp_headers` | no | extra headers merged into every MCP request (e.g. Cloudflare Access service token) |
|
|
70
67
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
## Why dejavu_* (not noc_*)?
|
|
68
|
+
## Tool naming
|
|
74
69
|
|
|
75
|
-
|
|
70
|
+
The `dejavu_boot` / `dejavu_read` prefixes make the memory tools explicit in the tool list and in the boot protocol, so agents call them directly instead of probing for a generic resource first.
|
|
76
71
|
|
|
77
72
|
## License
|
|
78
73
|
|
|
@@ -80,7 +75,5 @@ MIT
|
|
|
80
75
|
|
|
81
76
|
## Related
|
|
82
77
|
|
|
83
|
-
- [
|
|
84
|
-
- [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
|
|
78
|
+
- [dejavu-memory for ChatGPT and Codex](https://github.com/RetiredPhysicist/openai-plugins/tree/main/plugins/dejavu-memory) — same memory server, with the interactive graph UI
|
|
85
79
|
- [pi-dejavu-memory](https://github.com/RetiredPhysicist/pi-plugins/tree/main/packages/pi-dejavu-memory) — same memory tools for Pi
|
|
86
|
-
- [DejaVu_memory](https://github.com/Dataojitori/DejaVu_memory) — upstream project
|
package/README.zh.md
CHANGED
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
|
|
9
9
|
> 由 [pi-dejavu-memory](https://github.com/RetiredPhysicist/pi-plugins/tree/main/packages/pi-dejavu-memory) 移植,协议与工具名完全一致。
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
可交互的记忆图只由 [OpenAI/Codex 插件](https://github.com/RetiredPhysicist/openai-plugins/tree/main/plugins/dejavu-memory) 打开。dsh 通过同一服务的工具接入,没有图界面,也不需要让最终用户手工配 MCP。
|
|
12
12
|
|
|
13
13
|
<p align="center">
|
|
14
|
-
<img src="assets/readme/dejavu-memory-graph.webp" width="100%" alt="Codex
|
|
14
|
+
<img src="assets/readme/dejavu-memory-graph.webp" width="100%" alt="OpenAI/Codex 的 DejaVu Memory 插件:整棵记忆树的可交互图,节点按类型着色、按优先级决定大小">
|
|
15
15
|
</p>
|
|
16
16
|
|
|
17
17
|
<p align="center">
|
|
18
|
-
<img src="assets/readme/dejavu-memory-inspector.webp" width="100%" alt="
|
|
18
|
+
<img src="assets/readme/dejavu-memory-inspector.webp" width="100%" alt="OpenAI/Codex 的 DejaVu Memory 插件选中节点后的详情面板:记忆 URI、类型、优先级、正文和子树">
|
|
19
19
|
</p>
|
|
20
20
|
|
|
21
21
|
[English](README.md) · [中文](README.zh.md)
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
dsh plugin --profile web add dsh-dejavu-memory
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
需要你能连到自己的 DejaVu
|
|
40
|
+
需要你能连到自己的 DejaVu MCP 服务器。
|
|
41
41
|
|
|
42
42
|
```yaml
|
|
43
43
|
- id: dejavu
|
|
@@ -64,11 +64,9 @@ dsh plugin --profile web add dsh-dejavu-memory
|
|
|
64
64
|
| `mcp_url` | 是 | 你的 DejaVu MCP 端点(Streamable HTTP) |
|
|
65
65
|
| `mcp_auth` | 否 | 遗留字段;优先用 `mcp_headers` 传 Cloudflare Access service token |
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
## 工具命名
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
部分模型会先探测 `read_mcp_resource` 再调用记忆工具,浪费一次往返([上游 issue #32](https://github.com/Dataojitori/nocturne_memory/issues/32))。工具列表与 boot 协议提示词里显式的 `dejavu_boot` / `dejavu_read` 命名,能把模型直接引导到正确工具——无需 resource 兼容层。
|
|
69
|
+
`dejavu_boot` / `dejavu_read` 前缀让记忆工具在工具列表和 boot 协议里含义明确,模型会直接调用,无需先探测通用 resource。
|
|
72
70
|
|
|
73
71
|
## License
|
|
74
72
|
|
|
@@ -76,7 +74,5 @@ MIT
|
|
|
76
74
|
|
|
77
75
|
## 相关
|
|
78
76
|
|
|
79
|
-
- [
|
|
80
|
-
- [dejavu-memory(ChatGPT / Codex 版)](https://github.com/RetiredPhysicist/openai-plugins/tree/main/plugins/dejavu-memory) — 同一个记忆服务器,另有可交互的知识图谱
|
|
77
|
+
- [dejavu-memory(ChatGPT / Codex 版)](https://github.com/RetiredPhysicist/openai-plugins/tree/main/plugins/dejavu-memory) — 同一个记忆服务器,另有可交互的图界面
|
|
81
78
|
- [pi-dejavu-memory](https://github.com/RetiredPhysicist/pi-plugins/tree/main/packages/pi-dejavu-memory) — 面向 Pi 的同一套记忆工具
|
|
82
|
-
- [DejaVu_memory](https://github.com/Dataojitori/DejaVu_memory) — 上游项目
|
package/cordis.patch.yml
CHANGED
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
# name: 'dsh-dejavu-memory'
|
|
7
7
|
# config:
|
|
8
8
|
# mcp_url: http://localhost:PORT/mcp
|
|
9
|
-
#
|
|
9
|
+
# mcp_headers:
|
|
10
|
+
# CF-Access-Client-Id: <client id>
|
|
11
|
+
# CF-Access-Client-Secret: <client secret>
|
|
10
12
|
- insert:
|
|
11
13
|
- id: dejavu
|
|
12
14
|
name: 'dsh-dejavu-memory'
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import z from '@deepseek-ai/schemastery';
|
|
|
3
3
|
export declare const name = "dejavu-memory";
|
|
4
4
|
export declare const inject: string[];
|
|
5
5
|
export interface Config {
|
|
6
|
-
/**
|
|
6
|
+
/** DejaVu MCP server URL, e.g. http://localhost:PORT/mcp. Optional at load
|
|
7
7
|
* time — a missing server surfaces as a setup hint on tool calls so the
|
|
8
8
|
* plugin still loads in a bare profile. */
|
|
9
9
|
mcp_url?: string;
|
|
@@ -20,13 +20,13 @@ export declare const Config: z<Config>;
|
|
|
20
20
|
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
|
-
export declare const BOOT_URIS: readonly [
|
|
23
|
+
export declare const BOOT_URIS: readonly ['system://boot', 'system://recent/5', 'system://triggers'];
|
|
24
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
|
-
readonly read:
|
|
27
|
-
readonly search:
|
|
28
|
-
readonly create:
|
|
29
|
-
readonly update:
|
|
30
|
-
readonly delete:
|
|
26
|
+
readonly read: 'read_memory';
|
|
27
|
+
readonly search: 'search_memory';
|
|
28
|
+
readonly create: 'create_memory';
|
|
29
|
+
readonly update: 'update_memory';
|
|
30
|
+
readonly delete: 'delete_memory';
|
|
31
31
|
};
|
|
32
32
|
export declare function apply(ctx: Context, config: Config): void;
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// dsh-memory — DeepSeek Harness (Cordis) plugin.
|
|
2
2
|
//
|
|
3
|
-
//
|
|
4
|
-
// backed by YOUR OWN
|
|
3
|
+
// DejaVu Memory client: automated long-term memory for the agent,
|
|
4
|
+
// backed by YOUR OWN DejaVu MCP server (mcp_url). Ported from
|
|
5
5
|
// pi-dejavu-memory — same MCP protocol, same boot protocol, same tools.
|
|
6
6
|
//
|
|
7
7
|
// Tools: dejavu_boot (session-start memory load), dejavu_read,
|
|
@@ -13,8 +13,9 @@ import z from '@deepseek-ai/schemastery';
|
|
|
13
13
|
import { defineTool } from '@deepseek-ai/dsh-tools';
|
|
14
14
|
export const name = 'dejavu-memory';
|
|
15
15
|
export const inject = ['tools', 'systemPrompt'];
|
|
16
|
+
const PLUGIN_VERSION = '0.5.5';
|
|
16
17
|
export const Config = z.object({
|
|
17
|
-
mcp_url: z.string().description('
|
|
18
|
+
mcp_url: z.string().description('DejaVu MCP server URL, e.g. http://localhost:PORT/mcp'),
|
|
18
19
|
mcp_auth: z.string().description('MCP auth token (Authorization header value, e.g. "Bearer xxx")'),
|
|
19
20
|
mcp_headers: z.dict(z.string()).description('Extra headers merged into every MCP request (e.g. Cloudflare Access service token)'),
|
|
20
21
|
protocol_version: z.string().description('MCP protocol version (default 2024-11-05)'),
|
|
@@ -89,7 +90,7 @@ function isMissingSession(parsed) {
|
|
|
89
90
|
const message = String(parsed?.error?.message ?? '').toLowerCase();
|
|
90
91
|
return code === -32600 || message.includes('session');
|
|
91
92
|
}
|
|
92
|
-
class
|
|
93
|
+
class DejaVuClient {
|
|
93
94
|
url;
|
|
94
95
|
auth;
|
|
95
96
|
protocolVersion;
|
|
@@ -130,7 +131,7 @@ class NocClient {
|
|
|
130
131
|
const resp = await this.fetchRaw('initialize', {
|
|
131
132
|
protocolVersion: this.protocolVersion,
|
|
132
133
|
capabilities: {},
|
|
133
|
-
clientInfo: { name: 'dsh-memory', version:
|
|
134
|
+
clientInfo: { name: 'dsh-dejavu-memory', version: PLUGIN_VERSION },
|
|
134
135
|
});
|
|
135
136
|
if (!resp.ok)
|
|
136
137
|
return null;
|
|
@@ -175,21 +176,23 @@ export function apply(ctx, config) {
|
|
|
175
176
|
ctx.systemPrompt.section({
|
|
176
177
|
name: 'tool:dejavu-memory',
|
|
177
178
|
order: 2960,
|
|
178
|
-
text: 'You have long-term memory via the
|
|
179
|
+
text: 'You have long-term memory via the DejaVu MCP server. At the start of ' +
|
|
179
180
|
'substantial work call dejavu_boot to load system://boot, system://recent/5, ' +
|
|
180
181
|
'system://triggers, and best-effort system://briefing; then ' +
|
|
181
182
|
'read system://focus to resume active working trees (recent is a briefing ' +
|
|
182
|
-
'subset — no need to re-read it after boot)
|
|
183
|
-
'answering from memory
|
|
183
|
+
'subset — no need to re-read it after boot). Use dejavu_search before ' +
|
|
184
|
+
'answering from memory or when the task topic changes; describe what you need in natural language, not ' +
|
|
184
185
|
'just keywords (semantic recall finds memories with no shared words); ' +
|
|
185
|
-
'persist
|
|
186
|
-
'dead nodes with dejavu_delete. ' +
|
|
186
|
+
'read before writing, persist durable outcomes with dejavu_create, ' +
|
|
187
|
+
'revise with dejavu_update, and remove dead nodes with dejavu_delete. ' +
|
|
188
|
+
'Prefer dejavu_update when the topic already exists because URI is identity. ' +
|
|
187
189
|
'Periodically (after many new memories or when you repeat a mistake) ' +
|
|
188
190
|
'run a memory audit: dejavu_read system://diagnostic/dejavu, then fix what it ' +
|
|
189
191
|
'flags — never-reaccessed high-priority memories (disclosure/placement), ' +
|
|
190
192
|
'stale or cold candidates (dejavu_delete if dead, demote if niche), crowded ' +
|
|
191
|
-
'parents (regroup), contradictions (merge via dejavu_update).
|
|
192
|
-
'dejavu_read a node in full before changing it.'
|
|
193
|
+
'parents (regroup), contradictions (merge via dejavu_update). Never keep two conflicting versions. ' +
|
|
194
|
+
'Always dejavu_read a node in full before changing or deleting it. ' +
|
|
195
|
+
'The interactive memory graph belongs to the OpenAI/Codex plugin, not dsh.',
|
|
193
196
|
});
|
|
194
197
|
const resolveAuth = async () => config.mcp_auth ?? '';
|
|
195
198
|
// One client per plugin instance: the MCP session (initialize handshake +
|
|
@@ -200,9 +203,9 @@ export function apply(ctx, config) {
|
|
|
200
203
|
if (!cachedClient) {
|
|
201
204
|
cachedClient = (async () => {
|
|
202
205
|
if (!config.mcp_url) {
|
|
203
|
-
throw new Error('
|
|
206
|
+
throw new Error('DejaVu MCP server not configured — set mcp_url in the plugin config (e.g. http://localhost:PORT/mcp)');
|
|
204
207
|
}
|
|
205
|
-
return new
|
|
208
|
+
return new DejaVuClient(config.mcp_url, await resolveAuth(), config.protocol_version ?? '2024-11-05', config.mcp_headers ?? {});
|
|
206
209
|
})();
|
|
207
210
|
}
|
|
208
211
|
return cachedClient;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-dejavu-memory",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.5",
|
|
4
4
|
"description": "DeepSeek Harness plugin: DejaVu memory client — 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",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"@deepseek-ai/schemastery": "~3.18.5"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@types/node": "^
|
|
39
|
-
"tsx": "^4.
|
|
40
|
-
"typescript": "^
|
|
38
|
+
"@types/node": "^26.6.5",
|
|
39
|
+
"tsx": "^4.23.15",
|
|
40
|
+
"typescript": "^7.0.2"
|
|
41
41
|
},
|
|
42
42
|
"dsh": {
|
|
43
43
|
"manifestVersion": 1,
|
|
@@ -51,6 +51,6 @@
|
|
|
51
51
|
"directory": "packages/dsh-dejavu-memory"
|
|
52
52
|
},
|
|
53
53
|
"engines": {
|
|
54
|
-
"node": ">=
|
|
54
|
+
"node": ">=26"
|
|
55
55
|
}
|
|
56
56
|
}
|