@kanadego/dsh-heartbeat 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/client.js +510 -169
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -300,6 +300,15 @@ dsh plugin --profile web remove @kanadego/dsh-heartbeat
|
|
|
300
300
|
<details open>
|
|
301
301
|
<summary><b>v2.0.x</b></summary>
|
|
302
302
|
|
|
303
|
+
### v2.0.1 · 2026-10-25(客户端界面支持英文)
|
|
304
|
+
|
|
305
|
+
设置卡、状态卡与报告面板的文案全部改走 Harness 的 locale 服务。Harness 切成英文时,心跳的界面跟着变英文;中文界面**一个字都没动**。感谢 [@miztizm](https://github.com/miztizm) 的贡献([#5](https://github.com/Kanadego/dsh-heartbeat/pull/5))。
|
|
306
|
+
|
|
307
|
+
- **界面双语**:157 条文案收进 `heartbeat` 命名空间,zh / en 各一套。语言切换即时生效,不用重启、也不用刷新页面——设置行、状态卡、素材池、用户画像、周报、迁移界面都在里面。
|
|
308
|
+
- **中文逐字未改**:这一版只搬字符串。中文文案一个字没改;原先几个拼接碎片改成了模板,插值之后的渲染结果与原版完全一致。
|
|
309
|
+
- **数据与宿主侧不受影响**:数据目录、配置项、RPC 接口都没动,升级不需要迁移。心跳报告正文(引擎室那份)仍是原来的中文口径,宿主侧的本地化另开一轮做。
|
|
310
|
+
- **兼容性不变**:仍需 DSH 0.1.1 及以上(`locale` 服务从 0.1.1 起就有,已逐个版本验过);取不到 locale 时退回内置中文,不影响界面启动。
|
|
311
|
+
|
|
303
312
|
### v2.0.0 · 2026-10-17(心事匣 + 摘抄本 + 代码审查:22 项修复 + 结构整改)
|
|
304
313
|
|
|
305
314
|
第二次全量代码审查(22 项主发现 + 一节低优先级观察)的修复与结构整改,外加两个新功能:**心事匣**——心跳第一次有了「跳与跳之间的缝」;**摘抄本**——心跳第一次有了自己的笔记本。
|
package/client.js
CHANGED
|
@@ -19,6 +19,338 @@ window.__ModuleLoader__.load({
|
|
|
19
19
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
20
20
|
const React = require("react");
|
|
21
21
|
|
|
22
|
+
// Locale namespace and dictionary. zh is the source of truth: a host
|
|
23
|
+
// without @deepseek-ai/dsh-client-locale falls back to it unchanged.
|
|
24
|
+
const LOCALE_NS = "heartbeat";
|
|
25
|
+
const DICT = {
|
|
26
|
+
zh: {
|
|
27
|
+
"settings.row.label": "心跳",
|
|
28
|
+
"common.loading": "加载中…",
|
|
29
|
+
"common.loadFailed": "加载失败:{error}",
|
|
30
|
+
"common.confirmDelete": "确认删除",
|
|
31
|
+
"common.delete": "删除",
|
|
32
|
+
"common.empty": "(空)",
|
|
33
|
+
"common.labelWithCount": "{label}({count})",
|
|
34
|
+
"common.off": "关闭",
|
|
35
|
+
"common.on": "开启",
|
|
36
|
+
"common.refresh": "刷新",
|
|
37
|
+
"common.remove": "移除",
|
|
38
|
+
"common.save": "保存",
|
|
39
|
+
"common.unknown": "未知",
|
|
40
|
+
"common.add": "添加",
|
|
41
|
+
"error.rpcUnavailable": "RPC 通道不可用(请确认 DSH 正在运行)",
|
|
42
|
+
"error.rpcFailed": "RPC 调用失败",
|
|
43
|
+
"status.loadFailed": "状态获取失败:{error}",
|
|
44
|
+
"status.spoke": "说了:{text}",
|
|
45
|
+
"status.silent": "沉默({reason})",
|
|
46
|
+
"status.spokeFailed": "投递失败({reason})",
|
|
47
|
+
"status.error": "心跳异常({reason})",
|
|
48
|
+
"status.none": "尚无记录",
|
|
49
|
+
"status.currentWithNote": "心跳此刻:{scene}——{note}",
|
|
50
|
+
"status.current": "心跳此刻:{scene}",
|
|
51
|
+
"status.currentEmpty": "心跳此刻:(还没有状态记录)",
|
|
52
|
+
"status.version": "插件版本:v{version}",
|
|
53
|
+
"status.lastBeat": "上次心跳:",
|
|
54
|
+
"status.result": "结果:",
|
|
55
|
+
"status.today": "今日表达:{used} / {max} 条",
|
|
56
|
+
"status.quiet": "当前:静默时段内",
|
|
57
|
+
"status.rhythm": "当前:正常节律(间隔 {interval} 分钟)",
|
|
58
|
+
"status.statusbarOff": "{status}(状态栏已关闭)",
|
|
59
|
+
"status.timeInject": "时间注入:",
|
|
60
|
+
"status.timeInjectOff": "已关闭",
|
|
61
|
+
"status.timeInjectEvery": "每 {interval} 分钟,最近 {last}",
|
|
62
|
+
"status.never": "未发生过",
|
|
63
|
+
"scene.quietHours": "静默时段,世界睡了",
|
|
64
|
+
"scene.justSpoke": "刚去和你说过话",
|
|
65
|
+
"scene.wandering": "正在闲逛看新东西",
|
|
66
|
+
"scene.busy": "看到你在忙,不去打扰",
|
|
67
|
+
"scene.present": "在场待着",
|
|
68
|
+
"scene.away": "你不在,自己待着",
|
|
69
|
+
"sessions.homeName": "心跳正身(引擎室)",
|
|
70
|
+
"sessions.hint": "绑定 = 表达投递 + 对话观察(D13),两个开关可以同时开,也可以在下面逐个切换。心跳正身的思考轮次固定在其自身会话,不受绑定影响。",
|
|
71
|
+
"sessions.boundRow": "🔗 {name}({modes})",
|
|
72
|
+
"sessions.deliverTitleOn": "点击关闭投递",
|
|
73
|
+
"sessions.deliverTitleOff": "点击开启投递",
|
|
74
|
+
"sessions.observeTitleOn": "点击关闭观察",
|
|
75
|
+
"sessions.observeTitleOff": "点击开启观察",
|
|
76
|
+
"sessions.deliver": "投递",
|
|
77
|
+
"sessions.observe": "观察",
|
|
78
|
+
"sessions.unbind": "解绑",
|
|
79
|
+
"sessions.noBound": "(暂无绑定会话——表达只出现在心跳正身会话)",
|
|
80
|
+
"sessions.collapseUnbound": "收起未绑定列表",
|
|
81
|
+
"sessions.bindOthers": "绑定其他会话({count})",
|
|
82
|
+
"sessions.filterPlaceholder": "按会话名或 id 过滤…",
|
|
83
|
+
"sessions.noMatch": "(无匹配会话)",
|
|
84
|
+
"sessions.homeNoBind": "(心跳正身,无需绑定)",
|
|
85
|
+
"sessions.bindDeliver": "绑定投递",
|
|
86
|
+
"sessions.bindObserve": "绑定观察",
|
|
87
|
+
"sessions.modesBoth": "投递+观察",
|
|
88
|
+
"seeds.activeSummary": "活跃 {active} / {cap} 条;归档 {archived} 条",
|
|
89
|
+
"seeds.tabTopic": "话题素材",
|
|
90
|
+
"seeds.tabChat": "聊天素材",
|
|
91
|
+
"seeds.tabArchivedTopic": "话题·归档",
|
|
92
|
+
"seeds.tabArchivedChat": "聊天·归档",
|
|
93
|
+
"seeds.hintArchivedChat": "归档的聊天素材:不再被挑中,可以恢复",
|
|
94
|
+
"seeds.hintArchivedTopic": "归档的话题素材:不再被挑中,可以恢复",
|
|
95
|
+
"seeds.hintChat": "对话里长出来的:说过一次就算用掉",
|
|
96
|
+
"seeds.hintTopic": "浏览流、手写、画像喂进来的:随机挑,可重复用",
|
|
97
|
+
"seeds.emptyArchived": "(这类还没有归档条目)",
|
|
98
|
+
"seeds.empty": "(这类还没有条目)",
|
|
99
|
+
"seeds.restore": "恢复",
|
|
100
|
+
"seeds.archive": "归档",
|
|
101
|
+
"seeds.used": " used:{used}",
|
|
102
|
+
"interests.added": "已添加",
|
|
103
|
+
"interests.addFailed": "添加失败:{error}",
|
|
104
|
+
"interests.deleted": "已删除",
|
|
105
|
+
"interests.deleteFailed": "删除失败:{error}",
|
|
106
|
+
"interests.savedWindows": "浏览时段已保存",
|
|
107
|
+
"interests.saveFailed": "保存失败:{error}",
|
|
108
|
+
"interests.hint": "闲逛搜索按这份清单轮换挑焦点(同一条 3 天内不重复)。增删后即时生效,无需重启。",
|
|
109
|
+
"interests.empty": "(清单是空的——闲逛将没有焦点可挑)",
|
|
110
|
+
"interests.placeholder": "新兴趣,如:天文摄影",
|
|
111
|
+
"interests.windowsHint": "浏览时段(闲逛只在这些窗口内发生;起始须早于结束,多个时段不能重叠):",
|
|
112
|
+
"interests.to": "到",
|
|
113
|
+
"interests.addWindow": "加一个时段",
|
|
114
|
+
"interests.saveWindows": "保存时段",
|
|
115
|
+
"profile.tabInterest": "兴趣",
|
|
116
|
+
"profile.tabProjects": "进行中",
|
|
117
|
+
"profile.tabComm": "沟通偏好",
|
|
118
|
+
"profile.tabPsy": "心理",
|
|
119
|
+
"profile.exported": "已导出:{path}",
|
|
120
|
+
"profile.engine": "引擎室输入",
|
|
121
|
+
"profile.digest": "共 {total} / {budget} 字符({budgetState});按预算省略:处境 {tact} 条、话题 {topic} 条、兴趣 {wander} 条",
|
|
122
|
+
"profile.withinBudget": "在预算内",
|
|
123
|
+
"profile.overBudget": "超预算",
|
|
124
|
+
"profile.tactFacet": "处境切面",
|
|
125
|
+
"profile.topicFacet": "话题切面",
|
|
126
|
+
"profile.wanderFacet": "兴趣切面",
|
|
127
|
+
"profile.valid": "有效 {valid} 条 / 历史 {historical} 条(过期条目不进引擎室输入,也不在这里列出)",
|
|
128
|
+
"profile.emptyPartition": "(这个分区还没有条目)",
|
|
129
|
+
"profile.conf": " conf {value}",
|
|
130
|
+
"profile.temporal": " {value}",
|
|
131
|
+
"profile.stale": " 久未验证",
|
|
132
|
+
"profile.updated": " 更新 {date}",
|
|
133
|
+
"profile.exportMarkdown": "导出 Markdown",
|
|
134
|
+
"config.saved": "已保存(即时生效,无需重启)",
|
|
135
|
+
"config.saveFailed": "保存失败:{error}",
|
|
136
|
+
"config.interval": "心跳间隔(分钟)",
|
|
137
|
+
"config.cap": "每日表达上限(条)",
|
|
138
|
+
"config.timeInject": "时间注入间隔(分钟)",
|
|
139
|
+
"config.timeInjectOff": "0 = 关闭",
|
|
140
|
+
"config.statusbar": "状态栏",
|
|
141
|
+
"config.statusbarHint": "日常会话中的心跳状态感知(会额外消耗token)",
|
|
142
|
+
"config.idle": "闲着模式",
|
|
143
|
+
"config.idleHint": "素材池空时用画像话题兜底主动搭话(闸门仍生效)",
|
|
144
|
+
"config.tokenSaver": "节省 token 模式",
|
|
145
|
+
"config.tokenSaverHint": "你离开(闲置 ≥30 分钟)或锁屏时整跳暂停,回来自动恢复",
|
|
146
|
+
"config.psy": "psy 分区",
|
|
147
|
+
"config.psyHint": "允许画像记录 psy 分区(警告,开启后模型会主动猜测用户心理并计入用户画像,关闭时画像内容计入内容较少)",
|
|
148
|
+
"config.saveHint": "全部参数保存后即时生效,无需重启",
|
|
149
|
+
"weekly.intro": "每 7 天生成一份:本周表达与静默、新认识、账本、素材池与活跃高峰。报告只陈述事实,由后台「心跳」署名。",
|
|
150
|
+
"weekly.empty": "(还没有周报——装好一周后自动出第一期)",
|
|
151
|
+
"migrate.processing": "处理中…",
|
|
152
|
+
"migrate.failed": "失败:{error}",
|
|
153
|
+
"migrate.pwMismatch": "两次口令不一致或为空",
|
|
154
|
+
"migrate.exported": "已打包 {count} 个文件 → {path}(可拷贝到新机器,口令别丢)",
|
|
155
|
+
"migrate.needInput": "需要容器路径与口令",
|
|
156
|
+
"migrate.imported": "恢复 {restored} 个文件,备份 {backedUp} 个,跳过 {skipped} 个——重启 DSH 后生效",
|
|
157
|
+
"migrate.intro": "换电脑/重装系统时把心跳的记忆带走:导出一个口令加密的迁移包,在新机器上导入。口令丢失无法破解,容器可安全走网盘。",
|
|
158
|
+
"migrate.exportHeading": "① 在这台机器上导出",
|
|
159
|
+
"migrate.pwPlaceholder": "设置口令",
|
|
160
|
+
"migrate.pwAgainPlaceholder": "再输入一次",
|
|
161
|
+
"migrate.exportButton": "导出迁移包",
|
|
162
|
+
"migrate.importHeading": "② 在新机器上导入",
|
|
163
|
+
"migrate.filePlaceholder": "迁移包完整路径(.hbmig)",
|
|
164
|
+
"migrate.pwPlaceholderShort": "口令",
|
|
165
|
+
"migrate.importButton": "导入",
|
|
166
|
+
"section.status": "心跳状态",
|
|
167
|
+
"section.sessions": "会话绑定",
|
|
168
|
+
"section.seeds": "素材池",
|
|
169
|
+
"section.interests": "兴趣范围",
|
|
170
|
+
"section.profile": "用户画像(只读)",
|
|
171
|
+
"section.ledger": "账本",
|
|
172
|
+
"section.excerpt": "摘抄本",
|
|
173
|
+
"section.weekly": "周报",
|
|
174
|
+
"section.migrate": "换机迁移",
|
|
175
|
+
"section.config": "节律配置",
|
|
176
|
+
"ledger.opened": "已打开:{path}",
|
|
177
|
+
"ledger.failed": "失败:{error}",
|
|
178
|
+
"ledger.open": "一键打开账本",
|
|
179
|
+
"ledger.hint": "账本是心跳 agent 的待办与话题来源,可直接手编",
|
|
180
|
+
"excerpt.opened": "已打开:{path}",
|
|
181
|
+
"excerpt.failed": "失败:{error}",
|
|
182
|
+
"excerpt.open": "一键打开摘抄本",
|
|
183
|
+
"excerpt.hint": "留句子和小事的地方:只增不减,直接手编也不会被覆盖",
|
|
184
|
+
},
|
|
185
|
+
en: {
|
|
186
|
+
"settings.row.label": "Heartbeat",
|
|
187
|
+
"common.loading": "Loading…",
|
|
188
|
+
"common.loadFailed": "Failed to load: {error}",
|
|
189
|
+
"common.confirmDelete": "Confirm delete",
|
|
190
|
+
"common.delete": "Delete",
|
|
191
|
+
"common.empty": "(empty)",
|
|
192
|
+
"common.labelWithCount": "{label} ({count})",
|
|
193
|
+
"common.off": "Off",
|
|
194
|
+
"common.on": "On",
|
|
195
|
+
"common.refresh": "Refresh",
|
|
196
|
+
"common.remove": "Remove",
|
|
197
|
+
"common.save": "Save",
|
|
198
|
+
"common.unknown": "unknown",
|
|
199
|
+
"common.add": "Add",
|
|
200
|
+
"error.rpcUnavailable": "RPC channel unavailable (make sure DSH is running)",
|
|
201
|
+
"error.rpcFailed": "RPC call failed",
|
|
202
|
+
"status.loadFailed": "Failed to fetch status: {error}",
|
|
203
|
+
"status.spoke": "Said: {text}",
|
|
204
|
+
"status.silent": "Silent ({reason})",
|
|
205
|
+
"status.spokeFailed": "Delivery failed ({reason})",
|
|
206
|
+
"status.error": "Heartbeat error ({reason})",
|
|
207
|
+
"status.none": "No record yet",
|
|
208
|
+
"status.currentWithNote": "Heartbeat now: {scene} — {note}",
|
|
209
|
+
"status.current": "Heartbeat now: {scene}",
|
|
210
|
+
"status.currentEmpty": "Heartbeat now: (no status record yet)",
|
|
211
|
+
"status.version": "Plugin version: v{version}",
|
|
212
|
+
"status.lastBeat": "Last heartbeat:",
|
|
213
|
+
"status.result": "Result:",
|
|
214
|
+
"status.today": "Expressions today: {used} / {max}",
|
|
215
|
+
"status.quiet": "Now: in quiet hours",
|
|
216
|
+
"status.rhythm": "Now: normal rhythm (every {interval} min)",
|
|
217
|
+
"status.statusbarOff": "{status} (status bar off)",
|
|
218
|
+
"status.timeInject": "Time injection:",
|
|
219
|
+
"status.timeInjectOff": "Off",
|
|
220
|
+
"status.timeInjectEvery": "Every {interval} min, last {last}",
|
|
221
|
+
"status.never": "never",
|
|
222
|
+
"scene.quietHours": "Quiet hours — the world is asleep",
|
|
223
|
+
"scene.justSpoke": "Just talked to you",
|
|
224
|
+
"scene.wandering": "Wandering around, looking at something new",
|
|
225
|
+
"scene.busy": "You look busy, so I am staying out of the way",
|
|
226
|
+
"scene.present": "Here with you",
|
|
227
|
+
"scene.away": "You are away, so I am on my own",
|
|
228
|
+
"sessions.homeName": "Heartbeat itself (engine room)",
|
|
229
|
+
"sessions.hint": "Binding = expression delivery + conversation observation (D13). Both switches can be on at once, or toggled individually below. The heartbeat itself always thinks in its own session, regardless of bindings.",
|
|
230
|
+
"sessions.boundRow": "🔗 {name} ({modes})",
|
|
231
|
+
"sessions.deliverTitleOn": "Click to turn delivery off",
|
|
232
|
+
"sessions.deliverTitleOff": "Click to turn delivery on",
|
|
233
|
+
"sessions.observeTitleOn": "Click to turn observation off",
|
|
234
|
+
"sessions.observeTitleOff": "Click to turn observation on",
|
|
235
|
+
"sessions.deliver": "Deliver",
|
|
236
|
+
"sessions.observe": "Observe",
|
|
237
|
+
"sessions.unbind": "Unbind",
|
|
238
|
+
"sessions.noBound": "(No bound sessions — expressions only appear in the heartbeat's own session)",
|
|
239
|
+
"sessions.collapseUnbound": "Hide unbound sessions",
|
|
240
|
+
"sessions.bindOthers": "Bind other sessions ({count})",
|
|
241
|
+
"sessions.filterPlaceholder": "Filter by session name or id…",
|
|
242
|
+
"sessions.noMatch": "(No matching sessions)",
|
|
243
|
+
"sessions.homeNoBind": "(The heartbeat itself does not need binding)",
|
|
244
|
+
"sessions.bindDeliver": "Bind delivery",
|
|
245
|
+
"sessions.bindObserve": "Bind observation",
|
|
246
|
+
"sessions.modesBoth": "Deliver + observe",
|
|
247
|
+
"seeds.activeSummary": "Active {active} / {cap} entries; archived {archived}",
|
|
248
|
+
"seeds.tabTopic": "Topics",
|
|
249
|
+
"seeds.tabChat": "Chat",
|
|
250
|
+
"seeds.tabArchivedTopic": "Topics · archived",
|
|
251
|
+
"seeds.tabArchivedChat": "Chat · archived",
|
|
252
|
+
"seeds.hintArchivedChat": "Archived chat material: no longer picked, but can be restored",
|
|
253
|
+
"seeds.hintArchivedTopic": "Archived topic material: no longer picked, but can be restored",
|
|
254
|
+
"seeds.hintChat": "Grown from conversations: used once and then spent",
|
|
255
|
+
"seeds.hintTopic": "From browsing, handwriting, and the profile: picked at random and reusable",
|
|
256
|
+
"seeds.emptyArchived": "(No archived entries of this kind yet)",
|
|
257
|
+
"seeds.empty": "(No entries of this kind yet)",
|
|
258
|
+
"seeds.restore": "Restore",
|
|
259
|
+
"seeds.archive": "Archive",
|
|
260
|
+
"seeds.used": " used: {used}",
|
|
261
|
+
"interests.added": "Added",
|
|
262
|
+
"interests.addFailed": "Failed to add: {error}",
|
|
263
|
+
"interests.deleted": "Deleted",
|
|
264
|
+
"interests.deleteFailed": "Failed to delete: {error}",
|
|
265
|
+
"interests.savedWindows": "Browsing windows saved",
|
|
266
|
+
"interests.saveFailed": "Failed to save: {error}",
|
|
267
|
+
"interests.hint": "Wandering searches rotate through this list for focus (the same entry is not reused within 3 days). Changes take effect immediately, no restart needed.",
|
|
268
|
+
"interests.empty": "(The list is empty — wandering will have no focus to pick)",
|
|
269
|
+
"interests.placeholder": "New interest, e.g. astrophotography",
|
|
270
|
+
"interests.windowsHint": "Browsing windows (wandering only happens inside these; start must be before end, and windows must not overlap):",
|
|
271
|
+
"interests.to": "to",
|
|
272
|
+
"interests.addWindow": "Add a window",
|
|
273
|
+
"interests.saveWindows": "Save windows",
|
|
274
|
+
"profile.tabInterest": "Interests",
|
|
275
|
+
"profile.tabProjects": "In progress",
|
|
276
|
+
"profile.tabComm": "Communication preferences",
|
|
277
|
+
"profile.tabPsy": "Psychology",
|
|
278
|
+
"profile.exported": "Exported: {path}",
|
|
279
|
+
"profile.engine": "Engine room input",
|
|
280
|
+
"profile.digest": "{total} / {budget} characters ({budgetState}); omitted to fit the budget — situation: {tact}, topic: {topic}, interest: {wander}",
|
|
281
|
+
"profile.withinBudget": "within budget",
|
|
282
|
+
"profile.overBudget": "over budget",
|
|
283
|
+
"profile.tactFacet": "Situation facet",
|
|
284
|
+
"profile.topicFacet": "Topic facet",
|
|
285
|
+
"profile.wanderFacet": "Interest facet",
|
|
286
|
+
"profile.valid": "Valid {valid} / historical {historical} entries (expired entries are neither sent to the engine room nor listed here)",
|
|
287
|
+
"profile.emptyPartition": "(This partition has no entries yet)",
|
|
288
|
+
"profile.conf": " · confidence {value}",
|
|
289
|
+
"profile.temporal": " · {value}",
|
|
290
|
+
"profile.stale": " · not verified for a while",
|
|
291
|
+
"profile.updated": " · updated {date}",
|
|
292
|
+
"profile.exportMarkdown": "Export Markdown",
|
|
293
|
+
"config.saved": "Saved (takes effect immediately, no restart needed)",
|
|
294
|
+
"config.saveFailed": "Failed to save: {error}",
|
|
295
|
+
"config.interval": "Heartbeat interval (minutes)",
|
|
296
|
+
"config.cap": "Daily expression limit",
|
|
297
|
+
"config.timeInject": "Time injection interval (minutes)",
|
|
298
|
+
"config.timeInjectOff": "0 = off",
|
|
299
|
+
"config.statusbar": "Status bar",
|
|
300
|
+
"config.statusbarHint": "Show heartbeat status in everyday conversations (uses extra tokens)",
|
|
301
|
+
"config.idle": "Idle mode",
|
|
302
|
+
"config.idleHint": "When the material pool is empty, fall back to profile topics and start a conversation (gates still apply)",
|
|
303
|
+
"config.tokenSaver": "Token-saver mode",
|
|
304
|
+
"config.tokenSaverHint": "Pause all beats while you are away (idle for 30+ min) or the screen is locked, and resume automatically when you return",
|
|
305
|
+
"config.psy": "Psychology partition",
|
|
306
|
+
"config.psyHint": "Allow the profile to record the psychology partition (warning: when enabled, the model will guess your psychology and add it to your profile; when disabled, the profile contains less content)",
|
|
307
|
+
"config.saveHint": "All settings take effect immediately after saving, no restart needed",
|
|
308
|
+
"weekly.intro": "Generated every 7 days: this week's expressions and silences, new acquaintances, ledger, material pool, and activity peaks. The report states facts only and is signed by the background Heartbeat.",
|
|
309
|
+
"weekly.empty": "(No weekly report yet — the first one appears a week after installation)",
|
|
310
|
+
"migrate.processing": "Working…",
|
|
311
|
+
"migrate.failed": "Failed: {error}",
|
|
312
|
+
"migrate.pwMismatch": "The two passphrases do not match, or are empty",
|
|
313
|
+
"migrate.exported": "Packed {count} files → {path} (copy it to the new machine, and do not lose the passphrase)",
|
|
314
|
+
"migrate.needInput": "A container path and passphrase are required",
|
|
315
|
+
"migrate.imported": "Restored {restored} files, backed up {backedUp}, skipped {skipped} — restart DSH to apply",
|
|
316
|
+
"migrate.intro": "Take the heartbeat's memory with you when changing computers or reinstalling: export a passphrase-encrypted migration package, then import it on the new machine. A lost passphrase cannot be cracked, and the container is safe to put on cloud storage.",
|
|
317
|
+
"migrate.exportHeading": "1. Export on this machine",
|
|
318
|
+
"migrate.pwPlaceholder": "Set a passphrase",
|
|
319
|
+
"migrate.pwAgainPlaceholder": "Enter it again",
|
|
320
|
+
"migrate.exportButton": "Export migration package",
|
|
321
|
+
"migrate.importHeading": "2. Import on the new machine",
|
|
322
|
+
"migrate.filePlaceholder": "Full path to the migration package (.hbmig)",
|
|
323
|
+
"migrate.pwPlaceholderShort": "Passphrase",
|
|
324
|
+
"migrate.importButton": "Import",
|
|
325
|
+
"section.status": "Heartbeat status",
|
|
326
|
+
"section.sessions": "Session bindings",
|
|
327
|
+
"section.seeds": "Material pool",
|
|
328
|
+
"section.interests": "Interest scope",
|
|
329
|
+
"section.profile": "User profile (read-only)",
|
|
330
|
+
"section.ledger": "Ledger",
|
|
331
|
+
"section.excerpt": "Excerpt book",
|
|
332
|
+
"section.weekly": "Weekly report",
|
|
333
|
+
"section.migrate": "Migrate to a new machine",
|
|
334
|
+
"section.config": "Rhythm settings",
|
|
335
|
+
"ledger.opened": "Opened: {path}",
|
|
336
|
+
"ledger.failed": "Failed: {error}",
|
|
337
|
+
"ledger.open": "Open the ledger",
|
|
338
|
+
"ledger.hint": "The ledger is the heartbeat agent's source of todos and topics, and can be edited by hand",
|
|
339
|
+
"excerpt.opened": "Opened: {path}",
|
|
340
|
+
"excerpt.failed": "Failed: {error}",
|
|
341
|
+
"excerpt.open": "Open the excerpt book",
|
|
342
|
+
"excerpt.hint": "A place for sentences and small things: it only grows, and hand edits are never overwritten",
|
|
343
|
+
},
|
|
344
|
+
};
|
|
345
|
+
const fill = (text, params) => String(text).replace(/\{(\w+)\}/g, (match, key) => (params && key in params ? String(params[key]) : match));
|
|
346
|
+
let localeSvc = null;
|
|
347
|
+
const t = (key, params) => {
|
|
348
|
+
if (localeSvc) return localeSvc.bind(LOCALE_NS)(key, params);
|
|
349
|
+
const text = DICT.zh[key];
|
|
350
|
+
return text === undefined ? key : fill(text, params);
|
|
351
|
+
};
|
|
352
|
+
const L = (key, params) => t(key, params);
|
|
353
|
+
|
|
22
354
|
const rowStyle = { display: "flex", alignItems: "center", gap: 8, margin: "6px 0" };
|
|
23
355
|
const labelStyle = { minWidth: 140, fontSize: 13, color: "var(--dsw-alias-label-secondary)", flex: "none" };
|
|
24
356
|
const inputStyle = { width: 90, height: 28, borderRadius: 8, border: "1px solid var(--dsw-alias-border-l2)", background: "var(--dsw-specific-input-bg, transparent)", color: "var(--dsw-alias-label-primary)", padding: "0 8px", fontSize: 13 };
|
|
@@ -34,19 +366,24 @@ window.__ModuleLoader__.load({
|
|
|
34
366
|
// settingsScope was removed in DSH 0.1.7 — never bound here again.
|
|
35
367
|
// The rhythm editor rides the RPC channel (data/settings/ui.json on
|
|
36
368
|
// the host), so the card works identically on every host generation.
|
|
369
|
+
const locale = ctx.get("locale");
|
|
370
|
+
if (locale && typeof locale.register === "function" && typeof locale.bind === "function") {
|
|
371
|
+
localeSvc = locale;
|
|
372
|
+
ctx.effect(() => locale.register(LOCALE_NS, { zh: DICT.zh, en: DICT.en }));
|
|
373
|
+
}
|
|
37
374
|
const getConnection = () => {
|
|
38
375
|
try { return ctx.get("connection"); } catch { return undefined; }
|
|
39
376
|
};
|
|
40
377
|
const rpc = async (endpoint, payload) => {
|
|
41
378
|
const conn = getConnection();
|
|
42
379
|
if (!conn || !conn.rpc || typeof conn.rpc.call !== "function") {
|
|
43
|
-
throw new Error("
|
|
380
|
+
throw new Error(t("error.rpcUnavailable"));
|
|
44
381
|
}
|
|
45
382
|
// C21:0.1.5 起自定义 rpc.handle 通道不可用,宿主侧改为 /api 下的精确
|
|
46
383
|
// Fetch 路由;端点名走 payload.endpoint 字段(信封与 /api 同构)。
|
|
47
384
|
const result = await conn.rpc.call("/api", "heartbeat", { endpoint, ...(payload ?? {}) }, undefined);
|
|
48
385
|
if (!result || result.ok !== true) {
|
|
49
|
-
throw new Error((result && result.error && result.error.message) || "
|
|
386
|
+
throw new Error((result && result.error && result.error.message) || t("error.rpcFailed"));
|
|
50
387
|
}
|
|
51
388
|
return result.value;
|
|
52
389
|
};
|
|
@@ -91,44 +428,47 @@ window.__ModuleLoader__.load({
|
|
|
91
428
|
function StatusCard() {
|
|
92
429
|
const { loading, error, value } = useAsync(() => rpc("status"), []);
|
|
93
430
|
React.useEffect(() => {
|
|
94
|
-
const
|
|
95
|
-
return () => clearInterval(
|
|
431
|
+
const timer = setInterval(() => { rpc("status").then((v) => setStateSafe(v)).catch(() => {}); }, 30000);
|
|
432
|
+
return () => clearInterval(timer);
|
|
96
433
|
}, []);
|
|
97
434
|
const stateRef = React.useRef(null);
|
|
98
435
|
function setStateSafe(v) { stateRef.current = v; force(); }
|
|
99
436
|
const [, force] = React.useReducer((x) => x + 1, 0);
|
|
100
437
|
const view = stateRef.current || value;
|
|
101
|
-
if (loading && !view) return React.createElement("div", { style: hintStyle }, "
|
|
102
|
-
if (error) return React.createElement("div", { style: hintStyle }, "
|
|
438
|
+
if (loading && !view) return React.createElement("div", { style: hintStyle }, t("common.loading"));
|
|
439
|
+
if (error) return React.createElement("div", { style: hintStyle }, L("status.loadFailed", { error }));
|
|
103
440
|
const lb = view.lastBeat || {};
|
|
104
|
-
const verdictText = lb.verdict === "spoke" ? "
|
|
105
|
-
: lb.verdict === "silent" ? "
|
|
106
|
-
: lb.verdict === "spoke_failed" ? "
|
|
107
|
-
: lb.verdict === "error" ? "
|
|
441
|
+
const verdictText = lb.verdict === "spoke" ? L("status.spoke", { text: (lb.text || "").slice(0, 60) })
|
|
442
|
+
: lb.verdict === "silent" ? L("status.silent", { reason: lb.reason || "" })
|
|
443
|
+
: lb.verdict === "spoke_failed" ? L("status.spokeFailed", { reason: lb.reason || "" })
|
|
444
|
+
: lb.verdict === "error" ? L("status.error", { reason: lb.reason || "" }) : t("status.none");
|
|
108
445
|
const sb = view.statusbar || {};
|
|
109
|
-
const
|
|
110
|
-
"quiet-hours": "
|
|
111
|
-
"just-spoke": "
|
|
112
|
-
"wandering": "
|
|
113
|
-
"busy": "
|
|
114
|
-
"present": "
|
|
115
|
-
"away": "
|
|
446
|
+
const SCENE_KEYS = {
|
|
447
|
+
"quiet-hours": "scene.quietHours",
|
|
448
|
+
"just-spoke": "scene.justSpoke",
|
|
449
|
+
"wandering": "scene.wandering",
|
|
450
|
+
"busy": "scene.busy",
|
|
451
|
+
"present": "scene.present",
|
|
452
|
+
"away": "scene.away",
|
|
116
453
|
};
|
|
454
|
+
const sceneLabel = sb.lastStatus ? (SCENE_KEYS[sb.lastStatus.scene] ? t(SCENE_KEYS[sb.lastStatus.scene]) : sb.lastStatus.scene) : "";
|
|
117
455
|
const statusText = sb.lastStatus
|
|
118
|
-
?
|
|
119
|
-
|
|
456
|
+
? (sb.lastStatus.note
|
|
457
|
+
? L("status.currentWithNote", { scene: sceneLabel, note: sb.lastStatus.note })
|
|
458
|
+
: L("status.current", { scene: sceneLabel }))
|
|
459
|
+
: t("status.currentEmpty");
|
|
120
460
|
return React.createElement(
|
|
121
461
|
"div",
|
|
122
462
|
{ style: listStyle },
|
|
123
|
-
React.createElement("div", null, "
|
|
124
|
-
React.createElement("div", null, "
|
|
125
|
-
React.createElement("div", null, "
|
|
126
|
-
React.createElement("div", null, "
|
|
127
|
-
React.createElement("div", null, view.quiet ? "
|
|
128
|
-
React.createElement("div", null, sb.enabled === false ?
|
|
463
|
+
React.createElement("div", null, L("status.version", { version: view.version || t("common.unknown") })),
|
|
464
|
+
React.createElement("div", null, t("status.lastBeat"), fmtTime(lb.at)),
|
|
465
|
+
React.createElement("div", null, t("status.result"), verdictText),
|
|
466
|
+
React.createElement("div", null, L("status.today", { used: view.cap.used, max: view.cap.max })),
|
|
467
|
+
React.createElement("div", null, view.quiet ? t("status.quiet") : L("status.rhythm", { interval: view.intervalMin })),
|
|
468
|
+
React.createElement("div", null, sb.enabled === false ? L("status.statusbarOff", { status: statusText }) : statusText),
|
|
129
469
|
React.createElement("div", { style: hintStyle },
|
|
130
|
-
"
|
|
131
|
-
: "
|
|
470
|
+
t("status.timeInject"), sb.timeInjectMin === 0 ? t("status.timeInjectOff")
|
|
471
|
+
: L("status.timeInjectEvery", { interval: sb.timeInjectMin, last: sb.lastTimeInjectAt ? fmtTime(sb.lastTimeInjectAt) : t("status.never") })),
|
|
132
472
|
);
|
|
133
473
|
}
|
|
134
474
|
|
|
@@ -145,8 +485,8 @@ window.__ModuleLoader__.load({
|
|
|
145
485
|
);
|
|
146
486
|
}, []);
|
|
147
487
|
React.useEffect(() => { reload(); }, [reload]);
|
|
148
|
-
if (error) return React.createElement("div", { style: hintStyle }, "
|
|
149
|
-
if (!data) return React.createElement("div", { style: hintStyle }, "
|
|
488
|
+
if (error) return React.createElement("div", { style: hintStyle }, L("common.loadFailed", { error }));
|
|
489
|
+
if (!data) return React.createElement("div", { style: hintStyle }, t("common.loading"));
|
|
150
490
|
const bound = data.sessions.filter((s) => s.deliver || s.observe);
|
|
151
491
|
const doUnbind = (id) => rpc("bindings.remove", { sessionId: id }).then(reload, (e) => setError(String(e).slice(0, 100)));
|
|
152
492
|
const doBind = (id, deliver, observe) => rpc("bindings.add", { sessionId: id, deliver, observe }).then(reload, (e) => setError(String(e).slice(0, 100)));
|
|
@@ -160,39 +500,40 @@ window.__ModuleLoader__.load({
|
|
|
160
500
|
};
|
|
161
501
|
const flagStyle = (on) => (on ? buttonGhost : { ...buttonGhost, opacity: 0.5 });
|
|
162
502
|
// 会话名:宿主从 projcache 取 title;无 title 时回退 id 前缀
|
|
163
|
-
const nameOf = (s) => s.title || (s.home ? "
|
|
503
|
+
const nameOf = (s) => s.title || (s.home ? t("sessions.homeName") : s.id.slice(0, 19) + "…");
|
|
164
504
|
const q = query.trim().toLowerCase();
|
|
165
505
|
const matches = (s) => !q || nameOf(s).toLowerCase().includes(q) || s.id.toLowerCase().includes(q);
|
|
166
506
|
const unbound = data.sessions.filter((s) => !s.deliver && !s.observe && matches(s));
|
|
507
|
+
const modesOf = (s) => (s.deliver && s.observe ? t("sessions.modesBoth") : s.deliver ? t("sessions.deliver") : t("sessions.observe"));
|
|
167
508
|
return React.createElement(
|
|
168
509
|
"div",
|
|
169
510
|
null,
|
|
170
|
-
React.createElement("div", { style: hintStyle }, "
|
|
511
|
+
React.createElement("div", { style: hintStyle }, t("sessions.hint")),
|
|
171
512
|
bound.map((s) => React.createElement("div", { key: s.id, style: rowList },
|
|
172
513
|
React.createElement("span", { style: { flex: 1, fontSize: 12 } },
|
|
173
|
-
"
|
|
514
|
+
L("sessions.boundRow", { name: nameOf(s), modes: modesOf(s) })),
|
|
174
515
|
React.createElement("span", { style: { display: "flex", gap: 4 } },
|
|
175
|
-
React.createElement("button", { style: flagStyle(s.deliver), title: s.deliver ? "
|
|
176
|
-
React.createElement("button", { style: flagStyle(s.observe), title: s.observe ? "
|
|
177
|
-
React.createElement("button", { style: buttonGhost, onClick: () => doUnbind(s.id) }, "
|
|
516
|
+
React.createElement("button", { style: flagStyle(s.deliver), title: s.deliver ? t("sessions.deliverTitleOn") : t("sessions.deliverTitleOff"), onClick: () => setFlags(s.id, !s.deliver, s.observe) }, (s.deliver ? "☑ " : "☐ ") + t("sessions.deliver")),
|
|
517
|
+
React.createElement("button", { style: flagStyle(s.observe), title: s.observe ? t("sessions.observeTitleOn") : t("sessions.observeTitleOff"), onClick: () => setFlags(s.id, s.deliver, !s.observe) }, (s.observe ? "☑ " : "☐ ") + t("sessions.observe")),
|
|
518
|
+
React.createElement("button", { style: buttonGhost, onClick: () => doUnbind(s.id) }, t("sessions.unbind")),
|
|
178
519
|
),
|
|
179
520
|
)),
|
|
180
|
-
bound.length === 0 ? React.createElement("div", { style: hintStyle }, "
|
|
521
|
+
bound.length === 0 ? React.createElement("div", { style: hintStyle }, t("sessions.noBound")) : null,
|
|
181
522
|
React.createElement("div", { style: rowStyle },
|
|
182
|
-
React.createElement("button", { style: buttonGhost, onClick: () => setShowUnbound(!showUnbound) }, showUnbound ? "
|
|
523
|
+
React.createElement("button", { style: buttonGhost, onClick: () => setShowUnbound(!showUnbound) }, showUnbound ? t("sessions.collapseUnbound") : L("sessions.bindOthers", { count: unbound.length }))),
|
|
183
524
|
showUnbound ? React.createElement(
|
|
184
525
|
"div",
|
|
185
526
|
null,
|
|
186
|
-
React.createElement("input", { style: { ...inputStyle, width: "100%", margin: "4px 0", boxSizing: "border-box" }, placeholder: "
|
|
187
|
-
unbound.length === 0 ? React.createElement("div", { style: hintStyle }, "
|
|
527
|
+
React.createElement("input", { style: { ...inputStyle, width: "100%", margin: "4px 0", boxSizing: "border-box" }, placeholder: t("sessions.filterPlaceholder"), value: query, onChange: (e) => setQuery(e.target.value) }),
|
|
528
|
+
unbound.length === 0 ? React.createElement("div", { style: hintStyle }, t("sessions.noMatch")) : null,
|
|
188
529
|
unbound.map((s) => React.createElement("div", { key: s.id, style: rowList },
|
|
189
|
-
React.createElement("span", { style: { flex: 1, fontSize: 12 } }, nameOf(s), s.home ? "
|
|
530
|
+
React.createElement("span", { style: { flex: 1, fontSize: 12 } }, nameOf(s), s.home ? t("sessions.homeNoBind") : ""),
|
|
190
531
|
s.home ? null : React.createElement(
|
|
191
532
|
"span",
|
|
192
533
|
{ style: { display: "flex", gap: 4 } },
|
|
193
|
-
React.createElement("button", { style: buttonStyle, onClick: () => doBind(s.id, true, false) }, "
|
|
194
|
-
React.createElement("button", { style: buttonGhost, onClick: () => doBind(s.id, false, true) }, "
|
|
195
|
-
React.createElement("button", { style: buttonGhost, onClick: () => doBind(s.id, true, true) }, "
|
|
534
|
+
React.createElement("button", { style: buttonStyle, onClick: () => doBind(s.id, true, false) }, t("sessions.bindDeliver")),
|
|
535
|
+
React.createElement("button", { style: buttonGhost, onClick: () => doBind(s.id, false, true) }, t("sessions.bindObserve")),
|
|
536
|
+
React.createElement("button", { style: buttonGhost, onClick: () => doBind(s.id, true, true) }, t("sessions.modesBoth")),
|
|
196
537
|
),
|
|
197
538
|
)),
|
|
198
539
|
) : null,
|
|
@@ -210,18 +551,18 @@ window.__ModuleLoader__.load({
|
|
|
210
551
|
rpc("seeds.list").then(setData, (e) => setError(String(e).slice(0, 100)));
|
|
211
552
|
}, []);
|
|
212
553
|
React.useEffect(() => { reload(); }, [reload]);
|
|
213
|
-
if (error) return React.createElement("div", { style: hintStyle }, "
|
|
214
|
-
if (!data) return React.createElement("div", { style: hintStyle }, "
|
|
554
|
+
if (error) return React.createElement("div", { style: hintStyle }, L("common.loadFailed", { error }));
|
|
555
|
+
if (!data) return React.createElement("div", { style: hintStyle }, t("common.loading"));
|
|
215
556
|
const act = (endpoint, id) => rpc(endpoint, { id }).then(reload, (e) => setError(String(e).slice(0, 100)));
|
|
216
557
|
const row = (s, archived) => React.createElement("div", { key: s.id, style: rowList },
|
|
217
558
|
React.createElement("span", { style: { flex: 1, fontSize: 12, wordBreak: "break-word" } },
|
|
218
|
-
"[", s.tag, "/", s.source, "] ", s.text.slice(0, 60), "
|
|
559
|
+
"[", s.tag, "/", s.source, "] ", s.text.slice(0, 60), L("seeds.used", { used: s.used })),
|
|
219
560
|
archived
|
|
220
|
-
? React.createElement("button", { style: buttonGhost, onClick: () => act("seeds.restore", s.id) }, "
|
|
221
|
-
: React.createElement("button", { style: buttonGhost, onClick: () => act("seeds.archive", s.id) }, "
|
|
561
|
+
? React.createElement("button", { style: buttonGhost, onClick: () => act("seeds.restore", s.id) }, t("seeds.restore"))
|
|
562
|
+
: React.createElement("button", { style: buttonGhost, onClick: () => act("seeds.archive", s.id) }, t("seeds.archive")),
|
|
222
563
|
confirmId === s.id
|
|
223
|
-
? React.createElement("button", { style: { ...buttonStyle, background: "#e5484d" }, onClick: () => { setConfirmId(null); act("seeds.delete", s.id); } }, "
|
|
224
|
-
: React.createElement("button", { style: buttonGhost, onClick: () => setConfirmId(s.id) }, "
|
|
564
|
+
? React.createElement("button", { style: { ...buttonStyle, background: "#e5484d" }, onClick: () => { setConfirmId(null); act("seeds.delete", s.id); } }, t("common.confirmDelete"))
|
|
565
|
+
: React.createElement("button", { style: buttonGhost, onClick: () => setConfirmId(s.id) }, t("common.delete")),
|
|
225
566
|
);
|
|
226
567
|
const isChat = (s) => (s.category || "topic") === "chat";
|
|
227
568
|
const topics = data.active.filter((s) => !isChat(s));
|
|
@@ -235,21 +576,21 @@ window.__ModuleLoader__.load({
|
|
|
235
576
|
key,
|
|
236
577
|
style: tab === key ? buttonStyle : buttonGhost,
|
|
237
578
|
onClick: () => setTab(key),
|
|
238
|
-
},
|
|
579
|
+
}, L("common.labelWithCount", { label, count }));
|
|
239
580
|
return React.createElement(
|
|
240
581
|
"div",
|
|
241
582
|
null,
|
|
242
|
-
React.createElement("div", { style: hintStyle }, "
|
|
583
|
+
React.createElement("div", { style: hintStyle }, L("seeds.activeSummary", { active: data.active.length, cap: data.cap, archived: data.archived.length })),
|
|
243
584
|
React.createElement("div", { style: tabRow },
|
|
244
|
-
tabButton("topic", "
|
|
245
|
-
tabButton("chat", "
|
|
246
|
-
tabButton("arc-topic", "
|
|
247
|
-
tabButton("arc-chat", "
|
|
585
|
+
tabButton("topic", t("seeds.tabTopic"), topics.length),
|
|
586
|
+
tabButton("chat", t("seeds.tabChat"), chats.length),
|
|
587
|
+
tabButton("arc-topic", t("seeds.tabArchivedTopic"), arcTopics.length),
|
|
588
|
+
tabButton("arc-chat", t("seeds.tabArchivedChat"), arcChats.length)),
|
|
248
589
|
React.createElement("div", { style: hintStyle }, archived
|
|
249
|
-
? (chat ? "
|
|
250
|
-
: (chat ? "
|
|
590
|
+
? (chat ? t("seeds.hintArchivedChat") : t("seeds.hintArchivedTopic"))
|
|
591
|
+
: (chat ? t("seeds.hintChat") : t("seeds.hintTopic"))),
|
|
251
592
|
list.length === 0
|
|
252
|
-
? React.createElement("div", { style: hintStyle }, archived ? "
|
|
593
|
+
? React.createElement("div", { style: hintStyle }, archived ? t("seeds.emptyArchived") : t("seeds.empty"))
|
|
253
594
|
: React.createElement("div", { style: scrollBox }, list.map((s) => row(s, archived))),
|
|
254
595
|
);
|
|
255
596
|
}
|
|
@@ -271,53 +612,53 @@ window.__ModuleLoader__.load({
|
|
|
271
612
|
}, (e) => setError(String(e).slice(0, 100)));
|
|
272
613
|
}, []);
|
|
273
614
|
React.useEffect(() => { reload(); }, [reload]);
|
|
274
|
-
if (error) return React.createElement("div", { style: hintStyle }, "
|
|
275
|
-
if (!data) return React.createElement("div", { style: hintStyle }, "
|
|
615
|
+
if (error) return React.createElement("div", { style: hintStyle }, L("common.loadFailed", { error }));
|
|
616
|
+
if (!data) return React.createElement("div", { style: hintStyle }, t("common.loading"));
|
|
276
617
|
const interests = data.interests || [];
|
|
277
618
|
const doAdd = () => {
|
|
278
619
|
const text = draft.trim();
|
|
279
620
|
if (!text) return;
|
|
280
621
|
rpc("interests.add", { text }).then(
|
|
281
|
-
() => { setDraft(""); setStatus("
|
|
282
|
-
(e) => setStatus("
|
|
622
|
+
() => { setDraft(""); setStatus(t("interests.added")); reload(); },
|
|
623
|
+
(e) => setStatus(L("interests.addFailed", { error: String(e).slice(0, 80) })),
|
|
283
624
|
);
|
|
284
625
|
};
|
|
285
626
|
const doRemove = (text) => rpc("interests.remove", { text }).then(
|
|
286
|
-
() => { setConfirmText(null); setStatus("
|
|
287
|
-
(e) => { setConfirmText(null); setStatus("
|
|
627
|
+
() => { setConfirmText(null); setStatus(t("interests.deleted")); reload(); },
|
|
628
|
+
(e) => { setConfirmText(null); setStatus(L("interests.deleteFailed", { error: String(e).slice(0, 80) })); },
|
|
288
629
|
);
|
|
289
630
|
const saveWindows = () => {
|
|
290
631
|
rpc("interests.setWindows", { windows: draftWindows }).then(
|
|
291
|
-
() => { setStatus("
|
|
292
|
-
(e) => setStatus("
|
|
632
|
+
() => { setStatus(t("interests.savedWindows")); reload(); },
|
|
633
|
+
(e) => setStatus(L("interests.saveFailed", { error: String(e).slice(0, 80) })),
|
|
293
634
|
);
|
|
294
635
|
};
|
|
295
636
|
const editWindow = (idx, field, value) => setDraftWindows((ws) => ws.map((w, i) => (i === idx ? { ...w, [field]: value } : w)));
|
|
296
637
|
return React.createElement(
|
|
297
638
|
"div",
|
|
298
639
|
null,
|
|
299
|
-
React.createElement("div", { style: hintStyle }, "
|
|
300
|
-
interests.map((
|
|
301
|
-
React.createElement("span", { style: { flex: 1, fontSize: 12 } },
|
|
302
|
-
confirmText ===
|
|
303
|
-
? React.createElement("button", { style: { ...buttonStyle, background: "#e5484d" }, onClick: () => doRemove(
|
|
304
|
-
: React.createElement("button", { style: buttonGhost, onClick: () => setConfirmText(
|
|
640
|
+
React.createElement("div", { style: hintStyle }, t("interests.hint")),
|
|
641
|
+
interests.map((item) => React.createElement("div", { key: item, style: rowList },
|
|
642
|
+
React.createElement("span", { style: { flex: 1, fontSize: 12 } }, item),
|
|
643
|
+
confirmText === item
|
|
644
|
+
? React.createElement("button", { style: { ...buttonStyle, background: "#e5484d" }, onClick: () => doRemove(item) }, t("common.confirmDelete"))
|
|
645
|
+
: React.createElement("button", { style: buttonGhost, onClick: () => setConfirmText(item) }, t("common.delete")),
|
|
305
646
|
)),
|
|
306
|
-
interests.length === 0 ? React.createElement("div", { style: hintStyle }, "
|
|
647
|
+
interests.length === 0 ? React.createElement("div", { style: hintStyle }, t("interests.empty")) : null,
|
|
307
648
|
React.createElement("div", { style: rowStyle },
|
|
308
|
-
React.createElement("input", { style: { ...inputStyle, width: 240 }, placeholder: "
|
|
309
|
-
React.createElement("button", { style: buttonStyle, onClick: doAdd }, "
|
|
649
|
+
React.createElement("input", { style: { ...inputStyle, width: 240 }, placeholder: t("interests.placeholder"), value: draft, onChange: (e) => setDraft(e.target.value), onKeyDown: (e) => { if (e.key === "Enter") doAdd(); } }),
|
|
650
|
+
React.createElement("button", { style: buttonStyle, onClick: doAdd }, t("common.add")),
|
|
310
651
|
),
|
|
311
|
-
React.createElement("div", { style: { ...hintStyle, marginTop: 10 } }, "
|
|
652
|
+
React.createElement("div", { style: { ...hintStyle, marginTop: 10 } }, t("interests.windowsHint")),
|
|
312
653
|
(draftWindows || []).map((w, idx) => React.createElement("div", { key: idx, style: rowList },
|
|
313
654
|
React.createElement("input", { style: inputStyle, type: "time", value: w.start, onChange: (e) => editWindow(idx, "start", e.target.value) }),
|
|
314
|
-
React.createElement("span", { style: hintStyle }, "
|
|
655
|
+
React.createElement("span", { style: hintStyle }, t("interests.to")),
|
|
315
656
|
React.createElement("input", { style: inputStyle, type: "time", value: w.end, onChange: (e) => editWindow(idx, "end", e.target.value) }),
|
|
316
|
-
(draftWindows.length > 1) ? React.createElement("button", { style: buttonGhost, onClick: () => setDraftWindows((ws) => ws.filter((_, i) => i !== idx)) }, "
|
|
657
|
+
(draftWindows.length > 1) ? React.createElement("button", { style: buttonGhost, onClick: () => setDraftWindows((ws) => ws.filter((_, i) => i !== idx)) }, t("common.remove")) : null,
|
|
317
658
|
)),
|
|
318
659
|
React.createElement("div", { style: rowStyle },
|
|
319
|
-
React.createElement("button", { style: buttonGhost, onClick: () => setDraftWindows((ws) => [...(ws || []), { id: "", start: "11:00", end: "13:00" }]) }, "
|
|
320
|
-
React.createElement("button", { style: buttonStyle, onClick: saveWindows }, "
|
|
660
|
+
React.createElement("button", { style: buttonGhost, onClick: () => setDraftWindows((ws) => [...(ws || []), { id: "", start: "11:00", end: "13:00" }]) }, t("interests.addWindow")),
|
|
661
|
+
React.createElement("button", { style: buttonStyle, onClick: saveWindows }, t("interests.saveWindows")),
|
|
321
662
|
),
|
|
322
663
|
status ? React.createElement("div", { style: hintStyle }, status) : null,
|
|
323
664
|
);
|
|
@@ -327,10 +668,10 @@ window.__ModuleLoader__.load({
|
|
|
327
668
|
// 一次只看一个分区,条目一条一块、正文自动换行;另给一个只读的
|
|
328
669
|
// 「引擎室输入」视图,直接回答「截断后引擎室到底看到了什么」。
|
|
329
670
|
const PARTITIONS = [
|
|
330
|
-
{ key: "interest",
|
|
331
|
-
{ key: "projects",
|
|
332
|
-
{ key: "comm",
|
|
333
|
-
{ key: "psy",
|
|
671
|
+
{ key: "interest", labelKey: "profile.tabInterest" },
|
|
672
|
+
{ key: "projects", labelKey: "profile.tabProjects" },
|
|
673
|
+
{ key: "comm", labelKey: "profile.tabComm" },
|
|
674
|
+
{ key: "psy", labelKey: "profile.tabPsy" },
|
|
334
675
|
];
|
|
335
676
|
const entryBox = { borderLeft: "2px solid var(--dsw-alias-border-l2)", paddingLeft: 8, margin: "6px 0" };
|
|
336
677
|
// v1.9.3:分区条目一多就顶到屏幕外,给个固定高度的滚动区。
|
|
@@ -351,11 +692,11 @@ window.__ModuleLoader__.load({
|
|
|
351
692
|
}, []);
|
|
352
693
|
React.useEffect(() => { load(); }, [load]);
|
|
353
694
|
const doExport = () => rpc("profile.export").then(
|
|
354
|
-
(v) => setStatus("
|
|
695
|
+
(v) => setStatus(L("profile.exported", { path: v.path })),
|
|
355
696
|
(e) => setError(String(e).slice(0, 120)),
|
|
356
697
|
);
|
|
357
|
-
if (error) return React.createElement("div", { style: hintStyle }, "
|
|
358
|
-
if (!data) return React.createElement("div", { style: hintStyle }, "
|
|
698
|
+
if (error) return React.createElement("div", { style: hintStyle }, L("common.loadFailed", { error }));
|
|
699
|
+
if (!data) return React.createElement("div", { style: hintStyle }, t("common.loading"));
|
|
359
700
|
const groups = data.partitions || {};
|
|
360
701
|
const group = groups[tab] || { total: 0, valid: 0, entries: [] };
|
|
361
702
|
const entries = group.entries || [];
|
|
@@ -363,44 +704,44 @@ window.__ModuleLoader__.load({
|
|
|
363
704
|
key,
|
|
364
705
|
style: tab === key ? buttonStyle : buttonGhost,
|
|
365
706
|
onClick: () => setTab(key),
|
|
366
|
-
}, count === undefined ? label :
|
|
707
|
+
}, count === undefined ? label : L("common.labelWithCount", { label, count }));
|
|
367
708
|
const om = (digest && digest.omitted) || { tact: 0, topic: 0, wander: 0 };
|
|
368
709
|
return React.createElement(
|
|
369
710
|
"div",
|
|
370
711
|
{ style: listStyle },
|
|
371
712
|
React.createElement("div", { style: tabRow },
|
|
372
|
-
PARTITIONS.map((p) => tabButton(p.key, p.
|
|
373
|
-
tabButton("__engine", "
|
|
713
|
+
PARTITIONS.map((p) => tabButton(p.key, t(p.labelKey), (groups[p.key] || {}).valid || 0)),
|
|
714
|
+
tabButton("__engine", t("profile.engine"))),
|
|
374
715
|
tab === "__engine"
|
|
375
716
|
? React.createElement("div", null,
|
|
376
717
|
React.createElement("div", { style: hintStyle }, digest
|
|
377
|
-
? "
|
|
378
|
-
: "
|
|
718
|
+
? L("profile.digest", { total: digest.totalChars, budget: digest.budgetChars, budgetState: digest.withinBudget ? t("profile.withinBudget") : t("profile.overBudget"), tact: om.tact, topic: om.topic, wander: om.wander })
|
|
719
|
+
: t("common.loading")),
|
|
379
720
|
React.createElement("div", { style: scrollBox },
|
|
380
721
|
React.createElement("div", null,
|
|
381
|
-
React.createElement("b", null, "
|
|
382
|
-
React.createElement("div", { style: entryBody }, (digest && digest.tact) ||
|
|
722
|
+
React.createElement("b", null, t("profile.tactFacet")),
|
|
723
|
+
React.createElement("div", { style: entryBody }, (digest && digest.tact) || t("common.empty"))),
|
|
383
724
|
React.createElement("div", null,
|
|
384
|
-
React.createElement("b", null, "
|
|
385
|
-
React.createElement("div", { style: entryBody }, (digest && digest.topic) ||
|
|
725
|
+
React.createElement("b", null, t("profile.topicFacet")),
|
|
726
|
+
React.createElement("div", { style: entryBody }, (digest && digest.topic) || t("common.empty"))),
|
|
386
727
|
React.createElement("div", null,
|
|
387
|
-
React.createElement("b", null, "
|
|
388
|
-
React.createElement("div", { style: entryBody }, (digest && digest.wander) ||
|
|
728
|
+
React.createElement("b", null, t("profile.wanderFacet")),
|
|
729
|
+
React.createElement("div", { style: entryBody }, (digest && digest.wander) || t("common.empty")))))
|
|
389
730
|
: React.createElement("div", null,
|
|
390
|
-
React.createElement("div", { style: hintStyle }, "
|
|
731
|
+
React.createElement("div", { style: hintStyle }, L("profile.valid", { valid: group.valid, historical: group.total - group.valid })),
|
|
391
732
|
entries.length === 0
|
|
392
|
-
? React.createElement("div", { style: hintStyle }, "
|
|
733
|
+
? React.createElement("div", { style: hintStyle }, t("profile.emptyPartition"))
|
|
393
734
|
: React.createElement("div", { style: scrollBox }, entries.map((e) => React.createElement("div", { key: e.id || (String(e.topic) + String(e.content).slice(0, 12)), style: entryBox },
|
|
394
735
|
React.createElement("div", { style: entryHead },
|
|
395
736
|
(e.topic || "") + "/" + (e.subTopic || "")
|
|
396
|
-
+ "
|
|
397
|
-
+ (e.temporal ? "
|
|
398
|
-
+ (e.lowActivity ? "
|
|
399
|
-
+ (e.updatedAt ? "
|
|
737
|
+
+ L("profile.conf", { value: Number(e.confidence || 0).toFixed(2) })
|
|
738
|
+
+ (e.temporal ? L("profile.temporal", { value: e.temporal }) : "")
|
|
739
|
+
+ (e.lowActivity ? t("profile.stale") : "")
|
|
740
|
+
+ (e.updatedAt ? L("profile.updated", { date: String(e.updatedAt).slice(0, 10) }) : "")),
|
|
400
741
|
React.createElement("div", { style: entryBody }, e.content || ""))))),
|
|
401
742
|
React.createElement("div", { style: rowStyle },
|
|
402
|
-
React.createElement("button", { style: buttonGhost, onClick: () => { load(); } }, "
|
|
403
|
-
React.createElement("button", { style: buttonGhost, onClick: () => { void doExport(); } }, "
|
|
743
|
+
React.createElement("button", { style: buttonGhost, onClick: () => { load(); } }, t("common.refresh")),
|
|
744
|
+
React.createElement("button", { style: buttonGhost, onClick: () => { void doExport(); } }, t("profile.exportMarkdown"))),
|
|
404
745
|
status ? React.createElement("div", { style: hintStyle }, status) : null,
|
|
405
746
|
);
|
|
406
747
|
}
|
|
@@ -446,45 +787,45 @@ window.__ModuleLoader__.load({
|
|
|
446
787
|
psyEnabled: !!draftPsy,
|
|
447
788
|
});
|
|
448
789
|
setValue(v);
|
|
449
|
-
setStatus("
|
|
790
|
+
setStatus(t("config.saved"));
|
|
450
791
|
} catch (e) {
|
|
451
|
-
setStatus("
|
|
792
|
+
setStatus(L("config.saveFailed", { error: String(e).slice(0, 80) }));
|
|
452
793
|
}
|
|
453
794
|
};
|
|
454
|
-
if (loadErr && !value) return React.createElement("div", { style: hintStyle }, "
|
|
455
|
-
if (!value) return React.createElement("div", { style: hintStyle }, "
|
|
795
|
+
if (loadErr && !value) return React.createElement("div", { style: hintStyle }, L("common.loadFailed", { error: loadErr }));
|
|
796
|
+
if (!value) return React.createElement("div", { style: hintStyle }, t("common.loading"));
|
|
456
797
|
return React.createElement(
|
|
457
798
|
"div",
|
|
458
799
|
null,
|
|
459
800
|
React.createElement("div", { style: rowStyle },
|
|
460
|
-
React.createElement("span", { style: labelStyle }, "
|
|
801
|
+
React.createElement("span", { style: labelStyle }, t("config.interval")),
|
|
461
802
|
React.createElement("input", { style: inputStyle, type: "number", min: 1, max: 1440, value: draftInterval, onChange: (e) => setDraftInterval(e.target.value) })),
|
|
462
803
|
React.createElement("div", { style: rowStyle },
|
|
463
|
-
React.createElement("span", { style: labelStyle }, "
|
|
804
|
+
React.createElement("span", { style: labelStyle }, t("config.cap")),
|
|
464
805
|
React.createElement("input", { style: inputStyle, type: "number", min: 1, max: 50, value: draftCap, onChange: (e) => setDraftCap(e.target.value) })),
|
|
465
806
|
React.createElement("div", { style: rowStyle },
|
|
466
|
-
React.createElement("span", { style: labelStyle }, "
|
|
807
|
+
React.createElement("span", { style: labelStyle }, t("config.timeInject")),
|
|
467
808
|
React.createElement("input", { style: inputStyle, type: "number", min: 0, max: 1440, value: draftTimeInject, onChange: (e) => setDraftTimeInject(e.target.value) }),
|
|
468
|
-
React.createElement("span", { style: hintStyle }, "
|
|
809
|
+
React.createElement("span", { style: hintStyle }, t("config.timeInjectOff"))),
|
|
469
810
|
React.createElement("div", { style: rowStyle },
|
|
470
|
-
React.createElement("span", { style: labelStyle }, "
|
|
471
|
-
React.createElement("button", { style: draftStatusbar ? buttonStyle : buttonGhost, onClick: () => setDraftStatusbar(!draftStatusbar) }, draftStatusbar ? "☑
|
|
472
|
-
React.createElement("span", { style: hintStyle }, "
|
|
811
|
+
React.createElement("span", { style: labelStyle }, t("config.statusbar")),
|
|
812
|
+
React.createElement("button", { style: draftStatusbar ? buttonStyle : buttonGhost, onClick: () => setDraftStatusbar(!draftStatusbar) }, draftStatusbar ? "☑ " + t("common.on") : "☐ " + t("common.off")),
|
|
813
|
+
React.createElement("span", { style: hintStyle }, t("config.statusbarHint"))),
|
|
473
814
|
React.createElement("div", { style: rowStyle },
|
|
474
|
-
React.createElement("span", { style: labelStyle }, "
|
|
475
|
-
React.createElement("button", { style: draftIdle ? buttonStyle : buttonGhost, onClick: () => setDraftIdle(!draftIdle) }, draftIdle ? "☑
|
|
476
|
-
React.createElement("span", { style: hintStyle }, "
|
|
815
|
+
React.createElement("span", { style: labelStyle }, t("config.idle")),
|
|
816
|
+
React.createElement("button", { style: draftIdle ? buttonStyle : buttonGhost, onClick: () => setDraftIdle(!draftIdle) }, draftIdle ? "☑ " + t("common.on") : "☐ " + t("common.off")),
|
|
817
|
+
React.createElement("span", { style: hintStyle }, t("config.idleHint"))),
|
|
477
818
|
React.createElement("div", { style: rowStyle },
|
|
478
|
-
React.createElement("span", { style: labelStyle }, "
|
|
479
|
-
React.createElement("button", { style: draftTokenSaver ? buttonStyle : buttonGhost, onClick: () => setDraftTokenSaver(!draftTokenSaver) }, draftTokenSaver ? "☑
|
|
480
|
-
React.createElement("span", { style: hintStyle }, "
|
|
819
|
+
React.createElement("span", { style: labelStyle }, t("config.tokenSaver")),
|
|
820
|
+
React.createElement("button", { style: draftTokenSaver ? buttonStyle : buttonGhost, onClick: () => setDraftTokenSaver(!draftTokenSaver) }, draftTokenSaver ? "☑ " + t("common.on") : "☐ " + t("common.off")),
|
|
821
|
+
React.createElement("span", { style: hintStyle }, t("config.tokenSaverHint"))),
|
|
481
822
|
React.createElement("div", { style: rowStyle },
|
|
482
|
-
React.createElement("span", { style: labelStyle }, "psy
|
|
483
|
-
React.createElement("button", { style: draftPsy ? buttonStyle : buttonGhost, onClick: () => setDraftPsy(!draftPsy) }, draftPsy ? "☑
|
|
484
|
-
React.createElement("span", { style: hintStyle }, "
|
|
823
|
+
React.createElement("span", { style: labelStyle }, t("config.psy")),
|
|
824
|
+
React.createElement("button", { style: draftPsy ? buttonStyle : buttonGhost, onClick: () => setDraftPsy(!draftPsy) }, draftPsy ? "☑ " + t("common.on") : "☐ " + t("common.off")),
|
|
825
|
+
React.createElement("span", { style: hintStyle }, t("config.psyHint"))),
|
|
485
826
|
React.createElement("div", { style: rowStyle },
|
|
486
|
-
React.createElement("button", { style: buttonStyle, onClick: () => { void save(); } }, "
|
|
487
|
-
React.createElement("span", { style: hintStyle }, status || "
|
|
827
|
+
React.createElement("button", { style: buttonStyle, onClick: () => { void save(); } }, t("common.save")),
|
|
828
|
+
React.createElement("span", { style: hintStyle }, status || t("config.saveHint"))),
|
|
488
829
|
);
|
|
489
830
|
}
|
|
490
831
|
|
|
@@ -511,13 +852,13 @@ window.__ModuleLoader__.load({
|
|
|
511
852
|
);
|
|
512
853
|
}, [loadReport]);
|
|
513
854
|
React.useEffect(() => { reload(); }, [reload]);
|
|
514
|
-
if (error) return React.createElement("div", { style: hintStyle }, "
|
|
515
|
-
if (!data) return React.createElement("div", { style: hintStyle }, "
|
|
855
|
+
if (error) return React.createElement("div", { style: hintStyle }, L("common.loadFailed", { error }));
|
|
856
|
+
if (!data) return React.createElement("div", { style: hintStyle }, t("common.loading"));
|
|
516
857
|
return React.createElement(
|
|
517
858
|
"div",
|
|
518
859
|
null,
|
|
519
|
-
React.createElement("div", { style: hintStyle }, "
|
|
520
|
-
data.length === 0 ? React.createElement("div", { style: hintStyle }, "
|
|
860
|
+
React.createElement("div", { style: hintStyle }, t("weekly.intro")),
|
|
861
|
+
data.length === 0 ? React.createElement("div", { style: hintStyle }, t("weekly.empty")) : null,
|
|
521
862
|
data.length > 1 ? React.createElement("div", { style: rowStyle },
|
|
522
863
|
data.map((r) => React.createElement("button", {
|
|
523
864
|
key: r.file,
|
|
@@ -527,7 +868,7 @@ window.__ModuleLoader__.load({
|
|
|
527
868
|
) : null,
|
|
528
869
|
text ? React.createElement("pre", { style: { whiteSpace: "pre-wrap", margin: "4px 0", fontSize: 12 } }, text) : null,
|
|
529
870
|
React.createElement("div", { style: rowStyle },
|
|
530
|
-
React.createElement("button", { style: buttonGhost, onClick: () => { void reload(); } }, "
|
|
871
|
+
React.createElement("button", { style: buttonGhost, onClick: () => { void reload(); } }, t("common.refresh"))),
|
|
531
872
|
);
|
|
532
873
|
}
|
|
533
874
|
|
|
@@ -544,36 +885,36 @@ window.__ModuleLoader__.load({
|
|
|
544
885
|
const run = (fn) => {
|
|
545
886
|
if (busy.current) return;
|
|
546
887
|
busy.current = true;
|
|
547
|
-
setStatus("
|
|
548
|
-
fn().catch((e) => setStatus("
|
|
888
|
+
setStatus(t("migrate.processing"));
|
|
889
|
+
fn().catch((e) => setStatus(L("migrate.failed", { error: String(e).slice(0, 120) }))).finally(() => { busy.current = false; });
|
|
549
890
|
};
|
|
550
891
|
const doExport = () => run(async () => {
|
|
551
|
-
if (!pw1 || pw1 !== pw2) { setStatus("
|
|
892
|
+
if (!pw1 || pw1 !== pw2) { setStatus(t("migrate.pwMismatch")); return; }
|
|
552
893
|
const v = await rpc("migrate.export", { passphrase: pw1 });
|
|
553
894
|
setPw1(""); setPw2("");
|
|
554
|
-
setStatus("
|
|
895
|
+
setStatus(L("migrate.exported", { count: v.count, path: v.path }));
|
|
555
896
|
});
|
|
556
897
|
const doImport = () => run(async () => {
|
|
557
|
-
if (!importFile || !importPw) { setStatus("
|
|
898
|
+
if (!importFile || !importPw) { setStatus(t("migrate.needInput")); return; }
|
|
558
899
|
const v = await rpc("migrate.import", { file: importFile.trim(), passphrase: importPw });
|
|
559
900
|
setImportPw("");
|
|
560
|
-
setStatus("
|
|
901
|
+
setStatus(L("migrate.imported", { restored: v.restored.length, backedUp: v.backedUp.length, skipped: v.skipped.length }));
|
|
561
902
|
});
|
|
562
903
|
return React.createElement(
|
|
563
904
|
"div",
|
|
564
905
|
null,
|
|
565
|
-
React.createElement("div", { style: hintStyle }, "
|
|
566
|
-
React.createElement("div", { style: { ...hintStyle, marginTop: 6, fontWeight: 600 } }, "
|
|
906
|
+
React.createElement("div", { style: hintStyle }, t("migrate.intro")),
|
|
907
|
+
React.createElement("div", { style: { ...hintStyle, marginTop: 6, fontWeight: 600 } }, t("migrate.exportHeading")),
|
|
567
908
|
React.createElement("div", { style: rowStyle },
|
|
568
|
-
React.createElement("input", { style: inputStyle, type: "password", placeholder: "
|
|
569
|
-
React.createElement("input", { style: inputStyle, type: "password", placeholder: "
|
|
570
|
-
React.createElement("button", { style: buttonStyle, onClick: () => { void doExport(); } }, "
|
|
909
|
+
React.createElement("input", { style: inputStyle, type: "password", placeholder: t("migrate.pwPlaceholder"), value: pw1, onChange: (e) => setPw1(e.target.value) }),
|
|
910
|
+
React.createElement("input", { style: inputStyle, type: "password", placeholder: t("migrate.pwAgainPlaceholder"), value: pw2, onChange: (e) => setPw2(e.target.value) }),
|
|
911
|
+
React.createElement("button", { style: buttonStyle, onClick: () => { void doExport(); } }, t("migrate.exportButton")),
|
|
571
912
|
),
|
|
572
|
-
React.createElement("div", { style: { ...hintStyle, marginTop: 6, fontWeight: 600 } }, "
|
|
913
|
+
React.createElement("div", { style: { ...hintStyle, marginTop: 6, fontWeight: 600 } }, t("migrate.importHeading")),
|
|
573
914
|
React.createElement("div", { style: rowStyle },
|
|
574
|
-
React.createElement("input", { style: { ...inputStyle, width: 220 }, placeholder: "
|
|
575
|
-
React.createElement("input", { style: inputStyle, type: "password", placeholder: "
|
|
576
|
-
React.createElement("button", { style: buttonStyle, onClick: () => { void doImport(); } }, "
|
|
915
|
+
React.createElement("input", { style: { ...inputStyle, width: 220 }, placeholder: t("migrate.filePlaceholder"), value: importFile, onChange: (e) => setImportFile(e.target.value) }),
|
|
916
|
+
React.createElement("input", { style: inputStyle, type: "password", placeholder: t("migrate.pwPlaceholderShort"), value: importPw, onChange: (e) => setImportPw(e.target.value) }),
|
|
917
|
+
React.createElement("button", { style: buttonStyle, onClick: () => { void doImport(); } }, t("migrate.importButton")),
|
|
577
918
|
),
|
|
578
919
|
status ? React.createElement("div", { style: hintStyle }, status) : null,
|
|
579
920
|
);
|
|
@@ -583,46 +924,46 @@ window.__ModuleLoader__.load({
|
|
|
583
924
|
function HeartbeatSection() {
|
|
584
925
|
const [ledgerMsg, setLedgerMsg] = React.useState("");
|
|
585
926
|
const openLedger = () => rpc("ledger.open").then(
|
|
586
|
-
(v) => setLedgerMsg("
|
|
587
|
-
(e) => setLedgerMsg("
|
|
927
|
+
(v) => setLedgerMsg(L("ledger.opened", { path: v.path })),
|
|
928
|
+
(e) => setLedgerMsg(L("ledger.failed", { error: String(e).slice(0, 80) })),
|
|
588
929
|
);
|
|
589
930
|
const [excerptMsg, setExcerptMsg] = React.useState("");
|
|
590
931
|
const openExcerpt = () => rpc("excerpt.open").then(
|
|
591
|
-
(v) => setExcerptMsg("
|
|
592
|
-
(e) => setExcerptMsg("
|
|
932
|
+
(v) => setExcerptMsg(L("excerpt.opened", { path: v.path })),
|
|
933
|
+
(e) => setExcerptMsg(L("excerpt.failed", { error: String(e).slice(0, 80) })),
|
|
593
934
|
);
|
|
594
935
|
return React.createElement(
|
|
595
936
|
"div",
|
|
596
937
|
{ style: { padding: "2px 0" } },
|
|
597
|
-
React.createElement(Section, { title: "
|
|
598
|
-
React.createElement(Section, { title: "
|
|
599
|
-
React.createElement(Section, { title: "
|
|
600
|
-
React.createElement(Section, { title: "
|
|
601
|
-
React.createElement(Section, { title: "
|
|
602
|
-
React.createElement(Section, { title: "
|
|
938
|
+
React.createElement(Section, { title: t("section.status"), open: true }, React.createElement(StatusCard, null)),
|
|
939
|
+
React.createElement(Section, { title: t("section.sessions") }, React.createElement(SessionsSection, null)),
|
|
940
|
+
React.createElement(Section, { title: t("section.seeds") }, React.createElement(SeedsSection, null)),
|
|
941
|
+
React.createElement(Section, { title: t("section.interests") }, React.createElement(InterestsSection, null)),
|
|
942
|
+
React.createElement(Section, { title: t("section.profile") }, React.createElement(ProfileSection, null)),
|
|
943
|
+
React.createElement(Section, { title: t("section.ledger") }, React.createElement(
|
|
603
944
|
"div",
|
|
604
945
|
null,
|
|
605
946
|
React.createElement("div", { style: rowStyle },
|
|
606
|
-
React.createElement("button", { style: buttonStyle, onClick: () => { void openLedger(); } }, "
|
|
607
|
-
React.createElement("span", { style: hintStyle }, ledgerMsg || "
|
|
947
|
+
React.createElement("button", { style: buttonStyle, onClick: () => { void openLedger(); } }, t("ledger.open")),
|
|
948
|
+
React.createElement("span", { style: hintStyle }, ledgerMsg || t("ledger.hint"))),
|
|
608
949
|
)),
|
|
609
|
-
React.createElement(Section, { title: "
|
|
950
|
+
React.createElement(Section, { title: t("section.excerpt") }, React.createElement(
|
|
610
951
|
"div",
|
|
611
952
|
null,
|
|
612
953
|
React.createElement("div", { style: rowStyle },
|
|
613
|
-
React.createElement("button", { style: buttonStyle, onClick: () => { void openExcerpt(); } }, "
|
|
614
|
-
React.createElement("span", { style: hintStyle }, excerptMsg || "
|
|
954
|
+
React.createElement("button", { style: buttonStyle, onClick: () => { void openExcerpt(); } }, t("excerpt.open")),
|
|
955
|
+
React.createElement("span", { style: hintStyle }, excerptMsg || t("excerpt.hint"))),
|
|
615
956
|
)),
|
|
616
|
-
React.createElement(Section, { title: "
|
|
617
|
-
React.createElement(Section, { title: "
|
|
618
|
-
React.createElement(Section, { title: "
|
|
957
|
+
React.createElement(Section, { title: t("section.weekly") }, React.createElement(WeeklySection, null)),
|
|
958
|
+
React.createElement(Section, { title: t("section.migrate") }, React.createElement(MigrateSection, null)),
|
|
959
|
+
React.createElement(Section, { title: t("section.config") }, React.createElement(ConfigSection, null)),
|
|
619
960
|
);
|
|
620
961
|
}
|
|
621
962
|
|
|
622
963
|
try {
|
|
623
964
|
ctx.slots.inject("settings.section", function* () {
|
|
624
965
|
yield ctx.slots.register(
|
|
625
|
-
{ name: "settings.section", id: "dsh-heartbeat", order: 20, label: () => "
|
|
966
|
+
{ name: "settings.section", id: "dsh-heartbeat", order: 20, locale: LOCALE_NS, label: () => t("settings.row.label") },
|
|
626
967
|
HeartbeatSection,
|
|
627
968
|
);
|
|
628
969
|
});
|
|
@@ -634,7 +975,7 @@ window.__ModuleLoader__.load({
|
|
|
634
975
|
// settingsScope deliberately absent: removed in DSH 0.1.7 (its client
|
|
635
976
|
// service no longer exists; declaring it stalls the whole client bundle
|
|
636
977
|
// on a "waiting for service" and blocks the web UI from booting).
|
|
637
|
-
exports.inject = ["slots", "sessions"];
|
|
978
|
+
exports.inject = ["slots", "sessions", "locale"];
|
|
638
979
|
exports.apply = apply;
|
|
639
980
|
return module.exports;
|
|
640
981
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kanadego/dsh-heartbeat",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Heartbeat plugin for DeepSeek Harness: scheduled autonomous reflection loop with user profile, material pool, pace gate, and gated proactive expression.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -78,6 +78,7 @@
|
|
|
78
78
|
"patch": "./cordis.patch.yml"
|
|
79
79
|
},
|
|
80
80
|
"client": {
|
|
81
|
+
"inject": ["@deepseek-ai/dsh-client-locale"],
|
|
81
82
|
"platform": "web"
|
|
82
83
|
}
|
|
83
84
|
}
|