moi-computer 0.12.0 → 0.12.1-next.1
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 +27 -27
- package/bin/moi.mjs +2 -2
- package/client/AGENTS.md +7 -4
- package/client/api/app-config.ts +3 -2
- package/client/api/app-ui-keys.ts +1 -1
- package/client/api/workspace-keys.ts +2 -4
- package/client/app/{AppRouter.tsx → app-router.tsx} +4 -4
- package/client/app/routes/{HomeRoute.tsx → home-route.tsx} +2 -2
- package/client/app/routes/{WorkspaceRoute.tsx → workspace-route.tsx} +20 -31
- package/client/app/shell/{SidebarLayout.tsx → sidebar-layout.tsx} +10 -10
- package/client/dev/index.html +43 -0
- package/client/dev/index.ts +15 -0
- package/client/features/applets/{AppletContainer.tsx → applet-container.tsx} +1 -1
- package/client/features/applets/applet-runtime.ts +11 -13
- package/client/features/applets/applet-thumbnail.ts +1 -1
- package/client/features/applets/{useApplet.ts → use-applet.ts} +2 -2
- package/client/features/applets/{WidgetShell.tsx → widget-shell.tsx} +4 -4
- package/client/features/chat/applet-chat-intents.ts +33 -14
- package/client/features/chat/{ChatPanel.tsx → chat-panel.tsx} +80 -59
- package/client/features/chat/chat-popup.tsx +171 -0
- package/client/features/chat/chat-send.ts +33 -1
- package/client/features/chat/chat-store.ts +10 -0
- package/client/features/chat/composer/attachments/{DrawingAttachmentChip.tsx → drawing-attachment-chip.tsx} +1 -1
- package/client/features/chat/composer/attachments/{FileAttachmentChip.tsx → file-attachment-chip.tsx} +1 -1
- package/client/features/chat/composer/attachments/{TextAttachmentChip.tsx → text-attachment-chip.tsx} +1 -1
- package/client/features/chat/composer/banners/{ComposerBanner.tsx → composer-banner.tsx} +0 -14
- package/client/features/chat/composer/banners/{ErrorBanner.tsx → error-banner.tsx} +1 -1
- package/client/features/chat/composer/banners/{SkillUpdateBanner.tsx → skill-update-banner.tsx} +3 -3
- package/client/features/chat/composer/{ChatComposer.tsx → chat-composer.tsx} +31 -33
- package/client/features/chat/composer/{ModelPicker.tsx → model-picker.tsx} +4 -4
- package/client/features/chat/composer/{useWorkspaceComposerState.tsx → use-workspace-composer-state.tsx} +14 -30
- package/client/features/chat/composer/{useWorkspaceSkillUpdates.ts → use-workspace-skill-updates.ts} +1 -1
- package/client/features/chat/connection/chat-frames.ts +15 -8
- package/client/features/chat/messages/{ChatEmptyState.tsx → chat-empty-state.tsx} +37 -23
- package/client/features/chat/messages/fork-history.ts +14 -0
- package/client/features/chat/messages/{MarkdownContent.tsx → markdown-content.tsx} +4 -4
- package/client/features/chat/messages/tool-group/index.ts +1 -1
- package/client/features/chat/messages/tool-group/{ReadImagePreview.tsx → read-image-preview.tsx} +2 -2
- package/client/features/chat/messages/tool-group/{SubagentCard.tsx → subagent-card.tsx} +3 -3
- package/client/features/chat/messages/tool-group/{TimelineRow.tsx → timeline-row.tsx} +1 -1
- package/client/features/chat/messages/tool-group/{ToolCallGroup.tsx → tool-call-group.tsx} +8 -8
- package/client/features/chat/messages/tool-group/{ToolOutput.tsx → tool-output.tsx} +1 -1
- package/client/features/chat/messages/{TurnView.tsx → turn-view.tsx} +4 -4
- package/client/features/chat/sessions/api.ts +109 -19
- package/client/features/chat/sessions/browser-tab-state.ts +30 -7
- package/client/features/chat/sessions/{ChatSelector.tsx → chat-selector.tsx} +139 -80
- package/client/features/chat/sessions/use-selected-session.ts +351 -0
- package/client/features/chat/{useChat.ts → use-chat.ts} +46 -48
- package/client/features/collab/client.ts +10 -11
- package/client/features/collab/hooks.tsx +6 -11
- package/client/features/collab/host-state.ts +57 -128
- package/client/features/collab/provider.tsx +3 -3
- package/client/features/collab/proxy-user.ts +1 -1
- package/client/features/collab/testing/fake-engine.ts +6 -27
- package/client/features/collab/workspace-users-menu.tsx +3 -7
- package/client/features/connectors/mcp-icons.ts +1 -1
- package/client/features/connectors/{McpServerCards.tsx → mcp-server-cards.tsx} +1 -1
- package/client/features/{home/workspace-setup/DemoDialog.tsx → demo/demo-dialog.tsx} +6 -6
- package/client/features/dev/chat-states-fixtures.ts +4 -4
- package/client/features/dev/{ChatStatesPage.tsx → chat-states-page.tsx} +6 -6
- package/client/features/dev/collab/local-user-settings.tsx +4 -4
- package/client/features/dev/{DevIndexPage.tsx → dev-index-page.tsx} +7 -1
- package/client/features/dev/{DevRoutes.tsx → dev-routes.tsx} +8 -6
- package/client/features/dev/workspace-setup-mocks.ts +102 -0
- package/client/features/dev/workspace-setup-page.tsx +11 -0
- package/client/features/dev/workspace-setup-preview.tsx +226 -0
- package/client/features/drawings/{DrawingToolbar.tsx → drawing-toolbar.tsx} +1 -1
- package/client/features/drawings/{useChatAnnotation.ts → use-chat-annotation.ts} +29 -23
- package/client/features/drawings/{useDrawingLayer.ts → use-drawing-layer.ts} +1 -1
- package/client/features/drawings/{useViewBuilderSketch.ts → use-view-sketch.ts} +8 -8
- package/client/features/harness/api.ts +36 -0
- package/client/features/harness/device-login-steps.tsx +97 -0
- package/client/features/home/api.ts +1 -81
- package/client/features/home/{HomeLogo.tsx → home-logo.tsx} +1 -1
- package/client/features/home/{HomePage.tsx → home-page.tsx} +16 -20
- package/client/features/overview/api.ts +2 -2
- package/client/features/overview/default/registry.tsx +3 -5
- package/client/features/overview/default/{ViewsWidget.tsx → views-widget.tsx} +6 -13
- package/client/features/overview/{HiddenPanel.tsx → hidden-panel.tsx} +2 -2
- package/client/features/overview/{Overview.tsx → overview.tsx} +9 -12
- package/client/features/overview/{WidgetCanvas.tsx → widget-canvas.tsx} +1 -1
- package/client/features/overview/{WidgetFrame.tsx → widget-frame.tsx} +1 -1
- package/client/features/overview/workspace-name.tsx +55 -0
- package/client/features/scratchpad/{Scratchpad.tsx → scratchpad.tsx} +7 -7
- package/client/features/scratchpad/{useScratchpadSnapshot.tsx → use-scratchpad-snapshot.tsx} +3 -3
- package/client/features/settings/api.ts +1 -1
- package/client/features/settings/{ConnectorsSettings.tsx → connectors-settings.tsx} +3 -3
- package/client/features/settings/{EnvironmentSettings.tsx → environment-settings.tsx} +3 -3
- package/client/features/settings/{GeneralSettings.tsx → general-settings.tsx} +5 -5
- package/client/features/settings/{useEnvVars.ts → use-env-vars.ts} +1 -1
- package/client/features/settings/{WorkspaceIconPicker.tsx → workspace-icon-picker.tsx} +1 -1
- package/client/features/settings/{WorkspaceSettingsDialog.tsx → workspace-settings-dialog.tsx} +3 -3
- package/client/features/update/api.ts +1 -1
- package/client/features/views/api.ts +64 -131
- package/client/features/views/pending-view-screen.tsx +282 -0
- package/client/features/views/use-view-actions.ts +151 -0
- package/client/features/views/use-view-drafts.ts +88 -0
- package/client/features/views/{ViewManager.tsx → view-manager.tsx} +13 -13
- package/client/features/views/view-presentation.ts +4 -5
- package/client/features/views/view-submission.ts +88 -0
- package/client/features/workspace/add/api.ts +80 -0
- package/client/features/{home/workspace-setup/CreateWorkspaceDialog.tsx → workspace/add/create-workspace-dialog.tsx} +56 -42
- package/client/features/workspace/add/import-workspace-dialog.tsx +81 -0
- package/client/features/{home/workspace-setup/useWorkspaceImport.ts → workspace/add/use-workspace-import.ts} +1 -1
- package/client/features/workspace/add/workspace-agent-options.ts +53 -0
- package/client/features/{home/workspace-setup/WorkspaceAgentStep.tsx → workspace/add/workspace-agent-selector.tsx} +59 -98
- package/client/features/{home/workspace-setup/WorkspaceDialogContent.tsx → workspace/add/workspace-dialog-content.tsx} +1 -1
- package/client/features/workspace/api.ts +24 -15
- package/client/features/workspace/browser-tab-state.ts +16 -9
- package/client/features/workspace/moi-context.ts +14 -16
- package/client/features/workspace/setup/workspace-login-state.tsx +175 -0
- package/client/features/workspace/setup/workspace-recovery-states.tsx +125 -0
- package/client/features/workspace/setup/workspace-setup-panel.tsx +18 -0
- package/client/features/workspace/setup/workspace-setup.tsx +77 -0
- package/client/features/workspace/setup/workspace-welcome-state.tsx +81 -0
- package/client/features/workspace/tab-resolution.ts +16 -29
- package/client/features/workspace/{ThemePanel.tsx → theme-panel.tsx} +3 -3
- package/client/features/workspace/use-workspace-navigation.ts +245 -0
- package/client/features/workspace/workspace-content.tsx +641 -0
- package/client/features/workspace/workspace-identity.tsx +40 -0
- package/client/features/workspace/workspace-menu.tsx +63 -0
- package/client/features/{home → workspace}/workspace-presentation.tsx +10 -3
- package/client/features/workspace/workspace-screen.tsx +28 -0
- package/client/features/workspace/{WorkspaceSplitLayout.tsx → workspace-split-layout.tsx} +1 -1
- package/client/features/workspace/{WorkspaceTabs.tsx → workspace-tabs.tsx} +2 -2
- package/client/index.css +2 -2
- package/client/index.html +1 -1
- package/client/index.tsx +5 -1
- package/client/lib/agent-availability.ts +0 -5
- package/client/main.tsx +1 -1
- package/client/runtime/{useWorkspaceEvents.ts → use-workspace-events.ts} +10 -18
- package/client/store/ui.ts +25 -29
- package/dist/chunk-08ndj2rg.js +2 -0
- package/dist/chunk-2x040tmg.js +68 -0
- package/dist/chunk-3smxq0ts.js +1 -0
- package/dist/chunk-68ch5hs8.js +2 -0
- package/dist/{chunk-z3byfve5.js → chunk-9vg3xa81.js} +2 -2
- package/dist/chunk-c2p00p9j.css +1 -0
- package/dist/chunk-cs833y9j.js +1 -0
- package/dist/{chunk-97eg9mjn.js → chunk-d7cbm65e.js} +1 -1
- package/dist/{chunk-efdyz6xp.js → chunk-hvh9f5h0.js} +1 -1
- package/dist/{chunk-vfpsc75k.js → chunk-jvyvwwv3.js} +1 -1
- package/dist/chunk-nwevqe86.js +10 -0
- package/dist/{chunk-3a48fyf7.js → chunk-q0gbdts4.js} +4 -4
- package/dist/chunk-rt30jbcm.js +1 -0
- package/dist/chunk-y5y3kj67.js +1 -0
- package/dist/index.html +2 -2
- package/lib/format.ts +1 -1
- package/lib/harness-instructions.ts +30 -0
- package/lib/ids.ts +3 -6
- package/lib/moi-context.ts +102 -75
- package/lib/navigation.ts +48 -87
- package/lib/scratchpad-skew.ts +3 -3
- package/lib/session-drafts.ts +10 -0
- package/lib/types.ts +92 -51
- package/lib/update.ts +1 -1
- package/lib/view-build-directives.ts +12 -0
- package/lib/workspace-layout.ts +1 -1
- package/lib/workspace-tabs.ts +12 -7
- package/package.json +7 -2
- package/server/AGENTS.md +10 -4
- package/server/README.md +102 -0
- package/server/agent-launcher.ts +27 -0
- package/server/api/harnesses.ts +56 -0
- package/server/{api.ts → api/index.ts} +197 -299
- package/server/app-config.ts +45 -14
- package/server/app-settings.ts +1 -1
- package/server/applets/applet-css.ts +1 -1
- package/server/applets/build-applet.ts +4 -4
- package/server/applets/build-worker.ts +3 -2
- package/server/applets/config.ts +1 -1
- package/server/{functions-worker.ts → applets/functions-worker.ts} +1 -1
- package/server/{functions.ts → applets/functions.ts} +3 -2
- package/server/applets/index.ts +2 -2
- package/server/{thumbnails.ts → applets/thumbnails.ts} +1 -1
- package/server/{applet-typecheck.ts → applets/typecheck.ts} +4 -4
- package/server/{ui-components.ts → applets/ui-components.ts} +2 -2
- package/server/applets/view-source.ts +7 -1
- package/server/{views.ts → applets/views.ts} +35 -46
- package/server/{widgets.ts → applets/widgets.ts} +2 -2
- package/server/cli/applet-selector.ts +19 -0
- package/server/cli/args.ts +5 -0
- package/server/{cli-colors.ts → cli/colors.ts} +1 -1
- package/server/cli/commands/bundle.ts +119 -0
- package/server/cli/commands/call-server-fn.ts +42 -0
- package/server/cli/commands/check.ts +53 -0
- package/server/cli/commands/config.ts +132 -0
- package/server/cli/commands/debug.ts +119 -0
- package/server/cli/commands/env.ts +162 -0
- package/server/cli/commands/hermes.ts +149 -0
- package/server/cli/commands/init.ts +286 -0
- package/server/cli/commands/navigate.ts +35 -0
- package/server/cli/commands/openclaw.ts +168 -0
- package/server/cli/commands/refresh.ts +39 -0
- package/server/cli/commands/scratch.ts +496 -0
- package/server/cli/commands/service.ts +298 -0
- package/server/cli/commands/skill.ts +122 -0
- package/server/cli/commands/start.ts +138 -0
- package/server/cli/commands/status.ts +80 -0
- package/server/cli/commands/tabs.ts +43 -0
- package/server/cli/commands/theme.ts +192 -0
- package/server/cli/commands/ui-components.ts +15 -0
- package/server/cli/commands/update.ts +192 -0
- package/server/cli/commands/version.ts +9 -0
- package/server/cli/commands/views.ts +87 -0
- package/server/cli/control.ts +89 -0
- package/server/{cli-env.ts → cli/env.ts} +78 -56
- package/server/cli/index.ts +171 -0
- package/server/{cli-pc.ts → cli/pc.ts} +1 -1
- package/server/cli/provider.ts +25 -0
- package/server/cli/server-version.ts +16 -0
- package/server/cli/server.ts +81 -0
- package/server/{cli-ui-components.ts → cli/ui-components.ts} +5 -5
- package/server/cli.ts +2 -3215
- package/server/collab/manager.ts +3 -3
- package/server/collab/skill/index.ts +2 -2
- package/server/control.ts +97 -78
- package/server/data-dir.ts +13 -0
- package/server/harness/README.md +55 -25
- package/server/harness/acp/NOTES.md +11 -11
- package/server/harness/acp/adapter.ts +2 -2
- package/server/harness/acp/archived.ts +3 -3
- package/server/harness/acp/client.ts +4 -3
- package/server/harness/acp/discovery.ts +3 -3
- package/server/harness/acp/run-durations.ts +1 -1
- package/server/harness/acp/session.ts +9 -12
- package/server/harness/auth.ts +303 -0
- package/server/harness/claude-code/NOTES.md +9 -7
- package/server/harness/claude-code/adapter.ts +13 -8
- package/server/harness/claude-code/auth.ts +127 -18
- package/server/harness/claude-code/cli.ts +3 -1
- package/server/harness/claude-code/git-worktree.ts +5 -2
- package/server/harness/claude-code/index.ts +7 -1
- package/server/harness/claude-code/mcp.ts +3 -1
- package/server/harness/claude-code/models.ts +2 -0
- package/server/harness/claude-code/session.ts +13 -39
- package/server/harness/claude-code/sessions.ts +8 -12
- package/server/harness/codex/NOTES.md +35 -16
- package/server/harness/codex/adapter.ts +5 -3
- package/server/harness/codex/auth.ts +86 -19
- package/server/harness/codex/client.ts +30 -34
- package/server/harness/codex/index.ts +20 -1
- package/server/harness/codex/permissions.ts +3 -3
- package/server/harness/codex/probe.ts +3 -5
- package/server/harness/codex/session.ts +20 -25
- package/server/harness/codex/thread-list.ts +74 -0
- package/server/harness/codex/transport.ts +5 -5
- package/server/harness/executable.ts +42 -18
- package/server/harness/fork.ts +12 -0
- package/server/harness/hermes/NOTES.md +70 -70
- package/server/harness/hermes/discovery.ts +1 -1
- package/server/harness/openclaw/NOTES.md +24 -24
- package/server/harness/openclaw/adapter.ts +4 -4
- package/server/harness/openclaw/compat.ts +1 -1
- package/server/harness/openclaw/session.ts +6 -31
- package/server/harness/registry.ts +1 -1
- package/server/harness/session-title.ts +12 -3
- package/server/harness/shell-path.ts +31 -21
- package/server/harness/types.ts +17 -5
- package/server/navigation-relay.ts +1 -1
- package/server/open-browser.ts +7 -0
- package/server/{scratchpad-assets.ts → scratchpad/assets.ts} +4 -4
- package/server/{scratchpad.ts → scratchpad/document.ts} +8 -8
- package/server/{scratchpad-executor.ts → scratchpad/executor.ts} +7 -7
- package/server/{scratchpad-relay.ts → scratchpad/relay.ts} +4 -5
- package/server/{scratchpad-shape-defaults.ts → scratchpad/shape-defaults.ts} +2 -2
- package/server/server-cwd.ts +1 -1
- package/server/service.ts +18 -4
- package/server/sessions/archive.ts +32 -0
- package/server/{attachment-message.ts → sessions/attachment-message.ts} +1 -1
- package/server/sessions/config.ts +41 -0
- package/server/sessions/lifecycle.ts +17 -0
- package/server/sessions/pending-views.ts +164 -0
- package/server/sessions/selected.ts +199 -0
- package/server/sessions/store.ts +127 -0
- package/server/sessions/view-sessions.ts +267 -0
- package/server/{skills-template.ts → skills/template.ts} +1 -1
- package/server/{skill-update.ts → skills/update.ts} +5 -5
- package/server/{skill-version.ts → skills/version.ts} +4 -4
- package/server/static.ts +1 -1
- package/server/status.ts +6 -4
- package/server/web.ts +58 -49
- package/server/{env-apply.ts → workspaces/env-apply.ts} +5 -5
- package/server/{workspace-env.ts → workspaces/env.ts} +30 -3
- package/server/{workspace-import.ts → workspaces/import.ts} +4 -4
- package/server/{workspace-init.ts → workspaces/init.ts} +10 -6
- package/server/{layout.ts → workspaces/layout.ts} +2 -2
- package/server/{preview.ts → workspaces/preview.ts} +1 -1
- package/server/{registry.ts → workspaces/registry.ts} +17 -7
- package/server/{required-env.ts → workspaces/required-env.ts} +3 -3
- package/server/{moi-scaffold.ts → workspaces/scaffold.ts} +4 -3
- package/server/{tabs.ts → workspaces/tabs.ts} +7 -10
- package/ui-components/button.tsx +1 -1
- package/ui-components/docs/attachment.md +2 -2
- package/ui-components/docs/button.md +1 -1
- package/ui-components/docs/calendar.md +1 -1
- package/ui-components/docs/chart.md +4 -4
- package/ui-components/docs/data-table.md +1 -1
- package/ui-components/docs/drawer.md +1 -1
- package/ui-components/docs/field.md +1 -1
- package/ui-components/docs/input.md +2 -2
- package/ui-components/docs/label.md +2 -2
- package/ui-components/docs/table.md +2 -2
- package/workspace/.claude/skills/moi-workspace/SKILL.md +61 -32
- package/workspace/.claude/skills/moi-workspace/references/COLLAB.md +4 -7
- package/workspace/.claude/skills/moi-workspace/references/DESIGN.md +2 -2
- package/workspace/.claude/skills/moi-workspace/references/INTENTS.md +2 -2
- package/client/features/chat/ChatPopup.tsx +0 -98
- package/client/features/chat/composer/banners/AgentAvailabilityBanner.tsx +0 -101
- package/client/features/chat/sessions/useSelectedSession.ts +0 -185
- package/client/features/home/workspace-setup/ImportWorkspaceDialog.tsx +0 -92
- package/client/features/overview/WorkspaceName.tsx +0 -60
- package/client/features/views/ViewBuilder.tsx +0 -239
- package/client/features/views/useViewBuilderActions.ts +0 -103
- package/client/features/views/useViewBuilderDrafts.ts +0 -68
- package/client/features/workspace/WorkspaceScreen.tsx +0 -839
- package/client/features/workspace/useWorkspaceNavigation.ts +0 -203
- package/dist/chunk-2jncyq65.js +0 -1
- package/dist/chunk-e2q5ken7.js +0 -68
- package/dist/chunk-h2kj1ysj.js +0 -1
- package/dist/chunk-jf6czgrz.js +0 -2
- package/dist/chunk-nez8sdta.js +0 -1
- package/dist/chunk-nzwgm8vc.css +0 -1
- package/dist/chunk-ph0h6h86.js +0 -1
- package/dist/chunk-ryg9z3kn.js +0 -10
- package/dist/chunk-tpn177bt.js +0 -2
- package/lib/view-builder-directives.ts +0 -16
- package/server/agent.ts +0 -223
- package/server/chat-selection.ts +0 -22
- package/server/selected-session.ts +0 -152
- package/server/session-config.ts +0 -136
- package/server/view-builders.ts +0 -453
- /package/client/components/shared/{AgentBlobatar.tsx → agent-blobatar.tsx} +0 -0
- /package/client/components/shared/{BottomPanel.tsx → bottom-panel.tsx} +0 -0
- /package/client/components/shared/{Composer.tsx → composer.tsx} +0 -0
- /package/client/components/shared/{LedLogo.tsx → led-logo.tsx} +0 -0
- /package/client/components/shared/{PanelHeader.tsx → panel-header.tsx} +0 -0
- /package/client/components/shared/{ReorderableList.tsx → reorderable-list.tsx} +0 -0
- /package/client/components/shared/{WorkspaceIcon.tsx → workspace-icon.tsx} +0 -0
- /package/client/features/applets/{WidgetErrorBoundary.tsx → widget-error-boundary.tsx} +0 -0
- /package/client/features/chat/composer/attachments/{AttachmentChip.tsx → attachment-chip.tsx} +0 -0
- /package/client/features/chat/messages/{ChatPromptBubbles.tsx → chat-prompt-bubbles.tsx} +0 -0
- /package/client/features/chat/messages/{ShimmerText.tsx → shimmer-text.tsx} +0 -0
- /package/client/features/chat/messages/tool-group/{CodeBlock.tsx → code-block.tsx} +0 -0
- /package/client/features/chat/messages/tool-group/{Collapse.tsx → collapse.tsx} +0 -0
- /package/client/features/chat/messages/{useStickToBottom.ts → use-stick-to-bottom.ts} +0 -0
- /package/client/features/connectors/{IconMcp.tsx → icon-mcp.tsx} +0 -0
- /package/client/features/dev/{BlobatarShapesPage.tsx → blobatar-shapes-page.tsx} +0 -0
- /package/client/features/dev/{HarnessDebugPage.tsx → harness-debug-page.tsx} +0 -0
- /package/client/features/dev/{TextureLabPage.tsx → texture-lab-page.tsx} +0 -0
- /package/client/features/dev/{ToolCallsPage.tsx → tool-calls-page.tsx} +0 -0
- /package/client/features/drawings/{DrawingLayer.tsx → drawing-layer.tsx} +0 -0
- /package/client/features/home/{WorkspacePreview.tsx → workspace-preview.tsx} +0 -0
- /package/client/features/overview/{useGridReconcile.ts → use-grid-reconcile.ts} +0 -0
- /package/client/features/scratchpad/{ScratchpadControls.tsx → scratchpad-controls.tsx} +0 -0
- /package/client/features/settings/{SettingsLayout.tsx → settings-layout.tsx} +0 -0
- /package/client/features/update/{UpdateControl.tsx → update-control.tsx} +0 -0
- /package/client/features/workspace/{UnavailablePage.tsx → unavailable-page.tsx} +0 -0
- /package/client/features/workspace/{useFitsSplitLayout.ts → use-fits-split-layout.ts} +0 -0
- /package/client/features/workspace/{WorkspaceContext.tsx → workspace-context.tsx} +0 -0
- /package/client/features/workspace/{WorkspaceLayoutContext.tsx → workspace-layout-context.tsx} +0 -0
- /package/server/{bundle-queue.ts → applets/bundle-queue.ts} +0 -0
- /package/server/{applet-log.ts → applets/log.ts} +0 -0
- /package/server/{cli-ui.ts → cli/ui.ts} +0 -0
- /package/server/{workspace-config.ts → workspaces/config.ts} +0 -0
- /package/server/{icon.ts → workspaces/icon.ts} +0 -0
- /package/server/{theme.ts → workspaces/theme.ts} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Per-workspace environment variables surfaced to both spawn sites: the widget
|
|
2
|
-
// function workers (functions.ts) and
|
|
2
|
+
// function workers (server/applets/functions.ts) and agent harness processes.
|
|
3
3
|
//
|
|
4
4
|
// Two sources feed a workspace's effective env:
|
|
5
5
|
// 1. Discovered `.env` files in the workspace root (`.env`, then `.env.local`,
|
|
@@ -20,7 +20,7 @@ import { parseEnv } from 'node:util'
|
|
|
20
20
|
|
|
21
21
|
import type { WorkspaceEnvVar, WorkspaceEnvView } from '@/lib/types'
|
|
22
22
|
|
|
23
|
-
import { DATA_DIR } from '
|
|
23
|
+
import { DATA_DIR } from '../data-dir'
|
|
24
24
|
|
|
25
25
|
// Dotenv files scanned in the workspace root, low → high precedence. A later
|
|
26
26
|
// file's keys override an earlier file's (base `.env`, machine-local `.env.local`).
|
|
@@ -299,7 +299,7 @@ async function loadWorkspaceEnvState(workspacePath: string): Promise<WorkspaceEn
|
|
|
299
299
|
|
|
300
300
|
// The effective env: discovered `.env` (when inherited) overlaid with the
|
|
301
301
|
// custom secrets. Injected at spawn — env is frozen once the process starts,
|
|
302
|
-
// so changes require a restart (see functions.ts /
|
|
302
|
+
// so changes require a restart (see server/applets/functions.ts and server/harness/).
|
|
303
303
|
export async function resolveWorkspaceEnv(workspacePath: string): Promise<Record<string, string>> {
|
|
304
304
|
const { secrets, dotenv } = await loadWorkspaceEnvState(workspacePath)
|
|
305
305
|
return { ...dotenv, ...secrets }
|
|
@@ -328,6 +328,33 @@ export type EnvUpdate = {
|
|
|
328
328
|
inheritDotenv?: boolean
|
|
329
329
|
}
|
|
330
330
|
|
|
331
|
+
// Validate an env patch that arrives from outside the process (PUT /env, the
|
|
332
|
+
// control port). Returns the patch, or an error message for the caller.
|
|
333
|
+
export function parseEnvUpdate(body: unknown): EnvUpdate | string {
|
|
334
|
+
if (!body || typeof body !== 'object') return 'Bad request'
|
|
335
|
+
const raw = body as Record<string, unknown>
|
|
336
|
+
const patch: EnvUpdate = {}
|
|
337
|
+
if (raw.set !== undefined) {
|
|
338
|
+
if (typeof raw.set !== 'object' || raw.set === null) return 'set must be an object'
|
|
339
|
+
for (const [k, v] of Object.entries(raw.set)) {
|
|
340
|
+
if (!isValidEnvKey(k)) return `Invalid env key: ${k}`
|
|
341
|
+
if (typeof v !== 'string') return `Value for ${k} must be a string`
|
|
342
|
+
}
|
|
343
|
+
patch.set = raw.set as Record<string, string>
|
|
344
|
+
}
|
|
345
|
+
if (raw.remove !== undefined) {
|
|
346
|
+
if (!Array.isArray(raw.remove) || raw.remove.some(k => typeof k !== 'string')) {
|
|
347
|
+
return 'remove must be an array of strings'
|
|
348
|
+
}
|
|
349
|
+
patch.remove = raw.remove as string[]
|
|
350
|
+
}
|
|
351
|
+
if (raw.inheritDotenv !== undefined) {
|
|
352
|
+
if (typeof raw.inheritDotenv !== 'boolean') return 'inheritDotenv must be a boolean'
|
|
353
|
+
patch.inheritDotenv = raw.inheritDotenv
|
|
354
|
+
}
|
|
355
|
+
return patch
|
|
356
|
+
}
|
|
357
|
+
|
|
331
358
|
// Apply a patch to a workspace's custom secrets + metadata. Patch (not replace)
|
|
332
359
|
// semantics, because values are write-only — the UI can add/update one key
|
|
333
360
|
// without resending the others. Serialized per workspace to avoid lost updates.
|
|
@@ -2,10 +2,10 @@ import { resolve } from 'node:path'
|
|
|
2
2
|
|
|
3
3
|
import type { WorkspaceType } from '@/lib/types'
|
|
4
4
|
|
|
5
|
-
import { discoverHermesProfiles } from '
|
|
6
|
-
import type { HermesProfile } from '
|
|
7
|
-
import { discoverOpenClawAgents } from '
|
|
8
|
-
import type { OpenClawAgent } from '
|
|
5
|
+
import { discoverHermesProfiles } from '../harness/hermes/discovery'
|
|
6
|
+
import type { HermesProfile } from '../harness/hermes/discovery'
|
|
7
|
+
import { discoverOpenClawAgents } from '../harness/openclaw/discovery'
|
|
8
|
+
import type { OpenClawAgent } from '../harness/openclaw/discovery'
|
|
9
9
|
|
|
10
10
|
export type WorkspaceImportMetadata = {
|
|
11
11
|
name?: string
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// The one place that knows how to turn a directory into a
|
|
1
|
+
// The one place that knows how to turn a directory into a Moi workspace:
|
|
2
2
|
// bundled skills + the `.moi/` scaffold, with the skills location keyed on the
|
|
3
3
|
// agent backend. `moi init`, `moi openclaw init`, and the HTTP API (UI import /
|
|
4
4
|
// create) all provision through here, so a workspace set up from the UI is
|
|
@@ -10,9 +10,10 @@ import { join } from 'node:path'
|
|
|
10
10
|
import type { WorkspaceType } from '@/lib/types'
|
|
11
11
|
export { validateWorkspaceFolderName } from '@/lib/workspace-name'
|
|
12
12
|
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
13
|
+
import { getAppConfig } from '../app-config'
|
|
14
|
+
import { harnessFor } from '../harness/registry'
|
|
15
|
+
import { createDependencyInstallLogPath, scaffoldMoiDir } from './scaffold'
|
|
16
|
+
import { installBundledSkills } from '../skills/template'
|
|
16
17
|
|
|
17
18
|
// Where each backend loads skills from — the harness owns the answer
|
|
18
19
|
// (Claude Code: `.claude/skills/`; OpenClaw: `<workspace>/skills/`; Codex:
|
|
@@ -24,8 +25,11 @@ export function skillsDirFor(workspaceRoot: string, type?: WorkspaceType): strin
|
|
|
24
25
|
|
|
25
26
|
// Folder that holds workspaces created from the UI (`/workspace/create`) — a
|
|
26
27
|
// visible home-dir folder, mirroring how Cowork keeps its session folders under
|
|
27
|
-
// the user's home rather than an app-data dir.
|
|
28
|
-
|
|
28
|
+
// the user's home rather than an app-data dir. Managed machines set their own
|
|
29
|
+
// (`workspacesDir` in config.json).
|
|
30
|
+
export function createdWorkspacesRoot(): string {
|
|
31
|
+
return getAppConfig().workspacesDir ?? join(homedir(), 'moi')
|
|
32
|
+
}
|
|
29
33
|
|
|
30
34
|
export type ProvisionResult = {
|
|
31
35
|
// Where the skills were installed (backend-dependent, see skillsDirFor).
|
|
@@ -9,7 +9,7 @@ import type {
|
|
|
9
9
|
import { createDefaultWorkspaceLayout, normalizeWorkspaceTabs } from '@/lib/workspace-layout'
|
|
10
10
|
import { isWorkspaceIcon } from '@/lib/workspace-icon'
|
|
11
11
|
|
|
12
|
-
import { getCapturedThumbnails } from '
|
|
12
|
+
import { getCapturedThumbnails } from '../applets/thumbnails'
|
|
13
13
|
|
|
14
14
|
function normalizeLayout(parsed: Record<string, unknown>): WorkspaceLayout {
|
|
15
15
|
const defaults = createDefaultWorkspaceLayout()
|
|
@@ -24,7 +24,7 @@ function normalizeLayout(parsed: Record<string, unknown>): WorkspaceLayout {
|
|
|
24
24
|
delete layout.icon
|
|
25
25
|
}
|
|
26
26
|
// Legacy thumbnail caches are intentionally dropped, not migrated — images
|
|
27
|
-
// now live as files under `.moi/.cache/thumbnails` (server/thumbnails.ts)
|
|
27
|
+
// now live as files under `.moi/.cache/thumbnails` (server/applets/thumbnails.ts)
|
|
28
28
|
// and applets are simply captured again there.
|
|
29
29
|
delete layout.widgetThumbnails
|
|
30
30
|
delete layout.viewThumbnails
|
|
@@ -14,7 +14,7 @@ import { statSync } from 'node:fs'
|
|
|
14
14
|
|
|
15
15
|
import sharp from 'sharp'
|
|
16
16
|
|
|
17
|
-
import { resolveWorkspaceMediaFile } from '
|
|
17
|
+
import { resolveWorkspaceMediaFile } from '../applets'
|
|
18
18
|
|
|
19
19
|
// Long edge of the rendered preview. 2× the ~300px display size keeps it crisp
|
|
20
20
|
// on retina without shipping the original.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { existsSync } from 'node:fs'
|
|
1
|
+
import { existsSync, realpathSync } from 'node:fs'
|
|
2
2
|
import { rename, rm } from 'node:fs/promises'
|
|
3
3
|
import { homedir } from 'node:os'
|
|
4
4
|
import { join, resolve, sep } from 'path'
|
|
@@ -7,9 +7,9 @@ import { newWorkspaceId, validateWorkspaceId } from '@/lib/ids'
|
|
|
7
7
|
import type { DiscoveredWorkspace, WorkspaceEntry, WorkspaceType } from '@/lib/types'
|
|
8
8
|
import { orderWorkspaceTypes } from '@/lib/workspace-types'
|
|
9
9
|
|
|
10
|
-
import { DATA_DIR } from '
|
|
11
|
-
import { allHarnesses } from '
|
|
12
|
-
import type { DiscoveredWorkspaceCandidate } from '
|
|
10
|
+
import { DATA_DIR } from '../data-dir'
|
|
11
|
+
import { allHarnesses } from '../harness/registry'
|
|
12
|
+
import type { DiscoveredWorkspaceCandidate } from '../harness/types'
|
|
13
13
|
|
|
14
14
|
// Replace the home-dir prefix with `~` for display. Keeps the original
|
|
15
15
|
// absolute path in place; callers should put the result in `displayPath`.
|
|
@@ -186,10 +186,20 @@ export function findWorkspaceForPath<T extends { path: string }>(
|
|
|
186
186
|
workspaces: T[],
|
|
187
187
|
reqPath: string
|
|
188
188
|
): T | null {
|
|
189
|
-
|
|
190
|
-
|
|
189
|
+
// Shells can resolve aliases such as macOS /tmp → /private/tmp differently.
|
|
190
|
+
function canonicalPath(path: string) {
|
|
191
|
+
try {
|
|
192
|
+
return realpathSync(path)
|
|
193
|
+
} catch {
|
|
194
|
+
return resolve(path)
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
const normal = canonicalPath(reqPath)
|
|
198
|
+
const matches = workspaces
|
|
199
|
+
.map(workspace => ({ workspace, path: canonicalPath(workspace.path) }))
|
|
200
|
+
.filter(w => normal === w.path || normal.startsWith(w.path + sep))
|
|
191
201
|
if (matches.length === 0) return null
|
|
192
|
-
return matches.reduce((best, w) => (w.path.length > best.path.length ? w : best))
|
|
202
|
+
return matches.reduce((best, w) => (w.path.length > best.path.length ? w : best)).workspace
|
|
193
203
|
}
|
|
194
204
|
|
|
195
205
|
// If `p` lies inside a workspace's `.moi/` directory, return the workspace root
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// The env "required" view aggregates `config.requiredEnv` declared by both
|
|
2
2
|
// widgets and views, each key mapped to the bundle ids that asked for it.
|
|
3
|
-
// Shared by the env API (api.ts) and
|
|
4
|
-
import { collectViewRequiredEnv } from '
|
|
5
|
-
import { collectRequiredEnv } from '
|
|
3
|
+
// Shared by the env API (server/api/index.ts) and control-port handlers.
|
|
4
|
+
import { collectViewRequiredEnv } from '../applets/views'
|
|
5
|
+
import { collectRequiredEnv } from '../applets/widgets'
|
|
6
6
|
|
|
7
7
|
export async function requiredEnvFor(workspacePath: string): Promise<Record<string, string[]>> {
|
|
8
8
|
const [widgets, views] = await Promise.all([
|
|
@@ -6,7 +6,8 @@ import { appendFile, mkdir, open, stat } from 'node:fs/promises'
|
|
|
6
6
|
import { tmpdir } from 'node:os'
|
|
7
7
|
import { join, resolve, sep } from 'node:path'
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { agentCommand } from '../agent-launcher'
|
|
10
|
+
import { syncAppletDeclarations } from '../applets/declarations'
|
|
10
11
|
|
|
11
12
|
// Dependency set available to widgets. `react`/`react-dom` are stubs — at
|
|
12
13
|
// runtime they resolve to moi's locally-vendored ESM via the browser importmap
|
|
@@ -54,7 +55,7 @@ async function runBunInstall(moiDir: string, logPath: string): Promise<number> {
|
|
|
54
55
|
await log.writeFile(
|
|
55
56
|
`bun install started at ${new Date().toISOString()}\nWorking directory: ${moiDir}\n\n`
|
|
56
57
|
)
|
|
57
|
-
install = Bun.spawn(['bun', 'install'], {
|
|
58
|
+
install = Bun.spawn(agentCommand(['bun', 'install']), {
|
|
58
59
|
cwd: moiDir,
|
|
59
60
|
stdin: 'ignore',
|
|
60
61
|
// Direct file descriptors keep capturing both streams after a
|
|
@@ -94,7 +95,7 @@ async function runBunInstall(moiDir: string, logPath: string): Promise<number> {
|
|
|
94
95
|
// package.json, and lockfile stay committable — they ARE the workspace.
|
|
95
96
|
const REQUIRED_IGNORES = ['.build/', '.cache/', 'node_modules/'] as const
|
|
96
97
|
|
|
97
|
-
export const MOI_GITIGNORE = `#
|
|
98
|
+
export const MOI_GITIGNORE = `# Moi internals — machine-local, re-creatable state
|
|
98
99
|
${REQUIRED_IGNORES.join('\n')}
|
|
99
100
|
`
|
|
100
101
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// Tab discovery with portable navigation addresses.
|
|
2
2
|
import type { ViewInfo, WorkspaceTabId } from '@/lib/types'
|
|
3
|
-
import { moiHref } from '@/lib/navigation'
|
|
4
3
|
import { viewTabId } from '@/lib/workspace-tabs'
|
|
5
4
|
|
|
6
5
|
// One row of `moi tabs`. `isDefault` marks the workspace's saved default tab
|
|
@@ -9,27 +8,25 @@ export type TabRow = {
|
|
|
9
8
|
id: WorkspaceTabId
|
|
10
9
|
title: string
|
|
11
10
|
isDefault: boolean
|
|
12
|
-
href
|
|
11
|
+
href: string
|
|
13
12
|
}
|
|
14
13
|
|
|
15
14
|
// The always-present tabs, titled like the tab bar renders them.
|
|
16
15
|
const STATIC_TABS: { id: WorkspaceTabId; title: string }[] = [
|
|
17
16
|
{ id: 'overview', title: 'Overview' },
|
|
18
|
-
{ id: 'agent', title: 'Agent' },
|
|
19
17
|
{ id: 'scratchpad', title: 'Scratchpad' }
|
|
20
18
|
]
|
|
21
19
|
|
|
22
|
-
// The `moi tabs` listing: static tabs plus
|
|
23
|
-
//
|
|
24
|
-
// they don't list (and a builder default simply marks no row).
|
|
20
|
+
// The `moi tabs` listing: static tabs plus every compiled or pending view, with
|
|
21
|
+
// the saved default marked.
|
|
25
22
|
export function assembleTabRows(views: ViewInfo[], defaultTab: WorkspaceTabId): TabRow[] {
|
|
26
23
|
return [
|
|
27
24
|
...STATIC_TABS,
|
|
28
|
-
...views.map(view => ({ id: viewTabId(view.id), title: view.
|
|
25
|
+
...views.map(view => ({ id: viewTabId(view.id), title: view.title || view.id }))
|
|
29
26
|
].map(row => ({
|
|
30
27
|
...row,
|
|
31
28
|
isDefault: row.id === defaultTab,
|
|
32
|
-
|
|
29
|
+
href: `moi:/${row.id}`
|
|
33
30
|
}))
|
|
34
31
|
}
|
|
35
32
|
|
|
@@ -37,9 +34,9 @@ export function assembleTabRows(views: ViewInfo[], defaultTab: WorkspaceTabId):
|
|
|
37
34
|
// browser to move. The browser repeats the availability check in case its view
|
|
38
35
|
// list is stale in either direction.
|
|
39
36
|
export function assertNavigableTab(tab: WorkspaceTabId, views: ViewInfo[]): void {
|
|
40
|
-
const rows = assembleTabRows(views, '
|
|
37
|
+
const rows = assembleTabRows(views, 'overview')
|
|
41
38
|
if (rows.some(row => row.id === tab)) return
|
|
42
39
|
throw new Error(
|
|
43
|
-
`Unknown destination "
|
|
40
|
+
`Unknown destination "moi:/${tab}". Valid addresses: ${rows.map(row => row.href).join(', ')}`
|
|
44
41
|
)
|
|
45
42
|
}
|
package/ui-components/button.tsx
CHANGED
|
@@ -11,7 +11,7 @@ const buttonVariants = cva(
|
|
|
11
11
|
default:
|
|
12
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
13
|
secondary:
|
|
14
|
-
'bg-accent text-accent-foreground hover:bg-[color-mix(in_oklch,var(--accent),var(--foreground)_3%)]',
|
|
14
|
+
'bg-accent text-accent-foreground hover:bg-[color-mix(in_oklch,var(--accent),var(--foreground)_3%)] disabled:text-muted-foreground disabled:opacity-100',
|
|
15
15
|
outline:
|
|
16
16
|
'border bg-background text-foreground hover:bg-[color-mix(in_oklch,var(--background),var(--foreground)_3%)]',
|
|
17
17
|
ghost: 'hover:bg-accent hover:text-accent-foreground',
|
|
@@ -112,7 +112,7 @@ moi ui-components add attachment
|
|
|
112
112
|
|
|
113
113
|
<Steps className="mb-0 pt-2">
|
|
114
114
|
|
|
115
|
-
<Step>Install the required
|
|
115
|
+
<Step>Install the required Moi component:</Step>
|
|
116
116
|
|
|
117
117
|
```bash
|
|
118
118
|
moi ui-components add button
|
|
@@ -664,7 +664,7 @@ A container for one or more actions, aligned to the end of the attachment.
|
|
|
664
664
|
|
|
665
665
|
### AttachmentAction
|
|
666
666
|
|
|
667
|
-
An action button. Renders a [`Button`](
|
|
667
|
+
An action button. Renders a [`Button`](button.md) and accepts all of its props.
|
|
668
668
|
|
|
669
669
|
| Prop | Type | Default | Description |
|
|
670
670
|
| ---------- | ------------------------------------- | ----------- | ---------------------------------------- |
|
|
@@ -95,7 +95,7 @@ The `Calendar` component is built on top of [React DayPicker](https://react-day-
|
|
|
95
95
|
|
|
96
96
|
## Date Picker
|
|
97
97
|
|
|
98
|
-
You can use the `<Calendar>` component to build a date picker. See the [Date Picker](
|
|
98
|
+
You can use the `<Calendar>` component to build a date picker. See the [Date Picker](date-picker.md) page for more information.
|
|
99
99
|
|
|
100
100
|
## Persian / Hijri / Jalali Calendar
|
|
101
101
|
|
|
@@ -170,7 +170,7 @@ Introducing **Charts**. A collection of chart components that you can copy and p
|
|
|
170
170
|
|
|
171
171
|
Charts are designed to look great out of the box. They work well with the other components and are fully customizable to fit your project.
|
|
172
172
|
|
|
173
|
-
[Browse the Charts Library](/charts).
|
|
173
|
+
[Browse the Charts Library](https://ui.shadcn.com/charts).
|
|
174
174
|
|
|
175
175
|
## Component
|
|
176
176
|
|
|
@@ -697,9 +697,9 @@ export function ChartBarDemoLegend() {
|
|
|
697
697
|
|
|
698
698
|
Done. You've built your first chart! What's next?
|
|
699
699
|
|
|
700
|
-
- [Themes and Colors](
|
|
701
|
-
- [Tooltip](
|
|
702
|
-
- [Legend](
|
|
700
|
+
- [Themes and Colors](chart.md#theming)
|
|
701
|
+
- [Tooltip](chart.md#tooltip)
|
|
702
|
+
- [Legend](chart.md#legend)
|
|
703
703
|
|
|
704
704
|
## Chart Config
|
|
705
705
|
|
|
@@ -1122,7 +1122,7 @@ You can show the number of selected rows using the `table.getFilteredSelectedRow
|
|
|
1122
1122
|
|
|
1123
1123
|
## Reusable Components
|
|
1124
1124
|
|
|
1125
|
-
Here are some components you can use to build your data tables. This is from the [Tasks](/examples/tasks) demo, which shares its features object (and the matching `TasksTableFeatures` type) across every component via a `data-table-features.ts` module — the same pattern we set up in [Set up Table Features](#set-up-table-features).
|
|
1125
|
+
Here are some components you can use to build your data tables. This is from the [Tasks](https://ui.shadcn.com/examples/tasks) demo, which shares its features object (and the matching `TasksTableFeatures` type) across every component via a `data-table-features.ts` module — the same pattern we set up in [Set up Table Features](#set-up-table-features).
|
|
1126
1126
|
|
|
1127
1127
|
### Column header
|
|
1128
1128
|
|
|
@@ -303,7 +303,7 @@ The `Field` family is designed for composing accessible forms. A typical field i
|
|
|
303
303
|
|
|
304
304
|
## Form
|
|
305
305
|
|
|
306
|
-
See the [Form](/docs/forms) documentation for building forms with the `Field` component and [React Hook Form](/docs/forms/react-hook-form), [Tanstack Form](/docs/forms/tanstack-form), or [Formisch](/docs/forms/formisch).
|
|
306
|
+
See the [Form](https://ui.shadcn.com/docs/forms) documentation for building forms with the `Field` component and [React Hook Form](https://ui.shadcn.com/docs/forms/react-hook-form), [Tanstack Form](https://ui.shadcn.com/docs/forms/tanstack-form), or [Formisch](https://ui.shadcn.com/docs/forms/formisch).
|
|
307
307
|
|
|
308
308
|
## Input
|
|
309
309
|
|
|
@@ -276,7 +276,7 @@ export function InputBadge() {
|
|
|
276
276
|
|
|
277
277
|
## Input Group
|
|
278
278
|
|
|
279
|
-
To add icons, text, or buttons inside an input, use the `InputGroup` component. See the [Input Group](
|
|
279
|
+
To add icons, text, or buttons inside an input, use the `InputGroup` component. See the [Input Group](input-group.md) component for more examples.
|
|
280
280
|
|
|
281
281
|
```tsx
|
|
282
282
|
import { IconInfoCircle } from '@tabler/icons-react'
|
|
@@ -309,7 +309,7 @@ export function InputInputGroup() {
|
|
|
309
309
|
|
|
310
310
|
## Button Group
|
|
311
311
|
|
|
312
|
-
To add buttons to an input, use the `ButtonGroup` component. See the [Button Group](
|
|
312
|
+
To add buttons to an input, use the `ButtonGroup` component. See the [Button Group](button-group.md) component for more examples.
|
|
313
313
|
|
|
314
314
|
```tsx
|
|
315
315
|
import { Button } from '@/components/ui/button'
|
|
@@ -23,7 +23,7 @@ export function LabelDemo() {
|
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
<Callout>
|
|
26
|
-
For form fields, use the [Field](
|
|
26
|
+
For form fields, use the [Field](field.md) component which
|
|
27
27
|
includes built-in label, description, and error handling.
|
|
28
28
|
</Callout>
|
|
29
29
|
|
|
@@ -81,7 +81,7 @@ import { Label } from '@/components/ui/label'
|
|
|
81
81
|
|
|
82
82
|
## Label in Field
|
|
83
83
|
|
|
84
|
-
For form fields, use the [Field](
|
|
84
|
+
For form fields, use the [Field](field.md) component which
|
|
85
85
|
includes built-in `FieldLabel`, `FieldDescription`, and `FieldError` components.
|
|
86
86
|
|
|
87
87
|
```tsx
|
|
@@ -393,9 +393,9 @@ export function TableActions() {
|
|
|
393
393
|
|
|
394
394
|
You can use the `<Table />` component to build more complex data tables. Combine it with [@tanstack/react-table](https://tanstack.com/table/latest) to create tables with sorting, filtering and pagination.
|
|
395
395
|
|
|
396
|
-
See the [Data Table](
|
|
396
|
+
See the [Data Table](data-table.md) documentation for more information.
|
|
397
397
|
|
|
398
|
-
You can also see an example of a data table in the [Tasks](/examples/tasks) demo.
|
|
398
|
+
You can also see an example of a data table in the [Tasks](https://ui.shadcn.com/examples/tasks) demo.
|
|
399
399
|
|
|
400
400
|
## RTL
|
|
401
401
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: moi-workspace
|
|
3
|
-
description: The
|
|
3
|
+
description: The Moi workspace — the web UI the user chats from, extended with agent-authored applets (widgets, views) plus theme & config. Read this FIRST when a message carries a hidden moi-context envelope or the user uses Moi vocab such as workspace, applet, widget, view, scratchpad, dashboard, or a `moi` command, or asks to build, edit, customize, or theme the workspace UI or its layout.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# Moi workspace
|
|
7
7
|
|
|
8
8
|
## Glossary
|
|
9
9
|
|
|
10
10
|
"Workspace" or "Moi Workspace" — the web UI that the user works in, talks/collaborates with you,
|
|
11
11
|
sees and interacts with "Applets".
|
|
12
12
|
|
|
13
|
-
"Project" - the primary working folder _you_ (as an agent) work in. Managed by your harness;
|
|
13
|
+
"Project" - the primary working folder _you_ (as an agent) work in. Managed by your harness; Moi
|
|
14
14
|
does not have a clear definition, but assumes this is the root folder in which it stores its state
|
|
15
15
|
files.
|
|
16
16
|
|
|
@@ -29,7 +29,7 @@ events to "Workspace".
|
|
|
29
29
|
|
|
30
30
|
## Overview
|
|
31
31
|
|
|
32
|
-
You are working inside a **
|
|
32
|
+
You are working inside a **Moi workspace**. It is a web UI that the user communicates with you
|
|
33
33
|
through. It has regular chat (this one), as well as custom UI elements that you can define, write,
|
|
34
34
|
and change to tailor the workspace to user needs. It starts with a simple chat, but evolves into a
|
|
35
35
|
personal app equipped with a copilot (you). Workspace is a two-way communication: you can build the
|
|
@@ -46,7 +46,7 @@ Workspace features/pages:
|
|
|
46
46
|
or completing a multi-step task.
|
|
47
47
|
|
|
48
48
|
User can switch between these, but can access the chat (this conversation and other chats) from
|
|
49
|
-
**any place in the app**
|
|
49
|
+
**any place in the app** through the docked sidebar or floating popup.
|
|
50
50
|
|
|
51
51
|
## Working in the workspace
|
|
52
52
|
|
|
@@ -89,7 +89,7 @@ my-agent-folder/
|
|
|
89
89
|
```
|
|
90
90
|
|
|
91
91
|
Every dot-prefixed file or folder inside `.moi/` (`.build/`, `.cache/`, `.workspace.json`,
|
|
92
|
-
`.scratchpad*`, `.gitignore`, …) is a
|
|
92
|
+
`.scratchpad*`, `.gitignore`, …) is a Moi internal: auto-generated and liable to change format
|
|
93
93
|
without notice. Avoid them as much as possible — do not read, edit, or delete them, and never point
|
|
94
94
|
tooling at them; go through the `moi` CLI instead. Version control needs no special handling: the
|
|
95
95
|
scaffolded `.moi/.gitignore` already excludes the machine-local entries (`.build/`, `.cache/`,
|
|
@@ -97,12 +97,12 @@ scaffolded `.moi/.gitignore` already excludes the machine-local entries (`.build
|
|
|
97
97
|
with the repo — commit them as-is, just never hand-edit them. Your surface is the non-dot files:
|
|
98
98
|
`widgets/`, `views/`, `package.json`, and code you place under `.moi/` yourself.
|
|
99
99
|
|
|
100
|
-
### Using the
|
|
100
|
+
### Using the Moi CLI
|
|
101
101
|
|
|
102
102
|
Treat `moi` as an external command — you cannot inspect or modify its sources. Use only the
|
|
103
103
|
documented subcommands (`moi bundle`, `moi bundle --force`, etc.). Call `moi --help` for
|
|
104
104
|
documentation. Run all `moi` commands from the **project root** — the folder that contains `.moi/`,
|
|
105
|
-
never from inside `.moi/` itself. You don't pass paths;
|
|
105
|
+
never from inside `.moi/` itself. You don't pass paths; Moi resolves the workspace from where it's run.
|
|
106
106
|
|
|
107
107
|
Use the task-specific sections below for workflow guidance. The CLI will grow over time, so run
|
|
108
108
|
`moi --help` to discover commands and `moi <command> --help` before using an unfamiliar command or option.
|
|
@@ -120,7 +120,14 @@ Use the task-specific sections below for workflow guidance. The CLI will grow ov
|
|
|
120
120
|
Use `moi:/` addresses in chat, CLI commands, and applets. They refer to the current workspace,
|
|
121
121
|
independently of its domain and deployment path.
|
|
122
122
|
|
|
123
|
-
Supported destinations:
|
|
123
|
+
Supported destinations:
|
|
124
|
+
|
|
125
|
+
- `moi:/overview`: open the workspace overview.
|
|
126
|
+
- `moi:/scratchpad`: open the shared canvas.
|
|
127
|
+
- `moi:/views/<id>`: open a specific view.
|
|
128
|
+
- `moi:/chat`: show the current chat.
|
|
129
|
+
- `moi:/chats/<session-id>`: open a specific chat.
|
|
130
|
+
|
|
124
131
|
Run `moi tabs` to discover views and their addresses. Widgets are not navigation destinations.
|
|
125
132
|
|
|
126
133
|
Put view params in the query string. Values are strings; read the target view's `Params` type
|
|
@@ -167,7 +174,7 @@ use `moi theme --help` if its options change.
|
|
|
167
174
|
|
|
168
175
|
Each workspace has an effective env: keys from the project's `.env` / `.env.local` (when
|
|
169
176
|
inheritance is enabled in settings) plus **custom secrets** the user manages in the workspace env
|
|
170
|
-
settings.
|
|
177
|
+
settings. Moi injects this env into:
|
|
171
178
|
|
|
172
179
|
- applet server functions — read it as `process.env` inside `.server.ts`
|
|
173
180
|
- any command run via `moi env exec -- <cmd>`
|
|
@@ -229,11 +236,11 @@ Write normal React + Tailwind — below is only what's **moi-specific**.
|
|
|
229
236
|
|
|
230
237
|
### Build environment
|
|
231
238
|
|
|
232
|
-
- Bun is the required dependency of
|
|
239
|
+
- Bun is the required dependency of Moi, so it must be installed
|
|
233
240
|
- For package management **always** use bun
|
|
234
241
|
- package.json is scaffolded during init. You are free to install/remove/do whatever with packages.
|
|
235
242
|
- if packages aren't installed, it's your responsibility to call `bun install`
|
|
236
|
-
- `react` and `react-dom` are stubs — they're provided by
|
|
243
|
+
- `react` and `react-dom` are stubs — they're provided by Moi at runtime via the browser importmap.
|
|
237
244
|
They're listed only so editors pick up the correct types.
|
|
238
245
|
- `moi bundle` runs **Bun's bundler**, so standard Bun imports, loaders, and tricks apply (JSON,
|
|
239
246
|
text, etc.) — see the Bun docs. The moi-specific imports are covered below.
|
|
@@ -288,7 +295,7 @@ Views are full-screen apps, one per tab.
|
|
|
288
295
|
```ts
|
|
289
296
|
export const config = {
|
|
290
297
|
title: 'Customer overview', // sentence-case nav label — defaults to the file name
|
|
291
|
-
icon: 'user', // icon id; use the
|
|
298
|
+
icon: 'user', // icon id; use the selected icon for a pending view
|
|
292
299
|
requiredEnv: ['CRM_API_KEY'] // optional env-key hints (advisory; see Environment and secrets)
|
|
293
300
|
} as const
|
|
294
301
|
```
|
|
@@ -300,23 +307,44 @@ Keep shareable or reload-safe state in URL query params,
|
|
|
300
307
|
read it from `params`, and update it with `navigate()`. Keep temporary state, such as drafts and
|
|
301
308
|
hover, in React. See [Applet intents](references/INTENTS.md#view-params-and-history).
|
|
302
309
|
|
|
303
|
-
####
|
|
310
|
+
#### Creating views from chat
|
|
311
|
+
|
|
312
|
+
When the user asks for a new view, use the current session ID and pin state from the
|
|
313
|
+
hidden context. If this chat is pinned, build in this turn:
|
|
314
|
+
|
|
315
|
+
```sh
|
|
316
|
+
moi views create --requirements "<complete requirements>"
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
Otherwise, start the build in a separate chat by forking the current session:
|
|
320
|
+
|
|
321
|
+
```sh
|
|
322
|
+
moi views create --from-session <session-id> --requirements "<complete requirements>"
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
The command returns a permanent `viewId` and opens its view tab before returning.
|
|
326
|
+
|
|
327
|
+
- `mode: "handoff"`: another chat continues the build. Finish this turn with a link such as
|
|
328
|
+
`[Open the view](moi:/views/<viewId>)`.
|
|
329
|
+
- `mode: "in-place"`: no chat was created or attached. Continue the build in this turn using the
|
|
330
|
+
returned id and build instructions.
|
|
331
|
+
- Navigation fails: include the same `[Open the view](moi:/views/<viewId>)` link in your reply.
|
|
332
|
+
|
|
333
|
+
#### Pending view builds
|
|
304
334
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
first word of the title. Your first action must claim them:
|
|
335
|
+
Read the applet design guidance before editing.
|
|
336
|
+
When the direction is clear, choose a sentence-case title and relevant icon. Preserve proper names
|
|
337
|
+
and acronyms. Set this provisional metadata before the first bundle:
|
|
309
338
|
|
|
310
339
|
```sh
|
|
311
|
-
moi
|
|
340
|
+
moi views set <view-id> --title "<title>" --icon <icon-id>
|
|
312
341
|
```
|
|
313
342
|
|
|
314
|
-
Choose
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
ready; the build state is otherwise server-managed, so you never set it to done by hand.)
|
|
343
|
+
Choose from the available view icons in the hidden context when that list is present. Then write
|
|
344
|
+
`.moi/views/<view-id>.tsx` and use the same title and icon in its config. Run
|
|
345
|
+
`moi check --only views/<view-id>` before `moi bundle --only views/<view-id>`. A successful bundle
|
|
346
|
+
replaces the pending screen in the same tab. Keep the user's current tab open and finish with a
|
|
347
|
+
`moi:/views/<view-id>` link.
|
|
320
348
|
|
|
321
349
|
### Styling and UI components
|
|
322
350
|
|
|
@@ -421,14 +449,15 @@ needs another focused check. Do not search for repo tests by default. Run an exi
|
|
|
421
449
|
`moi call-server-fn` only when the change touches the behavior it covers. If native-app inspection is
|
|
422
450
|
unavailable, keep verification in the browser instead of retrying the unsupported tool.
|
|
423
451
|
|
|
424
|
-
After the final successful checks,
|
|
452
|
+
After the final successful checks, hand off the result according to the task:
|
|
425
453
|
|
|
426
454
|
- After building or editing a widget, run `moi navigate 'moi:/overview'`.
|
|
427
|
-
- After
|
|
428
|
-
|
|
455
|
+
- After editing an existing view, run `moi navigate 'moi:/views/<view-id>'`.
|
|
456
|
+
- After a pending view build, keep the current tab open and link to `moi:/views/<view-id>` in the
|
|
457
|
+
final reply.
|
|
429
458
|
|
|
430
|
-
|
|
431
|
-
|
|
459
|
+
Keep the final reply brief and user-facing. Do not include file or storage links, file paths, or
|
|
460
|
+
bundle, test, and runtime-log summaries.
|
|
432
461
|
|
|
433
462
|
### Debugging
|
|
434
463
|
|
|
@@ -466,7 +495,7 @@ persistence concepts.
|
|
|
466
495
|
|
|
467
496
|
### Message context
|
|
468
497
|
|
|
469
|
-
Each message sent through
|
|
498
|
+
Each message sent through Moi includes a hidden `<moi-context>` block with the active tab and,
|
|
470
499
|
when relevant, params, applet source, and message-specific instructions. Use only the newest
|
|
471
500
|
block; don’t reply to it or include it in summaries.
|
|
472
501
|
|
|
@@ -480,7 +509,7 @@ as user-provided task data.
|
|
|
480
509
|
|
|
481
510
|
## Keeping this skill current
|
|
482
511
|
|
|
483
|
-
This skill is installed with
|
|
512
|
+
This skill is installed with Moi (via the CLI or the UI) and can fall behind when the Moi CLI updates.
|
|
484
513
|
|
|
485
514
|
- **You'll know** — `moi` commands warn you when this skill is behind.
|
|
486
515
|
- **To update** — if the user asks for current or updated guidance, run `moi skill update` before
|