@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
@@ -1,413 +0,0 @@
1
- import { w as createLucideIcon, r as reactExports, aa as useNavigate, n as useTabsStore, ab as useOpenFile, f as useFileTreeStore, v as BUILTIN_PLUGINS, j as jsxRuntimeExports, l as Search, N as Sparkles, ac as Terminal, ad as Settings, ae as Puzzle, af as BookOpen, k as FileText, ag as FileCode2, b as cn } from './index-Nt9hS4ck.js';
2
- import { S as Sigma } from './sigma-CKbE5jJT.js';
3
- import { I as Image } from './image-Dqe2X2tW.js';
4
-
5
- /**
6
- * @license lucide-react v0.511.0 - ISC
7
- *
8
- * This source code is licensed under the ISC license.
9
- * See the LICENSE file in the root directory of this source tree.
10
- */
11
-
12
-
13
- const __iconNode$1 = [
14
- ["path", { d: "m18 16 4-4-4-4", key: "1inbqp" }],
15
- ["path", { d: "m6 8-4 4 4 4", key: "15zrgr" }],
16
- ["path", { d: "m14.5 4-5 16", key: "e7oirm" }]
17
- ];
18
- const CodeXml = createLucideIcon("code-xml", __iconNode$1);
19
-
20
- /**
21
- * @license lucide-react v0.511.0 - ISC
22
- *
23
- * This source code is licensed under the ISC license.
24
- * See the LICENSE file in the root directory of this source tree.
25
- */
26
-
27
-
28
- const __iconNode = [
29
- ["path", { d: "M15 12h-5", key: "r7krc0" }],
30
- ["path", { d: "M15 8h-5", key: "1khuty" }],
31
- ["path", { d: "M19 17V5a2 2 0 0 0-2-2H4", key: "zz82l3" }],
32
- [
33
- "path",
34
- {
35
- d: "M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",
36
- key: "1ph1d7"
37
- }
38
- ]
39
- ];
40
- const ScrollText = createLucideIcon("scroll-text", __iconNode);
41
-
42
- function getProjectIdFromContext(context) {
43
- const projectId = context.customData?.projectId;
44
- return typeof projectId === "string" ? projectId : null;
45
- }
46
- function ensureExtension(fileName, ext) {
47
- const trimmed = fileName.trim();
48
- if (!trimmed) return trimmed;
49
- if (trimmed.includes(".")) return trimmed;
50
- return `${trimmed}${ext}`;
51
- }
52
- function buildNotebookSeedFile(name) {
53
- const finalName = ensureExtension(name, ".md");
54
- const title = finalName.replace(/\.md$/i, "");
55
- const content = `# ${title}
56
-
57
- `;
58
- return new File([content], finalName, { type: "text/markdown" });
59
- }
60
- function buildSeedName(prefix) {
61
- const stamp = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
62
- const suffix = Math.random().toString(36).slice(2, 6);
63
- return `${prefix}-${stamp}-${suffix}`;
64
- }
65
- const workspaceTools = [
66
- {
67
- id: BUILTIN_PLUGINS.SEARCH,
68
- title: "Search",
69
- description: "Find files by name or path.",
70
- icon: Search,
71
- badge: "tool",
72
- requiresProject: true
73
- },
74
- {
75
- id: "@ds/plugin-analysis",
76
- title: "Analysis",
77
- description: "Reusable prompts and analysis recipes.",
78
- icon: Sparkles,
79
- badge: "tool",
80
- requiresProject: true
81
- },
82
- {
83
- id: BUILTIN_PLUGINS.CLI,
84
- title: "CLI",
85
- description: "Remote CLI sessions and agent tooling.",
86
- icon: Terminal,
87
- badge: "tool",
88
- requiresProject: true
89
- },
90
- {
91
- id: BUILTIN_PLUGINS.SETTINGS,
92
- title: "Settings",
93
- description: "Quest-focused settings and workspace preferences.",
94
- icon: Settings,
95
- badge: "system"
96
- },
97
- {
98
- id: "@ds/plugin-marketplace",
99
- title: "Plugin Marketplace",
100
- description: "Browse and organize installed plugins.",
101
- icon: Puzzle,
102
- badge: "system"
103
- }
104
- ];
105
- const authoringTools = [
106
- {
107
- id: BUILTIN_PLUGINS.NOTEBOOK,
108
- title: "Notebook",
109
- description: "Create a new markdown notebook file.",
110
- icon: BookOpen,
111
- badge: "authoring",
112
- requiresProject: true,
113
- openLabel: "New"
114
- },
115
- {
116
- id: BUILTIN_PLUGINS.LATEX,
117
- title: "LaTeX",
118
- description: "Create a new LaTeX project folder.",
119
- icon: Sigma,
120
- badge: "authoring",
121
- requiresProject: true,
122
- openLabel: "New"
123
- }
124
- ];
125
- const pdfTools = [
126
- {
127
- id: BUILTIN_PLUGINS.PDF_VIEWER,
128
- title: "PDF Viewer",
129
- description: "View and annotate PDFs with highlights.",
130
- icon: FileText,
131
- badge: "pdf",
132
- openMode: "disabled",
133
- openLabel: "Auto",
134
- disabledReason: "Opens when you select a PDF file."
135
- },
136
- {
137
- id: BUILTIN_PLUGINS.PDF_MARKDOWN,
138
- title: "PDF Markdown",
139
- description: "Read MinerU Markdown output from PDFs.",
140
- icon: FileCode2,
141
- badge: "pdf",
142
- openMode: "disabled",
143
- openLabel: "Auto",
144
- disabledReason: "Opens after selecting a PDF and switching to Markdown view."
145
- }
146
- ];
147
- const fileViewers = [
148
- {
149
- id: BUILTIN_PLUGINS.CODE_EDITOR,
150
- title: "Code Editor",
151
- description: "Monaco editor with autosave.",
152
- icon: CodeXml,
153
- badge: "viewer",
154
- openMode: "disabled",
155
- openLabel: "Auto",
156
- disabledReason: "Opens when you select a code file."
157
- },
158
- {
159
- id: BUILTIN_PLUGINS.CODE_VIEWER,
160
- title: "Code Viewer",
161
- description: "Read-only viewer with syntax highlighting.",
162
- icon: CodeXml,
163
- badge: "viewer",
164
- openMode: "disabled",
165
- openLabel: "Auto",
166
- disabledReason: "Opens when you select a supported code file."
167
- },
168
- {
169
- id: BUILTIN_PLUGINS.MARKDOWN_VIEWER,
170
- title: "Markdown Viewer",
171
- description: "Render Markdown with GFM + math.",
172
- icon: ScrollText,
173
- badge: "viewer",
174
- openMode: "disabled",
175
- openLabel: "Auto",
176
- disabledReason: "Opens when you select a Markdown file."
177
- },
178
- {
179
- id: BUILTIN_PLUGINS.TEXT_VIEWER,
180
- title: "Text Viewer",
181
- description: "Plain text viewer with search tools.",
182
- icon: FileText,
183
- badge: "viewer",
184
- openMode: "disabled",
185
- openLabel: "Auto",
186
- disabledReason: "Opens when you select a text file."
187
- },
188
- {
189
- id: BUILTIN_PLUGINS.IMAGE_VIEWER,
190
- title: "Image Viewer",
191
- description: "Zoom, pan, and inspect images.",
192
- icon: Image,
193
- badge: "viewer",
194
- openMode: "disabled",
195
- openLabel: "Auto",
196
- disabledReason: "Opens when you select an image file."
197
- },
198
- {
199
- id: "@ds/plugin-doc-viewer",
200
- title: "Document Viewer",
201
- description: "Preview Word, Excel, and PowerPoint files.",
202
- icon: FileText,
203
- badge: "viewer",
204
- openMode: "disabled",
205
- openLabel: "Auto",
206
- disabledReason: "Opens when you select a document file."
207
- }
208
- ];
209
- const integrations = [
210
- {
211
- id: "panel:arxiv",
212
- title: "ArXiv Import",
213
- description: "Import papers from arXiv into your workspace.",
214
- icon: BookOpen,
215
- badge: "integration",
216
- openMode: "disabled",
217
- openLabel: "Use sidebar",
218
- disabledReason: "Use the ArXiv panel in the left sidebar."
219
- }
220
- ];
221
- const pluginSections = [
222
- {
223
- id: "workspace-tools",
224
- title: "Workspace tools",
225
- subtitle: "Openable as tabs",
226
- plugins: workspaceTools
227
- },
228
- {
229
- id: "authoring",
230
- title: "Authoring",
231
- subtitle: "Notes and documents",
232
- plugins: authoringTools
233
- },
234
- {
235
- id: "pdf-tools",
236
- title: "PDF workflow",
237
- subtitle: "View, extract, and publish",
238
- plugins: pdfTools
239
- },
240
- {
241
- id: "file-viewers",
242
- title: "Viewers & editors",
243
- subtitle: "Auto-picked based on file type",
244
- plugins: fileViewers
245
- },
246
- {
247
- id: "integrations",
248
- title: "Integrations",
249
- subtitle: "External sources",
250
- plugins: integrations
251
- }
252
- ];
253
- function MarketplacePlugin({ context, setTitle }) {
254
- reactExports.useEffect(() => setTitle("Plugin Marketplace"), [setTitle]);
255
- const navigate = useNavigate();
256
- const openTab = useTabsStore((s) => s.openTab);
257
- const { openFileInTab } = useOpenFile();
258
- const storeProjectId = useFileTreeStore((s) => s.projectId);
259
- const loadFiles = useFileTreeStore((s) => s.loadFiles);
260
- const upload = useFileTreeStore((s) => s.upload);
261
- const createLatexProject = useFileTreeStore((s) => s.createLatexProject);
262
- const highlightFile = useFileTreeStore((s) => s.highlightFile);
263
- const projectId = getProjectIdFromContext(context);
264
- const ensureProjectReady = reactExports.useCallback(async () => {
265
- if (!projectId) return false;
266
- if (storeProjectId !== projectId) {
267
- await loadFiles(projectId);
268
- }
269
- return true;
270
- }, [loadFiles, projectId, storeProjectId]);
271
- const handleOpen = reactExports.useCallback(
272
- async (card) => {
273
- if (card.openMode === "disabled") return;
274
- if (card.requiresProject && !projectId) return;
275
- if (card.id === BUILTIN_PLUGINS.SETTINGS) {
276
- navigate("/settings");
277
- return;
278
- }
279
- if (card.id === BUILTIN_PLUGINS.NOTEBOOK) {
280
- try {
281
- const ready = await ensureProjectReady();
282
- if (!ready || !projectId) return;
283
- const fileName = buildSeedName("Notebook");
284
- const file = buildNotebookSeedFile(fileName);
285
- const created = await upload(null, [file]);
286
- const createdFile = created.find((node) => node.type === "file") || created[0];
287
- if (createdFile) {
288
- highlightFile(createdFile.id);
289
- await openFileInTab(createdFile, { customData: { projectId } });
290
- }
291
- } catch (error) {
292
- console.error("[MarketplacePlugin] Failed to create notebook file:", error);
293
- }
294
- return;
295
- }
296
- if (card.id === BUILTIN_PLUGINS.LATEX) {
297
- try {
298
- const ready = await ensureProjectReady();
299
- if (!ready || !projectId) return;
300
- const folderName = buildSeedName("LaTeX");
301
- const folder = await createLatexProject(null, folderName);
302
- highlightFile(folder.id);
303
- openTab({
304
- pluginId: card.id,
305
- context: {
306
- type: "custom",
307
- resourceId: folder.id,
308
- resourceName: folder.name,
309
- customData: {
310
- projectId,
311
- latexFolderId: folder.id,
312
- mainFileId: folder.latex?.mainFileId ?? null
313
- }
314
- },
315
- title: folder.name
316
- });
317
- } catch (error) {
318
- console.error("[MarketplacePlugin] Failed to create LaTeX project:", error);
319
- }
320
- return;
321
- }
322
- const contextData = {
323
- type: card.contextType ?? "custom",
324
- resourceName: card.resourceName ?? card.title,
325
- resourcePath: card.resourcePath,
326
- mimeType: card.mimeType,
327
- customData: projectId ? { projectId, ...card.customData ?? {} } : card.customData
328
- };
329
- openTab({
330
- pluginId: card.id,
331
- context: contextData,
332
- title: card.tabTitle ?? card.resourceName ?? card.title
333
- });
334
- },
335
- [
336
- createLatexProject,
337
- ensureProjectReady,
338
- highlightFile,
339
- openFileInTab,
340
- openTab,
341
- projectId,
342
- upload,
343
- navigate
344
- ]
345
- );
346
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-full", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-5xl", children: [
347
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start justify-between gap-4", children: [
348
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
349
- /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "text-2xl font-semibold tracking-tight text-foreground", children: "Plugin Marketplace" }),
350
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: "Browse built-in plugins and jump straight in. File-based viewers open automatically when you select a file." })
351
- ] }),
352
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "hidden sm:flex items-center gap-2 text-xs text-muted-foreground", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "px-2 py-1 rounded-full border border-border bg-muted/30", children: "Built-in" }) })
353
- ] }),
354
- pluginSections.map((section) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-8", children: [
355
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between", children: [
356
- /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-sm font-semibold text-foreground", children: section.title }),
357
- section.subtitle ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-muted-foreground", children: section.subtitle }) : null
358
- ] }),
359
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-3 grid grid-cols-1 md:grid-cols-2 gap-4", children: section.plugins.map((plugin) => {
360
- const Icon = plugin.icon;
361
- const isCurrent = plugin.id === "@ds/plugin-marketplace";
362
- const missingProject = plugin.requiresProject && !projectId;
363
- const showButton = plugin.openMode !== "disabled" || missingProject;
364
- const isDisabled = isCurrent || missingProject;
365
- const buttonLabel = isCurrent ? "You're here" : missingProject ? "Requires project" : plugin.openLabel ?? "Open";
366
- const helperText = missingProject ? "Open a project to use this plugin." : plugin.disabledReason;
367
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(
368
- "div",
369
- {
370
- className: cn(
371
- "rounded-2xl border border-border bg-card/90 backdrop-blur p-5",
372
- "shadow-sm hover:shadow-md transition-shadow"
373
- ),
374
- children: [
375
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start justify-between gap-4", children: [
376
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-3 min-w-0", children: [
377
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "inline-flex h-10 w-10 items-center justify-center rounded-xl bg-muted text-foreground", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { className: "h-5 w-5" }) }),
378
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-w-0", children: [
379
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm font-semibold text-foreground", children: plugin.title }),
380
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-0.5 text-xs text-muted-foreground", children: plugin.description }),
381
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 text-[11px] font-mono text-muted-foreground truncate", children: plugin.id })
382
- ] })
383
- ] }),
384
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "shrink-0 px-2 py-1 rounded-full border border-border bg-muted/30 text-[10px] text-muted-foreground", children: plugin.badge ?? "built-in" })
385
- ] }),
386
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-4", children: [
387
- showButton ? /* @__PURE__ */ jsxRuntimeExports.jsx(
388
- "button",
389
- {
390
- type: "button",
391
- onClick: () => void handleOpen(plugin),
392
- disabled: isDisabled,
393
- className: cn(
394
- "inline-flex items-center justify-center px-3 py-1.5 rounded-xl text-sm",
395
- "border border-border bg-background hover:bg-accent/40 transition-colors text-foreground",
396
- isDisabled && "opacity-50 cursor-not-allowed"
397
- ),
398
- children: buttonLabel
399
- }
400
- ) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "inline-flex items-center px-3 py-1.5 rounded-xl text-xs border border-border bg-muted/30 text-muted-foreground", children: plugin.openLabel ?? "Auto" }),
401
- helperText ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 text-[11px] text-muted-foreground", children: helperText }) : null
402
- ] })
403
- ]
404
- },
405
- plugin.id
406
- );
407
- }) })
408
- ] }, section.id)),
409
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-8 text-xs text-muted-foreground", children: "Want external plugins? That's next: sandboxing, permissions, and a loader that can fetch + verify bundles." })
410
- ] }) });
411
- }
412
-
413
- export { MarketplacePlugin as default };