@researai/deepscientist 1.5.0 → 1.5.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.
Files changed (163) hide show
  1. package/AGENTS.md +26 -0
  2. package/README.md +19 -179
  3. package/assets/connectors/lingzhu/openclaw-bridge/README.md +124 -0
  4. package/assets/connectors/lingzhu/openclaw-bridge/index.ts +162 -0
  5. package/assets/connectors/lingzhu/openclaw-bridge/openclaw.plugin.json +145 -0
  6. package/assets/connectors/lingzhu/openclaw-bridge/package.json +35 -0
  7. package/assets/connectors/lingzhu/openclaw-bridge/src/cli.ts +180 -0
  8. package/assets/connectors/lingzhu/openclaw-bridge/src/config.ts +196 -0
  9. package/assets/connectors/lingzhu/openclaw-bridge/src/debug-log.ts +111 -0
  10. package/assets/connectors/lingzhu/openclaw-bridge/src/events.ts +4 -0
  11. package/assets/connectors/lingzhu/openclaw-bridge/src/http-handler.ts +1133 -0
  12. package/assets/connectors/lingzhu/openclaw-bridge/src/image-cache.ts +75 -0
  13. package/assets/connectors/lingzhu/openclaw-bridge/src/lingzhu-tools.ts +246 -0
  14. package/assets/connectors/lingzhu/openclaw-bridge/src/transform.ts +541 -0
  15. package/assets/connectors/lingzhu/openclaw-bridge/src/types.ts +131 -0
  16. package/assets/connectors/lingzhu/openclaw-bridge/tsconfig.json +14 -0
  17. package/assets/connectors/lingzhu/openclaw.lingzhu.config.template.json +39 -0
  18. package/bin/ds.js +233 -53
  19. package/docs/en/00_QUICK_START.md +134 -0
  20. package/docs/en/01_SETTINGS_REFERENCE.md +1104 -0
  21. package/docs/en/02_START_RESEARCH_GUIDE.md +404 -0
  22. package/docs/en/03_QQ_CONNECTOR_GUIDE.md +325 -0
  23. package/docs/en/04_LINGZHU_CONNECTOR_GUIDE.md +216 -0
  24. package/docs/en/05_TUI_GUIDE.md +141 -0
  25. package/docs/en/06_RUNTIME_AND_CANVAS.md +679 -0
  26. package/docs/en/07_MEMORY_AND_MCP.md +253 -0
  27. package/docs/en/08_FIGURE_STYLE_GUIDE.md +97 -0
  28. package/docs/en/09_DOCTOR.md +108 -0
  29. package/docs/en/90_ARCHITECTURE.md +245 -0
  30. package/docs/en/91_DEVELOPMENT.md +195 -0
  31. package/docs/en/99_ACKNOWLEDGEMENTS.md +29 -0
  32. package/docs/zh/00_QUICK_START.md +134 -0
  33. package/docs/zh/01_SETTINGS_REFERENCE.md +1137 -0
  34. package/docs/zh/02_START_RESEARCH_GUIDE.md +414 -0
  35. package/docs/zh/03_QQ_CONNECTOR_GUIDE.md +324 -0
  36. package/docs/zh/04_LINGZHU_CONNECTOR_GUIDE.md +230 -0
  37. package/docs/zh/05_TUI_GUIDE.md +128 -0
  38. package/docs/zh/06_RUNTIME_AND_CANVAS.md +271 -0
  39. package/docs/zh/07_MEMORY_AND_MCP.md +235 -0
  40. package/docs/zh/08_FIGURE_STYLE_GUIDE.md +97 -0
  41. package/docs/zh/09_DOCTOR.md +112 -0
  42. package/docs/zh/99_ACKNOWLEDGEMENTS.md +29 -0
  43. package/install.sh +32 -8
  44. package/package.json +4 -2
  45. package/pyproject.toml +1 -1
  46. package/src/deepscientist/artifact/guidance.py +9 -2
  47. package/src/deepscientist/artifact/service.py +482 -22
  48. package/src/deepscientist/bash_exec/monitor.py +27 -5
  49. package/src/deepscientist/bash_exec/runtime.py +639 -0
  50. package/src/deepscientist/bash_exec/service.py +99 -16
  51. package/src/deepscientist/bridges/base.py +3 -0
  52. package/src/deepscientist/bridges/connectors.py +292 -13
  53. package/src/deepscientist/channels/qq.py +19 -2
  54. package/src/deepscientist/channels/relay.py +1 -0
  55. package/src/deepscientist/cli.py +32 -25
  56. package/src/deepscientist/config/models.py +28 -2
  57. package/src/deepscientist/config/service.py +201 -6
  58. package/src/deepscientist/connector_runtime.py +2 -0
  59. package/src/deepscientist/daemon/api/handlers.py +50 -5
  60. package/src/deepscientist/daemon/api/router.py +1 -0
  61. package/src/deepscientist/daemon/app.py +442 -15
  62. package/src/deepscientist/doctor.py +444 -0
  63. package/src/deepscientist/home.py +1 -0
  64. package/src/deepscientist/latex_runtime.py +17 -4
  65. package/src/deepscientist/lingzhu_support.py +182 -0
  66. package/src/deepscientist/mcp/server.py +49 -2
  67. package/src/deepscientist/prompts/builder.py +181 -58
  68. package/src/deepscientist/quest/layout.py +1 -0
  69. package/src/deepscientist/quest/service.py +63 -2
  70. package/src/deepscientist/quest/stage_views.py +19 -1
  71. package/src/deepscientist/runtime_tools/__init__.py +16 -0
  72. package/src/deepscientist/runtime_tools/builtins.py +19 -0
  73. package/src/deepscientist/runtime_tools/models.py +29 -0
  74. package/src/deepscientist/runtime_tools/registry.py +40 -0
  75. package/src/deepscientist/runtime_tools/service.py +59 -0
  76. package/src/deepscientist/runtime_tools/tinytex.py +25 -0
  77. package/src/deepscientist/tinytex.py +276 -0
  78. package/src/prompts/connectors/lingzhu.md +12 -0
  79. package/src/prompts/connectors/qq.md +121 -0
  80. package/src/prompts/system.md +177 -33
  81. package/src/skills/analysis-campaign/SKILL.md +22 -6
  82. package/src/skills/baseline/SKILL.md +5 -4
  83. package/src/skills/decision/SKILL.md +4 -3
  84. package/src/skills/experiment/SKILL.md +5 -4
  85. package/src/skills/finalize/SKILL.md +5 -4
  86. package/src/skills/idea/SKILL.md +5 -4
  87. package/src/skills/intake-audit/SKILL.md +277 -0
  88. package/src/skills/intake-audit/references/state-audit-template.md +41 -0
  89. package/src/skills/rebuttal/SKILL.md +407 -0
  90. package/src/skills/rebuttal/references/action-plan-template.md +63 -0
  91. package/src/skills/rebuttal/references/evidence-update-template.md +30 -0
  92. package/src/skills/rebuttal/references/response-letter-template.md +113 -0
  93. package/src/skills/rebuttal/references/review-matrix-template.md +55 -0
  94. package/src/skills/review/SKILL.md +293 -0
  95. package/src/skills/review/references/experiment-todo-template.md +29 -0
  96. package/src/skills/review/references/review-report-template.md +83 -0
  97. package/src/skills/review/references/revision-log-template.md +40 -0
  98. package/src/skills/scout/SKILL.md +5 -4
  99. package/src/skills/write/SKILL.md +7 -3
  100. package/src/tui/dist/components/WelcomePanel.js +17 -43
  101. package/src/tui/dist/components/messages/BashExecOperationMessage.js +3 -2
  102. package/src/tui/package.json +1 -1
  103. package/src/ui/dist/assets/{AiManusChatView-7v-dHngU.js → AiManusChatView-w5lF2Ttt.js} +109 -575
  104. package/src/ui/dist/assets/{AnalysisPlugin-B_Xmz-KE.js → AnalysisPlugin-DJOED79I.js} +1 -1
  105. package/src/ui/dist/assets/{AutoFigurePlugin-Cko-0tm1.js → AutoFigurePlugin-DaG61Y0M.js} +63 -8
  106. package/src/ui/dist/assets/{CliPlugin-BsU0ht7q.js → CliPlugin-CV4LqUB_.js} +43 -609
  107. package/src/ui/dist/assets/{CodeEditorPlugin-DcMMP0Rt.js → CodeEditorPlugin-DylfAea4.js} +8 -8
  108. package/src/ui/dist/assets/{CodeViewerPlugin-BqoQ5QyY.js → CodeViewerPlugin-F7saY0LM.js} +5 -5
  109. package/src/ui/dist/assets/{DocViewerPlugin-D7eHNhU6.js → DocViewerPlugin-COP0c7jf.js} +3 -3
  110. package/src/ui/dist/assets/{GitDiffViewerPlugin-DLJN42T5.js → GitDiffViewerPlugin-CAS05pT9.js} +1 -1
  111. package/src/ui/dist/assets/{ImageViewerPlugin-gJMV7MOu.js → ImageViewerPlugin-Bco1CN_w.js} +5 -6
  112. package/src/ui/dist/assets/{LabCopilotPanel-B857sfxP.js → LabCopilotPanel-CvMlCD99.js} +12 -15
  113. package/src/ui/dist/assets/LabPlugin-BYankkE4.js +2676 -0
  114. package/src/ui/dist/assets/LabPlugin-D9jVIo0A.css +2698 -0
  115. package/src/ui/dist/assets/{LatexPlugin-DWKEo-Wj.js → LatexPlugin-LDSMR-t-.js} +16 -16
  116. package/src/ui/dist/assets/{MarkdownViewerPlugin-DBzoEmhv.js → MarkdownViewerPlugin-B7o80jgm.js} +4 -4
  117. package/src/ui/dist/assets/{MarketplacePlugin-DoHc-8vo.js → MarketplacePlugin-CM6ZOcpC.js} +3 -3
  118. package/src/ui/dist/assets/{NotebookEditor-CKjKH-yS.js → NotebookEditor-Dc61cXmK.js} +3 -3
  119. package/src/ui/dist/assets/{PdfLoader-zFoL0VPo.js → PdfLoader-DWowuQwx.js} +1 -1
  120. package/src/ui/dist/assets/{PdfMarkdownPlugin-DXPaL9Nt.js → PdfMarkdownPlugin-BsJM1q_a.js} +3 -3
  121. package/src/ui/dist/assets/{PdfViewerPlugin-DhK8qCFp.js → PdfViewerPlugin-DB2eEEFQ.js} +10 -10
  122. package/src/ui/dist/assets/{SearchPlugin-CdSi6krf.js → SearchPlugin-CraThSvt.js} +1 -1
  123. package/src/ui/dist/assets/{Stepper-V-WiDQJl.js → Stepper-CgocRTPq.js} +1 -1
  124. package/src/ui/dist/assets/{TextViewerPlugin-hIs1Efiu.js → TextViewerPlugin-B1JGhKtd.js} +4 -4
  125. package/src/ui/dist/assets/{VNCViewer-DG8b0q2X.js → VNCViewer-CclFC7FM.js} +9 -10
  126. package/src/ui/dist/assets/{bibtex-HDac6fVW.js → bibtex-D3IKsMl7.js} +1 -1
  127. package/src/ui/dist/assets/{code-BnBeNxBc.js → code-BP37Xx0p.js} +1 -1
  128. package/src/ui/dist/assets/{file-content-IRQ3jHb8.js → file-content-BAJSu-9r.js} +1 -1
  129. package/src/ui/dist/assets/{file-diff-panel-DZoQ9I6r.js → file-diff-panel-DUGeCTuy.js} +1 -1
  130. package/src/ui/dist/assets/{file-socket-BMCdLc-P.js → file-socket-CXc1Ojf7.js} +1 -1
  131. package/src/ui/dist/assets/{file-utils-CltILB3w.js → file-utils-2J21jt7M.js} +1 -1
  132. package/src/ui/dist/assets/{image-Boe6ffhu.js → image-CMMmgvcn.js} +1 -1
  133. package/src/ui/dist/assets/{index-BlplpvE1.js → index-BaVumsQT.js} +2 -2
  134. package/src/ui/dist/assets/{index-DZqJ-qAM.js → index-CWgMgpow.js} +60 -2154
  135. package/src/ui/dist/assets/{index-DO43pFZP.js → index-DmwmJmbW.js} +6372 -8434
  136. package/src/ui/dist/assets/{index-Bq2bvfkl.css → index-KGt-z-dD.css} +225 -2920
  137. package/src/ui/dist/assets/{index-2Zf65FZt.js → index-s7aHnNQ4.js} +1 -1
  138. package/src/ui/dist/assets/{message-square-mUHn_Ssb.js → message-square-CQRfX0Am.js} +1 -1
  139. package/src/ui/dist/assets/{monaco-fe0arNEU.js → monaco-B4TbdsrF.js} +1 -1
  140. package/src/ui/dist/assets/{popover-D_7i19qU.js → popover-B8Rokodk.js} +1 -1
  141. package/src/ui/dist/assets/{project-sync-DyVGrU7H.js → project-sync-D_i96KH4.js} +2 -8
  142. package/src/ui/dist/assets/{sigma-BzazRyxQ.js → sigma-D12PnzCN.js} +1 -1
  143. package/src/ui/dist/assets/{tooltip-DN_yjHFH.js → tooltip-B6YrI4aJ.js} +1 -1
  144. package/src/ui/dist/assets/trash-Bc8jGp0V.js +32 -0
  145. package/src/ui/dist/assets/{useCliAccess-DV2L2Qxy.js → useCliAccess-mXVCYSZ-.js} +12 -42
  146. package/src/ui/dist/assets/{useFileDiffOverlay-DyTj-p_V.js → useFileDiffOverlay-Bg6b9H9K.js} +1 -1
  147. package/src/ui/dist/assets/{wrap-text-ozYHtUwq.js → wrap-text-Drh5GEnL.js} +1 -1
  148. package/src/ui/dist/assets/{zoom-out-BN9MUyCQ.js → zoom-out-CJj9DZLn.js} +1 -1
  149. package/src/ui/dist/index.html +2 -2
  150. package/assets/fonts/Inter-Variable.ttf +0 -0
  151. package/assets/fonts/NotoSerifSC-Regular-C94HN_ZN.ttf +0 -0
  152. package/assets/fonts/NunitoSans-Variable.ttf +0 -0
  153. package/assets/fonts/Satoshi-Medium-ByP-Zb-9.woff2 +0 -0
  154. package/assets/fonts/SourceSans3-Variable.ttf +0 -0
  155. package/assets/fonts/ds-fonts.css +0 -83
  156. package/src/ui/dist/assets/Inter-Variable-VF2RPR_K.ttf +0 -0
  157. package/src/ui/dist/assets/LabPlugin-bL7rpic8.js +0 -43
  158. package/src/ui/dist/assets/NotoSerifSC-Regular-C94HN_ZN-C94HN_ZN.ttf +0 -0
  159. package/src/ui/dist/assets/NunitoSans-Variable-B_ZymHAd.ttf +0 -0
  160. package/src/ui/dist/assets/Satoshi-Medium-ByP-Zb-9-GkA34YXu.woff2 +0 -0
  161. package/src/ui/dist/assets/SourceSans3-Variable-CD-WOsSK.ttf +0 -0
  162. package/src/ui/dist/assets/info-CcsK_htA.js +0 -18
  163. package/src/ui/dist/assets/user-plus-BusDx-hF.js +0 -79
@@ -0,0 +1,325 @@
1
+ # 03 QQ Connector Guide: Use QQ With DeepScientist
2
+
3
+ This guide explains how to talk to DeepScientist through QQ and how to configure the QQ connector from the DeepScientist `Settings` page.
4
+
5
+ This guide assumes the current built-in DeepScientist QQ runtime:
6
+
7
+ - official QQ Gateway direct connection
8
+ - no public callback URL required
9
+ - no `relay_url` required
10
+ - no extra QQ plugin installation
11
+
12
+ If you previously followed an OpenClaw or NanoClaw article, note the key difference: DeepScientist already includes the QQ connector runtime. You configure it from `Settings > Connectors > QQ` instead of installing a separate plugin from the CLI.
13
+
14
+ ## 1. What you get after setup
15
+
16
+ After finishing this guide, you should be able to:
17
+
18
+ - chat with DeepScientist from QQ private messages
19
+ - let QQ auto-bind to the latest active quest
20
+ - use `/new`, `/use latest`, `/status`, and related commands from QQ
21
+ - see the detected `openid` in the `Settings` page
22
+ - run safe readiness checks and send probes from the `Settings` page
23
+
24
+ ### Deployment checklist before you start
25
+
26
+ Before configuring anything, make sure all of these are already true:
27
+
28
+ - DeepScientist is installed and the daemon / web UI is already running
29
+ - you can open `Settings > Connectors`
30
+ - you already have the QQ bot `AppID` and `AppSecret`
31
+ - you have a real QQ account ready to send the first private message to the bot
32
+ - if you changed QQ settings before, `Restart gateway on config change` should stay enabled
33
+
34
+ If any of the items above is still missing, fix that first. It saves a lot of unnecessary debugging later.
35
+
36
+ ## 2. Register a QQ bot
37
+
38
+ This section is based on the Tencent Cloud developer article “OpenClaw 接入 QQ 机器人”:
39
+
40
+ - Source article: https://cloud.tencent.com/developer/article/2635190
41
+ - Official QQ Bot platform: https://bot.q.qq.com/
42
+
43
+ Use the official QQ Bot platform as the primary source of truth. The screenshot below is included only to make the registration flow easier to recognize.
44
+
45
+ ### 2.1 Open the bot registration entry
46
+
47
+ Prefer the official platform:
48
+
49
+ ```text
50
+ https://bot.q.qq.com/
51
+ ```
52
+
53
+ The Tencent Cloud article also shows this quick-entry page:
54
+
55
+ ```text
56
+ https://q.qq.com/qqbot/openclaw/login.html
57
+ ```
58
+
59
+ ![QQ bot registration entry](../images/qq/tencent-cloud-qq-register.png)
60
+
61
+ ### 2.2 Sign in and create the bot
62
+
63
+ 1. Sign in with QQ by scanning the QR code.
64
+ 2. Create a new QQ bot.
65
+ 3. Finish the basic bot setup in the Tencent console.
66
+
67
+ ### 2.3 Save `AppID` and `AppSecret` immediately
68
+
69
+ After creation, record these two values right away:
70
+
71
+ | Field | Meaning | Required by DeepScientist |
72
+ | --- | --- | --- |
73
+ | `AppID` | Unique bot identifier | Yes |
74
+ | `AppSecret` | Secret used to call the QQ Bot API | Yes |
75
+
76
+ Important pitfalls:
77
+
78
+ - `AppSecret` is usually shown only once when created or reset.
79
+ - If you lose it, you will normally need to reset it in the console.
80
+ - DeepScientist only needs these two credentials to start the built-in QQ gateway direct path.
81
+
82
+ ## 3. What you do **not** need in DeepScientist
83
+
84
+ This matters a lot if you are coming from an OpenClaw-style guide.
85
+
86
+ In DeepScientist, you do **not** need to:
87
+
88
+ - install `@sliverp/qqbot`
89
+ - run `openclaw channels add ...`
90
+ - configure a public callback URL
91
+ - configure `relay_url`
92
+ - manually fill `openid` before the first inbound QQ message
93
+
94
+ DeepScientist currently uses this path:
95
+
96
+ - fixed `transport: gateway_direct`
97
+ - direct `app_id + app_secret`
98
+ - automatic `openid` detection after the first private QQ message
99
+
100
+ ## 4. Configure QQ from the Settings page
101
+
102
+ Open:
103
+
104
+ - [Settings > Connectors > QQ](/settings/connectors#connector-qq)
105
+
106
+ The link jumps directly to the `QQ` connector card. The page is now organized into these anchored setup steps:
107
+
108
+ - `#connector-qq-step-credentials`: enter `App ID` and `App Secret`
109
+ - `#connector-qq-step-bind`: save first, then send the first QQ private message
110
+ - `#connector-qq-step-success`: confirm the auto-detected OpenID
111
+ - `#connector-qq-step-advanced`: advanced settings and milestone delivery switches
112
+
113
+ ### 4.1 Recommended field order
114
+
115
+ | Field | How to fill it | Recommendation |
116
+ | --- | --- | --- |
117
+ | `Enabled` | Turn it on | Required |
118
+ | `Transport` | Keep `gateway_direct` | Fixed, do not change |
119
+ | `App ID` | Paste the `AppID` from the QQ bot console | Required |
120
+ | `App secret` | Paste the `AppSecret` from the QQ bot console | Required |
121
+ | `Detected OpenID` | Leave empty at first | Auto-filled after the first private message |
122
+
123
+ The remaining settings such as group mention policy, command prefix, auto-binding, and milestone delivery live under `#connector-qq-step-advanced`. Milestone delivery now defaults to fully enabled; only change those switches if you want less outbound push.
124
+
125
+ ### 4.2 Important things to notice before saving
126
+
127
+ - QQ does not need `public_callback_url`
128
+ - QQ does not need `relay_url`
129
+ - `Detected OpenID` is not something you must fill before the first test
130
+ - It is normal for `Detected OpenID` to stay empty until the bot receives the first private QQ message
131
+
132
+ ## 5. Recommended end-to-end test flow
133
+
134
+ This is the most reliable path with the fewest surprises.
135
+
136
+ ### Step 1: save the credentials
137
+
138
+ Fill:
139
+
140
+ - `App ID`
141
+ - `App secret`
142
+
143
+ Then save the connector config.
144
+
145
+ ### Step 2: click “Check”
146
+
147
+ From the `Settings` page, click:
148
+
149
+ - `Check`
150
+
151
+ Expected result:
152
+
153
+ - no more missing-credential errors for `app_id` or `app_secret`
154
+
155
+ ### Step 3: click “Test all” or QQ-specific “Send probe”
156
+
157
+ Before the first inbound private message, you may still see a warning like:
158
+
159
+ ```text
160
+ QQ readiness is healthy, but no OpenID has been learned yet. Save credentials, then send one private QQ message so DeepScientist can auto-detect and save the `openid`.
161
+ ```
162
+
163
+ This usually does **not** mean your credentials are wrong. It means:
164
+
165
+ - DeepScientist can already exchange `access_token` and probe `/gateway`
166
+ - but it still does not know which QQ `openid` should receive an active outbound test message
167
+
168
+ In other words:
169
+
170
+ - a successful readiness check is not the same as already having a delivery target
171
+
172
+ ### Step 4: send the first private QQ message to the bot
173
+
174
+ Start with a private chat, not a group.
175
+
176
+ ![QQ private chat with the bot](../images/qq/tencent-cloud-qq-chat.png)
177
+
178
+ You can send:
179
+
180
+ ```text
181
+ /help
182
+ ```
183
+
184
+ or:
185
+
186
+ ```text
187
+ hello
188
+ ```
189
+
190
+ If the connector is working, DeepScientist will auto-detect the `openid` for that private conversation and save it into `main_chat_id`.
191
+
192
+ ### Step 5: go back to the Settings page and confirm the state
193
+
194
+ Refresh or reopen `Settings > Connectors > QQ`, or jump back to [#connector-qq-step-success](/settings/connectors#connector-qq-step-success), and check:
195
+
196
+ - whether `Detected OpenID` is now filled automatically
197
+ - whether the `Snapshot` panel shows something close to:
198
+ - `Transport = gateway_direct`
199
+ - `Connection` / `Auth` near `ready`
200
+ - `Discovered targets > 0`
201
+ - `Bound target` showing your `openid`
202
+
203
+ ### Step 6: click “Send probe” again
204
+
205
+ Now click:
206
+
207
+ - `Send probe`
208
+
209
+ If it succeeds, DeepScientist can now:
210
+
211
+ - actively send messages to that QQ user
212
+ - receive new messages from that QQ user
213
+
214
+ ### 5.1 What success looks like
215
+
216
+ When the connector is fully working, you should usually see all of these:
217
+
218
+ - the bot replies to `/help`, `/status`, and similar commands
219
+ - `Detected OpenID` is no longer empty in `Settings > Connectors > QQ`
220
+ - the `Snapshot` panel shows a discovered target and the bound target is no longer empty
221
+ - clicking `Send probe` again no longer reports an empty delivery target
222
+ - if a latest quest already exists, plain text continues that quest automatically; if no quest exists yet, the bot returns help instead
223
+
224
+ ### 5.2 Error quick decoder
225
+
226
+ | Message | What it usually means | What to do |
227
+ | --- | --- | --- |
228
+ | `app_id is required` / `app_secret is required` | The credentials are incomplete | Fill the missing field in Settings and save again |
229
+ | `401` / `invalid credential` / token exchange failed | The `AppID` or `AppSecret` is wrong, or the secret was reset | Recheck the QQ console values and save them again |
230
+ | `QQ readiness is healthy, but no OpenID has been learned yet...` | The credentials probably work, but DeepScientist still does not know which QQ user should receive an active outbound message | Send one private QQ message to the bot first so the runtime can discover the `openid` |
231
+ | `QQ callback flow usually needs public_callback_url...` | This comes from an older callback/relay model, not the current DeepScientist direct path | Keep `transport = gateway_direct` and do not add a public callback URL |
232
+ | `QQ relay mode needs relay_url...` | The transport was switched to relay mode by mistake | Change it back to `gateway_direct` |
233
+ | `Detected OpenID` stays empty | The bot has not received the first private QQ message yet, or the gateway did not restart cleanly after config changes | Save the config first, then send a private QQ message, and restart the gateway if needed |
234
+
235
+ ## 6. How to talk to DeepScientist from QQ
236
+
237
+ Common commands:
238
+
239
+ | Command | Meaning |
240
+ | --- | --- |
241
+ | `/help` | Show help |
242
+ | `/projects` or `/list` | List quests |
243
+ | `/use <quest_id>` | Bind a specific quest |
244
+ | `/use latest` | Bind the newest quest |
245
+ | `/new <goal>` | Create a new quest and bind the current QQ conversation |
246
+ | `/status` | Show the current quest status |
247
+
248
+ Recommended usage:
249
+
250
+ - if a latest quest already exists, plain text usually continues that quest
251
+ - if there is no quest yet, start with `/new <goal>`
252
+ - if you want to switch to another quest, send `/use <quest_id>` explicitly
253
+
254
+ ## 7. Most common mistakes
255
+
256
+ ### 7.1 Assuming QQ needs a public callback
257
+
258
+ The current DeepScientist QQ path does **not** require a public callback.
259
+
260
+ If you see these ideas from older guides, ignore them for DeepScientist:
261
+
262
+ - `public_callback_url`
263
+ - `relay_url`
264
+
265
+ ### 7.2 Assuming a failed active send test means the credentials are wrong
266
+
267
+ If the warning says the target is empty, the usual reason is:
268
+
269
+ - you have not sent the first private QQ message yet
270
+ - the runtime has not auto-detected the `openid` yet
271
+
272
+ That is a different problem from invalid `app_id` or `app_secret`.
273
+
274
+ ### 7.3 Thinking you must manually discover `openid`
275
+
276
+ In DeepScientist, the easiest path is not manual lookup. Instead:
277
+
278
+ 1. save `App ID` and `App secret`
279
+ 2. send one private QQ message to the bot
280
+ 3. let the runtime auto-fill `Detected OpenID`
281
+
282
+ ### 7.4 Bot does not respond in a group
283
+
284
+ Check:
285
+
286
+ - whether you actually `@` mentioned the bot
287
+ - whether `Require @ mention in groups` is enabled
288
+
289
+ If private chat is not working yet, do not start group debugging first.
290
+
291
+ ### 7.5 A different operator now uses QQ, but `main_chat_id` is still the old one
292
+
293
+ If a previous `main_chat_id` is already saved, a new private user may not automatically overwrite it.
294
+
295
+ In that case:
296
+
297
+ - decide who the primary QQ operator should be
298
+ - clear or update the QQ target explicitly if needed
299
+ - then rerun the private-message test flow
300
+
301
+ ## 8. Smallest reliable deployment sequence
302
+
303
+ If you only want the shortest path that works:
304
+
305
+ 1. create the QQ bot
306
+ 2. save `AppID` and `AppSecret`
307
+ 3. open [Settings > Connectors > QQ](/settings/connectors#connector-qq)
308
+ 4. enable QQ and fill `App ID` / `App secret`
309
+ 5. save and click `Check`
310
+ 6. send `/help` to the bot from your QQ private chat
311
+ 7. verify that `Detected OpenID` is now filled
312
+ 8. click `Send probe` again
313
+ 9. start using `/new <goal>` or `/use latest`
314
+
315
+ ## 9. References
316
+
317
+ - Tencent Cloud developer article: “OpenClaw 接入 QQ 机器人”
318
+ - https://cloud.tencent.com/developer/article/2635190
319
+ - Official QQ Bot platform
320
+ - https://bot.q.qq.com/
321
+
322
+ Notes:
323
+
324
+ - the bot-registration flow and screenshots in this guide are based on the Tencent Cloud article above
325
+ - the actual DeepScientist connector behavior follows the current built-in DeepScientist QQ runtime, not the OpenClaw plugin workflow
@@ -0,0 +1,216 @@
1
+ # 04 Lingzhu Connector Guide: Configure Lingzhu for DeepScientist
2
+
3
+ This guide explains how to configure the Lingzhu companion endpoint from `Settings > Connectors > Lingzhu`.
4
+
5
+ Scope:
6
+
7
+ - configuration only
8
+ - OpenClaw-compatible Lingzhu bridge values
9
+ - local probe and SSE smoke test
10
+ - what to paste into the Lingzhu platform
11
+
12
+ This guide does not cover cloud deployment architecture. You only need one working OpenClaw gateway and one public IP or public domain that the glasses can reach.
13
+
14
+ Reference sources:
15
+
16
+ - Rokid forum setup page: https://forum.rokid.com/post/detail/2831
17
+ - packaged bridge root: `assets/connectors/lingzhu/openclaw-bridge`
18
+ - packaged OpenClaw config template: `assets/connectors/lingzhu/openclaw.lingzhu.config.template.json`
19
+
20
+ ## 1. What DeepScientist now provides
21
+
22
+ The Lingzhu settings card now generates and validates:
23
+
24
+ - local health URL
25
+ - local SSE URL
26
+ - public SSE URL
27
+ - `auth_ak`
28
+ - OpenClaw config snippet
29
+ - local probe `curl`
30
+
31
+ The packaged bridge is configured to:
32
+
33
+ - emit one immediate visible receipt acknowledgement before the model starts
34
+ - keep comment heartbeats alive
35
+ - emit lightweight visible progress heartbeats during long silent upstream phases
36
+
37
+ DeepScientist treats Lingzhu as a companion endpoint, not as a full bidirectional chat connector like QQ.
38
+
39
+ ## 2. Before you start
40
+
41
+ Make sure these are already true:
42
+
43
+ - DeepScientist is installed and running
44
+ - your OpenClaw gateway is already running locally
45
+ - the OpenClaw HTTP gateway port is known, usually `18789`
46
+ - you have a public IP or public domain
47
+
48
+ Important:
49
+
50
+ - `127.0.0.1` only works for local health checks
51
+ - Lingzhu devices need a public address
52
+
53
+ ## 3. Open the settings page
54
+
55
+ Open:
56
+
57
+ - `Settings > Connectors > Lingzhu`
58
+
59
+ The card is organized into:
60
+
61
+ - gateway endpoint
62
+ - auth and identity
63
+ - generated values
64
+ - probe and verify
65
+ - advanced debug
66
+
67
+ ![Lingzhu settings overview](../images/lingzhu/lingzhu-settings-overview.svg)
68
+
69
+ ## 4. Fill the endpoint fields
70
+
71
+ Recommended values:
72
+
73
+ | Field | Recommended value | Notes |
74
+ | --- | --- | --- |
75
+ | `Enabled` | `true` | turn on the companion config |
76
+ | `Transport` | `openclaw_sse` | fixed, do not change |
77
+ | `Local host` | `127.0.0.1` | used only for local probe |
78
+ | `Gateway port` | `18789` | match your OpenClaw gateway |
79
+ | `Public base URL` | `http://<public-ip>:18789` | must be reachable from the glasses |
80
+
81
+ If you do not know what to fill for the local endpoint, click:
82
+
83
+ - `Use local defaults`
84
+
85
+ ## 5. Generate the AK and identity values
86
+
87
+ Fill or keep:
88
+
89
+ | Field | Recommended value |
90
+ | --- | --- |
91
+ | `Auth AK` | click `Generate AK` |
92
+ | `Agent ID` | `main` |
93
+ | `Lingzhu system prompt` | optional |
94
+
95
+ Use the same `auth_ak` and `agent_id` in both places:
96
+
97
+ - OpenClaw Lingzhu plugin config
98
+ - Lingzhu platform config
99
+
100
+ ## 6. Use the generated values
101
+
102
+ DeepScientist shows the exact values you need:
103
+
104
+ - local health URL
105
+ - local SSE URL
106
+ - public SSE URL
107
+ - OpenClaw config snippet
108
+ - probe curl
109
+
110
+ The public value is the one you should paste into the Lingzhu platform.
111
+
112
+ ![Lingzhu platform values](../images/lingzhu/lingzhu-platform-values.svg)
113
+
114
+ ## 7. Update OpenClaw
115
+
116
+ Use either:
117
+
118
+ - the generated snippet in the settings page
119
+ - or the packaged template at `assets/connectors/lingzhu/openclaw.lingzhu.config.template.json`
120
+
121
+ Install the packaged bridge with:
122
+
123
+ ```bash
124
+ openclaw plugins install ./assets/connectors/lingzhu/openclaw-bridge
125
+ ```
126
+
127
+ At minimum, OpenClaw must expose:
128
+
129
+ ```json
130
+ {
131
+ "gateway": {
132
+ "port": 18789,
133
+ "http": {
134
+ "endpoints": {
135
+ "chatCompletions": {
136
+ "enabled": true
137
+ }
138
+ }
139
+ }
140
+ }
141
+ }
142
+ ```
143
+
144
+ DeepScientist also generates the full Lingzhu plugin block for you:
145
+
146
+ ![OpenClaw config snippet](../images/lingzhu/lingzhu-openclaw-config.svg)
147
+
148
+ ## 8. Run the local probe
149
+
150
+ After saving the values, click:
151
+
152
+ - `Run Lingzhu probe`
153
+
154
+ DeepScientist performs:
155
+
156
+ 1. `GET /metis/agent/api/health`
157
+ 2. `POST /metis/agent/api/sse`
158
+
159
+ Expected result:
160
+
161
+ - `Connection = reachable`
162
+ - `Auth = ready`
163
+ - probe result returns no errors
164
+
165
+ ## 9. What to paste into the Lingzhu platform
166
+
167
+ Use:
168
+
169
+ - `Public SSE URL`
170
+ - `Auth AK`
171
+
172
+ Do not paste:
173
+
174
+ - `127.0.0.1`
175
+ - any local-only host name
176
+
177
+ ## 10. Common failure causes
178
+
179
+ ### Health is offline
180
+
181
+ Usually means:
182
+
183
+ - OpenClaw is not running
184
+ - wrong `gateway_port`
185
+ - wrong `local_host`
186
+
187
+ ### SSE probe fails
188
+
189
+ Usually means:
190
+
191
+ - `auth_ak` mismatch
192
+ - Lingzhu endpoint path is not exposed
193
+ - OpenClaw `chatCompletions.enabled` is still off
194
+
195
+ ### Device still cannot connect
196
+
197
+ Usually means:
198
+
199
+ - `Public base URL` is not public
200
+ - firewall or reverse proxy still blocks the port
201
+
202
+ ## 11. Practical note
203
+
204
+ This settings surface is intentionally registry-first:
205
+
206
+ - Lingzhu stays in `connectors.yaml`
207
+ - generated values come from the same structured config
208
+ - validation, testing, and frontend rendering consume the same connector record
209
+
210
+ For long-running tasks, the most stable practical behavior is:
211
+
212
+ - immediate bridge-level receipt acknowledgement
213
+ - visible progress heartbeats from the bridge during silent upstream phases
214
+ - preserved per-user session continuity across follow-up turns
215
+
216
+ This improves Lingzhu compatibility, but it still does not remove the platform-side single-request timeout limit.
@@ -0,0 +1,141 @@
1
+ # 05 TUI Guide: Use the Terminal Interface
2
+
3
+ This document is the single repo-level reference for the current DeepScientist TUI workflow.
4
+
5
+ For the current runtime control flow, prompt/skill execution model, MCP surface, and Canvas reconstruction logic, also see `docs/en/06_RUNTIME_AND_CANVAS.md`.
6
+
7
+ ## Install And Start
8
+
9
+ Use the current workspace install:
10
+
11
+ ```bash
12
+ pip install -e .
13
+ npm install
14
+ ```
15
+
16
+ Common launcher commands:
17
+
18
+ ```bash
19
+ ds
20
+ ds --tui
21
+ ds --both
22
+ ds --status
23
+ ds --stop
24
+ ```
25
+
26
+ Notes:
27
+
28
+ - `ds` starts the managed daemon, prints the local web URL, tries to open the browser, and exits.
29
+ - `ds --tui` starts daemon plus the Ink-based terminal workspace.
30
+ - `ds --both` starts the daemon, opens the web workspace, and keeps the terminal workspace attached.
31
+ - `ds --stop` stops the managed daemon itself, not just one quest.
32
+ - `python -m deepscientist.cli ...` remains available for low-level commands, but the launcher is the normal path.
33
+ - from a source checkout, `node bin/ds.js` behaves the same as `ds`
34
+
35
+ ## Core TUI Flow
36
+
37
+ Inside the TUI:
38
+
39
+ - `/home`: leave the current quest and return to request mode.
40
+ - `/projects`: open the quest browser.
41
+ - `/use <quest_id>`: bind the current TUI session to one quest.
42
+ - `/new`: create a quest from inside the TUI.
43
+ - `/new <goal>` creates the quest and auto-starts it through the daemon.
44
+ - `/delete <quest_id> --yes`: delete a quest (destructive; requires confirmation).
45
+ - plain text: send a normal user message to the bound quest.
46
+ - `/status`: inspect the current quest state.
47
+ - `/graph`: inspect the current quest graph.
48
+ - `/help`: show the in-TUI command list and control keys.
49
+ - `/config`: open the local config browser.
50
+ - `/pause`: pause the current quest; if no quest is bound, choose one in the panel.
51
+ - `/resume`: resume the current quest; if no quest is bound, choose one in the panel.
52
+ - `/stop`: stop the current quest; if no quest is bound, choose one in the panel.
53
+ - `/stop <quest_id>`: stop a specific quest explicitly.
54
+ - typing `/` in the input box shows a live command list; typing `/re`, `/co`, and similar prefixes filters the visible command rows
55
+ - in home mode, `↑/↓` and `Tab` only change the selected quest preview; they do not hard-switch an already bound quest
56
+ - in home mode, plain text does not create or send anything implicitly; use `/new <goal>` to create and `/projects` or `/use <quest_id>` to bind before chatting
57
+
58
+ If you are already inside a quest, `/pause`, `/resume`, and `/stop` target that quest automatically.
59
+
60
+ The footer and welcome banner also expose the main shortcuts directly:
61
+
62
+ - `Enter`: send or confirm
63
+ - `↑/↓`: browse selectors
64
+ - `Esc`: close the active overlay
65
+ - `Ctrl+O`: open the web workspace
66
+ - `Ctrl+C`: quit the TUI
67
+
68
+ ## Message Delivery Model
69
+
70
+ The TUI, web UI, and connectors now share the same mailbox semantics.
71
+
72
+ 1. The first plain user message for an idle quest starts a turn directly.
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.
79
+
80
+ Durable files used by this flow:
81
+
82
+ - `.ds/runtime_state.json`
83
+ - `.ds/user_message_queue.json`
84
+ - `.ds/interaction_journal.jsonl`
85
+ - `.ds/events.jsonl`
86
+
87
+ ## Stop, Pause, Resume
88
+
89
+ Quest-level control:
90
+
91
+ - `/pause` interrupts the active runner and marks the quest as `paused`.
92
+ - `/resume` moves a `paused` or `stopped` quest back to `active`.
93
+ - `/stop` interrupts the active runner, clears `active_run_id`, and marks the quest as `stopped`.
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.
95
+
96
+ `/stop` semantics are intentionally stronger than `/pause`:
97
+
98
+ - queued but not yet delivered user mailbox messages are cancelled
99
+ - those cancelled messages are preserved in the queue audit trail with terminal status fields such as `cancelled_by_stop`
100
+ - the currently executing launch message is recorded as `accepted_by_run`
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
103
+
104
+ Daemon-level stop:
105
+
106
+ - `ds --stop` shuts down the managed daemon
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
112
+
113
+ ## Artifact Interaction Expectations
114
+
115
+ The agent should use `artifact.interact(...)` as the long-lived conversation thread:
116
+
117
+ - `progress` and `milestone` updates are threaded, non-blocking status messages
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(...)`
121
+
122
+ ## Troubleshooting
123
+
124
+ If the TUI looks idle after you send text:
125
+
126
+ - confirm the quest is actually bound
127
+ - check the quest status with `/status`
128
+ - inspect `.ds/runtime_state.json` for `status`, `active_run_id`, and `pending_user_message_count`
129
+ - inspect `.ds/events.jsonl` for `runner.turn_error`, `quest.control`, or `artifact.recorded`
130
+
131
+ If a follow-up user message does not seem to reach the agent:
132
+
133
+ - check whether the quest is currently running
134
+ - inspect `.ds/user_message_queue.json`
135
+ - confirm the agent is calling `artifact.interact(...)` during long work
136
+
137
+ If stop appears ineffective:
138
+
139
+ - use `/stop` inside the quest first
140
+ - verify the quest becomes `stopped`
141
+ - for a full daemon shutdown use `ds --stop`