@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
@@ -1,15 +1,14 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BlplpvE1.js","assets/index-DO43pFZP.js","assets/index-Bq2bvfkl.css","assets/useCliAccess-DV2L2Qxy.js","assets/VNCViewer-DG8b0q2X.js","assets/file-content-IRQ3jHb8.js","assets/file-utils-CltILB3w.js","assets/file-jump-queue-r5XKgJEV.js","assets/pdf-effect-queue-DSw_D3RV.js","assets/file-diff-panel-DZoQ9I6r.js","assets/user-plus-BusDx-hF.js","assets/message-square-mUHn_Ssb.js","assets/NotebookEditor-CKjKH-yS.js","assets/NotebookEditor-C3VQ7ylN.css","assets/tooltip-DN_yjHFH.js","assets/info-CcsK_htA.js"])))=>i.map(i=>d[i]);
2
- import { o as createLucideIcon, r as reactExports, bU as useIsomorphicLayoutEffect, bQ as frame, df as LayoutGroupContext, j as jsxRuntimeExports, bX as useConstant, y as apiClient, dg as isQuestRuntimeSurface, dh as shouldUseQuestProject, di as getApiBaseUrl, dj as deriveMcpIdentity, dk as supportsProductApis, cs as axios, dl as getCachedValue, dm as setCachedValue, a5 as getShareSessionToken, dn as recordRequestEvent, dp as redactSensitive, dq as sanitizeUrl, dr as refreshAccessToken, aQ as useChatSessionStore, ds as getShareSessionMeta, dt as getActiveShareProjectId, cb as getMyToken, du as clearShareSession, dv as redirectToLanding, K as create$1, aC as useLabCopilotStore, b_ as useCliStore, dw as EXPLORER_REFRESH_EVENT, v as useTabsStore, cw as buildCliFileId, dx as getCliFileName, cx as toCliResourcePath, ct as getPluginIdFromExtension, z as BUILTIN_PLUGINS, b as cn, dy as GripVertical, w as useToast, q as useAuthStore, bt as listProjectMembers, dz as getProject, c as copyToClipboard, c8 as Pencil, E as Eye, dA as updateProject, b9 as Dialog, ba as DialogContent, bc as DialogTitle, bI as DialogDescription, a6 as Button, ab as Settings, dB as AnimatedCheckbox, $ as Link2, bJ as Input, e as Copy, f as useFileTreeStore, U as toFilesResourcePath, cu as getPluginIdFromMimeType, T as TriangleAlert, dC as resolveMcpIdentity, dD as getToolArgsRecord, dE as getToolResultRecord, dF as getToolResultValue, dG as asString$2, dH as asRecord$4, dI as asStringArray, dJ as extractPathEntries, dK as Clock3, dL as truncateText, dM as ArrowUpRight, l as Search, dN as Database, dO as ArrowRightLeft, H as Sparkles, k as FileText, dP as GitBranch, dQ as asBoolean, dR as Bot, dS as BASH_CARRIAGE_RETURN_PREFIX, ai as useQuery, bq as CircleHelp, dT as Activity, dU as Clock, dV as truncateText$1, dW as listLabPendingQuestions, dX as listLabQuestionHistory, ad as BookOpen, ah as ExternalLink, u as useI18n, dY as normalizeWebSearchPayload, dZ as WebSearchQueryPills, d_ as WebSearchResults, J as EnhancedTerminal, h as dynamic, _ as __vitePreload, d$ as BashToolView, aa as Terminal, e0 as getMimeTypeFromExtension, e1 as getFileTextPreview, e2 as createFileObjectUrl, bE as ChevronLeft, c0 as Folder, m as ChevronUp, n as ChevronDown, X as X$1, L as LoaderCircle, aL as FileIcon, e3 as formatFileSize, bH as ChevronRight, e4 as Send, e5 as ConfirmModal, e6 as RotatingText, d as Check, aN as useReducedMotion, e7 as useTokenStream, e8 as McpBashExecView, e9 as PngIcon, ea as Brain, eb as BRAND_LOGO_SMALL_SRC, ec as BRAND_LOGO_SMALL_SRC_INVERTED, ed as CircleX, aX as motion, bk as DropdownMenu, bl as DropdownMenuTrigger, bm as DropdownMenuContent, bo as DropdownMenuItem, c7 as DropdownMenuSeparator, b$ as GlareHover, c6 as SpotlightCard, cL as Noise, b3 as Plus, a0 as Play, ee as getWorkspaceContentTone, aW as AnimatePresence, a9 as useOpenFile, a as useWorkspaceSurfaceStore, ef as useSearchParams, eg as useAgentRegistryStore, bg as isShareViewForProject, eh as PanelLeft, ei as parseCliFileId, bs as getFile, cf as refreshCliServerStatus, ej as COPILOT_FILES_ENABLED, Z as listLatexBuilds, a4 as getLatexBuildLogText, Y as compileLatex, ek as ThinkingIndicator, b4 as Select, b5 as SelectTrigger, b7 as SelectContent, b8 as SelectItem, el as assetUrl, em as VariableSizeList, en as OrbitLogoStatus, aM as reactDomExports, eo as ChatScrollProvider, bb as DialogHeader, bd as DialogFooter } from './index-DO43pFZP.js';
3
- import { u as useFileContentStore } from './file-content-IRQ3jHb8.js';
4
- import { n as normalizePath$1, j as joinPath, s as splitPath, S as Server, L as Layers } from './file-utils-CltILB3w.js';
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BaVumsQT.js","assets/index-DmwmJmbW.js","assets/index-KGt-z-dD.css","assets/useCliAccess-mXVCYSZ-.js","assets/VNCViewer-CclFC7FM.js","assets/file-content-BAJSu-9r.js","assets/file-utils-2J21jt7M.js","assets/file-jump-queue-r5XKgJEV.js","assets/pdf-effect-queue-DSw_D3RV.js","assets/file-diff-panel-DUGeCTuy.js","assets/message-square-CQRfX0Am.js","assets/NotebookEditor-Dc61cXmK.js","assets/NotebookEditor-C3VQ7ylN.css","assets/tooltip-B6YrI4aJ.js","assets/trash-Bc8jGp0V.js"])))=>i.map(i=>d[i]);
2
+ import { z as createLucideIcon, r as reactExports, co as useIsomorphicLayoutEffect, ck as frame, d8 as LayoutGroupContext, j as jsxRuntimeExports, cr as useConstant, x as apiClient, bD as isQuestRuntimeSurface, d9 as shouldUseQuestProject, bE as getApiBaseUrl, da as deriveMcpIdentity, db as supportsProductApis, cW as axios, dc as getCachedValue, dd as setCachedValue, de as recordRequestEvent, df as redactSensitive, dg as sanitizeUrl, dh as refreshAccessToken, aO as useChatSessionStore, cG as getMyToken, bF as redirectToLanding, I as create$1, aA as useLabCopilotStore, bG as useCliStore, di as EXPLORER_REFRESH_EVENT, t as useTabsStore, c_ as buildCliFileId, dj as getCliFileName, c$ as toCliResourcePath, cX as getPluginIdFromExtension, y as BUILTIN_PLUGINS, b as cn, dk as GripVertical, f as useFileTreeStore, P as toFilesResourcePath, cY as getPluginIdFromMimeType, T as TriangleAlert, dl as resolveMcpIdentity, dm as getToolArgsRecord, dn as getToolResultRecord, dp as getToolResultValue, dq as asString$2, dr as asRecord$4, ds as asStringArray, dt as extractPathEntries, du as Clock3, dv as truncateText, dw as ArrowUpRight, l as Search, dx as Database, dy as ArrowRightLeft, D as Sparkles, k as FileText, bw as GitBranch, dz as asBoolean, bx as Bot, dA as BASH_CARRIAGE_RETURN_PREFIX, af as useQuery, bp as CircleHelp, dB as Activity, br as Clock, dC as truncateText$1, dD as listLabPendingQuestions, dE as listLabQuestionHistory, aa as BookOpen, ae as ExternalLink, u as useI18n, dF as normalizeWebSearchPayload, dG as WebSearchQueryPills, dH as WebSearchResults, H as EnhancedTerminal, h as dynamic, _ as __vitePreload, dI as BashToolView, a7 as Terminal, v as useToast, dJ as getMimeTypeFromExtension, dK as getFileTextPreview, dL as createFileObjectUrl, c as copyToClipboard, c2 as ChevronLeft, cv as Folder, m as ChevronUp, n as ChevronDown, X as X$1, L as LoaderCircle, aJ as FileIcon, dM as formatFileSize, E as Eye, e as Copy, b8 as Dialog, b9 as DialogContent, c5 as ChevronRight, dN as Send, dO as ConfirmModal, dP as RotatingText, d as Check, aL as useReducedMotion, dQ as useTokenStream, dR as McpBashExecView, dS as PngIcon, dT as Brain, dU as BRAND_LOGO_SMALL_SRC, dV as BRAND_LOGO_SMALL_SRC_INVERTED, dW as CircleX, aV as motion, bb as DialogTitle, c6 as DialogDescription, bO as DropdownMenu, bP as DropdownMenuTrigger, b1 as Ellipsis, bQ as DropdownMenuContent, bS as DropdownMenuItem, cC as DropdownMenuSeparator, cu as GlareHover, cB as SpotlightCard, d7 as Noise, b2 as Plus, ai as Info, Z as Play, dX as getWorkspaceContentTone, aU as AnimatePresence, a6 as useOpenFile, a as useWorkspaceSurfaceStore, p as useAuthStore, dY as useSearchParams, dZ as useAgentRegistryStore, d_ as PanelLeft, d$ as parseCliFileId, bV as getFile, bK as getProject, cJ as refreshCliServerStatus, e0 as COPILOT_FILES_ENABLED, W as listLatexBuilds, a2 as getLatexBuildLogText, V as compileLatex, e1 as ThinkingIndicator, b3 as Select, b4 as SelectTrigger, b6 as SelectContent, b7 as SelectItem, e2 as assetUrl, e3 as VariableSizeList, bq as OrbitLogoStatus, aK as reactDomExports, e4 as ChatScrollProvider, ba as DialogHeader, bc as DialogFooter } from './index-DmwmJmbW.js';
3
+ import { u as useFileContentStore } from './file-content-BAJSu-9r.js';
4
+ import { n as normalizePath$1, j as joinPath, s as splitPath, S as Server, L as Layers } from './file-utils-2J21jt7M.js';
5
5
  import { q as queueFileJumpEffect } from './file-jump-queue-r5XKgJEV.js';
6
6
  import { q as queuePdfEffect } from './pdf-effect-queue-DSw_D3RV.js';
7
- import { F as FileDiffPanel } from './file-diff-panel-DZoQ9I6r.js';
8
- import { U as UserPlus, R as RefreshCcw, E as Ellipsis, T as Trash, A as ArrowDown } from './user-plus-BusDx-hF.js';
9
- import { M as MessageSquare } from './message-square-mUHn_Ssb.js';
10
- import { v as ve$2, d as defaultExtensions, g as getEditorMarkdown, s as setEditorMarkdown, U as U$2, I as I$1 } from './NotebookEditor-CKjKH-yS.js';
11
- import { T as TooltipProvider, a as Tooltip, b as TooltipTrigger, c as TooltipContent } from './tooltip-DN_yjHFH.js';
12
- import { I as Info } from './info-CcsK_htA.js';
7
+ import { F as FileDiffPanel } from './file-diff-panel-DUGeCTuy.js';
8
+ import { M as MessageSquare } from './message-square-CQRfX0Am.js';
9
+ import { v as ve$2, d as defaultExtensions, g as getEditorMarkdown, s as setEditorMarkdown, U as U$2, I as I$1 } from './NotebookEditor-Dc61cXmK.js';
10
+ import { T as TooltipProvider, a as Tooltip, b as TooltipTrigger, c as TooltipContent } from './tooltip-B6YrI4aJ.js';
11
+ import { T as Trash, A as ArrowDown } from './trash-Bc8jGp0V.js';
13
12
 
14
13
  /**
15
14
  * @license lucide-react v0.511.0 - ISC
@@ -19,12 +18,12 @@ import { I as Info } from './info-CcsK_htA.js';
19
18
  */
20
19
 
21
20
 
22
- const __iconNode$i = [
21
+ const __iconNode$k = [
23
22
  ["rect", { width: "20", height: "5", x: "2", y: "3", rx: "1", key: "1wp1u1" }],
24
23
  ["path", { d: "M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8", key: "1s80jp" }],
25
24
  ["path", { d: "M10 12h4", key: "a56b0p" }]
26
25
  ];
27
- const Archive = createLucideIcon("archive", __iconNode$i);
26
+ const Archive = createLucideIcon("archive", __iconNode$k);
28
27
 
29
28
  /**
30
29
  * @license lucide-react v0.511.0 - ISC
@@ -34,7 +33,7 @@ const Archive = createLucideIcon("archive", __iconNode$i);
34
33
  */
35
34
 
36
35
 
37
- const __iconNode$h = [
36
+ const __iconNode$j = [
38
37
  ["path", { d: "M12 7v14", key: "1akyts" }],
39
38
  ["path", { d: "M16 12h2", key: "7q9ll5" }],
40
39
  ["path", { d: "M16 8h2", key: "msurwy" }],
@@ -48,7 +47,7 @@ const __iconNode$h = [
48
47
  ["path", { d: "M6 12h2", key: "32wvfc" }],
49
48
  ["path", { d: "M6 8h2", key: "30oboj" }]
50
49
  ];
51
- const BookOpenText = createLucideIcon("book-open-text", __iconNode$h);
50
+ const BookOpenText = createLucideIcon("book-open-text", __iconNode$j);
52
51
 
53
52
  /**
54
53
  * @license lucide-react v0.511.0 - ISC
@@ -58,11 +57,11 @@ const BookOpenText = createLucideIcon("book-open-text", __iconNode$h);
58
57
  */
59
58
 
60
59
 
61
- const __iconNode$g = [
60
+ const __iconNode$i = [
62
61
  ["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
63
62
  ["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
64
63
  ];
65
- const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$g);
64
+ const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$i);
66
65
 
67
66
  /**
68
67
  * @license lucide-react v0.511.0 - ISC
@@ -72,12 +71,12 @@ const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$g);
72
71
  */
73
72
 
74
73
 
75
- const __iconNode$f = [
74
+ const __iconNode$h = [
76
75
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
77
76
  ["line", { x1: "10", x2: "10", y1: "15", y2: "9", key: "c1nkhi" }],
78
77
  ["line", { x1: "14", x2: "14", y1: "15", y2: "9", key: "h65svq" }]
79
78
  ];
80
- const CirclePause = createLucideIcon("circle-pause", __iconNode$f);
79
+ const CirclePause = createLucideIcon("circle-pause", __iconNode$h);
81
80
 
82
81
  /**
83
82
  * @license lucide-react v0.511.0 - ISC
@@ -87,13 +86,13 @@ const CirclePause = createLucideIcon("circle-pause", __iconNode$f);
87
86
  */
88
87
 
89
88
 
90
- const __iconNode$e = [
89
+ const __iconNode$g = [
91
90
  [
92
91
  "path",
93
92
  { d: "M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3", key: "11bfej" }
94
93
  ]
95
94
  ];
96
- const Command = createLucideIcon("command", __iconNode$e);
95
+ const Command = createLucideIcon("command", __iconNode$g);
97
96
 
98
97
  /**
99
98
  * @license lucide-react v0.511.0 - ISC
@@ -103,7 +102,7 @@ const Command = createLucideIcon("command", __iconNode$e);
103
102
  */
104
103
 
105
104
 
106
- const __iconNode$d = [
105
+ const __iconNode$f = [
107
106
  ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
108
107
  [
109
108
  "path",
@@ -112,7 +111,7 @@ const __iconNode$d = [
112
111
  ["path", { d: "m9 18-1.5-1.5", key: "1j6qii" }],
113
112
  ["circle", { cx: "5", cy: "14", r: "3", key: "ufru5t" }]
114
113
  ];
115
- const FileSearch = createLucideIcon("file-search", __iconNode$d);
114
+ const FileSearch = createLucideIcon("file-search", __iconNode$f);
116
115
 
117
116
  /**
118
117
  * @license lucide-react v0.511.0 - ISC
@@ -122,12 +121,12 @@ const FileSearch = createLucideIcon("file-search", __iconNode$d);
122
121
  */
123
122
 
124
123
 
125
- const __iconNode$c = [
124
+ const __iconNode$e = [
126
125
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }],
127
126
  ["line", { x1: "3", x2: "9", y1: "12", y2: "12", key: "1dyftd" }],
128
127
  ["line", { x1: "15", x2: "21", y1: "12", y2: "12", key: "oup4p8" }]
129
128
  ];
130
- const GitCommitHorizontal = createLucideIcon("git-commit-horizontal", __iconNode$c);
129
+ const GitCommitHorizontal = createLucideIcon("git-commit-horizontal", __iconNode$e);
131
130
 
132
131
  /**
133
132
  * @license lucide-react v0.511.0 - ISC
@@ -137,12 +136,12 @@ const GitCommitHorizontal = createLucideIcon("git-commit-horizontal", __iconNode
137
136
  */
138
137
 
139
138
 
140
- const __iconNode$b = [
139
+ const __iconNode$d = [
141
140
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
142
141
  ["path", { d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20", key: "13o1zl" }],
143
142
  ["path", { d: "M2 12h20", key: "9i4pu4" }]
144
143
  ];
145
- const Globe = createLucideIcon("globe", __iconNode$b);
144
+ const Globe = createLucideIcon("globe", __iconNode$d);
146
145
 
147
146
  /**
148
147
  * @license lucide-react v0.511.0 - ISC
@@ -152,7 +151,7 @@ const Globe = createLucideIcon("globe", __iconNode$b);
152
151
  */
153
152
 
154
153
 
155
- const __iconNode$a = [
154
+ const __iconNode$c = [
156
155
  [
157
156
  "path",
158
157
  {
@@ -163,7 +162,7 @@ const __iconNode$a = [
163
162
  ["path", { d: "M22 10v6", key: "1lu8f3" }],
164
163
  ["path", { d: "M6 12.5V16a6 3 0 0 0 12 0v-3.5", key: "1r8lef" }]
165
164
  ];
166
- const GraduationCap = createLucideIcon("graduation-cap", __iconNode$a);
165
+ const GraduationCap = createLucideIcon("graduation-cap", __iconNode$c);
167
166
 
168
167
  /**
169
168
  * @license lucide-react v0.511.0 - ISC
@@ -173,7 +172,7 @@ const GraduationCap = createLucideIcon("graduation-cap", __iconNode$a);
173
172
  */
174
173
 
175
174
 
176
- const __iconNode$9 = [
175
+ const __iconNode$b = [
177
176
  ["path", { d: "M10 17H7l-4 4v-7", key: "1r71xu" }],
178
177
  ["path", { d: "M14 17h1", key: "nufu4t" }],
179
178
  ["path", { d: "M14 3h1", key: "1ec4yj" }],
@@ -184,7 +183,7 @@ const __iconNode$9 = [
184
183
  ["path", { d: "M5 3a2 2 0 0 0-2 2", key: "y57alp" }],
185
184
  ["path", { d: "M9 3h1", key: "1yesri" }]
186
185
  ];
187
- const MessageSquareDashed = createLucideIcon("message-square-dashed", __iconNode$9);
186
+ const MessageSquareDashed = createLucideIcon("message-square-dashed", __iconNode$b);
188
187
 
189
188
  /**
190
189
  * @license lucide-react v0.511.0 - ISC
@@ -194,7 +193,7 @@ const MessageSquareDashed = createLucideIcon("message-square-dashed", __iconNode
194
193
  */
195
194
 
196
195
 
197
- const __iconNode$8 = [
196
+ const __iconNode$a = [
198
197
  ["path", { d: "M12 13v8", key: "1l5pq0" }],
199
198
  ["path", { d: "M12 3v3", key: "1n5kay" }],
200
199
  [
@@ -205,7 +204,7 @@ const __iconNode$8 = [
205
204
  }
206
205
  ]
207
206
  ];
208
- const Milestone = createLucideIcon("milestone", __iconNode$8);
207
+ const Milestone = createLucideIcon("milestone", __iconNode$a);
209
208
 
210
209
  /**
211
210
  * @license lucide-react v0.511.0 - ISC
@@ -215,13 +214,13 @@ const Milestone = createLucideIcon("milestone", __iconNode$8);
215
214
  */
216
215
 
217
216
 
218
- const __iconNode$7 = [
217
+ const __iconNode$9 = [
219
218
  ["path", { d: "m14 10 7-7", key: "oa77jy" }],
220
219
  ["path", { d: "M20 10h-6V4", key: "mjg0md" }],
221
220
  ["path", { d: "m3 21 7-7", key: "tjx5ai" }],
222
221
  ["path", { d: "M4 14h6v6", key: "rmj7iw" }]
223
222
  ];
224
- const Minimize2 = createLucideIcon("minimize-2", __iconNode$7);
223
+ const Minimize2 = createLucideIcon("minimize-2", __iconNode$9);
225
224
 
226
225
  /**
227
226
  * @license lucide-react v0.511.0 - ISC
@@ -231,7 +230,7 @@ const Minimize2 = createLucideIcon("minimize-2", __iconNode$7);
231
230
  */
232
231
 
233
232
 
234
- const __iconNode$6 = [
233
+ const __iconNode$8 = [
235
234
  ["path", { d: "M13.234 20.252 21 12.3", key: "1cbrk9" }],
236
235
  [
237
236
  "path",
@@ -241,7 +240,7 @@ const __iconNode$6 = [
241
240
  }
242
241
  ]
243
242
  ];
244
- const Paperclip = createLucideIcon("paperclip", __iconNode$6);
243
+ const Paperclip = createLucideIcon("paperclip", __iconNode$8);
245
244
 
246
245
  /**
247
246
  * @license lucide-react v0.511.0 - ISC
@@ -251,7 +250,7 @@ const Paperclip = createLucideIcon("paperclip", __iconNode$6);
251
250
  */
252
251
 
253
252
 
254
- const __iconNode$5 = [
253
+ const __iconNode$7 = [
255
254
  ["path", { d: "M12 20h9", key: "t2du7b" }],
256
255
  [
257
256
  "path",
@@ -262,7 +261,7 @@ const __iconNode$5 = [
262
261
  ],
263
262
  ["path", { d: "m15 5 3 3", key: "1w25hb" }]
264
263
  ];
265
- const PencilLine = createLucideIcon("pencil-line", __iconNode$5);
264
+ const PencilLine = createLucideIcon("pencil-line", __iconNode$7);
266
265
 
267
266
  /**
268
267
  * @license lucide-react v0.511.0 - ISC
@@ -272,7 +271,7 @@ const PencilLine = createLucideIcon("pencil-line", __iconNode$5);
272
271
  */
273
272
 
274
273
 
275
- const __iconNode$4 = [
274
+ const __iconNode$6 = [
276
275
  ["path", { d: "M12 17v5", key: "bb1du9" }],
277
276
  ["path", { d: "M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89", key: "znwnzq" }],
278
277
  ["path", { d: "m2 2 20 20", key: "1ooewy" }],
@@ -284,7 +283,7 @@ const __iconNode$4 = [
284
283
  }
285
284
  ]
286
285
  ];
287
- const PinOff = createLucideIcon("pin-off", __iconNode$4);
286
+ const PinOff = createLucideIcon("pin-off", __iconNode$6);
288
287
 
289
288
  /**
290
289
  * @license lucide-react v0.511.0 - ISC
@@ -294,7 +293,7 @@ const PinOff = createLucideIcon("pin-off", __iconNode$4);
294
293
  */
295
294
 
296
295
 
297
- const __iconNode$3 = [
296
+ const __iconNode$5 = [
298
297
  ["path", { d: "M12 17v5", key: "bb1du9" }],
299
298
  [
300
299
  "path",
@@ -304,7 +303,7 @@ const __iconNode$3 = [
304
303
  }
305
304
  ]
306
305
  ];
307
- const Pin = createLucideIcon("pin", __iconNode$3);
306
+ const Pin = createLucideIcon("pin", __iconNode$5);
308
307
 
309
308
  /**
310
309
  * @license lucide-react v0.511.0 - ISC
@@ -314,13 +313,13 @@ const Pin = createLucideIcon("pin", __iconNode$3);
314
313
  */
315
314
 
316
315
 
317
- const __iconNode$2 = [
316
+ const __iconNode$4 = [
318
317
  ["path", { d: "M12 22v-5", key: "1ega77" }],
319
318
  ["path", { d: "M9 8V2", key: "14iosj" }],
320
319
  ["path", { d: "M15 8V2", key: "18g5xt" }],
321
320
  ["path", { d: "M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z", key: "osxo6l" }]
322
321
  ];
323
- const Plug = createLucideIcon("plug", __iconNode$2);
322
+ const Plug = createLucideIcon("plug", __iconNode$4);
324
323
 
325
324
  /**
326
325
  * @license lucide-react v0.511.0 - ISC
@@ -330,12 +329,28 @@ const Plug = createLucideIcon("plug", __iconNode$2);
330
329
  */
331
330
 
332
331
 
333
- const __iconNode$1 = [
332
+ const __iconNode$3 = [
333
+ ["path", { d: "M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "14sxne" }],
334
+ ["path", { d: "M3 3v5h5", key: "1xhq8a" }],
335
+ ["path", { d: "M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16", key: "1hlbsb" }],
336
+ ["path", { d: "M16 16h5v5", key: "ccwih5" }]
337
+ ];
338
+ const RefreshCcw = createLucideIcon("refresh-ccw", __iconNode$3);
339
+
340
+ /**
341
+ * @license lucide-react v0.511.0 - ISC
342
+ *
343
+ * This source code is licensed under the ISC license.
344
+ * See the LICENSE file in the root directory of this source tree.
345
+ */
346
+
347
+
348
+ const __iconNode$2 = [
334
349
  ["circle", { cx: "6", cy: "19", r: "3", key: "1kj8tv" }],
335
350
  ["path", { d: "M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15", key: "1d8sl" }],
336
351
  ["circle", { cx: "18", cy: "5", r: "3", key: "gq8acd" }]
337
352
  ];
338
- const Route = createLucideIcon("route", __iconNode$1);
353
+ const Route = createLucideIcon("route", __iconNode$2);
339
354
 
340
355
  /**
341
356
  * @license lucide-react v0.511.0 - ISC
@@ -345,14 +360,30 @@ const Route = createLucideIcon("route", __iconNode$1);
345
360
  */
346
361
 
347
362
 
348
- const __iconNode = [
363
+ const __iconNode$1 = [
349
364
  ["circle", { cx: "18", cy: "5", r: "3", key: "gq8acd" }],
350
365
  ["circle", { cx: "6", cy: "12", r: "3", key: "w7nqdw" }],
351
366
  ["circle", { cx: "18", cy: "19", r: "3", key: "1xt0gg" }],
352
367
  ["line", { x1: "8.59", x2: "15.42", y1: "13.51", y2: "17.49", key: "47mynk" }],
353
368
  ["line", { x1: "15.41", x2: "8.59", y1: "6.51", y2: "10.49", key: "1n3mei" }]
354
369
  ];
355
- const Share2 = createLucideIcon("share-2", __iconNode);
370
+ const Share2 = createLucideIcon("share-2", __iconNode$1);
371
+
372
+ /**
373
+ * @license lucide-react v0.511.0 - ISC
374
+ *
375
+ * This source code is licensed under the ISC license.
376
+ * See the LICENSE file in the root directory of this source tree.
377
+ */
378
+
379
+
380
+ const __iconNode = [
381
+ ["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
382
+ ["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
383
+ ["line", { x1: "19", x2: "19", y1: "8", y2: "14", key: "1bvyxn" }],
384
+ ["line", { x1: "22", x2: "16", y1: "11", y2: "11", key: "1shjgl" }]
385
+ ];
386
+ const UserPlus = createLucideIcon("user-plus", __iconNode);
356
387
 
357
388
  const notify = (node) => !node.isLayoutDirty && node.willUpdate(false);
358
389
  function nodeGroup() {
@@ -1357,8 +1388,7 @@ async function getVncUrl(sessionId, expireMinutes = 15) {
1357
1388
  throw error;
1358
1389
  }
1359
1390
  const userToken = window.localStorage.getItem("ds_access_token");
1360
- const shareToken = getShareSessionToken();
1361
- const token = userToken || shareToken;
1391
+ const token = userToken || null;
1362
1392
  const query = token ? `?token=${encodeURIComponent(token)}` : "";
1363
1393
  return `${baseUrl}/api/v1/sessions/${sessionId}/vnc${query}`;
1364
1394
  }
@@ -1438,53 +1468,16 @@ const buildAuthContext = () => {
1438
1468
  let authMode = "none";
1439
1469
  if (typeof window === "undefined") return { headers, authMode };
1440
1470
  const userToken = window.localStorage.getItem("ds_access_token");
1441
- const shareToken = getShareSessionToken();
1442
- const shareMeta = getShareSessionMeta();
1443
- const activeShareProject = getActiveShareProjectId();
1444
- const preferShare = Boolean(
1445
- shareToken && shareMeta?.access === "view" && shareMeta.projectId && activeShareProject && shareMeta.projectId === activeShareProject
1446
- );
1447
- if (preferShare && shareToken) {
1448
- headers.Authorization = `Bearer ${shareToken}`;
1449
- headers["X-Share-Token"] = shareToken;
1450
- authMode = "share";
1451
- return { headers, authMode };
1452
- }
1453
1471
  if (userToken) {
1454
1472
  headers.Authorization = `Bearer ${userToken}`;
1455
1473
  authMode = "user";
1456
- return { headers, authMode };
1457
- }
1458
- if (shareToken) {
1459
- headers.Authorization = `Bearer ${shareToken}`;
1460
- headers["X-Share-Token"] = shareToken;
1461
- authMode = "share";
1462
1474
  }
1463
1475
  return { headers, authMode };
1464
1476
  };
1465
- const isShareView = () => {
1466
- if (typeof window === "undefined") return false;
1467
- const shareMeta = getShareSessionMeta();
1468
- const activeShareProject = getActiveShareProjectId();
1469
- return Boolean(
1470
- shareMeta?.access === "view" && shareMeta.projectId && activeShareProject && shareMeta.projectId === activeShareProject
1471
- );
1472
- };
1473
1477
  const handleUnauthorized = (headers) => {
1474
1478
  if (typeof window === "undefined") return;
1475
1479
  const userToken = window.localStorage.getItem("ds_access_token");
1476
- const shareToken = getShareSessionToken();
1477
1480
  const hasUserToken = Boolean(userToken);
1478
- const hasShareSession = Boolean(shareToken);
1479
- const authHeader = typeof headers.Authorization === "string" ? headers.Authorization : null;
1480
- const usedShareSession = Boolean(authHeader && shareToken && authHeader === `Bearer ${shareToken}`);
1481
- if (usedShareSession || !hasUserToken && hasShareSession) {
1482
- clearShareSession();
1483
- if (!window.location.pathname.startsWith("/share")) {
1484
- window.location.href = "/";
1485
- }
1486
- return;
1487
- }
1488
1481
  if (hasUserToken) {
1489
1482
  window.localStorage.removeItem("ds_access_token");
1490
1483
  redirectToLanding("session_expired");
@@ -1718,7 +1711,7 @@ const postChat = async (payload, projectId2, attempt = 0) => {
1718
1711
  return;
1719
1712
  }
1720
1713
  }
1721
- handleUnauthorized(headers);
1714
+ handleUnauthorized();
1722
1715
  return;
1723
1716
  }
1724
1717
  if (!response2.ok) {
@@ -1768,7 +1761,7 @@ const postChat = async (payload, projectId2, attempt = 0) => {
1768
1761
  return;
1769
1762
  }
1770
1763
  }
1771
- handleUnauthorized(headers);
1764
+ handleUnauthorized();
1772
1765
  return;
1773
1766
  }
1774
1767
  if (!response.ok) {
@@ -1794,7 +1787,7 @@ const runStream = async (runtime, payload, runId, attempt = 0) => {
1794
1787
  const message = payload.message ?? "";
1795
1788
  const hasMessage = message.trim().length > 0;
1796
1789
  const hasAttachments = (payload.attachments ?? []).length > 0;
1797
- const streamOnly = isShareView() || !hasMessage && !hasAttachments;
1790
+ const streamOnly = !hasMessage && !hasAttachments;
1798
1791
  if (streamOnly) {
1799
1792
  delete headers["Content-Type"];
1800
1793
  }
@@ -4991,420 +4984,6 @@ const ResizableHandle = ({
4991
4984
  }
4992
4985
  );
4993
4986
 
4994
- async function createProjectShareLink(projectId, data) {
4995
- const response = await apiClient.post(`/api/v1/projects/${projectId}/share-links`, data);
4996
- return response.data;
4997
- }
4998
- async function listProjectShareLinks(projectId) {
4999
- const response = await apiClient.get(`/api/v1/projects/${projectId}/share-links`);
5000
- return response.data.items || [];
5001
- }
5002
- async function updateProjectShareLink(projectId, linkId, data) {
5003
- const response = await apiClient.patch(`/api/v1/projects/${projectId}/share-links/${linkId}`, data);
5004
- return response.data;
5005
- }
5006
-
5007
- function formatIso(iso) {
5008
- if (!iso) return "Never";
5009
- try {
5010
- return new Date(iso).toLocaleString();
5011
- } catch {
5012
- return iso;
5013
- }
5014
- }
5015
- function formatExpiry(link) {
5016
- if (!link) return "—";
5017
- if (!link.expires_at) return "Never";
5018
- return formatIso(link.expires_at);
5019
- }
5020
- function pickLink(links, permission) {
5021
- return links.find((link) => link.permission === permission && link.is_active) || links.find((link) => link.permission === permission) || null;
5022
- }
5023
- function getShareUrl(base, link) {
5024
- if (!base || !link) return "";
5025
- return `${base}${link.token}`;
5026
- }
5027
- function ProjectShareDialog({
5028
- projectId,
5029
- open,
5030
- onOpenChange,
5031
- canManageShare = true
5032
- }) {
5033
- const { addToast } = useToast();
5034
- const { user } = useAuthStore();
5035
- const [shareBaseUrl, setShareBaseUrl] = reactExports.useState("");
5036
- const [links, setLinks] = reactExports.useState([]);
5037
- const [linksLoading, setLinksLoading] = reactExports.useState(false);
5038
- const [linksError, setLinksError] = reactExports.useState("");
5039
- const [linkUpdatingId, setLinkUpdatingId] = reactExports.useState(null);
5040
- const [showSettings, setShowSettings] = reactExports.useState(false);
5041
- const [members, setMembers] = reactExports.useState([]);
5042
- const [membersLoading, setMembersLoading] = reactExports.useState(false);
5043
- const [membersError, setMembersError] = reactExports.useState("");
5044
- const [settingsLoading, setSettingsLoading] = reactExports.useState(false);
5045
- const [settingsSaving, setSettingsSaving] = reactExports.useState(false);
5046
- const [settingsError, setSettingsError] = reactExports.useState("");
5047
- const [projectSettings, setProjectSettings] = reactExports.useState({});
5048
- const [viewLoginRequired, setViewLoginRequired] = reactExports.useState(false);
5049
- reactExports.useEffect(() => {
5050
- if (!open) return;
5051
- if (typeof window === "undefined") return;
5052
- setShareBaseUrl(`${window.location.origin}/share/`);
5053
- }, [open]);
5054
- const syncLinks = reactExports.useCallback(async () => {
5055
- if (!open) return;
5056
- setLinksError("");
5057
- setLinksLoading(true);
5058
- try {
5059
- if (!canManageShare) {
5060
- setLinks([]);
5061
- return;
5062
- }
5063
- let items = await listProjectShareLinks(projectId);
5064
- const ensureLink = async (permission) => {
5065
- const existing = pickLink(items, permission);
5066
- if (!existing) {
5067
- const created = await createProjectShareLink(projectId, {
5068
- permission,
5069
- expires_at: null,
5070
- allow_copy: true
5071
- });
5072
- items = [created, ...items];
5073
- return;
5074
- }
5075
- const updates = {};
5076
- if (!existing.is_active) updates.is_active = true;
5077
- if (existing.expires_at) updates.expires_at = null;
5078
- if (Object.keys(updates).length > 0) {
5079
- const updated = await updateProjectShareLink(projectId, existing.id, updates);
5080
- items = items.map((item) => item.id === updated.id ? updated : item);
5081
- }
5082
- };
5083
- await ensureLink("edit");
5084
- await ensureLink("view");
5085
- setLinks(items);
5086
- } catch (err) {
5087
- const error = err;
5088
- setLinksError(error.response?.data?.detail || error.message || "Failed to load share links");
5089
- setLinks([]);
5090
- } finally {
5091
- setLinksLoading(false);
5092
- }
5093
- }, [canManageShare, open, projectId]);
5094
- reactExports.useEffect(() => {
5095
- if (!open) return;
5096
- setShowSettings(false);
5097
- void syncLinks();
5098
- }, [open, syncLinks]);
5099
- reactExports.useEffect(() => {
5100
- if (!open || !showSettings) return;
5101
- if (!canManageShare) return;
5102
- let cancelled = false;
5103
- setMembersLoading(true);
5104
- setMembersError("");
5105
- listProjectMembers(projectId).then((data) => {
5106
- if (cancelled) return;
5107
- setMembers(data);
5108
- }).catch((err) => {
5109
- if (cancelled) return;
5110
- const error = err;
5111
- setMembersError(error.response?.data?.detail || error.message || "Failed to load members");
5112
- setMembers([]);
5113
- }).finally(() => {
5114
- if (!cancelled) setMembersLoading(false);
5115
- });
5116
- return () => {
5117
- cancelled = true;
5118
- };
5119
- }, [canManageShare, open, projectId, showSettings]);
5120
- reactExports.useEffect(() => {
5121
- if (!open || !canManageShare) return;
5122
- let cancelled = false;
5123
- setSettingsLoading(true);
5124
- setSettingsError("");
5125
- getProject(projectId).then((project) => {
5126
- if (cancelled) return;
5127
- const settings = project.settings || {};
5128
- setProjectSettings(settings);
5129
- setViewLoginRequired(Boolean(settings.share_view_requires_login));
5130
- }).catch((err) => {
5131
- if (cancelled) return;
5132
- const error = err;
5133
- setSettingsError(error.response?.data?.detail || error.message || "Failed to load share settings");
5134
- }).finally(() => {
5135
- if (!cancelled) setSettingsLoading(false);
5136
- });
5137
- return () => {
5138
- cancelled = true;
5139
- };
5140
- }, [canManageShare, open, projectId]);
5141
- const editLink = reactExports.useMemo(() => pickLink(links, "edit"), [links]);
5142
- const viewLink = reactExports.useMemo(() => pickLink(links, "view"), [links]);
5143
- const editUrl = reactExports.useMemo(() => getShareUrl(shareBaseUrl, editLink), [shareBaseUrl, editLink]);
5144
- const viewUrl = reactExports.useMemo(() => getShareUrl(shareBaseUrl, viewLink), [shareBaseUrl, viewLink]);
5145
- const editDescription = reactExports.useMemo(() => {
5146
- if (!editLink) return "Anyone with this link can edit. Copying follows owner settings.";
5147
- return editLink.allow_copy ? "Anyone with this link can edit and copy." : "Anyone with this link can edit. Copying is disabled.";
5148
- }, [editLink]);
5149
- const viewDescription = reactExports.useMemo(() => {
5150
- const base = viewLoginRequired ? "Login required to view." : "Anyone with this link can view.";
5151
- if (!viewLink) return `${base} Copying follows owner settings.`;
5152
- return viewLink.allow_copy ? `${base} Copying is allowed.` : `${base} Copying is disabled.`;
5153
- }, [viewLink, viewLoginRequired]);
5154
- const handleCopy = reactExports.useCallback(
5155
- async (url) => {
5156
- if (!url) return;
5157
- const ok = await copyToClipboard(url);
5158
- if (ok) {
5159
- addToast({ type: "success", title: "Copied", description: "Link copied to clipboard." });
5160
- } else {
5161
- addToast({ type: "error", title: "Copy failed", description: "Please copy manually." });
5162
- }
5163
- },
5164
- [addToast]
5165
- );
5166
- const settingsLinks = reactExports.useMemo(() => {
5167
- return [
5168
- { label: "Editable link", icon: Pencil, link: editLink },
5169
- { label: "View link", icon: Eye, link: viewLink }
5170
- ];
5171
- }, [editLink, viewLink]);
5172
- const handleToggleAllowCopy = reactExports.useCallback(
5173
- async (link, allowCopy) => {
5174
- if (!link) return;
5175
- setLinkUpdatingId(link.id);
5176
- try {
5177
- const updated = await updateProjectShareLink(projectId, link.id, {
5178
- allow_copy: allowCopy
5179
- });
5180
- setLinks((prev) => prev.map((item) => item.id === updated.id ? updated : item));
5181
- } catch (err) {
5182
- const error = err;
5183
- addToast({
5184
- type: "error",
5185
- title: "Update failed",
5186
- description: error.response?.data?.detail || error.message || "Unable to update allow copy."
5187
- });
5188
- } finally {
5189
- setLinkUpdatingId(null);
5190
- }
5191
- },
5192
- [addToast, projectId]
5193
- );
5194
- const handleToggleViewLogin = reactExports.useCallback(
5195
- async (nextValue) => {
5196
- if (settingsSaving) return;
5197
- const previous = viewLoginRequired;
5198
- const previousSettings = projectSettings;
5199
- const nextSettings = { ...projectSettings, share_view_requires_login: nextValue };
5200
- setViewLoginRequired(nextValue);
5201
- setProjectSettings(nextSettings);
5202
- setSettingsSaving(true);
5203
- try {
5204
- await updateProject(projectId, { settings: nextSettings });
5205
- } catch (err) {
5206
- const error = err;
5207
- setViewLoginRequired(previous);
5208
- setProjectSettings(previousSettings);
5209
- addToast({
5210
- type: "error",
5211
- title: "Update failed",
5212
- description: error.response?.data?.detail || error.message || "Unable to update share settings."
5213
- });
5214
- } finally {
5215
- setSettingsSaving(false);
5216
- }
5217
- },
5218
- [addToast, projectId, projectSettings, settingsSaving, viewLoginRequired]
5219
- );
5220
- const visibleMembers = reactExports.useMemo(() => {
5221
- if (!user?.id) return members;
5222
- return members.filter((member) => member.user_id !== user.id);
5223
- }, [members, user?.id]);
5224
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogContent, { className: cn("max-w-3xl p-0 overflow-hidden"), children: [
5225
- /* @__PURE__ */ jsxRuntimeExports.jsx(DialogTitle, { className: "sr-only", children: "Project share" }),
5226
- /* @__PURE__ */ jsxRuntimeExports.jsx(DialogDescription, { className: "sr-only", children: "Share with an editable link or a view-only link." }),
5227
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
5228
- "div",
5229
- {
5230
- className: cn(
5231
- "grid gap-6 p-6",
5232
- showSettings ? "lg:grid-cols-[minmax(0,1fr)_320px]" : "grid-cols-1"
5233
- ),
5234
- children: [
5235
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-5", children: [
5236
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start justify-between gap-3", children: [
5237
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-1", children: [
5238
- /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-xl font-semibold", children: "Share links" }),
5239
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-muted-foreground", children: "Two links are always available: editable and view-only." })
5240
- ] }),
5241
- /* @__PURE__ */ jsxRuntimeExports.jsx(
5242
- Button,
5243
- {
5244
- type: "button",
5245
- variant: "ghost",
5246
- size: "icon",
5247
- onClick: () => setShowSettings((v) => !v),
5248
- className: "rounded-full",
5249
- title: showSettings ? "Hide settings" : "Show settings",
5250
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(Settings, { className: "h-4 w-4" })
5251
- }
5252
- )
5253
- ] }),
5254
- linksError ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "rounded-2xl border border-border/60 bg-muted/30 px-4 py-3 text-sm text-destructive", children: linksError }) : null,
5255
- !canManageShare ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "rounded-2xl border border-border/60 bg-muted/30 px-4 py-3 text-sm text-muted-foreground", children: "Share links are managed by project owners or admins." }) : null,
5256
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
5257
- /* @__PURE__ */ jsxRuntimeExports.jsx(
5258
- ShareLinkCard,
5259
- {
5260
- title: "Editable link",
5261
- description: editDescription,
5262
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(Pencil, { className: "h-4 w-4" }),
5263
- url: editUrl,
5264
- loading: linksLoading,
5265
- onCopy: () => handleCopy(editUrl)
5266
- }
5267
- ),
5268
- /* @__PURE__ */ jsxRuntimeExports.jsx(
5269
- ShareLinkCard,
5270
- {
5271
- title: "View-only link",
5272
- description: viewDescription,
5273
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(Eye, { className: "h-4 w-4" }),
5274
- url: viewUrl,
5275
- loading: linksLoading,
5276
- onCopy: () => handleCopy(viewUrl)
5277
- }
5278
- )
5279
- ] })
5280
- ] }),
5281
- showSettings ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "rounded-2xl border border-border/60 bg-muted/20 p-4 space-y-5", children: [
5282
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
5283
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm font-semibold", children: "Link settings" }),
5284
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-muted-foreground", children: "Copy and login requirements can be adjusted per link." })
5285
- ] }),
5286
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
5287
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "rounded-xl border border-border/50 bg-background/80 p-3", children: [
5288
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs font-medium", children: "View access" }),
5289
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-2 flex items-center justify-between text-xs text-muted-foreground", children: [
5290
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Require login to view" }),
5291
- /* @__PURE__ */ jsxRuntimeExports.jsx(
5292
- AnimatedCheckbox,
5293
- {
5294
- checked: viewLoginRequired,
5295
- onChange: handleToggleViewLogin,
5296
- disabled: !canManageShare || settingsLoading || settingsSaving,
5297
- size: "sm"
5298
- }
5299
- )
5300
- ] }),
5301
- settingsError ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 text-[11px] text-destructive", children: settingsError }) : null
5302
- ] }),
5303
- settingsLinks.map(({ label, icon: Icon, link }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "rounded-xl border border-border/50 bg-background/80 p-3", children: [
5304
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 text-sm font-medium", children: [
5305
- /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { className: "h-4 w-4 text-muted-foreground" }),
5306
- label
5307
- ] }),
5308
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-2 space-y-1 text-xs text-muted-foreground", children: [
5309
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
5310
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Allow copy" }),
5311
- /* @__PURE__ */ jsxRuntimeExports.jsx(
5312
- AnimatedCheckbox,
5313
- {
5314
- checked: Boolean(link?.allow_copy),
5315
- onChange: (checked) => handleToggleAllowCopy(link, checked),
5316
- disabled: !link || linksLoading || linkUpdatingId === link.id || !canManageShare,
5317
- size: "sm"
5318
- }
5319
- )
5320
- ] }),
5321
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
5322
- "Expires: ",
5323
- formatExpiry(link)
5324
- ] }),
5325
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
5326
- "Status: ",
5327
- link ? link.is_active ? "Active" : "Inactive" : "—"
5328
- ] }),
5329
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
5330
- "Views: ",
5331
- link?.access_count ?? 0
5332
- ] }),
5333
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
5334
- "Last access: ",
5335
- link?.last_accessed_at ? formatIso(link.last_accessed_at) : "—"
5336
- ] })
5337
- ] })
5338
- ] }, label))
5339
- ] }),
5340
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
5341
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm font-semibold", children: "Project members" }),
5342
- membersLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-muted-foreground", children: "Loading members…" }) : membersError ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-destructive", children: membersError }) : visibleMembers.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-muted-foreground", children: "No additional members found." }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-2", children: visibleMembers.slice(0, 6).map((member) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
5343
- "div",
5344
- {
5345
- className: "flex items-center justify-between rounded-lg border border-border/50 bg-background/80 px-3 py-2 text-xs",
5346
- children: [
5347
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-w-0", children: [
5348
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "truncate font-medium text-foreground", children: member.user?.username || member.user?.email || member.user_id }),
5349
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-muted-foreground truncate", children: member.user?.email || "—" })
5350
- ] }),
5351
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "rounded-full border border-border/60 px-2 py-0.5 text-[10px] uppercase text-muted-foreground", children: member.role })
5352
- ]
5353
- },
5354
- member.id
5355
- )) })
5356
- ] })
5357
- ] }) : null
5358
- ]
5359
- }
5360
- )
5361
- ] }) });
5362
- }
5363
- function ShareLinkCard({
5364
- title,
5365
- description,
5366
- icon,
5367
- url,
5368
- loading,
5369
- onCopy
5370
- }) {
5371
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "rounded-2xl border border-border/60 bg-muted/20 p-4", children: [
5372
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 text-sm font-semibold", children: [
5373
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex h-7 w-7 items-center justify-center rounded-full border border-border/60 bg-background/80", children: icon }),
5374
- title
5375
- ] }),
5376
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1 text-xs text-muted-foreground", children: description }),
5377
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-3 flex flex-col gap-2 sm:flex-row", children: [
5378
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative flex-1", children: [
5379
- /* @__PURE__ */ jsxRuntimeExports.jsx(Link2, { className: "pointer-events-none absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
5380
- /* @__PURE__ */ jsxRuntimeExports.jsx(
5381
- Input,
5382
- {
5383
- value: loading ? "Generating link…" : url,
5384
- readOnly: true,
5385
- className: "pl-9 text-xs",
5386
- disabled: loading
5387
- }
5388
- )
5389
- ] }),
5390
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
5391
- Button,
5392
- {
5393
- type: "button",
5394
- variant: "outline",
5395
- className: "h-9",
5396
- onClick: onCopy,
5397
- disabled: loading || !url,
5398
- children: [
5399
- /* @__PURE__ */ jsxRuntimeExports.jsx(Copy, { className: "mr-2 h-4 w-4" }),
5400
- "Copy"
5401
- ]
5402
- }
5403
- )
5404
- ] })
5405
- ] });
5406
- }
5407
-
5408
4987
  const normalizeTextValue = (value) => typeof value === "string" ? value.trim() : "";
5409
4988
  const mergeSessionItem = (existing, incoming) => {
5410
4989
  const incomingTitle = normalizeTextValue(incoming.title);
@@ -5457,47 +5036,16 @@ function useSessionList(options) {
5457
5036
  let authMode = "none";
5458
5037
  if (typeof window === "undefined") return { headers, authMode };
5459
5038
  const userToken = window.localStorage.getItem("ds_access_token");
5460
- const shareToken = getShareSessionToken();
5461
- const shareMeta = getShareSessionMeta();
5462
- const activeShareProject = getActiveShareProjectId();
5463
- const preferShare = Boolean(
5464
- shareToken && shareMeta?.access === "view" && shareMeta.projectId && activeShareProject && shareMeta.projectId === activeShareProject
5465
- );
5466
- if (preferShare && shareToken) {
5467
- headers.Authorization = `Bearer ${shareToken}`;
5468
- headers["X-Share-Token"] = shareToken;
5469
- authMode = "share";
5470
- return { headers, authMode };
5471
- }
5472
5039
  if (userToken) {
5473
5040
  headers.Authorization = `Bearer ${userToken}`;
5474
5041
  authMode = "user";
5475
- return { headers, authMode };
5476
- }
5477
- if (shareToken) {
5478
- headers.Authorization = `Bearer ${shareToken}`;
5479
- headers["X-Share-Token"] = shareToken;
5480
- authMode = "share";
5481
5042
  }
5482
5043
  return { headers, authMode };
5483
5044
  }, []);
5484
5045
  const handleUnauthorized = reactExports.useCallback((headers) => {
5485
5046
  if (typeof window === "undefined") return;
5486
5047
  const userToken = window.localStorage.getItem("ds_access_token");
5487
- const shareToken = getShareSessionToken();
5488
5048
  const hasUserToken = Boolean(userToken);
5489
- const hasShareSession = Boolean(shareToken);
5490
- const authHeader = typeof headers.Authorization === "string" ? headers.Authorization : null;
5491
- const usedShareSession = Boolean(
5492
- authHeader && shareToken && authHeader === `Bearer ${shareToken}`
5493
- );
5494
- if (usedShareSession || !hasUserToken && hasShareSession) {
5495
- clearShareSession();
5496
- if (!window.location.pathname.startsWith("/share")) {
5497
- window.location.href = "/";
5498
- }
5499
- return;
5500
- }
5501
5049
  if (hasUserToken) {
5502
5050
  window.localStorage.removeItem("ds_access_token");
5503
5051
  redirectToLanding("session_expired");
@@ -11752,7 +11300,7 @@ function normalizeItem(value) {
11752
11300
  };
11753
11301
  }
11754
11302
  function ReadPaperToolView({ toolContent, panelMode }) {
11755
- const { t } = useI18n("review");
11303
+ const { t } = useI18n("workspace");
11756
11304
  const showHeader = panelMode == null;
11757
11305
  const toolRecord = asRecord$1(toolContent);
11758
11306
  const rawContent = asRecord$1(toolContent.content);
@@ -11923,7 +11471,7 @@ function SearchToolView({ toolContent, panelMode }) {
11923
11471
  }
11924
11472
 
11925
11473
  const CliToolTerminal = dynamic(
11926
- () => __vitePreload(() => import('./index-BlplpvE1.js'),true?__vite__mapDeps([0,1,2,3]):void 0).then((mod) => mod.CliToolTerminal),
11474
+ () => __vitePreload(() => import('./index-BaVumsQT.js'),true?__vite__mapDeps([0,1,2,3]):void 0).then((mod) => mod.CliToolTerminal),
11927
11475
  {
11928
11476
  loading: () => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex h-full items-center justify-center text-xs text-[var(--text-tertiary)]", children: "Loading terminal..." })
11929
11477
  }
@@ -12297,8 +11845,8 @@ const TOOL_FUNCTION_MAP = {
12297
11845
  rebuttal_pdf_read_lines: "Reading PDF lines",
12298
11846
  rebuttal_pdf_annotate: "Annotating PDF",
12299
11847
  rebuttal_pdf_jump: "Jumping in PDF",
12300
- review_final_markdown_write: "Writing final review report",
12301
- rebuttal_final_markdown_write: "Writing final rebuttal report",
11848
+ review_final_markdown_write: "Writing final report",
11849
+ rebuttal_final_markdown_write: "Writing final report",
12302
11850
  context_read: "Reading context",
12303
11851
  ds_system_read_file: "Reading file",
12304
11852
  ds_system_pull_file: "Reading file",
@@ -14799,12 +14347,12 @@ function asRecord(value) {
14799
14347
  function asString(value) {
14800
14348
  return typeof value === "string" ? value : "";
14801
14349
  }
14802
- function resolveFinalReportSectionLabel(section, tReview) {
14350
+ function resolveFinalReportSectionLabel(section, tWorkspace) {
14803
14351
  if (typeof section === "string") {
14804
14352
  const normalized = section.trim().toLowerCase();
14805
14353
  if (!normalized) return null;
14806
14354
  const labelKey = FINAL_REPORT_SECTION_LABEL_KEYS[normalized];
14807
- if (labelKey) return tReview(labelKey, void 0, section);
14355
+ if (labelKey) return tWorkspace(labelKey, void 0, section);
14808
14356
  return section.trim();
14809
14357
  }
14810
14358
  const descriptor = asRecord(section);
@@ -14813,7 +14361,7 @@ function resolveFinalReportSectionLabel(section, tReview) {
14813
14361
  if (normalizedId) {
14814
14362
  const labelKey = FINAL_REPORT_SECTION_LABEL_KEYS[normalizedId];
14815
14363
  if (labelKey) {
14816
- return tReview(labelKey, void 0, asString(descriptor.title) || normalizedId);
14364
+ return tWorkspace(labelKey, void 0, asString(descriptor.title) || normalizedId);
14817
14365
  }
14818
14366
  }
14819
14367
  const title = asString(descriptor.title);
@@ -14895,7 +14443,7 @@ function ToolUseDefault({
14895
14443
  }) {
14896
14444
  const toolInfo = reactExports.useMemo(() => getToolInfo(tool), [tool]);
14897
14445
  const actorLabel = reactExports.useMemo(() => resolveToolActorLabel(tool), [tool]);
14898
- const { t: tReview } = useI18n("review");
14446
+ const { t: tWorkspace } = useI18n("workspace");
14899
14447
  const Icon = toolInfo.icon;
14900
14448
  const isCompact = Boolean(compact);
14901
14449
  const [expanded, setExpanded] = reactExports.useState(false);
@@ -15361,8 +14909,8 @@ function ToolUseDefault({
15361
14909
  asString(normalizedContent.reason) || asString(content.reason) || ""
15362
14910
  ).trim().toLowerCase();
15363
14911
  const retryRequired = normalizedContent.retry_required === true || content.retry_required === true;
15364
- const currentSectionLabel = resolveFinalReportSectionLabel(normalizedContent.current_section, tReview) || resolveFinalReportSectionLabel(content.current_section, tReview) || resolveFinalReportSectionLabel(asString(toolArgs.section_id) || asString(toolArgs.section), tReview);
15365
- const nextSectionLabel = resolveFinalReportSectionLabel(normalizedContent.next_required_section, tReview) || resolveFinalReportSectionLabel(content.next_required_section, tReview);
14912
+ const currentSectionLabel = resolveFinalReportSectionLabel(normalizedContent.current_section, tWorkspace) || resolveFinalReportSectionLabel(content.current_section, tWorkspace) || resolveFinalReportSectionLabel(asString(toolArgs.section_id) || asString(toolArgs.section), tWorkspace);
14913
+ const nextSectionLabel = resolveFinalReportSectionLabel(normalizedContent.next_required_section, tWorkspace) || resolveFinalReportSectionLabel(content.next_required_section, tWorkspace);
15366
14914
  const missingSections = Array.isArray(normalizedContent.missing_sections) ? normalizedContent.missing_sections : Array.isArray(content.missing_sections) ? content.missing_sections : [];
15367
14915
  const missingCount = missingSections.length;
15368
14916
  const detail = compactFinalReportWriteDetail(
@@ -15370,27 +14918,27 @@ function ToolUseDefault({
15370
14918
  );
15371
14919
  if (toolStatus === "calling") {
15372
14920
  return {
15373
- headline: currentSectionLabel ? tReview("detail_final_report_tool_writing_section", { section: currentSectionLabel }) : tReview("detail_final_report_tool_writing_generic"),
14921
+ headline: currentSectionLabel ? tWorkspace("detail_final_report_tool_writing_section", { section: currentSectionLabel }) : tWorkspace("detail_final_report_tool_writing_generic"),
15374
14922
  detail: null,
15375
14923
  tone: "active"
15376
14924
  };
15377
14925
  }
15378
14926
  if (["ok", "success", "completed"].includes(resultStatus2)) {
15379
14927
  return {
15380
- headline: tReview("detail_final_report_tool_completed"),
14928
+ headline: tWorkspace("detail_final_report_tool_completed"),
15381
14929
  detail,
15382
14930
  tone: "success"
15383
14931
  };
15384
14932
  }
15385
14933
  if (resultStatus2 === "partial" || reason === "required_sections_missing") {
15386
14934
  return {
15387
- headline: nextSectionLabel ? tReview("detail_final_report_tool_partial_next", { section: nextSectionLabel }) : missingCount > 0 ? tReview("detail_final_report_tool_partial_generic") : tReview("detail_final_report_tool_writing_generic"),
14935
+ headline: nextSectionLabel ? tWorkspace("detail_final_report_tool_partial_next", { section: nextSectionLabel }) : missingCount > 0 ? tWorkspace("detail_final_report_tool_partial_generic") : tWorkspace("detail_final_report_tool_writing_generic"),
15388
14936
  detail,
15389
14937
  tone: "active"
15390
14938
  };
15391
14939
  }
15392
14940
  if (resultStatus2 === "error" || retryRequired || Boolean(asString(normalizedContent.error) || asString(content.error))) {
15393
- const headline = reason === "paper_search_calls_not_met" || reason === "paper_search_distinct_queries_not_met" ? tReview("detail_final_report_tool_gate_paper_search") : reason === "annotation_count_not_met" ? tReview("detail_final_report_tool_gate_annotation") : tReview("detail_final_report_tool_retry_required");
14941
+ const headline = reason === "paper_search_calls_not_met" || reason === "paper_search_distinct_queries_not_met" ? tWorkspace("detail_final_report_tool_gate_paper_search") : reason === "annotation_count_not_met" ? tWorkspace("detail_final_report_tool_gate_annotation") : tWorkspace("detail_final_report_tool_retry_required");
15394
14942
  return {
15395
14943
  headline,
15396
14944
  detail,
@@ -15405,11 +14953,11 @@ function ToolUseDefault({
15405
14953
  };
15406
14954
  }
15407
14955
  return {
15408
- headline: currentSectionLabel ? tReview("detail_final_report_tool_writing_section", { section: currentSectionLabel }) : tReview("detail_final_report_tool_writing_generic"),
14956
+ headline: currentSectionLabel ? tWorkspace("detail_final_report_tool_writing_section", { section: currentSectionLabel }) : tWorkspace("detail_final_report_tool_writing_generic"),
15409
14957
  detail: null,
15410
14958
  tone: "active"
15411
14959
  };
15412
- }, [isFinalReportWrite, tReview, tool.status, toolArgs.section, toolArgs.section_id, toolResult]);
14960
+ }, [isFinalReportWrite, tWorkspace, tool.status, toolArgs.section, toolArgs.section_id, toolResult]);
15413
14961
  if (isMcpTemplate) {
15414
14962
  const chipClasses = cn(
15415
14963
  "ai-manus-tool-chip flex w-full items-start gap-2 rounded-[12px] border border-[var(--border-light)] px-3 py-2 text-left",
@@ -18776,7 +18324,7 @@ function pickGreetingTemplate() {
18776
18324
  return GREETING_TEMPLATES[index];
18777
18325
  }
18778
18326
  const VNCViewer = dynamic(
18779
- () => __vitePreload(() => import('./VNCViewer-DG8b0q2X.js'),true?__vite__mapDeps([4,1,2,5,6,7,8,9,10,11,12,13,14,15]):void 0).then((mod) => mod.VNCViewer),
18327
+ () => __vitePreload(() => import('./VNCViewer-CclFC7FM.js'),true?__vite__mapDeps([4,1,2,5,6,7,8,9,10,11,12,13,14]):void 0).then((mod) => mod.VNCViewer),
18780
18328
  {
18781
18329
  loading: () => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex h-full w-full items-center justify-center text-sm text-[var(--text-tertiary)]", children: "Loading sandbox view..." })
18782
18330
  }
@@ -19568,11 +19116,10 @@ function AiManusChatView({
19568
19116
  },
19569
19117
  [projectId, setCliServerId, setExecutionTarget]
19570
19118
  );
19571
- const isShareView = Boolean(projectId && isShareViewForProject(projectId));
19572
- const readOnlyMode = Boolean(readOnly || isShareView);
19119
+ const readOnlyMode = Boolean(readOnly);
19573
19120
  const sessionListEnabledValue = (sessionListEnabled ?? true) && !deferSessionList;
19574
19121
  const resolvedHistoryMode = historyMode ?? "inline";
19575
- const historyPanelEnabled = sessionListEnabledValue && !isShareView && (mode === "welcome" || resolvedHistoryMode === "overlay");
19122
+ const historyPanelEnabled = sessionListEnabledValue && (mode === "welcome" || resolvedHistoryMode === "overlay");
19576
19123
  const historyPanelInline = historyPanelEnabled && resolvedHistoryMode !== "overlay" && mode === "welcome";
19577
19124
  const historyPanelOverlay = historyPanelEnabled && resolvedHistoryMode === "overlay";
19578
19125
  const sessionListReadOnly = readOnlyMode || !projectId;
@@ -19639,7 +19186,6 @@ function AiManusChatView({
19639
19186
  const [recoveryBanner, setRecoveryBanner] = reactExports.useState(null);
19640
19187
  const recoveryTimeoutRef = reactExports.useRef(null);
19641
19188
  const autoResumeTimerRef = reactExports.useRef(null);
19642
- const [shareOpen, setShareOpen] = reactExports.useState(false);
19643
19189
  const refreshingAgentsRef = reactExports.useRef(false);
19644
19190
  const lastOnlineServersKeyRef = reactExports.useRef(null);
19645
19191
  const lastMentionRefreshRef = reactExports.useRef(null);
@@ -20285,7 +19831,7 @@ function AiManusChatView({
20285
19831
  setRestoreToken((value) => value + 1);
20286
19832
  }, []);
20287
19833
  reactExports.useEffect(() => {
20288
- if (!projectId || readOnlyMode || isShareView) return;
19834
+ if (!projectId || readOnlyMode) return;
20289
19835
  if (typeof window === "undefined") return;
20290
19836
  let cancelled = false;
20291
19837
  const apiBaseUrl = getApiBaseUrl();
@@ -20408,7 +19954,6 @@ function AiManusChatView({
20408
19954
  };
20409
19955
  }, [
20410
19956
  isCopilotSurface,
20411
- isShareView,
20412
19957
  projectId,
20413
19958
  readOnlyMode,
20414
19959
  requestRestore,
@@ -20772,8 +20317,8 @@ function AiManusChatView({
20772
20317
  adopt: Boolean(options?.adopt),
20773
20318
  loadedProjectId: latestSessionLoadedRef.current
20774
20319
  });
20775
- if (!projectId || readOnlyMode || isShareView) {
20776
- debugLog("latest:skip", { reason: "no_project_or_readonly_or_share" });
20320
+ if (!projectId || readOnlyMode) {
20321
+ debugLog("latest:skip", { reason: "no_project_or_readonly" });
20777
20322
  return null;
20778
20323
  }
20779
20324
  if (!allowSurfaceFallback) {
@@ -20876,7 +20421,6 @@ function AiManusChatView({
20876
20421
  debugLog,
20877
20422
  draftSessionIdRef,
20878
20423
  allowSurfaceFallback,
20879
- isShareView,
20880
20424
  isRestoring,
20881
20425
  sessionSurface,
20882
20426
  projectId,
@@ -20895,14 +20439,14 @@ function AiManusChatView({
20895
20439
  lastVisibleRef.current = isVisible;
20896
20440
  lastModeRef.current = mode;
20897
20441
  const currentSessionId = sessionIdRef.current;
20898
- const shouldAutoAdoptLatest = allowSurfaceFallback && Boolean(projectId) && !readOnlyMode && !isShareView && !draftSessionIdRef.current && isCopilotSurface && !manualSessionSelectionRef.current && !currentSessionId;
20442
+ const shouldAutoAdoptLatest = allowSurfaceFallback && Boolean(projectId) && !readOnlyMode && !draftSessionIdRef.current && isCopilotSurface && !manualSessionSelectionRef.current && !currentSessionId;
20899
20443
  if (isVisible && (!wasVisible || modeChanged)) {
20900
20444
  debugLog("visibility:enter", { wasVisible, modeChanged, isFirstMount });
20901
20445
  if (mode === "welcome") {
20902
20446
  debugLog("sessions:reload", { reason: "visible_or_mode_changed" });
20903
20447
  void reloadSessionSummaries();
20904
20448
  }
20905
- if (!projectId || readOnlyMode || isShareView) return;
20449
+ if (!projectId || readOnlyMode) return;
20906
20450
  if (draftSessionIdRef.current) return;
20907
20451
  if (currentSessionId && messagesRef.current.length === 0 && !isRestoring) {
20908
20452
  debugLog("restore:request", { reason: "visible_restore_existing_session" });
@@ -20924,7 +20468,7 @@ function AiManusChatView({
20924
20468
  return;
20925
20469
  }
20926
20470
  if (isFirstMount && !currentSessionId && !draftSessionIdRef.current) {
20927
- if (!projectId || readOnlyMode || isShareView) return;
20471
+ if (!projectId || readOnlyMode) return;
20928
20472
  debugLog("latest:trigger", { reason: "first_mount_no_session" });
20929
20473
  if (allowSurfaceFallback) {
20930
20474
  void loadLatestSession({ force: true, adopt: shouldAutoAdoptLatest });
@@ -20932,7 +20476,7 @@ function AiManusChatView({
20932
20476
  return;
20933
20477
  }
20934
20478
  if (isFirstMount && currentSessionId && messagesRef.current.length === 0) {
20935
- if (!projectId || readOnlyMode || isShareView) return;
20479
+ if (!projectId || readOnlyMode) return;
20936
20480
  if (!isRestoring) {
20937
20481
  debugLog("restore:request", { reason: "first_mount_session_no_messages" });
20938
20482
  requestRestore();
@@ -20941,7 +20485,6 @@ function AiManusChatView({
20941
20485
  }, [
20942
20486
  debugLog,
20943
20487
  allowSurfaceFallback,
20944
- isShareView,
20945
20488
  isRestoring,
20946
20489
  loadLatestSession,
20947
20490
  mode,
@@ -26757,15 +26300,6 @@ ${lines.join("\n")}`;
26757
26300
  ] }) : chatPanel
26758
26301
  }
26759
26302
  ),
26760
- projectId ? /* @__PURE__ */ jsxRuntimeExports.jsx(
26761
- ProjectShareDialog,
26762
- {
26763
- projectId,
26764
- open: shareOpen,
26765
- onOpenChange: setShareOpen,
26766
- canManageShare: !readOnlyMode
26767
- }
26768
- ) : null,
26769
26303
  /* @__PURE__ */ jsxRuntimeExports.jsx(
26770
26304
  Dialog,
26771
26305
  {