@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":"scheduler.js","sourceRoot":"","sources":["../../src/jobs/scheduler.ts"],"names":[],"m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CAAC,CAAC;YAE3C,OAAO,CAAC,KAAK,CACX,yBAAyB,OAAO,WAAW,EAC3C,GAAG,EAAE,OAAO,CACb,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC,CAAC,4BAA4B;AACjC,CAAC;AAED,KAAK,UAAU,cAAc,CAC3B,QAAkB,EAClB,IAAoB,EACpB,IAAY;IAEZ,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC5C,MAAM,WAAW,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC5D,CAAC","sourcesContent":["import { collectFinalResponseTextFromAgentEvents } from \"../a2a/response-text.js\";\nimport {\n getStoredModelForEngine,\n normalizeModelForEngine,\n resolveEngine,\n} from \"../agent/engine/index.js\";\nimport type { AgentEngine } from \"../agent/engine/types.js\";\nimport {\n runAgentLoop,\n actionsToEngineTools,\n filterInitialEngineTools,\n getOwnerActiveApiKey,\n type ActionEntry,\n} from \"../agent/production-agent.js\";\nimport { runAgentLoopDirectWithSoftTimeout } from \"../agent/run-loop-with-resume.js\";\nimport { startRun, resolveRunSoftTimeoutMs } from \"../agent/run-manager.js\";\nimport { attachToolSearch } from \"../agent/tool-search.js\";\nimport { createThread } from \"../chat-threads/store.js\";\nimport {\n organizationIdFromResourceOwner,\n resourceListAllOwners,\n resourcePut,\n type Resource,\n} from \"../resources/store.js\";\nimport { runWithRequestContext } from \"../server/request-context.js\";\nimport { nextOccurrence, isValidCron, describeCron } from \"./cron.js\";\n\n// ─── Frontmatter parsing ────────────────────────────────────────────────────\n\nexport interface JobFrontmatter {\n schedule: string;\n enabled: boolean;\n createdBy?: string;\n orgId?: string;\n runAs?: \"creator\" | \"shared\";\n lastRun?: string;\n lastStatus?: \"success\" | \"error\" | \"running\" | \"skipped\";\n lastError?: string;\n nextRun?: string;\n originScopeId?: string;\n deliveryPlatform?: string;\n deliveryDestination?: string;\n deliveryThreadRef?: string;\n deliveryTenantId?: string;\n model?: string;\n /** Explicit MCP tool capabilities available to this background run. */\n mcpTools?: string[];\n}\n\nconst MAX_JOB_MCP_TOOLS = 64;\nconst JOB_MCP_TOOL_NAME_RE = /^mcp__[^\\s]+__[^\\s]+$/;\n\n/**\n * Normalize the non-secret MCP capability references persisted with a job.\n * Tool names are opaque framework identifiers; URLs and credentials never\n * belong in job frontmatter.\n */\nexport function normalizeJobMcpTools(value: unknown): string[] | undefined {\n if (value === undefined || value === null) return undefined;\n const parsed =\n typeof value === \"string\"\n ? (() => {\n try {\n return JSON.parse(value);\n } catch {\n throw new Error(\"mcpTools must be a JSON array of tool names.\");\n }\n })()\n : value;\n if (!Array.isArray(parsed)) {\n throw new Error(\"mcpTools must be an array of MCP tool names.\");\n }\n if (parsed.length > MAX_JOB_MCP_TOOLS) {\n throw new Error(\n `mcpTools may contain at most ${MAX_JOB_MCP_TOOLS} tool names.`,\n );\n }\n const normalized = [...new Set(parsed)];\n if (\n normalized.some(\n (toolName) =>\n typeof toolName !== \"string\" || !JOB_MCP_TOOL_NAME_RE.test(toolName),\n )\n ) {\n throw new Error(\n \"mcpTools must contain only framework MCP tool names such as mcp__server__tool.\",\n );\n }\n return normalized;\n}\n\nconst FRONTMATTER_RE = /^---\\n([\\s\\S]*?)\\n---\\n?([\\s\\S]*)$/;\n\nexport function parseJobFrontmatter(content: string): {\n meta: JobFrontmatter;\n body: string;\n} {\n const match = content.match(FRONTMATTER_RE);\n if (!match) {\n return {\n meta: { schedule: \"\", enabled: false },\n body: content,\n };\n }\n\n const yamlBlock = match[1];\n const body = match[2].trim();\n\n const meta: JobFrontmatter = { schedule: \"\", enabled: true };\n\n for (const line of yamlBlock.split(\"\\n\")) {\n const colonIdx = line.indexOf(\":\");\n if (colonIdx === -1) continue;\n const key = line.slice(0, colonIdx).trim();\n let value = line.slice(colonIdx + 1).trim();\n\n // Strip quotes\n if (\n (value.startsWith('\"') && value.endsWith('\"')) ||\n (value.startsWith(\"'\") && value.endsWith(\"'\"))\n ) {\n value = value.slice(1, -1);\n }\n\n switch (key) {\n case \"schedule\":\n meta.schedule = value;\n break;\n case \"enabled\":\n meta.enabled = value !== \"false\";\n break;\n case \"createdBy\":\n meta.createdBy = value;\n break;\n case \"orgId\":\n meta.orgId = value;\n break;\n case \"runAs\":\n meta.runAs =\n value === \"shared\" || value === \"creator\" ? value : undefined;\n break;\n case \"lastRun\":\n meta.lastRun = value;\n break;\n case \"lastStatus\":\n meta.lastStatus = value as JobFrontmatter[\"lastStatus\"];\n break;\n case \"lastError\":\n // Reverse the escaping applied in buildJobContent.\n meta.lastError = value\n .replace(/\\\\n/g, \"\\n\")\n .replace(/\\\\r/g, \"\\r\")\n .replace(/\\\\\"/g, '\"')\n .replace(/\\\\\\\\/g, \"\\\\\");\n break;\n case \"nextRun\":\n meta.nextRun = value;\n break;\n case \"originScopeId\":\n meta.originScopeId = value;\n break;\n case \"deliveryPlatform\":\n meta.deliveryPlatform = value;\n break;\n case \"deliveryDestination\":\n meta.deliveryDestination = value;\n break;\n case \"deliveryThreadRef\":\n meta.deliveryThreadRef = value;\n break;\n case \"deliveryTenantId\":\n meta.deliveryTenantId = value;\n break;\n case \"model\":\n meta.model = value;\n break;\n case \"mcpTools\":\n try {\n meta.mcpTools = normalizeJobMcpTools(value);\n } catch {\n // Ignore malformed optional capability metadata and keep the job\n // readable; newly-created jobs are validated before persistence.\n }\n break;\n }\n }\n\n return { meta, body };\n}\n\nexport function buildJobContent(meta: JobFrontmatter, body: string): string {\n const lines = [`---`];\n lines.push(`schedule: \"${meta.schedule}\"`);\n lines.push(`enabled: ${meta.enabled}`);\n if (meta.createdBy) lines.push(`createdBy: ${meta.createdBy}`);\n if (meta.orgId) lines.push(`orgId: ${meta.orgId}`);\n if (meta.runAs) lines.push(`runAs: ${meta.runAs}`);\n if (meta.lastRun) lines.push(`lastRun: ${meta.lastRun}`);\n if (meta.lastStatus) lines.push(`lastStatus: ${meta.lastStatus}`);\n if (meta.lastError) {\n // Escape backslash, quote, then CR/LF. The frontmatter parser splits on\n // \"\\n\", so an un-escaped newline (common in stack traces) would otherwise\n // split the value across lines and corrupt/truncate the stored error.\n const escaped = meta.lastError\n .replace(/\\\\/g, \"\\\\\\\\\")\n .replace(/\"/g, '\\\\\"')\n .replace(/\\r/g, \"\\\\r\")\n .replace(/\\n/g, \"\\\\n\");\n lines.push(`lastError: \"${escaped}\"`);\n }\n if (meta.nextRun) lines.push(`nextRun: ${meta.nextRun}`);\n if (meta.originScopeId) lines.push(`originScopeId: ${meta.originScopeId}`);\n if (meta.deliveryPlatform)\n lines.push(`deliveryPlatform: ${meta.deliveryPlatform}`);\n if (meta.deliveryDestination)\n lines.push(`deliveryDestination: ${meta.deliveryDestination}`);\n if (meta.deliveryThreadRef)\n lines.push(`deliveryThreadRef: ${meta.deliveryThreadRef}`);\n if (meta.deliveryTenantId)\n lines.push(`deliveryTenantId: ${meta.deliveryTenantId}`);\n if (meta.model) lines.push(`model: ${meta.model}`);\n if (meta.mcpTools?.length)\n lines.push(`mcpTools: ${JSON.stringify(meta.mcpTools)}`);\n lines.push(`---`);\n lines.push(\"\");\n lines.push(body);\n return lines.join(\"\\n\");\n}\n\n// ─── Job execution ──────────────────────────────────────────────────────────\n\nexport interface RecurringJobContext {\n name: string;\n meta: JobFrontmatter;\n body: string;\n resource: Resource;\n}\n\nexport interface SchedulerDeps {\n getActions: (job?: RecurringJobContext) => Record<string, ActionEntry>;\n getSystemPrompt: (owner: string) => Promise<string>;\n /**\n * Tool names to expose on the FIRST engine request for a job run. When\n * provided, every other action returned by `getActions()` is deferred\n * behind an attached `tool-search` entry instead of being serialized on\n * every scheduled tick — `runAgentLoop`'s mid-run tool expansion\n * (`expandActiveTools`) still lets the model discover and call them after\n * a search. Omit to keep the full `getActions()` set visible up front\n * (current behavior). The caller (not this module) knows which of the\n * merged actions are the app's own vs. framework additions, so this must\n * be supplied explicitly rather than inferred here.\n */\n getInitialToolNames?: (job?: RecurringJobContext) => string[] | undefined;\n /** Optional engine override. Defaults to the resolved request engine. */\n engine?: AgentEngine;\n apiKey?: string;\n model?: string;\n /** App/template id used for org-scoped per-app model defaults. */\n appId?: string;\n}\n\nlet _isRunning = false;\n\n// Skip the DB query on every tick if we recently confirmed no jobs exist.\n// `_hasJobsCache` is invalidated whenever a `jobs/*` resource is written or\n// deleted (subscribed below), and refreshed at most every 5 minutes.\nlet _hasJobsCache: boolean | undefined;\nlet _lastJobsCheck = 0;\nconst JOBS_CHECK_INTERVAL_MS = 5 * 60_000;\nlet _emitterSubscribed = false;\n\nfunction subscribeToJobsResourceEvents(): void {\n if (_emitterSubscribed) return;\n _emitterSubscribed = true;\n // Lazy import to avoid circular deps at module load\n import(\"../resources/emitter.js\")\n .then(({ getResourcesEmitter }) => {\n getResourcesEmitter().on(\"resources\", (event: any) => {\n if (typeof event?.path === \"string\" && event.path.startsWith(\"jobs/\")) {\n _hasJobsCache = undefined;\n }\n });\n })\n .catch((err) => {\n console.warn(\n \"[jobs] resource-event subscription failed:\",\n err instanceof Error ? err.message : err,\n );\n });\n}\n\n/**\n * Process all due recurring jobs. Called every 60 seconds.\n * Sequential execution with 5-minute timeout per job.\n */\nexport async function processRecurringJobs(deps: SchedulerDeps): Promise<void> {\n // Prevent concurrent runs\n if (_isRunning) return;\n\n subscribeToJobsResourceEvents();\n\n // Skip if we recently confirmed there are no job resources to run.\n const nowMs = Date.now();\n if (\n _hasJobsCache === false &&\n nowMs - _lastJobsCheck < JOBS_CHECK_INTERVAL_MS\n ) {\n return;\n }\n\n _isRunning = true;\n\n try {\n const jobResources = await resourceListAllOwners(\"jobs/\");\n _hasJobsCache = jobResources.some(\n (r) => r.path.endsWith(\".md\") && !r.path.endsWith(\".keep\"),\n );\n _lastJobsCheck = nowMs;\n if (!_hasJobsCache) return;\n const now = new Date();\n\n for (const resource of jobResources) {\n // Skip non-markdown or .keep files\n if (!resource.path.endsWith(\".md\")) continue;\n if (resource.path.endsWith(\".keep\")) continue;\n\n const { meta, body } = parseJobFrontmatter(resource.content);\n\n // Skip disabled or missing schedule\n if (!meta.enabled || !meta.schedule) continue;\n if (!isValidCron(meta.schedule)) continue;\n\n // Skip if currently running, unless it has been stuck for more than 10 minutes\n // (server crash mid-job leaves lastStatus=running forever without this guard)\n if (meta.lastStatus === \"running\") {\n const stuckCutoff = 10 * 60 * 1000;\n if (\n meta.lastRun &&\n now.getTime() - new Date(meta.lastRun).getTime() < stuckCutoff\n ) {\n continue;\n }\n // Stuck — reset so the next check can re-run it\n meta.lastStatus = \"error\";\n meta.lastError = \"Job timed out or server crashed mid-run\";\n const next = nextOccurrence(meta.schedule, now);\n meta.nextRun = next.toISOString();\n await updateResource(resource, meta, body);\n continue;\n }\n\n // Check if due\n if (meta.nextRun) {\n const nextRunDate = new Date(meta.nextRun);\n if (nextRunDate > now) continue;\n } else {\n // No nextRun computed yet — seed it from `now` so the job waits for its\n // real next occurrence. Computing from new Date(0) (the epoch) always\n // returns a 1970 date, which is < now, so the job would fire\n // immediately on first sight regardless of its schedule.\n const next = nextOccurrence(meta.schedule, now);\n meta.nextRun = next.toISOString();\n await updateResource(resource, meta, body);\n continue;\n }\n\n // Skip if body is empty\n if (!body.trim()) continue;\n\n // Execute the job\n await executeJob(resource, meta, body, deps, now);\n }\n } catch (err) {\n // Transient WS / connection drops (Neon serverless): silently retry next\n // tick instead of spamming stderr — `retryOnConnectionError` already did\n // its retry budget at the driver level.\n const { isConnectionError } = await import(\"../db/client.js\");\n if (isConnectionError(err)) {\n _hasJobsCache = undefined; // force re-check on next successful tick\n _lastJobsCheck = 0;\n return;\n }\n // Unwrap ErrorEvent (Neon WS driver emits these on network failure) so logs show the real cause\n const detail =\n err instanceof Error\n ? err\n : ((err as any)?.error ?? (err as any)?.message ?? err);\n console.error(\"[recurring-jobs] Error processing jobs:\", detail);\n } finally {\n _isRunning = false;\n }\n}\n\n/**\n * Validate that the run-as user still exists and (if scoped to an org) is\n * still a member of that org. Skips the check for the dev-mode bypass\n * identity and the shared-owner sentinel, neither of which map to a real\n * user row.\n *\n * SECURITY: without this check the scheduler keeps running jobs as\n * `meta.createdBy` indefinitely — even after the user has been deleted,\n * removed from the org, or had their account disabled. The cron entry\n * itself is left intact so an admin can purge it manually after the\n * underlying user-state issue is investigated. See audit 12 #10.\n */\nasync function isJobRunAsStillValid(\n jobUserEmail: string,\n jobOrgId: string | undefined,\n): Promise<{ ok: boolean; reason?: string }> {\n // Shared-owner sentinel isn't a real user (used by jobs run as the\n // workspace identity).\n if (\n jobUserEmail === \"__shared__\" ||\n organizationIdFromResourceOwner(jobUserEmail)\n ) {\n return { ok: true };\n }\n try {\n const { getDbExec } = await import(\"../db/client.js\");\n const db = getDbExec();\n // Better Auth's user table is named \"user\" (singular). The reserved\n // word is quoted to avoid ambiguity in Postgres.\n const userResult = await db.execute({\n sql: `SELECT 1 FROM \"user\" WHERE email = ? LIMIT 1`,\n args: [jobUserEmail],\n });\n if (!userResult.rows || userResult.rows.length === 0) {\n return { ok: false, reason: `user \"${jobUserEmail}\" no longer exists` };\n }\n if (jobOrgId) {\n const { queryOrgMembers } = await import(\"../org/context.js\");\n // Shared reader so this and getOrgContext cannot disagree about what a\n // failed org_members read means: null = tables absent on a brand-new\n // install (nothing to validate against), throw = unreadable.\n const memberRows = await queryOrgMembers({\n sql: `SELECT 1 FROM org_members WHERE org_id = ? AND LOWER(email) = LOWER(?) LIMIT 1`,\n args: [jobOrgId, jobUserEmail],\n });\n if (memberRows && memberRows.length === 0) {\n return {\n ok: false,\n reason: `user \"${jobUserEmail}\" is no longer a member of org \"${jobOrgId}\"`,\n };\n }\n }\n return { ok: true };\n } catch (err: any) {\n // Unreadable user/membership state: let the job run rather than blocking\n // on a failure mode we cannot interpret (e.g. transient connection issue,\n // or auth tables missing on a brand-new install). We log so it's visible.\n console.warn(\n `[recurring-jobs] User/membership validation failed for \"${jobUserEmail}\":`,\n err?.message,\n );\n return { ok: true };\n }\n}\n\n/**\n * A soft-timeout / no-progress checkpoint is a continuation boundary, not a\n * finish — but `terminalStatusForEvent` maps `auto_continue` to status\n * \"completed\". A scheduled job has no client to drive that continuation, so\n * without this check a truncated half-answer is recorded as a success and\n * shipped to the job's delivery target. Only the LAST terminal event decides:\n * an earlier boundary the in-invocation resume already recovered from is\n * followed by `done`, and that job really did finish.\n */\nexport function jobRunCutOffReason(run: {\n events?: readonly { event: { type: string; reason?: string } }[];\n}): string | null {\n const events = run.events ?? [];\n for (let i = events.length - 1; i >= 0; i--) {\n const event = events[i].event;\n if (event.type === \"auto_continue\") {\n return event.reason === \"run_timeout\" || event.reason === \"no_progress\"\n ? event.reason\n : null;\n }\n if (event.type === \"done\" || event.type === \"error\") return null;\n }\n return null;\n}\n\nasync function executeJob(\n resource: Resource,\n meta: JobFrontmatter,\n body: string,\n deps: SchedulerDeps,\n now: Date,\n): Promise<void> {\n const jobName = resource.path.replace(/^jobs\\//, \"\").replace(/\\.md$/, \"\");\n\n // Set owner context so all scoped operations (app-state, resources, etc.)\n // operate on the correct user's data\n const effectiveRunAs = meta.runAs ?? \"creator\";\n const jobUserEmail =\n effectiveRunAs === \"creator\"\n ? meta.createdBy || resource.owner\n : resource.owner;\n const jobOrgId = meta.orgId ?? undefined;\n\n // SECURITY (audit 12 #10): re-validate the run-as user/membership on\n // every tick. Sharing revocation, user deletion, and org-member removal\n // must take effect for already-scheduled jobs. Skip the tick on\n // failure; leave the cron entry alone so an admin can purge after\n // investigation.\n const validity = await isJobRunAsStillValid(jobUserEmail, jobOrgId);\n if (!validity.ok) {\n console.warn(\n `[recurring-jobs] Skipping job \"${jobName}\": ${validity.reason}. ` +\n `User/membership no longer valid — leaving cron entry for admin review.`,\n );\n // Mark as skipped without resetting nextRun so an admin can find it.\n meta.lastRun = now.toISOString();\n meta.lastStatus = \"skipped\";\n meta.lastError = validity.reason;\n await updateResource(resource, meta, body);\n return;\n }\n\n // Mark as running\n meta.lastRun = now.toISOString();\n meta.lastStatus = \"running\";\n meta.lastError = undefined;\n await updateResource(resource, meta, body);\n\n await runWithRequestContext(\n {\n userEmail: jobUserEmail,\n orgId: jobOrgId,\n ...(meta.originScopeId &&\n meta.deliveryPlatform &&\n meta.deliveryDestination\n ? {\n isIntegrationCaller: true,\n integration: {\n taskId: `job:${jobName}:${now.getTime()}`,\n scopeId: meta.originScopeId,\n principalType: \"service\" as const,\n incoming: {\n platform: meta.deliveryPlatform,\n externalThreadId: `${meta.deliveryTenantId || \"unknown\"}:${meta.deliveryDestination}:${meta.deliveryThreadRef || \"root\"}`,\n text: \"\",\n tenantId: meta.deliveryTenantId,\n integrationScopeId: meta.originScopeId,\n platformContext: {\n channelId: meta.deliveryDestination,\n threadTs: meta.deliveryThreadRef,\n teamId: meta.deliveryTenantId,\n },\n threadRef: meta.deliveryThreadRef,\n timestamp: now.getTime(),\n },\n },\n }\n : {}),\n },\n async () => {\n try {\n const jobContext: RecurringJobContext = {\n name: jobName,\n meta,\n body,\n resource,\n };\n const baseActions = deps.getActions(jobContext);\n const systemPrompt = await deps.getSystemPrompt(jobUserEmail);\n const initialToolNames = deps.getInitialToolNames?.(jobContext);\n // Only attach tool-search (and pay its schema cost) when the caller\n // actually supplied an initial subset to filter down to — otherwise\n // this is byte-for-byte the prior unfiltered behavior.\n const actions = initialToolNames\n ? attachToolSearch({ ...baseActions })\n : baseActions;\n const availableTools = actionsToEngineTools(actions);\n const tools = filterInitialEngineTools(\n availableTools,\n initialToolNames,\n );\n\n // Prefer the job runner's saved Anthropic key so recurring jobs\n // don't silently bill the shared platform key once a user has\n // brought their own. Falls back to the platform key when absent.\n const userApiKey = await getOwnerActiveApiKey(jobUserEmail);\n const engine =\n deps.engine ??\n (await resolveEngine({\n apiKey: userApiKey ?? deps.apiKey,\n appId: deps.appId,\n }));\n const modelCandidate =\n meta.model ??\n deps.model ??\n (await getStoredModelForEngine(engine, { appId: deps.appId })) ??\n engine.defaultModel;\n const model = normalizeModelForEngine(engine, modelCandidate);\n\n // Create a chat thread for this run\n const threadTitle = `Job: ${jobName} — ${now.toLocaleDateString()}`;\n const thread = await createThread(jobUserEmail, { title: threadTitle });\n\n const jobText = `[Recurring Job: ${jobName}]\\nSchedule: ${describeCron(meta.schedule)}\\n\\nExecute the following job instructions:\\n\\n${body}`;\n const messages = [\n {\n role: \"user\" as const,\n content: [{ type: \"text\" as const, text: jobText }],\n },\n ];\n\n // Route through startRun (from run-manager) instead of calling\n // runAgentLoop directly. This adds:\n // 1. A heartbeat row in agent_runs so a serverless kill is detected\n // by reapAllStaleRuns on the next startup and the row is flipped\n // to 'errored' — no more stranded lastStatus:\"running\" in the job\n // frontmatter after the next tick resets it via the stuck-guard.\n // 2. The soft-timeout infrastructure so the job checkpoints cleanly\n // before serverless hard-kill rather than dying mid-flight.\n // 3. SQL abort checks so a displaced/reaped run self-aborts instead\n // of completing invisibly and potentially overwriting newer state.\n const runId = `job-${jobName.replace(/[^a-zA-Z0-9._-]/g, \"-\")}-${Date.now()}-${Math.random().toString(36).slice(2, 6)}`;\n\n // Use the same soft-timeout logic as interactive runs. On hosted\n // runtimes this clamps to 40s (under the gateway wall); locally it\n // defaults to 0 (no framework timeout). The 5-minute hard-abort\n // below is still provided as a backstop via the startRun signal.\n const softTimeoutMs = resolveRunSoftTimeoutMs(undefined, {\n useHostedDefault: true,\n });\n\n let jobError: Error | null = null;\n // Hard-abort backstop: 5 minutes. On hosted runtimes the soft-timeout\n // will fire first; locally this is the only guard. Cleared when the\n // run completes so finished jobs don't leave a live timer keeping the\n // process/event loop alive for the remainder of the window.\n let hardAbortTimer: ReturnType<typeof setTimeout> | null = null;\n const jobUsageRef: {\n current: Awaited<ReturnType<typeof runAgentLoop>> | null;\n } = { current: null };\n let responseText = \"\";\n await new Promise<void>((resolve, reject) => {\n const activeRun = startRun(\n runId,\n thread.id,\n async (send, signal) => {\n // Wrapper, not raw `runAgentLoop`: a job has no browser to\n // re-POST a continuation, so an interrupted transport (gateway\n // 45s cut, socket hang up, upstream 5xx) has to be resumed\n // inside this same invocation or the job is simply lost.\n jobUsageRef.current = await runAgentLoopDirectWithSoftTimeout(\n {\n engine,\n model,\n systemPrompt,\n tools,\n availableTools,\n messages,\n actions,\n send,\n signal,\n threadId: thread.id,\n },\n softTimeoutMs,\n );\n },\n // onComplete: run finished (completed or aborted)\n async (run) => {\n if (hardAbortTimer) {\n clearTimeout(hardAbortTimer);\n hardAbortTimer = null;\n }\n const cutOffReason = jobRunCutOffReason(run);\n if (cutOffReason) {\n reject(\n new Error(\n `Job run was cut off before finishing (${cutOffReason})`,\n ),\n );\n } else if (run.status === \"completed\") {\n responseText = collectFinalResponseTextFromAgentEvents(\n (run.events ?? []).map((event) => event.event),\n );\n resolve();\n } else {\n reject(new Error(`Job run ended with status: ${run.status}`));\n }\n },\n {\n softTimeoutMs,\n // Without this the row is dispatch_mode NULL and the stale\n // reaper applies RUN_STALE_MS (15s) — a window sized for a\n // foreground run a browser is actively streaming. Nothing\n // streams a job, so it gets reaped mid-flight.\n dispatchMode: \"background\",\n // turnId defaults to runId — fine for single-turn jobs\n // No userId here: `jobUserEmail` is PII (email), which the\n // terminal event must not carry.\n model,\n engineName: engine.name,\n },\n );\n\n // Abort the run-manager's own controller after 5 minutes if the\n // run hasn't finished naturally.\n hardAbortTimer = setTimeout(\n () => {\n hardAbortTimer = null;\n if (activeRun.status === \"running\") {\n activeRun.abort.abort(\"job_hard_timeout\");\n reject(new Error(\"Job timed out after 5 minutes\"));\n }\n },\n 5 * 60 * 1000,\n );\n }).catch((err: any) => {\n jobError = err;\n });\n if (hardAbortTimer) {\n clearTimeout(hardAbortTimer);\n hardAbortTimer = null;\n }\n\n if (jobError) throw jobError;\n\n if (\n responseText.trim() &&\n meta.deliveryPlatform &&\n meta.deliveryDestination\n ) {\n const { getDefaultAdapter } =\n await import(\"../integrations/adapters/index.js\");\n const adapter = getDefaultAdapter(meta.deliveryPlatform);\n if (!adapter?.sendMessageToTarget) {\n throw new Error(\n `Recurring job delivery is not supported for ${meta.deliveryPlatform}`,\n );\n }\n await adapter.sendMessageToTarget(\n adapter.formatAgentResponse(responseText),\n {\n destination: meta.deliveryDestination,\n threadRef: meta.deliveryThreadRef ?? null,\n tenantId: meta.deliveryTenantId,\n },\n );\n }\n\n const jobUsage = jobUsageRef.current;\n if (\n jobUsage &&\n (jobUsage.inputTokens > 0 ||\n jobUsage.outputTokens > 0 ||\n jobUsage.cacheReadTokens > 0 ||\n jobUsage.cacheWriteTokens > 0)\n ) {\n try {\n const { recordUsage } = await import(\"../usage/store.js\");\n await recordUsage({\n ownerEmail: jobUserEmail,\n inputTokens: jobUsage.inputTokens,\n outputTokens: jobUsage.outputTokens,\n cacheReadTokens: jobUsage.cacheReadTokens,\n cacheWriteTokens: jobUsage.cacheWriteTokens,\n model: jobUsage.model,\n label: `recurring-job:${jobName}`,\n app: deps.appId,\n refId: runId,\n });\n } catch {\n // Usage attribution must not break the scheduled task.\n }\n }\n\n // Success — update status. Compute the next run from completion time,\n // not the job's start time `now`: a long run could otherwise schedule a\n // nextRun that's already in the past and re-fire immediately next tick.\n const next = nextOccurrence(meta.schedule, new Date());\n meta.lastStatus = \"success\";\n meta.nextRun = next.toISOString();\n await updateResource(resource, meta, body);\n\n console.log(\n `[recurring-jobs] Job \"${jobName}\" completed. Next run: ${meta.nextRun}`,\n );\n } catch (err: any) {\n // Error — update status. Use completion time (see success path).\n const next = nextOccurrence(meta.schedule, new Date());\n meta.lastStatus = \"error\";\n meta.lastError = err?.message?.slice(0, 200) || \"Unknown error\";\n meta.nextRun = next.toISOString();\n await updateResource(resource, meta, body);\n\n console.error(\n `[recurring-jobs] Job \"${jobName}\" failed:`,\n err?.message,\n );\n }\n },\n ); // end runWithRequestContext\n}\n\nasync function updateResource(\n resource: Resource,\n meta: JobFrontmatter,\n body: string,\n): Promise<void> {\n const content = buildJobContent(meta, body);\n await resourcePut(resource.owner, resource.path, content);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"scheduler.js","sourceRoot":"","sources":["../../src/jobs/scheduler.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,WAAW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AAO,CAAC,GAAG,CACT,yBAAyB,OAAO,0BAA0B,IAAI,CAAC,OAAO,EAAE,CACzE,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC;QAC1B,IAAI,CAAC,SAAS;YACZ,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC;QACrE,IAAI,CAAC,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;QACvE,MAAM,cAAc,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAC3C,OAAO,CAAC,KAAK,CAAC,yBAAyB,OAAO,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IAC7E,CAAC;AACH,CAAC;AAED,KAAK,UAAU,cAAc,CAC3B,QAAkB,EAClB,IAAoB,EACpB,IAAY;IAEZ,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC5C,MAAM,WAAW,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC5D,CAAC","sourcesContent":["import {\n resourceListAllOwners,\n resourcePut,\n type Resource,\n} from \"../resources/store.js\";\nimport {\n backgroundRunCutOffReason,\n isBackgroundAutomationRunActive,\n resolveBackgroundAutomationIdentity,\n runBackgroundAutomation,\n type BackgroundAutomationContext,\n type BackgroundAutomationDeps,\n} from \"./background-automation-runner.js\";\nimport { nextOccurrence, isValidCron, describeCron } from \"./cron.js\";\nimport {\n buildJobResourceContent,\n parseJobResource,\n type JobFrontmatter,\n} from \"./frontmatter.js\";\n\n// ─── Frontmatter parsing ────────────────────────────────────────────────────\n\nexport {\n classifyJobFrontmatter,\n classifyJobResource,\n normalizeJobMcpTools,\n parseJobResource,\n type JobFrontmatter,\n type JobResourceClassification,\n} from \"./frontmatter.js\";\n\nexport function parseJobFrontmatter(content: string): {\n meta: JobFrontmatter;\n body: string;\n} {\n const { meta, body } = parseJobResource(content);\n return { meta, body };\n}\n\nexport function buildJobContent(meta: JobFrontmatter, body: string): string {\n return buildJobResourceContent(meta, body);\n}\n\n// ─── Job execution ──────────────────────────────────────────────────────────\n\nexport type RecurringJobContext = BackgroundAutomationContext;\n\nexport interface SchedulerDeps extends BackgroundAutomationDeps {\n /**\n * Tool names to expose on the FIRST engine request for a job run. When\n * provided, every other action returned by `getActions()` is deferred\n * behind an attached `tool-search` entry instead of being serialized on\n * every scheduled tick — `runAgentLoop`'s mid-run tool expansion\n * (`expandActiveTools`) still lets the model discover and call them after\n * a search. Omit to keep the full `getActions()` set visible up front\n * (current behavior). The caller (not this module) knows which of the\n * merged actions are the app's own vs. framework additions, so this must\n * be supplied explicitly rather than inferred here.\n */\n getInitialToolNames?: (job?: RecurringJobContext) => string[] | undefined;\n}\n\nlet _isRunning = false;\n\n// Skip the DB query on every tick if we recently confirmed no jobs exist.\n// `_hasJobsCache` is invalidated whenever a `jobs/*` resource is written or\n// deleted (subscribed below), and refreshed at most every 5 minutes.\nlet _hasJobsCache: boolean | undefined;\nlet _lastJobsCheck = 0;\nconst JOBS_CHECK_INTERVAL_MS = 5 * 60_000;\nlet _emitterSubscribed = false;\n\nfunction subscribeToJobsResourceEvents(): void {\n if (_emitterSubscribed) return;\n _emitterSubscribed = true;\n // Lazy import to avoid circular deps at module load\n import(\"../resources/emitter.js\")\n .then(({ getResourcesEmitter }) => {\n getResourcesEmitter().on(\"resources\", (event: any) => {\n if (typeof event?.path === \"string\" && event.path.startsWith(\"jobs/\")) {\n _hasJobsCache = undefined;\n }\n });\n })\n .catch((err) => {\n console.warn(\n \"[jobs] resource-event subscription failed:\",\n err instanceof Error ? err.message : err,\n );\n });\n}\n\n/**\n * Process all due recurring jobs. Called every 60 seconds.\n * Sequential execution with 5-minute timeout per job.\n */\nexport async function processRecurringJobs(deps: SchedulerDeps): Promise<void> {\n // Prevent concurrent runs\n if (_isRunning) return;\n\n subscribeToJobsResourceEvents();\n\n // Skip if we recently confirmed there are no job resources to run.\n const nowMs = Date.now();\n if (\n _hasJobsCache === false &&\n nowMs - _lastJobsCheck < JOBS_CHECK_INTERVAL_MS\n ) {\n return;\n }\n\n _isRunning = true;\n\n try {\n const jobResources = await resourceListAllOwners(\"jobs/\");\n _hasJobsCache = jobResources.some(\n (r) => r.path.endsWith(\".md\") && !r.path.endsWith(\".keep\"),\n );\n _lastJobsCheck = nowMs;\n if (!_hasJobsCache) return;\n const now = new Date();\n\n for (const resource of jobResources) {\n // Skip non-markdown or .keep files\n if (!resource.path.endsWith(\".md\")) continue;\n if (resource.path.endsWith(\".keep\")) continue;\n\n const { meta, body } = parseJobFrontmatter(resource.content);\n\n // Skip disabled or missing schedule\n if (!meta.enabled || !meta.schedule) continue;\n if (!isValidCron(meta.schedule)) continue;\n\n // Skip if currently running, unless it has been stuck for more than 10 minutes\n // (server crash mid-job leaves lastStatus=running forever without this guard)\n if (meta.lastStatus === \"running\") {\n if (isBackgroundAutomationRunActive(meta, now)) continue;\n // Stuck — reset so the next check can re-run it\n meta.lastStatus = \"error\";\n meta.lastError = \"Job timed out or server crashed mid-run\";\n const next = nextOccurrence(meta.schedule, now);\n meta.nextRun = next.toISOString();\n await updateResource(resource, meta, body);\n continue;\n }\n\n // Check if due\n if (meta.nextRun) {\n const nextRunDate = new Date(meta.nextRun);\n if (nextRunDate > now) continue;\n } else {\n // No nextRun computed yet — seed it from `now` so the job waits for its\n // real next occurrence. Computing from new Date(0) (the epoch) always\n // returns a 1970 date, which is < now, so the job would fire\n // immediately on first sight regardless of its schedule.\n const next = nextOccurrence(meta.schedule, now);\n meta.nextRun = next.toISOString();\n await updateResource(resource, meta, body);\n continue;\n }\n\n // Skip if body is empty\n if (!body.trim()) continue;\n\n // Execute the job\n await executeJob(resource, meta, body, deps, now);\n }\n } catch (err) {\n // Transient WS / connection drops (Neon serverless): silently retry next\n // tick instead of spamming stderr — `retryOnConnectionError` already did\n // its retry budget at the driver level.\n const { isConnectionError } = await import(\"../db/client.js\");\n if (isConnectionError(err)) {\n _hasJobsCache = undefined; // force re-check on next successful tick\n _lastJobsCheck = 0;\n return;\n }\n // Unwrap ErrorEvent (Neon WS driver emits these on network failure) so logs show the real cause\n const detail =\n err instanceof Error\n ? err\n : ((err as any)?.error ?? (err as any)?.message ?? err);\n console.error(\"[recurring-jobs] Error processing jobs:\", detail);\n } finally {\n _isRunning = false;\n }\n}\n\nexport const jobRunCutOffReason = backgroundRunCutOffReason;\n\nasync function executeJob(\n resource: Resource,\n meta: JobFrontmatter,\n body: string,\n deps: SchedulerDeps,\n now: Date,\n): Promise<void> {\n const jobName = resource.path.replace(/^jobs\\//, \"\").replace(/\\.md$/, \"\");\n\n const jobContext: RecurringJobContext = {\n name: jobName,\n meta,\n body,\n resource,\n };\n const identity = await resolveBackgroundAutomationIdentity(jobContext);\n\n // SECURITY (audit 12 #10): re-validate the run-as user/membership on\n // every tick. Sharing revocation, user deletion, and org-member removal\n // must take effect for already-scheduled jobs. Skip the tick on\n // failure; leave the cron entry alone so an admin can purge after\n // investigation.\n if (!identity.ok) {\n console.warn(\n `[recurring-jobs] Skipping job \"${jobName}\": ${identity.reason}. ` +\n `User/membership no longer valid — leaving cron entry for admin review.`,\n );\n // Mark as skipped without resetting nextRun so an admin can find it.\n meta.lastRun = now.toISOString();\n meta.lastStatus = \"skipped\";\n meta.lastError = identity.reason;\n await updateResource(resource, meta, body);\n return;\n }\n const jobUserEmail = identity.identity.userEmail;\n const jobOrgId = identity.identity.orgId;\n\n // Mark as running\n meta.lastRun = now.toISOString();\n meta.lastStatus = \"running\";\n meta.lastError = undefined;\n await updateResource(resource, meta, body);\n\n const requestContext =\n meta.originScopeId && meta.deliveryPlatform && meta.deliveryDestination\n ? {\n isIntegrationCaller: true as const,\n integration: {\n taskId: `job:${jobName}:${now.getTime()}`,\n scopeId: meta.originScopeId,\n principalType: \"service\" as const,\n incoming: {\n platform: meta.deliveryPlatform,\n externalThreadId: `${meta.deliveryTenantId || \"unknown\"}:${meta.deliveryDestination}:${meta.deliveryThreadRef || \"root\"}`,\n text: \"\",\n tenantId: meta.deliveryTenantId,\n integrationScopeId: meta.originScopeId,\n platformContext: {\n channelId: meta.deliveryDestination,\n threadTs: meta.deliveryThreadRef,\n teamId: meta.deliveryTenantId,\n },\n threadRef: meta.deliveryThreadRef,\n timestamp: now.getTime(),\n },\n },\n }\n : undefined;\n\n try {\n await runBackgroundAutomation(\n {\n automation: jobContext,\n ownerEmail: jobUserEmail,\n orgId: jobOrgId,\n prompt: `[Recurring Job: ${jobName}]\\nSchedule: ${describeCron(meta.schedule)}\\n\\nExecute the following job instructions:\\n\\n${body}`,\n threadTitle: `Job: ${jobName} — ${now.toLocaleDateString()}`,\n runIdPrefix: `job-${jobName}`,\n usageLabel: `recurring-job:${jobName}`,\n requestContext,\n },\n deps,\n );\n\n // Compute from completion time so long runs cannot immediately re-fire.\n meta.lastStatus = \"success\";\n meta.nextRun = nextOccurrence(meta.schedule, new Date()).toISOString();\n await updateResource(resource, meta, body);\n console.log(\n `[recurring-jobs] Job \"${jobName}\" completed. Next run: ${meta.nextRun}`,\n );\n } catch (err) {\n meta.lastStatus = \"error\";\n meta.lastError =\n err instanceof Error ? err.message.slice(0, 200) : \"Unknown error\";\n meta.nextRun = nextOccurrence(meta.schedule, new Date()).toISOString();\n await updateResource(resource, meta, body);\n console.error(`[recurring-jobs] Job \"${jobName}\" failed:`, meta.lastError);\n }\n}\n\nasync function updateResource(\n resource: Resource,\n meta: JobFrontmatter,\n body: string,\n): Promise<void> {\n const content = buildJobContent(meta, body);\n await resourcePut(resource.owner, resource.path, content);\n}\n"]}
|
package/dist/jobs/tools.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/jobs/tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/jobs/tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAkBhE,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,gBAAgB,CAAC;AAsCxB;;;;;;;;;;GAUG;AACH,wBAAsB,oBAAoB,CACxC,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAkBxB;AAoOD,wBAAgB,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CA8F5D"}
|
package/dist/jobs/tools.js
CHANGED
|
@@ -2,6 +2,7 @@ import { getDbExec } from "../db/client.js";
|
|
|
2
2
|
import { resourcePut, resourceGetByPath, resourceList, resourceDelete, organizationIdFromResourceOwner, sharedResourceOwner, SHARED_OWNER, } from "../resources/store.js";
|
|
3
3
|
import { getRequestUserEmail, getRequestOrgId, getIntegrationRequestContext, } from "../server/request-context.js";
|
|
4
4
|
import { isValidCron, nextOccurrence, describeCron } from "./cron.js";
|
|
5
|
+
import { classifyJobResource } from "./frontmatter.js";
|
|
5
6
|
import { parseJobFrontmatter, buildJobContent, normalizeJobMcpTools, } from "./scheduler.js";
|
|
6
7
|
function getOwner() {
|
|
7
8
|
const email = getRequestUserEmail();
|
|
@@ -145,7 +146,11 @@ async function runList(args) {
|
|
|
145
146
|
const metas = resources.filter((r) => r.path.endsWith(".md") && !r.path.endsWith(".keep"));
|
|
146
147
|
const jobs = await Promise.all(metas.map(async (r) => {
|
|
147
148
|
const full = await resourceGetByPath(r.owner, r.path);
|
|
148
|
-
|
|
149
|
+
if (!full)
|
|
150
|
+
return null;
|
|
151
|
+
if (classifyJobResource(full.content).kind === "automation")
|
|
152
|
+
return null;
|
|
153
|
+
const { meta } = parseJobFrontmatter(full.content);
|
|
149
154
|
return {
|
|
150
155
|
name: r.path.replace(/^jobs\//, "").replace(/\.md$/, ""),
|
|
151
156
|
path: r.path,
|
|
@@ -164,10 +169,11 @@ async function runList(args) {
|
|
|
164
169
|
mcpTools: meta.mcpTools || [],
|
|
165
170
|
};
|
|
166
171
|
}));
|
|
167
|
-
|
|
172
|
+
const scheduledJobs = jobs.filter((job) => job !== null);
|
|
173
|
+
if (scheduledJobs.length === 0) {
|
|
168
174
|
return "No recurring jobs configured. Use manage-jobs with action 'create' to create one.";
|
|
169
175
|
}
|
|
170
|
-
return JSON.stringify(
|
|
176
|
+
return JSON.stringify(scheduledJobs, null, 2);
|
|
171
177
|
}
|
|
172
178
|
async function runUpdate(args) {
|
|
173
179
|
const { name, schedule, instructions, enabled, scope, runAs, model } = args;
|
|
@@ -181,6 +187,11 @@ async function runUpdate(args) {
|
|
|
181
187
|
return JSON.stringify({ error: `Job "${name}" not found` });
|
|
182
188
|
}
|
|
183
189
|
const { meta, body } = parseJobFrontmatter(resource.content);
|
|
190
|
+
if (classifyJobResource(resource.content).kind === "automation") {
|
|
191
|
+
return JSON.stringify({
|
|
192
|
+
error: `"${name}" is an automation. Use manage-automations to update it.`,
|
|
193
|
+
});
|
|
194
|
+
}
|
|
184
195
|
// Reject when the caller doesn't own the shared job and isn't an org
|
|
185
196
|
// admin. Without this check, any user could rewrite a shared job whose
|
|
186
197
|
// `createdBy` is alice@…, and the next cron tick would run the
|
|
@@ -249,6 +260,11 @@ async function runDelete(args) {
|
|
|
249
260
|
// remove a shared job. Otherwise any user could break another tenant's
|
|
250
261
|
// recurring schedule.
|
|
251
262
|
const { meta } = parseJobFrontmatter(resource.content);
|
|
263
|
+
if (classifyJobResource(resource.content).kind === "automation") {
|
|
264
|
+
return JSON.stringify({
|
|
265
|
+
error: `"${name}" is an automation. Use manage-automations to delete it.`,
|
|
266
|
+
});
|
|
267
|
+
}
|
|
252
268
|
const denied = await authorizeJobMutation(resource.owner, meta);
|
|
253
269
|
if (denied) {
|
|
254
270
|
return JSON.stringify({ error: denied });
|
|
@@ -319,6 +335,11 @@ For jobs that use a connected MCP, pass the exact tool names in mcpTools. This b
|
|
|
319
335
|
required: ["action"],
|
|
320
336
|
},
|
|
321
337
|
},
|
|
338
|
+
planMode: {
|
|
339
|
+
effect: (args) => (args.action === "list" ? "read" : "write"),
|
|
340
|
+
allowedValues: { action: ["list"] },
|
|
341
|
+
description: "Plan mode allows listing recurring jobs.",
|
|
342
|
+
},
|
|
322
343
|
run: async (args) => {
|
|
323
344
|
switch (args.action) {
|
|
324
345
|
case "create":
|
package/dist/jobs/tools.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/jobs/tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,+BAA+B,EAC/B,mBAAmB,EACnB,YAAY,GACb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,4BAA4B,GAC7B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACtE,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,oBAAoB,GAErB,MAAM,gBAAgB,CAAC;AAExB,SAAS,QAAQ;IACf,MAAM,KAAK,GAAG,mBAAmB,EAAE,CAAC;IACpC,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IACrD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,cAAc;IACrB,OAAO,mBAAmB,CAAC,eAAe,EAAE,CAAC,CAAC;AAChD,CAAC;AAED;;;;;GAKG;AACH,KAAK,UAAU,qBAAqB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AC,SAAS,EAAE,QAAQ,CAAC;yBAC5B;wBACD,KAAK,EAAE;4BACL,IAAI,EAAE,QAAQ;4BACd,WAAW,EACT,0FAA0F;yBAC7F;wBACD,QAAQ,EAAE;4BACR,IAAI,EAAE,OAAO;4BACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;4BACzB,WAAW,EACT,wQAAwQ;yBAC3Q;qBACF;oBACD,QAAQ,EAAE,CAAC,QAAQ,CAAC;iBACrB;aACF;YACD,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;gBAClB,QAAQ,IAAI,CAAC,MAAM,EAAE,CAAC;oBACpB,KAAK,QAAQ;wBACX,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;oBACzB,KAAK,MAAM;wBACT,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;oBACvB,KAAK,QAAQ;wBACX,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;oBACzB,KAAK,QAAQ;wBACX,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;oBACzB;wBACE,OAAO,IAAI,CAAC,SAAS,CAAC;4BACpB,KAAK,EAAE,mBAAmB,IAAI,CAAC,MAAM,uCAAuC;yBAC7E,CAAC,CAAC;gBACP,CAAC;YACH,CAAC;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { ActionEntry } from \"../agent/production-agent.js\";\nimport { getDbExec } from \"../db/client.js\";\nimport {\n resourcePut,\n resourceGetByPath,\n resourceList,\n resourceDelete,\n organizationIdFromResourceOwner,\n sharedResourceOwner,\n SHARED_OWNER,\n} from \"../resources/store.js\";\nimport {\n getRequestUserEmail,\n getRequestOrgId,\n getIntegrationRequestContext,\n} from \"../server/request-context.js\";\nimport { isValidCron, nextOccurrence, describeCron } from \"./cron.js\";\nimport {\n parseJobFrontmatter,\n buildJobContent,\n normalizeJobMcpTools,\n type JobFrontmatter,\n} from \"./scheduler.js\";\n\nfunction getOwner(): string {\n const email = getRequestUserEmail();\n if (!email) throw new Error(\"no authenticated user\");\n return email;\n}\n\nfunction getSharedOwner(): string {\n return sharedResourceOwner(getRequestOrgId());\n}\n\n/**\n * Determine if the current request's user is an org owner/admin in the\n * given org. Used to allow privileged users to update or delete shared\n * jobs created by other org members. Returns false when there is no org,\n * no user, no membership, or any error querying — fail closed.\n */\nasync function isCurrentUserOrgAdmin(\n orgId: string | undefined,\n): Promise<boolean> {\n if (!orgId) return false;\n const email = getRequestUserEmail();\n if (!email) return false;\n try {\n const client = getDbExec();\n const { rows } = await client.execute({\n sql: `SELECT role FROM org_members WHERE org_id = ? AND LOWER(email) = ? LIMIT 1`,\n args: [orgId, email.toLowerCase()],\n });\n if (rows.length === 0) return false;\n const role = String((rows[0] as any).role ?? \"\").toLowerCase();\n return role === \"owner\" || role === \"admin\";\n } catch {\n return false;\n }\n}\n\n/**\n * Authorise a mutation (update / delete) against a job resource. When the\n * job is in the SHARED scope the caller must either be the original\n * `createdBy` user or an org owner/admin — otherwise any user could rewrite\n * another user's shared job and have it run as that user on the next cron\n * tick (the privilege-escalation chain documented in audit\n * `/tmp/security-audit/12-mcp-a2a-agent.md`, finding #3).\n *\n * Returns null when the mutation is allowed, or an error string suitable\n * for returning to the caller when not.\n */\nexport async function authorizeJobMutation(\n resourceOwner: string,\n meta: JobFrontmatter,\n): Promise<string | null> {\n const resourceOrgId = organizationIdFromResourceOwner(resourceOwner);\n if (resourceOwner !== SHARED_OWNER && !resourceOrgId) {\n // Personal-scope job — owner is the request's user. resourceGetByPath is\n // already scoped to the caller, so we know meta.createdBy must match.\n return null;\n }\n const caller = getOwner();\n const createdBy = meta.createdBy?.toLowerCase();\n if (createdBy && createdBy === caller.toLowerCase()) return null;\n\n // Allow org owners/admins to manage shared jobs created by other members.\n const isAdmin = await isCurrentUserOrgAdmin(\n resourceOrgId ?? meta.orgId ?? getRequestOrgId() ?? undefined,\n );\n if (isAdmin) return null;\n\n return \"Only the job's creator (or an org admin) can update or delete it.\";\n}\n\nasync function runCreate(args: Record<string, any>): Promise<string> {\n const { name, schedule, instructions, scope, runAs, model } = args;\n\n if (!name || !schedule || !instructions) {\n return JSON.stringify({\n error: \"name, schedule, and instructions are required\",\n });\n }\n\n if (!isValidCron(schedule)) {\n return JSON.stringify({\n error: `Invalid cron expression: \"${schedule}\". Use 5 fields: minute hour day-of-month month day-of-week.`,\n });\n }\n\n let mcpTools: string[] | undefined;\n try {\n mcpTools = normalizeJobMcpTools(args.mcpTools);\n } catch (err) {\n return JSON.stringify({ error: (err as Error).message });\n }\n\n const owner = scope === \"personal\" ? getOwner() : getSharedOwner();\n const path = `jobs/${name}.md`;\n const now = new Date();\n const next = nextOccurrence(schedule, now);\n const integration = getIntegrationRequestContext();\n const channelId = integration?.incoming.platformContext.channelId;\n const threadRef = integration?.incoming.threadRef;\n\n const meta: JobFrontmatter = {\n schedule,\n enabled: true,\n createdBy: getOwner(),\n orgId: getRequestOrgId() || undefined,\n runAs: runAs === \"shared\" ? \"shared\" : \"creator\",\n nextRun: next.toISOString(),\n ...(integration?.scopeId ? { originScopeId: integration.scopeId } : {}),\n ...(integration?.incoming.platform\n ? { deliveryPlatform: integration.incoming.platform }\n : {}),\n ...(typeof channelId === \"string\"\n ? { deliveryDestination: channelId }\n : {}),\n ...(typeof threadRef === \"string\" ? { deliveryThreadRef: threadRef } : {}),\n ...(integration?.incoming.tenantId\n ? { deliveryTenantId: integration.incoming.tenantId }\n : {}),\n ...(typeof model === \"string\" && model.trim()\n ? { model: model.trim() }\n : {}),\n ...(mcpTools?.length ? { mcpTools } : {}),\n };\n\n const content = buildJobContent(meta, instructions);\n await resourcePut(owner, path, content);\n\n return JSON.stringify({\n created: true,\n name,\n path,\n schedule,\n scheduleDescription: describeCron(schedule),\n nextRun: next.toISOString(),\n scope: scope || \"shared\",\n ...(mcpTools?.length ? { mcpTools } : {}),\n });\n}\n\nasync function runList(args: Record<string, any>): Promise<string> {\n const owner = getOwner();\n const sharedOwner = getSharedOwner();\n // Fetch only current user's and shared jobs (not other users')\n const [personal, shared] = await Promise.all([\n resourceList(owner, \"jobs/\"),\n resourceList(sharedOwner, \"jobs/\"),\n ]);\n let resources = [...personal, ...shared];\n if (args.scope === \"personal\") resources = personal;\n else if (args.scope === \"shared\") resources = shared;\n const metas = resources.filter(\n (r) => r.path.endsWith(\".md\") && !r.path.endsWith(\".keep\"),\n );\n const jobs = await Promise.all(\n metas.map(async (r) => {\n const full = await resourceGetByPath(r.owner, r.path);\n const { meta } = parseJobFrontmatter(full?.content || \"\");\n return {\n name: r.path.replace(/^jobs\\//, \"\").replace(/\\.md$/, \"\"),\n path: r.path,\n scope: r.owner === sharedOwner ? \"shared\" : \"personal\",\n schedule: meta.schedule,\n scheduleDescription: meta.schedule ? describeCron(meta.schedule) : \"\",\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 originScopeId: meta.originScopeId || null,\n deliveryPlatform: meta.deliveryPlatform || null,\n deliveryDestination: meta.deliveryDestination || null,\n model: meta.model || null,\n mcpTools: meta.mcpTools || [],\n };\n }),\n );\n\n if (jobs.length === 0) {\n return \"No recurring jobs configured. Use manage-jobs with action 'create' to create one.\";\n }\n\n return JSON.stringify(jobs, null, 2);\n}\n\nasync function runUpdate(args: Record<string, any>): Promise<string> {\n const { name, schedule, instructions, enabled, scope, runAs, model } = args;\n const path = `jobs/${name}.md`;\n\n // Try to find the resource\n let resource = await resourceGetByPath(getSharedOwner(), path);\n if (!resource && scope !== \"shared\") {\n resource = await resourceGetByPath(getOwner(), path);\n }\n\n if (!resource) {\n return JSON.stringify({ error: `Job \"${name}\" not found` });\n }\n\n const { meta, body } = parseJobFrontmatter(resource.content);\n\n // Reject when the caller doesn't own the shared job and isn't an org\n // admin. Without this check, any user could rewrite a shared job whose\n // `createdBy` is alice@…, and the next cron tick would run the\n // attacker's instructions as alice (creator-runAs schedules in\n // jobs/scheduler.ts line 273-278).\n const denied = await authorizeJobMutation(resource.owner, meta);\n if (denied) {\n return JSON.stringify({ error: denied });\n }\n\n if (schedule) {\n if (!isValidCron(schedule)) {\n return JSON.stringify({\n error: `Invalid cron expression: \"${schedule}\"`,\n });\n }\n meta.schedule = schedule;\n meta.nextRun = nextOccurrence(schedule).toISOString();\n }\n\n if (enabled !== undefined) {\n // Accept both the schema's string enum (\"true\"/\"false\") and a real boolean\n // from non-LLM callers. `enabled === \"true\"` alone treats a boolean `true`\n // as false — silently *disabling* a job the caller meant to enable.\n meta.enabled = enabled === true || enabled === \"true\";\n }\n\n if (runAs === \"creator\" || runAs === \"shared\") {\n meta.runAs = runAs;\n }\n if (typeof model === \"string\" && model.trim()) meta.model = model.trim();\n\n if (args.mcpTools !== undefined) {\n try {\n const mcpTools = normalizeJobMcpTools(args.mcpTools) ?? [];\n if (mcpTools.length) meta.mcpTools = mcpTools;\n else delete meta.mcpTools;\n } catch (err) {\n return JSON.stringify({ error: (err as Error).message });\n }\n }\n\n const newBody = instructions || body;\n const content = buildJobContent(meta, newBody);\n await resourcePut(resource.owner, resource.path, content);\n\n return JSON.stringify({\n updated: true,\n name,\n schedule: meta.schedule,\n scheduleDescription: describeCron(meta.schedule),\n enabled: meta.enabled,\n nextRun: meta.nextRun,\n mcpTools: meta.mcpTools || [],\n });\n}\n\nasync function runDelete(args: Record<string, any>): Promise<string> {\n const { name, scope } = args;\n const path = `jobs/${name}.md`;\n\n let resource = await resourceGetByPath(getSharedOwner(), path);\n if (!resource && scope !== \"shared\") {\n resource = await resourceGetByPath(getOwner(), path);\n }\n\n if (!resource) {\n return JSON.stringify({ error: `Job \"${name}\" not found` });\n }\n\n // Same access check as runUpdate — only the creator or an org admin can\n // remove a shared job. Otherwise any user could break another tenant's\n // recurring schedule.\n const { meta } = parseJobFrontmatter(resource.content);\n const denied = await authorizeJobMutation(resource.owner, meta);\n if (denied) {\n return JSON.stringify({ error: denied });\n }\n\n await resourceDelete(resource.id);\n return JSON.stringify({ deleted: true, name });\n}\n\nexport function createJobTools(): Record<string, ActionEntry> {\n return {\n \"manage-jobs\": {\n tool: {\n description: `Manage recurring jobs that run on a cron schedule.\n\nActions:\n- \"create\": Create a new recurring job. Requires name, schedule, and instructions.\n- \"list\": List all recurring jobs and their status (schedule, enabled, last run, next run).\n- \"update\": Update a job's schedule, instructions, or enabled state. Requires name.\n- \"delete\": Delete a recurring job. Requires name. Always confirm with the user first.\n\nCron format is 5 fields: minute hour day-of-month month day-of-week. Common patterns: '0 9 * * *' (daily 9am), '0 9 * * 1-5' (weekdays 9am), '0 * * * *' (every hour), '0 9 * * 1' (Mondays 9am), '*/30 * * * *' (every 30 min).\n\nFor jobs that use a connected MCP, pass the exact tool names in mcpTools. This binds only those tools to the background run; OAuth credentials remain in the connector and are resolved for the job's user/org context.`,\n parameters: {\n type: \"object\",\n properties: {\n action: {\n type: \"string\",\n description: \"The action to perform.\",\n enum: [\"create\", \"list\", \"update\", \"delete\"],\n },\n name: {\n type: \"string\",\n description:\n \"Job name (hyphen-case, e.g. 'daily-scorecard-check'). Required for create and update.\",\n },\n schedule: {\n type: \"string\",\n description:\n \"Cron expression (5 fields: minute hour day-of-month month day-of-week). Required for create, optional for update.\",\n },\n instructions: {\n type: \"string\",\n description:\n \"What the agent should do when this job runs. Be specific — include which actions to call and what to do with the results. Required for create, optional for update.\",\n },\n enabled: {\n type: \"string\",\n description:\n \"Enable or disable a job: 'true' or 'false'. Only used with update.\",\n enum: [\"true\", \"false\"],\n },\n scope: {\n type: \"string\",\n description:\n \"For create: personal or shared (default: shared). For list: personal, shared, or all (default: all). For update: which scope to search (default: all).\",\n enum: [\"personal\", \"shared\", \"all\"],\n },\n runAs: {\n type: \"string\",\n description:\n \"Who shared jobs execute as: creator or shared. Default: creator. Used with create and update.\",\n enum: [\"creator\", \"shared\"],\n },\n model: {\n type: \"string\",\n description:\n \"Optional model id for this routine. The channel/app/engine default is used when omitted.\",\n },\n mcpTools: {\n type: \"array\",\n items: { type: \"string\" },\n description:\n 'Optional explicit MCP capabilities for this job. Use the connected tool names exactly as advertised, for example [\"mcp__meeting-notes__list_meetings\", \"mcp__meeting-notes__get_transcript\"]. The job runs only with these tools; credentials remain in the connector.',\n },\n },\n required: [\"action\"],\n },\n },\n run: async (args) => {\n switch (args.action) {\n case \"create\":\n return runCreate(args);\n case \"list\":\n return runList(args);\n case \"update\":\n return runUpdate(args);\n case \"delete\":\n return runDelete(args);\n default:\n return JSON.stringify({\n error: `Unknown action \"${args.action}\". Use \"create\", \"list\", or \"update\".`,\n });\n }\n },\n },\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/jobs/tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,+BAA+B,EAC/B,mBAAmB,EACnB,YAAY,GACb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,4BAA4B,GAC7B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,oBAAoB,GAErB,MAAM,gBAAgB,CAAC;AAExB,SAAS,QAAQ;IACf,MAAM,KAAK,GAAG,mBAAmB,EAAE,CAAC;IACpC,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IACrD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,cAAc;IACrB,OAAO,mBAAmB,CAAC,eAAe,EAAE,CAAC,CAAC;AAChD,CAAC;AAED;;;;;GAKG;AACH,KAAK,UAAU,qBAAqB,CAClC,KAAyB;IAEzB,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC;IACzB,MAAM,KAA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AC,IAAI,CAAC,CAAC;oBACzB,KAAK,MAAM;wBACT,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;oBACvB,KAAK,QAAQ;wBACX,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;oBACzB,KAAK,QAAQ;wBACX,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;oBACzB;wBACE,OAAO,IAAI,CAAC,SAAS,CAAC;4BACpB,KAAK,EAAE,mBAAmB,IAAI,CAAC,MAAM,uCAAuC;yBAC7E,CAAC,CAAC;gBACP,CAAC;YACH,CAAC;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { ActionEntry } from \"../agent/production-agent.js\";\nimport { getDbExec } from \"../db/client.js\";\nimport {\n resourcePut,\n resourceGetByPath,\n resourceList,\n resourceDelete,\n organizationIdFromResourceOwner,\n sharedResourceOwner,\n SHARED_OWNER,\n} from \"../resources/store.js\";\nimport {\n getRequestUserEmail,\n getRequestOrgId,\n getIntegrationRequestContext,\n} from \"../server/request-context.js\";\nimport { isValidCron, nextOccurrence, describeCron } from \"./cron.js\";\nimport { classifyJobResource } from \"./frontmatter.js\";\nimport {\n parseJobFrontmatter,\n buildJobContent,\n normalizeJobMcpTools,\n type JobFrontmatter,\n} from \"./scheduler.js\";\n\nfunction getOwner(): string {\n const email = getRequestUserEmail();\n if (!email) throw new Error(\"no authenticated user\");\n return email;\n}\n\nfunction getSharedOwner(): string {\n return sharedResourceOwner(getRequestOrgId());\n}\n\n/**\n * Determine if the current request's user is an org owner/admin in the\n * given org. Used to allow privileged users to update or delete shared\n * jobs created by other org members. Returns false when there is no org,\n * no user, no membership, or any error querying — fail closed.\n */\nasync function isCurrentUserOrgAdmin(\n orgId: string | undefined,\n): Promise<boolean> {\n if (!orgId) return false;\n const email = getRequestUserEmail();\n if (!email) return false;\n try {\n const client = getDbExec();\n const { rows } = await client.execute({\n sql: `SELECT role FROM org_members WHERE org_id = ? AND LOWER(email) = ? LIMIT 1`,\n args: [orgId, email.toLowerCase()],\n });\n if (rows.length === 0) return false;\n const role = String((rows[0] as any).role ?? \"\").toLowerCase();\n return role === \"owner\" || role === \"admin\";\n } catch {\n return false;\n }\n}\n\n/**\n * Authorise a mutation (update / delete) against a job resource. When the\n * job is in the SHARED scope the caller must either be the original\n * `createdBy` user or an org owner/admin — otherwise any user could rewrite\n * another user's shared job and have it run as that user on the next cron\n * tick (the privilege-escalation chain documented in audit\n * `/tmp/security-audit/12-mcp-a2a-agent.md`, finding #3).\n *\n * Returns null when the mutation is allowed, or an error string suitable\n * for returning to the caller when not.\n */\nexport async function authorizeJobMutation(\n resourceOwner: string,\n meta: JobFrontmatter,\n): Promise<string | null> {\n const resourceOrgId = organizationIdFromResourceOwner(resourceOwner);\n if (resourceOwner !== SHARED_OWNER && !resourceOrgId) {\n // Personal-scope job — owner is the request's user. resourceGetByPath is\n // already scoped to the caller, so we know meta.createdBy must match.\n return null;\n }\n const caller = getOwner();\n const createdBy = meta.createdBy?.toLowerCase();\n if (createdBy && createdBy === caller.toLowerCase()) return null;\n\n // Allow org owners/admins to manage shared jobs created by other members.\n const isAdmin = await isCurrentUserOrgAdmin(\n resourceOrgId ?? meta.orgId ?? getRequestOrgId() ?? undefined,\n );\n if (isAdmin) return null;\n\n return \"Only the job's creator (or an org admin) can update or delete it.\";\n}\n\nasync function runCreate(args: Record<string, any>): Promise<string> {\n const { name, schedule, instructions, scope, runAs, model } = args;\n\n if (!name || !schedule || !instructions) {\n return JSON.stringify({\n error: \"name, schedule, and instructions are required\",\n });\n }\n\n if (!isValidCron(schedule)) {\n return JSON.stringify({\n error: `Invalid cron expression: \"${schedule}\". Use 5 fields: minute hour day-of-month month day-of-week.`,\n });\n }\n\n let mcpTools: string[] | undefined;\n try {\n mcpTools = normalizeJobMcpTools(args.mcpTools);\n } catch (err) {\n return JSON.stringify({ error: (err as Error).message });\n }\n\n const owner = scope === \"personal\" ? getOwner() : getSharedOwner();\n const path = `jobs/${name}.md`;\n const now = new Date();\n const next = nextOccurrence(schedule, now);\n const integration = getIntegrationRequestContext();\n const channelId = integration?.incoming.platformContext.channelId;\n const threadRef = integration?.incoming.threadRef;\n\n const meta: JobFrontmatter = {\n schedule,\n enabled: true,\n createdBy: getOwner(),\n orgId: getRequestOrgId() || undefined,\n runAs: runAs === \"shared\" ? \"shared\" : \"creator\",\n nextRun: next.toISOString(),\n ...(integration?.scopeId ? { originScopeId: integration.scopeId } : {}),\n ...(integration?.incoming.platform\n ? { deliveryPlatform: integration.incoming.platform }\n : {}),\n ...(typeof channelId === \"string\"\n ? { deliveryDestination: channelId }\n : {}),\n ...(typeof threadRef === \"string\" ? { deliveryThreadRef: threadRef } : {}),\n ...(integration?.incoming.tenantId\n ? { deliveryTenantId: integration.incoming.tenantId }\n : {}),\n ...(typeof model === \"string\" && model.trim()\n ? { model: model.trim() }\n : {}),\n ...(mcpTools?.length ? { mcpTools } : {}),\n };\n\n const content = buildJobContent(meta, instructions);\n await resourcePut(owner, path, content);\n\n return JSON.stringify({\n created: true,\n name,\n path,\n schedule,\n scheduleDescription: describeCron(schedule),\n nextRun: next.toISOString(),\n scope: scope || \"shared\",\n ...(mcpTools?.length ? { mcpTools } : {}),\n });\n}\n\nasync function runList(args: Record<string, any>): Promise<string> {\n const owner = getOwner();\n const sharedOwner = getSharedOwner();\n // Fetch only current user's and shared jobs (not other users')\n const [personal, shared] = await Promise.all([\n resourceList(owner, \"jobs/\"),\n resourceList(sharedOwner, \"jobs/\"),\n ]);\n let resources = [...personal, ...shared];\n if (args.scope === \"personal\") resources = personal;\n else if (args.scope === \"shared\") resources = shared;\n const metas = resources.filter(\n (r) => r.path.endsWith(\".md\") && !r.path.endsWith(\".keep\"),\n );\n const jobs = await Promise.all(\n metas.map(async (r) => {\n const full = await resourceGetByPath(r.owner, r.path);\n if (!full) return null;\n if (classifyJobResource(full.content).kind === \"automation\") return null;\n const { meta } = parseJobFrontmatter(full.content);\n return {\n name: r.path.replace(/^jobs\\//, \"\").replace(/\\.md$/, \"\"),\n path: r.path,\n scope: r.owner === sharedOwner ? \"shared\" : \"personal\",\n schedule: meta.schedule,\n scheduleDescription: meta.schedule ? describeCron(meta.schedule) : \"\",\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 originScopeId: meta.originScopeId || null,\n deliveryPlatform: meta.deliveryPlatform || null,\n deliveryDestination: meta.deliveryDestination || null,\n model: meta.model || null,\n mcpTools: meta.mcpTools || [],\n };\n }),\n );\n const scheduledJobs = jobs.filter((job) => job !== null);\n\n if (scheduledJobs.length === 0) {\n return \"No recurring jobs configured. Use manage-jobs with action 'create' to create one.\";\n }\n\n return JSON.stringify(scheduledJobs, null, 2);\n}\n\nasync function runUpdate(args: Record<string, any>): Promise<string> {\n const { name, schedule, instructions, enabled, scope, runAs, model } = args;\n const path = `jobs/${name}.md`;\n\n // Try to find the resource\n let resource = await resourceGetByPath(getSharedOwner(), path);\n if (!resource && scope !== \"shared\") {\n resource = await resourceGetByPath(getOwner(), path);\n }\n\n if (!resource) {\n return JSON.stringify({ error: `Job \"${name}\" not found` });\n }\n\n const { meta, body } = parseJobFrontmatter(resource.content);\n if (classifyJobResource(resource.content).kind === \"automation\") {\n return JSON.stringify({\n error: `\"${name}\" is an automation. Use manage-automations to update it.`,\n });\n }\n\n // Reject when the caller doesn't own the shared job and isn't an org\n // admin. Without this check, any user could rewrite a shared job whose\n // `createdBy` is alice@…, and the next cron tick would run the\n // attacker's instructions as alice (creator-runAs schedules in\n // jobs/scheduler.ts line 273-278).\n const denied = await authorizeJobMutation(resource.owner, meta);\n if (denied) {\n return JSON.stringify({ error: denied });\n }\n\n if (schedule) {\n if (!isValidCron(schedule)) {\n return JSON.stringify({\n error: `Invalid cron expression: \"${schedule}\"`,\n });\n }\n meta.schedule = schedule;\n meta.nextRun = nextOccurrence(schedule).toISOString();\n }\n\n if (enabled !== undefined) {\n // Accept both the schema's string enum (\"true\"/\"false\") and a real boolean\n // from non-LLM callers. `enabled === \"true\"` alone treats a boolean `true`\n // as false — silently *disabling* a job the caller meant to enable.\n meta.enabled = enabled === true || enabled === \"true\";\n }\n\n if (runAs === \"creator\" || runAs === \"shared\") {\n meta.runAs = runAs;\n }\n if (typeof model === \"string\" && model.trim()) meta.model = model.trim();\n\n if (args.mcpTools !== undefined) {\n try {\n const mcpTools = normalizeJobMcpTools(args.mcpTools) ?? [];\n if (mcpTools.length) meta.mcpTools = mcpTools;\n else delete meta.mcpTools;\n } catch (err) {\n return JSON.stringify({ error: (err as Error).message });\n }\n }\n\n const newBody = instructions || body;\n const content = buildJobContent(meta, newBody);\n await resourcePut(resource.owner, resource.path, content);\n\n return JSON.stringify({\n updated: true,\n name,\n schedule: meta.schedule,\n scheduleDescription: describeCron(meta.schedule),\n enabled: meta.enabled,\n nextRun: meta.nextRun,\n mcpTools: meta.mcpTools || [],\n });\n}\n\nasync function runDelete(args: Record<string, any>): Promise<string> {\n const { name, scope } = args;\n const path = `jobs/${name}.md`;\n\n let resource = await resourceGetByPath(getSharedOwner(), path);\n if (!resource && scope !== \"shared\") {\n resource = await resourceGetByPath(getOwner(), path);\n }\n\n if (!resource) {\n return JSON.stringify({ error: `Job \"${name}\" not found` });\n }\n\n // Same access check as runUpdate — only the creator or an org admin can\n // remove a shared job. Otherwise any user could break another tenant's\n // recurring schedule.\n const { meta } = parseJobFrontmatter(resource.content);\n if (classifyJobResource(resource.content).kind === \"automation\") {\n return JSON.stringify({\n error: `\"${name}\" is an automation. Use manage-automations to delete it.`,\n });\n }\n const denied = await authorizeJobMutation(resource.owner, meta);\n if (denied) {\n return JSON.stringify({ error: denied });\n }\n\n await resourceDelete(resource.id);\n return JSON.stringify({ deleted: true, name });\n}\n\nexport function createJobTools(): Record<string, ActionEntry> {\n return {\n \"manage-jobs\": {\n tool: {\n description: `Manage recurring jobs that run on a cron schedule.\n\nActions:\n- \"create\": Create a new recurring job. Requires name, schedule, and instructions.\n- \"list\": List all recurring jobs and their status (schedule, enabled, last run, next run).\n- \"update\": Update a job's schedule, instructions, or enabled state. Requires name.\n- \"delete\": Delete a recurring job. Requires name. Always confirm with the user first.\n\nCron format is 5 fields: minute hour day-of-month month day-of-week. Common patterns: '0 9 * * *' (daily 9am), '0 9 * * 1-5' (weekdays 9am), '0 * * * *' (every hour), '0 9 * * 1' (Mondays 9am), '*/30 * * * *' (every 30 min).\n\nFor jobs that use a connected MCP, pass the exact tool names in mcpTools. This binds only those tools to the background run; OAuth credentials remain in the connector and are resolved for the job's user/org context.`,\n parameters: {\n type: \"object\",\n properties: {\n action: {\n type: \"string\",\n description: \"The action to perform.\",\n enum: [\"create\", \"list\", \"update\", \"delete\"],\n },\n name: {\n type: \"string\",\n description:\n \"Job name (hyphen-case, e.g. 'daily-scorecard-check'). Required for create and update.\",\n },\n schedule: {\n type: \"string\",\n description:\n \"Cron expression (5 fields: minute hour day-of-month month day-of-week). Required for create, optional for update.\",\n },\n instructions: {\n type: \"string\",\n description:\n \"What the agent should do when this job runs. Be specific — include which actions to call and what to do with the results. Required for create, optional for update.\",\n },\n enabled: {\n type: \"string\",\n description:\n \"Enable or disable a job: 'true' or 'false'. Only used with update.\",\n enum: [\"true\", \"false\"],\n },\n scope: {\n type: \"string\",\n description:\n \"For create: personal or shared (default: shared). For list: personal, shared, or all (default: all). For update: which scope to search (default: all).\",\n enum: [\"personal\", \"shared\", \"all\"],\n },\n runAs: {\n type: \"string\",\n description:\n \"Who shared jobs execute as: creator or shared. Default: creator. Used with create and update.\",\n enum: [\"creator\", \"shared\"],\n },\n model: {\n type: \"string\",\n description:\n \"Optional model id for this routine. The channel/app/engine default is used when omitted.\",\n },\n mcpTools: {\n type: \"array\",\n items: { type: \"string\" },\n description:\n 'Optional explicit MCP capabilities for this job. Use the connected tool names exactly as advertised, for example [\"mcp__meeting-notes__list_meetings\", \"mcp__meeting-notes__get_transcript\"]. The job runs only with these tools; credentials remain in the connector.',\n },\n },\n required: [\"action\"],\n },\n },\n planMode: {\n effect: (args) => (args.action === \"list\" ? \"read\" : \"write\"),\n allowedValues: { action: [\"list\"] },\n description: \"Plan mode allows listing recurring jobs.\",\n },\n run: async (args) => {\n switch (args.action) {\n case \"create\":\n return runCreate(args);\n case \"list\":\n return runList(args);\n case \"update\":\n return runUpdate(args);\n case \"delete\":\n return runDelete(args);\n default:\n return JSON.stringify({\n error: `Unknown action \"${args.action}\". Use \"create\", \"list\", or \"update\".`,\n });\n }\n },\n },\n };\n}\n"]}
|
|
@@ -277,6 +277,18 @@ declare const messages: {
|
|
|
277
277
|
unknownPlatform: string;
|
|
278
278
|
attemptsCount: string;
|
|
279
279
|
noErrorMessage: string;
|
|
280
|
+
browserChatUnavailableTitle: string;
|
|
281
|
+
browserChatUnavailableDescription: string;
|
|
282
|
+
browserChatPlaceholder: string;
|
|
283
|
+
browserChatAttachedPlaceholder: string;
|
|
284
|
+
browserConnectTitle: string;
|
|
285
|
+
browserConnectDescription: string;
|
|
286
|
+
browserConnectInvalid: string;
|
|
287
|
+
browserConnectConnected: string;
|
|
288
|
+
browserConnectConnecting: string;
|
|
289
|
+
browserConnectButton: string;
|
|
290
|
+
browserConnectOpenFromExtension: string;
|
|
291
|
+
browserConnectFailed: string;
|
|
280
292
|
};
|
|
281
293
|
};
|
|
282
294
|
agentPanel: {
|
|
@@ -444,69 +456,45 @@ declare const messages: {
|
|
|
444
456
|
systemOrdered: string;
|
|
445
457
|
};
|
|
446
458
|
jobs: {
|
|
447
|
-
agent: string;
|
|
448
459
|
pageTitle: string;
|
|
449
460
|
pageDescription: string;
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
recurringDescription: string;
|
|
461
|
+
personalDescription: string;
|
|
462
|
+
organizationDescription: string;
|
|
453
463
|
organizationMemberNote: string;
|
|
454
464
|
loading: string;
|
|
455
|
-
|
|
465
|
+
loadError: string;
|
|
456
466
|
organizationEmptyTitle: string;
|
|
457
467
|
organizationEmptyDescription: string;
|
|
458
|
-
recurringEmptyTitle: string;
|
|
459
|
-
recurringEmptyDescription: string;
|
|
460
|
-
organizationCreateTitle: string;
|
|
461
|
-
recurringCreateTitle: string;
|
|
462
468
|
organizationPrompt: string;
|
|
463
|
-
recurringPrompt: string;
|
|
464
|
-
organizationEmpty: string;
|
|
465
|
-
recurringEmpty: string;
|
|
466
469
|
enabled: string;
|
|
467
470
|
paused: string;
|
|
468
|
-
disabled: string;
|
|
469
471
|
nextRun: string;
|
|
470
472
|
lastRun: string;
|
|
471
473
|
details: string;
|
|
472
474
|
pause: string;
|
|
473
475
|
resume: string;
|
|
474
476
|
delete: string;
|
|
475
|
-
|
|
476
|
-
automationUpdateError: string;
|
|
477
|
-
automationsTitle: string;
|
|
478
|
-
organizationAutomationsDescription: string;
|
|
479
|
-
automationsDescription: string;
|
|
477
|
+
updateError: string;
|
|
480
478
|
automationsEmptyTitle: string;
|
|
481
479
|
automationsEmptyDescription: string;
|
|
482
480
|
automationsCreateTitle: string;
|
|
481
|
+
newAutomation: string;
|
|
483
482
|
automationPrompt: string;
|
|
484
|
-
automationsPersonalOnly: string;
|
|
485
|
-
deleteRecurringTitle: string;
|
|
486
|
-
deleteRecurringDescription: string;
|
|
487
483
|
cancel: string;
|
|
488
|
-
recurringDetails: string;
|
|
489
484
|
instructions: string;
|
|
490
485
|
mcpTools: string;
|
|
491
|
-
automationsLoadError: string;
|
|
492
|
-
automationsEmpty: string;
|
|
493
486
|
automationEventTrigger: string;
|
|
494
|
-
|
|
487
|
+
scheduledTrigger: string;
|
|
488
|
+
eventTrigger: string;
|
|
495
489
|
deleteAutomationTitle: string;
|
|
496
490
|
deleteAutomationDescription: string;
|
|
497
491
|
automationDetails: string;
|
|
498
492
|
automationEventDetails: string;
|
|
499
493
|
condition: string;
|
|
500
|
-
firingTestEvent: string;
|
|
501
|
-
fireEventError: string;
|
|
502
|
-
eventFired: string;
|
|
503
|
-
fireEventErrorGeneric: string;
|
|
504
|
-
newAutomation: string;
|
|
505
|
-
automationPlaceholder: string;
|
|
506
494
|
personal: string;
|
|
507
495
|
organization: string;
|
|
508
|
-
|
|
509
|
-
|
|
496
|
+
settingsSummary: string;
|
|
497
|
+
openAutomations: string;
|
|
510
498
|
};
|
|
511
499
|
share: {
|
|
512
500
|
titleWithResource: string;
|
|
@@ -627,6 +615,13 @@ declare const messages: {
|
|
|
627
615
|
deleting: string;
|
|
628
616
|
openFullView: string;
|
|
629
617
|
removeFromWidgetArea: string;
|
|
618
|
+
customBlockSandboxed: string;
|
|
619
|
+
sandboxedCustomBlock: string;
|
|
620
|
+
sandboxedCustomBlockCreatedBy: string;
|
|
621
|
+
promoteToAppCode: string;
|
|
622
|
+
historyShowsSourceVersions: string;
|
|
623
|
+
createdByHistoryShowsSourceVersions: string;
|
|
624
|
+
createdByHistoryShowsSourceVersionsCompact: string;
|
|
630
625
|
deleteExtensionEllipsis: string;
|
|
631
626
|
removeFromMyListEllipsis: string;
|
|
632
627
|
removeFromWidgetAreaForMe: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-messages.d.ts","sourceRoot":"","sources":["../../src/localization/default-messages.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,QAAQ;IACZ,aAAa;QACX,QAAQ;;IAEV,IAAI;QACF,aAAa;QACb,mBAAmB;QACnB,KAAK;QACL,KAAK;QACL,eAAe;QACf,aAAa;QACb,SAAS;QACT,eAAe;QACf,UAAU;QACV,gBAAgB;;IAElB,QAAQ;QACN,KAAK;QACL,SAAS;QACT,WAAW;QACX,aAAa;QACb,mBAAmB;QAEnB,aAAa;QACb,UAAU;QACV,gBAAgB;QAEhB,iBAAiB;QACjB,cAAc;QACd,oBAAoB;QACpB,gBAAgB;QAChB,oBAAoB;QACpB,QAAQ;QACR,mBAAmB;QACnB,yBAAyB;QAEzB,kBAAkB;QAClB,YAAY;QACZ,kBAAkB;QAClB,cAAc;QACd,gBAAgB;QAChB,mBAAmB;QACnB,iBAAiB;QACjB,gBAAgB;QAChB,kBAAkB;QAClB,gBAAgB;QAChB,sBAAsB;QACtB,sBAA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X,OAAO;gBACP,SAAS;;YAGX,OAAO;gBACL,WAAW;gBACX,OAAO;gBACP,SAAS;;YAGX,MAAM;gBACJ,WAAW;gBACX,OAAO;gBACP,SAAS;;YAGX,GAAG;gBACD,WAAW;gBACX,OAAO;gBACP,SAAS;;YAGX,OAAO;gBACL,WAAW;gBACX,OAAO;gBACP,SAAS;;YAGX,MAAM;gBACJ,WAAW;gBACX,OAAO;gBACP,SAAS;;;QAIb,IAAI;YACF,IAAI;YACJ,OAAO;YACP,KAAK;;QAEP,MAAM;YACJ,IAAI;YACJ,aAAa;YACb,gBAAgB;YAChB,QAAQ;YACR,aAAa;YACb,UAAU;;;IAGd,aAAa;QACX,MAAM;QACN,eAAe;QACf,OAAO;QACP,aAAa;QACb,SAAS;QACT,SAAS;QACT,UAAU;QACV,WAAW;QACX,QAAQ;QACR,YAAY;QACZ,GAAG;QACH,KAAK;QACL,QAAQ;QACR,IAAI;QACJ,KAAK;QACL,IAAI;QACJ,WAAW;QACX,UAAU;QACV,KAAK;QACL,IAAI;QACJ,IAAI;QACJ,MAAM;QACN,MAAM;QACN,UAAU;QACV,QAAQ;QACR,gBAAgB;QAChB,QAAQ;QACR,aAAa;QACb,KAAK;QACL,WAAW;QACX,QAAQ;QACR,QAAQ;QACR,OAAO;QACP,iBAAiB;QACjB,OAAO;QACP,KAAK;QACL,OAAO;QACP,OAAO;QACP,MAAM;QACN,KAAK;QACL,aAAa;QACb,UAAU;QACV,WAAW;QACX,YAAY;QACZ,UAAU;;IAEZ,KAAK;QACH,YAAY;QACZ,cAAc;QACd,aAAa;QACb,eAAe;QAEf,WAAW;QACX,MAAM;;CAET,CAAC;eAEa,QAAQ"}
|
|
1
|
+
{"version":3,"file":"default-messages.d.ts","sourceRoot":"","sources":["../../src/localization/default-messages.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,QAAQ;IACZ,aAAa;QACX,QAAQ;;IAEV,IAAI;QACF,aAAa;QACb,mBAAmB;QACnB,KAAK;QACL,KAAK;QAC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