@researai/deepscientist 1.5.8 → 1.5.11

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 (148) hide show
  1. package/LICENSE +186 -21
  2. package/README.md +108 -95
  3. package/assets/branding/connector-qq.png +0 -0
  4. package/assets/branding/connector-rokid.png +0 -0
  5. package/assets/branding/connector-weixin.png +0 -0
  6. package/assets/branding/projects.png +0 -0
  7. package/bin/ds.js +172 -13
  8. package/docs/assets/branding/projects.png +0 -0
  9. package/docs/en/00_QUICK_START.md +308 -70
  10. package/docs/en/01_SETTINGS_REFERENCE.md +3 -0
  11. package/docs/en/02_START_RESEARCH_GUIDE.md +112 -0
  12. package/docs/en/04_LINGZHU_CONNECTOR_GUIDE.md +62 -179
  13. package/docs/en/09_DOCTOR.md +41 -5
  14. package/docs/en/10_WEIXIN_CONNECTOR_GUIDE.md +137 -0
  15. package/docs/en/11_LICENSE_AND_RISK.md +256 -0
  16. package/docs/en/12_GUIDED_WORKFLOW_TOUR.md +427 -0
  17. package/docs/en/13_CORE_ARCHITECTURE_GUIDE.md +297 -0
  18. package/docs/en/14_PROMPT_SKILLS_AND_MCP_GUIDE.md +506 -0
  19. package/docs/en/99_ACKNOWLEDGEMENTS.md +4 -1
  20. package/docs/en/README.md +79 -0
  21. package/docs/images/lingzhu/rokid-agent-platform-create.png +0 -0
  22. package/docs/images/weixin/weixin-plugin-entry.png +0 -0
  23. package/docs/images/weixin/weixin-plugin-entry.svg +33 -0
  24. package/docs/images/weixin/weixin-qr-confirm.svg +30 -0
  25. package/docs/images/weixin/weixin-quest-media-flow.svg +44 -0
  26. package/docs/images/weixin/weixin-settings-bind.svg +57 -0
  27. package/docs/zh/00_QUICK_START.md +315 -74
  28. package/docs/zh/01_SETTINGS_REFERENCE.md +3 -0
  29. package/docs/zh/02_START_RESEARCH_GUIDE.md +112 -0
  30. package/docs/zh/04_LINGZHU_CONNECTOR_GUIDE.md +62 -193
  31. package/docs/zh/09_DOCTOR.md +41 -5
  32. package/docs/zh/10_WEIXIN_CONNECTOR_GUIDE.md +144 -0
  33. package/docs/zh/11_LICENSE_AND_RISK.md +256 -0
  34. package/docs/zh/12_GUIDED_WORKFLOW_TOUR.md +423 -0
  35. package/docs/zh/13_CORE_ARCHITECTURE_GUIDE.md +296 -0
  36. package/docs/zh/14_PROMPT_SKILLS_AND_MCP_GUIDE.md +506 -0
  37. package/docs/zh/99_ACKNOWLEDGEMENTS.md +4 -1
  38. package/docs/zh/README.md +126 -0
  39. package/install.sh +0 -34
  40. package/package.json +3 -3
  41. package/pyproject.toml +2 -2
  42. package/src/deepscientist/__init__.py +1 -1
  43. package/src/deepscientist/annotations.py +343 -0
  44. package/src/deepscientist/artifact/arxiv.py +484 -37
  45. package/src/deepscientist/artifact/metrics.py +1 -3
  46. package/src/deepscientist/artifact/service.py +1347 -111
  47. package/src/deepscientist/arxiv_library.py +275 -0
  48. package/src/deepscientist/bash_exec/service.py +9 -0
  49. package/src/deepscientist/bridges/builtins.py +2 -0
  50. package/src/deepscientist/bridges/connectors.py +447 -0
  51. package/src/deepscientist/channels/__init__.py +2 -0
  52. package/src/deepscientist/channels/builtins.py +3 -1
  53. package/src/deepscientist/channels/qq.py +1 -1
  54. package/src/deepscientist/channels/qq_gateway.py +1 -1
  55. package/src/deepscientist/channels/relay.py +7 -1
  56. package/src/deepscientist/channels/weixin.py +59 -0
  57. package/src/deepscientist/channels/weixin_ilink.py +317 -0
  58. package/src/deepscientist/config/models.py +22 -2
  59. package/src/deepscientist/config/service.py +431 -60
  60. package/src/deepscientist/connector/__init__.py +4 -0
  61. package/src/deepscientist/connector/connector_profiles.py +481 -0
  62. package/src/deepscientist/connector/lingzhu_support.py +668 -0
  63. package/src/deepscientist/connector/qq_profiles.py +206 -0
  64. package/src/deepscientist/connector/weixin_support.py +663 -0
  65. package/src/deepscientist/connector_profiles.py +1 -374
  66. package/src/deepscientist/connector_runtime.py +2 -0
  67. package/src/deepscientist/daemon/api/handlers.py +295 -5
  68. package/src/deepscientist/daemon/api/router.py +16 -1
  69. package/src/deepscientist/daemon/app.py +1130 -61
  70. package/src/deepscientist/doctor.py +5 -2
  71. package/src/deepscientist/gitops/diff.py +120 -29
  72. package/src/deepscientist/lingzhu_support.py +1 -182
  73. package/src/deepscientist/mcp/server.py +14 -5
  74. package/src/deepscientist/prompts/builder.py +29 -1
  75. package/src/deepscientist/qq_profiles.py +1 -196
  76. package/src/deepscientist/quest/node_traces.py +152 -2
  77. package/src/deepscientist/quest/service.py +169 -43
  78. package/src/deepscientist/quest/stage_views.py +172 -9
  79. package/src/deepscientist/registries/baseline.py +56 -4
  80. package/src/deepscientist/runners/codex.py +55 -3
  81. package/src/deepscientist/weixin_support.py +1 -0
  82. package/src/prompts/connectors/lingzhu.md +3 -1
  83. package/src/prompts/connectors/weixin.md +230 -0
  84. package/src/prompts/system.md +9 -0
  85. package/src/skills/idea/SKILL.md +16 -0
  86. package/src/skills/idea/references/literature-survey-template.md +24 -0
  87. package/src/skills/idea/references/related-work-playbook.md +4 -0
  88. package/src/skills/idea/references/selection-gate.md +9 -0
  89. package/src/skills/write/SKILL.md +1 -1
  90. package/src/tui/package.json +1 -1
  91. package/src/ui/dist/assets/{AiManusChatView-m2FNtwbn.js → AiManusChatView-D0mTXG4-.js} +156 -48
  92. package/src/ui/dist/assets/{AnalysisPlugin-BMTF8EGL.js → AnalysisPlugin-Db0cTXxm.js} +1 -1
  93. package/src/ui/dist/assets/{CliPlugin-BEOWgxCI.js → CliPlugin-DrV8je02.js} +164 -9
  94. package/src/ui/dist/assets/{CodeEditorPlugin-BCXvjqmb.js → CodeEditorPlugin-QXMSCH71.js} +8 -8
  95. package/src/ui/dist/assets/{CodeViewerPlugin-DaJcy3nD.js → CodeViewerPlugin-7hhtWj_E.js} +5 -5
  96. package/src/ui/dist/assets/{DocViewerPlugin-ByfeIq4K.js → DocViewerPlugin-BWMSnRJe.js} +3 -3
  97. package/src/ui/dist/assets/{GitDiffViewerPlugin-Cksf3VZ-.js → GitDiffViewerPlugin-7J9h9Vy_.js} +20 -21
  98. package/src/ui/dist/assets/{ImageViewerPlugin-CFz-OsTS.js → ImageViewerPlugin-CHJl_0lr.js} +5 -5
  99. package/src/ui/dist/assets/{LabCopilotPanel-CJ1cJzoX.js → LabCopilotPanel-1qSow1es.js} +11 -11
  100. package/src/ui/dist/assets/{LabPlugin-BF3dVJwa.js → LabPlugin-eQpPPCEp.js} +2 -1
  101. package/src/ui/dist/assets/{LatexPlugin-DDkwZ6Sj.js → LatexPlugin-BwRfi89Z.js} +7 -7
  102. package/src/ui/dist/assets/{MarkdownViewerPlugin-HAuvurcT.js → MarkdownViewerPlugin-836PVQWV.js} +4 -4
  103. package/src/ui/dist/assets/{MarketplacePlugin-BtoTYy2C.js → MarketplacePlugin-C2y_556i.js} +3 -3
  104. package/src/ui/dist/assets/{NotebookEditor-CSJYx7b-.js → NotebookEditor-BRzJbGsn.js} +12 -12
  105. package/src/ui/dist/assets/{NotebookEditor-DQgRezm_.js → NotebookEditor-DIX7Mlzu.js} +1 -1
  106. package/src/ui/dist/assets/{PdfLoader-DPa_-fv6.js → PdfLoader-DzRaTAlq.js} +14 -7
  107. package/src/ui/dist/assets/{PdfMarkdownPlugin-BZpXOEjm.js → PdfMarkdownPlugin-DZUfIUnp.js} +73 -6
  108. package/src/ui/dist/assets/{PdfViewerPlugin-BT8a6wGR.js → PdfViewerPlugin-BwtICzue.js} +103 -34
  109. package/src/ui/dist/assets/PdfViewerPlugin-DQ11QcSf.css +3627 -0
  110. package/src/ui/dist/assets/{SearchPlugin-D_blveZi.js → SearchPlugin-DHeIAMsx.js} +1 -1
  111. package/src/ui/dist/assets/{TextViewerPlugin-Btx0M3hX.js → TextViewerPlugin-C3tCmFox.js} +5 -4
  112. package/src/ui/dist/assets/{VNCViewer-DImJO4rO.js → VNCViewer-CQsKVm3t.js} +10 -10
  113. package/src/ui/dist/assets/bot-BEA2vWuK.js +21 -0
  114. package/src/ui/dist/assets/branding/logo-rokid.png +0 -0
  115. package/src/ui/dist/assets/browser-BAcuE0Xj.js +2895 -0
  116. package/src/ui/dist/assets/{code-BUfXGJSl.js → code-XfbSR8K2.js} +1 -1
  117. package/src/ui/dist/assets/{file-content-VqamwI3X.js → file-content-BjxNaIfy.js} +1 -1
  118. package/src/ui/dist/assets/{file-diff-panel-C_wOoS7a.js → file-diff-panel-D_lLVQk0.js} +1 -1
  119. package/src/ui/dist/assets/{file-socket-D2bTuMVP.js → file-socket-D9x_5vlY.js} +1 -1
  120. package/src/ui/dist/assets/{image-BZkGJ4mM.js → image-BhWT33W1.js} +1 -1
  121. package/src/ui/dist/assets/{index-DdRW6RMJ.js → index--c4iXtuy.js} +12 -12
  122. package/src/ui/dist/assets/{index-CxkvSeKw.js → index-BDxipwrC.js} +2 -2
  123. package/src/ui/dist/assets/{index-DjggJovS.js → index-DZTZ8mWP.js} +14934 -9613
  124. package/src/ui/dist/assets/{index-DXZ1daiJ.css → index-Dqj-Mjb4.css} +2 -13
  125. package/src/ui/dist/assets/index-PJbSbPTy.js +25 -0
  126. package/src/ui/dist/assets/{monaco-DHMc7kKM.js → monaco-K8izTGgo.js} +1 -1
  127. package/src/ui/dist/assets/{pdf-effect-queue-DSw_D3RV.js → pdf-effect-queue-DfBors6y.js} +16 -1
  128. package/src/ui/dist/assets/pdf.worker.min-yatZIOMy.mjs +21 -0
  129. package/src/ui/dist/assets/{popover-B85oCgCS.js → popover-yFK1J4fL.js} +1 -1
  130. package/src/ui/dist/assets/{project-sync-DOMCcPac.js → project-sync-PENr2zcz.js} +1 -74
  131. package/src/ui/dist/assets/select-CAbJDfYv.js +1690 -0
  132. package/src/ui/dist/assets/{sigma-BO2rQrl3.js → sigma-DEuYJqTl.js} +1 -1
  133. package/src/ui/dist/assets/{index-D9QIGcmc.js → square-check-big-omoSUmcd.js} +2 -13
  134. package/src/ui/dist/assets/{trash-BsVEH_dV.js → trash--F119N47.js} +1 -1
  135. package/src/ui/dist/assets/{useCliAccess-b8L6JuZm.js → useCliAccess-D31UR23I.js} +1 -1
  136. package/src/ui/dist/assets/{useFileDiffOverlay-BY7uA9hV.js → useFileDiffOverlay-BH6KcMzq.js} +1 -1
  137. package/src/ui/dist/assets/{wrap-text-BwyVuUIK.js → wrap-text-CZ613PM5.js} +1 -1
  138. package/src/ui/dist/assets/{zoom-out-RDpLugQP.js → zoom-out-BgDLAv3z.js} +1 -1
  139. package/src/ui/dist/index.html +2 -2
  140. package/src/ui/dist/assets/AutoFigurePlugin-BGxN8Umr.css +0 -3056
  141. package/src/ui/dist/assets/AutoFigurePlugin-DxPdMUNb.js +0 -8149
  142. package/src/ui/dist/assets/PdfViewerPlugin-BJXtIwj_.css +0 -260
  143. package/src/ui/dist/assets/Stepper-DH2k75Vo.js +0 -158
  144. package/src/ui/dist/assets/bibtex-B-Hqu0Sg.js +0 -189
  145. package/src/ui/dist/assets/file-utils--zJCPN1i.js +0 -109
  146. package/src/ui/dist/assets/message-square-FUIPIhU2.js +0 -16
  147. package/src/ui/dist/assets/pdfjs-DU1YE8WO.js +0 -3
  148. package/src/ui/dist/assets/tooltip-B1OspAkx.js +0 -108
@@ -0,0 +1,297 @@
1
+ # 13 Core Architecture Guide: How DeepScientist Fits Together
2
+
3
+ This is the user-facing architecture guide.
4
+
5
+ Use it when you want to understand how DeepScientist is organized without reading the maintainer-only architecture reference line by line.
6
+
7
+ If you are maintaining the repository itself, also read [90 Architecture](./90_ARCHITECTURE.md) and [91 Development](./91_DEVELOPMENT.md).
8
+
9
+ ## 1. One-sentence summary
10
+
11
+ DeepScientist is a local-first research operating system where:
12
+
13
+ - the public launcher is `npm` + `ds`
14
+ - the authoritative runtime is Python
15
+ - each quest is its own Git repository
16
+ - prompts and skills drive workflow behavior
17
+ - durable state lives in files, Git, memory cards, artifacts, and run logs
18
+
19
+ ## 2. Main entrypoints
20
+
21
+ DeepScientist has four practical entrypoints:
22
+
23
+ 1. the `ds` command
24
+ 2. the web workspace
25
+ 3. the TUI
26
+ 4. external connectors
27
+
28
+ ### 2.1 `ds`
29
+
30
+ `ds` is the normal user launch path.
31
+
32
+ It is the command that:
33
+
34
+ - prepares the runtime
35
+ - starts the daemon
36
+ - exposes the shared web and TUI API surface
37
+
38
+ ### 2.2 Web workspace
39
+
40
+ The web UI is the main visual workspace.
41
+
42
+ This is where you usually:
43
+
44
+ - create a quest
45
+ - inspect files
46
+ - read Canvas
47
+ - check memory
48
+ - continue a running thread
49
+
50
+ ### 2.3 TUI
51
+
52
+ The TUI is not a separate product with separate state.
53
+
54
+ It talks to the same daemon and the same quest state as the web UI.
55
+
56
+ ### 2.4 Connectors
57
+
58
+ Connectors such as Weixin, QQ, and Lingzhu are communication surfaces.
59
+
60
+ They are not the core runtime.
61
+
62
+ They let the same quest send or receive messages outside the browser.
63
+
64
+ ## 3. Launch chain
65
+
66
+ The normal launch chain is:
67
+
68
+ 1. `npm install -g @researai/deepscientist`
69
+ 2. run `ds`
70
+ 3. `bin/ds.js` prepares the runtime environment
71
+ 4. the Python daemon starts
72
+ 5. the daemon serves the web workspace and shared API
73
+ 6. the web UI, TUI, and connectors all talk to that daemon
74
+
75
+ The key design choice is:
76
+
77
+ - JavaScript is the launcher
78
+ - Python is the runtime authority
79
+
80
+ ## 4. Runtime home
81
+
82
+ By default, DeepScientist uses `~/DeepScientist/` as its runtime home.
83
+
84
+ Important directories inside it are:
85
+
86
+ - `runtime/`
87
+ - `config/`
88
+ - `memory/`
89
+ - `quests/`
90
+ - `logs/`
91
+ - `cache/`
92
+
93
+ What they mean:
94
+
95
+ - `runtime/`: managed runtime tools and Python environment
96
+ - `config/`: YAML config and baseline registry data
97
+ - `memory/`: global memory cards
98
+ - `quests/`: every quest repository
99
+ - `logs/`: daemon and runtime logs
100
+ - `cache/`: reusable caches
101
+
102
+ ## 5. One quest equals one Git repository
103
+
104
+ This is one of the most important DeepScientist ideas.
105
+
106
+ Every quest lives in its own directory:
107
+
108
+ `~/DeepScientist/quests/<quest_id>/`
109
+
110
+ That directory is its own Git repository.
111
+
112
+ This means the quest is not only a chat session.
113
+
114
+ It is a durable local workspace with:
115
+
116
+ - branches
117
+ - files
118
+ - plans
119
+ - summaries
120
+ - artifacts
121
+ - memory
122
+ - shell history
123
+
124
+ This is why DeepScientist can behave like a persistent research map instead of a disposable conversation.
125
+
126
+ ## 6. What `Start Research` actually creates
127
+
128
+ `Start Research` does not only create a new folder.
129
+
130
+ It also creates a structured startup contract.
131
+
132
+ That contract carries:
133
+
134
+ - the research goal
135
+ - references and baselines
136
+ - runtime constraints
137
+ - project objectives
138
+ - connector binding choice
139
+ - launch and decision policy
140
+
141
+ This contract becomes the first durable research brief for the quest.
142
+
143
+ It is the reason the system can start from something more disciplined than an ad hoc prompt.
144
+
145
+ ## 7. What happens when you send a user message
146
+
147
+ The simplified lifecycle is:
148
+
149
+ 1. a user message arrives from web, TUI, or a connector
150
+ 2. the daemon writes it into quest history
151
+ 3. if the quest is idle, the daemon schedules a turn
152
+ 4. the prompt builder assembles the current prompt
153
+ 5. the runner starts
154
+ 6. the agent uses MCP tools, files, Git, and shell
155
+ 7. outputs are persisted as events, artifacts, file changes, and summaries
156
+
157
+ The important detail is:
158
+
159
+ - user messages do not bypass quest state
160
+ - they become part of the quest's durable execution history
161
+
162
+ ## 8. Prompt-led and skill-led workflow
163
+
164
+ DeepScientist does not primarily rely on a giant hard-coded stage scheduler.
165
+
166
+ Instead, workflow discipline mainly comes from:
167
+
168
+ - `src/prompts/system.md`
169
+ - `src/skills/*/SKILL.md`
170
+ - the active quest anchor
171
+
172
+ In practice, this means:
173
+
174
+ - the daemon routes and persists
175
+ - the prompt defines expectations
176
+ - the skill tells the agent how to operate in the current stage
177
+
178
+ This keeps the runtime thinner and makes behavior easier to evolve through prompts and skills.
179
+
180
+ ## 9. The three built-in MCP namespaces
181
+
182
+ DeepScientist keeps its built-in MCP surface intentionally small:
183
+
184
+ - `memory`
185
+ - `artifact`
186
+ - `bash_exec`
187
+
188
+ ### 9.1 `memory`
189
+
190
+ Use `memory` for reusable knowledge:
191
+
192
+ - paper notes
193
+ - failure lessons
194
+ - stable caveats
195
+ - selected idea rationale
196
+
197
+ ### 9.2 `artifact`
198
+
199
+ Use `artifact` for quest state and structured progress:
200
+
201
+ - experiment records
202
+ - branch decisions
203
+ - milestone updates
204
+ - interaction delivery
205
+ - Git-backed quest operations
206
+
207
+ ### 9.3 `bash_exec`
208
+
209
+ Use `bash_exec` for durable shell work:
210
+
211
+ - training
212
+ - evaluations
213
+ - long-running scripts
214
+ - commands that may need later inspection
215
+
216
+ ## 10. Why `artifact.interact(...)` matters so much
217
+
218
+ `artifact.interact(...)` is one of the central runtime tools because it helps the system do several things together:
219
+
220
+ - persist interaction state
221
+ - optionally checkpoint progress
222
+ - push updates outward when routing allows it
223
+ - consume queued inbound user messages
224
+ - keep the interaction thread continuous across long runs
225
+
226
+ This is one reason DeepScientist can support long-running work without losing the collaboration thread.
227
+
228
+ ## 11. How the web workspace is built from durable state
229
+
230
+ The workspace is not a fake frontend over one temporary answer.
231
+
232
+ Different surfaces are rebuilt from durable state:
233
+
234
+ - `Explorer` from quest files and derived file-tree state
235
+ - `Canvas` from Git, artifacts, and raw quest events
236
+ - `Details` from quest summaries and state snapshots
237
+ - `Memory` from quest and global memory cards
238
+ - `Copilot / Studio` from the live daemon session plus durable history
239
+
240
+ This is why refreshing the page does not erase the quest's research structure.
241
+
242
+ ## 12. What Canvas really is
243
+
244
+ Canvas is not a separate graph database.
245
+
246
+ It is reconstructed from:
247
+
248
+ - Git branch structure
249
+ - artifact records
250
+ - quest events
251
+
252
+ So when you see a node or branch in Canvas, it should correspond to durable quest state, not only a temporary frontend object.
253
+
254
+ ## 13. Where connectors fit
255
+
256
+ Connectors are adapters around the quest, not replacements for the quest.
257
+
258
+ Their job is to:
259
+
260
+ - receive inbound messages from external surfaces
261
+ - bind those messages to the correct quest
262
+ - deliver outbound updates when routing allows
263
+
264
+ They do not own the core project state.
265
+
266
+ The quest repository and daemon still remain the source of truth.
267
+
268
+ ## 14. Why the system can keep growing
269
+
270
+ DeepScientist can accumulate progress across rounds because it stores state in durable forms:
271
+
272
+ - quest files
273
+ - Git branches and commits
274
+ - memory cards
275
+ - artifact records
276
+ - event logs
277
+ - bash session history
278
+
279
+ That is why later rounds can recover:
280
+
281
+ - what was tried
282
+ - what failed
283
+ - what was selected
284
+ - what evidence was produced
285
+
286
+ This is also why the system feels closer to a workshop than a one-shot run.
287
+
288
+ ## 15. Which document to read next
289
+
290
+ Read these next depending on your goal:
291
+
292
+ - first practical workflow: [12 Guided Workflow Tour](./12_GUIDED_WORKFLOW_TOUR.md)
293
+ - turn-time prompt and tool structure: [14 Prompt, Skills, and MCP Guide](./14_PROMPT_SKILLS_AND_MCP_GUIDE.md)
294
+ - exact startup contract: [02 Start Research Guide](./02_START_RESEARCH_GUIDE.md)
295
+ - runtime and Canvas detail: [06 Runtime and Canvas](./06_RUNTIME_AND_CANVAS.md)
296
+ - memory and MCP detail: [07 Memory and MCP](./07_MEMORY_AND_MCP.md)
297
+ - maintainer architecture: [90 Architecture](./90_ARCHITECTURE.md)