moi-computer 0.13.1-next.4 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/moi.mjs +10 -6
- package/dist/{chunk-k32585ne.js → chunk-828s864r.js} +61 -61
- package/dist/chunk-9ffaaaw3.css +1 -0
- package/dist/chunk-gh11h6dc.js +2 -0
- package/dist/chunk-hhgsmxsq.js +1 -0
- package/dist/chunk-ht9zmff2.js +5 -0
- package/dist/{chunk-0t8m1ehd.js → chunk-jqa4c92z.js} +2 -2
- package/dist/{chunk-qtkv7hp8.js → chunk-kkhswjz8.js} +2 -2
- package/dist/{chunk-wjbejzek.js → chunk-nqh3kx2x.js} +1 -1
- package/dist/chunk-rb2vsqvb.js +1 -0
- package/dist/{chunk-c8g5x288.js → chunk-t22yw8s6.js} +1 -1
- package/dist/chunk-yv6n9e3z.js +72 -0
- package/dist/dot-2bdkpg3k.png +0 -0
- package/dist/duet-3ab8xyzd.png +0 -0
- package/dist/grok-bot-yv07qj9f.png +0 -0
- package/dist/index.html +1 -1
- package/dist/instinct-ypmq6t0w.png +0 -0
- package/dist/muse-qr7zwsvf.png +0 -0
- package/package.json +39 -40
- package/runtime/applets/chunk-bzxakh65.js +2 -0
- package/runtime/applets/chunk-qhjskz2m.js +2 -0
- package/runtime/applets/collab.js +1 -0
- package/runtime/applets/moi.js +1 -0
- package/runtime/applets/rpc.js +2 -0
- package/runtime/assets/shadcn.css +629 -0
- package/runtime/assets/tw-animate.css +1 -0
- package/runtime/build-worker-entry.js +2 -0
- package/runtime/chunk-00rk365r.js +83 -0
- package/runtime/chunk-4wj1jzhr.js +3 -0
- package/runtime/chunk-5egvk1rz.js +3 -0
- package/runtime/chunk-7c0zbz74.js +3 -0
- package/runtime/chunk-8fvgvm56.js +2 -0
- package/runtime/chunk-c3qyet60.js +128 -0
- package/runtime/chunk-ewc55jga.js +32623 -0
- package/runtime/chunk-gbkjshyt.js +26 -0
- package/runtime/chunk-ggphq7nk.js +66 -0
- package/runtime/chunk-h2bwhk81.js +3 -0
- package/runtime/chunk-hjzfk1cr.js +3 -0
- package/runtime/chunk-j0nd7kw0.js +52 -0
- package/runtime/chunk-jb63ns1z.js +2 -0
- package/runtime/chunk-k049dtaq.js +3 -0
- package/runtime/chunk-kjp60rqs.js +3 -0
- package/runtime/chunk-q06m17nb.js +3 -0
- package/runtime/chunk-r5s8rm8n.js +3 -0
- package/runtime/chunk-sdyqhxe1.js +10 -0
- package/runtime/chunk-w1fx9tsc.js +3 -0
- package/runtime/chunk-w6ksnv8y.js +2 -0
- package/runtime/chunk-wvarpvem.js +78 -0
- package/runtime/chunk-zm7k0v1c.js +3 -0
- package/runtime/chunk-zwvtkb81.js +139 -0
- package/runtime/cli.js +246 -0
- package/runtime/functions-worker.js +2 -0
- package/runtime/gateway-client.js +2 -0
- package/runtime/third-party-notices.txt +6830 -0
- package/runtime/worker.js +2 -0
- package/runtime/xdg-open +1267 -0
- package/bunfig.toml +0 -7
- package/client/AGENTS.md +0 -40
- package/client/api/app-config.ts +0 -58
- package/client/api/http.ts +0 -44
- package/client/api/query-client.ts +0 -5
- package/client/api/query-options.ts +0 -6
- package/client/api/workspace-keys.ts +0 -18
- package/client/app/app-provider.tsx +0 -39
- package/client/app/app-router.tsx +0 -57
- package/client/app/routes/home-route.tsx +0 -27
- package/client/app/routes/onboarding-route.tsx +0 -11
- package/client/app/routes/settings-route.tsx +0 -10
- package/client/app/routes/workspace-registration.tsx +0 -68
- package/client/app/routes/workspace-route.tsx +0 -127
- package/client/app/shell/sidebar-layout.tsx +0 -247
- package/client/assets/claude.svg +0 -3
- package/client/assets/favicon.png +0 -0
- package/client/assets/floppy-disk.webp +0 -0
- package/client/assets/hermes.png +0 -0
- package/client/assets/mcp/.gitkeep +0 -0
- package/client/assets/mcp/airtable.png +0 -0
- package/client/assets/mcp/apollo.png +0 -0
- package/client/assets/mcp/asana.png +0 -0
- package/client/assets/mcp/atlassian.png +0 -0
- package/client/assets/mcp/box.png +0 -0
- package/client/assets/mcp/chrome.svg +0 -33
- package/client/assets/mcp/clickup.png +0 -0
- package/client/assets/mcp/cloudflare.png +0 -0
- package/client/assets/mcp/context7.png +0 -0
- package/client/assets/mcp/datadog.png +0 -0
- package/client/assets/mcp/discord.png +0 -0
- package/client/assets/mcp/dropbox.png +0 -0
- package/client/assets/mcp/elevenlabs.png +0 -0
- package/client/assets/mcp/exa.png +0 -0
- package/client/assets/mcp/figma.png +0 -0
- package/client/assets/mcp/firecrawl.png +0 -0
- package/client/assets/mcp/github.png +0 -0
- package/client/assets/mcp/gitlab.png +0 -0
- package/client/assets/mcp/gmail.png +0 -0
- package/client/assets/mcp/googlecalendar.png +0 -0
- package/client/assets/mcp/googledrive.png +0 -0
- package/client/assets/mcp/grafana.png +0 -0
- package/client/assets/mcp/granola.png +0 -0
- package/client/assets/mcp/hubspot.png +0 -0
- package/client/assets/mcp/huggingface.png +0 -0
- package/client/assets/mcp/intercom.png +0 -0
- package/client/assets/mcp/linear.png +0 -0
- package/client/assets/mcp/monday.png +0 -0
- package/client/assets/mcp/mongodb.png +0 -0
- package/client/assets/mcp/neon.png +0 -0
- package/client/assets/mcp/notion.png +0 -0
- package/client/assets/mcp/paper.png +0 -0
- package/client/assets/mcp/paypal.png +0 -0
- package/client/assets/mcp/perplexity.png +0 -0
- package/client/assets/mcp/postgresql.png +0 -0
- package/client/assets/mcp/posthog.png +0 -0
- package/client/assets/mcp/puppeteer.png +0 -0
- package/client/assets/mcp/railway.png +0 -0
- package/client/assets/mcp/redis.png +0 -0
- package/client/assets/mcp/salesforce.png +0 -0
- package/client/assets/mcp/sentry.png +0 -0
- package/client/assets/mcp/shopify.png +0 -0
- package/client/assets/mcp/slack.png +0 -0
- package/client/assets/mcp/snowflake.png +0 -0
- package/client/assets/mcp/stripe.png +0 -0
- package/client/assets/mcp/supabase.png +0 -0
- package/client/assets/mcp/telegram.png +0 -0
- package/client/assets/mcp/twilio.png +0 -0
- package/client/assets/mcp/vercel.png +0 -0
- package/client/assets/mcp/zapier.png +0 -0
- package/client/assets/moi-logo.svg +0 -11
- package/client/assets/openai.svg +0 -1
- package/client/assets/openclaw.svg +0 -22
- package/client/assets.d.ts +0 -14
- package/client/components/shared/agent-blobatar.tsx +0 -93
- package/client/components/shared/bottom-panel.tsx +0 -65
- package/client/components/shared/composer.tsx +0 -125
- package/client/components/shared/led-logo.tsx +0 -181
- package/client/components/shared/panel-header.tsx +0 -16
- package/client/components/shared/reorderable-list.tsx +0 -204
- package/client/components/shared/screen-shell.tsx +0 -23
- package/client/components/shared/ultrafast-icon.tsx +0 -61
- package/client/components/shared/workspace-icon.tsx +0 -83
- package/client/components/ui/alert-dialog.tsx +0 -1
- package/client/components/ui/button.tsx +0 -1
- package/client/components/ui/checkbox.tsx +0 -1
- package/client/components/ui/collapsible.tsx +0 -1
- package/client/components/ui/dialog.tsx +0 -1
- package/client/components/ui/dropdown-menu.tsx +0 -1
- package/client/components/ui/hover-card.tsx +0 -1
- package/client/components/ui/inline-input.tsx +0 -84
- package/client/components/ui/input.tsx +0 -1
- package/client/components/ui/popover.tsx +0 -1
- package/client/components/ui/resizable.tsx +0 -1
- package/client/components/ui/skeleton.tsx +0 -1
- package/client/components/ui/slider.tsx +0 -1
- package/client/components/ui/spinner.tsx +0 -1
- package/client/components/ui/switch.tsx +0 -1
- package/client/components/ui/tabs.tsx +0 -1
- package/client/components/ui/textarea.tsx +0 -1
- package/client/components/ui/toast.tsx +0 -220
- package/client/components/ui/tooltip.tsx +0 -1
- package/client/dev/index.html +0 -43
- package/client/dev/index.ts +0 -15
- package/client/externalize-react.ts +0 -41
- package/client/features/account/account-menu.tsx +0 -96
- package/client/features/account/account-provider.tsx +0 -93
- package/client/features/account/account-test-utils.tsx +0 -310
- package/client/features/account/api.ts +0 -67
- package/client/features/account/profile-actions.ts +0 -29
- package/client/features/app-settings/api.ts +0 -33
- package/client/features/app-settings/avatar-upload.tsx +0 -62
- package/client/features/app-settings/general-settings.tsx +0 -39
- package/client/features/app-settings/profile-settings.tsx +0 -105
- package/client/features/app-settings/settings-page.tsx +0 -45
- package/client/features/app-settings/settings-section.tsx +0 -26
- package/client/features/applets/api.ts +0 -38
- package/client/features/applets/applet-cache.ts +0 -95
- package/client/features/applets/applet-container.tsx +0 -33
- package/client/features/applets/applet-log.ts +0 -81
- package/client/features/applets/applet-runtime.ts +0 -325
- package/client/features/applets/applet-styles.ts +0 -81
- package/client/features/applets/applet-thumbnail.ts +0 -294
- package/client/features/applets/use-applet.ts +0 -210
- package/client/features/applets/widget-error-boundary.tsx +0 -62
- package/client/features/applets/widget-shell.tsx +0 -56
- package/client/features/chat/applet-chat-intents.ts +0 -173
- package/client/features/chat/chat-panel.tsx +0 -326
- package/client/features/chat/chat-popup.tsx +0 -175
- package/client/features/chat/chat-send.ts +0 -259
- package/client/features/chat/chat-store.ts +0 -328
- package/client/features/chat/composer/attachments/attachment-chip.tsx +0 -99
- package/client/features/chat/composer/attachments/draft-attachments.ts +0 -185
- package/client/features/chat/composer/attachments/drawing-attachment-chip.tsx +0 -37
- package/client/features/chat/composer/attachments/file-attachment-chip.tsx +0 -22
- package/client/features/chat/composer/attachments/text-attachment-chip.tsx +0 -11
- package/client/features/chat/composer/attachments/types.ts +0 -25
- package/client/features/chat/composer/attachments/uploads.ts +0 -26
- package/client/features/chat/composer/banners/composer-banner.tsx +0 -16
- package/client/features/chat/composer/banners/error-banner.tsx +0 -36
- package/client/features/chat/composer/banners/skill-update-banner.tsx +0 -93
- package/client/features/chat/composer/chat-composer.tsx +0 -290
- package/client/features/chat/composer/model-order.ts +0 -110
- package/client/features/chat/composer/model-picker.tsx +0 -408
- package/client/features/chat/composer/use-workspace-composer-state.tsx +0 -69
- package/client/features/chat/composer/use-workspace-skill-updates.ts +0 -160
- package/client/features/chat/connection/chat-connection.ts +0 -64
- package/client/features/chat/connection/chat-frames.ts +0 -153
- package/client/features/chat/messages/chat-empty-state.tsx +0 -294
- package/client/features/chat/messages/chat-prompt-bubbles.tsx +0 -72
- package/client/features/chat/messages/fork-history.ts +0 -14
- package/client/features/chat/messages/group-turns.ts +0 -74
- package/client/features/chat/messages/interleave-notices.ts +0 -80
- package/client/features/chat/messages/markdown-content.tsx +0 -89
- package/client/features/chat/messages/preview-turn.ts +0 -37
- package/client/features/chat/messages/shimmer-text.tsx +0 -20
- package/client/features/chat/messages/tool-group/code-block.tsx +0 -41
- package/client/features/chat/messages/tool-group/collapse.tsx +0 -28
- package/client/features/chat/messages/tool-group/detect.ts +0 -93
- package/client/features/chat/messages/tool-group/fixtures.ts +0 -309
- package/client/features/chat/messages/tool-group/format/claude.ts +0 -49
- package/client/features/chat/messages/tool-group/format/codex.ts +0 -130
- package/client/features/chat/messages/tool-group/format/hermes.ts +0 -69
- package/client/features/chat/messages/tool-group/format/index.ts +0 -34
- package/client/features/chat/messages/tool-group/format/mcp.ts +0 -68
- package/client/features/chat/messages/tool-group/format/openclaw.ts +0 -120
- package/client/features/chat/messages/tool-group/format/shared.ts +0 -49
- package/client/features/chat/messages/tool-group/format/shell.ts +0 -162
- package/client/features/chat/messages/tool-group/index.ts +0 -9
- package/client/features/chat/messages/tool-group/read-image-preview.tsx +0 -46
- package/client/features/chat/messages/tool-group/subagent-card.tsx +0 -138
- package/client/features/chat/messages/tool-group/timeline-row.tsx +0 -159
- package/client/features/chat/messages/tool-group/tool-call-group.tsx +0 -279
- package/client/features/chat/messages/tool-group/tool-output.tsx +0 -125
- package/client/features/chat/messages/turn-view.tsx +0 -270
- package/client/features/chat/messages/use-stick-to-bottom.ts +0 -96
- package/client/features/chat/messages/user-message-bubble.tsx +0 -63
- package/client/features/chat/sessions/api.ts +0 -193
- package/client/features/chat/sessions/chat-selector.tsx +0 -399
- package/client/features/chat/sessions/session-view.ts +0 -53
- package/client/features/chat/sessions/use-selected-session.ts +0 -171
- package/client/features/chat/use-chat.ts +0 -229
- package/client/features/collab/applet-api.ts +0 -35
- package/client/features/collab/components/cursors.tsx +0 -241
- package/client/features/collab/components/presence-avatars.tsx +0 -74
- package/client/features/collab/components/presence-frame.tsx +0 -122
- package/client/features/collab/components/presence-group.tsx +0 -31
- package/client/features/collab/components/presence-helpers.ts +0 -50
- package/client/features/collab/components/user-avatar-group.tsx +0 -35
- package/client/features/collab/components/user-avatar.tsx +0 -65
- package/client/features/collab/components/user.tsx +0 -69
- package/client/features/collab/host-state.ts +0 -160
- package/client/features/collab/index.ts +0 -5
- package/client/features/collab/local-user.ts +0 -46
- package/client/features/collab/members/api.ts +0 -17
- package/client/features/collab/members/hooks.ts +0 -97
- package/client/features/collab/members/store.ts +0 -148
- package/client/features/collab/members/types.ts +0 -55
- package/client/features/collab/presence/client.ts +0 -242
- package/client/features/collab/presence/hooks.tsx +0 -160
- package/client/features/collab/presence/presence-publisher.ts +0 -30
- package/client/features/collab/presence/presence-target.ts +0 -8
- package/client/features/collab/presence/provider.tsx +0 -74
- package/client/features/collab/presence/store.ts +0 -156
- package/client/features/collab/presence/users.ts +0 -87
- package/client/features/collab/proxy-user.ts +0 -28
- package/client/features/collab/sharing/agent-invite.tsx +0 -30
- package/client/features/collab/sharing/workspace-members.tsx +0 -269
- package/client/features/collab/sharing/workspace-sharing-menu.tsx +0 -179
- package/client/features/collab/testing/component-fixtures.tsx +0 -54
- package/client/features/collab/testing/fake-engine.ts +0 -120
- package/client/features/connectors/api.ts +0 -25
- package/client/features/connectors/icon-mcp.tsx +0 -21
- package/client/features/connectors/mcp-icons.ts +0 -183
- package/client/features/connectors/mcp-server-cards.tsx +0 -105
- package/client/features/connectors/read-connectors.ts +0 -35
- package/client/features/demo/demo-dialog.tsx +0 -194
- package/client/features/dev/blobatar-shapes-page.tsx +0 -344
- package/client/features/dev/chat-states-fixtures.ts +0 -755
- package/client/features/dev/chat-states-page.tsx +0 -476
- package/client/features/dev/collab/collab-page.tsx +0 -24
- package/client/features/dev/collab/collab-playground.tsx +0 -614
- package/client/features/dev/collab/local-user-settings.tsx +0 -120
- package/client/features/dev/collab/playground-room.ts +0 -33
- package/client/features/dev/dev-index-page.tsx +0 -83
- package/client/features/dev/dev-routes.tsx +0 -43
- package/client/features/dev/harness-debug-page.tsx +0 -607
- package/client/features/dev/onboarding-preview-page.tsx +0 -76
- package/client/features/dev/texture-lab-page.tsx +0 -149
- package/client/features/dev/tool-calls-page.tsx +0 -79
- package/client/features/dev/ui-components/ui-component-previews.tsx +0 -855
- package/client/features/dev/ui-components/ui-components-page.tsx +0 -60
- package/client/features/dev/workspace-setup-mocks.ts +0 -103
- package/client/features/dev/workspace-setup-page.tsx +0 -11
- package/client/features/dev/workspace-setup-preview.tsx +0 -249
- package/client/features/drawings/capture-element.ts +0 -57
- package/client/features/drawings/drawing-layer.tsx +0 -49
- package/client/features/drawings/drawing-toolbar.tsx +0 -95
- package/client/features/drawings/use-chat-annotation.ts +0 -228
- package/client/features/drawings/use-drawing-layer.ts +0 -756
- package/client/features/drawings/use-view-sketch.ts +0 -154
- package/client/features/harness/api.ts +0 -69
- package/client/features/harness/device-login-steps.tsx +0 -103
- package/client/features/harness/harness-login-panel.tsx +0 -232
- package/client/features/harness/harness-presentation.ts +0 -15
- package/client/features/harness/harness-selector.tsx +0 -119
- package/client/features/harness/use-harness-login.ts +0 -77
- package/client/features/home/api.ts +0 -135
- package/client/features/home/home-logo.tsx +0 -344
- package/client/features/home/home-page.tsx +0 -305
- package/client/features/home/shared-workspaces.tsx +0 -70
- package/client/features/home/workspace-invitations.tsx +0 -101
- package/client/features/home/workspace-preview.tsx +0 -213
- package/client/features/identity/host-api.ts +0 -35
- package/client/features/identity/store.ts +0 -26
- package/client/features/identity/types.ts +0 -41
- package/client/features/identity/use-identity.ts +0 -6
- package/client/features/onboarding/agent-setup-step.tsx +0 -57
- package/client/features/onboarding/api.ts +0 -42
- package/client/features/onboarding/onboarding-idea-disk.tsx +0 -129
- package/client/features/onboarding/onboarding-page.tsx +0 -33
- package/client/features/onboarding/onboarding-screen.tsx +0 -20
- package/client/features/onboarding/onboarding-status.tsx +0 -24
- package/client/features/onboarding/workspace-setup-step.tsx +0 -239
- package/client/features/overview/api.ts +0 -28
- package/client/features/overview/default/registry.tsx +0 -34
- package/client/features/overview/default/views-widget.tsx +0 -246
- package/client/features/overview/grid.ts +0 -77
- package/client/features/overview/hidden-panel.tsx +0 -111
- package/client/features/overview/overview.tsx +0 -299
- package/client/features/overview/use-grid-reconcile.ts +0 -94
- package/client/features/overview/widget-canvas.tsx +0 -166
- package/client/features/overview/widget-frame.tsx +0 -77
- package/client/features/overview/workspace-name.tsx +0 -55
- package/client/features/scratchpad/scratch-session.ts +0 -71
- package/client/features/scratchpad/scratchpad-controls.tsx +0 -516
- package/client/features/scratchpad/scratchpad.tsx +0 -360
- package/client/features/scratchpad/use-scratchpad-snapshot.tsx +0 -133
- package/client/features/update/api.ts +0 -35
- package/client/features/update/update-control.tsx +0 -102
- package/client/features/views/api.ts +0 -188
- package/client/features/views/pending-view-screen.tsx +0 -303
- package/client/features/views/use-view-actions.ts +0 -119
- package/client/features/views/use-view-drafts.ts +0 -88
- package/client/features/views/view-manager.tsx +0 -293
- package/client/features/views/view-presentation.ts +0 -12
- package/client/features/views/view-residency.ts +0 -77
- package/client/features/views/view-submission.ts +0 -56
- package/client/features/workspace/add/api.ts +0 -61
- package/client/features/workspace/add/create-workspace-dialog.tsx +0 -230
- package/client/features/workspace/add/import-workspace-dialog.tsx +0 -81
- package/client/features/workspace/add/use-workspace-import.ts +0 -61
- package/client/features/workspace/add/workspace-agent-options.ts +0 -53
- package/client/features/workspace/add/workspace-agent-selector.tsx +0 -96
- package/client/features/workspace/add/workspace-dialog-content.tsx +0 -22
- package/client/features/workspace/api.ts +0 -180
- package/client/features/workspace/harness-transition.ts +0 -81
- package/client/features/workspace/moi-context.ts +0 -129
- package/client/features/workspace/remote.ts +0 -34
- package/client/features/workspace/settings/api.ts +0 -112
- package/client/features/workspace/settings/connectors-settings.tsx +0 -110
- package/client/features/workspace/settings/environment-settings.tsx +0 -149
- package/client/features/workspace/settings/general-settings.tsx +0 -180
- package/client/features/workspace/settings/icon-picker-options.ts +0 -30
- package/client/features/workspace/settings/settings-layout.tsx +0 -53
- package/client/features/workspace/settings/use-env-vars.ts +0 -20
- package/client/features/workspace/settings/workspace-icon-picker.tsx +0 -318
- package/client/features/workspace/settings/workspace-settings-dialog.tsx +0 -65
- package/client/features/workspace/setup/workspace-login-state.tsx +0 -56
- package/client/features/workspace/setup/workspace-recovery-states.tsx +0 -142
- package/client/features/workspace/setup/workspace-setup.tsx +0 -98
- package/client/features/workspace/setup/workspace-welcome-state.tsx +0 -81
- package/client/features/workspace/tab-resolution.ts +0 -32
- package/client/features/workspace/theme-panel.tsx +0 -191
- package/client/features/workspace/unavailable-page.tsx +0 -21
- package/client/features/workspace/use-fits-split-layout.ts +0 -69
- package/client/features/workspace/use-workspace-navigation.ts +0 -265
- package/client/features/workspace/use-workspace-socket.ts +0 -51
- package/client/features/workspace/workspace-content.tsx +0 -597
- package/client/features/workspace/workspace-context.tsx +0 -21
- package/client/features/workspace/workspace-frame.tsx +0 -64
- package/client/features/workspace/workspace-identity.tsx +0 -40
- package/client/features/workspace/workspace-layout-context.tsx +0 -156
- package/client/features/workspace/workspace-menu.tsx +0 -67
- package/client/features/workspace/workspace-pane.tsx +0 -22
- package/client/features/workspace/workspace-pending-screen.tsx +0 -26
- package/client/features/workspace/workspace-preferences.ts +0 -91
- package/client/features/workspace/workspace-presentation.tsx +0 -35
- package/client/features/workspace/workspace-screen.tsx +0 -28
- package/client/features/workspace/workspace-split-layout.tsx +0 -116
- package/client/features/workspace/workspace-state.ts +0 -206
- package/client/features/workspace/workspace-tabs.tsx +0 -233
- package/client/features/workspace/workspace-test-utils.ts +0 -23
- package/client/global.d.ts +0 -5
- package/client/index.css +0 -247
- package/client/index.html +0 -81
- package/client/index.tsx +0 -45
- package/client/lib/agent-availability.ts +0 -14
- package/client/lib/browser-tab-id.ts +0 -4
- package/client/lib/cn.ts +0 -6
- package/client/lib/flags.ts +0 -11
- package/client/lib/identity-icon-registry.ts +0 -150
- package/client/lib/rate-limit.ts +0 -77
- package/client/lib/use-latest-ref.ts +0 -11
- package/client/lib/user-display-name.ts +0 -6
- package/client/lib/ws-url.ts +0 -10
- package/client/main.tsx +0 -43
- package/client/runtime/app-context.ts +0 -20
- package/client/runtime/app-events.ts +0 -75
- package/client/runtime/hmr-watchdog.ts +0 -39
- package/client/runtime/reconnecting-socket.ts +0 -115
- package/client/runtime/use-client-events.ts +0 -69
- package/client/runtime/workspace-theme.ts +0 -175
- package/client/store/ui.ts +0 -94
- package/client/store/workspace-session.ts +0 -30
- package/client/structured-clone-shim.ts +0 -14
- package/client/tailwind-config.ts +0 -43
- package/dist/chunk-851bx8ss.js +0 -72
- package/dist/chunk-cty37f3v.js +0 -1
- package/dist/chunk-dy6f6h3e.js +0 -5
- package/dist/chunk-j6928pwm.js +0 -1
- package/dist/chunk-kffcah9w.css +0 -1
- package/dist/chunk-rh58dc0y.js +0 -2
- package/lib/applet-selector.ts +0 -24
- package/lib/attachment-note.ts +0 -66
- package/lib/chat-title.ts +0 -11
- package/lib/collab/colors.ts +0 -30
- package/lib/collab/protocol.ts +0 -84
- package/lib/collab/types.ts +0 -52
- package/lib/default-widgets.ts +0 -32
- package/lib/events.ts +0 -61
- package/lib/format.ts +0 -348
- package/lib/harness-instructions.ts +0 -30
- package/lib/harness-types.ts +0 -13
- package/lib/identity-icons.ts +0 -73
- package/lib/ids.ts +0 -33
- package/lib/message-attachments.ts +0 -40
- package/lib/moi-attachments.ts +0 -204
- package/lib/moi-context.ts +0 -305
- package/lib/navigation.ts +0 -65
- package/lib/onboarding.ts +0 -41
- package/lib/scratchpad-skew.ts +0 -64
- package/lib/session-drafts.ts +0 -10
- package/lib/speed-mode.ts +0 -5
- package/lib/system-messages.ts +0 -241
- package/lib/themes.ts +0 -241
- package/lib/types.ts +0 -776
- package/lib/update.ts +0 -2
- package/lib/view-build-directives.ts +0 -11
- package/lib/workspace-config.ts +0 -48
- package/lib/workspace-icon.ts +0 -20
- package/lib/workspace-layout.ts +0 -15
- package/lib/workspace-name.ts +0 -17
- package/lib/workspace-tabs.ts +0 -29
- package/server/AGENTS.md +0 -17
- package/server/README.md +0 -123
- package/server/agent-caller.ts +0 -16
- package/server/agent-launcher.ts +0 -27
- package/server/api/harnesses.ts +0 -79
- package/server/api/index.ts +0 -1351
- package/server/api/onboarding.ts +0 -46
- package/server/app-config.ts +0 -264
- package/server/app-settings.ts +0 -69
- package/server/applets/api-base.ts +0 -4
- package/server/applets/applet-css.ts +0 -55
- package/server/applets/build-applet.ts +0 -475
- package/server/applets/build-worker.ts +0 -179
- package/server/applets/bundle-queue.ts +0 -19
- package/server/applets/config.ts +0 -226
- package/server/applets/declarations.ts +0 -45
- package/server/applets/dependencies.ts +0 -206
- package/server/applets/functions-worker.ts +0 -121
- package/server/applets/functions.ts +0 -392
- package/server/applets/index.ts +0 -504
- package/server/applets/log.ts +0 -149
- package/server/applets/runtime/collab.ts +0 -94
- package/server/applets/runtime/moi.ts +0 -35
- package/server/applets/runtime/rpc.ts +0 -15
- package/server/applets/thumbnails.ts +0 -200
- package/server/applets/typecheck.ts +0 -100
- package/server/applets/ui-components.ts +0 -241
- package/server/applets/view-source.ts +0 -73
- package/server/applets/views.ts +0 -323
- package/server/applets/widgets.ts +0 -181
- package/server/cli/applet-selector.ts +0 -19
- package/server/cli/args.ts +0 -5
- package/server/cli/colors.ts +0 -20
- package/server/cli/commands/bundle.ts +0 -119
- package/server/cli/commands/call-server-fn.ts +0 -42
- package/server/cli/commands/check.ts +0 -53
- package/server/cli/commands/config.ts +0 -120
- package/server/cli/commands/debug.ts +0 -119
- package/server/cli/commands/env.ts +0 -162
- package/server/cli/commands/hermes.ts +0 -149
- package/server/cli/commands/init.ts +0 -323
- package/server/cli/commands/navigate.ts +0 -35
- package/server/cli/commands/openclaw.ts +0 -168
- package/server/cli/commands/refresh.ts +0 -45
- package/server/cli/commands/remote.ts +0 -330
- package/server/cli/commands/scratch.ts +0 -496
- package/server/cli/commands/service.ts +0 -298
- package/server/cli/commands/skill.ts +0 -121
- package/server/cli/commands/start.ts +0 -112
- package/server/cli/commands/status.ts +0 -80
- package/server/cli/commands/tabs.ts +0 -36
- package/server/cli/commands/theme.ts +0 -192
- package/server/cli/commands/ui-components.ts +0 -15
- package/server/cli/commands/update.ts +0 -192
- package/server/cli/commands/version.ts +0 -9
- package/server/cli/commands/views.ts +0 -87
- package/server/cli/control.ts +0 -120
- package/server/cli/env.ts +0 -259
- package/server/cli/index.ts +0 -175
- package/server/cli/pc.ts +0 -20
- package/server/cli/provider.ts +0 -25
- package/server/cli/remote-command.ts +0 -77
- package/server/cli/remote-control.ts +0 -73
- package/server/cli/remote-operations.ts +0 -247
- package/server/cli/server-version.ts +0 -16
- package/server/cli/server.ts +0 -93
- package/server/cli/ui-components.ts +0 -294
- package/server/cli/ui.ts +0 -52
- package/server/cli.ts +0 -3
- package/server/collab/cloudflare-access.ts +0 -78
- package/server/collab/config.ts +0 -13
- package/server/collab/manager.ts +0 -413
- package/server/collab/service.ts +0 -136
- package/server/collab/skill/index.ts +0 -7
- package/server/collab/worker-messages.ts +0 -10
- package/server/collab/worker.ts +0 -52
- package/server/constants.ts +0 -13
- package/server/control-client.ts +0 -124
- package/server/control.ts +0 -572
- package/server/data-dir.ts +0 -22
- package/server/debug.ts +0 -10
- package/server/events.ts +0 -25
- package/server/harness/README.md +0 -381
- package/server/harness/acp/NOTES.md +0 -426
- package/server/harness/acp/adapter.ts +0 -206
- package/server/harness/acp/archived.ts +0 -88
- package/server/harness/acp/client.ts +0 -329
- package/server/harness/acp/discovery.ts +0 -127
- package/server/harness/acp/model-state.ts +0 -57
- package/server/harness/acp/run-durations.ts +0 -68
- package/server/harness/acp/session.ts +0 -786
- package/server/harness/acp/wire.ts +0 -132
- package/server/harness/auth.ts +0 -272
- package/server/harness/claude-code/NOTES.md +0 -651
- package/server/harness/claude-code/adapter.ts +0 -876
- package/server/harness/claude-code/auth.ts +0 -178
- package/server/harness/claude-code/cli.ts +0 -42
- package/server/harness/claude-code/git-worktree.ts +0 -35
- package/server/harness/claude-code/index.ts +0 -171
- package/server/harness/claude-code/mcp.ts +0 -152
- package/server/harness/claude-code/models.ts +0 -102
- package/server/harness/claude-code/permissions.ts +0 -34
- package/server/harness/claude-code/run-action.ts +0 -123
- package/server/harness/claude-code/session-title.ts +0 -104
- package/server/harness/claude-code/session.ts +0 -969
- package/server/harness/claude-code/sessions.ts +0 -153
- package/server/harness/codex/NOTES.md +0 -259
- package/server/harness/codex/adapter.ts +0 -633
- package/server/harness/codex/auth.ts +0 -140
- package/server/harness/codex/client.ts +0 -439
- package/server/harness/codex/connectors.ts +0 -92
- package/server/harness/codex/discovery.ts +0 -106
- package/server/harness/codex/index.ts +0 -107
- package/server/harness/codex/pagination.ts +0 -27
- package/server/harness/codex/permissions.ts +0 -80
- package/server/harness/codex/probe.ts +0 -183
- package/server/harness/codex/run-action.ts +0 -93
- package/server/harness/codex/session-title.ts +0 -147
- package/server/harness/codex/session.ts +0 -1196
- package/server/harness/codex/status.ts +0 -31
- package/server/harness/codex/thread-list.ts +0 -78
- package/server/harness/codex/transport.ts +0 -191
- package/server/harness/command.ts +0 -45
- package/server/harness/debug.ts +0 -57
- package/server/harness/detect.ts +0 -164
- package/server/harness/executable.ts +0 -125
- package/server/harness/fork.ts +0 -14
- package/server/harness/hermes/NOTES.md +0 -833
- package/server/harness/hermes/discovery.ts +0 -175
- package/server/harness/hermes/index.ts +0 -167
- package/server/harness/hermes/models.ts +0 -99
- package/server/harness/install.ts +0 -49
- package/server/harness/openclaw/NOTES.md +0 -749
- package/server/harness/openclaw/adapter.ts +0 -336
- package/server/harness/openclaw/compat.ts +0 -95
- package/server/harness/openclaw/cron-view.ts +0 -78
- package/server/harness/openclaw/discovery.ts +0 -456
- package/server/harness/openclaw/gateway.ts +0 -467
- package/server/harness/openclaw/index.ts +0 -125
- package/server/harness/openclaw/session.ts +0 -1512
- package/server/harness/openclaw/strip.ts +0 -184
- package/server/harness/openclaw/thinking.ts +0 -150
- package/server/harness/registry.ts +0 -39
- package/server/harness/run-action.ts +0 -85
- package/server/harness/session-title.ts +0 -59
- package/server/harness/shell-path.ts +0 -89
- package/server/harness/types.ts +0 -170
- package/server/navigation-relay.ts +0 -110
- package/server/onboarding/brief.ts +0 -29
- package/server/onboarding/ideas.ts +0 -48
- package/server/onboarding/jobs.ts +0 -291
- package/server/open-browser.ts +0 -7
- package/server/operations/commands.ts +0 -46
- package/server/operations/files.ts +0 -148
- package/server/operations/server.ts +0 -206
- package/server/remote/agent.ts +0 -103
- package/server/remote/broker-client.ts +0 -76
- package/server/remote/broker.ts +0 -81
- package/server/remote/client.ts +0 -725
- package/server/remote/errors.ts +0 -2
- package/server/remote/routes.ts +0 -121
- package/server/remote/workspace.ts +0 -34
- package/server/scratchpad/assets.ts +0 -258
- package/server/scratchpad/document.ts +0 -312
- package/server/scratchpad/executor.ts +0 -499
- package/server/scratchpad/relay.ts +0 -44
- package/server/scratchpad/shape-defaults.ts +0 -82
- package/server/server-cwd.ts +0 -23
- package/server/service.ts +0 -800
- package/server/sessions/archive.ts +0 -23
- package/server/sessions/attachment-message.ts +0 -95
- package/server/sessions/config.ts +0 -45
- package/server/sessions/lifecycle.ts +0 -19
- package/server/sessions/pending-views.ts +0 -158
- package/server/sessions/selected.ts +0 -113
- package/server/sessions/send-message.ts +0 -102
- package/server/sessions/store.ts +0 -54
- package/server/sessions/view-sessions.ts +0 -192
- package/server/skills/locations.ts +0 -82
- package/server/skills/lock.ts +0 -29
- package/server/skills/template.ts +0 -94
- package/server/skills/update.ts +0 -94
- package/server/skills/version.ts +0 -129
- package/server/skills/workspace.ts +0 -121
- package/server/state.ts +0 -40
- package/server/static.ts +0 -25
- package/server/status.ts +0 -110
- package/server/tldraw-package.d.ts +0 -4
- package/server/update.ts +0 -429
- package/server/uploads.ts +0 -290
- package/server/vendor.ts +0 -63
- package/server/version.ts +0 -41
- package/server/web.ts +0 -350
- package/server/workspace-state/file.ts +0 -181
- package/server/workspace-state/index.ts +0 -169
- package/server/workspace-state/lock.ts +0 -42
- package/server/workspace-state/types.ts +0 -16
- package/server/workspaces/api.ts +0 -24
- package/server/workspaces/change-harness.ts +0 -77
- package/server/workspaces/config.ts +0 -42
- package/server/workspaces/env-apply.ts +0 -20
- package/server/workspaces/env.ts +0 -424
- package/server/workspaces/harness-transition.ts +0 -29
- package/server/workspaces/icon.ts +0 -13
- package/server/workspaces/import.ts +0 -74
- package/server/workspaces/init.ts +0 -74
- package/server/workspaces/layout.ts +0 -190
- package/server/workspaces/preview.ts +0 -72
- package/server/workspaces/registry.ts +0 -330
- package/server/workspaces/required-env.ts +0 -19
- package/server/workspaces/scaffold.ts +0 -189
- package/server/workspaces/shared.ts +0 -74
- package/server/workspaces/tabs.ts +0 -35
- package/server/workspaces/theme.ts +0 -58
- package/tsconfig.json +0 -20
|
@@ -1,298 +0,0 @@
|
|
|
1
|
-
import { defineCommand } from 'citty'
|
|
2
|
-
import { existsSync } from 'node:fs'
|
|
3
|
-
import { dirname } from 'path'
|
|
4
|
-
import {
|
|
5
|
-
analyzeInstall,
|
|
6
|
-
captureServiceEnv,
|
|
7
|
-
installService,
|
|
8
|
-
queryServerInfo,
|
|
9
|
-
restartService,
|
|
10
|
-
ServiceError,
|
|
11
|
-
serviceLogPath,
|
|
12
|
-
serviceStatus,
|
|
13
|
-
uninstallService,
|
|
14
|
-
webAddress
|
|
15
|
-
} from '../../service'
|
|
16
|
-
import { isServerRunning } from '../control'
|
|
17
|
-
import pc from '../pc'
|
|
18
|
-
import { versionMismatchNotice } from '../server-version'
|
|
19
|
-
|
|
20
|
-
function serviceFail(err: unknown): never {
|
|
21
|
-
const message = err instanceof ServiceError ? err.message : String(err)
|
|
22
|
-
console.error('\n' + pc.red('✗') + ' ' + message + '\n')
|
|
23
|
-
process.exit(1)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Shared success line after install/restart: did the server actually come up,
|
|
27
|
-
// and on which version?
|
|
28
|
-
function printServiceServer(info: Awaited<ReturnType<typeof queryServerInfo>>) {
|
|
29
|
-
if (info) {
|
|
30
|
-
console.log(
|
|
31
|
-
' server ' +
|
|
32
|
-
pc.bold(`v${info.version}`) +
|
|
33
|
-
` running on ${webAddress(info)}` +
|
|
34
|
-
pc.dim(` (pid ${info.pid})`)
|
|
35
|
-
)
|
|
36
|
-
const mismatch = versionMismatchNotice(info.version)
|
|
37
|
-
if (mismatch) console.log('\n' + mismatch)
|
|
38
|
-
} else {
|
|
39
|
-
console.log(
|
|
40
|
-
' ' +
|
|
41
|
-
pc.yellow('server did not come up — check `moi service logs`') +
|
|
42
|
-
pc.dim(' (it may still be starting)')
|
|
43
|
-
)
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const serviceInstall = defineCommand({
|
|
48
|
-
meta: {
|
|
49
|
-
name: 'install',
|
|
50
|
-
description: 'Install and start the user service (launchd on macOS, systemd on Linux)'
|
|
51
|
-
},
|
|
52
|
-
args: {
|
|
53
|
-
port: { type: 'string', description: 'HTTP port for the service server (default: 13337)' },
|
|
54
|
-
env: {
|
|
55
|
-
type: 'string',
|
|
56
|
-
description:
|
|
57
|
-
'Extra env var names to capture from this shell, comma-separated (e.g. --env MY_TOKEN,OTHER)'
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
async run({ args }) {
|
|
61
|
-
// Check the install shape first: telling someone to stop their server only
|
|
62
|
-
// to then refuse the checkout would be a pointless round-trip.
|
|
63
|
-
const analysis = analyzeInstall()
|
|
64
|
-
if (analysis.kind !== 'global') {
|
|
65
|
-
try {
|
|
66
|
-
await installService() // throws the precise refusal for this analysis
|
|
67
|
-
} catch (err) {
|
|
68
|
-
serviceFail(err)
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
const port = args.port ? Number(args.port) : undefined
|
|
72
|
-
if (port !== undefined && (!Number.isInteger(port) || port < 1 || port > 65535)) {
|
|
73
|
-
serviceFail(new ServiceError(`Invalid --port value "${args.port}" — use a port number.`))
|
|
74
|
-
}
|
|
75
|
-
// citty hands back an array when the flag repeats — accept both shapes.
|
|
76
|
-
const envArg = Array.isArray(args.env) ? args.env.join(',') : args.env
|
|
77
|
-
const extraEnv = (envArg ?? '')
|
|
78
|
-
.split(',')
|
|
79
|
-
.map(k => k.trim())
|
|
80
|
-
.filter(Boolean)
|
|
81
|
-
const serviceEnv = captureServiceEnv(process.env, dirname(process.execPath), extraEnv)
|
|
82
|
-
const missingEnv = extraEnv.filter(key => !(key in serviceEnv))
|
|
83
|
-
if (missingEnv.length > 0) {
|
|
84
|
-
serviceFail(
|
|
85
|
-
new ServiceError(
|
|
86
|
-
`--env ${missingEnv.join(', ')}: not set in this shell (or the value is not capturable).`
|
|
87
|
-
)
|
|
88
|
-
)
|
|
89
|
-
}
|
|
90
|
-
// A foreground `moi start` holds the same ports the service needs. Refuse
|
|
91
|
-
// rather than install a unit that instantly fails on bind.
|
|
92
|
-
const runningInfo = await queryServerInfo()
|
|
93
|
-
const foreground = (await isServerRunning()) && !runningInfo?.service
|
|
94
|
-
if (foreground) {
|
|
95
|
-
serviceFail(
|
|
96
|
-
new ServiceError(
|
|
97
|
-
'A foreground server is running' +
|
|
98
|
-
(runningInfo?.pid ? ` (pid ${runningInfo.pid})` : '') +
|
|
99
|
-
'.\n Stop it (Ctrl-C in its terminal), then rerun `moi service install`.'
|
|
100
|
-
)
|
|
101
|
-
)
|
|
102
|
-
}
|
|
103
|
-
try {
|
|
104
|
-
const result = await installService({ port, extraEnv })
|
|
105
|
-
console.log(
|
|
106
|
-
'\n' +
|
|
107
|
-
pc.green('✓') +
|
|
108
|
-
' Service installed ' +
|
|
109
|
-
pc.dim(`(${process.platform === 'darwin' ? 'launchd' : 'systemd user unit'})`)
|
|
110
|
-
)
|
|
111
|
-
console.log(' unit ' + pc.dim(tildifyPath(result.unitPath)))
|
|
112
|
-
if (result.logPath) console.log(' logs ' + pc.dim(tildifyPath(result.logPath)))
|
|
113
|
-
printServiceServer(result.info)
|
|
114
|
-
console.log(pc.dim('\n Starts on login, restarts on crash, survives reboots.'))
|
|
115
|
-
for (const note of result.notes) console.log(pc.yellow(' ' + note))
|
|
116
|
-
console.log()
|
|
117
|
-
} catch (err) {
|
|
118
|
-
serviceFail(err)
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
})
|
|
122
|
-
|
|
123
|
-
const serviceUninstall = defineCommand({
|
|
124
|
-
meta: { name: 'uninstall', description: 'Stop the service and remove its unit' },
|
|
125
|
-
async run() {
|
|
126
|
-
try {
|
|
127
|
-
const { unitPath, existed } = await uninstallService()
|
|
128
|
-
if (!existed) {
|
|
129
|
-
console.log(
|
|
130
|
-
'\n' +
|
|
131
|
-
pc.dim('○') +
|
|
132
|
-
' Service is not installed ' +
|
|
133
|
-
pc.dim(`(${tildifyPath(unitPath)})`) +
|
|
134
|
-
'\n'
|
|
135
|
-
)
|
|
136
|
-
return
|
|
137
|
-
}
|
|
138
|
-
console.log(
|
|
139
|
-
'\n' + pc.green('✓') + ' Service removed ' + pc.dim(`(${tildifyPath(unitPath)})`) + '\n'
|
|
140
|
-
)
|
|
141
|
-
} catch (err) {
|
|
142
|
-
serviceFail(err)
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
})
|
|
146
|
-
|
|
147
|
-
const serviceRestart = defineCommand({
|
|
148
|
-
meta: { name: 'restart', description: 'Restart the service server' },
|
|
149
|
-
async run() {
|
|
150
|
-
try {
|
|
151
|
-
const info = await restartService()
|
|
152
|
-
console.log('\n' + pc.green('✓') + ' Service restarted')
|
|
153
|
-
printServiceServer(info)
|
|
154
|
-
console.log()
|
|
155
|
-
} catch (err) {
|
|
156
|
-
serviceFail(err)
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
})
|
|
160
|
-
|
|
161
|
-
const serviceLogs = defineCommand({
|
|
162
|
-
meta: { name: 'logs', description: 'Show server logs (journalctl on Linux, log file on macOS)' },
|
|
163
|
-
args: {
|
|
164
|
-
lines: { type: 'string', default: '80', description: 'How many trailing lines to show' },
|
|
165
|
-
follow: {
|
|
166
|
-
type: 'boolean',
|
|
167
|
-
alias: 'f',
|
|
168
|
-
default: false,
|
|
169
|
-
description: 'Keep following new output'
|
|
170
|
-
}
|
|
171
|
-
},
|
|
172
|
-
async run({ args }) {
|
|
173
|
-
const n = Math.max(1, Number(args.lines) || 80)
|
|
174
|
-
if (process.platform === 'linux') {
|
|
175
|
-
// journald owns the log (bounded, rotated). Inherit stdio so -f streams.
|
|
176
|
-
const argv = ['journalctl', '--user', '-u', 'moi.service', '-n', String(n), '--no-pager']
|
|
177
|
-
if (args.follow) argv.push('-f')
|
|
178
|
-
const proc = Bun.spawn(argv, { stdin: 'inherit', stdout: 'inherit', stderr: 'inherit' })
|
|
179
|
-
process.exit(await proc.exited)
|
|
180
|
-
}
|
|
181
|
-
const logPath = serviceLogPath()
|
|
182
|
-
if (!existsSync(logPath)) {
|
|
183
|
-
console.log('\n' + pc.dim('○') + ' No logs yet ' + pc.dim(`(${tildifyPath(logPath)})`) + '\n')
|
|
184
|
-
process.exit(0)
|
|
185
|
-
}
|
|
186
|
-
console.error(pc.dim(tildifyPath(logPath)))
|
|
187
|
-
const proc = Bun.spawn(['tail', '-n', String(n), ...(args.follow ? ['-F'] : []), logPath], {
|
|
188
|
-
stdin: 'inherit',
|
|
189
|
-
stdout: 'inherit',
|
|
190
|
-
stderr: 'inherit'
|
|
191
|
-
})
|
|
192
|
-
process.exit(await proc.exited)
|
|
193
|
-
}
|
|
194
|
-
})
|
|
195
|
-
|
|
196
|
-
function tildifyPath(p: string): string {
|
|
197
|
-
const home = process.env.HOME
|
|
198
|
-
return home && p.startsWith(home) ? '~' + p.slice(home.length) : p
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
async function runServiceStatus() {
|
|
202
|
-
try {
|
|
203
|
-
const s = await serviceStatus()
|
|
204
|
-
const flavor = s.platform === 'darwin' ? 'launchd user agent' : 'systemd user unit'
|
|
205
|
-
console.log('\n' + pc.bold('moi service') + pc.dim(` — ${flavor}`))
|
|
206
|
-
console.log()
|
|
207
|
-
if (!s.installed) {
|
|
208
|
-
console.log(' ' + pc.dim('○') + ' Not installed')
|
|
209
|
-
console.log(
|
|
210
|
-
pc.dim(' Run `moi service install` to start Moi on login and keep it running.')
|
|
211
|
-
)
|
|
212
|
-
console.log()
|
|
213
|
-
process.exit(0)
|
|
214
|
-
}
|
|
215
|
-
const rt = s.runtime
|
|
216
|
-
const stateLabel =
|
|
217
|
-
rt === null
|
|
218
|
-
? pc.dim('unknown')
|
|
219
|
-
: rt.state === 'running'
|
|
220
|
-
? pc.green('● running') + (rt.pid ? pc.dim(` (pid ${rt.pid})`) : '')
|
|
221
|
-
: rt.state === 'failed'
|
|
222
|
-
? pc.red('✗ failed') + pc.dim(rt.detail ? ` (${rt.detail})` : '')
|
|
223
|
-
: rt.state === 'unavailable'
|
|
224
|
-
? pc.yellow('? unavailable') + pc.dim(rt.detail ? ` — ${rt.detail}` : '')
|
|
225
|
-
: pc.dim('○ ' + rt.state)
|
|
226
|
-
console.log(' state ' + stateLabel)
|
|
227
|
-
console.log(' unit ' + pc.dim(tildifyPath(s.unitPath)))
|
|
228
|
-
if (s.logPath)
|
|
229
|
-
console.log(' logs ' + pc.dim(tildifyPath(s.logPath)) + pc.dim(' (`moi service logs`)'))
|
|
230
|
-
else
|
|
231
|
-
console.log(' logs ' + pc.dim('journalctl --user -u moi.service (`moi service logs`)'))
|
|
232
|
-
const info = await queryServerInfo()
|
|
233
|
-
if (info) {
|
|
234
|
-
console.log(
|
|
235
|
-
' server ' +
|
|
236
|
-
pc.bold(`v${info.version}`) +
|
|
237
|
-
pc.dim(` on ${webAddress(info)} (pid ${info.pid})`)
|
|
238
|
-
)
|
|
239
|
-
if (!info.service) {
|
|
240
|
-
console.log(
|
|
241
|
-
pc.yellow(' ⚠ The running server is a foreground `moi start`, not the service.')
|
|
242
|
-
)
|
|
243
|
-
}
|
|
244
|
-
} else if (rt?.state === 'running') {
|
|
245
|
-
console.log(' server ' + pc.yellow('unreachable on the control port'))
|
|
246
|
-
}
|
|
247
|
-
console.log()
|
|
248
|
-
if (s.binMissing && s.bin) {
|
|
249
|
-
console.log(
|
|
250
|
-
pc.yellow(` ⚠ The service execs ${s.bin}, which no longer exists`) +
|
|
251
|
-
pc.dim(' (Moi moved or was reinstalled elsewhere).') +
|
|
252
|
-
'\n' +
|
|
253
|
-
pc.dim(' Rerun `moi service install` to re-capture paths.')
|
|
254
|
-
)
|
|
255
|
-
}
|
|
256
|
-
if (s.bunMissing) {
|
|
257
|
-
console.log(
|
|
258
|
-
pc.yellow(' ⚠ No bun on the service PATH — the server cannot start.') +
|
|
259
|
-
'\n' +
|
|
260
|
-
pc.dim(' Reinstall bun, then rerun `moi service install`.')
|
|
261
|
-
)
|
|
262
|
-
}
|
|
263
|
-
if (s.linger === 'disabled') {
|
|
264
|
-
console.log(
|
|
265
|
-
pc.yellow(' ⚠ Lingering is off — the service stops when your last session ends.') +
|
|
266
|
-
'\n' +
|
|
267
|
-
pc.dim(' Enable: loginctl enable-linger')
|
|
268
|
-
)
|
|
269
|
-
}
|
|
270
|
-
const mismatch = info ? versionMismatchNotice(info.version) : null
|
|
271
|
-
if (mismatch) console.log(mismatch.replace(/^/gm, ' ').replace(/^ {2}⚠/, ' ⚠') + '\n')
|
|
272
|
-
process.exit(0)
|
|
273
|
-
} catch (err) {
|
|
274
|
-
serviceFail(err)
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
const serviceSubCommands = {
|
|
279
|
-
install: serviceInstall,
|
|
280
|
-
uninstall: serviceUninstall,
|
|
281
|
-
restart: serviceRestart,
|
|
282
|
-
logs: serviceLogs
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
export const service = defineCommand({
|
|
286
|
-
meta: {
|
|
287
|
-
name: 'service',
|
|
288
|
-
description: 'Run Moi as a user service: `moi service install|uninstall|restart|logs`'
|
|
289
|
-
},
|
|
290
|
-
subCommands: serviceSubCommands,
|
|
291
|
-
async run({ rawArgs }) {
|
|
292
|
-
// citty invokes the parent run even after dispatching a subcommand — only
|
|
293
|
-
// show status when none ran (same pattern as `moi env` / `moi tabs`).
|
|
294
|
-
const sub = rawArgs.find(a => !a.startsWith('-'))
|
|
295
|
-
if (sub && Object.hasOwn(serviceSubCommands, sub)) return
|
|
296
|
-
await runServiceStatus()
|
|
297
|
-
}
|
|
298
|
-
})
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import type { WorkspaceSkillStatus } from '@/lib/types'
|
|
2
|
-
import { defineCommand } from 'citty'
|
|
3
|
-
import { resolve } from 'path'
|
|
4
|
-
import { updateWorkspaceSkills } from '../../skills/update'
|
|
5
|
-
import type { WorkspaceSkillUpdateResult } from '../../skills/update'
|
|
6
|
-
import { displaySkillPath } from '../../skills/locations'
|
|
7
|
-
import { isBehind, isMinorBehind, resolveWorkspace, skillStatuses } from '../../skills/version'
|
|
8
|
-
import { dirArg } from '../args'
|
|
9
|
-
import pc from '../pc'
|
|
10
|
-
import { columns } from '../ui'
|
|
11
|
-
|
|
12
|
-
// Re-copy bundled skills into a workspace, then report what changed. Pure
|
|
13
|
-
// filesystem op — no running server needed. Resolves the workspace root the
|
|
14
|
-
// same way `moi bundle` does, so it works from `.moi/` or any subdirectory.
|
|
15
|
-
async function runSkillUpdate(cwd: string): Promise<void> {
|
|
16
|
-
// Include the primary harness destination and existing copies for other agents.
|
|
17
|
-
const { root, harness } = await resolveWorkspace(cwd)
|
|
18
|
-
const result = await updateWorkspaceSkills(root, harness)
|
|
19
|
-
const { changedSkills, updatedAppletTypes } = result
|
|
20
|
-
const heading = changedSkills.length > 0 ? 'Skills updated in ' : 'Skills unchanged in '
|
|
21
|
-
|
|
22
|
-
console.log('\n' + pc.green('✓') + ' ' + heading + pc.bold(root) + '\n')
|
|
23
|
-
printSkillUpdateTable(root, result)
|
|
24
|
-
for (const file of updatedAppletTypes) {
|
|
25
|
-
console.log(pc.dim(' Applet types regenerated: ') + pc.bold(`.moi/${file}\n`))
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function printSkillUpdateTable(
|
|
30
|
-
root: string,
|
|
31
|
-
{ before, status, changedSkills, changedSkillPaths }: WorkspaceSkillUpdateResult
|
|
32
|
-
): void {
|
|
33
|
-
const changedPaths = new Set(changedSkillPaths)
|
|
34
|
-
console.log(
|
|
35
|
-
columns(
|
|
36
|
-
['skill', 'path', 'from', 'to'].map(h => pc.dim(h)),
|
|
37
|
-
status.skills.map(s => {
|
|
38
|
-
const prev = before.find(b => b.name === s.name && b.path === s.path)?.installed ?? null
|
|
39
|
-
const versionChanged = prev !== s.installed
|
|
40
|
-
const filesChanged = changedPaths.has(s.path)
|
|
41
|
-
return [
|
|
42
|
-
s.name,
|
|
43
|
-
displaySkillPath(root, s.path),
|
|
44
|
-
prev ?? pc.dim('none'),
|
|
45
|
-
versionChanged
|
|
46
|
-
? pc.green(s.installed ?? '?')
|
|
47
|
-
: filesChanged
|
|
48
|
-
? pc.green((s.installed ?? '?') + ' (files changed)')
|
|
49
|
-
: pc.dim((s.installed ?? '?') + ' (no change)')
|
|
50
|
-
]
|
|
51
|
-
})
|
|
52
|
-
)
|
|
53
|
-
)
|
|
54
|
-
const nextStep =
|
|
55
|
-
changedSkills.length > 0
|
|
56
|
-
? ` Reload changed skills before using them again: ${changedSkills.join(', ')}.`
|
|
57
|
-
: ' No skill files changed. Keep using the copies already in context.'
|
|
58
|
-
console.log('\n' + pc.dim(nextStep) + '\n')
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// Colored status label for one skill row: minor+ behind is actionable, a patch
|
|
62
|
-
// gap is informational, otherwise current.
|
|
63
|
-
function skillState(s: WorkspaceSkillStatus): string {
|
|
64
|
-
if (isMinorBehind(s.installed, s.bundled)) return pc.yellow('update available')
|
|
65
|
-
if (isBehind(s.installed, s.bundled)) return pc.dim('patch behind')
|
|
66
|
-
return pc.green('up to date')
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// `update` and `install` are the same operation under two names (install kept
|
|
70
|
-
// for symmetry with how skills first land in a workspace). `dir` is a `--dir`
|
|
71
|
-
// option, not a positional: citty treats a bare positional on a command that
|
|
72
|
-
// carries subcommands as an unknown subcommand. Reuses the shared `dirArg`.
|
|
73
|
-
const defineSkillUpdate = (name: string, description: string) =>
|
|
74
|
-
defineCommand({
|
|
75
|
-
meta: { name, description },
|
|
76
|
-
args: { dir: dirArg },
|
|
77
|
-
async run({ args }) {
|
|
78
|
-
await runSkillUpdate(resolve(args.dir))
|
|
79
|
-
}
|
|
80
|
-
})
|
|
81
|
-
|
|
82
|
-
const skillSubCommands = {
|
|
83
|
-
update: defineSkillUpdate(
|
|
84
|
-
'update',
|
|
85
|
-
'Update this workspace’s skills to the version shipped with the CLI'
|
|
86
|
-
),
|
|
87
|
-
install: defineSkillUpdate('install', 'Alias for `moi skill update`')
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export const skill = defineCommand({
|
|
91
|
-
meta: { name: 'skill', description: 'Show or update the workspace skills shipped with Moi' },
|
|
92
|
-
subCommands: skillSubCommands,
|
|
93
|
-
args: { dir: dirArg },
|
|
94
|
-
async run({ args, rawArgs }) {
|
|
95
|
-
// citty runs this parent handler even after dispatching a subcommand, so
|
|
96
|
-
// bail when one was given — otherwise `moi skill update` also prints status.
|
|
97
|
-
const sub = rawArgs.find(a => !a.startsWith('-'))
|
|
98
|
-
if (sub && sub in skillSubCommands) return
|
|
99
|
-
|
|
100
|
-
const { root, harness } = await resolveWorkspace(resolve(args.dir))
|
|
101
|
-
const statuses = await skillStatuses(root, harness)
|
|
102
|
-
|
|
103
|
-
console.log('\n' + pc.bold('moi skill') + pc.dim(' — workspace skills') + '\n')
|
|
104
|
-
console.log(
|
|
105
|
-
columns(
|
|
106
|
-
['skill', 'path', 'installed', 'bundled', 'status'].map(h => pc.dim(h)),
|
|
107
|
-
statuses.map(s => [
|
|
108
|
-
s.name,
|
|
109
|
-
displaySkillPath(root, s.path),
|
|
110
|
-
s.installed ?? pc.dim('—'),
|
|
111
|
-
s.bundled ?? pc.dim('—'),
|
|
112
|
-
skillState(s)
|
|
113
|
-
])
|
|
114
|
-
)
|
|
115
|
-
)
|
|
116
|
-
if (statuses.some(s => isBehind(s.installed, s.bundled))) {
|
|
117
|
-
console.log('\n' + pc.dim(' Run ') + pc.bold('moi skill update') + pc.dim(' to refresh.'))
|
|
118
|
-
}
|
|
119
|
-
console.log()
|
|
120
|
-
}
|
|
121
|
-
})
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { defineCommand } from 'citty'
|
|
2
|
-
import { getAppConfig, initializeAppConfig } from '../../app-config'
|
|
3
|
-
import { CONTROL_PORT, PORT } from '../../constants'
|
|
4
|
-
import { serverCwd } from '../../server-cwd'
|
|
5
|
-
import { queryServerInfo, webAddress } from '../../service'
|
|
6
|
-
import { superviseServerUpdates } from '../../update'
|
|
7
|
-
import { PACKAGE_ROOT } from '../../version'
|
|
8
|
-
import { isServerRunning } from '../control'
|
|
9
|
-
import pc from '../pc'
|
|
10
|
-
import { assertDevRuntime, runDevSupervisor, spawnServer } from '../server'
|
|
11
|
-
|
|
12
|
-
export const start = defineCommand({
|
|
13
|
-
meta: { name: 'start', description: 'Start the Moi web server' },
|
|
14
|
-
args: {
|
|
15
|
-
port: {
|
|
16
|
-
type: 'string',
|
|
17
|
-
description: 'HTTP port to listen on (default: 13337)'
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
async run({ args }) {
|
|
21
|
-
const projectRoot = PACKAGE_ROOT
|
|
22
|
-
// Undocumented: --dev runs the watch-and-full-restart dev supervisor.
|
|
23
|
-
const dev = process.argv.includes('--dev')
|
|
24
|
-
if (dev) assertDevRuntime()
|
|
25
|
-
// Undocumented: --debug turns on the messaging trace (MOI_DEBUG) in the
|
|
26
|
-
// server — console lines for each message/session/turn in the chat pipeline.
|
|
27
|
-
const debug = process.argv.includes('--debug')
|
|
28
|
-
|
|
29
|
-
// Launcher path: we are the CLI, not the server. Decide whether to bail
|
|
30
|
-
// (a server is already up), run the dev supervisor, or spawn a one-shot
|
|
31
|
-
// server. Skipped when MOI_SERVER=1 (we are the spawned server itself).
|
|
32
|
-
if (!process.env.MOI_SERVER) {
|
|
33
|
-
if (await isServerRunning()) {
|
|
34
|
-
// Say who owns the running server: a service-managed one is expected
|
|
35
|
-
// to be here, and `moi service` is how to manage it.
|
|
36
|
-
const info = await queryServerInfo()
|
|
37
|
-
if (info?.service) {
|
|
38
|
-
console.log(
|
|
39
|
-
'\n' +
|
|
40
|
-
pc.yellow('◆') +
|
|
41
|
-
' The Moi service is already running on ' +
|
|
42
|
-
webAddress(info) +
|
|
43
|
-
pc.dim(` (v${info.version})`) +
|
|
44
|
-
'\n' +
|
|
45
|
-
pc.dim(' Manage it with `moi service` — restart, logs, uninstall.') +
|
|
46
|
-
'\n'
|
|
47
|
-
)
|
|
48
|
-
} else {
|
|
49
|
-
console.log(
|
|
50
|
-
'\n' + pc.yellow('◆') + ' Server is already running on ' + webAddress(info) + '\n'
|
|
51
|
-
)
|
|
52
|
-
}
|
|
53
|
-
process.exit(0)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// Spawn server with correct cwd so bunfig.toml is picked up at Bun startup.
|
|
57
|
-
// MOI_DEV tells the server to use the live bundler + HMR even if a stale
|
|
58
|
-
// `dist/` exists in the tree (prod serves prebuilt `dist/` statically).
|
|
59
|
-
const env = {
|
|
60
|
-
...process.env,
|
|
61
|
-
// The dev bundler snapshots process.env at server startup, so the
|
|
62
|
-
// PUBLIC_* inlining (bunfig `[serve.static] env`) only sees vars that
|
|
63
|
-
// are set before the server process spawns — setting one later from
|
|
64
|
-
// server code does nothing. Default the tldraw key here so an unset
|
|
65
|
-
// key inlines as '' (→ watermark) instead of leaving a bare
|
|
66
|
-
// `process.env.…` in the browser bundle that throws.
|
|
67
|
-
PUBLIC_TLDRAW_LICENSE_KEY: process.env.PUBLIC_TLDRAW_LICENSE_KEY ?? '',
|
|
68
|
-
...(args.port ? { PORT: args.port } : {}),
|
|
69
|
-
...(dev ? { MOI_DEV: '1' } : {}),
|
|
70
|
-
...(debug ? { MOI_DEBUG: '1' } : {})
|
|
71
|
-
}
|
|
72
|
-
if (dev) {
|
|
73
|
-
await runDevSupervisor(projectRoot, env)
|
|
74
|
-
return
|
|
75
|
-
}
|
|
76
|
-
const cwd = serverCwd(projectRoot, dev)
|
|
77
|
-
const proc = spawnServer(cwd, env)
|
|
78
|
-
process.exit(await superviseServerUpdates(proc, () => spawnServer(cwd, env)))
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// This IS the server process (MOI_SERVER=1). cwd is the package root when the
|
|
82
|
-
// dev bundler runs (bunfig loaded at Bun startup) or a neutral dir for a
|
|
83
|
-
// prebuilt install — see serverCwd().
|
|
84
|
-
initializeAppConfig()
|
|
85
|
-
try {
|
|
86
|
-
await import('../../web')
|
|
87
|
-
} catch (err) {
|
|
88
|
-
// Startup failure (port taken, config error). Under the service manager
|
|
89
|
-
// exit 0 on purpose: launchd (KeepAlive.SuccessfulExit=false) and
|
|
90
|
-
// systemd (Restart=on-failure) both read a clean exit as "do not
|
|
91
|
-
// respawn", so a permanently-broken start idles instead of looping.
|
|
92
|
-
const code = (err as { code?: string })?.code
|
|
93
|
-
if (code === 'EADDRINUSE') {
|
|
94
|
-
console.error(
|
|
95
|
-
`\n${pc.red('✗')} Port already in use (http :${PORT} / control :${CONTROL_PORT}) — ` +
|
|
96
|
-
'is another Moi server running?'
|
|
97
|
-
)
|
|
98
|
-
} else {
|
|
99
|
-
console.error(`\n${pc.red('✗')} Server failed to start: ${String(err)}`)
|
|
100
|
-
}
|
|
101
|
-
if (process.env.MOI_SERVICE) {
|
|
102
|
-
console.error(pc.dim(' The service stays idle — fix this, then `moi service restart`.\n'))
|
|
103
|
-
process.exit(0)
|
|
104
|
-
}
|
|
105
|
-
process.exit(1)
|
|
106
|
-
}
|
|
107
|
-
const { unixSocket } = getAppConfig()
|
|
108
|
-
console.log(`\n${pc.green('✓')} Server started on ${unixSocket ?? `http://localhost:${PORT}`}`)
|
|
109
|
-
console.log(pc.dim(' Press Ctrl+C to stop\n'))
|
|
110
|
-
// Stay alive as the server
|
|
111
|
-
}
|
|
112
|
-
})
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import type { WorkspaceEntry } from '@/lib/types'
|
|
2
|
-
import { defineCommand } from 'citty'
|
|
3
|
-
import { CONTROL_HOST, CONTROL_PORT, CONTROL_URL, PORT } from '../../constants'
|
|
4
|
-
import type { ControlProbe } from '../../control-client'
|
|
5
|
-
import { controlFailureMessage, probeControlServer } from '../../control-client'
|
|
6
|
-
import { queryServerInfo } from '../../service'
|
|
7
|
-
import { staleSkillNotice } from '../../skills/version'
|
|
8
|
-
import { VERSION } from '../../version'
|
|
9
|
-
import pc from '../pc'
|
|
10
|
-
import { versionMismatchNotice } from '../server-version'
|
|
11
|
-
|
|
12
|
-
export const status = defineCommand({
|
|
13
|
-
meta: { name: 'status', description: 'Show server status and registered workspaces' },
|
|
14
|
-
async run() {
|
|
15
|
-
const probe: ControlProbe = await probeControlServer()
|
|
16
|
-
const notice = await staleSkillNotice(process.cwd())
|
|
17
|
-
|
|
18
|
-
if (probe.status === 'not-running') {
|
|
19
|
-
console.log('\n' + pc.dim('○') + ' Server is ' + pc.bold('not running'))
|
|
20
|
-
console.log(pc.dim(` cli version ${VERSION}`) + '\n')
|
|
21
|
-
process.exit(0)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// The dial failed for a reason other than an empty port, so the server may
|
|
25
|
-
// be up and healthy. Name the real obstacle instead of blaming the process.
|
|
26
|
-
if (probe.status === 'unreachable') {
|
|
27
|
-
console.log('\n' + pc.yellow('◆') + ' Server is ' + pc.bold('unreachable'))
|
|
28
|
-
console.log(pc.dim(` control port ${CONTROL_HOST}:${CONTROL_PORT} — ${probe.reason}`))
|
|
29
|
-
console.log(pc.dim(` cli version ${VERSION}`) + '\n')
|
|
30
|
-
process.exit(1)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const info = await queryServerInfo()
|
|
34
|
-
console.log(
|
|
35
|
-
'\n' +
|
|
36
|
-
pc.green('●') +
|
|
37
|
-
' Server is ' +
|
|
38
|
-
pc.bold('running') +
|
|
39
|
-
pc.dim(
|
|
40
|
-
(info?.unixSocket
|
|
41
|
-
? ` (web socket: ${info.unixSocket}`
|
|
42
|
-
: ` (http port: ${info?.port || PORT}`) +
|
|
43
|
-
`, control port: ${CONTROL_PORT}` +
|
|
44
|
-
(info?.pid ? `, pid: ${info.pid}` : '') +
|
|
45
|
-
')'
|
|
46
|
-
)
|
|
47
|
-
)
|
|
48
|
-
if (info) {
|
|
49
|
-
console.log(
|
|
50
|
-
pc.dim(` server version ${info.version}`) +
|
|
51
|
-
(info.service ? pc.dim(' · service-managed (`moi service`)') : '')
|
|
52
|
-
)
|
|
53
|
-
}
|
|
54
|
-
console.log(pc.dim(` cli version ${VERSION}`))
|
|
55
|
-
const mismatch = info ? versionMismatchNotice(info.version) : null
|
|
56
|
-
if (mismatch) console.log('\n' + mismatch)
|
|
57
|
-
|
|
58
|
-
await new Promise<void>((resolve, reject) => {
|
|
59
|
-
const ws = new WebSocket(CONTROL_URL)
|
|
60
|
-
|
|
61
|
-
ws.onopen = () => ws.send(JSON.stringify({ type: 'workspace:list' }))
|
|
62
|
-
|
|
63
|
-
ws.onmessage = event => {
|
|
64
|
-
const res = JSON.parse(String(event.data))
|
|
65
|
-
const workspaces: WorkspaceEntry[] = res.workspaces ?? []
|
|
66
|
-
const n = workspaces.length
|
|
67
|
-
console.log(pc.dim(` ${n} workspace${n === 1 ? '' : 's'} registered\n`))
|
|
68
|
-
|
|
69
|
-
ws.close()
|
|
70
|
-
resolve()
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
ws.onerror = () =>
|
|
74
|
-
void probeControlServer().then(p => reject(new Error(controlFailureMessage(p))))
|
|
75
|
-
})
|
|
76
|
-
|
|
77
|
-
if (notice) console.log(pc.yellow(notice) + '\n')
|
|
78
|
-
process.exit(0)
|
|
79
|
-
}
|
|
80
|
-
})
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { defineCommand } from 'citty'
|
|
2
|
-
import { resolve } from 'path'
|
|
3
|
-
import { dirArg } from '../args'
|
|
4
|
-
import { sendControl } from '../control'
|
|
5
|
-
import pc from '../pc'
|
|
6
|
-
import { columns } from '../ui'
|
|
7
|
-
|
|
8
|
-
// The listing behind `moi tabs`: every tab (static + views), one per row. The
|
|
9
|
-
// addresses are documented in docs/navigation.md.
|
|
10
|
-
function runTabsList(dir: string) {
|
|
11
|
-
const path = resolve(dir)
|
|
12
|
-
sendControl(path, { type: 'tabs', path }, res => {
|
|
13
|
-
type Row = { title: string; href: string }
|
|
14
|
-
const rows: Row[] = Array.isArray(res.tabs) ? (res.tabs as Row[]) : []
|
|
15
|
-
console.log('\n' + pc.bold('moi tabs') + pc.dim(' — workspace tabs') + '\n')
|
|
16
|
-
console.log(
|
|
17
|
-
columns(
|
|
18
|
-
['title', 'address'].map(h => pc.dim(h)),
|
|
19
|
-
rows.map(row => [row.title, row.href])
|
|
20
|
-
)
|
|
21
|
-
)
|
|
22
|
-
console.log('\n' + pc.dim(' Open one: moi navigate <address>') + '\n')
|
|
23
|
-
})
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export const tabs = defineCommand({
|
|
27
|
-
meta: { name: 'tabs', description: 'List workspace tabs and their navigation addresses' },
|
|
28
|
-
args: { dir: dirArg },
|
|
29
|
-
run({ args }) {
|
|
30
|
-
if (args._.length) {
|
|
31
|
-
console.error('moi tabs only lists tabs. Use moi navigate <address> to navigate.')
|
|
32
|
-
process.exit(1)
|
|
33
|
-
}
|
|
34
|
-
runTabsList(args.dir)
|
|
35
|
-
}
|
|
36
|
-
})
|