@agent-native/core 0.69.0 → 0.70.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -15
- package/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +109 -0
- package/corpus/core/docs/design/durable-agent-runs.md +217 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/action.ts +89 -0
- package/corpus/core/src/agent/model-config.ts +0 -2
- package/corpus/core/src/agent/run-loop-with-resume.ts +48 -0
- package/corpus/core/src/changelog/parse.ts +245 -0
- package/corpus/core/src/cli/changelog.ts +199 -0
- package/corpus/core/src/cli/index.ts +19 -0
- package/corpus/core/src/cli/recap.ts +24 -1
- package/corpus/core/src/cli/skills.ts +74 -47
- package/corpus/core/src/client/AgentPanel.tsx +5 -3
- package/corpus/core/src/client/AssistantChat.tsx +8 -0
- package/corpus/core/src/client/CommandMenu.tsx +183 -75
- package/corpus/core/src/client/agent-chat-adapter.ts +44 -7
- package/corpus/core/src/client/analytics.ts +181 -0
- package/corpus/core/src/client/changelog/Changelog.tsx +321 -0
- package/corpus/core/src/client/client-surface.ts +41 -0
- package/corpus/core/src/client/composer/TiptapComposer.tsx +123 -12
- package/corpus/core/src/client/feedback-context.ts +4 -0
- package/corpus/core/src/client/index.ts +12 -0
- package/corpus/core/src/client/mcp-apps/McpAppRenderer.tsx +54 -0
- package/corpus/core/src/client/settings/useBuilderStatus.ts +82 -20
- package/corpus/core/src/client/sse-event-processor.ts +7 -1
- package/corpus/core/src/mcp/build-server.ts +57 -1
- package/corpus/core/src/mcp/embed-app.ts +197 -7
- package/corpus/core/src/mcp/oauth-route.ts +109 -13
- package/corpus/core/src/server/attribution.ts +211 -0
- package/corpus/core/src/server/auth.ts +6 -0
- package/corpus/core/src/server/better-auth-instance.ts +49 -5
- package/corpus/core/src/server/builder-browser.ts +27 -1
- package/corpus/core/src/server/core-routes-plugin.ts +136 -0
- package/corpus/core/src/server/google-oauth.ts +19 -6
- package/corpus/core/src/server/onboarding-html.ts +35 -0
- package/corpus/core/src/shared/mcp-embed-headers.ts +1 -1
- package/corpus/core/src/styles/agent-conversation.css +21 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/changelog/SKILL.md +111 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/reliable-mutations/SKILL.md +72 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/tracking/SKILL.md +46 -14
- package/corpus/templates/analytics/.agents/skills/dashboard-management/SKILL.md +22 -0
- package/corpus/templates/analytics/AGENTS.md +8 -1
- package/corpus/templates/analytics/CHANGELOG.md +10 -0
- package/corpus/templates/analytics/actions/install-dashboard-template.ts +99 -4
- package/corpus/templates/analytics/actions/open-traffic-dashboard.ts +1 -1
- package/corpus/templates/analytics/actions/update-dashboard.ts +39 -8
- package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +30 -3
- package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +180 -144
- package/corpus/templates/analytics/app/components/layout/Header.tsx +2 -3
- package/corpus/templates/analytics/app/components/layout/Layout.tsx +7 -5
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +221 -215
- package/corpus/templates/analytics/app/hooks/use-navigation-state.ts +6 -6
- package/corpus/templates/analytics/app/lib/demo-dashboard-path.ts +1 -1
- package/corpus/templates/analytics/app/lib/last-opened.ts +2 -1
- package/corpus/templates/analytics/app/pages/Settings.tsx +4 -0
- package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +3 -3
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/DashboardFilterBar.tsx +2 -2
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +32 -2
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +101 -99
- package/corpus/templates/analytics/app/pages/overview/OverviewPage.tsx +1 -1
- package/corpus/templates/analytics/app/routes/adhoc.$id.tsx +18 -5
- package/corpus/templates/analytics/app/routes/catalog.tsx +1 -1
- package/corpus/templates/analytics/app/routes/dashboards.$id.tsx +9 -0
- package/corpus/templates/analytics/app/routes/traffic.tsx +1 -1
- package/corpus/templates/analytics/changelog/2026-06-23-long-dashboard-and-analysis-names-in-the-sidebar-now-truncat.md +6 -0
- package/corpus/templates/analytics/changelog/2026-06-23-open-any-dashboard-chart-full-screen-in-a-modal-from-the-pan.md +6 -0
- package/corpus/templates/analytics/changelog/2026-06-23-the-dashboards-and-analyses-sidebar-settings-buttons-now-sta.md +6 -0
- package/corpus/templates/analytics/seeds/dashboards/agent-native-templates-first-party.json +145 -0
- package/corpus/templates/analytics/server/db/index.ts +1 -1
- package/corpus/templates/analytics/server/lib/dashboard-catalog.ts +9 -2
- package/corpus/templates/analytics/server/lib/demo-dashboards.ts +1 -1
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +2 -2
- package/corpus/templates/analytics/server/plugins/core-routes.ts +6 -6
- package/corpus/templates/assets/CHANGELOG.md +10 -0
- package/corpus/templates/assets/actions/generate-image.ts +24 -0
- package/corpus/templates/assets/app/components/layout/Sidebar.tsx +2 -2
- package/corpus/templates/assets/app/global.css +17 -1
- package/corpus/templates/assets/app/root.tsx +7 -1
- package/corpus/templates/assets/app/routes/_index.tsx +94 -14
- package/corpus/templates/assets/app/routes/settings.tsx +6 -0
- package/corpus/templates/assets/changelog/2026-06-23-chat-dates-in-the-sidebar-no-longer-wrap-onto-two-lines.md +6 -0
- package/corpus/templates/assets/changelog/2026-06-23-clicking-image-video-or-refine-on-the-start-screen-now-drops.md +6 -0
- package/corpus/templates/assets/changelog/2026-06-23-pick-your-image-generation-model-right-from-the-chat-model-m.md +6 -0
- package/corpus/templates/brain/CHANGELOG.md +10 -0
- package/corpus/templates/brain/app/root.tsx +7 -1
- package/corpus/templates/brain/app/routes/settings.tsx +8 -1
- package/corpus/templates/calendar/CHANGELOG.md +10 -0
- package/corpus/templates/calendar/app/pages/Settings.tsx +4 -0
- package/corpus/templates/calendar/app/root.tsx +7 -1
- package/corpus/templates/chat/CHANGELOG.md +10 -0
- package/corpus/templates/chat/app/root.tsx +7 -1
- package/corpus/templates/clips/CHANGELOG.md +10 -0
- package/corpus/templates/clips/app/components/library/library-grid.tsx +1 -20
- package/corpus/templates/clips/app/components/player/share-dialog.tsx +33 -7
- package/corpus/templates/clips/app/components/player/sign-in-prompt-dialog.tsx +8 -0
- package/corpus/templates/clips/app/components/player/video-player.tsx +150 -20
- package/corpus/templates/clips/app/components/recorder/countdown-overlay.tsx +72 -48
- package/corpus/templates/clips/app/components/recorder/pre-record-panel.tsx +7 -11
- package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +31 -0
- package/corpus/templates/clips/app/components/sharing/slack-share-hint.tsx +71 -0
- package/corpus/templates/clips/app/lib/countdown-audio-cue.ts +35 -17
- package/corpus/templates/clips/app/root.tsx +7 -1
- package/corpus/templates/clips/app/routes/_app.settings._index.tsx +15 -1
- package/corpus/templates/clips/app/routes/record.tsx +78 -5
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +86 -5
- package/corpus/templates/clips/changelog/2026-06-23-clips-shared-in-slack-no-longer-show-a-could-not-start-playb.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-23-made-the-play-button-on-shared-and-embedded-clips-scale-with.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-23-public-clip-share-links-now-show-whether-they-ll-play-inline.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-23-removed-select-button-from-library-hover-a-clip-to-select-it.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-23-screen-camera-recordings-now-keep-the-presenter-s-face-in-th.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-23-shared-video-links-now-play-for-anyone-without-signing-in.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-23-skip-or-cancel-the-recording-countdown-with-buttons-beside-t.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-23-the-desktop-camera-bubble-now-looks-sharp-the-instant-it-ope.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-23-the-desktop-recording-widget-now-grows-downward-only-when-yo.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-23-the-recording-start-sound-is-now-a-softer-more-modern-chime.md +6 -0
- package/corpus/templates/clips/chrome-extension/public/manifest.json +17 -8
- package/corpus/templates/clips/chrome-extension/src/background.ts +769 -180
- package/corpus/templates/clips/chrome-extension/src/content-script.ts +177 -0
- package/corpus/templates/clips/chrome-extension/src/offscreen.ts +466 -329
- package/corpus/templates/clips/chrome-extension/src/overlay.css +377 -0
- package/corpus/templates/clips/chrome-extension/src/overlay.html +12 -0
- package/corpus/templates/clips/chrome-extension/src/overlay.ts +330 -0
- package/corpus/templates/clips/chrome-extension/src/permission.html +227 -0
- package/corpus/templates/clips/chrome-extension/src/permission.ts +105 -0
- package/corpus/templates/clips/chrome-extension/src/popup.html +3 -0
- package/corpus/templates/clips/chrome-extension/src/popup.ts +50 -2
- package/corpus/templates/clips/chrome-extension/src/styles.css +50 -0
- package/corpus/templates/clips/chrome-extension/vite.config.ts +3 -0
- package/corpus/templates/clips/desktop/src/lib/audio-cue.ts +41 -24
- package/corpus/templates/clips/desktop/src/lib/bubble-webrtc.ts +119 -2
- package/corpus/templates/clips/desktop/src/lib/recorder.ts +20 -0
- package/corpus/templates/clips/desktop/src/main.tsx +3 -0
- package/corpus/templates/clips/desktop/src/overlays/countdown.tsx +21 -2
- package/corpus/templates/clips/desktop/src/overlays/region-record-border.tsx +76 -0
- package/corpus/templates/clips/desktop/src/styles.css +119 -2
- package/corpus/templates/clips/desktop/src-tauri/capabilities/default.json +2 -1
- package/corpus/templates/clips/desktop/src-tauri/src/clips/mod.rs +140 -1
- package/corpus/templates/clips/desktop/src-tauri/src/lib.rs +2 -0
- package/corpus/templates/clips/desktop/src-tauri/src/util.rs +4 -1
- package/corpus/templates/clips/server/routes/api/video/[recordingId].get.ts +85 -6
- package/corpus/templates/clips/shared/share-attribution.ts +79 -0
- package/corpus/templates/content/AGENTS.md +20 -3
- package/corpus/templates/content/CHANGELOG.md +10 -0
- package/corpus/templates/content/actions/_database-utils.ts +15 -0
- package/corpus/templates/content/actions/_property-utils.ts +371 -4
- package/corpus/templates/content/actions/configure-document-property.ts +35 -1
- package/corpus/templates/content/actions/create-content-database.ts +5 -1
- package/corpus/templates/content/actions/delete-document-property.ts +52 -2
- package/corpus/templates/content/actions/duplicate-document-property.ts +34 -17
- package/corpus/templates/content/actions/reorder-document-property.ts +79 -0
- package/corpus/templates/content/actions/set-document-property.ts +39 -0
- package/corpus/templates/content/app/components/editor/DocumentBlockFields.tsx +806 -0
- package/corpus/templates/content/app/components/editor/DocumentDatabase.tsx +226 -68
- package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +59 -30
- package/corpus/templates/content/app/components/editor/DocumentProperties.tsx +25 -1
- package/corpus/templates/content/app/components/editor/blockFieldSaveController.ts +180 -0
- package/corpus/templates/content/app/components/editor/blockFieldSaveRegistry.ts +179 -0
- package/corpus/templates/content/app/components/editor/previewDocumentSaveController.ts +244 -0
- package/corpus/templates/content/app/components/editor/previewDocumentSaveRegistry.ts +132 -0
- package/corpus/templates/content/app/global.css +9 -0
- package/corpus/templates/content/app/hooks/use-document-properties.ts +21 -0
- package/corpus/templates/content/app/root.tsx +7 -1
- package/corpus/templates/content/server/db/schema.ts +30 -0
- package/corpus/templates/content/server/plugins/db.ts +87 -0
- package/corpus/templates/content/shared/api.ts +7 -0
- package/corpus/templates/content/shared/properties.ts +109 -0
- package/corpus/templates/design/CHANGELOG.md +10 -0
- package/corpus/templates/design/actions/generate-design.ts +4 -0
- package/corpus/templates/design/app/root.tsx +7 -1
- package/corpus/templates/design/app/routes/settings.tsx +10 -2
- package/corpus/templates/dispatch/CHANGELOG.md +10 -0
- package/corpus/templates/dispatch/app/root.tsx +7 -1
- package/corpus/templates/forms/.agents/skills/form-responses/SKILL.md +10 -0
- package/corpus/templates/forms/CHANGELOG.md +10 -0
- package/corpus/templates/forms/actions/export-responses.ts +6 -0
- package/corpus/templates/forms/actions/list-responses.ts +2 -0
- package/corpus/templates/forms/actions/response-insights.ts +2 -0
- package/corpus/templates/forms/app/pages/ResponsesPage.tsx +138 -1
- package/corpus/templates/forms/app/root.tsx +7 -1
- package/corpus/templates/forms/changelog/2026-06-23-response-tables-now-show-the-page-each-submission-came-from-.md +6 -0
- package/corpus/templates/forms/changelog/2026-06-23-response-tables-now-show-whether-feedback-came-from-the-web-.md +6 -0
- package/corpus/templates/forms/server/db/schema.ts +7 -0
- package/corpus/templates/forms/server/handlers/submissions.ts +19 -2
- package/corpus/templates/forms/server/lib/integrations.ts +76 -2
- package/corpus/templates/forms/server/plugins/db.ts +20 -0
- package/corpus/templates/forms/shared/types.ts +12 -0
- package/corpus/templates/macros/CHANGELOG.md +10 -0
- package/corpus/templates/macros/app/root.tsx +7 -1
- package/corpus/templates/mail/CHANGELOG.md +10 -0
- package/corpus/templates/mail/app/components/layout/CommandPalette.tsx +3 -0
- package/corpus/templates/mail/app/pages/SettingsPage.tsx +27 -0
- package/corpus/templates/plan/.agents/skills/visual-plan/SKILL.md +31 -17
- package/corpus/templates/plan/.agents/skills/visual-plan/references/wireframe.md +7 -4
- package/corpus/templates/plan/.agents/skills/visual-recap/SKILL.md +34 -24
- package/corpus/templates/plan/.agents/skills/visual-recap/references/wireframe.md +7 -4
- package/corpus/templates/plan/AGENTS.md +4 -0
- package/corpus/templates/plan/CHANGELOG.md +10 -0
- package/corpus/templates/plan/actions/view-screen.ts +5 -0
- package/corpus/templates/plan/app/components/layout/Sidebar.tsx +98 -1
- package/corpus/templates/plan/app/components/plan/wireframe/html-artboard.css +3 -1
- package/corpus/templates/plan/app/pages/PlansPage.tsx +107 -7
- package/corpus/templates/plan/app/root.tsx +7 -1
- package/corpus/templates/plan/changelog/2026-06-23-large-diagrams-in-a-plan-now-scroll-within-their-block-inste.md +6 -0
- package/corpus/templates/plan/shared/share-attribution.ts +72 -0
- package/corpus/templates/slides/CHANGELOG.md +10 -0
- package/corpus/templates/slides/app/root.tsx +7 -1
- package/corpus/templates/videos/CHANGELOG.md +4 -151
- package/corpus/templates/videos/app/root.tsx +7 -1
- package/dist/action.js +87 -0
- package/dist/action.js.map +1 -1
- package/dist/agent/engine/builder-engine.d.ts +1 -1
- package/dist/agent/engine/builder-engine.d.ts.map +1 -1
- package/dist/agent/model-config.d.ts +2 -2
- package/dist/agent/model-config.d.ts.map +1 -1
- package/dist/agent/model-config.js +0 -2
- package/dist/agent/model-config.js.map +1 -1
- package/dist/agent/run-loop-with-resume.d.ts +13 -0
- package/dist/agent/run-loop-with-resume.d.ts.map +1 -1
- package/dist/agent/run-loop-with-resume.js +44 -0
- package/dist/agent/run-loop-with-resume.js.map +1 -1
- package/dist/changelog/parse.d.ts +70 -0
- package/dist/changelog/parse.d.ts.map +1 -0
- package/dist/changelog/parse.js +200 -0
- package/dist/changelog/parse.js.map +1 -0
- package/dist/cli/changelog.d.ts +4 -0
- package/dist/cli/changelog.d.ts.map +1 -0
- package/dist/cli/changelog.js +166 -0
- package/dist/cli/changelog.js.map +1 -0
- package/dist/cli/index.js +18 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/recap.d.ts.map +1 -1
- package/dist/cli/recap.js +22 -1
- package/dist/cli/recap.js.map +1 -1
- package/dist/cli/skills.d.ts +3 -3
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +74 -47
- package/dist/cli/skills.js.map +1 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +5 -3
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/AssistantChat.d.ts +6 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +2 -2
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/CommandMenu.d.ts +17 -1
- package/dist/client/CommandMenu.d.ts.map +1 -1
- package/dist/client/CommandMenu.js +49 -13
- package/dist/client/CommandMenu.js.map +1 -1
- package/dist/client/agent-chat-adapter.d.ts.map +1 -1
- package/dist/client/agent-chat-adapter.js +43 -6
- package/dist/client/agent-chat-adapter.js.map +1 -1
- package/dist/client/analytics.d.ts +18 -0
- package/dist/client/analytics.d.ts.map +1 -1
- package/dist/client/analytics.js +177 -0
- package/dist/client/analytics.js.map +1 -1
- package/dist/client/changelog/Changelog.d.ts +47 -0
- package/dist/client/changelog/Changelog.d.ts.map +1 -0
- package/dist/client/changelog/Changelog.js +138 -0
- package/dist/client/changelog/Changelog.js.map +1 -0
- package/dist/client/client-surface.d.ts +17 -0
- package/dist/client/client-surface.d.ts.map +1 -0
- package/dist/client/client-surface.js +24 -0
- package/dist/client/client-surface.js.map +1 -0
- package/dist/client/composer/TiptapComposer.d.ts +26 -1
- package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
- package/dist/client/composer/TiptapComposer.js +27 -5
- package/dist/client/composer/TiptapComposer.js.map +1 -1
- package/dist/client/feedback-context.d.ts +3 -0
- package/dist/client/feedback-context.d.ts.map +1 -1
- package/dist/client/feedback-context.js +2 -0
- package/dist/client/feedback-context.js.map +1 -1
- package/dist/client/index.d.ts +3 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +3 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/mcp-apps/McpAppRenderer.d.ts +1 -0
- package/dist/client/mcp-apps/McpAppRenderer.d.ts.map +1 -1
- package/dist/client/mcp-apps/McpAppRenderer.js +42 -1
- package/dist/client/mcp-apps/McpAppRenderer.js.map +1 -1
- package/dist/client/settings/useBuilderStatus.d.ts +2 -0
- package/dist/client/settings/useBuilderStatus.d.ts.map +1 -1
- package/dist/client/settings/useBuilderStatus.js +58 -10
- package/dist/client/settings/useBuilderStatus.js.map +1 -1
- package/dist/client/sse-event-processor.d.ts.map +1 -1
- package/dist/client/sse-event-processor.js +7 -1
- package/dist/client/sse-event-processor.js.map +1 -1
- package/dist/mcp/build-server.d.ts +21 -0
- package/dist/mcp/build-server.d.ts.map +1 -1
- package/dist/mcp/build-server.js +43 -1
- package/dist/mcp/build-server.js.map +1 -1
- package/dist/mcp/embed-app.d.ts.map +1 -1
- package/dist/mcp/embed-app.js +197 -7
- package/dist/mcp/embed-app.js.map +1 -1
- package/dist/mcp/oauth-route.d.ts.map +1 -1
- package/dist/mcp/oauth-route.js +95 -12
- package/dist/mcp/oauth-route.js.map +1 -1
- package/dist/server/attribution.d.ts +83 -0
- package/dist/server/attribution.d.ts.map +1 -0
- package/dist/server/attribution.js +178 -0
- package/dist/server/attribution.js.map +1 -0
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +7 -0
- package/dist/server/auth.js.map +1 -1
- package/dist/server/better-auth-instance.d.ts +9 -1
- package/dist/server/better-auth-instance.d.ts.map +1 -1
- package/dist/server/better-auth-instance.js +32 -2
- package/dist/server/better-auth-instance.js.map +1 -1
- package/dist/server/builder-browser.d.ts +4 -0
- package/dist/server/builder-browser.d.ts.map +1 -1
- package/dist/server/builder-browser.js +20 -1
- package/dist/server/builder-browser.js.map +1 -1
- package/dist/server/core-routes-plugin.d.ts +25 -0
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +101 -0
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/google-oauth.d.ts.map +1 -1
- package/dist/server/google-oauth.js +16 -2
- package/dist/server/google-oauth.js.map +1 -1
- package/dist/server/onboarding-html.d.ts.map +1 -1
- package/dist/server/onboarding-html.js +35 -0
- package/dist/server/onboarding-html.js.map +1 -1
- package/dist/shared/mcp-embed-headers.js +1 -1
- package/dist/shared/mcp-embed-headers.js.map +1 -1
- package/dist/styles/agent-conversation.css +21 -0
- package/dist/templates/workspace-core/.agents/skills/changelog/SKILL.md +111 -0
- package/dist/templates/workspace-core/.agents/skills/reliable-mutations/SKILL.md +72 -0
- package/dist/templates/workspace-core/.agents/skills/tracking/SKILL.md +46 -14
- package/docs/design/durable-agent-runs.md +217 -0
- package/package.json +1 -1
- package/src/templates/workspace-core/.agents/skills/changelog/SKILL.md +111 -0
- package/src/templates/workspace-core/.agents/skills/reliable-mutations/SKILL.md +72 -0
- package/src/templates/workspace-core/.agents/skills/tracking/SKILL.md +46 -14
- package/corpus/templates/analytics/app/pages/About.tsx +0 -108
- package/corpus/templates/analytics/app/routes/about.tsx +0 -9
- /package/corpus/templates/analytics/app/routes/{dashboards.tsx → dashboards._index.tsx} +0 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Changelog UI — renders an app's CHANGELOG.md as an in-app "What's new"
|
|
4
|
+
* surface. Core owns all of this; a template just passes its own
|
|
5
|
+
* `CHANGELOG.md?raw` content in (Vite inlines it at build time, so this works
|
|
6
|
+
* on every host with no runtime file access or server route).
|
|
7
|
+
*
|
|
8
|
+
* Surfaces:
|
|
9
|
+
* - <ChangelogDialog> a self-contained modal listing every release.
|
|
10
|
+
* - <ChangelogSettingsCard> a settings-page card with the latest updates.
|
|
11
|
+
* - useChangelogSeen() tracks the last release a user has seen (so the
|
|
12
|
+
* command menu can show an "unseen" dot).
|
|
13
|
+
*
|
|
14
|
+
* The command menu's built-in `changelog` prop (see CommandMenu.tsx) wires the
|
|
15
|
+
* dialog automatically — most templates never touch these directly.
|
|
16
|
+
*/
|
|
17
|
+
import React, { useEffect, useMemo, useState } from "react";
|
|
18
|
+
import { IconX, IconHistory } from "@tabler/icons-react";
|
|
19
|
+
import { parseChangelog } from "../../changelog/parse.js";
|
|
20
|
+
import { markdownModule, remarkGfmFn, useMarkdownReady, markdownUrlTransform, } from "../chat/markdown-renderer.js";
|
|
21
|
+
import { cn } from "../utils.js";
|
|
22
|
+
// ─── Date formatting ──────────────────────────────────────────────────────────
|
|
23
|
+
function formatEntryHeading(entry) {
|
|
24
|
+
if (entry.date) {
|
|
25
|
+
// Parse as a plain calendar date (avoid TZ shifting YYYY-MM-DD back a day).
|
|
26
|
+
const [y, m, d] = entry.date.split("-").map(Number);
|
|
27
|
+
if (y && m && d) {
|
|
28
|
+
const formatted = new Date(y, m - 1, d).toLocaleDateString(undefined, {
|
|
29
|
+
year: "numeric",
|
|
30
|
+
month: "long",
|
|
31
|
+
day: "numeric",
|
|
32
|
+
});
|
|
33
|
+
return entry.version ? `${entry.version} · ${formatted}` : formatted;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return entry.title;
|
|
37
|
+
}
|
|
38
|
+
// ─── Markdown body ────────────────────────────────────────────────────────────
|
|
39
|
+
// A small, self-contained renderer for a release body. Avoids depending on the
|
|
40
|
+
// typography plugin (`prose`) being generated in the host template by applying
|
|
41
|
+
// explicit utility classes that Tailwind scans from core's compiled output.
|
|
42
|
+
const changelogMarkdownComponents = {
|
|
43
|
+
h3: (props) => (_jsx("h3", { ...props, className: "mb-1.5 mt-3 text-xs font-semibold uppercase tracking-wide text-muted-foreground first:mt-0" })),
|
|
44
|
+
ul: (props) => (_jsx("ul", { ...props, className: "mb-2 ml-1 list-disc space-y-1 pl-4 text-sm text-foreground marker:text-muted-foreground" })),
|
|
45
|
+
ol: (props) => (_jsx("ol", { ...props, className: "mb-2 ml-1 list-decimal space-y-1 pl-4 text-sm text-foreground marker:text-muted-foreground" })),
|
|
46
|
+
li: (props) => (_jsx("li", { ...props, className: "leading-relaxed" })),
|
|
47
|
+
p: (props) => (_jsx("p", { ...props, className: "mb-2 text-sm leading-relaxed text-foreground" })),
|
|
48
|
+
a: (props) => (_jsx("a", { ...props, target: "_blank", rel: "noreferrer", className: "font-medium underline underline-offset-2" })),
|
|
49
|
+
code: (props) => (_jsx("code", { ...props, className: "rounded bg-muted px-1 py-0.5 font-mono text-[0.85em]" })),
|
|
50
|
+
};
|
|
51
|
+
function ChangelogBody({ markdown }) {
|
|
52
|
+
const ready = useMarkdownReady();
|
|
53
|
+
const ReactMarkdown = markdownModule?.default;
|
|
54
|
+
const gfm = remarkGfmFn;
|
|
55
|
+
if (!ready || !ReactMarkdown || !gfm) {
|
|
56
|
+
// The react-markdown chunk loads on module eval; this is typically only one
|
|
57
|
+
// frame. Show readable plain text rather than nothing in the meantime.
|
|
58
|
+
return (_jsx("div", { className: "whitespace-pre-wrap text-sm text-foreground", children: markdown }));
|
|
59
|
+
}
|
|
60
|
+
return (_jsx(ReactMarkdown, { remarkPlugins: [gfm], components: changelogMarkdownComponents, urlTransform: markdownUrlTransform, children: markdown }));
|
|
61
|
+
}
|
|
62
|
+
// ─── Unseen tracking ──────────────────────────────────────────────────────────
|
|
63
|
+
function seenStorageKey(appKey) {
|
|
64
|
+
return `an:changelog-seen:${appKey}`;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Tracks the latest release a user has already seen (per browser, via
|
|
68
|
+
* localStorage). Returns whether there's an unseen release and a `markSeen`
|
|
69
|
+
* callback to clear the indicator once the changelog is opened.
|
|
70
|
+
*/
|
|
71
|
+
export function useChangelogSeen(appKey, latestId) {
|
|
72
|
+
const [seenId, setSeenId] = useState(null);
|
|
73
|
+
const [hydrated, setHydrated] = useState(false);
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
try {
|
|
76
|
+
setSeenId(window.localStorage.getItem(seenStorageKey(appKey)));
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
// Private mode / disabled storage — treat as "nothing seen yet".
|
|
80
|
+
}
|
|
81
|
+
setHydrated(true);
|
|
82
|
+
}, [appKey]);
|
|
83
|
+
const markSeen = React.useCallback(() => {
|
|
84
|
+
if (!latestId)
|
|
85
|
+
return;
|
|
86
|
+
setSeenId(latestId);
|
|
87
|
+
try {
|
|
88
|
+
window.localStorage.setItem(seenStorageKey(appKey), latestId);
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
// Ignore storage failures; the dot just won't persist.
|
|
92
|
+
}
|
|
93
|
+
}, [appKey, latestId]);
|
|
94
|
+
// Don't flag "unseen" until hydrated, and never on a first-ever visit (no
|
|
95
|
+
// stored value) — only once the user has seen *something* and a newer
|
|
96
|
+
// release appears. This avoids nagging brand-new users.
|
|
97
|
+
const unseen = hydrated && !!latestId && seenId !== null && seenId !== latestId;
|
|
98
|
+
return { unseen, markSeen };
|
|
99
|
+
}
|
|
100
|
+
// ─── Shared markup ────────────────────────────────────────────────────────────
|
|
101
|
+
function ChangelogEntries({ entries, emptyText, }) {
|
|
102
|
+
if (entries.length === 0) {
|
|
103
|
+
return _jsx("p", { className: "text-sm text-muted-foreground", children: emptyText });
|
|
104
|
+
}
|
|
105
|
+
return (_jsx("div", { className: "space-y-6", children: entries.map((entry) => (_jsxs("section", { children: [_jsx("h4", { className: "mb-2 text-sm font-semibold text-foreground", children: formatEntryHeading(entry) }), _jsx(ChangelogBody, { markdown: entry.body })] }, entry.id))) }));
|
|
106
|
+
}
|
|
107
|
+
export function ChangelogDialog({ open, onOpenChange, markdown, title = "What's new", }) {
|
|
108
|
+
const entries = useMemo(() => parseChangelog(markdown), [markdown]);
|
|
109
|
+
useEffect(() => {
|
|
110
|
+
if (!open)
|
|
111
|
+
return;
|
|
112
|
+
const onKey = (e) => {
|
|
113
|
+
if (e.key === "Escape") {
|
|
114
|
+
e.preventDefault();
|
|
115
|
+
onOpenChange(false);
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
document.addEventListener("keydown", onKey);
|
|
119
|
+
return () => document.removeEventListener("keydown", onKey);
|
|
120
|
+
}, [open, onOpenChange]);
|
|
121
|
+
if (!open)
|
|
122
|
+
return null;
|
|
123
|
+
return (_jsx("div", { className: "fixed inset-0 z-50 flex items-start justify-center bg-black/50 p-4", onMouseDown: (e) => {
|
|
124
|
+
if (e.target === e.currentTarget)
|
|
125
|
+
onOpenChange(false);
|
|
126
|
+
}, children: _jsxs("div", { role: "dialog", "aria-modal": "true", "aria-label": title, className: "mt-[8vh] flex max-h-[80vh] w-full max-w-xl flex-col rounded-lg border border-border bg-popover text-popover-foreground shadow-lg", children: [_jsxs("div", { className: "flex items-center justify-between border-b border-border px-5 py-3.5", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(IconHistory, { className: "h-4 w-4 text-muted-foreground" }), _jsx("h3", { className: "text-sm font-semibold", children: title })] }), _jsx("button", { type: "button", onClick: () => onOpenChange(false), "aria-label": "Close", className: "rounded-sm p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground", children: _jsx(IconX, { className: "h-4 w-4" }) })] }), _jsx("div", { className: "overflow-y-auto px-5 py-4", children: _jsx(ChangelogEntries, { entries: entries, emptyText: "No updates have been published yet." }) })] }) }));
|
|
127
|
+
}
|
|
128
|
+
export function ChangelogSettingsCard({ markdown, limit = 2, title = "What's new", className, }) {
|
|
129
|
+
const entries = useMemo(() => parseChangelog(markdown), [markdown]);
|
|
130
|
+
const [dialogOpen, setDialogOpen] = useState(false);
|
|
131
|
+
if (entries.length === 0)
|
|
132
|
+
return null;
|
|
133
|
+
const shown = entries.slice(0, limit);
|
|
134
|
+
const hasMore = entries.length > shown.length;
|
|
135
|
+
return (_jsxs("div", { className: cn("rounded-lg border border-border bg-card text-card-foreground", className), children: [_jsxs("div", { className: "flex items-center gap-2 border-b border-border px-5 py-4", children: [_jsx(IconHistory, { className: "h-4 w-4 text-muted-foreground" }), _jsx("h3", { className: "text-sm font-semibold", children: title })] }), _jsxs("div", { className: "px-5 py-4", children: [_jsx(ChangelogEntries, { entries: shown, emptyText: "No updates yet." }), hasMore && (_jsx("button", { type: "button", onClick: () => setDialogOpen(true), className: "mt-4 text-sm font-medium text-foreground underline underline-offset-2", children: "View all updates" }))] }), _jsx(ChangelogDialog, { open: dialogOpen, onOpenChange: setDialogOpen, markdown: markdown, title: title })] }));
|
|
136
|
+
}
|
|
137
|
+
export { parseChangelog };
|
|
138
|
+
//# sourceMappingURL=Changelog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Changelog.js","sourceRoot":"","sources":["../../../src/client/changelog/Changelog.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EA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AE,CACX,8DAA8D,EAC9D,SAAS,CACV,aAED,eAAK,SAAS,EAAC,0DAA0D,aACvE,KAAC,WAAW,IAAC,SAAS,EAAC,+BAA+B,GAAG,EACzD,aAAI,SAAS,EAAC,uBAAuB,YAAE,KAAK,GAAM,IAC9C,EACN,eAAK,SAAS,EAAC,WAAW,aACxB,KAAC,gBAAgB,IAAC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAC,iBAAiB,GAAG,EAC/D,OAAO,IAAI,CACV,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,EAClC,SAAS,EAAC,uEAAuE,iCAG1E,CACV,IACG,EACN,KAAC,eAAe,IACd,IAAI,EAAE,UAAU,EAChB,YAAY,EAAE,aAAa,EAC3B,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,GACZ,IACE,CACP,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,CAAC","sourcesContent":["/**\n * Changelog UI — renders an app's CHANGELOG.md as an in-app \"What's new\"\n * surface. Core owns all of this; a template just passes its own\n * `CHANGELOG.md?raw` content in (Vite inlines it at build time, so this works\n * on every host with no runtime file access or server route).\n *\n * Surfaces:\n * - <ChangelogDialog> a self-contained modal listing every release.\n * - <ChangelogSettingsCard> a settings-page card with the latest updates.\n * - useChangelogSeen() tracks the last release a user has seen (so the\n * command menu can show an \"unseen\" dot).\n *\n * The command menu's built-in `changelog` prop (see CommandMenu.tsx) wires the\n * dialog automatically — most templates never touch these directly.\n */\n\nimport React, { useEffect, useMemo, useState } from \"react\";\nimport { IconX, IconHistory } from \"@tabler/icons-react\";\n\nimport { parseChangelog, type ChangelogEntry } from \"../../changelog/parse.js\";\nimport {\n markdownModule,\n remarkGfmFn,\n useMarkdownReady,\n markdownUrlTransform,\n} from \"../chat/markdown-renderer.js\";\nimport { cn } from \"../utils.js\";\n\n// ─── Date formatting ──────────────────────────────────────────────────────────\n\nfunction formatEntryHeading(entry: ChangelogEntry): string {\n if (entry.date) {\n // Parse as a plain calendar date (avoid TZ shifting YYYY-MM-DD back a day).\n const [y, m, d] = entry.date.split(\"-\").map(Number);\n if (y && m && d) {\n const formatted = new Date(y, m - 1, d).toLocaleDateString(undefined, {\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\",\n });\n return entry.version ? `${entry.version} · ${formatted}` : formatted;\n }\n }\n return entry.title;\n}\n\n// ─── Markdown body ────────────────────────────────────────────────────────────\n// A small, self-contained renderer for a release body. Avoids depending on the\n// typography plugin (`prose`) being generated in the host template by applying\n// explicit utility classes that Tailwind scans from core's compiled output.\n\nconst changelogMarkdownComponents = {\n h3: (props: React.HTMLAttributes<HTMLHeadingElement>) => (\n <h3\n {...props}\n className=\"mb-1.5 mt-3 text-xs font-semibold uppercase tracking-wide text-muted-foreground first:mt-0\"\n />\n ),\n ul: (props: React.HTMLAttributes<HTMLUListElement>) => (\n <ul\n {...props}\n className=\"mb-2 ml-1 list-disc space-y-1 pl-4 text-sm text-foreground marker:text-muted-foreground\"\n />\n ),\n ol: (props: React.HTMLAttributes<HTMLOListElement>) => (\n <ol\n {...props}\n className=\"mb-2 ml-1 list-decimal space-y-1 pl-4 text-sm text-foreground marker:text-muted-foreground\"\n />\n ),\n li: (props: React.HTMLAttributes<HTMLLIElement>) => (\n <li {...props} className=\"leading-relaxed\" />\n ),\n p: (props: React.HTMLAttributes<HTMLParagraphElement>) => (\n <p {...props} className=\"mb-2 text-sm leading-relaxed text-foreground\" />\n ),\n a: (props: React.AnchorHTMLAttributes<HTMLAnchorElement>) => (\n <a\n {...props}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"font-medium underline underline-offset-2\"\n />\n ),\n code: (props: React.HTMLAttributes<HTMLElement>) => (\n <code\n {...props}\n className=\"rounded bg-muted px-1 py-0.5 font-mono text-[0.85em]\"\n />\n ),\n};\n\nfunction ChangelogBody({ markdown }: { markdown: string }) {\n const ready = useMarkdownReady();\n const ReactMarkdown = markdownModule?.default;\n const gfm = remarkGfmFn;\n\n if (!ready || !ReactMarkdown || !gfm) {\n // The react-markdown chunk loads on module eval; this is typically only one\n // frame. Show readable plain text rather than nothing in the meantime.\n return (\n <div className=\"whitespace-pre-wrap text-sm text-foreground\">\n {markdown}\n </div>\n );\n }\n return (\n <ReactMarkdown\n remarkPlugins={[gfm]}\n components={changelogMarkdownComponents}\n urlTransform={markdownUrlTransform}\n >\n {markdown}\n </ReactMarkdown>\n );\n}\n\n// ─── Unseen tracking ──────────────────────────────────────────────────────────\n\nfunction seenStorageKey(appKey: string): string {\n return `an:changelog-seen:${appKey}`;\n}\n\n/**\n * Tracks the latest release a user has already seen (per browser, via\n * localStorage). Returns whether there's an unseen release and a `markSeen`\n * callback to clear the indicator once the changelog is opened.\n */\nexport function useChangelogSeen(\n appKey: string,\n latestId: string | undefined,\n): { unseen: boolean; markSeen: () => void } {\n const [seenId, setSeenId] = useState<string | null>(null);\n const [hydrated, setHydrated] = useState(false);\n\n useEffect(() => {\n try {\n setSeenId(window.localStorage.getItem(seenStorageKey(appKey)));\n } catch {\n // Private mode / disabled storage — treat as \"nothing seen yet\".\n }\n setHydrated(true);\n }, [appKey]);\n\n const markSeen = React.useCallback(() => {\n if (!latestId) return;\n setSeenId(latestId);\n try {\n window.localStorage.setItem(seenStorageKey(appKey), latestId);\n } catch {\n // Ignore storage failures; the dot just won't persist.\n }\n }, [appKey, latestId]);\n\n // Don't flag \"unseen\" until hydrated, and never on a first-ever visit (no\n // stored value) — only once the user has seen *something* and a newer\n // release appears. This avoids nagging brand-new users.\n const unseen =\n hydrated && !!latestId && seenId !== null && seenId !== latestId;\n\n return { unseen, markSeen };\n}\n\n// ─── Shared markup ────────────────────────────────────────────────────────────\n\nfunction ChangelogEntries({\n entries,\n emptyText,\n}: {\n entries: ChangelogEntry[];\n emptyText: string;\n}) {\n if (entries.length === 0) {\n return <p className=\"text-sm text-muted-foreground\">{emptyText}</p>;\n }\n return (\n <div className=\"space-y-6\">\n {entries.map((entry) => (\n <section key={entry.id}>\n <h4 className=\"mb-2 text-sm font-semibold text-foreground\">\n {formatEntryHeading(entry)}\n </h4>\n <ChangelogBody markdown={entry.body} />\n </section>\n ))}\n </div>\n );\n}\n\n// ─── Dialog ───────────────────────────────────────────────────────────────────\n\nexport interface ChangelogDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n /** Raw CHANGELOG.md contents (e.g. `import md from \"../CHANGELOG.md?raw\"`). */\n markdown: string;\n /** Dialog heading. Default: \"What's new\". */\n title?: string;\n}\n\nexport function ChangelogDialog({\n open,\n onOpenChange,\n markdown,\n title = \"What's new\",\n}: ChangelogDialogProps) {\n const entries = useMemo(() => parseChangelog(markdown), [markdown]);\n\n useEffect(() => {\n if (!open) return;\n const onKey = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") {\n e.preventDefault();\n onOpenChange(false);\n }\n };\n document.addEventListener(\"keydown\", onKey);\n return () => document.removeEventListener(\"keydown\", onKey);\n }, [open, onOpenChange]);\n\n if (!open) return null;\n\n return (\n <div\n className=\"fixed inset-0 z-50 flex items-start justify-center bg-black/50 p-4\"\n onMouseDown={(e) => {\n if (e.target === e.currentTarget) onOpenChange(false);\n }}\n >\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={title}\n className=\"mt-[8vh] flex max-h-[80vh] w-full max-w-xl flex-col rounded-lg border border-border bg-popover text-popover-foreground shadow-lg\"\n >\n <div className=\"flex items-center justify-between border-b border-border px-5 py-3.5\">\n <div className=\"flex items-center gap-2\">\n <IconHistory className=\"h-4 w-4 text-muted-foreground\" />\n <h3 className=\"text-sm font-semibold\">{title}</h3>\n </div>\n <button\n type=\"button\"\n onClick={() => onOpenChange(false)}\n aria-label=\"Close\"\n className=\"rounded-sm p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"\n >\n <IconX className=\"h-4 w-4\" />\n </button>\n </div>\n <div className=\"overflow-y-auto px-5 py-4\">\n <ChangelogEntries\n entries={entries}\n emptyText=\"No updates have been published yet.\"\n />\n </div>\n </div>\n </div>\n );\n}\n\n// ─── Settings card ────────────────────────────────────────────────────────────\n\nexport interface ChangelogSettingsCardProps {\n /** Raw CHANGELOG.md contents (e.g. `import md from \"../CHANGELOG.md?raw\"`). */\n markdown: string;\n /** How many recent releases to show inline before \"View all\". Default: 2. */\n limit?: number;\n /** Card heading. Default: \"What's new\". */\n title?: string;\n className?: string;\n}\n\nexport function ChangelogSettingsCard({\n markdown,\n limit = 2,\n title = \"What's new\",\n className,\n}: ChangelogSettingsCardProps) {\n const entries = useMemo(() => parseChangelog(markdown), [markdown]);\n const [dialogOpen, setDialogOpen] = useState(false);\n\n if (entries.length === 0) return null;\n\n const shown = entries.slice(0, limit);\n const hasMore = entries.length > shown.length;\n\n return (\n <div\n className={cn(\n \"rounded-lg border border-border bg-card text-card-foreground\",\n className,\n )}\n >\n <div className=\"flex items-center gap-2 border-b border-border px-5 py-4\">\n <IconHistory className=\"h-4 w-4 text-muted-foreground\" />\n <h3 className=\"text-sm font-semibold\">{title}</h3>\n </div>\n <div className=\"px-5 py-4\">\n <ChangelogEntries entries={shown} emptyText=\"No updates yet.\" />\n {hasMore && (\n <button\n type=\"button\"\n onClick={() => setDialogOpen(true)}\n className=\"mt-4 text-sm font-medium text-foreground underline underline-offset-2\"\n >\n View all updates\n </button>\n )}\n </div>\n <ChangelogDialog\n open={dialogOpen}\n onOpenChange={setDialogOpen}\n markdown={markdown}\n title={title}\n />\n </div>\n );\n}\n\nexport { parseChangelog };\nexport type { ChangelogEntry };\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The runtime shell the web UI is rendering inside. Used as pass-through
|
|
3
|
+
* feedback metadata so form owners can tell whether a submission came from the
|
|
4
|
+
* Agent Native desktop app (Electron), a Tauri desktop shell (e.g. Clips), or a
|
|
5
|
+
* plain browser — without surfacing it as a visible form field.
|
|
6
|
+
*/
|
|
7
|
+
export type ClientSurface = "web" | "electron" | "tauri";
|
|
8
|
+
/**
|
|
9
|
+
* Best-effort, side-effect-free detection of the current client surface.
|
|
10
|
+
* Returns "web" during SSR and in any plain browser.
|
|
11
|
+
*
|
|
12
|
+
* Electron detection keys off the `AgentNativeDesktop` User-Agent token that the
|
|
13
|
+
* desktop shell appends app-wide (see `app.userAgentFallback`), plus the preload
|
|
14
|
+
* globals, so it stays specific to our app rather than every Electron webview.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getClientSurface(): ClientSurface;
|
|
17
|
+
//# sourceMappingURL=client-surface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-surface.d.ts","sourceRoot":"","sources":["../../src/client/client-surface.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,UAAU,GAAG,OAAO,CAAC;AAYzD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,IAAI,aAAa,CAchD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Best-effort, side-effect-free detection of the current client surface.
|
|
3
|
+
* Returns "web" during SSR and in any plain browser.
|
|
4
|
+
*
|
|
5
|
+
* Electron detection keys off the `AgentNativeDesktop` User-Agent token that the
|
|
6
|
+
* desktop shell appends app-wide (see `app.userAgentFallback`), plus the preload
|
|
7
|
+
* globals, so it stays specific to our app rather than every Electron webview.
|
|
8
|
+
*/
|
|
9
|
+
export function getClientSurface() {
|
|
10
|
+
if (typeof window === "undefined")
|
|
11
|
+
return "web";
|
|
12
|
+
const w = window;
|
|
13
|
+
if (w.__TAURI_INTERNALS__ || w.__TAURI__)
|
|
14
|
+
return "tauri";
|
|
15
|
+
const ua = typeof navigator !== "undefined" ? navigator.userAgent || "" : "";
|
|
16
|
+
if (/AgentNativeDesktop/i.test(ua) ||
|
|
17
|
+
/\bElectron\b/i.test(ua) ||
|
|
18
|
+
w.agentNativeDesktop ||
|
|
19
|
+
w.electronAPI) {
|
|
20
|
+
return "electron";
|
|
21
|
+
}
|
|
22
|
+
return "web";
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=client-surface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-surface.js","sourceRoot":"","sources":["../../src/client/client-surface.ts"],"names":[],"mappings":"AAkBA;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB;IAC9B,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO,KAAK,CAAC;IAChD,MAAM,CAAC,GAAG,MAAmC,CAAC;IAC9C,IAAI,CAAC,CAAC,mBAAmB,IAAI,CAAC,CAAC,SAAS;QAAE,OAAO,OAAO,CAAC;IACzD,MAAM,EAAE,GAAG,OAAO,SAAS,KAAK,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7E,IACE,qBAAqB,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9B,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;QACxB,CAAC,CAAC,kBAAkB;QACpB,CAAC,CAAC,WAAW,EACb,CAAC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/**\n * The runtime shell the web UI is rendering inside. Used as pass-through\n * feedback metadata so form owners can tell whether a submission came from the\n * Agent Native desktop app (Electron), a Tauri desktop shell (e.g. Clips), or a\n * plain browser — without surfacing it as a visible form field.\n */\nexport type ClientSurface = \"web\" | \"electron\" | \"tauri\";\n\ninterface SurfaceGlobals {\n // Tauri v2 always injects this into the webview; `__TAURI__` only exists when\n // the app opts into `withGlobalTauri`, so check both.\n __TAURI_INTERNALS__?: unknown;\n __TAURI__?: unknown;\n // Exposed by the Agent Native desktop (Electron) preload bridges.\n agentNativeDesktop?: unknown;\n electronAPI?: unknown;\n}\n\n/**\n * Best-effort, side-effect-free detection of the current client surface.\n * Returns \"web\" during SSR and in any plain browser.\n *\n * Electron detection keys off the `AgentNativeDesktop` User-Agent token that the\n * desktop shell appends app-wide (see `app.userAgentFallback`), plus the preload\n * globals, so it stays specific to our app rather than every Electron webview.\n */\nexport function getClientSurface(): ClientSurface {\n if (typeof window === \"undefined\") return \"web\";\n const w = window as unknown as SurfaceGlobals;\n if (w.__TAURI_INTERNALS__ || w.__TAURI__) return \"tauri\";\n const ua = typeof navigator !== \"undefined\" ? navigator.userAgent || \"\" : \"\";\n if (\n /AgentNativeDesktop/i.test(ua) ||\n /\\bElectron\\b/i.test(ua) ||\n w.agentNativeDesktop ||\n w.electronAPI\n ) {\n return \"electron\";\n }\n return \"web\";\n}\n"]}
|
|
@@ -110,6 +110,11 @@ export interface TiptapComposerProps {
|
|
|
110
110
|
* Used by the Electron desktop app to route through the native IPC handler.
|
|
111
111
|
*/
|
|
112
112
|
onConnectProvider?: () => void;
|
|
113
|
+
/**
|
|
114
|
+
* Optional secondary model menu (e.g. an image-generation model) rendered as
|
|
115
|
+
* an extra section inside the model picker. Opt-in; omit for chat-only apps.
|
|
116
|
+
*/
|
|
117
|
+
imageModelMenu?: ComposerImageModelMenu;
|
|
113
118
|
/** Stable scope for persisted drafts, usually the active thread or tab id. */
|
|
114
119
|
draftScope?: string;
|
|
115
120
|
/** Keyed context nuggets staged for the next submitted prompt. */
|
|
@@ -141,6 +146,26 @@ export interface TiptapComposerProps {
|
|
|
141
146
|
onAttachmentError?: (message: string) => void;
|
|
142
147
|
}
|
|
143
148
|
export declare function createTiptapComposerExtensions(getPlaceholder: () => string | undefined): (import("@tiptap/core").Node<any, any> | import("@tiptap/core").Extension<import("@tiptap/starter-kit").StarterKitOptions, any> | import("@tiptap/core").Extension<import("@tiptap/extension-placeholder").PlaceholderOptions, any>)[];
|
|
144
|
-
|
|
149
|
+
/**
|
|
150
|
+
* Optional secondary model menu for apps that drive a separate generation model
|
|
151
|
+
* alongside the chat LLM (e.g. the Assets app's image-generation model). When
|
|
152
|
+
* provided, the model picker renders an extra collapsible section so the user
|
|
153
|
+
* can see and pick both "what reasons about my request" (the chat model) and
|
|
154
|
+
* "what produces the output" (this model). Opt-in — omit it and nothing changes.
|
|
155
|
+
*/
|
|
156
|
+
export interface ComposerImageModelMenu {
|
|
157
|
+
/** Currently-selected model id for this secondary menu. */
|
|
158
|
+
value: string;
|
|
159
|
+
/** Selectable options (stable id + human label). */
|
|
160
|
+
options: Array<{
|
|
161
|
+
value: string;
|
|
162
|
+
label: string;
|
|
163
|
+
}>;
|
|
164
|
+
/** Invoked when the user picks a different option. */
|
|
165
|
+
onChange: (value: string) => void;
|
|
166
|
+
/** Section header. Defaults to "Image model". */
|
|
167
|
+
label?: string;
|
|
168
|
+
}
|
|
169
|
+
export declare function TiptapComposer({ placeholder, disabled, focusRef, initialText, initialTextKey, onSubmit, clearOnSubmit, onTextChange, actionButton, extraActionButton, attachButton, modeControl, toolbarSlot, layoutVariant, slashCommands, slashSkills, includeDefaultSlashCommands, includeDefaultSlashSkills, onSlashCommand, execMode, onExecModeChange, planModeDisabled, planModeDisabledReason, voiceEnabled, selectedModel, selectedEffort, availableModels, onModelChange, onEffortChange, providerConnectStatusEnabled, onConnectProvider, imageModelMenu, draftScope, contextItems, onRemoveContextItem, plusMenuMode, interceptBuildRequestsForBuilder, onAttachmentError, }: TiptapComposerProps): import("react/jsx-runtime").JSX.Element;
|
|
145
170
|
export {};
|
|
146
171
|
//# sourceMappingURL=TiptapComposer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TiptapComposer.d.ts","sourceRoot":"","sources":["../../../src/client/composer/TiptapComposer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAwBlD,OAAO,KAAK,EAEV,WAAW,EACX,SAAS,EACT,YAAY,EAEZ,0BAA0B,EAC3B,MAAM,YAAY,CAAC;AAIpB,OAAO,EAAmB,KAAK,oBAAoB,EAAE,MA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AAE,MAAM,CAAC;IACd,oDAAoD;IACpD,OAAO,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACjD,sDAAsD;IACtD,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA6XD,wBAAgB,cAAc,CAAC,EAC7B,WAAgC,EAChC,QAAgB,EAChB,QAAQ,EACR,WAAW,EACX,cAAc,EACd,QAAQ,EACR,aAAoB,EACpB,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,WAAW,EACX,aAAyB,EACzB,aAAkB,EAClB,WAAgB,EAChB,2BAAkC,EAClC,yBAAgC,EAChC,cAAc,EACd,QAAQ,EACR,gBAAgB,EAChB,gBAAwB,EACxB,sBAAsB,EACtB,YAA8C,EAC9C,aAAa,EACb,cAAc,EACd,eAAe,EACf,aAAa,EACb,cAAc,EACd,4BAA4B,EAC5B,iBAAiB,EACjB,cAAc,EACd,UAAU,EACV,YAAiB,EACjB,mBAAmB,EACnB,YAAqB,EACrB,gCAAwC,EACxC,iBAAiB,GAClB,EAAE,mBAAmB,2CAsnCrB"}
|
|
@@ -347,7 +347,7 @@ function latestModelsOnly(models) {
|
|
|
347
347
|
return true;
|
|
348
348
|
});
|
|
349
349
|
}
|
|
350
|
-
function ModelSelector({ model, effort = "auto", engines, onChange, onEffortChange, providerConnectStatusEnabled = true, onConnectProvider, }) {
|
|
350
|
+
function ModelSelector({ model, effort = "auto", engines, onChange, onEffortChange, providerConnectStatusEnabled = true, onConnectProvider, imageModel, }) {
|
|
351
351
|
const [open, setOpen] = useState(false);
|
|
352
352
|
const autoModelGroup = engines.find((group) => group.models.includes("auto"));
|
|
353
353
|
const providerGroups = useMemo(() => engines
|
|
@@ -391,6 +391,23 @@ function ModelSelector({ model, effort = "auto", engines, onChange, onEffortChan
|
|
|
391
391
|
return next;
|
|
392
392
|
});
|
|
393
393
|
}, []);
|
|
394
|
+
// The reasoning effort list is collapsed by default — it's a secondary
|
|
395
|
+
// control most users don't touch, so it stays tucked behind a header that
|
|
396
|
+
// reveals the current effort at a glance. Reset to collapsed on each open.
|
|
397
|
+
const [reasoningExpanded, setReasoningExpanded] = useState(false);
|
|
398
|
+
useEffect(() => {
|
|
399
|
+
if (open)
|
|
400
|
+
setReasoningExpanded(false);
|
|
401
|
+
}, [open]);
|
|
402
|
+
// The optional image-model section follows the same collapsed-by-default
|
|
403
|
+
// pattern; the current selection shows next to the header.
|
|
404
|
+
const [imageExpanded, setImageExpanded] = useState(false);
|
|
405
|
+
useEffect(() => {
|
|
406
|
+
if (open)
|
|
407
|
+
setImageExpanded(false);
|
|
408
|
+
}, [open]);
|
|
409
|
+
const imageModelLabel = imageModel?.options.find((option) => option.value === imageModel.value)
|
|
410
|
+
?.label ?? imageModel?.value;
|
|
394
411
|
// When Builder.io isn't connected, surface a one-click connect path —
|
|
395
412
|
// it unlocks every model family (Claude, OpenAI, Gemini) without the
|
|
396
413
|
// user having to paste individual API keys.
|
|
@@ -429,7 +446,11 @@ function ModelSelector({ model, effort = "auto", engines, onChange, onEffortChan
|
|
|
429
446
|
}
|
|
430
447
|
}, disabled: !onConnectProvider && builderFlow.connecting, className: "flex w-full items-start gap-2 px-3 py-2 text-left hover:bg-accent/50 disabled:opacity-60", children: [_jsx(IconPlugConnected, { className: "h-4 w-4 shrink-0 mt-0.5 text-blue-500" }), _jsxs("span", { className: "flex-1 min-w-0", children: [_jsx("span", { className: "block text-[12px] font-medium text-foreground", children: !onConnectProvider && builderFlow.connecting
|
|
431
448
|
? "Connecting Builder.io…"
|
|
432
|
-
: "Connect Builder.io" }), _jsx("span", { className: "block text-[11px] text-muted-foreground", children: "Free credits for Claude, OpenAI & Gemini" })] })] }), _jsx("div", { className: "my-1 border-t border-border" })] })),
|
|
449
|
+
: "Connect Builder.io" }), _jsx("span", { className: "block text-[11px] text-muted-foreground", children: "Free credits for Claude, OpenAI & Gemini" })] })] }), _jsx("div", { className: "my-1 border-t border-border" })] })), imageModel && imageModel.options.length > 0 && (_jsxs(_Fragment, { children: [_jsx("div", { className: "flex items-center hover:bg-accent/30", children: _jsxs("button", { type: "button", "aria-expanded": imageExpanded, onClick: () => setImageExpanded((prev) => !prev), className: "flex flex-1 min-w-0 items-center gap-1.5 px-2 py-1.5 cursor-pointer text-left", children: [imageExpanded ? (_jsx(IconChevronDown, { className: "h-3 w-3 shrink-0 text-muted-foreground" })) : (_jsx(IconChevronRight, { className: "h-3 w-3 shrink-0 text-muted-foreground" })), _jsx("span", { className: "text-[11px] font-medium text-muted-foreground uppercase tracking-wide shrink-0", children: imageModel.label ?? "Image model" }), !imageExpanded && imageModelLabel && (_jsx("span", { className: "text-[11px] text-muted-foreground/80 truncate", children: imageModelLabel }))] }) }), imageExpanded &&
|
|
450
|
+
imageModel.options.map((option) => (_jsxs("button", { type: "button", onClick: () => {
|
|
451
|
+
imageModel.onChange(option.value);
|
|
452
|
+
setImageExpanded(false);
|
|
453
|
+
}, className: "flex w-full items-center gap-3 pl-7 pr-3 py-1.5 text-left hover:bg-accent/50", children: [_jsx("span", { className: "flex-1 min-w-0 text-[13px] text-foreground truncate", children: option.label }), option.value === imageModel.value && (_jsx(IconCheck, { className: "h-3.5 w-3.5 shrink-0 text-blue-500" }))] }, option.value))), _jsx("div", { className: "my-1 border-t border-border" })] })), autoModelGroup && (_jsxs("button", { type: "button", onClick: () => {
|
|
433
454
|
onChange("auto", autoModelGroup.engine);
|
|
434
455
|
setOpen(false);
|
|
435
456
|
}, className: "flex w-full items-center gap-3 px-3 py-1.5 text-left hover:bg-accent/50", children: [_jsx("span", { className: "flex-1 min-w-0 text-[13px] text-foreground truncate", children: "Auto" }), model === "auto" && (_jsx(IconCheck, { className: "h-3.5 w-3.5 shrink-0 text-blue-500" }))] })), autoModelGroup && providerGroups.length > 0 && (_jsx("div", { className: "my-1 border-t border-border" })), providerGroups.map((group) => {
|
|
@@ -454,9 +475,10 @@ function ModelSelector({ model, effort = "auto", engines, onChange, onEffortChan
|
|
|
454
475
|
}, className: `flex w-full items-center gap-3 pl-7 pr-3 py-1.5 text-left ${group.configured
|
|
455
476
|
? "hover:bg-accent/50"
|
|
456
477
|
: "opacity-40 cursor-default"}`, children: [_jsx("span", { className: "flex-1 min-w-0 text-[13px] text-foreground truncate", children: friendlyModelName(m) }), m === model && group.configured && (_jsx(IconCheck, { className: "h-3.5 w-3.5 shrink-0 text-blue-500" }))] }, m)))] }, groupKey));
|
|
457
|
-
}), effortOptions.length > 0 && (_jsxs(_Fragment, { children: [_jsx("div", { className: "my-1 border-t border-border" }), _jsx("div", { className: "
|
|
478
|
+
}), effortOptions.length > 0 && (_jsxs(_Fragment, { children: [_jsx("div", { className: "my-1 border-t border-border" }), _jsx("div", { className: "flex items-center hover:bg-accent/30", children: _jsxs("button", { type: "button", "aria-expanded": reasoningExpanded, onClick: () => setReasoningExpanded((prev) => !prev), className: "flex flex-1 min-w-0 items-center gap-1.5 px-2 py-1.5 cursor-pointer text-left", children: [reasoningExpanded ? (_jsx(IconChevronDown, { className: "h-3 w-3 shrink-0 text-muted-foreground" })) : (_jsx(IconChevronRight, { className: "h-3 w-3 shrink-0 text-muted-foreground" })), _jsx("span", { className: "text-[11px] font-medium text-muted-foreground uppercase tracking-wide shrink-0", children: "Reasoning" }), !reasoningExpanded && (_jsx("span", { className: "text-[11px] text-muted-foreground/80 truncate", children: reasoningEffortLabel(effort) }))] }) }), reasoningExpanded &&
|
|
479
|
+
effortOptions.map((option) => (_jsxs("button", { type: "button", onClick: () => onEffortChange?.(option), className: "flex w-full items-center gap-3 pl-7 pr-3 py-1.5 text-left hover:bg-accent/50", children: [_jsx("span", { className: "flex-1 min-w-0 text-[13px] text-foreground truncate", children: reasoningEffortLabel(option) }), option === effort && (_jsx(IconCheck, { className: "h-3.5 w-3.5 shrink-0 text-blue-500" }))] }, option)))] }))] })] }));
|
|
458
480
|
}
|
|
459
|
-
export function TiptapComposer({ placeholder = "Message agent...", disabled = false, focusRef, initialText, initialTextKey, onSubmit, clearOnSubmit = true, onTextChange, actionButton, extraActionButton, attachButton, modeControl, toolbarSlot, layoutVariant = "default", slashCommands = [], slashSkills = [], includeDefaultSlashCommands = true, includeDefaultSlashSkills = true, onSlashCommand, execMode, onExecModeChange, planModeDisabled = false, planModeDisabledReason, voiceEnabled = DEFAULT_VOICE_DICTATION_ENABLED, selectedModel, selectedEffort, availableModels, onModelChange, onEffortChange, providerConnectStatusEnabled, onConnectProvider, draftScope, contextItems = [], onRemoveContextItem, plusMenuMode = "full", interceptBuildRequestsForBuilder = false, onAttachmentError, }) {
|
|
481
|
+
export function TiptapComposer({ placeholder = "Message agent...", disabled = false, focusRef, initialText, initialTextKey, onSubmit, clearOnSubmit = true, onTextChange, actionButton, extraActionButton, attachButton, modeControl, toolbarSlot, layoutVariant = "default", slashCommands = [], slashSkills = [], includeDefaultSlashCommands = true, includeDefaultSlashSkills = true, onSlashCommand, execMode, onExecModeChange, planModeDisabled = false, planModeDisabledReason, voiceEnabled = DEFAULT_VOICE_DICTATION_ENABLED, selectedModel, selectedEffort, availableModels, onModelChange, onEffortChange, providerConnectStatusEnabled, onConnectProvider, imageModelMenu, draftScope, contextItems = [], onRemoveContextItem, plusMenuMode = "full", interceptBuildRequestsForBuilder = false, onAttachmentError, }) {
|
|
460
482
|
const [popover, setPopover] = useState(null);
|
|
461
483
|
const popoverRef = useRef(null);
|
|
462
484
|
const composerRuntime = useComposerRuntime();
|
|
@@ -1352,6 +1374,6 @@ export function TiptapComposer({ placeholder = "Message agent...", disabled = fa
|
|
|
1352
1374
|
composerModeRef.current = null;
|
|
1353
1375
|
editor?.commands.focus("end");
|
|
1354
1376
|
} }) })), hasContextItems && (_jsx("div", { "data-agent-composer-variant": layoutVariant, "data-agent-composer-slot": "context-row", className: "agent-composer-context-row flex flex-wrap gap-1.5 px-2.5 pt-2 pb-0", children: contextItems.map((item) => (_jsxs("span", { className: "inline-flex max-w-full items-center gap-1.5 rounded-md border border-border bg-muted/50 px-2 py-1 text-[11px] font-medium text-foreground", children: [_jsx(IconClipboardList, { className: "h-3 w-3 shrink-0 text-muted-foreground" }), _jsx("span", { className: "min-w-0 truncate", children: item.title }), _jsx("button", { type: "button", onClick: () => onRemoveContextItem?.(item.key), "aria-label": `Remove ${item.title} context`, className: "ml-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-accent hover:text-foreground", children: _jsx(IconX, { className: "h-3 w-3" }) })] }, item.key))) })), _jsx("div", { "data-agent-composer-variant": layoutVariant, "data-agent-composer-slot": "editor-wrap", className: `agent-composer-editor-wrap ${composerMode || hasContextItems ? "px-2 pt-1 pb-1" : "px-2 pt-2 pb-1"}`, children: _jsx(EditorContent, { editor: editor, "data-agent-composer-variant": layoutVariant, "data-agent-composer-slot": "editor", className: "agent-composer-editor aui-composer flex-1 min-w-0 [&_.ProseMirror]:outline-none [&_.ProseMirror_p]:m-0 px-0.5" }) }), voiceEnabled && _jsx(VoiceRecordingOverlay, { voice: voice }), _jsxs("div", { "data-agent-composer-variant": layoutVariant, "data-agent-composer-slot": "toolbar", className: "agent-composer-toolbar flex items-center gap-1 px-2 py-1.5", children: [attachButton ??
|
|
1355
|
-
(plusMenuMode === "hidden" ? null : (_jsx(ComposerPlusMenu, { onSelectMode: handleSelectMode, mode: plusMenuMode, onAttachmentError: onAttachmentError }))), toolbarSlot ?? modeControl, _jsx("div", { "data-agent-composer-slot": "toolbar-spacer", className: "flex-1" }), selectedModel && availableModels && onModelChange && (_jsx(ModelSelector, { model: selectedModel, effort: selectedEffort, engines: availableModels, onChange: onModelChange, onEffortChange: onEffortChange, providerConnectStatusEnabled: providerConnectStatusEnabled, onConnectProvider: onConnectProvider })), execMode && onExecModeChange && (_jsx(ModeSelector, { mode: execMode, onChange: onExecModeChange, planModeDisabled: planModeDisabled, planModeDisabledReason: planModeDisabledReason })), actionButton ?? (_jsxs(_Fragment, { children: [extraActionButton, voiceEnabled && (_jsx(VoiceButton, { voice: voice, isMac: isMac, disabled: disabled })), _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { type: "button", onClick: () => submitComposer("immediate"), disabled: !canSend, "data-agent-composer-slot": "send-button", className: "agent-composer-send-button shrink-0 flex h-7 w-7 items-center justify-center rounded-md bg-primary text-primary-foreground hover:opacity-90 disabled:opacity-30 disabled:cursor-not-allowed", children: _jsx(IconArrowUp, { className: "h-3.5 w-3.5" }) }) }), _jsx(TooltipContent, { children: "Send message" })] })] }))] }), _jsx(MentionPopover, { ref: popoverRef, type: popover?.type ?? "@", position: popover?.position ?? null, mentionItems: mentionItems, skills: filteredSkills, commands: filteredCommands, hint: hint, isLoading: popover?.type === "@" ? mentionsLoading : skillsLoading, query: popover?.query ?? "", onSelectMention: handleSelectMention, onSelectSkill: handleSelectSkill, onSelectCommand: handleSelectCommand, onClose: closePopover })] }));
|
|
1377
|
+
(plusMenuMode === "hidden" ? null : (_jsx(ComposerPlusMenu, { onSelectMode: handleSelectMode, mode: plusMenuMode, onAttachmentError: onAttachmentError }))), toolbarSlot ?? modeControl, _jsx("div", { "data-agent-composer-slot": "toolbar-spacer", className: "flex-1" }), selectedModel && availableModels && onModelChange && (_jsx(ModelSelector, { model: selectedModel, effort: selectedEffort, engines: availableModels, onChange: onModelChange, onEffortChange: onEffortChange, providerConnectStatusEnabled: providerConnectStatusEnabled, onConnectProvider: onConnectProvider, imageModel: imageModelMenu })), execMode && onExecModeChange && (_jsx(ModeSelector, { mode: execMode, onChange: onExecModeChange, planModeDisabled: planModeDisabled, planModeDisabledReason: planModeDisabledReason })), actionButton ?? (_jsxs(_Fragment, { children: [extraActionButton, voiceEnabled && (_jsx(VoiceButton, { voice: voice, isMac: isMac, disabled: disabled })), _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { type: "button", onClick: () => submitComposer("immediate"), disabled: !canSend, "data-agent-composer-slot": "send-button", className: "agent-composer-send-button shrink-0 flex h-7 w-7 items-center justify-center rounded-md bg-primary text-primary-foreground hover:opacity-90 disabled:opacity-30 disabled:cursor-not-allowed", children: _jsx(IconArrowUp, { className: "h-3.5 w-3.5" }) }) }), _jsx(TooltipContent, { children: "Send message" })] })] }))] }), _jsx(MentionPopover, { ref: popoverRef, type: popover?.type ?? "@", position: popover?.position ?? null, mentionItems: mentionItems, skills: filteredSkills, commands: filteredCommands, hint: hint, isLoading: popover?.type === "@" ? mentionsLoading : skillsLoading, query: popover?.query ?? "", onSelectMention: handleSelectMention, onSelectSkill: handleSelectSkill, onSelectCommand: handleSelectCommand, onClose: closePopover })] }));
|
|
1356
1378
|
}
|
|
1357
1379
|
//# sourceMappingURL=TiptapComposer.js.map
|