openclaw-cortex-memory 0.1.0-Alpha.8 → 0.1.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.
Files changed (106) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +347 -299
  3. package/SIGNATURE.md +7 -0
  4. package/SKILL.md +96 -350
  5. package/dist/index.d.ts +93 -23
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +1234 -1318
  8. package/dist/index.js.map +1 -1
  9. package/dist/openclaw.plugin.json +377 -18
  10. package/dist/src/dedup/three_stage_deduplicator.d.ts.map +1 -1
  11. package/dist/src/dedup/three_stage_deduplicator.js +13 -3
  12. package/dist/src/dedup/three_stage_deduplicator.js.map +1 -1
  13. package/dist/src/engine/memory_engine.d.ts +6 -1
  14. package/dist/src/engine/memory_engine.d.ts.map +1 -1
  15. package/dist/src/engine/ts_engine.d.ts +208 -0
  16. package/dist/src/engine/ts_engine.d.ts.map +1 -1
  17. package/dist/src/engine/ts_engine.js +1353 -84
  18. package/dist/src/engine/ts_engine.js.map +1 -1
  19. package/dist/src/engine/types.d.ts +27 -0
  20. package/dist/src/engine/types.d.ts.map +1 -1
  21. package/dist/src/graph/ontology.d.ts +87 -15
  22. package/dist/src/graph/ontology.d.ts.map +1 -1
  23. package/dist/src/graph/ontology.js +999 -12
  24. package/dist/src/graph/ontology.js.map +1 -1
  25. package/dist/src/net/http_post.d.ts +17 -0
  26. package/dist/src/net/http_post.d.ts.map +1 -0
  27. package/dist/src/net/http_post.js +56 -0
  28. package/dist/src/net/http_post.js.map +1 -0
  29. package/dist/src/quality/llm_output_validator.d.ts +65 -0
  30. package/dist/src/quality/llm_output_validator.d.ts.map +1 -0
  31. package/dist/src/quality/llm_output_validator.js +635 -0
  32. package/dist/src/quality/llm_output_validator.js.map +1 -0
  33. package/dist/src/reflect/reflector.d.ts.map +1 -1
  34. package/dist/src/reflect/reflector.js +296 -26
  35. package/dist/src/reflect/reflector.js.map +1 -1
  36. package/dist/src/rules/rule_store.d.ts.map +1 -1
  37. package/dist/src/rules/rule_store.js +75 -16
  38. package/dist/src/rules/rule_store.js.map +1 -1
  39. package/dist/src/session/session_end.d.ts +20 -42
  40. package/dist/src/session/session_end.d.ts.map +1 -1
  41. package/dist/src/session/session_end.js +31 -214
  42. package/dist/src/session/session_end.js.map +1 -1
  43. package/dist/src/store/archive_store.d.ts +52 -7
  44. package/dist/src/store/archive_store.d.ts.map +1 -1
  45. package/dist/src/store/archive_store.js +526 -96
  46. package/dist/src/store/archive_store.js.map +1 -1
  47. package/dist/src/store/embedding_utils.d.ts +32 -0
  48. package/dist/src/store/embedding_utils.d.ts.map +1 -0
  49. package/dist/src/store/embedding_utils.js +173 -0
  50. package/dist/src/store/embedding_utils.js.map +1 -0
  51. package/dist/src/store/graph_memory_store.d.ts +115 -0
  52. package/dist/src/store/graph_memory_store.d.ts.map +1 -0
  53. package/dist/src/store/graph_memory_store.js +1061 -0
  54. package/dist/src/store/graph_memory_store.js.map +1 -0
  55. package/dist/src/store/read_store.d.ts +95 -0
  56. package/dist/src/store/read_store.d.ts.map +1 -1
  57. package/dist/src/store/read_store.js +2108 -268
  58. package/dist/src/store/read_store.js.map +1 -1
  59. package/dist/src/store/vector_store.d.ts +15 -0
  60. package/dist/src/store/vector_store.d.ts.map +1 -1
  61. package/dist/src/store/vector_store.js +75 -1
  62. package/dist/src/store/vector_store.js.map +1 -1
  63. package/dist/src/store/write_store.d.ts +46 -0
  64. package/dist/src/store/write_store.d.ts.map +1 -1
  65. package/dist/src/store/write_store.js +399 -50
  66. package/dist/src/store/write_store.js.map +1 -1
  67. package/dist/src/sync/session_sync.d.ts +115 -2
  68. package/dist/src/sync/session_sync.d.ts.map +1 -1
  69. package/dist/src/sync/session_sync.js +2497 -44
  70. package/dist/src/sync/session_sync.js.map +1 -1
  71. package/dist/src/utils/runtime_env.d.ts +4 -0
  72. package/dist/src/utils/runtime_env.d.ts.map +1 -0
  73. package/dist/src/utils/runtime_env.js +51 -0
  74. package/dist/src/utils/runtime_env.js.map +1 -0
  75. package/dist/src/wiki/wiki_linter.d.ts +26 -0
  76. package/dist/src/wiki/wiki_linter.d.ts.map +1 -0
  77. package/dist/src/wiki/wiki_linter.js +339 -0
  78. package/dist/src/wiki/wiki_linter.js.map +1 -0
  79. package/dist/src/wiki/wiki_logger.d.ts +10 -0
  80. package/dist/src/wiki/wiki_logger.d.ts.map +1 -0
  81. package/dist/src/wiki/wiki_logger.js +78 -0
  82. package/dist/src/wiki/wiki_logger.js.map +1 -0
  83. package/dist/src/wiki/wiki_maintainer.d.ts +39 -0
  84. package/dist/src/wiki/wiki_maintainer.d.ts.map +1 -0
  85. package/dist/src/wiki/wiki_maintainer.js +38 -0
  86. package/dist/src/wiki/wiki_maintainer.js.map +1 -0
  87. package/dist/src/wiki/wiki_projector.d.ts +35 -0
  88. package/dist/src/wiki/wiki_projector.d.ts.map +1 -0
  89. package/dist/src/wiki/wiki_projector.js +1151 -0
  90. package/dist/src/wiki/wiki_projector.js.map +1 -0
  91. package/dist/src/wiki/wiki_queue.d.ts +29 -0
  92. package/dist/src/wiki/wiki_queue.d.ts.map +1 -0
  93. package/dist/src/wiki/wiki_queue.js +137 -0
  94. package/dist/src/wiki/wiki_queue.js.map +1 -0
  95. package/openclaw.plugin.json +377 -18
  96. package/package.json +52 -5
  97. package/schema/graph.schema.yaml +330 -0
  98. package/scripts/cli.js +80 -26
  99. package/scripts/repair-memory.js +321 -0
  100. package/scripts/uninstall.js +7 -1
  101. package/skills/cortex-memory/SKILL.md +83 -0
  102. package/skills/cortex-memory/references/agent-manual.md +127 -0
  103. package/skills/cortex-memory/references/configuration.md +109 -0
  104. package/skills/cortex-memory/references/publish-checklist.md +45 -0
  105. package/skills/cortex-memory/references/system-prompt-template.md +27 -0
  106. package/skills/cortex-memory/references/tools.md +191 -0
@@ -0,0 +1,330 @@
1
+ {
2
+ "eventTypes": [
3
+ "decision",
4
+ "issue",
5
+ "fix",
6
+ "preference",
7
+ "plan",
8
+ "risk",
9
+ "insight",
10
+ "action_item",
11
+ "conversation_summary",
12
+ "constraint",
13
+ "requirement",
14
+ "milestone",
15
+ "blocker",
16
+ "dependency",
17
+ "assumption",
18
+ "retrospective",
19
+ "follow_up"
20
+ ],
21
+ "eventTypeAliases": {
22
+ "problem": "issue",
23
+ "error": "issue",
24
+ "bug": "issue",
25
+ "solution": "fix",
26
+ "workaround": "fix",
27
+ "todo": "action_item",
28
+ "next_step": "action_item",
29
+ "limitation": "constraint",
30
+ "guardrail": "constraint",
31
+ "spec": "requirement",
32
+ "acceptance_criteria": "requirement",
33
+ "deadline": "milestone",
34
+ "target": "milestone",
35
+ "roadblock": "blocker",
36
+ "stuck": "blocker",
37
+ "depends_on": "dependency",
38
+ "upstream": "dependency",
39
+ "hypothesis": "assumption",
40
+ "lesson": "retrospective",
41
+ "postmortem": "retrospective",
42
+ "followup": "follow_up",
43
+ "next_action": "follow_up"
44
+ },
45
+ "entityTypes": [
46
+ "Person",
47
+ "FamilyMember",
48
+ "Friend",
49
+ "Team",
50
+ "Project",
51
+ "Task",
52
+ "Plan",
53
+ "Milestone",
54
+ "Location",
55
+ "Event",
56
+ "Schedule",
57
+ "Habit",
58
+ "HealthItem",
59
+ "FinanceItem",
60
+ "Issue",
61
+ "Fix",
62
+ "Decision",
63
+ "Action",
64
+ "Risk",
65
+ "Blocker",
66
+ "Assumption",
67
+ "Concept",
68
+ "Resource",
69
+ "Document",
70
+ "ConfigFile",
71
+ "Preference",
72
+ "Case",
73
+ "Pattern",
74
+ "Date"
75
+ ],
76
+ "entityAliases": {
77
+ "OpenClaw": ["openclaw", "插件", "该项目", "本项目"],
78
+ "FamilyMember": ["家人", "家庭成员", "亲人"],
79
+ "Friend": ["朋友", "好友"],
80
+ "Team": ["团队", "小组", "组", "班组"],
81
+ "Location": ["地点", "位置", "住址", "地址"],
82
+ "Event": ["活动", "事情", "事项"],
83
+ "Schedule": ["日程", "安排", "计划表"],
84
+ "Habit": ["习惯", "作息"],
85
+ "HealthItem": ["健康", "体检", "药物", "锻炼"],
86
+ "FinanceItem": ["账单", "支出", "收入", "预算"],
87
+ "Plan": ["计划", "方案", "路线图"],
88
+ "Preference": ["偏好", "习惯选择"],
89
+ "Document": ["文档", "说明文档", "手册", "wiki", "README", "PRD", "方案文档"],
90
+ "Resource": ["资源", "物品", "物件", "设备", "工具", "素材", "资产"],
91
+ "ConfigFile": ["配置文件", "config", "配置"],
92
+ "Decision": ["决策", "决定", "拍板"],
93
+ "Action": ["动作", "操作", "执行"],
94
+ "Risk": ["风险", "隐患"],
95
+ "Blocker": ["阻塞", "卡点", "障碍"],
96
+ "Assumption": ["假设", "前提"],
97
+ "Concept": ["概念", "术语"],
98
+ "Case": ["案例", "case"],
99
+ "Pattern": ["模式", "pattern"],
100
+ "Date": ["日期", "时间", "时间点"],
101
+ "Person": ["我", "自己", "本人", "同事", "客户", "用户", "姓名", "名字", "人名", "成员", "联系人"],
102
+ "Project": ["项目", "工程", "项目线"],
103
+ "Task": ["任务", "待办", "todo", "工单", "事项"],
104
+ "Milestone": ["里程碑", "节点"],
105
+ "Issue": ["问题", "故障", "报错"],
106
+ "Fix": ["修复", "解决方案"]
107
+ },
108
+ "relationTypes": [
109
+ "depends_on",
110
+ "blocks",
111
+ "unblocks",
112
+ "causes",
113
+ "impacts",
114
+ "resolves",
115
+ "encountered_bug",
116
+ "solved_with",
117
+ "uses_tech",
118
+ "integrates_with",
119
+ "migrates_to",
120
+ "replaced_by",
121
+ "has_subtask",
122
+ "belongs_to",
123
+ "owned_by",
124
+ "implements",
125
+ "requires",
126
+ "plans_to",
127
+ "planned_for",
128
+ "scheduled_for",
129
+ "references",
130
+ "documents",
131
+ "defined_in",
132
+ "configured_in",
133
+ "supports",
134
+ "conflicts_with",
135
+ "duplicates",
136
+ "supersedes",
137
+ "assigned_to",
138
+ "reviewed_by",
139
+ "approved_by",
140
+ "rejected_by",
141
+ "reported_by",
142
+ "lives_in",
143
+ "cares_for",
144
+ "pays_for",
145
+ "prefers",
146
+ "has_spouse",
147
+ "has_child",
148
+ "birthday_on",
149
+ "anniversary_on"
150
+ ],
151
+ "relationTypeAliases": {
152
+ "dependency": "depends_on",
153
+ "blocked_by": "blocks",
154
+ "unblock": "unblocks",
155
+ "impact": "impacts",
156
+ "plan_to": "plans_to",
157
+ "plan_for": "planned_for",
158
+ "schedule_for": "scheduled_for",
159
+ "located_in": "lives_in",
160
+ "care_for": "cares_for",
161
+ "pay_for": "pays_for",
162
+ "support": "supports",
163
+ "conflict_with": "conflicts_with",
164
+ "use_tech": "uses_tech",
165
+ "tech_stack": "uses_tech",
166
+ "integrate_with": "integrates_with",
167
+ "migrate_to": "migrates_to",
168
+ "replace_by": "replaced_by",
169
+ "replace_with": "replaced_by",
170
+ "bug": "encountered_bug",
171
+ "bug_on": "encountered_bug",
172
+ "fix_with": "solved_with",
173
+ "solve_with": "solved_with",
174
+ "solved_by": "solved_with",
175
+ "subtask_of": "has_subtask",
176
+ "child_task": "has_subtask",
177
+ "documented_by": "documents",
178
+ "defined_by": "defined_in",
179
+ "config_in": "configured_in",
180
+ "duplicate_of": "duplicates",
181
+ "superseded_by": "supersedes",
182
+ "assign_to": "assigned_to",
183
+ "review_by": "reviewed_by",
184
+ "approve_by": "approved_by",
185
+ "reject_by": "rejected_by",
186
+ "report_by": "reported_by",
187
+ "依赖于": "depends_on",
188
+ "依赖": "depends_on",
189
+ "取决于": "depends_on",
190
+ "阻塞": "blocks",
191
+ "卡住": "blocks",
192
+ "解除阻塞": "unblocks",
193
+ "导致": "causes",
194
+ "引起": "causes",
195
+ "影响": "impacts",
196
+ "解决": "resolves",
197
+ "修复": "resolves",
198
+ "遇到报错": "encountered_bug",
199
+ "通过": "solved_with",
200
+ "使用技术": "uses_tech",
201
+ "集成": "integrates_with",
202
+ "迁移到": "migrates_to",
203
+ "被替代": "replaced_by",
204
+ "子任务": "has_subtask",
205
+ "属于": "belongs_to",
206
+ "归属": "belongs_to",
207
+ "负责": "owned_by",
208
+ "由": "owned_by",
209
+ "实现": "implements",
210
+ "需要": "requires",
211
+ "计划做": "plans_to",
212
+ "打算": "plans_to",
213
+ "计划于": "planned_for",
214
+ "安排在": "scheduled_for",
215
+ "约在": "scheduled_for",
216
+ "参考": "references",
217
+ "引用": "references",
218
+ "记录": "documents",
219
+ "定义于": "defined_in",
220
+ "配置于": "configured_in",
221
+ "支持": "supports",
222
+ "冲突": "conflicts_with",
223
+ "矛盾": "conflicts_with",
224
+ "重复": "duplicates",
225
+ "取代": "supersedes",
226
+ "分配给": "assigned_to",
227
+ "评审": "reviewed_by",
228
+ "批准": "approved_by",
229
+ "拒绝": "rejected_by",
230
+ "报告": "reported_by",
231
+ "住在": "lives_in",
232
+ "居住在": "lives_in",
233
+ "照顾": "cares_for",
234
+ "看护": "cares_for",
235
+ "支付": "pays_for",
236
+ "付款": "pays_for",
237
+ "偏好": "prefers",
238
+ "更喜欢": "prefers",
239
+ "配偶": "has_spouse",
240
+ "孩子": "has_child",
241
+ "生日": "birthday_on",
242
+ "纪念日": "anniversary_on",
243
+ "belongs": "belongs_to",
244
+ "owner_of": "owned_by",
245
+ "refer_to": "references",
246
+ "preference_for": "prefers",
247
+ "implement": "implements",
248
+ "need": "requires",
249
+ "technology": "uses_tech",
250
+ "encountered_issue": "encountered_bug",
251
+ "spouse": "has_spouse",
252
+ "wife_of": "has_spouse",
253
+ "husband_of": "has_spouse",
254
+ "child_of": "has_child",
255
+ "parent_of": "has_child",
256
+ "birthday": "birthday_on",
257
+ "born_on": "birthday_on",
258
+ "anniversary": "anniversary_on",
259
+ "married_on": "anniversary_on"
260
+ },
261
+ "relationRules": [
262
+ { "type": "depends_on", "fromTypes": ["Task", "Plan", "Milestone", "Issue"], "toTypes": ["Task", "Plan", "Milestone", "Issue", "Resource"], "allowSelfLoop": false },
263
+ { "type": "blocks", "fromTypes": ["Issue", "Task", "Risk", "Blocker"], "toTypes": ["Task", "Plan", "Milestone"], "allowSelfLoop": false },
264
+ { "type": "unblocks", "fromTypes": ["Fix", "Action", "Decision"], "toTypes": ["Task", "Issue", "Blocker"], "allowSelfLoop": false },
265
+ { "type": "causes", "fromTypes": ["Issue", "Risk", "Assumption"], "toTypes": ["Issue", "Risk", "Blocker"], "allowSelfLoop": false },
266
+ { "type": "impacts", "fromTypes": ["Issue", "Risk", "Task", "Project", "Event"], "toTypes": ["Task", "Project", "Issue", "Milestone", "Event"], "allowSelfLoop": false },
267
+ { "type": "resolves", "fromTypes": ["Fix", "Decision", "Action"], "toTypes": ["Issue", "Blocker", "Risk"], "allowSelfLoop": false },
268
+ { "type": "encountered_bug", "fromTypes": ["Project", "Task", "Action"], "toTypes": ["Issue", "Blocker"], "allowSelfLoop": false },
269
+ { "type": "solved_with", "fromTypes": ["Issue", "Blocker", "Task"], "toTypes": ["Fix", "Action", "Decision", "Resource", "Document"], "allowSelfLoop": false },
270
+ { "type": "uses_tech", "fromTypes": ["Project", "Task", "Fix", "Action"], "toTypes": ["Resource", "Document", "ConfigFile", "Project"], "allowSelfLoop": false },
271
+ { "type": "integrates_with", "fromTypes": ["Project", "Task", "Resource"], "toTypes": ["Project", "Resource"], "allowSelfLoop": false },
272
+ { "type": "migrates_to", "fromTypes": ["Project", "Task", "Resource", "ConfigFile"], "toTypes": ["Project", "Resource", "ConfigFile"], "allowSelfLoop": false },
273
+ { "type": "replaced_by", "fromTypes": ["Project", "Task", "Resource", "Fix"], "toTypes": ["Project", "Task", "Resource", "Fix"], "allowSelfLoop": false },
274
+ { "type": "has_subtask", "fromTypes": ["Project", "Plan", "Milestone", "Task"], "toTypes": ["Task"], "allowSelfLoop": false },
275
+ { "type": "belongs_to", "fromTypes": ["Task", "Issue", "Fix", "Decision", "Document"], "toTypes": ["Project", "Plan", "Milestone", "Event"], "allowSelfLoop": false },
276
+ { "type": "owned_by", "fromTypes": ["Task", "Plan", "Project", "Issue", "Resource"], "toTypes": ["Person", "Team"], "allowSelfLoop": false },
277
+ { "type": "implements", "fromTypes": ["Task", "Fix", "Project", "Document"], "toTypes": ["Plan", "Milestone", "Concept"], "allowSelfLoop": false },
278
+ { "type": "requires", "fromTypes": ["Task", "Fix", "Project", "Issue", "Plan"], "toTypes": ["Task", "Resource", "Document", "ConfigFile", "Date"], "allowSelfLoop": false },
279
+ { "type": "planned_for", "fromTypes": ["Task", "Plan", "Milestone"], "toTypes": ["Date", "Schedule", "Milestone"], "allowSelfLoop": false },
280
+ { "type": "scheduled_for", "fromTypes": ["Task", "Event", "Plan"], "toTypes": ["Date", "Schedule"], "allowSelfLoop": false },
281
+ { "type": "references", "fromTypes": ["Task", "Issue", "Fix", "Document", "Project"], "toTypes": ["Document", "Resource", "ConfigFile"], "allowSelfLoop": false },
282
+ { "type": "documents", "fromTypes": ["Document", "Project", "Task"], "toTypes": ["Issue", "Fix", "Decision", "Event", "Case", "Pattern"], "allowSelfLoop": false },
283
+ { "type": "defined_in", "fromTypes": ["Task", "Issue", "Fix", "Pattern", "Case"], "toTypes": ["Document", "ConfigFile"], "allowSelfLoop": false },
284
+ { "type": "configured_in", "fromTypes": ["Task", "Fix", "Resource", "Project"], "toTypes": ["ConfigFile", "Document"], "allowSelfLoop": false },
285
+ { "type": "supports", "fromTypes": ["Resource", "Project", "Task", "Fix"], "toTypes": ["Task", "Project", "Issue", "Fix"], "allowSelfLoop": false },
286
+ { "type": "conflicts_with", "fromTypes": ["Task", "Plan", "Resource", "ConfigFile", "Issue"], "toTypes": ["Task", "Plan", "Resource", "ConfigFile", "Issue"], "allowSelfLoop": false },
287
+ { "type": "duplicates", "fromTypes": ["Issue", "Task", "Fix", "Document"], "toTypes": ["Issue", "Task", "Fix", "Document"], "allowSelfLoop": false },
288
+ { "type": "supersedes", "fromTypes": ["Fix", "Decision", "Document", "Plan", "Task"], "toTypes": ["Fix", "Decision", "Document", "Plan", "Task"], "allowSelfLoop": false },
289
+ { "type": "assigned_to", "fromTypes": ["Task", "Issue", "Fix", "Action"], "toTypes": ["Person", "Team"], "allowSelfLoop": false },
290
+ { "type": "reviewed_by", "fromTypes": ["Fix", "Task", "Document", "Decision"], "toTypes": ["Person", "Team"], "allowSelfLoop": false },
291
+ { "type": "approved_by", "fromTypes": ["Fix", "Task", "Document", "Decision"], "toTypes": ["Person", "Team"], "allowSelfLoop": false },
292
+ { "type": "rejected_by", "fromTypes": ["Fix", "Task", "Document", "Decision"], "toTypes": ["Person", "Team"], "allowSelfLoop": false },
293
+ { "type": "reported_by", "fromTypes": ["Issue", "Risk", "Blocker"], "toTypes": ["Person", "Team"], "allowSelfLoop": false },
294
+ { "type": "lives_in", "fromTypes": ["Person", "FamilyMember"], "toTypes": ["Location"], "allowSelfLoop": false },
295
+ { "type": "cares_for", "fromTypes": ["Person", "FamilyMember"], "toTypes": ["Person", "FamilyMember"], "allowSelfLoop": false },
296
+ { "type": "pays_for", "fromTypes": ["Person", "FamilyMember"], "toTypes": ["Person", "FamilyMember", "FinanceItem"], "allowSelfLoop": false },
297
+ { "type": "prefers", "fromTypes": ["Person", "Team"], "toTypes": ["Preference", "Resource", "Project", "Location", "Pattern"], "allowSelfLoop": false },
298
+ { "type": "has_spouse", "fromTypes": ["Person"], "toTypes": ["Person", "FamilyMember"], "allowSelfLoop": false },
299
+ { "type": "has_child", "fromTypes": ["Person", "FamilyMember"], "toTypes": ["Person", "FamilyMember"], "allowSelfLoop": false },
300
+ { "type": "birthday_on", "fromTypes": ["Person", "FamilyMember"], "toTypes": ["Date"], "allowSelfLoop": false },
301
+ { "type": "anniversary_on", "fromTypes": ["Person", "FamilyMember"], "toTypes": ["Date"], "allowSelfLoop": false }
302
+ ],
303
+ "highValueRelationTypes": [
304
+ "depends_on",
305
+ "blocks",
306
+ "unblocks",
307
+ "causes",
308
+ "impacts",
309
+ "resolves",
310
+ "encountered_bug",
311
+ "solved_with",
312
+ "uses_tech",
313
+ "integrates_with",
314
+ "migrates_to",
315
+ "replaced_by",
316
+ "has_subtask",
317
+ "belongs_to",
318
+ "owned_by",
319
+ "implements",
320
+ "requires",
321
+ "planned_for",
322
+ "scheduled_for"
323
+ ],
324
+ "relatedToMaxRatio": 0,
325
+ "relatedToMaxAbsolute": 0,
326
+ "minRelationConfidence": 0.35,
327
+ "evidenceSpanRequired": true,
328
+ "endpointMentionRequired": true,
329
+ "defaultEntityType": "Concept"
330
+ }
package/scripts/cli.js CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  const fs = require('fs');
4
4
  const path = require('path');
5
- const { spawn } = require('child_process');
6
5
 
7
6
  const PLUGIN_NAME = 'openclaw-cortex-memory';
7
+ const EXCLUSIVE_MEMORY_PLUGINS = ['memory-core', 'memory-lancedb'];
8
8
 
9
9
  function findOpenClawConfig() {
10
10
  const explicitConfigPath = process.env.OPENCLAW_CONFIG_PATH || '';
@@ -51,6 +51,41 @@ function saveConfig(configPath, config) {
51
51
  console.log(`Configuration saved to: ${configPath}`);
52
52
  }
53
53
 
54
+ function ensureExclusiveMemoryMode(config) {
55
+ let changed = false;
56
+
57
+ if (!config.plugins) {
58
+ config.plugins = {};
59
+ changed = true;
60
+ }
61
+ if (!config.plugins.entries) {
62
+ config.plugins.entries = {};
63
+ changed = true;
64
+ }
65
+
66
+ for (const pluginId of EXCLUSIVE_MEMORY_PLUGINS) {
67
+ const current = config.plugins.entries[pluginId] || {};
68
+ if (current.enabled !== false) {
69
+ config.plugins.entries[pluginId] = {
70
+ ...current,
71
+ enabled: false
72
+ };
73
+ changed = true;
74
+ }
75
+ }
76
+
77
+ if (!config.plugins.slots) {
78
+ config.plugins.slots = {};
79
+ changed = true;
80
+ }
81
+ if (config.plugins.slots.memory !== 'none') {
82
+ config.plugins.slots.memory = 'none';
83
+ changed = true;
84
+ }
85
+
86
+ return changed;
87
+ }
88
+
54
89
  function enablePlugin() {
55
90
  const configPath = findOpenClawConfig();
56
91
 
@@ -65,9 +100,15 @@ function enablePlugin() {
65
100
  plugins: {
66
101
  allow: [PLUGIN_NAME],
67
102
  slots: {
68
- memory: PLUGIN_NAME
103
+ memory: 'none'
69
104
  },
70
105
  entries: {
106
+ 'memory-core': {
107
+ enabled: false
108
+ },
109
+ 'memory-lancedb': {
110
+ enabled: false
111
+ },
71
112
  [PLUGIN_NAME]: {
72
113
  enabled: true
73
114
  }
@@ -93,24 +134,26 @@ function enablePlugin() {
93
134
  if (!config.plugins.entries) {
94
135
  config.plugins.entries = {};
95
136
  }
96
-
97
- if (config.plugins.entries[PLUGIN_NAME]?.enabled === true) {
98
- console.log(`Plugin '${PLUGIN_NAME}' is already enabled.`);
99
- return;
100
- }
101
-
137
+
138
+ const wasEnabled = config.plugins.entries[PLUGIN_NAME]?.enabled === true;
102
139
  config.plugins.entries[PLUGIN_NAME] = {
103
140
  ...config.plugins.entries[PLUGIN_NAME],
104
141
  enabled: true
105
142
  };
106
-
107
- if (!config.plugins.slots) {
108
- config.plugins.slots = {};
143
+
144
+ const exclusiveUpdated = ensureExclusiveMemoryMode(config);
145
+ if (wasEnabled && !exclusiveUpdated) {
146
+ console.log(`Plugin '${PLUGIN_NAME}' is already enabled.`);
147
+ return;
109
148
  }
110
- config.plugins.slots.memory = PLUGIN_NAME;
111
-
149
+
112
150
  saveConfig(configPath, config);
113
- console.log(`Plugin '${PLUGIN_NAME}' has been enabled.`);
151
+ if (wasEnabled) {
152
+ console.log(`Plugin '${PLUGIN_NAME}' is already enabled.`);
153
+ console.log('Exclusive memory mode config has been refreshed (slots.memory=none, memory-core/memory-lancedb disabled).');
154
+ } else {
155
+ console.log(`Plugin '${PLUGIN_NAME}' has been enabled.`);
156
+ }
114
157
  console.log('The plugin will be activated on the next OpenClaw restart or config reload.');
115
158
  }
116
159
 
@@ -175,21 +218,22 @@ function getStatus() {
175
218
  }
176
219
 
177
220
  function runUninstall(args) {
178
- const uninstallScript = path.join(__dirname, 'uninstall.js');
179
-
180
- if (!fs.existsSync(uninstallScript)) {
221
+ const uninstallScriptPath = path.join(__dirname, 'uninstall.js');
222
+ if (!fs.existsSync(uninstallScriptPath)) {
181
223
  console.error('Uninstall script not found.');
182
224
  process.exit(1);
183
225
  }
184
-
185
- const child = spawn(process.execPath, [uninstallScript, 'uninstall', ...args], {
186
- stdio: 'inherit',
187
- cwd: process.cwd()
188
- });
189
-
190
- child.on('exit', (code) => {
191
- process.exit(code || 0);
192
- });
226
+ try {
227
+ const uninstallModule = require(uninstallScriptPath);
228
+ if (!uninstallModule || typeof uninstallModule.uninstall !== 'function') {
229
+ console.error('Invalid uninstall script export.');
230
+ process.exit(1);
231
+ }
232
+ uninstallModule.uninstall(args);
233
+ } catch (error) {
234
+ console.error(`Failed to run uninstall: ${error instanceof Error ? error.message : String(error)}`);
235
+ process.exit(1);
236
+ }
193
237
  }
194
238
 
195
239
  function showHelp() {
@@ -221,13 +265,23 @@ Configuration:
221
265
  {
222
266
  "plugins": {
223
267
  "allow": ["openclaw-cortex-memory"],
268
+ "slots": {
269
+ "memory": "none"
270
+ },
224
271
  "entries": {
272
+ "memory-core": {
273
+ "enabled": false
274
+ },
275
+ "memory-lancedb": {
276
+ "enabled": false
277
+ },
225
278
  "openclaw-cortex-memory": {
226
279
  "enabled": true/false
227
280
  }
228
281
  }
229
282
  }
230
283
  }
284
+ Note: do not set plugins.slots.memory to "openclaw-cortex-memory".
231
285
 
232
286
  Fallback Behavior:
233
287
  When disabled, the plugin will fall back to OpenClaw's builtin