@agent-native/core 0.87.0 → 0.90.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/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +88 -2
- package/corpus/core/docs/content/agent-native-toolkit.mdx +103 -0
- package/corpus/core/docs/content/cloneable-saas.mdx +19 -19
- package/corpus/core/docs/content/components.mdx +16 -4
- package/corpus/core/docs/content/data-programs.mdx +329 -0
- package/corpus/core/docs/content/deployment.mdx +9 -9
- package/corpus/core/docs/content/extensions.mdx +8 -7
- package/corpus/core/docs/content/generative-ui.mdx +5 -3
- package/corpus/core/docs/content/key-concepts.mdx +6 -9
- package/corpus/core/docs/content/locales/ar-SA/agent-native-toolkit.mdx +103 -0
- package/corpus/core/docs/content/locales/ar-SA/cloneable-saas.mdx +19 -19
- package/corpus/core/docs/content/locales/ar-SA/components.mdx +12 -2
- package/corpus/core/docs/content/locales/ar-SA/data-programs.mdx +329 -0
- package/corpus/core/docs/content/locales/ar-SA/deployment.mdx +8 -9
- package/corpus/core/docs/content/locales/ar-SA/extensions.mdx +6 -4
- package/corpus/core/docs/content/locales/ar-SA/key-concepts.mdx +7 -9
- package/corpus/core/docs/content/locales/ar-SA/real-time-collaboration.mdx +9 -10
- package/corpus/core/docs/content/locales/ar-SA/sharing.mdx +15 -7
- package/corpus/core/docs/content/locales/de-DE/agent-native-toolkit.mdx +103 -0
- package/corpus/core/docs/content/locales/de-DE/cloneable-saas.mdx +19 -19
- package/corpus/core/docs/content/locales/de-DE/components.mdx +12 -2
- package/corpus/core/docs/content/locales/de-DE/data-programs.mdx +329 -0
- package/corpus/core/docs/content/locales/de-DE/deployment.mdx +8 -9
- package/corpus/core/docs/content/locales/de-DE/extensions.mdx +6 -4
- package/corpus/core/docs/content/locales/de-DE/key-concepts.mdx +8 -10
- package/corpus/core/docs/content/locales/de-DE/real-time-collaboration.mdx +9 -10
- package/corpus/core/docs/content/locales/de-DE/sharing.mdx +15 -7
- package/corpus/core/docs/content/locales/es-ES/agent-native-toolkit.mdx +103 -0
- package/corpus/core/docs/content/locales/es-ES/cloneable-saas.mdx +19 -19
- package/corpus/core/docs/content/locales/es-ES/components.mdx +12 -2
- package/corpus/core/docs/content/locales/es-ES/data-programs.mdx +329 -0
- package/corpus/core/docs/content/locales/es-ES/deployment.mdx +8 -9
- package/corpus/core/docs/content/locales/es-ES/extensions.mdx +6 -4
- package/corpus/core/docs/content/locales/es-ES/key-concepts.mdx +8 -10
- package/corpus/core/docs/content/locales/es-ES/real-time-collaboration.mdx +9 -10
- package/corpus/core/docs/content/locales/es-ES/sharing.mdx +15 -7
- package/corpus/core/docs/content/locales/fr-FR/agent-native-toolkit.mdx +103 -0
- package/corpus/core/docs/content/locales/fr-FR/cloneable-saas.mdx +19 -19
- package/corpus/core/docs/content/locales/fr-FR/components.mdx +12 -2
- package/corpus/core/docs/content/locales/fr-FR/data-programs.mdx +329 -0
- package/corpus/core/docs/content/locales/fr-FR/deployment.mdx +8 -9
- package/corpus/core/docs/content/locales/fr-FR/extensions.mdx +6 -4
- package/corpus/core/docs/content/locales/fr-FR/key-concepts.mdx +8 -10
- package/corpus/core/docs/content/locales/fr-FR/real-time-collaboration.mdx +9 -10
- package/corpus/core/docs/content/locales/fr-FR/sharing.mdx +15 -7
- package/corpus/core/docs/content/locales/hi-IN/agent-native-toolkit.mdx +103 -0
- package/corpus/core/docs/content/locales/hi-IN/cloneable-saas.mdx +19 -19
- package/corpus/core/docs/content/locales/hi-IN/components.mdx +20 -10
- package/corpus/core/docs/content/locales/hi-IN/data-programs.mdx +329 -0
- package/corpus/core/docs/content/locales/hi-IN/deployment.mdx +8 -9
- package/corpus/core/docs/content/locales/hi-IN/extensions.mdx +6 -4
- package/corpus/core/docs/content/locales/hi-IN/key-concepts.mdx +8 -10
- package/corpus/core/docs/content/locales/hi-IN/real-time-collaboration.mdx +9 -10
- package/corpus/core/docs/content/locales/hi-IN/sharing.mdx +15 -7
- package/corpus/core/docs/content/locales/ja-JP/agent-native-toolkit.mdx +103 -0
- package/corpus/core/docs/content/locales/ja-JP/cloneable-saas.mdx +19 -19
- package/corpus/core/docs/content/locales/ja-JP/components.mdx +12 -2
- package/corpus/core/docs/content/locales/ja-JP/data-programs.mdx +329 -0
- package/corpus/core/docs/content/locales/ja-JP/deployment.mdx +8 -9
- package/corpus/core/docs/content/locales/ja-JP/extensions.mdx +6 -4
- package/corpus/core/docs/content/locales/ja-JP/key-concepts.mdx +9 -11
- package/corpus/core/docs/content/locales/ja-JP/real-time-collaboration.mdx +9 -10
- package/corpus/core/docs/content/locales/ja-JP/sharing.mdx +15 -7
- package/corpus/core/docs/content/locales/ko-KR/agent-native-toolkit.mdx +103 -0
- package/corpus/core/docs/content/locales/ko-KR/cloneable-saas.mdx +19 -19
- package/corpus/core/docs/content/locales/ko-KR/components.mdx +20 -10
- package/corpus/core/docs/content/locales/ko-KR/data-programs.mdx +329 -0
- package/corpus/core/docs/content/locales/ko-KR/deployment.mdx +8 -9
- package/corpus/core/docs/content/locales/ko-KR/extensions.mdx +16 -14
- package/corpus/core/docs/content/locales/ko-KR/key-concepts.mdx +9 -11
- package/corpus/core/docs/content/locales/ko-KR/real-time-collaboration.mdx +9 -10
- package/corpus/core/docs/content/locales/ko-KR/sharing.mdx +15 -7
- package/corpus/core/docs/content/locales/pt-BR/agent-native-toolkit.mdx +103 -0
- package/corpus/core/docs/content/locales/pt-BR/cloneable-saas.mdx +19 -19
- package/corpus/core/docs/content/locales/pt-BR/components.mdx +12 -2
- package/corpus/core/docs/content/locales/pt-BR/data-programs.mdx +329 -0
- package/corpus/core/docs/content/locales/pt-BR/deployment.mdx +8 -9
- package/corpus/core/docs/content/locales/pt-BR/extensions.mdx +6 -4
- package/corpus/core/docs/content/locales/pt-BR/key-concepts.mdx +8 -11
- package/corpus/core/docs/content/locales/pt-BR/real-time-collaboration.mdx +9 -10
- package/corpus/core/docs/content/locales/pt-BR/sharing.mdx +15 -7
- package/corpus/core/docs/content/locales/zh-CN/agent-native-toolkit.mdx +103 -0
- package/corpus/core/docs/content/locales/zh-CN/cloneable-saas.mdx +19 -19
- package/corpus/core/docs/content/locales/zh-CN/components.mdx +20 -10
- package/corpus/core/docs/content/locales/zh-CN/data-programs.mdx +329 -0
- package/corpus/core/docs/content/locales/zh-CN/deployment.mdx +7 -9
- package/corpus/core/docs/content/locales/zh-CN/extensions.mdx +16 -14
- package/corpus/core/docs/content/locales/zh-CN/key-concepts.mdx +7 -11
- package/corpus/core/docs/content/locales/zh-CN/real-time-collaboration.mdx +10 -11
- package/corpus/core/docs/content/locales/zh-CN/sharing.mdx +15 -7
- package/corpus/core/docs/content/locales/zh-TW/agent-native-toolkit.mdx +103 -0
- package/corpus/core/docs/content/locales/zh-TW/cloneable-saas.mdx +19 -19
- package/corpus/core/docs/content/locales/zh-TW/components.mdx +20 -10
- package/corpus/core/docs/content/locales/zh-TW/data-programs.mdx +329 -0
- package/corpus/core/docs/content/locales/zh-TW/deployment.mdx +7 -9
- package/corpus/core/docs/content/locales/zh-TW/extensions.mdx +16 -14
- package/corpus/core/docs/content/locales/zh-TW/key-concepts.mdx +7 -11
- package/corpus/core/docs/content/locales/zh-TW/real-time-collaboration.mdx +10 -11
- package/corpus/core/docs/content/locales/zh-TW/sharing.mdx +15 -7
- package/corpus/core/docs/content/real-time-collaboration.mdx +10 -11
- package/corpus/core/docs/content/sharing.mdx +39 -7
- package/corpus/core/docs/content/toolkit-app-adapters.mdx +46 -0
- package/corpus/core/docs/content/toolkit-collaboration-ui.mdx +48 -0
- package/corpus/core/docs/content/toolkit-sharing-ui.mdx +33 -0
- package/corpus/core/docs/content/toolkit-shell-hooks.mdx +27 -0
- package/corpus/core/docs/content/toolkit-ui.mdx +69 -0
- package/corpus/core/package.json +6 -1
- package/corpus/core/src/agent/durable-background.ts +53 -0
- package/corpus/core/src/agent/engine/ai-sdk-engine.ts +7 -1
- package/corpus/core/src/agent/engine/anthropic-engine.ts +29 -1
- package/corpus/core/src/agent/engine/builder-engine.ts +1 -0
- package/corpus/core/src/agent/engine/output-tokens.ts +26 -13
- package/corpus/core/src/agent/engine/registry.ts +45 -26
- package/corpus/core/src/agent/engine/translate-ai-sdk.ts +56 -7
- package/corpus/core/src/agent/engine/translate-anthropic.ts +43 -1
- package/corpus/core/src/agent/engine/types.ts +16 -0
- package/corpus/core/src/agent/model-config.ts +100 -0
- package/corpus/core/src/agent/production-agent.ts +492 -241
- package/corpus/core/src/agent/runtime-context.ts +50 -12
- package/corpus/core/src/agent/tool-result-images.ts +178 -0
- package/corpus/core/src/brand-kit/fig/index.ts +8 -4
- package/corpus/core/src/client/AgentPanel.tsx +88 -31
- package/corpus/core/src/client/AssistantChat.tsx +95 -46
- package/corpus/core/src/client/KeepTabOpenNotice.tsx +176 -0
- package/corpus/core/src/client/MultiTabAssistantChat.tsx +7 -0
- package/corpus/core/src/client/RunStuckBanner.tsx +13 -1
- package/corpus/core/src/client/chat/run-recovery.tsx +7 -1
- package/corpus/core/src/client/clipboard.ts +17 -13
- package/corpus/core/src/client/components/AgentPresenceChip.tsx +4 -69
- package/corpus/core/src/client/components/LiveCursorOverlay.tsx +5 -240
- package/corpus/core/src/client/components/PresenceBar.tsx +4 -346
- package/corpus/core/src/client/components/RecentEditHighlights.tsx +4 -219
- package/corpus/core/src/client/components/RemoteSelectionRings.tsx +5 -220
- package/corpus/core/src/client/composer/TiptapComposer.tsx +94 -38
- package/corpus/core/src/client/db-admin/SqlEditor.tsx +13 -3
- package/corpus/core/src/client/dynamic-suggestions.ts +6 -1
- package/corpus/core/src/client/extensions/ExtensionViewer.tsx +0 -14
- package/corpus/core/src/client/extensions/ExtensionsListPage.tsx +29 -30
- package/corpus/core/src/client/extensions/ExtensionsSidebarSection.tsx +2 -1
- package/corpus/core/src/client/host-bridge.ts +29 -8
- package/corpus/core/src/client/i18n.tsx +7 -1
- package/corpus/core/src/client/index.ts +5 -0
- package/corpus/core/src/client/resources/McpIntegrationDialog.tsx +34 -69
- package/corpus/core/src/client/rich-markdown-editor/SharedRichEditor.tsx +4 -0
- package/corpus/core/src/client/rich-markdown-editor/useCollabReconcile.ts +7 -1
- package/corpus/core/src/client/settings/SettingsPanel.tsx +409 -230
- package/corpus/core/src/client/settings/SettingsTabsPage.tsx +5 -7
- package/corpus/core/src/client/settings/index.ts +5 -1
- package/corpus/core/src/client/sharing/VisibilityBadge.tsx +4 -37
- package/corpus/core/src/client/use-run-stuck-detection.ts +10 -1
- package/corpus/core/src/coding-tools/run-code.ts +473 -74
- package/corpus/core/src/coding-tools/sandbox/background.ts +406 -0
- package/corpus/core/src/coding-tools/sandbox/executions-store.ts +517 -0
- package/corpus/core/src/coding-tools/sandbox/index.ts +53 -13
- package/corpus/core/src/coding-tools/sandbox/local-child-process-adapter.ts +61 -4
- package/corpus/core/src/collab/client.ts +870 -562
- package/corpus/core/src/collab/presence.ts +12 -23
- package/corpus/core/src/collab/recent-edits.ts +13 -32
- package/corpus/core/src/data-programs/actions.ts +335 -0
- package/corpus/core/src/data-programs/contract.ts +284 -0
- package/corpus/core/src/data-programs/execute.ts +693 -0
- package/corpus/core/src/data-programs/index.ts +72 -0
- package/corpus/core/src/data-programs/schema.ts +148 -0
- package/corpus/core/src/data-programs/store.ts +755 -0
- package/corpus/core/src/deploy/build.ts +34 -0
- package/corpus/core/src/extensions/actions.ts +2 -2
- package/corpus/core/src/file-upload/builder.ts +11 -0
- package/corpus/core/src/integrations/webhook-handler.ts +27 -8
- package/corpus/core/src/local-artifacts/index.ts +1 -1
- package/corpus/core/src/localization/default-messages.ts +1 -2
- package/corpus/core/src/mcp-client/index.ts +29 -0
- package/corpus/core/src/onboarding/default-steps.ts +5 -2
- package/corpus/core/src/resources/store.ts +34 -3
- package/corpus/core/src/scripts/agent-engines/list-agent-engines.ts +4 -8
- package/corpus/core/src/scripts/agent-engines/test-agent-engine.ts +9 -2
- package/corpus/core/src/scripts/db/tool-mode.ts +2 -2
- package/corpus/core/src/scripts/resources/migrate-learnings.ts +9 -13
- package/corpus/core/src/server/action-discovery.ts +4 -0
- package/corpus/core/src/server/action-routes.ts +8 -1
- package/corpus/core/src/server/agent-chat-plugin.ts +154 -62
- package/corpus/core/src/server/agent-discovery.ts +67 -7
- package/corpus/core/src/server/auth.ts +90 -3
- package/corpus/core/src/server/builder-design-systems.ts +2 -2
- package/corpus/core/src/server/core-routes-plugin.ts +119 -22
- package/corpus/core/src/server/credential-provider.ts +28 -8
- package/corpus/core/src/server/csrf.ts +3 -0
- package/corpus/core/src/server/index.ts +9 -0
- package/corpus/core/src/server/oauth-helpers.ts +11 -1
- package/corpus/core/src/server/onboarding-html.ts +80 -48
- package/corpus/core/src/server/prompts/shared-rules.ts +2 -2
- package/corpus/core/src/server/transcribe-voice.ts +93 -9
- package/corpus/core/src/shared/agent-readable-resource.ts +111 -0
- package/corpus/core/src/shared/index.ts +9 -0
- package/corpus/core/src/sharing/actions/create-agent-resource-link.ts +91 -0
- package/corpus/core/src/sharing/registry.ts +19 -0
- package/corpus/core/src/styles/agent-native.css +57 -45
- package/corpus/core/src/templates/default/.agents/skills/actions/SKILL.md +55 -0
- package/corpus/core/src/templates/default/AGENTS.md +11 -14
- package/corpus/core/src/templates/default/actions/navigate.ts +1 -1
- package/corpus/core/src/templates/default/app/i18n/ar-SA.ts +0 -1
- package/corpus/core/src/templates/default/app/i18n/de-DE.ts +0 -1
- package/corpus/core/src/templates/default/app/i18n/en-US.ts +0 -1
- package/corpus/core/src/templates/default/app/i18n/es-ES.ts +0 -1
- package/corpus/core/src/templates/default/app/i18n/fr-FR.ts +0 -1
- package/corpus/core/src/templates/default/app/i18n/hi-IN.ts +0 -1
- package/corpus/core/src/templates/default/app/i18n/ja-JP.ts +0 -1
- package/corpus/core/src/templates/default/app/i18n/ko-KR.ts +0 -1
- package/corpus/core/src/templates/default/app/i18n/pt-BR.ts +0 -1
- package/corpus/core/src/templates/default/app/i18n/zh-CN.ts +0 -1
- package/corpus/core/src/templates/default/app/i18n/zh-TW.ts +0 -1
- package/corpus/core/src/templates/default/app/routes/settings.tsx +22 -33
- package/corpus/core/src/templates/headless/.agents/skills/agent-native-docs/SKILL.md +20 -7
- package/corpus/core/src/templates/headless/AGENTS.md +9 -6
- package/corpus/core/src/templates/workspace-core/.agents/skills/actions/SKILL.md +55 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +92 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/data-programs/SKILL.md +128 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/harness-agents/SKILL.md +10 -4
- package/corpus/core/src/vite/agents-bundle-plugin.ts +26 -1
- package/corpus/core/src/vite/client.ts +13 -0
- package/corpus/templates/analytics/.agents/skills/actions/SKILL.md +55 -0
- package/corpus/templates/analytics/.agents/skills/analysis-workspace/SKILL.md +8 -0
- package/corpus/templates/analytics/.agents/skills/data-programs/SKILL.md +348 -0
- package/corpus/templates/analytics/.agents/skills/provider-api/SKILL.md +10 -0
- package/corpus/templates/analytics/AGENTS.md +31 -32
- package/corpus/templates/analytics/actions/dashboard-mutation-api.ts +1 -1
- package/corpus/templates/analytics/actions/delete-data-source-credentials.ts +32 -0
- package/corpus/templates/analytics/actions/ensure-risk-meeting-dashboard.ts +247 -0
- package/corpus/templates/analytics/actions/get-sql-dashboard.ts +9 -113
- package/corpus/templates/analytics/actions/update-data-source-credentials.ts +123 -0
- package/corpus/templates/analytics/app/components/InlineMetric.tsx +2 -2
- package/corpus/templates/analytics/app/components/dashboard/CumulativeNetChart.tsx +2 -7
- package/corpus/templates/analytics/app/components/dashboard/DataTable.tsx +11 -16
- package/corpus/templates/analytics/app/components/dashboard/DateRangePicker.tsx +1 -2
- package/corpus/templates/analytics/app/components/dashboard/MetricCard.tsx +2 -7
- package/corpus/templates/analytics/app/components/dashboard/RecentActivity.tsx +3 -6
- package/corpus/templates/analytics/app/components/dashboard/RevenueChart.tsx +1 -6
- package/corpus/templates/analytics/app/components/dashboard/RevenueComparisonChart.tsx +2 -7
- package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +11 -15
- package/corpus/templates/analytics/app/components/dashboard/StatsCard.tsx +1 -7
- package/corpus/templates/analytics/app/components/dashboard/TimeSeriesChart.tsx +2 -7
- package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +16 -16
- package/corpus/templates/analytics/app/components/layout/Header.tsx +2 -2
- package/corpus/templates/analytics/app/components/layout/HeaderActions.tsx +2 -1
- package/corpus/templates/analytics/app/components/layout/Layout.tsx +2 -2
- package/corpus/templates/analytics/app/components/layout/MobileNav.tsx +33 -17
- package/corpus/templates/analytics/app/components/layout/NewAnalysisDialog.tsx +6 -6
- package/corpus/templates/analytics/app/components/layout/NewDashboardDialog.tsx +4 -3
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +119 -68
- package/corpus/templates/analytics/app/components/ui/alert-dialog.tsx +1 -0
- package/corpus/templates/analytics/app/components/ui/alert.tsx +1 -0
- package/corpus/templates/analytics/app/components/ui/avatar.tsx +1 -0
- package/corpus/templates/analytics/app/components/ui/badge.tsx +1 -0
- package/corpus/templates/analytics/app/components/ui/button.tsx +1 -0
- package/corpus/templates/analytics/app/components/ui/calendar.tsx +1 -1
- package/corpus/templates/analytics/app/components/ui/card.tsx +1 -0
- package/corpus/templates/analytics/app/components/ui/checkbox.tsx +1 -0
- package/corpus/templates/analytics/app/components/ui/collapsible.tsx +1 -0
- package/corpus/templates/analytics/app/components/ui/command.tsx +1 -0
- package/corpus/templates/analytics/app/components/ui/date-picker.tsx +1 -0
- package/corpus/templates/analytics/app/components/ui/dialog.tsx +1 -0
- package/corpus/templates/analytics/app/components/ui/dropdown-menu.tsx +1 -0
- package/corpus/templates/analytics/app/components/ui/input.tsx +1 -0
- package/corpus/templates/analytics/app/components/ui/label.tsx +1 -0
- package/corpus/templates/analytics/app/components/ui/popover.tsx +1 -0
- package/corpus/templates/analytics/app/components/ui/progress.tsx +1 -0
- package/corpus/templates/analytics/app/components/ui/select.tsx +1 -0
- package/corpus/templates/analytics/app/components/ui/sheet.tsx +1 -0
- package/corpus/templates/analytics/app/components/ui/skeleton.tsx +1 -0
- package/corpus/templates/analytics/app/components/ui/sonner.tsx +1 -0
- package/corpus/templates/analytics/app/components/ui/spinner.tsx +1 -0
- package/corpus/templates/analytics/app/components/ui/switch.tsx +1 -0
- package/corpus/templates/analytics/app/components/ui/table.tsx +1 -0
- package/corpus/templates/analytics/app/components/ui/tabs.tsx +1 -0
- package/corpus/templates/analytics/app/components/ui/textarea.tsx +1 -0
- package/corpus/templates/analytics/app/components/ui/toaster.tsx +1 -0
- package/corpus/templates/analytics/app/components/ui/toggle-group.tsx +1 -0
- package/corpus/templates/analytics/app/components/ui/toolkit-provider.tsx +12 -0
- package/corpus/templates/analytics/app/components/ui/tooltip.tsx +1 -0
- package/corpus/templates/analytics/app/global.css +26 -3
- package/corpus/templates/analytics/app/i18n/zh-TW.ts +27 -4
- package/corpus/templates/analytics/app/i18n-data.ts +277 -42
- package/corpus/templates/analytics/app/pages/Agents.tsx +19 -19
- package/corpus/templates/analytics/app/pages/DataDictionary.tsx +21 -21
- package/corpus/templates/analytics/app/pages/DataSources.tsx +31 -54
- package/corpus/templates/analytics/app/pages/NotFound.tsx +2 -1
- package/corpus/templates/analytics/app/pages/Placeholder.tsx +2 -1
- package/corpus/templates/analytics/app/pages/Settings.tsx +19 -37
- package/corpus/templates/analytics/app/pages/adhoc/DashboardSkeleton.tsx +3 -2
- package/corpus/templates/analytics/app/pages/adhoc/_shared/KpiChart.tsx +8 -13
- package/corpus/templates/analytics/app/pages/adhoc/_shared/components/DateRangeInput.tsx +1 -2
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/ChartTypePicker.tsx +2 -4
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/DateRangePicker.tsx +1 -2
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/EventCombobox.tsx +7 -7
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/EventPanel.tsx +2 -1
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/EventRow.tsx +2 -1
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/ExplorerChart.tsx +3 -8
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/FilterBuilder.tsx +5 -4
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/GroupByPicker.tsx +2 -1
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/PropertyCombobox.tsx +7 -7
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/PropertyValueCombobox.tsx +7 -7
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/SqlPreview.tsx +1 -1
- package/corpus/templates/analytics/app/pages/adhoc/explorer/index.tsx +16 -16
- package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/ChartCard.tsx +16 -21
- package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +32 -32
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/DashboardFilterBar.tsx +14 -14
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/EmailReportDialog.tsx +14 -13
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/PanelEditorDialog.tsx +200 -52
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +23 -28
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/ViewSqlPopover.tsx +13 -12
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/ViewsMenu.tsx +15 -15
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +32 -36
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/types.ts +2 -1
- package/corpus/templates/analytics/app/pages/analyses/AnalysesList.tsx +8 -7
- package/corpus/templates/analytics/app/pages/analyses/AnalysisDetail.tsx +19 -19
- package/corpus/templates/analytics/app/pages/analyses/LegacyFusionAnalysis.tsx +11 -15
- package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +14 -14
- package/corpus/templates/analytics/app/pages/sessions/SessionDevToolsPanel.tsx +7 -12
- package/corpus/templates/analytics/app/pages/sessions/SessionsPage.tsx +12 -12
- package/corpus/templates/analytics/app/pages/settings/AlertRulesSettingsCard.tsx +25 -25
- package/corpus/templates/analytics/app/root.tsx +22 -19
- package/corpus/templates/analytics/app/routes/catalog.tsx +8 -8
- package/corpus/templates/analytics/changelog/2026-07-06-dashboard-lists-and-headers-stay-compact.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-06-dashboards-can-now-chart-data-programs-saved-server-side-scr.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-06-extension-pages-and-mobile-headers-now-share-one-background-shade.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-06-mobile-chat-header-is-more-compact-and-the-menu-button-opens-navigation.md +5 -0
- package/corpus/templates/analytics/learnings.defaults.md +36 -0
- package/corpus/templates/analytics/seeds/data-programs/risk-meeting-cohort.js +254 -0
- package/corpus/templates/analytics/seeds/data-programs/risk-meeting-pylon-early-warning.js +184 -0
- package/corpus/templates/analytics/server/db/index.ts +14 -0
- package/corpus/templates/analytics/server/handlers/sql-query.ts +1 -1
- package/corpus/templates/analytics/server/lib/agent-readable-resource-context.ts +156 -0
- package/corpus/templates/analytics/server/lib/dashboard-panel-query.ts +109 -1
- package/corpus/templates/analytics/server/routes/[...page].get.ts +92 -25
- package/corpus/templates/analytics/server/routes/api/analysis-agent-context.json.get.ts +94 -0
- package/corpus/templates/analytics/server/routes/api/dashboard-agent-context.json.get.ts +109 -0
- package/corpus/templates/analytics/shared/resource-agent-access.ts +6 -0
- package/corpus/templates/assets/.agents/skills/actions/SKILL.md +55 -0
- package/corpus/templates/assets/app/components/create/RecentDraftsSection.tsx +3 -2
- package/corpus/templates/assets/app/components/generation/GenerationResults.tsx +16 -10
- package/corpus/templates/assets/app/components/layout/Header.tsx +1 -1
- package/corpus/templates/assets/app/components/layout/PageShell.tsx +4 -4
- package/corpus/templates/assets/app/components/layout/Sidebar.tsx +12 -12
- package/corpus/templates/assets/app/components/library/CreateLibraryDialog.tsx +8 -8
- package/corpus/templates/assets/app/components/library/EditLibraryDialog.tsx +7 -7
- package/corpus/templates/assets/app/components/library/LibraryCard.tsx +8 -8
- package/corpus/templates/assets/app/components/library/LibraryPresetGrid.tsx +3 -2
- package/corpus/templates/assets/app/components/ui/alert-dialog.tsx +1 -0
- package/corpus/templates/assets/app/components/ui/badge.tsx +1 -0
- package/corpus/templates/assets/app/components/ui/button.tsx +1 -0
- package/corpus/templates/assets/app/components/ui/card.tsx +1 -0
- package/corpus/templates/assets/app/components/ui/checkbox.tsx +1 -0
- package/corpus/templates/assets/app/components/ui/dialog.tsx +1 -0
- package/corpus/templates/assets/app/components/ui/dropdown-menu.tsx +1 -0
- package/corpus/templates/assets/app/components/ui/input.tsx +1 -0
- package/corpus/templates/assets/app/components/ui/label.tsx +1 -0
- package/corpus/templates/assets/app/components/ui/popover.tsx +1 -0
- package/corpus/templates/assets/app/components/ui/select.tsx +1 -0
- package/corpus/templates/assets/app/components/ui/separator.tsx +1 -0
- package/corpus/templates/assets/app/components/ui/sheet.tsx +1 -0
- package/corpus/templates/assets/app/components/ui/skeleton.tsx +1 -0
- package/corpus/templates/assets/app/components/ui/sonner.tsx +1 -0
- package/corpus/templates/assets/app/components/ui/spinner.tsx +1 -0
- package/corpus/templates/assets/app/components/ui/tabs.tsx +1 -0
- package/corpus/templates/assets/app/components/ui/toolkit-provider.tsx +12 -0
- package/corpus/templates/assets/app/components/ui/tooltip.tsx +1 -0
- package/corpus/templates/assets/app/global.css +1 -0
- package/corpus/templates/assets/app/root.tsx +12 -9
- package/corpus/templates/assets/app/routes/asset.$id.tsx +19 -19
- package/corpus/templates/assets/app/routes/audit.tsx +15 -14
- package/corpus/templates/assets/app/routes/brand-kits.$id.tsx +49 -54
- package/corpus/templates/assets/app/routes/library.tsx +31 -31
- package/corpus/templates/assets/app/routes/settings.tsx +21 -35
- package/corpus/templates/assets/changelog/2026-07-06-mobile-layouts-no-longer-stack-two-top-headers.md +5 -0
- package/corpus/templates/brain/.agents/skills/actions/SKILL.md +55 -0
- package/corpus/templates/brain/.agents/skills/ask-across-everything/SKILL.md +6 -1
- package/corpus/templates/brain/.agents/skills/brain/SKILL.md +63 -5
- package/corpus/templates/brain/.agents/skills/ingestion-and-connectors/SKILL.md +112 -0
- package/corpus/templates/brain/AGENTS.md +93 -8
- package/corpus/templates/brain/app/components/brain/CanonicalPreviewSheet.tsx +6 -5
- package/corpus/templates/brain/app/components/brain/Surface.tsx +3 -8
- package/corpus/templates/brain/app/components/layout/Layout.tsx +7 -7
- package/corpus/templates/brain/app/components/layout/Sidebar.tsx +6 -6
- package/corpus/templates/brain/app/components/ui/badge.tsx +1 -0
- package/corpus/templates/brain/app/components/ui/button.tsx +1 -0
- package/corpus/templates/brain/app/components/ui/card.tsx +1 -0
- package/corpus/templates/brain/app/components/ui/input.tsx +1 -0
- package/corpus/templates/brain/app/components/ui/label.tsx +1 -0
- package/corpus/templates/brain/app/components/ui/progress.tsx +1 -0
- package/corpus/templates/brain/app/components/ui/select.tsx +1 -0
- package/corpus/templates/brain/app/components/ui/separator.tsx +1 -0
- package/corpus/templates/brain/app/components/ui/sheet.tsx +1 -0
- package/corpus/templates/brain/app/components/ui/skeleton.tsx +1 -0
- package/corpus/templates/brain/app/components/ui/switch.tsx +1 -0
- package/corpus/templates/brain/app/components/ui/table.tsx +1 -0
- package/corpus/templates/brain/app/components/ui/textarea.tsx +1 -0
- package/corpus/templates/brain/app/components/ui/toolkit-provider.tsx +12 -0
- package/corpus/templates/brain/app/components/ui/tooltip.tsx +1 -0
- package/corpus/templates/brain/app/global.css +1 -0
- package/corpus/templates/brain/app/hooks/use-distillation-bridge.ts +9 -4
- package/corpus/templates/brain/app/root.tsx +11 -8
- package/corpus/templates/brain/app/routes/knowledge.tsx +19 -19
- package/corpus/templates/brain/app/routes/ops.tsx +18 -18
- package/corpus/templates/brain/app/routes/review.tsx +22 -27
- package/corpus/templates/brain/app/routes/search.tsx +20 -20
- package/corpus/templates/brain/app/routes/settings.tsx +25 -40
- package/corpus/templates/brain/app/routes/sources.tsx +23 -23
- package/corpus/templates/calendar/.agents/skills/actions/SKILL.md +55 -0
- package/corpus/templates/calendar/actions/find-a-time.ts +29 -16
- package/corpus/templates/calendar/actions/list-bookings.ts +33 -2
- package/corpus/templates/calendar/actions/list-events.ts +34 -8
- package/corpus/templates/calendar/actions/update-calendar-visual-preferences.ts +105 -34
- package/corpus/templates/calendar/app/components/ThemeToggle.tsx +5 -5
- package/corpus/templates/calendar/app/components/TimezoneCombobox.tsx +6 -6
- package/corpus/templates/calendar/app/components/booking/BookingConfirmation.tsx +2 -1
- package/corpus/templates/calendar/app/components/booking/BookingForm.tsx +9 -8
- package/corpus/templates/calendar/app/components/booking/DatePicker.tsx +2 -2
- package/corpus/templates/calendar/app/components/booking/TimeSlotPicker.tsx +3 -2
- package/corpus/templates/calendar/app/components/calendar/AddCalendarDialog.tsx +10 -15
- package/corpus/templates/calendar/app/components/calendar/AttendeeAutocomplete.tsx +6 -6
- package/corpus/templates/calendar/app/components/calendar/CommandPalette.tsx +73 -3
- package/corpus/templates/calendar/app/components/calendar/CreateEventDialog.tsx +27 -27
- package/corpus/templates/calendar/app/components/calendar/DayView.tsx +553 -267
- package/corpus/templates/calendar/app/components/calendar/DeleteEventDialog.tsx +9 -12
- package/corpus/templates/calendar/app/components/calendar/EventAttendeesSection.tsx +10 -13
- package/corpus/templates/calendar/app/components/calendar/EventDetailPanel.tsx +7 -7
- package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +21 -21
- package/corpus/templates/calendar/app/components/calendar/EventDialog.tsx +11 -11
- package/corpus/templates/calendar/app/components/calendar/EventOptionControls.tsx +9 -9
- package/corpus/templates/calendar/app/components/calendar/FindTimePanel.tsx +9 -9
- package/corpus/templates/calendar/app/components/calendar/GoogleConnectBanner.tsx +6 -6
- package/corpus/templates/calendar/app/components/calendar/GoogleSetupWizard.tsx +3 -3
- package/corpus/templates/calendar/app/components/calendar/GoogleSyncButton.tsx +1 -1
- package/corpus/templates/calendar/app/components/calendar/GuestNotificationDialog.tsx +8 -10
- package/corpus/templates/calendar/app/components/calendar/IntegrationsSidebar.tsx +12 -12
- package/corpus/templates/calendar/app/components/calendar/KeyboardShortcutsHelp.tsx +2 -2
- package/corpus/templates/calendar/app/components/calendar/MonthView.tsx +93 -41
- package/corpus/templates/calendar/app/components/calendar/PeopleSearchDialog.tsx +6 -6
- package/corpus/templates/calendar/app/components/calendar/WeekView.tsx +530 -299
- package/corpus/templates/calendar/app/components/layout/AppLayout.tsx +229 -134
- package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +135 -108
- package/corpus/templates/calendar/app/components/ui/alert-dialog.tsx +1 -0
- package/corpus/templates/calendar/app/components/ui/badge.tsx +1 -0
- package/corpus/templates/calendar/app/components/ui/button.tsx +1 -0
- package/corpus/templates/calendar/app/components/ui/card.tsx +1 -0
- package/corpus/templates/calendar/app/components/ui/checkbox.tsx +1 -0
- package/corpus/templates/calendar/app/components/ui/collapsible.tsx +1 -0
- package/corpus/templates/calendar/app/components/ui/command.tsx +1 -0
- package/corpus/templates/calendar/app/components/ui/dialog.tsx +1 -0
- package/corpus/templates/calendar/app/components/ui/dropdown-menu.tsx +1 -0
- package/corpus/templates/calendar/app/components/ui/input.tsx +1 -0
- package/corpus/templates/calendar/app/components/ui/label.tsx +1 -0
- package/corpus/templates/calendar/app/components/ui/popover.tsx +1 -0
- package/corpus/templates/calendar/app/components/ui/radio-group.tsx +1 -0
- package/corpus/templates/calendar/app/components/ui/select.tsx +1 -0
- package/corpus/templates/calendar/app/components/ui/separator.tsx +1 -0
- package/corpus/templates/calendar/app/components/ui/skeleton.tsx +1 -0
- package/corpus/templates/calendar/app/components/ui/spinner.tsx +1 -0
- package/corpus/templates/calendar/app/components/ui/switch.tsx +1 -0
- package/corpus/templates/calendar/app/components/ui/table.tsx +1 -0
- package/corpus/templates/calendar/app/components/ui/tabs.tsx +1 -0
- package/corpus/templates/calendar/app/components/ui/textarea.tsx +1 -0
- package/corpus/templates/calendar/app/components/ui/toolkit-provider.tsx +12 -0
- package/corpus/templates/calendar/app/components/ui/tooltip.tsx +1 -0
- package/corpus/templates/calendar/app/global.css +1 -0
- package/corpus/templates/calendar/app/hooks/use-event-drag.ts +63 -9
- package/corpus/templates/calendar/app/hooks/use-google-auth.ts +15 -27
- package/corpus/templates/calendar/app/hooks/use-grid-create-drag.ts +254 -0
- package/corpus/templates/calendar/app/hooks/use-mobile.ts +1 -0
- package/corpus/templates/calendar/app/hooks/use-view-preferences.ts +287 -21
- package/corpus/templates/calendar/app/hooks/use-zoom-auth.ts +56 -19
- package/corpus/templates/calendar/app/i18n/zh-TW.ts +3 -0
- package/corpus/templates/calendar/app/i18n-data.ts +31 -0
- package/corpus/templates/calendar/app/lib/event-colors.ts +29 -8
- package/corpus/templates/calendar/app/pages/AvailabilitySettings.tsx +11 -11
- package/corpus/templates/calendar/app/pages/BookingLinksPage.tsx +45 -50
- package/corpus/templates/calendar/app/pages/BookingPage.tsx +2 -2
- package/corpus/templates/calendar/app/pages/BookingsList.tsx +12 -12
- package/corpus/templates/calendar/app/pages/CalendarView.tsx +438 -271
- package/corpus/templates/calendar/app/pages/ManageBookingPage.tsx +13 -13
- package/corpus/templates/calendar/app/pages/Settings.tsx +15 -29
- package/corpus/templates/calendar/app/root.tsx +19 -15
- package/corpus/templates/calendar/app/routes/event.tsx +2 -2
- package/corpus/templates/calendar/changelog/2026-07-06-calendar-now-loads-view-preferences-much-more-efficiently.md +6 -0
- package/corpus/templates/calendar/changelog/2026-07-06-connected-calendars-keep-their-own-color-when-you-customize-.md +6 -0
- package/corpus/templates/calendar/changelog/2026-07-06-create-events-from-the-command-menu-with-natural-phrases-lik.md +6 -0
- package/corpus/templates/calendar/changelog/2026-07-06-drag-across-empty-week-or-day-slots-to-create-an-event-with-.md +6 -0
- package/corpus/templates/calendar/changelog/2026-07-06-dragging-and-resizing-events-is-much-smoother-especially-on-.md +6 -0
- package/corpus/templates/calendar/changelog/2026-07-06-each-connected-google-account-can-now-have-its-own-calendar-.md +6 -0
- package/corpus/templates/calendar/changelog/2026-07-06-events-spanning-multiple-days-now-show-on-every-day-they-cov.md +6 -0
- package/corpus/templates/calendar/changelog/2026-07-06-google-calendar-now-finishes-connecting-correctly-after-sign.md +6 -0
- package/corpus/templates/calendar/changelog/2026-07-06-public-booking-pages-respond-faster.md +6 -0
- package/corpus/templates/calendar/changelog/2026-07-06-the-app-header-no-longer-shows-the-global-notifications-bell.md +6 -0
- package/corpus/templates/calendar/package.json +1 -0
- package/corpus/templates/calendar/server/handlers/bookings.ts +46 -52
- package/corpus/templates/calendar/server/handlers/google-auth.ts +21 -5
- package/corpus/templates/calendar/server/lib/google-calendar.ts +32 -3
- package/corpus/templates/calendar/shared/calendar-view-preferences.ts +66 -2
- package/corpus/templates/chat/.agents/skills/actions/SKILL.md +55 -0
- package/corpus/templates/chat/app/components/layout/Layout.tsx +6 -6
- package/corpus/templates/chat/app/components/layout/Sidebar.tsx +12 -12
- package/corpus/templates/chat/app/components/ui/button.tsx +1 -0
- package/corpus/templates/chat/app/components/ui/card.tsx +1 -0
- package/corpus/templates/chat/app/components/ui/dropdown-menu.tsx +1 -0
- package/corpus/templates/chat/app/components/ui/input.tsx +1 -0
- package/corpus/templates/chat/app/components/ui/label.tsx +1 -0
- package/corpus/templates/chat/app/components/ui/sheet.tsx +1 -0
- package/corpus/templates/chat/app/components/ui/toolkit-provider.tsx +12 -0
- package/corpus/templates/chat/app/components/ui/tooltip.tsx +1 -0
- package/corpus/templates/chat/app/global.css +1 -0
- package/corpus/templates/chat/app/root.tsx +7 -4
- package/corpus/templates/chat/app/routes/settings.tsx +6 -21
- package/corpus/templates/clips/.agents/skills/actions/SKILL.md +55 -0
- package/corpus/templates/clips/.agents/skills/video-sharing/SKILL.md +18 -4
- package/corpus/templates/clips/.env.example +8 -0
- package/corpus/templates/clips/actions/accept-invite.ts +3 -0
- package/corpus/templates/clips/actions/add-recording-to-space.ts +55 -27
- package/corpus/templates/clips/actions/add-vocabulary-term.ts +3 -1
- package/corpus/templates/clips/actions/archive-recording.ts +5 -12
- package/corpus/templates/clips/actions/cleanup-transcript.ts +5 -4
- package/corpus/templates/clips/actions/clear-edits.ts +42 -29
- package/corpus/templates/clips/actions/create-meeting.ts +87 -40
- package/corpus/templates/clips/actions/create-recording.ts +6 -3
- package/corpus/templates/clips/actions/delete-meeting.ts +25 -0
- package/corpus/templates/clips/actions/delete-recording-permanent.ts +3 -0
- package/corpus/templates/clips/actions/disconnect-calendar.ts +10 -4
- package/corpus/templates/clips/actions/export-insights-csv.ts +28 -8
- package/corpus/templates/clips/actions/finalize-meeting.ts +106 -33
- package/corpus/templates/clips/actions/finalize-recording.ts +201 -3
- package/corpus/templates/clips/actions/get-organization-insights.ts +51 -7
- package/corpus/templates/clips/actions/import-loom-recording.ts +17 -0
- package/corpus/templates/clips/actions/lib/audio-only-transcription.ts +18 -1
- package/corpus/templates/clips/actions/lib/create-recording-schema.ts +7 -1
- package/corpus/templates/clips/actions/lib/ensure-seekable-video.ts +16 -0
- package/corpus/templates/clips/actions/list-clip-views.ts +60 -0
- package/corpus/templates/clips/actions/regenerate-summary.ts +10 -0
- package/corpus/templates/clips/actions/remove-vocabulary-term.ts +59 -0
- package/corpus/templates/clips/actions/request-transcript.ts +170 -25
- package/corpus/templates/clips/actions/restore-recording.ts +5 -12
- package/corpus/templates/clips/actions/save-browser-transcript.ts +13 -2
- package/corpus/templates/clips/actions/set-chapters.ts +6 -15
- package/corpus/templates/clips/actions/set-thumbnail.ts +77 -36
- package/corpus/templates/clips/actions/split-recording.ts +49 -35
- package/corpus/templates/clips/actions/stitch-recordings.ts +7 -4
- package/corpus/templates/clips/actions/stop-meeting-recording.ts +15 -1
- package/corpus/templates/clips/actions/sync-calendars.ts +10 -108
- package/corpus/templates/clips/actions/trash-recording.ts +43 -14
- package/corpus/templates/clips/actions/trim-recording.ts +48 -27
- package/corpus/templates/clips/actions/undo-edit.ts +49 -37
- package/corpus/templates/clips/app/components/capture-install-options.tsx +6 -6
- package/corpus/templates/clips/app/components/dictate/vocabulary-section.tsx +208 -0
- package/corpus/templates/clips/app/components/editable-recording-title.tsx +2 -2
- package/corpus/templates/clips/app/components/editor/chapters-editor.tsx +7 -7
- package/corpus/templates/clips/app/components/editor/editor-toolbar.tsx +26 -26
- package/corpus/templates/clips/app/components/editor/split-button.tsx +5 -4
- package/corpus/templates/clips/app/components/editor/stitch-manager.tsx +9 -9
- package/corpus/templates/clips/app/components/editor/thumbnail-picker.tsx +11 -16
- package/corpus/templates/clips/app/components/editor/timeline.tsx +3 -3
- package/corpus/templates/clips/app/components/editor/transcript-editor.tsx +5 -5
- package/corpus/templates/clips/app/components/library/bulk-action-toolbar.tsx +4 -4
- package/corpus/templates/clips/app/components/library/create-space-dialog.tsx +8 -8
- package/corpus/templates/clips/app/components/library/empty-state.tsx +2 -1
- package/corpus/templates/clips/app/components/library/folder-tree.tsx +14 -14
- package/corpus/templates/clips/app/components/library/library-grid.tsx +24 -98
- package/corpus/templates/clips/app/components/library/library-layout.tsx +18 -19
- package/corpus/templates/clips/app/components/library/organization-switcher.tsx +11 -11
- package/corpus/templates/clips/app/components/library/recording-card.tsx +44 -50
- package/corpus/templates/clips/app/components/library/search-bar.tsx +5 -5
- package/corpus/templates/clips/app/components/library/sort-menu.tsx +4 -3
- package/corpus/templates/clips/app/components/library/tag-input.tsx +4 -4
- package/corpus/templates/clips/app/components/meetings/attendee-stack.tsx +2 -6
- package/corpus/templates/clips/app/components/meetings/auto-record-prompt.tsx +1 -1
- package/corpus/templates/clips/app/components/meetings/bullet-link.tsx +4 -4
- package/corpus/templates/clips/app/components/meetings/canvas-editor.tsx +5 -5
- package/corpus/templates/clips/app/components/meetings/meeting-card.tsx +3 -3
- package/corpus/templates/clips/app/components/meetings/quick-ask-sidebar.tsx +17 -9
- package/corpus/templates/clips/app/components/meetings/share-meeting-dialog.tsx +6 -11
- package/corpus/templates/clips/app/components/meetings/transcript-bubbles.tsx +215 -21
- package/corpus/templates/clips/app/components/player/access-password-prompt.tsx +3 -2
- package/corpus/templates/clips/app/components/player/comments-panel.tsx +14 -14
- package/corpus/templates/clips/app/components/player/delete-recording-menu.tsx +7 -6
- package/corpus/templates/clips/app/components/player/insights-panel.tsx +18 -6
- package/corpus/templates/clips/app/components/player/player-controls.tsx +42 -36
- package/corpus/templates/clips/app/components/player/reactions-tray.tsx +4 -4
- package/corpus/templates/clips/app/components/player/settings-panel.tsx +13 -12
- package/corpus/templates/clips/app/components/player/share-dialog.tsx +80 -49
- package/corpus/templates/clips/app/components/player/sign-in-prompt-dialog.tsx +3 -2
- package/corpus/templates/clips/app/components/player/timestamped-comment-button.tsx +2 -2
- package/corpus/templates/clips/app/components/player/transcript-panel.tsx +7 -7
- package/corpus/templates/clips/app/components/player/video-player.tsx +182 -15
- package/corpus/templates/clips/app/components/recorder/camera-visualizer.tsx +1 -1
- package/corpus/templates/clips/app/components/recorder/microphone-visualizer.tsx +1 -1
- package/corpus/templates/clips/app/components/recorder/pre-record-panel.tsx +49 -36
- package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +285 -24
- package/corpus/templates/clips/app/components/recorder/recording-toolbar.tsx +6 -5
- package/corpus/templates/clips/app/components/recorder/storage-setup-card.tsx +7 -6
- package/corpus/templates/clips/app/components/sharing/share-ui.tsx +10 -10
- package/corpus/templates/clips/app/components/sharing/viewed-by-popover.tsx +132 -0
- package/corpus/templates/clips/app/components/ui/alert-dialog.tsx +1 -0
- package/corpus/templates/clips/app/components/ui/avatar.tsx +1 -0
- package/corpus/templates/clips/app/components/ui/badge.tsx +1 -0
- package/corpus/templates/clips/app/components/ui/button.tsx +1 -0
- package/corpus/templates/clips/app/components/ui/card.tsx +1 -0
- package/corpus/templates/clips/app/components/ui/checkbox.tsx +1 -0
- package/corpus/templates/clips/app/components/ui/collapsible.tsx +1 -0
- package/corpus/templates/clips/app/components/ui/context-menu.tsx +1 -0
- package/corpus/templates/clips/app/components/ui/dialog.tsx +1 -0
- package/corpus/templates/clips/app/components/ui/dropdown-menu.tsx +1 -0
- package/corpus/templates/clips/app/components/ui/input.tsx +1 -0
- package/corpus/templates/clips/app/components/ui/label.tsx +1 -0
- package/corpus/templates/clips/app/components/ui/popover.tsx +1 -0
- package/corpus/templates/clips/app/components/ui/scroll-area.tsx +1 -0
- package/corpus/templates/clips/app/components/ui/select.tsx +1 -0
- package/corpus/templates/clips/app/components/ui/separator.tsx +1 -0
- package/corpus/templates/clips/app/components/ui/sheet.tsx +1 -0
- package/corpus/templates/clips/app/components/ui/skeleton.tsx +1 -0
- package/corpus/templates/clips/app/components/ui/slider.tsx +1 -0
- package/corpus/templates/clips/app/components/ui/sonner.tsx +1 -0
- package/corpus/templates/clips/app/components/ui/spinner.tsx +1 -0
- package/corpus/templates/clips/app/components/ui/switch.tsx +1 -0
- package/corpus/templates/clips/app/components/ui/table.tsx +1 -0
- package/corpus/templates/clips/app/components/ui/tabs.tsx +1 -0
- package/corpus/templates/clips/app/components/ui/textarea.tsx +1 -0
- package/corpus/templates/clips/app/components/ui/toolkit-provider.tsx +12 -0
- package/corpus/templates/clips/app/components/ui/tooltip.tsx +1 -0
- package/corpus/templates/clips/app/components/workspace/branding-editor.tsx +5 -9
- package/corpus/templates/clips/app/components/workspace/insights-hub.tsx +9 -19
- package/corpus/templates/clips/app/components/workspace/invite-dialog.tsx +10 -9
- package/corpus/templates/clips/app/components/workspace/members-list.tsx +11 -10
- package/corpus/templates/clips/app/components/workspace/notifications-list.tsx +2 -1
- package/corpus/templates/clips/app/components/workspace/top-creators-table.tsx +3 -2
- package/corpus/templates/clips/app/components/workspace/top-videos-table.tsx +3 -2
- package/corpus/templates/clips/app/global.css +1 -0
- package/corpus/templates/clips/app/hooks/use-desktop-promo.ts +2 -1
- package/corpus/templates/clips/app/hooks/use-mobile.ts +1 -0
- package/corpus/templates/clips/app/hooks/use-player-shortcuts.ts +14 -10
- package/corpus/templates/clips/app/hooks/use-view-tracking.ts +14 -0
- package/corpus/templates/clips/app/i18n/ar-SA.ts +56 -0
- package/corpus/templates/clips/app/i18n/de-DE.ts +53 -0
- package/corpus/templates/clips/app/i18n/en-US.ts +52 -0
- package/corpus/templates/clips/app/i18n/es-ES.ts +53 -0
- package/corpus/templates/clips/app/i18n/fr-FR.ts +53 -0
- package/corpus/templates/clips/app/i18n/hi-IN.ts +52 -0
- package/corpus/templates/clips/app/i18n/ja-JP.ts +53 -0
- package/corpus/templates/clips/app/i18n/ko-KR.ts +52 -0
- package/corpus/templates/clips/app/i18n/pt-BR.ts +53 -0
- package/corpus/templates/clips/app/i18n/zh-CN.ts +51 -0
- package/corpus/templates/clips/app/i18n/zh-TW.ts +51 -0
- package/corpus/templates/clips/app/lib/recorder-preferences.ts +4 -0
- package/corpus/templates/clips/app/lib/timestamp-mapping.ts +5 -0
- package/corpus/templates/clips/app/root.tsx +26 -23
- package/corpus/templates/clips/app/routes/_app.dictate.tsx +39 -23
- package/corpus/templates/clips/app/routes/_app.meetings.$meetingId.tsx +134 -39
- package/corpus/templates/clips/app/routes/_app.meetings._index.tsx +20 -20
- package/corpus/templates/clips/app/routes/_app.notifications.tsx +3 -3
- package/corpus/templates/clips/app/routes/_app.settings._index.tsx +92 -60
- package/corpus/templates/clips/app/routes/_app.settings.organization.tsx +8 -13
- package/corpus/templates/clips/app/routes/_app.spaces._index.tsx +1 -1
- package/corpus/templates/clips/app/routes/_app.trash.tsx +96 -31
- package/corpus/templates/clips/app/routes/bug-report.done.tsx +1 -1
- package/corpus/templates/clips/app/routes/bug-report.tsx +11 -11
- package/corpus/templates/clips/app/routes/download.tsx +2 -2
- package/corpus/templates/clips/app/routes/embed.$shareId.tsx +2 -1
- package/corpus/templates/clips/app/routes/invite.$token.tsx +8 -13
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +263 -251
- package/corpus/templates/clips/app/routes/record.tsx +28 -10
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +51 -29
- package/corpus/templates/clips/app/routes/share.meeting.$meetingId.tsx +71 -16
- package/corpus/templates/clips/changelog/2026-07-05-mobile-clip-pages-use-a-tighter-viewer-layout-with-inline-ac.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-06-ai-setup-now-switches-to-your-saved-provider-key-and-uses-fa.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-06-browsers-that-can-t-play-a-clip-s-video-format-now-see-a-cle.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-06-calendar-connections-no-longer-ask-you-to-reconnect-after-te.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-06-chrome-extension-recordings-keep-your-selected-microphone.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-06-clip-recordings-now-use-streaming-uploads-by-default.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-06-clip-titles-in-the-library-grid-now-open-the-clip-instead-of.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-06-desktop-countdown-now-dims-the-screen-before-recording.md +5 -0
- package/corpus/templates/clips/changelog/2026-07-06-desktop-popover-no-longer-drops-bluetooth-headphones-into-call-quality-mode.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-06-desktop-recorder-now-refreshes-cameras-and-mics-when-the-pop.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-06-desktop-recordings-keep-microphone-volume-clear-while-recor.md +5 -0
- package/corpus/templates/clips/changelog/2026-07-06-desktop-recordings-no-longer-get-stuck-optimizing-when-scree.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-06-dictation-history-from-the-desktop-app-now-appears-in-the-di.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-06-dictation-no-longer-overwrites-your-clipboard-and-messaging-.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-06-double-tap-your-dictation-key-for-hands-free-dictation-tap-a.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-06-fixed-desktop-recordings-sometimes-uploading-without-audio-a.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-06-fixed-desktop-recordings-that-could-get-stuck-uploading-and-.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-06-fixed-recordings-sometimes-capturing-from-the-wrong-micropho.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-06-hands-free-dictation-and-meeting-cleanup-recover-more-reliab.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-06-live-meetings-show-time-remaining-and-you-can-end-a-meeting-.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-06-manage-your-personal-dictation-dictionary-from-the-dictate-t.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-06-meetings-interrupted-by-quitting-or-crashing-now-close-out-c.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-06-mic-only-desktop-recordings-now-use-the-selected-microphone-.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-06-paste-your-last-dictation-anytime-with-cmd-ctrl-v-or-from-th.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-06-press-esc-to-cancel-a-dictation-in-progress.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-06-recordings-whose-video-file-contains-no-audio-track-no-longe.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-06-search-inside-meeting-transcripts.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-06-see-who-viewed-your-shared-clips-and-when-click-the-view-cou.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-06-share-links-for-agents-now-appear-as-soon-as-the-share-menu-.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-06-share-popovers-now-stay-above-video-playback-controls.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-06-shared-clip-pages-now-recover-automatically-from-transient-v.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-06-the-desktop-app-now-walks-you-through-permissions-on-first-l.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-06-transcript-cleanup-preferences-now-save-per-user.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-06-transcripts-now-retry-automatically-after-transient-failures.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-06-video-compression-now-runs-in-the-background-without-blocking.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-07-native-microphone-recordings-now-reduce-steady-background-noise.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-07-recording-transcripts-now-line-up-with-the-video-start-afte.md +6 -0
- package/corpus/templates/clips/chrome-extension/public/manifest.json +1 -1
- package/corpus/templates/clips/chrome-extension/src/background.ts +141 -48
- package/corpus/templates/clips/chrome-extension/src/offscreen.ts +383 -59
- package/corpus/templates/clips/chrome-extension/src/overlay.ts +51 -10
- package/corpus/templates/clips/chrome-extension/src/popup.ts +57 -6
- package/corpus/templates/clips/desktop/package.json +1 -1
- package/corpus/templates/clips/desktop/scripts/sign-macos-local.ts +67 -0
- package/corpus/templates/clips/desktop/src/app.tsx +38 -13
- package/corpus/templates/clips/desktop/src/components/SourceRow.tsx +1 -0
- package/corpus/templates/clips/desktop/src/hooks/useMediaDevices.ts +88 -28
- package/corpus/templates/clips/desktop/src/hooks/useMeetingTranscription.ts +165 -55
- package/corpus/templates/clips/desktop/src/hooks/useMicMeter.ts +35 -10
- package/corpus/templates/clips/desktop/src/lib/backtrack.ts +12 -0
- package/corpus/templates/clips/desktop/src/lib/media-capture-constraints.ts +129 -34
- package/corpus/templates/clips/desktop/src/lib/media-device-selection.ts +157 -0
- package/corpus/templates/clips/desktop/src/lib/permissions.ts +2 -0
- package/corpus/templates/clips/desktop/src/lib/recorder.ts +109 -47
- package/corpus/templates/clips/desktop/src/lib/transcription-capture.ts +22 -2
- package/corpus/templates/clips/desktop/src/lib/transcription-engine.ts +29 -1
- package/corpus/templates/clips/desktop/src/lib/updater.ts +6 -0
- package/corpus/templates/clips/desktop/src/lib/voice-dictation.ts +372 -31
- package/corpus/templates/clips/desktop/src/overlays/finalizing.tsx +90 -0
- package/corpus/templates/clips/desktop/src/overlays/flow-bar.tsx +4 -6
- package/corpus/templates/clips/desktop/src/overlays/onboarding.tsx +214 -9
- package/corpus/templates/clips/desktop/src/overlays/recording-pill.tsx +37 -52
- package/corpus/templates/clips/desktop/src/styles.css +1 -1
- package/corpus/templates/clips/desktop/src-tauri/Cargo.toml +7 -0
- package/corpus/templates/clips/desktop/src-tauri/src/clips/mod.rs +371 -43
- package/corpus/templates/clips/desktop/src-tauri/src/lib.rs +79 -0
- package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +1418 -260
- package/corpus/templates/clips/desktop/src-tauri/src/native_speech.rs +188 -44
- package/corpus/templates/clips/desktop/src-tauri/src/shortcuts.rs +197 -8
- package/corpus/templates/clips/desktop/src-tauri/src/silence_detector.rs +64 -8
- package/corpus/templates/clips/desktop/src-tauri/src/state.rs +3 -2
- package/corpus/templates/clips/desktop/src-tauri/src/system_audio.rs +10 -0
- package/corpus/templates/clips/desktop/src-tauri/src/tray.rs +29 -8
- package/corpus/templates/clips/desktop/src-tauri/src/whisper_speech.rs +136 -13
- package/corpus/templates/clips/desktop/vite.config.ts +3 -0
- package/corpus/templates/clips/package.json +1 -1
- package/corpus/templates/clips/server/db/schema.ts +26 -0
- package/corpus/templates/clips/server/jobs/builder-media-compression.ts +41 -0
- package/corpus/templates/clips/server/jobs/stale-meeting-sweeper.ts +294 -0
- package/corpus/templates/clips/server/lib/builder-media-compression.ts +976 -0
- package/corpus/templates/clips/server/lib/calendar-event-meetings.ts +107 -56
- package/corpus/templates/clips/server/lib/env-flags.ts +4 -0
- package/corpus/templates/clips/server/lib/google-calendar-client.ts +8 -1
- package/corpus/templates/clips/server/lib/media-worker.ts +153 -0
- package/corpus/templates/clips/server/lib/s3-upload-provider.ts +58 -17
- package/corpus/templates/clips/server/lib/streaming-upload-mode.ts +17 -5
- package/corpus/templates/clips/server/lib/video-remux.ts +90 -0
- package/corpus/templates/clips/server/plugins/calendar-jobs.ts +4 -0
- package/corpus/templates/clips/server/plugins/db.ts +196 -0
- package/corpus/templates/clips/server/register-secrets.ts +78 -0
- package/corpus/templates/clips/server/routes/_agent-native/clips/user-prefs.get.ts +15 -0
- package/corpus/templates/clips/server/routes/_agent-native/clips/user-prefs.put.ts +27 -0
- package/corpus/templates/clips/server/routes/api/media-worker/callback.post.ts +88 -0
- package/corpus/templates/clips/server/routes/api/public-recording.get.ts +87 -7
- package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/abort.post.ts +7 -0
- package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/chunk.post.ts +35 -10
- package/corpus/templates/clips/server/routes/api/video/[recordingId].get.ts +24 -42
- package/corpus/templates/clips/server/routes/api/view-event.post.ts +29 -1
- package/corpus/templates/clips/shared/media-device-selection.ts +157 -0
- package/corpus/templates/clips/shared/media-worker-contract.ts +146 -0
- package/corpus/templates/content/.agents/skills/actions/SKILL.md +55 -0
- package/corpus/templates/content/.agents/skills/notion-integration/SKILL.md +67 -2
- package/corpus/templates/content/AGENTS.md +22 -14
- package/corpus/templates/content/actions/_local-file-documents.ts +90 -1
- package/corpus/templates/content/actions/_notion-action-utils.ts +6 -2
- package/corpus/templates/content/actions/delete-document.ts +8 -0
- package/corpus/templates/content/actions/remove-local-file-source.ts +100 -0
- package/corpus/templates/content/actions/sync-notion-comments.ts +174 -20
- package/corpus/templates/content/actions/update-document.ts +91 -5
- package/corpus/templates/content/app/blocks/SourceComponentBlock.tsx +31 -3
- package/corpus/templates/content/app/blocks/contentBlockRegistry.tsx +4 -4
- package/corpus/templates/content/app/components/EmptyState.tsx +1 -1
- package/corpus/templates/content/app/components/ThemeToggle.tsx +6 -6
- package/corpus/templates/content/app/components/editor/BubbleToolbar.tsx +5 -5
- package/corpus/templates/content/app/components/editor/CommentsSidebar.tsx +5 -5
- package/corpus/templates/content/app/components/editor/ContentReferencePreview.tsx +1 -1
- package/corpus/templates/content/app/components/editor/DocumentDatabase.tsx +10 -14630
- package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +72 -51
- package/corpus/templates/content/app/components/editor/DocumentEditorSkeleton.tsx +36 -0
- package/corpus/templates/content/app/components/editor/DocumentProperties.tsx +29 -29
- package/corpus/templates/content/app/components/editor/DocumentToolbar.tsx +29 -44
- package/corpus/templates/content/app/components/editor/EmojiPicker.tsx +5 -4
- package/corpus/templates/content/app/components/editor/LinkHoverPreview.tsx +5 -4
- package/corpus/templates/content/app/components/editor/NotionConflictBanner.tsx +1 -1
- package/corpus/templates/content/app/components/editor/NotionSyncBar.tsx +2 -2
- package/corpus/templates/content/app/components/editor/SlashCommandMenu.tsx +5 -5
- package/corpus/templates/content/app/components/editor/TableHoverControls.tsx +13 -13
- package/corpus/templates/content/app/components/editor/VersionHistoryPanel.tsx +10 -10
- package/corpus/templates/content/app/components/editor/VisualEditor.tsx +24 -7
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +2856 -8389
- package/corpus/templates/content/app/components/editor/database/navigation-state.ts +36 -1
- package/corpus/templates/content/app/components/editor/database/settings.tsx +3224 -0
- package/corpus/templates/content/app/components/editor/database/shared.tsx +19 -19
- package/corpus/templates/content/app/components/editor/database/text.ts +23 -0
- package/corpus/templates/content/app/components/editor/database-sources/BuilderSourceReviewDialog.tsx +9 -8
- package/corpus/templates/content/app/components/editor/extensions/AudioBlock.tsx +19 -18
- package/corpus/templates/content/app/components/editor/extensions/ImageBlock.tsx +21 -20
- package/corpus/templates/content/app/components/editor/extensions/LocalMdxComponentNode.tsx +8 -8
- package/corpus/templates/content/app/components/editor/extensions/NotionExtensions.tsx +9 -0
- package/corpus/templates/content/app/components/editor/extensions/VideoBlock.tsx +19 -18
- package/corpus/templates/content/app/components/layout/Header.tsx +1 -5
- package/corpus/templates/content/app/components/layout/Layout.tsx +25 -8
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +203 -55
- package/corpus/templates/content/app/components/sidebar/DocumentTreeItem.tsx +22 -22
- package/corpus/templates/content/app/components/sidebar/NotionButton.tsx +11 -11
- package/corpus/templates/content/app/components/sidebar/document-sidebar-sections.ts +109 -1
- package/corpus/templates/content/app/components/ui/alert-dialog.tsx +1 -0
- package/corpus/templates/content/app/components/ui/button.tsx +1 -0
- package/corpus/templates/content/app/components/ui/dialog.tsx +1 -0
- package/corpus/templates/content/app/components/ui/dropdown-menu.tsx +1 -0
- package/corpus/templates/content/app/components/ui/input.tsx +1 -0
- package/corpus/templates/content/app/components/ui/label.tsx +1 -0
- package/corpus/templates/content/app/components/ui/popover.tsx +1 -0
- package/corpus/templates/content/app/components/ui/separator.tsx +1 -0
- package/corpus/templates/content/app/components/ui/sheet.tsx +1 -0
- package/corpus/templates/content/app/components/ui/skeleton.tsx +1 -0
- package/corpus/templates/content/app/components/ui/sonner.tsx +1 -0
- package/corpus/templates/content/app/components/ui/spinner.tsx +1 -0
- package/corpus/templates/content/app/components/ui/table.tsx +1 -0
- package/corpus/templates/content/app/components/ui/toaster.tsx +1 -0
- package/corpus/templates/content/app/components/ui/toolkit-provider.tsx +12 -0
- package/corpus/templates/content/app/components/ui/tooltip.tsx +1 -0
- package/corpus/templates/content/app/global.css +1 -0
- package/corpus/templates/content/app/hooks/use-documents.ts +89 -37
- package/corpus/templates/content/app/hooks/use-mobile.ts +1 -0
- package/corpus/templates/content/app/hooks/use-notion.ts +73 -5
- package/corpus/templates/content/app/i18n/zh-TW.ts +14 -0
- package/corpus/templates/content/app/i18n-data.ts +153 -0
- package/corpus/templates/content/app/root.tsx +35 -29
- package/corpus/templates/content/app/routes/_app._index.tsx +1 -1
- package/corpus/templates/content/app/routes/_app.local-files.tsx +268 -81
- package/corpus/templates/content/app/routes/_app.settings.tsx +4 -21
- package/corpus/templates/content/app/routes/p.$id.tsx +114 -9
- package/corpus/templates/content/changelog/2026-07-01-builder-source-components-show-preservation-and-review-states.md +6 -0
- package/corpus/templates/content/changelog/2026-07-06-document-headers-and-page-bodies-now-share-one-background-shade.md +6 -0
- package/corpus/templates/content/changelog/2026-07-06-export-submenus-stay-visible-outside-the-page-actions-menu.md +6 -0
- package/corpus/templates/content/changelog/2026-07-06-fixed-collaborative-documents-reapplying-content-before-save.md +6 -0
- package/corpus/templates/content/changelog/2026-07-06-local-files-now-remember-sidebar-collapse-state-and-include-.md +6 -0
- package/corpus/templates/content/changelog/2026-07-06-notion-comment-sync-now-preserves-threads-replies-stay-attac.md +6 -0
- package/corpus/templates/content/changelog/2026-07-06-notion-sync-is-far-more-reliable-auto-sync-no-longer-overwri.md +6 -0
- package/corpus/templates/content/changelog/2026-07-06-opening-pages-now-highlights-the-sidebar-item-and-shows-the-.md +6 -0
- package/corpus/templates/content/changelog/2026-07-06-presence-markers-in-the-editor-are-now-compact-instead-of-co.md +6 -0
- package/corpus/templates/content/changelog/2026-07-06-sidebar-collapse-now-keeps-the-same-background-shade-as-the-.md +6 -0
- package/corpus/templates/content/changelog/2026-07-06-the-content-header-no-longer-shows-the-global-notifications-.md +6 -0
- package/corpus/templates/content/parity/matrix.md +24 -24
- package/corpus/templates/content/parity/matrix.ts +7 -3
- package/corpus/templates/content/server/db/index.ts +9 -0
- package/corpus/templates/content/server/db/schema.ts +15 -0
- package/corpus/templates/content/server/lib/notion-sync.ts +481 -39
- package/corpus/templates/content/server/lib/notion.ts +212 -48
- package/corpus/templates/content/server/plugins/db.ts +20 -0
- package/corpus/templates/content/server/routes/api/document-agent-context.json.get.ts +90 -0
- package/corpus/templates/content/server/routes/api/documents/[id]/notion/resolve.post.ts +14 -2
- package/corpus/templates/content/server/routes/api/notion/callback.get.ts +54 -6
- package/corpus/templates/content/shared/agent-readable.ts +56 -0
- package/corpus/templates/content/shared/builder-mdx.ts +68 -12
- package/corpus/templates/content/shared/builder-source-component-registry.ts +177 -0
- package/corpus/templates/content/shared/nfm.ts +459 -66
- package/corpus/templates/content/shared/source-component-block.ts +72 -6
- package/corpus/templates/content/vite.config.ts +17 -1
- package/corpus/templates/design/.agents/skills/actions/SKILL.md +55 -0
- package/corpus/templates/design/.agents/skills/design-generation/SKILL.md +21 -12
- package/corpus/templates/design/AGENTS.md +3 -2
- package/corpus/templates/design/actions/import-design-source.ts +8 -58
- package/corpus/templates/design/actions/run-design-audit.ts +127 -1
- package/corpus/templates/design/actions/take-design-screenshot.ts +673 -0
- package/corpus/templates/design/app/components/ThemeToggle.tsx +6 -6
- package/corpus/templates/design/app/components/design/CanvasContextMenu.tsx +11 -11
- package/corpus/templates/design/app/components/design/DesignEditorSkeleton.tsx +2 -2
- package/corpus/templates/design/app/components/design/DesignExtensionsPanel.tsx +16 -21
- package/corpus/templates/design/app/components/design/DesignImportPanel.tsx +6 -97
- package/corpus/templates/design/app/components/design/DrawOverlay.tsx +7 -7
- package/corpus/templates/design/app/components/design/EditPanel.tsx +30 -30
- package/corpus/templates/design/app/components/design/FusionAppBanner.tsx +9 -8
- package/corpus/templates/design/app/components/design/LayersPanel.tsx +14 -14
- package/corpus/templates/design/app/components/design/LocalhostWriteConsentDialog.tsx +6 -5
- package/corpus/templates/design/app/components/design/MotionDock.tsx +15 -15
- package/corpus/templates/design/app/components/design/QuestionFlow.tsx +3 -3
- package/corpus/templates/design/app/components/design/ReviewPanel.tsx +3 -3
- package/corpus/templates/design/app/components/design/StatesPanel.tsx +13 -13
- package/corpus/templates/design/app/components/design/TokensPanel.tsx +14 -14
- package/corpus/templates/design/app/components/design/TweaksPanel.tsx +6 -6
- package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +39 -9
- package/corpus/templates/design/app/components/design/code-workbench/ActivityBar.tsx +3 -3
- package/corpus/templates/design/app/components/design/code-workbench/SideBar.tsx +4 -7
- package/corpus/templates/design/app/components/design/code-workbench/editor/EditorTabs.tsx +6 -6
- package/corpus/templates/design/app/components/design/code-workbench/editor/MonacoHost.tsx +2 -1
- package/corpus/templates/design/app/components/design/code-workbench/explorer/FileTree.tsx +17 -17
- package/corpus/templates/design/app/components/design/code-workbench/search/SearchView.tsx +6 -6
- package/corpus/templates/design/app/components/design/inspector/AlignmentMatrix.tsx +3 -3
- package/corpus/templates/design/app/components/design/inspector/AutoLayoutMatrix.tsx +7 -7
- package/corpus/templates/design/app/components/design/inspector/ConstraintsWidget.tsx +3 -3
- package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +18 -18
- package/corpus/templates/design/app/components/design/inspector/ExportSettingsPanel.tsx +6 -6
- package/corpus/templates/design/app/components/design/inspector/ImageFillControls.tsx +6 -6
- package/corpus/templates/design/app/components/design/inspector/InspectorAiActions.tsx +7 -7
- package/corpus/templates/design/app/components/design/inspector/ScrubInput.tsx +7 -7
- package/corpus/templates/design/app/components/design/inspector/ShaderControls.tsx +14 -14
- package/corpus/templates/design/app/components/design/inspector/ShaderEffectRow.tsx +9 -9
- package/corpus/templates/design/app/components/design/inspector/ShaderFillsPanel.tsx +6 -6
- package/corpus/templates/design/app/components/design-system/DesignSystemCard.tsx +3 -2
- package/corpus/templates/design/app/components/editor/PromptDialog.tsx +15 -18
- package/corpus/templates/design/app/components/layout/Header.tsx +2 -2
- package/corpus/templates/design/app/components/layout/Sidebar.tsx +5 -5
- package/corpus/templates/design/app/components/ui/alert-dialog.tsx +1 -0
- package/corpus/templates/design/app/components/ui/avatar.tsx +1 -0
- package/corpus/templates/design/app/components/ui/badge.tsx +1 -0
- package/corpus/templates/design/app/components/ui/button.tsx +1 -0
- package/corpus/templates/design/app/components/ui/card.tsx +1 -0
- package/corpus/templates/design/app/components/ui/checkbox.tsx +1 -0
- package/corpus/templates/design/app/components/ui/collapsible.tsx +1 -0
- package/corpus/templates/design/app/components/ui/context-menu.tsx +1 -0
- package/corpus/templates/design/app/components/ui/dialog.tsx +1 -0
- package/corpus/templates/design/app/components/ui/dropdown-menu.tsx +1 -0
- package/corpus/templates/design/app/components/ui/input.tsx +1 -0
- package/corpus/templates/design/app/components/ui/label.tsx +1 -0
- package/corpus/templates/design/app/components/ui/popover.tsx +1 -0
- package/corpus/templates/design/app/components/ui/select.tsx +1 -0
- package/corpus/templates/design/app/components/ui/separator.tsx +1 -0
- package/corpus/templates/design/app/components/ui/sheet.tsx +1 -0
- package/corpus/templates/design/app/components/ui/skeleton.tsx +1 -0
- package/corpus/templates/design/app/components/ui/slider.tsx +1 -0
- package/corpus/templates/design/app/components/ui/sonner.tsx +1 -0
- package/corpus/templates/design/app/components/ui/spinner.tsx +1 -0
- package/corpus/templates/design/app/components/ui/switch.tsx +1 -0
- package/corpus/templates/design/app/components/ui/tabs.tsx +1 -0
- package/corpus/templates/design/app/components/ui/textarea.tsx +1 -0
- package/corpus/templates/design/app/components/ui/toolkit-provider.tsx +12 -0
- package/corpus/templates/design/app/components/ui/tooltip.tsx +1 -0
- package/corpus/templates/design/app/components/visual-editor/CanvasCommentPins.tsx +7 -7
- package/corpus/templates/design/app/components/visual-editor/DrawOverlay.tsx +7 -7
- package/corpus/templates/design/app/components/visual-editor/SaveStatusIndicator.tsx +3 -3
- package/corpus/templates/design/app/global.css +1 -0
- package/corpus/templates/design/app/i18n/zh-TW.ts +3 -4
- package/corpus/templates/design/app/i18n-data.ts +38 -35
- package/corpus/templates/design/app/pages/DesignEditor.tsx +47 -51
- package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +6 -6
- package/corpus/templates/design/app/pages/DesignSystems.tsx +31 -31
- package/corpus/templates/design/app/pages/Index.tsx +25 -29
- package/corpus/templates/design/app/pages/NotFound.tsx +2 -1
- package/corpus/templates/design/app/pages/Present.tsx +2 -1
- package/corpus/templates/design/app/pages/VisualEdit.tsx +2 -1
- package/corpus/templates/design/app/root.tsx +7 -4
- package/corpus/templates/design/app/routes/settings.tsx +22 -49
- package/corpus/templates/design/changelog/2026-07-05-code-sidebar-tabs-now-use-a-quieter-active-highlight-that-ma.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-fig-files-now-stay-on-the-builder-indexing-path-through-desi.md +6 -0
- package/corpus/templates/design/changelog/2026-07-06-mobile-layouts-no-longer-stack-two-top-headers.md +5 -0
- package/corpus/templates/design/changelog/2026-07-06-the-design-agent-now-visually-reviews-rendered-screenshots-o.md +6 -0
- package/corpus/templates/design/server/db/index.ts +8 -0
- package/corpus/templates/design/server/handlers/import-design-file.ts +4 -43
- package/corpus/templates/design/server/handlers/index-design-system-with-builder.ts +2 -2
- package/corpus/templates/design/server/lib/visible-clipboard-html.ts +32 -0
- package/corpus/templates/design/server/routes/[...page].get.ts +94 -1
- package/corpus/templates/design/server/routes/api/design-agent-context.json.get.ts +84 -0
- package/corpus/templates/design/shared/agent-readable.ts +2 -0
- package/corpus/templates/design/shared/design-review.ts +1 -0
- package/corpus/templates/dispatch/.agents/skills/actions/SKILL.md +55 -0
- package/corpus/templates/dispatch/actions/list-staged-datasets.ts +3 -0
- package/corpus/templates/dispatch/app/routes/settings.tsx +3 -17
- package/corpus/templates/forms/.agents/skills/actions/SKILL.md +55 -0
- package/corpus/templates/forms/app/components/CloudUpgrade.tsx +10 -10
- package/corpus/templates/forms/app/components/ThemeToggle.tsx +5 -5
- package/corpus/templates/forms/app/components/builder/FieldPropertiesPanel.tsx +11 -10
- package/corpus/templates/forms/app/components/builder/FieldRenderer.tsx +10 -13
- package/corpus/templates/forms/app/components/layout/Sidebar.tsx +17 -17
- package/corpus/templates/forms/app/components/ui/alert-dialog.tsx +1 -0
- package/corpus/templates/forms/app/components/ui/badge.tsx +1 -0
- package/corpus/templates/forms/app/components/ui/button.tsx +1 -0
- package/corpus/templates/forms/app/components/ui/calendar.tsx +1 -1
- package/corpus/templates/forms/app/components/ui/card.tsx +1 -0
- package/corpus/templates/forms/app/components/ui/checkbox.tsx +1 -0
- package/corpus/templates/forms/app/components/ui/command.tsx +1 -1
- package/corpus/templates/forms/app/components/ui/dialog.tsx +1 -0
- package/corpus/templates/forms/app/components/ui/dropdown-menu.tsx +1 -0
- package/corpus/templates/forms/app/components/ui/input.tsx +1 -0
- package/corpus/templates/forms/app/components/ui/label.tsx +1 -0
- package/corpus/templates/forms/app/components/ui/popover.tsx +1 -0
- package/corpus/templates/forms/app/components/ui/radio-group.tsx +1 -0
- package/corpus/templates/forms/app/components/ui/scroll-area.tsx +1 -0
- package/corpus/templates/forms/app/components/ui/select.tsx +1 -0
- package/corpus/templates/forms/app/components/ui/separator.tsx +1 -0
- package/corpus/templates/forms/app/components/ui/skeleton.tsx +1 -0
- package/corpus/templates/forms/app/components/ui/slider.tsx +1 -0
- package/corpus/templates/forms/app/components/ui/switch.tsx +1 -0
- package/corpus/templates/forms/app/components/ui/table.tsx +1 -0
- package/corpus/templates/forms/app/components/ui/tabs.tsx +1 -0
- package/corpus/templates/forms/app/components/ui/textarea.tsx +1 -0
- package/corpus/templates/forms/app/components/ui/toolkit-provider.tsx +12 -0
- package/corpus/templates/forms/app/components/ui/tooltip.tsx +1 -0
- package/corpus/templates/forms/app/global.css +1 -0
- package/corpus/templates/forms/app/hooks/use-mobile.ts +1 -0
- package/corpus/templates/forms/app/hooks/use-navigation-state.ts +0 -1
- package/corpus/templates/forms/app/pages/FormBuilderPage.tsx +24 -26
- package/corpus/templates/forms/app/pages/FormFillPage.tsx +2 -2
- package/corpus/templates/forms/app/pages/FormsListPage.tsx +21 -21
- package/corpus/templates/forms/app/pages/ResponseInsightsPage.tsx +11 -11
- package/corpus/templates/forms/app/pages/ResponsesPage.tsx +4 -4
- package/corpus/templates/forms/app/root.tsx +11 -8
- package/corpus/templates/forms/app/routes/_app.settings.tsx +6 -21
- package/corpus/templates/forms/app/routes/form-preview.tsx +3 -3
- package/corpus/templates/forms/changelog/2026-07-06-the-form-builder-header-no-longer-shows-the-global-notificat.md +6 -0
- package/corpus/templates/macros/app/components/AddExerciseDialog.tsx +1 -1
- package/corpus/templates/macros/app/components/AddMealDialog.tsx +1 -1
- package/corpus/templates/macros/app/components/AddWeightDialog.tsx +1 -1
- package/corpus/templates/macros/app/components/DailyProgress.tsx +7 -7
- package/corpus/templates/macros/app/components/WeeklyCaloriesChart.tsx +2 -1
- package/corpus/templates/macros/app/components/WeightCard.tsx +10 -10
- package/corpus/templates/macros/app/components/WeightTracker.tsx +1 -1
- package/corpus/templates/macros/app/components/layout/AppLayout.tsx +6 -10
- package/corpus/templates/macros/app/components/ui/alert-dialog.tsx +1 -0
- package/corpus/templates/macros/app/components/ui/label.tsx +1 -0
- package/corpus/templates/macros/app/components/ui/select.tsx +1 -0
- package/corpus/templates/macros/app/components/ui/sheet.tsx +1 -0
- package/corpus/templates/macros/app/components/ui/skeleton.tsx +1 -0
- package/corpus/templates/macros/app/components/ui/sonner.tsx +1 -0
- package/corpus/templates/macros/app/components/ui/toolkit-provider.tsx +12 -0
- package/corpus/templates/macros/app/components/ui/tooltip.tsx +1 -0
- package/corpus/templates/macros/app/global.css +1 -0
- package/corpus/templates/macros/app/root.tsx +17 -14
- package/corpus/templates/macros/app/routes/_index.tsx +1 -1
- package/corpus/templates/macros/app/routes/analytics.tsx +8 -8
- package/corpus/templates/macros/app/routes/settings.tsx +4 -19
- package/corpus/templates/mail/.agents/skills/actions/SKILL.md +55 -0
- package/corpus/templates/mail/.agents/skills/contacts-and-crm/SKILL.md +67 -0
- package/corpus/templates/mail/.agents/skills/draft-queue/SKILL.md +35 -1
- package/corpus/templates/mail/.agents/skills/email-drafts/SKILL.md +74 -33
- package/corpus/templates/mail/AGENTS.md +102 -16
- package/corpus/templates/mail/actions/archive-email.ts +67 -11
- package/corpus/templates/mail/actions/manage-snippets.ts +106 -0
- package/corpus/templates/mail/actions/mark-read.ts +45 -11
- package/corpus/templates/mail/actions/send-queued-drafts.ts +77 -42
- package/corpus/templates/mail/actions/star-email.ts +55 -10
- package/corpus/templates/mail/actions/trash-email.ts +48 -9
- package/corpus/templates/mail/app/components/GoogleConnectBanner.tsx +1 -1
- package/corpus/templates/mail/app/components/ThemeToggle.tsx +6 -6
- package/corpus/templates/mail/app/components/agent-engine-picker.tsx +10 -10
- package/corpus/templates/mail/app/components/email/CodeBlockLangPicker.tsx +4 -3
- package/corpus/templates/mail/app/components/email/ComposeBubbleToolbar.tsx +5 -5
- package/corpus/templates/mail/app/components/email/ComposeEditor.tsx +109 -10
- package/corpus/templates/mail/app/components/email/ComposeModal.tsx +44 -19
- package/corpus/templates/mail/app/components/email/ComposeSlashMenu.tsx +139 -17
- package/corpus/templates/mail/app/components/email/EmailList.tsx +522 -314
- package/corpus/templates/mail/app/components/email/EmailListItem.tsx +130 -45
- package/corpus/templates/mail/app/components/email/EmailThread.tsx +9 -9
- package/corpus/templates/mail/app/components/email/InlineReplyComposer.tsx +35 -13
- package/corpus/templates/mail/app/components/email/IntegrationsSidebar.tsx +13 -13
- package/corpus/templates/mail/app/components/email/MobileActionBar.tsx +13 -13
- package/corpus/templates/mail/app/components/email/RecipientInput.tsx +53 -42
- package/corpus/templates/mail/app/components/email/SendLaterButton.tsx +5 -4
- package/corpus/templates/mail/app/components/email/SnoozeModal.tsx +1 -1
- package/corpus/templates/mail/app/components/email/SnoozePopover.tsx +6 -6
- package/corpus/templates/mail/app/components/layout/AppLayout.tsx +19 -23
- package/corpus/templates/mail/app/components/layout/HeaderActions.tsx +12 -4
- package/corpus/templates/mail/app/components/layout/SearchBar.tsx +138 -18
- package/corpus/templates/mail/app/components/settings/GmailFiltersSection.tsx +23 -23
- package/corpus/templates/mail/app/components/settings/SnippetsSection.tsx +303 -0
- package/corpus/templates/mail/app/components/ui/alert-dialog.tsx +1 -0
- package/corpus/templates/mail/app/components/ui/badge.tsx +1 -0
- package/corpus/templates/mail/app/components/ui/button.tsx +1 -0
- package/corpus/templates/mail/app/components/ui/calendar.tsx +1 -1
- package/corpus/templates/mail/app/components/ui/command.tsx +1 -1
- package/corpus/templates/mail/app/components/ui/dialog.tsx +1 -0
- package/corpus/templates/mail/app/components/ui/drawer.tsx +1 -0
- package/corpus/templates/mail/app/components/ui/dropdown-menu.tsx +1 -0
- package/corpus/templates/mail/app/components/ui/popover.tsx +1 -0
- package/corpus/templates/mail/app/components/ui/select.tsx +1 -0
- package/corpus/templates/mail/app/components/ui/skeleton.tsx +1 -0
- package/corpus/templates/mail/app/components/ui/spinner.tsx +1 -0
- package/corpus/templates/mail/app/components/ui/switch.tsx +1 -0
- package/corpus/templates/mail/app/components/ui/toolkit-provider.tsx +12 -0
- package/corpus/templates/mail/app/components/ui/tooltip.tsx +1 -0
- package/corpus/templates/mail/app/global.css +20 -3
- package/corpus/templates/mail/app/hooks/use-emails.ts +187 -0
- package/corpus/templates/mail/app/hooks/use-snippets.ts +103 -0
- package/corpus/templates/mail/app/i18n/ar-SA.ts +17 -0
- package/corpus/templates/mail/app/i18n/de-DE.ts +18 -0
- package/corpus/templates/mail/app/i18n/en-US.ts +17 -0
- package/corpus/templates/mail/app/i18n/es-ES.ts +17 -0
- package/corpus/templates/mail/app/i18n/fr-FR.ts +18 -0
- package/corpus/templates/mail/app/i18n/hi-IN.ts +17 -0
- package/corpus/templates/mail/app/i18n/ja-JP.ts +18 -0
- package/corpus/templates/mail/app/i18n/ko-KR.ts +17 -0
- package/corpus/templates/mail/app/i18n/pt-BR.ts +17 -0
- package/corpus/templates/mail/app/i18n/zh-CN.ts +16 -0
- package/corpus/templates/mail/app/i18n/zh-TW.ts +16 -0
- package/corpus/templates/mail/app/pages/DraftQueuePage.tsx +14 -14
- package/corpus/templates/mail/app/pages/InboxPage.tsx +3 -3
- package/corpus/templates/mail/app/pages/NotFound.tsx +2 -1
- package/corpus/templates/mail/app/pages/SettingsPage.tsx +64 -66
- package/corpus/templates/mail/app/root.tsx +21 -18
- package/corpus/templates/mail/app/routes/_index.tsx +2 -1
- package/corpus/templates/mail/app/routes/email.tsx +2 -2
- package/corpus/templates/mail/changelog/2026-07-06-a-queued-draft-can-no-longer-be-sent-twice-by-simultaneous-s.md +6 -0
- package/corpus/templates/mail/changelog/2026-07-06-bulk-archive-trash-star-and-mark-read-now-complete-in-one-fa.md +6 -0
- package/corpus/templates/mail/changelog/2026-07-06-dark-mode-sidebars-and-notifications-now-use-the-softer-gray.md +6 -0
- package/corpus/templates/mail/changelog/2026-07-06-inbox-automations-pick-up-new-mail-faster.md +6 -0
- package/corpus/templates/mail/changelog/2026-07-06-inbox-lists-stay-fast-as-scheduled-and-snoozed-mail-accumula.md +6 -0
- package/corpus/templates/mail/changelog/2026-07-06-long-inboxes-scroll-smoothly-and-stay-fast-as-more-mail-load.md +6 -0
- package/corpus/templates/mail/changelog/2026-07-06-paste-or-drop-images-straight-into-the-composer-to-send-them.md +6 -0
- package/corpus/templates/mail/changelog/2026-07-06-save-reusable-snippets-and-insert-them-from-the-compose-slas.md +6 -0
- package/corpus/templates/mail/changelog/2026-07-06-scrolling-older-mail-keeps-loading-correctly-when-no-gmail-a.md +6 -0
- package/corpus/templates/mail/changelog/2026-07-06-search-shows-instant-matches-from-already-loaded-mail-while-.md +6 -0
- package/corpus/templates/mail/changelog/2026-07-06-sends-now-fail-with-a-clear-error-instead-of-quietly-missing.md +6 -0
- package/corpus/templates/mail/changelog/2026-07-06-the-mail-header-no-longer-shows-the-global-notifications-bel.md +6 -0
- package/corpus/templates/mail/package.json +1 -0
- package/corpus/templates/mail/server/db/schema.ts +11 -0
- package/corpus/templates/mail/server/handlers/emails.ts +20 -1
- package/corpus/templates/mail/server/lib/automation-engine.ts +53 -25
- package/corpus/templates/mail/server/lib/google-auth.ts +140 -9
- package/corpus/templates/mail/server/lib/jobs.ts +22 -6
- package/corpus/templates/mail/server/lib/outgoing-email.ts +11 -2
- package/corpus/templates/mail/server/lib/queued-drafts.ts +145 -4
- package/corpus/templates/mail/server/plugins/db.ts +29 -0
- package/corpus/templates/plan/.agents/skills/actions/SKILL.md +55 -0
- package/corpus/templates/plan/app/components/editor/PlanDocumentEditor.tsx +42 -3
- package/corpus/templates/plan/app/components/layout/Layout.tsx +5 -4
- package/corpus/templates/plan/app/components/layout/Sidebar.tsx +20 -20
- package/corpus/templates/plan/app/components/plan/CanvasArea.tsx +3 -2
- package/corpus/templates/plan/app/components/plan/DocumentArea.tsx +2 -2
- package/corpus/templates/plan/app/components/plan/GuestModeBanner.tsx +2 -1
- package/corpus/templates/plan/app/components/plan/LocalCodebasePicker.tsx +8 -8
- package/corpus/templates/plan/app/components/plan/PlanContentRenderer.tsx +6 -1
- package/corpus/templates/plan/app/components/plan/PlanImageViewer.tsx +8 -12
- package/corpus/templates/plan/app/components/plan/PlanMarkdownEditor.tsx +6 -1
- package/corpus/templates/plan/app/components/plan/PlanVisualSurface.tsx +3 -3
- package/corpus/templates/plan/app/components/plan/planBlocks.tsx +4 -4
- package/corpus/templates/plan/app/components/plan/wireframe/kit/rough.tsx +61 -27
- package/corpus/templates/plan/app/components/ui/alert-dialog.tsx +1 -0
- package/corpus/templates/plan/app/components/ui/avatar.tsx +1 -0
- package/corpus/templates/plan/app/components/ui/badge.tsx +1 -0
- package/corpus/templates/plan/app/components/ui/button.tsx +1 -0
- package/corpus/templates/plan/app/components/ui/card.tsx +1 -0
- package/corpus/templates/plan/app/components/ui/checkbox.tsx +1 -0
- package/corpus/templates/plan/app/components/ui/collapsible.tsx +1 -0
- package/corpus/templates/plan/app/components/ui/dialog.tsx +1 -0
- package/corpus/templates/plan/app/components/ui/dropdown-menu.tsx +1 -0
- package/corpus/templates/plan/app/components/ui/input.tsx +1 -0
- package/corpus/templates/plan/app/components/ui/label.tsx +1 -0
- package/corpus/templates/plan/app/components/ui/popover.tsx +1 -0
- package/corpus/templates/plan/app/components/ui/scroll-area.tsx +1 -0
- package/corpus/templates/plan/app/components/ui/select.tsx +1 -0
- package/corpus/templates/plan/app/components/ui/separator.tsx +1 -0
- package/corpus/templates/plan/app/components/ui/sheet.tsx +1 -0
- package/corpus/templates/plan/app/components/ui/skeleton.tsx +1 -0
- package/corpus/templates/plan/app/components/ui/sonner.tsx +1 -0
- package/corpus/templates/plan/app/components/ui/spinner.tsx +1 -0
- package/corpus/templates/plan/app/components/ui/textarea.tsx +1 -0
- package/corpus/templates/plan/app/components/ui/toggle-group.tsx +1 -0
- package/corpus/templates/plan/app/components/ui/toolkit-provider.tsx +12 -0
- package/corpus/templates/plan/app/components/ui/tooltip.tsx +1 -0
- package/corpus/templates/plan/app/global.css +13 -0
- package/corpus/templates/plan/app/hooks/use-plan-presence.ts +11 -1
- package/corpus/templates/plan/app/lib/plan-access-prompt.ts +74 -0
- package/corpus/templates/plan/app/lib/plan-annotation-runtime.ts +1435 -0
- package/corpus/templates/plan/app/lib/plan-comment-editor-helpers.ts +142 -0
- package/corpus/templates/plan/app/lib/plan-local-bridge.ts +376 -0
- package/corpus/templates/plan/app/lib/plan-native-anchors.ts +682 -0
- package/corpus/templates/plan/app/pages/PlansPage.tsx +216 -2747
- package/corpus/templates/plan/app/root.tsx +13 -10
- package/corpus/templates/plan/app/routes/_index.tsx +1 -2
- package/corpus/templates/plan/app/routes/local-plans.$slug.tsx +1 -1
- package/corpus/templates/plan/app/routes/plans.$id.tsx +1 -2
- package/corpus/templates/plan/app/routes/plans.tsx +1 -2
- package/corpus/templates/plan/app/routes/recaps.$id.tsx +1 -2
- package/corpus/templates/plan/app/routes/recaps.tsx +1 -2
- package/corpus/templates/plan/app/routes/settings.tsx +7 -21
- package/corpus/templates/plan/changelog/2026-07-05-plan-pages-open-at-the-top-unless-a-shared-link-targets-a-sp.md +6 -0
- package/corpus/templates/plan/changelog/2026-07-06-fixed-collaborative-plan-editing-so-content-no-longer-duplic.md +6 -0
- package/corpus/templates/plan/changelog/2026-07-06-fixed-visual-reports-using-excessive-cpu-while-rendering-ske.md +6 -0
- package/corpus/templates/plan/server/db/index.ts +12 -0
- package/corpus/templates/plan/server/plans.ts +25 -1
- package/corpus/templates/plan/server/routes/[...page].get.ts +107 -1
- package/corpus/templates/plan/server/routes/api/plan-agent-context.json.get.ts +65 -0
- package/corpus/templates/plan/shared/agent-readable.ts +2 -0
- package/corpus/templates/slides/.agents/skills/actions/SKILL.md +55 -0
- package/corpus/templates/slides/app/components/ThemeToggle.tsx +6 -6
- package/corpus/templates/slides/app/components/comments/SlideCommentsPanel.tsx +5 -5
- package/corpus/templates/slides/app/components/deck/DeckCard.tsx +7 -7
- package/corpus/templates/slides/app/components/deck/ExcalidrawSlide.tsx +2 -1
- package/corpus/templates/slides/app/components/deck/SlideRenderer.tsx +1 -1
- package/corpus/templates/slides/app/components/design-system/DesignSystemCard.tsx +3 -2
- package/corpus/templates/slides/app/components/design-system/DesignSystemSetup.tsx +15 -14
- package/corpus/templates/slides/app/components/editor/AnimationsPanel.tsx +7 -7
- package/corpus/templates/slides/app/components/editor/BlockBubbleMenu.tsx +5 -5
- package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +6 -6
- package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +14 -14
- package/corpus/templates/slides/app/components/editor/ExportMenu.tsx +10 -9
- package/corpus/templates/slides/app/components/editor/GenerateSlidesDialog.tsx +6 -5
- package/corpus/templates/slides/app/components/editor/HistoryPanel.tsx +12 -12
- package/corpus/templates/slides/app/components/editor/ImageDropPromptPopover.tsx +4 -3
- package/corpus/templates/slides/app/components/editor/ImageSearchPanel.tsx +5 -4
- package/corpus/templates/slides/app/components/editor/ImportButton.tsx +4 -3
- package/corpus/templates/slides/app/components/editor/PromptDialog.tsx +2 -1
- package/corpus/templates/slides/app/components/editor/ShareDialog.tsx +10 -10
- package/corpus/templates/slides/app/components/editor/SlideBubbleMenu.tsx +10 -10
- package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +6 -6
- package/corpus/templates/slides/app/components/editor/SlideStyleInspector.tsx +2 -1
- package/corpus/templates/slides/app/components/editor/TweaksPanel.tsx +1 -1
- package/corpus/templates/slides/app/components/layout/Header.tsx +2 -2
- package/corpus/templates/slides/app/components/layout/Sidebar.tsx +5 -5
- package/corpus/templates/slides/app/components/ui/alert-dialog.tsx +1 -0
- package/corpus/templates/slides/app/components/ui/button.tsx +1 -0
- package/corpus/templates/slides/app/components/ui/card.tsx +1 -0
- package/corpus/templates/slides/app/components/ui/dialog.tsx +1 -0
- package/corpus/templates/slides/app/components/ui/dropdown-menu.tsx +1 -0
- package/corpus/templates/slides/app/components/ui/input.tsx +1 -0
- package/corpus/templates/slides/app/components/ui/label.tsx +1 -0
- package/corpus/templates/slides/app/components/ui/popover.tsx +1 -0
- package/corpus/templates/slides/app/components/ui/scroll-area.tsx +1 -0
- package/corpus/templates/slides/app/components/ui/select.tsx +1 -0
- package/corpus/templates/slides/app/components/ui/separator.tsx +1 -0
- package/corpus/templates/slides/app/components/ui/sheet.tsx +1 -0
- package/corpus/templates/slides/app/components/ui/skeleton.tsx +1 -0
- package/corpus/templates/slides/app/components/ui/spinner.tsx +1 -0
- package/corpus/templates/slides/app/components/ui/textarea.tsx +1 -0
- package/corpus/templates/slides/app/components/ui/toast.tsx +1 -0
- package/corpus/templates/slides/app/components/ui/toaster.tsx +1 -0
- package/corpus/templates/slides/app/components/ui/toggle-group.tsx +1 -0
- package/corpus/templates/slides/app/components/ui/toolkit-provider.tsx +12 -0
- package/corpus/templates/slides/app/components/ui/tooltip.tsx +1 -0
- package/corpus/templates/slides/app/components/visual-editor/CanvasCommentPins.tsx +6 -6
- package/corpus/templates/slides/app/components/visual-editor/DrawOverlay.tsx +7 -7
- package/corpus/templates/slides/app/global.css +1 -0
- package/corpus/templates/slides/app/hooks/use-toast.ts +1 -0
- package/corpus/templates/slides/app/pages/DeckEditor.tsx +3 -3
- package/corpus/templates/slides/app/pages/DesignSystems.tsx +1 -1
- package/corpus/templates/slides/app/pages/Index.tsx +14 -17
- package/corpus/templates/slides/app/root.tsx +13 -10
- package/corpus/templates/slides/app/routes/p.$id.tsx +126 -12
- package/corpus/templates/slides/app/routes/settings.tsx +6 -21
- package/corpus/templates/slides/app/routes/share.$token.tsx +55 -8
- package/corpus/templates/slides/changelog/2026-07-06-mobile-layouts-no-longer-stack-two-top-headers.md +5 -0
- package/corpus/templates/slides/server/db/index.ts +9 -0
- package/corpus/templates/slides/server/handlers/uploads.ts +7 -2
- package/corpus/templates/slides/server/lib/chat-attachments.ts +1 -1
- package/corpus/templates/slides/server/routes/api/deck-agent-context.json.get.ts +97 -0
- package/corpus/templates/slides/shared/agent-readable.ts +2 -0
- package/dist/agent/durable-background.d.ts +29 -0
- package/dist/agent/durable-background.d.ts.map +1 -1
- package/dist/agent/durable-background.js +46 -0
- package/dist/agent/durable-background.js.map +1 -1
- package/dist/agent/engine/ai-sdk-engine.d.ts.map +1 -1
- package/dist/agent/engine/ai-sdk-engine.js +7 -2
- package/dist/agent/engine/ai-sdk-engine.js.map +1 -1
- package/dist/agent/engine/anthropic-engine.d.ts.map +1 -1
- package/dist/agent/engine/anthropic-engine.js +28 -2
- package/dist/agent/engine/anthropic-engine.js.map +1 -1
- package/dist/agent/engine/builder-engine.d.ts.map +1 -1
- package/dist/agent/engine/builder-engine.js +1 -1
- package/dist/agent/engine/builder-engine.js.map +1 -1
- package/dist/agent/engine/output-tokens.d.ts +3 -3
- package/dist/agent/engine/output-tokens.d.ts.map +1 -1
- package/dist/agent/engine/output-tokens.js +16 -14
- package/dist/agent/engine/output-tokens.js.map +1 -1
- package/dist/agent/engine/registry.d.ts +3 -3
- package/dist/agent/engine/registry.d.ts.map +1 -1
- package/dist/agent/engine/registry.js +28 -25
- package/dist/agent/engine/registry.js.map +1 -1
- package/dist/agent/engine/translate-ai-sdk.d.ts +14 -2
- package/dist/agent/engine/translate-ai-sdk.d.ts.map +1 -1
- package/dist/agent/engine/translate-ai-sdk.js +33 -18
- package/dist/agent/engine/translate-ai-sdk.js.map +1 -1
- package/dist/agent/engine/translate-anthropic.d.ts.map +1 -1
- package/dist/agent/engine/translate-anthropic.js +42 -1
- package/dist/agent/engine/translate-anthropic.js.map +1 -1
- package/dist/agent/engine/types.d.ts +15 -0
- package/dist/agent/engine/types.d.ts.map +1 -1
- package/dist/agent/engine/types.js.map +1 -1
- package/dist/agent/model-config.d.ts +8 -0
- package/dist/agent/model-config.d.ts.map +1 -1
- package/dist/agent/model-config.js +86 -0
- package/dist/agent/model-config.js.map +1 -1
- package/dist/agent/production-agent.d.ts +91 -5
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +389 -180
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/runtime-context.d.ts +29 -0
- package/dist/agent/runtime-context.d.ts.map +1 -1
- package/dist/agent/runtime-context.js +40 -11
- package/dist/agent/runtime-context.js.map +1 -1
- package/dist/agent/tool-result-images.d.ts +49 -0
- package/dist/agent/tool-result-images.d.ts.map +1 -0
- package/dist/agent/tool-result-images.js +141 -0
- package/dist/agent/tool-result-images.js.map +1 -0
- package/dist/brand-kit/fig/index.d.ts.map +1 -1
- package/dist/brand-kit/fig/index.js +6 -3
- package/dist/brand-kit/fig/index.js.map +1 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +66 -17
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +72 -40
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/KeepTabOpenNotice.d.ts +55 -0
- package/dist/client/KeepTabOpenNotice.d.ts.map +1 -0
- package/dist/client/KeepTabOpenNotice.js +85 -0
- package/dist/client/KeepTabOpenNotice.js.map +1 -0
- package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
- package/dist/client/MultiTabAssistantChat.js +2 -1
- package/dist/client/MultiTabAssistantChat.js.map +1 -1
- package/dist/client/RunStuckBanner.d.ts +7 -1
- package/dist/client/RunStuckBanner.d.ts.map +1 -1
- package/dist/client/RunStuckBanner.js +7 -2
- package/dist/client/RunStuckBanner.js.map +1 -1
- package/dist/client/chat/run-recovery.d.ts.map +1 -1
- package/dist/client/chat/run-recovery.js +7 -1
- package/dist/client/chat/run-recovery.js.map +1 -1
- package/dist/client/clipboard.d.ts.map +1 -1
- package/dist/client/clipboard.js +5 -6
- package/dist/client/clipboard.js.map +1 -1
- package/dist/client/components/AgentPresenceChip.d.ts +1 -11
- package/dist/client/components/AgentPresenceChip.d.ts.map +1 -1
- package/dist/client/components/AgentPresenceChip.js +1 -41
- package/dist/client/components/AgentPresenceChip.js.map +1 -1
- package/dist/client/components/LiveCursorOverlay.d.ts +1 -44
- package/dist/client/components/LiveCursorOverlay.d.ts.map +1 -1
- package/dist/client/components/LiveCursorOverlay.js +1 -123
- package/dist/client/components/LiveCursorOverlay.js.map +1 -1
- package/dist/client/components/PresenceBar.d.ts +1 -26
- package/dist/client/components/PresenceBar.d.ts.map +1 -1
- package/dist/client/components/PresenceBar.js +1 -164
- package/dist/client/components/PresenceBar.js.map +1 -1
- package/dist/client/components/RecentEditHighlights.d.ts +1 -42
- package/dist/client/components/RecentEditHighlights.d.ts.map +1 -1
- package/dist/client/components/RecentEditHighlights.js +1 -145
- package/dist/client/components/RecentEditHighlights.js.map +1 -1
- package/dist/client/components/RemoteSelectionRings.d.ts +1 -51
- package/dist/client/components/RemoteSelectionRings.d.ts.map +1 -1
- package/dist/client/components/RemoteSelectionRings.js +1 -129
- package/dist/client/components/RemoteSelectionRings.js.map +1 -1
- package/dist/client/composer/TiptapComposer.d.ts +4 -0
- package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
- package/dist/client/composer/TiptapComposer.js +74 -26
- package/dist/client/composer/TiptapComposer.js.map +1 -1
- package/dist/client/db-admin/SqlEditor.d.ts.map +1 -1
- package/dist/client/db-admin/SqlEditor.js +13 -3
- package/dist/client/db-admin/SqlEditor.js.map +1 -1
- package/dist/client/dynamic-suggestions.d.ts.map +1 -1
- package/dist/client/dynamic-suggestions.js +7 -1
- package/dist/client/dynamic-suggestions.js.map +1 -1
- package/dist/client/extensions/ExtensionViewer.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionViewer.js +7 -7
- package/dist/client/extensions/ExtensionViewer.js.map +1 -1
- package/dist/client/extensions/ExtensionsListPage.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionsListPage.js +5 -7
- package/dist/client/extensions/ExtensionsListPage.js.map +1 -1
- package/dist/client/extensions/ExtensionsSidebarSection.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionsSidebarSection.js +1 -1
- package/dist/client/extensions/ExtensionsSidebarSection.js.map +1 -1
- package/dist/client/host-bridge.d.ts +2 -0
- package/dist/client/host-bridge.d.ts.map +1 -1
- package/dist/client/host-bridge.js +26 -10
- package/dist/client/host-bridge.js.map +1 -1
- package/dist/client/i18n.d.ts +1 -0
- package/dist/client/i18n.d.ts.map +1 -1
- package/dist/client/i18n.js +3 -1
- package/dist/client/i18n.js.map +1 -1
- package/dist/client/index.d.ts +2 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +2 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/resources/McpIntegrationDialog.d.ts.map +1 -1
- package/dist/client/resources/McpIntegrationDialog.js +12 -31
- package/dist/client/resources/McpIntegrationDialog.js.map +1 -1
- package/dist/client/rich-markdown-editor/SharedRichEditor.d.ts +3 -1
- package/dist/client/rich-markdown-editor/SharedRichEditor.d.ts.map +1 -1
- package/dist/client/rich-markdown-editor/SharedRichEditor.js +2 -1
- package/dist/client/rich-markdown-editor/SharedRichEditor.js.map +1 -1
- package/dist/client/rich-markdown-editor/useCollabReconcile.d.ts +3 -1
- package/dist/client/rich-markdown-editor/useCollabReconcile.d.ts.map +1 -1
- package/dist/client/rich-markdown-editor/useCollabReconcile.js +6 -2
- package/dist/client/rich-markdown-editor/useCollabReconcile.js.map +1 -1
- package/dist/client/settings/SettingsPanel.d.ts +3 -1
- package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
- package/dist/client/settings/SettingsPanel.js +103 -9
- package/dist/client/settings/SettingsPanel.js.map +1 -1
- package/dist/client/settings/SettingsTabsPage.d.ts.map +1 -1
- package/dist/client/settings/SettingsTabsPage.js +5 -5
- package/dist/client/settings/SettingsTabsPage.js.map +1 -1
- package/dist/client/settings/index.d.ts +1 -1
- package/dist/client/settings/index.d.ts.map +1 -1
- package/dist/client/settings/index.js +1 -1
- package/dist/client/settings/index.js.map +1 -1
- package/dist/client/sharing/VisibilityBadge.d.ts +1 -10
- package/dist/client/sharing/VisibilityBadge.d.ts.map +1 -1
- package/dist/client/sharing/VisibilityBadge.js +1 -18
- package/dist/client/sharing/VisibilityBadge.js.map +1 -1
- package/dist/client/use-run-stuck-detection.d.ts +8 -1
- package/dist/client/use-run-stuck-detection.d.ts.map +1 -1
- package/dist/client/use-run-stuck-detection.js +3 -2
- package/dist/client/use-run-stuck-detection.js.map +1 -1
- package/dist/coding-tools/run-code.d.ts +36 -0
- package/dist/coding-tools/run-code.d.ts.map +1 -1
- package/dist/coding-tools/run-code.js +333 -62
- package/dist/coding-tools/run-code.js.map +1 -1
- package/dist/coding-tools/sandbox/background.d.ts +141 -0
- package/dist/coding-tools/sandbox/background.d.ts.map +1 -0
- package/dist/coding-tools/sandbox/background.js +279 -0
- package/dist/coding-tools/sandbox/background.js.map +1 -0
- package/dist/coding-tools/sandbox/executions-store.d.ts +138 -0
- package/dist/coding-tools/sandbox/executions-store.d.ts.map +1 -0
- package/dist/coding-tools/sandbox/executions-store.js +380 -0
- package/dist/coding-tools/sandbox/executions-store.js.map +1 -0
- package/dist/coding-tools/sandbox/index.d.ts +22 -13
- package/dist/coding-tools/sandbox/index.d.ts.map +1 -1
- package/dist/coding-tools/sandbox/index.js +31 -13
- package/dist/coding-tools/sandbox/index.js.map +1 -1
- package/dist/coding-tools/sandbox/local-child-process-adapter.d.ts.map +1 -1
- package/dist/coding-tools/sandbox/local-child-process-adapter.js +61 -4
- package/dist/coding-tools/sandbox/local-child-process-adapter.js.map +1 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/awareness.d.ts.map +1 -1
- package/dist/collab/client.d.ts +16 -12
- package/dist/collab/client.d.ts.map +1 -1
- package/dist/collab/client.js +744 -496
- package/dist/collab/client.js.map +1 -1
- package/dist/collab/presence.d.ts +2 -20
- package/dist/collab/presence.d.ts.map +1 -1
- package/dist/collab/presence.js +3 -0
- package/dist/collab/presence.js.map +1 -1
- package/dist/collab/recent-edits.d.ts +2 -37
- package/dist/collab/recent-edits.d.ts.map +1 -1
- package/dist/collab/recent-edits.js +2 -9
- package/dist/collab/recent-edits.js.map +1 -1
- package/dist/collab/routes.d.ts +2 -2
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/data-programs/actions.d.ts +19 -0
- package/dist/data-programs/actions.d.ts.map +1 -0
- package/dist/data-programs/actions.js +279 -0
- package/dist/data-programs/actions.js.map +1 -0
- package/dist/data-programs/contract.d.ts +70 -0
- package/dist/data-programs/contract.d.ts.map +1 -0
- package/dist/data-programs/contract.js +225 -0
- package/dist/data-programs/contract.js.map +1 -0
- package/dist/data-programs/execute.d.ts +96 -0
- package/dist/data-programs/execute.d.ts.map +1 -0
- package/dist/data-programs/execute.js +454 -0
- package/dist/data-programs/execute.js.map +1 -0
- package/dist/data-programs/index.d.ts +11 -0
- package/dist/data-programs/index.d.ts.map +1 -0
- package/dist/data-programs/index.js +11 -0
- package/dist/data-programs/index.js.map +1 -0
- package/dist/data-programs/schema.d.ts +517 -0
- package/dist/data-programs/schema.d.ts.map +1 -0
- package/dist/data-programs/schema.js +138 -0
- package/dist/data-programs/schema.js.map +1 -0
- package/dist/data-programs/store.d.ts +158 -0
- package/dist/data-programs/store.d.ts.map +1 -0
- package/dist/data-programs/store.js +493 -0
- package/dist/data-programs/store.js.map +1 -0
- package/dist/deploy/build.d.ts.map +1 -1
- package/dist/deploy/build.js +34 -0
- package/dist/deploy/build.js.map +1 -1
- package/dist/extensions/actions.js +2 -2
- package/dist/extensions/actions.js.map +1 -1
- package/dist/file-upload/builder.d.ts.map +1 -1
- package/dist/file-upload/builder.js +9 -0
- package/dist/file-upload/builder.js.map +1 -1
- package/dist/integrations/webhook-handler.d.ts.map +1 -1
- package/dist/integrations/webhook-handler.js +21 -10
- package/dist/integrations/webhook-handler.js.map +1 -1
- package/dist/local-artifacts/index.js +1 -1
- package/dist/local-artifacts/index.js.map +1 -1
- package/dist/localization/default-messages.d.ts +0 -1
- package/dist/localization/default-messages.d.ts.map +1 -1
- package/dist/localization/default-messages.js +1 -2
- package/dist/localization/default-messages.js.map +1 -1
- package/dist/mcp-client/index.d.ts +9 -0
- package/dist/mcp-client/index.d.ts.map +1 -1
- package/dist/mcp-client/index.js +23 -0
- package/dist/mcp-client/index.js.map +1 -1
- package/dist/notifications/routes.d.ts +1 -1
- package/dist/onboarding/default-steps.d.ts.map +1 -1
- package/dist/onboarding/default-steps.js +2 -2
- package/dist/onboarding/default-steps.js.map +1 -1
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/resources/store.d.ts.map +1 -1
- package/dist/resources/store.js +35 -3
- package/dist/resources/store.js.map +1 -1
- package/dist/scripts/agent-engines/list-agent-engines.d.ts.map +1 -1
- package/dist/scripts/agent-engines/list-agent-engines.js +4 -8
- package/dist/scripts/agent-engines/list-agent-engines.js.map +1 -1
- package/dist/scripts/agent-engines/test-agent-engine.d.ts.map +1 -1
- package/dist/scripts/agent-engines/test-agent-engine.js +7 -2
- package/dist/scripts/agent-engines/test-agent-engine.js.map +1 -1
- package/dist/scripts/db/tool-mode.js +3 -3
- package/dist/scripts/db/tool-mode.js.map +1 -1
- package/dist/scripts/resources/migrate-learnings.d.ts +5 -1
- package/dist/scripts/resources/migrate-learnings.d.ts.map +1 -1
- package/dist/scripts/resources/migrate-learnings.js +8 -10
- package/dist/scripts/resources/migrate-learnings.js.map +1 -1
- package/dist/server/action-discovery.d.ts.map +1 -1
- package/dist/server/action-discovery.js +4 -0
- package/dist/server/action-discovery.js.map +1 -1
- package/dist/server/action-routes.d.ts.map +1 -1
- package/dist/server/action-routes.js +8 -2
- package/dist/server/action-routes.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts +20 -6
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +138 -59
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/agent-discovery.d.ts.map +1 -1
- package/dist/server/agent-discovery.js +62 -8
- package/dist/server/agent-discovery.js.map +1 -1
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +75 -3
- package/dist/server/auth.js.map +1 -1
- package/dist/server/builder-design-systems.js +2 -2
- package/dist/server/builder-design-systems.js.map +1 -1
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +100 -20
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/credential-provider.d.ts +6 -3
- package/dist/server/credential-provider.d.ts.map +1 -1
- package/dist/server/credential-provider.js +25 -8
- package/dist/server/credential-provider.js.map +1 -1
- package/dist/server/csrf.d.ts.map +1 -1
- package/dist/server/csrf.js +3 -0
- package/dist/server/csrf.js.map +1 -1
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +1 -0
- package/dist/server/index.js.map +1 -1
- package/dist/server/oauth-helpers.d.ts.map +1 -1
- package/dist/server/oauth-helpers.js +9 -1
- package/dist/server/oauth-helpers.js.map +1 -1
- package/dist/server/onboarding-html.d.ts.map +1 -1
- package/dist/server/onboarding-html.js +80 -48
- package/dist/server/onboarding-html.js.map +1 -1
- package/dist/server/prompts/shared-rules.js +2 -2
- package/dist/server/prompts/shared-rules.js.map +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/server/transcribe-voice.d.ts.map +1 -1
- package/dist/server/transcribe-voice.js +77 -15
- package/dist/server/transcribe-voice.js.map +1 -1
- package/dist/shared/agent-readable-resource.d.ts +29 -0
- package/dist/shared/agent-readable-resource.d.ts.map +1 -0
- package/dist/shared/agent-readable-resource.js +60 -0
- package/dist/shared/agent-readable-resource.js.map +1 -0
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +1 -0
- package/dist/shared/index.js.map +1 -1
- package/dist/sharing/actions/create-agent-resource-link.d.ts +13 -0
- package/dist/sharing/actions/create-agent-resource-link.d.ts.map +1 -0
- package/dist/sharing/actions/create-agent-resource-link.js +72 -0
- package/dist/sharing/actions/create-agent-resource-link.js.map +1 -0
- package/dist/sharing/registry.d.ts +17 -0
- package/dist/sharing/registry.d.ts.map +1 -1
- package/dist/sharing/registry.js.map +1 -1
- package/dist/styles/agent-native.css +57 -45
- package/dist/templates/default/.agents/skills/actions/SKILL.md +55 -0
- package/dist/templates/default/AGENTS.md +11 -14
- package/dist/templates/default/actions/navigate.ts +1 -1
- package/dist/templates/default/app/i18n/ar-SA.ts +0 -1
- package/dist/templates/default/app/i18n/de-DE.ts +0 -1
- package/dist/templates/default/app/i18n/en-US.ts +0 -1
- package/dist/templates/default/app/i18n/es-ES.ts +0 -1
- package/dist/templates/default/app/i18n/fr-FR.ts +0 -1
- package/dist/templates/default/app/i18n/hi-IN.ts +0 -1
- package/dist/templates/default/app/i18n/ja-JP.ts +0 -1
- package/dist/templates/default/app/i18n/ko-KR.ts +0 -1
- package/dist/templates/default/app/i18n/pt-BR.ts +0 -1
- package/dist/templates/default/app/i18n/zh-CN.ts +0 -1
- package/dist/templates/default/app/i18n/zh-TW.ts +0 -1
- package/dist/templates/default/app/routes/settings.tsx +22 -33
- package/dist/templates/headless/.agents/skills/agent-native-docs/SKILL.md +20 -7
- package/dist/templates/headless/AGENTS.md +9 -6
- package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +55 -0
- package/dist/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +92 -0
- package/dist/templates/workspace-core/.agents/skills/data-programs/SKILL.md +128 -0
- package/dist/templates/workspace-core/.agents/skills/harness-agents/SKILL.md +10 -4
- package/dist/vite/agents-bundle-plugin.d.ts.map +1 -1
- package/dist/vite/agents-bundle-plugin.js +26 -1
- package/dist/vite/agents-bundle-plugin.js.map +1 -1
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +12 -0
- package/dist/vite/client.js.map +1 -1
- package/docs/content/agent-native-toolkit.mdx +103 -0
- package/docs/content/cloneable-saas.mdx +19 -19
- package/docs/content/components.mdx +16 -4
- package/docs/content/data-programs.mdx +329 -0
- package/docs/content/deployment.mdx +9 -9
- package/docs/content/extensions.mdx +8 -7
- package/docs/content/generative-ui.mdx +5 -3
- package/docs/content/key-concepts.mdx +6 -9
- package/docs/content/locales/ar-SA/agent-native-toolkit.mdx +103 -0
- package/docs/content/locales/ar-SA/cloneable-saas.mdx +19 -19
- package/docs/content/locales/ar-SA/components.mdx +12 -2
- package/docs/content/locales/ar-SA/data-programs.mdx +329 -0
- package/docs/content/locales/ar-SA/deployment.mdx +8 -9
- package/docs/content/locales/ar-SA/extensions.mdx +6 -4
- package/docs/content/locales/ar-SA/key-concepts.mdx +7 -9
- package/docs/content/locales/ar-SA/real-time-collaboration.mdx +9 -10
- package/docs/content/locales/ar-SA/sharing.mdx +15 -7
- package/docs/content/locales/de-DE/agent-native-toolkit.mdx +103 -0
- package/docs/content/locales/de-DE/cloneable-saas.mdx +19 -19
- package/docs/content/locales/de-DE/components.mdx +12 -2
- package/docs/content/locales/de-DE/data-programs.mdx +329 -0
- package/docs/content/locales/de-DE/deployment.mdx +8 -9
- package/docs/content/locales/de-DE/extensions.mdx +6 -4
- package/docs/content/locales/de-DE/key-concepts.mdx +8 -10
- package/docs/content/locales/de-DE/real-time-collaboration.mdx +9 -10
- package/docs/content/locales/de-DE/sharing.mdx +15 -7
- package/docs/content/locales/es-ES/agent-native-toolkit.mdx +103 -0
- package/docs/content/locales/es-ES/cloneable-saas.mdx +19 -19
- package/docs/content/locales/es-ES/components.mdx +12 -2
- package/docs/content/locales/es-ES/data-programs.mdx +329 -0
- package/docs/content/locales/es-ES/deployment.mdx +8 -9
- package/docs/content/locales/es-ES/extensions.mdx +6 -4
- package/docs/content/locales/es-ES/key-concepts.mdx +8 -10
- package/docs/content/locales/es-ES/real-time-collaboration.mdx +9 -10
- package/docs/content/locales/es-ES/sharing.mdx +15 -7
- package/docs/content/locales/fr-FR/agent-native-toolkit.mdx +103 -0
- package/docs/content/locales/fr-FR/cloneable-saas.mdx +19 -19
- package/docs/content/locales/fr-FR/components.mdx +12 -2
- package/docs/content/locales/fr-FR/data-programs.mdx +329 -0
- package/docs/content/locales/fr-FR/deployment.mdx +8 -9
- package/docs/content/locales/fr-FR/extensions.mdx +6 -4
- package/docs/content/locales/fr-FR/key-concepts.mdx +8 -10
- package/docs/content/locales/fr-FR/real-time-collaboration.mdx +9 -10
- package/docs/content/locales/fr-FR/sharing.mdx +15 -7
- package/docs/content/locales/hi-IN/agent-native-toolkit.mdx +103 -0
- package/docs/content/locales/hi-IN/cloneable-saas.mdx +19 -19
- package/docs/content/locales/hi-IN/components.mdx +20 -10
- package/docs/content/locales/hi-IN/data-programs.mdx +329 -0
- package/docs/content/locales/hi-IN/deployment.mdx +8 -9
- package/docs/content/locales/hi-IN/extensions.mdx +6 -4
- package/docs/content/locales/hi-IN/key-concepts.mdx +8 -10
- package/docs/content/locales/hi-IN/real-time-collaboration.mdx +9 -10
- package/docs/content/locales/hi-IN/sharing.mdx +15 -7
- package/docs/content/locales/ja-JP/agent-native-toolkit.mdx +103 -0
- package/docs/content/locales/ja-JP/cloneable-saas.mdx +19 -19
- package/docs/content/locales/ja-JP/components.mdx +12 -2
- package/docs/content/locales/ja-JP/data-programs.mdx +329 -0
- package/docs/content/locales/ja-JP/deployment.mdx +8 -9
- package/docs/content/locales/ja-JP/extensions.mdx +6 -4
- package/docs/content/locales/ja-JP/key-concepts.mdx +9 -11
- package/docs/content/locales/ja-JP/real-time-collaboration.mdx +9 -10
- package/docs/content/locales/ja-JP/sharing.mdx +15 -7
- package/docs/content/locales/ko-KR/agent-native-toolkit.mdx +103 -0
- package/docs/content/locales/ko-KR/cloneable-saas.mdx +19 -19
- package/docs/content/locales/ko-KR/components.mdx +20 -10
- package/docs/content/locales/ko-KR/data-programs.mdx +329 -0
- package/docs/content/locales/ko-KR/deployment.mdx +8 -9
- package/docs/content/locales/ko-KR/extensions.mdx +16 -14
- package/docs/content/locales/ko-KR/key-concepts.mdx +9 -11
- package/docs/content/locales/ko-KR/real-time-collaboration.mdx +9 -10
- package/docs/content/locales/ko-KR/sharing.mdx +15 -7
- package/docs/content/locales/pt-BR/agent-native-toolkit.mdx +103 -0
- package/docs/content/locales/pt-BR/cloneable-saas.mdx +19 -19
- package/docs/content/locales/pt-BR/components.mdx +12 -2
- package/docs/content/locales/pt-BR/data-programs.mdx +329 -0
- package/docs/content/locales/pt-BR/deployment.mdx +8 -9
- package/docs/content/locales/pt-BR/extensions.mdx +6 -4
- package/docs/content/locales/pt-BR/key-concepts.mdx +8 -11
- package/docs/content/locales/pt-BR/real-time-collaboration.mdx +9 -10
- package/docs/content/locales/pt-BR/sharing.mdx +15 -7
- package/docs/content/locales/zh-CN/agent-native-toolkit.mdx +103 -0
- package/docs/content/locales/zh-CN/cloneable-saas.mdx +19 -19
- package/docs/content/locales/zh-CN/components.mdx +20 -10
- package/docs/content/locales/zh-CN/data-programs.mdx +329 -0
- package/docs/content/locales/zh-CN/deployment.mdx +7 -9
- package/docs/content/locales/zh-CN/extensions.mdx +16 -14
- package/docs/content/locales/zh-CN/key-concepts.mdx +7 -11
- package/docs/content/locales/zh-CN/real-time-collaboration.mdx +10 -11
- package/docs/content/locales/zh-CN/sharing.mdx +15 -7
- package/docs/content/locales/zh-TW/agent-native-toolkit.mdx +103 -0
- package/docs/content/locales/zh-TW/cloneable-saas.mdx +19 -19
- package/docs/content/locales/zh-TW/components.mdx +20 -10
- package/docs/content/locales/zh-TW/data-programs.mdx +329 -0
- package/docs/content/locales/zh-TW/deployment.mdx +7 -9
- package/docs/content/locales/zh-TW/extensions.mdx +16 -14
- package/docs/content/locales/zh-TW/key-concepts.mdx +7 -11
- package/docs/content/locales/zh-TW/real-time-collaboration.mdx +10 -11
- package/docs/content/locales/zh-TW/sharing.mdx +15 -7
- package/docs/content/real-time-collaboration.mdx +10 -11
- package/docs/content/sharing.mdx +39 -7
- package/docs/content/toolkit-app-adapters.mdx +46 -0
- package/docs/content/toolkit-collaboration-ui.mdx +48 -0
- package/docs/content/toolkit-sharing-ui.mdx +33 -0
- package/docs/content/toolkit-shell-hooks.mdx +27 -0
- package/docs/content/toolkit-ui.mdx +69 -0
- package/package.json +7 -2
- package/src/templates/default/.agents/skills/actions/SKILL.md +55 -0
- package/src/templates/default/AGENTS.md +11 -14
- package/src/templates/default/actions/navigate.spec.ts +53 -0
- package/src/templates/default/actions/navigate.ts +1 -1
- package/src/templates/default/app/i18n/ar-SA.ts +0 -1
- package/src/templates/default/app/i18n/de-DE.ts +0 -1
- package/src/templates/default/app/i18n/en-US.ts +0 -1
- package/src/templates/default/app/i18n/es-ES.ts +0 -1
- package/src/templates/default/app/i18n/fr-FR.ts +0 -1
- package/src/templates/default/app/i18n/hi-IN.ts +0 -1
- package/src/templates/default/app/i18n/ja-JP.ts +0 -1
- package/src/templates/default/app/i18n/ko-KR.ts +0 -1
- package/src/templates/default/app/i18n/pt-BR.ts +0 -1
- package/src/templates/default/app/i18n/zh-CN.ts +0 -1
- package/src/templates/default/app/i18n/zh-TW.ts +0 -1
- package/src/templates/default/app/routes/settings.tsx +22 -33
- package/src/templates/headless/.agents/skills/agent-native-docs/SKILL.md +20 -7
- package/src/templates/headless/AGENTS.md +9 -6
- package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +55 -0
- package/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +92 -0
- package/src/templates/workspace-core/.agents/skills/data-programs/SKILL.md +128 -0
- package/src/templates/workspace-core/.agents/skills/harness-agents/SKILL.md +10 -4
- package/corpus/templates/design/server/lib/figma-import/clipboard.ts +0 -122
- package/corpus/templates/design/server/lib/figma-import/decode.ts +0 -455
- package/corpus/templates/design/server/lib/figma-import/processor.ts +0 -116
- package/corpus/templates/design/server/lib/figma-import/render-html.ts +0 -397
- package/corpus/templates/design/server/lib/figma-import/types.ts +0 -60
|
@@ -0,0 +1,1435 @@
|
|
|
1
|
+
import type { PlanAnnotationAnchor } from "@/lib/plan-native-anchors";
|
|
2
|
+
|
|
3
|
+
export type PreferredEditor =
|
|
4
|
+
| "vscode"
|
|
5
|
+
| "cursor"
|
|
6
|
+
| "finder"
|
|
7
|
+
| "terminal"
|
|
8
|
+
| "ghostty"
|
|
9
|
+
| "xcode";
|
|
10
|
+
|
|
11
|
+
export const PREFERRED_EDITOR_STORAGE_KEY =
|
|
12
|
+
"agent-native-plans.preferredEditor";
|
|
13
|
+
export const DESKTOP_PLAN_SYNC_AUTO_KEY_PREFIX =
|
|
14
|
+
"agent-native-plans.desktopSync.auto.";
|
|
15
|
+
export const PREFERRED_EDITOR_VALUES: PreferredEditor[] = [
|
|
16
|
+
"vscode",
|
|
17
|
+
"cursor",
|
|
18
|
+
"finder",
|
|
19
|
+
"terminal",
|
|
20
|
+
"ghostty",
|
|
21
|
+
"xcode",
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
const EDITOR_OPTIONS: Array<{ value: PreferredEditor; label: string }> = [
|
|
25
|
+
{ value: "vscode", label: "VS Code" }, // i18n-ignore stable app name
|
|
26
|
+
{ value: "cursor", label: "Cursor" }, // i18n-ignore stable app name
|
|
27
|
+
{ value: "finder", label: "Finder" }, // i18n-ignore stable app name
|
|
28
|
+
{ value: "terminal", label: "Terminal" }, // i18n-ignore stable app name
|
|
29
|
+
{ value: "ghostty", label: "Ghostty" }, // i18n-ignore stable app name
|
|
30
|
+
{ value: "xcode", label: "Xcode" }, // i18n-ignore stable app name
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
const EDITOR_ICON_HTML: Record<PreferredEditor, string> = {
|
|
34
|
+
vscode: `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-brand-vscode" aria-hidden="true"><path d="M16 3v18l4 -2.5v-13l-4 -2.5"></path><path d="M9.165 13.903l-4.165 3.597l-2 -1l4.333 -4.5m1.735 -1.802l6.932 -7.198v5l-4.795 4.141"></path><path d="M16 16.5l-11 -10l-2 1l13 13.5"></path></svg>`, // i18n-ignore inline SVG icon markup
|
|
35
|
+
cursor: `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-cube" aria-hidden="true"><path d="M21 16.008v-8.018a1.98 1.98 0 0 0 -1 -1.717l-7 -4.008a2.016 2.016 0 0 0 -2 0l-7 4.008c-.619 .355 -1 1.01 -1 1.718v8.018c0 .709 .381 1.363 1 1.717l7 4.008a2.016 2.016 0 0 0 2 0l7 -4.008c.619 -.355 1 -1.01 1 -1.718"></path><path d="M12 22v-10"></path><path d="M12 12l8.73 -5.04"></path><path d="M3.27 6.96l8.73 5.04"></path></svg>`, // i18n-ignore inline SVG icon markup
|
|
36
|
+
finder: `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-brand-finder" aria-hidden="true"><path d="M3 5a1 1 0 0 1 1 -1h16a1 1 0 0 1 1 1v14a1 1 0 0 1 -1 1h-16a1 1 0 0 1 -1 -1l0 -14"></path><path d="M7 8v1"></path><path d="M17 8v1"></path><path d="M12.5 4c-.654 1.486 -1.26 3.443 -1.5 9h2.5c-.19 2.867 .094 5.024 .5 7"></path><path d="M7 15.5c3.667 2 6.333 2 10 0"></path></svg>`, // i18n-ignore inline SVG icon markup
|
|
37
|
+
terminal: `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-terminal-2" aria-hidden="true"><path d="M8 9l3 3l-3 3"></path><path d="M13 15l3 0"></path><path d="M3 6a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2l0 -12"></path></svg>`, // i18n-ignore inline SVG icon markup
|
|
38
|
+
ghostty: `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-ghost-3" aria-hidden="true"><path d="M5 11a7 7 0 0 1 14 0v7a1.78 1.78 0 0 1 -3.1 1.4a1.65 1.65 0 0 0 -2.6 0a1.65 1.65 0 0 1 -2.6 0a1.65 1.65 0 0 0 -2.6 0a1.78 1.78 0 0 1 -3.1 -1.4v-7"></path><path d="M10 10h.01"></path><path d="M14 10h.01"></path></svg>`, // i18n-ignore inline SVG icon markup
|
|
39
|
+
xcode: `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-hammer" aria-hidden="true"><path d="M11.414 10l-7.383 7.418a2.091 2.091 0 0 0 0 2.967a2.11 2.11 0 0 0 2.976 0l7.407 -7.385"></path><path d="M18.121 15.293l2.586 -2.586a1 1 0 0 0 0 -1.414l-7.586 -7.586a1 1 0 0 0 -1.414 0l-2.586 2.586a1 1 0 0 0 0 1.414l7.586 7.586a1 1 0 0 0 1.414 0"></path></svg>`, // i18n-ignore inline SVG icon markup
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export type RuntimeAnnotation = {
|
|
43
|
+
id: string;
|
|
44
|
+
index: number;
|
|
45
|
+
message: string;
|
|
46
|
+
kind: string;
|
|
47
|
+
status: string;
|
|
48
|
+
createdBy: string;
|
|
49
|
+
parentCommentId?: string | null;
|
|
50
|
+
authorEmail?: string | null;
|
|
51
|
+
authorName?: string | null;
|
|
52
|
+
authorAvatarUrl?: string | null;
|
|
53
|
+
authorColor?: string | null;
|
|
54
|
+
authorInitials?: string | null;
|
|
55
|
+
sectionId?: string | null;
|
|
56
|
+
createdAt?: string;
|
|
57
|
+
anchor: PlanAnnotationAnchor;
|
|
58
|
+
replies: RuntimeAnnotationComment[];
|
|
59
|
+
participants: RuntimeAnnotationParticipant[];
|
|
60
|
+
commentCount: number;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export type RuntimeAnnotationComment = {
|
|
64
|
+
id: string;
|
|
65
|
+
message: string;
|
|
66
|
+
status: string;
|
|
67
|
+
createdBy: string;
|
|
68
|
+
parentCommentId?: string | null;
|
|
69
|
+
authorEmail?: string | null;
|
|
70
|
+
authorName?: string | null;
|
|
71
|
+
authorAvatarUrl?: string | null;
|
|
72
|
+
authorColor?: string | null;
|
|
73
|
+
authorInitials?: string | null;
|
|
74
|
+
createdAt?: string;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export type RuntimeAnnotationParticipant = {
|
|
78
|
+
id: string;
|
|
79
|
+
authorEmail?: string | null;
|
|
80
|
+
authorName?: string | null;
|
|
81
|
+
authorAvatarUrl?: string | null;
|
|
82
|
+
authorColor?: string | null;
|
|
83
|
+
authorInitials?: string | null;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export function injectAnnotationRuntime(input: {
|
|
87
|
+
html: string;
|
|
88
|
+
annotations: RuntimeAnnotation[];
|
|
89
|
+
annotateMode: boolean;
|
|
90
|
+
theme: "dark" | "light";
|
|
91
|
+
preferredEditor: PreferredEditor;
|
|
92
|
+
labels: {
|
|
93
|
+
closeCodePreview: string;
|
|
94
|
+
};
|
|
95
|
+
}) {
|
|
96
|
+
const { html, annotations, annotateMode, theme, preferredEditor, labels } =
|
|
97
|
+
input;
|
|
98
|
+
const payload = JSON.stringify({
|
|
99
|
+
annotateMode,
|
|
100
|
+
annotations,
|
|
101
|
+
theme,
|
|
102
|
+
preferredEditor,
|
|
103
|
+
}).replace(/[<>&\u2028\u2029]/g, (char) => {
|
|
104
|
+
return (
|
|
105
|
+
{
|
|
106
|
+
"<": "\\u003c",
|
|
107
|
+
">": "\\u003e",
|
|
108
|
+
"&": "\\u0026",
|
|
109
|
+
"\u2028": "\\u2028",
|
|
110
|
+
"\u2029": "\\u2029",
|
|
111
|
+
}[char] ?? char
|
|
112
|
+
);
|
|
113
|
+
});
|
|
114
|
+
const editorOptionsPayload = JSON.stringify(EDITOR_OPTIONS).replace(
|
|
115
|
+
/[<>&\u2028\u2029]/g,
|
|
116
|
+
(char) => {
|
|
117
|
+
return (
|
|
118
|
+
{
|
|
119
|
+
"<": "\\u003c",
|
|
120
|
+
">": "\\u003e",
|
|
121
|
+
"&": "\\u0026",
|
|
122
|
+
"\u2028": "\\u2028",
|
|
123
|
+
"\u2029": "\\u2029",
|
|
124
|
+
}[char] ?? char
|
|
125
|
+
);
|
|
126
|
+
},
|
|
127
|
+
);
|
|
128
|
+
const editorIconPayload = JSON.stringify(EDITOR_ICON_HTML).replace(
|
|
129
|
+
/[<>&\u2028\u2029]/g,
|
|
130
|
+
(char) => {
|
|
131
|
+
return (
|
|
132
|
+
{
|
|
133
|
+
"<": "\\u003c",
|
|
134
|
+
">": "\\u003e",
|
|
135
|
+
"&": "\\u0026",
|
|
136
|
+
"\u2028": "\\u2028",
|
|
137
|
+
"\u2029": "\\u2029",
|
|
138
|
+
}[char] ?? char
|
|
139
|
+
);
|
|
140
|
+
},
|
|
141
|
+
);
|
|
142
|
+
const closeCodePreviewLabel = escapeRuntimeJsString(labels.closeCodePreview);
|
|
143
|
+
const runtime = `<style>
|
|
144
|
+
:root[data-agent-native-theme="light"] {
|
|
145
|
+
color-scheme: light;
|
|
146
|
+
--bg: #f7f7f4;
|
|
147
|
+
--paper: #ffffff;
|
|
148
|
+
--paper-2: #f3f3ef;
|
|
149
|
+
--paper-3: #e9e9e3;
|
|
150
|
+
--line: #dadad2;
|
|
151
|
+
--line-soft: #e8e8e2;
|
|
152
|
+
--text: #171717;
|
|
153
|
+
--soft: #4b4b4b;
|
|
154
|
+
--muted: #70706c;
|
|
155
|
+
--faint: #999992;
|
|
156
|
+
--accent: #00B5FF;
|
|
157
|
+
--accent-soft: rgba(0, 181, 255, .11);
|
|
158
|
+
--shadow: 0 24px 70px rgba(29, 29, 24, .08);
|
|
159
|
+
}
|
|
160
|
+
:root[data-agent-native-theme="light"] body { background: var(--bg) !important; color: var(--text) !important; }
|
|
161
|
+
:root[data-agent-native-theme="light"] code { background: #eeeeea !important; color: #242424 !important; }
|
|
162
|
+
:root[data-agent-native-theme] pre code,
|
|
163
|
+
:root[data-agent-native-theme] pre code * { background: transparent !important; background-image: none !important; box-shadow: none !important; }
|
|
164
|
+
:root[data-agent-native-theme="light"] .mock-plan,
|
|
165
|
+
:root[data-agent-native-theme="light"] .mock-sidebar,
|
|
166
|
+
:root[data-agent-native-theme="light"] .diagram-card,
|
|
167
|
+
:root[data-agent-native-theme="light"] .mock-browser { background-color: #ffffff !important; }
|
|
168
|
+
:root[data-agent-native-theme="light"] .floating-tools,
|
|
169
|
+
:root[data-agent-native-theme="light"] .product-screen,
|
|
170
|
+
:root[data-agent-native-theme="light"] .comment-screen,
|
|
171
|
+
:root[data-agent-native-theme="light"] .annotation-card,
|
|
172
|
+
:root[data-agent-native-theme="light"] .inline-comment,
|
|
173
|
+
:root[data-agent-native-theme="light"] .panel { background-color: #f5f5f1 !important; }
|
|
174
|
+
:root[data-agent-native-theme="light"] .doc-title,
|
|
175
|
+
:root[data-agent-native-theme="light"] .tool.primary,
|
|
176
|
+
:root[data-agent-native-theme="light"] .pin { background: #171717 !important; color: #ffffff !important; }
|
|
177
|
+
:root[data-agent-native-theme="light"] .doc-line,
|
|
178
|
+
:root[data-agent-native-theme="light"] .panel i,
|
|
179
|
+
:root[data-agent-native-theme="light"] .pill { background: #d8d8d2 !important; }
|
|
180
|
+
::selection { background: rgba(0,181,255,.32); }
|
|
181
|
+
.an-plan-annotating, .an-plan-annotating * { cursor: crosshair !important; }
|
|
182
|
+
.an-plan-annotation-layer { position: absolute; inset: 0; z-index: 2147483000; pointer-events: none; }
|
|
183
|
+
.an-plan-marker { position: absolute; transform: translate(-50%, -50%); min-width: 30px; height: 30px; overflow: visible; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; background: rgba(23,23,25,.86); color: #fff; font: 800 10px/1 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; display: inline-flex; align-items: center; justify-content: center; gap: 3px; box-shadow: 0 10px 28px rgba(0,0,0,.36); pointer-events: auto; padding: 2px 6px 2px 2px; }
|
|
184
|
+
.an-plan-marker[data-single="true"] { width: 30px; min-width: 30px; padding: 0; border: 2px solid var(--paper, #111113); background: var(--author-color, #00B5FF); overflow: hidden; }
|
|
185
|
+
.an-plan-marker-stack { display: inline-flex; align-items: center; flex: 0 0 auto; }
|
|
186
|
+
.an-plan-marker-face { width: 26px; height: 26px; margin-left: -7px; overflow: hidden; border: 2px solid var(--paper, #111113); border-radius: 999px; background: var(--author-color, #00B5FF); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
|
|
187
|
+
.an-plan-marker-face:first-child { margin-left: 0; }
|
|
188
|
+
.an-plan-marker[data-single="true"] .an-plan-marker-face { width: 28px; height: 28px; margin-left: 0; border: 0; }
|
|
189
|
+
.an-plan-marker-avatar { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; display: block; }
|
|
190
|
+
.an-plan-marker-initials { width: 100%; height: 100%; border-radius: inherit; background: var(--author-color, #00B5FF); color: #fff; display: inline-flex; align-items: center; justify-content: center; letter-spacing: 0; }
|
|
191
|
+
.an-plan-marker-count { min-width: 13px; padding: 0 2px; color: rgba(255,255,255,.94); font-size: 11px; line-height: 1; }
|
|
192
|
+
.an-plan-marker[hidden] { display: none !important; }
|
|
193
|
+
.an-plan-marker[data-status="resolved"] { opacity: .46; }
|
|
194
|
+
.an-plan-selection-toolbar { position: absolute; z-index: 2147483001; display: none; align-items: center; gap: 4px; border: 1px solid rgba(255,255,255,.16); border-radius: 14px; background: rgba(16,16,18,.96); padding: 5px; box-shadow: 0 14px 42px rgba(0,0,0,.34); backdrop-filter: blur(16px); }
|
|
195
|
+
:root[data-agent-native-theme="light"] .an-plan-selection-toolbar { border-color: rgba(0,0,0,.12); background: rgba(255,255,255,.97); box-shadow: 0 14px 42px rgba(29,29,24,.13); }
|
|
196
|
+
.an-plan-selection-toolbar button { height: 34px; display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 10px; background: transparent; color: var(--text); padding: 0 11px; font: 650 13px/1 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; cursor: pointer; }
|
|
197
|
+
.an-plan-selection-toolbar button:hover { background: rgba(255,255,255,.08); }
|
|
198
|
+
:root[data-agent-native-theme="light"] .an-plan-selection-toolbar button:hover { background: rgba(0,0,0,.06); }
|
|
199
|
+
.an-plan-selection-toolbar svg { width: 17px; height: 17px; color: #00B5FF; }
|
|
200
|
+
.an-plan-code-popover { position: absolute; z-index: 2147483001; width: min(760px, calc(100vw - 24px)); max-height: min(520px, calc(100vh - 24px)); overflow: hidden; border: 1px solid rgba(255,255,255,.16); border-radius: 16px; background: rgba(16,16,18,.98); box-shadow: 0 24px 70px rgba(0,0,0,.42); backdrop-filter: blur(18px); }
|
|
201
|
+
:root[data-agent-native-theme="light"] .an-plan-code-popover { border-color: rgba(0,0,0,.12); background: rgba(255,255,255,.98); box-shadow: 0 24px 70px rgba(29,29,24,.16); }
|
|
202
|
+
.an-plan-code-popover-header { display: flex; min-height: 46px; align-items: center; gap: 12px; border-bottom: 1px solid var(--line, rgba(255,255,255,.12)); padding: 7px 9px 7px 14px; color: var(--muted, #a4a4aa); font: 650 12px/1.3 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
|
|
203
|
+
.an-plan-code-popover-title { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text, #f4f4f5); font: 650 13px/1.3 "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
|
|
204
|
+
.an-plan-code-popover-actions { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
|
|
205
|
+
.an-plan-code-popover-close { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: transparent; color: inherit; cursor: pointer; font-size: 18px; }
|
|
206
|
+
.an-plan-code-popover-close:hover { background: rgba(255,255,255,.08); color: var(--text, #f4f4f5); }
|
|
207
|
+
:root[data-agent-native-theme="light"] .an-plan-code-popover-close:hover { background: rgba(0,0,0,.06); }
|
|
208
|
+
.an-plan-code-popover .code-preview-title { display: none !important; }
|
|
209
|
+
.an-plan-code-popover .code-preview { border: 0 !important; background: transparent !important; box-shadow: none !important; }
|
|
210
|
+
.an-plan-code-popover .code-preview pre { margin: 0 !important; max-height: 474px; overflow: auto; padding: 14px 16px !important; background: #0c0c0e !important; color: #e9e9ea; font: 12px/1.65 "SFMono-Regular", Consolas, "Liberation Mono", monospace !important; tab-size: 2; }
|
|
211
|
+
.an-plan-code-popover .code-preview pre code { display: block !important; min-width: max-content; border: 0 !important; background: transparent !important; color: inherit !important; font: inherit !important; padding: 0 !important; white-space: pre !important; }
|
|
212
|
+
.an-plan-code-popover .code-preview pre code * { margin: 0 !important; border: 0 !important; border-radius: 0 !important; outline: 0 !important; background: transparent !important; background-image: none !important; box-shadow: none !important; padding: 0 !important; text-decoration: none !important; font: inherit !important; }
|
|
213
|
+
.an-plan-code-popover .code-preview pre code code { display: inline !important; }
|
|
214
|
+
.editor-picker { position: relative; display: inline-flex; min-height: 32px; align-items: stretch; overflow: visible; border: 1px solid var(--line, rgba(255,255,255,.14)); border-radius: 8px; background: transparent; }
|
|
215
|
+
.editor-picker:focus-within, .editor-picker:hover { border-color: rgba(0,181,255,.44); background: rgba(0,181,255,.06); }
|
|
216
|
+
.editor-picker button { min-height: 30px; border: 0; border-radius: 0; background: transparent; color: var(--soft, #d4d4d8); padding: 0 10px; font: 650 12px/30px ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; cursor: pointer; }
|
|
217
|
+
.editor-picker button:hover { color: var(--text, #f4f4f5); background: rgba(255,255,255,.05); }
|
|
218
|
+
.editor-picker-trigger { display: inline-flex; width: 48px; align-items: center; justify-content: center; gap: 6px; border-right: 1px solid var(--line, rgba(255,255,255,.14)) !important; border-radius: 7px 0 0 7px !important; }
|
|
219
|
+
.editor-picker-open { border-radius: 0 7px 7px 0 !important; color: var(--text, #f4f4f5) !important; }
|
|
220
|
+
.editor-picker-select { display: none; }
|
|
221
|
+
.editor-picker-caret { width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-1px) rotate(45deg); opacity: .72; }
|
|
222
|
+
.editor-picker-menu { position: absolute; top: calc(100% + 7px); right: 0; z-index: 2147483002; display: none; width: 188px; border: 1px solid var(--line, rgba(255,255,255,.14)); border-radius: 12px; background: var(--paper, #111113); padding: 6px; box-shadow: 0 18px 50px rgba(0,0,0,.32); }
|
|
223
|
+
.editor-picker[data-open="true"] .editor-picker-menu { display: grid; gap: 2px; }
|
|
224
|
+
.editor-picker-option { display: flex !important; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; border-radius: 8px !important; text-align: left; }
|
|
225
|
+
.editor-picker-option:hover, .editor-picker-option.is-active { background: rgba(255,255,255,.06); color: var(--text, #f4f4f5); }
|
|
226
|
+
.editor-icon { display: inline-flex; width: 18px; height: 18px; flex: 0 0 auto; align-items: center; justify-content: center; }
|
|
227
|
+
.editor-icon svg { width: 18px; height: 18px; stroke-width: 2; }
|
|
228
|
+
.editor-icon-vscode { color: #41a6f6; }
|
|
229
|
+
.editor-icon-cursor { color: var(--text, #f4f4f5); }
|
|
230
|
+
.editor-icon-finder { color: #4aa9ff; }
|
|
231
|
+
.editor-icon-terminal { color: #73d99f; }
|
|
232
|
+
.editor-icon-ghostty { color: #a78bfa; }
|
|
233
|
+
.editor-icon-xcode { color: #54a7ff; }
|
|
234
|
+
.editor-picker-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
|
|
235
|
+
:root[data-agent-native-theme="light"] .editor-picker button { color: var(--soft, #4b4b4b); }
|
|
236
|
+
:root[data-agent-native-theme="light"] .editor-picker button:hover, :root[data-agent-native-theme="light"] .editor-picker-option.is-active { background: rgba(0,0,0,.06); color: var(--text, #171717); }
|
|
237
|
+
:root[data-agent-native-theme="light"] .editor-picker-menu { background: var(--paper, #ffffff); box-shadow: 0 18px 50px rgba(29,29,24,.13); }
|
|
238
|
+
.visual-tabs[data-plan-tabs] { display: grid; gap: 14px; }
|
|
239
|
+
.visual-tabs[data-plan-tabs] .tab-list { display: inline-flex; width: fit-content; max-width: 100%; gap: 8px; border: 0; border-radius: 0; background: transparent; padding: 0; overflow-x: auto; }
|
|
240
|
+
.visual-tabs[data-plan-tabs] .tab-button { min-height: 30px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--muted, #a4a4aa); padding: 0 11px; font: 650 12px/30px ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; white-space: nowrap; cursor: pointer; }
|
|
241
|
+
.visual-tabs[data-plan-tabs] .tab-button:hover { color: var(--text, #f4f4f5); background: rgba(255,255,255,.05); }
|
|
242
|
+
.visual-tabs[data-plan-tabs] .tab-button.is-active { border-color: var(--text, #f4f4f5); background: transparent; color: var(--text, #f4f4f5); }
|
|
243
|
+
.visual-tabs[data-plan-tabs] .tab-button.is-active:hover { background: transparent; color: var(--text, #f4f4f5); }
|
|
244
|
+
:root[data-agent-native-theme="light"] .visual-tabs[data-plan-tabs] .tab-button:hover { background: rgba(0,0,0,.06); }
|
|
245
|
+
:root[data-agent-native-theme="light"] .visual-tabs[data-plan-tabs] .tab-button.is-active:hover { background: transparent; color: var(--text, #171717); }
|
|
246
|
+
.visual-tabs[data-plan-tabs] .tab-panel { display: none; }
|
|
247
|
+
.visual-tabs[data-plan-tabs] .tab-panel.is-active { display: block; }
|
|
248
|
+
.implementation-map { margin: 24px 0; border-top: 1px solid var(--line, rgba(255,255,255,.14)); }
|
|
249
|
+
.implementation-map-header { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; color: var(--muted, #a4a4aa); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
|
|
250
|
+
.implementation-file-tabs { min-height: 330px; display: grid; grid-template-columns: minmax(220px, .44fr) minmax(0, 1fr); border-top: 1px solid var(--line, rgba(255,255,255,.14)); border-bottom: 1px solid var(--line, rgba(255,255,255,.14)); }
|
|
251
|
+
.implementation-file-list { display: grid; align-content: start; border-right: 1px solid var(--line, rgba(255,255,255,.14)); }
|
|
252
|
+
.implementation-file-tab { width: 100%; display: grid; gap: 3px; border: 0; border-bottom: 1px solid var(--line, rgba(255,255,255,.14)); background: transparent; color: var(--muted, #a4a4aa); padding: 13px 14px; text-align: left; cursor: pointer; }
|
|
253
|
+
.implementation-file-tab:hover { background: rgba(255,255,255,.035); color: var(--soft, #d4d4d8); }
|
|
254
|
+
.implementation-file-tab.is-active { background: var(--paper-2, rgba(255,255,255,.04)); color: var(--text, #f4f4f5); box-shadow: inset 2px 0 0 var(--accent, #00B5FF); }
|
|
255
|
+
.file-tab-name, .file-tab-path { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
256
|
+
.file-tab-name { font: 700 14px/1.35 "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
|
|
257
|
+
.file-tab-path { font: 500 12px/1.35 "SFMono-Regular", Consolas, "Liberation Mono", monospace; color: var(--muted, #a4a4aa); }
|
|
258
|
+
.implementation-file-tab.is-active .file-tab-path { color: var(--soft, #d4d4d8); }
|
|
259
|
+
.implementation-file-panels { min-width: 0; }
|
|
260
|
+
.implementation-file-panel { display: none; min-height: 100%; padding: 18px 20px 20px; border: 0 !important; }
|
|
261
|
+
.implementation-file-panel.is-active { display: block; }
|
|
262
|
+
.file-detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line, rgba(255,255,255,.14)); }
|
|
263
|
+
.file-title-stack { min-width: 0; display: grid; gap: 5px; }
|
|
264
|
+
.file-name { margin: 0; color: var(--text, #f4f4f5); font: 750 18px/1.25 "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
|
|
265
|
+
.file-path { margin: 0; overflow-wrap: anywhere; color: var(--muted, #a4a4aa); font: 500 12px/1.45 "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
|
|
266
|
+
.file-detail-body { padding-top: 16px; }
|
|
267
|
+
.file-summary { max-width: 760px; margin: 0; color: var(--soft, #d4d4d8); font-size: 15px; }
|
|
268
|
+
.inline-code-preview { margin-top: 18px; overflow: hidden; border: 1px solid var(--line, rgba(255,255,255,.14)); border-radius: 10px; background: #0c0c0e; }
|
|
269
|
+
.code-preview pre, .inline-code-preview pre { margin: 0 !important; max-height: 420px; overflow: auto; padding: 14px 16px !important; background: #0c0c0e !important; color: #e9e9ea; font: 12px/1.65 "SFMono-Regular", Consolas, "Liberation Mono", monospace !important; tab-size: 2; }
|
|
270
|
+
.code-preview pre code, .inline-code-preview pre code { display: block !important; min-width: max-content; border: 0 !important; background: transparent !important; color: inherit !important; font: inherit !important; padding: 0 !important; white-space: pre !important; }
|
|
271
|
+
.code-preview pre code *, .inline-code-preview pre code * { margin: 0 !important; border: 0 !important; border-radius: 0 !important; outline: 0 !important; background: transparent !important; background-image: none !important; box-shadow: none !important; padding: 0 !important; text-decoration: none !important; font: inherit !important; }
|
|
272
|
+
.code-preview pre code code, .inline-code-preview pre code code { display: inline !important; }
|
|
273
|
+
.syntax-keyword { color: #7cc7ff; }
|
|
274
|
+
.syntax-string { color: #a6e3a1; }
|
|
275
|
+
.syntax-literal { color: #c4b5fd; }
|
|
276
|
+
.syntax-comment { color: #7a7a83; }
|
|
277
|
+
.file-actions { display: flex; align-items: flex-start; gap: 8px; }
|
|
278
|
+
@media (max-width: 760px) { .implementation-file-tabs { grid-template-columns: 1fr; } .implementation-file-list { border-right: 0; } .implementation-file-panels { border-top: 1px solid var(--line, rgba(255,255,255,.14)); } .implementation-map-header, .file-detail-header, .file-actions { flex-wrap: wrap; } }
|
|
279
|
+
</style><script>
|
|
280
|
+
(() => {
|
|
281
|
+
const state = ${payload};
|
|
282
|
+
const editorOptions = ${editorOptionsPayload};
|
|
283
|
+
const editorIconMap = ${editorIconPayload};
|
|
284
|
+
const root = document.documentElement;
|
|
285
|
+
root.dataset.agentNativeTheme = state.theme || "dark";
|
|
286
|
+
if (state.annotateMode) root.classList.add("an-plan-annotating");
|
|
287
|
+
function removeEmptyPlanSections() {
|
|
288
|
+
const candidates = Array.from(document.querySelectorAll("section[data-plan-section-id], section.plan-section, section[id]"));
|
|
289
|
+
for (const section of candidates) {
|
|
290
|
+
const text = (section.textContent || "").replace(/\\s+/g, " ").trim();
|
|
291
|
+
const hasMedia = Boolean(section.querySelector("img,svg,canvas,video,iframe,table,pre,code,template,.visual,.flow-diagram,.wireframe-shell,.implementation-map,[data-plan-tabs],[data-agent-native-code-preview]"));
|
|
292
|
+
if (!text && !hasMedia) section.remove();
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
function initializePlanTabs() {
|
|
296
|
+
const tabsets = Array.from(document.querySelectorAll("[data-plan-tabs]"));
|
|
297
|
+
for (const tabset of tabsets) {
|
|
298
|
+
const buttons = Array.from(tabset.querySelectorAll("[data-tab-target]"));
|
|
299
|
+
const panels = Array.from(tabset.querySelectorAll("[data-tab-panel]"));
|
|
300
|
+
if (buttons.length === 0 || panels.length === 0) continue;
|
|
301
|
+
const activate = (target, notify = true) => {
|
|
302
|
+
for (const button of buttons) {
|
|
303
|
+
const isActive = button.getAttribute("data-tab-target") === target;
|
|
304
|
+
button.classList.toggle("is-active", isActive);
|
|
305
|
+
button.setAttribute("aria-selected", String(isActive));
|
|
306
|
+
}
|
|
307
|
+
for (const panel of panels) {
|
|
308
|
+
panel.classList.toggle("is-active", panel.getAttribute("data-tab-panel") === target);
|
|
309
|
+
}
|
|
310
|
+
requestAnimationFrame(syncAnnotationMarkers);
|
|
311
|
+
if (notify) {
|
|
312
|
+
window.parent.postMessage({ type: "agent-native-plan-close-comment-popover" }, "*");
|
|
313
|
+
}
|
|
314
|
+
postDocState();
|
|
315
|
+
};
|
|
316
|
+
for (const button of buttons) {
|
|
317
|
+
button.setAttribute("role", "tab");
|
|
318
|
+
button.addEventListener("click", (event) => {
|
|
319
|
+
event.preventDefault();
|
|
320
|
+
event.stopPropagation();
|
|
321
|
+
activate(button.getAttribute("data-tab-target") || "");
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
for (const panel of panels) panel.setAttribute("role", "tabpanel");
|
|
325
|
+
const initial = buttons.find((button) => button.classList.contains("is-active")) || buttons[0];
|
|
326
|
+
activate(initial.getAttribute("data-tab-target") || "", false);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
function displayFilePath(rawPath) {
|
|
330
|
+
return String(rawPath || "").replace(/\\s+/g, " ").trim().replace(/:\\d+$/, "");
|
|
331
|
+
}
|
|
332
|
+
function basenameForPath(path) {
|
|
333
|
+
return path.split("/").filter(Boolean).pop() || path || "File";
|
|
334
|
+
}
|
|
335
|
+
function removeImplementationSymbolList(file) {
|
|
336
|
+
file.querySelector(".symbol-list")?.remove();
|
|
337
|
+
}
|
|
338
|
+
function removeImplementationPreviewButtons(container) {
|
|
339
|
+
for (const button of Array.from(container.querySelectorAll("[data-agent-native-code-preview]"))) {
|
|
340
|
+
button.removeAttribute("data-agent-native-code-preview");
|
|
341
|
+
button.removeAttribute("data-agent-native-hover-preview");
|
|
342
|
+
if (button.tagName === "BUTTON" && button.closest(".file-actions")) button.remove();
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
function inlinePreviewFromTemplate(template) {
|
|
346
|
+
const preview = template?.content?.querySelector?.(".code-preview");
|
|
347
|
+
if (!preview) return null;
|
|
348
|
+
const clone = preview.cloneNode(true);
|
|
349
|
+
clone.classList.add("inline-code-preview");
|
|
350
|
+
clone.querySelector?.(".code-preview-title")?.remove?.();
|
|
351
|
+
return clone;
|
|
352
|
+
}
|
|
353
|
+
function ensureInlineCodePreview(file) {
|
|
354
|
+
const body = file.querySelector(".file-detail-body");
|
|
355
|
+
const template = file.querySelector("template");
|
|
356
|
+
if (body && !body.querySelector(".inline-code-preview")) {
|
|
357
|
+
const inline = inlinePreviewFromTemplate(template);
|
|
358
|
+
if (inline) body.appendChild(inline);
|
|
359
|
+
}
|
|
360
|
+
template?.remove?.();
|
|
361
|
+
removeImplementationPreviewButtons(file);
|
|
362
|
+
}
|
|
363
|
+
function upgradeImplementationFileMaps() {
|
|
364
|
+
const maps = Array.from(document.querySelectorAll(".implementation-map"));
|
|
365
|
+
for (const map of maps) {
|
|
366
|
+
const oldContainer = map.querySelector(":scope > .implementation-files");
|
|
367
|
+
if (!oldContainer) {
|
|
368
|
+
removeImplementationPreviewButtons(map);
|
|
369
|
+
for (const file of Array.from(map.querySelectorAll(".implementation-file"))) {
|
|
370
|
+
removeImplementationSymbolList(file);
|
|
371
|
+
file.querySelector(".file-path span")?.remove();
|
|
372
|
+
ensureInlineCodePreview(file);
|
|
373
|
+
}
|
|
374
|
+
continue;
|
|
375
|
+
}
|
|
376
|
+
const files = Array.from(oldContainer.querySelectorAll(":scope > .implementation-file"));
|
|
377
|
+
if (files.length === 0) continue;
|
|
378
|
+
map.dataset.planTabs = "true";
|
|
379
|
+
oldContainer.className = "implementation-file-tabs";
|
|
380
|
+
const list = document.createElement("div");
|
|
381
|
+
list.className = "implementation-file-list";
|
|
382
|
+
list.setAttribute("role", "tablist");
|
|
383
|
+
list.setAttribute("aria-label", "Files touched");
|
|
384
|
+
const panels = document.createElement("div");
|
|
385
|
+
panels.className = "implementation-file-panels";
|
|
386
|
+
oldContainer.replaceChildren(list, panels);
|
|
387
|
+
files.forEach((file, index) => {
|
|
388
|
+
const path = displayFilePath(file.getAttribute("data-file-path") || file.querySelector(".file-path")?.textContent || ("File " + (index + 1)));
|
|
389
|
+
const existingActions = file.querySelector(":scope > .file-actions") || file.querySelector(".file-actions");
|
|
390
|
+
const existingTemplates = Array.from(file.querySelectorAll(":scope > template"));
|
|
391
|
+
const existingInfo = Array.from(file.children).find((child) => child !== existingActions && child.tagName !== "TEMPLATE");
|
|
392
|
+
const summary = existingInfo?.querySelector?.(".file-summary") || file.querySelector(".file-summary");
|
|
393
|
+
const legacyButtons = Array.from(existingActions?.querySelectorAll("[data-agent-native-open-editor]") || []);
|
|
394
|
+
const vscodeHref = legacyButtons.map((button) => button.getAttribute("data-agent-native-open-editor") || "").find((href) => href.startsWith("vscode://file/")) || "";
|
|
395
|
+
const cursorHref = legacyButtons.map((button) => button.getAttribute("data-agent-native-open-editor") || "").find((href) => href.startsWith("cursor://file/")) || "";
|
|
396
|
+
const openFile = openFileFromHref(vscodeHref || cursorHref);
|
|
397
|
+
const target = "runtime-file-" + index + "-" + path.toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/^-|-$/g, "");
|
|
398
|
+
const tab = document.createElement("button");
|
|
399
|
+
tab.type = "button";
|
|
400
|
+
tab.className = "implementation-file-tab" + (index === 0 ? " is-active" : "");
|
|
401
|
+
tab.dataset.tabTarget = target;
|
|
402
|
+
tab.dataset.filePath = path;
|
|
403
|
+
if (openFile) tab.dataset.agentNativeOpenFile = openFile;
|
|
404
|
+
tab.innerHTML = '<span class="file-tab-name"></span><span class="file-tab-path"></span>';
|
|
405
|
+
tab.querySelector(".file-tab-name").textContent = basenameForPath(path);
|
|
406
|
+
tab.querySelector(".file-tab-path").textContent = path;
|
|
407
|
+
list.appendChild(tab);
|
|
408
|
+
|
|
409
|
+
file.className = "implementation-file implementation-file-panel tab-panel" + (index === 0 ? " is-active" : "");
|
|
410
|
+
file.dataset.tabPanel = target;
|
|
411
|
+
file.dataset.filePath = path;
|
|
412
|
+
|
|
413
|
+
const header = document.createElement("div");
|
|
414
|
+
header.className = "file-detail-header";
|
|
415
|
+
const title = document.createElement("div");
|
|
416
|
+
title.className = "file-title-stack";
|
|
417
|
+
title.innerHTML = '<p class="file-name"></p><p class="file-path"></p>';
|
|
418
|
+
title.querySelector(".file-name").textContent = basenameForPath(path);
|
|
419
|
+
title.querySelector(".file-path").textContent = path;
|
|
420
|
+
header.appendChild(title);
|
|
421
|
+
if (existingActions) header.appendChild(existingActions);
|
|
422
|
+
|
|
423
|
+
const body = document.createElement("div");
|
|
424
|
+
body.className = "file-detail-body";
|
|
425
|
+
if (summary) body.appendChild(summary);
|
|
426
|
+
const inlinePreview = inlinePreviewFromTemplate(existingTemplates[0]);
|
|
427
|
+
if (inlinePreview) body.appendChild(inlinePreview);
|
|
428
|
+
|
|
429
|
+
removeImplementationPreviewButtons(file);
|
|
430
|
+
file.replaceChildren(header, body);
|
|
431
|
+
removeImplementationSymbolList(file);
|
|
432
|
+
ensureInlineCodePreview(file);
|
|
433
|
+
panels.appendChild(file);
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
const editorValues = editorOptions.map((option) => option.value);
|
|
438
|
+
let preferredEditor = normalizeEditor(state.preferredEditor);
|
|
439
|
+
function normalizeEditor(value) {
|
|
440
|
+
return editorValues.includes(value) ? value : "vscode";
|
|
441
|
+
}
|
|
442
|
+
function editorLabel(editor) {
|
|
443
|
+
return editorOptions.find((option) => option.value === editor)?.label || "VS Code";
|
|
444
|
+
}
|
|
445
|
+
function editorIconHtml(editor) {
|
|
446
|
+
const normalized = normalizeEditor(editor);
|
|
447
|
+
return '<span class="editor-icon editor-icon-' + normalized + '">' + (editorIconMap[normalized] || "") + '</span>';
|
|
448
|
+
}
|
|
449
|
+
function editorTriggerHtml(editor) {
|
|
450
|
+
const normalized = normalizeEditor(editor);
|
|
451
|
+
return editorIconHtml(normalized) + '<span class="editor-picker-sr">Preferred editor: ' + editorLabel(normalized) + '</span><span class="editor-picker-caret" aria-hidden="true"></span>';
|
|
452
|
+
}
|
|
453
|
+
function editorSelectOptionsHtml() {
|
|
454
|
+
return editorOptions.map(({ value, label }) => '<option value="' + value + '">' + label + '</option>').join(""); // i18n-ignore generated editor picker markup with stable app labels
|
|
455
|
+
}
|
|
456
|
+
function editorMenuHtml(activeEditor) {
|
|
457
|
+
const active = normalizeEditor(activeEditor);
|
|
458
|
+
return editorOptions.map(({ value, label }) => {
|
|
459
|
+
const selected = value === active;
|
|
460
|
+
return '<button type="button" class="editor-picker-option' + (selected ? " is-active" : "") + '" data-agent-native-editor-option="' + value + '" role="menuitemradio" aria-checked="' + (selected ? "true" : "false") + '">' + editorIconHtml(value) + '<span>' + label + '</span></button>'; // i18n-ignore generated editor picker markup with stable app labels
|
|
461
|
+
}).join("");
|
|
462
|
+
}
|
|
463
|
+
function closeEditorMenus(exceptPicker) {
|
|
464
|
+
for (const picker of document.querySelectorAll("[data-agent-native-editor-picker]")) {
|
|
465
|
+
if (picker !== exceptPicker) {
|
|
466
|
+
picker.removeAttribute("data-open");
|
|
467
|
+
picker.querySelector("[data-agent-native-editor-trigger]")?.setAttribute("aria-expanded", "false");
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
function setPreferredEditor(editor, notifyParent) {
|
|
472
|
+
preferredEditor = normalizeEditor(editor);
|
|
473
|
+
for (const picker of document.querySelectorAll("[data-agent-native-editor-picker]")) {
|
|
474
|
+
picker.dataset.editor = preferredEditor;
|
|
475
|
+
const trigger = picker.querySelector("[data-agent-native-editor-trigger]");
|
|
476
|
+
if (trigger) {
|
|
477
|
+
trigger.innerHTML = editorTriggerHtml(preferredEditor);
|
|
478
|
+
trigger.setAttribute("aria-label", "Choose editor. Current: " + editorLabel(preferredEditor));
|
|
479
|
+
}
|
|
480
|
+
const select = picker.querySelector("[data-agent-native-editor-select]");
|
|
481
|
+
if (select) select.value = preferredEditor;
|
|
482
|
+
const menu = picker.querySelector("[data-agent-native-editor-menu]");
|
|
483
|
+
if (menu) menu.innerHTML = editorMenuHtml(preferredEditor);
|
|
484
|
+
}
|
|
485
|
+
if (notifyParent) {
|
|
486
|
+
window.parent.postMessage({ type: "agent-native-plan-editor-preference", editor: preferredEditor }, "*");
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
function splitFileLocation(filePath, explicitLine) {
|
|
490
|
+
const value = filePath || "";
|
|
491
|
+
const match = value.match(/^(.*?)(?::(\\d+)(?::(\\d+))?)?$/);
|
|
492
|
+
return {
|
|
493
|
+
path: match?.[1] || value,
|
|
494
|
+
line: explicitLine || match?.[2] || "",
|
|
495
|
+
column: match?.[3] || "1"
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
function openFileFromHref(href) {
|
|
499
|
+
const match = String(href || "").match(/^(?:vscode|cursor):\\/\\/file(.+)$/);
|
|
500
|
+
return match?.[1] ? decodeURI(match[1]) : "";
|
|
501
|
+
}
|
|
502
|
+
function directoryForPath(filePath) {
|
|
503
|
+
const index = filePath.lastIndexOf("/");
|
|
504
|
+
return index > 0 ? filePath.slice(0, index) : filePath;
|
|
505
|
+
}
|
|
506
|
+
function hrefForEditor(editor, filePath, line) {
|
|
507
|
+
if (!filePath) return "";
|
|
508
|
+
const normalized = normalizeEditor(editor);
|
|
509
|
+
const location = splitFileLocation(filePath, line);
|
|
510
|
+
const lineSuffix = location.line ? ":" + location.line + ":" + location.column : "";
|
|
511
|
+
if (normalized === "finder") return "file://" + encodeURI(location.path);
|
|
512
|
+
if (normalized === "xcode") {
|
|
513
|
+
return "xcode://open?url=" + encodeURIComponent("file://" + location.path) + (location.line ? "&line=" + encodeURIComponent(location.line) : ""); // i18n-ignore stable editor URL scheme
|
|
514
|
+
}
|
|
515
|
+
if (normalized === "terminal") {
|
|
516
|
+
return "terminal://open?path=" + encodeURIComponent(directoryForPath(location.path)); // i18n-ignore stable editor URL scheme
|
|
517
|
+
}
|
|
518
|
+
if (normalized === "ghostty") {
|
|
519
|
+
return "ghostty://open?path=" + encodeURIComponent(directoryForPath(location.path)); // i18n-ignore stable editor URL scheme
|
|
520
|
+
}
|
|
521
|
+
return normalized + "://file" + encodeURI(location.path) + lineSuffix;
|
|
522
|
+
}
|
|
523
|
+
function createEditorPicker(openFile, hrefs = {}, line = "") {
|
|
524
|
+
const picker = document.createElement("div");
|
|
525
|
+
picker.className = "editor-picker";
|
|
526
|
+
picker.dataset.agentNativeEditorPicker = "true";
|
|
527
|
+
picker.dataset.editor = preferredEditor;
|
|
528
|
+
const trigger = document.createElement("button");
|
|
529
|
+
trigger.type = "button";
|
|
530
|
+
trigger.className = "editor-picker-trigger";
|
|
531
|
+
trigger.dataset.agentNativeEditorTrigger = "true";
|
|
532
|
+
trigger.setAttribute("aria-haspopup", "menu");
|
|
533
|
+
trigger.setAttribute("aria-expanded", "false");
|
|
534
|
+
trigger.setAttribute("aria-label", "Choose editor. Current: " + editorLabel(preferredEditor));
|
|
535
|
+
trigger.innerHTML = editorTriggerHtml(preferredEditor);
|
|
536
|
+
const select = document.createElement("select");
|
|
537
|
+
select.className = "editor-picker-select";
|
|
538
|
+
select.dataset.agentNativeEditorSelect = "true";
|
|
539
|
+
select.setAttribute("aria-hidden", "true");
|
|
540
|
+
select.setAttribute("tabindex", "-1");
|
|
541
|
+
select.innerHTML = editorSelectOptionsHtml();
|
|
542
|
+
const menu = document.createElement("div");
|
|
543
|
+
menu.className = "editor-picker-menu";
|
|
544
|
+
menu.dataset.agentNativeEditorMenu = "true";
|
|
545
|
+
menu.setAttribute("role", "menu");
|
|
546
|
+
menu.innerHTML = editorMenuHtml(preferredEditor);
|
|
547
|
+
const open = document.createElement("button");
|
|
548
|
+
open.type = "button";
|
|
549
|
+
open.className = "editor-picker-open";
|
|
550
|
+
open.textContent = "Open";
|
|
551
|
+
open.dataset.agentNativeOpenSelectedEditor = "true";
|
|
552
|
+
if (openFile) open.dataset.agentNativeOpenFile = openFile;
|
|
553
|
+
if (line) open.dataset.agentNativeOpenLine = line;
|
|
554
|
+
if (hrefs.vscode) open.dataset.agentNativeOpenVscode = hrefs.vscode;
|
|
555
|
+
if (hrefs.cursor) open.dataset.agentNativeOpenCursor = hrefs.cursor;
|
|
556
|
+
picker.append(trigger, select, menu, open);
|
|
557
|
+
return picker;
|
|
558
|
+
}
|
|
559
|
+
function upgradeEditorPickerElement(picker) {
|
|
560
|
+
if (picker.querySelector("[data-agent-native-editor-trigger]")) return;
|
|
561
|
+
const select = picker.querySelector("[data-agent-native-editor-select]");
|
|
562
|
+
const open = picker.querySelector("[data-agent-native-open-selected-editor], [data-agent-native-open-file]") || document.createElement("button");
|
|
563
|
+
const editor = normalizeEditor(select?.value || picker.dataset.editor || preferredEditor);
|
|
564
|
+
const openFile = open.getAttribute?.("data-agent-native-open-file") || "";
|
|
565
|
+
const openLine = open.getAttribute?.("data-agent-native-open-line") || "";
|
|
566
|
+
const vscode = open.getAttribute?.("data-agent-native-open-vscode") || "";
|
|
567
|
+
const cursor = open.getAttribute?.("data-agent-native-open-cursor") || "";
|
|
568
|
+
const upgraded = createEditorPicker(openFile, { vscode, cursor }, openLine);
|
|
569
|
+
picker.replaceChildren(...Array.from(upgraded.childNodes));
|
|
570
|
+
picker.className = "editor-picker";
|
|
571
|
+
picker.dataset.agentNativeEditorPicker = "true";
|
|
572
|
+
picker.dataset.editor = editor;
|
|
573
|
+
}
|
|
574
|
+
function initializeEditorPickers() {
|
|
575
|
+
const actionGroups = Array.from(document.querySelectorAll(".file-actions"));
|
|
576
|
+
for (const actions of actionGroups) {
|
|
577
|
+
if (actions.querySelector("[data-agent-native-editor-picker]")) {
|
|
578
|
+
for (const picker of Array.from(actions.querySelectorAll("[data-agent-native-editor-picker]"))) {
|
|
579
|
+
upgradeEditorPickerElement(picker);
|
|
580
|
+
}
|
|
581
|
+
continue;
|
|
582
|
+
}
|
|
583
|
+
const legacyButtons = Array.from(actions.querySelectorAll("[data-agent-native-open-editor]"));
|
|
584
|
+
if (legacyButtons.length === 0) continue;
|
|
585
|
+
const hrefs = {};
|
|
586
|
+
for (const button of legacyButtons) {
|
|
587
|
+
const href = button.getAttribute("data-agent-native-open-editor") || "";
|
|
588
|
+
if (href.startsWith("cursor://file/")) hrefs.cursor = href;
|
|
589
|
+
if (href.startsWith("vscode://file/")) hrefs.vscode = href;
|
|
590
|
+
button.remove();
|
|
591
|
+
}
|
|
592
|
+
const openFile = openFileFromHref(hrefs.vscode || hrefs.cursor);
|
|
593
|
+
if (!openFile && !hrefs.cursor && !hrefs.vscode) continue;
|
|
594
|
+
actions.appendChild(createEditorPicker(openFile, hrefs));
|
|
595
|
+
}
|
|
596
|
+
for (const picker of Array.from(document.querySelectorAll("[data-agent-native-editor-picker]"))) {
|
|
597
|
+
upgradeEditorPickerElement(picker);
|
|
598
|
+
}
|
|
599
|
+
setPreferredEditor(preferredEditor, false);
|
|
600
|
+
}
|
|
601
|
+
function escapeCodeHtml(value) {
|
|
602
|
+
return String(value || "")
|
|
603
|
+
.replace(/&/g, "&")
|
|
604
|
+
.replace(/</g, "<")
|
|
605
|
+
.replace(/>/g, ">")
|
|
606
|
+
.replace(/"/g, """)
|
|
607
|
+
.replace(/'/g, "'");
|
|
608
|
+
}
|
|
609
|
+
function highlightPlainCodeBlocks() {
|
|
610
|
+
const blocks = Array.from(document.querySelectorAll(".code-preview pre, .inline-code-preview pre"));
|
|
611
|
+
for (const pre of blocks) {
|
|
612
|
+
const target = pre.querySelector("code") || pre;
|
|
613
|
+
if (target.querySelector(".syntax-keyword,.syntax-string,.syntax-literal,.syntax-comment")) continue;
|
|
614
|
+
const text = target.textContent || "";
|
|
615
|
+
if (!text.trim()) continue;
|
|
616
|
+
let html = escapeCodeHtml(text);
|
|
617
|
+
html = html
|
|
618
|
+
.replace(/("[^&]*(?:")|'[^&]*(?:')|\`[^\`]*\`)/g, '<span class="syntax-string">$1</span>')
|
|
619
|
+
.replace(/\\b(import|export|from|const|let|var|function|return|type|interface|class|extends|async|await|if|else|for|while|new|throw|try|catch|switch|case|default)\\b/g, '<span class="syntax-keyword">$1</span>')
|
|
620
|
+
.replace(/\\b(true|false|null|undefined)\\b/g, '<span class="syntax-literal">$1</span>')
|
|
621
|
+
.replace(/(^|\\n)(\\s*\\/\\/.*)/g, '$1<span class="syntax-comment">$2</span>');
|
|
622
|
+
target.innerHTML = html;
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
function setRuntimeAnnotateMode(value) {
|
|
626
|
+
state.annotateMode = Boolean(value);
|
|
627
|
+
root.classList.toggle("an-plan-annotating", state.annotateMode);
|
|
628
|
+
if (state.annotateMode) {
|
|
629
|
+
closeEditorMenus();
|
|
630
|
+
hideCodePopover();
|
|
631
|
+
hideSelectionToolbar();
|
|
632
|
+
} else {
|
|
633
|
+
hideSelectionToolbar();
|
|
634
|
+
}
|
|
635
|
+
postDocState();
|
|
636
|
+
}
|
|
637
|
+
function setRuntimeTheme(theme) {
|
|
638
|
+
state.theme = theme === "light" ? "light" : "dark";
|
|
639
|
+
root.dataset.agentNativeTheme = state.theme;
|
|
640
|
+
}
|
|
641
|
+
function restoreDocumentScroll(savedState) {
|
|
642
|
+
if (!savedState) return;
|
|
643
|
+
const doc = document.documentElement;
|
|
644
|
+
const scrollWidth = Math.max(doc.scrollWidth, document.body?.scrollWidth || 0);
|
|
645
|
+
const scrollHeight = Math.max(doc.scrollHeight, document.body?.scrollHeight || 0);
|
|
646
|
+
const x =
|
|
647
|
+
typeof savedState.scrollX === "number"
|
|
648
|
+
? savedState.scrollX * (scrollWidth / Math.max(savedState.scrollWidth || scrollWidth, 1))
|
|
649
|
+
: 0;
|
|
650
|
+
const y =
|
|
651
|
+
typeof savedState.scrollY === "number"
|
|
652
|
+
? savedState.scrollY * (scrollHeight / Math.max(savedState.scrollHeight || scrollHeight, 1))
|
|
653
|
+
: 0;
|
|
654
|
+
requestAnimationFrame(() => {
|
|
655
|
+
window.scrollTo(x, y);
|
|
656
|
+
syncAnnotationMarkers();
|
|
657
|
+
postDocState();
|
|
658
|
+
requestAnimationFrame(postDocState);
|
|
659
|
+
});
|
|
660
|
+
}
|
|
661
|
+
window.addEventListener("message", (event) => {
|
|
662
|
+
const data = event.data || {};
|
|
663
|
+
if (data.type !== "agent-native-plan-runtime-state") return;
|
|
664
|
+
if (typeof data.parentOrigin === "string" && data.parentOrigin && data.parentOrigin !== "null") {
|
|
665
|
+
window.__agentNativePlanParentOrigin = data.parentOrigin;
|
|
666
|
+
}
|
|
667
|
+
if (typeof data.theme === "string") setRuntimeTheme(data.theme);
|
|
668
|
+
if (typeof data.preferredEditor === "string") {
|
|
669
|
+
setPreferredEditor(data.preferredEditor, false);
|
|
670
|
+
}
|
|
671
|
+
if (typeof data.annotateMode === "boolean") {
|
|
672
|
+
setRuntimeAnnotateMode(data.annotateMode);
|
|
673
|
+
}
|
|
674
|
+
if (data.restoreScroll) restoreDocumentScroll(data.restoreScroll);
|
|
675
|
+
});
|
|
676
|
+
function postDocState() {
|
|
677
|
+
const doc = document.documentElement;
|
|
678
|
+
window.parent.postMessage({
|
|
679
|
+
type: "agent-native-plan-doc-state",
|
|
680
|
+
state: {
|
|
681
|
+
scrollX: window.scrollX || doc.scrollLeft || 0,
|
|
682
|
+
scrollY: window.scrollY || doc.scrollTop || 0,
|
|
683
|
+
scrollWidth: Math.max(doc.scrollWidth, document.body?.scrollWidth || 0),
|
|
684
|
+
scrollHeight: Math.max(doc.scrollHeight, document.body?.scrollHeight || 0),
|
|
685
|
+
clientWidth: doc.clientWidth,
|
|
686
|
+
clientHeight: doc.clientHeight
|
|
687
|
+
}
|
|
688
|
+
}, "*");
|
|
689
|
+
}
|
|
690
|
+
let annotationMarkerSyncFrame = 0;
|
|
691
|
+
function scheduleAnnotationMarkerSync() {
|
|
692
|
+
if (annotationMarkerSyncFrame) return;
|
|
693
|
+
annotationMarkerSyncFrame = requestAnimationFrame(() => {
|
|
694
|
+
annotationMarkerSyncFrame = 0;
|
|
695
|
+
syncAnnotationMarkers();
|
|
696
|
+
});
|
|
697
|
+
}
|
|
698
|
+
function markerAuthorFromItem(item) {
|
|
699
|
+
return {
|
|
700
|
+
authorName: item.authorName,
|
|
701
|
+
authorEmail: item.authorEmail,
|
|
702
|
+
authorAvatarUrl: item.authorAvatarUrl,
|
|
703
|
+
authorColor: item.authorColor,
|
|
704
|
+
authorInitials: item.authorInitials
|
|
705
|
+
};
|
|
706
|
+
}
|
|
707
|
+
function createMarkerFace(author) {
|
|
708
|
+
const face = document.createElement("span");
|
|
709
|
+
face.className = "an-plan-marker-face";
|
|
710
|
+
face.style.setProperty("--author-color", author.authorColor || "#00B5FF");
|
|
711
|
+
const fallback = document.createElement("span");
|
|
712
|
+
fallback.className = "an-plan-marker-initials";
|
|
713
|
+
fallback.textContent = author.authorInitials || "?";
|
|
714
|
+
if (author.authorAvatarUrl) {
|
|
715
|
+
const image = document.createElement("img");
|
|
716
|
+
image.className = "an-plan-marker-avatar";
|
|
717
|
+
image.src = author.authorAvatarUrl;
|
|
718
|
+
image.alt = author.authorName || "Comment author";
|
|
719
|
+
image.addEventListener("error", () => {
|
|
720
|
+
image.replaceWith(fallback);
|
|
721
|
+
});
|
|
722
|
+
face.appendChild(image);
|
|
723
|
+
} else {
|
|
724
|
+
face.appendChild(fallback);
|
|
725
|
+
}
|
|
726
|
+
return face;
|
|
727
|
+
}
|
|
728
|
+
function setMarkerThreadFaces(marker, item) {
|
|
729
|
+
const participants = Array.isArray(item.participants) && item.participants.length
|
|
730
|
+
? item.participants
|
|
731
|
+
: [markerAuthorFromItem(item)];
|
|
732
|
+
const count = Math.max(1, Number(item.commentCount || 1));
|
|
733
|
+
const single = participants.length <= 1 && count <= 1;
|
|
734
|
+
marker.dataset.single = String(single);
|
|
735
|
+
marker.style.setProperty("--author-color", participants[0]?.authorColor || item.authorColor || "#00B5FF");
|
|
736
|
+
const stack = document.createElement("span");
|
|
737
|
+
stack.className = "an-plan-marker-stack";
|
|
738
|
+
for (const author of participants.slice(0, 2)) {
|
|
739
|
+
stack.appendChild(createMarkerFace(author));
|
|
740
|
+
}
|
|
741
|
+
marker.replaceChildren(stack);
|
|
742
|
+
if (!single) {
|
|
743
|
+
const countLabel = document.createElement("span");
|
|
744
|
+
countLabel.className = "an-plan-marker-count";
|
|
745
|
+
countLabel.textContent = count > 99 ? "99+" : String(count);
|
|
746
|
+
marker.appendChild(countLabel);
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
removeEmptyPlanSections();
|
|
750
|
+
upgradeImplementationFileMaps();
|
|
751
|
+
initializePlanTabs();
|
|
752
|
+
initializeEditorPickers();
|
|
753
|
+
highlightPlainCodeBlocks();
|
|
754
|
+
postDocState();
|
|
755
|
+
window.addEventListener("scroll", postDocState, { passive: true });
|
|
756
|
+
window.addEventListener("resize", () => {
|
|
757
|
+
scheduleAnnotationMarkerSync();
|
|
758
|
+
postDocState();
|
|
759
|
+
});
|
|
760
|
+
window.addEventListener("agent-native-plan-board-layout-change", () => {
|
|
761
|
+
scheduleAnnotationMarkerSync();
|
|
762
|
+
postDocState();
|
|
763
|
+
});
|
|
764
|
+
function pct(value, total) {
|
|
765
|
+
return Math.max(0, Math.min(100, Number(((value / Math.max(total, 1)) * 100).toFixed(3))));
|
|
766
|
+
}
|
|
767
|
+
function closestSection(target) {
|
|
768
|
+
if (!(target instanceof Element)) return null;
|
|
769
|
+
return target.closest("[data-plan-section-id], section[id], article[id], [id]");
|
|
770
|
+
}
|
|
771
|
+
function normalizeText(value) {
|
|
772
|
+
return String(value || "").replace(/\\s+/g, " ").trim();
|
|
773
|
+
}
|
|
774
|
+
function textSnippet(target) {
|
|
775
|
+
if (!(target instanceof Element)) return "";
|
|
776
|
+
const text = normalizeText(target.innerText || target.textContent || "");
|
|
777
|
+
return text.slice(0, 90);
|
|
778
|
+
}
|
|
779
|
+
function closestTextContext(target) {
|
|
780
|
+
if (!(target instanceof Element)) return "";
|
|
781
|
+
const selector = [
|
|
782
|
+
"p",
|
|
783
|
+
"li",
|
|
784
|
+
"h1",
|
|
785
|
+
"h2",
|
|
786
|
+
"h3",
|
|
787
|
+
"h4",
|
|
788
|
+
"td",
|
|
789
|
+
"th",
|
|
790
|
+
"blockquote",
|
|
791
|
+
"figcaption",
|
|
792
|
+
"summary",
|
|
793
|
+
"button",
|
|
794
|
+
"a",
|
|
795
|
+
"label",
|
|
796
|
+
"pre",
|
|
797
|
+
"code",
|
|
798
|
+
"[data-plan-text]"
|
|
799
|
+
].join(",");
|
|
800
|
+
const direct = target.matches(selector) ? target : target.closest(selector);
|
|
801
|
+
const candidates = [direct, target, target.parentElement, closestSection(target)].filter(Boolean);
|
|
802
|
+
for (const candidate of candidates) {
|
|
803
|
+
const text = normalizeText(candidate.innerText || candidate.textContent || "");
|
|
804
|
+
if (text.length >= 8) return text.slice(0, 220);
|
|
805
|
+
}
|
|
806
|
+
return "";
|
|
807
|
+
}
|
|
808
|
+
function closestVisualContext(target) {
|
|
809
|
+
if (!(target instanceof Element)) return null;
|
|
810
|
+
return target.closest(".wireframe-shell,.mock-browser,.mock-plan,.mock-sidebar,.diagram-card,.flow-diagram,svg,canvas,img,figure,[data-plan-visual],[data-visual]");
|
|
811
|
+
}
|
|
812
|
+
function visualLabel(visual, section) {
|
|
813
|
+
if (!(visual instanceof Element)) return "";
|
|
814
|
+
return normalizeText(
|
|
815
|
+
visual.getAttribute("aria-label") ||
|
|
816
|
+
visual.getAttribute("data-label") ||
|
|
817
|
+
visual.querySelector?.("strong,h3,h4")?.textContent ||
|
|
818
|
+
sectionTitle(section) ||
|
|
819
|
+
"Visual"
|
|
820
|
+
);
|
|
821
|
+
}
|
|
822
|
+
function clamp(value, min, max) {
|
|
823
|
+
return Math.max(min, Math.min(max, value));
|
|
824
|
+
}
|
|
825
|
+
function cssEscape(value) {
|
|
826
|
+
if (window.CSS?.escape) return window.CSS.escape(String(value));
|
|
827
|
+
return String(value).replace(/[^a-zA-Z0-9_-]/g, (char) => "\\\\" + char);
|
|
828
|
+
}
|
|
829
|
+
function cssAttr(value) {
|
|
830
|
+
return String(value || "").replace(/\\\\/g, "\\\\\\\\").replace(/"/g, '\\"');
|
|
831
|
+
}
|
|
832
|
+
function uniqueSelector(selector) {
|
|
833
|
+
try {
|
|
834
|
+
return document.querySelectorAll(selector).length === 1;
|
|
835
|
+
} catch {
|
|
836
|
+
return false;
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
function selectorForElement(element) {
|
|
840
|
+
if (!(element instanceof Element)) return "";
|
|
841
|
+
if (element.id) {
|
|
842
|
+
const selector = "#" + cssEscape(element.id);
|
|
843
|
+
if (uniqueSelector(selector)) return selector;
|
|
844
|
+
}
|
|
845
|
+
for (const attr of ["data-plan-section-id", "data-tab-panel", "data-file-path"]) {
|
|
846
|
+
const value = element.getAttribute(attr);
|
|
847
|
+
if (!value) continue;
|
|
848
|
+
const selector = element.tagName.toLowerCase() + "[" + attr + '="' + cssAttr(value) + '"]';
|
|
849
|
+
if (uniqueSelector(selector)) return selector;
|
|
850
|
+
}
|
|
851
|
+
const parts = [];
|
|
852
|
+
let current = element;
|
|
853
|
+
while (current && current !== document.body && current !== document.documentElement) {
|
|
854
|
+
let part = current.tagName.toLowerCase();
|
|
855
|
+
const parent = current.parentElement;
|
|
856
|
+
if (!parent) break;
|
|
857
|
+
const sameTagSiblings = Array.from(parent.children).filter((child) => child.tagName === current.tagName);
|
|
858
|
+
if (sameTagSiblings.length > 1) {
|
|
859
|
+
part += ":nth-of-type(" + (sameTagSiblings.indexOf(current) + 1) + ")";
|
|
860
|
+
}
|
|
861
|
+
parts.unshift(part);
|
|
862
|
+
const selector = "body > " + parts.join(" > ");
|
|
863
|
+
if (uniqueSelector(selector)) return selector;
|
|
864
|
+
current = parent;
|
|
865
|
+
}
|
|
866
|
+
return parts.length ? "body > " + parts.join(" > ") : "";
|
|
867
|
+
}
|
|
868
|
+
function anchorTargetForElement(element) {
|
|
869
|
+
if (!(element instanceof Element)) return null;
|
|
870
|
+
const visual = closestVisualContext(element);
|
|
871
|
+
if (visual) return visual;
|
|
872
|
+
return closestTextElement(element) || element.closest("[data-tab-panel], [data-plan-section-id], section[id], article[id]") || element;
|
|
873
|
+
}
|
|
874
|
+
function withTargetAnchor(anchor, target, clientX, clientY) {
|
|
875
|
+
const targetElement = anchorTargetForElement(target);
|
|
876
|
+
const rect = targetElement?.getBoundingClientRect?.();
|
|
877
|
+
if (!targetElement || !rect || (!rect.width && !rect.height)) return anchor;
|
|
878
|
+
return {
|
|
879
|
+
...anchor,
|
|
880
|
+
targetSelector: selectorForElement(targetElement) || undefined,
|
|
881
|
+
targetX: pct(clamp(clientX, rect.left, rect.right) - rect.left, rect.width),
|
|
882
|
+
targetY: pct(clamp(clientY, rect.top, rect.bottom) - rect.top, rect.height)
|
|
883
|
+
};
|
|
884
|
+
}
|
|
885
|
+
function ensureLayer() {
|
|
886
|
+
let layer = document.querySelector(".an-plan-annotation-layer");
|
|
887
|
+
if (!layer) {
|
|
888
|
+
layer = document.createElement("div");
|
|
889
|
+
layer.className = "an-plan-annotation-layer";
|
|
890
|
+
document.body.style.position = document.body.style.position || "relative";
|
|
891
|
+
document.body.appendChild(layer);
|
|
892
|
+
}
|
|
893
|
+
return layer;
|
|
894
|
+
}
|
|
895
|
+
function sectionForNode(node) {
|
|
896
|
+
const element = node instanceof Element ? node : node?.parentElement;
|
|
897
|
+
return closestSection(element);
|
|
898
|
+
}
|
|
899
|
+
function sectionTitle(section) {
|
|
900
|
+
return section?.querySelector?.("h1,h2,h3,[data-plan-section-title]")?.textContent?.replace(/\\s+/g, " ").trim() || "";
|
|
901
|
+
}
|
|
902
|
+
function tabContextForElement(element) {
|
|
903
|
+
if (!(element instanceof Element)) return {};
|
|
904
|
+
const panel = element.closest("[data-tab-panel]");
|
|
905
|
+
const tabPanelId = panel?.getAttribute("data-tab-panel") || "";
|
|
906
|
+
if (!tabPanelId) return {};
|
|
907
|
+
const tabset = panel.closest("[data-plan-tabs]");
|
|
908
|
+
const tabButton = Array.from(tabset?.querySelectorAll("[data-tab-target]") || []).find((button) => button.getAttribute("data-tab-target") === tabPanelId);
|
|
909
|
+
const tabLabel = normalizeText(tabButton?.textContent || panel.getAttribute("aria-label") || "");
|
|
910
|
+
return {
|
|
911
|
+
tabPanelId,
|
|
912
|
+
tabLabel: tabLabel || undefined
|
|
913
|
+
};
|
|
914
|
+
}
|
|
915
|
+
function tabContextForPoint(anchor) {
|
|
916
|
+
if (!anchor || anchor.tabPanelId) return {};
|
|
917
|
+
const doc = document.documentElement;
|
|
918
|
+
const clientX = (anchor.x / 100) * doc.scrollWidth - window.scrollX;
|
|
919
|
+
const clientY = (anchor.y / 100) * Math.max(doc.scrollHeight, document.body.scrollHeight) - window.scrollY;
|
|
920
|
+
const element = document.elementFromPoint(clientX, clientY);
|
|
921
|
+
return tabContextForElement(element);
|
|
922
|
+
}
|
|
923
|
+
function isTabContextActive(tabPanelId) {
|
|
924
|
+
if (!tabPanelId) return true;
|
|
925
|
+
const panel = Array.from(document.querySelectorAll("[data-tab-panel]")).find((candidate) => candidate.getAttribute("data-tab-panel") === tabPanelId);
|
|
926
|
+
return Boolean(panel?.classList.contains("is-active"));
|
|
927
|
+
}
|
|
928
|
+
function elementTabPanelId(element) {
|
|
929
|
+
if (!(element instanceof Element)) return "";
|
|
930
|
+
return element.closest("[data-tab-panel]")?.getAttribute("data-tab-panel") || "";
|
|
931
|
+
}
|
|
932
|
+
function isElementTabActive(element) {
|
|
933
|
+
const tabPanelId = elementTabPanelId(element);
|
|
934
|
+
return !tabPanelId || isTabContextActive(tabPanelId);
|
|
935
|
+
}
|
|
936
|
+
function resolveAnchorTarget(anchor) {
|
|
937
|
+
if (!anchor) return null;
|
|
938
|
+
if (anchor.targetSelector) {
|
|
939
|
+
try {
|
|
940
|
+
const target = document.querySelector(anchor.targetSelector);
|
|
941
|
+
if (target) return target;
|
|
942
|
+
} catch {
|
|
943
|
+
// Ignore stale selectors and fall back to quote matching.
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
const quote = normalizeText(anchor.textQuote || anchor.snippet || "");
|
|
947
|
+
if (!quote) return null;
|
|
948
|
+
const needle = quote.slice(0, 120);
|
|
949
|
+
const scopes = [];
|
|
950
|
+
if (anchor.sectionId) {
|
|
951
|
+
const escapedSection = cssEscape(anchor.sectionId);
|
|
952
|
+
scopes.push(
|
|
953
|
+
document.querySelector('[data-plan-section-id="' + cssAttr(anchor.sectionId) + '"]'),
|
|
954
|
+
document.getElementById(anchor.sectionId),
|
|
955
|
+
document.querySelector("#" + escapedSection)
|
|
956
|
+
);
|
|
957
|
+
}
|
|
958
|
+
scopes.push(document);
|
|
959
|
+
for (const scope of scopes.filter(Boolean)) {
|
|
960
|
+
const candidates = Array.from(scope.querySelectorAll?.([
|
|
961
|
+
"p",
|
|
962
|
+
"li",
|
|
963
|
+
"h1",
|
|
964
|
+
"h2",
|
|
965
|
+
"h3",
|
|
966
|
+
"h4",
|
|
967
|
+
"td",
|
|
968
|
+
"th",
|
|
969
|
+
"blockquote",
|
|
970
|
+
"figcaption",
|
|
971
|
+
"summary",
|
|
972
|
+
"button",
|
|
973
|
+
"a",
|
|
974
|
+
"label",
|
|
975
|
+
"pre",
|
|
976
|
+
"code",
|
|
977
|
+
"[data-plan-text]"
|
|
978
|
+
].join(",")) || []);
|
|
979
|
+
const match = candidates.find((candidate) => normalizeText(candidate.textContent || "").includes(needle));
|
|
980
|
+
if (match) return anchorTargetForElement(match);
|
|
981
|
+
}
|
|
982
|
+
return null;
|
|
983
|
+
}
|
|
984
|
+
function pointForAnchor(anchor) {
|
|
985
|
+
const doc = document.documentElement;
|
|
986
|
+
const docHeight = Math.max(doc.scrollHeight, document.body.scrollHeight);
|
|
987
|
+
const target = resolveAnchorTarget(anchor);
|
|
988
|
+
if (target) {
|
|
989
|
+
if (!isElementTabActive(target)) return null;
|
|
990
|
+
const rect = target.getBoundingClientRect();
|
|
991
|
+
if (rect && (rect.width || rect.height)) {
|
|
992
|
+
return {
|
|
993
|
+
left: rect.left + window.scrollX + ((anchor.targetX ?? anchor.visualX ?? 50) / 100) * rect.width,
|
|
994
|
+
top: rect.top + window.scrollY + ((anchor.targetY ?? anchor.visualY ?? 50) / 100) * rect.height
|
|
995
|
+
};
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
const tabContext = anchor.tabPanelId ? { tabPanelId: anchor.tabPanelId } : tabContextForPoint(anchor);
|
|
999
|
+
if (!isTabContextActive(tabContext.tabPanelId)) return null;
|
|
1000
|
+
return {
|
|
1001
|
+
left: (anchor.x / 100) * doc.scrollWidth,
|
|
1002
|
+
top: (anchor.y / 100) * docHeight
|
|
1003
|
+
};
|
|
1004
|
+
}
|
|
1005
|
+
function setMarkerVisibility(marker, visible) {
|
|
1006
|
+
marker.style.display = visible ? "inline-flex" : "none";
|
|
1007
|
+
marker.setAttribute("aria-hidden", String(!visible));
|
|
1008
|
+
}
|
|
1009
|
+
function positionMarker(marker, item) {
|
|
1010
|
+
const point = pointForAnchor(item.anchor);
|
|
1011
|
+
if (!point) {
|
|
1012
|
+
setMarkerVisibility(marker, false);
|
|
1013
|
+
return;
|
|
1014
|
+
}
|
|
1015
|
+
marker.style.left = point.left + "px";
|
|
1016
|
+
marker.style.top = point.top + "px";
|
|
1017
|
+
setMarkerVisibility(marker, true);
|
|
1018
|
+
}
|
|
1019
|
+
function anchorWithCurrentPoint(anchor) {
|
|
1020
|
+
const point = pointForAnchor(anchor);
|
|
1021
|
+
if (!point) return anchor;
|
|
1022
|
+
const doc = document.documentElement;
|
|
1023
|
+
return {
|
|
1024
|
+
...anchor,
|
|
1025
|
+
x: pct(point.left, doc.scrollWidth),
|
|
1026
|
+
y: pct(point.top, Math.max(doc.scrollHeight, document.body.scrollHeight))
|
|
1027
|
+
};
|
|
1028
|
+
}
|
|
1029
|
+
function rangeFromPoint(clientX, clientY) {
|
|
1030
|
+
if (document.caretPositionFromPoint) {
|
|
1031
|
+
const position = document.caretPositionFromPoint(clientX, clientY);
|
|
1032
|
+
if (!position?.offsetNode) return null;
|
|
1033
|
+
const range = document.createRange();
|
|
1034
|
+
range.setStart(position.offsetNode, position.offset);
|
|
1035
|
+
range.collapse(true);
|
|
1036
|
+
return range;
|
|
1037
|
+
}
|
|
1038
|
+
if (document.caretRangeFromPoint) {
|
|
1039
|
+
return document.caretRangeFromPoint(clientX, clientY);
|
|
1040
|
+
}
|
|
1041
|
+
return null;
|
|
1042
|
+
}
|
|
1043
|
+
function expandRangeToWord(range) {
|
|
1044
|
+
if (!range || range.startContainer.nodeType !== Node.TEXT_NODE) return null;
|
|
1045
|
+
const node = range.startContainer;
|
|
1046
|
+
const text = node.textContent || "";
|
|
1047
|
+
if (!text.trim()) return null;
|
|
1048
|
+
let index = Math.min(range.startOffset, Math.max(0, text.length - 1));
|
|
1049
|
+
if (/\\s/.test(text[index] || "")) {
|
|
1050
|
+
let left = index - 1;
|
|
1051
|
+
let right = index + 1;
|
|
1052
|
+
while (left >= 0 || right < text.length) {
|
|
1053
|
+
if (left >= 0 && !/\\s/.test(text[left])) {
|
|
1054
|
+
index = left;
|
|
1055
|
+
break;
|
|
1056
|
+
}
|
|
1057
|
+
if (right < text.length && !/\\s/.test(text[right])) {
|
|
1058
|
+
index = right;
|
|
1059
|
+
break;
|
|
1060
|
+
}
|
|
1061
|
+
left -= 1;
|
|
1062
|
+
right += 1;
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
if (/\\s/.test(text[index] || "")) return null;
|
|
1066
|
+
let start = index;
|
|
1067
|
+
let end = index + 1;
|
|
1068
|
+
while (start > 0 && !/\\s/.test(text[start - 1])) start -= 1;
|
|
1069
|
+
while (end < text.length && !/\\s/.test(text[end])) end += 1;
|
|
1070
|
+
const selectedText = text.slice(start, end).trim();
|
|
1071
|
+
if (selectedText.length < 2) return null;
|
|
1072
|
+
const wordRange = document.createRange();
|
|
1073
|
+
wordRange.setStart(node, start);
|
|
1074
|
+
wordRange.setEnd(node, end);
|
|
1075
|
+
return { range: wordRange, selectedText };
|
|
1076
|
+
}
|
|
1077
|
+
function closestTextElement(target) {
|
|
1078
|
+
if (!(target instanceof Element)) return null;
|
|
1079
|
+
const selector = [
|
|
1080
|
+
"p",
|
|
1081
|
+
"li",
|
|
1082
|
+
"h1",
|
|
1083
|
+
"h2",
|
|
1084
|
+
"h3",
|
|
1085
|
+
"h4",
|
|
1086
|
+
"td",
|
|
1087
|
+
"th",
|
|
1088
|
+
"blockquote",
|
|
1089
|
+
"figcaption",
|
|
1090
|
+
"summary",
|
|
1091
|
+
"button",
|
|
1092
|
+
"a",
|
|
1093
|
+
"label",
|
|
1094
|
+
"pre",
|
|
1095
|
+
"code",
|
|
1096
|
+
"[data-plan-text]"
|
|
1097
|
+
].join(",");
|
|
1098
|
+
return target.matches(selector) ? target : target.closest(selector);
|
|
1099
|
+
}
|
|
1100
|
+
function anchorFromPoint(clientX, clientY, target) {
|
|
1101
|
+
const word = expandRangeToWord(rangeFromPoint(clientX, clientY));
|
|
1102
|
+
if (word) {
|
|
1103
|
+
const anchor = anchorFromRange(word.range, word.selectedText);
|
|
1104
|
+
if (anchor) return anchor;
|
|
1105
|
+
}
|
|
1106
|
+
const textElement = closestTextElement(target);
|
|
1107
|
+
if (!(textElement instanceof Element)) return null;
|
|
1108
|
+
const rect = textElement.getBoundingClientRect();
|
|
1109
|
+
if (!rect || (!rect.width && !rect.height)) return null;
|
|
1110
|
+
const doc = document.documentElement;
|
|
1111
|
+
const textQuote = closestTextContext(textElement);
|
|
1112
|
+
const section = closestSection(textElement);
|
|
1113
|
+
const anchor = {
|
|
1114
|
+
x: pct(clamp(clientX, rect.left, rect.right) + window.scrollX, doc.scrollWidth),
|
|
1115
|
+
y: pct(clamp(clientY, rect.top, rect.bottom) + window.scrollY, Math.max(doc.scrollHeight, document.body.scrollHeight)),
|
|
1116
|
+
sectionId: section?.getAttribute("data-plan-section-id") || section?.id || undefined,
|
|
1117
|
+
sectionTitle: sectionTitle(section) || undefined,
|
|
1118
|
+
...tabContextForElement(textElement),
|
|
1119
|
+
snippet: textQuote || textSnippet(textElement),
|
|
1120
|
+
textQuote: textQuote || undefined,
|
|
1121
|
+
anchorKind: textQuote ? "text" : "point",
|
|
1122
|
+
tagName: textElement.tagName.toLowerCase()
|
|
1123
|
+
};
|
|
1124
|
+
return withTargetAnchor(anchor, textElement, clientX, clientY);
|
|
1125
|
+
}
|
|
1126
|
+
function anchorFromRange(range, selectedText) {
|
|
1127
|
+
const rect = range.getBoundingClientRect();
|
|
1128
|
+
if (!rect || (!rect.width && !rect.height)) return null;
|
|
1129
|
+
const doc = document.documentElement;
|
|
1130
|
+
const section = sectionForNode(range.commonAncestorContainer);
|
|
1131
|
+
const rangeElement = range.commonAncestorContainer instanceof Element ? range.commonAncestorContainer : range.commonAncestorContainer.parentElement;
|
|
1132
|
+
const anchor = {
|
|
1133
|
+
x: pct(rect.left + window.scrollX + rect.width / 2, doc.scrollWidth),
|
|
1134
|
+
y: pct(rect.top + window.scrollY + rect.height / 2, Math.max(doc.scrollHeight, document.body.scrollHeight)),
|
|
1135
|
+
sectionId: section?.getAttribute("data-plan-section-id") || section?.id || undefined,
|
|
1136
|
+
sectionTitle: sectionTitle(section) || undefined,
|
|
1137
|
+
...tabContextForElement(rangeElement),
|
|
1138
|
+
snippet: selectedText.slice(0, 160),
|
|
1139
|
+
textQuote: selectedText.slice(0, 220),
|
|
1140
|
+
anchorKind: "text",
|
|
1141
|
+
tagName: "selection"
|
|
1142
|
+
};
|
|
1143
|
+
return withTargetAnchor(anchor, rangeElement, rect.left + rect.width / 2, rect.top + rect.height / 2);
|
|
1144
|
+
}
|
|
1145
|
+
function ensureSelectionToolbar() {
|
|
1146
|
+
let toolbar = document.querySelector(".an-plan-selection-toolbar");
|
|
1147
|
+
if (!toolbar) {
|
|
1148
|
+
toolbar = document.createElement("div");
|
|
1149
|
+
toolbar.className = "an-plan-selection-toolbar";
|
|
1150
|
+
toolbar.innerHTML = '<button type="button"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 9h8"/><path d="M8 13h6"/><path d="M12 20l-3-3H7a4 4 0 0 1-4-4V7a4 4 0 0 1 4-4h10a4 4 0 0 1 4 4v4.5"/><path d="M19 16v6"/><path d="M16 19h6"/></svg><span>Comment</span></button>';
|
|
1151
|
+
const button = toolbar.querySelector("button");
|
|
1152
|
+
button?.addEventListener("mousedown", (event) => event.preventDefault());
|
|
1153
|
+
button?.addEventListener("click", (event) => {
|
|
1154
|
+
event.preventDefault();
|
|
1155
|
+
event.stopPropagation();
|
|
1156
|
+
const selection = window.getSelection();
|
|
1157
|
+
if (!selection || selection.rangeCount === 0 || selection.isCollapsed) return;
|
|
1158
|
+
const selectedText = selection.toString().replace(/\\s+/g, " ").trim();
|
|
1159
|
+
if (!selectedText) return;
|
|
1160
|
+
const anchor = anchorFromRange(selection.getRangeAt(0), selectedText);
|
|
1161
|
+
if (!anchor) return;
|
|
1162
|
+
toolbar.style.display = "none";
|
|
1163
|
+
window.parent.postMessage({ type: "agent-native-plan-annotate", anchor }, "*");
|
|
1164
|
+
});
|
|
1165
|
+
document.body.appendChild(toolbar);
|
|
1166
|
+
}
|
|
1167
|
+
return toolbar;
|
|
1168
|
+
}
|
|
1169
|
+
function hideSelectionToolbar() {
|
|
1170
|
+
const toolbar = document.querySelector(".an-plan-selection-toolbar");
|
|
1171
|
+
if (toolbar) toolbar.style.display = "none";
|
|
1172
|
+
}
|
|
1173
|
+
function hideCodePopover() {
|
|
1174
|
+
document.querySelector(".an-plan-code-popover")?.remove();
|
|
1175
|
+
}
|
|
1176
|
+
function showCodePopover(button, templateId) {
|
|
1177
|
+
const template = document.getElementById(templateId);
|
|
1178
|
+
if (!(template instanceof HTMLTemplateElement)) return;
|
|
1179
|
+
hideCodePopover();
|
|
1180
|
+
const popover = document.createElement("div");
|
|
1181
|
+
popover.className = "an-plan-code-popover";
|
|
1182
|
+
popover.innerHTML = '<div class="an-plan-code-popover-header"><span class="an-plan-code-popover-title"></span><div class="an-plan-code-popover-actions"></div><button type="button" class="an-plan-code-popover-close" aria-label="${closeCodePreviewLabel}">×</button></div><div class="an-plan-code-popover-body"></div>';
|
|
1183
|
+
const content = template.content.cloneNode(true);
|
|
1184
|
+
const codePreview = content.querySelector?.(".code-preview");
|
|
1185
|
+
const oldTitle = content.querySelector?.(".code-preview-title");
|
|
1186
|
+
const fileTitle = codePreview?.getAttribute?.("data-file-path") || oldTitle?.querySelector?.("strong")?.textContent?.trim() || button.getAttribute("data-file-path") || button.closest(".implementation-file")?.getAttribute("data-file-path") || "Snippet";
|
|
1187
|
+
const hrefs = {};
|
|
1188
|
+
const fileActions = button.closest(".implementation-file")?.querySelector(".file-actions");
|
|
1189
|
+
for (const openButton of Array.from(fileActions?.querySelectorAll("[data-agent-native-open-editor], [data-agent-native-open-selected-editor], [data-agent-native-open-file]") || [])) {
|
|
1190
|
+
const vscode = openButton.getAttribute("data-agent-native-open-vscode") || "";
|
|
1191
|
+
const cursor = openButton.getAttribute("data-agent-native-open-cursor") || "";
|
|
1192
|
+
const legacy = openButton.getAttribute("data-agent-native-open-editor") || "";
|
|
1193
|
+
if (vscode) hrefs.vscode = vscode;
|
|
1194
|
+
if (cursor) hrefs.cursor = cursor;
|
|
1195
|
+
if (legacy.startsWith("vscode://file/")) hrefs.vscode = legacy;
|
|
1196
|
+
if (legacy.startsWith("cursor://file/")) hrefs.cursor = legacy;
|
|
1197
|
+
}
|
|
1198
|
+
const openFile = button.getAttribute("data-agent-native-open-file") || codePreview?.getAttribute?.("data-agent-native-open-file") || openFileFromHref(hrefs.vscode || hrefs.cursor);
|
|
1199
|
+
const openLine = button.getAttribute("data-agent-native-open-line") || codePreview?.getAttribute?.("data-agent-native-open-line") || "";
|
|
1200
|
+
oldTitle?.remove?.();
|
|
1201
|
+
popover.querySelector(".an-plan-code-popover-title").textContent = fileTitle;
|
|
1202
|
+
if (openFile || hrefs.vscode || hrefs.cursor) {
|
|
1203
|
+
popover.querySelector(".an-plan-code-popover-actions")?.append(createEditorPicker(openFile, hrefs, openLine));
|
|
1204
|
+
setPreferredEditor(preferredEditor, false);
|
|
1205
|
+
}
|
|
1206
|
+
popover.querySelector(".an-plan-code-popover-body")?.append(content);
|
|
1207
|
+
popover.querySelector(".an-plan-code-popover-close")?.addEventListener("click", hideCodePopover);
|
|
1208
|
+
document.body.appendChild(popover);
|
|
1209
|
+
const rect = button.getBoundingClientRect();
|
|
1210
|
+
const width = popover.offsetWidth || 640;
|
|
1211
|
+
const height = popover.offsetHeight || 420;
|
|
1212
|
+
const minLeft = window.scrollX + 12;
|
|
1213
|
+
const maxLeft = window.scrollX + document.documentElement.clientWidth - width - 12;
|
|
1214
|
+
popover.style.left = clamp(rect.left + window.scrollX, minLeft, maxLeft) + "px";
|
|
1215
|
+
popover.style.top = clamp(rect.bottom + window.scrollY + 8, window.scrollY + 12, window.scrollY + document.documentElement.clientHeight - height - 12) + "px";
|
|
1216
|
+
}
|
|
1217
|
+
function updateSelectionToolbar() {
|
|
1218
|
+
if (state.annotateMode) {
|
|
1219
|
+
hideSelectionToolbar();
|
|
1220
|
+
return;
|
|
1221
|
+
}
|
|
1222
|
+
const selection = window.getSelection();
|
|
1223
|
+
if (!selection || selection.rangeCount === 0 || selection.isCollapsed) {
|
|
1224
|
+
hideSelectionToolbar();
|
|
1225
|
+
return;
|
|
1226
|
+
}
|
|
1227
|
+
const selectedText = selection.toString().replace(/\\s+/g, " ").trim();
|
|
1228
|
+
if (!selectedText) {
|
|
1229
|
+
hideSelectionToolbar();
|
|
1230
|
+
return;
|
|
1231
|
+
}
|
|
1232
|
+
const rect = selection.getRangeAt(0).getBoundingClientRect();
|
|
1233
|
+
if (!rect || (!rect.width && !rect.height)) {
|
|
1234
|
+
hideSelectionToolbar();
|
|
1235
|
+
return;
|
|
1236
|
+
}
|
|
1237
|
+
const toolbar = ensureSelectionToolbar();
|
|
1238
|
+
toolbar.style.display = "flex";
|
|
1239
|
+
const width = toolbar.offsetWidth || 124;
|
|
1240
|
+
const left = clamp(rect.left + window.scrollX + rect.width / 2 - width / 2, window.scrollX + 10, window.scrollX + document.documentElement.clientWidth - width - 10);
|
|
1241
|
+
const top = Math.max(window.scrollY + 10, rect.top + window.scrollY - (toolbar.offsetHeight || 44) - 10);
|
|
1242
|
+
toolbar.style.left = left + "px";
|
|
1243
|
+
toolbar.style.top = top + "px";
|
|
1244
|
+
}
|
|
1245
|
+
function syncAnnotationMarkers() {
|
|
1246
|
+
for (const marker of document.querySelectorAll("[data-agent-native-plan-marker]")) {
|
|
1247
|
+
if (marker.__agentNativePlanAnnotation) {
|
|
1248
|
+
positionMarker(marker, marker.__agentNativePlanAnnotation);
|
|
1249
|
+
continue;
|
|
1250
|
+
}
|
|
1251
|
+
const tabPanelId = marker.getAttribute("data-tab-panel-id") || "";
|
|
1252
|
+
setMarkerVisibility(marker, isTabContextActive(tabPanelId));
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
const layer = ensureLayer();
|
|
1256
|
+
for (const item of state.annotations) {
|
|
1257
|
+
if (!item.anchor) continue;
|
|
1258
|
+
const button = document.createElement("button");
|
|
1259
|
+
const tabContext = item.anchor.tabPanelId ? { tabPanelId: item.anchor.tabPanelId, tabLabel: item.anchor.tabLabel } : tabContextForPoint(item.anchor);
|
|
1260
|
+
button.type = "button";
|
|
1261
|
+
button.className = "an-plan-marker";
|
|
1262
|
+
button.dataset.status = item.status || "open";
|
|
1263
|
+
button.dataset.agentNativePlanMarker = "true";
|
|
1264
|
+
button.__agentNativePlanAnnotation = item;
|
|
1265
|
+
if (tabContext.tabPanelId) {
|
|
1266
|
+
button.dataset.tabPanelId = tabContext.tabPanelId;
|
|
1267
|
+
}
|
|
1268
|
+
if (tabContext.tabLabel) {
|
|
1269
|
+
button.dataset.tabLabel = tabContext.tabLabel;
|
|
1270
|
+
}
|
|
1271
|
+
positionMarker(button, item);
|
|
1272
|
+
setMarkerThreadFaces(button, item);
|
|
1273
|
+
const participantNames = Array.isArray(item.participants)
|
|
1274
|
+
? item.participants.map((participant) => participant.authorName).filter(Boolean).slice(0, 3).join(", ")
|
|
1275
|
+
: "";
|
|
1276
|
+
const countLabel = (item.commentCount || 1) + " comment" + ((item.commentCount || 1) === 1 ? "" : "s");
|
|
1277
|
+
button.title = participantNames
|
|
1278
|
+
? countLabel + " by " + participantNames + ": " + (item.message || "Plan comment")
|
|
1279
|
+
: countLabel + ": " + (item.message || "Plan comment");
|
|
1280
|
+
button.setAttribute("aria-label", button.title);
|
|
1281
|
+
button.addEventListener("click", (event) => {
|
|
1282
|
+
event.preventDefault();
|
|
1283
|
+
event.stopPropagation();
|
|
1284
|
+
window.parent.postMessage({
|
|
1285
|
+
type: "agent-native-plan-open-comment",
|
|
1286
|
+
comment: {
|
|
1287
|
+
...item,
|
|
1288
|
+
anchor: anchorWithCurrentPoint(item.anchor)
|
|
1289
|
+
}
|
|
1290
|
+
}, "*");
|
|
1291
|
+
});
|
|
1292
|
+
layer.appendChild(button);
|
|
1293
|
+
}
|
|
1294
|
+
document.addEventListener("selectionchange", () => requestAnimationFrame(updateSelectionToolbar));
|
|
1295
|
+
document.addEventListener("mouseup", () => setTimeout(updateSelectionToolbar, 0));
|
|
1296
|
+
document.addEventListener("keyup", updateSelectionToolbar);
|
|
1297
|
+
document.addEventListener("keydown", (event) => {
|
|
1298
|
+
if (event.key === "Escape") {
|
|
1299
|
+
closeEditorMenus();
|
|
1300
|
+
if (state.annotateMode) {
|
|
1301
|
+
event.preventDefault();
|
|
1302
|
+
event.stopPropagation();
|
|
1303
|
+
setRuntimeAnnotateMode(false);
|
|
1304
|
+
window.parent.postMessage({ type: "agent-native-plan-exit-comment-mode" }, "*");
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
});
|
|
1308
|
+
document.addEventListener("change", (event) => {
|
|
1309
|
+
const editorSelect = event.target instanceof Element ? event.target.closest("[data-agent-native-editor-select]") : null;
|
|
1310
|
+
if (!editorSelect) return;
|
|
1311
|
+
setPreferredEditor(editorSelect.value, true);
|
|
1312
|
+
});
|
|
1313
|
+
document.addEventListener("click", (event) => {
|
|
1314
|
+
const editorOption = event.target instanceof Element ? event.target.closest("[data-agent-native-editor-option]") : null;
|
|
1315
|
+
if (editorOption) {
|
|
1316
|
+
event.preventDefault();
|
|
1317
|
+
event.stopPropagation();
|
|
1318
|
+
setPreferredEditor(editorOption.getAttribute("data-agent-native-editor-option"), true);
|
|
1319
|
+
closeEditorMenus();
|
|
1320
|
+
return;
|
|
1321
|
+
}
|
|
1322
|
+
const editorTrigger = event.target instanceof Element ? event.target.closest("[data-agent-native-editor-trigger]") : null;
|
|
1323
|
+
if (editorTrigger) {
|
|
1324
|
+
event.preventDefault();
|
|
1325
|
+
event.stopPropagation();
|
|
1326
|
+
const picker = editorTrigger.closest("[data-agent-native-editor-picker]");
|
|
1327
|
+
const willOpen = picker?.getAttribute("data-open") !== "true";
|
|
1328
|
+
closeEditorMenus(picker);
|
|
1329
|
+
if (picker && willOpen) {
|
|
1330
|
+
picker.setAttribute("data-open", "true");
|
|
1331
|
+
editorTrigger.setAttribute("aria-expanded", "true");
|
|
1332
|
+
} else {
|
|
1333
|
+
picker?.removeAttribute("data-open");
|
|
1334
|
+
editorTrigger.setAttribute("aria-expanded", "false");
|
|
1335
|
+
}
|
|
1336
|
+
return;
|
|
1337
|
+
}
|
|
1338
|
+
const previewButton = event.target instanceof Element ? event.target.closest("[data-agent-native-code-preview]") : null;
|
|
1339
|
+
if (previewButton) {
|
|
1340
|
+
event.preventDefault();
|
|
1341
|
+
event.stopPropagation();
|
|
1342
|
+
showCodePopover(previewButton, previewButton.getAttribute("data-agent-native-code-preview") || "");
|
|
1343
|
+
return;
|
|
1344
|
+
}
|
|
1345
|
+
const editorButton = event.target instanceof Element ? event.target.closest("[data-agent-native-open-file], [data-agent-native-open-selected-editor]") : null;
|
|
1346
|
+
if (editorButton) {
|
|
1347
|
+
event.preventDefault();
|
|
1348
|
+
event.stopPropagation();
|
|
1349
|
+
const picker = editorButton.closest("[data-agent-native-editor-picker]");
|
|
1350
|
+
const select = picker?.querySelector?.("[data-agent-native-editor-select]");
|
|
1351
|
+
const editor = normalizeEditor(picker?.getAttribute("data-editor") || select?.value || preferredEditor);
|
|
1352
|
+
const directHref = editorButton.getAttribute("data-agent-native-open-" + editor) || "";
|
|
1353
|
+
const filePath = editorButton.getAttribute("data-agent-native-open-file") || "";
|
|
1354
|
+
const line = editorButton.getAttribute("data-agent-native-open-line") || "";
|
|
1355
|
+
const href = directHref || hrefForEditor(editor, filePath, line);
|
|
1356
|
+
closeEditorMenus();
|
|
1357
|
+
window.parent.postMessage({ type: "agent-native-plan-open-editor", href }, "*");
|
|
1358
|
+
return;
|
|
1359
|
+
}
|
|
1360
|
+
const link = event.target instanceof Element ? event.target.closest("a[href]") : null;
|
|
1361
|
+
if (!state.annotateMode && link) {
|
|
1362
|
+
const href = link.getAttribute("href") || "";
|
|
1363
|
+
if (href === "#" || href.trim() === "") {
|
|
1364
|
+
event.preventDefault();
|
|
1365
|
+
event.stopPropagation();
|
|
1366
|
+
window.parent.postMessage({ type: "agent-native-plan-link-blocked", href }, "*");
|
|
1367
|
+
return;
|
|
1368
|
+
}
|
|
1369
|
+
if (href && !href.startsWith("#")) {
|
|
1370
|
+
event.preventDefault();
|
|
1371
|
+
event.stopPropagation();
|
|
1372
|
+
window.parent.postMessage({ type: "agent-native-plan-link-blocked", href }, "*");
|
|
1373
|
+
return;
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
if (!state.annotateMode) {
|
|
1377
|
+
if (event.target instanceof Element && event.target.closest(".an-plan-selection-toolbar")) return;
|
|
1378
|
+
if (event.target instanceof Element && event.target.closest(".an-plan-code-popover")) return;
|
|
1379
|
+
closeEditorMenus();
|
|
1380
|
+
hideCodePopover();
|
|
1381
|
+
window.parent.postMessage({ type: "agent-native-plan-close-comment-popover" }, "*");
|
|
1382
|
+
return;
|
|
1383
|
+
}
|
|
1384
|
+
if (!state.annotateMode) return;
|
|
1385
|
+
if (event.target instanceof Element && event.target.closest("[data-agent-native-plan-marker]")) return;
|
|
1386
|
+
hideSelectionToolbar();
|
|
1387
|
+
event.preventDefault();
|
|
1388
|
+
event.stopPropagation();
|
|
1389
|
+
const doc = document.documentElement;
|
|
1390
|
+
const target = event.target instanceof Element ? event.target : null;
|
|
1391
|
+
const section = closestSection(target);
|
|
1392
|
+
const visual = closestVisualContext(target);
|
|
1393
|
+
const visualRect = visual?.getBoundingClientRect?.();
|
|
1394
|
+
const tabContext = tabContextForElement(visual || target || section);
|
|
1395
|
+
const textAnchor = visual ? null : anchorFromPoint(event.clientX, event.clientY, target);
|
|
1396
|
+
const textQuote = visual ? "" : closestTextContext(target);
|
|
1397
|
+
const visualX = visualRect ? pct(event.clientX - visualRect.left, visualRect.width) : undefined;
|
|
1398
|
+
const visualY = visualRect ? pct(event.clientY - visualRect.top, visualRect.height) : undefined;
|
|
1399
|
+
const fallbackAnchor = {
|
|
1400
|
+
x: pct(event.pageX, doc.scrollWidth),
|
|
1401
|
+
y: pct(event.pageY, Math.max(doc.scrollHeight, document.body.scrollHeight)),
|
|
1402
|
+
sectionId: section?.getAttribute("data-plan-section-id") || section?.id || undefined,
|
|
1403
|
+
sectionTitle: sectionTitle(section) || undefined,
|
|
1404
|
+
...tabContext,
|
|
1405
|
+
snippet: textQuote || (target ? textSnippet(target) : ""),
|
|
1406
|
+
textQuote: textQuote || undefined,
|
|
1407
|
+
anchorKind: visual ? "visual" : textQuote ? "text" : "point",
|
|
1408
|
+
visualLabel: visual ? visualLabel(visual, section) : undefined,
|
|
1409
|
+
visualX,
|
|
1410
|
+
visualY,
|
|
1411
|
+
tagName: target ? target.tagName.toLowerCase() : undefined
|
|
1412
|
+
};
|
|
1413
|
+
const anchoredFallback = withTargetAnchor(fallbackAnchor, visual || target, event.clientX, event.clientY);
|
|
1414
|
+
window.parent.postMessage({
|
|
1415
|
+
type: "agent-native-plan-annotate",
|
|
1416
|
+
anchor: textAnchor ? { ...textAnchor, ...tabContext } : anchoredFallback
|
|
1417
|
+
}, "*");
|
|
1418
|
+
}, true);
|
|
1419
|
+
})();
|
|
1420
|
+
</script>`;
|
|
1421
|
+
if (html.includes("</body>")) {
|
|
1422
|
+
return html.replace("</body>", `${runtime}</body>`);
|
|
1423
|
+
}
|
|
1424
|
+
return `${html}${runtime}`;
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
function escapeRuntimeJsString(value: string) {
|
|
1428
|
+
return value
|
|
1429
|
+
.replace(/\\/g, "\\\\")
|
|
1430
|
+
.replace(/'/g, "\\'")
|
|
1431
|
+
.replace(/&/g, "&")
|
|
1432
|
+
.replace(/</g, "\\u003c")
|
|
1433
|
+
.replace(/>/g, "\\u003e")
|
|
1434
|
+
.replace(/"/g, """);
|
|
1435
|
+
}
|