@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
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp-client/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,KAAK,SAAS,EACd,KAAK,eAAe,GACrB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,KAAK,OAAO,EACZ,KAAK,uBAAuB,GAC7B,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACpB,yBAAyB,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M,EAAE,WAAW,CAAC,GAClC,IAAI,CAWN;AA6DD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAMxD;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAiB5D;AA6BD;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,OAAO,GACd,yBAAyB,EAAE,CAgB7B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp-client/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,KAAK,SAAS,EACd,KAAK,eAAe,GACrB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,KAAK,OAAO,EACZ,KAAK,uBAAuB,GAC7B,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACpB,yBAAyB,EACzB,iCAAiC,EACjC,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,EAClB,KAAK,cAAc,EACnB,KAAK,qBAAqB,GAC3B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,0BAA0B,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,GACzB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,kCAAkC,EAClC,wBAAwB,EACxB,uBAAuB,EACvB,+BAA+B,EAC/B,mCAAmC,EACnC,gCAAgC,EAChC,wBAAwB,EACxB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,GAC5B,MA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AAM,iBAAiB,CAAC;AAQzB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAC1E;;;;GAIG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAShE,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,qBAAqB;IACpC,gBAAgB,CAAC,EAAE,uBAAuB,CAAC;IAC3C,+EAA+E;IAC/E,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC/B;AAED,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,gBAAgB,EACzB,OAAO,GAAE,qBAA0B,GAClC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAU7B;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAClC,IAAI,CAWN;AAmED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAMxD;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAiB5D;AA6BD;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,OAAO,GACd,yBAAyB,EAAE,CAgB7B"}
@@ -64,6 +64,10 @@ function mcpToolToActionEntry(manager, tool, options = {}) {
64
64
  parameters: tool.inputSchema,
65
65
  },
66
66
  http: false,
67
+ planMode: {
68
+ effect: (args) => evaluateMcpToolCallPolicy({ mode: "read-only" }, tool, args).effect,
69
+ description: "Plan mode allows MCP calls classified as read-only from annotations, operation names, and runtime arguments.",
70
+ },
67
71
  ...(tool.annotations?.readOnlyHint === true ? { readOnly: true } : {}),
68
72
  run: async (args) => {
69
73
  // Defense-in-depth: even if a cross-scope MCP tool somehow makes it
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mcp-client/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,aAAa,EACb,mBAAmB,GAGpB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,GAGhB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACpB,yBAAyB,EACzB,iCAAiC,EACjC,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,GAGnB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,0BAA0B,GAM3B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,kCAAkC,EAClC,wBAAwB,EACxB,uBAAuB,EACvB,+BAA+B,EAC/B,mCAAmC,EACnC,gCAAgC,EAChC,wBAAwB,GAGzB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,iCAAiC,EACjC,iCAAiC,EACjC,gCAAgC,EAChC,8BAA8B,GAE/B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,GAEtB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,GAGpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,cAAc,GAGf,MAAM,cAAc,CAAC;AACtB,OAAO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/B,OAAyB,EACzB,IAAa,EACb,WAAmB;IAEnB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QACzE,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAE,MAAc,EAAE,QAAQ,CAAC;YACvD,CAAC,CAAG,MAAc,CAAC,QAAsB;YACzC,CAAC,CAAC,EAAE,CAAC;QACP,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC/B,MAAM,QAAQ,GAAG,8BAA8B,CAAC,OAAO,CAAC,CAAC;YACzD,IACE,QAAQ,EAAE,GAAG,KAAK,WAAW;gBAC7B,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,EACnC,CAAC;gBACD,OAAO,QAAQ,CAAC;YAClB,CAAC;QACH,CAAC;IACH,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,OAAO,CAAC,IAAI,CACV,gDAAgD,WAAW,KAAK,GAAG,EAAE,OAAO,IAAI,GAAG,EAAE,CACtF,CAAC;IACJ,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["/**\n * MCP client module — symmetric counterpart to `@agent-native/core/mcp`\n * (the MCP server). Connects to local MCP servers configured in\n * `mcp.config.json` or the `MCP_SERVERS` env var and exposes their tools\n * to the agent-chat tool-use loop.\n */\n\nexport {\n loadMcpConfig,\n autoDetectMcpConfig,\n type McpConfig,\n type McpServerConfig,\n} from \"./config.js\";\n\nexport {\n McpClientManager,\n buildMcpToolName,\n parseMcpToolName,\n MCP_TOOL_PREFIX,\n type McpTool,\n type McpClientManagerOptions,\n} from \"./manager.js\";\n\nexport {\n listRemoteServers,\n addRemoteServer,\n addOAuthRemoteServer,\n addFirstPartyRemoteServer,\n isFirstPartyRemoteEndpointTrusted,\n removeRemoteServer,\n validateRemoteUrl,\n normalizeServerName,\n mergedConfigKey,\n parseMergedKey,\n hashEmail,\n toHttpServerConfig,\n toHttpServerConfigAsync,\n materializeHeaders,\n type RemoteMcpScope,\n type StoredRemoteMcpServer,\n} from \"./remote-store.js\";\n\nexport {\n finishMcpOAuthAuthorization,\n getMcpOAuthAccessToken,\n readMcpOAuthCredentials,\n saveMcpOAuthCredentials,\n startMcpOAuthAuthorization,\n type McpOAuthCallbackResult,\n type McpOAuthCredentialBundle,\n type McpOAuthDiscoveryState,\n type McpOAuthProviderOptions,\n type McpOAuthStartResult,\n} from \"./oauth-client.js\";\n\nexport {\n areBuiltinMcpCapabilitiesSupported,\n BUILTIN_MCP_CAPABILITIES,\n getBuiltinMcpCapability,\n isBuiltinMcpCapabilityAvailable,\n listSupportedBuiltinMcpCapabilities,\n normalizeBuiltinMcpCapabilityIds,\n toBuiltinMcpServerConfig,\n type BuiltinMcpCapability,\n type BuiltinMcpCapabilityId,\n} from \"./builtin-capabilities.js\";\n\nexport {\n builtinMcpCapabilitiesSettingsKey,\n listEnabledBuiltinMcpCapabilities,\n setEnabledBuiltinMcpCapabilities,\n setBuiltinMcpCapabilityEnabled,\n type StoredBuiltinMcpCapabilities,\n} from \"./builtin-store.js\";\n\nexport {\n mountMcpServersRoutes,\n buildMergedConfig,\n builtinMergedConfigKey,\n startMcpConfigRefresh,\n type ClientBuiltinCapability,\n} from \"./routes.js\";\n\nexport {\n mountMcpHubRoutes,\n listHubServers,\n getHubStatus,\n isHubServeEnabled,\n isHubConsumeEnabled,\n type HubServerRecord,\n type HubServersResponse,\n} from \"./hub-routes.js\";\n\nexport { fetchHubServers } from \"./hub-client.js\";\n\nexport { isMcpToolAllowedForRequest } from \"./visibility.js\";\nexport {\n callMcpTool,\n listVisibleMcpTools,\n McpAppApiError,\n type AppMcpTool,\n type ListVisibleMcpToolsOptions,\n} from \"./app-api.js\";\nimport { isMcpToolAllowedForRequest } from \"./visibility.js\";\nexport {\n classifyMcpToolCall,\n evaluateMcpToolCallPolicy,\n type McpToolCallClassification,\n type McpToolEffect,\n type McpToolFamily,\n type McpToolInvocationPolicy,\n type McpToolPolicyDecision,\n} from \"./tool-policy.js\";\nexport {\n configureScreenMemory,\n queryScreenMemoryForAgent,\n queryScreenMemoryContext,\n readScreenMemoryStatus,\n type ScreenMemoryConfig,\n type ScreenMemoryAgentQueryResult,\n type ScreenMemoryContextItem,\n type ScreenMemoryCoverageGap,\n type ScreenMemoryEvidenceItem,\n type ScreenMemoryEvidenceSourceType,\n type ScreenMemoryQueryResult,\n type ScreenMemoryRetrievalCoverage,\n type ScreenMemorySegmentReference,\n type ScreenMemoryStatus,\n type ScreenMemoryTimeRange,\n type ScreenMemoryTruncation,\n} from \"./screen-memory-local.js\";\nexport {\n MCP_ACTION_RESULT_MARKER,\n isMcpActionResult,\n type AgentMcpAppPayload,\n type AgentMcpAppResourceContent,\n type McpActionResult,\n} from \"./app-result.js\";\nimport {\n getToolUiResourceUri,\n isToolVisibilityAppOnly,\n isToolVisibilityModelOnly,\n} from \"@modelcontextprotocol/ext-apps/app-bridge\";\n\nimport { MCP_APP_MIME_TYPE } from \"../action.js\";\nimport type { EngineToolResultImagePart } from \"../agent/engine/types.js\";\n/**\n * Convert MCP tools into `ActionEntry` values suitable for registration in\n * the agent's action registry. Each tool is marked `http: false` so it's\n * never auto-mounted as an HTTP endpoint — MCP tools are agent-only.\n */\nimport type { ActionEntry } from \"../agent/production-agent.js\";\nimport { normalizeToolResultImages } from \"../agent/tool-result-images.js\";\nimport {\n MCP_ACTION_RESULT_MARKER,\n toolForMcpAppPayload,\n type AgentMcpAppPayload,\n type AgentMcpAppResourceContent,\n type McpActionResult,\n} from \"./app-result.js\";\nimport type { McpClientManager, McpTool } from \"./manager.js\";\nimport {\n evaluateMcpToolCallPolicy,\n type McpToolInvocationPolicy,\n} from \"./tool-policy.js\";\n\nexport interface McpActionEntryOptions {\n invocationPolicy?: McpToolInvocationPolicy;\n /** Restrict the generated entries to an explicit background capability set. */\n toolNames?: readonly string[];\n}\n\nexport function mcpToolsToActionEntries(\n manager: McpClientManager,\n options: McpActionEntryOptions = {},\n): Record<string, ActionEntry> {\n const entries: Record<string, ActionEntry> = {};\n const selectedToolNames = options.toolNames\n ? new Set(options.toolNames)\n : undefined;\n for (const tool of manager.getTools().filter(isVisibleToModel)) {\n if (selectedToolNames && !selectedToolNames.has(tool.name)) continue;\n entries[tool.name] = mcpToolToActionEntry(manager, tool, options);\n }\n return entries;\n}\n\n/**\n * Mutate a target action dict in place so it matches the current MCP tool set:\n * - adds new `mcp__*` keys that aren't in target,\n * - removes `mcp__*` keys that no longer exist in the manager,\n * - leaves non-MCP keys untouched.\n *\n * Used by the agent-chat plugin to keep its `prodActions` / `devActions`\n * registries in sync after `McpClientManager.reconfigure()` runs.\n */\nexport function syncMcpActionEntries(\n manager: McpClientManager,\n target: Record<string, ActionEntry>,\n): void {\n const current = new Set<string>();\n for (const tool of manager.getTools().filter(isVisibleToModel)) {\n current.add(tool.name);\n target[tool.name] = mcpToolToActionEntry(manager, tool);\n }\n for (const key of Object.keys(target)) {\n if (key.startsWith(\"mcp__\") && !current.has(key)) {\n delete target[key];\n }\n }\n}\n\nfunction mcpToolToActionEntry(\n manager: McpClientManager,\n tool: McpTool,\n options: McpActionEntryOptions = {},\n): ActionEntry {\n return {\n tool: {\n description: tool.description,\n parameters: tool.inputSchema as any,\n },\n http: false,\n ...(tool.annotations?.readOnlyHint === true ? { readOnly: true } : {}),\n run: async (args: Record<string, unknown>) => {\n // Defense-in-depth: even if a cross-scope MCP tool somehow makes it\n // into the LLM's visible tool list, reject invocation here so we never\n // execute a user's credentials on behalf of another user.\n if (!isMcpToolAllowedForRequest(tool.name)) {\n return buildMcpErrorActionResult(\n tool,\n args,\n `Error: MCP tool ${tool.name} is not available in the current request scope.`,\n );\n }\n if (options.invocationPolicy) {\n const decision = evaluateMcpToolCallPolicy(\n options.invocationPolicy,\n tool,\n args,\n );\n if (!decision.allowed) {\n return buildMcpErrorActionResult(\n tool,\n args,\n `Error: MCP tool ${tool.name} is unavailable in read-only mode: ${decision.reason}.`,\n );\n }\n }\n try {\n const result = await manager.callTool(tool.name, args);\n return await buildMcpActionResult(manager, tool, args, result);\n } catch (err: any) {\n return buildMcpErrorActionResult(\n tool,\n args,\n `Error calling MCP tool ${tool.name}: ${err?.message ?? err}`,\n );\n }\n },\n };\n}\n\nfunction isVisibleToModel(tool: McpTool): boolean {\n try {\n return !isToolVisibilityAppOnly(tool.raw as any);\n } catch {\n return true;\n }\n}\n\nexport function isVisibleToMcpApp(tool: McpTool): boolean {\n try {\n return !isToolVisibilityModelOnly(tool.raw as any);\n } catch {\n return true;\n }\n}\n\nexport function flattenMcpToolResult(result: unknown): string {\n if (\n result &&\n typeof result === \"object\" &&\n Array.isArray((result as any).content)\n ) {\n const parts = (result as any).content as Array<Record<string, any>>;\n const text = parts.map(formatMcpContentPart).join(\"\\n\");\n const fallback =\n text ||\n (hasStructuredContent(result)\n ? JSON.stringify((result as any).structuredContent, null, 2)\n : \"(no output)\");\n if ((result as any).isError) return `Error: ${fallback}`;\n return fallback;\n }\n return typeof result === \"string\" ? result : JSON.stringify(result);\n}\n\nfunction formatMcpContentPart(part: Record<string, any>): string {\n if (part?.type === \"text\" && typeof part.text === \"string\") {\n return part.text;\n }\n if (part?.type === \"image\") {\n return `[image: ${part?.mimeType ?? \"unknown\"}]`;\n }\n if (part?.type === \"resource\") {\n const resource = part.resource ?? {};\n const uri = typeof resource.uri === \"string\" ? ` ${resource.uri}` : \"\";\n return `[resource: ${resource.mimeType ?? \"unknown\"}${uri}]`;\n }\n if (part?.type === \"resource_link\") {\n const uri = typeof part.uri === \"string\" ? ` ${part.uri}` : \"\";\n return `[resource: ${part.mimeType ?? \"unknown\"}${uri}]`;\n }\n return JSON.stringify(part);\n}\n\nfunction hasStructuredContent(result: unknown): boolean {\n return (\n !!result &&\n typeof result === \"object\" &&\n Object.prototype.hasOwnProperty.call(result, \"structuredContent\")\n );\n}\n\n/**\n * Extract vision images from a raw MCP tool result so the model can SEE\n * screenshots/previews returned by external MCP tools instead of only the\n * `[image: <mime>]` placeholder that `flattenMcpToolResult` leaves in the\n * text. Shares the per-result caps with `_agentImages` (max count, max base64\n * size); over-cap or unsupported images stay placeholder-only. Never throws.\n */\nexport function extractMcpToolResultImages(\n result: unknown,\n): EngineToolResultImagePart[] {\n if (\n !result ||\n typeof result !== \"object\" ||\n !Array.isArray((result as any).content) ||\n (result as any).isError\n ) {\n return [];\n }\n const candidates = ((result as any).content as Array<Record<string, any>>)\n .filter((part) => part?.type === \"image\" && typeof part.data === \"string\")\n .map((part) => ({\n data: part.data as string,\n mediaType: typeof part.mimeType === \"string\" ? part.mimeType : undefined,\n }));\n return normalizeToolResultImages(candidates).images;\n}\n\nasync function buildMcpActionResult(\n manager: McpClientManager,\n tool: McpTool,\n input: Record<string, unknown>,\n raw: unknown,\n): Promise<McpActionResult> {\n const text = flattenMcpToolResult(raw);\n const mcpApp = await extractMcpAppPayload(manager, tool, input, raw);\n return {\n [MCP_ACTION_RESULT_MARKER]: true,\n text,\n raw,\n serverId: tool.source,\n toolName: tool.name,\n originalToolName: tool.originalName,\n input,\n ...(mcpApp ? { mcpApp } : {}),\n };\n}\n\nfunction buildMcpErrorActionResult(\n tool: McpTool,\n input: Record<string, unknown>,\n text: string,\n): McpActionResult {\n return {\n [MCP_ACTION_RESULT_MARKER]: true,\n text,\n raw: {\n isError: true,\n content: [{ type: \"text\", text }],\n },\n serverId: tool.source,\n toolName: tool.name,\n originalToolName: tool.originalName,\n input,\n };\n}\n\nasync function extractMcpAppPayload(\n manager: McpClientManager,\n tool: McpTool,\n input: Record<string, unknown>,\n raw: unknown,\n): Promise<AgentMcpAppPayload | undefined> {\n const inlineResource = findInlineMcpAppResource(raw);\n const resourceUri =\n inlineResource?.uri ??\n resourceUriFromTool(tool) ??\n resourceUriFromResult(raw);\n if (!resourceUri) return undefined;\n\n const resource =\n inlineResource ?? (await readMcpAppResource(manager, tool, resourceUri));\n\n return {\n serverId: tool.source,\n toolName: tool.name,\n originalToolName: tool.originalName,\n resourceUri,\n toolInput: input,\n toolResult:\n raw && typeof raw === \"object\"\n ? ({ ...(raw as Record<string, unknown>) } as Record<string, unknown>)\n : { content: [{ type: \"text\", text: String(raw ?? \"\") }] },\n tool: toolForMcpAppPayload(tool),\n ...(resource ? { resource } : {}),\n };\n}\n\nfunction resourceUriFromTool(tool: McpTool): string | undefined {\n try {\n return getToolUiResourceUri(tool.raw as any);\n } catch {\n return undefined;\n }\n}\n\nfunction resourceUriFromResult(raw: unknown): string | undefined {\n if (!raw || typeof raw !== \"object\") return undefined;\n const meta = (raw as any)._meta;\n const nested = meta?.ui?.resourceUri;\n if (typeof nested === \"string\" && nested.startsWith(\"ui://\")) return nested;\n const flat = meta?.[\"ui/resourceUri\"] ?? meta?.[\"ui.resourceUri\"];\n if (typeof flat === \"string\" && flat.startsWith(\"ui://\")) return flat;\n return findInlineMcpAppResource(raw)?.uri;\n}\n\nfunction findInlineMcpAppResource(\n raw: unknown,\n): AgentMcpAppResourceContent | undefined {\n if (!raw || typeof raw !== \"object\") return undefined;\n const content = Array.isArray((raw as any).content)\n ? ((raw as any).content as unknown[])\n : [];\n for (const part of content) {\n const resource = normalizeMcpAppResourceContent(part);\n if (resource) return resource;\n }\n return undefined;\n}\n\nfunction normalizeMcpAppResourceContent(\n part: unknown,\n): AgentMcpAppResourceContent | undefined {\n if (!part || typeof part !== \"object\") return undefined;\n const candidate =\n (part as any).type === \"resource\"\n ? (part as any).resource\n : ((part as any).resource ?? part);\n if (!candidate || typeof candidate !== \"object\") return undefined;\n const uri = (candidate as any).uri;\n if (typeof uri !== \"string\" || !uri.startsWith(\"ui://\")) return undefined;\n const mimeType =\n typeof (candidate as any).mimeType === \"string\"\n ? (candidate as any).mimeType\n : undefined;\n if (mimeType && !mimeType.includes(MCP_APP_MIME_TYPE)) return undefined;\n const text =\n typeof (candidate as any).text === \"string\"\n ? (candidate as any).text\n : undefined;\n const blob =\n typeof (candidate as any).blob === \"string\"\n ? (candidate as any).blob\n : undefined;\n const meta =\n (candidate as any)._meta && typeof (candidate as any)._meta === \"object\"\n ? ((candidate as any)._meta as Record<string, unknown>)\n : (part as any)._meta && typeof (part as any)._meta === \"object\"\n ? ((part as any)._meta as Record<string, unknown>)\n : undefined;\n return {\n uri,\n ...(mimeType ? { mimeType } : {}),\n ...(text ? { text } : {}),\n ...(blob ? { blob } : {}),\n ...(meta ? { _meta: meta } : {}),\n };\n}\n\nasync function readMcpAppResource(\n manager: McpClientManager,\n tool: McpTool,\n resourceUri: string,\n): Promise<AgentMcpAppResourceContent | undefined> {\n try {\n const result = await manager.readResourceForTool(tool.name, resourceUri);\n const contents = Array.isArray((result as any)?.contents)\n ? ((result as any).contents as unknown[])\n : [];\n for (const content of contents) {\n const resource = normalizeMcpAppResourceContent(content);\n if (\n resource?.uri === resourceUri ||\n (resource && contents.length === 1)\n ) {\n return resource;\n }\n }\n } catch (err: any) {\n console.warn(\n `[mcp-client] Failed to read MCP App resource ${resourceUri}: ${err?.message ?? err}`,\n );\n }\n return undefined;\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mcp-client/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,aAAa,EACb,mBAAmB,GAGpB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,GAGhB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACpB,yBAAyB,EACzB,iCAAiC,EACjC,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,GAGnB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,0BAA0B,GAM3B,MAAM,mBAAmB,CAAC;AAE3B,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,KAAK,WAAW;gBAC7B,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,EACnC,CAAC;gBACD,OAAO,QAAQ,CAAC;YAClB,CAAC;QACH,CAAC;IACH,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,OAAO,CAAC,IAAI,CACV,gDAAgD,WAAW,KAAK,GAAG,EAAE,OAAO,IAAI,GAAG,EAAE,CACtF,CAAC;IACJ,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["/**\n * MCP client module — symmetric counterpart to `@agent-native/core/mcp`\n * (the MCP server). Connects to local MCP servers configured in\n * `mcp.config.json` or the `MCP_SERVERS` env var and exposes their tools\n * to the agent-chat tool-use loop.\n */\n\nexport {\n loadMcpConfig,\n autoDetectMcpConfig,\n type McpConfig,\n type McpServerConfig,\n} from \"./config.js\";\n\nexport {\n McpClientManager,\n buildMcpToolName,\n parseMcpToolName,\n MCP_TOOL_PREFIX,\n type McpTool,\n type McpClientManagerOptions,\n} from \"./manager.js\";\n\nexport {\n listRemoteServers,\n addRemoteServer,\n addOAuthRemoteServer,\n addFirstPartyRemoteServer,\n isFirstPartyRemoteEndpointTrusted,\n removeRemoteServer,\n validateRemoteUrl,\n normalizeServerName,\n mergedConfigKey,\n parseMergedKey,\n hashEmail,\n toHttpServerConfig,\n toHttpServerConfigAsync,\n materializeHeaders,\n type RemoteMcpScope,\n type StoredRemoteMcpServer,\n} from \"./remote-store.js\";\n\nexport {\n finishMcpOAuthAuthorization,\n getMcpOAuthAccessToken,\n readMcpOAuthCredentials,\n saveMcpOAuthCredentials,\n startMcpOAuthAuthorization,\n type McpOAuthCallbackResult,\n type McpOAuthCredentialBundle,\n type McpOAuthDiscoveryState,\n type McpOAuthProviderOptions,\n type McpOAuthStartResult,\n} from \"./oauth-client.js\";\n\nexport {\n areBuiltinMcpCapabilitiesSupported,\n BUILTIN_MCP_CAPABILITIES,\n getBuiltinMcpCapability,\n isBuiltinMcpCapabilityAvailable,\n listSupportedBuiltinMcpCapabilities,\n normalizeBuiltinMcpCapabilityIds,\n toBuiltinMcpServerConfig,\n type BuiltinMcpCapability,\n type BuiltinMcpCapabilityId,\n} from \"./builtin-capabilities.js\";\n\nexport {\n builtinMcpCapabilitiesSettingsKey,\n listEnabledBuiltinMcpCapabilities,\n setEnabledBuiltinMcpCapabilities,\n setBuiltinMcpCapabilityEnabled,\n type StoredBuiltinMcpCapabilities,\n} from \"./builtin-store.js\";\n\nexport {\n mountMcpServersRoutes,\n buildMergedConfig,\n builtinMergedConfigKey,\n startMcpConfigRefresh,\n type ClientBuiltinCapability,\n} from \"./routes.js\";\n\nexport {\n mountMcpHubRoutes,\n listHubServers,\n getHubStatus,\n isHubServeEnabled,\n isHubConsumeEnabled,\n type HubServerRecord,\n type HubServersResponse,\n} from \"./hub-routes.js\";\n\nexport { fetchHubServers } from \"./hub-client.js\";\n\nexport { isMcpToolAllowedForRequest } from \"./visibility.js\";\nexport {\n callMcpTool,\n listVisibleMcpTools,\n McpAppApiError,\n type AppMcpTool,\n type ListVisibleMcpToolsOptions,\n} from \"./app-api.js\";\nimport { isMcpToolAllowedForRequest } from \"./visibility.js\";\nexport {\n classifyMcpToolCall,\n evaluateMcpToolCallPolicy,\n type McpToolCallClassification,\n type McpToolEffect,\n type McpToolFamily,\n type McpToolInvocationPolicy,\n type McpToolPolicyDecision,\n} from \"./tool-policy.js\";\nexport {\n configureScreenMemory,\n queryScreenMemoryForAgent,\n queryScreenMemoryContext,\n readScreenMemoryStatus,\n type ScreenMemoryConfig,\n type ScreenMemoryAgentQueryResult,\n type ScreenMemoryContextItem,\n type ScreenMemoryCoverageGap,\n type ScreenMemoryEvidenceItem,\n type ScreenMemoryEvidenceSourceType,\n type ScreenMemoryQueryResult,\n type ScreenMemoryRetrievalCoverage,\n type ScreenMemorySegmentReference,\n type ScreenMemoryStatus,\n type ScreenMemoryTimeRange,\n type ScreenMemoryTruncation,\n} from \"./screen-memory-local.js\";\nexport {\n MCP_ACTION_RESULT_MARKER,\n isMcpActionResult,\n type AgentMcpAppPayload,\n type AgentMcpAppResourceContent,\n type McpActionResult,\n} from \"./app-result.js\";\nimport {\n getToolUiResourceUri,\n isToolVisibilityAppOnly,\n isToolVisibilityModelOnly,\n} from \"@modelcontextprotocol/ext-apps/app-bridge\";\n\nimport { MCP_APP_MIME_TYPE } from \"../action.js\";\nimport type { EngineToolResultImagePart } from \"../agent/engine/types.js\";\n/**\n * Convert MCP tools into `ActionEntry` values suitable for registration in\n * the agent's action registry. Each tool is marked `http: false` so it's\n * never auto-mounted as an HTTP endpoint — MCP tools are agent-only.\n */\nimport type { ActionEntry } from \"../agent/production-agent.js\";\nimport { normalizeToolResultImages } from \"../agent/tool-result-images.js\";\nimport {\n MCP_ACTION_RESULT_MARKER,\n toolForMcpAppPayload,\n type AgentMcpAppPayload,\n type AgentMcpAppResourceContent,\n type McpActionResult,\n} from \"./app-result.js\";\nimport type { McpClientManager, McpTool } from \"./manager.js\";\nimport {\n evaluateMcpToolCallPolicy,\n type McpToolInvocationPolicy,\n} from \"./tool-policy.js\";\n\nexport interface McpActionEntryOptions {\n invocationPolicy?: McpToolInvocationPolicy;\n /** Restrict the generated entries to an explicit background capability set. */\n toolNames?: readonly string[];\n}\n\nexport function mcpToolsToActionEntries(\n manager: McpClientManager,\n options: McpActionEntryOptions = {},\n): Record<string, ActionEntry> {\n const entries: Record<string, ActionEntry> = {};\n const selectedToolNames = options.toolNames\n ? new Set(options.toolNames)\n : undefined;\n for (const tool of manager.getTools().filter(isVisibleToModel)) {\n if (selectedToolNames && !selectedToolNames.has(tool.name)) continue;\n entries[tool.name] = mcpToolToActionEntry(manager, tool, options);\n }\n return entries;\n}\n\n/**\n * Mutate a target action dict in place so it matches the current MCP tool set:\n * - adds new `mcp__*` keys that aren't in target,\n * - removes `mcp__*` keys that no longer exist in the manager,\n * - leaves non-MCP keys untouched.\n *\n * Used by the agent-chat plugin to keep its `prodActions` / `devActions`\n * registries in sync after `McpClientManager.reconfigure()` runs.\n */\nexport function syncMcpActionEntries(\n manager: McpClientManager,\n target: Record<string, ActionEntry>,\n): void {\n const current = new Set<string>();\n for (const tool of manager.getTools().filter(isVisibleToModel)) {\n current.add(tool.name);\n target[tool.name] = mcpToolToActionEntry(manager, tool);\n }\n for (const key of Object.keys(target)) {\n if (key.startsWith(\"mcp__\") && !current.has(key)) {\n delete target[key];\n }\n }\n}\n\nfunction mcpToolToActionEntry(\n manager: McpClientManager,\n tool: McpTool,\n options: McpActionEntryOptions = {},\n): ActionEntry {\n return {\n tool: {\n description: tool.description,\n parameters: tool.inputSchema as any,\n },\n http: false,\n planMode: {\n effect: (args) =>\n evaluateMcpToolCallPolicy({ mode: \"read-only\" }, tool, args).effect,\n description:\n \"Plan mode allows MCP calls classified as read-only from annotations, operation names, and runtime arguments.\",\n },\n ...(tool.annotations?.readOnlyHint === true ? { readOnly: true } : {}),\n run: async (args: Record<string, unknown>) => {\n // Defense-in-depth: even if a cross-scope MCP tool somehow makes it\n // into the LLM's visible tool list, reject invocation here so we never\n // execute a user's credentials on behalf of another user.\n if (!isMcpToolAllowedForRequest(tool.name)) {\n return buildMcpErrorActionResult(\n tool,\n args,\n `Error: MCP tool ${tool.name} is not available in the current request scope.`,\n );\n }\n if (options.invocationPolicy) {\n const decision = evaluateMcpToolCallPolicy(\n options.invocationPolicy,\n tool,\n args,\n );\n if (!decision.allowed) {\n return buildMcpErrorActionResult(\n tool,\n args,\n `Error: MCP tool ${tool.name} is unavailable in read-only mode: ${decision.reason}.`,\n );\n }\n }\n try {\n const result = await manager.callTool(tool.name, args);\n return await buildMcpActionResult(manager, tool, args, result);\n } catch (err: any) {\n return buildMcpErrorActionResult(\n tool,\n args,\n `Error calling MCP tool ${tool.name}: ${err?.message ?? err}`,\n );\n }\n },\n };\n}\n\nfunction isVisibleToModel(tool: McpTool): boolean {\n try {\n return !isToolVisibilityAppOnly(tool.raw as any);\n } catch {\n return true;\n }\n}\n\nexport function isVisibleToMcpApp(tool: McpTool): boolean {\n try {\n return !isToolVisibilityModelOnly(tool.raw as any);\n } catch {\n return true;\n }\n}\n\nexport function flattenMcpToolResult(result: unknown): string {\n if (\n result &&\n typeof result === \"object\" &&\n Array.isArray((result as any).content)\n ) {\n const parts = (result as any).content as Array<Record<string, any>>;\n const text = parts.map(formatMcpContentPart).join(\"\\n\");\n const fallback =\n text ||\n (hasStructuredContent(result)\n ? JSON.stringify((result as any).structuredContent, null, 2)\n : \"(no output)\");\n if ((result as any).isError) return `Error: ${fallback}`;\n return fallback;\n }\n return typeof result === \"string\" ? result : JSON.stringify(result);\n}\n\nfunction formatMcpContentPart(part: Record<string, any>): string {\n if (part?.type === \"text\" && typeof part.text === \"string\") {\n return part.text;\n }\n if (part?.type === \"image\") {\n return `[image: ${part?.mimeType ?? \"unknown\"}]`;\n }\n if (part?.type === \"resource\") {\n const resource = part.resource ?? {};\n const uri = typeof resource.uri === \"string\" ? ` ${resource.uri}` : \"\";\n return `[resource: ${resource.mimeType ?? \"unknown\"}${uri}]`;\n }\n if (part?.type === \"resource_link\") {\n const uri = typeof part.uri === \"string\" ? ` ${part.uri}` : \"\";\n return `[resource: ${part.mimeType ?? \"unknown\"}${uri}]`;\n }\n return JSON.stringify(part);\n}\n\nfunction hasStructuredContent(result: unknown): boolean {\n return (\n !!result &&\n typeof result === \"object\" &&\n Object.prototype.hasOwnProperty.call(result, \"structuredContent\")\n );\n}\n\n/**\n * Extract vision images from a raw MCP tool result so the model can SEE\n * screenshots/previews returned by external MCP tools instead of only the\n * `[image: <mime>]` placeholder that `flattenMcpToolResult` leaves in the\n * text. Shares the per-result caps with `_agentImages` (max count, max base64\n * size); over-cap or unsupported images stay placeholder-only. Never throws.\n */\nexport function extractMcpToolResultImages(\n result: unknown,\n): EngineToolResultImagePart[] {\n if (\n !result ||\n typeof result !== \"object\" ||\n !Array.isArray((result as any).content) ||\n (result as any).isError\n ) {\n return [];\n }\n const candidates = ((result as any).content as Array<Record<string, any>>)\n .filter((part) => part?.type === \"image\" && typeof part.data === \"string\")\n .map((part) => ({\n data: part.data as string,\n mediaType: typeof part.mimeType === \"string\" ? part.mimeType : undefined,\n }));\n return normalizeToolResultImages(candidates).images;\n}\n\nasync function buildMcpActionResult(\n manager: McpClientManager,\n tool: McpTool,\n input: Record<string, unknown>,\n raw: unknown,\n): Promise<McpActionResult> {\n const text = flattenMcpToolResult(raw);\n const mcpApp = await extractMcpAppPayload(manager, tool, input, raw);\n return {\n [MCP_ACTION_RESULT_MARKER]: true,\n text,\n raw,\n serverId: tool.source,\n toolName: tool.name,\n originalToolName: tool.originalName,\n input,\n ...(mcpApp ? { mcpApp } : {}),\n };\n}\n\nfunction buildMcpErrorActionResult(\n tool: McpTool,\n input: Record<string, unknown>,\n text: string,\n): McpActionResult {\n return {\n [MCP_ACTION_RESULT_MARKER]: true,\n text,\n raw: {\n isError: true,\n content: [{ type: \"text\", text }],\n },\n serverId: tool.source,\n toolName: tool.name,\n originalToolName: tool.originalName,\n input,\n };\n}\n\nasync function extractMcpAppPayload(\n manager: McpClientManager,\n tool: McpTool,\n input: Record<string, unknown>,\n raw: unknown,\n): Promise<AgentMcpAppPayload | undefined> {\n const inlineResource = findInlineMcpAppResource(raw);\n const resourceUri =\n inlineResource?.uri ??\n resourceUriFromTool(tool) ??\n resourceUriFromResult(raw);\n if (!resourceUri) return undefined;\n\n const resource =\n inlineResource ?? (await readMcpAppResource(manager, tool, resourceUri));\n\n return {\n serverId: tool.source,\n toolName: tool.name,\n originalToolName: tool.originalName,\n resourceUri,\n toolInput: input,\n toolResult:\n raw && typeof raw === \"object\"\n ? ({ ...(raw as Record<string, unknown>) } as Record<string, unknown>)\n : { content: [{ type: \"text\", text: String(raw ?? \"\") }] },\n tool: toolForMcpAppPayload(tool),\n ...(resource ? { resource } : {}),\n };\n}\n\nfunction resourceUriFromTool(tool: McpTool): string | undefined {\n try {\n return getToolUiResourceUri(tool.raw as any);\n } catch {\n return undefined;\n }\n}\n\nfunction resourceUriFromResult(raw: unknown): string | undefined {\n if (!raw || typeof raw !== \"object\") return undefined;\n const meta = (raw as any)._meta;\n const nested = meta?.ui?.resourceUri;\n if (typeof nested === \"string\" && nested.startsWith(\"ui://\")) return nested;\n const flat = meta?.[\"ui/resourceUri\"] ?? meta?.[\"ui.resourceUri\"];\n if (typeof flat === \"string\" && flat.startsWith(\"ui://\")) return flat;\n return findInlineMcpAppResource(raw)?.uri;\n}\n\nfunction findInlineMcpAppResource(\n raw: unknown,\n): AgentMcpAppResourceContent | undefined {\n if (!raw || typeof raw !== \"object\") return undefined;\n const content = Array.isArray((raw as any).content)\n ? ((raw as any).content as unknown[])\n : [];\n for (const part of content) {\n const resource = normalizeMcpAppResourceContent(part);\n if (resource) return resource;\n }\n return undefined;\n}\n\nfunction normalizeMcpAppResourceContent(\n part: unknown,\n): AgentMcpAppResourceContent | undefined {\n if (!part || typeof part !== \"object\") return undefined;\n const candidate =\n (part as any).type === \"resource\"\n ? (part as any).resource\n : ((part as any).resource ?? part);\n if (!candidate || typeof candidate !== \"object\") return undefined;\n const uri = (candidate as any).uri;\n if (typeof uri !== \"string\" || !uri.startsWith(\"ui://\")) return undefined;\n const mimeType =\n typeof (candidate as any).mimeType === \"string\"\n ? (candidate as any).mimeType\n : undefined;\n if (mimeType && !mimeType.includes(MCP_APP_MIME_TYPE)) return undefined;\n const text =\n typeof (candidate as any).text === \"string\"\n ? (candidate as any).text\n : undefined;\n const blob =\n typeof (candidate as any).blob === \"string\"\n ? (candidate as any).blob\n : undefined;\n const meta =\n (candidate as any)._meta && typeof (candidate as any)._meta === \"object\"\n ? ((candidate as any)._meta as Record<string, unknown>)\n : (part as any)._meta && typeof (part as any)._meta === \"object\"\n ? ((part as any)._meta as Record<string, unknown>)\n : undefined;\n return {\n uri,\n ...(mimeType ? { mimeType } : {}),\n ...(text ? { text } : {}),\n ...(blob ? { blob } : {}),\n ...(meta ? { _meta: meta } : {}),\n };\n}\n\nasync function readMcpAppResource(\n manager: McpClientManager,\n tool: McpTool,\n resourceUri: string,\n): Promise<AgentMcpAppResourceContent | undefined> {\n try {\n const result = await manager.readResourceForTool(tool.name, resourceUri);\n const contents = Array.isArray((result as any)?.contents)\n ? ((result as any).contents as unknown[])\n : [];\n for (const content of contents) {\n const resource = normalizeMcpAppResourceContent(content);\n if (\n resource?.uri === resourceUri ||\n (resource && contents.length === 1)\n ) {\n return resource;\n }\n }\n } catch (err: any) {\n console.warn(\n `[mcp-client] Failed to read MCP App resource ${resourceUri}: ${err?.message ?? err}`,\n );\n }\n return undefined;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/notifications/actions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAUhE,wBAAgB,6BAA6B,CAC3C,cAAc,EAAE,MAAM,MAAM,GAC3B,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAkI7B"}
1
+ {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/notifications/actions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAUhE,wBAAgB,6BAA6B,CAC3C,cAAc,EAAE,MAAM,MAAM,GAC3B,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAuI7B"}
@@ -66,6 +66,11 @@ export function createNotificationToolEntries(getCurrentUser) {
66
66
  required: ["action"],
67
67
  },
68
68
  },
69
+ planMode: {
70
+ effect: (args) => (args.action === "list" ? "read" : "write"),
71
+ allowedValues: { action: ["list"] },
72
+ description: "Plan mode allows listing notifications.",
73
+ },
69
74
  run: async (args) => {
70
75
  const owner = getCurrentUser();
71
76
  const action = args.action;
@@ -1 +1 @@
1
- {"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/notifications/actions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,MAAM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,GAAG,WAAW,cAAc,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;oBACxD,CAAC;oBAED;wBACE,OAAO,0BAA0B,MAAM,gCAAgC,CAAC;gBAC5E,CAAC;YACH,CAAC;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Framework-level agent actions for the notifications primitive.\n *\n * Registered as native tools (not template actions) so they're available in\n * every template. Consolidated into a single `manage-notifications` tool with\n * an `action` parameter that dispatches to the correct implementation.\n */\n\nimport type { ActionEntry } from \"../agent/production-agent.js\";\nimport { notify, listNotifications, countUnread } from \"./registry.js\";\nimport type { NotificationSeverity } from \"./types.js\";\n\nfunction parseLimit(value: unknown, fallback = 20): number {\n const n = Number(value ?? fallback);\n if (!Number.isFinite(n) || n <= 0) return fallback;\n return Math.min(Math.floor(n), 200);\n}\n\nexport function createNotificationToolEntries(\n getCurrentUser: () => string,\n): Record<string, ActionEntry> {\n return {\n \"manage-notifications\": {\n tool: {\n description: [\n \"Manage user notifications. Available actions:\",\n \"\",\n '• action=\"send\" — Send a notification to the user. Persisted to the in-app inbox so the bell + toast surface shows it. Registered channels (webhook, Slack, etc.) also run.',\n \" Required: severity, title. Optional: body, metadataJson, channels.\",\n \"\",\n '• action=\"list\" — List recent notifications for the current user. Useful when the user asks about prior alerts.',\n \" Optional: unreadOnly (boolean), limit (number, default 20, max 200).\",\n ].join(\"\\n\"),\n parameters: {\n type: \"object\" as const,\n properties: {\n action: {\n type: \"string\",\n enum: [\"send\", \"list\"],\n description: \"The notification action to perform.\",\n },\n severity: {\n type: \"string\",\n enum: [\"info\", \"warning\", \"critical\"],\n description:\n '(send) Severity level — drives styling and per-severity channel routing. Use \"info\" for FYI, \"warning\" for things the user should look at, \"critical\" for things that need immediate attention.',\n },\n title: {\n type: \"string\",\n description:\n \"(send) Short, human-readable headline (≤100 chars).\",\n },\n body: {\n type: \"string\",\n description: \"(send) Optional longer description.\",\n },\n metadataJson: {\n type: \"string\",\n description:\n '(send) Optional JSON metadata (URLs, entity ids, etc.). Example: \\'{\"threadId\":\"abc\",\"link\":\"/inbox/abc\"}\\'.',\n },\n channels: {\n type: \"string\",\n description:\n '(send) Optional comma-separated channel allowlist (e.g. \"inbox,webhook\"). Omit to run all registered channels.',\n },\n unreadOnly: {\n type: \"boolean\",\n description:\n \"(list) When true, only include unread notifications.\",\n },\n limit: {\n type: \"number\",\n description: \"(list) Max rows to return (default 20, max 200).\",\n },\n },\n required: [\"action\"],\n },\n },\n run: async (args: Record<string, unknown>) => {\n const owner = getCurrentUser();\n const action = args.action as string;\n\n switch (action) {\n case \"send\": {\n if (!args.severity || !args.title) {\n return \"Error: severity and title are required for action=send.\";\n }\n const severity = args.severity as NotificationSeverity;\n if (![\"info\", \"warning\", \"critical\"].includes(severity)) {\n return `Error: severity must be info, warning, or critical (got \"${severity}\").`;\n }\n\n let metadata: Record<string, unknown> | undefined;\n if (args.metadataJson) {\n try {\n metadata = JSON.parse(args.metadataJson as string);\n } catch {\n return \"Error: metadataJson must be valid JSON.\";\n }\n }\n\n const channels =\n typeof args.channels === \"string\"\n ? args.channels\n .split(\",\")\n .map((s) => s.trim())\n .filter(Boolean)\n : undefined;\n\n const stored = await notify(\n {\n severity,\n title: args.title as string,\n body: (args.body as string) || undefined,\n metadata,\n channels,\n },\n { owner },\n );\n return stored\n ? `Notification sent (id: ${stored.id})`\n : \"Notification dispatched to channels (not persisted).\";\n }\n\n case \"list\": {\n const rows = await listNotifications(owner, {\n unreadOnly:\n args.unreadOnly === true || args.unreadOnly === \"true\",\n limit: parseLimit(args.limit),\n });\n if (rows.length === 0) {\n return args.unreadOnly\n ? \"No unread notifications.\"\n : \"No notifications.\";\n }\n const unreadCount = await countUnread(owner);\n const lines = rows.map(\n (n) =>\n `[${n.readAt ? \" \" : \"•\"}] (${n.severity}) ${n.title}${n.body ? ` — ${n.body}` : \"\"} · ${n.createdAt}`,\n );\n return `${unreadCount} unread\\n\\n${lines.join(\"\\n\")}`;\n }\n\n default:\n return `Error: unknown action \"${action}\". Must be one of: send, list.`;\n }\n },\n },\n };\n}\n"]}
1
+ {"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/notifications/actions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGvE,SAAS,UAAU,CAAC,KAAc,EAAE,QAAQ,GAAG,EAAE;IAC/C,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,IAAI,QAAQ,CAAC,CAAC;IACpC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,QAAQ,CAAC;IACnD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,6BAA6B,CAC3C,cAA4B;IAE5B,OAAO;QACL,sBAAsB,EAAE;YACtB,IAAI,EAAE;gBACJ,WAAW,EAAE;oBACX,+CAA+C;oBAC/C,EAAE;oBACF,6KAA6K;oBAC7K,sEAAsE;oBACtE,EAAE;oBACF,iHAAiH;oBACjH,wEAAwE;iBACzE,CAAC,IAAI,CAAC,IAAI,CAAC;gBACZ,UAAU,EAAE;oBACV,IAAI,EAAE,QAAiB;oBACvB,UAAU,EAAE;wBACV,MAAM,EAAE;4BACN,IAAI,EAAE,QAAQ;4BACd,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;4BACtB,WAAW,EAAE,qCAAqC;yBACnD;wBACD,QAAQ,EAAE;4BACR,IAAI,EAAE,QAAQ;4BACd,IAAI,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,CAAC;4BACrC,WAAW,EACT,iMAAiM;yBACpM;wBACD,KAAK,EAAE;4BACL,IAAI,EAAE,QAAQ;4BACd,WAAW,EACT,qDAAqD;yBACxD;wBACD,IAAI,EAAE;4B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B,CAAC;wBACD,MAAM,WAAW,GAAG,MAAM,WAAW,CAAC,KAAK,CAAC,CAAC;wBAC7C,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CACpB,CAAC,CAAC,EAAE,EAAE,CACJ,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,SAAS,EAAE,CACzG,CAAC;wBACF,OAAO,GAAG,WAAW,cAAc,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;oBACxD,CAAC;oBAED;wBACE,OAAO,0BAA0B,MAAM,gCAAgC,CAAC;gBAC5E,CAAC;YACH,CAAC;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Framework-level agent actions for the notifications primitive.\n *\n * Registered as native tools (not template actions) so they're available in\n * every template. Consolidated into a single `manage-notifications` tool with\n * an `action` parameter that dispatches to the correct implementation.\n */\n\nimport type { ActionEntry } from \"../agent/production-agent.js\";\nimport { notify, listNotifications, countUnread } from \"./registry.js\";\nimport type { NotificationSeverity } from \"./types.js\";\n\nfunction parseLimit(value: unknown, fallback = 20): number {\n const n = Number(value ?? fallback);\n if (!Number.isFinite(n) || n <= 0) return fallback;\n return Math.min(Math.floor(n), 200);\n}\n\nexport function createNotificationToolEntries(\n getCurrentUser: () => string,\n): Record<string, ActionEntry> {\n return {\n \"manage-notifications\": {\n tool: {\n description: [\n \"Manage user notifications. Available actions:\",\n \"\",\n '• action=\"send\" — Send a notification to the user. Persisted to the in-app inbox so the bell + toast surface shows it. Registered channels (webhook, Slack, etc.) also run.',\n \" Required: severity, title. Optional: body, metadataJson, channels.\",\n \"\",\n '• action=\"list\" — List recent notifications for the current user. Useful when the user asks about prior alerts.',\n \" Optional: unreadOnly (boolean), limit (number, default 20, max 200).\",\n ].join(\"\\n\"),\n parameters: {\n type: \"object\" as const,\n properties: {\n action: {\n type: \"string\",\n enum: [\"send\", \"list\"],\n description: \"The notification action to perform.\",\n },\n severity: {\n type: \"string\",\n enum: [\"info\", \"warning\", \"critical\"],\n description:\n '(send) Severity level — drives styling and per-severity channel routing. Use \"info\" for FYI, \"warning\" for things the user should look at, \"critical\" for things that need immediate attention.',\n },\n title: {\n type: \"string\",\n description:\n \"(send) Short, human-readable headline (≤100 chars).\",\n },\n body: {\n type: \"string\",\n description: \"(send) Optional longer description.\",\n },\n metadataJson: {\n type: \"string\",\n description:\n '(send) Optional JSON metadata (URLs, entity ids, etc.). Example: \\'{\"threadId\":\"abc\",\"link\":\"/inbox/abc\"}\\'.',\n },\n channels: {\n type: \"string\",\n description:\n '(send) Optional comma-separated channel allowlist (e.g. \"inbox,webhook\"). Omit to run all registered channels.',\n },\n unreadOnly: {\n type: \"boolean\",\n description:\n \"(list) When true, only include unread notifications.\",\n },\n limit: {\n type: \"number\",\n description: \"(list) Max rows to return (default 20, max 200).\",\n },\n },\n required: [\"action\"],\n },\n },\n planMode: {\n effect: (args) => (args.action === \"list\" ? \"read\" : \"write\"),\n allowedValues: { action: [\"list\"] },\n description: \"Plan mode allows listing notifications.\",\n },\n run: async (args: Record<string, unknown>) => {\n const owner = getCurrentUser();\n const action = args.action as string;\n\n switch (action) {\n case \"send\": {\n if (!args.severity || !args.title) {\n return \"Error: severity and title are required for action=send.\";\n }\n const severity = args.severity as NotificationSeverity;\n if (![\"info\", \"warning\", \"critical\"].includes(severity)) {\n return `Error: severity must be info, warning, or critical (got \"${severity}\").`;\n }\n\n let metadata: Record<string, unknown> | undefined;\n if (args.metadataJson) {\n try {\n metadata = JSON.parse(args.metadataJson as string);\n } catch {\n return \"Error: metadataJson must be valid JSON.\";\n }\n }\n\n const channels =\n typeof args.channels === \"string\"\n ? args.channels\n .split(\",\")\n .map((s) => s.trim())\n .filter(Boolean)\n : undefined;\n\n const stored = await notify(\n {\n severity,\n title: args.title as string,\n body: (args.body as string) || undefined,\n metadata,\n channels,\n },\n { owner },\n );\n return stored\n ? `Notification sent (id: ${stored.id})`\n : \"Notification dispatched to channels (not persisted).\";\n }\n\n case \"list\": {\n const rows = await listNotifications(owner, {\n unreadOnly:\n args.unreadOnly === true || args.unreadOnly === \"true\",\n limit: parseLimit(args.limit),\n });\n if (rows.length === 0) {\n return args.unreadOnly\n ? \"No unread notifications.\"\n : \"No notifications.\";\n }\n const unreadCount = await countUnread(owner);\n const lines = rows.map(\n (n) =>\n `[${n.readAt ? \" \" : \"•\"}] (${n.severity}) ${n.title}${n.body ? ` — ${n.body}` : \"\"} · ${n.createdAt}`,\n );\n return `${unreadCount} unread\\n\\n${lines.join(\"\\n\")}`;\n }\n\n default:\n return `Error: unknown action \"${action}\". Must be one of: send, list.`;\n }\n },\n },\n };\n}\n"]}
@@ -11,14 +11,14 @@
11
11
  * DELETE /_agent-native/notifications/:id — delete
12
12
  */
13
13
  export declare function createNotificationsHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<"" | import("./types.js").Notification[] | {
14
- error?: undefined;
15
14
  count: number;
16
15
  updated?: undefined;
16
+ error?: undefined;
17
17
  ok?: undefined;
18
18
  } | {
19
- error?: undefined;
20
19
  count?: undefined;
21
20
  updated: number;
21
+ error?: undefined;
22
22
  ok?: undefined;
23
23
  } | {
24
24
  count?: undefined;
@@ -26,9 +26,9 @@ export declare function createNotificationsHandler(): import("h3").EventHandlerW
26
26
  error: string;
27
27
  ok?: undefined;
28
28
  } | {
29
- error?: undefined;
30
29
  count?: undefined;
31
30
  updated?: undefined;
32
31
  ok: boolean;
32
+ error?: undefined;
33
33
  }>>;
34
34
  //# sourceMappingURL=routes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/progress/actions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAchE,wBAAgB,yBAAyB,CACvC,cAAc,EAAE,MAAM,MAAM,GAC3B,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAyJ7B"}
1
+ {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/progress/actions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAchE,wBAAgB,yBAAyB,CACvC,cAAc,EAAE,MAAM,MAAM,GAC3B,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CA8J7B"}
@@ -78,6 +78,11 @@ Actions:
78
78
  required: ["action"],
79
79
  },
80
80
  },
81
+ planMode: {
82
+ effect: (args) => (args.action === "list" ? "read" : "write"),
83
+ allowedValues: { action: ["list"] },
84
+ description: "Plan mode allows listing recent progress runs.",
85
+ },
81
86
  run: async (args) => {
82
87
  const owner = getCurrentUser();
83
88
  const action = String(args.action ?? "");
@@ -1 +1 @@
1
- {"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/progress/actions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EACL,QAAQ,EACR,iBAAiB,EACjB,WAAW,EACX,QAAQ,GACT,MAAM,eAAe,CAAC;AAEvB,SAAS,UAAU,CAAC,KAAc,EAAE,QAAQ,GAAG,EAAE;IAC/C,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,IAAI,QAAQ,CAAC,CAAC;IACpC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,QAAQ,CAAC;IACnD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,yBAAyB,CACvC,cAA4B;IAE5B,OAAO;QACL,iBAAiB,E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AAK,CAAC;yBAC9B,CAAC,CAAC;wBACH,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;4BACtB,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,UAAU,CAAC;wBACtD,CAAC;wBACD,OAAO,IAAI;6BACR,GAAG,CACF,CAAC,CAAC,EAAE,EAAE,CACJ,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,SAAS,EAAE,CAC3H;6BACA,IAAI,CAAC,IAAI,CAAC,CAAC;oBAChB,CAAC;oBAED;wBACE,OAAO,0BAA0B,MAAM,+CAA+C,CAAC;gBAC3F,CAAC;YACH,CAAC;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Framework-level agent tools for the progress primitive. Registered as\n * native tools so every template exposes them. Use from long agent loops\n * to communicate status to the user while work is still in-flight.\n *\n * All operations are consolidated into a single `manage-progress` tool\n * with an `action` discriminator.\n */\n\nimport type { ActionEntry } from \"../agent/production-agent.js\";\nimport {\n startRun,\n updateRunProgress,\n completeRun,\n listRuns,\n} from \"./registry.js\";\n\nfunction parseLimit(value: unknown, fallback = 20): number {\n const n = Number(value ?? fallback);\n if (!Number.isFinite(n) || n <= 0) return fallback;\n return Math.min(Math.floor(n), 200);\n}\n\nexport function createProgressToolEntries(\n getCurrentUser: () => string,\n): Record<string, ActionEntry> {\n return {\n \"manage-progress\": {\n tool: {\n description: `Track multi-step task progress visible to the user in the runs tray.\n\nUse for non-trivial work with multiple real steps (not single-action lookups). Do NOT create single-step plans. Skip for trivial tasks that finish in one tool call.\n\n**Discipline:**\n- Exactly one task in progress at a time; never batch-complete steps after the fact — update as you go.\n- Always transition pending → in_progress before completing a step.\n- If the task pivots (scope change, unexpected blocker), update the current step to reflect it before continuing.\n- Only include fields for the selected action; do not send empty placeholder fields.\n- End every run with \"complete\" (succeeded / failed / cancelled). Never leave a run open indefinitely.\n\nActions:\n• \"start\" — Begin tracking. Returns a runId for subsequent calls. Params: title (required, short human description e.g. \"Triage 42 emails\"), step (optional initial step), metadataJson (optional JSON with link/thread/artifact info).\n• \"update\" — Report progress. Call after each meaningful milestone. Params: runId (required), percent (optional 0–100 when a bound is known), step (optional current step text). Omitted fields stay unchanged.\n• \"complete\" — Mark finished. Params: runId (required), status (required: \"succeeded\" | \"failed\" | \"cancelled\"), step (optional final step text). Pair with \\`notify\\` when the user should be alerted.\n• \"list\" — List recent runs. Use when the user asks \"what is still running\" or \"what did you do earlier\". Params: active (optional boolean, filter to in-progress only), limit (optional number, default 20, max 200).`,\n parameters: {\n type: \"object\" as const,\n properties: {\n action: {\n type: \"string\",\n enum: [\"start\", \"update\", \"complete\", \"list\"],\n description:\n 'The operation to perform: \"start\" a new run, \"update\" progress, \"complete\" a run, or \"list\" recent runs.',\n },\n title: {\n type: \"string\",\n description:\n '[start] Short human-readable title, e.g. \"Triage 128 unread emails\".',\n },\n step: {\n type: \"string\",\n description:\n '[start/update/complete] Step description, e.g. \"Fetching inbox\" or \"Drafting reply 23/100\".',\n },\n metadataJson: {\n type: \"string\",\n description:\n \"[start] Optional JSON metadata: link, thread id, artifact path, etc.\",\n },\n runId: {\n type: \"string\",\n description:\n '[update/complete] The id returned by a \"start\" action.',\n },\n percent: {\n type: \"number\",\n description:\n \"[update] Progress 0–100. Omit if the task has no known upper bound.\",\n },\n status: {\n type: \"string\",\n enum: [\"\", \"succeeded\", \"failed\", \"cancelled\"],\n description:\n '[complete] Terminal status for the run. Omit it for \"start\" and \"update\".',\n },\n active: {\n type: \"boolean\",\n description:\n \"[list] When true, only return runs still in progress.\",\n },\n limit: {\n type: \"number\",\n description: \"[list] Max rows (default 20, max 200).\",\n },\n },\n required: [\"action\"],\n },\n },\n run: async (args: Record<string, unknown>) => {\n const owner = getCurrentUser();\n const action = String(args.action ?? \"\");\n\n switch (action) {\n case \"start\": {\n const title = args.title ? String(args.title) : \"\";\n if (!title) return \"Error: title is required for the start action.\";\n let metadata: Record<string, unknown> | undefined;\n if (args.metadataJson) {\n try {\n metadata = JSON.parse(String(args.metadataJson));\n } catch {\n return \"Error: metadataJson must be valid JSON.\";\n }\n }\n const run = await startRun({\n owner,\n title,\n step: args.step ? String(args.step) : undefined,\n metadata,\n });\n return `Run started. runId=${run.id}`;\n }\n\n case \"update\": {\n const runId = String(args.runId ?? \"\");\n if (!runId)\n return \"Error: runId is required for the update action.\";\n const percent =\n args.percent == null ? undefined : Number(args.percent);\n const run = await updateRunProgress(runId, owner, {\n percent,\n step: args.step ? String(args.step) : undefined,\n });\n if (!run) return `Error: run ${runId} not found.`;\n return `Run updated (percent=${run.percent ?? \"?\"}, step=${run.step ?? \"\"}).`;\n }\n\n case \"complete\": {\n const runId = String(args.runId ?? \"\");\n const status = String(args.status ?? \"\");\n if (!runId || !status) {\n return \"Error: runId and status are required for the complete action.\";\n }\n if (![\"succeeded\", \"failed\", \"cancelled\"].includes(status)) {\n return 'Error: status must be \"succeeded\", \"failed\", or \"cancelled\".';\n }\n const run = await completeRun(\n runId,\n owner,\n status as \"succeeded\" | \"failed\" | \"cancelled\",\n args.step ? { step: String(args.step) } : undefined,\n );\n if (!run) return `Error: run ${runId} not found.`;\n return `Run ${run.id} completed with status=${run.status}.`;\n }\n\n case \"list\": {\n const rows = await listRuns(owner, {\n activeOnly: args.active === true || args.active === \"true\",\n limit: parseLimit(args.limit),\n });\n if (rows.length === 0) {\n return args.active ? \"No active runs.\" : \"No runs.\";\n }\n return rows\n .map(\n (r) =>\n `[${r.status}] ${r.title}${r.percent != null ? ` · ${r.percent}%` : \"\"}${r.step ? ` — ${r.step}` : \"\"} · ${r.startedAt}`,\n )\n .join(\"\\n\");\n }\n\n default:\n return `Error: unknown action \"${action}\". Use one of: start, update, complete, list.`;\n }\n },\n },\n };\n}\n"]}
1
+ {"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/progress/actions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EACL,QAAQ,EACR,iBAAiB,EACjB,WAAW,EACX,QAAQ,GACT,MAAM,eAAe,CAAC;AAEvB,SAAS,UAAU,CAAC,KAAc,EAAE,QAAQ,GAAG,EAAE;IAC/C,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,IAAI,QAAQ,CAAC,CAAC;IACpC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,QAAQ,CAAC;IACnD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,yBAAyB,CACvC,cAA4B;IAE5B,OAAO;QACL,iBAAiB,EAAE;YACjB,IAAI,EAAE;gBACJ,WAAW,EAAE;;;;;;;;;;;;;;;uNAekM;gBAC/M,UAAU,EAAE;oBACV,IAAI,EAAE,QAAiB;oBACvB,UAAU,EAAE;wBACV,MAAM,EAAE;4BACN,IAAI,EAAE,QAAQ;4BACd,IAAI,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,CAAC;4BAC7C,WAAW,EACT,0GAA0G;yBAC7G;wBACD,KAAK,EAAE;4BACL,IAAI,EAAE,QAAQ;4BACd,WAAW,EACT,sEAAsE;yBACzE;wBACD,IAAI,EAAE;4BACJ,IAAI,EAAE,QAAQ;4BACd,WAAW,EACT,6FAA6F;yBAChG;wBACD,YAAY,EAAE;4BACZ,IAAI,EAAE,QAAQ;4BACd,WAAW,EACT,sEAAsE;yBACzE;wBACD,KAAK,EAAE;4BACL,IAAI,EAAE,QAAQ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AG,CAAC,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,SAAS,EAAE,CAC3H;6BACA,IAAI,CAAC,IAAI,CAAC,CAAC;oBAChB,CAAC;oBAED;wBACE,OAAO,0BAA0B,MAAM,+CAA+C,CAAC;gBAC3F,CAAC;YACH,CAAC;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Framework-level agent tools for the progress primitive. Registered as\n * native tools so every template exposes them. Use from long agent loops\n * to communicate status to the user while work is still in-flight.\n *\n * All operations are consolidated into a single `manage-progress` tool\n * with an `action` discriminator.\n */\n\nimport type { ActionEntry } from \"../agent/production-agent.js\";\nimport {\n startRun,\n updateRunProgress,\n completeRun,\n listRuns,\n} from \"./registry.js\";\n\nfunction parseLimit(value: unknown, fallback = 20): number {\n const n = Number(value ?? fallback);\n if (!Number.isFinite(n) || n <= 0) return fallback;\n return Math.min(Math.floor(n), 200);\n}\n\nexport function createProgressToolEntries(\n getCurrentUser: () => string,\n): Record<string, ActionEntry> {\n return {\n \"manage-progress\": {\n tool: {\n description: `Track multi-step task progress visible to the user in the runs tray.\n\nUse for non-trivial work with multiple real steps (not single-action lookups). Do NOT create single-step plans. Skip for trivial tasks that finish in one tool call.\n\n**Discipline:**\n- Exactly one task in progress at a time; never batch-complete steps after the fact — update as you go.\n- Always transition pending → in_progress before completing a step.\n- If the task pivots (scope change, unexpected blocker), update the current step to reflect it before continuing.\n- Only include fields for the selected action; do not send empty placeholder fields.\n- End every run with \"complete\" (succeeded / failed / cancelled). Never leave a run open indefinitely.\n\nActions:\n• \"start\" — Begin tracking. Returns a runId for subsequent calls. Params: title (required, short human description e.g. \"Triage 42 emails\"), step (optional initial step), metadataJson (optional JSON with link/thread/artifact info).\n• \"update\" — Report progress. Call after each meaningful milestone. Params: runId (required), percent (optional 0–100 when a bound is known), step (optional current step text). Omitted fields stay unchanged.\n• \"complete\" — Mark finished. Params: runId (required), status (required: \"succeeded\" | \"failed\" | \"cancelled\"), step (optional final step text). Pair with \\`notify\\` when the user should be alerted.\n• \"list\" — List recent runs. Use when the user asks \"what is still running\" or \"what did you do earlier\". Params: active (optional boolean, filter to in-progress only), limit (optional number, default 20, max 200).`,\n parameters: {\n type: \"object\" as const,\n properties: {\n action: {\n type: \"string\",\n enum: [\"start\", \"update\", \"complete\", \"list\"],\n description:\n 'The operation to perform: \"start\" a new run, \"update\" progress, \"complete\" a run, or \"list\" recent runs.',\n },\n title: {\n type: \"string\",\n description:\n '[start] Short human-readable title, e.g. \"Triage 128 unread emails\".',\n },\n step: {\n type: \"string\",\n description:\n '[start/update/complete] Step description, e.g. \"Fetching inbox\" or \"Drafting reply 23/100\".',\n },\n metadataJson: {\n type: \"string\",\n description:\n \"[start] Optional JSON metadata: link, thread id, artifact path, etc.\",\n },\n runId: {\n type: \"string\",\n description:\n '[update/complete] The id returned by a \"start\" action.',\n },\n percent: {\n type: \"number\",\n description:\n \"[update] Progress 0–100. Omit if the task has no known upper bound.\",\n },\n status: {\n type: \"string\",\n enum: [\"\", \"succeeded\", \"failed\", \"cancelled\"],\n description:\n '[complete] Terminal status for the run. Omit it for \"start\" and \"update\".',\n },\n active: {\n type: \"boolean\",\n description:\n \"[list] When true, only return runs still in progress.\",\n },\n limit: {\n type: \"number\",\n description: \"[list] Max rows (default 20, max 200).\",\n },\n },\n required: [\"action\"],\n },\n },\n planMode: {\n effect: (args) => (args.action === \"list\" ? \"read\" : \"write\"),\n allowedValues: { action: [\"list\"] },\n description: \"Plan mode allows listing recent progress runs.\",\n },\n run: async (args: Record<string, unknown>) => {\n const owner = getCurrentUser();\n const action = String(args.action ?? \"\");\n\n switch (action) {\n case \"start\": {\n const title = args.title ? String(args.title) : \"\";\n if (!title) return \"Error: title is required for the start action.\";\n let metadata: Record<string, unknown> | undefined;\n if (args.metadataJson) {\n try {\n metadata = JSON.parse(String(args.metadataJson));\n } catch {\n return \"Error: metadataJson must be valid JSON.\";\n }\n }\n const run = await startRun({\n owner,\n title,\n step: args.step ? String(args.step) : undefined,\n metadata,\n });\n return `Run started. runId=${run.id}`;\n }\n\n case \"update\": {\n const runId = String(args.runId ?? \"\");\n if (!runId)\n return \"Error: runId is required for the update action.\";\n const percent =\n args.percent == null ? undefined : Number(args.percent);\n const run = await updateRunProgress(runId, owner, {\n percent,\n step: args.step ? String(args.step) : undefined,\n });\n if (!run) return `Error: run ${runId} not found.`;\n return `Run updated (percent=${run.percent ?? \"?\"}, step=${run.step ?? \"\"}).`;\n }\n\n case \"complete\": {\n const runId = String(args.runId ?? \"\");\n const status = String(args.status ?? \"\");\n if (!runId || !status) {\n return \"Error: runId and status are required for the complete action.\";\n }\n if (![\"succeeded\", \"failed\", \"cancelled\"].includes(status)) {\n return 'Error: status must be \"succeeded\", \"failed\", or \"cancelled\".';\n }\n const run = await completeRun(\n runId,\n owner,\n status as \"succeeded\" | \"failed\" | \"cancelled\",\n args.step ? { step: String(args.step) } : undefined,\n );\n if (!run) return `Error: run ${runId} not found.`;\n return `Run ${run.id} completed with status=${run.status}.`;\n }\n\n case \"list\": {\n const rows = await listRuns(owner, {\n activeOnly: args.active === true || args.active === \"true\",\n limit: parseLimit(args.limit),\n });\n if (rows.length === 0) {\n return args.active ? \"No active runs.\" : \"No runs.\";\n }\n return rows\n .map(\n (r) =>\n `[${r.status}] ${r.title}${r.percent != null ? ` · ${r.percent}%` : \"\"}${r.step ? ` — ${r.step}` : \"\"} · ${r.startedAt}`,\n )\n .join(\"\\n\");\n }\n\n default:\n return `Error: unknown action \"${action}\". Use one of: start, update, complete, list.`;\n }\n },\n },\n };\n}\n"]}
@@ -76,10 +76,7 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
76
76
  }>>;
77
77
  }, z.core.$strip>>, {
78
78
  id?: undefined;
79
- message?: undefined;
80
- provider?: undefined;
81
79
  deleted?: undefined;
82
- found?: undefined;
83
80
  providers: {
84
81
  id: string;
85
82
  label: string;
@@ -90,44 +87,47 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
90
87
  updatedAt: number;
91
88
  }[];
92
89
  count: number;
90
+ provider?: undefined;
91
+ found?: undefined;
93
92
  registered?: undefined;
94
93
  label?: undefined;
94
+ message?: undefined;
95
95
  } | {
96
+ count?: undefined;
96
97
  id?: undefined;
97
- message?: undefined;
98
98
  deleted?: undefined;
99
99
  providers?: undefined;
100
- count?: undefined;
101
100
  found: boolean;
102
101
  provider: import("../custom-registry.js").CustomProviderConfig;
103
102
  registered?: undefined;
104
103
  label?: undefined;
105
- } | {
106
104
  message?: undefined;
107
- provider?: undefined;
105
+ } | {
106
+ count?: undefined;
108
107
  deleted?: undefined;
109
108
  providers?: undefined;
110
- count?: undefined;
109
+ provider?: undefined;
111
110
  found: boolean;
112
111
  id: string;
113
112
  registered?: undefined;
114
113
  label?: undefined;
115
- } | {
116
114
  message?: undefined;
115
+ } | {
116
+ count?: undefined;
117
+ providers?: undefined;
117
118
  provider?: undefined;
118
119
  found?: undefined;
119
- providers?: undefined;
120
- count?: undefined;
121
120
  deleted: boolean;
122
121
  id: string;
123
122
  registered?: undefined;
124
123
  label?: undefined;
124
+ message?: undefined;
125
125
  } | {
126
- provider?: undefined;
126
+ count?: undefined;
127
127
  deleted?: undefined;
128
- found?: undefined;
129
128
  providers?: undefined;
130
- count?: undefined;
129
+ provider?: undefined;
130
+ found?: undefined;
131
131
  registered: boolean;
132
132
  id: string;
133
133
  label: string;
@@ -1 +1 @@
1
- {"version":3,"file":"github-repo-files.d.ts","sourceRoot":"","sources":["../../../src/provider-api/actions/github-repo-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAMV,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAQrB,QAAA,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6H/B,CAAC;AAIH,MAAM,WAAW,kCAAkC;IACjD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC;AAED,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,IAAI,CACX,kBAAkB,EAChB,2BAA2B,GAC3B,6BAA6B,GAC7B,0BAA0B,GAC1B,2BAA2B,GAC3B,4BAA4B,CAC/B,EACD,OAAO,GAAE,kCAAuC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kOAsGjD;AAED,OAAO,EAAE,2BAA2B,EAAE,CAAC"}
1
+ {"version":3,"file":"github-repo-files.d.ts","sourceRoot":"","sources":["../../../src/provider-api/actions/github-repo-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAMV,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAQrB,QAAA,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6H/B,CAAC;AAIH,MAAM,WAAW,kCAAkC;IACjD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC;AAED,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,IAAI,CACX,kBAAkB,EAChB,2BAA2B,GAC3B,6BAA6B,GAC7B,0BAA0B,GAC1B,2BAA2B,GAC3B,4BAA4B,CAC/B,EACD,OAAO,GAAE,kCAAuC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kOAiHjD;AAED,OAAO,EAAE,2BAA2B,EAAE,CAAC"}
@@ -118,6 +118,15 @@ export function createGitHubRepoFilesAction(runtime, options = {}) {
118
118
  "List, search, read, create/update, and delete GitHub repository files through the configured GitHub connector or GITHUB_TOKEN. Uses GitHub REST APIs directly; it does not clone repositories or use a filesystem sandbox.",
119
119
  schema: GitHubRepoFilesActionSchema,
120
120
  http: false,
121
+ planMode: {
122
+ effect: (args) => args.operation === "list" ||
123
+ args.operation === "search" ||
124
+ args.operation === "read"
125
+ ? "read"
126
+ : "write",
127
+ allowedValues: { operation: ["list", "search", "read"] },
128
+ description: "Plan mode allows listing, searching, and reading repository files.",
129
+ },
121
130
  needsApproval: requireApprovalForWrites
122
131
  ? (args) => args.operation === "write" || args.operation === "delete"
123
132
  : false,
@@ -1 +1 @@
1
- {"version":3,"file":"github-repo-files.js","sourceRoot":"","sources":["../../../src/provider-api/actions/github-repo-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAU/C,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,uBAAuB,CAAC;IACzD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,wBAAwB,CAAC;IAC5D,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;CAChE,CAAC,CAAC;AAEH,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,SAAS,EAAE,CAAC;SACT,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;SACnD,QAAQ,CACP,iIAAiI,CAClI;IACH,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,mCAAmC,CAAC;IACtE,IAAI,EAAE,CAAC;SACJ,MAAM,EAAE;SACR,GAAG,CAAC,CAAC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AAQ;aACgB,CAAC,CAAC;QAC7C,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,OAAO,EAAE,2BAA2B,EAAE,CAAC","sourcesContent":["import { z } from \"zod\";\n\nimport { defineAction } from \"../../action.js\";\nimport type {\n GitHubRepositoryFileDeleteArgs,\n GitHubRepositoryFileListArgs,\n GitHubRepositoryFileReadArgs,\n GitHubRepositoryFileSearchArgs,\n GitHubRepositoryFileWriteArgs,\n ProviderApiRuntime,\n} from \"../index.js\";\n\nconst GitHubCommitIdentitySchema = z.object({\n name: z.string().min(1).describe(\"Commit identity name.\"),\n email: z.string().email().describe(\"Commit identity email.\"),\n date: z.string().optional().describe(\"Optional ISO timestamp.\"),\n});\n\nconst GitHubRepoFilesActionSchema = z.object({\n operation: z\n .enum([\"list\", \"search\", \"read\", \"write\", \"delete\"])\n .describe(\n \"Operation to perform: list repository file paths, search code/files, read one file, create/update one file, or delete one file.\",\n ),\n owner: z.string().min(1).describe(\"Repository owner or organization.\"),\n repo: z\n .string()\n .min(1)\n .describe(\"Repository name, with or without a trailing .git suffix.\"),\n path: z\n .string()\n .optional()\n .describe(\n \"Repository-relative file or directory path. For search without query, this filters matching paths.\",\n ),\n ref: z\n .string()\n .optional()\n .describe(\n \"Branch, tag, or commit-ish for list/read. Code search uses GitHub's default-branch search.\",\n ),\n recursive: z\n .boolean()\n .optional()\n .describe(\"For list, read the repository tree recursively.\"),\n includeDirectories: z\n .boolean()\n .optional()\n .describe(\"For list, include directory entries along with files.\"),\n query: z\n .string()\n .optional()\n .describe(\n \"For search, a GitHub code-search term. Omit to search/filter file paths from the repository tree.\",\n ),\n filename: z\n .string()\n .optional()\n .describe(\"For search, restrict to an exact filename.\"),\n extension: z\n .string()\n .optional()\n .describe(\"For search, restrict to a file extension such as ts or md.\"),\n language: z\n .string()\n .optional()\n .describe(\"For code search, restrict to a GitHub language qualifier.\"),\n page: z.coerce\n .number()\n .int()\n .min(1)\n .max(100)\n .optional()\n .describe(\"For code search, result page to fetch.\"),\n perPage: z.coerce\n .number()\n .int()\n .min(1)\n .max(100)\n .optional()\n .describe(\"For code search, results per page.\"),\n maxFiles: z.coerce\n .number()\n .int()\n .min(1)\n .max(10_000)\n .optional()\n .describe(\n \"Maximum file entries to return from list or tree-filter search.\",\n ),\n includeTextMatches: z\n .boolean()\n .optional()\n .describe(\"For code search, request GitHub text-match metadata.\"),\n content: z\n .string()\n .optional()\n .describe(\"For write, complete replacement UTF-8 file content.\"),\n message: z.string().optional().describe(\"For write, commit message.\"),\n branch: z\n .string()\n .optional()\n .describe(\n \"For write, branch to create/update on. Defaults to GitHub's default branch.\",\n ),\n sha: z\n .string()\n .optional()\n .describe(\n \"For write updates, the current blob SHA. The action reads it first by default when omitted.\",\n ),\n overwriteExisting: z\n .boolean()\n .optional()\n .describe(\n \"For write, read the current file SHA first when sha is omitted, then update if it exists. Defaults to true.\",\n ),\n committer: GitHubCommitIdentitySchema.optional().describe(\n \"Optional GitHub contents API committer identity.\",\n ),\n author: GitHubCommitIdentitySchema.optional().describe(\n \"Optional GitHub contents API author identity.\",\n ),\n connectionId: z\n .string()\n .trim()\n .min(1)\n .optional()\n .describe(\"Optional workspace GitHub connection id to use.\"),\n timeoutMs: z.coerce\n .number()\n .int()\n .min(1_000)\n .max(120_000)\n .optional()\n .describe(\"Request timeout in milliseconds.\"),\n maxBytes: z.coerce\n .number()\n .int()\n .min(1_000)\n .max(4 * 1024 * 1024)\n .optional()\n .describe(\"Maximum provider response bytes to read.\"),\n});\n\ntype GitHubRepoFilesActionArgs = z.infer<typeof GitHubRepoFilesActionSchema>;\n\nexport interface CreateGitHubRepoFilesActionOptions {\n description?: string;\n requireApprovalForWrites?: boolean;\n}\n\nexport function createGitHubRepoFilesAction(\n runtime: Pick<\n ProviderApiRuntime,\n | \"listGitHubRepositoryFiles\"\n | \"searchGitHubRepositoryFiles\"\n | \"readGitHubRepositoryFile\"\n | \"writeGitHubRepositoryFile\"\n | \"deleteGitHubRepositoryFile\"\n >,\n options: CreateGitHubRepoFilesActionOptions = {},\n) {\n const requireApprovalForWrites = options.requireApprovalForWrites ?? true;\n return defineAction({\n description:\n options.description ??\n \"List, search, read, create/update, and delete GitHub repository files through the configured GitHub connector or GITHUB_TOKEN. Uses GitHub REST APIs directly; it does not clone repositories or use a filesystem sandbox.\",\n schema: GitHubRepoFilesActionSchema,\n http: false,\n needsApproval: requireApprovalForWrites\n ? (args: GitHubRepoFilesActionArgs) =>\n args.operation === \"write\" || args.operation === \"delete\"\n : false,\n run: async (args) => {\n if (args.operation === \"list\") {\n return runtime.listGitHubRepositoryFiles({\n owner: args.owner,\n repo: args.repo,\n path: args.path,\n ref: args.ref,\n recursive: args.recursive,\n includeDirectories: args.includeDirectories,\n maxFiles: args.maxFiles,\n connectionId: args.connectionId,\n timeoutMs: args.timeoutMs,\n maxBytes: args.maxBytes,\n } satisfies GitHubRepositoryFileListArgs);\n }\n\n if (args.operation === \"search\") {\n return runtime.searchGitHubRepositoryFiles({\n owner: args.owner,\n repo: args.repo,\n query: args.query,\n path: args.path,\n filename: args.filename,\n extension: args.extension,\n language: args.language,\n ref: args.ref,\n perPage: args.perPage,\n page: args.page,\n maxFiles: args.maxFiles,\n includeTextMatches: args.includeTextMatches,\n connectionId: args.connectionId,\n timeoutMs: args.timeoutMs,\n maxBytes: args.maxBytes,\n } satisfies GitHubRepositoryFileSearchArgs);\n }\n\n if (args.operation === \"read\") {\n if (!args.path) throw new Error(\"path is required for read.\");\n return runtime.readGitHubRepositoryFile({\n owner: args.owner,\n repo: args.repo,\n path: args.path,\n ref: args.ref,\n connectionId: args.connectionId,\n timeoutMs: args.timeoutMs,\n maxBytes: args.maxBytes,\n } satisfies GitHubRepositoryFileReadArgs);\n }\n\n if (!args.path) {\n throw new Error(`path is required for ${args.operation}.`);\n }\n if (args.operation === \"delete\") {\n return runtime.deleteGitHubRepositoryFile({\n owner: args.owner,\n repo: args.repo,\n path: args.path,\n message: args.message ?? `Delete ${args.path}`,\n branch: args.branch,\n sha: args.sha,\n committer: args.committer,\n author: args.author,\n connectionId: args.connectionId,\n timeoutMs: args.timeoutMs,\n maxBytes: args.maxBytes,\n } satisfies GitHubRepositoryFileDeleteArgs);\n }\n\n if (args.content === undefined) {\n throw new Error(\"content is required for write.\");\n }\n if (!args.message) throw new Error(\"message is required for write.\");\n return runtime.writeGitHubRepositoryFile({\n owner: args.owner,\n repo: args.repo,\n path: args.path,\n content: args.content,\n message: args.message,\n branch: args.branch,\n sha: args.sha,\n overwriteExisting: args.overwriteExisting ?? true,\n committer: args.committer,\n author: args.author,\n connectionId: args.connectionId,\n timeoutMs: args.timeoutMs,\n maxBytes: args.maxBytes,\n } satisfies GitHubRepositoryFileWriteArgs);\n },\n });\n}\n\nexport { GitHubRepoFilesActionSchema };\n"]}
1
+ {"version":3,"file":"github-repo-files.js","sourceRoot":"","sources":["../../../src/provider-api/actions/github-repo-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAU/C,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,uBAAuB,CAAC;IACzD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,wBAAwB,CAAC;IAC5D,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;CAChE,CAAC,CAAC;AAEH,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,SAAS,EAAE,CAAC;SACT,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;SACnD,QAAQ,CACP,iIAAiI,CAClI;IACH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AAC;gBACvC,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,GAAG,EAAE,IAAI,CAAC,GAAG;gBACb,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,IAAI,IAAI;gBACjD,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,YAAY,EAAE,IAAI,CAAC,YAAY;gBAC/B,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,QAAQ,EAAE,IAAI,CAAC,QAAQ;aACgB,CAAC,CAAC;QAC7C,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,OAAO,EAAE,2BAA2B,EAAE,CAAC","sourcesContent":["import { z } from \"zod\";\n\nimport { defineAction } from \"../../action.js\";\nimport type {\n GitHubRepositoryFileDeleteArgs,\n GitHubRepositoryFileListArgs,\n GitHubRepositoryFileReadArgs,\n GitHubRepositoryFileSearchArgs,\n GitHubRepositoryFileWriteArgs,\n ProviderApiRuntime,\n} from \"../index.js\";\n\nconst GitHubCommitIdentitySchema = z.object({\n name: z.string().min(1).describe(\"Commit identity name.\"),\n email: z.string().email().describe(\"Commit identity email.\"),\n date: z.string().optional().describe(\"Optional ISO timestamp.\"),\n});\n\nconst GitHubRepoFilesActionSchema = z.object({\n operation: z\n .enum([\"list\", \"search\", \"read\", \"write\", \"delete\"])\n .describe(\n \"Operation to perform: list repository file paths, search code/files, read one file, create/update one file, or delete one file.\",\n ),\n owner: z.string().min(1).describe(\"Repository owner or organization.\"),\n repo: z\n .string()\n .min(1)\n .describe(\"Repository name, with or without a trailing .git suffix.\"),\n path: z\n .string()\n .optional()\n .describe(\n \"Repository-relative file or directory path. For search without query, this filters matching paths.\",\n ),\n ref: z\n .string()\n .optional()\n .describe(\n \"Branch, tag, or commit-ish for list/read. Code search uses GitHub's default-branch search.\",\n ),\n recursive: z\n .boolean()\n .optional()\n .describe(\"For list, read the repository tree recursively.\"),\n includeDirectories: z\n .boolean()\n .optional()\n .describe(\"For list, include directory entries along with files.\"),\n query: z\n .string()\n .optional()\n .describe(\n \"For search, a GitHub code-search term. Omit to search/filter file paths from the repository tree.\",\n ),\n filename: z\n .string()\n .optional()\n .describe(\"For search, restrict to an exact filename.\"),\n extension: z\n .string()\n .optional()\n .describe(\"For search, restrict to a file extension such as ts or md.\"),\n language: z\n .string()\n .optional()\n .describe(\"For code search, restrict to a GitHub language qualifier.\"),\n page: z.coerce\n .number()\n .int()\n .min(1)\n .max(100)\n .optional()\n .describe(\"For code search, result page to fetch.\"),\n perPage: z.coerce\n .number()\n .int()\n .min(1)\n .max(100)\n .optional()\n .describe(\"For code search, results per page.\"),\n maxFiles: z.coerce\n .number()\n .int()\n .min(1)\n .max(10_000)\n .optional()\n .describe(\n \"Maximum file entries to return from list or tree-filter search.\",\n ),\n includeTextMatches: z\n .boolean()\n .optional()\n .describe(\"For code search, request GitHub text-match metadata.\"),\n content: z\n .string()\n .optional()\n .describe(\"For write, complete replacement UTF-8 file content.\"),\n message: z.string().optional().describe(\"For write, commit message.\"),\n branch: z\n .string()\n .optional()\n .describe(\n \"For write, branch to create/update on. Defaults to GitHub's default branch.\",\n ),\n sha: z\n .string()\n .optional()\n .describe(\n \"For write updates, the current blob SHA. The action reads it first by default when omitted.\",\n ),\n overwriteExisting: z\n .boolean()\n .optional()\n .describe(\n \"For write, read the current file SHA first when sha is omitted, then update if it exists. Defaults to true.\",\n ),\n committer: GitHubCommitIdentitySchema.optional().describe(\n \"Optional GitHub contents API committer identity.\",\n ),\n author: GitHubCommitIdentitySchema.optional().describe(\n \"Optional GitHub contents API author identity.\",\n ),\n connectionId: z\n .string()\n .trim()\n .min(1)\n .optional()\n .describe(\"Optional workspace GitHub connection id to use.\"),\n timeoutMs: z.coerce\n .number()\n .int()\n .min(1_000)\n .max(120_000)\n .optional()\n .describe(\"Request timeout in milliseconds.\"),\n maxBytes: z.coerce\n .number()\n .int()\n .min(1_000)\n .max(4 * 1024 * 1024)\n .optional()\n .describe(\"Maximum provider response bytes to read.\"),\n});\n\ntype GitHubRepoFilesActionArgs = z.infer<typeof GitHubRepoFilesActionSchema>;\n\nexport interface CreateGitHubRepoFilesActionOptions {\n description?: string;\n requireApprovalForWrites?: boolean;\n}\n\nexport function createGitHubRepoFilesAction(\n runtime: Pick<\n ProviderApiRuntime,\n | \"listGitHubRepositoryFiles\"\n | \"searchGitHubRepositoryFiles\"\n | \"readGitHubRepositoryFile\"\n | \"writeGitHubRepositoryFile\"\n | \"deleteGitHubRepositoryFile\"\n >,\n options: CreateGitHubRepoFilesActionOptions = {},\n) {\n const requireApprovalForWrites = options.requireApprovalForWrites ?? true;\n return defineAction({\n description:\n options.description ??\n \"List, search, read, create/update, and delete GitHub repository files through the configured GitHub connector or GITHUB_TOKEN. Uses GitHub REST APIs directly; it does not clone repositories or use a filesystem sandbox.\",\n schema: GitHubRepoFilesActionSchema,\n http: false,\n planMode: {\n effect: (args) =>\n args.operation === \"list\" ||\n args.operation === \"search\" ||\n args.operation === \"read\"\n ? \"read\"\n : \"write\",\n allowedValues: { operation: [\"list\", \"search\", \"read\"] },\n description:\n \"Plan mode allows listing, searching, and reading repository files.\",\n },\n needsApproval: requireApprovalForWrites\n ? (args: GitHubRepoFilesActionArgs) =>\n args.operation === \"write\" || args.operation === \"delete\"\n : false,\n run: async (args) => {\n if (args.operation === \"list\") {\n return runtime.listGitHubRepositoryFiles({\n owner: args.owner,\n repo: args.repo,\n path: args.path,\n ref: args.ref,\n recursive: args.recursive,\n includeDirectories: args.includeDirectories,\n maxFiles: args.maxFiles,\n connectionId: args.connectionId,\n timeoutMs: args.timeoutMs,\n maxBytes: args.maxBytes,\n } satisfies GitHubRepositoryFileListArgs);\n }\n\n if (args.operation === \"search\") {\n return runtime.searchGitHubRepositoryFiles({\n owner: args.owner,\n repo: args.repo,\n query: args.query,\n path: args.path,\n filename: args.filename,\n extension: args.extension,\n language: args.language,\n ref: args.ref,\n perPage: args.perPage,\n page: args.page,\n maxFiles: args.maxFiles,\n includeTextMatches: args.includeTextMatches,\n connectionId: args.connectionId,\n timeoutMs: args.timeoutMs,\n maxBytes: args.maxBytes,\n } satisfies GitHubRepositoryFileSearchArgs);\n }\n\n if (args.operation === \"read\") {\n if (!args.path) throw new Error(\"path is required for read.\");\n return runtime.readGitHubRepositoryFile({\n owner: args.owner,\n repo: args.repo,\n path: args.path,\n ref: args.ref,\n connectionId: args.connectionId,\n timeoutMs: args.timeoutMs,\n maxBytes: args.maxBytes,\n } satisfies GitHubRepositoryFileReadArgs);\n }\n\n if (!args.path) {\n throw new Error(`path is required for ${args.operation}.`);\n }\n if (args.operation === \"delete\") {\n return runtime.deleteGitHubRepositoryFile({\n owner: args.owner,\n repo: args.repo,\n path: args.path,\n message: args.message ?? `Delete ${args.path}`,\n branch: args.branch,\n sha: args.sha,\n committer: args.committer,\n author: args.author,\n connectionId: args.connectionId,\n timeoutMs: args.timeoutMs,\n maxBytes: args.maxBytes,\n } satisfies GitHubRepositoryFileDeleteArgs);\n }\n\n if (args.content === undefined) {\n throw new Error(\"content is required for write.\");\n }\n if (!args.message) throw new Error(\"message is required for write.\");\n return runtime.writeGitHubRepositoryFile({\n owner: args.owner,\n repo: args.repo,\n path: args.path,\n content: args.content,\n message: args.message,\n branch: args.branch,\n sha: args.sha,\n overwriteExisting: args.overwriteExisting ?? true,\n committer: args.committer,\n author: args.author,\n connectionId: args.connectionId,\n timeoutMs: args.timeoutMs,\n maxBytes: args.maxBytes,\n } satisfies GitHubRepositoryFileWriteArgs);\n },\n });\n}\n\nexport { GitHubRepoFilesActionSchema };\n"]}
@@ -311,8 +311,10 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
311
311
  notes?: string | undefined;
312
312
  scope?: "org" | "user" | undefined;
313
313
  }, {
314
+ message?: undefined;
314
315
  id?: undefined;
315
- found?: undefined;
316
+ provider?: undefined;
317
+ deleted?: undefined;
316
318
  providers: {
317
319
  id: string;
318
320
  label: string;
@@ -323,47 +325,45 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
323
325
  updatedAt: number;
324
326
  }[];
325
327
  count: number;
326
- provider?: undefined;
327
- deleted?: undefined;
328
+ found?: undefined;
328
329
  registered?: undefined;
329
330
  label?: undefined;
330
- message?: undefined;
331
331
  } | {
332
- count?: undefined;
332
+ message?: undefined;
333
333
  id?: undefined;
334
+ deleted?: undefined;
335
+ count?: undefined;
334
336
  providers?: undefined;
335
337
  found: boolean;
336
338
  provider: import("../custom-registry.js").CustomProviderConfig;
337
- deleted?: undefined;
338
339
  registered?: undefined;
339
340
  label?: undefined;
340
- message?: undefined;
341
341
  } | {
342
+ message?: undefined;
343
+ provider?: undefined;
344
+ deleted?: undefined;
342
345
  count?: undefined;
343
346
  providers?: undefined;
344
- provider?: undefined;
345
347
  found: boolean;
346
348
  id: string;
347
- deleted?: undefined;
348
349
  registered?: undefined;
349
350
  label?: undefined;
350
- message?: undefined;
351
351
  } | {
352
+ message?: undefined;
353
+ provider?: undefined;
352
354
  count?: undefined;
353
- found?: undefined;
354
355
  providers?: undefined;
355
- provider?: undefined;
356
+ found?: undefined;
356
357
  deleted: boolean;
357
358
  id: string;
358
359
  registered?: undefined;
359
360
  label?: undefined;
360
- message?: undefined;
361
361
  } | {
362
- count?: undefined;
363
- found?: undefined;
364
- providers?: undefined;
365
362
  provider?: undefined;
366
363
  deleted?: undefined;
364
+ count?: undefined;
365
+ providers?: undefined;
366
+ found?: undefined;
367
367
  registered: boolean;
368
368
  id: string;
369
369
  label: string;
@@ -1 +1 @@
1
- {"version":3,"file":"provider-api.d.ts","sourceRoot":"","sources":["../../../src/provider-api/actions/provider-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,KAAK,UAAU,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