@cryptiklemur/lattice 4.0.2 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/lattice +1 -9
- package/dist/client/assets/{angular-html-N8PCEquT.js → angular-html-DKTL-XDO.js} +1 -1
- package/dist/client/assets/{angular-ts-CJ8RJIPD.js → angular-ts-tvBzOwQR.js} +1 -1
- package/dist/client/assets/{apl-BD6tCLWN.js → apl-CCzl5qFl.js} +1 -1
- package/dist/client/assets/{astro-CpIIfBs6.js → astro-DNQTpO2Y.js} +1 -1
- package/dist/client/assets/{blade-D3qgnjiV.js → blade-CyJoIMeJ.js} +1 -1
- package/dist/client/assets/{c-Dr6ADN_t.js → c-OEwk5KN8.js} +1 -1
- package/dist/client/assets/{cobol-BIfDE0Hr.js → cobol-DpHyJzz2.js} +1 -1
- package/dist/client/assets/{coffee-DHQ57vfY.js → coffee-BX5dbDzZ.js} +1 -1
- package/dist/client/assets/{cpp-CEBY6JOp.js → cpp-BTBjNg2U.js} +1 -1
- package/dist/client/assets/{crystal-D125CSmP.js → crystal-CNzZd6DW.js} +1 -1
- package/dist/client/assets/{css-CBmrkYSr.js → css-BuKsNmms.js} +1 -1
- package/dist/client/assets/{dist-A_mCRD1f.js → dist-CKpDHMy6.js} +2 -2
- package/dist/client/assets/{edge-Ccsz7cJW.js → edge-DzhnGgJE.js} +1 -1
- package/dist/client/assets/{elixir-Do6gk14X.js → elixir-Dqs0waqF.js} +1 -1
- package/dist/client/assets/{elm-Db22zT4C.js → elm-BtWwjxWn.js} +1 -1
- package/dist/client/assets/{erb-MXVqAAJD.js → erb-iPD89b4v.js} +1 -1
- package/dist/client/assets/{git-rebase-B-LLWBOA.js → git-rebase-BxVNXJL4.js} +1 -1
- package/dist/client/assets/{glimmer-js-eWszRU73.js → glimmer-js-BlyCupwF.js} +1 -1
- package/dist/client/assets/{glimmer-ts-VQmwGqUp.js → glimmer-ts-DjIxWOS9.js} +1 -1
- package/dist/client/assets/{glsl-B8ilOfAl.js → glsl-CGIL-65r.js} +1 -1
- package/dist/client/assets/{graphql-DnTqxeOc.js → graphql-DeOn6mNV.js} +1 -1
- package/dist/client/assets/{hack-XJsHYSQb.js → hack-DVppeCmS.js} +1 -1
- package/dist/client/assets/{haml-CQ7Vqzwp.js → haml-WDhua0Mp.js} +1 -1
- package/dist/client/assets/{handlebars-C4szooBf.js → handlebars-i2Fu_9HI.js} +1 -1
- package/dist/client/assets/{html-B6EgAiSd.js → html-B1e6oxzK.js} +1 -1
- package/dist/client/assets/{html-derivative-DdinogQX.js → html-derivative-MofKXIVd.js} +1 -1
- package/dist/client/assets/{http-BSLxCgRq.js → http-Dk6S5pRD.js} +1 -1
- package/dist/client/assets/{hurl-pOsTwNfp.js → hurl-CroFYYJG.js} +1 -1
- package/dist/client/assets/{index-BHQ_8mvl.js → index-CVu-S6Yk.js} +2 -2
- package/dist/client/assets/{java-DRQLiiST.js → java-B89FYjqS.js} +1 -1
- package/dist/client/assets/{javascript-DvEK2-47.js → javascript-m6CO1Uiy.js} +1 -1
- package/dist/client/assets/{jinja-D2NYJ25y.js → jinja-DC9Wi41X.js} +1 -1
- package/dist/client/assets/{jison-DDZaLNAp.js → jison-6xiegwDk.js} +1 -1
- package/dist/client/assets/{json-TGR0NIWd.js → json-HA-96-qr.js} +1 -1
- package/dist/client/assets/{jsx-BjUoPYga.js → jsx-Wt1a8i8U.js} +1 -1
- package/dist/client/assets/{julia-C4gjSpFu.js → julia-7M93VBON.js} +1 -1
- package/dist/client/assets/{just-H351x5u_.js → just-CjfDLYLv.js} +1 -1
- package/dist/client/assets/{latex-BiTmf6gf.js → latex-CitsJ46x.js} +1 -1
- package/dist/client/assets/{liquid-86ufjRy-.js → liquid-C8VIFin8.js} +1 -1
- package/dist/client/assets/{lua-BNxR0F_8.js → lua-Ba2N7esc.js} +1 -1
- package/dist/client/assets/{marko-CvRxpRjM.js → marko-lTLvb2wu.js} +1 -1
- package/dist/client/assets/{mdc-CYbAIy2C.js → mdc-D6IV-8FD.js} +1 -1
- package/dist/client/assets/{nginx-egdgMq-F.js → nginx-Ch5AjE6S.js} +1 -1
- package/dist/client/assets/{nim-CXBJVz_w.js → nim-WmDDC6LW.js} +1 -1
- package/dist/client/assets/{perl-XRfMobzg.js → perl-CQv0gYuq.js} +1 -1
- package/dist/client/assets/{php-Br7a8uil.js → php-BJmH0qOB.js} +1 -1
- package/dist/client/assets/{pug-BVbbUVvy.js → pug-CsHPkzc9.js} +1 -1
- package/dist/client/assets/{qml-ByKvrL1j.js → qml-B36ecArG.js} +1 -1
- package/dist/client/assets/{r-mVoV0Ni6.js → r-D5Yi5Z4y.js} +1 -1
- package/dist/client/assets/{razor-T5O-9UJL.js → razor-CHAxVq4R.js} +1 -1
- package/dist/client/assets/{regexp-CioRuhuN.js → regexp-gfs--3M7.js} +1 -1
- package/dist/client/assets/{rst-V__uTudD.js → rst-ugdlp-hl.js} +1 -1
- package/dist/client/assets/{ruby-C_PuKPTI.js → ruby-CDRRW37j.js} +1 -1
- package/dist/client/assets/{sas-D_DqqQH4.js → sas-DZaNQaIP.js} +1 -1
- package/dist/client/assets/{scss-D-TjzZ4c.js → scss-CzWQEplj.js} +1 -1
- package/dist/client/assets/{shellscript-E5759VHu.js → shellscript-fgYvpu9N.js} +1 -1
- package/dist/client/assets/{shellsession-AESTM-Pv.js → shellsession-BoAohHh7.js} +1 -1
- package/dist/client/assets/{soy-QrbrrcDv.js → soy-DBzVgv9x.js} +1 -1
- package/dist/client/assets/{sql-0M8VcDHD.js → sql-BYXpAYTs.js} +1 -1
- package/dist/client/assets/{stata-CgeIpGtc.js → stata-I71MMY3p.js} +1 -1
- package/dist/client/assets/{surrealql-DBGwnZbw.js → surrealql-C9U8_1VO.js} +1 -1
- package/dist/client/assets/{svelte-Cv0PvUc_.js → svelte-VOFrPnWT.js} +1 -1
- package/dist/client/assets/{templ-B9t7xRE4.js → templ-BIaxAEtC.js} +1 -1
- package/dist/client/assets/{tex-DhZZ8dr2.js → tex-D1dwnBE5.js} +1 -1
- package/dist/client/assets/{ts-tags-BFv8sbnd.js → ts-tags-C0L2Q0r5.js} +1 -1
- package/dist/client/assets/{tsx-CXC9KSbY.js → tsx-BqcycEv1.js} +1 -1
- package/dist/client/assets/{twig-CM_OO66r.js → twig-vyWqOhpM.js} +1 -1
- package/dist/client/assets/{typescript-BdgOTaoD.js → typescript-B2YbovqG.js} +1 -1
- package/dist/client/assets/{vue-BnQhjnCm.js → vue-CbXxGdjo.js} +1 -1
- package/dist/client/assets/{vue-html-CNnGecRI.js → vue-html-DDX4KXW7.js} +1 -1
- package/dist/client/assets/{vue-vine-DCuMkRhK.js → vue-vine-DsyY1LR5.js} +1 -1
- package/dist/client/assets/{xml-CbTD7cB8.js → xml-Ddi0-r0D.js} +1 -1
- package/dist/client/assets/{xsl-uOqqo7cf.js → xsl-CsFcZHFS.js} +1 -1
- package/dist/client/assets/{yaml-BNrLoH59.js → yaml-tGJWoH6Y.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/client/sw.js +1 -1
- package/dist/server/analytics/engine.js +832 -0
- package/dist/server/assets.js +39 -0
- package/dist/server/auth/passphrase.js +70 -0
- package/dist/server/config.js +47 -0
- package/dist/server/daemon.js +535 -0
- package/dist/server/features/ralph-loop.js +138 -0
- package/dist/server/features/scheduler.js +260 -0
- package/dist/server/features/sticky-notes.js +99 -0
- package/dist/server/handlers/analytics.js +28 -0
- package/dist/server/handlers/attachment.js +158 -0
- package/dist/server/handlers/bookmarks.js +41 -0
- package/dist/server/handlers/chat.js +350 -0
- package/dist/server/handlers/editor.js +72 -0
- package/dist/server/handlers/fs.js +234 -0
- package/dist/server/handlers/loop.js +33 -0
- package/dist/server/handlers/memory.js +181 -0
- package/dist/server/handlers/mesh.js +322 -0
- package/dist/server/handlers/notes.js +36 -0
- package/dist/server/handlers/plugins.js +593 -0
- package/dist/server/handlers/project-settings.js +166 -0
- package/dist/server/handlers/scheduler.js +52 -0
- package/dist/server/handlers/session.js +194 -0
- package/dist/server/handlers/settings.js +148 -0
- package/dist/server/handlers/skills.js +360 -0
- package/dist/server/handlers/terminal.js +75 -0
- package/dist/server/handlers/themes.js +102 -0
- package/dist/server/handlers/update.js +124 -0
- package/dist/server/identity.js +45 -0
- package/dist/server/index.js +435 -0
- package/dist/server/logger.js +20 -0
- package/dist/server/mesh/connector.js +355 -0
- package/dist/server/mesh/crypto.js +88 -0
- package/dist/server/mesh/discovery.js +95 -0
- package/dist/server/mesh/pairing.js +104 -0
- package/dist/server/mesh/peers.js +54 -0
- package/dist/server/mesh/proxy.js +86 -0
- package/dist/server/mesh/session-sync.js +85 -0
- package/dist/server/project/bookmarks.js +77 -0
- package/dist/server/project/context-breakdown.js +279 -0
- package/dist/server/project/file-browser.js +97 -0
- package/dist/server/project/project-files.js +274 -0
- package/dist/server/project/registry.js +51 -0
- package/dist/server/project/sdk-bridge.js +960 -0
- package/dist/server/project/session.js +696 -0
- package/dist/server/project/terminal.js +87 -0
- package/dist/server/project/warmup.js +242 -0
- package/dist/server/push.js +87 -0
- package/dist/server/tls.js +50 -0
- package/dist/server/tui.js +83 -0
- package/dist/server/update-checker.js +119 -0
- package/dist/server/ws/broadcast.js +50 -0
- package/dist/server/ws/router.js +105 -0
- package/dist/server/ws/server.js +2 -0
- package/dist/shared/analytics.js +1 -0
- package/dist/shared/messages.js +1 -0
- package/dist/shared/models.js +1 -0
- package/dist/shared/project-settings.js +1 -0
- package/package.json +5 -8
- package/themes/alabaster.json +9 -0
- package/themes/amoled.json +20 -0
- package/themes/ayu-light.json +9 -0
- package/themes/catppuccin-latte.json +9 -0
- package/themes/catppuccin-mocha.json +9 -0
- package/themes/clay-light.json +10 -0
- package/themes/clay.json +10 -0
- package/themes/dracula.json +9 -0
- package/themes/everforest-light.json +9 -0
- package/themes/everforest.json +9 -0
- package/themes/github-light.json +9 -0
- package/themes/gruvbox-dark.json +9 -0
- package/themes/gruvbox-light.json +9 -0
- package/themes/horizon-light.json +9 -0
- package/themes/kanagawa-lotus.json +9 -0
- package/themes/kanagawa.json +9 -0
- package/themes/modus-operandi.json +9 -0
- package/themes/monokai.json +9 -0
- package/themes/nightfox.json +9 -0
- package/themes/nord-light.json +9 -0
- package/themes/nord.json +9 -0
- package/themes/one-dark.json +9 -0
- package/themes/one-light.json +9 -0
- package/themes/palenight.json +9 -0
- package/themes/paper.json +9 -0
- package/themes/penumbra-light.json +9 -0
- package/themes/poimandres.json +9 -0
- package/themes/quiet-light.json +9 -0
- package/themes/rose-pine-dawn.json +9 -0
- package/themes/rose-pine.json +9 -0
- package/themes/solarized-dark.json +9 -0
- package/themes/solarized-light.json +9 -0
- package/themes/synthwave84.json +9 -0
- package/themes/tokyo-night-light.json +9 -0
- package/themes/tokyo-night.json +9 -0
- package/themes/vesper.json +9 -0
- package/index.html +0 -20
- package/public/icons/icon-192.svg +0 -11
- package/public/icons/icon-512.svg +0 -11
- package/public/sw-push.js +0 -53
- package/src/client/App.tsx +0 -42
- package/src/client/commands.ts +0 -36
- package/src/client/components/analytics/AnalyticsView.tsx +0 -244
- package/src/client/components/analytics/ChartCard.tsx +0 -194
- package/src/client/components/analytics/PeriodSelector.tsx +0 -42
- package/src/client/components/analytics/QuickStats.tsx +0 -122
- package/src/client/components/analytics/chartTokens.ts +0 -188
- package/src/client/components/analytics/charts/ActivityCalendar.tsx +0 -204
- package/src/client/components/analytics/charts/CacheEfficiencyChart.tsx +0 -56
- package/src/client/components/analytics/charts/ContextUtilizationChart.tsx +0 -106
- package/src/client/components/analytics/charts/CostAreaChart.tsx +0 -79
- package/src/client/components/analytics/charts/CostDistributionChart.tsx +0 -59
- package/src/client/components/analytics/charts/CostDonutChart.tsx +0 -84
- package/src/client/components/analytics/charts/CumulativeCostChart.tsx +0 -59
- package/src/client/components/analytics/charts/DailySummaryCards.tsx +0 -86
- package/src/client/components/analytics/charts/HourlyHeatmap.tsx +0 -133
- package/src/client/components/analytics/charts/NodeFleetOverview.tsx +0 -89
- package/src/client/components/analytics/charts/PermissionBreakdown.tsx +0 -98
- package/src/client/components/analytics/charts/ProjectRadar.tsx +0 -126
- package/src/client/components/analytics/charts/ResponseTimeScatter.tsx +0 -96
- package/src/client/components/analytics/charts/SessionBubbleChart.tsx +0 -114
- package/src/client/components/analytics/charts/SessionComplexityList.tsx +0 -65
- package/src/client/components/analytics/charts/SessionTimeline.tsx +0 -107
- package/src/client/components/analytics/charts/TokenFlowChart.tsx +0 -78
- package/src/client/components/analytics/charts/TokenSankeyChart.tsx +0 -93
- package/src/client/components/analytics/charts/ToolSunburst.tsx +0 -123
- package/src/client/components/analytics/charts/ToolTreemap.tsx +0 -110
- package/src/client/components/auth/PassphrasePrompt.tsx +0 -70
- package/src/client/components/chat/AttachmentChips.tsx +0 -116
- package/src/client/components/chat/ChatInput.tsx +0 -533
- package/src/client/components/chat/ChatView.tsx +0 -1076
- package/src/client/components/chat/CommandPalette.tsx +0 -162
- package/src/client/components/chat/ElicitationCard.tsx +0 -238
- package/src/client/components/chat/Message.tsx +0 -825
- package/src/client/components/chat/ModelSelector.tsx +0 -108
- package/src/client/components/chat/PermissionModeSelector.tsx +0 -41
- package/src/client/components/chat/PromptQuestion.tsx +0 -271
- package/src/client/components/chat/StatusBar.tsx +0 -50
- package/src/client/components/chat/TodoCard.tsx +0 -57
- package/src/client/components/chat/ToolGroup.tsx +0 -129
- package/src/client/components/chat/ToolResultRenderer.tsx +0 -348
- package/src/client/components/chat/VoiceRecorder.tsx +0 -85
- package/src/client/components/chat/toolSummary.ts +0 -41
- package/src/client/components/dashboard/DashboardView.tsx +0 -200
- package/src/client/components/dashboard/ProjectDashboardView.tsx +0 -179
- package/src/client/components/mesh/NodeBadge.tsx +0 -24
- package/src/client/components/mesh/PairingDialog.tsx +0 -340
- package/src/client/components/project-settings/ProjectClaude.tsx +0 -318
- package/src/client/components/project-settings/ProjectEnvironment.tsx +0 -235
- package/src/client/components/project-settings/ProjectGeneral.tsx +0 -76
- package/src/client/components/project-settings/ProjectMcp.tsx +0 -232
- package/src/client/components/project-settings/ProjectMemory.tsx +0 -488
- package/src/client/components/project-settings/ProjectNotifications.tsx +0 -48
- package/src/client/components/project-settings/ProjectPermissions.tsx +0 -209
- package/src/client/components/project-settings/ProjectPlugins.tsx +0 -117
- package/src/client/components/project-settings/ProjectRules.tsx +0 -286
- package/src/client/components/project-settings/ProjectSettingsView.tsx +0 -117
- package/src/client/components/project-settings/ProjectSkills.tsx +0 -91
- package/src/client/components/settings/Appearance.tsx +0 -275
- package/src/client/components/settings/BudgetSettings.tsx +0 -165
- package/src/client/components/settings/ClaudeSettings.tsx +0 -175
- package/src/client/components/settings/Editor.tsx +0 -123
- package/src/client/components/settings/Environment.tsx +0 -185
- package/src/client/components/settings/GlobalMcp.tsx +0 -216
- package/src/client/components/settings/GlobalMemory.tsx +0 -19
- package/src/client/components/settings/GlobalPlugins.tsx +0 -806
- package/src/client/components/settings/GlobalRules.tsx +0 -149
- package/src/client/components/settings/GlobalSkills.tsx +0 -140
- package/src/client/components/settings/MeshStatus.tsx +0 -183
- package/src/client/components/settings/Notifications.tsx +0 -123
- package/src/client/components/settings/SettingsView.tsx +0 -75
- package/src/client/components/settings/SkillMarketplace.tsx +0 -175
- package/src/client/components/settings/ThemePreview.tsx +0 -140
- package/src/client/components/settings/ThemeWizard.tsx +0 -405
- package/src/client/components/settings/mcp-shared.tsx +0 -194
- package/src/client/components/settings/skill-shared.tsx +0 -186
- package/src/client/components/setup/SetupWizard.tsx +0 -755
- package/src/client/components/sidebar/AddProjectModal.tsx +0 -438
- package/src/client/components/sidebar/NodeSettingsModal.tsx +0 -206
- package/src/client/components/sidebar/ProjectDropdown.tsx +0 -211
- package/src/client/components/sidebar/ProjectRail.tsx +0 -353
- package/src/client/components/sidebar/SearchFilter.tsx +0 -52
- package/src/client/components/sidebar/SessionList.tsx +0 -599
- package/src/client/components/sidebar/SettingsSidebar.tsx +0 -139
- package/src/client/components/sidebar/Sidebar.tsx +0 -469
- package/src/client/components/sidebar/UserIsland.tsx +0 -282
- package/src/client/components/sidebar/UserMenu.tsx +0 -107
- package/src/client/components/ui/CommandPalette.tsx +0 -321
- package/src/client/components/ui/ContextMenu.tsx +0 -153
- package/src/client/components/ui/ErrorBoundary.tsx +0 -56
- package/src/client/components/ui/IconPicker.tsx +0 -184
- package/src/client/components/ui/KeyboardShortcuts.tsx +0 -129
- package/src/client/components/ui/LatticeLogomark.tsx +0 -19
- package/src/client/components/ui/NodeDisconnectedOverlay.tsx +0 -35
- package/src/client/components/ui/PopupMenu.tsx +0 -120
- package/src/client/components/ui/SaveFooter.tsx +0 -63
- package/src/client/components/ui/Toast.tsx +0 -132
- package/src/client/components/ui/UpdateBanner.tsx +0 -110
- package/src/client/components/ui/UpdatePrompt.tsx +0 -47
- package/src/client/components/workspace/BookmarksView.tsx +0 -156
- package/src/client/components/workspace/FileBrowser.tsx +0 -174
- package/src/client/components/workspace/FileTree.tsx +0 -129
- package/src/client/components/workspace/FileViewer.tsx +0 -211
- package/src/client/components/workspace/NoteCard.tsx +0 -120
- package/src/client/components/workspace/NotesView.tsx +0 -102
- package/src/client/components/workspace/ScheduledTasksView.tsx +0 -117
- package/src/client/components/workspace/SplitPane.tsx +0 -81
- package/src/client/components/workspace/TabBar.tsx +0 -170
- package/src/client/components/workspace/TaskCard.tsx +0 -159
- package/src/client/components/workspace/TaskEditModal.tsx +0 -129
- package/src/client/components/workspace/TerminalInstance.tsx +0 -171
- package/src/client/components/workspace/TerminalView.tsx +0 -110
- package/src/client/components/workspace/WorkspaceView.tsx +0 -141
- package/src/client/hooks/useAnalytics.ts +0 -84
- package/src/client/hooks/useAttachments.ts +0 -313
- package/src/client/hooks/useBookmarks.ts +0 -57
- package/src/client/hooks/useEditorConfig.ts +0 -28
- package/src/client/hooks/useFocusTrap.ts +0 -74
- package/src/client/hooks/useIdleDetection.ts +0 -50
- package/src/client/hooks/useInstallPrompt.ts +0 -53
- package/src/client/hooks/useMesh.ts +0 -89
- package/src/client/hooks/useNotifications.ts +0 -54
- package/src/client/hooks/useOnline.ts +0 -6
- package/src/client/hooks/useProjectSettings.ts +0 -56
- package/src/client/hooks/useProjects.ts +0 -98
- package/src/client/hooks/usePushNotifications.ts +0 -92
- package/src/client/hooks/useSaveState.ts +0 -65
- package/src/client/hooks/useSession.ts +0 -580
- package/src/client/hooks/useSidebar.ts +0 -90
- package/src/client/hooks/useSkills.ts +0 -30
- package/src/client/hooks/useSpinnerVerb.ts +0 -36
- package/src/client/hooks/useSwipeDrawer.ts +0 -299
- package/src/client/hooks/useTheme.ts +0 -114
- package/src/client/hooks/useTimeTick.ts +0 -35
- package/src/client/hooks/useVoiceRecorder.ts +0 -169
- package/src/client/hooks/useWebSocket.ts +0 -27
- package/src/client/hooks/useWorkspace.ts +0 -57
- package/src/client/lib/theme-derive.ts +0 -196
- package/src/client/lib/workspace-url.ts +0 -219
- package/src/client/main.tsx +0 -10
- package/src/client/providers/WebSocketProvider.tsx +0 -186
- package/src/client/router.tsx +0 -578
- package/src/client/stores/analytics.ts +0 -68
- package/src/client/stores/bookmarks.ts +0 -45
- package/src/client/stores/mesh.ts +0 -78
- package/src/client/stores/session.ts +0 -569
- package/src/client/stores/sidebar.ts +0 -530
- package/src/client/stores/theme.ts +0 -44
- package/src/client/stores/workspace.ts +0 -518
- package/src/client/styles/global.css +0 -391
- package/src/client/styles/theme-vars.css +0 -18
- package/src/client/themes/index.ts +0 -105
- package/src/client/utils/editorUrl.ts +0 -55
- package/src/client/utils/findDuplicateKeys.ts +0 -12
- package/src/client/utils/formatSessionTitle.ts +0 -17
- package/src/client/vite-env.d.ts +0 -6
- package/src/server/analytics/engine.ts +0 -920
- package/src/server/assets.ts +0 -45
- package/src/server/auth/passphrase.ts +0 -78
- package/src/server/config.ts +0 -55
- package/src/server/daemon.ts +0 -567
- package/src/server/features/ralph-loop.ts +0 -173
- package/src/server/features/scheduler.ts +0 -304
- package/src/server/features/sticky-notes.ts +0 -104
- package/src/server/handlers/analytics.ts +0 -39
- package/src/server/handlers/attachment.ts +0 -189
- package/src/server/handlers/bookmarks.ts +0 -50
- package/src/server/handlers/chat.ts +0 -381
- package/src/server/handlers/editor.ts +0 -76
- package/src/server/handlers/fs.ts +0 -251
- package/src/server/handlers/loop.ts +0 -37
- package/src/server/handlers/memory.ts +0 -182
- package/src/server/handlers/mesh.ts +0 -362
- package/src/server/handlers/notes.ts +0 -47
- package/src/server/handlers/plugins.ts +0 -655
- package/src/server/handlers/project-settings.ts +0 -180
- package/src/server/handlers/scheduler.ts +0 -64
- package/src/server/handlers/session.ts +0 -226
- package/src/server/handlers/settings.ts +0 -157
- package/src/server/handlers/skills.ts +0 -378
- package/src/server/handlers/terminal.ts +0 -88
- package/src/server/handlers/themes.ts +0 -121
- package/src/server/handlers/update.ts +0 -133
- package/src/server/identity.ts +0 -56
- package/src/server/index.ts +0 -457
- package/src/server/logger.ts +0 -21
- package/src/server/mesh/connector.ts +0 -419
- package/src/server/mesh/crypto.ts +0 -106
- package/src/server/mesh/discovery.ts +0 -126
- package/src/server/mesh/pairing.ts +0 -123
- package/src/server/mesh/peers.ts +0 -60
- package/src/server/mesh/proxy.ts +0 -106
- package/src/server/mesh/session-sync.ts +0 -107
- package/src/server/project/bookmarks.ts +0 -83
- package/src/server/project/context-breakdown.ts +0 -307
- package/src/server/project/file-browser.ts +0 -106
- package/src/server/project/project-files.ts +0 -267
- package/src/server/project/pty-worker.cjs +0 -83
- package/src/server/project/registry.ts +0 -57
- package/src/server/project/sdk-bridge.ts +0 -1100
- package/src/server/project/session.ts +0 -723
- package/src/server/project/terminal.ts +0 -111
- package/src/server/project/warmup.ts +0 -285
- package/src/server/push.ts +0 -121
- package/src/server/tls.ts +0 -65
- package/src/server/tui.ts +0 -103
- package/src/server/update-checker.ts +0 -147
- package/src/server/ws/broadcast.ts +0 -61
- package/src/server/ws/router.ts +0 -123
- package/src/server/ws/server.ts +0 -2
- package/src/shared/analytics.ts +0 -40
- package/src/shared/messages.ts +0 -1302
- package/src/shared/models.ts +0 -255
- package/src/shared/project-settings.ts +0 -45
- package/tsconfig.json +0 -25
- package/vite.config.ts +0 -71
- /package/{src/server/runtime.ts → dist/server/runtime.js} +0 -0
- /package/{src/shared/constants.ts → dist/shared/constants.js} +0 -0
- /package/{src/shared/index.ts → dist/shared/index.js} +0 -0
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect } from "react";
|
|
2
|
-
import { ArrowUpCircle, X, Loader2, ExternalLink, RefreshCw } from "lucide-react";
|
|
3
|
-
import { useWebSocket } from "../../hooks/useWebSocket";
|
|
4
|
-
import type { ServerMessage } from "#shared";
|
|
5
|
-
|
|
6
|
-
interface UpdateState {
|
|
7
|
-
currentVersion: string;
|
|
8
|
-
latestVersion: string | null;
|
|
9
|
-
updateAvailable: boolean;
|
|
10
|
-
releaseUrl: string | null;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function UpdateBanner() {
|
|
14
|
-
var { send, subscribe, unsubscribe } = useWebSocket();
|
|
15
|
-
var [update, setUpdate] = useState<UpdateState | null>(null);
|
|
16
|
-
var [dismissed, setDismissed] = useState(false);
|
|
17
|
-
var [applying, setApplying] = useState(false);
|
|
18
|
-
var [applyResult, setApplyResult] = useState<{ success: boolean; message: string } | null>(null);
|
|
19
|
-
|
|
20
|
-
useEffect(function () {
|
|
21
|
-
function handleStatus(msg: ServerMessage) {
|
|
22
|
-
if (msg.type !== "update:status") return;
|
|
23
|
-
var data = msg as UpdateState & { type: string };
|
|
24
|
-
setUpdate({ currentVersion: data.currentVersion, latestVersion: data.latestVersion, updateAvailable: data.updateAvailable, releaseUrl: data.releaseUrl });
|
|
25
|
-
if (data.updateAvailable) setDismissed(false);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function handleApplyResult(msg: ServerMessage) {
|
|
29
|
-
if (msg.type !== "update:apply_result") return;
|
|
30
|
-
var data = msg as { type: string; success: boolean; message?: string };
|
|
31
|
-
setApplying(false);
|
|
32
|
-
setApplyResult({ success: data.success, message: data.message ?? "" });
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
subscribe("update:status", handleStatus);
|
|
36
|
-
subscribe("update:apply_result", handleApplyResult);
|
|
37
|
-
send({ type: "update:check" } as any);
|
|
38
|
-
|
|
39
|
-
return function () {
|
|
40
|
-
unsubscribe("update:status", handleStatus);
|
|
41
|
-
unsubscribe("update:apply_result", handleApplyResult);
|
|
42
|
-
};
|
|
43
|
-
}, []);
|
|
44
|
-
|
|
45
|
-
if (!update || !update.updateAvailable || dismissed) return null;
|
|
46
|
-
|
|
47
|
-
if (applyResult) {
|
|
48
|
-
return (
|
|
49
|
-
<div className={
|
|
50
|
-
"flex items-center gap-2 px-4 py-2 text-[12px] border-b " +
|
|
51
|
-
(applyResult.success
|
|
52
|
-
? "bg-success/10 border-success/20 text-success"
|
|
53
|
-
: "bg-error/10 border-error/20 text-error")
|
|
54
|
-
}>
|
|
55
|
-
<span className="flex-1">{applyResult.message}</span>
|
|
56
|
-
{applyResult.success && (
|
|
57
|
-
<button
|
|
58
|
-
onClick={function () { window.location.reload(); }}
|
|
59
|
-
className="flex items-center gap-1 text-[11px] font-mono font-bold hover:underline"
|
|
60
|
-
>
|
|
61
|
-
<RefreshCw size={11} />
|
|
62
|
-
Reload
|
|
63
|
-
</button>
|
|
64
|
-
)}
|
|
65
|
-
<button onClick={function () { setDismissed(true); }} className="btn btn-ghost btn-xs btn-square opacity-50 hover:opacity-100">
|
|
66
|
-
<X size={12} />
|
|
67
|
-
</button>
|
|
68
|
-
</div>
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return (
|
|
73
|
-
<div className="flex items-center gap-2 px-4 py-2 bg-primary/8 border-b border-primary/15 text-[12px] text-base-content/70">
|
|
74
|
-
<ArrowUpCircle size={14} className="text-primary flex-shrink-0" />
|
|
75
|
-
<span className="flex-1">
|
|
76
|
-
<span className="font-semibold text-base-content">v{update.latestVersion}</span>
|
|
77
|
-
{" "}available
|
|
78
|
-
<span className="text-base-content/40 ml-1">(current: v{update.currentVersion})</span>
|
|
79
|
-
</span>
|
|
80
|
-
{update.releaseUrl && (
|
|
81
|
-
<a
|
|
82
|
-
href={update.releaseUrl}
|
|
83
|
-
target="_blank"
|
|
84
|
-
rel="noopener noreferrer"
|
|
85
|
-
className="flex items-center gap-0.5 text-[11px] text-primary/50 hover:text-primary transition-colors"
|
|
86
|
-
>
|
|
87
|
-
<ExternalLink size={10} />
|
|
88
|
-
Notes
|
|
89
|
-
</a>
|
|
90
|
-
)}
|
|
91
|
-
{applying ? (
|
|
92
|
-
<Loader2 size={12} className="text-primary animate-spin" />
|
|
93
|
-
) : (
|
|
94
|
-
<button
|
|
95
|
-
onClick={function () { setApplying(true); send({ type: "update:apply" } as any); }}
|
|
96
|
-
className="btn btn-primary btn-xs"
|
|
97
|
-
>
|
|
98
|
-
Update
|
|
99
|
-
</button>
|
|
100
|
-
)}
|
|
101
|
-
<button
|
|
102
|
-
onClick={function () { setDismissed(true); }}
|
|
103
|
-
aria-label="Dismiss update"
|
|
104
|
-
className="btn btn-ghost btn-xs btn-square text-base-content/30 hover:text-base-content"
|
|
105
|
-
>
|
|
106
|
-
<X size={12} />
|
|
107
|
-
</button>
|
|
108
|
-
</div>
|
|
109
|
-
);
|
|
110
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from "react";
|
|
2
|
-
import { RefreshCw } from "lucide-react";
|
|
3
|
-
|
|
4
|
-
export function UpdatePrompt() {
|
|
5
|
-
var [showUpdate, setShowUpdate] = useState(false);
|
|
6
|
-
var [registration, setRegistration] = useState<ServiceWorkerRegistration | null>(null);
|
|
7
|
-
|
|
8
|
-
useEffect(function () {
|
|
9
|
-
if (!("serviceWorker" in navigator)) return;
|
|
10
|
-
|
|
11
|
-
navigator.serviceWorker.ready.then(function (reg) {
|
|
12
|
-
reg.addEventListener("updatefound", function () {
|
|
13
|
-
var newWorker = reg.installing;
|
|
14
|
-
if (!newWorker) return;
|
|
15
|
-
var worker: ServiceWorker = newWorker;
|
|
16
|
-
worker.addEventListener("statechange", function () {
|
|
17
|
-
if (worker.state === "installed" && navigator.serviceWorker.controller) {
|
|
18
|
-
setRegistration(reg);
|
|
19
|
-
setShowUpdate(true);
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
}, []);
|
|
25
|
-
|
|
26
|
-
function handleReload() {
|
|
27
|
-
if (registration && registration.waiting) {
|
|
28
|
-
registration.waiting.postMessage({ type: "SKIP_WAITING" });
|
|
29
|
-
}
|
|
30
|
-
window.location.reload();
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (!showUpdate) return null;
|
|
34
|
-
|
|
35
|
-
return (
|
|
36
|
-
<div className="fixed bottom-4 right-4 z-[9998] bg-base-300 border border-base-content/15 rounded-xl shadow-2xl px-4 py-3 flex items-center gap-3 max-w-sm">
|
|
37
|
-
<RefreshCw size={16} className="text-primary flex-shrink-0" />
|
|
38
|
-
<div className="flex-1 min-w-0">
|
|
39
|
-
<div className="text-[13px] text-base-content font-semibold">Update available</div>
|
|
40
|
-
<div className="text-[11px] text-base-content/40">A new version of Lattice is ready.</div>
|
|
41
|
-
</div>
|
|
42
|
-
<button onClick={handleReload} className="btn btn-primary btn-xs">
|
|
43
|
-
Reload
|
|
44
|
-
</button>
|
|
45
|
-
</div>
|
|
46
|
-
);
|
|
47
|
-
}
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import { useEffect, useMemo } from "react";
|
|
2
|
-
import { Bookmark, MessageSquare, ExternalLink } from "lucide-react";
|
|
3
|
-
import { useBookmarks } from "../../hooks/useBookmarks";
|
|
4
|
-
import { useSession } from "../../hooks/useSession";
|
|
5
|
-
import { useProjects } from "../../hooks/useProjects";
|
|
6
|
-
import { openTab } from "../../stores/workspace";
|
|
7
|
-
import type { MessageBookmark } from "#shared";
|
|
8
|
-
|
|
9
|
-
function relativeTime(ts: number): string {
|
|
10
|
-
var diff = Date.now() - ts;
|
|
11
|
-
var seconds = Math.floor(diff / 1000);
|
|
12
|
-
if (seconds < 60) return seconds + "s ago";
|
|
13
|
-
var minutes = Math.floor(seconds / 60);
|
|
14
|
-
if (minutes < 60) return minutes + "m ago";
|
|
15
|
-
var hours = Math.floor(minutes / 60);
|
|
16
|
-
if (hours < 24) return hours + "h ago";
|
|
17
|
-
var days = Math.floor(hours / 24);
|
|
18
|
-
return days + "d ago";
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
interface GroupedBookmarks {
|
|
22
|
-
projectSlug: string;
|
|
23
|
-
sessions: Array<{
|
|
24
|
-
sessionId: string;
|
|
25
|
-
bookmarks: MessageBookmark[];
|
|
26
|
-
}>;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export function BookmarksView() {
|
|
30
|
-
var { allBookmarks, requestAllBookmarks } = useBookmarks();
|
|
31
|
-
var { activateSession } = useSession();
|
|
32
|
-
var { projects } = useProjects();
|
|
33
|
-
|
|
34
|
-
useEffect(function () {
|
|
35
|
-
requestAllBookmarks();
|
|
36
|
-
}, []);
|
|
37
|
-
|
|
38
|
-
var grouped = useMemo(function () {
|
|
39
|
-
var projectMap = new Map<string, Map<string, MessageBookmark[]>>();
|
|
40
|
-
for (var i = 0; i < allBookmarks.length; i++) {
|
|
41
|
-
var bm = allBookmarks[i];
|
|
42
|
-
if (!projectMap.has(bm.projectSlug)) {
|
|
43
|
-
projectMap.set(bm.projectSlug, new Map());
|
|
44
|
-
}
|
|
45
|
-
var sessionMap = projectMap.get(bm.projectSlug)!;
|
|
46
|
-
if (!sessionMap.has(bm.sessionId)) {
|
|
47
|
-
sessionMap.set(bm.sessionId, []);
|
|
48
|
-
}
|
|
49
|
-
sessionMap.get(bm.sessionId)!.push(bm);
|
|
50
|
-
}
|
|
51
|
-
var result: GroupedBookmarks[] = [];
|
|
52
|
-
projectMap.forEach(function (sessionMap, projectSlug) {
|
|
53
|
-
var sessions: GroupedBookmarks["sessions"] = [];
|
|
54
|
-
sessionMap.forEach(function (bookmarks, sessionId) {
|
|
55
|
-
sessions.push({ sessionId, bookmarks });
|
|
56
|
-
});
|
|
57
|
-
sessions.sort(function (a, b) {
|
|
58
|
-
return b.bookmarks[0].createdAt - a.bookmarks[0].createdAt;
|
|
59
|
-
});
|
|
60
|
-
result.push({ projectSlug, sessions });
|
|
61
|
-
});
|
|
62
|
-
result.sort(function (a, b) {
|
|
63
|
-
var aLatest = a.sessions[0]?.bookmarks[0]?.createdAt ?? 0;
|
|
64
|
-
var bLatest = b.sessions[0]?.bookmarks[0]?.createdAt ?? 0;
|
|
65
|
-
return bLatest - aLatest;
|
|
66
|
-
});
|
|
67
|
-
return result;
|
|
68
|
-
}, [allBookmarks]);
|
|
69
|
-
|
|
70
|
-
function getProjectTitle(slug: string): string {
|
|
71
|
-
for (var i = 0; i < projects.length; i++) {
|
|
72
|
-
if (projects[i].slug === slug) return projects[i].title;
|
|
73
|
-
}
|
|
74
|
-
return slug;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function handleBookmarkClick(bm: MessageBookmark) {
|
|
78
|
-
activateSession(bm.projectSlug, bm.sessionId);
|
|
79
|
-
openTab("chat");
|
|
80
|
-
setTimeout(function () {
|
|
81
|
-
var el = document.getElementById("msg-" + bm.messageUuid);
|
|
82
|
-
if (el) {
|
|
83
|
-
el.scrollIntoView({ behavior: window.matchMedia("(prefers-reduced-motion: reduce)").matches ? "auto" : "smooth", block: "center" });
|
|
84
|
-
el.classList.add("ring-2", "ring-warning/40");
|
|
85
|
-
setTimeout(function () { el!.classList.remove("ring-2", "ring-warning/40"); }, 2000);
|
|
86
|
-
}
|
|
87
|
-
}, 500);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return (
|
|
91
|
-
<div className="flex flex-col h-full w-full overflow-hidden">
|
|
92
|
-
<div className="flex items-center gap-2 px-4 py-3 border-b border-base-content/10 bg-base-100 flex-shrink-0">
|
|
93
|
-
<Bookmark size={16} className="text-warning" />
|
|
94
|
-
<span className="text-sm font-semibold text-base-content">Bookmarks</span>
|
|
95
|
-
<span className="text-[10px] font-mono text-base-content/30 ml-auto">{allBookmarks.length} total</span>
|
|
96
|
-
</div>
|
|
97
|
-
<div className="flex-1 overflow-y-auto p-4">
|
|
98
|
-
{allBookmarks.length === 0 ? (
|
|
99
|
-
<div className="flex flex-col items-center justify-center h-full text-base-content/30 gap-3">
|
|
100
|
-
<Bookmark size={32} className="text-base-content/15" />
|
|
101
|
-
<div className="text-[13px] font-mono">No bookmarks yet</div>
|
|
102
|
-
<div className="text-[11px] text-base-content/20 max-w-[260px] text-center">
|
|
103
|
-
Bookmark messages in chat to quickly find them later.
|
|
104
|
-
</div>
|
|
105
|
-
</div>
|
|
106
|
-
) : (
|
|
107
|
-
<div className="flex flex-col gap-4">
|
|
108
|
-
{grouped.map(function (group) {
|
|
109
|
-
return (
|
|
110
|
-
<div key={group.projectSlug}>
|
|
111
|
-
<div className="text-[10px] uppercase tracking-widest text-base-content/40 font-mono font-bold mb-2">
|
|
112
|
-
{getProjectTitle(group.projectSlug)}
|
|
113
|
-
</div>
|
|
114
|
-
<div className="flex flex-col gap-2">
|
|
115
|
-
{group.sessions.map(function (session) {
|
|
116
|
-
return (
|
|
117
|
-
<div key={session.sessionId} className="bg-base-200/50 border border-base-content/8 rounded-lg overflow-hidden">
|
|
118
|
-
<div className="flex items-center gap-2 px-3 py-1.5 border-b border-base-content/5">
|
|
119
|
-
<MessageSquare size={11} className="text-base-content/30" />
|
|
120
|
-
<span className="text-[11px] font-mono text-base-content/40 truncate">{session.sessionId.slice(0, 12)}...</span>
|
|
121
|
-
</div>
|
|
122
|
-
<div className="flex flex-col">
|
|
123
|
-
{session.bookmarks.map(function (bm) {
|
|
124
|
-
return (
|
|
125
|
-
<button
|
|
126
|
-
key={bm.id}
|
|
127
|
-
type="button"
|
|
128
|
-
onClick={function () { handleBookmarkClick(bm); }}
|
|
129
|
-
className="flex items-start gap-2 px-3 py-2 hover:bg-base-content/5 transition-colors text-left w-full"
|
|
130
|
-
>
|
|
131
|
-
<Bookmark size={10} className="text-warning/60 mt-0.5 flex-shrink-0" />
|
|
132
|
-
<div className="min-w-0 flex-1">
|
|
133
|
-
<div className="text-[12px] text-base-content/70 line-clamp-2">{bm.messageText}</div>
|
|
134
|
-
<div className="flex items-center gap-2 mt-0.5">
|
|
135
|
-
<span className="text-[9px] text-base-content/25 font-mono">{bm.messageType}</span>
|
|
136
|
-
<span className="text-[9px] text-base-content/20 font-mono">{relativeTime(bm.createdAt)}</span>
|
|
137
|
-
</div>
|
|
138
|
-
</div>
|
|
139
|
-
<ExternalLink size={10} className="text-base-content/20 mt-1 flex-shrink-0" />
|
|
140
|
-
</button>
|
|
141
|
-
);
|
|
142
|
-
})}
|
|
143
|
-
</div>
|
|
144
|
-
</div>
|
|
145
|
-
);
|
|
146
|
-
})}
|
|
147
|
-
</div>
|
|
148
|
-
</div>
|
|
149
|
-
);
|
|
150
|
-
})}
|
|
151
|
-
</div>
|
|
152
|
-
)}
|
|
153
|
-
</div>
|
|
154
|
-
</div>
|
|
155
|
-
);
|
|
156
|
-
}
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import { useCallback, useEffect, useRef, useState } from "react";
|
|
2
|
-
import { ArrowLeft, FileCode, FileX } from "lucide-react";
|
|
3
|
-
import type { FsListResultMessage, FsReadResultMessage, ServerMessage } from "#shared";
|
|
4
|
-
import { useWebSocket } from "../../hooks/useWebSocket";
|
|
5
|
-
import { useSidebar } from "../../hooks/useSidebar";
|
|
6
|
-
import { useProjects } from "../../hooks/useProjects";
|
|
7
|
-
import { useEditorConfig } from "../../hooks/useEditorConfig";
|
|
8
|
-
import { getEditorUrl } from "../../utils/editorUrl";
|
|
9
|
-
import { FileTree, buildNodes } from "./FileTree";
|
|
10
|
-
import { FileViewer } from "./FileViewer";
|
|
11
|
-
import type { TreeNode } from "./FileTree";
|
|
12
|
-
|
|
13
|
-
export function FileBrowser() {
|
|
14
|
-
var { send, subscribe, unsubscribe } = useWebSocket();
|
|
15
|
-
var { activeProjectSlug } = useSidebar();
|
|
16
|
-
var { activeProject } = useProjects();
|
|
17
|
-
var { editorType, wslDistro } = useEditorConfig();
|
|
18
|
-
var projectSlugRef = useRef<string | null>(null);
|
|
19
|
-
projectSlugRef.current = activeProjectSlug;
|
|
20
|
-
var [rootNodes, setRootNodes] = useState<TreeNode[]>([]);
|
|
21
|
-
var [selectedPath, setSelectedPath] = useState<string | null>(null);
|
|
22
|
-
var [fileContent, setFileContent] = useState<string | null>(null);
|
|
23
|
-
var [loadingContent, setLoadingContent] = useState(false);
|
|
24
|
-
var [mobileShowViewer, setMobileShowViewer] = useState(false);
|
|
25
|
-
var nodesRef = useRef<TreeNode[]>([]);
|
|
26
|
-
|
|
27
|
-
nodesRef.current = rootNodes;
|
|
28
|
-
|
|
29
|
-
var handleListResult = useCallback(function (msg: ServerMessage) {
|
|
30
|
-
var listMsg = msg as FsListResultMessage;
|
|
31
|
-
var newNodes = buildNodes(listMsg.entries);
|
|
32
|
-
|
|
33
|
-
if (listMsg.path === "" || listMsg.path === ".") {
|
|
34
|
-
setRootNodes(newNodes);
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function updateNodes(nodes: TreeNode[]): TreeNode[] {
|
|
39
|
-
return nodes.map(function (node) {
|
|
40
|
-
if (node.entry.path === listMsg.path) {
|
|
41
|
-
return Object.assign({}, node, { children: newNodes, expanded: true });
|
|
42
|
-
}
|
|
43
|
-
if (node.children) {
|
|
44
|
-
return Object.assign({}, node, { children: updateNodes(node.children) });
|
|
45
|
-
}
|
|
46
|
-
return node;
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
setRootNodes(function (prev) {
|
|
51
|
-
return updateNodes(prev);
|
|
52
|
-
});
|
|
53
|
-
}, []);
|
|
54
|
-
|
|
55
|
-
var handleReadResult = useCallback(function (msg: ServerMessage) {
|
|
56
|
-
var readMsg = msg as FsReadResultMessage;
|
|
57
|
-
setFileContent(readMsg.content);
|
|
58
|
-
setLoadingContent(false);
|
|
59
|
-
}, []);
|
|
60
|
-
|
|
61
|
-
var selectedPathRef = useRef<string | null>(null);
|
|
62
|
-
selectedPathRef.current = selectedPath;
|
|
63
|
-
|
|
64
|
-
var handleFsChanged = useCallback(function (msg: ServerMessage) {
|
|
65
|
-
var changedPath = (msg as { path: string }).path;
|
|
66
|
-
if (changedPath === selectedPathRef.current) {
|
|
67
|
-
send({ type: "fs:read", path: changedPath, projectSlug: projectSlugRef.current || undefined });
|
|
68
|
-
}
|
|
69
|
-
}, [send]);
|
|
70
|
-
|
|
71
|
-
useEffect(function () {
|
|
72
|
-
subscribe("fs:list_result", handleListResult);
|
|
73
|
-
subscribe("fs:read_result", handleReadResult);
|
|
74
|
-
subscribe("fs:changed", handleFsChanged);
|
|
75
|
-
|
|
76
|
-
send({ type: "fs:list", path: ".", projectSlug: projectSlugRef.current || undefined });
|
|
77
|
-
|
|
78
|
-
return function () {
|
|
79
|
-
unsubscribe("fs:list_result", handleListResult);
|
|
80
|
-
unsubscribe("fs:read_result", handleReadResult);
|
|
81
|
-
unsubscribe("fs:changed", handleFsChanged);
|
|
82
|
-
};
|
|
83
|
-
}, [handleListResult, handleReadResult, handleFsChanged, send, subscribe, unsubscribe]);
|
|
84
|
-
|
|
85
|
-
function handleToggle(path: string) {
|
|
86
|
-
function findAndToggle(nodes: TreeNode[]): TreeNode[] {
|
|
87
|
-
return nodes.map(function (node) {
|
|
88
|
-
if (node.entry.path === path) {
|
|
89
|
-
if (!node.expanded && !node.children) {
|
|
90
|
-
send({ type: "fs:list", path: path, projectSlug: projectSlugRef.current || undefined });
|
|
91
|
-
return Object.assign({}, node, { expanded: true });
|
|
92
|
-
}
|
|
93
|
-
return Object.assign({}, node, { expanded: !node.expanded });
|
|
94
|
-
}
|
|
95
|
-
if (node.children) {
|
|
96
|
-
return Object.assign({}, node, { children: findAndToggle(node.children) });
|
|
97
|
-
}
|
|
98
|
-
return node;
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
setRootNodes(function (prev) {
|
|
102
|
-
return findAndToggle(prev);
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
function handleSelect(path: string) {
|
|
107
|
-
setSelectedPath(path);
|
|
108
|
-
setFileContent(null);
|
|
109
|
-
setLoadingContent(true);
|
|
110
|
-
setMobileShowViewer(true);
|
|
111
|
-
send({ type: "fs:read", path: path, projectSlug: activeProjectSlug || undefined });
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
var editorUrlForSelected = selectedPath && activeProject
|
|
115
|
-
? getEditorUrl(editorType, activeProject.path, selectedPath, undefined, wslDistro, activeProject.ideProjectName)
|
|
116
|
-
: null;
|
|
117
|
-
|
|
118
|
-
return (
|
|
119
|
-
<div className="flex h-full w-full overflow-hidden bg-base-100">
|
|
120
|
-
<div className={"w-full sm:w-[220px] sm:flex-shrink-0 sm:border-r sm:border-base-content/15 overflow-y-auto p-2" + (mobileShowViewer ? " hidden sm:block" : " block")}>
|
|
121
|
-
<div className="text-[11px] font-semibold tracking-[0.06em] uppercase text-base-content/40 px-2 pb-2 pt-1">
|
|
122
|
-
Files
|
|
123
|
-
</div>
|
|
124
|
-
<FileTree
|
|
125
|
-
nodes={rootNodes}
|
|
126
|
-
selectedPath={selectedPath}
|
|
127
|
-
onToggle={handleToggle}
|
|
128
|
-
onSelect={handleSelect}
|
|
129
|
-
/>
|
|
130
|
-
</div>
|
|
131
|
-
|
|
132
|
-
<div className={"flex-1 flex-col overflow-hidden" + (mobileShowViewer ? " flex" : " hidden sm:flex")}>
|
|
133
|
-
{selectedPath && (
|
|
134
|
-
<button
|
|
135
|
-
className="sm:hidden flex items-center gap-1 px-2 py-1.5 text-[12px] text-base-content/60 hover:text-base-content border-b border-base-content/15"
|
|
136
|
-
onClick={function () { setMobileShowViewer(false); }}
|
|
137
|
-
>
|
|
138
|
-
<ArrowLeft size={14} />
|
|
139
|
-
<span>Back to files</span>
|
|
140
|
-
</button>
|
|
141
|
-
)}
|
|
142
|
-
|
|
143
|
-
{!selectedPath && (
|
|
144
|
-
<div className="h-full flex flex-col items-center justify-center gap-3">
|
|
145
|
-
<FileCode size={28} className="text-base-content/15" />
|
|
146
|
-
<div className="text-base-content/40 text-[13px]">Select a file from the tree to view its contents</div>
|
|
147
|
-
</div>
|
|
148
|
-
)}
|
|
149
|
-
|
|
150
|
-
{selectedPath && loadingContent && (
|
|
151
|
-
<div className="h-full flex items-center justify-center text-base-content/40 text-[13px]">
|
|
152
|
-
Loading...
|
|
153
|
-
</div>
|
|
154
|
-
)}
|
|
155
|
-
|
|
156
|
-
{selectedPath && !loadingContent && fileContent !== null && (
|
|
157
|
-
<FileViewer
|
|
158
|
-
path={selectedPath}
|
|
159
|
-
content={fileContent}
|
|
160
|
-
editorUrl={editorUrlForSelected}
|
|
161
|
-
/>
|
|
162
|
-
)}
|
|
163
|
-
|
|
164
|
-
{selectedPath && !loadingContent && fileContent === null && (
|
|
165
|
-
<div className="h-full flex flex-col items-center justify-center gap-3">
|
|
166
|
-
<FileX size={28} className="text-base-content/15" />
|
|
167
|
-
<div className="text-base-content/40 text-[13px]">Cannot display this file</div>
|
|
168
|
-
<div className="text-base-content/30 text-[11px]">Binary files and files over 512KB are not shown</div>
|
|
169
|
-
</div>
|
|
170
|
-
)}
|
|
171
|
-
</div>
|
|
172
|
-
</div>
|
|
173
|
-
);
|
|
174
|
-
}
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import { ChevronRight, FileIcon } from "lucide-react";
|
|
2
|
-
import type { FileEntry } from "#shared";
|
|
3
|
-
|
|
4
|
-
export interface TreeNode {
|
|
5
|
-
entry: FileEntry;
|
|
6
|
-
children: TreeNode[] | null;
|
|
7
|
-
expanded: boolean;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function buildNodes(entries: FileEntry[]): TreeNode[] {
|
|
11
|
-
return entries.map(function (entry) {
|
|
12
|
-
return { entry, children: null, expanded: false };
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
interface FileTreeItemProps {
|
|
17
|
-
node: TreeNode;
|
|
18
|
-
depth: number;
|
|
19
|
-
selectedPath: string | null;
|
|
20
|
-
onToggle: (path: string) => void;
|
|
21
|
-
onSelect: (path: string) => void;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function FileTreeItem(props: FileTreeItemProps) {
|
|
25
|
-
var { node, depth, selectedPath, onToggle, onSelect } = props;
|
|
26
|
-
var isSelected = selectedPath === node.entry.path;
|
|
27
|
-
var isDir = node.entry.isDirectory;
|
|
28
|
-
|
|
29
|
-
function handleActivate() {
|
|
30
|
-
if (isDir) {
|
|
31
|
-
onToggle(node.entry.path);
|
|
32
|
-
} else {
|
|
33
|
-
onSelect(node.entry.path);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function handleKeyDown(e: React.KeyboardEvent) {
|
|
38
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
39
|
-
e.preventDefault();
|
|
40
|
-
handleActivate();
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return (
|
|
45
|
-
<div role="treeitem" aria-expanded={isDir ? node.expanded : undefined} aria-selected={isSelected}>
|
|
46
|
-
<div
|
|
47
|
-
tabIndex={0}
|
|
48
|
-
onClick={handleActivate}
|
|
49
|
-
onKeyDown={handleKeyDown}
|
|
50
|
-
className={
|
|
51
|
-
"flex items-center gap-1.5 py-[3px] pr-2 cursor-pointer text-[13px] rounded select-none outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:ring-offset-1 focus-visible:ring-offset-base-200 " +
|
|
52
|
-
(isSelected ? "bg-base-300 text-primary" : "text-base-content hover:bg-base-200")
|
|
53
|
-
}
|
|
54
|
-
style={{ paddingLeft: (8 + depth * 16) + "px" }}
|
|
55
|
-
>
|
|
56
|
-
{isDir ? (
|
|
57
|
-
<ChevronRight
|
|
58
|
-
size={12}
|
|
59
|
-
className="flex-shrink-0 text-base-content/40 transition-transform duration-[120ms]"
|
|
60
|
-
style={{ transform: node.expanded ? "rotate(90deg)" : "none" }}
|
|
61
|
-
/>
|
|
62
|
-
) : (
|
|
63
|
-
<FileIcon
|
|
64
|
-
size={12}
|
|
65
|
-
className="flex-shrink-0 text-base-content/40"
|
|
66
|
-
/>
|
|
67
|
-
)}
|
|
68
|
-
<span
|
|
69
|
-
className={
|
|
70
|
-
"truncate " +
|
|
71
|
-
(isDir ? "text-info" : "text-base-content")
|
|
72
|
-
}
|
|
73
|
-
>
|
|
74
|
-
{node.entry.name}
|
|
75
|
-
</span>
|
|
76
|
-
</div>
|
|
77
|
-
{isDir && node.expanded && node.children && (
|
|
78
|
-
<div role="group">
|
|
79
|
-
{node.children.map(function (child) {
|
|
80
|
-
return (
|
|
81
|
-
<FileTreeItem
|
|
82
|
-
key={child.entry.path}
|
|
83
|
-
node={child}
|
|
84
|
-
depth={depth + 1}
|
|
85
|
-
selectedPath={selectedPath}
|
|
86
|
-
onToggle={onToggle}
|
|
87
|
-
onSelect={onSelect}
|
|
88
|
-
/>
|
|
89
|
-
);
|
|
90
|
-
})}
|
|
91
|
-
</div>
|
|
92
|
-
)}
|
|
93
|
-
</div>
|
|
94
|
-
);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
interface FileTreeProps {
|
|
98
|
-
nodes: TreeNode[];
|
|
99
|
-
selectedPath: string | null;
|
|
100
|
-
onToggle: (path: string) => void;
|
|
101
|
-
onSelect: (path: string) => void;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export function FileTree(props: FileTreeProps) {
|
|
105
|
-
var { nodes, selectedPath, onToggle, onSelect } = props;
|
|
106
|
-
|
|
107
|
-
return (
|
|
108
|
-
<div role="tree" aria-label="File tree">
|
|
109
|
-
{nodes.length === 0 ? (
|
|
110
|
-
<div className="px-2 py-3 text-[12px] text-base-content/40">
|
|
111
|
-
Loading...
|
|
112
|
-
</div>
|
|
113
|
-
) : (
|
|
114
|
-
nodes.map(function (node) {
|
|
115
|
-
return (
|
|
116
|
-
<FileTreeItem
|
|
117
|
-
key={node.entry.path}
|
|
118
|
-
node={node}
|
|
119
|
-
depth={0}
|
|
120
|
-
selectedPath={selectedPath}
|
|
121
|
-
onToggle={onToggle}
|
|
122
|
-
onSelect={onSelect}
|
|
123
|
-
/>
|
|
124
|
-
);
|
|
125
|
-
})
|
|
126
|
-
)}
|
|
127
|
-
</div>
|
|
128
|
-
);
|
|
129
|
-
}
|