@researai/deepscientist 1.5.14 → 1.5.16

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 (225) hide show
  1. package/README.md +336 -90
  2. package/assets/branding/logo-raster.png +0 -0
  3. package/bin/ds.js +816 -131
  4. package/docs/en/00_QUICK_START.md +36 -15
  5. package/docs/en/01_SETTINGS_REFERENCE.md +53 -4
  6. package/docs/en/02_START_RESEARCH_GUIDE.md +7 -0
  7. package/docs/en/03_QQ_CONNECTOR_GUIDE.md +19 -0
  8. package/docs/en/05_TUI_GUIDE.md +6 -0
  9. package/docs/en/06_RUNTIME_AND_CANVAS.md +4 -3
  10. package/docs/en/09_DOCTOR.md +11 -5
  11. package/docs/en/10_WEIXIN_CONNECTOR_GUIDE.md +20 -0
  12. package/docs/en/14_PROMPT_SKILLS_AND_MCP_GUIDE.md +65 -13
  13. package/docs/en/15_CODEX_PROVIDER_SETUP.md +25 -8
  14. package/docs/en/16_TELEGRAM_CONNECTOR_GUIDE.md +134 -0
  15. package/docs/en/17_WHATSAPP_CONNECTOR_GUIDE.md +126 -0
  16. package/docs/en/18_FEISHU_CONNECTOR_GUIDE.md +136 -0
  17. package/docs/en/19_EXTERNAL_CONTROLLER_GUIDE.md +226 -0
  18. package/docs/en/19_LOCAL_BROWSER_AUTH.md +70 -0
  19. package/docs/en/20_WORKSPACE_MODES_GUIDE.md +250 -0
  20. package/docs/en/README.md +24 -0
  21. package/docs/zh/00_QUICK_START.md +36 -15
  22. package/docs/zh/01_SETTINGS_REFERENCE.md +53 -4
  23. package/docs/zh/02_START_RESEARCH_GUIDE.md +7 -0
  24. package/docs/zh/03_QQ_CONNECTOR_GUIDE.md +19 -0
  25. package/docs/zh/05_TUI_GUIDE.md +6 -0
  26. package/docs/zh/09_DOCTOR.md +11 -5
  27. package/docs/zh/10_WEIXIN_CONNECTOR_GUIDE.md +20 -0
  28. package/docs/zh/14_PROMPT_SKILLS_AND_MCP_GUIDE.md +65 -13
  29. package/docs/zh/15_CODEX_PROVIDER_SETUP.md +25 -8
  30. package/docs/zh/16_TELEGRAM_CONNECTOR_GUIDE.md +134 -0
  31. package/docs/zh/17_WHATSAPP_CONNECTOR_GUIDE.md +126 -0
  32. package/docs/zh/18_FEISHU_CONNECTOR_GUIDE.md +136 -0
  33. package/docs/zh/19_EXTERNAL_CONTROLLER_GUIDE.md +226 -0
  34. package/docs/zh/19_LOCAL_BROWSER_AUTH.md +68 -0
  35. package/docs/zh/20_WORKSPACE_MODES_GUIDE.md +251 -0
  36. package/docs/zh/README.md +24 -0
  37. package/install.sh +2 -0
  38. package/package.json +1 -1
  39. package/pyproject.toml +1 -1
  40. package/src/deepscientist/__init__.py +1 -1
  41. package/src/deepscientist/acp/envelope.py +6 -0
  42. package/src/deepscientist/artifact/charts.py +567 -0
  43. package/src/deepscientist/artifact/guidance.py +50 -10
  44. package/src/deepscientist/artifact/metrics.py +228 -5
  45. package/src/deepscientist/artifact/schemas.py +3 -0
  46. package/src/deepscientist/artifact/service.py +4276 -308
  47. package/src/deepscientist/bash_exec/models.py +23 -0
  48. package/src/deepscientist/bash_exec/monitor.py +147 -67
  49. package/src/deepscientist/bash_exec/runtime.py +218 -156
  50. package/src/deepscientist/bash_exec/service.py +309 -69
  51. package/src/deepscientist/bash_exec/shells.py +87 -0
  52. package/src/deepscientist/bridges/connectors.py +51 -2
  53. package/src/deepscientist/cli.py +115 -19
  54. package/src/deepscientist/codex_cli_compat.py +232 -0
  55. package/src/deepscientist/config/models.py +8 -4
  56. package/src/deepscientist/config/service.py +38 -11
  57. package/src/deepscientist/connector/weixin_support.py +122 -1
  58. package/src/deepscientist/daemon/api/handlers.py +199 -9
  59. package/src/deepscientist/daemon/api/router.py +5 -0
  60. package/src/deepscientist/daemon/app.py +1458 -289
  61. package/src/deepscientist/doctor.py +51 -0
  62. package/src/deepscientist/file_lock.py +48 -0
  63. package/src/deepscientist/gitops/__init__.py +10 -1
  64. package/src/deepscientist/gitops/diff.py +296 -1
  65. package/src/deepscientist/gitops/service.py +4 -1
  66. package/src/deepscientist/mcp/server.py +212 -5
  67. package/src/deepscientist/process_control.py +161 -0
  68. package/src/deepscientist/prompts/builder.py +501 -453
  69. package/src/deepscientist/quest/layout.py +15 -2
  70. package/src/deepscientist/quest/service.py +2539 -195
  71. package/src/deepscientist/quest/stage_views.py +177 -1
  72. package/src/deepscientist/runners/base.py +2 -0
  73. package/src/deepscientist/runners/codex.py +169 -31
  74. package/src/deepscientist/runners/runtime_overrides.py +17 -1
  75. package/src/deepscientist/skills/__init__.py +2 -2
  76. package/src/deepscientist/skills/installer.py +196 -5
  77. package/src/deepscientist/skills/registry.py +66 -0
  78. package/src/prompts/connectors/qq.md +18 -8
  79. package/src/prompts/connectors/weixin.md +16 -6
  80. package/src/prompts/contracts/shared_interaction.md +24 -4
  81. package/src/prompts/system.md +921 -72
  82. package/src/prompts/system_copilot.md +43 -0
  83. package/src/skills/analysis-campaign/SKILL.md +32 -2
  84. package/src/skills/analysis-campaign/references/artifact-orchestration.md +1 -1
  85. package/src/skills/analysis-campaign/references/writing-facing-slice-examples.md +65 -0
  86. package/src/skills/baseline/SKILL.md +10 -0
  87. package/src/skills/decision/SKILL.md +27 -2
  88. package/src/skills/experiment/SKILL.md +16 -2
  89. package/src/skills/figure-polish/SKILL.md +1 -0
  90. package/src/skills/finalize/SKILL.md +19 -0
  91. package/src/skills/idea/SKILL.md +79 -0
  92. package/src/skills/idea/references/idea-generation-playbook.md +100 -0
  93. package/src/skills/idea/references/outline-seeding-example.md +60 -0
  94. package/src/skills/intake-audit/SKILL.md +9 -1
  95. package/src/skills/mentor/SKILL.md +217 -0
  96. package/src/skills/mentor/references/correction-rules.md +210 -0
  97. package/src/skills/mentor/references/knowledge-profile.md +91 -0
  98. package/src/skills/mentor/references/persona-profile.md +138 -0
  99. package/src/skills/mentor/references/taste-profile.md +128 -0
  100. package/src/skills/mentor/references/thought-style-profile.md +138 -0
  101. package/src/skills/mentor/references/work-profile.md +289 -0
  102. package/src/skills/mentor/references/workflow-profile.md +240 -0
  103. package/src/skills/optimize/SKILL.md +1645 -0
  104. package/src/skills/rebuttal/SKILL.md +3 -1
  105. package/src/skills/review/SKILL.md +3 -1
  106. package/src/skills/scout/SKILL.md +8 -0
  107. package/src/skills/write/SKILL.md +81 -12
  108. package/src/skills/write/references/outline-evidence-contract-example.md +107 -0
  109. package/src/tui/dist/app/AppContainer.js +22 -11
  110. package/src/tui/dist/index.js +4 -1
  111. package/src/tui/dist/lib/api.js +33 -3
  112. package/src/tui/package.json +1 -1
  113. package/src/ui/dist/assets/AiManusChatView-COFACy7V.js +204 -0
  114. package/src/ui/dist/assets/AnalysisPlugin-DnSm0GZn.js +1 -0
  115. package/src/ui/dist/assets/CliPlugin-CvwCmDQ5.js +109 -0
  116. package/src/ui/dist/assets/CodeEditorPlugin-cOqSa0xq.js +2 -0
  117. package/src/ui/dist/assets/CodeViewerPlugin-itb0tltR.js +270 -0
  118. package/src/ui/dist/assets/DocViewerPlugin-DqKkiCI6.js +7 -0
  119. package/src/ui/dist/assets/GitCommitViewerPlugin-DVgNHBCS.js +1 -0
  120. package/src/ui/dist/assets/GitDiffViewerPlugin-DxL2ezFG.js +6 -0
  121. package/src/ui/dist/assets/GitSnapshotViewer-B_RQm1YZ.js +30 -0
  122. package/src/ui/dist/assets/ImageViewerPlugin-tHqlXY3n.js +26 -0
  123. package/src/ui/dist/assets/LabCopilotPanel-ClMbq5Yu.js +14 -0
  124. package/src/ui/dist/assets/LabPlugin-L_SuE8ow.js +22 -0
  125. package/src/ui/dist/assets/LatexPlugin-B495DTXC.js +25 -0
  126. package/src/ui/dist/assets/MarkdownViewerPlugin-DG28-61B.js +128 -0
  127. package/src/ui/dist/assets/MarketplacePlugin-BiOGT-Kj.js +13 -0
  128. package/src/ui/dist/assets/{NotebookEditor-CccQYZjX.css → NotebookEditor-BHH8rdGj.css} +1 -1
  129. package/src/ui/dist/assets/NotebookEditor-BOr3x3Ej.css +1 -0
  130. package/src/ui/dist/assets/NotebookEditor-C-4Kt1p9.js +81 -0
  131. package/src/ui/dist/assets/NotebookEditor-CVsj8h_T.js +361 -0
  132. package/src/ui/dist/assets/PdfLoader-CASDQmxJ.js +16 -0
  133. package/src/ui/dist/assets/PdfLoader-Cy5jtWrr.css +1 -0
  134. package/src/ui/dist/assets/PdfMarkdownPlugin-BFhwoKsY.js +1 -0
  135. package/src/ui/dist/assets/PdfViewerPlugin-DcOzU9vd.js +17 -0
  136. package/src/ui/dist/assets/PdfViewerPlugin-nwwE-fjJ.css +1 -0
  137. package/src/ui/dist/assets/SearchPlugin-CHj7M58O.js +16 -0
  138. package/src/ui/dist/assets/SearchPlugin-DA4en4hK.css +1 -0
  139. package/src/ui/dist/assets/TextViewerPlugin-CB4DYfWO.js +54 -0
  140. package/src/ui/dist/assets/VNCViewer-CjlbyCB3.js +11 -0
  141. package/src/ui/dist/assets/bot-CFkZY-JP.js +6 -0
  142. package/src/ui/dist/assets/browser-CTB2jwNe.js +8 -0
  143. package/src/ui/dist/assets/chevron-up-Dq5ofbht.js +6 -0
  144. package/src/ui/dist/assets/code-DLC6G24T.js +6 -0
  145. package/src/ui/dist/assets/file-content-Dv4LoZec.js +1 -0
  146. package/src/ui/dist/assets/file-diff-panel-Denq-lC3.js +1 -0
  147. package/src/ui/dist/assets/file-jump-queue-DA-SdG__.js +1 -0
  148. package/src/ui/dist/assets/file-socket-Cu4Qln7Y.js +1 -0
  149. package/src/ui/dist/assets/git-commit-horizontal-BUh6G52n.js +6 -0
  150. package/src/ui/dist/assets/image-B9HUUddG.js +6 -0
  151. package/src/ui/dist/assets/index-B2B1sg-M.js +1 -0
  152. package/src/ui/dist/assets/index-Cgla8biy.css +33 -0
  153. package/src/ui/dist/assets/index-DRyx7vAc.js +1 -0
  154. package/src/ui/dist/assets/index-Gbl53BNp.js +2496 -0
  155. package/src/ui/dist/assets/index-wQ7RIIRd.js +11 -0
  156. package/src/ui/dist/assets/monaco-CiHMMNH_.js +1 -0
  157. package/src/ui/dist/assets/pdf-effect-queue-ZtnHFCAi.js +6 -0
  158. package/src/ui/dist/assets/plugin-monaco-C8UgLomw.js +19 -0
  159. package/src/ui/dist/assets/plugin-notebook-HbW2K-1c.js +169 -0
  160. package/src/ui/dist/assets/plugin-pdf-CR8hgQBV.js +357 -0
  161. package/src/ui/dist/assets/plugin-terminal-MXFIPun8.js +227 -0
  162. package/src/ui/dist/assets/popover-DL6h35vr.js +1 -0
  163. package/src/ui/dist/assets/project-sync-CsX08Qno.js +1 -0
  164. package/src/ui/dist/assets/select-DvmXt1yY.js +11 -0
  165. package/src/ui/dist/assets/sigma-7jpXazui.js +6 -0
  166. package/src/ui/dist/assets/trash-xA7kFt8i.js +11 -0
  167. package/src/ui/dist/assets/useCliAccess-DsMwDjOp.js +1 -0
  168. package/src/ui/dist/assets/useFileDiffOverlay-FuhcnKiw.js +1 -0
  169. package/src/ui/dist/assets/wrap-text-CwMn-iqb.js +11 -0
  170. package/src/ui/dist/assets/zoom-out-R-GWEhzS.js +11 -0
  171. package/src/ui/dist/index.html +5 -2
  172. package/src/ui/dist/assets/AiManusChatView-DaF9Nge_.js +0 -26597
  173. package/src/ui/dist/assets/AnalysisPlugin-BSVx6dXE.js +0 -123
  174. package/src/ui/dist/assets/CliPlugin-C9gzJX41.js +0 -5905
  175. package/src/ui/dist/assets/CodeEditorPlugin-DU9G0Tox.js +0 -427
  176. package/src/ui/dist/assets/CodeViewerPlugin-DoX_fI9l.js +0 -905
  177. package/src/ui/dist/assets/DocViewerPlugin-C4FWIXuU.js +0 -278
  178. package/src/ui/dist/assets/GitDiffViewerPlugin-BgfFMgtf.js +0 -2661
  179. package/src/ui/dist/assets/ImageViewerPlugin-tcPkfY_x.js +0 -500
  180. package/src/ui/dist/assets/LabCopilotPanel-_dKV60Bf.js +0 -4104
  181. package/src/ui/dist/assets/LabPlugin-Bje0ayoC.js +0 -2677
  182. package/src/ui/dist/assets/LatexPlugin-CVsBzAln.js +0 -1792
  183. package/src/ui/dist/assets/MarkdownViewerPlugin-xjmrqv_8.js +0 -308
  184. package/src/ui/dist/assets/MarketplacePlugin-mMM2A8wP.js +0 -413
  185. package/src/ui/dist/assets/NotebookEditor-3kVDSOBo.js +0 -4214
  186. package/src/ui/dist/assets/NotebookEditor-C3VQ7ylN.css +0 -1405
  187. package/src/ui/dist/assets/NotebookEditor-SoJ8X-MO.js +0 -84873
  188. package/src/ui/dist/assets/PdfLoader-C-Y707R3.css +0 -49
  189. package/src/ui/dist/assets/PdfLoader-DElVuHl9.js +0 -25468
  190. package/src/ui/dist/assets/PdfMarkdownPlugin-Bq88XT4G.js +0 -409
  191. package/src/ui/dist/assets/PdfViewerPlugin-CsCXMo9S.js +0 -3095
  192. package/src/ui/dist/assets/PdfViewerPlugin-DQ11QcSf.css +0 -3627
  193. package/src/ui/dist/assets/SearchPlugin-DDMrGDkh.css +0 -379
  194. package/src/ui/dist/assets/SearchPlugin-oUPvy19k.js +0 -741
  195. package/src/ui/dist/assets/TextViewerPlugin-CRkT9yNy.js +0 -472
  196. package/src/ui/dist/assets/VNCViewer-BgbuvWhR.js +0 -18821
  197. package/src/ui/dist/assets/awareness-C0NPR2Dj.js +0 -292
  198. package/src/ui/dist/assets/bot-v_RASACv.js +0 -21
  199. package/src/ui/dist/assets/browser-BAcuE0Xj.js +0 -2895
  200. package/src/ui/dist/assets/code-5hC9d0VH.js +0 -17
  201. package/src/ui/dist/assets/file-content-D1PxfOrp.js +0 -377
  202. package/src/ui/dist/assets/file-diff-panel-DG1oT_Hj.js +0 -92
  203. package/src/ui/dist/assets/file-jump-queue-r5XKgJEV.js +0 -16
  204. package/src/ui/dist/assets/file-socket-BmdFYQlk.js +0 -58
  205. package/src/ui/dist/assets/function-B5QZkkHC.js +0 -1895
  206. package/src/ui/dist/assets/image-Dqe2X2tW.js +0 -18
  207. package/src/ui/dist/assets/index-BQG-1s2o.css +0 -12553
  208. package/src/ui/dist/assets/index-DVsMKK_y.js +0 -25
  209. package/src/ui/dist/assets/index-Duvz8Ip0.js +0 -159
  210. package/src/ui/dist/assets/index-Nt9hS4ck.js +0 -244829
  211. package/src/ui/dist/assets/index-RDlNXXx1.js +0 -120
  212. package/src/ui/dist/assets/monaco-DIXge1CP.js +0 -623
  213. package/src/ui/dist/assets/pdf-effect-queue-BBTTQaO-.js +0 -47
  214. package/src/ui/dist/assets/pdf_viewer-e0g1is2C.js +0 -8206
  215. package/src/ui/dist/assets/popover-BWlolyxo.js +0 -476
  216. package/src/ui/dist/assets/project-sync-BM5PkFH4.js +0 -297
  217. package/src/ui/dist/assets/select-D4dAtrA8.js +0 -1690
  218. package/src/ui/dist/assets/sigma-CKbE5jJT.js +0 -22
  219. package/src/ui/dist/assets/square-check-big-CZNGMgiB.js +0 -17
  220. package/src/ui/dist/assets/trash-DaB37xAz.js +0 -32
  221. package/src/ui/dist/assets/useCliAccess-C2OmAcWe.js +0 -957
  222. package/src/ui/dist/assets/useFileDiffOverlay-Dowd1Ij4.js +0 -53
  223. package/src/ui/dist/assets/wrap-text-BGjAhAUq.js +0 -35
  224. package/src/ui/dist/assets/yjs-DncrqiZ8.js +0 -11243
  225. package/src/ui/dist/assets/zoom-out-dMZQMXzc.js +0 -34
@@ -0,0 +1,134 @@
1
+ # 16 Telegram Connector Guide
2
+
3
+ Use this guide when you want DeepScientist to continue a quest through Telegram.
4
+
5
+ Telegram in the current open-source runtime uses the built-in polling path:
6
+
7
+ - no public webhook is required
8
+ - the main credential is the BotFather token
9
+ - direct messages can auto-bind to the latest active quest when enabled
10
+
11
+ ## 1. What Telegram support includes
12
+
13
+ DeepScientist currently supports Telegram through:
14
+
15
+ - `TelegramPollingService` for inbound polling
16
+ - `GenericRelayChannel` for bindings, inbox/outbox, targets, and runtime status
17
+ - `TelegramConnectorBridge` for direct outbound sends through the Bot API
18
+
19
+ This means Telegram already fits the same quest-binding model as the other connector surfaces.
20
+
21
+ ## 2. Recommended setup path
22
+
23
+ 1. Open BotFather.
24
+ 2. Run `/newbot`.
25
+ 3. Save the generated bot token.
26
+ 4. Open `Settings > Connectors > Telegram`.
27
+ 5. Enable Telegram.
28
+ 6. Keep `transport: polling`.
29
+ 7. Fill `bot_token`.
30
+ 8. Save the connector.
31
+ 9. Send one real private message such as `/start` or `/help` to the bot.
32
+ 10. Return to DeepScientist and verify that the runtime has discovered the target conversation.
33
+
34
+ ## 3. Important config fields
35
+
36
+ Main fields:
37
+
38
+ - `enabled`
39
+ - `transport`
40
+ - `bot_name`
41
+ - `bot_token`
42
+ - `command_prefix`
43
+ - `require_mention_in_groups`
44
+ - `dm_policy`
45
+ - `allow_from`
46
+ - `group_policy`
47
+ - `group_allow_from`
48
+ - `groups`
49
+ - `auto_bind_dm_to_active_quest`
50
+
51
+ For the full field reference, see [01 Settings Reference](./01_SETTINGS_REFERENCE.md).
52
+
53
+ ## 4. Binding model
54
+
55
+ Telegram conversations are normalized into quest-aware connector ids like:
56
+
57
+ - `telegram:direct:<chat_id>`
58
+ - `telegram:group:<chat_id>`
59
+
60
+ DeepScientist binds quests to those normalized conversation ids, not to transient webhook state.
61
+
62
+ Important rules:
63
+
64
+ - one quest keeps local access plus at most one external connector target
65
+ - direct messages can auto-follow the latest active quest when auto-bind is enabled
66
+ - bindings can be changed later from the project settings page
67
+
68
+ ## 5. Group chat behavior
69
+
70
+ By default:
71
+
72
+ - Telegram direct messages are allowed
73
+ - group behavior depends on `group_policy`
74
+ - if `require_mention_in_groups` is `true`, the bot only reacts when explicitly mentioned or when a command is used
75
+
76
+ This is the recommended default for larger shared groups.
77
+
78
+ ## 6. Outbound delivery
79
+
80
+ Telegram outbound delivery currently focuses on text-first quest updates:
81
+
82
+ - progress
83
+ - milestone summaries
84
+ - binding notices
85
+ - structured quest replies
86
+
87
+ The current bridge uses `sendMessage` through the Bot API.
88
+
89
+ ## 7. Troubleshooting
90
+
91
+ ### Telegram does not appear in Settings
92
+
93
+ Telegram may be hidden by the system connector gate. Confirm that:
94
+
95
+ - `config.connectors.system_enabled.telegram` is `true`
96
+
97
+ ### Validation says credentials are missing
98
+
99
+ Check that:
100
+
101
+ - `bot_token` is filled
102
+ - or `bot_token_env` points at a real environment variable
103
+
104
+ ### The bot receives no messages
105
+
106
+ Check that:
107
+
108
+ - the bot token is correct
109
+ - the bot was started from Telegram at least once
110
+ - `transport` is still `polling`
111
+ - no stale public webhook is intercepting updates
112
+
113
+ ### Group messages do not trigger the bot
114
+
115
+ Check:
116
+
117
+ - `group_policy`
118
+ - `groups`
119
+ - `group_allow_from`
120
+ - `require_mention_in_groups`
121
+
122
+ ### The quest does not continue from Telegram
123
+
124
+ Check that:
125
+
126
+ - the conversation is bound to the intended quest
127
+ - or `auto_bind_dm_to_active_quest` is enabled for direct-message pairing
128
+
129
+ ## 8. Related docs
130
+
131
+ - [01 Settings Reference](./01_SETTINGS_REFERENCE.md)
132
+ - [02 Start Research Guide](./02_START_RESEARCH_GUIDE.md)
133
+ - [09 Doctor](./09_DOCTOR.md)
134
+ - [13 Core Architecture Guide](./13_CORE_ARCHITECTURE_GUIDE.md)
@@ -0,0 +1,126 @@
1
+ # 17 WhatsApp Connector Guide
2
+
3
+ Use this guide when you want DeepScientist to continue a quest through WhatsApp.
4
+
5
+ The current open-source runtime prefers the local-session path for WhatsApp:
6
+
7
+ - no public webhook is required for the recommended path
8
+ - the local auth/session state stays on your machine
9
+ - direct messages can auto-bind to the latest active quest when enabled
10
+
11
+ ## 1. What WhatsApp support includes
12
+
13
+ DeepScientist currently supports WhatsApp through:
14
+
15
+ - `WhatsAppLocalSessionService` for local session sync and inbound ingestion
16
+ - `GenericRelayChannel` for bindings, inbox/outbox, targets, and runtime status
17
+ - `WhatsAppConnectorBridge` for outbound delivery
18
+
19
+ For the recommended path, outbound delivery is queued into the local-session outbox and handled by the local sidecar/session runtime.
20
+
21
+ ## 2. Recommended setup path
22
+
23
+ 1. Open `Settings > Connectors > WhatsApp`.
24
+ 2. Enable WhatsApp.
25
+ 3. Keep `transport: local_session`.
26
+ 4. Keep or choose a writable `session_dir`.
27
+ 5. Save the connector.
28
+ 6. Complete the local login flow for the WhatsApp session.
29
+ 7. Send one real message from WhatsApp.
30
+ 8. Return to DeepScientist and verify that the target conversation has been discovered.
31
+
32
+ ## 3. Important config fields
33
+
34
+ Main fields:
35
+
36
+ - `enabled`
37
+ - `transport`
38
+ - `bot_name`
39
+ - `auth_method`
40
+ - `session_dir`
41
+ - `command_prefix`
42
+ - `dm_policy`
43
+ - `allow_from`
44
+ - `group_policy`
45
+ - `group_allow_from`
46
+ - `groups`
47
+ - `auto_bind_dm_to_active_quest`
48
+
49
+ For the full field reference, see [01 Settings Reference](./01_SETTINGS_REFERENCE.md).
50
+
51
+ ## 4. Binding model
52
+
53
+ WhatsApp conversations are normalized into quest-aware connector ids like:
54
+
55
+ - `whatsapp:direct:<jid>`
56
+ - `whatsapp:group:<jid>`
57
+
58
+ DeepScientist binds quests to those normalized conversation ids instead of transient browser/session state.
59
+
60
+ Important rules:
61
+
62
+ - one quest keeps local access plus at most one external connector target
63
+ - direct messages can auto-follow the latest active quest when auto-bind is enabled
64
+ - bindings can be changed later from the project settings page
65
+
66
+ ## 5. Local-session runtime behavior
67
+
68
+ The current open-source path is local-session oriented:
69
+
70
+ - runtime status is mirrored into DeepScientist under connector logs
71
+ - inbound messages are drained from the local session inbox
72
+ - outbound messages are queued into the local session outbox
73
+
74
+ This keeps the recommended WhatsApp path local-first.
75
+
76
+ ## 6. Group behavior
77
+
78
+ By default:
79
+
80
+ - direct messages can pair with the active quest
81
+ - group behavior depends on `group_policy`
82
+ - group allowlists can be enforced through `groups` and `group_allow_from`
83
+
84
+ ## 7. Troubleshooting
85
+
86
+ ### WhatsApp does not appear in Settings
87
+
88
+ WhatsApp may be hidden by the system connector gate. Confirm that:
89
+
90
+ - `config.connectors.system_enabled.whatsapp` is `true`
91
+
92
+ ### Validation says the connector is not ready
93
+
94
+ Check that:
95
+
96
+ - `transport` is `local_session`
97
+ - `session_dir` points to a writable path
98
+
99
+ ### No discovered targets appear
100
+
101
+ Check that:
102
+
103
+ - the local login/session flow has completed
104
+ - at least one real inbound message has reached the local session inbox
105
+
106
+ ### The quest does not continue from WhatsApp
107
+
108
+ Check that:
109
+
110
+ - the conversation is bound to the intended quest
111
+ - or `auto_bind_dm_to_active_quest` is enabled for direct-message pairing
112
+
113
+ ### Outbound messages do not arrive
114
+
115
+ Check that:
116
+
117
+ - the local-session sidecar or local session processor is running
118
+ - the local session outbox is being drained
119
+ - the target JID is correct
120
+
121
+ ## 8. Related docs
122
+
123
+ - [01 Settings Reference](./01_SETTINGS_REFERENCE.md)
124
+ - [02 Start Research Guide](./02_START_RESEARCH_GUIDE.md)
125
+ - [09 Doctor](./09_DOCTOR.md)
126
+ - [13 Core Architecture Guide](./13_CORE_ARCHITECTURE_GUIDE.md)
@@ -0,0 +1,136 @@
1
+ # 18 Feishu Connector Guide
2
+
3
+ Use this guide when you want DeepScientist to continue a quest through Feishu / Lark.
4
+
5
+ The current open-source runtime prefers the built-in long-connection path:
6
+
7
+ - no public event callback is required for the recommended setup
8
+ - the main credentials are `app_id` and `app_secret`
9
+ - direct messages can auto-bind to the latest active quest when enabled
10
+
11
+ ## 1. What Feishu support includes
12
+
13
+ DeepScientist currently supports Feishu through:
14
+
15
+ - `FeishuLongConnectionService` for inbound long-connection delivery
16
+ - `GenericRelayChannel` for bindings, inbox/outbox, targets, and runtime status
17
+ - `FeishuConnectorBridge` for direct outbound sends
18
+
19
+ This means Feishu already fits the same quest-binding model as the other connector surfaces.
20
+
21
+ ## 2. Recommended setup path
22
+
23
+ 1. Open the Feishu / Lark developer platform.
24
+ 2. Create an app.
25
+ 3. Save `app_id` and `app_secret`.
26
+ 4. Open `Settings > Connectors > Feishu`.
27
+ 5. Enable Feishu.
28
+ 6. Keep `transport: long_connection`.
29
+ 7. Fill `app_id` and `app_secret`.
30
+ 8. Save the connector.
31
+ 9. Send one real message to the bot.
32
+ 10. Return to DeepScientist and confirm that the target conversation has been discovered.
33
+
34
+ ## 3. Important config fields
35
+
36
+ Main fields:
37
+
38
+ - `enabled`
39
+ - `transport`
40
+ - `bot_name`
41
+ - `app_id`
42
+ - `app_secret`
43
+ - `api_base_url`
44
+ - `command_prefix`
45
+ - `dm_policy`
46
+ - `allow_from`
47
+ - `group_policy`
48
+ - `group_allow_from`
49
+ - `groups`
50
+ - `require_mention_in_groups`
51
+ - `auto_bind_dm_to_active_quest`
52
+
53
+ For the full field reference, see [01 Settings Reference](./01_SETTINGS_REFERENCE.md).
54
+
55
+ ## 4. Binding model
56
+
57
+ Feishu conversations are normalized into quest-aware connector ids like:
58
+
59
+ - `feishu:direct:<chat_id>`
60
+ - `feishu:group:<chat_id>`
61
+
62
+ DeepScientist binds quests to those normalized conversation ids, not to transient callback payloads.
63
+
64
+ Important rules:
65
+
66
+ - one quest keeps local access plus at most one external connector target
67
+ - direct messages can auto-follow the latest active quest when auto-bind is enabled
68
+ - bindings can be changed later from the project settings page
69
+
70
+ ## 5. Group behavior
71
+
72
+ By default:
73
+
74
+ - direct messages are allowed
75
+ - group behavior depends on `group_policy`
76
+ - if `require_mention_in_groups` is `true`, the bot only reacts when explicitly mentioned or when a command is used
77
+
78
+ This is the recommended default for larger shared workspaces.
79
+
80
+ ## 6. Outbound delivery
81
+
82
+ Feishu outbound delivery currently focuses on text-first quest updates:
83
+
84
+ - progress
85
+ - milestone summaries
86
+ - binding notices
87
+ - structured quest replies
88
+
89
+ The current bridge delivers through the Feishu Open Platform messaging API.
90
+
91
+ ## 7. Troubleshooting
92
+
93
+ ### Feishu does not appear in Settings
94
+
95
+ Feishu may be hidden by the system connector gate. Confirm that:
96
+
97
+ - `config.connectors.system_enabled.feishu` is `true`
98
+
99
+ ### Validation says credentials are missing
100
+
101
+ Check that:
102
+
103
+ - `app_id` is filled
104
+ - `app_secret` is filled
105
+ - or `app_secret_env` points at a real environment variable
106
+
107
+ ### No discovered targets appear
108
+
109
+ Check that:
110
+
111
+ - the app credentials are correct
112
+ - the bot has received at least one real inbound message
113
+ - `transport` is still `long_connection`
114
+
115
+ ### Group messages do not trigger the bot
116
+
117
+ Check:
118
+
119
+ - `group_policy`
120
+ - `groups`
121
+ - `group_allow_from`
122
+ - `require_mention_in_groups`
123
+
124
+ ### The quest does not continue from Feishu
125
+
126
+ Check that:
127
+
128
+ - the conversation is bound to the intended quest
129
+ - or `auto_bind_dm_to_active_quest` is enabled for direct-message pairing
130
+
131
+ ## 8. Related docs
132
+
133
+ - [01 Settings Reference](./01_SETTINGS_REFERENCE.md)
134
+ - [02 Start Research Guide](./02_START_RESEARCH_GUIDE.md)
135
+ - [09 Doctor](./09_DOCTOR.md)
136
+ - [13 Core Architecture Guide](./13_CORE_ARCHITECTURE_GUIDE.md)
@@ -0,0 +1,226 @@
1
+ # 19 External Controller Guide
2
+
3
+ DeepScientist already exposes enough durable state to support an outer orchestration layer without patching core runtime code.
4
+
5
+ This guide explains the minimal public pattern for external controllers that:
6
+
7
+ - inspect recent quest state
8
+ - decide whether the current run should continue
9
+ - enqueue a routed follow-up message through the quest mailbox
10
+ - optionally stop the current run through `quest_control`
11
+ - record a durable report explaining why the guard fired
12
+
13
+ This is intentionally lighter than a plugin framework.
14
+
15
+ ## When to use an external controller
16
+
17
+ Use an external controller when the rule is:
18
+
19
+ - project-specific
20
+ - expensive to hard-code into global prompts or skills
21
+ - better treated as outer governance than as core runtime behavior
22
+
23
+ Examples:
24
+
25
+ - publishability admission rules before paper-facing writing
26
+ - repeated figure-polish loops that monopolize the frontier
27
+ - lab-specific stop / branch policies
28
+
29
+ ## Public contracts you can rely on
30
+
31
+ The safest extension surface is the existing durable runtime contract:
32
+
33
+ - quest mailbox
34
+ - queued user-facing messages are stored under `.ds/user_message_queue.json`
35
+ - recent quest state
36
+ - runtime state, artifact state, and connector-visible outputs are already durable files
37
+ - daemon quest control
38
+ - `POST /api/quests/<quest_id>/control`
39
+ - connector-visible durable reports
40
+ - write your own report under the quest tree so the next turn can cite it
41
+
42
+ Prefer these contracts over prompt patching, private monkey-patching, or editing installed package files.
43
+
44
+ ## Minimal controller loop
45
+
46
+ An external controller usually follows this sequence:
47
+
48
+ 1. Read the latest durable quest state.
49
+ 2. Decide whether a guard condition is active.
50
+ 3. Write a durable report describing:
51
+ - what was observed
52
+ - why it matters
53
+ - the recommended next route
54
+ 4. If intervention is needed:
55
+ - optionally stop the current run through `quest_control`
56
+ - enqueue one clear routed mailbox message for the next turn
57
+
58
+ The mailbox message should explain the conclusion, not dump raw logs.
59
+
60
+ ## Example control flow
61
+
62
+ ```text
63
+ read quest state
64
+ -> detect low-yield loop or route violation
65
+ -> write durable report
66
+ -> stop current run if needed
67
+ -> enqueue one mailbox message with the required next route
68
+ ```
69
+
70
+ ## Example `quest_control` request
71
+
72
+ ```bash
73
+ curl -X POST http://127.0.0.1:20999/api/quests/<quest_id>/control \
74
+ -H 'Content-Type: application/json' \
75
+ -d '{
76
+ "action": "stop",
77
+ "source": "external-controller"
78
+ }'
79
+ ```
80
+
81
+ ## Example mailbox intervention shape
82
+
83
+ The exact queue file is runtime-owned, so your controller should preserve the existing schema and only append a normal user-style message payload.
84
+
85
+ The message content should be short and actionable, for example:
86
+
87
+ ```text
88
+ Hard control message from external orchestration layer: stop the current figure loop.
89
+ Return to the main line and do one bounded route next:
90
+ 1. literature scout
91
+ 2. reference expansion
92
+ 3. manuscript body revision
93
+ ```
94
+
95
+ ## Example controllers you can adapt
96
+
97
+ ### Example 1: publishability admission guard
98
+
99
+ This controller is useful when a quest is drifting into paper-facing writing before the evidence line is ready.
100
+
101
+ Typical inputs:
102
+
103
+ - the latest verification note
104
+ - the current draft / summary state
105
+ - recent baseline or utility results
106
+
107
+ Typical stop condition:
108
+
109
+ - the claimed paper direction still has weak support
110
+ - one or more mandatory evidence items are still missing
111
+
112
+ Typical intervention:
113
+
114
+ 1. Write `reports/publishability_guard.md` explaining the missing support.
115
+ 2. Stop the current write-heavy run through `quest_control`.
116
+ 3. Enqueue one mailbox message that routes the next turn back to `idea`, `analysis`, or a bounded evidence-repair step.
117
+
118
+ Example mailbox text:
119
+
120
+ ```text
121
+ External controller: do not continue manuscript-facing writing yet.
122
+ Reason: the current evidence line does not pass the publishability admission gate.
123
+ Next route: return to one bounded evidence-building step before write resumes.
124
+ ```
125
+
126
+ ### Example 2: figure-loop guard
127
+
128
+ This controller is useful when the frontier is monopolized by repeated reopen / polish cycles on the same figure.
129
+
130
+ Typical inputs:
131
+
132
+ - recent figure artifact history
133
+ - repeated reopen events
134
+ - the latest review or summary note
135
+
136
+ Typical stop condition:
137
+
138
+ - the same figure has been reopened multiple times without improving the main claim
139
+ - the next useful action is no longer figure polish, but evidence repair or manuscript revision
140
+
141
+ Typical intervention:
142
+
143
+ 1. Write `reports/figure_loop_guard.md` summarizing the loop.
144
+ 2. Stop the current figure branch if needed.
145
+ 3. Enqueue one mailbox message that names exactly one next route.
146
+
147
+ Example mailbox text:
148
+
149
+ ```text
150
+ External controller: stop the current figure-polish loop.
151
+ Reason: repeated reopen cycles are no longer improving the main evidence line.
152
+ Next route: return to one bounded manuscript or analysis task.
153
+ ```
154
+
155
+ ## Example connector customization surface
156
+
157
+ The control logic should stay connector-agnostic. In practice, adapting the same controller to a different connector usually means changing only the message profile, not the stop logic or durable report contract.
158
+
159
+ For example:
160
+
161
+ ```yaml
162
+ connector_profiles:
163
+ weixin:
164
+ summary_style: concise
165
+ max_route_options: 2
166
+ include_report_path: true
167
+ telegram:
168
+ summary_style: concise
169
+ max_route_options: 3
170
+ include_report_path: true
171
+ studio:
172
+ summary_style: detailed
173
+ max_route_options: 4
174
+ include_report_excerpt: true
175
+ ```
176
+
177
+ The controller decision stays the same:
178
+
179
+ - read durable state
180
+ - decide whether to stop
181
+ - write a durable report
182
+ - enqueue one routed mailbox message
183
+
184
+ What changes per connector is only how much detail you surface to the human operator.
185
+
186
+ ## Durable report shape
187
+
188
+ Keep reports simple and auditable.
189
+
190
+ A good report usually includes:
191
+
192
+ - `generated_at`
193
+ - `quest_id`
194
+ - `status`
195
+ - `recommended_action`
196
+ - `blockers`
197
+ - `evidence_summary`
198
+
199
+ Markdown plus a machine-readable JSON companion is a practical pattern.
200
+
201
+ ## What not to rely on
202
+
203
+ Avoid building controllers that depend on:
204
+
205
+ - private prompt text offsets
206
+ - internal temporary logs that are not documented durable state
207
+ - patching installed package files inside `site-packages`
208
+ - undocumented frontend-only state
209
+
210
+ If a controller needs one of those, the contract is not stable enough yet.
211
+
212
+ ## Design recommendations
213
+
214
+ - keep each controller focused on one question
215
+ - prefer additive reports over hidden side effects
216
+ - stop only when the next routed action is clear
217
+ - keep domain- or lab-specific policy outside core defaults
218
+ - treat external controllers as optional governance, not as required runtime plumbing
219
+
220
+ ## Good first controllers
221
+
222
+ If you want to start small, begin with one of these:
223
+
224
+ - a publishability admission guard for paper-mode quests
225
+ - a figure-loop guard that stops repeated reopen cycles
226
+ - a route-drift guard that blocks accidental `write` transitions before evidence is ready
@@ -0,0 +1,70 @@
1
+ # Local Browser Auth
2
+
3
+ DeepScientist can optionally protect the local web workspace with a generated 16-character password.
4
+
5
+ This protection is local-first:
6
+
7
+ - it applies to the browser UI
8
+ - it also applies to `/api/*` requests from the browser
9
+ - it is disabled by default unless you launch with `ds --auth true` or set `ui.auth_enabled: true`
10
+
11
+ ## What Happens On Startup
12
+
13
+ When you run `ds --auth true`, DeepScientist starts the daemon and prints two important things in the terminal:
14
+
15
+ - the local browser URL, such as `http://127.0.0.1:20999`
16
+ - the generated local access password for that launch
17
+
18
+ The browser URL is no longer expected to carry `?token=...`.
19
+
20
+ If the browser is not already authenticated, DeepScientist shows a password modal on top of the landing page before it loads quests, docs, settings, or workspace data.
21
+
22
+ ## How To View The Password
23
+
24
+ Use either of these:
25
+
26
+ ```bash
27
+ ds --status
28
+ ```
29
+
30
+ Read the `auth_token` field from the JSON output, or look at the terminal where `ds` was started.
31
+
32
+ ## How Login Persistence Works
33
+
34
+ After the first successful login:
35
+
36
+ - the browser stores the local auth state
37
+ - later visits from the same browser usually open directly
38
+ - restarting or reusing the managed daemon can rotate the password again
39
+
40
+ If the password rotates, the browser will be asked to log in again.
41
+
42
+ ## How To Disable It
43
+
44
+ Enable the browser password gate for one launch:
45
+
46
+ ```bash
47
+ ds --auth true
48
+ ```
49
+
50
+ In that mode:
51
+
52
+ - the password modal is enabled
53
+ - browser requests to `/api/*` require the local auth token
54
+
55
+ To disable it again explicitly for one launch:
56
+
57
+ ```bash
58
+ ds --auth false
59
+ ```
60
+
61
+ In that mode:
62
+
63
+ - the password modal is disabled
64
+ - browser requests to `/api/*` do not require the local auth token
65
+
66
+ ## Practical Notes
67
+
68
+ - This is not intended as internet-grade authentication. It is a local browser gate for machines you control.
69
+ - If you share the machine or expose the port remotely, enable auth explicitly.
70
+ - If you script against the local daemon from a browser client, authenticate first or disable auth explicitly for that launch.