moi-computer 0.12.1-next.0 → 0.12.1-next.2
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 +26 -26
- package/bin/moi.mjs +2 -2
- package/client/AGENTS.md +7 -3
- package/client/api/app-config.ts +5 -10
- package/client/api/workspace-keys.ts +3 -2
- package/client/app/app-provider.tsx +25 -0
- 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} +22 -23
- package/client/app/shell/{SidebarLayout.tsx → sidebar-layout.tsx} +29 -23
- package/client/dev/index.html +43 -0
- package/client/dev/index.ts +15 -0
- package/client/features/applets/api.ts +1 -1
- package/client/features/applets/{AppletContainer.tsx → applet-container.tsx} +1 -1
- 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 +4 -4
- package/client/features/chat/{ChatPanel.tsx → chat-panel.tsx} +11 -11
- package/client/features/chat/{ChatPopup.tsx → chat-popup.tsx} +1 -1
- 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} +8 -7
- package/client/features/chat/composer/{ModelPicker.tsx → model-picker.tsx} +1 -1
- package/client/features/chat/composer/{useWorkspaceComposerState.tsx → use-workspace-composer-state.tsx} +12 -28
- package/client/features/chat/composer/{useWorkspaceSkillUpdates.ts → use-workspace-skill-updates.ts} +1 -1
- package/client/features/chat/connection/chat-frames.ts +3 -3
- package/client/features/chat/messages/{ChatEmptyState.tsx → chat-empty-state.tsx} +4 -4
- package/client/features/chat/messages/{MarkdownContent.tsx → markdown-content.tsx} +1 -1
- 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 +3 -3
- package/client/features/chat/sessions/{ChatSelector.tsx → chat-selector.tsx} +2 -2
- package/client/features/chat/sessions/{useSelectedSession.ts → use-selected-session.ts} +2 -2
- package/client/features/chat/{useChat.ts → use-chat.ts} +4 -4
- package/client/features/collab/host-state.ts +24 -7
- package/client/features/collab/local-user.ts +1 -1
- package/client/features/collab/proxy-user.ts +4 -9
- 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} +26 -80
- 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 +253 -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/{useViewSketch.ts → use-view-sketch.ts} +1 -1
- package/client/features/harness/api.ts +36 -0
- package/client/features/harness/device-login-steps.tsx +97 -0
- package/client/features/home/api.ts +29 -89
- package/client/features/home/{HomeLogo.tsx → home-logo.tsx} +1 -1
- package/client/features/home/{HomePage.tsx → home-page.tsx} +13 -14
- package/client/features/overview/api.ts +2 -2
- package/client/features/overview/default/registry.tsx +1 -1
- package/client/features/overview/default/{ViewsWidget.tsx → views-widget.tsx} +1 -1
- package/client/features/overview/{HiddenPanel.tsx → hidden-panel.tsx} +2 -2
- package/client/features/overview/{Overview.tsx → overview.tsx} +6 -6
- 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} +10 -13
- package/client/features/scratchpad/{useScratchpadSnapshot.tsx → use-scratchpad-snapshot.tsx} +3 -3
- package/client/features/settings/api.ts +15 -9
- 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 +1 -1
- package/client/features/views/{PendingViewScreen.tsx → pending-view-screen.tsx} +7 -4
- package/client/features/views/{useViewActions.ts → use-view-actions.ts} +2 -2
- package/client/features/views/{useViewDrafts.ts → use-view-drafts.ts} +15 -6
- package/client/features/views/{ViewManager.tsx → view-manager.tsx} +3 -3
- package/client/features/views/view-submission.ts +1 -1
- 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 +31 -26
- package/client/features/workspace/browser-tab-state.ts +1 -1
- package/client/features/workspace/moi-context.ts +1 -1
- 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 +78 -0
- package/client/features/workspace/setup/workspace-welcome-state.tsx +81 -0
- package/client/features/workspace/{ThemePanel.tsx → theme-panel.tsx} +3 -3
- package/client/features/workspace/{useWorkspaceNavigation.ts → use-workspace-navigation.ts} +2 -2
- package/client/features/workspace/{WorkspaceScreen.tsx → workspace-content.tsx} +37 -80
- package/client/features/workspace/workspace-frame.tsx +76 -0
- package/client/features/workspace/workspace-identity.tsx +40 -0
- package/client/features/workspace/{WorkspaceLayoutContext.tsx → workspace-layout-context.tsx} +2 -0
- package/client/features/workspace/{WorkspaceMenu.tsx → workspace-menu.tsx} +3 -3
- package/client/features/workspace/workspace-pending-screen.tsx +26 -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 +29 -10
- package/client/index.tsx +7 -2
- package/client/lib/agent-availability.ts +0 -5
- package/client/lib/browser-tab-id.ts +4 -0
- package/client/main.tsx +10 -7
- package/client/runtime/app-context.ts +20 -0
- package/client/runtime/use-workspace-events.ts +56 -0
- package/client/runtime/workspace-events.ts +151 -0
- package/dist/chunk-00rh9df4.js +2 -0
- package/dist/chunk-4nh7y1hq.css +1 -0
- package/dist/{chunk-vqpkqtdr.js → chunk-am4agx6v.js} +1 -1
- package/dist/{chunk-gps4qc38.js → chunk-d7cbm65e.js} +1 -1
- package/dist/chunk-hbpdv7vd.js +1 -0
- package/dist/chunk-hmka9rt5.js +2 -0
- package/dist/{chunk-j905va8r.js → chunk-hvh9f5h0.js} +1 -1
- package/dist/chunk-mjjregkn.js +10 -0
- package/dist/chunk-rt30jbcm.js +1 -0
- package/dist/chunk-vt6zybej.js +2 -0
- package/dist/chunk-wbkwf6cc.js +68 -0
- package/dist/chunk-xjyfyz64.js +1 -0
- package/dist/{chunk-hzwr8dp8.js → chunk-y8nbwp21.js} +71 -71
- package/dist/chunk-ysfdcew7.js +1 -0
- package/dist/index.html +30 -11
- package/lib/format.ts +1 -1
- package/lib/harness-instructions.ts +30 -0
- package/lib/ids.ts +3 -3
- package/lib/moi-context.ts +2 -2
- package/lib/scratchpad-skew.ts +3 -3
- package/lib/types.ts +28 -20
- package/lib/update.ts +1 -1
- package/package.json +5 -2
- package/server/AGENTS.md +10 -4
- package/server/README.md +102 -0
- package/server/api/harnesses.ts +56 -0
- package/server/{api.ts → api/index.ts} +125 -118
- package/server/app-config.ts +24 -12
- 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 +1 -1
- 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} +2 -2
- package/server/applets/index.ts +2 -2
- package/server/{thumbnails.ts → applets/thumbnails.ts} +9 -6
- package/server/{applet-typecheck.ts → applets/typecheck.ts} +4 -4
- package/server/{ui-components.ts → applets/ui-components.ts} +2 -2
- package/server/{views.ts → applets/views.ts} +7 -7
- 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} +9 -9
- 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 -3252
- package/server/collab/manager.ts +3 -3
- package/server/collab/skill/index.ts +2 -2
- package/server/control.ts +20 -20
- package/server/harness/README.md +47 -25
- package/server/harness/acp/NOTES.md +11 -11
- package/server/harness/acp/archived.ts +3 -3
- package/server/harness/acp/client.ts +2 -2
- package/server/harness/acp/run-durations.ts +1 -1
- package/server/harness/acp/session.ts +5 -5
- package/server/harness/auth.ts +303 -0
- package/server/harness/claude-code/NOTES.md +9 -7
- package/server/harness/claude-code/auth.ts +125 -17
- package/server/harness/claude-code/index.ts +2 -1
- package/server/harness/claude-code/mcp.ts +1 -1
- package/server/harness/claude-code/session.ts +10 -7
- package/server/harness/codex/NOTES.md +12 -12
- package/server/harness/codex/auth.ts +86 -19
- package/server/harness/codex/client.ts +17 -13
- package/server/harness/codex/index.ts +2 -1
- package/server/harness/codex/permissions.ts +3 -3
- package/server/harness/codex/probe.ts +3 -5
- package/server/harness/codex/session.ts +16 -13
- package/server/harness/codex/thread-list.ts +4 -0
- package/server/harness/codex/transport.ts +5 -5
- package/server/harness/executable.ts +42 -18
- 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 +1 -1
- package/server/harness/openclaw/compat.ts +1 -1
- package/server/harness/openclaw/session.ts +5 -2
- package/server/harness/registry.ts +1 -1
- package/server/harness/shell-path.ts +31 -21
- package/server/harness/types.ts +9 -2
- 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 +2 -2
- package/server/{session-archive.ts → sessions/archive.ts} +5 -5
- package/server/{attachment-message.ts → sessions/attachment-message.ts} +1 -1
- package/server/{session-config.ts → sessions/config.ts} +1 -1
- package/server/{session-lifecycle.ts → sessions/lifecycle.ts} +3 -3
- package/server/{pending-views.ts → sessions/pending-views.ts} +3 -3
- package/server/{selected-session.ts → sessions/selected.ts} +1 -1
- package/server/{session-store.ts → sessions/store.ts} +1 -1
- package/server/{view-sessions.ts → sessions/view-sessions.ts} +9 -9
- 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 +5 -3
- package/server/status.ts +3 -3
- package/server/vendor.ts +23 -30
- package/server/web.ts +17 -9
- package/server/{env-apply.ts → workspaces/env-apply.ts} +5 -5
- package/server/{workspace-env.ts → workspaces/env.ts} +3 -3
- package/server/{workspace-import.ts → workspaces/import.ts} +4 -4
- package/server/{workspace-init.ts → workspaces/init.ts} +5 -5
- package/server/{layout.ts → workspaces/layout.ts} +13 -8
- package/server/{preview.ts → workspaces/preview.ts} +1 -1
- package/server/{registry.ts → workspaces/registry.ts} +3 -3
- package/server/{required-env.ts → workspaces/required-env.ts} +3 -3
- package/server/{moi-scaffold.ts → workspaces/scaffold.ts} +3 -3
- 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 +12 -12
- package/workspace/.claude/skills/moi-workspace/references/COLLAB.md +2 -2
- 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/composer/banners/AgentAvailabilityBanner.tsx +0 -101
- package/client/features/home/workspace-setup/ImportWorkspaceDialog.tsx +0 -92
- package/client/features/overview/WorkspaceName.tsx +0 -60
- package/client/runtime/useWorkspaceEvents.ts +0 -189
- package/dist/chunk-1zhnhy00.js +0 -1
- package/dist/chunk-27501vke.js +0 -1
- package/dist/chunk-9xtv6djt.js +0 -2
- package/dist/chunk-am1x230f.js +0 -2
- package/dist/chunk-darpsw65.js +0 -1
- package/dist/chunk-n33w9y38.js +0 -10
- package/dist/chunk-r63ks44z.js +0 -68
- package/dist/chunk-wd46nk26.css +0 -1
- package/dist/chunk-xgt7vxt9.js +0 -1
- package/dist/chunk-yvzhwtfa.js +0 -2
- package/server/agent.ts +0 -223
- /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/vendor/react/{development → 19.2.4/development}/_impl/react-dom-client.js +0 -0
- /package/client/vendor/react/{development → 19.2.4/development}/_impl/react-dom.js +0 -0
- /package/client/vendor/react/{development → 19.2.4/development}/_impl/react-jsx-dev-runtime.js +0 -0
- /package/client/vendor/react/{development → 19.2.4/development}/_impl/react-jsx-runtime.js +0 -0
- /package/client/vendor/react/{development → 19.2.4/development}/_impl/react.js +0 -0
- /package/client/vendor/react/{development → 19.2.4/development}/react-dom-client.js +0 -0
- /package/client/vendor/react/{development → 19.2.4/development}/react-dom.js +0 -0
- /package/client/vendor/react/{development → 19.2.4/development}/react-jsx-dev-runtime.js +0 -0
- /package/client/vendor/react/{development → 19.2.4/development}/react-jsx-runtime.js +0 -0
- /package/client/vendor/react/{development → 19.2.4/development}/react.js +0 -0
- /package/client/vendor/react/{production → 19.2.4/production}/_impl/react-dom-client.js +0 -0
- /package/client/vendor/react/{production → 19.2.4/production}/_impl/react-dom.js +0 -0
- /package/client/vendor/react/{production → 19.2.4/production}/_impl/react-jsx-dev-runtime.js +0 -0
- /package/client/vendor/react/{production → 19.2.4/production}/_impl/react-jsx-runtime.js +0 -0
- /package/client/vendor/react/{production → 19.2.4/production}/_impl/react.js +0 -0
- /package/client/vendor/react/{production → 19.2.4/production}/react-dom-client.js +0 -0
- /package/client/vendor/react/{production → 19.2.4/production}/react-dom.js +0 -0
- /package/client/vendor/react/{production → 19.2.4/production}/react-jsx-dev-runtime.js +0 -0
- /package/client/vendor/react/{production → 19.2.4/production}/react-jsx-runtime.js +0 -0
- /package/client/vendor/react/{production → 19.2.4/production}/react.js +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/{tabs.ts → workspaces/tabs.ts} +0 -0
- /package/server/{theme.ts → workspaces/theme.ts} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { mkdir, rename } from 'node:fs/promises'
|
|
2
2
|
import { join } from 'path'
|
|
3
3
|
|
|
4
|
-
import { DATA_DIR } from '
|
|
4
|
+
import { DATA_DIR } from '../data-dir'
|
|
5
5
|
import type { WorkspaceSessionSelection, WorkspaceTabId } from '@/lib/types'
|
|
6
6
|
import { isWorkspaceTabId } from '@/lib/workspace-tabs'
|
|
7
7
|
|
|
@@ -7,7 +7,7 @@ import type {
|
|
|
7
7
|
SessionInfo,
|
|
8
8
|
SessionSummary
|
|
9
9
|
} from '@/lib/types'
|
|
10
|
-
import { DATA_DIR } from '
|
|
10
|
+
import { DATA_DIR } from '../data-dir'
|
|
11
11
|
|
|
12
12
|
type Store = Record<string, Record<string, SessionRecord>>
|
|
13
13
|
export const DEFAULT_SESSION_STORE_PATH = join(DATA_DIR, 'sessions.json')
|
|
@@ -2,15 +2,15 @@ import { APP_ICON_IDS } from '@/lib/app-icons'
|
|
|
2
2
|
import { viewBuildDirectives } from '@/lib/view-build-directives'
|
|
3
3
|
import { viewIdFromTab, viewTabId } from '@/lib/workspace-tabs'
|
|
4
4
|
import type { PendingView, SelectedSessionScope, WorkspaceEntry, WorkspaceTabId } from '@/lib/types'
|
|
5
|
-
import { getCollabReferencePath } from '
|
|
6
|
-
import { harnessFor } from '
|
|
7
|
-
import type { SendMessageInput } from '
|
|
8
|
-
import { ForkUnsupportedError, inheritedHistoryBoundary } from '
|
|
9
|
-
import { publishEvent } from '
|
|
10
|
-
import { broadcast } from '
|
|
11
|
-
import { getPinnedSession, saveSelectedSession, resolveRenamedSession } from './selected
|
|
12
|
-
import { getSessionRecord, patchSessionRecord } from './
|
|
13
|
-
import { getSessionConfig, saveSessionConfig } from './
|
|
5
|
+
import { getCollabReferencePath } from '../collab/config'
|
|
6
|
+
import { harnessFor } from '../harness/registry'
|
|
7
|
+
import type { SendMessageInput } from '../harness/types'
|
|
8
|
+
import { ForkUnsupportedError, inheritedHistoryBoundary } from '../harness/fork'
|
|
9
|
+
import { publishEvent } from '../events'
|
|
10
|
+
import { broadcast } from '../state'
|
|
11
|
+
import { getPinnedSession, saveSelectedSession, resolveRenamedSession } from './selected'
|
|
12
|
+
import { getSessionRecord, patchSessionRecord } from './store'
|
|
13
|
+
import { getSessionConfig, saveSessionConfig } from './config'
|
|
14
14
|
import {
|
|
15
15
|
beginViewBuild,
|
|
16
16
|
createPendingView,
|
|
@@ -7,7 +7,7 @@ import { join } from 'node:path'
|
|
|
7
7
|
|
|
8
8
|
// Source directory for shipped templates. Resolved relative to this file so
|
|
9
9
|
// symlinked CLI binaries still find the source tree.
|
|
10
|
-
export const TEMPLATE_DIR = join(import.meta.dir, '..', 'workspace')
|
|
10
|
+
export const TEMPLATE_DIR = join(import.meta.dir, '..', '..', 'workspace')
|
|
11
11
|
|
|
12
12
|
// The folder holding the skill packages this CLI ships. Each subdirectory is
|
|
13
13
|
// one skill (e.g. `moi-workspace/`) with its own `SKILL.md`. Source of truth
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { WorkspaceSkillsStatus, WorkspaceSkillStatus, WorkspaceType } from '@/lib/types'
|
|
2
2
|
|
|
3
|
-
import type { AppletDeclarationFile } from '
|
|
4
|
-
import { syncAppletDeclarations } from '
|
|
5
|
-
import { isBehind, skillStatuses } from './
|
|
6
|
-
import { installBundledSkills } from './
|
|
7
|
-
import { skillsDirFor } from '
|
|
3
|
+
import type { AppletDeclarationFile } from '../applets/declarations'
|
|
4
|
+
import { syncAppletDeclarations } from '../applets/declarations'
|
|
5
|
+
import { isBehind, skillStatuses } from './version'
|
|
6
|
+
import { installBundledSkills } from './template'
|
|
7
|
+
import { skillsDirFor } from '../workspaces/init'
|
|
8
8
|
|
|
9
9
|
export type WorkspaceSkillUpdateResult = {
|
|
10
10
|
before: WorkspaceSkillStatus[]
|
|
@@ -6,9 +6,9 @@ import { join } from 'node:path'
|
|
|
6
6
|
|
|
7
7
|
import type { WorkspaceSkillStatus, WorkspaceType } from '@/lib/types'
|
|
8
8
|
|
|
9
|
-
import { findWorkspaceForPath, liftToWorkspaceRoot, listWorkspaces } from '
|
|
10
|
-
import { BUNDLED_SKILLS_DIR } from './
|
|
11
|
-
import { skillsDirFor } from '
|
|
9
|
+
import { findWorkspaceForPath, liftToWorkspaceRoot, listWorkspaces } from '../workspaces/registry'
|
|
10
|
+
import { BUNDLED_SKILLS_DIR } from './template'
|
|
11
|
+
import { skillsDirFor } from '../workspaces/init'
|
|
12
12
|
|
|
13
13
|
// The version is stamped as a self-contained marker in SKILL.md, e.g.
|
|
14
14
|
// `<moi-skill version="0.1.0" />`, rather than in YAML frontmatter. SKILL.md
|
|
@@ -127,7 +127,7 @@ export async function staleSkillNotice(cwd: string): Promise<string | null> {
|
|
|
127
127
|
)
|
|
128
128
|
if (stale.length === 0) return null
|
|
129
129
|
const parts = stale.map(s => `${s.name} (${s.installed ?? 'none'} → ${s.bundled})`)
|
|
130
|
-
return `⚠
|
|
130
|
+
return `⚠ Moi skill outdated: ${parts.join(', ')} — run \`moi skill update\` to refresh.`
|
|
131
131
|
} catch {
|
|
132
132
|
return null
|
|
133
133
|
}
|
package/server/static.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { join } from 'node:path'
|
|
|
7
7
|
// install tree. In dev there is no `dist/`, so web.ts falls back to the
|
|
8
8
|
// imported HTML route + Bun.serve's live bundler (HMR). `import.meta.dir` is
|
|
9
9
|
// server/, so `dist/` sits one level up. The Hono API serves files from here
|
|
10
|
-
// via `serveStatic` (see api.ts).
|
|
10
|
+
// via `serveStatic` (see api/index.ts).
|
|
11
11
|
export const DIST_DIR = join(import.meta.dir, '..', 'dist')
|
|
12
12
|
const DIST_INDEX = join(DIST_DIR, 'index.html')
|
|
13
13
|
|
|
@@ -17,7 +17,9 @@ const DIST_INDEX = join(DIST_DIR, 'index.html')
|
|
|
17
17
|
export const prebuilt = !process.env.MOI_DEV && existsSync(DIST_INDEX)
|
|
18
18
|
|
|
19
19
|
// The prebuilt SPA shell, served for client-side routes in production. In dev,
|
|
20
|
-
// web.ts uses the live-bundled HTML import instead (for HMR).
|
|
20
|
+
// web.ts uses the live-bundled HTML import instead (for HMR). `no-cache`: the
|
|
21
|
+
// shell is the one unhashed document — it names the hashed chunks and the
|
|
22
|
+
// versioned React, which are cached for good, so it must be revalidated itself.
|
|
21
23
|
export function distShell(): Response {
|
|
22
|
-
return new Response(Bun.file(DIST_INDEX))
|
|
24
|
+
return new Response(Bun.file(DIST_INDEX), { headers: { 'Cache-Control': 'no-cache' } })
|
|
23
25
|
}
|
package/server/status.ts
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
import { getAppConfig } from './app-config'
|
|
9
9
|
import { CONTROL_PORT, PORT } from './constants'
|
|
10
10
|
import { debugEnabled } from './debug'
|
|
11
|
-
import { WORKER_LIMITS, type WorkerDebugInfo, getWorkersDebugSnapshot } from './functions'
|
|
11
|
+
import { WORKER_LIMITS, type WorkerDebugInfo, getWorkersDebugSnapshot } from './applets/functions'
|
|
12
12
|
import { allHarnesses } from './harness/registry'
|
|
13
|
-
import { tildify } from './registry'
|
|
13
|
+
import { tildify } from './workspaces/registry'
|
|
14
14
|
import { getClientCount } from './state'
|
|
15
15
|
import { VERSION } from './version'
|
|
16
16
|
|
|
@@ -69,7 +69,7 @@ export function renderStatus(): string {
|
|
|
69
69
|
const now = Date.now()
|
|
70
70
|
|
|
71
71
|
const lines: string[] = []
|
|
72
|
-
lines.push('
|
|
72
|
+
lines.push('Moi server status')
|
|
73
73
|
lines.push('=================')
|
|
74
74
|
lines.push('')
|
|
75
75
|
lines.push(`version ${VERSION}${process.env.MOI_SERVICE ? ' (service-managed)' : ''}`)
|
package/server/vendor.ts
CHANGED
|
@@ -1,48 +1,41 @@
|
|
|
1
|
-
// Serves the locally-vendored React ESM (client/vendor/react
|
|
2
|
-
// scripts/build-vendor.ts) behind the
|
|
3
|
-
// importmap in client/index.html
|
|
4
|
-
// — no esm.sh fetch.
|
|
1
|
+
// Serves the locally-vendored React ESM (client/vendor/react/<version>,
|
|
2
|
+
// generated by scripts/build-vendor.ts) behind the
|
|
3
|
+
// `/vendor/react/<version>/<mode>/*` URLs the importmap in client/index.html
|
|
4
|
+
// points at. This is what makes moi run offline — no esm.sh fetch.
|
|
5
5
|
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
// production
|
|
9
|
-
//
|
|
6
|
+
// Both the version and the build mode are in the URL, which is what makes the
|
|
7
|
+
// files safe to cache forever: a React bump moves the URL, and the development
|
|
8
|
+
// and production builds (different bytes — prod's jsx-dev-runtime has no
|
|
9
|
+
// `jsxDEV`) never share one, so a prebuilt `moi` and `bun run dev` on the same
|
|
10
|
+
// port cannot poison each other's cache. The source HTML names the development
|
|
11
|
+
// build; scripts/build-client.ts switches it to production in `dist/`.
|
|
12
|
+
// `client/` ships in the published package (see package.json `files`), so this
|
|
13
|
+
// resolves in a global install too.
|
|
10
14
|
import { join } from 'node:path'
|
|
11
15
|
|
|
12
|
-
import { prebuilt } from './static'
|
|
13
|
-
|
|
14
16
|
const VENDOR_DIR = join(import.meta.dir, '..', 'client', 'vendor', 'react')
|
|
15
17
|
const EMOJIBASE_DIR = join(import.meta.dir, '..', 'client', 'vendor', 'emojibase')
|
|
16
|
-
const MODE = prebuilt ? 'production' : 'development'
|
|
17
18
|
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
|
|
19
|
+
// `<version>/<mode>/<file>`: a version folder, the build mode, then a single
|
|
20
|
+
// flat file (`react.js`) or one nested under `_impl/` — all `.js`, no
|
|
21
|
+
// traversal. Matches exactly the layout build-vendor.ts emits.
|
|
22
|
+
const ALLOWED = /^\d[\w.-]*\/(development|production)\/(_impl\/)?[a-zA-Z0-9_-]+\.js$/
|
|
21
23
|
|
|
22
24
|
export async function serveVendorReact(req: Request): Promise<Response> {
|
|
23
25
|
const rel = new URL(req.url).pathname.replace(/^\/vendor\/react\//, '')
|
|
24
26
|
if (!ALLOWED.test(rel) || rel.includes('..')) {
|
|
25
27
|
return new Response('Not found', { status: 404 })
|
|
26
28
|
}
|
|
27
|
-
const file = Bun.file(join(VENDOR_DIR,
|
|
29
|
+
const file = Bun.file(join(VENDOR_DIR, rel))
|
|
28
30
|
if (!(await file.exists())) {
|
|
29
31
|
return new Response('Not found', { status: 404 })
|
|
30
32
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const headers = {
|
|
38
|
-
'Content-Type': 'text/javascript; charset=utf-8',
|
|
39
|
-
'Cache-Control': 'no-cache',
|
|
40
|
-
ETag: etag
|
|
41
|
-
}
|
|
42
|
-
if (req.headers.get('if-none-match') === etag) {
|
|
43
|
-
return new Response(null, { status: 304, headers })
|
|
44
|
-
}
|
|
45
|
-
return new Response(file, { headers })
|
|
33
|
+
return new Response(file, {
|
|
34
|
+
headers: {
|
|
35
|
+
'Content-Type': 'text/javascript; charset=utf-8',
|
|
36
|
+
'Cache-Control': 'public, max-age=31536000, immutable'
|
|
37
|
+
}
|
|
38
|
+
})
|
|
46
39
|
}
|
|
47
40
|
|
|
48
41
|
// `<locale>/<file>.json` only — mirrors the emojibase-data package layout the
|
package/server/web.ts
CHANGED
|
@@ -6,9 +6,11 @@ import { isMoiContext } from '@/lib/moi-context'
|
|
|
6
6
|
import { rm } from 'node:fs/promises'
|
|
7
7
|
|
|
8
8
|
import index from '../client/index.html'
|
|
9
|
+
import devSandbox from '../client/dev/index.html'
|
|
9
10
|
import { api } from './api'
|
|
10
11
|
import { getAppConfig } from './app-config'
|
|
11
|
-
import {
|
|
12
|
+
import { harnessStore } from './harness/auth'
|
|
13
|
+
import { AttachmentUploadError } from './sessions/attachment-message'
|
|
12
14
|
import { PORT } from './constants'
|
|
13
15
|
import { control } from './control'
|
|
14
16
|
import { proxyUserState } from './collab/cloudflare-access'
|
|
@@ -16,14 +18,14 @@ import { isCollabEnabled } from './collab/config'
|
|
|
16
18
|
import { collabManager } from './collab/manager'
|
|
17
19
|
import { EVENTS_TOPIC, setEventServer } from './events'
|
|
18
20
|
import { killBuildWorkers } from './applets/build-worker'
|
|
19
|
-
import { killAllWorkers } from './functions'
|
|
20
|
-
import { startScratchpadSweeper } from './scratchpad'
|
|
21
|
+
import { killAllWorkers } from './applets/functions'
|
|
22
|
+
import { startScratchpadSweeper } from './scratchpad/document'
|
|
21
23
|
import { navigationRelay } from './navigation-relay'
|
|
22
|
-
import { resolveScratchOp } from './scratchpad
|
|
24
|
+
import { resolveScratchOp } from './scratchpad/relay'
|
|
23
25
|
import { allHarnesses, harnessFor } from './harness/registry'
|
|
24
|
-
import { getWorkspace, listWorkspaces } from './registry'
|
|
25
|
-
import { failInterruptedViewStarts, sendWorkspaceMessage } from './view-sessions'
|
|
26
|
-
import { PendingViewError } from './pending-views'
|
|
26
|
+
import { getWorkspace, listWorkspaces } from './workspaces/registry'
|
|
27
|
+
import { failInterruptedViewStarts, sendWorkspaceMessage } from './sessions/view-sessions'
|
|
28
|
+
import { PendingViewError } from './sessions/pending-views'
|
|
27
29
|
import {
|
|
28
30
|
addClient,
|
|
29
31
|
broadcast,
|
|
@@ -138,8 +140,9 @@ export const app = Bun.serve<WsData>({
|
|
|
138
140
|
headers: { 'Content-Type': 'text/plain; charset=utf-8', 'Cache-Control': 'no-store' }
|
|
139
141
|
}),
|
|
140
142
|
|
|
141
|
-
// Locally-vendored React ESM (offline; no CDN)
|
|
142
|
-
//
|
|
143
|
+
// Locally-vendored React ESM (offline; no CDN), under a versioned path so
|
|
144
|
+
// production can cache it for good. The importmap in client/index.html
|
|
145
|
+
// points here; the handler picks dev/prod per env.
|
|
143
146
|
'/vendor/react/*': (req: Request) => serveVendorReact(req),
|
|
144
147
|
|
|
145
148
|
// Vendored emojibase-data for the settings emoji picker (offline; no CDN).
|
|
@@ -149,6 +152,10 @@ export const app = Bun.serve<WsData>({
|
|
|
149
152
|
'/': shell,
|
|
150
153
|
'/dev': shell,
|
|
151
154
|
'/dev/*': shell,
|
|
155
|
+
// Isolated sandboxes bypass app startup and share the client/dev entry point.
|
|
156
|
+
'/dev/workspace-setup/preview': prebuilt
|
|
157
|
+
? new Response('Not found', { status: 404 })
|
|
158
|
+
: devSandbox,
|
|
152
159
|
'/workspace/*': shell,
|
|
153
160
|
|
|
154
161
|
// Chat websocket — app-wide (one per client, not per workspace). Each chat
|
|
@@ -304,6 +311,7 @@ async function shutdown() {
|
|
|
304
311
|
try {
|
|
305
312
|
control.stop(true)
|
|
306
313
|
} catch {}
|
|
314
|
+
harnessStore.shutdown()
|
|
307
315
|
for (const h of allHarnesses()) h.shutdown?.()
|
|
308
316
|
killAllWorkers()
|
|
309
317
|
killBuildWorkers()
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
// relayed over the control port — the workspace's processes must be reaped and
|
|
4
4
|
// every connected client told to refetch. Both entry points call this so the
|
|
5
5
|
// side effects can never drift apart.
|
|
6
|
-
import {
|
|
7
|
-
import { publishEvent } from '
|
|
8
|
-
import { restartWorker } from '
|
|
9
|
-
import { allHarnesses } from '
|
|
6
|
+
import { harnessStore } from '../harness/auth'
|
|
7
|
+
import { publishEvent } from '../events'
|
|
8
|
+
import { restartWorker } from '../applets/functions'
|
|
9
|
+
import { allHarnesses } from '../harness/registry'
|
|
10
10
|
|
|
11
11
|
export function applyEnvChanged(workspace: { id: string; path: string }): void {
|
|
12
12
|
// Kill the cached widget worker (next RPC respawns with fresh env) and tear
|
|
@@ -15,6 +15,6 @@ export function applyEnvChanged(workspace: { id: string; path: string }): void {
|
|
|
15
15
|
for (const h of allHarnesses()) h.onEnvChanged?.(workspace.path)
|
|
16
16
|
// Env can carry credentials (ANTHROPIC_API_KEY, provider config) — drop the
|
|
17
17
|
// cached availability so the next agent snapshot re-probes.
|
|
18
|
-
|
|
18
|
+
harnessStore.invalidate(workspace)
|
|
19
19
|
publishEvent({ type: 'env:updated', workspaceId: workspace.id })
|
|
20
20
|
}
|
|
@@ -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 }
|
|
@@ -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,10 +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 { getAppConfig } from '
|
|
14
|
-
import { harnessFor } from '
|
|
15
|
-
import { createDependencyInstallLogPath, scaffoldMoiDir } from './
|
|
16
|
-
import { installBundledSkills } from '
|
|
13
|
+
import { getAppConfig } from '../app-config'
|
|
14
|
+
import { harnessFor } from '../harness/registry'
|
|
15
|
+
import { createDependencyInstallLogPath, scaffoldMoiDir } from './scaffold'
|
|
16
|
+
import { installBundledSkills } from '../skills/template'
|
|
17
17
|
|
|
18
18
|
// Where each backend loads skills from — the harness owns the answer
|
|
19
19
|
// (Claude Code: `.claude/skills/`; OpenClaw: `<workspace>/skills/`; Codex:
|
|
@@ -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
|
|
@@ -100,7 +100,8 @@ export type WorkspacePreviewOptions = {
|
|
|
100
100
|
viewIds?: readonly string[]
|
|
101
101
|
// Maps a captured applet to the image URL the home card should render —
|
|
102
102
|
// the API layer owns the route shape (GET .../applet-thumbnails/:kind/:id).
|
|
103
|
-
|
|
103
|
+
// `version` changes with every capture, so the URL can be cached forever.
|
|
104
|
+
thumbnailUrl: (kind: AppletKind, id: string, version: string) => string
|
|
104
105
|
}
|
|
105
106
|
|
|
106
107
|
export async function getWorkspacePreview(
|
|
@@ -111,17 +112,21 @@ export async function getWorkspacePreview(
|
|
|
111
112
|
const layout = await loadLayout(workspacePath)
|
|
112
113
|
const captured = await getCapturedThumbnails(workspacePath)
|
|
113
114
|
const validViewIds = new Set(viewIds)
|
|
114
|
-
const capturedWidgets = new
|
|
115
|
-
captured
|
|
115
|
+
const capturedWidgets = new Map(
|
|
116
|
+
captured
|
|
117
|
+
.filter(record => record.kind === 'widget')
|
|
118
|
+
.map(record => [record.id, record.capturedAt])
|
|
116
119
|
)
|
|
117
120
|
const widgetImages = [...layout.widgetGrid]
|
|
118
121
|
.sort((a, b) => a.y - b.y || a.x - b.x)
|
|
119
|
-
.
|
|
120
|
-
|
|
122
|
+
.flatMap(item => {
|
|
123
|
+
const version = capturedWidgets.get(item.i)
|
|
124
|
+
return version === undefined ? [] : [thumbnailUrl('widget', item.i, version)]
|
|
125
|
+
})
|
|
121
126
|
const viewImages = captured
|
|
122
127
|
.filter(record => record.kind === 'view' && validViewIds.has(record.id))
|
|
123
128
|
.sort((a, b) => Date.parse(b.viewedAt) - Date.parse(a.viewedAt))
|
|
124
|
-
.map(record => thumbnailUrl('view', record.id))
|
|
129
|
+
.map(record => thumbnailUrl('view', record.id, record.capturedAt))
|
|
125
130
|
const thumbnails = [...widgetImages, ...viewImages].slice(0, PREVIEW_LIMIT)
|
|
126
131
|
// The message bubble is the card's fallback for "nothing to show": gate on
|
|
127
132
|
// captured thumbnails, not grid emptiness — a workspace with widgets that
|
|
@@ -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.
|
|
@@ -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`.
|
|
@@ -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,8 +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 { agentCommand } from '
|
|
10
|
-
import { syncAppletDeclarations } from '
|
|
9
|
+
import { agentCommand } from '../agent-launcher'
|
|
10
|
+
import { syncAppletDeclarations } from '../applets/declarations'
|
|
11
11
|
|
|
12
12
|
// Dependency set available to widgets. `react`/`react-dom` are stubs — at
|
|
13
13
|
// runtime they resolve to moi's locally-vendored ESM via the browser importmap
|
|
@@ -95,7 +95,7 @@ async function runBunInstall(moiDir: string, logPath: string): Promise<number> {
|
|
|
95
95
|
// package.json, and lockfile stay committable — they ARE the workspace.
|
|
96
96
|
const REQUIRED_IGNORES = ['.build/', '.cache/', 'node_modules/'] as const
|
|
97
97
|
|
|
98
|
-
export const MOI_GITIGNORE = `#
|
|
98
|
+
export const MOI_GITIGNORE = `# Moi internals — machine-local, re-creatable state
|
|
99
99
|
${REQUIRED_IGNORES.join('\n')}
|
|
100
100
|
`
|
|
101
101
|
|
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
|