cortico-world-memory-core 0.4.4 → 0.12.1
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/CHANGELOG.md +106 -0
- package/ENV_PROMPT.md +15 -19
- package/README.md +181 -167
- package/describe.json +30 -53
- package/package.json +7 -4
- package/src/config.ts +266 -258
- package/src/recall.ts +215 -114
- package/src/site.ts +15 -1
- package/src/store.ts +115 -0
- package/src/tools.ts +88 -114
- package/src/world.ts +1456 -1199
- package/webui/app.js +3300 -2388
- package/webui/index.html +120 -104
- package/webui/style.css +814 -735
package/describe.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"tools": [
|
|
3
3
|
{
|
|
4
4
|
"name": "mcore_write",
|
|
5
|
-
"description": "写一条记忆。kind:fact=关于对方的事实,self=关于你自己的,episode
|
|
5
|
+
"description": "写一条记忆。kind:fact=关于对方的事实,self=关于你自己的,episode=会改变你判断的一件事(别记流水账),promise=答应过的事(必须写 dueAt),note=临时信息。一条只写一件事,40-80 字。旧记录用 closes 关掉。",
|
|
6
6
|
"parameters": {
|
|
7
7
|
"type": "object",
|
|
8
8
|
"additionalProperties": false,
|
|
@@ -20,28 +20,26 @@
|
|
|
20
20
|
},
|
|
21
21
|
"text": {
|
|
22
22
|
"type": "string",
|
|
23
|
-
"description": "
|
|
23
|
+
"description": "内容,40-80 字"
|
|
24
24
|
},
|
|
25
25
|
"weight": {
|
|
26
26
|
"type": "number",
|
|
27
|
-
"
|
|
28
|
-
"maximum": 1,
|
|
29
|
-
"description": "在心里有多重:0.3 琐事 / 0.5 一般 / 0.8 重要。默认 0.5"
|
|
27
|
+
"description": "0-1,0.3 琐事 / 0.8 重要"
|
|
30
28
|
},
|
|
31
29
|
"tags": {
|
|
32
30
|
"type": "array",
|
|
33
31
|
"items": {
|
|
34
32
|
"type": "string"
|
|
35
33
|
},
|
|
36
|
-
"description": "
|
|
34
|
+
"description": "最多 6 个"
|
|
37
35
|
},
|
|
38
36
|
"dueAt": {
|
|
39
37
|
"type": "string",
|
|
40
|
-
"description": "
|
|
38
|
+
"description": "promise 用:ISO 或 YYYY-MM-DD HH:MM;没有截止时间写 none"
|
|
41
39
|
},
|
|
42
40
|
"closes": {
|
|
43
41
|
"type": "string",
|
|
44
|
-
"description": "
|
|
42
|
+
"description": "要关掉的旧 id"
|
|
45
43
|
}
|
|
46
44
|
},
|
|
47
45
|
"required": [
|
|
@@ -56,14 +54,14 @@
|
|
|
56
54
|
},
|
|
57
55
|
{
|
|
58
56
|
"name": "mcore_recall",
|
|
59
|
-
"description": "
|
|
57
|
+
"description": "查记忆。给 query 按内容搜(同时搜最近 7 天原文和工作区笔记),不给就看最近几条;mode=open 看没做完的承诺和今天的安排,mode=archive 翻归档(要 query)。对方提到人或旧事、问「你还记得吗」时先查再答。",
|
|
60
58
|
"parameters": {
|
|
61
59
|
"type": "object",
|
|
62
60
|
"additionalProperties": false,
|
|
63
61
|
"properties": {
|
|
64
62
|
"query": {
|
|
65
63
|
"type": "string",
|
|
66
|
-
"description": "
|
|
64
|
+
"description": "关键词就够"
|
|
67
65
|
},
|
|
68
66
|
"kind": {
|
|
69
67
|
"type": "string",
|
|
@@ -84,18 +82,14 @@
|
|
|
84
82
|
"open",
|
|
85
83
|
"archive"
|
|
86
84
|
],
|
|
87
|
-
"description": "默认 search
|
|
85
|
+
"description": "默认 search"
|
|
88
86
|
},
|
|
89
87
|
"days": {
|
|
90
88
|
"type": "integer",
|
|
91
|
-
"minimum": 1,
|
|
92
|
-
"maximum": 3650,
|
|
93
89
|
"description": "只看最近这么多天"
|
|
94
90
|
},
|
|
95
91
|
"limit": {
|
|
96
92
|
"type": "integer",
|
|
97
|
-
"minimum": 1,
|
|
98
|
-
"maximum": 12,
|
|
99
93
|
"description": "最多几条,默认 5"
|
|
100
94
|
}
|
|
101
95
|
},
|
|
@@ -108,7 +102,7 @@
|
|
|
108
102
|
},
|
|
109
103
|
{
|
|
110
104
|
"name": "mcore_state",
|
|
111
|
-
"description": "
|
|
105
|
+
"description": "你自己的状态:精力、心情、在做什么、在哪、睡没睡。这是你自己的,不要念成清单给对方听。",
|
|
112
106
|
"parameters": {
|
|
113
107
|
"type": "object",
|
|
114
108
|
"additionalProperties": false,
|
|
@@ -120,31 +114,27 @@
|
|
|
120
114
|
"update",
|
|
121
115
|
"rest"
|
|
122
116
|
],
|
|
123
|
-
"description": "get
|
|
117
|
+
"description": "get 读 / update 改 / rest 睡"
|
|
124
118
|
},
|
|
125
119
|
"energy": {
|
|
126
120
|
"type": "number",
|
|
127
|
-
"minimum": 0,
|
|
128
|
-
"maximum": 100,
|
|
129
121
|
"description": "精力 0-100"
|
|
130
122
|
},
|
|
131
123
|
"mood": {
|
|
132
124
|
"type": "number",
|
|
133
|
-
"minimum": 0,
|
|
134
|
-
"maximum": 100,
|
|
135
125
|
"description": "心情 0-100"
|
|
136
126
|
},
|
|
137
127
|
"activity": {
|
|
138
128
|
"type": "string",
|
|
139
|
-
"description": "
|
|
129
|
+
"description": "正在做什么"
|
|
140
130
|
},
|
|
141
131
|
"location": {
|
|
142
132
|
"type": "string",
|
|
143
|
-
"description": "
|
|
133
|
+
"description": "在哪"
|
|
144
134
|
},
|
|
145
135
|
"sleeping": {
|
|
146
136
|
"type": "boolean",
|
|
147
|
-
"description": "
|
|
137
|
+
"description": "在睡"
|
|
148
138
|
}
|
|
149
139
|
},
|
|
150
140
|
"required": [
|
|
@@ -160,7 +150,7 @@
|
|
|
160
150
|
},
|
|
161
151
|
{
|
|
162
152
|
"name": "mcore_plan",
|
|
163
|
-
"description": "
|
|
153
|
+
"description": "你今天的安排。日程是你开口的由头,不用讲给对方听。",
|
|
164
154
|
"parameters": {
|
|
165
155
|
"type": "object",
|
|
166
156
|
"additionalProperties": false,
|
|
@@ -172,37 +162,24 @@
|
|
|
172
162
|
"add",
|
|
173
163
|
"done",
|
|
174
164
|
"clear"
|
|
175
|
-
]
|
|
165
|
+
],
|
|
166
|
+
"description": "list 看 / add 加 / done 完成 / clear 清空"
|
|
176
167
|
},
|
|
177
|
-
"
|
|
178
|
-
"type": "
|
|
179
|
-
"description": "add
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
"title": {
|
|
189
|
-
"type": "string",
|
|
190
|
-
"description": "做什么"
|
|
191
|
-
},
|
|
192
|
-
"place": {
|
|
193
|
-
"type": "string",
|
|
194
|
-
"description": "在哪,可省略"
|
|
195
|
-
}
|
|
196
|
-
},
|
|
197
|
-
"required": [
|
|
198
|
-
"time",
|
|
199
|
-
"title"
|
|
200
|
-
]
|
|
201
|
-
}
|
|
168
|
+
"time": {
|
|
169
|
+
"type": "string",
|
|
170
|
+
"description": "add 用,HH:MM"
|
|
171
|
+
},
|
|
172
|
+
"title": {
|
|
173
|
+
"type": "string",
|
|
174
|
+
"description": "add 用,做什么"
|
|
175
|
+
},
|
|
176
|
+
"place": {
|
|
177
|
+
"type": "string",
|
|
178
|
+
"description": "add 用,在哪(可省)"
|
|
202
179
|
},
|
|
203
180
|
"id": {
|
|
204
181
|
"type": "string",
|
|
205
|
-
"description": "done
|
|
182
|
+
"description": "done 用,日程 id"
|
|
206
183
|
}
|
|
207
184
|
},
|
|
208
185
|
"required": [
|
|
@@ -258,7 +235,7 @@
|
|
|
258
235
|
"key": "worlds.memory-core.envPrompt",
|
|
259
236
|
"title": "记忆核心 · 环境提示词",
|
|
260
237
|
"role": "envPrompt",
|
|
261
|
-
"content": "【记忆核心】\n\n
|
|
238
|
+
"content": "【记忆核心】\n\n你只有这一套记忆:`mcore_write` 写,`mcore_recall` 查。旧的几套已经并进来了,不要再提别的记忆系统,也不要问对方「记在哪」。\n\n写的时候:\n- 能写成 `fact` 就别写成 `episode`;`episode` 一天最多 2 条,只写会改变你怎么看她的事。\n- `promise` 没定时间就先问一句;确实没有截止时间就写 `dueAt:\"none\"`。做完或改口传 `closes`(查出来的行首 8 位)。\n- 一条一件事,写清楚谁、什么时候、怎么了;别写「对方说了一些事」这种空话。同一件事不要写两遍。\n- `tags` 给两个词:主题 + 对方可能换的说法(「小黑盒」「发帖」);别写「日常」这种到处都是的。\n\n查的时候:提到旧事、或问「你还记得吗」,先查再答,不要硬猜。\n\n状态和日程用 `mcore_state` / `mcore_plan`,不要写进 `mcore_write`。\n\n分寸:记忆是你记得的东西,不是拿来念的清单。可以自然地说「我记得你说过……」;不确定就直接问,别编。"
|
|
262
239
|
}
|
|
263
240
|
]
|
|
264
241
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cortico-world-memory-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.1",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "
|
|
5
|
+
"description": "四个工具写卡、查卡、改状态、排日程,改口不覆盖。每轮自动把 2 条相关旧记忆推到眼前,不用模型自己查;搜索分「对得上 / 可能沾边」两档。冷层收走三个月没想起的流水账,不删、可回暖。3D 星图一眼看完整个库。常驻约 1,000 token,本地不联网,MIT。\n\nQQ 交流群:745879632",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"cortico-world",
|
|
8
8
|
"cortico",
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
"locales": {
|
|
32
32
|
"zh": {
|
|
33
33
|
"displayName": "记忆核心",
|
|
34
|
-
"description": "
|
|
34
|
+
"description": "四个工具写卡、查卡、改状态、排日程,改口不覆盖。每轮自动把 2 条相关旧记忆推到眼前,不用模型自己查;搜索分「对得上 / 可能沾边」两档。冷层收走三个月没想起的流水账,不删、可回暖。3D 星图一眼看完整个库。常驻约 1,000 token,本地不联网,MIT。\n\nQQ 交流群:745879632"
|
|
35
35
|
},
|
|
36
36
|
"en": {
|
|
37
37
|
"displayName": "Memory Core",
|
|
38
|
-
"description": "
|
|
38
|
+
"description": "Four tools: write a card, look one up, change its state, schedule. Corrections never overwrite - the old card is superseded. Every turn it pushes two relevant old memories to the front, so the model never has to search; lookup comes in two tiers, exact and maybe-related. A cold tier carries off ledgers untouched for three months - nothing is deleted, and they can be warmed back. A 3D star map shows the whole store at a glance. About 1,000 tokens resident, fully local, MIT.\n\nQQ group: 745879632"
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
"tags": [
|
|
@@ -68,5 +68,8 @@
|
|
|
68
68
|
],
|
|
69
69
|
"publishConfig": {
|
|
70
70
|
"access": "public"
|
|
71
|
+
},
|
|
72
|
+
"scripts": {
|
|
73
|
+
"test": "node --experimental-transform-types --no-warnings tools/test-store.ts && node --experimental-transform-types --no-warnings tools/test-world.ts && node --experimental-transform-types --no-warnings tools/test-capture.ts && node --experimental-transform-types --no-warnings tools/test-upgrade.ts && node --experimental-transform-types --no-warnings tools/test-site-auth.ts && node --experimental-transform-types --no-warnings tools/audit-webui.ts"
|
|
71
74
|
}
|
|
72
75
|
}
|