@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,405 +0,0 @@
|
|
|
1
|
-
import { useState, useMemo, useEffect } from "react";
|
|
2
|
-
import { createPortal } from "react-dom";
|
|
3
|
-
import { X, ChevronLeft, ChevronRight, Download, Save, Palette, Sun, Moon, Check } from "lucide-react";
|
|
4
|
-
import { ThemePreview, ThemeSwatches } from "./ThemePreview";
|
|
5
|
-
import { deriveFullPalette, normalizeHex, isValidHex } from "../../lib/theme-derive";
|
|
6
|
-
import { useWebSocket } from "../../hooks/useWebSocket";
|
|
7
|
-
import { themes as allThemes } from "../../themes";
|
|
8
|
-
import type { ThemeEntry } from "../../themes";
|
|
9
|
-
|
|
10
|
-
interface ThemeWizardProps {
|
|
11
|
-
onClose: () => void;
|
|
12
|
-
editTheme?: { name: string; author: string; variant: "dark" | "light"; colors: Record<string, string> } | null;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
var BASE16_KEYS = ["base00", "base01", "base02", "base03", "base04", "base05", "base06", "base07", "base08", "base09", "base0A", "base0B", "base0C", "base0D", "base0E", "base0F"];
|
|
16
|
-
|
|
17
|
-
var COLOR_LABELS: Record<string, string> = {
|
|
18
|
-
base00: "Background",
|
|
19
|
-
base01: "Lighter Background",
|
|
20
|
-
base02: "Selection",
|
|
21
|
-
base03: "Comments",
|
|
22
|
-
base04: "Dark Foreground",
|
|
23
|
-
base05: "Foreground",
|
|
24
|
-
base06: "Light Foreground",
|
|
25
|
-
base07: "Brightest",
|
|
26
|
-
base08: "Red / Variables",
|
|
27
|
-
base09: "Orange / Numbers",
|
|
28
|
-
base0A: "Yellow / Classes",
|
|
29
|
-
base0B: "Green / Strings",
|
|
30
|
-
base0C: "Cyan / Support",
|
|
31
|
-
base0D: "Blue / Functions",
|
|
32
|
-
base0E: "Purple / Keywords",
|
|
33
|
-
base0F: "Brown / Deprecated",
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
function emptyColors(): Record<string, string> {
|
|
37
|
-
var c: Record<string, string> = {};
|
|
38
|
-
for (var i = 0; i < BASE16_KEYS.length; i++) {
|
|
39
|
-
c[BASE16_KEYS[i]] = "000000";
|
|
40
|
-
}
|
|
41
|
-
return c;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function defaultDarkColors(): Record<string, string> {
|
|
45
|
-
return {
|
|
46
|
-
base00: "1a1a2e", base01: "222240", base02: "2a2a4a", base03: "505070",
|
|
47
|
-
base04: "7a7a9a", base05: "c0c0d0", base06: "d0d0e0", base07: "ffffff",
|
|
48
|
-
base08: "ff6b6b", base09: "ffa06b", base0A: "ffd06b", base0B: "6bffa0",
|
|
49
|
-
base0C: "6bd0ff", base0D: "6b9fff", base0E: "c06bff", base0F: "ff6bb0",
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function defaultLightColors(): Record<string, string> {
|
|
54
|
-
return {
|
|
55
|
-
base00: "f5f5f0", base01: "e8e8e0", base02: "d5d5cd", base03: "999990",
|
|
56
|
-
base04: "666660", base05: "333330", base06: "222220", base07: "000000",
|
|
57
|
-
base08: "c24040", base09: "b06030", base0A: "907020", base0B: "408040",
|
|
58
|
-
base0C: "207080", base0D: "3060b0", base0E: "703090", base0F: "a04060",
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export function ThemeWizard(props: ThemeWizardProps) {
|
|
63
|
-
var ws = useWebSocket();
|
|
64
|
-
var [step, setStep] = useState(1);
|
|
65
|
-
var [name, setName] = useState(props.editTheme?.name || "");
|
|
66
|
-
var [author, setAuthor] = useState(props.editTheme?.author || "");
|
|
67
|
-
var [variant, setVariant] = useState<"dark" | "light">(props.editTheme?.variant || "dark");
|
|
68
|
-
var [baseTheme, setBaseTheme] = useState<string | null>(null);
|
|
69
|
-
var [colors, setColors] = useState<Record<string, string>>(
|
|
70
|
-
props.editTheme?.colors || defaultDarkColors()
|
|
71
|
-
);
|
|
72
|
-
var [coreBg, setCoreBg] = useState(colors.base00);
|
|
73
|
-
var [coreSurface, setCoreSurface] = useState(colors.base02);
|
|
74
|
-
var [coreFg, setCoreFg] = useState(colors.base05);
|
|
75
|
-
var [coreAccent, setCoreAccent] = useState(colors.base0D);
|
|
76
|
-
var [showAdvanced, setShowAdvanced] = useState(false);
|
|
77
|
-
|
|
78
|
-
function handleBaseSelect(themeName: string) {
|
|
79
|
-
setBaseTheme(themeName);
|
|
80
|
-
var found = allThemes.find(function (t: ThemeEntry) { return t.theme.name === themeName; });
|
|
81
|
-
if (found) {
|
|
82
|
-
var theme = found.theme as unknown as Record<string, string>;
|
|
83
|
-
var newColors: Record<string, string> = {};
|
|
84
|
-
for (var i = 0; i < BASE16_KEYS.length; i++) {
|
|
85
|
-
newColors[BASE16_KEYS[i]] = normalizeHex(theme[BASE16_KEYS[i]] || "000000");
|
|
86
|
-
}
|
|
87
|
-
setColors(newColors);
|
|
88
|
-
setVariant(found.theme.variant as "dark" | "light");
|
|
89
|
-
setCoreBg(newColors.base00);
|
|
90
|
-
setCoreSurface(newColors.base02);
|
|
91
|
-
setCoreFg(newColors.base05);
|
|
92
|
-
setCoreAccent(newColors.base0D);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
function handleVariantChange(v: "dark" | "light") {
|
|
97
|
-
setVariant(v);
|
|
98
|
-
if (!baseTheme && !props.editTheme) {
|
|
99
|
-
var defaults = v === "dark" ? defaultDarkColors() : defaultLightColors();
|
|
100
|
-
setColors(defaults);
|
|
101
|
-
setCoreBg(defaults.base00);
|
|
102
|
-
setCoreSurface(defaults.base02);
|
|
103
|
-
setCoreFg(defaults.base05);
|
|
104
|
-
setCoreAccent(defaults.base0D);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
function handleCoreChange(field: "bg" | "surface" | "fg" | "accent", value: string) {
|
|
109
|
-
var hex = normalizeHex(value);
|
|
110
|
-
if (field === "bg") setCoreBg(hex);
|
|
111
|
-
if (field === "surface") setCoreSurface(hex);
|
|
112
|
-
if (field === "fg") setCoreFg(hex);
|
|
113
|
-
if (field === "accent") setCoreAccent(hex);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
useEffect(function () {
|
|
117
|
-
if (step === 2 && isValidHex(coreBg) && isValidHex(coreSurface) && isValidHex(coreFg) && isValidHex(coreAccent)) {
|
|
118
|
-
var derived = deriveFullPalette(normalizeHex(coreBg), normalizeHex(coreSurface), normalizeHex(coreFg), normalizeHex(coreAccent), variant);
|
|
119
|
-
setColors(derived);
|
|
120
|
-
}
|
|
121
|
-
}, [coreBg, coreSurface, coreFg, coreAccent, variant, step]);
|
|
122
|
-
|
|
123
|
-
function handleColorChange(key: string, value: string) {
|
|
124
|
-
var hex = normalizeHex(value);
|
|
125
|
-
setColors(function (prev) {
|
|
126
|
-
var next = { ...prev };
|
|
127
|
-
next[key] = hex;
|
|
128
|
-
return next;
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
function handleSave() {
|
|
133
|
-
ws.send({
|
|
134
|
-
type: "theme:save",
|
|
135
|
-
name: name || "Untitled Theme",
|
|
136
|
-
author: author || "Custom",
|
|
137
|
-
variant: variant,
|
|
138
|
-
colors: colors,
|
|
139
|
-
} as any);
|
|
140
|
-
props.onClose();
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
function handleExport() {
|
|
144
|
-
var theme: Record<string, string> = {
|
|
145
|
-
name: name || "Untitled Theme",
|
|
146
|
-
author: author || "Custom",
|
|
147
|
-
variant: variant,
|
|
148
|
-
};
|
|
149
|
-
for (var i = 0; i < BASE16_KEYS.length; i++) {
|
|
150
|
-
theme[BASE16_KEYS[i]] = colors[BASE16_KEYS[i]];
|
|
151
|
-
}
|
|
152
|
-
var blob = new Blob([JSON.stringify(theme, null, 2)], { type: "application/json" });
|
|
153
|
-
var url = URL.createObjectURL(blob);
|
|
154
|
-
var a = document.createElement("a");
|
|
155
|
-
a.href = url;
|
|
156
|
-
a.download = (name || "custom-theme").toLowerCase().replace(/[^a-z0-9]+/g, "-") + ".json";
|
|
157
|
-
a.click();
|
|
158
|
-
URL.revokeObjectURL(url);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
var canProceed = step === 1 ? name.trim().length > 0 : true;
|
|
162
|
-
|
|
163
|
-
return createPortal(
|
|
164
|
-
<div className="fixed inset-0 z-[9999] flex items-center justify-center bg-base-content/60 backdrop-blur-sm" onClick={props.onClose}>
|
|
165
|
-
<div
|
|
166
|
-
className="bg-base-200 border border-base-content/15 rounded-2xl shadow-2xl w-[90vw] max-w-[860px] max-h-[85vh] flex flex-col overflow-hidden"
|
|
167
|
-
onClick={function (e) { e.stopPropagation(); }}
|
|
168
|
-
>
|
|
169
|
-
<div className="flex items-center justify-between px-5 py-3.5 border-b border-base-content/10">
|
|
170
|
-
<div className="flex items-center gap-3">
|
|
171
|
-
<Palette size={18} className="text-primary" />
|
|
172
|
-
<h2 className="text-sm font-semibold text-base-content">
|
|
173
|
-
{props.editTheme ? "Edit Theme" : "Create Theme"}
|
|
174
|
-
</h2>
|
|
175
|
-
<div className="flex items-center gap-1 ml-2">
|
|
176
|
-
{[1, 2, 3, 4].map(function (s) {
|
|
177
|
-
return (
|
|
178
|
-
<div
|
|
179
|
-
key={s}
|
|
180
|
-
className={"w-2 h-2 rounded-full transition-colors " + (s === step ? "bg-primary" : s < step ? "bg-primary/40" : "bg-base-content/15")}
|
|
181
|
-
/>
|
|
182
|
-
);
|
|
183
|
-
})}
|
|
184
|
-
</div>
|
|
185
|
-
</div>
|
|
186
|
-
<button onClick={props.onClose} className="btn btn-ghost btn-sm btn-circle">
|
|
187
|
-
<X size={16} />
|
|
188
|
-
</button>
|
|
189
|
-
</div>
|
|
190
|
-
|
|
191
|
-
<div className="flex-1 overflow-y-auto p-5">
|
|
192
|
-
{step === 1 && (
|
|
193
|
-
<div className="space-y-4">
|
|
194
|
-
<div>
|
|
195
|
-
<label className="text-xs font-medium text-base-content/50 uppercase tracking-wider mb-1.5 block">Theme Name</label>
|
|
196
|
-
<input
|
|
197
|
-
type="text"
|
|
198
|
-
value={name}
|
|
199
|
-
onChange={function (e) { setName(e.target.value); }}
|
|
200
|
-
placeholder="My Awesome Theme"
|
|
201
|
-
className="input input-bordered w-full max-w-xs text-sm"
|
|
202
|
-
autoFocus
|
|
203
|
-
/>
|
|
204
|
-
</div>
|
|
205
|
-
|
|
206
|
-
<div>
|
|
207
|
-
<label className="text-xs font-medium text-base-content/50 uppercase tracking-wider mb-1.5 block">Variant</label>
|
|
208
|
-
<div className="flex gap-2">
|
|
209
|
-
<button
|
|
210
|
-
onClick={function () { handleVariantChange("dark"); }}
|
|
211
|
-
className={"btn btn-sm gap-2 " + (variant === "dark" ? "btn-primary" : "btn-ghost")}
|
|
212
|
-
>
|
|
213
|
-
<Moon size={14} /> Dark
|
|
214
|
-
</button>
|
|
215
|
-
<button
|
|
216
|
-
onClick={function () { handleVariantChange("light"); }}
|
|
217
|
-
className={"btn btn-sm gap-2 " + (variant === "light" ? "btn-primary" : "btn-ghost")}
|
|
218
|
-
>
|
|
219
|
-
<Sun size={14} /> Light
|
|
220
|
-
</button>
|
|
221
|
-
</div>
|
|
222
|
-
</div>
|
|
223
|
-
|
|
224
|
-
<div>
|
|
225
|
-
<label className="text-xs font-medium text-base-content/50 uppercase tracking-wider mb-2 block">Start from (optional)</label>
|
|
226
|
-
<div className="grid grid-cols-4 sm:grid-cols-6 gap-2 max-h-[300px] overflow-y-auto pr-1">
|
|
227
|
-
{allThemes.filter(function (t: ThemeEntry) { return t.theme.variant === variant; }).map(function (t: ThemeEntry) {
|
|
228
|
-
var isSelected = baseTheme === t.theme.name;
|
|
229
|
-
return (
|
|
230
|
-
<button
|
|
231
|
-
key={t.id}
|
|
232
|
-
onClick={function () { handleBaseSelect(t.theme.name); }}
|
|
233
|
-
className={"relative rounded-lg border-2 p-1 transition-all cursor-pointer " + (isSelected ? "border-primary ring-2 ring-primary/20" : "border-transparent hover:border-base-content/20")}
|
|
234
|
-
>
|
|
235
|
-
<ThemeSwatches colors={t.theme as unknown as Record<string, string>} />
|
|
236
|
-
<div className="text-[9px] text-base-content/50 mt-1 truncate text-center">{t.theme.name}</div>
|
|
237
|
-
{isSelected && (
|
|
238
|
-
<div className="absolute -top-1 -right-1 w-4 h-4 rounded-full bg-primary flex items-center justify-center">
|
|
239
|
-
<Check size={10} className="text-primary-content" />
|
|
240
|
-
</div>
|
|
241
|
-
)}
|
|
242
|
-
</button>
|
|
243
|
-
);
|
|
244
|
-
})}
|
|
245
|
-
</div>
|
|
246
|
-
</div>
|
|
247
|
-
</div>
|
|
248
|
-
)}
|
|
249
|
-
|
|
250
|
-
{step === 2 && (
|
|
251
|
-
<div className="flex gap-6">
|
|
252
|
-
<div className="flex-1 space-y-4">
|
|
253
|
-
<p className="text-xs text-base-content/40 mb-3">Pick 4 core colors. The remaining 12 are auto-derived.</p>
|
|
254
|
-
|
|
255
|
-
<ColorPicker label="Background" sublabel="base00 — Main background" value={coreBg} onChange={function (v) { handleCoreChange("bg", v); }} />
|
|
256
|
-
<ColorPicker label="Surface" sublabel="base02 — Panels, selections" value={coreSurface} onChange={function (v) { handleCoreChange("surface", v); }} />
|
|
257
|
-
<ColorPicker label="Foreground" sublabel="base05 — Main text" value={coreFg} onChange={function (v) { handleCoreChange("fg", v); }} />
|
|
258
|
-
<ColorPicker label="Accent" sublabel="base0D — Links, interactive elements" value={coreAccent} onChange={function (v) { handleCoreChange("accent", v); }} />
|
|
259
|
-
</div>
|
|
260
|
-
<div className="w-[320px] shrink-0">
|
|
261
|
-
<ThemePreview colors={colors} variant={variant} />
|
|
262
|
-
<div className="mt-3">
|
|
263
|
-
<ThemeSwatches colors={colors} />
|
|
264
|
-
</div>
|
|
265
|
-
</div>
|
|
266
|
-
</div>
|
|
267
|
-
)}
|
|
268
|
-
|
|
269
|
-
{step === 3 && (
|
|
270
|
-
<div className="flex gap-6">
|
|
271
|
-
<div className="flex-1 space-y-3">
|
|
272
|
-
<button
|
|
273
|
-
onClick={function () { setShowAdvanced(!showAdvanced); }}
|
|
274
|
-
className="text-xs text-primary cursor-pointer hover:underline"
|
|
275
|
-
>
|
|
276
|
-
{showAdvanced ? "Hide individual colors" : "Show individual colors"}
|
|
277
|
-
</button>
|
|
278
|
-
|
|
279
|
-
{showAdvanced && (
|
|
280
|
-
<div className="space-y-4">
|
|
281
|
-
<div>
|
|
282
|
-
<div className="text-[10px] font-semibold text-base-content/30 uppercase tracking-wider mb-2">Backgrounds</div>
|
|
283
|
-
<div className="grid grid-cols-2 gap-2">
|
|
284
|
-
{["base00", "base01", "base02", "base03"].map(function (key) {
|
|
285
|
-
return <ColorPicker key={key} label={key} sublabel={COLOR_LABELS[key]} value={colors[key]} onChange={function (v) { handleColorChange(key, v); }} compact />;
|
|
286
|
-
})}
|
|
287
|
-
</div>
|
|
288
|
-
</div>
|
|
289
|
-
<div>
|
|
290
|
-
<div className="text-[10px] font-semibold text-base-content/30 uppercase tracking-wider mb-2">Foregrounds</div>
|
|
291
|
-
<div className="grid grid-cols-2 gap-2">
|
|
292
|
-
{["base04", "base05", "base06", "base07"].map(function (key) {
|
|
293
|
-
return <ColorPicker key={key} label={key} sublabel={COLOR_LABELS[key]} value={colors[key]} onChange={function (v) { handleColorChange(key, v); }} compact />;
|
|
294
|
-
})}
|
|
295
|
-
</div>
|
|
296
|
-
</div>
|
|
297
|
-
<div>
|
|
298
|
-
<div className="text-[10px] font-semibold text-base-content/30 uppercase tracking-wider mb-2">Syntax & UI</div>
|
|
299
|
-
<div className="grid grid-cols-2 gap-2">
|
|
300
|
-
{["base08", "base09", "base0A", "base0B", "base0C", "base0D", "base0E", "base0F"].map(function (key) {
|
|
301
|
-
return <ColorPicker key={key} label={key} sublabel={COLOR_LABELS[key]} value={colors[key]} onChange={function (v) { handleColorChange(key, v); }} compact />;
|
|
302
|
-
})}
|
|
303
|
-
</div>
|
|
304
|
-
</div>
|
|
305
|
-
</div>
|
|
306
|
-
)}
|
|
307
|
-
|
|
308
|
-
{!showAdvanced && (
|
|
309
|
-
<p className="text-xs text-base-content/30">Colors were auto-derived from your core palette. Click above to fine-tune individual colors.</p>
|
|
310
|
-
)}
|
|
311
|
-
</div>
|
|
312
|
-
<div className="w-[320px] shrink-0">
|
|
313
|
-
<ThemePreview colors={colors} variant={variant} />
|
|
314
|
-
<div className="mt-3">
|
|
315
|
-
<ThemeSwatches colors={colors} />
|
|
316
|
-
</div>
|
|
317
|
-
</div>
|
|
318
|
-
</div>
|
|
319
|
-
)}
|
|
320
|
-
|
|
321
|
-
{step === 4 && (
|
|
322
|
-
<div className="space-y-4">
|
|
323
|
-
<ThemePreview colors={colors} variant={variant} />
|
|
324
|
-
<div className="flex gap-4">
|
|
325
|
-
<div className="flex-1">
|
|
326
|
-
<label className="text-xs font-medium text-base-content/50 uppercase tracking-wider mb-1 block">Name</label>
|
|
327
|
-
<input type="text" value={name} onChange={function (e) { setName(e.target.value); }} className="input input-bordered input-sm w-full" />
|
|
328
|
-
</div>
|
|
329
|
-
<div className="flex-1">
|
|
330
|
-
<label className="text-xs font-medium text-base-content/50 uppercase tracking-wider mb-1 block">Author</label>
|
|
331
|
-
<input type="text" value={author} onChange={function (e) { setAuthor(e.target.value); }} placeholder="Your name" className="input input-bordered input-sm w-full" />
|
|
332
|
-
</div>
|
|
333
|
-
</div>
|
|
334
|
-
<ThemeSwatches colors={colors} />
|
|
335
|
-
</div>
|
|
336
|
-
)}
|
|
337
|
-
</div>
|
|
338
|
-
|
|
339
|
-
<div className="flex items-center justify-between px-5 py-3 border-t border-base-content/10">
|
|
340
|
-
<div>
|
|
341
|
-
{step > 1 && (
|
|
342
|
-
<button onClick={function () { setStep(step - 1); }} className="btn btn-ghost btn-sm gap-1">
|
|
343
|
-
<ChevronLeft size={14} /> Back
|
|
344
|
-
</button>
|
|
345
|
-
)}
|
|
346
|
-
</div>
|
|
347
|
-
<div className="flex items-center gap-2">
|
|
348
|
-
{step === 4 && (
|
|
349
|
-
<button onClick={handleExport} className="btn btn-ghost btn-sm gap-1">
|
|
350
|
-
<Download size={14} /> Export JSON
|
|
351
|
-
</button>
|
|
352
|
-
)}
|
|
353
|
-
{step < 4 ? (
|
|
354
|
-
<button
|
|
355
|
-
onClick={function () { setStep(step + 1); }}
|
|
356
|
-
disabled={!canProceed}
|
|
357
|
-
className="btn btn-primary btn-sm gap-1"
|
|
358
|
-
>
|
|
359
|
-
Next <ChevronRight size={14} />
|
|
360
|
-
</button>
|
|
361
|
-
) : (
|
|
362
|
-
<button onClick={handleSave} className="btn btn-primary btn-sm gap-1">
|
|
363
|
-
<Save size={14} /> Save Theme
|
|
364
|
-
</button>
|
|
365
|
-
)}
|
|
366
|
-
</div>
|
|
367
|
-
</div>
|
|
368
|
-
</div>
|
|
369
|
-
</div>,
|
|
370
|
-
document.body,
|
|
371
|
-
);
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
function ColorPicker(props: { label: string; sublabel?: string; value: string; onChange: (hex: string) => void; compact?: boolean }) {
|
|
375
|
-
var hex = normalizeHex(props.value);
|
|
376
|
-
var displayHex = "#" + hex;
|
|
377
|
-
|
|
378
|
-
return (
|
|
379
|
-
<div className={"flex items-center gap-2 " + (props.compact ? "" : "py-1")}>
|
|
380
|
-
<label className="relative cursor-pointer group">
|
|
381
|
-
<div
|
|
382
|
-
className={"rounded-lg border-2 border-base-content/15 group-hover:border-base-content/30 transition-colors " + (props.compact ? "w-7 h-7" : "w-9 h-9")}
|
|
383
|
-
style={{ background: displayHex }}
|
|
384
|
-
/>
|
|
385
|
-
<input
|
|
386
|
-
type="color"
|
|
387
|
-
value={displayHex}
|
|
388
|
-
onChange={function (e) { props.onChange(e.target.value); }}
|
|
389
|
-
className="absolute inset-0 opacity-0 cursor-pointer w-full h-full"
|
|
390
|
-
/>
|
|
391
|
-
</label>
|
|
392
|
-
<div className="flex-1 min-w-0">
|
|
393
|
-
<div className={"font-medium text-base-content/70 " + (props.compact ? "text-[10px]" : "text-xs")}>{props.label}</div>
|
|
394
|
-
{props.sublabel && <div className="text-[9px] text-base-content/30">{props.sublabel}</div>}
|
|
395
|
-
</div>
|
|
396
|
-
<input
|
|
397
|
-
type="text"
|
|
398
|
-
value={hex}
|
|
399
|
-
onChange={function (e) { props.onChange(e.target.value); }}
|
|
400
|
-
className={"input input-bordered font-mono " + (props.compact ? "input-xs w-20 text-[10px]" : "input-sm w-24 text-xs")}
|
|
401
|
-
maxLength={7}
|
|
402
|
-
/>
|
|
403
|
-
</div>
|
|
404
|
-
);
|
|
405
|
-
}
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
import type { McpServerConfig } from "#shared";
|
|
2
|
-
|
|
3
|
-
export type ServerType = "stdio" | "http" | "sse";
|
|
4
|
-
|
|
5
|
-
export interface FormState {
|
|
6
|
-
name: string;
|
|
7
|
-
serverType: ServerType;
|
|
8
|
-
command: string;
|
|
9
|
-
args: string;
|
|
10
|
-
env: string;
|
|
11
|
-
url: string;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function emptyForm(): FormState {
|
|
15
|
-
return { name: "", serverType: "stdio", command: "", args: "", env: "", url: "" };
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function formFromConfig(name: string, config: McpServerConfig): FormState {
|
|
19
|
-
var serverType: ServerType = config.type === "http" ? "http" : config.type === "sse" ? "sse" : "stdio";
|
|
20
|
-
if (serverType === "stdio" && "command" in config) {
|
|
21
|
-
return {
|
|
22
|
-
name,
|
|
23
|
-
serverType,
|
|
24
|
-
command: config.command,
|
|
25
|
-
args: (config.args ?? []).join(", "),
|
|
26
|
-
env: Object.entries(config.env ?? {}).map(function ([k, v]) { return k + "=" + v; }).join("\n"),
|
|
27
|
-
url: "",
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
if ("url" in config) {
|
|
31
|
-
return { name, serverType, command: "", args: "", env: "", url: config.url };
|
|
32
|
-
}
|
|
33
|
-
return { ...emptyForm(), name, serverType };
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function formToConfig(form: FormState): McpServerConfig {
|
|
37
|
-
if (form.serverType === "stdio") {
|
|
38
|
-
var argsArr = form.args.trim()
|
|
39
|
-
? form.args.split(",").map(function (s) { return s.trim(); }).filter(Boolean)
|
|
40
|
-
: [];
|
|
41
|
-
var envObj: Record<string, string> = {};
|
|
42
|
-
form.env.split("\n").forEach(function (line) {
|
|
43
|
-
var idx = line.indexOf("=");
|
|
44
|
-
if (idx > 0) {
|
|
45
|
-
envObj[line.slice(0, idx).trim()] = line.slice(idx + 1).trim();
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
var result: McpServerConfig = { type: "stdio", command: form.command.trim(), args: argsArr };
|
|
49
|
-
if (Object.keys(envObj).length > 0) {
|
|
50
|
-
(result as { env?: Record<string, string> }).env = envObj;
|
|
51
|
-
}
|
|
52
|
-
return result;
|
|
53
|
-
}
|
|
54
|
-
return { type: form.serverType, url: form.url.trim() };
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export function typeBadge(config: McpServerConfig) {
|
|
58
|
-
var t = config.type === "http" ? "http" : config.type === "sse" ? "sse" : "stdio";
|
|
59
|
-
return (
|
|
60
|
-
<span className="px-1.5 py-0.5 rounded-lg text-[10px] uppercase tracking-wider font-mono bg-base-content/10 text-base-content/40 flex-shrink-0">
|
|
61
|
-
{t}
|
|
62
|
-
</span>
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export function configSummary(config: McpServerConfig) {
|
|
67
|
-
if (config.type === "http" || config.type === "sse") {
|
|
68
|
-
return <div className="font-mono text-[11px] text-base-content/40 truncate">{config.url}</div>;
|
|
69
|
-
}
|
|
70
|
-
var cmd = config.command + ((config.args?.length ?? 0) > 0 ? " " + config.args!.join(" ") : "");
|
|
71
|
-
return <div className="font-mono text-[11px] text-base-content/40 truncate">{cmd}</div>;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export function ServerForm({
|
|
75
|
-
form,
|
|
76
|
-
setForm,
|
|
77
|
-
onSave,
|
|
78
|
-
onCancel,
|
|
79
|
-
existingNames,
|
|
80
|
-
idPrefix,
|
|
81
|
-
}: {
|
|
82
|
-
form: FormState;
|
|
83
|
-
setForm: (f: FormState) => void;
|
|
84
|
-
onSave: () => void;
|
|
85
|
-
onCancel: () => void;
|
|
86
|
-
existingNames: Set<string>;
|
|
87
|
-
idPrefix: string;
|
|
88
|
-
}) {
|
|
89
|
-
var inputClass = "w-full h-9 sm:h-7 px-3 bg-base-300 border border-base-content/15 rounded-xl text-base-content font-mono text-[12px] focus:border-primary focus-visible:outline-none transition-colors duration-[120ms]";
|
|
90
|
-
var nameConflict = form.name.trim() !== "" && existingNames.has(form.name.trim());
|
|
91
|
-
var canSave = form.name.trim() !== "" && !nameConflict &&
|
|
92
|
-
(form.serverType === "stdio" ? form.command.trim() !== "" : form.url.trim() !== "");
|
|
93
|
-
|
|
94
|
-
return (
|
|
95
|
-
<div className="border border-base-content/15 rounded-xl bg-base-300/40 p-4 flex flex-col gap-3">
|
|
96
|
-
<div>
|
|
97
|
-
<label htmlFor={idPrefix + "-name"} className="block text-[11px] text-base-content/40 mb-1">Server Name</label>
|
|
98
|
-
<input
|
|
99
|
-
id={idPrefix + "-name"}
|
|
100
|
-
type="text"
|
|
101
|
-
value={form.name}
|
|
102
|
-
onChange={function (e) { setForm({ ...form, name: e.target.value }); }}
|
|
103
|
-
placeholder="my-server"
|
|
104
|
-
className={"w-full h-9 sm:h-7 px-3 bg-base-300 border rounded-xl text-base-content font-mono text-[12px] focus:border-primary focus-visible:outline-none transition-colors duration-[120ms] " + (nameConflict ? "border-warning" : "border-base-content/15")}
|
|
105
|
-
/>
|
|
106
|
-
{nameConflict && (
|
|
107
|
-
<div className="text-[10px] text-warning mt-0.5" role="alert">Name already in use</div>
|
|
108
|
-
)}
|
|
109
|
-
</div>
|
|
110
|
-
|
|
111
|
-
<fieldset>
|
|
112
|
-
<legend className="block text-[11px] text-base-content/40 mb-1.5">Type</legend>
|
|
113
|
-
<div className="flex gap-3">
|
|
114
|
-
{(["stdio", "http", "sse"] as ServerType[]).map(function (t) {
|
|
115
|
-
return (
|
|
116
|
-
<label key={t} className="flex items-center gap-1.5 cursor-pointer">
|
|
117
|
-
<input
|
|
118
|
-
type="radio"
|
|
119
|
-
name={idPrefix + "-type"}
|
|
120
|
-
value={t}
|
|
121
|
-
checked={form.serverType === t}
|
|
122
|
-
onChange={function () { setForm({ ...form, serverType: t }); }}
|
|
123
|
-
className="radio radio-xs radio-primary"
|
|
124
|
-
/>
|
|
125
|
-
<span className="text-[12px] font-mono text-base-content uppercase">{t}</span>
|
|
126
|
-
</label>
|
|
127
|
-
);
|
|
128
|
-
})}
|
|
129
|
-
</div>
|
|
130
|
-
</fieldset>
|
|
131
|
-
|
|
132
|
-
{form.serverType === "stdio" && (
|
|
133
|
-
<>
|
|
134
|
-
<div>
|
|
135
|
-
<label htmlFor={idPrefix + "-command"} className="block text-[11px] text-base-content/40 mb-1">Command</label>
|
|
136
|
-
<input
|
|
137
|
-
id={idPrefix + "-command"}
|
|
138
|
-
type="text"
|
|
139
|
-
value={form.command}
|
|
140
|
-
onChange={function (e) { setForm({ ...form, command: e.target.value }); }}
|
|
141
|
-
placeholder="npx"
|
|
142
|
-
className={inputClass}
|
|
143
|
-
/>
|
|
144
|
-
</div>
|
|
145
|
-
<div>
|
|
146
|
-
<label htmlFor={idPrefix + "-args"} className="block text-[11px] text-base-content/40 mb-1">Args (comma-separated)</label>
|
|
147
|
-
<input
|
|
148
|
-
id={idPrefix + "-args"}
|
|
149
|
-
type="text"
|
|
150
|
-
value={form.args}
|
|
151
|
-
onChange={function (e) { setForm({ ...form, args: e.target.value }); }}
|
|
152
|
-
placeholder="-y, @modelcontextprotocol/server-filesystem"
|
|
153
|
-
className={inputClass}
|
|
154
|
-
/>
|
|
155
|
-
</div>
|
|
156
|
-
<div>
|
|
157
|
-
<label htmlFor={idPrefix + "-env"} className="block text-[11px] text-base-content/40 mb-1">Environment (KEY=value, one per line)</label>
|
|
158
|
-
<textarea
|
|
159
|
-
id={idPrefix + "-env"}
|
|
160
|
-
value={form.env}
|
|
161
|
-
onChange={function (e) { setForm({ ...form, env: e.target.value }); }}
|
|
162
|
-
placeholder={"API_KEY=abc123\nDEBUG=true"}
|
|
163
|
-
rows={3}
|
|
164
|
-
className="w-full px-3 py-2 bg-base-300 border border-base-content/15 rounded-xl text-base-content font-mono text-[12px] focus:border-primary focus-visible:outline-none transition-colors duration-[120ms] resize-y"
|
|
165
|
-
/>
|
|
166
|
-
</div>
|
|
167
|
-
</>
|
|
168
|
-
)}
|
|
169
|
-
|
|
170
|
-
{(form.serverType === "http" || form.serverType === "sse") && (
|
|
171
|
-
<div>
|
|
172
|
-
<label htmlFor={idPrefix + "-url"} className="block text-[11px] text-base-content/40 mb-1">URL</label>
|
|
173
|
-
<input
|
|
174
|
-
id={idPrefix + "-url"}
|
|
175
|
-
type="text"
|
|
176
|
-
value={form.url}
|
|
177
|
-
onChange={function (e) { setForm({ ...form, url: e.target.value }); }}
|
|
178
|
-
placeholder="http://localhost:3000/mcp"
|
|
179
|
-
className={inputClass}
|
|
180
|
-
/>
|
|
181
|
-
</div>
|
|
182
|
-
)}
|
|
183
|
-
|
|
184
|
-
<div className="flex items-center gap-2 justify-end pt-1">
|
|
185
|
-
<button onClick={onCancel} className="btn btn-ghost btn-sm text-[12px]">
|
|
186
|
-
Cancel
|
|
187
|
-
</button>
|
|
188
|
-
<button onClick={onSave} disabled={!canSave} className={"btn btn-primary btn-sm text-[12px]" + (!canSave ? " opacity-50 cursor-not-allowed" : "")}>
|
|
189
|
-
Save
|
|
190
|
-
</button>
|
|
191
|
-
</div>
|
|
192
|
-
</div>
|
|
193
|
-
);
|
|
194
|
-
}
|