dsh-collab-pair 1.3.1 → 1.4.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 +38 -0
- package/client.js +717 -1
- package/cordis.patch.yml +1 -0
- package/index.js +348 -34
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -36,6 +36,10 @@ Manager receives a collaboration report → next round for that worker, or colla
|
|
|
36
36
|
- Worker: its manager, current task, state, latest report, and a "Leave" action.
|
|
37
37
|
- Not linked: the link form.
|
|
38
38
|
3. **All tasks** — a board across every collaboration, grouped by **project**. Each row shows the worker, round, **working state** (`Working` / `Waiting for report` / `Idle` / `Finished`), waiting time, current task, and latest report. Refresh re-reads it.
|
|
39
|
+
4. **Cross-device** — relay mode (off / self-hosted hub / free ntfy.sh), URL, room, token and device name; save/test, connection status, worker alias registration, and remote-worker linking.
|
|
40
|
+
5. **Stage queue** (manager only) — pick a worker, add a stage title/prompt/acceptance, then start it, complete it (auto-dispatches the next), or remove a pending one.
|
|
41
|
+
|
|
42
|
+
Right-click a conversation in the sidebar and choose **Set as project manager (new worker)**: the plugin creates and links a fresh worker, so that conversation becomes a manager.
|
|
39
43
|
|
|
40
44
|
The manager card also shows the **project name** and lets you rename it.
|
|
41
45
|
|
|
@@ -96,6 +100,17 @@ The manager dispatches through the hub; the worker device prompts its local conv
|
|
|
96
100
|
|
|
97
101
|
Security: the token is a shared secret for the room; anyone holding it can deliver prompts to devices in that room. Use a long random token, HTTPS (a tunnel), and a dedicated room. The hub keeps messages in memory only (15 minutes, 1000 per room) and is not a durable queue.
|
|
98
102
|
|
|
103
|
+
If a tunnel is inconvenient, choose **Free public relay (ntfy.sh)** in the Settings card: no account and no deployment. The topic is derived from room + token; messages go through ntfy.sh in 4 KB chunks (the free tier allows about 250 publishes per day per IP). Use a long random token; this is not end-to-end encrypted.
|
|
104
|
+
|
|
105
|
+
## Stage queue
|
|
106
|
+
|
|
107
|
+
A human can pre-write several large stages for one worker; finishing one dispatches the next automatically.
|
|
108
|
+
|
|
109
|
+
- Add stages in the manager's **Stage queue** card, or with `collab_stage({ action: "add", worker, title, prompt, acceptance })`.
|
|
110
|
+
- `start` dispatches the first pending stage; when its acceptance passes, `complete` marks it done and dispatches the next pending stage in the same call.
|
|
111
|
+
- A stage is a normal round: the worker reports as usual, and `complete` waits until no round is pending.
|
|
112
|
+
- The queue is stored on the worker link; `remove` deletes a pending stage, `clear` removes all pending stages.
|
|
113
|
+
|
|
99
114
|
## Projects
|
|
100
115
|
|
|
101
116
|
A project is the set of workers managed by one project-manager conversation. Different managers are different projects, so nothing mixes:
|
|
@@ -147,6 +162,7 @@ For an existing conversation, call `collab_sessions` to get its id, then `collab
|
|
|
147
162
|
| `collab_link` | anyone | Link a worker; `role=worker` makes the current conversation the worker; `peer="new"` creates one; `mode` picks temporary/permanent; `project` names the project |
|
|
148
163
|
| `collab_worker_create` | manager | Create a new worker conversation (name, preset/model), linked automatically; can dispatch the first round |
|
|
149
164
|
| `collab_remote` | anyone | Cross-device: `alias` registers this conversation on the worker device; `link` binds a remote device/alias on the manager device |
|
|
165
|
+
| `collab_stage` | manager | Stage queue: add/list/start/complete stages; `complete` dispatches the next one automatically |
|
|
150
166
|
| `collab_dispatch` | manager | Dispatch one round; `worker` selects the worker (optional with a single worker), `acceptance` optional |
|
|
151
167
|
| `collab_report` | worker | Report `summary` / `status`(done\|partial\|blocked) / `details` / `next` |
|
|
152
168
|
| `collab_status` | anyone | A manager sees every worker's progress; a worker sees its manager and pending task |
|
|
@@ -168,6 +184,8 @@ The settings page uses it; it can also be typed manually:
|
|
|
168
184
|
/collab project {"name":"…"}
|
|
169
185
|
/collab create {"name":"前端","preset":"standard"}
|
|
170
186
|
/collab remote {"action":"link","device":"laptop","worker":"frontend"}
|
|
187
|
+
/collab stage {"action":"add","title":"阶段一","prompt":"…"}
|
|
188
|
+
/collab relay {"action":"set","mode":"ntfy","hubRoom":"my-project","hubToken":"…"}
|
|
171
189
|
/collab configure {"worker":"session-…","preset":"ptc"}
|
|
172
190
|
/collab configure {"worker":"session-…","provider":"deepseek-account","model":"deepseek-flash"}
|
|
173
191
|
/collab dispatch {"worker":"session-…","task":"…","acceptance":"…"}
|
|
@@ -200,6 +218,7 @@ The `collab-pair` row in `cordis.patch.yml`:
|
|
|
200
218
|
hubRoom: 'default'
|
|
201
219
|
hubToken: ''
|
|
202
220
|
deviceName: '' # defaults to the host name
|
|
221
|
+
relayMode: 'off' # off | hub | ntfy
|
|
203
222
|
addPrefix: true # add the title prefix to linked conversations
|
|
204
223
|
prefixManager: '【项目经理】'
|
|
205
224
|
prefixWorker: '【员工】'
|
|
@@ -261,6 +280,10 @@ dsh plugin add dsh-collab-pair
|
|
|
261
280
|
- 是员工:显示项目经理、当前任务、状态与最近回报,可**退出协作**。
|
|
262
281
|
- 无关联:直接显示关联表单。
|
|
263
282
|
3. **全部任务**:所有协作的任务看板,不限当前会话。每行显示员工、所属项目经理、第几轮、**工作状态**(`工作中` / `等待回报` / `空闲` / `已结束`)、等待时长、本轮任务、最近回报。点「刷新」重新读取。
|
|
283
|
+
4. **跨设备协作**:中继模式(关闭 / 自建 hub / 免费 ntfy.sh)、URL、房间、令牌、设备名;保存/测试、连接状态、员工别名注册、远端员工关联。
|
|
284
|
+
5. **阶段队列**(仅项目经理):选员工,填标题/提示词/验收标准;可开始、完成并自动派发下一阶段、删除待开始阶段。
|
|
285
|
+
|
|
286
|
+
在侧栏右键一个对话,选「设为项目经理(新建员工)」:插件会新建并关联一个员工,使该对话成为项目经理。
|
|
264
287
|
|
|
265
288
|
页面只做关联/解除和查看,不代填目标、任务、验收——这些交给项目经理对话。
|
|
266
289
|
|
|
@@ -317,6 +340,17 @@ collab_dispatch({ worker: "前端", task: "…" })
|
|
|
317
340
|
|
|
318
341
|
安全:token 是整个房间的共享密钥,持有它的人可以向该房间的设备投递提示词。请用足够长的随机 token、HTTPS(隧道)和专用房间。hub 只在内存里保留 15 分钟 / 每房间最多 1000 条消息,不是持久队列。
|
|
319
342
|
|
|
343
|
+
如果内网穿透不方便,可在设置卡片里选 **免费公共中继(ntfy.sh)**:不用账号、不用部署。topic 由 room + token 派生;消息以 4 KB 分片经过 ntfy.sh(免费额度约每 IP 每天 250 次发布)。请用足够长的随机 token;这不是端到端加密。
|
|
344
|
+
|
|
345
|
+
## 阶段队列
|
|
346
|
+
|
|
347
|
+
人可以给同一个员工预先写好多个大阶段;完成一个阶段后自动派发下一个。
|
|
348
|
+
|
|
349
|
+
- 在项目经理卡片的「阶段队列」里添加,或用 `collab_stage({ action: "add", worker, title, prompt, acceptance })`。
|
|
350
|
+
- `start` 派发第一个待开始阶段;验收通过后 `complete` 标记完成,并在同一次调用里自动派发下一个待开始阶段。
|
|
351
|
+
- 阶段本质就是普通的一轮:员工照常回报;仍有轮次在等待回报时,`complete` 会拒绝。
|
|
352
|
+
- 队列保存在员工关联上;`remove` 删除待开始阶段,`clear` 清空所有待开始阶段。
|
|
353
|
+
|
|
320
354
|
## 项目
|
|
321
355
|
|
|
322
356
|
一个项目就是「一个项目经理对话所管理的员工集合」。不同项目经理就是不同项目,互不混淆:
|
|
@@ -364,6 +398,7 @@ collab_dispatch({ worker: "前端", task: "…" })
|
|
|
364
398
|
| `collab_link` | 任何人 | 关联员工;`role=worker` 表示当前对话成为对方的员工;`peer="new"` 新建;`mode` 选临时/永久;`project` 指定项目名 |
|
|
365
399
|
| `collab_worker_create` | 项目经理 | 新建员工对话(可命名、设预设/模型),默认自动关联,可顺便派发第一轮 |
|
|
366
400
|
| `collab_remote` | 任何人 | 跨设备:员工设备用 `alias` 注册对话;经理设备用 `link` 绑定远端设备/别名 |
|
|
401
|
+
| `collab_stage` | 项目经理 | 阶段队列:add/list/start/complete;`complete` 会自动派发下一阶段 |
|
|
367
402
|
| `collab_dispatch` | 项目经理 | 派发一轮;`worker` 指定员工(只有一个时可省略),`acceptance` 可选 |
|
|
368
403
|
| `collab_report` | 员工 | 汇报 `summary` / `status`(done\|partial\|blocked) / `details` / `next` |
|
|
369
404
|
| `collab_status` | 任何人 | 经理看所有员工进度;员工看自己的经理与待办 |
|
|
@@ -385,6 +420,8 @@ collab_dispatch({ worker: "前端", task: "…" })
|
|
|
385
420
|
/collab project {"name":"…"}
|
|
386
421
|
/collab create {"name":"前端","preset":"standard"}
|
|
387
422
|
/collab remote {"action":"link","device":"laptop","worker":"frontend"}
|
|
423
|
+
/collab stage {"action":"add","title":"阶段一","prompt":"…"}
|
|
424
|
+
/collab relay {"action":"set","mode":"ntfy","hubRoom":"my-project","hubToken":"…"}
|
|
388
425
|
/collab configure {"worker":"session-…","preset":"ptc"}
|
|
389
426
|
/collab configure {"worker":"session-…","provider":"deepseek-account","model":"deepseek-flash"}
|
|
390
427
|
/collab dispatch {"worker":"session-…","task":"…","acceptance":"…"}
|
|
@@ -417,6 +454,7 @@ collab_dispatch({ worker: "前端", task: "…" })
|
|
|
417
454
|
hubRoom: 'default'
|
|
418
455
|
hubToken: ''
|
|
419
456
|
deviceName: '' # 默认取主机名
|
|
457
|
+
relayMode: 'off' # off | hub | ntfy
|
|
420
458
|
addPrefix: true # 是否给关联对话加标题前缀
|
|
421
459
|
prefixManager: '【项目经理】'
|
|
422
460
|
prefixWorker: '【员工】'
|