@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
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { terminalSessionManager, type TerminalSessionState } from './session.service';
|
|
7
7
|
import { terminalPersistenceManager } from './persistence.service';
|
|
8
|
-
import { terminalStore } from '$frontend/
|
|
8
|
+
import { terminalStore } from '$frontend/stores/features/terminal.svelte';
|
|
9
9
|
import type { TerminalSession } from '$shared/types/terminal';
|
|
10
10
|
import { terminalService } from './terminal.service';
|
|
11
11
|
import { debug } from '$shared/utils/logger';
|
|
@@ -790,7 +790,7 @@ class TerminalProjectManager {
|
|
|
790
790
|
* see the tab list update automatically.
|
|
791
791
|
*/
|
|
792
792
|
private setupCollaborativeListeners(): void {
|
|
793
|
-
import('$frontend/
|
|
793
|
+
import('$frontend/utils/ws').then(({ default: ws }) => {
|
|
794
794
|
// Listen for terminal tab created by another user
|
|
795
795
|
ws.on('terminal:tab-created', (data: {
|
|
796
796
|
sessionId: string;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import type { TerminalLine, TerminalSession, TerminalCommand } from '$shared/types/terminal';
|
|
8
8
|
import { terminalSessionManager, type TerminalSessionState } from './session.service';
|
|
9
9
|
import { backgroundTerminalService } from './background';
|
|
10
|
-
import ws from '$frontend/
|
|
10
|
+
import ws from '$frontend/utils/ws';
|
|
11
11
|
import { debug } from '$shared/utils/logger';
|
|
12
12
|
|
|
13
13
|
export interface TerminalConnectOptions {
|
|
@@ -66,7 +66,7 @@ export class TerminalService {
|
|
|
66
66
|
let outputStartIndex = 0;
|
|
67
67
|
if (typeof window !== 'undefined') {
|
|
68
68
|
try {
|
|
69
|
-
const terminalStoreModule = await import('$frontend/
|
|
69
|
+
const terminalStoreModule = await import('$frontend/stores/features/terminal.svelte');
|
|
70
70
|
const termSession = terminalStoreModule.terminalStore.getSession(sessionId);
|
|
71
71
|
if (termSession && termSession.lines) {
|
|
72
72
|
outputStartIndex = termSession.lines.length;
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
* read from one place (merges backend presence + frontend app state).
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { projectStatusService, type ProjectStatus } from '$frontend/
|
|
11
|
-
import { userStore } from '$frontend/
|
|
12
|
-
import { appState, markSessionUnread, hasUnreadSessionsForProject } from '$frontend/
|
|
13
|
-
import { sessionState } from '$frontend/
|
|
10
|
+
import { projectStatusService, type ProjectStatus } from '$frontend/services/project/status.service';
|
|
11
|
+
import { userStore } from '$frontend/stores/features/user.svelte';
|
|
12
|
+
import { appState, markSessionUnread, hasUnreadSessionsForProject } from '$frontend/stores/core/app.svelte';
|
|
13
|
+
import { sessionState } from '$frontend/stores/core/sessions.svelte';
|
|
14
14
|
|
|
15
15
|
// Shared reactive state
|
|
16
16
|
export const presenceState = $state<{
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* No localStorage usage - server is single source of truth
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import ws from '$frontend/
|
|
9
|
+
import ws from '$frontend/utils/ws';
|
|
10
10
|
import type { Project } from '$shared/types/database/schema';
|
|
11
11
|
|
|
12
12
|
import { debug } from '$shared/utils/logger';
|
|
@@ -64,8 +64,8 @@ export async function setCurrentProject(project: Project | null) {
|
|
|
64
64
|
if (typeof window !== 'undefined') {
|
|
65
65
|
try {
|
|
66
66
|
// Import services dynamically to avoid circular dependency
|
|
67
|
-
const { projectStatusService } = await import('$frontend/
|
|
68
|
-
const { terminalProjectManager } = await import('$frontend/
|
|
67
|
+
const { projectStatusService } = await import('$frontend/services/project');
|
|
68
|
+
const { terminalProjectManager } = await import('$frontend/services/terminal');
|
|
69
69
|
|
|
70
70
|
// Stop tracking previous project if switching
|
|
71
71
|
if (currentProjectId && currentProjectId !== newProjectId) {
|
|
@@ -95,7 +95,7 @@ export async function setCurrentProject(project: Project | null) {
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
// Clear edit mode state from previous project (server retains per-project state)
|
|
98
|
-
const { onProjectLeave, onProjectEnter } = await import('$frontend/
|
|
98
|
+
const { onProjectLeave, onProjectEnter } = await import('$frontend/stores/ui/edit-mode.svelte');
|
|
99
99
|
onProjectLeave();
|
|
100
100
|
|
|
101
101
|
// Clear current session when switching projects
|
|
@@ -250,7 +250,7 @@ export async function loadProjects(restoreProjectId?: string | null) {
|
|
|
250
250
|
// Start tracking the restored project
|
|
251
251
|
if (typeof window !== 'undefined') {
|
|
252
252
|
try {
|
|
253
|
-
const { projectStatusService } = await import('$frontend/
|
|
253
|
+
const { projectStatusService } = await import('$frontend/services/project');
|
|
254
254
|
await projectStatusService.startTracking(existingProject.id);
|
|
255
255
|
} catch (error) {
|
|
256
256
|
debug.error('project', 'Error starting tracking for restored project:', error);
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
import type { ChatSession, SDKMessageFormatter } from '$shared/types/database/schema';
|
|
11
11
|
import type { SDKMessage } from '$shared/types/messaging';
|
|
12
12
|
import { buildMetadataFromTransport } from '$shared/utils/message-formatter';
|
|
13
|
-
import ws from '$frontend/
|
|
13
|
+
import ws from '$frontend/utils/ws';
|
|
14
14
|
import { projectState } from './projects.svelte';
|
|
15
|
-
import { setupEditModeListener, restoreEditMode } from '$frontend/
|
|
16
|
-
import { markSessionUnread, markSessionRead, appState } from '$frontend/
|
|
15
|
+
import { setupEditModeListener, restoreEditMode } from '$frontend/stores/ui/edit-mode.svelte';
|
|
16
|
+
import { markSessionUnread, markSessionRead, appState } from '$frontend/stores/core/app.svelte';
|
|
17
17
|
import { debug } from '$shared/utils/logger';
|
|
18
18
|
|
|
19
19
|
interface SessionState {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Supports no-auth mode (single user, no login required).
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import ws from '$frontend/
|
|
10
|
+
import ws from '$frontend/utils/ws';
|
|
11
11
|
import { debug } from '$shared/utils/logger';
|
|
12
12
|
import type { AuthMode } from '$shared/types/stores/settings';
|
|
13
13
|
|
|
@@ -187,6 +187,34 @@ export const authStore = {
|
|
|
187
187
|
debug.log('auth', `No-auth setup complete: ${result.user.name}`);
|
|
188
188
|
},
|
|
189
189
|
|
|
190
|
+
/**
|
|
191
|
+
* Switch to with-auth mode mid-wizard (e.g. user changed selection after refresh).
|
|
192
|
+
* Regenerates PAT for the existing no-auth admin and updates authMode setting.
|
|
193
|
+
*/
|
|
194
|
+
async switchToWithAuth() {
|
|
195
|
+
const { loadSystemSettings, updateSystemSettings } = await import('$frontend/stores/features/settings.svelte');
|
|
196
|
+
await loadSystemSettings();
|
|
197
|
+
await updateSystemSettings({ authMode: 'required' });
|
|
198
|
+
|
|
199
|
+
const result = await ws.http('auth:regenerate-pat', {});
|
|
200
|
+
personalAccessToken = result.personalAccessToken;
|
|
201
|
+
authMode = 'required';
|
|
202
|
+
debug.log('auth', 'Switched to with-auth mode, PAT regenerated');
|
|
203
|
+
},
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Switch to no-auth mode mid-wizard (e.g. user changed selection after refresh).
|
|
207
|
+
* Only updates the authMode setting; existing user remains unchanged.
|
|
208
|
+
*/
|
|
209
|
+
async switchToNoAuth() {
|
|
210
|
+
const { loadSystemSettings, updateSystemSettings } = await import('$frontend/stores/features/settings.svelte');
|
|
211
|
+
await loadSystemSettings();
|
|
212
|
+
await updateSystemSettings({ authMode: 'none' });
|
|
213
|
+
|
|
214
|
+
authMode = 'none';
|
|
215
|
+
debug.log('auth', 'Switched to no-auth mode');
|
|
216
|
+
},
|
|
217
|
+
|
|
190
218
|
/**
|
|
191
219
|
* Complete setup — transition to ready state after wizard is done.
|
|
192
220
|
* Saves onboardingComplete flag so wizard won't show again.
|
|
@@ -196,7 +224,7 @@ export const authStore = {
|
|
|
196
224
|
|
|
197
225
|
// Save onboardingComplete to system settings
|
|
198
226
|
try {
|
|
199
|
-
const { loadSystemSettings, updateSystemSettings } = await import('$frontend/
|
|
227
|
+
const { loadSystemSettings, updateSystemSettings } = await import('$frontend/stores/features/settings.svelte');
|
|
200
228
|
await loadSystemSettings();
|
|
201
229
|
await updateSystemSettings({ onboardingComplete: true });
|
|
202
230
|
} catch {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import { CLAUDE_CODE_MODELS, registerModels } from '$shared/constants/engines';
|
|
10
10
|
import type { EngineModel, EngineType } from '$shared/types/engine';
|
|
11
|
-
import ws from '$frontend/
|
|
11
|
+
import ws from '$frontend/utils/ws';
|
|
12
12
|
|
|
13
13
|
import { debug } from '$shared/utils/logger';
|
|
14
14
|
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
import { DEFAULT_MODEL, DEFAULT_ENGINE } from '$shared/constants/engines';
|
|
10
10
|
import type { AppSettings, SystemSettings } from '$shared/types/stores/settings';
|
|
11
|
-
import { builtInPresets } from '$frontend/
|
|
12
|
-
import ws from '$frontend/
|
|
11
|
+
import { builtInPresets } from '$frontend/stores/ui/workspace.svelte';
|
|
12
|
+
import ws from '$frontend/utils/ws';
|
|
13
13
|
|
|
14
14
|
import { debug } from '$shared/utils/logger';
|
|
15
15
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { TerminalSession, TerminalLine, TerminalCommand } from '$shared/types/terminal';
|
|
7
|
-
import { terminalService, type StreamingResponse } from '$frontend/
|
|
7
|
+
import { terminalService, type StreamingResponse } from '$frontend/services/terminal';
|
|
8
8
|
import { addNotification } from '../ui/notification.svelte';
|
|
9
9
|
|
|
10
10
|
import { debug } from '$shared/utils/logger';
|
|
@@ -195,7 +195,7 @@ export const terminalStore = {
|
|
|
195
195
|
// Clear persistence data for this session
|
|
196
196
|
debug.log('terminal', `🔴 [closeSession] Clearing persistence data...`);
|
|
197
197
|
try {
|
|
198
|
-
const { terminalPersistenceManager } = await import('$frontend/
|
|
198
|
+
const { terminalPersistenceManager } = await import('$frontend/services/terminal/persistence.service');
|
|
199
199
|
// Remove entire session from persistence (not just stream info)
|
|
200
200
|
terminalPersistenceManager.removeSession(sessionId);
|
|
201
201
|
debug.log('terminal', `🔴 [closeSession] Persistence data cleared`);
|
|
@@ -207,7 +207,7 @@ export const terminalStore = {
|
|
|
207
207
|
// This prevents session from being recreated on browser refresh
|
|
208
208
|
debug.log('terminal', `🔴 [closeSession] Removing from project context...`);
|
|
209
209
|
try {
|
|
210
|
-
const { terminalProjectManager } = await import('$frontend/
|
|
210
|
+
const { terminalProjectManager } = await import('$frontend/services/terminal/project.service');
|
|
211
211
|
terminalProjectManager.removeSessionFromContext(sessionId);
|
|
212
212
|
debug.log('terminal', `🔴 [closeSession] Removed from project context`);
|
|
213
213
|
} catch (error) {
|
|
@@ -710,7 +710,7 @@ export const terminalStore = {
|
|
|
710
710
|
terminalState.lineBuffers.clear();
|
|
711
711
|
|
|
712
712
|
// Clear terminal persistence data (in-memory)
|
|
713
|
-
import('$frontend/
|
|
713
|
+
import('$frontend/services/terminal/persistence.service').then(({ terminalPersistenceManager }) => {
|
|
714
714
|
terminalPersistenceManager.clearAll();
|
|
715
715
|
});
|
|
716
716
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import { authStore } from './auth.svelte';
|
|
9
9
|
import { debug } from '$shared/utils/logger';
|
|
10
|
-
import ws from '$frontend/
|
|
10
|
+
import ws from '$frontend/utils/ws';
|
|
11
11
|
|
|
12
12
|
// Re-export user type from auth store
|
|
13
13
|
export type { AuthUser as AnonymousUser } from './auth.svelte';
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* Server is single source of truth - no client storage
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import ws from '$frontend/
|
|
8
|
-
import { userStore } from '$frontend/
|
|
9
|
-
import { sessionState } from '$frontend/
|
|
7
|
+
import ws from '$frontend/utils/ws';
|
|
8
|
+
import { userStore } from '$frontend/stores/features/user.svelte';
|
|
9
|
+
import { sessionState } from '$frontend/stores/core/sessions.svelte';
|
|
10
10
|
import { debug } from '$shared/utils/logger';
|
|
11
11
|
|
|
12
12
|
export interface EditAttachment {
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Tracks npm package update availability and auto-update state
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import ws from '$frontend/
|
|
7
|
-
import { systemSettings } from '$frontend/
|
|
6
|
+
import ws from '$frontend/utils/ws';
|
|
7
|
+
import { systemSettings } from '$frontend/stores/features/settings.svelte';
|
|
8
8
|
import { debug } from '$shared/utils/logger';
|
|
9
9
|
|
|
10
10
|
interface UpdateState {
|
|
@@ -15,6 +15,7 @@ interface UpdateState {
|
|
|
15
15
|
updating: boolean;
|
|
16
16
|
dismissed: boolean;
|
|
17
17
|
error: string | null;
|
|
18
|
+
errorType: 'check' | 'update' | null;
|
|
18
19
|
updateOutput: string | null;
|
|
19
20
|
updateSuccess: boolean;
|
|
20
21
|
}
|
|
@@ -27,6 +28,7 @@ export const updateState = $state<UpdateState>({
|
|
|
27
28
|
updating: false,
|
|
28
29
|
dismissed: false,
|
|
29
30
|
error: null,
|
|
31
|
+
errorType: null,
|
|
30
32
|
updateOutput: null,
|
|
31
33
|
updateSuccess: false
|
|
32
34
|
});
|
|
@@ -39,6 +41,7 @@ export async function checkForUpdate(): Promise<void> {
|
|
|
39
41
|
|
|
40
42
|
updateState.checking = true;
|
|
41
43
|
updateState.error = null;
|
|
44
|
+
updateState.errorType = null;
|
|
42
45
|
|
|
43
46
|
try {
|
|
44
47
|
const result = await ws.http('system:check-update', {});
|
|
@@ -53,6 +56,7 @@ export async function checkForUpdate(): Promise<void> {
|
|
|
53
56
|
}
|
|
54
57
|
} catch (err) {
|
|
55
58
|
updateState.error = err instanceof Error ? err.message : 'Failed to check for updates';
|
|
59
|
+
updateState.errorType = 'check';
|
|
56
60
|
debug.error('server', 'Update check failed:', err);
|
|
57
61
|
} finally {
|
|
58
62
|
updateState.checking = false;
|
|
@@ -65,6 +69,7 @@ export async function runUpdate(): Promise<void> {
|
|
|
65
69
|
|
|
66
70
|
updateState.updating = true;
|
|
67
71
|
updateState.error = null;
|
|
72
|
+
updateState.errorType = null;
|
|
68
73
|
updateState.updateOutput = null;
|
|
69
74
|
|
|
70
75
|
try {
|
|
@@ -77,6 +82,7 @@ export async function runUpdate(): Promise<void> {
|
|
|
77
82
|
debug.log('server', 'Update completed successfully');
|
|
78
83
|
} catch (err) {
|
|
79
84
|
updateState.error = err instanceof Error ? err.message : 'Update failed';
|
|
85
|
+
updateState.errorType = 'update';
|
|
80
86
|
debug.error('server', 'Update failed:', err);
|
|
81
87
|
} finally {
|
|
82
88
|
updateState.updating = false;
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Re-exports theme functions from the store for convenience
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
export { initializeTheme, setTheme, toggleDarkMode, isDarkMode, currentTheme } from '$frontend/
|
|
6
|
+
export { initializeTheme, setTheme, toggleDarkMode, isDarkMode, currentTheme } from '$frontend/stores/ui/theme.svelte';
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import { WSClient } from '$shared/utils/ws-client';
|
|
8
8
|
import type { WSAPI } from '$backend/ws';
|
|
9
|
-
import { setConnectionStatus } from '$frontend/
|
|
9
|
+
import { setConnectionStatus } from '$frontend/stores/ui/connection.svelte';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Get WebSocket URL based on environment
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myrialabs/clopen",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "All-in-one web workspace for Claude Code & OpenCode — chat, terminal, git, browser preview, checkpoints, and real-time collaboration",
|
|
5
5
|
"author": "Myria Labs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"dev:backend": "bun --watch backend/index.ts",
|
|
50
50
|
"dev:frontend": "bunx vite dev",
|
|
51
51
|
"build": "vite build",
|
|
52
|
-
"start": "
|
|
52
|
+
"start": "bun scripts/start.ts",
|
|
53
53
|
"check": "svelte-check --tsconfig ./tsconfig.json",
|
|
54
54
|
"lint": "eslint .",
|
|
55
55
|
"lint:fix": "eslint . --fix",
|
package/scripts/dev.ts
CHANGED
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import concurrently from 'concurrently';
|
|
10
|
-
import { findAvailablePort } from '../backend/
|
|
10
|
+
import { findAvailablePort } from '../backend/utils/port-utils';
|
|
11
11
|
|
|
12
|
-
const desiredBackend = process.env.PORT_BACKEND ? parseInt(process.env.PORT_BACKEND) :
|
|
13
|
-
const desiredFrontend = process.env.PORT_FRONTEND ? parseInt(process.env.PORT_FRONTEND) :
|
|
12
|
+
const desiredBackend = process.env.PORT_BACKEND ? parseInt(process.env.PORT_BACKEND) : 9161;
|
|
13
|
+
const desiredFrontend = process.env.PORT_FRONTEND ? parseInt(process.env.PORT_FRONTEND) : 9151;
|
|
14
14
|
|
|
15
15
|
// Resolve available ports
|
|
16
16
|
const backendPort = await findAvailablePort(desiredBackend);
|
|
@@ -33,6 +33,7 @@ console.log(`Frontend: http://localhost:${frontendPort}`);
|
|
|
33
33
|
console.log();
|
|
34
34
|
|
|
35
35
|
const portEnv = {
|
|
36
|
+
NODE_ENV: 'development',
|
|
36
37
|
PORT_BACKEND: String(backendPort),
|
|
37
38
|
PORT_FRONTEND: String(frontendPort),
|
|
38
39
|
};
|
|
@@ -36,7 +36,7 @@ export type LucideIconName = keyof typeof lucideIconRegistry;
|
|
|
36
36
|
`;
|
|
37
37
|
|
|
38
38
|
// Write the file using Bun.write
|
|
39
|
-
await Bun.write('src/
|
|
39
|
+
await Bun.write('src/components/common/lucide-icons.ts', lucideIconsContent);
|
|
40
40
|
console.log(`Generated lucide-icons.ts with ${iconNames.length} icons`);
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -75,7 +75,7 @@ export type MaterialIconName = keyof typeof materialIconRegistry;
|
|
|
75
75
|
`;
|
|
76
76
|
|
|
77
77
|
// Write the file using Bun.write
|
|
78
|
-
await Bun.write('src/
|
|
78
|
+
await Bun.write('src/components/common/material-icons.ts', materialIconsContent);
|
|
79
79
|
console.log(`Generated material-icons.ts with ${iconNames.length} icons`);
|
|
80
80
|
}
|
|
81
81
|
|
package/scripts/start.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Production start script — resolves available port before starting backend.
|
|
5
|
+
* Mirrors scripts/dev.ts: ensures port is truly available (IPv4 + IPv6)
|
|
6
|
+
* before the backend binds, avoiding silent hangs from zombie processes.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { findAvailablePort } from '../backend/utils/port-utils';
|
|
10
|
+
|
|
11
|
+
const desiredPort = process.env.PORT ? parseInt(process.env.PORT) : 9141;
|
|
12
|
+
|
|
13
|
+
const port = await findAvailablePort(desiredPort);
|
|
14
|
+
|
|
15
|
+
if (port !== desiredPort) {
|
|
16
|
+
console.log(`⚠️ Port ${desiredPort} in use, using ${port}`);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Set resolved values before importing backend (env.ts reads at import time)
|
|
20
|
+
process.env.PORT = String(port);
|
|
21
|
+
process.env.HOST = process.env.HOST || 'localhost';
|
|
22
|
+
process.env.NODE_ENV = 'production';
|
|
23
|
+
|
|
24
|
+
await import('../backend/index.ts');
|
package/shared/types/ui/icons.ts
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
// Icon types for type safety
|
|
6
|
-
import type { lucideIconRegistry } from '$frontend/
|
|
7
|
-
import type { materialIconRegistry } from '$frontend/
|
|
6
|
+
import type { lucideIconRegistry } from '$frontend/components/common/lucide-icons';
|
|
7
|
+
import type { materialIconRegistry } from '$frontend/components/common/material-icons';
|
|
8
8
|
|
|
9
9
|
// Individual icon type exports from auto-generated files
|
|
10
|
-
export type { LucideIconName } from '$frontend/
|
|
11
|
-
export type { MaterialIconName } from '$frontend/
|
|
10
|
+
export type { LucideIconName } from '$frontend/components/common/lucide-icons';
|
|
11
|
+
export type { MaterialIconName } from '$frontend/components/common/material-icons';
|
|
12
12
|
|
|
13
13
|
// Combined icon registry type
|
|
14
14
|
const iconRegistry = {
|
|
@@ -10,7 +10,7 @@ import { debug } from '$shared/utils/logger';
|
|
|
10
10
|
let wsClient: any = null;
|
|
11
11
|
async function getWS() {
|
|
12
12
|
if (!wsClient && typeof window !== 'undefined') {
|
|
13
|
-
const module = await import('$frontend/
|
|
13
|
+
const module = await import('$frontend/utils/ws');
|
|
14
14
|
wsClient = module.default;
|
|
15
15
|
}
|
|
16
16
|
return wsClient;
|
|
@@ -312,7 +312,7 @@ export class WSRouter<
|
|
|
312
312
|
}),
|
|
313
313
|
handler: async ({ conn, data }) => {
|
|
314
314
|
// Import ws server to update context
|
|
315
|
-
const { ws: wsServer } = await import('$backend/
|
|
315
|
+
const { ws: wsServer } = await import('$backend/utils/ws');
|
|
316
316
|
|
|
317
317
|
// userId is set exclusively by auth handlers (auth:login, auth:setup, auth:accept-invite)
|
|
318
318
|
// ws:set-context only handles projectId
|
|
@@ -657,7 +657,7 @@ export class WSRouter<
|
|
|
657
657
|
|
|
658
658
|
// Register connection with ws singleton
|
|
659
659
|
try {
|
|
660
|
-
const { ws: wsServer } = await import('$backend/
|
|
660
|
+
const { ws: wsServer } = await import('$backend/utils/ws');
|
|
661
661
|
wsServer.register(conn);
|
|
662
662
|
} catch (err) {
|
|
663
663
|
debug.error('websocket', 'Failed to register connection:', err);
|
|
@@ -669,7 +669,7 @@ export class WSRouter<
|
|
|
669
669
|
// Unregister connection from ws singleton
|
|
670
670
|
// All registered cleanups are called automatically by unregister()
|
|
671
671
|
try {
|
|
672
|
-
const { ws: wsServer } = await import('$backend/
|
|
672
|
+
const { ws: wsServer } = await import('$backend/utils/ws');
|
|
673
673
|
wsServer.unregister(conn);
|
|
674
674
|
} catch (err) {
|
|
675
675
|
debug.error('websocket', 'Failed to unregister connection:', err);
|
package/vite.config.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { defineConfig } from 'vite';
|
|
|
3
3
|
import tailwindcss from '@tailwindcss/vite';
|
|
4
4
|
import { resolve } from 'path';
|
|
5
5
|
|
|
6
|
-
const frontendPort = parseInt(process.env.PORT_FRONTEND || '
|
|
7
|
-
const backendPort = parseInt(process.env.PORT_BACKEND || '
|
|
6
|
+
const frontendPort = parseInt(process.env.PORT_FRONTEND || '9151');
|
|
7
|
+
const backendPort = parseInt(process.env.PORT_BACKEND || '9161');
|
|
8
8
|
|
|
9
9
|
export default defineConfig({
|
|
10
10
|
plugins: [tailwindcss(), svelte()],
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/backend/{lib/database → database}/migrations/010_add_soft_delete_and_branch_support.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/backend/{lib/database → database}/migrations/017_add_current_session_to_user_projects.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/backend/{lib/database → database}/migrations/023_create_user_unread_sessions_table.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|