@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,348 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect, useRef, useCallback } from "react";
|
|
2
|
-
import { useFocusTrap } from "../../hooks/useFocusTrap";
|
|
3
|
-
import { createPortal } from "react-dom";
|
|
4
|
-
import Markdown from "react-markdown";
|
|
5
|
-
import remarkGfm from "remark-gfm";
|
|
6
|
-
import { Columns2, AlignLeft, FileText, Image } from "lucide-react";
|
|
7
|
-
|
|
8
|
-
interface ToolResultRendererProps {
|
|
9
|
-
toolName: string;
|
|
10
|
-
args: string;
|
|
11
|
-
result: string;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function parseArgs(argsStr: string): Record<string, unknown> {
|
|
15
|
-
try {
|
|
16
|
-
return JSON.parse(argsStr);
|
|
17
|
-
} catch {
|
|
18
|
-
return {};
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function isImagePath(path: string): boolean {
|
|
23
|
-
var ext = path.split(".").pop()?.toLowerCase() || "";
|
|
24
|
-
return ["png", "jpg", "jpeg", "gif", "svg", "webp", "bmp", "ico"].includes(ext);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function hasMarkdownTable(text: string): boolean {
|
|
28
|
-
return /\|.+\|[\r\n]+\|[\s-:]+\|/.test(text);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function computeLineDiff(oldText: string, newText: string): Array<{ type: "same" | "add" | "remove"; text: string }> {
|
|
32
|
-
var oldLines = oldText.split("\n");
|
|
33
|
-
var newLines = newText.split("\n");
|
|
34
|
-
var result: Array<{ type: "same" | "add" | "remove"; text: string }> = [];
|
|
35
|
-
|
|
36
|
-
var prefixLen = 0;
|
|
37
|
-
while (prefixLen < oldLines.length && prefixLen < newLines.length && oldLines[prefixLen] === newLines[prefixLen]) {
|
|
38
|
-
prefixLen++;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
var suffixLen = 0;
|
|
42
|
-
while (
|
|
43
|
-
suffixLen < oldLines.length - prefixLen &&
|
|
44
|
-
suffixLen < newLines.length - prefixLen &&
|
|
45
|
-
oldLines[oldLines.length - 1 - suffixLen] === newLines[newLines.length - 1 - suffixLen]
|
|
46
|
-
) {
|
|
47
|
-
suffixLen++;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
var contextBefore = Math.max(0, prefixLen - 3);
|
|
51
|
-
for (var i = contextBefore; i < prefixLen; i++) {
|
|
52
|
-
result.push({ type: "same", text: oldLines[i] });
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
for (var j = prefixLen; j < oldLines.length - suffixLen; j++) {
|
|
56
|
-
result.push({ type: "remove", text: oldLines[j] });
|
|
57
|
-
}
|
|
58
|
-
for (var k = prefixLen; k < newLines.length - suffixLen; k++) {
|
|
59
|
-
result.push({ type: "add", text: newLines[k] });
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
var suffixStart = Math.max(oldLines.length - suffixLen, prefixLen);
|
|
63
|
-
var contextAfter = Math.min(suffixStart + 3, oldLines.length);
|
|
64
|
-
for (var l = suffixStart; l < contextAfter; l++) {
|
|
65
|
-
result.push({ type: "same", text: oldLines[l] });
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return result;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function DiffUnified(props: { oldText: string; newText: string }) {
|
|
72
|
-
var lines = computeLineDiff(props.oldText, props.newText);
|
|
73
|
-
return (
|
|
74
|
-
<div className="font-mono text-[11px] leading-relaxed overflow-x-auto">
|
|
75
|
-
{lines.map(function (line, i) {
|
|
76
|
-
var bg = line.type === "add" ? "bg-success/10" : line.type === "remove" ? "bg-error/10" : "";
|
|
77
|
-
var prefix = line.type === "add" ? "+" : line.type === "remove" ? "-" : " ";
|
|
78
|
-
var color = line.type === "add" ? "text-success/70" : line.type === "remove" ? "text-error/70" : "text-base-content/40";
|
|
79
|
-
return (
|
|
80
|
-
<div key={i} className={bg + " px-2 whitespace-pre-wrap break-words"}>
|
|
81
|
-
<span className={color + " select-none inline-block w-4"}>{prefix}</span>
|
|
82
|
-
<span className={color}>{line.text}</span>
|
|
83
|
-
</div>
|
|
84
|
-
);
|
|
85
|
-
})}
|
|
86
|
-
</div>
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function DiffSideBySide(props: { oldText: string; newText: string }) {
|
|
91
|
-
var lines = computeLineDiff(props.oldText, props.newText);
|
|
92
|
-
var leftLines: Array<{ text: string; type: string }> = [];
|
|
93
|
-
var rightLines: Array<{ text: string; type: string }> = [];
|
|
94
|
-
|
|
95
|
-
for (var i = 0; i < lines.length; i++) {
|
|
96
|
-
if (lines[i].type === "same") {
|
|
97
|
-
leftLines.push({ text: lines[i].text, type: "same" });
|
|
98
|
-
rightLines.push({ text: lines[i].text, type: "same" });
|
|
99
|
-
} else if (lines[i].type === "remove") {
|
|
100
|
-
leftLines.push({ text: lines[i].text, type: "remove" });
|
|
101
|
-
} else if (lines[i].type === "add") {
|
|
102
|
-
rightLines.push({ text: lines[i].text, type: "add" });
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
var maxLen = Math.max(leftLines.length, rightLines.length);
|
|
107
|
-
while (leftLines.length < maxLen) leftLines.push({ text: "", type: "pad" });
|
|
108
|
-
while (rightLines.length < maxLen) rightLines.push({ text: "", type: "pad" });
|
|
109
|
-
|
|
110
|
-
return (
|
|
111
|
-
<div className="font-mono text-[11px] leading-relaxed overflow-x-auto grid grid-cols-2 gap-0">
|
|
112
|
-
<div className="border-r border-base-content/8">
|
|
113
|
-
{leftLines.map(function (line, i) {
|
|
114
|
-
var bg = line.type === "remove" ? "bg-error/10" : "";
|
|
115
|
-
var color = line.type === "remove" ? "text-error/70" : line.type === "same" ? "text-base-content/40" : "text-transparent";
|
|
116
|
-
return (
|
|
117
|
-
<div key={i} className={bg + " px-2 whitespace-pre-wrap break-words min-h-[1.4em]"}>
|
|
118
|
-
<span className={color}>{line.text}</span>
|
|
119
|
-
</div>
|
|
120
|
-
);
|
|
121
|
-
})}
|
|
122
|
-
</div>
|
|
123
|
-
<div>
|
|
124
|
-
{rightLines.map(function (line, i) {
|
|
125
|
-
var bg = line.type === "add" ? "bg-success/10" : "";
|
|
126
|
-
var color = line.type === "add" ? "text-success/70" : line.type === "same" ? "text-base-content/40" : "text-transparent";
|
|
127
|
-
return (
|
|
128
|
-
<div key={i} className={bg + " px-2 whitespace-pre-wrap break-words min-h-[1.4em]"}>
|
|
129
|
-
<span className={color}>{line.text}</span>
|
|
130
|
-
</div>
|
|
131
|
-
);
|
|
132
|
-
})}
|
|
133
|
-
</div>
|
|
134
|
-
</div>
|
|
135
|
-
);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
function DiffRenderer(props: { oldText: string; newText: string }) {
|
|
139
|
-
var [mode, setMode] = useState<"unified" | "split">("unified");
|
|
140
|
-
|
|
141
|
-
return (
|
|
142
|
-
<div>
|
|
143
|
-
<div className="flex items-center justify-between mb-1">
|
|
144
|
-
<div className="text-[9px] text-base-content/25 uppercase tracking-wider font-semibold">Diff</div>
|
|
145
|
-
<div className="flex items-center gap-0.5">
|
|
146
|
-
<button
|
|
147
|
-
type="button"
|
|
148
|
-
onClick={function () { setMode("unified"); }}
|
|
149
|
-
className={"icon-action p-0.5 rounded transition-colors " + (mode === "unified" ? "text-primary/70 bg-primary/10" : "text-base-content/25 hover:text-base-content/40")}
|
|
150
|
-
title="Unified view"
|
|
151
|
-
>
|
|
152
|
-
<AlignLeft size={11} />
|
|
153
|
-
</button>
|
|
154
|
-
<button
|
|
155
|
-
type="button"
|
|
156
|
-
onClick={function () { setMode("split"); }}
|
|
157
|
-
className={"icon-action p-0.5 rounded transition-colors " + (mode === "split" ? "text-primary/70 bg-primary/10" : "text-base-content/25 hover:text-base-content/40")}
|
|
158
|
-
title="Side-by-side view"
|
|
159
|
-
>
|
|
160
|
-
<Columns2 size={11} />
|
|
161
|
-
</button>
|
|
162
|
-
</div>
|
|
163
|
-
</div>
|
|
164
|
-
<div className="rounded-md bg-base-100/50 overflow-hidden">
|
|
165
|
-
{mode === "unified" ? (
|
|
166
|
-
<DiffUnified oldText={props.oldText} newText={props.newText} />
|
|
167
|
-
) : (
|
|
168
|
-
<DiffSideBySide oldText={props.oldText} newText={props.newText} />
|
|
169
|
-
)}
|
|
170
|
-
</div>
|
|
171
|
-
</div>
|
|
172
|
-
);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
function ImageRenderer(props: { path: string }) {
|
|
176
|
-
var [error, setError] = useState(false);
|
|
177
|
-
var [modalOpen, setModalOpen] = useState(false);
|
|
178
|
-
var imgSrc = "/api/file?path=" + encodeURIComponent(props.path);
|
|
179
|
-
var imageModalRef = useRef<HTMLDivElement>(null);
|
|
180
|
-
var closeImageModal = useCallback(function () { setModalOpen(false); }, []);
|
|
181
|
-
useFocusTrap(imageModalRef, closeImageModal, modalOpen);
|
|
182
|
-
|
|
183
|
-
useEffect(function () {
|
|
184
|
-
if (!modalOpen) return;
|
|
185
|
-
var root = document.getElementById("root");
|
|
186
|
-
if (root) root.style.overflow = "hidden";
|
|
187
|
-
document.body.style.overflow = "hidden";
|
|
188
|
-
document.documentElement.style.overflow = "hidden";
|
|
189
|
-
return function () {
|
|
190
|
-
if (root) root.style.overflow = "";
|
|
191
|
-
document.body.style.overflow = "";
|
|
192
|
-
document.documentElement.style.overflow = "";
|
|
193
|
-
};
|
|
194
|
-
}, [modalOpen]);
|
|
195
|
-
|
|
196
|
-
if (error) {
|
|
197
|
-
return (
|
|
198
|
-
<div className="flex items-center gap-1.5 text-[11px] text-base-content/40">
|
|
199
|
-
<Image size={12} />
|
|
200
|
-
<span className="font-mono">{props.path}</span>
|
|
201
|
-
</div>
|
|
202
|
-
);
|
|
203
|
-
}
|
|
204
|
-
return (
|
|
205
|
-
<>
|
|
206
|
-
<div>
|
|
207
|
-
<div className="text-[9px] text-base-content/25 uppercase tracking-wider font-semibold mb-1">Screenshot</div>
|
|
208
|
-
<img
|
|
209
|
-
src={imgSrc}
|
|
210
|
-
alt={props.path}
|
|
211
|
-
className="max-w-full max-h-[240px] rounded-md border border-base-content/10 cursor-pointer hover:border-primary/30 hover:shadow-lg transition-all object-contain"
|
|
212
|
-
onError={function () { setError(true); }}
|
|
213
|
-
onClick={function () { setModalOpen(true); }}
|
|
214
|
-
loading="lazy"
|
|
215
|
-
/>
|
|
216
|
-
<div className="text-[10px] text-base-content/25 font-mono mt-1 truncate">{props.path}</div>
|
|
217
|
-
</div>
|
|
218
|
-
{modalOpen && createPortal(
|
|
219
|
-
<div
|
|
220
|
-
ref={imageModalRef}
|
|
221
|
-
className="fixed inset-0 z-[9999] flex items-center justify-center bg-black/80 backdrop-blur-sm p-4 sm:p-8 cursor-pointer overscroll-contain"
|
|
222
|
-
onClick={function () { setModalOpen(false); }}
|
|
223
|
-
onWheel={function (e) { e.stopPropagation(); }}
|
|
224
|
-
onTouchMove={function (e) { e.stopPropagation(); }}
|
|
225
|
-
role="dialog"
|
|
226
|
-
aria-label="Image preview"
|
|
227
|
-
tabIndex={0}
|
|
228
|
-
>
|
|
229
|
-
<div className="relative max-w-[95vw] max-h-[90vh] sm:max-w-[85vw] sm:max-h-[85vh]" onClick={function (e) { e.stopPropagation(); }}>
|
|
230
|
-
<img
|
|
231
|
-
src={imgSrc}
|
|
232
|
-
alt={props.path}
|
|
233
|
-
className="max-w-full max-h-[90vh] sm:max-h-[85vh] rounded-lg shadow-2xl object-contain"
|
|
234
|
-
/>
|
|
235
|
-
<div className="absolute -top-10 right-0 flex items-center gap-3">
|
|
236
|
-
<a
|
|
237
|
-
href={imgSrc}
|
|
238
|
-
target="_blank"
|
|
239
|
-
rel="noopener noreferrer"
|
|
240
|
-
className="text-[11px] font-mono text-white/50 hover:text-white/80 transition-colors"
|
|
241
|
-
onClick={function (e) { e.stopPropagation(); }}
|
|
242
|
-
>
|
|
243
|
-
Open in tab
|
|
244
|
-
</a>
|
|
245
|
-
<button
|
|
246
|
-
onClick={function () { setModalOpen(false); }}
|
|
247
|
-
className="text-white/50 hover:text-white transition-colors text-lg leading-none"
|
|
248
|
-
aria-label="Close preview"
|
|
249
|
-
>
|
|
250
|
-
×
|
|
251
|
-
</button>
|
|
252
|
-
</div>
|
|
253
|
-
<div className="text-[11px] text-white/30 font-mono mt-2 truncate text-center">{props.path}</div>
|
|
254
|
-
</div>
|
|
255
|
-
</div>,
|
|
256
|
-
document.body
|
|
257
|
-
)}
|
|
258
|
-
</>
|
|
259
|
-
);
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
function FileHeader(props: { path: string }) {
|
|
263
|
-
var parts = props.path.split("/");
|
|
264
|
-
var filename = parts[parts.length - 1] || props.path;
|
|
265
|
-
var ext = filename.split(".").pop() || "";
|
|
266
|
-
return (
|
|
267
|
-
<div className="flex items-center gap-1.5 mb-1">
|
|
268
|
-
<FileText size={10} className="text-base-content/25" />
|
|
269
|
-
<span className="text-[10px] font-mono text-base-content/40 truncate">{filename}</span>
|
|
270
|
-
{ext && <span className="text-[9px] font-mono text-base-content/20 uppercase">{ext}</span>}
|
|
271
|
-
</div>
|
|
272
|
-
);
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
export function ToolResultRenderer(props: ToolResultRendererProps) {
|
|
276
|
-
var args = parseArgs(props.args);
|
|
277
|
-
var result = props.result;
|
|
278
|
-
|
|
279
|
-
if ((props.toolName === "Edit" || props.toolName === "MultiEdit") && args.old_string && args.new_string) {
|
|
280
|
-
return (
|
|
281
|
-
<div className="px-2.5 py-2">
|
|
282
|
-
<DiffRenderer oldText={String(args.old_string)} newText={String(args.new_string)} />
|
|
283
|
-
{result && !result.includes("has been updated successfully") && (
|
|
284
|
-
<div className="mt-2">
|
|
285
|
-
<div className="text-[9px] text-base-content/25 uppercase tracking-wider font-semibold mb-0.5">Result</div>
|
|
286
|
-
<pre className="font-mono text-[11px] text-base-content/45 whitespace-pre-wrap break-words m-0 leading-relaxed bg-base-100/50 rounded-md p-2 max-h-[160px] overflow-y-auto">
|
|
287
|
-
{result}
|
|
288
|
-
</pre>
|
|
289
|
-
</div>
|
|
290
|
-
)}
|
|
291
|
-
</div>
|
|
292
|
-
);
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
if (props.toolName === "mcp__playwright__browser_take_screenshot" || props.toolName === "mcp__playwright__browser_snapshot") {
|
|
296
|
-
var screenshotMatch = result.match(/\[Screenshot[^\]]*\]\(([^)]+)\)/);
|
|
297
|
-
var pathMatch = result.match(/path:\s*['"]?([^\s'"]+\.(?:png|jpg|jpeg))/i);
|
|
298
|
-
var imagePath = screenshotMatch ? screenshotMatch[1] : pathMatch ? pathMatch[1] : null;
|
|
299
|
-
if (imagePath) {
|
|
300
|
-
return (
|
|
301
|
-
<div className="px-2.5 py-2">
|
|
302
|
-
<ImageRenderer path={imagePath} />
|
|
303
|
-
</div>
|
|
304
|
-
);
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
if (props.toolName === "Read" && args.file_path && isImagePath(String(args.file_path))) {
|
|
309
|
-
return (
|
|
310
|
-
<div className="px-2.5 py-2">
|
|
311
|
-
<ImageRenderer path={String(args.file_path)} />
|
|
312
|
-
</div>
|
|
313
|
-
);
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
if (props.toolName === "Read" && args.file_path && result) {
|
|
317
|
-
return (
|
|
318
|
-
<div className="px-2.5 py-2">
|
|
319
|
-
<FileHeader path={String(args.file_path)} />
|
|
320
|
-
<pre className="font-mono text-[11px] text-base-content/45 whitespace-pre-wrap break-words m-0 leading-relaxed bg-base-100/50 rounded-md p-2 max-h-[240px] overflow-y-auto">
|
|
321
|
-
{result}
|
|
322
|
-
</pre>
|
|
323
|
-
</div>
|
|
324
|
-
);
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
if (result && hasMarkdownTable(result)) {
|
|
328
|
-
return (
|
|
329
|
-
<div className="px-2.5 py-2">
|
|
330
|
-
<div className="text-[9px] text-base-content/25 uppercase tracking-wider font-semibold mb-0.5">Result</div>
|
|
331
|
-
<div className="prose prose-sm max-w-none text-[11px] [&_table]:text-[11px] [&_th]:px-2 [&_th]:py-1 [&_td]:px-2 [&_td]:py-1 [&_th]:text-base-content/60 [&_td]:text-base-content/45 [&_table]:border-base-content/10 [&_th]:border-base-content/10 [&_td]:border-base-content/10 [&_th]:bg-base-100/50">
|
|
332
|
-
<Markdown remarkPlugins={[remarkGfm]}>{result}</Markdown>
|
|
333
|
-
</div>
|
|
334
|
-
</div>
|
|
335
|
-
);
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
if (!result) return null;
|
|
339
|
-
|
|
340
|
-
return (
|
|
341
|
-
<div className="px-2.5 py-2">
|
|
342
|
-
<div className="text-[9px] text-base-content/25 uppercase tracking-wider font-semibold mb-0.5">Result</div>
|
|
343
|
-
<pre className="font-mono text-[11px] text-base-content/45 whitespace-pre-wrap break-words m-0 leading-relaxed bg-base-100/50 rounded-md p-2 max-h-[240px] overflow-y-auto">
|
|
344
|
-
{result}
|
|
345
|
-
</pre>
|
|
346
|
-
</div>
|
|
347
|
-
);
|
|
348
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { Mic } from "lucide-react";
|
|
2
|
-
|
|
3
|
-
interface VoiceRecorderProps {
|
|
4
|
-
isRecording: boolean;
|
|
5
|
-
isSupported: boolean;
|
|
6
|
-
isSpeaking: boolean;
|
|
7
|
-
elapsed: number;
|
|
8
|
-
interimTranscript: string;
|
|
9
|
-
onStart: () => void;
|
|
10
|
-
onStop: () => void;
|
|
11
|
-
onCancel: () => void;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function formatTime(seconds: number): string {
|
|
15
|
-
var m = Math.floor(seconds / 60);
|
|
16
|
-
var s = seconds % 60;
|
|
17
|
-
return m + ":" + (s < 10 ? "0" : "") + s;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export function VoiceRecorder(props: VoiceRecorderProps) {
|
|
21
|
-
if (!props.isRecording) {
|
|
22
|
-
return (
|
|
23
|
-
<button
|
|
24
|
-
aria-label={props.isSupported ? "Start voice input" : "Voice input not supported"}
|
|
25
|
-
disabled={!props.isSupported}
|
|
26
|
-
onClick={props.onStart}
|
|
27
|
-
className={
|
|
28
|
-
"w-7 h-7 rounded-md flex items-center justify-center transition-colors flex-shrink-0 " +
|
|
29
|
-
(props.isSupported
|
|
30
|
-
? "text-base-content/30 hover:text-base-content/50 border border-base-content/10 hover:border-base-content/20"
|
|
31
|
-
: "text-base-content/15 cursor-not-allowed")
|
|
32
|
-
}
|
|
33
|
-
title={props.isSupported ? "Voice input" : "Voice input not supported in this browser"}
|
|
34
|
-
>
|
|
35
|
-
<Mic size={13} />
|
|
36
|
-
</button>
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return (
|
|
41
|
-
<div className="flex items-center gap-2 flex-1 min-w-0">
|
|
42
|
-
<button
|
|
43
|
-
aria-label="Stop recording"
|
|
44
|
-
onClick={props.onStop}
|
|
45
|
-
className="w-7 h-7 rounded-md flex items-center justify-center bg-error/15 text-error border border-error/30 animate-pulse flex-shrink-0"
|
|
46
|
-
>
|
|
47
|
-
<Mic size={13} />
|
|
48
|
-
</button>
|
|
49
|
-
|
|
50
|
-
<div className="flex items-center gap-[2px] h-5" aria-hidden="true">
|
|
51
|
-
{Array.from({ length: 8 }).map(function (_, i) {
|
|
52
|
-
return (
|
|
53
|
-
<div
|
|
54
|
-
key={i}
|
|
55
|
-
className={
|
|
56
|
-
"w-[2px] rounded-sm bg-error transition-all duration-300 " +
|
|
57
|
-
(props.isSpeaking ? "animate-waveform" : "")
|
|
58
|
-
}
|
|
59
|
-
style={{
|
|
60
|
-
height: props.isSpeaking ? undefined : "4px",
|
|
61
|
-
opacity: props.isSpeaking ? undefined : 0.3,
|
|
62
|
-
animationDelay: (i * 0.1) + "s",
|
|
63
|
-
}}
|
|
64
|
-
/>
|
|
65
|
-
);
|
|
66
|
-
})}
|
|
67
|
-
</div>
|
|
68
|
-
|
|
69
|
-
<span className="text-[12px] text-error font-mono flex-shrink-0">{formatTime(props.elapsed)}</span>
|
|
70
|
-
|
|
71
|
-
{props.interimTranscript && (
|
|
72
|
-
<span className="text-[11px] text-base-content/30 truncate flex-1 min-w-0">
|
|
73
|
-
{props.interimTranscript.slice(-60)}
|
|
74
|
-
</span>
|
|
75
|
-
)}
|
|
76
|
-
|
|
77
|
-
<button
|
|
78
|
-
onClick={props.onCancel}
|
|
79
|
-
className="text-[11px] text-base-content/40 hover:text-base-content/60 border border-base-content/10 rounded-md px-2 py-0.5 flex-shrink-0"
|
|
80
|
-
>
|
|
81
|
-
Cancel
|
|
82
|
-
</button>
|
|
83
|
-
</div>
|
|
84
|
-
);
|
|
85
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
export function formatToolSummary(name: string, argsStr: string): string {
|
|
2
|
-
try {
|
|
3
|
-
var args = JSON.parse(argsStr);
|
|
4
|
-
if (name === "Read" && args.file_path) return args.file_path;
|
|
5
|
-
if (name === "Write" && args.file_path) return args.file_path;
|
|
6
|
-
if (name === "Edit" && args.file_path) return args.file_path;
|
|
7
|
-
if (name === "MultiEdit" && args.file_path) return args.file_path;
|
|
8
|
-
if (name === "Grep" && args.pattern) return args.pattern + (args.path ? " in " + args.path : "");
|
|
9
|
-
if (name === "Glob" && args.pattern) return args.pattern + (args.path ? " in " + args.path : "");
|
|
10
|
-
if (name === "Bash" && (args.command || args.description)) {
|
|
11
|
-
var cmd = args.description || args.command;
|
|
12
|
-
return cmd.length > 60 ? cmd.slice(0, 57) + "..." : cmd;
|
|
13
|
-
}
|
|
14
|
-
if (name === "LS" && args.path) return args.path;
|
|
15
|
-
if (name === "Agent" && args.description) return args.description;
|
|
16
|
-
if (name === "Skill" && args.skill) return args.skill;
|
|
17
|
-
if (name === "NotebookEdit" && args.file_path) return args.file_path;
|
|
18
|
-
if (name === "WebSearch" && args.query) return args.query;
|
|
19
|
-
if (name === "WebFetch" && args.url) return args.url.length > 60 ? args.url.slice(0, 57) + "..." : args.url;
|
|
20
|
-
if (name === "TodoWrite" || name === "TaskCreate" || name === "TaskUpdate") {
|
|
21
|
-
if (args.description) return args.description.length > 50 ? args.description.slice(0, 47) + "..." : args.description;
|
|
22
|
-
}
|
|
23
|
-
if (name.startsWith("mcp__playwright__")) {
|
|
24
|
-
var short = name.replace("mcp__playwright__browser_", "");
|
|
25
|
-
if (args.url) return short + " " + args.url;
|
|
26
|
-
if (args.element) return short + " " + args.element;
|
|
27
|
-
if (args.filename) return short + " → " + args.filename;
|
|
28
|
-
return short;
|
|
29
|
-
}
|
|
30
|
-
if (name.startsWith("mcp__")) {
|
|
31
|
-
var parts = name.split("__");
|
|
32
|
-
return parts.length >= 3 ? parts.slice(2).join(".") : name;
|
|
33
|
-
}
|
|
34
|
-
if (args.file_path) return args.file_path;
|
|
35
|
-
if (args.path) return args.path;
|
|
36
|
-
if (args.query) return args.query;
|
|
37
|
-
return "";
|
|
38
|
-
} catch {
|
|
39
|
-
return "";
|
|
40
|
-
}
|
|
41
|
-
}
|
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect, useMemo } from "react";
|
|
2
|
-
import { useMesh } from "../../hooks/useMesh";
|
|
3
|
-
import { useProjects } from "../../hooks/useProjects";
|
|
4
|
-
import { useSidebar } from "../../hooks/useSidebar";
|
|
5
|
-
import { useWebSocket } from "../../hooks/useWebSocket";
|
|
6
|
-
import { useTimeTick } from "../../hooks/useTimeTick";
|
|
7
|
-
import { LatticeLogomark } from "../ui/LatticeLogomark";
|
|
8
|
-
import { QuickStats } from "../analytics/QuickStats";
|
|
9
|
-
import {
|
|
10
|
-
Network, FolderOpen, MessageSquare, Menu,
|
|
11
|
-
ChevronRight, CircleDot, Circle,
|
|
12
|
-
} from "lucide-react";
|
|
13
|
-
import type { ServerMessage, SessionSummary, LatticeConfig } from "#shared";
|
|
14
|
-
import { formatSessionTitle } from "../../utils/formatSessionTitle";
|
|
15
|
-
import { openSessionTab } from "../../stores/workspace";
|
|
16
|
-
|
|
17
|
-
function relativeTime(ts: number): string {
|
|
18
|
-
var diff = Date.now() - ts;
|
|
19
|
-
var seconds = Math.floor(diff / 1000);
|
|
20
|
-
if (seconds < 60) return seconds + "s ago";
|
|
21
|
-
var minutes = Math.floor(seconds / 60);
|
|
22
|
-
if (minutes < 60) return minutes + "m ago";
|
|
23
|
-
var hours = Math.floor(minutes / 60);
|
|
24
|
-
if (hours < 24) return hours + "h ago";
|
|
25
|
-
var days = Math.floor(hours / 24);
|
|
26
|
-
return days + "d ago";
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export function DashboardView() {
|
|
30
|
-
useTimeTick();
|
|
31
|
-
var { nodes } = useMesh();
|
|
32
|
-
var { projects } = useProjects();
|
|
33
|
-
var sidebar = useSidebar();
|
|
34
|
-
var { send, subscribe, unsubscribe } = useWebSocket();
|
|
35
|
-
var [sessions, setSessions] = useState<SessionSummary[]>([]);
|
|
36
|
-
var [localConfig, setLocalConfig] = useState<LatticeConfig | null>(null);
|
|
37
|
-
|
|
38
|
-
var onlineNodes = useMemo(function () {
|
|
39
|
-
return nodes.filter(function (n) { return n.online; });
|
|
40
|
-
}, [nodes]);
|
|
41
|
-
|
|
42
|
-
useEffect(function () {
|
|
43
|
-
function handleSessions(msg: ServerMessage) {
|
|
44
|
-
if (msg.type !== "session:list_all") return;
|
|
45
|
-
var data = msg as { type: "session:list_all"; sessions: SessionSummary[] };
|
|
46
|
-
setSessions(data.sessions);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function handleSettings(msg: ServerMessage) {
|
|
50
|
-
if (msg.type !== "settings:data") return;
|
|
51
|
-
var data = msg as { type: "settings:data"; config: LatticeConfig };
|
|
52
|
-
setLocalConfig(data.config);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
subscribe("session:list_all", handleSessions);
|
|
56
|
-
subscribe("settings:data", handleSettings);
|
|
57
|
-
send({ type: "session:list_all_request" });
|
|
58
|
-
send({ type: "settings:get" });
|
|
59
|
-
|
|
60
|
-
return function () {
|
|
61
|
-
unsubscribe("session:list_all", handleSessions);
|
|
62
|
-
unsubscribe("settings:data", handleSettings);
|
|
63
|
-
};
|
|
64
|
-
}, []);
|
|
65
|
-
|
|
66
|
-
var projectTitleMap = useMemo(function () {
|
|
67
|
-
var map = new Map<string, string>();
|
|
68
|
-
for (var i = 0; i < projects.length; i++) {
|
|
69
|
-
map.set(projects[i].slug, projects[i].title);
|
|
70
|
-
}
|
|
71
|
-
return map;
|
|
72
|
-
}, [projects]);
|
|
73
|
-
|
|
74
|
-
function getProjectTitle(slug: string): string {
|
|
75
|
-
return projectTitleMap.get(slug) || slug;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
var sessionsByProject = useMemo(function () {
|
|
79
|
-
var map = new Map<string, SessionSummary[]>();
|
|
80
|
-
for (var i = 0; i < sessions.length; i++) {
|
|
81
|
-
var s = sessions[i];
|
|
82
|
-
var arr = map.get(s.projectSlug);
|
|
83
|
-
if (!arr) {
|
|
84
|
-
arr = [];
|
|
85
|
-
map.set(s.projectSlug, arr);
|
|
86
|
-
}
|
|
87
|
-
arr.push(s);
|
|
88
|
-
}
|
|
89
|
-
return map;
|
|
90
|
-
}, [sessions]);
|
|
91
|
-
|
|
92
|
-
var remoteNodes = nodes.filter(function (n) { return !n.isLocal; });
|
|
93
|
-
|
|
94
|
-
return (
|
|
95
|
-
<div className="flex-1 overflow-auto">
|
|
96
|
-
<div className="max-w-2xl mx-auto px-4 sm:px-8 py-6 sm:py-10">
|
|
97
|
-
<div className="flex items-center gap-3 mb-2">
|
|
98
|
-
<button
|
|
99
|
-
className="btn btn-ghost btn-sm btn-square lg:hidden"
|
|
100
|
-
aria-label="Toggle sidebar"
|
|
101
|
-
onClick={sidebar.toggleDrawer}
|
|
102
|
-
>
|
|
103
|
-
<Menu size={18} />
|
|
104
|
-
</button>
|
|
105
|
-
<LatticeLogomark size={28} />
|
|
106
|
-
<h1 className="text-lg font-mono font-bold text-base-content">Lattice</h1>
|
|
107
|
-
</div>
|
|
108
|
-
|
|
109
|
-
<div className="flex items-center gap-4 text-[11px] font-mono text-base-content/30 mb-10 ml-[43px]">
|
|
110
|
-
<span>{onlineNodes.length}/{nodes.length} nodes</span>
|
|
111
|
-
<span className="text-base-content/15">/</span>
|
|
112
|
-
<span>{projects.length} projects</span>
|
|
113
|
-
<span className="text-base-content/15">/</span>
|
|
114
|
-
<span>{sessions.length} sessions</span>
|
|
115
|
-
</div>
|
|
116
|
-
|
|
117
|
-
<div className="mb-12">
|
|
118
|
-
<QuickStats />
|
|
119
|
-
</div>
|
|
120
|
-
|
|
121
|
-
{sessions.length > 0 && (
|
|
122
|
-
<div className="mb-12">
|
|
123
|
-
<h2 className="text-[11px] font-semibold tracking-wider uppercase text-base-content/40 mb-3">Recent Sessions</h2>
|
|
124
|
-
<div className="flex flex-col gap-1">
|
|
125
|
-
{sessions.slice(0, 8).map(function (s) {
|
|
126
|
-
return (
|
|
127
|
-
<button
|
|
128
|
-
key={s.id}
|
|
129
|
-
onClick={function () { openSessionTab(s.id, s.projectSlug, s.title); sidebar.navigateToSession(s.projectSlug, s.id); }}
|
|
130
|
-
className="flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-base-200 transition-colors duration-[120ms] cursor-pointer text-left focus-visible:ring-2 focus-visible:ring-primary group"
|
|
131
|
-
>
|
|
132
|
-
<MessageSquare size={12} className="text-base-content/20 flex-shrink-0" />
|
|
133
|
-
<span className="flex-1 text-[12px] text-base-content/70 truncate group-hover:text-base-content">{formatSessionTitle(s.title) || "Untitled"}</span>
|
|
134
|
-
<span className="text-[10px] font-mono text-base-content/25 flex-shrink-0">
|
|
135
|
-
{getProjectTitle(s.projectSlug)}
|
|
136
|
-
</span>
|
|
137
|
-
<span className="text-[10px] text-base-content/20 font-mono flex-shrink-0">
|
|
138
|
-
{relativeTime(s.updatedAt)}
|
|
139
|
-
</span>
|
|
140
|
-
<ChevronRight size={10} className="text-base-content/15 flex-shrink-0 opacity-0 group-hover:opacity-100" />
|
|
141
|
-
</button>
|
|
142
|
-
);
|
|
143
|
-
})}
|
|
144
|
-
</div>
|
|
145
|
-
</div>
|
|
146
|
-
)}
|
|
147
|
-
|
|
148
|
-
{projects.length > 0 && (
|
|
149
|
-
<div className="mb-12">
|
|
150
|
-
<h2 className="text-[11px] font-semibold tracking-wider uppercase text-base-content/40 mb-3">Projects</h2>
|
|
151
|
-
<div className="grid grid-cols-1 sm:grid-cols-2 gap-2">
|
|
152
|
-
{projects.map(function (project) {
|
|
153
|
-
var projectSessions = sessionsByProject.get(project.slug) || [];
|
|
154
|
-
return (
|
|
155
|
-
<button
|
|
156
|
-
key={project.slug + "@" + project.nodeId}
|
|
157
|
-
onClick={function () { sidebar.setActiveProjectSlug(project.slug); }}
|
|
158
|
-
className="flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-base-200 transition-colors duration-[120ms] cursor-pointer text-left focus-visible:ring-2 focus-visible:ring-primary group"
|
|
159
|
-
>
|
|
160
|
-
<FolderOpen size={14} className="text-base-content/20 flex-shrink-0" />
|
|
161
|
-
<div className="flex-1 min-w-0">
|
|
162
|
-
<div className="text-[13px] font-semibold text-base-content/70 truncate group-hover:text-base-content">{project.title}</div>
|
|
163
|
-
<div className="text-[10px] text-base-content/25 font-mono">
|
|
164
|
-
{projectSessions.length} session{projectSessions.length !== 1 ? "s" : ""}
|
|
165
|
-
{project.isRemote && (
|
|
166
|
-
<span className="ml-1.5 text-base-content/20">on {project.nodeName}</span>
|
|
167
|
-
)}
|
|
168
|
-
</div>
|
|
169
|
-
</div>
|
|
170
|
-
<ChevronRight size={12} className="text-base-content/15 flex-shrink-0 opacity-0 group-hover:opacity-100" />
|
|
171
|
-
</button>
|
|
172
|
-
);
|
|
173
|
-
})}
|
|
174
|
-
</div>
|
|
175
|
-
</div>
|
|
176
|
-
)}
|
|
177
|
-
|
|
178
|
-
{remoteNodes.length > 0 && (
|
|
179
|
-
<div>
|
|
180
|
-
<h2 className="text-[11px] font-semibold tracking-wider uppercase text-base-content/40 mb-3">Mesh</h2>
|
|
181
|
-
<div className="flex flex-wrap gap-x-6 gap-y-2">
|
|
182
|
-
{remoteNodes.map(function (node) {
|
|
183
|
-
return (
|
|
184
|
-
<div key={node.id} className="flex items-center gap-2">
|
|
185
|
-
{node.online
|
|
186
|
-
? <CircleDot size={10} className="text-success flex-shrink-0" />
|
|
187
|
-
: <Circle size={10} className="text-base-content/20 flex-shrink-0" />
|
|
188
|
-
}
|
|
189
|
-
<span className="text-[12px] text-base-content/50">{node.name}</span>
|
|
190
|
-
<span className="text-[10px] text-base-content/20 font-mono">{node.projects.length}p</span>
|
|
191
|
-
</div>
|
|
192
|
-
);
|
|
193
|
-
})}
|
|
194
|
-
</div>
|
|
195
|
-
</div>
|
|
196
|
-
)}
|
|
197
|
-
</div>
|
|
198
|
-
</div>
|
|
199
|
-
);
|
|
200
|
-
}
|