@dsh-teamwork/dsh-teamwork 0.8.2 → 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/README.md +90 -225
- package/README.zh-CN.md +104 -0
- package/assets/readme/icon-256.png +0 -0
- package/assets/readme/review-and-publish.png +0 -0
- package/assets/readme/teamwork-panel.png +0 -0
- package/assets/readme/versions-and-backups.png +0 -0
- package/docs/README.md +7 -0
- package/docs/development.md +165 -0
- package/docs/en/guide.md +168 -0
- package/docs/zh-CN/guide.md +100 -0
- package/lib/local-share.js +3 -1
- package/lib/local-share.js.map +1 -1
- package/lib/npm-command.js +20 -0
- package/lib/npm-command.js.map +1 -0
- package/lib/types/local-share.d.ts.map +1 -1
- package/lib/types/npm-command.d.ts +6 -0
- package/lib/types/npm-command.d.ts.map +1 -0
- package/package.json +32 -4
- package/screenshots.json +5 -0
package/README.md
CHANGED
|
@@ -1,262 +1,127 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center"><img src="https://raw.githubusercontent.com/dsh-teamwork/dsh-teamwork/main/assets/readme/icon-256.png" width="72" height="72" alt="DSH Teamwork"></p>
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# DSH Teamwork
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
English · [简体中文](README.zh-CN.md)
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
pnpm test
|
|
11
|
-
pnpm typecheck
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
插件包含可发布的 `lib` 输出;修改源码后应重新构建。`pnpm build` 同时编译宿主端(`src/` → `lib/`)和浏览器端(`src/web/` → `lib/web/client.js`)。
|
|
15
|
-
|
|
16
|
-
仓库是 pnpm workspace:`ui/` 是共用组件库 `@dsh-teamwork/ui`,供本插件的面板使用,将来给 web 端和其他 DSH 插件共用,之后拆到独立仓库 `dsh-teamwork/dsh-teamwork-ui`。它的约定见 [`ui/README.md`](ui/README.md)。
|
|
17
|
-
|
|
18
|
-
## 接入 DSH
|
|
19
|
-
|
|
20
|
-
安装插件后,默认连接官方服务 `https://www.dshteamwork.com`,不用任何配置。自建团队可以在 Teamwork 面板的登录页更改服务器地址(例如本地开发的 `http://localhost:3800`),选择保存在配置缓存旁的 `<缓存名>.server.json`;也可以在 profile 的 `dsh-teamwork` 条目里改默认值:
|
|
21
|
-
|
|
22
|
-
```yaml
|
|
23
|
-
- id: dsh-teamwork
|
|
24
|
-
config:
|
|
25
|
-
apiEndpoint: https://teamwork.example.com # 默认 https://www.dshteamwork.com
|
|
26
|
-
cachePath: /absolute/path/to/private/teamwork-cache.json
|
|
27
|
-
autoSync: true
|
|
28
|
-
syncIntervalMs: 60000
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
**手机接入(托管服务)**:登录后,插件会向服务器询问 `GET /api/relay`。服务器提供中转时,插件主动连出一条 WebSocket,并用登录得到的令牌表明身份。服务器那边会把这台电脑登记为你的主机,面板顶部显示“手机可连接”。DSH Teamwork App 之后就能经由这条连接操作这台电脑上的 DSH。自建的社区版服务器不提供中转,插件也就不会连出。这台电脑的标识保存在缓存旁的 `<缓存名>.host.json`;退出登录会断开连接。
|
|
32
|
-
|
|
33
|
-
**手机能做什么**:只有在这台电脑上确认过的配对,才能把手机的请求转进来。插件逐条按白名单检查,再以这部手机专属的身份在本机调用 DSH。白名单只包括:查看会话列表、新建会话、发送消息、跟随输出、取消、切换模型、回答 Agent 的提问和审批。名单之外的请求不会到达 DSH。只开终端、没有启动 DSH web 或桌面端时,手机请求一律返回 503。解除配对后,这部手机会立刻断开。Agent 提问或需要审批时,插件会告诉服务器是哪个会话在等,服务器再通知这台电脑上没打开 App 的已配对手机;通知只写是哪台电脑在等,不包含问题内容。
|
|
34
|
-
|
|
35
|
-
包的 `cordis.patch.yml` 使用 `insert` 声明新条目。手动 `--patch` 加载时也需使用 insert,并将 name 指向本仓库 `lib/index.js` 的绝对路径。
|
|
36
|
-
|
|
37
|
-
## 侧栏面板
|
|
38
|
-
|
|
39
|
-
DSH web 和桌面端的左侧栏有 Teamwork 入口,打开后是主区域的 Teamwork 面板:
|
|
40
|
-
|
|
41
|
-
- 未登录:点“在浏览器中登录”,在网页上确认授权,面板随即自动完成登录。插件在本机 `127.0.0.1` 的一个临时端口上等授权码,最多等十分钟,兑换成功后立即关闭;浏览器和 DSH 不在同一台机器时,把网页上显示的那一行粘贴到面板里。页面底部显示当前服务器,可以改成自建或本地地址,或恢复默认;服务器只接受 https,本机地址可以用 http。更改服务器会退出当前登录并清除旧服务器的团队配置。
|
|
42
|
-
- 顶栏:图标右侧为“我的团队 > 当前团队”,手机连接、我的账号在右。Teamwork 名称、服务器、本机信息、同步状态和刷新位于底部贴边的状态栏,内容单独滚动。手机连接独立于团队资源;配对授权整台 DSH 可访问的会话,目前不能只授权某个团队。
|
|
43
|
-
- 团队资源:使用顶栏的自定义下拉框切换团队,预设、模型和插件均标注所属团队。多团队首次登录先选择浏览范围,之后按服务器与账号记住选择;筛选不会改变已有会话或手机授权。发布配置和管理成员仍在网页完成。
|
|
44
|
-
- 我的账号:显示名称、邮箱与账号语言,通过宿主接口读取和保存个人资料。可更换服务器或确认退出;令牌不会发给浏览器,重启 DSH 仍需重新授权。
|
|
45
|
-
- 个人资料的未保存草稿会在切换页面时保留,可撤销修改;保存失败保留输入并提供重试。手机操作期间阻止重复提交,解除配对失败保留确认;配对码过期可重新生成,“收起配对码”仅隐藏展示,不会提前使服务器上的码失效。
|
|
46
|
-
- 预设:每个预设的模型、就绪状态(必需工具、依赖插件),"用于当前会话"(仅限尚未开始对话的会话)和"新建会话"。
|
|
47
|
-
- 团队模型:用于当前会话,只改本会话,不改本地默认设置。
|
|
48
|
-
- 团队插件:固定版本的状态;安装前在面板里确认,确认绑定当时的精确版本。
|
|
49
|
-
|
|
50
|
-
面板通过宿主端的 `/api/teamwork/*` 路由(`src/panel.ts`)工作,与 `/teamwork` 命令调用同一组函数;平台令牌只留在宿主进程里,不会发到浏览器。DSH 只允许本机所有者访问这些路由。会话恢复相关的子命令(`session`、`continue`、`cancel`、`retry`)只保留为命令。
|
|
51
|
-
|
|
52
|
-
面板读取的是宿主已同步的配置,每次状态请求只扫描一次本机插件清单,供所有预设复用;没有插件依赖或团队插件时不扫描。清单不跨请求缓存,下一次刷新会重新检查插件状态。状态轮询在上一次请求结束后再计时,刷新失败保留已有内容。
|
|
7
|
+
[](https://www.npmjs.com/package/@dsh-teamwork/dsh-teamwork)
|
|
8
|
+
[](https://github.com/dsh-teamwork/dsh-teamwork/actions/workflows/ci.yml)
|
|
9
|
+
[](LICENSE)
|
|
53
10
|
|
|
54
|
-
|
|
11
|
+
**Shared models, agent presets, and approved plugins for your team's DSH workspace.**
|
|
55
12
|
|
|
56
|
-
|
|
13
|
+
Connect [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) to
|
|
14
|
+
[DSH Teamwork](https://www.dshteamwork.com), or your team's self-hosted server.
|
|
15
|
+
A team publishes its configuration once; members sync it into their own DSH.
|
|
16
|
+
The team assistant helps with sharing, usage and administration in conversation.
|
|
57
17
|
|
|
58
|
-
|
|
59
|
-
- `/teamwork authorize <code>`:自动交回没有成功时,手动兑换两分钟有效的授权码;直接粘贴网页上显示的整行也可以。
|
|
60
|
-
- `/teamwork status`:查看登录状态、自动同步开关、团队配置数量、最近同步成功时间和错误。
|
|
61
|
-
- `/teamwork sync`:拉取团队模型、预设和插件目录。
|
|
62
|
-
- `/teamwork list`:查看配置 ID。
|
|
63
|
-
- `/teamwork info [id]`:查看当前会话或指定预设的说明、版本、来源、提示词和工具状态。
|
|
64
|
-
- `/teamwork new <id>`:用最新团队预设创建新会话,在 DSH 会话列表打开;不复制旧历史、不启动任务。
|
|
65
|
-
- `/teamwork use <id>`:选择本会话使用的团队模型/预设,不修改本地默认模型。
|
|
66
|
-
- `/teamwork install <id>`:查看固定版本插件的安装确认说明。
|
|
67
|
-
- `/teamwork install <id> confirm`:通过 DSH 插件管理器先下载为禁用状态,检查配置覆盖和条目冲突后再启用。已有本地插件不会被覆盖或升级;有冲突的新包保持禁用,供用户在本地插件管理器中检查。
|
|
68
|
-
- `/teamwork logout`:在本地丢弃插件令牌,并移除团队缓存和注册。平台令牌无法在服务端撤销,但被移出团队的成员在下一次请求时即被拒绝。
|
|
18
|
+

|
|
69
19
|
|
|
70
|
-
|
|
20
|
+
The plugin panel currently uses Simplified Chinese. The web console supports
|
|
21
|
+
English and Simplified Chinese. Screenshots use a local demonstration team.
|
|
71
22
|
|
|
72
|
-
|
|
23
|
+
## What you can do
|
|
73
24
|
|
|
74
|
-
|
|
25
|
+
| Capability | What it gives your team |
|
|
26
|
+
| --- | --- |
|
|
27
|
+
| Shared models and presets | Sync team resources and create sessions from native DSH agent presets. |
|
|
28
|
+
| Team assistant | Ask about configuration, personal usage and applicable budgets; administrators get their authorized management operations. |
|
|
29
|
+
| Reviewed sharing | Prepare local plugin packages and submit new or updated plugins/presets for administrator review. |
|
|
30
|
+
| Version history | Inspect publications, export resource backups and prepare a reviewed restoration. |
|
|
31
|
+
| Team governance | Administrators manage configuration, budgets and approval through the connected service. |
|
|
32
|
+
| Paired mobile access | With the hosted relay and a matching Teamwork App, pair your phone to your online DSH computer. |
|
|
75
33
|
|
|
76
|
-
|
|
34
|
+
Sharing and review happen inside the selected team. A publication becomes
|
|
35
|
+
available to its members; it does not install code on their computers.
|
|
77
36
|
|
|
78
|
-
##
|
|
37
|
+
## Install
|
|
79
38
|
|
|
80
|
-
|
|
39
|
+
**DSH Desktop:** open **Plugins → Add plugin** in the application, enter the
|
|
40
|
+
package name below, install it and enable it. Follow any restart prompt.
|
|
81
41
|
|
|
82
|
-
|
|
42
|
+
```text
|
|
43
|
+
@dsh-teamwork/dsh-teamwork
|
|
44
|
+
```
|
|
83
45
|
|
|
46
|
+
Desktop manages its own profile. Use its plugin manager for installation and
|
|
47
|
+
updates; a CLI installation into `web` belongs to a different profile.
|
|
84
48
|
|
|
85
|
-
|
|
49
|
+
**DSH CLI / Web:** install into the profile you actually run:
|
|
86
50
|
|
|
87
51
|
```sh
|
|
88
|
-
|
|
89
|
-
|
|
52
|
+
dsh plugin --profile web add @dsh-teamwork/dsh-teamwork
|
|
53
|
+
dsh web
|
|
90
54
|
```
|
|
91
55
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
测试启动独立临时 profile 和本地 npm registry,创建并打包两个固定版本 fixture,提供 SHA-512 integrity,经真实 DSH 包管理器下载和加载。测试不会发布包,也不修改现有 DSH profile。成功后清理临时目录;失败时报告诊断目录。宿主日志可能含本地浏览器令牌,请勿公开上传完整日志。
|
|
95
|
-
|
|
96
|
-
安装确认绑定当前会话和包的精确版本;配置改变后必须重新查看安装说明。浏览器登录(Google 或邮件验证码)和授权仍由 platform 仓库提供。包声明 `dsh.bundle`(宿主端插件和原生命令)和 `dsh.client`(浏览器端面板,`exports["./client"]` 指向 `lib/web/client.js`)。
|
|
97
|
-
|
|
98
|
-
测试为隔离的临时 DSH profile 设置 `npm_config_ignore_workspace_root_check=true`,允许 pnpm 9 在该 profile 的 workspace 根目录安装受控包。
|
|
99
|
-
|
|
100
|
-
## 自动配置同步
|
|
101
|
-
|
|
102
|
-
默认授权完成后立即同步,并每 60 秒自动刷新团队配置;`autoSync: false` 可关闭这两个自动行为,仍可手动 `/teamwork sync`。`syncIntervalMs` 必须是 10000–86400000 之间的整数毫秒数。每次定时请求结束后才安排下一次,手动与自动请求合并,避免慢网络下堆积请求。
|
|
103
|
-
|
|
104
|
-
网络或响应格式错误保留已有配置,下次定时重试;401/403 清除团队缓存、注册与内存登录状态,暂停自动请求,需重新登录。重启恢复的缓存不代表已登录,`/teamwork status` 会明确区分。自动同步仅更新配置目录,不自动安装插件,不上传会话。插件卸载时停止定时器,等待当前同步结束后释放团队注册。
|
|
105
|
-
|
|
106
|
-
## Platform 模型网关
|
|
107
|
-
|
|
108
|
-
团队模型和预设统一选择 `teamwork-platform` provider,wire model 为团队配置 ID。插件把 DSH 的文本、工具调用和流式输出转换为 OpenAI Chat Completions 请求,发送到当前服务器的 `/api/llm/chat/completions`。认证使用内存中的 platform 插件会话令牌,不读取本地供应商密钥,也不提供供应商直连降级。
|
|
109
|
-
|
|
110
|
-
供应商地址和真实 API Key 仅配置在 platform 部署环境。缓存只保存配置描述;未登录时,即使有缓存也无法推理。当前适配器先支持文本和工具调用,模型目录读取团队配置中的 `contextWindow` 和 `maxTokens`。只有缺失字段才使用 32K 上下文、4096 输出的兼容值(确保输出不超过上下文)。管理员可在 platform 查询供应商模型列表并补充未提供的能力值;多模态和其他供应商协议后续补齐。
|
|
111
|
-
|
|
112
|
-
按已确认的产品边界,现有本地模型继续独立使用;teamwork 管理的模型和预设全部经 platform,不修改本地模型配置或凭据。
|
|
113
|
-
|
|
114
|
-
## Agent Preset
|
|
115
|
-
|
|
116
|
-
团队预设复用 DSH 原生 `agentPresets` 注册、挂载、选择及 revision 生命周期。管理员在 platform 配置简介、使用说明、输出要求、团队模型引用、增量提示词以及必需/可选工具名称。说明字段供用户阅读;需要模型执行的要求写入 `systemPrompt`。新预设引用同团队 `kind=model` 的配置 ID,旧版内嵌 provider/model 配置继续兼容,不允许两种方式混用。引用模型删除后,客户端不降级到本地模型,网关也拒绝该请求。
|
|
117
|
-
|
|
118
|
-
- `/teamwork info` 显示实际挂载版本;`/teamwork info <id>` 预览最新目录配置,工具检查基于当前会话。
|
|
119
|
-
- 工具按 DSH 注册名称检查,区分已注册、条件可用、缺失、无法检查。工具已注册不意味着已获得执行授权,运行时仍由宿主处理权限与条件。
|
|
120
|
-
- 必需工具缺失/无法检查时,`/teamwork use` 拒绝选择;通过其他原生入口选择的预设,也在每次模型请求前重新检查。可选工具缺失只展示提示。
|
|
121
|
-
- DSH 只允许空白会话切换预设。开始第一轮后或执行中,使用 `/teamwork new <id>` 创建新会话;不在原会话静默改提示词、不清空历史。
|
|
122
|
-
- 同步更新后,已有 Agent 保留 DSH 原生旧 revision,`/teamwork info` 展示新版本;空白会话再次 `/teamwork use` 可更新。
|
|
123
|
-
- 每个会话开始时的团队/预设/版本记录在配置缓存旁的 `<缓存名>.sessions.json`(0600,原子替换),不写进会话日志:DSH 拒绝重新打开日志里含有它不认识的事件类型的会话,而第三方插件写不了它接受的可忽略记录。宿主恢复会话时若重新挂载的版本与记录不一致,阻止继续推理并提示新建会话;当前不保存历史预设定义,不承诺跨重启恢复已删除的旧 revision。没有记录的会话(包括分叉出的新会话)从首次请求开始记录。
|
|
124
|
-
- 预设版本固定不冻结服务端策略:成员权限、模型路由和输出限制仍采用 platform 当前配置。
|
|
125
|
-
|
|
126
|
-
本地定向宿主检查:`DSH_CLI=/path/to/dsh/lib/bin.js pnpm test:presets`,不调用真实模型,不安装测试插件。
|
|
127
|
-
|
|
128
|
-
## 工具清单与插件依赖
|
|
56
|
+
For an existing web process, follow the host's reload/restart instructions.
|
|
57
|
+
Replace `web` with your custom profile name where appropriate.
|
|
129
58
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
-
|
|
134
|
-
|
|
135
|
-
- `/teamwork install` 仍需先查看说明再确认。已有插件的启用、升级和错误诊断交给 DSH 本地插件管理器,团队操作不覆盖它们。安装后刷新插件状态和当前预设必需工具;重启提示不会被误报为已就绪。
|
|
59
|
+
| Requirement | Support |
|
|
60
|
+
| --- | --- |
|
|
61
|
+
| Declared DSH range | `>=0.2.2-rc.1 <0.3.0-0` |
|
|
62
|
+
| CI host versions | `0.2.2-rc.1`, `0.2.2-rc.2`, `0.2.2-rc.3` |
|
|
63
|
+
| Node.js | Follow your DSH runtime's requirement; the current RC line requires Node.js 24.9+. Desktop supplies its runtime. |
|
|
136
64
|
|
|
137
|
-
|
|
65
|
+
CI uses Linux and pnpm 9.15.9. Other host and package-manager combinations
|
|
66
|
+
follow their own build-script and installation policies. See
|
|
67
|
+
[installation troubleshooting](docs/en/guide.md#installation-and-updates).
|
|
138
68
|
|
|
139
|
-
|
|
140
|
-
- `/teamwork continue <后续指令>`:在空闲且无待处理输入时,检查模型、权限、预设版本、插件和工具,然后使用 DSH `followup` 发送新的用户消息。原有本地模型不要求 platform 登录。恢复已有会话沿用 DSH 原生入口,不覆盖其保存的模型选择。
|
|
141
|
-
- `/teamwork cancel`:调用 DSH `cancel({kind:'user'}, {keepInbox:true})`,请求取消当前执行,保留待处理输入。取消是请求,不承诺同步停止;用概览确认状态。文件修改不会回滚,历史不会删除。
|
|
142
|
-
- `/teamwork retry`:仅为失败、被阻止、取消、输出截断或意外中断的任务提供确认说明;`/teamwork retry confirm` 在两分钟内提交一次恢复指令,要求先检查已有结果再继续。不是重放工具调用,也不是完全复现原请求;仍可能产生新操作,需要用户明确确认。
|
|
69
|
+
## Start with your team
|
|
143
70
|
|
|
144
|
-
|
|
71
|
+
1. Open **Teamwork** in the DSH sidebar and choose the browser sign-in action.
|
|
72
|
+
2. Sign in to the service and authorize this DSH. Use the displayed fallback
|
|
73
|
+
authorization line if the loopback callback cannot complete.
|
|
74
|
+
3. Select a team and refresh its resources. Create or join a team in the web
|
|
75
|
+
console if you have no membership yet.
|
|
76
|
+
4. Select the team's assistant preset and create a new session. New teams receive
|
|
77
|
+
an assistant named after the team; existing teams are not automatically changed.
|
|
145
78
|
|
|
146
|
-
|
|
79
|
+
Try asking:
|
|
147
80
|
|
|
148
|
-
|
|
81
|
+
> Sync my team's configuration and show my usage for this month.
|
|
149
82
|
|
|
150
|
-
|
|
83
|
+
The assistant may inherit your session's local model. It needs a working model
|
|
84
|
+
to act; inheriting a model does not configure a team gateway route.
|
|
151
85
|
|
|
152
|
-
|
|
153
|
-
2. 在 `main` 的那个提交上打 `v<version>` 并推送。`.github/workflows/publish.yaml` 分两步:`package` 不带 OIDC 权限,检查 tag 指向 `main` 的历史、和版本号一致、提交的 `lib/` 与源码构建一致,再测试并打包;`stage` 在受保护的 `npm-release` 环境里,核对拿到的正是打出来的那个包(SHA-256),关掉生命周期脚本后执行 `npm stage publish`。
|
|
154
|
-
3. 维护者用 `npm stage list` 找到这次暂存,再用 `npm stage approve <stage-id>`(需要 2FA)正式发布。
|
|
86
|
+
## Members and administrators
|
|
155
87
|
|
|
156
|
-
|
|
88
|
+
| Member | Team administrator |
|
|
89
|
+
| --- | --- |
|
|
90
|
+
| Read shared resources and personal usage; inspect applicable budgets. | Read authorized team usage and manage team/member/provider budgets. |
|
|
91
|
+
| Submit presets and local plugin packages, including updates. | Review frozen submissions and publish or reject them. |
|
|
92
|
+
| Use published presets and explicitly install approved plugins. | Manage team configuration and prepare historical restorations. |
|
|
157
93
|
|
|
158
|
-
|
|
94
|
+
Mutations use DSH's real approval flow and the server rechecks permissions.
|
|
95
|
+
Enter provider keys and account passwords through the console's secure forms.
|
|
96
|
+
The [user guide](docs/en/guide.md) covers commands, configuration, phone access
|
|
97
|
+
and the distinction between submitted, published, synced and installed.
|
|
159
98
|
|
|
160
|
-
|
|
99
|
+

|
|
161
100
|
|
|
162
|
-
##
|
|
101
|
+
## Service and data
|
|
163
102
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
as local actions, returning a bounded `teamwork/` error code on refusal.
|
|
103
|
+
- The default service is `https://www.dshteamwork.com`. Change it on the
|
|
104
|
+
Teamwork sign-in screen to use a [self-hosted community server](https://github.com/dsh-teamwork/dsh-teamwork-platform).
|
|
105
|
+
- Team-model requests go through your chosen server. Provider keys stay on
|
|
106
|
+
that server; prompts and model context pass through its model gateway.
|
|
107
|
+
- Plugin sign-in tokens stay in host memory. Restarting DSH requires signing
|
|
108
|
+
in again. Configuration caches do not authenticate a session.
|
|
109
|
+
- The hosted phone relay requires the matching App and an online web/desktop
|
|
110
|
+
host. The community server does not provide that relay. Pairing grants
|
|
111
|
+
access to the owner's permitted DSH sessions across teams.
|
|
174
112
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
pairing confirmation states this scope explicitly.
|
|
113
|
+
[Data, phone pairing and recovery details](docs/en/guide.md#data-and-phone-access)
|
|
114
|
+
explain which information is local, which reaches your server, and what the
|
|
115
|
+
paired channel protects.
|
|
179
116
|
|
|
180
|
-
##
|
|
117
|
+
## Help and development
|
|
181
118
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
also pins the desktop public key. Later connections use fresh handshakes and
|
|
187
|
-
saved keys. Missing or changed keys require pairing again, with no plaintext
|
|
188
|
-
fallback. Existing plaintext pairings must be replaced.
|
|
119
|
+
- [User guide](docs/en/guide.md) · [中文使用指南](docs/zh-CN/guide.md)
|
|
120
|
+
- [Developer reference](docs/development.md) — build, host checks, runtime behavior and publishing.
|
|
121
|
+
- [Report an issue](https://github.com/dsh-teamwork/dsh-teamwork/issues) — include DSH/plugin versions, platform, profile type and a redacted error.
|
|
122
|
+
- [Teamwork service](https://www.dshteamwork.com) · [Community server](https://github.com/dsh-teamwork/dsh-teamwork-platform)
|
|
189
123
|
|
|
190
|
-
|
|
191
|
-
key inside Noise. Messages and uploads then bypass Noise and use native
|
|
192
|
-
AES-256-GCM: Node/OpenSSL on desktop and Expo Crypto on mobile. Each opaque
|
|
193
|
-
`data` record authenticates its channel, sending direction and monotonic counter;
|
|
194
|
-
replay, reordering, cipher failure or exhausted key budgets close the channel.
|
|
195
|
-
The small Noise handshake remains JS; application payloads have no JS cipher
|
|
196
|
-
fallback. Upgrade relay and both clients together. Saved verified device keys
|
|
197
|
-
remain valid across this transport change.
|
|
124
|
+
## License
|
|
198
125
|
|
|
199
|
-
|
|
200
|
-
by
|
|
201
|
-
locally saved device roster. The identity seed and account/server-scoped peers
|
|
202
|
-
are atomically saved in `<cache>.phone-keys.json` with restrictive permissions.
|
|
203
|
-
Desktop revocation closes the channel and saves trust removal before calling
|
|
204
|
-
the relay. Phone revocation requires an encrypted desktop acknowledgement; an
|
|
205
|
-
offline desktop must reconnect before it completes.
|
|
206
|
-
|
|
207
|
-
The relay can see public keys, account/device metadata, timing and sizes, but
|
|
208
|
-
cannot read encrypted methods, conversation content, tool data or uploads.
|
|
209
|
-
Generic notifications omit session ids and question types. Local DSH storage
|
|
210
|
-
and the hosted team-model gateway remain separate boundaries: model context
|
|
211
|
-
still passes through that gateway. Update relay, plugin and mobile together.
|
|
212
|
-
|
|
213
|
-
## Phone file attachments
|
|
214
|
-
|
|
215
|
-
Phones query upload limits through `teamwork/configuration`, then use four
|
|
216
|
-
allow-listed calls: `teamwork/uploadStart`, `teamwork/uploadChunk`,
|
|
217
|
-
`teamwork/uploadFinish` and `teamwork/uploadCancel`. Intake passes native
|
|
218
|
-
session admission. Files can be staged while the agent is busy or the model
|
|
219
|
-
is unavailable; readiness is enforced on a new prompt, not on file transfer.
|
|
220
|
-
Phones transfer selected files immediately and submit completed receipts only
|
|
221
|
-
when the member presses Send. Transfer ids and completed receipts are bound to
|
|
222
|
-
the pairing and exact session, and chunks stream with backpressure
|
|
223
|
-
to DSH's authenticated binary upload service. The relay envelope is unchanged.
|
|
224
|
-
|
|
225
|
-
The initial budgets are five files per message, 20 MiB per file, 50 MiB total,
|
|
226
|
-
256 KiB raw chunks, one active transfer per pairing and two per host. Transfers
|
|
227
|
-
expire after 60 seconds idle or five minutes total; completed plugin receipts
|
|
228
|
-
expire after ten minutes. Detach, revocation and cancellation release transfer
|
|
229
|
-
state. The plugin does not delete DSH's stored objects or workspace files.
|
|
230
|
-
|
|
231
|
-
Prompts use native file receipts and stable request ids. An already-accepted
|
|
232
|
-
request may reach native deduplication before the busy/readiness check; new
|
|
233
|
-
work still passes all checks and validates its receipt metadata. This slice
|
|
234
|
-
supports ordinary files, not image input or document extraction. Update the
|
|
235
|
-
mobile app and plugin together. Build output under `lib/` is included.
|
|
236
|
-
|
|
237
|
-
预算由所选团队的服务端计算,插件底栏异步显示当前成员的积分剩余、Token 限额或待核实状态。切换资源团队不会改变正在使用的会话模型;模型和上游的其他限制仍由网关在请求时检查。读取失败显示“预算暂不可用”,不影响配置列表和同步。
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
## Team assistant and reviewed sharing
|
|
241
|
-
|
|
242
|
-
New teams receive a built-in assistant that can inherit a local/session model.
|
|
243
|
-
The assistant's tools bind operations to its active team, reuse server permissions,
|
|
244
|
-
and require real host approval for mutations. They cover sync, configuration,
|
|
245
|
-
usage/budgets, preset submissions, local plugin preparation/upload, review and
|
|
246
|
-
historical restoration. Provider keys and account passwords use secure console forms.
|
|
247
|
-
|
|
248
|
-
Members can submit new or updated presets/plugins on the platform's sharing page;
|
|
249
|
-
administrators approve frozen revisions. Publication does not install a plugin.
|
|
250
|
-
Private archives are downloaded through host authentication, verified by SHA-256,
|
|
251
|
-
and installed disabled before the normal conflict checks and activation. Existing
|
|
252
|
-
local installations remain protected; upgrades use the local plugin manager.
|
|
253
|
-
|
|
254
|
-
Pinned preset dependencies survive catalog updates through historical plugin
|
|
255
|
-
metadata. Use `/teamwork install <configId>@<version>` for an exact retained pin.
|
|
256
|
-
The platform's history page supports comparison, backup export and restoration
|
|
257
|
-
as a new reviewed publication. Existing conversations retain their preset version.
|
|
258
|
-
|
|
259
|
-
Run `pnpm test:assistant` with `DSH_CLI` set as in the host-test instructions.
|
|
260
|
-
It verifies model inheritance, team-bound tools, denied approval, authenticated
|
|
261
|
-
archive download and real local-archive installation. Host tests isolate their
|
|
262
|
-
package stores so an earlier fixture cannot satisfy the download check.
|
|
126
|
+
[Apache License 2.0](LICENSE). The DSH Teamwork name and whale mark are covered
|
|
127
|
+
by [NOTICE](NOTICE); a fork uses its own branding.
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
<p align="center"><img src="https://raw.githubusercontent.com/dsh-teamwork/dsh-teamwork/main/assets/readme/icon-256.png" width="72" height="72" alt="DSH Teamwork"></p>
|
|
2
|
+
|
|
3
|
+
# DSH Teamwork
|
|
4
|
+
|
|
5
|
+
[English](README.md) · 简体中文
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/@dsh-teamwork/dsh-teamwork)
|
|
8
|
+
[](https://github.com/dsh-teamwork/dsh-teamwork/actions/workflows/ci.yml)
|
|
9
|
+
[](LICENSE)
|
|
10
|
+
|
|
11
|
+
**把团队共享模型、预设和审批后的插件带入 DSH,通过团队助理完成日常协作与管理。**
|
|
12
|
+
|
|
13
|
+
将 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 连接到
|
|
14
|
+
[DSH Teamwork](https://www.dshteamwork.com) 或团队自建服务器。团队配置发布一次,成员同步到各自的 DSH;团队助理可在对话中协助分享资源、查看使用量和管理团队。
|
|
15
|
+
|
|
16
|
+

|
|
17
|
+
|
|
18
|
+
插件面板目前使用简体中文;网页控制台支持英文和简体中文。截图均来自本地演示团队。
|
|
19
|
+
|
|
20
|
+
## 可以做什么
|
|
21
|
+
|
|
22
|
+
| 能力 | 为团队带来的功能 |
|
|
23
|
+
| --- | --- |
|
|
24
|
+
| 共享模型与预设 | 同步团队资源,使用 DSH 原生智能体预设创建会话。 |
|
|
25
|
+
| 团队助理 | 查询配置、个人使用量和适用预算;管理员可执行获授权的团队管理操作。 |
|
|
26
|
+
| 分享与审批 | 准备本地插件包,提交新插件、预设及更新,交由管理员审批。 |
|
|
27
|
+
| 版本历史 | 查看发布记录、导出资源备份,准备经审批的历史恢复。 |
|
|
28
|
+
| 团队治理 | 通过连接的团队服务管理配置、预算和审批。 |
|
|
29
|
+
| 手机连接 | 配合托管服务中转和匹配的 Teamwork App,将手机在线配对到正在运行的 DSH 电脑。 |
|
|
30
|
+
|
|
31
|
+
资源在所选团队内部分享。发布后团队成员可以使用;发布不会自动在成员电脑上安装代码。
|
|
32
|
+
|
|
33
|
+
## 安装
|
|
34
|
+
|
|
35
|
+
**DSH 桌面版:**在应用中打开 **Plugins → Add plugin(插件 → 添加插件)**,输入以下包名,安装并启用。若提示重启,按提示操作。
|
|
36
|
+
|
|
37
|
+
```text
|
|
38
|
+
@dsh-teamwork/dsh-teamwork
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
桌面版由应用管理自己的 profile。安装和更新都从应用内操作;CLI 中的 `web` 属于另一个 profile。
|
|
42
|
+
|
|
43
|
+
**DSH CLI/网页版:**安装到实际使用的 profile:
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
dsh plugin --profile web add @dsh-teamwork/dsh-teamwork
|
|
47
|
+
dsh web
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
如果 web 进程已经启动,遵循宿主的重新加载/重启提示。使用自定义 profile 时,将 `web` 换成对应名称。
|
|
51
|
+
|
|
52
|
+
| 要求 | 支持范围 |
|
|
53
|
+
| --- | --- |
|
|
54
|
+
| 声明的 DSH 兼容范围 | `>=0.2.2-rc.1 <0.3.0-0` |
|
|
55
|
+
| CI 宿主版本 | `0.2.2-rc.1`、`0.2.2-rc.2`、`0.2.2-rc.3` |
|
|
56
|
+
| Node.js | 以 DSH 宿主要求为准;当前 RC 系列要求 Node.js 24.9+。桌面版提供自己的运行时。 |
|
|
57
|
+
|
|
58
|
+
CI 使用 Linux 和 pnpm 9.15.9。其他宿主、包管理器组合仍遵循各自的构建脚本及安装策略,详见[安装与更新排查](docs/zh-CN/guide.md#安装与更新)。
|
|
59
|
+
|
|
60
|
+
## 开始使用
|
|
61
|
+
|
|
62
|
+
1. 在 DSH 侧栏打开 **Teamwork**,选择“在浏览器中登录”。
|
|
63
|
+
2. 在团队服务中登录并授权这台 DSH。若本机回传未完成,粘贴网页显示的备用授权行。
|
|
64
|
+
3. 选择团队并刷新资源。如果还没有团队成员身份,先在网页控制台创建或加入团队。
|
|
65
|
+
4. 选择团队助理预设并新建会话。新团队会获得以团队名命名的助理;已有团队不会被自动补建。
|
|
66
|
+
|
|
67
|
+
可以先问:
|
|
68
|
+
|
|
69
|
+
> 同步团队配置,并查看我本月的使用量。
|
|
70
|
+
|
|
71
|
+
助理可以继承当前会话的本地模型。它需要一个可用模型才能执行任务;继承模型不等于建立团队模型网关路由。
|
|
72
|
+
|
|
73
|
+
## 成员与管理员
|
|
74
|
+
|
|
75
|
+
| 成员 | 团队管理员 |
|
|
76
|
+
| --- | --- |
|
|
77
|
+
| 查看共享资源、自己的使用量及适用预算。 | 查看获授权的团队使用量,管理团队、成员和供应商预算。 |
|
|
78
|
+
| 提交预设和本地插件包,包括更新。 | 审核冻结后的提交内容,发布或拒绝。 |
|
|
79
|
+
| 使用已发布预设,明确确认后安装插件。 | 管理团队配置,准备历史版本恢复。 |
|
|
80
|
+
|
|
81
|
+
修改操作使用 DSH 的真实审批流程,服务端会重新检查权限。供应商密钥和账号密码通过网页安全表单输入。
|
|
82
|
+
[使用指南](docs/zh-CN/guide.md)说明了命令、配置、手机连接,以及“已提交、已发布、已同步、已安装”的区别。
|
|
83
|
+
|
|
84
|
+

|
|
85
|
+
|
|
86
|
+
## 服务与数据
|
|
87
|
+
|
|
88
|
+
- 默认连接 `https://www.dshteamwork.com`。可在 Teamwork 登录页切换到[自建社区版服务器](https://github.com/dsh-teamwork/dsh-teamwork-platform)。
|
|
89
|
+
- 团队模型请求经过所选服务器。供应商密钥保留在服务端;提示词和模型上下文经过其模型网关。
|
|
90
|
+
- 插件登录令牌只保留在宿主内存中,重启后需要重新登录。配置缓存不能代替登录。
|
|
91
|
+
- 手机连接需要托管中转、匹配的 App 和在线的 web/桌面宿主;社区版不提供该中转。配对允许访问账号在这台 DSH 上有权限的个人与各团队会话。
|
|
92
|
+
|
|
93
|
+
[数据、手机配对和恢复说明](docs/zh-CN/guide.md#数据与手机连接)列出了本地信息、发往服务器的信息和配对通道的保护范围。
|
|
94
|
+
|
|
95
|
+
## 帮助与开发
|
|
96
|
+
|
|
97
|
+
- [中文使用指南](docs/zh-CN/guide.md) · [English guide](docs/en/guide.md)
|
|
98
|
+
- [开发参考](docs/development.md)(英文):构建、真实宿主检查、运行机制及发布。
|
|
99
|
+
- [提交问题](https://github.com/dsh-teamwork/dsh-teamwork/issues):附上 DSH/插件版本、系统、profile 类型及脱敏错误。
|
|
100
|
+
- [Teamwork 服务](https://www.dshteamwork.com) · [社区版服务器](https://github.com/dsh-teamwork/dsh-teamwork-platform)
|
|
101
|
+
|
|
102
|
+
## 许可证
|
|
103
|
+
|
|
104
|
+
[Apache License 2.0](LICENSE)。DSH Teamwork 名称和鲸鱼标识另受 [NOTICE](NOTICE) 约束,分叉项目应使用自己的品牌。
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/docs/README.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Documentation
|
|
2
|
+
|
|
3
|
+
Start with the [English README](../README.md) or [Chinese README](../README.zh-CN.md).
|
|
4
|
+
|
|
5
|
+
- [User guide](en/guide.md) — setup, commands, sharing, phone access and troubleshooting.
|
|
6
|
+
- [Chinese user guide](zh-CN/guide.md) — the same user workflows in Simplified Chinese.
|
|
7
|
+
- [Developer reference](development.md) — architecture, building, host checks and publishing.
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# Developer reference
|
|
2
|
+
|
|
3
|
+
[User documentation](README.md) covers installation and workflows. This file
|
|
4
|
+
owns build commands, runtime contracts, phone protocols and release operations.
|
|
5
|
+
|
|
6
|
+
## Build and verify
|
|
7
|
+
|
|
8
|
+
Use Node.js compatible with the host and pnpm 9.15.9 from `packageManager`.
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
pnpm install --frozen-lockfile
|
|
12
|
+
pnpm build
|
|
13
|
+
pnpm typecheck
|
|
14
|
+
pnpm test
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
`build` compiles `src/` into committed `lib/`, declarations into `lib/types/`,
|
|
18
|
+
and the browser bundle into `lib/web/client.js`. The browser bundle embeds the
|
|
19
|
+
workspace `@dsh-teamwork/ui` components and takes React from DSH. Its ownership
|
|
20
|
+
rules are in [ui/README.md](../ui/README.md).
|
|
21
|
+
|
|
22
|
+
DSH core services are peer dependencies supplied by the host. Development
|
|
23
|
+
versions are pinned to rc.3 and Zod to 4.6.6 to avoid recursive type expansion
|
|
24
|
+
across mismatched versions. Never add `@deepseek-ai/dsh-*` to runtime dependencies:
|
|
25
|
+
hoisted installations can shadow the upgraded host even when the plugin is disabled.
|
|
26
|
+
|
|
27
|
+
The real-host suites install the packed plugin in temporary profiles and use
|
|
28
|
+
an isolated local fixture registry and package store:
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
npm install --prefix /tmp/dsh-test-runtime --no-package-lock @deepseek-ai/dsh@0.2.2-rc.3
|
|
32
|
+
export DSH_CLI=/tmp/dsh-test-runtime/node_modules/@deepseek-ai/dsh/lib/bin.js
|
|
33
|
+
pnpm test:host
|
|
34
|
+
pnpm test:presets
|
|
35
|
+
pnpm test:assistant
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
CI repeats this on DSH rc.1, rc.2 and rc.3 on Linux. Windows-safe argument
|
|
39
|
+
packing is covered by the archive tests; that is not a Windows Desktop GUI test.
|
|
40
|
+
The fixture profile sets `npm_config_ignore_workspace_root_check=true` for its
|
|
41
|
+
own workspace root. Successful runs clean up; failures retain diagnostics that
|
|
42
|
+
can contain a local browser token. Do not publish raw host logs.
|
|
43
|
+
|
|
44
|
+
## Host and browser boundary
|
|
45
|
+
|
|
46
|
+
The package declares `dsh.bundle.patch` and `dsh.client`, exporting its browser
|
|
47
|
+
entry as `./client`. `cordis.patch.yml` inserts one root entry. A manual development
|
|
48
|
+
patch uses `insert` with an absolute path to `lib/index.js`; normal installations
|
|
49
|
+
load the package's patch automatically and must not duplicate that entry.
|
|
50
|
+
|
|
51
|
+
`src/panel.ts` defines `/api/teamwork/*`. The browser calls these host routes;
|
|
52
|
+
DSH admits only its owner. The platform token remains in the host. Commands and
|
|
53
|
+
panel actions reuse operations. Session continuation/retry/cancellation are commands.
|
|
54
|
+
State polls wait for the previous request, failures preserve the displayed data,
|
|
55
|
+
and dependency inventory is shared only within one state request.
|
|
56
|
+
|
|
57
|
+
The server selection persists beside the cache as `<cache>.server.json`.
|
|
58
|
+
Changing it clears old identity/resources. Tokens are memory-only. Configuration
|
|
59
|
+
caches use private file permissions and atomic replacement. Periodic/manual sync
|
|
60
|
+
requests coalesce; unload stops timers and waits before releasing registrations.
|
|
61
|
+
401/403 clear team resources and suspend automatic sync. Network/schema failures
|
|
62
|
+
retain the previous snapshot. Sync never installs plugins or uploads conversations.
|
|
63
|
+
|
|
64
|
+
## Models and preset generations
|
|
65
|
+
|
|
66
|
+
Team models use `teamwork-platform` with the configuration ID as wire model.
|
|
67
|
+
`src/platform-models.ts` adapts text, tool calls and streamed output to the chosen
|
|
68
|
+
service's `/api/llm/chat/completions`. There is no provider-direct fallback or
|
|
69
|
+
local provider-key lookup. Model capability values come from team configuration;
|
|
70
|
+
missing context/output limits use 32K/4096, with output bounded by context.
|
|
71
|
+
Multimodal input and other provider protocols are not implemented by this adapter.
|
|
72
|
+
|
|
73
|
+
Presets use native `agentPresets` registration, mounting, selection and revisions.
|
|
74
|
+
A preset has one of inherited selection, same-team model reference, or legacy
|
|
75
|
+
explicit provider/model. Human-readable instructions/output notes are not system
|
|
76
|
+
instructions; behavior belongs in `systemPrompt`. Team prompts are additive.
|
|
77
|
+
Required tools and pinned plugin dependencies are checked when selecting and
|
|
78
|
+
before team inference; optional tools warn. Tool registration is not permission.
|
|
79
|
+
Package-to-tool ownership is declared by the team, not inferred from DSH.
|
|
80
|
+
|
|
81
|
+
Started sessions keep their native generation. `<cache>.sessions.json` privately
|
|
82
|
+
records team/preset/version stamps instead of adding unknown events to DSH logs.
|
|
83
|
+
A restored session with an incompatible stamp is blocked; historical deleted
|
|
84
|
+
preset definitions are not reconstructed. Unstamped/forked sessions are stamped
|
|
85
|
+
on first inference. A pinned revision does not freeze current server permissions,
|
|
86
|
+
routing or budgets.
|
|
87
|
+
|
|
88
|
+
Task summaries use native session projections. Follow-up/recovery checks model,
|
|
89
|
+
team access, generations and dependencies before admission. Retry confirms a new
|
|
90
|
+
recovery instruction for failed/blocked/cancelled/truncated/interrupted work; it
|
|
91
|
+
never replays tools. Queued/guidance input is not bypassed. Cancellation keeps
|
|
92
|
+
inbox/file changes; concurrent or cancelled preparation cannot dispatch a new turn.
|
|
93
|
+
Errors report bounded categories without upstream response bodies.
|
|
94
|
+
|
|
95
|
+
## Assistant and private resources
|
|
96
|
+
|
|
97
|
+
Tools bind to the active preset's team and current account epoch. DSH's actual
|
|
98
|
+
approval pipeline gates mutations, even in permissive sessions. Review reads
|
|
99
|
+
frozen server contents and checks revisions. Provider secrets and initial account
|
|
100
|
+
passwords use the console's forms. Server membership/role checks remain authoritative.
|
|
101
|
+
|
|
102
|
+
Local packages are prepared without lifecycle scripts and inspected before upload.
|
|
103
|
+
After review, private downloads authenticate to the service, verify SHA-256 and
|
|
104
|
+
persist a private content-addressed archive before installing disabled and checking
|
|
105
|
+
conflicts. Exact historical pins remain installable. Existing local plugins use
|
|
106
|
+
the host's separate update flow. See the community server's
|
|
107
|
+
[resource contract](https://github.com/dsh-teamwork/dsh-teamwork-platform/blob/main/docs/tech/team-assistant.md).
|
|
108
|
+
|
|
109
|
+
## Phone transport
|
|
110
|
+
|
|
111
|
+
The hosted relay is optional and discovered through `GET /api/relay`. The host
|
|
112
|
+
connects out over WebSocket using its in-memory token and `<cache>.host.json`
|
|
113
|
+
identity. Logout disconnects it. Only confirmed pairings can reach allowlisted
|
|
114
|
+
DSH calls. Headless-only hosts return 503. Pairing is account/host-wide, not
|
|
115
|
+
limited by the panel's team filter. Model selection changes a session, not the
|
|
116
|
+
computer's default. Notifications omit conversation/question contents and session IDs.
|
|
117
|
+
|
|
118
|
+
Phone and desktop pin Ed25519 identities and authenticate through libp2p Noise XX.
|
|
119
|
+
A single-use six-letter locator and matching eight-digit safety codes establish
|
|
120
|
+
trust, with phone confirmation and desktop approval. QR links pin the desktop
|
|
121
|
+
public key. Missing/changed keys require new pairing; plaintext has no fallback.
|
|
122
|
+
After Noise authentication, endpoints exchange independent AES-256 sending keys.
|
|
123
|
+
Payloads use native AES-256-GCM (Node/OpenSSL and Expo Crypto), authenticating the
|
|
124
|
+
channel, direction and monotonic counter. Replay, reordering, cipher failure and
|
|
125
|
+
exhausted key budgets close the channel. The relay sees metadata, timing and
|
|
126
|
+
sizes but cannot read encrypted request content. Team gateway model traffic is
|
|
127
|
+
outside this channel. Upgrade relay and both clients together.
|
|
128
|
+
|
|
129
|
+
`src/secure-channel.ts` matches the mobile implementation, checked by integration
|
|
130
|
+
tests. `src/phone-security.ts` gates every request on the local roster.
|
|
131
|
+
`<cache>.phone-keys.json` atomically stores the identity seed and account/server
|
|
132
|
+
peers with restrictive permissions. Desktop revocation saves trust removal and
|
|
133
|
+
closes the channel before notifying the relay; phone revocation needs an encrypted
|
|
134
|
+
acknowledgement and can wait for an offline host.
|
|
135
|
+
|
|
136
|
+
File intake uses `teamwork/uploadStart`, `uploadChunk`, `uploadFinish` and
|
|
137
|
+
`uploadCancel` after native admission. Receipt/transfer identity binds pairing and
|
|
138
|
+
session. Staging works during a busy/unavailable model; prompt readiness is checked
|
|
139
|
+
on send. Budgets: five files, 20 MiB each, 50 MiB total, 256 KiB chunks, one active
|
|
140
|
+
transfer per pairing and two per host. Idle/total expiry is 60 seconds/five minutes;
|
|
141
|
+
completed receipts expire after ten minutes. Cancellation/revocation release
|
|
142
|
+
transfer state, not stored DSH objects or workspace files. Native file receipts and
|
|
143
|
+
stable request IDs support deduplication. Ordinary files are supported; image input
|
|
144
|
+
and document extraction are not implemented in this slice.
|
|
145
|
+
|
|
146
|
+
## Publishing
|
|
147
|
+
|
|
148
|
+
Update `package.json`, build and commit the matching `lib/`, and merge reviewed
|
|
149
|
+
changes to main. A matching `v<version>` tag runs `.github/workflows/publish.yaml`:
|
|
150
|
+
its package job builds, verifies committed output, tests and packs; the protected
|
|
151
|
+
stage job verifies the exact SHA-256 and uses trusted OIDC publishing with lifecycle
|
|
152
|
+
scripts disabled. No npm token is stored in the repository.
|
|
153
|
+
|
|
154
|
+
A maintainer completes npm 2FA approval with `npm stage approve <stage-id>` after
|
|
155
|
+
checking `npm stage list`. A staged package is not public. `PUBLISHING=off` pauses
|
|
156
|
+
staging. The npm Trusted Publisher points at this repository, workflow and
|
|
157
|
+
`npm-release` environment. Run `npm pack --ignore-scripts --dry-run --json` to inspect the file list for
|
|
158
|
+
both READMEs, guides and images.
|
|
159
|
+
|
|
160
|
+
Keep `screenshots.json` to 1–8 relative GitHub-hosted images. Public catalog entries
|
|
161
|
+
belong in Awesome DSH's `data/plugins/<owner>__<repo>.yml`; never edit its generated
|
|
162
|
+
README or add an `npm:` key. dsh.so's existing entry is
|
|
163
|
+
[dsh-teamwork-2](https://www.dsh.so/artifact/dsh-teamwork-2/); update that record
|
|
164
|
+
rather than the unrelated same-name repository. Community verification remains
|
|
165
|
+
the community's own result, not this project's CI status.
|
package/docs/en/guide.md
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# Using DSH Teamwork
|
|
2
|
+
|
|
3
|
+
[README](../../README.md) · [简体中文](../zh-CN/guide.md)
|
|
4
|
+
|
|
5
|
+
Connect a DSH host to your team's service, sync resources, then choose a preset
|
|
6
|
+
for a new conversation. Teamwork resources are additive: local configuration
|
|
7
|
+
and local default models remain independent.
|
|
8
|
+
|
|
9
|
+
## Installation and updates
|
|
10
|
+
|
|
11
|
+
Use the desktop application's **Plugins → Add plugin** for a Desktop profile.
|
|
12
|
+
For a CLI web profile use `dsh plugin --profile web add @dsh-teamwork/dsh-teamwork`.
|
|
13
|
+
Use the same profile's plugin manager for updates, enabling and diagnostics.
|
|
14
|
+
Follow its reload/restart prompts.
|
|
15
|
+
|
|
16
|
+
- **Version rejected:** check the installed plugin and DSH versions. The declared
|
|
17
|
+
range is `>=0.2.2-rc.1 <0.3.0-0`; CI covers rc.1, rc.2 and rc.3. Install a
|
|
18
|
+
compatible published version. A range is a declaration, not a test of every
|
|
19
|
+
future release.
|
|
20
|
+
- **A new release is not selected:** some hosts apply a minimum release age.
|
|
21
|
+
Select an exact version that is already visible on the
|
|
22
|
+
[npm versions page](https://www.npmjs.com/package/@dsh-teamwork/dsh-teamwork?activeTab=versions).
|
|
23
|
+
A version in GitHub's main branch may still await npm publication.
|
|
24
|
+
- **Build scripts await a decision:** pnpm 11 can stop for dependency scripts.
|
|
25
|
+
Use your host's build review. In an isolated Linux CLI check, explicitly
|
|
26
|
+
denying the `@google/genai` and `protobufjs` scripts allowed installation and
|
|
27
|
+
the basic integration checks to pass. This is separate from DSH compatibility.
|
|
28
|
+
- **Installed, but missing in Desktop:** a `web` CLI install does not change
|
|
29
|
+
Desktop's profile. Install through the application.
|
|
30
|
+
- **DSH fails after an older plugin install:** earlier packages could install
|
|
31
|
+
their own DSH core dependencies into a hoisted profile. Back up the profile,
|
|
32
|
+
upgrade the plugin and reinstall the profile dependencies using the host's
|
|
33
|
+
recovery flow. Disabling the old plugin alone does not remove those packages.
|
|
34
|
+
|
|
35
|
+
## Sign in and select a team
|
|
36
|
+
|
|
37
|
+
Open Teamwork and choose the browser sign-in action. The plugin starts a
|
|
38
|
+
loopback callback for up to ten minutes. If the callback is inaccessible,
|
|
39
|
+
copy the authorization line shown by the service into the panel or DSH command
|
|
40
|
+
input. The one-use authorization code expires after two minutes.
|
|
41
|
+
|
|
42
|
+
Authorization immediately syncs resources; by default the plugin refreshes
|
|
43
|
+
every 60 seconds. Use the team selector to browse one team or all teams.
|
|
44
|
+
Browsing another team does not retarget an existing conversation or restrict
|
|
45
|
+
phone pairing to that team. A person may belong to several teams.
|
|
46
|
+
|
|
47
|
+
Create or join teams in the web console. New teams receive a built-in assistant;
|
|
48
|
+
existing teams are unchanged. Team renaming does not automatically rename the
|
|
49
|
+
assistant. Use its preset with a working model and ask it to inspect real state.
|
|
50
|
+
|
|
51
|
+
## Choose a model or preset
|
|
52
|
+
|
|
53
|
+
Use **New session** for a team preset. **Use in current session** works only
|
|
54
|
+
before the conversation begins. Started sessions keep their preset generation;
|
|
55
|
+
use a new session to adopt an update. A restart cannot promise to reconstruct a
|
|
56
|
+
deleted old preset: a version mismatch blocks team inference and gives recovery
|
|
57
|
+
guidance.
|
|
58
|
+
|
|
59
|
+
Required tools and pinned plugin dependencies must be available. Optional
|
|
60
|
+
missing tools are warnings. A registered tool still follows DSH's authorization
|
|
61
|
+
and runtime conditions. Team model routes go through your service; a preset
|
|
62
|
+
that inherits a local model keeps that model instead.
|
|
63
|
+
|
|
64
|
+
## Share, review and restore
|
|
65
|
+
|
|
66
|
+
1. Ask the team assistant to prepare a plugin inside the session workspace,
|
|
67
|
+
or submit a preset/plugin through **Sharing and review** in the web console.
|
|
68
|
+
2. Review the prepared package identity, version, file list and SHA-256 before
|
|
69
|
+
upload. Preparation does not run package lifecycle scripts.
|
|
70
|
+
3. Submit the new resource or update for administrator review. An update names
|
|
71
|
+
the existing configuration and its base version.
|
|
72
|
+
4. An administrator inspects the frozen contents and approves or rejects them.
|
|
73
|
+
A conflicting newer publication requires a fresh submission.
|
|
74
|
+
5. Members sync the published resource. A plugin still needs a separate local
|
|
75
|
+
installation confirmation; existing local packages are not silently upgraded.
|
|
76
|
+
|
|
77
|
+
Members see their own submissions. Administrators see the team's submissions.
|
|
78
|
+
Assistant writes also need host approval, including for administrators.
|
|
79
|
+
Provider secrets and new account passwords belong in the console's forms.
|
|
80
|
+
|
|
81
|
+
**Versions and backups** shows publication time, author/approver, changes and
|
|
82
|
+
retained versions. Exported resources can include retained private plugin bytes.
|
|
83
|
+
A restoration prepares a new publication for review; it does not erase history
|
|
84
|
+
or replace a running conversation's preset. A resource export is distinct from
|
|
85
|
+
a full database-and-artifact backup managed by the server operator.
|
|
86
|
+
|
|
87
|
+

|
|
88
|
+
|
|
89
|
+
## Commands
|
|
90
|
+
|
|
91
|
+
Run these in DSH's command input, not your shell. IDs come from `/teamwork list`.
|
|
92
|
+
|
|
93
|
+
| Command | Purpose |
|
|
94
|
+
| --- | --- |
|
|
95
|
+
| `/teamwork login` | Open browser authorization. |
|
|
96
|
+
| `/teamwork authorize <code>` | Redeem a fallback authorization code. |
|
|
97
|
+
| `/teamwork status` | Show authentication, sync status and recent errors. |
|
|
98
|
+
| `/teamwork sync` | Refresh the team's resources. |
|
|
99
|
+
| `/teamwork list` | List configuration IDs. |
|
|
100
|
+
| `/teamwork info [id]` | Inspect active or available preset details and readiness. |
|
|
101
|
+
| `/teamwork new <id>` | Create a session from the latest preset without starting a task. |
|
|
102
|
+
| `/teamwork use <id>` | Select a team resource in a blank session. |
|
|
103
|
+
| `/teamwork tools` | Inspect visible tool names and conditions. |
|
|
104
|
+
| `/teamwork plugins [presetId]` | Check published plugin dependencies. |
|
|
105
|
+
| `/teamwork install <id>[@<version>]` | Preview an exact plugin installation; repeat with `confirm` after inspection. |
|
|
106
|
+
| `/teamwork session [check]` | Inspect session state; `check` refreshes team access/readiness. |
|
|
107
|
+
| `/teamwork continue <instruction>` | Send follow-up input after readiness checks. |
|
|
108
|
+
| `/teamwork cancel` | Request native cancellation; keep the inbox and existing file changes. |
|
|
109
|
+
| `/teamwork retry` | Preview recovery; `retry confirm` sends a recovery instruction, not tool replay. |
|
|
110
|
+
| `/teamwork logout` | Drop the in-memory token, team cache and team registrations. |
|
|
111
|
+
|
|
112
|
+
Continue and retry do not jump ahead of queued input. A confirmation expires
|
|
113
|
+
when its session, model, configuration or login binding changes. Logout leaves
|
|
114
|
+
explicitly installed plugins in place. Removed members are refused by the
|
|
115
|
+
server on their next request.
|
|
116
|
+
|
|
117
|
+
## Configuration
|
|
118
|
+
|
|
119
|
+
The default server is `https://www.dshteamwork.com`. Change it on the sign-in
|
|
120
|
+
screen to a self-hosted server. HTTPS is required except on loopback. Changing
|
|
121
|
+
servers signs you out and clears the previous server's team resources.
|
|
122
|
+
|
|
123
|
+
Advanced profile configuration can override the inserted plugin entry:
|
|
124
|
+
|
|
125
|
+
```yaml
|
|
126
|
+
- id: dsh-teamwork
|
|
127
|
+
config:
|
|
128
|
+
apiEndpoint: https://teamwork.example.com
|
|
129
|
+
cachePath: /absolute/path/to/private/teamwork-cache.json
|
|
130
|
+
autoSync: true
|
|
131
|
+
syncIntervalMs: 60000
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
`syncIntervalMs` accepts integer milliseconds from 10000 to 86400000.
|
|
135
|
+
`autoSync: false` disables login-triggered and periodic sync; manual sync remains.
|
|
136
|
+
Do not duplicate the package's `insert` entry in a profile.
|
|
137
|
+
|
|
138
|
+
## Data and phone access
|
|
139
|
+
|
|
140
|
+
Tokens stay in host memory; restart requires sign-in. Team configuration is
|
|
141
|
+
cached with private file permissions. A stale cache is not authorization.
|
|
142
|
+
Network failures preserve it; 401/403 clear team registrations and suspend sync
|
|
143
|
+
until sign-in. Provider keys remain on the service; team-model prompts and
|
|
144
|
+
context travel through that service's gateway.
|
|
145
|
+
|
|
146
|
+
The hosted service may advertise a relay. A matching Teamwork App and an online
|
|
147
|
+
DSH web/desktop host are required. Headless-only hosts return 503 for phone
|
|
148
|
+
requests. The community edition does not supply the hosted relay.
|
|
149
|
+
|
|
150
|
+
Pairing requires matching account identity, checking the safety code on both
|
|
151
|
+
devices and approval on the computer. It authorizes the owner's permitted
|
|
152
|
+
personal and team sessions on this DSH, across teams. It grants no additional
|
|
153
|
+
team permissions. A private, authenticated encrypted channel protects phone
|
|
154
|
+
requests and ordinary file attachments; the relay can still see account/device
|
|
155
|
+
metadata, public keys, timing and sizes. The team-model gateway is a separate
|
|
156
|
+
boundary. Both endpoints must be on matching protocol versions.
|
|
157
|
+
|
|
158
|
+
Pairing keys persist locally. Changed or missing trusted keys require pairing
|
|
159
|
+
again. Desktop revocation closes the channel immediately; phone-side revocation
|
|
160
|
+
needs the computer's encrypted acknowledgement and may wait for reconnection.
|
|
161
|
+
|
|
162
|
+
## Getting help
|
|
163
|
+
|
|
164
|
+
Use `/teamwork status`, the local plugin manager and your server's console.
|
|
165
|
+
Include DSH/plugin versions, OS, profile type, package-manager version and
|
|
166
|
+
redacted diagnostics in an [issue](https://github.com/dsh-teamwork/dsh-teamwork/issues).
|
|
167
|
+
Remove tokens, authorization lines, pairing codes, provider keys and private
|
|
168
|
+
team data before posting. [Developer details](../development.md) cover tests and protocols.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# 使用 DSH Teamwork
|
|
2
|
+
|
|
3
|
+
[中文 README](../../README.zh-CN.md) · [English](../en/guide.md)
|
|
4
|
+
|
|
5
|
+
连接团队服务、同步资源,再为新会话选择预设。团队资源以增量方式加入 DSH,本地配置和默认模型继续独立使用。
|
|
6
|
+
|
|
7
|
+
## 安装与更新
|
|
8
|
+
|
|
9
|
+
桌面版从应用内 **Plugins → Add plugin** 安装;CLI web profile 使用
|
|
10
|
+
`dsh plugin --profile web add @dsh-teamwork/dsh-teamwork`。更新、启用及诊断也应通过同一个 profile 的插件管理器,遵循宿主的重载/重启提示。
|
|
11
|
+
|
|
12
|
+
- **版本被拒绝:**核对 DSH 与插件版本。声明范围为 `>=0.2.2-rc.1 <0.3.0-0`,CI 覆盖 rc.1、rc.2、rc.3。选择兼容且已发布的插件版本;范围声明不代表实测过所有未来版本。
|
|
13
|
+
- **没有选到刚发布的版本:**部分宿主应用最短发布时间策略。可在 [npm 版本页](https://www.npmjs.com/package/@dsh-teamwork/dsh-teamwork?activeTab=versions)核实后指定精确版本。GitHub main 中的版本可能仍在等待 npm 发布。
|
|
14
|
+
- **构建脚本等待处理:**pnpm 11 可能因依赖脚本暂停安装,使用宿主的构建审核流程。本地隔离 Linux CLI 检查中,明确拒绝 `@google/genai`、`protobufjs` 的脚本后,安装和基础集成检查通过;这与 DSH 版本兼容检查是两件事。
|
|
15
|
+
- **安装成功但桌面版没有出现:**CLI 的 `web` profile 不属于桌面应用,应在应用内安装。
|
|
16
|
+
- **旧版安装后 DSH 启动失败:**早期插件可能把自己的 DSH 核心包安装到 hoisted profile,覆盖升级后的宿主。先备份 profile,通过宿主恢复流程升级插件并重新安装依赖;仅停用旧插件不会清除这些包。
|
|
17
|
+
|
|
18
|
+
## 登录与选择团队
|
|
19
|
+
|
|
20
|
+
在 Teamwork 中选择浏览器登录。插件会启动最多十分钟的本机回传监听;无法回传时,把网页显示的授权行粘贴到面板或 DSH 命令输入框。一次性授权码有效期为两分钟。
|
|
21
|
+
|
|
22
|
+
授权完成后立即同步,默认每 60 秒刷新。用团队下拉框浏览一个或所有团队;改变浏览范围不改变已有会话的目标团队,也不能把手机授权限制到这个团队。一个账号可以加入多个团队。
|
|
23
|
+
|
|
24
|
+
在网页控制台创建或加入团队。新团队会获得内置助理,已有团队不自动补建;重命名团队不会自动重命名助理。为助理预设选择可用模型后,要求它读取真实状态再操作。
|
|
25
|
+
|
|
26
|
+
## 选择模型或预设
|
|
27
|
+
|
|
28
|
+
使用“新建会话”应用团队预设。“用于当前会话”仅适用于尚未开始对话的会话。已开始的会话保留原预设代次,使用新会话采用更新。跨重启不保证重建已删除的旧预设;发现版本不一致时会阻止团队推理并给出恢复指引。
|
|
29
|
+
|
|
30
|
+
必需工具和固定版本的插件依赖必须就绪,可选工具缺失只提示。工具已注册仍须满足 DSH 授权与运行条件。团队模型经过团队服务;继承本地模型的预设继续使用所继承的模型。
|
|
31
|
+
|
|
32
|
+
## 分享、审批与恢复
|
|
33
|
+
|
|
34
|
+
1. 让团队助理准备会话工作区内的插件,或在网页“分享与审批”中提交插件/预设。
|
|
35
|
+
2. 上传前检查包名、版本、文件清单和 SHA-256。准备包时不运行生命周期脚本。
|
|
36
|
+
3. 提交新增或更新;更新须关联现有配置及其基础版本。
|
|
37
|
+
4. 管理员检查冻结内容并批准或拒绝;如已有更新版本发布,需要重新提交。
|
|
38
|
+
5. 成员同步已发布资源。插件仍需本机安装确认,不会静默升级已有本地包。
|
|
39
|
+
|
|
40
|
+
成员查看自己的提交,管理员查看团队提交。管理员通过助理写入时也需要宿主审批。供应商密钥和新账号密码通过网页安全表单输入。
|
|
41
|
+
|
|
42
|
+
“版本与备份”显示发布时间、作者/审批人、变更和保留版本。导出资源可包含保留的私有插件文件;恢复会准备一个新的待审核发布,不会抹去历史或替换运行中会话的预设。资源导出不同于运维人员管理的完整数据库与插件文件备份。
|
|
43
|
+
|
|
44
|
+

|
|
45
|
+
|
|
46
|
+
## 命令
|
|
47
|
+
|
|
48
|
+
在 DSH 命令输入框中运行,不是在系统 shell 中。ID 可通过 `/teamwork list` 查看。
|
|
49
|
+
|
|
50
|
+
| 命令 | 用途 |
|
|
51
|
+
| --- | --- |
|
|
52
|
+
| `/teamwork login` | 打开浏览器授权。 |
|
|
53
|
+
| `/teamwork authorize <code>` | 兑换备用授权码。 |
|
|
54
|
+
| `/teamwork status` | 查看登录、同步和最近错误。 |
|
|
55
|
+
| `/teamwork sync` | 刷新团队资源。 |
|
|
56
|
+
| `/teamwork list` | 列出配置 ID。 |
|
|
57
|
+
| `/teamwork info [id]` | 检查当前或可选预设的说明与就绪状态。 |
|
|
58
|
+
| `/teamwork new <id>` | 从最新预设创建会话,不直接启动任务。 |
|
|
59
|
+
| `/teamwork use <id>` | 在空白会话中选择团队资源。 |
|
|
60
|
+
| `/teamwork tools` | 查看可见工具名和条件。 |
|
|
61
|
+
| `/teamwork plugins [presetId]` | 检查已发布插件依赖。 |
|
|
62
|
+
| `/teamwork install <id>[@<version>]` | 预览精确版本安装,检查后追加 `confirm` 确认。 |
|
|
63
|
+
| `/teamwork session [check]` | 查看会话状态;`check` 额外刷新团队权限和就绪状态。 |
|
|
64
|
+
| `/teamwork continue <instruction>` | 检查后发送后续指令。 |
|
|
65
|
+
| `/teamwork cancel` | 请求原生取消,保留待处理输入与已产生的文件修改。 |
|
|
66
|
+
| `/teamwork retry` | 预览恢复;`retry confirm` 发送恢复指令,不重放工具调用。 |
|
|
67
|
+
| `/teamwork logout` | 丢弃内存令牌、团队缓存与注册。 |
|
|
68
|
+
|
|
69
|
+
继续和重试不会插队;会话、模型、配置或登录身份变化会使确认失效。退出不卸载明确安装过的插件;被移除成员的下一次服务端请求将被拒绝。
|
|
70
|
+
|
|
71
|
+
## 配置
|
|
72
|
+
|
|
73
|
+
默认服务器为 `https://www.dshteamwork.com`,可在登录页改为自建服务。除本机回环地址外须使用 HTTPS。切换服务器会退出登录并清除旧服务器的团队资源。
|
|
74
|
+
|
|
75
|
+
高级 profile 配置可覆盖已插入的插件条目:
|
|
76
|
+
|
|
77
|
+
```yaml
|
|
78
|
+
- id: dsh-teamwork
|
|
79
|
+
config:
|
|
80
|
+
apiEndpoint: https://teamwork.example.com
|
|
81
|
+
cachePath: /absolute/path/to/private/teamwork-cache.json
|
|
82
|
+
autoSync: true
|
|
83
|
+
syncIntervalMs: 60000
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
`syncIntervalMs` 接受 10000–86400000 之间的整数毫秒。`autoSync: false` 关闭登录触发与定时同步,手动同步仍可用。不要重复复制包内的 `insert` 条目。
|
|
87
|
+
|
|
88
|
+
## 数据与手机连接
|
|
89
|
+
|
|
90
|
+
令牌只在宿主内存中保存,重启需要登录;团队配置以私有文件权限缓存。旧缓存不是登录授权。网络失败时保留缓存;401/403 会清除团队注册并暂停同步,等待重新登录。供应商密钥保留在服务端,团队模型的提示词与上下文经过其网关。
|
|
91
|
+
|
|
92
|
+
托管服务可提供中转,需要匹配的 Teamwork App 与在线的 DSH web/桌面宿主。仅启动 headless 的主机对手机请求返回 503;社区版不提供托管中转。
|
|
93
|
+
|
|
94
|
+
配对需要相同账号、两端核对安全码并在电脑批准。配对可访问本机账号有权限的个人和各团队会话,不增加团队权限。私有认证加密通道保护手机请求与普通附件;中转仍可见账号/设备元数据、公钥、时间和大小。团队模型网关是另一条数据边界;两端须使用匹配协议版本。
|
|
95
|
+
|
|
96
|
+
配对密钥保存在本机。信任密钥变化或丢失时需要重新配对。电脑解除配对会立即关闭通道;手机端解除需要电脑的加密确认,离线电脑需要重新连线。
|
|
97
|
+
|
|
98
|
+
## 获取帮助
|
|
99
|
+
|
|
100
|
+
查看 `/teamwork status`、本地插件管理器和团队服务控制台。向 [Issues](https://github.com/dsh-teamwork/dsh-teamwork/issues) 提供 DSH/插件版本、系统、profile 类型、包管理器版本和脱敏诊断。公开前移除令牌、授权行、配对码、供应商密钥及私有团队数据。构建、测试及协议见[开发参考](../development.md)。
|
package/lib/local-share.js
CHANGED
|
@@ -6,6 +6,7 @@ import { tmpdir } from 'node:os';
|
|
|
6
6
|
import { resolve, relative, join, basename } from 'node:path';
|
|
7
7
|
import { gunzipSync } from 'node:zlib';
|
|
8
8
|
import { createHash } from 'node:crypto';
|
|
9
|
+
import { npmCommand } from './npm-command.js';
|
|
9
10
|
const exec = promisify(execFile);
|
|
10
11
|
export async function preparePlugin(cwd, input, signal) {
|
|
11
12
|
const root = await realpath(resolve(cwd, input));
|
|
@@ -15,7 +16,8 @@ export async function preparePlugin(cwd, input, signal) {
|
|
|
15
16
|
throw Error('Choose a directory inside this session workspace');
|
|
16
17
|
const directory = await mkdtemp(join(tmpdir(), 'teamwork-share-'));
|
|
17
18
|
try {
|
|
18
|
-
const
|
|
19
|
+
const command = npmCommand(['pack', '--ignore-scripts', '--json', '--pack-destination', directory]);
|
|
20
|
+
const { stdout } = await exec(command.file, command.args, { cwd: root, signal, maxBuffer: 4 * 1024 * 1024, windowsHide: true });
|
|
19
21
|
const [result] = JSON.parse(stdout);
|
|
20
22
|
if (!result ||
|
|
21
23
|
result.size > 10 * 1024 * 1024 ||
|
package/lib/local-share.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-share.js","sourceRoot":"","sources":["../src/local-share.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,MAAM,IAAI,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AO,CAAC;gBAEtB,MAAM,KAAK,CAAC,uCAAuC,IAAI,EAAE,CAAC,CAAC;YAC7D,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;gBACjB,MAAM,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,GAAG,EAAE,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,CAAC;gBACrE,IACE,2FAA2F,CAAC,IAAI,CAC9F,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CACzB;oBAED,MAAM,KAAK,CAAC,yBAAyB,IAAI,EAAE,CAAC,CAAC;gBAC/C,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACnB,CAAC;YACD,MAAM,IAAI,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;QAC9C,CAAC;QACD,OAAO;YACL,IAAI;YACJ,SAAS;YACT,OAAO,EAAE,MAAM,CAAC,IAAI;YACpB,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;YACxD,IAAI,EAAE,KAAK,CAAC,MAAM;YAClB,KAAK;SACN,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACtD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { delimiter, dirname, join } from 'node:path';
|
|
3
|
+
/** Run npm's JS entry on Windows: execFile cannot execute npm.cmd directly. */
|
|
4
|
+
export function npmCommand(args) {
|
|
5
|
+
if (process.platform !== 'win32')
|
|
6
|
+
return { file: 'npm', args };
|
|
7
|
+
const directories = [dirname(process.execPath), ...(process.env.PATH ?? '').split(delimiter)];
|
|
8
|
+
for (const directory of directories) {
|
|
9
|
+
if (!directory)
|
|
10
|
+
continue;
|
|
11
|
+
const root = directory.replace(/^"(.*)"$/, '$1');
|
|
12
|
+
const cli = join(root, 'node_modules', 'npm', 'bin', 'npm-cli.js');
|
|
13
|
+
if (!existsSync(cli))
|
|
14
|
+
continue;
|
|
15
|
+
const node = join(root, 'node.exe');
|
|
16
|
+
return { file: existsSync(node) ? node : process.execPath, args: [cli, ...args] };
|
|
17
|
+
}
|
|
18
|
+
throw new Error('npm was not found on PATH. Install Node.js with npm to share a local plugin.');
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=npm-command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"npm-command.js","sourceRoot":"","sources":["../src/npm-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAErD,+EAA+E;AAC/E,MAAM,UAAU,UAAU,CAAC,IAAc;IACvC,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO;QAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAC/D,MAAM,WAAW,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IAC9F,KAAK,MAAM,SAAS,IAAI,WAAW,EAAE,CAAC;QACpC,IAAI,CAAC,SAAS;YAAE,SAAS;QACzB,MAAM,IAAI,GAAG,SAAS,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QACjD,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC;QACnE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,SAAS;QAC/B,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QACpC,OAAO,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;IACpF,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,8EAA8E,CAAC,CAAC;AAClG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-share.d.ts","sourceRoot":"","sources":["../../src/local-share.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"local-share.d.ts","sourceRoot":"","sources":["../../src/local-share.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AACD,wBAAsB,aAAa,CACjC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,cAAc,CAAC,CAiGzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"npm-command.d.ts","sourceRoot":"","sources":["../../src/npm-command.ts"],"names":[],"mappings":"AAGA,+EAA+E;AAC/E,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE;;;EAYxC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-teamwork/dsh-teamwork",
|
|
3
|
-
"version": "0.8.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.8.4",
|
|
4
|
+
"description": "Shared team models, agent presets, and approved plugins for DeepSeek Harness",
|
|
5
5
|
"icon": "icon.svg",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
@@ -19,7 +19,11 @@
|
|
|
19
19
|
"icon.svg",
|
|
20
20
|
"cordis.patch.yml",
|
|
21
21
|
"LICENSE",
|
|
22
|
-
"NOTICE"
|
|
22
|
+
"NOTICE",
|
|
23
|
+
"README.zh-CN.md",
|
|
24
|
+
"docs",
|
|
25
|
+
"assets/readme",
|
|
26
|
+
"screenshots.json"
|
|
23
27
|
],
|
|
24
28
|
"peerDependencies": {
|
|
25
29
|
"@deepseek-ai/cordis": "~4.1.0",
|
|
@@ -42,6 +46,15 @@
|
|
|
42
46
|
"tsx": "^4.19.0",
|
|
43
47
|
"typescript": "^5.6.0",
|
|
44
48
|
"vitest": "^2.1.0",
|
|
49
|
+
"@deepseek-ai/dsh-agent": "0.2.2-rc.3",
|
|
50
|
+
"@deepseek-ai/dsh-agent-preset-registry": "0.2.2-rc.3",
|
|
51
|
+
"@deepseek-ai/dsh-commands": "0.2.2-rc.3",
|
|
52
|
+
"@deepseek-ai/dsh-llm": "0.2.2-rc.3",
|
|
53
|
+
"@deepseek-ai/dsh-llm-pi-ai": "0.2.2-rc.3",
|
|
54
|
+
"@deepseek-ai/dsh-plugin-manager": "0.2.2-rc.3",
|
|
55
|
+
"@deepseek-ai/dsh-session": "0.2.2-rc.3",
|
|
56
|
+
"@deepseek-ai/dsh-session-projection": "0.2.2-rc.3",
|
|
57
|
+
"@deepseek-ai/dsh-tools": "0.2.2-rc.3",
|
|
45
58
|
"@dsh-teamwork/ui": "0.1.0"
|
|
46
59
|
},
|
|
47
60
|
"dependencies": {
|
|
@@ -53,7 +66,7 @@
|
|
|
53
66
|
"@libp2p/peer-id": "5.0.16",
|
|
54
67
|
"@noble/curves": "1.9.7",
|
|
55
68
|
"@noble/hashes": "1.8.0",
|
|
56
|
-
"zod": "
|
|
69
|
+
"zod": "4.6.6"
|
|
57
70
|
},
|
|
58
71
|
"dsh": {
|
|
59
72
|
"bundle": {
|
|
@@ -76,6 +89,21 @@
|
|
|
76
89
|
"./client": "./lib/web/client.js",
|
|
77
90
|
"./package.json": "./package.json"
|
|
78
91
|
},
|
|
92
|
+
"homepage": "https://www.dshteamwork.com",
|
|
93
|
+
"bugs": {
|
|
94
|
+
"url": "https://github.com/dsh-teamwork/dsh-teamwork/issues"
|
|
95
|
+
},
|
|
96
|
+
"keywords": [
|
|
97
|
+
"deepseek-harness",
|
|
98
|
+
"dsh-plugin",
|
|
99
|
+
"teamwork",
|
|
100
|
+
"collaboration",
|
|
101
|
+
"team-configuration",
|
|
102
|
+
"agent-presets",
|
|
103
|
+
"plugin-sharing",
|
|
104
|
+
"usage",
|
|
105
|
+
"budgets"
|
|
106
|
+
],
|
|
79
107
|
"scripts": {
|
|
80
108
|
"build": "tsc && node scripts/build-web.mjs",
|
|
81
109
|
"watch": "tsc -w & node scripts/build-web.mjs --watch",
|