luckytri 1.0.0 → 1.0.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/.github/SECURITY.md +4 -4
- package/README.en.md +252 -250
- package/README.md +252 -250
- package/bin/luckytri.js +5 -1
- package/docs/en/CHANGELOG.md +8 -0
- package/docs/en/connect.md +18 -18
- package/docs/en/guide.md +202 -216
- package/docs/en/npm-release.md +25 -25
- package/docs/zh/CHANGELOG.md +8 -0
- package/docs/zh/connect.md +17 -17
- package/docs/zh/guide.md +202 -216
- package/docs/zh/npm-release.md +33 -33
- package/package.json +110 -108
- package/plugins/sdk/index.d.ts +155 -155
- package/plugins/sdk/testing.js +58 -58
- package/plugins/weather/index.js +82 -82
- package/plugins/weather/luckytri-plugin.json +29 -29
- package/public/app/assets/ChatsPage-BhlJHseG.js +3 -0
- package/public/app/assets/Empty-DP6WMGHi.js +2 -0
- package/public/app/assets/Field-CtbdqaiB.js +1 -0
- package/public/app/assets/HeartPage-32BeTPn2.js +1 -0
- package/public/app/assets/LifePage-CxSm0XKI.js +1 -0
- package/public/app/assets/MemoryPage-BeKBcPCY.js +1 -0
- package/public/app/assets/NaturePage-NEPYl2HS.js +3 -0
- package/public/app/assets/PeoplePage-DxtpekwM.js +1 -0
- package/public/app/assets/PluginsPage-CVVQwEBI.css +1 -0
- package/public/app/assets/PluginsPage-DksEZbUU.js +2 -0
- package/public/app/assets/{SystemPage-CAMPoYqM.css → SystemPage-BkRu0Rvx.css} +1 -1
- package/public/app/assets/SystemPage-BvzJlHuY.js +1 -0
- package/public/app/assets/TimePage-7-awH5XL.js +3 -0
- package/public/app/assets/index-4rItIkD-.js +4 -0
- package/public/app/assets/{index-YDz1ree1.css → index-DY4e15Kh.css} +1 -1
- package/public/app/assets/{knowledge-DG0e0uKw.js → knowledge-C6_HvoyB.js} +1 -1
- package/public/app/assets/media-SMfTT-yc.js +1 -0
- package/public/app/index.html +3 -3
- package/public/guide.en.html +72 -99
- package/public/guide.html +44 -86
- package/public/tutorial.en.md +25 -39
- package/public/tutorial.md +25 -39
- package/scripts/backup.js +311 -311
- package/scripts/browser.js +41 -41
- package/scripts/import-data.js +128 -0
- package/scripts/launch.js +101 -94
- package/scripts/plugin.js +150 -150
- package/scripts/reset-password.js +22 -0
- package/scripts/runtime.js +25 -25
- package/scripts/service.js +56 -47
- package/scripts/setup.js +50 -50
- package/scripts/start-server.js +41 -41
- package/scripts/stop.js +36 -36
- package/server/app.js +112 -96
- package/server/auth.js +217 -0
- package/server/channels/contract.js +57 -57
- package/server/channels/hub.js +165 -165
- package/server/channels/index.js +28 -25
- package/server/channels/onebot/index.js +335 -336
- package/server/channels/onebot/token.js +22 -3
- package/server/core/capabilities.js +208 -208
- package/server/core/events.js +64 -60
- package/server/core/image-preprocessor.js +208 -208
- package/server/core/model-manager.js +1213 -1213
- package/server/core/net-guard.js +49 -49
- package/server/core/orchestrator.js +569 -569
- package/server/core/perceivers.js +91 -91
- package/server/core/persona-manager.js +243 -243
- package/server/core/repository.js +293 -293
- package/server/core/response-validator.js +508 -508
- package/server/core/turn-processor.js +630 -630
- package/server/core/turn.js +236 -236
- package/server/core/vision-manager.js +633 -633
- package/server/i18n/errors.js +548 -497
- package/server/i18n/labels.js +649 -653
- package/server/index.js +151 -102
- package/server/knowledge/manager.js +386 -386
- package/server/knowledge/schema.js +12 -8
- package/server/local-access.js +32 -0
- package/server/mind/anticipations.js +507 -507
- package/server/mind/api.js +703 -703
- package/server/mind/budget.js +152 -152
- package/server/mind/context-selection.js +61 -61
- package/server/mind/day-planner.js +324 -324
- package/server/mind/evidence.js +148 -148
- package/server/mind/index.js +445 -445
- package/server/mind/life/diary.js +786 -786
- package/server/mind/life/index.js +1049 -1049
- package/server/mind/observations.js +84 -84
- package/server/mind/own-day.js +324 -324
- package/server/mind/own-voice.js +318 -318
- package/server/mind/senses.js +53 -53
- package/server/mind/time/activity-clock.js +196 -196
- package/server/mind/time/availability.js +69 -69
- package/server/mind/time/commitment-review.js +198 -198
- package/server/mind/time/executor.js +512 -512
- package/server/mind/time/experiences.js +128 -128
- package/server/mind/time/games.js +562 -562
- package/server/mind/time/index.js +739 -739
- package/server/mind/time/intent.js +166 -166
- package/server/mind/time/kinds.js +171 -171
- package/server/mind/time/plugin-activity.js +207 -207
- package/server/mind/time/tasks.js +587 -587
- package/server/mind/util.js +110 -110
- package/server/mind/view.js +273 -273
- package/server/paths.js +102 -102
- package/server/plugins/api.js +204 -204
- package/server/plugins/host.js +967 -967
- package/server/plugins/install.js +295 -295
- package/server/plugins/manifest.js +201 -201
- package/server/plugins/permissions.js +42 -42
- package/server/plugins/runner/guard.mjs +36 -36
- package/server/plugins/runner/worker.mjs +250 -250
- package/server/plugins/schema.js +91 -91
- package/server/plugins/zip.js +112 -112
- package/server/startup-lock.js +118 -118
- package/server/storage/archive.js +242 -241
- package/server/storage/backup-cleanup-worker.js +8 -8
- package/server/storage/backup-cleanup.js +415 -414
- package/server/storage/backup-lock.js +76 -76
- package/server/storage/backup-scheduler.js +131 -131
- package/server/storage/data-package.js +298 -0
- package/server/storage/data-transfer-api.js +50 -0
- package/server/storage/data-transfer-worker.js +18 -0
- package/server/storage/data-transfer.js +415 -0
- package/server/storage/store.js +202 -199
- package/server/studio/readiness.js +181 -190
- package/server/studio/settings.js +236 -236
- package/public/app/assets/ChatsPage-C-FcRapR.js +0 -3
- package/public/app/assets/Empty-CpP5kQHH.js +0 -2
- package/public/app/assets/Field-D4gY-INU.js +0 -1
- package/public/app/assets/HeartPage-CPy_thQd.js +0 -1
- package/public/app/assets/LifePage-CxWvwmSf.js +0 -1
- package/public/app/assets/MemoryPage-DC4rhQ68.js +0 -1
- package/public/app/assets/NaturePage-IvYw04Zq.js +0 -3
- package/public/app/assets/PeoplePage-Cqefm9-q.js +0 -1
- package/public/app/assets/PluginsPage-DKSaKvXb.js +0 -2
- package/public/app/assets/PluginsPage-HyBe5D8w.css +0 -1
- package/public/app/assets/SystemPage-CJmtJkrK.js +0 -1
- package/public/app/assets/TimePage-Cw44inM4.js +0 -3
- package/public/app/assets/index-BheRW-1t.js +0 -4
- package/public/app/assets/media-BzPDBm7e.js +0 -1
package/docs/en/connect.md
CHANGED
|
@@ -8,17 +8,17 @@ Only one channel is active at a time. Switch under "System → Connect QQ"; swit
|
|
|
8
8
|
|
|
9
9
|
## How to choose
|
|
10
10
|
|
|
11
|
-
|
|
|
12
|
-
|
|
|
13
|
-
| What you need
|
|
14
|
-
| Direction
|
|
15
|
-
| Logging in to QQ
|
|
16
|
-
| Group message scope
|
|
17
|
-
| Names
|
|
18
|
-
| Recognizing people across groups | By QQ number: the same person in every group and private chat
|
|
19
|
-
| Replying
|
|
20
|
-
| Reaching out
|
|
21
|
-
| Images
|
|
11
|
+
| | OneBot 11 | QQ official bot |
|
|
12
|
+
| -------------------------------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
13
|
+
| What you need | An OneBot 11 connector of your own (with reverse WebSocket client support) and a QQ account | A bot on the QQ Open Platform: AppID and AppSecret |
|
|
14
|
+
| Direction | The connector connects to LuckyTri's `/onebot/v11/ws` | LuckyTri connects to the Open Platform's WebSocket gateway |
|
|
15
|
+
| Logging in to QQ | Done in the connector | Not needed |
|
|
16
|
+
| Group message scope | All group messages | All of them when "receive all messages" is enabled on the Open Platform; otherwise only messages that @ her |
|
|
17
|
+
| Names | Group names and nicknames are available | The official interface gives no group names and one-to-one nicknames are often empty; you can rename a session under "Chat" |
|
|
18
|
+
| Recognizing people across groups | By QQ number: the same person in every group and private chat | The same person has a different openid in each group; she can only tell it is one person when the platform provides a unified identity (`union_openid`) |
|
|
19
|
+
| Replying | Any time | Inside the passive-reply window (5 minutes in groups, 60 minutes in one-to-one) as a reply to the original message, each bubble with a rising sequence number; beyond it a proactive message is sent |
|
|
20
|
+
| Reaching out | No extra limits | Sent as proactive messages; when a person or group has turned the bot's proactive messages off, she waits for them to come to her |
|
|
21
|
+
| Images | Fetched through the connector | Attachment URLs go through the same vision path; only official media domains are allowed |
|
|
22
22
|
|
|
23
23
|
Neither is "more right". If you want every group message and don't mind running a connector, pick OneBot 11. If you would rather not log in to QQ or maintain a connector, pick the official bot and enable "receive all messages" on the Open Platform.
|
|
24
24
|
|
|
@@ -26,14 +26,14 @@ Neither is "more right". If you want every group message and don't mind running
|
|
|
26
26
|
|
|
27
27
|
LuckyTri only implements the reverse-WebSocket side of OneBot 11 and ships no connector.
|
|
28
28
|
|
|
29
|
-
| Item
|
|
30
|
-
|
|
|
31
|
-
| Protocol
|
|
32
|
-
| Reverse WebSocket URL | `ws://127.0.0.1:3210/onebot/v11/ws` (the port is your `PORT`)
|
|
33
|
-
| Token
|
|
34
|
-
| Message format
|
|
29
|
+
| Item | Value |
|
|
30
|
+
| --------------------- | --------------------------------------------------------------------------------------- |
|
|
31
|
+
| Protocol | OneBot 11 |
|
|
32
|
+
| Reverse WebSocket URL | `ws://127.0.0.1:3210/onebot/v11/ws` (the port is your `PORT`) |
|
|
33
|
+
| Token | Not needed locally; remote clients can use the management password or an existing token |
|
|
34
|
+
| Message format | array |
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
For remote or container access, use the reachable LuckyTri address and set a management password locally first. Local clients can keep their existing address and QQ sign-in.
|
|
37
37
|
|
|
38
38
|
## QQ official bot
|
|
39
39
|
|
package/docs/en/guide.md
CHANGED
|
@@ -1,216 +1,202 @@
|
|
|
1
|
-
<p align="right"><a href="../zh/guide.md">中文</a> · <b>English</b></p>
|
|
2
|
-
|
|
3
|
-
# LuckyTri · Getting Started
|
|
4
|
-
|
|
5
|
-
LuckyTri runs on your own computer and meets people through QQ. QQ has two ways to connect, and you pick one: **OneBot 11** (you bring a connector, reverse WebSocket) or the **QQ official bot** (QQ Open Platform). With either, her memory, mood and behavior are exactly the same; only the way messages arrive differs. You configure the model API yourself.
|
|
6
|
-
|
|
7
|
-
The top-right corner of the interface switches between "中文" and "English". Chinese is the default and your choice is remembered in this browser. What she says, writes in her diary and keeps as her own thoughts is never translated; that is her own content.
|
|
8
|
-
|
|
9
|
-
## 1. Start
|
|
10
|
-
|
|
11
|
-
You need Node.js 24.5 or newer. Install globally:
|
|
12
|
-
|
|
13
|
-
```powershell
|
|
14
|
-
node --version
|
|
15
|
-
npm install -g luckytri
|
|
16
|
-
luckytri
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
LuckyTri starts in the background and opens <http://127.0.0.1:3210>, creating local configuration on the first run. The package includes the built WebUI. The experimental-SQLite notice does not mean the start failed.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
For source development, run `npm install`, `npm run setup`, `npm run build` and `npm start` in the checkout. Later examples using `npm run setup/stop/backup/recovery/plugin` apply to source checkouts; global users use the corresponding `luckytri setup/stop/backup/recovery/plugin` commands.
|
|
24
|
-
|
|
25
|
-
On Windows you can double-click `启动LuckyTri.cmd` for daily use. If the service is already running, it only opens LuckyTri. Closing the browser does not stop the service; to stop it double-click `停止LuckyTri.cmd` or run `npm run stop` in the project folder. That command stops this project only and leaves other Node processes alone. When running in the foreground you can also press `Ctrl+C` in that terminal.
|
|
26
|
-
|
|
27
|
-
LuckyTri is "TA's little world". The left navigation has three groups and ten entries:
|
|
28
|
-
|
|
29
|
-
| Group | Entry | What is inside |
|
|
30
|
-
| ---------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
31
|
-
| TA | Now | TA's mood right now, what she is doing, what she said lately, what is on her mind and what she is waiting for; today's timeline, token usage and the status bar |
|
|
32
|
-
| TA | Inner life | The star map (TA's threads of self), notes she keeps in mind, the mood ribbon |
|
|
33
|
-
| TA | People | The people galaxy, each person's detail page, how TA is in each group |
|
|
34
|
-
| TA | Lifetime | The diary and TA on that day, reviews, "my road so far" and chapters, promises and anticipation, the bookshelf |
|
|
35
|
-
| Daily life | Time | The record of TA's actual life: today's activity, to-dos, works library, ongoing projects, experiences |
|
|
36
|
-
| Daily life | Chat | Session list, live chat and "why she said this", feedback, session settings, simulated messages, back to that moment (replay) |
|
|
37
|
-
| Daily life | Memory | What TA remembers, the bookshelf |
|
|
38
|
-
| Settings | Nature | Name and character (the glow beside it previews live), daily rhythm, TA's days, daily tokens, advanced prompts, trial chat |
|
|
39
|
-
| Settings | System | Connect QQ, model library, run switches |
|
|
40
|
-
| Settings | Plugins | Enable, install and remove the ways she touches the world. See [Plugins](plugins.md) |
|
|
41
|
-
|
|
42
|
-
The colors, sky and motion follow TA's mood and rhythm: warm when she is happy, grey-blue when she is low, night once she is asleep. At the bottom left you can pin one theme or turn on "Reduce motion". The small TA at the bottom right answers a poke, a long press is a head-pat, and a double click or "Chat" opens the trial chat. These are interface animations only and never change her mind. On a phone the navigation sits at the bottom and the other entries are under "More".
|
|
43
|
-
|
|
44
|
-
## 2.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
npm run backup
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
|
200
|
-
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
| Wrong token | Use `ADMIN_TOKEN`; restart after editing `.env` |
|
|
204
|
-
| OneBot not connected | Is the connector logged in; do the URL, port, path and `ONEBOT_TOKEN` all match |
|
|
205
|
-
| Official bot not connected | Are the AppID and AppSecret right, are group and one-to-one messages enabled for the bot, can the network reach the QQ Open Platform |
|
|
206
|
-
| Official bot only gets @ messages | Enable "receive all messages" on the Open Platform; this is a platform permission, not a LuckyTri limit |
|
|
207
|
-
| Connected but no sessions | Send one more new message in QQ; with OneBot also check the message format is array |
|
|
208
|
-
| No reply in a group | Global switch, session switch, simulation mode, key; under "Chat", was it "TA glanced over it" or did TA look closely and choose silence |
|
|
209
|
-
| No reply even when @-ed | Is TA asleep (see "Now", the interface is night), the per-minute limit, today's tokens used up, a model error, or TA's own reason |
|
|
210
|
-
| Model 401 / 403 | Key and permissions; an environment-variable key may override the one saved in LuckyTri |
|
|
211
|
-
| Model 404 | Do not append `/chat/completions` twice to the API address; check the model ID |
|
|
212
|
-
| Model returns no JSON | Use a model that supports JSON object output and run the connection test first |
|
|
213
|
-
| Memory did not appear | Was it an explicit "remember, I…", was it undone, is its discretion "keep secret" and you are not in the original session |
|
|
214
|
-
| Too much motion | "Reduce motion" at the bottom left; when the system asks for reduced motion, particles and morphing switch off automatically |
|
|
215
|
-
|
|
216
|
-
Never post API keys, `.env` or private chat text anywhere public.
|
|
1
|
+
<p align="right"><a href="../zh/guide.md">中文</a> · <b>English</b></p>
|
|
2
|
+
|
|
3
|
+
# LuckyTri · Getting Started
|
|
4
|
+
|
|
5
|
+
LuckyTri runs on your own computer and meets people through QQ. QQ has two ways to connect, and you pick one: **OneBot 11** (you bring a connector, reverse WebSocket) or the **QQ official bot** (QQ Open Platform). With either, her memory, mood and behavior are exactly the same; only the way messages arrive differs. You configure the model API yourself.
|
|
6
|
+
|
|
7
|
+
The top-right corner of the interface switches between "中文" and "English". Chinese is the default and your choice is remembered in this browser. What she says, writes in her diary and keeps as her own thoughts is never translated; that is her own content.
|
|
8
|
+
|
|
9
|
+
## 1. Start
|
|
10
|
+
|
|
11
|
+
You need Node.js 24.5 or newer. Install globally:
|
|
12
|
+
|
|
13
|
+
```powershell
|
|
14
|
+
node --version
|
|
15
|
+
npm install -g luckytri
|
|
16
|
+
luckytri
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
LuckyTri starts in the background and opens <http://127.0.0.1:3210>, creating local configuration on the first run. The package includes the built WebUI. The experimental-SQLite notice does not mean the start failed.
|
|
20
|
+
|
|
21
|
+
Set a password in the studio on your first visit. Use `luckytri --no-browser`, `luckytri start` and `luckytri stop` for background, foreground and stop. Update with stop, `npm install -g luckytri@latest`, then launch; password, configuration and data stay intact.
|
|
22
|
+
|
|
23
|
+
For source development, run `npm install`, `npm run setup`, `npm run build` and `npm start` in the checkout. Later examples using `npm run setup/stop/backup/recovery/plugin` apply to source checkouts; global users use the corresponding `luckytri setup/stop/backup/recovery/plugin` commands.
|
|
24
|
+
|
|
25
|
+
On Windows you can double-click `启动LuckyTri.cmd` for daily use. If the service is already running, it only opens LuckyTri. Closing the browser does not stop the service; to stop it double-click `停止LuckyTri.cmd` or run `npm run stop` in the project folder. That command stops this project only and leaves other Node processes alone. When running in the foreground you can also press `Ctrl+C` in that terminal.
|
|
26
|
+
|
|
27
|
+
LuckyTri is "TA's little world". The left navigation has three groups and ten entries:
|
|
28
|
+
|
|
29
|
+
| Group | Entry | What is inside |
|
|
30
|
+
| ---------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
31
|
+
| TA | Now | TA's mood right now, what she is doing, what she said lately, what is on her mind and what she is waiting for; today's timeline, token usage and the status bar |
|
|
32
|
+
| TA | Inner life | The star map (TA's threads of self), notes she keeps in mind, the mood ribbon |
|
|
33
|
+
| TA | People | The people galaxy, each person's detail page, how TA is in each group |
|
|
34
|
+
| TA | Lifetime | The diary and TA on that day, reviews, "my road so far" and chapters, promises and anticipation, the bookshelf |
|
|
35
|
+
| Daily life | Time | The record of TA's actual life: today's activity, to-dos, works library, ongoing projects, experiences |
|
|
36
|
+
| Daily life | Chat | Session list, live chat and "why she said this", feedback, session settings, simulated messages, back to that moment (replay) |
|
|
37
|
+
| Daily life | Memory | What TA remembers, the bookshelf |
|
|
38
|
+
| Settings | Nature | Name and character (the glow beside it previews live), daily rhythm, TA's days, daily tokens, advanced prompts, trial chat |
|
|
39
|
+
| Settings | System | Connect QQ, model library, run switches |
|
|
40
|
+
| Settings | Plugins | Enable, install and remove the ways she touches the world. See [Plugins](plugins.md) |
|
|
41
|
+
|
|
42
|
+
The colors, sky and motion follow TA's mood and rhythm: warm when she is happy, grey-blue when she is low, night once she is asleep. At the bottom left you can pin one theme or turn on "Reduce motion". The small TA at the bottom right answers a poke, a long press is a head-pat, and a double click or "Chat" opens the trial chat. These are interface animations only and never change her mind. On a phone the navigation sits at the bottom and the other entries are under "More".
|
|
43
|
+
|
|
44
|
+
## 2. Set your management password
|
|
45
|
+
|
|
46
|
+
On the first visit, choose and confirm a password of at least 8 characters. Use it to sign in later; no environment-file token is needed. Browser sessions are remembered, and updates or reinstalls preserve the password.
|
|
47
|
+
|
|
48
|
+
Change the password or sign out under System → Run switches. Only a salted verification digest is stored. Existing environment configuration and model keys remain intact.
|
|
49
|
+
|
|
50
|
+
## 3. Try it in simulation mode first
|
|
51
|
+
|
|
52
|
+
Simulation mode is on by default, so nothing is sent to QQ.
|
|
53
|
+
|
|
54
|
+
1. Open "Chat", click "+ Add session" above the session list and enter a test group number and name.
|
|
55
|
+
2. In the chat in the middle click "Simulated message", type an ordinary line as one of the group members and send it.
|
|
56
|
+
3. Click "Why she said that" under TA's reply to see the reason. "TA glanced over it" and "TA looked but stayed quiet" show up as dividers in the chat.
|
|
57
|
+
|
|
58
|
+
Without a model key, simulated replies use local samples and call no model. Once there is a key, the same path runs the real speaking flow, still without sending to QQ. Simulated messages go into a simulated session and never change TA's mood, relationships or memory.
|
|
59
|
+
|
|
60
|
+
"Simulated message" is only available in simulation mode. The "Chat" of the small TA and the trial chat to the right of "Nature" are different: they go through the real pipeline and read TA's mind as it is now, and the Nature page can even include an unsaved draft, but nothing is written and nothing is sent to QQ.
|
|
61
|
+
|
|
62
|
+
## 4. Connect a model
|
|
63
|
+
|
|
64
|
+
Open "System → Model library", click "+ Add model" and choose a preset.
|
|
65
|
+
|
|
66
|
+
- For the API address enter the root of the provider's compatible endpoint. The program appends `/chat/completions` itself; do not write the full path again.
|
|
67
|
+
- For the model name enter a model ID the provider accepts.
|
|
68
|
+
- Leaving the API key empty keeps the saved key.
|
|
69
|
+
|
|
70
|
+
A preset only fills in a common address and model name; the real models are whatever your provider's console shows. Speaking decisions and replies need the model to return a JSON object.
|
|
71
|
+
|
|
72
|
+
After saving, click "Test this model's connection". The test carries no group chat text. Test again after changing the address, model or key.
|
|
73
|
+
|
|
74
|
+
You can also stay in simulation mode and trial-chat with TA under "Nature" to see how she speaks before letting her join real QQ.
|
|
75
|
+
|
|
76
|
+
### Reading images
|
|
77
|
+
|
|
78
|
+
Enable "Image understanding" in the model profile and use a model whose provider supports vision. Images can be read from QQ URLs, local cache files or the image-cache API. Originals up to 32 MiB and 80 million pixels are accepted by default, so ordinary photos and screenshots larger than 4 MiB are no longer rejected outright. Small images retain their bytes after decoding validation. Large screenshots first try lossless compression, then encoding compression or proportional resizing as needed. Photos are oriented correctly without cropping. Each image sent to the model defaults to at most 4 MiB, 8192 pixels on its longest side and 16 million output pixels. Originals stay unchanged and duplicate detection uses their original contents.
|
|
79
|
+
|
|
80
|
+
Downloads have a 30-second timeout by default. An interrupted or damaged image fails independently of other images in the batch. AVIF is converted to a common format; animated images contribute their first frame, which does not establish the full animation. Large Base64 images returned by QQ's image-cache API no longer fall under the ordinary 1 MiB message limit; ordinary messages keep that limit.
|
|
81
|
+
|
|
82
|
+
To adjust this, set `VISION_SOURCE_MAX_MB` (4–64, default 32), `VISION_MODEL_MAX_MB` (1–4, default 4) or `VISION_DOWNLOAD_TIMEOUT_SECONDS` (5–120, default 30) in `.env`, then restart. Interpretation still depends on the selected model's visual abilities and an available provider endpoint.
|
|
83
|
+
|
|
84
|
+
## 5. Connect QQ
|
|
85
|
+
|
|
86
|
+
Open "System → Connect QQ". There are two options at the top: **OneBot 11** and **QQ official bot**, and only one is used at a time. Switching drops the current connection; sessions from the previous method stay readable but can no longer be sent to. See `docs/en/connect.md` for how the two compare; the steps are below.
|
|
87
|
+
|
|
88
|
+
### Option one: OneBot 11
|
|
89
|
+
|
|
90
|
+
LuckyTri only implements the reverse-WebSocket side of OneBot 11. You prepare and manage the connector yourself.
|
|
91
|
+
|
|
92
|
+
1. Local clients need no separate token. Keep an existing client address and QQ sign-in.
|
|
93
|
+
2. In the connector's own network settings add an OneBot 11 reverse WebSocket client:
|
|
94
|
+
|
|
95
|
+
| Item | Value on this machine |
|
|
96
|
+
| -------------- | --------------------------------------------------------------------------------------- |
|
|
97
|
+
| Protocol | OneBot 11 |
|
|
98
|
+
| WebSocket URL | `ws://127.0.0.1:3210/onebot/v11/ws` |
|
|
99
|
+
| Token | Not needed locally; remote clients can use the management password or an existing token |
|
|
100
|
+
| Message format | array |
|
|
101
|
+
| Enabled | on, then save |
|
|
102
|
+
|
|
103
|
+
3. Log in to QQ in the connector. The account must already be in the target group; LuckyTri does not store QQ passwords.
|
|
104
|
+
|
|
105
|
+
In a container or another computer, localhost refers to that environment. Use the reachable LuckyTri address for remote access, set the password locally first, and use HTTPS for remote studio access.
|
|
106
|
+
|
|
107
|
+
### Option two: QQ official bot
|
|
108
|
+
|
|
109
|
+
No QQ account login and no extra connector are needed; LuckyTri connects to the QQ Open Platform by itself.
|
|
110
|
+
|
|
111
|
+
1. On the QQ Open Platform create a bot, note its **AppID** and **AppSecret**, enable group and one-to-one messages as the platform requires, and add the bot to the group you test with or as a contact. The platform's entry points and review rules change over time; follow the Open Platform's current instructions.
|
|
112
|
+
2. In "System → Connect QQ" choose "QQ official bot", fill in the AppID and AppSecret and save. You can also set `QQBOT_APP_ID` and `QQBOT_APP_SECRET` in `.env`. The AppSecret is never shown again after saving.
|
|
113
|
+
3. When the status reads "Connected", @ her in the group or message her privately. For her to see every group message, enable "receive all messages" on the Open Platform; without it she only receives messages that @ her, and the connection page says so.
|
|
114
|
+
4. The official interface gives no group names, so new sessions are shown by number. You can rename a session under "Chat".
|
|
115
|
+
|
|
116
|
+
With both options, connected only means the transport works. After a message arrives from the target group, the session appears in the session list under "Chat"; newly discovered sessions are paused by default.
|
|
117
|
+
|
|
118
|
+
## 6. Let TA join a session
|
|
119
|
+
|
|
120
|
+
1. In "System → Run switches" confirm chatting is allowed, turn simulation mode off and save. The status bar under "Now" shows both.
|
|
121
|
+
2. In "Chat" select the target group and click "Resume" under "This session" on the right, or flip the switch in the list.
|
|
122
|
+
3. In QQ @ her, or just call TA by name.
|
|
123
|
+
4. Go back to "Chat" to read the messages and "Why she said that".
|
|
124
|
+
|
|
125
|
+
Whether she speaks is TA's own decision; there is no participation probability and no cooldown. When she is addressed by name, in a private chat, quoted, or a crisis signal appears, TA always looks closely and then chooses to answer, react briefly, say she does not feel like talking, or stay silent; the reason is shown under "Chat" and "Now → TA today". Ordinary group messages get a close look only when TA cares: she was just talking, someone asks everyone, the topic touches her interests, someone familiar is speaking, a lot of messages piled up. Otherwise she only glances, calls no model, and reads them together at the next close look. If she seems too quiet, raise "Proactive" under "Nature".
|
|
126
|
+
|
|
127
|
+
TA sleeps at 02:00 and wakes at 08:00 by default. Drag the moon and the sun under "Nature → Daily rhythm" to change this, or turn it off. If she is called while asleep she looks once she wakes, and the whole interface turns to night. The per-minute limit on speaking turns stays, to prevent bursts of consecutive replies.
|
|
128
|
+
|
|
129
|
+
Once "Image understanding" is on for a model, images in private chats, @ messages or quotes are read locally first and then shown to the model. When the main model cannot see images, pick another vision-capable model with image understanding on under "Chat → This session → Session settings". A model without image understanding never receives the picture.
|
|
130
|
+
|
|
131
|
+
## 7. TA, memory and knowledge
|
|
132
|
+
|
|
133
|
+
"Nature" is the only part you write: name, character, interests, boundaries, bottom lines and daily rhythm, saved as a new version each time. As you drag a character dial, the glow beside it follows: gentleness warms the color and lifts the corners of the mouth, liveliness makes it bounce faster.
|
|
134
|
+
|
|
135
|
+
Everything else grows from experience: TA's self is the stars of the "Inner life" star map, her feeling for each person is under "People", and how she is in each group is in the group faces below "People". Open any of them to see where each change came from and undo what feels wrong; what was undone is never written back. Threads that have not been touched for a long time slowly fade into the "far away" of the map; they are not deleted and come back when talked about. The record of her time alone, her diary, night sorting, reviews and autobiography rewrites, together with what she is waiting for (arrangements others mentioned, things she promised; they can be undone), are all under "Lifetime". Daily token cap, background share, night sorting and the review interval are set under "Nature → TA's days".
|
|
136
|
+
|
|
137
|
+
In "Memory" pick a session first; you can also filter by person.
|
|
138
|
+
|
|
139
|
+
- TA has one memory across all sessions: what was learned elsewhere is only recalled when relevant; what was learned in a private chat is marked "known privately" and not said in public; what was asked to be kept secret stays in the original session. You can adjust discretion, lock or undo each memory. Memories about a person also appear on that person's detail page under "People".
|
|
140
|
+
- When a group member says "remember, I…", it goes straight into what TA remembers (passwords, verification codes and the like are not remembered).
|
|
141
|
+
- Reference material placed in a collection on the "Bookshelf" is searched within what the current session may see. Group chats never load other private chats' collections.
|
|
142
|
+
- Clearing the context in "Chat" does not delete long-term memory.
|
|
143
|
+
|
|
144
|
+
## 8. Backup and stop
|
|
145
|
+
|
|
146
|
+
```powershell
|
|
147
|
+
npm run backup
|
|
148
|
+
npm run stop
|
|
149
|
+
npm start
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Backups go to `data/backups/`. The database holds chats, memories and any keys saved in it, so keep it like a private file. `.env` is not part of this backup.
|
|
153
|
+
|
|
154
|
+
Everything of TA lives in this one database, so the service backs it up automatically while running: by default every 24 hours, in another process, it writes a `luckytri-auto-*.db`, keeps only the latest 7 and checks integrity afterwards. An automatic backup holds chats, memories, self, diary and relationships, but not model call records older than a day (each can be hundreds of KB and would make the backup more than ten times bigger), so "Why she said that" can only be looked back on for the last day. `npm run backup` is still the full backup. Adjust in `.env`:
|
|
155
|
+
|
|
156
|
+
| Variable | Meaning | Default |
|
|
157
|
+
| ----------------------- | ------------------------------------------------------ | -------------- |
|
|
158
|
+
| `BACKUP_INTERVAL_HOURS` | Interval between automatic backups, `0` turns them off | `24` |
|
|
159
|
+
| `BACKUP_KEEP` | How many automatic backups to keep | `7` |
|
|
160
|
+
| `BACKUP_TRACE_DAYS` | Days of call records kept inside a backup | `1` |
|
|
161
|
+
| `BACKUP_DIR` | Backup folder | `data/backups` |
|
|
162
|
+
|
|
163
|
+
To take an automatic backup right now: `node scripts/backup.js --auto --force`. A failed automatic backup is noted in the launcher window or `data/launcher.log` and retried after longer and longer pauses. A backup on the same disk as the database cannot survive disk failure; copy important backups elsewhere yourself.
|
|
164
|
+
|
|
165
|
+
When `DB_PATH` points to a different database and `BACKUP_DIR` is unset, backups go into a `backups` folder beside that database, keeping separate instances apart.
|
|
166
|
+
|
|
167
|
+
Under System → Data and backups, inspect each historical copy, set a daily cleanup time, maximum age and maximum count for full backups, or select individual copies for removal. By default, a daily check at 04:30 server local time selects full backups older than 14 days or beyond the newest two. Set the count to 0 to retain no full backups. Full and migration snapshots are no longer permanently locked and can all be selected manually. Automatic backups rotate only identifiable copies belonging to this instance, with the newest two reserved as restore points. Unidentifiable older copies, migration, older-version and pre-upgrade snapshots are removed only through manual selection.
|
|
168
|
+
|
|
169
|
+
Cleanup verifies a retained automatic backup of this instance from the last 72 hours. If the newest copy is damaged, another one is tried. New manifests include a database identity so a different instance cannot provide the recovery guarantee. Older manifests can still be verified and restored, but a refreshed automatic backup is needed before they can guarantee cleanup. Backup and cleanup share a folder lock; the live database, hard links to it and copies with runtime sidecars cannot be removed. Partial failures list the remaining files and accurately report the space already freed. Copy historical restore points worth keeping to another disk together with their `.db.json` manifests first.
|
|
170
|
+
|
|
171
|
+
To restore, stop the service, move the current `data/friend.db` and its `-wal` and `-shm` files away, then copy the chosen backup to `data/friend.db`. When `DB_PATH` is set, work on that path. Never keep an old WAL file next to a restored database. The safer way is `npm run recovery`, which verifies a backup and restores it into a brand new file; see `docs/en/recovery.md`.
|
|
172
|
+
|
|
173
|
+
### Import and export from the studio
|
|
174
|
+
|
|
175
|
+
"System → Data and backups" provides "Export data package" and "Choose import file". A `.luckytri` package contains chats, memories, relationships, personal state, diaries, tasks, work versions, knowledge text and settings stored in the database, including saved credentials. Management passwords and login sessions are not migrated. Plugin programs, original knowledge files and the local `.env` are outside the package. Export uses a consistent snapshot while the instance continues running and streams large downloads.
|
|
176
|
+
|
|
177
|
+
Imports accept `.luckytri` packages and existing `.db` / SQLite backups. The default upload limit is 10 GiB; adjust `DATA_TRANSFER_MAX_GB` (1–100) in `.env`. Uploads are checked for package SHA-256, database integrity, references and supported structures. Older versions are upgraded only in staging. The preview shows the name, version and record counts before current data changes, so it can be cancelled.
|
|
178
|
+
|
|
179
|
+
Confirming "Import and restart" stops the instance, retains a complete `luckytri-before-import-*.db` snapshot, replaces the data and restarts automatically. The local management password, current logins, QQ connection settings and backup cleanup rules are preserved. Automatic replies are turned off and plugin execution grants reset. Review connections, models and tasks before enabling replies; reinstall plugins or review their permissions. Import replaces the whole database rather than merging records. Pre-import snapshots can be managed manually and are excluded from scheduled full-backup cleanup.
|
|
180
|
+
|
|
181
|
+
The server removes the export copy after download. Cancelled, expired and interrupted staging files are reclaimed; unused previews expire after one hour. Failed imports retain or restore the original database rather than starting with a partial file.
|
|
182
|
+
|
|
183
|
+
## 9. Troubleshooting
|
|
184
|
+
|
|
185
|
+
| Symptom | Check first |
|
|
186
|
+
| --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
|
|
187
|
+
| The page does not open | Is Node running, and is the address `127.0.0.1:3210` |
|
|
188
|
+
| Port already in use | Run `npm run stop` first; do not kill every node process |
|
|
189
|
+
| Incorrect password | Sign in with your management password; change it under System → Run switches |
|
|
190
|
+
| OneBot not connected | Check sign-in, enabled reverse client, address, port and path; local clients need no token |
|
|
191
|
+
| Official bot not connected | Are the AppID and AppSecret right, are group and one-to-one messages enabled for the bot, can the network reach the QQ Open Platform |
|
|
192
|
+
| Official bot only gets @ messages | Enable "receive all messages" on the Open Platform; this is a platform permission, not a LuckyTri limit |
|
|
193
|
+
| Connected but no sessions | Send one more new message in QQ; with OneBot also check the message format is array |
|
|
194
|
+
| No reply in a group | Global switch, session switch, simulation mode, key; under "Chat", was it "TA glanced over it" or did TA look closely and choose silence |
|
|
195
|
+
| No reply even when @-ed | Is TA asleep (see "Now", the interface is night), the per-minute limit, today's tokens used up, a model error, or TA's own reason |
|
|
196
|
+
| Model 401 / 403 | Key and permissions; an environment-variable key may override the one saved in LuckyTri |
|
|
197
|
+
| Model 404 | Do not append `/chat/completions` twice to the API address; check the model ID |
|
|
198
|
+
| Model returns no JSON | Use a model that supports JSON object output and run the connection test first |
|
|
199
|
+
| Memory did not appear | Was it an explicit "remember, I…", was it undone, is its discretion "keep secret" and you are not in the original session |
|
|
200
|
+
| Too much motion | "Reduce motion" at the bottom left; when the system asks for reduced motion, particles and morphing switch off automatically |
|
|
201
|
+
|
|
202
|
+
Never post API keys, `.env` or private chat text anywhere public.
|