@agent-native/core 0.97.0 → 0.98.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 +56 -0
- package/corpus/core/docs/content/authentication.mdx +3 -3
- package/corpus/core/docs/content/doctor.mdx +170 -0
- package/corpus/core/docs/content/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/ar-SA/authentication.mdx +2 -2
- package/corpus/core/docs/content/locales/ar-SA/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/ar-SA/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/ar-SA/security.mdx +2 -0
- package/corpus/core/docs/content/locales/de-DE/authentication.mdx +1 -1
- package/corpus/core/docs/content/locales/de-DE/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/de-DE/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/de-DE/security.mdx +2 -0
- package/corpus/core/docs/content/locales/es-ES/authentication.mdx +2 -2
- package/corpus/core/docs/content/locales/es-ES/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/es-ES/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/es-ES/security.mdx +2 -0
- package/corpus/core/docs/content/locales/fr-FR/authentication.mdx +1 -1
- package/corpus/core/docs/content/locales/fr-FR/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/fr-FR/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/fr-FR/security.mdx +2 -0
- package/corpus/core/docs/content/locales/hi-IN/authentication.mdx +2 -2
- package/corpus/core/docs/content/locales/hi-IN/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/hi-IN/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/hi-IN/security.mdx +2 -0
- package/corpus/core/docs/content/locales/ja-JP/authentication.mdx +2 -2
- package/corpus/core/docs/content/locales/ja-JP/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/ja-JP/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/ja-JP/security.mdx +2 -0
- package/corpus/core/docs/content/locales/ko-KR/authentication.mdx +2 -2
- package/corpus/core/docs/content/locales/ko-KR/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/ko-KR/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/ko-KR/security.mdx +2 -0
- package/corpus/core/docs/content/locales/pt-BR/authentication.mdx +2 -2
- package/corpus/core/docs/content/locales/pt-BR/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/pt-BR/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/pt-BR/security.mdx +2 -0
- package/corpus/core/docs/content/locales/zh-CN/authentication.mdx +2 -2
- package/corpus/core/docs/content/locales/zh-CN/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/zh-CN/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-CN/security.mdx +2 -0
- package/corpus/core/docs/content/locales/zh-TW/authentication.mdx +2 -2
- package/corpus/core/docs/content/locales/zh-TW/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/zh-TW/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-TW/security.mdx +2 -0
- package/corpus/core/docs/content/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/security.mdx +2 -0
- package/corpus/core/package.json +6 -2
- package/corpus/core/scripts/finalize-build.mjs +63 -3
- package/corpus/core/scripts/materialize-source-corpus.mjs +101 -15
- package/corpus/core/src/action-change-marker.ts +8 -1
- package/corpus/core/src/action.ts +42 -0
- package/corpus/core/src/agent/engine/builder-engine.ts +3 -0
- package/corpus/core/src/agent/engine/context-directives-transform.ts +69 -0
- package/corpus/core/src/agent/engine/continuation-dispatch-retry.ts +168 -0
- package/corpus/core/src/agent/engine/tool-call-journal-seed.ts +85 -0
- package/corpus/core/src/agent/production-agent.ts +129 -244
- package/corpus/core/src/changelog/parse.ts +8 -3
- package/corpus/core/src/cli/doctor.ts +9 -3
- package/corpus/core/src/cli/plan-local.ts +10 -2
- package/corpus/core/src/cli/skills-content/assets-skill.ts +83 -0
- package/corpus/core/src/cli/skills-content/canvas.ts +153 -0
- package/corpus/core/src/cli/skills-content/connection.ts +52 -0
- package/corpus/core/src/cli/skills-content/content-skill.ts +109 -0
- package/corpus/core/src/cli/skills-content/design-exploration-skill.ts +118 -0
- package/corpus/core/src/cli/skills-content/design-visual-edit-skill.ts +228 -0
- package/corpus/core/src/cli/skills-content/document-quality.ts +196 -0
- package/corpus/core/src/cli/skills-content/exemplar.ts +69 -0
- package/corpus/core/src/cli/skills-content/help.ts +77 -0
- package/corpus/core/src/cli/skills-content/index.ts +22 -0
- package/corpus/core/src/cli/skills-content/local-files.ts +95 -0
- package/corpus/core/src/cli/skills-content/plan-setup-auth.ts +80 -0
- package/corpus/core/src/cli/skills-content/visual-plan-skill.ts +470 -0
- package/corpus/core/src/cli/skills-content/visual-recap-skill.ts +547 -0
- package/corpus/core/src/cli/skills-content/visualize-repo-skill.ts +93 -0
- package/corpus/core/src/cli/skills-content/wireframe.ts +349 -0
- package/corpus/core/src/cli/skills.ts +27 -2733
- package/corpus/core/src/client/AgentPanel.tsx +8 -8
- package/corpus/core/src/client/AssistantChat.tsx +83 -39
- package/corpus/core/src/client/CommandMenu.tsx +16 -5
- package/corpus/core/src/client/FeedbackButton.tsx +2 -2
- package/corpus/core/src/client/analytics.ts +29 -0
- package/corpus/core/src/client/app-providers.tsx +18 -5
- package/corpus/core/src/client/blocks/library/wireframe-kit.tsx +16 -2
- package/corpus/core/src/client/chat/tool-call-display.tsx +3 -3
- package/corpus/core/src/client/chat-model-groups.ts +28 -0
- package/corpus/core/src/client/composer/PastedTextChip.tsx +1 -1
- package/corpus/core/src/client/composer/RealtimeVoiceMode.tsx +523 -68
- package/corpus/core/src/client/composer/TiptapComposer.tsx +47 -30
- package/corpus/core/src/client/composer/VoiceButton.tsx +22 -5
- package/corpus/core/src/client/composer/index.ts +5 -0
- package/corpus/core/src/client/composer/useRealtimeVoiceMode.tsx +1271 -35
- package/corpus/core/src/client/context-xray/ContextXRayPanel.tsx +5 -2
- package/corpus/core/src/client/extensions/ExtensionEditor.tsx +37 -4
- package/corpus/core/src/client/extensions/ExtensionQueryErrorState.tsx +47 -0
- package/corpus/core/src/client/extensions/ExtensionSlot.tsx +39 -10
- package/corpus/core/src/client/extensions/ExtensionViewer.tsx +44 -6
- package/corpus/core/src/client/extensions/ExtensionsListPage.tsx +12 -3
- package/corpus/core/src/client/extensions/ExtensionsSidebarSection.tsx +49 -11
- package/corpus/core/src/client/index.ts +5 -13
- package/corpus/core/src/client/progress/RunsTray.tsx +23 -4
- package/corpus/core/src/client/settings/SecretsSection.tsx +387 -266
- package/corpus/core/src/client/settings/SettingsPanel.tsx +117 -38
- package/corpus/core/src/client/settings/SettingsTabsPage.tsx +7 -0
- package/corpus/core/src/client/settings/useBuilderStatus.ts +6 -0
- package/corpus/core/src/client/tool-cells/EditCell.tsx +19 -16
- package/corpus/core/src/client/tool-cells/FilesChangedSummary.tsx +26 -23
- package/corpus/core/src/client/tool-cells/WriteCell.tsx +19 -16
- package/corpus/core/src/client/use-action.ts +12 -0
- package/corpus/core/src/client/use-agent-chat-home-handoff.ts +8 -1
- package/corpus/core/src/client/use-agent-engine-configured.ts +17 -3
- package/corpus/core/src/client/use-db-sync.ts +84 -34
- package/corpus/core/src/client/use-pausing-interval.ts +14 -4
- package/corpus/core/src/client/visual-style-controls.tsx +1 -1
- package/corpus/core/src/deploy/build.ts +36 -14
- package/corpus/core/src/integrations/google-docs-poller.ts +23 -2
- package/corpus/core/src/integrations/plugin.ts +10 -0
- package/corpus/core/src/integrations/scope-store.ts +1 -1
- package/corpus/core/src/integrations/usage-budget-store.ts +1 -1
- package/corpus/core/src/integrations/webhook-handler.ts +27 -2
- package/corpus/core/src/jobs/scheduler.ts +28 -2
- package/corpus/core/src/localization/default-messages.ts +51 -1
- package/corpus/core/src/mcp/oauth-token.ts +6 -1
- package/corpus/core/src/mcp-client/workspace-servers.ts +4 -4
- package/corpus/core/src/observability/routes.ts +36 -0
- package/corpus/core/src/observability/sentiment.ts +261 -0
- package/corpus/core/src/observability/store.ts +23 -0
- package/corpus/core/src/observability/traces.ts +49 -63
- package/corpus/core/src/observability/tracking-identity.ts +55 -0
- package/corpus/core/src/observability/types.ts +13 -0
- package/corpus/core/src/secrets/crypto.ts +28 -8
- package/corpus/core/src/secrets/storage.ts +67 -3
- package/corpus/core/src/server/action-change.ts +5 -1
- package/corpus/core/src/server/action-routes.ts +8 -0
- package/corpus/core/src/server/agent-chat/action-filters-a2a.ts +199 -0
- package/corpus/core/src/server/agent-chat/browser-team-tools.ts +510 -0
- package/corpus/core/src/server/agent-chat/context-tools.ts +595 -0
- package/corpus/core/src/server/agent-chat/framework-prompts.ts +470 -0
- package/corpus/core/src/server/agent-chat/lazy-fs.ts +11 -0
- package/corpus/core/src/server/agent-chat/mcp-glue.ts +91 -0
- package/corpus/core/src/server/agent-chat/plugin-options.ts +350 -0
- package/corpus/core/src/server/agent-chat/process-run-failure.ts +62 -0
- package/corpus/core/src/server/agent-chat/prompt-resources.ts +688 -0
- package/corpus/core/src/server/agent-chat/recurring-jobs-runtime.ts +80 -0
- package/corpus/core/src/server/agent-chat/request-surface.ts +71 -0
- package/corpus/core/src/server/agent-chat/run-code-tools.ts +67 -0
- package/corpus/core/src/server/agent-chat/script-entries.ts +779 -0
- package/corpus/core/src/server/agent-chat/shared-thread.ts +301 -0
- package/corpus/core/src/server/agent-chat/skill-frontmatter.ts +41 -0
- package/corpus/core/src/server/agent-chat-plugin.ts +364 -4182
- package/corpus/core/src/server/agent-teams.ts +26 -3
- package/corpus/core/src/server/auth.ts +55 -57
- package/corpus/core/src/server/credential-provider.ts +22 -25
- package/corpus/core/src/server/edge.ts +1 -0
- package/corpus/core/src/server/onboarding-html.ts +1 -16
- package/corpus/core/src/server/poll.ts +1 -0
- package/corpus/core/src/server/realtime-voice.ts +335 -14
- package/corpus/core/src/server/request-origin.ts +6 -2
- package/corpus/core/src/server/ssr-handler.ts +55 -2
- package/corpus/core/src/sharing/access.ts +155 -11
- package/corpus/core/src/sharing/registry.ts +7 -0
- package/corpus/core/src/styles/agent-native.css +17 -16
- package/corpus/core/src/templates/default/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/core/src/templates/default/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/core/src/templates/default/app/i18n/ar-SA.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/de-DE.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/en-US.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/es-ES.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/fr-FR.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/hi-IN.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/ja-JP.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/ko-KR.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/pt-BR.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/zh-CN.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/zh-TW.ts +6 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +27 -29
- package/corpus/core/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +2 -1
- package/corpus/core/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/core/src/templates/workspace-core/.agents/skills/observability/SKILL.md +32 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/core/src/templates/workspace-core/.agents/skills/secrets/SKILL.md +7 -3
- package/corpus/core/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +39 -9
- package/corpus/core/src/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +25 -0
- package/corpus/core/src/templates/workspace-core/src/server/index.ts +4 -2
- package/corpus/core/src/testing.ts +26 -0
- package/corpus/core/src/triggers/dispatcher.ts +23 -2
- package/corpus/core/src/vite/client.ts +135 -3
- package/corpus/core/tsconfig.cli.json +1 -1
- package/corpus/core/tsconfig.json +5 -1
- package/corpus/templates/analytics/.agents/skills/bigquery/SKILL.md +2 -2
- package/corpus/templates/analytics/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/analytics/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/analytics/.agents/skills/session-replay/SKILL.md +10 -5
- package/corpus/templates/analytics/AGENTS.md +15 -6
- package/corpus/templates/analytics/actions/install-dashboard-template.ts +79 -43
- package/corpus/templates/analytics/actions/list-explorer-dashboards.ts +3 -3
- package/corpus/templates/analytics/actions/list-sql-dashboards.ts +8 -3
- package/corpus/templates/analytics/actions/navigate.ts +59 -5
- package/corpus/templates/analytics/actions/rename-analysis.ts +8 -2
- package/corpus/templates/analytics/actions/rename-dashboard.ts +8 -7
- package/corpus/templates/analytics/actions/view-screen.ts +7 -29
- package/corpus/templates/analytics/app/components/ProviderCorpusJobNotifier.tsx +20 -3
- package/corpus/templates/analytics/app/components/ResourceLoadError.tsx +42 -0
- package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +2 -1
- package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +85 -70
- package/corpus/templates/analytics/app/components/layout/Header.tsx +1 -1
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +128 -95
- package/corpus/templates/analytics/app/components/layout/SidebarLoadError.tsx +24 -0
- package/corpus/templates/analytics/app/global.css +19 -20
- package/corpus/templates/analytics/app/hooks/use-dashboard-views.ts +15 -5
- package/corpus/templates/analytics/app/i18n/zh-TW.ts +4 -0
- package/corpus/templates/analytics/app/i18n-data.ts +40 -0
- package/corpus/templates/analytics/app/lib/provider-corpus-job-sync.ts +26 -0
- package/corpus/templates/analytics/app/pages/Settings.tsx +41 -343
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/SqlPreview.tsx +36 -20
- package/corpus/templates/analytics/app/pages/adhoc/explorer/index.tsx +34 -20
- package/corpus/templates/analytics/app/pages/adhoc/explorer/use-explorer-config.ts +42 -41
- package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +43 -36
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/ViewsMenu.tsx +11 -2
- package/corpus/templates/analytics/app/pages/monitoring/ErrorsPanel.tsx +38 -7
- package/corpus/templates/analytics/app/pages/monitoring/MonitoringPage.tsx +1 -1
- package/corpus/templates/analytics/app/pages/monitoring/errors/i18n.ts +3 -0
- package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +333 -272
- package/corpus/templates/analytics/app/pages/sessions/SessionDevToolsPanel.tsx +72 -17
- package/corpus/templates/analytics/app/pages/sessions/SessionsPage.tsx +297 -108
- package/corpus/templates/analytics/app/root.tsx +40 -8
- package/corpus/templates/analytics/app/routes/_index.tsx +14 -2
- package/corpus/templates/analytics/changelog/2026-06-24-first-party-signup-and-pageview-panels-now-honor-dashboard-filters.md +2 -1
- package/corpus/templates/analytics/changelog/2026-06-25-referrer-dashboard-panels-show-external-domains.md +2 -1
- package/corpus/templates/analytics/changelog/2026-07-03-agent-llm-observability-dashboard.md +1 -1
- package/corpus/templates/analytics/changelog/2026-07-06-mobile-chat-header-is-more-compact-and-the-menu-button-opens-navigation.md +1 -0
- package/corpus/templates/analytics/changelog/2026-07-08-dashboard-history-and-chat-context.md +1 -0
- package/corpus/templates/analytics/changelog/2026-07-08-settings-are-cleaner-searchable-and-alerts-have-their-own-tab.md +1 -0
- package/corpus/templates/analytics/changelog/2026-07-08-sidebar-sections-stay-collapsed-until-opened.md +1 -0
- package/corpus/templates/analytics/changelog/2026-07-11-agent-feedback-sentiment-dashboard.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-analytics-chats-now-start-faster-by-loading-metric-definitio.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-analytics-no-longer-repeatedly-restarts-background-requests-.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-analytics-only-asks-for-replay-storage-when-you-enable-sessi.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-charts-now-show-their-loading-skeleton-while-refreshing.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-command-and-sql-previews-now-respond-without-lag.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-command-search-now-reports-loading-failures-and-lets-you-ret.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-dashboard-navigation-now-loads-faster-and-reports-request-fa.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-inferred-message-sentiment-dashboard.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-microphone-settings-from-realtime-voice-mode-now-open-the-vo.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-more-dashboard-edit-paths-are-now-safe-against-simultaneous-.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-realtime-voice-now-shows-a-clear-connection-indicator-comple.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-renaming-a-dashboard-is-now-safe-against-simultaneous-agent-.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-renaming-an-analysis-is-now-safe-against-simultaneous-edits.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-replay-event-counts-stay-hidden-until-recordings-finish-load.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-replay-storage-key-mismatches-show-actionable-setup-guidance.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-replay-timelines-group-continuous-scrolling-and-dev-tools-co.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-session-filters-now-stay-compact-in-a-settings-menu-at-mediu.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-session-replay-console-errors-now-link-to-matching-issues-or.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-session-replays-load-large-recordings-faster-and-surface-fai.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-session-replays-preserve-recorded-styles-and-viewport-layout.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-session-replays-stay-centered-instead-of-clipping-wide-recor.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-workspace-mounted-analytics-now-opens-ask-reliably-and-route.md +6 -0
- package/corpus/templates/analytics/docs/schemas/first-party-analytics.md +37 -3
- package/corpus/templates/analytics/package.json +1 -1
- package/corpus/templates/analytics/seeds/dashboards/agent-native-templates-first-party.json +37 -1
- package/corpus/templates/analytics/server/handlers/session-replay.ts +57 -0
- package/corpus/templates/analytics/server/lib/dashboard-catalog.ts +1 -24
- package/corpus/templates/analytics/server/lib/dashboard-seeds.ts +0 -5
- package/corpus/templates/analytics/server/lib/dashboards-store.ts +289 -20
- package/corpus/templates/analytics/server/lib/data-dictionary-context.ts +106 -34
- package/corpus/templates/analytics/server/lib/demo-dashboards.ts +20 -4
- package/corpus/templates/analytics/server/lib/session-replay-agent-context.ts +12 -0
- package/corpus/templates/analytics/server/lib/session-replay.ts +208 -2
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +11 -39
- package/corpus/templates/analytics/server/plugins/onboarding.ts +7 -79
- package/corpus/templates/analytics/server/routes/api/session-replay/recordings/[recordingId]/chunks.get.ts +1 -0
- package/corpus/templates/assets/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/assets/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/assets/app/components/create/RecentDraftsSection.tsx +30 -4
- package/corpus/templates/assets/app/global.css +4 -4
- package/corpus/templates/assets/app/routes/brand-kits.$id.tsx +0 -1
- package/corpus/templates/assets/app/routes/library.tsx +49 -6
- package/corpus/templates/assets/changelog/2026-07-11-library-load-failures-now-show-a-retry-action.md +6 -0
- package/corpus/templates/brain/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/brain/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/brain/app/global.css +5 -5
- package/corpus/templates/brain/app/root.tsx +0 -3
- package/corpus/templates/calendar/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/calendar/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/calendar/.env.example +5 -0
- package/corpus/templates/calendar/app/components/calendar/EventCard.tsx +2 -2
- package/corpus/templates/calendar/app/i18n/zh-TW.ts +2 -0
- package/corpus/templates/calendar/app/i18n-data.ts +20 -0
- package/corpus/templates/calendar/app/pages/BookingLinksPage.tsx +37 -1
- package/corpus/templates/calendar/app/pages/BookingsList.tsx +20 -3
- package/corpus/templates/calendar/app/root.tsx +1 -0
- package/corpus/templates/calendar/changelog/2026-07-11-booking-load-failures-now-show-a-retry-action.md +6 -0
- package/corpus/templates/calendar/changelog/2026-07-11-event-cards-give-subtle-press-feedback-and-smoother-hover.md +6 -0
- package/corpus/templates/chat/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/chat/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/clips/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/clips/actions/decline-invite.ts +8 -0
- package/corpus/templates/clips/app/components/library/folder-tree.tsx +209 -187
- package/corpus/templates/clips/app/components/meetings/meeting-card.tsx +2 -2
- package/corpus/templates/clips/app/components/player/reactions-tray.tsx +17 -5
- package/corpus/templates/clips/app/components/player/scrubber.tsx +5 -3
- package/corpus/templates/clips/app/components/recorder/pre-record-panel.tsx +2 -2
- package/corpus/templates/clips/app/components/workspace/insights-hub.tsx +119 -95
- package/corpus/templates/clips/app/global.css +45 -0
- package/corpus/templates/clips/app/hooks/use-auto-title.ts +74 -8
- package/corpus/templates/clips/app/hooks/use-library.ts +12 -25
- package/corpus/templates/clips/app/root.tsx +4 -0
- package/corpus/templates/clips/app/routes/_app.notifications.tsx +23 -2
- package/corpus/templates/clips/app/routes/_app.settings._index.tsx +20 -22
- package/corpus/templates/clips/app/routes/_app.trash.tsx +24 -2
- package/corpus/templates/clips/changelog/2026-07-11-controls-and-folders-now-move-more-smoothly.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-11-declining-an-invitation-now-requires-being-its-recipient.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-11-generated-titles-no-longer-cause-continuous-background-refreshes.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-11-recording-overlays-are-lighter-weight-and-no-longer-cause-pa.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-11-s3-storage-setup-stays-collapsed-until-you-choose-it-as-the-.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-11-workspace-load-failures-now-show-a-retry-action.md +6 -0
- package/corpus/templates/clips/chrome-extension/src/overlay.css +34 -5
- package/corpus/templates/clips/chrome-extension/src/styles.css +2 -2
- package/corpus/templates/clips/desktop/src/styles.css +71 -26
- package/corpus/templates/content/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/content/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/content/actions/move-document.ts +34 -18
- package/corpus/templates/content/app/components/QueryErrorState.tsx +39 -0
- package/corpus/templates/content/app/components/editor/LinkHoverPreview.tsx +1 -1
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +225 -1435
- package/corpus/templates/content/app/components/editor/database/GalleryView.tsx +368 -0
- package/corpus/templates/content/app/components/editor/database/ListView.tsx +353 -0
- package/corpus/templates/content/app/components/editor/database/TimelineView.tsx +580 -0
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +11 -2
- package/corpus/templates/content/app/global.css +19 -19
- package/corpus/templates/content/app/hooks/use-comments.ts +0 -1
- package/corpus/templates/content/app/root.tsx +2 -2
- package/corpus/templates/content/app/routes/_app._index.tsx +11 -1
- package/corpus/templates/content/changelog/2026-07-11-comments-now-update-from-live-collaboration-events-without-c.md +6 -0
- package/corpus/templates/content/changelog/2026-07-11-document-load-failures-now-show-a-retry-action.md +6 -0
- package/corpus/templates/content/changelog/2026-07-11-editor-toggle-feedback-now-feels-more-responsive.md +6 -0
- package/corpus/templates/content/changelog/2026-07-11-moving-documents-at-the-same-time-no-longer-scrambles-their-.md +6 -0
- package/corpus/templates/content/changelog/2026-07-11-public-document-chats-now-start-faster-while-keeping-full-do.md +6 -0
- package/corpus/templates/content/changelog/2026-07-11-reopening-a-comment-now-uses-consistent-permissions-everywhe.md +6 -0
- package/corpus/templates/content/changelog/2026-07-11-sidebar-resizing-now-tracks-your-cursor-instantly-instead-of.md +6 -0
- package/corpus/templates/content/server/lib/public-documents.ts +47 -10
- package/corpus/templates/content/server/routes/api/comments/[id].patch.ts +24 -24
- package/corpus/templates/design/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/design/app/components/QueryErrorState.tsx +24 -0
- package/corpus/templates/design/app/components/design/CanvasContextMenu.tsx +1 -1
- package/corpus/templates/design/app/components/design/DesignImportPanel.tsx +5 -2
- package/corpus/templates/design/app/components/design/EditPanel.tsx +326 -319
- package/corpus/templates/design/app/components/design/LayersPanel.tsx +198 -193
- package/corpus/templates/design/app/components/design/edit-panel/panel-primitives.tsx +11 -4
- package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +1 -1
- package/corpus/templates/design/app/components/layout/Header.tsx +1 -1
- package/corpus/templates/design/app/components/layout/Layout.tsx +1 -1
- package/corpus/templates/design/app/pages/DesignSystems.tsx +7 -1
- package/corpus/templates/design/app/pages/Index.tsx +14 -2
- package/corpus/templates/design/app/pages/Present.tsx +16 -3
- package/corpus/templates/design/app/pages/Templates.tsx +10 -4
- package/corpus/templates/design/app/pages/design-editor/canvas-primitive-insert.ts +484 -0
- package/corpus/templates/design/app/pages/design-editor/clone-and-pen-edit.ts +378 -0
- package/corpus/templates/design/app/pages/design-editor/design-data-geometry-utils.ts +138 -0
- package/corpus/templates/design/app/pages/design-editor/dom-utils.ts +15 -0
- package/corpus/templates/design/app/pages/design-editor/generation-prompt-directives.ts +180 -0
- package/corpus/templates/design/app/pages/design-editor/html-layer-positioning.ts +226 -0
- package/corpus/templates/design/app/pages/design-editor/png-export-render.ts +348 -0
- package/corpus/templates/design/app/pages/design-editor/screen-command-utils.ts +160 -0
- package/corpus/templates/design/app/pages/design-editor/text-edit-utils.ts +238 -0
- package/corpus/templates/design/app/pages/design-editor/tool-state.ts +23 -1
- package/corpus/templates/design/app/pages/design-editor/types.ts +25 -0
- package/corpus/templates/design/app/root.tsx +10 -1
- package/corpus/templates/design/changelog/2026-07-11-canvas-context-menus-now-open-without-motion-jitter.md +6 -0
- package/corpus/templates/design/changelog/2026-07-11-design-load-failures-now-show-a-retry-action.md +6 -0
- package/corpus/templates/design/changelog/2026-07-11-inspector-tooltips-appear-instantly-as-you-sweep-across-icon.md +6 -0
- package/corpus/templates/dispatch/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/dispatch/app/i18n/zh-TW.ts +10 -0
- package/corpus/templates/dispatch/app/i18n-data.ts +123 -0
- package/corpus/templates/dispatch/app/routes/integrations.tsx +163 -144
- package/corpus/templates/dispatch/changelog/2026-07-11-dispatch-mcp-connections-now-start-with-safer-app-access-and.md +6 -0
- package/corpus/templates/dispatch/changelog/2026-07-11-overview-and-chat-now-share-a-cleaner-more-stable-flow.md +6 -0
- package/corpus/templates/dispatch/changelog/2026-07-11-query-errors-now-show-a-retry-option.md +6 -0
- package/corpus/templates/forms/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/forms/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/forms/app/components/layout/Sidebar.tsx +3 -3
- package/corpus/templates/forms/app/root.tsx +34 -8
- package/corpus/templates/macros/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/macros/app/components/DailyProgress.tsx +25 -5
- package/corpus/templates/macros/app/components/QueryErrorState.tsx +31 -0
- package/corpus/templates/macros/app/components/WeightTracker.tsx +5 -1
- package/corpus/templates/macros/app/components/layout/AppLayout.tsx +1 -2
- package/corpus/templates/macros/app/components/ui/button.tsx +1 -1
- package/corpus/templates/macros/app/components/ui/progress.tsx +1 -1
- package/corpus/templates/macros/app/components/ui/tabs.tsx +1 -1
- package/corpus/templates/macros/app/i18n/ar-SA.ts +2 -0
- package/corpus/templates/macros/app/i18n/de-DE.ts +2 -0
- package/corpus/templates/macros/app/i18n/en-US.ts +2 -0
- package/corpus/templates/macros/app/i18n/es-ES.ts +2 -0
- package/corpus/templates/macros/app/i18n/fr-FR.ts +2 -0
- package/corpus/templates/macros/app/i18n/hi-IN.ts +2 -0
- package/corpus/templates/macros/app/i18n/ja-JP.ts +2 -0
- package/corpus/templates/macros/app/i18n/ko-KR.ts +2 -0
- package/corpus/templates/macros/app/i18n/pt-BR.ts +2 -0
- package/corpus/templates/macros/app/i18n/zh-CN.ts +2 -0
- package/corpus/templates/macros/app/i18n/zh-TW.ts +2 -0
- package/corpus/templates/macros/app/root.tsx +0 -3
- package/corpus/templates/macros/app/routes/_index.tsx +22 -12
- package/corpus/templates/macros/app/routes/analytics.tsx +31 -10
- package/corpus/templates/macros/changelog/2026-07-11-daily-tracking-now-loads-and-updates-more-quickly.md +6 -0
- package/corpus/templates/macros/changelog/2026-07-11-data-load-failures-now-show-a-clear-error-with-a-retry-actio.md +6 -0
- package/corpus/templates/mail/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/mail/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/mail/.env.example +16 -11
- package/corpus/templates/mail/actions/list-emails.ts +39 -35
- package/corpus/templates/mail/app/components/email/ComposeModal.tsx +58 -6
- package/corpus/templates/mail/app/components/email/EmailListItem.tsx +35 -2
- package/corpus/templates/mail/app/components/layout/AppLayout.tsx +113 -104
- package/corpus/templates/mail/app/hooks/use-compose-state.ts +1 -0
- package/corpus/templates/mail/app/root.tsx +9 -22
- package/corpus/templates/mail/changelog/2026-07-11-compose-and-navigation-motion-now-feel-faster-and-smoother.md +6 -0
- package/corpus/templates/mail/changelog/2026-07-11-swipe-to-archive-or-snooze-now-responds-to-quick-flicks-not-.md +6 -0
- package/corpus/templates/mail/changelog/2026-07-11-the-assistant-now-sees-the-same-inbox-you-do-snoozed-mail-st.md +6 -0
- package/corpus/templates/mail/server/handlers/emails.ts +25 -69
- package/corpus/templates/mail/server/lib/list-inbox-emails.ts +169 -0
- package/corpus/templates/plan/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/plan/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/plan/.env.example +4 -0
- package/corpus/templates/plan/actions/create-plan-design.ts +89 -81
- package/corpus/templates/plan/actions/create-prototype-plan.ts +72 -59
- package/corpus/templates/plan/actions/create-ui-plan.ts +70 -55
- package/corpus/templates/plan/actions/create-visual-plan.ts +65 -51
- package/corpus/templates/plan/actions/update-local-plan-folder.ts +43 -30
- package/corpus/templates/plan/actions/update-visual-plan.ts +81 -64
- package/corpus/templates/plan/app/components/layout/Sidebar.tsx +17 -0
- package/corpus/templates/plan/app/components/ui/tabs.tsx +1 -1
- package/corpus/templates/plan/app/hooks/use-navigation-state.ts +5 -2
- package/corpus/templates/plan/app/hooks/use-plans.ts +6 -13
- package/corpus/templates/plan/app/i18n/ar-SA.ts +10 -0
- package/corpus/templates/plan/app/i18n/de-DE.ts +10 -0
- package/corpus/templates/plan/app/i18n/en-US.ts +10 -0
- package/corpus/templates/plan/app/i18n/es-ES.ts +10 -0
- package/corpus/templates/plan/app/i18n/fr-FR.ts +10 -0
- package/corpus/templates/plan/app/i18n/hi-IN.ts +10 -0
- package/corpus/templates/plan/app/i18n/ja-JP.ts +10 -0
- package/corpus/templates/plan/app/i18n/ko-KR.ts +10 -0
- package/corpus/templates/plan/app/i18n/pt-BR.ts +10 -0
- package/corpus/templates/plan/app/i18n/zh-CN.ts +10 -0
- package/corpus/templates/plan/app/i18n/zh-TW.ts +10 -0
- package/corpus/templates/plan/app/lib/plan-local-bridge.ts +80 -1
- package/corpus/templates/plan/app/pages/PlansPage.tsx +157 -31
- package/corpus/templates/plan/app/root.tsx +11 -0
- package/corpus/templates/plan/changelog/2026-07-11-local-plans-now-explain-and-recover-from-browser-permission-.md +6 -0
- package/corpus/templates/plan/changelog/2026-07-11-plan-edits-now-save-atomically-and-can-no-longer-partially-a.md +6 -0
- package/corpus/templates/plan/changelog/2026-07-11-plan-lists-now-show-a-clear-error-with-a-retry-action-when-t.md +6 -0
- package/corpus/templates/plan/changelog/2026-07-11-plan-refreshes-only-when-content-changes.md +6 -0
- package/corpus/templates/plan/shared/plan-content.ts +546 -260
- package/corpus/templates/slides/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/slides/actions/delete-slide-comment.ts +49 -0
- package/corpus/templates/slides/actions/update-slide-comment.ts +93 -0
- package/corpus/templates/slides/actions/view-screen.ts +14 -6
- package/corpus/templates/slides/app/components/comments/SlideCommentsPanel.tsx +37 -11
- package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +1 -1
- package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +2 -2
- package/corpus/templates/slides/app/components/editor/GenerateSlidesDialog.tsx +2 -2
- package/corpus/templates/slides/app/components/layout/Header.tsx +1 -1
- package/corpus/templates/slides/app/components/presentation/PresentationView.tsx +4 -2
- package/corpus/templates/slides/app/components/visual-editor/CanvasCommentPins.tsx +4 -3
- package/corpus/templates/slides/app/context/DeckContext.tsx +10 -0
- package/corpus/templates/slides/app/hooks/use-slide-comments.ts +7 -31
- package/corpus/templates/slides/app/i18n/ar-SA.ts +6 -0
- package/corpus/templates/slides/app/i18n/de-DE.ts +6 -0
- package/corpus/templates/slides/app/i18n/en-US.ts +6 -0
- package/corpus/templates/slides/app/i18n/es-ES.ts +6 -0
- package/corpus/templates/slides/app/i18n/fr-FR.ts +6 -0
- package/corpus/templates/slides/app/i18n/hi-IN.ts +6 -0
- package/corpus/templates/slides/app/i18n/ja-JP.ts +6 -0
- package/corpus/templates/slides/app/i18n/ko-KR.ts +6 -0
- package/corpus/templates/slides/app/i18n/pt-BR.ts +6 -0
- package/corpus/templates/slides/app/i18n/zh-CN.ts +5 -0
- package/corpus/templates/slides/app/i18n/zh-TW.ts +5 -0
- package/corpus/templates/slides/app/pages/DesignSystems.tsx +23 -2
- package/corpus/templates/slides/app/pages/Index.tsx +29 -1
- package/corpus/templates/slides/changelog/2026-07-11-comment-load-failures-now-show-a-retry-action-instead-of-say.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-11-comment-pins-now-clear-with-a-faster-smoother-confirmation.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-11-comments-now-update-from-live-collaboration-events-without-c.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-11-deck-and-design-system-load-failures-now-show-a-retry-action.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-11-editor-toggles-and-toolbar-menus-now-animate-smoothly.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-11-the-assistant-can-now-resolve-reopen-and-delete-slide-commen.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-11-viewing-slides-no-longer-loads-every-deck-s-full-contents-in.md +6 -0
- package/corpus/templates/slides/server/routes/api/comments/[id].delete.ts +29 -48
- package/corpus/templates/slides/server/routes/api/comments/[id].patch.ts +29 -65
- package/dist/action-change-marker.d.ts +1 -0
- package/dist/action-change-marker.d.ts.map +1 -1
- package/dist/action-change-marker.js +7 -1
- package/dist/action-change-marker.js.map +1 -1
- package/dist/action.d.ts +23 -0
- package/dist/action.d.ts.map +1 -1
- package/dist/action.js +13 -0
- package/dist/action.js.map +1 -1
- package/dist/agent/engine/builder-engine.d.ts.map +1 -1
- package/dist/agent/engine/builder-engine.js +3 -0
- package/dist/agent/engine/builder-engine.js.map +1 -1
- package/dist/agent/engine/context-directives-transform.d.ts +25 -0
- package/dist/agent/engine/context-directives-transform.d.ts.map +1 -0
- package/dist/agent/engine/context-directives-transform.js +53 -0
- package/dist/agent/engine/context-directives-transform.js.map +1 -0
- package/dist/agent/engine/continuation-dispatch-retry.d.ts +40 -0
- package/dist/agent/engine/continuation-dispatch-retry.d.ts.map +1 -0
- package/dist/agent/engine/continuation-dispatch-retry.js +109 -0
- package/dist/agent/engine/continuation-dispatch-retry.js.map +1 -0
- package/dist/agent/engine/tool-call-journal-seed.d.ts +46 -0
- package/dist/agent/engine/tool-call-journal-seed.d.ts.map +1 -0
- package/dist/agent/engine/tool-call-journal-seed.js +60 -0
- package/dist/agent/engine/tool-call-journal-seed.js.map +1 -0
- package/dist/agent/production-agent.d.ts +7 -0
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +102 -222
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/changelog/parse.d.ts +4 -2
- package/dist/changelog/parse.d.ts.map +1 -1
- package/dist/changelog/parse.js +5 -3
- package/dist/changelog/parse.js.map +1 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +7 -3
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/plan-local.d.ts.map +1 -1
- package/dist/cli/plan-local.js +8 -2
- package/dist/cli/plan-local.js.map +1 -1
- package/dist/cli/skills-content/assets-skill.d.ts +2 -0
- package/dist/cli/skills-content/assets-skill.d.ts.map +1 -0
- package/dist/cli/skills-content/assets-skill.js +84 -0
- package/dist/cli/skills-content/assets-skill.js.map +1 -0
- package/dist/cli/skills-content/canvas.d.ts +4 -0
- package/dist/cli/skills-content/canvas.d.ts.map +1 -0
- package/dist/cli/skills-content/canvas.js +152 -0
- package/dist/cli/skills-content/canvas.js.map +1 -0
- package/dist/cli/skills-content/connection.d.ts +2 -0
- package/dist/cli/skills-content/connection.d.ts.map +1 -0
- package/dist/cli/skills-content/connection.js +53 -0
- package/dist/cli/skills-content/connection.js.map +1 -0
- package/dist/cli/skills-content/content-skill.d.ts +2 -0
- package/dist/cli/skills-content/content-skill.d.ts.map +1 -0
- package/dist/cli/skills-content/content-skill.js +110 -0
- package/dist/cli/skills-content/content-skill.js.map +1 -0
- package/dist/cli/skills-content/design-exploration-skill.d.ts +2 -0
- package/dist/cli/skills-content/design-exploration-skill.d.ts.map +1 -0
- package/dist/cli/skills-content/design-exploration-skill.js +119 -0
- package/dist/cli/skills-content/design-exploration-skill.js.map +1 -0
- package/dist/cli/skills-content/design-visual-edit-skill.d.ts +2 -0
- package/dist/cli/skills-content/design-visual-edit-skill.d.ts.map +1 -0
- package/dist/cli/skills-content/design-visual-edit-skill.js +229 -0
- package/dist/cli/skills-content/design-visual-edit-skill.js.map +1 -0
- package/dist/cli/skills-content/document-quality.d.ts +4 -0
- package/dist/cli/skills-content/document-quality.d.ts.map +1 -0
- package/dist/cli/skills-content/document-quality.js +195 -0
- package/dist/cli/skills-content/document-quality.js.map +1 -0
- package/dist/cli/skills-content/exemplar.d.ts +4 -0
- package/dist/cli/skills-content/exemplar.d.ts.map +1 -0
- package/dist/cli/skills-content/exemplar.js +68 -0
- package/dist/cli/skills-content/exemplar.js.map +1 -0
- package/dist/cli/skills-content/help.d.ts +2 -0
- package/dist/cli/skills-content/help.d.ts.map +1 -0
- package/dist/cli/skills-content/help.js +78 -0
- package/dist/cli/skills-content/help.js.map +1 -0
- package/dist/cli/skills-content/index.d.ts +23 -0
- package/dist/cli/skills-content/index.d.ts.map +1 -0
- package/dist/cli/skills-content/index.js +23 -0
- package/dist/cli/skills-content/index.js.map +1 -0
- package/dist/cli/skills-content/local-files.d.ts +2 -0
- package/dist/cli/skills-content/local-files.d.ts.map +1 -0
- package/dist/cli/skills-content/local-files.js +96 -0
- package/dist/cli/skills-content/local-files.js.map +1 -0
- package/dist/cli/skills-content/plan-setup-auth.d.ts +9 -0
- package/dist/cli/skills-content/plan-setup-auth.d.ts.map +1 -0
- package/dist/cli/skills-content/plan-setup-auth.js +81 -0
- package/dist/cli/skills-content/plan-setup-auth.js.map +1 -0
- package/dist/cli/skills-content/visual-plan-skill.d.ts +2 -0
- package/dist/cli/skills-content/visual-plan-skill.d.ts.map +1 -0
- package/dist/cli/skills-content/visual-plan-skill.js +471 -0
- package/dist/cli/skills-content/visual-plan-skill.js.map +1 -0
- package/dist/cli/skills-content/visual-recap-skill.d.ts +2 -0
- package/dist/cli/skills-content/visual-recap-skill.d.ts.map +1 -0
- package/dist/cli/skills-content/visual-recap-skill.js +548 -0
- package/dist/cli/skills-content/visual-recap-skill.js.map +1 -0
- package/dist/cli/skills-content/visualize-repo-skill.d.ts +2 -0
- package/dist/cli/skills-content/visualize-repo-skill.d.ts.map +1 -0
- package/dist/cli/skills-content/visualize-repo-skill.js +94 -0
- package/dist/cli/skills-content/visualize-repo-skill.js.map +1 -0
- package/dist/cli/skills-content/wireframe.d.ts +4 -0
- package/dist/cli/skills-content/wireframe.d.ts.map +1 -0
- package/dist/cli/skills-content/wireframe.js +347 -0
- package/dist/cli/skills-content/wireframe.js.map +1 -0
- package/dist/cli/skills.d.ts +2 -10
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +2 -2710
- package/dist/cli/skills.js.map +1 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +6 -5
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/AssistantChat.d.ts +7 -0
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +62 -40
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/CommandMenu.d.ts.map +1 -1
- package/dist/client/CommandMenu.js +15 -3
- package/dist/client/CommandMenu.js.map +1 -1
- package/dist/client/FeedbackButton.js +2 -2
- package/dist/client/FeedbackButton.js.map +1 -1
- package/dist/client/analytics.d.ts.map +1 -1
- package/dist/client/analytics.js +26 -0
- package/dist/client/analytics.js.map +1 -1
- package/dist/client/app-providers.d.ts +13 -5
- package/dist/client/app-providers.d.ts.map +1 -1
- package/dist/client/app-providers.js +9 -6
- package/dist/client/app-providers.js.map +1 -1
- package/dist/client/blocks/library/wireframe-kit.d.ts +2 -0
- package/dist/client/blocks/library/wireframe-kit.d.ts.map +1 -1
- package/dist/client/blocks/library/wireframe-kit.js +9 -2
- package/dist/client/blocks/library/wireframe-kit.js.map +1 -1
- package/dist/client/chat/tool-call-display.d.ts +4 -0
- package/dist/client/chat/tool-call-display.d.ts.map +1 -1
- package/dist/client/chat/tool-call-display.js +3 -3
- package/dist/client/chat/tool-call-display.js.map +1 -1
- package/dist/client/chat-model-groups.d.ts.map +1 -1
- package/dist/client/chat-model-groups.js +24 -0
- package/dist/client/chat-model-groups.js.map +1 -1
- package/dist/client/composer/PastedTextChip.js +1 -1
- package/dist/client/composer/PastedTextChip.js.map +1 -1
- package/dist/client/composer/RealtimeVoiceMode.d.ts +40 -2
- package/dist/client/composer/RealtimeVoiceMode.d.ts.map +1 -1
- package/dist/client/composer/RealtimeVoiceMode.js +186 -35
- package/dist/client/composer/RealtimeVoiceMode.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 +48 -30
- package/dist/client/composer/TiptapComposer.js.map +1 -1
- package/dist/client/composer/VoiceButton.d.ts +2 -0
- package/dist/client/composer/VoiceButton.d.ts.map +1 -1
- package/dist/client/composer/VoiceButton.js +9 -3
- package/dist/client/composer/VoiceButton.js.map +1 -1
- package/dist/client/composer/index.d.ts +2 -2
- package/dist/client/composer/index.d.ts.map +1 -1
- package/dist/client/composer/index.js +1 -1
- package/dist/client/composer/index.js.map +1 -1
- package/dist/client/composer/useRealtimeVoiceMode.d.ts +104 -2
- package/dist/client/composer/useRealtimeVoiceMode.d.ts.map +1 -1
- package/dist/client/composer/useRealtimeVoiceMode.js +1015 -35
- package/dist/client/composer/useRealtimeVoiceMode.js.map +1 -1
- package/dist/client/context-xray/ContextXRayPanel.d.ts.map +1 -1
- package/dist/client/context-xray/ContextXRayPanel.js +4 -1
- package/dist/client/context-xray/ContextXRayPanel.js.map +1 -1
- package/dist/client/extensions/ExtensionEditor.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionEditor.js +15 -5
- package/dist/client/extensions/ExtensionEditor.js.map +1 -1
- package/dist/client/extensions/ExtensionQueryErrorState.d.ts +8 -0
- package/dist/client/extensions/ExtensionQueryErrorState.d.ts.map +1 -0
- package/dist/client/extensions/ExtensionQueryErrorState.js +11 -0
- package/dist/client/extensions/ExtensionQueryErrorState.js.map +1 -0
- package/dist/client/extensions/ExtensionSlot.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionSlot.js +17 -7
- package/dist/client/extensions/ExtensionSlot.js.map +1 -1
- package/dist/client/extensions/ExtensionViewer.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionViewer.js +17 -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 -3
- 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 +21 -8
- package/dist/client/extensions/ExtensionsSidebarSection.js.map +1 -1
- package/dist/client/index.d.ts +1 -3
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +1 -6
- package/dist/client/index.js.map +1 -1
- package/dist/client/progress/RunsTray.d.ts.map +1 -1
- package/dist/client/progress/RunsTray.js +17 -4
- package/dist/client/progress/RunsTray.js.map +1 -1
- package/dist/client/settings/SecretsSection.d.ts +2 -3
- package/dist/client/settings/SecretsSection.d.ts.map +1 -1
- package/dist/client/settings/SecretsSection.js +46 -22
- package/dist/client/settings/SecretsSection.js.map +1 -1
- package/dist/client/settings/SettingsPanel.d.ts +9 -0
- package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
- package/dist/client/settings/SettingsPanel.js +46 -12
- 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 +4 -0
- package/dist/client/settings/SettingsTabsPage.js.map +1 -1
- package/dist/client/settings/useBuilderStatus.d.ts +2 -0
- package/dist/client/settings/useBuilderStatus.d.ts.map +1 -1
- package/dist/client/settings/useBuilderStatus.js +4 -0
- package/dist/client/settings/useBuilderStatus.js.map +1 -1
- package/dist/client/tool-cells/EditCell.d.ts.map +1 -1
- package/dist/client/tool-cells/EditCell.js +2 -1
- package/dist/client/tool-cells/EditCell.js.map +1 -1
- package/dist/client/tool-cells/FilesChangedSummary.d.ts.map +1 -1
- package/dist/client/tool-cells/FilesChangedSummary.js +2 -1
- package/dist/client/tool-cells/FilesChangedSummary.js.map +1 -1
- package/dist/client/tool-cells/WriteCell.d.ts.map +1 -1
- package/dist/client/tool-cells/WriteCell.js +2 -1
- package/dist/client/tool-cells/WriteCell.js.map +1 -1
- package/dist/client/use-action.d.ts +2 -0
- package/dist/client/use-action.d.ts.map +1 -1
- package/dist/client/use-action.js +10 -0
- package/dist/client/use-action.js.map +1 -1
- package/dist/client/use-agent-chat-home-handoff.d.ts +2 -0
- package/dist/client/use-agent-chat-home-handoff.d.ts.map +1 -1
- package/dist/client/use-agent-chat-home-handoff.js +7 -1
- package/dist/client/use-agent-chat-home-handoff.js.map +1 -1
- package/dist/client/use-agent-engine-configured.d.ts.map +1 -1
- package/dist/client/use-agent-engine-configured.js +17 -3
- package/dist/client/use-agent-engine-configured.js.map +1 -1
- package/dist/client/use-db-sync.d.ts +8 -2
- package/dist/client/use-db-sync.d.ts.map +1 -1
- package/dist/client/use-db-sync.js +57 -32
- package/dist/client/use-db-sync.js.map +1 -1
- package/dist/client/use-pausing-interval.d.ts.map +1 -1
- package/dist/client/use-pausing-interval.js +16 -4
- package/dist/client/use-pausing-interval.js.map +1 -1
- package/dist/client/visual-style-controls.js +1 -1
- package/dist/client/visual-style-controls.js.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/deploy/build.d.ts.map +1 -1
- package/dist/deploy/build.js +36 -14
- package/dist/deploy/build.js.map +1 -1
- package/dist/integrations/google-docs-poller.d.ts +7 -0
- package/dist/integrations/google-docs-poller.d.ts.map +1 -1
- package/dist/integrations/google-docs-poller.js +13 -3
- package/dist/integrations/google-docs-poller.js.map +1 -1
- package/dist/integrations/plugin.d.ts.map +1 -1
- package/dist/integrations/plugin.js +10 -0
- package/dist/integrations/plugin.js.map +1 -1
- package/dist/integrations/scope-store.js +1 -1
- package/dist/integrations/scope-store.js.map +1 -1
- package/dist/integrations/usage-budget-store.js +1 -1
- package/dist/integrations/usage-budget-store.js.map +1 -1
- package/dist/integrations/webhook-handler.d.ts +11 -0
- package/dist/integrations/webhook-handler.d.ts.map +1 -1
- package/dist/integrations/webhook-handler.js +16 -4
- package/dist/integrations/webhook-handler.js.map +1 -1
- package/dist/jobs/scheduler.d.ts +12 -0
- package/dist/jobs/scheduler.d.ts.map +1 -1
- package/dist/jobs/scheduler.js +13 -3
- package/dist/jobs/scheduler.js.map +1 -1
- package/dist/localization/default-messages.d.ts +47 -0
- package/dist/localization/default-messages.d.ts.map +1 -1
- package/dist/localization/default-messages.js +48 -1
- package/dist/localization/default-messages.js.map +1 -1
- package/dist/mcp/oauth-token.d.ts +1 -1
- package/dist/mcp/oauth-token.d.ts.map +1 -1
- package/dist/mcp/oauth-token.js +6 -1
- package/dist/mcp/oauth-token.js.map +1 -1
- package/dist/mcp-client/workspace-servers.js +4 -4
- package/dist/mcp-client/workspace-servers.js.map +1 -1
- package/dist/notifications/routes.d.ts +2 -2
- package/dist/observability/routes.d.ts +5 -5
- package/dist/observability/routes.d.ts.map +1 -1
- package/dist/observability/routes.js +32 -0
- package/dist/observability/routes.js.map +1 -1
- package/dist/observability/sentiment.d.ts +42 -0
- package/dist/observability/sentiment.d.ts.map +1 -0
- package/dist/observability/sentiment.js +196 -0
- package/dist/observability/sentiment.js.map +1 -0
- package/dist/observability/store.d.ts +5 -0
- package/dist/observability/store.d.ts.map +1 -1
- package/dist/observability/store.js +17 -0
- package/dist/observability/store.js.map +1 -1
- package/dist/observability/traces.d.ts +2 -0
- package/dist/observability/traces.d.ts.map +1 -1
- package/dist/observability/traces.js +42 -57
- package/dist/observability/traces.js.map +1 -1
- package/dist/observability/tracking-identity.d.ts +3 -0
- package/dist/observability/tracking-identity.d.ts.map +1 -0
- package/dist/observability/tracking-identity.js +51 -0
- package/dist/observability/tracking-identity.js.map +1 -0
- package/dist/observability/types.d.ts +10 -0
- package/dist/observability/types.d.ts.map +1 -1
- package/dist/observability/types.js +3 -0
- package/dist/observability/types.js.map +1 -1
- package/dist/progress/routes.d.ts +1 -1
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/secrets/crypto.d.ts +7 -6
- package/dist/secrets/crypto.d.ts.map +1 -1
- package/dist/secrets/crypto.js +30 -11
- package/dist/secrets/crypto.js.map +1 -1
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/secrets/storage.d.ts +6 -0
- package/dist/secrets/storage.d.ts.map +1 -1
- package/dist/secrets/storage.js +61 -3
- package/dist/secrets/storage.js.map +1 -1
- package/dist/server/action-change.d.ts +1 -0
- package/dist/server/action-change.d.ts.map +1 -1
- package/dist/server/action-change.js +4 -1
- package/dist/server/action-change.js.map +1 -1
- package/dist/server/action-routes.d.ts.map +1 -1
- package/dist/server/action-routes.js +5 -0
- package/dist/server/action-routes.js.map +1 -1
- package/dist/server/agent-chat/action-filters-a2a.d.ts +50 -0
- package/dist/server/agent-chat/action-filters-a2a.d.ts.map +1 -0
- package/dist/server/agent-chat/action-filters-a2a.js +127 -0
- package/dist/server/agent-chat/action-filters-a2a.js.map +1 -0
- package/dist/server/agent-chat/browser-team-tools.d.ts +21 -0
- package/dist/server/agent-chat/browser-team-tools.d.ts.map +1 -0
- package/dist/server/agent-chat/browser-team-tools.js +417 -0
- package/dist/server/agent-chat/browser-team-tools.js.map +1 -0
- package/dist/server/agent-chat/context-tools.d.ts +33 -0
- package/dist/server/agent-chat/context-tools.d.ts.map +1 -0
- package/dist/server/agent-chat/context-tools.js +520 -0
- package/dist/server/agent-chat/context-tools.js.map +1 -0
- package/dist/server/agent-chat/framework-prompts.d.ts +65 -0
- package/dist/server/agent-chat/framework-prompts.d.ts.map +1 -0
- package/dist/server/agent-chat/framework-prompts.js +403 -0
- package/dist/server/agent-chat/framework-prompts.js.map +1 -0
- package/dist/server/agent-chat/lazy-fs.d.ts +2 -0
- package/dist/server/agent-chat/lazy-fs.d.ts.map +1 -0
- package/dist/server/agent-chat/lazy-fs.js +11 -0
- package/dist/server/agent-chat/lazy-fs.js.map +1 -0
- package/dist/server/agent-chat/mcp-glue.d.ts +9 -0
- package/dist/server/agent-chat/mcp-glue.d.ts.map +1 -0
- package/dist/server/agent-chat/mcp-glue.js +63 -0
- package/dist/server/agent-chat/mcp-glue.js.map +1 -0
- package/dist/server/agent-chat/plugin-options.d.ts +322 -0
- package/dist/server/agent-chat/plugin-options.d.ts.map +1 -0
- package/dist/server/agent-chat/plugin-options.js +2 -0
- package/dist/server/agent-chat/plugin-options.js.map +1 -0
- package/dist/server/agent-chat/process-run-failure.d.ts +12 -0
- package/dist/server/agent-chat/process-run-failure.d.ts.map +1 -0
- package/dist/server/agent-chat/process-run-failure.js +24 -0
- package/dist/server/agent-chat/process-run-failure.js.map +1 -0
- package/dist/server/agent-chat/prompt-resources.d.ts +28 -0
- package/dist/server/agent-chat/prompt-resources.d.ts.map +1 -0
- package/dist/server/agent-chat/prompt-resources.js +514 -0
- package/dist/server/agent-chat/prompt-resources.js.map +1 -0
- package/dist/server/agent-chat/recurring-jobs-runtime.d.ts +5 -0
- package/dist/server/agent-chat/recurring-jobs-runtime.d.ts.map +1 -0
- package/dist/server/agent-chat/recurring-jobs-runtime.js +53 -0
- package/dist/server/agent-chat/recurring-jobs-runtime.js.map +1 -0
- package/dist/server/agent-chat/request-surface.d.ts +8 -0
- package/dist/server/agent-chat/request-surface.d.ts.map +1 -0
- package/dist/server/agent-chat/request-surface.js +56 -0
- package/dist/server/agent-chat/request-surface.js.map +1 -0
- package/dist/server/agent-chat/run-code-tools.d.ts +17 -0
- package/dist/server/agent-chat/run-code-tools.d.ts.map +1 -0
- package/dist/server/agent-chat/run-code-tools.js +55 -0
- package/dist/server/agent-chat/run-code-tools.js.map +1 -0
- package/dist/server/agent-chat/script-entries.d.ts +47 -0
- package/dist/server/agent-chat/script-entries.d.ts.map +1 -0
- package/dist/server/agent-chat/script-entries.js +633 -0
- package/dist/server/agent-chat/script-entries.js.map +1 -0
- package/dist/server/agent-chat/shared-thread.d.ts +33 -0
- package/dist/server/agent-chat/shared-thread.d.ts.map +1 -0
- package/dist/server/agent-chat/shared-thread.js +242 -0
- package/dist/server/agent-chat/shared-thread.js.map +1 -0
- package/dist/server/agent-chat/skill-frontmatter.d.ts +7 -0
- package/dist/server/agent-chat/skill-frontmatter.d.ts.map +1 -0
- package/dist/server/agent-chat/skill-frontmatter.js +26 -0
- package/dist/server/agent-chat/skill-frontmatter.js.map +1 -0
- package/dist/server/agent-chat-plugin.d.ts +45 -486
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +173 -3005
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/agent-teams.d.ts +10 -0
- package/dist/server/agent-teams.d.ts.map +1 -1
- package/dist/server/agent-teams.js +13 -3
- package/dist/server/agent-teams.js.map +1 -1
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +50 -52
- package/dist/server/auth.js.map +1 -1
- package/dist/server/credential-provider.d.ts.map +1 -1
- package/dist/server/credential-provider.js +22 -21
- package/dist/server/credential-provider.js.map +1 -1
- package/dist/server/edge.d.ts +1 -0
- package/dist/server/edge.d.ts.map +1 -1
- package/dist/server/edge.js +1 -0
- package/dist/server/edge.js.map +1 -1
- package/dist/server/onboarding-html.d.ts.map +1 -1
- package/dist/server/onboarding-html.js +1 -16
- package/dist/server/onboarding-html.js.map +1 -1
- package/dist/server/poll.d.ts.map +1 -1
- package/dist/server/poll.js +1 -0
- package/dist/server/poll.js.map +1 -1
- package/dist/server/realtime-voice.d.ts +10 -0
- package/dist/server/realtime-voice.d.ts.map +1 -1
- package/dist/server/realtime-voice.js +249 -15
- package/dist/server/realtime-voice.js.map +1 -1
- package/dist/server/request-origin.d.ts.map +1 -1
- package/dist/server/request-origin.js +6 -3
- package/dist/server/request-origin.js.map +1 -1
- package/dist/server/ssr-handler.d.ts.map +1 -1
- package/dist/server/ssr-handler.js +47 -2
- package/dist/server/ssr-handler.js.map +1 -1
- package/dist/sharing/access.d.ts +63 -3
- package/dist/sharing/access.d.ts.map +1 -1
- package/dist/sharing/access.js +53 -15
- package/dist/sharing/access.js.map +1 -1
- package/dist/sharing/registry.d.ts +7 -0
- package/dist/sharing/registry.d.ts.map +1 -1
- package/dist/sharing/registry.js.map +1 -1
- package/dist/styles/agent-native.css +17 -16
- package/dist/templates/default/.agents/skills/frontend-design/SKILL.md +1 -1
- package/dist/templates/default/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/dist/templates/default/app/i18n/ar-SA.ts +6 -0
- package/dist/templates/default/app/i18n/de-DE.ts +6 -0
- package/dist/templates/default/app/i18n/en-US.ts +6 -0
- package/dist/templates/default/app/i18n/es-ES.ts +6 -0
- package/dist/templates/default/app/i18n/fr-FR.ts +6 -0
- package/dist/templates/default/app/i18n/hi-IN.ts +6 -0
- package/dist/templates/default/app/i18n/ja-JP.ts +6 -0
- package/dist/templates/default/app/i18n/ko-KR.ts +6 -0
- package/dist/templates/default/app/i18n/pt-BR.ts +6 -0
- package/dist/templates/default/app/i18n/zh-CN.ts +6 -0
- package/dist/templates/default/app/i18n/zh-TW.ts +6 -0
- package/dist/templates/workspace-core/.agents/skills/authentication/SKILL.md +27 -29
- package/dist/templates/workspace-core/.agents/skills/external-agents/SKILL.md +2 -1
- package/dist/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +1 -1
- package/dist/templates/workspace-core/.agents/skills/observability/SKILL.md +32 -0
- package/dist/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/dist/templates/workspace-core/.agents/skills/secrets/SKILL.md +7 -3
- package/dist/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +39 -9
- package/dist/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +25 -0
- package/dist/templates/workspace-core/src/server/index.ts +4 -2
- package/dist/testing.d.ts +16 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +16 -0
- package/dist/testing.js.map +1 -0
- package/dist/triggers/dispatcher.d.ts +7 -0
- package/dist/triggers/dispatcher.d.ts.map +1 -1
- package/dist/triggers/dispatcher.js +13 -3
- package/dist/triggers/dispatcher.js.map +1 -1
- package/dist/vite/client.d.ts +16 -1
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +111 -3
- package/dist/vite/client.js.map +1 -1
- package/docs/content/authentication.mdx +3 -3
- package/docs/content/doctor.mdx +170 -0
- package/docs/content/external-agents.mdx +8 -7
- package/docs/content/locales/ar-SA/authentication.mdx +2 -2
- package/docs/content/locales/ar-SA/external-agents.mdx +8 -7
- package/docs/content/locales/ar-SA/mcp-protocol.mdx +1 -1
- package/docs/content/locales/ar-SA/security.mdx +2 -0
- package/docs/content/locales/de-DE/authentication.mdx +1 -1
- package/docs/content/locales/de-DE/external-agents.mdx +8 -7
- package/docs/content/locales/de-DE/mcp-protocol.mdx +1 -1
- package/docs/content/locales/de-DE/security.mdx +2 -0
- package/docs/content/locales/es-ES/authentication.mdx +2 -2
- package/docs/content/locales/es-ES/external-agents.mdx +8 -7
- package/docs/content/locales/es-ES/mcp-protocol.mdx +1 -1
- package/docs/content/locales/es-ES/security.mdx +2 -0
- package/docs/content/locales/fr-FR/authentication.mdx +1 -1
- package/docs/content/locales/fr-FR/external-agents.mdx +8 -7
- package/docs/content/locales/fr-FR/mcp-protocol.mdx +1 -1
- package/docs/content/locales/fr-FR/security.mdx +2 -0
- package/docs/content/locales/hi-IN/authentication.mdx +2 -2
- package/docs/content/locales/hi-IN/external-agents.mdx +8 -7
- package/docs/content/locales/hi-IN/mcp-protocol.mdx +1 -1
- package/docs/content/locales/hi-IN/security.mdx +2 -0
- package/docs/content/locales/ja-JP/authentication.mdx +2 -2
- package/docs/content/locales/ja-JP/external-agents.mdx +8 -7
- package/docs/content/locales/ja-JP/mcp-protocol.mdx +1 -1
- package/docs/content/locales/ja-JP/security.mdx +2 -0
- package/docs/content/locales/ko-KR/authentication.mdx +2 -2
- package/docs/content/locales/ko-KR/external-agents.mdx +8 -7
- package/docs/content/locales/ko-KR/mcp-protocol.mdx +1 -1
- package/docs/content/locales/ko-KR/security.mdx +2 -0
- package/docs/content/locales/pt-BR/authentication.mdx +2 -2
- package/docs/content/locales/pt-BR/external-agents.mdx +8 -7
- package/docs/content/locales/pt-BR/mcp-protocol.mdx +1 -1
- package/docs/content/locales/pt-BR/security.mdx +2 -0
- package/docs/content/locales/zh-CN/authentication.mdx +2 -2
- package/docs/content/locales/zh-CN/external-agents.mdx +8 -7
- package/docs/content/locales/zh-CN/mcp-protocol.mdx +1 -1
- package/docs/content/locales/zh-CN/security.mdx +2 -0
- package/docs/content/locales/zh-TW/authentication.mdx +2 -2
- package/docs/content/locales/zh-TW/external-agents.mdx +8 -7
- package/docs/content/locales/zh-TW/mcp-protocol.mdx +1 -1
- package/docs/content/locales/zh-TW/security.mdx +2 -0
- package/docs/content/mcp-protocol.mdx +1 -1
- package/docs/content/security.mdx +2 -0
- package/package.json +7 -3
- package/src/templates/default/.agents/skills/frontend-design/SKILL.md +1 -1
- package/src/templates/default/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/src/templates/default/app/i18n/ar-SA.ts +6 -0
- package/src/templates/default/app/i18n/de-DE.ts +6 -0
- package/src/templates/default/app/i18n/en-US.ts +6 -0
- package/src/templates/default/app/i18n/es-ES.ts +6 -0
- package/src/templates/default/app/i18n/fr-FR.ts +6 -0
- package/src/templates/default/app/i18n/hi-IN.ts +6 -0
- package/src/templates/default/app/i18n/ja-JP.ts +6 -0
- package/src/templates/default/app/i18n/ko-KR.ts +6 -0
- package/src/templates/default/app/i18n/pt-BR.ts +6 -0
- package/src/templates/default/app/i18n/zh-CN.ts +6 -0
- package/src/templates/default/app/i18n/zh-TW.ts +6 -0
- package/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +27 -29
- package/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +2 -1
- package/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +1 -1
- package/src/templates/workspace-core/.agents/skills/observability/SKILL.md +32 -0
- package/src/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/src/templates/workspace-core/.agents/skills/secrets/SKILL.md +7 -3
- package/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +39 -9
- package/src/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +25 -0
- package/src/templates/workspace-core/src/server/index.ts +4 -2
- package/corpus/core/src/client/ProductionAgentPanel.tsx +0 -9
- package/corpus/core/src/client/auth-redirect-url.ts +0 -23
- package/corpus/core/src/client/useProductionAgent.ts +0 -253
- package/corpus/core/src/shared/auth-redirect-url.ts +0 -1
- package/corpus/templates/analytics/app/pages/Index.tsx +0 -16
- package/corpus/templates/analytics/seeds/dashboards/agent-observability-llm.json +0 -173
- package/dist/client/ProductionAgentPanel.d.ts +0 -6
- package/dist/client/ProductionAgentPanel.d.ts.map +0 -1
- package/dist/client/ProductionAgentPanel.js +0 -6
- package/dist/client/ProductionAgentPanel.js.map +0 -1
- package/dist/client/auth-redirect-url.d.ts +0 -2
- package/dist/client/auth-redirect-url.d.ts.map +0 -1
- package/dist/client/auth-redirect-url.js +0 -19
- package/dist/client/auth-redirect-url.js.map +0 -1
- package/dist/client/useProductionAgent.d.ts +0 -24
- package/dist/client/useProductionAgent.d.ts.map +0 -1
- package/dist/client/useProductionAgent.js +0 -179
- package/dist/client/useProductionAgent.js.map +0 -1
- package/dist/shared/auth-redirect-url.d.ts +0 -2
- package/dist/shared/auth-redirect-url.d.ts.map +0 -1
- package/dist/shared/auth-redirect-url.js +0 -2
- package/dist/shared/auth-redirect-url.js.map +0 -1
|
@@ -52,24 +52,54 @@ action before requesting microphone permission.
|
|
|
52
52
|
- Starting voice mode collapses the chat into a persistent bottom-end speech
|
|
53
53
|
orb. The orb stays visible above the chat even when the chat opens
|
|
54
54
|
automatically. Clicking it shows or hides chat without ending the session;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
opening chat slides the orb clear of the sidebar. The progressively disclosed
|
|
56
|
+
controls contain only settings and the separate end-session action.
|
|
57
|
+
- The orb's compact waveform stays visible for the full session and reflects
|
|
58
|
+
actual microphone or assistant audio activity. At silence it rests at its
|
|
59
|
+
baseline instead of turning into a loading spinner. While connecting, show a
|
|
60
|
+
distinct compact spinner; when the session becomes live, the assistant gives
|
|
61
|
+
one brief spoken greeting so readiness is unambiguous. Do not apply a
|
|
62
|
+
text-sized `max_output_tokens` cap to that audio greeting because audio tokens
|
|
63
|
+
can truncate it mid-sentence.
|
|
64
|
+
- The orb settings cog opens in place without ending voice mode or navigating
|
|
65
|
+
away. Nested pickers must not dismiss the settings popover. Language and
|
|
66
|
+
intelligence update the active Realtime session; the microphone picker swaps
|
|
67
|
+
the live WebRTC input track and remembers the browser-local device choice;
|
|
68
|
+
an output-voice change updates immediately only before the assistant has
|
|
69
|
+
emitted audio and otherwise applies to the next conversation, matching the
|
|
70
|
+
Realtime API's voice immutability rule.
|
|
58
71
|
- Semantic VAD keeps listening, starts responses automatically, and supports
|
|
59
72
|
barge-in while the agent is speaking.
|
|
60
73
|
- Function calls must cross the authenticated realtime tool bridge and enter
|
|
61
74
|
`executeAgentToolCall`. Never call `ActionEntry.run` directly: that bypasses
|
|
62
75
|
schema validation, approvals, audit/journal behavior, timeouts, redaction,
|
|
63
76
|
and mutation refreshes.
|
|
64
|
-
- Preserve the active browser-tab id in request context so `set-url`,
|
|
77
|
+
- Preserve the active browser-tab id in request context so `set-url-path`,
|
|
65
78
|
`set-search-params`, `view-screen`, and tab-scoped application state affect
|
|
66
|
-
the app the user is actually speaking to.
|
|
79
|
+
the app the user is actually speaking to. Realtime tool manifests are capped,
|
|
80
|
+
so prioritize `navigate`, `set-url-path`, `set-search-params`, and
|
|
81
|
+
`view-screen` before packing large template registries.
|
|
82
|
+
- Keep `tool-search` in the initial Realtime manifest. A successful specific
|
|
83
|
+
search may expand the live session with matching action schemas, but the
|
|
84
|
+
server must derive those schemas from its own registry, bind authorization
|
|
85
|
+
to the authenticated voice session, and continue execution through
|
|
86
|
+
`executeAgentToolCall`. Treat `session.update.tools` as a full replacement:
|
|
87
|
+
preserve the pinned navigation/discovery tools, evict lower-priority entries
|
|
88
|
+
within the manifest cap, and wait for `session.updated` before asking the
|
|
89
|
+
model to continue with a newly discovered tool.
|
|
67
90
|
- Do not persist audio or interim transcript deltas. Append completed user and
|
|
68
91
|
assistant utterances as ordinary text messages to the exact chat thread
|
|
69
|
-
captured when the session starts.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
92
|
+
captured when the session starts. Input transcription completes
|
|
93
|
+
asynchronously from assistant generation, so reserve provider conversation
|
|
94
|
+
item order and publish only the contiguous completed sequence; never use
|
|
95
|
+
completion arrival time as chat order. Ending voice mode opens that chat so
|
|
96
|
+
the user can continue over text. Store only compact lifecycle and latest
|
|
97
|
+
context at `application_state["realtime-voice-session"]`; delete it when the
|
|
98
|
+
session ends.
|
|
99
|
+
- Store the user-controlled language, intelligence, and output-voice choices at
|
|
100
|
+
`application_state["realtime-voice-prefs"]`. Keep this separate from
|
|
101
|
+
`voice-transcription-prefs`, which configures editable dictation rather than
|
|
102
|
+
the speech-to-speech session.
|
|
73
103
|
- Missing-key failures should open Settings focused on the user-scoped
|
|
74
104
|
`OPENAI_API_KEY` field. Never send, log, or echo the key to the browser.
|
|
75
105
|
|
|
@@ -96,6 +96,31 @@ contract:
|
|
|
96
96
|
- Do not create pass-through routes whose main job is to call, repackage, or
|
|
97
97
|
re-export an action.
|
|
98
98
|
|
|
99
|
+
## Budget the first model request
|
|
100
|
+
|
|
101
|
+
Treat the initial prompt and tool catalog as a latency budget. The agent should
|
|
102
|
+
start with a compact map of the app, then retrieve depth only when the task
|
|
103
|
+
needs it.
|
|
104
|
+
|
|
105
|
+
- Set `initialToolNames` to the small set of actions used in the app's primary
|
|
106
|
+
workflows. Keep `tool-search` available so every other registered action and
|
|
107
|
+
connected MCP tool remains discoverable on demand.
|
|
108
|
+
- Keep essential, always-applicable rules in `AGENTS.md`. Put workflow detail
|
|
109
|
+
in skills and long reference material in `references/` or workspace
|
|
110
|
+
resources that the agent can read when relevant.
|
|
111
|
+
- Do not inject full documents, transcripts, data dictionaries, source trees,
|
|
112
|
+
or provider catalogs through `systemPrompt` or `extraContext`. Inject a
|
|
113
|
+
bounded summary, stable ids/paths, and the exact action or resource lookup
|
|
114
|
+
that retrieves the full content.
|
|
115
|
+
- Avoid duplicating action descriptions in prose. The starter tools already
|
|
116
|
+
carry schemas; uncommon actions are available through `tool-search`.
|
|
117
|
+
- Keep `view-screen` concise. Return navigation, selection, visible summary,
|
|
118
|
+
and ids needed for a follow-up read rather than full record bodies.
|
|
119
|
+
|
|
120
|
+
The goal is progressive disclosure, not reduced capability: a compact first
|
|
121
|
+
request, precise discovery, and full fidelity once the agent knows which depth
|
|
122
|
+
is relevant.
|
|
123
|
+
|
|
99
124
|
When documenting version history, restore, or audit trails, use actions for
|
|
100
125
|
full restorable snapshots (`list-<resource>-versions`,
|
|
101
126
|
`get-<resource>-version`, `restore-<resource>-version`). Do not copy legacy
|
|
@@ -5,13 +5,15 @@ import {
|
|
|
5
5
|
createAgentChatPlugin,
|
|
6
6
|
defaultAuthPlugin,
|
|
7
7
|
type AgentChatPluginOptions,
|
|
8
|
+
type NitroPluginDef,
|
|
8
9
|
} from "@agent-native/core/server";
|
|
9
10
|
|
|
10
11
|
export function createWorkspaceAgentChatPlugin(
|
|
11
12
|
options?: AgentChatPluginOptions,
|
|
12
|
-
) {
|
|
13
|
+
): NitroPluginDef {
|
|
13
14
|
return createAgentChatPlugin(options);
|
|
14
15
|
}
|
|
15
16
|
|
|
16
|
-
export const defaultAgentChatPlugin =
|
|
17
|
+
export const defaultAgentChatPlugin: NitroPluginDef =
|
|
18
|
+
createWorkspaceAgentChatPlugin();
|
|
17
19
|
export { defaultAuthPlugin };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@agent-native/core/testing` — a small barrel of internal symbols that
|
|
3
|
+
* template test suites need direct access to (an in-memory db factory, the
|
|
4
|
+
* local Design/Plan dev bridges, and the shared rich-markdown-editor drag
|
|
5
|
+
* handle). Published so template specs can import these through the package
|
|
6
|
+
* boundary instead of reaching into `packages/core/src/**` with deep
|
|
7
|
+
* relative paths.
|
|
8
|
+
*
|
|
9
|
+
* Keep this list minimal — only add a re-export when a template spec
|
|
10
|
+
* actually needs it.
|
|
11
|
+
*/
|
|
12
|
+
export { createGetDb, patchBetterSqliteTransactions, } from "./db/create-get-db.js";
|
|
13
|
+
export { startLocalPlanBridge } from "./cli/plan-local.js";
|
|
14
|
+
export { prepareDesignConnectManifest, startDesignConnectBridge, type DesignConnectBridge, } from "./cli/design-connect.js";
|
|
15
|
+
export { DragHandle } from "./client/rich-markdown-editor/DragHandle.js";
|
|
16
|
+
//# sourceMappingURL=testing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,WAAW,EACX,6BAA6B,GAC9B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,KAAK,mBAAmB,GACzB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAC"}
|
package/dist/testing.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@agent-native/core/testing` — a small barrel of internal symbols that
|
|
3
|
+
* template test suites need direct access to (an in-memory db factory, the
|
|
4
|
+
* local Design/Plan dev bridges, and the shared rich-markdown-editor drag
|
|
5
|
+
* handle). Published so template specs can import these through the package
|
|
6
|
+
* boundary instead of reaching into `packages/core/src/**` with deep
|
|
7
|
+
* relative paths.
|
|
8
|
+
*
|
|
9
|
+
* Keep this list minimal — only add a re-export when a template spec
|
|
10
|
+
* actually needs it.
|
|
11
|
+
*/
|
|
12
|
+
export { createGetDb, patchBetterSqliteTransactions, } from "./db/create-get-db.js";
|
|
13
|
+
export { startLocalPlanBridge } from "./cli/plan-local.js";
|
|
14
|
+
export { prepareDesignConnectManifest, startDesignConnectBridge, } from "./cli/design-connect.js";
|
|
15
|
+
export { DragHandle } from "./client/rich-markdown-editor/DragHandle.js";
|
|
16
|
+
//# sourceMappingURL=testing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing.js","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,WAAW,EACX,6BAA6B,GAC9B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,GAEzB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAC","sourcesContent":["/**\n * `@agent-native/core/testing` — a small barrel of internal symbols that\n * template test suites need direct access to (an in-memory db factory, the\n * local Design/Plan dev bridges, and the shared rich-markdown-editor drag\n * handle). Published so template specs can import these through the package\n * boundary instead of reaching into `packages/core/src/**` with deep\n * relative paths.\n *\n * Keep this list minimal — only add a re-export when a template spec\n * actually needs it.\n */\n\nexport {\n createGetDb,\n patchBetterSqliteTransactions,\n} from \"./db/create-get-db.js\";\n\nexport { startLocalPlanBridge } from \"./cli/plan-local.js\";\n\nexport {\n prepareDesignConnectManifest,\n startDesignConnectBridge,\n type DesignConnectBridge,\n} from \"./cli/design-connect.js\";\n\nexport { DragHandle } from \"./client/rich-markdown-editor/DragHandle.js\";\n"]}
|
|
@@ -15,6 +15,13 @@ export declare function buildTriggerContent(meta: TriggerFrontmatter, body: stri
|
|
|
15
15
|
export interface TriggerDispatcherDeps {
|
|
16
16
|
getActions: () => Record<string, ActionEntry>;
|
|
17
17
|
getSystemPrompt: (owner: string) => Promise<string>;
|
|
18
|
+
/**
|
|
19
|
+
* Tool names to expose on the FIRST engine request for a trigger run. See
|
|
20
|
+
* `SchedulerDeps.getInitialToolNames` (`jobs/scheduler.ts`) — same
|
|
21
|
+
* semantics. Omit to keep the full `getActions()` set visible up front
|
|
22
|
+
* (current behavior).
|
|
23
|
+
*/
|
|
24
|
+
getInitialToolNames?: () => string[] | undefined;
|
|
18
25
|
apiKey?: string;
|
|
19
26
|
model?: string;
|
|
20
27
|
/** App/template id used for org-scoped per-app model defaults. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatcher.d.ts","sourceRoot":"","sources":["../../src/triggers/dispatcher.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,OAAO,
|
|
1
|
+
{"version":3,"file":"dispatcher.d.ts","sourceRoot":"","sources":["../../src/triggers/dispatcher.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,OAAO,EAKL,KAAK,WAAW,EACjB,MAAM,8BAA8B,CAAC;AAStC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAKrD,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG;IACxD,IAAI,EAAE,kBAAkB,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;CACd,CAsFA;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,kBAAkB,EACxB,IAAI,EAAE,MAAM,GACX,MAAM,CAsBR;AAID,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAC9C,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACpD;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,MAAM,MAAM,EAAE,GAAG,SAAS,CAAC;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAgBD;;;GAGG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,qBAAqB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAGf;AAED;;;GAGG;AACH,wBAAsB,yBAAyB,IAAI,OAAO,CAAC,IAAI,CAAC,CAgC/D"}
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* loop) when matching events fire.
|
|
7
7
|
*/
|
|
8
8
|
import { getStoredModelForEngine, normalizeModelForEngine, resolveEngine, } from "../agent/engine/index.js";
|
|
9
|
-
import { runAgentLoop, actionsToEngineTools, getOwnerActiveApiKey, } from "../agent/production-agent.js";
|
|
9
|
+
import { runAgentLoop, actionsToEngineTools, filterInitialEngineTools, getOwnerActiveApiKey, } from "../agent/production-agent.js";
|
|
10
|
+
import { attachToolSearch } from "../agent/tool-search.js";
|
|
10
11
|
import { createThread } from "../chat-threads/store.js";
|
|
11
12
|
import { subscribe, unsubscribe } from "../event-bus/index.js";
|
|
12
13
|
import { resourceListAllOwners, resourcePut } from "../resources/store.js";
|
|
@@ -314,9 +315,17 @@ async function dispatchAgentic(resource, meta, body, payload, eventMeta, apiKey)
|
|
|
314
315
|
await resourcePut(resource.owner, resource.path, buildTriggerContent(meta, body));
|
|
315
316
|
await runWithRequestContext({ userEmail: jobUserEmail, orgId: jobOrgId }, async () => {
|
|
316
317
|
try {
|
|
317
|
-
const
|
|
318
|
+
const baseActions = _deps.getActions();
|
|
318
319
|
const systemPrompt = await _deps.getSystemPrompt(jobUserEmail);
|
|
319
|
-
const
|
|
320
|
+
const initialToolNames = _deps.getInitialToolNames?.();
|
|
321
|
+
// Only attach tool-search (and pay its schema cost) when the caller
|
|
322
|
+
// actually supplied an initial subset to filter down to — otherwise
|
|
323
|
+
// this is byte-for-byte the prior unfiltered behavior.
|
|
324
|
+
const actions = initialToolNames
|
|
325
|
+
? attachToolSearch({ ...baseActions })
|
|
326
|
+
: baseActions;
|
|
327
|
+
const availableTools = actionsToEngineTools(actions);
|
|
328
|
+
const tools = filterInitialEngineTools(availableTools, initialToolNames);
|
|
320
329
|
const engine = await resolveEngine({
|
|
321
330
|
apiKey,
|
|
322
331
|
appId: _deps.appId,
|
|
@@ -362,6 +371,7 @@ ${body}`;
|
|
|
362
371
|
model,
|
|
363
372
|
systemPrompt,
|
|
364
373
|
tools,
|
|
374
|
+
availableTools,
|
|
365
375
|
messages,
|
|
366
376
|
actions,
|
|
367
377
|
send: (event) => events.push(event),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatcher.js","sourceRoot":"","sources":["../../src/triggers/dispatcher.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,aAAa,GACd,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,GAErB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE/D,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAG7D,uEAAuE;AACvE,MAAM,cAAc,GAAG,oCAAoC,CAAC;AAE5D,MAAM,UAAU,uBAAuB,CAAC,OAAe;IAIrD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAC5C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO;YACL,IAAI,EAAE;gBACJ,QA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CAAC,eAAe;wBAC7C,gBAAgB,EAAE,YAAY,CAAC,gBAAgB;wBAC/C,KAAK,EAAE,YAAY,CAAC,KAAK;wBACzB,KAAK,EAAE,cAAc,WAAW,EAAE;wBAClC,GAAG,EAAE,KAAM,CAAC,KAAK;wBACjB,KAAK,EAAE,SAAS,CAAC,OAAO;qBACzB,CAAC,CAAC;gBACL,CAAC;gBAAC,MAAM,CAAC;oBACP,wDAAwD;gBAC1D,CAAC;YACH,CAAC;YAED,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;YAC5B,MAAM,WAAW,CACf,QAAQ,CAAC,KAAK,EACd,QAAQ,CAAC,IAAI,EACb,mBAAmB,CAAC,IAAI,EAAE,IAAI,CAAC,CAChC,CAAC;YAEF,OAAO,CAAC,GAAG,CAAC,eAAe,WAAW,0BAA0B,CAAC,CAAC;QACpE,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC;YAC1B,IAAI,CAAC,SAAS,GAAG,GAAG,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,eAAe,CAAC;YAChE,MAAM,WAAW,CACf,QAAQ,CAAC,KAAK,EACd,QAAQ,CAAC,IAAI,EACb,mBAAmB,CAAC,IAAI,EAAE,IAAI,CAAC,CAChC,CAAC;YACF,OAAO,CAAC,KAAK,CAAC,eAAe,WAAW,WAAW,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;QACrE,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Trigger dispatcher — bridges the event bus to the automation system.\n *\n * On startup, loads all event-triggered jobs from the resources store,\n * subscribes to their events, and dispatches them (condition eval → agent\n * loop) when matching events fire.\n */\n\nimport {\n getStoredModelForEngine,\n normalizeModelForEngine,\n resolveEngine,\n} from \"../agent/engine/index.js\";\nimport {\n runAgentLoop,\n actionsToEngineTools,\n getOwnerActiveApiKey,\n type ActionEntry,\n} from \"../agent/production-agent.js\";\nimport type { AgentChatEvent } from \"../agent/types.js\";\nimport { createThread } from \"../chat-threads/store.js\";\nimport { subscribe, unsubscribe } from \"../event-bus/index.js\";\nimport type { EventMeta } from \"../event-bus/types.js\";\nimport { resourceListAllOwners, resourcePut } from \"../resources/store.js\";\nimport { runWithRequestContext } from \"../server/request-context.js\";\nimport { evaluateCondition } from \"./condition-evaluator.js\";\nimport type { TriggerFrontmatter } from \"./types.js\";\n\n// Re-use the job frontmatter parser — triggers extend the same format.\nconst FRONTMATTER_RE = /^---\\n([\\s\\S]*?)\\n---\\n?([\\s\\S]*)$/;\n\nexport function parseTriggerFrontmatter(content: string): {\n meta: TriggerFrontmatter;\n body: string;\n} {\n const match = content.match(FRONTMATTER_RE);\n if (!match) {\n return {\n meta: {\n schedule: \"\",\n enabled: false,\n triggerType: \"schedule\",\n mode: \"agentic\",\n },\n body: content,\n };\n }\n\n const yamlBlock = match[1];\n const body = match[2].trim();\n\n const meta: TriggerFrontmatter = {\n schedule: \"\",\n enabled: true,\n triggerType: \"schedule\",\n mode: \"agentic\",\n };\n\n for (const line of yamlBlock.split(\"\\n\")) {\n const colonIdx = line.indexOf(\":\");\n if (colonIdx === -1) continue;\n const key = line.slice(0, colonIdx).trim();\n let value = line.slice(colonIdx + 1).trim();\n if (\n (value.startsWith('\"') && value.endsWith('\"')) ||\n (value.startsWith(\"'\") && value.endsWith(\"'\"))\n ) {\n value = value.slice(1, -1);\n }\n\n switch (key) {\n case \"schedule\":\n meta.schedule = value;\n break;\n case \"enabled\":\n meta.enabled = value !== \"false\";\n break;\n case \"triggerType\":\n meta.triggerType =\n value === \"event\" || value === \"schedule\" ? value : \"schedule\";\n break;\n case \"event\":\n meta.event = value;\n break;\n case \"condition\":\n meta.condition = value;\n break;\n case \"mode\":\n meta.mode =\n value === \"deterministic\" || value === \"agentic\" ? value : \"agentic\";\n break;\n case \"domain\":\n meta.domain = value;\n break;\n case \"createdBy\":\n meta.createdBy = value;\n break;\n case \"orgId\":\n meta.orgId = value;\n break;\n case \"runAs\":\n meta.runAs =\n value === \"shared\" || value === \"creator\" ? value : undefined;\n break;\n case \"lastRun\":\n meta.lastRun = value;\n break;\n case \"lastStatus\":\n meta.lastStatus = value as TriggerFrontmatter[\"lastStatus\"];\n break;\n case \"lastError\":\n meta.lastError = value;\n break;\n case \"nextRun\":\n meta.nextRun = value;\n break;\n }\n }\n\n return { meta, body };\n}\n\nexport function buildTriggerContent(\n meta: TriggerFrontmatter,\n body: string,\n): string {\n const lines = [\"---\"];\n lines.push(`schedule: \"${meta.schedule}\"`);\n lines.push(`enabled: ${meta.enabled}`);\n lines.push(`triggerType: ${meta.triggerType}`);\n if (meta.event) lines.push(`event: ${meta.event}`);\n if (meta.condition)\n lines.push(`condition: \"${meta.condition.replace(/\"/g, '\\\\\"')}\"`);\n lines.push(`mode: ${meta.mode}`);\n if (meta.domain) lines.push(`domain: ${meta.domain}`);\n if (meta.createdBy) lines.push(`createdBy: ${meta.createdBy}`);\n if (meta.orgId) lines.push(`orgId: ${meta.orgId}`);\n if (meta.runAs) lines.push(`runAs: ${meta.runAs}`);\n if (meta.lastRun) lines.push(`lastRun: ${meta.lastRun}`);\n if (meta.lastStatus) lines.push(`lastStatus: ${meta.lastStatus}`);\n if (meta.lastError)\n lines.push(`lastError: \"${meta.lastError.replace(/\"/g, '\\\\\"')}\"`);\n if (meta.nextRun) lines.push(`nextRun: ${meta.nextRun}`);\n lines.push(\"---\");\n lines.push(\"\");\n lines.push(body);\n return lines.join(\"\\n\");\n}\n\n// ─── Dispatcher deps (same pattern as SchedulerDeps) ────────────────────────\n\nexport interface TriggerDispatcherDeps {\n getActions: () => Record<string, ActionEntry>;\n getSystemPrompt: (owner: string) => Promise<string>;\n apiKey?: string;\n model?: string;\n /** App/template id used for org-scoped per-app model defaults. */\n appId?: string;\n}\n\n// Track active subscriptions (eventName -> subscription id) to avoid\n// double-subscribing AND so subscriptions for events that no longer have any\n// enabled trigger can be torn down — otherwise deleted/disabled triggers leave\n// phantom bus listeners that fire handleEvent forever.\nconst _eventSubscriptions = new Map<string, string>();\n// In-flight agentic dispatches keyed by `${owner}:${path}`. Guards against the\n// check-then-write TOCTOU window in handleEvent: two near-simultaneous fires of\n// the same event both pass the `lastStatus !== \"running\"` check (which has\n// several awaits before the DB is marked running) and would otherwise launch\n// two concurrent agent runs for one trigger. Sufficient for single-process\n// deployments; multi-instance would need a conditional DB update.\nconst _dispatchingTriggers = new Set<string>();\nlet _deps: TriggerDispatcherDeps | null = null;\n\n/**\n * Initialize the trigger dispatcher. Call once at server startup.\n * Loads all event-triggered jobs and subscribes to their events.\n */\nexport async function initTriggerDispatcher(\n deps: TriggerDispatcherDeps,\n): Promise<void> {\n _deps = deps;\n await refreshEventSubscriptions();\n}\n\n/**\n * Refresh event subscriptions from the resource store.\n * Call after creating/updating triggers.\n */\nexport async function refreshEventSubscriptions(): Promise<void> {\n try {\n const jobResources = await resourceListAllOwners(\"jobs/\");\n const eventNames = new Set<string>();\n\n for (const resource of jobResources) {\n if (!resource.path.endsWith(\".md\")) continue;\n const { meta } = parseTriggerFrontmatter(resource.content);\n if (meta.triggerType === \"event\" && meta.event && meta.enabled) {\n eventNames.add(meta.event);\n }\n }\n\n // Tear down subscriptions whose event no longer has any enabled trigger.\n for (const [eventName, subId] of [..._eventSubscriptions]) {\n if (!eventNames.has(eventName)) {\n unsubscribe(subId);\n _eventSubscriptions.delete(eventName);\n }\n }\n\n for (const eventName of eventNames) {\n if (!_eventSubscriptions.has(eventName)) {\n const subId = subscribe(eventName, (payload, eventMeta) =>\n handleEvent(eventName, payload, eventMeta),\n );\n _eventSubscriptions.set(eventName, subId);\n }\n }\n } catch (err) {\n console.error(\"[triggers] Failed to refresh event subscriptions:\", err);\n }\n}\n\nasync function handleEvent(\n eventName: string,\n payload: unknown,\n eventMeta: EventMeta,\n): Promise<void> {\n if (!_deps) return;\n\n try {\n const jobResources = await resourceListAllOwners(\"jobs/\");\n const matchingTriggers = jobResources.filter((r) => {\n if (!r.path.endsWith(\".md\")) return false;\n const { meta } = parseTriggerFrontmatter(r.content);\n // Scope: only dispatch triggers owned by the event's owner,\n // or shared triggers. Prevents cross-tenant trigger execution.\n if (\n eventMeta.owner &&\n r.owner !== eventMeta.owner &&\n r.owner !== \"__shared__\"\n ) {\n return false;\n }\n return (\n meta.triggerType === \"event\" &&\n meta.event === eventName &&\n meta.enabled &&\n meta.lastStatus !== \"running\"\n );\n });\n\n for (const resource of matchingTriggers) {\n const { meta, body } = parseTriggerFrontmatter(resource.content);\n if (!body.trim()) continue;\n\n // Resolve API key for condition evaluation\n const owner = meta.createdBy || resource.owner;\n const userApiKey = await getOwnerActiveApiKey(owner);\n const apiKey = userApiKey || _deps.apiKey;\n if (!apiKey) {\n console.warn(\n `[triggers] No API key for trigger \"${resource.path}\" — skipping`,\n );\n continue;\n }\n\n // Evaluate condition\n const matches = await evaluateCondition(meta.condition, payload, apiKey);\n if (!matches) continue;\n\n // Dispatch. Guard against concurrent duplicate dispatch of the same\n // trigger (TOCTOU on lastStatus) with an in-process lock keyed on the\n // trigger's identity.\n const dispatchKey = `${resource.owner}:${resource.path}`;\n if (_dispatchingTriggers.has(dispatchKey)) continue;\n if (meta.mode === \"agentic\") {\n _dispatchingTriggers.add(dispatchKey);\n try {\n await dispatchAgentic(\n resource,\n meta,\n body,\n payload,\n eventMeta,\n apiKey,\n );\n } finally {\n _dispatchingTriggers.delete(dispatchKey);\n }\n } else {\n console.warn(\n `[triggers] Deterministic mode not yet implemented for \"${resource.path}\" — skipping`,\n );\n }\n }\n } catch (err) {\n console.error(`[triggers] Error handling event \"${eventName}\":`, err);\n }\n}\n\n/**\n * Validate that the run-as user still exists and (if scoped to an org) is\n * still a member of that org. Mirrors the recurring-jobs scheduler check\n * (audit 12 #10): event-triggered automations must stop firing when the\n * creator is removed/demoted.\n */\nasync function isTriggerRunAsStillValid(\n jobUserEmail: string,\n jobOrgId: string | undefined,\n): Promise<{ ok: boolean; reason?: string }> {\n if (jobUserEmail === \"__shared__\") return { ok: true };\n try {\n const { getDbExec } = await import(\"../db/client.js\");\n const db = getDbExec();\n const userResult = await db.execute({\n sql: `SELECT 1 FROM \"user\" WHERE email = ? LIMIT 1`,\n args: [jobUserEmail],\n });\n if (!userResult.rows || userResult.rows.length === 0) {\n return { ok: false, reason: `user \"${jobUserEmail}\" no longer exists` };\n }\n if (jobOrgId) {\n const memberResult = await db.execute({\n sql: `SELECT 1 FROM org_members WHERE org_id = ? AND LOWER(email) = LOWER(?) LIMIT 1`,\n args: [jobOrgId, jobUserEmail],\n });\n if (!memberResult.rows || memberResult.rows.length === 0) {\n return {\n ok: false,\n reason: `user \"${jobUserEmail}\" is no longer a member of org \"${jobOrgId}\"`,\n };\n }\n }\n return { ok: true };\n } catch (err: any) {\n const msg = err?.message?.toLowerCase() ?? \"\";\n if (\n msg.includes(\"does not exist\") ||\n msg.includes(\"no such table\") ||\n msg.includes(\"undefined table\")\n ) {\n return { ok: true };\n }\n console.warn(\n `[triggers] User/membership validation failed for \"${jobUserEmail}\":`,\n err?.message,\n );\n return { ok: true };\n }\n}\n\nasync function dispatchAgentic(\n resource: { path: string; owner: string; content: string },\n meta: TriggerFrontmatter,\n body: string,\n payload: unknown,\n eventMeta: EventMeta,\n apiKey: string,\n): Promise<void> {\n if (!_deps) return;\n\n const triggerName = resource.path.replace(/^jobs\\//, \"\").replace(/\\.md$/, \"\");\n const now = new Date();\n\n const jobUserEmail = meta.createdBy || resource.owner;\n const jobOrgId = meta.orgId ?? undefined;\n\n // SECURITY (audit 12 #10): re-validate the run-as user/membership on\n // every dispatch. Sharing revocation, user deletion, and org-member\n // removal must take effect for already-scheduled triggers. Skip the\n // dispatch on failure; leave the trigger entry alone for admin review.\n const validity = await isTriggerRunAsStillValid(jobUserEmail, jobOrgId);\n if (!validity.ok) {\n console.warn(\n `[triggers] Skipping trigger \"${triggerName}\": ${validity.reason}. ` +\n `User/membership no longer valid — leaving entry for admin review.`,\n );\n meta.lastRun = now.toISOString();\n meta.lastStatus = \"skipped\";\n meta.lastError = validity.reason;\n await resourcePut(\n resource.owner,\n resource.path,\n buildTriggerContent(meta, body),\n );\n return;\n }\n\n // Mark as running\n meta.lastRun = now.toISOString();\n meta.lastStatus = \"running\";\n meta.lastError = undefined;\n await resourcePut(\n resource.owner,\n resource.path,\n buildTriggerContent(meta, body),\n );\n\n await runWithRequestContext(\n { userEmail: jobUserEmail, orgId: jobOrgId },\n async () => {\n try {\n const actions = _deps!.getActions();\n const systemPrompt = await _deps!.getSystemPrompt(jobUserEmail);\n const tools = actionsToEngineTools(actions);\n\n const engine = await resolveEngine({\n apiKey,\n appId: _deps!.appId,\n });\n const modelCandidate =\n _deps!.model ??\n (await getStoredModelForEngine(engine, { appId: _deps!.appId })) ??\n engine.defaultModel;\n const model = normalizeModelForEngine(engine, modelCandidate);\n const thread = await createThread(jobUserEmail, {\n title: `Trigger: ${triggerName} — ${now.toLocaleDateString()}`,\n });\n\n let payloadStr: string;\n try {\n payloadStr = JSON.stringify(payload, null, 2);\n } catch {\n payloadStr = String(payload);\n }\n\n const triggerText = `[Automation Trigger: ${triggerName}]\nEvent: ${meta.event}\nEvent ID: ${eventMeta.eventId}\nFired at: ${eventMeta.emittedAt}\n\nEvent payload:\n${payloadStr}\n\nExecute the following automation instructions:\n\n${body}`;\n\n const messages = [\n {\n role: \"user\" as const,\n content: [{ type: \"text\" as const, text: triggerText }],\n },\n ];\n\n const controller = new AbortController();\n const timeout = setTimeout(() => controller.abort(), 5 * 60 * 1000);\n\n const events: AgentChatEvent[] = [];\n let triggerUsage: Awaited<ReturnType<typeof runAgentLoop>> | null =\n null;\n\n try {\n triggerUsage = await runAgentLoop({\n engine,\n model,\n systemPrompt,\n tools,\n messages,\n actions,\n send: (event) => events.push(event),\n signal: controller.signal,\n threadId: thread.id,\n });\n } finally {\n clearTimeout(timeout);\n }\n\n if (\n triggerUsage &&\n (triggerUsage.inputTokens > 0 ||\n triggerUsage.outputTokens > 0 ||\n triggerUsage.cacheReadTokens > 0 ||\n triggerUsage.cacheWriteTokens > 0)\n ) {\n try {\n const { recordUsage } = await import(\"../usage/store.js\");\n await recordUsage({\n ownerEmail: jobUserEmail,\n inputTokens: triggerUsage.inputTokens,\n outputTokens: triggerUsage.outputTokens,\n cacheReadTokens: triggerUsage.cacheReadTokens,\n cacheWriteTokens: triggerUsage.cacheWriteTokens,\n model: triggerUsage.model,\n label: `automation:${triggerName}`,\n app: _deps!.appId,\n refId: eventMeta.eventId,\n });\n } catch {\n // Usage attribution must not break automation dispatch.\n }\n }\n\n meta.lastStatus = \"success\";\n await resourcePut(\n resource.owner,\n resource.path,\n buildTriggerContent(meta, body),\n );\n\n console.log(`[triggers] \"${triggerName}\" completed successfully`);\n } catch (err: any) {\n meta.lastStatus = \"error\";\n meta.lastError = err?.message?.slice(0, 200) || \"Unknown error\";\n await resourcePut(\n resource.owner,\n resource.path,\n buildTriggerContent(meta, body),\n );\n console.error(`[triggers] \"${triggerName}\" failed:`, err?.message);\n }\n },\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"dispatcher.js","sourceRoot":"","sources":["../../src/triggers/dispatcher.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,aAAa,GACd,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,GAErB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE/D,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BA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K,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,eAAe,CAAC;YAChE,MAAM,WAAW,CACf,QAAQ,CAAC,KAAK,EACd,QAAQ,CAAC,IAAI,EACb,mBAAmB,CAAC,IAAI,EAAE,IAAI,CAAC,CAChC,CAAC;YACF,OAAO,CAAC,KAAK,CAAC,eAAe,WAAW,WAAW,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;QACrE,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Trigger dispatcher — bridges the event bus to the automation system.\n *\n * On startup, loads all event-triggered jobs from the resources store,\n * subscribes to their events, and dispatches them (condition eval → agent\n * loop) when matching events fire.\n */\n\nimport {\n getStoredModelForEngine,\n normalizeModelForEngine,\n resolveEngine,\n} from \"../agent/engine/index.js\";\nimport {\n runAgentLoop,\n actionsToEngineTools,\n filterInitialEngineTools,\n getOwnerActiveApiKey,\n type ActionEntry,\n} from \"../agent/production-agent.js\";\nimport { attachToolSearch } from \"../agent/tool-search.js\";\nimport type { AgentChatEvent } from \"../agent/types.js\";\nimport { createThread } from \"../chat-threads/store.js\";\nimport { subscribe, unsubscribe } from \"../event-bus/index.js\";\nimport type { EventMeta } from \"../event-bus/types.js\";\nimport { resourceListAllOwners, resourcePut } from \"../resources/store.js\";\nimport { runWithRequestContext } from \"../server/request-context.js\";\nimport { evaluateCondition } from \"./condition-evaluator.js\";\nimport type { TriggerFrontmatter } from \"./types.js\";\n\n// Re-use the job frontmatter parser — triggers extend the same format.\nconst FRONTMATTER_RE = /^---\\n([\\s\\S]*?)\\n---\\n?([\\s\\S]*)$/;\n\nexport function parseTriggerFrontmatter(content: string): {\n meta: TriggerFrontmatter;\n body: string;\n} {\n const match = content.match(FRONTMATTER_RE);\n if (!match) {\n return {\n meta: {\n schedule: \"\",\n enabled: false,\n triggerType: \"schedule\",\n mode: \"agentic\",\n },\n body: content,\n };\n }\n\n const yamlBlock = match[1];\n const body = match[2].trim();\n\n const meta: TriggerFrontmatter = {\n schedule: \"\",\n enabled: true,\n triggerType: \"schedule\",\n mode: \"agentic\",\n };\n\n for (const line of yamlBlock.split(\"\\n\")) {\n const colonIdx = line.indexOf(\":\");\n if (colonIdx === -1) continue;\n const key = line.slice(0, colonIdx).trim();\n let value = line.slice(colonIdx + 1).trim();\n if (\n (value.startsWith('\"') && value.endsWith('\"')) ||\n (value.startsWith(\"'\") && value.endsWith(\"'\"))\n ) {\n value = value.slice(1, -1);\n }\n\n switch (key) {\n case \"schedule\":\n meta.schedule = value;\n break;\n case \"enabled\":\n meta.enabled = value !== \"false\";\n break;\n case \"triggerType\":\n meta.triggerType =\n value === \"event\" || value === \"schedule\" ? value : \"schedule\";\n break;\n case \"event\":\n meta.event = value;\n break;\n case \"condition\":\n meta.condition = value;\n break;\n case \"mode\":\n meta.mode =\n value === \"deterministic\" || value === \"agentic\" ? value : \"agentic\";\n break;\n case \"domain\":\n meta.domain = value;\n break;\n case \"createdBy\":\n meta.createdBy = value;\n break;\n case \"orgId\":\n meta.orgId = value;\n break;\n case \"runAs\":\n meta.runAs =\n value === \"shared\" || value === \"creator\" ? value : undefined;\n break;\n case \"lastRun\":\n meta.lastRun = value;\n break;\n case \"lastStatus\":\n meta.lastStatus = value as TriggerFrontmatter[\"lastStatus\"];\n break;\n case \"lastError\":\n meta.lastError = value;\n break;\n case \"nextRun\":\n meta.nextRun = value;\n break;\n }\n }\n\n return { meta, body };\n}\n\nexport function buildTriggerContent(\n meta: TriggerFrontmatter,\n body: string,\n): string {\n const lines = [\"---\"];\n lines.push(`schedule: \"${meta.schedule}\"`);\n lines.push(`enabled: ${meta.enabled}`);\n lines.push(`triggerType: ${meta.triggerType}`);\n if (meta.event) lines.push(`event: ${meta.event}`);\n if (meta.condition)\n lines.push(`condition: \"${meta.condition.replace(/\"/g, '\\\\\"')}\"`);\n lines.push(`mode: ${meta.mode}`);\n if (meta.domain) lines.push(`domain: ${meta.domain}`);\n if (meta.createdBy) lines.push(`createdBy: ${meta.createdBy}`);\n if (meta.orgId) lines.push(`orgId: ${meta.orgId}`);\n if (meta.runAs) lines.push(`runAs: ${meta.runAs}`);\n if (meta.lastRun) lines.push(`lastRun: ${meta.lastRun}`);\n if (meta.lastStatus) lines.push(`lastStatus: ${meta.lastStatus}`);\n if (meta.lastError)\n lines.push(`lastError: \"${meta.lastError.replace(/\"/g, '\\\\\"')}\"`);\n if (meta.nextRun) lines.push(`nextRun: ${meta.nextRun}`);\n lines.push(\"---\");\n lines.push(\"\");\n lines.push(body);\n return lines.join(\"\\n\");\n}\n\n// ─── Dispatcher deps (same pattern as SchedulerDeps) ────────────────────────\n\nexport interface TriggerDispatcherDeps {\n getActions: () => Record<string, ActionEntry>;\n getSystemPrompt: (owner: string) => Promise<string>;\n /**\n * Tool names to expose on the FIRST engine request for a trigger run. See\n * `SchedulerDeps.getInitialToolNames` (`jobs/scheduler.ts`) — same\n * semantics. Omit to keep the full `getActions()` set visible up front\n * (current behavior).\n */\n getInitialToolNames?: () => string[] | undefined;\n apiKey?: string;\n model?: string;\n /** App/template id used for org-scoped per-app model defaults. */\n appId?: string;\n}\n\n// Track active subscriptions (eventName -> subscription id) to avoid\n// double-subscribing AND so subscriptions for events that no longer have any\n// enabled trigger can be torn down — otherwise deleted/disabled triggers leave\n// phantom bus listeners that fire handleEvent forever.\nconst _eventSubscriptions = new Map<string, string>();\n// In-flight agentic dispatches keyed by `${owner}:${path}`. Guards against the\n// check-then-write TOCTOU window in handleEvent: two near-simultaneous fires of\n// the same event both pass the `lastStatus !== \"running\"` check (which has\n// several awaits before the DB is marked running) and would otherwise launch\n// two concurrent agent runs for one trigger. Sufficient for single-process\n// deployments; multi-instance would need a conditional DB update.\nconst _dispatchingTriggers = new Set<string>();\nlet _deps: TriggerDispatcherDeps | null = null;\n\n/**\n * Initialize the trigger dispatcher. Call once at server startup.\n * Loads all event-triggered jobs and subscribes to their events.\n */\nexport async function initTriggerDispatcher(\n deps: TriggerDispatcherDeps,\n): Promise<void> {\n _deps = deps;\n await refreshEventSubscriptions();\n}\n\n/**\n * Refresh event subscriptions from the resource store.\n * Call after creating/updating triggers.\n */\nexport async function refreshEventSubscriptions(): Promise<void> {\n try {\n const jobResources = await resourceListAllOwners(\"jobs/\");\n const eventNames = new Set<string>();\n\n for (const resource of jobResources) {\n if (!resource.path.endsWith(\".md\")) continue;\n const { meta } = parseTriggerFrontmatter(resource.content);\n if (meta.triggerType === \"event\" && meta.event && meta.enabled) {\n eventNames.add(meta.event);\n }\n }\n\n // Tear down subscriptions whose event no longer has any enabled trigger.\n for (const [eventName, subId] of [..._eventSubscriptions]) {\n if (!eventNames.has(eventName)) {\n unsubscribe(subId);\n _eventSubscriptions.delete(eventName);\n }\n }\n\n for (const eventName of eventNames) {\n if (!_eventSubscriptions.has(eventName)) {\n const subId = subscribe(eventName, (payload, eventMeta) =>\n handleEvent(eventName, payload, eventMeta),\n );\n _eventSubscriptions.set(eventName, subId);\n }\n }\n } catch (err) {\n console.error(\"[triggers] Failed to refresh event subscriptions:\", err);\n }\n}\n\nasync function handleEvent(\n eventName: string,\n payload: unknown,\n eventMeta: EventMeta,\n): Promise<void> {\n if (!_deps) return;\n\n try {\n const jobResources = await resourceListAllOwners(\"jobs/\");\n const matchingTriggers = jobResources.filter((r) => {\n if (!r.path.endsWith(\".md\")) return false;\n const { meta } = parseTriggerFrontmatter(r.content);\n // Scope: only dispatch triggers owned by the event's owner,\n // or shared triggers. Prevents cross-tenant trigger execution.\n if (\n eventMeta.owner &&\n r.owner !== eventMeta.owner &&\n r.owner !== \"__shared__\"\n ) {\n return false;\n }\n return (\n meta.triggerType === \"event\" &&\n meta.event === eventName &&\n meta.enabled &&\n meta.lastStatus !== \"running\"\n );\n });\n\n for (const resource of matchingTriggers) {\n const { meta, body } = parseTriggerFrontmatter(resource.content);\n if (!body.trim()) continue;\n\n // Resolve API key for condition evaluation\n const owner = meta.createdBy || resource.owner;\n const userApiKey = await getOwnerActiveApiKey(owner);\n const apiKey = userApiKey || _deps.apiKey;\n if (!apiKey) {\n console.warn(\n `[triggers] No API key for trigger \"${resource.path}\" — skipping`,\n );\n continue;\n }\n\n // Evaluate condition\n const matches = await evaluateCondition(meta.condition, payload, apiKey);\n if (!matches) continue;\n\n // Dispatch. Guard against concurrent duplicate dispatch of the same\n // trigger (TOCTOU on lastStatus) with an in-process lock keyed on the\n // trigger's identity.\n const dispatchKey = `${resource.owner}:${resource.path}`;\n if (_dispatchingTriggers.has(dispatchKey)) continue;\n if (meta.mode === \"agentic\") {\n _dispatchingTriggers.add(dispatchKey);\n try {\n await dispatchAgentic(\n resource,\n meta,\n body,\n payload,\n eventMeta,\n apiKey,\n );\n } finally {\n _dispatchingTriggers.delete(dispatchKey);\n }\n } else {\n console.warn(\n `[triggers] Deterministic mode not yet implemented for \"${resource.path}\" — skipping`,\n );\n }\n }\n } catch (err) {\n console.error(`[triggers] Error handling event \"${eventName}\":`, err);\n }\n}\n\n/**\n * Validate that the run-as user still exists and (if scoped to an org) is\n * still a member of that org. Mirrors the recurring-jobs scheduler check\n * (audit 12 #10): event-triggered automations must stop firing when the\n * creator is removed/demoted.\n */\nasync function isTriggerRunAsStillValid(\n jobUserEmail: string,\n jobOrgId: string | undefined,\n): Promise<{ ok: boolean; reason?: string }> {\n if (jobUserEmail === \"__shared__\") return { ok: true };\n try {\n const { getDbExec } = await import(\"../db/client.js\");\n const db = getDbExec();\n const userResult = await db.execute({\n sql: `SELECT 1 FROM \"user\" WHERE email = ? LIMIT 1`,\n args: [jobUserEmail],\n });\n if (!userResult.rows || userResult.rows.length === 0) {\n return { ok: false, reason: `user \"${jobUserEmail}\" no longer exists` };\n }\n if (jobOrgId) {\n const memberResult = await db.execute({\n sql: `SELECT 1 FROM org_members WHERE org_id = ? AND LOWER(email) = LOWER(?) LIMIT 1`,\n args: [jobOrgId, jobUserEmail],\n });\n if (!memberResult.rows || memberResult.rows.length === 0) {\n return {\n ok: false,\n reason: `user \"${jobUserEmail}\" is no longer a member of org \"${jobOrgId}\"`,\n };\n }\n }\n return { ok: true };\n } catch (err: any) {\n const msg = err?.message?.toLowerCase() ?? \"\";\n if (\n msg.includes(\"does not exist\") ||\n msg.includes(\"no such table\") ||\n msg.includes(\"undefined table\")\n ) {\n return { ok: true };\n }\n console.warn(\n `[triggers] User/membership validation failed for \"${jobUserEmail}\":`,\n err?.message,\n );\n return { ok: true };\n }\n}\n\nasync function dispatchAgentic(\n resource: { path: string; owner: string; content: string },\n meta: TriggerFrontmatter,\n body: string,\n payload: unknown,\n eventMeta: EventMeta,\n apiKey: string,\n): Promise<void> {\n if (!_deps) return;\n\n const triggerName = resource.path.replace(/^jobs\\//, \"\").replace(/\\.md$/, \"\");\n const now = new Date();\n\n const jobUserEmail = meta.createdBy || resource.owner;\n const jobOrgId = meta.orgId ?? undefined;\n\n // SECURITY (audit 12 #10): re-validate the run-as user/membership on\n // every dispatch. Sharing revocation, user deletion, and org-member\n // removal must take effect for already-scheduled triggers. Skip the\n // dispatch on failure; leave the trigger entry alone for admin review.\n const validity = await isTriggerRunAsStillValid(jobUserEmail, jobOrgId);\n if (!validity.ok) {\n console.warn(\n `[triggers] Skipping trigger \"${triggerName}\": ${validity.reason}. ` +\n `User/membership no longer valid — leaving entry for admin review.`,\n );\n meta.lastRun = now.toISOString();\n meta.lastStatus = \"skipped\";\n meta.lastError = validity.reason;\n await resourcePut(\n resource.owner,\n resource.path,\n buildTriggerContent(meta, body),\n );\n return;\n }\n\n // Mark as running\n meta.lastRun = now.toISOString();\n meta.lastStatus = \"running\";\n meta.lastError = undefined;\n await resourcePut(\n resource.owner,\n resource.path,\n buildTriggerContent(meta, body),\n );\n\n await runWithRequestContext(\n { userEmail: jobUserEmail, orgId: jobOrgId },\n async () => {\n try {\n const baseActions = _deps!.getActions();\n const systemPrompt = await _deps!.getSystemPrompt(jobUserEmail);\n const initialToolNames = _deps!.getInitialToolNames?.();\n // Only attach tool-search (and pay its schema cost) when the caller\n // actually supplied an initial subset to filter down to — otherwise\n // this is byte-for-byte the prior unfiltered behavior.\n const actions = initialToolNames\n ? attachToolSearch({ ...baseActions })\n : baseActions;\n const availableTools = actionsToEngineTools(actions);\n const tools = filterInitialEngineTools(\n availableTools,\n initialToolNames,\n );\n\n const engine = await resolveEngine({\n apiKey,\n appId: _deps!.appId,\n });\n const modelCandidate =\n _deps!.model ??\n (await getStoredModelForEngine(engine, { appId: _deps!.appId })) ??\n engine.defaultModel;\n const model = normalizeModelForEngine(engine, modelCandidate);\n const thread = await createThread(jobUserEmail, {\n title: `Trigger: ${triggerName} — ${now.toLocaleDateString()}`,\n });\n\n let payloadStr: string;\n try {\n payloadStr = JSON.stringify(payload, null, 2);\n } catch {\n payloadStr = String(payload);\n }\n\n const triggerText = `[Automation Trigger: ${triggerName}]\nEvent: ${meta.event}\nEvent ID: ${eventMeta.eventId}\nFired at: ${eventMeta.emittedAt}\n\nEvent payload:\n${payloadStr}\n\nExecute the following automation instructions:\n\n${body}`;\n\n const messages = [\n {\n role: \"user\" as const,\n content: [{ type: \"text\" as const, text: triggerText }],\n },\n ];\n\n const controller = new AbortController();\n const timeout = setTimeout(() => controller.abort(), 5 * 60 * 1000);\n\n const events: AgentChatEvent[] = [];\n let triggerUsage: Awaited<ReturnType<typeof runAgentLoop>> | null =\n null;\n\n try {\n triggerUsage = await runAgentLoop({\n engine,\n model,\n systemPrompt,\n tools,\n availableTools,\n messages,\n actions,\n send: (event) => events.push(event),\n signal: controller.signal,\n threadId: thread.id,\n });\n } finally {\n clearTimeout(timeout);\n }\n\n if (\n triggerUsage &&\n (triggerUsage.inputTokens > 0 ||\n triggerUsage.outputTokens > 0 ||\n triggerUsage.cacheReadTokens > 0 ||\n triggerUsage.cacheWriteTokens > 0)\n ) {\n try {\n const { recordUsage } = await import(\"../usage/store.js\");\n await recordUsage({\n ownerEmail: jobUserEmail,\n inputTokens: triggerUsage.inputTokens,\n outputTokens: triggerUsage.outputTokens,\n cacheReadTokens: triggerUsage.cacheReadTokens,\n cacheWriteTokens: triggerUsage.cacheWriteTokens,\n model: triggerUsage.model,\n label: `automation:${triggerName}`,\n app: _deps!.appId,\n refId: eventMeta.eventId,\n });\n } catch {\n // Usage attribution must not break automation dispatch.\n }\n }\n\n meta.lastStatus = \"success\";\n await resourcePut(\n resource.owner,\n resource.path,\n buildTriggerContent(meta, body),\n );\n\n console.log(`[triggers] \"${triggerName}\" completed successfully`);\n } catch (err: any) {\n meta.lastStatus = \"error\";\n meta.lastError = err?.message?.slice(0, 200) || \"Unknown error\";\n await resourcePut(\n resource.owner,\n resource.path,\n buildTriggerContent(meta, body),\n );\n console.error(`[triggers] \"${triggerName}\" failed:`, err?.message);\n }\n },\n );\n}\n"]}
|
package/dist/vite/client.d.ts
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
import type { Plugin, UserConfig } from "vite";
|
|
2
2
|
import { type McpIntegrationsConfigInput } from "../shared/mcp-integration-config.js";
|
|
3
3
|
import { type AgentNativeRouteWarmupConfigInput } from "../shared/route-warmup-config.js";
|
|
4
|
+
/**
|
|
5
|
+
* Wraps a single Nitro-provided Vite plugin so that, if it defines a
|
|
6
|
+
* `hotUpdate` hook, any `environment.hot.send({ type: "full-reload" })` call
|
|
7
|
+
* made from inside that hook is coalesced with a trailing debounce (leading
|
|
8
|
+
* edge suppressed) instead of firing immediately for every changed file.
|
|
9
|
+
* Everything else — module-graph invalidation, non-reload hot messages, the
|
|
10
|
+
* hook's return value — passes through unchanged and immediate. A burst of
|
|
11
|
+
* N changes within the debounce window collapses into exactly one
|
|
12
|
+
* full-reload once things go quiet; a single isolated change still reloads,
|
|
13
|
+
* just delayed by up to `NITRO_FULL_RELOAD_DEBOUNCE_MS`.
|
|
14
|
+
*
|
|
15
|
+
* `hotUpdate` only ever runs on Vite's dev server (never during a build), so
|
|
16
|
+
* this has no effect outside `vite dev`.
|
|
17
|
+
*/
|
|
18
|
+
declare function debounceNitroFullReloadHotUpdate(plugin: Plugin): Plugin;
|
|
4
19
|
/**
|
|
5
20
|
* Build the `resolve.dedupe` list dynamically. Reads core's package.json and
|
|
6
21
|
* collects every peerDependency that the consuming app also declares. This
|
|
@@ -148,5 +163,5 @@ export declare function agentNative(options?: AgentNativeVitePluginOptions): Plu
|
|
|
148
163
|
* preset. This compatibility wrapper remains for existing templates.
|
|
149
164
|
*/
|
|
150
165
|
export declare function defineConfig(options?: ClientConfigOptions): UserConfig;
|
|
151
|
-
export { getClientDedupe as _getClientDedupe, getDefaultOptimizeDeps as _getDefaultOptimizeDeps, findCorePackageRoot as _findCorePackageRoot, getReactRouterAliases as _getReactRouterAliases, };
|
|
166
|
+
export { getClientDedupe as _getClientDedupe, getDefaultOptimizeDeps as _getDefaultOptimizeDeps, findCorePackageRoot as _findCorePackageRoot, getReactRouterAliases as _getReactRouterAliases, debounceNitroFullReloadHotUpdate as _debounceNitroFullReloadHotUpdate, };
|
|
152
167
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/vite/client.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/vite/client.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAIV,MAAM,EACN,UAAU,EACX,MAAM,MAAM,CAAC;AAqBd,OAAO,EAEL,KAAK,0BAA0B,EAChC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAEL,KAAK,iCAAiC,EACvC,MAAM,kCAAkC,CAAC;AAmN1C;;;;;;;;;;;;;GAaG;AACH,iBAAS,gCAAgC,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAoFhE;AAuRD;;;;;GAKG;AACH,iBAAS,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAgE9C;AAED;;;;;;GAMG;AACH,iBAAS,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAkCvD;AAOD;;;;;GAKG;AACH,iBAAS,qBAAqB,CAC5B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;;OAQG;IACH,WAAW,CAAC,EAAE,iCAAiC,CAAC;IAChD;;;;;;;;OAQG;IACH,eAAe,CAAC,EAAE,0BAA0B,CAAC;IAC7C;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjD;AAED,MAAM,WAAW,4BAA6B,SAAQ,IAAI,CACxD,mBAAmB,EACnB,SAAS,GAAG,aAAa,CAC1B;IACC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAkiBD,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,IAAI,EAAE,MAAM,GAAG,SAAS,GACvB,MAAM,GAAG,SAAS,CAMpB;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GAAG,SAAS,GACvB,OAAO,CAWT;AAm8BD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CACzB,OAAO,GAAE,4BAAiC,GACzC,MAAM,EAAE,CAcV;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,GAAE,mBAAwB,GAAG,UAAU,CAU1E;AAED,OAAO,EACL,eAAe,IAAI,gBAAgB,EACnC,sBAAsB,IAAI,uBAAuB,EACjD,mBAAmB,IAAI,oBAAoB,EAC3C,qBAAqB,IAAI,sBAAsB,EAC/C,gCAAgC,IAAI,iCAAiC,GACtE,CAAC"}
|
package/dist/vite/client.js
CHANGED
|
@@ -175,7 +175,110 @@ function installNitroFsWatchGuard() {
|
|
|
175
175
|
}
|
|
176
176
|
function nitroVitePlugin(...args) {
|
|
177
177
|
installNitroFsWatchGuard();
|
|
178
|
-
|
|
178
|
+
const plugins = require("nitro/vite").nitro(...args);
|
|
179
|
+
return plugins.map(debounceNitroFullReloadHotUpdate);
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Debounce window for coalescing Nitro's dev-mode full-reload broadcasts.
|
|
183
|
+
*
|
|
184
|
+
* Nitro's own Vite plugin (the `hotUpdate` hook inside `nitro/vite`)
|
|
185
|
+
* invalidates each changed server module in the module graph synchronously,
|
|
186
|
+
* then sends `{ type: "full-reload" }` over that environment's hot channel —
|
|
187
|
+
* once per file-change event, with no debounce of its own. Every full-reload
|
|
188
|
+
* makes the Nitro dev worker re-import the entire SSR/server entry point,
|
|
189
|
+
* which is expensive. AI coding agents routinely write dozens of files in a
|
|
190
|
+
* single burst, so one edit session can trigger dozens of sequential
|
|
191
|
+
* re-imports back to back and pin a CPU core for minutes. This is a distinct
|
|
192
|
+
* concern from `fullReloadOnOptimizeDep504` elsewhere in this file (which
|
|
193
|
+
* rate-limits an unrelated client-reload nudge); keep the two independent.
|
|
194
|
+
*/
|
|
195
|
+
const NITRO_FULL_RELOAD_DEBOUNCE_MS = 300;
|
|
196
|
+
/**
|
|
197
|
+
* Wraps a single Nitro-provided Vite plugin so that, if it defines a
|
|
198
|
+
* `hotUpdate` hook, any `environment.hot.send({ type: "full-reload" })` call
|
|
199
|
+
* made from inside that hook is coalesced with a trailing debounce (leading
|
|
200
|
+
* edge suppressed) instead of firing immediately for every changed file.
|
|
201
|
+
* Everything else — module-graph invalidation, non-reload hot messages, the
|
|
202
|
+
* hook's return value — passes through unchanged and immediate. A burst of
|
|
203
|
+
* N changes within the debounce window collapses into exactly one
|
|
204
|
+
* full-reload once things go quiet; a single isolated change still reloads,
|
|
205
|
+
* just delayed by up to `NITRO_FULL_RELOAD_DEBOUNCE_MS`.
|
|
206
|
+
*
|
|
207
|
+
* `hotUpdate` only ever runs on Vite's dev server (never during a build), so
|
|
208
|
+
* this has no effect outside `vite dev`.
|
|
209
|
+
*/
|
|
210
|
+
function debounceNitroFullReloadHotUpdate(plugin) {
|
|
211
|
+
const originalHook = plugin.hotUpdate;
|
|
212
|
+
if (!originalHook)
|
|
213
|
+
return plugin;
|
|
214
|
+
// Vite hook properties are either a plain function or `{ handler, ... }`
|
|
215
|
+
// ("object form", used to attach hook metadata like `order`). Support both.
|
|
216
|
+
const isHandlerForm = typeof originalHook === "object";
|
|
217
|
+
const originalHandler = (isHandlerForm
|
|
218
|
+
? originalHook.handler
|
|
219
|
+
: originalHook);
|
|
220
|
+
// One pending-reload timer per Vite environment name ("ssr" by default, or
|
|
221
|
+
// a named Nitro service environment), so unrelated environments can never
|
|
222
|
+
// block or coalesce into each other.
|
|
223
|
+
const pendingReloadTimers = new Map();
|
|
224
|
+
function wrappedHotUpdate(options) {
|
|
225
|
+
const realEnvironment = this.environment;
|
|
226
|
+
// Proxy `this.environment.hot.send` so nitro's hook body (which reads
|
|
227
|
+
// `this.environment` and calls `env.hot.send(...)`) is otherwise
|
|
228
|
+
// untouched — only full-reload payloads get intercepted below.
|
|
229
|
+
const proxiedThis = new Proxy(this, {
|
|
230
|
+
get(target, prop, receiver) {
|
|
231
|
+
if (prop !== "environment") {
|
|
232
|
+
return Reflect.get(target, prop, receiver);
|
|
233
|
+
}
|
|
234
|
+
return new Proxy(realEnvironment, {
|
|
235
|
+
get(envTarget, envProp, envReceiver) {
|
|
236
|
+
if (envProp !== "hot") {
|
|
237
|
+
return Reflect.get(envTarget, envProp, envReceiver);
|
|
238
|
+
}
|
|
239
|
+
const realHot = envTarget.hot;
|
|
240
|
+
return new Proxy(realHot, {
|
|
241
|
+
get(hotTarget, hotProp, hotReceiver) {
|
|
242
|
+
if (hotProp !== "send") {
|
|
243
|
+
return Reflect.get(hotTarget, hotProp, hotReceiver);
|
|
244
|
+
}
|
|
245
|
+
return (payload) => {
|
|
246
|
+
if (!payload ||
|
|
247
|
+
typeof payload !== "object" ||
|
|
248
|
+
payload.type !== "full-reload") {
|
|
249
|
+
// Not a full-reload — pass through immediately.
|
|
250
|
+
return hotTarget.send(payload);
|
|
251
|
+
}
|
|
252
|
+
const key = realEnvironment.name || "default";
|
|
253
|
+
const pending = pendingReloadTimers.get(key);
|
|
254
|
+
if (pending)
|
|
255
|
+
clearTimeout(pending);
|
|
256
|
+
const timer = setTimeout(() => {
|
|
257
|
+
pendingReloadTimers.delete(key);
|
|
258
|
+
hotTarget.send(payload);
|
|
259
|
+
}, NITRO_FULL_RELOAD_DEBOUNCE_MS);
|
|
260
|
+
// Never hold the process open just for a pending reload.
|
|
261
|
+
timer.unref?.();
|
|
262
|
+
pendingReloadTimers.set(key, timer);
|
|
263
|
+
};
|
|
264
|
+
},
|
|
265
|
+
});
|
|
266
|
+
},
|
|
267
|
+
});
|
|
268
|
+
},
|
|
269
|
+
});
|
|
270
|
+
return originalHandler.call(proxiedThis, options);
|
|
271
|
+
}
|
|
272
|
+
if (isHandlerForm) {
|
|
273
|
+
return {
|
|
274
|
+
...plugin,
|
|
275
|
+
hotUpdate: {
|
|
276
|
+
...originalHook,
|
|
277
|
+
handler: wrappedHotUpdate,
|
|
278
|
+
},
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
return { ...plugin, hotUpdate: wrappedHotUpdate };
|
|
179
282
|
}
|
|
180
283
|
/**
|
|
181
284
|
* Sync discovery for the workspace-core in an enterprise monorepo.
|
|
@@ -1640,7 +1743,12 @@ function readAppChangelogMarkdown(changelogPath, watchFile) {
|
|
|
1640
1743
|
.map((file) => {
|
|
1641
1744
|
const filePath = path.join(pendingDir, file);
|
|
1642
1745
|
watchFile(filePath);
|
|
1643
|
-
|
|
1746
|
+
// `agent-native changelog add` prefixes every pending filename with its
|
|
1747
|
+
// date. Preserve that date when a hand-written entry omits `date:` so a
|
|
1748
|
+
// deployed What's new surface never groups an already-merged update
|
|
1749
|
+
// under an inaccurate "Unreleased" heading.
|
|
1750
|
+
const filenameDate = file.match(/^(\d{4}-\d{2}-\d{2})(?:-|\.md$)/)?.[1];
|
|
1751
|
+
return parsePendingEntry(fs.readFileSync(filePath, "utf-8"), filenameDate);
|
|
1644
1752
|
});
|
|
1645
1753
|
return mergePendingChangelog(existing, pending);
|
|
1646
1754
|
}
|
|
@@ -2311,5 +2419,5 @@ export function defineConfig(options = {}) {
|
|
|
2311
2419
|
}),
|
|
2312
2420
|
};
|
|
2313
2421
|
}
|
|
2314
|
-
export { getClientDedupe as _getClientDedupe, getDefaultOptimizeDeps as _getDefaultOptimizeDeps, findCorePackageRoot as _findCorePackageRoot, getReactRouterAliases as _getReactRouterAliases, };
|
|
2422
|
+
export { getClientDedupe as _getClientDedupe, getDefaultOptimizeDeps as _getDefaultOptimizeDeps, findCorePackageRoot as _findCorePackageRoot, getReactRouterAliases as _getReactRouterAliases, debounceNitroFullReloadHotUpdate as _debounceNitroFullReloadHotUpdate, };
|
|
2315
2423
|
//# sourceMappingURL=client.js.map
|