@agent-native/core 0.137.7 → 0.138.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/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/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/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/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/components/recorder/pre-record-panel.tsx +65 -18
- 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/i18n/en-US.ts +4 -0
- 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/desktop/package.json +1 -0
- package/corpus/templates/clips/desktop/src/app.tsx +70 -6
- package/corpus/templates/clips/desktop/src/components/AlertDialog.tsx +131 -0
- package/corpus/templates/clips/desktop/src/styles.css +129 -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/public-agent-context.ts +1 -1
- 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/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/plugins/db.ts +24 -0
- package/corpus/templates/content/server/plugins/onboarding.ts +2 -2
- 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/design-generation/SKILL.md +2 -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/generate-design.ts +3 -2
- 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 +96 -14
- package/corpus/templates/design/agent-native.json +12 -0
- package/corpus/templates/design/app/components/design/DesignImportPanel.tsx +7 -2
- package/corpus/templates/design/app/components/design/FigmaHydrationDialog.tsx +11 -2
- package/corpus/templates/design/app/components/design/edit-panel/component-section.tsx +1 -1
- package/corpus/templates/design/app/components/editor/PromptDialog.tsx +8 -1
- package/corpus/templates/design/app/i18n-data.ts +53 -22
- package/corpus/templates/design/app/lib/design-file-upload.ts +2 -3
- package/corpus/templates/design/app/lib/upload-limits.ts +4 -0
- package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +1 -1
- package/corpus/templates/design/changelog/2026-08-05-chat-attachments-now-warn-before-upload-when-they-exceed-the.md +6 -0
- package/corpus/templates/design/changelog/2026-08-05-figma-fig-uploads-now-show-a-clear-4-mb-limit-up-front-inste.md +6 -0
- package/corpus/templates/design/scripts/qa-figma-stress-import.ts +1 -1
- package/corpus/templates/design/server/handlers/import-design-file.ts +9 -5
- package/corpus/templates/design/server/handlers/uploads.ts +13 -9
- package/corpus/templates/design/server/lib/fig-file-limits.ts +2 -1
- package/corpus/templates/design/server/lib/figma-image-hydration.ts +1 -1
- package/corpus/templates/design/server/lib/figma-node-import.ts +1 -1
- package/corpus/templates/design/server/lib/request-body-limits.ts +11 -0
- package/corpus/templates/design/shared/canvas-frames.ts +81 -0
- 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/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/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/agent-native.json +12 -0
- package/corpus/templates/plan/server/lib/plan-assets.ts +1 -1
- 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/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/require-session.js +13 -4
- 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/client/use-session.d.ts +11 -0
- package/dist/client/use-session.js +34 -6
- package/dist/collab/routes.d.ts +2 -2
- 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/extensions/web-search-tool.js +2 -2
- 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 +24 -0
- package/dist/localization/default-messages.js +26 -2
- package/dist/notifications/routes.d.ts +6 -6
- 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/progress/routes.d.ts +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +16 -16
- 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 +9 -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 +25 -3
- 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 +17 -0
- package/dist/server/email.js +22 -1
- package/dist/server/framework-request-handler.js +6 -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 +6 -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
|
@@ -5,6 +5,10 @@ import { and, asc, eq, inArray, isNull, sql } from "drizzle-orm";
|
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
7
7
|
import { getDb, schema } from "../server/db/index.js";
|
|
8
|
+
import {
|
|
9
|
+
lockContentDatabaseMutation,
|
|
10
|
+
touchContentDatabase,
|
|
11
|
+
} from "./_content-database-mutation-lock.js";
|
|
8
12
|
import { getContentDatabaseResponse } from "./_database-utils.js";
|
|
9
13
|
import {
|
|
10
14
|
databaseItemsPositionScope,
|
|
@@ -69,6 +73,11 @@ export default defineAction({
|
|
|
69
73
|
databaseItemsPositionScope(row.item.databaseId),
|
|
70
74
|
() =>
|
|
71
75
|
db.transaction(async (tx) => {
|
|
76
|
+
await lockContentDatabaseMutation(
|
|
77
|
+
tx as unknown as ReturnType<typeof getDb>,
|
|
78
|
+
row.item.databaseId,
|
|
79
|
+
);
|
|
80
|
+
|
|
72
81
|
const items = await tx
|
|
73
82
|
.select()
|
|
74
83
|
.from(schema.contentDatabaseItems)
|
|
@@ -88,6 +97,11 @@ export default defineAction({
|
|
|
88
97
|
const [moved] = nextItems.splice(currentIndex, 1);
|
|
89
98
|
nextItems.splice(nextIndex, 0, moved);
|
|
90
99
|
const now = new Date().toISOString();
|
|
100
|
+
await touchContentDatabase(
|
|
101
|
+
tx as unknown as ReturnType<typeof getDb>,
|
|
102
|
+
row.item.databaseId,
|
|
103
|
+
now,
|
|
104
|
+
);
|
|
91
105
|
const itemIds = nextItems.map((item) => item.id);
|
|
92
106
|
const documentIds = nextItems.map((item) => item.documentId);
|
|
93
107
|
|
|
@@ -4,7 +4,12 @@ import { assertAccess } from "@agent-native/core/sharing";
|
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
6
6
|
import { getDb } from "../server/db/index.js";
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
deleteTrashedDocumentSubtree,
|
|
9
|
+
PermanentDeleteScopeChangedError,
|
|
10
|
+
} from "./delete-document.js";
|
|
11
|
+
|
|
12
|
+
const MAX_DELETE_SCOPE_ATTEMPTS = 3;
|
|
8
13
|
|
|
9
14
|
export default defineAction({
|
|
10
15
|
description:
|
|
@@ -15,11 +20,27 @@ export default defineAction({
|
|
|
15
20
|
run: async ({ id }) => {
|
|
16
21
|
const access = await assertAccess("document", id, "admin");
|
|
17
22
|
const db = getDb();
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
let deleted: string[] | undefined;
|
|
24
|
+
for (let attempt = 1; attempt <= MAX_DELETE_SCOPE_ATTEMPTS; attempt += 1) {
|
|
25
|
+
try {
|
|
26
|
+
deleted = await db.transaction((tx) =>
|
|
27
|
+
deleteTrashedDocumentSubtree(
|
|
28
|
+
tx as unknown as ReturnType<typeof getDb>,
|
|
29
|
+
id,
|
|
30
|
+
access.resource.ownerEmail as string,
|
|
31
|
+
),
|
|
32
|
+
);
|
|
33
|
+
break;
|
|
34
|
+
} catch (error) {
|
|
35
|
+
if (
|
|
36
|
+
!(error instanceof PermanentDeleteScopeChangedError) ||
|
|
37
|
+
attempt === MAX_DELETE_SCOPE_ATTEMPTS
|
|
38
|
+
) {
|
|
39
|
+
throw error;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (!deleted) throw new Error("Document deletion did not complete.");
|
|
23
44
|
await writeAppState("refresh-signal", { ts: Date.now() });
|
|
24
45
|
return { success: true, deleted: deleted.length };
|
|
25
46
|
},
|
|
@@ -4,6 +4,10 @@ import { assertAccess } from "@agent-native/core/sharing";
|
|
|
4
4
|
import { and, eq, inArray } from "drizzle-orm";
|
|
5
5
|
|
|
6
6
|
import { getDb, schema } from "../server/db/index.js";
|
|
7
|
+
import {
|
|
8
|
+
lockContentDatabaseMutation,
|
|
9
|
+
touchContentDatabase,
|
|
10
|
+
} from "./_content-database-mutation-lock.js";
|
|
7
11
|
import { assertNotWorkspaceCatalogDocuments } from "./_content-space-catalog-guards.js";
|
|
8
12
|
import { lockDatabaseMemberships } from "./_database-membership-lock.js";
|
|
9
13
|
import {
|
|
@@ -80,6 +84,15 @@ export default defineAction({
|
|
|
80
84
|
|
|
81
85
|
await withPositionLock(databaseItemsPositionScope(database.id), () =>
|
|
82
86
|
db.transaction(async (tx) => {
|
|
87
|
+
await lockContentDatabaseMutation(
|
|
88
|
+
tx as unknown as ReturnType<typeof getDb>,
|
|
89
|
+
database.id,
|
|
90
|
+
);
|
|
91
|
+
await touchContentDatabase(
|
|
92
|
+
tx as unknown as ReturnType<typeof getDb>,
|
|
93
|
+
database.id,
|
|
94
|
+
now,
|
|
95
|
+
);
|
|
83
96
|
if (removedItemIds.length > 0) {
|
|
84
97
|
await lockDatabaseMemberships(tx, removedItemIds);
|
|
85
98
|
const [sourceRow, hydrationRow] = await Promise.all([
|
|
@@ -5,6 +5,7 @@ import { and, asc, eq } from "drizzle-orm";
|
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
7
7
|
import { getDb, schema } from "../server/db/index.js";
|
|
8
|
+
import { lockContentDatabaseMutation } from "./_content-database-mutation-lock.js";
|
|
8
9
|
import {
|
|
9
10
|
listPropertiesForDocument,
|
|
10
11
|
resolvePropertyDatabaseForDocument,
|
|
@@ -45,54 +46,52 @@ export default defineAction({
|
|
|
45
46
|
);
|
|
46
47
|
if (!database) throw new Error("Document is not part of a database.");
|
|
47
48
|
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
definitionById
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
49
|
+
const now = new Date().toISOString();
|
|
50
|
+
await db.transaction(async (tx) => {
|
|
51
|
+
await lockContentDatabaseMutation(
|
|
52
|
+
tx as unknown as ReturnType<typeof getDb>,
|
|
53
|
+
database.id,
|
|
54
|
+
);
|
|
55
|
+
const definitions = await tx
|
|
56
|
+
.select()
|
|
57
|
+
.from(schema.documentPropertyDefinitions)
|
|
58
|
+
.where(eq(schema.documentPropertyDefinitions.databaseId, database.id))
|
|
59
|
+
.orderBy(asc(schema.documentPropertyDefinitions.position));
|
|
60
|
+
const ids = definitions.map((definition) => definition.id);
|
|
61
|
+
if (!ids.includes(propertyId)) {
|
|
62
|
+
throw new Error(`Property "${propertyId}" not found`);
|
|
63
|
+
}
|
|
64
|
+
if (!ids.includes(targetPropertyId)) {
|
|
65
|
+
throw new Error(`Property "${targetPropertyId}" not found`);
|
|
66
|
+
}
|
|
67
|
+
const definitionById = new Map(
|
|
68
|
+
definitions.map((definition) => [definition.id, definition]),
|
|
69
|
+
);
|
|
70
|
+
if (
|
|
71
|
+
definitionById.get(propertyId)?.systemRole ||
|
|
72
|
+
definitionById.get(targetPropertyId)?.systemRole
|
|
73
|
+
) {
|
|
74
|
+
throw new Error("System properties cannot be reordered.");
|
|
75
|
+
}
|
|
76
|
+
if (propertyId === targetPropertyId) return;
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
remaining.splice(insertAt, 0, propertyId);
|
|
78
|
+
const remaining = ids.filter((id) => id !== propertyId);
|
|
79
|
+
const targetIndex = remaining.indexOf(targetPropertyId);
|
|
80
|
+
const insertAt = position === "after" ? targetIndex + 1 : targetIndex;
|
|
81
|
+
remaining.splice(insertAt, 0, propertyId);
|
|
83
82
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
)
|
|
94
|
-
|
|
95
|
-
}
|
|
83
|
+
for (let index = 0; index < remaining.length; index += 1) {
|
|
84
|
+
await tx
|
|
85
|
+
.update(schema.documentPropertyDefinitions)
|
|
86
|
+
.set({ position: index, updatedAt: now })
|
|
87
|
+
.where(
|
|
88
|
+
and(
|
|
89
|
+
eq(schema.documentPropertyDefinitions.id, remaining[index]),
|
|
90
|
+
eq(schema.documentPropertyDefinitions.databaseId, database.id),
|
|
91
|
+
),
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
96
95
|
|
|
97
96
|
await writeAppState("refresh-signal", { ts: Date.now() });
|
|
98
97
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineAction } from "@agent-native/core";
|
|
2
2
|
import { assertAccess } from "@agent-native/core/sharing";
|
|
3
|
-
import { and, eq, isNull, ne
|
|
3
|
+
import { and, eq, isNull, ne } from "drizzle-orm";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
6
6
|
import { getDb, schema } from "../server/db/index.js";
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
parsePropertyOptions,
|
|
13
13
|
type DocumentPropertyType,
|
|
14
14
|
} from "../shared/properties.js";
|
|
15
|
+
import { lockContentDatabaseMutation } from "./_content-database-mutation-lock.js";
|
|
15
16
|
import { resolveContentDocumentAccess } from "./_content-document-access.js";
|
|
16
17
|
import { lockDatabaseMemberships } from "./_database-membership-lock.js";
|
|
17
18
|
import {
|
|
@@ -80,11 +81,41 @@ export default defineAction({
|
|
|
80
81
|
await assertAccess("document", documentId, "editor");
|
|
81
82
|
const normalized = normalizePropertyValue(type, value);
|
|
82
83
|
const content = typeof normalized === "string" ? normalized : "";
|
|
83
|
-
|
|
84
|
+
let target = blocksStorageTarget(
|
|
84
85
|
parsePropertyOptions(definition.optionsJson),
|
|
85
86
|
);
|
|
86
87
|
await db.transaction(async (tx) => {
|
|
87
88
|
await lockDatabaseMemberships(tx, [membership.id]);
|
|
89
|
+
const [lockedDefinition] = await tx
|
|
90
|
+
.select()
|
|
91
|
+
.from(schema.documentPropertyDefinitions)
|
|
92
|
+
.where(eq(schema.documentPropertyDefinitions.id, propertyId));
|
|
93
|
+
const [lockedMembership] = await tx
|
|
94
|
+
.select({ id: schema.contentDatabaseItems.id })
|
|
95
|
+
.from(schema.contentDatabaseItems)
|
|
96
|
+
.where(
|
|
97
|
+
and(
|
|
98
|
+
eq(schema.contentDatabaseItems.id, membership.id),
|
|
99
|
+
eq(schema.contentDatabaseItems.databaseId, database.id),
|
|
100
|
+
eq(schema.contentDatabaseItems.documentId, documentId),
|
|
101
|
+
),
|
|
102
|
+
);
|
|
103
|
+
if (!lockedDefinition || lockedDefinition.databaseId !== database.id) {
|
|
104
|
+
throw new Error(`Property "${propertyId}" not found`);
|
|
105
|
+
}
|
|
106
|
+
if (!lockedMembership) {
|
|
107
|
+
throw new Error("Document is not part of this database.");
|
|
108
|
+
}
|
|
109
|
+
if (
|
|
110
|
+
!isBlocksPropertyType(lockedDefinition.type as DocumentPropertyType)
|
|
111
|
+
) {
|
|
112
|
+
throw new Error(
|
|
113
|
+
"Property type changed before the operation completed.",
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
target = blocksStorageTarget(
|
|
117
|
+
parsePropertyOptions(lockedDefinition.optionsJson),
|
|
118
|
+
);
|
|
88
119
|
if (target === "document_body") {
|
|
89
120
|
await tx
|
|
90
121
|
.update(schema.documents)
|
|
@@ -130,9 +161,13 @@ export default defineAction({
|
|
|
130
161
|
|
|
131
162
|
const valueJson = normalizedValueJson(type, value);
|
|
132
163
|
await db.transaction(async (tx) => {
|
|
164
|
+
await lockContentDatabaseMutation(
|
|
165
|
+
tx as unknown as ReturnType<typeof getDb>,
|
|
166
|
+
database.id,
|
|
167
|
+
);
|
|
133
168
|
const [lockedDatabase] = await tx
|
|
134
|
-
.
|
|
135
|
-
.
|
|
169
|
+
.select({ id: schema.contentDatabases.id })
|
|
170
|
+
.from(schema.contentDatabases)
|
|
136
171
|
.where(
|
|
137
172
|
and(
|
|
138
173
|
eq(schema.contentDatabases.id, database.id),
|
|
@@ -140,38 +175,43 @@ export default defineAction({
|
|
|
140
175
|
eq(schema.contentDatabases.ownerEmail, database.ownerEmail),
|
|
141
176
|
isNull(schema.contentDatabases.deletedAt),
|
|
142
177
|
),
|
|
143
|
-
)
|
|
144
|
-
.returning({ id: schema.contentDatabases.id });
|
|
178
|
+
);
|
|
145
179
|
if (!lockedDatabase) throw new Error("Database is no longer active.");
|
|
180
|
+
await lockDatabaseMemberships(tx, [membership.id]);
|
|
146
181
|
const [lockedDefinition] = await tx
|
|
147
|
-
.
|
|
148
|
-
.
|
|
149
|
-
|
|
150
|
-
|
|
182
|
+
.select()
|
|
183
|
+
.from(schema.documentPropertyDefinitions)
|
|
184
|
+
.where(eq(schema.documentPropertyDefinitions.id, propertyId));
|
|
185
|
+
const [lockedMembership] = await tx
|
|
186
|
+
.select({ id: schema.contentDatabaseItems.id })
|
|
187
|
+
.from(schema.contentDatabaseItems)
|
|
151
188
|
.where(
|
|
152
189
|
and(
|
|
153
|
-
eq(schema.
|
|
154
|
-
eq(schema.
|
|
155
|
-
eq(
|
|
156
|
-
schema.documentPropertyDefinitions.ownerEmail,
|
|
157
|
-
database.ownerEmail,
|
|
158
|
-
),
|
|
190
|
+
eq(schema.contentDatabaseItems.id, membership.id),
|
|
191
|
+
eq(schema.contentDatabaseItems.databaseId, database.id),
|
|
192
|
+
eq(schema.contentDatabaseItems.documentId, documentId),
|
|
159
193
|
),
|
|
160
|
-
)
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
) {
|
|
194
|
+
);
|
|
195
|
+
if (!lockedDefinition || lockedDefinition.databaseId !== database.id) {
|
|
196
|
+
throw new Error(`Property "${propertyId}" not found`);
|
|
197
|
+
}
|
|
198
|
+
if (!lockedMembership) {
|
|
199
|
+
throw new Error("Document is not part of this database.");
|
|
200
|
+
}
|
|
201
|
+
const lockedType = lockedDefinition.type as DocumentPropertyType;
|
|
202
|
+
if (lockedType !== type) {
|
|
170
203
|
throw new Error(
|
|
171
|
-
|
|
204
|
+
"Property type changed before the operation completed.",
|
|
172
205
|
);
|
|
173
206
|
}
|
|
174
|
-
|
|
207
|
+
if (isBlocksPropertyType(lockedType)) {
|
|
208
|
+
throw new Error(
|
|
209
|
+
"Property type changed before the operation completed.",
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
if (isComputedPropertyType(lockedType)) {
|
|
213
|
+
throw new Error("Computed properties cannot be edited.");
|
|
214
|
+
}
|
|
175
215
|
const [conflictingClaim] = await tx
|
|
176
216
|
.select({ id: schema.contentDatabaseItemKeyClaims.id })
|
|
177
217
|
.from(schema.contentDatabaseItemKeyClaims)
|
|
@@ -25,6 +25,10 @@ import {
|
|
|
25
25
|
type DocumentPropertyType,
|
|
26
26
|
type DocumentPropertyValue,
|
|
27
27
|
} from "../shared/properties.js";
|
|
28
|
+
import {
|
|
29
|
+
lockContentDatabaseMutation,
|
|
30
|
+
touchContentDatabase,
|
|
31
|
+
} from "./_content-database-mutation-lock.js";
|
|
28
32
|
import { ensureDocumentFilesMembership } from "./_content-files.js";
|
|
29
33
|
import { nanoid, parseDatabaseViewConfig } from "./_property-utils.js";
|
|
30
34
|
|
|
@@ -47,6 +51,21 @@ const submitContentDatabaseFormSchema = z.object({
|
|
|
47
51
|
type PropertyDefinitionRow =
|
|
48
52
|
typeof schema.documentPropertyDefinitions.$inferSelect;
|
|
49
53
|
|
|
54
|
+
function propertyDefinitionFingerprint(definitions: PropertyDefinitionRow[]) {
|
|
55
|
+
return JSON.stringify(
|
|
56
|
+
definitions
|
|
57
|
+
.map((definition) => ({
|
|
58
|
+
id: definition.id,
|
|
59
|
+
name: definition.name,
|
|
60
|
+
type: definition.type,
|
|
61
|
+
systemRole: definition.systemRole,
|
|
62
|
+
visibility: definition.visibility,
|
|
63
|
+
optionsJson: definition.optionsJson,
|
|
64
|
+
}))
|
|
65
|
+
.sort((left, right) => left.id.localeCompare(right.id)),
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
50
69
|
function resolveFormView(
|
|
51
70
|
views: ContentDatabaseView[],
|
|
52
71
|
activeViewId: string,
|
|
@@ -231,6 +250,7 @@ export default defineAction({
|
|
|
231
250
|
),
|
|
232
251
|
),
|
|
233
252
|
);
|
|
253
|
+
const definitionsFingerprint = propertyDefinitionFingerprint(definitions);
|
|
234
254
|
const viewConfig = parseDatabaseViewConfig(database.viewConfigJson);
|
|
235
255
|
const formView = resolveFormView(
|
|
236
256
|
viewConfig.views,
|
|
@@ -310,6 +330,35 @@ export default defineAction({
|
|
|
310
330
|
const createdBy = getRequestUserEmail() ?? database.ownerEmail;
|
|
311
331
|
|
|
312
332
|
await db.transaction(async (tx) => {
|
|
333
|
+
await lockContentDatabaseMutation(
|
|
334
|
+
tx as unknown as ReturnType<typeof getDb>,
|
|
335
|
+
databaseId,
|
|
336
|
+
);
|
|
337
|
+
await touchContentDatabase(
|
|
338
|
+
tx as unknown as ReturnType<typeof getDb>,
|
|
339
|
+
databaseId,
|
|
340
|
+
now,
|
|
341
|
+
);
|
|
342
|
+
const lockedDefinitions = await tx
|
|
343
|
+
.select()
|
|
344
|
+
.from(schema.documentPropertyDefinitions)
|
|
345
|
+
.where(
|
|
346
|
+
and(
|
|
347
|
+
eq(schema.documentPropertyDefinitions.databaseId, databaseId),
|
|
348
|
+
eq(
|
|
349
|
+
schema.documentPropertyDefinitions.ownerEmail,
|
|
350
|
+
database.ownerEmail,
|
|
351
|
+
),
|
|
352
|
+
),
|
|
353
|
+
);
|
|
354
|
+
if (
|
|
355
|
+
propertyDefinitionFingerprint(lockedDefinitions) !==
|
|
356
|
+
definitionsFingerprint
|
|
357
|
+
) {
|
|
358
|
+
throw new Error(
|
|
359
|
+
"Database properties changed before form submission completed.",
|
|
360
|
+
);
|
|
361
|
+
}
|
|
313
362
|
const [maxDocumentPosition] = await tx
|
|
314
363
|
.select({ max: sql<number>`COALESCE(MAX(position), -1)` })
|
|
315
364
|
.from(schema.documents)
|
|
@@ -356,7 +356,7 @@ async function transcribeMedia(media: AudioOnlyTranscriptionMedia) {
|
|
|
356
356
|
);
|
|
357
357
|
}
|
|
358
358
|
throw new Error(
|
|
359
|
-
`No media transcription provider is available. Connect Builder.io in Settings -> File uploads or configure GROQ_API_KEY. ${groqError}`,
|
|
359
|
+
`No media transcription provider is available. Connect Builder.io (free tier available) in Settings -> File uploads or configure GROQ_API_KEY. ${groqError}`,
|
|
360
360
|
);
|
|
361
361
|
}
|
|
362
362
|
}
|
|
@@ -129,7 +129,7 @@ async function uploadMediaFile(
|
|
|
129
129
|
const serverMessage = uploadResponseMessage(response, body, kind);
|
|
130
130
|
if (isBuilderReconnectError(serverMessage)) {
|
|
131
131
|
throw new Error(
|
|
132
|
-
"Builder.io is connected, but the saved connection was rejected. Reconnect Builder.io in Settings -> File uploads, then try again.",
|
|
132
|
+
"Builder.io is connected, but the saved connection was rejected. Reconnect Builder.io in Settings -> File uploads (free tier available), then try again.",
|
|
133
133
|
);
|
|
134
134
|
}
|
|
135
135
|
if (
|
|
@@ -139,7 +139,7 @@ async function uploadMediaFile(
|
|
|
139
139
|
)
|
|
140
140
|
) {
|
|
141
141
|
throw new Error(
|
|
142
|
-
`${mediaUploadLabel(kind)} uploads need file storage. Connect Builder.io in Settings -> File uploads, then try again.`,
|
|
142
|
+
`${mediaUploadLabel(kind)} uploads need file storage. Connect Builder.io in Settings -> File uploads (free tier available), then try again.`,
|
|
143
143
|
);
|
|
144
144
|
}
|
|
145
145
|
throw new Error(serverMessage);
|
|
@@ -227,7 +227,7 @@ const databaseMessages = {
|
|
|
227
227
|
collapseAllGroups: "Collapse all groups",
|
|
228
228
|
color: "Color",
|
|
229
229
|
connectYourBuilderAccountToBrowseItsSpaces:
|
|
230
|
-
"Connect your Builder account to browse its spaces and models.",
|
|
230
|
+
"Connect your Builder account (free tier available) to browse its spaces and models.",
|
|
231
231
|
connectedSources: "Connected sources",
|
|
232
232
|
couldntSyncRetry: "Couldn’t sync · Retry",
|
|
233
233
|
databasePagePreview: "Database page preview",
|
|
@@ -9,7 +9,7 @@ This generated matrix tracks whether high-value Content UI operations use the sa
|
|
|
9
9
|
| database.lifecycle-and-trash | database | Create, soft-delete, restore, list, and inspect content databases | action-backed | `create-content-database`, `create-inline-content-database`, `delete-content-database`, `get-content-database`, `list-content-databases`, `list-trashed-content-databases`, `restore-content-database` | `app/components/editor/SlashCommandMenu.tsx`, `app/hooks/use-content-database.ts`, `app/hooks/use-documents.ts` | Database pages and database records are created, read, soft-deleted, restored, and listed. | - | - | P0 | covered | `actions/content-database-lifecycle.db.test.ts` | `database-source-scope` | - |
|
|
10
10
|
| database.private-preview-drafts | database | Persist and reconcile a user's private database-page preview draft | action-backed | `get-preview-document-draft`, `update-preview-document-draft` | `app/components/editor/database/DatabaseView.tsx`, `app/hooks/use-documents.ts` | A user's private preview draft is read, saved, conflict-checked, or deleted without changing the shared database page until the normal save flow applies it. | These per-user editor-state actions are intentionally hidden from agent tools because preview drafts are a private UI recovery mechanism. | - | P1 | covered | `actions/preview-document-draft.db.test.ts` | - | - |
|
|
11
11
|
| database.properties-and-view-config | database | Configure properties, values, ordering, and saved views | action-backed | `configure-document-property`, `delete-document-property`, `duplicate-document-property`, `get-content-database-personal-view`, `list-document-properties`, `reorder-document-property`, `set-document-property`, `update-content-database-personal-view`, `update-content-database-view` | `app/components/editor/DocumentProperties.tsx`, `app/components/editor/DocumentDatabase.tsx`, `app/components/editor/database/DatabaseView.tsx`, `app/hooks/use-document-properties.ts` | Property schemas, property values, property order, filters, sorts, grouping, hidden columns, view type, and view settings are stored. | - | - | P0 | covered | `actions/bind-content-database-source-field.db.test.ts`, `actions/content-database-source-actions.test.ts`, `actions/resync-content-database-source.db.test.ts` | `database-source-scope` | - |
|
|
12
|
-
| database.rows | database | Add, duplicate, move, open, edit, and remove database rows | action-backed | `add-database-item`, `upsert-database-item-by-key`, `remove-database-items`, `duplicate-database-items`, `duplicate-database-item`, `move-database-item`, `set-document-property`
|
|
12
|
+
| database.rows | database | Add, duplicate, move, open, edit, and remove database rows | action-backed | `add-database-item`, `upsert-database-item-by-key`, `remove-database-items`, `duplicate-database-items`, `duplicate-database-item`, `migrate-content-database-rows`, `move-database-item`, `set-document-property` | `app/components/editor/DocumentDatabase.tsx`, `app/components/editor/database/DatabaseView.tsx` | Database row memberships and ordering are created, duplicated, moved, edited, and removed without deleting the backing page; bounded migrations atomically update row bodies and properties through the same canonical data model. | - | - | P0 | covered | `actions/database-row-batch-actions.db.test.ts`, `actions/migrate-content-database-rows.db.test.ts`, `parity/__tests__/database-row-batch-reliability.test.ts` | `database-bulk-row-reliability` | - |
|
|
13
13
|
| database.table-query-page | database | Query one constrained page while retaining database metadata | action-backed | `query-content-database-items` | `app/components/editor/database/DatabaseView.tsx`, `app/hooks/use-content-database.ts` | - | This UI-only bounded projection is intentionally hidden with agentTool: false; agents use get-content-database for the complete database contract. | - | P0 | covered | `actions/content-database-lifecycle.db.test.ts`, `app/hooks/use-content-database.test.ts` | - | - |
|
|
14
14
|
| editor.agent-assist-prompts | editor | Ask AI from slash generation or comment context | client-assist | - | `app/components/editor/SlashCommandMenu.tsx`, `app/components/editor/CommentsSidebar.tsx` | No direct durable mutation; the prompt asks the agent to use document actions when it decides to write. | - | - | P1 | none | - | - | - |
|
|
15
15
|
| editor.client-formatting-and-insertions | editor | Rich text formatting, selection state, slash block insertion, and copy actions | client-only-ephemeral | - | `app/components/editor/BubbleToolbar.tsx`, `app/components/editor/SlashCommandMenu.tsx`, `app/components/editor/DocumentToolbar.tsx` | - | - | - | P1 | none | - | - | - |
|
|
@@ -317,9 +317,9 @@ export const parityMatrix: ParityRow[] = [
|
|
|
317
317
|
"app/components/editor/database/DatabaseView.tsx",
|
|
318
318
|
],
|
|
319
319
|
durableEffect:
|
|
320
|
-
"Database row memberships and ordering are created, duplicated, moved, edited, and removed without deleting the backing page.",
|
|
320
|
+
"Database row memberships and ordering are created, duplicated, moved, edited, and removed without deleting the backing page; bounded migrations atomically update row bodies and properties through the same canonical data model.",
|
|
321
321
|
uiImplementation:
|
|
322
|
-
"Row controls call row actions; selected-row duplicate/removal call bounded batch actions, while
|
|
322
|
+
"Row controls call row actions; selected-row duplicate/removal call bounded batch actions, while bounded whole-database schema-and-body migrations use one validated, receipt-backed action instead of many partial writes.",
|
|
323
323
|
status: "action-backed",
|
|
324
324
|
actions: [
|
|
325
325
|
"add-database-item",
|
|
@@ -327,6 +327,7 @@ export const parityMatrix: ParityRow[] = [
|
|
|
327
327
|
"remove-database-items",
|
|
328
328
|
"duplicate-database-items",
|
|
329
329
|
"duplicate-database-item",
|
|
330
|
+
"migrate-content-database-rows",
|
|
330
331
|
"move-database-item",
|
|
331
332
|
"set-document-property",
|
|
332
333
|
],
|
|
@@ -337,6 +338,7 @@ export const parityMatrix: ParityRow[] = [
|
|
|
337
338
|
followUpPR: null,
|
|
338
339
|
coverageRefs: [
|
|
339
340
|
"actions/database-row-batch-actions.db.test.ts",
|
|
341
|
+
"actions/migrate-content-database-rows.db.test.ts",
|
|
340
342
|
"parity/__tests__/database-row-batch-reliability.test.ts",
|
|
341
343
|
],
|
|
342
344
|
evalScenarioIds: ["database-bulk-row-reliability"],
|
|
@@ -464,6 +464,36 @@ export const contentDatabaseSourceExecutionClaims = table(
|
|
|
464
464
|
},
|
|
465
465
|
);
|
|
466
466
|
|
|
467
|
+
export const contentDatabaseMigrationReceipts = table(
|
|
468
|
+
"content_database_migration_receipts",
|
|
469
|
+
{
|
|
470
|
+
id: text("id").primaryKey(),
|
|
471
|
+
ownerEmail: text("owner_email").notNull().default("local@localhost"),
|
|
472
|
+
orgId: text("org_id"),
|
|
473
|
+
databaseId: text("database_id").notNull(),
|
|
474
|
+
databaseDocumentId: text("database_document_id").notNull(),
|
|
475
|
+
idempotencyKey: text("idempotency_key").notNull(),
|
|
476
|
+
planHash: text("plan_hash").notNull(),
|
|
477
|
+
state: text("state").notNull(),
|
|
478
|
+
preDigest: text("pre_digest").notNull(),
|
|
479
|
+
postDigest: text("post_digest").notNull(),
|
|
480
|
+
rollbackJson: text("rollback_json").notNull().default("{}"),
|
|
481
|
+
resultJson: text("result_json").notNull().default("{}"),
|
|
482
|
+
createdAt: text("created_at").notNull().default(now()),
|
|
483
|
+
updatedAt: text("updated_at").notNull().default(now()),
|
|
484
|
+
},
|
|
485
|
+
(receipt) => [
|
|
486
|
+
uniqueIndex("content_database_migration_receipts_database_key_unique").on(
|
|
487
|
+
receipt.databaseId,
|
|
488
|
+
receipt.idempotencyKey,
|
|
489
|
+
),
|
|
490
|
+
index("content_database_migration_receipts_owner_database_idx").on(
|
|
491
|
+
receipt.ownerEmail,
|
|
492
|
+
receipt.databaseId,
|
|
493
|
+
),
|
|
494
|
+
],
|
|
495
|
+
);
|
|
496
|
+
|
|
467
497
|
export const documentPropertyValues = table("document_property_values", {
|
|
468
498
|
id: text("id").primaryKey(),
|
|
469
499
|
ownerEmail: text("owner_email").notNull().default("local@localhost"),
|
|
@@ -932,6 +932,30 @@ const runContentMigrations = runMigrations(
|
|
|
932
932
|
name: "content-database-item-stable-key-single-active-claim",
|
|
933
933
|
sql: `CREATE UNIQUE INDEX IF NOT EXISTS content_database_item_key_claims_database_property_document_unique ON content_database_item_key_claims (database_id, property_id, document_id)`,
|
|
934
934
|
},
|
|
935
|
+
{
|
|
936
|
+
version: 80,
|
|
937
|
+
name: "content-database-migration-receipts",
|
|
938
|
+
sql: `CREATE TABLE IF NOT EXISTS content_database_migration_receipts (
|
|
939
|
+
id TEXT PRIMARY KEY,
|
|
940
|
+
owner_email TEXT NOT NULL DEFAULT 'local@localhost',
|
|
941
|
+
org_id TEXT,
|
|
942
|
+
database_id TEXT NOT NULL,
|
|
943
|
+
database_document_id TEXT NOT NULL,
|
|
944
|
+
idempotency_key TEXT NOT NULL,
|
|
945
|
+
plan_hash TEXT NOT NULL,
|
|
946
|
+
state TEXT NOT NULL,
|
|
947
|
+
pre_digest TEXT NOT NULL,
|
|
948
|
+
post_digest TEXT NOT NULL,
|
|
949
|
+
rollback_json TEXT NOT NULL DEFAULT '{}',
|
|
950
|
+
result_json TEXT NOT NULL DEFAULT '{}',
|
|
951
|
+
created_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
952
|
+
updated_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
953
|
+
);
|
|
954
|
+
CREATE UNIQUE INDEX IF NOT EXISTS content_database_migration_receipts_database_key_unique
|
|
955
|
+
ON content_database_migration_receipts (database_id, idempotency_key);
|
|
956
|
+
CREATE INDEX IF NOT EXISTS content_database_migration_receipts_owner_database_idx
|
|
957
|
+
ON content_database_migration_receipts (owner_email, database_id)`,
|
|
958
|
+
},
|
|
935
959
|
],
|
|
936
960
|
{ table: "content_migrations" },
|
|
937
961
|
);
|
|
@@ -24,14 +24,14 @@ export default async (nitroApp: any): Promise<void> => {
|
|
|
24
24
|
required: false,
|
|
25
25
|
title: "Media uploads",
|
|
26
26
|
description:
|
|
27
|
-
"Connect Builder.io to upload and embed images, videos, and audio files in Content documents.",
|
|
27
|
+
"Connect Builder.io (free tier available) to upload and embed images, videos, and audio files in Content documents.",
|
|
28
28
|
methods: [
|
|
29
29
|
{
|
|
30
30
|
id: "builder",
|
|
31
31
|
kind: "builder-cli-auth",
|
|
32
32
|
label: "Connect Builder.io",
|
|
33
33
|
description:
|
|
34
|
-
"One-click file storage for media blocks.
|
|
34
|
+
"One-click file storage for media blocks. Builder.io's free tier includes file storage.",
|
|
35
35
|
primary: true,
|
|
36
36
|
badge: "free",
|
|
37
37
|
payload: { scope: "browser" },
|