aicrosschat 0.8.3 → 0.8.4
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/INSTALL.md +6 -6
- package/LICENSE +1 -1
- package/README.md +79 -46
- package/mcp/server.mjs +33 -0
- package/package.json +1 -1
- package/plugin/package.json +2 -2
- package/setup-member.ps1 +6 -6
package/INSTALL.md
CHANGED
|
@@ -35,16 +35,16 @@ relay **不需要**在每台机器上都跑——只要有一台机器(通常
|
|
|
35
35
|
```sh
|
|
36
36
|
# macOS / Linux
|
|
37
37
|
cd ~/.dsh/profiles/web # 或你使用的 profile 目录
|
|
38
|
-
pnpm add
|
|
38
|
+
pnpm add aicrosschat
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
```powershell
|
|
42
42
|
# Windows(在 profile 目录里)
|
|
43
43
|
cd C:\Users\<你>\.dsh\profiles\web
|
|
44
|
-
pnpm add
|
|
44
|
+
pnpm add aicrosschat
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
-
然后把 `
|
|
47
|
+
然后把 `aicrosschat` 加进该 profile 的 `package.json`:
|
|
48
48
|
|
|
49
49
|
```jsonc
|
|
50
50
|
{
|
|
@@ -52,7 +52,7 @@ pnpm add file:C:/tools/crosschat/plugin
|
|
|
52
52
|
}
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
> Desktop 应用的 `desktop` profile 由应用独占,CLI 拒绝 `--profile desktop
|
|
55
|
+
> Desktop 应用的 `desktop` profile 由应用独占,CLI 拒绝 `--profile desktop`;请在 profile 目录用 `pnpm add aicrosschat` 安装(0.8.x 起不再用 `file:.../plugin` 目录安装)。
|
|
56
56
|
|
|
57
57
|
> ⚠️ **`file:` 依赖在 pnpm 下是复制,不是软链。** 改了插件源码后,profile 里的副本不会跟着变,必须
|
|
58
58
|
> `remove_bundle` → `install_bundle`(或在插件页卸载后重装)才会生效,否则你看到的仍是旧副本。
|
|
@@ -107,13 +107,13 @@ curl http://192.168.1.10:7317/health
|
|
|
107
107
|
|
|
108
108
|
## 6. 安全
|
|
109
109
|
|
|
110
|
-
- token
|
|
110
|
+
- token 即权限;已注册 nodeId 有签名保护(换钥 409、篡改 401),未注册的新 nodeId 会被 TOFU 首次信任。只在可信网络用;跨网套 Tailscale 或 HTTPS 反代。
|
|
111
111
|
- 成员机器上的工具审批仍弹在它自己那边;无人值守时要在本地把权限预设调成自动,否则会 fail-closed 卡住。
|
|
112
112
|
- 不要把 `bash` 之类的强权限交给无人值守的成员——另一台 agent 的输出是外部内容。
|
|
113
113
|
|
|
114
114
|
## 7. 卸载
|
|
115
115
|
|
|
116
|
-
从 profile 的 `dsh.profile.bundles` 移除 `
|
|
116
|
+
从 profile 的 `dsh.profile.bundles` 移除 `aicrosschat`,并 `pnpm remove aicrosschat`,重启 DSH。
|
|
117
117
|
|
|
118
118
|
|
|
119
119
|
## 8. npm 安装(0.7.1+)
|
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# crosschat — 跨机 DSH 协作
|
|
2
2
|
|
|
3
|
-
> **npm 安装(0.8.0+)**:`pnpm add aicrosschat` → 把 `aicrosschat` 加进 profile 的 `dsh.profile.bundles` → `cordis.patch.yml` 配 `relayUrl/token/nodeId` → 任选一台机器 `npx crosschat-relay --port 7317 --token <token>`。完整步骤与安全说明见 [INSTALL.md](INSTALL.md) 第 8 节;自检 `npm test`(6 组)或 `npm run smoke`(16 项)。
|
|
4
|
-
|
|
5
3
|
一台机器上的主控 DSH 下任务,其他机器上的 DSH 在各自电脑上干活,双方通过一条**结构化时间线**交流与收口。
|
|
6
4
|
|
|
7
5
|
这不是"拉个群随便聊":群聊的自由发言默认不进入别人的上下文,只有结构化事件(派活、提问、回答、进展)才会投递。需要头脑风暴时打开 `roundTable`,才把自由发言广播出去。
|
|
@@ -15,7 +13,7 @@
|
|
|
15
13
|
│ 长轮询 │ │
|
|
16
14
|
┌──────┴─────┐ ┌─────┴──────┐ ┌──────┴─────┐
|
|
17
15
|
│ 主控 DSH │ │ 成员 DSH 1 │ │ 成员 DSH 2 │
|
|
18
|
-
│ nodeId=lead │ │ node-b │ │ node-
|
|
16
|
+
│ nodeId=lead │ │ node-b │ │ node-c │
|
|
19
17
|
└────────────┘ └────────────┘ └────────────┘
|
|
20
18
|
```
|
|
21
19
|
|
|
@@ -47,14 +45,17 @@
|
|
|
47
45
|
| 广播的 `note`(自由发言) | **不投递**(仍可用 `team_inbox` 读到) | 投递、只注入 |
|
|
48
46
|
| 与他机相关的事件 | 不投递 | 不投递 |
|
|
49
47
|
|
|
50
|
-
##
|
|
48
|
+
## 模型可见的工具(DSH 端共 11 个)
|
|
51
49
|
|
|
52
50
|
| 工具 | 作用 |
|
|
53
51
|
|---|---|
|
|
54
|
-
| `team_join` |
|
|
52
|
+
| `team_join` / `team_leave` | 入席 / 退席(MCP 端由环境变量固定身份,没有这两个) |
|
|
55
53
|
| `team_say` | 发言/派活/汇报;`to`、`kind`、`taskId` 决定投给谁 |
|
|
56
54
|
| `team_inbox` | 读取最近事件(包括没投递给你的),支持 `since` 续读 |
|
|
57
55
|
| `team_peers` | 列出在线节点 |
|
|
56
|
+
| `team_claim` / `team_done` / `team_tasks` | 任务板:认领 / 完成 / 查看 |
|
|
57
|
+
| `team_profile` / `team_roster` | 能力自述 / 名册 |
|
|
58
|
+
| `team_wait` | 阻塞等一组任务完成(默认 60s,上限 300s) |
|
|
58
59
|
|
|
59
60
|
## 任务板
|
|
60
61
|
|
|
@@ -74,14 +75,13 @@ task ──▶ open ──claim──▶ claimed ──done──▶ done
|
|
|
74
75
|
| 释放 | `release` 把 `claimed` 退回 `open`,可被别人重新认领 |
|
|
75
76
|
| 关闭 | 只有 `done` 关闭任务;`answer` / `status` 只是汇报,不算完成 |
|
|
76
77
|
|
|
77
|
-
|
|
78
|
+
三端工具的差异(以实际代码为准):
|
|
78
79
|
|
|
79
|
-
|
|
|
80
|
-
|
|
81
|
-
| `
|
|
82
|
-
|
|
|
83
|
-
|
|
|
84
|
-
| `team_say(kind=task, …)` | 派任务;未给 `taskId` 时自动生成 |
|
|
80
|
+
| 端 | 工具数 | 说明 |
|
|
81
|
+
|---|---|---|
|
|
82
|
+
| DSH 插件 | **11** | 含 `team_join` / `team_leave`,身份随会话自动恢复 |
|
|
83
|
+
| MCP 桥 | **9** | 无 join/leave(用 `CROSSCHAT_NODE` 固定身份),其余同名同义,含 `team_wait` |
|
|
84
|
+
| CLI | **9** | 子命令 `peers/say/inbox/claim/done/tasks/profile/roster/wait` |
|
|
85
85
|
|
|
86
86
|
> 实践提醒:干完活一定要调 `team_done`,别只发 `answer`——`answer` 不关闭任务,板上会一直显示 `open`。
|
|
87
87
|
|
|
@@ -106,7 +106,7 @@ task ──▶ open ──claim──▶ claimed ──done──▶ done
|
|
|
106
106
|
### 1. 主控机器上启动 relay
|
|
107
107
|
|
|
108
108
|
```powershell
|
|
109
|
-
|
|
109
|
+
npx crosschat-relay --port 7317 --host 0.0.0.0 --token <一个长随机串>
|
|
110
110
|
```
|
|
111
111
|
|
|
112
112
|
- 建议加 `--data events.jsonl` 持久化事件。
|
|
@@ -115,15 +115,14 @@ node crosschat\relay\relay.mjs --port 7317 --host 0.0.0.0 --token <一个长随
|
|
|
115
115
|
|
|
116
116
|
### 2. 每台机器装插件
|
|
117
117
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
```
|
|
123
|
-
plugin_manager.install_bundle({ action: 'install_bundle', target: 'file:C:\\path\\to\\crosschat\\plugin' })
|
|
118
|
+
```powershell
|
|
119
|
+
cd %USERPROFILE%\.dsh\profiles\desktop
|
|
120
|
+
pnpm add aicrosschat
|
|
124
121
|
```
|
|
125
122
|
|
|
126
|
-
|
|
123
|
+
然后把 `aicrosschat` 加进该 profile 的 `dsh.profile.bundles`,重启 DSH。根包通过 `dsh.bundle.patch` 指向 `plugin/cordis.patch.yml`。
|
|
124
|
+
|
|
125
|
+
> 0.8.x 起不再支持“把 `plugin` 子目录当包安装”(`file:...\plugin`);那是 0.7 的目录分发方式,patch 的模块名已改为 `aicrosschat`。
|
|
127
126
|
|
|
128
127
|
### 3. 每台机器配置
|
|
129
128
|
|
|
@@ -131,7 +130,7 @@ plugin_manager.install_bundle({ action: 'install_bundle', target: 'file:C:\\path
|
|
|
131
130
|
|
|
132
131
|
```yaml
|
|
133
132
|
- id: crosschat
|
|
134
|
-
name:
|
|
133
|
+
name: aicrosschat
|
|
135
134
|
config:
|
|
136
135
|
relayUrl: http://192.168.1.10:7317
|
|
137
136
|
token: <和 relay 一致>
|
|
@@ -155,20 +154,20 @@ plugin_manager.install_bundle({ action: 'install_bundle', target: 'file:C:\\path
|
|
|
155
154
|
|
|
156
155
|
## 验证
|
|
157
156
|
|
|
157
|
+
仓库内(含测试目录):
|
|
158
|
+
|
|
158
159
|
```powershell
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
node crosschat\plugin\test-integration.mjs # 真实 relay + 假 agent 的端到端
|
|
162
|
-
node crosschat\test-two-instances.mjs # 两个隔离 DSH 实例的端到端
|
|
160
|
+
npm test # 6 组:identity / tasks / core / relay smoke / mcp / 包完整性
|
|
161
|
+
npm run smoke # relay 协议与安全,16 项断言
|
|
163
162
|
```
|
|
164
163
|
|
|
165
|
-
|
|
164
|
+
安装包里(`test/` 不进发布包):
|
|
166
165
|
|
|
167
|
-
|
|
166
|
+
```powershell
|
|
167
|
+
npm run smoke # 16 项,等价于 node relay/smoke.mjs
|
|
168
|
+
```
|
|
168
169
|
|
|
169
|
-
|
|
170
|
-
- 实例 B:隔离 `DSH_HOME=%USERPROFILE%\.crosschat-member`,`sdk` profile,`nodeId=node-b`,由 `test-two-instances.mjs` 通过 stdio JSON-RPC 驱动。
|
|
171
|
-
- 证据链:B 运行 `team_join` 后出现在 `/peers`;A 发 `task`(seq=7);B 被 `followup` 唤醒、跑完一轮、用 `team_say` 回报(seq=8);该回报以 `[crosschat]` 信封注入 A 的上下文。
|
|
170
|
+
> 早先文档里提到的 `test-core.mjs`、`test-integration.mjs`、`test-two-instances.mjs` 已不存在;双实例结果属于历史记录,当前仓库不再提供该驱动脚本,**不作为可复现声明**。
|
|
172
171
|
|
|
173
172
|
|
|
174
173
|
## 其他客户端接入(非 DSH)
|
|
@@ -186,7 +185,7 @@ node crosschat\test-two-instances.mjs # 两个隔离 DSH 实例的端到端
|
|
|
186
185
|
| `CROSSCHAT_NODE` | 本成员节点 id(必填,全网唯一) |
|
|
187
186
|
| `CROSSCHAT_NAME` | 显示名,默认等于节点 id |
|
|
188
187
|
|
|
189
|
-
|
|
188
|
+
暴露九个工具:`team_say`、`team_inbox`、`team_peers`、`team_claim`、`team_done`、`team_tasks`、`team_profile`、`team_roster`、`team_wait`(与 DSH 插件的对应工具同名同义;DSH 另有 `team_join` / `team_leave`,用于入席管理,MCP 端以环境变量固定身份,不需要这两个)。
|
|
190
189
|
|
|
191
190
|
通用 `mcpServers` 配置(WorkBuddy 的 `~/.workbuddy/mcp.json`、Trae、扣子、Kimi、Qoder、Claude Code、Codex、Cursor、Gemini CLI 都吃这一套):
|
|
192
191
|
|
|
@@ -195,7 +194,7 @@ node crosschat\test-two-instances.mjs # 两个隔离 DSH 实例的端到端
|
|
|
195
194
|
"mcpServers": {
|
|
196
195
|
"crosschat": {
|
|
197
196
|
"command": "node",
|
|
198
|
-
"args": ["
|
|
197
|
+
"args": ["npx crosschat-mcp"],
|
|
199
198
|
"env": {
|
|
200
199
|
"CROSSCHAT_RELAY": "http://192.168.1.10:7317",
|
|
201
200
|
"CROSSCHAT_TOKEN": "<relay token>",
|
|
@@ -210,9 +209,9 @@ node crosschat\test-two-instances.mjs # 两个隔离 DSH 实例的端到端
|
|
|
210
209
|
### 2) CLI shim(任何能跑命令的 agent)
|
|
211
210
|
|
|
212
211
|
```sh
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
212
|
+
npx crosschat peers
|
|
213
|
+
npx crosschat say "正文" --to node-a --kind answer --task T1
|
|
214
|
+
npx crosschat inbox --since 8 --limit 5
|
|
216
215
|
```
|
|
217
216
|
|
|
218
217
|
连接参数:`--relay` / `--token` / `--node` / `--name`,或对应的 `CROSSCHAT_*` 环境变量。
|
|
@@ -246,7 +245,37 @@ MCP 与 CLI 成员**没有 `inject`/`followup`**——那是 DSH 内部的 agent
|
|
|
246
245
|
|
|
247
246
|
> 升级顺序:**先升客户端,再升 relay**。反过来的话,旧客户端发不出签名,所有消息都会被 400 拒绝。
|
|
248
247
|
|
|
249
|
-
##
|
|
248
|
+
## 依赖、能力自述与收口
|
|
249
|
+
|
|
250
|
+
这三组能力是为「一句话派活 → 自动拆解 → 等齐 → 汇总」准备的。
|
|
251
|
+
|
|
252
|
+
### 任务依赖(`dependsOn`)
|
|
253
|
+
|
|
254
|
+
```json
|
|
255
|
+
{ "kind": "task", "taskId": "T3", "to": "node-b", "dependsOn": ["T1", "T2"], "text": "跑测试" }
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
- 前置任务**没有全部 `done`** 时,`team_claim` 会返回「依赖未完成:T1, T2」,不会生效;
|
|
259
|
+
- 任务板上该项显示 `deps=…`,未就绪时标「· 等待中」;
|
|
260
|
+
- 依赖是**认领门**,不是自动调度:前置完成后,需要主控或成员再次 `claim`(或由主控 `team_wait` 等到齐后再派下一批)。
|
|
261
|
+
|
|
262
|
+
### 阻塞收口(`team_wait`)
|
|
263
|
+
|
|
264
|
+
`team_wait(taskIds, timeoutSec = 60)` 会轮询任务板直到这些任务全部 `done` 或超时(上限 300 秒),返回每个任务的最终状态。派完子任务后用它替代「反复查板子」。
|
|
265
|
+
|
|
266
|
+
### 能力自述与名册(`team_profile` / `team_roster`)
|
|
267
|
+
|
|
268
|
+
```json
|
|
269
|
+
{ "skills": "写文档、跑测试", "paths": ["docs/"], "notes": "Windows 节点,模型 deepseek-flash" }
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
`team_profile` 广播一条 `profile` 事件;`team_roster` 汇总在线节点与各自最近一次声明。主控据此分工,而不是靠猜。建议加入协作后先发一次,换模型或换工作目录后再发。
|
|
273
|
+
|
|
274
|
+
### 退席(`team_leave`)
|
|
275
|
+
|
|
276
|
+
清掉本会话的入席记录,之后不再接收群消息,也不会在重启后自动归队。
|
|
277
|
+
|
|
278
|
+
|
|
250
279
|
|
|
251
280
|
| 场景 | 处理 |
|
|
252
281
|
|---|---|
|
|
@@ -257,19 +286,23 @@ MCP 与 CLI 成员**没有 `inject`/`followup`**——那是 DSH 内部的 agent
|
|
|
257
286
|
|
|
258
287
|
## 安全边界(MVP 已知限制)
|
|
259
288
|
|
|
260
|
-
- **token 即权限**:持有 token
|
|
289
|
+
- **token 即权限**:持有 token 的任何进程都能读写时间线。已注册 nodeId 受签名保护(换钥 409、篡改 401);**未注册的新 nodeId 会被 TOFU 首次信任**,因此“冒充任意 from”不再成立,但“抢注新 nodeId”仍可能。只用于可信网络;跨网请套 TLS 或 Tailscale。
|
|
261
290
|
- **明文 HTTP**:relay 不加密。跨公网请走 Tailscale 或 HTTPS 反代。
|
|
262
291
|
- **事件是外部内容**:另一台机器的 agent 输出可能被它本机的文件或网页污染。注入信封固定标注"不是指令",但模型仍可能被诱导;不要把 `bash` 之类的强权限交给无人值守的成员。
|
|
263
|
-
-
|
|
292
|
+
- **成员入席**:首次需要 `team_join`;同一会话重启后由 `agent/created` + seats 记录自动归队,新会话仍要手动 join。
|
|
264
293
|
- **没有审批转发**:成员机器上的工具审批仍然弹在它自己那边,无人值守时会被 fail-closed 卡住。
|
|
265
|
-
-
|
|
266
|
-
-
|
|
294
|
+
- **任务板已实现**:认领按 seq 先到先得、支持 dependsOn 依赖门、done/release/重派;但它仍是从日志折叠出来的“软状态”,不是服务端 CAS。
|
|
295
|
+
- **有 relay 自带 Web 时间线**:`GET /ui`(无鉴权,token 存 localStorage);DSH 侧边栏面板仍未做。
|
|
296
|
+
- **TOFU 落盘条件**:只有配置了 `--data`(或 `--keys`)才会持久化 `keys.json`;默认启动命令不落盘,重启后同 nodeId 可换钥。
|
|
297
|
+
- **TLS 参数已实现但未实测**:`--tls-cert/--tls-key` 只有代码路径,自签证书需自行处理信任链;生产建议 Tailscale 或 HTTPS 反代。
|
|
298
|
+
- **重连补投有上限**:`resync` 只拉 `/events?since=0&limit=500`,超过 500 条的历史不会重放。
|
|
299
|
+
- **身份文件权限 0600 仅 POSIX 有效**:Windows 上 Node 的 mode 不生效。
|
|
267
300
|
|
|
268
301
|
## 路线
|
|
269
302
|
|
|
270
|
-
1. ✅ relay + 插件 +
|
|
271
|
-
2.
|
|
272
|
-
3.
|
|
273
|
-
4.
|
|
274
|
-
5.
|
|
275
|
-
6.
|
|
303
|
+
1. ✅ relay + 插件 + 投递规则(smoke 16/16)
|
|
304
|
+
2. ✅ 任务板(claim / done / dependsOn / 重派)
|
|
305
|
+
3. ✅ 自动归队(同会话重启经 seats 恢复)
|
|
306
|
+
4. ✅ MCP 桥(9 工具)与 CLI(9 子命令)
|
|
307
|
+
5. ⏳ 审批转发到主控;DSH 侧边栏面板
|
|
308
|
+
6. ⏳ TLS 实测与证书信任链;>500 条历史补投
|
package/mcp/server.mjs
CHANGED
|
@@ -98,6 +98,18 @@ const TOOLS = [
|
|
|
98
98
|
description: '查看成员名册:在线节点与各自最近一次能力声明。',
|
|
99
99
|
inputSchema: { type: 'object', properties: {} },
|
|
100
100
|
},
|
|
101
|
+
{
|
|
102
|
+
name: 'team_wait',
|
|
103
|
+
description: '阻塞等待一组任务全部完成(done)或超时。派完子任务后用它收口,最多等 timeoutSec 秒。',
|
|
104
|
+
inputSchema: {
|
|
105
|
+
type: 'object',
|
|
106
|
+
properties: {
|
|
107
|
+
taskIds: { type: 'array', items: { type: 'string' }, description: '要等待的任务 id 列表。' },
|
|
108
|
+
timeoutSec: { type: 'integer', description: '最长等待秒数,默认 60,上限 300。' },
|
|
109
|
+
},
|
|
110
|
+
required: ['taskIds'],
|
|
111
|
+
},
|
|
112
|
+
},
|
|
101
113
|
{
|
|
102
114
|
name: 'team_peers',
|
|
103
115
|
description: '列出当前在线的协作节点和日志尾部序号。',
|
|
@@ -215,6 +227,27 @@ async function callTool(name, args) {
|
|
|
215
227
|
return [...nodes].map(node => `${node}${online.has(node) ? '' : '(离线)'}`
|
|
216
228
|
+ `${profiles.has(node) ? `: ${profiles.get(node)}` : '(未声明能力)'}`).join('\n')
|
|
217
229
|
}
|
|
230
|
+
if (name === 'team_wait') {
|
|
231
|
+
const ids = normalizeIds(args?.taskIds)
|
|
232
|
+
if (ids.length === 0) throw new Error('taskIds 不能为空')
|
|
233
|
+
const timeoutSec = Math.min(300, Math.max(5, Number(args?.timeoutSec ?? 60)))
|
|
234
|
+
const deadline = Date.now() + timeoutSec * 1000
|
|
235
|
+
const snapshot = async () => {
|
|
236
|
+
const page = await client.events(0, 500)
|
|
237
|
+
const board = foldTasks(page.events ?? [])
|
|
238
|
+
return ids.map(id => ({ id, state: board.get(id)?.state ?? 'missing' }))
|
|
239
|
+
}
|
|
240
|
+
for (;;) {
|
|
241
|
+
const rows = await snapshot()
|
|
242
|
+
if (rows.every(row => row.state === 'done')) {
|
|
243
|
+
return `全部完成:${rows.map(row => `${row.id}=done`).join('、')}`
|
|
244
|
+
}
|
|
245
|
+
if (Date.now() >= deadline) {
|
|
246
|
+
return `超时(${timeoutSec}s),仍未全部完成:${rows.map(row => `${row.id}=${row.state}`).join('、')}`
|
|
247
|
+
}
|
|
248
|
+
await new Promise(resolve => setTimeout(resolve, 2000))
|
|
249
|
+
}
|
|
250
|
+
}
|
|
218
251
|
if (name === 'team_peers') {
|
|
219
252
|
const page = await client.peers()
|
|
220
253
|
const nodes = (page.peers ?? []).map(p => p.node)
|
package/package.json
CHANGED
package/plugin/package.json
CHANGED
package/setup-member.ps1
CHANGED
|
@@ -60,27 +60,27 @@ if (-not (Test-Path $manifestFile)) {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
# --- 3. plugin installed? --------------------------------------------------
|
|
63
|
-
$pluginPkg = Join-Path $ProfileDir 'node_modules\
|
|
63
|
+
$pluginPkg = Join-Path $ProfileDir 'node_modules\aicrosschat\package.json'
|
|
64
64
|
if (Test-Path $pluginPkg) {
|
|
65
65
|
$version = ([System.IO.File]::ReadAllText($pluginPkg, [System.Text.Encoding]::UTF8) | ConvertFrom-Json).version
|
|
66
|
-
Write-Ok "plugin present:
|
|
66
|
+
Write-Ok "plugin present: aicrosschat@$version"
|
|
67
67
|
} else {
|
|
68
68
|
Write-Warn2 "plugin not installed yet - install it in the DSH Plugins UI (source: path to crosschat\plugin)"
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
$manifest = [System.IO.File]::ReadAllText($manifestFile, [System.Text.Encoding]::UTF8) | ConvertFrom-Json
|
|
72
72
|
$bundles = @($manifest.dsh.profile.bundles)
|
|
73
|
-
if ($bundles -contains '
|
|
74
|
-
Write-Ok "
|
|
73
|
+
if ($bundles -contains 'aicrosschat') {
|
|
74
|
+
Write-Ok "aicrosschat is already in dsh.profile.bundles"
|
|
75
75
|
} else {
|
|
76
|
-
Write-Warn2 "
|
|
76
|
+
Write-Warn2 "aicrosschat is missing from dsh.profile.bundles - add it or install via the Plugins UI"
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
# --- 4. config block -------------------------------------------------------
|
|
80
80
|
$block = @"
|
|
81
81
|
# crosschat (written by setup-member.ps1)
|
|
82
82
|
- id: crosschat
|
|
83
|
-
name:
|
|
83
|
+
name: aicrosschat
|
|
84
84
|
config:
|
|
85
85
|
relayUrl: $RelayUrl
|
|
86
86
|
token: $Token
|