@myrialabs/clopen 0.2.1 → 0.2.3
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/.dockerignore +5 -0
- package/.env.example +2 -5
- package/CONTRIBUTING.md +4 -0
- package/README.md +4 -2
- package/backend/{lib/auth → auth}/auth-service.ts +2 -2
- package/backend/{lib/chat → chat}/stream-manager.ts +1 -1
- package/backend/{lib/database → database}/queries/message-queries.ts +42 -0
- package/backend/{lib/database → database}/utils/connection.ts +5 -5
- package/backend/{lib/engine → engine}/adapters/claude/environment.ts +3 -4
- package/backend/{lib/engine → engine}/adapters/opencode/message-converter.ts +1 -1
- package/backend/{lib/engine → engine}/adapters/opencode/server.ts +7 -1
- package/backend/{lib/files → files}/file-watcher.ts +1 -1
- package/backend/{lib/git → git}/git-executor.ts +3 -2
- package/backend/index.ts +16 -16
- package/backend/{lib/mcp → mcp}/README.md +68 -79
- package/backend/{lib/mcp → mcp}/config.ts +1 -1
- package/backend/{lib/mcp → mcp}/servers/browser-automation/actions.ts +4 -4
- package/backend/{lib/mcp → mcp}/servers/browser-automation/browser.ts +3 -3
- package/backend/{lib/mcp → mcp}/servers/browser-automation/inspection.ts +3 -3
- package/backend/middleware/cors.ts +1 -1
- package/backend/middleware/error-handler.ts +1 -1
- package/backend/{lib/preview → preview}/browser/browser-preview-service.ts +1 -1
- package/backend/{lib/preview → preview}/browser/browser-tab-manager.ts +1 -1
- package/backend/{lib/preview → preview}/browser/types.ts +1 -1
- package/backend/{lib/project → project}/status-manager.ts +223 -223
- package/backend/{lib/snapshot → snapshot}/blob-store.ts +2 -2
- package/backend/{lib/terminal → terminal}/shell-utils.ts +1 -1
- package/backend/{lib/shared → utils}/env.ts +13 -15
- package/backend/{lib/shared → utils}/index.ts +4 -1
- package/backend/utils/paths.ts +11 -0
- package/backend/{lib/shared → utils}/port-utils.ts +19 -6
- package/backend/{lib/utils → utils}/ws.ts +2 -2
- package/backend/ws/README.md +9 -9
- package/backend/ws/auth/invites.ts +2 -2
- package/backend/ws/auth/login.ts +9 -9
- package/backend/ws/auth/status.ts +2 -2
- package/backend/ws/auth/users.ts +1 -1
- package/backend/ws/chat/background.ts +2 -2
- package/backend/ws/chat/stream.ts +3 -3
- package/backend/ws/engine/claude/accounts.ts +4 -4
- package/backend/ws/engine/claude/status.ts +1 -1
- package/backend/ws/files/read.ts +2 -2
- package/backend/ws/files/watch.ts +2 -2
- package/backend/ws/files/write.ts +1 -1
- package/backend/ws/git/branch.ts +2 -2
- package/backend/ws/git/commit.ts +2 -2
- package/backend/ws/git/conflict.ts +2 -2
- package/backend/ws/git/diff.ts +2 -2
- package/backend/ws/git/log.ts +2 -2
- package/backend/ws/git/remote.ts +2 -2
- package/backend/ws/git/staging.ts +2 -2
- package/backend/ws/git/status.ts +3 -3
- package/backend/ws/messages/crud.ts +53 -1
- package/backend/ws/preview/browser/cleanup.ts +2 -2
- package/backend/ws/preview/browser/console.ts +2 -2
- package/backend/ws/preview/browser/interact.ts +2 -2
- package/backend/ws/preview/browser/mcp.ts +1 -1
- package/backend/ws/preview/browser/native-ui.ts +2 -2
- package/backend/ws/preview/browser/stats.ts +2 -2
- package/backend/ws/preview/browser/tab-info.ts +2 -2
- package/backend/ws/preview/browser/tab.ts +2 -2
- package/backend/ws/preview/browser/webcodecs.ts +2 -2
- package/backend/ws/projects/crud.ts +3 -3
- package/backend/ws/projects/presence.ts +3 -3
- package/backend/ws/projects/status.ts +3 -3
- package/backend/ws/sessions/crud.ts +2 -2
- package/backend/ws/settings/crud.ts +2 -2
- package/backend/ws/snapshot/restore.ts +5 -5
- package/backend/ws/snapshot/timeline.ts +3 -3
- package/backend/ws/system/operations.ts +1 -1
- package/backend/ws/terminal/persistence.ts +3 -3
- package/backend/ws/terminal/session.ts +6 -6
- package/backend/ws/terminal/stream.ts +2 -2
- package/backend/ws/tunnel/operations.ts +1 -1
- package/backend/ws/user/crud.ts +4 -4
- package/bin/clopen.ts +15 -15
- package/docker-compose.yml +31 -0
- package/frontend/App.svelte +13 -13
- package/frontend/{lib/components → components}/auth/InvitePage.svelte +2 -2
- package/frontend/{lib/components → components}/auth/LoginPage.svelte +1 -1
- package/frontend/{lib/components → components}/auth/SetupPage.svelte +49 -17
- package/frontend/{lib/components → components}/chat/ChatInterface.svelte +14 -14
- package/frontend/{lib/components → components}/chat/formatters/ErrorMessage.svelte +1 -1
- package/frontend/{lib/components → components}/chat/formatters/MessageFormatter.svelte +4 -4
- package/frontend/{lib/components → components}/chat/formatters/TextMessage.svelte +1 -1
- package/frontend/{lib/components → components}/chat/formatters/Tools.svelte +1 -1
- package/frontend/{lib/components → components}/chat/input/ChatInput.svelte +12 -12
- package/frontend/{lib/components → components}/chat/input/components/ChatInputActions.svelte +1 -1
- package/frontend/{lib/components → components}/chat/input/components/EditModeIndicator.svelte +2 -2
- package/frontend/{lib/components → components}/chat/input/components/EngineModelPicker.svelte +9 -9
- package/frontend/{lib/components → components}/chat/input/components/FileAttachmentPreview.svelte +1 -1
- package/frontend/{lib/components → components}/chat/input/components/LoadingIndicator.svelte +2 -2
- package/frontend/{lib/components → components}/chat/input/composables/use-chat-actions.svelte.ts +8 -8
- package/frontend/{lib/components → components}/chat/input/composables/use-file-handling.svelte.ts +1 -1
- package/frontend/{lib/components → components}/chat/input/composables/use-input-state.svelte.ts +6 -6
- package/frontend/{lib/components → components}/chat/message/ChatMessage.svelte +8 -8
- package/frontend/{lib/components → components}/chat/message/ChatMessages.svelte +7 -7
- package/frontend/{lib/components → components}/chat/message/MessageBubble.svelte +1 -1
- package/frontend/{lib/components → components}/chat/message/MessageHeader.svelte +2 -2
- package/frontend/{lib/components → components}/chat/modal/DebugModal.svelte +2 -2
- package/frontend/{lib/components → components}/chat/modal/TokenUsageModal.svelte +2 -2
- package/frontend/{lib/components → components}/chat/tools/AskUserQuestionTool.svelte +4 -4
- package/frontend/{lib/components → components}/chat/tools/CustomMcpTool.svelte +1 -1
- package/frontend/{lib/components → components}/chat/tools/EditTool.svelte +1 -1
- package/frontend/{lib/components → components}/chat/tools/TodoWriteTool.svelte +1 -1
- package/frontend/{lib/components → components}/chat/tools/components/CodeBlock.svelte +2 -2
- package/frontend/{lib/components → components}/chat/tools/components/DiffBlock.svelte +1 -1
- package/frontend/{lib/components → components}/chat/tools/components/FileHeader.svelte +2 -2
- package/frontend/{lib/components → components}/chat/tools/components/InfoLine.svelte +1 -1
- package/frontend/{lib/components → components}/chat/widgets/FloatingTodoList.svelte +127 -13
- package/frontend/{lib/components → components}/chat/widgets/TokenUsage.svelte +4 -4
- package/frontend/{lib/components → components}/checkpoint/TimelineModal.svelte +10 -10
- package/frontend/{lib/components → components}/checkpoint/timeline/TimelineNode.svelte +1 -1
- package/frontend/{lib/components/common → components/common/display}/Icon.svelte +2 -2
- package/frontend/{lib/components/common → components/common/display}/PageTemplate.svelte +1 -1
- package/frontend/{lib/components/common → components/common/display}/ProjectUserAvatars.svelte +1 -1
- package/frontend/{lib/components/common → components/common/display}/ThemeToggle.svelte +1 -1
- package/frontend/{lib/components/common → components/common/editor}/MonacoEditor.svelte +2 -2
- package/frontend/{lib/components/common → components/common/feedback}/Alert.svelte +1 -1
- package/frontend/{lib/components/common → components/common/feedback}/ConnectionBanner.svelte +3 -3
- package/frontend/{lib/components/common → components/common/feedback}/LoadingScreen.svelte +1 -1
- package/frontend/{lib/components/common → components/common/feedback}/NotificationToast.svelte +2 -2
- package/frontend/{lib/components/common → components/common/feedback}/UpdateBanner.svelte +5 -5
- package/frontend/{lib/components/common → components/common/form}/Checkbox.svelte +1 -1
- package/frontend/{lib/components/common → components/common/form}/FolderBrowser.svelte +6 -6
- package/frontend/{lib/components/common → components/common/form}/Input.svelte +1 -1
- package/frontend/{lib/components/common → components/common/form}/ModelSelector.svelte +3 -3
- package/frontend/{lib/components/common → components/common/form}/Select.svelte +1 -1
- package/frontend/{lib/components/common → components/common/form}/Textarea.svelte +1 -1
- package/frontend/{lib/components/common → components/common/overlay}/Dialog.svelte +1 -1
- package/frontend/{lib/components/common → components/common/overlay}/Lightbox.svelte +3 -3
- package/frontend/{lib/components/common → components/common/overlay}/ModalProvider.svelte +2 -2
- package/frontend/{lib/components → components}/common/xterm/XTerm.svelte +5 -5
- package/frontend/{lib/components → components}/common/xterm/xterm-service.ts +2 -2
- package/frontend/{lib/components → components}/files/FileNode.svelte +3 -3
- package/frontend/{lib/components → components}/files/FileTree.svelte +5 -5
- package/frontend/{lib/components → components}/files/FileViewer.svelte +7 -7
- package/frontend/{lib/components → components}/files/SearchResults.svelte +3 -3
- package/frontend/{lib/components → components}/git/BranchManager.svelte +6 -6
- package/frontend/{lib/components → components}/git/ChangesSection.svelte +1 -1
- package/frontend/{lib/components → components}/git/CommitForm.svelte +1 -1
- package/frontend/{lib/components → components}/git/ConflictResolver.svelte +1 -1
- package/frontend/{lib/components → components}/git/DiffViewer.svelte +7 -7
- package/frontend/{lib/components → components}/git/FileChangeItem.svelte +3 -3
- package/frontend/{lib/components → components}/git/GitButton.svelte +1 -1
- package/frontend/{lib/components → components}/git/GitLog.svelte +2 -2
- package/frontend/{lib/components → components}/git/GitModal.svelte +3 -3
- package/frontend/{lib/components → components}/history/HistoryModal.svelte +41 -89
- package/frontend/{lib/components → components}/history/HistoryView.svelte +57 -104
- package/frontend/{lib/components → components}/index.ts +9 -9
- package/frontend/{lib/components → components}/preview/browser/BrowserPreview.svelte +3 -3
- package/frontend/{lib/components → components}/preview/browser/components/Canvas.svelte +2 -2
- package/frontend/{lib/components → components}/preview/browser/components/ConsolePanel.svelte +1 -1
- package/frontend/{lib/components → components}/preview/browser/components/Container.svelte +2 -2
- package/frontend/{lib/components → components}/preview/browser/components/ContextMenu.svelte +1 -1
- package/frontend/{lib/components → components}/preview/browser/components/SelectDropdown.svelte +1 -1
- package/frontend/{lib/components → components}/preview/browser/components/Toolbar.svelte +2 -2
- package/frontend/{lib/components → components}/preview/browser/core/cleanup.svelte.ts +1 -1
- package/frontend/{lib/components → components}/preview/browser/core/coordinator.svelte.ts +4 -4
- package/frontend/{lib/components → components}/preview/browser/core/interactions.svelte.ts +3 -3
- package/frontend/{lib/components → components}/preview/browser/core/mcp-handlers.svelte.ts +2 -2
- package/frontend/{lib/components → components}/preview/browser/core/native-ui-handlers.svelte.ts +2 -2
- package/frontend/{lib/components → components}/preview/browser/core/tab-manager.svelte.ts +1 -1
- package/frontend/{lib/components → components}/preview/browser/core/tab-operations.svelte.ts +3 -3
- package/frontend/{lib/components → components}/settings/SettingsModal.svelte +4 -4
- package/frontend/{lib/components → components}/settings/SettingsView.svelte +2 -2
- package/frontend/{lib/components → components}/settings/admin/InviteManagement.svelte +5 -5
- package/frontend/{lib/components → components}/settings/admin/UserManagement.svelte +5 -5
- package/frontend/{lib/components → components}/settings/appearance/AppearanceSettings.svelte +5 -5
- package/frontend/{lib/components → components}/settings/appearance/LayoutPresetSettings.svelte +3 -3
- package/frontend/{lib/components → components}/settings/appearance/LayoutPreview.svelte +1 -1
- package/frontend/{lib/components → components}/settings/engines/AIEnginesSettings.svelte +6 -6
- package/frontend/{lib/components → components}/settings/general/AdvancedSettings.svelte +5 -5
- package/frontend/{lib/components → components}/settings/general/AuthModeSettings.svelte +5 -5
- package/frontend/{lib/components → components}/settings/general/DataManagementSettings.svelte +9 -9
- package/frontend/{lib/components → components}/settings/general/UpdateSettings.svelte +3 -3
- package/frontend/{lib/components → components}/settings/model/ModelSettings.svelte +2 -2
- package/frontend/{lib/components → components}/settings/notifications/NotificationSettings.svelte +4 -4
- package/frontend/{lib/components → components}/settings/user/UserSettings.svelte +5 -5
- package/frontend/{lib/components → components}/terminal/Terminal.svelte +9 -9
- package/frontend/{lib/components → components}/terminal/TerminalTabs.svelte +1 -1
- package/frontend/{lib/components → components}/terminal/TerminalView.svelte +5 -5
- package/frontend/{lib/components → components}/tunnel/TunnelActive.svelte +3 -3
- package/frontend/{lib/components → components}/tunnel/TunnelButton.svelte +2 -2
- package/frontend/{lib/components → components}/tunnel/TunnelInactive.svelte +4 -4
- package/frontend/{lib/components → components}/tunnel/TunnelModal.svelte +2 -2
- package/frontend/{lib/components → components}/workspace/DesktopNavigator.svelte +372 -372
- package/frontend/{lib/components → components}/workspace/MobileNavigator.svelte +380 -380
- package/frontend/{lib/components → components}/workspace/PanelContainer.svelte +3 -3
- package/frontend/{lib/components → components}/workspace/PanelHeader.svelte +10 -10
- package/frontend/{lib/components → components}/workspace/ViewMenu.svelte +4 -4
- package/frontend/{lib/components → components}/workspace/WorkspaceLayout.svelte +17 -17
- package/frontend/{lib/components → components}/workspace/layout/DesktopLayout.svelte +1 -1
- package/frontend/{lib/components → components}/workspace/layout/MobileLayout.svelte +1 -1
- package/frontend/{lib/components → components}/workspace/layout/split-pane/Container.svelte +1 -1
- package/frontend/{lib/components → components}/workspace/layout/split-pane/Handle.svelte +2 -2
- package/frontend/{lib/components → components}/workspace/layout/split-pane/Layout.svelte +2 -2
- package/frontend/{lib/components → components}/workspace/panels/ChatPanel.svelte +14 -14
- package/frontend/{lib/components → components}/workspace/panels/FilesPanel.svelte +51 -13
- package/frontend/{lib/components → components}/workspace/panels/GitPanel.svelte +55 -17
- package/frontend/{lib/components → components}/workspace/panels/PreviewPanel.svelte +5 -5
- package/frontend/{lib/components → components}/workspace/panels/TerminalPanel.svelte +6 -6
- package/frontend/{lib/services → services}/chat/chat.service.ts +8 -8
- package/frontend/{lib/services → services}/notification/global-stream-monitor.ts +117 -117
- package/frontend/{lib/services → services}/notification/push.service.ts +1 -1
- package/frontend/{lib/services → services}/notification/sound.service.ts +1 -1
- package/frontend/{lib/services → services}/preview/browser/browser-console.service.ts +1 -1
- package/frontend/{lib/services → services}/preview/browser/browser-webcodecs.service.ts +1 -1
- package/frontend/{lib/services → services}/preview/browser/mcp-integration.svelte.ts +2 -2
- package/frontend/{lib/services → services}/project/status.service.ts +160 -160
- package/frontend/{lib/services → services}/snapshot/snapshot.service.ts +2 -2
- package/frontend/{lib/services → services}/terminal/background/index.ts +1 -1
- package/frontend/{lib/services → services}/terminal/background/session-restore.ts +1 -1
- package/frontend/{lib/services → services}/terminal/background/stream-manager.ts +1 -1
- package/frontend/{lib/services → services}/terminal/project.service.ts +2 -2
- package/frontend/{lib/services → services}/terminal/terminal.service.ts +2 -2
- package/frontend/{lib/stores → stores}/core/app.svelte.ts +1 -1
- package/frontend/{lib/stores → stores}/core/presence.svelte.ts +4 -4
- package/frontend/{lib/stores → stores}/core/projects.svelte.ts +5 -5
- package/frontend/{lib/stores → stores}/core/sessions.svelte.ts +3 -3
- package/frontend/{lib/stores → stores}/features/auth.svelte.ts +30 -2
- package/frontend/{lib/stores → stores}/features/claude-accounts.svelte.ts +1 -1
- package/frontend/{lib/stores → stores}/features/models.svelte.ts +1 -1
- package/frontend/{lib/stores → stores}/features/settings.svelte.ts +2 -2
- package/frontend/{lib/stores → stores}/features/terminal.svelte.ts +4 -4
- package/frontend/{lib/stores → stores}/features/tunnel.svelte.ts +1 -1
- package/frontend/{lib/stores → stores}/features/user.svelte.ts +1 -1
- package/frontend/{lib/stores → stores}/ui/edit-mode.svelte.ts +3 -3
- package/frontend/{lib/stores → stores}/ui/update.svelte.ts +8 -2
- package/frontend/{lib/utils → utils}/theme.ts +1 -1
- package/frontend/{lib/utils → utils}/ws.ts +1 -1
- package/package.json +2 -2
- package/scripts/dev.ts +4 -3
- package/scripts/generate-icons.ts +2 -2
- package/scripts/start.ts +24 -0
- package/shared/types/ui/icons.ts +4 -4
- package/shared/utils/anonymous-user.ts +1 -1
- package/shared/utils/ws-server.ts +3 -3
- package/vite.config.ts +2 -2
- /package/backend/{lib/auth → auth}/index.ts +0 -0
- /package/backend/{lib/auth → auth}/permissions.ts +0 -0
- /package/backend/{lib/auth → auth}/rate-limiter.ts +0 -0
- /package/backend/{lib/auth → auth}/tokens.ts +0 -0
- /package/backend/{lib/chat → chat}/helpers.ts +0 -0
- /package/backend/{lib/chat → chat}/index.ts +0 -0
- /package/backend/{lib/database → database}/README.md +0 -0
- /package/backend/{lib/database → database}/index.ts +0 -0
- /package/backend/{lib/database → database}/migrations/001_create_projects_table.ts +0 -0
- /package/backend/{lib/database → database}/migrations/002_create_chat_sessions_table.ts +0 -0
- /package/backend/{lib/database → database}/migrations/003_create_messages_table.ts +0 -0
- /package/backend/{lib/database → database}/migrations/004_create_prompt_templates_table.ts +0 -0
- /package/backend/{lib/database → database}/migrations/005_create_settings_table.ts +0 -0
- /package/backend/{lib/database → database}/migrations/006_add_user_to_messages.ts +0 -0
- /package/backend/{lib/database → database}/migrations/007_create_stream_states_table.ts +0 -0
- /package/backend/{lib/database → database}/migrations/008_create_message_snapshots_table.ts +0 -0
- /package/backend/{lib/database → database}/migrations/009_add_delta_snapshot_fields.ts +0 -0
- /package/backend/{lib/database → database}/migrations/010_add_soft_delete_and_branch_support.ts +0 -0
- /package/backend/{lib/database → database}/migrations/011_git_like_commit_graph.ts +0 -0
- /package/backend/{lib/database → database}/migrations/012_add_file_change_statistics.ts +0 -0
- /package/backend/{lib/database → database}/migrations/013_checkpoint_tree_state.ts +0 -0
- /package/backend/{lib/database → database}/migrations/014_add_engine_to_sessions.ts +0 -0
- /package/backend/{lib/database → database}/migrations/015_add_model_to_sessions.ts +0 -0
- /package/backend/{lib/database → database}/migrations/016_create_user_projects_table.ts +0 -0
- /package/backend/{lib/database → database}/migrations/017_add_current_session_to_user_projects.ts +0 -0
- /package/backend/{lib/database → database}/migrations/018_create_claude_accounts_table.ts +0 -0
- /package/backend/{lib/database → database}/migrations/019_add_claude_account_to_sessions.ts +0 -0
- /package/backend/{lib/database → database}/migrations/020_add_snapshot_tree_hash.ts +0 -0
- /package/backend/{lib/database → database}/migrations/021_drop_prompt_templates_table.ts +0 -0
- /package/backend/{lib/database → database}/migrations/022_add_snapshot_changes_column.ts +0 -0
- /package/backend/{lib/database → database}/migrations/023_create_user_unread_sessions_table.ts +0 -0
- /package/backend/{lib/database → database}/migrations/024_create_users_table.ts +0 -0
- /package/backend/{lib/database → database}/migrations/025_create_auth_sessions_table.ts +0 -0
- /package/backend/{lib/database → database}/migrations/026_create_invite_tokens_table.ts +0 -0
- /package/backend/{lib/database → database}/migrations/index.ts +0 -0
- /package/backend/{lib/database → database}/queries/auth-queries.ts +0 -0
- /package/backend/{lib/database → database}/queries/checkpoint-queries.ts +0 -0
- /package/backend/{lib/database → database}/queries/engine-queries.ts +0 -0
- /package/backend/{lib/database → database}/queries/index.ts +0 -0
- /package/backend/{lib/database → database}/queries/project-queries.ts +0 -0
- /package/backend/{lib/database → database}/queries/session-queries.ts +0 -0
- /package/backend/{lib/database → database}/queries/settings-queries.ts +0 -0
- /package/backend/{lib/database → database}/queries/snapshot-queries.ts +0 -0
- /package/backend/{lib/database → database}/queries/utils-queries.ts +0 -0
- /package/backend/{lib/database → database}/seeders/index.ts +0 -0
- /package/backend/{lib/database → database}/seeders/settings_seeder.ts +0 -0
- /package/backend/{lib/database → database}/utils/index.ts +0 -0
- /package/backend/{lib/database → database}/utils/migration-runner.ts +0 -0
- /package/backend/{lib/database → database}/utils/seeder-runner.ts +0 -0
- /package/backend/{lib/engine → engine}/adapters/claude/error-handler.ts +0 -0
- /package/backend/{lib/engine → engine}/adapters/claude/index.ts +0 -0
- /package/backend/{lib/engine → engine}/adapters/claude/path-utils.ts +0 -0
- /package/backend/{lib/engine → engine}/adapters/claude/stream.ts +0 -0
- /package/backend/{lib/engine → engine}/adapters/opencode/index.ts +0 -0
- /package/backend/{lib/engine → engine}/adapters/opencode/stream.ts +0 -0
- /package/backend/{lib/engine → engine}/index.ts +0 -0
- /package/backend/{lib/engine → engine}/types.ts +0 -0
- /package/backend/{lib/files → files}/file-operations.ts +0 -0
- /package/backend/{lib/files → files}/file-reading.ts +0 -0
- /package/backend/{lib/files → files}/path-browsing.ts +0 -0
- /package/backend/{lib/git → git}/git-parser.ts +0 -0
- /package/backend/{lib/git → git}/git-service.ts +0 -0
- /package/backend/{lib/mcp → mcp}/index.ts +0 -0
- /package/backend/{lib/mcp → mcp}/project-context.ts +0 -0
- /package/backend/{lib/mcp → mcp}/remote-server.ts +0 -0
- /package/backend/{lib/mcp → mcp}/servers/browser-automation/index.ts +0 -0
- /package/backend/{lib/mcp → mcp}/servers/helper.ts +0 -0
- /package/backend/{lib/mcp → mcp}/servers/index.ts +0 -0
- /package/backend/{lib/mcp → mcp}/servers/weather/get-temperature.ts +0 -0
- /package/backend/{lib/mcp → mcp}/servers/weather/index.ts +0 -0
- /package/backend/{lib/mcp → mcp}/types.ts +0 -0
- /package/backend/{lib/preview → preview}/browser/browser-audio-capture.ts +0 -0
- /package/backend/{lib/preview → preview}/browser/browser-console-manager.ts +0 -0
- /package/backend/{lib/preview → preview}/browser/browser-dialog-handler.ts +0 -0
- /package/backend/{lib/preview → preview}/browser/browser-interaction-handler.ts +0 -0
- /package/backend/{lib/preview → preview}/browser/browser-mcp-control.ts +0 -0
- /package/backend/{lib/preview → preview}/browser/browser-native-ui-handler.ts +0 -0
- /package/backend/{lib/preview → preview}/browser/browser-navigation-tracker.ts +0 -0
- /package/backend/{lib/preview → preview}/browser/browser-pool.ts +0 -0
- /package/backend/{lib/preview → preview}/browser/browser-video-capture.ts +0 -0
- /package/backend/{lib/preview → preview}/browser/scripts/audio-stream.ts +0 -0
- /package/backend/{lib/preview → preview}/browser/scripts/cursor-tracking.ts +0 -0
- /package/backend/{lib/preview → preview}/browser/scripts/video-stream.ts +0 -0
- /package/backend/{lib/preview → preview}/index.ts +0 -0
- /package/backend/{lib/project → project}/index.ts +0 -0
- /package/backend/{lib/snapshot → snapshot}/gitignore.ts +0 -0
- /package/backend/{lib/snapshot → snapshot}/helpers.ts +0 -0
- /package/backend/{lib/snapshot → snapshot}/snapshot-service.ts +0 -0
- /package/backend/{lib/terminal → terminal}/helpers.ts +0 -0
- /package/backend/{lib/terminal → terminal}/index.ts +0 -0
- /package/backend/{lib/terminal → terminal}/pty-manager.ts +0 -0
- /package/backend/{lib/terminal → terminal}/pty-session-manager.ts +0 -0
- /package/backend/{lib/terminal → terminal}/stream-manager.ts +0 -0
- /package/backend/{lib/tunnel → tunnel}/global-tunnel-manager.ts +0 -0
- /package/backend/{lib/tunnel → tunnel}/project-tunnel-manager.ts +0 -0
- /package/backend/{lib/shared → utils}/process-manager.ts +0 -0
- /package/backend/{lib/user/helpers.ts → utils/user-helpers.ts} +0 -0
- /package/frontend/{lib/app-environment.ts → app-environment.ts} +0 -0
- /package/frontend/{lib/components → components}/chat/formatters/index.ts +0 -0
- /package/frontend/{lib/components → components}/chat/input/components/DragDropOverlay.svelte +0 -0
- /package/frontend/{lib/components → components}/chat/input/composables/use-animations.svelte.ts +0 -0
- /package/frontend/{lib/components → components}/chat/input/composables/use-textarea-resize.svelte.ts +0 -0
- /package/frontend/{lib/components → components}/chat/message/DateSeparator.svelte +0 -0
- /package/frontend/{lib/components → components}/chat/shared/index.ts +0 -0
- /package/frontend/{lib/components → components}/chat/shared/utils.ts +0 -0
- /package/frontend/{lib/components → components}/chat/tools/AgentTool.svelte +0 -0
- /package/frontend/{lib/components → components}/chat/tools/BashOutputTool.svelte +0 -0
- /package/frontend/{lib/components → components}/chat/tools/BashTool.svelte +0 -0
- /package/frontend/{lib/components → components}/chat/tools/EnterPlanModeTool.svelte +0 -0
- /package/frontend/{lib/components → components}/chat/tools/ExitPlanModeTool.svelte +0 -0
- /package/frontend/{lib/components → components}/chat/tools/GlobTool.svelte +0 -0
- /package/frontend/{lib/components → components}/chat/tools/GrepTool.svelte +0 -0
- /package/frontend/{lib/components → components}/chat/tools/ListMcpResourcesTool.svelte +0 -0
- /package/frontend/{lib/components → components}/chat/tools/NotebookEditTool.svelte +0 -0
- /package/frontend/{lib/components → components}/chat/tools/ReadMcpResourceTool.svelte +0 -0
- /package/frontend/{lib/components → components}/chat/tools/ReadTool.svelte +0 -0
- /package/frontend/{lib/components → components}/chat/tools/TaskStopTool.svelte +0 -0
- /package/frontend/{lib/components → components}/chat/tools/TaskTool.svelte +0 -0
- /package/frontend/{lib/components → components}/chat/tools/WebFetchTool.svelte +0 -0
- /package/frontend/{lib/components → components}/chat/tools/WebSearchTool.svelte +0 -0
- /package/frontend/{lib/components → components}/chat/tools/WriteTool.svelte +0 -0
- /package/frontend/{lib/components → components}/chat/tools/components/StatsBadges.svelte +0 -0
- /package/frontend/{lib/components → components}/chat/tools/components/TerminalCommand.svelte +0 -0
- /package/frontend/{lib/components → components}/chat/tools/components/index.ts +0 -0
- /package/frontend/{lib/components → components}/chat/tools/index.ts +0 -0
- /package/frontend/{lib/components → components}/checkpoint/timeline/TimelineEdge.svelte +0 -0
- /package/frontend/{lib/components → components}/checkpoint/timeline/TimelineGraph.svelte +0 -0
- /package/frontend/{lib/components → components}/checkpoint/timeline/TimelineVersionGroup.svelte +0 -0
- /package/frontend/{lib/components → components}/checkpoint/timeline/animation.ts +0 -0
- /package/frontend/{lib/components → components}/checkpoint/timeline/config.ts +0 -0
- /package/frontend/{lib/components → components}/checkpoint/timeline/graph-builder.ts +0 -0
- /package/frontend/{lib/components → components}/checkpoint/timeline/types.ts +0 -0
- /package/frontend/{lib/components → components}/checkpoint/timeline/utils.ts +0 -0
- /package/frontend/{lib/components/common → components/common/display}/AvatarBubble.svelte +0 -0
- /package/frontend/{lib/components/common → components/common/display}/Button.svelte +0 -0
- /package/frontend/{lib/components/common → components/common/display}/Card.svelte +0 -0
- /package/frontend/{lib/components/common → components/common/feedback}/LoadingSpinner.svelte +0 -0
- /package/frontend/{lib/components → components}/common/lucide-icons.ts +0 -0
- /package/frontend/{lib/components → components}/common/material-icons.ts +0 -0
- /package/frontend/{lib/components/common → components/common/overlay}/Modal.svelte +0 -0
- /package/frontend/{lib/components → components}/common/xterm/index.ts +0 -0
- /package/frontend/{lib/components → components}/common/xterm/terminal-config.ts +0 -0
- /package/frontend/{lib/components → components}/common/xterm/types.ts +0 -0
- /package/frontend/{lib/components → components}/preview/browser/components/VirtualCursor.svelte +0 -0
- /package/frontend/{lib/components → components}/preview/browser/core/stream-handler.svelte.ts +0 -0
- /package/frontend/{lib/components → components}/preview/index.ts +0 -0
- /package/frontend/{lib/components → components}/settings/account/AccountSettings.svelte +0 -0
- /package/frontend/{lib/components → components}/settings/general/GeneralSettings.svelte +0 -0
- /package/frontend/{lib/components → components}/settings/security/SecuritySettings.svelte +0 -0
- /package/frontend/{lib/components → components}/settings/system/SystemSettings.svelte +0 -0
- /package/frontend/{lib/components → components}/tunnel/TunnelQRCode.svelte +0 -0
- /package/frontend/{lib/services → services}/chat/index.ts +0 -0
- /package/frontend/{lib/services → services}/notification/index.ts +0 -0
- /package/frontend/{lib/services → services}/preview/index.ts +0 -0
- /package/frontend/{lib/services → services}/project/index.ts +0 -0
- /package/frontend/{lib/services → services}/terminal/index.ts +0 -0
- /package/frontend/{lib/services → services}/terminal/persistence.service.ts +0 -0
- /package/frontend/{lib/services → services}/terminal/session.service.ts +0 -0
- /package/frontend/{lib/stores → stores}/core/files.svelte.ts +0 -0
- /package/frontend/{lib/stores → stores}/ui/chat-input.svelte.ts +0 -0
- /package/frontend/{lib/stores → stores}/ui/chat-model.svelte.ts +0 -0
- /package/frontend/{lib/stores → stores}/ui/connection.svelte.ts +0 -0
- /package/frontend/{lib/stores → stores}/ui/dialog.svelte.ts +0 -0
- /package/frontend/{lib/stores → stores}/ui/notification.svelte.ts +0 -0
- /package/frontend/{lib/stores → stores}/ui/settings-modal.svelte.ts +0 -0
- /package/frontend/{lib/stores → stores}/ui/theme.svelte.ts +0 -0
- /package/frontend/{lib/stores → stores}/ui/workspace.svelte.ts +0 -0
- /package/frontend/{lib/utils → utils}/chat/date-separator.ts +0 -0
- /package/frontend/{lib/utils → utils}/chat/message-grouper.ts +0 -0
- /package/frontend/{lib/utils → utils}/chat/message-processor.ts +0 -0
- /package/frontend/{lib/utils → utils}/chat/tool-handler.ts +0 -0
- /package/frontend/{lib/utils → utils}/chat/virtual-scroll.svelte.ts +0 -0
- /package/frontend/{lib/utils → utils}/click-outside.ts +0 -0
- /package/frontend/{lib/utils → utils}/context-manager.ts +0 -0
- /package/frontend/{lib/utils → utils}/file-icon-mappings.ts +0 -0
- /package/frontend/{lib/utils → utils}/folder-icon-mappings.ts +0 -0
- /package/frontend/{lib/utils → utils}/git-status.ts +0 -0
- /package/frontend/{lib/types → utils}/native-ui.ts +0 -0
- /package/frontend/{lib/utils → utils}/platform.ts +0 -0
- /package/frontend/{lib/utils → utils}/port-check.ts +0 -0
- /package/frontend/{lib/constants/preview.ts → utils/preview-constants.ts} +0 -0
- /package/frontend/{lib/utils/terminalFormatter.ts → utils/terminal-formatter.ts} +0 -0
- /package/frontend/{lib/utils → utils}/tree-visualizer.ts +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { fade, scale } from 'svelte/transition';
|
|
3
3
|
import { cubicOut } from 'svelte/easing';
|
|
4
|
-
import Icon from '$frontend/
|
|
5
|
-
import { getFileIcon } from '$frontend/
|
|
6
|
-
import { formatFileSize } from '$frontend/
|
|
4
|
+
import Icon from '$frontend/components/common/display/Icon.svelte';
|
|
5
|
+
import { getFileIcon } from '$frontend/utils/file-icon-mappings';
|
|
6
|
+
import { formatFileSize } from '$frontend/components/chat/shared/utils';
|
|
7
7
|
import { debug } from '$shared/utils/logger';
|
|
8
8
|
|
|
9
9
|
interface Props {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import Alert from '
|
|
2
|
+
import Alert from '../feedback/Alert.svelte';
|
|
3
3
|
import Dialog from './Dialog.svelte';
|
|
4
|
-
import { dialogStore, closeAlert, closeConfirm } from '$frontend/
|
|
4
|
+
import { dialogStore, closeAlert, closeConfirm } from '$frontend/stores/ui/dialog.svelte';
|
|
5
5
|
|
|
6
6
|
const alertState = $derived(dialogStore.alert);
|
|
7
7
|
const confirmState = $derived(dialogStore.confirm);
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
-->
|
|
5
5
|
<script lang="ts">
|
|
6
6
|
import { onMount, onDestroy } from 'svelte';
|
|
7
|
-
import { browser } from '$frontend/
|
|
7
|
+
import { browser } from '$frontend/app-environment';
|
|
8
8
|
import type { TerminalSession } from '$shared/types/terminal';
|
|
9
9
|
import { XTermService } from './xterm-service';
|
|
10
10
|
import type { XTermProps, XTermMethods } from './types';
|
|
11
|
-
import { terminalStore } from '$frontend/
|
|
12
|
-
import { backgroundTerminalService } from '$frontend/
|
|
13
|
-
import { terminalService } from '$frontend/
|
|
14
|
-
import { settings } from '$frontend/
|
|
11
|
+
import { terminalStore } from '$frontend/stores/features/terminal.svelte';
|
|
12
|
+
import { backgroundTerminalService } from '$frontend/services/terminal/background';
|
|
13
|
+
import { terminalService } from '$frontend/services/terminal';
|
|
14
|
+
import { settings } from '$frontend/stores/features/settings.svelte';
|
|
15
15
|
|
|
16
16
|
// Import CSS directly - Vite will handle it properly
|
|
17
17
|
import '@xterm/xterm/css/xterm.css';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* No command parsing, no prompt handling - everything handled by shell
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { browser } from '$frontend/
|
|
8
|
+
import { browser } from '$frontend/app-environment';
|
|
9
9
|
import type { Terminal } from '@xterm/xterm';
|
|
10
10
|
import type { FitAddon } from '@xterm/addon-fit';
|
|
11
11
|
import type { WebLinksAddon } from '@xterm/addon-web-links';
|
|
@@ -15,7 +15,7 @@ import type { LigaturesAddon } from '@xterm/addon-ligatures';
|
|
|
15
15
|
import type { TerminalLine } from '$shared/types/terminal';
|
|
16
16
|
import { terminalConfig } from './terminal-config';
|
|
17
17
|
import { debug } from '$shared/utils/logger';
|
|
18
|
-
import ws from '$frontend/
|
|
18
|
+
import ws from '$frontend/utils/ws';
|
|
19
19
|
|
|
20
20
|
export class XTermService {
|
|
21
21
|
public terminal: Terminal | null = null;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { FileNode as FileNodeType } from '$shared/types/filesystem';
|
|
3
3
|
import FileNode from './FileNode.svelte';
|
|
4
|
-
import Icon from '$frontend/
|
|
4
|
+
import Icon from '$frontend/components/common/display/Icon.svelte';
|
|
5
5
|
import type { IconName } from '$shared/types/ui/icons';
|
|
6
|
-
import { getFileIcon } from '$frontend/
|
|
7
|
-
import { getFolderIcon } from '$frontend/
|
|
6
|
+
import { getFileIcon } from '$frontend/utils/file-icon-mappings';
|
|
7
|
+
import { getFolderIcon } from '$frontend/utils/folder-icon-mappings';
|
|
8
8
|
import { onMount } from 'svelte';
|
|
9
9
|
|
|
10
10
|
const {
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
</script>
|
|
5
5
|
|
|
6
6
|
<script lang="ts">
|
|
7
|
-
import { projectState } from '$frontend/
|
|
7
|
+
import { projectState } from '$frontend/stores/core/projects.svelte';
|
|
8
8
|
import type { FileNode as FileNodeType } from '$shared/types/filesystem';
|
|
9
9
|
import FileNode from './FileNode.svelte';
|
|
10
10
|
import SearchResults from './SearchResults.svelte';
|
|
11
|
-
import Icon from '$frontend/
|
|
12
|
-
import ws from '$frontend/
|
|
13
|
-
import { addNotification } from '$frontend/
|
|
14
|
-
import { showConfirm } from '$frontend/
|
|
11
|
+
import Icon from '$frontend/components/common/display/Icon.svelte';
|
|
12
|
+
import ws from '$frontend/utils/ws';
|
|
13
|
+
import { addNotification } from '$frontend/stores/ui/notification.svelte';
|
|
14
|
+
import { showConfirm } from '$frontend/stores/ui/dialog.svelte';
|
|
15
15
|
import { normalizePath } from '$shared/utils/path';
|
|
16
16
|
import { onDestroy } from 'svelte';
|
|
17
17
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { FileNode } from '$shared/types/filesystem';
|
|
3
|
-
import LoadingSpinner from '../common/LoadingSpinner.svelte';
|
|
4
|
-
import MonacoEditor from '../common/MonacoEditor.svelte';
|
|
5
|
-
import { themeStore } from '$frontend/
|
|
6
|
-
import Icon from '$frontend/
|
|
7
|
-
import { getFileIcon } from '$frontend/
|
|
8
|
-
import { getFolderIcon } from '$frontend/
|
|
3
|
+
import LoadingSpinner from '../common/feedback/LoadingSpinner.svelte';
|
|
4
|
+
import MonacoEditor from '../common/editor/MonacoEditor.svelte';
|
|
5
|
+
import { themeStore } from '$frontend/stores/ui/theme.svelte';
|
|
6
|
+
import Icon from '$frontend/components/common/display/Icon.svelte';
|
|
7
|
+
import { getFileIcon } from '$frontend/utils/file-icon-mappings';
|
|
8
|
+
import { getFolderIcon } from '$frontend/utils/folder-icon-mappings';
|
|
9
9
|
import { onMount, onDestroy } from 'svelte';
|
|
10
10
|
import type { IconName } from '$shared/types/ui/icons';
|
|
11
11
|
import type { editor } from 'monaco-editor';
|
|
12
12
|
import { debug } from '$shared/utils/logger';
|
|
13
|
-
import ws from '$frontend/
|
|
13
|
+
import ws from '$frontend/utils/ws';
|
|
14
14
|
|
|
15
15
|
// Interface untuk MonacoEditor component
|
|
16
16
|
interface MonacoEditorComponent {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import Icon from '$frontend/
|
|
3
|
-
import { getFileIcon } from '$frontend/
|
|
4
|
-
import { getFolderIcon } from '$frontend/
|
|
2
|
+
import Icon from '$frontend/components/common/display/Icon.svelte';
|
|
3
|
+
import { getFileIcon } from '$frontend/utils/file-icon-mappings';
|
|
4
|
+
import { getFolderIcon } from '$frontend/utils/folder-icon-mappings';
|
|
5
5
|
import { normalizePath } from '$shared/utils/path';
|
|
6
6
|
import type { IconName } from '$shared/types/ui/icons';
|
|
7
7
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import Icon from '$frontend/
|
|
3
|
-
import Modal from '$frontend/
|
|
4
|
-
import Dialog from '$frontend/
|
|
2
|
+
import Icon from '$frontend/components/common/display/Icon.svelte';
|
|
3
|
+
import Modal from '$frontend/components/common/overlay/Modal.svelte';
|
|
4
|
+
import Dialog from '$frontend/components/common/overlay/Dialog.svelte';
|
|
5
5
|
import type { GitBranchInfo, GitRemote } from '$shared/types/git';
|
|
6
|
-
import { projectState } from '$frontend/
|
|
7
|
-
import { showError, showInfo } from '$frontend/
|
|
6
|
+
import { projectState } from '$frontend/stores/core/projects.svelte';
|
|
7
|
+
import { showError, showInfo } from '$frontend/stores/ui/notification.svelte';
|
|
8
8
|
import { debug } from '$shared/utils/logger';
|
|
9
|
-
import ws from '$frontend/
|
|
9
|
+
import ws from '$frontend/utils/ws';
|
|
10
10
|
|
|
11
11
|
interface Props {
|
|
12
12
|
isOpen: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import Icon from '$frontend/
|
|
2
|
+
import Icon from '$frontend/components/common/display/Icon.svelte';
|
|
3
3
|
import FileChangeItem from './FileChangeItem.svelte';
|
|
4
4
|
import type { GitFileChange } from '$shared/types/git';
|
|
5
5
|
import type { IconName } from '$shared/types/ui/icons';
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { onMount, onDestroy, untrack } from 'svelte';
|
|
3
|
-
import Icon from '$frontend/
|
|
4
|
-
import { getFileIcon } from '$frontend/
|
|
5
|
-
import { getGitStatusBadgeLabel, getGitStatusBadgeColor } from '$frontend/
|
|
6
|
-
import { themeStore } from '$frontend/
|
|
7
|
-
import { projectState } from '$frontend/
|
|
8
|
-
import { settings } from '$frontend/
|
|
3
|
+
import Icon from '$frontend/components/common/display/Icon.svelte';
|
|
4
|
+
import { getFileIcon } from '$frontend/utils/file-icon-mappings';
|
|
5
|
+
import { getGitStatusBadgeLabel, getGitStatusBadgeColor } from '$frontend/utils/git-status';
|
|
6
|
+
import { themeStore } from '$frontend/stores/ui/theme.svelte';
|
|
7
|
+
import { projectState } from '$frontend/stores/core/projects.svelte';
|
|
8
|
+
import { settings } from '$frontend/stores/features/settings.svelte';
|
|
9
9
|
import loader from '@monaco-editor/loader';
|
|
10
10
|
import type { editor } from 'monaco-editor';
|
|
11
11
|
import type { GitFileDiff } from '$shared/types/git';
|
|
12
12
|
import type { IconName } from '$shared/types/ui/icons';
|
|
13
13
|
import { debug } from '$shared/utils/logger';
|
|
14
|
-
import ws from '$frontend/
|
|
14
|
+
import ws from '$frontend/utils/ws';
|
|
15
15
|
|
|
16
16
|
interface Props {
|
|
17
17
|
diff: GitFileDiff | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import Icon from '$frontend/
|
|
3
|
-
import { getFileIcon } from '$frontend/
|
|
4
|
-
import { getGitStatusLabel, getGitStatusColor } from '$frontend/
|
|
2
|
+
import Icon from '$frontend/components/common/display/Icon.svelte';
|
|
3
|
+
import { getFileIcon } from '$frontend/utils/file-icon-mappings';
|
|
4
|
+
import { getGitStatusLabel, getGitStatusColor } from '$frontend/utils/git-status';
|
|
5
5
|
import type { GitFileChange } from '$shared/types/git';
|
|
6
6
|
import type { IconName } from '$shared/types/ui/icons';
|
|
7
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import Icon from '$frontend/
|
|
3
|
-
import { addNotification } from '$frontend/
|
|
2
|
+
import Icon from '$frontend/components/common/display/Icon.svelte';
|
|
3
|
+
import { addNotification } from '$frontend/stores/ui/notification.svelte';
|
|
4
4
|
import type { GitCommit } from '$shared/types/git';
|
|
5
5
|
|
|
6
6
|
interface Props {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import Modal from '$frontend/
|
|
3
|
-
import Icon from '$frontend/
|
|
4
|
-
import GitPanel from '$frontend/
|
|
2
|
+
import Modal from '$frontend/components/common/overlay/Modal.svelte';
|
|
3
|
+
import Icon from '$frontend/components/common/display/Icon.svelte';
|
|
4
|
+
import GitPanel from '$frontend/components/workspace/panels/GitPanel.svelte';
|
|
5
5
|
|
|
6
6
|
interface Props {
|
|
7
7
|
isOpen: boolean;
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { untrack } from 'svelte';
|
|
3
|
-
import { sessionState, setCurrentSession, removeSession, reloadSessionsForProject } from '$frontend/
|
|
4
|
-
import { projectState } from '$frontend/
|
|
5
|
-
import { addNotification } from '$frontend/
|
|
6
|
-
import ws from '$frontend/
|
|
3
|
+
import { sessionState, setCurrentSession, removeSession, reloadSessionsForProject } from '$frontend/stores/core/sessions.svelte';
|
|
4
|
+
import { projectState } from '$frontend/stores/core/projects.svelte';
|
|
5
|
+
import { addNotification } from '$frontend/stores/ui/notification.svelte';
|
|
6
|
+
import ws from '$frontend/utils/ws';
|
|
7
7
|
import type { ChatSession } from '$shared/types/database/schema';
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { userStore } from '$frontend/lib/stores/features/user.svelte';
|
|
8
|
+
import Icon from '$frontend/components/common/display/Icon.svelte';
|
|
9
|
+
import AvatarBubble from '$frontend/components/common/display/AvatarBubble.svelte';
|
|
10
|
+
import Modal from '$frontend/components/common/overlay/Modal.svelte';
|
|
11
|
+
import Dialog from '$frontend/components/common/overlay/Dialog.svelte';
|
|
12
|
+
import { presenceState, isSessionWaitingInput } from '$frontend/stores/core/presence.svelte';
|
|
13
|
+
import { isSessionUnread } from '$frontend/stores/core/app.svelte';
|
|
14
|
+
import { userStore } from '$frontend/stores/features/user.svelte';
|
|
16
15
|
import { debug } from '$shared/utils/logger';
|
|
17
16
|
|
|
18
17
|
interface Props {
|
|
@@ -55,7 +54,6 @@
|
|
|
55
54
|
|
|
56
55
|
// Cache for session data to avoid multiple API calls
|
|
57
56
|
let sessionDataCache = $state<Record<string, {
|
|
58
|
-
messages: SDKMessage[];
|
|
59
57
|
title: string;
|
|
60
58
|
summary: string;
|
|
61
59
|
count: number;
|
|
@@ -64,87 +62,30 @@
|
|
|
64
62
|
}>>({});
|
|
65
63
|
let loadingSessionData = $state(false);
|
|
66
64
|
|
|
67
|
-
// Helper to get session data from cache or API
|
|
65
|
+
// Helper to get session data from cache or API (single session fallback)
|
|
68
66
|
async function getSessionData(sessionId: string) {
|
|
69
67
|
if (sessionDataCache[sessionId]) {
|
|
70
68
|
return sessionDataCache[sessionId];
|
|
71
69
|
}
|
|
72
70
|
|
|
73
71
|
try {
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
if (textContent) {
|
|
88
|
-
title = textContent.slice(0, 60) + (textContent.length > 60 ? '...' : '');
|
|
89
|
-
}
|
|
72
|
+
const previews = await ws.http('sessions:preview', { session_ids: [sessionId] });
|
|
73
|
+
const preview = previews[0];
|
|
74
|
+
if (preview) {
|
|
75
|
+
sessionDataCache[sessionId] = {
|
|
76
|
+
title: preview.title,
|
|
77
|
+
summary: preview.summary,
|
|
78
|
+
count: preview.count,
|
|
79
|
+
userCount: preview.userCount,
|
|
80
|
+
assistantCount: preview.assistantCount
|
|
81
|
+
};
|
|
82
|
+
return sessionDataCache[sessionId];
|
|
90
83
|
}
|
|
91
|
-
|
|
92
|
-
const assistantMessages = messages.filter((m: SDKMessage) => m.type === 'assistant');
|
|
93
|
-
let summary = 'No messages yet';
|
|
94
|
-
if (assistantMessages.length > 0) {
|
|
95
|
-
const lastMessage = assistantMessages[assistantMessages.length - 1];
|
|
96
|
-
const textBlocks = lastMessage.message.content.filter((c: any) => c.type === 'text');
|
|
97
|
-
if (textBlocks.length > 0) {
|
|
98
|
-
const fullText = textBlocks.map((b: any) => 'text' in b ? b.text : '').join(' ');
|
|
99
|
-
const cleanText = fullText.replace(/```[\s\S]*?```/g, '').trim();
|
|
100
|
-
summary = cleanText.slice(0, 100) + (cleanText.length > 100 ? '...' : '');
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
const userMessages = messages.filter((m: SDKMessage) => {
|
|
105
|
-
if (m.type !== 'user') return false;
|
|
106
|
-
let textContent = '';
|
|
107
|
-
if (typeof m.message.content === 'string') {
|
|
108
|
-
textContent = m.message.content;
|
|
109
|
-
} else if (Array.isArray(m.message.content)) {
|
|
110
|
-
const textBlocks = m.message.content.filter(c => c.type === 'text');
|
|
111
|
-
textContent = textBlocks.map(b => 'text' in b ? b.text : '').join(' ');
|
|
112
|
-
}
|
|
113
|
-
return textContent.trim().length > 0;
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
const totalBubbles = userMessages.length + assistantMessages.length;
|
|
117
|
-
|
|
118
|
-
const data = {
|
|
119
|
-
messages,
|
|
120
|
-
title,
|
|
121
|
-
summary,
|
|
122
|
-
count: totalBubbles,
|
|
123
|
-
userCount: userMessages.length,
|
|
124
|
-
assistantCount: assistantMessages.length
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
sessionDataCache[sessionId] = data;
|
|
128
|
-
debug.log('session', `Loaded session ${sessionId}:`, {
|
|
129
|
-
title,
|
|
130
|
-
totalMessages: messages.length,
|
|
131
|
-
userCount: userMessages.length,
|
|
132
|
-
assistantCount: assistantMessages.length,
|
|
133
|
-
totalBubbles: totalBubbles,
|
|
134
|
-
summary: summary.substring(0, 50)
|
|
135
|
-
});
|
|
136
|
-
return data;
|
|
137
84
|
} catch (error) {
|
|
138
85
|
debug.error('session', 'Error fetching session data:', error);
|
|
139
|
-
return {
|
|
140
|
-
messages: [],
|
|
141
|
-
title: 'New Conversation',
|
|
142
|
-
summary: 'No messages yet',
|
|
143
|
-
count: 0,
|
|
144
|
-
userCount: 0,
|
|
145
|
-
assistantCount: 0
|
|
146
|
-
};
|
|
147
86
|
}
|
|
87
|
+
|
|
88
|
+
return { title: 'New Conversation', summary: 'No messages yet', count: 0, userCount: 0, assistantCount: 0 };
|
|
148
89
|
}
|
|
149
90
|
|
|
150
91
|
function getMessageCount(sessionId: string): number {
|
|
@@ -167,12 +108,23 @@
|
|
|
167
108
|
loadingSessionData = true;
|
|
168
109
|
try {
|
|
169
110
|
// Sort newest first and load top 20 so new sessions are always included
|
|
170
|
-
const
|
|
111
|
+
const sessionIds = [...sessions]
|
|
171
112
|
.sort((a, b) => new Date(b.started_at).getTime() - new Date(a.started_at).getTime())
|
|
172
|
-
.slice(0, 20)
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
);
|
|
113
|
+
.slice(0, 20)
|
|
114
|
+
.map(s => s.id);
|
|
115
|
+
|
|
116
|
+
if (sessionIds.length === 0) return;
|
|
117
|
+
|
|
118
|
+
const previews = await ws.http('sessions:preview', { session_ids: sessionIds });
|
|
119
|
+
for (const preview of previews) {
|
|
120
|
+
sessionDataCache[preview.session_id] = {
|
|
121
|
+
title: preview.title,
|
|
122
|
+
summary: preview.summary,
|
|
123
|
+
count: preview.count,
|
|
124
|
+
userCount: preview.userCount,
|
|
125
|
+
assistantCount: preview.assistantCount
|
|
126
|
+
};
|
|
127
|
+
}
|
|
176
128
|
} catch (error) {
|
|
177
129
|
debug.error('session', 'Error preloading session data:', error);
|
|
178
130
|
} finally {
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { onMount } from 'svelte';
|
|
3
|
-
import { sessionState, removeSession, setCurrentSession } from '$frontend/
|
|
4
|
-
import { projectState, setCurrentProject } from '$frontend/
|
|
5
|
-
import { addNotification } from '$frontend/
|
|
6
|
-
import { setCurrentView } from '$frontend/
|
|
7
|
-
import ws from '$frontend/
|
|
3
|
+
import { sessionState, removeSession, setCurrentSession } from '$frontend/stores/core/sessions.svelte';
|
|
4
|
+
import { projectState, setCurrentProject } from '$frontend/stores/core/projects.svelte';
|
|
5
|
+
import { addNotification } from '$frontend/stores/ui/notification.svelte';
|
|
6
|
+
import { setCurrentView } from '$frontend/stores/core/app.svelte';
|
|
7
|
+
import ws from '$frontend/utils/ws';
|
|
8
8
|
import type { ChatSession, Project } from '$shared/types/database/schema';
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import Modal from '$frontend/lib/components/common/Modal.svelte';
|
|
9
|
+
import Input from '../common/form/Input.svelte';
|
|
10
|
+
import Select from '../common/form/Select.svelte';
|
|
11
|
+
import Icon from '$frontend/components/common/display/Icon.svelte';
|
|
12
|
+
import PageTemplate from '../common/display/PageTemplate.svelte';
|
|
13
|
+
import Button from '../common/display/Button.svelte';
|
|
14
|
+
import { showConfirm } from '$frontend/stores/ui/dialog.svelte';
|
|
15
|
+
import Modal from '$frontend/components/common/overlay/Modal.svelte';
|
|
17
16
|
import TimelineModal from '../checkpoint/TimelineModal.svelte';
|
|
18
17
|
import { debug } from '$shared/utils/logger';
|
|
19
18
|
|
|
@@ -62,7 +61,6 @@
|
|
|
62
61
|
|
|
63
62
|
// Cache for session data to avoid multiple API calls
|
|
64
63
|
const sessionDataCache = $state<Record<string, {
|
|
65
|
-
messages: SDKMessage[];
|
|
66
64
|
title: string;
|
|
67
65
|
summary: string;
|
|
68
66
|
count: number;
|
|
@@ -71,95 +69,30 @@
|
|
|
71
69
|
}>>({});
|
|
72
70
|
let loadingSessionData = $state(true);
|
|
73
71
|
|
|
74
|
-
// Helper to get session data from cache or API
|
|
72
|
+
// Helper to get session data from cache or API (single session fallback)
|
|
75
73
|
async function getSessionData(sessionId: string) {
|
|
76
74
|
if (sessionDataCache[sessionId]) {
|
|
77
75
|
return sessionDataCache[sessionId];
|
|
78
76
|
}
|
|
79
77
|
|
|
80
78
|
try {
|
|
81
|
-
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
} else if (Array.isArray(firstUserMessage.message.content)) {
|
|
93
|
-
// Extract text from content blocks
|
|
94
|
-
const textBlocks = firstUserMessage.message.content.filter((c: any) => c.type === 'text');
|
|
95
|
-
textContent = textBlocks.map((b: any) => 'text' in b ? b.text : '').join(' ');
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
if (textContent) {
|
|
99
|
-
title = textContent.slice(0, 60) + (textContent.length > 60 ? '...' : '');
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// Get summary from last assistant message in current HEAD checkpoint
|
|
104
|
-
const assistantMessages = messages.filter((m: SDKMessage) => m.type === 'assistant');
|
|
105
|
-
let summary = 'No messages yet';
|
|
106
|
-
if (assistantMessages.length > 0) {
|
|
107
|
-
const lastMessage = assistantMessages[assistantMessages.length - 1];
|
|
108
|
-
const textBlocks = lastMessage.message.content.filter((c: any) => c.type === 'text');
|
|
109
|
-
if (textBlocks.length > 0) {
|
|
110
|
-
const fullText = textBlocks.map((b: any) => 'text' in b ? b.text : '').join(' ');
|
|
111
|
-
const cleanText = fullText.replace(/```[\s\S]*?```/g, '').trim();
|
|
112
|
-
summary = cleanText.slice(0, 150) + (cleanText.length > 150 ? '...' : '');
|
|
113
|
-
}
|
|
79
|
+
const previews = await ws.http('sessions:preview', { session_ids: [sessionId] });
|
|
80
|
+
const preview = previews[0];
|
|
81
|
+
if (preview) {
|
|
82
|
+
sessionDataCache[sessionId] = {
|
|
83
|
+
title: preview.title,
|
|
84
|
+
summary: preview.summary,
|
|
85
|
+
count: preview.count,
|
|
86
|
+
userCount: preview.userCount,
|
|
87
|
+
assistantCount: preview.assistantCount
|
|
88
|
+
};
|
|
89
|
+
return sessionDataCache[sessionId];
|
|
114
90
|
}
|
|
115
|
-
|
|
116
|
-
// Count user and assistant messages in current HEAD checkpoint
|
|
117
|
-
// Filter out empty user messages (same as ChatInterface.svelte timeline logic)
|
|
118
|
-
const userMessages = messages.filter((m: SDKMessage) => {
|
|
119
|
-
if (m.type !== 'user') return false;
|
|
120
|
-
// Extract text content
|
|
121
|
-
let textContent = '';
|
|
122
|
-
if (typeof m.message.content === 'string') {
|
|
123
|
-
textContent = m.message.content;
|
|
124
|
-
} else if (Array.isArray(m.message.content)) {
|
|
125
|
-
const textBlocks = m.message.content.filter(c => c.type === 'text');
|
|
126
|
-
textContent = textBlocks.map(b => 'text' in b ? b.text : '').join(' ');
|
|
127
|
-
}
|
|
128
|
-
return textContent.trim().length > 0;
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
const totalBubbles = userMessages.length + assistantMessages.length; // Total message bubbles in chat
|
|
132
|
-
|
|
133
|
-
const data = {
|
|
134
|
-
messages,
|
|
135
|
-
title,
|
|
136
|
-
summary,
|
|
137
|
-
count: totalBubbles, // Total bubbles (user + assistant with non-empty content)
|
|
138
|
-
userCount: userMessages.length, // Number of chat sessions/exchanges (non-empty user messages)
|
|
139
|
-
assistantCount: assistantMessages.length
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
sessionDataCache[sessionId] = data;
|
|
143
|
-
debug.log('session', `Loaded session ${sessionId}:`, {
|
|
144
|
-
title,
|
|
145
|
-
totalMessages: messages.length,
|
|
146
|
-
userCount: userMessages.length,
|
|
147
|
-
assistantCount: assistantMessages.length,
|
|
148
|
-
totalBubbles: totalBubbles,
|
|
149
|
-
summary: summary.substring(0, 50)
|
|
150
|
-
});
|
|
151
|
-
return data;
|
|
152
91
|
} catch (error) {
|
|
153
92
|
debug.error('session', 'Error fetching session data:', error);
|
|
154
|
-
return {
|
|
155
|
-
messages: [],
|
|
156
|
-
title: 'New Conversation',
|
|
157
|
-
summary: 'No messages yet',
|
|
158
|
-
count: 0,
|
|
159
|
-
userCount: 0,
|
|
160
|
-
assistantCount: 0
|
|
161
|
-
};
|
|
162
93
|
}
|
|
94
|
+
|
|
95
|
+
return { title: 'New Conversation', summary: 'No messages yet', count: 0, userCount: 0, assistantCount: 0 };
|
|
163
96
|
}
|
|
164
97
|
|
|
165
98
|
// Helper functions that use cached data
|
|
@@ -179,14 +112,23 @@
|
|
|
179
112
|
return sessionDataCache[sessionId]?.summary || 'No messages yet';
|
|
180
113
|
}
|
|
181
114
|
|
|
182
|
-
// Preload session data for visible sessions
|
|
115
|
+
// Preload session data for visible sessions using a single bulk request
|
|
183
116
|
async function preloadSessionData() {
|
|
184
117
|
loadingSessionData = true;
|
|
185
118
|
try {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
);
|
|
119
|
+
const sessionIds = sessions.slice(0, 20).map(s => s.id);
|
|
120
|
+
if (sessionIds.length === 0) return;
|
|
121
|
+
|
|
122
|
+
const previews = await ws.http('sessions:preview', { session_ids: sessionIds });
|
|
123
|
+
for (const preview of previews) {
|
|
124
|
+
sessionDataCache[preview.session_id] = {
|
|
125
|
+
title: preview.title,
|
|
126
|
+
summary: preview.summary,
|
|
127
|
+
count: preview.count,
|
|
128
|
+
userCount: preview.userCount,
|
|
129
|
+
assistantCount: preview.assistantCount
|
|
130
|
+
};
|
|
131
|
+
}
|
|
190
132
|
} catch (error) {
|
|
191
133
|
debug.error('session', 'Error preloading session data:', error);
|
|
192
134
|
} finally {
|
|
@@ -199,14 +141,25 @@
|
|
|
199
141
|
preloadSessionData();
|
|
200
142
|
});
|
|
201
143
|
|
|
202
|
-
// Reload session data when sessions
|
|
144
|
+
// Reload session data when new sessions arrive
|
|
203
145
|
$effect(() => {
|
|
204
146
|
if (sessions.length > 0 && !loadingSessionData) {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
147
|
+
const uncachedIds = sessions.filter(s => !sessionDataCache[s.id]).map(s => s.id);
|
|
148
|
+
if (uncachedIds.length > 0) {
|
|
149
|
+
debug.log('session', `Found ${uncachedIds.length} uncached sessions, loading...`);
|
|
150
|
+
ws.http('sessions:preview', { session_ids: uncachedIds }).then((previews: any[]) => {
|
|
151
|
+
for (const preview of previews) {
|
|
152
|
+
sessionDataCache[preview.session_id] = {
|
|
153
|
+
title: preview.title,
|
|
154
|
+
summary: preview.summary,
|
|
155
|
+
count: preview.count,
|
|
156
|
+
userCount: preview.userCount,
|
|
157
|
+
assistantCount: preview.assistantCount
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
}).catch((err: unknown) => {
|
|
161
|
+
debug.error('session', 'Error loading uncached sessions:', err);
|
|
162
|
+
});
|
|
210
163
|
}
|
|
211
164
|
}
|
|
212
165
|
});
|