@agent-native/core 0.131.5 → 0.131.7

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 (350) hide show
  1. package/corpus/README.md +3 -3
  2. package/corpus/core/CHANGELOG.md +70 -0
  3. package/corpus/core/docs/content/agent-native-toolkit.mdx +13 -6
  4. package/corpus/core/docs/content/cloneable-saas.mdx +5 -5
  5. package/corpus/core/docs/content/creating-templates.mdx +9 -0
  6. package/corpus/core/docs/content/deployment.mdx +18 -12
  7. package/corpus/core/docs/content/doctor.mdx +8 -1
  8. package/corpus/core/docs/content/drop-in-agent.mdx +1 -1
  9. package/corpus/core/docs/content/extensions.mdx +18 -18
  10. package/corpus/core/docs/content/faq.mdx +4 -4
  11. package/corpus/core/docs/content/key-concepts.mdx +30 -21
  12. package/corpus/core/docs/content/security.mdx +2 -2
  13. package/corpus/core/docs/content/template-brain-developers.mdx +4 -1
  14. package/corpus/core/docs/content/template-mail-developers.mdx +4 -1
  15. package/corpus/core/docs/content/what-is-agent-native.mdx +6 -6
  16. package/corpus/core/package.json +1 -1
  17. package/corpus/core/src/a2a/client.ts +449 -66
  18. package/corpus/core/src/a2a/correlation.ts +31 -0
  19. package/corpus/core/src/a2a/invoke.ts +4 -2
  20. package/corpus/core/src/a2a/types.ts +4 -0
  21. package/corpus/core/src/action.ts +3 -0
  22. package/corpus/core/src/agent/action-continuation-guidance.ts +2 -1
  23. package/corpus/core/src/agent/engine/registry.ts +98 -6
  24. package/corpus/core/src/agent/production-agent.ts +151 -18
  25. package/corpus/core/src/agent/run-loop-with-resume.ts +190 -3
  26. package/corpus/core/src/agent/run-manager.ts +117 -41
  27. package/corpus/core/src/agent/thread-debug-history.ts +86 -0
  28. package/corpus/core/src/agent/types.ts +3 -1
  29. package/corpus/core/src/cli/create.ts +11 -1
  30. package/corpus/core/src/cli/templates-meta.ts +2 -2
  31. package/corpus/core/src/client/agent-chat-adapter.ts +91 -13
  32. package/corpus/core/src/client/resources/McpIntegrationDialog.tsx +11 -9
  33. package/corpus/core/src/client/sse-event-processor.ts +17 -3
  34. package/corpus/core/src/db/client.ts +57 -17
  35. package/corpus/core/src/guards/no-env-credentials.ts +2 -0
  36. package/corpus/core/src/integrations/adapters/slack.ts +8 -3
  37. package/corpus/core/src/localization/default-messages.ts +44 -0
  38. package/corpus/core/src/observability/traces.ts +78 -5
  39. package/corpus/core/src/scripts/call-agent.ts +294 -11
  40. package/corpus/core/src/scripts/describe-workspace-apps.ts +2 -2
  41. package/corpus/core/src/secrets/crypto.ts +156 -35
  42. package/corpus/core/src/secrets/storage.ts +64 -26
  43. package/corpus/core/src/server/agent-capabilities.ts +1 -1
  44. package/corpus/core/src/server/agent-chat/action-filters-a2a.ts +113 -7
  45. package/corpus/core/src/server/agent-chat/context-tools.ts +2 -0
  46. package/corpus/core/src/server/agent-chat/plugin-options.ts +34 -1
  47. package/corpus/core/src/server/agent-chat/prompt-resources.ts +1 -1
  48. package/corpus/core/src/server/agent-chat-plugin.ts +91 -59
  49. package/corpus/core/src/templates/default/.agents/skills/secrets/SKILL.md +19 -7
  50. package/corpus/core/src/templates/headless/.agents/skills/secrets/SKILL.md +19 -7
  51. package/corpus/core/src/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +18 -7
  52. package/corpus/core/src/templates/workspace-core/.agents/skills/composable-mini-apps/SKILL.md +15 -14
  53. package/corpus/core/src/templates/workspace-core/.agents/skills/secrets/SKILL.md +19 -7
  54. package/corpus/core/src/vite/client.ts +1 -0
  55. package/corpus/templates/analytics/.agents/skills/dashboard-ops/SKILL.md +5 -4
  56. package/corpus/templates/analytics/.agents/skills/gong/SKILL.md +6 -4
  57. package/corpus/templates/analytics/AGENTS.md +7 -4
  58. package/corpus/templates/analytics/actions/query-agent-native-analytics.ts +4 -3
  59. package/corpus/templates/analytics/changelog/2026-07-30-delegated-analytics-questions-now-return-a-useful-current-me.md +6 -0
  60. package/corpus/templates/analytics/changelog/2026-07-30-scheduled-dashboard-emails-complete-every-panel-without-pool.md +6 -0
  61. package/corpus/templates/analytics/scripts/emit-netlify-dashboard-report-cron.ts +28 -1
  62. package/corpus/templates/analytics/server/jobs/dashboard-report.ts +18 -11
  63. package/corpus/templates/analytics/server/lib/analytics-connector-catalog.ts +4 -4
  64. package/corpus/templates/analytics/server/lib/canonical-first-party-dashboard-repair.ts +9 -5
  65. package/corpus/templates/analytics/server/lib/dashboard-panel-query.ts +6 -2
  66. package/corpus/templates/analytics/server/lib/dashboard-panel-source-resolver.ts +11 -4
  67. package/corpus/templates/analytics/server/lib/dashboard-report-render.ts +49 -31
  68. package/corpus/templates/analytics/server/lib/first-party-analytics.ts +16 -8
  69. package/corpus/templates/analytics/server/lib/first-party-metric-catalog.ts +9 -3
  70. package/corpus/templates/analytics/server/lib/production-serverless-runtime.ts +11 -0
  71. package/corpus/templates/analytics/server/lib/real-data-actions.ts +10 -0
  72. package/corpus/templates/analytics/server/plugins/agent-chat.ts +3 -2
  73. package/corpus/templates/analytics/server/plugins/analytics-alert-jobs.ts +2 -1
  74. package/corpus/templates/analytics/server/plugins/dashboard-report-jobs.ts +2 -1
  75. package/corpus/templates/analytics/server/plugins/uptime-monitor-jobs.ts +1 -12
  76. package/corpus/templates/brain/.agents/skills/brain/RUNBOOK.md +54 -6
  77. package/corpus/templates/brain/.agents/skills/brain/SKILL.md +20 -9
  78. package/corpus/templates/brain/.agents/skills/ingestion-and-connectors/SKILL.md +33 -1
  79. package/corpus/templates/brain/AGENTS.md +3 -1
  80. package/corpus/templates/brain/README.md +4 -1
  81. package/corpus/templates/brain/actions/_schemas.ts +30 -8
  82. package/corpus/templates/brain/actions/ask-brain.ts +124 -14
  83. package/corpus/templates/brain/actions/create-source.ts +18 -2
  84. package/corpus/templates/brain/actions/enqueue-captures-distillation.ts +8 -123
  85. package/corpus/templates/brain/actions/enqueue-distillation.ts +6 -127
  86. package/corpus/templates/brain/actions/import-capture.ts +17 -5
  87. package/corpus/templates/brain/actions/import-transcript.ts +17 -5
  88. package/corpus/templates/brain/actions/update-source.ts +25 -5
  89. package/corpus/templates/brain/app/components/layout/Sidebar.tsx +1 -1
  90. package/corpus/templates/brain/changelog/2026-07-30-blessed-resources-can-feed-cited-company-answers.md +6 -0
  91. package/corpus/templates/brain/changelog/2026-07-30-the-left-sidebar-no-longer-shows-a-blank-organization-placeh.md +6 -0
  92. package/corpus/templates/brain/server/lib/brain.ts +49 -19
  93. package/corpus/templates/brain/server/lib/distillation-queue.ts +147 -0
  94. package/corpus/templates/brain/server/lib/source-policy.ts +264 -0
  95. package/corpus/templates/brain/server/plugins/agent-chat.ts +3 -2
  96. package/corpus/templates/brain/server/routes/api/_agent-native/brain/ingest.post.ts +116 -19
  97. package/corpus/templates/clips/app/components/meetings/google-oauth-identity-notice.tsx +51 -0
  98. package/corpus/templates/clips/app/i18n/en-US.ts +4 -0
  99. package/corpus/templates/clips/app/routes/_app.meetings._index.tsx +3 -1
  100. package/corpus/templates/clips/changelog/2026-07-30-google-calendar-warning.md +6 -0
  101. package/corpus/templates/content/app/components/editor/VisualEditor.tsx +72 -8
  102. package/corpus/templates/content/changelog/2026-07-30-the-slash-command-hint-now-stays-on-only-the-active-empty-li.md +6 -0
  103. package/corpus/templates/design/.generated/bridge/editor-chrome.generated.ts +506 -11
  104. package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +148 -17
  105. package/corpus/templates/design/app/components/design/canvas-interactions/design-canvas-interactions.ts +357 -0
  106. package/corpus/templates/design/app/components/design/inspector/ScrubInput.tsx +7 -466
  107. package/corpus/templates/design/app/components/design/inspector/scrub-input-utils.ts +15 -311
  108. package/corpus/templates/design/app/components/visual-editor/CanvasCommentPins.tsx +19 -997
  109. package/corpus/templates/design/app/components/visual-editor/DrawOverlay.tsx +8 -1216
  110. package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +31 -38
  111. package/corpus/templates/design/package.json +0 -1
  112. package/corpus/templates/dispatch/AGENTS.md +8 -0
  113. package/corpus/templates/dispatch/DEVELOPING.md +29 -0
  114. package/corpus/templates/dispatch/actions/view-screen.ts +34 -2
  115. package/corpus/templates/dispatch/app/i18n-data.ts +457 -0
  116. package/corpus/templates/dispatch/changelog/2026-07-30-delegated-dispatch-work-continues-reliably-in-the-background.md +6 -0
  117. package/corpus/templates/dispatch/changelog/2026-07-30-find-failed-runs-across-apps.md +6 -0
  118. package/corpus/templates/dispatch/netlify.toml +3 -0
  119. package/corpus/templates/plan/actions/get-visual-plan.ts +10 -6
  120. package/corpus/templates/plan/actions/patch-visual-plan-source.ts +117 -1
  121. package/corpus/templates/plan/actions/update-visual-plan.ts +56 -14
  122. package/corpus/templates/plan/app/pages/PlansPage.tsx +1 -1
  123. package/corpus/templates/plan/changelog/2026-07-30-plan-agents-recover-with-targeted-writes.md +6 -0
  124. package/corpus/templates/plan/shared/plan-content.ts +35 -0
  125. package/corpus/templates/slides/.agents/skills/analytics-data-for-decks/SKILL.md +8 -12
  126. package/corpus/templates/slides/AGENTS.md +4 -4
  127. package/corpus/templates/slides/actions/create-deck.ts +1 -1
  128. package/corpus/templates/slides/actions/duplicate-deck.ts +19 -4
  129. package/corpus/templates/slides/app/components/deck/DeckCard.tsx +2 -10
  130. package/corpus/templates/slides/app/components/deck/MermaidRenderer.tsx +12 -1
  131. package/corpus/templates/slides/app/components/deck/SlideRenderer.tsx +30 -13
  132. package/corpus/templates/slides/app/components/editor/DeckEditorSkeleton.tsx +35 -0
  133. package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +63 -56
  134. package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +21 -76
  135. package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +1110 -292
  136. package/corpus/templates/slides/app/components/editor/SlideOverflowWarning.tsx +53 -0
  137. package/corpus/templates/slides/app/components/editor/SlideStyleInspector.tsx +235 -18
  138. package/corpus/templates/slides/app/components/editor/SpeakerNotesPanel.tsx +4 -1
  139. package/corpus/templates/slides/app/components/editor/canvas-interactions/index.ts +11 -0
  140. package/corpus/templates/slides/app/components/editor/canvas-interactions/slides-canvas-adapter.ts +129 -0
  141. package/corpus/templates/slides/app/components/editor/selection-overlay-measurement.ts +70 -0
  142. package/corpus/templates/slides/app/components/editor/slide-object-interactions.ts +519 -65
  143. package/corpus/templates/slides/app/components/visual-editor/CanvasCommentPins.tsx +36 -426
  144. package/corpus/templates/slides/app/components/visual-editor/DrawOverlay.tsx +19 -458
  145. package/corpus/templates/slides/app/context/DeckContext.tsx +179 -72
  146. package/corpus/templates/slides/app/global.css +105 -0
  147. package/corpus/templates/slides/app/i18n/en-US.ts +8 -0
  148. package/corpus/templates/slides/app/lib/deck-editor-loading.ts +26 -0
  149. package/corpus/templates/slides/app/lib/mermaid-blocks.ts +27 -0
  150. package/corpus/templates/slides/app/pages/DeckEditor.tsx +71 -38
  151. package/corpus/templates/slides/app/pages/Index.tsx +98 -41
  152. package/corpus/templates/slides/changelog/2026-07-30-deck-loading-no-longer-flashes-an-unavailable-message.md +6 -0
  153. package/corpus/templates/slides/changelog/2026-07-30-duplicating-a-deck-from-the-deck-list-now-opens-the-copy-imm.md +6 -0
  154. package/corpus/templates/slides/changelog/2026-07-30-layout-overflow-warning-is-readable-and-dismissible.md +6 -0
  155. package/corpus/templates/slides/changelog/2026-07-30-new-decks-now-start-with-an-empty-slide-list-when-no-slides-.md +6 -0
  156. package/corpus/templates/slides/changelog/2026-07-30-shared-canvas-annotations.md +6 -0
  157. package/corpus/templates/slides/changelog/2026-07-30-slide-objects-can-be-moved-as-a-group-copied-and-pasted-with.md +6 -0
  158. package/corpus/templates/slides/changelog/2026-07-30-slide-text-editing-and-object-controls-now-match-google-slides.md +6 -0
  159. package/corpus/templates/slides/changelog/2026-07-30-style-panel-now-scrolls-with-speaker-notes-open-shows-the-sl.md +6 -0
  160. package/corpus/templates/slides/changelog/2026-07-30-top-toolbar-controls-now-use-consistent-sizing-with-undo-and.md +6 -0
  161. package/corpus/templates/slides/netlify.toml +3 -1
  162. package/corpus/templates/slides/package.json +0 -1
  163. package/corpus/templates/slides/server/lib/chat-attachments.ts +18 -0
  164. package/corpus/templates/slides/server/plugins/agent-chat.ts +5 -0
  165. package/corpus/templates/slides/vite.config.ts +0 -1
  166. package/corpus/toolkit/CHANGELOG.md +13 -0
  167. package/corpus/toolkit/README.md +19 -0
  168. package/corpus/toolkit/agent-native.eject.json +38 -0
  169. package/corpus/toolkit/package.json +29 -1
  170. package/corpus/toolkit/src/canvas-annotations/CanvasCommentPins.tsx +861 -0
  171. package/corpus/toolkit/src/canvas-annotations/DrawOverlay.tsx +1233 -0
  172. package/corpus/toolkit/src/canvas-annotations/index.ts +15 -0
  173. package/corpus/toolkit/src/canvas-annotations/types.ts +14 -0
  174. package/corpus/toolkit/src/canvas-interactions/canvas-interactions.ts +933 -0
  175. package/corpus/toolkit/src/canvas-interactions/index.ts +67 -0
  176. package/corpus/toolkit/src/design-tweaks/scrub-input-utils.ts +311 -0
  177. package/corpus/toolkit/src/design-tweaks/scrub-input.tsx +491 -0
  178. package/corpus/toolkit/src/design-tweaks/visual-style-controls.tsx +26 -171
  179. package/corpus/toolkit/src/index.ts +1 -0
  180. package/dist/a2a/client.d.ts +23 -0
  181. package/dist/a2a/client.d.ts.map +1 -1
  182. package/dist/a2a/client.js +309 -44
  183. package/dist/a2a/client.js.map +1 -1
  184. package/dist/a2a/correlation.d.ts +1 -0
  185. package/dist/a2a/correlation.d.ts.map +1 -1
  186. package/dist/a2a/correlation.js +27 -0
  187. package/dist/a2a/correlation.js.map +1 -1
  188. package/dist/a2a/invoke.d.ts.map +1 -1
  189. package/dist/a2a/invoke.js +4 -2
  190. package/dist/a2a/invoke.js.map +1 -1
  191. package/dist/a2a/types.d.ts +4 -0
  192. package/dist/a2a/types.d.ts.map +1 -1
  193. package/dist/a2a/types.js.map +1 -1
  194. package/dist/action.d.ts +3 -0
  195. package/dist/action.d.ts.map +1 -1
  196. package/dist/action.js.map +1 -1
  197. package/dist/agent/action-continuation-guidance.d.ts.map +1 -1
  198. package/dist/agent/action-continuation-guidance.js +2 -1
  199. package/dist/agent/action-continuation-guidance.js.map +1 -1
  200. package/dist/agent/engine/registry.d.ts.map +1 -1
  201. package/dist/agent/engine/registry.js +82 -8
  202. package/dist/agent/engine/registry.js.map +1 -1
  203. package/dist/agent/production-agent.d.ts +40 -1
  204. package/dist/agent/production-agent.d.ts.map +1 -1
  205. package/dist/agent/production-agent.js +113 -15
  206. package/dist/agent/production-agent.js.map +1 -1
  207. package/dist/agent/run-loop-with-resume.d.ts +21 -0
  208. package/dist/agent/run-loop-with-resume.d.ts.map +1 -1
  209. package/dist/agent/run-loop-with-resume.js +163 -4
  210. package/dist/agent/run-loop-with-resume.js.map +1 -1
  211. package/dist/agent/run-manager.d.ts +16 -9
  212. package/dist/agent/run-manager.d.ts.map +1 -1
  213. package/dist/agent/run-manager.js +93 -42
  214. package/dist/agent/run-manager.js.map +1 -1
  215. package/dist/agent/thread-debug-history.d.ts +10 -0
  216. package/dist/agent/thread-debug-history.d.ts.map +1 -0
  217. package/dist/agent/thread-debug-history.js +68 -0
  218. package/dist/agent/thread-debug-history.js.map +1 -0
  219. package/dist/agent/types.d.ts +3 -1
  220. package/dist/agent/types.d.ts.map +1 -1
  221. package/dist/agent/types.js.map +1 -1
  222. package/dist/cli/create.d.ts.map +1 -1
  223. package/dist/cli/create.js +6 -1
  224. package/dist/cli/create.js.map +1 -1
  225. package/dist/cli/templates-meta.js +2 -2
  226. package/dist/cli/templates-meta.js.map +1 -1
  227. package/dist/client/agent-chat-adapter.d.ts +1 -1
  228. package/dist/client/agent-chat-adapter.d.ts.map +1 -1
  229. package/dist/client/agent-chat-adapter.js +76 -13
  230. package/dist/client/agent-chat-adapter.js.map +1 -1
  231. package/dist/client/resources/McpIntegrationDialog.d.ts.map +1 -1
  232. package/dist/client/resources/McpIntegrationDialog.js +1 -1
  233. package/dist/client/resources/McpIntegrationDialog.js.map +1 -1
  234. package/dist/client/sse-event-processor.d.ts.map +1 -1
  235. package/dist/client/sse-event-processor.js +12 -3
  236. package/dist/client/sse-event-processor.js.map +1 -1
  237. package/dist/collab/routes.d.ts +1 -1
  238. package/dist/db/client.d.ts.map +1 -1
  239. package/dist/db/client.js +48 -17
  240. package/dist/db/client.js.map +1 -1
  241. package/dist/guards/no-env-credentials.d.ts.map +1 -1
  242. package/dist/guards/no-env-credentials.js +2 -0
  243. package/dist/guards/no-env-credentials.js.map +1 -1
  244. package/dist/integrations/adapters/slack.js +7 -3
  245. package/dist/integrations/adapters/slack.js.map +1 -1
  246. package/dist/localization/default-messages.d.ts +43 -0
  247. package/dist/localization/default-messages.d.ts.map +1 -1
  248. package/dist/localization/default-messages.js +43 -0
  249. package/dist/localization/default-messages.js.map +1 -1
  250. package/dist/observability/traces.d.ts +3 -1
  251. package/dist/observability/traces.d.ts.map +1 -1
  252. package/dist/observability/traces.js +73 -4
  253. package/dist/observability/traces.js.map +1 -1
  254. package/dist/progress/routes.d.ts +1 -1
  255. package/dist/provider-api/actions/custom-provider-registration.d.ts +12 -12
  256. package/dist/provider-api/actions/provider-api.d.ts +13 -13
  257. package/dist/provider-api/corpus-jobs.d.ts +2 -2
  258. package/dist/scripts/call-agent.d.ts.map +1 -1
  259. package/dist/scripts/call-agent.js +237 -12
  260. package/dist/scripts/call-agent.js.map +1 -1
  261. package/dist/scripts/describe-workspace-apps.js +2 -2
  262. package/dist/scripts/describe-workspace-apps.js.map +1 -1
  263. package/dist/secrets/crypto.d.ts +36 -21
  264. package/dist/secrets/crypto.d.ts.map +1 -1
  265. package/dist/secrets/crypto.js +134 -33
  266. package/dist/secrets/crypto.js.map +1 -1
  267. package/dist/secrets/storage.d.ts +6 -6
  268. package/dist/secrets/storage.d.ts.map +1 -1
  269. package/dist/secrets/storage.js +43 -26
  270. package/dist/secrets/storage.js.map +1 -1
  271. package/dist/server/agent-capabilities.js +1 -1
  272. package/dist/server/agent-capabilities.js.map +1 -1
  273. package/dist/server/agent-chat/action-filters-a2a.d.ts +17 -3
  274. package/dist/server/agent-chat/action-filters-a2a.d.ts.map +1 -1
  275. package/dist/server/agent-chat/action-filters-a2a.js +94 -3
  276. package/dist/server/agent-chat/action-filters-a2a.js.map +1 -1
  277. package/dist/server/agent-chat/context-tools.d.ts.map +1 -1
  278. package/dist/server/agent-chat/context-tools.js +2 -0
  279. package/dist/server/agent-chat/context-tools.js.map +1 -1
  280. package/dist/server/agent-chat/plugin-options.d.ts +23 -0
  281. package/dist/server/agent-chat/plugin-options.d.ts.map +1 -1
  282. package/dist/server/agent-chat/plugin-options.js +4 -1
  283. package/dist/server/agent-chat/plugin-options.js.map +1 -1
  284. package/dist/server/agent-chat/prompt-resources.js +1 -1
  285. package/dist/server/agent-chat/prompt-resources.js.map +1 -1
  286. package/dist/server/agent-chat-plugin.d.ts +2 -1
  287. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  288. package/dist/server/agent-chat-plugin.js +79 -56
  289. package/dist/server/agent-chat-plugin.js.map +1 -1
  290. package/dist/server/realtime-token.d.ts +1 -1
  291. package/dist/templates/default/.agents/skills/secrets/SKILL.md +19 -7
  292. package/dist/templates/headless/.agents/skills/secrets/SKILL.md +19 -7
  293. package/dist/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +18 -7
  294. package/dist/templates/workspace-core/.agents/skills/composable-mini-apps/SKILL.md +15 -14
  295. package/dist/templates/workspace-core/.agents/skills/secrets/SKILL.md +19 -7
  296. package/dist/vite/client.d.ts.map +1 -1
  297. package/dist/vite/client.js +1 -0
  298. package/dist/vite/client.js.map +1 -1
  299. package/docs/content/agent-native-toolkit.mdx +13 -6
  300. package/docs/content/cloneable-saas.mdx +5 -5
  301. package/docs/content/creating-templates.mdx +9 -0
  302. package/docs/content/deployment.mdx +18 -12
  303. package/docs/content/doctor.mdx +8 -1
  304. package/docs/content/drop-in-agent.mdx +1 -1
  305. package/docs/content/extensions.mdx +18 -18
  306. package/docs/content/faq.mdx +4 -4
  307. package/docs/content/key-concepts.mdx +30 -21
  308. package/docs/content/security.mdx +2 -2
  309. package/docs/content/template-brain-developers.mdx +4 -1
  310. package/docs/content/template-mail-developers.mdx +4 -1
  311. package/docs/content/what-is-agent-native.mdx +6 -6
  312. package/package.json +3 -3
  313. package/src/a2a/client.ts +449 -66
  314. package/src/a2a/correlation.ts +31 -0
  315. package/src/a2a/invoke.ts +4 -2
  316. package/src/a2a/types.ts +4 -0
  317. package/src/action.ts +3 -0
  318. package/src/agent/action-continuation-guidance.ts +2 -1
  319. package/src/agent/engine/registry.ts +98 -6
  320. package/src/agent/production-agent.ts +151 -18
  321. package/src/agent/run-loop-with-resume.ts +190 -3
  322. package/src/agent/run-manager.ts +117 -41
  323. package/src/agent/thread-debug-history.ts +86 -0
  324. package/src/agent/types.ts +3 -1
  325. package/src/cli/create.ts +11 -1
  326. package/src/cli/templates-meta.ts +2 -2
  327. package/src/client/agent-chat-adapter.ts +91 -13
  328. package/src/client/resources/McpIntegrationDialog.tsx +11 -9
  329. package/src/client/sse-event-processor.ts +17 -3
  330. package/src/db/client.ts +57 -17
  331. package/src/guards/no-env-credentials.ts +2 -0
  332. package/src/integrations/adapters/slack.ts +8 -3
  333. package/src/localization/default-messages.ts +44 -0
  334. package/src/observability/traces.ts +78 -5
  335. package/src/scripts/call-agent.ts +294 -11
  336. package/src/scripts/describe-workspace-apps.ts +2 -2
  337. package/src/secrets/crypto.ts +156 -35
  338. package/src/secrets/storage.ts +64 -26
  339. package/src/server/agent-capabilities.ts +1 -1
  340. package/src/server/agent-chat/action-filters-a2a.ts +113 -7
  341. package/src/server/agent-chat/context-tools.ts +2 -0
  342. package/src/server/agent-chat/plugin-options.ts +34 -1
  343. package/src/server/agent-chat/prompt-resources.ts +1 -1
  344. package/src/server/agent-chat-plugin.ts +91 -59
  345. package/src/templates/default/.agents/skills/secrets/SKILL.md +19 -7
  346. package/src/templates/headless/.agents/skills/secrets/SKILL.md +19 -7
  347. package/src/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +18 -7
  348. package/src/templates/workspace-core/.agents/skills/composable-mini-apps/SKILL.md +15 -14
  349. package/src/templates/workspace-core/.agents/skills/secrets/SKILL.md +19 -7
  350. package/src/vite/client.ts +1 -0
@@ -1,466 +1,7 @@
1
- import { IconArrowsHorizontal } from "@tabler/icons-react";
2
- import {
3
- useEffect,
4
- useId,
5
- useRef,
6
- useState,
7
- type KeyboardEvent,
8
- type PointerEvent,
9
- type ReactNode,
10
- } from "react";
11
-
12
- import { Input } from "@/components/ui/input";
13
- import { Label } from "@/components/ui/label";
14
- import {
15
- Tooltip,
16
- TooltipContent,
17
- TooltipTrigger,
18
- } from "@/components/ui/tooltip";
19
- import { cn } from "@/lib/utils";
20
-
21
- import {
22
- formatScrubValue,
23
- getScrubStepFromEvent,
24
- normalizeScrubNumber,
25
- parseScrubExpression,
26
- roundScrubDragValue,
27
- startScrubDrag,
28
- updateScrubDrag,
29
- type ScrubExpressionOptions,
30
- } from "./scrub-input-utils";
31
-
32
- type ScrubInputIcon = (props: { className?: string }) => ReactNode;
33
-
34
- export interface ScrubInputChangeMeta {
35
- source: "commit" | "keyboard" | "scrub";
36
- expression?: string;
37
- /**
38
- * Gesture-lifecycle signal for downstream consumers that want to throttle
39
- * expensive work during a drag and only do the expensive commit once.
40
- *
41
- * - "preview": a live, in-progress tick — e.g. one pointermove sample while
42
- * scrubbing. There can be many of these per gesture; treat each as a
43
- * cheap, throttleable preview of the value, not a point to commit at full
44
- * cost.
45
- * - "commit": the gesture's authoritative, final value. Fired exactly once
46
- * per gesture: on pointerup that ends a scrub drag, and for every
47
- * `source: "commit"` (blur/Enter) or `source: "keyboard"` (arrow step)
48
- * change, since those are already discrete, complete edits.
49
- */
50
- phase: "preview" | "commit";
51
- /**
52
- * Set when an arrow-key nudge fires on a `mixed` selection (see
53
- * `handleKeyDown`): there is no single current value to step from across a
54
- * mixed selection, so `onChange`'s `value` arg is the step delta itself
55
- * (not a new absolute value) and consumers that support per-target relative
56
- * application should add this delta to each selected target's own current
57
- * value instead of overwriting every target with `value`. Omitted for
58
- * every other change — existing consumers that don't check for it keep
59
- * receiving absolute values exactly as before.
60
- */
61
- relativeDelta?: number;
62
- }
63
-
64
- export interface ScrubInputProps extends ScrubExpressionOptions {
65
- label: string;
66
- value: number;
67
- onChange: (value: number, meta: ScrubInputChangeMeta) => void;
68
- id?: string;
69
- step?: number;
70
- icon?: ScrubInputIcon | null;
71
- disabled?: boolean;
72
- placeholder?: string;
73
- mixed?: boolean;
74
- className?: string;
75
- inputClassName?: string;
76
- labelClassName?: string;
77
- ariaLabel?: string;
78
- tooltipLabel?: string;
79
- }
80
-
81
- export interface PendingScrubCommit {
82
- value: number;
83
- /** Incoming prop value at commit time. While this exact value remains, the
84
- * host has not acknowledged the write yet and the optimistic draft should
85
- * stay visible. A different incoming value is authoritative host
86
- * normalization/rejection and must supersede the optimistic draft. */
87
- baseline: number;
88
- }
89
-
90
- export function resolvePendingScrubCommit(
91
- pending: PendingScrubCommit | null,
92
- incomingValue: number,
93
- options: ScrubExpressionOptions,
94
- ): "none" | "hold" | "confirmed" | "superseded" {
95
- if (pending === null) return "none";
96
- const incoming = normalizeScrubNumber(incomingValue, options);
97
- if (incoming === pending.value) return "confirmed";
98
- return incoming === pending.baseline ? "hold" : "superseded";
99
- }
100
-
101
- export function ScrubInput({
102
- label,
103
- value,
104
- onChange,
105
- id,
106
- step = 1,
107
- unit,
108
- min,
109
- max,
110
- precision,
111
- icon: Icon = IconArrowsHorizontal,
112
- disabled = false,
113
- placeholder,
114
- mixed = false,
115
- className,
116
- inputClassName,
117
- labelClassName,
118
- ariaLabel,
119
- tooltipLabel,
120
- }: ScrubInputProps) {
121
- const generatedId = useId();
122
- const inputId = id ?? generatedId;
123
- const [draft, setDraft] = useState(() =>
124
- mixed ? "Mixed" : formatScrubValue(value, { unit, precision }),
125
- );
126
- // Track the latest draft in a ref so commitDraft always reads the most
127
- // up-to-date value even if the blur event fires before the React state
128
- // update has been committed to the render tree (concurrent mode / batching).
129
- const draftRef = useRef(draft);
130
- const [focused, setFocused] = useState(false);
131
- const [dragging, setDragging] = useState(false);
132
- const inputRef = useRef<HTMLInputElement>(null);
133
- const skipNextBlurCommitRef = useRef(false);
134
- const dragRef = useRef({
135
- pointerId: -1,
136
- drag: startScrubDrag(0),
137
- });
138
- // The last normalized value emitted as a "preview" scrub tick, so endDrag
139
- // can re-emit it once as the gesture's authoritative "commit" — without
140
- // recomputing from stale pointer deltas after pointer capture is released.
141
- const lastScrubValueRef = useRef(value);
142
- // The most recent value THIS input committed (typed Enter/blur, keyboard
143
- // nudge, or scrub release) that the host hasn't echoed back yet. While this
144
- // is set, the resync effect below must hold the optimistic committed
145
- // display instead of snapping back to the still-stale incoming `value`
146
- // prop — otherwise a round-trip slower than one React render (host commit
147
- // -> computedStyles update -> fresh `value` prop) clobbers the just-typed
148
- // value back to the old one the instant focus leaves the input, which
149
- // reads as "Enter resets to the old value". Cleared as soon as a fresh
150
- // `value` prop confirms (or supersedes) the pending commit.
151
- const pendingCommitRef = useRef<PendingScrubCommit | null>(null);
152
- const options = { unit, min, max, precision };
153
-
154
- useEffect(() => {
155
- if (mixed) pendingCommitRef.current = null;
156
- const resolution = resolvePendingScrubCommit(
157
- pendingCommitRef.current,
158
- value,
159
- options,
160
- );
161
- if (resolution !== "none") {
162
- if (resolution === "confirmed" || resolution === "superseded") {
163
- // The host either echoed exactly what we committed or returned a new,
164
- // authoritative normalized/rejected value. In both cases resume prop
165
- // synchronization. The old equality-only logic held forever on the
166
- // second path, leaving the field permanently stuck on a value the
167
- // canvas never accepted.
168
- pendingCommitRef.current = null;
169
- } else {
170
- // Still seeing the exact pre-commit prop — don't stomp the optimistic
171
- // draft while the source-write round trip is pending.
172
- return;
173
- }
174
- }
175
- if (!focused) {
176
- const formatted = mixed
177
- ? "Mixed"
178
- : formatScrubValue(value, { unit, precision });
179
- draftRef.current = formatted;
180
- setDraft(formatted);
181
- }
182
- // eslint-disable-next-line react-hooks/exhaustive-deps -- `options` is a fresh object every render; the individual fields it's built from (unit/min/max/precision) are already listed below.
183
- }, [focused, max, min, mixed, precision, unit, value]);
184
-
185
- const resolvedTooltipLabel = tooltipLabel ?? ariaLabel ?? label;
186
-
187
- const setNextValue = (nextValue: number, meta: ScrubInputChangeMeta) => {
188
- const normalized = normalizeScrubNumber(nextValue, options);
189
- // Mark commit-phase writes as pending confirmation so the resync effect
190
- // holds this optimistic display instead of reverting to a stale `value`
191
- // prop before the host's round-trip lands (see pendingCommitRef above).
192
- // Preview ticks don't need this: they're expected to be superseded by
193
- // the next tick or the gesture's own final commit almost immediately.
194
- if (meta.phase === "commit") {
195
- pendingCommitRef.current = {
196
- value: normalized,
197
- baseline: normalizeScrubNumber(value, options),
198
- };
199
- }
200
- onChange(normalized, meta);
201
- const formatted = formatScrubValue(normalized, options);
202
- draftRef.current = formatted;
203
- setDraft(formatted);
204
- return normalized;
205
- };
206
-
207
- const commitDraft = () => {
208
- // Always read from the ref so we use the latest typed value even if the
209
- // React render with the updated draft state hasn't committed yet (e.g.
210
- // when blur fires in the same synchronous batch as the last onChange).
211
- const currentDraft = draftRef.current;
212
- if (mixed && currentDraft === "Mixed") return;
213
- const parsed = parseScrubExpression(currentDraft, value, options);
214
- if (!parsed) {
215
- const reverted = mixed ? "Mixed" : formatScrubValue(value, options);
216
- draftRef.current = reverted;
217
- setDraft(reverted);
218
- return;
219
- }
220
-
221
- draftRef.current = parsed.normalized;
222
- setDraft(parsed.normalized);
223
- // From a mixed selection every explicitly typed value must commit, even
224
- // when it equals the placeholder `value` prop (e.g. typing "0"): the
225
- // selected objects hold differing values, so "no change" is meaningless.
226
- if (parsed.value !== value || mixed) {
227
- // See setNextValue's pendingCommitRef comment — this text-commit path
228
- // (Enter/blur) bypasses setNextValue, so mark it pending here too.
229
- pendingCommitRef.current = {
230
- value: parsed.value,
231
- baseline: normalizeScrubNumber(value, options),
232
- };
233
- onChange(parsed.value, {
234
- source: "commit",
235
- expression: currentDraft,
236
- phase: "commit",
237
- });
238
- }
239
- };
240
-
241
- const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {
242
- if (event.key === "ArrowUp" || event.key === "ArrowDown") {
243
- event.preventDefault();
244
- const direction = event.key === "ArrowUp" ? 1 : -1;
245
- // getScrubStepFromEvent handles shiftKey (×10) and altKey (÷10).
246
- // Cmd (metaKey) mirrors Shift for ×10 — editor convention on macOS.
247
- const baseStep = getScrubStepFromEvent(event, step);
248
- const cmdMultiplier = event.metaKey && !event.shiftKey ? 10 : 1;
249
- const delta = direction * baseStep * cmdMultiplier;
250
- // Mixed selection: the `value` prop is only a placeholder (typically 0)
251
- // — there's no single current value to step from, and there's no
252
- // typed draft either (mixed keeps the draft as the literal "Mixed"
253
- // string, see commitDraft's guard). Figma's behavior here is a
254
- // *relative* nudge: apply the same +/-delta to each selected object's
255
- // own value rather than snapping every object to one absolute number.
256
- // ScrubInput itself can't resolve each target's individual value, so
257
- // emit the delta via `onChange` (as both `value` and
258
- // `meta.relativeDelta`) and let the consumer apply it per-target. Do
259
- // NOT route through setNextValue: that formats/displays one absolute
260
- // number in the draft, which would incorrectly replace the "Mixed"
261
- // placeholder text with a single value that was never actually common
262
- // to the whole selection.
263
- if (mixed) {
264
- onChange(delta, {
265
- source: "keyboard",
266
- phase: "commit",
267
- relativeDelta: delta,
268
- });
269
- return;
270
- }
271
- // Step from the currently typed draft, not the last-committed `value`
272
- // prop — otherwise an in-progress, uncommitted edit (typed but not yet
273
- // blurred/entered) is silently discarded the moment an arrow key is
274
- // pressed. Parse the draft the same way commitDraft does, falling back
275
- // to `value` only when the draft doesn't parse (e.g. empty/invalid).
276
- const draftParsed = parseScrubExpression(
277
- draftRef.current,
278
- value,
279
- options,
280
- );
281
- const base = draftParsed ? draftParsed.value : value;
282
- setNextValue(base + delta, {
283
- source: "keyboard",
284
- phase: "commit",
285
- });
286
- return;
287
- }
288
-
289
- if (event.key === "Enter") {
290
- event.preventDefault();
291
- commitDraft();
292
- skipNextBlurCommitRef.current = true;
293
- event.currentTarget.blur();
294
- return;
295
- }
296
-
297
- if (event.key === "Escape") {
298
- event.preventDefault();
299
- const reverted = mixed ? "Mixed" : formatScrubValue(value, options);
300
- draftRef.current = reverted;
301
- setDraft(reverted);
302
- skipNextBlurCommitRef.current = true;
303
- event.currentTarget.blur();
304
- }
305
- };
306
-
307
- const handlePointerDown = (event: PointerEvent<HTMLLabelElement>) => {
308
- if (disabled || event.button !== 0) return;
309
- event.preventDefault();
310
- dragRef.current = {
311
- pointerId: event.pointerId,
312
- drag: startScrubDrag(event.clientX),
313
- };
314
- // Re-seed the gesture's running base from the current prop right as the
315
- // drag starts. Without this, a stale `lastScrubValueRef` left over from a
316
- // previous gesture (or from an out-of-band prop update that arrived while
317
- // not dragging) would silently become this gesture's starting point
318
- // instead of the value actually displayed when the user grabbed the
319
- // control.
320
- lastScrubValueRef.current = value;
321
- event.currentTarget.setPointerCapture(event.pointerId);
322
- setDragging(true);
323
- };
324
-
325
- const handlePointerMove = (event: PointerEvent<HTMLLabelElement>) => {
326
- if (!dragging || dragRef.current.pointerId !== event.pointerId) return;
327
- // Mixed selection: scrubbing has no meaningful base value (the `value`
328
- // prop is a placeholder), so committing drag deltas would snap every
329
- // selected object to a step-from-0 value. Keep the drag inert; releasing
330
- // without a committed drag focuses the input so the user can type an
331
- // explicit value that then applies to all.
332
- if (mixed) return;
333
- // updateScrubDrag mirrors the jitter-threshold + hasDragged bookkeeping
334
- // (see scrub-input-utils.ts) so it can be unit tested in isolation from
335
- // real DOM pointer events.
336
- const tick = updateScrubDrag(dragRef.current.drag, event.clientX);
337
- dragRef.current.drag = tick.state;
338
- if (tick.deltaX === null) return;
339
- // Use incremental deltas from the last move so that clamped/rounded values
340
- // committed by onChange are respected. A total-delta approach would create
341
- // a dead zone equal to the amount dragged past the clamp boundary.
342
- //
343
- // Accumulate from this gesture's OWN last emitted value
344
- // (lastScrubValueRef), not the `value` prop. The prop only reflects
345
- // whatever the host last echoed back through computedStyles — a "preview"
346
- // phase commit is not guaranteed to round-trip before the next
347
- // pointermove tick fires (the host may debounce/throttle/skip preview
348
- // writes), so re-reading `value` here would recompute every tick from a
349
- // stale, pre-drag base plus one tiny incremental delta: the displayed
350
- // number barely creeps from the original value instead of following the
351
- // cursor, which reads as jittery/near-random rather than a smooth
352
- // continuum. The gesture's own running total is always current because
353
- // this component sets it itself on every tick below.
354
- const next =
355
- lastScrubValueRef.current +
356
- tick.deltaX *
357
- getScrubStepFromEvent(
358
- { altKey: event.altKey, shiftKey: event.shiftKey },
359
- step,
360
- );
361
- // Px-type fields snap to whole numbers while scrubbing (see
362
- // roundScrubDragValue) even though `precision` — which also governs typed
363
- // input and keyboard nudges — allows a decimal. Rounding here, before
364
- // setNextValue's own normalizeScrubNumber pass, keeps every subsequent
365
- // incremental delta measured from an already-whole value instead of
366
- // drifting on fractional leftovers.
367
- lastScrubValueRef.current = setNextValue(roundScrubDragValue(next, unit), {
368
- source: "scrub",
369
- phase: "preview",
370
- });
371
- };
372
-
373
- const endDrag = (event: PointerEvent<HTMLLabelElement>) => {
374
- if (dragRef.current.pointerId !== event.pointerId) return;
375
- event.currentTarget.releasePointerCapture(event.pointerId);
376
- const wasDrag = dragRef.current.drag.hasDragged;
377
- setDragging(false);
378
- // A real scrub drag emitted only "preview" ticks via handlePointerMove.
379
- // Emit exactly one authoritative "commit" here with the final value so a
380
- // downstream consumer can distinguish "gesture finished" from "still
381
- // dragging" — without this, the last preview tick would be the only
382
- // signal, and a consumer that ignores preview ticks would never commit.
383
- if (wasDrag && !mixed) {
384
- // See setNextValue's pendingCommitRef comment — mark this gesture's
385
- // authoritative value as pending confirmation so releasing the drag
386
- // can't be clobbered back to the pre-drag value by a slow host
387
- // round-trip (same class of bug as the Enter/blur text-commit case).
388
- pendingCommitRef.current = {
389
- value: lastScrubValueRef.current,
390
- baseline: normalizeScrubNumber(value, options),
391
- };
392
- onChange(lastScrubValueRef.current, {
393
- source: "scrub",
394
- phase: "commit",
395
- });
396
- }
397
- // If the pointer was released without dragging (a plain click), focus the
398
- // input so the user can type immediately — mirrors the design editor's label click
399
- // behaviour (the event.preventDefault() in handlePointerDown blocks the
400
- // native label→input focus transfer).
401
- if (!wasDrag && !disabled) {
402
- inputRef.current?.focus();
403
- }
404
- };
405
-
406
- return (
407
- <div className={cn("flex items-center gap-1.5", className)}>
408
- <Tooltip>
409
- <TooltipTrigger asChild>
410
- <Label
411
- htmlFor={inputId}
412
- onPointerDown={handlePointerDown}
413
- onPointerMove={handlePointerMove}
414
- onPointerUp={endDrag}
415
- onPointerCancel={endDrag}
416
- className={cn(
417
- "flex h-6 w-20 shrink-0 cursor-ew-resize select-none items-center gap-1 rounded-sm !text-[11px] text-muted-foreground transition-colors",
418
- "hover:bg-[var(--design-editor-control-bg)] hover:text-foreground",
419
- dragging &&
420
- "bg-[var(--design-editor-control-bg)] text-foreground",
421
- disabled && "pointer-events-none cursor-not-allowed opacity-50",
422
- labelClassName,
423
- )}
424
- >
425
- {Icon ? <Icon className="size-3 shrink-0" /> : null}
426
- <span className="truncate">{label}</span>
427
- </Label>
428
- </TooltipTrigger>
429
- <TooltipContent>{resolvedTooltipLabel}</TooltipContent>
430
- </Tooltip>
431
- <Input
432
- ref={inputRef}
433
- id={inputId}
434
- value={draft}
435
- disabled={disabled}
436
- placeholder={placeholder}
437
- inputMode="decimal"
438
- aria-label={ariaLabel ?? label}
439
- onFocus={(event) => {
440
- setFocused(true);
441
- event.currentTarget.select();
442
- }}
443
- onBlur={() => {
444
- setFocused(false);
445
- if (skipNextBlurCommitRef.current) {
446
- skipNextBlurCommitRef.current = false;
447
- return;
448
- }
449
- commitDraft();
450
- }}
451
- onChange={(event) => {
452
- draftRef.current = event.target.value;
453
- setDraft(event.target.value);
454
- }}
455
- onKeyDown={handleKeyDown}
456
- className={cn(
457
- // Compact design-editor: h-6, 11px tabular text, ring-1 with no offset.
458
- "h-6 !text-[11px] tabular-nums",
459
- "focus-visible:ring-1 focus-visible:ring-offset-0",
460
- inputClassName,
461
- mixed && "text-muted-foreground",
462
- )}
463
- />
464
- </div>
465
- );
466
- }
1
+ export {
2
+ VisualScrubInput as ScrubInput,
3
+ resolvePendingScrubCommit,
4
+ type PendingScrubCommit,
5
+ type ScrubInputChangeMeta,
6
+ type ScrubInputProps,
7
+ } from "@agent-native/toolkit/design-tweaks";