moi-computer 0.11.0 → 0.11.1-dev.1c52199
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/README.md +2 -2
- package/client/AGENTS.md +2 -2
- package/client/api/app-config.ts +2 -1
- package/client/app/AppRouter.tsx +2 -2
- package/client/app/routes/WorkspaceRoute.tsx +33 -27
- package/client/app/shell/SidebarLayout.tsx +18 -15
- package/client/components/shared/BottomPanel.tsx +26 -14
- package/client/components/shared/PanelHeader.tsx +1 -1
- package/client/components/shared/ReorderableList.tsx +7 -2
- package/client/components/shared/WorkspaceIcon.tsx +92 -0
- package/client/components/ui/alert-dialog.tsx +1 -0
- package/client/components/ui/button.tsx +1 -53
- package/client/components/ui/checkbox.tsx +1 -0
- package/client/components/ui/collapsible.tsx +1 -15
- package/client/components/ui/dialog.tsx +1 -58
- package/client/components/ui/dropdown-menu.tsx +1 -254
- package/client/components/ui/hover-card.tsx +1 -44
- package/client/components/ui/inline-input.tsx +84 -0
- package/client/components/ui/input.tsx +1 -21
- package/client/components/ui/popover.tsx +1 -88
- package/client/components/ui/resizable.tsx +1 -40
- package/client/components/ui/skeleton.tsx +1 -13
- package/client/components/ui/slider.tsx +1 -70
- package/client/components/ui/spinner.tsx +1 -18
- package/client/components/ui/switch.tsx +1 -23
- package/client/components/ui/tabs.tsx +1 -0
- package/client/components/ui/textarea.tsx +1 -18
- package/client/components/ui/toast.tsx +2 -2
- package/client/components/ui/tooltip.tsx +1 -51
- package/client/features/applets/AppletMount.tsx +5 -2
- package/client/features/applets/applet-cache.ts +3 -3
- package/client/features/applets/applet-runtime.ts +158 -108
- package/client/features/applets/applet-styles.ts +2 -2
- package/client/features/applets/applet-thumbnail.ts +6 -8
- package/client/features/applets/useApplet.ts +10 -9
- package/client/features/chat/ChatPanel.tsx +24 -15
- package/client/features/chat/ChatPopup.tsx +9 -5
- package/client/features/chat/applet-chat-intents.ts +179 -0
- package/client/features/chat/chat-send.ts +116 -64
- package/client/features/chat/chat-store.ts +51 -62
- package/client/features/chat/composer/ChatComposer.tsx +43 -128
- package/client/features/chat/composer/ModelPicker.tsx +47 -60
- package/client/features/chat/composer/attachments/AttachmentChip.tsx +99 -0
- package/client/features/chat/composer/attachments/DrawingAttachmentChip.tsx +37 -0
- package/client/features/chat/composer/attachments/FileAttachmentChip.tsx +22 -0
- package/client/features/chat/composer/attachments/TextAttachmentChip.tsx +11 -0
- package/client/features/chat/composer/attachments/draft-attachments.ts +168 -0
- package/client/features/chat/composer/attachments/types.ts +25 -0
- package/client/features/chat/composer/attachments/uploads.ts +26 -0
- package/client/features/chat/composer/banners/ErrorBanner.tsx +20 -12
- package/client/features/chat/composer/model-order.ts +15 -0
- package/client/features/chat/composer/useWorkspaceComposerState.tsx +15 -7
- package/client/features/chat/{chat-connection.ts → connection/chat-connection.ts} +1 -1
- package/client/features/chat/{chat-frames.ts → connection/chat-frames.ts} +10 -8
- package/client/features/chat/{ChatEmptyState.tsx → messages/ChatEmptyState.tsx} +16 -11
- package/client/features/chat/{MarkdownContent.tsx → messages/MarkdownContent.tsx} +16 -1
- package/client/features/chat/{TurnView.tsx → messages/TurnView.tsx} +27 -19
- package/client/features/chat/{group-turns.ts → messages/group-turns.ts} +12 -0
- package/client/features/chat/{interleave-notices.ts → messages/interleave-notices.ts} +7 -11
- package/client/features/chat/{tool-group → messages/tool-group}/SubagentCard.tsx +1 -1
- package/client/features/chat/{tool-group → messages/tool-group}/TimelineRow.tsx +2 -2
- package/client/features/chat/{tool-group → messages/tool-group}/ToolCallGroup.tsx +2 -5
- package/client/features/chat/{tool-group → messages/tool-group}/format/codex.ts +4 -1
- package/client/features/chat/{ChatSelector.tsx → sessions/ChatSelector.tsx} +3 -3
- package/client/features/chat/{api.ts → sessions/api.ts} +5 -14
- package/client/features/chat/sessions/session-view.ts +53 -0
- package/client/features/chat/{useSelectedSession.ts → sessions/useSelectedSession.ts} +64 -20
- package/client/features/chat/useChat.ts +46 -24
- package/client/features/collab/DevCollabIdentity.tsx +170 -0
- package/client/features/collab/DevCollabKit.tsx +501 -0
- package/client/features/collab/DevCollabPage.tsx +25 -0
- package/client/features/collab/WorkspaceCollabControls.tsx +313 -0
- package/client/features/collab/client.ts +146 -0
- package/client/features/collab/components.tsx +307 -0
- package/client/features/collab/dev-persona.ts +66 -0
- package/client/features/collab/engine.ts +96 -0
- package/client/features/collab/entry.tsx +35 -0
- package/client/features/collab/facehash-avatar.ts +132 -0
- package/client/features/collab/fake-engine.ts +130 -0
- package/client/features/collab/hooks.tsx +253 -0
- package/client/features/collab/identity.ts +305 -0
- package/client/features/collab/index.ts +45 -0
- package/client/features/collab/people.ts +102 -0
- package/client/features/collab/personal-state.ts +61 -0
- package/client/features/collab/presence-publisher.ts +29 -0
- package/client/features/collab/presence-target.ts +10 -0
- package/client/features/collab/primitives.tsx +398 -0
- package/client/features/collab/proxy-identity.ts +24 -0
- package/client/features/collab/store.ts +156 -0
- package/client/features/dev/ChatStatesPage.tsx +8 -7
- package/client/features/dev/DevIndexPage.tsx +10 -0
- package/client/features/dev/DevRoutes.tsx +16 -1
- package/client/features/dev/HarnessDebugPage.tsx +11 -8
- package/client/features/dev/ToolCallsPage.tsx +1 -1
- package/client/features/dev/UiComponentPreviews.tsx +855 -0
- package/client/features/dev/UiComponentsPage.tsx +60 -0
- package/client/features/dev/chat-states-fixtures.ts +13 -2
- package/client/features/drawings/useChatAnnotation.ts +17 -17
- package/client/features/drawings/useDrawingLayer.ts +7 -9
- package/client/features/drawings/useViewBuilderSketch.ts +18 -15
- package/client/features/home/HomePage.tsx +8 -7
- package/client/features/home/WorkspacePreview.tsx +2 -2
- package/client/features/home/workspace-presentation.tsx +1 -11
- package/client/features/home/workspace-setup/DemoDialog.tsx +3 -2
- package/client/features/home/workspace-setup/ImportWorkspaceDialog.tsx +5 -8
- package/client/features/home/workspace-setup/WorkspaceAgentStep.tsx +2 -4
- package/client/features/home/workspace-setup/WorkspaceDialogContent.tsx +7 -20
- package/client/features/overview/HiddenPanel.tsx +109 -0
- package/client/features/overview/Overview.tsx +302 -0
- package/client/features/overview/WidgetCanvas.tsx +164 -0
- package/client/features/{widgets → overview}/WidgetFrame.tsx +25 -17
- package/client/features/overview/WorkspaceName.tsx +60 -0
- package/client/features/overview/api.ts +30 -0
- package/client/features/overview/default/ViewsWidget.tsx +252 -0
- package/client/features/overview/default/registry.tsx +36 -0
- package/client/features/{widgets → overview}/grid.ts +36 -0
- package/client/features/overview/useGridReconcile.ts +94 -0
- package/client/features/scratchpad/Scratchpad.tsx +7 -8
- package/client/features/scratchpad/ScratchpadControls.tsx +0 -1
- package/client/features/scratchpad/useScratchpadSnapshot.tsx +23 -13
- package/client/features/settings/GeneralSettings.tsx +55 -58
- package/client/features/settings/SettingsLayout.tsx +2 -2
- package/client/features/settings/WorkspaceIconPicker.tsx +318 -0
- package/client/features/settings/WorkspaceSettingsDialog.tsx +65 -0
- package/client/features/settings/api.ts +48 -24
- package/client/features/views/ViewBuilder.tsx +5 -4
- package/client/features/views/ViewManager.tsx +28 -22
- package/client/features/views/api.ts +36 -2
- package/client/features/views/useViewBuilderActions.ts +11 -5
- package/client/features/views/useViewBuilderDrafts.ts +23 -21
- package/client/features/views/view-presentation.ts +13 -0
- package/client/features/workspace/{CustomizePanel.tsx → ThemePanel.tsx} +26 -31
- package/client/features/workspace/UnavailablePage.tsx +21 -0
- package/client/features/workspace/WorkspaceLayoutContext.tsx +22 -10
- package/client/features/workspace/WorkspaceScreen.tsx +228 -172
- package/client/features/workspace/WorkspaceSplitLayout.tsx +7 -2
- package/client/features/workspace/WorkspaceTabs.tsx +2 -0
- package/client/features/workspace/api.ts +5 -31
- package/client/features/workspace/layout-save.ts +13 -0
- package/client/features/workspace/moi-context.ts +15 -11
- package/client/features/workspace/tab-resolution.ts +10 -33
- package/client/features/workspace/useWorkspaceNavigation.ts +173 -101
- package/client/index.css +23 -30
- package/client/index.tsx +4 -3
- package/client/lib/app-icon-registry.ts +2 -0
- package/client/lib/use-latest-ref.ts +11 -0
- package/client/main.tsx +1 -1
- package/client/runtime/useWorkspaceEvents.ts +59 -14
- package/client/theme.css +5 -5
- package/dist/chunk-1ftessc8.js +2 -0
- package/dist/chunk-3802vh2p.js +2 -0
- package/dist/chunk-542a2m9m.js +1 -0
- package/dist/chunk-5745d83v.js +2 -0
- package/dist/chunk-5zxdsjym.js +1 -0
- package/dist/{chunk-tqd3pkg8.css → chunk-60q353jq.css} +1 -1
- package/dist/chunk-7r4z77ry.js +2 -0
- package/dist/chunk-9cm0wjah.js +79 -0
- package/dist/{chunk-11cab5dq.css → chunk-cq2r11fg.css} +1 -1
- package/dist/chunk-cvgdm1hq.js +2 -0
- package/dist/chunk-gptm4jpd.js +546 -0
- package/dist/chunk-nf2wkvf9.js +14 -0
- package/dist/chunk-wnmf38ta.js +5 -0
- package/dist/chunk-xaehhr1j.css +1 -0
- package/dist/chunk-xpt063fx.js +1 -0
- package/dist/index.html +1 -1
- package/lib/app-icons.ts +1 -0
- package/lib/applet-selector.ts +24 -0
- package/lib/chat-title.ts +6 -1
- package/lib/collab/colors.ts +24 -0
- package/lib/collab/protocol.ts +83 -0
- package/lib/collab/types.ts +63 -0
- package/lib/default-widgets.ts +32 -0
- package/lib/experimental.ts +14 -0
- package/lib/format.ts +67 -7
- package/lib/message-attachments.ts +40 -0
- package/lib/moi-attachments.ts +204 -0
- package/lib/moi-context.ts +27 -35
- package/lib/navigation.ts +84 -0
- package/lib/themes.ts +6 -6
- package/lib/types.ts +103 -40
- package/lib/workspace-icon.ts +20 -0
- package/lib/workspace-layout.ts +22 -2
- package/lib/workspace-tabs.ts +9 -33
- package/package.json +44 -32
- package/registry.json +656 -0
- package/server/AGENTS.md +2 -0
- package/server/agent.ts +1 -1
- package/server/api.ts +162 -68
- package/server/app-config.ts +127 -34
- package/server/applet-typecheck.ts +100 -0
- package/server/applets/applet-css.ts +55 -0
- package/server/{bundler → applets}/build-applet.ts +21 -240
- package/server/applets/build-worker.ts +178 -0
- package/server/applets/config.ts +226 -0
- package/server/applets/dependencies.ts +206 -0
- package/server/{applets.ts → applets/index.ts} +44 -189
- package/server/applets/runtime/base.ts +4 -0
- package/server/applets/runtime/moi.ts +42 -0
- package/server/applets/runtime/rpc.ts +17 -0
- package/server/applets/view-source.ts +67 -0
- package/server/attachment-message.ts +95 -0
- package/server/chat-selection.ts +23 -0
- package/server/cli-ui-components.ts +28 -33
- package/server/cli.ts +226 -120
- package/server/collab/applet-module.ts +50 -0
- package/server/collab/cloudflare-access.ts +77 -0
- package/server/collab/config.ts +18 -0
- package/server/collab/ipc.ts +10 -0
- package/server/collab/manager.ts +407 -0
- package/server/collab/service.ts +137 -0
- package/server/collab/skill/collab-env.d.ts +92 -0
- package/server/collab/skill/index.ts +59 -0
- package/server/collab/worker.ts +52 -0
- package/server/control.ts +63 -42
- package/server/data-dir.ts +1 -1
- package/server/harness/README.md +45 -50
- package/server/harness/acp/NOTES.md +426 -0
- package/server/harness/acp/adapter.ts +7 -21
- package/server/harness/acp/discovery.ts +27 -30
- package/server/harness/acp/model-state.ts +57 -0
- package/server/harness/acp/session.ts +49 -56
- package/server/harness/claude-code/NOTES.md +54 -13
- package/server/harness/claude-code/adapter.ts +8 -25
- package/server/harness/claude-code/cli.ts +40 -0
- package/server/harness/claude-code/index.ts +13 -5
- package/server/harness/claude-code/models.ts +72 -19
- package/server/harness/claude-code/session.ts +447 -343
- package/server/harness/claude-code/sessions.ts +9 -4
- package/server/harness/codex/NOTES.md +222 -350
- package/server/harness/codex/adapter.ts +102 -52
- package/server/harness/codex/auth.ts +1 -3
- package/server/harness/codex/client.ts +169 -249
- package/server/harness/codex/discovery.ts +9 -17
- package/server/harness/codex/index.ts +3 -1
- package/server/harness/codex/pagination.ts +24 -0
- package/server/harness/codex/permissions.ts +32 -8
- package/server/harness/codex/probe.ts +10 -13
- package/server/harness/codex/session.ts +567 -181
- package/server/harness/codex/transport.ts +184 -0
- package/server/harness/debug.ts +1 -1
- package/server/harness/hermes/NOTES.md +19 -1
- package/server/harness/hermes/discovery.ts +20 -0
- package/server/harness/hermes/index.ts +13 -0
- package/server/harness/hermes/models.ts +28 -8
- package/server/harness/openclaw/NOTES.md +1 -1
- package/server/harness/openclaw/adapter.ts +22 -4
- package/server/harness/openclaw/gateway.ts +5 -3
- package/server/harness/openclaw/session.ts +27 -27
- package/server/harness/types.ts +9 -5
- package/server/layout.ts +24 -16
- package/server/moi-scaffold.ts +22 -14
- package/server/navigation-relay.ts +110 -0
- package/server/preview.ts +3 -1
- package/server/registry.ts +71 -41
- package/server/scratchpad-executor.ts +79 -56
- package/server/scratchpad-shape-defaults.ts +82 -0
- package/server/selected-session.ts +24 -4
- package/server/skill-update.ts +5 -3
- package/server/skill-version.ts +4 -7
- package/server/skills-template.ts +60 -9
- package/server/tabs.ts +19 -33
- package/server/tldraw-package.d.ts +4 -0
- package/server/ui-components.ts +101 -434
- package/server/uploads.ts +0 -0
- package/server/view-builders.ts +20 -2
- package/server/views.ts +126 -6
- package/server/web.ts +108 -30
- package/server/widgets.ts +12 -5
- package/server/workspace-config.ts +13 -9
- package/server/workspace-env.ts +3 -2
- package/tsconfig.json +0 -1
- package/ui-components/accordion.tsx +71 -0
- package/ui-components/alert-dialog.tsx +165 -0
- package/ui-components/alert.tsx +68 -0
- package/ui-components/attachment.tsx +195 -0
- package/ui-components/avatar.tsx +91 -0
- package/ui-components/badge.tsx +49 -0
- package/ui-components/button-group.tsx +78 -0
- package/ui-components/button.tsx +55 -0
- package/ui-components/calendar.tsx +180 -0
- package/ui-components/card.tsx +84 -0
- package/ui-components/carousel.tsx +235 -0
- package/ui-components/chart.tsx +338 -0
- package/ui-components/checkbox.tsx +28 -0
- package/ui-components/collapsible.tsx +15 -0
- package/ui-components/combobox.tsx +267 -0
- package/ui-components/context-menu.tsx +244 -0
- package/ui-components/dialog.tsx +138 -0
- package/ui-components/docs/accordion.md +463 -0
- package/ui-components/docs/alert-dialog.md +481 -0
- package/ui-components/docs/alert.md +301 -0
- package/ui-components/docs/attachment.md +689 -0
- package/ui-components/docs/avatar.md +495 -0
- package/ui-components/docs/badge.md +258 -0
- package/ui-components/docs/button-group.md +879 -0
- package/ui-components/docs/button.md +26 -0
- package/ui-components/docs/calendar.md +862 -0
- package/ui-components/docs/card.md +265 -0
- package/ui-components/docs/carousel.md +627 -0
- package/ui-components/docs/chart.md +1256 -0
- package/ui-components/docs/checkbox.md +477 -0
- package/ui-components/docs/collapsible.md +446 -0
- package/ui-components/docs/combobox.md +1003 -0
- package/ui-components/docs/context-menu.md +860 -0
- package/ui-components/docs/data-table.md +1580 -0
- package/ui-components/docs/date-picker.md +614 -0
- package/ui-components/docs/dialog.md +414 -0
- package/ui-components/docs/drawer.md +51 -0
- package/ui-components/docs/dropdown-menu.md +1000 -0
- package/ui-components/docs/field.md +1192 -0
- package/ui-components/docs/hover-card.md +275 -0
- package/ui-components/docs/input-group.md +866 -0
- package/ui-components/docs/input.md +456 -0
- package/ui-components/docs/kbd.md +191 -0
- package/ui-components/docs/label.md +295 -0
- package/ui-components/docs/pagination.md +416 -0
- package/ui-components/docs/popover.md +348 -0
- package/ui-components/docs/progress.md +214 -0
- package/ui-components/docs/radio-group.md +389 -0
- package/ui-components/docs/resizable.md +265 -0
- package/ui-components/docs/select.md +616 -0
- package/ui-components/docs/separator.md +216 -0
- package/ui-components/docs/skeleton.md +205 -0
- package/ui-components/docs/slider.md +226 -0
- package/ui-components/docs/spinner.md +332 -0
- package/ui-components/docs/switch.md +236 -0
- package/ui-components/docs/table.md +551 -0
- package/ui-components/docs/tabs.md +379 -0
- package/ui-components/docs/textarea.md +187 -0
- package/ui-components/docs/toggle-group.md +370 -0
- package/ui-components/docs/toggle.md +91 -0
- package/ui-components/docs/tooltip.md +290 -0
- package/ui-components/drawer.tsx +213 -0
- package/ui-components/dropdown-menu.tsx +263 -0
- package/ui-components/field.tsx +224 -0
- package/ui-components/hover-card.tsx +46 -0
- package/ui-components/input-group.tsx +146 -0
- package/ui-components/input.tsx +20 -0
- package/ui-components/kbd.tsx +32 -0
- package/ui-components/label.tsx +17 -0
- package/ui-components/pagination.tsx +124 -0
- package/ui-components/popover.tsx +81 -0
- package/ui-components/progress.tsx +63 -0
- package/ui-components/radio-group.tsx +38 -0
- package/ui-components/resizable.tsx +40 -0
- package/ui-components/scoped-portal.tsx +31 -0
- package/ui-components/select.tsx +195 -0
- package/ui-components/separator.tsx +18 -0
- package/ui-components/skeleton.tsx +15 -0
- package/ui-components/slider.tsx +75 -0
- package/ui-components/spinner.tsx +20 -0
- package/ui-components/switch.tsx +27 -0
- package/ui-components/table.tsx +86 -0
- package/ui-components/tabs.tsx +75 -0
- package/ui-components/textarea.tsx +17 -0
- package/ui-components/toggle-group.tsx +85 -0
- package/ui-components/toggle.tsx +42 -0
- package/ui-components/tooltip.tsx +61 -0
- package/ui-components/utils.ts +8 -0
- package/workspace/.claude/skills/moi-workspace/SKILL.md +295 -248
- package/workspace/.claude/skills/moi-workspace/references/COLLABORATIVE.md +151 -0
- package/workspace/.claude/skills/moi-workspace/references/DESIGN.md +100 -152
- package/workspace/.claude/skills/moi-workspace/references/INTENTS.md +156 -0
- package/workspace/.claude/skills/moi-workspace/references/UI-COMPONENTS.md +67 -203
- package/client/features/chat/attachment-staging.ts +0 -153
- package/client/features/chat/uploads.ts +0 -18
- package/client/features/chat/useAppletChatMessage.ts +0 -68
- package/client/features/settings/IconPicker.tsx +0 -442
- package/client/features/settings/WorkspaceSettings.tsx +0 -92
- package/client/features/settings/render-icon.ts +0 -173
- package/client/features/widgets/HiddenPanel.tsx +0 -80
- package/client/features/widgets/WidgetGrid.tsx +0 -123
- package/client/features/widgets/Widgets.tsx +0 -264
- package/client/features/widgets/useGridReconcile.ts +0 -73
- package/dist/chunk-104m57qw.js +0 -2
- package/dist/chunk-59zf0m6n.js +0 -1
- package/dist/chunk-bj3akjs2.js +0 -1
- package/dist/chunk-c9pjqx9m.js +0 -14
- package/dist/chunk-j2w2vak4.js +0 -546
- package/dist/chunk-k2r9c95m.js +0 -10
- package/dist/chunk-kmbxhgwv.js +0 -1
- package/dist/chunk-p1yqa71k.js +0 -83
- package/dist/chunk-pcnahct1.js +0 -5
- package/dist/chunk-r5xrenjy.css +0 -1
- package/dist/chunk-tny85yt2.js +0 -2
- package/dist/chunk-v7wr1df4.js +0 -2
- package/server/bundler/applet-css.ts +0 -155
- /package/client/features/chat/{ChatPromptBubbles.tsx → messages/ChatPromptBubbles.tsx} +0 -0
- /package/client/features/chat/{ShimmerText.tsx → messages/ShimmerText.tsx} +0 -0
- /package/client/features/chat/{preview-turn.ts → messages/preview-turn.ts} +0 -0
- /package/client/features/chat/{tool-group → messages/tool-group}/CodeBlock.tsx +0 -0
- /package/client/features/chat/{tool-group → messages/tool-group}/Collapse.tsx +0 -0
- /package/client/features/chat/{tool-group → messages/tool-group}/ReadImagePreview.tsx +0 -0
- /package/client/features/chat/{tool-group → messages/tool-group}/ToolOutput.tsx +0 -0
- /package/client/features/chat/{tool-group → messages/tool-group}/detect.ts +0 -0
- /package/client/features/chat/{tool-group → messages/tool-group}/fixtures.ts +0 -0
- /package/client/features/chat/{tool-group → messages/tool-group}/format/claude.ts +0 -0
- /package/client/features/chat/{tool-group → messages/tool-group}/format/hermes.ts +0 -0
- /package/client/features/chat/{tool-group → messages/tool-group}/format/index.ts +0 -0
- /package/client/features/chat/{tool-group → messages/tool-group}/format/mcp.ts +0 -0
- /package/client/features/chat/{tool-group → messages/tool-group}/format/openclaw.ts +0 -0
- /package/client/features/chat/{tool-group → messages/tool-group}/format/shared.ts +0 -0
- /package/client/features/chat/{tool-group → messages/tool-group}/format/shell.ts +0 -0
- /package/client/features/chat/{tool-group → messages/tool-group}/index.ts +0 -0
- /package/client/features/chat/{useStickToBottom.ts → messages/useStickToBottom.ts} +0 -0
package/README.md
CHANGED
|
@@ -33,7 +33,7 @@ Works with the harness you already use:
|
|
|
33
33
|
fonts, color scheme and more.
|
|
34
34
|
- **Scratchpad**. A shared canvas where you ideate together with the agent: ask
|
|
35
35
|
it to draw diagrams, add feedback or comments, visualize knowledge and plans.
|
|
36
|
-
- **
|
|
36
|
+
- **Overview**. A dynamic home made of small widgets wired to the data from
|
|
37
37
|
your workspace. They can be rearranged, modified, and completely customized.
|
|
38
38
|
- **Views**. An app embedded in the workspace that lives in its own tab. Build
|
|
39
39
|
complex interfaces: CRMs, task trackers, second brain storage, customer
|
|
@@ -41,7 +41,7 @@ Works with the harness you already use:
|
|
|
41
41
|
|
|
42
42
|
<table>
|
|
43
43
|
<tr>
|
|
44
|
-
<td align="center"><img src="assets/screenshots/moi-moi-dash-2.webp" alt="
|
|
44
|
+
<td align="center"><img src="assets/screenshots/moi-moi-dash-2.webp" alt="Overview" /><br /><sub>Widgets wired to live project stats</sub></td>
|
|
45
45
|
<td align="center"><img src="assets/screenshots/moi-magazin-scratch-2.webp" alt="Scratchpad" /><br /><sub>Order funnel on the scratchpad, live from Postgres</sub></td>
|
|
46
46
|
<td align="center"><img src="assets/screenshots/moi-magazin-products-2.webp" alt="Products view" /><br /><sub>Use the agent as a copilot when working with products</sub></td>
|
|
47
47
|
</tr>
|
package/client/AGENTS.md
CHANGED
|
@@ -12,7 +12,7 @@ Before editing host-app UI, read `../DESIGN.md` and the relevant rules in `../.a
|
|
|
12
12
|
|
|
13
13
|
## Conventions
|
|
14
14
|
|
|
15
|
-
- UI components in `components/ui/` are
|
|
15
|
+
- UI components in `components/ui/` are host facades over the shared moi registry components built on Base UI React. Local compatibility copies explain why they cannot re-export yet.
|
|
16
16
|
- `lib/cn.ts` is `clsx` + `tailwind-merge`.
|
|
17
17
|
|
|
18
18
|
## Vendored React
|
|
@@ -28,7 +28,7 @@ React is not bundled into the app. It ships as locally-vendored ESM in `vendor/r
|
|
|
28
28
|
|
|
29
29
|
- `app/` owns routes and the app shell. Route files load data and compose features; keep feature UI out of them.
|
|
30
30
|
- `features/<name>/` owns that feature's components, hooks, state, API hooks, and nearby tests.
|
|
31
|
-
- `components/ui/` contains
|
|
31
|
+
- `components/ui/` contains host facades for shared UI primitives. `components/shared/` contains reusable app components with no feature knowledge.
|
|
32
32
|
- `api/` contains shared request helpers, query keys, and query policies. Feature endpoints stay in the feature's `api.ts`.
|
|
33
33
|
- `runtime/` contains browser-wide lifecycle code such as HMR and shared workspace events.
|
|
34
34
|
- `lib/` contains small feature-neutral utilities. Do not use it as a catch-all for components or feature state.
|
package/client/api/app-config.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useSyncExternalStore } from 'react'
|
|
2
2
|
|
|
3
3
|
import type { ClientAppConfig } from '@/lib/types'
|
|
4
|
+
import { EXPERIMENTAL_DEFAULTS } from '@/lib/experimental'
|
|
4
5
|
|
|
5
6
|
import { onWorkspaceEventsReconnect } from '@/client/runtime/useWorkspaceEvents'
|
|
6
7
|
|
|
@@ -14,7 +15,7 @@ import { requestJson } from './http'
|
|
|
14
15
|
|
|
15
16
|
const DEFAULTS: ClientAppConfig = {
|
|
16
17
|
cloudDemo: false,
|
|
17
|
-
|
|
18
|
+
experimental: { ...EXPERIMENTAL_DEFAULTS },
|
|
18
19
|
demoInstallUrl: 'https://moi.computer'
|
|
19
20
|
}
|
|
20
21
|
|
package/client/app/AppRouter.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import { Suspense, lazy, useEffect } from 'react'
|
|
|
2
2
|
|
|
3
3
|
import { Redirect, Route, Switch, useLocation } from 'wouter'
|
|
4
4
|
|
|
5
|
-
import { setWorkspaceSwitchHandler } from '@/client/features/chat/chat-connection'
|
|
5
|
+
import { setWorkspaceSwitchHandler } from '@/client/features/chat/connection/chat-connection'
|
|
6
6
|
|
|
7
7
|
import { HomeRoute } from './routes/HomeRoute'
|
|
8
8
|
import { WorkspaceRoute } from './routes/WorkspaceRoute'
|
|
@@ -41,7 +41,7 @@ export function AppRouter() {
|
|
|
41
41
|
<Switch>
|
|
42
42
|
<Route path="/" component={HomeRoute} />
|
|
43
43
|
<Route path="/dev/*?" component={DevLazy} />
|
|
44
|
-
{/* The wildcard is the
|
|
44
|
+
{/* The wildcard is the destination path (`views/orders`, `overview`, …) —
|
|
45
45
|
the URL is the tab address, read downstream with `useParams`. This
|
|
46
46
|
pattern is its only definition. Keyed by workspace id only, so tab
|
|
47
47
|
switches never remount the workspace tree. */}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { CollabProvider, useCollabIdentityEnabled } from '@/client/features/collab/entry'
|
|
1
2
|
import { useQueryClient } from '@tanstack/react-query'
|
|
2
3
|
|
|
3
4
|
import { workspaceKeys } from '@/client/api/workspace-keys'
|
|
5
|
+
import { useAppConfig } from '@/client/api/app-config'
|
|
4
6
|
import { LedLogo } from '@/client/components/shared/LedLogo'
|
|
5
7
|
import { SidebarLayout } from '@/client/app/shell/SidebarLayout'
|
|
6
|
-
import { useSelectedSession } from '@/client/features/chat/useSelectedSession'
|
|
8
|
+
import { useSelectedSession } from '@/client/features/chat/sessions/useSelectedSession'
|
|
7
9
|
import { useAppletCacheInvalidation } from '@/client/features/applets/useApplet'
|
|
8
10
|
import { Workspace } from '@/client/features/workspace/WorkspaceContext'
|
|
9
11
|
import {
|
|
@@ -11,35 +13,38 @@ import {
|
|
|
11
13
|
useWorkspaceLayoutCtx
|
|
12
14
|
} from '@/client/features/workspace/WorkspaceLayoutContext'
|
|
13
15
|
import { WorkspaceScreen } from '@/client/features/workspace/WorkspaceScreen'
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { useGridReconcile } from '@/client/features/widgets/useGridReconcile'
|
|
16
|
+
import { useViewBuilders, useViews } from '@/client/features/views/api'
|
|
17
|
+
import { useWidgets } from '@/client/features/overview/api'
|
|
17
18
|
import { useWorkspaceEvent } from '@/client/runtime/useWorkspaceEvents'
|
|
18
19
|
|
|
19
20
|
type WorkspaceRouteProps = {
|
|
20
21
|
id: string
|
|
21
22
|
}
|
|
22
23
|
|
|
23
|
-
//
|
|
24
|
-
//
|
|
24
|
+
// Navigation reads the raw browser address so encoded paths and query params
|
|
25
|
+
// are decoded exactly once; the route only owns the workspace ID.
|
|
25
26
|
export function WorkspaceRoute({ id }: WorkspaceRouteProps) {
|
|
27
|
+
const { experimental } = useAppConfig()
|
|
28
|
+
|
|
26
29
|
return (
|
|
27
30
|
<Workspace id={id}>
|
|
28
31
|
<WorkspaceLayoutProvider id={id}>
|
|
29
|
-
<
|
|
32
|
+
<CollabProvider workspaceId={id} enabled={experimental.collab}>
|
|
33
|
+
<WorkspaceContent id={id} />
|
|
34
|
+
</CollabProvider>
|
|
30
35
|
</WorkspaceLayoutProvider>
|
|
31
36
|
</Workspace>
|
|
32
37
|
)
|
|
33
38
|
}
|
|
34
39
|
|
|
35
|
-
function
|
|
40
|
+
function WorkspaceContent({ id }: WorkspaceRouteProps) {
|
|
41
|
+
const personal = useCollabIdentityEnabled()
|
|
36
42
|
const queryClient = useQueryClient()
|
|
37
43
|
const [selectedSessionId] = useSelectedSession()
|
|
38
|
-
const {
|
|
39
|
-
const widgets =
|
|
40
|
-
const views =
|
|
44
|
+
const { isLoading: layoutLoading } = useWorkspaceLayoutCtx()
|
|
45
|
+
const widgets = useWidgets(id)
|
|
46
|
+
const views = useViews(id)
|
|
41
47
|
const builders = useViewBuilders(id)
|
|
42
|
-
useGridReconcile(id, widgets.data, layout, setLayout)
|
|
43
48
|
useAppletCacheInvalidation()
|
|
44
49
|
|
|
45
50
|
useWorkspaceEvent(event => {
|
|
@@ -64,20 +69,21 @@ function WorkspaceLoader({ id }: WorkspaceRouteProps) {
|
|
|
64
69
|
builders.isLoading
|
|
65
70
|
|
|
66
71
|
return (
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
72
|
+
<SidebarLayout>
|
|
73
|
+
{fresh ? (
|
|
74
|
+
<div className="flex h-full items-center justify-center">
|
|
75
|
+
<LedLogo sprite="moi" effect="chaos" />
|
|
76
|
+
</div>
|
|
77
|
+
) : (
|
|
78
|
+
// Personal tabs are read when the screen mounts; reset that state when
|
|
79
|
+
// navigation switches between the shared layout and this browser tab.
|
|
80
|
+
<WorkspaceScreen
|
|
81
|
+
key={personal ? 'personal' : 'shared'}
|
|
82
|
+
widgets={widgets.data}
|
|
83
|
+
views={views.data ?? []}
|
|
84
|
+
builders={builders.data ?? []}
|
|
85
|
+
/>
|
|
86
|
+
)}
|
|
87
|
+
</SidebarLayout>
|
|
82
88
|
)
|
|
83
89
|
}
|
|
@@ -18,6 +18,7 @@ import { CreateWorkspaceDialog } from '@/client/features/home/workspace-setup/Cr
|
|
|
18
18
|
import { DemoDialog } from '@/client/features/home/workspace-setup/DemoDialog'
|
|
19
19
|
import { ReorderableList } from '@/client/components/shared/ReorderableList'
|
|
20
20
|
import type { ReorderableRenderState } from '@/client/components/shared/ReorderableList'
|
|
21
|
+
import { WorkspaceIcon } from '@/client/components/shared/WorkspaceIcon'
|
|
21
22
|
import { Button, buttonVariants } from '@/client/components/ui/button'
|
|
22
23
|
import {
|
|
23
24
|
Tooltip,
|
|
@@ -25,10 +26,7 @@ import {
|
|
|
25
26
|
TooltipProvider,
|
|
26
27
|
TooltipTrigger
|
|
27
28
|
} from '@/client/components/ui/tooltip'
|
|
28
|
-
import {
|
|
29
|
-
workspaceDisplayName,
|
|
30
|
-
workspaceProviderIcon
|
|
31
|
-
} from '@/client/features/home/workspace-presentation'
|
|
29
|
+
import { workspaceDisplayName } from '@/client/features/home/workspace-presentation'
|
|
32
30
|
import { cn } from '@/client/lib/cn'
|
|
33
31
|
import type { WorkspaceEntry } from '@/lib/types'
|
|
34
32
|
|
|
@@ -53,14 +51,18 @@ type SidebarLayoutProps = {
|
|
|
53
51
|
export function SidebarLayout({ children, showWorkspaces = true }: SidebarLayoutProps) {
|
|
54
52
|
const { data: workspaces } = useWorkspaces()
|
|
55
53
|
|
|
56
|
-
//
|
|
57
|
-
//
|
|
58
|
-
//
|
|
54
|
+
// Identity, theme, and registry changes can all alter a workspace's sidebar
|
|
55
|
+
// presentation. Refetch the list so the sidebar reflects them live. Exact:
|
|
56
|
+
// `workspaceKeys.all` is the
|
|
59
57
|
// prefix of every workspace query — a prefix invalidation would refetch
|
|
60
58
|
// transcripts, widgets, and MCP probes in every connected client.
|
|
61
59
|
const qc = useQueryClient()
|
|
62
60
|
useWorkspaceEvent(e => {
|
|
63
|
-
if (
|
|
61
|
+
if (
|
|
62
|
+
e.type === 'workspace:updated' ||
|
|
63
|
+
e.type === 'theme:updated' ||
|
|
64
|
+
e.type === 'workspaces-list:updated'
|
|
65
|
+
) {
|
|
64
66
|
qc.invalidateQueries({ queryKey: workspaceKeys.all, exact: true })
|
|
65
67
|
}
|
|
66
68
|
})
|
|
@@ -104,7 +106,7 @@ function Sidebar({ workspaces }: SidebarProps) {
|
|
|
104
106
|
className="flex flex-col gap-4"
|
|
105
107
|
onReorder={ids => reorder.mutate(ids)}
|
|
106
108
|
renderPlaceholder={() => (
|
|
107
|
-
<div className="pointer-events-none absolute top-0 left-1 size-
|
|
109
|
+
<div className="pointer-events-none absolute top-0 left-1 size-12 rounded-xl bg-accent" />
|
|
108
110
|
)}
|
|
109
111
|
renderOverlay={ws => <WorkspaceButton workspace={ws} dragOverlay />}
|
|
110
112
|
renderItem={(ws, state) => <WorkspaceButton workspace={ws} dragState={state} />}
|
|
@@ -197,7 +199,7 @@ function WorkspaceButton({ workspace, dragOverlay = false, dragState }: Workspac
|
|
|
197
199
|
const [location] = useLocation()
|
|
198
200
|
const href = `/workspace/${workspace.id}`
|
|
199
201
|
const label = workspaceDisplayName(workspace)
|
|
200
|
-
// A workspace URL carries a
|
|
202
|
+
// A workspace URL carries a destination (`/workspace/:id/views/orders`), so the
|
|
201
203
|
// rail matches the workspace segment, not the whole path. The trailing slash
|
|
202
204
|
// keeps `/workspace/ws1` from lighting up a sibling `/workspace/ws1-other`.
|
|
203
205
|
const active = location === href || location.startsWith(`${href}/`)
|
|
@@ -212,10 +214,11 @@ function WorkspaceButton({ workspace, dragOverlay = false, dragState }: Workspac
|
|
|
212
214
|
active && !dragOverlay && 'bg-accent text-accent-foreground'
|
|
213
215
|
)}
|
|
214
216
|
>
|
|
215
|
-
<
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
217
|
+
<WorkspaceIcon
|
|
218
|
+
icon={workspace.icon}
|
|
219
|
+
workspaceType={workspace.type}
|
|
220
|
+
workspaceTheme={workspace.theme}
|
|
221
|
+
className="size-7 shrink-0 rounded-md transition-[border-radius] duration-100 ease-out motion-reduce:transition-none"
|
|
219
222
|
/>
|
|
220
223
|
</div>
|
|
221
224
|
)
|
|
@@ -242,7 +245,7 @@ function WorkspaceButton({ workspace, dragOverlay = false, dragState }: Workspac
|
|
|
242
245
|
if (dragState?.isDragging) event.preventDefault()
|
|
243
246
|
}}
|
|
244
247
|
className={cn(
|
|
245
|
-
'group flex w-14 flex-col items-center rounded-
|
|
248
|
+
'group flex w-14 flex-col items-center rounded-xl outline-none',
|
|
246
249
|
dragState?.isDragging && 'invisible'
|
|
247
250
|
)}
|
|
248
251
|
{...dragState?.dragHandleProps}
|
|
@@ -8,22 +8,31 @@ import { Button } from '@/client/components/ui/button'
|
|
|
8
8
|
import { cn } from '@/client/lib/cn'
|
|
9
9
|
|
|
10
10
|
type BottomPanelProps = {
|
|
11
|
+
actions?: ReactNode
|
|
11
12
|
className?: string
|
|
12
13
|
title: string
|
|
13
|
-
children
|
|
14
|
+
children?: ReactNode
|
|
14
15
|
onClose: () => void
|
|
15
16
|
// Forwarded to the panel element so the working area can measure its height
|
|
16
17
|
// and reserve matching space below the grid.
|
|
17
18
|
ref?: Ref<HTMLDivElement>
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
export function BottomPanel({
|
|
21
|
+
export function BottomPanel({
|
|
22
|
+
actions,
|
|
23
|
+
className,
|
|
24
|
+
title,
|
|
25
|
+
children,
|
|
26
|
+
onClose,
|
|
27
|
+
ref
|
|
28
|
+
}: BottomPanelProps) {
|
|
21
29
|
return (
|
|
22
30
|
<motion.div
|
|
23
31
|
ref={ref}
|
|
24
32
|
className={cn(
|
|
25
|
-
'absolute inset-x-4 bottom-4 no-scrollbar flex max-h-full flex-col gap-4 overflow-y-auto rounded-2xl bg-
|
|
26
|
-
'mx-auto max-w-[calc(var(--chat-max-container)+var(--page-pad)*2)] p-(--page-pad)
|
|
33
|
+
'absolute inset-x-4 bottom-4 no-scrollbar flex max-h-full flex-col gap-4 overflow-y-auto rounded-2xl bg-popover text-popover-foreground shadow-md',
|
|
34
|
+
'mx-auto max-w-[calc(var(--chat-max-container)+var(--page-pad)*2)] p-(--page-pad)',
|
|
35
|
+
children && 'pb-0',
|
|
27
36
|
className
|
|
28
37
|
)}
|
|
29
38
|
variants={{
|
|
@@ -37,17 +46,20 @@ export function BottomPanel({ className, title, children, onClose, ref }: Bottom
|
|
|
37
46
|
>
|
|
38
47
|
<div className="flex shrink-0 items-center justify-between gap-4">
|
|
39
48
|
<p className="text-sm font-medium">{title}</p>
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
<div className="flex items-center gap-2">
|
|
50
|
+
{actions}
|
|
51
|
+
<Button
|
|
52
|
+
type="button"
|
|
53
|
+
variant="ghost"
|
|
54
|
+
size="icon-sm"
|
|
55
|
+
onClick={onClose}
|
|
56
|
+
aria-label="Close panel"
|
|
57
|
+
>
|
|
58
|
+
<IconX stroke={1.75} />
|
|
59
|
+
</Button>
|
|
60
|
+
</div>
|
|
49
61
|
</div>
|
|
50
|
-
<div className="flex-1 pb-(--page-pad)">{children}</div>
|
|
62
|
+
{children && <div className="flex-1 pb-(--page-pad)">{children}</div>}
|
|
51
63
|
</motion.div>
|
|
52
64
|
)
|
|
53
65
|
}
|
|
@@ -5,7 +5,7 @@ export function PanelHeader({ children }: { children?: ReactNode }) {
|
|
|
5
5
|
return (
|
|
6
6
|
<header
|
|
7
7
|
className={cn(
|
|
8
|
-
'@container relative flex shrink-0 items-center gap-
|
|
8
|
+
'@container relative flex shrink-0 items-center gap-1 py-2 pr-3 pl-4',
|
|
9
9
|
// Header bottom border that overflows the tab content and contrasts with it
|
|
10
10
|
'after:absolute after:top-full after:left-0 after:h-px after:w-full after:bg-border'
|
|
11
11
|
)}
|
|
@@ -40,6 +40,7 @@ type ReorderableListProps<T> = {
|
|
|
40
40
|
className?: string
|
|
41
41
|
itemClassName?: (item: T, state: ReorderableRenderState) => string | undefined
|
|
42
42
|
dragDisabled?: boolean
|
|
43
|
+
isItemDragDisabled?: (item: T) => boolean
|
|
43
44
|
onReorder: (orderedIds: ReorderableId[]) => void
|
|
44
45
|
renderItem: (item: T, state: ReorderableRenderState) => ReactNode
|
|
45
46
|
renderPlaceholder?: (item: T) => ReactNode
|
|
@@ -63,6 +64,7 @@ export function ReorderableList<T>({
|
|
|
63
64
|
className,
|
|
64
65
|
itemClassName,
|
|
65
66
|
dragDisabled = false,
|
|
67
|
+
isItemDragDisabled,
|
|
66
68
|
onReorder,
|
|
67
69
|
renderItem,
|
|
68
70
|
renderPlaceholder,
|
|
@@ -83,7 +85,10 @@ export function ReorderableList<T>({
|
|
|
83
85
|
.map(id => itemById.get(id))
|
|
84
86
|
.filter((item): item is T => Boolean(item))
|
|
85
87
|
const draggingItem = draggingId ? itemById.get(draggingId) : undefined
|
|
86
|
-
const
|
|
88
|
+
const reorderableCount = isItemDragDisabled
|
|
89
|
+
? items.filter(item => !isItemDragDisabled(item)).length
|
|
90
|
+
: items.length
|
|
91
|
+
const disabled = dragDisabled || reorderableCount < 2
|
|
87
92
|
|
|
88
93
|
const handleDragOver = (event: DragOverEvent) => {
|
|
89
94
|
const activeId = String(event.active.id)
|
|
@@ -132,7 +137,7 @@ export function ReorderableList<T>({
|
|
|
132
137
|
key={getId(item)}
|
|
133
138
|
id={getId(item)}
|
|
134
139
|
item={item}
|
|
135
|
-
disabled={disabled}
|
|
140
|
+
disabled={disabled || isItemDragDisabled?.(item) === true}
|
|
136
141
|
itemClassName={itemClassName}
|
|
137
142
|
renderItem={renderItem}
|
|
138
143
|
renderPlaceholder={renderPlaceholder}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { createElement } from 'react'
|
|
2
|
+
|
|
3
|
+
import claudeIcon from '@/client/assets/claude.svg'
|
|
4
|
+
import hermesIcon from '@/client/assets/hermes.png'
|
|
5
|
+
import openaiIcon from '@/client/assets/openai.svg'
|
|
6
|
+
import openclawIcon from '@/client/assets/openclaw.svg'
|
|
7
|
+
import { resolveAppIcon } from '@/client/lib/app-icon-registry'
|
|
8
|
+
import { cn } from '@/client/lib/cn'
|
|
9
|
+
import { DEFAULT_PRIMARY_COLOR, deriveThemeColors, resolveThemeColorOverrides } from '@/lib/themes'
|
|
10
|
+
import type {
|
|
11
|
+
WorkspaceIcon as WorkspaceIconValue,
|
|
12
|
+
WorkspaceLayout,
|
|
13
|
+
WorkspaceType
|
|
14
|
+
} from '@/lib/types'
|
|
15
|
+
|
|
16
|
+
export const workspaceProviderIcon: Record<WorkspaceType, string> = {
|
|
17
|
+
'claude-code': claudeIcon,
|
|
18
|
+
openclaw: openclawIcon,
|
|
19
|
+
codex: openaiIcon,
|
|
20
|
+
hermes: hermesIcon
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
type WorkspaceIconProps = {
|
|
24
|
+
className?: string
|
|
25
|
+
icon?: WorkspaceIconValue
|
|
26
|
+
workspaceType?: WorkspaceType | null
|
|
27
|
+
workspaceTheme?: WorkspaceLayout['theme']
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function renderIconContent(
|
|
31
|
+
icon: WorkspaceIconValue | undefined,
|
|
32
|
+
themed: boolean,
|
|
33
|
+
providerIcon: string
|
|
34
|
+
) {
|
|
35
|
+
switch (icon?.type) {
|
|
36
|
+
case 'emoji':
|
|
37
|
+
return (
|
|
38
|
+
<span
|
|
39
|
+
aria-hidden="true"
|
|
40
|
+
className={cn(
|
|
41
|
+
'flex size-full translate-y-[2cqi] items-center justify-center font-[Apple_Color_Emoji,Segoe_UI_Emoji,Noto_Color_Emoji,sans-serif] leading-none',
|
|
42
|
+
themed ? 'text-[60cqi]' : 'text-[85cqi]'
|
|
43
|
+
)}
|
|
44
|
+
>
|
|
45
|
+
{icon.value}
|
|
46
|
+
</span>
|
|
47
|
+
)
|
|
48
|
+
case 'upload':
|
|
49
|
+
return <img src={icon.value} alt="" className="size-full" />
|
|
50
|
+
case 'glyph': {
|
|
51
|
+
const Glyph = resolveAppIcon(icon.value)
|
|
52
|
+
if (Glyph) {
|
|
53
|
+
return createElement(Glyph, {
|
|
54
|
+
'aria-hidden': true,
|
|
55
|
+
stroke: 1.75,
|
|
56
|
+
className: themed ? 'size-[70%]' : 'size-[95%] text-foreground'
|
|
57
|
+
})
|
|
58
|
+
}
|
|
59
|
+
// Fall through to the default provider icon.
|
|
60
|
+
}
|
|
61
|
+
default:
|
|
62
|
+
return <img src={providerIcon} alt="" className="size-[95%]" />
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function WorkspaceIcon({
|
|
67
|
+
className,
|
|
68
|
+
icon,
|
|
69
|
+
workspaceType,
|
|
70
|
+
workspaceTheme
|
|
71
|
+
}: WorkspaceIconProps) {
|
|
72
|
+
const themed = icon?.type !== 'upload' && icon?.background === 'theme'
|
|
73
|
+
const colors = themed
|
|
74
|
+
? (resolveThemeColorOverrides(workspaceTheme) ?? deriveThemeColors(DEFAULT_PRIMARY_COLOR))
|
|
75
|
+
: undefined
|
|
76
|
+
const providerIcon = workspaceProviderIcon[workspaceType ?? 'claude-code']
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<span
|
|
80
|
+
className={cn(
|
|
81
|
+
'@container inline-flex shrink-0 items-center justify-center overflow-hidden',
|
|
82
|
+
themed && 'shadow-[inset_0_0_1rem_rgba(255,255,255,0.3)]',
|
|
83
|
+
className
|
|
84
|
+
)}
|
|
85
|
+
style={
|
|
86
|
+
colors ? { backgroundColor: colors.primary, color: colors.primaryForeground } : undefined
|
|
87
|
+
}
|
|
88
|
+
>
|
|
89
|
+
{renderIconContent(icon, themed, providerIcon)}
|
|
90
|
+
</span>
|
|
91
|
+
)
|
|
92
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@/ui-components/alert-dialog'
|
|
@@ -1,53 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { type VariantProps, cva } from 'class-variance-authority'
|
|
3
|
-
|
|
4
|
-
import { cn } from '@/client/lib/cn'
|
|
5
|
-
|
|
6
|
-
const buttonVariants = cva(
|
|
7
|
-
'inline-flex shrink-0 cursor-pointer items-center justify-center gap-1.5 rounded-lg text-sm font-medium whitespace-nowrap transition-all duration-100 outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0',
|
|
8
|
-
{
|
|
9
|
-
variants: {
|
|
10
|
-
variant: {
|
|
11
|
-
default:
|
|
12
|
-
'bg-primary text-primary-foreground inset-shadow-[0_0_8px_color-mix(in_oklab,var(--color-white)_20%,transparent)] hover:bg-primary/90 disabled:bg-accent disabled:text-muted-foreground disabled:opacity-100 disabled:shadow-none',
|
|
13
|
-
secondary:
|
|
14
|
-
'bg-accent text-foreground hover:bg-[color-mix(in_oklch,var(--accent),var(--foreground)_3%)] hover:text-accent-foreground',
|
|
15
|
-
outline:
|
|
16
|
-
'bg-background text-foreground shadow-xs hover:text-accent-foreground hover:shadow-sm',
|
|
17
|
-
ghost: 'hover:bg-accent hover:text-accent-foreground',
|
|
18
|
-
destructive:
|
|
19
|
-
'bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20'
|
|
20
|
-
},
|
|
21
|
-
size: {
|
|
22
|
-
sm: 'h-7 gap-1.5 rounded-md px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg]:size-4',
|
|
23
|
-
default:
|
|
24
|
-
'h-8 px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5 [&_svg]:size-5',
|
|
25
|
-
lg: 'h-10 rounded-xl px-4 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3 [&_svg]:size-5',
|
|
26
|
-
'icon-sm': 'size-7 rounded-md [&_svg]:size-4',
|
|
27
|
-
icon: 'size-8 [&_svg]:size-5',
|
|
28
|
-
'icon-lg': 'size-10 rounded-xl [&_svg]:size-5'
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
defaultVariants: {
|
|
32
|
-
variant: 'default',
|
|
33
|
-
size: 'default'
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
)
|
|
37
|
-
|
|
38
|
-
function Button({
|
|
39
|
-
className,
|
|
40
|
-
variant = 'default',
|
|
41
|
-
size = 'default',
|
|
42
|
-
...props
|
|
43
|
-
}: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>) {
|
|
44
|
-
return (
|
|
45
|
-
<ButtonPrimitive
|
|
46
|
-
data-slot="button"
|
|
47
|
-
className={cn(buttonVariants({ variant, size, className }))}
|
|
48
|
-
{...props}
|
|
49
|
-
/>
|
|
50
|
-
)
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export { Button, buttonVariants }
|
|
1
|
+
export * from '@/ui-components/button'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@/ui-components/checkbox'
|
|
@@ -1,15 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function Collapsible({ ...props }: CollapsiblePrimitive.Root.Props) {
|
|
4
|
-
return <CollapsiblePrimitive.Root data-slot="collapsible" {...props} />
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
function CollapsibleTrigger({ ...props }: CollapsiblePrimitive.Trigger.Props) {
|
|
8
|
-
return <CollapsiblePrimitive.Trigger data-slot="collapsible-trigger" {...props} />
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function CollapsibleContent({ ...props }: CollapsiblePrimitive.Panel.Props) {
|
|
12
|
-
return <CollapsiblePrimitive.Panel data-slot="collapsible-content" {...props} />
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export { Collapsible, CollapsibleTrigger, CollapsibleContent }
|
|
1
|
+
export * from '@/ui-components/collapsible'
|
|
@@ -1,58 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { cn } from '@/client/lib/cn'
|
|
4
|
-
|
|
5
|
-
function Dialog({ ...props }: DialogPrimitive.Root.Props) {
|
|
6
|
-
return <DialogPrimitive.Root data-slot="dialog" {...props} />
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
function DialogTrigger({ ...props }: DialogPrimitive.Trigger.Props) {
|
|
10
|
-
return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function DialogClose({ ...props }: DialogPrimitive.Close.Props) {
|
|
14
|
-
return <DialogPrimitive.Close data-slot="dialog-close" {...props} />
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function DialogContent({ className, children, ...props }: DialogPrimitive.Popup.Props) {
|
|
18
|
-
return (
|
|
19
|
-
<DialogPrimitive.Portal>
|
|
20
|
-
<DialogPrimitive.Backdrop
|
|
21
|
-
data-slot="dialog-backdrop"
|
|
22
|
-
className="fixed inset-0 z-50 bg-foreground/40 duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0"
|
|
23
|
-
/>
|
|
24
|
-
<DialogPrimitive.Popup
|
|
25
|
-
data-slot="dialog-content"
|
|
26
|
-
className={cn(
|
|
27
|
-
'fixed top-1/2 left-1/2 z-50 origin-center -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-xl bg-card text-card-foreground shadow-xl outline-hidden duration-150 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',
|
|
28
|
-
className
|
|
29
|
-
)}
|
|
30
|
-
{...props}
|
|
31
|
-
>
|
|
32
|
-
{children}
|
|
33
|
-
</DialogPrimitive.Popup>
|
|
34
|
-
</DialogPrimitive.Portal>
|
|
35
|
-
)
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props) {
|
|
39
|
-
return (
|
|
40
|
-
<DialogPrimitive.Title
|
|
41
|
-
data-slot="dialog-title"
|
|
42
|
-
className={cn('text-lg font-semibold', className)}
|
|
43
|
-
{...props}
|
|
44
|
-
/>
|
|
45
|
-
)
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function DialogDescription({ className, ...props }: DialogPrimitive.Description.Props) {
|
|
49
|
-
return (
|
|
50
|
-
<DialogPrimitive.Description
|
|
51
|
-
data-slot="dialog-description"
|
|
52
|
-
className={cn('text-sm text-muted-foreground', className)}
|
|
53
|
-
{...props}
|
|
54
|
-
/>
|
|
55
|
-
)
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogTitle, DialogTrigger }
|
|
1
|
+
export * from '@/ui-components/dialog'
|