@vibe-forge/client 2.0.0 → 3.0.0-alpha.0
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.
- package/AGENTS.md +4 -1
- package/dist/assets/{arc-CbOXL0l9.js → arc-1JbypnRY.js} +1 -1
- package/dist/assets/{blockDiagram-c4efeb88-CqxINvsS.js → blockDiagram-c4efeb88-jT5b9nId.js} +1 -1
- package/dist/assets/{c4Diagram-c83219d4-BKazU0hb.js → c4Diagram-c83219d4-KNPh-1ta.js} +1 -1
- package/dist/assets/channel-pzvjJnfd.js +1 -0
- package/dist/assets/{classDiagram-beda092f-fAFX5BpB.js → classDiagram-beda092f-vvXuOT3F.js} +1 -1
- package/dist/assets/{classDiagram-v2-2358418a-w1VkNGJj.js → classDiagram-v2-2358418a-vH4j7skr.js} +1 -1
- package/dist/assets/clone-CtWwIeUb.js +1 -0
- package/dist/assets/{createText-1719965b-CEinakVP.js → createText-1719965b-COeSYnf3.js} +1 -1
- package/dist/assets/{cssMode-DPqRki4y.js → cssMode-Doc7QRKn.js} +1 -1
- package/dist/assets/{edges-96097737-Cb0F1_3K.js → edges-96097737-D09v6R_r.js} +1 -1
- package/dist/assets/{erDiagram-0228fc6a-C-N2fx-J.js → erDiagram-0228fc6a-CbZ6rfxl.js} +1 -1
- package/dist/assets/{flowDb-c6c81e3f-D1Xz_8Gf.js → flowDb-c6c81e3f-CnZOzhdk.js} +1 -1
- package/dist/assets/{flowDiagram-50d868cf-DyPSZyAj.js → flowDiagram-50d868cf-jv-xWM2p.js} +1 -1
- package/dist/assets/flowDiagram-v2-4f6560a1-BiyrkIKs.js +1 -0
- package/dist/assets/{flowchart-elk-definition-6af322e1-Dr1DDXwE.js → flowchart-elk-definition-6af322e1-D8pf677G.js} +1 -1
- package/dist/assets/{freemarker2-C3DvPFaK.js → freemarker2-CL0o23Gj.js} +1 -1
- package/dist/assets/{ganttDiagram-a2739b55-DmvY1GRj.js → ganttDiagram-a2739b55-BAPQzC4u.js} +1 -1
- package/dist/assets/{gitGraphDiagram-82fe8481-CoXfPYYi.js → gitGraphDiagram-82fe8481-BI2x71m0.js} +1 -1
- package/dist/assets/{graph-BkDQy7Qt.js → graph-CZK4Bjpq.js} +1 -1
- package/dist/assets/{handlebars-BcTFdqjl.js → handlebars-CCG38Pg6.js} +1 -1
- package/dist/assets/{html-Dg-O6XFr.js → html-BddshTWG.js} +1 -1
- package/dist/assets/{htmlMode-B_wqYWvn.js → htmlMode-xKXiYcDz.js} +1 -1
- package/dist/assets/{index-5325376f-kxPTR3_e.js → index-5325376f-BWMTD8RU.js} +1 -1
- package/dist/assets/{index-wkhI4dr6.js → index-CBe7kDkV.js} +398 -377
- package/dist/assets/index-MWOwVzqE.css +32 -0
- package/dist/assets/{infoDiagram-8eee0895-BEvqkwPI.js → infoDiagram-8eee0895-CR78btIF.js} +1 -1
- package/dist/assets/{javascript-DhlOH8_z.js → javascript-BPlRHPjg.js} +1 -1
- package/dist/assets/{journeyDiagram-c64418c1-gKtLYmmp.js → journeyDiagram-c64418c1-DZRv6FKz.js} +1 -1
- package/dist/assets/{jsonMode-DxTbF9OD.js → jsonMode-BYLVfdkf.js} +1 -1
- package/dist/assets/{layout-CDaZEk6E.js → layout-BtudyPU2.js} +1 -1
- package/dist/assets/{line-DNRQu8iq.js → line-DgHXrIhS.js} +1 -1
- package/dist/assets/{linear-Cph9Z6_j.js → linear-DtBoKICx.js} +1 -1
- package/dist/assets/{liquid-ByZ6JgRG.js → liquid-DxBlJk0W.js} +1 -1
- package/dist/assets/{lspLanguageFeatures-DzvhkgnM.js → lspLanguageFeatures-DmKVpmeH.js} +1 -1
- package/dist/assets/{mdx-D8RGHTl6.js → mdx-DrScsd-w.js} +1 -1
- package/dist/assets/{mermaid.core-BgcryF__.js → mermaid.core-Cj_NJ_lZ.js} +4 -4
- package/dist/assets/{mindmap-definition-8da855dc-WrxK0FcB.js → mindmap-definition-8da855dc-CMXbwtsc.js} +1 -1
- package/dist/assets/{pieDiagram-a8764435-VsZBsiQy.js → pieDiagram-a8764435-Bd6rfpJv.js} +1 -1
- package/dist/assets/{python-CXVtk_cg.js → python-Crbi7B7n.js} +1 -1
- package/dist/assets/{quadrantDiagram-1e28029f-BVlgwOvU.js → quadrantDiagram-1e28029f-H-FdBQn6.js} +1 -1
- package/dist/assets/{razor-0tind7h2.js → razor-DHyrzIfE.js} +1 -1
- package/dist/assets/{requirementDiagram-08caed73-CpPMPoYp.js → requirementDiagram-08caed73-BSyCVDSG.js} +1 -1
- package/dist/assets/{sankeyDiagram-a04cb91d-Cm5nnRmc.js → sankeyDiagram-a04cb91d-S6E6BReg.js} +1 -1
- package/dist/assets/{sequenceDiagram-c5b8d532-DpMlJvJB.js → sequenceDiagram-c5b8d532-BMHY4KMj.js} +1 -1
- package/dist/assets/{stateDiagram-1ecb1508-DU1zc7vq.js → stateDiagram-1ecb1508-BMrMw6XR.js} +1 -1
- package/dist/assets/{stateDiagram-v2-c2b004d7-D-0RgmAp.js → stateDiagram-v2-c2b004d7-B5SIFUb_.js} +1 -1
- package/dist/assets/{styles-b4e223ce-BSO-yNWV.js → styles-b4e223ce-DqiXwnx3.js} +1 -1
- package/dist/assets/{styles-ca3715f6-CHnsn2Ro.js → styles-ca3715f6-jNxW2Db8.js} +1 -1
- package/dist/assets/{styles-d45a18b0-B-rVGjEq.js → styles-d45a18b0-C4nlfLcZ.js} +1 -1
- package/dist/assets/{svgDrawCommon-b86b1483-CA3Pl89f.js → svgDrawCommon-b86b1483-FIWFuZfb.js} +1 -1
- package/dist/assets/{timeline-definition-faaaa080-BcihLR6s.js → timeline-definition-faaaa080-CEQDoqdf.js} +1 -1
- package/dist/assets/{tsMode-D9GGa5Ur.js → tsMode-DnNy3rE9.js} +1 -1
- package/dist/assets/{typescript-BT9CK_EL.js → typescript-YBZ4vw5B.js} +1 -1
- package/dist/assets/{xml-DNO75J-T.js → xml-BJGGYD70.js} +1 -1
- package/dist/assets/{xychartDiagram-f5964ef8-DJTwe32X.js → xychartDiagram-f5964ef8-DUNOFOk0.js} +1 -1
- package/dist/assets/{yaml-7CVzhiP2.js → yaml-BMY4mu5s.js} +1 -1
- package/dist/index.html +8 -3
- package/dist/manifest.webmanifest +30 -0
- package/dist/pwa-icon-192.png +0 -0
- package/dist/pwa-icon-512.png +0 -0
- package/dist/sw.js +105 -0
- package/index.html +6 -1
- package/package.json +13 -13
- package/public/manifest.webmanifest +30 -0
- package/public/pwa-icon-192.png +0 -0
- package/public/pwa-icon-512.png +0 -0
- package/public/sw.js +105 -0
- package/src/App.tsx +13 -1
- package/src/api/README.md +1 -0
- package/src/api/adapters.ts +63 -0
- package/src/api/auth-token.ts +51 -0
- package/src/api/auth.ts +46 -0
- package/src/api/automation.ts +10 -0
- package/src/api/base.ts +20 -17
- package/src/api/config.ts +5 -1
- package/src/api/knowledge.ts +59 -0
- package/src/api/sessions.ts +35 -3
- package/src/api/skill-hub.ts +126 -0
- package/src/api/workspace.ts +33 -1
- package/src/api/worktree-environments.ts +53 -0
- package/src/api.ts +62 -7
- package/src/client-build-info.ts +19 -0
- package/src/components/ConfigView.scss +596 -28
- package/src/components/ConfigView.tsx +569 -138
- package/src/components/NavRail.scss +1 -2
- package/src/components/NavRail.tsx +33 -3
- package/src/components/Sidebar.scss +0 -44
- package/src/components/Sidebar.tsx +110 -37
- package/src/components/auth/AuthGate.scss +79 -0
- package/src/components/auth/AuthGate.tsx +174 -0
- package/src/components/automation-view/@components/AutomationTaskComposer.tsx +220 -0
- package/src/components/automation-view/@components/AutomationTriggerRow.tsx +192 -0
- package/src/components/automation-view/@hooks/use-automation-startup-options-data.tsx +289 -0
- package/src/components/automation-view/@hooks/use-automation-startup-static-options.ts +51 -0
- package/src/components/automation-view/@utils/sender-model-options.tsx +52 -0
- package/src/components/automation-view/@utils/startup-options.ts +26 -0
- package/src/components/automation-view/AutomationEmptyGuide.tsx +61 -0
- package/src/components/automation-view/AutomationEmptyLanding.scss +165 -0
- package/src/components/automation-view/AutomationEmptyLanding.tsx +211 -0
- package/src/components/automation-view/AutomationRuleDetailPreview.tsx +179 -0
- package/src/components/automation-view/PanelTitleActions.tsx +66 -0
- package/src/components/automation-view/RuleFormPanel.scss +172 -49
- package/src/components/automation-view/RuleFormPanel.tsx +196 -91
- package/src/components/automation-view/RuleSidebar.scss +128 -41
- package/src/components/automation-view/RuleSidebar.tsx +173 -89
- package/src/components/automation-view/RunHistoryPanel.scss +307 -72
- package/src/components/automation-view/RunHistoryPanel.tsx +185 -165
- package/src/components/automation-view/TaskList.scss +130 -64
- package/src/components/automation-view/TaskList.tsx +15 -31
- package/src/components/automation-view/TriggerList.scss +87 -8
- package/src/components/automation-view/TriggerList.tsx +14 -173
- package/src/components/automation-view/index.scss +165 -37
- package/src/components/automation-view/index.tsx +174 -87
- package/src/components/automation-view/types.ts +13 -0
- package/src/components/chat/AGENTS.md +3 -1
- package/src/components/chat/ChatHeader.tsx +56 -33
- package/src/components/chat/ChatHistoryView.tsx +254 -123
- package/src/components/chat/NewSessionGuide.scss +274 -204
- package/src/components/chat/NewSessionGuide.tsx +46 -111
- package/src/components/chat/NewSessionGuideStarterList.tsx +190 -0
- package/src/components/chat/NewSessionGuideStarterSection.tsx +121 -0
- package/src/components/chat/bottom-dock-constants.ts +4 -0
- package/src/components/chat/conversation-starter-apply.ts +181 -0
- package/src/components/chat/git-controls/ChatGitControls.scss +65 -0
- package/src/components/chat/git-controls/DraftGitControls.tsx +14 -0
- package/src/components/chat/git-controls/DraftWorktreeEnvironmentDropdown.tsx +115 -0
- package/src/components/chat/messages/MessageItem.tsx +21 -6
- package/src/components/chat/messages/MessageStatusNotice.tsx +12 -4
- package/src/components/chat/messages/build-chat-history-status-notices.ts +18 -13
- package/src/components/chat/messages/message-action-utils.ts +29 -0
- package/src/components/chat/new-session-guide-config.ts +19 -0
- package/src/components/chat/new-session-guide-items.ts +172 -0
- package/src/components/chat/new-session-guide-list-order.ts +58 -0
- package/src/components/chat/sender/@components/account-select/AccountSelectControl.scss +112 -0
- package/src/components/chat/sender/@components/account-select/AccountSelectControl.tsx +280 -0
- package/src/components/chat/sender/@components/account-select/AccountSelectDropdown.scss +155 -0
- package/src/components/chat/sender/@components/adapter-select/AdapterSelectControl.scss +51 -12
- package/src/components/chat/sender/@components/adapter-select/AdapterSelectDropdown.scss +14 -0
- package/src/components/chat/sender/@components/effort-select/EffortSelectControl.scss +36 -0
- package/src/components/chat/sender/@components/effort-select/EffortSelectControl.tsx +17 -12
- package/src/components/chat/sender/@components/model-select/ModelSelectControl.scss +62 -0
- package/src/components/chat/sender/@components/model-select/ModelSelectControl.tsx +17 -12
- package/src/components/chat/sender/@components/model-select/ModelSelectMenu.scss +2 -0
- package/src/components/chat/sender/@components/model-select/ModelSelectMenuLabels.scss +24 -0
- package/src/components/chat/sender/@components/permission-mode-control/PermissionModeControl.scss +199 -0
- package/src/components/chat/sender/@components/permission-mode-control/PermissionModeControl.tsx +172 -0
- package/src/components/chat/sender/@components/reference-actions/ReferenceActionsControl.scss +1 -10
- package/src/components/chat/sender/@components/reference-actions/ReferenceActionsControl.tsx +16 -65
- package/src/components/chat/sender/@components/sender-body/SenderBody.tsx +13 -1
- package/src/components/chat/sender/@components/sender-header-controls/SenderHeaderControls.tsx +157 -0
- package/src/components/chat/sender/@components/sender-monaco-editor/monaco-runtime.ts +1 -17
- package/src/components/chat/sender/@components/sender-toolbar/SenderSelectBase.scss +18 -2
- package/src/components/chat/sender/@components/sender-toolbar/SenderSelectShared.scss +18 -1
- package/src/components/chat/sender/@components/sender-toolbar/SenderToolbar.scss +2 -0
- package/src/components/chat/sender/@components/sender-toolbar/SenderToolbar.tsx +40 -40
- package/src/components/chat/sender/@components/session-target/SenderSessionTargetBar.scss +215 -0
- package/src/components/chat/sender/@components/session-target/SenderSessionTargetBar.tsx +185 -0
- package/src/components/chat/sender/@core/build-sender-toolbar.ts +6 -0
- package/src/components/chat/sender/@core/create-sender-toolbar-handlers.ts +21 -1
- package/src/components/chat/sender/@core/get-sender-runtime-state.ts +3 -2
- package/src/components/chat/sender/@core/sender-toolbar-bindings.ts +12 -0
- package/src/components/chat/sender/@hooks/use-sender-controller.ts +56 -1
- package/src/components/chat/sender/@hooks/use-sender-reference-actions.ts +9 -66
- package/src/components/chat/sender/@types/sender-props.ts +18 -0
- package/src/components/chat/sender/@types/sender-toolbar-types.ts +8 -1
- package/src/components/chat/sender/@types/sender-types.ts +1 -3
- package/src/components/chat/sender/@utils/sender-constants.ts +1 -1
- package/src/components/chat/sender/Sender.scss +257 -2
- package/src/components/chat/sender/Sender.tsx +1 -0
- package/src/components/chat/status-bar/ChatStatusBar.scss +85 -0
- package/src/components/chat/status-bar/ChatStatusBar.tsx +48 -0
- package/src/components/chat/terminal/@components/TerminalManagerList.tsx +191 -0
- package/src/components/chat/terminal/@components/TerminalPane.scss +71 -0
- package/src/components/chat/terminal/@components/TerminalPane.tsx +137 -0
- package/src/components/chat/terminal/@components/TerminalPanelActions.tsx +75 -0
- package/src/components/chat/terminal/@hooks/use-terminal-instance.ts +36 -0
- package/src/components/chat/terminal/@hooks/use-terminal-session.ts +18 -21
- package/src/components/chat/terminal/@hooks/use-terminal-title-editor.ts +72 -0
- package/src/components/chat/terminal/@utils/terminal-keyboard.ts +141 -0
- package/src/components/chat/terminal/@utils/terminal-panes.ts +123 -0
- package/src/components/chat/terminal/ChatTerminalView.scss +310 -38
- package/src/components/chat/terminal/ChatTerminalView.tsx +151 -79
- package/src/components/chat/tools/core/ToolDiffViewer.tsx +3 -17
- package/src/components/chat/workspace-drawer/ChatWorkspaceDrawer.scss +778 -0
- package/src/components/chat/workspace-drawer/ChatWorkspaceDrawer.tsx +112 -0
- package/src/components/chat/workspace-drawer/ChatWorkspaceDrawerToolbar.tsx +183 -0
- package/src/components/chat/workspace-drawer/WorkspaceDrawerChangedFileRow.tsx +75 -0
- package/src/components/chat/workspace-drawer/WorkspaceDrawerChangedFiles.tsx +161 -0
- package/src/components/chat/workspace-drawer/WorkspaceDrawerChangedFolderTree.tsx +191 -0
- package/src/components/chat/workspace-drawer/WorkspaceDrawerTree.tsx +35 -0
- package/src/components/chat/workspace-drawer/WorkspaceDrawerTreeState.tsx +17 -0
- package/src/components/chat/workspace-drawer/changed-files-model.ts +152 -0
- package/src/components/chat/workspace-drawer/workspace-drawer-icons.ts +110 -0
- package/src/components/chat/workspace-file-editor/WorkspaceFileBreadcrumb.tsx +17 -0
- package/src/components/chat/workspace-file-editor/WorkspaceFileEditorView.scss +283 -0
- package/src/components/chat/workspace-file-editor/WorkspaceFileEditorView.tsx +165 -0
- package/src/components/chat/workspace-file-editor/WorkspaceFileTabs.tsx +135 -0
- package/src/components/chat/workspace-file-editor/use-workspace-file-editor-state.ts +113 -0
- package/src/components/chat/workspace-file-editor/workspace-file-editor-language.ts +55 -0
- package/src/components/composer-landing/ComposerLanding.scss +75 -0
- package/src/components/composer-landing/ComposerLanding.tsx +47 -0
- package/src/components/config/AGENTS.md +45 -0
- package/src/components/config/AdapterAccountsManager.scss +540 -0
- package/src/components/config/AdapterAccountsManager.tsx +846 -0
- package/src/components/config/AppSettingsPanel.tsx +85 -9
- package/src/components/config/ConfigAboutSection.scss +7 -1
- package/src/components/config/ConfigAboutSection.tsx +21 -3
- package/src/components/config/ConfigEditors.scss +12 -0
- package/src/components/config/ConfigFieldRow.scss +88 -4
- package/src/components/config/ConfigSectionForm.scss +88 -3
- package/src/components/config/ConfigSectionForm.tsx +948 -138
- package/src/components/config/ConfigSectionPanel.tsx +188 -12
- package/src/components/config/ConfigSourceSwitch.tsx +32 -18
- package/src/components/config/DetailCollectionFieldActions.tsx +63 -0
- package/src/components/config/DetailListField.tsx +413 -0
- package/src/components/config/McpServerItemEditor.tsx +154 -0
- package/src/components/config/RecommendedModelsItemEditor.tsx +146 -0
- package/src/components/config/WorktreeEnvironmentDetailView.tsx +126 -0
- package/src/components/config/WorktreeEnvironmentListView.tsx +126 -0
- package/src/components/config/WorktreeEnvironmentPanel.scss +430 -0
- package/src/components/config/WorktreeEnvironmentPanel.tsx +147 -0
- package/src/components/config/WorktreeEnvironmentScriptEditorCard.tsx +125 -0
- package/src/components/config/WorktreeEnvironmentScriptEditors.tsx +189 -0
- package/src/components/config/configConflict.ts +41 -0
- package/src/components/config/configDetail.ts +381 -0
- package/src/components/config/configSchema.ts +850 -179
- package/src/components/config/configUtils.ts +1 -1
- package/src/components/config/record-editors/RecordEditors.scss +187 -2
- package/src/components/config/record-editors/RecordJsonEditor.tsx +27 -2
- package/src/components/config/record-editors/SchemaObjectEditor.tsx +183 -0
- package/src/components/config/record-editors/SchemaRecordEditor.tsx +184 -0
- package/src/components/config/record-editors/index.tsx +2 -1
- package/src/components/config/record-editors/schemaRecordUtils.ts +55 -0
- package/src/components/config/use-worktree-environment-auto-save.ts +386 -0
- package/src/components/config/worktree-environment-panel-model.ts +108 -0
- package/src/components/dock-panel/DockPanel.scss +84 -17
- package/src/components/dock-panel/DockPanel.tsx +37 -34
- package/src/components/dock-panel/DockPanelHeader.tsx +65 -0
- package/src/components/dock-panel/use-dock-panel-fullscreen.ts +51 -0
- package/src/components/knowledge-base/KnowledgeBaseView.scss +276 -38
- package/src/components/knowledge-base/KnowledgeBaseView.tsx +252 -46
- package/src/components/knowledge-base/components/@hooks/use-skills-cli-modal-controller.ts +157 -0
- package/src/components/knowledge-base/components/@hooks/use-skills-tab-actions.ts +63 -0
- package/src/components/knowledge-base/components/ActionButton.scss +30 -4
- package/src/components/knowledge-base/components/ActionButton.tsx +13 -3
- package/src/components/knowledge-base/components/CreateSkillModal.tsx +59 -0
- package/src/components/knowledge-base/components/EmptyState.scss +4 -2
- package/src/components/knowledge-base/components/EntitiesTab.tsx +20 -20
- package/src/components/knowledge-base/components/EntityList.scss +3 -0
- package/src/components/knowledge-base/components/FilterBar.scss +1 -0
- package/src/components/knowledge-base/components/FilterBar.tsx +12 -8
- package/src/components/knowledge-base/components/FlowsTab.tsx +20 -20
- package/src/components/knowledge-base/components/KnowledgeBaseHeader.tsx +7 -6
- package/src/components/knowledge-base/components/KnowledgeContentControls.tsx +35 -0
- package/src/components/knowledge-base/components/KnowledgeList.scss +14 -3
- package/src/components/knowledge-base/components/KnowledgeMobilePanel.tsx +122 -0
- package/src/components/knowledge-base/components/KnowledgeSidebar.tsx +97 -0
- package/src/components/knowledge-base/components/LoadingState.scss +2 -1
- package/src/components/knowledge-base/components/ProjectSkillsList.tsx +79 -0
- package/src/components/knowledge-base/components/RuleList.scss +3 -0
- package/src/components/knowledge-base/components/RulesTab.tsx +31 -30
- package/src/components/knowledge-base/components/SectionHeader.scss +13 -1
- package/src/components/knowledge-base/components/SectionHeader.tsx +5 -3
- package/src/components/knowledge-base/components/SkillArchiveInput.tsx +43 -0
- package/src/components/knowledge-base/components/SkillHubResultItem.tsx +112 -0
- package/src/components/knowledge-base/components/SkillMarketResults.tsx +98 -0
- package/src/components/knowledge-base/components/SkillMarketView.tsx +198 -0
- package/src/components/knowledge-base/components/SkillMarketView.types.ts +28 -0
- package/src/components/knowledge-base/components/SkillRegistryErrors.tsx +21 -0
- package/src/components/knowledge-base/components/SkillRegistryModal.tsx +74 -0
- package/src/components/knowledge-base/components/SkillsCliModal.tsx +154 -0
- package/src/components/knowledge-base/components/SkillsTab.scss +424 -0
- package/src/components/knowledge-base/components/SkillsTab.tsx +166 -35
- package/src/components/knowledge-base/components/SkillsTabActions.tsx +88 -0
- package/src/components/knowledge-base/components/SpecList.scss +3 -0
- package/src/components/knowledge-base/components/TabContent.scss +4 -3
- package/src/components/knowledge-base/components/skill-hub-utils.ts +108 -0
- package/src/components/knowledge-base/components/use-skill-market-filters.ts +37 -0
- package/src/components/knowledge-base/components/use-skill-market-query-input.ts +44 -0
- package/src/components/knowledge-base/components/use-skill-market-search.ts +49 -0
- package/src/components/knowledge-base/components/use-skill-registry-modal.ts +68 -0
- package/src/components/monaco/monaco-runtime.ts +44 -0
- package/src/components/monaco/use-monaco-theme.ts +63 -0
- package/src/components/nav-rail-account-actions.tsx +104 -0
- package/src/components/server-connection/ServerConnectionGate.scss +356 -0
- package/src/components/server-connection/ServerConnectionGate.tsx +238 -0
- package/src/components/server-connection/ServerConnectionProfileModal.tsx +145 -0
- package/src/components/server-connection/ServerConnectionProfiles.tsx +113 -0
- package/src/components/server-connection/ServerConnectionUrlInput.tsx +85 -0
- package/src/components/sidebar/SidebarHeader.scss +5 -41
- package/src/components/sidebar/SidebarHeader.tsx +117 -91
- package/src/components/sidebar/SidebarHeaderSearchActions.tsx +24 -28
- package/src/components/sidebar/sidebar-search-visibility.ts +18 -0
- package/src/components/sidebar-list/SidebarListHeader.scss +246 -0
- package/src/components/sidebar-list/SidebarListHeader.tsx +146 -0
- package/src/components/workspace/ContextFilePicker.scss +9 -26
- package/src/components/workspace/ContextFilePicker.tsx +31 -113
- package/src/components/workspace/context-file-types.ts +36 -0
- package/src/components/workspace/project-file-tree/ProjectFileTree.scss +298 -0
- package/src/components/workspace/project-file-tree/ProjectFileTree.tsx +138 -0
- package/src/components/workspace/project-file-tree/ProjectFileTreeRow.tsx +167 -0
- package/src/components/workspace/project-file-tree/ProjectFileTreeRowContextMenu.tsx +106 -0
- package/src/components/workspace/project-file-tree/ProjectFileTreeRows.tsx +139 -0
- package/src/components/workspace/project-file-tree/project-file-tree-helpers.ts +101 -0
- package/src/components/workspace/project-file-tree/project-file-tree-icons.ts +93 -0
- package/src/components/workspace/project-file-tree/project-file-tree-types.ts +27 -0
- package/src/components/workspace/project-file-tree/use-project-file-tree-data.ts +197 -0
- package/src/components/workspace/project-file-tree/use-project-file-tree-selection.ts +144 -0
- package/src/hooks/chat/chat-session-target.ts +69 -0
- package/src/hooks/chat/chat-session-workspace-draft.ts +11 -4
- package/src/hooks/chat/interaction-state.ts +1 -0
- package/src/hooks/chat/optimistic-session-creation.ts +189 -0
- package/src/hooks/chat/use-chat-adapter-account-selection.tsx +156 -0
- package/src/hooks/chat/use-chat-route-bottom-panel.ts +181 -0
- package/src/hooks/chat/use-chat-route-deep-link-view.ts +33 -0
- package/src/hooks/chat/use-chat-session-actions.ts +259 -65
- package/src/hooks/chat/use-chat-session-messages.ts +71 -4
- package/src/hooks/chat/use-chat-session.ts +36 -1
- package/src/hooks/chat/workspace-file-panel-state.ts +43 -0
- package/src/hooks/session-subscription-cache.ts +25 -0
- package/src/hooks/use-chat-layout-query-state.ts +29 -0
- package/src/hooks/use-sender-header-query-state.ts +35 -0
- package/src/hooks/use-session-subscription.ts +17 -8
- package/src/hooks/useQueryParams.ts +91 -23
- package/src/i18n-resources.ts +44 -0
- package/src/i18n.ts +21 -6
- package/src/main.tsx +8 -0
- package/src/pwa.ts +46 -0
- package/src/resources/locales/en.json +741 -24
- package/src/resources/locales/zh.json +743 -26
- package/src/routes/ChatRoute.scss +110 -7
- package/src/routes/ChatRoute.tsx +11 -165
- package/src/routes/ChatRouteBottomPanel.tsx +47 -0
- package/src/routes/ChatRouteView.tsx +199 -0
- package/src/runtime-config.ts +155 -2
- package/src/server-connection-history.ts +179 -0
- package/src/store/index.ts +151 -3
- package/src/styles/global.scss +3 -0
- package/src/utils/mobile-viewport.ts +67 -0
- package/src/version-compatibility.ts +37 -0
- package/src/vite-env.d.ts +9 -0
- package/src/ws.ts +20 -9
- package/vite.config.ts +23 -1
- package/dist/assets/channel-Dnopc5A6.js +0 -1
- package/dist/assets/clone-sQthahUA.js +0 -1
- package/dist/assets/flowDiagram-v2-4f6560a1-OazrdWQO.js +0 -1
- package/dist/assets/index-o93dlo92.css +0 -32
- package/src/components/chat/NewSessionGuideCompactPanel.tsx +0 -130
- package/src/components/chat/NewSessionGuideGrid.tsx +0 -141
- package/src/components/chat/sender/@components/reference-actions/ReferencePermissionActionsPopover.tsx +0 -114
|
@@ -1,8 +1,34 @@
|
|
|
1
|
-
.chat-
|
|
1
|
+
.chat-route-layout {
|
|
2
|
+
--dock-panel-fullscreen-inset-top: 40px;
|
|
3
|
+
|
|
2
4
|
display: flex;
|
|
3
5
|
flex-direction: column;
|
|
4
6
|
flex: 1;
|
|
7
|
+
min-width: 0;
|
|
8
|
+
min-height: 0;
|
|
5
9
|
height: 100%;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
background-color: var(--bg-color);
|
|
12
|
+
position: relative;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.chat-route-layout:has(.chat-header.is-compact) {
|
|
16
|
+
--dock-panel-fullscreen-inset-top: 54px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.chat-route-layout__main {
|
|
20
|
+
display: flex;
|
|
21
|
+
flex: 1;
|
|
22
|
+
min-width: 0;
|
|
23
|
+
min-height: 0;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
transition: padding-bottom .18s ease;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.chat-container {
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
flex: 1;
|
|
6
32
|
min-width: 0;
|
|
7
33
|
min-height: 0;
|
|
8
34
|
background-color: var(--bg-color);
|
|
@@ -19,10 +45,12 @@
|
|
|
19
45
|
|
|
20
46
|
.new-session-guide-wrapper {
|
|
21
47
|
flex: 1;
|
|
48
|
+
min-height: 0;
|
|
22
49
|
display: flex;
|
|
23
50
|
align-items: center;
|
|
24
51
|
justify-content: center;
|
|
25
|
-
|
|
52
|
+
overflow: auto;
|
|
53
|
+
padding: 24px 24px 16px;
|
|
26
54
|
}
|
|
27
55
|
}
|
|
28
56
|
}
|
|
@@ -42,7 +70,7 @@
|
|
|
42
70
|
overscroll-behavior-y: contain;
|
|
43
71
|
-webkit-overflow-scrolling: touch;
|
|
44
72
|
scrollbar-gutter: stable both-edges;
|
|
45
|
-
padding:
|
|
73
|
+
padding: 0 12px 0;
|
|
46
74
|
position: relative;
|
|
47
75
|
opacity: 0;
|
|
48
76
|
background-color: var(--bg-color);
|
|
@@ -251,10 +279,80 @@
|
|
|
251
279
|
padding-bottom .4s cubic-bezier(.4, 0, .2, 1);
|
|
252
280
|
}
|
|
253
281
|
|
|
282
|
+
.chat-thinking-indicator {
|
|
283
|
+
display: flex;
|
|
284
|
+
justify-content: flex-start;
|
|
285
|
+
padding: 0;
|
|
286
|
+
min-width: 0;
|
|
287
|
+
width: 100%;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.chat-thinking-indicator__text {
|
|
291
|
+
display: inline-flex;
|
|
292
|
+
align-items: center;
|
|
293
|
+
justify-content: flex-start;
|
|
294
|
+
position: relative;
|
|
295
|
+
isolation: isolate;
|
|
296
|
+
overflow: hidden;
|
|
297
|
+
max-width: min(90%, 100%);
|
|
298
|
+
font-size: 14px;
|
|
299
|
+
line-height: 1.6;
|
|
300
|
+
font-weight: 400;
|
|
301
|
+
white-space: nowrap;
|
|
302
|
+
text-align: left;
|
|
303
|
+
color: var(--text-color);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.chat-thinking-indicator__text::after {
|
|
307
|
+
content: '';
|
|
308
|
+
position: absolute;
|
|
309
|
+
inset: -1px -20%;
|
|
310
|
+
border-radius: 999px;
|
|
311
|
+
pointer-events: none;
|
|
312
|
+
background: linear-gradient(
|
|
313
|
+
100deg,
|
|
314
|
+
transparent 18%,
|
|
315
|
+
rgba(255, 255, 255, 0) 34%,
|
|
316
|
+
rgba(255, 255, 255, .08) 42%,
|
|
317
|
+
rgba(255, 255, 255, .82) 50%,
|
|
318
|
+
rgba(255, 255, 255, .08) 58%,
|
|
319
|
+
rgba(255, 255, 255, 0) 66%,
|
|
320
|
+
transparent 82%
|
|
321
|
+
);
|
|
322
|
+
mix-blend-mode: screen;
|
|
323
|
+
transform: translate3d(-180%, 0, 0);
|
|
324
|
+
animation: chat-thinking-indicator-scan 2s ease-in-out infinite;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
@keyframes chat-thinking-indicator-scan {
|
|
328
|
+
from {
|
|
329
|
+
transform: translate3d(-180%, 0, 0);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
to {
|
|
333
|
+
transform: translate3d(180%, 0, 0);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
@media (prefers-reduced-motion: reduce) {
|
|
338
|
+
.chat-thinking-indicator__text::after {
|
|
339
|
+
animation: none;
|
|
340
|
+
opacity: 0;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
254
344
|
.chat-composer-stack {
|
|
255
345
|
flex: 0;
|
|
256
346
|
min-width: 0;
|
|
257
|
-
padding: 0 12px
|
|
347
|
+
padding: 0 12px
|
|
348
|
+
calc(
|
|
349
|
+
max(8px, env(safe-area-inset-bottom)) +
|
|
350
|
+
var(--vf-keyboard-inset-bottom, 0px)
|
|
351
|
+
);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.chat-route-layout.has-bottom-dock .chat-composer-stack {
|
|
355
|
+
padding-bottom: calc(6px + var(--vf-keyboard-inset-bottom, 0px));
|
|
258
356
|
}
|
|
259
357
|
|
|
260
358
|
.chat-composer-stack__inner {
|
|
@@ -291,7 +389,10 @@
|
|
|
291
389
|
|
|
292
390
|
.scroll-bottom-btn {
|
|
293
391
|
position: sticky;
|
|
294
|
-
bottom:
|
|
392
|
+
bottom: calc(
|
|
393
|
+
max(16px, env(safe-area-inset-bottom)) +
|
|
394
|
+
var(--vf-keyboard-inset-bottom, 0px)
|
|
395
|
+
);
|
|
295
396
|
left: 100%;
|
|
296
397
|
transform: translateX(-44px);
|
|
297
398
|
width: 36px;
|
|
@@ -408,8 +509,10 @@
|
|
|
408
509
|
|
|
409
510
|
.chat-composer-stack {
|
|
410
511
|
padding: 0 max(12px, env(safe-area-inset-right))
|
|
411
|
-
|
|
412
|
-
|
|
512
|
+
calc(
|
|
513
|
+
max(8px, env(safe-area-inset-bottom)) +
|
|
514
|
+
var(--vf-keyboard-inset-bottom, 0px)
|
|
515
|
+
) max(12px, env(safe-area-inset-left));
|
|
413
516
|
}
|
|
414
517
|
|
|
415
518
|
.chat-settings-panel {
|
package/src/routes/ChatRoute.tsx
CHANGED
|
@@ -1,36 +1,32 @@
|
|
|
1
1
|
import './ChatRoute.scss'
|
|
2
2
|
|
|
3
3
|
import { Button, Empty } from 'antd'
|
|
4
|
-
import {
|
|
5
|
-
import { useEffect, useMemo, useRef } from 'react'
|
|
4
|
+
import { useAtomValue } from 'jotai'
|
|
6
5
|
import { useTranslation } from 'react-i18next'
|
|
7
|
-
import { useNavigate, useParams
|
|
6
|
+
import { useNavigate, useParams } from 'react-router-dom'
|
|
8
7
|
import useSWR from 'swr'
|
|
9
8
|
|
|
10
9
|
import type { Session } from '@vibe-forge/core'
|
|
11
10
|
|
|
12
11
|
import { listSessions } from '#~/api'
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
import {
|
|
16
|
-
import { ChatTimelineView } from '#~/components/chat/ChatTimelineView.js'
|
|
17
|
-
import { buildChatHistoryStatusNotices } from '#~/components/chat/messages/build-chat-history-status-notices'
|
|
18
|
-
import { ChatTerminalView } from '#~/components/chat/terminal/ChatTerminalView.js'
|
|
19
|
-
import { useChatSession } from '#~/hooks/chat/use-chat-session'
|
|
20
|
-
import { useTerminalDockVisibility } from '#~/hooks/chat/use-terminal-dock-visibility'
|
|
21
|
-
import { useResponsiveLayout } from '#~/hooks/use-responsive-layout'
|
|
22
|
-
import { isMobileSidebarOpenAtom } from '#~/store/index'
|
|
12
|
+
import { optimisticSessionCreationsAtom } from '#~/hooks/chat/optimistic-session-creation'
|
|
13
|
+
|
|
14
|
+
import { ChatRouteView } from './ChatRouteView'
|
|
23
15
|
|
|
24
16
|
export function ChatRoute() {
|
|
25
17
|
const { t } = useTranslation()
|
|
26
18
|
const { sessionId } = useParams()
|
|
27
19
|
const navigate = useNavigate()
|
|
20
|
+
const optimisticCreations = useAtomValue(optimisticSessionCreationsAtom)
|
|
28
21
|
const { data: sessionsRes, isLoading } = useSWR<{ sessions: Session[] }>(
|
|
29
22
|
sessionId ? '/api/sessions' : null,
|
|
30
23
|
() => listSessions('active')
|
|
31
24
|
)
|
|
32
|
-
const
|
|
33
|
-
|
|
25
|
+
const optimisticCreation = sessionId == null ? undefined : optimisticCreations[sessionId]
|
|
26
|
+
const session = sessionId == null
|
|
27
|
+
? undefined
|
|
28
|
+
: optimisticCreation?.session ?? sessionsRes?.sessions.find(item => item.id === sessionId)
|
|
29
|
+
if (sessionId != null && isLoading && optimisticCreation == null) return null
|
|
34
30
|
if (sessionId != null && session == null) {
|
|
35
31
|
return (
|
|
36
32
|
<div className='chat-route__empty-state'>
|
|
@@ -42,153 +38,3 @@ export function ChatRoute() {
|
|
|
42
38
|
|
|
43
39
|
return <ChatRouteView session={session} />
|
|
44
40
|
}
|
|
45
|
-
|
|
46
|
-
function ChatRouteView({ session }: { session?: Session }) {
|
|
47
|
-
const { t } = useTranslation()
|
|
48
|
-
const [searchParams] = useSearchParams()
|
|
49
|
-
const navigate = useNavigate()
|
|
50
|
-
const { isCompactLayout } = useResponsiveLayout()
|
|
51
|
-
const setIsMobileSidebarOpen = useSetAtom(isMobileSidebarOpenAtom)
|
|
52
|
-
const {
|
|
53
|
-
messages,
|
|
54
|
-
sessionInfo,
|
|
55
|
-
queuedMessages,
|
|
56
|
-
interactionRequest,
|
|
57
|
-
isReady,
|
|
58
|
-
errorState,
|
|
59
|
-
retryConnection,
|
|
60
|
-
activeView,
|
|
61
|
-
isTerminalOpen,
|
|
62
|
-
setActiveView,
|
|
63
|
-
setIsTerminalOpen,
|
|
64
|
-
handleInteractionResponse,
|
|
65
|
-
setMessages,
|
|
66
|
-
placeholder,
|
|
67
|
-
modelMenuGroups,
|
|
68
|
-
modelSearchOptions,
|
|
69
|
-
recommendedModelOptions,
|
|
70
|
-
servicePreviewModelOptions,
|
|
71
|
-
toggleRecommendedModel,
|
|
72
|
-
updatingRecommendedModelValue,
|
|
73
|
-
selectedModel,
|
|
74
|
-
modelForQuery,
|
|
75
|
-
setSelectedModel,
|
|
76
|
-
effort,
|
|
77
|
-
setEffort,
|
|
78
|
-
effortOptions,
|
|
79
|
-
permissionMode,
|
|
80
|
-
setPermissionMode,
|
|
81
|
-
permissionModeOptions,
|
|
82
|
-
selectedAdapter,
|
|
83
|
-
setSelectedAdapter,
|
|
84
|
-
adapterOptions,
|
|
85
|
-
hasAvailableModels,
|
|
86
|
-
modelUnavailable
|
|
87
|
-
} = useChatSession({ session })
|
|
88
|
-
const targetMessageId = searchParams.get('messageId') ?? undefined
|
|
89
|
-
const targetToolUseId = searchParams.get('toolUseId') ?? undefined
|
|
90
|
-
const isDebugMode = searchParams.get('debug') === 'true'
|
|
91
|
-
const deepLinkTargetKey = targetToolUseId?.trim()
|
|
92
|
-
? `tool:${targetToolUseId.trim()}`
|
|
93
|
-
: targetMessageId?.trim()
|
|
94
|
-
? `message:${targetMessageId.trim()}`
|
|
95
|
-
: ''
|
|
96
|
-
const historyStatusNotices = useMemo(() =>
|
|
97
|
-
buildChatHistoryStatusNotices({
|
|
98
|
-
errorState,
|
|
99
|
-
isDebugMode,
|
|
100
|
-
modelUnavailable,
|
|
101
|
-
t
|
|
102
|
-
}), [errorState, isDebugMode, modelUnavailable, t])
|
|
103
|
-
const isEmptyNewSession = !session?.id && messages.length === 0 && historyStatusNotices.length === 0
|
|
104
|
-
const resolvedActiveView = session?.id != null ? activeView : 'history'
|
|
105
|
-
const shouldShowTerminal = session?.id != null && isTerminalOpen
|
|
106
|
-
const { isRendered: isTerminalRendered, isVisible: isTerminalVisible } = useTerminalDockVisibility(
|
|
107
|
-
shouldShowTerminal
|
|
108
|
-
)
|
|
109
|
-
const handledDeepLinkTargetRef = useRef('')
|
|
110
|
-
useEffect(() => {
|
|
111
|
-
if (deepLinkTargetKey === '') {
|
|
112
|
-
handledDeepLinkTargetRef.current = ''
|
|
113
|
-
} else if (handledDeepLinkTargetRef.current !== deepLinkTargetKey) {
|
|
114
|
-
handledDeepLinkTargetRef.current = deepLinkTargetKey
|
|
115
|
-
if (activeView !== 'history') {
|
|
116
|
-
setActiveView('history')
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}, [activeView, deepLinkTargetKey, setActiveView])
|
|
120
|
-
return (
|
|
121
|
-
<div
|
|
122
|
-
className={`chat-container ${isReady ? 'ready' : ''} ${isEmptyNewSession ? 'is-new-session' : ''} ${
|
|
123
|
-
shouldShowTerminal ? 'has-terminal' : ''
|
|
124
|
-
}`}
|
|
125
|
-
>
|
|
126
|
-
{(session?.id != null || isCompactLayout) && (
|
|
127
|
-
<ChatHeader
|
|
128
|
-
sessionInfo={sessionInfo}
|
|
129
|
-
sessionId={session?.id}
|
|
130
|
-
sessionTitle={session?.title}
|
|
131
|
-
sessionStatus={session?.status}
|
|
132
|
-
isStarred={session?.isStarred}
|
|
133
|
-
isArchived={session?.isArchived}
|
|
134
|
-
tags={session?.tags}
|
|
135
|
-
lastMessage={session?.lastMessage}
|
|
136
|
-
lastUserMessage={session?.lastUserMessage}
|
|
137
|
-
activeView={resolvedActiveView}
|
|
138
|
-
isTerminalOpen={isTerminalOpen}
|
|
139
|
-
onCreateSession={() => {
|
|
140
|
-
void navigate('/')
|
|
141
|
-
}}
|
|
142
|
-
onOpenSidebar={() => {
|
|
143
|
-
setIsMobileSidebarOpen(true)
|
|
144
|
-
}}
|
|
145
|
-
onViewChange={setActiveView}
|
|
146
|
-
onToggleTerminal={() => setIsTerminalOpen(!isTerminalOpen)}
|
|
147
|
-
/>
|
|
148
|
-
)}
|
|
149
|
-
{resolvedActiveView === 'history' && (
|
|
150
|
-
<ChatHistoryView
|
|
151
|
-
isReady={isReady}
|
|
152
|
-
messages={messages}
|
|
153
|
-
session={session}
|
|
154
|
-
targetMessageId={targetMessageId}
|
|
155
|
-
targetToolUseId={targetToolUseId}
|
|
156
|
-
sessionInfo={sessionInfo}
|
|
157
|
-
historyStatusNotices={historyStatusNotices}
|
|
158
|
-
queuedMessages={queuedMessages}
|
|
159
|
-
onRetryConnection={retryConnection}
|
|
160
|
-
interactionRequest={interactionRequest}
|
|
161
|
-
onInteractionResponse={handleInteractionResponse}
|
|
162
|
-
setMessages={setMessages}
|
|
163
|
-
onClearMessages={() => setMessages([])}
|
|
164
|
-
placeholder={placeholder}
|
|
165
|
-
modelMenuGroups={modelMenuGroups}
|
|
166
|
-
modelSearchOptions={modelSearchOptions}
|
|
167
|
-
recommendedModelOptions={recommendedModelOptions}
|
|
168
|
-
servicePreviewModelOptions={servicePreviewModelOptions}
|
|
169
|
-
onToggleRecommendedModel={toggleRecommendedModel}
|
|
170
|
-
updatingRecommendedModelValue={updatingRecommendedModelValue}
|
|
171
|
-
selectedModel={selectedModel}
|
|
172
|
-
modelForQuery={modelForQuery}
|
|
173
|
-
onModelChange={setSelectedModel}
|
|
174
|
-
effort={effort}
|
|
175
|
-
effortOptions={effortOptions}
|
|
176
|
-
onEffortChange={setEffort}
|
|
177
|
-
permissionMode={permissionMode}
|
|
178
|
-
permissionModeOptions={permissionModeOptions}
|
|
179
|
-
onPermissionModeChange={setPermissionMode}
|
|
180
|
-
selectedAdapter={selectedAdapter}
|
|
181
|
-
adapterOptions={adapterOptions}
|
|
182
|
-
onAdapterChange={setSelectedAdapter}
|
|
183
|
-
modelUnavailable={modelUnavailable}
|
|
184
|
-
hasAvailableModels={hasAvailableModels}
|
|
185
|
-
/>
|
|
186
|
-
)}
|
|
187
|
-
{resolvedActiveView === 'timeline' && <ChatTimelineView messages={messages} />}
|
|
188
|
-
{resolvedActiveView === 'settings' && session?.id &&
|
|
189
|
-
<ChatSettingsView session={session} sessionInfo={sessionInfo} onClose={() => setActiveView('history')} />}
|
|
190
|
-
{isTerminalRendered && session?.id &&
|
|
191
|
-
<ChatTerminalView isOpen={isTerminalVisible} sessionId={session.id} onClose={() => setIsTerminalOpen(false)} />}
|
|
192
|
-
</div>
|
|
193
|
-
)
|
|
194
|
-
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ChatTerminalView } from '#~/components/chat/terminal/ChatTerminalView.js'
|
|
2
|
+
import { WorkspaceFileEditorView } from '#~/components/chat/workspace-file-editor/WorkspaceFileEditorView'
|
|
3
|
+
import type { ChatRouteBottomPanelState } from '#~/hooks/chat/use-chat-route-bottom-panel'
|
|
4
|
+
|
|
5
|
+
export function ChatRouteBottomPanel({
|
|
6
|
+
bottomPanel,
|
|
7
|
+
isRendered,
|
|
8
|
+
isVisible,
|
|
9
|
+
sessionId,
|
|
10
|
+
terminalSessionId
|
|
11
|
+
}: {
|
|
12
|
+
bottomPanel: ChatRouteBottomPanelState
|
|
13
|
+
isRendered: boolean
|
|
14
|
+
isVisible: boolean
|
|
15
|
+
sessionId?: string
|
|
16
|
+
terminalSessionId: string
|
|
17
|
+
}) {
|
|
18
|
+
if (!isRendered) {
|
|
19
|
+
return null
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<>
|
|
24
|
+
{bottomPanel.shouldShowTerminal &&
|
|
25
|
+
<ChatTerminalView
|
|
26
|
+
key={terminalSessionId}
|
|
27
|
+
isOpen={isVisible}
|
|
28
|
+
sessionId={terminalSessionId}
|
|
29
|
+
onClose={bottomPanel.handleCloseTerminal}
|
|
30
|
+
/>}
|
|
31
|
+
{bottomPanel.shouldShowFileEditor && bottomPanel.selectedWorkspaceFilePath != null &&
|
|
32
|
+
<WorkspaceFileEditorView
|
|
33
|
+
key={bottomPanel.selectedWorkspaceFilePath}
|
|
34
|
+
isOpen={isVisible}
|
|
35
|
+
openPaths={bottomPanel.openWorkspaceFilePaths}
|
|
36
|
+
path={bottomPanel.selectedWorkspaceFilePath}
|
|
37
|
+
sessionId={sessionId}
|
|
38
|
+
onClose={bottomPanel.handleCloseWorkspaceFile}
|
|
39
|
+
onCloseAllPaths={bottomPanel.handleCloseAllWorkspaceFileTabs}
|
|
40
|
+
onCloseOtherPaths={bottomPanel.handleCloseOtherWorkspaceFileTabs}
|
|
41
|
+
onClosePath={bottomPanel.handleCloseWorkspaceFileTab}
|
|
42
|
+
onClosePathsToRight={bottomPanel.handleCloseWorkspaceFileTabsToRight}
|
|
43
|
+
onSelectPath={bottomPanel.handleSelectWorkspaceFile}
|
|
44
|
+
/>}
|
|
45
|
+
</>
|
|
46
|
+
)
|
|
47
|
+
}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { useSetAtom } from 'jotai'
|
|
2
|
+
import { useMemo, useState } from 'react'
|
|
3
|
+
import { useTranslation } from 'react-i18next'
|
|
4
|
+
import { useNavigate, useSearchParams } from 'react-router-dom'
|
|
5
|
+
|
|
6
|
+
import type { Session } from '@vibe-forge/core'
|
|
7
|
+
|
|
8
|
+
import { ChatHeader } from '#~/components/chat/ChatHeader.js'
|
|
9
|
+
import { ChatHistoryView } from '#~/components/chat/ChatHistoryView.js'
|
|
10
|
+
import { ChatSettingsView } from '#~/components/chat/ChatSettingsView.js'
|
|
11
|
+
import { ChatTimelineView } from '#~/components/chat/ChatTimelineView.js'
|
|
12
|
+
import { buildChatHistoryStatusNotices } from '#~/components/chat/messages/build-chat-history-status-notices'
|
|
13
|
+
import { ChatWorkspaceDrawer } from '#~/components/chat/workspace-drawer/ChatWorkspaceDrawer'
|
|
14
|
+
import type { ContextPickerFile, ContextReferenceRequest } from '#~/components/workspace/context-file-types'
|
|
15
|
+
import { useChatRouteBottomPanel } from '#~/hooks/chat/use-chat-route-bottom-panel'
|
|
16
|
+
import { useChatRouteDeepLinkView } from '#~/hooks/chat/use-chat-route-deep-link-view'
|
|
17
|
+
import { useChatSession } from '#~/hooks/chat/use-chat-session'
|
|
18
|
+
import { useTerminalDockVisibility } from '#~/hooks/chat/use-terminal-dock-visibility'
|
|
19
|
+
import { useChatLayoutQueryState } from '#~/hooks/use-chat-layout-query-state'
|
|
20
|
+
import { useResponsiveLayout } from '#~/hooks/use-responsive-layout'
|
|
21
|
+
import { isMobileSidebarOpenAtom } from '#~/store/index'
|
|
22
|
+
|
|
23
|
+
import { ChatRouteBottomPanel } from './ChatRouteBottomPanel'
|
|
24
|
+
|
|
25
|
+
const WORKSPACE_TERMINAL_SESSION_ID = '__workspace__'
|
|
26
|
+
|
|
27
|
+
export function ChatRouteView({ session }: { session?: Session }) {
|
|
28
|
+
const { t } = useTranslation()
|
|
29
|
+
const [searchParams] = useSearchParams()
|
|
30
|
+
const [contextReferenceRequest, setContextReferenceRequest] = useState<ContextReferenceRequest | null>(null)
|
|
31
|
+
const navigate = useNavigate()
|
|
32
|
+
const { isCompactLayout } = useResponsiveLayout()
|
|
33
|
+
const { isWorkspaceDrawerOpen, setWorkspaceDrawerOpen } = useChatLayoutQueryState()
|
|
34
|
+
const setIsMobileSidebarOpen = useSetAtom(isMobileSidebarOpenAtom)
|
|
35
|
+
const {
|
|
36
|
+
messages,
|
|
37
|
+
sessionInfo,
|
|
38
|
+
queuedMessages,
|
|
39
|
+
interactionRequest,
|
|
40
|
+
isReady,
|
|
41
|
+
errorState,
|
|
42
|
+
retryConnection,
|
|
43
|
+
activeView,
|
|
44
|
+
isTerminalOpen,
|
|
45
|
+
setActiveView,
|
|
46
|
+
setIsTerminalOpen,
|
|
47
|
+
handleInteractionResponse,
|
|
48
|
+
setMessages,
|
|
49
|
+
placeholder,
|
|
50
|
+
modelMenuGroups,
|
|
51
|
+
modelSearchOptions,
|
|
52
|
+
recommendedModelOptions,
|
|
53
|
+
servicePreviewModelOptions,
|
|
54
|
+
toggleRecommendedModel,
|
|
55
|
+
updatingRecommendedModelValue,
|
|
56
|
+
selectedModel,
|
|
57
|
+
modelForQuery,
|
|
58
|
+
setSelectedModel,
|
|
59
|
+
effort,
|
|
60
|
+
setEffort,
|
|
61
|
+
effortOptions,
|
|
62
|
+
permissionMode,
|
|
63
|
+
setPermissionMode,
|
|
64
|
+
permissionModeOptions,
|
|
65
|
+
selectedAdapter,
|
|
66
|
+
setSelectedAdapter,
|
|
67
|
+
selectedAccount,
|
|
68
|
+
setSelectedAccount,
|
|
69
|
+
accountOptions,
|
|
70
|
+
showAccountSelector,
|
|
71
|
+
adapterOptions,
|
|
72
|
+
hasAvailableModels,
|
|
73
|
+
modelUnavailable
|
|
74
|
+
} = useChatSession({ session })
|
|
75
|
+
const targetMessageId = searchParams.get('messageId') ?? undefined
|
|
76
|
+
const targetToolUseId = searchParams.get('toolUseId') ?? undefined
|
|
77
|
+
const isDebugMode = searchParams.get('debug') === 'true'
|
|
78
|
+
const historyStatusNotices = useMemo(() =>
|
|
79
|
+
buildChatHistoryStatusNotices({
|
|
80
|
+
errorState,
|
|
81
|
+
isDebugMode,
|
|
82
|
+
modelUnavailable,
|
|
83
|
+
t
|
|
84
|
+
}), [errorState, isDebugMode, modelUnavailable, t])
|
|
85
|
+
const isEmptyNewSession = !session?.id && messages.length === 0 && historyStatusNotices.length === 0
|
|
86
|
+
const handleReferenceWorkspacePaths = (files: ContextPickerFile[]) => {
|
|
87
|
+
if (files.length === 0) {
|
|
88
|
+
return
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
setContextReferenceRequest(current => ({
|
|
92
|
+
id: (current?.id ?? 0) + 1,
|
|
93
|
+
files
|
|
94
|
+
}))
|
|
95
|
+
}
|
|
96
|
+
const resolvedActiveView = session?.id != null ? activeView : 'history'
|
|
97
|
+
const terminalSessionId = session?.id ?? WORKSPACE_TERMINAL_SESSION_ID
|
|
98
|
+
const bottomPanel = useChatRouteBottomPanel({ isTerminalOpen, session, setIsTerminalOpen })
|
|
99
|
+
const shouldShowWorkspaceDrawer = isWorkspaceDrawerOpen && !isCompactLayout
|
|
100
|
+
const { isRendered: isBottomPanelRendered, isVisible: isBottomPanelVisible } = useTerminalDockVisibility(
|
|
101
|
+
bottomPanel.shouldShowBottomPanel
|
|
102
|
+
)
|
|
103
|
+
useChatRouteDeepLinkView({ activeView, setActiveView, targetMessageId, targetToolUseId })
|
|
104
|
+
return (
|
|
105
|
+
<div
|
|
106
|
+
className={`chat-route-layout ${shouldShowWorkspaceDrawer ? 'has-workspace-drawer' : ''} ${
|
|
107
|
+
bottomPanel.shouldShowTerminal ? 'has-terminal' : ''
|
|
108
|
+
} ${bottomPanel.shouldShowBottomPanel ? 'has-bottom-dock' : ''}`}
|
|
109
|
+
>
|
|
110
|
+
<div className='chat-route-layout__main'>
|
|
111
|
+
<div
|
|
112
|
+
className={`chat-container ${isReady ? 'ready' : ''} ${isEmptyNewSession ? 'is-new-session' : ''}`}
|
|
113
|
+
>
|
|
114
|
+
<ChatHeader
|
|
115
|
+
sessionInfo={sessionInfo}
|
|
116
|
+
sessionId={session?.id}
|
|
117
|
+
sessionTitle={session?.title}
|
|
118
|
+
sessionStatus={session?.status}
|
|
119
|
+
isStarred={session?.isStarred}
|
|
120
|
+
isArchived={session?.isArchived}
|
|
121
|
+
tags={session?.tags}
|
|
122
|
+
lastMessage={session?.lastMessage}
|
|
123
|
+
lastUserMessage={session?.lastUserMessage}
|
|
124
|
+
activeView={resolvedActiveView}
|
|
125
|
+
isTerminalOpen={bottomPanel.shouldShowTerminal}
|
|
126
|
+
isWorkspaceDrawerOpen={shouldShowWorkspaceDrawer}
|
|
127
|
+
onCreateSession={() => void navigate('/')}
|
|
128
|
+
onOpenSidebar={() => setIsMobileSidebarOpen(true)}
|
|
129
|
+
onViewChange={setActiveView}
|
|
130
|
+
onToggleTerminal={bottomPanel.handleToggleTerminal}
|
|
131
|
+
onToggleWorkspaceDrawer={() => setWorkspaceDrawerOpen(!isWorkspaceDrawerOpen)}
|
|
132
|
+
/>
|
|
133
|
+
{resolvedActiveView === 'history' && (
|
|
134
|
+
<ChatHistoryView
|
|
135
|
+
isReady={isReady}
|
|
136
|
+
messages={messages}
|
|
137
|
+
session={session}
|
|
138
|
+
targetMessageId={targetMessageId}
|
|
139
|
+
targetToolUseId={targetToolUseId}
|
|
140
|
+
sessionInfo={sessionInfo}
|
|
141
|
+
historyStatusNotices={historyStatusNotices}
|
|
142
|
+
queuedMessages={queuedMessages}
|
|
143
|
+
onRetryConnection={retryConnection}
|
|
144
|
+
interactionRequest={interactionRequest}
|
|
145
|
+
onInteractionResponse={handleInteractionResponse}
|
|
146
|
+
setMessages={setMessages}
|
|
147
|
+
onClearMessages={() => setMessages([])}
|
|
148
|
+
placeholder={placeholder}
|
|
149
|
+
modelMenuGroups={modelMenuGroups}
|
|
150
|
+
modelSearchOptions={modelSearchOptions}
|
|
151
|
+
recommendedModelOptions={recommendedModelOptions}
|
|
152
|
+
servicePreviewModelOptions={servicePreviewModelOptions}
|
|
153
|
+
onToggleRecommendedModel={toggleRecommendedModel}
|
|
154
|
+
updatingRecommendedModelValue={updatingRecommendedModelValue}
|
|
155
|
+
selectedModel={selectedModel}
|
|
156
|
+
modelForQuery={modelForQuery}
|
|
157
|
+
onModelChange={setSelectedModel}
|
|
158
|
+
effort={effort}
|
|
159
|
+
effortOptions={effortOptions}
|
|
160
|
+
onEffortChange={setEffort}
|
|
161
|
+
permissionMode={permissionMode}
|
|
162
|
+
permissionModeOptions={permissionModeOptions}
|
|
163
|
+
onPermissionModeChange={setPermissionMode}
|
|
164
|
+
selectedAdapter={selectedAdapter}
|
|
165
|
+
adapterOptions={adapterOptions}
|
|
166
|
+
onAdapterChange={setSelectedAdapter}
|
|
167
|
+
selectedAccount={selectedAccount}
|
|
168
|
+
accountOptions={accountOptions}
|
|
169
|
+
showAccountSelector={showAccountSelector}
|
|
170
|
+
onAccountChange={setSelectedAccount}
|
|
171
|
+
modelUnavailable={modelUnavailable}
|
|
172
|
+
hasAvailableModels={hasAvailableModels}
|
|
173
|
+
contextReferenceRequest={contextReferenceRequest}
|
|
174
|
+
/>
|
|
175
|
+
)}
|
|
176
|
+
|
|
177
|
+
{resolvedActiveView === 'timeline' && <ChatTimelineView messages={messages} />}
|
|
178
|
+
{resolvedActiveView === 'settings' && session?.id &&
|
|
179
|
+
<ChatSettingsView session={session} sessionInfo={sessionInfo} onClose={() => setActiveView('history')} />}
|
|
180
|
+
</div>
|
|
181
|
+
{shouldShowWorkspaceDrawer && (
|
|
182
|
+
<ChatWorkspaceDrawer
|
|
183
|
+
selectedFilePath={bottomPanel.selectedWorkspaceFilePath}
|
|
184
|
+
sessionId={session?.id}
|
|
185
|
+
onReferencePaths={handleReferenceWorkspacePaths}
|
|
186
|
+
onOpenFile={bottomPanel.handleOpenWorkspaceFile}
|
|
187
|
+
/>
|
|
188
|
+
)}
|
|
189
|
+
</div>
|
|
190
|
+
<ChatRouteBottomPanel
|
|
191
|
+
bottomPanel={bottomPanel}
|
|
192
|
+
isRendered={isBottomPanelRendered}
|
|
193
|
+
isVisible={isBottomPanelVisible}
|
|
194
|
+
sessionId={session?.id}
|
|
195
|
+
terminalSessionId={terminalSessionId}
|
|
196
|
+
/>
|
|
197
|
+
</div>
|
|
198
|
+
)
|
|
199
|
+
}
|