@agent-native/core 0.137.8 → 0.139.0
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/agent-native.eject.json +2 -0
- package/corpus/README.md +1 -1
- package/corpus/templates/analytics/.agents/skills/agent-native-docs/SKILL.md +23 -3
- package/corpus/templates/analytics/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
- package/corpus/templates/analytics/.agents/skills/data-querying/SKILL.md +15 -0
- package/corpus/templates/analytics/.agents/skills/frontend-design/SKILL.md +23 -2
- package/corpus/templates/analytics/.agents/skills/frontend-design/references/visual-direction.md +99 -0
- package/corpus/templates/analytics/AGENTS.md +2 -2
- package/corpus/templates/analytics/actions/get-first-party-analytics-health.ts +65 -0
- package/corpus/templates/analytics/actions/provider-api-catalog.ts +3 -6
- package/corpus/templates/analytics/actions/provider-api-docs.ts +3 -6
- package/corpus/templates/analytics/actions/provider-api-request.ts +3 -6
- package/corpus/templates/analytics/actions/query-agent-native-analytics.ts +3 -3
- package/corpus/templates/analytics/agent-native.json +12 -0
- package/corpus/templates/analytics/app/i18n-data.ts +162 -0
- package/corpus/templates/analytics/app/pages/DataSources.tsx +126 -1
- package/corpus/templates/analytics/changelog/2026-08-05-analytics-now-flags-neon-pressure-and-guides-high-volume-tra.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-05-first-party-analytics-uses-compact-rollups-for-faster-usage-.md +6 -0
- package/corpus/templates/analytics/server/db/schema.ts +52 -0
- package/corpus/templates/analytics/server/lib/credential-keys.ts +3 -0
- package/corpus/templates/analytics/server/lib/dashboard-report.ts +2 -0
- package/corpus/templates/analytics/server/lib/emails.ts +51 -0
- package/corpus/templates/analytics/server/lib/first-party-analytics-health.ts +397 -0
- package/corpus/templates/analytics/server/lib/first-party-analytics-rollups.ts +182 -0
- package/corpus/templates/analytics/server/lib/first-party-analytics.ts +86 -15
- package/corpus/templates/analytics/server/lib/provider-api.ts +20 -1
- package/corpus/templates/analytics/server/lib/replay-storage.ts +1 -1
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +1 -0
- package/corpus/templates/analytics/server/plugins/db.ts +60 -0
- package/corpus/templates/analytics/server/plugins/transactional-emails.ts +5 -0
- package/corpus/templates/assets/.agents/skills/agent-native-docs/SKILL.md +23 -3
- package/corpus/templates/assets/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
- package/corpus/templates/assets/.agents/skills/frontend-design/SKILL.md +23 -2
- package/corpus/templates/assets/.agents/skills/frontend-design/references/visual-direction.md +99 -0
- package/corpus/templates/assets/agent-native.json +12 -0
- package/corpus/templates/assets/server/lib/generation.ts +8 -8
- package/corpus/templates/assets/server/lib/storage.ts +1 -1
- package/corpus/templates/assets/server/plugins/onboarding.ts +1 -1
- package/corpus/templates/brain/.agents/skills/agent-native-docs/SKILL.md +23 -3
- package/corpus/templates/brain/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
- package/corpus/templates/brain/.agents/skills/frontend-design/SKILL.md +23 -2
- package/corpus/templates/brain/.agents/skills/frontend-design/references/visual-direction.md +99 -0
- package/corpus/templates/brain/agent-native.json +12 -0
- package/corpus/templates/calendar/.agents/skills/agent-native-docs/SKILL.md +23 -3
- package/corpus/templates/calendar/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
- package/corpus/templates/calendar/.agents/skills/frontend-design/SKILL.md +23 -2
- package/corpus/templates/calendar/.agents/skills/frontend-design/references/visual-direction.md +99 -0
- package/corpus/templates/calendar/agent-native.json +12 -0
- package/corpus/templates/calendar/server/lib/booking-emails.ts +154 -70
- package/corpus/templates/calendar/server/lib/emails.ts +167 -0
- package/corpus/templates/calendar/server/lib/event-guest-notifications.ts +64 -28
- package/corpus/templates/calendar/server/plugins/transactional-emails.ts +5 -0
- package/corpus/templates/chat/.agents/skills/agent-native-docs/SKILL.md +23 -3
- package/corpus/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
- package/corpus/templates/chat/.agents/skills/frontend-design/SKILL.md +23 -2
- package/corpus/templates/chat/.agents/skills/frontend-design/references/visual-direction.md +99 -0
- package/corpus/templates/chat/AGENTS.md +3 -0
- package/corpus/templates/chat/DESIGN.md +28 -0
- package/corpus/templates/chat/agent-native.json +12 -0
- package/corpus/templates/clips/.agents/skills/agent-native-docs/SKILL.md +23 -3
- package/corpus/templates/clips/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
- package/corpus/templates/clips/.agents/skills/frontend-design/SKILL.md +23 -2
- package/corpus/templates/clips/.agents/skills/frontend-design/references/visual-direction.md +99 -0
- package/corpus/templates/clips/actions/cleanup-transcript.ts +2 -2
- package/corpus/templates/clips/actions/delete-recording-permanent.ts +3 -0
- package/corpus/templates/clips/actions/get-playback-position.ts +68 -0
- package/corpus/templates/clips/actions/import-loom-recording.ts +2 -2
- package/corpus/templates/clips/actions/invite-member.ts +39 -15
- package/corpus/templates/clips/actions/save-playback-position.ts +80 -0
- package/corpus/templates/clips/actions/set-thumbnail.ts +1 -1
- package/corpus/templates/clips/agent-native.json +12 -0
- package/corpus/templates/clips/app/components/player/video-player.tsx +54 -5
- package/corpus/templates/clips/app/hooks/use-playback-position.ts +188 -0
- package/corpus/templates/clips/app/hooks/use-view-tracking.ts +6 -24
- package/corpus/templates/clips/app/lib/playback-position.ts +99 -0
- package/corpus/templates/clips/app/lib/viewer-session.ts +29 -0
- package/corpus/templates/clips/changelog/2026-08-05-clip-buffering-now-uses-buffering-copy-after-playback.md +6 -0
- package/corpus/templates/clips/changelog/2026-08-05-clips-remembers-your-playback-position-when-you-reopen-a-cli.md +6 -0
- package/corpus/templates/clips/learnings.defaults.md +1 -1
- package/corpus/templates/clips/server/db/schema.ts +18 -0
- package/corpus/templates/clips/server/lib/emails.ts +256 -0
- package/corpus/templates/clips/server/lib/public-agent-context.ts +1 -1
- package/corpus/templates/clips/server/lib/transactional-email-templates.ts +24 -0
- package/corpus/templates/clips/server/lib/video-storage.ts +1 -1
- package/corpus/templates/clips/server/plugins/db.ts +15 -0
- package/corpus/templates/clips/server/plugins/transactional-email-catalog.ts +5 -0
- package/corpus/templates/clips/server/routes/api/media/index.post.ts +1 -1
- package/corpus/templates/content/.agents/skills/agent-native-docs/SKILL.md +23 -3
- package/corpus/templates/content/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
- package/corpus/templates/content/.agents/skills/document-editing/references/databases.md +13 -0
- package/corpus/templates/content/.agents/skills/frontend-design/SKILL.md +23 -2
- package/corpus/templates/content/.agents/skills/frontend-design/references/visual-direction.md +99 -0
- package/corpus/templates/content/AGENTS.md +1 -0
- package/corpus/templates/content/actions/_content-database-mutation-lock.ts +41 -0
- package/corpus/templates/content/actions/_content-database-row-migration.ts +569 -0
- package/corpus/templates/content/actions/_database-source-utils.ts +82 -36
- package/corpus/templates/content/actions/_database-utils.ts +5 -0
- package/corpus/templates/content/actions/_delete-content-space.ts +25 -11
- package/corpus/templates/content/actions/add-database-item.ts +60 -42
- package/corpus/templates/content/actions/attach-content-database-source.ts +2 -0
- package/corpus/templates/content/actions/configure-document-property.ts +99 -104
- package/corpus/templates/content/actions/delete-content-database.ts +19 -7
- package/corpus/templates/content/actions/delete-document-property.ts +47 -58
- package/corpus/templates/content/actions/delete-document.ts +390 -167
- package/corpus/templates/content/actions/disconnect-content-database-source.ts +41 -24
- package/corpus/templates/content/actions/duplicate-database-item.ts +63 -31
- package/corpus/templates/content/actions/duplicate-database-items.ts +86 -43
- package/corpus/templates/content/actions/duplicate-document-property.ts +37 -14
- package/corpus/templates/content/actions/migrate-content-database-rows.ts +830 -0
- package/corpus/templates/content/actions/move-database-item.ts +14 -0
- package/corpus/templates/content/actions/permanently-delete-document.ts +27 -6
- package/corpus/templates/content/actions/remove-database-items.ts +13 -0
- package/corpus/templates/content/actions/reorder-document-property.ts +45 -46
- package/corpus/templates/content/actions/set-document-property.ts +68 -28
- package/corpus/templates/content/actions/submit-content-database-form.ts +49 -0
- package/corpus/templates/content/actions/transcribe-media.ts +1 -1
- package/corpus/templates/content/agent-native.json +12 -0
- package/corpus/templates/content/app/components/editor/image-upload.ts +2 -2
- package/corpus/templates/content/app/i18n-data.ts +1 -1
- package/corpus/templates/content/changelog/2026-08-01-content-can-reorganize-every-row-in-an-existing-database-as-.md +6 -0
- package/corpus/templates/content/parity/matrix.md +1 -1
- package/corpus/templates/content/parity/matrix.ts +4 -2
- package/corpus/templates/content/server/db/schema.ts +30 -0
- package/corpus/templates/content/server/lib/comment-notifications.ts +57 -26
- package/corpus/templates/content/server/lib/emails.ts +70 -0
- package/corpus/templates/content/server/plugins/db.ts +24 -0
- package/corpus/templates/content/server/plugins/onboarding.ts +2 -2
- package/corpus/templates/content/server/plugins/transactional-emails.ts +5 -0
- package/corpus/templates/crm/.agents/skills/agent-native-docs/SKILL.md +23 -3
- package/corpus/templates/crm/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
- package/corpus/templates/crm/agent-native.json +12 -0
- package/corpus/templates/design/.agents/skills/agent-native-docs/SKILL.md +23 -3
- package/corpus/templates/design/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
- package/corpus/templates/design/.agents/skills/frontend-design/SKILL.md +23 -2
- package/corpus/templates/design/.agents/skills/frontend-design/references/visual-direction.md +99 -0
- package/corpus/templates/design/CODE_NATIVE_DESIGN_STUDIO_IMPLEMENTATION_PLAN.md +2 -2
- package/corpus/templates/design/DESIGN-STUDIO-PLAN.md +2 -2
- package/corpus/templates/design/actions/apply-design-token-edit.ts +1 -1
- package/corpus/templates/design/actions/capture-design-state.ts +1 -1
- package/corpus/templates/design/actions/connect-builder-app.ts +2 -2
- package/corpus/templates/design/actions/create-design-branch.ts +1 -1
- package/corpus/templates/design/actions/create-fusion-app.ts +3 -3
- package/corpus/templates/design/actions/deploy-design-preview.ts +1 -1
- package/corpus/templates/design/actions/get-component-details.ts +1 -1
- package/corpus/templates/design/actions/get-design-branch-diff.ts +1 -1
- package/corpus/templates/design/actions/index-components.ts +3 -3
- package/corpus/templates/design/actions/index-design-system-with-builder.ts +1 -1
- package/corpus/templates/design/actions/migrate-inline-design-to-app.ts +3 -3
- package/corpus/templates/design/actions/open-component-source.ts +1 -1
- package/corpus/templates/design/actions/update-design.ts +61 -0
- package/corpus/templates/design/agent-native.json +12 -0
- package/corpus/templates/design/app/components/design/edit-panel/component-section.tsx +1 -1
- package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +1 -1
- package/corpus/templates/design/scripts/qa-figma-stress-import.ts +1 -1
- package/corpus/templates/design/server/lib/figma-node-import.ts +1 -1
- package/corpus/templates/design/shared/design-source-capabilities.ts +25 -9
- package/corpus/templates/dispatch/.agents/skills/agent-native-docs/SKILL.md +23 -3
- package/corpus/templates/dispatch/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
- package/corpus/templates/dispatch/.agents/skills/frontend-design/SKILL.md +23 -2
- package/corpus/templates/dispatch/.agents/skills/frontend-design/references/visual-direction.md +99 -0
- package/corpus/templates/dispatch/agent-native.json +12 -0
- package/corpus/templates/dispatch/app/routes/transactional-email.$appId.$id.tsx +4 -0
- package/corpus/templates/dispatch/app/routes/transactional-email.tsx +4 -0
- package/corpus/templates/factory/.agents/skills/agent-native-docs/SKILL.md +23 -3
- package/corpus/templates/factory/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
- package/corpus/templates/factory/.agents/skills/frontend-design/SKILL.md +23 -2
- package/corpus/templates/factory/.agents/skills/frontend-design/references/visual-direction.md +99 -0
- package/corpus/templates/factory/agent-native.json +12 -0
- package/corpus/templates/forms/.agents/skills/agent-native-docs/SKILL.md +23 -3
- package/corpus/templates/forms/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
- package/corpus/templates/forms/.agents/skills/frontend-design/SKILL.md +23 -2
- package/corpus/templates/forms/.agents/skills/frontend-design/references/visual-direction.md +99 -0
- package/corpus/templates/forms/actions/export-responses.ts +1 -1
- package/corpus/templates/forms/agent-native.json +12 -0
- package/corpus/templates/forms/server/lib/emails.ts +52 -0
- package/corpus/templates/forms/server/lib/response-email.ts +2 -0
- package/corpus/templates/forms/server/plugins/transactional-emails.ts +5 -0
- package/corpus/templates/macros/.agents/skills/agent-native-docs/SKILL.md +23 -3
- package/corpus/templates/macros/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
- package/corpus/templates/macros/.agents/skills/frontend-design/SKILL.md +23 -2
- package/corpus/templates/macros/.agents/skills/frontend-design/references/visual-direction.md +99 -0
- package/corpus/templates/macros/agent-native.json +12 -0
- package/corpus/templates/mail/.agents/skills/agent-native-docs/SKILL.md +23 -3
- package/corpus/templates/mail/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
- package/corpus/templates/mail/.agents/skills/frontend-design/SKILL.md +23 -2
- package/corpus/templates/mail/.agents/skills/frontend-design/references/visual-direction.md +99 -0
- package/corpus/templates/mail/agent-native.json +12 -0
- package/corpus/templates/mail/app/i18n/en-US.ts +1 -1
- package/corpus/templates/mail/server/lib/media-upload.ts +1 -1
- package/corpus/templates/plan/.agents/skills/agent-native-docs/SKILL.md +23 -3
- package/corpus/templates/plan/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
- package/corpus/templates/plan/.agents/skills/frontend-design/SKILL.md +23 -2
- package/corpus/templates/plan/.agents/skills/frontend-design/references/visual-direction.md +99 -0
- package/corpus/templates/plan/actions/request-plan-access.ts +33 -12
- package/corpus/templates/plan/agent-native.json +12 -0
- package/corpus/templates/plan/server/lib/comment-notifications.ts +53 -27
- package/corpus/templates/plan/server/lib/emails.ts +67 -0
- package/corpus/templates/plan/server/lib/plan-assets.ts +1 -1
- package/corpus/templates/plan/server/plugins/transactional-emails.ts +5 -0
- package/corpus/templates/slides/.agents/skills/agent-native-docs/SKILL.md +23 -3
- package/corpus/templates/slides/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
- package/corpus/templates/slides/.agents/skills/frontend-design/SKILL.md +23 -2
- package/corpus/templates/slides/.agents/skills/frontend-design/references/visual-direction.md +99 -0
- package/corpus/templates/slides/actions/generate-image-api.ts +1 -1
- package/corpus/templates/slides/actions/generate-slides-ai.ts +1 -1
- package/corpus/templates/slides/actions/import-file.ts +2 -2
- package/corpus/templates/slides/actions/index-design-system-with-builder.ts +1 -1
- package/corpus/templates/slides/agent-native.json +12 -0
- package/corpus/templates/slides/app/components/design-system/DesignSystemSetup.tsx +1 -1
- package/corpus/templates/slides/app/i18n/en-US.ts +2 -2
- package/corpus/templates/slides/app/lib/deck-sorting.ts +19 -0
- package/corpus/templates/slides/app/lib/image-drop-to-agent.ts +1 -1
- package/corpus/templates/slides/app/pages/Index.tsx +7 -2
- package/corpus/templates/slides/changelog/2026-08-05-decks-are-now-sorted-by-most-recently-updated.md +6 -0
- package/corpus/templates/slides/server/handlers/assets.ts +1 -1
- package/corpus/templates/slides/server/handlers/uploads.ts +1 -1
- package/corpus/templates/slides/server/lib/comment-notifications.ts +44 -21
- package/corpus/templates/slides/server/lib/emails.ts +40 -0
- package/corpus/templates/slides/server/plugins/transactional-emails.ts +5 -0
- package/corpus/templates/tasks/.agents/skills/agent-native-docs/SKILL.md +23 -3
- package/corpus/templates/tasks/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
- package/corpus/templates/tasks/.agents/skills/frontend-design/SKILL.md +23 -2
- package/corpus/templates/tasks/.agents/skills/frontend-design/references/visual-direction.md +99 -0
- package/corpus/templates/tasks/agent-native.json +12 -0
- package/dist/action.d.ts +6 -0
- package/dist/agent/engine/builder-engine.js +2 -2
- package/dist/agent/engine/credential-errors.d.ts +1 -1
- package/dist/agent/engine/credential-errors.js +2 -2
- package/dist/agent/production-agent.js +3 -2
- package/dist/brand-kit/fig/index.js +1 -1
- package/dist/cli/agent.js +45 -3
- package/dist/cli/code-agent-executor.js +2 -1
- package/dist/cli/create.d.ts +9 -1
- package/dist/cli/create.js +94 -1
- package/dist/cli/doctor.d.ts +8 -11
- package/dist/cli/doctor.js +92 -24
- package/dist/cli/index.js +6 -5
- package/dist/client/AgentAskPopover.d.ts +3 -1
- package/dist/client/AgentAskPopover.js +2 -2
- package/dist/client/AgentPanel.js +9 -3
- package/dist/client/AssistantChat.js +54 -33
- package/dist/client/MultiTabAssistantChat.js +1 -1
- package/dist/client/RouteTransitionIndicator.d.ts +7 -0
- package/dist/client/RouteTransitionIndicator.js +31 -0
- package/dist/client/agent-engine-key.js +1 -1
- package/dist/client/app-providers.js +11 -2
- package/dist/client/chat/message-components.js +1 -1
- package/dist/client/chat/run-recovery.js +1 -1
- package/dist/client/chat/tool-call-display.d.ts +3 -1
- package/dist/client/chat/tool-call-display.js +4 -3
- package/dist/client/chat-model-groups.d.ts +6 -0
- package/dist/client/chat-model-groups.js +11 -0
- package/dist/client/error-format.js +1 -1
- package/dist/client/i18n.js +1 -1
- package/dist/client/onboarding/FirstRunOnboarding.d.ts +5 -1
- package/dist/client/onboarding/FirstRunOnboarding.js +29 -13
- package/dist/client/onboarding/first-run-enabled.d.ts +6 -1
- package/dist/client/onboarding/first-run-enabled.js +33 -3
- package/dist/client/onboarding/use-onboarding.js +16 -11
- package/dist/client/resources/mcp-integration-catalog.js +26 -0
- package/dist/client/resources/mcp-integration-logos.js +4 -0
- package/dist/client/route-warmup.js +56 -10
- package/dist/client/settings/AccountSettingsCard.js +78 -3
- package/dist/client/settings/SettingsPanel.js +1 -1
- package/dist/client/settings/VoiceTranscriptionSection.js +2 -2
- package/dist/client/settings/useBuilderStatus.js +1 -1
- package/dist/client/setup-connections/useBuilderConnectCardController.js +1 -1
- package/dist/client/ui/index.d.ts +1 -0
- package/dist/client/ui/index.js +1 -0
- package/dist/client/uploads/upload-editor-image.js +1 -1
- package/dist/client/use-chat-threads.js +3 -0
- package/dist/collab/routes.d.ts +1 -1
- package/dist/config.d.ts +48 -0
- package/dist/config.js +111 -0
- package/dist/db/migrations.js +5 -0
- package/dist/eject/provider-api-definitions.d.ts +1 -1
- package/dist/eject/provider-api-definitions.js +1 -0
- package/dist/eject/remote-mcp-presets.js +1 -0
- package/dist/email-catalog/actions/list-email-activity.d.ts +6 -0
- package/dist/email-catalog/actions/list-email-activity.js +15 -0
- package/dist/email-catalog/actions/list-email-engagement.d.ts +6 -0
- package/dist/email-catalog/actions/list-email-engagement.js +15 -0
- package/dist/email-catalog/actions/list-email-log.d.ts +8 -0
- package/dist/email-catalog/actions/list-email-log.js +22 -0
- package/dist/email-catalog/actions/list-transactional-emails.d.ts +23 -0
- package/dist/email-catalog/actions/list-transactional-emails.js +61 -0
- package/dist/email-catalog/actions/render-transactional-email-preview.d.ts +10 -0
- package/dist/email-catalog/actions/render-transactional-email-preview.js +24 -0
- package/dist/email-catalog/authorize.d.ts +2 -0
- package/dist/email-catalog/authorize.js +10 -0
- package/dist/email-catalog/log.d.ts +57 -0
- package/dist/email-catalog/log.js +117 -0
- package/dist/email-catalog/provider-metrics.d.ts +34 -0
- package/dist/email-catalog/provider-metrics.js +165 -0
- package/dist/email-catalog/registry.d.ts +79 -0
- package/dist/email-catalog/registry.js +71 -0
- package/dist/email-catalog/schema.d.ts +212 -0
- package/dist/email-catalog/schema.js +49 -0
- package/dist/email-catalog/system-emails.d.ts +14 -0
- package/dist/email-catalog/system-emails.js +68 -0
- package/dist/extensions/web-search-tool.js +2 -2
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/file-upload/actions/upload-image.js +1 -1
- package/dist/file-upload/registry.js +1 -1
- package/dist/guards/index.d.ts +3 -0
- package/dist/guards/index.js +2 -0
- package/dist/guards/no-empty-migrations.d.ts +14 -0
- package/dist/guards/no-empty-migrations.js +126 -0
- package/dist/index.browser.d.ts +1 -0
- package/dist/index.browser.js +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/localization/default-messages.d.ts +69 -0
- package/dist/localization/default-messages.js +71 -2
- package/dist/notifications/routes.d.ts +2 -2
- package/dist/onboarding/app-profile.js +1 -1
- package/dist/onboarding/plugin.d.ts +2 -0
- package/dist/onboarding/plugin.js +29 -2
- package/dist/org/handlers.js +8 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +11 -11
- package/dist/provider-api/actions/provider-api.d.ts +13 -13
- package/dist/provider-api/index.d.ts +4 -4
- package/dist/provider-api/index.js +35 -0
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/resources/handlers.js +1 -1
- package/dist/scripts/docs/framework-search.d.ts +9 -0
- package/dist/scripts/docs/framework-search.js +239 -0
- package/dist/scripts/docs/index.js +1 -0
- package/dist/scripts/docs/search.d.ts +10 -0
- package/dist/scripts/docs/search.js +1 -1
- package/dist/scripts/docs/source-search.d.ts +10 -2
- package/dist/scripts/docs/source-search.js +108 -41
- package/dist/search-utils/index.d.ts +11 -0
- package/dist/search-utils/index.js +72 -0
- package/dist/server/action-change.d.ts +6 -0
- package/dist/server/action-change.js +28 -14
- package/dist/server/action-discovery.js +31 -0
- package/dist/server/action-routes.js +1 -0
- package/dist/server/agent-chat/browser-team-tools.js +1 -1
- package/dist/server/agent-chat/script-entries.js +43 -2
- package/dist/server/auth-login-mode.d.ts +8 -0
- package/dist/server/auth-login-mode.js +17 -0
- package/dist/server/auth.js +100 -15
- package/dist/server/better-auth-instance.d.ts +36 -0
- package/dist/server/better-auth-instance.js +42 -5
- package/dist/server/builder-design-systems.js +1 -1
- package/dist/server/core-routes-plugin.js +17 -14
- package/dist/server/credential-provider.js +3 -3
- package/dist/server/email-templates.d.ts +7 -0
- package/dist/server/email-templates.js +24 -0
- package/dist/server/email.d.ts +26 -0
- package/dist/server/email.js +66 -4
- package/dist/server/framework-request-handler.js +6 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +1 -0
- package/dist/server/onboarding-html.d.ts +2 -0
- package/dist/server/onboarding-html.js +169 -8
- package/dist/server/realtime-token.d.ts +1 -1
- package/dist/server/realtime-voice.js +1 -1
- package/dist/server/sentry.d.ts +1 -1
- package/dist/server/transcribe-voice.js +3 -3
- package/dist/shared/first-run-onboarding.d.ts +1 -0
- package/dist/shared/first-run-onboarding.js +1 -0
- package/dist/templates/chat/.agents/skills/agent-native-docs/SKILL.md +23 -3
- package/dist/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
- package/dist/templates/chat/.agents/skills/frontend-design/SKILL.md +23 -2
- package/dist/templates/chat/.agents/skills/frontend-design/references/visual-direction.md +99 -0
- package/dist/templates/chat/AGENTS.md +3 -0
- package/dist/templates/chat/DESIGN.md +28 -0
- package/dist/templates/chat/agent-native.json +12 -0
- package/dist/templates/default/.agents/skills/agent-native-docs/SKILL.md +23 -3
- package/dist/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
- package/dist/templates/default/.agents/skills/frontend-design/SKILL.md +23 -2
- package/dist/templates/default/.agents/skills/frontend-design/references/visual-direction.md +99 -0
- package/dist/templates/default/AGENTS.md +4 -0
- package/dist/templates/default/DESIGN.md +30 -0
- package/dist/templates/default/agent-native.json +9 -0
- package/dist/templates/default/app/i18n/ar-SA.ts +2 -2
- package/dist/templates/default/app/i18n/de-DE.ts +2 -2
- package/dist/templates/default/app/i18n/en-US.ts +2 -2
- package/dist/templates/default/app/i18n/es-ES.ts +2 -2
- package/dist/templates/default/app/i18n/fr-FR.ts +2 -2
- package/dist/templates/default/app/i18n/hi-IN.ts +2 -2
- package/dist/templates/default/app/i18n/ja-JP.ts +2 -2
- package/dist/templates/default/app/i18n/ko-KR.ts +2 -2
- package/dist/templates/default/app/i18n/pt-BR.ts +2 -2
- package/dist/templates/default/app/i18n/zh-CN.ts +2 -2
- package/dist/templates/default/app/i18n/zh-TW.ts +1 -1
- package/dist/templates/default/package.json +1 -0
- package/dist/templates/headless/.agents/skills/agent-native-docs/SKILL.md +23 -3
- package/dist/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
- package/dist/templates/headless/agent-native.json +9 -0
- package/dist/templates/headless/package.json +2 -0
- package/dist/templates/workspace-core/.agents/skills/agent-native-docs/SKILL.md +23 -3
- package/dist/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
- package/dist/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +23 -2
- package/dist/templates/workspace-core/.agents/skills/frontend-design/references/visual-direction.md +99 -0
- package/dist/templates/workspace-core/AGENTS.md +3 -0
- package/dist/templates/workspace-core/DESIGN.md +35 -0
- package/dist/templates/workspace-root/AGENTS.md +3 -0
- package/dist/templates/workspace-root/DESIGN.md +35 -0
- package/dist/templates/workspace-root/agent-native.json +9 -0
- package/dist/templates/workspace-root/package.json +3 -0
- package/dist/transcription/builder-transcription.js +1 -1
- package/dist/user-profile/actions/change-password.d.ts +8 -0
- package/dist/user-profile/actions/change-password.js +24 -0
- package/dist/user-profile/actions/get-auth-methods.d.ts +6 -0
- package/dist/user-profile/actions/get-auth-methods.js +23 -0
- package/dist/user-profile/actions/set-password.d.ts +7 -0
- package/dist/user-profile/actions/set-password.js +23 -0
- package/dist/vite/client.d.ts +8 -1
- package/dist/vite/client.js +63 -12
- package/dist/vite/index.d.ts +1 -0
- package/dist/vite/index.js +1 -0
- package/docs/AGENTS.md +7 -2
- package/docs/SKILL.md +7 -5
- package/docs/content/agent-native-config.mdx +165 -0
- package/docs/content/agent-native-toolkit.mdx +1 -1
- package/docs/content/deployment.mdx +7 -2
- package/docs/content/doctor.mdx +21 -13
- package/docs/content/environment-variables.mdx +158 -0
- package/docs/content/file-uploads.mdx +1 -1
- package/docs/content/getting-started.mdx +1 -1
- package/docs/content/key-concepts.mdx +1 -1
- package/docs/content/multi-app-workspace.mdx +1 -1
- package/docs/content/template-clips-ai-and-editing.mdx +6 -6
- package/docs/content/template-clips-developers.mdx +3 -3
- package/docs/content/toolkit-settings.mdx +1 -1
- package/docs/content/voice-input.mdx +4 -4
- package/package.json +7 -2
- package/src/eject/provider-api-definitions.ts +1 -0
- package/src/eject/remote-mcp-presets.ts +1 -0
- package/src/templates/chat/.agents/skills/agent-native-docs/SKILL.md +23 -3
- package/src/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
- package/src/templates/chat/.agents/skills/frontend-design/SKILL.md +23 -2
- package/src/templates/chat/.agents/skills/frontend-design/references/visual-direction.md +99 -0
- package/src/templates/chat/AGENTS.md +3 -0
- package/src/templates/chat/DESIGN.md +28 -0
- package/src/templates/chat/agent-native.json +12 -0
- package/src/templates/default/.agents/skills/agent-native-docs/SKILL.md +23 -3
- package/src/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
- package/src/templates/default/.agents/skills/frontend-design/SKILL.md +23 -2
- package/src/templates/default/.agents/skills/frontend-design/references/visual-direction.md +99 -0
- package/src/templates/default/AGENTS.md +4 -0
- package/src/templates/default/DESIGN.md +30 -0
- package/src/templates/default/agent-native.json +9 -0
- package/src/templates/default/app/i18n/ar-SA.ts +2 -2
- package/src/templates/default/app/i18n/de-DE.ts +2 -2
- package/src/templates/default/app/i18n/en-US.ts +2 -2
- package/src/templates/default/app/i18n/es-ES.ts +2 -2
- package/src/templates/default/app/i18n/fr-FR.ts +2 -2
- package/src/templates/default/app/i18n/hi-IN.ts +2 -2
- package/src/templates/default/app/i18n/ja-JP.ts +2 -2
- package/src/templates/default/app/i18n/ko-KR.ts +2 -2
- package/src/templates/default/app/i18n/pt-BR.ts +2 -2
- package/src/templates/default/app/i18n/zh-CN.ts +2 -2
- package/src/templates/default/app/i18n/zh-TW.ts +1 -1
- package/src/templates/default/package.json +1 -0
- package/src/templates/headless/.agents/skills/agent-native-docs/SKILL.md +23 -3
- package/src/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
- package/src/templates/headless/agent-native.json +9 -0
- package/src/templates/headless/package.json +2 -0
- package/src/templates/workspace-core/.agents/skills/agent-native-docs/SKILL.md +23 -3
- package/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
- package/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +23 -2
- package/src/templates/workspace-core/.agents/skills/frontend-design/references/visual-direction.md +99 -0
- package/src/templates/workspace-core/AGENTS.md +3 -0
- package/src/templates/workspace-core/DESIGN.md +35 -0
- package/src/templates/workspace-root/AGENTS.md +3 -0
- package/src/templates/workspace-root/DESIGN.md +35 -0
- package/src/templates/workspace-root/agent-native.json +9 -0
- package/src/templates/workspace-root/package.json +3 -0
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Core script: source-search
|
|
3
3
|
*
|
|
4
|
-
* Search and read
|
|
5
|
-
*
|
|
4
|
+
* Search and read version-matched framework source.
|
|
5
|
+
* First-party templates are generated into @agent-native/core/corpus during
|
|
6
|
+
* package build; Core and Toolkit source are read from their installed roots.
|
|
6
7
|
*
|
|
7
8
|
* Usage:
|
|
8
9
|
* pnpm action source-search --query "defineAction"
|
|
9
10
|
* pnpm action source-search --path templates/chat/actions/hello.ts
|
|
11
|
+
* pnpm action source-search --path core/src/action.ts
|
|
10
12
|
* pnpm action source-search --path templates/plan/AGENTS.md
|
|
11
13
|
* pnpm action source-search --list
|
|
12
14
|
*/
|
|
@@ -57,6 +59,40 @@ function getCorpusRoot() {
|
|
|
57
59
|
// dist/scripts/docs/source-search.js -> corpus/
|
|
58
60
|
return path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../../../corpus");
|
|
59
61
|
}
|
|
62
|
+
function getPackageRoot() {
|
|
63
|
+
return path.dirname(getCorpusRoot());
|
|
64
|
+
}
|
|
65
|
+
function getToolkitSourceRoot() {
|
|
66
|
+
const candidates = [
|
|
67
|
+
path.resolve(getPackageRoot(), "../toolkit/src"),
|
|
68
|
+
path.resolve(process.cwd(), "node_modules/@agent-native/toolkit/src"),
|
|
69
|
+
];
|
|
70
|
+
return candidates.find((candidate) => fs.existsSync(candidate)) ?? null;
|
|
71
|
+
}
|
|
72
|
+
function getSourceRoots() {
|
|
73
|
+
const corpusRoot = getCorpusRoot();
|
|
74
|
+
const roots = [
|
|
75
|
+
{
|
|
76
|
+
prefix: "templates",
|
|
77
|
+
directory: path.join(corpusRoot, "templates"),
|
|
78
|
+
visibilityRoot: corpusRoot,
|
|
79
|
+
},
|
|
80
|
+
];
|
|
81
|
+
// A monorepo checkout has the authored Core source. Published packages do
|
|
82
|
+
// not carry the whole source tree, so use their readable dist output.
|
|
83
|
+
const coreSourceRoot = path.join(getPackageRoot(), "src");
|
|
84
|
+
roots.push(fs.existsSync(path.join(coreSourceRoot, "server"))
|
|
85
|
+
? { prefix: "core/src", directory: coreSourceRoot }
|
|
86
|
+
: { prefix: "core/dist", directory: path.join(getPackageRoot(), "dist") });
|
|
87
|
+
const toolkitSourceRoot = getToolkitSourceRoot();
|
|
88
|
+
if (toolkitSourceRoot) {
|
|
89
|
+
roots.push({
|
|
90
|
+
prefix: "toolkit/src",
|
|
91
|
+
directory: toolkitSourceRoot,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
return roots;
|
|
95
|
+
}
|
|
60
96
|
/**
|
|
61
97
|
* The corpus is a sibling of the package root, so a bundled serverless deploy
|
|
62
98
|
* never carries it. Callers register this tool conditionally: advertising a
|
|
@@ -125,29 +161,52 @@ function isRuntimeVisibleCorpusPath(corpusRoot, absolutePath) {
|
|
|
125
161
|
return true;
|
|
126
162
|
}
|
|
127
163
|
}
|
|
128
|
-
function listFiles(dir, base = dir,
|
|
164
|
+
function listFiles(dir, base = dir, visibilityRoot) {
|
|
129
165
|
if (!fs.existsSync(dir))
|
|
130
166
|
return [];
|
|
131
167
|
const files = [];
|
|
132
|
-
|
|
168
|
+
let entries;
|
|
169
|
+
try {
|
|
170
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
171
|
+
}
|
|
172
|
+
catch {
|
|
173
|
+
return files;
|
|
174
|
+
}
|
|
175
|
+
for (const entry of entries) {
|
|
133
176
|
const abs = path.join(dir, entry.name);
|
|
134
|
-
if (!isRuntimeVisibleCorpusPath(
|
|
177
|
+
if (visibilityRoot && !isRuntimeVisibleCorpusPath(visibilityRoot, abs)) {
|
|
135
178
|
continue;
|
|
179
|
+
}
|
|
136
180
|
if (entry.isDirectory()) {
|
|
137
|
-
files.push(...listFiles(abs, base,
|
|
181
|
+
files.push(...listFiles(abs, base, visibilityRoot));
|
|
138
182
|
}
|
|
139
183
|
else if (entry.isFile() && isProbablyTextFile(abs)) {
|
|
140
|
-
|
|
184
|
+
let stat;
|
|
185
|
+
try {
|
|
186
|
+
stat = fs.statSync(abs);
|
|
187
|
+
}
|
|
188
|
+
catch {
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
141
191
|
if (stat.size <= MAX_FILE_BYTES) {
|
|
142
192
|
files.push({
|
|
143
193
|
absolutePath: abs,
|
|
144
194
|
relativePath: path.relative(base, abs).split(path.sep).join("/"),
|
|
195
|
+
visibilityRoot,
|
|
145
196
|
});
|
|
146
197
|
}
|
|
147
198
|
}
|
|
148
199
|
}
|
|
149
200
|
return files.sort((a, b) => a.relativePath.localeCompare(b.relativePath));
|
|
150
201
|
}
|
|
202
|
+
export function listSourceFiles() {
|
|
203
|
+
return getSourceRoots()
|
|
204
|
+
.flatMap((root) => listFiles(root.directory, root.directory, root.visibilityRoot).map((file) => ({
|
|
205
|
+
...file,
|
|
206
|
+
relativePath: `${root.prefix}/${file.relativePath}`,
|
|
207
|
+
})))
|
|
208
|
+
.sort((a, b) => a.relativePath.localeCompare(b.relativePath));
|
|
209
|
+
}
|
|
151
210
|
function lineSnippet(line, terms) {
|
|
152
211
|
const trimmed = line.trim();
|
|
153
212
|
if (trimmed.length <= 220)
|
|
@@ -162,7 +221,6 @@ function lineSnippet(line, terms) {
|
|
|
162
221
|
return `${start > 0 ? "..." : ""}${trimmed.slice(start, end)}${end < trimmed.length ? "..." : ""}`;
|
|
163
222
|
}
|
|
164
223
|
function searchCorpus(query) {
|
|
165
|
-
const corpusRoot = getCorpusRoot();
|
|
166
224
|
const terms = query
|
|
167
225
|
.toLowerCase()
|
|
168
226
|
.split(/\s+/)
|
|
@@ -171,7 +229,9 @@ function searchCorpus(query) {
|
|
|
171
229
|
if (terms.length === 0)
|
|
172
230
|
return [];
|
|
173
231
|
const results = [];
|
|
174
|
-
for (const file of
|
|
232
|
+
for (const file of listSourceFiles()) {
|
|
233
|
+
if (/\.(?:spec|test)\.[cm]?[jt]sx?$/.test(file.relativePath))
|
|
234
|
+
continue;
|
|
175
235
|
let raw = "";
|
|
176
236
|
try {
|
|
177
237
|
raw = fs.readFileSync(file.absolutePath, "utf-8");
|
|
@@ -204,26 +264,37 @@ function searchCorpus(query) {
|
|
|
204
264
|
}
|
|
205
265
|
return results.sort((a, b) => b.score - a.score || a.file.localeCompare(b.file));
|
|
206
266
|
}
|
|
207
|
-
function
|
|
267
|
+
function readSourcePath(relative) {
|
|
208
268
|
if (!isValidPath(relative)) {
|
|
209
|
-
return `Invalid
|
|
269
|
+
return `Invalid source path: ${relative}`;
|
|
210
270
|
}
|
|
211
|
-
const
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
271
|
+
const sourceRoot = getSourceRoots().find((root) => relative === root.prefix || relative.startsWith(`${root.prefix}/`));
|
|
272
|
+
if (!sourceRoot)
|
|
273
|
+
return `Source path not found: ${relative}`;
|
|
274
|
+
const rootRelativePath = relative
|
|
275
|
+
.slice(sourceRoot.prefix.length)
|
|
276
|
+
.replace(/^\//, "");
|
|
277
|
+
const target = path.resolve(sourceRoot.directory, rootRelativePath);
|
|
278
|
+
if (!target.startsWith(sourceRoot.directory + path.sep) &&
|
|
279
|
+
target !== sourceRoot.directory) {
|
|
280
|
+
return `Invalid source path: ${relative}`;
|
|
215
281
|
}
|
|
216
282
|
if (!fs.existsSync(target)) {
|
|
217
|
-
return `
|
|
283
|
+
return `Source path not found: ${relative}`;
|
|
218
284
|
}
|
|
219
|
-
if (
|
|
220
|
-
|
|
285
|
+
if (sourceRoot.visibilityRoot &&
|
|
286
|
+
!isRuntimeVisibleCorpusPath(sourceRoot.visibilityRoot, target)) {
|
|
287
|
+
return `Source path is not available to runtime source-search: ${relative}`;
|
|
221
288
|
}
|
|
222
289
|
const stat = fs.statSync(target);
|
|
223
290
|
if (stat.isDirectory()) {
|
|
224
291
|
const entries = fs
|
|
225
292
|
.readdirSync(target, { withFileTypes: true })
|
|
226
|
-
.filter((entry) =>
|
|
293
|
+
.filter((entry) => {
|
|
294
|
+
if (!sourceRoot.visibilityRoot)
|
|
295
|
+
return true;
|
|
296
|
+
return isRuntimeVisibleCorpusPath(sourceRoot.visibilityRoot, path.join(target, entry.name));
|
|
297
|
+
})
|
|
227
298
|
.map((entry) => `${entry.isDirectory() ? "dir " : "file"} ${entry.name}`)
|
|
228
299
|
.sort();
|
|
229
300
|
const shown = entries.slice(0, 200);
|
|
@@ -239,33 +310,30 @@ function readCorpusPath(relative) {
|
|
|
239
310
|
.join("\n");
|
|
240
311
|
}
|
|
241
312
|
if (!stat.isFile())
|
|
242
|
-
return `Unsupported
|
|
313
|
+
return `Unsupported source path: ${relative}`;
|
|
243
314
|
if (!isProbablyTextFile(target))
|
|
244
|
-
return `Not a text
|
|
315
|
+
return `Not a text source file: ${relative}`;
|
|
245
316
|
if (stat.size > MAX_FILE_BYTES) {
|
|
246
|
-
return `
|
|
317
|
+
return `Source file is too large to read through source-search: ${relative}`;
|
|
247
318
|
}
|
|
248
319
|
const raw = fs.readFileSync(target, "utf-8");
|
|
249
320
|
if (raw.length <= MAX_READ_CHARS)
|
|
250
321
|
return raw;
|
|
251
322
|
return `${raw.slice(0, MAX_READ_CHARS)}\n\n... truncated at ${MAX_READ_CHARS} characters. Use a narrower path or direct rg for more context.`;
|
|
252
323
|
}
|
|
253
|
-
function
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
const sectionRoot = path.join(corpusRoot, section);
|
|
258
|
-
const files = listFiles(sectionRoot);
|
|
259
|
-
const children = fs.existsSync(sectionRoot)
|
|
324
|
+
function listSourceRoots() {
|
|
325
|
+
return getSourceRoots().map((root) => {
|
|
326
|
+
const files = listFiles(root.directory, root.directory, root.visibilityRoot);
|
|
327
|
+
const children = fs.existsSync(root.directory)
|
|
260
328
|
? fs
|
|
261
|
-
.readdirSync(
|
|
329
|
+
.readdirSync(root.directory, { withFileTypes: true })
|
|
262
330
|
.filter((entry) => entry.isDirectory())
|
|
263
331
|
.map((entry) => entry.name)
|
|
264
332
|
.sort()
|
|
265
333
|
: [];
|
|
266
334
|
return {
|
|
267
|
-
section,
|
|
268
|
-
path:
|
|
335
|
+
section: root.prefix,
|
|
336
|
+
path: root.prefix,
|
|
269
337
|
files: files.length,
|
|
270
338
|
directories: children,
|
|
271
339
|
};
|
|
@@ -273,27 +341,26 @@ function listCorpus() {
|
|
|
273
341
|
}
|
|
274
342
|
export default async function sourceSearchScript(args) {
|
|
275
343
|
const parsed = parseArgs(args);
|
|
276
|
-
const corpusRoot = getCorpusRoot();
|
|
277
344
|
if (parsed.help === "true") {
|
|
278
345
|
console.log(`Usage: pnpm action source-search [options]
|
|
279
346
|
|
|
280
347
|
Options:
|
|
281
|
-
--query <text> Search source
|
|
282
|
-
--path <path> Read a
|
|
283
|
-
--list List
|
|
348
|
+
--query <text> Search readable framework source by keyword
|
|
349
|
+
--path <path> Read a source file or list a source directory
|
|
350
|
+
--list List source roots
|
|
284
351
|
--help Show this help message`);
|
|
285
352
|
return;
|
|
286
353
|
}
|
|
287
|
-
if (!
|
|
288
|
-
console.log(
|
|
354
|
+
if (!hasSourceCorpus()) {
|
|
355
|
+
console.log("Version-matched source is not available. Build or reinstall @agent-native/core so its source corpus and readable package sources are present.");
|
|
289
356
|
return;
|
|
290
357
|
}
|
|
291
358
|
if (parsed.list === "true") {
|
|
292
|
-
console.log(JSON.stringify(
|
|
359
|
+
console.log(JSON.stringify(listSourceRoots(), null, 2));
|
|
293
360
|
return;
|
|
294
361
|
}
|
|
295
362
|
if (parsed.path) {
|
|
296
|
-
console.log(
|
|
363
|
+
console.log(readSourcePath(parsed.path));
|
|
297
364
|
return;
|
|
298
365
|
}
|
|
299
366
|
if (parsed.query) {
|
|
@@ -310,7 +377,7 @@ Options:
|
|
|
310
377
|
}
|
|
311
378
|
console.log("");
|
|
312
379
|
}
|
|
313
|
-
console.log("Use --path <file> to read a specific
|
|
380
|
+
console.log("Use --path <file> to read a specific source file.");
|
|
314
381
|
return;
|
|
315
382
|
}
|
|
316
383
|
console.log("Provide --query, --path, or --list. Use --help for details.");
|
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
export type SearchMatchMode = "allTerms" | "anyTerm" | "phrase" | "regex";
|
|
2
|
+
export type TextSearchMode = "substring" | "glob" | "sql-like" | "regex";
|
|
3
|
+
export interface TextMatcher {
|
|
4
|
+
matches(value: string): boolean;
|
|
5
|
+
error?: string;
|
|
6
|
+
}
|
|
2
7
|
export declare function escapeLikeTerm(value: string): string;
|
|
3
8
|
export declare function normalizeSearchTerms(query: string): string[];
|
|
4
9
|
export declare function matchesSearchMode(value: string, query: string, mode: SearchMatchMode): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Build a bounded, case-insensitive matcher for agent-facing text search.
|
|
12
|
+
* Regexes are deliberately constrained because these matchers may scan a
|
|
13
|
+
* packaged source corpus during a single agent turn.
|
|
14
|
+
*/
|
|
15
|
+
export declare function createTextMatcher(pattern: string, mode?: TextSearchMode): TextMatcher;
|
|
5
16
|
export declare function buildSearchSnippet(value: string, terms: string[], maxLength?: number): string;
|
|
6
17
|
export declare function scoreSearchText(fields: {
|
|
7
18
|
title?: string | null;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import safeRegex from "safe-regex2";
|
|
2
|
+
const MAX_TEXT_SEARCH_PATTERN_LENGTH = 240;
|
|
2
3
|
const STOPWORDS = new Set([
|
|
3
4
|
"about",
|
|
4
5
|
"and",
|
|
@@ -57,6 +58,77 @@ export function matchesSearchMode(value, query, mode) {
|
|
|
57
58
|
? tokens.every((term) => normalizedValue.includes(term))
|
|
58
59
|
: tokens.some((term) => normalizedValue.includes(term));
|
|
59
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Build a bounded, case-insensitive matcher for agent-facing text search.
|
|
63
|
+
* Regexes are deliberately constrained because these matchers may scan a
|
|
64
|
+
* packaged source corpus during a single agent turn.
|
|
65
|
+
*/
|
|
66
|
+
export function createTextMatcher(pattern, mode = "substring") {
|
|
67
|
+
if (!pattern) {
|
|
68
|
+
return { matches: () => false, error: "Search pattern cannot be empty." };
|
|
69
|
+
}
|
|
70
|
+
if (pattern.length > MAX_TEXT_SEARCH_PATTERN_LENGTH) {
|
|
71
|
+
return {
|
|
72
|
+
matches: () => false,
|
|
73
|
+
error: `Search pattern is limited to ${MAX_TEXT_SEARCH_PATTERN_LENGTH} characters.`,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
if (mode === "substring") {
|
|
77
|
+
const normalized = pattern.toLowerCase();
|
|
78
|
+
return {
|
|
79
|
+
matches: (value) => value.toLowerCase().includes(normalized),
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
const regexSource = mode === "regex" ? pattern : wildcardPatternToRegex(pattern, mode);
|
|
83
|
+
try {
|
|
84
|
+
const matcher = new RegExp(regexSource, "isu");
|
|
85
|
+
if (mode === "regex" && !safeRegex(pattern)) {
|
|
86
|
+
return {
|
|
87
|
+
matches: () => false,
|
|
88
|
+
error: "Regex pattern is too complex for a bounded source search.",
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
return { matches: (value) => matcher.test(value) };
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
return {
|
|
95
|
+
matches: () => false,
|
|
96
|
+
error: `Invalid ${mode} search pattern.`,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
function wildcardPatternToRegex(pattern, mode) {
|
|
101
|
+
let source = "";
|
|
102
|
+
let escaped = false;
|
|
103
|
+
for (const character of pattern) {
|
|
104
|
+
if (escaped) {
|
|
105
|
+
source += escapeRegexCharacter(character);
|
|
106
|
+
escaped = false;
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
if (character === "\\") {
|
|
110
|
+
escaped = true;
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
const isMany = mode === "glob" ? character === "*" : character === "%";
|
|
114
|
+
const isOne = mode === "glob" ? character === "?" : character === "_";
|
|
115
|
+
if (isMany) {
|
|
116
|
+
source += "[\\s\\S]*";
|
|
117
|
+
}
|
|
118
|
+
else if (isOne) {
|
|
119
|
+
source += "[\\s\\S]";
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
source += escapeRegexCharacter(character);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
if (escaped)
|
|
126
|
+
source += "\\\\";
|
|
127
|
+
return source;
|
|
128
|
+
}
|
|
129
|
+
function escapeRegexCharacter(value) {
|
|
130
|
+
return value.replace(/[\\^$.*+?()[\]{}|]/g, "\\$&");
|
|
131
|
+
}
|
|
60
132
|
export function buildSearchSnippet(value, terms, maxLength = 260) {
|
|
61
133
|
const text = normalizeText(value);
|
|
62
134
|
if (text.length <= maxLength)
|
|
@@ -26,4 +26,10 @@ export interface NotifyActionChangeOptions {
|
|
|
26
26
|
}
|
|
27
27
|
export declare function writeActionChangeMarker(options: NotifyActionChangeOptions): Promise<void>;
|
|
28
28
|
export declare function notifyActionChange(options: NotifyActionChangeOptions): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Publish the fast in-memory invalidation without holding a user-visible run
|
|
31
|
+
* on the durable marker write. The marker remains scheduled for other
|
|
32
|
+
* processes and its failure is logged instead of becoming an invisible gap.
|
|
33
|
+
*/
|
|
34
|
+
export declare function notifyActionChangeInBackground(options: NotifyActionChangeOptions): void;
|
|
29
35
|
//# sourceMappingURL=action-change.d.ts.map
|
|
@@ -40,6 +40,23 @@ function actionChangeTarget(options) {
|
|
|
40
40
|
requestSource: options.requestSource,
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
+
function recordActionChange(options) {
|
|
44
|
+
const target = actionChangeTarget(options);
|
|
45
|
+
recordChange({
|
|
46
|
+
source: "action",
|
|
47
|
+
type: "change",
|
|
48
|
+
key: target.actionName,
|
|
49
|
+
...(target.owner ? { owner: target.owner } : {}),
|
|
50
|
+
...(target.orgId ? { orgId: target.orgId } : {}),
|
|
51
|
+
...(target.requestSource ? { requestSource: target.requestSource } : {}),
|
|
52
|
+
});
|
|
53
|
+
return {
|
|
54
|
+
actionName: options.actionName,
|
|
55
|
+
...(target.owner ? { owner: target.owner } : {}),
|
|
56
|
+
...(target.orgId ? { orgId: target.orgId } : {}),
|
|
57
|
+
...(target.requestSource ? { requestSource: target.requestSource } : {}),
|
|
58
|
+
};
|
|
59
|
+
}
|
|
43
60
|
export async function writeActionChangeMarker(options) {
|
|
44
61
|
const target = actionChangeTarget(options);
|
|
45
62
|
const sessionId = actionChangeMarkerSession(target);
|
|
@@ -51,20 +68,17 @@ export async function writeActionChangeMarker(options) {
|
|
|
51
68
|
}, { requestSource: options.requestSource ?? "agent" });
|
|
52
69
|
}
|
|
53
70
|
export async function notifyActionChange(options) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
...(target.owner ? { owner: target.owner } : {}),
|
|
66
|
-
...(target.orgId ? { orgId: target.orgId } : {}),
|
|
67
|
-
...(options.requestSource ? { requestSource: options.requestSource } : {}),
|
|
71
|
+
await writeActionChangeMarker(recordActionChange(options));
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Publish the fast in-memory invalidation without holding a user-visible run
|
|
75
|
+
* on the durable marker write. The marker remains scheduled for other
|
|
76
|
+
* processes and its failure is logged instead of becoming an invisible gap.
|
|
77
|
+
*/
|
|
78
|
+
export function notifyActionChangeInBackground(options) {
|
|
79
|
+
const normalizedOptions = recordActionChange(options);
|
|
80
|
+
void writeActionChangeMarker(normalizedOptions).catch((error) => {
|
|
81
|
+
console.warn("[action-change] durable marker write failed:", error instanceof Error ? error.message : String(error));
|
|
68
82
|
});
|
|
69
83
|
}
|
|
70
84
|
//# sourceMappingURL=action-change.js.map
|
|
@@ -517,6 +517,28 @@ export async function mergeCoreSharingActions(registry) {
|
|
|
517
517
|
() => import("../sharing/actions/create-agent-resource-link.js"),
|
|
518
518
|
],
|
|
519
519
|
["upload-image", () => import("../file-upload/actions/upload-image.js")],
|
|
520
|
+
// Transactional email catalog — mounted everywhere so Dispatch can ask any
|
|
521
|
+
// app what it sends without that app opting in.
|
|
522
|
+
[
|
|
523
|
+
"list-transactional-emails",
|
|
524
|
+
() => import("../email-catalog/actions/list-transactional-emails.js"),
|
|
525
|
+
],
|
|
526
|
+
[
|
|
527
|
+
"render-transactional-email-preview",
|
|
528
|
+
() => import("../email-catalog/actions/render-transactional-email-preview.js"),
|
|
529
|
+
],
|
|
530
|
+
[
|
|
531
|
+
"list-email-log",
|
|
532
|
+
() => import("../email-catalog/actions/list-email-log.js"),
|
|
533
|
+
],
|
|
534
|
+
[
|
|
535
|
+
"list-email-activity",
|
|
536
|
+
() => import("../email-catalog/actions/list-email-activity.js"),
|
|
537
|
+
],
|
|
538
|
+
[
|
|
539
|
+
"list-email-engagement",
|
|
540
|
+
() => import("../email-catalog/actions/list-email-engagement.js"),
|
|
541
|
+
],
|
|
520
542
|
[
|
|
521
543
|
"get-feature-flags",
|
|
522
544
|
() => import("../feature-flags/actions/get-feature-flags.js"),
|
|
@@ -596,6 +618,15 @@ export async function mergeCoreSharingActions(registry) {
|
|
|
596
618
|
"update-user-profile",
|
|
597
619
|
() => import("../user-profile/actions/update-user-profile.js"),
|
|
598
620
|
],
|
|
621
|
+
[
|
|
622
|
+
"get-auth-methods",
|
|
623
|
+
() => import("../user-profile/actions/get-auth-methods.js"),
|
|
624
|
+
],
|
|
625
|
+
["set-password", () => import("../user-profile/actions/set-password.js")],
|
|
626
|
+
[
|
|
627
|
+
"change-password",
|
|
628
|
+
() => import("../user-profile/actions/change-password.js"),
|
|
629
|
+
],
|
|
599
630
|
[
|
|
600
631
|
"change-appearance",
|
|
601
632
|
() => import("../appearance/actions/change-appearance.js"),
|
|
@@ -228,7 +228,7 @@ export function createBuilderBrowserTool(deps) {
|
|
|
228
228
|
},
|
|
229
229
|
"activate-browser": {
|
|
230
230
|
tool: {
|
|
231
|
-
description: "Activate browser automation tools. Call this when you need to interact with a real browser — e.g. to extract design tokens from a rendered page, take screenshots, read computed styles from JS-heavy sites, or test a live URL. After activation, chrome-devtools MCP tools (navigate, click, evaluate_script, take_screenshot, etc.) become available on your next action. Requires Builder.io connection.",
|
|
231
|
+
description: "Activate browser automation tools. Call this when you need to interact with a real browser — e.g. to extract design tokens from a rendered page, take screenshots, read computed styles from JS-heavy sites, or test a live URL. After activation, chrome-devtools MCP tools (navigate, click, evaluate_script, take_screenshot, etc.) become available on your next action. Requires a Builder.io connection (free tier available).",
|
|
232
232
|
parameters: {
|
|
233
233
|
type: "object",
|
|
234
234
|
properties: {
|
|
@@ -3,7 +3,7 @@ import { dbExecToolParameters } from "../../scripts/db/tool-schemas.js";
|
|
|
3
3
|
import { captureCliOutput } from "../cli-capture.js";
|
|
4
4
|
import { getAmbientUserEmail, getRequestOrgId, getRequestRunContext, getRequestUserEmail, } from "../request-context.js";
|
|
5
5
|
// ---------------------------------------------------------------------------
|
|
6
|
-
// CLI-script-backed action entries: db-*, docs-search/source-search,
|
|
6
|
+
// CLI-script-backed action entries: db-*, framework-search/docs-search/source-search,
|
|
7
7
|
// resources/save-memory/delete-memory, chat-history, manage-agent-engine,
|
|
8
8
|
// manage-agent-loop-settings, and call-agent. Each wraps a core CLI script
|
|
9
9
|
// (that writes to console.log) as an ActionEntry via `wrapCliScript`.
|
|
@@ -174,6 +174,47 @@ export async function createDbScriptEntries(mode = "read", options = {}) {
|
|
|
174
174
|
*/
|
|
175
175
|
export async function createDocsScriptEntries() {
|
|
176
176
|
const entries = {};
|
|
177
|
+
try {
|
|
178
|
+
const mod = await import("../../scripts/docs/framework-search.js");
|
|
179
|
+
entries["framework-search"] = wrapCliScript({
|
|
180
|
+
description: "Search the version-matched Agent Native docs and readable Core, Toolkit, and first-party template source in one bounded read-only call. Use this first when a docs answer may require implementation evidence.",
|
|
181
|
+
parameters: {
|
|
182
|
+
type: "object",
|
|
183
|
+
properties: {
|
|
184
|
+
pattern: {
|
|
185
|
+
type: "string",
|
|
186
|
+
description: "Text pattern to search across docs and source. Use normal text by default, or use glob (* and ?) / SQL-like (% and _) / regex mode for broader or more precise matching.",
|
|
187
|
+
},
|
|
188
|
+
scope: {
|
|
189
|
+
type: "string",
|
|
190
|
+
description: "Search corpus: all, docs, or source (default: all).",
|
|
191
|
+
enum: ["all", "docs", "source"],
|
|
192
|
+
},
|
|
193
|
+
mode: {
|
|
194
|
+
type: "string",
|
|
195
|
+
description: "Match mode: substring, glob, sql-like, or safe regex (default: substring).",
|
|
196
|
+
enum: ["substring", "glob", "sql-like", "regex"],
|
|
197
|
+
},
|
|
198
|
+
path: {
|
|
199
|
+
type: "string",
|
|
200
|
+
description: "Optional glob path filter such as templates/*/actions/*.ts or core/src/server/*.",
|
|
201
|
+
},
|
|
202
|
+
limit: {
|
|
203
|
+
type: "string",
|
|
204
|
+
description: "Maximum matching files to return, from 1 to 50.",
|
|
205
|
+
},
|
|
206
|
+
list: {
|
|
207
|
+
type: "string",
|
|
208
|
+
description: 'Set to "true" to list searchable docs and source roots.',
|
|
209
|
+
enum: ["true"],
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
}, mod.default, { readOnly: true });
|
|
214
|
+
}
|
|
215
|
+
catch (error) {
|
|
216
|
+
console.warn("[agent-chat] framework-search unavailable; keeping the older lookup tools:", error instanceof Error ? error.message : String(error));
|
|
217
|
+
}
|
|
177
218
|
try {
|
|
178
219
|
const mod = await import("../../scripts/docs/search.js");
|
|
179
220
|
entries["docs-search"] = wrapCliScript({
|
|
@@ -207,7 +248,7 @@ export async function createDocsScriptEntries() {
|
|
|
207
248
|
return entries;
|
|
208
249
|
}
|
|
209
250
|
entries["source-search"] = wrapCliScript({
|
|
210
|
-
description: "Search and read
|
|
251
|
+
description: "Search and read readable version-matched Core, Toolkit, and first-party template source. Use framework-search for one combined docs/source search with glob, SQL-like, or regex matching; use --list, --query, or --path for focused source lookup.",
|
|
211
252
|
parameters: {
|
|
212
253
|
type: "object",
|
|
213
254
|
properties: {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type EmailReadiness } from "./email.js";
|
|
2
|
+
export type AuthLoginMode = "magic-link" | "password";
|
|
3
|
+
/** Magic link is the frictionless default only when outbound email is ready. */
|
|
4
|
+
export declare function resolveAuthLoginMode(emailReady: boolean): AuthLoginMode;
|
|
5
|
+
export declare function resolveAuthLoginModeFromReadiness(emailReadiness: EmailReadiness): AuthLoginMode;
|
|
6
|
+
/** Resolve the browser mode from the same scoped email transport used to send. */
|
|
7
|
+
export declare function getAuthLoginMode(): Promise<AuthLoginMode>;
|
|
8
|
+
//# sourceMappingURL=auth-login-mode.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { getEmailReadiness } from "./email.js";
|
|
2
|
+
/** Magic link is the frictionless default only when outbound email is ready. */
|
|
3
|
+
export function resolveAuthLoginMode(emailReady) {
|
|
4
|
+
const optOut = process.env.AUTH_MAGIC_LINK?.trim().toLowerCase();
|
|
5
|
+
if (optOut === "0" || optOut === "false" || optOut === "off") {
|
|
6
|
+
return "password";
|
|
7
|
+
}
|
|
8
|
+
return emailReady ? "magic-link" : "password";
|
|
9
|
+
}
|
|
10
|
+
export function resolveAuthLoginModeFromReadiness(emailReadiness) {
|
|
11
|
+
return resolveAuthLoginMode(emailReadiness.status === "ready");
|
|
12
|
+
}
|
|
13
|
+
/** Resolve the browser mode from the same scoped email transport used to send. */
|
|
14
|
+
export async function getAuthLoginMode() {
|
|
15
|
+
return resolveAuthLoginModeFromReadiness(await getEmailReadiness());
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=auth-login-mode.js.map
|