@agent-native/core 0.86.1 → 0.88.0

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 (1282) hide show
  1. package/corpus/README.md +2 -2
  2. package/corpus/core/CHANGELOG.md +18 -0
  3. package/corpus/core/docs/content/agent-native-toolkit.mdx +162 -0
  4. package/corpus/core/docs/content/components.mdx +13 -0
  5. package/corpus/core/docs/content/creating-templates.mdx +7 -0
  6. package/corpus/core/docs/content/locales/ar-SA/agent-native-toolkit.mdx +73 -0
  7. package/corpus/core/docs/content/locales/ar-SA/components.mdx +9 -0
  8. package/corpus/core/docs/content/locales/ar-SA/creating-templates.mdx +2 -0
  9. package/corpus/core/docs/content/locales/ar-SA/sharing.mdx +15 -7
  10. package/corpus/core/docs/content/locales/ar-SA/template-analytics.mdx +6 -0
  11. package/corpus/core/docs/content/locales/ar-SA/template-clips.mdx +7 -0
  12. package/corpus/core/docs/content/locales/ar-SA/tracking.mdx +6 -0
  13. package/corpus/core/docs/content/locales/de-DE/agent-native-toolkit.mdx +77 -0
  14. package/corpus/core/docs/content/locales/de-DE/components.mdx +9 -0
  15. package/corpus/core/docs/content/locales/de-DE/creating-templates.mdx +2 -0
  16. package/corpus/core/docs/content/locales/de-DE/sharing.mdx +15 -7
  17. package/corpus/core/docs/content/locales/de-DE/template-analytics.mdx +6 -0
  18. package/corpus/core/docs/content/locales/de-DE/template-clips.mdx +7 -0
  19. package/corpus/core/docs/content/locales/de-DE/tracking.mdx +6 -0
  20. package/corpus/core/docs/content/locales/es-ES/agent-native-toolkit.mdx +77 -0
  21. package/corpus/core/docs/content/locales/es-ES/components.mdx +9 -0
  22. package/corpus/core/docs/content/locales/es-ES/creating-templates.mdx +2 -0
  23. package/corpus/core/docs/content/locales/es-ES/sharing.mdx +15 -7
  24. package/corpus/core/docs/content/locales/es-ES/template-analytics.mdx +6 -0
  25. package/corpus/core/docs/content/locales/es-ES/template-clips.mdx +7 -0
  26. package/corpus/core/docs/content/locales/es-ES/tracking.mdx +6 -0
  27. package/corpus/core/docs/content/locales/fr-FR/agent-native-toolkit.mdx +79 -0
  28. package/corpus/core/docs/content/locales/fr-FR/components.mdx +9 -0
  29. package/corpus/core/docs/content/locales/fr-FR/creating-templates.mdx +2 -0
  30. package/corpus/core/docs/content/locales/fr-FR/sharing.mdx +15 -7
  31. package/corpus/core/docs/content/locales/fr-FR/template-analytics.mdx +6 -0
  32. package/corpus/core/docs/content/locales/fr-FR/template-clips.mdx +7 -0
  33. package/corpus/core/docs/content/locales/fr-FR/tracking.mdx +6 -0
  34. package/corpus/core/docs/content/locales/hi-IN/agent-native-toolkit.mdx +74 -0
  35. package/corpus/core/docs/content/locales/hi-IN/components.mdx +9 -0
  36. package/corpus/core/docs/content/locales/hi-IN/creating-templates.mdx +2 -0
  37. package/corpus/core/docs/content/locales/hi-IN/sharing.mdx +15 -7
  38. package/corpus/core/docs/content/locales/hi-IN/template-analytics.mdx +6 -0
  39. package/corpus/core/docs/content/locales/hi-IN/template-clips.mdx +7 -0
  40. package/corpus/core/docs/content/locales/hi-IN/tracking.mdx +6 -0
  41. package/corpus/core/docs/content/locales/ja-JP/agent-native-toolkit.mdx +67 -0
  42. package/corpus/core/docs/content/locales/ja-JP/components.mdx +9 -0
  43. package/corpus/core/docs/content/locales/ja-JP/creating-templates.mdx +2 -0
  44. package/corpus/core/docs/content/locales/ja-JP/sharing.mdx +15 -7
  45. package/corpus/core/docs/content/locales/ja-JP/template-analytics.mdx +6 -0
  46. package/corpus/core/docs/content/locales/ja-JP/template-clips.mdx +7 -0
  47. package/corpus/core/docs/content/locales/ja-JP/tracking.mdx +6 -0
  48. package/corpus/core/docs/content/locales/ko-KR/agent-native-toolkit.mdx +63 -0
  49. package/corpus/core/docs/content/locales/ko-KR/components.mdx +9 -0
  50. package/corpus/core/docs/content/locales/ko-KR/creating-templates.mdx +2 -0
  51. package/corpus/core/docs/content/locales/ko-KR/sharing.mdx +15 -7
  52. package/corpus/core/docs/content/locales/ko-KR/template-analytics.mdx +6 -0
  53. package/corpus/core/docs/content/locales/ko-KR/template-clips.mdx +7 -0
  54. package/corpus/core/docs/content/locales/ko-KR/tracking.mdx +6 -0
  55. package/corpus/core/docs/content/locales/pt-BR/agent-native-toolkit.mdx +77 -0
  56. package/corpus/core/docs/content/locales/pt-BR/components.mdx +9 -0
  57. package/corpus/core/docs/content/locales/pt-BR/creating-templates.mdx +2 -0
  58. package/corpus/core/docs/content/locales/pt-BR/sharing.mdx +15 -7
  59. package/corpus/core/docs/content/locales/pt-BR/template-analytics.mdx +6 -0
  60. package/corpus/core/docs/content/locales/pt-BR/template-clips.mdx +7 -0
  61. package/corpus/core/docs/content/locales/pt-BR/tracking.mdx +6 -0
  62. package/corpus/core/docs/content/locales/zh-CN/agent-native-toolkit.mdx +61 -0
  63. package/corpus/core/docs/content/locales/zh-CN/components.mdx +9 -0
  64. package/corpus/core/docs/content/locales/zh-CN/creating-templates.mdx +2 -0
  65. package/corpus/core/docs/content/locales/zh-CN/sharing.mdx +15 -7
  66. package/corpus/core/docs/content/locales/zh-CN/template-analytics.mdx +6 -0
  67. package/corpus/core/docs/content/locales/zh-CN/template-clips.mdx +7 -0
  68. package/corpus/core/docs/content/locales/zh-CN/tracking.mdx +6 -0
  69. package/corpus/core/docs/content/locales/zh-TW/agent-native-toolkit.mdx +61 -0
  70. package/corpus/core/docs/content/locales/zh-TW/components.mdx +9 -0
  71. package/corpus/core/docs/content/locales/zh-TW/creating-templates.mdx +2 -0
  72. package/corpus/core/docs/content/locales/zh-TW/sharing.mdx +15 -7
  73. package/corpus/core/docs/content/locales/zh-TW/template-analytics.mdx +6 -0
  74. package/corpus/core/docs/content/locales/zh-TW/template-clips.mdx +7 -0
  75. package/corpus/core/docs/content/locales/zh-TW/tracking.mdx +6 -0
  76. package/corpus/core/docs/content/sharing.mdx +39 -7
  77. package/corpus/core/docs/content/template-analytics.mdx +6 -0
  78. package/corpus/core/docs/content/template-clips.mdx +7 -0
  79. package/corpus/core/docs/content/tracking.mdx +6 -0
  80. package/corpus/core/package.json +9 -1
  81. package/corpus/core/src/application-state/emitter.ts +37 -5
  82. package/corpus/core/src/cli/create.ts +55 -3
  83. package/corpus/core/src/cli/workspacify.ts +10 -4
  84. package/corpus/core/src/client/components/ui/dialog.tsx +1 -91
  85. package/corpus/core/src/client/components/ui/dropdown-menu.tsx +1 -191
  86. package/corpus/core/src/client/components/ui/hover-card.tsx +1 -29
  87. package/corpus/core/src/client/components/ui/popover.tsx +1 -31
  88. package/corpus/core/src/client/components/ui/sheet.tsx +1 -96
  89. package/corpus/core/src/client/components/ui/tooltip.tsx +1 -53
  90. package/corpus/core/src/secrets/crypto.ts +47 -9
  91. package/corpus/core/src/server/action-discovery.ts +4 -0
  92. package/corpus/core/src/server/action-routes.ts +8 -1
  93. package/corpus/core/src/server/agent-access.ts +72 -0
  94. package/corpus/core/src/server/h3-helpers.ts +14 -2
  95. package/corpus/core/src/server/index.ts +28 -0
  96. package/corpus/core/src/server/request-context.ts +64 -7
  97. package/corpus/core/src/shared/agent-access.ts +112 -0
  98. package/corpus/core/src/shared/agent-readable-resource.ts +111 -0
  99. package/corpus/core/src/shared/index.ts +23 -0
  100. package/corpus/core/src/sharing/actions/create-agent-resource-link.ts +91 -0
  101. package/corpus/core/src/sharing/registry.ts +19 -0
  102. package/corpus/core/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +92 -0
  103. package/corpus/core/src/vite/client.ts +1 -0
  104. package/corpus/templates/analytics/AGENTS.md +4 -0
  105. package/corpus/templates/analytics/actions/get-sql-dashboard.ts +9 -113
  106. package/corpus/templates/analytics/app/components/InlineMetric.tsx +2 -2
  107. package/corpus/templates/analytics/app/components/dashboard/CumulativeNetChart.tsx +7 -2
  108. package/corpus/templates/analytics/app/components/dashboard/DataTable.tsx +16 -11
  109. package/corpus/templates/analytics/app/components/dashboard/DateRangePicker.tsx +2 -1
  110. package/corpus/templates/analytics/app/components/dashboard/MetricCard.tsx +7 -2
  111. package/corpus/templates/analytics/app/components/dashboard/RecentActivity.tsx +6 -3
  112. package/corpus/templates/analytics/app/components/dashboard/RevenueChart.tsx +6 -1
  113. package/corpus/templates/analytics/app/components/dashboard/RevenueComparisonChart.tsx +7 -2
  114. package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +15 -11
  115. package/corpus/templates/analytics/app/components/dashboard/StatsCard.tsx +7 -1
  116. package/corpus/templates/analytics/app/components/dashboard/TimeSeriesChart.tsx +7 -2
  117. package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +16 -16
  118. package/corpus/templates/analytics/app/components/layout/HeaderActions.tsx +1 -2
  119. package/corpus/templates/analytics/app/components/layout/MobileNav.tsx +5 -2
  120. package/corpus/templates/analytics/app/components/layout/NewAnalysisDialog.tsx +6 -6
  121. package/corpus/templates/analytics/app/components/layout/NewDashboardDialog.tsx +3 -4
  122. package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +12 -9
  123. package/corpus/templates/analytics/app/components/ui/calendar.tsx +1 -1
  124. package/corpus/templates/analytics/app/pages/Agents.tsx +19 -19
  125. package/corpus/templates/analytics/app/pages/DataDictionary.tsx +21 -21
  126. package/corpus/templates/analytics/app/pages/DataSources.tsx +28 -28
  127. package/corpus/templates/analytics/app/pages/NotFound.tsx +1 -2
  128. package/corpus/templates/analytics/app/pages/Placeholder.tsx +1 -2
  129. package/corpus/templates/analytics/app/pages/Settings.tsx +16 -16
  130. package/corpus/templates/analytics/app/pages/adhoc/DashboardSkeleton.tsx +2 -3
  131. package/corpus/templates/analytics/app/pages/adhoc/_shared/KpiChart.tsx +13 -8
  132. package/corpus/templates/analytics/app/pages/adhoc/_shared/components/DateRangeInput.tsx +2 -1
  133. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/ChartTypePicker.tsx +4 -2
  134. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/DateRangePicker.tsx +2 -1
  135. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/EventCombobox.tsx +7 -7
  136. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/EventPanel.tsx +1 -2
  137. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/EventRow.tsx +1 -2
  138. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/ExplorerChart.tsx +8 -3
  139. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/FilterBuilder.tsx +4 -5
  140. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/GroupByPicker.tsx +1 -2
  141. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/PropertyCombobox.tsx +7 -7
  142. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/PropertyValueCombobox.tsx +7 -7
  143. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/SqlPreview.tsx +1 -1
  144. package/corpus/templates/analytics/app/pages/adhoc/explorer/index.tsx +16 -16
  145. package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/ChartCard.tsx +21 -16
  146. package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +32 -32
  147. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/DashboardFilterBar.tsx +14 -14
  148. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/EmailReportDialog.tsx +13 -14
  149. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/PanelEditorDialog.tsx +21 -13
  150. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +28 -23
  151. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/ViewSqlPopover.tsx +12 -12
  152. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/ViewsMenu.tsx +15 -15
  153. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +33 -29
  154. package/corpus/templates/analytics/app/pages/analyses/AnalysesList.tsx +7 -8
  155. package/corpus/templates/analytics/app/pages/analyses/AnalysisDetail.tsx +19 -19
  156. package/corpus/templates/analytics/app/pages/analyses/LegacyFusionAnalysis.tsx +15 -11
  157. package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +42 -23
  158. package/corpus/templates/analytics/app/pages/sessions/SessionDevToolsPanel.tsx +12 -7
  159. package/corpus/templates/analytics/app/pages/sessions/SessionsPage.tsx +12 -12
  160. package/corpus/templates/analytics/app/pages/settings/AlertRulesSettingsCard.tsx +25 -25
  161. package/corpus/templates/analytics/app/root.tsx +2 -2
  162. package/corpus/templates/analytics/app/routes/catalog.tsx +8 -8
  163. package/corpus/templates/analytics/package.json +1 -0
  164. package/corpus/templates/analytics/server/db/index.ts +14 -0
  165. package/corpus/templates/analytics/server/lib/agent-readable-resource-context.ts +156 -0
  166. package/corpus/templates/analytics/server/lib/session-replay-agent-context.ts +59 -59
  167. package/corpus/templates/analytics/server/routes/[...page].get.ts +92 -25
  168. package/corpus/templates/analytics/server/routes/api/analysis-agent-context.json.get.ts +94 -0
  169. package/corpus/templates/analytics/server/routes/api/dashboard-agent-context.json.get.ts +109 -0
  170. package/corpus/templates/analytics/shared/resource-agent-access.ts +6 -0
  171. package/corpus/templates/analytics/shared/session-replay-agent-access.ts +14 -3
  172. package/corpus/templates/assets/app/components/create/RecentDraftsSection.tsx +2 -3
  173. package/corpus/templates/assets/app/components/generation/GenerationResults.tsx +9 -9
  174. package/corpus/templates/assets/app/components/layout/Header.tsx +4 -2
  175. package/corpus/templates/assets/app/components/layout/Layout.tsx +1 -1
  176. package/corpus/templates/assets/app/components/layout/PageShell.tsx +5 -6
  177. package/corpus/templates/assets/app/components/layout/Sidebar.tsx +12 -12
  178. package/corpus/templates/assets/app/components/library/CreateLibraryDialog.tsx +8 -8
  179. package/corpus/templates/assets/app/components/library/EditLibraryDialog.tsx +7 -7
  180. package/corpus/templates/assets/app/components/library/LibraryCard.tsx +8 -8
  181. package/corpus/templates/assets/app/components/library/LibraryPresetGrid.tsx +2 -3
  182. package/corpus/templates/assets/app/root.tsx +1 -1
  183. package/corpus/templates/assets/app/routes/asset.$id.tsx +19 -19
  184. package/corpus/templates/assets/app/routes/audit.tsx +14 -15
  185. package/corpus/templates/assets/app/routes/brand-kits.$id.tsx +54 -49
  186. package/corpus/templates/assets/app/routes/library.tsx +31 -31
  187. package/corpus/templates/assets/app/routes/settings.tsx +18 -18
  188. package/corpus/templates/assets/package.json +1 -0
  189. package/corpus/templates/brain/app/components/brain/CanonicalPreviewSheet.tsx +5 -6
  190. package/corpus/templates/brain/app/components/brain/Surface.tsx +8 -3
  191. package/corpus/templates/brain/app/components/layout/Layout.tsx +7 -7
  192. package/corpus/templates/brain/app/components/layout/Sidebar.tsx +6 -6
  193. package/corpus/templates/brain/app/routes/knowledge.tsx +19 -19
  194. package/corpus/templates/brain/app/routes/ops.tsx +18 -18
  195. package/corpus/templates/brain/app/routes/review.tsx +27 -22
  196. package/corpus/templates/brain/app/routes/search.tsx +20 -20
  197. package/corpus/templates/brain/app/routes/settings.tsx +22 -22
  198. package/corpus/templates/brain/app/routes/sources.tsx +23 -23
  199. package/corpus/templates/brain/package.json +1 -0
  200. package/corpus/templates/calendar/app/components/ThemeToggle.tsx +5 -5
  201. package/corpus/templates/calendar/app/components/TimezoneCombobox.tsx +6 -6
  202. package/corpus/templates/calendar/app/components/booking/BookingConfirmation.tsx +1 -2
  203. package/corpus/templates/calendar/app/components/booking/BookingForm.tsx +8 -9
  204. package/corpus/templates/calendar/app/components/booking/DatePicker.tsx +2 -2
  205. package/corpus/templates/calendar/app/components/booking/TimeSlotPicker.tsx +2 -3
  206. package/corpus/templates/calendar/app/components/calendar/AddCalendarDialog.tsx +15 -10
  207. package/corpus/templates/calendar/app/components/calendar/AttendeeAutocomplete.tsx +6 -6
  208. package/corpus/templates/calendar/app/components/calendar/CreateEventDialog.tsx +27 -27
  209. package/corpus/templates/calendar/app/components/calendar/DeleteEventDialog.tsx +12 -9
  210. package/corpus/templates/calendar/app/components/calendar/EventAttendeesSection.tsx +13 -10
  211. package/corpus/templates/calendar/app/components/calendar/EventDetailPanel.tsx +7 -7
  212. package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +21 -21
  213. package/corpus/templates/calendar/app/components/calendar/EventDialog.tsx +11 -11
  214. package/corpus/templates/calendar/app/components/calendar/EventOptionControls.tsx +9 -9
  215. package/corpus/templates/calendar/app/components/calendar/FindTimePanel.tsx +9 -9
  216. package/corpus/templates/calendar/app/components/calendar/GoogleConnectBanner.tsx +6 -6
  217. package/corpus/templates/calendar/app/components/calendar/GoogleSetupWizard.tsx +3 -3
  218. package/corpus/templates/calendar/app/components/calendar/GoogleSyncButton.tsx +1 -1
  219. package/corpus/templates/calendar/app/components/calendar/GuestNotificationDialog.tsx +10 -8
  220. package/corpus/templates/calendar/app/components/calendar/IntegrationsSidebar.tsx +12 -12
  221. package/corpus/templates/calendar/app/components/calendar/KeyboardShortcutsHelp.tsx +2 -2
  222. package/corpus/templates/calendar/app/components/calendar/MonthView.tsx +1 -1
  223. package/corpus/templates/calendar/app/components/calendar/PeopleSearchDialog.tsx +6 -6
  224. package/corpus/templates/calendar/app/components/calendar/WeekView.tsx +6 -6
  225. package/corpus/templates/calendar/app/components/layout/AppLayout.tsx +2 -2
  226. package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +16 -16
  227. package/corpus/templates/calendar/app/pages/AvailabilitySettings.tsx +11 -11
  228. package/corpus/templates/calendar/app/pages/BookingLinksPage.tsx +50 -45
  229. package/corpus/templates/calendar/app/pages/BookingPage.tsx +2 -2
  230. package/corpus/templates/calendar/app/pages/BookingsList.tsx +12 -12
  231. package/corpus/templates/calendar/app/pages/CalendarView.tsx +17 -17
  232. package/corpus/templates/calendar/app/pages/ManageBookingPage.tsx +13 -13
  233. package/corpus/templates/calendar/app/pages/Settings.tsx +12 -12
  234. package/corpus/templates/calendar/app/routes/event.tsx +2 -2
  235. package/corpus/templates/calendar/package.json +1 -0
  236. package/corpus/templates/chat/app/components/layout/Header.tsx +4 -2
  237. package/corpus/templates/chat/app/components/layout/Layout.tsx +7 -7
  238. package/corpus/templates/chat/app/components/layout/Sidebar.tsx +12 -12
  239. package/corpus/templates/chat/app/routes/database.tsx +1 -2
  240. package/corpus/templates/chat/app/routes/observability.tsx +1 -1
  241. package/corpus/templates/chat/app/routes/settings.tsx +5 -5
  242. package/corpus/templates/chat/package.json +1 -0
  243. package/corpus/templates/clips/AGENTS.md +5 -0
  244. package/corpus/templates/clips/actions/create-recording-agent-link.ts +15 -20
  245. package/corpus/templates/clips/actions/delete-recording-permanent.ts +74 -34
  246. package/corpus/templates/clips/app/components/capture-install-options.tsx +6 -6
  247. package/corpus/templates/clips/app/components/editable-recording-title.tsx +2 -2
  248. package/corpus/templates/clips/app/components/editor/chapters-editor.tsx +7 -7
  249. package/corpus/templates/clips/app/components/editor/editor-layout.tsx +165 -3
  250. package/corpus/templates/clips/app/components/editor/editor-toolbar.tsx +101 -57
  251. package/corpus/templates/clips/app/components/editor/split-button.tsx +4 -5
  252. package/corpus/templates/clips/app/components/editor/stitch-manager.tsx +9 -9
  253. package/corpus/templates/clips/app/components/editor/thumbnail-picker.tsx +16 -11
  254. package/corpus/templates/clips/app/components/editor/timeline.tsx +4 -6
  255. package/corpus/templates/clips/app/components/editor/transcript-editor.tsx +5 -5
  256. package/corpus/templates/clips/app/components/editor/trim-handles.tsx +4 -7
  257. package/corpus/templates/clips/app/components/editor/waveform.tsx +13 -4
  258. package/corpus/templates/clips/app/components/layout/Header.tsx +4 -2
  259. package/corpus/templates/clips/app/components/layout/Layout.tsx +2 -3
  260. package/corpus/templates/clips/app/components/library/bulk-action-toolbar.tsx +4 -4
  261. package/corpus/templates/clips/app/components/library/create-space-dialog.tsx +8 -8
  262. package/corpus/templates/clips/app/components/library/empty-state.tsx +1 -2
  263. package/corpus/templates/clips/app/components/library/folder-tree.tsx +14 -14
  264. package/corpus/templates/clips/app/components/library/library-grid.tsx +7 -7
  265. package/corpus/templates/clips/app/components/library/library-layout.tsx +16 -16
  266. package/corpus/templates/clips/app/components/library/organization-switcher.tsx +11 -11
  267. package/corpus/templates/clips/app/components/library/recording-card.tsx +16 -12
  268. package/corpus/templates/clips/app/components/library/search-bar.tsx +5 -5
  269. package/corpus/templates/clips/app/components/library/sort-menu.tsx +3 -4
  270. package/corpus/templates/clips/app/components/library/tag-input.tsx +4 -4
  271. package/corpus/templates/clips/app/components/meetings/attendee-stack.tsx +6 -2
  272. package/corpus/templates/clips/app/components/meetings/auto-record-prompt.tsx +1 -1
  273. package/corpus/templates/clips/app/components/meetings/bullet-link.tsx +4 -4
  274. package/corpus/templates/clips/app/components/meetings/canvas-editor.tsx +5 -5
  275. package/corpus/templates/clips/app/components/meetings/meeting-card.tsx +3 -3
  276. package/corpus/templates/clips/app/components/meetings/quick-ask-sidebar.tsx +9 -9
  277. package/corpus/templates/clips/app/components/meetings/share-meeting-dialog.tsx +11 -6
  278. package/corpus/templates/clips/app/components/meetings/transcript-bubbles.tsx +4 -4
  279. package/corpus/templates/clips/app/components/player/access-password-prompt.tsx +2 -3
  280. package/corpus/templates/clips/app/components/player/comments-panel.tsx +14 -14
  281. package/corpus/templates/clips/app/components/player/delete-recording-menu.tsx +6 -7
  282. package/corpus/templates/clips/app/components/player/insights-panel.tsx +1 -2
  283. package/corpus/templates/clips/app/components/player/player-controls.tsx +15 -15
  284. package/corpus/templates/clips/app/components/player/reactions-tray.tsx +3 -3
  285. package/corpus/templates/clips/app/components/player/settings-panel.tsx +12 -13
  286. package/corpus/templates/clips/app/components/player/share-dialog.tsx +20 -11
  287. package/corpus/templates/clips/app/components/player/sign-in-prompt-dialog.tsx +2 -3
  288. package/corpus/templates/clips/app/components/player/timestamped-comment-button.tsx +2 -2
  289. package/corpus/templates/clips/app/components/player/transcript-panel.tsx +7 -7
  290. package/corpus/templates/clips/app/components/player/video-player.tsx +9 -9
  291. package/corpus/templates/clips/app/components/recorder/camera-visualizer.tsx +1 -1
  292. package/corpus/templates/clips/app/components/recorder/microphone-visualizer.tsx +1 -1
  293. package/corpus/templates/clips/app/components/recorder/pre-record-panel.tsx +21 -21
  294. package/corpus/templates/clips/app/components/recorder/recording-toolbar.tsx +5 -6
  295. package/corpus/templates/clips/app/components/recorder/storage-setup-card.tsx +6 -7
  296. package/corpus/templates/clips/app/components/sharing/share-ui.tsx +10 -10
  297. package/corpus/templates/clips/app/components/workspace/branding-editor.tsx +9 -5
  298. package/corpus/templates/clips/app/components/workspace/insights-hub.tsx +19 -9
  299. package/corpus/templates/clips/app/components/workspace/invite-dialog.tsx +9 -10
  300. package/corpus/templates/clips/app/components/workspace/members-list.tsx +10 -11
  301. package/corpus/templates/clips/app/components/workspace/notifications-list.tsx +1 -2
  302. package/corpus/templates/clips/app/components/workspace/top-creators-table.tsx +2 -3
  303. package/corpus/templates/clips/app/components/workspace/top-videos-table.tsx +2 -3
  304. package/corpus/templates/clips/app/hooks/use-desktop-promo.ts +1 -2
  305. package/corpus/templates/clips/app/root.tsx +10 -10
  306. package/corpus/templates/clips/app/routes/_app.dictate.tsx +13 -13
  307. package/corpus/templates/clips/app/routes/_app.meetings.$meetingId.tsx +35 -26
  308. package/corpus/templates/clips/app/routes/_app.meetings._index.tsx +20 -20
  309. package/corpus/templates/clips/app/routes/_app.notifications.tsx +3 -3
  310. package/corpus/templates/clips/app/routes/_app.settings._index.tsx +31 -31
  311. package/corpus/templates/clips/app/routes/_app.settings.organization.tsx +13 -8
  312. package/corpus/templates/clips/app/routes/_app.spaces._index.tsx +1 -1
  313. package/corpus/templates/clips/app/routes/_app.trash.tsx +10 -10
  314. package/corpus/templates/clips/app/routes/bug-report.done.tsx +1 -1
  315. package/corpus/templates/clips/app/routes/bug-report.tsx +11 -11
  316. package/corpus/templates/clips/app/routes/download.tsx +2 -2
  317. package/corpus/templates/clips/app/routes/embed.$shareId.tsx +1 -1
  318. package/corpus/templates/clips/app/routes/invite.$token.tsx +13 -8
  319. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +28 -23
  320. package/corpus/templates/clips/app/routes/record.tsx +3 -3
  321. package/corpus/templates/clips/app/routes/share.$shareId.tsx +41 -20
  322. package/corpus/templates/clips/app/routes/share.meeting.$meetingId.tsx +2 -2
  323. package/corpus/templates/clips/changelog/2026-07-05-desktop-full-screen-recordings-with-system-audio-now-finaliz.md +6 -0
  324. package/corpus/templates/clips/changelog/2026-07-05-desktop-recording-shortcut-start-stop.md +6 -0
  325. package/corpus/templates/clips/changelog/2026-07-05-desktop-recordings-no-longer-fail-when-saved-capture-constra.md +6 -0
  326. package/corpus/templates/clips/changelog/2026-07-05-permanently-deleted-clips-now-clean-up-s3-media-objects.md +6 -0
  327. package/corpus/templates/clips/changelog/2026-07-05-timeline-zoom-controls-are-now-visible-in-the-clip-editor-an.md +6 -0
  328. package/corpus/templates/clips/desktop/src/app.tsx +98 -1
  329. package/corpus/templates/clips/desktop/src/components/MediaDeviceRow.tsx +3 -2
  330. package/corpus/templates/clips/desktop/src/lib/media-capture-constraints.ts +121 -0
  331. package/corpus/templates/clips/desktop/src/lib/recorder.ts +55 -84
  332. package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +77 -39
  333. package/corpus/templates/clips/desktop/src-tauri/src/shortcuts.rs +60 -8
  334. package/corpus/templates/clips/package.json +1 -0
  335. package/corpus/templates/clips/server/lib/public-agent-context.ts +17 -12
  336. package/corpus/templates/clips/server/lib/recording-media-cleanup.ts +110 -0
  337. package/corpus/templates/clips/server/lib/s3-upload-provider.ts +126 -0
  338. package/corpus/templates/clips/server/routes/api/public-recording.get.ts +47 -11
  339. package/corpus/templates/clips/shared/agent-context.ts +23 -21
  340. package/corpus/templates/content/app/blocks/contentBlockRegistry.tsx +4 -4
  341. package/corpus/templates/content/app/components/EmptyState.tsx +1 -1
  342. package/corpus/templates/content/app/components/ThemeToggle.tsx +6 -6
  343. package/corpus/templates/content/app/components/editor/BubbleToolbar.tsx +5 -5
  344. package/corpus/templates/content/app/components/editor/CommentsSidebar.tsx +5 -5
  345. package/corpus/templates/content/app/components/editor/ContentReferencePreview.tsx +1 -1
  346. package/corpus/templates/content/app/components/editor/DocumentDatabase.tsx +36 -36
  347. package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +3 -3
  348. package/corpus/templates/content/app/components/editor/DocumentProperties.tsx +29 -29
  349. package/corpus/templates/content/app/components/editor/DocumentToolbar.tsx +23 -23
  350. package/corpus/templates/content/app/components/editor/EmojiPicker.tsx +4 -5
  351. package/corpus/templates/content/app/components/editor/LinkHoverPreview.tsx +4 -5
  352. package/corpus/templates/content/app/components/editor/NotionConflictBanner.tsx +1 -1
  353. package/corpus/templates/content/app/components/editor/NotionSyncBar.tsx +2 -2
  354. package/corpus/templates/content/app/components/editor/SlashCommandMenu.tsx +5 -5
  355. package/corpus/templates/content/app/components/editor/TableHoverControls.tsx +13 -13
  356. package/corpus/templates/content/app/components/editor/VersionHistoryPanel.tsx +10 -10
  357. package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +41 -41
  358. package/corpus/templates/content/app/components/editor/database/shared.tsx +19 -19
  359. package/corpus/templates/content/app/components/editor/database-sources/BuilderSourceReviewDialog.tsx +8 -9
  360. package/corpus/templates/content/app/components/editor/extensions/AudioBlock.tsx +18 -19
  361. package/corpus/templates/content/app/components/editor/extensions/ImageBlock.tsx +20 -21
  362. package/corpus/templates/content/app/components/editor/extensions/LocalMdxComponentNode.tsx +8 -8
  363. package/corpus/templates/content/app/components/editor/extensions/VideoBlock.tsx +18 -19
  364. package/corpus/templates/content/app/components/layout/Header.tsx +4 -2
  365. package/corpus/templates/content/app/components/layout/Layout.tsx +3 -3
  366. package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +22 -22
  367. package/corpus/templates/content/app/components/sidebar/DocumentTreeItem.tsx +22 -22
  368. package/corpus/templates/content/app/components/sidebar/NotionButton.tsx +11 -11
  369. package/corpus/templates/content/app/root.tsx +4 -5
  370. package/corpus/templates/content/app/routes/_app._index.tsx +1 -1
  371. package/corpus/templates/content/app/routes/_app.local-files.tsx +11 -11
  372. package/corpus/templates/content/app/routes/_app.settings.tsx +3 -3
  373. package/corpus/templates/content/app/routes/p.$id.tsx +114 -9
  374. package/corpus/templates/content/package.json +1 -0
  375. package/corpus/templates/content/server/db/index.ts +9 -0
  376. package/corpus/templates/content/server/routes/api/document-agent-context.json.get.ts +90 -0
  377. package/corpus/templates/content/shared/agent-readable.ts +56 -0
  378. package/corpus/templates/design/app/components/ThemeToggle.tsx +6 -6
  379. package/corpus/templates/design/app/components/design/CanvasContextMenu.tsx +11 -11
  380. package/corpus/templates/design/app/components/design/DesignEditorSkeleton.tsx +2 -2
  381. package/corpus/templates/design/app/components/design/DesignExtensionsPanel.tsx +21 -16
  382. package/corpus/templates/design/app/components/design/DesignImportPanel.tsx +3 -3
  383. package/corpus/templates/design/app/components/design/DrawOverlay.tsx +7 -7
  384. package/corpus/templates/design/app/components/design/EditPanel.tsx +30 -30
  385. package/corpus/templates/design/app/components/design/FusionAppBanner.tsx +8 -9
  386. package/corpus/templates/design/app/components/design/LayersPanel.tsx +14 -14
  387. package/corpus/templates/design/app/components/design/LocalhostWriteConsentDialog.tsx +5 -6
  388. package/corpus/templates/design/app/components/design/MotionDock.tsx +15 -15
  389. package/corpus/templates/design/app/components/design/QuestionFlow.tsx +3 -3
  390. package/corpus/templates/design/app/components/design/ReviewPanel.tsx +3 -3
  391. package/corpus/templates/design/app/components/design/StatesPanel.tsx +13 -13
  392. package/corpus/templates/design/app/components/design/TokensPanel.tsx +14 -14
  393. package/corpus/templates/design/app/components/design/TweaksPanel.tsx +6 -6
  394. package/corpus/templates/design/app/components/design/code-workbench/ActivityBar.tsx +3 -3
  395. package/corpus/templates/design/app/components/design/code-workbench/SideBar.tsx +3 -3
  396. package/corpus/templates/design/app/components/design/code-workbench/editor/EditorTabs.tsx +6 -6
  397. package/corpus/templates/design/app/components/design/code-workbench/editor/MonacoHost.tsx +1 -2
  398. package/corpus/templates/design/app/components/design/code-workbench/explorer/FileTree.tsx +17 -17
  399. package/corpus/templates/design/app/components/design/code-workbench/search/SearchView.tsx +6 -6
  400. package/corpus/templates/design/app/components/design/inspector/AlignmentMatrix.tsx +3 -3
  401. package/corpus/templates/design/app/components/design/inspector/AutoLayoutMatrix.tsx +7 -7
  402. package/corpus/templates/design/app/components/design/inspector/ConstraintsWidget.tsx +3 -3
  403. package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +18 -18
  404. package/corpus/templates/design/app/components/design/inspector/ExportSettingsPanel.tsx +6 -6
  405. package/corpus/templates/design/app/components/design/inspector/ImageFillControls.tsx +6 -6
  406. package/corpus/templates/design/app/components/design/inspector/InspectorAiActions.tsx +7 -7
  407. package/corpus/templates/design/app/components/design/inspector/ScrubInput.tsx +7 -7
  408. package/corpus/templates/design/app/components/design/inspector/ShaderControls.tsx +14 -14
  409. package/corpus/templates/design/app/components/design/inspector/ShaderEffectRow.tsx +9 -9
  410. package/corpus/templates/design/app/components/design/inspector/ShaderFillsPanel.tsx +6 -6
  411. package/corpus/templates/design/app/components/design-system/DesignSystemCard.tsx +2 -3
  412. package/corpus/templates/design/app/components/editor/PromptDialog.tsx +18 -15
  413. package/corpus/templates/design/app/components/layout/Header.tsx +4 -2
  414. package/corpus/templates/design/app/components/layout/Layout.tsx +1 -1
  415. package/corpus/templates/design/app/components/layout/Sidebar.tsx +5 -5
  416. package/corpus/templates/design/app/components/visual-editor/CanvasCommentPins.tsx +7 -7
  417. package/corpus/templates/design/app/components/visual-editor/DrawOverlay.tsx +7 -7
  418. package/corpus/templates/design/app/components/visual-editor/SaveStatusIndicator.tsx +3 -3
  419. package/corpus/templates/design/app/pages/DesignEditor.tsx +51 -47
  420. package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +8 -8
  421. package/corpus/templates/design/app/pages/DesignSystems.tsx +32 -32
  422. package/corpus/templates/design/app/pages/Index.tsx +28 -28
  423. package/corpus/templates/design/app/pages/NotFound.tsx +1 -2
  424. package/corpus/templates/design/app/pages/Present.tsx +1 -2
  425. package/corpus/templates/design/app/pages/VisualEdit.tsx +1 -2
  426. package/corpus/templates/design/app/root.tsx +1 -1
  427. package/corpus/templates/design/app/routes/settings.tsx +3 -3
  428. package/corpus/templates/design/package.json +1 -0
  429. package/corpus/templates/design/server/db/index.ts +8 -0
  430. package/corpus/templates/design/server/routes/[...page].get.ts +94 -1
  431. package/corpus/templates/design/server/routes/api/design-agent-context.json.get.ts +84 -0
  432. package/corpus/templates/design/shared/agent-readable.ts +2 -0
  433. package/corpus/templates/forms/app/components/CloudUpgrade.tsx +10 -10
  434. package/corpus/templates/forms/app/components/ThemeToggle.tsx +5 -5
  435. package/corpus/templates/forms/app/components/builder/FieldPropertiesPanel.tsx +10 -11
  436. package/corpus/templates/forms/app/components/builder/FieldRenderer.tsx +13 -10
  437. package/corpus/templates/forms/app/components/layout/Header.tsx +4 -2
  438. package/corpus/templates/forms/app/components/layout/Layout.tsx +1 -1
  439. package/corpus/templates/forms/app/components/layout/Sidebar.tsx +15 -15
  440. package/corpus/templates/forms/app/components/ui/calendar.tsx +1 -1
  441. package/corpus/templates/forms/app/components/ui/command.tsx +1 -1
  442. package/corpus/templates/forms/app/pages/FormBuilderPage.tsx +24 -24
  443. package/corpus/templates/forms/app/pages/FormFillPage.tsx +2 -2
  444. package/corpus/templates/forms/app/pages/FormsListPage.tsx +25 -25
  445. package/corpus/templates/forms/app/pages/ResponseInsightsPage.tsx +11 -11
  446. package/corpus/templates/forms/app/pages/ResponsesPage.tsx +4 -4
  447. package/corpus/templates/forms/app/routes/_app.settings.tsx +5 -5
  448. package/corpus/templates/forms/app/routes/form-preview.tsx +3 -3
  449. package/corpus/templates/forms/package.json +1 -0
  450. package/corpus/templates/macros/app/components/AddExerciseDialog.tsx +1 -1
  451. package/corpus/templates/macros/app/components/AddMealDialog.tsx +1 -1
  452. package/corpus/templates/macros/app/components/AddWeightDialog.tsx +1 -1
  453. package/corpus/templates/macros/app/components/DailyProgress.tsx +7 -7
  454. package/corpus/templates/macros/app/components/WeeklyCaloriesChart.tsx +1 -2
  455. package/corpus/templates/macros/app/components/WeightCard.tsx +10 -10
  456. package/corpus/templates/macros/app/components/WeightTracker.tsx +1 -1
  457. package/corpus/templates/macros/app/components/layout/AppLayout.tsx +11 -7
  458. package/corpus/templates/macros/app/components/layout/Header.tsx +4 -2
  459. package/corpus/templates/macros/app/root.tsx +1 -1
  460. package/corpus/templates/macros/app/routes/_index.tsx +1 -1
  461. package/corpus/templates/macros/app/routes/analytics.tsx +9 -9
  462. package/corpus/templates/macros/app/routes/settings.tsx +2 -2
  463. package/corpus/templates/macros/package.json +1 -0
  464. package/corpus/templates/mail/app/components/GoogleConnectBanner.tsx +1 -1
  465. package/corpus/templates/mail/app/components/ThemeToggle.tsx +6 -6
  466. package/corpus/templates/mail/app/components/agent-engine-picker.tsx +10 -10
  467. package/corpus/templates/mail/app/components/email/CodeBlockLangPicker.tsx +3 -4
  468. package/corpus/templates/mail/app/components/email/ComposeBubbleToolbar.tsx +5 -5
  469. package/corpus/templates/mail/app/components/email/ComposeEditor.tsx +9 -9
  470. package/corpus/templates/mail/app/components/email/ComposeModal.tsx +18 -18
  471. package/corpus/templates/mail/app/components/email/EmailList.tsx +17 -17
  472. package/corpus/templates/mail/app/components/email/EmailListItem.tsx +5 -5
  473. package/corpus/templates/mail/app/components/email/EmailThread.tsx +6 -6
  474. package/corpus/templates/mail/app/components/email/InlineReplyComposer.tsx +11 -11
  475. package/corpus/templates/mail/app/components/email/IntegrationsSidebar.tsx +13 -13
  476. package/corpus/templates/mail/app/components/email/MobileActionBar.tsx +13 -13
  477. package/corpus/templates/mail/app/components/email/RecipientInput.tsx +13 -13
  478. package/corpus/templates/mail/app/components/email/SendLaterButton.tsx +4 -5
  479. package/corpus/templates/mail/app/components/email/SnoozeModal.tsx +1 -1
  480. package/corpus/templates/mail/app/components/email/SnoozePopover.tsx +6 -6
  481. package/corpus/templates/mail/app/components/layout/AppLayout.tsx +12 -12
  482. package/corpus/templates/mail/app/components/layout/SearchBar.tsx +5 -5
  483. package/corpus/templates/mail/app/components/settings/GmailFiltersSection.tsx +23 -23
  484. package/corpus/templates/mail/app/components/ui/calendar.tsx +1 -1
  485. package/corpus/templates/mail/app/components/ui/command.tsx +1 -1
  486. package/corpus/templates/mail/app/pages/DraftQueuePage.tsx +14 -14
  487. package/corpus/templates/mail/app/pages/NotFound.tsx +1 -2
  488. package/corpus/templates/mail/app/pages/SettingsPage.tsx +25 -25
  489. package/corpus/templates/mail/app/root.tsx +1 -1
  490. package/corpus/templates/mail/app/routes/_index.tsx +1 -2
  491. package/corpus/templates/mail/app/routes/email.tsx +2 -2
  492. package/corpus/templates/mail/package.json +1 -0
  493. package/corpus/templates/plan/app/components/layout/Header.tsx +4 -2
  494. package/corpus/templates/plan/app/components/layout/Layout.tsx +5 -6
  495. package/corpus/templates/plan/app/components/layout/Sidebar.tsx +20 -20
  496. package/corpus/templates/plan/app/components/plan/CanvasArea.tsx +2 -3
  497. package/corpus/templates/plan/app/components/plan/DocumentArea.tsx +2 -2
  498. package/corpus/templates/plan/app/components/plan/GuestModeBanner.tsx +1 -2
  499. package/corpus/templates/plan/app/components/plan/LocalCodebasePicker.tsx +8 -8
  500. package/corpus/templates/plan/app/components/plan/PlanContentRenderer.tsx +1 -1
  501. package/corpus/templates/plan/app/components/plan/PlanImageViewer.tsx +83 -82
  502. package/corpus/templates/plan/app/components/plan/PlanVisualSurface.tsx +3 -3
  503. package/corpus/templates/plan/app/components/plan/planBlocks.tsx +4 -4
  504. package/corpus/templates/plan/app/pages/PlansPage.tsx +84 -77
  505. package/corpus/templates/plan/app/root.tsx +1 -1
  506. package/corpus/templates/plan/app/routes/_index.tsx +2 -1
  507. package/corpus/templates/plan/app/routes/local-plans.$slug.tsx +1 -1
  508. package/corpus/templates/plan/app/routes/plans.$id.tsx +2 -1
  509. package/corpus/templates/plan/app/routes/plans.tsx +2 -1
  510. package/corpus/templates/plan/app/routes/recaps.$id.tsx +2 -1
  511. package/corpus/templates/plan/app/routes/recaps.tsx +2 -1
  512. package/corpus/templates/plan/app/routes/settings.tsx +5 -5
  513. package/corpus/templates/plan/changelog/2026-07-05-images-in-plan-documents-open-reliably-in-the-full-size-prev.md +6 -0
  514. package/corpus/templates/plan/package.json +1 -0
  515. package/corpus/templates/plan/server/db/index.ts +12 -0
  516. package/corpus/templates/plan/server/plans.ts +25 -1
  517. package/corpus/templates/plan/server/routes/[...page].get.ts +107 -1
  518. package/corpus/templates/plan/server/routes/api/plan-agent-context.json.get.ts +65 -0
  519. package/corpus/templates/plan/shared/agent-readable.ts +2 -0
  520. package/corpus/templates/slides/app/components/ThemeToggle.tsx +6 -6
  521. package/corpus/templates/slides/app/components/comments/SlideCommentsPanel.tsx +5 -5
  522. package/corpus/templates/slides/app/components/deck/DeckCard.tsx +7 -7
  523. package/corpus/templates/slides/app/components/deck/ExcalidrawSlide.tsx +1 -2
  524. package/corpus/templates/slides/app/components/deck/SlideRenderer.tsx +1 -1
  525. package/corpus/templates/slides/app/components/design-system/DesignSystemCard.tsx +2 -3
  526. package/corpus/templates/slides/app/components/design-system/DesignSystemSetup.tsx +13 -14
  527. package/corpus/templates/slides/app/components/editor/AnimationsPanel.tsx +7 -7
  528. package/corpus/templates/slides/app/components/editor/BlockBubbleMenu.tsx +5 -5
  529. package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +6 -6
  530. package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +13 -13
  531. package/corpus/templates/slides/app/components/editor/ExportMenu.tsx +9 -10
  532. package/corpus/templates/slides/app/components/editor/GenerateSlidesDialog.tsx +5 -6
  533. package/corpus/templates/slides/app/components/editor/HistoryPanel.tsx +12 -12
  534. package/corpus/templates/slides/app/components/editor/ImageDropPromptPopover.tsx +3 -4
  535. package/corpus/templates/slides/app/components/editor/ImageSearchPanel.tsx +4 -5
  536. package/corpus/templates/slides/app/components/editor/ImportButton.tsx +3 -4
  537. package/corpus/templates/slides/app/components/editor/PromptDialog.tsx +1 -2
  538. package/corpus/templates/slides/app/components/editor/ShareDialog.tsx +10 -10
  539. package/corpus/templates/slides/app/components/editor/SlideBubbleMenu.tsx +10 -10
  540. package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +6 -6
  541. package/corpus/templates/slides/app/components/editor/SlideStyleInspector.tsx +1 -2
  542. package/corpus/templates/slides/app/components/editor/TweaksPanel.tsx +1 -1
  543. package/corpus/templates/slides/app/components/layout/Header.tsx +4 -2
  544. package/corpus/templates/slides/app/components/layout/Layout.tsx +1 -1
  545. package/corpus/templates/slides/app/components/layout/Sidebar.tsx +5 -5
  546. package/corpus/templates/slides/app/components/visual-editor/CanvasCommentPins.tsx +6 -6
  547. package/corpus/templates/slides/app/components/visual-editor/DrawOverlay.tsx +7 -7
  548. package/corpus/templates/slides/app/pages/DeckEditor.tsx +3 -3
  549. package/corpus/templates/slides/app/pages/DesignSystems.tsx +5 -5
  550. package/corpus/templates/slides/app/pages/Index.tsx +18 -15
  551. package/corpus/templates/slides/app/root.tsx +3 -3
  552. package/corpus/templates/slides/app/routes/p.$id.tsx +126 -12
  553. package/corpus/templates/slides/app/routes/settings.tsx +5 -5
  554. package/corpus/templates/slides/app/routes/share.$token.tsx +55 -8
  555. package/corpus/templates/slides/package.json +1 -0
  556. package/corpus/templates/slides/server/db/index.ts +9 -0
  557. package/corpus/templates/slides/server/routes/api/deck-agent-context.json.get.ts +97 -0
  558. package/corpus/templates/slides/shared/agent-readable.ts +2 -0
  559. package/dist/application-state/emitter.d.ts +9 -2
  560. package/dist/application-state/emitter.d.ts.map +1 -1
  561. package/dist/application-state/emitter.js +25 -3
  562. package/dist/application-state/emitter.js.map +1 -1
  563. package/dist/cli/create.d.ts +2 -1
  564. package/dist/cli/create.d.ts.map +1 -1
  565. package/dist/cli/create.js +52 -4
  566. package/dist/cli/create.js.map +1 -1
  567. package/dist/cli/workspacify.d.ts +2 -0
  568. package/dist/cli/workspacify.d.ts.map +1 -1
  569. package/dist/cli/workspacify.js +8 -4
  570. package/dist/cli/workspacify.js.map +1 -1
  571. package/dist/client/components/ui/dialog.d.ts +1 -13
  572. package/dist/client/components/ui/dialog.d.ts.map +1 -1
  573. package/dist/client/components/ui/dialog.js +1 -20
  574. package/dist/client/components/ui/dialog.js.map +1 -1
  575. package/dist/client/components/ui/dropdown-menu.d.ts +1 -27
  576. package/dist/client/components/ui/dropdown-menu.d.ts.map +1 -1
  577. package/dist/client/components/ui/dropdown-menu.js +1 -33
  578. package/dist/client/components/ui/dropdown-menu.js.map +1 -1
  579. package/dist/client/components/ui/hover-card.d.ts +1 -6
  580. package/dist/client/components/ui/hover-card.d.ts.map +1 -1
  581. package/dist/client/components/ui/hover-card.js +1 -9
  582. package/dist/client/components/ui/hover-card.js.map +1 -1
  583. package/dist/client/components/ui/popover.d.ts +1 -7
  584. package/dist/client/components/ui/popover.d.ts.map +1 -1
  585. package/dist/client/components/ui/popover.js +1 -10
  586. package/dist/client/components/ui/popover.js.map +1 -1
  587. package/dist/client/components/ui/sheet.d.ts +1 -15
  588. package/dist/client/components/ui/sheet.d.ts.map +1 -1
  589. package/dist/client/components/ui/sheet.js +1 -22
  590. package/dist/client/components/ui/sheet.js.map +1 -1
  591. package/dist/client/components/ui/tooltip.d.ts +1 -8
  592. package/dist/client/components/ui/tooltip.d.ts.map +1 -1
  593. package/dist/client/components/ui/tooltip.js +1 -17
  594. package/dist/client/components/ui/tooltip.js.map +1 -1
  595. package/dist/collab/routes.d.ts +1 -1
  596. package/dist/collab/struct-routes.d.ts +1 -1
  597. package/dist/observability/routes.d.ts +5 -5
  598. package/dist/progress/routes.d.ts +1 -1
  599. package/dist/provider-api/corpus-jobs.d.ts +2 -2
  600. package/dist/secrets/crypto.d.ts.map +1 -1
  601. package/dist/secrets/crypto.js +37 -4
  602. package/dist/secrets/crypto.js.map +1 -1
  603. package/dist/secrets/routes.d.ts +9 -9
  604. package/dist/server/action-discovery.d.ts.map +1 -1
  605. package/dist/server/action-discovery.js +4 -0
  606. package/dist/server/action-discovery.js.map +1 -1
  607. package/dist/server/action-routes.d.ts.map +1 -1
  608. package/dist/server/action-routes.js +8 -2
  609. package/dist/server/action-routes.js.map +1 -1
  610. package/dist/server/agent-access.d.ts +16 -0
  611. package/dist/server/agent-access.d.ts.map +1 -0
  612. package/dist/server/agent-access.js +25 -0
  613. package/dist/server/agent-access.js.map +1 -0
  614. package/dist/server/h3-helpers.d.ts.map +1 -1
  615. package/dist/server/h3-helpers.js +12 -2
  616. package/dist/server/h3-helpers.js.map +1 -1
  617. package/dist/server/index.d.ts +2 -0
  618. package/dist/server/index.d.ts.map +1 -1
  619. package/dist/server/index.js +2 -0
  620. package/dist/server/index.js.map +1 -1
  621. package/dist/server/request-context.d.ts +17 -0
  622. package/dist/server/request-context.d.ts.map +1 -1
  623. package/dist/server/request-context.js +46 -6
  624. package/dist/server/request-context.js.map +1 -1
  625. package/dist/server/transcribe-voice.d.ts +1 -1
  626. package/dist/shared/agent-access.d.ts +29 -0
  627. package/dist/shared/agent-access.d.ts.map +1 -0
  628. package/dist/shared/agent-access.js +57 -0
  629. package/dist/shared/agent-access.js.map +1 -0
  630. package/dist/shared/agent-readable-resource.d.ts +29 -0
  631. package/dist/shared/agent-readable-resource.d.ts.map +1 -0
  632. package/dist/shared/agent-readable-resource.js +60 -0
  633. package/dist/shared/agent-readable-resource.js.map +1 -0
  634. package/dist/shared/index.d.ts +2 -0
  635. package/dist/shared/index.d.ts.map +1 -1
  636. package/dist/shared/index.js +2 -0
  637. package/dist/shared/index.js.map +1 -1
  638. package/dist/sharing/actions/create-agent-resource-link.d.ts +13 -0
  639. package/dist/sharing/actions/create-agent-resource-link.d.ts.map +1 -0
  640. package/dist/sharing/actions/create-agent-resource-link.js +72 -0
  641. package/dist/sharing/actions/create-agent-resource-link.js.map +1 -0
  642. package/dist/sharing/registry.d.ts +17 -0
  643. package/dist/sharing/registry.d.ts.map +1 -1
  644. package/dist/sharing/registry.js.map +1 -1
  645. package/dist/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +92 -0
  646. package/dist/vite/client.d.ts.map +1 -1
  647. package/dist/vite/client.js +1 -0
  648. package/dist/vite/client.js.map +1 -1
  649. package/docs/content/agent-native-toolkit.mdx +162 -0
  650. package/docs/content/components.mdx +13 -0
  651. package/docs/content/creating-templates.mdx +7 -0
  652. package/docs/content/locales/ar-SA/agent-native-toolkit.mdx +73 -0
  653. package/docs/content/locales/ar-SA/components.mdx +9 -0
  654. package/docs/content/locales/ar-SA/creating-templates.mdx +2 -0
  655. package/docs/content/locales/ar-SA/sharing.mdx +15 -7
  656. package/docs/content/locales/ar-SA/template-analytics.mdx +6 -0
  657. package/docs/content/locales/ar-SA/template-clips.mdx +7 -0
  658. package/docs/content/locales/ar-SA/tracking.mdx +6 -0
  659. package/docs/content/locales/de-DE/agent-native-toolkit.mdx +77 -0
  660. package/docs/content/locales/de-DE/components.mdx +9 -0
  661. package/docs/content/locales/de-DE/creating-templates.mdx +2 -0
  662. package/docs/content/locales/de-DE/sharing.mdx +15 -7
  663. package/docs/content/locales/de-DE/template-analytics.mdx +6 -0
  664. package/docs/content/locales/de-DE/template-clips.mdx +7 -0
  665. package/docs/content/locales/de-DE/tracking.mdx +6 -0
  666. package/docs/content/locales/es-ES/agent-native-toolkit.mdx +77 -0
  667. package/docs/content/locales/es-ES/components.mdx +9 -0
  668. package/docs/content/locales/es-ES/creating-templates.mdx +2 -0
  669. package/docs/content/locales/es-ES/sharing.mdx +15 -7
  670. package/docs/content/locales/es-ES/template-analytics.mdx +6 -0
  671. package/docs/content/locales/es-ES/template-clips.mdx +7 -0
  672. package/docs/content/locales/es-ES/tracking.mdx +6 -0
  673. package/docs/content/locales/fr-FR/agent-native-toolkit.mdx +79 -0
  674. package/docs/content/locales/fr-FR/components.mdx +9 -0
  675. package/docs/content/locales/fr-FR/creating-templates.mdx +2 -0
  676. package/docs/content/locales/fr-FR/sharing.mdx +15 -7
  677. package/docs/content/locales/fr-FR/template-analytics.mdx +6 -0
  678. package/docs/content/locales/fr-FR/template-clips.mdx +7 -0
  679. package/docs/content/locales/fr-FR/tracking.mdx +6 -0
  680. package/docs/content/locales/hi-IN/agent-native-toolkit.mdx +74 -0
  681. package/docs/content/locales/hi-IN/components.mdx +9 -0
  682. package/docs/content/locales/hi-IN/creating-templates.mdx +2 -0
  683. package/docs/content/locales/hi-IN/sharing.mdx +15 -7
  684. package/docs/content/locales/hi-IN/template-analytics.mdx +6 -0
  685. package/docs/content/locales/hi-IN/template-clips.mdx +7 -0
  686. package/docs/content/locales/hi-IN/tracking.mdx +6 -0
  687. package/docs/content/locales/ja-JP/agent-native-toolkit.mdx +67 -0
  688. package/docs/content/locales/ja-JP/components.mdx +9 -0
  689. package/docs/content/locales/ja-JP/creating-templates.mdx +2 -0
  690. package/docs/content/locales/ja-JP/sharing.mdx +15 -7
  691. package/docs/content/locales/ja-JP/template-analytics.mdx +6 -0
  692. package/docs/content/locales/ja-JP/template-clips.mdx +7 -0
  693. package/docs/content/locales/ja-JP/tracking.mdx +6 -0
  694. package/docs/content/locales/ko-KR/agent-native-toolkit.mdx +63 -0
  695. package/docs/content/locales/ko-KR/components.mdx +9 -0
  696. package/docs/content/locales/ko-KR/creating-templates.mdx +2 -0
  697. package/docs/content/locales/ko-KR/sharing.mdx +15 -7
  698. package/docs/content/locales/ko-KR/template-analytics.mdx +6 -0
  699. package/docs/content/locales/ko-KR/template-clips.mdx +7 -0
  700. package/docs/content/locales/ko-KR/tracking.mdx +6 -0
  701. package/docs/content/locales/pt-BR/agent-native-toolkit.mdx +77 -0
  702. package/docs/content/locales/pt-BR/components.mdx +9 -0
  703. package/docs/content/locales/pt-BR/creating-templates.mdx +2 -0
  704. package/docs/content/locales/pt-BR/sharing.mdx +15 -7
  705. package/docs/content/locales/pt-BR/template-analytics.mdx +6 -0
  706. package/docs/content/locales/pt-BR/template-clips.mdx +7 -0
  707. package/docs/content/locales/pt-BR/tracking.mdx +6 -0
  708. package/docs/content/locales/zh-CN/agent-native-toolkit.mdx +61 -0
  709. package/docs/content/locales/zh-CN/components.mdx +9 -0
  710. package/docs/content/locales/zh-CN/creating-templates.mdx +2 -0
  711. package/docs/content/locales/zh-CN/sharing.mdx +15 -7
  712. package/docs/content/locales/zh-CN/template-analytics.mdx +6 -0
  713. package/docs/content/locales/zh-CN/template-clips.mdx +7 -0
  714. package/docs/content/locales/zh-CN/tracking.mdx +6 -0
  715. package/docs/content/locales/zh-TW/agent-native-toolkit.mdx +61 -0
  716. package/docs/content/locales/zh-TW/components.mdx +9 -0
  717. package/docs/content/locales/zh-TW/creating-templates.mdx +2 -0
  718. package/docs/content/locales/zh-TW/sharing.mdx +15 -7
  719. package/docs/content/locales/zh-TW/template-analytics.mdx +6 -0
  720. package/docs/content/locales/zh-TW/template-clips.mdx +7 -0
  721. package/docs/content/locales/zh-TW/tracking.mdx +6 -0
  722. package/docs/content/sharing.mdx +39 -7
  723. package/docs/content/template-analytics.mdx +6 -0
  724. package/docs/content/template-clips.mdx +7 -0
  725. package/docs/content/tracking.mdx +6 -0
  726. package/package.json +10 -2
  727. package/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +92 -0
  728. package/corpus/templates/analytics/app/components/ui/accordion.tsx +0 -56
  729. package/corpus/templates/analytics/app/components/ui/alert-dialog.tsx +0 -139
  730. package/corpus/templates/analytics/app/components/ui/alert.tsx +0 -59
  731. package/corpus/templates/analytics/app/components/ui/aspect-ratio.tsx +0 -5
  732. package/corpus/templates/analytics/app/components/ui/avatar.tsx +0 -48
  733. package/corpus/templates/analytics/app/components/ui/badge.tsx +0 -37
  734. package/corpus/templates/analytics/app/components/ui/breadcrumb.tsx +0 -115
  735. package/corpus/templates/analytics/app/components/ui/button.tsx +0 -57
  736. package/corpus/templates/analytics/app/components/ui/card.tsx +0 -86
  737. package/corpus/templates/analytics/app/components/ui/carousel.tsx +0 -260
  738. package/corpus/templates/analytics/app/components/ui/checkbox.tsx +0 -28
  739. package/corpus/templates/analytics/app/components/ui/collapsible.tsx +0 -9
  740. package/corpus/templates/analytics/app/components/ui/command.tsx +0 -154
  741. package/corpus/templates/analytics/app/components/ui/context-menu.tsx +0 -202
  742. package/corpus/templates/analytics/app/components/ui/date-picker.tsx +0 -68
  743. package/corpus/templates/analytics/app/components/ui/dialog.tsx +0 -130
  744. package/corpus/templates/analytics/app/components/ui/drawer.tsx +0 -116
  745. package/corpus/templates/analytics/app/components/ui/dropdown-menu.tsx +0 -212
  746. package/corpus/templates/analytics/app/components/ui/form.tsx +0 -177
  747. package/corpus/templates/analytics/app/components/ui/hover-card.tsx +0 -27
  748. package/corpus/templates/analytics/app/components/ui/input-otp.tsx +0 -69
  749. package/corpus/templates/analytics/app/components/ui/input.tsx +0 -22
  750. package/corpus/templates/analytics/app/components/ui/label.tsx +0 -24
  751. package/corpus/templates/analytics/app/components/ui/menubar.tsx +0 -234
  752. package/corpus/templates/analytics/app/components/ui/navigation-menu.tsx +0 -128
  753. package/corpus/templates/analytics/app/components/ui/pagination.tsx +0 -121
  754. package/corpus/templates/analytics/app/components/ui/popover.tsx +0 -44
  755. package/corpus/templates/analytics/app/components/ui/progress.tsx +0 -26
  756. package/corpus/templates/analytics/app/components/ui/radio-group.tsx +0 -42
  757. package/corpus/templates/analytics/app/components/ui/resizable.tsx +0 -43
  758. package/corpus/templates/analytics/app/components/ui/scroll-area.tsx +0 -46
  759. package/corpus/templates/analytics/app/components/ui/select.tsx +0 -158
  760. package/corpus/templates/analytics/app/components/ui/separator.tsx +0 -29
  761. package/corpus/templates/analytics/app/components/ui/sheet.tsx +0 -160
  762. package/corpus/templates/analytics/app/components/ui/sidebar.tsx +0 -782
  763. package/corpus/templates/analytics/app/components/ui/skeleton.tsx +0 -15
  764. package/corpus/templates/analytics/app/components/ui/slider.tsx +0 -26
  765. package/corpus/templates/analytics/app/components/ui/sonner.tsx +0 -58
  766. package/corpus/templates/analytics/app/components/ui/spinner.tsx +0 -17
  767. package/corpus/templates/analytics/app/components/ui/switch.tsx +0 -27
  768. package/corpus/templates/analytics/app/components/ui/table.tsx +0 -117
  769. package/corpus/templates/analytics/app/components/ui/tabs.tsx +0 -53
  770. package/corpus/templates/analytics/app/components/ui/textarea.tsx +0 -23
  771. package/corpus/templates/analytics/app/components/ui/toast.tsx +0 -127
  772. package/corpus/templates/analytics/app/components/ui/toaster.tsx +0 -33
  773. package/corpus/templates/analytics/app/components/ui/toggle-group.tsx +0 -59
  774. package/corpus/templates/analytics/app/components/ui/toggle.tsx +0 -43
  775. package/corpus/templates/analytics/app/components/ui/tooltip.tsx +0 -30
  776. package/corpus/templates/analytics/app/components/ui/use-toast.ts +0 -3
  777. package/corpus/templates/analytics/app/hooks/use-mobile.tsx +0 -21
  778. package/corpus/templates/analytics/app/hooks/use-toast.ts +0 -188
  779. package/corpus/templates/assets/app/components/layout/HeaderActions.tsx +0 -84
  780. package/corpus/templates/assets/app/components/ui/alert-dialog.tsx +0 -139
  781. package/corpus/templates/assets/app/components/ui/alert.tsx +0 -59
  782. package/corpus/templates/assets/app/components/ui/avatar.tsx +0 -48
  783. package/corpus/templates/assets/app/components/ui/badge.tsx +0 -37
  784. package/corpus/templates/assets/app/components/ui/breadcrumb.tsx +0 -115
  785. package/corpus/templates/assets/app/components/ui/button.tsx +0 -57
  786. package/corpus/templates/assets/app/components/ui/card.tsx +0 -86
  787. package/corpus/templates/assets/app/components/ui/checkbox.tsx +0 -28
  788. package/corpus/templates/assets/app/components/ui/dialog.tsx +0 -130
  789. package/corpus/templates/assets/app/components/ui/dropdown-menu.tsx +0 -212
  790. package/corpus/templates/assets/app/components/ui/hover-card.tsx +0 -27
  791. package/corpus/templates/assets/app/components/ui/input.tsx +0 -22
  792. package/corpus/templates/assets/app/components/ui/label.tsx +0 -24
  793. package/corpus/templates/assets/app/components/ui/pagination.tsx +0 -121
  794. package/corpus/templates/assets/app/components/ui/popover.tsx +0 -44
  795. package/corpus/templates/assets/app/components/ui/progress.tsx +0 -26
  796. package/corpus/templates/assets/app/components/ui/scroll-area.tsx +0 -46
  797. package/corpus/templates/assets/app/components/ui/select.tsx +0 -158
  798. package/corpus/templates/assets/app/components/ui/separator.tsx +0 -29
  799. package/corpus/templates/assets/app/components/ui/sheet.tsx +0 -160
  800. package/corpus/templates/assets/app/components/ui/skeleton.tsx +0 -15
  801. package/corpus/templates/assets/app/components/ui/slider.tsx +0 -26
  802. package/corpus/templates/assets/app/components/ui/sonner.tsx +0 -58
  803. package/corpus/templates/assets/app/components/ui/spinner.tsx +0 -17
  804. package/corpus/templates/assets/app/components/ui/table.tsx +0 -117
  805. package/corpus/templates/assets/app/components/ui/tabs.tsx +0 -53
  806. package/corpus/templates/assets/app/components/ui/tooltip.tsx +0 -30
  807. package/corpus/templates/brain/app/components/ui/badge.tsx +0 -37
  808. package/corpus/templates/brain/app/components/ui/button.tsx +0 -57
  809. package/corpus/templates/brain/app/components/ui/card.tsx +0 -86
  810. package/corpus/templates/brain/app/components/ui/input.tsx +0 -22
  811. package/corpus/templates/brain/app/components/ui/label.tsx +0 -24
  812. package/corpus/templates/brain/app/components/ui/progress.tsx +0 -26
  813. package/corpus/templates/brain/app/components/ui/select.tsx +0 -158
  814. package/corpus/templates/brain/app/components/ui/separator.tsx +0 -29
  815. package/corpus/templates/brain/app/components/ui/sheet.tsx +0 -160
  816. package/corpus/templates/brain/app/components/ui/skeleton.tsx +0 -15
  817. package/corpus/templates/brain/app/components/ui/sonner.tsx +0 -58
  818. package/corpus/templates/brain/app/components/ui/switch.tsx +0 -27
  819. package/corpus/templates/brain/app/components/ui/table.tsx +0 -117
  820. package/corpus/templates/brain/app/components/ui/textarea.tsx +0 -23
  821. package/corpus/templates/brain/app/components/ui/tooltip.tsx +0 -30
  822. package/corpus/templates/calendar/app/components/ui/accordion.tsx +0 -56
  823. package/corpus/templates/calendar/app/components/ui/alert-dialog.tsx +0 -139
  824. package/corpus/templates/calendar/app/components/ui/alert.tsx +0 -59
  825. package/corpus/templates/calendar/app/components/ui/aspect-ratio.tsx +0 -5
  826. package/corpus/templates/calendar/app/components/ui/avatar.tsx +0 -48
  827. package/corpus/templates/calendar/app/components/ui/badge.tsx +0 -37
  828. package/corpus/templates/calendar/app/components/ui/breadcrumb.tsx +0 -115
  829. package/corpus/templates/calendar/app/components/ui/button.tsx +0 -57
  830. package/corpus/templates/calendar/app/components/ui/calendar.tsx +0 -68
  831. package/corpus/templates/calendar/app/components/ui/card.tsx +0 -86
  832. package/corpus/templates/calendar/app/components/ui/carousel.tsx +0 -260
  833. package/corpus/templates/calendar/app/components/ui/chart.tsx +0 -375
  834. package/corpus/templates/calendar/app/components/ui/checkbox.tsx +0 -28
  835. package/corpus/templates/calendar/app/components/ui/collapsible.tsx +0 -9
  836. package/corpus/templates/calendar/app/components/ui/command.tsx +0 -154
  837. package/corpus/templates/calendar/app/components/ui/context-menu.tsx +0 -202
  838. package/corpus/templates/calendar/app/components/ui/dialog.tsx +0 -130
  839. package/corpus/templates/calendar/app/components/ui/drawer.tsx +0 -116
  840. package/corpus/templates/calendar/app/components/ui/dropdown-menu.tsx +0 -212
  841. package/corpus/templates/calendar/app/components/ui/form.tsx +0 -177
  842. package/corpus/templates/calendar/app/components/ui/hover-card.tsx +0 -27
  843. package/corpus/templates/calendar/app/components/ui/input-otp.tsx +0 -69
  844. package/corpus/templates/calendar/app/components/ui/input.tsx +0 -22
  845. package/corpus/templates/calendar/app/components/ui/label.tsx +0 -24
  846. package/corpus/templates/calendar/app/components/ui/menubar.tsx +0 -234
  847. package/corpus/templates/calendar/app/components/ui/navigation-menu.tsx +0 -128
  848. package/corpus/templates/calendar/app/components/ui/pagination.tsx +0 -121
  849. package/corpus/templates/calendar/app/components/ui/popover.tsx +0 -44
  850. package/corpus/templates/calendar/app/components/ui/progress.tsx +0 -26
  851. package/corpus/templates/calendar/app/components/ui/radio-group.tsx +0 -42
  852. package/corpus/templates/calendar/app/components/ui/resizable.tsx +0 -43
  853. package/corpus/templates/calendar/app/components/ui/scroll-area.tsx +0 -46
  854. package/corpus/templates/calendar/app/components/ui/select.tsx +0 -158
  855. package/corpus/templates/calendar/app/components/ui/separator.tsx +0 -29
  856. package/corpus/templates/calendar/app/components/ui/sheet.tsx +0 -160
  857. package/corpus/templates/calendar/app/components/ui/sidebar.tsx +0 -782
  858. package/corpus/templates/calendar/app/components/ui/skeleton.tsx +0 -15
  859. package/corpus/templates/calendar/app/components/ui/slider.tsx +0 -26
  860. package/corpus/templates/calendar/app/components/ui/spinner.tsx +0 -17
  861. package/corpus/templates/calendar/app/components/ui/switch.tsx +0 -27
  862. package/corpus/templates/calendar/app/components/ui/table.tsx +0 -117
  863. package/corpus/templates/calendar/app/components/ui/tabs.tsx +0 -53
  864. package/corpus/templates/calendar/app/components/ui/textarea.tsx +0 -23
  865. package/corpus/templates/calendar/app/components/ui/toast.tsx +0 -127
  866. package/corpus/templates/calendar/app/components/ui/toaster.tsx +0 -33
  867. package/corpus/templates/calendar/app/components/ui/toggle-group.tsx +0 -59
  868. package/corpus/templates/calendar/app/components/ui/toggle.tsx +0 -43
  869. package/corpus/templates/calendar/app/components/ui/tooltip.tsx +0 -30
  870. package/corpus/templates/calendar/app/components/ui/use-toast.ts +0 -3
  871. package/corpus/templates/calendar/app/hooks/use-mobile.tsx +0 -21
  872. package/corpus/templates/calendar/app/hooks/use-toast.ts +0 -188
  873. package/corpus/templates/chat/app/components/layout/HeaderActions.tsx +0 -84
  874. package/corpus/templates/chat/app/components/ui/accordion.tsx +0 -56
  875. package/corpus/templates/chat/app/components/ui/alert-dialog.tsx +0 -139
  876. package/corpus/templates/chat/app/components/ui/alert.tsx +0 -59
  877. package/corpus/templates/chat/app/components/ui/aspect-ratio.tsx +0 -5
  878. package/corpus/templates/chat/app/components/ui/avatar.tsx +0 -48
  879. package/corpus/templates/chat/app/components/ui/badge.tsx +0 -37
  880. package/corpus/templates/chat/app/components/ui/breadcrumb.tsx +0 -115
  881. package/corpus/templates/chat/app/components/ui/button.tsx +0 -57
  882. package/corpus/templates/chat/app/components/ui/calendar.tsx +0 -68
  883. package/corpus/templates/chat/app/components/ui/card.tsx +0 -86
  884. package/corpus/templates/chat/app/components/ui/carousel.tsx +0 -260
  885. package/corpus/templates/chat/app/components/ui/chart.tsx +0 -375
  886. package/corpus/templates/chat/app/components/ui/checkbox.tsx +0 -28
  887. package/corpus/templates/chat/app/components/ui/collapsible.tsx +0 -9
  888. package/corpus/templates/chat/app/components/ui/command.tsx +0 -154
  889. package/corpus/templates/chat/app/components/ui/context-menu.tsx +0 -202
  890. package/corpus/templates/chat/app/components/ui/dialog.tsx +0 -130
  891. package/corpus/templates/chat/app/components/ui/drawer.tsx +0 -116
  892. package/corpus/templates/chat/app/components/ui/dropdown-menu.tsx +0 -212
  893. package/corpus/templates/chat/app/components/ui/form.tsx +0 -177
  894. package/corpus/templates/chat/app/components/ui/hover-card.tsx +0 -27
  895. package/corpus/templates/chat/app/components/ui/input-otp.tsx +0 -69
  896. package/corpus/templates/chat/app/components/ui/input.tsx +0 -22
  897. package/corpus/templates/chat/app/components/ui/label.tsx +0 -24
  898. package/corpus/templates/chat/app/components/ui/menubar.tsx +0 -234
  899. package/corpus/templates/chat/app/components/ui/navigation-menu.tsx +0 -128
  900. package/corpus/templates/chat/app/components/ui/pagination.tsx +0 -121
  901. package/corpus/templates/chat/app/components/ui/popover.tsx +0 -44
  902. package/corpus/templates/chat/app/components/ui/progress.tsx +0 -26
  903. package/corpus/templates/chat/app/components/ui/radio-group.tsx +0 -42
  904. package/corpus/templates/chat/app/components/ui/resizable.tsx +0 -43
  905. package/corpus/templates/chat/app/components/ui/scroll-area.tsx +0 -46
  906. package/corpus/templates/chat/app/components/ui/select.tsx +0 -158
  907. package/corpus/templates/chat/app/components/ui/separator.tsx +0 -29
  908. package/corpus/templates/chat/app/components/ui/sheet.tsx +0 -160
  909. package/corpus/templates/chat/app/components/ui/sidebar.tsx +0 -782
  910. package/corpus/templates/chat/app/components/ui/skeleton.tsx +0 -15
  911. package/corpus/templates/chat/app/components/ui/slider.tsx +0 -26
  912. package/corpus/templates/chat/app/components/ui/sonner.tsx +0 -58
  913. package/corpus/templates/chat/app/components/ui/spinner.tsx +0 -17
  914. package/corpus/templates/chat/app/components/ui/switch.tsx +0 -27
  915. package/corpus/templates/chat/app/components/ui/table.tsx +0 -117
  916. package/corpus/templates/chat/app/components/ui/tabs.tsx +0 -53
  917. package/corpus/templates/chat/app/components/ui/textarea.tsx +0 -23
  918. package/corpus/templates/chat/app/components/ui/toast.tsx +0 -127
  919. package/corpus/templates/chat/app/components/ui/toaster.tsx +0 -33
  920. package/corpus/templates/chat/app/components/ui/toggle-group.tsx +0 -59
  921. package/corpus/templates/chat/app/components/ui/toggle.tsx +0 -43
  922. package/corpus/templates/chat/app/components/ui/tooltip.tsx +0 -30
  923. package/corpus/templates/chat/app/components/ui/use-toast.ts +0 -3
  924. package/corpus/templates/chat/app/hooks/use-mobile.tsx +0 -21
  925. package/corpus/templates/chat/app/hooks/use-toast.ts +0 -188
  926. package/corpus/templates/clips/app/components/layout/HeaderActions.tsx +0 -84
  927. package/corpus/templates/clips/app/components/ui/accordion.tsx +0 -56
  928. package/corpus/templates/clips/app/components/ui/alert-dialog.tsx +0 -139
  929. package/corpus/templates/clips/app/components/ui/alert.tsx +0 -59
  930. package/corpus/templates/clips/app/components/ui/aspect-ratio.tsx +0 -5
  931. package/corpus/templates/clips/app/components/ui/avatar.tsx +0 -48
  932. package/corpus/templates/clips/app/components/ui/badge.tsx +0 -37
  933. package/corpus/templates/clips/app/components/ui/breadcrumb.tsx +0 -115
  934. package/corpus/templates/clips/app/components/ui/button.tsx +0 -57
  935. package/corpus/templates/clips/app/components/ui/calendar.tsx +0 -68
  936. package/corpus/templates/clips/app/components/ui/card.tsx +0 -86
  937. package/corpus/templates/clips/app/components/ui/carousel.tsx +0 -260
  938. package/corpus/templates/clips/app/components/ui/chart.tsx +0 -375
  939. package/corpus/templates/clips/app/components/ui/checkbox.tsx +0 -28
  940. package/corpus/templates/clips/app/components/ui/collapsible.tsx +0 -9
  941. package/corpus/templates/clips/app/components/ui/command.tsx +0 -154
  942. package/corpus/templates/clips/app/components/ui/context-menu.tsx +0 -202
  943. package/corpus/templates/clips/app/components/ui/dialog.tsx +0 -130
  944. package/corpus/templates/clips/app/components/ui/drawer.tsx +0 -116
  945. package/corpus/templates/clips/app/components/ui/dropdown-menu.tsx +0 -212
  946. package/corpus/templates/clips/app/components/ui/form.tsx +0 -177
  947. package/corpus/templates/clips/app/components/ui/hover-card.tsx +0 -27
  948. package/corpus/templates/clips/app/components/ui/input-otp.tsx +0 -69
  949. package/corpus/templates/clips/app/components/ui/input.tsx +0 -22
  950. package/corpus/templates/clips/app/components/ui/label.tsx +0 -24
  951. package/corpus/templates/clips/app/components/ui/menubar.tsx +0 -234
  952. package/corpus/templates/clips/app/components/ui/navigation-menu.tsx +0 -128
  953. package/corpus/templates/clips/app/components/ui/pagination.tsx +0 -121
  954. package/corpus/templates/clips/app/components/ui/popover.tsx +0 -44
  955. package/corpus/templates/clips/app/components/ui/progress.tsx +0 -26
  956. package/corpus/templates/clips/app/components/ui/radio-group.tsx +0 -42
  957. package/corpus/templates/clips/app/components/ui/resizable.tsx +0 -43
  958. package/corpus/templates/clips/app/components/ui/scroll-area.tsx +0 -46
  959. package/corpus/templates/clips/app/components/ui/select.tsx +0 -158
  960. package/corpus/templates/clips/app/components/ui/separator.tsx +0 -29
  961. package/corpus/templates/clips/app/components/ui/sheet.tsx +0 -160
  962. package/corpus/templates/clips/app/components/ui/sidebar.tsx +0 -782
  963. package/corpus/templates/clips/app/components/ui/skeleton.tsx +0 -15
  964. package/corpus/templates/clips/app/components/ui/slider.tsx +0 -26
  965. package/corpus/templates/clips/app/components/ui/sonner.tsx +0 -58
  966. package/corpus/templates/clips/app/components/ui/spinner.tsx +0 -17
  967. package/corpus/templates/clips/app/components/ui/switch.tsx +0 -27
  968. package/corpus/templates/clips/app/components/ui/table.tsx +0 -117
  969. package/corpus/templates/clips/app/components/ui/tabs.tsx +0 -53
  970. package/corpus/templates/clips/app/components/ui/textarea.tsx +0 -23
  971. package/corpus/templates/clips/app/components/ui/toast.tsx +0 -127
  972. package/corpus/templates/clips/app/components/ui/toaster.tsx +0 -33
  973. package/corpus/templates/clips/app/components/ui/toggle-group.tsx +0 -59
  974. package/corpus/templates/clips/app/components/ui/toggle.tsx +0 -43
  975. package/corpus/templates/clips/app/components/ui/tooltip.tsx +0 -30
  976. package/corpus/templates/clips/app/components/ui/use-toast.ts +0 -3
  977. package/corpus/templates/clips/app/hooks/use-mobile.tsx +0 -21
  978. package/corpus/templates/clips/app/hooks/use-toast.ts +0 -188
  979. package/corpus/templates/content/app/components/layout/HeaderActions.tsx +0 -84
  980. package/corpus/templates/content/app/components/ui/alert-dialog.tsx +0 -139
  981. package/corpus/templates/content/app/components/ui/button.tsx +0 -57
  982. package/corpus/templates/content/app/components/ui/dialog.tsx +0 -130
  983. package/corpus/templates/content/app/components/ui/dropdown-menu.tsx +0 -212
  984. package/corpus/templates/content/app/components/ui/input.tsx +0 -22
  985. package/corpus/templates/content/app/components/ui/label.tsx +0 -24
  986. package/corpus/templates/content/app/components/ui/popover.tsx +0 -44
  987. package/corpus/templates/content/app/components/ui/separator.tsx +0 -29
  988. package/corpus/templates/content/app/components/ui/sheet.tsx +0 -160
  989. package/corpus/templates/content/app/components/ui/skeleton.tsx +0 -15
  990. package/corpus/templates/content/app/components/ui/sonner.tsx +0 -58
  991. package/corpus/templates/content/app/components/ui/spinner.tsx +0 -17
  992. package/corpus/templates/content/app/components/ui/table.tsx +0 -117
  993. package/corpus/templates/content/app/components/ui/toast.tsx +0 -127
  994. package/corpus/templates/content/app/components/ui/toaster.tsx +0 -33
  995. package/corpus/templates/content/app/components/ui/toggle.tsx +0 -43
  996. package/corpus/templates/content/app/components/ui/tooltip.tsx +0 -30
  997. package/corpus/templates/content/app/components/ui/use-toast.ts +0 -3
  998. package/corpus/templates/content/app/hooks/use-mobile.tsx +0 -21
  999. package/corpus/templates/content/app/hooks/use-toast.ts +0 -188
  1000. package/corpus/templates/design/app/components/layout/HeaderActions.tsx +0 -84
  1001. package/corpus/templates/design/app/components/ui/accordion.tsx +0 -56
  1002. package/corpus/templates/design/app/components/ui/alert-dialog.tsx +0 -139
  1003. package/corpus/templates/design/app/components/ui/alert.tsx +0 -59
  1004. package/corpus/templates/design/app/components/ui/aspect-ratio.tsx +0 -5
  1005. package/corpus/templates/design/app/components/ui/avatar.tsx +0 -48
  1006. package/corpus/templates/design/app/components/ui/badge.tsx +0 -37
  1007. package/corpus/templates/design/app/components/ui/breadcrumb.tsx +0 -115
  1008. package/corpus/templates/design/app/components/ui/button.tsx +0 -57
  1009. package/corpus/templates/design/app/components/ui/calendar.tsx +0 -68
  1010. package/corpus/templates/design/app/components/ui/card.tsx +0 -86
  1011. package/corpus/templates/design/app/components/ui/carousel.tsx +0 -260
  1012. package/corpus/templates/design/app/components/ui/chart.tsx +0 -375
  1013. package/corpus/templates/design/app/components/ui/checkbox.tsx +0 -28
  1014. package/corpus/templates/design/app/components/ui/collapsible.tsx +0 -9
  1015. package/corpus/templates/design/app/components/ui/command.tsx +0 -154
  1016. package/corpus/templates/design/app/components/ui/context-menu.tsx +0 -202
  1017. package/corpus/templates/design/app/components/ui/dialog.tsx +0 -130
  1018. package/corpus/templates/design/app/components/ui/drawer.tsx +0 -116
  1019. package/corpus/templates/design/app/components/ui/dropdown-menu.tsx +0 -212
  1020. package/corpus/templates/design/app/components/ui/form.tsx +0 -177
  1021. package/corpus/templates/design/app/components/ui/hover-card.tsx +0 -27
  1022. package/corpus/templates/design/app/components/ui/input-otp.tsx +0 -69
  1023. package/corpus/templates/design/app/components/ui/input.tsx +0 -22
  1024. package/corpus/templates/design/app/components/ui/label.tsx +0 -24
  1025. package/corpus/templates/design/app/components/ui/menubar.tsx +0 -234
  1026. package/corpus/templates/design/app/components/ui/navigation-menu.tsx +0 -128
  1027. package/corpus/templates/design/app/components/ui/pagination.tsx +0 -121
  1028. package/corpus/templates/design/app/components/ui/popover.tsx +0 -44
  1029. package/corpus/templates/design/app/components/ui/progress.tsx +0 -26
  1030. package/corpus/templates/design/app/components/ui/radio-group.tsx +0 -42
  1031. package/corpus/templates/design/app/components/ui/resizable.tsx +0 -43
  1032. package/corpus/templates/design/app/components/ui/scroll-area.tsx +0 -46
  1033. package/corpus/templates/design/app/components/ui/select.tsx +0 -158
  1034. package/corpus/templates/design/app/components/ui/separator.tsx +0 -29
  1035. package/corpus/templates/design/app/components/ui/sheet.tsx +0 -160
  1036. package/corpus/templates/design/app/components/ui/sidebar.tsx +0 -782
  1037. package/corpus/templates/design/app/components/ui/skeleton.tsx +0 -15
  1038. package/corpus/templates/design/app/components/ui/slider.tsx +0 -26
  1039. package/corpus/templates/design/app/components/ui/sonner.tsx +0 -58
  1040. package/corpus/templates/design/app/components/ui/spinner.tsx +0 -17
  1041. package/corpus/templates/design/app/components/ui/switch.tsx +0 -27
  1042. package/corpus/templates/design/app/components/ui/table.tsx +0 -117
  1043. package/corpus/templates/design/app/components/ui/tabs.tsx +0 -53
  1044. package/corpus/templates/design/app/components/ui/textarea.tsx +0 -23
  1045. package/corpus/templates/design/app/components/ui/toast.tsx +0 -127
  1046. package/corpus/templates/design/app/components/ui/toaster.tsx +0 -33
  1047. package/corpus/templates/design/app/components/ui/toggle-group.tsx +0 -59
  1048. package/corpus/templates/design/app/components/ui/toggle.tsx +0 -43
  1049. package/corpus/templates/design/app/components/ui/tooltip.tsx +0 -30
  1050. package/corpus/templates/design/app/components/ui/use-toast.ts +0 -3
  1051. package/corpus/templates/design/app/hooks/use-mobile.tsx +0 -21
  1052. package/corpus/templates/design/app/hooks/use-toast.ts +0 -188
  1053. package/corpus/templates/forms/app/components/layout/HeaderActions.tsx +0 -84
  1054. package/corpus/templates/forms/app/components/ui/accordion.tsx +0 -56
  1055. package/corpus/templates/forms/app/components/ui/alert-dialog.tsx +0 -139
  1056. package/corpus/templates/forms/app/components/ui/alert.tsx +0 -59
  1057. package/corpus/templates/forms/app/components/ui/aspect-ratio.tsx +0 -5
  1058. package/corpus/templates/forms/app/components/ui/avatar.tsx +0 -48
  1059. package/corpus/templates/forms/app/components/ui/badge.tsx +0 -37
  1060. package/corpus/templates/forms/app/components/ui/breadcrumb.tsx +0 -115
  1061. package/corpus/templates/forms/app/components/ui/button.tsx +0 -57
  1062. package/corpus/templates/forms/app/components/ui/card.tsx +0 -86
  1063. package/corpus/templates/forms/app/components/ui/carousel.tsx +0 -260
  1064. package/corpus/templates/forms/app/components/ui/checkbox.tsx +0 -28
  1065. package/corpus/templates/forms/app/components/ui/collapsible.tsx +0 -9
  1066. package/corpus/templates/forms/app/components/ui/dialog.tsx +0 -130
  1067. package/corpus/templates/forms/app/components/ui/drawer.tsx +0 -116
  1068. package/corpus/templates/forms/app/components/ui/dropdown-menu.tsx +0 -212
  1069. package/corpus/templates/forms/app/components/ui/form.tsx +0 -177
  1070. package/corpus/templates/forms/app/components/ui/hover-card.tsx +0 -27
  1071. package/corpus/templates/forms/app/components/ui/input-otp.tsx +0 -69
  1072. package/corpus/templates/forms/app/components/ui/input.tsx +0 -22
  1073. package/corpus/templates/forms/app/components/ui/label.tsx +0 -24
  1074. package/corpus/templates/forms/app/components/ui/navigation-menu.tsx +0 -128
  1075. package/corpus/templates/forms/app/components/ui/pagination.tsx +0 -121
  1076. package/corpus/templates/forms/app/components/ui/popover.tsx +0 -44
  1077. package/corpus/templates/forms/app/components/ui/progress.tsx +0 -26
  1078. package/corpus/templates/forms/app/components/ui/radio-group.tsx +0 -42
  1079. package/corpus/templates/forms/app/components/ui/resizable.tsx +0 -43
  1080. package/corpus/templates/forms/app/components/ui/scroll-area.tsx +0 -46
  1081. package/corpus/templates/forms/app/components/ui/select.tsx +0 -158
  1082. package/corpus/templates/forms/app/components/ui/separator.tsx +0 -29
  1083. package/corpus/templates/forms/app/components/ui/sheet.tsx +0 -160
  1084. package/corpus/templates/forms/app/components/ui/sidebar.tsx +0 -782
  1085. package/corpus/templates/forms/app/components/ui/skeleton.tsx +0 -15
  1086. package/corpus/templates/forms/app/components/ui/slider.tsx +0 -26
  1087. package/corpus/templates/forms/app/components/ui/sonner.tsx +0 -58
  1088. package/corpus/templates/forms/app/components/ui/spinner.tsx +0 -17
  1089. package/corpus/templates/forms/app/components/ui/switch.tsx +0 -27
  1090. package/corpus/templates/forms/app/components/ui/table.tsx +0 -117
  1091. package/corpus/templates/forms/app/components/ui/tabs.tsx +0 -53
  1092. package/corpus/templates/forms/app/components/ui/textarea.tsx +0 -23
  1093. package/corpus/templates/forms/app/components/ui/toast.tsx +0 -127
  1094. package/corpus/templates/forms/app/components/ui/toaster.tsx +0 -33
  1095. package/corpus/templates/forms/app/components/ui/toggle-group.tsx +0 -59
  1096. package/corpus/templates/forms/app/components/ui/toggle.tsx +0 -43
  1097. package/corpus/templates/forms/app/components/ui/tooltip.tsx +0 -30
  1098. package/corpus/templates/forms/app/hooks/use-mobile.tsx +0 -21
  1099. package/corpus/templates/forms/app/hooks/use-toast.ts +0 -188
  1100. package/corpus/templates/macros/app/components/layout/HeaderActions.tsx +0 -84
  1101. package/corpus/templates/macros/app/components/ui/accordion.tsx +0 -56
  1102. package/corpus/templates/macros/app/components/ui/alert-dialog.tsx +0 -139
  1103. package/corpus/templates/macros/app/components/ui/alert.tsx +0 -59
  1104. package/corpus/templates/macros/app/components/ui/aspect-ratio.tsx +0 -5
  1105. package/corpus/templates/macros/app/components/ui/avatar.tsx +0 -48
  1106. package/corpus/templates/macros/app/components/ui/badge.tsx +0 -37
  1107. package/corpus/templates/macros/app/components/ui/breadcrumb.tsx +0 -115
  1108. package/corpus/templates/macros/app/components/ui/chart.tsx +0 -375
  1109. package/corpus/templates/macros/app/components/ui/checkbox.tsx +0 -28
  1110. package/corpus/templates/macros/app/components/ui/collapsible.tsx +0 -9
  1111. package/corpus/templates/macros/app/components/ui/command.tsx +0 -154
  1112. package/corpus/templates/macros/app/components/ui/context-menu.tsx +0 -202
  1113. package/corpus/templates/macros/app/components/ui/drawer.tsx +0 -116
  1114. package/corpus/templates/macros/app/components/ui/dropdown-menu.tsx +0 -212
  1115. package/corpus/templates/macros/app/components/ui/form.tsx +0 -177
  1116. package/corpus/templates/macros/app/components/ui/hover-card.tsx +0 -27
  1117. package/corpus/templates/macros/app/components/ui/label.tsx +0 -24
  1118. package/corpus/templates/macros/app/components/ui/logo.tsx +0 -36
  1119. package/corpus/templates/macros/app/components/ui/navigation-menu.tsx +0 -128
  1120. package/corpus/templates/macros/app/components/ui/pagination.tsx +0 -121
  1121. package/corpus/templates/macros/app/components/ui/popover.tsx +0 -44
  1122. package/corpus/templates/macros/app/components/ui/radio-group.tsx +0 -42
  1123. package/corpus/templates/macros/app/components/ui/scroll-area.tsx +0 -46
  1124. package/corpus/templates/macros/app/components/ui/select.tsx +0 -158
  1125. package/corpus/templates/macros/app/components/ui/separator.tsx +0 -29
  1126. package/corpus/templates/macros/app/components/ui/sheet.tsx +0 -160
  1127. package/corpus/templates/macros/app/components/ui/skeleton.tsx +0 -15
  1128. package/corpus/templates/macros/app/components/ui/slider.tsx +0 -26
  1129. package/corpus/templates/macros/app/components/ui/sonner.tsx +0 -58
  1130. package/corpus/templates/macros/app/components/ui/switch.tsx +0 -27
  1131. package/corpus/templates/macros/app/components/ui/table.tsx +0 -117
  1132. package/corpus/templates/macros/app/components/ui/toast.tsx +0 -127
  1133. package/corpus/templates/macros/app/components/ui/toggle-group.tsx +0 -59
  1134. package/corpus/templates/macros/app/components/ui/toggle.tsx +0 -43
  1135. package/corpus/templates/macros/app/components/ui/tooltip.tsx +0 -30
  1136. package/corpus/templates/mail/app/components/ui/accordion.tsx +0 -56
  1137. package/corpus/templates/mail/app/components/ui/alert-dialog.tsx +0 -139
  1138. package/corpus/templates/mail/app/components/ui/alert.tsx +0 -59
  1139. package/corpus/templates/mail/app/components/ui/aspect-ratio.tsx +0 -5
  1140. package/corpus/templates/mail/app/components/ui/avatar.tsx +0 -48
  1141. package/corpus/templates/mail/app/components/ui/badge.tsx +0 -37
  1142. package/corpus/templates/mail/app/components/ui/breadcrumb.tsx +0 -115
  1143. package/corpus/templates/mail/app/components/ui/button.tsx +0 -57
  1144. package/corpus/templates/mail/app/components/ui/card.tsx +0 -86
  1145. package/corpus/templates/mail/app/components/ui/carousel.tsx +0 -260
  1146. package/corpus/templates/mail/app/components/ui/checkbox.tsx +0 -28
  1147. package/corpus/templates/mail/app/components/ui/collapsible.tsx +0 -9
  1148. package/corpus/templates/mail/app/components/ui/dialog.tsx +0 -130
  1149. package/corpus/templates/mail/app/components/ui/drawer.tsx +0 -116
  1150. package/corpus/templates/mail/app/components/ui/dropdown-menu.tsx +0 -212
  1151. package/corpus/templates/mail/app/components/ui/form.tsx +0 -177
  1152. package/corpus/templates/mail/app/components/ui/hover-card.tsx +0 -27
  1153. package/corpus/templates/mail/app/components/ui/input-otp.tsx +0 -69
  1154. package/corpus/templates/mail/app/components/ui/label.tsx +0 -24
  1155. package/corpus/templates/mail/app/components/ui/navigation-menu.tsx +0 -128
  1156. package/corpus/templates/mail/app/components/ui/pagination.tsx +0 -121
  1157. package/corpus/templates/mail/app/components/ui/popover.tsx +0 -44
  1158. package/corpus/templates/mail/app/components/ui/progress.tsx +0 -26
  1159. package/corpus/templates/mail/app/components/ui/radio-group.tsx +0 -42
  1160. package/corpus/templates/mail/app/components/ui/resizable.tsx +0 -43
  1161. package/corpus/templates/mail/app/components/ui/scroll-area.tsx +0 -46
  1162. package/corpus/templates/mail/app/components/ui/select.tsx +0 -158
  1163. package/corpus/templates/mail/app/components/ui/separator.tsx +0 -29
  1164. package/corpus/templates/mail/app/components/ui/sheet.tsx +0 -160
  1165. package/corpus/templates/mail/app/components/ui/sidebar.tsx +0 -782
  1166. package/corpus/templates/mail/app/components/ui/skeleton.tsx +0 -15
  1167. package/corpus/templates/mail/app/components/ui/slider.tsx +0 -26
  1168. package/corpus/templates/mail/app/components/ui/spinner.tsx +0 -17
  1169. package/corpus/templates/mail/app/components/ui/switch.tsx +0 -27
  1170. package/corpus/templates/mail/app/components/ui/table.tsx +0 -117
  1171. package/corpus/templates/mail/app/components/ui/tabs.tsx +0 -53
  1172. package/corpus/templates/mail/app/components/ui/toast.tsx +0 -127
  1173. package/corpus/templates/mail/app/components/ui/toaster.tsx +0 -33
  1174. package/corpus/templates/mail/app/components/ui/toggle-group.tsx +0 -59
  1175. package/corpus/templates/mail/app/components/ui/toggle.tsx +0 -43
  1176. package/corpus/templates/mail/app/components/ui/tooltip.tsx +0 -30
  1177. package/corpus/templates/mail/app/hooks/use-toast.ts +0 -188
  1178. package/corpus/templates/plan/app/components/layout/HeaderActions.tsx +0 -84
  1179. package/corpus/templates/plan/app/components/ui/accordion.tsx +0 -56
  1180. package/corpus/templates/plan/app/components/ui/alert-dialog.tsx +0 -139
  1181. package/corpus/templates/plan/app/components/ui/alert.tsx +0 -59
  1182. package/corpus/templates/plan/app/components/ui/aspect-ratio.tsx +0 -5
  1183. package/corpus/templates/plan/app/components/ui/avatar.tsx +0 -48
  1184. package/corpus/templates/plan/app/components/ui/badge.tsx +0 -37
  1185. package/corpus/templates/plan/app/components/ui/breadcrumb.tsx +0 -115
  1186. package/corpus/templates/plan/app/components/ui/button.tsx +0 -57
  1187. package/corpus/templates/plan/app/components/ui/calendar.tsx +0 -68
  1188. package/corpus/templates/plan/app/components/ui/card.tsx +0 -86
  1189. package/corpus/templates/plan/app/components/ui/carousel.tsx +0 -260
  1190. package/corpus/templates/plan/app/components/ui/chart.tsx +0 -375
  1191. package/corpus/templates/plan/app/components/ui/checkbox.tsx +0 -28
  1192. package/corpus/templates/plan/app/components/ui/collapsible.tsx +0 -9
  1193. package/corpus/templates/plan/app/components/ui/command.tsx +0 -154
  1194. package/corpus/templates/plan/app/components/ui/context-menu.tsx +0 -202
  1195. package/corpus/templates/plan/app/components/ui/dialog.tsx +0 -130
  1196. package/corpus/templates/plan/app/components/ui/drawer.tsx +0 -116
  1197. package/corpus/templates/plan/app/components/ui/dropdown-menu.tsx +0 -212
  1198. package/corpus/templates/plan/app/components/ui/form.tsx +0 -177
  1199. package/corpus/templates/plan/app/components/ui/hover-card.tsx +0 -27
  1200. package/corpus/templates/plan/app/components/ui/input-otp.tsx +0 -69
  1201. package/corpus/templates/plan/app/components/ui/input.tsx +0 -22
  1202. package/corpus/templates/plan/app/components/ui/label.tsx +0 -24
  1203. package/corpus/templates/plan/app/components/ui/menubar.tsx +0 -234
  1204. package/corpus/templates/plan/app/components/ui/navigation-menu.tsx +0 -128
  1205. package/corpus/templates/plan/app/components/ui/pagination.tsx +0 -121
  1206. package/corpus/templates/plan/app/components/ui/popover.tsx +0 -44
  1207. package/corpus/templates/plan/app/components/ui/progress.tsx +0 -26
  1208. package/corpus/templates/plan/app/components/ui/radio-group.tsx +0 -42
  1209. package/corpus/templates/plan/app/components/ui/resizable.tsx +0 -43
  1210. package/corpus/templates/plan/app/components/ui/scroll-area.tsx +0 -46
  1211. package/corpus/templates/plan/app/components/ui/select.tsx +0 -158
  1212. package/corpus/templates/plan/app/components/ui/separator.tsx +0 -29
  1213. package/corpus/templates/plan/app/components/ui/sheet.tsx +0 -160
  1214. package/corpus/templates/plan/app/components/ui/sidebar.tsx +0 -782
  1215. package/corpus/templates/plan/app/components/ui/skeleton.tsx +0 -15
  1216. package/corpus/templates/plan/app/components/ui/slider.tsx +0 -26
  1217. package/corpus/templates/plan/app/components/ui/sonner.tsx +0 -58
  1218. package/corpus/templates/plan/app/components/ui/spinner.tsx +0 -17
  1219. package/corpus/templates/plan/app/components/ui/switch.tsx +0 -27
  1220. package/corpus/templates/plan/app/components/ui/table.tsx +0 -117
  1221. package/corpus/templates/plan/app/components/ui/textarea.tsx +0 -23
  1222. package/corpus/templates/plan/app/components/ui/toast.tsx +0 -127
  1223. package/corpus/templates/plan/app/components/ui/toaster.tsx +0 -33
  1224. package/corpus/templates/plan/app/components/ui/toggle-group.tsx +0 -59
  1225. package/corpus/templates/plan/app/components/ui/toggle.tsx +0 -43
  1226. package/corpus/templates/plan/app/components/ui/tooltip.tsx +0 -30
  1227. package/corpus/templates/plan/app/components/ui/use-toast.ts +0 -3
  1228. package/corpus/templates/plan/app/hooks/use-mobile.tsx +0 -21
  1229. package/corpus/templates/plan/app/hooks/use-toast.ts +0 -188
  1230. package/corpus/templates/slides/app/components/layout/HeaderActions.tsx +0 -84
  1231. package/corpus/templates/slides/app/components/ui/accordion.tsx +0 -56
  1232. package/corpus/templates/slides/app/components/ui/alert-dialog.tsx +0 -139
  1233. package/corpus/templates/slides/app/components/ui/alert.tsx +0 -59
  1234. package/corpus/templates/slides/app/components/ui/aspect-ratio.tsx +0 -5
  1235. package/corpus/templates/slides/app/components/ui/avatar.tsx +0 -48
  1236. package/corpus/templates/slides/app/components/ui/badge.tsx +0 -37
  1237. package/corpus/templates/slides/app/components/ui/breadcrumb.tsx +0 -115
  1238. package/corpus/templates/slides/app/components/ui/button.tsx +0 -57
  1239. package/corpus/templates/slides/app/components/ui/calendar.tsx +0 -68
  1240. package/corpus/templates/slides/app/components/ui/card.tsx +0 -86
  1241. package/corpus/templates/slides/app/components/ui/carousel.tsx +0 -260
  1242. package/corpus/templates/slides/app/components/ui/chart.tsx +0 -375
  1243. package/corpus/templates/slides/app/components/ui/checkbox.tsx +0 -28
  1244. package/corpus/templates/slides/app/components/ui/collapsible.tsx +0 -9
  1245. package/corpus/templates/slides/app/components/ui/command.tsx +0 -154
  1246. package/corpus/templates/slides/app/components/ui/context-menu.tsx +0 -202
  1247. package/corpus/templates/slides/app/components/ui/dialog.tsx +0 -130
  1248. package/corpus/templates/slides/app/components/ui/drawer.tsx +0 -116
  1249. package/corpus/templates/slides/app/components/ui/dropdown-menu.tsx +0 -212
  1250. package/corpus/templates/slides/app/components/ui/form.tsx +0 -177
  1251. package/corpus/templates/slides/app/components/ui/hover-card.tsx +0 -27
  1252. package/corpus/templates/slides/app/components/ui/input-otp.tsx +0 -69
  1253. package/corpus/templates/slides/app/components/ui/input.tsx +0 -22
  1254. package/corpus/templates/slides/app/components/ui/label.tsx +0 -24
  1255. package/corpus/templates/slides/app/components/ui/menubar.tsx +0 -234
  1256. package/corpus/templates/slides/app/components/ui/navigation-menu.tsx +0 -128
  1257. package/corpus/templates/slides/app/components/ui/pagination.tsx +0 -121
  1258. package/corpus/templates/slides/app/components/ui/popover.tsx +0 -44
  1259. package/corpus/templates/slides/app/components/ui/progress.tsx +0 -26
  1260. package/corpus/templates/slides/app/components/ui/radio-group.tsx +0 -42
  1261. package/corpus/templates/slides/app/components/ui/resizable.tsx +0 -43
  1262. package/corpus/templates/slides/app/components/ui/scroll-area.tsx +0 -46
  1263. package/corpus/templates/slides/app/components/ui/select.tsx +0 -158
  1264. package/corpus/templates/slides/app/components/ui/separator.tsx +0 -29
  1265. package/corpus/templates/slides/app/components/ui/sheet.tsx +0 -160
  1266. package/corpus/templates/slides/app/components/ui/sidebar.tsx +0 -782
  1267. package/corpus/templates/slides/app/components/ui/skeleton.tsx +0 -15
  1268. package/corpus/templates/slides/app/components/ui/slider.tsx +0 -26
  1269. package/corpus/templates/slides/app/components/ui/sonner.tsx +0 -58
  1270. package/corpus/templates/slides/app/components/ui/spinner.tsx +0 -17
  1271. package/corpus/templates/slides/app/components/ui/switch.tsx +0 -27
  1272. package/corpus/templates/slides/app/components/ui/table.tsx +0 -117
  1273. package/corpus/templates/slides/app/components/ui/tabs.tsx +0 -53
  1274. package/corpus/templates/slides/app/components/ui/textarea.tsx +0 -23
  1275. package/corpus/templates/slides/app/components/ui/toast.tsx +0 -127
  1276. package/corpus/templates/slides/app/components/ui/toaster.tsx +0 -33
  1277. package/corpus/templates/slides/app/components/ui/toggle-group.tsx +0 -59
  1278. package/corpus/templates/slides/app/components/ui/toggle.tsx +0 -43
  1279. package/corpus/templates/slides/app/components/ui/tooltip.tsx +0 -30
  1280. package/corpus/templates/slides/app/components/ui/use-toast.ts +0 -3
  1281. package/corpus/templates/slides/app/hooks/use-mobile.tsx +0 -21
  1282. package/corpus/templates/slides/app/hooks/use-toast.ts +0 -188
@@ -1 +1 @@
1
- {"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/cli/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAE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gBACnC,CAAC;YACH,CAAC;QACH,CAAC;aAAM,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;YAC/B,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;QAC3C,CAAC;aAAM,CAAC;YACN,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,uBAAuB,CAAC,IAAY,EAAE,OAAgB;IAC7D,IACE,2BAA2B,CAAC,IAAI,CAAC,IAAI,CAAC;QACtC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,EAC5C,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IACE,IAAI,KAAK,cAAc;QACvB,IAAI,KAAK,eAAe;QACxB,IAAI,KAAK,MAAM;QACf,IAAI,KAAK,YAAY;QACrB,IAAI,KAAK,gBAAgB;QACzB,IAAI,KAAK,UAAU;QACnB,IAAI,KAAK,SAAS;QAClB,IAAI,KAAK,YAAY;QACrB,IAAI,KAAK,eAAe;QACxB,IAAI,KAAK,SAAS;QAClB,IAAI,KAAK,OAAO;QAChB,IAAI,KAAK,MAAM;QACf,IAAI,KAAK,cAAc;QACvB,IAAI,KAAK,mBAAmB;QAC5B,IAAI,KAAK,WAAW,EACpB,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CACL,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC;QAC1B,2BAA2B,CAAC,IAAI,CAAC,IAAI,CAAC;QACtC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAC/B,CAAC;AACJ,CAAC","sourcesContent":["import { execFileSync } from \"child_process\";\nimport fs from \"fs\";\nimport path from \"path\";\nimport { fileURLToPath, pathToFileURL } from \"url\";\n\nimport {\n DISPATCH_WORKSPACE_ROOT_REDIRECTS,\n getWorkspaceAppIdValidationError,\n} from \"../shared/workspace-app-id.js\";\nimport { setupAgentSymlinks } from \"./setup-agents.js\";\nimport {\n coreTemplates,\n getTemplate,\n allTemplateNames,\n type TemplateMeta,\n} from \"./templates-meta.js\";\nimport { workspacifyApp, parseWorkspaceScope } from \"./workspacify.js\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\nconst REPO = \"BuilderIO/agent-native\";\nconst TEMPLATES_DIR = \"templates\";\nconst POSTGRES_DEPENDENCY_VERSION = \"^3.4.9\";\nconst STANDALONE_EXACT_DEPENDENCY_OVERRIDES: Record<string, string> = {\n \"@react-router/dev\": \"8.1.0\",\n \"@react-router/fs-routes\": \"8.1.0\",\n \"react-router\": \"8.1.0\",\n};\nconst SENTRY_MINIMUM_RELEASE_AGE_EXCLUDES = ['\"@sentry/*\"'];\nconst FIRST_PARTY_TARBALL_SYMLINK_EXCLUDES = [\n \"*/CLAUDE.md\",\n \"*/.claude/skills\",\n];\n\n/**\n * Tagged error for input that fails CLI-level validation (repo names, app\n * names, etc.). The Sentry `beforeSend` hook in cli/index.ts drops events\n * whose top-level exception type is `ValidationError` so we don't pollute\n * Sentry with expected user-input rejections.\n */\nexport class ValidationError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"ValidationError\";\n }\n}\n\n/**\n * Move the primitive-first and chat on-ramps to the top of the list so they\n * line up with clack's default highlight.\n */\nfunction onRampFirst(templates: TemplateMeta[]): TemplateMeta[] {\n return moveTemplatesToFront(templates, [\"headless\", \"chat\"]);\n}\n\nfunction moveTemplatesToFront(\n templates: TemplateMeta[],\n preferredNames: string[],\n): TemplateMeta[] {\n const preferred = preferredNames\n .map((name) => templates.find((t) => t.name === name))\n .filter((template): template is TemplateMeta => Boolean(template));\n if (preferred.length === 0) return templates;\n const preferredSet = new Set(preferred.map((t) => t.name));\n return [...preferred, ...templates.filter((t) => !preferredSet.has(t.name))];\n}\n\n/** Primitive-first scaffold option appended to standalone pickers. */\nconst HEADLESS_OPTION = {\n name: \"headless\",\n label: \"Headless\",\n hint: \"Action-first app with one hello primitive and no UI shell\",\n};\n\nexport interface CreateAppOptions {\n /** Pre-select these templates in the picker. Comma-separated string or array. */\n template?: string;\n /** Scaffold a single standalone app (old behavior). Skips workspace creation. */\n standalone?: boolean;\n /** Internal: skip pnpm install at the end (for tests). */\n noInstall?: boolean;\n /**\n * Internal: always scaffold a workspace and skip the start-shape prompt.\n * Used by the deprecated `create-workspace` alias, whose contract is an\n * unconditional workspace scaffold.\n */\n forceWorkspace?: boolean;\n}\n\n/**\n * Main entry for `agent-native create [name]`.\n *\n * Default behavior: scaffold a workspace at <name>/ with a multi-select\n * template picker. Use --standalone for the single-app standalone flow.\n *\n * If run *inside* an existing workspace, falls through to the add-app\n * flow that scaffolds one new app under apps/<name>/.\n */\nexport async function createApp(\n name?: string,\n opts?: CreateAppOptions,\n): Promise<void> {\n const clack = await import(\"@clack/prompts\");\n\n // Reject an invalid provided name before any interactive prompt so bad input\n // fails fast instead of blocking on the start-shape picker below.\n if (name !== undefined) {\n assertValidProjectName(name, clack);\n }\n\n // If we're already inside a workspace, the meaning of `create <name>` is\n // \"add a new app to this workspace\". Delegate to add-app.\n const workspace = detectWorkspace(process.cwd());\n if (workspace) {\n await addAppToWorkspace(name, opts);\n return;\n }\n\n // Standalone escape hatch — behaves like the old single-app flow.\n if (opts?.standalone) {\n await createStandaloneApp(name, opts, clack);\n return;\n }\n\n // When exactly one template is specified explicitly, treat it as a\n // standalone scaffold (script-friendly, matches historic behavior).\n // Use `--template a,b` or pass no --template to opt into the workspace\n // flow with the multi-select picker.\n const parsed = parseTemplateList(opts?.template);\n // Headless can't live in a workspace, so reject it when more than one\n // template is requested or when workspace semantics are forced.\n if (\n parsed.includes(\"headless\") &&\n (parsed.length > 1 || opts?.forceWorkspace)\n ) {\n clack.cancel(\n \"The headless scaffold is standalone-only. Use `agent-native create my-app --headless`, or use the Chat template when adding a UI app to a workspace.\",\n );\n process.exit(1);\n }\n // A single explicit template scaffolds a standalone app, unless the caller\n // forces workspace semantics (the deprecated `create-workspace` alias), in\n // which case the template is preselected in the workspace picker below.\n if (parsed.length === 1 && !opts?.forceWorkspace) {\n await createStandaloneApp(name, opts, clack);\n return;\n }\n\n // No template specified: ask what shape to start from before diving into\n // \"which templates?\". The on-ramp choice implies the project structure, so\n // we don't ask a separate \"workspace or standalone?\" question — Chat and\n // Headless scaffold a single standalone app (the lightest starts; headless\n // cannot live in a workspace), while Template continues into the workspace\n // multi-select.\n if (parsed.length === 0) {\n // The deprecated `create-workspace` alias forces workspace semantics, so\n // it must skip the start-shape prompt and scaffold a workspace directly.\n if (opts?.forceWorkspace) {\n await createWorkspaceInteractive(name, opts, clack);\n return;\n }\n const shape = await promptStartShape(clack);\n if (shape === \"headless\" || shape === \"chat\") {\n await createStandaloneApp(name, { ...opts, template: shape }, clack);\n return;\n }\n // shape === \"template\" → full app(s) in a workspace.\n await createWorkspaceInteractive(name, opts, clack);\n return;\n }\n\n // Multiple explicit templates: create a workspace with them.\n await createWorkspaceInteractive(name, opts, clack);\n}\n\n/**\n * Top-level on-ramp shown by the bare `create <name>` command (no flags). The\n * choice made here implies the project structure, so we deliberately avoid a\n * separate \"workspace or standalone?\" question:\n * - \"template\" → full app(s) in a workspace (the multi-select picker)\n * - \"chat\" → a single standalone chat UI app\n * - \"headless\" → a single standalone action-first app with no UI shell\n * Chat and headless are standalone on purpose: a monorepo is unnecessary\n * ceremony for the lightest on-ramps, and headless cannot be a workspace\n * member. Either can grow into a workspace later via `add-app`.\n */\nasync function promptStartShape(\n clack: typeof import(\"@clack/prompts\"),\n): Promise<\"template\" | \"chat\" | \"headless\"> {\n const choice = await clack.select({\n message: \"How do you want to start?\",\n options: [\n {\n value: \"template\",\n label: \"Full template(s)\",\n hint: \"Clone complete apps (Mail, Calendar, Slides, ...) into a workspace\",\n },\n {\n value: \"chat\",\n label: \"Chat\",\n hint: \"A single app with a minimal chat UI and the browser shell wired up\",\n },\n {\n value: \"headless\",\n label: \"Headless\",\n hint: \"A single action-first app with one primitive and no UI shell\",\n },\n ],\n });\n if (clack.isCancel(choice)) {\n clack.cancel(\"Cancelled.\");\n process.exit(0);\n }\n return choice as \"template\" | \"chat\" | \"headless\";\n}\n\n/**\n * Validate a project name supplied on the command line. Mirrors the rule in\n * `promptNameIfMissing` so an invalid name is rejected before any interactive\n * prompt runs (the sub-flows re-validate, which is a harmless no-op).\n */\nfunction assertValidProjectName(\n name: string,\n clack: typeof import(\"@clack/prompts\"),\n): void {\n if (!/^[a-z][a-z0-9-]*$/.test(name)) {\n clack.cancel(\n `Invalid name \"${name}\". Use lowercase letters, numbers, and hyphens (must start with a letter).`,\n );\n process.exit(1);\n }\n}\n\n/* ─────────────────────────────────────────────────────────────────────────\n * Workspace creation (new default)\n * ───────────────────────────────────────────────────────────────────────── */\n\nasync function createWorkspaceInteractive(\n name: string | undefined,\n opts: CreateAppOptions | undefined,\n clack: typeof import(\"@clack/prompts\"),\n): Promise<void> {\n clack.intro(\"Create a new agent-native workspace\");\n\n name = await promptNameIfMissing(name, clack, \"workspace\", \"my-platform\");\n const preselected = parseTemplateList(opts?.template);\n\n clack.note(\n [\n `You're creating a workspace named \"${name}\". A workspace is a monorepo`,\n \"container — it isn't an app itself. Inside it you pick one or more apps\",\n \"(below), and each app gets its own route, agent, and UI. Apps in the\",\n \"same workspace share auth, database, and the agent chat. Add more apps\",\n \"later with `npx @agent-native/core@latest add-app`. Chat is the UI on-ramp\",\n \"for a minimal chat-first app with the browser shell already wired.\",\n \"Dispatch is always included as the workspace control plane —\",\n \"it owns shared secrets, messaging, approvals, and cross-app routing.\",\n ].join(\"\\n\"),\n \"About workspaces\",\n );\n\n // Dispatch is the workspace control plane (shared secrets, messaging,\n // approvals, cross-app routing) and is always scaffolded — the picker\n // only shows the optional apps. If the user explicitly passed\n // `--template=...`, those entries get unioned with dispatch.\n const optionalPicks =\n preselected.length > 0\n ? preselected.filter((t) => t !== \"dispatch\")\n : await promptTemplatePicker(preselected, clack, {\n defaultTemplates: [\"chat\"],\n preferredFirst: [\"chat\"],\n excludeNames: [\"dispatch\"],\n });\n const templates = [\"dispatch\", ...optionalPicks];\n\n const targetDir = path.resolve(process.cwd(), name);\n if (fs.existsSync(targetDir)) {\n clack.cancel(`Directory \"${name}\" already exists.`);\n process.exit(1);\n }\n\n const s = clack.spinner();\n s.start(`Scaffolding workspace \"${name}\"...`);\n const appNames = new Set<string>();\n const scaffoldedApps: string[] = [];\n\n try {\n await scaffoldWorkspaceRoot(targetDir, name);\n const workspaceCoreName = `@${name}/shared`;\n\n for (let i = 0; i < templates.length; i++) {\n const templateName = templates[i];\n const appName = workspaceAppNameForTemplateSelection(templateName);\n validateWorkspaceAppName(appName, clack, {\n allowDispatch: appName === \"dispatch\" && templateName === \"dispatch\",\n });\n if (appNames.has(appName)) {\n clack.cancel(\n `Workspace app \"${appName}\" is selected more than once. Choose unique app templates or app names.`,\n );\n process.exit(1);\n }\n appNames.add(appName);\n scaffoldedApps.push(appName);\n // Distinguish download vs local copy in the spinner so a multi-second\n // GitHub fetch doesn't look like a frozen \"Scaffolding...\" message.\n // Mirrors the local-vs-remote decision inside scaffoldAppTemplate.\n const willDownload =\n templateName !== \"headless\" && templateName.startsWith(\"github:\")\n ? true\n : !findLocalTemplate(normalizeTemplateName(templateName));\n s.message(\n willDownload\n ? `Downloading ${titleCase(appName)} template (${i + 1}/${templates.length})...`\n : `Scaffolding ${titleCase(appName)} (${i + 1}/${templates.length})...`,\n );\n const appDir = path.join(targetDir, \"apps\", appName);\n await scaffoldAppTemplate(appDir, templateName);\n s.message(\n `Configuring ${titleCase(appName)} (${i + 1}/${templates.length})...`,\n );\n replacePlaceholders(appDir, appName, appTitleForScaffold(appName), name);\n rewriteTrackingAppId(appDir, appName, templateName);\n workspacifyApp({\n appDir,\n appName,\n templateName,\n workspaceRoot: targetDir,\n workspaceCoreName,\n coreDependencyVersion: getCoreDependencyVersion(),\n dispatchDependencyVersion: getDispatchDependencyVersion(),\n });\n fixPackageJsonName(appDir, appName, templateName);\n fixWebManifestName(appDir, appName, templateName);\n rewriteNetlifyToml(appDir, appName, \"workspace\");\n renameGitignore(appDir);\n // Each app owns its own .claude / .agents symlinks.\n setupAgentSymlinks(appDir);\n }\n\n s.message(\"Adding shared packages...\");\n await scaffoldRequiredPackages(templates, targetDir);\n\n s.stop(\n `Workspace scaffolded with ${templates.length} app${templates.length === 1 ? \"\" : \"s\"}.`,\n );\n } catch (err: any) {\n s.stop(\"Failed to scaffold workspace.\");\n // Remove the partially-scaffolded workspace so a retry of `agent-native\n // create <name>` doesn't trip the \"Directory already exists\" guard.\n cleanupOnFailure(targetDir);\n clack.cancel(err?.message ?? String(err));\n process.exit(1);\n }\n\n tryGitInit(targetDir);\n\n // Show the user the tree we just built so the workspace/app distinction is\n // visible, not just described. First-time users routinely expect their\n // workspace name to be the app — seeing apps/<template>/ subdirectories\n // makes the structure concrete.\n const treeLines = [\n ` ${name}/ ← your workspace`,\n ...scaffoldedApps.map(\n (appName, i) =>\n ` ${i === scaffoldedApps.length - 1 ? \"└─\" : \"├─\"} apps/${appName}/`.padEnd(\n 30,\n ) + ` ← app`,\n ),\n ];\n const dispatchNextStep = [\n `Once running, open Dispatch — you'll see \"Workspace: ${titleCase(name)}\"`,\n `at the top, with all your apps listed under it.`,\n ];\n\n const installSteps = hasPnpm()\n ? [\n ` pnpm install`,\n ` pnpm dev # starts Dispatch on http://localhost:8092`,\n ]\n : [\n ` # pnpm is required but wasn't found on your PATH. Install it first:`,\n ` npm install -g pnpm`,\n ``,\n ` pnpm install`,\n ` pnpm dev # starts Dispatch on http://localhost:8092`,\n ];\n\n clack.outro(\n [\n `Created workspace \"${name}\" with ${templates.length} app${templates.length === 1 ? \"\" : \"s\"}:`,\n ``,\n ...treeLines,\n ``,\n `Next steps:`,\n ``,\n ` cd ${name}`,\n ...installSteps,\n ``,\n ...dispatchNextStep,\n ``,\n `Add another app later: npx @agent-native/core@latest add-app`,\n `Deploy the whole workspace: pnpm exec agent-native deploy`,\n ].join(\"\\n\"),\n );\n}\n\nfunction workspaceAppNameForTemplateSelection(templateName: string): string {\n const normalized = normalizeTemplateName(templateName);\n if (!normalized.startsWith(\"github:\")) return templateName;\n const repo = normalized.slice(\"github:\".length).trim();\n const repoName = repo.split(\"/\").filter(Boolean).pop() ?? \"app\";\n let appName = repoName\n .toLowerCase()\n .replace(/[^a-z0-9-]+/g, \"-\")\n .replace(/-+/g, \"-\")\n .replace(/^-+|-+$/g, \"\");\n if (!appName) appName = \"app\";\n if (!/^[a-z]/.test(appName)) appName = `app-${appName}`;\n return appName;\n}\n\n/**\n * Detect whether pnpm is on PATH. End-user machines often have npm/yarn but\n * not pnpm; the workspace scaffold uses pnpm workspaces, so we surface a\n * specific install hint in the outro when it's missing rather than letting\n * the user hit `zsh: command not found: pnpm`.\n */\nfunction hasPnpm(): boolean {\n try {\n execFileSync(\"pnpm\", [\"--version\"], { stdio: \"ignore\" });\n return true;\n } catch {\n return false;\n }\n}\n\nasync function scaffoldWorkspaceRoot(\n targetDir: string,\n name: string,\n): Promise<void> {\n const packageRoot = path.resolve(__dirname, \"../..\");\n const rootTemplate = path.join(packageRoot, \"src/templates/workspace-root\");\n const coreTemplate = path.join(packageRoot, \"src/templates/workspace-core\");\n\n copyDir(rootTemplate, targetDir);\n replacePlaceholders(targetDir, name, titleCase(name));\n rewriteCoreDependencyVersions(targetDir);\n renameGitignore(targetDir);\n\n // Inject the catalog from this repo's pnpm-workspace.yaml so templates'\n // `catalog:` version references resolve in the scaffolded workspace.\n const catalog = loadCatalog();\n if (Object.keys(catalog).length > 0) {\n const wsPath = path.join(targetDir, \"pnpm-workspace.yaml\");\n const existing = fs.existsSync(wsPath)\n ? fs.readFileSync(wsPath, \"utf-8\")\n : \"\";\n if (!existing.includes(\"catalog:\")) {\n const catalogYaml = Object.entries(catalog)\n .map(([k, v]) => ` \"${k}\": \"${v}\"`)\n .join(\"\\n\");\n fs.writeFileSync(\n wsPath,\n existing.trimEnd() + \"\\ncatalog:\\n\" + catalogYaml + \"\\n\",\n );\n }\n }\n\n const corePackageDir = path.join(targetDir, \"packages\", \"shared\");\n fs.mkdirSync(path.join(targetDir, \"packages\"), { recursive: true });\n copyDir(coreTemplate, corePackageDir);\n replacePlaceholders(corePackageDir, name, titleCase(name));\n rewriteCoreDependencyVersions(corePackageDir);\n setupAgentSymlinks(corePackageDir);\n\n // Ensure apps/ exists (even if empty).\n fs.mkdirSync(path.join(targetDir, \"apps\"), { recursive: true });\n\n // Root-level agent instructions apply before an agent descends into an app.\n linkWorkspaceRootSkills(targetDir);\n setupAgentSymlinks(targetDir);\n}\n\nfunction linkWorkspaceRootSkills(targetDir: string): void {\n const sharedSkillsDir = path.join(\n targetDir,\n \"packages\",\n \"shared\",\n \".agents\",\n \"skills\",\n );\n if (!fs.existsSync(sharedSkillsDir)) return;\n\n const agentsDir = path.join(targetDir, \".agents\");\n const linkPath = path.join(agentsDir, \"skills\");\n const target = \"../packages/shared/.agents/skills\";\n\n fs.mkdirSync(agentsDir, { recursive: true });\n\n try {\n const stat = fs.lstatSync(linkPath);\n if (stat.isSymbolicLink()) {\n if (fs.readlinkSync(linkPath) === target) return;\n fs.unlinkSync(linkPath);\n } else {\n return;\n }\n } catch {\n // Missing link; create below.\n }\n\n try {\n fs.symlinkSync(\n target,\n linkPath,\n process.platform === \"win32\" ? \"junction\" : \"dir\",\n );\n } catch {\n try {\n copyDir(sharedSkillsDir, linkPath);\n } catch {\n // Best-effort fallback for environments that disallow symlinks.\n }\n }\n}\n\n/* ─────────────────────────────────────────────────────────────────────────\n * Adding an app into an existing workspace\n * ───────────────────────────────────────────────────────────────────────── */\n\n/**\n * Entry for `agent-native add-app [name]`. Called from inside a workspace.\n * Shows the multi-select picker (excluding already-installed apps) and\n * scaffolds each selected template under apps/<name>/.\n *\n * When `name` is provided with `--template foo`, scaffolds exactly one app\n * named <name> using template foo (non-interactive).\n */\nexport async function addAppToWorkspace(\n name?: string,\n opts?: CreateAppOptions,\n): Promise<void> {\n const clack = await import(\"@clack/prompts\");\n const workspace = detectWorkspace(process.cwd());\n if (!workspace) {\n clack.cancel(\n \"Not inside a workspace. Run `agent-native create` to make one first, or use `--standalone`.\",\n );\n process.exit(1);\n }\n\n clack.intro(\"Add an app to your workspace\");\n\n const installed = listInstalledApps(workspace.workspaceRoot);\n\n // Non-interactive path: name + single --template\n const preselected = parseTemplateList(opts?.template);\n if (preselected.includes(\"headless\")) {\n clack.cancel(\n \"The headless scaffold is standalone-only. Use `agent-native create my-app --headless` outside a workspace, or use the Chat template when adding a UI app to a workspace.\",\n );\n process.exit(1);\n }\n if (name && preselected.length === 1) {\n const tpl = preselected[0];\n await scaffoldOneAppIntoWorkspace(workspace, name, tpl, clack);\n return;\n }\n\n const hasDispatch = installed.includes(\"dispatch\");\n const templates = await promptTemplatePicker(preselected, clack, {\n excludeNames: installed,\n message: \"Which apps do you want to add?\",\n defaultTemplates: hasDispatch ? undefined : [\"dispatch\"],\n preferredFirst: hasDispatch ? [\"chat\"] : [\"dispatch\", \"chat\"],\n recommendedNames: hasDispatch ? [] : [\"dispatch\"],\n });\n if (templates.length === 0) {\n clack.cancel(\"No apps selected. Cancelled.\");\n process.exit(0);\n }\n\n for (const t of templates) {\n await scaffoldOneAppIntoWorkspace(workspace, t, t, clack);\n }\n}\n\nasync function scaffoldOneAppIntoWorkspace(\n workspace: { workspaceRoot: string; workspaceCoreName: string },\n appName: string,\n templateName: string,\n clack: typeof import(\"@clack/prompts\"),\n): Promise<void> {\n // Dispatch is the one reserved-route exception: the canonical workspace\n // control-plane app intentionally owns /dispatch.\n validateWorkspaceAppName(appName, clack, {\n allowDispatch: appName === \"dispatch\" && templateName === \"dispatch\",\n });\n const appsDir = path.join(workspace.workspaceRoot, \"apps\");\n fs.mkdirSync(appsDir, { recursive: true });\n const appDir = path.join(appsDir, appName);\n\n if (fs.existsSync(appDir)) {\n clack.cancel(`Directory \"apps/${appName}\" already exists.`);\n process.exit(1);\n }\n\n const s = clack.spinner();\n s.start(\n `Working... no action needed. Scaffolding apps/${appName} from ${templateName}.`,\n );\n\n try {\n await scaffoldAppTemplate(appDir, templateName);\n replacePlaceholders(\n appDir,\n appName,\n appTitleForScaffold(appName),\n path.basename(workspace.workspaceRoot),\n );\n rewriteTrackingAppId(appDir, appName, templateName);\n workspacifyApp({\n appDir,\n appName,\n templateName,\n workspaceRoot: workspace.workspaceRoot,\n workspaceCoreName: workspace.workspaceCoreName,\n coreDependencyVersion: getCoreDependencyVersion(),\n dispatchDependencyVersion: getDispatchDependencyVersion(),\n });\n fixPackageJsonName(appDir, appName, templateName);\n fixWebManifestName(appDir, appName, templateName);\n rewriteNetlifyToml(appDir, appName, \"workspace\");\n renameGitignore(appDir);\n setupAgentSymlinks(appDir);\n await scaffoldRequiredPackages([templateName], workspace.workspaceRoot);\n s.stop(`Scaffolded apps/${appName}.`);\n } catch (err: any) {\n s.stop(`Failed to scaffold apps/${appName}.`);\n cleanupOnFailure(appDir);\n clack.cancel(err?.message ?? String(err));\n process.exit(1);\n }\n\n clack.outro(\n [\n `Done!`,\n ``,\n ` pnpm install`,\n ` pnpm dev`,\n ``,\n `The workspace gateway will detect apps/${appName} and serve it at /${appName}.`,\n ].join(\"\\n\"),\n );\n}\n\n/* ─────────────────────────────────────────────────────────────────────────\n * Standalone creation (escape hatch)\n * ───────────────────────────────────────────────────────────────────────── */\n\nasync function createStandaloneApp(\n name: string | undefined,\n opts: CreateAppOptions | undefined,\n clack: typeof import(\"@clack/prompts\"),\n): Promise<void> {\n clack.intro(\"Create a new standalone agent-native app\");\n\n name = await promptNameIfMissing(name, clack, \"app\", \"my-app\");\n\n const targetDir = path.resolve(process.cwd(), name);\n if (fs.existsSync(targetDir)) {\n clack.cancel(`Directory \"${name}\" already exists.`);\n process.exit(1);\n }\n\n // Standalone is single-select — pick one template.\n let template =\n opts?.template && !opts.template.includes(\",\") ? opts.template : undefined;\n if (!template) {\n const picked = await clack.select({\n message: \"Which template would you like to use?\",\n options: [\n {\n value: HEADLESS_OPTION.name,\n label: HEADLESS_OPTION.label,\n hint: HEADLESS_OPTION.hint,\n },\n ...onRampFirst(coreTemplates())\n .filter((t) => t.name !== HEADLESS_OPTION.name)\n .map((t) => ({\n value: t.name,\n label: t.label,\n hint: t.hint,\n })),\n ],\n });\n if (clack.isCancel(picked)) {\n clack.cancel(\"Cancelled.\");\n process.exit(0);\n }\n template = picked as string;\n }\n template = normalizeTemplateName(template);\n\n const s = clack.spinner();\n s.start(\n template === \"headless\"\n ? \"Scaffolding the headless agent app...\"\n : `Downloading the ${template} template from GitHub...`,\n );\n try {\n await scaffoldAppTemplate(targetDir, template);\n s.message(`Setting up ${name}…`);\n postProcessStandalone(name, targetDir, template);\n s.stop(\"App created!\");\n } catch (err: any) {\n s.stop(\"Failed to create app.\");\n cleanupOnFailure(targetDir);\n clack.cancel(err?.message ?? String(err));\n process.exit(1);\n }\n\n tryGitInit(targetDir);\n\n if (template === \"headless\") {\n clack.outro(\n [\n \"Done! Next steps:\",\n \"\",\n ` cd ${name}`,\n \" pnpm install\",\n \" pnpm action hello --name Builder\",\n ` pnpm agent \"Call hello for Builder\"`,\n \"\",\n \"Add a UI later by starting from the Chat template; `agent-native add` is reserved for integration blueprints.\",\n ].join(\"\\n\"),\n );\n } else {\n clack.outro(\n `Done! Next steps:\\n\\n cd ${name}\\n pnpm install\\n pnpm dev`,\n );\n }\n}\n\n/**\n * Remove a partially-scaffolded target directory after a scaffold failure so a\n * retry doesn't hit the \"Directory already exists\" guard. Best-effort — the\n * underlying failure is what we want surfaced, so we swallow rm errors and\n * skip if the directory is somehow already gone.\n */\nfunction cleanupOnFailure(targetDir: string): void {\n try {\n if (fs.existsSync(targetDir)) {\n fs.rmSync(targetDir, { recursive: true, force: true });\n }\n } catch {\n // Ignore — original error is more useful than a cleanup failure.\n }\n}\n\n/* ─────────────────────────────────────────────────────────────────────────\n * Shared scaffolding helpers\n * ───────────────────────────────────────────────────────────────────────── */\n\n/**\n * Scaffold a single app template into `targetDir`. Resolves:\n * - \"headless\" / legacy \"blank\" → bundled action-first template\n * - \"github:user/repo\" → download the whole repo\n * - first-party template name → download that subdir from BuilderIO/agent-native\n */\nasync function scaffoldAppTemplate(\n targetDir: string,\n template: string,\n): Promise<void> {\n fs.mkdirSync(path.dirname(targetDir), { recursive: true });\n\n // Normalize legacy / renamed aliases.\n let resolved = normalizeTemplateName(template);\n\n if (resolved === \"headless\") {\n const packageRoot = path.resolve(__dirname, \"../..\");\n const headlessDir = path.join(packageRoot, \"src/templates/headless\");\n if (!fs.existsSync(headlessDir)) {\n throw new Error(\n `Headless template not found at ${headlessDir}. Is the package installed correctly?`,\n );\n }\n copyDir(headlessDir, targetDir);\n return;\n }\n\n if (resolved.startsWith(\"github:\")) {\n const repo = resolved.slice(\"github:\".length);\n await downloadGitHubRepo(repo, targetDir);\n return;\n }\n\n if (!getTemplate(resolved)) {\n throw new Error(\n `Unknown template \"${template}\". Known: ${allTemplateNames().join(\", \")} — or use github:user/repo for community templates.`,\n );\n }\n\n // If running from the framework monorepo with a local templates/ dir, use\n // that. Otherwise download from GitHub. This keeps `agent-native create`\n // fast during framework development.\n const sourceTemplate = templateSourceName(resolved);\n const localTemplate = findLocalTemplate(sourceTemplate);\n if (localTemplate) {\n copyDir(localTemplate, targetDir);\n } else {\n await downloadGitHubSubdir(\n REPO,\n `${TEMPLATES_DIR}/${sourceTemplate}`,\n targetDir,\n );\n }\n}\n\nfunction templateSourceName(name: string): string {\n if (name === \"starter\") return \"chat\";\n return name;\n}\n\n/**\n * When developing the framework itself, prefer the sibling templates/<name>\n * directory. Returns undefined when running as a published package.\n */\nfunction findLocalTemplate(name: string): string | undefined {\n let dir = path.resolve(__dirname);\n for (let i = 0; i < 10; i++) {\n const candidate = path.join(dir, \"templates\", name);\n if (fs.existsSync(path.join(candidate, \"package.json\"))) {\n return candidate;\n }\n const parent = path.dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n return undefined;\n}\n\nfunction normalizeTemplateName(template: string): string {\n if (template === \"blank\") return \"headless\";\n if (template === \"image\" || template === \"images\" || template === \"asset\") {\n return \"assets\";\n }\n return template;\n}\n\n/**\n * Find a local packages/<name> directory (for framework development).\n * Returns undefined when running as a published npm package.\n */\nfunction findLocalPackage(name: string): string | undefined {\n let dir = path.resolve(__dirname);\n for (let i = 0; i < 10; i++) {\n const candidate = path.join(dir, \"packages\", name);\n if (fs.existsSync(path.join(candidate, \"package.json\"))) {\n return candidate;\n }\n const parent = path.dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n return undefined;\n}\n\n/**\n * Scaffold internal workspace packages required by the selected templates.\n * Deduplicates so each package is only copied once even if multiple\n * templates need it.\n */\nasync function scaffoldRequiredPackages(\n templateNames: string[],\n workspaceRoot: string,\n): Promise<void> {\n const needed = new Set<string>();\n for (const t of templateNames) {\n const meta = getTemplate(t);\n if (meta?.requiredPackages) {\n for (const p of meta.requiredPackages) needed.add(p);\n }\n }\n\n for (const pkgName of needed) {\n const targetDir = path.join(workspaceRoot, \"packages\", pkgName);\n if (fs.existsSync(targetDir)) continue;\n\n fs.mkdirSync(path.join(workspaceRoot, \"packages\"), { recursive: true });\n\n const localPkg = findLocalPackage(pkgName);\n if (localPkg) {\n copyDir(localPkg, targetDir);\n } else {\n await downloadGitHubSubdir(REPO, `packages/${pkgName}`, targetDir);\n }\n\n // The copied package may have @agent-native/core as a workspace:* dep.\n // Convert it to this CLI package's published range since\n // @agent-native/core is an npm package, not a workspace member.\n const pkgJsonPath = path.join(targetDir, \"package.json\");\n if (fs.existsSync(pkgJsonPath)) {\n try {\n const pkg = JSON.parse(fs.readFileSync(pkgJsonPath, \"utf-8\"));\n for (const depType of [\n \"dependencies\",\n \"devDependencies\",\n \"peerDependencies\",\n ] as const) {\n const deps = pkg[depType];\n if (!deps) continue;\n for (const [key, val] of Object.entries(deps)) {\n if (\n typeof val === \"string\" &&\n val.startsWith(\"workspace:\") &&\n key === \"@agent-native/core\"\n ) {\n deps[key] = getCoreDependencyVersion();\n }\n }\n }\n fs.writeFileSync(pkgJsonPath, JSON.stringify(pkg, null, 2) + \"\\n\");\n } catch {}\n }\n }\n\n // Add a postinstall script to build workspace packages so their dist/\n // directories exist even when downloaded from GitHub (where dist/ is\n // gitignored).\n if (needed.size > 0) {\n const rootPkgPath = path.join(workspaceRoot, \"package.json\");\n if (fs.existsSync(rootPkgPath)) {\n try {\n const rootPkg = JSON.parse(fs.readFileSync(rootPkgPath, \"utf-8\"));\n rootPkg.scripts = rootPkg.scripts ?? {};\n const builds = [...needed]\n .map((n) => `pnpm --filter ./packages/${n} build`)\n .join(\" && \");\n const existing = rootPkg.scripts.postinstall;\n if (existing) {\n if (!existing.includes(builds)) {\n rootPkg.scripts.postinstall = `${existing} && ${builds}`;\n }\n } else {\n rootPkg.scripts.postinstall = builds;\n }\n fs.writeFileSync(rootPkgPath, JSON.stringify(rootPkg, null, 2) + \"\\n\");\n } catch {}\n }\n }\n}\n\n/**\n * Post-process a standalone scaffold: replace placeholders, strip\n * workspace:* deps, set up agent symlinks, etc.\n */\nfunction postProcessStandalone(\n name: string,\n targetDir: string,\n templateName?: string,\n): void {\n const appTitle = appTitleForScaffold(name);\n replacePlaceholders(targetDir, name, appTitle);\n rewriteTrackingAppId(targetDir, name, templateName);\n rewriteAgentChatAppId(targetDir, name, templateName);\n fixPackageJsonName(targetDir, name, templateName);\n fixWebManifestName(targetDir, name, templateName);\n rewriteNetlifyToml(targetDir, name, \"standalone\");\n\n for (const base of [\"learnings\"]) {\n const defaultsFile = path.join(targetDir, `${base}.defaults.md`);\n const targetFile = path.join(targetDir, `${base}.md`);\n if (fs.existsSync(defaultsFile) && !fs.existsSync(targetFile)) {\n fs.copyFileSync(defaultsFile, targetFile);\n }\n }\n\n renameGitignore(targetDir);\n\n // No monorepo-only files to drop for standalone scaffolds.\n // DEVELOPING.md is intentionally kept: it documents local run commands,\n // DATABASE_URL defaults, and other local-run instructions that are equally\n // valid for standalone apps.\n\n // Resolve workspace:* and catalog: deps for standalone projects.\n // catalog: references only resolve inside a pnpm workspace with a catalog\n // defined in pnpm-workspace.yaml — standalone scaffolds don't have one.\n const catalog = loadCatalog();\n const pkgPath = path.join(targetDir, \"package.json\");\n if (fs.existsSync(pkgPath)) {\n try {\n const pkg = JSON.parse(fs.readFileSync(pkgPath, \"utf-8\"));\n for (const depType of [\n \"dependencies\",\n \"devDependencies\",\n \"peerDependencies\",\n ] as const) {\n const deps = pkg[depType];\n if (!deps) continue;\n for (const [key, val] of Object.entries(deps)) {\n const exactOverride = STANDALONE_EXACT_DEPENDENCY_OVERRIDES[key];\n if (exactOverride) {\n deps[key] = exactOverride;\n } else if (key === \"@agent-native/core\") {\n deps[key] = getCoreDependencyVersion();\n } else if (typeof val === \"string\" && val.startsWith(\"workspace:\")) {\n deps[key] = \"latest\";\n } else if (typeof val === \"string\" && val === \"catalog:\") {\n deps[key] = catalog[key] ?? \"latest\";\n }\n }\n }\n // Ensure pnpm.onlyBuiltDependencies is set so native packages\n // (better-sqlite3, esbuild, node-pty) compile their postinstall scripts\n // under pnpm 10+ without prompting for `pnpm approve-builds`.\n pkg.dependencies = pkg.dependencies ?? {};\n pkg.dependencies.postgres ??= POSTGRES_DEPENDENCY_VERSION;\n\n const requiredBuilt = [\"better-sqlite3\", \"esbuild\", \"node-pty\"];\n if (!pkg.pnpm || typeof pkg.pnpm !== \"object\") {\n pkg.pnpm = {};\n }\n const existing = Array.isArray(pkg.pnpm.onlyBuiltDependencies)\n ? pkg.pnpm.onlyBuiltDependencies\n : [];\n pkg.pnpm.onlyBuiltDependencies = Array.from(\n new Set([...existing, ...requiredBuilt]),\n );\n fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + \"\\n\");\n } catch {}\n }\n\n // Write pnpm-workspace.yaml for pnpm v11 compatibility. pnpm v11 no longer\n // reads the pnpm field in package.json, so allowBuilds and overrides must\n // live here. Merge into any existing file (e.g. from the default template)\n // without creating duplicate section headers.\n const wsPath = path.join(targetDir, \"pnpm-workspace.yaml\");\n try {\n const existing = fs.existsSync(wsPath)\n ? fs.readFileSync(wsPath, \"utf-8\")\n : \"\";\n const sections: Record<string, Record<string, string>> = {\n allowBuilds: {\n \"better-sqlite3\": \"true\",\n esbuild: \"true\",\n \"node-pty\": \"true\",\n },\n };\n if (templateName !== \"headless\") {\n sections.overrides = {\n '\"@assistant-ui/store\"': '\">=0.2.9 <0.2.14\"',\n '\"@assistant-ui/tap\"': '\"^0.5.14\"',\n nf3: '\"0.3.17\"',\n };\n }\n let updated = mergeWorkspaceYamlSections(existing, sections);\n updated = mergeWorkspaceYamlListItems(\n updated,\n \"minimumReleaseAgeExclude\",\n SENTRY_MINIMUM_RELEASE_AGE_EXCLUDES,\n );\n if (updated !== existing) {\n fs.writeFileSync(wsPath, updated);\n }\n } catch {}\n\n fixStandaloneTsconfig(targetDir, templateName);\n\n setupAgentSymlinks(targetDir);\n}\n\nfunction fixStandaloneTsconfig(targetDir: string, templateName?: string): void {\n const tsconfigPath = path.join(targetDir, \"tsconfig.json\");\n if (!fs.existsSync(tsconfigPath)) return;\n try {\n const tsconfig = JSON.parse(fs.readFileSync(tsconfigPath, \"utf-8\")) as {\n compilerOptions?: Record<string, unknown>;\n };\n tsconfig.compilerOptions ??= {};\n const hasUiApp =\n templateName !== \"headless\" && fs.existsSync(path.join(targetDir, \"app\"));\n const paths = {\n ...((tsconfig.compilerOptions.paths as Record<string, string[]>) ?? {}),\n };\n paths[\"*\"] ??= [\"./*\"];\n if (hasUiApp) {\n paths[\"@/*\"] ??= [\"./app/*\"];\n paths[\"@shared/*\"] ??= [\"./shared/*\"];\n }\n // baseUrl is deprecated/errors in TS 6 (TS5101/TS5102) and removed in TS 7\n // (tsgo, which CI runs). paths already resolve relative to this tsconfig,\n // and the \"*\": [\"./*\"] entry replaces baseUrl's bare-specifier resolution,\n // so never emit baseUrl into scaffolds.\n delete tsconfig.compilerOptions.baseUrl;\n tsconfig.compilerOptions.paths = paths;\n fs.writeFileSync(tsconfigPath, `${JSON.stringify(tsconfig, null, 2)}\\n`);\n } catch {}\n}\n\n/* ─────────────────────────────────────────────────────────────────────────\n * Prompting helpers\n * ───────────────────────────────────────────────────────────────────────── */\n\nasync function promptNameIfMissing(\n name: string | undefined,\n clack: typeof import(\"@clack/prompts\"),\n kind: \"workspace\" | \"app\",\n placeholder: string,\n): Promise<string> {\n if (name) {\n if (!/^[a-z][a-z0-9-]*$/.test(name)) {\n clack.cancel(\n `Invalid ${kind} name \"${name}\". Use lowercase letters, numbers, and hyphens.`,\n );\n process.exit(1);\n }\n return name;\n }\n const result = await clack.text({\n message: `What is your ${kind} name?`,\n placeholder,\n validate(value) {\n if (!value)\n return `${kind[0].toUpperCase() + kind.slice(1)} name is required`;\n if (!/^[a-z][a-z0-9-]*$/.test(value)) {\n return \"Use lowercase letters, numbers, and hyphens (must start with a letter)\";\n }\n if (fs.existsSync(path.resolve(process.cwd(), value))) {\n return `Directory \"${value}\" already exists`;\n }\n },\n });\n if (clack.isCancel(result)) {\n clack.cancel(\"Cancelled.\");\n process.exit(0);\n }\n return result as string;\n}\n\nasync function promptTemplatePicker(\n preselected: string[],\n clack: typeof import(\"@clack/prompts\"),\n opts?: {\n defaultTemplates?: string[];\n excludeNames?: string[];\n message?: string;\n preferredFirst?: string[];\n recommendedNames?: string[];\n },\n): Promise<string[]> {\n const excluded = new Set(opts?.excludeNames ?? []);\n const orderedTemplates = opts?.preferredFirst\n ? moveTemplatesToFront(coreTemplates(), opts.preferredFirst)\n : onRampFirst(coreTemplates());\n const recommendedNames = new Set(opts?.recommendedNames ?? []);\n const options = orderedTemplates\n .filter((t) => !excluded.has(t.name))\n .map((t) => ({\n value: t.name,\n label: recommendedNames.has(t.name)\n ? `${t.label} (recommended)`\n : t.label,\n hint:\n recommendedNames.has(t.name) && t.name === \"dispatch\"\n ? \"Recommended workspace control plane: secrets, messaging, approvals, and A2A delegation\"\n : t.hint,\n }));\n\n // If there's nothing left to pick, the caller gets an empty selection —\n // they decide how to handle it.\n if (options.length === 0) return [];\n\n // Default pre-selection: what the user passed via --template, falling\n // back to caller defaults, then to \"chat\" when available.\n const defaults =\n preselected.length > 0\n ? preselected.filter((p) => options.some((o) => o.value === p))\n : opts?.defaultTemplates\n ? opts.defaultTemplates.filter((p) =>\n options.some((o) => o.value === p),\n )\n : options.some((o) => o.value === \"chat\")\n ? [\"chat\"]\n : [];\n\n const baseMessage = opts?.message ?? \"Which apps would you like to include?\";\n const result = await clack.multiselect({\n message: `${baseMessage}\\n (↑/↓ move · space to toggle · enter to confirm)`,\n options,\n initialValues: defaults,\n required: false,\n });\n if (clack.isCancel(result)) {\n clack.cancel(\"Cancelled.\");\n process.exit(0);\n }\n return result as string[];\n}\n\nfunction parseTemplateList(input?: string): string[] {\n if (!input) return [];\n return input\n .split(\",\")\n .map((s) => normalizeTemplateName(s.trim()))\n .filter(Boolean);\n}\n\nfunction listInstalledApps(workspaceRoot: string): string[] {\n const appsDir = path.join(workspaceRoot, \"apps\");\n if (!fs.existsSync(appsDir)) return [];\n return fs\n .readdirSync(appsDir, { withFileTypes: true })\n .filter((e) => e.isDirectory())\n .map((e) => e.name);\n}\n\n/* ─────────────────────────────────────────────────────────────────────────\n * Workspace detection\n * ───────────────────────────────────────────────────────────────────────── */\n\n/**\n * Walk up from startDir looking for a package.json with\n * `agent-native.workspaceCore` set. Returns the workspace root and core\n * package name, or null if not inside a workspace.\n */\nexport function detectWorkspace(\n startDir: string,\n): { workspaceRoot: string; workspaceCoreName: string } | null {\n let dir = path.resolve(startDir);\n for (let i = 0; i < 20; i++) {\n const pkgPath = path.join(dir, \"package.json\");\n if (fs.existsSync(pkgPath)) {\n try {\n const pkg = JSON.parse(fs.readFileSync(pkgPath, \"utf-8\"));\n const wsCore = pkg?.[\"agent-native\"]?.workspaceCore;\n if (typeof wsCore === \"string\" && wsCore.length > 0) {\n return { workspaceRoot: dir, workspaceCoreName: wsCore };\n }\n } catch {}\n }\n const parent = path.dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n return null;\n}\n\nexport { parseWorkspaceScope };\n\n/** @internal — exported for E2E tests */\nexport {\n scaffoldWorkspaceRoot as _scaffoldWorkspaceRoot,\n scaffoldAppTemplate as _scaffoldAppTemplate,\n scaffoldRequiredPackages as _scaffoldRequiredPackages,\n postProcessStandalone as _postProcessStandalone,\n loadCatalog as _loadCatalog,\n fixPackageJsonName as _fixPackageJsonName,\n renameGitignore as _renameGitignore,\n rewriteNetlifyToml as _rewriteNetlifyToml,\n getCoreDependencyVersion as _getCoreDependencyVersion,\n getDispatchDependencyVersion as _getDispatchDependencyVersion,\n getGitHubTemplateRef as _getGitHubTemplateRef,\n getGitHubTemplateRefCandidates as _getGitHubTemplateRefCandidates,\n workspaceAppNameForTemplateSelection as _workspaceAppNameForTemplateSelection,\n shouldSkipScaffoldEntry as _shouldSkipScaffoldEntry,\n tarExtractArgs as _tarExtractArgs,\n};\n\n/* ─────────────────────────────────────────────────────────────────────────\n * Download / copy helpers\n * ───────────────────────────────────────────────────────────────────────── */\n\nfunction validateRepoName(repo: string): void {\n if (!/^[a-zA-Z0-9_.-]+\\/[a-zA-Z0-9_.-]+$/.test(repo)) {\n throw new ValidationError(\n `Invalid repository name \"${repo}\". Expected format: user/repo`,\n );\n }\n}\n\nfunction tarExtractArgs(\n tarPath: string,\n destDir: string,\n options: { skipAgentSymlinks?: boolean } = {},\n): string[] {\n const excludes = options.skipAgentSymlinks\n ? FIRST_PARTY_TARBALL_SYMLINK_EXCLUDES.flatMap((pattern) => [\n \"--exclude\",\n pattern,\n ])\n : [];\n return [\"xzf\", tarPath, \"--strip-components=1\", ...excludes, \"-C\", destDir];\n}\n\nfunction downloadAndExtract(\n url: string,\n destDir: string,\n options: { skipAgentSymlinks?: boolean } = {},\n): void {\n fs.mkdirSync(destDir, { recursive: true });\n // --fail-with-body so curl exits non-zero on HTTP 4xx/5xx instead of writing\n // the error body (HTML/JSON) to disk where tar then fails with the opaque\n // \"Unrecognized archive format\" message.\n const tarball = execFileSync(\"curl\", [\"--fail-with-body\", \"-sL\", url], {\n maxBuffer: 100 * 1024 * 1024,\n });\n const tarPath = path.join(destDir, \".download.tar.gz\");\n fs.writeFileSync(tarPath, tarball);\n try {\n execFileSync(\"tar\", tarExtractArgs(tarPath, destDir, options), {\n stdio: \"pipe\",\n });\n } finally {\n fs.unlinkSync(tarPath);\n }\n}\n\nasync function downloadGitHubSubdir(\n repo: string,\n subdir: string,\n targetDir: string,\n): Promise<void> {\n validateRepoName(repo);\n const refs = getGitHubTemplateRefCandidates();\n const errors: string[] = [];\n for (const ref of refs) {\n const tarUrl = `https://api.github.com/repos/${repo}/tarball/${encodeURIComponent(ref)}`;\n const tmpDir = path.join(\n targetDir,\n \"..\",\n `.agent-native-tmp-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,\n );\n try {\n downloadAndExtract(tarUrl, tmpDir, { skipAgentSymlinks: repo === REPO });\n const srcDir = path.join(tmpDir, subdir);\n if (!fs.existsSync(srcDir)) {\n throw new Error(\n `Template directory \"${subdir}\" not found at ref \"${ref}\".`,\n );\n }\n copyDir(srcDir, targetDir);\n return;\n } catch (err) {\n errors.push(\n ` ${ref}: ${err instanceof Error ? err.message.split(\"\\n\")[0] : String(err)}`,\n );\n } finally {\n fs.rmSync(tmpDir, { recursive: true, force: true });\n }\n }\n throw new Error(\n `Failed to download templates from ${repo}. Tried refs:\\n${errors.join(\"\\n\")}`,\n );\n}\n\nasync function downloadGitHubRepo(\n repo: string,\n targetDir: string,\n): Promise<void> {\n validateRepoName(repo);\n const tarUrl = `https://api.github.com/repos/${repo}/tarball/main`;\n downloadAndExtract(tarUrl, targetDir);\n}\n\n/* ─────────────────────────────────────────────────────────────────────────\n * Text / filesystem helpers\n * ───────────────────────────────────────────────────────────────────────── */\n\n/**\n * Merge key-value entries into named sections of a pnpm-workspace.yaml string\n * without creating duplicate section headers. For each section:\n * - If the section already exists, new entries are injected after its header.\n * - If the section is absent, a new block is appended at the end.\n * Entries already present (by key) are skipped.\n */\nfunction mergeWorkspaceYamlSections(\n yaml: string,\n sections: Record<string, Record<string, string>>,\n): string {\n let result = yaml;\n for (const [section, entries] of Object.entries(sections)) {\n for (const [key, value] of Object.entries(entries)) {\n if (result.includes(key)) continue;\n const sectionHeader = new RegExp(`^${section}:\\\\s*$`, \"m\");\n const match = sectionHeader.exec(result);\n if (match) {\n const insertAt = match.index + match[0].length;\n result =\n result.slice(0, insertAt) +\n `\\n ${key}: ${value}` +\n result.slice(insertAt);\n } else {\n result =\n result.trimEnd() +\n (result ? \"\\n\" : \"\") +\n `\\n${section}:\\n ${key}: ${value}\\n`;\n }\n }\n }\n return result;\n}\n\nfunction mergeWorkspaceYamlListItems(\n yaml: string,\n section: string,\n items: string[],\n): string {\n let result = yaml;\n for (const item of items) {\n const rendered = ` - ${item}`;\n if (result.includes(rendered)) continue;\n const sectionHeader = new RegExp(`^${section}:\\\\s*$`, \"m\");\n const match = sectionHeader.exec(result);\n if (match) {\n const insertAt = match.index + match[0].length;\n result =\n result.slice(0, insertAt) + `\\n${rendered}` + result.slice(insertAt);\n } else {\n result =\n result.trimEnd() +\n (result ? \"\\n\" : \"\") +\n `\\n${section}:\\n${rendered}\\n`;\n }\n }\n return result;\n}\n\n/**\n * Load the pnpm workspace catalog.\n * First tries the build-time snapshot at dist/catalog.json (works when\n * running as a published npm package). Falls back to parsing the monorepo\n * pnpm-workspace.yaml (works during local framework development).\n */\nfunction loadCatalog(): Record<string, string> {\n try {\n // Build-time snapshot generated by finalize-build.mjs\n const snapshotPath = path.resolve(__dirname, \"../catalog.json\");\n if (fs.existsSync(snapshotPath)) {\n return JSON.parse(fs.readFileSync(snapshotPath, \"utf-8\"));\n }\n\n // Fallback: parse pnpm-workspace.yaml from the monorepo root\n // From dist/cli/ or src/cli/: 4 levels up → packages/core → packages → repo root\n const repoRoot = path.resolve(__dirname, \"../../../..\");\n const wsPath = path.join(repoRoot, \"pnpm-workspace.yaml\");\n if (!fs.existsSync(wsPath)) return {};\n const content = fs.readFileSync(wsPath, \"utf-8\");\n const result: Record<string, string> = {};\n let inCatalog = false;\n for (const line of content.split(\"\\n\")) {\n if (/^catalog:\\s*$/.test(line)) {\n inCatalog = true;\n continue;\n }\n if (inCatalog) {\n if (/^\\S/.test(line)) break;\n const match = line.match(/^\\s+\"?([^\":]+)\"?\\s*:\\s*\"?([^\"]+)\"?\\s*$/);\n if (match) result[match[1]] = match[2];\n }\n }\n return result;\n } catch {\n return {};\n }\n}\n\nfunction titleCase(name: string): string {\n return name\n .split(\"-\")\n .map((w) => (w ? w[0].toUpperCase() + w.slice(1) : w))\n .join(\" \");\n}\n\nfunction appTitleForScaffold(appName: string): string {\n return titleCase(appName);\n}\n\nfunction isChatOnRampTemplate(templateName: string | undefined): boolean {\n return templateName === \"chat\" || templateName === \"starter\";\n}\n\nfunction trackingTemplateName(\n templateName: string | undefined,\n): string | undefined {\n return templateName === \"starter\" ? \"chat\" : templateName;\n}\n\nfunction defaultPackageDescriptionForScaffold(appName: string): string {\n const appTitle = appTitleForScaffold(appName);\n return `Workspace app for ${appTitle}.`;\n}\n\nfunction shouldReplaceScaffoldDescription(value: unknown): boolean {\n if (typeof value !== \"string\" || !value.trim()) return true;\n return /\\b(starter|new app|blank\\b.*\\bapp)\\b/i.test(value);\n}\n\nfunction fixPackageJsonName(\n appDir: string,\n name: string,\n templateName?: string,\n): void {\n const pkgPath = path.join(appDir, \"package.json\");\n if (!fs.existsSync(pkgPath)) return;\n try {\n const pkg = JSON.parse(fs.readFileSync(pkgPath, \"utf-8\"));\n pkg.name = name;\n const appTitle = appTitleForScaffold(name);\n // When the user picked a custom name (e.g. `add-app todo --template=chat`)\n // the template's displayName would otherwise leak into the workspace apps\n // grid as the new app's label. Overwrite it so the app shows up as \"Todo\"\n // instead of the source template's branding.\n if (templateName && name !== templateName) {\n pkg.displayName = appTitle;\n }\n if (\n shouldReplaceScaffoldDescription(pkg.description) ||\n (isChatOnRampTemplate(templateName) && name !== templateName)\n ) {\n pkg.description = defaultPackageDescriptionForScaffold(name);\n }\n fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + \"\\n\");\n } catch {}\n}\n\nfunction fixWebManifestName(\n appDir: string,\n name: string,\n templateName?: string,\n): void {\n if (!isChatOnRampTemplate(templateName) || name === templateName) return;\n const manifestPath = path.join(appDir, \"public\", \"manifest.json\");\n if (!fs.existsSync(manifestPath)) return;\n try {\n const manifest = JSON.parse(fs.readFileSync(manifestPath, \"utf-8\"));\n const appTitle = titleCase(name);\n manifest.name = appTitle;\n manifest.short_name = appTitle;\n if (\n typeof manifest.description !== \"string\" ||\n /\\b(blank app|starter|chat-first)\\b/i.test(manifest.description)\n ) {\n manifest.description = defaultPackageDescriptionForScaffold(name);\n }\n fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2) + \"\\n\");\n } catch {}\n}\n\nfunction getCoreDependencyVersion(): string {\n if (process.env.AGENT_NATIVE_CREATE_USE_LOCAL_CORE === \"1\") {\n const localCore = findLocalPackage(\"core\");\n if (localCore) return pathToFileURL(localCore).href;\n }\n\n // Generated apps must install before the current package version is\n // published. The dist-tag resolves to the newest released core today and to\n // this package version once the release goes live. Local file deps are\n // intentionally opt-in so scaffolded repos remain portable by default.\n return \"latest\";\n}\n\nfunction getDispatchDependencyVersion(): string {\n if (process.env.AGENT_NATIVE_CREATE_USE_LOCAL_CORE === \"1\") {\n const localDispatch = findLocalPackage(\"dispatch\");\n if (localDispatch) return pathToFileURL(localDispatch).href;\n }\n\n return \"latest\";\n}\n\nfunction getCorePackageVersion(): string | undefined {\n try {\n const packageRoot = path.resolve(__dirname, \"../..\");\n const pkg = JSON.parse(\n fs.readFileSync(path.join(packageRoot, \"package.json\"), \"utf-8\"),\n );\n return typeof pkg.version === \"string\" ? pkg.version : undefined;\n } catch {\n return undefined;\n }\n}\n\n/**\n * Git refs to try, in priority order, when downloading templates from the\n * framework repo. The release tag scheme has shifted over time:\n *\n * - ≤ 0.7.83: single repo-wide tag `v<version>` (legacy).\n * - ≥ 0.8.0: changesets per-package tags\n * `@agent-native/core@<version>` (current).\n *\n * `main` is the final fallback so dev builds and brand-new releases (where\n * the tag has not propagated yet) still work — at the cost of pulling\n * potentially newer template code than the running CLI was built against.\n */\nfunction getGitHubTemplateRefCandidates(): string[] {\n const version = getCorePackageVersion();\n const candidates: string[] = [];\n if (version && /^\\d+\\.\\d+\\.\\d+(?:-.+)?$/.test(version)) {\n candidates.push(`@agent-native/core@${version}`);\n candidates.push(`v${version}`);\n }\n candidates.push(\"main\");\n return candidates;\n}\n\n/** @deprecated Kept for backward-compatible test imports. Returns the\n * highest-priority candidate; callers that need the full fallback list\n * should use `getGitHubTemplateRefCandidates()`. */\nfunction getGitHubTemplateRef(): string {\n return getGitHubTemplateRefCandidates()[0]!;\n}\n\nfunction rewriteCoreDependencyVersions(projectDir: string): void {\n const pkgPath = path.join(projectDir, \"package.json\");\n if (!fs.existsSync(pkgPath)) return;\n try {\n const pkg = JSON.parse(fs.readFileSync(pkgPath, \"utf-8\"));\n for (const depType of [\n \"dependencies\",\n \"devDependencies\",\n \"peerDependencies\",\n ] as const) {\n const deps = pkg[depType];\n if (deps?.[\"@agent-native/core\"]) {\n deps[\"@agent-native/core\"] = getCoreDependencyVersion();\n }\n }\n fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + \"\\n\");\n } catch {}\n}\n\nfunction validateWorkspaceAppName(\n appName: string,\n clack: typeof import(\"@clack/prompts\"),\n opts?: { allowDispatch?: boolean },\n): void {\n const error =\n opts?.allowDispatch && appName === \"dispatch\"\n ? null\n : getWorkspaceAppIdValidationError(appName);\n if (error) {\n clack.cancel(error);\n process.exit(1);\n }\n}\n\nfunction upsertTomlBuildEnvironment(\n content: string,\n vars: Record<string, string>,\n): string {\n const lines = content.split(\"\\n\");\n const sectionIndex = lines.findIndex(\n (line) => line.trim() === \"[build.environment]\",\n );\n if (sectionIndex === -1) {\n const envLines = [\"\", \"[build.environment]\"].concat(\n Object.entries(vars).map(([key, value]) => ` ${key} = \"${value}\"`),\n );\n return content.trimEnd() + \"\\n\" + envLines.join(\"\\n\") + \"\\n\";\n }\n\n let nextSectionIndex = lines.findIndex(\n (line, index) => index > sectionIndex && /^\\s*\\[/.test(line),\n );\n if (nextSectionIndex === -1) nextSectionIndex = lines.length;\n\n for (const [key, value] of Object.entries(vars)) {\n const existingIndex = lines.findIndex(\n (line, index) =>\n index > sectionIndex &&\n index < nextSectionIndex &&\n new RegExp(`^\\\\s*${key}\\\\s*=`).test(line),\n );\n const nextLine = ` ${key} = \"${value}\"`;\n if (existingIndex === -1) {\n lines.splice(nextSectionIndex, 0, nextLine);\n nextSectionIndex += 1;\n } else {\n lines[existingIndex] = nextLine;\n }\n }\n\n return lines.join(\"\\n\");\n}\n\nfunction ensureRedirect(\n content: string,\n from: string,\n to: string,\n status: number,\n): string {\n const escapedFrom = from.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n const redirectPattern = new RegExp(\n `\\\\n?\\\\[\\\\[redirects\\\\]\\\\]\\\\s+from\\\\s*=\\\\s*\"${escapedFrom}\"\\\\s+to\\\\s*=\\\\s*\"[^\"]*\"\\\\s+status\\\\s*=\\\\s*\\\\d+(?:\\\\s+force\\\\s*=\\\\s*(?:true|false))?`,\n \"m\",\n );\n const block = [\n \"\",\n \"[[redirects]]\",\n ` from = \"${from}\"`,\n ` to = \"${to}\"`,\n ` status = ${status}`,\n ].join(\"\\n\");\n if (redirectPattern.test(content)) {\n return content.replace(redirectPattern, block);\n }\n return content.trimEnd() + \"\\n\" + block + \"\\n\";\n}\n\nfunction removeRedirect(content: string, from: string): string {\n const escapedFrom = from.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n const redirectPattern = new RegExp(\n `\\\\n?\\\\[\\\\[redirects\\\\]\\\\]\\\\s+from\\\\s*=\\\\s*\"${escapedFrom}\"\\\\s+to\\\\s*=\\\\s*\"[^\"]*\"\\\\s+status\\\\s*=\\\\s*\\\\d+(?:\\\\s+force\\\\s*=\\\\s*(?:true|false))?`,\n \"gm\",\n );\n return content.replace(redirectPattern, \"\").replace(/\\n{3,}/g, \"\\n\\n\");\n}\n\nfunction addWorkspaceMountNetlifyConfig(\n content: string,\n appName: string,\n): string {\n const basePath = `/${appName}`;\n let next = upsertTomlBuildEnvironment(content, {\n APP_BASE_PATH: basePath,\n VITE_APP_BASE_PATH: basePath,\n NITRO_PRESET: \"netlify\",\n NPM_CONFIG_PRODUCTION: \"false\",\n });\n\n if (appName === \"dispatch\") {\n next = ensureRedirect(next, \"/\", \"/dispatch/overview\", 302);\n next = ensureRedirect(next, \"/dispatch\", \"/dispatch/overview\", 302);\n for (const [from, to] of DISPATCH_WORKSPACE_ROOT_REDIRECTS) {\n next = ensureRedirect(next, `/${from}`, `/dispatch/${to}`, 302);\n }\n next = removeRedirect(next, \"/dispatch/*\");\n }\n\n return next;\n}\n\nfunction rewriteNetlifyToml(\n appDir: string,\n appName: string,\n mode: \"standalone\" | \"workspace\",\n): void {\n const netlifyPath = path.join(appDir, \"netlify.toml\");\n if (!fs.existsSync(netlifyPath)) return;\n\n try {\n let content = fs.readFileSync(netlifyPath, \"utf-8\");\n const originalCommand = content.match(/^\\s*command = \"([^\"]*)\"$/m)?.[1];\n const usesUnpooledDatabase =\n originalCommand?.includes(\"NETLIFY_DATABASE_URL_UNPOOLED\") ?? false;\n const buildCommand =\n mode === \"workspace\"\n ? `APP_BASE_PATH=/${appName} VITE_APP_BASE_PATH=/${appName} NITRO_PRESET=netlify pnpm --filter ${appName} build`\n : \"NITRO_PRESET=netlify pnpm build\";\n const databaseSetup =\n 'export DATABASE_URL=\\\\\"${NETLIFY_DATABASE_URL:-$DATABASE_URL}\\\\\"';\n const buildDatabasePrefix = usesUnpooledDatabase\n ? 'DATABASE_URL=\\\\\"${NETLIFY_DATABASE_URL_UNPOOLED:-$DATABASE_URL}\\\\\" '\n : \"\";\n const command = `${databaseSetup} && ${buildDatabasePrefix}${buildCommand}`;\n const publishPath = mode === \"workspace\" ? `apps/${appName}/dist` : \"dist\";\n const functionsPath =\n mode === \"workspace\"\n ? `apps/${appName}/.netlify/functions-internal`\n : \".netlify/functions-internal\";\n\n content = content\n .replace(/^(\\s*)command = \".*\"$/m, `$1command = \"${command}\"`)\n .replace(\n /publish = \"templates\\/[^\"]+\\/dist\"/g,\n `publish = \"${publishPath}\"`,\n )\n .replace(\n /functions = \"templates\\/[^\"]+\\/\\.netlify\\/functions-internal\"/g,\n `functions = \"${functionsPath}\"`,\n )\n // Strip the `ignore` script line: it references a monorepo script path\n // (scripts/netlify-ignore-build.mjs) that doesn't exist in scaffolds, so\n // skip-unchanged would never work and every deploy logs a not-found error.\n .replace(/^\\s*ignore\\s*=\\s*\"[^\"]*\"\\s*\\n/m, \"\");\n\n if (mode === \"workspace\") {\n content = addWorkspaceMountNetlifyConfig(content, appName);\n }\n\n fs.writeFileSync(netlifyPath, content);\n } catch {}\n}\n\nfunction rewriteAgentChatAppId(\n appDir: string,\n appName: string,\n templateName?: string,\n): void {\n const pluginPath = path.join(appDir, \"server\", \"plugins\", \"agent-chat.ts\");\n if (!fs.existsSync(pluginPath)) return;\n\n try {\n const content = fs.readFileSync(pluginPath, \"utf-8\");\n const sourceAppIds = [\"chat\", \"starter\"];\n if (templateName && templateName !== appName) {\n sourceAppIds.push(templateName);\n }\n const pattern = new RegExp(\n `(appId:\\\\s*)([\"'])(${sourceAppIds.map(escapeRegExp).join(\"|\")})\\\\2`,\n );\n if (!pattern.test(content)) return;\n\n const next = content.replace(\n pattern,\n (_match, prefix: string, quote: string) =>\n `${prefix}${quote}${appName}${quote}`,\n );\n if (next !== content) {\n fs.writeFileSync(pluginPath, next);\n }\n } catch {}\n}\n\nfunction rewriteTrackingAppId(\n appDir: string,\n appName: string,\n templateName?: string,\n): void {\n const rootPath = path.join(appDir, \"app\", \"root.tsx\");\n if (!fs.existsSync(rootPath)) return;\n\n try {\n const content = fs.readFileSync(rootPath, \"utf-8\");\n const trackedTemplateName = trackingTemplateName(templateName);\n const sourceAppIds = [\"agent-native-[^\\\"']+\", \"\\\\{\\\\{APP_NAME\\\\}\\\\}\"];\n if (templateName && templateName !== appName) {\n sourceAppIds.push(escapeRegExp(templateName));\n }\n if (isChatOnRampTemplate(templateName)) {\n sourceAppIds.push(\"starter\", \"chat\");\n }\n const pattern = new RegExp(\n `(^\\\\s*app:\\\\s*)([\"'])(?:${sourceAppIds.join(\"|\")})\\\\2(\\\\s*,?)`,\n \"m\",\n );\n if (!pattern.test(content)) return;\n\n let next = content.replace(\n pattern,\n (_match, prefix: string, quote: string, suffix: string) =>\n `${prefix}${quote}${appName}${quote}${suffix}`,\n );\n\n if (\n trackedTemplateName &&\n trackedTemplateName !== appName &&\n !hasTrackingTemplate(next)\n ) {\n next = next.replace(\n /(^\\s*app:\\s*[\"'][^\"']+[\"'],?\\s*$)/m,\n (line) =>\n `${line}\\n template: ${JSON.stringify(trackedTemplateName)},`,\n );\n }\n\n if (next !== content) {\n fs.writeFileSync(rootPath, next);\n }\n } catch {}\n}\n\nfunction escapeRegExp(value: string): string {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n\nfunction hasTrackingTemplate(content: string): boolean {\n const match = content.match(/configureTracking\\(\\{[\\s\\S]*?\\}\\);/);\n return !!match && /^\\s*template\\s*:/m.test(match[0]);\n}\n\nfunction tryGitInit(dir: string): boolean {\n try {\n execFileSync(\"git\", [\"init\"], { cwd: dir, stdio: \"pipe\" });\n execFileSync(\"git\", [\"add\", \"-A\"], { cwd: dir, stdio: \"pipe\" });\n execFileSync(\n \"git\",\n [\"commit\", \"-m\", \"Initial commit from agent-native create\"],\n {\n cwd: dir,\n stdio: \"pipe\",\n env: {\n ...process.env,\n GIT_AUTHOR_NAME: \"agent-native\",\n GIT_AUTHOR_EMAIL: \"noreply@agent-native.com\",\n GIT_COMMITTER_NAME: \"agent-native\",\n GIT_COMMITTER_EMAIL: \"noreply@agent-native.com\",\n },\n },\n );\n return true;\n } catch {\n return false;\n }\n}\n\nfunction renameGitignore(dir: string): void {\n const src = path.join(dir, \"_gitignore\");\n const dst = path.join(dir, \".gitignore\");\n if (fs.existsSync(src)) fs.renameSync(src, dst);\n}\n\nfunction replacePlaceholders(\n dir: string,\n appName: string,\n appTitle: string,\n workspaceName?: string,\n): void {\n for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {\n const p = path.join(dir, entry.name);\n if (entry.isSymbolicLink()) continue;\n if (entry.isDirectory()) {\n replacePlaceholders(p, appName, appTitle, workspaceName);\n continue;\n }\n let content: string;\n try {\n content = fs.readFileSync(p, \"utf-8\");\n } catch {\n continue;\n }\n const hasWs =\n workspaceName !== undefined && content.includes(\"{{WORKSPACE_NAME}}\");\n if (\n !content.includes(\"{{APP_NAME}}\") &&\n !content.includes(\"{{APP_TITLE}}\") &&\n !hasWs\n ) {\n continue;\n }\n let next = content;\n if (workspaceName !== undefined) {\n next = next.replace(/\\{\\{WORKSPACE_NAME\\}\\}/g, workspaceName);\n }\n next = next\n .replace(/\\{\\{APP_NAME\\}\\}/g, appName)\n .replace(/\\{\\{APP_TITLE\\}\\}/g, appTitle);\n fs.writeFileSync(p, next);\n }\n}\n\nfunction copyDir(src: string, dest: string, root?: string): void {\n const resolvedRoot = root ?? path.resolve(src);\n fs.mkdirSync(dest, { recursive: true });\n for (const entry of fs.readdirSync(src, { withFileTypes: true })) {\n const srcPath = path.join(src, entry.name);\n if (shouldSkipScaffoldEntry(entry.name, srcPath)) continue;\n const destPath = path.join(dest, entry.name);\n if (entry.isSymbolicLink()) {\n const target = fs.readlinkSync(srcPath);\n const resolvedTarget = path.resolve(path.dirname(srcPath), target);\n if (resolvedTarget.startsWith(resolvedRoot)) {\n fs.symlinkSync(target, destPath);\n } else {\n try {\n const stat = fs.statSync(srcPath);\n if (stat.isDirectory()) {\n copyDir(srcPath, destPath, resolvedRoot);\n } else {\n fs.copyFileSync(srcPath, destPath);\n }\n } catch {\n // Broken symlink — skip silently\n }\n }\n } else if (entry.isDirectory()) {\n copyDir(srcPath, destPath, resolvedRoot);\n } else {\n fs.copyFileSync(srcPath, destPath);\n }\n }\n}\n\nfunction shouldSkipScaffoldEntry(name: string, srcPath?: string): boolean {\n if (\n /^settings(?:\\..*)?\\.json$/.test(name) &&\n srcPath?.split(path.sep).includes(\".claude\")\n ) {\n return true;\n }\n if (\n name === \"node_modules\" ||\n name === \".agent-native\" ||\n name === \".env\" ||\n name === \".env.local\" ||\n name === \"pnpm-lock.yaml\" ||\n name === \".netlify\" ||\n name === \".vercel\" ||\n name === \".generated\" ||\n name === \".react-router\" ||\n name === \".output\" ||\n name === \"build\" ||\n name === \"dist\" ||\n name === \"test-results\" ||\n name === \"playwright-report\" ||\n name === \".DS_Store\"\n ) {\n return true;\n }\n return (\n name.endsWith(\".tmp.json\") ||\n /^qa-.*\\.db(?:-shm|-wal)?$/.test(name) ||\n /\\.db-(?:shm|wal)$/.test(name)\n );\n}\n"]}
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/cli/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEnD,OAAO,EACL,iCAAiC,EACjC,gCAAgC,GACjC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EACL,aAAa,EACb,WAAW,EACX,gBAAgB,GAEjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvE,MAAM,UAAU,GAAG,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAE3C,MAAM,IAAI,GAAG,wBAAwB,CAAC;AACtC,MAAM,aAAa,GAAG,WAAW,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AAI,CAAC,CAC/B,CAAC;AACJ,CAAC","sourcesContent":["import { execFileSync } from \"child_process\";\nimport fs from \"fs\";\nimport path from \"path\";\nimport { fileURLToPath, pathToFileURL } from \"url\";\n\nimport {\n DISPATCH_WORKSPACE_ROOT_REDIRECTS,\n getWorkspaceAppIdValidationError,\n} from \"../shared/workspace-app-id.js\";\nimport { setupAgentSymlinks } from \"./setup-agents.js\";\nimport {\n coreTemplates,\n getTemplate,\n allTemplateNames,\n type TemplateMeta,\n} from \"./templates-meta.js\";\nimport { workspacifyApp, parseWorkspaceScope } from \"./workspacify.js\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\nconst REPO = \"BuilderIO/agent-native\";\nconst TEMPLATES_DIR = \"templates\";\nconst POSTGRES_DEPENDENCY_VERSION = \"^3.4.9\";\nconst STANDALONE_EXACT_DEPENDENCY_OVERRIDES: Record<string, string> = {\n \"@react-router/dev\": \"8.1.0\",\n \"@react-router/fs-routes\": \"8.1.0\",\n \"react-router\": \"8.1.0\",\n};\nconst SENTRY_MINIMUM_RELEASE_AGE_EXCLUDES = ['\"@sentry/*\"'];\nconst FIRST_PARTY_TARBALL_SYMLINK_EXCLUDES = [\n \"*/CLAUDE.md\",\n \"*/.claude/skills\",\n];\n\n/**\n * Tagged error for input that fails CLI-level validation (repo names, app\n * names, etc.). The Sentry `beforeSend` hook in cli/index.ts drops events\n * whose top-level exception type is `ValidationError` so we don't pollute\n * Sentry with expected user-input rejections.\n */\nexport class ValidationError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"ValidationError\";\n }\n}\n\n/**\n * Move the primitive-first and chat on-ramps to the top of the list so they\n * line up with clack's default highlight.\n */\nfunction onRampFirst(templates: TemplateMeta[]): TemplateMeta[] {\n return moveTemplatesToFront(templates, [\"headless\", \"chat\"]);\n}\n\nfunction moveTemplatesToFront(\n templates: TemplateMeta[],\n preferredNames: string[],\n): TemplateMeta[] {\n const preferred = preferredNames\n .map((name) => templates.find((t) => t.name === name))\n .filter((template): template is TemplateMeta => Boolean(template));\n if (preferred.length === 0) return templates;\n const preferredSet = new Set(preferred.map((t) => t.name));\n return [...preferred, ...templates.filter((t) => !preferredSet.has(t.name))];\n}\n\n/** Primitive-first scaffold option appended to standalone pickers. */\nconst HEADLESS_OPTION = {\n name: \"headless\",\n label: \"Headless\",\n hint: \"Action-first app with one hello primitive and no UI shell\",\n};\n\nexport interface CreateAppOptions {\n /** Pre-select these templates in the picker. Comma-separated string or array. */\n template?: string;\n /** Scaffold a single standalone app (old behavior). Skips workspace creation. */\n standalone?: boolean;\n /** Internal: skip pnpm install at the end (for tests). */\n noInstall?: boolean;\n /**\n * Internal: always scaffold a workspace and skip the start-shape prompt.\n * Used by the deprecated `create-workspace` alias, whose contract is an\n * unconditional workspace scaffold.\n */\n forceWorkspace?: boolean;\n}\n\n/**\n * Main entry for `agent-native create [name]`.\n *\n * Default behavior: scaffold a workspace at <name>/ with a multi-select\n * template picker. Use --standalone for the single-app standalone flow.\n *\n * If run *inside* an existing workspace, falls through to the add-app\n * flow that scaffolds one new app under apps/<name>/.\n */\nexport async function createApp(\n name?: string,\n opts?: CreateAppOptions,\n): Promise<void> {\n const clack = await import(\"@clack/prompts\");\n\n // Reject an invalid provided name before any interactive prompt so bad input\n // fails fast instead of blocking on the start-shape picker below.\n if (name !== undefined) {\n assertValidProjectName(name, clack);\n }\n\n // If we're already inside a workspace, the meaning of `create <name>` is\n // \"add a new app to this workspace\". Delegate to add-app.\n const workspace = detectWorkspace(process.cwd());\n if (workspace) {\n await addAppToWorkspace(name, opts);\n return;\n }\n\n // Standalone escape hatch — behaves like the old single-app flow.\n if (opts?.standalone) {\n await createStandaloneApp(name, opts, clack);\n return;\n }\n\n // When exactly one template is specified explicitly, treat it as a\n // standalone scaffold (script-friendly, matches historic behavior).\n // Use `--template a,b` or pass no --template to opt into the workspace\n // flow with the multi-select picker.\n const parsed = parseTemplateList(opts?.template);\n // Headless can't live in a workspace, so reject it when more than one\n // template is requested or when workspace semantics are forced.\n if (\n parsed.includes(\"headless\") &&\n (parsed.length > 1 || opts?.forceWorkspace)\n ) {\n clack.cancel(\n \"The headless scaffold is standalone-only. Use `agent-native create my-app --headless`, or use the Chat template when adding a UI app to a workspace.\",\n );\n process.exit(1);\n }\n // A single explicit template scaffolds a standalone app, unless the caller\n // forces workspace semantics (the deprecated `create-workspace` alias), in\n // which case the template is preselected in the workspace picker below.\n if (parsed.length === 1 && !opts?.forceWorkspace) {\n await createStandaloneApp(name, opts, clack);\n return;\n }\n\n // No template specified: ask what shape to start from before diving into\n // \"which templates?\". The on-ramp choice implies the project structure, so\n // we don't ask a separate \"workspace or standalone?\" question — Chat and\n // Headless scaffold a single standalone app (the lightest starts; headless\n // cannot live in a workspace), while Template continues into the workspace\n // multi-select.\n if (parsed.length === 0) {\n // The deprecated `create-workspace` alias forces workspace semantics, so\n // it must skip the start-shape prompt and scaffold a workspace directly.\n if (opts?.forceWorkspace) {\n await createWorkspaceInteractive(name, opts, clack);\n return;\n }\n const shape = await promptStartShape(clack);\n if (shape === \"headless\" || shape === \"chat\") {\n await createStandaloneApp(name, { ...opts, template: shape }, clack);\n return;\n }\n // shape === \"template\" → full app(s) in a workspace.\n await createWorkspaceInteractive(name, opts, clack);\n return;\n }\n\n // Multiple explicit templates: create a workspace with them.\n await createWorkspaceInteractive(name, opts, clack);\n}\n\n/**\n * Top-level on-ramp shown by the bare `create <name>` command (no flags). The\n * choice made here implies the project structure, so we deliberately avoid a\n * separate \"workspace or standalone?\" question:\n * - \"template\" → full app(s) in a workspace (the multi-select picker)\n * - \"chat\" → a single standalone chat UI app\n * - \"headless\" → a single standalone action-first app with no UI shell\n * Chat and headless are standalone on purpose: a monorepo is unnecessary\n * ceremony for the lightest on-ramps, and headless cannot be a workspace\n * member. Either can grow into a workspace later via `add-app`.\n */\nasync function promptStartShape(\n clack: typeof import(\"@clack/prompts\"),\n): Promise<\"template\" | \"chat\" | \"headless\"> {\n const choice = await clack.select({\n message: \"How do you want to start?\",\n options: [\n {\n value: \"template\",\n label: \"Full template(s)\",\n hint: \"Clone complete apps (Mail, Calendar, Slides, ...) into a workspace\",\n },\n {\n value: \"chat\",\n label: \"Chat\",\n hint: \"A single app with a minimal chat UI and the browser shell wired up\",\n },\n {\n value: \"headless\",\n label: \"Headless\",\n hint: \"A single action-first app with one primitive and no UI shell\",\n },\n ],\n });\n if (clack.isCancel(choice)) {\n clack.cancel(\"Cancelled.\");\n process.exit(0);\n }\n return choice as \"template\" | \"chat\" | \"headless\";\n}\n\n/**\n * Validate a project name supplied on the command line. Mirrors the rule in\n * `promptNameIfMissing` so an invalid name is rejected before any interactive\n * prompt runs (the sub-flows re-validate, which is a harmless no-op).\n */\nfunction assertValidProjectName(\n name: string,\n clack: typeof import(\"@clack/prompts\"),\n): void {\n if (!/^[a-z][a-z0-9-]*$/.test(name)) {\n clack.cancel(\n `Invalid name \"${name}\". Use lowercase letters, numbers, and hyphens (must start with a letter).`,\n );\n process.exit(1);\n }\n}\n\n/* ─────────────────────────────────────────────────────────────────────────\n * Workspace creation (new default)\n * ───────────────────────────────────────────────────────────────────────── */\n\nasync function createWorkspaceInteractive(\n name: string | undefined,\n opts: CreateAppOptions | undefined,\n clack: typeof import(\"@clack/prompts\"),\n): Promise<void> {\n clack.intro(\"Create a new agent-native workspace\");\n\n name = await promptNameIfMissing(name, clack, \"workspace\", \"my-platform\");\n const preselected = parseTemplateList(opts?.template);\n\n clack.note(\n [\n `You're creating a workspace named \"${name}\". A workspace is a monorepo`,\n \"container — it isn't an app itself. Inside it you pick one or more apps\",\n \"(below), and each app gets its own route, agent, and UI. Apps in the\",\n \"same workspace share auth, database, and the agent chat. Add more apps\",\n \"later with `npx @agent-native/core@latest add-app`. Chat is the UI on-ramp\",\n \"for a minimal chat-first app with the browser shell already wired.\",\n \"Dispatch is always included as the workspace control plane —\",\n \"it owns shared secrets, messaging, approvals, and cross-app routing.\",\n ].join(\"\\n\"),\n \"About workspaces\",\n );\n\n // Dispatch is the workspace control plane (shared secrets, messaging,\n // approvals, cross-app routing) and is always scaffolded — the picker\n // only shows the optional apps. If the user explicitly passed\n // `--template=...`, those entries get unioned with dispatch.\n const optionalPicks =\n preselected.length > 0\n ? preselected.filter((t) => t !== \"dispatch\")\n : await promptTemplatePicker(preselected, clack, {\n defaultTemplates: [\"chat\"],\n preferredFirst: [\"chat\"],\n excludeNames: [\"dispatch\"],\n });\n const templates = [\"dispatch\", ...optionalPicks];\n\n const targetDir = path.resolve(process.cwd(), name);\n if (fs.existsSync(targetDir)) {\n clack.cancel(`Directory \"${name}\" already exists.`);\n process.exit(1);\n }\n\n const s = clack.spinner();\n s.start(`Scaffolding workspace \"${name}\"...`);\n const appNames = new Set<string>();\n const scaffoldedApps: string[] = [];\n\n try {\n await scaffoldWorkspaceRoot(targetDir, name);\n const workspaceCoreName = `@${name}/shared`;\n\n for (let i = 0; i < templates.length; i++) {\n const templateName = templates[i];\n const appName = workspaceAppNameForTemplateSelection(templateName);\n validateWorkspaceAppName(appName, clack, {\n allowDispatch: appName === \"dispatch\" && templateName === \"dispatch\",\n });\n if (appNames.has(appName)) {\n clack.cancel(\n `Workspace app \"${appName}\" is selected more than once. Choose unique app templates or app names.`,\n );\n process.exit(1);\n }\n appNames.add(appName);\n scaffoldedApps.push(appName);\n // Distinguish download vs local copy in the spinner so a multi-second\n // GitHub fetch doesn't look like a frozen \"Scaffolding...\" message.\n // Mirrors the local-vs-remote decision inside scaffoldAppTemplate.\n const willDownload =\n templateName !== \"headless\" && templateName.startsWith(\"github:\")\n ? true\n : !findLocalTemplate(normalizeTemplateName(templateName));\n s.message(\n willDownload\n ? `Downloading ${titleCase(appName)} template (${i + 1}/${templates.length})...`\n : `Scaffolding ${titleCase(appName)} (${i + 1}/${templates.length})...`,\n );\n const appDir = path.join(targetDir, \"apps\", appName);\n await scaffoldAppTemplate(appDir, templateName);\n s.message(\n `Configuring ${titleCase(appName)} (${i + 1}/${templates.length})...`,\n );\n replacePlaceholders(appDir, appName, appTitleForScaffold(appName), name);\n rewriteTrackingAppId(appDir, appName, templateName);\n workspacifyApp({\n appDir,\n appName,\n templateName,\n workspaceRoot: targetDir,\n workspaceCoreName,\n coreDependencyVersion: getCoreDependencyVersion(),\n dispatchDependencyVersion: getDispatchDependencyVersion(),\n toolkitDependencyVersion: getToolkitDependencyVersion(),\n });\n fixPackageJsonName(appDir, appName, templateName);\n fixWebManifestName(appDir, appName, templateName);\n rewriteNetlifyToml(appDir, appName, \"workspace\");\n renameGitignore(appDir);\n // Each app owns its own .claude / .agents symlinks.\n setupAgentSymlinks(appDir);\n }\n\n s.message(\"Adding shared packages...\");\n await scaffoldRequiredPackages(templates, targetDir);\n\n s.stop(\n `Workspace scaffolded with ${templates.length} app${templates.length === 1 ? \"\" : \"s\"}.`,\n );\n } catch (err: any) {\n s.stop(\"Failed to scaffold workspace.\");\n // Remove the partially-scaffolded workspace so a retry of `agent-native\n // create <name>` doesn't trip the \"Directory already exists\" guard.\n cleanupOnFailure(targetDir);\n clack.cancel(err?.message ?? String(err));\n process.exit(1);\n }\n\n tryGitInit(targetDir);\n\n // Show the user the tree we just built so the workspace/app distinction is\n // visible, not just described. First-time users routinely expect their\n // workspace name to be the app — seeing apps/<template>/ subdirectories\n // makes the structure concrete.\n const treeLines = [\n ` ${name}/ ← your workspace`,\n ...scaffoldedApps.map(\n (appName, i) =>\n ` ${i === scaffoldedApps.length - 1 ? \"└─\" : \"├─\"} apps/${appName}/`.padEnd(\n 30,\n ) + ` ← app`,\n ),\n ];\n const dispatchNextStep = [\n `Once running, open Dispatch — you'll see \"Workspace: ${titleCase(name)}\"`,\n `at the top, with all your apps listed under it.`,\n ];\n\n const installSteps = hasPnpm()\n ? [\n ` pnpm install`,\n ` pnpm dev # starts Dispatch on http://localhost:8092`,\n ]\n : [\n ` # pnpm is required but wasn't found on your PATH. Install it first:`,\n ` npm install -g pnpm`,\n ``,\n ` pnpm install`,\n ` pnpm dev # starts Dispatch on http://localhost:8092`,\n ];\n\n clack.outro(\n [\n `Created workspace \"${name}\" with ${templates.length} app${templates.length === 1 ? \"\" : \"s\"}:`,\n ``,\n ...treeLines,\n ``,\n `Next steps:`,\n ``,\n ` cd ${name}`,\n ...installSteps,\n ``,\n ...dispatchNextStep,\n ``,\n `Add another app later: npx @agent-native/core@latest add-app`,\n `Deploy the whole workspace: pnpm exec agent-native deploy`,\n ].join(\"\\n\"),\n );\n}\n\nfunction workspaceAppNameForTemplateSelection(templateName: string): string {\n const normalized = normalizeTemplateName(templateName);\n if (!normalized.startsWith(\"github:\")) return templateName;\n const repo = normalized.slice(\"github:\".length).trim();\n const repoName = repo.split(\"/\").filter(Boolean).pop() ?? \"app\";\n let appName = repoName\n .toLowerCase()\n .replace(/[^a-z0-9-]+/g, \"-\")\n .replace(/-+/g, \"-\")\n .replace(/^-+|-+$/g, \"\");\n if (!appName) appName = \"app\";\n if (!/^[a-z]/.test(appName)) appName = `app-${appName}`;\n return appName;\n}\n\n/**\n * Detect whether pnpm is on PATH. End-user machines often have npm/yarn but\n * not pnpm; the workspace scaffold uses pnpm workspaces, so we surface a\n * specific install hint in the outro when it's missing rather than letting\n * the user hit `zsh: command not found: pnpm`.\n */\nfunction hasPnpm(): boolean {\n try {\n execFileSync(\"pnpm\", [\"--version\"], { stdio: \"ignore\" });\n return true;\n } catch {\n return false;\n }\n}\n\nasync function scaffoldWorkspaceRoot(\n targetDir: string,\n name: string,\n): Promise<void> {\n const packageRoot = path.resolve(__dirname, \"../..\");\n const rootTemplate = path.join(packageRoot, \"src/templates/workspace-root\");\n const coreTemplate = path.join(packageRoot, \"src/templates/workspace-core\");\n\n copyDir(rootTemplate, targetDir);\n replacePlaceholders(targetDir, name, titleCase(name));\n rewriteCoreDependencyVersions(targetDir);\n renameGitignore(targetDir);\n\n // Inject the catalog from this repo's pnpm-workspace.yaml so templates'\n // `catalog:` version references resolve in the scaffolded workspace.\n const catalog = loadCatalog();\n if (Object.keys(catalog).length > 0) {\n const wsPath = path.join(targetDir, \"pnpm-workspace.yaml\");\n const existing = fs.existsSync(wsPath)\n ? fs.readFileSync(wsPath, \"utf-8\")\n : \"\";\n if (!existing.includes(\"catalog:\")) {\n const catalogYaml = Object.entries(catalog)\n .map(([k, v]) => ` \"${k}\": \"${v}\"`)\n .join(\"\\n\");\n fs.writeFileSync(\n wsPath,\n existing.trimEnd() + \"\\ncatalog:\\n\" + catalogYaml + \"\\n\",\n );\n }\n }\n\n const localToolkit = localToolkitOverride();\n if (localToolkit) {\n const wsPath = path.join(targetDir, \"pnpm-workspace.yaml\");\n const existing = fs.existsSync(wsPath)\n ? fs.readFileSync(wsPath, \"utf-8\")\n : \"\";\n const updated = mergeWorkspaceYamlSections(existing, {\n overrides: {\n '\"@agent-native/toolkit\"': JSON.stringify(localToolkit),\n },\n });\n if (updated !== existing) {\n fs.writeFileSync(wsPath, updated);\n }\n }\n\n const corePackageDir = path.join(targetDir, \"packages\", \"shared\");\n fs.mkdirSync(path.join(targetDir, \"packages\"), { recursive: true });\n copyDir(coreTemplate, corePackageDir);\n replacePlaceholders(corePackageDir, name, titleCase(name));\n rewriteCoreDependencyVersions(corePackageDir);\n setupAgentSymlinks(corePackageDir);\n\n // Ensure apps/ exists (even if empty).\n fs.mkdirSync(path.join(targetDir, \"apps\"), { recursive: true });\n\n // Root-level agent instructions apply before an agent descends into an app.\n linkWorkspaceRootSkills(targetDir);\n setupAgentSymlinks(targetDir);\n}\n\nfunction linkWorkspaceRootSkills(targetDir: string): void {\n const sharedSkillsDir = path.join(\n targetDir,\n \"packages\",\n \"shared\",\n \".agents\",\n \"skills\",\n );\n if (!fs.existsSync(sharedSkillsDir)) return;\n\n const agentsDir = path.join(targetDir, \".agents\");\n const linkPath = path.join(agentsDir, \"skills\");\n const target = \"../packages/shared/.agents/skills\";\n\n fs.mkdirSync(agentsDir, { recursive: true });\n\n try {\n const stat = fs.lstatSync(linkPath);\n if (stat.isSymbolicLink()) {\n if (fs.readlinkSync(linkPath) === target) return;\n fs.unlinkSync(linkPath);\n } else {\n return;\n }\n } catch {\n // Missing link; create below.\n }\n\n try {\n fs.symlinkSync(\n target,\n linkPath,\n process.platform === \"win32\" ? \"junction\" : \"dir\",\n );\n } catch {\n try {\n copyDir(sharedSkillsDir, linkPath);\n } catch {\n // Best-effort fallback for environments that disallow symlinks.\n }\n }\n}\n\n/* ─────────────────────────────────────────────────────────────────────────\n * Adding an app into an existing workspace\n * ───────────────────────────────────────────────────────────────────────── */\n\n/**\n * Entry for `agent-native add-app [name]`. Called from inside a workspace.\n * Shows the multi-select picker (excluding already-installed apps) and\n * scaffolds each selected template under apps/<name>/.\n *\n * When `name` is provided with `--template foo`, scaffolds exactly one app\n * named <name> using template foo (non-interactive).\n */\nexport async function addAppToWorkspace(\n name?: string,\n opts?: CreateAppOptions,\n): Promise<void> {\n const clack = await import(\"@clack/prompts\");\n const workspace = detectWorkspace(process.cwd());\n if (!workspace) {\n clack.cancel(\n \"Not inside a workspace. Run `agent-native create` to make one first, or use `--standalone`.\",\n );\n process.exit(1);\n }\n\n clack.intro(\"Add an app to your workspace\");\n\n const installed = listInstalledApps(workspace.workspaceRoot);\n\n // Non-interactive path: name + single --template\n const preselected = parseTemplateList(opts?.template);\n if (preselected.includes(\"headless\")) {\n clack.cancel(\n \"The headless scaffold is standalone-only. Use `agent-native create my-app --headless` outside a workspace, or use the Chat template when adding a UI app to a workspace.\",\n );\n process.exit(1);\n }\n if (name && preselected.length === 1) {\n const tpl = preselected[0];\n await scaffoldOneAppIntoWorkspace(workspace, name, tpl, clack);\n return;\n }\n\n const hasDispatch = installed.includes(\"dispatch\");\n const templates = await promptTemplatePicker(preselected, clack, {\n excludeNames: installed,\n message: \"Which apps do you want to add?\",\n defaultTemplates: hasDispatch ? undefined : [\"dispatch\"],\n preferredFirst: hasDispatch ? [\"chat\"] : [\"dispatch\", \"chat\"],\n recommendedNames: hasDispatch ? [] : [\"dispatch\"],\n });\n if (templates.length === 0) {\n clack.cancel(\"No apps selected. Cancelled.\");\n process.exit(0);\n }\n\n for (const t of templates) {\n await scaffoldOneAppIntoWorkspace(workspace, t, t, clack);\n }\n}\n\nasync function scaffoldOneAppIntoWorkspace(\n workspace: { workspaceRoot: string; workspaceCoreName: string },\n appName: string,\n templateName: string,\n clack: typeof import(\"@clack/prompts\"),\n): Promise<void> {\n // Dispatch is the one reserved-route exception: the canonical workspace\n // control-plane app intentionally owns /dispatch.\n validateWorkspaceAppName(appName, clack, {\n allowDispatch: appName === \"dispatch\" && templateName === \"dispatch\",\n });\n const appsDir = path.join(workspace.workspaceRoot, \"apps\");\n fs.mkdirSync(appsDir, { recursive: true });\n const appDir = path.join(appsDir, appName);\n\n if (fs.existsSync(appDir)) {\n clack.cancel(`Directory \"apps/${appName}\" already exists.`);\n process.exit(1);\n }\n\n const s = clack.spinner();\n s.start(\n `Working... no action needed. Scaffolding apps/${appName} from ${templateName}.`,\n );\n\n try {\n await scaffoldAppTemplate(appDir, templateName);\n replacePlaceholders(\n appDir,\n appName,\n appTitleForScaffold(appName),\n path.basename(workspace.workspaceRoot),\n );\n rewriteTrackingAppId(appDir, appName, templateName);\n workspacifyApp({\n appDir,\n appName,\n templateName,\n workspaceRoot: workspace.workspaceRoot,\n workspaceCoreName: workspace.workspaceCoreName,\n coreDependencyVersion: getCoreDependencyVersion(),\n dispatchDependencyVersion: getDispatchDependencyVersion(),\n toolkitDependencyVersion: getToolkitDependencyVersion(),\n });\n fixPackageJsonName(appDir, appName, templateName);\n fixWebManifestName(appDir, appName, templateName);\n rewriteNetlifyToml(appDir, appName, \"workspace\");\n renameGitignore(appDir);\n setupAgentSymlinks(appDir);\n await scaffoldRequiredPackages([templateName], workspace.workspaceRoot);\n s.stop(`Scaffolded apps/${appName}.`);\n } catch (err: any) {\n s.stop(`Failed to scaffold apps/${appName}.`);\n cleanupOnFailure(appDir);\n clack.cancel(err?.message ?? String(err));\n process.exit(1);\n }\n\n clack.outro(\n [\n `Done!`,\n ``,\n ` pnpm install`,\n ` pnpm dev`,\n ``,\n `The workspace gateway will detect apps/${appName} and serve it at /${appName}.`,\n ].join(\"\\n\"),\n );\n}\n\n/* ─────────────────────────────────────────────────────────────────────────\n * Standalone creation (escape hatch)\n * ───────────────────────────────────────────────────────────────────────── */\n\nasync function createStandaloneApp(\n name: string | undefined,\n opts: CreateAppOptions | undefined,\n clack: typeof import(\"@clack/prompts\"),\n): Promise<void> {\n clack.intro(\"Create a new standalone agent-native app\");\n\n name = await promptNameIfMissing(name, clack, \"app\", \"my-app\");\n\n const targetDir = path.resolve(process.cwd(), name);\n if (fs.existsSync(targetDir)) {\n clack.cancel(`Directory \"${name}\" already exists.`);\n process.exit(1);\n }\n\n // Standalone is single-select — pick one template.\n let template =\n opts?.template && !opts.template.includes(\",\") ? opts.template : undefined;\n if (!template) {\n const picked = await clack.select({\n message: \"Which template would you like to use?\",\n options: [\n {\n value: HEADLESS_OPTION.name,\n label: HEADLESS_OPTION.label,\n hint: HEADLESS_OPTION.hint,\n },\n ...onRampFirst(coreTemplates())\n .filter((t) => t.name !== HEADLESS_OPTION.name)\n .map((t) => ({\n value: t.name,\n label: t.label,\n hint: t.hint,\n })),\n ],\n });\n if (clack.isCancel(picked)) {\n clack.cancel(\"Cancelled.\");\n process.exit(0);\n }\n template = picked as string;\n }\n template = normalizeTemplateName(template);\n\n const s = clack.spinner();\n s.start(\n template === \"headless\"\n ? \"Scaffolding the headless agent app...\"\n : `Downloading the ${template} template from GitHub...`,\n );\n try {\n await scaffoldAppTemplate(targetDir, template);\n s.message(`Setting up ${name}…`);\n postProcessStandalone(name, targetDir, template);\n s.stop(\"App created!\");\n } catch (err: any) {\n s.stop(\"Failed to create app.\");\n cleanupOnFailure(targetDir);\n clack.cancel(err?.message ?? String(err));\n process.exit(1);\n }\n\n tryGitInit(targetDir);\n\n if (template === \"headless\") {\n clack.outro(\n [\n \"Done! Next steps:\",\n \"\",\n ` cd ${name}`,\n \" pnpm install\",\n \" pnpm action hello --name Builder\",\n ` pnpm agent \"Call hello for Builder\"`,\n \"\",\n \"Add a UI later by starting from the Chat template; `agent-native add` is reserved for integration blueprints.\",\n ].join(\"\\n\"),\n );\n } else {\n clack.outro(\n `Done! Next steps:\\n\\n cd ${name}\\n pnpm install\\n pnpm dev`,\n );\n }\n}\n\n/**\n * Remove a partially-scaffolded target directory after a scaffold failure so a\n * retry doesn't hit the \"Directory already exists\" guard. Best-effort — the\n * underlying failure is what we want surfaced, so we swallow rm errors and\n * skip if the directory is somehow already gone.\n */\nfunction cleanupOnFailure(targetDir: string): void {\n try {\n if (fs.existsSync(targetDir)) {\n fs.rmSync(targetDir, { recursive: true, force: true });\n }\n } catch {\n // Ignore — original error is more useful than a cleanup failure.\n }\n}\n\n/* ─────────────────────────────────────────────────────────────────────────\n * Shared scaffolding helpers\n * ───────────────────────────────────────────────────────────────────────── */\n\n/**\n * Scaffold a single app template into `targetDir`. Resolves:\n * - \"headless\" / legacy \"blank\" → bundled action-first template\n * - \"github:user/repo\" → download the whole repo\n * - first-party template name → download that subdir from BuilderIO/agent-native\n */\nasync function scaffoldAppTemplate(\n targetDir: string,\n template: string,\n): Promise<void> {\n fs.mkdirSync(path.dirname(targetDir), { recursive: true });\n\n // Normalize legacy / renamed aliases.\n let resolved = normalizeTemplateName(template);\n\n if (resolved === \"headless\") {\n const packageRoot = path.resolve(__dirname, \"../..\");\n const headlessDir = path.join(packageRoot, \"src/templates/headless\");\n if (!fs.existsSync(headlessDir)) {\n throw new Error(\n `Headless template not found at ${headlessDir}. Is the package installed correctly?`,\n );\n }\n copyDir(headlessDir, targetDir);\n return;\n }\n\n if (resolved.startsWith(\"github:\")) {\n const repo = resolved.slice(\"github:\".length);\n await downloadGitHubRepo(repo, targetDir);\n return;\n }\n\n if (!getTemplate(resolved)) {\n throw new Error(\n `Unknown template \"${template}\". Known: ${allTemplateNames().join(\", \")} — or use github:user/repo for community templates.`,\n );\n }\n\n // If running from the framework monorepo with a local templates/ dir, use\n // that. Otherwise download from GitHub. This keeps `agent-native create`\n // fast during framework development.\n const sourceTemplate = templateSourceName(resolved);\n const localTemplate = findLocalTemplate(sourceTemplate);\n if (localTemplate) {\n copyDir(localTemplate, targetDir);\n } else {\n await downloadGitHubSubdir(\n REPO,\n `${TEMPLATES_DIR}/${sourceTemplate}`,\n targetDir,\n );\n }\n}\n\nfunction templateSourceName(name: string): string {\n if (name === \"starter\") return \"chat\";\n return name;\n}\n\n/**\n * When developing the framework itself, prefer the sibling templates/<name>\n * directory. Returns undefined when running as a published package.\n */\nfunction findLocalTemplate(name: string): string | undefined {\n let dir = path.resolve(__dirname);\n for (let i = 0; i < 10; i++) {\n const candidate = path.join(dir, \"templates\", name);\n if (fs.existsSync(path.join(candidate, \"package.json\"))) {\n return candidate;\n }\n const parent = path.dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n return undefined;\n}\n\nfunction normalizeTemplateName(template: string): string {\n if (template === \"blank\") return \"headless\";\n if (template === \"image\" || template === \"images\" || template === \"asset\") {\n return \"assets\";\n }\n return template;\n}\n\n/**\n * Find a local packages/<name> directory (for framework development).\n * Returns undefined when running as a published npm package.\n */\nfunction findLocalPackage(name: string): string | undefined {\n let dir = path.resolve(__dirname);\n for (let i = 0; i < 10; i++) {\n const candidate = path.join(dir, \"packages\", name);\n if (fs.existsSync(path.join(candidate, \"package.json\"))) {\n return candidate;\n }\n const parent = path.dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n return undefined;\n}\n\n/**\n * Scaffold internal workspace packages required by the selected templates.\n * Deduplicates so each package is only copied once even if multiple\n * templates need it.\n */\nasync function scaffoldRequiredPackages(\n templateNames: string[],\n workspaceRoot: string,\n): Promise<void> {\n const needed = new Set<string>();\n for (const t of templateNames) {\n const meta = getTemplate(t);\n if (meta?.requiredPackages) {\n for (const p of meta.requiredPackages) needed.add(p);\n }\n }\n\n for (const pkgName of needed) {\n const targetDir = path.join(workspaceRoot, \"packages\", pkgName);\n if (fs.existsSync(targetDir)) continue;\n\n fs.mkdirSync(path.join(workspaceRoot, \"packages\"), { recursive: true });\n\n const localPkg = findLocalPackage(pkgName);\n if (localPkg) {\n copyDir(localPkg, targetDir);\n } else {\n await downloadGitHubSubdir(REPO, `packages/${pkgName}`, targetDir);\n }\n\n // The copied package may have published framework packages as workspace:*\n // deps. Convert them to published ranges because these package-backed\n // modules are npm dependencies, not scaffolded workspace members.\n const pkgJsonPath = path.join(targetDir, \"package.json\");\n if (fs.existsSync(pkgJsonPath)) {\n try {\n const pkg = JSON.parse(fs.readFileSync(pkgJsonPath, \"utf-8\"));\n for (const depType of [\n \"dependencies\",\n \"devDependencies\",\n \"peerDependencies\",\n ] as const) {\n const deps = pkg[depType];\n if (!deps) continue;\n for (const [key, val] of Object.entries(deps)) {\n if (\n typeof val === \"string\" &&\n val.startsWith(\"workspace:\") &&\n key === \"@agent-native/core\"\n ) {\n deps[key] = getCoreDependencyVersion();\n }\n if (\n typeof val === \"string\" &&\n val.startsWith(\"workspace:\") &&\n key === \"@agent-native/toolkit\"\n ) {\n deps[key] = getToolkitDependencyVersion();\n }\n }\n }\n fs.writeFileSync(pkgJsonPath, JSON.stringify(pkg, null, 2) + \"\\n\");\n } catch {}\n }\n }\n\n // Add a postinstall script to build workspace packages so their dist/\n // directories exist even when downloaded from GitHub (where dist/ is\n // gitignored).\n if (needed.size > 0) {\n const rootPkgPath = path.join(workspaceRoot, \"package.json\");\n if (fs.existsSync(rootPkgPath)) {\n try {\n const rootPkg = JSON.parse(fs.readFileSync(rootPkgPath, \"utf-8\"));\n rootPkg.scripts = rootPkg.scripts ?? {};\n const builds = [...needed]\n .map((n) => `pnpm --filter ./packages/${n} build`)\n .join(\" && \");\n const existing = rootPkg.scripts.postinstall;\n if (existing) {\n if (!existing.includes(builds)) {\n rootPkg.scripts.postinstall = `${existing} && ${builds}`;\n }\n } else {\n rootPkg.scripts.postinstall = builds;\n }\n fs.writeFileSync(rootPkgPath, JSON.stringify(rootPkg, null, 2) + \"\\n\");\n } catch {}\n }\n }\n}\n\n/**\n * Post-process a standalone scaffold: replace placeholders, strip\n * workspace:* deps, set up agent symlinks, etc.\n */\nfunction postProcessStandalone(\n name: string,\n targetDir: string,\n templateName?: string,\n): void {\n const appTitle = appTitleForScaffold(name);\n replacePlaceholders(targetDir, name, appTitle);\n rewriteTrackingAppId(targetDir, name, templateName);\n rewriteAgentChatAppId(targetDir, name, templateName);\n fixPackageJsonName(targetDir, name, templateName);\n fixWebManifestName(targetDir, name, templateName);\n rewriteNetlifyToml(targetDir, name, \"standalone\");\n\n for (const base of [\"learnings\"]) {\n const defaultsFile = path.join(targetDir, `${base}.defaults.md`);\n const targetFile = path.join(targetDir, `${base}.md`);\n if (fs.existsSync(defaultsFile) && !fs.existsSync(targetFile)) {\n fs.copyFileSync(defaultsFile, targetFile);\n }\n }\n\n renameGitignore(targetDir);\n\n // No monorepo-only files to drop for standalone scaffolds.\n // DEVELOPING.md is intentionally kept: it documents local run commands,\n // DATABASE_URL defaults, and other local-run instructions that are equally\n // valid for standalone apps.\n\n // Resolve workspace:* and catalog: deps for standalone projects.\n // catalog: references only resolve inside a pnpm workspace with a catalog\n // defined in pnpm-workspace.yaml — standalone scaffolds don't have one.\n const catalog = loadCatalog();\n const pkgPath = path.join(targetDir, \"package.json\");\n if (fs.existsSync(pkgPath)) {\n try {\n const pkg = JSON.parse(fs.readFileSync(pkgPath, \"utf-8\"));\n for (const depType of [\n \"dependencies\",\n \"devDependencies\",\n \"peerDependencies\",\n ] as const) {\n const deps = pkg[depType];\n if (!deps) continue;\n for (const [key, val] of Object.entries(deps)) {\n const exactOverride = STANDALONE_EXACT_DEPENDENCY_OVERRIDES[key];\n if (exactOverride) {\n deps[key] = exactOverride;\n } else if (key === \"@agent-native/core\") {\n deps[key] = getCoreDependencyVersion();\n } else if (key === \"@agent-native/toolkit\") {\n deps[key] = getToolkitDependencyVersion();\n } else if (typeof val === \"string\" && val.startsWith(\"workspace:\")) {\n deps[key] = \"latest\";\n } else if (typeof val === \"string\" && val === \"catalog:\") {\n deps[key] = catalog[key] ?? \"latest\";\n }\n }\n }\n // Ensure pnpm.onlyBuiltDependencies is set so native packages\n // (better-sqlite3, esbuild, node-pty) compile their postinstall scripts\n // under pnpm 10+ without prompting for `pnpm approve-builds`.\n pkg.dependencies = pkg.dependencies ?? {};\n pkg.dependencies.postgres ??= POSTGRES_DEPENDENCY_VERSION;\n\n const requiredBuilt = [\"better-sqlite3\", \"esbuild\", \"node-pty\"];\n if (!pkg.pnpm || typeof pkg.pnpm !== \"object\") {\n pkg.pnpm = {};\n }\n const existing = Array.isArray(pkg.pnpm.onlyBuiltDependencies)\n ? pkg.pnpm.onlyBuiltDependencies\n : [];\n pkg.pnpm.onlyBuiltDependencies = Array.from(\n new Set([...existing, ...requiredBuilt]),\n );\n fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + \"\\n\");\n } catch {}\n }\n\n // Write pnpm-workspace.yaml for pnpm v11 compatibility. pnpm v11 no longer\n // reads the pnpm field in package.json, so allowBuilds and overrides must\n // live here. Merge into any existing file (e.g. from the default template)\n // without creating duplicate section headers.\n const wsPath = path.join(targetDir, \"pnpm-workspace.yaml\");\n try {\n const existing = fs.existsSync(wsPath)\n ? fs.readFileSync(wsPath, \"utf-8\")\n : \"\";\n const sections: Record<string, Record<string, string>> = {\n allowBuilds: {\n \"better-sqlite3\": \"true\",\n esbuild: \"true\",\n \"node-pty\": \"true\",\n },\n };\n if (templateName !== \"headless\") {\n sections.overrides = {\n '\"@assistant-ui/store\"': '\">=0.2.9 <0.2.14\"',\n '\"@assistant-ui/tap\"': '\"^0.5.14\"',\n nf3: '\"0.3.17\"',\n };\n }\n const localToolkit = localToolkitOverride();\n if (localToolkit) {\n sections.overrides ??= {};\n sections.overrides['\"@agent-native/toolkit\"'] =\n JSON.stringify(localToolkit);\n }\n let updated = mergeWorkspaceYamlSections(existing, sections);\n updated = mergeWorkspaceYamlListItems(\n updated,\n \"minimumReleaseAgeExclude\",\n SENTRY_MINIMUM_RELEASE_AGE_EXCLUDES,\n );\n if (updated !== existing) {\n fs.writeFileSync(wsPath, updated);\n }\n } catch {}\n\n fixStandaloneTsconfig(targetDir, templateName);\n\n setupAgentSymlinks(targetDir);\n}\n\nfunction fixStandaloneTsconfig(targetDir: string, templateName?: string): void {\n const tsconfigPath = path.join(targetDir, \"tsconfig.json\");\n if (!fs.existsSync(tsconfigPath)) return;\n try {\n const tsconfig = JSON.parse(fs.readFileSync(tsconfigPath, \"utf-8\")) as {\n compilerOptions?: Record<string, unknown>;\n };\n tsconfig.compilerOptions ??= {};\n const hasUiApp =\n templateName !== \"headless\" && fs.existsSync(path.join(targetDir, \"app\"));\n const paths = {\n ...((tsconfig.compilerOptions.paths as Record<string, string[]>) ?? {}),\n };\n paths[\"*\"] ??= [\"./*\"];\n if (hasUiApp) {\n paths[\"@/*\"] ??= [\"./app/*\"];\n paths[\"@shared/*\"] ??= [\"./shared/*\"];\n }\n // baseUrl is deprecated/errors in TS 6 (TS5101/TS5102) and removed in TS 7\n // (tsgo, which CI runs). paths already resolve relative to this tsconfig,\n // and the \"*\": [\"./*\"] entry replaces baseUrl's bare-specifier resolution,\n // so never emit baseUrl into scaffolds.\n delete tsconfig.compilerOptions.baseUrl;\n tsconfig.compilerOptions.paths = paths;\n fs.writeFileSync(tsconfigPath, `${JSON.stringify(tsconfig, null, 2)}\\n`);\n } catch {}\n}\n\n/* ─────────────────────────────────────────────────────────────────────────\n * Prompting helpers\n * ───────────────────────────────────────────────────────────────────────── */\n\nasync function promptNameIfMissing(\n name: string | undefined,\n clack: typeof import(\"@clack/prompts\"),\n kind: \"workspace\" | \"app\",\n placeholder: string,\n): Promise<string> {\n if (name) {\n if (!/^[a-z][a-z0-9-]*$/.test(name)) {\n clack.cancel(\n `Invalid ${kind} name \"${name}\". Use lowercase letters, numbers, and hyphens.`,\n );\n process.exit(1);\n }\n return name;\n }\n const result = await clack.text({\n message: `What is your ${kind} name?`,\n placeholder,\n validate(value) {\n if (!value)\n return `${kind[0].toUpperCase() + kind.slice(1)} name is required`;\n if (!/^[a-z][a-z0-9-]*$/.test(value)) {\n return \"Use lowercase letters, numbers, and hyphens (must start with a letter)\";\n }\n if (fs.existsSync(path.resolve(process.cwd(), value))) {\n return `Directory \"${value}\" already exists`;\n }\n },\n });\n if (clack.isCancel(result)) {\n clack.cancel(\"Cancelled.\");\n process.exit(0);\n }\n return result as string;\n}\n\nasync function promptTemplatePicker(\n preselected: string[],\n clack: typeof import(\"@clack/prompts\"),\n opts?: {\n defaultTemplates?: string[];\n excludeNames?: string[];\n message?: string;\n preferredFirst?: string[];\n recommendedNames?: string[];\n },\n): Promise<string[]> {\n const excluded = new Set(opts?.excludeNames ?? []);\n const orderedTemplates = opts?.preferredFirst\n ? moveTemplatesToFront(coreTemplates(), opts.preferredFirst)\n : onRampFirst(coreTemplates());\n const recommendedNames = new Set(opts?.recommendedNames ?? []);\n const options = orderedTemplates\n .filter((t) => !excluded.has(t.name))\n .map((t) => ({\n value: t.name,\n label: recommendedNames.has(t.name)\n ? `${t.label} (recommended)`\n : t.label,\n hint:\n recommendedNames.has(t.name) && t.name === \"dispatch\"\n ? \"Recommended workspace control plane: secrets, messaging, approvals, and A2A delegation\"\n : t.hint,\n }));\n\n // If there's nothing left to pick, the caller gets an empty selection —\n // they decide how to handle it.\n if (options.length === 0) return [];\n\n // Default pre-selection: what the user passed via --template, falling\n // back to caller defaults, then to \"chat\" when available.\n const defaults =\n preselected.length > 0\n ? preselected.filter((p) => options.some((o) => o.value === p))\n : opts?.defaultTemplates\n ? opts.defaultTemplates.filter((p) =>\n options.some((o) => o.value === p),\n )\n : options.some((o) => o.value === \"chat\")\n ? [\"chat\"]\n : [];\n\n const baseMessage = opts?.message ?? \"Which apps would you like to include?\";\n const result = await clack.multiselect({\n message: `${baseMessage}\\n (↑/↓ move · space to toggle · enter to confirm)`,\n options,\n initialValues: defaults,\n required: false,\n });\n if (clack.isCancel(result)) {\n clack.cancel(\"Cancelled.\");\n process.exit(0);\n }\n return result as string[];\n}\n\nfunction parseTemplateList(input?: string): string[] {\n if (!input) return [];\n return input\n .split(\",\")\n .map((s) => normalizeTemplateName(s.trim()))\n .filter(Boolean);\n}\n\nfunction listInstalledApps(workspaceRoot: string): string[] {\n const appsDir = path.join(workspaceRoot, \"apps\");\n if (!fs.existsSync(appsDir)) return [];\n return fs\n .readdirSync(appsDir, { withFileTypes: true })\n .filter((e) => e.isDirectory())\n .map((e) => e.name);\n}\n\n/* ─────────────────────────────────────────────────────────────────────────\n * Workspace detection\n * ───────────────────────────────────────────────────────────────────────── */\n\n/**\n * Walk up from startDir looking for a package.json with\n * `agent-native.workspaceCore` set. Returns the workspace root and core\n * package name, or null if not inside a workspace.\n */\nexport function detectWorkspace(\n startDir: string,\n): { workspaceRoot: string; workspaceCoreName: string } | null {\n let dir = path.resolve(startDir);\n for (let i = 0; i < 20; i++) {\n const pkgPath = path.join(dir, \"package.json\");\n if (fs.existsSync(pkgPath)) {\n try {\n const pkg = JSON.parse(fs.readFileSync(pkgPath, \"utf-8\"));\n const wsCore = pkg?.[\"agent-native\"]?.workspaceCore;\n if (typeof wsCore === \"string\" && wsCore.length > 0) {\n return { workspaceRoot: dir, workspaceCoreName: wsCore };\n }\n } catch {}\n }\n const parent = path.dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n return null;\n}\n\nexport { parseWorkspaceScope };\n\n/** @internal — exported for E2E tests */\nexport {\n scaffoldWorkspaceRoot as _scaffoldWorkspaceRoot,\n scaffoldAppTemplate as _scaffoldAppTemplate,\n scaffoldRequiredPackages as _scaffoldRequiredPackages,\n postProcessStandalone as _postProcessStandalone,\n loadCatalog as _loadCatalog,\n fixPackageJsonName as _fixPackageJsonName,\n renameGitignore as _renameGitignore,\n rewriteNetlifyToml as _rewriteNetlifyToml,\n getCoreDependencyVersion as _getCoreDependencyVersion,\n getDispatchDependencyVersion as _getDispatchDependencyVersion,\n getToolkitDependencyVersion as _getToolkitDependencyVersion,\n getGitHubTemplateRef as _getGitHubTemplateRef,\n getGitHubTemplateRefCandidates as _getGitHubTemplateRefCandidates,\n workspaceAppNameForTemplateSelection as _workspaceAppNameForTemplateSelection,\n shouldSkipScaffoldEntry as _shouldSkipScaffoldEntry,\n tarExtractArgs as _tarExtractArgs,\n};\n\n/* ─────────────────────────────────────────────────────────────────────────\n * Download / copy helpers\n * ───────────────────────────────────────────────────────────────────────── */\n\nfunction validateRepoName(repo: string): void {\n if (!/^[a-zA-Z0-9_.-]+\\/[a-zA-Z0-9_.-]+$/.test(repo)) {\n throw new ValidationError(\n `Invalid repository name \"${repo}\". Expected format: user/repo`,\n );\n }\n}\n\nfunction tarExtractArgs(\n tarPath: string,\n destDir: string,\n options: { skipAgentSymlinks?: boolean } = {},\n): string[] {\n const excludes = options.skipAgentSymlinks\n ? FIRST_PARTY_TARBALL_SYMLINK_EXCLUDES.flatMap((pattern) => [\n \"--exclude\",\n pattern,\n ])\n : [];\n return [\"xzf\", tarPath, \"--strip-components=1\", ...excludes, \"-C\", destDir];\n}\n\nfunction downloadAndExtract(\n url: string,\n destDir: string,\n options: { skipAgentSymlinks?: boolean } = {},\n): void {\n fs.mkdirSync(destDir, { recursive: true });\n // --fail-with-body so curl exits non-zero on HTTP 4xx/5xx instead of writing\n // the error body (HTML/JSON) to disk where tar then fails with the opaque\n // \"Unrecognized archive format\" message.\n const tarball = execFileSync(\"curl\", [\"--fail-with-body\", \"-sL\", url], {\n maxBuffer: 100 * 1024 * 1024,\n });\n const tarPath = path.join(destDir, \".download.tar.gz\");\n fs.writeFileSync(tarPath, tarball);\n try {\n execFileSync(\"tar\", tarExtractArgs(tarPath, destDir, options), {\n stdio: \"pipe\",\n });\n } finally {\n fs.unlinkSync(tarPath);\n }\n}\n\nasync function downloadGitHubSubdir(\n repo: string,\n subdir: string,\n targetDir: string,\n): Promise<void> {\n validateRepoName(repo);\n const refs = getGitHubTemplateRefCandidates();\n const errors: string[] = [];\n for (const ref of refs) {\n const tarUrl = `https://api.github.com/repos/${repo}/tarball/${encodeURIComponent(ref)}`;\n const tmpDir = path.join(\n targetDir,\n \"..\",\n `.agent-native-tmp-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,\n );\n try {\n downloadAndExtract(tarUrl, tmpDir, { skipAgentSymlinks: repo === REPO });\n const srcDir = path.join(tmpDir, subdir);\n if (!fs.existsSync(srcDir)) {\n throw new Error(\n `Template directory \"${subdir}\" not found at ref \"${ref}\".`,\n );\n }\n copyDir(srcDir, targetDir);\n return;\n } catch (err) {\n errors.push(\n ` ${ref}: ${err instanceof Error ? err.message.split(\"\\n\")[0] : String(err)}`,\n );\n } finally {\n fs.rmSync(tmpDir, { recursive: true, force: true });\n }\n }\n throw new Error(\n `Failed to download templates from ${repo}. Tried refs:\\n${errors.join(\"\\n\")}`,\n );\n}\n\nasync function downloadGitHubRepo(\n repo: string,\n targetDir: string,\n): Promise<void> {\n validateRepoName(repo);\n const tarUrl = `https://api.github.com/repos/${repo}/tarball/main`;\n downloadAndExtract(tarUrl, targetDir);\n}\n\n/* ─────────────────────────────────────────────────────────────────────────\n * Text / filesystem helpers\n * ───────────────────────────────────────────────────────────────────────── */\n\n/**\n * Merge key-value entries into named sections of a pnpm-workspace.yaml string\n * without creating duplicate section headers. For each section:\n * - If the section already exists, new entries are injected after its header.\n * - If the section is absent, a new block is appended at the end.\n * Entries already present (by key) are skipped.\n */\nfunction mergeWorkspaceYamlSections(\n yaml: string,\n sections: Record<string, Record<string, string>>,\n): string {\n let result = yaml;\n for (const [section, entries] of Object.entries(sections)) {\n for (const [key, value] of Object.entries(entries)) {\n if (result.includes(key)) continue;\n const sectionHeader = new RegExp(`^${section}:\\\\s*$`, \"m\");\n const match = sectionHeader.exec(result);\n if (match) {\n const insertAt = match.index + match[0].length;\n result =\n result.slice(0, insertAt) +\n `\\n ${key}: ${value}` +\n result.slice(insertAt);\n } else {\n result =\n result.trimEnd() +\n (result ? \"\\n\" : \"\") +\n `\\n${section}:\\n ${key}: ${value}\\n`;\n }\n }\n }\n return result;\n}\n\nfunction mergeWorkspaceYamlListItems(\n yaml: string,\n section: string,\n items: string[],\n): string {\n let result = yaml;\n for (const item of items) {\n const rendered = ` - ${item}`;\n if (result.includes(rendered)) continue;\n const sectionHeader = new RegExp(`^${section}:\\\\s*$`, \"m\");\n const match = sectionHeader.exec(result);\n if (match) {\n const insertAt = match.index + match[0].length;\n result =\n result.slice(0, insertAt) + `\\n${rendered}` + result.slice(insertAt);\n } else {\n result =\n result.trimEnd() +\n (result ? \"\\n\" : \"\") +\n `\\n${section}:\\n${rendered}\\n`;\n }\n }\n return result;\n}\n\n/**\n * Load the pnpm workspace catalog.\n * First tries the build-time snapshot at dist/catalog.json (works when\n * running as a published npm package). Falls back to parsing the monorepo\n * pnpm-workspace.yaml (works during local framework development).\n */\nfunction loadCatalog(): Record<string, string> {\n try {\n // Build-time snapshot generated by finalize-build.mjs\n const snapshotPath = path.resolve(__dirname, \"../catalog.json\");\n if (fs.existsSync(snapshotPath)) {\n return JSON.parse(fs.readFileSync(snapshotPath, \"utf-8\"));\n }\n\n // Fallback: parse pnpm-workspace.yaml from the monorepo root\n // From dist/cli/ or src/cli/: 4 levels up → packages/core → packages → repo root\n const repoRoot = path.resolve(__dirname, \"../../../..\");\n const wsPath = path.join(repoRoot, \"pnpm-workspace.yaml\");\n if (!fs.existsSync(wsPath)) return {};\n const content = fs.readFileSync(wsPath, \"utf-8\");\n const result: Record<string, string> = {};\n let inCatalog = false;\n for (const line of content.split(\"\\n\")) {\n if (/^catalog:\\s*$/.test(line)) {\n inCatalog = true;\n continue;\n }\n if (inCatalog) {\n if (/^\\S/.test(line)) break;\n const match = line.match(/^\\s+\"?([^\":]+)\"?\\s*:\\s*\"?([^\"]+)\"?\\s*$/);\n if (match) result[match[1]] = match[2];\n }\n }\n return result;\n } catch {\n return {};\n }\n}\n\nfunction titleCase(name: string): string {\n return name\n .split(\"-\")\n .map((w) => (w ? w[0].toUpperCase() + w.slice(1) : w))\n .join(\" \");\n}\n\nfunction appTitleForScaffold(appName: string): string {\n return titleCase(appName);\n}\n\nfunction isChatOnRampTemplate(templateName: string | undefined): boolean {\n return templateName === \"chat\" || templateName === \"starter\";\n}\n\nfunction trackingTemplateName(\n templateName: string | undefined,\n): string | undefined {\n return templateName === \"starter\" ? \"chat\" : templateName;\n}\n\nfunction defaultPackageDescriptionForScaffold(appName: string): string {\n const appTitle = appTitleForScaffold(appName);\n return `Workspace app for ${appTitle}.`;\n}\n\nfunction shouldReplaceScaffoldDescription(value: unknown): boolean {\n if (typeof value !== \"string\" || !value.trim()) return true;\n return /\\b(starter|new app|blank\\b.*\\bapp)\\b/i.test(value);\n}\n\nfunction fixPackageJsonName(\n appDir: string,\n name: string,\n templateName?: string,\n): void {\n const pkgPath = path.join(appDir, \"package.json\");\n if (!fs.existsSync(pkgPath)) return;\n try {\n const pkg = JSON.parse(fs.readFileSync(pkgPath, \"utf-8\"));\n pkg.name = name;\n const appTitle = appTitleForScaffold(name);\n // When the user picked a custom name (e.g. `add-app todo --template=chat`)\n // the template's displayName would otherwise leak into the workspace apps\n // grid as the new app's label. Overwrite it so the app shows up as \"Todo\"\n // instead of the source template's branding.\n if (templateName && name !== templateName) {\n pkg.displayName = appTitle;\n }\n if (\n shouldReplaceScaffoldDescription(pkg.description) ||\n (isChatOnRampTemplate(templateName) && name !== templateName)\n ) {\n pkg.description = defaultPackageDescriptionForScaffold(name);\n }\n fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + \"\\n\");\n } catch {}\n}\n\nfunction fixWebManifestName(\n appDir: string,\n name: string,\n templateName?: string,\n): void {\n if (!isChatOnRampTemplate(templateName) || name === templateName) return;\n const manifestPath = path.join(appDir, \"public\", \"manifest.json\");\n if (!fs.existsSync(manifestPath)) return;\n try {\n const manifest = JSON.parse(fs.readFileSync(manifestPath, \"utf-8\"));\n const appTitle = titleCase(name);\n manifest.name = appTitle;\n manifest.short_name = appTitle;\n if (\n typeof manifest.description !== \"string\" ||\n /\\b(blank app|starter|chat-first)\\b/i.test(manifest.description)\n ) {\n manifest.description = defaultPackageDescriptionForScaffold(name);\n }\n fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2) + \"\\n\");\n } catch {}\n}\n\nfunction getCoreDependencyVersion(): string {\n if (process.env.AGENT_NATIVE_CREATE_USE_LOCAL_CORE === \"1\") {\n const localCore = findLocalPackage(\"core\");\n if (localCore) return pathToFileURL(localCore).href;\n }\n\n // Generated apps must install before the current package version is\n // published. The dist-tag resolves to the newest released core today and to\n // this package version once the release goes live. Local file deps are\n // intentionally opt-in so scaffolded repos remain portable by default.\n return \"latest\";\n}\n\nfunction getDispatchDependencyVersion(): string {\n if (process.env.AGENT_NATIVE_CREATE_USE_LOCAL_CORE === \"1\") {\n const localDispatch = findLocalPackage(\"dispatch\");\n if (localDispatch) return pathToFileURL(localDispatch).href;\n }\n\n return \"latest\";\n}\n\nfunction getToolkitDependencyVersion(): string {\n if (process.env.AGENT_NATIVE_CREATE_USE_LOCAL_CORE === \"1\") {\n const localToolkit = findLocalPackage(\"toolkit\");\n if (localToolkit) return pathToFileURL(localToolkit).href;\n }\n\n return \"latest\";\n}\n\nfunction localToolkitOverride(): string | null {\n if (process.env.AGENT_NATIVE_CREATE_USE_LOCAL_CORE !== \"1\") return null;\n const localToolkit = findLocalPackage(\"toolkit\");\n return localToolkit ? pathToFileURL(localToolkit).href : null;\n}\n\nfunction getCorePackageVersion(): string | undefined {\n try {\n const packageRoot = path.resolve(__dirname, \"../..\");\n const pkg = JSON.parse(\n fs.readFileSync(path.join(packageRoot, \"package.json\"), \"utf-8\"),\n );\n return typeof pkg.version === \"string\" ? pkg.version : undefined;\n } catch {\n return undefined;\n }\n}\n\n/**\n * Git refs to try, in priority order, when downloading templates from the\n * framework repo. The release tag scheme has shifted over time:\n *\n * - ≤ 0.7.83: single repo-wide tag `v<version>` (legacy).\n * - ≥ 0.8.0: changesets per-package tags\n * `@agent-native/core@<version>` (current).\n *\n * `main` is the final fallback so dev builds and brand-new releases (where\n * the tag has not propagated yet) still work — at the cost of pulling\n * potentially newer template code than the running CLI was built against.\n */\nfunction getGitHubTemplateRefCandidates(): string[] {\n const version = getCorePackageVersion();\n const candidates: string[] = [];\n if (version && /^\\d+\\.\\d+\\.\\d+(?:-.+)?$/.test(version)) {\n candidates.push(`@agent-native/core@${version}`);\n candidates.push(`v${version}`);\n }\n candidates.push(\"main\");\n return candidates;\n}\n\n/** @deprecated Kept for backward-compatible test imports. Returns the\n * highest-priority candidate; callers that need the full fallback list\n * should use `getGitHubTemplateRefCandidates()`. */\nfunction getGitHubTemplateRef(): string {\n return getGitHubTemplateRefCandidates()[0]!;\n}\n\nfunction rewriteCoreDependencyVersions(projectDir: string): void {\n const pkgPath = path.join(projectDir, \"package.json\");\n if (!fs.existsSync(pkgPath)) return;\n try {\n const pkg = JSON.parse(fs.readFileSync(pkgPath, \"utf-8\"));\n for (const depType of [\n \"dependencies\",\n \"devDependencies\",\n \"peerDependencies\",\n ] as const) {\n const deps = pkg[depType];\n if (deps?.[\"@agent-native/core\"]) {\n deps[\"@agent-native/core\"] = getCoreDependencyVersion();\n }\n if (deps?.[\"@agent-native/toolkit\"]) {\n deps[\"@agent-native/toolkit\"] = getToolkitDependencyVersion();\n }\n }\n fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + \"\\n\");\n } catch {}\n}\n\nfunction validateWorkspaceAppName(\n appName: string,\n clack: typeof import(\"@clack/prompts\"),\n opts?: { allowDispatch?: boolean },\n): void {\n const error =\n opts?.allowDispatch && appName === \"dispatch\"\n ? null\n : getWorkspaceAppIdValidationError(appName);\n if (error) {\n clack.cancel(error);\n process.exit(1);\n }\n}\n\nfunction upsertTomlBuildEnvironment(\n content: string,\n vars: Record<string, string>,\n): string {\n const lines = content.split(\"\\n\");\n const sectionIndex = lines.findIndex(\n (line) => line.trim() === \"[build.environment]\",\n );\n if (sectionIndex === -1) {\n const envLines = [\"\", \"[build.environment]\"].concat(\n Object.entries(vars).map(([key, value]) => ` ${key} = \"${value}\"`),\n );\n return content.trimEnd() + \"\\n\" + envLines.join(\"\\n\") + \"\\n\";\n }\n\n let nextSectionIndex = lines.findIndex(\n (line, index) => index > sectionIndex && /^\\s*\\[/.test(line),\n );\n if (nextSectionIndex === -1) nextSectionIndex = lines.length;\n\n for (const [key, value] of Object.entries(vars)) {\n const existingIndex = lines.findIndex(\n (line, index) =>\n index > sectionIndex &&\n index < nextSectionIndex &&\n new RegExp(`^\\\\s*${key}\\\\s*=`).test(line),\n );\n const nextLine = ` ${key} = \"${value}\"`;\n if (existingIndex === -1) {\n lines.splice(nextSectionIndex, 0, nextLine);\n nextSectionIndex += 1;\n } else {\n lines[existingIndex] = nextLine;\n }\n }\n\n return lines.join(\"\\n\");\n}\n\nfunction ensureRedirect(\n content: string,\n from: string,\n to: string,\n status: number,\n): string {\n const escapedFrom = from.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n const redirectPattern = new RegExp(\n `\\\\n?\\\\[\\\\[redirects\\\\]\\\\]\\\\s+from\\\\s*=\\\\s*\"${escapedFrom}\"\\\\s+to\\\\s*=\\\\s*\"[^\"]*\"\\\\s+status\\\\s*=\\\\s*\\\\d+(?:\\\\s+force\\\\s*=\\\\s*(?:true|false))?`,\n \"m\",\n );\n const block = [\n \"\",\n \"[[redirects]]\",\n ` from = \"${from}\"`,\n ` to = \"${to}\"`,\n ` status = ${status}`,\n ].join(\"\\n\");\n if (redirectPattern.test(content)) {\n return content.replace(redirectPattern, block);\n }\n return content.trimEnd() + \"\\n\" + block + \"\\n\";\n}\n\nfunction removeRedirect(content: string, from: string): string {\n const escapedFrom = from.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n const redirectPattern = new RegExp(\n `\\\\n?\\\\[\\\\[redirects\\\\]\\\\]\\\\s+from\\\\s*=\\\\s*\"${escapedFrom}\"\\\\s+to\\\\s*=\\\\s*\"[^\"]*\"\\\\s+status\\\\s*=\\\\s*\\\\d+(?:\\\\s+force\\\\s*=\\\\s*(?:true|false))?`,\n \"gm\",\n );\n return content.replace(redirectPattern, \"\").replace(/\\n{3,}/g, \"\\n\\n\");\n}\n\nfunction addWorkspaceMountNetlifyConfig(\n content: string,\n appName: string,\n): string {\n const basePath = `/${appName}`;\n let next = upsertTomlBuildEnvironment(content, {\n APP_BASE_PATH: basePath,\n VITE_APP_BASE_PATH: basePath,\n NITRO_PRESET: \"netlify\",\n NPM_CONFIG_PRODUCTION: \"false\",\n });\n\n if (appName === \"dispatch\") {\n next = ensureRedirect(next, \"/\", \"/dispatch/overview\", 302);\n next = ensureRedirect(next, \"/dispatch\", \"/dispatch/overview\", 302);\n for (const [from, to] of DISPATCH_WORKSPACE_ROOT_REDIRECTS) {\n next = ensureRedirect(next, `/${from}`, `/dispatch/${to}`, 302);\n }\n next = removeRedirect(next, \"/dispatch/*\");\n }\n\n return next;\n}\n\nfunction rewriteNetlifyToml(\n appDir: string,\n appName: string,\n mode: \"standalone\" | \"workspace\",\n): void {\n const netlifyPath = path.join(appDir, \"netlify.toml\");\n if (!fs.existsSync(netlifyPath)) return;\n\n try {\n let content = fs.readFileSync(netlifyPath, \"utf-8\");\n const originalCommand = content.match(/^\\s*command = \"([^\"]*)\"$/m)?.[1];\n const usesUnpooledDatabase =\n originalCommand?.includes(\"NETLIFY_DATABASE_URL_UNPOOLED\") ?? false;\n const buildCommand =\n mode === \"workspace\"\n ? `APP_BASE_PATH=/${appName} VITE_APP_BASE_PATH=/${appName} NITRO_PRESET=netlify pnpm --filter ${appName} build`\n : \"NITRO_PRESET=netlify pnpm build\";\n const databaseSetup =\n 'export DATABASE_URL=\\\\\"${NETLIFY_DATABASE_URL:-$DATABASE_URL}\\\\\"';\n const buildDatabasePrefix = usesUnpooledDatabase\n ? 'DATABASE_URL=\\\\\"${NETLIFY_DATABASE_URL_UNPOOLED:-$DATABASE_URL}\\\\\" '\n : \"\";\n const command = `${databaseSetup} && ${buildDatabasePrefix}${buildCommand}`;\n const publishPath = mode === \"workspace\" ? `apps/${appName}/dist` : \"dist\";\n const functionsPath =\n mode === \"workspace\"\n ? `apps/${appName}/.netlify/functions-internal`\n : \".netlify/functions-internal\";\n\n content = content\n .replace(/^(\\s*)command = \".*\"$/m, `$1command = \"${command}\"`)\n .replace(\n /publish = \"templates\\/[^\"]+\\/dist\"/g,\n `publish = \"${publishPath}\"`,\n )\n .replace(\n /functions = \"templates\\/[^\"]+\\/\\.netlify\\/functions-internal\"/g,\n `functions = \"${functionsPath}\"`,\n )\n // Strip the `ignore` script line: it references a monorepo script path\n // (scripts/netlify-ignore-build.mjs) that doesn't exist in scaffolds, so\n // skip-unchanged would never work and every deploy logs a not-found error.\n .replace(/^\\s*ignore\\s*=\\s*\"[^\"]*\"\\s*\\n/m, \"\");\n\n if (mode === \"workspace\") {\n content = addWorkspaceMountNetlifyConfig(content, appName);\n }\n\n fs.writeFileSync(netlifyPath, content);\n } catch {}\n}\n\nfunction rewriteAgentChatAppId(\n appDir: string,\n appName: string,\n templateName?: string,\n): void {\n const pluginPath = path.join(appDir, \"server\", \"plugins\", \"agent-chat.ts\");\n if (!fs.existsSync(pluginPath)) return;\n\n try {\n const content = fs.readFileSync(pluginPath, \"utf-8\");\n const sourceAppIds = [\"chat\", \"starter\"];\n if (templateName && templateName !== appName) {\n sourceAppIds.push(templateName);\n }\n const pattern = new RegExp(\n `(appId:\\\\s*)([\"'])(${sourceAppIds.map(escapeRegExp).join(\"|\")})\\\\2`,\n );\n if (!pattern.test(content)) return;\n\n const next = content.replace(\n pattern,\n (_match, prefix: string, quote: string) =>\n `${prefix}${quote}${appName}${quote}`,\n );\n if (next !== content) {\n fs.writeFileSync(pluginPath, next);\n }\n } catch {}\n}\n\nfunction rewriteTrackingAppId(\n appDir: string,\n appName: string,\n templateName?: string,\n): void {\n const rootPath = path.join(appDir, \"app\", \"root.tsx\");\n if (!fs.existsSync(rootPath)) return;\n\n try {\n const content = fs.readFileSync(rootPath, \"utf-8\");\n const trackedTemplateName = trackingTemplateName(templateName);\n const sourceAppIds = [\"agent-native-[^\\\"']+\", \"\\\\{\\\\{APP_NAME\\\\}\\\\}\"];\n if (templateName && templateName !== appName) {\n sourceAppIds.push(escapeRegExp(templateName));\n }\n if (isChatOnRampTemplate(templateName)) {\n sourceAppIds.push(\"starter\", \"chat\");\n }\n const pattern = new RegExp(\n `(^\\\\s*app:\\\\s*)([\"'])(?:${sourceAppIds.join(\"|\")})\\\\2(\\\\s*,?)`,\n \"m\",\n );\n if (!pattern.test(content)) return;\n\n let next = content.replace(\n pattern,\n (_match, prefix: string, quote: string, suffix: string) =>\n `${prefix}${quote}${appName}${quote}${suffix}`,\n );\n\n if (\n trackedTemplateName &&\n trackedTemplateName !== appName &&\n !hasTrackingTemplate(next)\n ) {\n next = next.replace(\n /(^\\s*app:\\s*[\"'][^\"']+[\"'],?\\s*$)/m,\n (line) =>\n `${line}\\n template: ${JSON.stringify(trackedTemplateName)},`,\n );\n }\n\n if (next !== content) {\n fs.writeFileSync(rootPath, next);\n }\n } catch {}\n}\n\nfunction escapeRegExp(value: string): string {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n\nfunction hasTrackingTemplate(content: string): boolean {\n const match = content.match(/configureTracking\\(\\{[\\s\\S]*?\\}\\);/);\n return !!match && /^\\s*template\\s*:/m.test(match[0]);\n}\n\nfunction tryGitInit(dir: string): boolean {\n try {\n execFileSync(\"git\", [\"init\"], { cwd: dir, stdio: \"pipe\" });\n execFileSync(\"git\", [\"add\", \"-A\"], { cwd: dir, stdio: \"pipe\" });\n execFileSync(\n \"git\",\n [\"commit\", \"-m\", \"Initial commit from agent-native create\"],\n {\n cwd: dir,\n stdio: \"pipe\",\n env: {\n ...process.env,\n GIT_AUTHOR_NAME: \"agent-native\",\n GIT_AUTHOR_EMAIL: \"noreply@agent-native.com\",\n GIT_COMMITTER_NAME: \"agent-native\",\n GIT_COMMITTER_EMAIL: \"noreply@agent-native.com\",\n },\n },\n );\n return true;\n } catch {\n return false;\n }\n}\n\nfunction renameGitignore(dir: string): void {\n const src = path.join(dir, \"_gitignore\");\n const dst = path.join(dir, \".gitignore\");\n if (fs.existsSync(src)) fs.renameSync(src, dst);\n}\n\nfunction replacePlaceholders(\n dir: string,\n appName: string,\n appTitle: string,\n workspaceName?: string,\n): void {\n for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {\n const p = path.join(dir, entry.name);\n if (entry.isSymbolicLink()) continue;\n if (entry.isDirectory()) {\n replacePlaceholders(p, appName, appTitle, workspaceName);\n continue;\n }\n let content: string;\n try {\n content = fs.readFileSync(p, \"utf-8\");\n } catch {\n continue;\n }\n const hasWs =\n workspaceName !== undefined && content.includes(\"{{WORKSPACE_NAME}}\");\n if (\n !content.includes(\"{{APP_NAME}}\") &&\n !content.includes(\"{{APP_TITLE}}\") &&\n !hasWs\n ) {\n continue;\n }\n let next = content;\n if (workspaceName !== undefined) {\n next = next.replace(/\\{\\{WORKSPACE_NAME\\}\\}/g, workspaceName);\n }\n next = next\n .replace(/\\{\\{APP_NAME\\}\\}/g, appName)\n .replace(/\\{\\{APP_TITLE\\}\\}/g, appTitle);\n fs.writeFileSync(p, next);\n }\n}\n\nfunction copyDir(src: string, dest: string, root?: string): void {\n const resolvedRoot = root ?? path.resolve(src);\n fs.mkdirSync(dest, { recursive: true });\n for (const entry of fs.readdirSync(src, { withFileTypes: true })) {\n const srcPath = path.join(src, entry.name);\n if (shouldSkipScaffoldEntry(entry.name, srcPath)) continue;\n const destPath = path.join(dest, entry.name);\n if (entry.isSymbolicLink()) {\n const target = fs.readlinkSync(srcPath);\n const resolvedTarget = path.resolve(path.dirname(srcPath), target);\n if (resolvedTarget.startsWith(resolvedRoot)) {\n fs.symlinkSync(target, destPath);\n } else {\n try {\n const stat = fs.statSync(srcPath);\n if (stat.isDirectory()) {\n copyDir(srcPath, destPath, resolvedRoot);\n } else {\n fs.copyFileSync(srcPath, destPath);\n }\n } catch {\n // Broken symlink — skip silently\n }\n }\n } else if (entry.isDirectory()) {\n copyDir(srcPath, destPath, resolvedRoot);\n } else {\n fs.copyFileSync(srcPath, destPath);\n }\n }\n}\n\nfunction shouldSkipScaffoldEntry(name: string, srcPath?: string): boolean {\n if (\n /^settings(?:\\..*)?\\.json$/.test(name) &&\n srcPath?.split(path.sep).includes(\".claude\")\n ) {\n return true;\n }\n if (\n name === \"node_modules\" ||\n name === \".agent-native\" ||\n name === \".env\" ||\n name === \".env.local\" ||\n name === \"pnpm-lock.yaml\" ||\n name === \".netlify\" ||\n name === \".vercel\" ||\n name === \".generated\" ||\n name === \".react-router\" ||\n name === \".output\" ||\n name === \"build\" ||\n name === \"dist\" ||\n name === \"test-results\" ||\n name === \"playwright-report\" ||\n name === \".DS_Store\"\n ) {\n return true;\n }\n return (\n name.endsWith(\".tmp.json\") ||\n /^qa-.*\\.db(?:-shm|-wal)?$/.test(name) ||\n /\\.db-(?:shm|wal)$/.test(name)\n );\n}\n"]}