@agent-native/core 0.149.1 → 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 (422) 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/dashboard-management/SKILL.md +2 -0
  9. package/corpus/templates/analytics/.agents/skills/frontend-design/SKILL.md +4 -5
  10. package/corpus/templates/analytics/.agents/skills/turn-into-app/SKILL.md +18 -31
  11. package/corpus/templates/analytics/AGENTS.md +25 -32
  12. package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +150 -46
  13. package/corpus/templates/analytics/app/global.css +1 -1
  14. package/corpus/templates/analytics/app/i18n-data.ts +37 -0
  15. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/PanelEditorDialog.tsx +1 -1
  16. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +32 -0
  17. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/types.ts +2 -0
  18. package/corpus/templates/analytics/changelog/2026-08-10-dashboard-tables-can-be-copied-and-sorted-by-multiple-column.md +6 -0
  19. package/corpus/templates/analytics/changelog/2026-08-10-full-page-chat-now-uses-the-available-width-up-to-1000px-for.md +6 -0
  20. package/corpus/templates/analytics/changelog/2026-08-11-full-page-chat-composers-stay-at-a-focused-750px-width.md +6 -0
  21. package/corpus/templates/assets/.agents/skills/actions/SKILL.md +54 -488
  22. package/corpus/templates/assets/.agents/skills/actions/references/action-fields.md +136 -0
  23. package/corpus/templates/assets/.agents/skills/actions/references/examples.md +94 -0
  24. package/corpus/templates/assets/.agents/skills/actions/references/provider-apis.md +95 -0
  25. package/corpus/templates/assets/.agents/skills/create-skill/SKILL.md +9 -35
  26. package/corpus/templates/assets/.agents/skills/creative-context/SKILL.md +4 -2
  27. package/corpus/templates/assets/.agents/skills/frontend-design/SKILL.md +4 -5
  28. package/corpus/templates/assets/.agents/skills/turn-into-app/SKILL.md +18 -31
  29. package/corpus/templates/assets/AGENTS.md +6 -9
  30. package/corpus/templates/assets/app/global.css +1 -1
  31. package/corpus/templates/assets/changelog/2026-08-10-full-page-chat-now-uses-the-available-width-up-to-1000px-for.md +6 -0
  32. package/corpus/templates/assets/changelog/2026-08-11-full-page-chat-composers-stay-at-a-focused-750px-width.md +6 -0
  33. package/corpus/templates/brain/.agents/skills/actions/SKILL.md +54 -488
  34. package/corpus/templates/brain/.agents/skills/actions/references/action-fields.md +136 -0
  35. package/corpus/templates/brain/.agents/skills/actions/references/examples.md +94 -0
  36. package/corpus/templates/brain/.agents/skills/actions/references/provider-apis.md +95 -0
  37. package/corpus/templates/brain/.agents/skills/create-skill/SKILL.md +9 -35
  38. package/corpus/templates/brain/.agents/skills/frontend-design/SKILL.md +4 -5
  39. package/corpus/templates/brain/.agents/skills/turn-into-app/SKILL.md +18 -31
  40. package/corpus/templates/brain/AGENTS.md +5 -12
  41. package/corpus/templates/brain/app/global.css +1 -1
  42. package/corpus/templates/brain/changelog/2026-08-10-full-page-chat-now-uses-the-available-width-up-to-1000px-for.md +6 -0
  43. package/corpus/templates/brain/changelog/2026-08-11-full-page-chat-composers-stay-at-a-focused-750px-width.md +6 -0
  44. package/corpus/templates/calendar/.agents/skills/actions/SKILL.md +54 -488
  45. package/corpus/templates/calendar/.agents/skills/actions/references/action-fields.md +136 -0
  46. package/corpus/templates/calendar/.agents/skills/actions/references/examples.md +94 -0
  47. package/corpus/templates/calendar/.agents/skills/actions/references/provider-apis.md +95 -0
  48. package/corpus/templates/calendar/.agents/skills/create-skill/SKILL.md +9 -35
  49. package/corpus/templates/calendar/.agents/skills/frontend-design/SKILL.md +4 -5
  50. package/corpus/templates/calendar/.agents/skills/turn-into-app/SKILL.md +18 -31
  51. package/corpus/templates/calendar/AGENTS.md +8 -9
  52. package/corpus/templates/chat/.agents/skills/actions/SKILL.md +54 -488
  53. package/corpus/templates/chat/.agents/skills/actions/references/action-fields.md +136 -0
  54. package/corpus/templates/chat/.agents/skills/actions/references/examples.md +94 -0
  55. package/corpus/templates/chat/.agents/skills/actions/references/provider-apis.md +95 -0
  56. package/corpus/templates/chat/.agents/skills/create-skill/SKILL.md +9 -35
  57. package/corpus/templates/chat/.agents/skills/frontend-design/SKILL.md +4 -5
  58. package/corpus/templates/chat/.agents/skills/turn-into-app/SKILL.md +18 -31
  59. package/corpus/templates/chat/AGENTS.md +32 -80
  60. package/corpus/templates/chat/changelog/2026-08-10-full-page-chat-now-uses-the-available-width-up-to-1000px-for.md +6 -0
  61. package/corpus/templates/clips/.agents/skills/actions/SKILL.md +54 -488
  62. package/corpus/templates/clips/.agents/skills/actions/references/action-fields.md +136 -0
  63. package/corpus/templates/clips/.agents/skills/actions/references/examples.md +94 -0
  64. package/corpus/templates/clips/.agents/skills/actions/references/provider-apis.md +95 -0
  65. package/corpus/templates/clips/.agents/skills/create-skill/SKILL.md +9 -35
  66. package/corpus/templates/clips/.agents/skills/frontend-design/SKILL.md +4 -5
  67. package/corpus/templates/clips/.agents/skills/turn-into-app/SKILL.md +18 -31
  68. package/corpus/templates/clips/AGENTS.md +25 -31
  69. package/corpus/templates/clips/changelog/2026-08-10-clips-desktop-sign-in-now-starts-with-magic-links-and-google.md +6 -0
  70. package/corpus/templates/clips/chrome-extension/src/overlay.css +1 -0
  71. package/corpus/templates/clips/desktop/src/app.tsx +274 -137
  72. package/corpus/templates/clips/desktop/src/styles.css +35 -0
  73. package/corpus/templates/content/.agents/skills/actions/SKILL.md +54 -488
  74. package/corpus/templates/content/.agents/skills/actions/references/action-fields.md +136 -0
  75. package/corpus/templates/content/.agents/skills/actions/references/examples.md +94 -0
  76. package/corpus/templates/content/.agents/skills/actions/references/provider-apis.md +95 -0
  77. package/corpus/templates/content/.agents/skills/create-skill/SKILL.md +9 -35
  78. package/corpus/templates/content/.agents/skills/creative-context/SKILL.md +4 -2
  79. package/corpus/templates/content/.agents/skills/frontend-design/SKILL.md +4 -5
  80. package/corpus/templates/content/.agents/skills/turn-into-app/SKILL.md +18 -31
  81. package/corpus/templates/content/AGENTS.md +5 -9
  82. package/corpus/templates/content/app/global.css +1 -0
  83. package/corpus/templates/crm/.agents/skills/turn-into-app/SKILL.md +18 -31
  84. package/corpus/templates/crm/AGENTS.md +7 -11
  85. package/corpus/templates/crm/app/global.css +1 -1
  86. package/corpus/templates/crm/changelog/2026-08-10-full-page-chat-now-uses-the-available-width-up-to-1000px-for.md +6 -0
  87. package/corpus/templates/crm/changelog/2026-08-11-full-page-chat-composers-stay-at-a-focused-750px-width.md +6 -0
  88. package/corpus/templates/design/.agents/skills/actions/SKILL.md +54 -488
  89. package/corpus/templates/design/.agents/skills/actions/references/action-fields.md +136 -0
  90. package/corpus/templates/design/.agents/skills/actions/references/examples.md +94 -0
  91. package/corpus/templates/design/.agents/skills/actions/references/provider-apis.md +95 -0
  92. package/corpus/templates/design/.agents/skills/create-skill/SKILL.md +9 -35
  93. package/corpus/templates/design/.agents/skills/creative-context/SKILL.md +4 -2
  94. package/corpus/templates/design/.agents/skills/frontend-design/SKILL.md +4 -5
  95. package/corpus/templates/design/.agents/skills/turn-into-app/SKILL.md +18 -31
  96. package/corpus/templates/design/.generated/bridge/editor-chrome.generated.ts +70 -3
  97. package/corpus/templates/design/AGENTS.md +13 -21
  98. package/corpus/templates/design/app/components/design/DesignCanvas.tsx +12 -0
  99. package/corpus/templates/design/app/components/design/LayersPanel.tsx +19 -2
  100. package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +115 -7
  101. package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +82 -7
  102. package/corpus/templates/design/app/components/design/design-trace.ts +120 -0
  103. package/corpus/templates/design/app/components/design/dnd-debug.ts +2 -1
  104. package/corpus/templates/design/app/components/design/edit-panel/position-layout-properties.tsx +40 -26
  105. package/corpus/templates/design/app/components/design/multi-screen/board-surface-html.ts +4 -1
  106. package/corpus/templates/design/app/components/design/multi-screen/frame-geometry.ts +12 -3
  107. package/corpus/templates/design/app/components/design/multi-screen/screen-content-cache.ts +4 -0
  108. package/corpus/templates/design/app/components/design/multi-screen/types.ts +7 -0
  109. package/corpus/templates/design/app/components/editor/PromptDialog.tsx +3 -2
  110. package/corpus/templates/design/app/components/layout/Sidebar.tsx +2 -2
  111. package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +3 -0
  112. package/corpus/templates/design/app/i18n-data.ts +1 -0
  113. package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +5 -5
  114. package/corpus/templates/design/app/pages/DesignSystems.tsx +3 -2
  115. package/corpus/templates/design/app/pages/design-editor/canvas-primitive-insert.ts +100 -13
  116. package/corpus/templates/design/app/pages/design-editor/cross-screen-text-color.ts +1 -1
  117. package/corpus/templates/design/app/pages/design-editor/data-operations.ts +14 -0
  118. package/corpus/templates/design/changelog/2026-08-10-marquee-selecting-layers-far-down-a-tall-screen-now-selects-.md +6 -0
  119. package/corpus/templates/design/changelog/2026-08-10-the-frame-tool-draws-a-plain-frame-by-default-with-screen-av.md +6 -0
  120. package/corpus/templates/design/e2e/global-setup.ts +27 -32
  121. package/corpus/templates/design/playwright.config.ts +3 -5
  122. package/corpus/templates/design/shared/breakpoint-media.ts +9 -2
  123. package/corpus/templates/dispatch/.agents/skills/actions/SKILL.md +54 -488
  124. package/corpus/templates/dispatch/.agents/skills/actions/references/action-fields.md +136 -0
  125. package/corpus/templates/dispatch/.agents/skills/actions/references/examples.md +94 -0
  126. package/corpus/templates/dispatch/.agents/skills/actions/references/provider-apis.md +95 -0
  127. package/corpus/templates/dispatch/.agents/skills/create-skill/SKILL.md +9 -35
  128. package/corpus/templates/dispatch/.agents/skills/frontend-design/SKILL.md +4 -5
  129. package/corpus/templates/dispatch/.agents/skills/turn-into-app/SKILL.md +18 -31
  130. package/corpus/templates/dispatch/AGENTS.md +9 -16
  131. package/corpus/templates/dispatch/changelog/2026-08-10-full-page-chat-now-uses-the-available-width-up-to-1000px-for.md +6 -0
  132. package/corpus/templates/factory/.agents/skills/actions/SKILL.md +54 -488
  133. package/corpus/templates/factory/.agents/skills/actions/references/action-fields.md +136 -0
  134. package/corpus/templates/factory/.agents/skills/actions/references/examples.md +94 -0
  135. package/corpus/templates/factory/.agents/skills/actions/references/provider-apis.md +95 -0
  136. package/corpus/templates/factory/.agents/skills/create-skill/SKILL.md +9 -35
  137. package/corpus/templates/factory/.agents/skills/frontend-design/SKILL.md +4 -5
  138. package/corpus/templates/factory/.agents/skills/turn-into-app/SKILL.md +18 -31
  139. package/corpus/templates/factory/AGENTS.md +10 -24
  140. package/corpus/templates/factory/changelog/2026-08-10-full-page-chat-now-uses-the-available-width-up-to-1000px-for.md +6 -0
  141. package/corpus/templates/forms/.agents/skills/actions/SKILL.md +54 -488
  142. package/corpus/templates/forms/.agents/skills/actions/references/action-fields.md +136 -0
  143. package/corpus/templates/forms/.agents/skills/actions/references/examples.md +94 -0
  144. package/corpus/templates/forms/.agents/skills/actions/references/provider-apis.md +95 -0
  145. package/corpus/templates/forms/.agents/skills/create-skill/SKILL.md +9 -35
  146. package/corpus/templates/forms/.agents/skills/frontend-design/SKILL.md +4 -5
  147. package/corpus/templates/forms/.agents/skills/turn-into-app/SKILL.md +18 -31
  148. package/corpus/templates/forms/AGENTS.md +11 -17
  149. package/corpus/templates/forms/app/global.css +1 -0
  150. package/corpus/templates/forms/changelog/2026-08-10-full-page-chat-now-uses-the-available-width-up-to-1000px-for.md +6 -0
  151. package/corpus/templates/forms/changelog/2026-08-11-full-page-chat-composers-stay-at-a-focused-750px-width.md +6 -0
  152. package/corpus/templates/macros/.agents/skills/frontend-design/SKILL.md +4 -5
  153. package/corpus/templates/macros/.agents/skills/turn-into-app/SKILL.md +18 -31
  154. package/corpus/templates/macros/AGENTS.md +8 -8
  155. package/corpus/templates/mail/.agents/skills/actions/SKILL.md +54 -488
  156. package/corpus/templates/mail/.agents/skills/actions/references/action-fields.md +136 -0
  157. package/corpus/templates/mail/.agents/skills/actions/references/examples.md +94 -0
  158. package/corpus/templates/mail/.agents/skills/actions/references/provider-apis.md +95 -0
  159. package/corpus/templates/mail/.agents/skills/create-skill/SKILL.md +9 -35
  160. package/corpus/templates/mail/.agents/skills/frontend-design/SKILL.md +4 -5
  161. package/corpus/templates/mail/.agents/skills/turn-into-app/SKILL.md +18 -31
  162. package/corpus/templates/mail/AGENTS.md +5 -6
  163. package/corpus/templates/plan/.agents/skills/actions/SKILL.md +54 -488
  164. package/corpus/templates/plan/.agents/skills/actions/references/action-fields.md +136 -0
  165. package/corpus/templates/plan/.agents/skills/actions/references/examples.md +94 -0
  166. package/corpus/templates/plan/.agents/skills/actions/references/provider-apis.md +95 -0
  167. package/corpus/templates/plan/.agents/skills/create-skill/SKILL.md +9 -35
  168. package/corpus/templates/plan/.agents/skills/frontend-design/SKILL.md +4 -5
  169. package/corpus/templates/plan/.agents/skills/turn-into-app/SKILL.md +18 -31
  170. package/corpus/templates/plan/AGENTS.md +5 -14
  171. package/corpus/templates/plan/app/global.css +1 -0
  172. package/corpus/templates/plan/changelog/2026-08-10-full-page-chat-now-uses-the-available-width-up-to-1000px-for.md +6 -0
  173. package/corpus/templates/plan/changelog/2026-08-11-plan-no-longer-reloads-when-runtime-state-changes.md +6 -0
  174. package/corpus/templates/plan/server/ui-plan-html.ts +4 -1
  175. package/corpus/templates/plan/vite.config.ts +5 -0
  176. package/corpus/templates/slides/.agents/skills/actions/SKILL.md +54 -488
  177. package/corpus/templates/slides/.agents/skills/actions/references/action-fields.md +136 -0
  178. package/corpus/templates/slides/.agents/skills/actions/references/examples.md +94 -0
  179. package/corpus/templates/slides/.agents/skills/actions/references/provider-apis.md +95 -0
  180. package/corpus/templates/slides/.agents/skills/create-deck/SKILL.md +2 -2
  181. package/corpus/templates/slides/.agents/skills/create-skill/SKILL.md +9 -35
  182. package/corpus/templates/slides/.agents/skills/creative-context/SKILL.md +6 -3
  183. package/corpus/templates/slides/.agents/skills/deck-management/SKILL.md +6 -1
  184. package/corpus/templates/slides/.agents/skills/frontend-design/SKILL.md +4 -5
  185. package/corpus/templates/slides/.agents/skills/image-generation-via-a2a/SKILL.md +3 -2
  186. package/corpus/templates/slides/.agents/skills/slide-editing/SKILL.md +3 -0
  187. package/corpus/templates/slides/.agents/skills/slide-images/SKILL.md +3 -3
  188. package/corpus/templates/slides/.agents/skills/turn-into-app/SKILL.md +18 -31
  189. package/corpus/templates/slides/AGENTS.md +33 -35
  190. package/corpus/templates/slides/actions/add-deck.ts +2 -0
  191. package/corpus/templates/slides/actions/add-slide.ts +15 -1
  192. package/corpus/templates/slides/actions/create-deck.ts +18 -6
  193. package/corpus/templates/slides/actions/get-deck-reference-context.ts +2 -2
  194. package/corpus/templates/slides/actions/get-deck.ts +83 -7
  195. package/corpus/templates/slides/actions/import-file.ts +2 -1
  196. package/corpus/templates/slides/actions/patch-deck.ts +165 -9
  197. package/corpus/templates/slides/actions/save-deck.ts +24 -1
  198. package/corpus/templates/slides/actions/update-slide.ts +1 -1
  199. package/corpus/templates/slides/app/components/comments/SlideCommentsPanel.tsx +2 -2
  200. package/corpus/templates/slides/app/components/deck/DeckCard.tsx +1 -23
  201. package/corpus/templates/slides/app/components/design-system/DesignSystemCard.tsx +2 -2
  202. package/corpus/templates/slides/app/components/design-system/DesignSystemSetup.tsx +6 -6
  203. package/corpus/templates/slides/app/components/editor/AnimationsPanel.tsx +3 -3
  204. package/corpus/templates/slides/app/components/editor/DeckEditorSkeleton.tsx +4 -4
  205. package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +1 -1
  206. package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +432 -668
  207. package/corpus/templates/slides/app/components/editor/ExportMenu.tsx +296 -259
  208. package/corpus/templates/slides/app/components/editor/GeneratingSlidePreview.tsx +1 -1
  209. package/corpus/templates/slides/app/components/editor/GoogleDriveConnectionCta.tsx +13 -1
  210. package/corpus/templates/slides/app/components/editor/NewDeckReferenceStep.tsx +56 -174
  211. package/corpus/templates/slides/app/components/editor/PromptDialog.tsx +241 -116
  212. package/corpus/templates/slides/app/components/editor/SlideContextToolbar.tsx +1 -1
  213. package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +42 -14
  214. package/corpus/templates/slides/app/components/editor/SpeakerNotesPanel.tsx +6 -12
  215. package/corpus/templates/slides/app/components/editor/editor-command-model.ts +35 -0
  216. package/corpus/templates/slides/app/components/layout/AgentWorkIndicator.tsx +1 -1
  217. package/corpus/templates/slides/app/components/layout/Layout.tsx +34 -35
  218. package/corpus/templates/slides/app/components/layout/Sidebar.tsx +8 -10
  219. package/corpus/templates/slides/app/components/layout/layout-route-policy.ts +2 -5
  220. package/corpus/templates/slides/app/components/onboarding/FirstDeckOnboardingFlow.tsx +45 -40
  221. package/corpus/templates/slides/app/components/presentation/PresentationView.tsx +63 -16
  222. package/corpus/templates/slides/app/context/DeckContext.tsx +2 -1
  223. package/corpus/templates/slides/app/global.css +76 -1
  224. package/corpus/templates/slides/app/hooks/use-generating-slide-preview.ts +25 -3
  225. package/corpus/templates/slides/app/i18n/en-US.ts +2 -0
  226. package/corpus/templates/slides/app/lib/create-deck-generation.ts +52 -23
  227. package/corpus/templates/slides/app/lib/recent-references.ts +23 -1
  228. package/corpus/templates/slides/app/lib/slide-animation-elements.ts +104 -3
  229. package/corpus/templates/slides/app/pages/DeckEditor.tsx +17 -33
  230. package/corpus/templates/slides/app/pages/DesignSystems.tsx +2 -2
  231. package/corpus/templates/slides/app/pages/Index.tsx +315 -151
  232. package/corpus/templates/slides/app/root.tsx +43 -0
  233. package/corpus/templates/slides/changelog/2026-08-10-ai-editing-avatar-badge.md +6 -0
  234. package/corpus/templates/slides/changelog/2026-08-10-generated-decks-keep-a-clear-human-readable-title.md +6 -0
  235. package/corpus/templates/slides/changelog/2026-08-10-new-deck-creation-now-shows-progress-opens-the-editor-direct.md +6 -0
  236. package/corpus/templates/slides/changelog/2026-08-10-presentation-reveals-now-follow-valid-targets.md +6 -0
  237. package/corpus/templates/slides/changelog/2026-08-10-slides-editing-controls-are-consolidated-into-one-focused-me.md +6 -0
  238. package/corpus/templates/slides/changelog/2026-08-10-slides-now-verify-and-restyle-every-imported-slide-in-one-pa.md +6 -0
  239. package/corpus/templates/slides/changelog/2026-08-10-slides-only-suggests-a-google-connection-for-relevant-reques.md +6 -0
  240. package/corpus/templates/slides/changelog/2026-08-10-the-google-slides-import-option-is-now-labeled-slides.md +6 -0
  241. package/corpus/templates/slides/changelog/2026-08-11-faster-slides-chat-deck-reads.md +6 -0
  242. package/corpus/templates/slides/changelog/2026-08-11-slides-chat-can-read-one-slide-without-loading-the-full-deck.md +6 -0
  243. package/corpus/templates/slides/changelog/2026-08-11-slides-clearly-indicate-when-an-ai-agent-is-editing-alongsid.md +6 -0
  244. package/corpus/templates/slides/package.json +1 -0
  245. package/corpus/templates/slides/server/lib/chat-attachments.ts +1 -1
  246. package/corpus/templates/slides/server/lib/validate-slide-animations.ts +163 -0
  247. package/corpus/templates/slides/server/plugins/agent-chat.ts +8 -5
  248. package/corpus/templates/slides/shared/api.ts +47 -15
  249. package/corpus/templates/slides/shared/deck-title.ts +135 -0
  250. package/corpus/templates/tasks/.agents/skills/actions/SKILL.md +54 -488
  251. package/corpus/templates/tasks/.agents/skills/actions/references/action-fields.md +136 -0
  252. package/corpus/templates/tasks/.agents/skills/actions/references/examples.md +94 -0
  253. package/corpus/templates/tasks/.agents/skills/actions/references/provider-apis.md +95 -0
  254. package/corpus/templates/tasks/.agents/skills/agent-watchdog/SKILL.md +1 -0
  255. package/corpus/templates/tasks/.agents/skills/create-skill/SKILL.md +9 -35
  256. package/corpus/templates/tasks/.agents/skills/efficient-fable/SKILL.md +1 -0
  257. package/corpus/templates/tasks/.agents/skills/efficient-frontier/SKILL.md +1 -0
  258. package/corpus/templates/tasks/.agents/skills/frontend-design/SKILL.md +4 -5
  259. package/corpus/templates/tasks/.agents/skills/plan-arbiter/SKILL.md +1 -0
  260. package/corpus/templates/tasks/.agents/skills/plow-ahead/SKILL.md +1 -0
  261. package/corpus/templates/tasks/.agents/skills/quick-recap/SKILL.md +1 -0
  262. package/corpus/templates/tasks/.agents/skills/read-the-damn-docs/SKILL.md +1 -0
  263. package/corpus/templates/tasks/.agents/skills/stay-within-limits/SKILL.md +1 -0
  264. package/corpus/templates/tasks/.agents/skills/turn-into-app/SKILL.md +18 -31
  265. package/corpus/templates/tasks/AGENTS.md +5 -20
  266. package/corpus/templates/tasks/app/components/tasks/TaskListRow.tsx +4 -1
  267. package/dist/agent/engine/ai-sdk-engine.js +1 -1
  268. package/dist/agent/production-agent.d.ts +21 -1
  269. package/dist/agent/production-agent.js +505 -355
  270. package/dist/agent/run-manager.js +156 -14
  271. package/dist/agent/run-store.d.ts +11 -10
  272. package/dist/agent/run-store.js +17 -13
  273. package/dist/agent/tool-approval-store.d.ts +18 -0
  274. package/dist/agent/tool-approval-store.js +122 -0
  275. package/dist/agent/types.d.ts +1 -1
  276. package/dist/cli/code-agent-executor.js +11 -2
  277. package/dist/client/AgentPanel.js +31 -6
  278. package/dist/client/AssistantChat.d.ts +9 -4
  279. package/dist/client/AssistantChat.js +221 -149
  280. package/dist/client/active-run-state.d.ts +9 -1
  281. package/dist/client/active-run-state.js +34 -3
  282. package/dist/client/agent-chat/index.d.ts +1 -1
  283. package/dist/client/agent-chat-adapter.d.ts +8 -0
  284. package/dist/client/agent-chat-adapter.js +125 -28
  285. package/dist/client/agent-chat.d.ts +1 -1
  286. package/dist/client/chat/markdown-renderer.js +14 -2
  287. package/dist/client/chat/message-components.d.ts +13 -3
  288. package/dist/client/chat/message-components.js +57 -52
  289. package/dist/client/chat/run-recovery.d.ts +1 -0
  290. package/dist/client/chat/run-recovery.js +8 -0
  291. package/dist/client/chat/tool-call-display.d.ts +5 -5
  292. package/dist/client/chat/tool-call-display.js +9 -212
  293. package/dist/client/chat-first/apps-rail.js +3 -3
  294. package/dist/client/chat-first/browser-pane.js +4 -1
  295. package/dist/client/chat-first/chat-history.d.ts +3 -1
  296. package/dist/client/chat-first/chat-history.js +7 -4
  297. package/dist/client/chat-first/surface-tabs.d.ts +1 -1
  298. package/dist/client/chat-first/surface-tabs.js +52 -41
  299. package/dist/client/chat-first/types.d.ts +3 -0
  300. package/dist/client/chat-first.d.ts +10 -0
  301. package/dist/client/chat-first.js +37 -2
  302. package/dist/client/components/ui/message-scroller.js +4 -1
  303. package/dist/client/i18n.js +3 -1
  304. package/dist/client/resources/McpConnectionSuggestion.js +9 -1
  305. package/dist/client/sse-event-processor.d.ts +4 -2
  306. package/dist/client/sse-event-processor.js +46 -6
  307. package/dist/client/use-chat-models.js +156 -80
  308. package/dist/client/use-run-stuck-detection.d.ts +2 -0
  309. package/dist/client/use-run-stuck-detection.js +85 -9
  310. package/dist/collab/awareness.d.ts +2 -2
  311. package/dist/collab/routes.d.ts +1 -1
  312. package/dist/collab/struct-routes.d.ts +1 -1
  313. package/dist/integrations/adapters/slack.d.ts +0 -4
  314. package/dist/integrations/adapters/slack.js +6 -30
  315. package/dist/integrations/catalog.js +1 -1
  316. package/dist/integrations/pending-tasks-store.d.ts +0 -8
  317. package/dist/integrations/pending-tasks-store.js +0 -21
  318. package/dist/integrations/slack-manifest.d.ts +2 -2
  319. package/dist/integrations/slack-manifest.js +0 -3
  320. package/dist/integrations/webhook-handler.js +1 -1
  321. package/dist/mcp/screen-memory-stdio.d.ts +7 -7
  322. package/dist/observability/routes.d.ts +3 -3
  323. package/dist/provider-api/actions/custom-provider-registration.d.ts +4 -4
  324. package/dist/provider-api/actions/provider-api.d.ts +8 -8
  325. package/dist/scripts/docs/source-search.js +2 -2
  326. package/dist/server/agent-chat/framework-prompts.js +7 -2
  327. package/dist/server/agent-chat/prompt-resources.js +2 -2
  328. package/dist/server/agent-chat/skill-frontmatter.d.ts +31 -2
  329. package/dist/server/agent-chat/skill-frontmatter.js +41 -15
  330. package/dist/server/agent-chat-plugin.js +3 -3
  331. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  332. package/dist/server/agents-bundle.d.ts +16 -19
  333. package/dist/server/agents-bundle.js +19 -35
  334. package/dist/server/auth.js +262 -31
  335. package/dist/server/better-auth-instance.d.ts +1 -0
  336. package/dist/server/better-auth-instance.js +17 -2
  337. package/dist/server/onboarding-html.js +56 -9
  338. package/dist/server/prompts/framework-core-compact.d.ts +6 -1
  339. package/dist/server/prompts/framework-core-compact.js +12 -9
  340. package/dist/server/prompts/framework-core.d.ts +6 -1
  341. package/dist/server/prompts/framework-core.js +11 -9
  342. package/dist/server/prompts/index.d.ts +1 -1
  343. package/dist/server/prompts/index.js +1 -1
  344. package/dist/server/prompts/shared-rules.d.ts +15 -11
  345. package/dist/server/prompts/shared-rules.js +17 -13
  346. package/dist/server/realtime-token.d.ts +1 -1
  347. package/dist/server/transcribe-voice.d.ts +1 -1
  348. package/dist/shared/reasoning-effort.d.ts +8 -8
  349. package/dist/shared/reasoning-effort.js +10 -10
  350. package/dist/shared/streaming-text-smoothing.js +41 -11
  351. package/dist/styles/agent-native.css +19 -32
  352. package/dist/templates/chat/.agents/skills/actions/SKILL.md +54 -488
  353. package/dist/templates/chat/.agents/skills/actions/references/action-fields.md +136 -0
  354. package/dist/templates/chat/.agents/skills/actions/references/examples.md +94 -0
  355. package/dist/templates/chat/.agents/skills/actions/references/provider-apis.md +95 -0
  356. package/dist/templates/chat/.agents/skills/create-skill/SKILL.md +9 -35
  357. package/dist/templates/chat/.agents/skills/frontend-design/SKILL.md +4 -5
  358. package/dist/templates/chat/.agents/skills/turn-into-app/SKILL.md +18 -31
  359. package/dist/templates/chat/AGENTS.md +32 -80
  360. package/dist/templates/chat/changelog/2026-08-10-full-page-chat-now-uses-the-available-width-up-to-1000px-for.md +6 -0
  361. package/dist/templates/default/.agents/skills/actions/SKILL.md +54 -488
  362. package/dist/templates/default/.agents/skills/actions/references/action-fields.md +136 -0
  363. package/dist/templates/default/.agents/skills/actions/references/examples.md +94 -0
  364. package/dist/templates/default/.agents/skills/actions/references/provider-apis.md +95 -0
  365. package/dist/templates/default/.agents/skills/create-skill/SKILL.md +9 -35
  366. package/dist/templates/default/.agents/skills/frontend-design/SKILL.md +4 -5
  367. package/dist/templates/default/.agents/skills/turn-into-app/SKILL.md +18 -31
  368. package/dist/templates/headless/.agents/skills/actions/SKILL.md +54 -488
  369. package/dist/templates/headless/.agents/skills/actions/references/action-fields.md +136 -0
  370. package/dist/templates/headless/.agents/skills/actions/references/examples.md +94 -0
  371. package/dist/templates/headless/.agents/skills/actions/references/provider-apis.md +95 -0
  372. package/dist/templates/headless/.agents/skills/turn-into-app/SKILL.md +18 -31
  373. package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +54 -488
  374. package/dist/templates/workspace-core/.agents/skills/actions/references/action-fields.md +136 -0
  375. package/dist/templates/workspace-core/.agents/skills/actions/references/examples.md +94 -0
  376. package/dist/templates/workspace-core/.agents/skills/actions/references/provider-apis.md +95 -0
  377. package/dist/templates/workspace-core/.agents/skills/adding-workspace-apps/SKILL.md +1 -0
  378. package/dist/templates/workspace-core/.agents/skills/agent-page/SKILL.md +1 -0
  379. package/dist/templates/workspace-core/.agents/skills/create-skill/SKILL.md +9 -35
  380. package/dist/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +4 -5
  381. package/dist/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +21 -29
  382. package/dist/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +18 -31
  383. package/dist/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +7 -17
  384. package/dist/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +3 -3
  385. package/dist/templates/workspace-core/AGENTS.md +7 -16
  386. package/docs/content/messaging.mdx +6 -7
  387. package/docs/content/template-chat.mdx +1 -1
  388. package/package.json +2 -2
  389. package/src/templates/chat/.agents/skills/actions/SKILL.md +54 -488
  390. package/src/templates/chat/.agents/skills/actions/references/action-fields.md +136 -0
  391. package/src/templates/chat/.agents/skills/actions/references/examples.md +94 -0
  392. package/src/templates/chat/.agents/skills/actions/references/provider-apis.md +95 -0
  393. package/src/templates/chat/.agents/skills/create-skill/SKILL.md +9 -35
  394. package/src/templates/chat/.agents/skills/frontend-design/SKILL.md +4 -5
  395. package/src/templates/chat/.agents/skills/turn-into-app/SKILL.md +18 -31
  396. package/src/templates/chat/AGENTS.md +32 -80
  397. package/src/templates/chat/changelog/2026-08-10-full-page-chat-now-uses-the-available-width-up-to-1000px-for.md +6 -0
  398. package/src/templates/default/.agents/skills/actions/SKILL.md +54 -488
  399. package/src/templates/default/.agents/skills/actions/references/action-fields.md +136 -0
  400. package/src/templates/default/.agents/skills/actions/references/examples.md +94 -0
  401. package/src/templates/default/.agents/skills/actions/references/provider-apis.md +95 -0
  402. package/src/templates/default/.agents/skills/create-skill/SKILL.md +9 -35
  403. package/src/templates/default/.agents/skills/frontend-design/SKILL.md +4 -5
  404. package/src/templates/default/.agents/skills/turn-into-app/SKILL.md +18 -31
  405. package/src/templates/headless/.agents/skills/actions/SKILL.md +54 -488
  406. package/src/templates/headless/.agents/skills/actions/references/action-fields.md +136 -0
  407. package/src/templates/headless/.agents/skills/actions/references/examples.md +94 -0
  408. package/src/templates/headless/.agents/skills/actions/references/provider-apis.md +95 -0
  409. package/src/templates/headless/.agents/skills/turn-into-app/SKILL.md +18 -31
  410. package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +54 -488
  411. package/src/templates/workspace-core/.agents/skills/actions/references/action-fields.md +136 -0
  412. package/src/templates/workspace-core/.agents/skills/actions/references/examples.md +94 -0
  413. package/src/templates/workspace-core/.agents/skills/actions/references/provider-apis.md +95 -0
  414. package/src/templates/workspace-core/.agents/skills/adding-workspace-apps/SKILL.md +1 -0
  415. package/src/templates/workspace-core/.agents/skills/agent-page/SKILL.md +1 -0
  416. package/src/templates/workspace-core/.agents/skills/create-skill/SKILL.md +9 -35
  417. package/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +4 -5
  418. package/src/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +21 -29
  419. package/src/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +18 -31
  420. package/src/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +7 -17
  421. package/src/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +3 -3
  422. package/src/templates/workspace-core/AGENTS.md +7 -16
@@ -15,6 +15,7 @@ import {
15
15
  IconAlertTriangle,
16
16
  IconPlus,
17
17
  IconRefresh,
18
+ IconSearch,
18
19
  IconStack2,
19
20
  IconUserCircle,
20
21
  } from "@tabler/icons-react";
@@ -33,6 +34,7 @@ import {
33
34
  } from "@/components/editor/NewDeckReferenceStep";
34
35
  import PromptPopover, {
35
36
  uploadPromptFiles,
37
+ type PromptImportSelection,
36
38
  type UploadedFile,
37
39
  } from "@/components/editor/PromptDialog";
38
40
  import {
@@ -46,6 +48,7 @@ import {
46
48
  AlertDialogTitle,
47
49
  } from "@/components/ui/alert-dialog";
48
50
  import { Button } from "@/components/ui/button";
51
+ import { Input } from "@/components/ui/input";
49
52
  import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
50
53
  import {
51
54
  describeDeckPersistenceFailure,
@@ -57,6 +60,7 @@ import { useDesignSystems } from "@/hooks/use-design-systems";
57
60
  import { useWorkspaceDefaults } from "@/hooks/use-workspace-defaults";
58
61
  import { createDeckAgentMessage } from "@/lib/agent-visible-message";
59
62
  import { savePromptToComposerDraft } from "@/lib/composer-draft";
63
+ import { isSourceImprovementRequest } from "@/lib/create-deck-generation";
60
64
  import { sortDecksByRecency } from "@/lib/deck-sorting";
61
65
  import {
62
66
  IMPORT_ACTION_TIMEOUT_MS,
@@ -64,6 +68,7 @@ import {
64
68
  type ImportedSourceDeck,
65
69
  } from "@/lib/import-uploaded-deck";
66
70
  import {
71
+ forgetRecentReference,
67
72
  readRecentReferences,
68
73
  rememberRecentReference,
69
74
  type RecentReference,
@@ -206,20 +211,22 @@ function describeUploadedFilesForAgent(
206
211
  "",
207
212
  importedSourceDeck
208
213
  ? `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.`
209
- : `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:`,
214
+ : `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.`,
210
215
  fileList,
211
216
  "",
212
217
  "File handling rules:",
213
218
  importedSourceDeck
214
- ? "- 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. Use update-slide on existing slide IDs; do not rebuild it with add-slide."
215
- : `- PPTX files: call \`import-pptx --filePath "<path>" --deckId ${deckId}\` before adding or editing slides.`,
219
+ ? "- 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."
220
+ : `- 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\`.`,
216
221
  importedSourceDeck
217
222
  ? "- 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."
218
- : `- 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.`,
223
+ : "- 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.",
219
224
  "- Text-like files: use the uploaded-text-file blocks already included in the prompt; do not call import-file for them.",
220
225
  '- 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.',
221
226
  "- 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.",
222
- "- 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.",
227
+ importedSourceDeck
228
+ ? "- 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."
229
+ : "- 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.",
223
230
  ].join("\n");
224
231
  }
225
232
 
@@ -236,7 +243,7 @@ export default function Index() {
236
243
  loadError,
237
244
  reloadDecks,
238
245
  } = useDecks();
239
- const { designSystems, defaultSystem } = useDesignSystems();
246
+ const { designSystems } = useDesignSystems();
240
247
  const {
241
248
  referenceDeck: workspaceReferenceDeck,
242
249
  designSystem: workspaceDesignSystem,
@@ -276,6 +283,7 @@ export default function Index() {
276
283
  const [selectedReferenceDeckId, setSelectedReferenceDeckId] = useState<
277
284
  string | null
278
285
  >(null);
286
+ const [deckSearch, setDeckSearch] = useState("");
279
287
  // True while the picker still reflects an auto-applied default rather than
280
288
  // an explicit user choice. `useWorkspaceDefaults()`/`useDesignSystems()`
281
289
  // resolve asynchronously, so the initial value set on dialog open can be a
@@ -290,40 +298,39 @@ export default function Index() {
290
298
  const anchorRef = useRef<HTMLElement | null>(null);
291
299
  // Keep anchorRef.current in sync so PromptPopover can read it
292
300
  anchorRef.current = anchorElRef.current;
293
- const designSystemTitleById = useMemo<Map<string, string>>(
294
- () => new Map(designSystems.map((ds) => [ds.id, ds.title])),
295
- [designSystems],
296
- );
297
- // A workspace default the caller cannot open is reported by the action as
298
- // `unavailable` rather than absent; preselecting it would send every new
299
- // prompt at a deck that 404s, so fall back to no reference instead.
300
- const workspaceReferenceDeckId =
301
- workspaceReferenceDeck && !workspaceReferenceDeck.unavailable
302
- ? workspaceReferenceDeck.id
303
- : null;
304
301
  const workspaceDesignSystemId =
305
302
  workspaceDesignSystem && !workspaceDesignSystem.unavailable
306
303
  ? workspaceDesignSystem.id
307
304
  : null;
308
- // Same precedence the server uses in `create-deck`: an explicit personal
309
- // default, then the workspace default, then whatever exists. `defaultSystem`
310
- // already collapses the first and last of those, so match it deliberately.
311
- const personalDefaultDesignSystemId =
312
- designSystems.find((ds) => ds.isDefault)?.id ?? null;
305
+ const lastUsedDesignSystemId =
306
+ recentReferences.find(
307
+ (reference) =>
308
+ reference.kind === "design-system" &&
309
+ designSystems.some((designSystem) => designSystem.id === reference.id),
310
+ )?.id ?? null;
311
+ const lastUsedReferenceDeckId =
312
+ recentReferences.find(
313
+ (reference) =>
314
+ reference.kind === "deck" &&
315
+ decks.some((deck) => deck.id === reference.id),
316
+ )?.id ?? null;
313
317
  const initialDesignSystemId =
314
- personalDefaultDesignSystemId ??
315
- workspaceDesignSystemId ??
316
- defaultSystem?.id ??
317
- null;
318
+ lastUsedDesignSystemId ?? workspaceDesignSystemId;
319
+ const initialReferenceDeckId = lastUsedReferenceDeckId;
318
320
  const deckFilter = searchParams.get("createdBy") === "me" ? "mine" : "all";
321
+ const normalizedDeckSearch = deckSearch.trim().toLowerCase();
319
322
  const visibleDecks = useMemo(
320
323
  () =>
321
324
  sortDecksByRecency(
322
- deckFilter === "mine"
323
- ? decks.filter((deck) => deck.createdByMe)
324
- : decks,
325
+ decks.filter((deck) => {
326
+ if (deckFilter === "mine" && !deck.createdByMe) return false;
327
+ return (
328
+ normalizedDeckSearch.length === 0 ||
329
+ deck.title.toLowerCase().includes(normalizedDeckSearch)
330
+ );
331
+ }),
325
332
  ),
326
- [deckFilter, decks],
333
+ [deckFilter, decks, normalizedDeckSearch],
327
334
  );
328
335
  const rememberReference = useCallback(
329
336
  (reference: Parameters<typeof rememberRecentReference>[0]) => {
@@ -332,24 +339,16 @@ export default function Index() {
332
339
  },
333
340
  [],
334
341
  );
342
+ const forgetReference = useCallback((kind: RecentReference["kind"]) => {
343
+ const result = forgetRecentReference(kind);
344
+ if (result.readable) setRecentReferences(result.items);
345
+ }, []);
335
346
 
336
347
  useEffect(() => {
337
348
  const result = readRecentReferences();
338
349
  if (result.readable) setRecentReferences(result.items);
339
350
  }, []);
340
351
 
341
- useEffect(() => {
342
- if (initialDesignSystemId) {
343
- rememberReference({
344
- id: initialDesignSystemId,
345
- kind: "design-system",
346
- });
347
- }
348
- if (workspaceReferenceDeckId) {
349
- rememberReference({ id: workspaceReferenceDeckId, kind: "deck" });
350
- }
351
- }, [initialDesignSystemId, rememberReference, workspaceReferenceDeckId]);
352
-
353
352
  const initialPrompt = searchParams.get("initialPrompt")?.trim() ?? "";
354
353
  const onboardingPreview = searchParams.get("onboarding") === "preview";
355
354
  const openInitialPrompt = useCallback(() => {
@@ -430,10 +429,10 @@ export default function Index() {
430
429
  designSystemAutoRef.current = true;
431
430
  referenceDeckAutoRef.current = true;
432
431
  setSelectedDesignSystemId(initialDesignSystemId ?? null);
433
- setSelectedReferenceDeckId(workspaceReferenceDeckId ?? null);
432
+ setSelectedReferenceDeckId(initialReferenceDeckId ?? null);
434
433
  setShowNewDeckPrompt(true);
435
434
  },
436
- [initialDesignSystemId, workspaceReferenceDeckId],
435
+ [initialDesignSystemId, initialReferenceDeckId],
437
436
  );
438
437
 
439
438
  const setNewDeckPromptOpen = useCallback(
@@ -486,13 +485,13 @@ export default function Index() {
486
485
  }
487
486
  }, [initialDesignSystemId, designSystems.length, showNewDeckPrompt]);
488
487
 
489
- // Same as above for the reference-deck picker: `workspaceReferenceDeckId`
488
+ // Same as above for the reference-deck picker: the local last-used reference
490
489
  // can still be loading when the dialog opens, so re-apply it once it
491
490
  // resolves unless the user already picked a reference deck.
492
491
  useEffect(() => {
493
492
  if (!showNewDeckPrompt || !referenceDeckAutoRef.current) return;
494
- setSelectedReferenceDeckId(workspaceReferenceDeckId ?? null);
495
- }, [workspaceReferenceDeckId, showNewDeckPrompt]);
493
+ setSelectedReferenceDeckId(initialReferenceDeckId ?? null);
494
+ }, [initialReferenceDeckId, showNewDeckPrompt]);
496
495
 
497
496
  // Restore a prompt that was held back when the user wasn't signed in:
498
497
  // we wrote the text to sessionStorage before redirecting to sign-in,
@@ -516,9 +515,9 @@ export default function Index() {
516
515
  designSystemAutoRef.current = true;
517
516
  referenceDeckAutoRef.current = true;
518
517
  setSelectedDesignSystemId(initialDesignSystemId ?? null);
519
- setSelectedReferenceDeckId(workspaceReferenceDeckId ?? null);
518
+ setSelectedReferenceDeckId(initialReferenceDeckId ?? null);
520
519
  setShowNewDeckPrompt(true);
521
- }, [initialDesignSystemId, workspaceReferenceDeckId, session]);
520
+ }, [initialDesignSystemId, initialReferenceDeckId, session]);
522
521
 
523
522
  // Recovering from a failed deck-generation kickoff (see
524
523
  // recoverFromGenerationSetupFailure below) navigates back to this route
@@ -598,50 +597,67 @@ export default function Index() {
598
597
  const deckId = deck.id;
599
598
  setNewDeckPromptOpen(false);
600
599
 
601
- const persisted = await ensureDeckPersisted(deck.id);
602
- if (!persisted.persisted) {
600
+ // Leave the grid as soon as the optimistic deck exists. Persistence and
601
+ // agent context hydration can take several seconds, so the editor's
602
+ // generation state is the only useful surface while that work finishes.
603
+ navigate(`/deck/${deck.id}?generating=1`, {
604
+ replace: true,
605
+ flushSync: true,
606
+ });
607
+
608
+ const recoverFromGenerationSetupFailure = (description: string) => {
603
609
  if (!savePromptForRetry(prompt)) {
604
610
  setNewDeckInitialPrompt({ text: prompt, key: Date.now() });
605
611
  }
606
612
  setNewDeckRetryFiles(filesForGeneration);
607
613
  deleteDeck(deckId);
608
- toast.error(t("home.generationStartFailed"), {
609
- description: describeDeckPersistenceFailure(
614
+ toast.error(t("home.generationStartFailed"), { description });
615
+ if (
616
+ typeof window !== "undefined" &&
617
+ deckIdFromPathname(window.location.pathname) === deckId
618
+ ) {
619
+ navigate("/", {
620
+ replace: true,
621
+ state: {
622
+ retryPrompt: prompt,
623
+ retryFiles: filesForGeneration,
624
+ } satisfies DeckGenerationRetryState,
625
+ flushSync: true,
626
+ });
627
+ }
628
+ };
629
+
630
+ const persisted = await ensureDeckPersisted(deck.id);
631
+ if (!persisted.persisted) {
632
+ recoverFromGenerationSetupFailure(
633
+ describeDeckPersistenceFailure(
610
634
  persisted,
611
635
  t("home.generationStartFailedDescription"),
612
636
  ),
613
- });
614
- setShowNewDeckPrompt(true);
637
+ );
615
638
  return;
616
639
  }
617
640
 
618
641
  let importedSourceDeck: ImportedSourceDeck | null = null;
619
- try {
620
- importedSourceDeck = await importUploadedDeckIntoDeck(
621
- filesForGeneration,
622
- deckId,
623
- );
624
- } catch (error) {
625
- if (!savePromptForRetry(prompt)) {
626
- setNewDeckInitialPrompt({ text: prompt, key: Date.now() });
627
- }
628
- setNewDeckRetryFiles(filesForGeneration);
629
- deleteDeck(deckId);
630
- toast.error(t("home.generationStartFailed"), {
631
- description:
642
+ if (isSourceImprovementRequest(prompt, filesForGeneration)) {
643
+ try {
644
+ importedSourceDeck = await importUploadedDeckIntoDeck(
645
+ filesForGeneration,
646
+ deckId,
647
+ );
648
+ } catch (error) {
649
+ recoverFromGenerationSetupFailure(
632
650
  error instanceof Error
633
651
  ? error.message
634
652
  : t("home.generationStartFailedDescription"),
635
- });
636
- setShowNewDeckPrompt(true);
637
- return;
653
+ );
654
+ return;
655
+ }
638
656
  }
639
657
 
640
658
  clearPendingPromptForRetry();
641
659
  setNewDeckInitialPrompt(null);
642
660
  setNewDeckRetryFiles([]);
643
- navigate(`/deck/${deck.id}`, { flushSync: true });
644
-
645
661
  const trimmedPrompt = prompt.trim();
646
662
  const hasImportedGoogleDocContext = trimmedPrompt.includes("<google-doc ");
647
663
  const googleDocUrls = hasImportedGoogleDocContext
@@ -662,11 +678,11 @@ export default function Index() {
662
678
  "If the action cannot read a private document, tell the user the exact sharing step from the action error instead of generating from the URL alone.",
663
679
  ].join("\n")
664
680
  : "";
665
- const referenceDeckContext =
666
- await loadReferenceDeckGenerationContext(referenceDeckId);
667
- const hydratedDesignSystemContext = await loadDesignSystemGenerationContext(
668
- selectedDesignSystem?.id,
669
- );
681
+ const [referenceDeckContext, hydratedDesignSystemContext] =
682
+ await Promise.all([
683
+ loadReferenceDeckGenerationContext(referenceDeckId),
684
+ loadDesignSystemGenerationContext(selectedDesignSystem?.id),
685
+ ]);
670
686
  const designSystemContext = selectedDesignSystem
671
687
  ? [
672
688
  "",
@@ -703,19 +719,21 @@ export default function Index() {
703
719
  "Source-preserving improvement mode:",
704
720
  `- 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.`,
705
721
  "- 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.",
706
- "- Read `get-deck` before editing, load the linked design system with `get-design-system`, then use one `update-slide` call per existing slide ID for bounded visual improvements. 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.",
707
- "- 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.",
708
- "- If `get-deck` reports partial source fidelity or skipped images, stop and report the exact warning instead of claiming a reliable restyle.",
722
+ "- 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.",
723
+ "- 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.",
724
+ '- 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.',
725
+ "- If get-deck reports partial source fidelity or skipped images, stop and report the exact warning instead of claiming a reliable restyle.",
709
726
  ].join("\n")
710
727
  : "";
711
728
  const sourceModeInstructions = importedSourceDeck
712
729
  ? [
713
730
  "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.",
714
- "Do not use the new-deck add-slide workflow for this source-preserving request.",
731
+ "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.",
715
732
  ].join("\n")
716
733
  : [
734
+ "This is a new deck. Keep it empty until generation begins; attached reference files must not seed it with imported slides.",
717
735
  "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.",
718
- "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. Call `patch-deck` with `deckId: \"" +
736
+ "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: \"" +
719
737
  deckId +
720
738
  '\"` 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.',
721
739
  "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.",
@@ -754,10 +772,6 @@ export default function Index() {
754
772
  ).catch(() => {});
755
773
  deleteClientAppState("guided-questions").catch(() => {});
756
774
 
757
- navigate(`/deck/${deck.id}?generating=1`, {
758
- replace: true,
759
- flushSync: true,
760
- });
761
775
  agentSubmit(createDeckAgentMessage(trimmedPrompt), context, {
762
776
  newTab: true,
763
777
  reuseEmptyTab: true,
@@ -774,18 +788,150 @@ export default function Index() {
774
788
  [setNewDeckPromptOpen],
775
789
  );
776
790
 
791
+ const handlePromptSkip = useCallback(() => {
792
+ setNewDeckPromptOpen(false, { clearInitialPrompt: false });
793
+ setPendingDeck({ prompt: "", files: [] });
794
+ setShowNewDeckReferenceStep(true);
795
+ }, [setNewDeckPromptOpen]);
796
+
797
+ const handleDirectImport = useCallback(
798
+ async (selection: PromptImportSelection): Promise<boolean> => {
799
+ if (!session) {
800
+ setSignInPromptHadFiles(selection.kind !== "google-slides");
801
+ setShowSignInDialog(true);
802
+ return false;
803
+ }
804
+
805
+ if (selection.kind === "google-slides") {
806
+ const imported = (await callAction("import-google-slides-reference", {
807
+ presentationUrl: selection.url,
808
+ })) as {
809
+ id?: unknown;
810
+ imported?: unknown;
811
+ slideCount?: unknown;
812
+ };
813
+ if (
814
+ typeof imported.id !== "string" ||
815
+ !imported.id ||
816
+ imported.imported !== true ||
817
+ typeof imported.slideCount !== "number" ||
818
+ imported.slideCount < 1
819
+ ) {
820
+ throw new Error(
821
+ "The Google Slides presentation did not create a deck.",
822
+ );
823
+ }
824
+ await reloadDecks();
825
+ navigate(`/deck/${imported.id}`, { flushSync: true });
826
+ return true;
827
+ }
828
+
829
+ const uploaded = await uploadPromptFiles(selection.files);
830
+ const file = uploaded[0];
831
+ if (!file) throw new Error("The selected file could not be uploaded.");
832
+
833
+ if (selection.kind === "pptx") {
834
+ const imported = (await callAction("import-pptx", {
835
+ filePath: file.path,
836
+ designSystemId: initialDesignSystemId,
837
+ })) as {
838
+ id?: unknown;
839
+ imported?: unknown;
840
+ slideCount?: unknown;
841
+ };
842
+ if (
843
+ typeof imported.id !== "string" ||
844
+ !imported.id ||
845
+ imported.imported !== true ||
846
+ typeof imported.slideCount !== "number" ||
847
+ imported.slideCount < 1
848
+ ) {
849
+ throw new Error("The PowerPoint presentation did not create a deck.");
850
+ }
851
+ await reloadDecks();
852
+ navigate(`/deck/${imported.id}`, { flushSync: true });
853
+ return true;
854
+ }
855
+
856
+ let deck: ReturnType<typeof createDeck> | undefined;
857
+ flushSync(() => {
858
+ deck = createDeck(undefined, {
859
+ noDefaultSlides: true,
860
+ designSystemId: initialDesignSystemId,
861
+ });
862
+ });
863
+ if (!deck) throw new Error("The PDF deck could not be created.");
864
+
865
+ const persisted = await ensureDeckPersisted(deck.id);
866
+ if (!persisted.persisted) {
867
+ deleteDeck(deck.id);
868
+ throw new Error(
869
+ describeDeckPersistenceFailure(
870
+ persisted,
871
+ "The PDF deck could not be saved.",
872
+ ),
873
+ );
874
+ }
875
+
876
+ try {
877
+ const imported = (await callAction("import-file", {
878
+ filePath: file.path,
879
+ format: "pdf",
880
+ deckId: deck.id,
881
+ importIntoDeck: true,
882
+ })) as {
883
+ imported?: unknown;
884
+ deckId?: unknown;
885
+ pageCount?: unknown;
886
+ };
887
+ if (
888
+ imported.imported !== true ||
889
+ imported.deckId !== deck.id ||
890
+ typeof imported.pageCount !== "number" ||
891
+ imported.pageCount < 1
892
+ ) {
893
+ throw new Error("The PDF could not be imported into the new deck.");
894
+ }
895
+ await reloadDecks();
896
+ navigate(`/deck/${deck.id}`, { flushSync: true });
897
+ return true;
898
+ } catch (error) {
899
+ deleteDeck(deck.id);
900
+ throw error;
901
+ }
902
+ },
903
+ [
904
+ callAction,
905
+ createDeck,
906
+ deleteDeck,
907
+ ensureDeckPersisted,
908
+ initialDesignSystemId,
909
+ navigate,
910
+ reloadDecks,
911
+ session,
912
+ ],
913
+ );
914
+
777
915
  const handleReferenceSelect = useCallback(
778
916
  async (selection: NewDeckReferenceSelection) => {
779
917
  const pending = pendingDeck;
780
918
  if (!pending) return;
781
- if (selection.designSystemId) {
782
- rememberReference({
783
- id: selection.designSystemId,
784
- kind: "design-system",
785
- });
919
+ if (selection.designSystemId !== undefined) {
920
+ if (selection.designSystemId) {
921
+ rememberReference({
922
+ id: selection.designSystemId,
923
+ kind: "design-system",
924
+ });
925
+ } else {
926
+ forgetReference("design-system");
927
+ }
786
928
  }
787
- if (selection.referenceDeckId) {
788
- rememberReference({ id: selection.referenceDeckId, kind: "deck" });
929
+ if (selection.referenceDeckId !== undefined) {
930
+ if (selection.referenceDeckId) {
931
+ rememberReference({ id: selection.referenceDeckId, kind: "deck" });
932
+ } else {
933
+ forgetReference("deck");
934
+ }
789
935
  }
790
936
  setShowNewDeckReferenceStep(false);
791
937
  setPendingDeck(null);
@@ -795,7 +941,12 @@ export default function Index() {
795
941
  selection,
796
942
  );
797
943
  },
798
- [handleCreateDeckWithPrompt, pendingDeck, rememberReference],
944
+ [
945
+ forgetReference,
946
+ handleCreateDeckWithPrompt,
947
+ pendingDeck,
948
+ rememberReference,
949
+ ],
799
950
  );
800
951
 
801
952
  const handleReferenceImport = useCallback(
@@ -901,7 +1052,6 @@ export default function Index() {
901
1052
  );
902
1053
  if (importedReference) {
903
1054
  await reloadDecks();
904
- rememberReference({ id: importedReference.id, kind: "deck" });
905
1055
  setSelectedReferenceDeckId(importedReference.id);
906
1056
  }
907
1057
  return importedReference;
@@ -924,7 +1074,6 @@ export default function Index() {
924
1074
  ensureDeckPersisted,
925
1075
  pendingDeck,
926
1076
  reloadDecks,
927
- rememberReference,
928
1077
  t,
929
1078
  ],
930
1079
  );
@@ -964,7 +1113,6 @@ export default function Index() {
964
1113
  source: "google-slides",
965
1114
  };
966
1115
  await reloadDecks();
967
- rememberReference({ id: importedReference.id, kind: "deck" });
968
1116
  setSelectedReferenceDeckId(importedReference.id);
969
1117
  return importedReference;
970
1118
  } catch (error) {
@@ -979,7 +1127,7 @@ export default function Index() {
979
1127
  setReferenceImporting(false);
980
1128
  }
981
1129
  },
982
- [callAction, reloadDecks, rememberReference, t],
1130
+ [callAction, reloadDecks, t],
983
1131
  );
984
1132
 
985
1133
  const handleReferenceSkip = useCallback(() => {
@@ -990,11 +1138,22 @@ export default function Index() {
990
1138
  }
991
1139
  setShowNewDeckReferenceStep(false);
992
1140
  setPendingDeck(null);
1141
+ forgetReference("design-system");
1142
+ forgetReference("deck");
1143
+ if (!pending.prompt.trim() && pending.files.length === 0) {
1144
+ handleCreateDeckBlank();
1145
+ return;
1146
+ }
993
1147
  void handleCreateDeckWithPrompt(pending.prompt, pending.files, {
994
1148
  designSystemId: null,
995
1149
  referenceDeckId: null,
996
1150
  });
997
- }, [handleCreateDeckWithPrompt, pendingDeck]);
1151
+ }, [
1152
+ forgetReference,
1153
+ handleCreateDeckBlank,
1154
+ handleCreateDeckWithPrompt,
1155
+ pendingDeck,
1156
+ ]);
998
1157
 
999
1158
  const handleConfirmDelete = () => {
1000
1159
  if (deckToDelete) {
@@ -1132,7 +1291,7 @@ export default function Index() {
1132
1291
  );
1133
1292
 
1134
1293
  return (
1135
- <main className="min-w-0 flex-1 overflow-y-auto px-4 py-6 sm:px-6 sm:py-10">
1294
+ <main className="min-w-0 flex-1 overflow-y-auto px-4 pb-6 pt-0 sm:px-6 sm:pb-10">
1136
1295
  {loading ? (
1137
1296
  <>
1138
1297
  <div className="mb-4 flex items-center justify-end">
@@ -1141,10 +1300,7 @@ export default function Index() {
1141
1300
  <div className="deck-grid-container">
1142
1301
  <div className="deck-grid grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4">
1143
1302
  {Array.from({ length: 8 }).map((_, i) => (
1144
- <div
1145
- key={i}
1146
- className="overflow-hidden rounded-xl border border-border bg-card"
1147
- >
1303
+ <div key={i} className="overflow-hidden rounded-xl bg-card">
1148
1304
  <div className="aspect-video animate-pulse bg-muted/50" />
1149
1305
  <div className="space-y-2 p-4">
1150
1306
  <div className="h-4 w-3/4 animate-pulse rounded bg-muted" />
@@ -1180,37 +1336,49 @@ export default function Index() {
1180
1336
  ) : (
1181
1337
  <>
1182
1338
  <div className="mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
1183
- <ToggleGroup
1184
- type="single"
1185
- value={deckFilter}
1186
- onValueChange={(value) => value && setDeckFilter(value)}
1187
- className="w-fit rounded-lg border border-border bg-card p-0.5"
1188
- size="sm"
1189
- >
1190
- <ToggleGroupItem
1191
- value="all"
1192
- aria-label={t("home.showAllDecks")}
1193
- className="h-7 rounded-md px-3 text-xs data-[state=on]:bg-accent"
1339
+ <div className="flex min-w-0 flex-col gap-3 sm:flex-row sm:items-center">
1340
+ <ToggleGroup
1341
+ type="single"
1342
+ value={deckFilter}
1343
+ onValueChange={(value) => value && setDeckFilter(value)}
1344
+ className="w-fit rounded-lg border border-border bg-card p-0.5"
1345
+ size="sm"
1194
1346
  >
1195
- <IconStack2 className="me-1.5 h-3.5 w-3.5" />
1196
- {t("home.all")}
1197
- </ToggleGroupItem>
1198
- <ToggleGroupItem
1199
- value="mine"
1200
- aria-label={t("home.showMineDecks")}
1201
- className="h-7 rounded-md px-3 text-xs data-[state=on]:bg-accent"
1202
- >
1203
- <IconUserCircle className="me-1.5 h-3.5 w-3.5" />
1204
- {t("home.mine")}
1205
- </ToggleGroupItem>
1206
- </ToggleGroup>
1347
+ <ToggleGroupItem
1348
+ value="all"
1349
+ aria-label={t("home.showAllDecks")}
1350
+ className="h-7 rounded-md px-3 text-xs data-[state=on]:bg-accent"
1351
+ >
1352
+ <IconStack2 className="me-1.5 h-3.5 w-3.5" />
1353
+ {t("home.all")}
1354
+ </ToggleGroupItem>
1355
+ <ToggleGroupItem
1356
+ value="mine"
1357
+ aria-label={t("home.showMineDecks")}
1358
+ className="h-7 rounded-md px-3 text-xs data-[state=on]:bg-accent"
1359
+ >
1360
+ <IconUserCircle className="me-1.5 h-3.5 w-3.5" />
1361
+ {t("home.mine")}
1362
+ </ToggleGroupItem>
1363
+ </ToggleGroup>
1364
+ <label className="flex h-8 w-full items-center gap-2 rounded-lg border border-border bg-card px-2.5 text-muted-foreground sm:w-60">
1365
+ <IconSearch className="size-3.5 shrink-0" aria-hidden="true" />
1366
+ <Input
1367
+ type="search"
1368
+ value={deckSearch}
1369
+ onChange={(event) => setDeckSearch(event.target.value)}
1370
+ placeholder={t("root.searchDecks")}
1371
+ aria-label={t("root.searchDecks")}
1372
+ className="h-7 min-w-0 flex-1 border-0 bg-transparent p-0 text-xs shadow-none focus-visible:ring-0 focus-visible:ring-offset-0"
1373
+ />
1374
+ </label>
1375
+ </div>
1207
1376
  <span className="text-xs text-muted-foreground/70">
1208
- {deckFilter === "mine"
1377
+ {deckFilter === "mine" || normalizedDeckSearch
1209
1378
  ? `${visibleDecks.length} of ${decks.length}`
1210
- : decks.length}{" "}
1379
+ : visibleDecks.length}{" "}
1211
1380
  {t("home.deckCount", {
1212
- count:
1213
- deckFilter === "mine" ? visibleDecks.length : decks.length,
1381
+ count: visibleDecks.length,
1214
1382
  })}
1215
1383
  </span>
1216
1384
  </div>
@@ -1219,7 +1387,7 @@ export default function Index() {
1219
1387
  {/* New deck card */}
1220
1388
  <button
1221
1389
  onClick={openNewDeck}
1222
- className="group relative cursor-pointer overflow-hidden rounded-xl border border-dashed border-border bg-card text-start hover:border-foreground/15"
1390
+ className="group relative cursor-pointer overflow-hidden rounded-xl border border-transparent bg-card text-start transition-[background-color,border-color] duration-200 hover:border-border hover:bg-accent/30"
1223
1391
  >
1224
1392
  <div className="flex aspect-video items-center justify-center bg-muted/30">
1225
1393
  <div className="flex h-12 w-12 items-center justify-center rounded-xl bg-accent/50 group-hover:bg-accent">
@@ -1230,9 +1398,6 @@ export default function Index() {
1230
1398
  <h3 className="text-sm font-medium text-muted-foreground group-hover:text-foreground/70">
1231
1399
  {t("home.newDeck")}
1232
1400
  </h3>
1233
- <div className="mt-1 text-xs text-muted-foreground/70">
1234
- {t("home.createDeckOrVisual")}
1235
- </div>
1236
1401
  </div>
1237
1402
  </button>
1238
1403
 
@@ -1244,19 +1409,16 @@ export default function Index() {
1244
1409
  onRename={handleRename}
1245
1410
  onDuplicate={handleDuplicate}
1246
1411
  onToggleStar={handleToggleStar}
1247
- designSystemTitle={
1248
- deck.designSystemId
1249
- ? designSystemTitleById.get(deck.designSystemId)
1250
- : null
1251
- }
1252
1412
  isWorkspaceDefault={workspaceReferenceDeck?.id === deck.id}
1253
1413
  canSetWorkspaceDefault={canManageWorkspaceDefaults}
1254
1414
  onSetWorkspaceDefault={handleSetWorkspaceDefaultDeck}
1255
1415
  />
1256
1416
  ))}
1257
1417
  {visibleDecks.length === 0 && (
1258
- <div className="rounded-xl border border-border bg-card p-6 text-sm text-muted-foreground">
1259
- {t("home.noMineDecks")}
1418
+ <div className="rounded-xl bg-card p-6 text-sm text-muted-foreground">
1419
+ {normalizedDeckSearch
1420
+ ? t("home.noDecksMatchSearch")
1421
+ : t("home.noMineDecks")}
1260
1422
  </div>
1261
1423
  )}
1262
1424
  </div>
@@ -1317,9 +1479,11 @@ export default function Index() {
1317
1479
  onOpenChange={setNewDeckPromptOpen}
1318
1480
  title={t("home.newDeckPromptTitle")}
1319
1481
  placeholder={t("home.newDeckPlaceholder")}
1320
- onSkip={handleCreateDeckBlank}
1482
+ onSkip={handlePromptSkip}
1321
1483
  skipLabel={t("home.skipPrompt")}
1322
1484
  onSubmit={handlePromptSubmit}
1485
+ onImport={handleDirectImport}
1486
+ importFromLabel={t("home.importFrom")}
1323
1487
  importingLabel={t("editorToolbar.importing")}
1324
1488
  onBeforeUpload={(prompt, files) => {
1325
1489
  if (session) return true;
@@ -1337,11 +1501,14 @@ export default function Index() {
1337
1501
  open={showNewDeckReferenceStep}
1338
1502
  onOpenChange={(open) => {
1339
1503
  if (!open) {
1340
- const prompt = pendingDeck?.prompt;
1504
+ const pending = pendingDeck;
1341
1505
  setShowNewDeckReferenceStep(false);
1342
1506
  setPendingDeck(null);
1343
- if (prompt) {
1344
- setNewDeckInitialPrompt({ text: prompt, key: Date.now() });
1507
+ if (pending) {
1508
+ setNewDeckInitialPrompt({
1509
+ text: pending.prompt,
1510
+ key: Date.now(),
1511
+ });
1345
1512
  setShowNewDeckPrompt(true);
1346
1513
  }
1347
1514
  }
@@ -1349,8 +1516,7 @@ export default function Index() {
1349
1516
  designSystems={designSystems}
1350
1517
  decks={decks}
1351
1518
  defaultDesignSystemId={initialDesignSystemId}
1352
- defaultReferenceDeckId={workspaceReferenceDeckId}
1353
- recentReferences={recentReferences}
1519
+ defaultReferenceDeckId={initialReferenceDeckId}
1354
1520
  onSelect={(selection) => void handleReferenceSelect(selection)}
1355
1521
  onImport={handleReferenceImport}
1356
1522
  onImportSource={handleReferenceSourceImport}
@@ -1362,8 +1528,6 @@ export default function Index() {
1362
1528
  chooseDeckLabel={t("home.referenceDeckPlaceholder")}
1363
1529
  importingLabel={t("editorToolbar.importing")}
1364
1530
  skipLabel={t("home.referenceDeckNone")}
1365
- starredLabel={t("home.referenceDeckStarredGroup")}
1366
- otherDecksLabel={t("home.referenceDeckOtherGroup")}
1367
1531
  searchDecksLabel={t("root.searchDecks")}
1368
1532
  promptSummary={pendingDeck?.prompt}
1369
1533
  />