@agent-native/core 0.132.2 → 0.133.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/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +161 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/a2a/correlation.ts +11 -1
- package/corpus/core/src/a2a/types.ts +11 -3
- package/corpus/core/src/agent/engine/ai-sdk-engine.ts +33 -46
- package/corpus/core/src/agent/engine/builder-engine.ts +22 -10
- package/corpus/core/src/agent/engine/error-detail.ts +184 -3
- package/corpus/core/src/agent/engine/failure-taxonomy.ts +123 -0
- package/corpus/core/src/agent/engine/index.ts +8 -0
- package/corpus/core/src/agent/engine/registry.ts +92 -8
- package/corpus/core/src/agent/engine/translate-ai-sdk.ts +17 -2
- package/corpus/core/src/agent/production-agent.ts +13 -33
- package/corpus/core/src/agent/run-loop-with-resume.ts +1 -1
- package/corpus/core/src/agent/run-manager.ts +43 -14
- package/corpus/core/src/agent/run-store.ts +30 -3
- package/corpus/core/src/agent/thread-data-builder.ts +36 -4
- package/corpus/core/src/cli/templates-meta.ts +13 -0
- package/corpus/core/src/cli/workspace-dev.ts +1 -0
- package/corpus/core/src/client/error-format.ts +12 -0
- package/corpus/core/src/credentials/index.ts +51 -12
- package/corpus/core/src/extensions/url-safety.ts +46 -12
- package/corpus/core/src/integrations/adapters/slack.ts +32 -10
- package/corpus/core/src/integrations/google-docs-poller.ts +12 -1
- package/corpus/core/src/integrations/installations-store.ts +30 -0
- package/corpus/core/src/integrations/plugin.ts +5 -5
- package/corpus/core/src/integrations/types.ts +7 -0
- package/corpus/core/src/integrations/webhook-handler.ts +24 -1
- package/corpus/core/src/jobs/background-automation-runner.ts +38 -1
- package/corpus/core/src/provider-api/index.ts +8 -2
- package/corpus/core/src/scripts/call-agent.ts +6 -0
- package/corpus/core/src/server/agent-chat-plugin.ts +30 -9
- package/corpus/core/src/server/agent-discovery.ts +2 -0
- package/corpus/core/src/server/builder-design-systems.ts +21 -0
- package/corpus/core/src/server/credential-provider.ts +51 -12
- package/corpus/core/src/server/index.ts +1 -0
- package/corpus/core/src/server/onboarding-html.ts +37 -2
- package/corpus/core/src/shared/reasoning-effort.ts +1 -1
- package/corpus/core/src/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +11 -0
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +6 -2
- package/corpus/templates/assets/app/components/layout/Sidebar.tsx +39 -19
- package/corpus/templates/assets/changelog/2026-07-31-the-agent-native-logo-stays-visible-when-the-sidebar-is-coll.md +6 -0
- package/corpus/templates/brain/app/components/layout/Sidebar.tsx +30 -3
- package/corpus/templates/brain/changelog/2026-07-31-clicking-the-agent-native-logo-now-toggles-the-app-sidebar.md +6 -0
- package/corpus/templates/calendar/app/components/layout/AppLayout.tsx +1 -1
- package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +54 -25
- package/corpus/templates/calendar/changelog/2026-07-31-the-agent-native-logo-stays-visible-when-the-sidebar-is-coll.md +6 -0
- package/corpus/templates/chat/app/components/layout/Sidebar.tsx +30 -3
- package/corpus/templates/chat/changelog/2026-07-31-clicking-the-agent-native-logo-now-toggles-the-app-sidebar.md +6 -0
- package/corpus/templates/clips/app/components/library/library-layout.tsx +37 -21
- package/corpus/templates/clips/changelog/2026-07-31-the-agent-native-logo-stays-visible-when-the-sidebar-is-coll.md +6 -0
- package/corpus/templates/clips/desktop/src/hooks/useMediaDevices.ts +1 -1
- package/corpus/templates/clips/desktop/src/lib/media-capture-constraints.ts +1 -1
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +34 -17
- package/corpus/templates/content/changelog/2026-07-31-the-agent-native-logo-stays-visible-when-the-sidebar-is-coll.md +6 -0
- package/corpus/templates/design/.agents/skills/design-systems/SKILL.md +6 -2
- package/corpus/templates/design/actions/create-design-system.ts +1 -0
- package/corpus/templates/design/actions/set-default-design-system.ts +34 -26
- package/corpus/templates/design/app/components/layout/Sidebar.tsx +21 -4
- package/corpus/templates/design/app/i18n-data.ts +39 -0
- package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +229 -12
- package/corpus/templates/design/app/pages/DesignSystems.tsx +10 -4
- package/corpus/templates/design/changelog/2026-07-31-clicking-the-agent-native-logo-now-toggles-the-app-sidebar.md +6 -0
- package/corpus/templates/design/changelog/2026-07-31-design-system-indexing-keeps-your-chosen-name-when-you-uploa.md +6 -0
- package/corpus/templates/design/server/lib/builder-design-system-proxy.ts +19 -4
- package/corpus/templates/dispatch/AGENTS.md +4 -0
- package/corpus/templates/factory/.agents/skills/actions/SKILL.md +562 -0
- package/corpus/templates/factory/.agents/skills/adding-a-feature/SKILL.md +198 -0
- package/corpus/templates/factory/.agents/skills/agent-native-docs/SKILL.md +115 -0
- package/corpus/templates/factory/.agents/skills/agent-native-toolkit/SKILL.md +182 -0
- package/corpus/templates/factory/.agents/skills/capture-learnings/SKILL.md +89 -0
- package/corpus/templates/factory/.agents/skills/create-skill/SKILL.md +221 -0
- package/corpus/templates/factory/.agents/skills/customizing-agent-native/SKILL.md +220 -0
- package/corpus/templates/factory/.agents/skills/delegate-to-agent/SKILL.md +263 -0
- package/corpus/templates/factory/.agents/skills/factory-graphs/SKILL.md +52 -0
- package/corpus/templates/factory/.agents/skills/feature-flags/SKILL.md +169 -0
- package/corpus/templates/factory/.agents/skills/frontend-design/SKILL.md +174 -0
- package/corpus/templates/factory/.agents/skills/real-time-sync/SKILL.md +232 -0
- package/corpus/templates/factory/.agents/skills/security/SKILL.md +324 -0
- package/corpus/templates/factory/.agents/skills/self-modifying-code/SKILL.md +119 -0
- package/corpus/templates/factory/.agents/skills/shadcn-ui/SKILL.md +123 -0
- package/corpus/templates/factory/.agents/skills/sharing/SKILL.md +232 -0
- package/corpus/templates/factory/.agents/skills/storing-data/SKILL.md +178 -0
- package/corpus/templates/factory/.agents/skills/upgrade-agent-native/SKILL.md +122 -0
- package/corpus/templates/factory/.env.example +24 -0
- package/corpus/templates/factory/.ignore +0 -0
- package/corpus/templates/factory/.oxfmtrc.json +8 -0
- package/corpus/templates/factory/AGENTS.md +90 -0
- package/corpus/templates/factory/CHANGELOG.md +10 -0
- package/corpus/templates/factory/DEVELOPING.md +185 -0
- package/corpus/templates/factory/README.md +64 -0
- package/corpus/templates/factory/_gitignore +42 -0
- package/corpus/templates/factory/actions/add-factory-comment.ts +55 -0
- package/corpus/templates/factory/actions/approve-factory-item.ts +214 -0
- package/corpus/templates/factory/actions/babysit-pull-request.ts +126 -0
- package/corpus/templates/factory/actions/evaluate-triage-item.ts +172 -0
- package/corpus/templates/factory/actions/get-factory-graph.ts +62 -0
- package/corpus/templates/factory/actions/get-triage-config.ts +42 -0
- package/corpus/templates/factory/actions/get-triage-item.ts +74 -0
- package/corpus/templates/factory/actions/hello.ts +13 -0
- package/corpus/templates/factory/actions/ingest-github-observation.ts +100 -0
- package/corpus/templates/factory/actions/list-factories.ts +40 -0
- package/corpus/templates/factory/actions/list-factory-comments.ts +40 -0
- package/corpus/templates/factory/actions/list-triage-items.ts +85 -0
- package/corpus/templates/factory/actions/list-triage-rules.ts +44 -0
- package/corpus/templates/factory/actions/navigate.ts +41 -0
- package/corpus/templates/factory/actions/poll-slack-channel.ts +118 -0
- package/corpus/templates/factory/actions/reconcile-triage-run.ts +179 -0
- package/corpus/templates/factory/actions/record-triage-feedback.ts +58 -0
- package/corpus/templates/factory/actions/run.ts +2 -0
- package/corpus/templates/factory/actions/save-factory-graph.ts +129 -0
- package/corpus/templates/factory/actions/save-triage-config.ts +67 -0
- package/corpus/templates/factory/actions/save-triage-rule.ts +89 -0
- package/corpus/templates/factory/actions/suggest-factory-rules.ts +70 -0
- package/corpus/templates/factory/actions/view-screen.ts +73 -0
- package/corpus/templates/factory/app/components/factory/FactoryCanvas.tsx +441 -0
- package/corpus/templates/factory/app/components/factory/FactoryInspector.tsx +388 -0
- package/corpus/templates/factory/app/components/layout/Header.tsx +60 -0
- package/corpus/templates/factory/app/components/layout/Layout.tsx +190 -0
- package/corpus/templates/factory/app/components/layout/Sidebar.tsx +538 -0
- package/corpus/templates/factory/app/components/triage/triage-status-pill.tsx +28 -0
- package/corpus/templates/factory/app/components/ui/button.tsx +1 -0
- package/corpus/templates/factory/app/components/ui/card.tsx +1 -0
- package/corpus/templates/factory/app/components/ui/dropdown-menu.tsx +1 -0
- package/corpus/templates/factory/app/components/ui/input.tsx +1 -0
- package/corpus/templates/factory/app/components/ui/label.tsx +1 -0
- package/corpus/templates/factory/app/components/ui/sheet.tsx +1 -0
- package/corpus/templates/factory/app/components/ui/textarea.tsx +1 -0
- package/corpus/templates/factory/app/components/ui/toolkit-provider.tsx +17 -0
- package/corpus/templates/factory/app/components/ui/tooltip.tsx +1 -0
- package/corpus/templates/factory/app/design-system.ts +3 -0
- package/corpus/templates/factory/app/entry.client.tsx +22 -0
- package/corpus/templates/factory/app/entry.server.tsx +10 -0
- package/corpus/templates/factory/app/global.css +93 -0
- package/corpus/templates/factory/app/hooks/use-navigation-state.ts +113 -0
- package/corpus/templates/factory/app/i18n/en-US.ts +211 -0
- package/corpus/templates/factory/app/i18n/index.ts +34 -0
- package/corpus/templates/factory/app/i18n-data.ts +556 -0
- package/corpus/templates/factory/app/lib/agent-page.tsx +49 -0
- package/corpus/templates/factory/app/lib/app-config.ts +11 -0
- package/corpus/templates/factory/app/lib/tab-id.ts +1 -0
- package/corpus/templates/factory/app/lib/utils.ts +1 -0
- package/corpus/templates/factory/app/root.tsx +175 -0
- package/corpus/templates/factory/app/routes/_index.tsx +94 -0
- package/corpus/templates/factory/app/routes/agent.tsx +24 -0
- package/corpus/templates/factory/app/routes/chat.$threadId.tsx +1 -0
- package/corpus/templates/factory/app/routes/database.tsx +17 -0
- package/corpus/templates/factory/app/routes/extensions.$id.$slug.tsx +2 -0
- package/corpus/templates/factory/app/routes/extensions.$id.tsx +11 -0
- package/corpus/templates/factory/app/routes/extensions._index.tsx +11 -0
- package/corpus/templates/factory/app/routes/extensions.tsx +5 -0
- package/corpus/templates/factory/app/routes/factory.tsx +1003 -0
- package/corpus/templates/factory/app/routes/observability.tsx +19 -0
- package/corpus/templates/factory/app/routes/settings.tsx +89 -0
- package/corpus/templates/factory/app/routes/team.tsx +11 -0
- package/corpus/templates/factory/app/routes.ts +4 -0
- package/corpus/templates/factory/app/vite-env.d.ts +6 -0
- package/corpus/templates/factory/changelog/2026-06-24-a-new-settings-page-gives-quick-access-to-language-workspace.md +6 -0
- package/corpus/templates/factory/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
- package/corpus/templates/factory/changelog/2026-06-27-traditional-chinese-copy-uses-taiwan-terminology.md +6 -0
- package/corpus/templates/factory/changelog/2026-06-28-left-sidebar-collapse-motion-and-footer-chrome-are-quieter.md +6 -0
- package/corpus/templates/factory/changelog/2026-06-29-chat-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-08-settings-are-cleaner-and-searchable.md +5 -0
- package/corpus/templates/factory/changelog/2026-07-10-chat-now-makes-ai-connection-setup-clear-without-shifting-th.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-13-a-full-agent-page-now-brings-context-files-connections-jobs-.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-14-chat-opens-reliably-on-hosted-deployments-instead-of-failing.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-14-fixed-chat-template-startup-with-older-core-versions.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-15-chat-navigation-focuses-on-chat-and-agent.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-17-the-agent-chat-sidebar-stays-closed-until-you-open-it-or-sta.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-22-compact-sidebar-footer.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-22-full-page-chat-keeps-the-active-conversation-when-moving-to-.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-22-manage-agent-navigation-now-uses-the-connected-nodes-icon.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-22-recent-chats-are-easier-to-scan-and-expand.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-23-full-page-chat-is-better-centered-with-quieter-chat-history-.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-31-added-an-inspectable-observe-only-factory-queue-for-slack-.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-31-clicking-the-agent-native-logo-now-toggles-the-app-sidebar.md +6 -0
- package/corpus/templates/factory/components.json +20 -0
- package/corpus/templates/factory/data/sync-config.json +1 -0
- package/corpus/templates/factory/learnings.defaults.md +5 -0
- package/corpus/templates/factory/netlify.toml +10 -0
- package/corpus/templates/factory/package.json +105 -0
- package/corpus/templates/factory/public/agent-native-icon-dark.svg +10 -0
- package/corpus/templates/factory/public/agent-native-icon-light.svg +10 -0
- package/corpus/templates/factory/public/agent-native-logo-dark.svg +21 -0
- package/corpus/templates/factory/public/agent-native-logo-light.svg +21 -0
- package/corpus/templates/factory/public/favicon.svg +1 -0
- package/corpus/templates/factory/public/icon-180.svg +1 -0
- package/corpus/templates/factory/public/icon-192.svg +1 -0
- package/corpus/templates/factory/public/icon-512.svg +1 -0
- package/corpus/templates/factory/public/manifest.json +21 -0
- package/corpus/templates/factory/react-router.config.ts +7 -0
- package/corpus/templates/factory/server/connectors/credentials.ts +129 -0
- package/corpus/templates/factory/server/connectors/slack.ts +129 -0
- package/corpus/templates/factory/server/db/index.ts +6 -0
- package/corpus/templates/factory/server/db/schema.ts +193 -0
- package/corpus/templates/factory/server/factory-graph/contracts.ts +212 -0
- package/corpus/templates/factory/server/factory-graph/store.ts +121 -0
- package/corpus/templates/factory/server/lib/require-workspace-member.ts +55 -0
- package/corpus/templates/factory/server/middleware/auth.ts +15 -0
- package/corpus/templates/factory/server/plugins/agent-chat.ts +58 -0
- package/corpus/templates/factory/server/plugins/auth.ts +14 -0
- package/corpus/templates/factory/server/plugins/factory-migrations.ts +247 -0
- package/corpus/templates/factory/server/plugins/factory-scheduler-job.ts +116 -0
- package/corpus/templates/factory/server/plugins/integrations.ts +46 -0
- package/corpus/templates/factory/server/routes/[...page].get.ts +5 -0
- package/corpus/templates/factory/server/routes/_agent-native/factory/builder-callback.post.ts +116 -0
- package/corpus/templates/factory/server/triage/ai-services-git.ts +197 -0
- package/corpus/templates/factory/server/triage/builder-executor.ts +118 -0
- package/corpus/templates/factory/server/triage/contracts.ts +164 -0
- package/corpus/templates/factory/server/triage/github-ingestion.ts +35 -0
- package/corpus/templates/factory/server/triage/guards.ts +121 -0
- package/corpus/templates/factory/server/triage/ids.ts +27 -0
- package/corpus/templates/factory/server/triage/pr-babysit.ts +100 -0
- package/corpus/templates/factory/server/triage/pr-monitor.ts +220 -0
- package/corpus/templates/factory/server/triage/slack-client.ts +55 -0
- package/corpus/templates/factory/server/triage/slack-poller.ts +152 -0
- package/corpus/templates/factory/ssr-entry.ts +15 -0
- package/corpus/templates/factory/tsconfig.json +21 -0
- package/corpus/templates/factory/vite.config.ts +19 -0
- package/corpus/templates/forms/app/components/layout/Sidebar.tsx +55 -5
- package/corpus/templates/forms/changelog/2026-07-31-the-agent-native-logo-stays-visible-when-the-sidebar-is-coll.md +6 -0
- package/corpus/templates/macros/app/components/layout/AppLayout.tsx +6 -2
- package/corpus/templates/plan/app/components/layout/Sidebar.tsx +21 -6
- package/corpus/templates/plan/changelog/2026-07-31-clicking-the-agent-native-logo-now-toggles-the-app-sidebar.md +6 -0
- package/corpus/templates/slides/.agents/skills/create-deck/SKILL.md +12 -0
- package/corpus/templates/slides/.agents/skills/design-systems/SKILL.md +9 -0
- package/corpus/templates/slides/.agents/skills/slide-editing/SKILL.md +11 -0
- package/corpus/templates/slides/AGENTS.md +5 -6
- package/corpus/templates/slides/actions/_await-fit-check.ts +20 -10
- package/corpus/templates/slides/actions/add-slide.ts +17 -4
- package/corpus/templates/slides/actions/create-design-system.ts +16 -4
- package/corpus/templates/slides/actions/delete-design-system.ts +18 -2
- package/corpus/templates/slides/actions/get-layout-overflows.ts +88 -0
- package/corpus/templates/slides/actions/import-file.ts +1 -0
- package/corpus/templates/slides/actions/index-design-system-with-builder.ts +8 -0
- package/corpus/templates/slides/actions/patch-deck.ts +48 -16
- package/corpus/templates/slides/actions/set-default-design-system.ts +49 -19
- package/corpus/templates/slides/actions/update-slide.ts +13 -3
- package/corpus/templates/slides/actions/view-screen.ts +87 -10
- package/corpus/templates/slides/app/components/deck/SlideRenderer.tsx +155 -28
- package/corpus/templates/slides/app/components/design-system/DesignSystemCard.tsx +21 -17
- package/corpus/templates/slides/app/components/design-system/DesignSystemSetup.tsx +849 -341
- package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +102 -2
- package/corpus/templates/slides/app/components/editor/PromptDialog.tsx +13 -16
- package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +60 -12
- package/corpus/templates/slides/app/components/editor/SlideOverflowWarning.tsx +11 -1
- package/corpus/templates/slides/app/components/layout/Sidebar.tsx +66 -19
- package/corpus/templates/slides/app/i18n/en-US.ts +23 -0
- package/corpus/templates/slides/app/lib/normalize-slide-padding.ts +8 -15
- package/corpus/templates/slides/app/pages/DeckEditor.tsx +4 -3
- package/corpus/templates/slides/app/pages/DesignSystems.tsx +4 -3
- package/corpus/templates/slides/app/pages/Index.tsx +1 -1
- package/corpus/templates/slides/changelog/2026-07-31-design-system-details-now-show-their-source-and-indexing-sta.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-31-design-system-indexing-keeps-your-chosen-name-when-you-uploa.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-31-design-system-setup-keeps-focus-rings-visible-and-uses-a-sim.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-31-skip-prompt-is-now-available-in-the-new-deck-prompt-header.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-31-slides-now-detect-real-text-and-box-overflow-across-the-deck.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-31-the-agent-native-logo-stays-visible-when-the-sidebar-is-coll.md +6 -0
- package/corpus/templates/slides/server/handlers/design-systems.ts +1 -0
- package/corpus/templates/slides/server/handlers/index-design-system-sources.ts +1 -0
- package/corpus/templates/slides/server/lib/builder-design-system-proxy.ts +23 -4
- package/corpus/templates/slides/server/plugins/agent-chat.ts +5 -0
- package/corpus/templates/slides/server/plugins/creative-context.ts +16 -3
- package/corpus/templates/slides/server/workspace-defaults.ts +5 -1
- package/corpus/templates/slides/shared/slide-fit.ts +26 -0
- package/corpus/templates/tasks/app/components/layout/Sidebar.tsx +30 -3
- package/corpus/templates/tasks/changelog/2026-07-31-clicking-the-agent-native-logo-now-toggles-the-app-sidebar.md +6 -0
- package/dist/a2a/correlation.d.ts +4 -1
- package/dist/a2a/correlation.d.ts.map +1 -1
- package/dist/a2a/correlation.js +8 -1
- package/dist/a2a/correlation.js.map +1 -1
- package/dist/a2a/types.d.ts +11 -3
- package/dist/a2a/types.d.ts.map +1 -1
- package/dist/a2a/types.js.map +1 -1
- package/dist/agent/engine/ai-sdk-engine.d.ts.map +1 -1
- package/dist/agent/engine/ai-sdk-engine.js +27 -41
- package/dist/agent/engine/ai-sdk-engine.js.map +1 -1
- package/dist/agent/engine/builder-engine.d.ts.map +1 -1
- package/dist/agent/engine/builder-engine.js +18 -8
- package/dist/agent/engine/builder-engine.js.map +1 -1
- package/dist/agent/engine/error-detail.d.ts +61 -0
- package/dist/agent/engine/error-detail.d.ts.map +1 -1
- package/dist/agent/engine/error-detail.js +145 -3
- package/dist/agent/engine/error-detail.js.map +1 -1
- package/dist/agent/engine/failure-taxonomy.d.ts +24 -0
- package/dist/agent/engine/failure-taxonomy.d.ts.map +1 -0
- package/dist/agent/engine/failure-taxonomy.js +88 -0
- package/dist/agent/engine/failure-taxonomy.js.map +1 -0
- package/dist/agent/engine/index.d.ts +2 -1
- package/dist/agent/engine/index.d.ts.map +1 -1
- package/dist/agent/engine/index.js +2 -1
- package/dist/agent/engine/index.js.map +1 -1
- package/dist/agent/engine/registry.d.ts +16 -0
- package/dist/agent/engine/registry.d.ts.map +1 -1
- package/dist/agent/engine/registry.js +71 -6
- package/dist/agent/engine/registry.js.map +1 -1
- package/dist/agent/engine/translate-ai-sdk.d.ts.map +1 -1
- package/dist/agent/engine/translate-ai-sdk.js +14 -2
- package/dist/agent/engine/translate-ai-sdk.js.map +1 -1
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +13 -24
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/run-loop-with-resume.js +1 -1
- package/dist/agent/run-loop-with-resume.js.map +1 -1
- package/dist/agent/run-manager.d.ts.map +1 -1
- package/dist/agent/run-manager.js +39 -10
- package/dist/agent/run-manager.js.map +1 -1
- package/dist/agent/run-store.d.ts +10 -0
- package/dist/agent/run-store.d.ts.map +1 -1
- package/dist/agent/run-store.js +20 -3
- package/dist/agent/run-store.js.map +1 -1
- package/dist/agent/thread-data-builder.d.ts.map +1 -1
- package/dist/agent/thread-data-builder.js +28 -4
- package/dist/agent/thread-data-builder.js.map +1 -1
- package/dist/cli/templates-meta.d.ts.map +1 -1
- package/dist/cli/templates-meta.js +13 -0
- package/dist/cli/templates-meta.js.map +1 -1
- package/dist/cli/workspace-dev.d.ts.map +1 -1
- package/dist/cli/workspace-dev.js +1 -0
- package/dist/cli/workspace-dev.js.map +1 -1
- package/dist/client/error-format.d.ts.map +1 -1
- package/dist/client/error-format.js +10 -0
- package/dist/client/error-format.js.map +1 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/awareness.d.ts.map +1 -1
- package/dist/credentials/index.d.ts +9 -2
- package/dist/credentials/index.d.ts.map +1 -1
- package/dist/credentials/index.js +50 -8
- package/dist/credentials/index.js.map +1 -1
- package/dist/extensions/url-safety.d.ts.map +1 -1
- package/dist/extensions/url-safety.js +38 -12
- package/dist/extensions/url-safety.js.map +1 -1
- package/dist/integrations/adapters/slack.d.ts.map +1 -1
- package/dist/integrations/adapters/slack.js +25 -8
- package/dist/integrations/adapters/slack.js.map +1 -1
- package/dist/integrations/google-docs-poller.d.ts.map +1 -1
- package/dist/integrations/google-docs-poller.js +13 -1
- package/dist/integrations/google-docs-poller.js.map +1 -1
- package/dist/integrations/installations-store.d.ts +10 -0
- package/dist/integrations/installations-store.d.ts.map +1 -1
- package/dist/integrations/installations-store.js +24 -0
- package/dist/integrations/installations-store.js.map +1 -1
- package/dist/integrations/plugin.d.ts.map +1 -1
- package/dist/integrations/plugin.js +6 -5
- package/dist/integrations/plugin.js.map +1 -1
- package/dist/integrations/types.d.ts +7 -0
- package/dist/integrations/types.d.ts.map +1 -1
- package/dist/integrations/types.js.map +1 -1
- package/dist/integrations/webhook-handler.d.ts.map +1 -1
- package/dist/integrations/webhook-handler.js +16 -1
- package/dist/integrations/webhook-handler.js.map +1 -1
- package/dist/jobs/background-automation-runner.d.ts.map +1 -1
- package/dist/jobs/background-automation-runner.js +35 -2
- package/dist/jobs/background-automation-runner.js.map +1 -1
- package/dist/mcp/screen-memory-stdio.d.ts +7 -7
- package/dist/mcp/screen-memory-stdio.d.ts.map +1 -1
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/observability/routes.d.ts +3 -3
- package/dist/provider-api/actions/custom-provider-registration.d.ts +14 -14
- package/dist/provider-api/actions/provider-api.d.ts +8 -8
- package/dist/provider-api/index.js +7 -3
- package/dist/provider-api/index.js.map +1 -1
- package/dist/scripts/call-agent.d.ts.map +1 -1
- package/dist/scripts/call-agent.js +6 -1
- package/dist/scripts/call-agent.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +25 -7
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/agent-discovery.d.ts +2 -0
- package/dist/server/agent-discovery.d.ts.map +1 -1
- package/dist/server/agent-discovery.js.map +1 -1
- package/dist/server/builder-design-systems.d.ts +4 -1
- package/dist/server/builder-design-systems.d.ts.map +1 -1
- package/dist/server/builder-design-systems.js +11 -1
- package/dist/server/builder-design-systems.js.map +1 -1
- package/dist/server/credential-provider.d.ts.map +1 -1
- package/dist/server/credential-provider.js +49 -12
- package/dist/server/credential-provider.js.map +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/onboarding-html.d.ts.map +1 -1
- package/dist/server/onboarding-html.js +37 -2
- package/dist/server/onboarding-html.js.map +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/shared/reasoning-effort.d.ts +1 -0
- package/dist/shared/reasoning-effort.d.ts.map +1 -1
- package/dist/shared/reasoning-effort.js +1 -1
- package/dist/shared/reasoning-effort.js.map +1 -1
- package/dist/templates/chat/app/components/layout/Sidebar.tsx +30 -3
- package/dist/templates/chat/changelog/2026-07-31-clicking-the-agent-native-logo-now-toggles-the-app-sidebar.md +6 -0
- package/dist/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +11 -0
- package/package.json +1 -1
- package/src/a2a/correlation.ts +11 -1
- package/src/a2a/types.ts +11 -3
- package/src/agent/engine/ai-sdk-engine.ts +33 -46
- package/src/agent/engine/builder-engine.ts +22 -10
- package/src/agent/engine/error-detail.ts +184 -3
- package/src/agent/engine/failure-taxonomy.ts +123 -0
- package/src/agent/engine/index.ts +8 -0
- package/src/agent/engine/registry.ts +92 -8
- package/src/agent/engine/translate-ai-sdk.ts +17 -2
- package/src/agent/production-agent.ts +13 -33
- package/src/agent/run-loop-with-resume.ts +1 -1
- package/src/agent/run-manager.ts +43 -14
- package/src/agent/run-store.ts +30 -3
- package/src/agent/thread-data-builder.ts +36 -4
- package/src/cli/templates-meta.ts +13 -0
- package/src/cli/workspace-dev.ts +1 -0
- package/src/client/error-format.ts +12 -0
- package/src/credentials/index.ts +51 -12
- package/src/extensions/url-safety.ts +46 -12
- package/src/integrations/adapters/slack.ts +32 -10
- package/src/integrations/google-docs-poller.ts +12 -1
- package/src/integrations/installations-store.ts +30 -0
- package/src/integrations/plugin.ts +5 -5
- package/src/integrations/types.ts +7 -0
- package/src/integrations/webhook-handler.ts +24 -1
- package/src/jobs/background-automation-runner.ts +38 -1
- package/src/provider-api/index.ts +8 -2
- package/src/scripts/call-agent.ts +6 -0
- package/src/server/agent-chat-plugin.ts +30 -9
- package/src/server/agent-discovery.ts +2 -0
- package/src/server/builder-design-systems.ts +21 -0
- package/src/server/credential-provider.ts +51 -12
- package/src/server/index.ts +1 -0
- package/src/server/onboarding-html.ts +37 -2
- package/src/shared/reasoning-effort.ts +1 -1
- package/src/templates/chat/app/components/layout/Sidebar.tsx +30 -3
- package/src/templates/chat/changelog/2026-07-31-clicking-the-agent-native-logo-now-toggles-the-app-sidebar.md +6 -0
- package/src/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +11 -0
- package/corpus/templates/clips/desktop/src/lib/media-device-selection.ts +0 -157
|
@@ -254,13 +254,17 @@ function SidebarContent({
|
|
|
254
254
|
src={appPath("/agent-native-icon-light.svg")}
|
|
255
255
|
alt=""
|
|
256
256
|
aria-hidden="true"
|
|
257
|
-
|
|
257
|
+
width={28}
|
|
258
|
+
height={16}
|
|
259
|
+
className="block h-4 w-7 shrink-0 object-contain object-center dark:hidden"
|
|
258
260
|
/>
|
|
259
261
|
<img
|
|
260
262
|
src={appPath("/agent-native-icon-dark.svg")}
|
|
261
263
|
alt=""
|
|
262
264
|
aria-hidden="true"
|
|
263
|
-
|
|
265
|
+
width={28}
|
|
266
|
+
height={16}
|
|
267
|
+
className="hidden h-4 w-7 shrink-0 object-contain object-center dark:block"
|
|
264
268
|
/>
|
|
265
269
|
<span className="font-logo truncate text-sm font-bold tracking-tight text-foreground">
|
|
266
270
|
{t("navigation.brand")}
|
|
@@ -606,30 +606,45 @@ export function Sidebar({
|
|
|
606
606
|
collapsed ? "justify-center px-0" : "gap-2 px-3",
|
|
607
607
|
)}
|
|
608
608
|
>
|
|
609
|
-
<
|
|
609
|
+
<button
|
|
610
|
+
type="button"
|
|
611
|
+
onClick={() => onCollapsedChange?.(!collapsed)}
|
|
610
612
|
className={cn(
|
|
611
|
-
"flex min-w-0 items-center gap-2",
|
|
612
|
-
collapsed ? "justify-center" : "flex-1",
|
|
613
|
+
"flex min-w-0 items-center gap-2 rounded outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
614
|
+
collapsed ? "justify-center" : "flex-1 text-start",
|
|
613
615
|
)}
|
|
616
|
+
aria-label={
|
|
617
|
+
collapsible
|
|
618
|
+
? collapsed
|
|
619
|
+
? t("sidebar.expandSidebar")
|
|
620
|
+
: t("sidebar.collapseSidebar")
|
|
621
|
+
: undefined
|
|
622
|
+
}
|
|
623
|
+
disabled={!collapsible || !onCollapsedChange}
|
|
624
|
+
data-sidebar-brand-toggle
|
|
614
625
|
>
|
|
615
626
|
<img
|
|
616
627
|
src={appPath("/agent-native-icon-light.svg")}
|
|
617
628
|
alt=""
|
|
618
629
|
aria-hidden="true"
|
|
619
|
-
|
|
630
|
+
width={28}
|
|
631
|
+
height={16}
|
|
632
|
+
className="block h-4 w-7 shrink-0 object-contain object-center dark:hidden"
|
|
620
633
|
/>
|
|
621
634
|
<img
|
|
622
635
|
src={appPath("/agent-native-icon-dark.svg")}
|
|
623
636
|
alt=""
|
|
624
637
|
aria-hidden="true"
|
|
625
|
-
|
|
638
|
+
width={28}
|
|
639
|
+
height={16}
|
|
640
|
+
className="hidden h-4 w-7 shrink-0 object-contain object-center dark:block"
|
|
626
641
|
/>
|
|
627
642
|
{!collapsed && (
|
|
628
643
|
<span className="truncate text-sm font-semibold tracking-tight">
|
|
629
644
|
{APP_TITLE}
|
|
630
645
|
</span>
|
|
631
646
|
)}
|
|
632
|
-
</
|
|
647
|
+
</button>
|
|
633
648
|
{!collapsed && <BrandingCustomizePopover />}
|
|
634
649
|
</div>
|
|
635
650
|
|
|
@@ -127,6 +127,18 @@ Every slide's `content` must use this exact outer div:
|
|
|
127
127
|
</div>
|
|
128
128
|
```
|
|
129
129
|
|
|
130
|
+
## Fit budget
|
|
131
|
+
|
|
132
|
+
The canvas is fixed at its aspect-ratio dimensions. With the standard 16:9
|
|
133
|
+
canvas (960x540) and `padding: 80px 110px`, the usable content area is only
|
|
134
|
+
740x380px. Treat that as a hard budget for the main flow: use at most two title
|
|
135
|
+
lines, three short bullets or cards, and two or three short items per column.
|
|
136
|
+
Split dense source material across slides instead of shrinking it into a dense
|
|
137
|
+
stack. Keep body text at or above 16px. Never hide overflow with zoom,
|
|
138
|
+
`transform: scale()`, clipping, or scroll overflow. A later structural repair
|
|
139
|
+
may reduce the slide's explicit padding, and that padding must remain intact
|
|
140
|
+
when the saved HTML is rendered.
|
|
141
|
+
|
|
130
142
|
Background is pure black (`bg-[#000000]`) — set by the renderer, not the slide HTML.
|
|
131
143
|
|
|
132
144
|
## Ready-to-Use Templates
|
|
@@ -14,6 +14,7 @@ Design systems are stored in the `design_systems` SQL table. Each has a `data` c
|
|
|
14
14
|
- `logos`: array of { url, name, variant }
|
|
15
15
|
- `imageStyle`: referenceUrls, styleDescription
|
|
16
16
|
- `customCSS`: optional custom CSS
|
|
17
|
+
- `visibility`: organization-scoped systems default to `org`; local systems default to `private`
|
|
17
18
|
|
|
18
19
|
## Creating a Design System
|
|
19
20
|
|
|
@@ -22,6 +23,10 @@ Design systems are stored in the `design_systems` SQL table. Each has a `data` c
|
|
|
22
23
|
3. Agent analyzes the data and calls `create-design-system` with extracted tokens
|
|
23
24
|
4. The design system is published and becomes available for deck creation
|
|
24
25
|
|
|
26
|
+
When an organization is active, newly created systems are shared with that
|
|
27
|
+
organization by default. Builder-indexed local proxy systems follow the same
|
|
28
|
+
visibility rule.
|
|
29
|
+
|
|
25
30
|
### Source: Figma `.fig` file
|
|
26
31
|
|
|
27
32
|
When the user uploads a raw Figma local copy (`.fig`), start Builder
|
|
@@ -60,6 +65,10 @@ members who have not set their own. `create-deck` resolves it server-side, so
|
|
|
60
65
|
call `get-workspace-defaults` only to name it or answer what the default is.
|
|
61
66
|
See the `create-deck` skill.
|
|
62
67
|
|
|
68
|
+
The personal default is separate from the workspace default. Use
|
|
69
|
+
`set-default-design-system` with `isDefault: false` to clear a personal star;
|
|
70
|
+
setting another system clears the previous star in the same organization.
|
|
71
|
+
|
|
63
72
|
## Deleting a Design System
|
|
64
73
|
|
|
65
74
|
`delete-design-system` requires admin access or higher (owner or admin share
|
|
@@ -37,6 +37,17 @@ All generated slides follow these conventions:
|
|
|
37
37
|
| Bold terms | `<strong style="font-weight: 800; color: #fff;">Term</strong>` + description in rgba(255,255,255,0.55) |
|
|
38
38
|
| Accent color | `#00E5FF` (cyan) for section labels, emphasis, highlights |
|
|
39
39
|
|
|
40
|
+
## Fit and Density
|
|
41
|
+
|
|
42
|
+
Fit the main content to the native content area, not merely to the outer
|
|
43
|
+
wrapper. For the default 16:9 canvas, the standard `80px 110px` padding leaves
|
|
44
|
+
740x380px. Keep titles to two lines, content slides to three short bullets or
|
|
45
|
+
three compact cards, and two-column slides to two or three short items per
|
|
46
|
+
column. If the source is denser, split it across slides. Never use zoom,
|
|
47
|
+
`transform: scale()`, clipping, or scroll overflow to hide a fit issue; body
|
|
48
|
+
text must remain at least 16px. Explicitly reduced slide padding is allowed when
|
|
49
|
+
the content still needs the space.
|
|
50
|
+
|
|
40
51
|
## Updating a Slide
|
|
41
52
|
|
|
42
53
|
To edit a slide's content:
|
|
@@ -30,17 +30,16 @@ ladder.
|
|
|
30
30
|
- Preserve freeform objects and their `data-slide-object-id` values. They are
|
|
31
31
|
absolutely positioned `.fmd-slide` children; keep generated flex/grid in
|
|
32
32
|
normal flow and mint ids only for duplicates. Use styled HTML, not inline SVG.
|
|
33
|
-
-
|
|
33
|
+
- Read `slide-editing` before creating slides; it covers fit, density, and overflow.
|
|
34
|
+
- Follow linked design-system tokens; read `design-systems` for per-source actions.
|
|
34
35
|
- Build reusable design systems from Figma, code, GitHub, or `design.md` via
|
|
35
|
-
Builder-backed DSI indexing, never a duplicate local copy.
|
|
36
|
-
`design-systems` for the per-source actions.
|
|
36
|
+
Builder-backed DSI indexing, never a duplicate local copy.
|
|
37
37
|
- Import/export actions are shortcuts, not capability limits. For exact Google
|
|
38
38
|
Drive API needs, use `provider-api-catalog`, `provider-api-docs`, and
|
|
39
39
|
`provider-api-request`; auth comes from the user's Google Docs OAuth. Stage
|
|
40
40
|
large scans with `stageAs` and analyze them via `query-staged-dataset`.
|
|
41
|
-
- Use image
|
|
42
|
-
|
|
43
|
-
- Use framework sharing actions for deck visibility and grants.
|
|
41
|
+
- Use image actions only when needed; preserve asset provenance.
|
|
42
|
+
- Use sharing actions for visibility and grants.
|
|
44
43
|
- Ask a sibling app's agent with a natural-language `call-agent` message by
|
|
45
44
|
default. Let that specialist use its own instructions, skills, sources, and
|
|
46
45
|
tools. Direct action invocation is only for an exact bounded read with a
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { readAppStateForCurrentTab } from "./_tab-state.js";
|
|
2
2
|
|
|
3
3
|
/** A measurement record written by the editor after rendering a slide.
|
|
4
|
-
*
|
|
5
|
-
* `verticalOverflow > 0` means the rendered content was too tall. */
|
|
4
|
+
* Both overflow fields must be zero for the slide to fit the canvas. */
|
|
6
5
|
export interface SlideFitMeasurement {
|
|
7
6
|
slideId: string;
|
|
8
7
|
deckId?: string;
|
|
9
8
|
contentHeight: number;
|
|
9
|
+
contentWidth?: number;
|
|
10
10
|
viewportHeight: number;
|
|
11
|
+
viewportWidth?: number;
|
|
11
12
|
verticalOverflow: number;
|
|
13
|
+
horizontalOverflow?: number;
|
|
14
|
+
contentHash?: string;
|
|
12
15
|
measuredAt: number;
|
|
13
16
|
}
|
|
14
17
|
|
|
@@ -45,6 +48,7 @@ export async function awaitLayoutFitCheck(
|
|
|
45
48
|
slideId: string,
|
|
46
49
|
since: number,
|
|
47
50
|
timeoutMs: number = DEFAULT_TIMEOUT_MS,
|
|
51
|
+
expectedContentHash?: string,
|
|
48
52
|
): Promise<SlideFitResult> {
|
|
49
53
|
const deadline = Date.now() + timeoutMs;
|
|
50
54
|
while (Date.now() < deadline) {
|
|
@@ -63,11 +67,17 @@ export async function awaitLayoutFitCheck(
|
|
|
63
67
|
if (
|
|
64
68
|
m &&
|
|
65
69
|
m.slideId === slideId &&
|
|
66
|
-
|
|
70
|
+
(expectedContentHash === undefined ||
|
|
71
|
+
m.contentHash === expectedContentHash) &&
|
|
72
|
+
Number.isFinite(m.measuredAt) &&
|
|
67
73
|
m.measuredAt >= since &&
|
|
68
|
-
|
|
74
|
+
Number.isFinite(m.verticalOverflow) &&
|
|
75
|
+
Number.isFinite(m.contentHeight) &&
|
|
76
|
+
Number.isFinite(m.viewportHeight) &&
|
|
77
|
+
(m.horizontalOverflow === undefined ||
|
|
78
|
+
Number.isFinite(m.horizontalOverflow))
|
|
69
79
|
) {
|
|
70
|
-
return m.verticalOverflow > 0
|
|
80
|
+
return m.verticalOverflow > 0 || (m.horizontalOverflow ?? 0) > 0
|
|
71
81
|
? { status: "overflows", measurement: m }
|
|
72
82
|
: { status: "fits", measurement: m };
|
|
73
83
|
}
|
|
@@ -78,22 +88,22 @@ export async function awaitLayoutFitCheck(
|
|
|
78
88
|
|
|
79
89
|
/** Format an overflow result into a short tool-result block that the agent
|
|
80
90
|
* will see and act on. Includes the slide id, the exact overflow, and a
|
|
81
|
-
* prioritized fix list. The wording is deliberately
|
|
82
|
-
*
|
|
91
|
+
* prioritized fix list. The wording is deliberately bounded so the agent
|
|
92
|
+
* makes one structural repair and verifies it instead of looping. */
|
|
83
93
|
export function formatOverflowForTool(
|
|
84
94
|
deckId: string,
|
|
85
95
|
m: SlideFitMeasurement,
|
|
86
96
|
): string {
|
|
87
97
|
return [
|
|
88
98
|
``,
|
|
89
|
-
`⚠ Layout overflows the canvas vertically
|
|
99
|
+
`⚠ Layout overflows the canvas${m.verticalOverflow > 0 ? ` vertically by ${m.verticalOverflow}px` : ""}${(m.horizontalOverflow ?? 0) > 0 ? ` and horizontally by ${m.horizontalOverflow}px` : ""} — natural content is ${m.contentWidth ?? "unknown"}x${m.contentHeight}px inside a ${m.viewportWidth ?? "unknown"}x${m.viewportHeight}px content area.`,
|
|
90
100
|
``,
|
|
91
|
-
|
|
101
|
+
`Make one structural repair now with \`update-slide --deckId ${deckId} --slideId ${m.slideId}\`. Prefer small surgical patches (--find / --replace) over a full rewrite:`,
|
|
92
102
|
`1. Tighten copy — shorter headings/bullets, drop low-value lines.`,
|
|
93
103
|
`2. Reduce vertical density — fewer stacked cards, smaller gaps, body font no smaller than 16px.`,
|
|
94
104
|
`3. Reduce slide padding (e.g. 40px top/bottom instead of 60-80px).`,
|
|
95
105
|
`4. Split across two slides only if the content cannot be compressed.`,
|
|
96
106
|
``,
|
|
97
|
-
`Do **not** use \`transform: scale\`, \`overflow: scroll\`, or
|
|
107
|
+
`Do **not** use zoom, \`transform: scale\`, clipping, \`overflow: scroll\`, or a smaller-than-16px body font. Preserve existing absolute text boxes and fix the normal-flow HTML. Verify the action result and then use \`view-screen\`; do not spin through another repair loop.`,
|
|
98
108
|
].join("\n");
|
|
99
109
|
}
|
|
@@ -17,6 +17,7 @@ import { normalizeSlidePadding } from "../app/lib/normalize-slide-padding.js";
|
|
|
17
17
|
import { getDb, schema } from "../server/db/index.js";
|
|
18
18
|
import { notifyClients } from "../server/handlers/decks.js";
|
|
19
19
|
import { createDeckVersionSnapshot } from "../server/lib/deck-versions.js";
|
|
20
|
+
import { hashSlideContent } from "../shared/slide-fit.js";
|
|
20
21
|
import { slideLabelFor, touchAgentSlidePresence } from "./_agent-presence.js";
|
|
21
22
|
import {
|
|
22
23
|
awaitLayoutFitCheck,
|
|
@@ -350,6 +351,11 @@ export default defineAction({
|
|
|
350
351
|
);
|
|
351
352
|
});
|
|
352
353
|
|
|
354
|
+
// Start the freshness window immediately after the SQL write and before
|
|
355
|
+
// notifying the editor. A render can happen during presence/navigation;
|
|
356
|
+
// capturing the timestamp later can discard that valid measurement.
|
|
357
|
+
const fitSince = Date.now();
|
|
358
|
+
|
|
353
359
|
// Best-effort agent presence: light the agent up on the newly-added slide
|
|
354
360
|
// in open editors and drop a lingering "AI edited" highlight for it. Uses
|
|
355
361
|
// the NEW slide's id. Never blocks or fails the write.
|
|
@@ -388,11 +394,15 @@ export default defineAction({
|
|
|
388
394
|
|
|
389
395
|
// Wait briefly for the editor to render the new slide and report its
|
|
390
396
|
// measured fit. If we get an "overflows" signal, append the auto-fix
|
|
391
|
-
// hint so the agent can
|
|
392
|
-
//
|
|
397
|
+
// hint so the agent can make one bounded structural repair. Timeout = no
|
|
398
|
+
// editor measurement available
|
|
393
399
|
// (e.g. headless server) — return success without a fit hint.
|
|
394
|
-
const
|
|
395
|
-
|
|
400
|
+
const fit = await awaitLayoutFitCheck(
|
|
401
|
+
newSlideId,
|
|
402
|
+
fitSince,
|
|
403
|
+
5000,
|
|
404
|
+
hashSlideContent(newSlide.content),
|
|
405
|
+
);
|
|
396
406
|
|
|
397
407
|
const base = {
|
|
398
408
|
deckId,
|
|
@@ -411,7 +421,10 @@ export default defineAction({
|
|
|
411
421
|
...base,
|
|
412
422
|
layoutOverflow: {
|
|
413
423
|
verticalOverflow: fit.measurement.verticalOverflow,
|
|
424
|
+
horizontalOverflow: fit.measurement.horizontalOverflow ?? 0,
|
|
425
|
+
contentWidth: fit.measurement.contentWidth,
|
|
414
426
|
contentHeight: fit.measurement.contentHeight,
|
|
427
|
+
viewportWidth: fit.measurement.viewportWidth,
|
|
415
428
|
viewportHeight: fit.measurement.viewportHeight,
|
|
416
429
|
},
|
|
417
430
|
message: formatOverflowForTool(deckId, fit.measurement),
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
getRequestUserEmail,
|
|
4
4
|
getRequestOrgId,
|
|
5
5
|
} from "@agent-native/core/server/request-context";
|
|
6
|
-
import { eq } from "drizzle-orm";
|
|
6
|
+
import { and, eq, isNull } from "drizzle-orm";
|
|
7
7
|
import { nanoid } from "nanoid";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
|
|
@@ -65,12 +65,23 @@ export default defineAction({
|
|
|
65
65
|
if (!ownerEmail) throw new Error("no authenticated user");
|
|
66
66
|
const orgId = getRequestOrgId();
|
|
67
67
|
|
|
68
|
-
// Check only this user's owned systems
|
|
69
|
-
// the first system a user creates from becoming
|
|
68
|
+
// Check only this user's owned systems in the active organization. Shared
|
|
69
|
+
// systems should not prevent the first system a user creates from becoming
|
|
70
|
+
// their default, and another organization must not affect this one.
|
|
70
71
|
const existing = await db
|
|
71
72
|
.select({ id: schema.designSystems.id })
|
|
72
73
|
.from(schema.designSystems)
|
|
73
|
-
.where(
|
|
74
|
+
.where(
|
|
75
|
+
orgId
|
|
76
|
+
? and(
|
|
77
|
+
eq(schema.designSystems.ownerEmail, ownerEmail),
|
|
78
|
+
eq(schema.designSystems.orgId, orgId),
|
|
79
|
+
)
|
|
80
|
+
: and(
|
|
81
|
+
eq(schema.designSystems.ownerEmail, ownerEmail),
|
|
82
|
+
isNull(schema.designSystems.orgId),
|
|
83
|
+
),
|
|
84
|
+
)
|
|
74
85
|
.limit(1);
|
|
75
86
|
|
|
76
87
|
const isDefault = existing.length === 0;
|
|
@@ -85,6 +96,7 @@ export default defineAction({
|
|
|
85
96
|
isDefault,
|
|
86
97
|
ownerEmail,
|
|
87
98
|
orgId,
|
|
99
|
+
visibility: orgId ? "org" : "private",
|
|
88
100
|
createdAt: now,
|
|
89
101
|
updatedAt: now,
|
|
90
102
|
});
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { defineAction } from "@agent-native/core";
|
|
2
|
+
import { getRequestOrgId } from "@agent-native/core/server/request-context";
|
|
2
3
|
import {
|
|
3
4
|
assertAccess,
|
|
4
5
|
resolveAccess,
|
|
5
6
|
type ShareRole,
|
|
6
7
|
} from "@agent-native/core/sharing";
|
|
7
|
-
import { desc, eq } from "drizzle-orm";
|
|
8
|
+
import { and, desc, eq, isNull } from "drizzle-orm";
|
|
8
9
|
import { z } from "zod";
|
|
9
10
|
|
|
10
11
|
import { getDb, schema } from "../server/db/index.js";
|
|
@@ -73,6 +74,7 @@ export default defineAction({
|
|
|
73
74
|
const access = await assertAccess("design-system", id, "admin");
|
|
74
75
|
|
|
75
76
|
const db = getDb();
|
|
77
|
+
const orgId = getRequestOrgId();
|
|
76
78
|
|
|
77
79
|
const linkedDeckIds = (
|
|
78
80
|
await db
|
|
@@ -103,7 +105,21 @@ export default defineAction({
|
|
|
103
105
|
.select({ id: schema.designSystems.id })
|
|
104
106
|
.from(schema.designSystems)
|
|
105
107
|
.where(
|
|
106
|
-
|
|
108
|
+
orgId
|
|
109
|
+
? and(
|
|
110
|
+
eq(
|
|
111
|
+
schema.designSystems.ownerEmail,
|
|
112
|
+
access.resource.ownerEmail,
|
|
113
|
+
),
|
|
114
|
+
eq(schema.designSystems.orgId, orgId),
|
|
115
|
+
)
|
|
116
|
+
: and(
|
|
117
|
+
eq(
|
|
118
|
+
schema.designSystems.ownerEmail,
|
|
119
|
+
access.resource.ownerEmail,
|
|
120
|
+
),
|
|
121
|
+
isNull(schema.designSystems.orgId),
|
|
122
|
+
),
|
|
107
123
|
)
|
|
108
124
|
.orderBy(desc(schema.designSystems.updatedAt))
|
|
109
125
|
.limit(1);
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { defineAction } from "@agent-native/core";
|
|
2
|
+
import { resolveAccess } from "@agent-native/core/sharing";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
|
|
5
|
+
import { hashSlideContent, type DeckFitState } from "../shared/slide-fit.js";
|
|
6
|
+
import { readAppStateForCurrentTab } from "./_tab-state.js";
|
|
7
|
+
|
|
8
|
+
export default defineAction({
|
|
9
|
+
description:
|
|
10
|
+
"Read the latest browser measurements for every slide in a deck. Returns status unknown until every slide has a finite measurement matching its current HTML, so never use a partial result to claim the deck fits.",
|
|
11
|
+
schema: z.object({
|
|
12
|
+
deckId: z.string().describe("Deck ID"),
|
|
13
|
+
}),
|
|
14
|
+
http: false,
|
|
15
|
+
run: async ({ deckId }) => {
|
|
16
|
+
const access = await resolveAccess("deck", deckId);
|
|
17
|
+
if (!access)
|
|
18
|
+
throw Object.assign(new Error("Deck not found"), { statusCode: 404 });
|
|
19
|
+
|
|
20
|
+
const deck = JSON.parse(access.resource.data) as {
|
|
21
|
+
aspectRatio?: string | null;
|
|
22
|
+
slides?: Array<{ id: string; content?: string }>;
|
|
23
|
+
};
|
|
24
|
+
const slides = Array.isArray(deck.slides) ? deck.slides : [];
|
|
25
|
+
const state = (await readAppStateForCurrentTab("deck-fit-checks", {
|
|
26
|
+
fallbackToGlobal: false,
|
|
27
|
+
})) as DeckFitState | null;
|
|
28
|
+
|
|
29
|
+
const unknownSlideIds: string[] = [];
|
|
30
|
+
const overflows: Array<{
|
|
31
|
+
slideId: string;
|
|
32
|
+
slideNumber: number;
|
|
33
|
+
verticalOverflow: number;
|
|
34
|
+
horizontalOverflow: number;
|
|
35
|
+
contentHeight: number;
|
|
36
|
+
contentWidth: number;
|
|
37
|
+
viewportHeight: number;
|
|
38
|
+
viewportWidth: number;
|
|
39
|
+
}> = [];
|
|
40
|
+
|
|
41
|
+
slides.forEach((slide, index) => {
|
|
42
|
+
const measurement =
|
|
43
|
+
state?.deckId === deckId &&
|
|
44
|
+
state.aspectRatio === (deck.aspectRatio ?? "16:9")
|
|
45
|
+
? state.slides?.[slide.id]
|
|
46
|
+
: undefined;
|
|
47
|
+
if (
|
|
48
|
+
!measurement ||
|
|
49
|
+
measurement.contentHash !== hashSlideContent(slide.content ?? "") ||
|
|
50
|
+
!Number.isFinite(measurement.verticalOverflow) ||
|
|
51
|
+
!Number.isFinite(measurement.horizontalOverflow) ||
|
|
52
|
+
!Number.isFinite(measurement.contentHeight) ||
|
|
53
|
+
!Number.isFinite(measurement.contentWidth) ||
|
|
54
|
+
!Number.isFinite(measurement.viewportHeight) ||
|
|
55
|
+
!Number.isFinite(measurement.viewportWidth) ||
|
|
56
|
+
!Number.isFinite(measurement.measuredAt)
|
|
57
|
+
) {
|
|
58
|
+
unknownSlideIds.push(slide.id);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (
|
|
62
|
+
measurement.verticalOverflow > 0 ||
|
|
63
|
+
measurement.horizontalOverflow > 0
|
|
64
|
+
) {
|
|
65
|
+
overflows.push({
|
|
66
|
+
slideId: slide.id,
|
|
67
|
+
slideNumber: index + 1,
|
|
68
|
+
verticalOverflow: measurement.verticalOverflow,
|
|
69
|
+
horizontalOverflow: measurement.horizontalOverflow,
|
|
70
|
+
contentHeight: measurement.contentHeight,
|
|
71
|
+
contentWidth: measurement.contentWidth,
|
|
72
|
+
viewportHeight: measurement.viewportHeight,
|
|
73
|
+
viewportWidth: measurement.viewportWidth,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
return {
|
|
79
|
+
deckId,
|
|
80
|
+
status: unknownSlideIds.length > 0 ? "unknown" : "measured",
|
|
81
|
+
measuredSlideCount: slides.length - unknownSlideIds.length,
|
|
82
|
+
slideCount: slides.length,
|
|
83
|
+
unknownSlideIds,
|
|
84
|
+
overflows,
|
|
85
|
+
canClaimDeckFits: unknownSlideIds.length === 0 && overflows.length === 0,
|
|
86
|
+
};
|
|
87
|
+
},
|
|
88
|
+
});
|
|
@@ -93,6 +93,14 @@ export default defineAction({
|
|
|
93
93
|
orgId: getRequestOrgId(),
|
|
94
94
|
projectName,
|
|
95
95
|
description,
|
|
96
|
+
sourceKind:
|
|
97
|
+
githubRepoUrl && (codeFiles?.length || designMd)
|
|
98
|
+
? "mixed"
|
|
99
|
+
: githubRepoUrl
|
|
100
|
+
? "github"
|
|
101
|
+
: codeFiles?.length || designMd
|
|
102
|
+
? "code"
|
|
103
|
+
: undefined,
|
|
96
104
|
});
|
|
97
105
|
|
|
98
106
|
return {
|
|
@@ -141,25 +141,29 @@ export const OperationSchema = z.discriminatedUnion("op", [
|
|
|
141
141
|
|
|
142
142
|
export type Operation = z.infer<typeof OperationSchema>;
|
|
143
143
|
|
|
144
|
-
// The browser uses the full operation union above
|
|
145
|
-
// this action
|
|
146
|
-
//
|
|
147
|
-
// metadata fields with empty defaults that the runtime correctly rejects.
|
|
144
|
+
// The browser uses the full operation union above. Agents additionally use
|
|
145
|
+
// this action for one bounded, deck-wide layout repair: one patch-slide per
|
|
146
|
+
// slide in a single SQL transaction, followed by a fresh read for verification.
|
|
148
147
|
const AgentPatchDeckInputSchema = z.object({
|
|
149
148
|
deckId: z.string().describe("Deck ID"),
|
|
150
149
|
operations: z
|
|
151
150
|
.array(
|
|
152
|
-
z.
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
151
|
+
z.union([
|
|
152
|
+
PatchSlideOp,
|
|
153
|
+
z.object({
|
|
154
|
+
op: z.literal("patch-deck-fields"),
|
|
155
|
+
fields: z.object({
|
|
156
|
+
title: z
|
|
157
|
+
.string()
|
|
158
|
+
.describe("The concise, specific title to apply to the deck"),
|
|
159
|
+
}),
|
|
158
160
|
}),
|
|
159
|
-
|
|
161
|
+
]),
|
|
160
162
|
)
|
|
161
163
|
.min(1)
|
|
162
|
-
.describe(
|
|
164
|
+
.describe(
|
|
165
|
+
"One patch-slide operation per slide that needs a structural HTML repair. Use patch-deck-fields only for a deck title change.",
|
|
166
|
+
),
|
|
163
167
|
});
|
|
164
168
|
|
|
165
169
|
const CreativeContextReuseLabelSchema = z.object({
|
|
@@ -344,9 +348,9 @@ export default defineAction({
|
|
|
344
348
|
description:
|
|
345
349
|
"Granular deck patch used by the browser editor for concurrent-safe writes. " +
|
|
346
350
|
"Each operation touches only the target slide or field — concurrent writers " +
|
|
347
|
-
"on different slides never overwrite each other's work.
|
|
348
|
-
"
|
|
349
|
-
"
|
|
351
|
+
"on different slides never overwrite each other's work. For a deck-wide " +
|
|
352
|
+
"layout repair, send one patch-slide operation per affected slide in one " +
|
|
353
|
+
"call, then call get-deck to verify the persisted HTML before reporting success.",
|
|
350
354
|
schema: z.object({
|
|
351
355
|
deckId: z.string().describe("Deck ID"),
|
|
352
356
|
operations: z
|
|
@@ -385,6 +389,21 @@ export default defineAction({
|
|
|
385
389
|
const deck: any = JSON.parse(row.data);
|
|
386
390
|
const existingContext = storedCreativeContext(deck.creativeContext);
|
|
387
391
|
|
|
392
|
+
const existingSlideIds = new Set(
|
|
393
|
+
(Array.isArray(deck.slides) ? deck.slides : []).map(
|
|
394
|
+
(slide: { id?: unknown }) => slide.id,
|
|
395
|
+
),
|
|
396
|
+
);
|
|
397
|
+
const missingSlideIds = operations
|
|
398
|
+
.filter((operation) => operation.op === "patch-slide")
|
|
399
|
+
.map((operation) => operation.slideId)
|
|
400
|
+
.filter((slideId) => !existingSlideIds.has(slideId));
|
|
401
|
+
if (missingSlideIds.length > 0) {
|
|
402
|
+
throw new Error(
|
|
403
|
+
`Cannot patch missing slide(s): ${[...new Set(missingSlideIds)].join(", ")}`,
|
|
404
|
+
);
|
|
405
|
+
}
|
|
406
|
+
|
|
388
407
|
for (const op of operations) {
|
|
389
408
|
applyOperation(deck, op);
|
|
390
409
|
}
|
|
@@ -542,7 +561,20 @@ export default defineAction({
|
|
|
542
561
|
|
|
543
562
|
notifyClients(deckId);
|
|
544
563
|
|
|
545
|
-
return {
|
|
564
|
+
return {
|
|
565
|
+
ok: true,
|
|
566
|
+
deckId,
|
|
567
|
+
updatedAt: now,
|
|
568
|
+
updatedSlideIds: [
|
|
569
|
+
...new Set(
|
|
570
|
+
operations.flatMap((operation) =>
|
|
571
|
+
operation.op === "patch-slide" || operation.op === "add-slide"
|
|
572
|
+
? [operation.slideId]
|
|
573
|
+
: [],
|
|
574
|
+
),
|
|
575
|
+
),
|
|
576
|
+
],
|
|
577
|
+
};
|
|
546
578
|
});
|
|
547
579
|
},
|
|
548
580
|
});
|