@thewaifu/dsh-bot 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +304 -0
- package/bin/dsh-bot-web.js +33 -0
- package/client.js +13691 -0
- package/cordis.patch.yml +17 -0
- package/index.js +57 -0
- package/package.json +80 -0
- package/src/host/agents.js +186 -0
- package/src/host/approvals.js +63 -0
- package/src/host/browser.js +258 -0
- package/src/host/channel.js +342 -0
- package/src/host/chat-index.js +293 -0
- package/src/host/connectors.js +169 -0
- package/src/host/constants.js +65 -0
- package/src/host/delivery.js +71 -0
- package/src/host/diagnostics.js +249 -0
- package/src/host/dsh-compat.js +22 -0
- package/src/host/dsh-update.js +170 -0
- package/src/host/groups.js +592 -0
- package/src/host/home-lock.js +97 -0
- package/src/host/images.js +211 -0
- package/src/host/memory.js +1362 -0
- package/src/host/models.js +231 -0
- package/src/host/parts.js +976 -0
- package/src/host/permissions.js +48 -0
- package/src/host/prompt.js +71 -0
- package/src/host/roster.js +471 -0
- package/src/host/schedules.js +151 -0
- package/src/host/secrets.js +530 -0
- package/src/host/steward.js +164 -0
- package/src/host/store.js +344 -0
- package/src/host/text.js +47 -0
- package/src/host/time-context.js +46 -0
- package/src/host/tools.js +425 -0
- package/src/host/turns.js +388 -0
- package/src/host/update.js +237 -0
- package/src/host/usage.js +591 -0
- package/src/host/waifu.js +58 -0
- package/src/shared/mentions.js +65 -0
- package/src/shared/web-port.js +26 -0
- package/web-search.js +764 -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/README.md
ADDED
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
# @thewaifu/dsh-bot
|
|
2
|
+
|
|
3
|
+
DS Bot turns DeepSeek Harness (DSH) Web and Desktop into a persistent team of AI Bots. Each Bot has its own model, role, instructions, memory, chat history, and working session. Bots can work independently, message one another, and collaborate in group chats without mixing their private conversations.
|
|
4
|
+
|
|
5
|
+
This guide is for people installing and using the plugin. Contributor instructions are in the repository's [CONTRIBUTING.md](https://github.com/Fei2411/DeepSeek-Bot/blob/main/CONTRIBUTING.md).
|
|
6
|
+
|
|
7
|
+
## What you get
|
|
8
|
+
|
|
9
|
+
- A Main Bot named Chief on first launch.
|
|
10
|
+
- Multiple long-lived Bots with separate models, roles, instructions, and appearances.
|
|
11
|
+
- Group chats with an administrator, configurable reply behavior, `@Name`, and `@all` mentions.
|
|
12
|
+
- Bot-to-Bot messages, shared references, memory, scheduled tasks, usage reports, and secret handling.
|
|
13
|
+
- Model selection from every provider installed in the same DSH profile.
|
|
14
|
+
- Optional browser tools in DSH Desktop.
|
|
15
|
+
- Optional voice input and a Waifu TTS connection status, authorization, and test control.
|
|
16
|
+
|
|
17
|
+
## Requirements
|
|
18
|
+
|
|
19
|
+
- Node.js `^22.19.0` or `>=24.0.0`.
|
|
20
|
+
- DeepSeek Harness `>=0.1.5-rc.1`.
|
|
21
|
+
- A working DSH `web` or `desktop` profile.
|
|
22
|
+
- At least one configured model provider before a Bot can answer with an AI model.
|
|
23
|
+
|
|
24
|
+
Run these checks if you are not sure what is installed:
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
node --version
|
|
28
|
+
dsh --version
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Install in DSH Web
|
|
32
|
+
|
|
33
|
+
Install version `1.1.1` from the public npm registry:
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
dsh plugin --profile web add @thewaifu/dsh-bot@1.1.1 --registry=https://registry.npmjs.org/
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Start or restart the Web profile with the DS Bot launcher:
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
dsh plugin --profile web exec dsh-bot-web
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The launcher tries `127.0.0.1:3082` first. If that port is occupied, it tries `3083`, `3084`, and so on until it finds a free port, then starts the official `dsh web` command with that port. Open the address printed by DSH; DS Bot appears in the left sidebar.
|
|
46
|
+
|
|
47
|
+
Use `dsh web --port <port>` instead when you want one exact port with no automatic fallback.
|
|
48
|
+
|
|
49
|
+
## Install in DSH Desktop
|
|
50
|
+
|
|
51
|
+
Install the plugin into the Desktop profile:
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
dsh plugin --profile desktop add @thewaifu/dsh-bot@1.1.1 --registry=https://registry.npmjs.org/
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Quit DSH Desktop completely and open it again. Installing into `web` does not install the plugin into `desktop`; profiles are separate.
|
|
58
|
+
|
|
59
|
+
## Install with OH-MY-DSH
|
|
60
|
+
|
|
61
|
+
Install OH-MY-DSH first, then add DS Bot to the same `web` profile:
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
curl -fsSL https://thewaifu.ai/waifu-install.sh | sh
|
|
65
|
+
dsh plugin --profile web add @thewaifu/dsh-bot@1.1.1 --registry=https://registry.npmjs.org/
|
|
66
|
+
dsh plugin --profile web exec dsh-bot-web
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Upgrade from an older package name
|
|
70
|
+
|
|
71
|
+
Earlier builds may be installed as `ds-bot` or `dsh-bot`. Do not keep both the old package and `@thewaifu/dsh-bot` in one profile because they register the same `bot` plugin ID.
|
|
72
|
+
|
|
73
|
+
First list the profile dependencies:
|
|
74
|
+
|
|
75
|
+
```sh
|
|
76
|
+
dsh plugin --profile web list --depth=0
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Remove only the old name that appears in that list, then install the scoped package:
|
|
80
|
+
|
|
81
|
+
```sh
|
|
82
|
+
dsh plugin --profile web remove ds-bot
|
|
83
|
+
dsh plugin --profile web add @thewaifu/dsh-bot@1.1.1 --registry=https://registry.npmjs.org/
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Use `dsh-bot` instead of `ds-bot` in the remove command when that is the installed legacy name. Restart DSH afterward. The runtime plugin ID and data layout have not changed, so the existing team, chats, preferences, and secrets remain available.
|
|
87
|
+
|
|
88
|
+
## First-run setup
|
|
89
|
+
|
|
90
|
+
1. Open **DS Bot** in the left sidebar.
|
|
91
|
+
2. Open Chief. A new Chief has no model until you choose one.
|
|
92
|
+
3. Select a provider and model on the model card in the chat.
|
|
93
|
+
4. Send a short test message and confirm the answer is generated by the selected model.
|
|
94
|
+
5. Open **DS Bot settings > Bots** to change Chief's name, role, instructions, model, character, and color.
|
|
95
|
+
6. Create additional Bots for distinct jobs such as coding, review, writing, or research.
|
|
96
|
+
7. Open **DS Bot settings > Group chats** to create a group with at least two Bots.
|
|
97
|
+
|
|
98
|
+
Main Bots can create, change, and remove other Bots. A group administrator can change its own group and invite members to answer. Ordinary members can work in the group but cannot manage the whole team.
|
|
99
|
+
|
|
100
|
+
## Providers and models
|
|
101
|
+
|
|
102
|
+
DS Bot does not create model credentials or duplicate DSH's provider configuration. It reads the live model catalog from the current DSH profile.
|
|
103
|
+
|
|
104
|
+
To choose or change a model:
|
|
105
|
+
|
|
106
|
+
1. Open the Bot's chat and use the model selector in its header, or open **DS Bot settings > Bots** and select the Bot.
|
|
107
|
+
2. Choose a provider.
|
|
108
|
+
3. Choose one of that provider's available models.
|
|
109
|
+
4. Send a new message to verify the route.
|
|
110
|
+
|
|
111
|
+
Each Bot may use a different model. Existing messages keep the output that was originally generated; changing a model does not rewrite chat history.
|
|
112
|
+
|
|
113
|
+
### Token Factory models
|
|
114
|
+
|
|
115
|
+
When `@thewaifu/dsh-token-factory` is installed and connected in the same profile, its available routes appear in DS Bot's model selector. Available routes may include:
|
|
116
|
+
|
|
117
|
+
- `tw-helixtoken/deepseek-v4-flash`
|
|
118
|
+
- `tw-helixtoken/helix-cheap`
|
|
119
|
+
- `tw-helixtoken/helix-auto`
|
|
120
|
+
|
|
121
|
+
If these routes are missing:
|
|
122
|
+
|
|
123
|
+
1. Open the Token Factory page and confirm the account status and quota.
|
|
124
|
+
2. Confirm Token Factory is installed in the same `web` profile as DS Bot.
|
|
125
|
+
3. Restart `dsh web` after installing or updating provider plugins.
|
|
126
|
+
4. Reopen the Bot and refresh its model selector.
|
|
127
|
+
|
|
128
|
+
The model name must be selected on the Bot itself. Merely installing Token Factory does not automatically replace a Bot's current model.
|
|
129
|
+
|
|
130
|
+
## Create and use Bots
|
|
131
|
+
|
|
132
|
+
Open **DS Bot settings > Bots** and choose **Create Bot**. Set a clear role and concise instructions. A useful team gives each Bot a distinct responsibility instead of giving every Bot the same prompt.
|
|
133
|
+
|
|
134
|
+
In a direct Bot chat:
|
|
135
|
+
|
|
136
|
+
- Send a normal message to that Bot.
|
|
137
|
+
- Type `@` to reference another Bot when collaboration is needed.
|
|
138
|
+
- Use the reference control beside the composer to attach a relevant Bot chat.
|
|
139
|
+
- Open the Bot details to inspect its role, model, memory, and available browser panel.
|
|
140
|
+
|
|
141
|
+
Bot-to-Bot work is shown in the exchange transcript. It does not replace the visible conversation you opened.
|
|
142
|
+
|
|
143
|
+
## Group chats
|
|
144
|
+
|
|
145
|
+
Create a group from **DS Bot settings > Group chats**. Choose an administrator first, add at least one more member, then optionally set a name and a shared notice.
|
|
146
|
+
|
|
147
|
+
There are two reply modes:
|
|
148
|
+
|
|
149
|
+
| Mode | Behavior |
|
|
150
|
+
|---|---|
|
|
151
|
+
| **Admin leads** | A plain message goes to the administrator. The administrator can call other members with `@Name`. |
|
|
152
|
+
| **Everyone** | Every member answers in order, with the administrator first. |
|
|
153
|
+
|
|
154
|
+
Mentions override the default mode:
|
|
155
|
+
|
|
156
|
+
- `@Writer` asks Writer to answer.
|
|
157
|
+
- `@all`, `@everyone`, `所有人`, or `全体` asks every member to answer.
|
|
158
|
+
- Type `@` in the composer to choose a valid member instead of relying on spelling.
|
|
159
|
+
|
|
160
|
+
Each group member speaks through a hidden DSH Session dedicated to that group. This separation is intentional: group context must not leak into the Bot's private chat. While members answer, the visible selection should stay on the group. If the UI jumps into a member's private chat, update to this release, restart DSH, and hard-refresh the browser so an old client bundle is not cached.
|
|
161
|
+
|
|
162
|
+
## Voice input and Waifu TTS
|
|
163
|
+
|
|
164
|
+
DS Bot exposes two different voice paths:
|
|
165
|
+
|
|
166
|
+
1. **DS Bot voice chat** records your microphone, transcribes your speech, sends it as a normal message, and reads the answer with the browser's speech synthesis. It is available in direct Bot chats, not group chats. When DSH's Voice Input bundle is installed, DS Bot uses its local recognizer; otherwise it uses browser speech recognition when available.
|
|
167
|
+
2. **Waifu TTS** belongs to `@thewaifu/dsh-waifu`. DS Bot shows its connection state and can ask Waifu to play a real test line through the selected character voice. It does not replace the browser voice used by DS Bot voice chat.
|
|
168
|
+
|
|
169
|
+
To connect Waifu TTS:
|
|
170
|
+
|
|
171
|
+
1. Confirm `@thewaifu/dsh-waifu` is installed in the same DSH profile and the Waifu companion is running.
|
|
172
|
+
2. Open **DS Bot settings > Connectors > Waifu TTS**.
|
|
173
|
+
3. Select **Connect**. Complete the authorization page that opens in the browser.
|
|
174
|
+
4. Return to DS Bot and wait for the status to become connected.
|
|
175
|
+
5. Select **Test voice**. The companion should say, "DS Bot voice test is ready."
|
|
176
|
+
|
|
177
|
+
If an authorization page says that the link is invalid, expired, or already used, return to **Waifu TTS** and select **New link** or **Reconnect**. Always use the newest page. If no page opens, allow pop-ups or external links for the local DSH page, then try again.
|
|
178
|
+
|
|
179
|
+
The connector deliberately does not return authorization URLs, device codes, credentials, or tokens to the DS Bot browser UI.
|
|
180
|
+
|
|
181
|
+
## Memory, schedules, usage, and secrets
|
|
182
|
+
|
|
183
|
+
### Memory
|
|
184
|
+
|
|
185
|
+
Each Bot has private long-term memory and the team has shared memory. Open a Bot's details and select **Memory** to review, search, update, or remove entries. Memory rejects values that look like credentials or identity numbers.
|
|
186
|
+
|
|
187
|
+
### Scheduled tasks
|
|
188
|
+
|
|
189
|
+
Open **DS Bot settings > Scheduled tasks** to create recurring work for a Bot or group. Review the selected target and model before enabling a schedule.
|
|
190
|
+
|
|
191
|
+
### Usage
|
|
192
|
+
|
|
193
|
+
Open **DS Bot settings > Usage** to inspect token counts by time, Bot, group, and model. Usage is a token report, not a currency or invoice report.
|
|
194
|
+
|
|
195
|
+
### Secrets
|
|
196
|
+
|
|
197
|
+
When a Bot needs a credential, it can show a secret request card in its direct chat. The value is stored outside the conversation and is masked before tool results or prompts are saved. Secret cards are not shown in group chats.
|
|
198
|
+
|
|
199
|
+
Treat backups of `<DSH_HOME>/bot/secrets.json` like passwords. Do not put real credentials in a group message, Bot instructions, the repository, or a troubleshooting screenshot.
|
|
200
|
+
|
|
201
|
+
## Optional configuration
|
|
202
|
+
|
|
203
|
+
DS Bot works without a custom configuration. To override an option, add or update the `bot` entry in the profile's `cordis.patch.yml`:
|
|
204
|
+
|
|
205
|
+
```yaml
|
|
206
|
+
- id: bot
|
|
207
|
+
name: '@thewaifu/dsh-bot'
|
|
208
|
+
config:
|
|
209
|
+
workspace: /path/to/bot-workspace
|
|
210
|
+
home: /path/to/bot-data
|
|
211
|
+
checkRatio: 0.8
|
|
212
|
+
browser: true
|
|
213
|
+
memory: true
|
|
214
|
+
memoryReview: true
|
|
215
|
+
updateCheck: true
|
|
216
|
+
github: false
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
`workspace` controls where Bots work. `home` controls where DS Bot stores its team data. Set paths that the DSH process can read and write. Restart DSH after changing the profile patch.
|
|
220
|
+
|
|
221
|
+
The package also installs `@thewaifu/dsh-bot/web-search` and selects its `auto` search provider. A profile-level `searchProvider` override still takes precedence.
|
|
222
|
+
|
|
223
|
+
## Data and backups
|
|
224
|
+
|
|
225
|
+
By default, DS Bot stores team data under `$DSH_HOME/bot`. If `DSH_HOME` is not set, the usual locations are:
|
|
226
|
+
|
|
227
|
+
| System | Default folder |
|
|
228
|
+
|---|---|
|
|
229
|
+
| Linux and macOS | `~/.dsh/bot/` |
|
|
230
|
+
| Windows | `C:\Users\<user>\.dsh\bot\` |
|
|
231
|
+
|
|
232
|
+
Bot and group conversations are DSH Sessions, so they are stored with the rest of the DSH session data rather than only in the `bot` folder.
|
|
233
|
+
|
|
234
|
+
To make a complete backup:
|
|
235
|
+
|
|
236
|
+
1. Stop DSH Web or quit DSH Desktop.
|
|
237
|
+
2. Back up the whole DSH home directory, including `bot`, `sessions`, `storages`, and `profiles`.
|
|
238
|
+
3. Keep the backup private because it can contain secrets and provider configuration.
|
|
239
|
+
|
|
240
|
+
Do not run the same Bot data directory from two writable DSH processes at once. DS Bot uses a lock and makes the second process read-only to protect the team state.
|
|
241
|
+
|
|
242
|
+
## Update
|
|
243
|
+
|
|
244
|
+
Update to the latest published version in the profile:
|
|
245
|
+
|
|
246
|
+
```sh
|
|
247
|
+
dsh plugin --profile web update @thewaifu/dsh-bot --registry=https://registry.npmjs.org/
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
For Desktop, replace `web` with `desktop`. Restart DSH after the update. You can also use **DS Bot settings > About DS Bot > Check for updates** when the installed DSH plugin manager supports it.
|
|
251
|
+
|
|
252
|
+
Version `1.1.1` fixes the Web client registration failure in `1.1.0`. After updating from `1.1.0`, restart DSH and hard-refresh the browser so it does not reuse the old client bundle.
|
|
253
|
+
|
|
254
|
+
## Uninstall
|
|
255
|
+
|
|
256
|
+
Remove the package from a Web profile:
|
|
257
|
+
|
|
258
|
+
```sh
|
|
259
|
+
dsh plugin --profile web remove @thewaifu/dsh-bot
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
For Desktop, replace `web` with `desktop`. Restart DSH after removal.
|
|
263
|
+
|
|
264
|
+
Uninstalling the npm package does not automatically erase `$DSH_HOME/bot` or the related DSH Sessions. This protects your data from accidental removal. Delete saved data only after making a backup and confirming that no other profile uses it.
|
|
265
|
+
|
|
266
|
+
## Troubleshooting
|
|
267
|
+
|
|
268
|
+
### DS Bot does not appear
|
|
269
|
+
|
|
270
|
+
Run:
|
|
271
|
+
|
|
272
|
+
```sh
|
|
273
|
+
dsh plugin --profile web list --depth=0
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
The list must contain `@thewaifu/dsh-bot`. If it does not, install it again from the npm registry. If it does, restart DSH and hard-refresh the browser.
|
|
277
|
+
|
|
278
|
+
### The model selector is empty
|
|
279
|
+
|
|
280
|
+
The current profile has not exposed an available model. Open the DSH provider or Models settings, connect a provider, verify its account and quota, then restart DSH. If you use Token Factory, verify that it is connected in the same `web` profile.
|
|
281
|
+
|
|
282
|
+
### Replies look like `Received: ...`
|
|
283
|
+
|
|
284
|
+
That wording is produced by the development mock model, not by DS Bot itself. Old mock answers remain visible in history. Select a real provider route on the Bot and send a new message. If a new message still echoes the input, the profile is still configured to use a mock provider or mock endpoint; correct the DSH model route before testing again.
|
|
285
|
+
|
|
286
|
+
### A group message opens another conversation
|
|
287
|
+
|
|
288
|
+
Confirm that `@thewaifu/dsh-bot@1.1.1` is the only package registering the `bot` plugin, restart DSH, and hard-refresh the page. Do not install `ds-bot`, `dsh-bot`, and `@thewaifu/dsh-bot` together. A member's hidden group Session is an implementation detail and should not replace the visible group selection.
|
|
289
|
+
|
|
290
|
+
### Only the administrator replies in a group
|
|
291
|
+
|
|
292
|
+
Open the group's settings and inspect **Who answers**. **Admin leads** sends plain messages only to the administrator. Select **Everyone**, mention specific Bots with `@Name`, or use `@all` when every member should answer.
|
|
293
|
+
|
|
294
|
+
### Waifu TTS does not show or no authorization page opens
|
|
295
|
+
|
|
296
|
+
Confirm Waifu is installed in the same profile, restart DSH, then open **DS Bot settings > Connectors**. If the card says browser authorization is disabled, update or reconfigure the Waifu plugin. If an old link fails, select **New link** or **Reconnect** and use the newly opened page.
|
|
297
|
+
|
|
298
|
+
### Waifu is connected but there is no sound
|
|
299
|
+
|
|
300
|
+
Open the Waifu companion, confirm a character and voice are selected, check the operating system output device and volume, then select **Test voice** again. A successful authorization does not override muted audio or the wrong system output device.
|
|
301
|
+
|
|
302
|
+
## License
|
|
303
|
+
|
|
304
|
+
[Apache-2.0](LICENSE)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawn } from 'node:child_process'
|
|
3
|
+
import { DEFAULT_WEB_PORT, findAvailablePort } from '../src/shared/web-port.js'
|
|
4
|
+
|
|
5
|
+
const args = process.argv.slice(2)
|
|
6
|
+
|
|
7
|
+
if (args.some(arg => arg === '--port' || arg.startsWith('--port='))) {
|
|
8
|
+
console.error('dsh-bot-web chooses the first available port starting at 3082; remove --port or run dsh web directly.')
|
|
9
|
+
process.exitCode = 2
|
|
10
|
+
} else {
|
|
11
|
+
const hostIndex = args.indexOf('--host')
|
|
12
|
+
const inlineHost = args.find(arg => arg.startsWith('--host='))?.slice('--host='.length)
|
|
13
|
+
const host = inlineHost || (hostIndex >= 0 ? args[hostIndex + 1] : undefined) || '127.0.0.1'
|
|
14
|
+
|
|
15
|
+
try {
|
|
16
|
+
const port = await findAvailablePort(DEFAULT_WEB_PORT, host)
|
|
17
|
+
const detail = port === DEFAULT_WEB_PORT ? '' : ` because ${DEFAULT_WEB_PORT}-${port - 1} ${port - 1 === DEFAULT_WEB_PORT ? 'is' : 'are'} unavailable`
|
|
18
|
+
console.error(`dsh-bot-web: starting DSH Web on ${host}:${port}${detail}`)
|
|
19
|
+
|
|
20
|
+
const command = process.platform === 'win32' ? 'dsh.cmd' : 'dsh'
|
|
21
|
+
const child = spawn(command, ['web', '--port', String(port), ...args], { stdio: 'inherit' })
|
|
22
|
+
child.once('error', (error) => {
|
|
23
|
+
console.error(`dsh-bot-web: could not start dsh: ${error.message}`)
|
|
24
|
+
process.exitCode = 1
|
|
25
|
+
})
|
|
26
|
+
child.once('exit', code => {
|
|
27
|
+
process.exitCode = code ?? 1
|
|
28
|
+
})
|
|
29
|
+
} catch (error) {
|
|
30
|
+
console.error(`dsh-bot-web: ${error instanceof Error ? error.message : String(error)}`)
|
|
31
|
+
process.exitCode = 1
|
|
32
|
+
}
|
|
33
|
+
}
|