dsh-team-bots 0.0.0-stage → 0.2.338

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.
Files changed (168) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +14 -0
  3. package/README.md +49 -2
  4. package/cordis.patch.yml +3 -0
  5. package/docs/README.zh.md +50 -0
  6. package/docs/assets/channel-redesign.png +0 -0
  7. package/docs/assets/global-config-dark.png +0 -0
  8. package/docs/assets/global-config-light.png +0 -0
  9. package/docs/assets/global-config-light.zh.png +0 -0
  10. package/docs/assets/global-config-redesign.png +0 -0
  11. package/docs/assets/secrets-redesign.png +0 -0
  12. package/docs/assets/tasks.png +0 -0
  13. package/docs/assets/tasks.zh.png +0 -0
  14. package/docs/assets/usage-redesign-global.png +0 -0
  15. package/docs/assets/usage.png +0 -0
  16. package/docs/assets/usage.zh.png +0 -0
  17. package/index.js +41 -0
  18. package/package.json +68 -4
  19. package/scripts/doctor.mjs +125 -0
  20. package/src/api.js +252 -0
  21. package/src/botmsg.js +126 -0
  22. package/src/config.js +265 -0
  23. package/src/db-migrations.js +369 -0
  24. package/src/db.js +570 -0
  25. package/src/errors.js +18 -0
  26. package/src/http.js +350 -0
  27. package/src/paths.js +162 -0
  28. package/src/pricing.js +129 -0
  29. package/src/project-skills.js +118 -0
  30. package/src/runtime.js +48 -0
  31. package/src/secrets.js +242 -0
  32. package/src/seed-bots.js +124 -0
  33. package/src/service.js +111 -0
  34. package/src/services/approvals.js +338 -0
  35. package/src/services/attention-schema.js +60 -0
  36. package/src/services/backoff.js +92 -0
  37. package/src/services/bot-quota.js +242 -0
  38. package/src/services/bots.js +340 -0
  39. package/src/services/chat.js +440 -0
  40. package/src/services/core.js +315 -0
  41. package/src/services/file-policy.js +43 -0
  42. package/src/services/hygiene.js +168 -0
  43. package/src/services/locale.js +130 -0
  44. package/src/services/memory.js +546 -0
  45. package/src/services/message-images.js +251 -0
  46. package/src/services/mixin.js +9 -0
  47. package/src/services/model-fallback.js +122 -0
  48. package/src/services/notify.js +99 -0
  49. package/src/services/projects.js +661 -0
  50. package/src/services/proposals.js +307 -0
  51. package/src/services/questions.js +365 -0
  52. package/src/services/recovery-schema.js +32 -0
  53. package/src/services/review-watchdog.js +299 -0
  54. package/src/services/rollover-schema.js +26 -0
  55. package/src/services/run-finish.js +527 -0
  56. package/src/services/runs.js +667 -0
  57. package/src/services/runtime/lifecycle.js +367 -0
  58. package/src/services/runtime/model-restore.js +275 -0
  59. package/src/services/runtime/prompt.js +713 -0
  60. package/src/services/runtime/session.js +455 -0
  61. package/src/services/runtime/trajectory.js +135 -0
  62. package/src/services/scheduler.js +745 -0
  63. package/src/services/secrets.js +339 -0
  64. package/src/services/system.js +443 -0
  65. package/src/services/task-notify.js +119 -0
  66. package/src/services/task-relations.js +176 -0
  67. package/src/services/task-review.js +149 -0
  68. package/src/services/task-sandbox-schema.js +32 -0
  69. package/src/services/task-stage.js +58 -0
  70. package/src/services/tasks.js +881 -0
  71. package/src/services/terminal.js +176 -0
  72. package/src/services/usage.js +100 -0
  73. package/src/services/vision-proxy.js +196 -0
  74. package/src/services/wechat.js +319 -0
  75. package/src/services/workspace-groups.js +103 -0
  76. package/src/services/write-scopes.js +122 -0
  77. package/src/skill-parse.js +33 -0
  78. package/src/skills.js +302 -0
  79. package/src/tools.js +457 -0
  80. package/src/updater.js +161 -0
  81. package/src/usage-reconcile.js +269 -0
  82. package/src/usage.js +733 -0
  83. package/src/util.js +112 -0
  84. package/src/wechat/channel.js +500 -0
  85. package/src/wechat/commands.js +197 -0
  86. package/src/wechat/format.js +247 -0
  87. package/src/wechat/store.js +243 -0
  88. package/ui/app.js +798 -0
  89. package/ui/fonts/OFL.txt +92 -0
  90. package/ui/fonts/inter-400.woff2 +0 -0
  91. package/ui/fonts/inter-500.woff2 +0 -0
  92. package/ui/fonts/inter-600.woff2 +0 -0
  93. package/ui/i18n/en/chat.js +140 -0
  94. package/ui/i18n/en/common.js +189 -0
  95. package/ui/i18n/en/nav.js +90 -0
  96. package/ui/i18n/en/settings.js +354 -0
  97. package/ui/i18n/en/tasks.js +232 -0
  98. package/ui/i18n/en/usage.js +141 -0
  99. package/ui/i18n/en/wechat.js +24 -0
  100. package/ui/i18n/en.js +19 -0
  101. package/ui/i18n/zh/chat.js +140 -0
  102. package/ui/i18n/zh/common.js +189 -0
  103. package/ui/i18n/zh/nav.js +90 -0
  104. package/ui/i18n/zh/settings.js +354 -0
  105. package/ui/i18n/zh/tasks.js +232 -0
  106. package/ui/i18n/zh/usage.js +141 -0
  107. package/ui/i18n/zh/wechat.js +24 -0
  108. package/ui/i18n/zh.js +19 -0
  109. package/ui/index.html +27 -0
  110. package/ui/modules/api.js +117 -0
  111. package/ui/modules/bot-quota.js +27 -0
  112. package/ui/modules/cards.js +547 -0
  113. package/ui/modules/chat.js +460 -0
  114. package/ui/modules/composer.js +671 -0
  115. package/ui/modules/dom-morph.js +292 -0
  116. package/ui/modules/events-board.js +273 -0
  117. package/ui/modules/events-click.js +645 -0
  118. package/ui/modules/events-misc.js +306 -0
  119. package/ui/modules/events-submit.js +256 -0
  120. package/ui/modules/global-pages.js +157 -0
  121. package/ui/modules/i18n.js +49 -0
  122. package/ui/modules/icons.js +42 -0
  123. package/ui/modules/markdown.js +116 -0
  124. package/ui/modules/modal-forms.js +791 -0
  125. package/ui/modules/modal-layer.js +172 -0
  126. package/ui/modules/page-shell.js +62 -0
  127. package/ui/modules/settings.js +447 -0
  128. package/ui/modules/solo-archive.js +13 -0
  129. package/ui/modules/state.js +153 -0
  130. package/ui/modules/tasks.js +778 -0
  131. package/ui/modules/typing-linger.js +270 -0
  132. package/ui/modules/usage.js +373 -0
  133. package/ui/modules/util.js +241 -0
  134. package/ui/styles/a11y.css +37 -0
  135. package/ui/styles/avatars.css +68 -0
  136. package/ui/styles/base.css +326 -0
  137. package/ui/styles/boot.css +46 -0
  138. package/ui/styles/buttons.css +194 -0
  139. package/ui/styles/cards.css +331 -0
  140. package/ui/styles/chat-cards.css +435 -0
  141. package/ui/styles/chat-composer.css +245 -0
  142. package/ui/styles/chat-images.css +705 -0
  143. package/ui/styles/chat.css +370 -0
  144. package/ui/styles/frame.css +347 -0
  145. package/ui/styles/global-config.css +259 -0
  146. package/ui/styles/main.css +142 -0
  147. package/ui/styles/modal.css +301 -0
  148. package/ui/styles/settings.css +233 -0
  149. package/ui/styles/surfaces.css +106 -0
  150. package/ui/styles/tasks.css +580 -0
  151. package/ui/styles/terminal.css +398 -0
  152. package/ui/styles/toast.css +40 -0
  153. package/ui/styles/usage.css +309 -0
  154. package/ui/styles/wide.css +501 -0
  155. package/vendor/dompurify/LICENSE +568 -0
  156. package/vendor/dompurify/NOTICE +6 -0
  157. package/vendor/dompurify/package.json +171 -0
  158. package/vendor/dompurify/purify.min.js +3 -0
  159. package/vendor/marked/LICENSE +44 -0
  160. package/vendor/marked/NOTICE +5 -0
  161. package/vendor/marked/marked.umd.js +2604 -0
  162. package/vendor/marked/package.json +111 -0
  163. package/vendor/qrcode/NOTICE +5 -0
  164. package/vendor/qrcode/package.json +30 -0
  165. package/vendor/qrcode/qrcode.js +2298 -0
  166. package/vendor/wechat-ilink/LICENSE.tencent-openclaw-weixin +26 -0
  167. package/vendor/wechat-ilink/NOTICE +12 -0
  168. package/vendor/wechat-ilink/index.js +1383 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,14 @@
1
+ DSH Team Bots
2
+ Copyright 2026 DSH Team Bots contributors
3
+
4
+ This product is licensed under the Apache License, Version 2.0 (see LICENSE).
5
+
6
+ Architecture and DSH integration were informed by:
7
+ - DS Bot, Copyright 2026 Fei2411 and the DS Bot contributors, Apache-2.0
8
+ https://github.com/Fei2411/DS-Bot
9
+ - Cindy, Copyright Cindy contributors, Apache-2.0
10
+ https://github.com/makecindy/cindy
11
+
12
+ Runtime dependency:
13
+ - DeepSeek Harness (DSH), Copyright (c) 2026 DeepSeek, MIT License
14
+ https://github.com/deepseek-ai/deepseek-harness
package/README.md CHANGED
@@ -1,3 +1,50 @@
1
- # Temporary Holding Version
1
+ # DSH Team Bots
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [中文](docs/README.zh.md)
4
+
5
+ DSH Team Bots is the npm package `dsh-team-bots`, a DSH (DeepSeek Harness) plugin that packs a collaborating crew of bots into one workspace: project group chats, a task board, write-scope parallel scheduling, memory and skills, usage and cost, plus a personal WeChat channel. Every run keeps a trajectory, duration, token count and cost.
6
+
7
+ ![DSH Team Bots workspace](docs/assets/tasks.png)
8
+
9
+ ## Install
10
+
11
+ Node.js ≥ 22.19 and the DSH CLI are required; the plugin runs inside the DSH Web process — no standalone service or port.
12
+
13
+ ```sh
14
+ dsh plugin --profile <name> add dsh-team-bots
15
+ dsh --profile <name> # read the tokenised dsh web entry from the startup log
16
+ ```
17
+
18
+ The package resolves from the npm registry, so no `npm pack` or local tarball is needed; `npm run profile:install -- --profile <name>` does the same from a checkout.
19
+
20
+ ## Start
21
+
22
+ ```text
23
+ http://<host>:<port>/ auto-login, straight into the team workspace
24
+ http://<host>:<port>/api/dsh-team/ui the DSH Team Bots workspace (direct)
25
+ http://<host>:<port>/index.html the native DSH web UI
26
+ ```
27
+
28
+ The first visit to the home page exchanges the current startup token for a 30-day login cookie. Auto-login means **anyone who can reach the port becomes owner**, so listen on the local machine or a trusted network; public exposure needs an HTTPS reverse proxy that forwards Host and WebSocket correctly.
29
+
30
+ ## Configuration
31
+
32
+ The two paths that matter are `DSH_TEAM_WORKSPACE` (team workspace root, default `~/.dsh/workspace/team-bots`) and `DSH_TEAM_DATA` (team database and run records, default `<workspace>/.data`); every other variable, its default and its resolution order (explicit env > value saved on the page > code default) live in `src/config.ts`.
33
+
34
+ Data under `DSH_TEAM_DATA` includes `team.sqlite`, `wechat-channel.sqlite`, `secret.key`, `memory/`, `messages/` and `secrets-runtime/` (burned on TTL expiry). Back up `secret.key` together with the data — without it the existing ciphertext cannot be decrypted.
35
+
36
+ A template for the common variables lives in `.env.example`; **do not put a `.env` file in the repository root**, because that would leak `DSH_*` into `npm test` and `npm run dev`. Plugin files inside a profile are a snapshot: after changing code, reinstall or the page sticks at "connecting to the team space".
37
+
38
+ ## Screenshots
39
+
40
+ Usage stats carry the summary window, the last 14 days of detail, a per-model / per-bot / per-project breakdown and a CSV export:
41
+
42
+ ![Usage stats](docs/assets/usage.png)
43
+
44
+ The global configuration page keeps only the core groups; channels, secrets, version status and pricing rules live on their own top-level pages:
45
+
46
+ ![Global configuration](docs/assets/global-config-light.png)
47
+
48
+ ## License
49
+
50
+ Apache-2.0, see `LICENSE` and `NOTICE`.
@@ -0,0 +1,3 @@
1
+ - insert:
2
+ - id: dsh-team-bots
3
+ name: dsh-team-bots
@@ -0,0 +1,50 @@
1
+ # DSH Team Bots
2
+
3
+ [English](../README.md)
4
+
5
+ DSH Team Bots 是 npm 包 `dsh-team-bots`,一个 DSH(DeepSeek Harness)插件,把一整个协作的 bot 团队装进同一个工作区:项目群聊、任务板、按写范围并行调度、记忆与技能、用量与成本,外加一条个人微信通道。每个 run 都保留轨迹、时长、token 数和成本。
6
+
7
+ ![DSH Team Bots 工作区](assets/tasks.zh.png)
8
+
9
+ ## 安装
10
+
11
+ 需要 Node.js ≥ 22.19 与 DSH CLI;插件跑在 DSH Web 进程里 —— 没有独立服务与端口。
12
+
13
+ ```sh
14
+ dsh plugin --profile <name> add dsh-team-bots
15
+ dsh --profile <name> # 从启动日志里读带 token 的 dsh web 入口
16
+ ```
17
+
18
+ 包从 npm registry 解析,不需要 `npm pack` 或本地 tarball;在仓库里用 `npm run profile:install -- --profile <name>` 等价。
19
+
20
+ ## 启动
21
+
22
+ ```text
23
+ http://<host>:<port>/ 自动登录,直接进入团队工作区
24
+ http://<host>:<port>/api/dsh-team/ui DSH Team Bots 工作区(直达)
25
+ http://<host>:<port>/index.html DSH 原生 Web UI
26
+ ```
27
+
28
+ 首次访问首页会用当前启动 token 换一张 30 天登录 cookie。自动登录意味着**任何能访问到端口的人都是 owner**,所以请只监听本机或可信网络;要公网暴露,需要一个正确转发 Host 与 WebSocket 的 HTTPS 反向代理。
29
+
30
+ ## 配置要点
31
+
32
+ 真正要紧的两个路径是 `DSH_TEAM_WORKSPACE`(团队工作区根目录,缺省 `~/.dsh/workspace/team-bots`)和 `DSH_TEAM_DATA`(团队数据库与 run 记录,缺省 `<workspace>/.data`);其余变量、缺省值和解析顺序(显式 env > 页面保存值 > 代码缺省)都在 `src/config.ts`。
33
+
34
+ `DSH_TEAM_DATA` 下的数据包括 `team.sqlite`、`wechat-channel.sqlite`、`secret.key`、`memory/`、`messages/` 和 `secrets-runtime/`(TTL 到期即焚)。备份时请把 `secret.key` 一起带走 —— 没有它,已有的密文永远解不开。
35
+
36
+ 常用变量的模板在 `.env.example`;**不要把 `.env` 放在仓库根目录**,否则 `DSH_*` 会漏进 `npm test` 和 `npm run dev`。profile 里的插件文件是快照:改了代码必须重装,否则页面会卡在「connecting to the team space」。
37
+
38
+ ## 截图
39
+
40
+ 用量统计带汇总窗口、最近 14 天明细、按模型 / 按 bot / 按项目拆分和 CSV 导出:
41
+
42
+ ![用量统计](assets/usage.zh.png)
43
+
44
+ 全局配置页只保留核心分组;通道、密钥、版本状态与价格规则在各自的一级页:
45
+
46
+ ![全局配置](assets/global-config-light.zh.png)
47
+
48
+ ## License
49
+
50
+ Apache-2.0,见 `LICENSE` 与 `NOTICE`。
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/index.js ADDED
@@ -0,0 +1,41 @@
1
+ import { resolveConfig } from './src/config.js'
2
+ import { openDatabase } from './src/db.js'
3
+ import { installHttp } from './src/http.js'
4
+ import { DshRuntime } from './src/runtime.js'
5
+ import { TeamService } from './src/service.js'
6
+ import { installSkillProvider } from './src/skills.js'
7
+ import { installTeamTools } from './src/tools.js'
8
+
9
+ export const name = 'dsh-team-bots'
10
+ export const inject = ['llm', 'tools', 'systemPrompt', 'sessionController', 'sessionTitle', 'connection', 'webServer']
11
+
12
+ export function apply(ctx, config = {}) {
13
+ const resolved = resolveConfig(config)
14
+ const logger = {
15
+ info: (...args) => console.log('[dsh-team]', ...args),
16
+ warn: (...args) => console.warn('[dsh-team]', ...args),
17
+ error: (...args) => console.error('[dsh-team]', ...args),
18
+ }
19
+ const store = openDatabase(resolved.dbPath)
20
+ const service = new TeamService({ store, config: resolved, logger })
21
+ const runtime = new DshRuntime({ ctx, config: resolved, store, logger })
22
+ service.attachRuntime(runtime)
23
+ runtime.attach()
24
+ installTeamTools(ctx, service)
25
+ installSkillProvider(ctx, resolved, logger, store)
26
+ installHttp(ctx, service, logger)
27
+
28
+ ctx.effect?.(() => () => {
29
+ service.stop()
30
+ store.close()
31
+ }, 'dsh-team: shutdown')
32
+
33
+ const boot = service.initialize().then(() => {
34
+ service.start()
35
+ logger.info('ready: workspace=%s data=%s', resolved.workspace, resolved.dataDir)
36
+ }).catch(error => {
37
+ logger.error('startup failed: %s', error?.stack ?? error)
38
+ })
39
+ service.boot = boot
40
+ return { service, runtime, store }
41
+ }
package/package.json CHANGED
@@ -1,6 +1,70 @@
1
1
  {
2
2
  "name": "dsh-team-bots",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.338",
4
+ "description": "Project spaces, group chats, task boards, memory and usage for teams of DSH bots",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/8kugames/dsh-team-bots.git"
8
+ },
9
+ "homepage": "https://github.com/8kugames/dsh-team-bots#readme",
10
+ "bugs": {
11
+ "url": "https://github.com/8kugames/dsh-team-bots/issues"
12
+ },
13
+ "license": "Apache-2.0",
14
+ "type": "module",
15
+ "main": "index.js",
16
+ "engines": {
17
+ "node": ">=22.19"
18
+ },
19
+ "files": [
20
+ "index.js",
21
+ "src/",
22
+ "!src/**/*.ts",
23
+ "scripts/doctor.mjs",
24
+ "ui/",
25
+ "!ui/**/*.ts",
26
+ "vendor/",
27
+ "cordis.patch.yml",
28
+ "README.md",
29
+ "docs/README.zh.md",
30
+ "docs/assets/",
31
+ "NOTICE",
32
+ "LICENSE"
33
+ ],
34
+ "devDependencies": {
35
+ "@types/node": "26.6.6",
36
+ "typescript": "6.0.3"
37
+ },
38
+ "scripts": {
39
+ "build": "node scripts/build.mjs",
40
+ "typecheck": "tsc -p tsconfig.json",
41
+ "pretest": "npm run build",
42
+ "test": "node --test \"tests/*.test.js\" \"scripts/*.test.js\"",
43
+ "release": "node scripts/release.mjs",
44
+ "predev": "npm run build",
45
+ "dev": "node scripts/dev-server.mjs",
46
+ "prestart": "npm run build",
47
+ "start": "node scripts/dev-server.mjs",
48
+ "prepack": "npm run build",
49
+ "doctor": "node scripts/doctor.mjs",
50
+ "profile:install": "node scripts/install-profile.mjs",
51
+ "verify:agent-team": "node scripts/verify-agent-team.mjs",
52
+ "backup": "node scripts/backup.mjs",
53
+ "restore-check": "node scripts/restore-check.mjs",
54
+ "load-test": "node scripts/load-test.mjs",
55
+ "fault-test": "node scripts/fault-test.mjs"
56
+ },
57
+ "keywords": [
58
+ "dsh-plugin",
59
+ "deepseek-harness",
60
+ "dsh",
61
+ "bots",
62
+ "team",
63
+ "tasks"
64
+ ],
65
+ "dsh": {
66
+ "bundle": {
67
+ "patch": "./cordis.patch.yml"
68
+ }
69
+ }
70
+ }
@@ -0,0 +1,125 @@
1
+ // Diagnostics for path and permission problems. It prints the resolved layout
2
+ // and reports anything that would stop the service from writing to its own
3
+ // directories.
4
+ import { accessSync, constants, existsSync, lstatSync, readFileSync, realpathSync, statSync } from 'node:fs'
5
+ import { spawnSync } from 'node:child_process'
6
+ import { homedir } from 'node:os'
7
+ import { join, resolve } from 'node:path'
8
+ import { pathToFileURL } from 'node:url'
9
+ import { resolveConfig } from '../src/config.js'
10
+
11
+ // Absolute filesystem paths referenced by a dsh patch (the global
12
+ // ~/.dsh/cordis.patch.yml registers MCP runtimes this way). Returns unique
13
+ // paths in order of first appearance. Comment lines are ignored; scoped
14
+ // package names, URLs and single-segment paths are not host references.
15
+ export function extractHostRefs(text) {
16
+ const body = String(text)
17
+ .split(/^/m)
18
+ .filter(line => !/^\s*#/.test(line))
19
+ .join('')
20
+ const refs = []
21
+ const pattern = /(^|[\s"'`,\[])(\/[A-Za-z0-9._@+-]+(?:\/[A-Za-z0-9._@+-]+)+)/g
22
+ for (const match of body.matchAll(pattern)) {
23
+ if (!refs.includes(match[2])) refs.push(match[2])
24
+ }
25
+ return refs
26
+ }
27
+
28
+ const describe = path => {
29
+ let entry
30
+ try {
31
+ entry = lstatSync(path)
32
+ } catch (error ) {
33
+ if (error.code === 'ENOENT') return { label: 'missing', dir: false, target: null }
34
+ return { label: error.code === 'ELOOP' ? 'broken symlink loop' : (error.code ?? 'error'), dir: false, target: null }
35
+ }
36
+ if (entry.isSymbolicLink()) {
37
+ try {
38
+ const target = realpathSync(path)
39
+ const targetEntry = statSync(target)
40
+ return {
41
+ label: targetEntry.isDirectory()
42
+ ? `symlink -> ${target}`
43
+ : `symlink -> ${target} (not a directory)`,
44
+ dir: targetEntry.isDirectory(),
45
+ target,
46
+ }
47
+ } catch (error ) {
48
+ return {
49
+ label: error.code === 'ELOOP' ? 'broken symlink loop' : `dangling symlink (${error.code ?? 'error'})`,
50
+ dir: false,
51
+ target: null,
52
+ }
53
+ }
54
+ }
55
+ if (entry.isDirectory()) return { label: 'directory', dir: true, target: path }
56
+ return { label: 'file', dir: false, target: path }
57
+ }
58
+
59
+ const writable = path => {
60
+ try {
61
+ accessSync(path, constants.W_OK)
62
+ return true
63
+ } catch {
64
+ return false
65
+ }
66
+ }
67
+
68
+ function main() {
69
+ const config = resolveConfig()
70
+ const targets = [
71
+ ['DSH home', config.dshHome, true],
72
+ ['workspace', config.workspace, false],
73
+ ['data dir', config.dataDir, false],
74
+ ['skill pool', config.skillRoot, false],
75
+ ['skill dir', `${config.skillRoot}/skills`, false],
76
+ ]
77
+
78
+ console.log(`node ${process.versions.node} uid=${process.getuid?.() ?? 'n/a'} gid=${process.getgid?.() ?? 'n/a'} home=${homedir()}`)
79
+
80
+ const dsh = spawnSync('dsh', ['--version'], { encoding: 'utf8' })
81
+ const dshVersion = dsh.status === 0 ? String(dsh.stdout).trim() : ((dsh.error )?.code === 'ENOENT' ? 'not installed' : 'unknown')
82
+ console.log(`dsh ${dshVersion}`)
83
+ console.log('')
84
+
85
+ let problems = 0
86
+ for (const [label, path, optional] of targets) {
87
+ const info = describe(path)
88
+ const canWrite = info.dir ? writable(info.target ?? path) : false
89
+ const ok = info.dir && canWrite
90
+ if (!ok && !optional) problems += 1
91
+ console.log(`${label.padEnd(11)} ${path}`)
92
+ console.log(`${''.padEnd(11)} ${info.label}${ok ? ', writable' : info.dir ? ', NOT writable' : ''}${optional && !ok ? ' (optional)' : ''}`)
93
+ }
94
+
95
+ // Host capability bridge: every absolute path the global patch references
96
+ // must resolve here, or the bundle it configures (typically an MCP client)
97
+ // fails to activate on every start.
98
+ const patchFile = join(config.dshHome, 'cordis.patch.yml')
99
+ if (existsSync(patchFile)) {
100
+ const refs = extractHostRefs(readFileSync(patchFile, 'utf8'))
101
+ console.log('')
102
+ console.log(`host refs ${patchFile}`)
103
+ if (refs.length === 0) {
104
+ console.log(`${''.padEnd(11)} none (no absolute paths referenced)`)
105
+ }
106
+ for (const ref of refs) {
107
+ const ok = existsSync(ref)
108
+ if (!ok) problems += 1
109
+ console.log(`${''.padEnd(11)} ${ok ? 'ok ' : 'MISSING '} ${ref}`)
110
+ }
111
+ if (refs.some(ref => !existsSync(ref))) {
112
+ console.log(`${''.padEnd(11)} fix the entry so the path exists on this machine, or remove it from the patch file`)
113
+ }
114
+ }
115
+
116
+ console.log('')
117
+ console.log(problems === 0
118
+ ? 'ok: all team directories exist and are writable'
119
+ : `${problems} problem(s); see README "故障排查"`)
120
+ process.exit(problems === 0 ? 0 : 1)
121
+ }
122
+
123
+ const invokedDirectly = process.argv[1]
124
+ && import.meta.url === pathToFileURL(resolve(process.argv[1])).href
125
+ if (invokedDirectly) main()