dsh-life-pipline 0.2.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +137 -132
- package/cordis.patch.yml +5 -7
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,132 +1,137 @@
|
|
|
1
|
-
# dsh-life-pipline
|
|
2
|
-
|
|
3
|
-
DeepSeek Harness 的「生活管线」整合包:一个 bundle 只管声明,每个组件是独立包,独立设计、独立验收。
|
|
4
|
-
|
|
5
|
-
设计稿在 [`不入库/管线规划.md`](不入库/管线规划.md),配置页视觉稿在 [`不入库/设计/dsh-life-chat-配置页.html`](不入库/设计/dsh-life-chat-配置页.html)。
|
|
6
|
-
|
|
7
|
-
## 结构
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
dsh-life-pipline/ #
|
|
11
|
-
├── package.json # dsh.bundle.patch → cordis.patch.yml
|
|
12
|
-
├── index.js # 只是导出名字,不是插件
|
|
13
|
-
├── cordis.patch.yml #
|
|
14
|
-
├── locale/{en,zh}.json #
|
|
15
|
-
├── assets/icon.png #
|
|
16
|
-
└── components/
|
|
17
|
-
└── dsh-lpipe-chat/ #
|
|
18
|
-
├── package.json # name / icon / exports / dsh.client
|
|
19
|
-
├──
|
|
20
|
-
├──
|
|
21
|
-
├──
|
|
22
|
-
├──
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
|
42
|
-
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
"
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
1
|
+
# dsh-life-pipline
|
|
2
|
+
|
|
3
|
+
DeepSeek Harness 的「生活管线」整合包:一个 bundle 只管声明,每个组件是独立包,独立设计、独立验收。
|
|
4
|
+
|
|
5
|
+
设计稿在 [`不入库/管线规划.md`](不入库/管线规划.md),配置页视觉稿在 [`不入库/设计/dsh-life-chat-配置页.html`](不入库/设计/dsh-life-chat-配置页.html)。
|
|
6
|
+
|
|
7
|
+
## 结构
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
dsh-life-pipline/ # 整合包:只声明依赖,不插组件行
|
|
11
|
+
├── package.json # dsh.bundle.patch → cordis.patch.yml,dependencies → 各组件
|
|
12
|
+
├── index.js # 只是导出名字,不是插件
|
|
13
|
+
├── cordis.patch.yml # 空列表:组件不再挂在这个 bundle 名下
|
|
14
|
+
├── locale/{en,zh}.json # 整合包自己的显示名与简介
|
|
15
|
+
├── assets/icon.png # 整合包图标:心形带子
|
|
16
|
+
└── components/
|
|
17
|
+
└── dsh-lpipe-chat/ # 组件:自己的 bundle + 自己的插件
|
|
18
|
+
├── package.json # name / icon / exports / dsh.bundle / dsh.client
|
|
19
|
+
├── cordis.patch.yml # 只插自己这一行 → 插件列表里独立一张卡片
|
|
20
|
+
├── src/index.js # 插件本体
|
|
21
|
+
├── client/panel.js # 设置页源码
|
|
22
|
+
├── lib/client.js # 构建产物(提交进仓库)
|
|
23
|
+
├── locale/{en,zh}.json
|
|
24
|
+
└── assets/icon.png # 组件图标:两个气泡合流
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
每个组件包都带一份自己的 `cordis.patch.yml`:
|
|
28
|
+
|
|
29
|
+
```yaml
|
|
30
|
+
- insert:
|
|
31
|
+
- id: dsh-lpipe-chat
|
|
32
|
+
name: dsh-lpipe-chat
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
整合包的那份留空。宿主里「bundle 不是插件行」——bundle 只贡献 patch,因此组件要作为一个插件出现在列表里,就必须自己带这份 patch,并自己被列进 profile 的 `dsh.profile.bundles`。
|
|
36
|
+
|
|
37
|
+
行名必须写裸包名。写成 `dsh-life-pipline/xxx` 这类子路径,宿主解析不出包元信息,客户端半边会静默不加载。
|
|
38
|
+
|
|
39
|
+
## 显示名与图标
|
|
40
|
+
|
|
41
|
+
| 位置 | 包 | 显示名 | 图标 |
|
|
42
|
+
| --- | --- | --- | --- |
|
|
43
|
+
| 插件列表卡片(整合包) | `dsh-life-pipline` | **Life Pipline** | [`assets/icon.png`](assets/icon.png) |
|
|
44
|
+
| 插件列表卡片(组件) | `dsh-lpipe-chat` | **Lpipe Chat** | [`components/dsh-lpipe-chat/assets/icon.png`](components/dsh-lpipe-chat/assets/icon.png) |
|
|
45
|
+
| 设置侧栏条目与页面标题 | `dsh-lpipe-chat` | **Lpipe Chat** | — |
|
|
46
|
+
|
|
47
|
+
标题和简介来自包导出的 `locale/en.json`、`locale/zh.json` 的 `meta.title` / `meta.description`,由宿主的 `readPluginMeta` 读取,缺失时才回退 `package.json` 的 `name` / `description`;图标来自 `package.json` 的 `icon` 字段,必须在包目录内、≤256 KiB。两条路径都要在 `exports` 里放行,否则宿主解析不到。
|
|
48
|
+
|
|
49
|
+
同一个包只能有一个身份:卡片、组件行都读包自己的元信息。想让每个组件都有自己的名字和图标,就必须各做一个包——这就是 `components/` 下按组件分包、并且每个包自带 patch 的原因。
|
|
50
|
+
|
|
51
|
+
图标用 ComfyUI(Krea 2 Turbo)出原型,再用 Photoshop 去白底、居中留白、缩到 512² 导出;候选留在 `不入库/设计/图标/candidates/`。
|
|
52
|
+
|
|
53
|
+
## 组件
|
|
54
|
+
|
|
55
|
+
| 组件 | 包 | 状态 |
|
|
56
|
+
| --- | --- | --- |
|
|
57
|
+
| 社交(微信 / QQ) | `dsh-lpipe-chat` | 实现中 |
|
|
58
|
+
| 记忆、星图、回忆、联想、想象、唤醒、B站 | — | 未开始 |
|
|
59
|
+
|
|
60
|
+
### dsh-lpipe-chat
|
|
61
|
+
|
|
62
|
+
自己持有微信(iLink 官方机器人协议)和 QQ(开放平台机器人)两条通道,不再依赖 dsh-im。
|
|
63
|
+
|
|
64
|
+
- **入站**:扫码接入 → 长轮询收消息 → 只放行主人 → 第一条立即注入,其后 `windowSeconds` 内的消息合并成一次注入。
|
|
65
|
+
- **注入**:独立来源 `dsh-lpipe-chat`、`form: notice` 的后台通知;通过 `sessionController.resolveAgent` 恢复目标会话,忙时 `agent.inject` 等下一步读取,空闲时 `agent.followup` 唤醒。不走普通用户 `prompt`,不使用 `steer`。
|
|
66
|
+
- **标注**:注入正文形如 `[微信 · Kaczev] 原文`,群聊为 `[QQ · 群 · 昵称] 原文`。
|
|
67
|
+
- **出站**:`chat_send` 按渠道回复;回不回由当轮决定。
|
|
68
|
+
- **记录**:`~/.dsh/life-chat/messages.jsonl`,append-only,进出都记,不改写。
|
|
69
|
+
|
|
70
|
+
数据目录仍然叫 `life-chat`,改名会丢已扫码的凭据,所以不动。
|
|
71
|
+
|
|
72
|
+
工具:`chat_send`、`chat_history`、`chat_login`、`chat_status`。
|
|
73
|
+
|
|
74
|
+
**配置页**:设置 → **Lpipe Chat**(宿主 `settings.section` 槽,`id: lpipe-chat`、`order: 60`)。不再挂在插件详情页里,所以整合包与组件都不需要各放一份。主会话 id 输入并回显会话标题、兜窗口秒数、微信/QQ 状态与扫码接入(二维码直接画在页面上,需要配对码时出现输入框)。主会话在会话栏的行首带一枚小气泡标记(`assets/session-mark.png`,青蓝对半,内联成 data URL;挂在宿主的 `sidebar.session.row.leading` 槽位上,按 `sessionId` 判断是不是主会话)。面板只用宿主的 `--dsw-alias-*` 设计 token,深浅色主题跟着宿主走。
|
|
75
|
+
|
|
76
|
+
配置页通过 Host 的 `/api/dsh-lpipe-chat` 管理通道与页面通信(`chat.status` / `chat.config.save` / `chat.session.title` / `chat.login.begin` / `chat.login.state` / `chat.login.code` / `chat.login.cancel`),凭据只留在 Host 侧,页面只能看到「已连接/未连接」。
|
|
77
|
+
|
|
78
|
+
客户端只有一份 `client/panel.js`,构建即包一层模块壳:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
node components/dsh-lpipe-chat/scripts/build-client.mjs # → lib/client.js(提交进仓库,link 安装无需构建)
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## 加一个组件
|
|
85
|
+
|
|
86
|
+
1. `components/<包名>/` 建包,`package.json` 里写 `name`、`icon`、`exports`(含 `./icon`、`./locale/en.json`、`./locale/zh.json`)、`dsh.bundle.patch`、`dsh.client`。
|
|
87
|
+
2. `locale/{en,zh}.json` 写 `meta.title` / `meta.description`。
|
|
88
|
+
3. 包里放 `cordis.patch.yml`,一行插自己(`id` 与 `name` 都用裸包名)。
|
|
89
|
+
4. 跑 `node scripts/install-local.mjs` 重新装进 profile(脚本会把每个组件也列进 `dsh.profile.bundles`)。
|
|
90
|
+
|
|
91
|
+
## 安装
|
|
92
|
+
|
|
93
|
+
普通用户装整合包,组件作为依赖自动带上:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
pnpm add dsh-life-pipline # 或在插件页里搜 Life Pipline
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
`dsh-life-pipline` 的 `dependencies` 里写着 `dsh-lpipe-chat`,所以装整合包会把它一起装进来;组件本身也可以单独装(见 [components/dsh-lpipe-chat/README.md](components/dsh-lpipe-chat/README.md))。
|
|
100
|
+
|
|
101
|
+
注意激活范围:宿主只把**直接依赖**里带 patch 的包自动激活成 bundle。整合包装进来的组件是传递依赖,因此装完之后要在插件页把 Lpipe Chat 启用一次(或用下面的 `install-local`,它会把每个组件也写进 `dsh.profile.bundles`)。
|
|
102
|
+
|
|
103
|
+
## 安装到本机 profile(开发)
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
node scripts/install-local.mjs # 写入 profile package.json 并 pnpm install
|
|
107
|
+
# 然后重启 DeepSeek Harness
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
脚本把整合包和 `components/*` 逐个以 `link:` 写进 profile 的依赖,也逐个列进 `dsh.profile.bundles`(同时清掉旧的 `dsh-life-piplines`),再 `pnpm install`。`--revert` 撤销,`--no-install` 只改清单,执行前会备份 profile 的 `package.json`。
|
|
111
|
+
|
|
112
|
+
## 配置
|
|
113
|
+
|
|
114
|
+
`~/.dsh/life-chat/config.json`:
|
|
115
|
+
|
|
116
|
+
```json
|
|
117
|
+
{
|
|
118
|
+
"mainSessionId": "",
|
|
119
|
+
"windowSeconds": 5,
|
|
120
|
+
"ownerOnly": true,
|
|
121
|
+
"ownerName": "",
|
|
122
|
+
"weixin": { "enabled": true, "botToken": "", "accountId": "", "ownerUserId": "", "baseUrl": "https://ilinkai.weixin.qq.com/" },
|
|
123
|
+
"qq": { "enabled": true, "appId": "", "appSecret": "", "ownerOpenId": "" }
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
凭据为空时不会连接,所以装上之后不会和 dsh-im 抢同一条通道;扫码成功后才开始抢。`chat_status` 会读出 `~/.dsh/integrations` 里 dsh-im 的账号,提示还有哪条通道没交接,避免两个轮询器互相踢。
|
|
128
|
+
|
|
129
|
+
## 测试
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
node --test "components/*/test/*.test.mjs"
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## 收编说明
|
|
136
|
+
|
|
137
|
+
见 [`vendor/MANIFEST.md`](vendor/MANIFEST.md):微信协议层取自 dsh-im 5.9.1(MIT),QQ 用官方 SDK。
|
package/cordis.patch.yml
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
#
|
|
4
|
-
# and
|
|
5
|
-
|
|
6
|
-
- id: dsh-lpipe-chat
|
|
7
|
-
name: dsh-lpipe-chat
|
|
1
|
+
# The aggregator declares npm dependencies only — every component is its own
|
|
2
|
+
# bundle that mounts its own row (components/*/cordis.patch.yml). Keeping this
|
|
3
|
+
# list empty is what stops a component from being inserted twice when the
|
|
4
|
+
# aggregator and the component package are both active in one profile.
|
|
5
|
+
[]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-life-pipline",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "A DSH life bundle that grows one component at a time.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -44,6 +44,6 @@
|
|
|
44
44
|
"deepseek-harness"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"dsh-lpipe-chat": "^0.
|
|
47
|
+
"dsh-lpipe-chat": "^0.3.0"
|
|
48
48
|
}
|
|
49
49
|
}
|