cortico-world-memory-core 0.18.1 → 0.18.2
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 +10 -0
- package/package.json +1 -1
- package/src/world.ts +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.18.2
|
|
4
|
+
|
|
5
|
+
- **坏数据不再变成卡片**:读 `thoughts.jsonl` 时只认字符串。之前只判了 `!t.text`,
|
|
6
|
+
手改坏的文件(或未来换字段)会让对象漏进去,变成一张正文是「独处时写下:[object Object]」的
|
|
7
|
+
永久记忆。现在 `typeof t.text !== 'string'` 直接跳过,空字符串也跳过。
|
|
8
|
+
- 测试 28 加两条:坏数据不进库、空字符串不进库。
|
|
9
|
+
- 顺手修了测试 15 的时效 bug:它假设「现在」已经过了 `nightlyHour`,凌晨 0 点跑必挂。
|
|
10
|
+
改成显式构造 02:30。
|
|
11
|
+
|
|
12
|
+
## 0.18.1
|
|
3
13
|
## 0.18.1
|
|
4
14
|
|
|
5
15
|
「独处」独立成团后有自己的颜色了。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cortico-world-memory-core",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "四个工具写卡、查卡、改状态、排日程,改口不覆盖。每轮自动把 2 条相关旧记忆推到眼前,不用模型自己查;搜索分「对得上 / 可能沾边」两档。冷层收走三个月没想起的流水账,不删、可回暖。3D 星图一眼看完整个库。常驻约 1,000 token,本地不联网,MIT。\n\nQQ 交流群:745879632",
|
|
6
6
|
"keywords": [
|
package/src/world.ts
CHANGED
|
@@ -1445,12 +1445,13 @@ export class MemoryCoreWorld implements World {
|
|
|
1445
1445
|
const out: { id: string; ts: string; text: string; importance: number }[] = [];
|
|
1446
1446
|
for (const line of lines) {
|
|
1447
1447
|
try {
|
|
1448
|
-
const t = JSON.parse(line) as { id?: string; ts?: string; text?:
|
|
1449
|
-
|
|
1448
|
+
const t = JSON.parse(line) as { id?: string; ts?: string; text?: unknown; importance?: number };
|
|
1449
|
+
// 同上:非字符串一律跳过,别让它变成一张「[object Object]」的卡片
|
|
1450
|
+
if (typeof t.text !== 'string' || !t.text.trim()) continue;
|
|
1450
1451
|
out.push({
|
|
1451
1452
|
id: String(t.id ?? ''),
|
|
1452
1453
|
ts: String(t.ts ?? ''),
|
|
1453
|
-
text:
|
|
1454
|
+
text: t.text,
|
|
1454
1455
|
importance: Number(t.importance) || 0,
|
|
1455
1456
|
});
|
|
1456
1457
|
} catch {
|