@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
@@ -532,6 +532,8 @@ interface SlideEditorProps {
532
532
  * shell above the slide rail. Selection state lives here, so the toolbar is
533
533
  * portaled out rather than lifted. Falls back to rendering in place. */
534
534
  contextToolbarSlot?: HTMLElement | null;
535
+ /** Wide editor-shell host for the toolbar's top-row placement. */
536
+ wideContextToolbarSlot?: HTMLElement | null;
535
537
  /** Selection-independent actions for the head of the contextual toolbar. */
536
538
  contextToolbarLeading?: ReactNode;
537
539
  onGenerateImage: () => void;
@@ -564,8 +566,6 @@ interface SlideEditorProps {
564
566
  onComment?: (quotedText: string) => void;
565
567
  /** Zero-based index of the current slide */
566
568
  slideIndex?: number;
567
- /** Total number of slides in the deck */
568
- slideCount?: number;
569
569
  /** Design system to inject as CSS custom properties on the slide */
570
570
  designSystem?: DesignSystemData;
571
571
  /** Deck aspect ratio (defaults to 16:9 when omitted) */
@@ -647,10 +647,15 @@ function SameSlidePresenceIndicator({ users }: { users: CollabUser[] }) {
647
647
  if (users.length === 0) return null;
648
648
  const visible = users.slice(0, 3);
649
649
  const overflow = users.length - visible.length;
650
+ const agentIsPresent = users.some(
651
+ (user) => user.email.trim().toLowerCase() === "agent@system",
652
+ );
650
653
  const label =
651
- users.length === 1
652
- ? `${users[0].name} is here`
653
- : `${users.length} others here`;
654
+ agentIsPresent && users.length === 1
655
+ ? "AI editing"
656
+ : users.length === 1
657
+ ? `${users[0].name} is here`
658
+ : `${users.length} others here`;
654
659
  return (
655
660
  <div className="pointer-events-auto flex items-center gap-1.5 rounded-full border border-border bg-popover/95 py-1 pl-1 pr-2.5 text-xs text-popover-foreground shadow-lg">
656
661
  <div className="flex items-center">
@@ -993,6 +998,7 @@ export default function SlideEditor({
993
998
  onUpdateSlide,
994
999
  readOnly = false,
995
1000
  contextToolbarSlot,
1001
+ wideContextToolbarSlot,
996
1002
  contextToolbarLeading,
997
1003
  onGenerateImage,
998
1004
  onOpenAssetLibrary,
@@ -1004,7 +1010,6 @@ export default function SlideEditor({
1004
1010
  onToggleObjectFit,
1005
1011
  agentActive,
1006
1012
  slideIndex = 0,
1007
- slideCount = 1,
1008
1013
  designSystem,
1009
1014
  aspectRatio,
1010
1015
  drawMode,
@@ -4198,6 +4203,27 @@ export default function SlideEditor({
4198
4203
  // the button's onClick runs, so partial-text formatting would silently
4199
4204
  // apply to the whole object.
4200
4205
  data-slide-inline-edit-surface="true"
4206
+ data-slide-context-toolbar-placement="row"
4207
+ onPointerDownCapture={preserveRichTextSelection}
4208
+ >
4209
+ <SlideContextToolbar
4210
+ snapshot={selectedStyleSnapshot}
4211
+ background={slide.background}
4212
+ designSystem={designSystem}
4213
+ leading={contextToolbarLeading}
4214
+ onChange={applySelectedStylePatch}
4215
+ onBackgroundChange={applySlideBackground}
4216
+ onArrange={handleArrangeSelected}
4217
+ onToggleList={handleToggleList}
4218
+ />
4219
+ </div>
4220
+ ) : null;
4221
+
4222
+ const wideContextToolbar = !readOnly ? (
4223
+ <div
4224
+ className="shrink-0"
4225
+ data-slide-inline-edit-surface="true"
4226
+ data-slide-context-toolbar-placement="top"
4201
4227
  onPointerDownCapture={preserveRichTextSelection}
4202
4228
  >
4203
4229
  <SlideContextToolbar
@@ -4209,15 +4235,19 @@ export default function SlideEditor({
4209
4235
  onBackgroundChange={applySlideBackground}
4210
4236
  onArrange={handleArrangeSelected}
4211
4237
  onToggleList={handleToggleList}
4238
+ className="slide-context-toolbar--top-row"
4212
4239
  />
4213
4240
  </div>
4214
4241
  ) : null;
4215
4242
 
4216
4243
  return (
4217
4244
  <div
4218
- className="relative flex h-full min-h-0 flex-1 flex-col overflow-hidden"
4245
+ className="relative flex h-full min-h-0 flex-1 flex-col overflow-hidden rounded-l-lg bg-[var(--slides-editor-surface)]"
4219
4246
  data-slide-element-selected={slideElementSelected ? "true" : undefined}
4220
4247
  >
4248
+ {!readOnly && wideContextToolbarSlot
4249
+ ? createPortal(wideContextToolbar, wideContextToolbarSlot)
4250
+ : null}
4221
4251
  {contextToolbarSlot
4222
4252
  ? createPortal(contextToolbar, contextToolbarSlot)
4223
4253
  : contextToolbar}
@@ -4225,7 +4255,7 @@ export default function SlideEditor({
4225
4255
  <div className="flex min-h-0 flex-1 overflow-hidden">
4226
4256
  <div className="min-w-0 flex-1 overflow-hidden">
4227
4257
  {slide.excalidrawData ? (
4228
- <div className="relative h-full bg-background">
4258
+ <div className="relative h-full bg-[var(--slides-editor-surface)]">
4229
4259
  {!readOnly && (
4230
4260
  <ExcalidrawExitButton
4231
4261
  // JSON.stringify drops `undefined` properties before the patch
@@ -4245,8 +4275,8 @@ export default function SlideEditor({
4245
4275
  />
4246
4276
  </div>
4247
4277
  ) : (
4248
- <div className="relative h-full bg-background">
4249
- <div className="absolute right-3 top-3 z-20 flex h-8 items-center gap-0.5 rounded-md border border-border bg-popover/95 px-1 shadow-lg">
4278
+ <div className="relative h-full bg-[var(--slides-editor-surface)]">
4279
+ <div className="absolute right-3 top-3 z-20 flex h-8 items-center gap-0.5 rounded-md bg-popover/95 px-1">
4250
4280
  <Tooltip>
4251
4281
  <TooltipTrigger asChild>
4252
4282
  <Button
@@ -4385,8 +4415,6 @@ export default function SlideEditor({
4385
4415
  <SpeakerNotesPanel
4386
4416
  notes={slide.notes}
4387
4417
  onChange={(notes) => onUpdateSlide({ notes })}
4388
- slideIndex={slideIndex}
4389
- slideCount={slideCount}
4390
4418
  readOnly={readOnly}
4391
4419
  />
4392
4420
 
@@ -5,8 +5,6 @@ import { useState, type PointerEvent as ReactPointerEvent } from "react";
5
5
  interface SpeakerNotesPanelProps {
6
6
  notes: string;
7
7
  onChange: (notes: string) => void;
8
- slideIndex: number;
9
- slideCount: number;
10
8
  readOnly?: boolean;
11
9
  }
12
10
 
@@ -21,16 +19,15 @@ function clampNotesHeight(value: number) {
21
19
  export function SpeakerNotesPanel({
22
20
  notes,
23
21
  onChange,
24
- slideIndex,
25
- slideCount,
26
22
  readOnly = false,
27
23
  }: SpeakerNotesPanelProps) {
28
24
  const t = useT();
29
25
  const [expanded, setExpanded] = useState(() => {
30
26
  try {
31
- return localStorage.getItem("speaker-notes-expanded") !== "false";
27
+ return localStorage.getItem("speaker-notes-expanded") === "true";
32
28
  } catch {
33
- return true;
29
+ // coercion-ok: browser storage is optional; the collapsed state is the default.
30
+ return false;
34
31
  }
35
32
  });
36
33
  const [height, setHeight] = useState(() => {
@@ -74,7 +71,7 @@ export function SpeakerNotesPanel({
74
71
  };
75
72
 
76
73
  return (
77
- <div className="flex-shrink-0 border-t border-border bg-background">
74
+ <div className="flex-shrink-0 bg-[var(--slides-editor-surface)]">
78
75
  {expanded && (
79
76
  <div
80
77
  role="separator"
@@ -83,7 +80,7 @@ export function SpeakerNotesPanel({
83
80
  className="group flex h-2 cursor-row-resize items-center justify-center"
84
81
  onPointerDown={startResize}
85
82
  >
86
- <div className="h-px w-10 rounded-full bg-border transition-colors group-hover:bg-muted-foreground/70" />
83
+ <div className="h-px w-10 rounded-full bg-muted-foreground/30 transition-colors group-hover:bg-muted-foreground/70" />
87
84
  </div>
88
85
  )}
89
86
  <button
@@ -91,10 +88,7 @@ export function SpeakerNotesPanel({
91
88
  className="flex w-full cursor-pointer items-center justify-between px-4 py-1.5"
92
89
  >
93
90
  <span className="text-[10px] font-medium text-muted-foreground uppercase tracking-wider">
94
- {t("raw.speakerNotesForSlide", {
95
- index: slideIndex + 1,
96
- count: slideCount,
97
- })}
91
+ {t("raw.speakerNotes")}
98
92
  </span>
99
93
  {expanded ? (
100
94
  <IconChevronDown className="w-3 h-3 text-muted-foreground" />
@@ -0,0 +1,35 @@
1
+ import type { ComponentType } from "react";
2
+
3
+ export type EditorCommandGroup =
4
+ | "media"
5
+ | "slideTools"
6
+ | "comments"
7
+ | "deck"
8
+ | "other";
9
+
10
+ export interface EditorCommand {
11
+ id: string;
12
+ group: EditorCommandGroup;
13
+ label: string;
14
+ keywords?: string[];
15
+ icon?: ComponentType<{ className?: string; size?: number }>;
16
+ active?: boolean;
17
+ run: () => void;
18
+ }
19
+
20
+ const EMPTY_COMMANDS: readonly EditorCommand[] = [];
21
+ type EditorCommandSource = () => readonly EditorCommand[];
22
+
23
+ let activeCommandSource: EditorCommandSource | null = null;
24
+
25
+ export function registerEditorCommands(source: EditorCommandSource) {
26
+ activeCommandSource = source;
27
+
28
+ return () => {
29
+ if (activeCommandSource === source) activeCommandSource = null;
30
+ };
31
+ }
32
+
33
+ export function getEditorCommands(): readonly EditorCommand[] {
34
+ return activeCommandSource?.() ?? EMPTY_COMMANDS;
35
+ }
@@ -6,8 +6,8 @@ import { OrgSwitcher } from "@agent-native/core/client/org";
6
6
  import { FeedbackButton } from "@agent-native/core/client/ui";
7
7
  import { SidebarFooterActions } from "@agent-native/toolkit/app-shell";
8
8
  import {
9
- IconStack2,
10
- IconPalette,
9
+ IconLayoutGrid,
10
+ IconComponents,
11
11
  IconSettings,
12
12
  IconLayoutSidebarLeftCollapse,
13
13
  IconLayoutSidebarLeftExpand,
@@ -23,9 +23,9 @@ import {
23
23
  import { cn } from "@/lib/utils";
24
24
 
25
25
  const navItems = [
26
- { icon: IconStack2, labelKey: "navigation.decks", href: "/" },
26
+ { icon: IconLayoutGrid, labelKey: "navigation.decks", href: "/" },
27
27
  {
28
- icon: IconPalette,
28
+ icon: IconComponents,
29
29
  labelKey: "navigation.designSystems",
30
30
  href: "/design-systems",
31
31
  },
@@ -161,8 +161,8 @@ export function Sidebar({ collapsed, onToggleCollapsed }: SidebarProps) {
161
161
 
162
162
  if (collapsed) {
163
163
  return (
164
- <aside className="flex h-full w-12 shrink-0 flex-col items-center overflow-hidden border-e border-border bg-sidebar text-sidebar-foreground transition-[width] duration-200 ease-out">
165
- <div className="flex h-12 w-full shrink-0 items-center justify-center border-b border-border">
164
+ <aside className="flex h-full w-12 shrink-0 flex-col items-center overflow-hidden bg-sidebar text-sidebar-foreground transition-[width] duration-200 ease-out">
165
+ <div className="flex h-12 w-full shrink-0 items-center justify-center">
166
166
  {brandControl}
167
167
  </div>
168
168
  <nav className="flex min-h-0 flex-1 flex-col items-center gap-1 overflow-y-auto pt-1">
@@ -224,10 +224,8 @@ export function Sidebar({ collapsed, onToggleCollapsed }: SidebarProps) {
224
224
  }
225
225
 
226
226
  return (
227
- <aside className="flex h-full w-56 min-w-0 shrink-0 flex-col overflow-hidden border-e border-border bg-sidebar text-sidebar-foreground transition-[width] duration-200 ease-out">
228
- <div className="flex h-12 shrink-0 items-center border-b border-border px-4">
229
- {brandControl}
230
- </div>
227
+ <aside className="flex h-full w-56 min-w-0 shrink-0 flex-col overflow-hidden bg-sidebar text-sidebar-foreground transition-[width] duration-200 ease-out">
228
+ <div className="flex h-12 shrink-0 items-center px-4">{brandControl}</div>
231
229
 
232
230
  <div className="flex min-h-0 flex-1 flex-col overflow-y-auto">
233
231
  <nav className="space-y-1 px-2 py-2">
@@ -8,6 +8,7 @@ import { callAction } from "@agent-native/core/client/hooks";
8
8
  import { isEmbedAuthActive } from "@agent-native/core/client/host";
9
9
  import { useOrg } from "@agent-native/core/client/org";
10
10
  import { subscribeSyncEvents } from "@agent-native/core/client/use-db-sync";
11
+ import { DEFAULT_DECK_TITLE } from "@shared/deck-title";
11
12
  import { nanoid } from "nanoid";
12
13
  import {
13
14
  createContext,
@@ -1760,7 +1761,7 @@ export function DeckProvider({ children }: { children: ReactNode }) {
1760
1761
  const insertIndex = decksRef.current.length;
1761
1762
  const newDeck: Deck = {
1762
1763
  id: nanoid(10),
1763
- title: title || "Untitled Deck",
1764
+ title: title?.trim() || DEFAULT_DECK_TITLE,
1764
1765
  createdAt: new Date().toISOString(),
1765
1766
  updatedAt: new Date().toISOString(),
1766
1767
  createdByMe: true,
@@ -143,7 +143,7 @@ button[title="Open agent sidebar"] {
143
143
  }
144
144
 
145
145
  .slide-style-inspector .slides-inspector-section {
146
- border-bottom: 1px solid var(--slides-inspector-divider);
146
+ border-bottom: 0;
147
147
  border-radius: 0;
148
148
  padding: 0.625rem 0.75rem;
149
149
  }
@@ -239,6 +239,81 @@ button[title="Open agent sidebar"] {
239
239
  container-type: inline-size;
240
240
  }
241
241
 
242
+ .deck-editor-shell {
243
+ --slides-editor-surface: hsl(var(--background));
244
+ container-type: inline-size;
245
+ container-name: deck-editor;
246
+ }
247
+
248
+ @supports (background: color-mix(in srgb, white, black)) {
249
+ .deck-editor-shell {
250
+ --slides-editor-surface: color-mix(
251
+ in srgb,
252
+ hsl(var(--background)) 35%,
253
+ var(--agent-native-lower-surface, hsl(var(--background))) 65%
254
+ );
255
+ }
256
+ }
257
+
258
+ .deck-editor-context-toolbar-host {
259
+ min-width: 0;
260
+ overflow: hidden;
261
+ }
262
+
263
+ .deck-editor-context-toolbar-host--wide {
264
+ display: none;
265
+ }
266
+
267
+ .deck-editor-context-toolbar-host--narrow {
268
+ display: flex;
269
+ justify-content: flex-end;
270
+ }
271
+
272
+ .deck-editor-context-toolbar-host--narrow
273
+ > [data-slide-inline-edit-surface="true"] {
274
+ min-width: 0;
275
+ width: fit-content;
276
+ max-width: 100%;
277
+ flex: 0 1 auto;
278
+ }
279
+
280
+ @container deck-editor (max-width: 1149px) {
281
+ .deck-editor-context-toolbar-host--wide {
282
+ display: none;
283
+ }
284
+
285
+ .deck-editor-context-toolbar-host--narrow {
286
+ display: flex;
287
+ }
288
+ }
289
+
290
+ @container deck-editor (min-width: 1150px) {
291
+ .deck-editor-context-toolbar-host--narrow {
292
+ display: none;
293
+ }
294
+
295
+ .deck-editor-context-toolbar-host--wide[data-context-toolbar-visible="true"] {
296
+ display: flex;
297
+ flex: 1 1 0%;
298
+ align-items: center;
299
+ justify-content: flex-end;
300
+ }
301
+
302
+ .deck-editor-context-toolbar-host--wide
303
+ > [data-slide-inline-edit-surface="true"] {
304
+ min-width: 0;
305
+ max-width: 100%;
306
+ }
307
+
308
+ .deck-editor-context-toolbar-host--wide .slide-context-toolbar--top-row {
309
+ height: 2.75rem;
310
+ justify-content: flex-end;
311
+ border: 0;
312
+ background: transparent;
313
+ padding-inline: 0;
314
+ }
315
+ }
316
+
242
317
  @container (max-width: 36rem) {
243
318
  .deck-grid {
244
319
  grid-template-columns: minmax(0, 1fr);
@@ -659,6 +659,7 @@ const messages = {
659
659
  deckCount_other: "decks",
660
660
  createDeckOrVisual: "Create a presentation",
661
661
  noMineDecks: "No decks created by you yet.",
662
+ noDecksMatchSearch: "No decks match your search.",
662
663
  deleteDeckTitle: "Delete Deck?",
663
664
  deleteDeckDescription:
664
665
  "This will permanently delete this deck and all its slides. This action cannot be undone.",
@@ -91,6 +91,30 @@ async function loadReferenceDeckGenerationContext(
91
91
  ].join("\n");
92
92
  }
93
93
 
94
+ export function isSourceImprovementRequest(
95
+ prompt: string,
96
+ files: UploadedFile[],
97
+ ): boolean {
98
+ const hasSourceDeck = files.some((file) =>
99
+ /\.(pptx|pdf)$/i.test(file.originalName),
100
+ );
101
+ if (!hasSourceDeck) return false;
102
+
103
+ const normalized = prompt.toLowerCase();
104
+ const asksToImprove =
105
+ /\b(restyl\w*|redesign\w*|rebrand\w*|revamp\w*|rework\w*|moderni[sz]\w*|refresh\w*|polish\w*|improv\w*|updat\w*|revis\w*|edit\w*)\b/.test(
106
+ normalized,
107
+ ) ||
108
+ /\bmake\b[\s\S]{0,40}\b(better|modern|professional|polished|prett\w*)\b/.test(
109
+ normalized,
110
+ );
111
+ // A source deck attachment is the object being improved even when the
112
+ // prompt uses an implicit phrase such as "make this prettier". Requiring a
113
+ // source noun here silently falls back to reference-only generation and can
114
+ // discard the uploaded deck's slide IDs and content.
115
+ return asksToImprove;
116
+ }
117
+
94
118
  function describeUploadedFilesForAgent(
95
119
  files: UploadedFile[],
96
120
  deckId: string,
@@ -103,25 +127,26 @@ function describeUploadedFilesForAgent(
103
127
  `- ${file.originalName} (${file.type}, ${(file.size / 1024).toFixed(1)}KB) at path: ${file.path}${file.url ? `; embeddable URL: ${file.url}` : ""}`,
104
128
  )
105
129
  .join("\n");
106
- const sourceFile = importedSourceDeck?.file;
107
130
  return [
108
131
  "",
109
132
  importedSourceDeck
110
- ? `The user uploaded ${files.length} file(s). The ${sourceFile?.originalName ?? importedSourceDeck.format.toUpperCase()} source deck has already been imported into target deck ${deckId} with ${importedSourceDeck.slideCount} source slide(s); do not import it again.`
111
- : `The user uploaded ${files.length} file(s). These are mandatory source material, not optional references — process every one of them with the matching import action BEFORE adding the first slide:`,
133
+ ? `The user uploaded ${files.length} file(s). The ${importedSourceDeck.file.originalName} source deck has already been imported into target deck ${deckId} with ${importedSourceDeck.slideCount} source slide(s); do not import it again.`
134
+ : `The user attached ${files.length} file(s) as reference material for this new deck. Attachments are context for the agent by default; do not import or append their slides to target deck ${deckId} merely because they were attached.`,
112
135
  fileList,
113
136
  "",
114
137
  "File handling rules:",
115
138
  importedSourceDeck
116
- ? "- The imported source deck is the canonical source. Preserve its slide count, order, IDs, factual copy, notes, imagery, charts, tables, diagrams, and freeform objects while improving styling. For a deck-wide restyle, use one patch-deck call with requireAllSourceSlides=true; use update-slide only for a targeted one-slide edit. Do not rebuild it with add-slide."
117
- : `- PPTX files: call \`import-pptx --filePath \"<path>\" --deckId ${deckId}\` before adding or editing slides.`,
139
+ ? "- The imported source deck is canonical. Preserve its slide count, order, IDs, factual copy, notes, imagery, charts, tables, diagrams, and freeform objects while improving styling. For a deck-wide restyle, use one patch-deck call with requireAllSourceSlides=true; use update-slide only for a targeted one-slide edit. Do not rebuild it with add-slide."
140
+ : `- PDF, PPTX, and DOCX files: call \`import-file --filePath \"<path>\" --format auto\` (without \`importIntoDeck\`) when you need their text or structure. Use the returned material as reference while creating new slides with \`add-slide\`.`,
118
141
  importedSourceDeck
119
142
  ? "- For a PDF source, keep the original full-page image in every slide and add restrained design-system chrome around it without obscuring source content. Never OCR-reconstruct a source-faithful page from extracted text."
120
- : `- PDF and DOCX files: call \`import-file --filePath \"<path>\" --format auto --deckId ${deckId}\` and use the returned extracted text as source material. The returned text is capped for reliability; re-run with maxChars only if more context is needed. For a visual PDF whose original layout should be preserved, pass \`--importIntoDeck true\` instead of rebuilding the pages from extracted text. Do not proceed to add-slide until this call has returned for every PDF/DOCX in the list above.`,
143
+ : "- Do not pass `importIntoDeck: true` for an attached file unless the user explicitly asks to import or preserve the source pages in the current deck. An attached reference is not an instruction to replace or seed the deck.",
121
144
  "- Text-like files: use the uploaded-text-file blocks already included in the prompt; do not call import-file for them.",
122
145
  '- Image files with an embeddable URL are mandatory assets: if the user specified where to use one (e.g. "on the first and last slide"), embed it there with `<img src="...">` exactly as requested. Do not omit a requested image and continue silently — if it truly cannot be placed, say why in your final chat response.',
123
146
  "- Image files without a URL are visual/reference assets only; do not claim to have processed a PPTX/PDF/DOCX unless the relevant import action succeeds.",
124
- "- Before your final response, verify every uploaded file above was either imported (PPTX/PDF/DOCX) or placed as requested (images). If any file's content or requested placement is missing from the deck, say so explicitly instead of reporting success.",
147
+ importedSourceDeck
148
+ ? "- Before your final response, verify the same source slide IDs and count with get-deck after the restyle. If source fidelity is partial or images were skipped, report the exact warning instead of claiming success."
149
+ : "- Before your final response, verify every uploaded file above was either used as reference or placed as explicitly requested. If any file's content or requested placement is missing from the deck, say so explicitly instead of reporting success.",
125
150
  ].join("\n");
126
151
  }
127
152
 
@@ -179,7 +204,7 @@ export interface StartDeckGenerationOptions {
179
204
  files: UploadedFile[],
180
205
  failure: DeckPersistenceResult,
181
206
  ) => void;
182
- onSetupFailure: (
207
+ onSetupFailure?: (
183
208
  prompt: string,
184
209
  files: UploadedFile[],
185
210
  failure: unknown,
@@ -248,15 +273,17 @@ export async function startDeckGeneration({
248
273
  }
249
274
 
250
275
  let importedSourceDeck: ImportedSourceDeck | null = null;
251
- try {
252
- importedSourceDeck = await importUploadedDeckIntoDeck(
253
- filesForGeneration,
254
- deckId,
255
- );
256
- } catch (error) {
257
- deleteDeck(deckId);
258
- onSetupFailure(prompt, filesForGeneration, error);
259
- return "failed";
276
+ if (isSourceImprovementRequest(prompt, filesForGeneration)) {
277
+ try {
278
+ importedSourceDeck = await importUploadedDeckIntoDeck(
279
+ filesForGeneration,
280
+ deckId,
281
+ );
282
+ } catch (error) {
283
+ deleteDeck(deckId);
284
+ onSetupFailure?.(prompt, filesForGeneration, error);
285
+ return "failed";
286
+ }
260
287
  }
261
288
 
262
289
  onPromptClosed();
@@ -324,20 +351,21 @@ export async function startDeckGeneration({
324
351
  "Source-preserving improvement mode:",
325
352
  `- The target deck already contains ${importedSourceDeck.slideCount} imported source slides. Treat those slides as the user's complete source, not as inspiration for a new deck.`,
326
353
  "- Keep the exact source slide count, order, IDs, factual meaning, notes, images, charts, tables, diagrams, and freeform objects unless the user explicitly asks to change one of them.",
327
- "- Read `get-deck` once before editing to obtain every existing slide ID and source HTML, load the linked design system with `get-design-system`, then make a deck-wide restyle with one `patch-deck` call using `requireAllSourceSlides: true` and one `patch-slide` operation with `fields.content` for every source slide ID. Do not split a full-deck restyle into arbitrary batches or fall back to one-by-one `update-slide` calls; use `update-slide` only for a targeted one-slide edit. Keep every original `<img>` source and enough original factual copy for each slide; for PDF slides, use restrained design-system chrome around the page without obscuring it.",
328
- "- Do not call `add-slide`, delete slides, reorder slides, or replace source images with generic cards. Do not claim success until `get-deck` verifies the same slide IDs and count after the edits.",
329
- '- After the patch succeeds, verify with `get-deck` using `compact: "true"` so only slide IDs, count, and previews are returned. Do not report an initial or partial pass, and do not leave any source slides for a later run.',
330
- "- If `get-deck` reports partial source fidelity or skipped images, stop and report the exact warning instead of claiming a reliable restyle.",
354
+ "- Read get-deck once before editing to obtain every existing slide ID and source HTML, load the linked design system with get-design-system, then make a deck-wide restyle with one patch-deck call using requireAllSourceSlides=true and one patch-slide operation with fields.content for every source slide ID. Do not split a full-deck restyle into arbitrary batches or fall back to one-by-one update-slide calls; use update-slide only for a targeted one-slide edit. Keep every original image source and enough original factual copy for each slide; for PDF slides, use restrained design-system chrome around the page without obscuring it.",
355
+ "- Do not call add-slide, delete slides, reorder slides, or replace source images with generic cards. Do not claim success until get-deck verifies the same slide IDs and count after the edits.",
356
+ '- After the patch succeeds, verify with get-deck using compact: "true" so only slide IDs, count, and previews are returned. Do not report an initial or partial pass, and do not leave any source slides for a later run.',
357
+ "- If get-deck reports partial source fidelity or skipped images, stop and report the exact warning instead of claiming a reliable restyle.",
331
358
  ].join("\n")
332
359
  : "";
333
360
  const sourceModeInstructions = importedSourceDeck
334
361
  ? [
335
362
  "The request is an in-place visual improvement of an imported source deck. Make a coherent style pass across every existing slide while preserving all source content and media.",
336
363
  "Do not use the new-deck add-slide workflow for this source-preserving request. Finish every source slide in this run; if patch-deck rejects incomplete coverage, continue with the returned missing IDs instead of reporting success with a partial deck.",
337
- ]
364
+ ].join("\n")
338
365
  : [
366
+ "This is a new deck. Keep it empty until generation begins; attached reference files must not seed it with imported slides.",
339
367
  "Start a `manage-progress` run so progress appears in the app header. Add the first slide as soon as it is ready, then continue one slide at a time so the editor visibly fills in.",
340
- `After reading any requested or imported source material, but before adding the first slide, choose a concise, specific deck title from the user's request and source material. Never use the deck id, run id, file id, or another opaque alphanumeric token as the title. Call \`patch-deck\` with \`deckId: \"${deckId}\"\` and \`operations: [{ \"op\": \"patch-deck-fields\", \"fields\": { \"title\": \"<generated title>\" } }]\`. Include only \`title\` in \`fields\`; omit all other optional fields. Never leave a generated deck named \"Untitled Deck\" or another placeholder.`,
368
+ `After reading any requested or attached reference material, but before adding the first slide, choose a concise, specific deck title from the user's request and source material. Never use the deck id, run id, file id, or another opaque alphanumeric token as the title. Call \`patch-deck\` with \`deckId: \"${deckId}\"\` and \`operations: [{ \"op\": \"patch-deck-fields\", \"fields\": { \"title\": \"<generated title>\" } }]\`. Include only \`title\` in \`fields\`; omit all other optional fields. Never leave a generated deck named \"Untitled Deck\" or another placeholder.`,
341
369
  "If the user asks for a standalone visual, diagram, hero, one-pager, poster, or a couple of visuals, create only the requested one/few polished visual slides. Do not pad the result into a full presentation.",
342
370
  "If the request is for a presentation or deck and does not explicitly ask for one slide, infer a coherent multi-slide outline from the scope and keep adding slides until that outline is complete. Do not stop after the first slide just because the prompt has few explicit instructions.",
343
371
  `Add slides ONE AT A TIME using the \`add-slide\` action with --deckId=${deckId}. Wait for each \`add-slide\` result before calling it again; do not batch or parallelize slide writes.`,
@@ -17,6 +17,27 @@ export interface ResolvedAnimationTarget<
17
17
  key: string;
18
18
  }
19
19
 
20
+ export type AnimationTargetResolutionIssueCode =
21
+ | "missing-target"
22
+ | "duplicate-target";
23
+
24
+ export interface AnimationTargetResolutionIssue<
25
+ T extends AnimationTarget = AnimationTarget,
26
+ > {
27
+ animationIndex: number;
28
+ code: AnimationTargetResolutionIssueCode;
29
+ target: T;
30
+ key?: string;
31
+ preview?: string;
32
+ }
33
+
34
+ export interface AnimationTargetResolution<
35
+ T extends AnimationTarget = AnimationTarget,
36
+ > {
37
+ resolved: ResolvedAnimationTarget<T>[] | null;
38
+ issue: AnimationTargetResolutionIssue<T> | null;
39
+ }
40
+
20
41
  const INLINE_TAGS = new Set([
21
42
  "a",
22
43
  "abbr",
@@ -222,21 +243,63 @@ export function resolveSlideAnimationTargets<T extends AnimationTarget>(
222
243
  root: Element,
223
244
  targets: readonly T[],
224
245
  ): ResolvedAnimationTarget<T>[] | null {
246
+ return resolveSlideAnimationTargetsWithDiagnostics(root, targets).resolved;
247
+ }
248
+
249
+ export function resolveSlideAnimationTargetsWithDiagnostics<
250
+ T extends AnimationTarget,
251
+ >(root: Element, targets: readonly T[]): AnimationTargetResolution<T> {
225
252
  const seen = new Set<string>();
226
253
  const resolved: ResolvedAnimationTarget<T>[] = [];
227
254
 
228
- for (const target of targets) {
255
+ for (const [animationIndex, target] of targets.entries()) {
229
256
  const element = resolveSlideAnimationElement(root, target);
230
- if (!element) return null;
257
+ if (!element) {
258
+ return {
259
+ resolved: null,
260
+ issue: {
261
+ animationIndex,
262
+ code: "missing-target",
263
+ target,
264
+ },
265
+ };
266
+ }
231
267
  const path = getElementPath(root, element);
232
- if (!path) return null;
268
+ if (!path) {
269
+ return {
270
+ resolved: null,
271
+ issue: {
272
+ animationIndex,
273
+ code: "missing-target",
274
+ target,
275
+ preview: getElementPreview(
276
+ element,
277
+ `Element ${target.elementIndex + 1}`,
278
+ ),
279
+ },
280
+ };
281
+ }
233
282
  const key = animationElementKey(path);
234
- if (seen.has(key)) return null;
283
+ if (seen.has(key)) {
284
+ return {
285
+ resolved: null,
286
+ issue: {
287
+ animationIndex,
288
+ code: "duplicate-target",
289
+ target,
290
+ key,
291
+ preview: getElementPreview(
292
+ element,
293
+ `Element ${target.elementIndex + 1}`,
294
+ ),
295
+ },
296
+ };
297
+ }
235
298
  seen.add(key);
236
299
  resolved.push({ target, element, key });
237
300
  }
238
301
 
239
- return resolved;
302
+ return { resolved, issue: null };
240
303
  }
241
304
 
242
305
  export function getSlideAnimationTargetKey(