@agent-native/core 0.130.2 → 0.131.3
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 +79 -0
- package/corpus/core/docs/content/agent-surfaces.mdx +4 -4
- package/corpus/core/docs/content/automations.mdx +61 -12
- package/corpus/core/docs/content/deployment.mdx +11 -4
- package/corpus/core/docs/content/extensions.mdx +39 -33
- package/corpus/core/docs/content/recurring-jobs.mdx +41 -19
- package/corpus/core/docs/content/template-dispatch-operations.mdx +19 -7
- package/corpus/core/package.json +3 -1
- package/corpus/core/src/a2a/types.ts +6 -0
- package/corpus/core/src/action.ts +68 -0
- package/corpus/core/src/agent/engine/builder-engine.ts +8 -4
- package/corpus/core/src/agent/production-agent.ts +175 -100
- package/corpus/core/src/agent/tool-search.ts +36 -0
- package/corpus/core/src/automations/service.ts +506 -0
- package/corpus/core/src/browser-context/index.ts +392 -0
- package/corpus/core/src/client/AgentPanel.tsx +2 -1
- package/corpus/core/src/client/FeedbackButton.tsx +37 -4
- package/corpus/core/src/client/MultiTabAssistantChat.tsx +21 -0
- package/corpus/core/src/client/agent-chat.ts +31 -3
- package/corpus/core/src/client/agent-page/AgentJobsTab.tsx +438 -310
- package/corpus/core/src/client/agent-page/AgentTabsPage.tsx +4 -4
- package/corpus/core/src/client/agent-page/use-jobs.ts +7 -0
- package/corpus/core/src/client/analytics-session.ts +13 -0
- package/corpus/core/src/client/extensions/ExtensionViewer.tsx +67 -0
- package/corpus/core/src/client/settings/AutomationsSection.tsx +27 -499
- package/corpus/core/src/client/settings/SettingsPanel.tsx +32 -11
- package/corpus/core/src/client/settings/index.ts +2 -0
- package/corpus/core/src/client/use-agent-chat.ts +35 -3
- package/corpus/core/src/client/use-chat-threads.ts +8 -25
- package/corpus/core/src/deploy/build.ts +2 -0
- package/corpus/core/src/deploy/workspace-deploy.ts +2 -0
- package/corpus/core/src/extensions/actions.ts +115 -3
- package/corpus/core/src/extensions/fetch-tool.ts +11 -0
- package/corpus/core/src/extensions/routes.ts +16 -1
- package/corpus/core/src/extensions/web-content.ts +96 -1
- package/corpus/core/src/integrations/computer-supervision.ts +33 -1
- package/corpus/core/src/integrations/index.ts +6 -0
- package/corpus/core/src/integrations/integration-durable-dispatch-config.ts +10 -0
- package/corpus/core/src/integrations/integration-durable-dispatch.ts +4 -0
- package/corpus/core/src/integrations/plugin.ts +94 -41
- package/corpus/core/src/integrations/remote-browser-actions.ts +621 -0
- package/corpus/core/src/jobs/actions/list-recurring-jobs.ts +5 -7
- package/corpus/core/src/jobs/actions/manage-recurring-job.ts +3 -7
- package/corpus/core/src/jobs/background-automation-runner.ts +437 -0
- package/corpus/core/src/jobs/frontmatter.ts +308 -0
- package/corpus/core/src/jobs/scheduler.ts +89 -598
- package/corpus/core/src/jobs/tools.ts +22 -3
- package/corpus/core/src/localization/default-messages.ts +45 -45
- package/corpus/core/src/mcp-client/index.ts +6 -0
- package/corpus/core/src/notifications/actions.ts +5 -0
- package/corpus/core/src/progress/actions.ts +5 -0
- package/corpus/core/src/provider-api/actions/github-repo-files.ts +11 -0
- package/corpus/core/src/provider-api/actions/provider-api.ts +13 -0
- package/corpus/core/src/server/action-discovery.ts +7 -0
- package/corpus/core/src/server/agent-capabilities.ts +43 -8
- package/corpus/core/src/server/agent-chat/action-filters-a2a.ts +63 -1
- package/corpus/core/src/server/agent-chat/browser-team-tools.ts +126 -3
- package/corpus/core/src/server/agent-chat/framework-prompts.ts +7 -11
- package/corpus/core/src/server/agent-chat/plugin-options.ts +3 -3
- package/corpus/core/src/server/agent-chat/script-entries.ts +52 -1
- package/corpus/core/src/server/agent-chat-plugin.ts +25 -5
- package/corpus/core/src/server/attribution.ts +22 -0
- package/corpus/core/src/server/auth.ts +20 -6
- package/corpus/core/src/server/better-auth-instance.ts +10 -2
- package/corpus/core/src/server/core-routes-plugin.ts +10 -1
- package/corpus/core/src/server/csrf.ts +25 -0
- package/corpus/core/src/server/google-oauth.ts +21 -1
- package/corpus/core/src/server/onboarding-html.ts +18 -0
- package/corpus/core/src/server/prompts/framework-core-compact.ts +3 -3
- package/corpus/core/src/server/prompts/framework-core.ts +3 -3
- package/corpus/core/src/server/prompts/shared-rules.ts +3 -3
- package/corpus/core/src/settings/index.ts +1 -0
- package/corpus/core/src/shared/analytics-anonymous-id.ts +35 -0
- package/corpus/core/src/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/core/src/templates/default/app/i18n/ar-SA.ts +26 -0
- package/corpus/core/src/templates/default/app/i18n/de-DE.ts +28 -0
- package/corpus/core/src/templates/default/app/i18n/en-US.ts +27 -0
- package/corpus/core/src/templates/default/app/i18n/es-ES.ts +28 -0
- package/corpus/core/src/templates/default/app/i18n/fr-FR.ts +28 -0
- package/corpus/core/src/templates/default/app/i18n/hi-IN.ts +25 -0
- package/corpus/core/src/templates/default/app/i18n/ja-JP.ts +27 -0
- package/corpus/core/src/templates/default/app/i18n/ko-KR.ts +27 -0
- package/corpus/core/src/templates/default/app/i18n/pt-BR.ts +27 -0
- package/corpus/core/src/templates/default/app/i18n/zh-CN.ts +24 -0
- package/corpus/core/src/templates/default/app/i18n/zh-TW.ts +24 -0
- package/corpus/core/src/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/agent-page/SKILL.md +10 -7
- package/corpus/core/src/templates/workspace-core/.agents/skills/automations/SKILL.md +53 -8
- package/corpus/core/src/templates/workspace-core/.agents/skills/browser-sessions/SKILL.md +131 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/extension-points/SKILL.md +13 -4
- package/corpus/core/src/templates/workspace-core/.agents/skills/extensions/SKILL.md +23 -15
- package/corpus/core/src/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +33 -18
- package/corpus/core/src/tracking/providers.ts +1 -0
- package/corpus/core/src/tracking/registry.ts +2 -1
- package/corpus/core/src/tracking/types.ts +1 -0
- package/corpus/core/src/triggers/actions/list-automations.ts +43 -44
- package/corpus/core/src/triggers/actions/manage-automation.ts +17 -48
- package/corpus/core/src/triggers/actions.ts +218 -127
- package/corpus/core/src/triggers/dispatcher.ts +181 -367
- package/corpus/core/src/triggers/routes.ts +84 -27
- package/corpus/core/src/triggers/types.ts +9 -23
- package/corpus/templates/analytics/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/analytics/AGENTS.md +5 -0
- package/corpus/templates/analytics/actions/hubspot-deals.ts +1 -0
- package/corpus/templates/analytics/actions/hubspot-records.ts +1 -0
- package/corpus/templates/analytics/actions/install-dashboard-template.ts +13 -4
- package/corpus/templates/analytics/actions/rename-dashboard.ts +8 -3
- package/corpus/templates/analytics/actions/restore-dashboard-revision.ts +8 -3
- package/corpus/templates/analytics/actions/update-dashboard.ts +22 -5
- package/corpus/templates/analytics/app/components/dashboard/DashboardPanelSkeleton.tsx +7 -1
- package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +1 -82
- package/corpus/templates/analytics/app/components/layout/NewDashboardDialog.tsx +4 -4
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +23 -13
- package/corpus/templates/analytics/app/global.css +21 -0
- package/corpus/templates/analytics/app/i18n-data.ts +165 -101
- package/corpus/templates/analytics/app/lib/custom-block-promotion.ts +62 -0
- package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +17 -2
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/PanelEditorDialog.tsx +3 -1
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +77 -12
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/dashboard-save-queue.ts +34 -0
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +42 -26
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/types.ts +15 -0
- package/corpus/templates/analytics/app/pages/analyses/AnalysisDetail.tsx +1 -1
- package/corpus/templates/analytics/changelog/2026-07-29-chat-history-now-closes-smoothly-and-stays-ready-when-you-re.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-29-chat-history-stays-visible-when-you-return-to-the-dashboard.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-29-custom-dashboard-blocks-now-identify-one-off-agent-patches-a.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-29-dashboard-chart-deletions-now-save-in-order-so-removed-rows-.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-29-dashboard-chart-loaders-are-easier-to-see-and-animate-more-s.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-29-plan-mode-can-now-query-connected-analytics-sources-while-ke.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-29-plan-mode-can-use-clips-as-read-only-prompt-context.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-29-signup-entry-pages-now-show-the-first-page-viewed-before-eac.md +6 -0
- package/corpus/templates/analytics/seeds/dashboards/agent-native-templates-first-party.json +26 -1
- package/corpus/templates/analytics/server/lib/agent-chat-plan-mode.ts +0 -33
- package/corpus/templates/analytics/server/lib/analytics-connector-catalog.ts +2 -0
- package/corpus/templates/analytics/server/lib/canonical-first-party-dashboard-repair.ts +13 -3
- package/corpus/templates/analytics/server/lib/dashboard-catalog.ts +9 -1
- package/corpus/templates/analytics/server/lib/first-party-analytics.ts +44 -1
- package/corpus/templates/analytics/server/lib/first-party-metric-catalog.ts +96 -16
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +18 -27
- package/corpus/templates/analytics/server/plugins/core-routes.ts +1 -0
- package/corpus/templates/assets/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/assets/app/components/layout/Sidebar.tsx +4 -8
- package/corpus/templates/assets/changelog/2026-07-29-chat-history-now-closes-smoothly-and-stays-ready-when-you-re.md +6 -0
- package/corpus/templates/assets/changelog/2026-07-29-chat-history-stays-visible-when-you-return-to-the-workspace.md +6 -0
- package/corpus/templates/assets/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/corpus/templates/brain/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/brain/app/components/layout/Sidebar.tsx +3 -7
- package/corpus/templates/brain/app/root.tsx +0 -3
- package/corpus/templates/brain/changelog/2026-07-29-chat-history-now-closes-smoothly-and-stays-ready-when-you-re.md +6 -0
- package/corpus/templates/brain/changelog/2026-07-29-chat-history-stays-visible-when-you-return-to-ask-brain.md +6 -0
- package/corpus/templates/brain/changelog/2026-07-29-extensions-are-no-longer-shown-as-a-default-command-menu-des.md +6 -0
- package/corpus/templates/brain/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/corpus/templates/calendar/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/calendar/.agents/skills/event-management/SKILL.md +25 -5
- package/corpus/templates/calendar/AGENTS.md +5 -0
- package/corpus/templates/calendar/actions/create-event.ts +43 -13
- package/corpus/templates/calendar/actions/event-action-helpers.ts +131 -1
- package/corpus/templates/calendar/actions/get-event.ts +1 -0
- package/corpus/templates/calendar/actions/manage-event-draft.ts +65 -2
- package/corpus/templates/calendar/app/components/calendar/CreateEventDialog.tsx +438 -258
- package/corpus/templates/calendar/app/components/calendar/DayView.tsx +19 -3
- package/corpus/templates/calendar/app/components/calendar/EventDetailPanel.tsx +7 -3
- package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +14 -19
- package/corpus/templates/calendar/app/components/calendar/MonthView.tsx +24 -0
- package/corpus/templates/calendar/app/components/calendar/WeekView.tsx +15 -2
- package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +1 -5
- package/corpus/templates/calendar/app/hooks/use-events.ts +51 -5
- package/corpus/templates/calendar/app/i18n-data.ts +50 -0
- package/corpus/templates/calendar/app/lib/all-day-layout.ts +9 -2
- package/corpus/templates/calendar/app/lib/event-form-initialization.ts +4 -8
- package/corpus/templates/calendar/app/lib/event-form-utils.ts +43 -8
- package/corpus/templates/calendar/app/lib/location-suggestions.ts +36 -0
- package/corpus/templates/calendar/app/lib/out-of-office.ts +87 -1
- package/corpus/templates/calendar/app/pages/CalendarView.tsx +82 -20
- package/corpus/templates/calendar/changelog/2026-07-26-out-of-office-events-now-default-to-full-days-with-a-ready.md +6 -0
- package/corpus/templates/calendar/changelog/2026-07-29-recent-calendar-locations-now-appear-as-address-suggestions-.md +6 -0
- package/corpus/templates/calendar/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/corpus/templates/calendar/changelog/2026-07-29-unnamed-events-now-use-a-title-placeholder.md +6 -0
- package/corpus/templates/calendar/server/lib/find-time.ts +29 -5
- package/corpus/templates/calendar/server/lib/google-calendar.ts +2 -0
- package/corpus/templates/calendar/server/lib/ical-fetcher.ts +1 -0
- package/corpus/templates/calendar/shared/api.ts +4 -0
- package/corpus/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/chat/app/components/layout/Sidebar.tsx +1 -5
- package/corpus/templates/chat/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/corpus/templates/clips/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/clips/app/components/library/library-layout.tsx +1 -5
- package/corpus/templates/clips/changelog/2026-07-29-fixed-system-audio-recordings-picking-up-your-microphone-in-.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-29-the-desktop-camera-preview-now-closes-after-a-recording-fin.md +6 -0
- package/corpus/templates/clips/desktop/src/app.tsx +14 -15
- package/corpus/templates/clips/desktop/src/lib/bubble-session.ts +11 -0
- package/corpus/templates/clips/desktop/src/lib/recorder.ts +9 -4
- package/corpus/templates/clips/desktop/src/lib/transcription-capture.ts +11 -0
- package/corpus/templates/clips/server/jobs/transactional-emails.ts +47 -23
- package/corpus/templates/clips/server/lib/transactional-email-store.ts +16 -6
- package/corpus/templates/content/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/content/.agents/skills/content-product-development/SKILL.md +103 -0
- package/corpus/templates/content/.agents/skills/content-product-development/references/verification.md +57 -0
- package/corpus/templates/content/AGENTS.md +2 -0
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +1 -6
- package/corpus/templates/content/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/corpus/templates/content/docs/product/README.md +115 -0
- package/corpus/templates/content/docs/product/architecture.md +98 -0
- package/corpus/templates/content/docs/product/capabilities/content.access.page-database.md +76 -0
- package/corpus/templates/content/docs/product/capabilities/content.access.row-private.md +75 -0
- package/corpus/templates/content/docs/product/capabilities/content.access.safe-aggregate.md +75 -0
- package/corpus/templates/content/docs/product/capabilities/content.access.visibility-closure.md +79 -0
- package/corpus/templates/content/docs/product/capabilities/content.action.button.md +67 -0
- package/corpus/templates/content/docs/product/capabilities/content.agent.action-parity.md +73 -0
- package/corpus/templates/content/docs/product/capabilities/content.agent.audience-safe.md +91 -0
- package/corpus/templates/content/docs/product/capabilities/content.agent.automation.md +67 -0
- package/corpus/templates/content/docs/product/capabilities/content.agent.expression-authoring.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.agent.presence.md +103 -0
- package/corpus/templates/content/docs/product/capabilities/content.agent.resource-consent.md +90 -0
- package/corpus/templates/content/docs/product/capabilities/content.agent.skill-catalog.md +67 -0
- package/corpus/templates/content/docs/product/capabilities/content.api.cms.md +70 -0
- package/corpus/templates/content/docs/product/capabilities/content.author.code.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.author.document-editor.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.author.footnotes.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.author.math.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.author.media.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.author.mermaid.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.automation.scheduled.md +67 -0
- package/corpus/templates/content/docs/product/capabilities/content.capture.enrich.md +75 -0
- package/corpus/templates/content/docs/product/capabilities/content.command.fabric.md +67 -0
- package/corpus/templates/content/docs/product/capabilities/content.comment.page-owned.md +75 -0
- package/corpus/templates/content/docs/product/capabilities/content.diff.ai-assist.md +75 -0
- package/corpus/templates/content/docs/product/capabilities/content.diff.filtered-review.md +79 -0
- package/corpus/templates/content/docs/product/capabilities/content.diff.in-place.md +80 -0
- package/corpus/templates/content/docs/product/capabilities/content.discussion.page.md +80 -0
- package/corpus/templates/content/docs/product/capabilities/content.embed.host-grant.md +70 -0
- package/corpus/templates/content/docs/product/capabilities/content.embed.mcp-app.md +69 -0
- package/corpus/templates/content/docs/product/capabilities/content.embed.surface.md +74 -0
- package/corpus/templates/content/docs/product/capabilities/content.event.committed.md +85 -0
- package/corpus/templates/content/docs/product/capabilities/content.expression.cached-result.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.expression.catalog.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.expression.language.md +76 -0
- package/corpus/templates/content/docs/product/capabilities/content.feedback.signal.md +67 -0
- package/corpus/templates/content/docs/product/capabilities/content.form.shared-engine.md +72 -0
- package/corpus/templates/content/docs/product/capabilities/content.history.queryable.md +79 -0
- package/corpus/templates/content/docs/product/capabilities/content.home.global.md +80 -0
- package/corpus/templates/content/docs/product/capabilities/content.job.durable.md +76 -0
- package/corpus/templates/content/docs/product/capabilities/content.knowledge.graph.md +67 -0
- package/corpus/templates/content/docs/product/capabilities/content.knowledge.links.md +67 -0
- package/corpus/templates/content/docs/product/capabilities/content.knowledge.search.md +67 -0
- package/corpus/templates/content/docs/product/capabilities/content.layout.responsive.md +80 -0
- package/corpus/templates/content/docs/product/capabilities/content.navigation.sidebar.md +86 -0
- package/corpus/templates/content/docs/product/capabilities/content.notification.source.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.object.block.md +76 -0
- package/corpus/templates/content/docs/product/capabilities/content.object.blocks-field.md +79 -0
- package/corpus/templates/content/docs/product/capabilities/content.object.database.md +92 -0
- package/corpus/templates/content/docs/product/capabilities/content.object.multi-membership.md +75 -0
- package/corpus/templates/content/docs/product/capabilities/content.object.page.md +76 -0
- package/corpus/templates/content/docs/product/capabilities/content.object.reference.md +75 -0
- package/corpus/templates/content/docs/product/capabilities/content.object.transclusion.md +75 -0
- package/corpus/templates/content/docs/product/capabilities/content.organization.teams.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.portability.pdf-export.md +78 -0
- package/corpus/templates/content/docs/product/capabilities/content.portability.roundtrip.md +154 -0
- package/corpus/templates/content/docs/product/capabilities/content.portability.source-representation.md +70 -0
- package/corpus/templates/content/docs/product/capabilities/content.portability.vault-export.md +80 -0
- package/corpus/templates/content/docs/product/capabilities/content.presentation.mode.md +76 -0
- package/corpus/templates/content/docs/product/capabilities/content.preset.catalog.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.property.actor.md +75 -0
- package/corpus/templates/content/docs/product/capabilities/content.property.catalog.md +76 -0
- package/corpus/templates/content/docs/product/capabilities/content.property.constraints.md +75 -0
- package/corpus/templates/content/docs/product/capabilities/content.property.guarded-change.md +76 -0
- package/corpus/templates/content/docs/product/capabilities/content.property.location.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.property.typed.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.publish.public.md +75 -0
- package/corpus/templates/content/docs/product/capabilities/content.publish.reading.md +74 -0
- package/corpus/templates/content/docs/product/capabilities/content.query.object.md +114 -0
- package/corpus/templates/content/docs/product/capabilities/content.reader.documents.md +69 -0
- package/corpus/templates/content/docs/product/capabilities/content.reader.surface.md +75 -0
- package/corpus/templates/content/docs/product/capabilities/content.relationship.edge.md +183 -0
- package/corpus/templates/content/docs/product/capabilities/content.renderer.artifact-block.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.renderer.custom-block.md +81 -0
- package/corpus/templates/content/docs/product/capabilities/content.renderer.graph.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.renderer.typed.md +92 -0
- package/corpus/templates/content/docs/product/capabilities/content.research.annotation.md +75 -0
- package/corpus/templates/content/docs/product/capabilities/content.research.citation.md +70 -0
- package/corpus/templates/content/docs/product/capabilities/content.review.code.md +67 -0
- package/corpus/templates/content/docs/product/capabilities/content.revision.suggestions.md +76 -0
- package/corpus/templates/content/docs/product/capabilities/content.rule.deterministic.md +79 -0
- package/corpus/templates/content/docs/product/capabilities/content.schedule.constraints.md +81 -0
- package/corpus/templates/content/docs/product/capabilities/content.security.private-vault.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.share.views.md +140 -0
- package/corpus/templates/content/docs/product/capabilities/content.source.adapters.md +154 -0
- package/corpus/templates/content/docs/product/capabilities/content.source.builder-codec.md +70 -0
- package/corpus/templates/content/docs/product/capabilities/content.source.catalog.md +149 -0
- package/corpus/templates/content/docs/product/capabilities/content.source.file-folder.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.source.local-bridge.md +156 -0
- package/corpus/templates/content/docs/product/capabilities/content.source.local-project.md +70 -0
- package/corpus/templates/content/docs/product/capabilities/content.source.page-link.md +70 -0
- package/corpus/templates/content/docs/product/capabilities/content.source.row-union.md +69 -0
- package/corpus/templates/content/docs/product/capabilities/content.source.spaces-files.md +75 -0
- package/corpus/templates/content/docs/product/capabilities/content.source.sync-policy.md +161 -0
- package/corpus/templates/content/docs/product/capabilities/content.system.dependencies.md +80 -0
- package/corpus/templates/content/docs/product/capabilities/content.system.my-tasks.md +75 -0
- package/corpus/templates/content/docs/product/capabilities/content.system.project-status.md +77 -0
- package/corpus/templates/content/docs/product/capabilities/content.system.research-workspace.md +80 -0
- package/corpus/templates/content/docs/product/capabilities/content.system.task-project.md +76 -0
- package/corpus/templates/content/docs/product/capabilities/content.template.governance.md +76 -0
- package/corpus/templates/content/docs/product/capabilities/content.template.graph.md +76 -0
- package/corpus/templates/content/docs/product/capabilities/content.template.item-body.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.template.update.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.time.types.md +85 -0
- package/corpus/templates/content/docs/product/capabilities/content.version.branching.md +151 -0
- package/corpus/templates/content/docs/product/capabilities/content.version.field-history.md +103 -0
- package/corpus/templates/content/docs/product/capabilities/content.view.canvas.md +94 -0
- package/corpus/templates/content/docs/product/capabilities/content.view.chart.md +91 -0
- package/corpus/templates/content/docs/product/capabilities/content.view.dynamic-create.md +137 -0
- package/corpus/templates/content/docs/product/capabilities/content.view.fast-capture.md +82 -0
- package/corpus/templates/content/docs/product/capabilities/content.view.graph.md +95 -0
- package/corpus/templates/content/docs/product/capabilities/content.view.grouping-aggregation.md +83 -0
- package/corpus/templates/content/docs/product/capabilities/content.view.map.md +77 -0
- package/corpus/templates/content/docs/product/capabilities/content.view.personal-state.md +99 -0
- package/corpus/templates/content/docs/product/capabilities/content.view.pivot.md +76 -0
- package/corpus/templates/content/docs/product/capabilities/content.view.query.md +106 -0
- package/corpus/templates/content/docs/product/capabilities/content.view.renderer-conformance.md +77 -0
- package/corpus/templates/content/docs/product/capabilities/content.view.scale.md +77 -0
- package/corpus/templates/content/docs/product/capabilities/content.view.source-query.md +159 -0
- package/corpus/templates/content/docs/product/capabilities/content.view.timeline.md +86 -0
- package/corpus/templates/content/docs/product/capabilities/content.view.tree.md +77 -0
- package/corpus/templates/content/docs/product/capabilities/content.workspace.multi-scope.md +80 -0
- package/corpus/templates/content/docs/product/capabilities/content.workspace.session-restore.md +76 -0
- package/corpus/templates/content/docs/product/capabilities/content.workspace.view-instance.md +76 -0
- package/corpus/templates/content/docs/product/capabilities/content.workspace.working-set.md +77 -0
- package/corpus/templates/content/docs/product/chapters/content.chapter.capture-research.md +20 -0
- package/corpus/templates/content/docs/product/chapters/content.chapter.connected-sources.md +20 -0
- package/corpus/templates/content/docs/product/chapters/content.chapter.consensus.md +19 -0
- package/corpus/templates/content/docs/product/chapters/content.chapter.durable-home.md +21 -0
- package/corpus/templates/content/docs/product/chapters/content.chapter.publishing-portability.md +21 -0
- package/corpus/templates/content/docs/product/chapters/content.chapter.working-systems.md +27 -0
- package/corpus/templates/content/docs/product/encyclopedia.md +559 -0
- package/corpus/templates/content/docs/product/features/content.feature.bring-your-local-work.md +39 -0
- package/corpus/templates/content/docs/product/features/content.feature.build-living-dashboards.md +34 -0
- package/corpus/templates/content/docs/product/features/content.feature.build-new-surfaces.md +33 -0
- package/corpus/templates/content/docs/product/features/content.feature.capture-into-action.md +34 -0
- package/corpus/templates/content/docs/product/features/content.feature.cite-what-you-found.md +34 -0
- package/corpus/templates/content/docs/product/features/content.feature.collaborate-in-context.md +59 -0
- package/corpus/templates/content/docs/product/features/content.feature.collect-structured-input.md +38 -0
- package/corpus/templates/content/docs/product/features/content.feature.connect-your-sources.md +38 -0
- package/corpus/templates/content/docs/product/features/content.feature.data-that-keeps-itself-right.md +45 -0
- package/corpus/templates/content/docs/product/features/content.feature.durable-foundations.md +48 -0
- package/corpus/templates/content/docs/product/features/content.feature.evolve-systems-safely.md +38 -0
- package/corpus/templates/content/docs/product/features/content.feature.explore-alternatives-safely.md +39 -0
- package/corpus/templates/content/docs/product/features/content.feature.find-your-place-again.md +40 -0
- package/corpus/templates/content/docs/product/features/content.feature.keep-your-private-vault-private.md +39 -0
- package/corpus/templates/content/docs/product/features/content.feature.living-references.md +38 -0
- package/corpus/templates/content/docs/product/features/content.feature.make-the-workspace-yours.md +40 -0
- package/corpus/templates/content/docs/product/features/content.feature.move-without-starting-over.md +38 -0
- package/corpus/templates/content/docs/product/features/content.feature.plan-work-across-time.md +39 -0
- package/corpus/templates/content/docs/product/features/content.feature.publish-with-confidence.md +43 -0
- package/corpus/templates/content/docs/product/features/content.feature.put-your-organizations-know-how-to-work.md +38 -0
- package/corpus/templates/content/docs/product/features/content.feature.read-and-annotate-anything.md +38 -0
- package/corpus/templates/content/docs/product/features/content.feature.review-changes-in-place.md +39 -0
- package/corpus/templates/content/docs/product/features/content.feature.run-projects-your-way.md +44 -0
- package/corpus/templates/content/docs/product/features/content.feature.see-your-information-your-way.md +44 -0
- package/corpus/templates/content/docs/product/features/content.feature.share-how-your-organization-works.md +38 -0
- package/corpus/templates/content/docs/product/features/content.feature.sketch-connections-keep-whats-true.md +39 -0
- package/corpus/templates/content/docs/product/features/content.feature.take-the-whole-vault-with-you.md +39 -0
- package/corpus/templates/content/docs/product/features/content.feature.trust-your-connected-sources.md +40 -0
- package/corpus/templates/content/docs/product/features/content.feature.understand-what-your-data-says.md +39 -0
- package/corpus/templates/content/docs/product/features/content.feature.when-this-happens-that-follows.md +43 -0
- package/corpus/templates/content/docs/product/features/content.feature.work-across-every-workspace.md +37 -0
- package/corpus/templates/content/docs/product/features/content.feature.work-on-content-inside-another-application.md +37 -0
- package/corpus/templates/content/docs/product/roadmap.md +878 -0
- package/corpus/templates/crm/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/crm/app/components/layout/CrmSidebar.tsx +1 -7
- package/corpus/templates/crm/app/i18n/en-US.ts +4 -0
- package/corpus/templates/crm/app/routes/settings.tsx +33 -8
- package/corpus/templates/crm/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/corpus/templates/design/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/design/.generated/bridge/editor-chrome.generated.ts +133 -63
- package/corpus/templates/design/.generated/bridge/embedded-wheel.generated.ts +19 -2
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +51 -14
- package/corpus/templates/design/app/components/design/DesignExtensionsPanel.tsx +41 -26
- package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +22 -4
- package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +216 -116
- package/corpus/templates/design/app/components/design/bridge/embedded-wheel.bridge.ts +21 -2
- package/corpus/templates/design/app/components/design/code-workbench/CodeWorkbench.tsx +5 -1
- package/corpus/templates/design/app/components/design/code-workbench/CodeWorkbenchLoader.tsx +10 -2
- package/corpus/templates/design/app/components/design/code-workbench/code-workbench-shell.ts +2 -0
- package/corpus/templates/design/app/components/design/code-workbench/explorer/ExplorerView.tsx +60 -55
- package/corpus/templates/design/app/components/design/design-canvas/content-size-report.ts +88 -2
- package/corpus/templates/design/app/components/design/multi-screen/board-surface-html.ts +3 -2
- package/corpus/templates/design/app/components/design/types.ts +4 -0
- package/corpus/templates/design/app/components/layout/Sidebar.tsx +1 -5
- package/corpus/templates/design/app/pages/design-editor/clipboard-layer-source.ts +28 -0
- package/corpus/templates/design/app/pages/design-editor/clone-and-pen-edit.ts +117 -0
- package/corpus/templates/design/app/pages/design-editor/code-layer-state.ts +3 -1
- package/corpus/templates/design/app/pages/design-editor/pending-edits.ts +120 -74
- package/corpus/templates/design/app/pages/design-editor/pending-structure-verification.ts +11 -0
- package/corpus/templates/design/app/pages/design-editor/react-semantic-handoff.ts +2 -0
- package/corpus/templates/design/app/pages/design-editor/source-location.ts +1 -1
- package/corpus/templates/design/changelog/2026-07-29-copy-rendered-ui-between-live-local-apps-and-design-files-wh.md +6 -0
- package/corpus/templates/design/changelog/2026-07-29-design-boards-stay-dark-and-viewport-height-content-keeps-it.md +6 -0
- package/corpus/templates/design/changelog/2026-07-29-design-frames-no-longer-grow-continuously-when-their-content.md +6 -0
- package/corpus/templates/design/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/corpus/templates/design/changelog/2026-07-29-the-code-panel-and-apply-design-update-control-now-use-clear.md +6 -0
- package/corpus/templates/design/changelog/2026-07-29-the-tools-panel-now-keeps-extension-creation-and-discovery-h.md +6 -0
- package/corpus/templates/design/shared/source-mode.ts +7 -1
- package/corpus/templates/dispatch/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/dispatch/app/i18n-data.ts +171 -0
- package/corpus/templates/dispatch/app/routes/browser-chat.tsx +4 -0
- package/corpus/templates/dispatch/app/routes/browser-connect.tsx +4 -0
- package/corpus/templates/dispatch/changelog/2026-07-29-browser-chat-can-securely-connect-the-agent-native-chrome-ex.md +6 -0
- package/corpus/templates/forms/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/forms/app/components/layout/Sidebar.tsx +1 -6
- package/corpus/templates/forms/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/corpus/templates/macros/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/macros/app/components/layout/AppLayout.tsx +1 -5
- package/corpus/templates/macros/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/corpus/templates/mail/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/mail/app/components/layout/AppLayout.tsx +1 -9
- package/corpus/templates/mail/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/corpus/templates/plan/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/plan/app/components/layout/Sidebar.tsx +3 -7
- package/corpus/templates/plan/app/pages/PlansPage.tsx +2 -2
- package/corpus/templates/plan/changelog/2026-07-29-chat-history-now-closes-smoothly-and-stays-ready-when-you-re.md +6 -0
- package/corpus/templates/plan/changelog/2026-07-29-chat-history-stays-visible-when-you-return-to-ask-plan.md +6 -0
- package/corpus/templates/plan/changelog/2026-07-29-fixed-plan-pages-crashing-when-recent-activity-is-unavailabl.md +6 -0
- package/corpus/templates/plan/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/corpus/templates/slides/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/slides/.agents/skills/analytics-data-for-decks/SKILL.md +48 -0
- package/corpus/templates/slides/.agents/skills/create-deck/SKILL.md +60 -4
- package/corpus/templates/slides/.agents/skills/design-systems/SKILL.md +20 -0
- package/corpus/templates/slides/.agents/skills/slide-editing/SKILL.md +30 -1
- package/corpus/templates/slides/.agents/skills/slide-images/SKILL.md +3 -1
- package/corpus/templates/slides/AGENTS.md +25 -24
- package/corpus/templates/slides/actions/check-image-gen.ts +8 -2
- package/corpus/templates/slides/actions/create-deck.ts +4 -12
- package/corpus/templates/slides/actions/export-pptx.ts +25 -3
- package/corpus/templates/slides/actions/generate-image-api.ts +4 -2
- package/corpus/templates/slides/actions/generate-slides-ai.ts +1 -1
- package/corpus/templates/slides/actions/get-deck-reference-context.ts +136 -0
- package/corpus/templates/slides/actions/get-workspace-defaults.ts +55 -0
- package/corpus/templates/slides/actions/image-gen-status.ts +10 -1
- package/corpus/templates/slides/actions/import-file.ts +53 -38
- package/corpus/templates/slides/actions/list-decks.ts +2 -0
- package/corpus/templates/slides/actions/patch-deck.ts +2 -0
- package/corpus/templates/slides/actions/set-workspace-defaults.ts +50 -0
- package/corpus/templates/slides/actions/view-screen.ts +6 -0
- package/corpus/templates/slides/app/components/comments/SlideCommentsPanel.tsx +1 -1
- package/corpus/templates/slides/app/components/deck/DeckCard.tsx +67 -3
- package/corpus/templates/slides/app/components/deck/SlideRenderer.tsx +40 -8
- package/corpus/templates/slides/app/components/design-system/DesignSystemCard.tsx +33 -8
- package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +6 -2
- package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +114 -128
- package/corpus/templates/slides/app/components/editor/ExportMenu.tsx +74 -9
- package/corpus/templates/slides/app/components/editor/ImageGenPanel.tsx +1 -1
- package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +1193 -267
- package/corpus/templates/slides/app/components/editor/SlideStyleInspector.tsx +302 -102
- package/corpus/templates/slides/app/components/editor/rich-text-selection.ts +270 -0
- package/corpus/templates/slides/app/components/editor/slide-escape-arbiter.ts +34 -0
- package/corpus/templates/slides/app/components/editor/slide-object-interactions.ts +368 -0
- package/corpus/templates/slides/app/components/editor/slide-presence.ts +13 -0
- package/corpus/templates/slides/app/components/layout/AgentWorkIndicator.tsx +23 -3
- package/corpus/templates/slides/app/components/layout/Layout.tsx +39 -6
- package/corpus/templates/slides/app/components/layout/Sidebar.tsx +1 -6
- package/corpus/templates/slides/app/components/layout/layout-route-policy.ts +23 -0
- package/corpus/templates/slides/app/components/visual-editor/DrawOverlay.tsx +0 -2
- package/corpus/templates/slides/app/context/DeckContext.tsx +2 -0
- package/corpus/templates/slides/app/global.css +60 -0
- package/corpus/templates/slides/app/hooks/use-agent-generating.ts +76 -5
- package/corpus/templates/slides/app/hooks/use-workspace-defaults.ts +26 -0
- package/corpus/templates/slides/app/i18n/en-US.ts +39 -3
- package/corpus/templates/slides/app/lib/generation-state.ts +13 -3
- package/corpus/templates/slides/app/lib/slide-image-replacement.ts +27 -6
- package/corpus/templates/slides/app/lib/text-tool-shortcut.ts +62 -0
- package/corpus/templates/slides/app/pages/DeckEditor.tsx +197 -83
- package/corpus/templates/slides/app/pages/DesignSystems.tsx +95 -0
- package/corpus/templates/slides/app/pages/Index.tsx +348 -53
- package/corpus/templates/slides/changelog/2026-07-28-pick-an-existing-deck-as-a-style-reference-when-creating-a-n.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-29-ai-editing-status-is-now-quieter-and-only-shows-slide-presen.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-29-design-systems-and-reference-decks-are-easier-to-choose-toge.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-29-generated-decks-now-receive-a-concise-relevant-title-before-.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-29-google-slides-exports-can-connect-your-google-account-direct.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-29-new-deck-prompts-reuse-empty-chats.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-29-new-deck-setup-now-stays-in-the-editor-with-closable-style-a.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-29-selected-words-and-text-runs-can-now-be-styled-independently.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-29-slide-annotation-tools-are-clearer-and-escape-now-exits-anno.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-29-slide-editing-now-opens-with-the-app-navigation-collapsed-fo.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-29-slide-editing-stays-visually-clean-on-hover-without-a-canvas.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-29-slides-now-appear-one-by-one-while-ai-builds-a-deck-with-ste.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-29-text-boxes-now-select-move-duplicate-resize-and-style-like-a.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-29-untitled-decks-now-use-a-clearer-this-deck-label-in-the-agen.md +6 -0
- package/corpus/templates/slides/server/handlers/google-docs-auth.ts +4 -2
- package/corpus/templates/slides/server/handlers/image-providers/builder.ts +305 -0
- package/corpus/templates/slides/server/handlers/image-providers/index.ts +6 -3
- package/corpus/templates/slides/server/plugins/agent-chat.ts +1 -0
- package/corpus/templates/slides/server/workspace-defaults.ts +169 -0
- package/corpus/templates/tasks/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/tasks/app/components/layout/Sidebar.tsx +31 -8
- package/corpus/templates/tasks/app/i18n/en-US.ts +7 -0
- package/corpus/templates/tasks/app/routes/settings.tsx +25 -2
- package/corpus/templates/tasks/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/corpus/toolkit/CHANGELOG.md +15 -0
- package/corpus/toolkit/README.md +2 -2
- package/corpus/toolkit/package.json +1 -1
- package/corpus/toolkit/src/app-shell/sidebar-footer-actions.tsx +0 -3
- package/corpus/toolkit/src/chat-history.css +1 -0
- package/corpus/toolkit/src/composer/ComposerPlusMenu.tsx +35 -14
- package/corpus/toolkit/src/composer/PromptComposer.tsx +6 -0
- package/corpus/toolkit/src/composer/TiptapComposer.tsx +11 -3
- package/corpus/toolkit/src/design-tweaks/visual-style-controls.tsx +64 -11
- package/dist/a2a/types.d.ts +6 -0
- package/dist/a2a/types.d.ts.map +1 -1
- package/dist/a2a/types.js.map +1 -1
- package/dist/action.d.ts +57 -0
- package/dist/action.d.ts.map +1 -1
- package/dist/action.js +9 -0
- package/dist/action.js.map +1 -1
- package/dist/agent/engine/builder-engine.js +6 -4
- package/dist/agent/engine/builder-engine.js.map +1 -1
- package/dist/agent/production-agent.d.ts +11 -1
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +131 -90
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/tool-search.d.ts +4 -0
- package/dist/agent/tool-search.d.ts.map +1 -1
- package/dist/agent/tool-search.js +30 -0
- package/dist/agent/tool-search.js.map +1 -1
- package/dist/automations/service.d.ts +85 -0
- package/dist/automations/service.d.ts.map +1 -0
- package/dist/automations/service.js +332 -0
- package/dist/automations/service.js.map +1 -0
- package/dist/browser-context/index.d.ts +579 -0
- package/dist/browser-context/index.d.ts.map +1 -0
- package/dist/browser-context/index.js +331 -0
- package/dist/browser-context/index.js.map +1 -0
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +1 -1
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/FeedbackButton.d.ts +6 -2
- package/dist/client/FeedbackButton.d.ts.map +1 -1
- package/dist/client/FeedbackButton.js +20 -3
- package/dist/client/FeedbackButton.js.map +1 -1
- package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
- package/dist/client/MultiTabAssistantChat.js +19 -2
- package/dist/client/MultiTabAssistantChat.js.map +1 -1
- package/dist/client/agent-chat.d.ts +15 -0
- package/dist/client/agent-chat.d.ts.map +1 -1
- package/dist/client/agent-chat.js +13 -3
- package/dist/client/agent-chat.js.map +1 -1
- package/dist/client/agent-page/AgentJobsTab.d.ts +1 -0
- package/dist/client/agent-page/AgentJobsTab.d.ts.map +1 -1
- package/dist/client/agent-page/AgentJobsTab.js +186 -98
- package/dist/client/agent-page/AgentJobsTab.js.map +1 -1
- package/dist/client/agent-page/AgentTabsPage.js +4 -4
- package/dist/client/agent-page/AgentTabsPage.js.map +1 -1
- package/dist/client/agent-page/use-jobs.d.ts +7 -0
- package/dist/client/agent-page/use-jobs.d.ts.map +1 -1
- package/dist/client/agent-page/use-jobs.js.map +1 -1
- package/dist/client/analytics-session.d.ts.map +1 -1
- package/dist/client/analytics-session.js +13 -0
- package/dist/client/analytics-session.js.map +1 -1
- package/dist/client/extensions/ExtensionViewer.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionViewer.js +29 -6
- package/dist/client/extensions/ExtensionViewer.js.map +1 -1
- package/dist/client/settings/AutomationsSection.d.ts +0 -9
- package/dist/client/settings/AutomationsSection.d.ts.map +1 -1
- package/dist/client/settings/AutomationsSection.js +9 -168
- package/dist/client/settings/AutomationsSection.js.map +1 -1
- package/dist/client/settings/SettingsPanel.d.ts +9 -1
- package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
- package/dist/client/settings/SettingsPanel.js +19 -11
- package/dist/client/settings/SettingsPanel.js.map +1 -1
- package/dist/client/settings/index.d.ts +1 -1
- package/dist/client/settings/index.d.ts.map +1 -1
- package/dist/client/settings/index.js +1 -1
- package/dist/client/settings/index.js.map +1 -1
- package/dist/client/use-agent-chat.d.ts.map +1 -1
- package/dist/client/use-agent-chat.js +20 -3
- package/dist/client/use-agent-chat.js.map +1 -1
- package/dist/client/use-chat-threads.d.ts.map +1 -1
- package/dist/client/use-chat-threads.js +4 -17
- package/dist/client/use-chat-threads.js.map +1 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/awareness.d.ts.map +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/deploy/build.d.ts.map +1 -1
- package/dist/deploy/build.js +2 -1
- package/dist/deploy/build.js.map +1 -1
- package/dist/deploy/workspace-deploy.d.ts.map +1 -1
- package/dist/deploy/workspace-deploy.js +2 -1
- package/dist/deploy/workspace-deploy.js.map +1 -1
- package/dist/extensions/actions.d.ts.map +1 -1
- package/dist/extensions/actions.js +82 -6
- package/dist/extensions/actions.js.map +1 -1
- package/dist/extensions/fetch-tool.d.ts.map +1 -1
- package/dist/extensions/fetch-tool.js +11 -0
- package/dist/extensions/fetch-tool.js.map +1 -1
- package/dist/extensions/routes.d.ts +5 -1
- package/dist/extensions/routes.d.ts.map +1 -1
- package/dist/extensions/routes.js +7 -1
- package/dist/extensions/routes.js.map +1 -1
- package/dist/extensions/web-content.d.ts +1 -0
- package/dist/extensions/web-content.d.ts.map +1 -1
- package/dist/extensions/web-content.js +82 -1
- package/dist/extensions/web-content.js.map +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/integrations/computer-supervision.d.ts.map +1 -1
- package/dist/integrations/computer-supervision.js +22 -1
- package/dist/integrations/computer-supervision.js.map +1 -1
- package/dist/integrations/index.d.ts +3 -2
- package/dist/integrations/index.d.ts.map +1 -1
- package/dist/integrations/index.js +3 -2
- package/dist/integrations/index.js.map +1 -1
- package/dist/integrations/integration-durable-dispatch-config.d.ts +2 -0
- package/dist/integrations/integration-durable-dispatch-config.d.ts.map +1 -1
- package/dist/integrations/integration-durable-dispatch-config.js +4 -0
- package/dist/integrations/integration-durable-dispatch-config.js.map +1 -1
- package/dist/integrations/integration-durable-dispatch.d.ts +2 -2
- package/dist/integrations/integration-durable-dispatch.d.ts.map +1 -1
- package/dist/integrations/integration-durable-dispatch.js +2 -2
- package/dist/integrations/integration-durable-dispatch.js.map +1 -1
- package/dist/integrations/plugin.d.ts.map +1 -1
- package/dist/integrations/plugin.js +84 -39
- package/dist/integrations/plugin.js.map +1 -1
- package/dist/integrations/remote-browser-actions.d.ts +7 -0
- package/dist/integrations/remote-browser-actions.d.ts.map +1 -0
- package/dist/integrations/remote-browser-actions.js +482 -0
- package/dist/integrations/remote-browser-actions.js.map +1 -0
- package/dist/jobs/actions/list-recurring-jobs.d.ts.map +1 -1
- package/dist/jobs/actions/list-recurring-jobs.js +4 -6
- package/dist/jobs/actions/list-recurring-jobs.js.map +1 -1
- package/dist/jobs/actions/manage-recurring-job.js +3 -6
- package/dist/jobs/actions/manage-recurring-job.js.map +1 -1
- package/dist/jobs/background-automation-runner.d.ts +76 -0
- package/dist/jobs/background-automation-runner.d.ts.map +1 -0
- package/dist/jobs/background-automation-runner.js +288 -0
- package/dist/jobs/background-automation-runner.js.map +1 -0
- package/dist/jobs/frontmatter.d.ts +63 -0
- package/dist/jobs/frontmatter.d.ts.map +1 -0
- package/dist/jobs/frontmatter.js +216 -0
- package/dist/jobs/frontmatter.js.map +1 -0
- package/dist/jobs/scheduler.d.ts +6 -60
- package/dist/jobs/scheduler.d.ts.map +1 -1
- package/dist/jobs/scheduler.js +67 -484
- package/dist/jobs/scheduler.js.map +1 -1
- package/dist/jobs/tools.d.ts.map +1 -1
- package/dist/jobs/tools.js +24 -3
- package/dist/jobs/tools.js.map +1 -1
- package/dist/localization/default-messages.d.ts +28 -33
- package/dist/localization/default-messages.d.ts.map +1 -1
- package/dist/localization/default-messages.js +34 -39
- package/dist/localization/default-messages.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/mcp-client/index.d.ts.map +1 -1
- package/dist/mcp-client/index.js +4 -0
- package/dist/mcp-client/index.js.map +1 -1
- package/dist/notifications/actions.d.ts.map +1 -1
- package/dist/notifications/actions.js +5 -0
- package/dist/notifications/actions.js.map +1 -1
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/progress/actions.d.ts.map +1 -1
- package/dist/progress/actions.js +5 -0
- package/dist/progress/actions.js.map +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +14 -14
- package/dist/provider-api/actions/github-repo-files.d.ts.map +1 -1
- package/dist/provider-api/actions/github-repo-files.js +9 -0
- package/dist/provider-api/actions/github-repo-files.js.map +1 -1
- package/dist/provider-api/actions/provider-api.d.ts +16 -16
- package/dist/provider-api/actions/provider-api.d.ts.map +1 -1
- package/dist/provider-api/actions/provider-api.js +14 -0
- package/dist/provider-api/actions/provider-api.js.map +1 -1
- package/dist/provider-api/corpus-jobs.d.ts +2 -2
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/server/action-discovery.d.ts.map +1 -1
- package/dist/server/action-discovery.js +5 -0
- package/dist/server/action-discovery.js.map +1 -1
- package/dist/server/agent-capabilities.d.ts.map +1 -1
- package/dist/server/agent-capabilities.js +32 -3
- package/dist/server/agent-capabilities.js.map +1 -1
- package/dist/server/agent-chat/action-filters-a2a.d.ts +17 -1
- package/dist/server/agent-chat/action-filters-a2a.d.ts.map +1 -1
- package/dist/server/agent-chat/action-filters-a2a.js +50 -1
- package/dist/server/agent-chat/action-filters-a2a.js.map +1 -1
- package/dist/server/agent-chat/browser-team-tools.d.ts.map +1 -1
- package/dist/server/agent-chat/browser-team-tools.js +90 -3
- package/dist/server/agent-chat/browser-team-tools.js.map +1 -1
- package/dist/server/agent-chat/framework-prompts.d.ts.map +1 -1
- package/dist/server/agent-chat/framework-prompts.js +7 -11
- package/dist/server/agent-chat/framework-prompts.js.map +1 -1
- package/dist/server/agent-chat/plugin-options.d.ts +3 -3
- package/dist/server/agent-chat/plugin-options.js.map +1 -1
- package/dist/server/agent-chat/script-entries.d.ts.map +1 -1
- package/dist/server/agent-chat/script-entries.js +43 -1
- package/dist/server/agent-chat/script-entries.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +24 -5
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/attribution.d.ts +6 -0
- package/dist/server/attribution.d.ts.map +1 -1
- package/dist/server/attribution.js +14 -14
- package/dist/server/attribution.js.map +1 -1
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +5 -2
- package/dist/server/auth.js.map +1 -1
- package/dist/server/better-auth-instance.d.ts +2 -1
- package/dist/server/better-auth-instance.d.ts.map +1 -1
- package/dist/server/better-auth-instance.js +6 -3
- package/dist/server/better-auth-instance.js.map +1 -1
- package/dist/server/core-routes-plugin.d.ts +7 -0
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +3 -1
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/csrf.d.ts.map +1 -1
- package/dist/server/csrf.js +25 -0
- package/dist/server/csrf.js.map +1 -1
- package/dist/server/google-oauth.d.ts +3 -0
- package/dist/server/google-oauth.d.ts.map +1 -1
- package/dist/server/google-oauth.js +12 -1
- package/dist/server/google-oauth.js.map +1 -1
- package/dist/server/onboarding-html.d.ts.map +1 -1
- package/dist/server/onboarding-html.js +18 -0
- package/dist/server/onboarding-html.js.map +1 -1
- package/dist/server/prompts/framework-core-compact.js +3 -3
- package/dist/server/prompts/framework-core-compact.js.map +1 -1
- package/dist/server/prompts/framework-core.js +3 -3
- package/dist/server/prompts/framework-core.js.map +1 -1
- package/dist/server/prompts/shared-rules.js +3 -3
- package/dist/server/prompts/shared-rules.js.map +1 -1
- package/dist/settings/index.d.ts +1 -1
- package/dist/settings/index.d.ts.map +1 -1
- package/dist/settings/index.js +1 -1
- package/dist/settings/index.js.map +1 -1
- package/dist/shared/analytics-anonymous-id.d.ts +12 -0
- package/dist/shared/analytics-anonymous-id.d.ts.map +1 -0
- package/dist/shared/analytics-anonymous-id.js +29 -0
- package/dist/shared/analytics-anonymous-id.js.map +1 -0
- package/dist/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/dist/templates/chat/app/components/layout/Sidebar.tsx +1 -5
- package/dist/templates/chat/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/dist/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/dist/templates/default/app/i18n/ar-SA.ts +26 -0
- package/dist/templates/default/app/i18n/de-DE.ts +28 -0
- package/dist/templates/default/app/i18n/en-US.ts +27 -0
- package/dist/templates/default/app/i18n/es-ES.ts +28 -0
- package/dist/templates/default/app/i18n/fr-FR.ts +28 -0
- package/dist/templates/default/app/i18n/hi-IN.ts +25 -0
- package/dist/templates/default/app/i18n/ja-JP.ts +27 -0
- package/dist/templates/default/app/i18n/ko-KR.ts +27 -0
- package/dist/templates/default/app/i18n/pt-BR.ts +27 -0
- package/dist/templates/default/app/i18n/zh-CN.ts +24 -0
- package/dist/templates/default/app/i18n/zh-TW.ts +24 -0
- package/dist/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/dist/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/dist/templates/workspace-core/.agents/skills/agent-page/SKILL.md +10 -7
- package/dist/templates/workspace-core/.agents/skills/automations/SKILL.md +53 -8
- package/dist/templates/workspace-core/.agents/skills/browser-sessions/SKILL.md +131 -0
- package/dist/templates/workspace-core/.agents/skills/extension-points/SKILL.md +13 -4
- package/dist/templates/workspace-core/.agents/skills/extensions/SKILL.md +23 -15
- package/dist/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +33 -18
- package/dist/tracking/providers.d.ts.map +1 -1
- package/dist/tracking/providers.js +1 -0
- package/dist/tracking/providers.js.map +1 -1
- package/dist/tracking/registry.d.ts +1 -0
- package/dist/tracking/registry.d.ts.map +1 -1
- package/dist/tracking/registry.js +1 -0
- package/dist/tracking/registry.js.map +1 -1
- package/dist/tracking/types.d.ts +1 -0
- package/dist/tracking/types.d.ts.map +1 -1
- package/dist/tracking/types.js.map +1 -1
- package/dist/triggers/actions/list-automations.d.ts +7 -0
- package/dist/triggers/actions/list-automations.d.ts.map +1 -1
- package/dist/triggers/actions/list-automations.js +29 -41
- package/dist/triggers/actions/list-automations.js.map +1 -1
- package/dist/triggers/actions/manage-automation.js +15 -33
- package/dist/triggers/actions/manage-automation.js.map +1 -1
- package/dist/triggers/actions.d.ts.map +1 -1
- package/dist/triggers/actions.js +184 -95
- package/dist/triggers/actions.js.map +1 -1
- package/dist/triggers/dispatcher.d.ts +3 -9
- package/dist/triggers/dispatcher.d.ts.map +1 -1
- package/dist/triggers/dispatcher.js +134 -304
- package/dist/triggers/dispatcher.js.map +1 -1
- package/dist/triggers/routes.d.ts.map +1 -1
- package/dist/triggers/routes.js +76 -17
- package/dist/triggers/routes.js.map +1 -1
- package/dist/triggers/types.d.ts +4 -23
- package/dist/triggers/types.d.ts.map +1 -1
- package/dist/triggers/types.js.map +1 -1
- package/docs/content/agent-surfaces.mdx +4 -4
- package/docs/content/automations.mdx +61 -12
- package/docs/content/deployment.mdx +11 -4
- package/docs/content/extensions.mdx +39 -33
- package/docs/content/recurring-jobs.mdx +41 -19
- package/docs/content/template-dispatch-operations.mdx +19 -7
- package/package.json +4 -2
- package/src/a2a/types.ts +6 -0
- package/src/action.ts +68 -0
- package/src/agent/engine/builder-engine.ts +8 -4
- package/src/agent/production-agent.ts +175 -100
- package/src/agent/tool-search.ts +36 -0
- package/src/automations/service.ts +506 -0
- package/src/browser-context/index.ts +392 -0
- package/src/client/AgentPanel.tsx +2 -1
- package/src/client/FeedbackButton.tsx +37 -4
- package/src/client/MultiTabAssistantChat.tsx +21 -0
- package/src/client/agent-chat.ts +31 -3
- package/src/client/agent-page/AgentJobsTab.tsx +438 -310
- package/src/client/agent-page/AgentTabsPage.tsx +4 -4
- package/src/client/agent-page/use-jobs.ts +7 -0
- package/src/client/analytics-session.ts +13 -0
- package/src/client/extensions/ExtensionViewer.tsx +67 -0
- package/src/client/settings/AutomationsSection.tsx +27 -499
- package/src/client/settings/SettingsPanel.tsx +32 -11
- package/src/client/settings/index.ts +2 -0
- package/src/client/use-agent-chat.ts +35 -3
- package/src/client/use-chat-threads.ts +8 -25
- package/src/deploy/build.ts +2 -0
- package/src/deploy/workspace-deploy.ts +2 -0
- package/src/extensions/actions.ts +115 -3
- package/src/extensions/fetch-tool.ts +11 -0
- package/src/extensions/routes.ts +16 -1
- package/src/extensions/web-content.ts +96 -1
- package/src/integrations/computer-supervision.ts +33 -1
- package/src/integrations/index.ts +6 -0
- package/src/integrations/integration-durable-dispatch-config.ts +10 -0
- package/src/integrations/integration-durable-dispatch.ts +4 -0
- package/src/integrations/plugin.ts +94 -41
- package/src/integrations/remote-browser-actions.ts +621 -0
- package/src/jobs/actions/list-recurring-jobs.ts +5 -7
- package/src/jobs/actions/manage-recurring-job.ts +3 -7
- package/src/jobs/background-automation-runner.ts +437 -0
- package/src/jobs/frontmatter.ts +308 -0
- package/src/jobs/scheduler.ts +89 -598
- package/src/jobs/tools.ts +22 -3
- package/src/localization/default-messages.ts +45 -45
- package/src/mcp-client/index.ts +6 -0
- package/src/notifications/actions.ts +5 -0
- package/src/progress/actions.ts +5 -0
- package/src/provider-api/actions/github-repo-files.ts +11 -0
- package/src/provider-api/actions/provider-api.ts +13 -0
- package/src/server/__snapshots__/agent-chat-plugin.surface.spec.ts.snap +4 -4
- package/src/server/action-discovery.ts +7 -0
- package/src/server/agent-capabilities.ts +43 -8
- package/src/server/agent-chat/action-filters-a2a.ts +63 -1
- package/src/server/agent-chat/browser-team-tools.ts +126 -3
- package/src/server/agent-chat/framework-prompts.ts +7 -11
- package/src/server/agent-chat/plugin-options.ts +3 -3
- package/src/server/agent-chat/script-entries.ts +52 -1
- package/src/server/agent-chat-plugin.ts +25 -5
- package/src/server/attribution.ts +22 -0
- package/src/server/auth.ts +20 -6
- package/src/server/better-auth-instance.ts +10 -2
- package/src/server/core-routes-plugin.ts +10 -1
- package/src/server/csrf.ts +25 -0
- package/src/server/google-oauth.ts +21 -1
- package/src/server/onboarding-html.ts +18 -0
- package/src/server/prompts/framework-core-compact.ts +3 -3
- package/src/server/prompts/framework-core.ts +3 -3
- package/src/server/prompts/shared-rules.ts +3 -3
- package/src/settings/index.ts +1 -0
- package/src/shared/analytics-anonymous-id.ts +35 -0
- package/src/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/src/templates/chat/app/components/layout/Sidebar.tsx +1 -5
- package/src/templates/chat/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/src/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/src/templates/default/app/i18n/ar-SA.ts +26 -0
- package/src/templates/default/app/i18n/de-DE.ts +28 -0
- package/src/templates/default/app/i18n/en-US.ts +27 -0
- package/src/templates/default/app/i18n/es-ES.ts +28 -0
- package/src/templates/default/app/i18n/fr-FR.ts +28 -0
- package/src/templates/default/app/i18n/hi-IN.ts +25 -0
- package/src/templates/default/app/i18n/ja-JP.ts +27 -0
- package/src/templates/default/app/i18n/ko-KR.ts +27 -0
- package/src/templates/default/app/i18n/pt-BR.ts +27 -0
- package/src/templates/default/app/i18n/zh-CN.ts +24 -0
- package/src/templates/default/app/i18n/zh-TW.ts +24 -0
- package/src/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/src/templates/workspace-core/.agents/skills/agent-page/SKILL.md +10 -7
- package/src/templates/workspace-core/.agents/skills/automations/SKILL.md +53 -8
- package/src/templates/workspace-core/.agents/skills/browser-sessions/SKILL.md +131 -0
- package/src/templates/workspace-core/.agents/skills/extension-points/SKILL.md +13 -4
- package/src/templates/workspace-core/.agents/skills/extensions/SKILL.md +23 -15
- package/src/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +33 -18
- package/src/tracking/providers.ts +1 -0
- package/src/tracking/registry.ts +2 -1
- package/src/tracking/types.ts +1 -0
- package/src/triggers/actions/list-automations.ts +43 -44
- package/src/triggers/actions/manage-automation.ts +17 -48
- package/src/triggers/actions.ts +218 -127
- package/src/triggers/dispatcher.ts +181 -367
- package/src/triggers/routes.ts +84 -27
- package/src/triggers/types.ts +9 -23
|
@@ -22,7 +22,7 @@ import { lazyFs } from "./lazy-fs.js";
|
|
|
22
22
|
export function buildFrameworkPrompts(examples, options) {
|
|
23
23
|
const FRAMEWORK_CORE = buildFrameworkCore(examples, options);
|
|
24
24
|
const FRAMEWORK_CORE_COMPACT = buildFrameworkCoreCompact(examples, options);
|
|
25
|
-
const extensionToolsEnabled = options?.extensionTools
|
|
25
|
+
const extensionToolsEnabled = options?.extensionTools === true;
|
|
26
26
|
const planModeArtifactList = extensionToolsEnabled
|
|
27
27
|
? "source-code handoffs and app-created artifacts such as extensions, widgets, dashboards, calculators, mini-apps, documents, designs, slides, or videos"
|
|
28
28
|
: "source-code handoffs and app-created artifacts such as documents, designs, slides, or videos";
|
|
@@ -30,38 +30,34 @@ export function buildFrameworkPrompts(examples, options) {
|
|
|
30
30
|
? "`render-inline-extension`, `create-extension`, `update-extension`, `connect-builder`, or any action that creates, updates, deletes, sends, publishes, or persists data"
|
|
31
31
|
: "`connect-builder`, or any action that creates, updates, deletes, sends, publishes, or persists data";
|
|
32
32
|
const extensionConnectBuilderGuard = extensionToolsEnabled
|
|
33
|
-
? "
|
|
34
|
-
: "
|
|
33
|
+
? "Prefer native app artifacts and actions. Use an extension only when the user explicitly requests one, or when the result is clearly bespoke and one-off and the native format cannot express it. Reusable or product-wide behavior belongs in app code. If the exact placement or behavior requires changing the host UI or no suitable slot exists, continue with the normal `connect-builder` source-change flow even if the user called it an extension; never stop at saying extensions cannot do it."
|
|
34
|
+
: "";
|
|
35
35
|
const extensionInstructionsFull = extensionToolsEnabled
|
|
36
36
|
? `### Generative UI and Extensions (Mini-Apps)
|
|
37
37
|
|
|
38
38
|
In Act mode, if the user asks for generated interactive UI in chat, choose the smallest extension action for the lifetime: \`render-inline-extension\` (one-off, chat-only), \`create-extension\` (saved/reusable), \`show-extension-inline\` (reopen a saved one), or \`update-extension\` (edit an existing one) — call the right one directly, without a "let me build…" preamble. Each tool's own description covers its exact use case, arguments, and available helpers (appAction, dbQuery, extensionData, agentNative.ui.output, etc.). Extensions are sandboxed mini-apps, not source-code changes, and never go through \`connect-builder\`.
|
|
39
39
|
|
|
40
|
-
If the app exposes native actions or instructions for dashboards, reports, analyses, charts, documents, decks, or other domain artifacts, use those app-native actions first. Choose an extension only when the user explicitly asks for an extension/custom mini-app, or when the app's native artifact format cannot faithfully express the requested interaction.
|
|
40
|
+
If the app exposes native actions or instructions for dashboards, reports, analyses, charts, documents, decks, or other domain artifacts, use those app-native actions first. Choose an extension only when the user explicitly asks for an extension/custom mini-app, or when the result is clearly bespoke and one-off and the app's native artifact format cannot faithfully express the requested interaction. Reusable or product-wide behavior belongs in app code.
|
|
41
41
|
|
|
42
42
|
Editing an existing extension (fix, restyle, rename, add behavior) is a SQL data update — call \`update-extension\` directly using the extensionId from \`<current-screen>\`/\`<current-url>\` when present; never call \`connect-builder\` for it.
|
|
43
43
|
|
|
44
44
|
Extensions render only on their own page or inside an existing named slot; they cannot inject UI into arbitrary native components. If an extension could only approximate the request in a different location, do not silently downgrade the requirement and do not end with "extensions cannot do that." Briefly explain the boundary, then follow the normal source-code handoff so the app can still be customized fully.
|
|
45
45
|
|
|
46
46
|
For helper APIs, Alpine.js patterns, the extension-vs-code-change boundary, and worked examples, read the \`extensions\` and \`generative-ui\` skills.`
|
|
47
|
-
:
|
|
48
|
-
|
|
49
|
-
Extension creation and management tools are disabled for this app. Do not claim you can create, edit, hide, or delete Agent-Native extensions unless the template exposes its own typed action for that workflow. For requests that would otherwise be handled as an extension/widget/dashboard/calculator mini-app, explain that this app has disabled extension tools and use the app's available actions instead.`;
|
|
47
|
+
: "";
|
|
50
48
|
const extensionInstructionsCompact = extensionToolsEnabled
|
|
51
49
|
? `### Generative UI and Extensions (Mini-Apps)
|
|
52
50
|
|
|
53
51
|
In Act mode, choose the smallest extension action for the lifetime: \`render-inline-extension\` (one-off, chat-only), \`create-extension\` (saved/reusable), \`show-extension-inline\` (reopen a saved one), or \`update-extension\` (edit an existing one) — each tool's own description covers its use case and helpers. These are sandboxed mini-apps, not code changes; never route them through \`connect-builder\`. Do not preface with "let me build…" — just call the right extension action.
|
|
54
52
|
|
|
55
|
-
Use app-native artifact actions first when they exist for dashboards, reports, analyses, charts, documents, decks, or similar domain artifacts. Pick \`create-extension\` only for explicit extension/custom mini-app requests or
|
|
53
|
+
Use app-native artifact actions first when they exist for dashboards, reports, analyses, charts, documents, decks, or similar domain artifacts. Pick \`create-extension\` only for explicit extension/custom mini-app requests, or when the result is clearly bespoke and one-off and the native artifact format cannot support it. Reusable or product-wide behavior belongs in app code.
|
|
56
54
|
|
|
57
55
|
Editing an existing extension is a data update — call \`update-extension\` directly using the extensionId from \`<current-screen>\`/\`<current-url>\` when present; never \`connect-builder\`.
|
|
58
56
|
|
|
59
57
|
Extensions can render only on their own page or in an existing named slot; they cannot inject UI into arbitrary native components. If the exact request changes host chrome, native components, layout, styles, routes, business logic, or needs placement where no slot exists, treat it as a source-code change and use the normal \`connect-builder\` flow even if the user called it an extension. Never stop at "extensions cannot do that" or silently offer a different placement; explain the boundary briefly and continue the code-change handoff.
|
|
60
58
|
|
|
61
59
|
See the \`extensions\` and \`generative-ui\` skills for helper APIs, Alpine.js patterns, and worked examples.`
|
|
62
|
-
:
|
|
63
|
-
|
|
64
|
-
Extension creation and management tools are disabled for this app. Do not claim you can create, edit, hide, or delete Agent-Native extensions unless the template exposes its own typed action for that workflow.`;
|
|
60
|
+
: "";
|
|
65
61
|
const PROD_FRAMEWORK_PROMPT = `## Agent-Native Framework — Production Mode
|
|
66
62
|
|
|
67
63
|
You are an AI agent in an agent-native application, running in **production mode**.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framework-prompts.js","sourceRoot":"","sources":["../../../src/server/agent-chat/framework-prompts.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,WAAW,CAAC;AAIjC,OAAO,EACL,kBAAkB,EAClB,yBAAyB,GAE1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,uBAA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C,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM;SAChC,CAAC,CAAC;QACH,IAAI,KAAK;YACP,MAAM,YAAY,CAChB,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,EAC9B,OAAO,EACP,KAAK,GAAG,CAAC,EACT,OAAO,CACR,CAAC;IACN,CAAC;AACH,CAAC","sourcesContent":["import nodePath from \"node:path\";\n\nimport type { ActionEntry } from \"../../agent/production-agent.js\";\nimport type { DatabaseToolsOption } from \"../../scripts/db/tool-mode.js\";\nimport {\n buildFrameworkCore,\n buildFrameworkCoreCompact,\n type PromptExamples,\n} from \"../prompts/index.js\";\nimport { getRequestOrgId } from \"../request-context.js\";\nimport { loadSchemaPromptBlock } from \"../schema-prompt.js\";\nimport { resolveInitialToolNames } from \"./action-filters-a2a.js\";\nimport {\n createDataWidgetActionEntries,\n FRAMEWORK_CONTEXT_SECTIONS,\n} from \"./context-tools.js\";\nimport { lazyFs } from \"./lazy-fs.js\";\n\n// ---------------------------------------------------------------------------\n// Framework-level system prompt assembly (production/dev, full/compact),\n// the \"Available Actions\" and corpus-tools prompt sections, the SQL schema\n// block, and the codebase file-tree walker used by a few dev-mode tools.\n// ---------------------------------------------------------------------------\n\n/**\n * Framework-level instructions injected into every agent's system prompt.\n * Prompt text lives in packages/core/src/server/prompts/ so this file stays\n * focused on routing and assembly logic.\n *\n * buildFrameworkPrompts() is called once per plugin instantiation (not per\n * request) with the template's promptExamples, producing the four assembled\n * prompt strings used at request time.\n */\nexport function buildFrameworkPrompts(\n examples?: PromptExamples,\n options?: { databaseTools?: DatabaseToolsOption; extensionTools?: boolean },\n): {\n FRAMEWORK_CORE: string;\n FRAMEWORK_CORE_COMPACT: string;\n PROD_FRAMEWORK_PROMPT: string;\n DEV_FRAMEWORK_PROMPT: string;\n PROD_FRAMEWORK_PROMPT_COMPACT: string;\n DEV_FRAMEWORK_PROMPT_COMPACT: string;\n} {\n const FRAMEWORK_CORE = buildFrameworkCore(examples, options);\n const FRAMEWORK_CORE_COMPACT = buildFrameworkCoreCompact(examples, options);\n const extensionToolsEnabled = options?.extensionTools !== false;\n const planModeArtifactList = extensionToolsEnabled\n ? \"source-code handoffs and app-created artifacts such as extensions, widgets, dashboards, calculators, mini-apps, documents, designs, slides, or videos\"\n : \"source-code handoffs and app-created artifacts such as documents, designs, slides, or videos\";\n const planModeBlockedTools = extensionToolsEnabled\n ? \"`render-inline-extension`, `create-extension`, `update-extension`, `connect-builder`, or any action that creates, updates, deletes, sends, publishes, or persists data\"\n : \"`connect-builder`, or any action that creates, updates, deletes, sends, publishes, or persists data\";\n const extensionConnectBuilderGuard = extensionToolsEnabled\n ? \"If the complete request can be satisfied by a self-contained extension or an existing named slot, use `render-inline-extension`, `create-extension`, `show-extension-inline`, or `update-extension` instead. If the exact placement or behavior requires changing the host UI or no suitable slot exists, continue with the normal `connect-builder` source-change flow even if the user called it an extension; never stop at saying extensions cannot do it.\"\n : \"Because extension tools are disabled, do NOT invent an extension workflow. Only use `connect-builder` when the request genuinely requires changing the host app's source code.\";\n const extensionInstructionsFull = extensionToolsEnabled\n ? `### Generative UI and Extensions (Mini-Apps)\n\nIn Act mode, if the user asks for generated interactive UI in chat, choose the smallest extension action for the lifetime: \\`render-inline-extension\\` (one-off, chat-only), \\`create-extension\\` (saved/reusable), \\`show-extension-inline\\` (reopen a saved one), or \\`update-extension\\` (edit an existing one) — call the right one directly, without a \"let me build…\" preamble. Each tool's own description covers its exact use case, arguments, and available helpers (appAction, dbQuery, extensionData, agentNative.ui.output, etc.). Extensions are sandboxed mini-apps, not source-code changes, and never go through \\`connect-builder\\`.\n\nIf the app exposes native actions or instructions for dashboards, reports, analyses, charts, documents, decks, or other domain artifacts, use those app-native actions first. Choose an extension only when the user explicitly asks for an extension/custom mini-app, or when the app's native artifact format cannot faithfully express the requested interaction.\n\nEditing an existing extension (fix, restyle, rename, add behavior) is a SQL data update — call \\`update-extension\\` directly using the extensionId from \\`<current-screen>\\`/\\`<current-url>\\` when present; never call \\`connect-builder\\` for it.\n\nExtensions render only on their own page or inside an existing named slot; they cannot inject UI into arbitrary native components. If an extension could only approximate the request in a different location, do not silently downgrade the requirement and do not end with \"extensions cannot do that.\" Briefly explain the boundary, then follow the normal source-code handoff so the app can still be customized fully.\n\nFor helper APIs, Alpine.js patterns, the extension-vs-code-change boundary, and worked examples, read the \\`extensions\\` and \\`generative-ui\\` skills.`\n : `### Extensions Disabled\n\nExtension creation and management tools are disabled for this app. Do not claim you can create, edit, hide, or delete Agent-Native extensions unless the template exposes its own typed action for that workflow. For requests that would otherwise be handled as an extension/widget/dashboard/calculator mini-app, explain that this app has disabled extension tools and use the app's available actions instead.`;\n const extensionInstructionsCompact = extensionToolsEnabled\n ? `### Generative UI and Extensions (Mini-Apps)\n\nIn Act mode, choose the smallest extension action for the lifetime: \\`render-inline-extension\\` (one-off, chat-only), \\`create-extension\\` (saved/reusable), \\`show-extension-inline\\` (reopen a saved one), or \\`update-extension\\` (edit an existing one) — each tool's own description covers its use case and helpers. These are sandboxed mini-apps, not code changes; never route them through \\`connect-builder\\`. Do not preface with \"let me build…\" — just call the right extension action.\n\nUse app-native artifact actions first when they exist for dashboards, reports, analyses, charts, documents, decks, or similar domain artifacts. Pick \\`create-extension\\` only for explicit extension/custom mini-app requests or for behavior the native artifact format cannot support.\n\nEditing an existing extension is a data update — call \\`update-extension\\` directly using the extensionId from \\`<current-screen>\\`/\\`<current-url>\\` when present; never \\`connect-builder\\`.\n\nExtensions can render only on their own page or in an existing named slot; they cannot inject UI into arbitrary native components. If the exact request changes host chrome, native components, layout, styles, routes, business logic, or needs placement where no slot exists, treat it as a source-code change and use the normal \\`connect-builder\\` flow even if the user called it an extension. Never stop at \"extensions cannot do that\" or silently offer a different placement; explain the boundary briefly and continue the code-change handoff.\n\nSee the \\`extensions\\` and \\`generative-ui\\` skills for helper APIs, Alpine.js patterns, and worked examples.`\n : `### Extensions Disabled\n\nExtension creation and management tools are disabled for this app. Do not claim you can create, edit, hide, or delete Agent-Native extensions unless the template exposes its own typed action for that workflow.`;\n\n const PROD_FRAMEWORK_PROMPT = `## Agent-Native Framework — Production Mode\n\nYou are an AI agent in an agent-native application, running in **production mode**.\n\nThe agent and the UI are equal partners — everything the UI can do, you can do via your tools, and vice versa. They share the same SQL database and stay in sync automatically.\n\n**In production mode, you operate through registered actions exposed as tools.** These are your capabilities — use them to read data, take actions, and help the user. You cannot edit source code or access the filesystem directly. Your tools are the app's API.\n\n### Plan Mode\n\nIf the current turn is in Plan mode, plan before anything gets written. This applies to ${planModeArtifactList}. Use only read-only tools, clarify the goal when needed, and return a concrete plan for approval. Do not call ${planModeBlockedTools} until the user switches back to Act mode.\n\n${extensionInstructionsFull}\n\n### Code Changes — Hand Off With \\`connect-builder\\`\n\n${extensionConnectBuilderGuard}\n\nIn Act mode, a request that needs source-file edits — the UI chrome, a component, a route, styles, a hook, an integration, or a bug in the app itself — is a handoff, not a task you plan. Builder plans and edits in its own sandbox, so the exploration, file-mapping, and code all happen there rather than here.\n\nKeep the whole turn to three beats:\n\n1. One short clause acknowledging what they asked for in their own terms (\"Got it — wider subject lines in the email list.\"), skipped entirely when they already know you're handing off. No generic preamble, no promised outcomes.\n2. The \\`connect-builder\\` call, with the user's request verbatim as \\`prompt\\`.\n3. One sentence framing the next click around what they asked for rather than pitching Builder. Read \\`builderEnabled\\` from the result first; the tool's own description defines what each value lets you claim and offer.\n\nNothing else belongs in that turn: no code exploration, no implementation plan, no \\`resources\\` write of a spec, and no sub-agents (they have no code-editing tools either). You don't need filesystem access to hand off, so don't reach for it or list tools you lack.\n${FRAMEWORK_CORE}`;\n\n const DEV_FRAMEWORK_PROMPT = `## Agent-Native Framework — Development Mode\n\nYou are an AI agent in an agent-native application, running in **development mode**.\n\nThe agent and the UI are equal partners — everything the UI can do, you can do via tools/scripts, and vice versa. They share the same SQL database and stay in sync automatically.\n\n**In development mode, you have full local access — use it with senior-engineer judgment** (read before you edit, keep changes scoped, verify before you claim done):\n- Run any shell command via the \\`bash\\` tool (node, curl, pnpm, rg, git, etc.), including arbitrary code\n- Read and write any file on the filesystem; edit source, install packages, modify the app\n- Query and modify the database\n- Call external APIs (via bash with curl, or via scripts)\n\nWhen no dedicated tool/action exists for what you need, reach for \\`bash\\`.\n\n**Template-specific actions are invoked via bash, NOT as direct tools.** In dev mode, the only tools registered as native tool calls are framework-level utilities (bash, read, edit, write, database, resources, chat, teams, jobs). Anything from the template's \\`actions/\\` directory must be run through bash: \\`bash({ command: 'pnpm action <name> --arg value' })\\`. The \"Available Actions\" section below shows the exact CLI syntax for each one — copy that command verbatim and pass it to \\`bash\\`. Do not try to call template actions by name as if they were tools; they will not appear in your tool list.\n\nWhen editing code, follow the agent-native architecture:\n- Every feature needs all four areas: UI + scripts + skills/instructions + application-state sync\n- All SQL must be dialect-agnostic (works on SQLite and Postgres)\n- No Node.js-specific APIs in server routes (must work on Cloudflare Workers, etc.)\n- Use shadcn/ui components and Tabler Icons for all UI work\n${FRAMEWORK_CORE}`;\n\n const PROD_FRAMEWORK_PROMPT_COMPACT = `## Agent-Native Framework — Production Mode\n\nYou are an AI agent in an agent-native application, running in **production mode**.\n\nThe agent and the UI are equal partners — everything the UI can do, you can do via your tools, and vice versa. They share the same SQL database and stay in sync automatically.\n\n**In production mode, you operate through registered actions exposed as tools.** These are your capabilities — use them to read data, take actions, and help the user. You cannot edit source code or access the filesystem directly. Your tools are the app's API.\n\n### Plan Mode\n\nIf the turn is in Plan mode, plan before anything gets written — including ${planModeArtifactList}. Use read-only tools only and do not call ${planModeBlockedTools} until the user switches back to Act mode.\n\n${extensionInstructionsCompact}\n\n### Code Changes — Hand Off With \\`connect-builder\\`\n\nIn Act mode, a request that genuinely needs a source-code edit (per the rules above) is a handoff, not a task you plan. Keep the turn to three beats: (1) one short clause acknowledging their specific ask in their own terms, no preamble; (2) the \\`connect-builder\\` call with their request verbatim as \\`prompt\\`; (3) one sentence framing the next click around what they asked for, not a Builder pitch — read \\`builderEnabled\\` from the result first, and let the tool's own description tell you what each value lets you claim. Nothing else belongs in that turn: no code, no file lists, no plans, no sub-agents.\n${FRAMEWORK_CORE_COMPACT}`;\n\n const DEV_FRAMEWORK_PROMPT_COMPACT = `## Agent-Native Framework — Development Mode\n\nYou are an AI agent in an agent-native application, running in **development mode**.\n\nThe agent and the UI are equal partners — everything the UI can do, you can do via tools/scripts, and vice versa. They share the same SQL database and stay in sync automatically.\n\n**In development mode, you have full local access** — shell, filesystem, database, external APIs, source edits, and package installs. Use it with senior-engineer judgment: read before you edit, keep changes scoped, verify before you claim done.\n\n**Template-specific actions are invoked via bash, NOT as direct tools.** Run them with: \\`bash({ command: 'pnpm action <name> --arg value' })\\`. See the \"Available Actions\" section below for CLI syntax.\n\nWhen editing code, follow the agent-native architecture:\n- Every feature needs all four areas: UI + scripts + skills/instructions + application-state sync\n- All SQL must be dialect-agnostic (works on SQLite and Postgres)\n- No Node.js-specific APIs in server routes (must work on Cloudflare Workers, etc.)\n- Use shadcn/ui components and Tabler Icons for all UI work\n${FRAMEWORK_CORE_COMPACT}`;\n\n return {\n FRAMEWORK_CORE,\n FRAMEWORK_CORE_COMPACT,\n PROD_FRAMEWORK_PROMPT,\n DEV_FRAMEWORK_PROMPT,\n PROD_FRAMEWORK_PROMPT_COMPACT,\n DEV_FRAMEWORK_PROMPT_COMPACT,\n };\n}\n\nexport const _agentChatPromptSectionsForTests = (() => {\n // Built with default (no template-specific) examples for test stability.\n const {\n FRAMEWORK_CORE: frameworkCore,\n FRAMEWORK_CORE_COMPACT: frameworkCoreCompact,\n } = buildFrameworkPrompts();\n return {\n frameworkCore,\n frameworkCoreCompact,\n frameworkContextSections: FRAMEWORK_CONTEXT_SECTIONS,\n buildFrameworkPrompts,\n generateActionsPrompt,\n resolveInitialToolNames,\n createDataWidgetActionEntries,\n };\n})();\n\n/**\n * Build the per-request SQL-schema context block. Reads AGENT_ORG_ID live\n * from the environment so scheduler/A2A/HTTP call sites all see whatever\n * org was just resolved for this request.\n */\nexport async function buildSchemaBlock(\n owner: string,\n databaseTools: DatabaseToolsOption = \"read\",\n): Promise<string> {\n try {\n return await loadSchemaPromptBlock({\n owner,\n orgId: getRequestOrgId() ?? null,\n databaseTools,\n });\n } catch {\n return \"\";\n }\n}\n\n/**\n * Generates a system prompt section describing registered template actions.\n *\n * Two output modes:\n *\n * - `\"tool\"` — used in production, where template actions are registered\n * as native Anthropic tools. The native tool schema already carries each\n * action's name, full description, and parameters, so this mode does NOT\n * re-list every action — it only surfaces what the tool list can't:\n * native-chat-widget annotations and a `tool-search` pointer for actions\n * omitted from the initial tool set.\n * - `\"cli\"` — used in dev, where template actions are NOT registered as\n * native tools and must be invoked via `bash(command=\"pnpm action ...\")`.\n * This listing is load-bearing here (there is no tool schema to fall\n * back on), so it still emits the full\n * `pnpm action name --arg <type> [--opt <type>] — desc` line per action.\n */\nexport function generateActionsPrompt(\n registry: Record<string, ActionEntry>,\n mode: \"cli\" | \"tool\" = \"tool\",\n initialToolNames?: string[],\n): string {\n if (!registry || Object.keys(registry).length === 0) return \"\";\n\n const allActionEntries = Object.entries(registry);\n const initialNames = initialToolNames ? new Set(initialToolNames) : undefined;\n const actionEntries = initialNames\n ? allActionEntries.filter(([name]) => initialNames.has(name))\n : allActionEntries;\n const omittedActionCount = allActionEntries.length - actionEntries.length;\n const nativeWidgetNote = (entry: ActionEntry) =>\n entry.chatUI && typeof entry.chatUI.renderer === \"string\"\n ? ` Native chat widget: \\`${entry.chatUI.renderer}\\`.`\n : \"\";\n\n if (mode === \"tool\") {\n // Native tool schemas already carry name + full description + params\n // for every action, so this section only needs to surface what the tool\n // list itself can't: which actions render a native chat widget, and\n // which actions exist but aren't loaded as initial tools yet.\n const widgetLines = actionEntries\n .filter(([, entry]) => typeof entry.chatUI?.renderer === \"string\")\n .map(\n ([name, entry]) =>\n `- \\`${name}\\` — Native chat widget: \\`${entry.chatUI?.renderer ?? \"\"}\\`.`,\n );\n\n const sections: string[] = [];\n if (widgetLines.length > 0) {\n sections.push(\n `**Actions that render a native chat widget** — call these directly for their table/chart/insights view instead of recreating it in prose:\\n\\n${widgetLines.join(\"\\n\")}`,\n );\n }\n if (omittedActionCount > 0) {\n sections.push(\n `${omittedActionCount} less-common app action${omittedActionCount === 1 ? \" is\" : \"s are\"} available on demand. Use \\`tool-search\\` with a specific capability query to load the matching schemas when needed.`,\n );\n }\n if (sections.length === 0) return \"\";\n\n return `\\n\\n## Available Actions\\n\\n${sections.join(\"\\n\\n\")}`;\n }\n\n const lines = actionEntries.map(([name, entry]) => {\n const desc = entry.tool.description;\n const params = entry.tool.parameters?.properties;\n const requiredFields = new Set(entry.tool.parameters?.required ?? []);\n\n // CLI mode: emit `pnpm action <name> --required <type> [--optional <type>]`\n if (!params || Object.keys(params).length === 0) {\n return `- \\`pnpm action ${name}\\` — ${desc}${nativeWidgetNote(entry)}`;\n }\n const entries = Object.entries(params);\n // Required first (alphabetical), then optional (alphabetical)\n entries.sort(([a], [b]) => {\n const ar = requiredFields.has(a) ? 0 : 1;\n const br = requiredFields.has(b) ? 0 : 1;\n if (ar !== br) return ar - br;\n return a.localeCompare(b);\n });\n const required: string[] = [];\n const optional: string[] = [];\n const requiredNames: string[] = [];\n for (const [k, v] of entries) {\n const type = (v as { type?: string }).type ?? \"any\";\n const flag = `--${k} <${type}>`;\n if (requiredFields.has(k)) {\n required.push(flag);\n requiredNames.push(`--${k}`);\n } else {\n optional.push(`[${flag}]`);\n }\n }\n const cmd = [\"pnpm action \" + name, ...required, ...optional].join(\" \");\n const requiredNote =\n requiredNames.length > 0 ? ` Required: ${requiredNames.join(\", \")}.` : \"\";\n return `- \\`${cmd}\\` — ${desc}.${requiredNote}${nativeWidgetNote(entry)}`;\n });\n\n return `\\n\\n## Available Actions\n\n**These template actions are NOT exposed as direct tools in dev mode. To run any of them, use the \\`bash\\` tool with the exact command shown below.** Example: \\`bash(command=\"pnpm action add-slide --deckId abc --content 'Hello'\")\\`.\n\nDo NOT try to call these by name as if they were tools — they will not exist in your tool list. Always go through \\`bash\\`.\n\n${lines.join(\"\\n\")}`;\n}\n\n/**\n * Tool names `generateCorpusToolsPrompt` teaches BY NAME, in the same order\n * it lists them. Exported so callers that build a request's initial\n * engine-tool set can fold in exactly the subset present in a given\n * registry — keeping \"what the prompt just told the model exists\" and\n * \"what tools are actually callable on the first request\" in sync. See the\n * corpus-prompt/initial-tools note at this function's call site in\n * agent-chat-plugin.ts.\n */\nconst CORPUS_TOOL_NAMES = [\n \"provider-api-catalog\",\n \"provider-api-docs\",\n \"provider-api-request\",\n \"provider-corpus-job\",\n \"query-staged-dataset\",\n \"run-code\",\n] as const;\n\nexport function corpusToolNamesTaughtByPrompt(\n registry: Record<string, ActionEntry>,\n): string[] {\n return CORPUS_TOOL_NAMES.filter((name) => name in registry);\n}\n\nexport function generateCorpusToolsPrompt(\n registry: Record<string, ActionEntry>,\n): string {\n const hasProviderApi = \"provider-api-request\" in registry;\n const hasProviderCorpusJob = \"provider-corpus-job\" in registry;\n const providerDiscoveryTools = [\n \"provider-api-catalog\" in registry ? \"`provider-api-catalog`\" : null,\n \"provider-api-docs\" in registry ? \"`provider-api-docs`\" : null,\n ].filter(Boolean);\n const hasRunCode = \"run-code\" in registry;\n const hasStagedDataset = \"query-staged-dataset\" in registry;\n if (\n !hasProviderApi &&\n !hasProviderCorpusJob &&\n !hasRunCode &&\n !hasStagedDataset\n )\n return \"\";\n\n const available = [\n ...providerDiscoveryTools,\n hasProviderApi ? \"`provider-api-request`\" : null,\n hasProviderCorpusJob ? \"`provider-corpus-job`\" : null,\n hasStagedDataset ? \"`query-staged-dataset`\" : null,\n hasRunCode ? \"`run-code`\" : null,\n ].filter(Boolean);\n\n return `\\n\\n## Broad Provider And Corpus Workflows\n\nAvailable corpus-capable tools: ${available.join(\", \")}.\n\nThis workflow does not apply to ordinary structured lookups, bounded aggregates, or counts grouped over one known source. For those requests, use the single most directly authoritative source, run one bounded query, and answer as soon as it succeeds. Do not cross-check or expand into a corpus workflow unless the user asks for multiple sources, exhaustive unstructured-record coverage, or an absence claim.\n\nFor broad provider searches, raw API access, multi-page cohorts, cross-source joins, classification over unstructured records, or absence-sensitive answers, do not stop at a bounded shortcut action. Use the provider's broad API/search/list surface, fetch every relevant page or an explicit bounded cohort, stage/save large responses when needed, and reduce the corpus with durable corpus jobs, staged-dataset queries, or code execution.\n\nWhen \\`provider-corpus-job\\` is available, prefer it for transcript/message/ticket/issue/document scans that may exceed one turn, need provider-side backoff, or need a defensible \"not found\" conclusion. Use operation=\"start\" with mode=\"paginated-search\" for any paginated provider endpoint, or mode=\"batch-search\" when a prior cohort of ids/records must feed a second provider endpoint. Continue paused jobs with operation=\"continue\" until status is completed or quota_wait, then read operation=\"results\". In run-code, prefer providerFetchAll() for short cursor/page/offset pagination and providerRequest() when response status, headers, or truncation metadata matters. Report source, filters, row counts, pagination/truncation, failed pages, quota_wait times, and remaining gaps.`;\n}\n\n/**\n * Walks the local filesystem (dev mode only) to build a bounded file/folder\n * tree, used by a couple of dev-mode workspace-inspection tools.\n */\nexport async function collectFiles(\n dir: string,\n prefix: string,\n depth: number,\n results: Array<{ path: string; name: string; type: \"file\" | \"folder\" }>,\n): Promise<void> {\n if (depth > 4 || results.length >= 500) return;\n const skip = new Set([\n \"node_modules\",\n \".git\",\n \".next\",\n \".output\",\n \"dist\",\n \".cache\",\n \".turbo\",\n \"data\",\n ]);\n let entries: import(\"fs\").Dirent[];\n try {\n const fs = await lazyFs();\n entries = fs.readdirSync(dir, { withFileTypes: true });\n } catch {\n return;\n }\n for (const entry of entries) {\n if (results.length >= 500) return;\n if (skip.has(entry.name) || entry.name.startsWith(\".\")) continue;\n const relPath = prefix ? `${prefix}/${entry.name}` : entry.name;\n const isDir = entry.isDirectory();\n results.push({\n path: relPath,\n name: entry.name,\n type: isDir ? \"folder\" : \"file\",\n });\n if (isDir)\n await collectFiles(\n nodePath.join(dir, entry.name),\n relPath,\n depth + 1,\n results,\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"framework-prompts.js","s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MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC;QAChE,MAAM,KAAK,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;QAClC,OAAO,CAAC,IAAI,CAAC;YACX,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM;SAChC,CAAC,CAAC;QACH,IAAI,KAAK;YACP,MAAM,YAAY,CAChB,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,EAC9B,OAAO,EACP,KAAK,GAAG,CAAC,EACT,OAAO,CACR,CAAC;IACN,CAAC;AACH,CAAC","sourcesContent":["import nodePath from \"node:path\";\n\nimport type { ActionEntry } from \"../../agent/production-agent.js\";\nimport type { DatabaseToolsOption } from \"../../scripts/db/tool-mode.js\";\nimport {\n buildFrameworkCore,\n buildFrameworkCoreCompact,\n type PromptExamples,\n} from \"../prompts/index.js\";\nimport { getRequestOrgId } from \"../request-context.js\";\nimport { loadSchemaPromptBlock } from \"../schema-prompt.js\";\nimport { resolveInitialToolNames } from \"./action-filters-a2a.js\";\nimport {\n createDataWidgetActionEntries,\n FRAMEWORK_CONTEXT_SECTIONS,\n} from \"./context-tools.js\";\nimport { lazyFs } from \"./lazy-fs.js\";\n\n// ---------------------------------------------------------------------------\n// Framework-level system prompt assembly (production/dev, full/compact),\n// the \"Available Actions\" and corpus-tools prompt sections, the SQL schema\n// block, and the codebase file-tree walker used by a few dev-mode tools.\n// ---------------------------------------------------------------------------\n\n/**\n * Framework-level instructions injected into every agent's system prompt.\n * Prompt text lives in packages/core/src/server/prompts/ so this file stays\n * focused on routing and assembly logic.\n *\n * buildFrameworkPrompts() is called once per plugin instantiation (not per\n * request) with the template's promptExamples, producing the four assembled\n * prompt strings used at request time.\n */\nexport function buildFrameworkPrompts(\n examples?: PromptExamples,\n options?: { databaseTools?: DatabaseToolsOption; extensionTools?: boolean },\n): {\n FRAMEWORK_CORE: string;\n FRAMEWORK_CORE_COMPACT: string;\n PROD_FRAMEWORK_PROMPT: string;\n DEV_FRAMEWORK_PROMPT: string;\n PROD_FRAMEWORK_PROMPT_COMPACT: string;\n DEV_FRAMEWORK_PROMPT_COMPACT: string;\n} {\n const FRAMEWORK_CORE = buildFrameworkCore(examples, options);\n const FRAMEWORK_CORE_COMPACT = buildFrameworkCoreCompact(examples, options);\n const extensionToolsEnabled = options?.extensionTools === true;\n const planModeArtifactList = extensionToolsEnabled\n ? \"source-code handoffs and app-created artifacts such as extensions, widgets, dashboards, calculators, mini-apps, documents, designs, slides, or videos\"\n : \"source-code handoffs and app-created artifacts such as documents, designs, slides, or videos\";\n const planModeBlockedTools = extensionToolsEnabled\n ? \"`render-inline-extension`, `create-extension`, `update-extension`, `connect-builder`, or any action that creates, updates, deletes, sends, publishes, or persists data\"\n : \"`connect-builder`, or any action that creates, updates, deletes, sends, publishes, or persists data\";\n const extensionConnectBuilderGuard = extensionToolsEnabled\n ? \"Prefer native app artifacts and actions. Use an extension only when the user explicitly requests one, or when the result is clearly bespoke and one-off and the native format cannot express it. Reusable or product-wide behavior belongs in app code. If the exact placement or behavior requires changing the host UI or no suitable slot exists, continue with the normal `connect-builder` source-change flow even if the user called it an extension; never stop at saying extensions cannot do it.\"\n : \"\";\n const extensionInstructionsFull = extensionToolsEnabled\n ? `### Generative UI and Extensions (Mini-Apps)\n\nIn Act mode, if the user asks for generated interactive UI in chat, choose the smallest extension action for the lifetime: \\`render-inline-extension\\` (one-off, chat-only), \\`create-extension\\` (saved/reusable), \\`show-extension-inline\\` (reopen a saved one), or \\`update-extension\\` (edit an existing one) — call the right one directly, without a \"let me build…\" preamble. Each tool's own description covers its exact use case, arguments, and available helpers (appAction, dbQuery, extensionData, agentNative.ui.output, etc.). Extensions are sandboxed mini-apps, not source-code changes, and never go through \\`connect-builder\\`.\n\nIf the app exposes native actions or instructions for dashboards, reports, analyses, charts, documents, decks, or other domain artifacts, use those app-native actions first. Choose an extension only when the user explicitly asks for an extension/custom mini-app, or when the result is clearly bespoke and one-off and the app's native artifact format cannot faithfully express the requested interaction. Reusable or product-wide behavior belongs in app code.\n\nEditing an existing extension (fix, restyle, rename, add behavior) is a SQL data update — call \\`update-extension\\` directly using the extensionId from \\`<current-screen>\\`/\\`<current-url>\\` when present; never call \\`connect-builder\\` for it.\n\nExtensions render only on their own page or inside an existing named slot; they cannot inject UI into arbitrary native components. If an extension could only approximate the request in a different location, do not silently downgrade the requirement and do not end with \"extensions cannot do that.\" Briefly explain the boundary, then follow the normal source-code handoff so the app can still be customized fully.\n\nFor helper APIs, Alpine.js patterns, the extension-vs-code-change boundary, and worked examples, read the \\`extensions\\` and \\`generative-ui\\` skills.`\n : \"\";\n const extensionInstructionsCompact = extensionToolsEnabled\n ? `### Generative UI and Extensions (Mini-Apps)\n\nIn Act mode, choose the smallest extension action for the lifetime: \\`render-inline-extension\\` (one-off, chat-only), \\`create-extension\\` (saved/reusable), \\`show-extension-inline\\` (reopen a saved one), or \\`update-extension\\` (edit an existing one) — each tool's own description covers its use case and helpers. These are sandboxed mini-apps, not code changes; never route them through \\`connect-builder\\`. Do not preface with \"let me build…\" — just call the right extension action.\n\nUse app-native artifact actions first when they exist for dashboards, reports, analyses, charts, documents, decks, or similar domain artifacts. Pick \\`create-extension\\` only for explicit extension/custom mini-app requests, or when the result is clearly bespoke and one-off and the native artifact format cannot support it. Reusable or product-wide behavior belongs in app code.\n\nEditing an existing extension is a data update — call \\`update-extension\\` directly using the extensionId from \\`<current-screen>\\`/\\`<current-url>\\` when present; never \\`connect-builder\\`.\n\nExtensions can render only on their own page or in an existing named slot; they cannot inject UI into arbitrary native components. If the exact request changes host chrome, native components, layout, styles, routes, business logic, or needs placement where no slot exists, treat it as a source-code change and use the normal \\`connect-builder\\` flow even if the user called it an extension. Never stop at \"extensions cannot do that\" or silently offer a different placement; explain the boundary briefly and continue the code-change handoff.\n\nSee the \\`extensions\\` and \\`generative-ui\\` skills for helper APIs, Alpine.js patterns, and worked examples.`\n : \"\";\n\n const PROD_FRAMEWORK_PROMPT = `## Agent-Native Framework — Production Mode\n\nYou are an AI agent in an agent-native application, running in **production mode**.\n\nThe agent and the UI are equal partners — everything the UI can do, you can do via your tools, and vice versa. They share the same SQL database and stay in sync automatically.\n\n**In production mode, you operate through registered actions exposed as tools.** These are your capabilities — use them to read data, take actions, and help the user. You cannot edit source code or access the filesystem directly. Your tools are the app's API.\n\n### Plan Mode\n\nIf the current turn is in Plan mode, plan before anything gets written. This applies to ${planModeArtifactList}. Use only read-only tools, clarify the goal when needed, and return a concrete plan for approval. Do not call ${planModeBlockedTools} until the user switches back to Act mode.\n\n${extensionInstructionsFull}\n\n### Code Changes — Hand Off With \\`connect-builder\\`\n\n${extensionConnectBuilderGuard}\n\nIn Act mode, a request that needs source-file edits — the UI chrome, a component, a route, styles, a hook, an integration, or a bug in the app itself — is a handoff, not a task you plan. Builder plans and edits in its own sandbox, so the exploration, file-mapping, and code all happen there rather than here.\n\nKeep the whole turn to three beats:\n\n1. One short clause acknowledging what they asked for in their own terms (\"Got it — wider subject lines in the email list.\"), skipped entirely when they already know you're handing off. No generic preamble, no promised outcomes.\n2. The \\`connect-builder\\` call, with the user's request verbatim as \\`prompt\\`.\n3. One sentence framing the next click around what they asked for rather than pitching Builder. Read \\`builderEnabled\\` from the result first; the tool's own description defines what each value lets you claim and offer.\n\nNothing else belongs in that turn: no code exploration, no implementation plan, no \\`resources\\` write of a spec, and no sub-agents (they have no code-editing tools either). You don't need filesystem access to hand off, so don't reach for it or list tools you lack.\n${FRAMEWORK_CORE}`;\n\n const DEV_FRAMEWORK_PROMPT = `## Agent-Native Framework — Development Mode\n\nYou are an AI agent in an agent-native application, running in **development mode**.\n\nThe agent and the UI are equal partners — everything the UI can do, you can do via tools/scripts, and vice versa. They share the same SQL database and stay in sync automatically.\n\n**In development mode, you have full local access — use it with senior-engineer judgment** (read before you edit, keep changes scoped, verify before you claim done):\n- Run any shell command via the \\`bash\\` tool (node, curl, pnpm, rg, git, etc.), including arbitrary code\n- Read and write any file on the filesystem; edit source, install packages, modify the app\n- Query and modify the database\n- Call external APIs (via bash with curl, or via scripts)\n\nWhen no dedicated tool/action exists for what you need, reach for \\`bash\\`.\n\n**Template-specific actions are invoked via bash, NOT as direct tools.** In dev mode, the only tools registered as native tool calls are framework-level utilities (bash, read, edit, write, database, resources, chat, teams, jobs). Anything from the template's \\`actions/\\` directory must be run through bash: \\`bash({ command: 'pnpm action <name> --arg value' })\\`. The \"Available Actions\" section below shows the exact CLI syntax for each one — copy that command verbatim and pass it to \\`bash\\`. Do not try to call template actions by name as if they were tools; they will not appear in your tool list.\n\nWhen editing code, follow the agent-native architecture:\n- Every feature needs all four areas: UI + scripts + skills/instructions + application-state sync\n- All SQL must be dialect-agnostic (works on SQLite and Postgres)\n- No Node.js-specific APIs in server routes (must work on Cloudflare Workers, etc.)\n- Use shadcn/ui components and Tabler Icons for all UI work\n${FRAMEWORK_CORE}`;\n\n const PROD_FRAMEWORK_PROMPT_COMPACT = `## Agent-Native Framework — Production Mode\n\nYou are an AI agent in an agent-native application, running in **production mode**.\n\nThe agent and the UI are equal partners — everything the UI can do, you can do via your tools, and vice versa. They share the same SQL database and stay in sync automatically.\n\n**In production mode, you operate through registered actions exposed as tools.** These are your capabilities — use them to read data, take actions, and help the user. You cannot edit source code or access the filesystem directly. Your tools are the app's API.\n\n### Plan Mode\n\nIf the turn is in Plan mode, plan before anything gets written — including ${planModeArtifactList}. Use read-only tools only and do not call ${planModeBlockedTools} until the user switches back to Act mode.\n\n${extensionInstructionsCompact}\n\n### Code Changes — Hand Off With \\`connect-builder\\`\n\nIn Act mode, a request that genuinely needs a source-code edit (per the rules above) is a handoff, not a task you plan. Keep the turn to three beats: (1) one short clause acknowledging their specific ask in their own terms, no preamble; (2) the \\`connect-builder\\` call with their request verbatim as \\`prompt\\`; (3) one sentence framing the next click around what they asked for, not a Builder pitch — read \\`builderEnabled\\` from the result first, and let the tool's own description tell you what each value lets you claim. Nothing else belongs in that turn: no code, no file lists, no plans, no sub-agents.\n${FRAMEWORK_CORE_COMPACT}`;\n\n const DEV_FRAMEWORK_PROMPT_COMPACT = `## Agent-Native Framework — Development Mode\n\nYou are an AI agent in an agent-native application, running in **development mode**.\n\nThe agent and the UI are equal partners — everything the UI can do, you can do via tools/scripts, and vice versa. They share the same SQL database and stay in sync automatically.\n\n**In development mode, you have full local access** — shell, filesystem, database, external APIs, source edits, and package installs. Use it with senior-engineer judgment: read before you edit, keep changes scoped, verify before you claim done.\n\n**Template-specific actions are invoked via bash, NOT as direct tools.** Run them with: \\`bash({ command: 'pnpm action <name> --arg value' })\\`. See the \"Available Actions\" section below for CLI syntax.\n\nWhen editing code, follow the agent-native architecture:\n- Every feature needs all four areas: UI + scripts + skills/instructions + application-state sync\n- All SQL must be dialect-agnostic (works on SQLite and Postgres)\n- No Node.js-specific APIs in server routes (must work on Cloudflare Workers, etc.)\n- Use shadcn/ui components and Tabler Icons for all UI work\n${FRAMEWORK_CORE_COMPACT}`;\n\n return {\n FRAMEWORK_CORE,\n FRAMEWORK_CORE_COMPACT,\n PROD_FRAMEWORK_PROMPT,\n DEV_FRAMEWORK_PROMPT,\n PROD_FRAMEWORK_PROMPT_COMPACT,\n DEV_FRAMEWORK_PROMPT_COMPACT,\n };\n}\n\nexport const _agentChatPromptSectionsForTests = (() => {\n // Built with default (no template-specific) examples for test stability.\n const {\n FRAMEWORK_CORE: frameworkCore,\n FRAMEWORK_CORE_COMPACT: frameworkCoreCompact,\n } = buildFrameworkPrompts();\n return {\n frameworkCore,\n frameworkCoreCompact,\n frameworkContextSections: FRAMEWORK_CONTEXT_SECTIONS,\n buildFrameworkPrompts,\n generateActionsPrompt,\n resolveInitialToolNames,\n createDataWidgetActionEntries,\n };\n})();\n\n/**\n * Build the per-request SQL-schema context block. Reads AGENT_ORG_ID live\n * from the environment so scheduler/A2A/HTTP call sites all see whatever\n * org was just resolved for this request.\n */\nexport async function buildSchemaBlock(\n owner: string,\n databaseTools: DatabaseToolsOption = \"read\",\n): Promise<string> {\n try {\n return await loadSchemaPromptBlock({\n owner,\n orgId: getRequestOrgId() ?? null,\n databaseTools,\n });\n } catch {\n return \"\";\n }\n}\n\n/**\n * Generates a system prompt section describing registered template actions.\n *\n * Two output modes:\n *\n * - `\"tool\"` — used in production, where template actions are registered\n * as native Anthropic tools. The native tool schema already carries each\n * action's name, full description, and parameters, so this mode does NOT\n * re-list every action — it only surfaces what the tool list can't:\n * native-chat-widget annotations and a `tool-search` pointer for actions\n * omitted from the initial tool set.\n * - `\"cli\"` — used in dev, where template actions are NOT registered as\n * native tools and must be invoked via `bash(command=\"pnpm action ...\")`.\n * This listing is load-bearing here (there is no tool schema to fall\n * back on), so it still emits the full\n * `pnpm action name --arg <type> [--opt <type>] — desc` line per action.\n */\nexport function generateActionsPrompt(\n registry: Record<string, ActionEntry>,\n mode: \"cli\" | \"tool\" = \"tool\",\n initialToolNames?: string[],\n): string {\n if (!registry || Object.keys(registry).length === 0) return \"\";\n\n const allActionEntries = Object.entries(registry);\n const initialNames = initialToolNames ? new Set(initialToolNames) : undefined;\n const actionEntries = initialNames\n ? allActionEntries.filter(([name]) => initialNames.has(name))\n : allActionEntries;\n const omittedActionCount = allActionEntries.length - actionEntries.length;\n const nativeWidgetNote = (entry: ActionEntry) =>\n entry.chatUI && typeof entry.chatUI.renderer === \"string\"\n ? ` Native chat widget: \\`${entry.chatUI.renderer}\\`.`\n : \"\";\n\n if (mode === \"tool\") {\n // Native tool schemas already carry name + full description + params\n // for every action, so this section only needs to surface what the tool\n // list itself can't: which actions render a native chat widget, and\n // which actions exist but aren't loaded as initial tools yet.\n const widgetLines = actionEntries\n .filter(([, entry]) => typeof entry.chatUI?.renderer === \"string\")\n .map(\n ([name, entry]) =>\n `- \\`${name}\\` — Native chat widget: \\`${entry.chatUI?.renderer ?? \"\"}\\`.`,\n );\n\n const sections: string[] = [];\n if (widgetLines.length > 0) {\n sections.push(\n `**Actions that render a native chat widget** — call these directly for their table/chart/insights view instead of recreating it in prose:\\n\\n${widgetLines.join(\"\\n\")}`,\n );\n }\n if (omittedActionCount > 0) {\n sections.push(\n `${omittedActionCount} less-common app action${omittedActionCount === 1 ? \" is\" : \"s are\"} available on demand. Use \\`tool-search\\` with a specific capability query to load the matching schemas when needed.`,\n );\n }\n if (sections.length === 0) return \"\";\n\n return `\\n\\n## Available Actions\\n\\n${sections.join(\"\\n\\n\")}`;\n }\n\n const lines = actionEntries.map(([name, entry]) => {\n const desc = entry.tool.description;\n const params = entry.tool.parameters?.properties;\n const requiredFields = new Set(entry.tool.parameters?.required ?? []);\n\n // CLI mode: emit `pnpm action <name> --required <type> [--optional <type>]`\n if (!params || Object.keys(params).length === 0) {\n return `- \\`pnpm action ${name}\\` — ${desc}${nativeWidgetNote(entry)}`;\n }\n const entries = Object.entries(params);\n // Required first (alphabetical), then optional (alphabetical)\n entries.sort(([a], [b]) => {\n const ar = requiredFields.has(a) ? 0 : 1;\n const br = requiredFields.has(b) ? 0 : 1;\n if (ar !== br) return ar - br;\n return a.localeCompare(b);\n });\n const required: string[] = [];\n const optional: string[] = [];\n const requiredNames: string[] = [];\n for (const [k, v] of entries) {\n const type = (v as { type?: string }).type ?? \"any\";\n const flag = `--${k} <${type}>`;\n if (requiredFields.has(k)) {\n required.push(flag);\n requiredNames.push(`--${k}`);\n } else {\n optional.push(`[${flag}]`);\n }\n }\n const cmd = [\"pnpm action \" + name, ...required, ...optional].join(\" \");\n const requiredNote =\n requiredNames.length > 0 ? ` Required: ${requiredNames.join(\", \")}.` : \"\";\n return `- \\`${cmd}\\` — ${desc}.${requiredNote}${nativeWidgetNote(entry)}`;\n });\n\n return `\\n\\n## Available Actions\n\n**These template actions are NOT exposed as direct tools in dev mode. To run any of them, use the \\`bash\\` tool with the exact command shown below.** Example: \\`bash(command=\"pnpm action add-slide --deckId abc --content 'Hello'\")\\`.\n\nDo NOT try to call these by name as if they were tools — they will not exist in your tool list. Always go through \\`bash\\`.\n\n${lines.join(\"\\n\")}`;\n}\n\n/**\n * Tool names `generateCorpusToolsPrompt` teaches BY NAME, in the same order\n * it lists them. Exported so callers that build a request's initial\n * engine-tool set can fold in exactly the subset present in a given\n * registry — keeping \"what the prompt just told the model exists\" and\n * \"what tools are actually callable on the first request\" in sync. See the\n * corpus-prompt/initial-tools note at this function's call site in\n * agent-chat-plugin.ts.\n */\nconst CORPUS_TOOL_NAMES = [\n \"provider-api-catalog\",\n \"provider-api-docs\",\n \"provider-api-request\",\n \"provider-corpus-job\",\n \"query-staged-dataset\",\n \"run-code\",\n] as const;\n\nexport function corpusToolNamesTaughtByPrompt(\n registry: Record<string, ActionEntry>,\n): string[] {\n return CORPUS_TOOL_NAMES.filter((name) => name in registry);\n}\n\nexport function generateCorpusToolsPrompt(\n registry: Record<string, ActionEntry>,\n): string {\n const hasProviderApi = \"provider-api-request\" in registry;\n const hasProviderCorpusJob = \"provider-corpus-job\" in registry;\n const providerDiscoveryTools = [\n \"provider-api-catalog\" in registry ? \"`provider-api-catalog`\" : null,\n \"provider-api-docs\" in registry ? \"`provider-api-docs`\" : null,\n ].filter(Boolean);\n const hasRunCode = \"run-code\" in registry;\n const hasStagedDataset = \"query-staged-dataset\" in registry;\n if (\n !hasProviderApi &&\n !hasProviderCorpusJob &&\n !hasRunCode &&\n !hasStagedDataset\n )\n return \"\";\n\n const available = [\n ...providerDiscoveryTools,\n hasProviderApi ? \"`provider-api-request`\" : null,\n hasProviderCorpusJob ? \"`provider-corpus-job`\" : null,\n hasStagedDataset ? \"`query-staged-dataset`\" : null,\n hasRunCode ? \"`run-code`\" : null,\n ].filter(Boolean);\n\n return `\\n\\n## Broad Provider And Corpus Workflows\n\nAvailable corpus-capable tools: ${available.join(\", \")}.\n\nThis workflow does not apply to ordinary structured lookups, bounded aggregates, or counts grouped over one known source. For those requests, use the single most directly authoritative source, run one bounded query, and answer as soon as it succeeds. Do not cross-check or expand into a corpus workflow unless the user asks for multiple sources, exhaustive unstructured-record coverage, or an absence claim.\n\nFor broad provider searches, raw API access, multi-page cohorts, cross-source joins, classification over unstructured records, or absence-sensitive answers, do not stop at a bounded shortcut action. Use the provider's broad API/search/list surface, fetch every relevant page or an explicit bounded cohort, stage/save large responses when needed, and reduce the corpus with durable corpus jobs, staged-dataset queries, or code execution.\n\nWhen \\`provider-corpus-job\\` is available, prefer it for transcript/message/ticket/issue/document scans that may exceed one turn, need provider-side backoff, or need a defensible \"not found\" conclusion. Use operation=\"start\" with mode=\"paginated-search\" for any paginated provider endpoint, or mode=\"batch-search\" when a prior cohort of ids/records must feed a second provider endpoint. Continue paused jobs with operation=\"continue\" until status is completed or quota_wait, then read operation=\"results\". In run-code, prefer providerFetchAll() for short cursor/page/offset pagination and providerRequest() when response status, headers, or truncation metadata matters. Report source, filters, row counts, pagination/truncation, failed pages, quota_wait times, and remaining gaps.`;\n}\n\n/**\n * Walks the local filesystem (dev mode only) to build a bounded file/folder\n * tree, used by a couple of dev-mode workspace-inspection tools.\n */\nexport async function collectFiles(\n dir: string,\n prefix: string,\n depth: number,\n results: Array<{ path: string; name: string; type: \"file\" | \"folder\" }>,\n): Promise<void> {\n if (depth > 4 || results.length >= 500) return;\n const skip = new Set([\n \"node_modules\",\n \".git\",\n \".next\",\n \".output\",\n \"dist\",\n \".cache\",\n \".turbo\",\n \"data\",\n ]);\n let entries: import(\"fs\").Dirent[];\n try {\n const fs = await lazyFs();\n entries = fs.readdirSync(dir, { withFileTypes: true });\n } catch {\n return;\n }\n for (const entry of entries) {\n if (results.length >= 500) return;\n if (skip.has(entry.name) || entry.name.startsWith(\".\")) continue;\n const relPath = prefix ? `${prefix}/${entry.name}` : entry.name;\n const isDir = entry.isDirectory();\n results.push({\n path: relPath,\n name: entry.name,\n type: isDir ? \"folder\" : \"file\",\n });\n if (isDir)\n await collectFiles(\n nodePath.join(dir, entry.name),\n relPath,\n depth + 1,\n results,\n );\n }\n}\n"]}
|
|
@@ -249,9 +249,9 @@ export interface AgentChatPluginOptions {
|
|
|
249
249
|
/**
|
|
250
250
|
* Expose framework extension management actions (`create-extension`,
|
|
251
251
|
* `update-extension`, `list-extensions`, etc.) to the app agent. Defaults to
|
|
252
|
-
*
|
|
253
|
-
* sandboxed extension mini-apps
|
|
254
|
-
*
|
|
252
|
+
* false. Set to true for apps that intentionally let the LLM create or
|
|
253
|
+
* manage sandboxed extension mini-apps. Core extension routes may still be
|
|
254
|
+
* mounted for compatibility and app-owned surfaces.
|
|
255
255
|
*/
|
|
256
256
|
extensionTools?: boolean;
|
|
257
257
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-options.js","sourceRoot":"","sources":["../../../src/server/agent-chat/plugin-options.ts"],"names":[],"mappings":"","sourcesContent":["import type { ActionEntry } from \"../../agent/production-agent.js\";\nimport type { AgentLoopFinalResponseGuard } from \"../../agent/production-agent.js\";\nimport type {\n AgentChatAttachment,\n AgentChatReference,\n MentionProvider,\n} from \"../../agent/types.js\";\nimport type { ExternalAgentPolicy } from \"../../mcp/external-agent-policy.js\";\nimport type { DatabaseToolsOption } from \"../../scripts/db/tool-mode.js\";\nimport type { PromptExamples } from \"../prompts/index.js\";\n\n/** Shape of a Nitro plugin function: receives the Nitro app instance at\n * startup and may register routes/hooks synchronously or asynchronously. */\nexport type NitroPluginDef = (nitroApp: any) => void | Promise<void>;\n\nexport interface AgentChatPluginOptions {\n /** Template-specific actions (email ops, booking ops, etc.) */\n actions?:\n | Record<string, ActionEntry>\n | (() =>\n | Record<string, ActionEntry>\n | Promise<Record<string, ActionEntry>>);\n /** @deprecated Use `actions` instead */\n scripts?:\n | Record<string, ActionEntry>\n | (() =>\n | Record<string, ActionEntry>\n | Promise<Record<string, ActionEntry>>);\n /** System prompt for the agent. A sensible default is provided. */\n systemPrompt?: string;\n /** Additional system prompt prepended in dev mode */\n devSystemPrompt?: string;\n /** Model to use. Defaults to the resolved engine's default model. */\n model?: string;\n /** Optional per-app agent run chunk budget in milliseconds. Defaults to\n * AGENT_RUN_SOFT_TIMEOUT_MS when set, otherwise no framework-imposed\n * timeout. When reached, long runs continue through the hidden continuation\n * path instead of surfacing a timeout warning. */\n runSoftTimeoutMs?: number;\n /** Optional per-app run-manager no-progress watchdog in milliseconds. */\n runNoProgressTimeoutMs?: number;\n /**\n * Opt this app into Netlify durable background-function agent-chat runs. This\n * gives hosted agent turns the 15-minute async-function budget when the app's\n * Netlify build also emits the background function. Set this to `false` to\n * explicitly disable a stale deploy-wide `AGENT_CHAT_DURABLE_BACKGROUND`\n * flag for this app.\n */\n durableBackgroundRuns?: boolean;\n /** Anthropic API key. Falls back to ANTHROPIC_API_KEY env var */\n apiKey?: string;\n /**\n * Agent engine to use. Can be a pre-constructed AgentEngine, a registered\n * engine name (e.g. \"anthropic\", \"ai-sdk:openai\"), or an object with name\n * and config. Defaults to the \"anthropic\" engine using ANTHROPIC_API_KEY.\n */\n engine?:\n | import(\"../../agent/engine/types.js\").AgentEngine\n | string\n | { name: string; config: Record<string, unknown> };\n /** Route path. Default: /_agent-native/agent-chat */\n path?: string;\n /** Custom mention providers for @-tagging template entities */\n mentionProviders?:\n | Record<string, MentionProvider>\n | (() =>\n | Record<string, MentionProvider>\n | Promise<Record<string, MentionProvider>>);\n /** App ID used to exclude self from agent discovery (e.g., \"mail\", \"calendar\") */\n appId?: string;\n /** Optional MCP server branding surfaced during the initialize handshake. */\n mcpServerInfo?: {\n /** Human-facing title. Defaults to the capitalized app id/name. */\n title?: string;\n /** Host-facing description. Defaults to \"Agent-native <app> agent\". */\n description?: string;\n /** Canonical app URL. Relative URLs are resolved against the request origin. */\n websiteUrl?: string;\n /** App icons. Relative `src` values are resolved against the request origin. */\n icons?: Array<{\n src: string;\n mimeType?: string;\n sizes?: string[];\n theme?: \"light\" | \"dark\";\n }>;\n };\n /**\n * Optional callback to resolve the org ID for the current request.\n * When provided, the resolved value is set as AGENT_ORG_ID env var so\n * that db-query/db-exec automatically scope by org_id in addition to\n * owner_email.\n *\n * If not provided, the framework automatically uses `session.orgId` from\n * Better Auth's active organization. Only provide this callback when you\n * need custom org resolution logic (e.g., Atlassian org mapping).\n */\n resolveOrgId?: (event: any) => string | null | Promise<string | null>;\n /**\n * Optional owner resolver for public/anonymous chat surfaces. When the\n * normal app session is missing, this callback may return a synthetic\n * owner id for a narrowly-scoped public request (for example, a public\n * shared document page). Anonymous requests use a read-only tool set by\n * default so public viewers cannot mutate app data through the agent.\n */\n anonymousOwner?: (event: any) => string | null | Promise<string | null>;\n /**\n * Keep anonymous-owner requests on read-only template actions. Defaults to\n * true. Only disable for single-tenant apps that intentionally allow public\n * agent mutations.\n */\n anonymousReadOnly?: boolean;\n /**\n * Optional auth adapter for the HTTP action route\n * (`/_agent-native/actions/*`). Its `resolveCaller` runs before the\n * cookie/bearer `getSession` chain, letting an app accept caller identities\n * `getSession` doesn't understand (e.g. an A2A JWT verified with\n * `verifyA2AToken`) declaratively, instead of pre-seeding request context\n * from a Nitro `request` hook.\n *\n * Returning `null` defers to the normal chain; THROWING hard-rejects with a\n * 401 (an invalid/forged credential must not fall through to a same-origin\n * session cookie). A resolved caller's org comes exclusively from the\n * verified credential — the returned `orgId` or the owner-email membership\n * lookup — never from the request's session cookie.\n * See {@link import(\"../action-routes.js\").ActionRouteAuthAdapter}.\n */\n actionRouteAuth?: import(\"../action-routes.js\").ActionRouteAuthAdapter;\n /**\n * Optional callback to append template-specific context to the system\n * prompt on each request. Runs after AGENTS.md / skills / memory are\n * loaded and before the schema block — use it to inject dynamic SQL\n * context like a data dictionary, active feature flags, or whatever\n * the agent should know about *right now* for this user/org.\n *\n * Return `null` or an empty string to skip. The string you return is\n * appended verbatim, so wrap it in your own XML tags (e.g.\n * `<data-dictionary>…</data-dictionary>`) to keep the prompt scannable.\n *\n * Called on every request in every prompt variant (lean, lazy, full).\n * Templates that want to suppress it in a particular mode should return\n * `null` from the callback based on their own logic.\n */\n extraContext?: (\n event: any,\n owner: string,\n ) => string | null | Promise<string | null>;\n /**\n * Optional final-answer guard. Templates can use this to require a\n * corrective retry before accepting a text-only final answer, e.g. forcing\n * real data-source tool calls for analytics requests.\n */\n finalResponseGuard?: AgentLoopFinalResponseGuard;\n /**\n * Optional per-template request normalizer. Runs after authentication and\n * before the model sees the message, so apps can translate chat attachments\n * into template-native file handles while preserving the user's visible text.\n */\n prepareRequest?: (details: {\n event: any;\n ownerEmail: string | null;\n message: string;\n displayMessage?: string;\n attachments: AgentChatAttachment[];\n references: AgentChatReference[];\n threadId?: string;\n internalContinuation?: boolean;\n mode: \"act\" | \"plan\";\n }) =>\n | void\n | {\n message?: string;\n displayMessage?: string;\n attachments?: AgentChatAttachment[];\n }\n | Promise<void | {\n message?: string;\n displayMessage?: string;\n attachments?: AgentChatAttachment[];\n }>;\n /**\n * Use ONLY the template's `systemPrompt` and the actions list — skip the\n * framework prompt wrapper, resource loading (AGENTS.md/LEARNINGS.md/\n * memory), the SQL schema block, and the workspace files/skills/agents\n * inventory. Intended for minimal or voice-first apps where a long,\n * generic preamble adds latency and iteration noise without adding value.\n *\n * When set, the same lean prompt is used in both dev and prod modes. In\n * dev mode the tool registry is ALSO swapped to the template's actions\n * (same set as prod) — the dev-only bash/db-exec/file-system tools\n * and the resource/docs/chat/team/job/browser scripts are dropped. The\n * lean system prompt has no bash-usage guidance, so routing actions\n * through bash would break. If you need the full dev tool surface,\n * leave this off.\n */\n leanPrompt?: boolean;\n /**\n * Skip auto-injecting the workspace files/skills/agents inventory on the\n * first message of a conversation while keeping the normal prompt, resources,\n * and tool surface. Use this for domain-focused apps where broad workspace\n * inventory is mostly latency/noise unless the user explicitly references it.\n *\n * `leanPrompt: true` and the default `lazyContext` mode imply this because\n * those catalogs are already discoverable through resources, docs-search,\n * tool-search, and the compact resource indexes. Set `false` explicitly only\n * when a workspace-wide inventory is central to the app's first-turn job.\n */\n skipFilesContext?: boolean;\n /**\n * Initial native tool schemas to send to the LLM provider. When set, the\n * agent starts with only these tools plus `tool-search`; the live registry\n * remains searchable, and matching schemas from `tool-search` results are\n * loaded into the next model request. Use this for domain-focused apps that\n * have a few common actions and many rare framework utilities. Common\n * discovery and resource-reading tools are promoted automatically when\n * present. Provider, MCP, extension, and code-execution schemas stay behind\n * tool-search unless the app explicitly includes them in this list.\n */\n initialToolNames?: string[];\n /**\n * Controls whether broad provider/corpus tools and their workflow prompt are\n * loaded into the first model request. Use `\"lazy\"` for apps that can answer\n * ordinary lookups from a compact curated tool set; corpus tools remain\n * discoverable through tool-search and the full retry surface.\n *\n * @default \"initial\"\n */\n corpusTools?: \"initial\" | \"lazy\";\n /**\n * Use a compact system prompt with on-demand context loading. The system\n * prompt includes essential behavioral rules and action signatures, but\n * defers verbose framework details, SQL schema, skills, learnings, and\n * memory behind tools (`get-framework-context`, `db-schema`,\n * `resources` (action: read)). The agent fetches these on-demand when needed.\n *\n * This reduces the system prompt by ~60-70%, significantly improving\n * time-to-first-token and reducing \"thinking\" time. The agent retains\n * all capabilities — it just loads context lazily instead of upfront.\n *\n * Defaults to `true`. Set to `false` to use the original full prompt.\n * Ignored when `leanPrompt` is set (lean mode is even more minimal).\n */\n lazyContext?: boolean;\n /**\n * In dev mode, register the template's actions as native tools the agent\n * can call directly with structured JSON args — skipping the default\n * `bash(command=\"pnpm action <name> ...\")` indirection.\n *\n * The default dev behavior shells out because it \"mirrors how Claude Code\n * works locally\" and reduces empty-object tool calls for templates with\n * simple string args. But templates whose actions take structured data\n * (objects, arrays, nested JSON) can't round-trip those cleanly through\n * the CLI parser — stringified JSON on the way in, loss of type fidelity\n * on the way out.\n *\n * Set to `true` to get the same tool surface in dev that production uses.\n * `leanPrompt: true` implies this already (lean mode has no bash-usage\n * guidance, so actions must be native). Set this flag without\n * `leanPrompt` when you want native actions AND the full system prompt.\n *\n * Defaults to `false`.\n */\n nativeActionsInDev?: boolean;\n /**\n * Expose raw SQL/native database tools to the app agent.\n *\n * Defaults to `\"read\"`: `db-schema`/`db-query` are available for inspection,\n * while writes route through typed app actions. Set to `\"write\"` (also\n * `true`) to expose `db-exec`/`db-patch` for scoped raw SQL maintenance.\n * Set to `\"off\"` (also `false`) for chat-first apps that want agents to use\n * typed actions only.\n */\n databaseTools?: DatabaseToolsOption;\n /**\n * Expose framework extension management actions (`create-extension`,\n * `update-extension`, `list-extensions`, etc.) to the app agent. Defaults to\n * true. Set to false for apps that do not want the LLM to create or manage\n * sandboxed extension mini-apps, even though the core extension routes may\n * still be mounted for other surfaces.\n */\n extensionTools?: boolean;\n /**\n * Optional A2A-only deterministic response path. Runs after inbound A2A text\n * and user context are resolved, but before an agent engine/model is loaded.\n * Return a message to complete the A2A task without invoking the LLM, or\n * null/undefined to continue through the normal agent loop.\n */\n a2aMessageFallback?: (details: {\n message: import(\"../../a2a/types.js\").Message;\n text: string;\n context: import(\"../../a2a/types.js\").A2AHandlerContext;\n userEmail: string | undefined;\n }) =>\n | import(\"../../a2a/types.js\").Message\n | string\n | null\n | undefined\n | Promise<import(\"../../a2a/types.js\").Message | string | null | undefined>;\n /**\n * Optional injectable prompt examples for core rules (rule 5 auto-refresh\n * examples and rule 8 external provider names). When absent, generic\n * placeholders are used so no template-specific names appear in the core\n * prompt by default.\n *\n * - `providerActions`: external provider action names this template exposes\n * (e.g. `[\"warehouse-query\", \"crm-records\"]` for a template).\n * - `appActions`: representative template action names for rule 5's refresh\n * examples (e.g. `[\"log-meal\", \"update-form\"]` for a forms template).\n */\n promptExamples?: PromptExamples;\n /**\n * Curated allow-list of action names to serve external **connector** clients\n * on a hosted multi-tenant deployment.\n *\n * Whenever this list is non-empty it is active by default for **every**\n * caller (hosted connectors, code/stdio clients, and the local CLI): external\n * MCP clients see (and can call) only these actions plus the builtin\n * cross-app tools (`list_apps`, `open_app`, `ask_app`, `create_embed_session`).\n * Calls to any tool outside the list are rejected with \"Unknown tool\".\n * This prevents the full ~105-tool catalog from bloating external-agent\n * context windows and removes footguns (db-exec, seed-*, extension suite,\n * browser-session tools) from connectors. It is no longer gated behind an\n * environment variable, and the catalog is never inferred from the client.\n *\n * `tool-search` stays available for discovery; a trimmed action still needs\n * the connector catalog, authenticated-read policy, or full-catalog opt-in\n * before an external caller can execute it.\n * Callers who need the full surface up front opt in explicitly with\n * `agent-native connect --full-catalog` (embeds a `catalog_scope: \"full\"`\n * claim in their connect-minted JWT) or the deployment-wide\n * `AGENT_NATIVE_MCP_FULL_CATALOG=1` env override.\n *\n * Declare here rather than in MCPConfig directly; the plugin copies it through.\n */\n connectorCatalog?: string[];\n\n /**\n * Default authenticated external-agent policy. In `auto` read mode, every\n * action explicitly marked as GET + readOnly + publicAgent.requiresAuth is\n * added to the connector surface automatically. Writes remain ask_app-only\n * unless `writes: \"allowlisted\"` is explicitly selected.\n */\n externalAgents?: ExternalAgentPolicy;\n\n /**\n * Skip mounting the remote MCP protocol route.\n *\n * Most apps should leave this off so agent chat, A2A, and MCP share one\n * runtime. Hosted apps with a dedicated early MCP plugin can set this to\n * true so their external connector does not depend on the heavier chat\n * plugin initialization path.\n */\n disableMcp?: boolean;\n\n /**\n * Code-execution capability for the production agent.\n *\n * - `\"off\"` (default) — no code-execution tools in production.\n * - `\"sandboxed\"` — registers the `run-code` tool (isolated Node.js sandbox\n * with a bridge to allowlisted registered tools). Safe for shared or\n * hosted deployments.\n * - `\"trusted\"` — registers both the full coding tool registry\n * (bash / read / edit / write) and the `run-code` sandbox. Only use in\n * single-tenant or operator-controlled deployments where full shell access\n * to the host machine is intentional.\n *\n * The `AGENT_PROD_CODE_EXECUTION` environment variable (`\"trusted\"`,\n * `\"sandboxed\"`, or `\"off\"`) takes precedence over this option, allowing\n * per-deployment overrides without code changes.\n *\n * Dev-mode behavior is unchanged — both the coding tools and `run-code` are\n * always available when the environment allows toggling.\n */\n codeExecution?: {\n production?: \"off\" | \"sandboxed\" | \"trusted\";\n /**\n * Extra registered-tool names the sandbox bridge may forward (beyond the\n * default allowlist: provider-api-request, provider-api-docs,\n * provider-api-catalog, web-request).\n */\n bridgeTools?: string[];\n };\n\n /**\n * App-level default tool-call limits. Individual actions override these with\n * their own `timeoutMs` / `maxResultChars` declarations.\n */\n toolLimits?: { timeoutMs?: number; maxResultChars?: number };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"plugin-options.js","sourceRoot":"","sources":["../../../src/server/agent-chat/plugin-options.ts"],"names":[],"mappings":"","sourcesContent":["import type { ActionEntry } from \"../../agent/production-agent.js\";\nimport type { AgentLoopFinalResponseGuard } from \"../../agent/production-agent.js\";\nimport type {\n AgentChatAttachment,\n AgentChatReference,\n MentionProvider,\n} from \"../../agent/types.js\";\nimport type { ExternalAgentPolicy } from \"../../mcp/external-agent-policy.js\";\nimport type { DatabaseToolsOption } from \"../../scripts/db/tool-mode.js\";\nimport type { PromptExamples } from \"../prompts/index.js\";\n\n/** Shape of a Nitro plugin function: receives the Nitro app instance at\n * startup and may register routes/hooks synchronously or asynchronously. */\nexport type NitroPluginDef = (nitroApp: any) => void | Promise<void>;\n\nexport interface AgentChatPluginOptions {\n /** Template-specific actions (email ops, booking ops, etc.) */\n actions?:\n | Record<string, ActionEntry>\n | (() =>\n | Record<string, ActionEntry>\n | Promise<Record<string, ActionEntry>>);\n /** @deprecated Use `actions` instead */\n scripts?:\n | Record<string, ActionEntry>\n | (() =>\n | Record<string, ActionEntry>\n | Promise<Record<string, ActionEntry>>);\n /** System prompt for the agent. A sensible default is provided. */\n systemPrompt?: string;\n /** Additional system prompt prepended in dev mode */\n devSystemPrompt?: string;\n /** Model to use. Defaults to the resolved engine's default model. */\n model?: string;\n /** Optional per-app agent run chunk budget in milliseconds. Defaults to\n * AGENT_RUN_SOFT_TIMEOUT_MS when set, otherwise no framework-imposed\n * timeout. When reached, long runs continue through the hidden continuation\n * path instead of surfacing a timeout warning. */\n runSoftTimeoutMs?: number;\n /** Optional per-app run-manager no-progress watchdog in milliseconds. */\n runNoProgressTimeoutMs?: number;\n /**\n * Opt this app into Netlify durable background-function agent-chat runs. This\n * gives hosted agent turns the 15-minute async-function budget when the app's\n * Netlify build also emits the background function. Set this to `false` to\n * explicitly disable a stale deploy-wide `AGENT_CHAT_DURABLE_BACKGROUND`\n * flag for this app.\n */\n durableBackgroundRuns?: boolean;\n /** Anthropic API key. Falls back to ANTHROPIC_API_KEY env var */\n apiKey?: string;\n /**\n * Agent engine to use. Can be a pre-constructed AgentEngine, a registered\n * engine name (e.g. \"anthropic\", \"ai-sdk:openai\"), or an object with name\n * and config. Defaults to the \"anthropic\" engine using ANTHROPIC_API_KEY.\n */\n engine?:\n | import(\"../../agent/engine/types.js\").AgentEngine\n | string\n | { name: string; config: Record<string, unknown> };\n /** Route path. Default: /_agent-native/agent-chat */\n path?: string;\n /** Custom mention providers for @-tagging template entities */\n mentionProviders?:\n | Record<string, MentionProvider>\n | (() =>\n | Record<string, MentionProvider>\n | Promise<Record<string, MentionProvider>>);\n /** App ID used to exclude self from agent discovery (e.g., \"mail\", \"calendar\") */\n appId?: string;\n /** Optional MCP server branding surfaced during the initialize handshake. */\n mcpServerInfo?: {\n /** Human-facing title. Defaults to the capitalized app id/name. */\n title?: string;\n /** Host-facing description. Defaults to \"Agent-native <app> agent\". */\n description?: string;\n /** Canonical app URL. Relative URLs are resolved against the request origin. */\n websiteUrl?: string;\n /** App icons. Relative `src` values are resolved against the request origin. */\n icons?: Array<{\n src: string;\n mimeType?: string;\n sizes?: string[];\n theme?: \"light\" | \"dark\";\n }>;\n };\n /**\n * Optional callback to resolve the org ID for the current request.\n * When provided, the resolved value is set as AGENT_ORG_ID env var so\n * that db-query/db-exec automatically scope by org_id in addition to\n * owner_email.\n *\n * If not provided, the framework automatically uses `session.orgId` from\n * Better Auth's active organization. Only provide this callback when you\n * need custom org resolution logic (e.g., Atlassian org mapping).\n */\n resolveOrgId?: (event: any) => string | null | Promise<string | null>;\n /**\n * Optional owner resolver for public/anonymous chat surfaces. When the\n * normal app session is missing, this callback may return a synthetic\n * owner id for a narrowly-scoped public request (for example, a public\n * shared document page). Anonymous requests use a read-only tool set by\n * default so public viewers cannot mutate app data through the agent.\n */\n anonymousOwner?: (event: any) => string | null | Promise<string | null>;\n /**\n * Keep anonymous-owner requests on read-only template actions. Defaults to\n * true. Only disable for single-tenant apps that intentionally allow public\n * agent mutations.\n */\n anonymousReadOnly?: boolean;\n /**\n * Optional auth adapter for the HTTP action route\n * (`/_agent-native/actions/*`). Its `resolveCaller` runs before the\n * cookie/bearer `getSession` chain, letting an app accept caller identities\n * `getSession` doesn't understand (e.g. an A2A JWT verified with\n * `verifyA2AToken`) declaratively, instead of pre-seeding request context\n * from a Nitro `request` hook.\n *\n * Returning `null` defers to the normal chain; THROWING hard-rejects with a\n * 401 (an invalid/forged credential must not fall through to a same-origin\n * session cookie). A resolved caller's org comes exclusively from the\n * verified credential — the returned `orgId` or the owner-email membership\n * lookup — never from the request's session cookie.\n * See {@link import(\"../action-routes.js\").ActionRouteAuthAdapter}.\n */\n actionRouteAuth?: import(\"../action-routes.js\").ActionRouteAuthAdapter;\n /**\n * Optional callback to append template-specific context to the system\n * prompt on each request. Runs after AGENTS.md / skills / memory are\n * loaded and before the schema block — use it to inject dynamic SQL\n * context like a data dictionary, active feature flags, or whatever\n * the agent should know about *right now* for this user/org.\n *\n * Return `null` or an empty string to skip. The string you return is\n * appended verbatim, so wrap it in your own XML tags (e.g.\n * `<data-dictionary>…</data-dictionary>`) to keep the prompt scannable.\n *\n * Called on every request in every prompt variant (lean, lazy, full).\n * Templates that want to suppress it in a particular mode should return\n * `null` from the callback based on their own logic.\n */\n extraContext?: (\n event: any,\n owner: string,\n ) => string | null | Promise<string | null>;\n /**\n * Optional final-answer guard. Templates can use this to require a\n * corrective retry before accepting a text-only final answer, e.g. forcing\n * real data-source tool calls for analytics requests.\n */\n finalResponseGuard?: AgentLoopFinalResponseGuard;\n /**\n * Optional per-template request normalizer. Runs after authentication and\n * before the model sees the message, so apps can translate chat attachments\n * into template-native file handles while preserving the user's visible text.\n */\n prepareRequest?: (details: {\n event: any;\n ownerEmail: string | null;\n message: string;\n displayMessage?: string;\n attachments: AgentChatAttachment[];\n references: AgentChatReference[];\n threadId?: string;\n internalContinuation?: boolean;\n mode: \"act\" | \"plan\";\n }) =>\n | void\n | {\n message?: string;\n displayMessage?: string;\n attachments?: AgentChatAttachment[];\n }\n | Promise<void | {\n message?: string;\n displayMessage?: string;\n attachments?: AgentChatAttachment[];\n }>;\n /**\n * Use ONLY the template's `systemPrompt` and the actions list — skip the\n * framework prompt wrapper, resource loading (AGENTS.md/LEARNINGS.md/\n * memory), the SQL schema block, and the workspace files/skills/agents\n * inventory. Intended for minimal or voice-first apps where a long,\n * generic preamble adds latency and iteration noise without adding value.\n *\n * When set, the same lean prompt is used in both dev and prod modes. In\n * dev mode the tool registry is ALSO swapped to the template's actions\n * (same set as prod) — the dev-only bash/db-exec/file-system tools\n * and the resource/docs/chat/team/job/browser scripts are dropped. The\n * lean system prompt has no bash-usage guidance, so routing actions\n * through bash would break. If you need the full dev tool surface,\n * leave this off.\n */\n leanPrompt?: boolean;\n /**\n * Skip auto-injecting the workspace files/skills/agents inventory on the\n * first message of a conversation while keeping the normal prompt, resources,\n * and tool surface. Use this for domain-focused apps where broad workspace\n * inventory is mostly latency/noise unless the user explicitly references it.\n *\n * `leanPrompt: true` and the default `lazyContext` mode imply this because\n * those catalogs are already discoverable through resources, docs-search,\n * tool-search, and the compact resource indexes. Set `false` explicitly only\n * when a workspace-wide inventory is central to the app's first-turn job.\n */\n skipFilesContext?: boolean;\n /**\n * Initial native tool schemas to send to the LLM provider. When set, the\n * agent starts with only these tools plus `tool-search`; the live registry\n * remains searchable, and matching schemas from `tool-search` results are\n * loaded into the next model request. Use this for domain-focused apps that\n * have a few common actions and many rare framework utilities. Common\n * discovery and resource-reading tools are promoted automatically when\n * present. Provider, MCP, extension, and code-execution schemas stay behind\n * tool-search unless the app explicitly includes them in this list.\n */\n initialToolNames?: string[];\n /**\n * Controls whether broad provider/corpus tools and their workflow prompt are\n * loaded into the first model request. Use `\"lazy\"` for apps that can answer\n * ordinary lookups from a compact curated tool set; corpus tools remain\n * discoverable through tool-search and the full retry surface.\n *\n * @default \"initial\"\n */\n corpusTools?: \"initial\" | \"lazy\";\n /**\n * Use a compact system prompt with on-demand context loading. The system\n * prompt includes essential behavioral rules and action signatures, but\n * defers verbose framework details, SQL schema, skills, learnings, and\n * memory behind tools (`get-framework-context`, `db-schema`,\n * `resources` (action: read)). The agent fetches these on-demand when needed.\n *\n * This reduces the system prompt by ~60-70%, significantly improving\n * time-to-first-token and reducing \"thinking\" time. The agent retains\n * all capabilities — it just loads context lazily instead of upfront.\n *\n * Defaults to `true`. Set to `false` to use the original full prompt.\n * Ignored when `leanPrompt` is set (lean mode is even more minimal).\n */\n lazyContext?: boolean;\n /**\n * In dev mode, register the template's actions as native tools the agent\n * can call directly with structured JSON args — skipping the default\n * `bash(command=\"pnpm action <name> ...\")` indirection.\n *\n * The default dev behavior shells out because it \"mirrors how Claude Code\n * works locally\" and reduces empty-object tool calls for templates with\n * simple string args. But templates whose actions take structured data\n * (objects, arrays, nested JSON) can't round-trip those cleanly through\n * the CLI parser — stringified JSON on the way in, loss of type fidelity\n * on the way out.\n *\n * Set to `true` to get the same tool surface in dev that production uses.\n * `leanPrompt: true` implies this already (lean mode has no bash-usage\n * guidance, so actions must be native). Set this flag without\n * `leanPrompt` when you want native actions AND the full system prompt.\n *\n * Defaults to `false`.\n */\n nativeActionsInDev?: boolean;\n /**\n * Expose raw SQL/native database tools to the app agent.\n *\n * Defaults to `\"read\"`: `db-schema`/`db-query` are available for inspection,\n * while writes route through typed app actions. Set to `\"write\"` (also\n * `true`) to expose `db-exec`/`db-patch` for scoped raw SQL maintenance.\n * Set to `\"off\"` (also `false`) for chat-first apps that want agents to use\n * typed actions only.\n */\n databaseTools?: DatabaseToolsOption;\n /**\n * Expose framework extension management actions (`create-extension`,\n * `update-extension`, `list-extensions`, etc.) to the app agent. Defaults to\n * false. Set to true for apps that intentionally let the LLM create or\n * manage sandboxed extension mini-apps. Core extension routes may still be\n * mounted for compatibility and app-owned surfaces.\n */\n extensionTools?: boolean;\n /**\n * Optional A2A-only deterministic response path. Runs after inbound A2A text\n * and user context are resolved, but before an agent engine/model is loaded.\n * Return a message to complete the A2A task without invoking the LLM, or\n * null/undefined to continue through the normal agent loop.\n */\n a2aMessageFallback?: (details: {\n message: import(\"../../a2a/types.js\").Message;\n text: string;\n context: import(\"../../a2a/types.js\").A2AHandlerContext;\n userEmail: string | undefined;\n }) =>\n | import(\"../../a2a/types.js\").Message\n | string\n | null\n | undefined\n | Promise<import(\"../../a2a/types.js\").Message | string | null | undefined>;\n /**\n * Optional injectable prompt examples for core rules (rule 5 auto-refresh\n * examples and rule 8 external provider names). When absent, generic\n * placeholders are used so no template-specific names appear in the core\n * prompt by default.\n *\n * - `providerActions`: external provider action names this template exposes\n * (e.g. `[\"warehouse-query\", \"crm-records\"]` for a template).\n * - `appActions`: representative template action names for rule 5's refresh\n * examples (e.g. `[\"log-meal\", \"update-form\"]` for a forms template).\n */\n promptExamples?: PromptExamples;\n /**\n * Curated allow-list of action names to serve external **connector** clients\n * on a hosted multi-tenant deployment.\n *\n * Whenever this list is non-empty it is active by default for **every**\n * caller (hosted connectors, code/stdio clients, and the local CLI): external\n * MCP clients see (and can call) only these actions plus the builtin\n * cross-app tools (`list_apps`, `open_app`, `ask_app`, `create_embed_session`).\n * Calls to any tool outside the list are rejected with \"Unknown tool\".\n * This prevents the full ~105-tool catalog from bloating external-agent\n * context windows and removes footguns (db-exec, seed-*, extension suite,\n * browser-session tools) from connectors. It is no longer gated behind an\n * environment variable, and the catalog is never inferred from the client.\n *\n * `tool-search` stays available for discovery; a trimmed action still needs\n * the connector catalog, authenticated-read policy, or full-catalog opt-in\n * before an external caller can execute it.\n * Callers who need the full surface up front opt in explicitly with\n * `agent-native connect --full-catalog` (embeds a `catalog_scope: \"full\"`\n * claim in their connect-minted JWT) or the deployment-wide\n * `AGENT_NATIVE_MCP_FULL_CATALOG=1` env override.\n *\n * Declare here rather than in MCPConfig directly; the plugin copies it through.\n */\n connectorCatalog?: string[];\n\n /**\n * Default authenticated external-agent policy. In `auto` read mode, every\n * action explicitly marked as GET + readOnly + publicAgent.requiresAuth is\n * added to the connector surface automatically. Writes remain ask_app-only\n * unless `writes: \"allowlisted\"` is explicitly selected.\n */\n externalAgents?: ExternalAgentPolicy;\n\n /**\n * Skip mounting the remote MCP protocol route.\n *\n * Most apps should leave this off so agent chat, A2A, and MCP share one\n * runtime. Hosted apps with a dedicated early MCP plugin can set this to\n * true so their external connector does not depend on the heavier chat\n * plugin initialization path.\n */\n disableMcp?: boolean;\n\n /**\n * Code-execution capability for the production agent.\n *\n * - `\"off\"` (default) — no code-execution tools in production.\n * - `\"sandboxed\"` — registers the `run-code` tool (isolated Node.js sandbox\n * with a bridge to allowlisted registered tools). Safe for shared or\n * hosted deployments.\n * - `\"trusted\"` — registers both the full coding tool registry\n * (bash / read / edit / write) and the `run-code` sandbox. Only use in\n * single-tenant or operator-controlled deployments where full shell access\n * to the host machine is intentional.\n *\n * The `AGENT_PROD_CODE_EXECUTION` environment variable (`\"trusted\"`,\n * `\"sandboxed\"`, or `\"off\"`) takes precedence over this option, allowing\n * per-deployment overrides without code changes.\n *\n * Dev-mode behavior is unchanged — both the coding tools and `run-code` are\n * always available when the environment allows toggling.\n */\n codeExecution?: {\n production?: \"off\" | \"sandboxed\" | \"trusted\";\n /**\n * Extra registered-tool names the sandbox bridge may forward (beyond the\n * default allowlist: provider-api-request, provider-api-docs,\n * provider-api-catalog, web-request).\n */\n bridgeTools?: string[];\n };\n\n /**\n * App-level default tool-call limits. Individual actions override these with\n * their own `timeoutMs` / `maxResultChars` declarations.\n */\n toolLimits?: { timeoutMs?: number; maxResultChars?: number };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"script-entries.d.ts","sourceRoot":"","sources":["../../../src/server/agent-chat/script-entries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;A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sB,uBAAuB,IAAI,OAAO,CACtD,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAC5B,CA0JA;AAED;;;GAGG;AACH,wBAAsB,8BAA8B,CAClD,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CA0BtC;AAED;;;GAGG;AACH,wBAAsB,oCAAoC,IAAI,OAAO,CACnE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAC5B,CAUA;AAED;;;GAGG;AACH,wBAAsB,0BAA0B,CAC9C,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAsDtC"}
|
|
@@ -54,7 +54,7 @@ export async function createDbScriptEntries(mode = "read", options = {}) {
|
|
|
54
54
|
try {
|
|
55
55
|
if (mode === "off")
|
|
56
56
|
return {};
|
|
57
|
-
const extensionQueryGuidance = options.extensionTools
|
|
57
|
+
const extensionQueryGuidance = options.extensionTools !== true
|
|
58
58
|
? "Extension management tools are disabled for this app; do not query or mutate the legacy tools table as a workaround."
|
|
59
59
|
: "For extension management, use list-extensions, update-extension, hide-extension, or delete-extension instead of querying the legacy tools table.";
|
|
60
60
|
const [schemaMod, queryMod] = await Promise.all([
|
|
@@ -337,6 +337,15 @@ export async function createResourceScriptEntries() {
|
|
|
337
337
|
required: ["action"],
|
|
338
338
|
},
|
|
339
339
|
},
|
|
340
|
+
planMode: {
|
|
341
|
+
effect: (args) => args.action === "list" ||
|
|
342
|
+
args.action === "read" ||
|
|
343
|
+
args.action === "effective"
|
|
344
|
+
? "read"
|
|
345
|
+
: "write",
|
|
346
|
+
allowedValues: { action: ["list", "read", "effective"] },
|
|
347
|
+
description: "Plan mode allows listing and reading workspace resources.",
|
|
348
|
+
},
|
|
340
349
|
run: async (args) => {
|
|
341
350
|
const { action: a, ...rest } = args;
|
|
342
351
|
if (a === "list")
|
|
@@ -539,6 +548,11 @@ export async function createChatScriptEntries() {
|
|
|
539
548
|
required: ["action"],
|
|
540
549
|
},
|
|
541
550
|
},
|
|
551
|
+
planMode: {
|
|
552
|
+
effect: (args) => (args.action === "search" ? "read" : "write"),
|
|
553
|
+
allowedValues: { action: ["search"] },
|
|
554
|
+
description: "Plan mode allows searching chat history.",
|
|
555
|
+
},
|
|
542
556
|
run: async (args) => {
|
|
543
557
|
if (args?.action === "open") {
|
|
544
558
|
return openEntry.run(args);
|
|
@@ -601,6 +615,11 @@ export async function createAgentEngineScriptEntries(appId) {
|
|
|
601
615
|
return {
|
|
602
616
|
"manage-agent-engine": {
|
|
603
617
|
tool: mod.tool,
|
|
618
|
+
planMode: {
|
|
619
|
+
effect: (args) => (args.action === "list" ? "read" : "write"),
|
|
620
|
+
allowedValues: { action: ["list"] },
|
|
621
|
+
description: "Plan mode allows listing available agent engines.",
|
|
622
|
+
},
|
|
604
623
|
run: (args) => mod.run({
|
|
605
624
|
...args,
|
|
606
625
|
appId: typeof args.appId === "string" && args.appId.trim()
|
|
@@ -639,6 +658,28 @@ export async function createCallAgentScriptEntry(selfAppId) {
|
|
|
639
658
|
const mod = await import("../../scripts/call-agent.js");
|
|
640
659
|
entries["call-agent"] = {
|
|
641
660
|
tool: mod.tool,
|
|
661
|
+
planMode: {
|
|
662
|
+
effect: (args) => {
|
|
663
|
+
const keys = Object.keys(args);
|
|
664
|
+
if (keys.some((key) => key !== "agent" && key !== "action" && key !== "input")) {
|
|
665
|
+
return "write";
|
|
666
|
+
}
|
|
667
|
+
if (typeof args.agent !== "string" ||
|
|
668
|
+
!args.agent.trim() ||
|
|
669
|
+
typeof args.action !== "string" ||
|
|
670
|
+
!args.action.trim() ||
|
|
671
|
+
!Object.hasOwn(args, "input") ||
|
|
672
|
+
args.input === null ||
|
|
673
|
+
typeof args.input !== "object" ||
|
|
674
|
+
Array.isArray(args.input)) {
|
|
675
|
+
return "unknown";
|
|
676
|
+
}
|
|
677
|
+
return "read";
|
|
678
|
+
},
|
|
679
|
+
allowedProperties: ["agent", "action", "input"],
|
|
680
|
+
requiredProperties: ["agent", "action"],
|
|
681
|
+
description: "Plan mode allows only exact read-only cross-app action calls with agent, action, and input.",
|
|
682
|
+
},
|
|
642
683
|
run: (args, context) => mod.run(args, context, selfAppId),
|
|
643
684
|
};
|
|
644
685
|
}
|
|
@@ -650,6 +691,7 @@ export async function createCallAgentScriptEntry(selfAppId) {
|
|
|
650
691
|
entries["describe-workspace-apps"] = {
|
|
651
692
|
tool: mod.tool,
|
|
652
693
|
run: (args, context) => mod.run(args, context, selfAppId),
|
|
694
|
+
readOnly: true,
|
|
653
695
|
};
|
|
654
696
|
}
|
|
655
697
|
catch {
|