@researai/deepscientist 1.5.13 → 1.5.14
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/docs/en/05_TUI_GUIDE.md +466 -96
- package/docs/en/README.md +2 -0
- package/docs/zh/05_TUI_GUIDE.md +465 -82
- package/docs/zh/README.md +2 -0
- package/package.json +1 -1
- package/pyproject.toml +1 -1
- package/src/deepscientist/__init__.py +1 -1
- package/src/deepscientist/artifact/service.py +125 -2
- package/src/deepscientist/connector/lingzhu_support.py +23 -4
- package/src/deepscientist/daemon/app.py +111 -30
- package/src/deepscientist/mcp/server.py +161 -19
- package/src/deepscientist/prompts/builder.py +13 -54
- package/src/deepscientist/quest/service.py +99 -0
- package/src/deepscientist/quest/stage_views.py +134 -29
- package/src/deepscientist/shared.py +6 -1
- package/src/prompts/system.md +220 -2065
- package/src/skills/baseline/SKILL.md +265 -994
- package/src/skills/baseline/references/baseline-checklist-template.md +21 -32
- package/src/skills/baseline/references/baseline-plan-template.md +41 -57
- package/src/tui/dist/app/AppContainer.js +1442 -52
- package/src/tui/dist/components/Composer.js +1 -1
- package/src/tui/dist/components/ConfigScreen.js +190 -36
- package/src/tui/dist/components/GradientStatusText.js +1 -20
- package/src/tui/dist/components/InputPrompt.js +41 -32
- package/src/tui/dist/components/LoadingIndicator.js +1 -1
- package/src/tui/dist/components/Logo.js +61 -38
- package/src/tui/dist/components/MainContent.js +10 -3
- package/src/tui/dist/components/WelcomePanel.js +4 -12
- package/src/tui/dist/components/messages/AssistantMessage.js +1 -1
- package/src/tui/dist/components/messages/BashExecOperationMessage.js +3 -3
- package/src/tui/dist/components/messages/OperationMessage.js +1 -1
- package/src/tui/dist/index.js +28 -1
- package/src/tui/dist/layouts/DefaultAppLayout.js +3 -3
- package/src/tui/dist/lib/api.js +17 -0
- package/src/tui/dist/lib/connectors.js +261 -0
- package/src/tui/dist/semantic-colors.js +29 -19
- package/src/tui/package.json +1 -1
- package/src/ui/dist/assets/{AiManusChatView-CnJcXynW.js → AiManusChatView-DaF9Nge_.js} +12 -12
- package/src/ui/dist/assets/{AnalysisPlugin-DeyzPEhV.js → AnalysisPlugin-BSVx6dXE.js} +1 -1
- package/src/ui/dist/assets/{CliPlugin-CB1YODQn.js → CliPlugin-C9gzJX41.js} +9 -9
- package/src/ui/dist/assets/{CodeEditorPlugin-B-xicq1e.js → CodeEditorPlugin-DU9G0Tox.js} +8 -8
- package/src/ui/dist/assets/{CodeViewerPlugin-DT54ysXa.js → CodeViewerPlugin-DoX_fI9l.js} +5 -5
- package/src/ui/dist/assets/{DocViewerPlugin-DQtKT-VD.js → DocViewerPlugin-C4FWIXuU.js} +3 -3
- package/src/ui/dist/assets/{GitDiffViewerPlugin-hqHbCfnv.js → GitDiffViewerPlugin-BgfFMgtf.js} +20 -20
- package/src/ui/dist/assets/{ImageViewerPlugin-OcVo33jV.js → ImageViewerPlugin-tcPkfY_x.js} +5 -5
- package/src/ui/dist/assets/{LabCopilotPanel-DdGwhEUV.js → LabCopilotPanel-_dKV60Bf.js} +11 -11
- package/src/ui/dist/assets/{LabPlugin-Ciz1gDaX.js → LabPlugin-Bje0ayoC.js} +2 -2
- package/src/ui/dist/assets/{LatexPlugin-BhmjNQRC.js → LatexPlugin-CVsBzAln.js} +7 -7
- package/src/ui/dist/assets/{MarkdownViewerPlugin-BzdVH9Bx.js → MarkdownViewerPlugin-xjmrqv_8.js} +4 -4
- package/src/ui/dist/assets/{MarketplacePlugin-DmyHspXt.js → MarketplacePlugin-mMM2A8wP.js} +3 -3
- package/src/ui/dist/assets/{NotebookEditor-BTVYRGkm.js → NotebookEditor-3kVDSOBo.js} +11 -11
- package/src/ui/dist/assets/{NotebookEditor-BMXKrDRk.js → NotebookEditor-SoJ8X-MO.js} +1 -1
- package/src/ui/dist/assets/{PdfLoader-CvcjJHXv.js → PdfLoader-DElVuHl9.js} +1 -1
- package/src/ui/dist/assets/{PdfMarkdownPlugin-DW2ej8Vk.js → PdfMarkdownPlugin-Bq88XT4G.js} +2 -2
- package/src/ui/dist/assets/{PdfViewerPlugin-CmlDxbhU.js → PdfViewerPlugin-CsCXMo9S.js} +10 -10
- package/src/ui/dist/assets/{SearchPlugin-DAjQZPSv.js → SearchPlugin-oUPvy19k.js} +1 -1
- package/src/ui/dist/assets/{TextViewerPlugin-C-nVAZb_.js → TextViewerPlugin-CRkT9yNy.js} +5 -5
- package/src/ui/dist/assets/{VNCViewer-D7-dIYon.js → VNCViewer-BgbuvWhR.js} +10 -10
- package/src/ui/dist/assets/{bot-C_G4WtNI.js → bot-v_RASACv.js} +1 -1
- package/src/ui/dist/assets/{code-Cd7WfiWq.js → code-5hC9d0VH.js} +1 -1
- package/src/ui/dist/assets/{file-content-B57zsL9y.js → file-content-D1PxfOrp.js} +1 -1
- package/src/ui/dist/assets/{file-diff-panel-DVoheLFq.js → file-diff-panel-DG1oT_Hj.js} +1 -1
- package/src/ui/dist/assets/{file-socket-B5kXFxZP.js → file-socket-BmdFYQlk.js} +1 -1
- package/src/ui/dist/assets/{image-LLOjkMHF.js → image-Dqe2X2tW.js} +1 -1
- package/src/ui/dist/assets/{index-Dxa2eYMY.js → index-DVsMKK_y.js} +1 -1
- package/src/ui/dist/assets/{index-C3r2iGrp.js → index-Duvz8Ip0.js} +12 -12
- package/src/ui/dist/assets/{index-CLQauncb.js → index-Nt9hS4ck.js} +470 -165
- package/src/ui/dist/assets/{index-hOUOWbW2.js → index-RDlNXXx1.js} +2 -2
- package/src/ui/dist/assets/{monaco-BGGAEii3.js → monaco-DIXge1CP.js} +1 -1
- package/src/ui/dist/assets/{pdf-effect-queue-DlEr1_y5.js → pdf-effect-queue-BBTTQaO-.js} +1 -1
- package/src/ui/dist/assets/{popover-CWJbJuYY.js → popover-BWlolyxo.js} +1 -1
- package/src/ui/dist/assets/{project-sync-CRJiucYO.js → project-sync-BM5PkFH4.js} +1 -1
- package/src/ui/dist/assets/{select-CoHB7pvH.js → select-D4dAtrA8.js} +2 -2
- package/src/ui/dist/assets/{sigma-D5aJWR8J.js → sigma-CKbE5jJT.js} +1 -1
- package/src/ui/dist/assets/{square-check-big-DUK_mnkS.js → square-check-big-CZNGMgiB.js} +1 -1
- package/src/ui/dist/assets/{trash-ChU3SEE3.js → trash-DaB37xAz.js} +1 -1
- package/src/ui/dist/assets/{useCliAccess-BrJBV3tY.js → useCliAccess-C2OmAcWe.js} +1 -1
- package/src/ui/dist/assets/{useFileDiffOverlay-C2OQaVWc.js → useFileDiffOverlay-Dowd1Ij4.js} +1 -1
- package/src/ui/dist/assets/{wrap-text-C7Qqh-om.js → wrap-text-BGjAhAUq.js} +1 -1
- package/src/ui/dist/assets/{zoom-out-rtX0FKya.js → zoom-out-dMZQMXzc.js} +1 -1
- package/src/ui/dist/index.html +1 -1
- package/uv.lock +1 -1
package/docs/en/05_TUI_GUIDE.md
CHANGED
|
@@ -1,141 +1,511 @@
|
|
|
1
|
-
# 05 TUI Guide:
|
|
1
|
+
# 05 TUI End-To-End Guide: Run The Full Flow In Terminal
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This guide is for one concrete goal:
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- start from `ds --tui`
|
|
6
|
+
- understand which mode the TUI is in
|
|
7
|
+
- create or switch quests correctly
|
|
8
|
+
- configure QQ, Weixin, and Lingzhu from the TUI
|
|
9
|
+
- bind the right connector target to the current quest
|
|
10
|
+
- continue the same quest across TUI, Web, QQ, Weixin, and Rokid without losing context
|
|
6
11
|
|
|
7
|
-
|
|
12
|
+
If you want the lower-level runtime and Canvas details afterward, also read [06 Runtime and Canvas](./06_RUNTIME_AND_CANVAS.md).
|
|
8
13
|
|
|
9
|
-
|
|
14
|
+
## 1. Learn The Three TUI Surfaces First
|
|
15
|
+
|
|
16
|
+
The current TUI is not just one chat box. It moves between three working surfaces:
|
|
17
|
+
|
|
18
|
+
1. `home / request mode`
|
|
19
|
+
The current terminal session is not bound to a quest yet.
|
|
20
|
+
You can preview quests, create a new quest, and open config, but plain text does not go to any quest.
|
|
21
|
+
2. `quest mode`
|
|
22
|
+
The current terminal session is already bound to one quest.
|
|
23
|
+
Plain text becomes a normal user message for that quest.
|
|
24
|
+
3. `config mode`
|
|
25
|
+
You are browsing local config, quest config, or connector config.
|
|
26
|
+
This mode is mainly operated with `↑/↓`, `Enter`, and `Esc`.
|
|
27
|
+
|
|
28
|
+
In practice:
|
|
29
|
+
|
|
30
|
+
- `home` is for choosing work
|
|
31
|
+
- `quest` is for advancing work
|
|
32
|
+
- `config` is for wiring external collaboration surfaces and editing configuration
|
|
33
|
+
|
|
34
|
+
## 2. Install And Start
|
|
35
|
+
|
|
36
|
+
From the repository root:
|
|
10
37
|
|
|
11
38
|
```bash
|
|
12
39
|
uv sync
|
|
13
40
|
npm install
|
|
14
41
|
```
|
|
15
42
|
|
|
16
|
-
|
|
43
|
+
The most common start command:
|
|
17
44
|
|
|
18
45
|
```bash
|
|
19
|
-
ds
|
|
20
46
|
ds --tui
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Also useful:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
ds
|
|
21
53
|
ds --both
|
|
22
54
|
ds --status
|
|
23
55
|
ds --stop
|
|
24
56
|
```
|
|
25
57
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
- `ds
|
|
29
|
-
- `ds --tui
|
|
30
|
-
- `ds --both
|
|
31
|
-
- `ds --
|
|
32
|
-
- `
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
58
|
+
Meaning:
|
|
59
|
+
|
|
60
|
+
- `ds`: start the daemon, print the local Web URL, try to open the browser, then exit.
|
|
61
|
+
- `ds --tui`: start the daemon and enter the terminal workspace.
|
|
62
|
+
- `ds --both`: open Web and TUI together.
|
|
63
|
+
- `ds --status`: inspect daemon status.
|
|
64
|
+
- `ds --stop`: stop the daemon itself, not just one quest.
|
|
65
|
+
|
|
66
|
+
## 3. What To Look At First After Entering TUI
|
|
67
|
+
|
|
68
|
+
When the TUI opens, the first useful signals are:
|
|
69
|
+
|
|
70
|
+
- whether you are in `request mode` or `quest mode`
|
|
71
|
+
- the local Web URL
|
|
72
|
+
- which quests are available to switch to
|
|
73
|
+
|
|
74
|
+
If the welcome area says `request mode`, the current terminal session is not bound to a quest yet.
|
|
75
|
+
|
|
76
|
+
The correct next move is not plain text. Do one of these first:
|
|
77
|
+
|
|
78
|
+
- create a new quest: `/new <goal>`
|
|
79
|
+
- bind an existing quest: `/use <quest_id>`
|
|
80
|
+
|
|
81
|
+
For example:
|
|
82
|
+
|
|
83
|
+
```text
|
|
84
|
+
/new Reproduce the current baseline and turn it into a comparable experiment plan
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
or:
|
|
88
|
+
|
|
89
|
+
```text
|
|
90
|
+
/use 001
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## 4. Shortest Working Path: From Zero To The First Quest
|
|
94
|
+
|
|
95
|
+
This is the first path I recommend.
|
|
96
|
+
|
|
97
|
+
### Step 1. Start TUI
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
ds --tui
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Step 2. Create a quest
|
|
104
|
+
|
|
105
|
+
Enter:
|
|
106
|
+
|
|
107
|
+
```text
|
|
108
|
+
/new Run the baseline in this repo once and tell me what configuration is still missing
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
The TUI will automatically switch into that new quest.
|
|
112
|
+
|
|
113
|
+
### Step 3. Wait for the first run to start
|
|
114
|
+
|
|
115
|
+
`/new <goal>` does not only create the quest. It also starts the first run.
|
|
116
|
+
|
|
117
|
+
You should then see:
|
|
118
|
+
|
|
119
|
+
- the quest is already bound
|
|
120
|
+
- the history area starts showing messages, artifacts, or operations
|
|
121
|
+
- the status line shows the active quest id
|
|
122
|
+
|
|
123
|
+
### Step 4. Send one normal message
|
|
124
|
+
|
|
125
|
+
For example:
|
|
126
|
+
|
|
127
|
+
```text
|
|
128
|
+
Stay narrow. First get the baseline running, then tell me exactly which settings are still missing.
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
That message goes to the currently bound quest.
|
|
132
|
+
|
|
133
|
+
### Step 5. Check `/status` and `/graph`
|
|
134
|
+
|
|
135
|
+
Useful commands:
|
|
136
|
+
|
|
137
|
+
```text
|
|
138
|
+
/status
|
|
139
|
+
/graph
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
- `/status`: inspect the current quest state
|
|
143
|
+
- `/graph`: inspect the quest graph and research progress
|
|
144
|
+
|
|
145
|
+
### Step 6. Open Web anytime
|
|
146
|
+
|
|
147
|
+
Inside TUI:
|
|
148
|
+
|
|
149
|
+
- `Ctrl+O`: open the Web workspace for the current quest
|
|
150
|
+
|
|
151
|
+
That matters because TUI and Web are looking at the same daemon, the same quest, and the same event stream.
|
|
152
|
+
|
|
153
|
+
## 5. Most Useful Commands And Keys
|
|
154
|
+
|
|
155
|
+
### Commands
|
|
156
|
+
|
|
157
|
+
- `/home`: return to unbound request mode
|
|
158
|
+
- `/projects`: open the quest browser
|
|
159
|
+
- `/use <quest_id>`: bind to a specific quest
|
|
160
|
+
- `/new <goal>`: create a new quest
|
|
161
|
+
- `/delete <quest_id> --yes`: delete a quest
|
|
162
|
+
- `/pause`: pause the current quest; if no quest is bound, open the selector
|
|
163
|
+
- `/resume`: resume the current quest; if no quest is bound, open the selector
|
|
164
|
+
- `/stop`: stop the current quest; if no quest is bound, open the selector
|
|
165
|
+
- `/stop <quest_id>`: stop a specific quest explicitly
|
|
166
|
+
- `/status`: inspect the current quest status
|
|
167
|
+
- `/graph`: inspect the current quest graph
|
|
168
|
+
- `/config`: open config
|
|
169
|
+
- `/config connectors`: open the connector list directly
|
|
170
|
+
- `/config qq`: open QQ config directly
|
|
171
|
+
- `/config weixin`: open Weixin config directly
|
|
172
|
+
- `/config lingzhu`: open Lingzhu config directly
|
|
173
|
+
|
|
174
|
+
### Keys
|
|
175
|
+
|
|
176
|
+
- `Enter`: send input or confirm the current selection
|
|
177
|
+
- `↑/↓`: move selection
|
|
178
|
+
- `Tab`: move forward in list selection
|
|
179
|
+
- `Esc`: go back one layer or close the current panel
|
|
180
|
+
- `Ctrl+R`: force refresh
|
|
181
|
+
- `Ctrl+O`: open the Web workspace
|
|
182
|
+
- `Ctrl+G`: open the config home directly
|
|
183
|
+
- `Ctrl+B`: leave the current quest; if you are in config first, close config
|
|
66
184
|
- `Ctrl+C`: quit the TUI
|
|
185
|
+
- `Shift+↑/↓`: scroll the history area by one line
|
|
186
|
+
- `PageUp/PageDown`: scroll the history area by one page
|
|
187
|
+
|
|
188
|
+
## 6. Recommended Daily Rhythm
|
|
189
|
+
|
|
190
|
+
If TUI is your main surface, keep this order:
|
|
191
|
+
|
|
192
|
+
1. confirm whether a quest is already bound
|
|
193
|
+
2. then send messages
|
|
194
|
+
3. use `/projects` or `/use` when you need to switch quests
|
|
195
|
+
4. before touching connectors, confirm which quest is current
|
|
196
|
+
|
|
197
|
+
The reason is simple:
|
|
198
|
+
|
|
199
|
+
- connector binding actions bind to the current quest
|
|
200
|
+
- if you open `/config qq` without an active quest, TUI can save the connector config, but it cannot bind a detected runtime target to a quest for you
|
|
201
|
+
|
|
202
|
+
So the normal order should be:
|
|
203
|
+
|
|
204
|
+
1. `/new <goal>` or `/use <quest_id>`
|
|
205
|
+
2. confirm you are in quest mode
|
|
206
|
+
3. then open `/config qq`, `/config weixin`, or `/config lingzhu`
|
|
207
|
+
|
|
208
|
+
## 7. The Right Order For Connector Setup In TUI
|
|
209
|
+
|
|
210
|
+
The current best-practice order is:
|
|
211
|
+
|
|
212
|
+
1. create or switch to the quest you want to continue
|
|
213
|
+
2. open the connector detail page
|
|
214
|
+
3. read the top guide first
|
|
215
|
+
4. finish the platform-side action in that order
|
|
216
|
+
5. come back to TUI and run save, refresh, or bind
|
|
217
|
+
|
|
218
|
+
### Why the top guide matters now
|
|
219
|
+
|
|
220
|
+
The connector detail header is no longer decorative text. It is the actual next-step instruction.
|
|
67
221
|
|
|
68
|
-
|
|
222
|
+
- `QQ`: it tells you to fill credentials first, then send the first private QQ message, then wait for OpenID and conversation targets to appear
|
|
223
|
+
- `Weixin`: it tells you to create the QR code first and scan it with WeChat
|
|
224
|
+
- `Lingzhu`: it tells you to set a public `public_base_url` first and then copy the generated values into Rokid
|
|
69
225
|
|
|
70
|
-
|
|
226
|
+
## 8. QQ: Run The Full Binding Chain In TUI
|
|
71
227
|
|
|
72
|
-
|
|
73
|
-
2. That first launch message is claimed by the run and does not get re-delivered later through the mailbox.
|
|
74
|
-
3. Later user messages that arrive while the agent is already running are written into `.ds/user_message_queue.json`.
|
|
75
|
-
4. Those queued messages are delivered only when the agent calls `artifact.interact(...)`.
|
|
76
|
-
5. When delivery happens, the agent receives the queued bundle as the latest user requirements and the queue entries move from `pending` to completed audit records.
|
|
77
|
-
6. If there is no new user message and the quest is still unfinished, the runtime can auto-start another turn so the agent keeps advancing from durable state instead of idling.
|
|
78
|
-
7. If there is no new user message, the runtime returns recent interaction records plus the instruction that the user did not send anything new.
|
|
228
|
+
This is the easiest flow to misuse, so it needs its own section.
|
|
79
229
|
|
|
80
|
-
|
|
230
|
+
### Recommended path
|
|
231
|
+
|
|
232
|
+
1. enter the target quest first
|
|
233
|
+
2. run `/config qq`
|
|
234
|
+
3. read the top guide
|
|
235
|
+
4. fill `Bot name`, `App ID`, and `App Secret`
|
|
236
|
+
5. run `Save Connector`
|
|
237
|
+
6. send the bot one private QQ message from your own QQ account
|
|
238
|
+
7. return to TUI and wait for auto-refresh, or press `Ctrl+R`
|
|
239
|
+
8. confirm that `Detected OpenID` and `Last conversation` are no longer empty
|
|
240
|
+
9. use the target action shown below to bind the current quest to the correct QQ target
|
|
241
|
+
|
|
242
|
+
### What you will see on the QQ page
|
|
243
|
+
|
|
244
|
+
Usually two top sections matter:
|
|
245
|
+
|
|
246
|
+
- `Top Guide`
|
|
247
|
+
This tells you what to do next.
|
|
248
|
+
- `Current Status`
|
|
249
|
+
This tells you what step is still missing.
|
|
250
|
+
|
|
251
|
+
Key fields:
|
|
252
|
+
|
|
253
|
+
- `Detected OpenID`
|
|
254
|
+
This is learned automatically from runtime activity. It is not supposed to be typed first.
|
|
255
|
+
- `Last conversation`
|
|
256
|
+
This is the latest conversation id seen by the runtime.
|
|
257
|
+
- `Discovered targets`
|
|
258
|
+
These are the runtime targets that TUI can already use for quest binding.
|
|
259
|
+
- `Profile · ...`
|
|
260
|
+
When QQ has multiple profiles, TUI now shows one runtime summary block per profile so you can see the detected OpenID, preferred target, current bound quest, and readiness state without switching back to Web first.
|
|
261
|
+
|
|
262
|
+
### The right way to think about QQ binding
|
|
263
|
+
|
|
264
|
+
There are two separate layers:
|
|
265
|
+
|
|
266
|
+
1. save QQ bot credentials
|
|
267
|
+
2. bind one runtime target to the current quest
|
|
268
|
+
|
|
269
|
+
Finishing only layer 1 does not mean the flow is complete.
|
|
270
|
+
|
|
271
|
+
A fully working QQ flow means:
|
|
272
|
+
|
|
273
|
+
- `Detected OpenID` is visible
|
|
274
|
+
- target actions are visible
|
|
275
|
+
- the current quest is bound to the correct QQ target
|
|
276
|
+
|
|
277
|
+
### Current TUI limits
|
|
278
|
+
|
|
279
|
+
- if you have multiple QQ profiles, the TUI detail page still warns that profile add, delete, and credential replacement are raw-config tasks
|
|
280
|
+
- adding or deleting multiple profiles is still better done in raw `connectors.yaml` or in Web settings
|
|
281
|
+
- per-profile summaries and runtime target bindings are visible directly in TUI
|
|
282
|
+
|
|
283
|
+
## 9. Weixin: Run The Full Binding Chain In TUI
|
|
284
|
+
|
|
285
|
+
### Recommended path
|
|
286
|
+
|
|
287
|
+
1. enter the target quest first
|
|
288
|
+
2. run `/config weixin`
|
|
289
|
+
3. choose `Bind Weixin` or `Rebind Weixin`
|
|
290
|
+
4. TUI switches into the QR page
|
|
291
|
+
5. scan with the target WeChat account on the phone
|
|
292
|
+
6. confirm the login in WeChat
|
|
293
|
+
7. after success, TUI returns to the detail page automatically
|
|
294
|
+
8. confirm that `Bot account`, `Owner account`, and `Known targets` are refreshed
|
|
295
|
+
|
|
296
|
+
### Current behavior that matters
|
|
297
|
+
|
|
298
|
+
- you do not need to type a bot token manually
|
|
299
|
+
- the QR code is generated directly inside TUI
|
|
300
|
+
- after the QR login succeeds, the connector config is saved automatically
|
|
301
|
+
|
|
302
|
+
### When the flow is actually done
|
|
303
|
+
|
|
304
|
+
At minimum:
|
|
305
|
+
|
|
306
|
+
- the detail page no longer looks unbound
|
|
307
|
+
- `Bot account` is not empty
|
|
308
|
+
- `Owner account` is not empty
|
|
309
|
+
|
|
310
|
+
If you want to use Weixin to keep advancing a quest, bind the relevant Weixin conversation to that quest afterward.
|
|
311
|
+
|
|
312
|
+
## 10. Lingzhu / Rokid: Run The Full Binding Chain In TUI
|
|
313
|
+
|
|
314
|
+
The key point for Lingzhu is not "click once and finish". The TUI generates platform fields, and you copy them into Rokid.
|
|
315
|
+
|
|
316
|
+
### Recommended path
|
|
317
|
+
|
|
318
|
+
1. enter the target quest first
|
|
319
|
+
2. run `/config lingzhu`
|
|
320
|
+
3. set `Public base URL` to the final public address
|
|
321
|
+
4. if needed, generate a new `Custom agent AK`
|
|
322
|
+
5. read the generated Rokid fields shown on the detail page
|
|
323
|
+
6. copy those values into the Rokid platform
|
|
324
|
+
7. return to TUI and run `Save Connector`
|
|
325
|
+
|
|
326
|
+
### What to watch carefully
|
|
327
|
+
|
|
328
|
+
- `public_base_url` must be the final public `http(s)` address
|
|
329
|
+
- `127.0.0.1`, `localhost`, and private LAN addresses are not valid for a real Rokid device
|
|
330
|
+
- the detail page now shows the same Rokid-facing generated fields as the Web popup:
|
|
331
|
+
- `Custom agent ID`
|
|
332
|
+
- `Custom agent URL`
|
|
333
|
+
- `Custom agent AK`
|
|
334
|
+
- `Agent name`
|
|
335
|
+
- `Category`
|
|
336
|
+
- `Capability summary`
|
|
337
|
+
- `Opening message`
|
|
338
|
+
- `Input type`
|
|
339
|
+
- use `PgUp` / `PgDn` if the full generated field list does not fit in one terminal screen
|
|
340
|
+
|
|
341
|
+
### When the flow is actually done
|
|
342
|
+
|
|
343
|
+
At minimum:
|
|
344
|
+
|
|
345
|
+
- `Public base URL` is a public address
|
|
346
|
+
- `Custom agent AK` is generated or filled
|
|
347
|
+
- the fields shown in the top guide have been copied into Rokid
|
|
348
|
+
- the connector has been saved
|
|
349
|
+
|
|
350
|
+
## 11. Three Full Recommended Scripts
|
|
351
|
+
|
|
352
|
+
If you want to run "create quest + configure connector + continue work" on a server through TUI, follow one of these.
|
|
353
|
+
|
|
354
|
+
### Script A: QQ
|
|
355
|
+
|
|
356
|
+
1. `ds --tui`
|
|
357
|
+
2. `/new <goal>`
|
|
358
|
+
3. wait for the quest to auto-start
|
|
359
|
+
4. `/config qq`
|
|
360
|
+
5. fill `Bot name / App ID / App Secret`
|
|
361
|
+
6. `Save Connector`
|
|
362
|
+
7. send one private QQ message to the bot
|
|
363
|
+
8. return to TUI and confirm `Detected OpenID` plus a target are visible
|
|
364
|
+
9. run the `Bind ...` action to bind the current quest to that QQ target
|
|
365
|
+
10. continue through QQ, TUI, or Web
|
|
366
|
+
|
|
367
|
+
### Script B: Weixin
|
|
368
|
+
|
|
369
|
+
1. `ds --tui`
|
|
370
|
+
2. `/new <goal>` or `/use <quest_id>`
|
|
371
|
+
3. `/config weixin`
|
|
372
|
+
4. `Bind Weixin`
|
|
373
|
+
5. scan and confirm on the phone
|
|
374
|
+
6. wait until TUI returns to the detail page
|
|
375
|
+
7. confirm the binding fields are refreshed
|
|
376
|
+
8. continue inside the quest
|
|
377
|
+
|
|
378
|
+
### Script C: Lingzhu
|
|
379
|
+
|
|
380
|
+
1. `ds --tui`
|
|
381
|
+
2. `/new <goal>` or `/use <quest_id>`
|
|
382
|
+
3. `/config lingzhu`
|
|
383
|
+
4. update `Public base URL`
|
|
384
|
+
5. generate or fill `Custom agent AK`
|
|
385
|
+
6. copy the top guide values into Rokid
|
|
386
|
+
7. `Save Connector`
|
|
387
|
+
8. then do the device-side connectivity check
|
|
388
|
+
|
|
389
|
+
## 12. TUI, Web, And Connectors Are The Same Quest
|
|
390
|
+
|
|
391
|
+
This point matters.
|
|
392
|
+
|
|
393
|
+
These TUI actions:
|
|
394
|
+
|
|
395
|
+
- `/new`
|
|
396
|
+
- `/use`
|
|
397
|
+
- plain messages
|
|
398
|
+
- `/pause`, `/resume`, `/stop`
|
|
399
|
+
- connector binding
|
|
400
|
+
|
|
401
|
+
all write into the same daemon and the same durable quest state.
|
|
402
|
+
|
|
403
|
+
So:
|
|
404
|
+
|
|
405
|
+
- a quest created in TUI is visible in Web immediately
|
|
406
|
+
- a connector bound in TUI is visible in Web immediately
|
|
407
|
+
- a conversation continued in QQ or Weixin returns to the same quest that TUI and Web see
|
|
408
|
+
|
|
409
|
+
TUI is not a second state system. It is another surface over the same quest.
|
|
410
|
+
|
|
411
|
+
## 13. Mailbox Semantics: Why The Agent May Not See A New Message Immediately
|
|
412
|
+
|
|
413
|
+
TUI, Web, and connectors share the same mailbox semantics.
|
|
414
|
+
|
|
415
|
+
Core rules:
|
|
416
|
+
|
|
417
|
+
1. when a quest is idle, the first normal user message starts a turn directly
|
|
418
|
+
2. while a quest is already running, later messages are queued first
|
|
419
|
+
3. queued messages are only delivered when the agent calls `artifact.interact(...)`
|
|
420
|
+
|
|
421
|
+
Durable quest files involved:
|
|
81
422
|
|
|
82
423
|
- `.ds/runtime_state.json`
|
|
83
424
|
- `.ds/user_message_queue.json`
|
|
84
425
|
- `.ds/interaction_journal.jsonl`
|
|
85
426
|
- `.ds/events.jsonl`
|
|
86
427
|
|
|
87
|
-
|
|
428
|
+
So:
|
|
429
|
+
|
|
430
|
+
- a follow-up sentence may not reach the agent within one second
|
|
431
|
+
- it is not lost; it is waiting in the mailbox for the next interaction point
|
|
88
432
|
|
|
89
|
-
|
|
433
|
+
## 14. How To Think About Pause / Resume / Stop
|
|
90
434
|
|
|
91
|
-
- `/pause
|
|
92
|
-
- `/resume
|
|
93
|
-
- `/stop
|
|
94
|
-
- `/pause`, `/resume`, and `/stop` also append a visible assistant-side control notice into the quest chat history and push the same notice to bound connectors using the normal connector routing policy.
|
|
435
|
+
- `/pause`: interrupt the current runner and mark the quest as `paused`
|
|
436
|
+
- `/resume`: move a `paused` or `stopped` quest back to `active`
|
|
437
|
+
- `/stop`: a stronger interruption that marks the quest as `stopped`
|
|
95
438
|
|
|
96
|
-
`/stop`
|
|
439
|
+
`/stop` is stronger than `/pause` because:
|
|
97
440
|
|
|
98
|
-
-
|
|
99
|
-
-
|
|
100
|
-
-
|
|
101
|
-
- the next user message after stop starts a fresh turn in the same quest context without silently replaying stale queued text
|
|
102
|
-
- stop does not rewrite Git state: the current branch, worktree, and already written files remain in place, so follow-up work resumes from the same repository context
|
|
441
|
+
- undelivered mailbox messages are cancelled
|
|
442
|
+
- stale messages are not silently replayed on the next turn
|
|
443
|
+
- but Git branches, worktrees, and already written files remain intact
|
|
103
444
|
|
|
104
|
-
|
|
445
|
+
So if you only want to pause for a while, prefer `/pause`.
|
|
446
|
+
If you want to cut off the current turn clearly, prefer `/stop`.
|
|
447
|
+
|
|
448
|
+
## 15. Troubleshooting
|
|
449
|
+
|
|
450
|
+
### Problem 1: I entered TUI, but plain text does nothing
|
|
451
|
+
|
|
452
|
+
Check first:
|
|
453
|
+
|
|
454
|
+
- are you still in `request mode`
|
|
455
|
+
- did you run `/use <quest_id>` or `/new <goal>` first
|
|
456
|
+
|
|
457
|
+
Without a bound quest, plain text is not sent.
|
|
458
|
+
|
|
459
|
+
### Problem 2: `Detected OpenID` stays empty in QQ
|
|
460
|
+
|
|
461
|
+
Check in order:
|
|
462
|
+
|
|
463
|
+
1. did you save `App ID / App Secret` first
|
|
464
|
+
2. did you really send the bot the first private QQ message
|
|
465
|
+
3. did you wait for one refresh cycle or press `Ctrl+R`
|
|
466
|
+
|
|
467
|
+
### Problem 3: I can see QQ targets, but there is no bind action
|
|
468
|
+
|
|
469
|
+
Usually that means:
|
|
470
|
+
|
|
471
|
+
- there is no active quest right now
|
|
472
|
+
|
|
473
|
+
Run:
|
|
474
|
+
|
|
475
|
+
```text
|
|
476
|
+
/use <quest_id>
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
Then go back to:
|
|
480
|
+
|
|
481
|
+
```text
|
|
482
|
+
/config qq
|
|
483
|
+
```
|
|
105
484
|
|
|
106
|
-
|
|
107
|
-
- it validates both `home` and `daemon_id` before touching the daemon
|
|
108
|
-
- it first asks the daemon to stop cleanly
|
|
109
|
-
- if needed it escalates to `SIGTERM`, then `SIGKILL`
|
|
110
|
-
- if shutdown succeeds, the launcher clears the daemon state file and prints `DeepScientist daemon stopped.`
|
|
111
|
-
- a clean daemon shutdown stops any actively running quests first, emits the same stop notice, and leaves Git/worktree state untouched for the next daemon start
|
|
485
|
+
### Problem 4: I scanned the Weixin QR code, but the page did not return
|
|
112
486
|
|
|
113
|
-
|
|
487
|
+
Check:
|
|
114
488
|
|
|
115
|
-
|
|
489
|
+
- whether the login was really confirmed on the phone
|
|
490
|
+
- whether the daemon is still online
|
|
116
491
|
|
|
117
|
-
|
|
118
|
-
- `decision_request` is the blocking form
|
|
119
|
-
- a blocking decision request should provide 1 to 3 concrete options, explain pros and cons, wait up to 1 day when feasible, then self-resolve and notify the user if the timeout expires
|
|
120
|
-
- true quest completion is separate from a normal decision request: the agent should first ask for explicit completion approval with `reply_schema.decision_type = quest_completion_approval`, and only then call `artifact.complete_quest(...)`
|
|
492
|
+
If unsure, press `Ctrl+R` once.
|
|
121
493
|
|
|
122
|
-
|
|
494
|
+
### Problem 5: Lingzhu is filled, but the device still cannot connect
|
|
123
495
|
|
|
124
|
-
|
|
496
|
+
Confirm:
|
|
125
497
|
|
|
126
|
-
-
|
|
127
|
-
-
|
|
128
|
-
-
|
|
129
|
-
- inspect `.ds/events.jsonl` for `runner.turn_error`, `quest.control`, or `artifact.recorded`
|
|
498
|
+
- `Public base URL` is publicly reachable
|
|
499
|
+
- it is not `localhost`, `127.0.0.1`, or a private LAN address
|
|
500
|
+
- the Rokid platform is using the values shown in the top guide, not a local address
|
|
130
501
|
|
|
131
|
-
|
|
502
|
+
## 16. A Simple Final Check
|
|
132
503
|
|
|
133
|
-
|
|
134
|
-
- inspect `.ds/user_message_queue.json`
|
|
135
|
-
- confirm the agent is calling `artifact.interact(...)` during long work
|
|
504
|
+
If you want to know whether you can really run the TUI flow end to end, check whether all four are true:
|
|
136
505
|
|
|
137
|
-
|
|
506
|
+
1. you can create or bind a quest from `request mode`
|
|
507
|
+
2. you can send messages and inspect status in `quest mode`
|
|
508
|
+
3. you can configure at least one connector inside `/config`
|
|
509
|
+
4. you understand that "connector saved" is not always the same as "quest bound", and you know where the quest binding action lives
|
|
138
510
|
|
|
139
|
-
|
|
140
|
-
- verify the quest becomes `stopped`
|
|
141
|
-
- for a full daemon shutdown use `ds --stop`
|
|
511
|
+
If all four are true, you can already run the main TUI workflow end to end.
|
package/docs/en/README.md
CHANGED
|
@@ -30,6 +30,8 @@ This page is the shortest path to the right document.
|
|
|
30
30
|
|
|
31
31
|
- [00 Quick Start](./00_QUICK_START.md)
|
|
32
32
|
Start here if you want to install DeepScientist, launch it locally, and create your first project.
|
|
33
|
+
- [05 TUI Guide](./05_TUI_GUIDE.md)
|
|
34
|
+
Read this if your main surface is the terminal and you want one end-to-end path through `ds --tui`, quests, connectors, and cross-surface work.
|
|
33
35
|
- [15 Codex Provider Setup](./15_CODEX_PROVIDER_SETUP.md)
|
|
34
36
|
Read this when you want to run DeepScientist through MiniMax, GLM, Volcengine Ark, Alibaba Bailian, or another Codex profile.
|
|
35
37
|
- [12 Guided Workflow Tour](./12_GUIDED_WORKFLOW_TOUR.md)
|