luckytri 1.0.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.
- package/.github/SECURITY.md +71 -0
- package/LICENSE +21 -0
- package/README.en.md +250 -0
- package/README.md +250 -0
- package/bin/luckytri.js +107 -0
- package/docs/brand/banner.png +0 -0
- package/docs/brand/palette.png +0 -0
- package/docs/brand/portrait.png +0 -0
- package/docs/en/CHANGELOG.md +113 -0
- package/docs/en/architecture.md +152 -0
- package/docs/en/chat-style.md +62 -0
- package/docs/en/connect.md +63 -0
- package/docs/en/guide.md +216 -0
- package/docs/en/her-life.md +189 -0
- package/docs/en/npm-release.md +25 -0
- package/docs/en/plugins.md +82 -0
- package/docs/en/recovery.md +28 -0
- package/docs/en/time.md +71 -0
- package/docs/en/webui.md +73 -0
- package/docs/zh/CHANGELOG.md +113 -0
- package/docs/zh/architecture.md +152 -0
- package/docs/zh/chat-style.md +62 -0
- package/docs/zh/connect.md +63 -0
- package/docs/zh/guide.md +216 -0
- package/docs/zh/her-life.md +189 -0
- package/docs/zh/npm-release.md +33 -0
- package/docs/zh/plugins.md +82 -0
- package/docs/zh/recovery.md +28 -0
- package/docs/zh/time.md +71 -0
- package/docs/zh/webui.md +73 -0
- package/package.json +108 -0
- package/plugins/sdk/index.d.ts +155 -0
- package/plugins/sdk/testing.js +58 -0
- package/plugins/weather/index.js +82 -0
- package/plugins/weather/luckytri-plugin.json +29 -0
- package/public/app/assets/ChatsPage-C-FcRapR.js +3 -0
- package/public/app/assets/ChatsPage-DfyPCS9N.css +1 -0
- package/public/app/assets/Empty-CpP5kQHH.js +2 -0
- package/public/app/assets/Empty-DmUB2-Bk.css +1 -0
- package/public/app/assets/Field-D4gY-INU.js +1 -0
- package/public/app/assets/HeartPage-Bft9wZp5.css +1 -0
- package/public/app/assets/HeartPage-CPy_thQd.js +1 -0
- package/public/app/assets/LifePage-BUi5euBF.css +1 -0
- package/public/app/assets/LifePage-CxWvwmSf.js +1 -0
- package/public/app/assets/MemoryPage-DC4rhQ68.js +1 -0
- package/public/app/assets/MemoryPage-cZvXfkXb.css +1 -0
- package/public/app/assets/NaturePage-CTXHCE2D.css +1 -0
- package/public/app/assets/NaturePage-IvYw04Zq.js +3 -0
- package/public/app/assets/PeoplePage-BmUxkrOU.css +1 -0
- package/public/app/assets/PeoplePage-Cqefm9-q.js +1 -0
- package/public/app/assets/PluginsPage-DKSaKvXb.js +2 -0
- package/public/app/assets/PluginsPage-HyBe5D8w.css +1 -0
- package/public/app/assets/SystemPage-CAMPoYqM.css +1 -0
- package/public/app/assets/SystemPage-CJmtJkrK.js +1 -0
- package/public/app/assets/TimePage-BOms_n4I.css +1 -0
- package/public/app/assets/TimePage-Cw44inM4.js +3 -0
- package/public/app/assets/formatters-ZmW_xFHw.js +1 -0
- package/public/app/assets/index-BheRW-1t.js +4 -0
- package/public/app/assets/index-YDz1ree1.css +1 -0
- package/public/app/assets/knowledge-DG0e0uKw.js +1 -0
- package/public/app/assets/liquid-garden-IMoHBwzc.png +0 -0
- package/public/app/assets/luckytri-home-95QKeMtc.png +0 -0
- package/public/app/assets/media-BzPDBm7e.js +1 -0
- package/public/app/index.html +27 -0
- package/public/guide.en.html +1053 -0
- package/public/guide.html +893 -0
- package/public/plugin-kit/v1/bridge.js +30 -0
- package/public/plugin-kit/v1/kit.css +14 -0
- package/public/tutorial.en.md +214 -0
- package/public/tutorial.md +214 -0
- package/scripts/backup.js +311 -0
- package/scripts/browser.js +41 -0
- package/scripts/launch.js +94 -0
- package/scripts/plugin.js +150 -0
- package/scripts/proxy-config.js +167 -0
- package/scripts/recover.js +26 -0
- package/scripts/runtime.js +25 -0
- package/scripts/service.js +47 -0
- package/scripts/setup.js +50 -0
- package/scripts/start-server.js +41 -0
- package/scripts/stop.js +36 -0
- package/server/app.js +96 -0
- package/server/channels/adapters.js +27 -0
- package/server/channels/contract.js +57 -0
- package/server/channels/hub.js +165 -0
- package/server/channels/index.js +25 -0
- package/server/channels/onebot/adapter.js +288 -0
- package/server/channels/onebot/index.js +336 -0
- package/server/channels/onebot/token.js +3 -0
- package/server/channels/qqbot/adapter.js +253 -0
- package/server/channels/qqbot/api.js +199 -0
- package/server/channels/qqbot/credentials.js +11 -0
- package/server/channels/qqbot/gateway.js +274 -0
- package/server/channels/qqbot/index.js +389 -0
- package/server/channels/segments.js +40 -0
- package/server/channels/session-key.js +153 -0
- package/server/channels/state.js +42 -0
- package/server/core/api.js +564 -0
- package/server/core/capabilities.js +208 -0
- package/server/core/context-builder.js +288 -0
- package/server/core/context-compactor.js +454 -0
- package/server/core/conversation-cues.js +325 -0
- package/server/core/conversation-manager.js +87 -0
- package/server/core/events.js +60 -0
- package/server/core/feedback.js +8 -0
- package/server/core/group-style.js +72 -0
- package/server/core/image-preprocessor.js +208 -0
- package/server/core/initiative-context.js +66 -0
- package/server/core/input-budget.js +32 -0
- package/server/core/local-demo.js +98 -0
- package/server/core/message-manager.js +118 -0
- package/server/core/message-scheduler.js +78 -0
- package/server/core/model-json.js +190 -0
- package/server/core/model-manager.js +1213 -0
- package/server/core/model-presets.js +900 -0
- package/server/core/name-call.js +29 -0
- package/server/core/net-guard.js +49 -0
- package/server/core/network.js +157 -0
- package/server/core/orchestrator.js +569 -0
- package/server/core/perceivers.js +91 -0
- package/server/core/person-name.js +22 -0
- package/server/core/persona-manager.js +243 -0
- package/server/core/reply-delivery.js +393 -0
- package/server/core/reply-target-resolver.js +50 -0
- package/server/core/repository.js +293 -0
- package/server/core/response-generator.js +50 -0
- package/server/core/response-validator.js +508 -0
- package/server/core/retired-prompts.js +51 -0
- package/server/core/sessions.js +109 -0
- package/server/core/speaker-names.js +92 -0
- package/server/core/topic-tracker.js +65 -0
- package/server/core/turn-processor.js +630 -0
- package/server/core/turn.js +236 -0
- package/server/core/vision-manager.js +633 -0
- package/server/http.js +18 -0
- package/server/i18n/decisions.js +206 -0
- package/server/i18n/errors.js +497 -0
- package/server/i18n/index.js +144 -0
- package/server/i18n/labels.js +653 -0
- package/server/i18n/models.js +111 -0
- package/server/index.js +102 -0
- package/server/knowledge/api.js +342 -0
- package/server/knowledge/embedding-profile.js +114 -0
- package/server/knowledge/index.js +13 -0
- package/server/knowledge/manager.js +386 -0
- package/server/knowledge/retrieval.js +93 -0
- package/server/knowledge/schema.js +154 -0
- package/server/knowledge/vector-index.js +90 -0
- package/server/mind/affect.js +265 -0
- package/server/mind/anticipations.js +507 -0
- package/server/mind/api.js +703 -0
- package/server/mind/attention.js +200 -0
- package/server/mind/bonds.js +558 -0
- package/server/mind/budget.js +152 -0
- package/server/mind/clock.js +83 -0
- package/server/mind/context-selection.js +61 -0
- package/server/mind/continuity.js +562 -0
- package/server/mind/conversation-origin.js +175 -0
- package/server/mind/day-planner.js +324 -0
- package/server/mind/days.js +210 -0
- package/server/mind/evidence-read.js +45 -0
- package/server/mind/evidence.js +148 -0
- package/server/mind/faces.js +138 -0
- package/server/mind/guard.js +60 -0
- package/server/mind/index.js +445 -0
- package/server/mind/initiative.js +333 -0
- package/server/mind/life/activities.js +21 -0
- package/server/mind/life/context.js +309 -0
- package/server/mind/life/diary.js +786 -0
- package/server/mind/life/growth.js +252 -0
- package/server/mind/life/index.js +1049 -0
- package/server/mind/life/presence.js +305 -0
- package/server/mind/meetings.js +1069 -0
- package/server/mind/memory-policy.js +48 -0
- package/server/mind/memory.js +888 -0
- package/server/mind/nature.js +262 -0
- package/server/mind/novelty.js +19 -0
- package/server/mind/observations.js +84 -0
- package/server/mind/own-day.js +324 -0
- package/server/mind/own-voice.js +318 -0
- package/server/mind/periods.js +118 -0
- package/server/mind/reading.js +120 -0
- package/server/mind/salience.js +201 -0
- package/server/mind/schema.js +562 -0
- package/server/mind/self.js +484 -0
- package/server/mind/senses.js +53 -0
- package/server/mind/thoughts.js +274 -0
- package/server/mind/time/activity-clock.js +196 -0
- package/server/mind/time/agenda.js +242 -0
- package/server/mind/time/api.js +200 -0
- package/server/mind/time/attention.js +34 -0
- package/server/mind/time/availability.js +69 -0
- package/server/mind/time/commitment-review.js +198 -0
- package/server/mind/time/delivery-links.js +130 -0
- package/server/mind/time/executor.js +512 -0
- package/server/mind/time/experiences.js +128 -0
- package/server/mind/time/games.js +562 -0
- package/server/mind/time/index.js +739 -0
- package/server/mind/time/intent.js +166 -0
- package/server/mind/time/kinds.js +171 -0
- package/server/mind/time/model-material.js +77 -0
- package/server/mind/time/plugin-activity.js +207 -0
- package/server/mind/time/presentation.js +51 -0
- package/server/mind/time/schedule.js +83 -0
- package/server/mind/time/schema.js +84 -0
- package/server/mind/time/search.js +383 -0
- package/server/mind/time/sharing.js +472 -0
- package/server/mind/time/task-links.js +311 -0
- package/server/mind/time/tasks.js +587 -0
- package/server/mind/time/works.js +432 -0
- package/server/mind/traits.js +191 -0
- package/server/mind/util.js +110 -0
- package/server/mind/view.js +273 -0
- package/server/paths.js +102 -0
- package/server/plugins/api.js +204 -0
- package/server/plugins/host.js +967 -0
- package/server/plugins/install.js +295 -0
- package/server/plugins/manifest.js +201 -0
- package/server/plugins/permissions.js +42 -0
- package/server/plugins/runner/guard.mjs +36 -0
- package/server/plugins/runner/worker.mjs +250 -0
- package/server/plugins/schema.js +91 -0
- package/server/plugins/zip.js +112 -0
- package/server/startup-lock.js +118 -0
- package/server/storage/archive.js +241 -0
- package/server/storage/backup-cleanup-worker.js +8 -0
- package/server/storage/backup-cleanup.js +414 -0
- package/server/storage/backup-lock.js +76 -0
- package/server/storage/backup-scheduler.js +131 -0
- package/server/storage/store.js +199 -0
- package/server/studio/display-names.js +138 -0
- package/server/studio/management.js +102 -0
- package/server/studio/readiness.js +190 -0
- package/server/studio/settings.js +236 -0
- package/server/version.js +10 -0
|
@@ -0,0 +1,1053 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
|
6
|
+
<title>LuckyTri v1.0.0 · Getting Started</title>
|
|
7
|
+
<style>
|
|
8
|
+
* {
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
}
|
|
11
|
+
html {
|
|
12
|
+
scroll-behavior: smooth;
|
|
13
|
+
}
|
|
14
|
+
body {
|
|
15
|
+
margin: 0;
|
|
16
|
+
background: #f6f8f3;
|
|
17
|
+
color: #34412f;
|
|
18
|
+
font:
|
|
19
|
+
14px/1.9 "Microsoft YaHei",
|
|
20
|
+
system-ui,
|
|
21
|
+
sans-serif;
|
|
22
|
+
}
|
|
23
|
+
a {
|
|
24
|
+
color: #638353;
|
|
25
|
+
text-underline-offset: 4px;
|
|
26
|
+
}
|
|
27
|
+
header {
|
|
28
|
+
background: #edf3e6;
|
|
29
|
+
border-bottom: 1px solid #dfe7d6;
|
|
30
|
+
padding: 24px max(24px, calc((100% - 1160px) / 2));
|
|
31
|
+
display: flex;
|
|
32
|
+
justify-content: space-between;
|
|
33
|
+
gap: 20px;
|
|
34
|
+
align-items: center;
|
|
35
|
+
}
|
|
36
|
+
header b {
|
|
37
|
+
font-size: 20px;
|
|
38
|
+
letter-spacing: 2px;
|
|
39
|
+
}
|
|
40
|
+
header small {
|
|
41
|
+
display: block;
|
|
42
|
+
color: #93a187;
|
|
43
|
+
font-size: 10px;
|
|
44
|
+
letter-spacing: 2px;
|
|
45
|
+
}
|
|
46
|
+
header nav {
|
|
47
|
+
display: flex;
|
|
48
|
+
gap: 14px;
|
|
49
|
+
align-items: center;
|
|
50
|
+
flex-wrap: wrap;
|
|
51
|
+
justify-content: flex-end;
|
|
52
|
+
font-size: 12px;
|
|
53
|
+
}
|
|
54
|
+
button {
|
|
55
|
+
font: inherit;
|
|
56
|
+
background: white;
|
|
57
|
+
border: 1px solid #dce5d2;
|
|
58
|
+
border-radius: 7px;
|
|
59
|
+
padding: 7px 13px;
|
|
60
|
+
color: #6e8760;
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
}
|
|
63
|
+
.lang {
|
|
64
|
+
border: 1px solid #dce5d2;
|
|
65
|
+
border-radius: 7px;
|
|
66
|
+
padding: 6px 12px;
|
|
67
|
+
background: white;
|
|
68
|
+
text-decoration: none;
|
|
69
|
+
}
|
|
70
|
+
.layout {
|
|
71
|
+
max-width: 1200px;
|
|
72
|
+
margin: 36px auto;
|
|
73
|
+
display: grid;
|
|
74
|
+
grid-template-columns: 225px minmax(0, 1fr);
|
|
75
|
+
gap: 32px;
|
|
76
|
+
padding: 0 24px;
|
|
77
|
+
}
|
|
78
|
+
.toc {
|
|
79
|
+
position: sticky;
|
|
80
|
+
top: 24px;
|
|
81
|
+
align-self: start;
|
|
82
|
+
font-size: 12px;
|
|
83
|
+
}
|
|
84
|
+
.toc p {
|
|
85
|
+
font-size: 10px;
|
|
86
|
+
letter-spacing: 2px;
|
|
87
|
+
color: #a5b097;
|
|
88
|
+
}
|
|
89
|
+
.toc a {
|
|
90
|
+
display: block;
|
|
91
|
+
text-decoration: none;
|
|
92
|
+
color: #819176;
|
|
93
|
+
padding: 8px 0;
|
|
94
|
+
}
|
|
95
|
+
.toc a:hover {
|
|
96
|
+
color: #456638;
|
|
97
|
+
}
|
|
98
|
+
article {
|
|
99
|
+
background: #fff;
|
|
100
|
+
border: 1px solid #e5ebdf;
|
|
101
|
+
border-radius: 14px;
|
|
102
|
+
padding: 38px 44px;
|
|
103
|
+
min-width: 0;
|
|
104
|
+
}
|
|
105
|
+
h1 {
|
|
106
|
+
font-size: 27px;
|
|
107
|
+
line-height: 1.5;
|
|
108
|
+
margin: 0 0 20px;
|
|
109
|
+
font-weight: 600;
|
|
110
|
+
}
|
|
111
|
+
h2 {
|
|
112
|
+
font-size: 20px;
|
|
113
|
+
scroll-margin-top: 24px;
|
|
114
|
+
border-top: 1px solid #e9eee4;
|
|
115
|
+
margin: 38px 0 20px;
|
|
116
|
+
padding-top: 28px;
|
|
117
|
+
}
|
|
118
|
+
h3 {
|
|
119
|
+
font-size: 15px;
|
|
120
|
+
margin-top: 24px;
|
|
121
|
+
}
|
|
122
|
+
p,
|
|
123
|
+
li {
|
|
124
|
+
color: #6f7d65;
|
|
125
|
+
}
|
|
126
|
+
strong {
|
|
127
|
+
color: #4e6442;
|
|
128
|
+
}
|
|
129
|
+
pre {
|
|
130
|
+
overflow: auto;
|
|
131
|
+
background: #f4f7ef;
|
|
132
|
+
padding: 18px 20px;
|
|
133
|
+
border: 1px solid #e5ecdc;
|
|
134
|
+
border-radius: 8px;
|
|
135
|
+
line-height: 1.7;
|
|
136
|
+
font-size: 12px;
|
|
137
|
+
color: #5d774e;
|
|
138
|
+
}
|
|
139
|
+
code {
|
|
140
|
+
font-family: Consolas, monospace;
|
|
141
|
+
overflow-wrap: anywhere;
|
|
142
|
+
}
|
|
143
|
+
p code,
|
|
144
|
+
li code,
|
|
145
|
+
td code {
|
|
146
|
+
background: #f1f5ec;
|
|
147
|
+
padding: 2px 5px;
|
|
148
|
+
border-radius: 4px;
|
|
149
|
+
font-size: 12px;
|
|
150
|
+
}
|
|
151
|
+
table {
|
|
152
|
+
border-collapse: collapse;
|
|
153
|
+
width: 100%;
|
|
154
|
+
table-layout: fixed;
|
|
155
|
+
font-size: 12px;
|
|
156
|
+
margin: 22px 0;
|
|
157
|
+
}
|
|
158
|
+
th,
|
|
159
|
+
td {
|
|
160
|
+
border: 1px solid #e4eadc;
|
|
161
|
+
padding: 10px 12px;
|
|
162
|
+
text-align: left;
|
|
163
|
+
overflow-wrap: anywhere;
|
|
164
|
+
}
|
|
165
|
+
th {
|
|
166
|
+
background: #eff4e9;
|
|
167
|
+
color: #708462;
|
|
168
|
+
}
|
|
169
|
+
td {
|
|
170
|
+
color: #7d8974;
|
|
171
|
+
}
|
|
172
|
+
ul,
|
|
173
|
+
ol {
|
|
174
|
+
padding-left: 24px;
|
|
175
|
+
}
|
|
176
|
+
blockquote {
|
|
177
|
+
border-left: 3px solid #b6c7a5;
|
|
178
|
+
padding-left: 18px;
|
|
179
|
+
}
|
|
180
|
+
footer {
|
|
181
|
+
text-align: center;
|
|
182
|
+
font-size: 10px;
|
|
183
|
+
color: #a8b19f;
|
|
184
|
+
padding: 0 20px 35px;
|
|
185
|
+
}
|
|
186
|
+
@media (max-width: 760px) {
|
|
187
|
+
header {
|
|
188
|
+
align-items: flex-start;
|
|
189
|
+
flex-direction: column;
|
|
190
|
+
}
|
|
191
|
+
header nav {
|
|
192
|
+
justify-content: flex-start;
|
|
193
|
+
}
|
|
194
|
+
.layout {
|
|
195
|
+
grid-template-columns: 1fr;
|
|
196
|
+
margin: 20px auto;
|
|
197
|
+
padding: 0 14px;
|
|
198
|
+
}
|
|
199
|
+
.toc {
|
|
200
|
+
position: static;
|
|
201
|
+
display: flex;
|
|
202
|
+
gap: 10px;
|
|
203
|
+
overflow: auto;
|
|
204
|
+
}
|
|
205
|
+
.toc p {
|
|
206
|
+
display: none;
|
|
207
|
+
}
|
|
208
|
+
.toc a {
|
|
209
|
+
white-space: nowrap;
|
|
210
|
+
border: 1px solid #e0e8d8;
|
|
211
|
+
border-radius: 7px;
|
|
212
|
+
padding: 7px 10px;
|
|
213
|
+
}
|
|
214
|
+
article {
|
|
215
|
+
padding: 24px 20px;
|
|
216
|
+
}
|
|
217
|
+
h1 {
|
|
218
|
+
font-size: 23px;
|
|
219
|
+
}
|
|
220
|
+
h2 {
|
|
221
|
+
font-size: 18px;
|
|
222
|
+
}
|
|
223
|
+
th,
|
|
224
|
+
td {
|
|
225
|
+
padding: 7px;
|
|
226
|
+
}
|
|
227
|
+
table {
|
|
228
|
+
font-size: 11px;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
@media print {
|
|
232
|
+
body {
|
|
233
|
+
background: white;
|
|
234
|
+
}
|
|
235
|
+
.toc,
|
|
236
|
+
header nav {
|
|
237
|
+
display: none;
|
|
238
|
+
}
|
|
239
|
+
.layout {
|
|
240
|
+
display: block;
|
|
241
|
+
margin: 0;
|
|
242
|
+
max-width: none;
|
|
243
|
+
padding: 0;
|
|
244
|
+
}
|
|
245
|
+
article {
|
|
246
|
+
border: 0;
|
|
247
|
+
padding: 0;
|
|
248
|
+
}
|
|
249
|
+
header {
|
|
250
|
+
padding: 0 0 20px;
|
|
251
|
+
background: white;
|
|
252
|
+
}
|
|
253
|
+
a {
|
|
254
|
+
color: inherit;
|
|
255
|
+
}
|
|
256
|
+
h2 {
|
|
257
|
+
break-after: avoid;
|
|
258
|
+
}
|
|
259
|
+
pre,
|
|
260
|
+
tr {
|
|
261
|
+
break-inside: avoid;
|
|
262
|
+
}
|
|
263
|
+
footer {
|
|
264
|
+
padding: 20px 0;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
</style>
|
|
268
|
+
</head>
|
|
269
|
+
<body>
|
|
270
|
+
<header>
|
|
271
|
+
<div>
|
|
272
|
+
<b>LuckyTri · Handbook</b><small>TIME · MEMORY · CHOICE / v1.0.0</small>
|
|
273
|
+
</div>
|
|
274
|
+
<nav>
|
|
275
|
+
<a href="/#setup">Back to the studio</a
|
|
276
|
+
><a href="/tutorial.en.md" download>Download Markdown</a
|
|
277
|
+
><button onclick="window.print()">Print / Save as PDF</button
|
|
278
|
+
><a class="lang" href="/guide.html" hreflang="zh" lang="zh">中文</a>
|
|
279
|
+
</nav>
|
|
280
|
+
</header>
|
|
281
|
+
<div class="layout">
|
|
282
|
+
<nav class="toc" aria-label="Guide contents">
|
|
283
|
+
<p>CONTENTS</p>
|
|
284
|
+
<a href="#step-1">1. Start</a><a href="#step-2">2. Local tokens</a
|
|
285
|
+
><a href="#step-3">3. Try it in simulation mode first</a
|
|
286
|
+
><a href="#step-4">4. Connect a model</a
|
|
287
|
+
><a href="#step-5">5. Connect QQ</a
|
|
288
|
+
><a href="#step-6">6. Let TA join a session</a
|
|
289
|
+
><a href="#step-7">7. TA, memory and knowledge</a
|
|
290
|
+
><a href="#step-8">8. Backup and stop</a
|
|
291
|
+
><a href="#step-9">9. Troubleshooting</a>
|
|
292
|
+
</nav>
|
|
293
|
+
<article>
|
|
294
|
+
<h1>LuckyTri · Getting Started</h1>
|
|
295
|
+
<p>
|
|
296
|
+
LuckyTri runs on your own computer and meets people through QQ. QQ has
|
|
297
|
+
two ways to connect, and you pick one: <strong>OneBot 11</strong> (you
|
|
298
|
+
bring a connector, reverse WebSocket) or the
|
|
299
|
+
<strong>QQ official bot</strong> (QQ Open Platform). With either, her
|
|
300
|
+
memory, mood and behavior are exactly the same; only the way messages
|
|
301
|
+
arrive differs. You configure the model API yourself.
|
|
302
|
+
</p>
|
|
303
|
+
<p>
|
|
304
|
+
The top-right corner of the interface switches between
|
|
305
|
+
"中文" and "English". Chinese is the default and
|
|
306
|
+
your choice is remembered in this browser. What she says, writes in
|
|
307
|
+
her diary and keeps as her own thoughts is never translated; that is
|
|
308
|
+
her own content.
|
|
309
|
+
</p>
|
|
310
|
+
<h2 id="step-1">1. Start</h2>
|
|
311
|
+
<p>You need Node.js 24.5 or newer. Install globally:</p>
|
|
312
|
+
<pre><code class="language-powershell">node --version
|
|
313
|
+
npm install -g luckytri
|
|
314
|
+
luckytri
|
|
315
|
+
</code></pre>
|
|
316
|
+
<p>
|
|
317
|
+
LuckyTri starts in the background and opens
|
|
318
|
+
<a href="http://127.0.0.1:3210">http://127.0.0.1:3210</a>, creating
|
|
319
|
+
local configuration on the first run. The package includes the built
|
|
320
|
+
WebUI. The experimental-SQLite notice does not mean the start failed.
|
|
321
|
+
</p>
|
|
322
|
+
<p>
|
|
323
|
+
Use <code>luckytri paths</code> to find <code>.env</code>, open it in
|
|
324
|
+
a local editor and enter <code>ADMIN_TOKEN</code> in the studio.
|
|
325
|
+
<code>luckytri --no-browser</code> launches without opening a browser,
|
|
326
|
+
<code>luckytri start</code> runs in the foreground, and
|
|
327
|
+
<code>luckytri stop</code> stops the service. Update with
|
|
328
|
+
<code>luckytri stop</code>,
|
|
329
|
+
<code>npm install -g luckytri@latest</code>, then
|
|
330
|
+
<code>luckytri</code>. Your configuration and data stay intact.
|
|
331
|
+
Default directories are listed in the
|
|
332
|
+
<a href="../../README.en.md#configuration-data-and-privacy">README</a
|
|
333
|
+
>.
|
|
334
|
+
</p>
|
|
335
|
+
<p>
|
|
336
|
+
For source development, run <code>npm install</code>,
|
|
337
|
+
<code>npm run setup</code>, <code>npm run build</code> and
|
|
338
|
+
<code>npm start</code> in the checkout. Later examples using
|
|
339
|
+
<code>npm run setup/stop/backup/recovery/plugin</code> apply to source
|
|
340
|
+
checkouts; global users use the corresponding
|
|
341
|
+
<code>luckytri setup/stop/backup/recovery/plugin</code> commands.
|
|
342
|
+
</p>
|
|
343
|
+
<p>
|
|
344
|
+
On Windows you can double-click <code>启动LuckyTri.cmd</code> for
|
|
345
|
+
daily use. If the service is already running, it only opens LuckyTri.
|
|
346
|
+
Closing the browser does not stop the service; to stop it double-click
|
|
347
|
+
<code>停止LuckyTri.cmd</code> or run <code>npm run stop</code> in the
|
|
348
|
+
project folder. That command stops this project only and leaves other
|
|
349
|
+
Node processes alone. When running in the foreground you can also
|
|
350
|
+
press <code>Ctrl+C</code> in that terminal.
|
|
351
|
+
</p>
|
|
352
|
+
<p>
|
|
353
|
+
LuckyTri is "TA's little world". The left navigation has
|
|
354
|
+
three groups and ten entries:
|
|
355
|
+
</p>
|
|
356
|
+
<table>
|
|
357
|
+
<thead>
|
|
358
|
+
<tr>
|
|
359
|
+
<th>Group</th>
|
|
360
|
+
<th>Entry</th>
|
|
361
|
+
<th>What is inside</th>
|
|
362
|
+
</tr>
|
|
363
|
+
</thead>
|
|
364
|
+
<tbody>
|
|
365
|
+
<tr>
|
|
366
|
+
<td>TA</td>
|
|
367
|
+
<td>Now</td>
|
|
368
|
+
<td>
|
|
369
|
+
TA's mood right now, what she is doing, what she said
|
|
370
|
+
lately, what is on her mind and what she is waiting for;
|
|
371
|
+
today's timeline, token usage and the status bar
|
|
372
|
+
</td>
|
|
373
|
+
</tr>
|
|
374
|
+
<tr>
|
|
375
|
+
<td>TA</td>
|
|
376
|
+
<td>Inner life</td>
|
|
377
|
+
<td>
|
|
378
|
+
The star map (TA's threads of self), notes she keeps in
|
|
379
|
+
mind, the mood ribbon
|
|
380
|
+
</td>
|
|
381
|
+
</tr>
|
|
382
|
+
<tr>
|
|
383
|
+
<td>TA</td>
|
|
384
|
+
<td>People</td>
|
|
385
|
+
<td>
|
|
386
|
+
The people galaxy, each person's detail page, how TA is in
|
|
387
|
+
each group
|
|
388
|
+
</td>
|
|
389
|
+
</tr>
|
|
390
|
+
<tr>
|
|
391
|
+
<td>TA</td>
|
|
392
|
+
<td>Lifetime</td>
|
|
393
|
+
<td>
|
|
394
|
+
The diary and TA on that day, reviews, "my road so
|
|
395
|
+
far" and chapters, promises and anticipation, the bookshelf
|
|
396
|
+
</td>
|
|
397
|
+
</tr>
|
|
398
|
+
<tr>
|
|
399
|
+
<td>Daily life</td>
|
|
400
|
+
<td>Time</td>
|
|
401
|
+
<td>
|
|
402
|
+
The record of TA's actual life: today's activity,
|
|
403
|
+
to-dos, works library, ongoing projects, experiences
|
|
404
|
+
</td>
|
|
405
|
+
</tr>
|
|
406
|
+
<tr>
|
|
407
|
+
<td>Daily life</td>
|
|
408
|
+
<td>Chat</td>
|
|
409
|
+
<td>
|
|
410
|
+
Session list, live chat and "why she said this",
|
|
411
|
+
feedback, session settings, simulated messages, back to that
|
|
412
|
+
moment (replay)
|
|
413
|
+
</td>
|
|
414
|
+
</tr>
|
|
415
|
+
<tr>
|
|
416
|
+
<td>Daily life</td>
|
|
417
|
+
<td>Memory</td>
|
|
418
|
+
<td>What TA remembers, the bookshelf</td>
|
|
419
|
+
</tr>
|
|
420
|
+
<tr>
|
|
421
|
+
<td>Settings</td>
|
|
422
|
+
<td>Nature</td>
|
|
423
|
+
<td>
|
|
424
|
+
Name and character (the glow beside it previews live), daily
|
|
425
|
+
rhythm, TA's days, daily tokens, advanced prompts, trial
|
|
426
|
+
chat
|
|
427
|
+
</td>
|
|
428
|
+
</tr>
|
|
429
|
+
<tr>
|
|
430
|
+
<td>Settings</td>
|
|
431
|
+
<td>System</td>
|
|
432
|
+
<td>Connect QQ, model library, run switches</td>
|
|
433
|
+
</tr>
|
|
434
|
+
<tr>
|
|
435
|
+
<td>Settings</td>
|
|
436
|
+
<td>Plugins</td>
|
|
437
|
+
<td>
|
|
438
|
+
Enable, install and remove the ways she touches the world. See
|
|
439
|
+
<a href="plugins.md">Plugins</a>
|
|
440
|
+
</td>
|
|
441
|
+
</tr>
|
|
442
|
+
</tbody>
|
|
443
|
+
</table>
|
|
444
|
+
<p>
|
|
445
|
+
The colors, sky and motion follow TA's mood and rhythm: warm when
|
|
446
|
+
she is happy, grey-blue when she is low, night once she is asleep. At
|
|
447
|
+
the bottom left you can pin one theme or turn on "Reduce
|
|
448
|
+
motion". The small TA at the bottom right answers a poke, a long
|
|
449
|
+
press is a head-pat, and a double click or "Chat" opens the
|
|
450
|
+
trial chat. These are interface animations only and never change her
|
|
451
|
+
mind. On a phone the navigation sits at the bottom and the other
|
|
452
|
+
entries are under "More".
|
|
453
|
+
</p>
|
|
454
|
+
<h2 id="step-2">2. Local tokens</h2>
|
|
455
|
+
<p>
|
|
456
|
+
Configuration is created on first launch. You can also initialize in
|
|
457
|
+
advance:
|
|
458
|
+
</p>
|
|
459
|
+
<pre><code class="language-powershell">luckytri setup
|
|
460
|
+
luckytri paths
|
|
461
|
+
</code></pre>
|
|
462
|
+
<p>
|
|
463
|
+
When there is no <code>.env</code>, setup writes an admin token and an
|
|
464
|
+
OneBot connection token. An existing <code>.env</code> is kept as it
|
|
465
|
+
is.
|
|
466
|
+
</p>
|
|
467
|
+
<pre><code class="language-dotenv">HOST=127.0.0.1
|
|
468
|
+
PORT=3210
|
|
469
|
+
ADMIN_TOKEN=
|
|
470
|
+
ONEBOT_TOKEN=
|
|
471
|
+
LLM_API_KEY=
|
|
472
|
+
</code></pre>
|
|
473
|
+
<table>
|
|
474
|
+
<thead>
|
|
475
|
+
<tr>
|
|
476
|
+
<th>Field</th>
|
|
477
|
+
<th>Purpose</th>
|
|
478
|
+
</tr>
|
|
479
|
+
</thead>
|
|
480
|
+
<tbody>
|
|
481
|
+
<tr>
|
|
482
|
+
<td><code>ADMIN_TOKEN</code></td>
|
|
483
|
+
<td>
|
|
484
|
+
Opens LuckyTri and calls the HTTP API; the stop command uses it
|
|
485
|
+
too
|
|
486
|
+
</td>
|
|
487
|
+
</tr>
|
|
488
|
+
<tr>
|
|
489
|
+
<td><code>ONEBOT_TOKEN</code></td>
|
|
490
|
+
<td>
|
|
491
|
+
The OneBot 11 connector uses it for
|
|
492
|
+
<code>/onebot/v11/ws</code> (only needed for OneBot)
|
|
493
|
+
</td>
|
|
494
|
+
</tr>
|
|
495
|
+
<tr>
|
|
496
|
+
<td><code>LLM_API_KEY</code></td>
|
|
497
|
+
<td>
|
|
498
|
+
Optional; when set it takes precedence over the model key saved
|
|
499
|
+
in LuckyTri
|
|
500
|
+
</td>
|
|
501
|
+
</tr>
|
|
502
|
+
<tr>
|
|
503
|
+
<td><code>LUCKYTRI_CHANNEL</code></td>
|
|
504
|
+
<td>
|
|
505
|
+
Optional; <code>onebot</code> or <code>qqbot</code>. When set,
|
|
506
|
+
the connection method cannot be changed in the interface
|
|
507
|
+
</td>
|
|
508
|
+
</tr>
|
|
509
|
+
<tr>
|
|
510
|
+
<td><code>QQBOT_APP_ID</code> / <code>QQBOT_APP_SECRET</code></td>
|
|
511
|
+
<td>
|
|
512
|
+
Optional; credentials of the QQ official bot, they take
|
|
513
|
+
precedence over what is saved in the interface
|
|
514
|
+
</td>
|
|
515
|
+
</tr>
|
|
516
|
+
<tr>
|
|
517
|
+
<td><code>HOST</code> / <code>PORT</code></td>
|
|
518
|
+
<td>Listen address and port; keep the defaults for local use</td>
|
|
519
|
+
</tr>
|
|
520
|
+
</tbody>
|
|
521
|
+
</table>
|
|
522
|
+
<p>
|
|
523
|
+
The first time the page loads data it asks for
|
|
524
|
+
<code>ADMIN_TOKEN</code>. The token stays in the current tab only.
|
|
525
|
+
Restart after changing <code>.env</code>. Never give
|
|
526
|
+
<code>ADMIN_TOKEN</code> to the QQ connector, and do not treat
|
|
527
|
+
<code>ONEBOT_TOKEN</code> as the studio password.
|
|
528
|
+
</p>
|
|
529
|
+
<h2 id="step-3">3. Try it in simulation mode first</h2>
|
|
530
|
+
<p>Simulation mode is on by default, so nothing is sent to QQ.</p>
|
|
531
|
+
<ol>
|
|
532
|
+
<li>
|
|
533
|
+
Open "Chat", click "+ Add session" above the
|
|
534
|
+
session list and enter a test group number and name.
|
|
535
|
+
</li>
|
|
536
|
+
<li>
|
|
537
|
+
In the chat in the middle click "Simulated message", type
|
|
538
|
+
an ordinary line as one of the group members and send it.
|
|
539
|
+
</li>
|
|
540
|
+
<li>
|
|
541
|
+
Click "Why she said that" under TA's reply to see the
|
|
542
|
+
reason. "TA glanced over it" and "TA looked but
|
|
543
|
+
stayed quiet" show up as dividers in the chat.
|
|
544
|
+
</li>
|
|
545
|
+
</ol>
|
|
546
|
+
<p>
|
|
547
|
+
Without a model key, simulated replies use local samples and call no
|
|
548
|
+
model. Once there is a key, the same path runs the real speaking flow,
|
|
549
|
+
still without sending to QQ. Simulated messages go into a simulated
|
|
550
|
+
session and never change TA's mood, relationships or memory.
|
|
551
|
+
</p>
|
|
552
|
+
<p>
|
|
553
|
+
"Simulated message" is only available in simulation mode.
|
|
554
|
+
The "Chat" of the small TA and the trial chat to the right
|
|
555
|
+
of "Nature" are different: they go through the real pipeline
|
|
556
|
+
and read TA's mind as it is now, and the Nature page can even
|
|
557
|
+
include an unsaved draft, but nothing is written and nothing is sent
|
|
558
|
+
to QQ.
|
|
559
|
+
</p>
|
|
560
|
+
<h2 id="step-4">4. Connect a model</h2>
|
|
561
|
+
<p>
|
|
562
|
+
Open "System → Model library", click "+ Add model"
|
|
563
|
+
and choose a preset.
|
|
564
|
+
</p>
|
|
565
|
+
<ul>
|
|
566
|
+
<li>
|
|
567
|
+
For the API address enter the root of the provider's compatible
|
|
568
|
+
endpoint. The program appends <code>/chat/completions</code> itself;
|
|
569
|
+
do not write the full path again.
|
|
570
|
+
</li>
|
|
571
|
+
<li>For the model name enter a model ID the provider accepts.</li>
|
|
572
|
+
<li>Leaving the API key empty keeps the saved key.</li>
|
|
573
|
+
</ul>
|
|
574
|
+
<p>
|
|
575
|
+
A preset only fills in a common address and model name; the real
|
|
576
|
+
models are whatever your provider's console shows. Speaking
|
|
577
|
+
decisions and replies need the model to return a JSON object.
|
|
578
|
+
</p>
|
|
579
|
+
<p>
|
|
580
|
+
After saving, click "Test this model's connection". The
|
|
581
|
+
test carries no group chat text. Test again after changing the
|
|
582
|
+
address, model or key.
|
|
583
|
+
</p>
|
|
584
|
+
<p>
|
|
585
|
+
You can also stay in simulation mode and trial-chat with TA under
|
|
586
|
+
"Nature" to see how she speaks before letting her join real
|
|
587
|
+
QQ.
|
|
588
|
+
</p>
|
|
589
|
+
<h3>Reading images</h3>
|
|
590
|
+
<p>
|
|
591
|
+
Enable "Image understanding" in the model profile and use a
|
|
592
|
+
model whose provider supports vision. Images can be read from QQ URLs,
|
|
593
|
+
local cache files or the image-cache API. Originals up to 32 MiB and
|
|
594
|
+
80 million pixels are accepted by default, so ordinary photos and
|
|
595
|
+
screenshots larger than 4 MiB are no longer rejected outright. Small
|
|
596
|
+
images retain their bytes after decoding validation. Large screenshots
|
|
597
|
+
first try lossless compression, then encoding compression or
|
|
598
|
+
proportional resizing as needed. Photos are oriented correctly without
|
|
599
|
+
cropping. Each image sent to the model defaults to at most 4 MiB, 8192
|
|
600
|
+
pixels on its longest side and 16 million output pixels. Originals
|
|
601
|
+
stay unchanged and duplicate detection uses their original contents.
|
|
602
|
+
</p>
|
|
603
|
+
<p>
|
|
604
|
+
Downloads have a 30-second timeout by default. An interrupted or
|
|
605
|
+
damaged image fails independently of other images in the batch. AVIF
|
|
606
|
+
is converted to a common format; animated images contribute their
|
|
607
|
+
first frame, which does not establish the full animation. Large Base64
|
|
608
|
+
images returned by QQ's image-cache API no longer fall under the
|
|
609
|
+
ordinary 1 MiB message limit; ordinary messages keep that limit.
|
|
610
|
+
</p>
|
|
611
|
+
<p>
|
|
612
|
+
To adjust this, set <code>VISION_SOURCE_MAX_MB</code> (4–64, default
|
|
613
|
+
32), <code>VISION_MODEL_MAX_MB</code> (1–4, default 4) or
|
|
614
|
+
<code>VISION_DOWNLOAD_TIMEOUT_SECONDS</code> (5–120, default 30) in
|
|
615
|
+
<code>.env</code>, then restart. Interpretation still depends on the
|
|
616
|
+
selected model's visual abilities and an available provider
|
|
617
|
+
endpoint.
|
|
618
|
+
</p>
|
|
619
|
+
<h2 id="step-5">5. Connect QQ</h2>
|
|
620
|
+
<p>
|
|
621
|
+
Open "System → Connect QQ". There are two options at the
|
|
622
|
+
top: <strong>OneBot 11</strong> and <strong>QQ official bot</strong>,
|
|
623
|
+
and only one is used at a time. Switching drops the current
|
|
624
|
+
connection; sessions from the previous method stay readable but can no
|
|
625
|
+
longer be sent to. See <code>docs/en/connect.md</code> for how the two
|
|
626
|
+
compare; the steps are below.
|
|
627
|
+
</p>
|
|
628
|
+
<h3>Option one: OneBot 11</h3>
|
|
629
|
+
<p>
|
|
630
|
+
LuckyTri only implements the reverse-WebSocket side of OneBot 11. You
|
|
631
|
+
prepare and manage the connector yourself.
|
|
632
|
+
</p>
|
|
633
|
+
<ol>
|
|
634
|
+
<li>
|
|
635
|
+
Set <code>ONEBOT_TOKEN</code> in the local <code>.env</code> and
|
|
636
|
+
restart LuckyTri.
|
|
637
|
+
</li>
|
|
638
|
+
<li>
|
|
639
|
+
In the connector's own network settings add an OneBot 11 reverse
|
|
640
|
+
WebSocket client:
|
|
641
|
+
</li>
|
|
642
|
+
</ol>
|
|
643
|
+
<table>
|
|
644
|
+
<thead>
|
|
645
|
+
<tr>
|
|
646
|
+
<th>Item</th>
|
|
647
|
+
<th>Value on this machine</th>
|
|
648
|
+
</tr>
|
|
649
|
+
</thead>
|
|
650
|
+
<tbody>
|
|
651
|
+
<tr>
|
|
652
|
+
<td>Protocol</td>
|
|
653
|
+
<td>OneBot 11</td>
|
|
654
|
+
</tr>
|
|
655
|
+
<tr>
|
|
656
|
+
<td>WebSocket URL</td>
|
|
657
|
+
<td><code>ws://127.0.0.1:3210/onebot/v11/ws</code></td>
|
|
658
|
+
</tr>
|
|
659
|
+
<tr>
|
|
660
|
+
<td>Token</td>
|
|
661
|
+
<td><code>ONEBOT_TOKEN</code> from <code>.env</code></td>
|
|
662
|
+
</tr>
|
|
663
|
+
<tr>
|
|
664
|
+
<td>Message format</td>
|
|
665
|
+
<td>array</td>
|
|
666
|
+
</tr>
|
|
667
|
+
<tr>
|
|
668
|
+
<td>Enabled</td>
|
|
669
|
+
<td>on, then save</td>
|
|
670
|
+
</tr>
|
|
671
|
+
</tbody>
|
|
672
|
+
</table>
|
|
673
|
+
<ol start="3">
|
|
674
|
+
<li>
|
|
675
|
+
Log in to QQ in the connector. The account must already be in the
|
|
676
|
+
target group; LuckyTri does not store QQ passwords.
|
|
677
|
+
</li>
|
|
678
|
+
</ol>
|
|
679
|
+
<p>
|
|
680
|
+
<code>3210</code> is LuckyTri's port. When the connector and
|
|
681
|
+
LuckyTri are on different machines or in containers,
|
|
682
|
+
<code>127.0.0.1</code> points at each own environment: replace it with
|
|
683
|
+
LuckyTri's real address and configure
|
|
684
|
+
<code>ADMIN_TOKEN</code> first.
|
|
685
|
+
</p>
|
|
686
|
+
<h3>Option two: QQ official bot</h3>
|
|
687
|
+
<p>
|
|
688
|
+
No QQ account login and no extra connector are needed; LuckyTri
|
|
689
|
+
connects to the QQ Open Platform by itself.
|
|
690
|
+
</p>
|
|
691
|
+
<ol>
|
|
692
|
+
<li>
|
|
693
|
+
On the QQ Open Platform create a bot, note its
|
|
694
|
+
<strong>AppID</strong> and <strong>AppSecret</strong>, enable group
|
|
695
|
+
and one-to-one messages as the platform requires, and add the bot to
|
|
696
|
+
the group you test with or as a contact. The platform's entry
|
|
697
|
+
points and review rules change over time; follow the Open
|
|
698
|
+
Platform's current instructions.
|
|
699
|
+
</li>
|
|
700
|
+
<li>
|
|
701
|
+
In "System → Connect QQ" choose "QQ official
|
|
702
|
+
bot", fill in the AppID and AppSecret and save. You can also
|
|
703
|
+
set <code>QQBOT_APP_ID</code> and <code>QQBOT_APP_SECRET</code> in
|
|
704
|
+
<code>.env</code>. The AppSecret is never shown again after saving.
|
|
705
|
+
</li>
|
|
706
|
+
<li>
|
|
707
|
+
When the status reads "Connected", @ her in the group or
|
|
708
|
+
message her privately. For her to see every group message, enable
|
|
709
|
+
"receive all messages" on the Open Platform; without it
|
|
710
|
+
she only receives messages that @ her, and the connection page says
|
|
711
|
+
so.
|
|
712
|
+
</li>
|
|
713
|
+
<li>
|
|
714
|
+
The official interface gives no group names, so new sessions are
|
|
715
|
+
shown by number. You can rename a session under "Chat".
|
|
716
|
+
</li>
|
|
717
|
+
</ol>
|
|
718
|
+
<p>
|
|
719
|
+
With both options, connected only means the transport works. After a
|
|
720
|
+
message arrives from the target group, the session appears in the
|
|
721
|
+
session list under "Chat"; newly discovered sessions are
|
|
722
|
+
paused by default.
|
|
723
|
+
</p>
|
|
724
|
+
<h2 id="step-6">6. Let TA join a session</h2>
|
|
725
|
+
<ol>
|
|
726
|
+
<li>
|
|
727
|
+
In "System → Run switches" confirm chatting is allowed,
|
|
728
|
+
turn simulation mode off and save. The status bar under
|
|
729
|
+
"Now" shows both.
|
|
730
|
+
</li>
|
|
731
|
+
<li>
|
|
732
|
+
In "Chat" select the target group and click
|
|
733
|
+
"Resume" under "This session" on the right, or
|
|
734
|
+
flip the switch in the list.
|
|
735
|
+
</li>
|
|
736
|
+
<li>In QQ @ her, or just call TA by name.</li>
|
|
737
|
+
<li>
|
|
738
|
+
Go back to "Chat" to read the messages and "Why she
|
|
739
|
+
said that".
|
|
740
|
+
</li>
|
|
741
|
+
</ol>
|
|
742
|
+
<p>
|
|
743
|
+
Whether she speaks is TA's own decision; there is no participation
|
|
744
|
+
probability and no cooldown. When she is addressed by name, in a
|
|
745
|
+
private chat, quoted, or a crisis signal appears, TA always looks
|
|
746
|
+
closely and then chooses to answer, react briefly, say she does not
|
|
747
|
+
feel like talking, or stay silent; the reason is shown under
|
|
748
|
+
"Chat" and "Now → TA today". Ordinary group
|
|
749
|
+
messages get a close look only when TA cares: she was just talking,
|
|
750
|
+
someone asks everyone, the topic touches her interests, someone
|
|
751
|
+
familiar is speaking, a lot of messages piled up. Otherwise she only
|
|
752
|
+
glances, calls no model, and reads them together at the next close
|
|
753
|
+
look. If she seems too quiet, raise "Proactive" under
|
|
754
|
+
"Nature".
|
|
755
|
+
</p>
|
|
756
|
+
<p>
|
|
757
|
+
TA sleeps at 02:00 and wakes at 08:00 by default. Drag the moon and
|
|
758
|
+
the sun under "Nature → Daily rhythm" to change this, or
|
|
759
|
+
turn it off. If she is called while asleep she looks once she wakes,
|
|
760
|
+
and the whole interface turns to night. The per-minute limit on
|
|
761
|
+
speaking turns stays, to prevent bursts of consecutive replies.
|
|
762
|
+
</p>
|
|
763
|
+
<p>
|
|
764
|
+
Once "Image understanding" is on for a model, images in
|
|
765
|
+
private chats, @ messages or quotes are read locally first and then
|
|
766
|
+
shown to the model. When the main model cannot see images, pick
|
|
767
|
+
another vision-capable model with image understanding on under
|
|
768
|
+
"Chat → This session → Session settings". A model without
|
|
769
|
+
image understanding never receives the picture.
|
|
770
|
+
</p>
|
|
771
|
+
<h2 id="step-7">7. TA, memory and knowledge</h2>
|
|
772
|
+
<p>
|
|
773
|
+
"Nature" is the only part you write: name, character,
|
|
774
|
+
interests, boundaries, bottom lines and daily rhythm, saved as a new
|
|
775
|
+
version each time. As you drag a character dial, the glow beside it
|
|
776
|
+
follows: gentleness warms the color and lifts the corners of the
|
|
777
|
+
mouth, liveliness makes it bounce faster.
|
|
778
|
+
</p>
|
|
779
|
+
<p>
|
|
780
|
+
Everything else grows from experience: TA's self is the stars of
|
|
781
|
+
the "Inner life" star map, her feeling for each person is
|
|
782
|
+
under "People", and how she is in each group is in the group
|
|
783
|
+
faces below "People". Open any of them to see where each
|
|
784
|
+
change came from and undo what feels wrong; what was undone is never
|
|
785
|
+
written back. Threads that have not been touched for a long time
|
|
786
|
+
slowly fade into the "far away" of the map; they are not
|
|
787
|
+
deleted and come back when talked about. The record of her time alone,
|
|
788
|
+
her diary, night sorting, reviews and autobiography rewrites, together
|
|
789
|
+
with what she is waiting for (arrangements others mentioned, things
|
|
790
|
+
she promised; they can be undone), are all under "Lifetime".
|
|
791
|
+
Daily token cap, background share, night sorting and the review
|
|
792
|
+
interval are set under "Nature → TA's days".
|
|
793
|
+
</p>
|
|
794
|
+
<p>
|
|
795
|
+
In "Memory" pick a session first; you can also filter by
|
|
796
|
+
person.
|
|
797
|
+
</p>
|
|
798
|
+
<ul>
|
|
799
|
+
<li>
|
|
800
|
+
TA has one memory across all sessions: what was learned elsewhere is
|
|
801
|
+
only recalled when relevant; what was learned in a private chat is
|
|
802
|
+
marked "known privately" and not said in public; what was
|
|
803
|
+
asked to be kept secret stays in the original session. You can
|
|
804
|
+
adjust discretion, lock or undo each memory. Memories about a person
|
|
805
|
+
also appear on that person's detail page under
|
|
806
|
+
"People".
|
|
807
|
+
</li>
|
|
808
|
+
<li>
|
|
809
|
+
When a group member says "remember, I…", it goes straight
|
|
810
|
+
into what TA remembers (passwords, verification codes and the like
|
|
811
|
+
are not remembered).
|
|
812
|
+
</li>
|
|
813
|
+
<li>
|
|
814
|
+
Reference material placed in a collection on the
|
|
815
|
+
"Bookshelf" is searched within what the current session
|
|
816
|
+
may see. Group chats never load other private chats'
|
|
817
|
+
collections.
|
|
818
|
+
</li>
|
|
819
|
+
<li>
|
|
820
|
+
Clearing the context in "Chat" does not delete long-term
|
|
821
|
+
memory.
|
|
822
|
+
</li>
|
|
823
|
+
</ul>
|
|
824
|
+
<h2 id="step-8">8. Backup and stop</h2>
|
|
825
|
+
<pre><code class="language-powershell">npm run backup
|
|
826
|
+
npm run stop
|
|
827
|
+
npm start
|
|
828
|
+
</code></pre>
|
|
829
|
+
<p>
|
|
830
|
+
Backups go to <code>data/backups/</code>. The database holds chats,
|
|
831
|
+
memories and any keys saved in it, so keep it like a private file.
|
|
832
|
+
<code>.env</code> is not part of this backup.
|
|
833
|
+
</p>
|
|
834
|
+
<p>
|
|
835
|
+
Everything of TA lives in this one database, so the service backs it
|
|
836
|
+
up automatically while running: by default every 24 hours, in another
|
|
837
|
+
process, it writes a <code>luckytri-auto-*.db</code>, keeps only the
|
|
838
|
+
latest 7 and checks integrity afterwards. An automatic backup holds
|
|
839
|
+
chats, memories, self, diary and relationships, but not model call
|
|
840
|
+
records older than a day (each can be hundreds of KB and would make
|
|
841
|
+
the backup more than ten times bigger), so "Why she said
|
|
842
|
+
that" can only be looked back on for the last day.
|
|
843
|
+
<code>npm run backup</code> is still the full backup. Adjust in
|
|
844
|
+
<code>.env</code>:
|
|
845
|
+
</p>
|
|
846
|
+
<table>
|
|
847
|
+
<thead>
|
|
848
|
+
<tr>
|
|
849
|
+
<th>Variable</th>
|
|
850
|
+
<th>Meaning</th>
|
|
851
|
+
<th>Default</th>
|
|
852
|
+
</tr>
|
|
853
|
+
</thead>
|
|
854
|
+
<tbody>
|
|
855
|
+
<tr>
|
|
856
|
+
<td><code>BACKUP_INTERVAL_HOURS</code></td>
|
|
857
|
+
<td>
|
|
858
|
+
Interval between automatic backups, <code>0</code> turns them
|
|
859
|
+
off
|
|
860
|
+
</td>
|
|
861
|
+
<td><code>24</code></td>
|
|
862
|
+
</tr>
|
|
863
|
+
<tr>
|
|
864
|
+
<td><code>BACKUP_KEEP</code></td>
|
|
865
|
+
<td>How many automatic backups to keep</td>
|
|
866
|
+
<td><code>7</code></td>
|
|
867
|
+
</tr>
|
|
868
|
+
<tr>
|
|
869
|
+
<td><code>BACKUP_TRACE_DAYS</code></td>
|
|
870
|
+
<td>Days of call records kept inside a backup</td>
|
|
871
|
+
<td><code>1</code></td>
|
|
872
|
+
</tr>
|
|
873
|
+
<tr>
|
|
874
|
+
<td><code>BACKUP_DIR</code></td>
|
|
875
|
+
<td>Backup folder</td>
|
|
876
|
+
<td><code>data/backups</code></td>
|
|
877
|
+
</tr>
|
|
878
|
+
</tbody>
|
|
879
|
+
</table>
|
|
880
|
+
<p>
|
|
881
|
+
To take an automatic backup right now:
|
|
882
|
+
<code>node scripts/backup.js --auto --force</code>. A failed automatic
|
|
883
|
+
backup is noted in the launcher window or
|
|
884
|
+
<code>data/launcher.log</code> and retried after longer and longer
|
|
885
|
+
pauses. A backup on the same disk as the database cannot survive disk
|
|
886
|
+
failure; copy important backups elsewhere yourself.
|
|
887
|
+
</p>
|
|
888
|
+
<p>
|
|
889
|
+
When <code>DB_PATH</code> points to a different database and
|
|
890
|
+
<code>BACKUP_DIR</code> is unset, backups go into a
|
|
891
|
+
<code>backups</code> folder beside that database, keeping separate
|
|
892
|
+
instances apart.
|
|
893
|
+
</p>
|
|
894
|
+
<p>
|
|
895
|
+
Under System → Data and backups, inspect each historical copy, set a
|
|
896
|
+
daily cleanup time, maximum age and maximum count for full backups, or
|
|
897
|
+
select individual copies for removal. By default, a daily check at
|
|
898
|
+
04:30 server local time selects full backups older than 14 days or
|
|
899
|
+
beyond the newest two. Set the count to 0 to retain no full backups.
|
|
900
|
+
Full and migration snapshots are no longer permanently locked and can
|
|
901
|
+
all be selected manually. Automatic backups rotate only identifiable
|
|
902
|
+
copies belonging to this instance, with the newest two reserved as
|
|
903
|
+
restore points. Unidentifiable older copies, migration, older-version
|
|
904
|
+
and pre-upgrade snapshots are removed only through manual selection.
|
|
905
|
+
</p>
|
|
906
|
+
<p>
|
|
907
|
+
Cleanup verifies a retained automatic backup of this instance from the
|
|
908
|
+
last 72 hours. If the newest copy is damaged, another one is tried.
|
|
909
|
+
New manifests include a database identity so a different instance
|
|
910
|
+
cannot provide the recovery guarantee. Older manifests can still be
|
|
911
|
+
verified and restored, but a refreshed automatic backup is needed
|
|
912
|
+
before they can guarantee cleanup. Backup and cleanup share a folder
|
|
913
|
+
lock; the live database, hard links to it and copies with runtime
|
|
914
|
+
sidecars cannot be removed. Partial failures list the remaining files
|
|
915
|
+
and accurately report the space already freed. Copy historical restore
|
|
916
|
+
points worth keeping to another disk together with their
|
|
917
|
+
<code>.db.json</code> manifests first.
|
|
918
|
+
</p>
|
|
919
|
+
<p>
|
|
920
|
+
To restore, stop the service, move the current
|
|
921
|
+
<code>data/friend.db</code> and its <code>-wal</code> and
|
|
922
|
+
<code>-shm</code> files away, then copy the chosen backup to
|
|
923
|
+
<code>data/friend.db</code>. When <code>DB_PATH</code> is set, work on
|
|
924
|
+
that path. Never keep an old WAL file next to a restored database. The
|
|
925
|
+
safer way is <code>npm run recovery</code>, which verifies a backup
|
|
926
|
+
and restores it into a brand new file; see
|
|
927
|
+
<code>docs/en/recovery.md</code>.
|
|
928
|
+
</p>
|
|
929
|
+
<h2 id="step-9">9. Troubleshooting</h2>
|
|
930
|
+
<table>
|
|
931
|
+
<thead>
|
|
932
|
+
<tr>
|
|
933
|
+
<th>Symptom</th>
|
|
934
|
+
<th>Check first</th>
|
|
935
|
+
</tr>
|
|
936
|
+
</thead>
|
|
937
|
+
<tbody>
|
|
938
|
+
<tr>
|
|
939
|
+
<td>The page does not open</td>
|
|
940
|
+
<td>
|
|
941
|
+
Is Node running, and is the address <code>127.0.0.1:3210</code>
|
|
942
|
+
</td>
|
|
943
|
+
</tr>
|
|
944
|
+
<tr>
|
|
945
|
+
<td>Port already in use</td>
|
|
946
|
+
<td>
|
|
947
|
+
Run <code>npm run stop</code> first; do not kill every node
|
|
948
|
+
process
|
|
949
|
+
</td>
|
|
950
|
+
</tr>
|
|
951
|
+
<tr>
|
|
952
|
+
<td>Wrong token</td>
|
|
953
|
+
<td>
|
|
954
|
+
Use <code>ADMIN_TOKEN</code>; restart after editing
|
|
955
|
+
<code>.env</code>
|
|
956
|
+
</td>
|
|
957
|
+
</tr>
|
|
958
|
+
<tr>
|
|
959
|
+
<td>OneBot not connected</td>
|
|
960
|
+
<td>
|
|
961
|
+
Is the connector logged in; do the URL, port, path and
|
|
962
|
+
<code>ONEBOT_TOKEN</code> all match
|
|
963
|
+
</td>
|
|
964
|
+
</tr>
|
|
965
|
+
<tr>
|
|
966
|
+
<td>Official bot not connected</td>
|
|
967
|
+
<td>
|
|
968
|
+
Are the AppID and AppSecret right, are group and one-to-one
|
|
969
|
+
messages enabled for the bot, can the network reach the QQ Open
|
|
970
|
+
Platform
|
|
971
|
+
</td>
|
|
972
|
+
</tr>
|
|
973
|
+
<tr>
|
|
974
|
+
<td>Official bot only gets @ messages</td>
|
|
975
|
+
<td>
|
|
976
|
+
Enable "receive all messages" on the Open Platform;
|
|
977
|
+
this is a platform permission, not a LuckyTri limit
|
|
978
|
+
</td>
|
|
979
|
+
</tr>
|
|
980
|
+
<tr>
|
|
981
|
+
<td>Connected but no sessions</td>
|
|
982
|
+
<td>
|
|
983
|
+
Send one more new message in QQ; with OneBot also check the
|
|
984
|
+
message format is array
|
|
985
|
+
</td>
|
|
986
|
+
</tr>
|
|
987
|
+
<tr>
|
|
988
|
+
<td>No reply in a group</td>
|
|
989
|
+
<td>
|
|
990
|
+
Global switch, session switch, simulation mode, key; under
|
|
991
|
+
"Chat", was it "TA glanced over it" or did
|
|
992
|
+
TA look closely and choose silence
|
|
993
|
+
</td>
|
|
994
|
+
</tr>
|
|
995
|
+
<tr>
|
|
996
|
+
<td>No reply even when @-ed</td>
|
|
997
|
+
<td>
|
|
998
|
+
Is TA asleep (see "Now", the interface is night), the
|
|
999
|
+
per-minute limit, today's tokens used up, a model error, or
|
|
1000
|
+
TA's own reason
|
|
1001
|
+
</td>
|
|
1002
|
+
</tr>
|
|
1003
|
+
<tr>
|
|
1004
|
+
<td>Model 401 / 403</td>
|
|
1005
|
+
<td>
|
|
1006
|
+
Key and permissions; an environment-variable key may override
|
|
1007
|
+
the one saved in LuckyTri
|
|
1008
|
+
</td>
|
|
1009
|
+
</tr>
|
|
1010
|
+
<tr>
|
|
1011
|
+
<td>Model 404</td>
|
|
1012
|
+
<td>
|
|
1013
|
+
Do not append <code>/chat/completions</code> twice to the API
|
|
1014
|
+
address; check the model ID
|
|
1015
|
+
</td>
|
|
1016
|
+
</tr>
|
|
1017
|
+
<tr>
|
|
1018
|
+
<td>Model returns no JSON</td>
|
|
1019
|
+
<td>
|
|
1020
|
+
Use a model that supports JSON object output and run the
|
|
1021
|
+
connection test first
|
|
1022
|
+
</td>
|
|
1023
|
+
</tr>
|
|
1024
|
+
<tr>
|
|
1025
|
+
<td>Memory did not appear</td>
|
|
1026
|
+
<td>
|
|
1027
|
+
Was it an explicit "remember, I…", was it undone, is
|
|
1028
|
+
its discretion "keep secret" and you are not in the
|
|
1029
|
+
original session
|
|
1030
|
+
</td>
|
|
1031
|
+
</tr>
|
|
1032
|
+
<tr>
|
|
1033
|
+
<td>Too much motion</td>
|
|
1034
|
+
<td>
|
|
1035
|
+
"Reduce motion" at the bottom left; when the system
|
|
1036
|
+
asks for reduced motion, particles and morphing switch off
|
|
1037
|
+
automatically
|
|
1038
|
+
</td>
|
|
1039
|
+
</tr>
|
|
1040
|
+
</tbody>
|
|
1041
|
+
</table>
|
|
1042
|
+
<p>
|
|
1043
|
+
Never post API keys, <code>.env</code> or private chat text anywhere
|
|
1044
|
+
public.
|
|
1045
|
+
</p>
|
|
1046
|
+
</article>
|
|
1047
|
+
</div>
|
|
1048
|
+
<footer>
|
|
1049
|
+
LuckyTri · so that experience and choice stay coherent. This guide matches
|
|
1050
|
+
the v1.0.0 interface.
|
|
1051
|
+
</footer>
|
|
1052
|
+
</body>
|
|
1053
|
+
</html>
|