@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.
Files changed (895) hide show
  1. package/corpus/README.md +2 -2
  2. package/corpus/core/CHANGELOG.md +79 -0
  3. package/corpus/core/docs/content/agent-surfaces.mdx +4 -4
  4. package/corpus/core/docs/content/automations.mdx +61 -12
  5. package/corpus/core/docs/content/deployment.mdx +11 -4
  6. package/corpus/core/docs/content/extensions.mdx +39 -33
  7. package/corpus/core/docs/content/recurring-jobs.mdx +41 -19
  8. package/corpus/core/docs/content/template-dispatch-operations.mdx +19 -7
  9. package/corpus/core/package.json +3 -1
  10. package/corpus/core/src/a2a/types.ts +6 -0
  11. package/corpus/core/src/action.ts +68 -0
  12. package/corpus/core/src/agent/engine/builder-engine.ts +8 -4
  13. package/corpus/core/src/agent/production-agent.ts +175 -100
  14. package/corpus/core/src/agent/tool-search.ts +36 -0
  15. package/corpus/core/src/automations/service.ts +506 -0
  16. package/corpus/core/src/browser-context/index.ts +392 -0
  17. package/corpus/core/src/client/AgentPanel.tsx +2 -1
  18. package/corpus/core/src/client/FeedbackButton.tsx +37 -4
  19. package/corpus/core/src/client/MultiTabAssistantChat.tsx +21 -0
  20. package/corpus/core/src/client/agent-chat.ts +31 -3
  21. package/corpus/core/src/client/agent-page/AgentJobsTab.tsx +438 -310
  22. package/corpus/core/src/client/agent-page/AgentTabsPage.tsx +4 -4
  23. package/corpus/core/src/client/agent-page/use-jobs.ts +7 -0
  24. package/corpus/core/src/client/analytics-session.ts +13 -0
  25. package/corpus/core/src/client/extensions/ExtensionViewer.tsx +67 -0
  26. package/corpus/core/src/client/settings/AutomationsSection.tsx +27 -499
  27. package/corpus/core/src/client/settings/SettingsPanel.tsx +32 -11
  28. package/corpus/core/src/client/settings/index.ts +2 -0
  29. package/corpus/core/src/client/use-agent-chat.ts +35 -3
  30. package/corpus/core/src/client/use-chat-threads.ts +8 -25
  31. package/corpus/core/src/deploy/build.ts +2 -0
  32. package/corpus/core/src/deploy/workspace-deploy.ts +2 -0
  33. package/corpus/core/src/extensions/actions.ts +115 -3
  34. package/corpus/core/src/extensions/fetch-tool.ts +11 -0
  35. package/corpus/core/src/extensions/routes.ts +16 -1
  36. package/corpus/core/src/extensions/web-content.ts +96 -1
  37. package/corpus/core/src/integrations/computer-supervision.ts +33 -1
  38. package/corpus/core/src/integrations/index.ts +6 -0
  39. package/corpus/core/src/integrations/integration-durable-dispatch-config.ts +10 -0
  40. package/corpus/core/src/integrations/integration-durable-dispatch.ts +4 -0
  41. package/corpus/core/src/integrations/plugin.ts +94 -41
  42. package/corpus/core/src/integrations/remote-browser-actions.ts +621 -0
  43. package/corpus/core/src/jobs/actions/list-recurring-jobs.ts +5 -7
  44. package/corpus/core/src/jobs/actions/manage-recurring-job.ts +3 -7
  45. package/corpus/core/src/jobs/background-automation-runner.ts +437 -0
  46. package/corpus/core/src/jobs/frontmatter.ts +308 -0
  47. package/corpus/core/src/jobs/scheduler.ts +89 -598
  48. package/corpus/core/src/jobs/tools.ts +22 -3
  49. package/corpus/core/src/localization/default-messages.ts +45 -45
  50. package/corpus/core/src/mcp-client/index.ts +6 -0
  51. package/corpus/core/src/notifications/actions.ts +5 -0
  52. package/corpus/core/src/progress/actions.ts +5 -0
  53. package/corpus/core/src/provider-api/actions/github-repo-files.ts +11 -0
  54. package/corpus/core/src/provider-api/actions/provider-api.ts +13 -0
  55. package/corpus/core/src/server/action-discovery.ts +7 -0
  56. package/corpus/core/src/server/agent-capabilities.ts +43 -8
  57. package/corpus/core/src/server/agent-chat/action-filters-a2a.ts +63 -1
  58. package/corpus/core/src/server/agent-chat/browser-team-tools.ts +126 -3
  59. package/corpus/core/src/server/agent-chat/framework-prompts.ts +7 -11
  60. package/corpus/core/src/server/agent-chat/plugin-options.ts +3 -3
  61. package/corpus/core/src/server/agent-chat/script-entries.ts +52 -1
  62. package/corpus/core/src/server/agent-chat-plugin.ts +25 -5
  63. package/corpus/core/src/server/attribution.ts +22 -0
  64. package/corpus/core/src/server/auth.ts +20 -6
  65. package/corpus/core/src/server/better-auth-instance.ts +10 -2
  66. package/corpus/core/src/server/core-routes-plugin.ts +10 -1
  67. package/corpus/core/src/server/csrf.ts +25 -0
  68. package/corpus/core/src/server/google-oauth.ts +21 -1
  69. package/corpus/core/src/server/onboarding-html.ts +18 -0
  70. package/corpus/core/src/server/prompts/framework-core-compact.ts +3 -3
  71. package/corpus/core/src/server/prompts/framework-core.ts +3 -3
  72. package/corpus/core/src/server/prompts/shared-rules.ts +3 -3
  73. package/corpus/core/src/settings/index.ts +1 -0
  74. package/corpus/core/src/shared/analytics-anonymous-id.ts +35 -0
  75. package/corpus/core/src/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  76. package/corpus/core/src/templates/default/app/i18n/ar-SA.ts +26 -0
  77. package/corpus/core/src/templates/default/app/i18n/de-DE.ts +28 -0
  78. package/corpus/core/src/templates/default/app/i18n/en-US.ts +27 -0
  79. package/corpus/core/src/templates/default/app/i18n/es-ES.ts +28 -0
  80. package/corpus/core/src/templates/default/app/i18n/fr-FR.ts +28 -0
  81. package/corpus/core/src/templates/default/app/i18n/hi-IN.ts +25 -0
  82. package/corpus/core/src/templates/default/app/i18n/ja-JP.ts +27 -0
  83. package/corpus/core/src/templates/default/app/i18n/ko-KR.ts +27 -0
  84. package/corpus/core/src/templates/default/app/i18n/pt-BR.ts +27 -0
  85. package/corpus/core/src/templates/default/app/i18n/zh-CN.ts +24 -0
  86. package/corpus/core/src/templates/default/app/i18n/zh-TW.ts +24 -0
  87. package/corpus/core/src/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  88. package/corpus/core/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  89. package/corpus/core/src/templates/workspace-core/.agents/skills/agent-page/SKILL.md +10 -7
  90. package/corpus/core/src/templates/workspace-core/.agents/skills/automations/SKILL.md +53 -8
  91. package/corpus/core/src/templates/workspace-core/.agents/skills/browser-sessions/SKILL.md +131 -0
  92. package/corpus/core/src/templates/workspace-core/.agents/skills/extension-points/SKILL.md +13 -4
  93. package/corpus/core/src/templates/workspace-core/.agents/skills/extensions/SKILL.md +23 -15
  94. package/corpus/core/src/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +33 -18
  95. package/corpus/core/src/tracking/providers.ts +1 -0
  96. package/corpus/core/src/tracking/registry.ts +2 -1
  97. package/corpus/core/src/tracking/types.ts +1 -0
  98. package/corpus/core/src/triggers/actions/list-automations.ts +43 -44
  99. package/corpus/core/src/triggers/actions/manage-automation.ts +17 -48
  100. package/corpus/core/src/triggers/actions.ts +218 -127
  101. package/corpus/core/src/triggers/dispatcher.ts +181 -367
  102. package/corpus/core/src/triggers/routes.ts +84 -27
  103. package/corpus/core/src/triggers/types.ts +9 -23
  104. package/corpus/templates/analytics/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  105. package/corpus/templates/analytics/AGENTS.md +5 -0
  106. package/corpus/templates/analytics/actions/hubspot-deals.ts +1 -0
  107. package/corpus/templates/analytics/actions/hubspot-records.ts +1 -0
  108. package/corpus/templates/analytics/actions/install-dashboard-template.ts +13 -4
  109. package/corpus/templates/analytics/actions/rename-dashboard.ts +8 -3
  110. package/corpus/templates/analytics/actions/restore-dashboard-revision.ts +8 -3
  111. package/corpus/templates/analytics/actions/update-dashboard.ts +22 -5
  112. package/corpus/templates/analytics/app/components/dashboard/DashboardPanelSkeleton.tsx +7 -1
  113. package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +1 -82
  114. package/corpus/templates/analytics/app/components/layout/NewDashboardDialog.tsx +4 -4
  115. package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +23 -13
  116. package/corpus/templates/analytics/app/global.css +21 -0
  117. package/corpus/templates/analytics/app/i18n-data.ts +165 -101
  118. package/corpus/templates/analytics/app/lib/custom-block-promotion.ts +62 -0
  119. package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +17 -2
  120. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/PanelEditorDialog.tsx +3 -1
  121. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +77 -12
  122. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/dashboard-save-queue.ts +34 -0
  123. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +42 -26
  124. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/types.ts +15 -0
  125. package/corpus/templates/analytics/app/pages/analyses/AnalysisDetail.tsx +1 -1
  126. package/corpus/templates/analytics/changelog/2026-07-29-chat-history-now-closes-smoothly-and-stays-ready-when-you-re.md +6 -0
  127. package/corpus/templates/analytics/changelog/2026-07-29-chat-history-stays-visible-when-you-return-to-the-dashboard.md +6 -0
  128. package/corpus/templates/analytics/changelog/2026-07-29-custom-dashboard-blocks-now-identify-one-off-agent-patches-a.md +6 -0
  129. package/corpus/templates/analytics/changelog/2026-07-29-dashboard-chart-deletions-now-save-in-order-so-removed-rows-.md +6 -0
  130. package/corpus/templates/analytics/changelog/2026-07-29-dashboard-chart-loaders-are-easier-to-see-and-animate-more-s.md +6 -0
  131. package/corpus/templates/analytics/changelog/2026-07-29-plan-mode-can-now-query-connected-analytics-sources-while-ke.md +6 -0
  132. package/corpus/templates/analytics/changelog/2026-07-29-plan-mode-can-use-clips-as-read-only-prompt-context.md +6 -0
  133. package/corpus/templates/analytics/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
  134. package/corpus/templates/analytics/changelog/2026-07-29-signup-entry-pages-now-show-the-first-page-viewed-before-eac.md +6 -0
  135. package/corpus/templates/analytics/seeds/dashboards/agent-native-templates-first-party.json +26 -1
  136. package/corpus/templates/analytics/server/lib/agent-chat-plan-mode.ts +0 -33
  137. package/corpus/templates/analytics/server/lib/analytics-connector-catalog.ts +2 -0
  138. package/corpus/templates/analytics/server/lib/canonical-first-party-dashboard-repair.ts +13 -3
  139. package/corpus/templates/analytics/server/lib/dashboard-catalog.ts +9 -1
  140. package/corpus/templates/analytics/server/lib/first-party-analytics.ts +44 -1
  141. package/corpus/templates/analytics/server/lib/first-party-metric-catalog.ts +96 -16
  142. package/corpus/templates/analytics/server/plugins/agent-chat.ts +18 -27
  143. package/corpus/templates/analytics/server/plugins/core-routes.ts +1 -0
  144. package/corpus/templates/assets/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  145. package/corpus/templates/assets/app/components/layout/Sidebar.tsx +4 -8
  146. package/corpus/templates/assets/changelog/2026-07-29-chat-history-now-closes-smoothly-and-stays-ready-when-you-re.md +6 -0
  147. package/corpus/templates/assets/changelog/2026-07-29-chat-history-stays-visible-when-you-return-to-the-workspace.md +6 -0
  148. package/corpus/templates/assets/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
  149. package/corpus/templates/brain/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  150. package/corpus/templates/brain/app/components/layout/Sidebar.tsx +3 -7
  151. package/corpus/templates/brain/app/root.tsx +0 -3
  152. package/corpus/templates/brain/changelog/2026-07-29-chat-history-now-closes-smoothly-and-stays-ready-when-you-re.md +6 -0
  153. package/corpus/templates/brain/changelog/2026-07-29-chat-history-stays-visible-when-you-return-to-ask-brain.md +6 -0
  154. package/corpus/templates/brain/changelog/2026-07-29-extensions-are-no-longer-shown-as-a-default-command-menu-des.md +6 -0
  155. package/corpus/templates/brain/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
  156. package/corpus/templates/calendar/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  157. package/corpus/templates/calendar/.agents/skills/event-management/SKILL.md +25 -5
  158. package/corpus/templates/calendar/AGENTS.md +5 -0
  159. package/corpus/templates/calendar/actions/create-event.ts +43 -13
  160. package/corpus/templates/calendar/actions/event-action-helpers.ts +131 -1
  161. package/corpus/templates/calendar/actions/get-event.ts +1 -0
  162. package/corpus/templates/calendar/actions/manage-event-draft.ts +65 -2
  163. package/corpus/templates/calendar/app/components/calendar/CreateEventDialog.tsx +438 -258
  164. package/corpus/templates/calendar/app/components/calendar/DayView.tsx +19 -3
  165. package/corpus/templates/calendar/app/components/calendar/EventDetailPanel.tsx +7 -3
  166. package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +14 -19
  167. package/corpus/templates/calendar/app/components/calendar/MonthView.tsx +24 -0
  168. package/corpus/templates/calendar/app/components/calendar/WeekView.tsx +15 -2
  169. package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +1 -5
  170. package/corpus/templates/calendar/app/hooks/use-events.ts +51 -5
  171. package/corpus/templates/calendar/app/i18n-data.ts +50 -0
  172. package/corpus/templates/calendar/app/lib/all-day-layout.ts +9 -2
  173. package/corpus/templates/calendar/app/lib/event-form-initialization.ts +4 -8
  174. package/corpus/templates/calendar/app/lib/event-form-utils.ts +43 -8
  175. package/corpus/templates/calendar/app/lib/location-suggestions.ts +36 -0
  176. package/corpus/templates/calendar/app/lib/out-of-office.ts +87 -1
  177. package/corpus/templates/calendar/app/pages/CalendarView.tsx +82 -20
  178. package/corpus/templates/calendar/changelog/2026-07-26-out-of-office-events-now-default-to-full-days-with-a-ready.md +6 -0
  179. package/corpus/templates/calendar/changelog/2026-07-29-recent-calendar-locations-now-appear-as-address-suggestions-.md +6 -0
  180. package/corpus/templates/calendar/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
  181. package/corpus/templates/calendar/changelog/2026-07-29-unnamed-events-now-use-a-title-placeholder.md +6 -0
  182. package/corpus/templates/calendar/server/lib/find-time.ts +29 -5
  183. package/corpus/templates/calendar/server/lib/google-calendar.ts +2 -0
  184. package/corpus/templates/calendar/server/lib/ical-fetcher.ts +1 -0
  185. package/corpus/templates/calendar/shared/api.ts +4 -0
  186. package/corpus/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  187. package/corpus/templates/chat/app/components/layout/Sidebar.tsx +1 -5
  188. package/corpus/templates/chat/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
  189. package/corpus/templates/clips/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  190. package/corpus/templates/clips/app/components/library/library-layout.tsx +1 -5
  191. package/corpus/templates/clips/changelog/2026-07-29-fixed-system-audio-recordings-picking-up-your-microphone-in-.md +6 -0
  192. package/corpus/templates/clips/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
  193. package/corpus/templates/clips/changelog/2026-07-29-the-desktop-camera-preview-now-closes-after-a-recording-fin.md +6 -0
  194. package/corpus/templates/clips/desktop/src/app.tsx +14 -15
  195. package/corpus/templates/clips/desktop/src/lib/bubble-session.ts +11 -0
  196. package/corpus/templates/clips/desktop/src/lib/recorder.ts +9 -4
  197. package/corpus/templates/clips/desktop/src/lib/transcription-capture.ts +11 -0
  198. package/corpus/templates/clips/server/jobs/transactional-emails.ts +47 -23
  199. package/corpus/templates/clips/server/lib/transactional-email-store.ts +16 -6
  200. package/corpus/templates/content/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  201. package/corpus/templates/content/.agents/skills/content-product-development/SKILL.md +103 -0
  202. package/corpus/templates/content/.agents/skills/content-product-development/references/verification.md +57 -0
  203. package/corpus/templates/content/AGENTS.md +2 -0
  204. package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +1 -6
  205. package/corpus/templates/content/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
  206. package/corpus/templates/content/docs/product/README.md +115 -0
  207. package/corpus/templates/content/docs/product/architecture.md +98 -0
  208. package/corpus/templates/content/docs/product/capabilities/content.access.page-database.md +76 -0
  209. package/corpus/templates/content/docs/product/capabilities/content.access.row-private.md +75 -0
  210. package/corpus/templates/content/docs/product/capabilities/content.access.safe-aggregate.md +75 -0
  211. package/corpus/templates/content/docs/product/capabilities/content.access.visibility-closure.md +79 -0
  212. package/corpus/templates/content/docs/product/capabilities/content.action.button.md +67 -0
  213. package/corpus/templates/content/docs/product/capabilities/content.agent.action-parity.md +73 -0
  214. package/corpus/templates/content/docs/product/capabilities/content.agent.audience-safe.md +91 -0
  215. package/corpus/templates/content/docs/product/capabilities/content.agent.automation.md +67 -0
  216. package/corpus/templates/content/docs/product/capabilities/content.agent.expression-authoring.md +71 -0
  217. package/corpus/templates/content/docs/product/capabilities/content.agent.presence.md +103 -0
  218. package/corpus/templates/content/docs/product/capabilities/content.agent.resource-consent.md +90 -0
  219. package/corpus/templates/content/docs/product/capabilities/content.agent.skill-catalog.md +67 -0
  220. package/corpus/templates/content/docs/product/capabilities/content.api.cms.md +70 -0
  221. package/corpus/templates/content/docs/product/capabilities/content.author.code.md +71 -0
  222. package/corpus/templates/content/docs/product/capabilities/content.author.document-editor.md +71 -0
  223. package/corpus/templates/content/docs/product/capabilities/content.author.footnotes.md +71 -0
  224. package/corpus/templates/content/docs/product/capabilities/content.author.math.md +71 -0
  225. package/corpus/templates/content/docs/product/capabilities/content.author.media.md +71 -0
  226. package/corpus/templates/content/docs/product/capabilities/content.author.mermaid.md +71 -0
  227. package/corpus/templates/content/docs/product/capabilities/content.automation.scheduled.md +67 -0
  228. package/corpus/templates/content/docs/product/capabilities/content.capture.enrich.md +75 -0
  229. package/corpus/templates/content/docs/product/capabilities/content.command.fabric.md +67 -0
  230. package/corpus/templates/content/docs/product/capabilities/content.comment.page-owned.md +75 -0
  231. package/corpus/templates/content/docs/product/capabilities/content.diff.ai-assist.md +75 -0
  232. package/corpus/templates/content/docs/product/capabilities/content.diff.filtered-review.md +79 -0
  233. package/corpus/templates/content/docs/product/capabilities/content.diff.in-place.md +80 -0
  234. package/corpus/templates/content/docs/product/capabilities/content.discussion.page.md +80 -0
  235. package/corpus/templates/content/docs/product/capabilities/content.embed.host-grant.md +70 -0
  236. package/corpus/templates/content/docs/product/capabilities/content.embed.mcp-app.md +69 -0
  237. package/corpus/templates/content/docs/product/capabilities/content.embed.surface.md +74 -0
  238. package/corpus/templates/content/docs/product/capabilities/content.event.committed.md +85 -0
  239. package/corpus/templates/content/docs/product/capabilities/content.expression.cached-result.md +71 -0
  240. package/corpus/templates/content/docs/product/capabilities/content.expression.catalog.md +71 -0
  241. package/corpus/templates/content/docs/product/capabilities/content.expression.language.md +76 -0
  242. package/corpus/templates/content/docs/product/capabilities/content.feedback.signal.md +67 -0
  243. package/corpus/templates/content/docs/product/capabilities/content.form.shared-engine.md +72 -0
  244. package/corpus/templates/content/docs/product/capabilities/content.history.queryable.md +79 -0
  245. package/corpus/templates/content/docs/product/capabilities/content.home.global.md +80 -0
  246. package/corpus/templates/content/docs/product/capabilities/content.job.durable.md +76 -0
  247. package/corpus/templates/content/docs/product/capabilities/content.knowledge.graph.md +67 -0
  248. package/corpus/templates/content/docs/product/capabilities/content.knowledge.links.md +67 -0
  249. package/corpus/templates/content/docs/product/capabilities/content.knowledge.search.md +67 -0
  250. package/corpus/templates/content/docs/product/capabilities/content.layout.responsive.md +80 -0
  251. package/corpus/templates/content/docs/product/capabilities/content.navigation.sidebar.md +86 -0
  252. package/corpus/templates/content/docs/product/capabilities/content.notification.source.md +71 -0
  253. package/corpus/templates/content/docs/product/capabilities/content.object.block.md +76 -0
  254. package/corpus/templates/content/docs/product/capabilities/content.object.blocks-field.md +79 -0
  255. package/corpus/templates/content/docs/product/capabilities/content.object.database.md +92 -0
  256. package/corpus/templates/content/docs/product/capabilities/content.object.multi-membership.md +75 -0
  257. package/corpus/templates/content/docs/product/capabilities/content.object.page.md +76 -0
  258. package/corpus/templates/content/docs/product/capabilities/content.object.reference.md +75 -0
  259. package/corpus/templates/content/docs/product/capabilities/content.object.transclusion.md +75 -0
  260. package/corpus/templates/content/docs/product/capabilities/content.organization.teams.md +71 -0
  261. package/corpus/templates/content/docs/product/capabilities/content.portability.pdf-export.md +78 -0
  262. package/corpus/templates/content/docs/product/capabilities/content.portability.roundtrip.md +154 -0
  263. package/corpus/templates/content/docs/product/capabilities/content.portability.source-representation.md +70 -0
  264. package/corpus/templates/content/docs/product/capabilities/content.portability.vault-export.md +80 -0
  265. package/corpus/templates/content/docs/product/capabilities/content.presentation.mode.md +76 -0
  266. package/corpus/templates/content/docs/product/capabilities/content.preset.catalog.md +71 -0
  267. package/corpus/templates/content/docs/product/capabilities/content.property.actor.md +75 -0
  268. package/corpus/templates/content/docs/product/capabilities/content.property.catalog.md +76 -0
  269. package/corpus/templates/content/docs/product/capabilities/content.property.constraints.md +75 -0
  270. package/corpus/templates/content/docs/product/capabilities/content.property.guarded-change.md +76 -0
  271. package/corpus/templates/content/docs/product/capabilities/content.property.location.md +71 -0
  272. package/corpus/templates/content/docs/product/capabilities/content.property.typed.md +71 -0
  273. package/corpus/templates/content/docs/product/capabilities/content.publish.public.md +75 -0
  274. package/corpus/templates/content/docs/product/capabilities/content.publish.reading.md +74 -0
  275. package/corpus/templates/content/docs/product/capabilities/content.query.object.md +114 -0
  276. package/corpus/templates/content/docs/product/capabilities/content.reader.documents.md +69 -0
  277. package/corpus/templates/content/docs/product/capabilities/content.reader.surface.md +75 -0
  278. package/corpus/templates/content/docs/product/capabilities/content.relationship.edge.md +183 -0
  279. package/corpus/templates/content/docs/product/capabilities/content.renderer.artifact-block.md +71 -0
  280. package/corpus/templates/content/docs/product/capabilities/content.renderer.custom-block.md +81 -0
  281. package/corpus/templates/content/docs/product/capabilities/content.renderer.graph.md +71 -0
  282. package/corpus/templates/content/docs/product/capabilities/content.renderer.typed.md +92 -0
  283. package/corpus/templates/content/docs/product/capabilities/content.research.annotation.md +75 -0
  284. package/corpus/templates/content/docs/product/capabilities/content.research.citation.md +70 -0
  285. package/corpus/templates/content/docs/product/capabilities/content.review.code.md +67 -0
  286. package/corpus/templates/content/docs/product/capabilities/content.revision.suggestions.md +76 -0
  287. package/corpus/templates/content/docs/product/capabilities/content.rule.deterministic.md +79 -0
  288. package/corpus/templates/content/docs/product/capabilities/content.schedule.constraints.md +81 -0
  289. package/corpus/templates/content/docs/product/capabilities/content.security.private-vault.md +71 -0
  290. package/corpus/templates/content/docs/product/capabilities/content.share.views.md +140 -0
  291. package/corpus/templates/content/docs/product/capabilities/content.source.adapters.md +154 -0
  292. package/corpus/templates/content/docs/product/capabilities/content.source.builder-codec.md +70 -0
  293. package/corpus/templates/content/docs/product/capabilities/content.source.catalog.md +149 -0
  294. package/corpus/templates/content/docs/product/capabilities/content.source.file-folder.md +71 -0
  295. package/corpus/templates/content/docs/product/capabilities/content.source.local-bridge.md +156 -0
  296. package/corpus/templates/content/docs/product/capabilities/content.source.local-project.md +70 -0
  297. package/corpus/templates/content/docs/product/capabilities/content.source.page-link.md +70 -0
  298. package/corpus/templates/content/docs/product/capabilities/content.source.row-union.md +69 -0
  299. package/corpus/templates/content/docs/product/capabilities/content.source.spaces-files.md +75 -0
  300. package/corpus/templates/content/docs/product/capabilities/content.source.sync-policy.md +161 -0
  301. package/corpus/templates/content/docs/product/capabilities/content.system.dependencies.md +80 -0
  302. package/corpus/templates/content/docs/product/capabilities/content.system.my-tasks.md +75 -0
  303. package/corpus/templates/content/docs/product/capabilities/content.system.project-status.md +77 -0
  304. package/corpus/templates/content/docs/product/capabilities/content.system.research-workspace.md +80 -0
  305. package/corpus/templates/content/docs/product/capabilities/content.system.task-project.md +76 -0
  306. package/corpus/templates/content/docs/product/capabilities/content.template.governance.md +76 -0
  307. package/corpus/templates/content/docs/product/capabilities/content.template.graph.md +76 -0
  308. package/corpus/templates/content/docs/product/capabilities/content.template.item-body.md +71 -0
  309. package/corpus/templates/content/docs/product/capabilities/content.template.update.md +71 -0
  310. package/corpus/templates/content/docs/product/capabilities/content.time.types.md +85 -0
  311. package/corpus/templates/content/docs/product/capabilities/content.version.branching.md +151 -0
  312. package/corpus/templates/content/docs/product/capabilities/content.version.field-history.md +103 -0
  313. package/corpus/templates/content/docs/product/capabilities/content.view.canvas.md +94 -0
  314. package/corpus/templates/content/docs/product/capabilities/content.view.chart.md +91 -0
  315. package/corpus/templates/content/docs/product/capabilities/content.view.dynamic-create.md +137 -0
  316. package/corpus/templates/content/docs/product/capabilities/content.view.fast-capture.md +82 -0
  317. package/corpus/templates/content/docs/product/capabilities/content.view.graph.md +95 -0
  318. package/corpus/templates/content/docs/product/capabilities/content.view.grouping-aggregation.md +83 -0
  319. package/corpus/templates/content/docs/product/capabilities/content.view.map.md +77 -0
  320. package/corpus/templates/content/docs/product/capabilities/content.view.personal-state.md +99 -0
  321. package/corpus/templates/content/docs/product/capabilities/content.view.pivot.md +76 -0
  322. package/corpus/templates/content/docs/product/capabilities/content.view.query.md +106 -0
  323. package/corpus/templates/content/docs/product/capabilities/content.view.renderer-conformance.md +77 -0
  324. package/corpus/templates/content/docs/product/capabilities/content.view.scale.md +77 -0
  325. package/corpus/templates/content/docs/product/capabilities/content.view.source-query.md +159 -0
  326. package/corpus/templates/content/docs/product/capabilities/content.view.timeline.md +86 -0
  327. package/corpus/templates/content/docs/product/capabilities/content.view.tree.md +77 -0
  328. package/corpus/templates/content/docs/product/capabilities/content.workspace.multi-scope.md +80 -0
  329. package/corpus/templates/content/docs/product/capabilities/content.workspace.session-restore.md +76 -0
  330. package/corpus/templates/content/docs/product/capabilities/content.workspace.view-instance.md +76 -0
  331. package/corpus/templates/content/docs/product/capabilities/content.workspace.working-set.md +77 -0
  332. package/corpus/templates/content/docs/product/chapters/content.chapter.capture-research.md +20 -0
  333. package/corpus/templates/content/docs/product/chapters/content.chapter.connected-sources.md +20 -0
  334. package/corpus/templates/content/docs/product/chapters/content.chapter.consensus.md +19 -0
  335. package/corpus/templates/content/docs/product/chapters/content.chapter.durable-home.md +21 -0
  336. package/corpus/templates/content/docs/product/chapters/content.chapter.publishing-portability.md +21 -0
  337. package/corpus/templates/content/docs/product/chapters/content.chapter.working-systems.md +27 -0
  338. package/corpus/templates/content/docs/product/encyclopedia.md +559 -0
  339. package/corpus/templates/content/docs/product/features/content.feature.bring-your-local-work.md +39 -0
  340. package/corpus/templates/content/docs/product/features/content.feature.build-living-dashboards.md +34 -0
  341. package/corpus/templates/content/docs/product/features/content.feature.build-new-surfaces.md +33 -0
  342. package/corpus/templates/content/docs/product/features/content.feature.capture-into-action.md +34 -0
  343. package/corpus/templates/content/docs/product/features/content.feature.cite-what-you-found.md +34 -0
  344. package/corpus/templates/content/docs/product/features/content.feature.collaborate-in-context.md +59 -0
  345. package/corpus/templates/content/docs/product/features/content.feature.collect-structured-input.md +38 -0
  346. package/corpus/templates/content/docs/product/features/content.feature.connect-your-sources.md +38 -0
  347. package/corpus/templates/content/docs/product/features/content.feature.data-that-keeps-itself-right.md +45 -0
  348. package/corpus/templates/content/docs/product/features/content.feature.durable-foundations.md +48 -0
  349. package/corpus/templates/content/docs/product/features/content.feature.evolve-systems-safely.md +38 -0
  350. package/corpus/templates/content/docs/product/features/content.feature.explore-alternatives-safely.md +39 -0
  351. package/corpus/templates/content/docs/product/features/content.feature.find-your-place-again.md +40 -0
  352. package/corpus/templates/content/docs/product/features/content.feature.keep-your-private-vault-private.md +39 -0
  353. package/corpus/templates/content/docs/product/features/content.feature.living-references.md +38 -0
  354. package/corpus/templates/content/docs/product/features/content.feature.make-the-workspace-yours.md +40 -0
  355. package/corpus/templates/content/docs/product/features/content.feature.move-without-starting-over.md +38 -0
  356. package/corpus/templates/content/docs/product/features/content.feature.plan-work-across-time.md +39 -0
  357. package/corpus/templates/content/docs/product/features/content.feature.publish-with-confidence.md +43 -0
  358. package/corpus/templates/content/docs/product/features/content.feature.put-your-organizations-know-how-to-work.md +38 -0
  359. package/corpus/templates/content/docs/product/features/content.feature.read-and-annotate-anything.md +38 -0
  360. package/corpus/templates/content/docs/product/features/content.feature.review-changes-in-place.md +39 -0
  361. package/corpus/templates/content/docs/product/features/content.feature.run-projects-your-way.md +44 -0
  362. package/corpus/templates/content/docs/product/features/content.feature.see-your-information-your-way.md +44 -0
  363. package/corpus/templates/content/docs/product/features/content.feature.share-how-your-organization-works.md +38 -0
  364. package/corpus/templates/content/docs/product/features/content.feature.sketch-connections-keep-whats-true.md +39 -0
  365. package/corpus/templates/content/docs/product/features/content.feature.take-the-whole-vault-with-you.md +39 -0
  366. package/corpus/templates/content/docs/product/features/content.feature.trust-your-connected-sources.md +40 -0
  367. package/corpus/templates/content/docs/product/features/content.feature.understand-what-your-data-says.md +39 -0
  368. package/corpus/templates/content/docs/product/features/content.feature.when-this-happens-that-follows.md +43 -0
  369. package/corpus/templates/content/docs/product/features/content.feature.work-across-every-workspace.md +37 -0
  370. package/corpus/templates/content/docs/product/features/content.feature.work-on-content-inside-another-application.md +37 -0
  371. package/corpus/templates/content/docs/product/roadmap.md +878 -0
  372. package/corpus/templates/crm/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  373. package/corpus/templates/crm/app/components/layout/CrmSidebar.tsx +1 -7
  374. package/corpus/templates/crm/app/i18n/en-US.ts +4 -0
  375. package/corpus/templates/crm/app/routes/settings.tsx +33 -8
  376. package/corpus/templates/crm/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
  377. package/corpus/templates/design/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  378. package/corpus/templates/design/.generated/bridge/editor-chrome.generated.ts +133 -63
  379. package/corpus/templates/design/.generated/bridge/embedded-wheel.generated.ts +19 -2
  380. package/corpus/templates/design/app/components/design/DesignCanvas.tsx +51 -14
  381. package/corpus/templates/design/app/components/design/DesignExtensionsPanel.tsx +41 -26
  382. package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +22 -4
  383. package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +216 -116
  384. package/corpus/templates/design/app/components/design/bridge/embedded-wheel.bridge.ts +21 -2
  385. package/corpus/templates/design/app/components/design/code-workbench/CodeWorkbench.tsx +5 -1
  386. package/corpus/templates/design/app/components/design/code-workbench/CodeWorkbenchLoader.tsx +10 -2
  387. package/corpus/templates/design/app/components/design/code-workbench/code-workbench-shell.ts +2 -0
  388. package/corpus/templates/design/app/components/design/code-workbench/explorer/ExplorerView.tsx +60 -55
  389. package/corpus/templates/design/app/components/design/design-canvas/content-size-report.ts +88 -2
  390. package/corpus/templates/design/app/components/design/multi-screen/board-surface-html.ts +3 -2
  391. package/corpus/templates/design/app/components/design/types.ts +4 -0
  392. package/corpus/templates/design/app/components/layout/Sidebar.tsx +1 -5
  393. package/corpus/templates/design/app/pages/design-editor/clipboard-layer-source.ts +28 -0
  394. package/corpus/templates/design/app/pages/design-editor/clone-and-pen-edit.ts +117 -0
  395. package/corpus/templates/design/app/pages/design-editor/code-layer-state.ts +3 -1
  396. package/corpus/templates/design/app/pages/design-editor/pending-edits.ts +120 -74
  397. package/corpus/templates/design/app/pages/design-editor/pending-structure-verification.ts +11 -0
  398. package/corpus/templates/design/app/pages/design-editor/react-semantic-handoff.ts +2 -0
  399. package/corpus/templates/design/app/pages/design-editor/source-location.ts +1 -1
  400. package/corpus/templates/design/changelog/2026-07-29-copy-rendered-ui-between-live-local-apps-and-design-files-wh.md +6 -0
  401. package/corpus/templates/design/changelog/2026-07-29-design-boards-stay-dark-and-viewport-height-content-keeps-it.md +6 -0
  402. package/corpus/templates/design/changelog/2026-07-29-design-frames-no-longer-grow-continuously-when-their-content.md +6 -0
  403. package/corpus/templates/design/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
  404. package/corpus/templates/design/changelog/2026-07-29-the-code-panel-and-apply-design-update-control-now-use-clear.md +6 -0
  405. package/corpus/templates/design/changelog/2026-07-29-the-tools-panel-now-keeps-extension-creation-and-discovery-h.md +6 -0
  406. package/corpus/templates/design/shared/source-mode.ts +7 -1
  407. package/corpus/templates/dispatch/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  408. package/corpus/templates/dispatch/app/i18n-data.ts +171 -0
  409. package/corpus/templates/dispatch/app/routes/browser-chat.tsx +4 -0
  410. package/corpus/templates/dispatch/app/routes/browser-connect.tsx +4 -0
  411. package/corpus/templates/dispatch/changelog/2026-07-29-browser-chat-can-securely-connect-the-agent-native-chrome-ex.md +6 -0
  412. package/corpus/templates/forms/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  413. package/corpus/templates/forms/app/components/layout/Sidebar.tsx +1 -6
  414. package/corpus/templates/forms/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
  415. package/corpus/templates/macros/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  416. package/corpus/templates/macros/app/components/layout/AppLayout.tsx +1 -5
  417. package/corpus/templates/macros/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
  418. package/corpus/templates/mail/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  419. package/corpus/templates/mail/app/components/layout/AppLayout.tsx +1 -9
  420. package/corpus/templates/mail/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
  421. package/corpus/templates/plan/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  422. package/corpus/templates/plan/app/components/layout/Sidebar.tsx +3 -7
  423. package/corpus/templates/plan/app/pages/PlansPage.tsx +2 -2
  424. package/corpus/templates/plan/changelog/2026-07-29-chat-history-now-closes-smoothly-and-stays-ready-when-you-re.md +6 -0
  425. package/corpus/templates/plan/changelog/2026-07-29-chat-history-stays-visible-when-you-return-to-ask-plan.md +6 -0
  426. package/corpus/templates/plan/changelog/2026-07-29-fixed-plan-pages-crashing-when-recent-activity-is-unavailabl.md +6 -0
  427. package/corpus/templates/plan/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
  428. package/corpus/templates/slides/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  429. package/corpus/templates/slides/.agents/skills/analytics-data-for-decks/SKILL.md +48 -0
  430. package/corpus/templates/slides/.agents/skills/create-deck/SKILL.md +60 -4
  431. package/corpus/templates/slides/.agents/skills/design-systems/SKILL.md +20 -0
  432. package/corpus/templates/slides/.agents/skills/slide-editing/SKILL.md +30 -1
  433. package/corpus/templates/slides/.agents/skills/slide-images/SKILL.md +3 -1
  434. package/corpus/templates/slides/AGENTS.md +25 -24
  435. package/corpus/templates/slides/actions/check-image-gen.ts +8 -2
  436. package/corpus/templates/slides/actions/create-deck.ts +4 -12
  437. package/corpus/templates/slides/actions/export-pptx.ts +25 -3
  438. package/corpus/templates/slides/actions/generate-image-api.ts +4 -2
  439. package/corpus/templates/slides/actions/generate-slides-ai.ts +1 -1
  440. package/corpus/templates/slides/actions/get-deck-reference-context.ts +136 -0
  441. package/corpus/templates/slides/actions/get-workspace-defaults.ts +55 -0
  442. package/corpus/templates/slides/actions/image-gen-status.ts +10 -1
  443. package/corpus/templates/slides/actions/import-file.ts +53 -38
  444. package/corpus/templates/slides/actions/list-decks.ts +2 -0
  445. package/corpus/templates/slides/actions/patch-deck.ts +2 -0
  446. package/corpus/templates/slides/actions/set-workspace-defaults.ts +50 -0
  447. package/corpus/templates/slides/actions/view-screen.ts +6 -0
  448. package/corpus/templates/slides/app/components/comments/SlideCommentsPanel.tsx +1 -1
  449. package/corpus/templates/slides/app/components/deck/DeckCard.tsx +67 -3
  450. package/corpus/templates/slides/app/components/deck/SlideRenderer.tsx +40 -8
  451. package/corpus/templates/slides/app/components/design-system/DesignSystemCard.tsx +33 -8
  452. package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +6 -2
  453. package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +114 -128
  454. package/corpus/templates/slides/app/components/editor/ExportMenu.tsx +74 -9
  455. package/corpus/templates/slides/app/components/editor/ImageGenPanel.tsx +1 -1
  456. package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +1193 -267
  457. package/corpus/templates/slides/app/components/editor/SlideStyleInspector.tsx +302 -102
  458. package/corpus/templates/slides/app/components/editor/rich-text-selection.ts +270 -0
  459. package/corpus/templates/slides/app/components/editor/slide-escape-arbiter.ts +34 -0
  460. package/corpus/templates/slides/app/components/editor/slide-object-interactions.ts +368 -0
  461. package/corpus/templates/slides/app/components/editor/slide-presence.ts +13 -0
  462. package/corpus/templates/slides/app/components/layout/AgentWorkIndicator.tsx +23 -3
  463. package/corpus/templates/slides/app/components/layout/Layout.tsx +39 -6
  464. package/corpus/templates/slides/app/components/layout/Sidebar.tsx +1 -6
  465. package/corpus/templates/slides/app/components/layout/layout-route-policy.ts +23 -0
  466. package/corpus/templates/slides/app/components/visual-editor/DrawOverlay.tsx +0 -2
  467. package/corpus/templates/slides/app/context/DeckContext.tsx +2 -0
  468. package/corpus/templates/slides/app/global.css +60 -0
  469. package/corpus/templates/slides/app/hooks/use-agent-generating.ts +76 -5
  470. package/corpus/templates/slides/app/hooks/use-workspace-defaults.ts +26 -0
  471. package/corpus/templates/slides/app/i18n/en-US.ts +39 -3
  472. package/corpus/templates/slides/app/lib/generation-state.ts +13 -3
  473. package/corpus/templates/slides/app/lib/slide-image-replacement.ts +27 -6
  474. package/corpus/templates/slides/app/lib/text-tool-shortcut.ts +62 -0
  475. package/corpus/templates/slides/app/pages/DeckEditor.tsx +197 -83
  476. package/corpus/templates/slides/app/pages/DesignSystems.tsx +95 -0
  477. package/corpus/templates/slides/app/pages/Index.tsx +348 -53
  478. package/corpus/templates/slides/changelog/2026-07-28-pick-an-existing-deck-as-a-style-reference-when-creating-a-n.md +6 -0
  479. package/corpus/templates/slides/changelog/2026-07-29-ai-editing-status-is-now-quieter-and-only-shows-slide-presen.md +6 -0
  480. package/corpus/templates/slides/changelog/2026-07-29-design-systems-and-reference-decks-are-easier-to-choose-toge.md +6 -0
  481. package/corpus/templates/slides/changelog/2026-07-29-generated-decks-now-receive-a-concise-relevant-title-before-.md +6 -0
  482. package/corpus/templates/slides/changelog/2026-07-29-google-slides-exports-can-connect-your-google-account-direct.md +6 -0
  483. package/corpus/templates/slides/changelog/2026-07-29-new-deck-prompts-reuse-empty-chats.md +6 -0
  484. package/corpus/templates/slides/changelog/2026-07-29-new-deck-setup-now-stays-in-the-editor-with-closable-style-a.md +6 -0
  485. package/corpus/templates/slides/changelog/2026-07-29-selected-words-and-text-runs-can-now-be-styled-independently.md +6 -0
  486. package/corpus/templates/slides/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
  487. package/corpus/templates/slides/changelog/2026-07-29-slide-annotation-tools-are-clearer-and-escape-now-exits-anno.md +6 -0
  488. package/corpus/templates/slides/changelog/2026-07-29-slide-editing-now-opens-with-the-app-navigation-collapsed-fo.md +6 -0
  489. package/corpus/templates/slides/changelog/2026-07-29-slide-editing-stays-visually-clean-on-hover-without-a-canvas.md +6 -0
  490. package/corpus/templates/slides/changelog/2026-07-29-slides-now-appear-one-by-one-while-ai-builds-a-deck-with-ste.md +6 -0
  491. package/corpus/templates/slides/changelog/2026-07-29-text-boxes-now-select-move-duplicate-resize-and-style-like-a.md +6 -0
  492. package/corpus/templates/slides/changelog/2026-07-29-untitled-decks-now-use-a-clearer-this-deck-label-in-the-agen.md +6 -0
  493. package/corpus/templates/slides/server/handlers/google-docs-auth.ts +4 -2
  494. package/corpus/templates/slides/server/handlers/image-providers/builder.ts +305 -0
  495. package/corpus/templates/slides/server/handlers/image-providers/index.ts +6 -3
  496. package/corpus/templates/slides/server/plugins/agent-chat.ts +1 -0
  497. package/corpus/templates/slides/server/workspace-defaults.ts +169 -0
  498. package/corpus/templates/tasks/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  499. package/corpus/templates/tasks/app/components/layout/Sidebar.tsx +31 -8
  500. package/corpus/templates/tasks/app/i18n/en-US.ts +7 -0
  501. package/corpus/templates/tasks/app/routes/settings.tsx +25 -2
  502. package/corpus/templates/tasks/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
  503. package/corpus/toolkit/CHANGELOG.md +15 -0
  504. package/corpus/toolkit/README.md +2 -2
  505. package/corpus/toolkit/package.json +1 -1
  506. package/corpus/toolkit/src/app-shell/sidebar-footer-actions.tsx +0 -3
  507. package/corpus/toolkit/src/chat-history.css +1 -0
  508. package/corpus/toolkit/src/composer/ComposerPlusMenu.tsx +35 -14
  509. package/corpus/toolkit/src/composer/PromptComposer.tsx +6 -0
  510. package/corpus/toolkit/src/composer/TiptapComposer.tsx +11 -3
  511. package/corpus/toolkit/src/design-tweaks/visual-style-controls.tsx +64 -11
  512. package/dist/a2a/types.d.ts +6 -0
  513. package/dist/a2a/types.d.ts.map +1 -1
  514. package/dist/a2a/types.js.map +1 -1
  515. package/dist/action.d.ts +57 -0
  516. package/dist/action.d.ts.map +1 -1
  517. package/dist/action.js +9 -0
  518. package/dist/action.js.map +1 -1
  519. package/dist/agent/engine/builder-engine.js +6 -4
  520. package/dist/agent/engine/builder-engine.js.map +1 -1
  521. package/dist/agent/production-agent.d.ts +11 -1
  522. package/dist/agent/production-agent.d.ts.map +1 -1
  523. package/dist/agent/production-agent.js +131 -90
  524. package/dist/agent/production-agent.js.map +1 -1
  525. package/dist/agent/tool-search.d.ts +4 -0
  526. package/dist/agent/tool-search.d.ts.map +1 -1
  527. package/dist/agent/tool-search.js +30 -0
  528. package/dist/agent/tool-search.js.map +1 -1
  529. package/dist/automations/service.d.ts +85 -0
  530. package/dist/automations/service.d.ts.map +1 -0
  531. package/dist/automations/service.js +332 -0
  532. package/dist/automations/service.js.map +1 -0
  533. package/dist/browser-context/index.d.ts +579 -0
  534. package/dist/browser-context/index.d.ts.map +1 -0
  535. package/dist/browser-context/index.js +331 -0
  536. package/dist/browser-context/index.js.map +1 -0
  537. package/dist/client/AgentPanel.d.ts.map +1 -1
  538. package/dist/client/AgentPanel.js +1 -1
  539. package/dist/client/AgentPanel.js.map +1 -1
  540. package/dist/client/FeedbackButton.d.ts +6 -2
  541. package/dist/client/FeedbackButton.d.ts.map +1 -1
  542. package/dist/client/FeedbackButton.js +20 -3
  543. package/dist/client/FeedbackButton.js.map +1 -1
  544. package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
  545. package/dist/client/MultiTabAssistantChat.js +19 -2
  546. package/dist/client/MultiTabAssistantChat.js.map +1 -1
  547. package/dist/client/agent-chat.d.ts +15 -0
  548. package/dist/client/agent-chat.d.ts.map +1 -1
  549. package/dist/client/agent-chat.js +13 -3
  550. package/dist/client/agent-chat.js.map +1 -1
  551. package/dist/client/agent-page/AgentJobsTab.d.ts +1 -0
  552. package/dist/client/agent-page/AgentJobsTab.d.ts.map +1 -1
  553. package/dist/client/agent-page/AgentJobsTab.js +186 -98
  554. package/dist/client/agent-page/AgentJobsTab.js.map +1 -1
  555. package/dist/client/agent-page/AgentTabsPage.js +4 -4
  556. package/dist/client/agent-page/AgentTabsPage.js.map +1 -1
  557. package/dist/client/agent-page/use-jobs.d.ts +7 -0
  558. package/dist/client/agent-page/use-jobs.d.ts.map +1 -1
  559. package/dist/client/agent-page/use-jobs.js.map +1 -1
  560. package/dist/client/analytics-session.d.ts.map +1 -1
  561. package/dist/client/analytics-session.js +13 -0
  562. package/dist/client/analytics-session.js.map +1 -1
  563. package/dist/client/extensions/ExtensionViewer.d.ts.map +1 -1
  564. package/dist/client/extensions/ExtensionViewer.js +29 -6
  565. package/dist/client/extensions/ExtensionViewer.js.map +1 -1
  566. package/dist/client/settings/AutomationsSection.d.ts +0 -9
  567. package/dist/client/settings/AutomationsSection.d.ts.map +1 -1
  568. package/dist/client/settings/AutomationsSection.js +9 -168
  569. package/dist/client/settings/AutomationsSection.js.map +1 -1
  570. package/dist/client/settings/SettingsPanel.d.ts +9 -1
  571. package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
  572. package/dist/client/settings/SettingsPanel.js +19 -11
  573. package/dist/client/settings/SettingsPanel.js.map +1 -1
  574. package/dist/client/settings/index.d.ts +1 -1
  575. package/dist/client/settings/index.d.ts.map +1 -1
  576. package/dist/client/settings/index.js +1 -1
  577. package/dist/client/settings/index.js.map +1 -1
  578. package/dist/client/use-agent-chat.d.ts.map +1 -1
  579. package/dist/client/use-agent-chat.js +20 -3
  580. package/dist/client/use-agent-chat.js.map +1 -1
  581. package/dist/client/use-chat-threads.d.ts.map +1 -1
  582. package/dist/client/use-chat-threads.js +4 -17
  583. package/dist/client/use-chat-threads.js.map +1 -1
  584. package/dist/collab/awareness.d.ts +2 -2
  585. package/dist/collab/awareness.d.ts.map +1 -1
  586. package/dist/collab/struct-routes.d.ts +1 -1
  587. package/dist/deploy/build.d.ts.map +1 -1
  588. package/dist/deploy/build.js +2 -1
  589. package/dist/deploy/build.js.map +1 -1
  590. package/dist/deploy/workspace-deploy.d.ts.map +1 -1
  591. package/dist/deploy/workspace-deploy.js +2 -1
  592. package/dist/deploy/workspace-deploy.js.map +1 -1
  593. package/dist/extensions/actions.d.ts.map +1 -1
  594. package/dist/extensions/actions.js +82 -6
  595. package/dist/extensions/actions.js.map +1 -1
  596. package/dist/extensions/fetch-tool.d.ts.map +1 -1
  597. package/dist/extensions/fetch-tool.js +11 -0
  598. package/dist/extensions/fetch-tool.js.map +1 -1
  599. package/dist/extensions/routes.d.ts +5 -1
  600. package/dist/extensions/routes.d.ts.map +1 -1
  601. package/dist/extensions/routes.js +7 -1
  602. package/dist/extensions/routes.js.map +1 -1
  603. package/dist/extensions/web-content.d.ts +1 -0
  604. package/dist/extensions/web-content.d.ts.map +1 -1
  605. package/dist/extensions/web-content.js +82 -1
  606. package/dist/extensions/web-content.js.map +1 -1
  607. package/dist/file-upload/actions/upload-image.d.ts +1 -1
  608. package/dist/integrations/computer-supervision.d.ts.map +1 -1
  609. package/dist/integrations/computer-supervision.js +22 -1
  610. package/dist/integrations/computer-supervision.js.map +1 -1
  611. package/dist/integrations/index.d.ts +3 -2
  612. package/dist/integrations/index.d.ts.map +1 -1
  613. package/dist/integrations/index.js +3 -2
  614. package/dist/integrations/index.js.map +1 -1
  615. package/dist/integrations/integration-durable-dispatch-config.d.ts +2 -0
  616. package/dist/integrations/integration-durable-dispatch-config.d.ts.map +1 -1
  617. package/dist/integrations/integration-durable-dispatch-config.js +4 -0
  618. package/dist/integrations/integration-durable-dispatch-config.js.map +1 -1
  619. package/dist/integrations/integration-durable-dispatch.d.ts +2 -2
  620. package/dist/integrations/integration-durable-dispatch.d.ts.map +1 -1
  621. package/dist/integrations/integration-durable-dispatch.js +2 -2
  622. package/dist/integrations/integration-durable-dispatch.js.map +1 -1
  623. package/dist/integrations/plugin.d.ts.map +1 -1
  624. package/dist/integrations/plugin.js +84 -39
  625. package/dist/integrations/plugin.js.map +1 -1
  626. package/dist/integrations/remote-browser-actions.d.ts +7 -0
  627. package/dist/integrations/remote-browser-actions.d.ts.map +1 -0
  628. package/dist/integrations/remote-browser-actions.js +482 -0
  629. package/dist/integrations/remote-browser-actions.js.map +1 -0
  630. package/dist/jobs/actions/list-recurring-jobs.d.ts.map +1 -1
  631. package/dist/jobs/actions/list-recurring-jobs.js +4 -6
  632. package/dist/jobs/actions/list-recurring-jobs.js.map +1 -1
  633. package/dist/jobs/actions/manage-recurring-job.js +3 -6
  634. package/dist/jobs/actions/manage-recurring-job.js.map +1 -1
  635. package/dist/jobs/background-automation-runner.d.ts +76 -0
  636. package/dist/jobs/background-automation-runner.d.ts.map +1 -0
  637. package/dist/jobs/background-automation-runner.js +288 -0
  638. package/dist/jobs/background-automation-runner.js.map +1 -0
  639. package/dist/jobs/frontmatter.d.ts +63 -0
  640. package/dist/jobs/frontmatter.d.ts.map +1 -0
  641. package/dist/jobs/frontmatter.js +216 -0
  642. package/dist/jobs/frontmatter.js.map +1 -0
  643. package/dist/jobs/scheduler.d.ts +6 -60
  644. package/dist/jobs/scheduler.d.ts.map +1 -1
  645. package/dist/jobs/scheduler.js +67 -484
  646. package/dist/jobs/scheduler.js.map +1 -1
  647. package/dist/jobs/tools.d.ts.map +1 -1
  648. package/dist/jobs/tools.js +24 -3
  649. package/dist/jobs/tools.js.map +1 -1
  650. package/dist/localization/default-messages.d.ts +28 -33
  651. package/dist/localization/default-messages.d.ts.map +1 -1
  652. package/dist/localization/default-messages.js +34 -39
  653. package/dist/localization/default-messages.js.map +1 -1
  654. package/dist/mcp/screen-memory-stdio.d.ts +7 -7
  655. package/dist/mcp/screen-memory-stdio.d.ts.map +1 -1
  656. package/dist/mcp-client/index.d.ts.map +1 -1
  657. package/dist/mcp-client/index.js +4 -0
  658. package/dist/mcp-client/index.js.map +1 -1
  659. package/dist/notifications/actions.d.ts.map +1 -1
  660. package/dist/notifications/actions.js +5 -0
  661. package/dist/notifications/actions.js.map +1 -1
  662. package/dist/notifications/routes.d.ts +3 -3
  663. package/dist/progress/actions.d.ts.map +1 -1
  664. package/dist/progress/actions.js +5 -0
  665. package/dist/progress/actions.js.map +1 -1
  666. package/dist/provider-api/actions/custom-provider-registration.d.ts +14 -14
  667. package/dist/provider-api/actions/github-repo-files.d.ts.map +1 -1
  668. package/dist/provider-api/actions/github-repo-files.js +9 -0
  669. package/dist/provider-api/actions/github-repo-files.js.map +1 -1
  670. package/dist/provider-api/actions/provider-api.d.ts +16 -16
  671. package/dist/provider-api/actions/provider-api.d.ts.map +1 -1
  672. package/dist/provider-api/actions/provider-api.js +14 -0
  673. package/dist/provider-api/actions/provider-api.js.map +1 -1
  674. package/dist/provider-api/corpus-jobs.d.ts +2 -2
  675. package/dist/resources/handlers.d.ts +1 -1
  676. package/dist/server/action-discovery.d.ts.map +1 -1
  677. package/dist/server/action-discovery.js +5 -0
  678. package/dist/server/action-discovery.js.map +1 -1
  679. package/dist/server/agent-capabilities.d.ts.map +1 -1
  680. package/dist/server/agent-capabilities.js +32 -3
  681. package/dist/server/agent-capabilities.js.map +1 -1
  682. package/dist/server/agent-chat/action-filters-a2a.d.ts +17 -1
  683. package/dist/server/agent-chat/action-filters-a2a.d.ts.map +1 -1
  684. package/dist/server/agent-chat/action-filters-a2a.js +50 -1
  685. package/dist/server/agent-chat/action-filters-a2a.js.map +1 -1
  686. package/dist/server/agent-chat/browser-team-tools.d.ts.map +1 -1
  687. package/dist/server/agent-chat/browser-team-tools.js +90 -3
  688. package/dist/server/agent-chat/browser-team-tools.js.map +1 -1
  689. package/dist/server/agent-chat/framework-prompts.d.ts.map +1 -1
  690. package/dist/server/agent-chat/framework-prompts.js +7 -11
  691. package/dist/server/agent-chat/framework-prompts.js.map +1 -1
  692. package/dist/server/agent-chat/plugin-options.d.ts +3 -3
  693. package/dist/server/agent-chat/plugin-options.js.map +1 -1
  694. package/dist/server/agent-chat/script-entries.d.ts.map +1 -1
  695. package/dist/server/agent-chat/script-entries.js +43 -1
  696. package/dist/server/agent-chat/script-entries.js.map +1 -1
  697. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  698. package/dist/server/agent-chat-plugin.js +24 -5
  699. package/dist/server/agent-chat-plugin.js.map +1 -1
  700. package/dist/server/attribution.d.ts +6 -0
  701. package/dist/server/attribution.d.ts.map +1 -1
  702. package/dist/server/attribution.js +14 -14
  703. package/dist/server/attribution.js.map +1 -1
  704. package/dist/server/auth.d.ts.map +1 -1
  705. package/dist/server/auth.js +5 -2
  706. package/dist/server/auth.js.map +1 -1
  707. package/dist/server/better-auth-instance.d.ts +2 -1
  708. package/dist/server/better-auth-instance.d.ts.map +1 -1
  709. package/dist/server/better-auth-instance.js +6 -3
  710. package/dist/server/better-auth-instance.js.map +1 -1
  711. package/dist/server/core-routes-plugin.d.ts +7 -0
  712. package/dist/server/core-routes-plugin.d.ts.map +1 -1
  713. package/dist/server/core-routes-plugin.js +3 -1
  714. package/dist/server/core-routes-plugin.js.map +1 -1
  715. package/dist/server/csrf.d.ts.map +1 -1
  716. package/dist/server/csrf.js +25 -0
  717. package/dist/server/csrf.js.map +1 -1
  718. package/dist/server/google-oauth.d.ts +3 -0
  719. package/dist/server/google-oauth.d.ts.map +1 -1
  720. package/dist/server/google-oauth.js +12 -1
  721. package/dist/server/google-oauth.js.map +1 -1
  722. package/dist/server/onboarding-html.d.ts.map +1 -1
  723. package/dist/server/onboarding-html.js +18 -0
  724. package/dist/server/onboarding-html.js.map +1 -1
  725. package/dist/server/prompts/framework-core-compact.js +3 -3
  726. package/dist/server/prompts/framework-core-compact.js.map +1 -1
  727. package/dist/server/prompts/framework-core.js +3 -3
  728. package/dist/server/prompts/framework-core.js.map +1 -1
  729. package/dist/server/prompts/shared-rules.js +3 -3
  730. package/dist/server/prompts/shared-rules.js.map +1 -1
  731. package/dist/settings/index.d.ts +1 -1
  732. package/dist/settings/index.d.ts.map +1 -1
  733. package/dist/settings/index.js +1 -1
  734. package/dist/settings/index.js.map +1 -1
  735. package/dist/shared/analytics-anonymous-id.d.ts +12 -0
  736. package/dist/shared/analytics-anonymous-id.d.ts.map +1 -0
  737. package/dist/shared/analytics-anonymous-id.js +29 -0
  738. package/dist/shared/analytics-anonymous-id.js.map +1 -0
  739. package/dist/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  740. package/dist/templates/chat/app/components/layout/Sidebar.tsx +1 -5
  741. package/dist/templates/chat/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
  742. package/dist/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  743. package/dist/templates/default/app/i18n/ar-SA.ts +26 -0
  744. package/dist/templates/default/app/i18n/de-DE.ts +28 -0
  745. package/dist/templates/default/app/i18n/en-US.ts +27 -0
  746. package/dist/templates/default/app/i18n/es-ES.ts +28 -0
  747. package/dist/templates/default/app/i18n/fr-FR.ts +28 -0
  748. package/dist/templates/default/app/i18n/hi-IN.ts +25 -0
  749. package/dist/templates/default/app/i18n/ja-JP.ts +27 -0
  750. package/dist/templates/default/app/i18n/ko-KR.ts +27 -0
  751. package/dist/templates/default/app/i18n/pt-BR.ts +27 -0
  752. package/dist/templates/default/app/i18n/zh-CN.ts +24 -0
  753. package/dist/templates/default/app/i18n/zh-TW.ts +24 -0
  754. package/dist/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  755. package/dist/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  756. package/dist/templates/workspace-core/.agents/skills/agent-page/SKILL.md +10 -7
  757. package/dist/templates/workspace-core/.agents/skills/automations/SKILL.md +53 -8
  758. package/dist/templates/workspace-core/.agents/skills/browser-sessions/SKILL.md +131 -0
  759. package/dist/templates/workspace-core/.agents/skills/extension-points/SKILL.md +13 -4
  760. package/dist/templates/workspace-core/.agents/skills/extensions/SKILL.md +23 -15
  761. package/dist/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +33 -18
  762. package/dist/tracking/providers.d.ts.map +1 -1
  763. package/dist/tracking/providers.js +1 -0
  764. package/dist/tracking/providers.js.map +1 -1
  765. package/dist/tracking/registry.d.ts +1 -0
  766. package/dist/tracking/registry.d.ts.map +1 -1
  767. package/dist/tracking/registry.js +1 -0
  768. package/dist/tracking/registry.js.map +1 -1
  769. package/dist/tracking/types.d.ts +1 -0
  770. package/dist/tracking/types.d.ts.map +1 -1
  771. package/dist/tracking/types.js.map +1 -1
  772. package/dist/triggers/actions/list-automations.d.ts +7 -0
  773. package/dist/triggers/actions/list-automations.d.ts.map +1 -1
  774. package/dist/triggers/actions/list-automations.js +29 -41
  775. package/dist/triggers/actions/list-automations.js.map +1 -1
  776. package/dist/triggers/actions/manage-automation.js +15 -33
  777. package/dist/triggers/actions/manage-automation.js.map +1 -1
  778. package/dist/triggers/actions.d.ts.map +1 -1
  779. package/dist/triggers/actions.js +184 -95
  780. package/dist/triggers/actions.js.map +1 -1
  781. package/dist/triggers/dispatcher.d.ts +3 -9
  782. package/dist/triggers/dispatcher.d.ts.map +1 -1
  783. package/dist/triggers/dispatcher.js +134 -304
  784. package/dist/triggers/dispatcher.js.map +1 -1
  785. package/dist/triggers/routes.d.ts.map +1 -1
  786. package/dist/triggers/routes.js +76 -17
  787. package/dist/triggers/routes.js.map +1 -1
  788. package/dist/triggers/types.d.ts +4 -23
  789. package/dist/triggers/types.d.ts.map +1 -1
  790. package/dist/triggers/types.js.map +1 -1
  791. package/docs/content/agent-surfaces.mdx +4 -4
  792. package/docs/content/automations.mdx +61 -12
  793. package/docs/content/deployment.mdx +11 -4
  794. package/docs/content/extensions.mdx +39 -33
  795. package/docs/content/recurring-jobs.mdx +41 -19
  796. package/docs/content/template-dispatch-operations.mdx +19 -7
  797. package/package.json +4 -2
  798. package/src/a2a/types.ts +6 -0
  799. package/src/action.ts +68 -0
  800. package/src/agent/engine/builder-engine.ts +8 -4
  801. package/src/agent/production-agent.ts +175 -100
  802. package/src/agent/tool-search.ts +36 -0
  803. package/src/automations/service.ts +506 -0
  804. package/src/browser-context/index.ts +392 -0
  805. package/src/client/AgentPanel.tsx +2 -1
  806. package/src/client/FeedbackButton.tsx +37 -4
  807. package/src/client/MultiTabAssistantChat.tsx +21 -0
  808. package/src/client/agent-chat.ts +31 -3
  809. package/src/client/agent-page/AgentJobsTab.tsx +438 -310
  810. package/src/client/agent-page/AgentTabsPage.tsx +4 -4
  811. package/src/client/agent-page/use-jobs.ts +7 -0
  812. package/src/client/analytics-session.ts +13 -0
  813. package/src/client/extensions/ExtensionViewer.tsx +67 -0
  814. package/src/client/settings/AutomationsSection.tsx +27 -499
  815. package/src/client/settings/SettingsPanel.tsx +32 -11
  816. package/src/client/settings/index.ts +2 -0
  817. package/src/client/use-agent-chat.ts +35 -3
  818. package/src/client/use-chat-threads.ts +8 -25
  819. package/src/deploy/build.ts +2 -0
  820. package/src/deploy/workspace-deploy.ts +2 -0
  821. package/src/extensions/actions.ts +115 -3
  822. package/src/extensions/fetch-tool.ts +11 -0
  823. package/src/extensions/routes.ts +16 -1
  824. package/src/extensions/web-content.ts +96 -1
  825. package/src/integrations/computer-supervision.ts +33 -1
  826. package/src/integrations/index.ts +6 -0
  827. package/src/integrations/integration-durable-dispatch-config.ts +10 -0
  828. package/src/integrations/integration-durable-dispatch.ts +4 -0
  829. package/src/integrations/plugin.ts +94 -41
  830. package/src/integrations/remote-browser-actions.ts +621 -0
  831. package/src/jobs/actions/list-recurring-jobs.ts +5 -7
  832. package/src/jobs/actions/manage-recurring-job.ts +3 -7
  833. package/src/jobs/background-automation-runner.ts +437 -0
  834. package/src/jobs/frontmatter.ts +308 -0
  835. package/src/jobs/scheduler.ts +89 -598
  836. package/src/jobs/tools.ts +22 -3
  837. package/src/localization/default-messages.ts +45 -45
  838. package/src/mcp-client/index.ts +6 -0
  839. package/src/notifications/actions.ts +5 -0
  840. package/src/progress/actions.ts +5 -0
  841. package/src/provider-api/actions/github-repo-files.ts +11 -0
  842. package/src/provider-api/actions/provider-api.ts +13 -0
  843. package/src/server/__snapshots__/agent-chat-plugin.surface.spec.ts.snap +4 -4
  844. package/src/server/action-discovery.ts +7 -0
  845. package/src/server/agent-capabilities.ts +43 -8
  846. package/src/server/agent-chat/action-filters-a2a.ts +63 -1
  847. package/src/server/agent-chat/browser-team-tools.ts +126 -3
  848. package/src/server/agent-chat/framework-prompts.ts +7 -11
  849. package/src/server/agent-chat/plugin-options.ts +3 -3
  850. package/src/server/agent-chat/script-entries.ts +52 -1
  851. package/src/server/agent-chat-plugin.ts +25 -5
  852. package/src/server/attribution.ts +22 -0
  853. package/src/server/auth.ts +20 -6
  854. package/src/server/better-auth-instance.ts +10 -2
  855. package/src/server/core-routes-plugin.ts +10 -1
  856. package/src/server/csrf.ts +25 -0
  857. package/src/server/google-oauth.ts +21 -1
  858. package/src/server/onboarding-html.ts +18 -0
  859. package/src/server/prompts/framework-core-compact.ts +3 -3
  860. package/src/server/prompts/framework-core.ts +3 -3
  861. package/src/server/prompts/shared-rules.ts +3 -3
  862. package/src/settings/index.ts +1 -0
  863. package/src/shared/analytics-anonymous-id.ts +35 -0
  864. package/src/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  865. package/src/templates/chat/app/components/layout/Sidebar.tsx +1 -5
  866. package/src/templates/chat/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
  867. package/src/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  868. package/src/templates/default/app/i18n/ar-SA.ts +26 -0
  869. package/src/templates/default/app/i18n/de-DE.ts +28 -0
  870. package/src/templates/default/app/i18n/en-US.ts +27 -0
  871. package/src/templates/default/app/i18n/es-ES.ts +28 -0
  872. package/src/templates/default/app/i18n/fr-FR.ts +28 -0
  873. package/src/templates/default/app/i18n/hi-IN.ts +25 -0
  874. package/src/templates/default/app/i18n/ja-JP.ts +27 -0
  875. package/src/templates/default/app/i18n/ko-KR.ts +27 -0
  876. package/src/templates/default/app/i18n/pt-BR.ts +27 -0
  877. package/src/templates/default/app/i18n/zh-CN.ts +24 -0
  878. package/src/templates/default/app/i18n/zh-TW.ts +24 -0
  879. package/src/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  880. package/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  881. package/src/templates/workspace-core/.agents/skills/agent-page/SKILL.md +10 -7
  882. package/src/templates/workspace-core/.agents/skills/automations/SKILL.md +53 -8
  883. package/src/templates/workspace-core/.agents/skills/browser-sessions/SKILL.md +131 -0
  884. package/src/templates/workspace-core/.agents/skills/extension-points/SKILL.md +13 -4
  885. package/src/templates/workspace-core/.agents/skills/extensions/SKILL.md +23 -15
  886. package/src/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +33 -18
  887. package/src/tracking/providers.ts +1 -0
  888. package/src/tracking/registry.ts +2 -1
  889. package/src/tracking/types.ts +1 -0
  890. package/src/triggers/actions/list-automations.ts +43 -44
  891. package/src/triggers/actions/manage-automation.ts +17 -48
  892. package/src/triggers/actions.ts +218 -127
  893. package/src/triggers/dispatcher.ts +181 -367
  894. package/src/triggers/routes.ts +84 -27
  895. package/src/triggers/types.ts +9 -23
@@ -0,0 +1,7 @@
1
+ import type { ActionEntry } from "../agent/production-agent.js";
2
+ export interface CreateRemoteBrowserActionEntriesOptions {
3
+ getOwnerEmail: () => string | null | undefined;
4
+ getOrgId?: () => string | null | undefined;
5
+ }
6
+ export declare function createRemoteBrowserActionEntries(options: CreateRemoteBrowserActionEntriesOptions): Record<string, ActionEntry>;
7
+ //# sourceMappingURL=remote-browser-actions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-browser-actions.d.ts","sourceRoot":"","sources":["../../src/integrations/remote-browser-actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAsDhE,MAAM,WAAW,uCAAuC;IACtD,aAAa,EAAE,MAAM,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC/C,QAAQ,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CAC5C;AAoZD,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,uCAAuC,GAC/C,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CA6J7B"}
@@ -0,0 +1,482 @@
1
+ import { createComputerApprovalRequest, decideComputerApproval, } from "./computer-supervision-store.js";
2
+ import { computeComputerActionHash, computerOperationRequiresApproval, } from "./computer-supervision.js";
3
+ import { enqueueComputerCommand, getRemoteCommand, } from "./remote-commands-store.js";
4
+ import { getRemoteComputerCapabilities, listRemoteDevicesForOwner, } from "./remote-devices-store.js";
5
+ const REMOTE_DEVICE_ONLINE_MS = 90_000;
6
+ const COMMAND_WAIT_MS = 20_000;
7
+ const COMMAND_POLL_MS = 250;
8
+ const CONTROL_ACTIONS = new Set([
9
+ "attach",
10
+ "click",
11
+ "type",
12
+ "key",
13
+ "navigate",
14
+ "scroll",
15
+ ]);
16
+ const BROWSER_KEYS = new Set([
17
+ "ArrowDown",
18
+ "ArrowLeft",
19
+ "ArrowRight",
20
+ "ArrowUp",
21
+ "Backspace",
22
+ "Delete",
23
+ "End",
24
+ "Enter",
25
+ "Escape",
26
+ "Home",
27
+ "PageDown",
28
+ "PageUp",
29
+ "Space",
30
+ "Tab",
31
+ ]);
32
+ const BROWSER_MODIFIERS = new Set(["alt", "control", "meta", "shift"]);
33
+ function requireOwner(options) {
34
+ const owner = options.getOwnerEmail()?.trim();
35
+ if (!owner) {
36
+ throw new Error("No authenticated user is available for remote browser control");
37
+ }
38
+ return owner;
39
+ }
40
+ function currentOrg(options) {
41
+ return options.getOrgId?.() ?? null;
42
+ }
43
+ function isOnline(device) {
44
+ return (device.status === "active" &&
45
+ device.lastSeenAt !== null &&
46
+ Date.now() - device.lastSeenAt <= REMOTE_DEVICE_ONLINE_MS);
47
+ }
48
+ function browserSessionMetadata(device) {
49
+ const value = device.metadata?.browserSession;
50
+ if (!value || typeof value !== "object" || Array.isArray(value))
51
+ return null;
52
+ const record = value;
53
+ if (typeof record.handle !== "string" || !record.handle.trim())
54
+ return null;
55
+ return {
56
+ handle: record.handle.trim(),
57
+ ...(typeof record.origin === "string" && record.origin
58
+ ? { origin: record.origin }
59
+ : {}),
60
+ ...(typeof record.title === "string" && record.title
61
+ ? { title: record.title }
62
+ : {}),
63
+ };
64
+ }
65
+ async function listBrowserDevices(options) {
66
+ const ownerEmail = requireOwner(options);
67
+ return (await listRemoteDevicesForOwner({
68
+ ownerEmail,
69
+ orgId: currentOrg(options),
70
+ status: "active",
71
+ })).filter((device) => isOnline(device) &&
72
+ Boolean(getRemoteComputerCapabilities(device)?.browser?.observe));
73
+ }
74
+ async function resolveBrowserDevice(options, args, mode) {
75
+ const devices = (await listBrowserDevices(options)).filter((device) => getRemoteComputerCapabilities(device)?.browser?.[mode] === true);
76
+ const requestedDeviceId = readString(args, "deviceId");
77
+ const sessionHandle = readString(args, "sessionHandle");
78
+ const matches = devices.filter((device) => {
79
+ if (requestedDeviceId && device.id !== requestedDeviceId)
80
+ return false;
81
+ if (sessionHandle &&
82
+ browserSessionMetadata(device)?.handle !== sessionHandle) {
83
+ return false;
84
+ }
85
+ return true;
86
+ });
87
+ if (matches.length === 1)
88
+ return matches[0];
89
+ if (matches.length === 0) {
90
+ throw new Error(sessionHandle
91
+ ? "That browser session is no longer connected. Re-open the Agent Native side panel on the page."
92
+ : `No online browser device advertises browser.${mode}. Open Agent Native for Chrome and grant page access first.`);
93
+ }
94
+ throw new Error("More than one browser session is connected. Pass the sessionHandle shown by list-remote-browser-devices.");
95
+ }
96
+ function readString(args, key) {
97
+ const value = args[key];
98
+ return typeof value === "string" && value.trim() ? value.trim() : undefined;
99
+ }
100
+ function readNumber(args, key, fallback = 0) {
101
+ const value = Number(args[key] ?? fallback);
102
+ if (!Number.isFinite(value))
103
+ throw new Error(`${key} must be a number`);
104
+ return value;
105
+ }
106
+ function requireSessionHandle(args) {
107
+ const value = readString(args, "sessionHandle");
108
+ if (!value)
109
+ throw new Error("sessionHandle is required");
110
+ return value;
111
+ }
112
+ function requireObservationTarget(args) {
113
+ const observationId = readString(args, "observationId");
114
+ const backendNodeId = Number(args.backendNodeId);
115
+ if (!observationId ||
116
+ !Number.isSafeInteger(backendNodeId) ||
117
+ backendNodeId < 0) {
118
+ throw new Error("observationId and a non-negative backendNodeId are required");
119
+ }
120
+ return { observationId, backendNodeId };
121
+ }
122
+ function buildReadAction(args) {
123
+ const action = readString(args, "action") ?? "read";
124
+ if (action === "read") {
125
+ return {
126
+ type: "browser.read",
127
+ target: { sessionHandle: requireSessionHandle(args) },
128
+ input: {},
129
+ };
130
+ }
131
+ if (action === "observe") {
132
+ return {
133
+ type: "browser.observe",
134
+ target: null,
135
+ input: {
136
+ maxNodes: Math.max(1, Math.min(Math.trunc(readNumber(args, "maxNodes", 400)), 1_000)),
137
+ },
138
+ };
139
+ }
140
+ throw new Error("Read action must be read or observe");
141
+ }
142
+ function buildControlAction(args) {
143
+ const action = readString(args, "action");
144
+ if (!action || (!CONTROL_ACTIONS.has(action) && action !== "stop")) {
145
+ throw new Error("Control action must be attach, click, type, key, navigate, scroll, or stop");
146
+ }
147
+ if (action === "attach") {
148
+ return {
149
+ type: "browser.attach",
150
+ target: { sessionHandle: requireSessionHandle(args) },
151
+ input: {},
152
+ };
153
+ }
154
+ if (action === "click") {
155
+ return {
156
+ type: "browser.click",
157
+ target: requireObservationTarget(args),
158
+ input: {
159
+ button: args.button === "middle" || args.button === "right"
160
+ ? args.button
161
+ : "left",
162
+ },
163
+ };
164
+ }
165
+ if (action === "type") {
166
+ const text = typeof args.text === "string" ? args.text : null;
167
+ if (text === null || text.length > 100_000) {
168
+ throw new Error("text is required and must not exceed 100,000 chars");
169
+ }
170
+ return {
171
+ type: "browser.type",
172
+ target: requireObservationTarget(args),
173
+ input: { text, replace: args.replace === true },
174
+ };
175
+ }
176
+ if (action === "key") {
177
+ const key = readString(args, "key");
178
+ if (!key || !BROWSER_KEYS.has(key)) {
179
+ throw new Error("key must be a supported browser key");
180
+ }
181
+ const modifiers = Array.isArray(args.modifiers)
182
+ ? args.modifiers.filter((value) => typeof value === "string" && BROWSER_MODIFIERS.has(value))
183
+ : [];
184
+ if (Array.isArray(args.modifiers) &&
185
+ modifiers.length !== args.modifiers.length) {
186
+ throw new Error("modifiers contains an unsupported browser modifier");
187
+ }
188
+ return {
189
+ type: "browser.key",
190
+ target: null,
191
+ input: { key, modifiers },
192
+ };
193
+ }
194
+ if (action === "navigate") {
195
+ const url = readString(args, "url");
196
+ if (!url)
197
+ throw new Error("url is required");
198
+ return {
199
+ type: "browser.navigate",
200
+ target: null,
201
+ input: { url },
202
+ };
203
+ }
204
+ if (action === "scroll") {
205
+ return {
206
+ type: "browser.scroll",
207
+ target: null,
208
+ input: {
209
+ deltaX: readNumber(args, "deltaX"),
210
+ deltaY: readNumber(args, "deltaY"),
211
+ ...(args.x === undefined ? {} : { x: readNumber(args, "x") }),
212
+ ...(args.y === undefined ? {} : { y: readNumber(args, "y") }),
213
+ },
214
+ };
215
+ }
216
+ return { type: "browser.stop", target: null, input: {} };
217
+ }
218
+ function sequenceNumber() {
219
+ const random = new Uint16Array(1);
220
+ globalThis.crypto.getRandomValues(random);
221
+ return Date.now() * 1_000 + (random[0] % 1_000);
222
+ }
223
+ function actionRunId(args, context) {
224
+ return (context?.threadId ??
225
+ context?.runId ??
226
+ readString(args, "sessionHandle") ??
227
+ `browser-${globalThis.crypto.randomUUID()}`).slice(0, 200);
228
+ }
229
+ async function createEnvelope(input) {
230
+ const now = Date.now();
231
+ const sequence = sequenceNumber();
232
+ const runId = actionRunId(input.args, input.context);
233
+ const envelope = {
234
+ version: 1,
235
+ taskId: (readString(input.args, "sessionHandle") ??
236
+ input.context?.threadId ??
237
+ runId).slice(0, 200),
238
+ runId,
239
+ sequence,
240
+ idempotencyKey: `browser-${sequence}-${globalThis.crypto.randomUUID()}`.slice(0, 200),
241
+ operationClass: input.operationClass,
242
+ action: input.action,
243
+ approval: {
244
+ id: null,
245
+ scope: "once",
246
+ actionHash: "0".repeat(64),
247
+ },
248
+ issuedAt: now,
249
+ leaseExpiresAt: now + 2 * 60_000,
250
+ };
251
+ envelope.approval.actionHash = await computeComputerActionHash(envelope);
252
+ return envelope;
253
+ }
254
+ async function bindApprovedControl(input) {
255
+ if (!computerOperationRequiresApproval(input.envelope.operationClass)) {
256
+ return input.envelope;
257
+ }
258
+ if (!input.approvedToolCallKey) {
259
+ throw new Error("Browser control requires human approval");
260
+ }
261
+ const pending = await createComputerApprovalRequest(input);
262
+ const approved = await decideComputerApproval({
263
+ id: pending.id,
264
+ ownerEmail: input.ownerEmail,
265
+ orgId: input.orgId,
266
+ actionHash: input.envelope.approval.actionHash,
267
+ decision: "approved",
268
+ decidedBy: input.ownerEmail,
269
+ result: { source: "agent-tool-approval" },
270
+ });
271
+ if (!approved)
272
+ throw new Error("Browser control approval expired");
273
+ return {
274
+ ...input.envelope,
275
+ approval: { ...input.envelope.approval, id: approved.id },
276
+ };
277
+ }
278
+ async function waitForCommand(command, signal) {
279
+ const deadline = Date.now() + COMMAND_WAIT_MS;
280
+ let current = command;
281
+ while (Date.now() < deadline &&
282
+ current.status !== "completed" &&
283
+ current.status !== "failed" &&
284
+ !signal?.aborted) {
285
+ await new Promise((resolve) => setTimeout(resolve, COMMAND_POLL_MS));
286
+ current = (await getRemoteCommand(command.id)) ?? current;
287
+ }
288
+ return current;
289
+ }
290
+ async function enqueueBrowserAction(input) {
291
+ const mode = input.operationClass.endsWith(".control")
292
+ ? "control"
293
+ : "observe";
294
+ const device = await resolveBrowserDevice(input.options, input.args, mode);
295
+ const ownerEmail = requireOwner(input.options);
296
+ const orgId = currentOrg(input.options);
297
+ let envelope = await createEnvelope(input);
298
+ envelope = await bindApprovedControl({
299
+ ownerEmail,
300
+ orgId,
301
+ deviceId: device.id,
302
+ envelope,
303
+ approvedToolCallKey: input.context?.approvedToolCallKey,
304
+ });
305
+ const command = await enqueueComputerCommand({
306
+ deviceId: device.id,
307
+ ownerEmail,
308
+ orgId,
309
+ envelope,
310
+ platform: "browser",
311
+ });
312
+ const settled = await waitForCommand(command, input.context?.signal);
313
+ return {
314
+ ok: settled.status === "completed",
315
+ commandId: settled.id,
316
+ status: settled.status,
317
+ ...(settled.result === null ? {} : { result: settled.result }),
318
+ ...(settled.errorMessage ? { error: settled.errorMessage } : {}),
319
+ };
320
+ }
321
+ const deviceSelectorProperties = {
322
+ sessionHandle: {
323
+ type: "string",
324
+ description: "Opaque browser session handle staged by the Chrome side panel or returned by list-remote-browser-devices.",
325
+ },
326
+ deviceId: {
327
+ type: "string",
328
+ description: "Optional remote device id. Usually omit this and select by sessionHandle.",
329
+ },
330
+ };
331
+ export function createRemoteBrowserActionEntries(options) {
332
+ return {
333
+ "list-remote-browser-devices": {
334
+ readOnly: true,
335
+ tool: {
336
+ description: "List online Agent Native Chrome sessions. Use the opaque sessionHandle to read or control the page; never ask the user for a Chrome tab id.",
337
+ parameters: {
338
+ type: "object",
339
+ properties: {},
340
+ additionalProperties: false,
341
+ },
342
+ },
343
+ run: async () => ({
344
+ ok: true,
345
+ sessions: (await listBrowserDevices(options)).map((device) => {
346
+ const capabilities = getRemoteComputerCapabilities(device)?.browser;
347
+ const session = browserSessionMetadata(device);
348
+ return {
349
+ deviceId: device.id,
350
+ sessionHandle: session?.handle ?? null,
351
+ title: session?.title ?? null,
352
+ origin: session?.origin ?? null,
353
+ canRead: capabilities?.observe === true,
354
+ canControl: capabilities?.control === true,
355
+ lastSeenAt: device.lastSeenAt,
356
+ };
357
+ }),
358
+ }),
359
+ },
360
+ "read-remote-browser-page": {
361
+ readOnly: true,
362
+ timeoutMs: 30_000,
363
+ tool: {
364
+ description: "Read a granted Chrome page or observe the currently attached control lease. Use read for bounded page context; use observe after attach to get interactive targets.",
365
+ parameters: {
366
+ type: "object",
367
+ properties: {
368
+ ...deviceSelectorProperties,
369
+ action: { type: "string", enum: ["read", "observe"] },
370
+ maxNodes: {
371
+ type: "number",
372
+ description: "Maximum accessibility nodes for observe.",
373
+ },
374
+ },
375
+ required: ["action"],
376
+ additionalProperties: false,
377
+ },
378
+ },
379
+ run: async (args, context) => enqueueBrowserAction({
380
+ options,
381
+ args,
382
+ context,
383
+ action: buildReadAction(args),
384
+ operationClass: "browser.observe",
385
+ }),
386
+ },
387
+ "control-remote-browser": {
388
+ timeoutMs: 30_000,
389
+ needsApproval: (args) => args.action !== "stop",
390
+ tool: {
391
+ description: "Attach to and control a user-granted Chrome page. Attach once per conversation before observing or acting. Targets must come from the latest observation. Control actions require inline user approval.",
392
+ parameters: {
393
+ type: "object",
394
+ properties: {
395
+ ...deviceSelectorProperties,
396
+ action: {
397
+ type: "string",
398
+ enum: [
399
+ "attach",
400
+ "click",
401
+ "type",
402
+ "key",
403
+ "navigate",
404
+ "scroll",
405
+ "stop",
406
+ ],
407
+ },
408
+ observationId: { type: "string" },
409
+ backendNodeId: { type: "number" },
410
+ button: {
411
+ type: "string",
412
+ enum: ["left", "middle", "right"],
413
+ },
414
+ text: { type: "string" },
415
+ replace: { type: "boolean" },
416
+ key: { type: "string", enum: Array.from(BROWSER_KEYS) },
417
+ modifiers: {
418
+ type: "array",
419
+ items: { type: "string", enum: Array.from(BROWSER_MODIFIERS) },
420
+ },
421
+ url: { type: "string" },
422
+ deltaX: { type: "number" },
423
+ deltaY: { type: "number" },
424
+ x: { type: "number" },
425
+ y: { type: "number" },
426
+ },
427
+ required: ["action"],
428
+ additionalProperties: false,
429
+ },
430
+ },
431
+ run: async (args, context) => {
432
+ const action = buildControlAction(args);
433
+ return enqueueBrowserAction({
434
+ options,
435
+ args,
436
+ context,
437
+ action,
438
+ operationClass: action.type === "browser.stop"
439
+ ? "browser.observe"
440
+ : "browser.control",
441
+ });
442
+ },
443
+ },
444
+ "get-remote-browser-command": {
445
+ readOnly: true,
446
+ tool: {
447
+ description: "Check a queued remote browser command when a previous browser tool returned before the extension completed it.",
448
+ parameters: {
449
+ type: "object",
450
+ properties: {
451
+ commandId: { type: "string" },
452
+ },
453
+ required: ["commandId"],
454
+ additionalProperties: false,
455
+ },
456
+ },
457
+ run: async (args) => {
458
+ const commandId = readString(args, "commandId");
459
+ if (!commandId)
460
+ throw new Error("commandId is required");
461
+ const command = await getRemoteCommand(commandId);
462
+ const ownerEmail = requireOwner(options);
463
+ const orgId = currentOrg(options);
464
+ if (!command ||
465
+ command.ownerEmail !== ownerEmail ||
466
+ command.orgId !== orgId ||
467
+ command.kind !== "computer-operation" ||
468
+ !command.computerOperation?.operationClass.startsWith("browser.")) {
469
+ throw new Error("Remote browser command was not found");
470
+ }
471
+ return {
472
+ ok: command.status === "completed",
473
+ commandId: command.id,
474
+ status: command.status,
475
+ ...(command.result === null ? {} : { result: command.result }),
476
+ ...(command.errorMessage ? { error: command.errorMessage } : {}),
477
+ };
478
+ },
479
+ },
480
+ };
481
+ }
482
+ //# sourceMappingURL=remote-browser-actions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-browser-actions.js","sourceRoot":"","sources":["../../src/integrations/remote-browser-actions.ts"],"names":[],"mappings":"AACA,OAAO,EACL,6BAA6B,EAC7B,sBAAsB,GACvB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,yBAAyB,EACzB,iCAAiC,GAClC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,6BAA6B,EAC7B,yBAAyB,GAC1B,MAAM,2BAA2B,CAAC;AASnC,MAAM,uBAAuB,GAAG,MAAM,CAAC;AACvC,MAAM,eAAe,GAAG,MAAM,CAAC;AAC/B,MAAM,eAAe,GAAG,GAAG,CAAC;AAC5B,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC;IAC9B,QAAQ;IACR,OAAO;IACP,MA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AC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;iBACjE,CAAC;YACJ,CAAC;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { ActionEntry } from \"../agent/production-agent.js\";\nimport {\n createComputerApprovalRequest,\n decideComputerApproval,\n} from \"./computer-supervision-store.js\";\nimport {\n computeComputerActionHash,\n computerOperationRequiresApproval,\n} from \"./computer-supervision.js\";\nimport {\n enqueueComputerCommand,\n getRemoteCommand,\n} from \"./remote-commands-store.js\";\nimport {\n getRemoteComputerCapabilities,\n listRemoteDevicesForOwner,\n} from \"./remote-devices-store.js\";\nimport type {\n ComputerCommandAction,\n ComputerCommandEnvelope,\n ComputerOperationClass,\n RemoteCommand,\n RemoteDevice,\n} from \"./remote-types.js\";\n\nconst REMOTE_DEVICE_ONLINE_MS = 90_000;\nconst COMMAND_WAIT_MS = 20_000;\nconst COMMAND_POLL_MS = 250;\nconst CONTROL_ACTIONS = new Set([\n \"attach\",\n \"click\",\n \"type\",\n \"key\",\n \"navigate\",\n \"scroll\",\n]);\nconst BROWSER_KEYS = new Set([\n \"ArrowDown\",\n \"ArrowLeft\",\n \"ArrowRight\",\n \"ArrowUp\",\n \"Backspace\",\n \"Delete\",\n \"End\",\n \"Enter\",\n \"Escape\",\n \"Home\",\n \"PageDown\",\n \"PageUp\",\n \"Space\",\n \"Tab\",\n]);\nconst BROWSER_MODIFIERS = new Set([\"alt\", \"control\", \"meta\", \"shift\"]);\n\nexport interface CreateRemoteBrowserActionEntriesOptions {\n getOwnerEmail: () => string | null | undefined;\n getOrgId?: () => string | null | undefined;\n}\n\ninterface RemoteBrowserSessionMetadata {\n handle: string;\n origin?: string;\n title?: string;\n}\n\nfunction requireOwner(\n options: CreateRemoteBrowserActionEntriesOptions,\n): string {\n const owner = options.getOwnerEmail()?.trim();\n if (!owner) {\n throw new Error(\n \"No authenticated user is available for remote browser control\",\n );\n }\n return owner;\n}\n\nfunction currentOrg(\n options: CreateRemoteBrowserActionEntriesOptions,\n): string | null {\n return options.getOrgId?.() ?? null;\n}\n\nfunction isOnline(device: RemoteDevice): boolean {\n return (\n device.status === \"active\" &&\n device.lastSeenAt !== null &&\n Date.now() - device.lastSeenAt <= REMOTE_DEVICE_ONLINE_MS\n );\n}\n\nfunction browserSessionMetadata(\n device: RemoteDevice,\n): RemoteBrowserSessionMetadata | null {\n const value = device.metadata?.browserSession;\n if (!value || typeof value !== \"object\" || Array.isArray(value)) return null;\n const record = value as Record<string, unknown>;\n if (typeof record.handle !== \"string\" || !record.handle.trim()) return null;\n return {\n handle: record.handle.trim(),\n ...(typeof record.origin === \"string\" && record.origin\n ? { origin: record.origin }\n : {}),\n ...(typeof record.title === \"string\" && record.title\n ? { title: record.title }\n : {}),\n };\n}\n\nasync function listBrowserDevices(\n options: CreateRemoteBrowserActionEntriesOptions,\n): Promise<RemoteDevice[]> {\n const ownerEmail = requireOwner(options);\n return (\n await listRemoteDevicesForOwner({\n ownerEmail,\n orgId: currentOrg(options),\n status: \"active\",\n })\n ).filter(\n (device) =>\n isOnline(device) &&\n Boolean(getRemoteComputerCapabilities(device)?.browser?.observe),\n );\n}\n\nasync function resolveBrowserDevice(\n options: CreateRemoteBrowserActionEntriesOptions,\n args: Record<string, unknown>,\n mode: \"observe\" | \"control\",\n): Promise<RemoteDevice> {\n const devices = (await listBrowserDevices(options)).filter(\n (device) => getRemoteComputerCapabilities(device)?.browser?.[mode] === true,\n );\n const requestedDeviceId = readString(args, \"deviceId\");\n const sessionHandle = readString(args, \"sessionHandle\");\n const matches = devices.filter((device) => {\n if (requestedDeviceId && device.id !== requestedDeviceId) return false;\n if (\n sessionHandle &&\n browserSessionMetadata(device)?.handle !== sessionHandle\n ) {\n return false;\n }\n return true;\n });\n if (matches.length === 1) return matches[0]!;\n if (matches.length === 0) {\n throw new Error(\n sessionHandle\n ? \"That browser session is no longer connected. Re-open the Agent Native side panel on the page.\"\n : `No online browser device advertises browser.${mode}. Open Agent Native for Chrome and grant page access first.`,\n );\n }\n throw new Error(\n \"More than one browser session is connected. Pass the sessionHandle shown by list-remote-browser-devices.\",\n );\n}\n\nfunction readString(\n args: Record<string, unknown>,\n key: string,\n): string | undefined {\n const value = args[key];\n return typeof value === \"string\" && value.trim() ? value.trim() : undefined;\n}\n\nfunction readNumber(\n args: Record<string, unknown>,\n key: string,\n fallback = 0,\n): number {\n const value = Number(args[key] ?? fallback);\n if (!Number.isFinite(value)) throw new Error(`${key} must be a number`);\n return value;\n}\n\nfunction requireSessionHandle(args: Record<string, unknown>): string {\n const value = readString(args, \"sessionHandle\");\n if (!value) throw new Error(\"sessionHandle is required\");\n return value;\n}\n\nfunction requireObservationTarget(\n args: Record<string, unknown>,\n): Record<string, unknown> {\n const observationId = readString(args, \"observationId\");\n const backendNodeId = Number(args.backendNodeId);\n if (\n !observationId ||\n !Number.isSafeInteger(backendNodeId) ||\n backendNodeId < 0\n ) {\n throw new Error(\n \"observationId and a non-negative backendNodeId are required\",\n );\n }\n return { observationId, backendNodeId };\n}\n\nfunction buildReadAction(args: Record<string, unknown>): ComputerCommandAction {\n const action = readString(args, \"action\") ?? \"read\";\n if (action === \"read\") {\n return {\n type: \"browser.read\",\n target: { sessionHandle: requireSessionHandle(args) },\n input: {},\n };\n }\n if (action === \"observe\") {\n return {\n type: \"browser.observe\",\n target: null,\n input: {\n maxNodes: Math.max(\n 1,\n Math.min(Math.trunc(readNumber(args, \"maxNodes\", 400)), 1_000),\n ),\n },\n };\n }\n throw new Error(\"Read action must be read or observe\");\n}\n\nfunction buildControlAction(\n args: Record<string, unknown>,\n): ComputerCommandAction {\n const action = readString(args, \"action\");\n if (!action || (!CONTROL_ACTIONS.has(action) && action !== \"stop\")) {\n throw new Error(\n \"Control action must be attach, click, type, key, navigate, scroll, or stop\",\n );\n }\n if (action === \"attach\") {\n return {\n type: \"browser.attach\",\n target: { sessionHandle: requireSessionHandle(args) },\n input: {},\n };\n }\n if (action === \"click\") {\n return {\n type: \"browser.click\",\n target: requireObservationTarget(args),\n input: {\n button:\n args.button === \"middle\" || args.button === \"right\"\n ? args.button\n : \"left\",\n },\n };\n }\n if (action === \"type\") {\n const text = typeof args.text === \"string\" ? args.text : null;\n if (text === null || text.length > 100_000) {\n throw new Error(\"text is required and must not exceed 100,000 chars\");\n }\n return {\n type: \"browser.type\",\n target: requireObservationTarget(args),\n input: { text, replace: args.replace === true },\n };\n }\n if (action === \"key\") {\n const key = readString(args, \"key\");\n if (!key || !BROWSER_KEYS.has(key)) {\n throw new Error(\"key must be a supported browser key\");\n }\n const modifiers = Array.isArray(args.modifiers)\n ? args.modifiers.filter(\n (value): value is string =>\n typeof value === \"string\" && BROWSER_MODIFIERS.has(value),\n )\n : [];\n if (\n Array.isArray(args.modifiers) &&\n modifiers.length !== args.modifiers.length\n ) {\n throw new Error(\"modifiers contains an unsupported browser modifier\");\n }\n return {\n type: \"browser.key\",\n target: null,\n input: { key, modifiers },\n };\n }\n if (action === \"navigate\") {\n const url = readString(args, \"url\");\n if (!url) throw new Error(\"url is required\");\n return {\n type: \"browser.navigate\",\n target: null,\n input: { url },\n };\n }\n if (action === \"scroll\") {\n return {\n type: \"browser.scroll\",\n target: null,\n input: {\n deltaX: readNumber(args, \"deltaX\"),\n deltaY: readNumber(args, \"deltaY\"),\n ...(args.x === undefined ? {} : { x: readNumber(args, \"x\") }),\n ...(args.y === undefined ? {} : { y: readNumber(args, \"y\") }),\n },\n };\n }\n return { type: \"browser.stop\", target: null, input: {} };\n}\n\nfunction sequenceNumber(): number {\n const random = new Uint16Array(1);\n globalThis.crypto.getRandomValues(random);\n return Date.now() * 1_000 + (random[0]! % 1_000);\n}\n\nfunction actionRunId(\n args: Record<string, unknown>,\n context: Parameters<NonNullable<ActionEntry[\"run\"]>>[1],\n): string {\n return (\n context?.threadId ??\n context?.runId ??\n readString(args, \"sessionHandle\") ??\n `browser-${globalThis.crypto.randomUUID()}`\n ).slice(0, 200);\n}\n\nasync function createEnvelope(input: {\n args: Record<string, unknown>;\n context: Parameters<NonNullable<ActionEntry[\"run\"]>>[1];\n action: ComputerCommandAction;\n operationClass: ComputerOperationClass;\n}): Promise<ComputerCommandEnvelope> {\n const now = Date.now();\n const sequence = sequenceNumber();\n const runId = actionRunId(input.args, input.context);\n const envelope: ComputerCommandEnvelope = {\n version: 1,\n taskId: (\n readString(input.args, \"sessionHandle\") ??\n input.context?.threadId ??\n runId\n ).slice(0, 200),\n runId,\n sequence,\n idempotencyKey:\n `browser-${sequence}-${globalThis.crypto.randomUUID()}`.slice(0, 200),\n operationClass: input.operationClass,\n action: input.action,\n approval: {\n id: null,\n scope: \"once\",\n actionHash: \"0\".repeat(64),\n },\n issuedAt: now,\n leaseExpiresAt: now + 2 * 60_000,\n };\n envelope.approval.actionHash = await computeComputerActionHash(envelope);\n return envelope;\n}\n\nasync function bindApprovedControl(input: {\n ownerEmail: string;\n orgId: string | null;\n deviceId: string;\n envelope: ComputerCommandEnvelope;\n approvedToolCallKey?: string;\n}): Promise<ComputerCommandEnvelope> {\n if (!computerOperationRequiresApproval(input.envelope.operationClass)) {\n return input.envelope;\n }\n if (!input.approvedToolCallKey) {\n throw new Error(\"Browser control requires human approval\");\n }\n const pending = await createComputerApprovalRequest(input);\n const approved = await decideComputerApproval({\n id: pending.id,\n ownerEmail: input.ownerEmail,\n orgId: input.orgId,\n actionHash: input.envelope.approval.actionHash,\n decision: \"approved\",\n decidedBy: input.ownerEmail,\n result: { source: \"agent-tool-approval\" },\n });\n if (!approved) throw new Error(\"Browser control approval expired\");\n return {\n ...input.envelope,\n approval: { ...input.envelope.approval, id: approved.id },\n };\n}\n\nasync function waitForCommand(\n command: RemoteCommand,\n signal?: AbortSignal,\n): Promise<RemoteCommand> {\n const deadline = Date.now() + COMMAND_WAIT_MS;\n let current = command;\n while (\n Date.now() < deadline &&\n current.status !== \"completed\" &&\n current.status !== \"failed\" &&\n !signal?.aborted\n ) {\n await new Promise((resolve) => setTimeout(resolve, COMMAND_POLL_MS));\n current = (await getRemoteCommand(command.id)) ?? current;\n }\n return current;\n}\n\nasync function enqueueBrowserAction(input: {\n options: CreateRemoteBrowserActionEntriesOptions;\n args: Record<string, unknown>;\n context: Parameters<NonNullable<ActionEntry[\"run\"]>>[1];\n action: ComputerCommandAction;\n operationClass: ComputerOperationClass;\n}): Promise<Record<string, unknown>> {\n const mode = input.operationClass.endsWith(\".control\")\n ? \"control\"\n : \"observe\";\n const device = await resolveBrowserDevice(input.options, input.args, mode);\n const ownerEmail = requireOwner(input.options);\n const orgId = currentOrg(input.options);\n let envelope = await createEnvelope(input);\n envelope = await bindApprovedControl({\n ownerEmail,\n orgId,\n deviceId: device.id,\n envelope,\n approvedToolCallKey: input.context?.approvedToolCallKey,\n });\n const command = await enqueueComputerCommand({\n deviceId: device.id,\n ownerEmail,\n orgId,\n envelope,\n platform: \"browser\",\n });\n const settled = await waitForCommand(command, input.context?.signal);\n return {\n ok: settled.status === \"completed\",\n commandId: settled.id,\n status: settled.status,\n ...(settled.result === null ? {} : { result: settled.result }),\n ...(settled.errorMessage ? { error: settled.errorMessage } : {}),\n };\n}\n\nconst deviceSelectorProperties = {\n sessionHandle: {\n type: \"string\",\n description:\n \"Opaque browser session handle staged by the Chrome side panel or returned by list-remote-browser-devices.\",\n },\n deviceId: {\n type: \"string\",\n description:\n \"Optional remote device id. Usually omit this and select by sessionHandle.\",\n },\n} as const;\n\nexport function createRemoteBrowserActionEntries(\n options: CreateRemoteBrowserActionEntriesOptions,\n): Record<string, ActionEntry> {\n return {\n \"list-remote-browser-devices\": {\n readOnly: true,\n tool: {\n description:\n \"List online Agent Native Chrome sessions. Use the opaque sessionHandle to read or control the page; never ask the user for a Chrome tab id.\",\n parameters: {\n type: \"object\",\n properties: {},\n additionalProperties: false,\n },\n },\n run: async () => ({\n ok: true,\n sessions: (await listBrowserDevices(options)).map((device) => {\n const capabilities = getRemoteComputerCapabilities(device)?.browser;\n const session = browserSessionMetadata(device);\n return {\n deviceId: device.id,\n sessionHandle: session?.handle ?? null,\n title: session?.title ?? null,\n origin: session?.origin ?? null,\n canRead: capabilities?.observe === true,\n canControl: capabilities?.control === true,\n lastSeenAt: device.lastSeenAt,\n };\n }),\n }),\n },\n \"read-remote-browser-page\": {\n readOnly: true,\n timeoutMs: 30_000,\n tool: {\n description:\n \"Read a granted Chrome page or observe the currently attached control lease. Use read for bounded page context; use observe after attach to get interactive targets.\",\n parameters: {\n type: \"object\",\n properties: {\n ...deviceSelectorProperties,\n action: { type: \"string\", enum: [\"read\", \"observe\"] },\n maxNodes: {\n type: \"number\",\n description: \"Maximum accessibility nodes for observe.\",\n },\n },\n required: [\"action\"],\n additionalProperties: false,\n },\n },\n run: async (args, context) =>\n enqueueBrowserAction({\n options,\n args,\n context,\n action: buildReadAction(args),\n operationClass: \"browser.observe\",\n }),\n },\n \"control-remote-browser\": {\n timeoutMs: 30_000,\n needsApproval: (args) => args.action !== \"stop\",\n tool: {\n description:\n \"Attach to and control a user-granted Chrome page. Attach once per conversation before observing or acting. Targets must come from the latest observation. Control actions require inline user approval.\",\n parameters: {\n type: \"object\",\n properties: {\n ...deviceSelectorProperties,\n action: {\n type: \"string\",\n enum: [\n \"attach\",\n \"click\",\n \"type\",\n \"key\",\n \"navigate\",\n \"scroll\",\n \"stop\",\n ],\n },\n observationId: { type: \"string\" },\n backendNodeId: { type: \"number\" },\n button: {\n type: \"string\",\n enum: [\"left\", \"middle\", \"right\"],\n },\n text: { type: \"string\" },\n replace: { type: \"boolean\" },\n key: { type: \"string\", enum: Array.from(BROWSER_KEYS) },\n modifiers: {\n type: \"array\",\n items: { type: \"string\", enum: Array.from(BROWSER_MODIFIERS) },\n },\n url: { type: \"string\" },\n deltaX: { type: \"number\" },\n deltaY: { type: \"number\" },\n x: { type: \"number\" },\n y: { type: \"number\" },\n },\n required: [\"action\"],\n additionalProperties: false,\n },\n },\n run: async (args, context) => {\n const action = buildControlAction(args);\n return enqueueBrowserAction({\n options,\n args,\n context,\n action,\n operationClass:\n action.type === \"browser.stop\"\n ? \"browser.observe\"\n : \"browser.control\",\n });\n },\n },\n \"get-remote-browser-command\": {\n readOnly: true,\n tool: {\n description:\n \"Check a queued remote browser command when a previous browser tool returned before the extension completed it.\",\n parameters: {\n type: \"object\",\n properties: {\n commandId: { type: \"string\" },\n },\n required: [\"commandId\"],\n additionalProperties: false,\n },\n },\n run: async (args) => {\n const commandId = readString(args, \"commandId\");\n if (!commandId) throw new Error(\"commandId is required\");\n const command = await getRemoteCommand(commandId);\n const ownerEmail = requireOwner(options);\n const orgId = currentOrg(options);\n if (\n !command ||\n command.ownerEmail !== ownerEmail ||\n command.orgId !== orgId ||\n command.kind !== \"computer-operation\" ||\n !command.computerOperation?.operationClass.startsWith(\"browser.\")\n ) {\n throw new Error(\"Remote browser command was not found\");\n }\n return {\n ok: command.status === \"completed\",\n commandId: command.id,\n status: command.status,\n ...(command.result === null ? {} : { result: command.result }),\n ...(command.errorMessage ? { error: command.errorMessage } : {}),\n };\n },\n },\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"list-recurring-jobs.d.ts","sourceRoot":"","sources":["../../../src/jobs/actions/list-recurring-jobs.ts"],"names":[],"mappings":"AAkCA,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,UAAU,GAAG,cAAc,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;CACpB"}
1
+ {"version":3,"file":"list-recurring-jobs.d.ts","sourceRoot":"","sources":["../../../src/jobs/actions/list-recurring-jobs.ts"],"names":[],"mappings":"AA8BA,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,UAAU,GAAG,cAAc,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;CACpB"}
@@ -2,13 +2,10 @@ import { z } from "zod";
2
2
  import { defineAction } from "../../action.js";
3
3
  import { organizationResourceOwner, resourceGetByPath, resourceList, } from "../../resources/store.js";
4
4
  import { describeCron, isValidCron, nextOccurrence } from "../cron.js";
5
+ import { classifyJobResource } from "../frontmatter.js";
5
6
  import { parseJobFrontmatter } from "../scheduler.js";
6
7
  import { authorizeJobMutation } from "../tools.js";
7
8
  const scopeSchema = z.enum(["personal", "organization"]);
8
- function hasTriggerFrontmatter(content) {
9
- const header = content.match(/^---\n([\s\S]*?)\n---/m)?.[1] ?? "";
10
- return /^triggerType\s*:/m.test(header);
11
- }
12
9
  function jobName(path) {
13
10
  return path.replace(/^jobs\//, "").replace(/\.md$/, "");
14
11
  }
@@ -23,7 +20,7 @@ function nextRun(meta) {
23
20
  return null;
24
21
  }
25
22
  export default defineAction({
26
- description: "List recurring cron jobs visible in the selected personal or organization scope. This read surface is used by the Agent Jobs page.",
23
+ description: "List legacy recurring cron jobs visible in the selected personal or organization scope. This compatibility read surface is used by the Agent Automations page.",
27
24
  agentTool: false,
28
25
  schema: z.object({
29
26
  scope: scopeSchema.default("personal"),
@@ -47,8 +44,9 @@ export default defineAction({
47
44
  continue;
48
45
  }
49
46
  const full = await resourceGetByPath(owner, resource.path);
50
- if (!full || hasTriggerFrontmatter(full.content))
47
+ if (!full || classifyJobResource(full.content).kind === "automation") {
51
48
  continue;
49
+ }
52
50
  const { meta, body } = parseJobFrontmatter(full.content);
53
51
  const canUpdate = scope === "personal" || !(await authorizeJobMutation(owner, meta));
54
52
  jobs.push({
@@ -1 +1 @@
1
- {"version":3,"file":"list-recurring-jobs.js","sourceRoot":"","sources":["../../../src/jobs/actions/list-recurring-jobs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,YAAY,GACb,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC;AAEzD,SAAS,qBAAqB,CAAC,OAAe;IAC5C,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAClE,OAAO,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC1C,CAAC;AAED,SA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AAC,IAAI,CAAC;gBACtB,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,IAAI;gBACjC,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,EAAE;gBAC7B,SAAS;aACV,CAAC,CAAC;QACL,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { z } from \"zod\";\n\nimport { defineAction } from \"../../action.js\";\nimport {\n organizationResourceOwner,\n resourceGetByPath,\n resourceList,\n} from \"../../resources/store.js\";\nimport { describeCron, isValidCron, nextOccurrence } from \"../cron.js\";\nimport { parseJobFrontmatter } from \"../scheduler.js\";\nimport { authorizeJobMutation } from \"../tools.js\";\n\nconst scopeSchema = z.enum([\"personal\", \"organization\"]);\n\nfunction hasTriggerFrontmatter(content: string): boolean {\n const header = content.match(/^---\\n([\\s\\S]*?)\\n---/m)?.[1] ?? \"\";\n return /^triggerType\\s*:/m.test(header);\n}\n\nfunction jobName(path: string): string {\n return path.replace(/^jobs\\//, \"\").replace(/\\.md$/, \"\");\n}\n\nfunction nextRun(\n meta: ReturnType<typeof parseJobFrontmatter>[\"meta\"],\n): string | null {\n if (!meta.enabled) return null;\n if (meta.nextRun) return meta.nextRun;\n if (meta.schedule && isValidCron(meta.schedule)) {\n return nextOccurrence(meta.schedule).toISOString();\n }\n return null;\n}\n\nexport interface RecurringJobActionItem {\n id: string;\n name: string;\n path: string;\n scope: \"personal\" | \"organization\";\n schedule: string;\n scheduleDescription: string;\n instructions: string;\n enabled: boolean;\n lastRun: string | null;\n lastStatus: string | null;\n lastError: string | null;\n nextRun: string | null;\n createdBy: string | null;\n mcpTools: string[];\n canUpdate: boolean;\n}\n\nexport default defineAction({\n description:\n \"List recurring cron jobs visible in the selected personal or organization scope. This read surface is used by the Agent Jobs page.\",\n agentTool: false,\n schema: z.object({\n scope: scopeSchema.default(\"personal\"),\n }),\n http: { method: \"GET\" },\n readOnly: true,\n parallelSafe: true,\n run: async ({ scope }, ctx): Promise<RecurringJobActionItem[]> => {\n const userEmail = ctx?.userEmail;\n if (!userEmail) throw new Error(\"Not authenticated.\");\n\n if (scope === \"organization\" && !ctx?.orgId) return [];\n\n const owner =\n scope === \"organization\"\n ? organizationResourceOwner(ctx.orgId as string)\n : userEmail;\n const resources = await resourceList(owner, \"jobs/\");\n const jobs: RecurringJobActionItem[] = [];\n\n for (const resource of resources) {\n if (!resource.path.endsWith(\".md\") || resource.path.endsWith(\".keep\")) {\n continue;\n }\n const full = await resourceGetByPath(owner, resource.path);\n if (!full || hasTriggerFrontmatter(full.content)) continue;\n\n const { meta, body } = parseJobFrontmatter(full.content);\n const canUpdate =\n scope === \"personal\" || !(await authorizeJobMutation(owner, meta));\n jobs.push({\n id: full.id,\n name: jobName(full.path),\n path: full.path,\n scope,\n schedule: meta.schedule,\n scheduleDescription: meta.schedule ? describeCron(meta.schedule) : \"\",\n instructions: body,\n enabled: meta.enabled,\n lastRun: meta.lastRun ?? null,\n lastStatus: meta.lastStatus ?? null,\n lastError: meta.lastError ?? null,\n nextRun: nextRun(meta),\n createdBy: meta.createdBy ?? null,\n mcpTools: meta.mcpTools ?? [],\n canUpdate,\n });\n }\n\n return jobs;\n },\n});\n"]}
1
+ {"version":3,"file":"list-recurring-jobs.js","sourceRoot":"","sources":["../../../src/jobs/actions/list-recurring-jobs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,YAAY,GACb,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa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I,CAAC,OAAO,IAAI,IAAI;gBAC7B,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,IAAI;gBACnC,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,IAAI;gBACjC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC;gBACtB,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,IAAI;gBACjC,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,EAAE;gBAC7B,SAAS;aACV,CAAC,CAAC;QACL,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { z } from \"zod\";\n\nimport { defineAction } from \"../../action.js\";\nimport {\n organizationResourceOwner,\n resourceGetByPath,\n resourceList,\n} from \"../../resources/store.js\";\nimport { describeCron, isValidCron, nextOccurrence } from \"../cron.js\";\nimport { classifyJobResource } from \"../frontmatter.js\";\nimport { parseJobFrontmatter } from \"../scheduler.js\";\nimport { authorizeJobMutation } from \"../tools.js\";\n\nconst scopeSchema = z.enum([\"personal\", \"organization\"]);\n\nfunction jobName(path: string): string {\n return path.replace(/^jobs\\//, \"\").replace(/\\.md$/, \"\");\n}\n\nfunction nextRun(\n meta: ReturnType<typeof parseJobFrontmatter>[\"meta\"],\n): string | null {\n if (!meta.enabled) return null;\n if (meta.nextRun) return meta.nextRun;\n if (meta.schedule && isValidCron(meta.schedule)) {\n return nextOccurrence(meta.schedule).toISOString();\n }\n return null;\n}\n\nexport interface RecurringJobActionItem {\n id: string;\n name: string;\n path: string;\n scope: \"personal\" | \"organization\";\n schedule: string;\n scheduleDescription: string;\n instructions: string;\n enabled: boolean;\n lastRun: string | null;\n lastStatus: string | null;\n lastError: string | null;\n nextRun: string | null;\n createdBy: string | null;\n mcpTools: string[];\n canUpdate: boolean;\n}\n\nexport default defineAction({\n description:\n \"List legacy recurring cron jobs visible in the selected personal or organization scope. This compatibility read surface is used by the Agent Automations page.\",\n agentTool: false,\n schema: z.object({\n scope: scopeSchema.default(\"personal\"),\n }),\n http: { method: \"GET\" },\n readOnly: true,\n parallelSafe: true,\n run: async ({ scope }, ctx): Promise<RecurringJobActionItem[]> => {\n const userEmail = ctx?.userEmail;\n if (!userEmail) throw new Error(\"Not authenticated.\");\n\n if (scope === \"organization\" && !ctx?.orgId) return [];\n\n const owner =\n scope === \"organization\"\n ? organizationResourceOwner(ctx.orgId as string)\n : userEmail;\n const resources = await resourceList(owner, \"jobs/\");\n const jobs: RecurringJobActionItem[] = [];\n\n for (const resource of resources) {\n if (!resource.path.endsWith(\".md\") || resource.path.endsWith(\".keep\")) {\n continue;\n }\n const full = await resourceGetByPath(owner, resource.path);\n if (!full || classifyJobResource(full.content).kind === \"automation\") {\n continue;\n }\n\n const { meta, body } = parseJobFrontmatter(full.content);\n const canUpdate =\n scope === \"personal\" || !(await authorizeJobMutation(owner, meta));\n jobs.push({\n id: full.id,\n name: jobName(full.path),\n path: full.path,\n scope,\n schedule: meta.schedule,\n scheduleDescription: meta.schedule ? describeCron(meta.schedule) : \"\",\n instructions: body,\n enabled: meta.enabled,\n lastRun: meta.lastRun ?? null,\n lastStatus: meta.lastStatus ?? null,\n lastError: meta.lastError ?? null,\n nextRun: nextRun(meta),\n createdBy: meta.createdBy ?? null,\n mcpTools: meta.mcpTools ?? [],\n canUpdate,\n });\n }\n\n return jobs;\n },\n});\n"]}