@dsh-teamwork/dsh-teamwork 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/README.md CHANGED
@@ -1,264 +1,127 @@
1
- # DSH Teamwork MVP
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
- 团队模型、预设和插件目录作为独立增量配置加入 DSH,不覆盖本地用户配置。DSH 兼容范围为 `>=0.2.2-rc.1 <0.3.0-0` / Cordis `4.1.0`;允许 `0.2.x` 更新,排除 `0.3.0` 及其预发布版。CI 矩阵覆盖 DSH `0.2.2-rc.1`、`0.2.2-rc.2` 和 `0.2.2-rc.3`。
3
+ # DSH Teamwork
4
4
 
5
- ## 开发
5
+ English · [简体中文](README.zh-CN.md)
6
6
 
7
- ```sh
8
- pnpm install --frozen-lockfile
9
- pnpm build
10
- pnpm test
11
- pnpm typecheck
12
- ```
13
-
14
- 插件包含可发布的 `lib` 输出;修改源码后应重新构建。`pnpm build` 同时编译宿主端(`src/` → `lib/`)和浏览器端(`src/web/` → `lib/web/client.js`)。
15
-
16
- DSH 核心包由宿主提供,只声明为 `peerDependencies`;开发依赖固定在 `0.2.2-rc.3`,Zod 与该宿主对齐为 `4.6.6`,避免多个版本的递归类型导致类型检查内存耗尽。不要将 `@deepseek-ai/dsh-*` 加回运行时依赖:旧版插件在 hoisted profile 中安装的核心包可能覆盖升级后的宿主,即使停用插件仍会导致启动失败。遇到此问题,应备份 profile,升级插件并重新安装依赖以清除旧核心包;仅关闭插件不会清除这些依赖。
17
-
18
- 仓库是 pnpm workspace:`ui/` 是共用组件库 `@dsh-teamwork/ui`,供本插件的面板使用,将来给 web 端和其他 DSH 插件共用,之后拆到独立仓库 `dsh-teamwork/dsh-teamwork-ui`。它的约定见 [`ui/README.md`](ui/README.md)。
19
-
20
- ## 接入 DSH
21
-
22
- 安装插件后,默认连接官方服务 `https://www.dshteamwork.com`,不用任何配置。自建团队可以在 Teamwork 面板的登录页更改服务器地址(例如本地开发的 `http://localhost:3800`),选择保存在配置缓存旁的 `<缓存名>.server.json`;也可以在 profile 的 `dsh-teamwork` 条目里改默认值:
23
-
24
- ```yaml
25
- - id: dsh-teamwork
26
- config:
27
- apiEndpoint: https://teamwork.example.com # 默认 https://www.dshteamwork.com
28
- cachePath: /absolute/path/to/private/teamwork-cache.json
29
- autoSync: true
30
- syncIntervalMs: 60000
31
- ```
32
-
33
- **手机接入(托管服务)**:登录后,插件会向服务器询问 `GET /api/relay`。服务器提供中转时,插件主动连出一条 WebSocket,并用登录得到的令牌表明身份。服务器那边会把这台电脑登记为你的主机,面板顶部显示“手机可连接”。DSH Teamwork App 之后就能经由这条连接操作这台电脑上的 DSH。自建的社区版服务器不提供中转,插件也就不会连出。这台电脑的标识保存在缓存旁的 `<缓存名>.host.json`;退出登录会断开连接。
34
-
35
- **手机能做什么**:只有在这台电脑上确认过的配对,才能把手机的请求转进来。插件逐条按白名单检查,再以这部手机专属的身份在本机调用 DSH。白名单只包括:查看会话列表、新建会话、发送消息、跟随输出、取消、切换模型、回答 Agent 的提问和审批。名单之外的请求不会到达 DSH。只开终端、没有启动 DSH web 或桌面端时,手机请求一律返回 503。解除配对后,这部手机会立刻断开。Agent 提问或需要审批时,插件会告诉服务器是哪个会话在等,服务器再通知这台电脑上没打开 App 的已配对手机;通知只写是哪台电脑在等,不包含问题内容。
36
-
37
- 包的 `cordis.patch.yml` 使用 `insert` 声明新条目。手动 `--patch` 加载时也需使用 insert,并将 name 指向本仓库 `lib/index.js` 的绝对路径。
38
-
39
- ## 侧栏面板
40
-
41
- DSH web 和桌面端的左侧栏有 Teamwork 入口,打开后是主区域的 Teamwork 面板:
42
-
43
- - 未登录:点“在浏览器中登录”,在网页上确认授权,面板随即自动完成登录。插件在本机 `127.0.0.1` 的一个临时端口上等授权码,最多等十分钟,兑换成功后立即关闭;浏览器和 DSH 不在同一台机器时,把网页上显示的那一行粘贴到面板里。页面底部显示当前服务器,可以改成自建或本地地址,或恢复默认;服务器只接受 https,本机地址可以用 http。更改服务器会退出当前登录并清除旧服务器的团队配置。
44
- - 顶栏:图标右侧为“我的团队 > 当前团队”,手机连接、我的账号在右。Teamwork 名称、服务器、本机信息、同步状态和刷新位于底部贴边的状态栏,内容单独滚动。手机连接独立于团队资源;配对授权整台 DSH 可访问的会话,目前不能只授权某个团队。
45
- - 团队资源:使用顶栏的自定义下拉框切换团队,预设、模型和插件均标注所属团队。多团队首次登录先选择浏览范围,之后按服务器与账号记住选择;筛选不会改变已有会话或手机授权。发布配置和管理成员仍在网页完成。
46
- - 我的账号:显示名称、邮箱与账号语言,通过宿主接口读取和保存个人资料。可更换服务器或确认退出;令牌不会发给浏览器,重启 DSH 仍需重新授权。
47
- - 个人资料的未保存草稿会在切换页面时保留,可撤销修改;保存失败保留输入并提供重试。手机操作期间阻止重复提交,解除配对失败保留确认;配对码过期可重新生成,“收起配对码”仅隐藏展示,不会提前使服务器上的码失效。
48
- - 预设:每个预设的模型、就绪状态(必需工具、依赖插件),"用于当前会话"(仅限尚未开始对话的会话)和"新建会话"。
49
- - 团队模型:用于当前会话,只改本会话,不改本地默认设置。
50
- - 团队插件:固定版本的状态;安装前在面板里确认,确认绑定当时的精确版本。
51
-
52
- 面板通过宿主端的 `/api/teamwork/*` 路由(`src/panel.ts`)工作,与 `/teamwork` 命令调用同一组函数;平台令牌只留在宿主进程里,不会发到浏览器。DSH 只允许本机所有者访问这些路由。会话恢复相关的子命令(`session`、`continue`、`cancel`、`retry`)只保留为命令。
53
-
54
- 面板读取的是宿主已同步的配置,每次状态请求只扫描一次本机插件清单,供所有预设复用;没有插件依赖或团队插件时不扫描。清单不跨请求缓存,下一次刷新会重新检查插件状态。状态轮询在上一次请求结束后再计时,刷新失败保留已有内容。
7
+ [![npm](https://img.shields.io/npm/v/@dsh-teamwork/dsh-teamwork)](https://www.npmjs.com/package/@dsh-teamwork/dsh-teamwork)
8
+ [![CI](https://github.com/dsh-teamwork/dsh-teamwork/actions/workflows/ci.yml/badge.svg)](https://github.com/dsh-teamwork/dsh-teamwork/actions/workflows/ci.yml)
9
+ [![License: Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](LICENSE)
55
10
 
56
- ## 命令
11
+ **Shared models, agent presets, and approved plugins for your team's DSH workspace.**
57
12
 
58
- 在 DSH 原生命令输入框中使用:
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.
59
17
 
60
- - `/teamwork login`:打开输出的浏览器链接,用 Google、邮件验证码或密码登录并确认授权,授权码会经本机 `127.0.0.1` 自动交回 DSH。需要服务器支持本机回传(platform ADR 0012)。
61
- - `/teamwork authorize <code>`:自动交回没有成功时,手动兑换两分钟有效的授权码;直接粘贴网页上显示的整行也可以。
62
- - `/teamwork status`:查看登录状态、自动同步开关、团队配置数量、最近同步成功时间和错误。
63
- - `/teamwork sync`:拉取团队模型、预设和插件目录。
64
- - `/teamwork list`:查看配置 ID。
65
- - `/teamwork info [id]`:查看当前会话或指定预设的说明、版本、来源、提示词和工具状态。
66
- - `/teamwork new <id>`:用最新团队预设创建新会话,在 DSH 会话列表打开;不复制旧历史、不启动任务。
67
- - `/teamwork use <id>`:选择本会话使用的团队模型/预设,不修改本地默认模型。
68
- - `/teamwork install <id>`:查看固定版本插件的安装确认说明。
69
- - `/teamwork install <id> confirm`:通过 DSH 插件管理器先下载为禁用状态,检查配置覆盖和条目冲突后再启用。已有本地插件不会被覆盖或升级;有冲突的新包保持禁用,供用户在本地插件管理器中检查。
70
- - `/teamwork logout`:在本地丢弃插件令牌,并移除团队缓存和注册。平台令牌无法在服务端撤销,但被移出团队的成员在下一次请求时即被拒绝。
18
+ ![Teamwork panel in a real DSH host, with demonstration team resources](https://raw.githubusercontent.com/dsh-teamwork/dsh-teamwork/main/assets/readme/teamwork-panel.png)
71
19
 
72
- 凭据只保存在内存,重启需要重新登录。非敏感团队配置缓存以 0600 文件权限保存并原子替换,宿主重启时恢复。缓存路径应位于用户私有目录。网络失败保留现有配置;明确的 401/403 清除团队缓存。
20
+ The plugin panel currently uses Simplified Chinese. The web console supports
21
+ English and Simplified Chinese. Screenshots use a local demonstration team.
73
22
 
74
- 团队提示词作为独立 scoped section 追加,按字面文本处理,不替换本地 persona,也不解释 `{{...}}` 模板。
23
+ ## What you can do
75
24
 
76
- 团队注册 ID 以 `team:<teamId>:<configId>` 命名,显示名是 `[团队名] 预设名`;团队改名后会重新注册。预设引用的模型和插件只在它自己的团队里查找,不跨团队。插件只释放自己持有的注册,不枚举或删除本地配置。已运行会话可能继续持有旧的 DSH 预设版本;更新后的版本用于新选择或新会话。用户确认安装的插件不会因为退出团队而被自动卸载。
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. |
77
33
 
78
- 也可以用 `TEAMWORK_URL=... TEAMWORK_CACHE=... pnpm cli` 运行交互式同步客户端。CLI 写入缓存后,需要重新加载 DSH 插件;优先使用宿主中的 `/teamwork` 命令。
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.
79
36
 
80
- ## 验证范围
37
+ ## Install
81
38
 
82
- 单元测试验证配置隔离、幂等同步、失败保留、缓存恢复、权限失效清理,以及退出时同步/授权请求的并发取消。授权码换取令牌的服务端逻辑由 platform 仓库的 `packages/shared/src/server/auth/nextauth/__tests__/tokens.test.ts` 覆盖。
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.
83
41
 
84
- 已在真实 DSH web 宿主验证团队预设注册、会话模型选择和 `/teamwork list`。真实模型调用需要本地配置的模型密钥。真实 DSH + 本地 npm 测试仓库已验证固定版本插件下载、校验、加载、确认安装、重复安装保护,以及退出团队后保留用户已安装插件。测试包为无外部依赖的受控 fixture;任意第三方包的兼容性仍由 DSH 管理器检查。
42
+ ```text
43
+ @dsh-teamwork/dsh-teamwork
44
+ ```
85
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.
86
48
 
87
- ## 真实宿主集成测试
49
+ **DSH CLI / Web:** install into the profile you actually run:
88
50
 
89
51
  ```sh
90
- npm install --prefix /tmp/dsh-test-runtime --no-package-lock @deepseek-ai/dsh@0.2.2-rc.2
91
- DSH_CLI=/tmp/dsh-test-runtime/node_modules/@deepseek-ai/dsh/lib/bin.js pnpm test:host
52
+ dsh plugin --profile web add @dsh-teamwork/dsh-teamwork
53
+ dsh web
92
54
  ```
93
55
 
94
- CI 在 `0.2.2-rc.1` 和 `0.2.2-rc.2` 两个真实运行时上执行。测试先把当前插件打包,经 DSH CLI 安装到独立临时 profile,不添加版本豁免,然后启动宿主验证。DSH 服务依赖声明为 peer,由运行时提供,避免加载不同版本的服务实现。
95
-
96
- 测试启动独立临时 profile 和本地 npm registry,创建并打包两个固定版本 fixture,提供 SHA-512 integrity,经真实 DSH 包管理器下载和加载。测试不会发布包,也不修改现有 DSH profile。成功后清理临时目录;失败时报告诊断目录。宿主日志可能含本地浏览器令牌,请勿公开上传完整日志。
97
-
98
- 安装确认绑定当前会话和包的精确版本;配置改变后必须重新查看安装说明。浏览器登录(Google 或邮件验证码)和授权仍由 platform 仓库提供。包声明 `dsh.bundle`(宿主端插件和原生命令)和 `dsh.client`(浏览器端面板,`exports["./client"]` 指向 `lib/web/client.js`)。
99
-
100
- 测试为隔离的临时 DSH profile 设置 `npm_config_ignore_workspace_root_check=true`,允许 pnpm 9 在该 profile 的 workspace 根目录安装受控包。
101
-
102
- ## 自动配置同步
103
-
104
- 默认授权完成后立即同步,并每 60 秒自动刷新团队配置;`autoSync: false` 可关闭这两个自动行为,仍可手动 `/teamwork sync`。`syncIntervalMs` 必须是 10000–86400000 之间的整数毫秒数。每次定时请求结束后才安排下一次,手动与自动请求合并,避免慢网络下堆积请求。
105
-
106
- 网络或响应格式错误保留已有配置,下次定时重试;401/403 清除团队缓存、注册与内存登录状态,暂停自动请求,需重新登录。重启恢复的缓存不代表已登录,`/teamwork status` 会明确区分。自动同步仅更新配置目录,不自动安装插件,不上传会话。插件卸载时停止定时器,等待当前同步结束后释放团队注册。
107
-
108
- ## Platform 模型网关
109
-
110
- 团队模型和预设统一选择 `teamwork-platform` provider,wire model 为团队配置 ID。插件把 DSH 的文本、工具调用和流式输出转换为 OpenAI Chat Completions 请求,发送到当前服务器的 `/api/llm/chat/completions`。认证使用内存中的 platform 插件会话令牌,不读取本地供应商密钥,也不提供供应商直连降级。
111
-
112
- 供应商地址和真实 API Key 仅配置在 platform 部署环境。缓存只保存配置描述;未登录时,即使有缓存也无法推理。当前适配器先支持文本和工具调用,模型目录读取团队配置中的 `contextWindow` 和 `maxTokens`。只有缺失字段才使用 32K 上下文、4096 输出的兼容值(确保输出不超过上下文)。管理员可在 platform 查询供应商模型列表并补充未提供的能力值;多模态和其他供应商协议后续补齐。
113
-
114
- 按已确认的产品边界,现有本地模型继续独立使用;teamwork 管理的模型和预设全部经 platform,不修改本地模型配置或凭据。
115
-
116
- ## Agent Preset
117
-
118
- 团队预设复用 DSH 原生 `agentPresets` 注册、挂载、选择及 revision 生命周期。管理员在 platform 配置简介、使用说明、输出要求、团队模型引用、增量提示词以及必需/可选工具名称。说明字段供用户阅读;需要模型执行的要求写入 `systemPrompt`。新预设引用同团队 `kind=model` 的配置 ID,旧版内嵌 provider/model 配置继续兼容,不允许两种方式混用。引用模型删除后,客户端不降级到本地模型,网关也拒绝该请求。
119
-
120
- - `/teamwork info` 显示实际挂载版本;`/teamwork info <id>` 预览最新目录配置,工具检查基于当前会话。
121
- - 工具按 DSH 注册名称检查,区分已注册、条件可用、缺失、无法检查。工具已注册不意味着已获得执行授权,运行时仍由宿主处理权限与条件。
122
- - 必需工具缺失/无法检查时,`/teamwork use` 拒绝选择;通过其他原生入口选择的预设,也在每次模型请求前重新检查。可选工具缺失只展示提示。
123
- - DSH 只允许空白会话切换预设。开始第一轮后或执行中,使用 `/teamwork new <id>` 创建新会话;不在原会话静默改提示词、不清空历史。
124
- - 同步更新后,已有 Agent 保留 DSH 原生旧 revision,`/teamwork info` 展示新版本;空白会话再次 `/teamwork use` 可更新。
125
- - 每个会话开始时的团队/预设/版本记录在配置缓存旁的 `<缓存名>.sessions.json`(0600,原子替换),不写进会话日志:DSH 拒绝重新打开日志里含有它不认识的事件类型的会话,而第三方插件写不了它接受的可忽略记录。宿主恢复会话时若重新挂载的版本与记录不一致,阻止继续推理并提示新建会话;当前不保存历史预设定义,不承诺跨重启恢复已删除的旧 revision。没有记录的会话(包括分叉出的新会话)从首次请求开始记录。
126
- - 预设版本固定不冻结服务端策略:成员权限、模型路由和输出限制仍采用 platform 当前配置。
127
-
128
- 本地定向宿主检查:`DSH_CLI=/path/to/dsh/lib/bin.js pnpm test:presets`,不调用真实模型,不安装测试插件。
129
-
130
- ## 工具清单与插件依赖
56
+ For an existing web process, follow the host's reload/restart instructions.
57
+ Replace `web` with your custom profile name where appropriate.
131
58
 
132
- - `/teamwork tools`:列出当前会话可见的实际工具注册名及条件状态。DSH 工具接口未提供可靠的包归属,来源仅标记为「团队声明来源」或「宿主未提供归属信息」,不猜测运行时归属。已注册不代表已获执行权限。
133
- - `/teamwork plugins`:重新读取宿主插件清单,检查所有团队目录插件;`/teamwork plugins <presetId>` 检查某预设的固定版本依赖。
134
- - 预设的 `pluginDependencies` 是 `{pluginConfigId, version}[]`。目录记录消失或版本变化会提示管理员更新预设,不自动换成新版本。状态检查覆盖未安装、未启用、版本不符、加载失败、待加载/重启、正常和无法确认。
135
- - 目录插件的 `providesTools` 是管理员声明的 DSH 工具注册名称,用于缺失工具的安装指引;实际可用性始终重新读取会话工具服务。
136
- - 依赖未就绪时 `/teamwork use` 拒绝选择;原生入口创建的预设在每次模型请求前也检查。已固定的旧预设依赖不随目录更新自动改写。
137
- - `/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. |
138
64
 
139
- ## 会话与任务操作
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).
140
68
 
141
- - `/teamwork session`:查看原生运行状态、最近任务结果、最近已进入上下文的用户输入摘要、队列数量、模型、预设版本和本地恢复检查。`/teamwork session check` 额外刷新团队配置,验证当前平台访问权限;不启动任务。
142
- - `/teamwork continue <后续指令>`:在空闲且无待处理输入时,检查模型、权限、预设版本、插件和工具,然后使用 DSH `followup` 发送新的用户消息。原有本地模型不要求 platform 登录。恢复已有会话沿用 DSH 原生入口,不覆盖其保存的模型选择。
143
- - `/teamwork cancel`:调用 DSH `cancel({kind:'user'}, {keepInbox:true})`,请求取消当前执行,保留待处理输入。取消是请求,不承诺同步停止;用概览确认状态。文件修改不会回滚,历史不会删除。
144
- - `/teamwork retry`:仅为失败、被阻止、取消、输出截断或意外中断的任务提供确认说明;`/teamwork retry confirm` 在两分钟内提交一次恢复指令,要求先检查已有结果再继续。不是重放工具调用,也不是完全复现原请求;仍可能产生新操作,需要用户明确确认。
69
+ ## Start with your team
145
70
 
146
- 继续/重试不插队:如果有队列或引导输入,先在 DSH 原生界面检查处理。确认会在会话、模型、团队配置或登录身份变更后失效。权限检查期间取消不会在检查返回后启动任务;同时提交的请求也不会重复派发。
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.
147
78
 
148
- 任务摘要和结果使用原生 session projection,在本地会话恢复时重建;不向 platform 上传会话。错误提示区分凭据、限流、网络和工具条件,不复制上游原始错误正文。恢复检查是启动前检查,不替代 platform 对实际每次请求的实时权限校验。
79
+ Try asking:
149
80
 
150
- ## 发布
81
+ > Sync my team's configuration and show my usage for this month.
151
82
 
152
- 发布到 npm 用 trusted publishing(OIDC),不存任何 npm 令牌,做法和 `motionhub-dev/motions` 相同:
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.
153
85
 
154
- 1. 把 `package.json` 的 `version` 改成新版本,合进 `main`。
155
- 2. 在 `main` 的那个提交上打 `v<version>` 并推送。`.github/workflows/publish.yaml` 分两步:`package` 不带 OIDC 权限,检查 tag 指向 `main` 的历史、和版本号一致、提交的 `lib/` 与源码构建一致,再测试并打包;`stage` 在受保护的 `npm-release` 环境里,核对拿到的正是打出来的那个包(SHA-256),关掉生命周期脚本后执行 `npm stage publish`。
156
- 3. 维护者用 `npm stage list` 找到这次暂存,再用 `npm stage approve <stage-id>`(需要 2FA)正式发布。
86
+ ## Members and administrators
157
87
 
158
- 一次性设置:GitHub 仓库里建 `npm-release` 环境(限定维护者审批、只允许受保护的 tag);npm 上给 `@dsh-teamwork/dsh-teamwork` 配置 Trusted Publisher,指向本仓库、`publish.yaml` 和 `npm-release` 环境。仓库变量 `PUBLISHING=off` 可暂停暂存。
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. |
159
93
 
160
- ## 许可证
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.
161
98
 
162
- Apache License 2.0(`LICENSE`)。名称“DSH Teamwork”和鲸鱼标志不随代码授权(`NOTICE`),派生项目需使用自己的名称和标志。
99
+ ![Administrator review of a demonstration preset submission](https://raw.githubusercontent.com/dsh-teamwork/dsh-teamwork/main/assets/readme/review-and-publish.png)
163
100
 
164
- ## Phone session configuration
101
+ ## Service and data
165
102
 
166
- Paired phones may choose an existing session folder and a registered native
167
- preset when creating a session. The bridge provides two narrowly scoped calls:
168
- `teamwork/configuration` reports the desktop's preset roster, team versions,
169
- dependency states and current session configuration; `teamwork/selectModel`
170
- changes a catalog model and optional advertised reasoning effort on an idle
171
- session. Native `session/selectModel` is no longer allowed for phones because
172
- it also saves the desktop default. Session-specific operations first pass the
173
- native admission check under the pairing's identity. Before forwarding a prompt,
174
- the bridge uses the same team, preset-version, plugin and tool readiness checks
175
- 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.
176
112
 
177
- The relay envelope is unchanged. Rebuild the plugin and mobile app together for
178
- these settings. This grants no new team permissions and exposes no credentials;
179
- phones remain paired to the same account's own DSH, across teams. The desktop
180
- 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.
181
116
 
182
- ## Verified phone encryption
117
+ ## Help and development
183
118
 
184
- The phone and desktop authenticate each other with pinned Ed25519 device
185
- identities over libp2p Noise XX. A six-letter, single-use code locates the
186
- computer; initial pairing requires comparing the eight-digit safety code on
187
- both screens, confirming on the phone, then approving on the desktop. A QR link
188
- also pins the desktop public key. Later connections use fresh handshakes and
189
- saved keys. Missing or changed keys require pairing again, with no plaintext
190
- 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)
191
123
 
192
- After authentication, each endpoint sends a fresh independent AES-256 sending
193
- key inside Noise. Messages and uploads then bypass Noise and use native
194
- AES-256-GCM: Node/OpenSSL on desktop and Expo Crypto on mobile. Each opaque
195
- `data` record authenticates its channel, sending direction and monotonic counter;
196
- replay, reordering, cipher failure or exhausted key budgets close the channel.
197
- The small Noise handshake remains JS; application payloads have no JS cipher
198
- fallback. Upgrade relay and both clients together. Saved verified device keys
199
- remain valid across this transport change.
124
+ ## License
200
125
 
201
- `src/secure-channel.ts` owns the wire and has an identical mobile copy checked
202
- by integration tests. `src/phone-security.ts` gates every bridge request on a
203
- locally saved device roster. The identity seed and account/server-scoped peers
204
- are atomically saved in `<cache>.phone-keys.json` with restrictive permissions.
205
- Desktop revocation closes the channel and saves trust removal before calling
206
- the relay. Phone revocation requires an encrypted desktop acknowledgement; an
207
- offline desktop must reconnect before it completes.
208
-
209
- The relay can see public keys, account/device metadata, timing and sizes, but
210
- cannot read encrypted methods, conversation content, tool data or uploads.
211
- Generic notifications omit session ids and question types. Local DSH storage
212
- and the hosted team-model gateway remain separate boundaries: model context
213
- still passes through that gateway. Update relay, plugin and mobile together.
214
-
215
- ## Phone file attachments
216
-
217
- Phones query upload limits through `teamwork/configuration`, then use four
218
- allow-listed calls: `teamwork/uploadStart`, `teamwork/uploadChunk`,
219
- `teamwork/uploadFinish` and `teamwork/uploadCancel`. Intake passes native
220
- session admission. Files can be staged while the agent is busy or the model
221
- is unavailable; readiness is enforced on a new prompt, not on file transfer.
222
- Phones transfer selected files immediately and submit completed receipts only
223
- when the member presses Send. Transfer ids and completed receipts are bound to
224
- the pairing and exact session, and chunks stream with backpressure
225
- to DSH's authenticated binary upload service. The relay envelope is unchanged.
226
-
227
- The initial budgets are five files per message, 20 MiB per file, 50 MiB total,
228
- 256 KiB raw chunks, one active transfer per pairing and two per host. Transfers
229
- expire after 60 seconds idle or five minutes total; completed plugin receipts
230
- expire after ten minutes. Detach, revocation and cancellation release transfer
231
- state. The plugin does not delete DSH's stored objects or workspace files.
232
-
233
- Prompts use native file receipts and stable request ids. An already-accepted
234
- request may reach native deduplication before the busy/readiness check; new
235
- work still passes all checks and validates its receipt metadata. This slice
236
- supports ordinary files, not image input or document extraction. Update the
237
- mobile app and plugin together. Build output under `lib/` is included.
238
-
239
- 预算由所选团队的服务端计算,插件底栏异步显示当前成员的积分剩余、Token 限额或待核实状态。切换资源团队不会改变正在使用的会话模型;模型和上游的其他限制仍由网关在请求时检查。读取失败显示“预算暂不可用”,不影响配置列表和同步。
240
-
241
-
242
- ## Team assistant and reviewed sharing
243
-
244
- New teams receive a built-in assistant that can inherit a local/session model.
245
- The assistant's tools bind operations to its active team, reuse server permissions,
246
- and require real host approval for mutations. They cover sync, configuration,
247
- usage/budgets, preset submissions, local plugin preparation/upload, review and
248
- historical restoration. Provider keys and account passwords use secure console forms.
249
-
250
- Members can submit new or updated presets/plugins on the platform's sharing page;
251
- administrators approve frozen revisions. Publication does not install a plugin.
252
- Private archives are downloaded through host authentication, verified by SHA-256,
253
- and installed disabled before the normal conflict checks and activation. Existing
254
- local installations remain protected; upgrades use the local plugin manager.
255
-
256
- Pinned preset dependencies survive catalog updates through historical plugin
257
- metadata. Use `/teamwork install <configId>@<version>` for an exact retained pin.
258
- The platform's history page supports comparison, backup export and restoration
259
- as a new reviewed publication. Existing conversations retain their preset version.
260
-
261
- Run `pnpm test:assistant` with `DSH_CLI` set as in the host-test instructions.
262
- It verifies model inheritance, team-bound tools, denied approval, authenticated
263
- archive download and real local-archive installation. Host tests isolate their
264
- 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.
@@ -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
+ [![npm](https://img.shields.io/npm/v/@dsh-teamwork/dsh-teamwork)](https://www.npmjs.com/package/@dsh-teamwork/dsh-teamwork)
8
+ [![CI](https://github.com/dsh-teamwork/dsh-teamwork/actions/workflows/ci.yml/badge.svg)](https://github.com/dsh-teamwork/dsh-teamwork/actions/workflows/ci.yml)
9
+ [![License: Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](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
+ ![真实 DSH 宿主中的 Teamwork 面板,使用本地演示团队](https://raw.githubusercontent.com/dsh-teamwork/dsh-teamwork/main/assets/readme/teamwork-panel.png)
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
+ ![管理员审核演示预设提交;网页可切换中文](https://raw.githubusercontent.com/dsh-teamwork/dsh-teamwork/main/assets/readme/review-and-publish.png)
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
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.
@@ -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
+ ![Publication history of a demonstration team](../../assets/readme/versions-and-backups.png)
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
+ ![演示团队的发布历史;网页可切换中文](../../assets/readme/versions-and-backups.png)
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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dsh-teamwork/dsh-teamwork",
3
- "version": "0.8.3",
4
- "description": "Team collaboration plugin for DeepSeek Harness",
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",
@@ -85,6 +89,21 @@
85
89
  "./client": "./lib/web/client.js",
86
90
  "./package.json": "./package.json"
87
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
+ ],
88
107
  "scripts": {
89
108
  "build": "tsc && node scripts/build-web.mjs",
90
109
  "watch": "tsc -w & node scripts/build-web.mjs --watch",
@@ -0,0 +1,5 @@
1
+ [
2
+ "assets/readme/teamwork-panel.png",
3
+ "assets/readme/review-and-publish.png",
4
+ "assets/readme/versions-and-backups.png"
5
+ ]