@agent-native/core 0.83.0 → 0.84.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/corpus/README.md +1 -1
- package/corpus/core/CHANGELOG.md +34 -0
- package/corpus/core/README.md +2 -2
- package/corpus/core/docs/content/cloneable-saas.mdx +2 -2
- package/corpus/core/docs/content/evals.mdx +34 -12
- package/corpus/core/docs/content/faq.mdx +1 -1
- package/corpus/core/docs/content/locales/ar-SA/cloneable-saas.mdx +2 -2
- package/corpus/core/docs/content/locales/ar-SA/evals.mdx +7 -0
- package/corpus/core/docs/content/locales/ar-SA/faq.mdx +1 -1
- package/corpus/core/docs/content/locales/ar-SA/template-chat.mdx +1 -1
- package/corpus/core/docs/content/locales/de-DE/cloneable-saas.mdx +2 -2
- package/corpus/core/docs/content/locales/de-DE/evals.mdx +8 -0
- package/corpus/core/docs/content/locales/de-DE/faq.mdx +1 -1
- package/corpus/core/docs/content/locales/de-DE/template-chat.mdx +1 -1
- package/corpus/core/docs/content/locales/es-ES/cloneable-saas.mdx +2 -2
- package/corpus/core/docs/content/locales/es-ES/evals.mdx +8 -0
- package/corpus/core/docs/content/locales/es-ES/faq.mdx +1 -1
- package/corpus/core/docs/content/locales/es-ES/template-chat.mdx +1 -1
- package/corpus/core/docs/content/locales/fr-FR/cloneable-saas.mdx +2 -2
- package/corpus/core/docs/content/locales/fr-FR/evals.mdx +8 -0
- package/corpus/core/docs/content/locales/fr-FR/faq.mdx +1 -1
- package/corpus/core/docs/content/locales/fr-FR/template-chat.mdx +1 -1
- package/corpus/core/docs/content/locales/hi-IN/cloneable-saas.mdx +2 -2
- package/corpus/core/docs/content/locales/hi-IN/evals.mdx +8 -0
- package/corpus/core/docs/content/locales/hi-IN/faq.mdx +1 -1
- package/corpus/core/docs/content/locales/hi-IN/template-chat.mdx +1 -1
- package/corpus/core/docs/content/locales/ja-JP/cloneable-saas.mdx +2 -2
- package/corpus/core/docs/content/locales/ja-JP/evals.mdx +7 -0
- package/corpus/core/docs/content/locales/ja-JP/faq.mdx +1 -1
- package/corpus/core/docs/content/locales/ja-JP/template-chat.mdx +1 -1
- package/corpus/core/docs/content/locales/ko-KR/cloneable-saas.mdx +2 -2
- package/corpus/core/docs/content/locales/ko-KR/evals.mdx +7 -0
- package/corpus/core/docs/content/locales/ko-KR/faq.mdx +1 -1
- package/corpus/core/docs/content/locales/ko-KR/template-chat.mdx +1 -1
- package/corpus/core/docs/content/locales/pt-BR/cloneable-saas.mdx +2 -2
- package/corpus/core/docs/content/locales/pt-BR/evals.mdx +8 -0
- package/corpus/core/docs/content/locales/pt-BR/faq.mdx +1 -1
- package/corpus/core/docs/content/locales/pt-BR/template-chat.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-CN/cloneable-saas.mdx +2 -2
- package/corpus/core/docs/content/locales/zh-CN/evals.mdx +7 -0
- package/corpus/core/docs/content/locales/zh-CN/faq.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-CN/template-chat.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-TW/cloneable-saas.mdx +2 -2
- package/corpus/core/docs/content/locales/zh-TW/evals.mdx +7 -0
- package/corpus/core/docs/content/locales/zh-TW/faq.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-TW/template-chat.mdx +1 -1
- package/corpus/core/docs/content/template-chat.mdx +1 -1
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/agent/engine/builtin.ts +1 -1
- package/corpus/core/src/agent/engine/output-tokens.ts +1 -1
- package/corpus/core/src/agent/harness/acp-adapter.ts +28 -4
- package/corpus/core/src/agent/harness/ai-sdk-adapter.ts +3 -0
- package/corpus/core/src/agent/harness/translate.ts +3 -0
- package/corpus/core/src/agent/harness/types.ts +1 -0
- package/corpus/core/src/agent/model-config.ts +34 -13
- package/corpus/core/src/agent/production-agent.ts +87 -10
- package/corpus/core/src/agent/thread-data-builder.ts +29 -4
- package/corpus/core/src/agent/tool-call-journal.ts +109 -48
- package/corpus/core/src/agent/types.ts +6 -1
- package/corpus/core/src/cli/design-connect.ts +106 -0
- package/corpus/core/src/cli/gateway-helpers.ts +17 -0
- package/corpus/core/src/cli/recap.ts +0 -2
- package/corpus/core/src/cli/skills.ts +54 -16
- package/corpus/core/src/cli/workspace-dev.ts +29 -5
- package/corpus/core/src/client/AssistantChat.tsx +89 -42
- package/corpus/core/src/client/DefaultSpinner.tsx +8 -1
- package/corpus/core/src/client/chat/message-components.tsx +49 -1
- package/corpus/core/src/client/chat/repo-helpers.ts +71 -0
- package/corpus/core/src/client/chat/run-recovery.tsx +15 -5
- package/corpus/core/src/client/components/ApiKeySettings.tsx +8 -8
- package/corpus/core/src/client/components/CodeRequiredDialog.tsx +26 -15
- package/corpus/core/src/client/components/MissingKeyCard.tsx +13 -6
- package/corpus/core/src/client/composer/TiptapComposer.tsx +4 -3
- package/corpus/core/src/client/extensions/ExtensionsSidebarSection.tsx +0 -1
- package/corpus/core/src/client/guided-questions.tsx +21 -27
- package/corpus/core/src/client/integrations/IntegrationCard.tsx +1 -1
- package/corpus/core/src/client/integrations/IntegrationsPanel.tsx +1 -1
- package/corpus/core/src/client/onboarding/OnboardingBanner.tsx +2 -2
- package/corpus/core/src/client/onboarding/OnboardingPanel.tsx +23 -19
- package/corpus/core/src/client/resources/ResourceEditor.tsx +18 -10
- package/corpus/core/src/client/resources/ResourcesPanel.tsx +5 -1
- package/corpus/core/src/client/settings/SettingsPanel.tsx +8 -3
- package/corpus/core/src/client/settings/useBuilderStatus.ts +8 -41
- package/corpus/core/src/client/useProductionAgent.ts +6 -2
- package/corpus/core/src/deploy/build.ts +1 -1
- package/corpus/core/src/eval/define-eval.ts +4 -1
- package/corpus/core/src/eval/report.ts +23 -8
- package/corpus/core/src/eval/runner.ts +41 -6
- package/corpus/core/src/eval/types.ts +11 -0
- package/corpus/core/src/observability/traces.ts +3 -3
- package/corpus/core/src/onboarding/default-steps.ts +1 -1
- package/corpus/core/src/scripts/agent-engines/manage-agent-engine.ts +1 -1
- package/corpus/core/src/scripts/agent-engines/set-agent-engine.ts +1 -1
- package/corpus/core/src/server/agent-chat-plugin.ts +177 -81
- package/corpus/core/src/server/core-routes-plugin.ts +7 -1
- package/corpus/core/src/server/open-route.ts +59 -40
- package/corpus/core/src/shared/reasoning-effort.ts +2 -0
- package/corpus/core/src/sharing/access.ts +22 -2
- package/corpus/core/src/sharing/registry.ts +18 -0
- package/corpus/core/src/styles/agent-native.css +104 -20
- package/corpus/core/src/styles/rich-markdown-editor.css +11 -10
- package/corpus/templates/analytics/app/components/dashboard/CumulativeNetChart.tsx +10 -10
- package/corpus/templates/analytics/app/components/dashboard/RevenueChart.tsx +10 -10
- package/corpus/templates/analytics/app/components/dashboard/RevenueComparisonChart.tsx +6 -5
- package/corpus/templates/analytics/app/components/dashboard/TimeSeriesChart.tsx +9 -9
- package/corpus/templates/analytics/app/global.css +4 -0
- package/corpus/templates/analytics/app/lib/chart-theme.ts +13 -0
- package/corpus/templates/analytics/app/pages/adhoc/_shared/KpiChart.tsx +22 -24
- package/corpus/templates/analytics/changelog/2026-06-30-dashboard-charts-now-use-theme-aware-tooltip-and-grid-colors.md +6 -0
- package/corpus/templates/analytics/changelog/2026-06-30-fixed-ask-composer-spacing-so-the-chat-field-has-a-comfortab.md +6 -0
- package/corpus/templates/calendar/AGENTS.md +4 -0
- package/corpus/templates/calendar/actions/connect-google-calendar.ts +80 -0
- package/corpus/templates/calendar/changelog/2026-06-30-calendar-now-gives-the-agent-a-safe-google-connection-link-i.md +6 -0
- package/corpus/templates/calendar/server/plugins/agent-chat.ts +4 -0
- package/corpus/templates/content/AGENTS.md +9 -2
- package/corpus/templates/content/actions/_database-row-batch.ts +230 -0
- package/corpus/templates/content/actions/_database-utils.ts +17 -9
- package/corpus/templates/content/actions/_notion-action-utils.ts +26 -0
- package/corpus/templates/content/actions/connect-notion-status.ts +13 -4
- package/corpus/templates/content/actions/create-and-link-notion-page.ts +23 -0
- package/corpus/templates/content/actions/delete-database-items.ts +55 -0
- package/corpus/templates/content/actions/delete-document.ts +4 -4
- package/corpus/templates/content/actions/disconnect-notion.ts +16 -0
- package/corpus/templates/content/actions/duplicate-database-item.ts +1 -1
- package/corpus/templates/content/actions/duplicate-database-items.ts +191 -0
- package/corpus/templates/content/actions/link-notion-page.ts +10 -7
- package/corpus/templates/content/actions/list-notion-links.ts +3 -4
- package/corpus/templates/content/actions/pull-notion-page.ts +7 -9
- package/corpus/templates/content/actions/push-notion-page.ts +7 -9
- package/corpus/templates/content/actions/refresh-notion-sync-status.ts +24 -0
- package/corpus/templates/content/actions/resolve-notion-sync-conflict.ts +23 -0
- package/corpus/templates/content/actions/search-notion-pages.ts +67 -0
- package/corpus/templates/content/actions/unlink-notion-page.ts +23 -0
- package/corpus/templates/content/app/components/editor/BubbleToolbar.tsx +5 -5
- package/corpus/templates/content/app/components/editor/DocumentDatabase.tsx +27 -34
- package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +16 -13
- package/corpus/templates/content/app/components/editor/DocumentToolbar.tsx +10 -10
- package/corpus/templates/content/app/components/editor/NotionConflictBanner.tsx +1 -1
- package/corpus/templates/content/app/components/editor/NotionSyncBar.tsx +18 -9
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +27 -34
- package/corpus/templates/content/app/components/editor/database/navigation-state.ts +10 -4
- package/corpus/templates/content/app/components/sidebar/NotionButton.tsx +32 -17
- package/corpus/templates/content/app/global.css +6 -5
- package/corpus/templates/content/app/hooks/use-content-database.ts +35 -0
- package/corpus/templates/content/app/hooks/use-notion.ts +108 -99
- package/corpus/templates/content/changelog/2026-06-30-editor-floating-toolbars-now-use-theme-aware-colors-in-light.md +6 -0
- package/corpus/templates/content/package.json +3 -0
- package/corpus/templates/content/parity/README.md +69 -0
- package/corpus/templates/content/parity/eval-scenarios.ts +118 -0
- package/corpus/templates/content/parity/exceptions.allowlist.ts +17 -0
- package/corpus/templates/content/parity/matrix.md +28 -0
- package/corpus/templates/content/parity/matrix.ts +606 -0
- package/corpus/templates/content/parity/matrix.types.ts +42 -0
- package/corpus/templates/content/parity/parity-evals.eval.ts +4 -0
- package/corpus/templates/content/parity/render-matrix.ts +90 -0
- package/corpus/templates/content/parity/scenario-to-eval.ts +57 -0
- package/corpus/templates/content/shared/api.ts +11 -0
- package/corpus/templates/design/.agents/skills/visual-edit/SKILL.md +6 -1
- package/corpus/templates/design/actions/add-localhost-screens.ts +63 -8
- package/corpus/templates/design/actions/apply-motion-edit.ts +12 -46
- package/corpus/templates/design/actions/list-design-native-assets.ts +2 -1
- package/corpus/templates/design/actions/migrate-board-objects-to-file.ts +49 -1
- package/corpus/templates/design/actions/navigate.ts +3 -12
- package/corpus/templates/design/actions/open-visual-edit.ts +341 -0
- package/corpus/templates/design/actions/view-screen.ts +1 -1
- package/corpus/templates/design/app/components/design/CanvasContextMenu.tsx +1 -1
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +345 -14
- package/corpus/templates/design/app/components/design/DesignEditorSkeleton.tsx +71 -91
- package/corpus/templates/design/app/components/design/DesignExtensionsPanel.tsx +25 -27
- package/corpus/templates/design/app/components/design/DeviceFrame.tsx +1 -1
- package/corpus/templates/design/app/components/design/DrawOverlay.tsx +2 -2
- package/corpus/templates/design/app/components/design/EditPanel.tsx +1111 -570
- package/corpus/templates/design/app/components/design/LayersPanel.tsx +162 -32
- package/corpus/templates/design/app/components/design/MotionDock.tsx +268 -240
- package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +1038 -150
- package/corpus/templates/design/app/components/design/QuestionFlow.tsx +1 -1
- package/corpus/templates/design/app/components/design/ReviewPanel.tsx +81 -102
- package/corpus/templates/design/app/components/design/StatesPanel.tsx +6 -6
- package/corpus/templates/design/app/components/design/TokensPanel.tsx +11 -11
- package/corpus/templates/design/app/components/design/TweaksPanel.tsx +9 -7
- package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +1129 -155
- package/corpus/templates/design/app/components/design/bridge/hit-test.bridge.ts +130 -37
- package/corpus/templates/design/app/components/design/canvas-primitive-style.ts +24 -11
- package/corpus/templates/design/app/components/design/inspector/AutoLayoutMatrix.tsx +184 -162
- package/corpus/templates/design/app/components/design/inspector/ConstraintsWidget.tsx +137 -79
- package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +13 -13
- package/corpus/templates/design/app/components/design/inspector/ExportSettingsPanel.tsx +8 -8
- package/corpus/templates/design/app/components/design/inspector/GradientEditor.tsx +2 -2
- package/corpus/templates/design/app/components/design/inspector/ImageFillControls.tsx +4 -4
- package/corpus/templates/design/app/components/design/inspector/InspectorAiActions.tsx +3 -3
- package/corpus/templates/design/app/components/design/inspector/ScrubInput.tsx +13 -7
- package/corpus/templates/design/app/components/design/inspector/ShaderControls.tsx +14 -11
- package/corpus/templates/design/app/components/design/inspector/ShaderFillsPanel.tsx +4 -4
- package/corpus/templates/design/app/components/design/inspector/index.ts +2 -0
- package/corpus/templates/design/app/components/design/types.ts +19 -0
- package/corpus/templates/design/app/components/editor/PromptDialog.tsx +61 -78
- package/corpus/templates/design/app/components/layout/Header.tsx +0 -1
- package/corpus/templates/design/app/components/layout/Layout.tsx +3 -2
- package/corpus/templates/design/app/components/layout/Sidebar.tsx +0 -2
- package/corpus/templates/design/app/components/visual-editor/CanvasCommentPins.tsx +5 -4
- package/corpus/templates/design/app/components/visual-editor/DrawOverlay.tsx +1 -1
- package/corpus/templates/design/app/components/visual-editor/SaveStatusIndicator.tsx +2 -2
- package/corpus/templates/design/app/global.css +56 -0
- package/corpus/templates/design/app/hooks/use-agent-generating.ts +4 -5
- package/corpus/templates/design/app/hooks/use-navigation-state.ts +6 -7
- package/corpus/templates/design/app/hooks/use-question-flow.ts +3 -2
- package/corpus/templates/design/app/hooks/useAgentEditRequest.ts +6 -4
- package/corpus/templates/design/app/i18n/zh-TW.ts +5 -14
- package/corpus/templates/design/app/i18n-data.ts +63 -188
- package/corpus/templates/design/app/lib/agent-chat.ts +13 -0
- package/corpus/templates/design/app/pages/DesignEditor.tsx +1428 -384
- package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +9 -5
- package/corpus/templates/design/app/pages/DesignSystems.tsx +2 -2
- package/corpus/templates/design/app/pages/Index.tsx +49 -26
- package/corpus/templates/design/app/pages/NotFound.tsx +25 -8
- package/corpus/templates/design/app/pages/VisualEdit.tsx +17 -5
- package/corpus/templates/design/app/routes/examples.tsx +1 -7
- package/corpus/templates/design/app/routes/templates.tsx +7 -4
- package/corpus/templates/design/changelog/2026-06-30-board-shapes-and-auto-layout-controls-are-clearer.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-component-selections-now-use-purple-component-chrome-and-sho.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-constraints-now-stay-tucked-into-a-compact-inspector-preview.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-creating-a-component-now-opens-in-a-compact-inspector-popove.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-design-cards-no-longer-show-legacy-project-type-badges.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-design-chat-now-keeps-new-turns-in-the-visible-design-agent-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-design-editor-panels-now-keep-their-compact-text-sizing-cons.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-design-no-longer-shows-the-connected-local-code-warning-bann.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-design-now-opens-to-the-files-panel-unless-a-generation-is-a.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-design-opens-with-a-cleaner-empty-canvas-and-loading-preview.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-design-tools-use-simpler-less-decorative-icons.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-dragging-absolute-elements-no-longer-shows-coordinate-labels.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-fixed-all-screens-opening-too-zoomed-in-by-default.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-fixed-the-public-design-assets-sidebar-so-native-components-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-fixed-the-screen-overview-board-so-empty-board-space-no-long.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-full-view-screens-can-now-scroll-while-remaining-editable.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-inspector-element-headers-show-the-selected-html-tag-and-the.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-inspector-inputs-stay-compact-across-desktop-breakpoints.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-layers-can-be-multi-selected-from-the-canvas-and-edited-toge.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-local-visual-edit-links-can-edit-localhost-frames-without-si.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-localhost-visual-edit-frames-can-now-be-selected-and-edited.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-marquee-selection-now-works-inside-screens-multi-selected-la.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-motion-is-now-available-from-the-persistent-left-rail-and-th.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-motion-timeline-collapse-and-reopen-animations-feel-smoother.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-multi-select-outlines-now-stay-consistent-across-all-screens.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-new-board-shapes-now-start-with-neutral-gray-styling.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-new-designs-open-into-a-steadier-loading-state-before-the-ed.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-new-designs-show-a-loading-state-during-handoff-and-keep-edi.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-public-visual-edit-design-links-now-open-directly-instead-of.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-removed-the-confusing-states-section-from-the-design-editor-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-removed-the-templates-gallery-from-design-navigation.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-share-stays-visible-as-soon-as-editable-designs-load.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-signed-out-save-and-share-controls-use-simpler-labels-and-op.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-text-added-on-the-canvas-now-focuses-cleanly-with-the-right-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-the-design-editor-loading-skeleton-is-simpler-and-its-bottom.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-the-design-editor-loading-skeleton-now-follows-the-current-t.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-the-design-inspector-no-longer-shows-child-layout-controls-o.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-the-design-inspector-no-longer-shows-the-ask-ai-section-abov.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-the-design-review-panel-no-longer-shows-a-separate-inline-au.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-the-empty-designs-page-now-focuses-on-a-single-primary-new-d.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-the-layers-panel-header-stays-as-layers-while-multiple-items.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-the-missing-design-screen-now-uses-a-neutral-back-button.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-the-motion-timeline-now-closes-without-squeezing-the-canvas-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-the-new-design-connect-ai-setup-now-lines-up-with-the-compos.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-the-screen-overview-board-now-blends-into-the-canvas-and-new.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-top-level-canvas-drops-now-show-screen-guides.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-top-level-canvas-layers-now-keep-a-transparent-backdrop-and-.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-top-level-canvas-layers-now-select-reliably-from-all-screens.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-visual-edit-can-open-and-refresh-localhost-screens-in-one-au.md +6 -0
- package/corpus/templates/design/e2e/helpers.ts +15 -4
- package/corpus/templates/design/server/db/index.ts +52 -0
- package/corpus/templates/design/server/plugins/agent-chat.ts +5 -0
- package/corpus/templates/design/server/plugins/auth.ts +1 -0
- package/corpus/templates/design/server/plugins/core-routes.ts +4 -0
- package/corpus/templates/design/shared/board-file.ts +380 -5
- package/corpus/templates/design/shared/board-objects.ts +2 -2
- package/corpus/templates/design/shared/code-layer.ts +50 -6
- package/corpus/templates/design/shared/motion-compiler.ts +27 -0
- package/corpus/templates/macros/app/components/DailyProgress.tsx +41 -37
- package/corpus/templates/macros/app/components/ExerciseCard.tsx +2 -2
- package/corpus/templates/macros/app/components/MealCard.tsx +2 -2
- package/corpus/templates/macros/app/components/VoiceDictation.tsx +1 -1
- package/corpus/templates/macros/app/components/WeeklyCaloriesChart.tsx +1 -1
- package/corpus/templates/macros/app/components/WeightCard.tsx +2 -2
- package/corpus/templates/macros/app/components/WeightTracker.tsx +1 -1
- package/corpus/templates/macros/app/components/layout/AppLayout.tsx +1 -1
- package/corpus/templates/macros/app/routes/_index.tsx +5 -5
- package/corpus/templates/macros/app/routes/analytics.tsx +1 -1
- package/corpus/templates/macros/changelog/2026-06-30-dashboard-loading-and-chart-surfaces-now-use-theme-aware-col.md +6 -0
- package/corpus/templates/mail/app/components/email/ComposeBubbleToolbar.tsx +14 -11
- package/corpus/templates/mail/app/global.css +3 -2
- package/corpus/templates/mail/changelog/2026-06-30-compose-floating-toolbars-now-use-theme-aware-colors-in-ligh.md +6 -0
- package/corpus/templates/plan/app/pages/PlansPage.tsx +2 -2
- package/corpus/templates/slides/app/components/deck/DeckCard.tsx +3 -3
- package/corpus/templates/slides/app/global.css +10 -0
- package/corpus/templates/slides/app/pages/Index.tsx +55 -51
- package/corpus/templates/slides/changelog/2026-06-30-deck-thumbnails-collapse-cleanly-to-one-column-when-the-chat.md +6 -0
- package/dist/agent/engine/anthropic-engine.d.ts +2 -2
- package/dist/agent/engine/anthropic-engine.d.ts.map +1 -1
- package/dist/agent/engine/builder-engine.d.ts +2 -2
- package/dist/agent/engine/builder-engine.d.ts.map +1 -1
- package/dist/agent/engine/builtin.js +1 -1
- package/dist/agent/engine/builtin.js.map +1 -1
- package/dist/agent/engine/output-tokens.js +1 -1
- package/dist/agent/engine/output-tokens.js.map +1 -1
- package/dist/agent/harness/acp-adapter.d.ts +4 -1
- package/dist/agent/harness/acp-adapter.d.ts.map +1 -1
- package/dist/agent/harness/acp-adapter.js +19 -2
- package/dist/agent/harness/acp-adapter.js.map +1 -1
- package/dist/agent/harness/ai-sdk-adapter.d.ts.map +1 -1
- package/dist/agent/harness/ai-sdk-adapter.js +3 -0
- package/dist/agent/harness/ai-sdk-adapter.js.map +1 -1
- package/dist/agent/harness/translate.d.ts.map +1 -1
- package/dist/agent/harness/translate.js +3 -0
- package/dist/agent/harness/translate.js.map +1 -1
- package/dist/agent/harness/types.d.ts +1 -0
- package/dist/agent/harness/types.d.ts.map +1 -1
- package/dist/agent/harness/types.js.map +1 -1
- package/dist/agent/model-config.d.ts +21 -20
- package/dist/agent/model-config.d.ts.map +1 -1
- package/dist/agent/model-config.js +31 -13
- package/dist/agent/model-config.js.map +1 -1
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +85 -10
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/thread-data-builder.d.ts.map +1 -1
- package/dist/agent/thread-data-builder.js +27 -6
- package/dist/agent/thread-data-builder.js.map +1 -1
- package/dist/agent/tool-call-journal.d.ts +11 -9
- package/dist/agent/tool-call-journal.d.ts.map +1 -1
- package/dist/agent/tool-call-journal.js +92 -40
- package/dist/agent/tool-call-journal.js.map +1 -1
- package/dist/agent/types.d.ts +5 -1
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/types.js.map +1 -1
- package/dist/cli/design-connect.d.ts.map +1 -1
- package/dist/cli/design-connect.js +84 -0
- package/dist/cli/design-connect.js.map +1 -1
- package/dist/cli/gateway-helpers.d.ts +4 -0
- package/dist/cli/gateway-helpers.d.ts.map +1 -1
- package/dist/cli/gateway-helpers.js +9 -0
- package/dist/cli/gateway-helpers.js.map +1 -1
- package/dist/cli/recap.d.ts.map +1 -1
- package/dist/cli/recap.js +0 -2
- package/dist/cli/recap.js.map +1 -1
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +54 -16
- package/dist/cli/skills.js.map +1 -1
- package/dist/cli/workspace-dev.d.ts.map +1 -1
- package/dist/cli/workspace-dev.js +33 -6
- package/dist/cli/workspace-dev.js.map +1 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +72 -26
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/DefaultSpinner.d.ts.map +1 -1
- package/dist/client/DefaultSpinner.js +8 -1
- package/dist/client/DefaultSpinner.js.map +1 -1
- package/dist/client/chat/message-components.d.ts +7 -1
- package/dist/client/chat/message-components.d.ts.map +1 -1
- package/dist/client/chat/message-components.js +37 -1
- package/dist/client/chat/message-components.js.map +1 -1
- package/dist/client/chat/repo-helpers.d.ts +1 -0
- package/dist/client/chat/repo-helpers.d.ts.map +1 -1
- package/dist/client/chat/repo-helpers.js +59 -0
- package/dist/client/chat/repo-helpers.js.map +1 -1
- package/dist/client/chat/run-recovery.d.ts.map +1 -1
- package/dist/client/chat/run-recovery.js +4 -4
- package/dist/client/chat/run-recovery.js.map +1 -1
- package/dist/client/components/ApiKeySettings.js +8 -8
- package/dist/client/components/ApiKeySettings.js.map +1 -1
- package/dist/client/components/CodeRequiredDialog.d.ts.map +1 -1
- package/dist/client/components/CodeRequiredDialog.js +24 -15
- package/dist/client/components/CodeRequiredDialog.js.map +1 -1
- package/dist/client/components/MissingKeyCard.d.ts.map +1 -1
- package/dist/client/components/MissingKeyCard.js +11 -6
- package/dist/client/components/MissingKeyCard.js.map +1 -1
- package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
- package/dist/client/composer/TiptapComposer.js +4 -3
- package/dist/client/composer/TiptapComposer.js.map +1 -1
- package/dist/client/extensions/ExtensionsSidebarSection.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionsSidebarSection.js +1 -1
- package/dist/client/extensions/ExtensionsSidebarSection.js.map +1 -1
- package/dist/client/guided-questions.d.ts.map +1 -1
- package/dist/client/guided-questions.js +6 -6
- package/dist/client/guided-questions.js.map +1 -1
- package/dist/client/integrations/IntegrationCard.js +1 -1
- package/dist/client/integrations/IntegrationCard.js.map +1 -1
- package/dist/client/integrations/IntegrationsPanel.js +1 -1
- package/dist/client/integrations/IntegrationsPanel.js.map +1 -1
- package/dist/client/onboarding/OnboardingBanner.js +2 -2
- package/dist/client/onboarding/OnboardingBanner.js.map +1 -1
- package/dist/client/onboarding/OnboardingPanel.js +23 -19
- package/dist/client/onboarding/OnboardingPanel.js.map +1 -1
- package/dist/client/resources/ResourceEditor.d.ts.map +1 -1
- package/dist/client/resources/ResourceEditor.js +13 -10
- package/dist/client/resources/ResourceEditor.js.map +1 -1
- package/dist/client/resources/ResourcesPanel.d.ts.map +1 -1
- package/dist/client/resources/ResourcesPanel.js +2 -1
- package/dist/client/resources/ResourcesPanel.js.map +1 -1
- package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
- package/dist/client/settings/SettingsPanel.js +8 -3
- package/dist/client/settings/SettingsPanel.js.map +1 -1
- package/dist/client/settings/useBuilderStatus.d.ts.map +1 -1
- package/dist/client/settings/useBuilderStatus.js +6 -38
- package/dist/client/settings/useBuilderStatus.js.map +1 -1
- package/dist/client/useProductionAgent.d.ts +2 -1
- package/dist/client/useProductionAgent.d.ts.map +1 -1
- package/dist/client/useProductionAgent.js.map +1 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/awareness.d.ts.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/deploy/build.js +1 -1
- package/dist/deploy/build.js.map +1 -1
- package/dist/eval/define-eval.d.ts.map +1 -1
- package/dist/eval/define-eval.js +2 -1
- package/dist/eval/define-eval.js.map +1 -1
- package/dist/eval/report.d.ts.map +1 -1
- package/dist/eval/report.js +19 -4
- package/dist/eval/report.js.map +1 -1
- package/dist/eval/runner.d.ts.map +1 -1
- package/dist/eval/runner.js +38 -6
- package/dist/eval/runner.js.map +1 -1
- package/dist/eval/types.d.ts +11 -0
- package/dist/eval/types.d.ts.map +1 -1
- package/dist/eval/types.js.map +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +2 -2
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/observability/routes.d.ts +5 -5
- package/dist/observability/traces.d.ts.map +1 -1
- package/dist/observability/traces.js.map +1 -1
- package/dist/onboarding/default-steps.js +1 -1
- package/dist/onboarding/default-steps.js.map +1 -1
- package/dist/progress/routes.d.ts +1 -1
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/scripts/agent-engines/manage-agent-engine.js +1 -1
- package/dist/scripts/agent-engines/manage-agent-engine.js.map +1 -1
- package/dist/scripts/agent-engines/set-agent-engine.js +1 -1
- package/dist/scripts/agent-engines/set-agent-engine.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts +3 -0
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +134 -72
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/core-routes-plugin.d.ts +3 -0
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +4 -1
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/open-route.d.ts +9 -0
- package/dist/server/open-route.d.ts.map +1 -1
- package/dist/server/open-route.js +48 -38
- package/dist/server/open-route.js.map +1 -1
- package/dist/shared/reasoning-effort.js +3 -0
- package/dist/shared/reasoning-effort.js.map +1 -1
- package/dist/sharing/access.d.ts.map +1 -1
- package/dist/sharing/access.js +18 -2
- package/dist/sharing/access.js.map +1 -1
- package/dist/sharing/registry.d.ts +10 -0
- package/dist/sharing/registry.d.ts.map +1 -1
- package/dist/sharing/registry.js.map +1 -1
- package/dist/styles/agent-native.css +104 -20
- package/dist/styles/rich-markdown-editor.css +11 -10
- package/docs/content/cloneable-saas.mdx +2 -2
- package/docs/content/evals.mdx +34 -12
- package/docs/content/faq.mdx +1 -1
- package/docs/content/locales/ar-SA/cloneable-saas.mdx +2 -2
- package/docs/content/locales/ar-SA/evals.mdx +7 -0
- package/docs/content/locales/ar-SA/faq.mdx +1 -1
- package/docs/content/locales/ar-SA/template-chat.mdx +1 -1
- package/docs/content/locales/de-DE/cloneable-saas.mdx +2 -2
- package/docs/content/locales/de-DE/evals.mdx +8 -0
- package/docs/content/locales/de-DE/faq.mdx +1 -1
- package/docs/content/locales/de-DE/template-chat.mdx +1 -1
- package/docs/content/locales/es-ES/cloneable-saas.mdx +2 -2
- package/docs/content/locales/es-ES/evals.mdx +8 -0
- package/docs/content/locales/es-ES/faq.mdx +1 -1
- package/docs/content/locales/es-ES/template-chat.mdx +1 -1
- package/docs/content/locales/fr-FR/cloneable-saas.mdx +2 -2
- package/docs/content/locales/fr-FR/evals.mdx +8 -0
- package/docs/content/locales/fr-FR/faq.mdx +1 -1
- package/docs/content/locales/fr-FR/template-chat.mdx +1 -1
- package/docs/content/locales/hi-IN/cloneable-saas.mdx +2 -2
- package/docs/content/locales/hi-IN/evals.mdx +8 -0
- package/docs/content/locales/hi-IN/faq.mdx +1 -1
- package/docs/content/locales/hi-IN/template-chat.mdx +1 -1
- package/docs/content/locales/ja-JP/cloneable-saas.mdx +2 -2
- package/docs/content/locales/ja-JP/evals.mdx +7 -0
- package/docs/content/locales/ja-JP/faq.mdx +1 -1
- package/docs/content/locales/ja-JP/template-chat.mdx +1 -1
- package/docs/content/locales/ko-KR/cloneable-saas.mdx +2 -2
- package/docs/content/locales/ko-KR/evals.mdx +7 -0
- package/docs/content/locales/ko-KR/faq.mdx +1 -1
- package/docs/content/locales/ko-KR/template-chat.mdx +1 -1
- package/docs/content/locales/pt-BR/cloneable-saas.mdx +2 -2
- package/docs/content/locales/pt-BR/evals.mdx +8 -0
- package/docs/content/locales/pt-BR/faq.mdx +1 -1
- package/docs/content/locales/pt-BR/template-chat.mdx +1 -1
- package/docs/content/locales/zh-CN/cloneable-saas.mdx +2 -2
- package/docs/content/locales/zh-CN/evals.mdx +7 -0
- package/docs/content/locales/zh-CN/faq.mdx +1 -1
- package/docs/content/locales/zh-CN/template-chat.mdx +1 -1
- package/docs/content/locales/zh-TW/cloneable-saas.mdx +2 -2
- package/docs/content/locales/zh-TW/evals.mdx +7 -0
- package/docs/content/locales/zh-TW/faq.mdx +1 -1
- package/docs/content/locales/zh-TW/template-chat.mdx +1 -1
- package/docs/content/template-chat.mdx +1 -1
- package/package.json +1 -1
- package/corpus/templates/content/server/routes/api/notion/disconnect.post.ts +0 -12
- package/corpus/templates/design/app/components/design/LocalSourceEditBanner.tsx +0 -157
- package/corpus/templates/design/app/lib/design-templates.ts +0 -1305
- package/corpus/templates/design/app/pages/Templates.tsx +0 -279
|
@@ -78,6 +78,20 @@ export async function scoreEval(
|
|
|
78
78
|
const threshold =
|
|
79
79
|
opts.thresholdOverride ?? evalCase.threshold ?? DEFAULT_EVAL_THRESHOLD;
|
|
80
80
|
|
|
81
|
+
if (evalCase.skipReason) {
|
|
82
|
+
return {
|
|
83
|
+
eval: evalCase.name,
|
|
84
|
+
threshold,
|
|
85
|
+
scores: [],
|
|
86
|
+
status: "skipped",
|
|
87
|
+
skipReason: evalCase.skipReason,
|
|
88
|
+
// Keep the legacy boolean gate friendly: skipped rows do not fail CI.
|
|
89
|
+
passed: true,
|
|
90
|
+
avgScore: 0,
|
|
91
|
+
durationMs: 0,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
81
95
|
let run: AgentRunOutput;
|
|
82
96
|
if (evalCase.run) {
|
|
83
97
|
run = await evalCase.run({
|
|
@@ -104,6 +118,7 @@ export async function scoreEval(
|
|
|
104
118
|
scores,
|
|
105
119
|
// A run that errored, or any sub-threshold scorer, fails the case.
|
|
106
120
|
passed: run.ok && scores.every((s) => s.passed),
|
|
121
|
+
status: run.ok && scores.every((s) => s.passed) ? "passed" : "failed",
|
|
107
122
|
avgScore,
|
|
108
123
|
durationMs: run.durationMs,
|
|
109
124
|
error: run.ok ? undefined : run.error,
|
|
@@ -120,14 +135,18 @@ export async function runEvals(
|
|
|
120
135
|
for (const evalCase of evals) {
|
|
121
136
|
const row = await scoreEval(evalCase, runner, opts);
|
|
122
137
|
results.push(row);
|
|
123
|
-
if (opts.persist
|
|
138
|
+
if (opts.persist && row.status !== "skipped") {
|
|
139
|
+
await persistEvalRow(row).catch(() => {});
|
|
140
|
+
}
|
|
124
141
|
}
|
|
125
142
|
|
|
126
143
|
const passed = results.filter((r) => r.passed).length;
|
|
144
|
+
const skipped = results.filter((r) => r.status === "skipped").length;
|
|
127
145
|
return {
|
|
128
146
|
total: results.length,
|
|
129
147
|
passed,
|
|
130
|
-
failed: results.
|
|
148
|
+
failed: results.filter((r) => r.status !== "skipped" && !r.passed).length,
|
|
149
|
+
skipped,
|
|
131
150
|
results,
|
|
132
151
|
};
|
|
133
152
|
}
|
|
@@ -301,12 +320,15 @@ export async function runEvalSuite(
|
|
|
301
320
|
evals = loaded.evals;
|
|
302
321
|
}
|
|
303
322
|
|
|
323
|
+
const needsRunner = evals.some((evalCase) => !evalCase.skipReason);
|
|
304
324
|
const runner =
|
|
305
325
|
opts.runner ??
|
|
306
|
-
(
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
326
|
+
(needsRunner
|
|
327
|
+
? await createAgentRunner({
|
|
328
|
+
actions: opts.actions ?? (await discoverActions(cwd)),
|
|
329
|
+
systemPrompt: opts.systemPrompt,
|
|
330
|
+
})
|
|
331
|
+
: createInertRunner());
|
|
310
332
|
|
|
311
333
|
const report = await runEvals(evals, runner, {
|
|
312
334
|
thresholdOverride: opts.thresholdOverride,
|
|
@@ -332,3 +354,16 @@ async function discoverActions(
|
|
|
332
354
|
return {};
|
|
333
355
|
}
|
|
334
356
|
}
|
|
357
|
+
|
|
358
|
+
function createInertRunner(): AgentRunner {
|
|
359
|
+
return {
|
|
360
|
+
engine: {} as AgentRunner["engine"],
|
|
361
|
+
model: "inert",
|
|
362
|
+
async runAgent() {
|
|
363
|
+
throw new Error("Eval unexpectedly requested the agent runner");
|
|
364
|
+
},
|
|
365
|
+
analyzeContext() {
|
|
366
|
+
throw new Error("Eval unexpectedly requested analyze context");
|
|
367
|
+
},
|
|
368
|
+
};
|
|
369
|
+
}
|
|
@@ -133,6 +133,12 @@ export interface EvalRunContext {
|
|
|
133
133
|
export interface Eval {
|
|
134
134
|
name: string;
|
|
135
135
|
input: EvalInput;
|
|
136
|
+
/**
|
|
137
|
+
* Skip this case without running the agent or scorers. Use for opt-in
|
|
138
|
+
* suites that need secrets, live provider credentials, or manual/nightly
|
|
139
|
+
* gates. Skipped rows are reported distinctly and do not fail the suite.
|
|
140
|
+
*/
|
|
141
|
+
skipReason?: string;
|
|
136
142
|
/**
|
|
137
143
|
* Optional override for how the agent is run for this case. Defaults to the
|
|
138
144
|
* runner's headless `runAgent`. Use this to do custom setup (seed data,
|
|
@@ -159,6 +165,10 @@ export interface EvalResultRow {
|
|
|
159
165
|
eval: string;
|
|
160
166
|
threshold: number;
|
|
161
167
|
scores: ScorerResult[];
|
|
168
|
+
/** Explicit row status for reports. Older consumers can still read `passed`. */
|
|
169
|
+
status?: "passed" | "failed" | "skipped";
|
|
170
|
+
/** Human-readable reason when `status` is `skipped`. */
|
|
171
|
+
skipReason?: string;
|
|
162
172
|
/** True only when every scorer passed. */
|
|
163
173
|
passed: boolean;
|
|
164
174
|
/** Mean of the scorer scores, for at-a-glance ranking. */
|
|
@@ -173,5 +183,6 @@ export interface EvalRunReport {
|
|
|
173
183
|
total: number;
|
|
174
184
|
passed: number;
|
|
175
185
|
failed: number;
|
|
186
|
+
skipped?: number;
|
|
176
187
|
results: EvalResultRow[];
|
|
177
188
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AgentLoopUsage } from "../agent/production-agent.js";
|
|
2
|
-
import type { AgentChatEvent } from "../agent/types.js";
|
|
2
|
+
import type { AgentChatEvent, AgentToolInput } from "../agent/types.js";
|
|
3
3
|
import { type AgentSpan, endAgentSpan, startAgentSpan } from "./tracing.js";
|
|
4
4
|
import type { TraceSpan, TraceSummary, ObservabilityConfig } from "./types.js";
|
|
5
5
|
import { DEFAULT_OBSERVABILITY_CONFIG } from "./types.js";
|
|
@@ -115,7 +115,7 @@ export async function instrumentAgentLoop(opts: {
|
|
|
115
115
|
spanId: string;
|
|
116
116
|
startMs: number;
|
|
117
117
|
toolName: string;
|
|
118
|
-
input:
|
|
118
|
+
input: AgentToolInput;
|
|
119
119
|
otelSpan: AgentSpan | null;
|
|
120
120
|
endResult?: { status: "success" | "error"; errorMessage: string | null };
|
|
121
121
|
}
|
|
@@ -148,7 +148,7 @@ export async function instrumentAgentLoop(opts: {
|
|
|
148
148
|
spanId: string;
|
|
149
149
|
startMs: number;
|
|
150
150
|
toolName: string;
|
|
151
|
-
input:
|
|
151
|
+
input: AgentToolInput;
|
|
152
152
|
otelSpan: AgentSpan | null;
|
|
153
153
|
// Set by the done handler if it fires before the span promise
|
|
154
154
|
// resolves, so the resolved span is ended with the correct status.
|
|
@@ -54,7 +54,7 @@ const LLM_KEY_METHODS: LlmKeyMethod[] = [
|
|
|
54
54
|
provider: "openrouter",
|
|
55
55
|
id: "openrouter-key",
|
|
56
56
|
label: "OpenRouter",
|
|
57
|
-
description: "OpenRouter models with your own
|
|
57
|
+
description: "OpenRouter models, including GLM 5.2, with your own key.",
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
provider: "groq",
|
|
@@ -54,7 +54,7 @@ export const tool: ActionTool = {
|
|
|
54
54
|
model: {
|
|
55
55
|
type: "string",
|
|
56
56
|
description:
|
|
57
|
-
"Model ID (e.g. 'gpt-5.5', 'claude-sonnet-
|
|
57
|
+
"Model ID (e.g. 'gpt-5.5', 'claude-sonnet-5', 'gemini-3-1-pro'). Required for \"set-app-default\"; optional for \"set\" and \"test\" where it defaults to the engine's default model.",
|
|
58
58
|
},
|
|
59
59
|
baseUrl: {
|
|
60
60
|
type: "string",
|
|
@@ -27,7 +27,7 @@ export const tool: ActionTool = {
|
|
|
27
27
|
model: {
|
|
28
28
|
type: "string",
|
|
29
29
|
description:
|
|
30
|
-
"Model ID to use with this engine (e.g. 'gpt-5.5', 'claude-sonnet-
|
|
30
|
+
"Model ID to use with this engine (e.g. 'gpt-5.5', 'claude-sonnet-5'). Defaults to the engine's default model if omitted.",
|
|
31
31
|
},
|
|
32
32
|
},
|
|
33
33
|
required: ["engine"],
|
|
@@ -3789,6 +3789,81 @@ export function shouldBlockInProductCodeEditingSurface(input: {
|
|
|
3789
3789
|
);
|
|
3790
3790
|
}
|
|
3791
3791
|
|
|
3792
|
+
type RecurringJobsRuntimeEnvKey =
|
|
3793
|
+
| "AGENT_NATIVE_DISABLE_RECURRING_JOBS"
|
|
3794
|
+
| "AGENT_NATIVE_ENABLE_LOCAL_RECURRING_JOBS"
|
|
3795
|
+
| "APP_URL"
|
|
3796
|
+
| "BETTER_AUTH_URL"
|
|
3797
|
+
| "DEPLOY_URL"
|
|
3798
|
+
| "NODE_ENV"
|
|
3799
|
+
| "URL"
|
|
3800
|
+
| "VITE_APP_URL"
|
|
3801
|
+
| "VITE_WORKSPACE_GATEWAY_URL"
|
|
3802
|
+
| "WORKSPACE_GATEWAY_URL";
|
|
3803
|
+
|
|
3804
|
+
type RecurringJobsRuntimeEnv = Partial<
|
|
3805
|
+
Record<RecurringJobsRuntimeEnvKey, string | undefined>
|
|
3806
|
+
>;
|
|
3807
|
+
|
|
3808
|
+
function isTruthyEnv(value: string | undefined): boolean {
|
|
3809
|
+
return /^(1|true|yes|on)$/i.test(value?.trim() ?? "");
|
|
3810
|
+
}
|
|
3811
|
+
|
|
3812
|
+
function isLoopbackAppUrl(value: string | undefined): boolean {
|
|
3813
|
+
const raw = value?.trim();
|
|
3814
|
+
if (!raw) return false;
|
|
3815
|
+
|
|
3816
|
+
const candidates = /^[a-z][a-z0-9+.-]*:\/\//i.test(raw)
|
|
3817
|
+
? [raw]
|
|
3818
|
+
: [raw, `http://${raw}`];
|
|
3819
|
+
for (const candidate of candidates) {
|
|
3820
|
+
try {
|
|
3821
|
+
const url = new URL(candidate);
|
|
3822
|
+
const host = url.hostname.toLowerCase().replace(/^\[|\]$/g, "");
|
|
3823
|
+
if (
|
|
3824
|
+
host === "localhost" ||
|
|
3825
|
+
host === "127.0.0.1" ||
|
|
3826
|
+
host === "0.0.0.0" ||
|
|
3827
|
+
host === "::1" ||
|
|
3828
|
+
host === "tauri.localhost" ||
|
|
3829
|
+
host.endsWith(".localhost")
|
|
3830
|
+
) {
|
|
3831
|
+
return true;
|
|
3832
|
+
}
|
|
3833
|
+
} catch {}
|
|
3834
|
+
}
|
|
3835
|
+
|
|
3836
|
+
return false;
|
|
3837
|
+
}
|
|
3838
|
+
|
|
3839
|
+
export function shouldDisableRecurringJobsRuntime(
|
|
3840
|
+
env: RecurringJobsRuntimeEnv = process.env,
|
|
3841
|
+
): boolean {
|
|
3842
|
+
if (isTruthyEnv(env.AGENT_NATIVE_DISABLE_RECURRING_JOBS)) return true;
|
|
3843
|
+
|
|
3844
|
+
const isLocalRuntime =
|
|
3845
|
+
env.NODE_ENV === "development" ||
|
|
3846
|
+
env.NODE_ENV === "test" ||
|
|
3847
|
+
[
|
|
3848
|
+
env.APP_URL,
|
|
3849
|
+
env.BETTER_AUTH_URL,
|
|
3850
|
+
env.DEPLOY_URL,
|
|
3851
|
+
env.URL,
|
|
3852
|
+
env.VITE_APP_URL,
|
|
3853
|
+
env.VITE_WORKSPACE_GATEWAY_URL,
|
|
3854
|
+
env.WORKSPACE_GATEWAY_URL,
|
|
3855
|
+
].some(isLoopbackAppUrl);
|
|
3856
|
+
|
|
3857
|
+
if (
|
|
3858
|
+
isLocalRuntime &&
|
|
3859
|
+
isTruthyEnv(env.AGENT_NATIVE_ENABLE_LOCAL_RECURRING_JOBS)
|
|
3860
|
+
) {
|
|
3861
|
+
return false;
|
|
3862
|
+
}
|
|
3863
|
+
|
|
3864
|
+
return isLocalRuntime;
|
|
3865
|
+
}
|
|
3866
|
+
|
|
3792
3867
|
export function createAgentChatPlugin(
|
|
3793
3868
|
options?: AgentChatPluginOptions,
|
|
3794
3869
|
): NitroPluginDef {
|
|
@@ -7994,56 +8069,69 @@ Non-code requests are still fine on this surface: read data, navigate the UI, su
|
|
|
7994
8069
|
}),
|
|
7995
8070
|
);
|
|
7996
8071
|
|
|
8072
|
+
const disableRecurringJobsRuntime = shouldDisableRecurringJobsRuntime();
|
|
8073
|
+
|
|
7997
8074
|
// ─── Recurring Jobs Scheduler ──────────────────────────────────────
|
|
7998
8075
|
// Poll every 60 seconds for due recurring jobs and execute them.
|
|
7999
8076
|
// Uses setInterval so it works in all deployment environments without
|
|
8000
8077
|
// requiring Nitro experimental tasks configuration.
|
|
8001
|
-
|
|
8002
|
-
|
|
8078
|
+
if (disableRecurringJobsRuntime) {
|
|
8079
|
+
if (process.env.DEBUG) {
|
|
8080
|
+
console.log(
|
|
8081
|
+
"[recurring-jobs] Scheduler disabled for local development",
|
|
8082
|
+
);
|
|
8083
|
+
}
|
|
8084
|
+
} else {
|
|
8085
|
+
try {
|
|
8086
|
+
const { processRecurringJobs } = await import("../jobs/scheduler.js");
|
|
8003
8087
|
|
|
8004
|
-
|
|
8005
|
-
|
|
8006
|
-
|
|
8007
|
-
|
|
8008
|
-
|
|
8009
|
-
|
|
8010
|
-
|
|
8011
|
-
|
|
8012
|
-
|
|
8013
|
-
|
|
8014
|
-
|
|
8015
|
-
|
|
8016
|
-
|
|
8017
|
-
|
|
8018
|
-
|
|
8019
|
-
|
|
8020
|
-
|
|
8021
|
-
|
|
8022
|
-
|
|
8023
|
-
|
|
8024
|
-
|
|
8025
|
-
|
|
8026
|
-
|
|
8027
|
-
|
|
8028
|
-
|
|
8029
|
-
|
|
8030
|
-
|
|
8031
|
-
|
|
8032
|
-
|
|
8033
|
-
|
|
8088
|
+
const schedulerDeps = {
|
|
8089
|
+
getActions: () => ({
|
|
8090
|
+
...templateScripts,
|
|
8091
|
+
...resourceScripts,
|
|
8092
|
+
...docsScripts,
|
|
8093
|
+
...(lazyContext ? frameworkContextTool : {}),
|
|
8094
|
+
...chatScripts,
|
|
8095
|
+
...jobTools,
|
|
8096
|
+
...automationTools,
|
|
8097
|
+
...notificationTools,
|
|
8098
|
+
...progressTools,
|
|
8099
|
+
...fetchTool,
|
|
8100
|
+
...webSearchTool,
|
|
8101
|
+
...toolActions,
|
|
8102
|
+
}),
|
|
8103
|
+
getSystemPrompt: async (owner: string) => {
|
|
8104
|
+
const resources = await loadResourcesForPrompt(
|
|
8105
|
+
owner,
|
|
8106
|
+
lazyContext,
|
|
8107
|
+
options?.appId,
|
|
8108
|
+
);
|
|
8109
|
+
const schemaBlock = lazyContext
|
|
8110
|
+
? ""
|
|
8111
|
+
: await buildSchemaBlock(owner, databaseToolsMode);
|
|
8112
|
+
return basePrompt + resources + schemaBlock;
|
|
8113
|
+
},
|
|
8114
|
+
apiKey: options?.apiKey,
|
|
8115
|
+
model: options?.model,
|
|
8116
|
+
appId: options?.appId,
|
|
8117
|
+
};
|
|
8034
8118
|
|
|
8035
|
-
|
|
8036
|
-
|
|
8037
|
-
|
|
8038
|
-
|
|
8039
|
-
|
|
8040
|
-
|
|
8041
|
-
|
|
8042
|
-
|
|
8043
|
-
|
|
8044
|
-
|
|
8045
|
-
|
|
8046
|
-
|
|
8119
|
+
// Start after a 10-second delay to let the server fully initialize
|
|
8120
|
+
setTimeout(() => {
|
|
8121
|
+
setInterval(() => {
|
|
8122
|
+
processRecurringJobs(schedulerDeps).catch((err) => {
|
|
8123
|
+
console.error(
|
|
8124
|
+
"[recurring-jobs] Scheduler error:",
|
|
8125
|
+
err?.message,
|
|
8126
|
+
);
|
|
8127
|
+
});
|
|
8128
|
+
}, 60_000);
|
|
8129
|
+
if (process.env.DEBUG)
|
|
8130
|
+
console.log("[recurring-jobs] Scheduler started (60s interval)");
|
|
8131
|
+
}, 10_000);
|
|
8132
|
+
} catch (err) {
|
|
8133
|
+
// Jobs module not available — skip silently
|
|
8134
|
+
}
|
|
8047
8135
|
}
|
|
8048
8136
|
|
|
8049
8137
|
// ─── Agent Teams orphan sweep ─────────────────────────────────────
|
|
@@ -8097,43 +8185,51 @@ Non-code requests are still fine on this surface: read data, navigate the UI, su
|
|
|
8097
8185
|
})();
|
|
8098
8186
|
|
|
8099
8187
|
// ─── Trigger Dispatcher (event-based automations) ─────────────────
|
|
8100
|
-
|
|
8101
|
-
|
|
8102
|
-
|
|
8103
|
-
|
|
8104
|
-
|
|
8105
|
-
|
|
8106
|
-
|
|
8107
|
-
|
|
8108
|
-
|
|
8109
|
-
|
|
8110
|
-
|
|
8111
|
-
|
|
8112
|
-
|
|
8113
|
-
|
|
8114
|
-
|
|
8115
|
-
|
|
8116
|
-
|
|
8117
|
-
|
|
8118
|
-
|
|
8119
|
-
|
|
8120
|
-
|
|
8121
|
-
|
|
8122
|
-
|
|
8123
|
-
|
|
8124
|
-
|
|
8125
|
-
|
|
8126
|
-
|
|
8127
|
-
|
|
8128
|
-
|
|
8129
|
-
|
|
8130
|
-
|
|
8131
|
-
|
|
8132
|
-
|
|
8133
|
-
|
|
8134
|
-
|
|
8135
|
-
|
|
8136
|
-
|
|
8188
|
+
if (disableRecurringJobsRuntime) {
|
|
8189
|
+
if (process.env.DEBUG) {
|
|
8190
|
+
console.log(
|
|
8191
|
+
"[triggers] Trigger dispatcher disabled for local development",
|
|
8192
|
+
);
|
|
8193
|
+
}
|
|
8194
|
+
} else {
|
|
8195
|
+
try {
|
|
8196
|
+
const { initTriggerDispatcher } =
|
|
8197
|
+
await import("../triggers/dispatcher.js");
|
|
8198
|
+
await initTriggerDispatcher({
|
|
8199
|
+
getActions: () => ({
|
|
8200
|
+
...templateScripts,
|
|
8201
|
+
...resourceScripts,
|
|
8202
|
+
...docsScripts,
|
|
8203
|
+
...(lazyContext ? frameworkContextTool : {}),
|
|
8204
|
+
...chatScripts,
|
|
8205
|
+
...jobTools,
|
|
8206
|
+
...automationTools,
|
|
8207
|
+
...notificationTools,
|
|
8208
|
+
...progressTools,
|
|
8209
|
+
...fetchTool,
|
|
8210
|
+
...webSearchTool,
|
|
8211
|
+
...toolActions,
|
|
8212
|
+
}),
|
|
8213
|
+
getSystemPrompt: async (owner: string) => {
|
|
8214
|
+
const resources = await loadResourcesForPrompt(
|
|
8215
|
+
owner,
|
|
8216
|
+
lazyContext,
|
|
8217
|
+
options?.appId,
|
|
8218
|
+
);
|
|
8219
|
+
const schemaBlock = lazyContext
|
|
8220
|
+
? ""
|
|
8221
|
+
: await buildSchemaBlock(owner, databaseToolsMode);
|
|
8222
|
+
return basePrompt + resources + schemaBlock;
|
|
8223
|
+
},
|
|
8224
|
+
apiKey: options?.apiKey,
|
|
8225
|
+
model: options?.model,
|
|
8226
|
+
appId: options?.appId,
|
|
8227
|
+
});
|
|
8228
|
+
if (process.env.DEBUG)
|
|
8229
|
+
console.log("[triggers] Trigger dispatcher initialized");
|
|
8230
|
+
} catch (err) {
|
|
8231
|
+
// Triggers module not available — skip silently
|
|
8232
|
+
}
|
|
8137
8233
|
}
|
|
8138
8234
|
})().catch((err) => {
|
|
8139
8235
|
// If the init fails, the routes never get registered and requests
|
|
@@ -715,6 +715,9 @@ export interface CoreRoutesPluginOptions {
|
|
|
715
715
|
/** Per-template override mapping deep-link params → client SPA path.
|
|
716
716
|
* See `createOpenRouteHandler`. */
|
|
717
717
|
resolveOpenPath?: import("./open-route.js").OpenRouteOptions["resolveOpenPath"];
|
|
718
|
+
/** Per-template allowlist for open-route targets that may redirect without
|
|
719
|
+
* a browser session. See `createOpenRouteHandler`. */
|
|
720
|
+
allowUnauthenticatedOpen?: import("./open-route.js").OpenRouteOptions["allowUnauthenticatedOpen"];
|
|
718
721
|
/** Env key configuration. Enables env-status and env-vars routes. */
|
|
719
722
|
envKeys?: EnvKeyConfig[];
|
|
720
723
|
/**
|
|
@@ -3196,7 +3199,10 @@ export function createCoreRoutesPlugin(
|
|
|
3196
3199
|
// guard bypasses this exact path so it can serve its own login form.
|
|
3197
3200
|
getH3App(nitroApp).use(
|
|
3198
3201
|
`${P}/open`,
|
|
3199
|
-
createOpenRouteHandler({
|
|
3202
|
+
createOpenRouteHandler({
|
|
3203
|
+
resolveOpenPath: options.resolveOpenPath,
|
|
3204
|
+
allowUnauthenticatedOpen: options.allowUnauthenticatedOpen,
|
|
3205
|
+
}),
|
|
3200
3206
|
);
|
|
3201
3207
|
}
|
|
3202
3208
|
|
|
@@ -73,6 +73,15 @@ export interface OpenRouteOptions {
|
|
|
73
73
|
view?: string;
|
|
74
74
|
params: Record<string, string>;
|
|
75
75
|
}) => string | null | undefined;
|
|
76
|
+
/** Per-template escape hatch for public deep-link targets. Return true only
|
|
77
|
+
* when the resolved SPA target is safe to show without a session. The open
|
|
78
|
+
* route will redirect without writing application state. */
|
|
79
|
+
allowUnauthenticatedOpen?: (params: {
|
|
80
|
+
app?: string;
|
|
81
|
+
view?: string;
|
|
82
|
+
params: Record<string, string>;
|
|
83
|
+
target: string;
|
|
84
|
+
}) => boolean | Promise<boolean>;
|
|
76
85
|
}
|
|
77
86
|
|
|
78
87
|
function getRequestUrl(event: H3Event): string {
|
|
@@ -180,11 +189,60 @@ export function createOpenRouteHandler(options: OpenRouteOptions = {}) {
|
|
|
180
189
|
const toParam = search.get("to") ?? undefined;
|
|
181
190
|
const compose = search.get("compose") ?? undefined;
|
|
182
191
|
|
|
192
|
+
// Build the navigation payload from every non-reserved query param
|
|
193
|
+
// (record ids + filters: threadId, eventId, dashboardId, f_*, ...).
|
|
194
|
+
const navParams: Record<string, string> = {};
|
|
195
|
+
for (const [k, v] of search.entries()) {
|
|
196
|
+
if (RESERVED.has(k)) continue;
|
|
197
|
+
navParams[k] = v;
|
|
198
|
+
}
|
|
199
|
+
const navPayload: Record<string, unknown> = { ...navParams };
|
|
200
|
+
if (view) navPayload.view = view;
|
|
201
|
+
|
|
202
|
+
// Resolve the SPA path to redirect to.
|
|
203
|
+
let target =
|
|
204
|
+
safeRelativePath(toParam) ??
|
|
205
|
+
safeRelativePath(
|
|
206
|
+
options.resolveOpenPath?.({ app, view, params: navParams }) ??
|
|
207
|
+
(view ? `/${view}` : null),
|
|
208
|
+
) ??
|
|
209
|
+
"/";
|
|
210
|
+
|
|
211
|
+
// Forward filter params (f_*) onto the redirect so dashboards/lists open
|
|
212
|
+
// pre-filtered even before the navigate command is drained.
|
|
213
|
+
const filters = new URLSearchParams();
|
|
214
|
+
for (const [k, v] of search.entries()) {
|
|
215
|
+
if (k.startsWith("f_")) filters.set(k, v);
|
|
216
|
+
}
|
|
217
|
+
target = appendSearchParams(target, filters);
|
|
218
|
+
const embedParams = new URLSearchParams();
|
|
219
|
+
for (const key of [
|
|
220
|
+
EMBED_MODE_QUERY_PARAM,
|
|
221
|
+
EMBED_TOKEN_QUERY_PARAM,
|
|
222
|
+
MCP_APP_CHAT_BRIDGE_QUERY_PARAM,
|
|
223
|
+
]) {
|
|
224
|
+
const value = search.get(key);
|
|
225
|
+
if (value) embedParams.set(key, value);
|
|
226
|
+
}
|
|
227
|
+
target = appendSearchParams(target, embedParams);
|
|
228
|
+
target = withCollapsedAgentSidebarParam(target);
|
|
229
|
+
target = withConfiguredRedirectBasePath(target);
|
|
230
|
+
|
|
183
231
|
// Resolve the BROWSER session. When unauthenticated, serve the same login
|
|
184
232
|
// form the guard would — at this URL — so the post-login reload returns
|
|
185
|
-
// here authenticated.
|
|
233
|
+
// here authenticated. Public templates may opt specific deep-link targets
|
|
234
|
+
// into anonymous redirect; no app-state writes happen without a session.
|
|
186
235
|
const session = await getSession(event);
|
|
187
236
|
if (!session?.email) {
|
|
237
|
+
const allowAnonymous = await options.allowUnauthenticatedOpen?.({
|
|
238
|
+
app,
|
|
239
|
+
view,
|
|
240
|
+
params: navParams,
|
|
241
|
+
target,
|
|
242
|
+
});
|
|
243
|
+
if (allowAnonymous) {
|
|
244
|
+
return redirect(event, target, requestHasEmbedAuthMarker(event));
|
|
245
|
+
}
|
|
188
246
|
const html = getConfiguredLoginHtml(event);
|
|
189
247
|
if (html) {
|
|
190
248
|
return new Response(html, {
|
|
@@ -196,16 +254,6 @@ export function createOpenRouteHandler(options: OpenRouteOptions = {}) {
|
|
|
196
254
|
// the user to the view; nothing to scope the navigate write to.
|
|
197
255
|
}
|
|
198
256
|
|
|
199
|
-
// Build the navigation payload from every non-reserved query param
|
|
200
|
-
// (record ids + filters: threadId, eventId, dashboardId, f_*, ...).
|
|
201
|
-
const navParams: Record<string, string> = {};
|
|
202
|
-
for (const [k, v] of search.entries()) {
|
|
203
|
-
if (RESERVED.has(k)) continue;
|
|
204
|
-
navParams[k] = v;
|
|
205
|
-
}
|
|
206
|
-
const navPayload: Record<string, unknown> = { ...navParams };
|
|
207
|
-
if (view) navPayload.view = view;
|
|
208
|
-
|
|
209
257
|
if (session?.email) {
|
|
210
258
|
try {
|
|
211
259
|
await appStatePut(session.email, "navigate", navPayload, {
|
|
@@ -258,35 +306,6 @@ export function createOpenRouteHandler(options: OpenRouteOptions = {}) {
|
|
|
258
306
|
}
|
|
259
307
|
}
|
|
260
308
|
|
|
261
|
-
// Resolve the SPA path to redirect to.
|
|
262
|
-
let target =
|
|
263
|
-
safeRelativePath(toParam) ??
|
|
264
|
-
safeRelativePath(
|
|
265
|
-
options.resolveOpenPath?.({ app, view, params: navParams }) ??
|
|
266
|
-
(view ? `/${view}` : null),
|
|
267
|
-
) ??
|
|
268
|
-
"/";
|
|
269
|
-
|
|
270
|
-
// Forward filter params (f_*) onto the redirect so dashboards/lists open
|
|
271
|
-
// pre-filtered even before the navigate command is drained.
|
|
272
|
-
const filters = new URLSearchParams();
|
|
273
|
-
for (const [k, v] of search.entries()) {
|
|
274
|
-
if (k.startsWith("f_")) filters.set(k, v);
|
|
275
|
-
}
|
|
276
|
-
target = appendSearchParams(target, filters);
|
|
277
|
-
const embedParams = new URLSearchParams();
|
|
278
|
-
for (const key of [
|
|
279
|
-
EMBED_MODE_QUERY_PARAM,
|
|
280
|
-
EMBED_TOKEN_QUERY_PARAM,
|
|
281
|
-
MCP_APP_CHAT_BRIDGE_QUERY_PARAM,
|
|
282
|
-
]) {
|
|
283
|
-
const value = search.get(key);
|
|
284
|
-
if (value) embedParams.set(key, value);
|
|
285
|
-
}
|
|
286
|
-
target = appendSearchParams(target, embedParams);
|
|
287
|
-
target = withCollapsedAgentSidebarParam(target);
|
|
288
|
-
target = withConfiguredRedirectBasePath(target);
|
|
289
|
-
|
|
290
309
|
return redirect(event, target, requestHasEmbedAuthMarker(event));
|
|
291
310
|
});
|
|
292
311
|
}
|
|
@@ -113,6 +113,8 @@ function supportsClaudeXHigh(model: string) {
|
|
|
113
113
|
// silently falling back to the lower "high" tier.
|
|
114
114
|
// claude-fable-5 is a Mythos-class model and also supports xhigh.
|
|
115
115
|
if (model.includes("fable-5")) return true;
|
|
116
|
+
// Sonnet 5 supports the expanded effort ladder through Builder/Anthropic.
|
|
117
|
+
if (model.includes("sonnet-5")) return true;
|
|
116
118
|
// opus-4-7 introduced xhigh; all opus-4.x successors (4-8, 4-9…) should too.
|
|
117
119
|
const opusMatch = model.match(/opus-4-(\d+)/);
|
|
118
120
|
if (opusMatch) {
|
|
@@ -233,6 +233,23 @@ export interface ResolvedAccess {
|
|
|
233
233
|
resource: any;
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
+
async function publicAccessRoleForResource(
|
|
237
|
+
reg: ShareableResourceRegistration,
|
|
238
|
+
resource: any,
|
|
239
|
+
ctx: AccessContext,
|
|
240
|
+
): Promise<ShareRole> {
|
|
241
|
+
const roleResolver = reg.publicAccessRole;
|
|
242
|
+
if (!roleResolver) return "viewer";
|
|
243
|
+
return typeof roleResolver === "function"
|
|
244
|
+
? await roleResolver(resource, ctx)
|
|
245
|
+
: roleResolver;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
function higherShareRole(a: ShareRole, b: ShareRole | null): ShareRole {
|
|
249
|
+
if (!b) return a;
|
|
250
|
+
return ROLE_RANK[b] > ROLE_RANK[a] ? b : a;
|
|
251
|
+
}
|
|
252
|
+
|
|
236
253
|
/**
|
|
237
254
|
* Return the effective role the current user has on a specific resource, or
|
|
238
255
|
* null if they have no access. Loads the resource and relevant share rows.
|
|
@@ -263,9 +280,12 @@ export async function resolveAccess(
|
|
|
263
280
|
return { role: "owner", resource };
|
|
264
281
|
}
|
|
265
282
|
if (resource.visibility === "public" && reg.allowPublic !== false) {
|
|
266
|
-
// No share row needed; default viewer unless
|
|
283
|
+
// No share row needed; default viewer unless the resource registration
|
|
284
|
+
// deliberately grants a stronger public-by-link role or explicit shares
|
|
285
|
+
// upgrade the current principal.
|
|
286
|
+
const publicRole = await publicAccessRoleForResource(reg, resource, ctx);
|
|
267
287
|
const role = await highestShareRole(reg, resourceId, ctx, resource);
|
|
268
|
-
return { role: role
|
|
288
|
+
return { role: higherShareRole(publicRole, role), resource };
|
|
269
289
|
}
|
|
270
290
|
// `visibility === "public"` on an `allowPublic: false` resource is treated
|
|
271
291
|
// as private: only owner + explicit shares grant access. Falls through to
|