@agent-native/core 0.149.1 → 0.149.3
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 +1 -1
- package/corpus/templates/analytics/.agents/skills/actions/SKILL.md +54 -488
- package/corpus/templates/analytics/.agents/skills/actions/references/action-fields.md +136 -0
- package/corpus/templates/analytics/.agents/skills/actions/references/examples.md +94 -0
- package/corpus/templates/analytics/.agents/skills/actions/references/provider-apis.md +95 -0
- package/corpus/templates/analytics/.agents/skills/create-skill/SKILL.md +9 -35
- package/corpus/templates/analytics/.agents/skills/creative-context/SKILL.md +4 -2
- package/corpus/templates/analytics/.agents/skills/dashboard-management/SKILL.md +2 -0
- package/corpus/templates/analytics/.agents/skills/frontend-design/SKILL.md +4 -5
- package/corpus/templates/analytics/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/analytics/AGENTS.md +25 -32
- package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +150 -46
- package/corpus/templates/analytics/app/global.css +1 -1
- package/corpus/templates/analytics/app/i18n-data.ts +37 -0
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/PanelEditorDialog.tsx +1 -1
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +32 -0
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/types.ts +2 -0
- package/corpus/templates/analytics/changelog/2026-08-10-dashboard-tables-can-be-copied-and-sorted-by-multiple-column.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-10-full-page-chat-now-uses-the-available-width-up-to-1000px-for.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-11-full-page-chat-composers-stay-at-a-focused-750px-width.md +6 -0
- package/corpus/templates/assets/.agents/skills/actions/SKILL.md +54 -488
- package/corpus/templates/assets/.agents/skills/actions/references/action-fields.md +136 -0
- package/corpus/templates/assets/.agents/skills/actions/references/examples.md +94 -0
- package/corpus/templates/assets/.agents/skills/actions/references/provider-apis.md +95 -0
- package/corpus/templates/assets/.agents/skills/create-skill/SKILL.md +9 -35
- package/corpus/templates/assets/.agents/skills/creative-context/SKILL.md +4 -2
- package/corpus/templates/assets/.agents/skills/frontend-design/SKILL.md +4 -5
- package/corpus/templates/assets/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/assets/AGENTS.md +6 -9
- package/corpus/templates/assets/app/global.css +1 -1
- package/corpus/templates/assets/changelog/2026-08-10-full-page-chat-now-uses-the-available-width-up-to-1000px-for.md +6 -0
- package/corpus/templates/assets/changelog/2026-08-11-full-page-chat-composers-stay-at-a-focused-750px-width.md +6 -0
- package/corpus/templates/brain/.agents/skills/actions/SKILL.md +54 -488
- package/corpus/templates/brain/.agents/skills/actions/references/action-fields.md +136 -0
- package/corpus/templates/brain/.agents/skills/actions/references/examples.md +94 -0
- package/corpus/templates/brain/.agents/skills/actions/references/provider-apis.md +95 -0
- package/corpus/templates/brain/.agents/skills/create-skill/SKILL.md +9 -35
- package/corpus/templates/brain/.agents/skills/frontend-design/SKILL.md +4 -5
- package/corpus/templates/brain/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/brain/AGENTS.md +5 -12
- package/corpus/templates/brain/app/global.css +1 -1
- package/corpus/templates/brain/changelog/2026-08-10-full-page-chat-now-uses-the-available-width-up-to-1000px-for.md +6 -0
- package/corpus/templates/brain/changelog/2026-08-11-full-page-chat-composers-stay-at-a-focused-750px-width.md +6 -0
- package/corpus/templates/calendar/.agents/skills/actions/SKILL.md +54 -488
- package/corpus/templates/calendar/.agents/skills/actions/references/action-fields.md +136 -0
- package/corpus/templates/calendar/.agents/skills/actions/references/examples.md +94 -0
- package/corpus/templates/calendar/.agents/skills/actions/references/provider-apis.md +95 -0
- package/corpus/templates/calendar/.agents/skills/create-skill/SKILL.md +9 -35
- package/corpus/templates/calendar/.agents/skills/frontend-design/SKILL.md +4 -5
- package/corpus/templates/calendar/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/calendar/AGENTS.md +8 -9
- package/corpus/templates/chat/.agents/skills/actions/SKILL.md +54 -488
- package/corpus/templates/chat/.agents/skills/actions/references/action-fields.md +136 -0
- package/corpus/templates/chat/.agents/skills/actions/references/examples.md +94 -0
- package/corpus/templates/chat/.agents/skills/actions/references/provider-apis.md +95 -0
- package/corpus/templates/chat/.agents/skills/create-skill/SKILL.md +9 -35
- package/corpus/templates/chat/.agents/skills/frontend-design/SKILL.md +4 -5
- package/corpus/templates/chat/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/chat/AGENTS.md +32 -80
- package/corpus/templates/chat/changelog/2026-08-10-full-page-chat-now-uses-the-available-width-up-to-1000px-for.md +6 -0
- package/corpus/templates/clips/.agents/skills/actions/SKILL.md +54 -488
- package/corpus/templates/clips/.agents/skills/actions/references/action-fields.md +136 -0
- package/corpus/templates/clips/.agents/skills/actions/references/examples.md +94 -0
- package/corpus/templates/clips/.agents/skills/actions/references/provider-apis.md +95 -0
- package/corpus/templates/clips/.agents/skills/create-skill/SKILL.md +9 -35
- package/corpus/templates/clips/.agents/skills/frontend-design/SKILL.md +4 -5
- package/corpus/templates/clips/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/clips/AGENTS.md +25 -31
- package/corpus/templates/clips/changelog/2026-08-10-clips-desktop-sign-in-now-starts-with-magic-links-and-google.md +6 -0
- package/corpus/templates/clips/chrome-extension/src/overlay.css +1 -0
- package/corpus/templates/clips/desktop/src/app.tsx +274 -137
- package/corpus/templates/clips/desktop/src/styles.css +35 -0
- package/corpus/templates/content/.agents/skills/actions/SKILL.md +54 -488
- package/corpus/templates/content/.agents/skills/actions/references/action-fields.md +136 -0
- package/corpus/templates/content/.agents/skills/actions/references/examples.md +94 -0
- package/corpus/templates/content/.agents/skills/actions/references/provider-apis.md +95 -0
- package/corpus/templates/content/.agents/skills/create-skill/SKILL.md +9 -35
- package/corpus/templates/content/.agents/skills/creative-context/SKILL.md +4 -2
- package/corpus/templates/content/.agents/skills/frontend-design/SKILL.md +4 -5
- package/corpus/templates/content/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/content/AGENTS.md +5 -9
- package/corpus/templates/content/app/global.css +1 -0
- package/corpus/templates/crm/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/crm/AGENTS.md +7 -11
- package/corpus/templates/crm/app/global.css +1 -1
- package/corpus/templates/crm/changelog/2026-08-10-full-page-chat-now-uses-the-available-width-up-to-1000px-for.md +6 -0
- package/corpus/templates/crm/changelog/2026-08-11-full-page-chat-composers-stay-at-a-focused-750px-width.md +6 -0
- package/corpus/templates/design/.agents/skills/actions/SKILL.md +54 -488
- package/corpus/templates/design/.agents/skills/actions/references/action-fields.md +136 -0
- package/corpus/templates/design/.agents/skills/actions/references/examples.md +94 -0
- package/corpus/templates/design/.agents/skills/actions/references/provider-apis.md +95 -0
- package/corpus/templates/design/.agents/skills/create-skill/SKILL.md +9 -35
- package/corpus/templates/design/.agents/skills/creative-context/SKILL.md +4 -2
- package/corpus/templates/design/.agents/skills/frontend-design/SKILL.md +4 -5
- package/corpus/templates/design/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/design/.generated/bridge/editor-chrome.generated.ts +70 -3
- package/corpus/templates/design/AGENTS.md +13 -21
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +12 -0
- package/corpus/templates/design/app/components/design/LayersPanel.tsx +19 -2
- package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +115 -7
- package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +82 -7
- package/corpus/templates/design/app/components/design/design-trace.ts +120 -0
- package/corpus/templates/design/app/components/design/dnd-debug.ts +2 -1
- package/corpus/templates/design/app/components/design/edit-panel/position-layout-properties.tsx +40 -26
- package/corpus/templates/design/app/components/design/multi-screen/board-surface-html.ts +4 -1
- package/corpus/templates/design/app/components/design/multi-screen/frame-geometry.ts +12 -3
- package/corpus/templates/design/app/components/design/multi-screen/screen-content-cache.ts +4 -0
- package/corpus/templates/design/app/components/design/multi-screen/types.ts +7 -0
- package/corpus/templates/design/app/components/editor/PromptDialog.tsx +3 -2
- package/corpus/templates/design/app/components/layout/Sidebar.tsx +2 -2
- package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +3 -0
- package/corpus/templates/design/app/i18n-data.ts +1 -0
- package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +5 -5
- package/corpus/templates/design/app/pages/DesignSystems.tsx +3 -2
- package/corpus/templates/design/app/pages/design-editor/canvas-primitive-insert.ts +100 -13
- package/corpus/templates/design/app/pages/design-editor/cross-screen-text-color.ts +1 -1
- package/corpus/templates/design/app/pages/design-editor/data-operations.ts +14 -0
- package/corpus/templates/design/changelog/2026-08-10-marquee-selecting-layers-far-down-a-tall-screen-now-selects-.md +6 -0
- package/corpus/templates/design/changelog/2026-08-10-the-frame-tool-draws-a-plain-frame-by-default-with-screen-av.md +6 -0
- package/corpus/templates/design/e2e/global-setup.ts +27 -32
- package/corpus/templates/design/playwright.config.ts +3 -5
- package/corpus/templates/design/shared/breakpoint-media.ts +9 -2
- package/corpus/templates/dispatch/.agents/skills/actions/SKILL.md +54 -488
- package/corpus/templates/dispatch/.agents/skills/actions/references/action-fields.md +136 -0
- package/corpus/templates/dispatch/.agents/skills/actions/references/examples.md +94 -0
- package/corpus/templates/dispatch/.agents/skills/actions/references/provider-apis.md +95 -0
- package/corpus/templates/dispatch/.agents/skills/create-skill/SKILL.md +9 -35
- package/corpus/templates/dispatch/.agents/skills/frontend-design/SKILL.md +4 -5
- package/corpus/templates/dispatch/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/dispatch/AGENTS.md +9 -16
- package/corpus/templates/dispatch/changelog/2026-08-10-full-page-chat-now-uses-the-available-width-up-to-1000px-for.md +6 -0
- package/corpus/templates/factory/.agents/skills/actions/SKILL.md +54 -488
- package/corpus/templates/factory/.agents/skills/actions/references/action-fields.md +136 -0
- package/corpus/templates/factory/.agents/skills/actions/references/examples.md +94 -0
- package/corpus/templates/factory/.agents/skills/actions/references/provider-apis.md +95 -0
- package/corpus/templates/factory/.agents/skills/create-skill/SKILL.md +9 -35
- package/corpus/templates/factory/.agents/skills/frontend-design/SKILL.md +4 -5
- package/corpus/templates/factory/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/factory/AGENTS.md +10 -24
- package/corpus/templates/factory/changelog/2026-08-10-full-page-chat-now-uses-the-available-width-up-to-1000px-for.md +6 -0
- package/corpus/templates/forms/.agents/skills/actions/SKILL.md +54 -488
- package/corpus/templates/forms/.agents/skills/actions/references/action-fields.md +136 -0
- package/corpus/templates/forms/.agents/skills/actions/references/examples.md +94 -0
- package/corpus/templates/forms/.agents/skills/actions/references/provider-apis.md +95 -0
- package/corpus/templates/forms/.agents/skills/create-skill/SKILL.md +9 -35
- package/corpus/templates/forms/.agents/skills/frontend-design/SKILL.md +4 -5
- package/corpus/templates/forms/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/forms/AGENTS.md +11 -17
- package/corpus/templates/forms/app/global.css +1 -0
- package/corpus/templates/forms/changelog/2026-08-10-full-page-chat-now-uses-the-available-width-up-to-1000px-for.md +6 -0
- package/corpus/templates/forms/changelog/2026-08-11-full-page-chat-composers-stay-at-a-focused-750px-width.md +6 -0
- package/corpus/templates/macros/.agents/skills/frontend-design/SKILL.md +4 -5
- package/corpus/templates/macros/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/macros/AGENTS.md +8 -8
- package/corpus/templates/mail/.agents/skills/actions/SKILL.md +54 -488
- package/corpus/templates/mail/.agents/skills/actions/references/action-fields.md +136 -0
- package/corpus/templates/mail/.agents/skills/actions/references/examples.md +94 -0
- package/corpus/templates/mail/.agents/skills/actions/references/provider-apis.md +95 -0
- package/corpus/templates/mail/.agents/skills/create-skill/SKILL.md +9 -35
- package/corpus/templates/mail/.agents/skills/frontend-design/SKILL.md +4 -5
- package/corpus/templates/mail/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/mail/AGENTS.md +5 -6
- package/corpus/templates/plan/.agents/skills/actions/SKILL.md +54 -488
- package/corpus/templates/plan/.agents/skills/actions/references/action-fields.md +136 -0
- package/corpus/templates/plan/.agents/skills/actions/references/examples.md +94 -0
- package/corpus/templates/plan/.agents/skills/actions/references/provider-apis.md +95 -0
- package/corpus/templates/plan/.agents/skills/create-skill/SKILL.md +9 -35
- package/corpus/templates/plan/.agents/skills/frontend-design/SKILL.md +4 -5
- package/corpus/templates/plan/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/plan/AGENTS.md +5 -14
- package/corpus/templates/plan/app/global.css +1 -0
- package/corpus/templates/plan/changelog/2026-08-10-full-page-chat-now-uses-the-available-width-up-to-1000px-for.md +6 -0
- package/corpus/templates/plan/changelog/2026-08-11-plan-no-longer-reloads-when-runtime-state-changes.md +6 -0
- package/corpus/templates/plan/server/ui-plan-html.ts +4 -1
- package/corpus/templates/plan/vite.config.ts +5 -0
- package/corpus/templates/slides/.agents/skills/actions/SKILL.md +54 -488
- package/corpus/templates/slides/.agents/skills/actions/references/action-fields.md +136 -0
- package/corpus/templates/slides/.agents/skills/actions/references/examples.md +94 -0
- package/corpus/templates/slides/.agents/skills/actions/references/provider-apis.md +95 -0
- package/corpus/templates/slides/.agents/skills/create-deck/SKILL.md +2 -2
- package/corpus/templates/slides/.agents/skills/create-skill/SKILL.md +9 -35
- package/corpus/templates/slides/.agents/skills/creative-context/SKILL.md +6 -3
- package/corpus/templates/slides/.agents/skills/deck-management/SKILL.md +6 -1
- package/corpus/templates/slides/.agents/skills/frontend-design/SKILL.md +4 -5
- package/corpus/templates/slides/.agents/skills/image-generation-via-a2a/SKILL.md +3 -2
- package/corpus/templates/slides/.agents/skills/slide-editing/SKILL.md +3 -0
- package/corpus/templates/slides/.agents/skills/slide-images/SKILL.md +3 -3
- package/corpus/templates/slides/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/slides/AGENTS.md +33 -35
- package/corpus/templates/slides/actions/add-deck.ts +2 -0
- package/corpus/templates/slides/actions/add-slide.ts +15 -1
- package/corpus/templates/slides/actions/create-deck.ts +18 -6
- package/corpus/templates/slides/actions/get-deck-reference-context.ts +2 -2
- package/corpus/templates/slides/actions/get-deck.ts +83 -7
- package/corpus/templates/slides/actions/import-file.ts +2 -1
- package/corpus/templates/slides/actions/patch-deck.ts +165 -9
- package/corpus/templates/slides/actions/save-deck.ts +24 -1
- package/corpus/templates/slides/actions/update-slide.ts +1 -1
- package/corpus/templates/slides/app/components/comments/SlideCommentsPanel.tsx +2 -2
- package/corpus/templates/slides/app/components/deck/DeckCard.tsx +1 -23
- package/corpus/templates/slides/app/components/design-system/DesignSystemCard.tsx +2 -2
- package/corpus/templates/slides/app/components/design-system/DesignSystemSetup.tsx +6 -6
- package/corpus/templates/slides/app/components/editor/AnimationsPanel.tsx +3 -3
- package/corpus/templates/slides/app/components/editor/DeckEditorSkeleton.tsx +4 -4
- package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +1 -1
- package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +432 -668
- package/corpus/templates/slides/app/components/editor/ExportMenu.tsx +296 -259
- package/corpus/templates/slides/app/components/editor/GeneratingSlidePreview.tsx +1 -1
- package/corpus/templates/slides/app/components/editor/GoogleDriveConnectionCta.tsx +13 -1
- package/corpus/templates/slides/app/components/editor/NewDeckReferenceStep.tsx +56 -174
- package/corpus/templates/slides/app/components/editor/PromptDialog.tsx +241 -116
- package/corpus/templates/slides/app/components/editor/SlideContextToolbar.tsx +1 -1
- package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +42 -14
- package/corpus/templates/slides/app/components/editor/SpeakerNotesPanel.tsx +6 -12
- package/corpus/templates/slides/app/components/editor/editor-command-model.ts +35 -0
- package/corpus/templates/slides/app/components/layout/AgentWorkIndicator.tsx +1 -1
- package/corpus/templates/slides/app/components/layout/Layout.tsx +34 -35
- package/corpus/templates/slides/app/components/layout/Sidebar.tsx +8 -10
- package/corpus/templates/slides/app/components/layout/layout-route-policy.ts +2 -5
- package/corpus/templates/slides/app/components/onboarding/FirstDeckOnboardingFlow.tsx +45 -40
- package/corpus/templates/slides/app/components/presentation/PresentationView.tsx +63 -16
- package/corpus/templates/slides/app/context/DeckContext.tsx +2 -1
- package/corpus/templates/slides/app/global.css +76 -1
- package/corpus/templates/slides/app/hooks/use-generating-slide-preview.ts +25 -3
- package/corpus/templates/slides/app/i18n/en-US.ts +2 -0
- package/corpus/templates/slides/app/lib/create-deck-generation.ts +52 -23
- package/corpus/templates/slides/app/lib/recent-references.ts +23 -1
- package/corpus/templates/slides/app/lib/slide-animation-elements.ts +104 -3
- package/corpus/templates/slides/app/pages/DeckEditor.tsx +17 -33
- package/corpus/templates/slides/app/pages/DesignSystems.tsx +2 -2
- package/corpus/templates/slides/app/pages/Index.tsx +315 -151
- package/corpus/templates/slides/app/root.tsx +43 -0
- package/corpus/templates/slides/changelog/2026-08-10-ai-editing-avatar-badge.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-10-generated-decks-keep-a-clear-human-readable-title.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-10-new-deck-creation-now-shows-progress-opens-the-editor-direct.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-10-presentation-reveals-now-follow-valid-targets.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-10-slides-editing-controls-are-consolidated-into-one-focused-me.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-10-slides-now-verify-and-restyle-every-imported-slide-in-one-pa.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-10-slides-only-suggests-a-google-connection-for-relevant-reques.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-10-the-google-slides-import-option-is-now-labeled-slides.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-11-faster-slides-chat-deck-reads.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-11-slides-chat-can-read-one-slide-without-loading-the-full-deck.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-11-slides-clearly-indicate-when-an-ai-agent-is-editing-alongsid.md +6 -0
- package/corpus/templates/slides/package.json +1 -0
- package/corpus/templates/slides/server/lib/chat-attachments.ts +1 -1
- package/corpus/templates/slides/server/lib/validate-slide-animations.ts +163 -0
- package/corpus/templates/slides/server/plugins/agent-chat.ts +8 -5
- package/corpus/templates/slides/shared/api.ts +47 -15
- package/corpus/templates/slides/shared/deck-title.ts +135 -0
- package/corpus/templates/tasks/.agents/skills/actions/SKILL.md +54 -488
- package/corpus/templates/tasks/.agents/skills/actions/references/action-fields.md +136 -0
- package/corpus/templates/tasks/.agents/skills/actions/references/examples.md +94 -0
- package/corpus/templates/tasks/.agents/skills/actions/references/provider-apis.md +95 -0
- package/corpus/templates/tasks/.agents/skills/agent-watchdog/SKILL.md +1 -0
- package/corpus/templates/tasks/.agents/skills/create-skill/SKILL.md +9 -35
- package/corpus/templates/tasks/.agents/skills/efficient-fable/SKILL.md +1 -0
- package/corpus/templates/tasks/.agents/skills/efficient-frontier/SKILL.md +1 -0
- package/corpus/templates/tasks/.agents/skills/frontend-design/SKILL.md +4 -5
- package/corpus/templates/tasks/.agents/skills/plan-arbiter/SKILL.md +1 -0
- package/corpus/templates/tasks/.agents/skills/plow-ahead/SKILL.md +1 -0
- package/corpus/templates/tasks/.agents/skills/quick-recap/SKILL.md +1 -0
- package/corpus/templates/tasks/.agents/skills/read-the-damn-docs/SKILL.md +1 -0
- package/corpus/templates/tasks/.agents/skills/stay-within-limits/SKILL.md +1 -0
- package/corpus/templates/tasks/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/tasks/AGENTS.md +5 -20
- package/corpus/templates/tasks/app/components/tasks/TaskListRow.tsx +4 -1
- package/dist/agent/engine/ai-sdk-engine.js +1 -1
- package/dist/agent/production-agent.d.ts +21 -1
- package/dist/agent/production-agent.js +505 -355
- package/dist/agent/run-manager.js +156 -14
- package/dist/agent/run-store.d.ts +11 -10
- package/dist/agent/run-store.js +17 -13
- package/dist/agent/tool-approval-store.d.ts +18 -0
- package/dist/agent/tool-approval-store.js +122 -0
- package/dist/agent/types.d.ts +1 -1
- package/dist/cli/code-agent-executor.js +11 -2
- package/dist/client/AgentPanel.js +31 -6
- package/dist/client/AssistantChat.d.ts +9 -4
- package/dist/client/AssistantChat.js +221 -149
- package/dist/client/active-run-state.d.ts +9 -1
- package/dist/client/active-run-state.js +34 -3
- package/dist/client/agent-chat/index.d.ts +1 -1
- package/dist/client/agent-chat-adapter.d.ts +8 -0
- package/dist/client/agent-chat-adapter.js +125 -28
- package/dist/client/agent-chat.d.ts +1 -1
- package/dist/client/chat/markdown-renderer.js +14 -2
- package/dist/client/chat/message-components.d.ts +13 -3
- package/dist/client/chat/message-components.js +57 -52
- package/dist/client/chat/run-recovery.d.ts +1 -0
- package/dist/client/chat/run-recovery.js +8 -0
- package/dist/client/chat/tool-call-display.d.ts +5 -5
- package/dist/client/chat/tool-call-display.js +9 -212
- package/dist/client/chat-first/apps-rail.js +3 -3
- package/dist/client/chat-first/browser-pane.js +4 -1
- package/dist/client/chat-first/chat-history.d.ts +3 -1
- package/dist/client/chat-first/chat-history.js +7 -4
- package/dist/client/chat-first/surface-tabs.d.ts +1 -1
- package/dist/client/chat-first/surface-tabs.js +52 -41
- package/dist/client/chat-first/types.d.ts +3 -0
- package/dist/client/chat-first.d.ts +10 -0
- package/dist/client/chat-first.js +37 -2
- package/dist/client/components/ui/message-scroller.js +4 -1
- package/dist/client/i18n.js +3 -1
- package/dist/client/resources/McpConnectionSuggestion.js +9 -1
- package/dist/client/sse-event-processor.d.ts +4 -2
- package/dist/client/sse-event-processor.js +46 -6
- package/dist/client/use-chat-models.js +156 -80
- package/dist/client/use-run-stuck-detection.d.ts +2 -0
- package/dist/client/use-run-stuck-detection.js +85 -9
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/routes.d.ts +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/integrations/adapters/slack.d.ts +0 -4
- package/dist/integrations/adapters/slack.js +6 -30
- package/dist/integrations/catalog.js +1 -1
- package/dist/integrations/pending-tasks-store.d.ts +0 -8
- package/dist/integrations/pending-tasks-store.js +0 -21
- package/dist/integrations/slack-manifest.d.ts +2 -2
- package/dist/integrations/slack-manifest.js +0 -3
- package/dist/integrations/webhook-handler.js +1 -1
- package/dist/mcp/screen-memory-stdio.d.ts +7 -7
- package/dist/observability/routes.d.ts +3 -3
- package/dist/provider-api/actions/custom-provider-registration.d.ts +4 -4
- package/dist/provider-api/actions/provider-api.d.ts +8 -8
- package/dist/scripts/docs/source-search.js +2 -2
- package/dist/server/agent-chat/framework-prompts.js +7 -2
- package/dist/server/agent-chat/prompt-resources.js +2 -2
- package/dist/server/agent-chat/skill-frontmatter.d.ts +31 -2
- package/dist/server/agent-chat/skill-frontmatter.js +41 -15
- package/dist/server/agent-chat-plugin.js +3 -3
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/agents-bundle.d.ts +16 -19
- package/dist/server/agents-bundle.js +19 -35
- package/dist/server/auth.js +262 -31
- package/dist/server/better-auth-instance.d.ts +1 -0
- package/dist/server/better-auth-instance.js +17 -2
- package/dist/server/onboarding-html.js +56 -9
- package/dist/server/prompts/framework-core-compact.d.ts +6 -1
- package/dist/server/prompts/framework-core-compact.js +12 -9
- package/dist/server/prompts/framework-core.d.ts +6 -1
- package/dist/server/prompts/framework-core.js +11 -9
- package/dist/server/prompts/index.d.ts +1 -1
- package/dist/server/prompts/index.js +1 -1
- package/dist/server/prompts/shared-rules.d.ts +15 -11
- package/dist/server/prompts/shared-rules.js +17 -13
- package/dist/server/realtime-token.d.ts +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/shared/reasoning-effort.d.ts +8 -8
- package/dist/shared/reasoning-effort.js +10 -10
- package/dist/shared/streaming-text-smoothing.js +41 -11
- package/dist/styles/agent-native.css +19 -32
- package/dist/templates/chat/.agents/skills/actions/SKILL.md +54 -488
- package/dist/templates/chat/.agents/skills/actions/references/action-fields.md +136 -0
- package/dist/templates/chat/.agents/skills/actions/references/examples.md +94 -0
- package/dist/templates/chat/.agents/skills/actions/references/provider-apis.md +95 -0
- package/dist/templates/chat/.agents/skills/create-skill/SKILL.md +9 -35
- package/dist/templates/chat/.agents/skills/frontend-design/SKILL.md +4 -5
- package/dist/templates/chat/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/dist/templates/chat/AGENTS.md +32 -80
- package/dist/templates/chat/changelog/2026-08-10-full-page-chat-now-uses-the-available-width-up-to-1000px-for.md +6 -0
- package/dist/templates/default/.agents/skills/actions/SKILL.md +54 -488
- package/dist/templates/default/.agents/skills/actions/references/action-fields.md +136 -0
- package/dist/templates/default/.agents/skills/actions/references/examples.md +94 -0
- package/dist/templates/default/.agents/skills/actions/references/provider-apis.md +95 -0
- package/dist/templates/default/.agents/skills/create-skill/SKILL.md +9 -35
- package/dist/templates/default/.agents/skills/frontend-design/SKILL.md +4 -5
- package/dist/templates/default/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/dist/templates/headless/.agents/skills/actions/SKILL.md +54 -488
- package/dist/templates/headless/.agents/skills/actions/references/action-fields.md +136 -0
- package/dist/templates/headless/.agents/skills/actions/references/examples.md +94 -0
- package/dist/templates/headless/.agents/skills/actions/references/provider-apis.md +95 -0
- package/dist/templates/headless/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +54 -488
- package/dist/templates/workspace-core/.agents/skills/actions/references/action-fields.md +136 -0
- package/dist/templates/workspace-core/.agents/skills/actions/references/examples.md +94 -0
- package/dist/templates/workspace-core/.agents/skills/actions/references/provider-apis.md +95 -0
- package/dist/templates/workspace-core/.agents/skills/adding-workspace-apps/SKILL.md +1 -0
- package/dist/templates/workspace-core/.agents/skills/agent-page/SKILL.md +1 -0
- package/dist/templates/workspace-core/.agents/skills/create-skill/SKILL.md +9 -35
- package/dist/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +4 -5
- package/dist/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +21 -29
- package/dist/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/dist/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +7 -17
- package/dist/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +3 -3
- package/dist/templates/workspace-core/AGENTS.md +7 -16
- package/docs/content/messaging.mdx +6 -7
- package/docs/content/template-chat.mdx +1 -1
- package/package.json +2 -2
- package/src/templates/chat/.agents/skills/actions/SKILL.md +54 -488
- package/src/templates/chat/.agents/skills/actions/references/action-fields.md +136 -0
- package/src/templates/chat/.agents/skills/actions/references/examples.md +94 -0
- package/src/templates/chat/.agents/skills/actions/references/provider-apis.md +95 -0
- package/src/templates/chat/.agents/skills/create-skill/SKILL.md +9 -35
- package/src/templates/chat/.agents/skills/frontend-design/SKILL.md +4 -5
- package/src/templates/chat/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/src/templates/chat/AGENTS.md +32 -80
- package/src/templates/chat/changelog/2026-08-10-full-page-chat-now-uses-the-available-width-up-to-1000px-for.md +6 -0
- package/src/templates/default/.agents/skills/actions/SKILL.md +54 -488
- package/src/templates/default/.agents/skills/actions/references/action-fields.md +136 -0
- package/src/templates/default/.agents/skills/actions/references/examples.md +94 -0
- package/src/templates/default/.agents/skills/actions/references/provider-apis.md +95 -0
- package/src/templates/default/.agents/skills/create-skill/SKILL.md +9 -35
- package/src/templates/default/.agents/skills/frontend-design/SKILL.md +4 -5
- package/src/templates/default/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/src/templates/headless/.agents/skills/actions/SKILL.md +54 -488
- package/src/templates/headless/.agents/skills/actions/references/action-fields.md +136 -0
- package/src/templates/headless/.agents/skills/actions/references/examples.md +94 -0
- package/src/templates/headless/.agents/skills/actions/references/provider-apis.md +95 -0
- package/src/templates/headless/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +54 -488
- package/src/templates/workspace-core/.agents/skills/actions/references/action-fields.md +136 -0
- package/src/templates/workspace-core/.agents/skills/actions/references/examples.md +94 -0
- package/src/templates/workspace-core/.agents/skills/actions/references/provider-apis.md +95 -0
- package/src/templates/workspace-core/.agents/skills/adding-workspace-apps/SKILL.md +1 -0
- package/src/templates/workspace-core/.agents/skills/agent-page/SKILL.md +1 -0
- package/src/templates/workspace-core/.agents/skills/create-skill/SKILL.md +9 -35
- package/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +4 -5
- package/src/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +21 -29
- package/src/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/src/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +7 -17
- package/src/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +3 -3
- package/src/templates/workspace-core/AGENTS.md +7 -16
|
@@ -1022,13 +1022,17 @@ export function App() {
|
|
|
1022
1022
|
const [videoStorageStatus, setVideoStorageStatus] =
|
|
1023
1023
|
useState<VideoStorageStatus>("checking");
|
|
1024
1024
|
const [signedInAs, setSignedInAs] = useState<string | null>(null);
|
|
1025
|
-
const [signInPending, setSignInPending] = useState
|
|
1025
|
+
const [signInPending, setSignInPending] = useState<
|
|
1026
|
+
"google" | "magic-link" | null
|
|
1027
|
+
>(null);
|
|
1028
|
+
const [magicLinkEmail, setMagicLinkEmail] = useState<string | null>(null);
|
|
1026
1029
|
const [signInError, setSignInError] = useState<string | null>(null);
|
|
1027
|
-
// Ref-based lock so two fast clicks cannot
|
|
1030
|
+
// Ref-based lock so two fast clicks cannot start competing desktop auth
|
|
1028
1031
|
// (state updates are async; refs are synchronous).
|
|
1029
1032
|
const signInInflightRef = useRef(false);
|
|
1030
1033
|
// Stored so Cancel can stop the polling loop.
|
|
1031
1034
|
const pollIntervalRef = useRef<ReturnType<typeof setInterval> | null>(null);
|
|
1035
|
+
const signInVisibilityRef = useRef<(() => void) | null>(null);
|
|
1032
1036
|
const isRecording = recorder !== null;
|
|
1033
1037
|
// Whether the popover window is shown; driven by the visibility effect below.
|
|
1034
1038
|
const [popoverVisible, setPopoverVisible] = useState(false);
|
|
@@ -2038,37 +2042,129 @@ export function App() {
|
|
|
2038
2042
|
selectedMicLabel,
|
|
2039
2043
|
});
|
|
2040
2044
|
|
|
2041
|
-
|
|
2042
|
-
// share a cookie jar with a separate Tauri WebviewWindow, and the old
|
|
2043
|
-
// approach of opening a WebView at the server root produced a blank window.
|
|
2044
|
-
// Instead: fetch the Google auth URL, open it externally, then poll a
|
|
2045
|
-
// server-side exchange endpoint for the session token.
|
|
2046
|
-
async function signInExternal() {
|
|
2047
|
-
// Synchronous ref guard — prevents a double-click from opening two OAuth
|
|
2048
|
-
// tabs. State updates are async so `signInPending` alone isn't sufficient.
|
|
2049
|
-
if (signInInflightRef.current) return;
|
|
2050
|
-
signInInflightRef.current = true;
|
|
2045
|
+
type DesktopAuthKind = "google" | "magic-link";
|
|
2051
2046
|
|
|
2052
|
-
|
|
2053
|
-
|
|
2047
|
+
function stopDesktopAuthPolling() {
|
|
2048
|
+
if (pollIntervalRef.current !== null) {
|
|
2049
|
+
clearInterval(pollIntervalRef.current);
|
|
2050
|
+
pollIntervalRef.current = null;
|
|
2051
|
+
}
|
|
2052
|
+
if (signInVisibilityRef.current) {
|
|
2053
|
+
document.removeEventListener(
|
|
2054
|
+
"visibilitychange",
|
|
2055
|
+
signInVisibilityRef.current,
|
|
2056
|
+
);
|
|
2057
|
+
signInVisibilityRef.current = null;
|
|
2058
|
+
}
|
|
2059
|
+
}
|
|
2054
2060
|
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2061
|
+
function finishDesktopAuthWithError(kind: DesktopAuthKind, message: string) {
|
|
2062
|
+
stopDesktopAuthPolling();
|
|
2063
|
+
signInInflightRef.current = false;
|
|
2064
|
+
setSignInPending(null);
|
|
2065
|
+
if (kind === "magic-link") setMagicLinkEmail(null);
|
|
2066
|
+
setSignInError(message);
|
|
2067
|
+
}
|
|
2068
|
+
|
|
2069
|
+
function startDesktopAuthExchange(
|
|
2070
|
+
flowId: string,
|
|
2071
|
+
kind: DesktopAuthKind,
|
|
2072
|
+
verifier?: string,
|
|
2073
|
+
) {
|
|
2074
|
+
let tickInFlight = false;
|
|
2075
|
+
const base = serverUrl.replace(/\/+$/, "");
|
|
2076
|
+
const start = Date.now();
|
|
2077
|
+
const TIMEOUT_MS = 5 * 60 * 1000;
|
|
2078
|
+
const POLL_ABORT_MS = Math.max(10_000, 1500 * 4);
|
|
2079
|
+
const timeoutMessage =
|
|
2080
|
+
kind === "magic-link"
|
|
2081
|
+
? "The sign-in link timed out. Please request a new one."
|
|
2082
|
+
: "Google sign-in timed out. Please try again.";
|
|
2083
|
+
const exchangeErrorMessage =
|
|
2084
|
+
kind === "magic-link"
|
|
2085
|
+
? "We couldn't complete sign-in with that link. Please request a new one."
|
|
2086
|
+
: "Google sign-in failed. Please try again.";
|
|
2087
|
+
|
|
2088
|
+
const tick = async () => {
|
|
2089
|
+
if (document.hidden || tickInFlight) return;
|
|
2090
|
+
tickInFlight = true;
|
|
2091
|
+
const controller = new AbortController();
|
|
2092
|
+
const abortTimer = setTimeout(() => controller.abort(), POLL_ABORT_MS);
|
|
2093
|
+
try {
|
|
2094
|
+
const exchangeParams = new URLSearchParams({ flow_id: flowId });
|
|
2095
|
+
if (verifier) exchangeParams.set("verifier", verifier);
|
|
2096
|
+
const xr = await fetch(
|
|
2097
|
+
`${base}/_agent-native/auth/desktop-exchange?${exchangeParams.toString()}`,
|
|
2098
|
+
{ credentials: "include", signal: controller.signal },
|
|
2099
|
+
);
|
|
2100
|
+
if (!xr.ok) {
|
|
2101
|
+
if (Date.now() - start > TIMEOUT_MS) {
|
|
2102
|
+
finishDesktopAuthWithError(kind, timeoutMessage);
|
|
2103
|
+
}
|
|
2104
|
+
return;
|
|
2105
|
+
}
|
|
2106
|
+
const xd = (await xr.json()) as {
|
|
2107
|
+
error?: string;
|
|
2108
|
+
message?: string;
|
|
2109
|
+
token?: string;
|
|
2110
|
+
} | null;
|
|
2111
|
+
if (xd?.error) {
|
|
2112
|
+
finishDesktopAuthWithError(
|
|
2113
|
+
kind,
|
|
2114
|
+
typeof xd.message === "string"
|
|
2115
|
+
? xd.message
|
|
2116
|
+
: typeof xd.error === "string"
|
|
2117
|
+
? xd.error
|
|
2118
|
+
: exchangeErrorMessage,
|
|
2119
|
+
);
|
|
2120
|
+
return;
|
|
2121
|
+
}
|
|
2122
|
+
if (xd?.token) {
|
|
2123
|
+
stopDesktopAuthPolling();
|
|
2124
|
+
saveDesktopAuthToken(base, String(xd.token));
|
|
2125
|
+
// The exchange response sets the WebView cookie. The bearer token
|
|
2126
|
+
// above is the reliable desktop auth path and avoids putting it in a
|
|
2127
|
+
// follow-up URL.
|
|
2128
|
+
signInInflightRef.current = false;
|
|
2129
|
+
setSignInPending(null);
|
|
2130
|
+
setMagicLinkEmail(null);
|
|
2131
|
+
const ok = await checkAuth();
|
|
2132
|
+
if (!ok) {
|
|
2133
|
+
setSignInError(
|
|
2134
|
+
kind === "magic-link"
|
|
2135
|
+
? "Sign-in completed, but Clips could not save the session. Please try again."
|
|
2136
|
+
: "Google sign-in completed, but Clips could not save the session. Please try again.",
|
|
2137
|
+
);
|
|
2138
|
+
}
|
|
2139
|
+
} else if (Date.now() - start > TIMEOUT_MS) {
|
|
2140
|
+
finishDesktopAuthWithError(kind, timeoutMessage);
|
|
2141
|
+
}
|
|
2142
|
+
} catch {
|
|
2143
|
+
if (Date.now() - start > TIMEOUT_MS) {
|
|
2144
|
+
finishDesktopAuthWithError(kind, timeoutMessage);
|
|
2145
|
+
}
|
|
2146
|
+
} finally {
|
|
2147
|
+
clearTimeout(abortTimer);
|
|
2148
|
+
tickInFlight = false;
|
|
2063
2149
|
}
|
|
2064
|
-
}
|
|
2150
|
+
};
|
|
2065
2151
|
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2152
|
+
stopDesktopAuthPolling();
|
|
2153
|
+
pollIntervalRef.current = setInterval(() => void tick(), 1500);
|
|
2154
|
+
const onVisibilityChange = () => {
|
|
2155
|
+
if (!document.hidden) void tick();
|
|
2156
|
+
};
|
|
2157
|
+
signInVisibilityRef.current = onVisibilityChange;
|
|
2158
|
+
document.addEventListener("visibilitychange", onVisibilityChange);
|
|
2159
|
+
void tick();
|
|
2160
|
+
}
|
|
2161
|
+
|
|
2162
|
+
// Google and magic-link verification open in the system browser because
|
|
2163
|
+
// the Tauri WebView has its own cookie jar. Both flows return through the
|
|
2164
|
+
// same short-lived server-side exchange.
|
|
2165
|
+
async function signInExternal() {
|
|
2166
|
+
if (signInInflightRef.current) return;
|
|
2167
|
+
signInInflightRef.current = true;
|
|
2072
2168
|
|
|
2073
2169
|
try {
|
|
2074
2170
|
setSignInError(null);
|
|
@@ -2077,84 +2173,15 @@ export function App() {
|
|
|
2077
2173
|
Math.random().toString(36).slice(2) + Date.now().toString(36);
|
|
2078
2174
|
const base = serverUrl.replace(/\/+$/, "");
|
|
2079
2175
|
|
|
2080
|
-
// Open directly in the system browser — the server redirects (302)
|
|
2081
|
-
// to Google's OAuth page, avoiding any cross-origin fetch from
|
|
2082
|
-
// the Tauri WebView.
|
|
2083
2176
|
await openExternal(
|
|
2084
2177
|
`${base}/_agent-native/google/auth-url?desktop=1&flow_id=${flowId}&redirect=1`,
|
|
2085
2178
|
);
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
// Poll the exchange endpoint for the session token.
|
|
2090
|
-
const start = Date.now();
|
|
2091
|
-
const TIMEOUT_MS = 180_000; // 3 minutes
|
|
2092
|
-
const POLL_ABORT_MS = Math.max(10_000, 1500 * 4);
|
|
2093
|
-
const tick = async () => {
|
|
2094
|
-
if (document.hidden || tickInFlight) return;
|
|
2095
|
-
tickInFlight = true;
|
|
2096
|
-
const controller = new AbortController();
|
|
2097
|
-
const abortTimer = setTimeout(() => controller.abort(), POLL_ABORT_MS);
|
|
2098
|
-
try {
|
|
2099
|
-
const xr = await fetch(
|
|
2100
|
-
`${base}/_agent-native/auth/desktop-exchange?flow_id=${flowId}`,
|
|
2101
|
-
{ credentials: "include", signal: controller.signal },
|
|
2102
|
-
);
|
|
2103
|
-
if (!xr.ok) {
|
|
2104
|
-
if (Date.now() - start > TIMEOUT_MS) {
|
|
2105
|
-
stopPolling();
|
|
2106
|
-
signInInflightRef.current = false;
|
|
2107
|
-
setSignInPending(false);
|
|
2108
|
-
}
|
|
2109
|
-
return;
|
|
2110
|
-
}
|
|
2111
|
-
const xd = await xr.json();
|
|
2112
|
-
if (xd?.error) {
|
|
2113
|
-
finishWithError(
|
|
2114
|
-
typeof xd.error === "string"
|
|
2115
|
-
? xd.error
|
|
2116
|
-
: "Google sign-in failed. Please try again.",
|
|
2117
|
-
);
|
|
2118
|
-
return;
|
|
2119
|
-
}
|
|
2120
|
-
if (xd?.token) {
|
|
2121
|
-
stopPolling();
|
|
2122
|
-
saveDesktopAuthToken(base, String(xd.token));
|
|
2123
|
-
// Establish the session cookie when the WebView accepts it; the
|
|
2124
|
-
// bearer token above is the reliable desktop auth path.
|
|
2125
|
-
await fetch(
|
|
2126
|
-
`${base}/_agent-native/auth/session?_session=${xd.token}`,
|
|
2127
|
-
{ credentials: "include", signal: controller.signal },
|
|
2128
|
-
);
|
|
2129
|
-
signInInflightRef.current = false;
|
|
2130
|
-
setSignInPending(false);
|
|
2131
|
-
const ok = await checkAuth();
|
|
2132
|
-
if (!ok) {
|
|
2133
|
-
setSignInError(
|
|
2134
|
-
"Google sign-in completed, but Clips could not save the session. Please try again.",
|
|
2135
|
-
);
|
|
2136
|
-
}
|
|
2137
|
-
} else if (Date.now() - start > TIMEOUT_MS) {
|
|
2138
|
-
finishWithError("Google sign-in timed out. Please try again.");
|
|
2139
|
-
}
|
|
2140
|
-
} catch {
|
|
2141
|
-
if (Date.now() - start > TIMEOUT_MS) {
|
|
2142
|
-
finishWithError("Google sign-in timed out. Please try again.");
|
|
2143
|
-
}
|
|
2144
|
-
} finally {
|
|
2145
|
-
clearTimeout(abortTimer);
|
|
2146
|
-
tickInFlight = false;
|
|
2147
|
-
}
|
|
2148
|
-
};
|
|
2149
|
-
pollIntervalRef.current = setInterval(() => void tick(), 1500);
|
|
2150
|
-
onVisibilityChange = () => {
|
|
2151
|
-
if (!document.hidden) void tick();
|
|
2152
|
-
};
|
|
2153
|
-
document.addEventListener("visibilitychange", onVisibilityChange);
|
|
2179
|
+
setSignInPending("google");
|
|
2180
|
+
startDesktopAuthExchange(flowId, "google");
|
|
2154
2181
|
} catch (err) {
|
|
2155
2182
|
console.error("[clips-tray] signInExternal failed:", err);
|
|
2156
2183
|
signInInflightRef.current = false;
|
|
2157
|
-
setSignInPending(
|
|
2184
|
+
setSignInPending(null);
|
|
2158
2185
|
setSignInError(
|
|
2159
2186
|
err instanceof Error
|
|
2160
2187
|
? err.message
|
|
@@ -2163,6 +2190,55 @@ export function App() {
|
|
|
2163
2190
|
}
|
|
2164
2191
|
}
|
|
2165
2192
|
|
|
2193
|
+
async function requestMagicLink(email: string) {
|
|
2194
|
+
if (signInInflightRef.current) return;
|
|
2195
|
+
signInInflightRef.current = true;
|
|
2196
|
+
const base = serverUrl.replace(/\/+$/, "");
|
|
2197
|
+
try {
|
|
2198
|
+
setSignInError(null);
|
|
2199
|
+
const res = await fetch(`${base}/_agent-native/auth/magic-link`, {
|
|
2200
|
+
method: "POST",
|
|
2201
|
+
headers: { "Content-Type": "application/json" },
|
|
2202
|
+
body: JSON.stringify({
|
|
2203
|
+
email: email.trim(),
|
|
2204
|
+
callbackURL: "/_agent-native/auth/magic-link/desktop-callback",
|
|
2205
|
+
}),
|
|
2206
|
+
credentials: "include",
|
|
2207
|
+
});
|
|
2208
|
+
const json = (await res.json()) as {
|
|
2209
|
+
error?: string;
|
|
2210
|
+
flowId?: string;
|
|
2211
|
+
verifier?: string;
|
|
2212
|
+
} | null;
|
|
2213
|
+
if (!res.ok) {
|
|
2214
|
+
throw new Error(
|
|
2215
|
+
json?.error || `Could not send sign-in link (${res.status})`,
|
|
2216
|
+
);
|
|
2217
|
+
}
|
|
2218
|
+
if (!json?.flowId || !json.verifier) {
|
|
2219
|
+
throw new Error(
|
|
2220
|
+
"The sign-in flow was not initialized. Please request a new link.",
|
|
2221
|
+
);
|
|
2222
|
+
}
|
|
2223
|
+
setMagicLinkEmail(email.trim());
|
|
2224
|
+
setSignInPending("magic-link");
|
|
2225
|
+
startDesktopAuthExchange(json.flowId, "magic-link", json.verifier);
|
|
2226
|
+
} catch (err) {
|
|
2227
|
+
signInInflightRef.current = false;
|
|
2228
|
+
setSignInPending(null);
|
|
2229
|
+
setMagicLinkEmail(null);
|
|
2230
|
+
throw err;
|
|
2231
|
+
}
|
|
2232
|
+
}
|
|
2233
|
+
|
|
2234
|
+
function cancelSignIn() {
|
|
2235
|
+
stopDesktopAuthPolling();
|
|
2236
|
+
signInInflightRef.current = false;
|
|
2237
|
+
setSignInPending(null);
|
|
2238
|
+
setMagicLinkEmail(null);
|
|
2239
|
+
setSignInError(null);
|
|
2240
|
+
}
|
|
2241
|
+
|
|
2166
2242
|
// Sign out via the framework's logout endpoint. The cookie clears in the
|
|
2167
2243
|
// same webview that will re-check `/auth/session`, so the popover flips
|
|
2168
2244
|
// back to the inline sign-in form without a reload.
|
|
@@ -3863,8 +3939,8 @@ export function App() {
|
|
|
3863
3939
|
// (not a separate Tauri window). This avoids Tauri 2's separate-WebKit-
|
|
3864
3940
|
// data-store-per-WebviewWindow cookie-jar issue — the cookie is set in
|
|
3865
3941
|
// the same webview that reads it on the next /auth/session poll.
|
|
3866
|
-
//
|
|
3867
|
-
//
|
|
3942
|
+
// Google and magic-link verification use the system browser, while the
|
|
3943
|
+
// password fallback stays inline in this WebView.
|
|
3868
3944
|
if (authStatus === "anon") {
|
|
3869
3945
|
return (
|
|
3870
3946
|
<div className="app" ref={appRef}>
|
|
@@ -3875,22 +3951,14 @@ export function App() {
|
|
|
3875
3951
|
/>
|
|
3876
3952
|
<UpdateBanner />
|
|
3877
3953
|
{pendingUploadBanner}
|
|
3878
|
-
{signInPending ? (
|
|
3954
|
+
{signInPending === "google" ? (
|
|
3879
3955
|
<div className="signin-pending">
|
|
3880
3956
|
<div className="signin-pending-spinner" />
|
|
3881
3957
|
<p className="signin-pending-text">Waiting for browser sign-in…</p>
|
|
3882
3958
|
<button
|
|
3883
3959
|
type="button"
|
|
3884
3960
|
className="signin-pending-cancel"
|
|
3885
|
-
onClick={
|
|
3886
|
-
if (pollIntervalRef.current !== null) {
|
|
3887
|
-
clearInterval(pollIntervalRef.current);
|
|
3888
|
-
pollIntervalRef.current = null;
|
|
3889
|
-
}
|
|
3890
|
-
signInInflightRef.current = false;
|
|
3891
|
-
setSignInPending(false);
|
|
3892
|
-
setSignInError(null);
|
|
3893
|
-
}}
|
|
3961
|
+
onClick={cancelSignIn}
|
|
3894
3962
|
>
|
|
3895
3963
|
Cancel
|
|
3896
3964
|
</button>
|
|
@@ -3907,6 +3975,11 @@ export function App() {
|
|
|
3907
3975
|
await checkAuth();
|
|
3908
3976
|
}}
|
|
3909
3977
|
onUseBrowser={signInExternal}
|
|
3978
|
+
onMagicLink={requestMagicLink}
|
|
3979
|
+
magicLinkSentEmail={
|
|
3980
|
+
signInPending === "magic-link" ? magicLinkEmail : null
|
|
3981
|
+
}
|
|
3982
|
+
onMagicLinkBack={cancelSignIn}
|
|
3910
3983
|
/>
|
|
3911
3984
|
</>
|
|
3912
3985
|
)}
|
|
@@ -4779,19 +4852,28 @@ function SignInForm({
|
|
|
4779
4852
|
serverUrl,
|
|
4780
4853
|
onSignedIn,
|
|
4781
4854
|
onUseBrowser,
|
|
4855
|
+
onMagicLink,
|
|
4856
|
+
magicLinkSentEmail,
|
|
4857
|
+
onMagicLinkBack,
|
|
4782
4858
|
}: {
|
|
4783
4859
|
serverUrl: string;
|
|
4784
4860
|
onSignedIn: () => Promise<void> | void;
|
|
4785
|
-
onUseBrowser: () => void
|
|
4861
|
+
onUseBrowser: () => void | Promise<void>;
|
|
4862
|
+
onMagicLink: (email: string) => Promise<void>;
|
|
4863
|
+
magicLinkSentEmail: string | null;
|
|
4864
|
+
onMagicLinkBack: () => void;
|
|
4786
4865
|
}) {
|
|
4787
4866
|
const [email, setEmail] = useState("");
|
|
4788
4867
|
const [password, setPassword] = useState("");
|
|
4868
|
+
const [authMode, setAuthMode] = useState<"magic-link" | "password">(
|
|
4869
|
+
"magic-link",
|
|
4870
|
+
);
|
|
4789
4871
|
const [submitting, setSubmitting] = useState(false);
|
|
4790
4872
|
const [error, setError] = useState<string | null>(null);
|
|
4791
4873
|
const emailRef = useRef<HTMLInputElement | null>(null);
|
|
4792
4874
|
useEffect(() => {
|
|
4793
|
-
emailRef.current?.focus();
|
|
4794
|
-
}, []);
|
|
4875
|
+
if (!magicLinkSentEmail) emailRef.current?.focus();
|
|
4876
|
+
}, [magicLinkSentEmail]);
|
|
4795
4877
|
|
|
4796
4878
|
async function onSubmit(e: React.FormEvent) {
|
|
4797
4879
|
e.preventDefault();
|
|
@@ -4799,6 +4881,10 @@ function SignInForm({
|
|
|
4799
4881
|
setError(null);
|
|
4800
4882
|
setSubmitting(true);
|
|
4801
4883
|
try {
|
|
4884
|
+
if (authMode === "magic-link") {
|
|
4885
|
+
await onMagicLink(email.trim());
|
|
4886
|
+
return;
|
|
4887
|
+
}
|
|
4802
4888
|
// Post to the framework's Better Auth-backed email/password endpoint.
|
|
4803
4889
|
// Production Tauri builds cannot rely on cross-origin cookies sticking,
|
|
4804
4890
|
// so the desktop fetch interceptor stores the returned session token and
|
|
@@ -4828,45 +4914,96 @@ function SignInForm({
|
|
|
4828
4914
|
}
|
|
4829
4915
|
}
|
|
4830
4916
|
|
|
4917
|
+
if (magicLinkSentEmail) {
|
|
4918
|
+
return (
|
|
4919
|
+
<div className="signin signin-success" aria-live="polite">
|
|
4920
|
+
<div className="signin-title">Check your email</div>
|
|
4921
|
+
<p className="signin-success-copy">
|
|
4922
|
+
{"We sent a secure sign-in link to "}
|
|
4923
|
+
<strong>{magicLinkSentEmail}</strong>
|
|
4924
|
+
{"."}
|
|
4925
|
+
</p>
|
|
4926
|
+
<button
|
|
4927
|
+
type="button"
|
|
4928
|
+
className="signin-alt signin-mode-link"
|
|
4929
|
+
onClick={onMagicLinkBack}
|
|
4930
|
+
>
|
|
4931
|
+
Back
|
|
4932
|
+
</button>
|
|
4933
|
+
</div>
|
|
4934
|
+
);
|
|
4935
|
+
}
|
|
4936
|
+
|
|
4831
4937
|
return (
|
|
4832
4938
|
<form className="signin" onSubmit={onSubmit}>
|
|
4833
|
-
<div className="signin-title">
|
|
4939
|
+
<div className="signin-title">Welcome</div>
|
|
4940
|
+
<div className="signin-subtitle">Create an account or sign in</div>
|
|
4941
|
+
<button
|
|
4942
|
+
type="button"
|
|
4943
|
+
className="signin-google"
|
|
4944
|
+
onClick={onUseBrowser}
|
|
4945
|
+
title="Opens your default browser to complete Google sign-in"
|
|
4946
|
+
>
|
|
4947
|
+
<GoogleIcon />
|
|
4948
|
+
Sign in with Google
|
|
4949
|
+
</button>
|
|
4950
|
+
<div className="signin-divider">
|
|
4951
|
+
<span>or</span>
|
|
4952
|
+
</div>
|
|
4834
4953
|
<input
|
|
4835
4954
|
ref={emailRef}
|
|
4836
4955
|
type="email"
|
|
4837
4956
|
autoComplete="email"
|
|
4838
|
-
placeholder="
|
|
4957
|
+
placeholder="you@example.com"
|
|
4839
4958
|
value={email}
|
|
4840
|
-
onChange={(e) =>
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
type="password"
|
|
4845
|
-
autoComplete="current-password"
|
|
4846
|
-
placeholder="Password"
|
|
4847
|
-
value={password}
|
|
4848
|
-
onChange={(e) => setPassword(e.target.value)}
|
|
4959
|
+
onChange={(e) => {
|
|
4960
|
+
setEmail(e.target.value);
|
|
4961
|
+
setError(null);
|
|
4962
|
+
}}
|
|
4849
4963
|
required
|
|
4850
4964
|
/>
|
|
4965
|
+
{authMode === "password" ? (
|
|
4966
|
+
<input
|
|
4967
|
+
type="password"
|
|
4968
|
+
autoComplete="current-password"
|
|
4969
|
+
placeholder="Password"
|
|
4970
|
+
value={password}
|
|
4971
|
+
onChange={(e) => {
|
|
4972
|
+
setPassword(e.target.value);
|
|
4973
|
+
setError(null);
|
|
4974
|
+
}}
|
|
4975
|
+
required
|
|
4976
|
+
/>
|
|
4977
|
+
) : null}
|
|
4851
4978
|
{error ? <div className="error-banner">{error}</div> : null}
|
|
4852
4979
|
<button
|
|
4853
4980
|
type="submit"
|
|
4854
4981
|
className="primary start"
|
|
4855
|
-
disabled={
|
|
4982
|
+
disabled={
|
|
4983
|
+
submitting || !email || (authMode === "password" && !password)
|
|
4984
|
+
}
|
|
4856
4985
|
>
|
|
4857
|
-
{submitting
|
|
4986
|
+
{submitting
|
|
4987
|
+
? authMode === "magic-link"
|
|
4988
|
+
? "Sending…"
|
|
4989
|
+
: "Signing in…"
|
|
4990
|
+
: authMode === "magic-link"
|
|
4991
|
+
? "Continue"
|
|
4992
|
+
: "Sign in"}
|
|
4858
4993
|
</button>
|
|
4859
|
-
<div className="signin-divider">
|
|
4860
|
-
<span>or</span>
|
|
4861
|
-
</div>
|
|
4862
4994
|
<button
|
|
4863
4995
|
type="button"
|
|
4864
|
-
className="signin-
|
|
4865
|
-
onClick={
|
|
4866
|
-
|
|
4996
|
+
className="signin-alt signin-mode-link"
|
|
4997
|
+
onClick={() => {
|
|
4998
|
+
setError(null);
|
|
4999
|
+
setAuthMode((current) =>
|
|
5000
|
+
current === "magic-link" ? "password" : "magic-link",
|
|
5001
|
+
);
|
|
5002
|
+
}}
|
|
4867
5003
|
>
|
|
4868
|
-
|
|
4869
|
-
|
|
5004
|
+
{authMode === "magic-link"
|
|
5005
|
+
? "Use a password instead"
|
|
5006
|
+
: "Use a sign-in link instead"}
|
|
4870
5007
|
</button>
|
|
4871
5008
|
</form>
|
|
4872
5009
|
);
|
|
@@ -4259,6 +4259,7 @@ body[data-clips-route="recording-pill"] #root {
|
|
|
4259
4259
|
object-fit: cover;
|
|
4260
4260
|
border-radius: 50%;
|
|
4261
4261
|
transform: scaleX(-1); /* Mirror — feels more natural for selfie view. */
|
|
4262
|
+
/* compositing-ok: live <video> is composited regardless. */
|
|
4262
4263
|
will-change: transform, opacity;
|
|
4263
4264
|
backface-visibility: hidden;
|
|
4264
4265
|
/* CRITICAL: clicks MUST pass through the canvas to the
|
|
@@ -4441,6 +4442,30 @@ body[data-clips-route="recording-pill"] #root {
|
|
|
4441
4442
|
margin-bottom: 2px;
|
|
4442
4443
|
}
|
|
4443
4444
|
|
|
4445
|
+
.signin-subtitle {
|
|
4446
|
+
color: var(--fg-muted);
|
|
4447
|
+
font-size: 12px;
|
|
4448
|
+
text-align: center;
|
|
4449
|
+
margin-bottom: 2px;
|
|
4450
|
+
}
|
|
4451
|
+
|
|
4452
|
+
.signin-success {
|
|
4453
|
+
align-items: center;
|
|
4454
|
+
text-align: center;
|
|
4455
|
+
}
|
|
4456
|
+
|
|
4457
|
+
.signin-success-copy {
|
|
4458
|
+
color: var(--fg-muted);
|
|
4459
|
+
font-size: 12px;
|
|
4460
|
+
line-height: 1.45;
|
|
4461
|
+
margin: 0;
|
|
4462
|
+
}
|
|
4463
|
+
|
|
4464
|
+
.signin-success-copy strong {
|
|
4465
|
+
color: var(--fg);
|
|
4466
|
+
font-weight: 600;
|
|
4467
|
+
}
|
|
4468
|
+
|
|
4444
4469
|
.signin input {
|
|
4445
4470
|
width: 100%;
|
|
4446
4471
|
padding: 10px 12px;
|
|
@@ -4475,6 +4500,16 @@ body[data-clips-route="recording-pill"] #root {
|
|
|
4475
4500
|
cursor: pointer;
|
|
4476
4501
|
}
|
|
4477
4502
|
|
|
4503
|
+
.signin-mode-link {
|
|
4504
|
+
color: var(--fg-muted);
|
|
4505
|
+
text-decoration: underline;
|
|
4506
|
+
text-underline-offset: 2px;
|
|
4507
|
+
}
|
|
4508
|
+
|
|
4509
|
+
.signin-mode-link:hover {
|
|
4510
|
+
color: var(--fg);
|
|
4511
|
+
}
|
|
4512
|
+
|
|
4478
4513
|
.signin-divider {
|
|
4479
4514
|
display: flex;
|
|
4480
4515
|
align-items: center;
|