cortico-world-self-awareness 0.3.0 → 0.4.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 +15 -0
- package/package.json +1 -1
- package/src/config.ts +2 -2
- package/src/pool.ts +2 -2
- package/src/think.ts +6 -0
- package/src/world.ts +9 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.1
|
|
4
|
+
|
|
5
|
+
- 「用哪家」改成「**快捷预设**」,说明也重写了。原来那句「选一个就行」会让人以为它决定用哪家服务,
|
|
6
|
+
实际上它只在你把地址和模型留空时才起作用——填了就以你填的为准,选哪个都一样(只有 ollama 例外,它不要密钥)。
|
|
7
|
+
|
|
8
|
+
## 0.4.0
|
|
9
|
+
## 0.4.0
|
|
10
|
+
|
|
11
|
+
- **新 `synthesize` 模式**:手上两件不相干的事,看它们有没有相通的地方。四种变五种。
|
|
12
|
+
「回看 / 走神 / 打算 / 琢磨」都是围绕**一件事**,只有它围绕**两件事**——联系和创造是从那儿来的。
|
|
13
|
+
提示词里给了出口:真的没有就说没有。
|
|
14
|
+
- **出错能看见了**:状态灯直接显示错误(比如「出错:HTTP 401」)。以前 key 失效了,
|
|
15
|
+
界面上还显示正常在跑。
|
|
16
|
+
|
|
17
|
+
## 0.3.0
|
|
3
18
|
## 0.3.0
|
|
4
19
|
|
|
5
20
|
五件事(界面 / 素材 / 延续 / 情绪 / 时间感),外加两个真 bug。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cortico-world-self-awareness",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "桌宠自己的内在时间线:没人说话的时候她也在想事情——想起旧事、走神、反复琢磨一件没想明白的。\n\n它只负责「想」:想到的写在本机一个文件里,不发消息,也不占对话的 token。配合「记忆核心」使用——你开口时,记忆核心会挑一条带进上下文,标明时间,并说清那不一定是你现在的想法。单独装也能跑,但那是一本她自己不会翻的日记。\n\n模型自选,OpenAI 兼容接口就行;默认一天最多 12 次,一次几分钱。\n\nQQ 交流群:745879632",
|
|
6
6
|
"keywords": [
|
package/src/config.ts
CHANGED
|
@@ -75,8 +75,8 @@ const RAW_GROUP: ConfigGroup = {
|
|
|
75
75
|
'worlds.self-awareness.provider': {
|
|
76
76
|
type: 'string',
|
|
77
77
|
enum: ['deepseek', 'openai', 'ollama', 'custom'],
|
|
78
|
-
title: '
|
|
79
|
-
description: '
|
|
78
|
+
title: '快捷预设',
|
|
79
|
+
description: '只是快捷选择:下面两项留空才用它。你已经填了地址和模型,那选哪个都一样——只有 ollama 例外,它不需要密钥。',
|
|
80
80
|
default: 'deepseek',
|
|
81
81
|
'x-hot': true,
|
|
82
82
|
} as never,
|
package/src/pool.ts
CHANGED
|
@@ -9,9 +9,9 @@ import { appendFileSync, existsSync, mkdirSync, readFileSync, writeFileSync } fr
|
|
|
9
9
|
import { join } from 'node:path';
|
|
10
10
|
import { randomUUID } from 'node:crypto';
|
|
11
11
|
|
|
12
|
-
export type ThoughtMode = 'reflect' | 'wonder' | 'plan' | 'doubt';
|
|
12
|
+
export type ThoughtMode = 'reflect' | 'wonder' | 'plan' | 'doubt' | 'synthesize';
|
|
13
13
|
|
|
14
|
-
export const THOUGHT_MODES: ThoughtMode[] = ['reflect', 'wonder', 'plan', 'doubt'];
|
|
14
|
+
export const THOUGHT_MODES: ThoughtMode[] = ['reflect', 'wonder', 'plan', 'doubt', 'synthesize'];
|
|
15
15
|
|
|
16
16
|
export interface Thought {
|
|
17
17
|
id: string;
|
package/src/think.ts
CHANGED
|
@@ -57,6 +57,12 @@ const MODE_ASK: Record<ThoughtMode, (ctx: ThinkContext) => string> = {
|
|
|
57
57
|
ctx.focus
|
|
58
58
|
? `有件事你一直没想明白:「${ctx.focus}」。再想一次,可以还是想不明白。`
|
|
59
59
|
: '有件事你一直没想明白。再想一次,可以还是想不明白。',
|
|
60
|
+
synthesize: (ctx) => {
|
|
61
|
+
const list = ctx.memories ?? [];
|
|
62
|
+
if (list.length < 2) return '你手上只有一件事。试着把它和别的什么连起来想。';
|
|
63
|
+
return `「${clip(list[0], 60)}」和「${clip(list[1], 60)}」——这两件事看着没关系。`
|
|
64
|
+
+ '它们之间有没有相通的地方?\n别硬凑,真的没有就说没有。';
|
|
65
|
+
},
|
|
60
66
|
};
|
|
61
67
|
|
|
62
68
|
export function buildMessages(mode: ThoughtMode, ctx: ThinkContext): { role: string; content: string }[] {
|
package/src/world.ts
CHANGED
|
@@ -132,12 +132,15 @@ export class SelfAwarenessWorld implements World {
|
|
|
132
132
|
lamps: [
|
|
133
133
|
{
|
|
134
134
|
label: '自我意识',
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
135
|
+
// 出错要能一眼看见:不然 key 失效了还以为它在正常工作
|
|
136
|
+
state: this.lastError ? 'offline' : cfg.enabled && endpoint.model ? 'online' : 'offline',
|
|
137
|
+
hint: this.lastError
|
|
138
|
+
? `出错:${clip(this.lastError, 30)}`
|
|
139
|
+
: !cfg.enabled
|
|
140
|
+
? '已关闭'
|
|
141
|
+
: !endpoint.model
|
|
142
|
+
? '还没配模型'
|
|
143
|
+
: `今天想过 ${this.budget.count} 次`,
|
|
141
144
|
},
|
|
142
145
|
],
|
|
143
146
|
badges: [
|