@agent-native/core 0.80.8 → 0.80.9
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/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +12 -0
- package/corpus/core/docs/content/locales/ar-SA/template-design.mdx +6 -0
- package/corpus/core/docs/content/locales/de-DE/template-design.mdx +8 -0
- package/corpus/core/docs/content/locales/es-ES/template-design.mdx +10 -2
- package/corpus/core/docs/content/locales/fr-FR/template-design.mdx +10 -2
- package/corpus/core/docs/content/locales/hi-IN/template-design.mdx +7 -0
- package/corpus/core/docs/content/locales/ja-JP/template-design.mdx +7 -0
- package/corpus/core/docs/content/locales/ko-KR/template-design.mdx +7 -0
- package/corpus/core/docs/content/locales/pt-BR/template-design.mdx +9 -2
- package/corpus/core/docs/content/locales/zh-CN/template-design.mdx +6 -0
- package/corpus/core/docs/content/locales/zh-TW/template-design.mdx +6 -0
- package/corpus/core/docs/content/template-design.mdx +9 -2
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/cli/mcp.ts +10 -0
- package/corpus/core/src/cli/skills.ts +58 -12
- package/corpus/core/src/client/error-format.ts +25 -0
- package/corpus/core/src/client/extensions/ExtensionViewer.tsx +13 -11
- package/corpus/core/src/client/guided-questions.tsx +32 -4
- package/corpus/core/src/client/onboarding/OnboardingPanel.tsx +33 -1
- package/corpus/core/src/client/resources/BuiltinCapabilityDetail.tsx +8 -0
- package/corpus/core/src/client/resources/use-builtin-capabilities.ts +4 -2
- package/corpus/core/src/client/session-replay.ts +34 -0
- package/corpus/core/src/client/sharing/ShareButton.tsx +106 -21
- package/corpus/core/src/coding-tools/index.ts +1 -1
- package/corpus/core/src/mcp/index.ts +2 -0
- package/corpus/core/src/mcp/screen-memory-stdio.ts +290 -0
- package/corpus/core/src/mcp-client/builtin-capabilities.ts +13 -1
- package/corpus/core/src/mcp-client/index.ts +9 -0
- package/corpus/core/src/mcp-client/screen-memory-local.ts +461 -0
- package/corpus/core/src/onboarding/types.ts +7 -0
- package/corpus/core/src/server/agent-chat-plugin.ts +25 -0
- package/corpus/core/src/server/agents-bundle.ts +35 -7
- package/corpus/core/src/styles/agent-native.css +5 -0
- package/corpus/core/src/templates/default/app/global.css +35 -35
- package/corpus/templates/analytics/AGENTS.md +6 -0
- package/corpus/templates/analytics/actions/github-repo-files.ts +9 -0
- package/corpus/templates/analytics/app/components/layout/Layout.tsx +4 -4
- package/corpus/templates/analytics/app/global.css +144 -40
- package/corpus/templates/analytics/app/pages/adhoc/explorer/index.tsx +1 -1
- package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/ChartCard.tsx +1 -1
- package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +1 -1
- package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +4 -4
- package/corpus/templates/analytics/app/pages/sessions/SessionsPage.tsx +9 -9
- package/corpus/templates/analytics/changelog/2026-06-29-agents-can-search-and-read-connected-github-repositories-whe.md +6 -0
- package/corpus/templates/analytics/changelog/2026-06-29-sessions-and-explorer-layouts-adapt-when-the-agent-sidebar-is.md +6 -0
- package/corpus/templates/assets/app/components/layout/Layout.tsx +3 -1
- package/corpus/templates/assets/app/components/library/LibraryPresetGrid.tsx +1 -1
- package/corpus/templates/assets/app/global.css +99 -35
- package/corpus/templates/assets/app/routes/asset.$id.tsx +2 -2
- package/corpus/templates/assets/app/routes/brand-kits.$id.tsx +4 -4
- package/corpus/templates/assets/app/routes/library.tsx +4 -4
- package/corpus/templates/assets/changelog/2026-06-29-asset-library-and-detail-layouts-adapt-when-the-agent-sidebar.md +6 -0
- package/corpus/templates/brain/app/components/layout/Layout.tsx +1 -1
- package/corpus/templates/brain/app/global.css +63 -35
- package/corpus/templates/brain/app/routes/search.tsx +1 -1
- package/corpus/templates/brain/app/routes/settings.tsx +1 -1
- package/corpus/templates/brain/app/routes/sources.tsx +2 -2
- package/corpus/templates/brain/changelog/2026-06-29-search-settings-and-source-layouts-adapt-when-the-agent-sidebar.md +6 -0
- package/corpus/templates/calendar/app/components/calendar/EventDetailPanel.tsx +4 -4
- package/corpus/templates/calendar/app/components/calendar/FindTimePanel.tsx +3 -2
- package/corpus/templates/calendar/app/components/layout/AppLayout.tsx +4 -2
- package/corpus/templates/calendar/app/global.css +69 -35
- package/corpus/templates/calendar/changelog/2026-06-29-event-and-find-time-layouts-adapt-when-the-agent-sidebar-is.md +6 -0
- package/corpus/templates/chat/app/components/layout/Layout.tsx +1 -1
- package/corpus/templates/chat/app/global.css +35 -35
- package/corpus/templates/chat/changelog/2026-06-29-chat-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
- package/corpus/templates/clips/AGENTS.md +13 -0
- package/corpus/templates/clips/actions/get-screen-memory-status.ts +12 -0
- package/corpus/templates/clips/actions/query-screen-memory-context.ts +29 -0
- package/corpus/templates/clips/actions/view-screen.ts +2 -2
- package/corpus/templates/clips/app/components/library/library-layout.tsx +1 -1
- package/corpus/templates/clips/app/global.css +47 -35
- package/corpus/templates/clips/app/routes/_app.meetings.$meetingId.tsx +3 -3
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +45 -18
- package/corpus/templates/clips/changelog/2026-06-29-meeting-detail-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-29-screen-memory-keeps-a-local-rolling-screen-buffer-for-agent-context.md +5 -0
- package/corpus/templates/clips/changelog/2026-06-29-video-chat-is-easier-to-find-on-recording-pages-and-s3-setup.md +6 -0
- package/corpus/templates/clips/chrome-extension/src/styles.css +39 -39
- package/corpus/templates/clips/desktop/src/app.tsx +290 -1
- package/corpus/templates/clips/desktop/src/shared/config.ts +83 -0
- package/corpus/templates/clips/desktop/src/styles.css +67 -52
- package/corpus/templates/clips/desktop/src-tauri/src/config.rs +50 -0
- package/corpus/templates/clips/desktop/src-tauri/src/lib.rs +17 -0
- package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +13 -13
- package/corpus/templates/clips/desktop/src-tauri/src/screen_memory.rs +990 -0
- package/corpus/templates/clips/server/plugins/onboarding.ts +2 -0
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +3 -3
- package/corpus/templates/content/app/components/layout/Layout.tsx +1 -1
- package/corpus/templates/content/app/global.css +29 -15
- package/corpus/templates/content/changelog/2026-06-29-database-gallery-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
- package/corpus/templates/design/.agents/skills/design-generation/SKILL.md +25 -20
- package/corpus/templates/design/.agents/skills/design-systems/SKILL.md +8 -0
- package/corpus/templates/design/.agents/skills/export-handoff/SKILL.md +8 -0
- package/corpus/templates/design/.agents/skills/visual-edit/SKILL.md +13 -0
- package/corpus/templates/design/AGENTS.md +20 -12
- package/corpus/templates/design/CODE_NATIVE_DESIGN_STUDIO_IMPLEMENTATION_PLAN.md +1054 -0
- package/corpus/templates/design/actions/apply-visual-edit.ts +24 -4
- package/corpus/templates/design/actions/export-coding-handoff.ts +12 -4
- package/corpus/templates/design/actions/generate-design.ts +6 -21
- package/corpus/templates/design/actions/generate-screens.ts +43 -2
- package/corpus/templates/design/actions/get-design.ts +1 -0
- package/corpus/templates/design/actions/present-design-variants.ts +355 -30
- package/corpus/templates/design/actions/view-screen.ts +75 -31
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +329 -69
- package/corpus/templates/design/app/components/design/DesignEditorSkeleton.tsx +1 -1
- package/corpus/templates/design/app/components/design/EditPanel.tsx +479 -77
- package/corpus/templates/design/app/components/design/LayersPanel.tsx +380 -216
- package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +1050 -196
- package/corpus/templates/design/app/components/design/QuestionFlow.tsx +83 -206
- package/corpus/templates/design/app/components/design/TweaksPanel.tsx +1 -1
- package/corpus/templates/design/app/components/design/index.ts +0 -1
- package/corpus/templates/design/app/components/design/inspector/AutoLayoutMatrix.tsx +225 -133
- package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +122 -11
- package/corpus/templates/design/app/components/design/inspector/ExportSettingsPanel.tsx +24 -5
- package/corpus/templates/design/app/components/design/inspector/ImageFillControls.tsx +57 -1
- package/corpus/templates/design/app/components/design/inspector/ScrubInput.tsx +37 -12
- package/corpus/templates/design/app/components/design/inspector/index.ts +1 -0
- package/corpus/templates/design/app/components/design/inspector/scrub-input-utils.ts +12 -5
- package/corpus/templates/design/app/components/design/types.ts +9 -0
- package/corpus/templates/design/app/components/layout/Layout.tsx +23 -5
- package/corpus/templates/design/app/global.css +77 -49
- package/corpus/templates/design/app/hooks/use-question-flow.ts +2 -2
- package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +8 -1
- package/corpus/templates/design/app/i18n/zh-TW.ts +3 -0
- package/corpus/templates/design/app/i18n-data.ts +45 -3
- package/corpus/templates/design/app/pages/DesignEditor.tsx +2602 -657
- package/corpus/templates/design/app/root.tsx +1 -1
- package/corpus/templates/design/changelog/2026-06-29-containers-no-longer-block-selecting-nested-elements-and-nor.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-design-agents-now-generate-and-refine-variants-from-stronger.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-design-inspector-controls-now-match-figmas-softer-dark-chrome.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-design-questions-now-appear-as-a-cleaner-canvas-intake-with-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-design-variant-directions-now-appear-as-board-screens-with-chat-buttons.md +5 -0
- package/corpus/templates/design/changelog/2026-06-29-element-selection-no-longer-snaps-back-to-the-previous-layer.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-frame-resize-measurements-now-stay-beside-the-cursor-while-d.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-inspector-number-fields-have-cleaner-tooltips-and-draggable-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-layer-locking-layer-nesting-generated-question-intake-and-im.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-layer-names-in-the-sidebar-can-scroll-horizontally-instead-o.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-layer-nesting-in-the-sidebar-now-uses-tighter-spacing-so-nam.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-layers-no-longer-repeat-document-wrapper-rows-when-a-screen-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-overview-previews-now-keep-element-hover-and-selection-tied-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-pressing-escape-now-cancels-a-stuck-screen-drag-in-the-overv.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-screen-overview-is-easier-to-find-and-named-screens-open-dir.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-screen-overview-only-highlights-screens-when-the-frame-or-ti.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-screen-overview-previews-now-resize-to-match-the-selected-de.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-screen-overview-selection-now-uses-a-pointer-cursor-instead-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-screen-overview-selection-outlines-now-stay-locked-to-the-se.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-screen-overview-zoom-now-reports-real-screen-scale-separatel.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-screen-overview-zooming-feels-smoother-and-selection-outline.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-screen-overview-zooming-now-stays-on-the-overview-canvas-ins.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-selecting-a-nested-layer-from-all-screens-now-keeps-you-in-a.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-share-now-groups-link-sharing-exports-and-agent-handoff.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-the-design-editor-loading-skeleton-now-uses-a-softer-charcoa.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-the-device-preview-menu-now-sits-next-to-the-preview-button-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-the-inspector-stays-read-only-while-an-empty-design-is-still.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-the-missing-design-view-now-matches-the-rest-of-the-editor-c.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-the-pen-tool-icon-and-tool-option-menus-better-match-the-edi.md +6 -0
- package/corpus/templates/design/changelog/2026-06-29-typography-controls-now-keep-the-font-name-visible-and-move-.md +6 -0
- package/corpus/templates/design/e2e/README.md +3 -3
- package/corpus/templates/design/e2e/global-setup.ts +11 -22
- package/corpus/templates/design/e2e/helpers.ts +122 -11
- package/corpus/templates/design/playwright.config.ts +9 -3
- package/corpus/templates/design/server/lib/coding-handoff.ts +126 -2
- package/corpus/templates/design/server/plugins/core-routes.ts +1 -2
- package/corpus/templates/design/server/routes/api/design-handoff/[id].zip.get.ts +86 -0
- package/corpus/templates/design/shared/code-layer.ts +125 -22
- package/corpus/templates/design/shared/generation-session.ts +41 -0
- package/corpus/templates/dispatch/app/global.css +79 -35
- package/corpus/templates/dispatch/app/routes/integrations.tsx +8 -7
- package/corpus/templates/dispatch/changelog/2026-06-29-integration-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
- package/corpus/templates/forms/app/components/layout/Layout.tsx +6 -2
- package/corpus/templates/forms/app/global.css +64 -35
- package/corpus/templates/forms/app/pages/FormsListPage.tsx +2 -2
- package/corpus/templates/forms/app/pages/ResponseInsightsPage.tsx +3 -3
- package/corpus/templates/forms/changelog/2026-06-29-form-list-and-insight-layouts-adapt-when-the-agent-sidebar.md +6 -0
- package/corpus/templates/macros/app/components/layout/AppLayout.tsx +3 -1
- package/corpus/templates/macros/app/global.css +25 -9
- package/corpus/templates/macros/changelog/2026-06-29-macro-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
- package/corpus/templates/mail/app/components/layout/AppLayout.tsx +6 -2
- package/corpus/templates/mail/app/global.css +42 -36
- package/corpus/templates/mail/app/pages/InboxPage.tsx +1 -1
- package/corpus/templates/mail/changelog/2026-06-29-the-contact-panel-now-adapts-to-the-available-mail-pane-width.md +6 -0
- package/corpus/templates/plan/app/components/layout/Layout.tsx +3 -1
- package/corpus/templates/plan/app/components/plan/DocumentArea.tsx +6 -7
- package/corpus/templates/plan/app/global.css +74 -42
- package/corpus/templates/plan/changelog/2026-06-29-plan-document-blocks-adapt-to-the-available-document-width.md +6 -0
- package/corpus/templates/plan/changelog/2026-06-29-plan-titles-and-summaries-can-be-edited-inline-without-focus.md +6 -0
- package/corpus/templates/slides/app/components/layout/Layout.tsx +3 -1
- package/corpus/templates/slides/app/global.css +49 -33
- package/corpus/templates/slides/changelog/2026-06-29-slide-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
- package/corpus/templates/videos/app/components/layout/Layout.tsx +3 -1
- package/corpus/templates/videos/app/global.css +35 -35
- package/corpus/templates/videos/changelog/2026-06-29-video-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
- package/dist/cli/mcp.d.ts.map +1 -1
- package/dist/cli/mcp.js +10 -0
- package/dist/cli/mcp.js.map +1 -1
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +58 -12
- package/dist/cli/skills.js.map +1 -1
- package/dist/client/error-format.d.ts.map +1 -1
- package/dist/client/error-format.js +17 -0
- package/dist/client/error-format.js.map +1 -1
- package/dist/client/extensions/ExtensionViewer.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionViewer.js +3 -4
- package/dist/client/extensions/ExtensionViewer.js.map +1 -1
- package/dist/client/guided-questions.d.ts +4 -0
- package/dist/client/guided-questions.d.ts.map +1 -1
- package/dist/client/guided-questions.js +16 -7
- package/dist/client/guided-questions.js.map +1 -1
- package/dist/client/onboarding/OnboardingPanel.js +26 -1
- package/dist/client/onboarding/OnboardingPanel.js.map +1 -1
- package/dist/client/resources/BuiltinCapabilityDetail.d.ts.map +1 -1
- package/dist/client/resources/BuiltinCapabilityDetail.js +1 -1
- package/dist/client/resources/BuiltinCapabilityDetail.js.map +1 -1
- package/dist/client/resources/use-builtin-capabilities.d.ts +1 -1
- package/dist/client/resources/use-builtin-capabilities.d.ts.map +1 -1
- package/dist/client/resources/use-builtin-capabilities.js +2 -1
- package/dist/client/resources/use-builtin-capabilities.js.map +1 -1
- package/dist/client/session-replay.d.ts.map +1 -1
- package/dist/client/session-replay.js +31 -0
- package/dist/client/session-replay.js.map +1 -1
- package/dist/client/sharing/ShareButton.d.ts +14 -0
- package/dist/client/sharing/ShareButton.d.ts.map +1 -1
- package/dist/client/sharing/ShareButton.js +36 -7
- package/dist/client/sharing/ShareButton.js.map +1 -1
- package/dist/coding-tools/index.js +1 -1
- package/dist/coding-tools/index.js.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +2 -2
- package/dist/mcp/index.d.ts +2 -0
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +1 -0
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/screen-memory-stdio.d.ts +6 -0
- package/dist/mcp/screen-memory-stdio.d.ts.map +1 -0
- package/dist/mcp/screen-memory-stdio.js +213 -0
- package/dist/mcp/screen-memory-stdio.js.map +1 -0
- package/dist/mcp-client/builtin-capabilities.d.ts +1 -1
- package/dist/mcp-client/builtin-capabilities.d.ts.map +1 -1
- package/dist/mcp-client/builtin-capabilities.js +10 -0
- package/dist/mcp-client/builtin-capabilities.js.map +1 -1
- package/dist/mcp-client/index.d.ts +1 -0
- package/dist/mcp-client/index.d.ts.map +1 -1
- package/dist/mcp-client/index.js +1 -0
- package/dist/mcp-client/index.js.map +1 -1
- package/dist/mcp-client/screen-memory-local.d.ts +61 -0
- package/dist/mcp-client/screen-memory-local.d.ts.map +1 -0
- package/dist/mcp-client/screen-memory-local.js +336 -0
- package/dist/mcp-client/screen-memory-local.js.map +1 -0
- package/dist/notifications/routes.d.ts +2 -2
- package/dist/observability/routes.d.ts +8 -8
- package/dist/onboarding/types.d.ts +7 -0
- package/dist/onboarding/types.d.ts.map +1 -1
- package/dist/onboarding/types.js.map +1 -1
- package/dist/resources/handlers.d.ts +2 -2
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +26 -0
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/agents-bundle.d.ts.map +1 -1
- package/dist/server/agents-bundle.js +22 -7
- package/dist/server/agents-bundle.js.map +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/styles/agent-native.css +5 -0
- package/dist/templates/default/app/global.css +35 -35
- package/docs/content/locales/ar-SA/template-design.mdx +6 -0
- package/docs/content/locales/de-DE/template-design.mdx +8 -0
- package/docs/content/locales/es-ES/template-design.mdx +10 -2
- package/docs/content/locales/fr-FR/template-design.mdx +10 -2
- package/docs/content/locales/hi-IN/template-design.mdx +7 -0
- package/docs/content/locales/ja-JP/template-design.mdx +7 -0
- package/docs/content/locales/ko-KR/template-design.mdx +7 -0
- package/docs/content/locales/pt-BR/template-design.mdx +9 -2
- package/docs/content/locales/zh-CN/template-design.mdx +6 -0
- package/docs/content/locales/zh-TW/template-design.mdx +6 -0
- package/docs/content/template-design.mdx +9 -2
- package/package.json +1 -1
- package/src/templates/default/app/global.css +35 -35
- package/corpus/templates/design/app/components/design/VariantGrid.tsx +0 -189
- package/corpus/templates/design/app/components/design/VariantHandoffCard.tsx +0 -115
- package/corpus/templates/design/app/hooks/use-variant-flow.ts +0 -342
package/dist/cli/mcp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../src/cli/mcp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,OAAO,EAEP,mBAAmB,EACnB,oBAAoB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AC,KAAK,UAAU,MAAM,CAAC,IAAc;IACzC,MAAM,CAAC,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAC1B,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEnB,QAAQ,GAAG,EAAE,CAAC;QACZ,KAAK,OAAO;YACV,MAAM,QAAQ,CAAC,CAAC,CAAC,CAAC;YAClB,OAAO;QACT,KAAK,SAAS;YACZ,MAAM,UAAU,CAAC,CAAC,CAAC,CAAC;YACpB,OAAO;QACT,KAAK,WAAW;YACd,YAAY,CAAC,CAAC,CAAC,CAAC;YAChB,OAAO;QACT,KAAK,QAAQ;YACX,MAAM,SAAS,EAAE,CAAC;YAClB,OAAO;QACT,KAAK,OAAO;YACV,QAAQ,CAAC,CAAC,CAAC,CAAC;YACZ,OAAO;QACT,KAAK,SAAS,CAAC;QACf,KAAK,QAAQ,CAAC;QACd,KAAK,IAAI,CAAC;QACV,KAAK,MAAM;YACT,MAAM,CAAC,IAAI,CAAC,CAAC;YACb,OAAO;QACT;YACE,MAAM,CAAC,2BAA2B,GAAG,EAAE,CAAC,CAAC;YACzC,MAAM,CAAC,IAAI,CAAC,CAAC;YACb,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACH,CAAC","sourcesContent":["/**\n * `agent-native mcp <subcommand>` — connect external coding agents (Claude\n * Code desktop & CLI, Claude Cowork, Codex, Cursor, OpenCode, GitHub Copilot /\n * VS Code) to this agent-native app/workspace over MCP.\n *\n * serve Run the MCP stdio transport (this is what client configs spawn).\n * install Provision a token + write the client's MCP config idempotently.\n * uninstall Remove the named entry from a client's MCP config.\n * status Print resolved MCP URL/port, token state, and per-client entries.\n * token Print or rotate the local ACCESS_TOKEN in the workspace .env.\n *\n * Node-only CLI module. Hand-rolled `.env` upsert + minimal TOML block merge\n * keep this dependency-free (no new npm deps).\n */\n\nimport crypto from \"node:crypto\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { runMCPStdio } from \"../mcp/stdio.js\";\nimport {\n findWorkspaceRoot,\n resolveLocalAppOrigin,\n resolveWorkspace,\n} from \"../mcp/workspace-resolve.js\";\nimport {\n CLIENTS,\n type ClientId,\n buildCodexHttpBlock,\n buildCodexLocalBlock,\n buildHttpMcpEntryForClient,\n buildLocalMcpEntryForClient,\n codexConfigPath,\n codexHasBlock,\n configPathFor as clientConfigPathFor,\n hasJsonMcpEntryForClient,\n writeCodexBlock,\n writeFileAtomic,\n writeJsonMcpEntryForClient,\n} from \"./mcp-config-writers.js\";\n\nconst SERVER_NAME_PREFIX = \"agent-native\";\n\ninterface ParsedArgs {\n _: string[];\n client?: string;\n app?: string;\n port?: number;\n scope?: string;\n standalone: boolean;\n rotate: boolean;\n}\n\nfunction parseArgs(argv: string[]): ParsedArgs {\n const out: ParsedArgs = { _: [], standalone: false, rotate: false };\n for (let i = 0; i < argv.length; i++) {\n const a = argv[i];\n const eat = (flag: string): string | undefined => {\n if (a === flag) return argv[++i];\n if (a.startsWith(`${flag}=`)) return a.slice(flag.length + 1);\n return undefined;\n };\n let v: string | undefined;\n if ((v = eat(\"--client\")) !== undefined) out.client = v;\n else if ((v = eat(\"--app\")) !== undefined) out.app = v;\n else if ((v = eat(\"--port\")) !== undefined) out.port = Number(v);\n else if ((v = eat(\"--scope\")) !== undefined) out.scope = v;\n else if (a === \"--standalone\") out.standalone = true;\n else if (a === \"--rotate\") out.rotate = true;\n else if (!a.startsWith(\"-\")) out._.push(a);\n }\n return out;\n}\n\nfunction logErr(msg: string): void {\n process.stderr.write(`${msg}\\n`);\n}\nfunction logOut(msg: string): void {\n process.stdout.write(`${msg}\\n`);\n}\n\n// ---------------------------------------------------------------------------\n// .env token provisioning (local dev) — hand-rolled idempotent upsert\n// ---------------------------------------------------------------------------\n\n/** Workspace root (or cwd for a standalone app) — where .env lives. */\nfunction envBaseDir(cwd = process.cwd()): string {\n return findWorkspaceRoot(cwd) ?? path.resolve(cwd);\n}\n\n/** Prefer .env.local, else .env. Returns the path we should write to. */\nfunction envFilePath(baseDir: string): string {\n const local = path.join(baseDir, \".env.local\");\n if (fs.existsSync(local)) return local;\n return path.join(baseDir, \".env\");\n}\n\nfunction readEnvFile(file: string): string {\n try {\n return fs.readFileSync(file, \"utf-8\");\n } catch {\n return \"\";\n }\n}\n\n/** Read a single key from a dotenv-format string (last assignment wins). */\nfunction getEnvValue(content: string, key: string): string | undefined {\n let found: string | undefined;\n for (const line of content.split(/\\r?\\n/)) {\n const m = line.match(/^\\s*([A-Z0-9_]+)\\s*=\\s*(.*)\\s*$/i);\n if (m && m[1] === key) {\n found = m[2].replace(/^[\"']|[\"']$/g, \"\");\n }\n }\n return found;\n}\n\n/**\n * Idempotently set `key=value` in the dotenv file. If the key already exists\n * we leave it untouched unless `force` is set (used by `token --rotate`).\n * Never clobbers an existing token implicitly.\n */\nfunction upsertEnv(\n file: string,\n key: string,\n value: string,\n force = false,\n): { changed: boolean; value: string } {\n const content = readEnvFile(file);\n const existing = getEnvValue(content, key);\n if (existing && !force) return { changed: false, value: existing };\n\n const line = `${key}=${value}`;\n let next: string;\n if (new RegExp(`^\\\\s*${key}\\\\s*=`, \"m\").test(content)) {\n next = content.replace(new RegExp(`^\\\\s*${key}\\\\s*=.*$`, \"m\"), line);\n } else {\n next =\n content.length === 0\n ? `${line}\\n`\n : `${content.replace(/\\n*$/, \"\")}\\n${line}\\n`;\n }\n writeFileAtomic(file, next);\n return { changed: true, value };\n}\n\nfunction generateToken(): string {\n return crypto.randomBytes(24).toString(\"base64url\");\n}\n\n/**\n * Ensure a local ACCESS_TOKEN exists in the workspace .env and return it.\n * Existing tokens are reused (never clobbered). Set `rotate` to replace it.\n */\nfunction ensureLocalToken(\n cwd: string,\n rotate = false,\n): { token: string; file: string; created: boolean } {\n const baseDir = envBaseDir(cwd);\n const file = envFilePath(baseDir);\n const content = readEnvFile(file);\n const existing = getEnvValue(content, \"ACCESS_TOKEN\");\n if (existing && !rotate) {\n return { token: existing, file, created: false };\n }\n const token = generateToken();\n upsertEnv(file, \"ACCESS_TOKEN\", token, true);\n return { token, file, created: true };\n}\n\n// ---------------------------------------------------------------------------\n// Hosted vs local detection\n// ---------------------------------------------------------------------------\n\n/**\n * Detect a hosted deployment URL. When the workspace .env points at a hosted\n * origin (APP_URL / BETTER_AUTH_URL with a non-localhost host) we write an\n * `http` client entry pointing at `<origin>/_agent-native/mcp` with a JWT\n * bearer instead of a stdio entry.\n */\nfunction detectHostedUrl(cwd: string): string | undefined {\n const baseDir = envBaseDir(cwd);\n const content =\n readEnvFile(path.join(baseDir, \".env.local\")) +\n \"\\n\" +\n readEnvFile(path.join(baseDir, \".env\"));\n for (const key of [\"AGENT_NATIVE_MCP_URL\", \"APP_URL\", \"BETTER_AUTH_URL\"]) {\n const v = getEnvValue(content, key);\n if (!v) continue;\n try {\n const u = new URL(v);\n if (!/^(localhost|127\\.0\\.0\\.1|\\[::1\\])$/.test(u.hostname)) {\n return `${u.origin}/_agent-native/mcp`;\n }\n } catch {\n // not a URL — skip\n }\n }\n return undefined;\n}\n\nasync function mintHostedJwt(cwd: string): Promise<string | undefined> {\n // Reuse the existing A2A signer — do not reinvent JWT minting.\n const owner =\n process.env.AGENT_NATIVE_OWNER_EMAIL ||\n process.env.OWNER_EMAIL ||\n \"owner@localhost\";\n let fileA2ASecret: string | undefined;\n if (!process.env.A2A_SECRET) {\n const baseDir = envBaseDir(cwd);\n const content =\n readEnvFile(path.join(baseDir, \".env.local\")) +\n \"\\n\" +\n readEnvFile(path.join(baseDir, \".env\"));\n fileA2ASecret = getEnvValue(content, \"A2A_SECRET\");\n }\n try {\n const { signA2AToken } = await import(\"../a2a/client.js\");\n return await signA2AToken(\n owner,\n undefined,\n process.env.A2A_SECRET || fileA2ASecret,\n {\n preferGlobalSecret: true,\n expiresIn: \"30d\",\n },\n );\n } catch (err: any) {\n logErr(\n ` Could not mint a hosted JWT (${err?.message ?? err}). ` +\n `Set A2A_SECRET in your workspace .env, or use the local stdio entry.`,\n );\n return undefined;\n }\n}\n\n// ---------------------------------------------------------------------------\n// Client config entries\n// ---------------------------------------------------------------------------\n\ninterface ServerEntryInputs {\n serverName: string;\n appId: string;\n token?: string;\n ownerEmail?: string;\n hostedUrl?: string;\n standalone: boolean;\n}\n\nfunction mcpServeArgs(i: ServerEntryInputs): string[] {\n const args = [\"mcp\", \"serve\"];\n if (i.appId) args.push(\"--app\", i.appId);\n if (i.standalone) args.push(\"--standalone\");\n return args;\n}\n\nfunction mcpServeEnv(i: ServerEntryInputs): Record<string, string> {\n const env: Record<string, string> = {};\n if (i.token) env.ACCESS_TOKEN = i.token;\n if (i.ownerEmail) env.AGENT_NATIVE_OWNER_EMAIL = i.ownerEmail;\n return env;\n}\n\nfunction buildJsonServerEntry(\n client: ClientId,\n i: ServerEntryInputs,\n): Record<string, unknown> {\n if (i.hostedUrl) {\n return buildHttpMcpEntryForClient(client, i.hostedUrl, i.token);\n }\n return buildLocalMcpEntryForClient(client, mcpServeArgs(i), mcpServeEnv(i));\n}\n\nfunction buildCodexBlock(name: string, i: ServerEntryInputs): string {\n if (i.hostedUrl) {\n return buildCodexHttpBlock(name, i.hostedUrl, i.token);\n }\n return buildCodexLocalBlock(name, mcpServeArgs(i), mcpServeEnv(i));\n}\n\n// ---------------------------------------------------------------------------\n// Per-client install/uninstall/status\n// ---------------------------------------------------------------------------\n\nfunction configPathFor(\n client: ClientId,\n cwd: string,\n scope: string | undefined,\n): string {\n return clientConfigPathFor(client, envBaseDir(cwd), scope);\n}\n\nfunction serverNameFor(appId: string): string {\n return `${SERVER_NAME_PREFIX}-${appId}`;\n}\n\n// Clients advertised in usage/help and listed by status. Excludes the legacy\n// `claude-code-cli` alias so only a single \"Claude Code\" appears (it is still\n// accepted via --client and collapses to claude-code).\nconst SELECTABLE_CLIENTS: ClientId[] = CLIENTS.filter(\n (c) => c !== \"claude-code-cli\",\n);\n\nfunction normalizeClientId(raw: string | undefined): ClientId | null {\n const value = (raw ?? \"\").toLowerCase();\n if (\n value === \"claude\" ||\n value === \"claude-code-desktop\" ||\n value === \"claude-code-cli\"\n ) {\n return \"claude-code\";\n }\n if (value === \"open-code\") return \"opencode\";\n if (value === \"copilot\" || value === \"vscode\" || value === \"vs-code\") {\n return \"github-copilot\";\n }\n return (CLIENTS as string[]).includes(value) ? (value as ClientId) : null;\n}\n\nfunction installForClient(\n client: ClientId,\n inputs: ServerEntryInputs,\n cwd: string,\n scope: string | undefined,\n): string {\n const name = inputs.serverName;\n const file = configPathFor(client, cwd, scope);\n if (client === \"codex\") {\n writeCodexBlock(file, name, buildCodexBlock(name, inputs));\n } else {\n writeJsonMcpEntryForClient(\n client,\n file,\n name,\n buildJsonServerEntry(client, inputs),\n );\n }\n return file;\n}\n\nfunction uninstallForClient(\n client: ClientId,\n appId: string,\n cwd: string,\n scope: string | undefined,\n): { file: string; removed: boolean } {\n const name = serverNameFor(appId);\n const file = configPathFor(client, cwd, scope);\n if (client === \"codex\") {\n const had = codexHasBlock(file, name);\n if (had) writeCodexBlock(file, name, null);\n return { file, removed: had };\n }\n const had = hasJsonMcpEntryForClient(client, file, name);\n if (had) writeJsonMcpEntryForClient(client, file, name, null);\n return { file, removed: had };\n}\n\nfunction clientHasEntry(client: ClientId, appId: string, cwd: string): boolean {\n const name = serverNameFor(appId);\n if (client === \"codex\") return codexHasBlock(codexConfigPath(), name);\n if (client === \"cowork\") {\n return hasJsonMcpEntryForClient(\n client,\n configPathFor(client, cwd, undefined),\n name,\n );\n }\n return (\n hasJsonMcpEntryForClient(\n client,\n configPathFor(client, cwd, \"project\"),\n name,\n ) ||\n hasJsonMcpEntryForClient(client, configPathFor(client, cwd, \"user\"), name)\n );\n}\n\n// ---------------------------------------------------------------------------\n// Subcommands\n// ---------------------------------------------------------------------------\n\nasync function cmdServe(p: ParsedArgs): Promise<void> {\n await runMCPStdio({\n appId: p.app,\n port: p.port,\n standalone: p.standalone,\n });\n}\n\nasync function cmdInstall(p: ParsedArgs): Promise<void> {\n const client = normalizeClientId(p.client);\n if (!client) {\n logErr(\n `Usage: npx @agent-native/core@latest mcp install --client ${SELECTABLE_CLIENTS.join(\"|\")} ` +\n `[--app <id>] [--scope user|project]`,\n );\n process.exit(1);\n }\n const cwd = process.cwd();\n\n // Resolve which app this entry targets (default = workspace default app).\n let appId = p.app;\n if (!appId) {\n try {\n const resolved = await resolveLocalAppOrigin({ cwd });\n appId = resolved.appId;\n } catch {\n appId = \"app\";\n }\n }\n const serverName = serverNameFor(appId);\n\n const hostedUrl = detectHostedUrl(cwd);\n const ownerEmail = process.env.AGENT_NATIVE_OWNER_EMAIL;\n\n let token: string | undefined;\n if (hostedUrl) {\n token = await mintHostedJwt(cwd);\n logOut(`Detected hosted deployment: ${hostedUrl}`);\n } else {\n const t = ensureLocalToken(cwd, false);\n token = t.token;\n logOut(\n t.created\n ? `Provisioned ACCESS_TOKEN in ${t.file}`\n : `Reusing existing ACCESS_TOKEN from ${t.file}`,\n );\n }\n\n const inputs: ServerEntryInputs = {\n serverName,\n appId: appId!,\n token,\n ownerEmail,\n hostedUrl,\n standalone: p.standalone,\n };\n\n const file = installForClient(client, inputs, cwd, p.scope);\n logOut(`Installed \"${serverName}\" for ${client} → ${file}`);\n logOut(\n hostedUrl\n ? ` Mode: http (${hostedUrl})`\n : ` Mode: stdio (npx @agent-native/core@latest mcp serve --app ${appId}${\n p.standalone ? \" --standalone\" : \"\"\n })`,\n );\n logOut(` Restart ${client} to pick up the new MCP server.`);\n}\n\nfunction cmdUninstall(p: ParsedArgs): void {\n const client = normalizeClientId(p.client);\n if (!client) {\n logErr(\n `Usage: npx @agent-native/core@latest mcp uninstall --client ${SELECTABLE_CLIENTS.join(\"|\")} ` +\n `[--app <id>]`,\n );\n process.exit(1);\n }\n const cwd = process.cwd();\n const appId = p.app ?? \"app\";\n const { file, removed } = uninstallForClient(client, appId, cwd, p.scope);\n logOut(\n removed\n ? `Removed \"${serverNameFor(appId)}\" from ${client} → ${file}`\n : `No \"${serverNameFor(appId)}\" entry found for ${client} (${file}) — nothing to do.`,\n );\n}\n\nasync function cmdStatus(): Promise<void> {\n const cwd = process.cwd();\n let appId = \"app\";\n let origin = \"(app not running)\";\n let port: number | undefined;\n try {\n const resolved = await resolveLocalAppOrigin({ cwd });\n appId = resolved.appId;\n origin = resolved.origin;\n const ws = await resolveWorkspace(cwd);\n port = ws.apps.find((a) => a.id === appId)?.port;\n } catch (err: any) {\n logErr(` Could not resolve app: ${err?.message ?? err}`);\n }\n\n const hostedUrl = detectHostedUrl(cwd);\n const baseDir = envBaseDir(cwd);\n const envContent =\n readEnvFile(path.join(baseDir, \".env.local\")) +\n \"\\n\" +\n readEnvFile(path.join(baseDir, \".env\"));\n const hasToken = !!getEnvValue(envContent, \"ACCESS_TOKEN\");\n const hasA2A =\n !!process.env.A2A_SECRET || !!getEnvValue(envContent, \"A2A_SECRET\");\n\n logOut(`Agent-Native MCP status`);\n logOut(` App: ${appId}`);\n logOut(\n hostedUrl\n ? ` MCP URL: ${hostedUrl} (hosted)`\n : ` MCP URL: ${origin}/_agent-native/mcp${\n port ? ` (port ${port})` : \"\"\n }`,\n );\n logOut(` ACCESS_TOKEN: ${hasToken ? \"set\" : \"not set\"} (.env)`);\n logOut(` A2A_SECRET: ${hasA2A ? \"set\" : \"not set\"}`);\n logOut(` Clients:`);\n for (const client of SELECTABLE_CLIENTS) {\n const present = clientHasEntry(client, appId, cwd);\n logOut(` ${client.padEnd(18)} ${present ? \"configured\" : \"—\"}`);\n }\n}\n\nfunction cmdToken(p: ParsedArgs): void {\n const cwd = process.cwd();\n const t = ensureLocalToken(cwd, p.rotate);\n logOut(\n p.rotate\n ? `Rotated ACCESS_TOKEN in ${t.file}`\n : t.created\n ? `Provisioned ACCESS_TOKEN in ${t.file}`\n : `ACCESS_TOKEN (${t.file}):`,\n );\n logOut(t.token);\n if (p.rotate) {\n logOut(\n ` Re-run \\`npx @agent-native/core@latest mcp install --client <c>\\` so client configs ` +\n `pick up the new token.`,\n );\n }\n}\n\nconst HELP = `npx @agent-native/core@latest mcp — connect external coding agents over MCP\n\nUsage:\n npx @agent-native/core@latest mcp serve [--app <id>] [--port <n>] [--standalone]\n Run the MCP stdio transport (what client configs spawn).\n Default: proxy to the running local app; --standalone builds from disk.\n\n npx @agent-native/core@latest mcp install --client <c> [--app <id>] [--scope user|project]\n Provision a token and write the client's MCP config (idempotent).\n Clients: claude-code, codex, cowork, cursor, opencode, github-copilot\n\n npx @agent-native/core@latest mcp uninstall --client <c> [--app <id>]\n Remove the named MCP entry from a client's config (idempotent).\n\n npx @agent-native/core@latest mcp status\n Show resolved MCP URL/port, token state, and per-client entries.\n\n npx @agent-native/core@latest mcp token [--rotate]\n Print (or rotate) the local ACCESS_TOKEN in the workspace .env.`;\n\nexport async function runMcp(args: string[]): Promise<void> {\n const p = parseArgs(args);\n const sub = p._[0];\n\n switch (sub) {\n case \"serve\":\n await cmdServe(p);\n return;\n case \"install\":\n await cmdInstall(p);\n return;\n case \"uninstall\":\n cmdUninstall(p);\n return;\n case \"status\":\n await cmdStatus();\n return;\n case \"token\":\n cmdToken(p);\n return;\n case undefined:\n case \"--help\":\n case \"-h\":\n case \"help\":\n logOut(HELP);\n return;\n default:\n logErr(`Unknown mcp subcommand: ${sub}`);\n logOut(HELP);\n process.exit(1);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../src/cli/mcp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,OAAO,EAEP,mBAAmB,EAC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F;YACtF,wBAAwB,CAC3B,CAAC;IACJ,CAAC;AACH,CAAC;AAED,MAAM,IAAI,GAAG;;;;;;;;;;;;;;;;;;;;;;sEAsByD,CAAC;AAEvE,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,IAAc;IACzC,MAAM,CAAC,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAC1B,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEnB,QAAQ,GAAG,EAAE,CAAC;QACZ,KAAK,OAAO;YACV,MAAM,QAAQ,CAAC,CAAC,CAAC,CAAC;YAClB,OAAO;QACT,KAAK,eAAe;YAClB,MAAM,uBAAuB,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,eAAe,EAAE,CAAC,CAAC;YAC/D,OAAO;QACT,KAAK,SAAS;YACZ,MAAM,UAAU,CAAC,CAAC,CAAC,CAAC;YACpB,OAAO;QACT,KAAK,WAAW;YACd,YAAY,CAAC,CAAC,CAAC,CAAC;YAChB,OAAO;QACT,KAAK,QAAQ;YACX,MAAM,SAAS,EAAE,CAAC;YAClB,OAAO;QACT,KAAK,OAAO;YACV,QAAQ,CAAC,CAAC,CAAC,CAAC;YACZ,OAAO;QACT,KAAK,SAAS,CAAC;QACf,KAAK,QAAQ,CAAC;QACd,KAAK,IAAI,CAAC;QACV,KAAK,MAAM;YACT,MAAM,CAAC,IAAI,CAAC,CAAC;YACb,OAAO;QACT;YACE,MAAM,CAAC,2BAA2B,GAAG,EAAE,CAAC,CAAC;YACzC,MAAM,CAAC,IAAI,CAAC,CAAC;YACb,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACH,CAAC","sourcesContent":["/**\n * `agent-native mcp <subcommand>` — connect external coding agents (Claude\n * Code desktop & CLI, Claude Cowork, Codex, Cursor, OpenCode, GitHub Copilot /\n * VS Code) to this agent-native app/workspace over MCP.\n *\n * serve Run the MCP stdio transport (this is what client configs spawn).\n * install Provision a token + write the client's MCP config idempotently.\n * uninstall Remove the named entry from a client's MCP config.\n * status Print resolved MCP URL/port, token state, and per-client entries.\n * token Print or rotate the local ACCESS_TOKEN in the workspace .env.\n *\n * Node-only CLI module. Hand-rolled `.env` upsert + minimal TOML block merge\n * keep this dependency-free (no new npm deps).\n */\n\nimport crypto from \"node:crypto\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { runScreenMemoryMCPStdio } from \"../mcp/screen-memory-stdio.js\";\nimport { runMCPStdio } from \"../mcp/stdio.js\";\nimport {\n findWorkspaceRoot,\n resolveLocalAppOrigin,\n resolveWorkspace,\n} from \"../mcp/workspace-resolve.js\";\nimport {\n CLIENTS,\n type ClientId,\n buildCodexHttpBlock,\n buildCodexLocalBlock,\n buildHttpMcpEntryForClient,\n buildLocalMcpEntryForClient,\n codexConfigPath,\n codexHasBlock,\n configPathFor as clientConfigPathFor,\n hasJsonMcpEntryForClient,\n writeCodexBlock,\n writeFileAtomic,\n writeJsonMcpEntryForClient,\n} from \"./mcp-config-writers.js\";\n\nconst SERVER_NAME_PREFIX = \"agent-native\";\n\ninterface ParsedArgs {\n _: string[];\n client?: string;\n app?: string;\n port?: number;\n screenMemoryDir?: string;\n scope?: string;\n standalone: boolean;\n rotate: boolean;\n}\n\nfunction parseArgs(argv: string[]): ParsedArgs {\n const out: ParsedArgs = { _: [], standalone: false, rotate: false };\n for (let i = 0; i < argv.length; i++) {\n const a = argv[i];\n const eat = (flag: string): string | undefined => {\n if (a === flag) return argv[++i];\n if (a.startsWith(`${flag}=`)) return a.slice(flag.length + 1);\n return undefined;\n };\n let v: string | undefined;\n if ((v = eat(\"--client\")) !== undefined) out.client = v;\n else if ((v = eat(\"--app\")) !== undefined) out.app = v;\n else if ((v = eat(\"--port\")) !== undefined) out.port = Number(v);\n else if ((v = eat(\"--dir\")) !== undefined) out.screenMemoryDir = v;\n else if ((v = eat(\"--scope\")) !== undefined) out.scope = v;\n else if (a === \"--standalone\") out.standalone = true;\n else if (a === \"--rotate\") out.rotate = true;\n else if (!a.startsWith(\"-\")) out._.push(a);\n }\n return out;\n}\n\nfunction logErr(msg: string): void {\n process.stderr.write(`${msg}\\n`);\n}\nfunction logOut(msg: string): void {\n process.stdout.write(`${msg}\\n`);\n}\n\n// ---------------------------------------------------------------------------\n// .env token provisioning (local dev) — hand-rolled idempotent upsert\n// ---------------------------------------------------------------------------\n\n/** Workspace root (or cwd for a standalone app) — where .env lives. */\nfunction envBaseDir(cwd = process.cwd()): string {\n return findWorkspaceRoot(cwd) ?? path.resolve(cwd);\n}\n\n/** Prefer .env.local, else .env. Returns the path we should write to. */\nfunction envFilePath(baseDir: string): string {\n const local = path.join(baseDir, \".env.local\");\n if (fs.existsSync(local)) return local;\n return path.join(baseDir, \".env\");\n}\n\nfunction readEnvFile(file: string): string {\n try {\n return fs.readFileSync(file, \"utf-8\");\n } catch {\n return \"\";\n }\n}\n\n/** Read a single key from a dotenv-format string (last assignment wins). */\nfunction getEnvValue(content: string, key: string): string | undefined {\n let found: string | undefined;\n for (const line of content.split(/\\r?\\n/)) {\n const m = line.match(/^\\s*([A-Z0-9_]+)\\s*=\\s*(.*)\\s*$/i);\n if (m && m[1] === key) {\n found = m[2].replace(/^[\"']|[\"']$/g, \"\");\n }\n }\n return found;\n}\n\n/**\n * Idempotently set `key=value` in the dotenv file. If the key already exists\n * we leave it untouched unless `force` is set (used by `token --rotate`).\n * Never clobbers an existing token implicitly.\n */\nfunction upsertEnv(\n file: string,\n key: string,\n value: string,\n force = false,\n): { changed: boolean; value: string } {\n const content = readEnvFile(file);\n const existing = getEnvValue(content, key);\n if (existing && !force) return { changed: false, value: existing };\n\n const line = `${key}=${value}`;\n let next: string;\n if (new RegExp(`^\\\\s*${key}\\\\s*=`, \"m\").test(content)) {\n next = content.replace(new RegExp(`^\\\\s*${key}\\\\s*=.*$`, \"m\"), line);\n } else {\n next =\n content.length === 0\n ? `${line}\\n`\n : `${content.replace(/\\n*$/, \"\")}\\n${line}\\n`;\n }\n writeFileAtomic(file, next);\n return { changed: true, value };\n}\n\nfunction generateToken(): string {\n return crypto.randomBytes(24).toString(\"base64url\");\n}\n\n/**\n * Ensure a local ACCESS_TOKEN exists in the workspace .env and return it.\n * Existing tokens are reused (never clobbered). Set `rotate` to replace it.\n */\nfunction ensureLocalToken(\n cwd: string,\n rotate = false,\n): { token: string; file: string; created: boolean } {\n const baseDir = envBaseDir(cwd);\n const file = envFilePath(baseDir);\n const content = readEnvFile(file);\n const existing = getEnvValue(content, \"ACCESS_TOKEN\");\n if (existing && !rotate) {\n return { token: existing, file, created: false };\n }\n const token = generateToken();\n upsertEnv(file, \"ACCESS_TOKEN\", token, true);\n return { token, file, created: true };\n}\n\n// ---------------------------------------------------------------------------\n// Hosted vs local detection\n// ---------------------------------------------------------------------------\n\n/**\n * Detect a hosted deployment URL. When the workspace .env points at a hosted\n * origin (APP_URL / BETTER_AUTH_URL with a non-localhost host) we write an\n * `http` client entry pointing at `<origin>/_agent-native/mcp` with a JWT\n * bearer instead of a stdio entry.\n */\nfunction detectHostedUrl(cwd: string): string | undefined {\n const baseDir = envBaseDir(cwd);\n const content =\n readEnvFile(path.join(baseDir, \".env.local\")) +\n \"\\n\" +\n readEnvFile(path.join(baseDir, \".env\"));\n for (const key of [\"AGENT_NATIVE_MCP_URL\", \"APP_URL\", \"BETTER_AUTH_URL\"]) {\n const v = getEnvValue(content, key);\n if (!v) continue;\n try {\n const u = new URL(v);\n if (!/^(localhost|127\\.0\\.0\\.1|\\[::1\\])$/.test(u.hostname)) {\n return `${u.origin}/_agent-native/mcp`;\n }\n } catch {\n // not a URL — skip\n }\n }\n return undefined;\n}\n\nasync function mintHostedJwt(cwd: string): Promise<string | undefined> {\n // Reuse the existing A2A signer — do not reinvent JWT minting.\n const owner =\n process.env.AGENT_NATIVE_OWNER_EMAIL ||\n process.env.OWNER_EMAIL ||\n \"owner@localhost\";\n let fileA2ASecret: string | undefined;\n if (!process.env.A2A_SECRET) {\n const baseDir = envBaseDir(cwd);\n const content =\n readEnvFile(path.join(baseDir, \".env.local\")) +\n \"\\n\" +\n readEnvFile(path.join(baseDir, \".env\"));\n fileA2ASecret = getEnvValue(content, \"A2A_SECRET\");\n }\n try {\n const { signA2AToken } = await import(\"../a2a/client.js\");\n return await signA2AToken(\n owner,\n undefined,\n process.env.A2A_SECRET || fileA2ASecret,\n {\n preferGlobalSecret: true,\n expiresIn: \"30d\",\n },\n );\n } catch (err: any) {\n logErr(\n ` Could not mint a hosted JWT (${err?.message ?? err}). ` +\n `Set A2A_SECRET in your workspace .env, or use the local stdio entry.`,\n );\n return undefined;\n }\n}\n\n// ---------------------------------------------------------------------------\n// Client config entries\n// ---------------------------------------------------------------------------\n\ninterface ServerEntryInputs {\n serverName: string;\n appId: string;\n token?: string;\n ownerEmail?: string;\n hostedUrl?: string;\n standalone: boolean;\n}\n\nfunction mcpServeArgs(i: ServerEntryInputs): string[] {\n const args = [\"mcp\", \"serve\"];\n if (i.appId) args.push(\"--app\", i.appId);\n if (i.standalone) args.push(\"--standalone\");\n return args;\n}\n\nfunction mcpServeEnv(i: ServerEntryInputs): Record<string, string> {\n const env: Record<string, string> = {};\n if (i.token) env.ACCESS_TOKEN = i.token;\n if (i.ownerEmail) env.AGENT_NATIVE_OWNER_EMAIL = i.ownerEmail;\n return env;\n}\n\nfunction buildJsonServerEntry(\n client: ClientId,\n i: ServerEntryInputs,\n): Record<string, unknown> {\n if (i.hostedUrl) {\n return buildHttpMcpEntryForClient(client, i.hostedUrl, i.token);\n }\n return buildLocalMcpEntryForClient(client, mcpServeArgs(i), mcpServeEnv(i));\n}\n\nfunction buildCodexBlock(name: string, i: ServerEntryInputs): string {\n if (i.hostedUrl) {\n return buildCodexHttpBlock(name, i.hostedUrl, i.token);\n }\n return buildCodexLocalBlock(name, mcpServeArgs(i), mcpServeEnv(i));\n}\n\n// ---------------------------------------------------------------------------\n// Per-client install/uninstall/status\n// ---------------------------------------------------------------------------\n\nfunction configPathFor(\n client: ClientId,\n cwd: string,\n scope: string | undefined,\n): string {\n return clientConfigPathFor(client, envBaseDir(cwd), scope);\n}\n\nfunction serverNameFor(appId: string): string {\n return `${SERVER_NAME_PREFIX}-${appId}`;\n}\n\n// Clients advertised in usage/help and listed by status. Excludes the legacy\n// `claude-code-cli` alias so only a single \"Claude Code\" appears (it is still\n// accepted via --client and collapses to claude-code).\nconst SELECTABLE_CLIENTS: ClientId[] = CLIENTS.filter(\n (c) => c !== \"claude-code-cli\",\n);\n\nfunction normalizeClientId(raw: string | undefined): ClientId | null {\n const value = (raw ?? \"\").toLowerCase();\n if (\n value === \"claude\" ||\n value === \"claude-code-desktop\" ||\n value === \"claude-code-cli\"\n ) {\n return \"claude-code\";\n }\n if (value === \"open-code\") return \"opencode\";\n if (value === \"copilot\" || value === \"vscode\" || value === \"vs-code\") {\n return \"github-copilot\";\n }\n return (CLIENTS as string[]).includes(value) ? (value as ClientId) : null;\n}\n\nfunction installForClient(\n client: ClientId,\n inputs: ServerEntryInputs,\n cwd: string,\n scope: string | undefined,\n): string {\n const name = inputs.serverName;\n const file = configPathFor(client, cwd, scope);\n if (client === \"codex\") {\n writeCodexBlock(file, name, buildCodexBlock(name, inputs));\n } else {\n writeJsonMcpEntryForClient(\n client,\n file,\n name,\n buildJsonServerEntry(client, inputs),\n );\n }\n return file;\n}\n\nfunction uninstallForClient(\n client: ClientId,\n appId: string,\n cwd: string,\n scope: string | undefined,\n): { file: string; removed: boolean } {\n const name = serverNameFor(appId);\n const file = configPathFor(client, cwd, scope);\n if (client === \"codex\") {\n const had = codexHasBlock(file, name);\n if (had) writeCodexBlock(file, name, null);\n return { file, removed: had };\n }\n const had = hasJsonMcpEntryForClient(client, file, name);\n if (had) writeJsonMcpEntryForClient(client, file, name, null);\n return { file, removed: had };\n}\n\nfunction clientHasEntry(client: ClientId, appId: string, cwd: string): boolean {\n const name = serverNameFor(appId);\n if (client === \"codex\") return codexHasBlock(codexConfigPath(), name);\n if (client === \"cowork\") {\n return hasJsonMcpEntryForClient(\n client,\n configPathFor(client, cwd, undefined),\n name,\n );\n }\n return (\n hasJsonMcpEntryForClient(\n client,\n configPathFor(client, cwd, \"project\"),\n name,\n ) ||\n hasJsonMcpEntryForClient(client, configPathFor(client, cwd, \"user\"), name)\n );\n}\n\n// ---------------------------------------------------------------------------\n// Subcommands\n// ---------------------------------------------------------------------------\n\nasync function cmdServe(p: ParsedArgs): Promise<void> {\n await runMCPStdio({\n appId: p.app,\n port: p.port,\n standalone: p.standalone,\n });\n}\n\nasync function cmdInstall(p: ParsedArgs): Promise<void> {\n const client = normalizeClientId(p.client);\n if (!client) {\n logErr(\n `Usage: npx @agent-native/core@latest mcp install --client ${SELECTABLE_CLIENTS.join(\"|\")} ` +\n `[--app <id>] [--scope user|project]`,\n );\n process.exit(1);\n }\n const cwd = process.cwd();\n\n // Resolve which app this entry targets (default = workspace default app).\n let appId = p.app;\n if (!appId) {\n try {\n const resolved = await resolveLocalAppOrigin({ cwd });\n appId = resolved.appId;\n } catch {\n appId = \"app\";\n }\n }\n const serverName = serverNameFor(appId);\n\n const hostedUrl = detectHostedUrl(cwd);\n const ownerEmail = process.env.AGENT_NATIVE_OWNER_EMAIL;\n\n let token: string | undefined;\n if (hostedUrl) {\n token = await mintHostedJwt(cwd);\n logOut(`Detected hosted deployment: ${hostedUrl}`);\n } else {\n const t = ensureLocalToken(cwd, false);\n token = t.token;\n logOut(\n t.created\n ? `Provisioned ACCESS_TOKEN in ${t.file}`\n : `Reusing existing ACCESS_TOKEN from ${t.file}`,\n );\n }\n\n const inputs: ServerEntryInputs = {\n serverName,\n appId: appId!,\n token,\n ownerEmail,\n hostedUrl,\n standalone: p.standalone,\n };\n\n const file = installForClient(client, inputs, cwd, p.scope);\n logOut(`Installed \"${serverName}\" for ${client} → ${file}`);\n logOut(\n hostedUrl\n ? ` Mode: http (${hostedUrl})`\n : ` Mode: stdio (npx @agent-native/core@latest mcp serve --app ${appId}${\n p.standalone ? \" --standalone\" : \"\"\n })`,\n );\n logOut(` Restart ${client} to pick up the new MCP server.`);\n}\n\nfunction cmdUninstall(p: ParsedArgs): void {\n const client = normalizeClientId(p.client);\n if (!client) {\n logErr(\n `Usage: npx @agent-native/core@latest mcp uninstall --client ${SELECTABLE_CLIENTS.join(\"|\")} ` +\n `[--app <id>]`,\n );\n process.exit(1);\n }\n const cwd = process.cwd();\n const appId = p.app ?? \"app\";\n const { file, removed } = uninstallForClient(client, appId, cwd, p.scope);\n logOut(\n removed\n ? `Removed \"${serverNameFor(appId)}\" from ${client} → ${file}`\n : `No \"${serverNameFor(appId)}\" entry found for ${client} (${file}) — nothing to do.`,\n );\n}\n\nasync function cmdStatus(): Promise<void> {\n const cwd = process.cwd();\n let appId = \"app\";\n let origin = \"(app not running)\";\n let port: number | undefined;\n try {\n const resolved = await resolveLocalAppOrigin({ cwd });\n appId = resolved.appId;\n origin = resolved.origin;\n const ws = await resolveWorkspace(cwd);\n port = ws.apps.find((a) => a.id === appId)?.port;\n } catch (err: any) {\n logErr(` Could not resolve app: ${err?.message ?? err}`);\n }\n\n const hostedUrl = detectHostedUrl(cwd);\n const baseDir = envBaseDir(cwd);\n const envContent =\n readEnvFile(path.join(baseDir, \".env.local\")) +\n \"\\n\" +\n readEnvFile(path.join(baseDir, \".env\"));\n const hasToken = !!getEnvValue(envContent, \"ACCESS_TOKEN\");\n const hasA2A =\n !!process.env.A2A_SECRET || !!getEnvValue(envContent, \"A2A_SECRET\");\n\n logOut(`Agent-Native MCP status`);\n logOut(` App: ${appId}`);\n logOut(\n hostedUrl\n ? ` MCP URL: ${hostedUrl} (hosted)`\n : ` MCP URL: ${origin}/_agent-native/mcp${\n port ? ` (port ${port})` : \"\"\n }`,\n );\n logOut(` ACCESS_TOKEN: ${hasToken ? \"set\" : \"not set\"} (.env)`);\n logOut(` A2A_SECRET: ${hasA2A ? \"set\" : \"not set\"}`);\n logOut(` Clients:`);\n for (const client of SELECTABLE_CLIENTS) {\n const present = clientHasEntry(client, appId, cwd);\n logOut(` ${client.padEnd(18)} ${present ? \"configured\" : \"—\"}`);\n }\n}\n\nfunction cmdToken(p: ParsedArgs): void {\n const cwd = process.cwd();\n const t = ensureLocalToken(cwd, p.rotate);\n logOut(\n p.rotate\n ? `Rotated ACCESS_TOKEN in ${t.file}`\n : t.created\n ? `Provisioned ACCESS_TOKEN in ${t.file}`\n : `ACCESS_TOKEN (${t.file}):`,\n );\n logOut(t.token);\n if (p.rotate) {\n logOut(\n ` Re-run \\`npx @agent-native/core@latest mcp install --client <c>\\` so client configs ` +\n `pick up the new token.`,\n );\n }\n}\n\nconst HELP = `npx @agent-native/core@latest mcp — connect external coding agents over MCP\n\nUsage:\n npx @agent-native/core@latest mcp serve [--app <id>] [--port <n>] [--standalone]\n Run the MCP stdio transport (what client configs spawn).\n Default: proxy to the running local app; --standalone builds from disk.\n\n npx @agent-native/core@latest mcp screen-memory [--dir <path>]\n Run the local Clips Screen Memory stdio server.\n Defaults to the Clips app-data screen-memory folder.\n\n npx @agent-native/core@latest mcp install --client <c> [--app <id>] [--scope user|project]\n Provision a token and write the client's MCP config (idempotent).\n Clients: claude-code, codex, cowork, cursor, opencode, github-copilot\n\n npx @agent-native/core@latest mcp uninstall --client <c> [--app <id>]\n Remove the named MCP entry from a client's config (idempotent).\n\n npx @agent-native/core@latest mcp status\n Show resolved MCP URL/port, token state, and per-client entries.\n\n npx @agent-native/core@latest mcp token [--rotate]\n Print (or rotate) the local ACCESS_TOKEN in the workspace .env.`;\n\nexport async function runMcp(args: string[]): Promise<void> {\n const p = parseArgs(args);\n const sub = p._[0];\n\n switch (sub) {\n case \"serve\":\n await cmdServe(p);\n return;\n case \"screen-memory\":\n await runScreenMemoryMCPStdio({ storeDir: p.screenMemoryDir });\n return;\n case \"install\":\n await cmdInstall(p);\n return;\n case \"uninstall\":\n cmdUninstall(p);\n return;\n case \"status\":\n await cmdStatus();\n return;\n case \"token\":\n cmdToken(p);\n return;\n case undefined:\n case \"--help\":\n case \"-h\":\n case \"help\":\n logOut(HELP);\n return;\n default:\n logErr(`Unknown mcp subcommand: ${sub}`);\n logOut(HELP);\n process.exit(1);\n }\n}\n"]}
|
package/dist/cli/skills.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/cli/skills.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAKL,KAAK,gBAAgB,EAEtB,MAAM,gBAAgB,CAAC;AAUxB,OAAO,EAAW,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGjE,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/cli/skills.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAKL,KAAK,gBAAgB,EAEtB,MAAM,gBAAgB,CAAC;AAUxB,OAAO,EAAW,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGjE,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AA24BvE,eAAO,MAAM,sBAAsB,uhlBAQlC,CAAC;AAyXF,eAAO,MAAM,mBAAmB,wuRAQ/B,CAAC;AAEF,eAAO,MAAM,6BAA6B,0zYASzC,CAAC;AAEF,eAAO,MAAM,qBAAqB,+gIAOjC,CAAC;AAyBF,eAAO,MAAM,uBAAuB,4+FAmDnC,CAAC;AAEF,eAAO,MAAM,wBAAwB,4kMA8FpC,CAAC;AAEF,eAAO,MAAM,qBAAqB,k53BA+cjC,CAAC;AAEF,eAAO,MAAM,qBAAqB,ymiCA+hBjC,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwR/B,CAAC;AAKF,eAAO,MAAM,gCAAgC,4BAA4B,CAAC;AA4F1E,KAAK,wBAAwB,GAAG,QAAQ,GAAG,IAAI,CAAC;AAoDhD,KAAK,aAAa,GAAG,M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E,KAAK,CAAC;QACb,KAAK,EAAE,wBAAwB,CAAC;QAChC,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KACd,CAAC,CAAC;IACH,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,UAAU,yBAAyB;IACjC,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,OAAO,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAChE;AAED,UAAU,+BAA+B;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,wBAAwB;IAChC,YAAY,EAAE,SAAS,GAAG,MAAM,CAAC;CAClC;AAED,UAAU,2BAA2B;IACnC,WAAW,EAAE,eAAe,CAAC;CAC9B;AAmrDD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,gBAAgB,CA8GhE;AAkiBD,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,gBAAgB,EACxB,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,eAAe,CAAC,CA6Y1B;AAyQD,wBAAsB,SAAS,CAC7B,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,IAAI,CAAC,CA8Zf"}
|
package/dist/cli/skills.js
CHANGED
|
@@ -303,17 +303,18 @@ iteration, or a human-in-the-loop choice among design directions.
|
|
|
303
303
|
- Use \`create-design\` first to create a project shell. Do not report the
|
|
304
304
|
design as ready until it has renderable HTML.
|
|
305
305
|
- For open-ended UX exploration, generate distinct, complete HTML directions
|
|
306
|
-
(2-5, three by default) and call \`present-design-variants\`.
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
306
|
+
(2-5, three by default) and call \`present-design-variants\`. Design saves
|
|
307
|
+
every option as a normal screen on the overview board and renders an inline
|
|
308
|
+
chat choice with one button per screen name. After the user picks, delete the
|
|
309
|
+
unchosen variant screens and continue from the kept screen.
|
|
310
|
+
- If the chat choice buttons are not available in the host, ask the user to
|
|
311
|
+
tell you the screen name they prefer. The variants are already real screens
|
|
312
|
+
on the board, so do not ask them to paste HTML or copy a generated handoff
|
|
313
|
+
summary.
|
|
314
314
|
- For direct refinements to an already chosen direction, call
|
|
315
|
-
\`get-design-snapshot\`, edit from the current tuned HTML,
|
|
316
|
-
\`generate-design
|
|
315
|
+
\`get-design-snapshot\`, edit from the current tuned HTML, and use
|
|
316
|
+
\`edit-design\` for surgical changes. Use \`generate-design\` for new files
|
|
317
|
+
or larger structural rewrites.
|
|
317
318
|
- Use \`export-coding-handoff\` when the user wants to implement the chosen
|
|
318
319
|
design in a codebase.
|
|
319
320
|
|
|
@@ -327,8 +328,29 @@ iteration, or a human-in-the-loop choice among design directions.
|
|
|
327
328
|
4. For product UI redesigns, prefer cleaner hierarchy, progressive disclosure,
|
|
328
329
|
and realistic controls over decorative mockups.
|
|
329
330
|
5. After \`present-design-variants\`, wait for the user's pick before
|
|
330
|
-
generating the next version.
|
|
331
|
-
|
|
331
|
+
generating the next version. Keep the chosen screen, delete the other
|
|
332
|
+
variant screens, then refine that direction with \`generate-design\` or
|
|
333
|
+
\`edit-design\`.
|
|
334
|
+
|
|
335
|
+
## Design Quality Bar
|
|
336
|
+
|
|
337
|
+
- Before generating, name the concrete audience, the screen's primary job, and
|
|
338
|
+
the visual thesis. If the brief is vague, make a reasonable choice and state
|
|
339
|
+
it instead of producing a generic dashboard/landing-page default.
|
|
340
|
+
- For existing products, inspect the current screen, design system, tokens,
|
|
341
|
+
component language, or codebase context before inventing a new direction.
|
|
342
|
+
- Make each direction distinct in structure and behavior, not just palette.
|
|
343
|
+
Give every variant one memorable signature choice, then keep the surrounding
|
|
344
|
+
chrome disciplined.
|
|
345
|
+
- Treat copy, data, and imagery as design material. Use realistic domain
|
|
346
|
+
content and first-party/generated assets when images matter; avoid lorem
|
|
347
|
+
ipsum, vague SaaS filler, and decorative placeholder boxes.
|
|
348
|
+
- Build to a quiet quality floor: responsive desktop/mobile layout, visible
|
|
349
|
+
keyboard focus, useful loading/empty/error states for app UI, and reduced
|
|
350
|
+
motion support when custom motion is present.
|
|
351
|
+
- After broad generation or refinement, inspect the rendered Design surface or
|
|
352
|
+
a screenshot-capable host before calling it ready. Fix obvious hierarchy,
|
|
353
|
+
overflow, contrast, broken interaction, and placeholder-content issues first.
|
|
332
354
|
|
|
333
355
|
## Cross-App Use
|
|
334
356
|
|
|
@@ -361,6 +383,8 @@ name: visual-edit
|
|
|
361
383
|
description: >-
|
|
362
384
|
Open a running local app in Design overview mode as URL-backed iframe screens
|
|
363
385
|
for visual editing, flow review, duplication, and route-state exploration.
|
|
386
|
+
Use when the user asks to inspect, compare, or edit a real local app visually
|
|
387
|
+
in Design.
|
|
364
388
|
metadata:
|
|
365
389
|
visibility: exported
|
|
366
390
|
---
|
|
@@ -388,6 +412,28 @@ iframe-backed screens on the infinite canvas.
|
|
|
388
412
|
\`localhost:1234/onboarding/1\` means
|
|
389
413
|
\`http://localhost:1234/onboarding/1\`.
|
|
390
414
|
|
|
415
|
+
## Review Quality
|
|
416
|
+
|
|
417
|
+
- Treat the running app as the truth. Preserve its component language, tokens,
|
|
418
|
+
route state, and real content unless the user explicitly asks for a new visual
|
|
419
|
+
direction.
|
|
420
|
+
- Use multiple URL states to reveal meaningful UX moments: empty/loading/error
|
|
421
|
+
states, focused panels, modals, responsive breakpoints, and completed flow
|
|
422
|
+
steps when those matter to the review.
|
|
423
|
+
- For visual edits, compare before/after at the relevant viewport sizes and
|
|
424
|
+
check key hover/focus/scroll states when the app exposes them.
|
|
425
|
+
|
|
426
|
+
## Account And Sharing Model
|
|
427
|
+
|
|
428
|
+
- The \`/visual-edit\` entry route can open before the viewer signs in. Public
|
|
429
|
+
\`/design/:id\` editor links can also render read-only public designs without a
|
|
430
|
+
session.
|
|
431
|
+
- Do not attempt anonymous write actions. Bridge registration, design creation,
|
|
432
|
+
screen placement, generation, saving, and sharing are account-backed. If a
|
|
433
|
+
signed-out visitor wants to save or share, send them through the framework
|
|
434
|
+
sign-in return flow, then save or copy the design into that account before
|
|
435
|
+
opening the share dialog.
|
|
436
|
+
|
|
391
437
|
## Required Local Bridge
|
|
392
438
|
|
|
393
439
|
From the target app repo, make sure its dev server is running, then run:
|