@takboo/dsh-coopanion 0.4.6 → 0.4.8
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 +6 -6
- package/THIRD_PARTY_NOTICES.md +4 -0
- package/desktop/main.cjs +19 -15
- package/desktop/tray-state.cjs +11 -6
- package/dist/bridge.js +4 -1
- package/dist/bridge.js.map +2 -2
- package/dist/client.js +371 -7
- package/dist/index.js +333 -8
- package/dist/index.js.map +4 -4
- package/docs/licenses/dompurify.txt +202 -0
- package/docs/licenses/marked.txt +44 -0
- package/docs/release-notes.md +29 -0
- package/npm-shrinkwrap.json +32 -2
- package/package.json +8 -4
- package/scripts/build.mjs +1 -0
- package/scripts/check-package.mjs +1 -1
- package/src/bridge.ts +4 -1
- package/src/client/index.ts +21 -3
- package/src/client/locale-sync.ts +34 -0
- package/src/client/notification-copy.ts +3 -2
- package/src/index.ts +32 -4
- package/tests/desktop.mjs +24 -10
- package/tests/inbox-ui.mjs +4 -4
- package/tests/install.mjs +8 -0
- package/tests/locale-client.mjs +25 -0
- package/tests/locale-sync.test.ts +36 -0
- package/tests/locale-ui.mjs +79 -0
- package/tests/notification-ui.mjs +1 -1
- package/tests/plugin.test.ts +27 -1
- package/tests/presentation.test.js +37 -3
- package/tests/session-replies-ui.mjs +108 -0
- package/tests/ui.mjs +6 -6
- package/web/index.html +42 -42
- package/web/locale.d.ts +6 -0
- package/web/locale.js +76 -0
- package/web/markdown-runtime.js +73 -0
- package/web/notification-ui.js +3 -2
- package/web/pet.js +120 -60
- package/web/reply-markdown.js +27 -0
- package/web/session-ui.js +19 -4
- package/web/style.css +20 -1
package/README.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
给 [DeepSeek Harness Desktop](https://github.com/deepseek-ai/deepseek-harness) 加一只桌面伙伴。她会陪你工作,在任务完成、出错或需要确认时提醒你;双击角色,可以向已打开的 Harness 会话发送消息。
|
|
4
4
|
|
|
5
|
-
**v0.4.
|
|
5
|
+
**v0.4.8 使用 Coopanion 的原生动画与角色运行时,组合程序采用 AGPL-3.0-or-later。** 大肥鱼的网格变形、弹簧动作、动态五官、物理拖拽和八套配色直接复用上游固定版本。角色贴图保留独立权利声明,见 [第三方声明](THIRD_PARTY_NOTICES.md) 和 [上游版本记录](web/upstream/UPSTREAM.md)。
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
本次更新统一桌宠与 Harness 的中英文语言,覆盖桌面菜单、聊天、收件箱、角色面板和原生托盘;切换立即生效,回复原文与当前配色保持不变。查看 [最新修改记录](https://github.com/takboo/dsh-coopanion/releases/latest) 或 [完整版本记录](docs/release-notes.md)。
|
|
8
8
|
|
|
9
9
|
## 功能
|
|
10
10
|
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
|
|
27
27
|
桌宠不作出审批,也不单独收集 API Key。聊天始终发给明确选中的关注会话,新建会话和后台任务不会自动切换目标。关注会话进行中时优先展示它的动作;空闲时用动作反映后台工作或确认 / 异常。状态栏图形优先提示任一会话的确认 / 异常,菜单显示详情。
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
信封直接打开回复与待办收件箱:同一会话的多个未读回合合并展示最新回复,未读数量按会话计算。只有一份回复时展开全文;多份回复显示摘要和各自的 **继续对话 ↗**,审批、提问及异常提供 **去处理 ↗**。全文支持 Markdown 标题、粗体、列表、表格和代码块。阅读不会切换正在聊天的会话;收件箱阅读器可连续读不同会话的结果,并返回收件箱查看新内容。正在阅读的回复不会被新结果替换。保留最近 200 份完整结果,优先淘汰已读;只有本次 Harness 运行中实时完成的回复计入未读,打开历史会话或重启 Harness 不会把旧回复重新标为未读。重启后原始对话仍由 Harness 保存;任务动画根据当前 Agent 的运行状态恢复。
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
回复气泡展示或自动收起、查看收件箱摘要及收起收件箱均不会标记已读;主动展开阅读、关闭单份回复气泡或通过该回复回到源会话时,确认展示时合并的未读回合。阅读期间新到的回合继续保留未读,旧回合的完整结果仍可通过历史导航查看。审批与 AI 提问由 Harness 的实际答复、决定或取消结果结算;查看、收起互动提示或打开源会话均不会代替处理请求。
|
|
32
32
|
|
|
33
33
|
高频流式事件仅发送动画元数据,完整结果只在结果列表或已读状态变化时传输,避免长回复和多会话拖慢桌面更新。
|
|
34
34
|
|
|
@@ -44,7 +44,7 @@ v0.4.0 移除了旧 Canvas 关键帧引擎、`dsh-character` v1 协议、`.dshpe
|
|
|
44
44
|
|
|
45
45
|
支持 **DSH 0.2.0-rc.2 和 0.2.1-alpha.1**;其他版本未声明兼容。
|
|
46
46
|
|
|
47
|
-
1. 下载对应 [Release](https://github.com/takboo/dsh-coopanion/releases) 的 `dsh-coopanion-0.4.
|
|
47
|
+
1. 下载对应 [Release](https://github.com/takboo/dsh-coopanion/releases) 的 `dsh-coopanion-0.4.8.tgz`,或按下面步骤构建 `takboo-dsh-coopanion-0.4.8.tgz`。npm 包名为 `@takboo/dsh-coopanion`;本地 `npm pack` 的文件名包含 scope。
|
|
48
48
|
2. 在 Harness 侧边栏 **插件** 页安装压缩包的绝对路径,启用 `dsh-coopanion`。
|
|
49
49
|
3. 完全退出再重新打开 Harness。首次启动时会下载并校验 Electron 44 运行时。
|
|
50
50
|
4. 打开一段 Harness 会话,双击角色聊天,或从 **Settings → 桌宠** 管理角色。
|
|
@@ -52,7 +52,7 @@ v0.4.0 移除了旧 Canvas 关键帧引擎、`dsh-character` v1 协议、`.dshpe
|
|
|
52
52
|
也可使用 Desktop 自带的 CLI。先启动 Desktop 一次初始化 profile,完全退出应用,再执行:
|
|
53
53
|
|
|
54
54
|
```bash
|
|
55
|
-
dsh plugin --profile desktop add /absolute/path/dsh-coopanion-0.4.
|
|
55
|
+
dsh plugin --profile desktop add /absolute/path/dsh-coopanion-0.4.8.tgz
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
npm 安装的 dsh 不能管理 Desktop 所拥有的 profile。Desktop 完全退出后执行包管理命令,再重新打开应用。
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -16,6 +16,10 @@ This integration follows the project user's existing statement that the communit
|
|
|
16
16
|
|
|
17
17
|
Electron 44.7.0 is installed as a dependency and retains its MIT license and Chromium's accompanying notices. Runtime download and verification remain unchanged.
|
|
18
18
|
|
|
19
|
+
## Marked 18.1.1 and DOMPurify 3.4.17
|
|
20
|
+
|
|
21
|
+
The full-reply reader bundles [Marked](https://github.com/markedjs/marked) and [DOMPurify](https://github.com/cure53/DOMPurify) into `web/markdown-runtime.js` at build time. Marked is distributed under the MIT license; DOMPurify is used under its Apache-2.0 license option. Their complete upstream license and copyright notices are retained in [docs/licenses/marked.txt](docs/licenses/marked.txt) and [docs/licenses/dompurify.txt](docs/licenses/dompurify.txt). Neither dependency is modified.
|
|
22
|
+
|
|
19
23
|
## fflate 0.8.3
|
|
20
24
|
|
|
21
25
|
MIT License
|
package/desktop/main.cjs
CHANGED
|
@@ -4,8 +4,9 @@ const { randomBytes } = require('node:crypto');
|
|
|
4
4
|
const { once } = require('node:events');
|
|
5
5
|
const { CharacterStore } = require('../dist/character-store.cjs');
|
|
6
6
|
const { createPetServer } = require('../dist/figure-server.cjs');
|
|
7
|
-
const { trayState } = require('./tray-state.cjs');
|
|
8
|
-
|
|
7
|
+
const { trayState, trayLocale } = require('./tray-state.cjs');
|
|
8
|
+
const { petCopy, petLanguage } = require('../web/locale.js');
|
|
9
|
+
app.setName(petCopy('en').defaultName);
|
|
9
10
|
if (process.env.DSH_PET_TEST_DATA_DIR) {
|
|
10
11
|
app.setPath('userData', process.env.DSH_PET_TEST_DATA_DIR);
|
|
11
12
|
app.setPath('crashDumps', join(process.env.DSH_PET_TEST_DATA_DIR, 'crashes'));
|
|
@@ -40,7 +41,10 @@ function show() { win?.showInactive(); syncTray(); }
|
|
|
40
41
|
function act(action) { process.send?.({ type: 'action', action }); }
|
|
41
42
|
function syncTray() {
|
|
42
43
|
if (!tray || tray.isDestroyed()) return;
|
|
43
|
-
const
|
|
44
|
+
const locale = trayLocale(options, presentation, app.getPreferredSystemLanguages());
|
|
45
|
+
const state = trayState(lastFrame?.snapshot, presentation, { ...options, locale }, win?.isVisible());
|
|
46
|
+
const copy = petCopy(locale);
|
|
47
|
+
if (app.getName() !== copy.defaultName) app.setName(copy.defaultName);
|
|
44
48
|
const key = JSON.stringify(state);
|
|
45
49
|
if (key === lastTrayKey) return;
|
|
46
50
|
lastTrayKey = key;
|
|
@@ -49,19 +53,19 @@ function syncTray() {
|
|
|
49
53
|
tray.setContextMenu(Menu.buildFromTemplate([
|
|
50
54
|
{ label: `${state.name} · ${state.stateLabel}`, enabled: false },
|
|
51
55
|
{ label: state.sessionLabel, enabled: false },
|
|
52
|
-
{ label:
|
|
53
|
-
{ label:
|
|
54
|
-
{ label:
|
|
56
|
+
{ label: copy.trayOpen, enabled: !!state.sessionId, click: () => act({ type: 'open-session', sessionId: state.sessionId }) },
|
|
57
|
+
{ label: copy.traySwitch, enabled: !!state.sessions.length, submenu: state.sessions.slice(0, 20).map(session => ({ type: 'radio', label: `${session.label} · ${session.id.replace(/^session[-_:]/, '').slice(-8)}${session.unread ? copy.trayUnread(session.unread) : ''}${['waiting', 'error'].includes(session.mood) ? copy.trayNeeds : ''}`, checked: session.selected, click: () => act({ type: 'select', sessionId: session.id }) })) },
|
|
58
|
+
{ label: copy.trayPending(state.activity.unread, state.activity.waiting + state.activity.errors), click: () => { show(); forward({ type: 'ui-control', command: 'sessions' }); } },
|
|
55
59
|
{ type: 'separator' },
|
|
56
|
-
{ label:
|
|
57
|
-
{ label:
|
|
58
|
-
{ label:
|
|
59
|
-
{ label:
|
|
60
|
-
{ label:
|
|
61
|
-
{ label:
|
|
60
|
+
{ label: copy.trayChat, click: () => { show(); forward({ type: 'ui-control', command: 'chat' }); } },
|
|
61
|
+
{ label: copy.trayCharacters, click: () => { show(); forward({ type: 'characters' }); } },
|
|
62
|
+
{ label: copy.trayRoam, type: 'checkbox', checked: state.roam, click: item => act({ type: 'preference', field: 'roam', value: item.checked }) },
|
|
63
|
+
{ label: copy.traySleep, type: 'checkbox', checked: state.sleeping, enabled: !state.active, click: () => forward({ type: 'ui-control', command: 'sleep' }) },
|
|
64
|
+
{ label: copy.trayNotices, type: 'checkbox', checked: state.notifications, click: item => act({ type: 'preference', field: 'notifications', value: item.checked }) },
|
|
65
|
+
{ label: copy.traySound, type: 'checkbox', checked: state.sound, click: () => forward({ type: 'ui-control', command: 'sound' }) },
|
|
62
66
|
{ type: 'separator' },
|
|
63
|
-
{ label: state.visible ?
|
|
64
|
-
{ label:
|
|
67
|
+
{ label: state.visible ? copy.hide : copy.trayShow, click: () => state.visible ? win.hide() : show() },
|
|
68
|
+
{ label: copy.trayQuit, click: () => app.quit() },
|
|
65
69
|
]));
|
|
66
70
|
process.send?.({ type: 'tray-state', state });
|
|
67
71
|
const iconKey = `${state.characterId}:${state.scheme}:${state.iconReady}:${state.icon}`;
|
|
@@ -170,7 +174,7 @@ app.whenReady().then(async () => {
|
|
|
170
174
|
if (action.type === 'move-display') { win.setBounds(bounds()); forward({ type: 'display-changed' }); return; }
|
|
171
175
|
if (action.type === 'presentation') {
|
|
172
176
|
if (typeof action.characterId !== 'string' || !/^[a-z0-9-]{1,32}$/.test(action.characterId) || typeof action.scheme !== 'string' || action.scheme.length > 200 || typeof action.name !== 'string' || action.name.length > 200 || typeof action.sleeping !== 'boolean' || typeof action.sound !== 'boolean') return;
|
|
173
|
-
presentation = { characterId: action.characterId, scheme: action.scheme, name: action.name, sleeping: action.sleeping, sound: action.sound, ready: action.ready === true }; syncTray(); return;
|
|
177
|
+
presentation = { characterId: action.characterId, scheme: action.scheme, name: action.name, locale: typeof action.locale === 'string' ? petLanguage(action.locale) : undefined, sleeping: action.sleeping, sound: action.sound, ready: action.ready === true }; syncTray(); return;
|
|
174
178
|
}
|
|
175
179
|
if (action.type === 'notification-snooze') { if (typeof action.interactionId === 'string' && action.interactionId.length <= 2048 && Number.isSafeInteger(action.generation)) act(action); return; }
|
|
176
180
|
if (action.type !== 'chat' && action.type !== 'select' && action.type !== 'open-session' && action.type !== 'preference' && action.type !== 'read') return;
|
package/desktop/tray-state.cjs
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
|
-
const labels = { idle: '陪伴中', thinking: '正在思考', talking: '正在回复', working: '正在工作', waiting: '等待确认', happy: '任务完成', error: '需要关注', sleeping: '休息中' };
|
|
2
1
|
const { sessionActivity } = require('../web/session-ui.js');
|
|
2
|
+
const { petCopy, automaticPetLanguage } = require('../web/locale.js');
|
|
3
|
+
|
|
4
|
+
function trayLocale(options = {}, presentation = {}, languages = []) {
|
|
5
|
+
return options.locale ?? presentation.locale ?? automaticPetLanguage(languages);
|
|
6
|
+
}
|
|
3
7
|
|
|
4
8
|
/** Desktop and status bar project the same host snapshot and acknowledged preferences. */
|
|
5
9
|
function trayState(snapshot = {}, presentation = {}, options = {}, visible = false) {
|
|
10
|
+
const copy = petCopy(options.locale ?? presentation.locale), labels = copy.labels;
|
|
6
11
|
const selected = snapshot.sessions?.find(session => session.id === snapshot.sessionId);
|
|
7
12
|
const activity = sessionActivity(snapshot), active = activity.active;
|
|
8
13
|
const mood = !active && !activity.waiting && !activity.errors && presentation.sleeping ? 'sleeping' : activity.mood;
|
|
9
|
-
const name = presentation.name ||
|
|
14
|
+
const name = presentation.name || copy.defaultName;
|
|
10
15
|
return { name, characterId: presentation.characterId || 'whale', scheme: presentation.scheme || '', iconReady: !!presentation.ready, icon: mood === 'sleeping' ? 'sleeping' : activity.icon, mood, stateLabel: labels[mood] ?? labels.idle, activity, active, sleeping: mood === 'sleeping', visible, roam: options.roam ?? true, notifications: options.notifications ?? true, sound: presentation.sound ?? true,
|
|
11
|
-
sessionId: snapshot.sessionId ?? null, sessionLabel: selected?.label ??
|
|
12
|
-
sessions: [...(snapshot.sessions ?? [])].sort((a, b) => Number(b.id === snapshot.sessionId) - Number(a.id === snapshot.sessionId) || (b.updatedAt ?? 0) - (a.updatedAt ?? 0)).map(session => ({ id: session.id, label: session.label, project: session.project, selected: session.id === snapshot.sessionId, mood: session.mood, unread: session.unread
|
|
13
|
-
tooltip:
|
|
16
|
+
sessionId: snapshot.sessionId ?? null, sessionLabel: selected?.label ?? copy.noConversation,
|
|
17
|
+
sessions: [...(snapshot.sessions ?? [])].sort((a, b) => Number(b.id === snapshot.sessionId) - Number(a.id === snapshot.sessionId) || (b.updatedAt ?? 0) - (a.updatedAt ?? 0)).map(session => ({ id: session.id, label: session.label, project: session.project, selected: session.id === snapshot.sessionId, mood: session.mood, unread: Number(!!session.unread) })),
|
|
18
|
+
tooltip: copy.trayTooltip(name, labels[mood] ?? labels.idle, selected?.label ?? copy.noConversation, activity.busy, activity.waiting + activity.errors, activity.unread),
|
|
14
19
|
title: '',
|
|
15
20
|
};
|
|
16
21
|
}
|
|
17
|
-
module.exports = { trayState };
|
|
22
|
+
module.exports = { trayState, trayLocale };
|
package/dist/bridge.js
CHANGED
|
@@ -117,8 +117,11 @@ var ElectronBridge = class extends EventEmitter {
|
|
|
117
117
|
removeAction(listener) {
|
|
118
118
|
this.off("action", listener);
|
|
119
119
|
}
|
|
120
|
+
// JSON IPC omits undefined. An explicit null lets a cleared Harness
|
|
121
|
+
// preference restore the renderer's automatic language instead of retaining
|
|
122
|
+
// its previous locale during a merged configuration update.
|
|
120
123
|
configure(options) {
|
|
121
|
-
this.send({ type: "configure", options });
|
|
124
|
+
this.send({ type: "configure", options: { ...options, locale: options.locale ?? null } });
|
|
122
125
|
}
|
|
123
126
|
control(command) {
|
|
124
127
|
this.send({ type: "control", command });
|
package/dist/bridge.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/bridge.ts"],
|
|
4
|
-
"sourcesContent": ["import { spawn, type ChildProcess } from 'node:child_process';\nimport { createRequire } from 'node:module';\nimport { fileURLToPath } from 'node:url';\nimport { EventEmitter } from 'node:events';\nimport type { PetSnapshot, PetNotice } from './model.ts';\nimport type { NotificationRuntime, NotificationSnapshot, TaskNotice } from './notification-contract.ts';\n\nexport interface StartLifetime { signal: AbortSignal; generation: number; }\nexport interface NativeLifecycle { running: boolean; visible: boolean; error?: string; generation?: number; visibilityRevision?: number; suspended?: boolean; }\n\nexport interface DesktopOptions { size: number; roam: boolean; notifications: boolean; bubbleDurationMs: number; electronPath?: string; locale?: string; systemNotifications?: boolean; reminders?: boolean; reminderDelayMs?: number; }\nexport interface PetBridge {\n start(options: DesktopOptions, lifetime?: StartLifetime): Promise<void>;\n update(snapshot: PetSnapshot): void;\n notify(notice: PetNotice | TaskNotice): void;\n notificationState?(snapshot: NotificationSnapshot): void;\n snoozeResult?(interactionId: string, ok: boolean, error?: string): void;\n presentRole?(notice: TaskNotice, runtime: NotificationRuntime): boolean;\n onAction(listener: (action: unknown) => void): void;\n removeAction(listener: (action: unknown) => void): void;\n dispose(): Promise<void>;\n configure?(options: DesktopOptions): void;\n control?(command: 'show' | 'hide' | 'characters'): void;\n focusHarness?(): void;\n onLifecycle?(listener: (state: NativeLifecycle) => void): void;\n removeLifecycle?(listener: (state: NativeLifecycle) => void): void;\n}\n\n/** Owns a separate Electron window; no changes or private IPC in the Harness desktop shell are needed. */\nexport class ElectronBridge extends EventEmitter implements PetBridge {\n private child?: ChildProcess;\n private latest?: PetSnapshot;\n private resultKey?: string;\n private closing = false;\n\n private generation = 0;\n private visibilityRevision = 0;\n private nativeVisible = false;\n private suspended = false;\n private lastNotificationState?: NotificationSnapshot;\n\n async start(options: DesktopOptions, lifetime?: StartLifetime): Promise<void> {\n if (this.child) throw new Error('Desktop pet is already running');\n if (lifetime?.signal.aborted) throw new Error('\u684C\u5BA0\u542F\u52A8\u5DF2\u53D6\u6D88');\n this.closing = false;\n this.generation = lifetime?.generation ?? this.generation + 1;\n this.visibilityRevision = 0; this.nativeVisible = false; this.suspended = false;\n if (process.platform === 'linux' && !process.env.DISPLAY && !process.env.WAYLAND_DISPLAY) throw new Error('\u684C\u5BA0\u9700\u8981\u684C\u9762\u663E\u793A\u73AF\u5883\u3002');\n const executable: string = options.electronPath ?? createRequire(import.meta.url)('electron');\n const env: NodeJS.ProcessEnv = { ...process.env, DSH_PET_GENERATION: String(this.generation) };\n delete (env as NodeJS.ProcessEnv).ELECTRON_RUN_AS_NODE;\n const args = [fileURLToPath(new URL('../desktop/main.cjs', import.meta.url))];\n if (env.DSH_PET_TEST_NO_SANDBOX === '1') args.unshift('--no-sandbox');\n const child = spawn(executable, args, { env, stdio: ['ignore', 'pipe', 'pipe', 'ipc'] });\n const generation = this.generation; this.child = child;\n let diagnostic = '';\n child.stderr?.on('data', data => { diagnostic = (diagnostic + data.toString()).slice(-4000); });\n child.on('message', message => {\n if (this.child !== child || !isRecord(message)) return;\n if (message.type === 'action') this.emit('action', message.action);\n if (message.type === 'tray-state') this.emit('tray-state', message.state);\n if (message.type === 'tray-icon') this.emit('tray-icon', message);\n if (message.type === 'visibility' && message.generation === generation && typeof message.visible === 'boolean' && Number.isSafeInteger(message.visibilityRevision) && (message.visibilityRevision as number) > this.visibilityRevision) {\n this.visibilityRevision = message.visibilityRevision as number;\n this.nativeVisible = message.visible; this.suspended = message.suspended === true;\n this.emit('lifecycle', { running: true, visible: this.nativeVisible, generation, visibilityRevision: this.visibilityRevision, suspended: this.suspended });\n }\n });\n child.once('exit', (code, signal) => {\n if (this.child !== child) return;\n this.child = undefined; this.nativeVisible = false;\n const error = !this.closing && (code !== 0 || signal) ? `\u684C\u5BA0\u8FDB\u7A0B\u5DF2\u9000\u51FA (${signal ?? code})` : undefined;\n this.emit('lifecycle', { running: false, visible: false, generation, visibilityRevision: ++this.visibilityRevision, suspended: false, ...(error ? { error } : {}) });\n if (error) this.emit('failure', new Error(error));\n });\n await new Promise<void>((resolve, reject) => {\n let done = false;\n const finish = (error?: Error) => {\n if (done) return; done = true;\n clearTimeout(timer); child.off('message', ready); child.off('error', failed); child.off('exit', exited); lifetime?.signal.removeEventListener('abort', aborted);\n if (error) { child.kill(); reject(error); } else resolve();\n };\n const ready = (message: unknown) => {\n if (isRecord(message) && message.type === 'ready' && this.child === child && !lifetime?.signal.aborted) {\n this.send({ type: 'init', options, snapshot: this.latest && desktopSnapshot(this.latest, true) });\n if (this.lastNotificationState) this.notificationState(this.lastNotificationState);\n finish();\n }\n };\n const failed = (error: Error) => finish(error);\n const exited = (code: number | null, signal: string | null) => finish(new Error(`\u684C\u5BA0\u542F\u52A8\u5931\u8D25 (${signal ?? code}): ${diagnostic}`));\n const aborted = () => finish(new Error('\u684C\u5BA0\u542F\u52A8\u5DF2\u53D6\u6D88'));\n const timer = setTimeout(() => finish(new Error(`\u684C\u5BA0\u672A\u80FD\u5728 20 \u79D2\u5185\u542F\u52A8: ${diagnostic}`)), 20000);\n child.on('message', ready); child.once('error', failed); child.once('exit', exited);\n lifetime?.signal.addEventListener('abort', aborted, { once: true });\n if (lifetime?.signal.aborted) aborted();\n });\n child.on('error', error => { if (this.child === child && !this.closing) this.emit('failure', error); });\n }\n\n update(snapshot: PetSnapshot): void {\n this.latest = snapshot;\n const key = snapshot.results.map(result => `${result.id}:${result.read}`).join('|');\n this.send({ type: 'snapshot', snapshot: desktopSnapshot(snapshot, key !== this.resultKey) });\n this.resultKey = key;\n }\n notify(notice: PetNotice | TaskNotice): void { this.send({ type: 'notice', notice }); }\n notificationState(snapshot: NotificationSnapshot): void { this.lastNotificationState = structuredClone(snapshot); this.send({ type: 'notification-state', snapshot }); }\n snoozeResult(interactionId: string, ok: boolean, error?: string): void { this.send({ type: 'notification-snooze-result', interactionId, ok, ...(error ? { error: error.slice(0, 600) } : {}) }); }\n presentRole(notice: TaskNotice, runtime: NotificationRuntime): boolean {\n if (!this.child?.connected || this.closing || !this.nativeVisible || this.suspended || runtime.generation !== this.generation || runtime.visibilityRevision !== this.visibilityRevision || !runtime.visible) return false;\n this.send({ type: 'notice', notice, generation: runtime.generation, visibilityRevision: runtime.visibilityRevision }); return true;\n }\n onAction(listener: (action: unknown) => void): void { this.on('action', listener); }\n removeAction(listener: (action: unknown) => void): void { this.off('action', listener); }\n configure(options: DesktopOptions): void { this.send({ type: 'configure', options }); }\n control(command: 'show' | 'hide' | 'characters'): void { this.send({ type: 'control', command }); }\n focusHarness(): void { this.send({ type: 'control', command: 'focus-harness' }); }\n onLifecycle(listener: (state: NativeLifecycle) => void): void { this.on('lifecycle', listener); }\n removeLifecycle(listener: (state: NativeLifecycle) => void): void { this.off('lifecycle', listener); }\n private send(message: object): void {\n if (this.child?.connected) this.child.send(message, error => { if (error && !this.closing) this.emit('failure', error); });\n }\n\n async dispose(): Promise<void> {\n this.closing = true;\n const child = this.child;\n if (!child) return;\n if (child.pid === undefined || child.exitCode !== null || child.signalCode !== null) { if (this.child === child) this.child = undefined; return; }\n await new Promise<void>((resolve, reject) => {\n let deadline: ReturnType<typeof setTimeout>;\n const timer = setTimeout(() => { child.kill('SIGKILL'); deadline = setTimeout(() => { if (child.exitCode !== null || child.signalCode !== null) resolve(); else reject(new Error('\u684C\u5BA0\u8FDB\u7A0B\u672A\u786E\u8BA4\u9000\u51FA')); }, 1000); }, 3000);\n child.once('exit', () => { clearTimeout(timer); clearTimeout(deadline); resolve(); });\n if (child.connected) child.send({ type: 'quit' }, error => { if (error) child.kill(); }); else child.kill();\n });\n if (this.child === child) this.child = undefined;\n }\n}\n\nexport function isRecord(value: unknown): value is Record<string, unknown> { return typeof value === 'object' && value !== null && !Array.isArray(value); }\n\n/** Stream animation updates carry metadata; full result text crosses IPC only when it changes. */\nfunction desktopSnapshot(snapshot: PetSnapshot, includeResults: boolean) {\n const { results, ...state } = snapshot;\n return { ...state, text: state.mood === 'happy' ? '' : state.text,\n sessions: state.sessions.map(session => ({ ...session, text: session.mood === 'happy' ? '' : session.text, reply: '' })),\n ...(includeResults ? { results } : {}),\n };\n}\n"],
|
|
5
|
-
"mappings": ";AAAA,SAAS,aAAgC;AACzC,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AA0BtB,IAAM,iBAAN,cAA6B,aAAkC;AAAA,EAC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A,EACnB;AAAA,EACA,OAAO,QAAsC;AAAE,SAAK,KAAK,EAAE,MAAM,UAAU,OAAO,CAAC;AAAA,EAAG;AAAA,EACtF,kBAAkB,UAAsC;AAAE,SAAK,wBAAwB,gBAAgB,QAAQ;AAAG,SAAK,KAAK,EAAE,MAAM,sBAAsB,SAAS,CAAC;AAAA,EAAG;AAAA,EACvK,aAAa,eAAuB,IAAa,OAAsB;AAAE,SAAK,KAAK,EAAE,MAAM,8BAA8B,eAAe,IAAI,GAAI,QAAQ,EAAE,OAAO,MAAM,MAAM,GAAG,GAAG,EAAE,IAAI,CAAC,EAAG,CAAC;AAAA,EAAG;AAAA,EACjM,YAAY,QAAoB,SAAuC;AACrE,QAAI,CAAC,KAAK,OAAO,aAAa,KAAK,WAAW,CAAC,KAAK,iBAAiB,KAAK,aAAa,QAAQ,eAAe,KAAK,cAAc,QAAQ,uBAAuB,KAAK,sBAAsB,CAAC,QAAQ,QAAS,QAAO;AACpN,SAAK,KAAK,EAAE,MAAM,UAAU,QAAQ,YAAY,QAAQ,YAAY,oBAAoB,QAAQ,mBAAmB,CAAC;AAAG,WAAO;AAAA,EAChI;AAAA,EACA,SAAS,UAA2C;AAAE,SAAK,GAAG,UAAU,QAAQ;AAAA,EAAG;AAAA,EACnF,aAAa,UAA2C;AAAE,SAAK,IAAI,UAAU,QAAQ;AAAA,EAAG;AAAA,
|
|
4
|
+
"sourcesContent": ["import { spawn, type ChildProcess } from 'node:child_process';\nimport { createRequire } from 'node:module';\nimport { fileURLToPath } from 'node:url';\nimport { EventEmitter } from 'node:events';\nimport type { PetSnapshot, PetNotice } from './model.ts';\nimport type { NotificationRuntime, NotificationSnapshot, TaskNotice } from './notification-contract.ts';\n\nexport interface StartLifetime { signal: AbortSignal; generation: number; }\nexport interface NativeLifecycle { running: boolean; visible: boolean; error?: string; generation?: number; visibilityRevision?: number; suspended?: boolean; }\n\nexport interface DesktopOptions { size: number; roam: boolean; notifications: boolean; bubbleDurationMs: number; electronPath?: string; locale?: string; systemNotifications?: boolean; reminders?: boolean; reminderDelayMs?: number; }\nexport interface PetBridge {\n start(options: DesktopOptions, lifetime?: StartLifetime): Promise<void>;\n update(snapshot: PetSnapshot): void;\n notify(notice: PetNotice | TaskNotice): void;\n notificationState?(snapshot: NotificationSnapshot): void;\n snoozeResult?(interactionId: string, ok: boolean, error?: string): void;\n presentRole?(notice: TaskNotice, runtime: NotificationRuntime): boolean;\n onAction(listener: (action: unknown) => void): void;\n removeAction(listener: (action: unknown) => void): void;\n dispose(): Promise<void>;\n configure?(options: DesktopOptions): void;\n control?(command: 'show' | 'hide' | 'characters'): void;\n focusHarness?(): void;\n onLifecycle?(listener: (state: NativeLifecycle) => void): void;\n removeLifecycle?(listener: (state: NativeLifecycle) => void): void;\n}\n\n/** Owns a separate Electron window; no changes or private IPC in the Harness desktop shell are needed. */\nexport class ElectronBridge extends EventEmitter implements PetBridge {\n private child?: ChildProcess;\n private latest?: PetSnapshot;\n private resultKey?: string;\n private closing = false;\n\n private generation = 0;\n private visibilityRevision = 0;\n private nativeVisible = false;\n private suspended = false;\n private lastNotificationState?: NotificationSnapshot;\n\n async start(options: DesktopOptions, lifetime?: StartLifetime): Promise<void> {\n if (this.child) throw new Error('Desktop pet is already running');\n if (lifetime?.signal.aborted) throw new Error('\u684C\u5BA0\u542F\u52A8\u5DF2\u53D6\u6D88');\n this.closing = false;\n this.generation = lifetime?.generation ?? this.generation + 1;\n this.visibilityRevision = 0; this.nativeVisible = false; this.suspended = false;\n if (process.platform === 'linux' && !process.env.DISPLAY && !process.env.WAYLAND_DISPLAY) throw new Error('\u684C\u5BA0\u9700\u8981\u684C\u9762\u663E\u793A\u73AF\u5883\u3002');\n const executable: string = options.electronPath ?? createRequire(import.meta.url)('electron');\n const env: NodeJS.ProcessEnv = { ...process.env, DSH_PET_GENERATION: String(this.generation) };\n delete (env as NodeJS.ProcessEnv).ELECTRON_RUN_AS_NODE;\n const args = [fileURLToPath(new URL('../desktop/main.cjs', import.meta.url))];\n if (env.DSH_PET_TEST_NO_SANDBOX === '1') args.unshift('--no-sandbox');\n const child = spawn(executable, args, { env, stdio: ['ignore', 'pipe', 'pipe', 'ipc'] });\n const generation = this.generation; this.child = child;\n let diagnostic = '';\n child.stderr?.on('data', data => { diagnostic = (diagnostic + data.toString()).slice(-4000); });\n child.on('message', message => {\n if (this.child !== child || !isRecord(message)) return;\n if (message.type === 'action') this.emit('action', message.action);\n if (message.type === 'tray-state') this.emit('tray-state', message.state);\n if (message.type === 'tray-icon') this.emit('tray-icon', message);\n if (message.type === 'visibility' && message.generation === generation && typeof message.visible === 'boolean' && Number.isSafeInteger(message.visibilityRevision) && (message.visibilityRevision as number) > this.visibilityRevision) {\n this.visibilityRevision = message.visibilityRevision as number;\n this.nativeVisible = message.visible; this.suspended = message.suspended === true;\n this.emit('lifecycle', { running: true, visible: this.nativeVisible, generation, visibilityRevision: this.visibilityRevision, suspended: this.suspended });\n }\n });\n child.once('exit', (code, signal) => {\n if (this.child !== child) return;\n this.child = undefined; this.nativeVisible = false;\n const error = !this.closing && (code !== 0 || signal) ? `\u684C\u5BA0\u8FDB\u7A0B\u5DF2\u9000\u51FA (${signal ?? code})` : undefined;\n this.emit('lifecycle', { running: false, visible: false, generation, visibilityRevision: ++this.visibilityRevision, suspended: false, ...(error ? { error } : {}) });\n if (error) this.emit('failure', new Error(error));\n });\n await new Promise<void>((resolve, reject) => {\n let done = false;\n const finish = (error?: Error) => {\n if (done) return; done = true;\n clearTimeout(timer); child.off('message', ready); child.off('error', failed); child.off('exit', exited); lifetime?.signal.removeEventListener('abort', aborted);\n if (error) { child.kill(); reject(error); } else resolve();\n };\n const ready = (message: unknown) => {\n if (isRecord(message) && message.type === 'ready' && this.child === child && !lifetime?.signal.aborted) {\n this.send({ type: 'init', options, snapshot: this.latest && desktopSnapshot(this.latest, true) });\n if (this.lastNotificationState) this.notificationState(this.lastNotificationState);\n finish();\n }\n };\n const failed = (error: Error) => finish(error);\n const exited = (code: number | null, signal: string | null) => finish(new Error(`\u684C\u5BA0\u542F\u52A8\u5931\u8D25 (${signal ?? code}): ${diagnostic}`));\n const aborted = () => finish(new Error('\u684C\u5BA0\u542F\u52A8\u5DF2\u53D6\u6D88'));\n const timer = setTimeout(() => finish(new Error(`\u684C\u5BA0\u672A\u80FD\u5728 20 \u79D2\u5185\u542F\u52A8: ${diagnostic}`)), 20000);\n child.on('message', ready); child.once('error', failed); child.once('exit', exited);\n lifetime?.signal.addEventListener('abort', aborted, { once: true });\n if (lifetime?.signal.aborted) aborted();\n });\n child.on('error', error => { if (this.child === child && !this.closing) this.emit('failure', error); });\n }\n\n update(snapshot: PetSnapshot): void {\n this.latest = snapshot;\n const key = snapshot.results.map(result => `${result.id}:${result.read}`).join('|');\n this.send({ type: 'snapshot', snapshot: desktopSnapshot(snapshot, key !== this.resultKey) });\n this.resultKey = key;\n }\n notify(notice: PetNotice | TaskNotice): void { this.send({ type: 'notice', notice }); }\n notificationState(snapshot: NotificationSnapshot): void { this.lastNotificationState = structuredClone(snapshot); this.send({ type: 'notification-state', snapshot }); }\n snoozeResult(interactionId: string, ok: boolean, error?: string): void { this.send({ type: 'notification-snooze-result', interactionId, ok, ...(error ? { error: error.slice(0, 600) } : {}) }); }\n presentRole(notice: TaskNotice, runtime: NotificationRuntime): boolean {\n if (!this.child?.connected || this.closing || !this.nativeVisible || this.suspended || runtime.generation !== this.generation || runtime.visibilityRevision !== this.visibilityRevision || !runtime.visible) return false;\n this.send({ type: 'notice', notice, generation: runtime.generation, visibilityRevision: runtime.visibilityRevision }); return true;\n }\n onAction(listener: (action: unknown) => void): void { this.on('action', listener); }\n removeAction(listener: (action: unknown) => void): void { this.off('action', listener); }\n // JSON IPC omits undefined. An explicit null lets a cleared Harness\n // preference restore the renderer's automatic language instead of retaining\n // its previous locale during a merged configuration update.\n configure(options: DesktopOptions): void { this.send({ type: 'configure', options: { ...options, locale: options.locale ?? null } }); }\n control(command: 'show' | 'hide' | 'characters'): void { this.send({ type: 'control', command }); }\n focusHarness(): void { this.send({ type: 'control', command: 'focus-harness' }); }\n onLifecycle(listener: (state: NativeLifecycle) => void): void { this.on('lifecycle', listener); }\n removeLifecycle(listener: (state: NativeLifecycle) => void): void { this.off('lifecycle', listener); }\n private send(message: object): void {\n if (this.child?.connected) this.child.send(message, error => { if (error && !this.closing) this.emit('failure', error); });\n }\n\n async dispose(): Promise<void> {\n this.closing = true;\n const child = this.child;\n if (!child) return;\n if (child.pid === undefined || child.exitCode !== null || child.signalCode !== null) { if (this.child === child) this.child = undefined; return; }\n await new Promise<void>((resolve, reject) => {\n let deadline: ReturnType<typeof setTimeout>;\n const timer = setTimeout(() => { child.kill('SIGKILL'); deadline = setTimeout(() => { if (child.exitCode !== null || child.signalCode !== null) resolve(); else reject(new Error('\u684C\u5BA0\u8FDB\u7A0B\u672A\u786E\u8BA4\u9000\u51FA')); }, 1000); }, 3000);\n child.once('exit', () => { clearTimeout(timer); clearTimeout(deadline); resolve(); });\n if (child.connected) child.send({ type: 'quit' }, error => { if (error) child.kill(); }); else child.kill();\n });\n if (this.child === child) this.child = undefined;\n }\n}\n\nexport function isRecord(value: unknown): value is Record<string, unknown> { return typeof value === 'object' && value !== null && !Array.isArray(value); }\n\n/** Stream animation updates carry metadata; full result text crosses IPC only when it changes. */\nfunction desktopSnapshot(snapshot: PetSnapshot, includeResults: boolean) {\n const { results, ...state } = snapshot;\n return { ...state, text: state.mood === 'happy' ? '' : state.text,\n sessions: state.sessions.map(session => ({ ...session, text: session.mood === 'happy' ? '' : session.text, reply: '' })),\n ...(includeResults ? { results } : {}),\n };\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,aAAgC;AACzC,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AA0BtB,IAAM,iBAAN,cAA6B,aAAkC;AAAA,EAC5D;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EAEV,aAAa;AAAA,EACb,qBAAqB;AAAA,EACrB,gBAAgB;A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