@takboo/dsh-coopanion 0.4.5 → 0.4.7
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 +7 -5
- package/THIRD_PARTY_NOTICES.md +4 -0
- package/desktop/tray-state.cjs +1 -1
- package/dist/index.js +16 -21
- package/dist/index.js.map +2 -2
- package/dist/model.js +3 -3
- package/dist/model.js.map +2 -2
- package/docs/licenses/dompurify.txt +202 -0
- package/docs/licenses/marked.txt +44 -0
- package/docs/notification-implementation.md +9 -1
- package/docs/notification-n4.md +9 -0
- package/docs/notification-plan.md +2 -2
- package/docs/release-notes.md +34 -0
- package/docs/releasing.md +6 -0
- package/npm-shrinkwrap.json +32 -2
- package/package.json +6 -2
- package/scripts/build.mjs +1 -0
- package/scripts/check-package.mjs +1 -1
- package/src/index.ts +10 -4
- package/src/model.ts +3 -3
- package/tests/desktop.mjs +16 -3
- package/tests/inbox-ui.mjs +120 -0
- package/tests/install.mjs +1 -1
- package/tests/model.test.ts +4 -4
- package/tests/notification-ui.mjs +1 -1
- package/tests/presentation.test.js +21 -2
- package/tests/session-recovery.test.ts +116 -0
- package/tests/session-replies-ui.mjs +108 -0
- package/tests/ui.mjs +6 -5
- package/web/index.html +9 -7
- package/web/markdown-runtime.js +73 -0
- package/web/notification-ui.js +4 -0
- package/web/pet.js +96 -45
- package/web/reply-markdown.js +27 -0
- package/web/session-ui.js +24 -1
- package/web/style.css +37 -10
package/README.md
CHANGED
|
@@ -2,7 +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.7 使用 Coopanion 的原生动画与角色运行时,组合程序采用 AGPL-3.0-or-later。** 大肥鱼的网格变形、弹簧动作、动态五官、物理拖拽和八套配色直接复用上游固定版本。角色贴图保留独立权利声明,见 [第三方声明](THIRD_PARTY_NOTICES.md) 和 [上游版本记录](web/upstream/UPSTREAM.md)。
|
|
6
|
+
|
|
7
|
+
本次更新将同一会话的未读回合合并为最新回复,并为完整阅读提供 Markdown 标题、粗体、表格、列表和代码块渲染。查看 [最新修改记录](https://github.com/takboo/dsh-coopanion/releases/latest) 或 [完整版本记录](docs/release-notes.md)。
|
|
6
8
|
|
|
7
9
|
## 功能
|
|
8
10
|
|
|
@@ -24,9 +26,9 @@
|
|
|
24
26
|
|
|
25
27
|
桌宠不作出审批,也不单独收集 API Key。聊天始终发给明确选中的关注会话,新建会话和后台任务不会自动切换目标。关注会话进行中时优先展示它的动作;空闲时用动作反映后台工作或确认 / 异常。状态栏图形优先提示任一会话的确认 / 异常,菜单显示详情。
|
|
26
28
|
|
|
27
|
-
|
|
29
|
+
信封直接打开回复与待办收件箱:同一会话的多个未读回合合并展示最新回复,未读数量按会话计算。只有一份回复时展开全文;多份回复显示摘要和各自的 **继续对话 ↗**,审批、提问及异常提供 **去处理 ↗**。全文支持 Markdown 标题、粗体、列表、表格和代码块。阅读不会切换正在聊天的会话;收件箱阅读器可连续读不同会话的结果,并返回收件箱查看新内容。正在阅读的回复不会被新结果替换。保留最近 200 份完整结果,优先淘汰已读;只有本次 Harness 运行中实时完成的回复计入未读,打开历史会话或重启 Harness 不会把旧回复重新标为未读。重启后原始对话仍由 Harness 保存;任务动画根据当前 Agent 的运行状态恢复。
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
回复气泡展示或自动收起、查看收件箱摘要及收起收件箱均不会标记已读;主动展开阅读、关闭单份回复气泡或通过该回复回到源会话时,确认展示时合并的未读回合。阅读期间新到的回合继续保留未读,旧回合的完整结果仍可通过历史导航查看。审批与 AI 提问由 Harness 的实际答复、决定或取消结果结算;查看、收起互动提示或打开源会话均不会代替处理请求。
|
|
30
32
|
|
|
31
33
|
高频流式事件仅发送动画元数据,完整结果只在结果列表或已读状态变化时传输,避免长回复和多会话拖慢桌面更新。
|
|
32
34
|
|
|
@@ -42,7 +44,7 @@ v0.4.0 移除了旧 Canvas 关键帧引擎、`dsh-character` v1 协议、`.dshpe
|
|
|
42
44
|
|
|
43
45
|
支持 **DSH 0.2.0-rc.2 和 0.2.1-alpha.1**;其他版本未声明兼容。
|
|
44
46
|
|
|
45
|
-
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.7.tgz`,或按下面步骤构建 `takboo-dsh-coopanion-0.4.7.tgz`。npm 包名为 `@takboo/dsh-coopanion`;本地 `npm pack` 的文件名包含 scope。
|
|
46
48
|
2. 在 Harness 侧边栏 **插件** 页安装压缩包的绝对路径,启用 `dsh-coopanion`。
|
|
47
49
|
3. 完全退出再重新打开 Harness。首次启动时会下载并校验 Electron 44 运行时。
|
|
48
50
|
4. 打开一段 Harness 会话,双击角色聊天,或从 **Settings → 桌宠** 管理角色。
|
|
@@ -50,7 +52,7 @@ v0.4.0 移除了旧 Canvas 关键帧引擎、`dsh-character` v1 协议、`.dshpe
|
|
|
50
52
|
也可使用 Desktop 自带的 CLI。先启动 Desktop 一次初始化 profile,完全退出应用,再执行:
|
|
51
53
|
|
|
52
54
|
```bash
|
|
53
|
-
dsh plugin --profile desktop add /absolute/path/dsh-coopanion-0.4.
|
|
55
|
+
dsh plugin --profile desktop add /absolute/path/dsh-coopanion-0.4.7.tgz
|
|
54
56
|
```
|
|
55
57
|
|
|
56
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/tray-state.cjs
CHANGED
|
@@ -9,7 +9,7 @@ function trayState(snapshot = {}, presentation = {}, options = {}, visible = fal
|
|
|
9
9
|
const name = presentation.name || 'DeepSeek 大肥鱼';
|
|
10
10
|
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
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
|
|
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: Number(!!session.unread) })),
|
|
13
13
|
tooltip: `${name} · ${labels[mood] ?? labels.idle}\n关注:${selected?.label ?? '还没有会话'}\n${activity.busy} 段进行中 · ${activity.waiting + activity.errors} 段需要你 · ${activity.unread} 份未读回复`,
|
|
14
14
|
title: '',
|
|
15
15
|
};
|
package/dist/index.js
CHANGED
|
@@ -716,7 +716,7 @@ var PetModel = class {
|
|
|
716
716
|
}
|
|
717
717
|
return item;
|
|
718
718
|
}
|
|
719
|
-
/**
|
|
719
|
+
/** Fold history as a read baseline; callers reconcile activity with the live Agent status. */
|
|
720
720
|
restore(session) {
|
|
721
721
|
if (!this.observe(session)) return;
|
|
722
722
|
for (const event of session.snapshotEvents?.() ?? []) this.fold(session, event, false);
|
|
@@ -893,10 +893,10 @@ var PetModel = class {
|
|
|
893
893
|
const text = task.finalText?.trim() ? task.finalText : "";
|
|
894
894
|
if (text) {
|
|
895
895
|
const id2 = `${item.id}:${event.data.turn}:${event.seq}`;
|
|
896
|
-
this.results.set(id2, { id: id2, sessionId: item.id, text, time: event.time, read:
|
|
896
|
+
this.results.set(id2, { id: id2, sessionId: item.id, text, time: event.time, read: !live });
|
|
897
897
|
item.reply = text;
|
|
898
898
|
item.replyId = id2;
|
|
899
|
-
item.unread++;
|
|
899
|
+
if (live) item.unread++;
|
|
900
900
|
if (this.results.size > 200) {
|
|
901
901
|
const old = [...this.results.values()].find((r) => r.read) ?? this.results.values().next().value;
|
|
902
902
|
this.results.delete(old.id);
|
|
@@ -1284,32 +1284,27 @@ async function mountPet(ctx, options, bridge) {
|
|
|
1284
1284
|
}));
|
|
1285
1285
|
}
|
|
1286
1286
|
});
|
|
1287
|
+
const restoreSession = (session, running = ctx.agents.list().some((agent) => agent.session.id === session.id && agent.status === "running")) => {
|
|
1288
|
+
model.restore(session);
|
|
1289
|
+
if (running) model.running(session);
|
|
1290
|
+
else model.idle(session.id);
|
|
1291
|
+
broker.restore(session);
|
|
1292
|
+
questions?.(session, false);
|
|
1293
|
+
};
|
|
1287
1294
|
ctx.inject(["sessions"], (child) => {
|
|
1288
|
-
for (const session of child.sessions.list())
|
|
1289
|
-
model.restore(session);
|
|
1290
|
-
broker.restore(session);
|
|
1291
|
-
questions?.(session, false);
|
|
1292
|
-
}
|
|
1295
|
+
for (const session of child.sessions.list()) restoreSession(session);
|
|
1293
1296
|
syncNotifications();
|
|
1294
1297
|
update();
|
|
1295
1298
|
});
|
|
1296
|
-
for (const agent of ctx.agents.list())
|
|
1297
|
-
model.restore(agent.session);
|
|
1298
|
-
broker.restore(agent.session);
|
|
1299
|
-
questions?.(agent.session, false);
|
|
1300
|
-
if (agent.status === "running") model.running(agent.session);
|
|
1301
|
-
}
|
|
1299
|
+
for (const agent of ctx.agents.list()) restoreSession(agent.session, agent.status === "running");
|
|
1302
1300
|
ctx.on("session/created", (session) => {
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
questions?.(session, false);
|
|
1301
|
+
restoreSession(session);
|
|
1302
|
+
syncNotifications();
|
|
1306
1303
|
update();
|
|
1307
1304
|
});
|
|
1308
1305
|
ctx.on("agent/created", ({ agent }) => {
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
questions?.(agent.session, false);
|
|
1312
|
-
if (agent.status === "running") model.running(agent.session);
|
|
1306
|
+
restoreSession(agent.session, agent.status === "running");
|
|
1307
|
+
syncNotifications();
|
|
1313
1308
|
update();
|
|
1314
1309
|
return void 0;
|
|
1315
1310
|
});
|