@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/triggers/actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/triggers/actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AA8RhE,wBAAgB,2BAA2B,CACzC,cAAc,EAAE,MAAM,MAAM,GAC3B,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAqI7B"}
|
package/dist/triggers/actions.js
CHANGED
|
@@ -8,9 +8,11 @@
|
|
|
8
8
|
* All six operations are consolidated into a single `manage-automations` tool
|
|
9
9
|
* with an `action` discriminator to keep the tool registry compact.
|
|
10
10
|
*/
|
|
11
|
+
import { defineAutomation, deleteAutomation, listAutomationDefinitions, updateAutomation, } from "../automations/service.js";
|
|
11
12
|
import { listEvents } from "../event-bus/index.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
13
|
+
import { describeCron } from "../jobs/cron.js";
|
|
14
|
+
import { getIntegrationRequestContext, getRequestOrgId, } from "../server/request-context.js";
|
|
15
|
+
import { refreshEventSubscriptions } from "./dispatcher.js";
|
|
14
16
|
/* ------------------------------------------------------------------ */
|
|
15
17
|
/* Individual action handlers */
|
|
16
18
|
/* ------------------------------------------------------------------ */
|
|
@@ -39,114 +41,180 @@ async function handleListEvents() {
|
|
|
39
41
|
return lines.join("\n");
|
|
40
42
|
}
|
|
41
43
|
async function handleList(args, getCurrentUser) {
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
.filter((
|
|
46
|
-
.filter((
|
|
47
|
-
.map((
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
44
|
+
const scope = automationScope(args.scope);
|
|
45
|
+
const definitions = await listAutomationDefinitions({ userEmail: getCurrentUser(), orgId: getRequestOrgId() }, scope);
|
|
46
|
+
const automations = definitions
|
|
47
|
+
.filter(({ meta }) => !args.domain || meta.domain === args.domain)
|
|
48
|
+
.filter(({ meta }) => args.enabled_only !== "true" || meta.enabled)
|
|
49
|
+
.map(({ name, meta, body, canUpdate }) => ({
|
|
50
|
+
name,
|
|
51
|
+
scope,
|
|
52
|
+
triggerType: meta.triggerType,
|
|
53
|
+
event: meta.event ?? null,
|
|
54
|
+
schedule: meta.schedule || null,
|
|
55
|
+
scheduleDescription: meta.schedule ? describeCron(meta.schedule) : null,
|
|
56
|
+
condition: meta.condition ?? null,
|
|
57
|
+
mode: meta.mode,
|
|
58
|
+
domain: meta.domain ?? null,
|
|
59
|
+
enabled: meta.enabled,
|
|
60
|
+
lastRun: meta.lastRun ?? null,
|
|
61
|
+
lastStatus: meta.lastStatus ?? null,
|
|
62
|
+
lastError: meta.lastError ?? null,
|
|
63
|
+
nextRun: meta.nextRun ?? null,
|
|
64
|
+
createdBy: meta.createdBy ?? null,
|
|
65
|
+
runAs: meta.runAs ?? null,
|
|
66
|
+
model: meta.model ?? null,
|
|
67
|
+
mcpTools: meta.mcpTools ?? [],
|
|
68
|
+
originScopeId: meta.originScopeId ?? null,
|
|
69
|
+
deliveryPlatform: meta.deliveryPlatform ?? null,
|
|
70
|
+
deliveryDestination: meta.deliveryDestination ?? null,
|
|
71
|
+
deliveryThreadRef: meta.deliveryThreadRef ?? null,
|
|
72
|
+
deliveryTenantId: meta.deliveryTenantId ?? null,
|
|
73
|
+
body,
|
|
74
|
+
canUpdate,
|
|
75
|
+
}));
|
|
76
|
+
return JSON.stringify(automations, null, 2);
|
|
77
|
+
}
|
|
78
|
+
function automationScope(value) {
|
|
79
|
+
if (value === undefined || value === null || value === "")
|
|
80
|
+
return "personal";
|
|
81
|
+
if (value === "personal" || value === "organization")
|
|
82
|
+
return value;
|
|
83
|
+
throw new Error('scope must be "personal" or "organization".');
|
|
84
|
+
}
|
|
85
|
+
function automationTriggerType(value) {
|
|
86
|
+
if (value === "schedule" || value === "event")
|
|
87
|
+
return value;
|
|
88
|
+
throw new Error('trigger_type must be "schedule" or "event".');
|
|
74
89
|
}
|
|
75
90
|
async function handleDefine(args, getCurrentUser) {
|
|
76
|
-
const owner = getCurrentUser();
|
|
77
|
-
const name = (args.name || "").replace(/[^a-z0-9-]/g, "-");
|
|
78
|
-
if (!name)
|
|
79
|
-
return "Error: name is required (lowercase, hyphens).";
|
|
80
|
-
const path = `jobs/${name}.md`;
|
|
81
|
-
// Check if it already exists
|
|
82
|
-
const existing = await resourceGetByPath(owner, path);
|
|
83
|
-
if (existing) {
|
|
84
|
-
return `Error: An automation named "${name}" already exists. Use a different name or delete the existing one first.`;
|
|
85
|
-
}
|
|
86
91
|
if (args.mode === "deterministic") {
|
|
87
92
|
return ("Error: Deterministic mode was removed — it was never implemented and " +
|
|
88
93
|
"automations that set it never fired. Create the automation without " +
|
|
89
94
|
"mode (agentic), and describe the exact fixed steps in the automation body.");
|
|
90
95
|
}
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
96
|
+
const integration = getIntegrationRequestContext();
|
|
97
|
+
try {
|
|
98
|
+
const definition = await defineAutomation({ userEmail: getCurrentUser(), orgId: getRequestOrgId() }, {
|
|
99
|
+
name: typeof args.name === "string" ? args.name : "",
|
|
100
|
+
scope: automationScope(args.scope),
|
|
101
|
+
triggerType: automationTriggerType(args.trigger_type),
|
|
102
|
+
body: typeof args.body === "string" ? args.body : "",
|
|
103
|
+
schedule: typeof args.schedule === "string" ? args.schedule : undefined,
|
|
104
|
+
event: typeof args.event === "string" ? args.event : undefined,
|
|
105
|
+
condition: typeof args.condition === "string" ? args.condition : undefined,
|
|
106
|
+
domain: typeof args.domain === "string" ? args.domain : undefined,
|
|
107
|
+
delegatedPolicyId: typeof args.delegated_policy_id === "string"
|
|
108
|
+
? args.delegated_policy_id
|
|
109
|
+
: undefined,
|
|
110
|
+
model: typeof args.model === "string" ? args.model : undefined,
|
|
111
|
+
mcpTools: args.mcpTools,
|
|
112
|
+
delivery: integration
|
|
113
|
+
? {
|
|
114
|
+
originScopeId: integration.scopeId,
|
|
115
|
+
platform: integration.incoming.platform,
|
|
116
|
+
destination: typeof integration.incoming.platformContext.channelId ===
|
|
117
|
+
"string"
|
|
118
|
+
? integration.incoming.platformContext.channelId
|
|
119
|
+
: undefined,
|
|
120
|
+
threadRef: typeof integration.incoming.threadRef === "string"
|
|
121
|
+
? integration.incoming.threadRef
|
|
122
|
+
: undefined,
|
|
123
|
+
tenantId: integration.incoming.tenantId,
|
|
124
|
+
}
|
|
125
|
+
: undefined,
|
|
126
|
+
});
|
|
127
|
+
await refreshEventSubscriptions();
|
|
128
|
+
return JSON.stringify({
|
|
129
|
+
created: true,
|
|
130
|
+
name: definition.name,
|
|
131
|
+
scope: definition.scope,
|
|
132
|
+
triggerType: definition.meta.triggerType,
|
|
133
|
+
event: definition.meta.event ?? null,
|
|
134
|
+
schedule: definition.meta.schedule || null,
|
|
135
|
+
nextRun: definition.meta.nextRun ?? null,
|
|
136
|
+
createdBy: definition.meta.createdBy,
|
|
137
|
+
runAs: definition.meta.runAs,
|
|
138
|
+
model: definition.meta.model ?? null,
|
|
139
|
+
mcpTools: definition.meta.mcpTools ?? [],
|
|
140
|
+
originScopeId: definition.meta.originScopeId ?? null,
|
|
141
|
+
deliveryPlatform: definition.meta.deliveryPlatform ?? null,
|
|
142
|
+
deliveryDestination: definition.meta.deliveryDestination ?? null,
|
|
143
|
+
deliveryThreadRef: definition.meta.deliveryThreadRef ?? null,
|
|
144
|
+
deliveryTenantId: definition.meta.deliveryTenantId ?? null,
|
|
145
|
+
});
|
|
120
146
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
meta.enabled = args.enabled !== "false";
|
|
147
|
+
catch (error) {
|
|
148
|
+
return `Error: ${error.message}`;
|
|
124
149
|
}
|
|
125
|
-
|
|
126
|
-
|
|
150
|
+
}
|
|
151
|
+
async function handleUpdate(args, getCurrentUser) {
|
|
152
|
+
try {
|
|
153
|
+
const definition = await updateAutomation({ userEmail: getCurrentUser(), orgId: getRequestOrgId() }, {
|
|
154
|
+
name: typeof args.name === "string" ? args.name : "",
|
|
155
|
+
scope: automationScope(args.scope),
|
|
156
|
+
enabled: args.enabled === undefined
|
|
157
|
+
? undefined
|
|
158
|
+
: args.enabled === true || args.enabled === "true",
|
|
159
|
+
condition: args.condition === undefined
|
|
160
|
+
? undefined
|
|
161
|
+
: typeof args.condition === "string"
|
|
162
|
+
? args.condition
|
|
163
|
+
: null,
|
|
164
|
+
delegatedPolicyId: args.delegated_policy_id === undefined
|
|
165
|
+
? undefined
|
|
166
|
+
: typeof args.delegated_policy_id === "string"
|
|
167
|
+
? args.delegated_policy_id
|
|
168
|
+
: null,
|
|
169
|
+
body: typeof args.body === "string" ? args.body : undefined,
|
|
170
|
+
schedule: typeof args.schedule === "string" ? args.schedule : undefined,
|
|
171
|
+
model: args.model === undefined
|
|
172
|
+
? undefined
|
|
173
|
+
: typeof args.model === "string"
|
|
174
|
+
? args.model
|
|
175
|
+
: null,
|
|
176
|
+
mcpTools: args.mcpTools,
|
|
177
|
+
});
|
|
178
|
+
await refreshEventSubscriptions();
|
|
179
|
+
return JSON.stringify({
|
|
180
|
+
updated: true,
|
|
181
|
+
name: definition.name,
|
|
182
|
+
scope: definition.scope,
|
|
183
|
+
triggerType: definition.meta.triggerType,
|
|
184
|
+
enabled: definition.meta.enabled,
|
|
185
|
+
schedule: definition.meta.schedule || null,
|
|
186
|
+
nextRun: definition.meta.nextRun ?? null,
|
|
187
|
+
createdBy: definition.meta.createdBy,
|
|
188
|
+
runAs: definition.meta.runAs,
|
|
189
|
+
model: definition.meta.model ?? null,
|
|
190
|
+
mcpTools: definition.meta.mcpTools ?? [],
|
|
191
|
+
originScopeId: definition.meta.originScopeId ?? null,
|
|
192
|
+
deliveryPlatform: definition.meta.deliveryPlatform ?? null,
|
|
193
|
+
deliveryDestination: definition.meta.deliveryDestination ?? null,
|
|
194
|
+
deliveryThreadRef: definition.meta.deliveryThreadRef ?? null,
|
|
195
|
+
deliveryTenantId: definition.meta.deliveryTenantId ?? null,
|
|
196
|
+
});
|
|
127
197
|
}
|
|
128
|
-
|
|
129
|
-
|
|
198
|
+
catch (error) {
|
|
199
|
+
return `Error: ${error.message}`;
|
|
130
200
|
}
|
|
131
|
-
const newBody = args.body ?? body;
|
|
132
|
-
await resourcePut(resource.owner, resource.path, buildTriggerContent(meta, newBody));
|
|
133
|
-
await refreshEventSubscriptions();
|
|
134
|
-
return `Automation "${name}" updated.`;
|
|
135
201
|
}
|
|
136
202
|
async function handleDelete(args, getCurrentUser) {
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
return
|
|
142
|
-
|
|
143
|
-
|
|
203
|
+
const name = typeof args.name === "string" ? args.name : "";
|
|
204
|
+
try {
|
|
205
|
+
await deleteAutomation({ userEmail: getCurrentUser(), orgId: getRequestOrgId() }, automationScope(args.scope), name);
|
|
206
|
+
await refreshEventSubscriptions();
|
|
207
|
+
return JSON.stringify({ deleted: true, name });
|
|
208
|
+
}
|
|
209
|
+
catch (error) {
|
|
210
|
+
return `Error: ${error.message}`;
|
|
211
|
+
}
|
|
144
212
|
}
|
|
145
213
|
async function handleFireTest(args, getCurrentUser) {
|
|
146
214
|
// Dynamic import to avoid circular dependency at module load time
|
|
147
215
|
const { emit } = await import("../event-bus/index.js");
|
|
148
216
|
let data = {};
|
|
149
|
-
if (args.data) {
|
|
217
|
+
if (typeof args.data === "string" && args.data) {
|
|
150
218
|
try {
|
|
151
219
|
data = JSON.parse(args.data);
|
|
152
220
|
}
|
|
@@ -178,9 +246,9 @@ export function createAutomationToolEntries(getCurrentUser) {
|
|
|
178
246
|
description: `Manage automations (event-triggered and scheduled tasks). Use the "action" parameter to choose an operation:
|
|
179
247
|
|
|
180
248
|
- **list-events**: List all registered event types that automations can subscribe to. Returns event names, descriptions, and payload schemas. Call this BEFORE defining an automation to discover available events.
|
|
181
|
-
- **list**: List all automations (triggers). Shows
|
|
182
|
-
- **define**: Create a new automation. IMPORTANT: Always confirm with the user before calling — show them a summary of what will be created. Required params: name, trigger_type, body. Optional: event, schedule, condition, mode, domain, delegated_policy_id.
|
|
183
|
-
- **update**: Update an existing automation's settings (enabled, condition, body,
|
|
249
|
+
- **list**: List all automations (triggers). Shows trigger, status, model, MCP allowlist, and delivery metadata. Optional params: scope, domain, enabled_only.
|
|
250
|
+
- **define**: Create a new automation. IMPORTANT: Always confirm with the user before calling — show them a summary of what will be created. Required params: name, trigger_type, body. Optional: scope, event, schedule, condition, mode, domain, delegated_policy_id, model, mcpTools.
|
|
251
|
+
- **update**: Update an existing automation's settings without changing its creator (enabled, schedule, condition, body, policy, model, MCP allowlist). Required param: name. Use the same scope it was created in.
|
|
184
252
|
- **delete**: Delete an automation. Always confirm with the user first. Required param: name.
|
|
185
253
|
- **fire-test**: Fire a test event to validate automations. Emits a test.event.fired event. Optional param: data (JSON string).`,
|
|
186
254
|
parameters: {
|
|
@@ -195,6 +263,11 @@ export function createAutomationToolEntries(getCurrentUser) {
|
|
|
195
263
|
type: "string",
|
|
196
264
|
description: "Slug name for the automation (lowercase, hyphens). Used by define, update, and delete.",
|
|
197
265
|
},
|
|
266
|
+
scope: {
|
|
267
|
+
type: "string",
|
|
268
|
+
description: "Personal or organization scope. Organization automations are visible to the active organization but always execute as their creator.",
|
|
269
|
+
enum: ["personal", "organization"],
|
|
270
|
+
},
|
|
198
271
|
trigger_type: {
|
|
199
272
|
type: "string",
|
|
200
273
|
description: '"event" or "schedule". Required for define.',
|
|
@@ -221,6 +294,15 @@ export function createAutomationToolEntries(getCurrentUser) {
|
|
|
221
294
|
type: "string",
|
|
222
295
|
description: "Domain tag for grouping (mail, calendar, clips, etc.). Used by define and list.",
|
|
223
296
|
},
|
|
297
|
+
model: {
|
|
298
|
+
type: "string",
|
|
299
|
+
description: "Optional model id for this automation. The default model is used when omitted.",
|
|
300
|
+
},
|
|
301
|
+
mcpTools: {
|
|
302
|
+
type: "array",
|
|
303
|
+
items: { type: "string" },
|
|
304
|
+
description: 'Optional explicit MCP capabilities. Use exact advertised tool names, for example ["mcp__meeting-notes__list_meetings"]. Credentials stay in the connector.',
|
|
305
|
+
},
|
|
224
306
|
delegated_policy_id: {
|
|
225
307
|
type: "string",
|
|
226
308
|
description: "Optional app-owned stored policy id. It is passed by the trusted trigger runtime, never as action input. Only use an id documented by the app.",
|
|
@@ -245,6 +327,13 @@ export function createAutomationToolEntries(getCurrentUser) {
|
|
|
245
327
|
required: ["action"],
|
|
246
328
|
},
|
|
247
329
|
},
|
|
330
|
+
planMode: {
|
|
331
|
+
effect: (args) => args.action === "list" || args.action === "list-events"
|
|
332
|
+
? "read"
|
|
333
|
+
: "write",
|
|
334
|
+
allowedValues: { action: ["list-events", "list"] },
|
|
335
|
+
description: "Plan mode allows listing automations and event types.",
|
|
336
|
+
},
|
|
248
337
|
run: async (args) => {
|
|
249
338
|
const action = args.action;
|
|
250
339
|
switch (action) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src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**\n * Framework-level agent actions for the automations system.\n *\n * These are registered as native tools (not template actions) so they're\n * available in every template. The agent uses them to create, list, and\n * manage automations from chat.\n *\n * All six operations are consolidated into a single `manage-automations` tool\n * with an `action` discriminator to keep the tool registry compact.\n */\n\nimport type { ActionEntry } from \"../agent/production-agent.js\";\nimport { listEvents } from \"../event-bus/index.js\";\nimport {\n resourceListAllOwners,\n resourcePut,\n resourceDelete,\n resourceGetByPath,\n SHARED_OWNER,\n} from \"../resources/store.js\";\nimport {\n parseTriggerFrontmatter,\n buildTriggerContent,\n refreshEventSubscriptions,\n} from \"./dispatcher.js\";\nimport type { TriggerFrontmatter } from \"./types.js\";\n\n/* ------------------------------------------------------------------ */\n/* Individual action handlers */\n/* ------------------------------------------------------------------ */\n\nasync function handleListEvents(): Promise<string> {\n const events = listEvents();\n if (events.length === 0) {\n return \"No events registered yet. Events are registered by integrations (mail, calendar, clips, etc.).\";\n }\n const lines = events.map((e) => {\n let schemaStr = \"\";\n try {\n const s = e.payloadSchema as any;\n if (s?._zod?.def?.shape) {\n const fields = Object.keys(s._zod.def.shape);\n schemaStr = ` Fields: ${fields.join(\", \")}`;\n }\n } catch {\n // ignore\n }\n const example = e.example\n ? `\\n Example: ${JSON.stringify(e.example)}`\n : \"\";\n return `- **${e.name}**: ${e.description}${schemaStr}${example}`;\n });\n return lines.join(\"\\n\");\n}\n\nasync function handleList(\n args: Record<string, string>,\n getCurrentUser: () => string,\n): Promise<string> {\n const owner = getCurrentUser();\n const resources = await resourceListAllOwners(\"jobs/\");\n const triggers = resources\n .filter((r) => r.owner === owner || r.owner === SHARED_OWNER)\n .filter((r) => r.path.endsWith(\".md\"))\n .map((r) => {\n const { meta, body } = parseTriggerFrontmatter(r.content);\n const name = r.path.replace(/^jobs\\//, \"\").replace(/\\.md$/, \"\");\n return { name, meta, body, owner: r.owner, id: r.id };\n })\n .filter((t) => {\n if (args.domain && t.meta.domain !== args.domain) return false;\n if (args.enabled_only === \"true\" && !t.meta.enabled) return false;\n return true;\n });\n\n if (triggers.length === 0) return \"No automations found.\";\n\n const lines = triggers.map((t) => {\n const type =\n t.meta.triggerType === \"event\"\n ? `on ${t.meta.event || \"?\"}`\n : `cron: ${t.meta.schedule}`;\n const status = t.meta.enabled ? \"enabled\" : \"disabled\";\n const lastStatus = t.meta.lastStatus ? ` (last: ${t.meta.lastStatus})` : \"\";\n const condition = t.meta.condition\n ? `\\n Condition: \"${t.meta.condition}\"`\n : \"\";\n const domain = t.meta.domain ? ` [${t.meta.domain}]` : \"\";\n return `- **${t.name}**${domain}: ${type} → ${t.meta.mode} (${status}${lastStatus})${condition}\\n Body: ${t.body.slice(0, 100)}${t.body.length > 100 ? \"...\" : \"\"}`;\n });\n return lines.join(\"\\n\\n\");\n}\n\nasync function handleDefine(\n args: Record<string, string>,\n getCurrentUser: () => string,\n): Promise<string> {\n const owner = getCurrentUser();\n const name = (args.name || \"\").replace(/[^a-z0-9-]/g, \"-\");\n if (!name) return \"Error: name is required (lowercase, hyphens).\";\n\n const path = `jobs/${name}.md`;\n\n // Check if it already exists\n const existing = await resourceGetByPath(owner, path);\n if (existing) {\n return `Error: An automation named \"${name}\" already exists. Use a different name or delete the existing one first.`;\n }\n\n if (args.mode === \"deterministic\") {\n return (\n \"Error: Deterministic mode was removed — it was never implemented and \" +\n \"automations that set it never fired. Create the automation without \" +\n \"mode (agentic), and describe the exact fixed steps in the automation body.\"\n );\n }\n\n const triggerType = args.trigger_type === \"schedule\" ? \"schedule\" : \"event\";\n const meta: TriggerFrontmatter = {\n schedule: args.schedule || \"\",\n enabled: true,\n triggerType,\n event: args.event || undefined,\n condition: args.condition || undefined,\n mode: \"agentic\",\n domain: args.domain || undefined,\n delegatedPolicyId: args.delegated_policy_id || undefined,\n createdBy: owner,\n runAs: \"creator\",\n };\n\n const content = buildTriggerContent(meta, args.body || \"\");\n await resourcePut(owner, path, content);\n\n // Refresh event subscriptions so the new trigger is active immediately\n await refreshEventSubscriptions();\n\n const summary =\n triggerType === \"event\"\n ? `on ${meta.event || \"?\"}${meta.condition ? ` when \"${meta.condition}\"` : \"\"}`\n : `on schedule \"${meta.schedule}\"`;\n\n return `Automation \"${name}\" created. Fires ${summary} in ${meta.mode} mode.`;\n}\n\nasync function handleUpdate(\n args: Record<string, string>,\n getCurrentUser: () => string,\n): Promise<string> {\n const owner = getCurrentUser();\n const name = args.name;\n const path = `jobs/${name}.md`;\n\n const resource = await resourceGetByPath(owner, path);\n if (!resource) {\n return `Automation \"${name}\" not found (or you don't own it).`;\n }\n\n const { meta, body } = parseTriggerFrontmatter(resource.content);\n\n if (args.enabled !== undefined) {\n meta.enabled = args.enabled !== \"false\";\n }\n if (args.condition !== undefined) {\n meta.condition = args.condition || undefined;\n }\n if (args.delegated_policy_id !== undefined) {\n meta.delegatedPolicyId = args.delegated_policy_id || undefined;\n }\n const newBody = args.body ?? body;\n\n await resourcePut(\n resource.owner,\n resource.path,\n buildTriggerContent(meta, newBody),\n );\n await refreshEventSubscriptions();\n\n return `Automation \"${name}\" updated.`;\n}\n\nasync function handleDelete(\n args: Record<string, string>,\n getCurrentUser: () => string,\n): Promise<string> {\n const owner = getCurrentUser();\n const path = `jobs/${args.name}.md`;\n\n const resource = await resourceGetByPath(owner, path);\n if (!resource) return `Automation \"${args.name}\" not found.`;\n\n await resourceDelete(resource.id);\n return `Automation \"${args.name}\" deleted.`;\n}\n\nasync function handleFireTest(\n args: Record<string, string>,\n getCurrentUser: () => string,\n): Promise<string> {\n // Dynamic import to avoid circular dependency at module load time\n const { emit } = await import(\"../event-bus/index.js\");\n\n let data: Record<string, unknown> = {};\n if (args.data) {\n try {\n data = JSON.parse(args.data);\n } catch {\n return \"Error: invalid JSON in data parameter.\";\n }\n }\n\n // Scope the test event to the current user so only their automations fire,\n // not automations owned by other users in the same process.\n const owner = getCurrentUser();\n emit(\"test.event.fired\", { data }, { owner });\n return `Test event fired with payload: ${JSON.stringify({ data })}. Any automations subscribed to \"test.event.fired\" will be evaluated.`;\n}\n\n/* ------------------------------------------------------------------ */\n/* Consolidated tool entry */\n/* ------------------------------------------------------------------ */\n\nconst VALID_ACTIONS = [\n \"list-events\",\n \"list\",\n \"define\",\n \"update\",\n \"delete\",\n \"fire-test\",\n] as const;\n\nexport function createAutomationToolEntries(\n getCurrentUser: () => string,\n): Record<string, ActionEntry> {\n return {\n \"manage-automations\": {\n tool: {\n description: `Manage automations (event-triggered and scheduled tasks). Use the \"action\" parameter to choose an operation:\n\n- **list-events**: List all registered event types that automations can subscribe to. Returns event names, descriptions, and payload schemas. Call this BEFORE defining an automation to discover available events.\n- **list**: List all automations (triggers). Shows name, event, condition, mode, status, and domain. Optional params: domain, enabled_only.\n- **define**: Create a new automation. IMPORTANT: Always confirm with the user before calling — show them a summary of what will be created. Required params: name, trigger_type, body. Optional: event, schedule, condition, mode, domain, delegated_policy_id.\n- **update**: Update an existing automation's settings (enabled, condition, body, delegated_policy_id, etc.). Required param: name.\n- **delete**: Delete an automation. Always confirm with the user first. Required param: name.\n- **fire-test**: Fire a test event to validate automations. Emits a test.event.fired event. Optional param: data (JSON string).`,\n parameters: {\n type: \"object\" as const,\n properties: {\n action: {\n type: \"string\",\n description:\n \"The operation to perform: list-events, list, define, update, delete, or fire-test.\",\n enum: [...VALID_ACTIONS],\n },\n name: {\n type: \"string\",\n description:\n \"Slug name for the automation (lowercase, hyphens). Used by define, update, and delete.\",\n },\n trigger_type: {\n type: \"string\",\n description: '\"event\" or \"schedule\". Required for define.',\n enum: [\"event\", \"schedule\"],\n },\n event: {\n type: \"string\",\n description:\n \"For event triggers: the event name to subscribe to. Call with action=list-events first to see available events.\",\n },\n schedule: {\n type: \"string\",\n description:\n 'For schedule triggers: cron expression. Example: \"0 9 * * 1-5\" (9am weekdays).',\n },\n condition: {\n type: \"string\",\n description:\n 'Natural-language condition. Example: \"attendee email ends with @builder.io\". Leave empty for unconditional. Used by define and update.',\n },\n mode: {\n type: \"string\",\n description:\n '\"agentic\" (full agent loop, can use tools) — the only supported mode. Used by define.',\n enum: [\"agentic\"],\n },\n domain: {\n type: \"string\",\n description:\n \"Domain tag for grouping (mail, calendar, clips, etc.). Used by define and list.\",\n },\n delegated_policy_id: {\n type: \"string\",\n description:\n \"Optional app-owned stored policy id. It is passed by the trusted trigger runtime, never as action input. Only use an id documented by the app.\",\n },\n body: {\n type: \"string\",\n description:\n \"The natural-language instructions for what to do when the automation fires. This becomes the agent's prompt in agentic mode. Used by define and update.\",\n },\n enabled: {\n type: \"string\",\n description:\n '\"true\" or \"false\" to enable/disable. Used by update.',\n },\n enabled_only: {\n type: \"string\",\n description:\n '\"true\" to show only enabled automations. Used by list.',\n },\n data: {\n type: \"string\",\n description:\n 'JSON data to include as the test event payload. Used by fire-test. Example: \\'{\"email\": \"test@example.com\"}\\'.',\n },\n },\n required: [\"action\"],\n },\n },\n run: async (args: Record<string, string>) => {\n const action = args.action;\n\n switch (action) {\n case \"list-events\":\n return handleListEvents();\n case \"list\":\n return handleList(args, getCurrentUser);\n case \"define\":\n return handleDefine(args, getCurrentUser);\n case \"update\":\n return handleUpdate(args, getCurrentUser);\n case \"delete\":\n return handleDelete(args, getCurrentUser);\n case \"fire-test\":\n return handleFireTest(args, getCurrentUser);\n default:\n return `Error: unknown action \"${action}\". Valid actions: ${VALID_ACTIONS.join(\", \")}.`;\n }\n },\n },\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/triggers/actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,yBAAyB,EACzB,gBAAgB,GAEjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EACL,4BAA4B,EAC5B,eAAe,GAChB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAE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AA6B,EAAE,EAAE;gBAC3C,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;gBAE3B,QAAQ,MAAM,EAAE,CAAC;oBACf,KAAK,aAAa;wBAChB,OAAO,gBAAgB,EAAE,CAAC;oBAC5B,KAAK,MAAM;wBACT,OAAO,UAAU,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;oBAC1C,KAAK,QAAQ;wBACX,OAAO,YAAY,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;oBAC5C,KAAK,QAAQ;wBACX,OAAO,YAAY,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;oBAC5C,KAAK,QAAQ;wBACX,OAAO,YAAY,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;oBAC5C,KAAK,WAAW;wBACd,OAAO,cAAc,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;oBAC9C;wBACE,OAAO,0BAA0B,MAAM,qBAAqB,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;gBAC5F,CAAC;YACH,CAAC;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Framework-level agent actions for the automations system.\n *\n * These are registered as native tools (not template actions) so they're\n * available in every template. The agent uses them to create, list, and\n * manage automations from chat.\n *\n * All six operations are consolidated into a single `manage-automations` tool\n * with an `action` discriminator to keep the tool registry compact.\n */\n\nimport type { ActionEntry } from \"../agent/production-agent.js\";\nimport {\n defineAutomation,\n deleteAutomation,\n listAutomationDefinitions,\n updateAutomation,\n type AutomationScope,\n} from \"../automations/service.js\";\nimport { listEvents } from \"../event-bus/index.js\";\nimport { describeCron } from \"../jobs/cron.js\";\nimport {\n getIntegrationRequestContext,\n getRequestOrgId,\n} from \"../server/request-context.js\";\nimport { refreshEventSubscriptions } from \"./dispatcher.js\";\n\n/* ------------------------------------------------------------------ */\n/* Individual action handlers */\n/* ------------------------------------------------------------------ */\n\nasync function handleListEvents(): Promise<string> {\n const events = listEvents();\n if (events.length === 0) {\n return \"No events registered yet. Events are registered by integrations (mail, calendar, clips, etc.).\";\n }\n const lines = events.map((e) => {\n let schemaStr = \"\";\n try {\n const s = e.payloadSchema as any;\n if (s?._zod?.def?.shape) {\n const fields = Object.keys(s._zod.def.shape);\n schemaStr = ` Fields: ${fields.join(\", \")}`;\n }\n } catch {\n // ignore\n }\n const example = e.example\n ? `\\n Example: ${JSON.stringify(e.example)}`\n : \"\";\n return `- **${e.name}**: ${e.description}${schemaStr}${example}`;\n });\n return lines.join(\"\\n\");\n}\n\nasync function handleList(\n args: Record<string, unknown>,\n getCurrentUser: () => string,\n): Promise<string> {\n const scope = automationScope(args.scope);\n const definitions = await listAutomationDefinitions(\n { userEmail: getCurrentUser(), orgId: getRequestOrgId() },\n scope,\n );\n const automations = definitions\n .filter(({ meta }) => !args.domain || meta.domain === args.domain)\n .filter(({ meta }) => args.enabled_only !== \"true\" || meta.enabled)\n .map(({ name, meta, body, canUpdate }) => ({\n name,\n scope,\n triggerType: meta.triggerType,\n event: meta.event ?? null,\n schedule: meta.schedule || null,\n scheduleDescription: meta.schedule ? describeCron(meta.schedule) : null,\n condition: meta.condition ?? null,\n mode: meta.mode,\n domain: meta.domain ?? null,\n enabled: meta.enabled,\n lastRun: meta.lastRun ?? null,\n lastStatus: meta.lastStatus ?? null,\n lastError: meta.lastError ?? null,\n nextRun: meta.nextRun ?? null,\n createdBy: meta.createdBy ?? null,\n runAs: meta.runAs ?? null,\n model: meta.model ?? null,\n mcpTools: meta.mcpTools ?? [],\n originScopeId: meta.originScopeId ?? null,\n deliveryPlatform: meta.deliveryPlatform ?? null,\n deliveryDestination: meta.deliveryDestination ?? null,\n deliveryThreadRef: meta.deliveryThreadRef ?? null,\n deliveryTenantId: meta.deliveryTenantId ?? null,\n body,\n canUpdate,\n }));\n return JSON.stringify(automations, null, 2);\n}\n\nfunction automationScope(value: unknown): AutomationScope {\n if (value === undefined || value === null || value === \"\") return \"personal\";\n if (value === \"personal\" || value === \"organization\") return value;\n throw new Error('scope must be \"personal\" or \"organization\".');\n}\n\nfunction automationTriggerType(value: unknown): \"schedule\" | \"event\" {\n if (value === \"schedule\" || value === \"event\") return value;\n throw new Error('trigger_type must be \"schedule\" or \"event\".');\n}\n\nasync function handleDefine(\n args: Record<string, unknown>,\n getCurrentUser: () => string,\n): Promise<string> {\n if (args.mode === \"deterministic\") {\n return (\n \"Error: Deterministic mode was removed — it was never implemented and \" +\n \"automations that set it never fired. Create the automation without \" +\n \"mode (agentic), and describe the exact fixed steps in the automation body.\"\n );\n }\n const integration = getIntegrationRequestContext();\n try {\n const definition = await defineAutomation(\n { userEmail: getCurrentUser(), orgId: getRequestOrgId() },\n {\n name: typeof args.name === \"string\" ? args.name : \"\",\n scope: automationScope(args.scope),\n triggerType: automationTriggerType(args.trigger_type),\n body: typeof args.body === \"string\" ? args.body : \"\",\n schedule: typeof args.schedule === \"string\" ? args.schedule : undefined,\n event: typeof args.event === \"string\" ? args.event : undefined,\n condition:\n typeof args.condition === \"string\" ? args.condition : undefined,\n domain: typeof args.domain === \"string\" ? args.domain : undefined,\n delegatedPolicyId:\n typeof args.delegated_policy_id === \"string\"\n ? args.delegated_policy_id\n : undefined,\n model: typeof args.model === \"string\" ? args.model : undefined,\n mcpTools: args.mcpTools,\n delivery: integration\n ? {\n originScopeId: integration.scopeId,\n platform: integration.incoming.platform,\n destination:\n typeof integration.incoming.platformContext.channelId ===\n \"string\"\n ? integration.incoming.platformContext.channelId\n : undefined,\n threadRef:\n typeof integration.incoming.threadRef === \"string\"\n ? integration.incoming.threadRef\n : undefined,\n tenantId: integration.incoming.tenantId,\n }\n : undefined,\n },\n );\n\n await refreshEventSubscriptions();\n return JSON.stringify({\n created: true,\n name: definition.name,\n scope: definition.scope,\n triggerType: definition.meta.triggerType,\n event: definition.meta.event ?? null,\n schedule: definition.meta.schedule || null,\n nextRun: definition.meta.nextRun ?? null,\n createdBy: definition.meta.createdBy,\n runAs: definition.meta.runAs,\n model: definition.meta.model ?? null,\n mcpTools: definition.meta.mcpTools ?? [],\n originScopeId: definition.meta.originScopeId ?? null,\n deliveryPlatform: definition.meta.deliveryPlatform ?? null,\n deliveryDestination: definition.meta.deliveryDestination ?? null,\n deliveryThreadRef: definition.meta.deliveryThreadRef ?? null,\n deliveryTenantId: definition.meta.deliveryTenantId ?? null,\n });\n } catch (error) {\n return `Error: ${(error as Error).message}`;\n }\n}\n\nasync function handleUpdate(\n args: Record<string, unknown>,\n getCurrentUser: () => string,\n): Promise<string> {\n try {\n const definition = await updateAutomation(\n { userEmail: getCurrentUser(), orgId: getRequestOrgId() },\n {\n name: typeof args.name === \"string\" ? args.name : \"\",\n scope: automationScope(args.scope),\n enabled:\n args.enabled === undefined\n ? undefined\n : args.enabled === true || args.enabled === \"true\",\n condition:\n args.condition === undefined\n ? undefined\n : typeof args.condition === \"string\"\n ? args.condition\n : null,\n delegatedPolicyId:\n args.delegated_policy_id === undefined\n ? undefined\n : typeof args.delegated_policy_id === \"string\"\n ? args.delegated_policy_id\n : null,\n body: typeof args.body === \"string\" ? args.body : undefined,\n schedule: typeof args.schedule === \"string\" ? args.schedule : undefined,\n model:\n args.model === undefined\n ? undefined\n : typeof args.model === \"string\"\n ? args.model\n : null,\n mcpTools: args.mcpTools,\n },\n );\n await refreshEventSubscriptions();\n return JSON.stringify({\n updated: true,\n name: definition.name,\n scope: definition.scope,\n triggerType: definition.meta.triggerType,\n enabled: definition.meta.enabled,\n schedule: definition.meta.schedule || null,\n nextRun: definition.meta.nextRun ?? null,\n createdBy: definition.meta.createdBy,\n runAs: definition.meta.runAs,\n model: definition.meta.model ?? null,\n mcpTools: definition.meta.mcpTools ?? [],\n originScopeId: definition.meta.originScopeId ?? null,\n deliveryPlatform: definition.meta.deliveryPlatform ?? null,\n deliveryDestination: definition.meta.deliveryDestination ?? null,\n deliveryThreadRef: definition.meta.deliveryThreadRef ?? null,\n deliveryTenantId: definition.meta.deliveryTenantId ?? null,\n });\n } catch (error) {\n return `Error: ${(error as Error).message}`;\n }\n}\n\nasync function handleDelete(\n args: Record<string, unknown>,\n getCurrentUser: () => string,\n): Promise<string> {\n const name = typeof args.name === \"string\" ? args.name : \"\";\n try {\n await deleteAutomation(\n { userEmail: getCurrentUser(), orgId: getRequestOrgId() },\n automationScope(args.scope),\n name,\n );\n await refreshEventSubscriptions();\n return JSON.stringify({ deleted: true, name });\n } catch (error) {\n return `Error: ${(error as Error).message}`;\n }\n}\n\nasync function handleFireTest(\n args: Record<string, unknown>,\n getCurrentUser: () => string,\n): Promise<string> {\n // Dynamic import to avoid circular dependency at module load time\n const { emit } = await import(\"../event-bus/index.js\");\n\n let data: Record<string, unknown> = {};\n if (typeof args.data === \"string\" && args.data) {\n try {\n data = JSON.parse(args.data);\n } catch {\n return \"Error: invalid JSON in data parameter.\";\n }\n }\n\n // Scope the test event to the current user so only their automations fire,\n // not automations owned by other users in the same process.\n const owner = getCurrentUser();\n emit(\"test.event.fired\", { data }, { owner });\n return `Test event fired with payload: ${JSON.stringify({ data })}. Any automations subscribed to \"test.event.fired\" will be evaluated.`;\n}\n\n/* ------------------------------------------------------------------ */\n/* Consolidated tool entry */\n/* ------------------------------------------------------------------ */\n\nconst VALID_ACTIONS = [\n \"list-events\",\n \"list\",\n \"define\",\n \"update\",\n \"delete\",\n \"fire-test\",\n] as const;\n\nexport function createAutomationToolEntries(\n getCurrentUser: () => string,\n): Record<string, ActionEntry> {\n return {\n \"manage-automations\": {\n tool: {\n description: `Manage automations (event-triggered and scheduled tasks). Use the \"action\" parameter to choose an operation:\n\n- **list-events**: List all registered event types that automations can subscribe to. Returns event names, descriptions, and payload schemas. Call this BEFORE defining an automation to discover available events.\n- **list**: List all automations (triggers). Shows trigger, status, model, MCP allowlist, and delivery metadata. Optional params: scope, domain, enabled_only.\n- **define**: Create a new automation. IMPORTANT: Always confirm with the user before calling — show them a summary of what will be created. Required params: name, trigger_type, body. Optional: scope, event, schedule, condition, mode, domain, delegated_policy_id, model, mcpTools.\n- **update**: Update an existing automation's settings without changing its creator (enabled, schedule, condition, body, policy, model, MCP allowlist). Required param: name. Use the same scope it was created in.\n- **delete**: Delete an automation. Always confirm with the user first. Required param: name.\n- **fire-test**: Fire a test event to validate automations. Emits a test.event.fired event. Optional param: data (JSON string).`,\n parameters: {\n type: \"object\" as const,\n properties: {\n action: {\n type: \"string\",\n description:\n \"The operation to perform: list-events, list, define, update, delete, or fire-test.\",\n enum: [...VALID_ACTIONS],\n },\n name: {\n type: \"string\",\n description:\n \"Slug name for the automation (lowercase, hyphens). Used by define, update, and delete.\",\n },\n scope: {\n type: \"string\",\n description:\n \"Personal or organization scope. Organization automations are visible to the active organization but always execute as their creator.\",\n enum: [\"personal\", \"organization\"],\n },\n trigger_type: {\n type: \"string\",\n description: '\"event\" or \"schedule\". Required for define.',\n enum: [\"event\", \"schedule\"],\n },\n event: {\n type: \"string\",\n description:\n \"For event triggers: the event name to subscribe to. Call with action=list-events first to see available events.\",\n },\n schedule: {\n type: \"string\",\n description:\n 'For schedule triggers: cron expression. Example: \"0 9 * * 1-5\" (9am weekdays).',\n },\n condition: {\n type: \"string\",\n description:\n 'Natural-language condition. Example: \"attendee email ends with @builder.io\". Leave empty for unconditional. Used by define and update.',\n },\n mode: {\n type: \"string\",\n description:\n '\"agentic\" (full agent loop, can use tools) — the only supported mode. Used by define.',\n enum: [\"agentic\"],\n },\n domain: {\n type: \"string\",\n description:\n \"Domain tag for grouping (mail, calendar, clips, etc.). Used by define and list.\",\n },\n model: {\n type: \"string\",\n description:\n \"Optional model id for this automation. The default model is used when omitted.\",\n },\n mcpTools: {\n type: \"array\",\n items: { type: \"string\" },\n description:\n 'Optional explicit MCP capabilities. Use exact advertised tool names, for example [\"mcp__meeting-notes__list_meetings\"]. Credentials stay in the connector.',\n },\n delegated_policy_id: {\n type: \"string\",\n description:\n \"Optional app-owned stored policy id. It is passed by the trusted trigger runtime, never as action input. Only use an id documented by the app.\",\n },\n body: {\n type: \"string\",\n description:\n \"The natural-language instructions for what to do when the automation fires. This becomes the agent's prompt in agentic mode. Used by define and update.\",\n },\n enabled: {\n type: \"string\",\n description:\n '\"true\" or \"false\" to enable/disable. Used by update.',\n },\n enabled_only: {\n type: \"string\",\n description:\n '\"true\" to show only enabled automations. Used by list.',\n },\n data: {\n type: \"string\",\n description:\n 'JSON data to include as the test event payload. Used by fire-test. Example: \\'{\"email\": \"test@example.com\"}\\'.',\n },\n },\n required: [\"action\"],\n },\n },\n planMode: {\n effect: (args) =>\n args.action === \"list\" || args.action === \"list-events\"\n ? \"read\"\n : \"write\",\n allowedValues: { action: [\"list-events\", \"list\"] },\n description: \"Plan mode allows listing automations and event types.\",\n },\n run: async (args: Record<string, unknown>) => {\n const action = args.action;\n\n switch (action) {\n case \"list-events\":\n return handleListEvents();\n case \"list\":\n return handleList(args, getCurrentUser);\n case \"define\":\n return handleDefine(args, getCurrentUser);\n case \"update\":\n return handleUpdate(args, getCurrentUser);\n case \"delete\":\n return handleDelete(args, getCurrentUser);\n case \"fire-test\":\n return handleFireTest(args, getCurrentUser);\n default:\n return `Error: unknown action \"${action}\". Valid actions: ${VALID_ACTIONS.join(\", \")}.`;\n }\n },\n },\n };\n}\n"]}
|
|
@@ -5,27 +5,21 @@
|
|
|
5
5
|
* subscribes to their events, and dispatches them (condition eval → agent
|
|
6
6
|
* loop) when matching events fire.
|
|
7
7
|
*/
|
|
8
|
-
import { type
|
|
8
|
+
import { type BackgroundAutomationContext, type BackgroundAutomationDeps } from "../jobs/background-automation-runner.js";
|
|
9
9
|
import type { TriggerFrontmatter } from "./types.js";
|
|
10
10
|
export declare function parseTriggerFrontmatter(content: string): {
|
|
11
11
|
meta: TriggerFrontmatter;
|
|
12
12
|
body: string;
|
|
13
13
|
};
|
|
14
14
|
export declare function buildTriggerContent(meta: TriggerFrontmatter, body: string): string;
|
|
15
|
-
export interface TriggerDispatcherDeps {
|
|
16
|
-
getActions: () => Record<string, ActionEntry>;
|
|
17
|
-
getSystemPrompt: (owner: string) => Promise<string>;
|
|
15
|
+
export interface TriggerDispatcherDeps extends BackgroundAutomationDeps {
|
|
18
16
|
/**
|
|
19
17
|
* Tool names to expose on the FIRST engine request for a trigger run. See
|
|
20
18
|
* `SchedulerDeps.getInitialToolNames` (`jobs/scheduler.ts`) — same
|
|
21
19
|
* semantics. Omit to keep the full `getActions()` set visible up front
|
|
22
20
|
* (current behavior).
|
|
23
21
|
*/
|
|
24
|
-
getInitialToolNames?: () => string[] | undefined;
|
|
25
|
-
apiKey?: string;
|
|
26
|
-
model?: string;
|
|
27
|
-
/** App/template id used for org-scoped per-app model defaults. */
|
|
28
|
-
appId?: string;
|
|
22
|
+
getInitialToolNames?: (automation?: BackgroundAutomationContext) => string[] | undefined;
|
|
29
23
|
}
|
|
30
24
|
/**
|
|
31
25
|
* Initialize the trigger dispatcher. Call once at server startup.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatcher.d.ts","sourceRoot":"","sources":["../../src/triggers/dispatcher.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"dispatcher.d.ts","sourceRoot":"","sources":["../../src/triggers/dispatcher.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAUH,OAAO,EAGL,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAC9B,MAAM,yCAAyC,CAAC;AAWjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG;IACxD,IAAI,EAAE,kBAAkB,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;CACd,CAUA;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,kBAAkB,EACxB,IAAI,EAAE,MAAM,GACX,MAAM,CAER;AAID,MAAM,WAAW,qBAAsB,SAAQ,wBAAwB;IACrE;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,CACpB,UAAU,CAAC,EAAE,2BAA2B,KACrC,MAAM,EAAE,GAAG,SAAS,CAAC;CAC3B;AAgBD;;;GAGG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,qBAAqB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAGf;AAED;;;GAGG;AACH,wBAAsB,yBAAyB,IAAI,OAAO,CAAC,IAAI,CAAC,CAgC/D"}
|