@kadaliao/dsh-bots 0.9.0 → 0.10.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/README.md +107 -48
- package/README.zh-CN.md +73 -35
- package/client.js +439 -379
- package/index.js +621 -125
- package/lib/cards.mjs +53 -7
- package/lib/channels/discord.mjs +3 -0
- package/lib/channels/feishu.mjs +4 -1
- package/lib/channels/slack.mjs +8 -3
- package/lib/channels/telegram.mjs +7 -2
- package/lib/channels.mjs +27 -10
- package/lib/discussions.mjs +300 -0
- package/lib/prompt.mjs +41 -22
- package/lib/store.mjs +20 -2
- package/lib/threads.mjs +16 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,8 +6,9 @@ Grok-style bots inside DeepSeek Harness: a team of bots that work together. Each
|
|
|
6
6
|
persona, model, skills, abilities, apps, scheduled tasks and memory**, and its own conversation. Bots **message each
|
|
7
7
|
other**, and one of them, the **dispatcher**, splits the work, hands it out, follows up and reports back. Each piece
|
|
8
8
|
of work handed out is a **task** that the bot works on in a conversation of its own, so one bot can work on several
|
|
9
|
-
at once.
|
|
10
|
-
**
|
|
9
|
+
at once. The chat with a bot reads like a chat app: the bot on the left, you on the right. To go on about one
|
|
10
|
+
message, reply to it: your reply quotes it, and the bot answers in a **thread**, where it sees that message and what
|
|
11
|
+
came before it, and nothing said in the chat since.
|
|
11
12
|
|
|
12
13
|
It is built for two situations:
|
|
13
14
|
|
|
@@ -62,29 +63,46 @@ Bots answer in the language you write in, so the same team works in Chinese and
|
|
|
62
63
|
Each message from Atlas to a teammate opens a task, the three tasks run at the same time, and Forge's message is the
|
|
63
64
|
report on its task.
|
|
64
65
|
|
|
65
|
-
## The chat:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
66
|
+
## The chat: reply to a message to open a thread
|
|
67
|
+
|
|
68
|
+
The chat with a bot reads like a chat app such as Feishu: the bot's messages on the left, yours on the right, in the
|
|
69
|
+
order they were said. Send as many messages as you like, whenever you like. To go on about one message, reply to it,
|
|
70
|
+
the way a chat app quotes a reply: the reply shows at the end of the chat with that message quoted on top, and the
|
|
71
|
+
bot answers in that message's **thread**.
|
|
72
|
+
|
|
73
|
+
<!-- screenshot: a quoted reply in the chat -->
|
|
74
|
+
|
|
75
|
+
- **What you send shows at once**, marked **Queued** until the bot takes it.
|
|
76
|
+
- **Reply to any message.** Hover over a message and click **Reply**: it is quoted above the box (**×** or Esc drops
|
|
77
|
+
it), and what you send answers it. The bot answers in a conversation of its own, **forked from its conversation at
|
|
78
|
+
that message**: it sees that message and everything before it, and nothing the main chat said after it. So when
|
|
79
|
+
you come back to an older message a few turns later, the bot answers about that message instead of taking it as a
|
|
80
|
+
reply to the last one. When the message you reply to is your own, the answer the bot gave it then is part of what
|
|
81
|
+
the thread sees.
|
|
82
|
+
- **Replies show in the chat, quoted.** Your reply quotes the message it answers; the bot's answer quotes your reply,
|
|
83
|
+
unless it is right under it. Click a quote to see the whole thread on its own beside the chat (over it on a
|
|
84
|
+
narrow screen), where you can go on too. A message with a thread has a small **N replies** link under it, with
|
|
85
|
+
**Replying…** while the bot answers there; the chat also shows the bot at work at its end.
|
|
86
|
+
- **The main chat hears what was said in threads.** Since you read the replies in the chat, your next message
|
|
87
|
+
there comes to the bot with a short note of what was said in its threads since (who said what, under which
|
|
88
|
+
message), so it doesn't lose the thread of the conversation. A thread doesn't hear what the main chat said after
|
|
89
|
+
its message.
|
|
90
|
+
- **Reply** to a message of a thread to go on in that thread (it quotes that message); threads don't nest. A thread
|
|
91
|
+
has no new topic: `/new` works in the main chat only.
|
|
92
|
+
- **Replying to a task's message talks to that task.** Reply to a result or a question from the bot doing a task and
|
|
93
|
+
what you write goes straight to that task; the dispatcher only gets a note, which doesn't wake it, and the task's
|
|
94
|
+
later reports show in that thread. A task that is done but whose conversation isn't archived yet takes it and goes on.
|
|
80
95
|
- **The dispatcher answers every message within a step or two**, because it doesn't do the work in its own
|
|
81
|
-
conversation: it hands it to the teammate that fits
|
|
82
|
-
again at once. Two requests sent back to back run side by side, and neither is dropped for the other
|
|
83
|
-
continues something already under way is added to that task
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
96
|
+
conversation: it hands it to the teammate that fits (the closest one when none fits exactly), never to itself, and
|
|
97
|
+
is free again at once. Two requests sent back to back run side by side, and neither is dropped for the other; a message that
|
|
98
|
+
continues something already under way is added to that task. In a thread it still only routes: a task it hands out
|
|
99
|
+
there reports back into the thread, and what you write later in the thread comes to it first, and it decides which
|
|
100
|
+
task it is for.
|
|
101
|
+
- **The bot doing the work answers you itself**, where the request came from (the main chat or a thread), with the
|
|
102
|
+
whole result. Only when the dispatcher splits one request between several bots and has to put the results together
|
|
103
|
+
does it ask for their reports back and answer you itself.
|
|
104
|
+
- A thread quiet for a day leaves the Harness sidebar; a new reply brings it back, and the thread goes on where it was.
|
|
105
|
+
- 0.9's topics read as the chat they were, with a link to each under its first message.
|
|
88
106
|
|
|
89
107
|
## Tasks: delegated work in conversations of their own
|
|
90
108
|
|
|
@@ -96,7 +114,8 @@ for you. You don't open tasks yourself: you ask the dispatcher (or any bot), and
|
|
|
96
114
|
|
|
97
115
|
- **Reports**: the bot doing a task reports with a status: **done** with the result, **question** when it needs an
|
|
98
116
|
answer, **blocked** when it cannot go on, or **progress**, which is kept on the task without interrupting anyone.
|
|
99
|
-
Done, question and blocked go to you as they are,
|
|
117
|
+
Done, question and blocked go to you as they are, where the request came from (the main chat, a thread or a chat
|
|
118
|
+
app; after you reply to one of them in the panel, in that thread), and the bot that asked
|
|
100
119
|
gets a note that doesn't wake it. When the bot that asked wants the reports back (to put several results together),
|
|
101
120
|
they reach it at once instead and it passes them on; so do a sub-task's reports, and those of a task that came from
|
|
102
121
|
no chat (a scheduled run). A report from a task that has already ended, or from a sub-task whose task has ended, is
|
|
@@ -117,8 +136,8 @@ for you. You don't open tasks yourself: you ask the dispatcher (or any bot), and
|
|
|
117
136
|
**Mark done** and **Stop** both end the task and stop its bot's work on it at once. Each bot's **Tasks** tab lists
|
|
118
137
|
what it is working on.
|
|
119
138
|
- **What bots say to each other stays out of your way**: in a bot's chat, hand-offs, reports and messages between
|
|
120
|
-
bots run together as one quiet group under your conversation with it; those about a task that came from a
|
|
121
|
-
in that
|
|
139
|
+
bots run together as one quiet group under your conversation with it; those about a task that came from a thread
|
|
140
|
+
show in that thread. **Settings → Chat → Messages between bots**
|
|
122
141
|
sets how much of them shows, the same on every device: **One line** (the default: who hands what to whom, its
|
|
123
142
|
stage and time; a click opens the task), **Short** (and the first two lines of the message) or **Full** (the whole
|
|
124
143
|
message, with the task's card). The bot's replies to you read like the main conversation, without a box.
|
|
@@ -138,15 +157,21 @@ for you. You don't open tasks yourself: you ask the dispatcher (or any bot), and
|
|
|
138
157
|
The dispatcher works in one of two ways, chosen under **How it works** on its **Profile** tab, for the whole team:
|
|
139
158
|
|
|
140
159
|
- **Router** (the default): it understands the request, hands the work out and keeps track of it. It does not run
|
|
141
|
-
commands, write or edit files, search the web, use sub-agents and workflows, draw images
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
160
|
+
commands, write or edit files, search the web, use sub-agents and workflows, draw images, make Office files or put
|
|
161
|
+
question cards to you (a card holds every message after it until you answer); it can still read files and use its
|
|
162
|
+
skills. Work that needs any of those goes to a teammate, never to itself (0.9 handed it to itself when no teammate
|
|
163
|
+
fit; 0.10 doesn't), while its own conversation stays free for you. When you say "ask me which tone before you
|
|
164
|
+
write", it hands the work out with that request and the teammate asks you in its task; when it must know something
|
|
165
|
+
itself before it can hand a request out, it asks in one line of its reply, and your next message is the answer. Its
|
|
166
|
+
**Abilities** section lists what Router mode turns off and marks it: switch a whole ability back on, or use **Turn
|
|
167
|
+
back on** for the part of one that is off (writing and editing under Files). Even then it may not `sleep`, a
|
|
168
|
+
command must finish within 30 seconds or run in the background, and with question cards back on it takes no new
|
|
169
|
+
message until a card is answered. It never waits for a teammate: it ends its turn and is woken when something needs it, so a new
|
|
146
170
|
request is not stuck behind work in progress, and messages that arrive while it is busy are taken together at its
|
|
147
|
-
next step, each
|
|
171
|
+
next step, and each one gets its answer. Since it only routes, a light, fast model is enough for it; its **Model** section says so, and Bots does
|
|
148
172
|
not change the model for you. In Router mode every bot that hands work to a teammate opens a task, not only the
|
|
149
|
-
dispatcher
|
|
173
|
+
dispatcher; but nobody opens one for the dispatcher: a teammate's message to it goes into its own conversation,
|
|
174
|
+
and it tells you what you should know and hands out what is work.
|
|
150
175
|
- **Hands-on**: how 0.7 worked. The dispatcher also does small jobs itself, and a message from one bot's own
|
|
151
176
|
conversation to another bot goes into that bot's own conversation instead of opening a task. Tasks already open keep
|
|
152
177
|
going and report as before.
|
|
@@ -161,16 +186,23 @@ a Telegram topic, or the panel.
|
|
|
161
186
|
|
|
162
187
|
- **Answers go back where the request came from.** The bot doing a task answers in that task's chat itself, signed
|
|
163
188
|
with its name (`【Forge】`) when the chat app belongs to another bot, so two requests from two chats are answered each
|
|
164
|
-
in its own chat. When one turn of the dispatcher involves more than one chat
|
|
165
|
-
`bot_reply`, and a task it opens there has to say which one it is for. Plain text left over from
|
|
166
|
-
the panel, marked **Not sent**, unless each chat
|
|
189
|
+
in its own chat. When one turn of the dispatcher involves more than one chat (the panel and a chat app, say), it
|
|
190
|
+
answers each with `bot_reply`, and a task it opens there has to say which one it is for. Plain text left over from
|
|
191
|
+
such a turn stays in the panel, marked **Not sent**, unless each chat has its answer already.
|
|
167
192
|
- **A follow-up in a thread goes straight to the task.** In a Slack or Discord thread, a Feishu topic or reply chain,
|
|
168
193
|
or a Telegram topic, what you write later in the same thread goes to the tasks started there; the dispatcher only
|
|
169
194
|
gets a note, which does not wake it. Until its conversation is archived, a done task also takes such a message and
|
|
170
195
|
goes on; a stopped task does not. In Slack, Discord and Feishu groups the bot answers under your message, so each
|
|
171
196
|
request there starts a thread of its own.
|
|
197
|
+
- **Otherwise a thread gets a conversation of its own, as in the panel.** In a thread with no live task, its first
|
|
198
|
+
message (the one that @mentions the bot in a group, say) goes to the bot's own conversation; once the bot has
|
|
199
|
+
answered there, what you write later in the same thread goes to a conversation forked from the bot's at that
|
|
200
|
+
exchange: it doesn't see what the bot talked about elsewhere since, and nothing said in the thread goes back.
|
|
201
|
+
Replying to one of the bot's own chat messages (a Feishu or Discord reply, a Slack thread) works the same way,
|
|
202
|
+
forked at that message; this needs the message's id from the chat app, so it works for messages sent since 0.10.
|
|
203
|
+
In Telegram only forum topics are threads; a reply in a private chat is not.
|
|
172
204
|
- **A follow-up in a private chat goes to the dispatcher.** A private chat (and a group without threads) is one long
|
|
173
|
-
conversation where new requests arrive too, so a
|
|
205
|
+
conversation where new requests arrive too, so a message sent there (not a reply) goes to the dispatcher, unless one task asked a
|
|
174
206
|
question there and is still waiting for the answer: then that task takes it. With two or more waiting, it goes to
|
|
175
207
|
the dispatcher, which works out which one it answers.
|
|
176
208
|
- A message that starts with `@handle` still goes to that bot's own conversation.
|
|
@@ -209,7 +241,9 @@ A bot works in ordinary Harness conversations, so everything Harness can do, a b
|
|
|
209
241
|
|
|
210
242
|
- **Abilities**: web search, files, running commands and code, Office documents, image generation,
|
|
211
243
|
sub-agents and workflows, handing over files… switched per bot on its Profile tab (a reviewer bot
|
|
212
|
-
that cannot run commands, for instance).
|
|
244
|
+
that cannot run commands, for instance). In a team of more than one bot, the dispatcher has no Harness sub-agents or
|
|
245
|
+
workflows: work in parallel goes to teammates, so the panel shows it as their tasks (even when a skill says to start
|
|
246
|
+
sub-agents). The other bots keep them.
|
|
213
247
|
- **Skills**:
|
|
214
248
|
- **Add from Harness**: pick from the skills you already installed (`~/.agents/skills`,
|
|
215
249
|
`~/.dsh/skills`, …); referenced, not copied, so they stay up to date;
|
|
@@ -241,7 +275,9 @@ A bot works in ordinary Harness conversations, so everything Harness can do, a b
|
|
|
241
275
|
| Maps & local | Amap 🔑, Baidu Maps 🔑 |
|
|
242
276
|
| Custom | Any local (stdio) or remote (Streamable HTTP) MCP server |
|
|
243
277
|
|
|
244
|
-
- **Schedules** are ordinary Harness scheduled tasks, also on the Automation page.
|
|
278
|
+
- **Schedules** are ordinary Harness scheduled tasks, also on the Automation page. A scheduled task missed while
|
|
279
|
+
Harness was closed runs when it starts again, once (its latest occurrence): that is Harness's rule, and Bots adds
|
|
280
|
+
no runs of its own. A team with many schedules can open several tasks at once after a start, and use many tokens.
|
|
245
281
|
- **AI avatars**: with the [Images plugin](../images), draw a bot's avatar from its persona. A bot can do it too:
|
|
246
282
|
ask the dispatcher to give the team new avatars and describe the look, or point it at an image file. A bot's
|
|
247
283
|
drawing runs in the background, so it goes on answering you: a ring turns around the avatar while the picture is
|
|
@@ -281,7 +317,9 @@ bot's scheduled tasks move along); what the bot knows carries over in its memory
|
|
|
281
317
|
|
|
282
318
|
Harness still compacts a conversation that nears the model's limit; topics keep every call small and cheap
|
|
283
319
|
long before that. A task's conversation is not a topic: it ends with its task. A task's report reaches the bot
|
|
284
|
-
that asked for it even after that bot started a new topic.
|
|
320
|
+
that asked for it even after that bot started a new topic. Threads are not topics either: a new topic leaves the
|
|
321
|
+
threads as they are, and a message from an earlier topic can still be replied to. The old conversation is archived,
|
|
322
|
+
and the Bots panel stays where it is (it used to jump to Harness's conversation view).
|
|
285
323
|
|
|
286
324
|
## Memory
|
|
287
325
|
|
|
@@ -456,13 +494,17 @@ one connection. If you change scopes later, reinstall the app to the workspace a
|
|
|
456
494
|
- Each bot owns one ordinary Harness conversation of its own, in the **Bots** workspace
|
|
457
495
|
(`~/.dsh/bots/workspace` unless `workdir` is set), and one more for each task it works on
|
|
458
496
|
(`ticket-<id>`), in the same workspace. A task's conversation is archived in Harness once the task has
|
|
459
|
-
been over for the hours set in Settings.
|
|
497
|
+
been over for the hours set in Settings. Each thread is a conversation too, forked with Harness's session fork
|
|
498
|
+
from the bot's conversation at the message replied to and titled "<bot> · <the start of that message>"; it is
|
|
499
|
+
archived after a quiet day and taken out of the archive on the next reply.
|
|
460
500
|
- When it runs, the bot's persona and the team roster join its system prompt; its own skills, ability
|
|
461
501
|
limits and apps apply to its conversations only. In a task's conversation the prompt also says which
|
|
462
502
|
task it is, who asked, and how to report. Edits apply at once; a new or changed app connects the next
|
|
463
503
|
time the conversation starts.
|
|
464
504
|
- In Router mode, `bot_send_message` from a bot's own conversation opens a task and returns at once; from
|
|
465
|
-
a task's conversation it reports to whoever asked (with a status) or opens a sub-task.
|
|
505
|
+
a task's conversation it reports to whoever asked (with a status) or opens a sub-task. A message to the
|
|
506
|
+
dispatcher opens no task: it goes into the dispatcher's own conversation (one sent from a task names it, and the
|
|
507
|
+
dispatcher's answer is added to that task). In Hands-on mode,
|
|
466
508
|
from a bot's own conversation, it puts the text into the other bot's inbox and wakes it, as in 0.7. Two
|
|
467
509
|
bots may exchange at most 16 messages in 10 minutes (new tasks and messages added to tasks count), so
|
|
468
510
|
conversations end.
|
|
@@ -483,7 +525,7 @@ one connection. If you change scopes later, reinstall the app to the workspace a
|
|
|
483
525
|
- A chat app is not an MCP server: the Host keeps one connection per chat app (long polling for Telegram,
|
|
484
526
|
the gateway for Discord, Socket Mode for Slack, the long connection for Feishu), starts and stops it as you add, change, switch off or remove the
|
|
485
527
|
app, and hands paired people's messages to the bot as user prompts headed
|
|
486
|
-
`[Telegram · Name] (thread <key>)`, or to the tasks of that thread (see
|
|
528
|
+
`[Telegram · Name] (thread <key>)`, or to the tasks or the own conversation of that thread (see
|
|
487
529
|
[Chats and threads](#chats-and-threads)). The thread key is what `bot_reply` names.
|
|
488
530
|
|
|
489
531
|
## Open Computer Use
|
|
@@ -500,7 +542,8 @@ permission and restart it.
|
|
|
500
542
|
per chat), `tickets.json` (tasks, with what was asked and their reports, and the chat threads they came
|
|
501
543
|
from; the newest 500 archived tasks are kept), `avatars/`, `skills/` (skills imported from GitHub),
|
|
502
544
|
`memory/` (notes, journal, digests), `usage.jsonl` and `tasks.jsonl` (token counts per call and run,
|
|
503
|
-
kept 400 days), `topics.json`, `
|
|
545
|
+
kept 400 days), `topics.json`, `discussions.json` (threads, where each message sits in its conversation, threads
|
|
546
|
+
you have read), `settings.json`, `price-catalog.json`. If `tickets.json` cannot be read
|
|
504
547
|
(permissions, say), Bots does not start and says why in the Harness log, so the file is never written over;
|
|
505
548
|
a damaged one is kept as `tickets.json.corrupt-<time>` and tasks start empty.
|
|
506
549
|
- Custom endpoints and a borrowed Codex login are written to Harness's own model settings (`llm-pi-ai`) and
|
|
@@ -531,6 +574,19 @@ git+https://github.com/kadaliao/dsh-plugins.git#main&path:/plugins/bots
|
|
|
531
574
|
|
|
532
575
|
Refresh the page once after installing. For AI avatars, install [Images](../images) too.
|
|
533
576
|
|
|
577
|
+
## Upgrading from 0.9
|
|
578
|
+
|
|
579
|
+
- **Quit and reopen Harness** once after the upgrade. A page reload alone gives you the new page while Harness still
|
|
580
|
+
runs the old Bots, and replies don't land in threads; a banner at the top of the panel says so until you reopen it.
|
|
581
|
+
- Nothing else to do: bots, tasks, memory, schedules, chat apps and pairings stay as they are; 0.10 adds
|
|
582
|
+
`discussions.json` for threads.
|
|
583
|
+
- The messages of 0.9's topics show in the chat in the order they were said, with a link to each topic's thread under
|
|
584
|
+
its first message; in one with a live task, what you write there still goes to the task.
|
|
585
|
+
- Messages from before the upgrade can be replied to: Bots finds the message's place in the conversation's log by its
|
|
586
|
+
time and forks there. When it cannot (a very long conversation, or one that is gone), it forks at the
|
|
587
|
+
conversation's latest turn and tells the bot that the chat may have gone on past that message.
|
|
588
|
+
- Threads use Harness's session fork; on a Harness without it, a reply says to update Harness first.
|
|
589
|
+
|
|
534
590
|
## Upgrading from 0.8
|
|
535
591
|
|
|
536
592
|
- Nothing to do: bots, tasks, memory, schedules, chat apps and pairings stay as they are. The timeline in
|
|
@@ -563,9 +619,12 @@ Refresh the page once after installing. For AI avatars, install [Images](../imag
|
|
|
563
619
|
- In a group chat a bot hears only messages that @mention it (or reply to it); it does not listen to the
|
|
564
620
|
rest of the conversation. 0.8 does not change that.
|
|
565
621
|
- Thread history starts with 0.8: messages from before the upgrade belong to no thread, so reading a chat
|
|
566
|
-
thread with `bot_recall` shows only what was said there since. Panel
|
|
567
|
-
-
|
|
568
|
-
|
|
622
|
+
thread with `bot_recall` shows only what was said there since. Panel threads start with 0.10.
|
|
623
|
+
- A thread doesn't see the main chat's later messages because it is a fork, and a fork needs the message's place in
|
|
624
|
+
the conversation's log. For a very old message whose place cannot be found, the thread forks at the latest turn and
|
|
625
|
+
sees what came after (the bot is told so).
|
|
626
|
+
- In a chat app, replying to one of the bot's messages makes a thread only for messages sent since 0.10; a message
|
|
627
|
+
sent straight into a private chat is still part of one conversation and goes to the dispatcher.
|
|
569
628
|
- The watchdog goes by time and status only; it does not judge whether a task is heading the right way.
|
|
570
629
|
- Costs are estimates. Gateways, subscriptions and discounts bill differently; set your own prices.
|
|
571
630
|
- Only the Codex CLI's login can be borrowed so far; other subscriptions sign in from Harness Settings →
|
package/README.zh-CN.md
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
把 Grok bot 搬进 DeepSeek Harness:一支能互相协作的 bot 团队。每个 bot 有自己的**头像、人设、模型、技能、能力、应用、定时任务和记忆**,
|
|
6
6
|
也有自己的会话;bot 之间**私信协作**,其中一个是**调度员**,负责拆解需求、分派、跟进、汇报。
|
|
7
7
|
分派出去的每件工作都是一个**任务**,bot 在专门的会话里做,所以一个 bot 可以同时做好几件事。
|
|
8
|
-
和 bot
|
|
8
|
+
和 bot 聊天就像在聊天软件里:bot 在左,你在右。想针对哪条消息接着聊,就回复它:你的回复引用那条消息,
|
|
9
|
+
bot 在它的**讨论串**里回答,只看得到这条消息和它之前的内容,不会把后来聊的别的事混进来。
|
|
9
10
|
|
|
10
11
|
它适合两种场景:
|
|
11
12
|
|
|
@@ -54,23 +55,32 @@ bot 默认用你说话的语言回答;中文提问就是中文协作。
|
|
|
54
55
|
|
|
55
56
|
上面 Atlas 发给三位队友的每条消息都开了一个任务,三个任务同时进行;Forge 那句话就是它对自己任务的汇报。
|
|
56
57
|
|
|
57
|
-
##
|
|
58
|
-
|
|
59
|
-
和 bot
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
-
|
|
58
|
+
## 聊天:回复一条消息,就开一个讨论串
|
|
59
|
+
|
|
60
|
+
和 bot 聊天就像在飞书这样的聊天软件里:bot 说的在左,你说的在右,按说话的先后排下来,想发几条发几条、什么时候发都行。
|
|
61
|
+
想针对某条消息接着聊,就像聊天软件里的引用回复那样回复它:回复出现在对话最后,顶上引用着那条消息,bot 在这条消息的**讨论串**里回答。
|
|
62
|
+
|
|
63
|
+
<!-- screenshot: a quoted reply in the chat -->
|
|
64
|
+
|
|
65
|
+
- **发出即显示。** 消息发出去立刻出现在对话里,bot 接手之前标着 **排队中**。
|
|
66
|
+
- **回复任何一条消息。** 鼠标移到消息上点 **回复**,那条消息引用在输入框上方(点 **×** 或按 Esc 取消),发出去的话就是回复它的。
|
|
67
|
+
bot 回答时用的是从它的会话**在那条消息处分出来**的一段新会话:看得到那条消息和之前的内容,看不到主对话后来说的话。
|
|
68
|
+
所以隔了几轮再去回复一条旧消息,它答的就是那条消息,不会当成在接最后一句。回复的是你自己的消息时,bot 当时对它的回答也算在内。
|
|
69
|
+
- **回复显示在对话里,带着引用。** 你的回复引用它回复的消息;bot 的回答引用你的回复,紧挨在下面时就不重复引用。
|
|
70
|
+
点引用,就在聊天旁边单独看这个讨论串的全部往来(窄屏时铺满),也可以在那里接着聊。有讨论串的消息下面有一个小小的 **N 条回复**,
|
|
71
|
+
bot 正在那里回答时显示 **正在回复…**,对话末尾也会显示它正在回答。
|
|
72
|
+
- **主对话知道讨论串里说了什么。** 回复都显示在对话里,你也都看到了,所以你下一次在主对话里发消息时,bot 会先收到一段简短的提示,
|
|
73
|
+
说明这段时间各个讨论串里谁说了什么、回复的是哪条消息,不会接不上话。反过来,讨论串看不到它那条消息之后主对话说的话。
|
|
74
|
+
- 回复讨论串里的某条消息,就是在那个讨论串里接着聊(会引用那条消息),不会再往下开。讨论串里没有新话题,`/new` 只在主对话里有用。
|
|
75
|
+
- **回复任务的消息,就是在跟那个任务说话。** 回复做任务的 bot 发来的结果或提问,这句话直接交给那个任务,
|
|
76
|
+
调度员只收到一条提示,不会被唤醒;任务之后的汇报也显示在这个讨论串里。任务已完成但会话还没归档时,会接着做。
|
|
77
|
+
- **调度员一两步之内就回应每一条消息**,因为活都交给队友:交给最合适的队友(没有正好对口的,就交给最接近的那个),
|
|
78
|
+
从不派给自己,然后马上空出来。连发两件事会同时推进,不会因为来了新消息就丢掉旧的;接着说某件进行中的事的消息,它会并进那个任务。
|
|
79
|
+
在讨论串里它也只调度:在那里交出去的任务,结果回到这个讨论串;你在讨论串里接着说的话仍然先到它这里,由它决定转给哪个任务。
|
|
80
|
+
- **干活的 bot 直接回复你**,在请求来的地方(主对话或讨论串)给出完整结果。只有调度员把一件事拆给几个 bot、需要汇总结果时,
|
|
72
81
|
才会让汇报先回到它那里,再由它回复你。
|
|
73
|
-
-
|
|
82
|
+
- 一天没有动静的讨论串,它的会话会从 Harness 侧栏收起来;再回复它就回来,接着原来的讨论串聊。
|
|
83
|
+
- 0.9 的话题照原来的样子显示在对话里,它第一条消息下面有讨论串的链接。
|
|
74
84
|
|
|
75
85
|
## 任务:分派出去的工作各有各的会话
|
|
76
86
|
|
|
@@ -80,7 +90,8 @@ bot 默认用你说话的语言回答;中文提问就是中文协作。
|
|
|
80
90
|
<!-- screenshot: tasks view -->
|
|
81
91
|
|
|
82
92
|
- **汇报**:做任务的 bot 汇报时注明状态:**完成**(附上结果)、**提问**(需要有人回答)、**受阻**(做不下去了),
|
|
83
|
-
|
|
93
|
+
或者**进展**——进展只记在任务上,不打扰任何人。完成、提问和受阻原文发给你,发在请求来的地方(主对话、讨论串或聊天应用;
|
|
94
|
+
在面板里回复过其中一条的,之后发在那个讨论串里);
|
|
84
95
|
发起的 bot 只收到一条提示,不会被唤醒。发起的 bot 要求汇报先回给它时(为了汇总几份结果),汇报立刻送到它那里,由它转告;
|
|
85
96
|
子任务的汇报、以及不来自任何聊天的任务(比如定时任务开出的)的汇报也是这样。
|
|
86
97
|
任务结束后才发来的汇报,或者所属任务已经结束的子任务发来的汇报,只记在任务上。
|
|
@@ -97,7 +108,7 @@ bot 默认用你说话的语言回答;中文提问就是中文协作。
|
|
|
97
108
|
**标为完成** 和 **停止** 都会结束任务,并让 bot 立刻停下手上的活。
|
|
98
109
|
每个 bot 的 **任务** 标签页列出它手上的工作。
|
|
99
110
|
- **bot 之间的消息不抢戏**:在 bot 的聊天里,分派、汇报和 bot 之间的消息连在一起,收成你和它对话下面安静的一组;
|
|
100
|
-
|
|
111
|
+
来自某个讨论串的任务,相关的这些消息显示在那个讨论串里。
|
|
101
112
|
**设置 → 聊天 → Bot 之间的消息** 决定显示多少,每台设备都一样:**一行**(默认:谁把什么交给谁、进度和时间,点一下打开任务)、
|
|
102
113
|
**简短**(再加消息的前两行)、**完整**(整条消息,委派附任务卡片)。bot 回复你的话和主对话一样排版,不再套框。
|
|
103
114
|
- **实时状态**:bot 干活时,聊天里会写出它此刻在做什么、做了多久("运行 `npm test` · 42 秒"、"思考中 · 8 秒",再加第几步和总用时);
|
|
@@ -112,12 +123,16 @@ bot 默认用你说话的语言回答;中文提问就是中文协作。
|
|
|
112
123
|
调度员有两种工作方式,在它的 **资料** 页 **调度方式** 里选,对整个团队生效:
|
|
113
124
|
|
|
114
125
|
- **只调度**(默认):听懂需求、把工作分派出去、跟进进度,自己不动手。这时它不执行命令、不写不改文件、不联网搜索、
|
|
115
|
-
不用子代理和工作流、不作图、不做 Office
|
|
116
|
-
|
|
117
|
-
|
|
126
|
+
不用子代理和工作流、不作图、不做 Office 文档,也不弹提问卡片(一张卡片没答之前,后面的消息都得排队),但仍能读文件、使用技能。
|
|
127
|
+
需要这些能力的事都交给队友,从不派给自己(0.9 时没有合适的队友它会派给自己,0.10 起不再这样),它自己的会话始终空着等你。
|
|
128
|
+
你说「动笔前先问我」这类话,它把这个要求连同工作一起交给队友,由队友在任务里问你;它自己得先弄清楚才能分派的事,
|
|
129
|
+
就在回复里用一句话问你,你的下一条消息就是答案。**能力** 一栏会列出只调度时关掉的项并标出来:整项关掉的,打开开关就放回;
|
|
130
|
+
只关掉一部分的(比如读写文件里的写和改),点 **重新打开** 放回(即使放回了命令,它也不能 `sleep`,命令要么在 30 秒内跑完,
|
|
131
|
+
要么放到后台跑;放回提问卡片的话,卡片没答之前它也接不了新消息)。
|
|
118
132
|
它从不等队友:分派完就结束这一轮,有事需要它时会自动唤醒,所以新请求不会被手上的活堵住;
|
|
119
|
-
|
|
120
|
-
**模型** 一栏也会这样提示;Bots 不会替你换模型。只调度时,任何 bot
|
|
133
|
+
它忙的时候进来的消息,会在下一步一起处理,每一条都得到回应。既然只管调度,用轻量、快速的模型就够了,
|
|
134
|
+
**模型** 一栏也会这样提示;Bots 不会替你换模型。只调度时,任何 bot 把工作交给队友都会开任务,不只调度员;
|
|
135
|
+
但没有人给调度员开任务:队友发给它的消息直接进它自己的会话,由它转告你该知道的、把该做的活分派出去。
|
|
121
136
|
- **亲自动手**:0.7 的做法。调度员小事自己顺手做掉;bot 在自己的会话里给队友发消息,消息直接进队友自己的会话,不开任务。
|
|
122
137
|
已经开出的任务照常进行、照常汇报。
|
|
123
138
|
|
|
@@ -128,13 +143,17 @@ bot 默认用你说话的语言回答;中文提问就是中文协作。
|
|
|
128
143
|
任务会记住它来自哪个聊天:私聊、Slack 讨论串、Discord 子区或回复链、飞书话题或回复链、Telegram 话题,或者面板。
|
|
129
144
|
|
|
130
145
|
- **结果回到请求来的地方。** 做任务的 bot 自己把结果发到这个任务来自的聊天;聊天应用属于别的 bot 时,开头署上它的名字(`【Forge】`),
|
|
131
|
-
|
|
132
|
-
这一轮开的任务也要说明是给哪一个的。这一轮剩下的普通回复只留在面板里,标着
|
|
146
|
+
所以从两个聊天各派一件事,结果各回各的聊天。如果调度员的某一轮同时涉及好几个聊天(比如面板和一个聊天应用),它会用 `bot_reply` 分别回复,
|
|
147
|
+
这一轮开的任务也要说明是给哪一个的。这一轮剩下的普通回复只留在面板里,标着 **未发出**;每个聊天都已经回复过的话就不显示。
|
|
133
148
|
- **讨论串里的跟进直接交给任务。** 在 Slack 讨论串、Discord 子区或回复链、飞书话题或回复链、Telegram 话题里,
|
|
134
149
|
你之后在同一个讨论串里说的话,直接交给从这里开出的任务;调度员只收到一条提示,不会被唤醒。
|
|
135
150
|
在会话归档之前,已完成的任务收到这样的消息也会接着做;已停止的任务不会。
|
|
136
151
|
在 Slack、Discord 和飞书的群里,bot 会在你那条消息下面回复,所以群里每个请求都自成一个讨论串。
|
|
137
|
-
-
|
|
152
|
+
- **其他时候,讨论串和面板里一样各有各的会话。** 讨论串里没有进行中的任务时,第一条消息(比如群里 @ 它的那条)交给 bot 自己的会话;
|
|
153
|
+
bot 在那里答过之后,同一个讨论串里再说的话,交给从 bot 会话在这次往来处分出来的会话:看不到 bot 后来在别处聊的内容,
|
|
154
|
+
讨论串里说的也不会带回去。回复 bot 在聊天里发过的某条消息(飞书和 Discord 的回复、Slack 讨论串)也一样,从那条消息处分出来;
|
|
155
|
+
这要靠聊天应用告诉 Bots 发出的消息 id,所以只对 0.10 以后发出的消息有效。Telegram 只有论坛话题算讨论串,私聊里的“回复”不算。
|
|
156
|
+
- **私聊里的跟进交给调度员。** 私聊(以及没有讨论串的群)是一整段对话,新请求也从这里来,所以直接发的新消息交给调度员;
|
|
138
157
|
只有一个任务在这里提了问题、还在等回答时,这条消息才交给那个任务。有两个或更多任务在等回答时,消息仍交给调度员,
|
|
139
158
|
由它判断是在回答哪一个。
|
|
140
159
|
- 以 `@handle` 开头的消息,仍然直接进那个 bot 自己的会话。
|
|
@@ -166,7 +185,8 @@ bot 的聊天页和任务详情页都有,同时这个 bot 或任务会被标
|
|
|
166
185
|
Bot 在普通的 Harness 会话里工作,所以 Harness 能做的它都能做,不需要重复造轮子:
|
|
167
186
|
|
|
168
187
|
- **能力**:联网搜索、读写文件、运行命令与代码、Office 文档、AI 作图、子代理与工作流、交付文件……在「资料」页按能力开关,
|
|
169
|
-
比如让审查 bot
|
|
188
|
+
比如让审查 bot 不能运行命令。团队里有不止一个 bot 时,调度员不用 Harness 自带的子代理和工作流:要并行的活交给队友,
|
|
189
|
+
面板里能看到各自的任务(就算技能里写着「启动子代理」也一样);其他 bot 照常可以用;
|
|
170
190
|
- **技能**:
|
|
171
191
|
- **从 Harness 添加**:直接选你已经装好的技能(`~/.agents/skills`、`~/.dsh/skills` 等),引用而不复制,跟着更新;
|
|
172
192
|
- **从 GitHub 导入**:一键浏览 Anthropic 官方技能,或粘贴任意 `owner/repo/path`,整个技能文件夹连脚本一起导入;
|
|
@@ -190,7 +210,8 @@ Bot 在普通的 Harness 会话里工作,所以 Harness 能做的它都能做
|
|
|
190
210
|
| 地图与本地 | 高德地图 🔑、百度地图 🔑 |
|
|
191
211
|
| 自定义 | 任意本地(stdio)或远程(Streamable HTTP)MCP 服务 |
|
|
192
212
|
|
|
193
|
-
- **定时任务**:就是 Harness
|
|
213
|
+
- **定时任务**:就是 Harness 的定时任务,也出现在「自动化」页面。Harness 没开着时错过的定时任务,下次启动时由 Harness 补跑,
|
|
214
|
+
每个只补最近的那一次(这是 Harness 的规则,Bots 不另外补);团队的定时任务多时,启动后会一下子开出好几个任务、用掉不少 token。
|
|
194
215
|
- **AI 头像**:装了 [图片插件](../images) 就能按 bot 的人设生成头像。bot 自己也能做:让调度员给团队换一批头像,
|
|
195
216
|
说清楚想要的样子就行,也可以指给它一张本地图片。bot 画头像是在后台进行的,不耽误它回你的话:画的时候头像上有一圈在转,
|
|
196
217
|
画好就换上;画好了(或没画成、为什么)bot 会收到通知并告诉你。Harness 重启会丢掉正在画的头像。
|
|
@@ -224,6 +245,8 @@ bot 知道的事靠记忆延续。下面几种情况会开新话题:
|
|
|
224
245
|
|
|
225
246
|
对话接近模型上限时,Harness 自己仍会压缩;话题在那之前很久就让每次调用保持小而便宜。
|
|
226
247
|
任务的会话不算话题,任务结束它也就结束了。发起任务的 bot 即使已经换了新话题,任务的汇报照样送到它那里。
|
|
248
|
+
讨论串也不算话题:开新话题不影响已有的讨论串,回复上一个话题里的消息照样开讨论串。
|
|
249
|
+
开新话题时旧会话会归档,Bots 面板留在原地(以前会跳到 Harness 的对话界面)。
|
|
227
250
|
|
|
228
251
|
## 记忆
|
|
229
252
|
|
|
@@ -372,10 +395,13 @@ Slack 走 Socket Mode:由 Harness 主动连到 Slack,电脑不需要公网
|
|
|
372
395
|
|
|
373
396
|
- 每个 bot 有一个自己的普通 Harness 会话,位于 **Bots** 工作区(默认 `~/.dsh/bots/workspace`,可用 `workdir` 改);
|
|
374
397
|
它做的每个任务另有一个会话(`ticket-<id>`),也在这个工作区里。任务结束超过设置里的小时数后,它的会话在 Harness 里归档。
|
|
398
|
+
每个讨论串也是一个会话:用 Harness 的会话分叉,从 bot 的会话在被回复的那条消息处分出来,标题是「bot 名 · 那条消息的开头」;
|
|
399
|
+
一天没有动静就归档,再回复时取消归档接着用。
|
|
375
400
|
- 会话运行时,bot 的人设和团队名单加入系统提示词;它自己的技能、能力限制和应用只作用于它自己的会话。
|
|
376
401
|
任务的会话里,提示词还会说明这是哪个任务、谁发起的、怎么汇报。修改即时生效;新增或修改应用在下次会话启动时连接。
|
|
377
402
|
- 「只调度」模式下,`bot_send_message` 在 bot 自己的会话里调用就开一个任务并立刻返回;在任务的会话里调用,
|
|
378
|
-
|
|
403
|
+
要么带状态向发起方汇报,要么开一个子任务。发给调度员的不开任务,放进它自己的会话(从任务里发的会注明是哪个任务,
|
|
404
|
+
调度员回话时追加到那个任务)。「亲自动手」模式下,从 bot 自己的会话发出的消息放进对方的收件箱并唤醒它,
|
|
379
405
|
和 0.7 一样。同一对 bot 10 分钟内最多互发 16 条(新开的任务和追加给任务的消息都算),防止无限对话。
|
|
380
406
|
- 所有会话都能用 `bot_list`、`bot_create`、`bot_update`、`bot_delete`、`bot_send_message`、`bot_reply`、`bot_recall`、
|
|
381
407
|
`bot_ticket`、`bot_schedule` 管理 bot 和任务,以及 `memory_save`、`memory_forget`、`memory_search`。
|
|
@@ -388,7 +414,7 @@ Slack 走 Socket Mode:由 Harness 主动连到 Slack,电脑不需要公网
|
|
|
388
414
|
再加上插件自己的记忆调用。
|
|
389
415
|
- 聊天应用不是 MCP 服务:Host 为每个聊天应用保持一个连接(Telegram 用长轮询,Discord 用 Gateway,Slack 用 Socket Mode,飞书用长连接),
|
|
390
416
|
随你添加、修改、关闭或删除应用而启动和停止,并把配对者的消息作为用户提示交给 bot,开头标着 `[Telegram · 名字] (thread <key>)`;
|
|
391
|
-
|
|
417
|
+
讨论串里的跟进则交给那个讨论串的任务或它自己的会话(见[聊天与讨论串](#聊天与讨论串))。`bot_reply` 用的就是这个 key。
|
|
392
418
|
|
|
393
419
|
## Open Computer Use
|
|
394
420
|
|
|
@@ -401,7 +427,7 @@ Slack 走 Socket Mode:由 Harness 主动连到 Slack,电脑不需要公网
|
|
|
401
427
|
`channels.json`(每个聊天应用的配对者,以及每个聊天处理过的最后一条消息)、`tickets.json`(任务:交代的内容、汇报,
|
|
402
428
|
以及它们来自的聊天讨论串;已归档的任务保留最新的 500 个)、`avatars/`、`skills/`(从 GitHub 导入的技能)、
|
|
403
429
|
`memory/`(笔记、工作日志、每日摘要)、`usage.jsonl` 和 `tasks.jsonl`(每次调用和每个回合的 tokens,保留 400 天)、
|
|
404
|
-
`topics.json`、`settings.json`、`price-catalog.json`。`tickets.json` 读不出来(比如权限不对)时,Bots 不会启动,
|
|
430
|
+
`topics.json`、`discussions.json`(讨论串、每条消息在会话里的位置、看过的讨论串)、`settings.json`、`price-catalog.json`。`tickets.json` 读不出来(比如权限不对)时,Bots 不会启动,
|
|
405
431
|
并在 Harness 日志里说明原因,这样文件不会被覆盖;文件损坏时,会改名保存为 `tickets.json.corrupt-<时间>`,任务从空白开始。
|
|
406
432
|
- 自定义端点和借用的 Codex 登录写在 Harness 自己的模型设置(`llm-pi-ai`)和凭据库里。使用 Codex 登录时,
|
|
407
433
|
Harness 刷新得到的令牌会写回 `~/.codex/auth.json`。
|
|
@@ -427,12 +453,22 @@ git+https://github.com/kadaliao/dsh-plugins.git#main&path:/plugins/bots
|
|
|
427
453
|
|
|
428
454
|
安装后刷新一次页面。想要 AI 头像,再装上[图片插件](../images)。
|
|
429
455
|
|
|
456
|
+
## 从 0.9 升级
|
|
457
|
+
|
|
458
|
+
- 升级后**退出并重新打开 Harness** 一次。只刷新页面的话,界面是新的,Harness 里跑的还是旧版 Bots,
|
|
459
|
+
回复会落不进讨论串;面板顶部会提示这一点,直到重新打开。
|
|
460
|
+
- 不用做什么:bot、任务、记忆、定时任务、聊天应用和配对都原样保留;新增 `discussions.json` 存放讨论串。
|
|
461
|
+
- 0.9 话题里的消息照原来的先后显示在对话里,第一条消息下面有讨论串的链接;里面有进行中任务的,接着说的话仍交给任务。
|
|
462
|
+
- 升级前的消息也能回复:Bots 在会话记录里按时间找出那条消息的位置,从那里分出讨论串。找不到时(会话很长、或已经不在),
|
|
463
|
+
从会话最新处分出来,并告诉 bot 主对话可能已经往后走了,让它围绕那条消息回答。
|
|
464
|
+
- 讨论串用到 Harness 的会话分叉;Harness 不支持时,回复会提示先更新 Harness。
|
|
465
|
+
|
|
430
466
|
## 从 0.8 升级
|
|
431
467
|
|
|
432
468
|
- 不用做什么:bot、任务、记忆、定时任务、聊天应用和配对都原样保留。时间线 `messages.jsonl` 多了话题相关的字段,
|
|
433
469
|
以前的消息照旧留在主时间线。
|
|
434
470
|
- 升级前开出、来自某个聊天或面板的任务,之后汇报时也直接回复你,和新任务一样。
|
|
435
|
-
-
|
|
471
|
+
- 「只调度」的调度员在自己的会话里不再联网搜索(搜索交给队友的任务;0.10 起它不再派给自己);在它的 **能力** 一栏点 **重新打开** 可以放回。
|
|
436
472
|
|
|
437
473
|
## 从 0.7 升级
|
|
438
474
|
|
|
@@ -451,8 +487,10 @@ git+https://github.com/kadaliao/dsh-plugins.git#main&path:/plugins/bots
|
|
|
451
487
|
- 仅 Web 界面。
|
|
452
488
|
- 暂无 bot 群聊,bot 之间通过任务和私信协作。
|
|
453
489
|
- 在群聊里,bot 只听 @ 它(或回复它)的消息,不旁听群里的其他对话;0.8 没有改变这一点。
|
|
454
|
-
- 讨论串的历史从 0.8 开始:升级前的消息不属于任何讨论串,所以用 `bot_recall`
|
|
455
|
-
-
|
|
490
|
+
- 讨论串的历史从 0.8 开始:升级前的消息不属于任何讨论串,所以用 `bot_recall` 读某个聊天讨论串时,只能看到升级以后的内容。面板讨论串从 0.10 开始。
|
|
491
|
+
- 讨论串看不到主对话后来的内容,靠的是会话分叉;可分叉的位置要能在会话记录里找到。很旧的消息找不到位置时,
|
|
492
|
+
讨论串从会话最新处分出来,看得到后面的内容(bot 会被告知这一点)。
|
|
493
|
+
- 聊天应用里,回复 bot 某条消息算讨论串,只对 0.10 以后发出的消息有效;私聊里直接发的消息仍是一整段对话,交给调度员。
|
|
456
494
|
- 看门狗只看时间和状态,不判断任务的方向对不对。
|
|
457
495
|
- 费用是估算,网关、订阅和折扣的实际计费会不同;可以填自己的价格。
|
|
458
496
|
- 目前只能借用 Codex CLI 的登录;其他订阅请在 Harness 支持的情况下,到 设置 → 模型 里登录。
|