@agent-native/core 0.149.2 → 0.149.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 (345) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/templates/analytics/.agents/skills/actions/SKILL.md +54 -488
  3. package/corpus/templates/analytics/.agents/skills/actions/references/action-fields.md +136 -0
  4. package/corpus/templates/analytics/.agents/skills/actions/references/examples.md +94 -0
  5. package/corpus/templates/analytics/.agents/skills/actions/references/provider-apis.md +95 -0
  6. package/corpus/templates/analytics/.agents/skills/create-skill/SKILL.md +9 -35
  7. package/corpus/templates/analytics/.agents/skills/creative-context/SKILL.md +4 -2
  8. package/corpus/templates/analytics/.agents/skills/frontend-design/SKILL.md +4 -5
  9. package/corpus/templates/analytics/.agents/skills/turn-into-app/SKILL.md +18 -31
  10. package/corpus/templates/analytics/AGENTS.md +25 -32
  11. package/corpus/templates/analytics/app/global.css +1 -1
  12. package/corpus/templates/analytics/changelog/2026-08-11-full-page-chat-composers-stay-at-a-focused-750px-width.md +6 -0
  13. package/corpus/templates/assets/.agents/skills/actions/SKILL.md +54 -488
  14. package/corpus/templates/assets/.agents/skills/actions/references/action-fields.md +136 -0
  15. package/corpus/templates/assets/.agents/skills/actions/references/examples.md +94 -0
  16. package/corpus/templates/assets/.agents/skills/actions/references/provider-apis.md +95 -0
  17. package/corpus/templates/assets/.agents/skills/create-skill/SKILL.md +9 -35
  18. package/corpus/templates/assets/.agents/skills/creative-context/SKILL.md +4 -2
  19. package/corpus/templates/assets/.agents/skills/frontend-design/SKILL.md +4 -5
  20. package/corpus/templates/assets/.agents/skills/turn-into-app/SKILL.md +18 -31
  21. package/corpus/templates/assets/AGENTS.md +6 -9
  22. package/corpus/templates/assets/app/global.css +1 -1
  23. package/corpus/templates/assets/changelog/2026-08-11-full-page-chat-composers-stay-at-a-focused-750px-width.md +6 -0
  24. package/corpus/templates/brain/.agents/skills/actions/SKILL.md +54 -488
  25. package/corpus/templates/brain/.agents/skills/actions/references/action-fields.md +136 -0
  26. package/corpus/templates/brain/.agents/skills/actions/references/examples.md +94 -0
  27. package/corpus/templates/brain/.agents/skills/actions/references/provider-apis.md +95 -0
  28. package/corpus/templates/brain/.agents/skills/create-skill/SKILL.md +9 -35
  29. package/corpus/templates/brain/.agents/skills/frontend-design/SKILL.md +4 -5
  30. package/corpus/templates/brain/.agents/skills/turn-into-app/SKILL.md +18 -31
  31. package/corpus/templates/brain/AGENTS.md +5 -12
  32. package/corpus/templates/brain/app/global.css +1 -1
  33. package/corpus/templates/brain/changelog/2026-08-11-full-page-chat-composers-stay-at-a-focused-750px-width.md +6 -0
  34. package/corpus/templates/calendar/.agents/skills/actions/SKILL.md +54 -488
  35. package/corpus/templates/calendar/.agents/skills/actions/references/action-fields.md +136 -0
  36. package/corpus/templates/calendar/.agents/skills/actions/references/examples.md +94 -0
  37. package/corpus/templates/calendar/.agents/skills/actions/references/provider-apis.md +95 -0
  38. package/corpus/templates/calendar/.agents/skills/create-skill/SKILL.md +9 -35
  39. package/corpus/templates/calendar/.agents/skills/frontend-design/SKILL.md +4 -5
  40. package/corpus/templates/calendar/.agents/skills/turn-into-app/SKILL.md +18 -31
  41. package/corpus/templates/calendar/AGENTS.md +8 -9
  42. package/corpus/templates/chat/.agents/skills/actions/SKILL.md +54 -488
  43. package/corpus/templates/chat/.agents/skills/actions/references/action-fields.md +136 -0
  44. package/corpus/templates/chat/.agents/skills/actions/references/examples.md +94 -0
  45. package/corpus/templates/chat/.agents/skills/actions/references/provider-apis.md +95 -0
  46. package/corpus/templates/chat/.agents/skills/create-skill/SKILL.md +9 -35
  47. package/corpus/templates/chat/.agents/skills/frontend-design/SKILL.md +4 -5
  48. package/corpus/templates/chat/.agents/skills/turn-into-app/SKILL.md +18 -31
  49. package/corpus/templates/chat/AGENTS.md +32 -80
  50. package/corpus/templates/clips/.agents/skills/actions/SKILL.md +54 -488
  51. package/corpus/templates/clips/.agents/skills/actions/references/action-fields.md +136 -0
  52. package/corpus/templates/clips/.agents/skills/actions/references/examples.md +94 -0
  53. package/corpus/templates/clips/.agents/skills/actions/references/provider-apis.md +95 -0
  54. package/corpus/templates/clips/.agents/skills/create-skill/SKILL.md +9 -35
  55. package/corpus/templates/clips/.agents/skills/frontend-design/SKILL.md +4 -5
  56. package/corpus/templates/clips/.agents/skills/turn-into-app/SKILL.md +18 -31
  57. package/corpus/templates/clips/AGENTS.md +25 -31
  58. package/corpus/templates/content/.agents/skills/actions/SKILL.md +54 -488
  59. package/corpus/templates/content/.agents/skills/actions/references/action-fields.md +136 -0
  60. package/corpus/templates/content/.agents/skills/actions/references/examples.md +94 -0
  61. package/corpus/templates/content/.agents/skills/actions/references/provider-apis.md +95 -0
  62. package/corpus/templates/content/.agents/skills/create-skill/SKILL.md +9 -35
  63. package/corpus/templates/content/.agents/skills/creative-context/SKILL.md +4 -2
  64. package/corpus/templates/content/.agents/skills/frontend-design/SKILL.md +4 -5
  65. package/corpus/templates/content/.agents/skills/turn-into-app/SKILL.md +18 -31
  66. package/corpus/templates/content/AGENTS.md +5 -9
  67. package/corpus/templates/crm/.agents/skills/turn-into-app/SKILL.md +18 -31
  68. package/corpus/templates/crm/AGENTS.md +7 -11
  69. package/corpus/templates/crm/app/global.css +1 -1
  70. package/corpus/templates/crm/changelog/2026-08-11-full-page-chat-composers-stay-at-a-focused-750px-width.md +6 -0
  71. package/corpus/templates/design/.agents/skills/actions/SKILL.md +54 -488
  72. package/corpus/templates/design/.agents/skills/actions/references/action-fields.md +136 -0
  73. package/corpus/templates/design/.agents/skills/actions/references/examples.md +94 -0
  74. package/corpus/templates/design/.agents/skills/actions/references/provider-apis.md +95 -0
  75. package/corpus/templates/design/.agents/skills/create-skill/SKILL.md +9 -35
  76. package/corpus/templates/design/.agents/skills/creative-context/SKILL.md +4 -2
  77. package/corpus/templates/design/.agents/skills/frontend-design/SKILL.md +4 -5
  78. package/corpus/templates/design/.agents/skills/turn-into-app/SKILL.md +18 -31
  79. package/corpus/templates/design/.generated/bridge/editor-chrome.generated.ts +70 -3
  80. package/corpus/templates/design/AGENTS.md +13 -21
  81. package/corpus/templates/design/app/components/design/DesignCanvas.tsx +12 -0
  82. package/corpus/templates/design/app/components/design/LayersPanel.tsx +19 -2
  83. package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +115 -7
  84. package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +82 -7
  85. package/corpus/templates/design/app/components/design/design-trace.ts +120 -0
  86. package/corpus/templates/design/app/components/design/dnd-debug.ts +2 -1
  87. package/corpus/templates/design/app/components/design/edit-panel/position-layout-properties.tsx +40 -26
  88. package/corpus/templates/design/app/components/design/multi-screen/board-surface-html.ts +4 -1
  89. package/corpus/templates/design/app/components/design/multi-screen/frame-geometry.ts +12 -3
  90. package/corpus/templates/design/app/components/design/multi-screen/screen-content-cache.ts +4 -0
  91. package/corpus/templates/design/app/components/design/multi-screen/types.ts +7 -0
  92. package/corpus/templates/design/app/components/editor/PromptDialog.tsx +3 -2
  93. package/corpus/templates/design/app/components/layout/Sidebar.tsx +2 -2
  94. package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +3 -0
  95. package/corpus/templates/design/app/i18n-data.ts +1 -0
  96. package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +5 -5
  97. package/corpus/templates/design/app/pages/DesignSystems.tsx +3 -2
  98. package/corpus/templates/design/app/pages/design-editor/canvas-primitive-insert.ts +100 -13
  99. package/corpus/templates/design/app/pages/design-editor/cross-screen-text-color.ts +1 -1
  100. package/corpus/templates/design/app/pages/design-editor/data-operations.ts +14 -0
  101. package/corpus/templates/design/changelog/2026-08-10-marquee-selecting-layers-far-down-a-tall-screen-now-selects-.md +6 -0
  102. package/corpus/templates/design/changelog/2026-08-10-the-frame-tool-draws-a-plain-frame-by-default-with-screen-av.md +6 -0
  103. package/corpus/templates/design/e2e/global-setup.ts +27 -32
  104. package/corpus/templates/design/playwright.config.ts +3 -5
  105. package/corpus/templates/design/shared/breakpoint-media.ts +9 -2
  106. package/corpus/templates/dispatch/.agents/skills/actions/SKILL.md +54 -488
  107. package/corpus/templates/dispatch/.agents/skills/actions/references/action-fields.md +136 -0
  108. package/corpus/templates/dispatch/.agents/skills/actions/references/examples.md +94 -0
  109. package/corpus/templates/dispatch/.agents/skills/actions/references/provider-apis.md +95 -0
  110. package/corpus/templates/dispatch/.agents/skills/create-skill/SKILL.md +9 -35
  111. package/corpus/templates/dispatch/.agents/skills/frontend-design/SKILL.md +4 -5
  112. package/corpus/templates/dispatch/.agents/skills/turn-into-app/SKILL.md +18 -31
  113. package/corpus/templates/dispatch/AGENTS.md +9 -16
  114. package/corpus/templates/factory/.agents/skills/actions/SKILL.md +54 -488
  115. package/corpus/templates/factory/.agents/skills/actions/references/action-fields.md +136 -0
  116. package/corpus/templates/factory/.agents/skills/actions/references/examples.md +94 -0
  117. package/corpus/templates/factory/.agents/skills/actions/references/provider-apis.md +95 -0
  118. package/corpus/templates/factory/.agents/skills/create-skill/SKILL.md +9 -35
  119. package/corpus/templates/factory/.agents/skills/frontend-design/SKILL.md +4 -5
  120. package/corpus/templates/factory/.agents/skills/turn-into-app/SKILL.md +18 -31
  121. package/corpus/templates/factory/AGENTS.md +10 -24
  122. package/corpus/templates/forms/.agents/skills/actions/SKILL.md +54 -488
  123. package/corpus/templates/forms/.agents/skills/actions/references/action-fields.md +136 -0
  124. package/corpus/templates/forms/.agents/skills/actions/references/examples.md +94 -0
  125. package/corpus/templates/forms/.agents/skills/actions/references/provider-apis.md +95 -0
  126. package/corpus/templates/forms/.agents/skills/create-skill/SKILL.md +9 -35
  127. package/corpus/templates/forms/.agents/skills/frontend-design/SKILL.md +4 -5
  128. package/corpus/templates/forms/.agents/skills/turn-into-app/SKILL.md +18 -31
  129. package/corpus/templates/forms/AGENTS.md +11 -17
  130. package/corpus/templates/forms/app/global.css +1 -0
  131. package/corpus/templates/forms/changelog/2026-08-11-full-page-chat-composers-stay-at-a-focused-750px-width.md +6 -0
  132. package/corpus/templates/macros/.agents/skills/frontend-design/SKILL.md +4 -5
  133. package/corpus/templates/macros/.agents/skills/turn-into-app/SKILL.md +18 -31
  134. package/corpus/templates/macros/AGENTS.md +8 -8
  135. package/corpus/templates/mail/.agents/skills/actions/SKILL.md +54 -488
  136. package/corpus/templates/mail/.agents/skills/actions/references/action-fields.md +136 -0
  137. package/corpus/templates/mail/.agents/skills/actions/references/examples.md +94 -0
  138. package/corpus/templates/mail/.agents/skills/actions/references/provider-apis.md +95 -0
  139. package/corpus/templates/mail/.agents/skills/create-skill/SKILL.md +9 -35
  140. package/corpus/templates/mail/.agents/skills/frontend-design/SKILL.md +4 -5
  141. package/corpus/templates/mail/.agents/skills/turn-into-app/SKILL.md +18 -31
  142. package/corpus/templates/mail/AGENTS.md +5 -6
  143. package/corpus/templates/plan/.agents/skills/actions/SKILL.md +54 -488
  144. package/corpus/templates/plan/.agents/skills/actions/references/action-fields.md +136 -0
  145. package/corpus/templates/plan/.agents/skills/actions/references/examples.md +94 -0
  146. package/corpus/templates/plan/.agents/skills/actions/references/provider-apis.md +95 -0
  147. package/corpus/templates/plan/.agents/skills/create-skill/SKILL.md +9 -35
  148. package/corpus/templates/plan/.agents/skills/frontend-design/SKILL.md +4 -5
  149. package/corpus/templates/plan/.agents/skills/turn-into-app/SKILL.md +18 -31
  150. package/corpus/templates/plan/AGENTS.md +5 -14
  151. package/corpus/templates/plan/changelog/2026-08-11-plan-no-longer-reloads-when-runtime-state-changes.md +6 -0
  152. package/corpus/templates/plan/vite.config.ts +5 -0
  153. package/corpus/templates/slides/.agents/skills/actions/SKILL.md +54 -488
  154. package/corpus/templates/slides/.agents/skills/actions/references/action-fields.md +136 -0
  155. package/corpus/templates/slides/.agents/skills/actions/references/examples.md +94 -0
  156. package/corpus/templates/slides/.agents/skills/actions/references/provider-apis.md +95 -0
  157. package/corpus/templates/slides/.agents/skills/create-deck/SKILL.md +2 -2
  158. package/corpus/templates/slides/.agents/skills/create-skill/SKILL.md +9 -35
  159. package/corpus/templates/slides/.agents/skills/creative-context/SKILL.md +6 -3
  160. package/corpus/templates/slides/.agents/skills/deck-management/SKILL.md +6 -1
  161. package/corpus/templates/slides/.agents/skills/frontend-design/SKILL.md +4 -5
  162. package/corpus/templates/slides/.agents/skills/image-generation-via-a2a/SKILL.md +3 -2
  163. package/corpus/templates/slides/.agents/skills/slide-editing/SKILL.md +3 -0
  164. package/corpus/templates/slides/.agents/skills/slide-images/SKILL.md +3 -3
  165. package/corpus/templates/slides/.agents/skills/turn-into-app/SKILL.md +18 -31
  166. package/corpus/templates/slides/AGENTS.md +22 -25
  167. package/corpus/templates/slides/actions/get-deck-reference-context.ts +2 -2
  168. package/corpus/templates/slides/actions/get-deck.ts +57 -9
  169. package/corpus/templates/slides/actions/import-file.ts +2 -1
  170. package/corpus/templates/slides/actions/patch-deck.ts +45 -2
  171. package/corpus/templates/slides/actions/update-slide.ts +1 -1
  172. package/corpus/templates/slides/app/components/comments/SlideCommentsPanel.tsx +2 -2
  173. package/corpus/templates/slides/app/components/deck/DeckCard.tsx +1 -23
  174. package/corpus/templates/slides/app/components/design-system/DesignSystemCard.tsx +2 -2
  175. package/corpus/templates/slides/app/components/design-system/DesignSystemSetup.tsx +6 -6
  176. package/corpus/templates/slides/app/components/editor/AnimationsPanel.tsx +3 -3
  177. package/corpus/templates/slides/app/components/editor/DeckEditorSkeleton.tsx +4 -4
  178. package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +1 -1
  179. package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +428 -180
  180. package/corpus/templates/slides/app/components/editor/ExportMenu.tsx +294 -266
  181. package/corpus/templates/slides/app/components/editor/PromptDialog.tsx +7 -5
  182. package/corpus/templates/slides/app/components/editor/SlideContextToolbar.tsx +1 -1
  183. package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +40 -12
  184. package/corpus/templates/slides/app/components/editor/SpeakerNotesPanel.tsx +6 -12
  185. package/corpus/templates/slides/app/components/editor/editor-command-model.ts +35 -0
  186. package/corpus/templates/slides/app/components/layout/Sidebar.tsx +8 -10
  187. package/corpus/templates/slides/app/context/DeckContext.tsx +2 -1
  188. package/corpus/templates/slides/app/global.css +76 -1
  189. package/corpus/templates/slides/app/i18n/en-US.ts +1 -0
  190. package/corpus/templates/slides/app/lib/create-deck-generation.ts +51 -23
  191. package/corpus/templates/slides/app/lib/slide-animation-elements.ts +68 -5
  192. package/corpus/templates/slides/app/pages/DeckEditor.tsx +13 -6
  193. package/corpus/templates/slides/app/pages/DesignSystems.tsx +2 -2
  194. package/corpus/templates/slides/app/pages/Index.tsx +87 -74
  195. package/corpus/templates/slides/app/root.tsx +43 -0
  196. package/corpus/templates/slides/changelog/2026-08-11-faster-slides-chat-deck-reads.md +6 -0
  197. package/corpus/templates/slides/changelog/2026-08-11-slides-chat-can-read-one-slide-without-loading-the-full-deck.md +6 -0
  198. package/corpus/templates/slides/changelog/2026-08-11-slides-clearly-indicate-when-an-ai-agent-is-editing-alongsid.md +6 -0
  199. package/corpus/templates/slides/package.json +1 -0
  200. package/corpus/templates/slides/server/lib/validate-slide-animations.ts +163 -0
  201. package/corpus/templates/slides/server/plugins/agent-chat.ts +4 -3
  202. package/corpus/templates/slides/shared/api.ts +46 -15
  203. package/corpus/templates/tasks/.agents/skills/actions/SKILL.md +54 -488
  204. package/corpus/templates/tasks/.agents/skills/actions/references/action-fields.md +136 -0
  205. package/corpus/templates/tasks/.agents/skills/actions/references/examples.md +94 -0
  206. package/corpus/templates/tasks/.agents/skills/actions/references/provider-apis.md +95 -0
  207. package/corpus/templates/tasks/.agents/skills/agent-watchdog/SKILL.md +1 -0
  208. package/corpus/templates/tasks/.agents/skills/create-skill/SKILL.md +9 -35
  209. package/corpus/templates/tasks/.agents/skills/efficient-fable/SKILL.md +1 -0
  210. package/corpus/templates/tasks/.agents/skills/efficient-frontier/SKILL.md +1 -0
  211. package/corpus/templates/tasks/.agents/skills/frontend-design/SKILL.md +4 -5
  212. package/corpus/templates/tasks/.agents/skills/plan-arbiter/SKILL.md +1 -0
  213. package/corpus/templates/tasks/.agents/skills/plow-ahead/SKILL.md +1 -0
  214. package/corpus/templates/tasks/.agents/skills/quick-recap/SKILL.md +1 -0
  215. package/corpus/templates/tasks/.agents/skills/read-the-damn-docs/SKILL.md +1 -0
  216. package/corpus/templates/tasks/.agents/skills/stay-within-limits/SKILL.md +1 -0
  217. package/corpus/templates/tasks/.agents/skills/turn-into-app/SKILL.md +18 -31
  218. package/corpus/templates/tasks/AGENTS.md +5 -20
  219. package/dist/agent/production-agent.js +376 -345
  220. package/dist/agent/run-manager.js +156 -14
  221. package/dist/agent/run-store.d.ts +11 -10
  222. package/dist/agent/run-store.js +17 -13
  223. package/dist/client/AssistantChat.d.ts +6 -2
  224. package/dist/client/AssistantChat.js +216 -131
  225. package/dist/client/active-run-state.d.ts +9 -1
  226. package/dist/client/active-run-state.js +34 -3
  227. package/dist/client/agent-chat-adapter.d.ts +8 -0
  228. package/dist/client/agent-chat-adapter.js +114 -28
  229. package/dist/client/chat/message-components.d.ts +7 -1
  230. package/dist/client/chat/message-components.js +32 -5
  231. package/dist/client/chat/run-recovery.d.ts +1 -0
  232. package/dist/client/chat/run-recovery.js +8 -0
  233. package/dist/client/chat/tool-call-display.d.ts +2 -0
  234. package/dist/client/chat/tool-call-display.js +2 -0
  235. package/dist/client/chat-first/apps-rail.js +1 -1
  236. package/dist/client/chat-first/chat-history.d.ts +1 -1
  237. package/dist/client/chat-first/chat-history.js +5 -2
  238. package/dist/client/sse-event-processor.d.ts +4 -2
  239. package/dist/client/sse-event-processor.js +36 -6
  240. package/dist/client/use-run-stuck-detection.d.ts +2 -0
  241. package/dist/client/use-run-stuck-detection.js +85 -9
  242. package/dist/collab/awareness.d.ts +2 -2
  243. package/dist/collab/routes.d.ts +1 -1
  244. package/dist/integrations/adapters/slack.d.ts +0 -4
  245. package/dist/integrations/adapters/slack.js +6 -30
  246. package/dist/integrations/catalog.js +1 -1
  247. package/dist/integrations/pending-tasks-store.d.ts +0 -8
  248. package/dist/integrations/pending-tasks-store.js +0 -21
  249. package/dist/integrations/slack-manifest.d.ts +2 -2
  250. package/dist/integrations/slack-manifest.js +0 -3
  251. package/dist/mcp/screen-memory-stdio.d.ts +7 -7
  252. package/dist/observability/routes.d.ts +3 -3
  253. package/dist/provider-api/actions/custom-provider-registration.d.ts +4 -4
  254. package/dist/provider-api/actions/provider-api.d.ts +8 -8
  255. package/dist/resources/handlers.d.ts +1 -1
  256. package/dist/scripts/docs/source-search.js +2 -2
  257. package/dist/secrets/routes.d.ts +9 -9
  258. package/dist/server/agent-chat/framework-prompts.js +7 -2
  259. package/dist/server/agent-chat/prompt-resources.js +2 -2
  260. package/dist/server/agent-chat/skill-frontmatter.d.ts +31 -2
  261. package/dist/server/agent-chat/skill-frontmatter.js +41 -15
  262. package/dist/server/agent-chat-plugin.js +3 -3
  263. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  264. package/dist/server/agents-bundle.d.ts +16 -19
  265. package/dist/server/agents-bundle.js +19 -35
  266. package/dist/server/better-auth-instance.d.ts +1 -0
  267. package/dist/server/better-auth-instance.js +17 -2
  268. package/dist/server/prompts/framework-core-compact.d.ts +6 -1
  269. package/dist/server/prompts/framework-core-compact.js +12 -9
  270. package/dist/server/prompts/framework-core.d.ts +6 -1
  271. package/dist/server/prompts/framework-core.js +11 -9
  272. package/dist/server/prompts/index.d.ts +1 -1
  273. package/dist/server/prompts/index.js +1 -1
  274. package/dist/server/prompts/shared-rules.d.ts +15 -11
  275. package/dist/server/prompts/shared-rules.js +17 -13
  276. package/dist/server/realtime-token.d.ts +1 -1
  277. package/dist/server/transcribe-voice.d.ts +1 -1
  278. package/dist/templates/chat/.agents/skills/actions/SKILL.md +54 -488
  279. package/dist/templates/chat/.agents/skills/actions/references/action-fields.md +136 -0
  280. package/dist/templates/chat/.agents/skills/actions/references/examples.md +94 -0
  281. package/dist/templates/chat/.agents/skills/actions/references/provider-apis.md +95 -0
  282. package/dist/templates/chat/.agents/skills/create-skill/SKILL.md +9 -35
  283. package/dist/templates/chat/.agents/skills/frontend-design/SKILL.md +4 -5
  284. package/dist/templates/chat/.agents/skills/turn-into-app/SKILL.md +18 -31
  285. package/dist/templates/chat/AGENTS.md +32 -80
  286. package/dist/templates/default/.agents/skills/actions/SKILL.md +54 -488
  287. package/dist/templates/default/.agents/skills/actions/references/action-fields.md +136 -0
  288. package/dist/templates/default/.agents/skills/actions/references/examples.md +94 -0
  289. package/dist/templates/default/.agents/skills/actions/references/provider-apis.md +95 -0
  290. package/dist/templates/default/.agents/skills/create-skill/SKILL.md +9 -35
  291. package/dist/templates/default/.agents/skills/frontend-design/SKILL.md +4 -5
  292. package/dist/templates/default/.agents/skills/turn-into-app/SKILL.md +18 -31
  293. package/dist/templates/headless/.agents/skills/actions/SKILL.md +54 -488
  294. package/dist/templates/headless/.agents/skills/actions/references/action-fields.md +136 -0
  295. package/dist/templates/headless/.agents/skills/actions/references/examples.md +94 -0
  296. package/dist/templates/headless/.agents/skills/actions/references/provider-apis.md +95 -0
  297. package/dist/templates/headless/.agents/skills/turn-into-app/SKILL.md +18 -31
  298. package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +54 -488
  299. package/dist/templates/workspace-core/.agents/skills/actions/references/action-fields.md +136 -0
  300. package/dist/templates/workspace-core/.agents/skills/actions/references/examples.md +94 -0
  301. package/dist/templates/workspace-core/.agents/skills/actions/references/provider-apis.md +95 -0
  302. package/dist/templates/workspace-core/.agents/skills/adding-workspace-apps/SKILL.md +1 -0
  303. package/dist/templates/workspace-core/.agents/skills/agent-page/SKILL.md +1 -0
  304. package/dist/templates/workspace-core/.agents/skills/create-skill/SKILL.md +9 -35
  305. package/dist/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +4 -5
  306. package/dist/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +21 -29
  307. package/dist/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +18 -31
  308. package/dist/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +7 -17
  309. package/dist/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +3 -3
  310. package/dist/templates/workspace-core/AGENTS.md +7 -16
  311. package/docs/content/messaging.mdx +6 -7
  312. package/package.json +1 -1
  313. package/src/templates/chat/.agents/skills/actions/SKILL.md +54 -488
  314. package/src/templates/chat/.agents/skills/actions/references/action-fields.md +136 -0
  315. package/src/templates/chat/.agents/skills/actions/references/examples.md +94 -0
  316. package/src/templates/chat/.agents/skills/actions/references/provider-apis.md +95 -0
  317. package/src/templates/chat/.agents/skills/create-skill/SKILL.md +9 -35
  318. package/src/templates/chat/.agents/skills/frontend-design/SKILL.md +4 -5
  319. package/src/templates/chat/.agents/skills/turn-into-app/SKILL.md +18 -31
  320. package/src/templates/chat/AGENTS.md +32 -80
  321. package/src/templates/default/.agents/skills/actions/SKILL.md +54 -488
  322. package/src/templates/default/.agents/skills/actions/references/action-fields.md +136 -0
  323. package/src/templates/default/.agents/skills/actions/references/examples.md +94 -0
  324. package/src/templates/default/.agents/skills/actions/references/provider-apis.md +95 -0
  325. package/src/templates/default/.agents/skills/create-skill/SKILL.md +9 -35
  326. package/src/templates/default/.agents/skills/frontend-design/SKILL.md +4 -5
  327. package/src/templates/default/.agents/skills/turn-into-app/SKILL.md +18 -31
  328. package/src/templates/headless/.agents/skills/actions/SKILL.md +54 -488
  329. package/src/templates/headless/.agents/skills/actions/references/action-fields.md +136 -0
  330. package/src/templates/headless/.agents/skills/actions/references/examples.md +94 -0
  331. package/src/templates/headless/.agents/skills/actions/references/provider-apis.md +95 -0
  332. package/src/templates/headless/.agents/skills/turn-into-app/SKILL.md +18 -31
  333. package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +54 -488
  334. package/src/templates/workspace-core/.agents/skills/actions/references/action-fields.md +136 -0
  335. package/src/templates/workspace-core/.agents/skills/actions/references/examples.md +94 -0
  336. package/src/templates/workspace-core/.agents/skills/actions/references/provider-apis.md +95 -0
  337. package/src/templates/workspace-core/.agents/skills/adding-workspace-apps/SKILL.md +1 -0
  338. package/src/templates/workspace-core/.agents/skills/agent-page/SKILL.md +1 -0
  339. package/src/templates/workspace-core/.agents/skills/create-skill/SKILL.md +9 -35
  340. package/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +4 -5
  341. package/src/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +21 -29
  342. package/src/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +18 -31
  343. package/src/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +7 -17
  344. package/src/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +3 -3
  345. package/src/templates/workspace-core/AGENTS.md +7 -16
@@ -499,10 +499,24 @@ function abortInMemoryRun(run, reason = "user") {
499
499
  threadToRun.delete(run.threadId);
500
500
  }
501
501
  run.abort.abort(reason);
502
- const terminalEvent = terminalEventForAbortReason(reason);
502
+ // Keep the abort terminal in the replay buffer as well as sending it to
503
+ // current subscribers. A reconnect can arrive after the live subscriber
504
+ // was removed but while this run is still warm in memory; closing that
505
+ // replay with no terminal frame makes the client manufacture a false
506
+ // frozen response and retry against a run that is already done.
507
+ const existingTerminalEvent = [...run.events]
508
+ .reverse()
509
+ .find((event) => isTerminalRunEvent(event.event));
510
+ const terminalRunEvent = existingTerminalEvent ?? {
511
+ seq: run.events.length,
512
+ event: terminalEventForAbortReason(reason),
513
+ };
514
+ if (!existingTerminalEvent) {
515
+ run.events.push(terminalRunEvent);
516
+ }
503
517
  for (const subscriber of run.subscribers) {
504
518
  try {
505
- subscriber({ seq: run.events.length, event: terminalEvent });
519
+ subscriber(terminalRunEvent);
506
520
  }
507
521
  catch {
508
522
  // ignore — subscriber is being removed below
@@ -596,18 +610,116 @@ export function startRun(runId, threadId, runFn, onComplete, options) {
596
610
  // Throttle the durable progress timestamp to at most once per second so
597
611
  // a chatty token-by-token stream doesn't translate into one DB write per
598
612
  // chunk. The stuck-detector threshold is on the order of tens of seconds,
599
- // so 1s resolution is plenty.
613
+ // so 1s resolution is plenty. Keep one write in flight and coalesce a
614
+ // trailing request: overlapping progress updates can exhaust a pooler and
615
+ // starve the heartbeat that is supposed to prove this run is alive.
616
+ const PROGRESS_BUMP_INTERVAL_MS = 1_000;
600
617
  let lastProgressBumpAt = 0;
618
+ let progressWriteInFlight = null;
619
+ let progressWriteTimer = null;
620
+ let progressWritePending = false;
621
+ let progressWriteAttempts = 0;
622
+ let progressWriteFailures = 0;
623
+ let consecutiveProgressWriteFailures = 0;
601
624
  const preparingActivityBytes = new Map();
602
625
  const preparingActivityTools = new Map();
603
626
  const preparingActivityRestartHighWater = new Map();
604
627
  let eventPersistenceErrorCaptured = false;
605
- const bumpProgressIfDue = () => {
606
- const now = Date.now();
607
- if (now - lastProgressBumpAt < 1000)
628
+ const recordProgressWriteFailure = (error, kind) => {
629
+ progressWriteFailures += 1;
630
+ consecutiveProgressWriteFailures += 1;
631
+ // Keep every failure counted and retried, but sample the error capture so
632
+ // a database outage does not turn one long streamed input into hundreds of
633
+ // identical reports. The run id and event count make the sampled report
634
+ // useful for correlating the durable clock with the event ledger.
635
+ if (progressWriteFailures === 1 || progressWriteFailures % 10 === 0) {
636
+ const capturedError = error instanceof Error ? error : new Error(String(error));
637
+ console.error(`[run-manager] durable progress write ${kind} failed`, runId, {
638
+ attempts: progressWriteAttempts,
639
+ failures: progressWriteFailures,
640
+ consecutiveFailures: consecutiveProgressWriteFailures,
641
+ eventCount: run.events.length,
642
+ }, capturedError);
643
+ captureError(capturedError, {
644
+ route: "/_agent-native/agent-chat",
645
+ tags: {
646
+ source: "agent-run-manager",
647
+ phase: "progress",
648
+ kind,
649
+ consecutiveFailures: String(consecutiveProgressWriteFailures),
650
+ },
651
+ aiTraceId: runId,
652
+ extra: {
653
+ runId,
654
+ threadId,
655
+ attempts: progressWriteAttempts,
656
+ failures: progressWriteFailures,
657
+ eventCount: run.events.length,
658
+ },
659
+ });
660
+ }
661
+ };
662
+ const writeProgress = async () => {
663
+ let updated = await bumpRunProgress(runId);
664
+ if (updated === false) {
665
+ // The initial run insert is intentionally asynchronous so the fast SSE
666
+ // path does not wait on SQL. If this first UPDATE wins the race, retry
667
+ // after that insert commits instead of permanently losing the first
668
+ // durable progress signal.
669
+ await insertRunPromise;
670
+ updated = await bumpRunProgress(runId);
671
+ }
672
+ if (updated === false) {
673
+ if (run.status !== "running")
674
+ return;
675
+ recordProgressWriteFailure(new Error("Durable progress update affected no running run row"), "no-row");
676
+ progressWritePending = true;
608
677
  return;
609
- lastProgressBumpAt = now;
610
- bumpRunProgress(runId).catch(() => { });
678
+ }
679
+ consecutiveProgressWriteFailures = 0;
680
+ };
681
+ function startProgressWrite() {
682
+ if (!progressWritePending ||
683
+ progressWriteInFlight ||
684
+ run.status !== "running") {
685
+ return;
686
+ }
687
+ progressWritePending = false;
688
+ lastProgressBumpAt = Date.now();
689
+ progressWriteAttempts += 1;
690
+ const write = writeProgress()
691
+ .catch((error) => {
692
+ recordProgressWriteFailure(error, "error");
693
+ // Retry even if no later event arrives. A transient failure must not
694
+ // freeze the durable clock until the next user-visible event.
695
+ progressWritePending = true;
696
+ })
697
+ .finally(() => {
698
+ progressWriteInFlight = null;
699
+ scheduleProgressWrite();
700
+ });
701
+ progressWriteInFlight = write;
702
+ }
703
+ function scheduleProgressWrite() {
704
+ if (!progressWritePending ||
705
+ progressWriteInFlight ||
706
+ progressWriteTimer ||
707
+ run.status !== "running") {
708
+ return;
709
+ }
710
+ const delayMs = Math.max(0, lastProgressBumpAt + PROGRESS_BUMP_INTERVAL_MS - Date.now());
711
+ if (delayMs === 0) {
712
+ startProgressWrite();
713
+ return;
714
+ }
715
+ progressWriteTimer = setTimeout(() => {
716
+ progressWriteTimer = null;
717
+ startProgressWrite();
718
+ }, delayMs);
719
+ }
720
+ const bumpProgressIfDue = () => {
721
+ progressWritePending = true;
722
+ scheduleProgressWrite();
611
723
  };
612
724
  const shouldBumpProgressForEvent = (event) => {
613
725
  if (event.type === "stream_keepalive")
@@ -683,6 +795,25 @@ export function startRun(runId, threadId, runFn, onComplete, options) {
683
795
  // emits nothing for minutes and carries its own 12-min timeout.
684
796
  let lastRealProgressAt = Date.now();
685
797
  let inFlightWorkCount = 0;
798
+ let inFlightMarkerSince = null;
799
+ let inFlightMarkerWrite = Promise.resolve();
800
+ const mirrorInFlightMarker = (inFlight) => {
801
+ const markerSince = inFlight ? Date.now() : inFlightMarkerSince;
802
+ if (inFlight) {
803
+ inFlightMarkerSince = markerSince;
804
+ }
805
+ else {
806
+ inFlightMarkerSince = null;
807
+ }
808
+ // Preserve transition order: a delayed clear must not erase the marker
809
+ // written for the next tool that starts before the clear reaches SQL.
810
+ inFlightMarkerWrite = inFlightMarkerWrite
811
+ .catch(() => undefined)
812
+ .then(() => setRunInFlightMarker(runId, inFlight, markerSince ?? undefined))
813
+ .catch((error) => {
814
+ console.error(`[run-manager] failed to mirror in-flight marker (${inFlight ? "set" : "clear"})`, runId, error instanceof Error ? error.message : error);
815
+ });
816
+ };
686
817
  const trackInFlightWork = (event) => {
687
818
  const wasIdle = inFlightWorkCount === 0;
688
819
  if (event.type === "tool_start") {
@@ -708,15 +839,15 @@ export function startRun(runId, threadId, runFn, onComplete, options) {
708
839
  // grant this demonstrably-alive run a bounded grace even when THIS
709
840
  // isolate's own heartbeat write is failing (e.g. Neon pooler saturation)
710
841
  // — `inFlightWorkCount` itself is in-memory and invisible to those other
711
- // isolates. Fire-and-forget: never block event emission on this write,
712
- // and a write failure here is no worse than today's behavior (the row
713
- // just gets no grace). See `setRunInFlightMarker` / `IN_FLIGHT_RUN_STALE_GRACE_MS`
714
- // in run-store.ts for the full reasoning and the bounded-grace derivation.
842
+ // isolates. Fire-and-forget: never block event emission on this write, but
843
+ // keep failures observable and preserve transition order. See
844
+ // `setRunInFlightMarker` / `IN_FLIGHT_RUN_STALE_GRACE_MS` in run-store.ts
845
+ // for the full reasoning and bounded-grace derivation.
715
846
  if (wasIdle && inFlightWorkCount > 0) {
716
- setRunInFlightMarker(runId, true).catch(() => { });
847
+ mirrorInFlightMarker(true);
717
848
  }
718
849
  else if (!wasIdle && inFlightWorkCount === 0) {
719
- setRunInFlightMarker(runId, false).catch(() => { });
850
+ mirrorInFlightMarker(false);
720
851
  }
721
852
  };
722
853
  // Make a chunk boundary durable at the instant it is decided. The terminal
@@ -1171,6 +1302,17 @@ export function startRun(runId, threadId, runFn, onComplete, options) {
1171
1302
  clearInterval(heartbeatTimer);
1172
1303
  if (softTimeoutTimer)
1173
1304
  clearTimeout(softTimeoutTimer);
1305
+ if (progressWriteTimer)
1306
+ clearTimeout(progressWriteTimer);
1307
+ progressWriteTimer = null;
1308
+ progressWritePending = false;
1309
+ // A tool can throw before its matching event is emitted, or the process
1310
+ // can reach terminal cleanup with an in-flight call still open. Do not
1311
+ // leave the SQL grace marker attached to a terminal run.
1312
+ if (inFlightWorkCount > 0 || inFlightMarkerSince !== null) {
1313
+ inFlightWorkCount = 0;
1314
+ mirrorInFlightMarker(false);
1315
+ }
1174
1316
  // 5. Persist final status to SQL. Use the conditional write so a zombie
1175
1317
  // run (reaped or displaced while executing) cannot clobber the newer
1176
1318
  // status written by the reaper or a replacement run.
@@ -457,7 +457,7 @@ export declare function updateRunHeartbeat(runId: string): Promise<void>;
457
457
  * stuck-detector can tell "process alive but nothing happening" from
458
458
  * "process dead." Callers should throttle (run-manager debounces to ~1/s).
459
459
  */
460
- export declare function bumpRunProgress(runId: string): Promise<void>;
460
+ export declare function bumpRunProgress(runId: string): Promise<boolean>;
461
461
  /**
462
462
  * Mirror run-manager's in-memory `inFlightWorkCount` 0<->N transitions into
463
463
  * SQL so a stale reaper running in a DIFFERENT isolate can tell a
@@ -469,17 +469,18 @@ export declare function bumpRunProgress(runId: string): Promise<void>;
469
469
  * depth belt-and-suspenders against a nested 1->2 transition clobbering the
470
470
  * ORIGINAL start time with a later one (the caller's own counter already
471
471
  * dedupes 0->1 transitions; this WHERE just makes the write itself
472
- * idempotent/order-independent too). `inFlight: false` always clears
473
- * unconditionally — if it races a fresh 0->1 write from a *different* tool
474
- * finishing/starting back to back, worst case is losing a few seconds of
475
- * grace, never gaining an incorrect one.
472
+ * idempotent/order-independent too). When `markerSince` is supplied for a
473
+ * clear, the UPDATE is conditional on the marker still having that value. The
474
+ * run manager serializes marker writes and supplies this token so a delayed
475
+ * clear from one tool cannot erase a newer tool's marker.
476
476
  *
477
- * Best-effort: callers fire-and-forget (`.catch(() => {})`) so a write
478
- * failure here never blocks event emission or aborts the run. If this write
479
- * itself fails (the same DB pressure that could be starving the heartbeat),
480
- * the row simply gets no grace — never worse than today's behavior.
477
+ * Best-effort: callers fire-and-forget so a write failure here never blocks
478
+ * event emission or aborts the run. The run manager logs marker-write failures
479
+ * while preserving transition order. If this write itself fails (the same DB
480
+ * pressure that could be starving the heartbeat), the row simply gets no grace
481
+ * - never worse than today's behavior.
481
482
  */
482
- export declare function setRunInFlightMarker(runId: string, inFlight: boolean): Promise<void>;
483
+ export declare function setRunInFlightMarker(runId: string, inFlight: boolean, markerSince?: number): Promise<void>;
483
484
  /**
484
485
  * If the given run is marked "running" in SQL but its heartbeat is stale
485
486
  * (producer likely crashed), flip it to "errored" so watchers stop waiting.
@@ -1351,7 +1351,7 @@ export async function bumpRunProgress(runId) {
1351
1351
  await ensureRunTables();
1352
1352
  const client = getDbExec();
1353
1353
  const now = Date.now();
1354
- await client.execute({
1354
+ const { rowsAffected } = await client.execute({
1355
1355
  // Multiple event-persistence paths and serverless isolates can bump the
1356
1356
  // same run concurrently. A slower, older write must never land after a
1357
1357
  // newer one and move the user-visible no-progress clock backwards.
@@ -1359,6 +1359,7 @@ export async function bumpRunProgress(runId) {
1359
1359
  sql: `UPDATE agent_runs SET last_progress_at = CASE WHEN last_progress_at IS NULL OR last_progress_at < ? THEN ? ELSE last_progress_at END WHERE id = ? AND status = 'running'`,
1360
1360
  args: [now, now, runId],
1361
1361
  });
1362
+ return (rowsAffected ?? 0) > 0;
1362
1363
  }
1363
1364
  /**
1364
1365
  * Mirror run-manager's in-memory `inFlightWorkCount` 0<->N transitions into
@@ -1371,29 +1372,32 @@ export async function bumpRunProgress(runId) {
1371
1372
  * depth belt-and-suspenders against a nested 1->2 transition clobbering the
1372
1373
  * ORIGINAL start time with a later one (the caller's own counter already
1373
1374
  * dedupes 0->1 transitions; this WHERE just makes the write itself
1374
- * idempotent/order-independent too). `inFlight: false` always clears
1375
- * unconditionally — if it races a fresh 0->1 write from a *different* tool
1376
- * finishing/starting back to back, worst case is losing a few seconds of
1377
- * grace, never gaining an incorrect one.
1375
+ * idempotent/order-independent too). When `markerSince` is supplied for a
1376
+ * clear, the UPDATE is conditional on the marker still having that value. The
1377
+ * run manager serializes marker writes and supplies this token so a delayed
1378
+ * clear from one tool cannot erase a newer tool's marker.
1378
1379
  *
1379
- * Best-effort: callers fire-and-forget (`.catch(() => {})`) so a write
1380
- * failure here never blocks event emission or aborts the run. If this write
1381
- * itself fails (the same DB pressure that could be starving the heartbeat),
1382
- * the row simply gets no grace — never worse than today's behavior.
1380
+ * Best-effort: callers fire-and-forget so a write failure here never blocks
1381
+ * event emission or aborts the run. The run manager logs marker-write failures
1382
+ * while preserving transition order. If this write itself fails (the same DB
1383
+ * pressure that could be starving the heartbeat), the row simply gets no grace
1384
+ * - never worse than today's behavior.
1383
1385
  */
1384
- export async function setRunInFlightMarker(runId, inFlight) {
1386
+ export async function setRunInFlightMarker(runId, inFlight, markerSince) {
1385
1387
  await ensureRunTables();
1386
1388
  const client = getDbExec();
1387
1389
  if (inFlight) {
1388
1390
  await client.execute({
1389
1391
  sql: `UPDATE agent_runs SET in_flight_since = ? WHERE id = ? AND status = 'running' AND in_flight_since IS NULL`,
1390
- args: [Date.now(), runId],
1392
+ args: [markerSince ?? Date.now(), runId],
1391
1393
  });
1392
1394
  }
1393
1395
  else {
1394
1396
  await client.execute({
1395
- sql: `UPDATE agent_runs SET in_flight_since = NULL WHERE id = ?`,
1396
- args: [runId],
1397
+ sql: markerSince == null
1398
+ ? `UPDATE agent_runs SET in_flight_since = NULL WHERE id = ?`
1399
+ : `UPDATE agent_runs SET in_flight_since = NULL WHERE id = ? AND in_flight_since = ?`,
1400
+ args: markerSince == null ? [runId] : [runId, markerSince],
1397
1401
  });
1398
1402
  }
1399
1403
  }
@@ -34,7 +34,7 @@ export declare function createUserMessageRunConfig(references?: Reference[], req
34
34
  model?: string;
35
35
  engine?: string;
36
36
  effort?: ReasoningEffort;
37
- }): {
37
+ }, turnId?: string): {
38
38
  runConfig?: {
39
39
  custom: {
40
40
  references?: Reference[];
@@ -45,6 +45,7 @@ export declare function createUserMessageRunConfig(references?: Reference[], req
45
45
  model?: string;
46
46
  engine?: string;
47
47
  effort?: ReasoningEffort;
48
+ turnId?: string;
48
49
  };
49
50
  };
50
51
  metadata?: {
@@ -98,13 +99,14 @@ export declare function resolveAssistantChatSubmitIntent({ isRunning, requestedI
98
99
  isRunning: boolean;
99
100
  requestedIntent?: ComposerSubmitIntent;
100
101
  }): ComposerSubmitIntent;
101
- export declare function resolveAssistantChatRunningState({ forceStopped, isRuntimeRunning, isReconnecting, optimisticRunning, isAutoResuming, hasActiveServerRun, }: {
102
+ export declare function resolveAssistantChatRunningState({ forceStopped, isRuntimeRunning, isReconnecting, optimisticRunning, isAutoResuming, hasActiveServerRun, hasTerminalRunError, }: {
102
103
  forceStopped: boolean;
103
104
  isRuntimeRunning: boolean;
104
105
  isReconnecting: boolean;
105
106
  optimisticRunning: boolean;
106
107
  isAutoResuming: boolean;
107
108
  hasActiveServerRun?: boolean;
109
+ hasTerminalRunError?: boolean;
108
110
  }): {
109
111
  isRunning: boolean;
110
112
  showRunningInUI: boolean;
@@ -137,6 +139,8 @@ type QueuedMessage = {
137
139
  trackInRunsTray?: boolean;
138
140
  hideUserMessage?: boolean;
139
141
  approvedToolCalls?: string[];
142
+ /** Preserve the logical turn when a hidden reconnect recovery is re-issued. */
143
+ turnId?: string;
140
144
  /**
141
145
  * Model/engine/effort snapshotted at enqueue time, for the same reason
142
146
  * `requestMode` is: the picker is global and live, so a queue that flushes