@cryptiklemur/lattice 4.0.1 → 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 -454
- 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,599 +0,0 @@
|
|
|
1
|
-
import { useEffect, useRef, useState, useMemo, useCallback } from "react";
|
|
2
|
-
import { createPortal } from "react-dom";
|
|
3
|
-
import { Clock, MessageSquare, Cpu, DollarSign, Pencil, Trash2 } from "lucide-react";
|
|
4
|
-
import { ContextMenu, useContextMenu } from "../ui/ContextMenu";
|
|
5
|
-
import type { SessionSummary, SessionPreview, SessionListMessage, SessionCreatedMessage, SessionPreviewMessage } from "#shared";
|
|
6
|
-
import type { ServerMessage } from "#shared";
|
|
7
|
-
import { useWebSocket } from "../../hooks/useWebSocket";
|
|
8
|
-
import { useTimeTick } from "../../hooks/useTimeTick";
|
|
9
|
-
import { markSessionHasUpdates, sessionHasUpdates, markSessionRead } from "../../stores/session";
|
|
10
|
-
import { formatSessionTitle } from "../../utils/formatSessionTitle";
|
|
11
|
-
|
|
12
|
-
var PAGE_SIZE = 40;
|
|
13
|
-
|
|
14
|
-
interface SessionGroup {
|
|
15
|
-
label: string;
|
|
16
|
-
sessions: SessionSummary[];
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function groupByTime(sessions: SessionSummary[]): SessionGroup[] {
|
|
20
|
-
var todayStart = new Date();
|
|
21
|
-
todayStart.setHours(0, 0, 0, 0);
|
|
22
|
-
var todayMs = todayStart.getTime();
|
|
23
|
-
var yesterdayStart = new Date(todayStart);
|
|
24
|
-
yesterdayStart.setDate(yesterdayStart.getDate() - 1);
|
|
25
|
-
var yesterdayMs = yesterdayStart.getTime();
|
|
26
|
-
var weekMs = todayMs - 6 * 86400000;
|
|
27
|
-
var monthMs = todayMs - 29 * 86400000;
|
|
28
|
-
|
|
29
|
-
var groups: Record<string, SessionSummary[]> = {
|
|
30
|
-
Today: [],
|
|
31
|
-
Yesterday: [],
|
|
32
|
-
"This Week": [],
|
|
33
|
-
"This Month": [],
|
|
34
|
-
Older: [],
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
for (var i = 0; i < sessions.length; i++) {
|
|
38
|
-
var ts = sessions[i].updatedAt;
|
|
39
|
-
if (ts >= todayMs) {
|
|
40
|
-
groups["Today"].push(sessions[i]);
|
|
41
|
-
} else if (ts >= yesterdayMs && ts < todayMs) {
|
|
42
|
-
groups["Yesterday"].push(sessions[i]);
|
|
43
|
-
} else if (ts >= weekMs) {
|
|
44
|
-
groups["This Week"].push(sessions[i]);
|
|
45
|
-
} else if (ts >= monthMs) {
|
|
46
|
-
groups["This Month"].push(sessions[i]);
|
|
47
|
-
} else {
|
|
48
|
-
groups["Older"].push(sessions[i]);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
var order = ["Today", "Yesterday", "This Week", "This Month", "Older"];
|
|
53
|
-
var result: SessionGroup[] = [];
|
|
54
|
-
for (var j = 0; j < order.length; j++) {
|
|
55
|
-
if (groups[order[j]].length > 0) {
|
|
56
|
-
result.push({ label: order[j], sessions: groups[order[j]] });
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return result;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
var knownUpdatedAt = new Map<string, number>();
|
|
63
|
-
|
|
64
|
-
export interface DateRange {
|
|
65
|
-
from?: number;
|
|
66
|
-
to?: number;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
interface SessionListProps {
|
|
70
|
-
projectSlug: string | null;
|
|
71
|
-
activeSessionId: string | null;
|
|
72
|
-
onSessionActivate: (session: SessionSummary) => void;
|
|
73
|
-
onSessionDeactivate?: () => void;
|
|
74
|
-
filter?: string;
|
|
75
|
-
dateRange?: DateRange;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function formatDate(ts: number): string {
|
|
79
|
-
var d = new Date(ts);
|
|
80
|
-
var now = new Date();
|
|
81
|
-
var diff = now.getTime() - d.getTime();
|
|
82
|
-
var day = 86400000;
|
|
83
|
-
|
|
84
|
-
if (diff < day && d.getDate() === now.getDate()) {
|
|
85
|
-
return d.toLocaleTimeString(undefined, { hour: "2-digit", minute: "2-digit" });
|
|
86
|
-
}
|
|
87
|
-
if (diff < 7 * day) {
|
|
88
|
-
return d.toLocaleDateString(undefined, { weekday: "short" });
|
|
89
|
-
}
|
|
90
|
-
return d.toLocaleDateString(undefined, { month: "short", day: "numeric" });
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function formatDuration(ms: number): string {
|
|
94
|
-
if (ms < 60000) return Math.round(ms / 1000) + "s";
|
|
95
|
-
if (ms < 3600000) return Math.round(ms / 60000) + "m";
|
|
96
|
-
var hours = Math.floor(ms / 3600000);
|
|
97
|
-
var mins = Math.round((ms % 3600000) / 60000);
|
|
98
|
-
return hours + "h " + mins + "m";
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function formatCost(cost: number): string {
|
|
102
|
-
if (cost < 0.01) return "<$0.01";
|
|
103
|
-
return "$" + cost.toFixed(2);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
function SessionSkeleton() {
|
|
107
|
-
return (
|
|
108
|
-
<div className="flex flex-col gap-2 px-4 py-3">
|
|
109
|
-
<div className="h-2 bg-base-content/10 rounded animate-pulse w-3/4" />
|
|
110
|
-
<div className="h-2 bg-base-content/10 rounded animate-pulse w-1/2" />
|
|
111
|
-
<div className="h-2 bg-base-content/10 rounded animate-pulse w-2/3" />
|
|
112
|
-
</div>
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
function PreviewPopover(props: { preview: SessionPreview | null; anchorRect: DOMRect | null }) {
|
|
117
|
-
if (!props.anchorRect) return null;
|
|
118
|
-
|
|
119
|
-
var top = props.anchorRect.top;
|
|
120
|
-
var left = props.anchorRect.right + 8;
|
|
121
|
-
|
|
122
|
-
var fitsRight = left + 280 < window.innerWidth;
|
|
123
|
-
if (!fitsRight) {
|
|
124
|
-
left = props.anchorRect.left - 288;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
var fitsBelow = top + 160 < window.innerHeight;
|
|
128
|
-
if (!fitsBelow) {
|
|
129
|
-
top = Math.max(8, props.anchorRect.bottom - 160);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
var content = (
|
|
133
|
-
<div
|
|
134
|
-
className="fixed z-[9999] w-[270px] bg-base-300 border border-base-content/15 rounded-lg shadow-xl p-3 pointer-events-none"
|
|
135
|
-
style={{ top, left }}
|
|
136
|
-
>
|
|
137
|
-
{props.preview ? (
|
|
138
|
-
<>
|
|
139
|
-
<div className="text-[11px] text-base-content/50 leading-relaxed line-clamp-2 mb-2.5 italic">
|
|
140
|
-
{props.preview.lastMessage || "No messages"}
|
|
141
|
-
</div>
|
|
142
|
-
<div className="grid grid-cols-2 gap-x-3 gap-y-1.5">
|
|
143
|
-
<div className="flex items-center gap-1.5">
|
|
144
|
-
<DollarSign className="!size-3 text-base-content/30 shrink-0" />
|
|
145
|
-
<span className="text-[11px] text-base-content/60">{formatCost(props.preview.cost)}</span>
|
|
146
|
-
</div>
|
|
147
|
-
<div className="flex items-center gap-1.5">
|
|
148
|
-
<Clock className="!size-3 text-base-content/30 shrink-0" />
|
|
149
|
-
<span className="text-[11px] text-base-content/60">{formatDuration(props.preview.durationMs)}</span>
|
|
150
|
-
</div>
|
|
151
|
-
<div className="flex items-center gap-1.5">
|
|
152
|
-
<MessageSquare className="!size-3 text-base-content/30 shrink-0" />
|
|
153
|
-
<span className="text-[11px] text-base-content/60">{props.preview.messageCount} msgs</span>
|
|
154
|
-
</div>
|
|
155
|
-
<div className="flex items-center gap-1.5">
|
|
156
|
-
<Cpu className="!size-3 text-base-content/30 shrink-0" />
|
|
157
|
-
<span className="text-[11px] text-base-content/60">{props.preview.model || "unknown"}</span>
|
|
158
|
-
</div>
|
|
159
|
-
</div>
|
|
160
|
-
</>
|
|
161
|
-
) : (
|
|
162
|
-
<div className="flex items-center gap-2">
|
|
163
|
-
<span className="w-3 h-3 border-2 border-base-content/20 border-t-primary/50 rounded-full animate-spin" />
|
|
164
|
-
<span className="text-[11px] text-base-content/40">Loading...</span>
|
|
165
|
-
</div>
|
|
166
|
-
)}
|
|
167
|
-
</div>
|
|
168
|
-
);
|
|
169
|
-
|
|
170
|
-
return createPortal(content, document.body);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
function loadCachedSessions(slug: string | null): SessionSummary[] {
|
|
174
|
-
if (!slug) return [];
|
|
175
|
-
try {
|
|
176
|
-
var raw = localStorage.getItem("lattice:sessions:" + slug);
|
|
177
|
-
if (raw) return JSON.parse(raw);
|
|
178
|
-
} catch {}
|
|
179
|
-
return [];
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
function cacheSessions(slug: string, sessions: SessionSummary[]): void {
|
|
183
|
-
try {
|
|
184
|
-
localStorage.setItem("lattice:sessions:" + slug, JSON.stringify(sessions.slice(0, 100)));
|
|
185
|
-
} catch {}
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
export function SessionList(props: SessionListProps) {
|
|
189
|
-
useTimeTick();
|
|
190
|
-
var ws = useWebSocket();
|
|
191
|
-
var [sessions, setSessions] = useState<SessionSummary[]>(function () { return loadCachedSessions(props.projectSlug); });
|
|
192
|
-
var [loading, setLoading] = useState<boolean>(false);
|
|
193
|
-
var [loadingMore, setLoadingMore] = useState<boolean>(false);
|
|
194
|
-
var [totalCount, setTotalCount] = useState<number>(0);
|
|
195
|
-
var [renameId, setRenameId] = useState<string | null>(null);
|
|
196
|
-
var [renameValue, setRenameValue] = useState<string>("");
|
|
197
|
-
var ctxMenu = useContextMenu<SessionSummary>();
|
|
198
|
-
var [unreadTick, setUnreadTick] = useState<number>(0);
|
|
199
|
-
var [hoveredId, setHoveredId] = useState<string | null>(null);
|
|
200
|
-
var [hoveredRect, setHoveredRect] = useState<DOMRect | null>(null);
|
|
201
|
-
var [previews, setPreviews] = useState<Map<string, SessionPreview>>(new Map());
|
|
202
|
-
var renameInputRef = useRef<HTMLInputElement | null>(null);
|
|
203
|
-
var handleRef = useRef<(msg: ServerMessage) => void>(function () {});
|
|
204
|
-
var activeSessionIdRef = useRef<string | null>(props.activeSessionId);
|
|
205
|
-
var hoverTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
206
|
-
var sentinelRef = useRef<HTMLDivElement | null>(null);
|
|
207
|
-
var scrollContainerRef = useRef<HTMLDivElement | null>(null);
|
|
208
|
-
var offsetRef = useRef<number>(0);
|
|
209
|
-
var hasMoreRef = useRef<boolean>(true);
|
|
210
|
-
activeSessionIdRef.current = props.activeSessionId;
|
|
211
|
-
|
|
212
|
-
useEffect(function () {
|
|
213
|
-
handleRef.current = function (msg: ServerMessage) {
|
|
214
|
-
if (msg.type === "session:list") {
|
|
215
|
-
var listMsg = msg as SessionListMessage;
|
|
216
|
-
if (listMsg.projectSlug === props.projectSlug) {
|
|
217
|
-
var incoming = listMsg.sessions.slice().sort(function (a: typeof listMsg.sessions[number], b: typeof listMsg.sessions[number]) { return b.updatedAt - a.updatedAt; });
|
|
218
|
-
var listOffset = listMsg.offset || 0;
|
|
219
|
-
var listTotal = listMsg.totalCount || incoming.length;
|
|
220
|
-
|
|
221
|
-
if (listOffset > 0) {
|
|
222
|
-
setSessions(function (prev) {
|
|
223
|
-
var existingIds = new Set(prev.map(function (s: typeof prev[number]) { return s.id; }));
|
|
224
|
-
var newSessions = incoming.filter(function (s: typeof incoming[number]) { return !existingIds.has(s.id); });
|
|
225
|
-
return prev.concat(newSessions);
|
|
226
|
-
});
|
|
227
|
-
setLoadingMore(false);
|
|
228
|
-
} else {
|
|
229
|
-
var hadChanges = false;
|
|
230
|
-
for (var i = 0; i < incoming.length; i++) {
|
|
231
|
-
var s = incoming[i];
|
|
232
|
-
var prev = knownUpdatedAt.get(s.id);
|
|
233
|
-
if (prev !== undefined && s.updatedAt > prev && s.id !== activeSessionIdRef.current) {
|
|
234
|
-
markSessionHasUpdates(s.id);
|
|
235
|
-
hadChanges = true;
|
|
236
|
-
}
|
|
237
|
-
knownUpdatedAt.set(s.id, s.updatedAt);
|
|
238
|
-
}
|
|
239
|
-
setSessions(function (existing) {
|
|
240
|
-
if (existing.length <= PAGE_SIZE) return incoming;
|
|
241
|
-
var incomingIds = new Set(incoming.map(function (s: typeof incoming[number]) { return s.id; }));
|
|
242
|
-
var kept = existing.filter(function (s: typeof existing[number]) { return !incomingIds.has(s.id); });
|
|
243
|
-
return incoming.concat(kept).sort(function (a: typeof incoming[number], b: typeof incoming[number]) { return b.updatedAt - a.updatedAt; });
|
|
244
|
-
});
|
|
245
|
-
setLoading(false);
|
|
246
|
-
if (hadChanges) {
|
|
247
|
-
setUnreadTick(function (t) { return t + 1; });
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
setTotalCount(listTotal);
|
|
252
|
-
offsetRef.current = listOffset + incoming.length;
|
|
253
|
-
if (props.projectSlug && listOffset === 0) {
|
|
254
|
-
cacheSessions(props.projectSlug, incoming);
|
|
255
|
-
}
|
|
256
|
-
hasMoreRef.current = listOffset + incoming.length < listTotal;
|
|
257
|
-
}
|
|
258
|
-
} else if (msg.type === "session:created") {
|
|
259
|
-
var createdMsg = msg as SessionCreatedMessage;
|
|
260
|
-
if (createdMsg.session.projectSlug === props.projectSlug) {
|
|
261
|
-
knownUpdatedAt.set(createdMsg.session.id, createdMsg.session.updatedAt);
|
|
262
|
-
setSessions(function (prev2) {
|
|
263
|
-
return [createdMsg.session, ...prev2];
|
|
264
|
-
});
|
|
265
|
-
setTotalCount(function (t) { return t + 1; });
|
|
266
|
-
props.onSessionActivate(createdMsg.session);
|
|
267
|
-
}
|
|
268
|
-
} else if (msg.type === "session:preview") {
|
|
269
|
-
var previewMsg = msg as SessionPreviewMessage;
|
|
270
|
-
setPreviews(function (prev3) {
|
|
271
|
-
var next = new Map(prev3);
|
|
272
|
-
if (next.size >= 100 && !next.has(previewMsg.sessionId)) {
|
|
273
|
-
var oldest = next.keys().next().value;
|
|
274
|
-
if (oldest !== undefined) next.delete(oldest);
|
|
275
|
-
}
|
|
276
|
-
next.set(previewMsg.sessionId, previewMsg.preview);
|
|
277
|
-
return next;
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
};
|
|
281
|
-
});
|
|
282
|
-
|
|
283
|
-
useEffect(function () {
|
|
284
|
-
function handler(msg: ServerMessage) {
|
|
285
|
-
handleRef.current(msg);
|
|
286
|
-
}
|
|
287
|
-
ws.subscribe("session:list", handler);
|
|
288
|
-
ws.subscribe("session:created", handler);
|
|
289
|
-
ws.subscribe("session:preview", handler);
|
|
290
|
-
return function () {
|
|
291
|
-
ws.unsubscribe("session:list", handler);
|
|
292
|
-
ws.unsubscribe("session:created", handler);
|
|
293
|
-
ws.unsubscribe("session:preview", handler);
|
|
294
|
-
};
|
|
295
|
-
}, [ws]);
|
|
296
|
-
|
|
297
|
-
var sendRef = useRef(ws.send);
|
|
298
|
-
sendRef.current = ws.send;
|
|
299
|
-
|
|
300
|
-
useEffect(function () {
|
|
301
|
-
if (props.projectSlug && ws.status === "connected") {
|
|
302
|
-
var cached = loadCachedSessions(props.projectSlug);
|
|
303
|
-
setSessions(cached);
|
|
304
|
-
setLoading(cached.length === 0);
|
|
305
|
-
offsetRef.current = 0;
|
|
306
|
-
hasMoreRef.current = true;
|
|
307
|
-
sendRef.current({ type: "session:list_request", projectSlug: props.projectSlug, offset: 0, limit: PAGE_SIZE });
|
|
308
|
-
var interval = setInterval(function () {
|
|
309
|
-
if (props.projectSlug && ws.status === "connected") {
|
|
310
|
-
sendRef.current({ type: "session:list_request", projectSlug: props.projectSlug, offset: 0, limit: PAGE_SIZE });
|
|
311
|
-
}
|
|
312
|
-
}, 30000);
|
|
313
|
-
return function () { clearInterval(interval); };
|
|
314
|
-
}
|
|
315
|
-
}, [props.projectSlug, ws.status]);
|
|
316
|
-
|
|
317
|
-
var loadMore = useCallback(function () {
|
|
318
|
-
if (!props.projectSlug || loadingMore || !hasMoreRef.current) return;
|
|
319
|
-
setLoadingMore(true);
|
|
320
|
-
sendRef.current({
|
|
321
|
-
type: "session:list_request",
|
|
322
|
-
projectSlug: props.projectSlug,
|
|
323
|
-
offset: offsetRef.current,
|
|
324
|
-
limit: PAGE_SIZE,
|
|
325
|
-
});
|
|
326
|
-
}, [props.projectSlug, loadingMore]);
|
|
327
|
-
|
|
328
|
-
useEffect(function () {
|
|
329
|
-
var sentinel = sentinelRef.current;
|
|
330
|
-
if (!sentinel) return;
|
|
331
|
-
|
|
332
|
-
var observer = new IntersectionObserver(function (entries) {
|
|
333
|
-
if (entries[0].isIntersecting) {
|
|
334
|
-
loadMore();
|
|
335
|
-
}
|
|
336
|
-
}, { root: scrollContainerRef.current, rootMargin: "100px" });
|
|
337
|
-
|
|
338
|
-
observer.observe(sentinel);
|
|
339
|
-
return function () { observer.disconnect(); };
|
|
340
|
-
}, [loadMore]);
|
|
341
|
-
|
|
342
|
-
useEffect(function () {
|
|
343
|
-
if (renameId && renameInputRef.current) {
|
|
344
|
-
renameInputRef.current.focus();
|
|
345
|
-
renameInputRef.current.select();
|
|
346
|
-
}
|
|
347
|
-
}, [renameId]);
|
|
348
|
-
|
|
349
|
-
function handleActivate(session: SessionSummary) {
|
|
350
|
-
if (!props.projectSlug) {
|
|
351
|
-
return;
|
|
352
|
-
}
|
|
353
|
-
if (sessionHasUpdates(session.id)) {
|
|
354
|
-
markSessionRead(session.id, 0);
|
|
355
|
-
setUnreadTick(function (t) { return t + 1; });
|
|
356
|
-
}
|
|
357
|
-
setHoveredId(null);
|
|
358
|
-
props.onSessionActivate(session);
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
function handleContextMenu(e: React.MouseEvent, session: SessionSummary) {
|
|
362
|
-
ctxMenu.open(e, session);
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
function handleRenameStart(session: SessionSummary) {
|
|
366
|
-
ctxMenu.close();
|
|
367
|
-
setRenameId(session.id);
|
|
368
|
-
setRenameValue(session.title);
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
function handleRenameCommit() {
|
|
372
|
-
if (renameId && renameValue.trim()) {
|
|
373
|
-
var originalSession = sessions.find(function (s) { return s.id === renameId; });
|
|
374
|
-
if (originalSession && renameValue.trim() === originalSession.title) {
|
|
375
|
-
setRenameId(null);
|
|
376
|
-
setRenameValue("");
|
|
377
|
-
return;
|
|
378
|
-
}
|
|
379
|
-
ws.send({ type: "session:rename", sessionId: renameId, title: renameValue.trim() });
|
|
380
|
-
setSessions(function (prev) {
|
|
381
|
-
return prev.map(function (s) {
|
|
382
|
-
return s.id === renameId ? { ...s, title: renameValue.trim() } : s;
|
|
383
|
-
});
|
|
384
|
-
});
|
|
385
|
-
}
|
|
386
|
-
setRenameId(null);
|
|
387
|
-
setRenameValue("");
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
function handleRenameKeyDown(e: React.KeyboardEvent<HTMLInputElement>) {
|
|
391
|
-
if (e.key === "Enter") {
|
|
392
|
-
handleRenameCommit();
|
|
393
|
-
} else if (e.key === "Escape") {
|
|
394
|
-
setRenameId(null);
|
|
395
|
-
setRenameValue("");
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
function handleDeleteSession(session: SessionSummary) {
|
|
400
|
-
ctxMenu.close();
|
|
401
|
-
ws.send({ type: "session:delete", sessionId: session.id });
|
|
402
|
-
setSessions(function (prev) {
|
|
403
|
-
return prev.filter(function (s) { return s.id !== session.id; });
|
|
404
|
-
});
|
|
405
|
-
setTotalCount(function (t) { return Math.max(0, t - 1); });
|
|
406
|
-
if (props.activeSessionId === session.id && props.onSessionDeactivate) {
|
|
407
|
-
props.onSessionDeactivate();
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
function handleMouseEnter(session: SessionSummary, e: React.PointerEvent | React.MouseEvent) {
|
|
412
|
-
var rect = (e.currentTarget as HTMLElement).getBoundingClientRect();
|
|
413
|
-
if (hoverTimerRef.current) clearTimeout(hoverTimerRef.current);
|
|
414
|
-
hoverTimerRef.current = setTimeout(function () {
|
|
415
|
-
setHoveredId(session.id);
|
|
416
|
-
setHoveredRect(rect);
|
|
417
|
-
if (!previews.has(session.id) && props.projectSlug) {
|
|
418
|
-
ws.send({ type: "session:preview_request", projectSlug: props.projectSlug, sessionId: session.id });
|
|
419
|
-
}
|
|
420
|
-
}, 300);
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
function handleMouseLeave() {
|
|
424
|
-
if (hoverTimerRef.current) {
|
|
425
|
-
clearTimeout(hoverTimerRef.current);
|
|
426
|
-
hoverTimerRef.current = null;
|
|
427
|
-
}
|
|
428
|
-
setHoveredId(null);
|
|
429
|
-
setHoveredRect(null);
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
var grouped = useMemo(function () {
|
|
433
|
-
var displayed = sessions;
|
|
434
|
-
if (props.filter) {
|
|
435
|
-
var term = props.filter.toLowerCase();
|
|
436
|
-
if (term.startsWith("*")) {
|
|
437
|
-
var idSuffix = term.slice(1);
|
|
438
|
-
displayed = displayed.filter(function (s) {
|
|
439
|
-
return s.id.toLowerCase().endsWith(idSuffix) || s.id.toLowerCase().includes(idSuffix);
|
|
440
|
-
});
|
|
441
|
-
} else {
|
|
442
|
-
displayed = displayed.filter(function (s) {
|
|
443
|
-
return s.title.toLowerCase().includes(term) || s.id.toLowerCase().includes(term);
|
|
444
|
-
});
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
if (props.dateRange) {
|
|
448
|
-
var from = props.dateRange.from;
|
|
449
|
-
var to = props.dateRange.to;
|
|
450
|
-
if (from !== undefined || to !== undefined) {
|
|
451
|
-
displayed = displayed.filter(function (s) {
|
|
452
|
-
if (from !== undefined && s.updatedAt < from) return false;
|
|
453
|
-
if (to !== undefined && s.updatedAt > to) return false;
|
|
454
|
-
return true;
|
|
455
|
-
});
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
return groupByTime(displayed);
|
|
459
|
-
}, [sessions, props.filter, props.dateRange]);
|
|
460
|
-
|
|
461
|
-
if (!props.projectSlug) {
|
|
462
|
-
return (
|
|
463
|
-
<div className="flex-1 flex items-start px-3 py-1.5">
|
|
464
|
-
<span className="text-[13px] text-base-content/40 italic">Select a project</span>
|
|
465
|
-
</div>
|
|
466
|
-
);
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
if (loading && sessions.length === 0) {
|
|
470
|
-
return (
|
|
471
|
-
<div className="flex flex-col flex-1 overflow-hidden min-h-0">
|
|
472
|
-
<div className="flex-1 overflow-y-auto overflow-x-hidden scrollbar-hidden py-0.5 pb-16">
|
|
473
|
-
<SessionSkeleton />
|
|
474
|
-
</div>
|
|
475
|
-
</div>
|
|
476
|
-
);
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
var activePreview = hoveredId ? (previews.get(hoveredId) || null) : null;
|
|
480
|
-
|
|
481
|
-
return (
|
|
482
|
-
<div className="flex flex-col flex-1 overflow-hidden min-h-0">
|
|
483
|
-
<div ref={scrollContainerRef} className="flex-1 overflow-y-auto overflow-x-hidden scrollbar-hidden py-0.5 pb-16">
|
|
484
|
-
{grouped.length === 0 ? (
|
|
485
|
-
<div className="px-4 py-6 text-center">
|
|
486
|
-
{props.filter ? (
|
|
487
|
-
<div className="text-[12px] text-base-content/30">No sessions match your search</div>
|
|
488
|
-
) : (
|
|
489
|
-
<>
|
|
490
|
-
<div className="text-[12px] text-base-content/30 mb-1">No sessions yet</div>
|
|
491
|
-
<div className="text-[11px] text-base-content/20">Click + above to start a conversation with Claude</div>
|
|
492
|
-
</>
|
|
493
|
-
)}
|
|
494
|
-
</div>
|
|
495
|
-
) : (
|
|
496
|
-
grouped.map(function (group) {
|
|
497
|
-
return (
|
|
498
|
-
<div key={group.label}>
|
|
499
|
-
<div className="text-[10px] uppercase tracking-widest text-base-content/30 px-3 pt-3 pb-1 select-none">
|
|
500
|
-
{group.label}
|
|
501
|
-
</div>
|
|
502
|
-
<div className="flex flex-col gap-0.5 overflow-hidden">
|
|
503
|
-
{group.sessions.map(function (session) {
|
|
504
|
-
var isActive = props.activeSessionId === session.id;
|
|
505
|
-
var isRenaming = renameId === session.id;
|
|
506
|
-
var isUnread = !isActive && sessionHasUpdates(session.id);
|
|
507
|
-
return (
|
|
508
|
-
<button
|
|
509
|
-
key={session.id}
|
|
510
|
-
type="button"
|
|
511
|
-
aria-label={"Session: " + session.title}
|
|
512
|
-
aria-current={isActive ? "true" : undefined}
|
|
513
|
-
onClick={function () { handleActivate(session); }}
|
|
514
|
-
onContextMenu={function (e) { handleContextMenu(e, session); }}
|
|
515
|
-
onPointerEnter={function (e) { handleMouseEnter(session, e); }}
|
|
516
|
-
onPointerLeave={handleMouseLeave}
|
|
517
|
-
className={
|
|
518
|
-
"flex flex-row items-start gap-2 px-2.5 py-[5px] mx-1 rounded w-[calc(100%-8px)] min-w-0 overflow-hidden cursor-pointer select-none transition-colors duration-[120ms] text-left focus-visible:ring-2 focus-visible:ring-primary/30 focus-visible:outline-none " +
|
|
519
|
-
(isActive ? "bg-primary/20 text-base-content font-medium" : "hover:bg-base-300/50")
|
|
520
|
-
}
|
|
521
|
-
>
|
|
522
|
-
{isUnread && (
|
|
523
|
-
<span className="shrink-0 mt-[7px] w-2 h-2 rounded-full bg-primary" />
|
|
524
|
-
)}
|
|
525
|
-
<div className="flex flex-col min-w-0 flex-1">
|
|
526
|
-
{isRenaming ? (
|
|
527
|
-
<input
|
|
528
|
-
ref={renameInputRef}
|
|
529
|
-
value={renameValue}
|
|
530
|
-
onChange={function (e) { setRenameValue(e.target.value); }}
|
|
531
|
-
onBlur={handleRenameCommit}
|
|
532
|
-
onKeyDown={handleRenameKeyDown}
|
|
533
|
-
onClick={function (e) { e.stopPropagation(); }}
|
|
534
|
-
className="input input-xs input-bordered w-full text-[13px]"
|
|
535
|
-
/>
|
|
536
|
-
) : (
|
|
537
|
-
<span
|
|
538
|
-
className={
|
|
539
|
-
"text-[13px] truncate leading-snug " +
|
|
540
|
-
(isActive ? "" : isUnread ? "text-base-content font-semibold" : "text-base-content/55")
|
|
541
|
-
}
|
|
542
|
-
>
|
|
543
|
-
{formatSessionTitle(session.title)}
|
|
544
|
-
</span>
|
|
545
|
-
)}
|
|
546
|
-
<div className="flex items-center gap-1.5 mt-0.5">
|
|
547
|
-
<span className="text-[11px] text-base-content/40">
|
|
548
|
-
{formatDate(session.updatedAt)}
|
|
549
|
-
</span>
|
|
550
|
-
{session.messageCount != null && (
|
|
551
|
-
<>
|
|
552
|
-
<span className="text-[11px] text-base-content/40">·</span>
|
|
553
|
-
<span className="text-[11px] text-base-content/40">
|
|
554
|
-
{session.messageCount} msg{session.messageCount !== 1 ? "s" : ""}
|
|
555
|
-
</span>
|
|
556
|
-
</>
|
|
557
|
-
)}
|
|
558
|
-
</div>
|
|
559
|
-
</div>
|
|
560
|
-
</button>
|
|
561
|
-
);
|
|
562
|
-
})}
|
|
563
|
-
</div>
|
|
564
|
-
</div>
|
|
565
|
-
);
|
|
566
|
-
})
|
|
567
|
-
)}
|
|
568
|
-
|
|
569
|
-
{hasMoreRef.current && (
|
|
570
|
-
<div ref={sentinelRef} className="py-3 flex justify-center">
|
|
571
|
-
{loadingMore && (
|
|
572
|
-
<div className="flex items-center gap-2 text-[11px] text-base-content/30">
|
|
573
|
-
<span className="w-3 h-3 border-2 border-base-content/20 border-t-primary/50 rounded-full animate-spin" />
|
|
574
|
-
Loading...
|
|
575
|
-
</div>
|
|
576
|
-
)}
|
|
577
|
-
</div>
|
|
578
|
-
)}
|
|
579
|
-
</div>
|
|
580
|
-
|
|
581
|
-
{hoveredId && (
|
|
582
|
-
<PreviewPopover preview={activePreview} anchorRect={hoveredRect} />
|
|
583
|
-
)}
|
|
584
|
-
|
|
585
|
-
{ctxMenu.state !== null && (
|
|
586
|
-
<ContextMenu
|
|
587
|
-
x={ctxMenu.state.x}
|
|
588
|
-
y={ctxMenu.state.y}
|
|
589
|
-
items={[
|
|
590
|
-
{ label: "Rename", icon: <Pencil size={14} />, onClick: function () { handleRenameStart(ctxMenu.state!.data); } },
|
|
591
|
-
{ label: "Delete", icon: <Trash2 size={14} />, onClick: function () { handleDeleteSession(ctxMenu.state!.data); }, danger: true },
|
|
592
|
-
]}
|
|
593
|
-
onClose={ctxMenu.close}
|
|
594
|
-
label="Session actions"
|
|
595
|
-
/>
|
|
596
|
-
)}
|
|
597
|
-
</div>
|
|
598
|
-
);
|
|
599
|
-
}
|