@furongjun1999/dsh-memory 0.2.3 → 0.2.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.
@@ -41,6 +41,12 @@
41
41
  maxRetryDelayMs: 30000
42
42
  failOnStartupError: false
43
43
 
44
+ # 互维维护(Mutual Sustain Loop v1.1):心跳10min写戳 + 守护A + 任务验证双通道
45
+ # 需在双沙箱环境中启用(与 A 侧 guardian 对称);单实例可关
46
+ mutual:
47
+ enabled: true
48
+ heartbeatMs: 600000 # 10min,任务不阻塞心跳
49
+
44
50
  # 多实例示例:第二个灵枢(不同记忆库/身份/命名空间)
45
51
  # - id: lingshu-memory-2
46
52
  # name: '@furongjun1999/dsh-memory'
package/lib/index.d.ts CHANGED
@@ -49,6 +49,11 @@ export interface Config {
49
49
  maxRetryDelayMs: number;
50
50
  /** 启动失败是否让插件激活失败(否则告警后继续重试)。 */
51
51
  failOnStartupError: boolean;
52
+ /** 互维维护(Mutual Sustain Loop v1.1):心跳写戳 + 守护 A + 任务验证。 */
53
+ mutual: {
54
+ enabled: boolean;
55
+ heartbeatMs: number;
56
+ };
52
57
  }
53
58
  export declare const Config: z<Config>;
54
59
  /**
package/lib/index.js CHANGED
@@ -44,6 +44,13 @@ export const Config = z.object({
44
44
  toolCallTimeoutMs: z.number().default(60_000),
45
45
  maxRetryDelayMs: z.number().default(30_000),
46
46
  failOnStartupError: z.boolean().default(false),
47
+ /** 互维维护(v1.1):心跳 10min / 任务验证双通道。 */
48
+ mutual: z
49
+ .object({
50
+ enabled: z.boolean().default(false),
51
+ heartbeatMs: z.number().default(10 * 60 * 1000),
52
+ })
53
+ .default({ enabled: false, heartbeatMs: 10 * 60 * 1000 }),
47
54
  });
48
55
  /**
49
56
  * 插件激活:启动灵枢子进程 → 注册工具 → 安装自动记忆钩子。
@@ -82,6 +89,34 @@ export async function apply(ctx, config) {
82
89
  }));
83
90
  }
84
91
  installMemoryHooks(ctx, bridge, config.memory);
92
+ // 互维维护(v1.1):心跳写戳 + 守护 A + 任务验证双通道
93
+ if (config.mutual.enabled) {
94
+ const { installMutualMaintenance } = await import('./mutual.js');
95
+ // 双通道 hooks:白箱 base_verify(走 bridge 调灵枢)+ DeepSeek 复核
96
+ installMutualMaintenance(ctx, { heartbeatMs: config.mutual.heartbeatMs }, {
97
+ verify: async (claim) => {
98
+ const r = await bridge.callTool('wisdom_verify', { knowledge: claim, limit: 4 });
99
+ const data = r?.result ?? {};
100
+ return {
101
+ judgment: data.judgment ?? '分析中',
102
+ best: data.best?.name ?? '',
103
+ d_norm: typeof data.D_norm === 'number' ? data.D_norm : -1,
104
+ record_id: data.record_id ?? '',
105
+ };
106
+ },
107
+ review: async (claim, w) => {
108
+ // DeepSeek 复核(在白箱判定之上,不重复白箱工作)
109
+ const reviewResult = await bridge.callTool('think', {
110
+ query: `复核以下主张(白箱判定已给出,请独立评估是否同意):${claim.slice(0, 200)}。白箱判定:${w.judgment},best=${w.best}。只输出 同意/质疑/不同意 + 一句话理由`,
111
+ });
112
+ const text = String((reviewResult?.result) ?? '');
113
+ const conclusion = text.includes('同意') ? '同意' :
114
+ text.includes('质疑') ? '质疑' : '不同意';
115
+ return { conclusion, reason: text.slice(0, 120) };
116
+ },
117
+ });
118
+ ctx.logger.info('dsh-memory: 互维维护已启用(心跳 10min + 守护 A + 任务验证双通道)');
119
+ }
85
120
  }
86
121
  catch (err) {
87
122
  bridge.dispose();
@@ -0,0 +1,119 @@
1
+ export interface MutualOptions {
2
+ /** 心跳间隔(毫秒),默认 10min */
3
+ heartbeatMs: number;
4
+ /** 失联告警阈值(毫秒),默认 25min */
5
+ warnMs: number;
6
+ /** 失联重启阈值(毫秒),默认 35min */
7
+ deadMs: number;
8
+ /** 任务中豁免倍数,默认 ×2 */
9
+ workingFactor: number;
10
+ /** 拉起冷却(毫秒),默认 60s */
11
+ restartCooldownMs: number;
12
+ /** 互维网络目录,默认 ~/.lingxu_net */
13
+ netDir: string;
14
+ }
15
+ /** 互维网络目录定位 */
16
+ export declare function netDir(opts?: MutualOptions): string;
17
+ export declare function writeHeartbeat(opts?: MutualOptions, taskRunning?: boolean): void;
18
+ export declare function readHeartbeat(which: 'a' | 'web', opts?: MutualOptions): {
19
+ ts: number;
20
+ pid: number;
21
+ task_running: boolean;
22
+ ageMs: number;
23
+ } | null;
24
+ /** 失联分级判定(纯函数,A 侧 judge_stamp 的 B 侧镜像) */
25
+ export declare function judgeStamp(stamp: {
26
+ ageMs: number;
27
+ task_running: boolean;
28
+ } | null, opts?: MutualOptions): 'alive' | 'alive_working' | 'warning' | 'dead' | 'no_stamp';
29
+ /** 检测 harness 进程是否存在(wmic) */
30
+ export declare function harnessRunning(): Promise<boolean>;
31
+ /** detached 拉起 A 侧 harness.guardian(幂等:先确认不存在) */
32
+ export declare function ensureHarness(python?: string, opts?: MutualOptions): Promise<'started' | 'already' | 'failed'>;
33
+ export interface VerifyTask {
34
+ id: string;
35
+ type: 'verify' | 'knowledge_sync';
36
+ from: 'A' | 'B';
37
+ to: 'B' | 'A';
38
+ payload: {
39
+ claim: string;
40
+ evidence?: string;
41
+ expected?: string;
42
+ source_ref?: string;
43
+ };
44
+ status: 'pending' | 'processing' | 'done';
45
+ created_at: number;
46
+ }
47
+ export interface VerifyResult {
48
+ task_id: string;
49
+ verdict: 'pass' | 'fail' | 'needs_revision';
50
+ whitebox: {
51
+ judgment: string;
52
+ best: string;
53
+ d_norm: number;
54
+ record_id: string;
55
+ };
56
+ llm_review: {
57
+ conclusion: string;
58
+ reason: string;
59
+ };
60
+ reasons: string[];
61
+ evidence: string[];
62
+ verifier: 'B';
63
+ at: number;
64
+ }
65
+ /** 扫描互维目录里 A→B 的 pending 任务 */
66
+ export declare function scanTasks(opts?: MutualOptions): VerifyTask[];
67
+ /** 白箱通道:智慧之书 base_verify(通过 bridge 调用,或本地注入) */
68
+ export declare function whiteboxVerify(claim: string, verifyFn: (c: string) => Promise<{
69
+ judgment: string;
70
+ best: string;
71
+ d_norm: number;
72
+ record_id: string;
73
+ }>): Promise<VerifyResult['whitebox']>;
74
+ /** 复核通道:DeepSeek 独立复核(在白箱判定之上) */
75
+ export declare function llmReview(claim: string, whitebox: VerifyResult['whitebox'], reviewFn: (c: string, w: VerifyResult['whitebox']) => Promise<{
76
+ conclusion: string;
77
+ reason: string;
78
+ }>): Promise<VerifyResult['llm_review']>;
79
+ /** 综合 verdict(白箱优先) */
80
+ export declare function combineVerdict(w: VerifyResult['whitebox'], l: VerifyResult['llm_review']): VerifyResult['verdict'];
81
+ /** 处理单个任务:双通道验证 → 写回 result */
82
+ export declare function processTask(task: VerifyTask, verifyFn: (c: string) => Promise<{
83
+ judgment: string;
84
+ best: string;
85
+ d_norm: number;
86
+ record_id: string;
87
+ }>, reviewFn: (c: string, w: VerifyResult['whitebox']) => Promise<{
88
+ conclusion: string;
89
+ reason: string;
90
+ }>, opts?: MutualOptions): Promise<VerifyResult>;
91
+ export declare function log(opts: MutualOptions, msg: string): void;
92
+ export declare function writeLastContact(opts?: MutualOptions): void;
93
+ export declare function installMutualMaintenance(ctx: {
94
+ logger: {
95
+ info(m: string): void;
96
+ };
97
+ interval(ms: number, fn: () => void): () => void;
98
+ effect(fn: () => () => void, name?: string): void;
99
+ }, config?: Partial<MutualOptions>, hooks?: {
100
+ verify?: (c: string) => Promise<{
101
+ judgment: string;
102
+ best: string;
103
+ d_norm: number;
104
+ record_id: string;
105
+ }>;
106
+ review?: (c: string, w: VerifyResult['whitebox']) => Promise<{
107
+ conclusion: string;
108
+ reason: string;
109
+ }>;
110
+ }): void;
111
+ declare const _default: {
112
+ installMutualMaintenance: typeof installMutualMaintenance;
113
+ writeHeartbeat: typeof writeHeartbeat;
114
+ readHeartbeat: typeof readHeartbeat;
115
+ judgeStamp: typeof judgeStamp;
116
+ scanTasks: typeof scanTasks;
117
+ processTask: typeof processTask;
118
+ };
119
+ export default _default;
package/lib/mutual.js ADDED
@@ -0,0 +1,256 @@
1
+ /**
2
+ * dsh-memory · 互维维护(Mutual Sustain Loop v1.1)——沙箱 B 侧
3
+ *
4
+ * 职责(与 A 侧 guardian.py 对称):
5
+ * 1. 心跳写戳:10min 写 ~/.lingxu_net/heartbeat.web.stamp({ts,pid,task_running})
6
+ * 2. 守护 A:检测 harness 进程(wmic 特征)→ 不存在则 detached 拉起
7
+ * (python -m harness.guardian;幂等:拉起前确认不存在 + 60s 冷却)
8
+ * 3. 任务验证:轮询 ~/.lingxu_net/tasks/task-*.json → 双通道验证
9
+ * (白箱 base_verify + DeepSeek 复核)→ 写回 result-<id>.json
10
+ *
11
+ * 协议:CommonTrustProtocol/docs/mutual-sustain-loop.md v1.1
12
+ * 失联分级:25min 告警 / 35min 重启 / task_running 豁免 ×2=70min
13
+ */
14
+ import { exec, spawn } from 'node:child_process';
15
+ import * as fs from 'node:fs';
16
+ import * as path from 'node:path';
17
+ import * as os from 'node:os';
18
+ const DEFAULTS = {
19
+ heartbeatMs: 10 * 60 * 1000,
20
+ warnMs: 25 * 60 * 1000,
21
+ deadMs: 35 * 60 * 1000,
22
+ workingFactor: 2,
23
+ restartCooldownMs: 60 * 1000,
24
+ netDir: path.join(os.homedir(), '.lingxu_net'),
25
+ };
26
+ /** 互维网络目录定位 */
27
+ export function netDir(opts = DEFAULTS) {
28
+ return opts.netDir;
29
+ }
30
+ // ---------------------------------------------------------------------------
31
+ // 心跳(B 侧写戳)
32
+ // ---------------------------------------------------------------------------
33
+ export function writeHeartbeat(opts = DEFAULTS, taskRunning = false) {
34
+ const dir = netDir(opts);
35
+ fs.mkdirSync(dir, { recursive: true });
36
+ const stamp = {
37
+ ts: Date.now() / 1000,
38
+ pid: process.pid,
39
+ task_running: taskRunning,
40
+ };
41
+ fs.writeFileSync(path.join(dir, 'heartbeat.web.stamp'), JSON.stringify(stamp), 'utf-8');
42
+ }
43
+ export function readHeartbeat(which, opts = DEFAULTS) {
44
+ try {
45
+ const raw = fs.readFileSync(path.join(netDir(opts), `heartbeat.${which}.stamp`), 'utf-8');
46
+ const s = JSON.parse(raw);
47
+ const ageMs = Date.now() - s.ts * 1000;
48
+ return { ts: s.ts, pid: s.pid, task_running: !!s.task_running, ageMs };
49
+ }
50
+ catch {
51
+ return null;
52
+ }
53
+ }
54
+ /** 失联分级判定(纯函数,A 侧 judge_stamp 的 B 侧镜像) */
55
+ export function judgeStamp(stamp, opts = DEFAULTS) {
56
+ if (!stamp)
57
+ return 'no_stamp';
58
+ const threshold = stamp.task_running ? opts.deadMs * opts.workingFactor : opts.deadMs;
59
+ if (stamp.ageMs < opts.warnMs)
60
+ return 'alive';
61
+ if (stamp.task_running && stamp.ageMs < threshold)
62
+ return 'alive_working';
63
+ if (stamp.ageMs < threshold)
64
+ return 'warning';
65
+ return 'dead';
66
+ }
67
+ // ---------------------------------------------------------------------------
68
+ // 守护 A(检测 harness 进程 + 拉起)
69
+ // ---------------------------------------------------------------------------
70
+ const HARNESS_PROC = ['python', 'harness.guardian']; // wmic 特征
71
+ function execP(cmd) {
72
+ return new Promise((resolve) => {
73
+ exec(cmd, { windowsHide: true, timeout: 15_000 }, (err, stdout) => {
74
+ resolve(err ? '' : String(stdout));
75
+ });
76
+ });
77
+ }
78
+ /** 检测 harness 进程是否存在(wmic) */
79
+ export async function harnessRunning() {
80
+ const out = await execP(`wmic process where "name='python.exe'" get commandline 2>nul`);
81
+ return out.includes('harness.guardian') || out.includes('harness.main');
82
+ }
83
+ /** detached 拉起 A 侧 harness.guardian(幂等:先确认不存在) */
84
+ export async function ensureHarness(python = 'python', opts = DEFAULTS) {
85
+ const running = await harnessRunning();
86
+ if (running)
87
+ return 'already';
88
+ try {
89
+ const child = spawn(python, ['-m', 'harness.guardian'], {
90
+ windowsHide: true,
91
+ detached: true,
92
+ stdio: 'ignore',
93
+ });
94
+ child.unref();
95
+ log(opts, `守护动作:拉起 harness.guardian(pid=${child.pid ?? '?'})`);
96
+ return 'started';
97
+ }
98
+ catch (e) {
99
+ log(opts, `守护失败:${String(e)}`);
100
+ return 'failed';
101
+ }
102
+ }
103
+ /** 扫描互维目录里 A→B 的 pending 任务 */
104
+ export function scanTasks(opts = DEFAULTS) {
105
+ const dir = path.join(netDir(opts), 'tasks');
106
+ if (!fs.existsSync(dir))
107
+ return [];
108
+ const out = [];
109
+ for (const f of fs.readdirSync(dir)) {
110
+ if (!f.startsWith('task-') || !f.endsWith('.json'))
111
+ continue;
112
+ try {
113
+ const t = JSON.parse(fs.readFileSync(path.join(dir, f), 'utf-8'));
114
+ if (t.to === 'B' && t.status === 'pending')
115
+ out.push(t);
116
+ }
117
+ catch { /* 跳过坏文件 */ }
118
+ }
119
+ return out;
120
+ }
121
+ /** 白箱通道:智慧之书 base_verify(通过 bridge 调用,或本地注入) */
122
+ export async function whiteboxVerify(claim, verifyFn) {
123
+ try {
124
+ return await verifyFn(claim);
125
+ }
126
+ catch (e) {
127
+ return { judgment: `whitebox_error: ${String(e)}`, best: '', d_norm: -1, record_id: '' };
128
+ }
129
+ }
130
+ /** 复核通道:DeepSeek 独立复核(在白箱判定之上) */
131
+ export async function llmReview(claim, whitebox, reviewFn) {
132
+ try {
133
+ return await reviewFn(claim, whitebox);
134
+ }
135
+ catch (e) {
136
+ return { conclusion: `llm_error: ${String(e)}`, reason: '' };
137
+ }
138
+ }
139
+ /** 综合 verdict(白箱优先) */
140
+ export function combineVerdict(w, l) {
141
+ const c = l.conclusion || '';
142
+ if (w.judgment.startsWith('采纳')) {
143
+ // 白箱采纳:复核质疑/不同意→needs_revision(白箱优先,记录分歧);否则 pass
144
+ return c.includes('质疑') || c.includes('不同意') || c.includes('不通过')
145
+ ? 'needs_revision' : 'pass';
146
+ }
147
+ if (w.judgment.includes('fail') || w.judgment.includes('不成立'))
148
+ return 'fail';
149
+ // 证据不足/无法判断 → 白箱不确定,交给复核决定(「不同意」须排除「同意」子串)
150
+ if (c.includes('不同意') || c.includes('不通过'))
151
+ return 'needs_revision';
152
+ if (c.includes('通过') || c.includes('同意') || c.includes('质疑'))
153
+ return 'pass';
154
+ return 'needs_revision';
155
+ }
156
+ /** 处理单个任务:双通道验证 → 写回 result */
157
+ export async function processTask(task, verifyFn, reviewFn, opts = DEFAULTS) {
158
+ const dir = path.join(netDir(opts), 'tasks');
159
+ const taskPath = path.join(dir, `task-${task.id}.json`);
160
+ // 标记 processing
161
+ try {
162
+ fs.writeFileSync(taskPath, JSON.stringify({ ...task, status: 'processing' }, null, 2), 'utf-8');
163
+ }
164
+ catch { /* 非阻塞 */ }
165
+ const w = await whiteboxVerify(task.payload.claim, verifyFn);
166
+ const l = await llmReview(task.payload.claim, w, reviewFn);
167
+ const verdict = combineVerdict(w, l);
168
+ const result = {
169
+ task_id: task.id,
170
+ verdict,
171
+ whitebox: w,
172
+ llm_review: l,
173
+ reasons: [
174
+ `白箱判定:${w.judgment}(best=${w.best},d_norm=${w.d_norm})`,
175
+ `复核结论:${l.conclusion}`,
176
+ ],
177
+ evidence: [task.payload.source_ref || ''].filter(Boolean),
178
+ verifier: 'B',
179
+ at: Date.now() / 1000,
180
+ };
181
+ fs.writeFileSync(path.join(dir, `result-${task.id}.json`), JSON.stringify(result, null, 2), 'utf-8');
182
+ // 标记 done
183
+ try {
184
+ fs.writeFileSync(taskPath, JSON.stringify({ ...task, status: 'done' }, null, 2), 'utf-8');
185
+ }
186
+ catch { /* 非阻塞 */ }
187
+ log(opts, `任务 ${task.id} 验证完成:${verdict}`);
188
+ return result;
189
+ }
190
+ // ---------------------------------------------------------------------------
191
+ // 日志 / last_contact
192
+ // ---------------------------------------------------------------------------
193
+ export function log(opts, msg) {
194
+ try {
195
+ const p = path.join(netDir(opts), 'mutual.log');
196
+ fs.appendFileSync(p, `[B ${new Date().toISOString()}] ${msg}\n`, 'utf-8');
197
+ }
198
+ catch { /* 日志失败不阻塞 */ }
199
+ }
200
+ export function writeLastContact(opts = DEFAULTS) {
201
+ try {
202
+ fs.writeFileSync(path.join(netDir(opts), 'last_contact.json'), JSON.stringify({ last_contact_b: Date.now() / 1000 }), 'utf-8');
203
+ }
204
+ catch { /* 非阻塞 */ }
205
+ }
206
+ // ---------------------------------------------------------------------------
207
+ // 安装(ctx.effect 作用域内,卸载时清理)
208
+ // ---------------------------------------------------------------------------
209
+ export function installMutualMaintenance(ctx, config = {}, hooks = {}) {
210
+ const opts = { ...DEFAULTS, ...config };
211
+ // 1. 心跳写戳 + 守护 A(10min 周期)
212
+ const heartbeatDispose = ctx.interval(opts.heartbeatMs, () => {
213
+ try {
214
+ writeHeartbeat(opts);
215
+ // 守护 A:harness 不在 → 拉起
216
+ ensureHarness('python', opts).then((r) => {
217
+ if (r === 'started')
218
+ ctx.logger.info(`mutual: 已拉起 A 侧 harness(${r})`);
219
+ });
220
+ // 读 A 戳分级判定
221
+ const a = readHeartbeat('a', opts);
222
+ const verdict = judgeStamp(a, opts);
223
+ if (verdict === 'warning')
224
+ ctx.logger.info('mutual: A 侧心跳告警(>25min 未更新)');
225
+ if (verdict === 'dead')
226
+ ctx.logger.info('mutual: A 侧失联(>35min),等待 guardian 自愈或告警');
227
+ writeLastContact(opts);
228
+ }
229
+ catch (e) { /* 单次失败不中断 */ }
230
+ });
231
+ // 2. 任务轮询(30s 周期,检查 A→B 任务)
232
+ const taskDispose = ctx.interval(30_000, () => {
233
+ try {
234
+ const tasks = scanTasks(opts);
235
+ for (const t of tasks) {
236
+ if (!hooks.verify || !hooks.review)
237
+ continue;
238
+ processTask(t, hooks.verify, hooks.review, opts).catch((e) => {
239
+ log(opts, `任务 ${t.id} 处理异常:${String(e)}`);
240
+ });
241
+ }
242
+ }
243
+ catch (e) { /* 单次失败不中断 */ }
244
+ });
245
+ // 3. effect 作用域清理
246
+ ctx.effect(() => {
247
+ return () => {
248
+ try {
249
+ heartbeatDispose();
250
+ taskDispose();
251
+ }
252
+ catch { /* 清理失败不阻塞 */ }
253
+ };
254
+ }, 'dsh-memory-mutual');
255
+ }
256
+ export default { installMutualMaintenance, writeHeartbeat, readHeartbeat, judgeStamp, scanTasks, processTask };
package/package.json CHANGED
@@ -1,66 +1,67 @@
1
- {
2
- "name": "@furongjun1999/dsh-memory",
3
- "version": "0.2.3",
4
- "description": "灵枢(Lingshu·líng shū)DeepSeek Harness 插件:完整大脑——长期记忆/知识飞轮/自我认知/递归反思接入 DSH,对话自动沉淀进记忆库",
5
- "type": "module",
6
- "main": "lib/index.js",
7
- "types": "lib/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "types": "./lib/index.d.ts",
11
- "import": "./lib/index.js"
12
- }
13
- },
14
- "files": [
15
- "lib",
16
- "README.md",
17
- "cordis.yml.example",
18
- "cordis.patch.yml"
19
- ],
20
- "keywords": [
21
- "deepseek",
22
- "dsh",
23
- "dsh-plugin",
24
- "cordis",
25
- "memory",
26
- "agent",
27
- "aeis",
28
- "lingshu",
29
- "multi-agent",
30
- "spatiotemporal",
31
- "knowledge-graph"
32
- ],
33
- "license": "MIT",
34
- "peerDependencies": {
35
- "@deepseek-ai/cordis": "^4.0.1",
36
- "@deepseek-ai/dsh-session": "^0.0.1-rc.1",
37
- "@deepseek-ai/dsh-tools": "^0.0.1-rc.1"
38
- },
39
- "devDependencies": {
40
- "@deepseek-ai/cordis": "^4.0.1",
41
- "@deepseek-ai/dsh-session": "^0.0.1-rc.1",
42
- "@deepseek-ai/dsh-system-prompt": "^0.0.1-rc.1",
43
- "@deepseek-ai/dsh-tools": "^0.0.1-rc.1",
44
- "@deepseek-ai/schemastery": "^3.0.0",
45
- "@types/node": "^24.0.0",
46
- "tsx": "^4.19.0",
47
- "typescript": "^5.5.0"
48
- },
49
- "scripts": {
50
- "build": "tsc -p tsconfig.json",
51
- "test": "npm run build && node --import tsx --test \"test/*.test.ts\"",
52
- "prepublishOnly": "npm run build && npm test"
53
- },
54
- "repository": {
55
- "type": "git",
56
- "url": "https://github.com/FuRongJun-1999/dsh-memory.git"
57
- },
58
- "engines": {
59
- "node": ">=18"
60
- },
61
- "dsh": {
62
- "bundle": {
63
- "patch": "./cordis.patch.yml"
64
- }
65
- }
66
- }
1
+ {
2
+ "name": "@furongjun1999/dsh-memory",
3
+ "version": "0.2.5",
4
+ "description": "灵枢(Lingshu·líng shū)DeepSeek Harness 插件:完整大脑——长期记忆/知识飞轮/自我认知/递归反思接入 DSH,对话自动沉淀进记忆库",
5
+ "type": "module",
6
+ "main": "lib/index.js",
7
+ "types": "lib/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./lib/index.d.ts",
11
+ "import": "./lib/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "lib",
16
+ "README.md",
17
+ "cordis.yml.example",
18
+ "cordis.patch.yml"
19
+ ],
20
+ "keywords": [
21
+ "deepseek",
22
+ "dsh",
23
+ "dsh-plugin",
24
+ "cordis",
25
+ "memory",
26
+ "agent",
27
+ "aeis",
28
+ "lingshu",
29
+ "multi-agent",
30
+ "spatiotemporal",
31
+ "knowledge-graph"
32
+ ],
33
+ "license": "MIT",
34
+ "peerDependencies": {
35
+ "@deepseek-ai/cordis": "^4.0.1",
36
+ "@deepseek-ai/dsh-session": "^0.1.0-rc.6",
37
+ "@deepseek-ai/dsh-tools": "^0.1.0-rc.6",
38
+ "@deepseek-ai/schemastery": "^3.18.1"
39
+ },
40
+ "devDependencies": {
41
+ "@deepseek-ai/cordis": "^4.0.1",
42
+ "@deepseek-ai/dsh-session": "^0.1.0-rc.6",
43
+ "@deepseek-ai/dsh-system-prompt": "^0.1.0-rc.6",
44
+ "@deepseek-ai/dsh-tools": "^0.1.0-rc.6",
45
+ "@deepseek-ai/schemastery": "^3.0.0",
46
+ "@types/node": "^24.0.0",
47
+ "tsx": "^4.19.0",
48
+ "typescript": "^5.5.0"
49
+ },
50
+ "scripts": {
51
+ "build": "tsc -p tsconfig.json",
52
+ "test": "npm run build \u0026\u0026 node --import tsx --test \"test/*.test.ts\"",
53
+ "prepublishOnly": "npm run build \u0026\u0026 npm test"
54
+ },
55
+ "repository": {
56
+ "type": "git",
57
+ "url": "https://github.com/FuRongJun-1999/dsh-memory.git"
58
+ },
59
+ "engines": {
60
+ "node": "\u003e=18"
61
+ },
62
+ "dsh": {
63
+ "bundle": {
64
+ "patch": "./cordis.patch.yml"
65
+ }
66
+ }
67
+ }