@takboo/dsh-coopanion 0.4.7 → 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 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.7 使用 Coopanion 的原生动画与角色运行时,组合程序采用 AGPL-3.0-or-later。** 大肥鱼的网格变形、弹簧动作、动态五官、物理拖拽和八套配色直接复用上游固定版本。角色贴图保留独立权利声明,见 [第三方声明](THIRD_PARTY_NOTICES.md) 和 [上游版本记录](web/upstream/UPSTREAM.md)。
5
+ **v0.4.8 使用 Coopanion 的原生动画与角色运行时,组合程序采用 AGPL-3.0-or-later。** 大肥鱼的网格变形、弹簧动作、动态五官、物理拖拽和八套配色直接复用上游固定版本。角色贴图保留独立权利声明,见 [第三方声明](THIRD_PARTY_NOTICES.md) 和 [上游版本记录](web/upstream/UPSTREAM.md)。
6
6
 
7
- 本次更新将同一会话的未读回合合并为最新回复,并为完整阅读提供 Markdown 标题、粗体、表格、列表和代码块渲染。查看 [最新修改记录](https://github.com/takboo/dsh-coopanion/releases/latest) 或 [完整版本记录](docs/release-notes.md)。
7
+ 本次更新统一桌宠与 Harness 的中英文语言,覆盖桌面菜单、聊天、收件箱、角色面板和原生托盘;切换立即生效,回复原文与当前配色保持不变。查看 [最新修改记录](https://github.com/takboo/dsh-coopanion/releases/latest) 或 [完整版本记录](docs/release-notes.md)。
8
8
 
9
9
  ## 功能
10
10
 
@@ -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.7.tgz`,或按下面步骤构建 `takboo-dsh-coopanion-0.4.7.tgz`。npm 包名为 `@takboo/dsh-coopanion`;本地 `npm pack` 的文件名包含 scope。
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.7.tgz
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/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
- app.setName('DeepSeek 大肥鱼');
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 state = trayState(lastFrame?.snapshot, presentation, options, win?.isVisible());
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: '回到当前会话', enabled: !!state.sessionId, click: () => act({ type: 'open-session', sessionId: state.sessionId }) },
53
- { label: '切换陪伴会话', 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 ? ` · ${session.unread} 份未读` : ''}${['waiting', 'error'].includes(session.mood) ? ' · 需要你' : ''}`, checked: session.selected, click: () => act({ type: 'select', sessionId: session.id }) })) },
54
- { label: `待查看 · ${state.activity.unread} 份回复 · ${state.activity.waiting + state.activity.errors} 段需要你`, click: () => { show(); forward({ type: 'ui-control', command: 'sessions' }); } },
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: '说句话', click: () => { show(); forward({ type: 'ui-control', command: 'chat' }); } },
57
- { label: '角色与配色', click: () => { show(); forward({ type: 'characters' }); } },
58
- { label: '自在走动', type: 'checkbox', checked: state.roam, click: item => act({ type: 'preference', field: 'roam', value: item.checked }) },
59
- { label: '休息一下(新任务会唤醒)', type: 'checkbox', checked: state.sleeping, enabled: !state.active, click: () => forward({ type: 'ui-control', command: 'sleep' }) },
60
- { label: '任务提醒', type: 'checkbox', checked: state.notifications, click: item => act({ type: 'preference', field: 'notifications', value: item.checked }) },
61
- { label: '动作与说话音效', type: 'checkbox', checked: state.sound, click: () => forward({ type: 'ui-control', command: 'sound' }) },
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 ? '暂时藏起来' : '显示伙伴', click: () => state.visible ? win.hide() : show() },
64
- { label: '关闭桌宠', click: () => app.quit() },
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;
@@ -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 || 'DeepSeek 大肥鱼';
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 ?? '还没有会话',
16
+ sessionId: snapshot.sessionId ?? null, sessionLabel: selected?.label ?? copy.noConversation,
12
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) })),
13
- tooltip: `${name} · ${labels[mood] ?? labels.idle}\n关注:${selected?.label ?? '还没有会话'}\n${activity.busy} 段进行中 · ${activity.waiting + activity.errors} 段需要你 · ${activity.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 });
@@ -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,EAC5D;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EAEV,aAAa;AAAA,EACb,qBAAqB;AAAA,EACrB,gBAAgB;AAAA,EAChB,YAAY;AAAA,EACZ;AAAA,EAER,MAAM,MAAM,SAAyB,UAAyC;AAC5E,QAAI,KAAK,MAAO,OAAM,IAAI,MAAM,gCAAgC;AAChE,QAAI,UAAU,OAAO,QAAS,OAAM,IAAI,MAAM,4CAAS;AACvD,SAAK,UAAU;AACf,SAAK,aAAa,UAAU,cAAc,KAAK,aAAa;AAC5D,SAAK,qBAAqB;AAAG,SAAK,gBAAgB;AAAO,SAAK,YAAY;AAC1E,QAAI,QAAQ,aAAa,WAAW,CAAC,QAAQ,IAAI,WAAW,CAAC,QAAQ,IAAI,gBAAiB,OAAM,IAAI,MAAM,oEAAa;AACvH,UAAM,aAAqB,QAAQ,gBAAgB,cAAc,YAAY,GAAG,EAAE,UAAU;AAC5F,UAAM,MAAyB,EAAE,GAAG,QAAQ,KAAK,oBAAoB,OAAO,KAAK,UAAU,EAAE;AAC7F,WAAQ,IAA0B;AAClC,UAAM,OAAO,CAAC,cAAc,IAAI,IAAI,uBAAuB,YAAY,GAAG,CAAC,CAAC;AAC5E,QAAI,IAAI,4BAA4B,IAAK,MAAK,QAAQ,cAAc;AACpE,UAAM,QAAQ,MAAM,YAAY,MAAM,EAAE,KAAK,OAAO,CAAC,UAAU,QAAQ,QAAQ,KAAK,EAAE,CAAC;AACvF,UAAM,aAAa,KAAK;AAAY,SAAK,QAAQ;AACjD,QAAI,aAAa;A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,CAAC;AACD,QAAI,KAAK,UAAU,MAAO,MAAK,QAAQ;AAAA,EACzC;AACF;AAEO,SAAS,SAAS,OAAkD;AAAE,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAAG;AAG1J,SAAS,gBAAgB,UAAuB,gBAAyB;AACvE,QAAM,EAAE,SAAS,GAAG,MAAM,IAAI;AAC9B,SAAO;AAAA,IAAE,GAAG;AAAA,IAAO,MAAM,MAAM,SAAS,UAAU,KAAK,MAAM;AAAA,IAC3D,UAAU,MAAM,SAAS,IAAI,cAAY,EAAE,GAAG,SAAS,MAAM,QAAQ,SAAS,UAAU,KAAK,QAAQ,MAAM,OAAO,GAAG,EAAE;AAAA,IACvH,GAAI,iBAAiB,EAAE,QAAQ,IAAI,CAAC;AAAA,EACtC;AACF;",
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;AAAA,EAChB,YAAY;AAAA,EACZ;AAAA,EAER,MAAM,MAAM,SAAyB,UAAyC;AAC5E,QAAI,KAAK,MAAO,OAAM,IAAI,MAAM,gCAAgC;AAChE,QAAI,UAAU,OAAO,QAAS,OAAM,IAAI,MAAM,4CAAS;AACvD,SAAK,UAAU;AACf,SAAK,aAAa,UAAU,cAAc,KAAK,aAAa;AAC5D,SAAK,qBAAqB;AAAG,SAAK,gBAAgB;AAAO,SAAK,YAAY;AAC1E,QAAI,QAAQ,aAAa,WAAW,CAAC,QAAQ,IAAI,WAA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