@agent-native/core 0.76.3 → 0.76.5

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 (435) hide show
  1. package/corpus/core/CHANGELOG.md +25 -0
  2. package/corpus/core/package.json +1 -1
  3. package/corpus/core/src/agent/production-agent.ts +147 -56
  4. package/corpus/core/src/agent/run-store.ts +36 -0
  5. package/corpus/core/src/client/AgentPanel.tsx +3 -3
  6. package/corpus/core/src/client/AgentTaskCard.tsx +2 -1
  7. package/corpus/core/src/client/AppearancePicker.tsx +1 -1
  8. package/corpus/core/src/client/AssistantChat.tsx +3 -3
  9. package/corpus/core/src/client/CommandMenu.tsx +4 -4
  10. package/corpus/core/src/client/ErrorBoundary.tsx +1 -1
  11. package/corpus/core/src/client/MultiTabAssistantChat.tsx +11 -11
  12. package/corpus/core/src/client/NewWorkspaceAppFlow.tsx +5 -5
  13. package/corpus/core/src/client/components/ui/dropdown-menu.tsx +9 -9
  14. package/corpus/core/src/client/components/ui/sheet.tsx +1 -1
  15. package/corpus/core/src/client/composer/ComposerPlusMenu.tsx +6 -6
  16. package/corpus/core/src/client/composer/MentionPopover.tsx +4 -4
  17. package/corpus/core/src/client/composer/PastedTextChip.tsx +3 -3
  18. package/corpus/core/src/client/composer/PromptComposer.tsx +3 -3
  19. package/corpus/core/src/client/composer/TiptapComposer.tsx +16 -16
  20. package/corpus/core/src/client/guided-questions.tsx +6 -8
  21. package/corpus/core/src/client/i18n.tsx +2 -2
  22. package/corpus/core/src/client/integrations/IntegrationCard.tsx +2 -2
  23. package/corpus/core/src/client/integrations/IntegrationsPanel.tsx +4 -4
  24. package/corpus/core/src/client/notifications/NotificationsBell.tsx +3 -3
  25. package/corpus/core/src/client/onboarding/OnboardingBanner.tsx +3 -3
  26. package/corpus/core/src/client/onboarding/OnboardingPanel.tsx +17 -10
  27. package/corpus/core/src/client/org/OrgSwitcher.tsx +13 -11
  28. package/corpus/core/src/client/org/TeamPage.tsx +2 -2
  29. package/corpus/core/src/client/settings/AgentsSection.tsx +3 -3
  30. package/corpus/core/src/client/settings/AutomationsSection.tsx +3 -3
  31. package/corpus/core/src/client/settings/SecretsSection.tsx +2 -2
  32. package/corpus/core/src/client/settings/SettingsPanel.tsx +5 -7
  33. package/corpus/core/src/client/settings/SettingsSection.tsx +1 -1
  34. package/corpus/core/src/client/settings/UsageSection.tsx +3 -3
  35. package/corpus/core/src/client/settings/VoiceTranscriptionSection.tsx +3 -3
  36. package/corpus/core/src/client/sharing/ShareButton.tsx +7 -7
  37. package/corpus/core/src/client/sharing/ShareDialog.tsx +3 -3
  38. package/corpus/core/src/deploy/build.ts +31 -14
  39. package/corpus/core/src/styles/agent-conversation.css +10 -10
  40. package/corpus/core/src/styles/blocks.css +2 -2
  41. package/corpus/core/src/styles/rich-markdown-editor.css +2 -2
  42. package/corpus/templates/analytics/app/components/layout/MobileNav.tsx +1 -1
  43. package/corpus/templates/analytics/app/components/ui/alert-dialog.tsx +1 -1
  44. package/corpus/templates/analytics/app/components/ui/alert.tsx +1 -1
  45. package/corpus/templates/analytics/app/components/ui/breadcrumb.tsx +1 -1
  46. package/corpus/templates/analytics/app/components/ui/calendar.tsx +6 -6
  47. package/corpus/templates/analytics/app/components/ui/carousel.tsx +6 -6
  48. package/corpus/templates/analytics/app/components/ui/command.tsx +2 -2
  49. package/corpus/templates/analytics/app/components/ui/context-menu.tsx +9 -9
  50. package/corpus/templates/analytics/app/components/ui/date-picker.tsx +1 -1
  51. package/corpus/templates/analytics/app/components/ui/dialog.tsx +2 -2
  52. package/corpus/templates/analytics/app/components/ui/drawer.tsx +1 -1
  53. package/corpus/templates/analytics/app/components/ui/dropdown-menu.tsx +9 -9
  54. package/corpus/templates/analytics/app/components/ui/input-otp.tsx +1 -1
  55. package/corpus/templates/analytics/app/components/ui/menubar.tsx +9 -9
  56. package/corpus/templates/analytics/app/components/ui/navigation-menu.tsx +3 -3
  57. package/corpus/templates/analytics/app/components/ui/pagination.tsx +4 -4
  58. package/corpus/templates/analytics/app/components/ui/scroll-area.tsx +1 -1
  59. package/corpus/templates/analytics/app/components/ui/select.tsx +3 -3
  60. package/corpus/templates/analytics/app/components/ui/sheet.tsx +2 -2
  61. package/corpus/templates/analytics/app/components/ui/sidebar.tsx +6 -6
  62. package/corpus/templates/analytics/app/components/ui/table.tsx +2 -2
  63. package/corpus/templates/analytics/app/components/ui/toast.tsx +3 -3
  64. package/corpus/templates/assets/app/components/layout/Layout.tsx +2 -2
  65. package/corpus/templates/assets/app/components/layout/Sidebar.tsx +12 -12
  66. package/corpus/templates/assets/app/components/ui/alert-dialog.tsx +1 -1
  67. package/corpus/templates/assets/app/components/ui/alert.tsx +1 -1
  68. package/corpus/templates/assets/app/components/ui/breadcrumb.tsx +1 -1
  69. package/corpus/templates/assets/app/components/ui/dialog.tsx +2 -2
  70. package/corpus/templates/assets/app/components/ui/dropdown-menu.tsx +9 -9
  71. package/corpus/templates/assets/app/components/ui/pagination.tsx +4 -4
  72. package/corpus/templates/assets/app/components/ui/scroll-area.tsx +1 -1
  73. package/corpus/templates/assets/app/components/ui/select.tsx +3 -3
  74. package/corpus/templates/assets/app/components/ui/sheet.tsx +2 -2
  75. package/corpus/templates/assets/app/components/ui/table.tsx +2 -2
  76. package/corpus/templates/assets/app/routes/library.tsx +3 -3
  77. package/corpus/templates/assets/app/routes/settings.tsx +1 -1
  78. package/corpus/templates/brain/app/components/layout/Sidebar.tsx +5 -5
  79. package/corpus/templates/brain/app/components/ui/dropdown-menu.tsx +9 -9
  80. package/corpus/templates/brain/app/components/ui/select.tsx +3 -3
  81. package/corpus/templates/brain/app/components/ui/sheet.tsx +2 -2
  82. package/corpus/templates/brain/app/components/ui/table.tsx +2 -2
  83. package/corpus/templates/calendar/app/components/calendar/GoogleConnectBanner.tsx +6 -6
  84. package/corpus/templates/calendar/app/components/calendar/GoogleSetupWizard.tsx +3 -3
  85. package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +11 -9
  86. package/corpus/templates/calendar/app/components/ui/alert-dialog.tsx +1 -1
  87. package/corpus/templates/calendar/app/components/ui/alert.tsx +1 -1
  88. package/corpus/templates/calendar/app/components/ui/breadcrumb.tsx +1 -1
  89. package/corpus/templates/calendar/app/components/ui/calendar.tsx +5 -5
  90. package/corpus/templates/calendar/app/components/ui/carousel.tsx +6 -6
  91. package/corpus/templates/calendar/app/components/ui/command.tsx +2 -2
  92. package/corpus/templates/calendar/app/components/ui/context-menu.tsx +9 -9
  93. package/corpus/templates/calendar/app/components/ui/dialog.tsx +2 -2
  94. package/corpus/templates/calendar/app/components/ui/drawer.tsx +1 -1
  95. package/corpus/templates/calendar/app/components/ui/dropdown-menu.tsx +9 -9
  96. package/corpus/templates/calendar/app/components/ui/input-otp.tsx +1 -1
  97. package/corpus/templates/calendar/app/components/ui/menubar.tsx +9 -9
  98. package/corpus/templates/calendar/app/components/ui/navigation-menu.tsx +3 -3
  99. package/corpus/templates/calendar/app/components/ui/pagination.tsx +4 -4
  100. package/corpus/templates/calendar/app/components/ui/scroll-area.tsx +1 -1
  101. package/corpus/templates/calendar/app/components/ui/select.tsx +3 -3
  102. package/corpus/templates/calendar/app/components/ui/sheet.tsx +2 -2
  103. package/corpus/templates/calendar/app/components/ui/sidebar.tsx +6 -6
  104. package/corpus/templates/calendar/app/components/ui/sonner.tsx +1 -1
  105. package/corpus/templates/calendar/app/components/ui/table.tsx +2 -2
  106. package/corpus/templates/calendar/app/components/ui/toast.tsx +3 -3
  107. package/corpus/templates/calendar/app/pages/Settings.tsx +5 -5
  108. package/corpus/templates/chat/app/components/layout/Sidebar.tsx +9 -9
  109. package/corpus/templates/chat/app/components/ui/alert-dialog.tsx +1 -1
  110. package/corpus/templates/chat/app/components/ui/alert.tsx +1 -1
  111. package/corpus/templates/chat/app/components/ui/breadcrumb.tsx +1 -1
  112. package/corpus/templates/chat/app/components/ui/calendar.tsx +5 -5
  113. package/corpus/templates/chat/app/components/ui/carousel.tsx +6 -6
  114. package/corpus/templates/chat/app/components/ui/command.tsx +2 -2
  115. package/corpus/templates/chat/app/components/ui/context-menu.tsx +9 -9
  116. package/corpus/templates/chat/app/components/ui/dialog.tsx +2 -2
  117. package/corpus/templates/chat/app/components/ui/drawer.tsx +1 -1
  118. package/corpus/templates/chat/app/components/ui/dropdown-menu.tsx +9 -9
  119. package/corpus/templates/chat/app/components/ui/input-otp.tsx +1 -1
  120. package/corpus/templates/chat/app/components/ui/menubar.tsx +9 -9
  121. package/corpus/templates/chat/app/components/ui/navigation-menu.tsx +3 -3
  122. package/corpus/templates/chat/app/components/ui/pagination.tsx +4 -4
  123. package/corpus/templates/chat/app/components/ui/scroll-area.tsx +1 -1
  124. package/corpus/templates/chat/app/components/ui/select.tsx +3 -3
  125. package/corpus/templates/chat/app/components/ui/sheet.tsx +2 -2
  126. package/corpus/templates/chat/app/components/ui/sidebar.tsx +6 -6
  127. package/corpus/templates/chat/app/components/ui/table.tsx +2 -2
  128. package/corpus/templates/chat/app/components/ui/toast.tsx +3 -3
  129. package/corpus/templates/clips/app/components/capture-install-options.tsx +3 -3
  130. package/corpus/templates/clips/app/components/editable-recording-title.tsx +1 -1
  131. package/corpus/templates/clips/app/components/library/bulk-action-toolbar.tsx +3 -3
  132. package/corpus/templates/clips/app/components/library/folder-tree.tsx +5 -5
  133. package/corpus/templates/clips/app/components/library/library-layout.tsx +3 -3
  134. package/corpus/templates/clips/app/components/library/organization-switcher.tsx +4 -4
  135. package/corpus/templates/clips/app/components/library/recording-card.tsx +11 -11
  136. package/corpus/templates/clips/app/components/library/search-bar.tsx +4 -4
  137. package/corpus/templates/clips/app/components/library/space-card.tsx +1 -1
  138. package/corpus/templates/clips/app/components/library/tag-input.tsx +1 -1
  139. package/corpus/templates/clips/app/components/meetings/quick-ask-sidebar.tsx +2 -2
  140. package/corpus/templates/clips/app/components/recorder/camera-visualizer.tsx +2 -2
  141. package/corpus/templates/clips/app/components/recorder/microphone-visualizer.tsx +1 -1
  142. package/corpus/templates/clips/app/components/recorder/pre-record-panel.tsx +4 -4
  143. package/corpus/templates/clips/app/components/recorder/storage-setup-card.tsx +1 -1
  144. package/corpus/templates/clips/app/components/sharing/share-ui.tsx +2 -2
  145. package/corpus/templates/clips/app/components/ui/alert-dialog.tsx +1 -1
  146. package/corpus/templates/clips/app/components/ui/alert.tsx +1 -1
  147. package/corpus/templates/clips/app/components/ui/breadcrumb.tsx +1 -1
  148. package/corpus/templates/clips/app/components/ui/calendar.tsx +5 -5
  149. package/corpus/templates/clips/app/components/ui/carousel.tsx +6 -6
  150. package/corpus/templates/clips/app/components/ui/command.tsx +2 -2
  151. package/corpus/templates/clips/app/components/ui/context-menu.tsx +9 -9
  152. package/corpus/templates/clips/app/components/ui/dialog.tsx +2 -2
  153. package/corpus/templates/clips/app/components/ui/drawer.tsx +1 -1
  154. package/corpus/templates/clips/app/components/ui/dropdown-menu.tsx +9 -9
  155. package/corpus/templates/clips/app/components/ui/input-otp.tsx +1 -1
  156. package/corpus/templates/clips/app/components/ui/menubar.tsx +9 -9
  157. package/corpus/templates/clips/app/components/ui/navigation-menu.tsx +3 -3
  158. package/corpus/templates/clips/app/components/ui/pagination.tsx +4 -4
  159. package/corpus/templates/clips/app/components/ui/scroll-area.tsx +1 -1
  160. package/corpus/templates/clips/app/components/ui/select.tsx +3 -3
  161. package/corpus/templates/clips/app/components/ui/sheet.tsx +2 -2
  162. package/corpus/templates/clips/app/components/ui/sidebar.tsx +6 -6
  163. package/corpus/templates/clips/app/components/ui/table.tsx +2 -2
  164. package/corpus/templates/clips/app/components/ui/toast.tsx +3 -3
  165. package/corpus/templates/clips/app/components/workspace/branding-editor.tsx +1 -1
  166. package/corpus/templates/clips/app/components/workspace/insights-hub.tsx +2 -2
  167. package/corpus/templates/clips/app/components/workspace/invite-dialog.tsx +2 -2
  168. package/corpus/templates/clips/app/components/workspace/top-creators-table.tsx +6 -6
  169. package/corpus/templates/clips/app/components/workspace/top-videos-table.tsx +2 -2
  170. package/corpus/templates/clips/app/routes/_app.dictate.tsx +4 -4
  171. package/corpus/templates/clips/app/routes/_app.meetings._index.tsx +7 -7
  172. package/corpus/templates/clips/app/routes/_app.settings._index.tsx +1 -1
  173. package/corpus/templates/clips/app/routes/download.tsx +2 -2
  174. package/corpus/templates/clips/app/routes/invite.$token.tsx +2 -2
  175. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +3 -3
  176. package/corpus/templates/clips/app/routes/record.tsx +5 -5
  177. package/corpus/templates/clips/app/routes/share.$shareId.tsx +7 -7
  178. package/corpus/templates/content/app/components/EmptyState.tsx +1 -1
  179. package/corpus/templates/content/app/components/editor/DocumentToolbar.tsx +17 -17
  180. package/corpus/templates/content/app/components/layout/Layout.tsx +2 -2
  181. package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +10 -9
  182. package/corpus/templates/content/app/components/sidebar/DocumentTreeItem.tsx +10 -6
  183. package/corpus/templates/content/app/components/sidebar/NotionButton.tsx +3 -3
  184. package/corpus/templates/content/app/components/ui/alert-dialog.tsx +1 -1
  185. package/corpus/templates/content/app/components/ui/dialog.tsx +2 -2
  186. package/corpus/templates/content/app/components/ui/dropdown-menu.tsx +9 -9
  187. package/corpus/templates/content/app/components/ui/scroll-area.tsx +1 -1
  188. package/corpus/templates/content/app/components/ui/sheet.tsx +2 -2
  189. package/corpus/templates/content/app/components/ui/table.tsx +2 -2
  190. package/corpus/templates/content/app/components/ui/toast.tsx +3 -3
  191. package/corpus/templates/design/app/components/layout/Layout.tsx +3 -3
  192. package/corpus/templates/design/app/components/layout/Sidebar.tsx +3 -3
  193. package/corpus/templates/design/app/components/ui/alert-dialog.tsx +1 -1
  194. package/corpus/templates/design/app/components/ui/alert.tsx +1 -1
  195. package/corpus/templates/design/app/components/ui/breadcrumb.tsx +1 -1
  196. package/corpus/templates/design/app/components/ui/calendar.tsx +5 -5
  197. package/corpus/templates/design/app/components/ui/carousel.tsx +6 -6
  198. package/corpus/templates/design/app/components/ui/command.tsx +2 -2
  199. package/corpus/templates/design/app/components/ui/context-menu.tsx +9 -9
  200. package/corpus/templates/design/app/components/ui/dialog.tsx +2 -2
  201. package/corpus/templates/design/app/components/ui/drawer.tsx +1 -1
  202. package/corpus/templates/design/app/components/ui/dropdown-menu.tsx +9 -9
  203. package/corpus/templates/design/app/components/ui/input-otp.tsx +1 -1
  204. package/corpus/templates/design/app/components/ui/menubar.tsx +9 -9
  205. package/corpus/templates/design/app/components/ui/navigation-menu.tsx +3 -3
  206. package/corpus/templates/design/app/components/ui/pagination.tsx +4 -4
  207. package/corpus/templates/design/app/components/ui/scroll-area.tsx +1 -1
  208. package/corpus/templates/design/app/components/ui/select.tsx +3 -3
  209. package/corpus/templates/design/app/components/ui/sheet.tsx +2 -2
  210. package/corpus/templates/design/app/components/ui/sidebar.tsx +6 -6
  211. package/corpus/templates/design/app/components/ui/table.tsx +2 -2
  212. package/corpus/templates/design/app/components/ui/toast.tsx +3 -3
  213. package/corpus/templates/design/app/pages/DesignSystems.tsx +6 -8
  214. package/corpus/templates/design/app/pages/Index.tsx +8 -8
  215. package/corpus/templates/design/app/pages/NotFound.tsx +1 -1
  216. package/corpus/templates/design/app/pages/Templates.tsx +2 -2
  217. package/corpus/templates/forms/app/components/layout/Sidebar.tsx +3 -3
  218. package/corpus/templates/forms/app/components/ui/alert-dialog.tsx +1 -1
  219. package/corpus/templates/forms/app/components/ui/alert.tsx +1 -1
  220. package/corpus/templates/forms/app/components/ui/breadcrumb.tsx +1 -1
  221. package/corpus/templates/forms/app/components/ui/calendar.tsx +9 -6
  222. package/corpus/templates/forms/app/components/ui/carousel.tsx +6 -6
  223. package/corpus/templates/forms/app/components/ui/command.tsx +2 -2
  224. package/corpus/templates/forms/app/components/ui/context-menu.tsx +9 -9
  225. package/corpus/templates/forms/app/components/ui/dialog.tsx +2 -2
  226. package/corpus/templates/forms/app/components/ui/drawer.tsx +1 -1
  227. package/corpus/templates/forms/app/components/ui/dropdown-menu.tsx +9 -9
  228. package/corpus/templates/forms/app/components/ui/input-otp.tsx +1 -1
  229. package/corpus/templates/forms/app/components/ui/menubar.tsx +9 -9
  230. package/corpus/templates/forms/app/components/ui/navigation-menu.tsx +3 -3
  231. package/corpus/templates/forms/app/components/ui/pagination.tsx +4 -4
  232. package/corpus/templates/forms/app/components/ui/scroll-area.tsx +1 -1
  233. package/corpus/templates/forms/app/components/ui/select.tsx +3 -3
  234. package/corpus/templates/forms/app/components/ui/sheet.tsx +2 -2
  235. package/corpus/templates/forms/app/components/ui/sidebar.tsx +6 -6
  236. package/corpus/templates/forms/app/components/ui/table.tsx +2 -2
  237. package/corpus/templates/forms/app/components/ui/toast.tsx +3 -3
  238. package/corpus/templates/forms/app/pages/FormBuilderPage.tsx +18 -18
  239. package/corpus/templates/forms/app/pages/FormsListPage.tsx +9 -9
  240. package/corpus/templates/macros/app/components/layout/AppLayout.tsx +4 -4
  241. package/corpus/templates/macros/app/components/ui/alert-dialog.tsx +1 -1
  242. package/corpus/templates/macros/app/components/ui/alert.tsx +1 -1
  243. package/corpus/templates/macros/app/components/ui/breadcrumb.tsx +1 -1
  244. package/corpus/templates/macros/app/components/ui/command.tsx +2 -2
  245. package/corpus/templates/macros/app/components/ui/context-menu.tsx +9 -9
  246. package/corpus/templates/macros/app/components/ui/dialog.tsx +2 -2
  247. package/corpus/templates/macros/app/components/ui/drawer.tsx +1 -1
  248. package/corpus/templates/macros/app/components/ui/dropdown-menu.tsx +9 -9
  249. package/corpus/templates/macros/app/components/ui/menubar.tsx +9 -9
  250. package/corpus/templates/macros/app/components/ui/navigation-menu.tsx +3 -3
  251. package/corpus/templates/macros/app/components/ui/pagination.tsx +4 -4
  252. package/corpus/templates/macros/app/components/ui/scroll-area.tsx +1 -1
  253. package/corpus/templates/macros/app/components/ui/select.tsx +3 -3
  254. package/corpus/templates/macros/app/components/ui/sheet.tsx +2 -2
  255. package/corpus/templates/macros/app/components/ui/table.tsx +2 -2
  256. package/corpus/templates/macros/app/components/ui/toast.tsx +3 -3
  257. package/corpus/templates/macros/app/routes/_index.tsx +2 -2
  258. package/corpus/templates/macros/app/routes/analytics.tsx +1 -1
  259. package/corpus/templates/mail/app/components/GoogleConnectBanner.tsx +6 -6
  260. package/corpus/templates/mail/app/components/email/AttachmentStrip.tsx +2 -2
  261. package/corpus/templates/mail/app/components/email/EmailListItem.tsx +5 -5
  262. package/corpus/templates/mail/app/components/email/IntegrationsSidebar.tsx +5 -5
  263. package/corpus/templates/mail/app/components/email/MobileActionBar.tsx +3 -3
  264. package/corpus/templates/mail/app/components/layout/AppLayout.tsx +10 -10
  265. package/corpus/templates/mail/app/components/layout/CommandPalette.tsx +1 -1
  266. package/corpus/templates/mail/app/components/layout/SearchBar.tsx +3 -3
  267. package/corpus/templates/mail/app/components/ui/alert-dialog.tsx +1 -1
  268. package/corpus/templates/mail/app/components/ui/alert.tsx +1 -1
  269. package/corpus/templates/mail/app/components/ui/breadcrumb.tsx +1 -1
  270. package/corpus/templates/mail/app/components/ui/calendar.tsx +4 -4
  271. package/corpus/templates/mail/app/components/ui/carousel.tsx +6 -6
  272. package/corpus/templates/mail/app/components/ui/command.tsx +2 -2
  273. package/corpus/templates/mail/app/components/ui/context-menu.tsx +9 -9
  274. package/corpus/templates/mail/app/components/ui/dialog.tsx +2 -2
  275. package/corpus/templates/mail/app/components/ui/drawer.tsx +1 -1
  276. package/corpus/templates/mail/app/components/ui/dropdown-menu.tsx +9 -9
  277. package/corpus/templates/mail/app/components/ui/input-otp.tsx +1 -1
  278. package/corpus/templates/mail/app/components/ui/menubar.tsx +9 -9
  279. package/corpus/templates/mail/app/components/ui/navigation-menu.tsx +3 -3
  280. package/corpus/templates/mail/app/components/ui/pagination.tsx +4 -4
  281. package/corpus/templates/mail/app/components/ui/scroll-area.tsx +1 -1
  282. package/corpus/templates/mail/app/components/ui/select.tsx +3 -3
  283. package/corpus/templates/mail/app/components/ui/sheet.tsx +2 -2
  284. package/corpus/templates/mail/app/components/ui/sidebar.tsx +6 -6
  285. package/corpus/templates/mail/app/components/ui/sonner.tsx +2 -2
  286. package/corpus/templates/mail/app/components/ui/table.tsx +2 -2
  287. package/corpus/templates/mail/app/components/ui/toast.tsx +3 -3
  288. package/corpus/templates/plan/app/components/layout/Sidebar.tsx +10 -10
  289. package/corpus/templates/plan/app/components/ui/alert-dialog.tsx +1 -1
  290. package/corpus/templates/plan/app/components/ui/alert.tsx +1 -1
  291. package/corpus/templates/plan/app/components/ui/breadcrumb.tsx +1 -1
  292. package/corpus/templates/plan/app/components/ui/calendar.tsx +5 -5
  293. package/corpus/templates/plan/app/components/ui/carousel.tsx +6 -6
  294. package/corpus/templates/plan/app/components/ui/command.tsx +2 -2
  295. package/corpus/templates/plan/app/components/ui/context-menu.tsx +9 -9
  296. package/corpus/templates/plan/app/components/ui/dialog.tsx +2 -2
  297. package/corpus/templates/plan/app/components/ui/drawer.tsx +1 -1
  298. package/corpus/templates/plan/app/components/ui/dropdown-menu.tsx +9 -9
  299. package/corpus/templates/plan/app/components/ui/input-otp.tsx +1 -1
  300. package/corpus/templates/plan/app/components/ui/menubar.tsx +9 -9
  301. package/corpus/templates/plan/app/components/ui/navigation-menu.tsx +3 -3
  302. package/corpus/templates/plan/app/components/ui/pagination.tsx +4 -4
  303. package/corpus/templates/plan/app/components/ui/scroll-area.tsx +1 -1
  304. package/corpus/templates/plan/app/components/ui/select.tsx +3 -3
  305. package/corpus/templates/plan/app/components/ui/sheet.tsx +2 -2
  306. package/corpus/templates/plan/app/components/ui/sidebar.tsx +6 -6
  307. package/corpus/templates/plan/app/components/ui/table.tsx +2 -2
  308. package/corpus/templates/plan/app/components/ui/toast.tsx +3 -3
  309. package/corpus/templates/slides/app/components/layout/Layout.tsx +1 -1
  310. package/corpus/templates/slides/app/components/ui/alert-dialog.tsx +1 -1
  311. package/corpus/templates/slides/app/components/ui/alert.tsx +1 -1
  312. package/corpus/templates/slides/app/components/ui/breadcrumb.tsx +1 -1
  313. package/corpus/templates/slides/app/components/ui/calendar.tsx +5 -5
  314. package/corpus/templates/slides/app/components/ui/carousel.tsx +6 -6
  315. package/corpus/templates/slides/app/components/ui/command.tsx +2 -2
  316. package/corpus/templates/slides/app/components/ui/context-menu.tsx +9 -9
  317. package/corpus/templates/slides/app/components/ui/dialog.tsx +2 -2
  318. package/corpus/templates/slides/app/components/ui/drawer.tsx +1 -1
  319. package/corpus/templates/slides/app/components/ui/dropdown-menu.tsx +9 -9
  320. package/corpus/templates/slides/app/components/ui/input-otp.tsx +1 -1
  321. package/corpus/templates/slides/app/components/ui/menubar.tsx +9 -9
  322. package/corpus/templates/slides/app/components/ui/navigation-menu.tsx +3 -3
  323. package/corpus/templates/slides/app/components/ui/pagination.tsx +4 -4
  324. package/corpus/templates/slides/app/components/ui/scroll-area.tsx +1 -1
  325. package/corpus/templates/slides/app/components/ui/select.tsx +3 -3
  326. package/corpus/templates/slides/app/components/ui/sheet.tsx +2 -2
  327. package/corpus/templates/slides/app/components/ui/sidebar.tsx +6 -6
  328. package/corpus/templates/slides/app/components/ui/table.tsx +2 -2
  329. package/corpus/templates/slides/app/components/ui/toast.tsx +3 -3
  330. package/corpus/templates/videos/app/components/ui/alert-dialog.tsx +1 -1
  331. package/corpus/templates/videos/app/components/ui/alert.tsx +1 -1
  332. package/corpus/templates/videos/app/components/ui/breadcrumb.tsx +1 -1
  333. package/corpus/templates/videos/app/components/ui/calendar.tsx +5 -5
  334. package/corpus/templates/videos/app/components/ui/carousel.tsx +6 -6
  335. package/corpus/templates/videos/app/components/ui/command.tsx +2 -2
  336. package/corpus/templates/videos/app/components/ui/context-menu.tsx +9 -9
  337. package/corpus/templates/videos/app/components/ui/dialog.tsx +2 -2
  338. package/corpus/templates/videos/app/components/ui/drawer.tsx +1 -1
  339. package/corpus/templates/videos/app/components/ui/dropdown-menu.tsx +9 -9
  340. package/corpus/templates/videos/app/components/ui/input-otp.tsx +1 -1
  341. package/corpus/templates/videos/app/components/ui/menubar.tsx +9 -9
  342. package/corpus/templates/videos/app/components/ui/navigation-menu.tsx +3 -3
  343. package/corpus/templates/videos/app/components/ui/pagination.tsx +4 -4
  344. package/corpus/templates/videos/app/components/ui/scroll-area.tsx +1 -1
  345. package/corpus/templates/videos/app/components/ui/select.tsx +3 -3
  346. package/corpus/templates/videos/app/components/ui/sheet.tsx +2 -2
  347. package/corpus/templates/videos/app/components/ui/sidebar.tsx +6 -6
  348. package/corpus/templates/videos/app/components/ui/table.tsx +2 -2
  349. package/corpus/templates/videos/app/components/ui/toast.tsx +3 -3
  350. package/dist/agent/production-agent.d.ts +47 -0
  351. package/dist/agent/production-agent.d.ts.map +1 -1
  352. package/dist/agent/production-agent.js +112 -56
  353. package/dist/agent/production-agent.js.map +1 -1
  354. package/dist/agent/run-store.d.ts +21 -0
  355. package/dist/agent/run-store.d.ts.map +1 -1
  356. package/dist/agent/run-store.js +32 -0
  357. package/dist/agent/run-store.js.map +1 -1
  358. package/dist/client/AgentPanel.js +3 -3
  359. package/dist/client/AgentPanel.js.map +1 -1
  360. package/dist/client/AgentTaskCard.d.ts.map +1 -1
  361. package/dist/client/AgentTaskCard.js +1 -1
  362. package/dist/client/AgentTaskCard.js.map +1 -1
  363. package/dist/client/AppearancePicker.js +1 -1
  364. package/dist/client/AppearancePicker.js.map +1 -1
  365. package/dist/client/AssistantChat.js +3 -3
  366. package/dist/client/AssistantChat.js.map +1 -1
  367. package/dist/client/CommandMenu.js +4 -4
  368. package/dist/client/CommandMenu.js.map +1 -1
  369. package/dist/client/ErrorBoundary.js +1 -1
  370. package/dist/client/ErrorBoundary.js.map +1 -1
  371. package/dist/client/MultiTabAssistantChat.js +9 -9
  372. package/dist/client/MultiTabAssistantChat.js.map +1 -1
  373. package/dist/client/NewWorkspaceAppFlow.js +5 -5
  374. package/dist/client/NewWorkspaceAppFlow.js.map +1 -1
  375. package/dist/client/components/ui/dropdown-menu.js +6 -6
  376. package/dist/client/components/ui/dropdown-menu.js.map +1 -1
  377. package/dist/client/components/ui/sheet.js +1 -1
  378. package/dist/client/components/ui/sheet.js.map +1 -1
  379. package/dist/client/composer/ComposerPlusMenu.js +5 -5
  380. package/dist/client/composer/ComposerPlusMenu.js.map +1 -1
  381. package/dist/client/composer/MentionPopover.js +4 -4
  382. package/dist/client/composer/MentionPopover.js.map +1 -1
  383. package/dist/client/composer/PastedTextChip.js +2 -2
  384. package/dist/client/composer/PastedTextChip.js.map +1 -1
  385. package/dist/client/composer/PromptComposer.js +3 -3
  386. package/dist/client/composer/PromptComposer.js.map +1 -1
  387. package/dist/client/composer/TiptapComposer.js +12 -12
  388. package/dist/client/composer/TiptapComposer.js.map +1 -1
  389. package/dist/client/guided-questions.d.ts.map +1 -1
  390. package/dist/client/guided-questions.js +5 -5
  391. package/dist/client/guided-questions.js.map +1 -1
  392. package/dist/client/i18n.js +2 -2
  393. package/dist/client/i18n.js.map +1 -1
  394. package/dist/client/integrations/IntegrationCard.js +1 -1
  395. package/dist/client/integrations/IntegrationCard.js.map +1 -1
  396. package/dist/client/integrations/IntegrationsPanel.js +4 -4
  397. package/dist/client/integrations/IntegrationsPanel.js.map +1 -1
  398. package/dist/client/notifications/NotificationsBell.js +3 -3
  399. package/dist/client/notifications/NotificationsBell.js.map +1 -1
  400. package/dist/client/onboarding/OnboardingBanner.js +3 -3
  401. package/dist/client/onboarding/OnboardingBanner.js.map +1 -1
  402. package/dist/client/onboarding/OnboardingPanel.d.ts.map +1 -1
  403. package/dist/client/onboarding/OnboardingPanel.js +15 -10
  404. package/dist/client/onboarding/OnboardingPanel.js.map +1 -1
  405. package/dist/client/org/OrgSwitcher.d.ts.map +1 -1
  406. package/dist/client/org/OrgSwitcher.js +7 -7
  407. package/dist/client/org/OrgSwitcher.js.map +1 -1
  408. package/dist/client/org/TeamPage.js +2 -2
  409. package/dist/client/org/TeamPage.js.map +1 -1
  410. package/dist/client/settings/AgentsSection.js +3 -3
  411. package/dist/client/settings/AgentsSection.js.map +1 -1
  412. package/dist/client/settings/AutomationsSection.js +2 -2
  413. package/dist/client/settings/AutomationsSection.js.map +1 -1
  414. package/dist/client/settings/SecretsSection.js +2 -2
  415. package/dist/client/settings/SecretsSection.js.map +1 -1
  416. package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
  417. package/dist/client/settings/SettingsPanel.js +4 -4
  418. package/dist/client/settings/SettingsPanel.js.map +1 -1
  419. package/dist/client/settings/SettingsSection.js +1 -1
  420. package/dist/client/settings/SettingsSection.js.map +1 -1
  421. package/dist/client/settings/UsageSection.js +2 -2
  422. package/dist/client/settings/UsageSection.js.map +1 -1
  423. package/dist/client/settings/VoiceTranscriptionSection.js +3 -3
  424. package/dist/client/settings/VoiceTranscriptionSection.js.map +1 -1
  425. package/dist/client/sharing/ShareButton.js +6 -6
  426. package/dist/client/sharing/ShareButton.js.map +1 -1
  427. package/dist/client/sharing/ShareDialog.js +3 -3
  428. package/dist/client/sharing/ShareDialog.js.map +1 -1
  429. package/dist/deploy/build.d.ts.map +1 -1
  430. package/dist/deploy/build.js +31 -14
  431. package/dist/deploy/build.js.map +1 -1
  432. package/dist/styles/agent-conversation.css +10 -10
  433. package/dist/styles/blocks.css +2 -2
  434. package/dist/styles/rich-markdown-editor.css +2 -2
  435. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ShareDialog.js","sourceRoot":"","sources":["../../../src/client/sharing/ShareDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EACL,KAAK,EACL,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,eAAe,GAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,EAAE,EA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C,gIAAgI,YAEzI,GAAG,CAAC,CAAC,CAAC,CACL,KAAC,YAAY,IAAC,IAAI,EAAE,EAAE,EAAE,WAAW,EAAE,IAAI,GAAI,CAC9C,CAAC,CAAC,CAAC,CACF,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,CAC5D,GACI,CACR,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,QAAiB;IAC3C,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAC9B,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO,SAAS,CAAC;IACpD,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;AAC9B,CAAC;AAED,SAAS,GAAG,CAAC,CAAS;IACpB,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAChD,CAAC","sourcesContent":["import { useEffect, useState, type ReactNode } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport {\n IconX,\n IconTrash,\n IconLock,\n IconBuilding,\n IconWorld,\n IconCheck,\n IconCopy,\n IconLink,\n IconMail,\n IconCode,\n IconChevronDown,\n} from \"@tabler/icons-react\";\nimport * as Select from \"@radix-ui/react-select\";\nimport { writeClipboardText } from \"../clipboard.js\";\nimport { useActionQuery, useActionMutation } from \"../use-action.js\";\nimport { cn } from \"../utils.js\";\nimport { agentNativePath } from \"../api-path.js\";\n\nexport interface ShareDialogProps {\n open: boolean;\n onClose: () => void;\n resourceType: string;\n resourceId: string;\n resourceTitle?: string;\n /**\n * When provided, enables the \"Link\" tab with a copy-link field.\n * Pass the user-facing share URL (e.g. `https://…/share/<id>`).\n */\n shareUrl?: string;\n /**\n * When provided, enables the \"Embed\" tab with a default iframe snippet.\n * For richer per-resource controls (autoplay, start time, responsive /\n * fixed size), pass `embedTabContent` instead (or in addition) — it\n * replaces the default embed body.\n */\n embedUrl?: string;\n /** Advanced: fully custom Embed tab body. Requires `embedUrl` to enable the tab. */\n embedTabContent?: ReactNode;\n /** Extra content appended to the bottom of the Link tab (e.g. download buttons). */\n linkTabExtras?: ReactNode;\n}\n\ntype Visibility = \"private\" | \"org\" | \"public\";\ntype Role = \"viewer\" | \"editor\" | \"admin\";\n\ninterface Share {\n id: string;\n principalType: \"user\" | \"org\";\n principalId: string;\n role: Role;\n}\n\ninterface SharesResponse {\n ownerEmail: string | null;\n orgId: string | null;\n visibility: Visibility | null;\n role?: \"owner\" | Role;\n shares: Share[];\n}\n\ninterface OrgMember {\n email: string;\n name?: string | null;\n}\n\nfunction useOrgMembers(): OrgMember[] {\n const [members, setMembers] = useState<OrgMember[]>([]);\n useEffect(() => {\n let cancelled = false;\n fetch(agentNativePath(\"/_agent-native/org/members\"))\n .then((r) => (r.ok ? r.json() : null))\n .then((data) => {\n if (cancelled || !data) return;\n const list = Array.isArray(data?.members) ? data.members : [];\n setMembers(\n list\n .map((m: any) => ({\n email: typeof m?.email === \"string\" ? m.email : \"\",\n name: typeof m?.name === \"string\" ? m.name : null,\n }))\n .filter((m: OrgMember) => m.email),\n );\n })\n .catch(() => {});\n return () => {\n cancelled = true;\n };\n }, []);\n return members;\n}\n\nfunction displayName(email: string, members: OrgMember[]): string {\n const match = members.find((m) => m.email === email);\n if (match?.name && match.name.trim()) return match.name;\n return email;\n}\n\nconst BUTTON_BASE =\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0\";\nconst BUTTON_OUTLINE_SM = cn(\n BUTTON_BASE,\n \"h-9 px-3 border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n);\nconst BUTTON_PRIMARY_SM = cn(\n BUTTON_BASE,\n \"h-9 px-4 bg-primary text-primary-foreground hover:bg-primary/90\",\n);\nconst BUTTON_GHOST_ICON = cn(\n BUTTON_BASE,\n \"h-8 w-8 p-0 text-muted-foreground hover:bg-accent hover:text-accent-foreground\",\n);\n\nconst VIS_META: Record<\n Visibility,\n { label: string; description: string; Icon: typeof IconLock }\n> = {\n private: {\n label: \"Private\",\n description: \"Only people with access can view\",\n Icon: IconLock,\n },\n org: {\n label: \"Organization\",\n description: \"Anyone in your organization can view\",\n Icon: IconBuilding,\n },\n public: {\n label: \"Public\",\n description: \"Anyone signed in with the link can view\",\n Icon: IconWorld,\n },\n};\n\nconst ROLE_OPTIONS: Array<{ value: Role; label: string; description: string }> =\n [\n { value: \"viewer\", label: \"Viewer\", description: \"Can view\" },\n { value: \"editor\", label: \"Editor\", description: \"Can edit\" },\n {\n value: \"admin\",\n label: \"Admin\",\n description: \"Can edit and manage access\",\n },\n ];\n\n/**\n * Framework share dialog. Drop into any template via\n * `<ShareDialog open onClose resourceType resourceId />`. Passing\n * `shareUrl` lights up a Link tab with a copy field; passing `embedUrl`\n * lights up an Embed tab. With neither prop, renders a single Invite +\n * general-access panel (Google-Docs-lite).\n */\nexport function ShareDialog(props: ShareDialogProps) {\n const {\n open,\n onClose,\n resourceType,\n resourceId,\n resourceTitle,\n shareUrl,\n embedUrl,\n embedTabContent,\n linkTabExtras,\n } = props;\n\n const sharesQuery = useActionQuery<SharesResponse>(\"list-resource-shares\", {\n resourceType,\n resourceId,\n });\n const orgMembers = useOrgMembers();\n\n const hasLinkTab = Boolean(shareUrl);\n const hasEmbedTab = Boolean(embedUrl);\n const tabsEnabled = hasLinkTab || hasEmbedTab;\n\n const [tab, setTab] = useState<\"link\" | \"invite\" | \"embed\">(\n hasLinkTab ? \"link\" : \"invite\",\n );\n\n useEffect(() => {\n if (!open) return;\n setTab(hasLinkTab ? \"link\" : \"invite\");\n }, [open, hasLinkTab]);\n\n useEffect(() => {\n if (!open) return;\n const onKey = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") onClose();\n };\n window.addEventListener(\"keydown\", onKey);\n return () => window.removeEventListener(\"keydown\", onKey);\n }, [open, onClose]);\n\n if (!open) return null;\n\n const titleText = resourceTitle\n ? `Share \"${resourceTitle}\"`\n : `Share ${resourceType}`;\n\n return createPortal(\n <div\n className=\"fixed inset-0 z-[2000] flex items-start justify-center bg-black/40 p-4 sm:items-center\"\n onClick={onClose}\n >\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={titleText}\n className=\"w-full max-w-lg rounded-xl border border-border bg-popover text-popover-foreground shadow-2xl outline-none\"\n onClick={(e) => e.stopPropagation()}\n >\n <div className=\"flex items-start justify-between gap-3 px-5 pt-4 pb-3\">\n <div className=\"min-w-0 flex-1\">\n <div className=\"truncate text-base font-semibold\" title={titleText}>\n {titleText}\n </div>\n {sharesQuery.data?.ownerEmail ? (\n <div className=\"mt-0.5 truncate text-xs text-muted-foreground\">\n Owner: {displayName(sharesQuery.data.ownerEmail, orgMembers)}\n </div>\n ) : null}\n </div>\n <button\n type=\"button\"\n aria-label=\"Close\"\n onClick={onClose}\n className={BUTTON_GHOST_ICON}\n >\n <IconX size={16} />\n </button>\n </div>\n\n {tabsEnabled ? (\n <div\n role=\"tablist\"\n aria-label=\"Share options\"\n className=\"mx-5 mt-1 flex gap-1 border-b border-border\"\n >\n {hasLinkTab ? (\n <TabTrigger\n active={tab === \"link\"}\n onClick={() => setTab(\"link\")}\n icon={<IconLink size={14} strokeWidth={1.75} />}\n label=\"Link\"\n />\n ) : null}\n <TabTrigger\n active={tab === \"invite\"}\n onClick={() => setTab(\"invite\")}\n icon={<IconMail size={14} strokeWidth={1.75} />}\n label=\"Invite\"\n />\n {hasEmbedTab ? (\n <TabTrigger\n active={tab === \"embed\"}\n onClick={() => setTab(\"embed\")}\n icon={<IconCode size={14} strokeWidth={1.75} />}\n label=\"Embed\"\n />\n ) : null}\n </div>\n ) : null}\n\n <div className=\"px-5 py-4\">\n {tabsEnabled && tab === \"link\" && hasLinkTab ? (\n <LinkTab\n resourceType={resourceType}\n resourceId={resourceId}\n shareUrl={shareUrl!}\n sharesQuery={sharesQuery}\n extras={linkTabExtras}\n />\n ) : null}\n {!tabsEnabled || tab === \"invite\" ? (\n <InviteTab\n resourceType={resourceType}\n resourceId={resourceId}\n shareUrl={shareUrl}\n sharesQuery={sharesQuery}\n showVisibility={!tabsEnabled}\n orgMembers={orgMembers}\n />\n ) : null}\n {tabsEnabled && tab === \"embed\" && hasEmbedTab\n ? (embedTabContent ?? <DefaultEmbedBody embedUrl={embedUrl!} />)\n : null}\n </div>\n\n <div className=\"flex justify-end border-t border-border px-5 py-3\">\n <button type=\"button\" onClick={onClose} className={BUTTON_PRIMARY_SM}>\n Done\n </button>\n </div>\n </div>\n </div>,\n document.body,\n );\n}\n\n// ---------------------------------------------------------------------------\n// Tabs\n// ---------------------------------------------------------------------------\n\nfunction TabTrigger(props: {\n active: boolean;\n onClick: () => void;\n icon: ReactNode;\n label: string;\n}) {\n return (\n <button\n type=\"button\"\n role=\"tab\"\n aria-selected={props.active}\n onClick={props.onClick}\n className={cn(\n \"inline-flex items-center gap-1.5 border-b-2 px-3 py-2 text-sm font-medium transition-colors\",\n props.active\n ? \"border-foreground text-foreground\"\n : \"border-transparent text-muted-foreground hover:text-foreground\",\n )}\n >\n {props.icon}\n {props.label}\n </button>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Link tab — visibility picker + copy-link field + optional extras\n// ---------------------------------------------------------------------------\n\nfunction LinkTab(props: {\n resourceType: string;\n resourceId: string;\n shareUrl: string;\n sharesQuery: ReturnType<typeof useActionQuery<SharesResponse>>;\n extras?: ReactNode;\n}) {\n const { resourceType, resourceId, shareUrl, sharesQuery, extras } = props;\n\n const setVisibility = useActionMutation(\"set-resource-visibility\");\n const data = sharesQuery.data;\n const visibility: Visibility =\n (data?.visibility as Visibility | null) ?? \"private\";\n const canManage = data?.role === \"owner\" || data?.role === \"admin\";\n const meta = VIS_META[visibility];\n\n const handleVisibility = (next: Visibility) => {\n if (next === visibility) return;\n setVisibility.mutate(\n { resourceType, resourceId, visibility: next } as any,\n { onSuccess: () => sharesQuery.refetch() },\n );\n };\n\n return (\n <div className=\"space-y-4\">\n <div>\n <div className=\"mb-2 text-sm font-semibold\">General access</div>\n <div className=\"flex items-center gap-3\">\n <span\n aria-hidden\n className=\"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground\"\n >\n <meta.Icon size={16} strokeWidth={1.75} />\n </span>\n <div className=\"min-w-0 flex-1\">\n <VisibilitySelect\n value={visibility}\n onChange={handleVisibility}\n disabled={!canManage}\n />\n <div className=\"mt-0.5 text-xs text-muted-foreground\">\n {meta.description}\n </div>\n </div>\n </div>\n </div>\n\n <CopyField label=\"Share link\" value={shareUrl} />\n\n {extras}\n </div>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Invite tab — invite-by-email + shares list + (optional) visibility\n// ---------------------------------------------------------------------------\n\nfunction InviteTab(props: {\n resourceType: string;\n resourceId: string;\n shareUrl?: string;\n sharesQuery: ReturnType<typeof useActionQuery<SharesResponse>>;\n showVisibility: boolean;\n orgMembers: OrgMember[];\n}) {\n const {\n resourceType,\n resourceId,\n shareUrl,\n sharesQuery,\n showVisibility,\n orgMembers,\n } = props;\n\n const share = useActionMutation(\"share-resource\");\n const unshare = useActionMutation(\"unshare-resource\");\n const setVisibility = useActionMutation(\"set-resource-visibility\");\n\n const [email, setEmail] = useState(\"\");\n const [role, setRole] = useState<Role>(\"viewer\");\n const [notifyPeople, setNotifyPeople] = useState(true);\n const hasInviteEmail = email.trim().length > 0;\n\n const data = sharesQuery.data;\n const shares = data?.shares ?? [];\n const visibility: Visibility =\n (data?.visibility as Visibility | null) ?? \"private\";\n const canManage = data?.role === \"owner\" || data?.role === \"admin\";\n const meta = VIS_META[visibility];\n\n const handleAdd = () => {\n const trimmed = email.trim();\n if (!trimmed) return;\n share.mutate(\n {\n resourceType,\n resourceId,\n principalType: \"user\",\n principalId: trimmed,\n role,\n notify: notifyPeople,\n resourceUrl: getNotificationUrl(shareUrl),\n } as any,\n {\n onSuccess: () => {\n setEmail(\"\");\n sharesQuery.refetch();\n },\n },\n );\n };\n\n const handleRemove = (s: Share) => {\n unshare.mutate(\n {\n resourceType,\n resourceId,\n principalType: s.principalType,\n principalId: s.principalId,\n } as any,\n { onSuccess: () => sharesQuery.refetch() },\n );\n };\n\n const handleVisibility = (next: Visibility) => {\n if (next === visibility) return;\n setVisibility.mutate(\n { resourceType, resourceId, visibility: next } as any,\n { onSuccess: () => sharesQuery.refetch() },\n );\n };\n\n return (\n <div className=\"space-y-4\">\n {canManage ? (\n <div className=\"space-y-2\">\n <div className=\"flex items-stretch gap-2\">\n <input\n type=\"email\"\n placeholder=\"Add people by email\"\n value={email}\n onChange={(e) => setEmail(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") handleAdd();\n }}\n autoComplete=\"off\"\n className=\"flex-1 min-w-0 h-9 rounded-md border border-input bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background\"\n />\n <RoleSelect value={role} onChange={setRole} />\n </div>\n {hasInviteEmail ? (\n <label className=\"inline-flex items-center gap-2 text-xs text-muted-foreground\">\n <input\n type=\"checkbox\"\n checked={notifyPeople}\n onChange={(e) => setNotifyPeople(e.target.checked)}\n className=\"h-4 w-4 rounded border-input accent-primary\"\n />\n Notify people\n </label>\n ) : null}\n </div>\n ) : null}\n\n <div>\n <div className=\"mb-2 text-sm font-semibold\">People with access</div>\n <ul className=\"flex flex-col gap-1 list-none p-0 m-0\">\n {data?.ownerEmail ? (\n <li className=\"flex items-center gap-3 px-1 py-1.5 text-sm\">\n <Avatar label={displayName(data.ownerEmail, orgMembers)} />\n <span className=\"flex-1 min-w-0 truncate\">\n {displayName(data.ownerEmail, orgMembers)}\n </span>\n <span className=\"text-xs text-muted-foreground\">Owner</span>\n </li>\n ) : null}\n {shares.map((s) => (\n <li\n key={`${s.principalType}:${s.principalId}`}\n className=\"flex items-center gap-3 px-1 py-1.5 text-sm\"\n >\n <Avatar\n label={\n s.principalType === \"org\"\n ? s.principalId\n : displayName(s.principalId, orgMembers)\n }\n org={s.principalType === \"org\"}\n />\n <span className=\"flex-1 min-w-0 truncate\">\n {s.principalType === \"org\"\n ? s.principalId\n : displayName(s.principalId, orgMembers)}\n </span>\n <span className=\"text-xs text-muted-foreground\">\n {cap(s.role)}\n </span>\n {canManage ? (\n <button\n type=\"button\"\n aria-label=\"Remove\"\n onClick={() => handleRemove(s)}\n className={BUTTON_GHOST_ICON}\n >\n <IconTrash size={14} />\n </button>\n ) : null}\n </li>\n ))}\n {!shares.length && !data?.ownerEmail ? (\n <li className=\"px-1 py-1.5 text-sm text-muted-foreground\">\n No one has access yet.\n </li>\n ) : null}\n </ul>\n </div>\n\n {showVisibility ? (\n <div>\n <div className=\"mb-2 text-sm font-semibold\">General access</div>\n <div className=\"flex items-center gap-3\">\n <span\n aria-hidden\n className=\"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground\"\n >\n <meta.Icon size={16} strokeWidth={1.75} />\n </span>\n <div className=\"min-w-0 flex-1\">\n <VisibilitySelect\n value={visibility}\n onChange={handleVisibility}\n disabled={!canManage}\n />\n <div className=\"mt-0.5 text-xs text-muted-foreground\">\n {meta.description}\n </div>\n </div>\n </div>\n </div>\n ) : null}\n </div>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Default Embed body (simple responsive iframe snippet)\n// ---------------------------------------------------------------------------\n\nfunction DefaultEmbedBody({ embedUrl }: { embedUrl: string }) {\n const code = `<div style=\"position:relative;padding-bottom:56.25%;height:0\"><iframe src=\"${embedUrl}\" frameborder=\"0\" allowfullscreen allow=\"autoplay; picture-in-picture\" style=\"position:absolute;inset:0;width:100%;height:100%\"></iframe></div>`;\n return (\n <div className=\"space-y-3\">\n <CopyField label=\"Embed URL\" value={embedUrl} />\n <CopyField label=\"Embed code\" value={code} multiline />\n </div>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Primitives\n// ---------------------------------------------------------------------------\n\nfunction CopyField({\n label,\n value,\n multiline,\n}: {\n label: string;\n value: string;\n multiline?: boolean;\n}) {\n const [copied, setCopied] = useState(false);\n const copy = async () => {\n if (!(await writeClipboardText(value))) {\n setCopied(false);\n return;\n }\n setCopied(true);\n setTimeout(() => setCopied(false), 1400);\n };\n return (\n <div>\n <div className=\"mb-1 text-xs font-medium text-muted-foreground\">\n {label}\n </div>\n <div className=\"flex items-stretch gap-2\">\n {multiline ? (\n <textarea\n readOnly\n value={value}\n className=\"flex-1 h-20 rounded-md border border-input bg-background px-3 py-2 text-xs font-mono text-foreground resize-none focus:outline-none focus:ring-2 focus:ring-ring\"\n />\n ) : (\n <input\n readOnly\n value={value}\n className=\"flex-1 min-w-0 h-9 rounded-md border border-input bg-background px-3 text-xs font-mono text-foreground focus:outline-none focus:ring-2 focus:ring-ring\"\n />\n )}\n <button\n type=\"button\"\n onClick={copy}\n aria-label=\"Copy\"\n className={cn(BUTTON_OUTLINE_SM, \"w-9 px-0\")}\n >\n {copied ? <IconCheck size={14} /> : <IconCopy size={14} />}\n </button>\n </div>\n </div>\n );\n}\n\nconst selectContentClass =\n \"z-[2100] min-w-[12rem] overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md\";\nconst selectItemClass =\n \"relative flex w-full cursor-pointer select-none items-start gap-2 rounded-sm py-2 pl-8 pr-3 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\";\n\nfunction SelectItems({\n items,\n}: {\n items: Array<{ value: string; label: string; description?: string }>;\n}) {\n return (\n <>\n {items.map((it) => (\n <Select.Item\n key={it.value}\n value={it.value}\n className={selectItemClass}\n >\n <span className=\"absolute left-2 top-2 flex h-4 w-4 items-center justify-center\">\n <Select.ItemIndicator>\n <IconCheck size={14} />\n </Select.ItemIndicator>\n </span>\n <span className=\"flex flex-col\">\n <Select.ItemText>{it.label}</Select.ItemText>\n {it.description ? (\n <span className=\"text-xs text-muted-foreground\">\n {it.description}\n </span>\n ) : null}\n </span>\n </Select.Item>\n ))}\n </>\n );\n}\n\nfunction RoleSelect(props: { value: Role; onChange: (v: Role) => void }) {\n const current =\n ROLE_OPTIONS.find((o) => o.value === props.value) ?? ROLE_OPTIONS[0];\n return (\n <Select.Root\n value={props.value}\n onValueChange={(v) => props.onChange(v as Role)}\n >\n <Select.Trigger\n aria-label=\"Role\"\n className={cn(\n BUTTON_BASE,\n \"h-9 px-3 border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n )}\n >\n <Select.Value>{current.label}</Select.Value>\n <Select.Icon>\n <IconChevronDown size={14} />\n </Select.Icon>\n </Select.Trigger>\n <Select.Portal>\n <Select.Content\n className={selectContentClass}\n position=\"popper\"\n sideOffset={4}\n >\n <Select.Viewport>\n <SelectItems items={ROLE_OPTIONS} />\n </Select.Viewport>\n </Select.Content>\n </Select.Portal>\n </Select.Root>\n );\n}\n\nfunction VisibilitySelect(props: {\n value: Visibility;\n onChange: (v: Visibility) => void;\n disabled?: boolean;\n}) {\n const current = VIS_META[props.value];\n return (\n <Select.Root\n value={props.value}\n onValueChange={(v) => props.onChange(v as Visibility)}\n disabled={props.disabled}\n >\n <Select.Trigger\n aria-label=\"General access\"\n className={cn(\n BUTTON_BASE,\n \"h-7 px-1 -ml-1 bg-transparent text-foreground hover:bg-accent hover:text-accent-foreground\",\n )}\n >\n <Select.Value>{current.label}</Select.Value>\n <Select.Icon>\n <IconChevronDown size={14} />\n </Select.Icon>\n </Select.Trigger>\n <Select.Portal>\n <Select.Content\n className={selectContentClass}\n position=\"popper\"\n sideOffset={4}\n >\n <Select.Viewport>\n <SelectItems\n items={(Object.keys(VIS_META) as Visibility[]).map((k) => ({\n value: k,\n label: VIS_META[k].label,\n description: VIS_META[k].description,\n }))}\n />\n </Select.Viewport>\n </Select.Content>\n </Select.Portal>\n </Select.Root>\n );\n}\n\nfunction Avatar({ label, org }: { label: string; org?: boolean }) {\n return (\n <span\n aria-hidden\n className=\"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-muted text-[11px] font-semibold text-muted-foreground\"\n >\n {org ? (\n <IconBuilding size={14} strokeWidth={1.75} />\n ) : (\n (label.split(\"@\")[0]?.[0] ?? label[0] ?? \"?\").toUpperCase()\n )}\n </span>\n );\n}\n\nfunction getNotificationUrl(explicit?: string): string | undefined {\n if (explicit) return explicit;\n if (typeof window === \"undefined\") return undefined;\n return window.location.href;\n}\n\nfunction cap(s: string): string {\n return s.charAt(0).toUpperCase() + s.slice(1);\n}\n"]}
1
+ {"version":3,"file":"ShareDialog.js","sourceRoot":"","sources":["../../../src/client/sharing/ShareDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EACL,KAAK,EACL,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,eAAe,GAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAiDjD,SAAS,aAAa;IACpB,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAc,EAAE,CAAC,CAAC;IACxD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,SAAS,GA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CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,CAC5D,GACI,CACR,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,QAAiB;IAC3C,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAC9B,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO,SAAS,CAAC;IACpD,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;AAC9B,CAAC;AAED,SAAS,GAAG,CAAC,CAAS;IACpB,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAChD,CAAC","sourcesContent":["import { useEffect, useState, type ReactNode } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport {\n IconX,\n IconTrash,\n IconLock,\n IconBuilding,\n IconWorld,\n IconCheck,\n IconCopy,\n IconLink,\n IconMail,\n IconCode,\n IconChevronDown,\n} from \"@tabler/icons-react\";\nimport * as Select from \"@radix-ui/react-select\";\nimport { writeClipboardText } from \"../clipboard.js\";\nimport { useActionQuery, useActionMutation } from \"../use-action.js\";\nimport { cn } from \"../utils.js\";\nimport { agentNativePath } from \"../api-path.js\";\n\nexport interface ShareDialogProps {\n open: boolean;\n onClose: () => void;\n resourceType: string;\n resourceId: string;\n resourceTitle?: string;\n /**\n * When provided, enables the \"Link\" tab with a copy-link field.\n * Pass the user-facing share URL (e.g. `https://…/share/<id>`).\n */\n shareUrl?: string;\n /**\n * When provided, enables the \"Embed\" tab with a default iframe snippet.\n * For richer per-resource controls (autoplay, start time, responsive /\n * fixed size), pass `embedTabContent` instead (or in addition) — it\n * replaces the default embed body.\n */\n embedUrl?: string;\n /** Advanced: fully custom Embed tab body. Requires `embedUrl` to enable the tab. */\n embedTabContent?: ReactNode;\n /** Extra content appended to the bottom of the Link tab (e.g. download buttons). */\n linkTabExtras?: ReactNode;\n}\n\ntype Visibility = \"private\" | \"org\" | \"public\";\ntype Role = \"viewer\" | \"editor\" | \"admin\";\n\ninterface Share {\n id: string;\n principalType: \"user\" | \"org\";\n principalId: string;\n role: Role;\n}\n\ninterface SharesResponse {\n ownerEmail: string | null;\n orgId: string | null;\n visibility: Visibility | null;\n role?: \"owner\" | Role;\n shares: Share[];\n}\n\ninterface OrgMember {\n email: string;\n name?: string | null;\n}\n\nfunction useOrgMembers(): OrgMember[] {\n const [members, setMembers] = useState<OrgMember[]>([]);\n useEffect(() => {\n let cancelled = false;\n fetch(agentNativePath(\"/_agent-native/org/members\"))\n .then((r) => (r.ok ? r.json() : null))\n .then((data) => {\n if (cancelled || !data) return;\n const list = Array.isArray(data?.members) ? data.members : [];\n setMembers(\n list\n .map((m: any) => ({\n email: typeof m?.email === \"string\" ? m.email : \"\",\n name: typeof m?.name === \"string\" ? m.name : null,\n }))\n .filter((m: OrgMember) => m.email),\n );\n })\n .catch(() => {});\n return () => {\n cancelled = true;\n };\n }, []);\n return members;\n}\n\nfunction displayName(email: string, members: OrgMember[]): string {\n const match = members.find((m) => m.email === email);\n if (match?.name && match.name.trim()) return match.name;\n return email;\n}\n\nconst BUTTON_BASE =\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0\";\nconst BUTTON_OUTLINE_SM = cn(\n BUTTON_BASE,\n \"h-9 px-3 border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n);\nconst BUTTON_PRIMARY_SM = cn(\n BUTTON_BASE,\n \"h-9 px-4 bg-primary text-primary-foreground hover:bg-primary/90\",\n);\nconst BUTTON_GHOST_ICON = cn(\n BUTTON_BASE,\n \"h-8 w-8 p-0 text-muted-foreground hover:bg-accent hover:text-accent-foreground\",\n);\n\nconst VIS_META: Record<\n Visibility,\n { label: string; description: string; Icon: typeof IconLock }\n> = {\n private: {\n label: \"Private\",\n description: \"Only people with access can view\",\n Icon: IconLock,\n },\n org: {\n label: \"Organization\",\n description: \"Anyone in your organization can view\",\n Icon: IconBuilding,\n },\n public: {\n label: \"Public\",\n description: \"Anyone signed in with the link can view\",\n Icon: IconWorld,\n },\n};\n\nconst ROLE_OPTIONS: Array<{ value: Role; label: string; description: string }> =\n [\n { value: \"viewer\", label: \"Viewer\", description: \"Can view\" },\n { value: \"editor\", label: \"Editor\", description: \"Can edit\" },\n {\n value: \"admin\",\n label: \"Admin\",\n description: \"Can edit and manage access\",\n },\n ];\n\n/**\n * Framework share dialog. Drop into any template via\n * `<ShareDialog open onClose resourceType resourceId />`. Passing\n * `shareUrl` lights up a Link tab with a copy field; passing `embedUrl`\n * lights up an Embed tab. With neither prop, renders a single Invite +\n * general-access panel (Google-Docs-lite).\n */\nexport function ShareDialog(props: ShareDialogProps) {\n const {\n open,\n onClose,\n resourceType,\n resourceId,\n resourceTitle,\n shareUrl,\n embedUrl,\n embedTabContent,\n linkTabExtras,\n } = props;\n\n const sharesQuery = useActionQuery<SharesResponse>(\"list-resource-shares\", {\n resourceType,\n resourceId,\n });\n const orgMembers = useOrgMembers();\n\n const hasLinkTab = Boolean(shareUrl);\n const hasEmbedTab = Boolean(embedUrl);\n const tabsEnabled = hasLinkTab || hasEmbedTab;\n\n const [tab, setTab] = useState<\"link\" | \"invite\" | \"embed\">(\n hasLinkTab ? \"link\" : \"invite\",\n );\n\n useEffect(() => {\n if (!open) return;\n setTab(hasLinkTab ? \"link\" : \"invite\");\n }, [open, hasLinkTab]);\n\n useEffect(() => {\n if (!open) return;\n const onKey = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") onClose();\n };\n window.addEventListener(\"keydown\", onKey);\n return () => window.removeEventListener(\"keydown\", onKey);\n }, [open, onClose]);\n\n if (!open) return null;\n\n const titleText = resourceTitle\n ? `Share \"${resourceTitle}\"`\n : `Share ${resourceType}`;\n\n return createPortal(\n <div\n className=\"fixed inset-0 z-[2000] flex items-start justify-center bg-black/40 p-4 sm:items-center\"\n onClick={onClose}\n >\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={titleText}\n className=\"w-full max-w-lg rounded-xl border border-border bg-popover text-popover-foreground shadow-2xl outline-none\"\n onClick={(e) => e.stopPropagation()}\n >\n <div className=\"flex items-start justify-between gap-3 px-5 pt-4 pb-3\">\n <div className=\"min-w-0 flex-1\">\n <div className=\"truncate text-base font-semibold\" title={titleText}>\n {titleText}\n </div>\n {sharesQuery.data?.ownerEmail ? (\n <div className=\"mt-0.5 truncate text-xs text-muted-foreground\">\n Owner: {displayName(sharesQuery.data.ownerEmail, orgMembers)}\n </div>\n ) : null}\n </div>\n <button\n type=\"button\"\n aria-label=\"Close\"\n onClick={onClose}\n className={BUTTON_GHOST_ICON}\n >\n <IconX size={16} />\n </button>\n </div>\n\n {tabsEnabled ? (\n <div\n role=\"tablist\"\n aria-label=\"Share options\"\n className=\"mx-5 mt-1 flex gap-1 border-b border-border\"\n >\n {hasLinkTab ? (\n <TabTrigger\n active={tab === \"link\"}\n onClick={() => setTab(\"link\")}\n icon={<IconLink size={14} strokeWidth={1.75} />}\n label=\"Link\"\n />\n ) : null}\n <TabTrigger\n active={tab === \"invite\"}\n onClick={() => setTab(\"invite\")}\n icon={<IconMail size={14} strokeWidth={1.75} />}\n label=\"Invite\"\n />\n {hasEmbedTab ? (\n <TabTrigger\n active={tab === \"embed\"}\n onClick={() => setTab(\"embed\")}\n icon={<IconCode size={14} strokeWidth={1.75} />}\n label=\"Embed\"\n />\n ) : null}\n </div>\n ) : null}\n\n <div className=\"px-5 py-4\">\n {tabsEnabled && tab === \"link\" && hasLinkTab ? (\n <LinkTab\n resourceType={resourceType}\n resourceId={resourceId}\n shareUrl={shareUrl!}\n sharesQuery={sharesQuery}\n extras={linkTabExtras}\n />\n ) : null}\n {!tabsEnabled || tab === \"invite\" ? (\n <InviteTab\n resourceType={resourceType}\n resourceId={resourceId}\n shareUrl={shareUrl}\n sharesQuery={sharesQuery}\n showVisibility={!tabsEnabled}\n orgMembers={orgMembers}\n />\n ) : null}\n {tabsEnabled && tab === \"embed\" && hasEmbedTab\n ? (embedTabContent ?? <DefaultEmbedBody embedUrl={embedUrl!} />)\n : null}\n </div>\n\n <div className=\"flex justify-end border-t border-border px-5 py-3\">\n <button type=\"button\" onClick={onClose} className={BUTTON_PRIMARY_SM}>\n Done\n </button>\n </div>\n </div>\n </div>,\n document.body,\n );\n}\n\n// ---------------------------------------------------------------------------\n// Tabs\n// ---------------------------------------------------------------------------\n\nfunction TabTrigger(props: {\n active: boolean;\n onClick: () => void;\n icon: ReactNode;\n label: string;\n}) {\n return (\n <button\n type=\"button\"\n role=\"tab\"\n aria-selected={props.active}\n onClick={props.onClick}\n className={cn(\n \"inline-flex items-center gap-1.5 border-b-2 px-3 py-2 text-sm font-medium transition-colors\",\n props.active\n ? \"border-foreground text-foreground\"\n : \"border-transparent text-muted-foreground hover:text-foreground\",\n )}\n >\n {props.icon}\n {props.label}\n </button>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Link tab — visibility picker + copy-link field + optional extras\n// ---------------------------------------------------------------------------\n\nfunction LinkTab(props: {\n resourceType: string;\n resourceId: string;\n shareUrl: string;\n sharesQuery: ReturnType<typeof useActionQuery<SharesResponse>>;\n extras?: ReactNode;\n}) {\n const { resourceType, resourceId, shareUrl, sharesQuery, extras } = props;\n\n const setVisibility = useActionMutation(\"set-resource-visibility\");\n const data = sharesQuery.data;\n const visibility: Visibility =\n (data?.visibility as Visibility | null) ?? \"private\";\n const canManage = data?.role === \"owner\" || data?.role === \"admin\";\n const meta = VIS_META[visibility];\n\n const handleVisibility = (next: Visibility) => {\n if (next === visibility) return;\n setVisibility.mutate(\n { resourceType, resourceId, visibility: next } as any,\n { onSuccess: () => sharesQuery.refetch() },\n );\n };\n\n return (\n <div className=\"space-y-4\">\n <div>\n <div className=\"mb-2 text-sm font-semibold\">General access</div>\n <div className=\"flex items-center gap-3\">\n <span\n aria-hidden\n className=\"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground\"\n >\n <meta.Icon size={16} strokeWidth={1.75} />\n </span>\n <div className=\"min-w-0 flex-1\">\n <VisibilitySelect\n value={visibility}\n onChange={handleVisibility}\n disabled={!canManage}\n />\n <div className=\"mt-0.5 text-xs text-muted-foreground\">\n {meta.description}\n </div>\n </div>\n </div>\n </div>\n\n <CopyField label=\"Share link\" value={shareUrl} />\n\n {extras}\n </div>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Invite tab — invite-by-email + shares list + (optional) visibility\n// ---------------------------------------------------------------------------\n\nfunction InviteTab(props: {\n resourceType: string;\n resourceId: string;\n shareUrl?: string;\n sharesQuery: ReturnType<typeof useActionQuery<SharesResponse>>;\n showVisibility: boolean;\n orgMembers: OrgMember[];\n}) {\n const {\n resourceType,\n resourceId,\n shareUrl,\n sharesQuery,\n showVisibility,\n orgMembers,\n } = props;\n\n const share = useActionMutation(\"share-resource\");\n const unshare = useActionMutation(\"unshare-resource\");\n const setVisibility = useActionMutation(\"set-resource-visibility\");\n\n const [email, setEmail] = useState(\"\");\n const [role, setRole] = useState<Role>(\"viewer\");\n const [notifyPeople, setNotifyPeople] = useState(true);\n const hasInviteEmail = email.trim().length > 0;\n\n const data = sharesQuery.data;\n const shares = data?.shares ?? [];\n const visibility: Visibility =\n (data?.visibility as Visibility | null) ?? \"private\";\n const canManage = data?.role === \"owner\" || data?.role === \"admin\";\n const meta = VIS_META[visibility];\n\n const handleAdd = () => {\n const trimmed = email.trim();\n if (!trimmed) return;\n share.mutate(\n {\n resourceType,\n resourceId,\n principalType: \"user\",\n principalId: trimmed,\n role,\n notify: notifyPeople,\n resourceUrl: getNotificationUrl(shareUrl),\n } as any,\n {\n onSuccess: () => {\n setEmail(\"\");\n sharesQuery.refetch();\n },\n },\n );\n };\n\n const handleRemove = (s: Share) => {\n unshare.mutate(\n {\n resourceType,\n resourceId,\n principalType: s.principalType,\n principalId: s.principalId,\n } as any,\n { onSuccess: () => sharesQuery.refetch() },\n );\n };\n\n const handleVisibility = (next: Visibility) => {\n if (next === visibility) return;\n setVisibility.mutate(\n { resourceType, resourceId, visibility: next } as any,\n { onSuccess: () => sharesQuery.refetch() },\n );\n };\n\n return (\n <div className=\"space-y-4\">\n {canManage ? (\n <div className=\"space-y-2\">\n <div className=\"flex items-stretch gap-2\">\n <input\n type=\"email\"\n placeholder=\"Add people by email\"\n value={email}\n onChange={(e) => setEmail(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") handleAdd();\n }}\n autoComplete=\"off\"\n className=\"flex-1 min-w-0 h-9 rounded-md border border-input bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background\"\n />\n <RoleSelect value={role} onChange={setRole} />\n </div>\n {hasInviteEmail ? (\n <label className=\"inline-flex items-center gap-2 text-xs text-muted-foreground\">\n <input\n type=\"checkbox\"\n checked={notifyPeople}\n onChange={(e) => setNotifyPeople(e.target.checked)}\n className=\"h-4 w-4 rounded border-input accent-primary\"\n />\n Notify people\n </label>\n ) : null}\n </div>\n ) : null}\n\n <div>\n <div className=\"mb-2 text-sm font-semibold\">People with access</div>\n <ul className=\"flex flex-col gap-1 list-none p-0 m-0\">\n {data?.ownerEmail ? (\n <li className=\"flex items-center gap-3 px-1 py-1.5 text-sm\">\n <Avatar label={displayName(data.ownerEmail, orgMembers)} />\n <span className=\"flex-1 min-w-0 truncate\">\n {displayName(data.ownerEmail, orgMembers)}\n </span>\n <span className=\"text-xs text-muted-foreground\">Owner</span>\n </li>\n ) : null}\n {shares.map((s) => (\n <li\n key={`${s.principalType}:${s.principalId}`}\n className=\"flex items-center gap-3 px-1 py-1.5 text-sm\"\n >\n <Avatar\n label={\n s.principalType === \"org\"\n ? s.principalId\n : displayName(s.principalId, orgMembers)\n }\n org={s.principalType === \"org\"}\n />\n <span className=\"flex-1 min-w-0 truncate\">\n {s.principalType === \"org\"\n ? s.principalId\n : displayName(s.principalId, orgMembers)}\n </span>\n <span className=\"text-xs text-muted-foreground\">\n {cap(s.role)}\n </span>\n {canManage ? (\n <button\n type=\"button\"\n aria-label=\"Remove\"\n onClick={() => handleRemove(s)}\n className={BUTTON_GHOST_ICON}\n >\n <IconTrash size={14} />\n </button>\n ) : null}\n </li>\n ))}\n {!shares.length && !data?.ownerEmail ? (\n <li className=\"px-1 py-1.5 text-sm text-muted-foreground\">\n No one has access yet.\n </li>\n ) : null}\n </ul>\n </div>\n\n {showVisibility ? (\n <div>\n <div className=\"mb-2 text-sm font-semibold\">General access</div>\n <div className=\"flex items-center gap-3\">\n <span\n aria-hidden\n className=\"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground\"\n >\n <meta.Icon size={16} strokeWidth={1.75} />\n </span>\n <div className=\"min-w-0 flex-1\">\n <VisibilitySelect\n value={visibility}\n onChange={handleVisibility}\n disabled={!canManage}\n />\n <div className=\"mt-0.5 text-xs text-muted-foreground\">\n {meta.description}\n </div>\n </div>\n </div>\n </div>\n ) : null}\n </div>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Default Embed body (simple responsive iframe snippet)\n// ---------------------------------------------------------------------------\n\nfunction DefaultEmbedBody({ embedUrl }: { embedUrl: string }) {\n const code = `<div style=\"position:relative;padding-bottom:56.25%;height:0\"><iframe src=\"${embedUrl}\" frameborder=\"0\" allowfullscreen allow=\"autoplay; picture-in-picture\" style=\"position:absolute;inset:0;width:100%;height:100%\"></iframe></div>`;\n return (\n <div className=\"space-y-3\">\n <CopyField label=\"Embed URL\" value={embedUrl} />\n <CopyField label=\"Embed code\" value={code} multiline />\n </div>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Primitives\n// ---------------------------------------------------------------------------\n\nfunction CopyField({\n label,\n value,\n multiline,\n}: {\n label: string;\n value: string;\n multiline?: boolean;\n}) {\n const [copied, setCopied] = useState(false);\n const copy = async () => {\n if (!(await writeClipboardText(value))) {\n setCopied(false);\n return;\n }\n setCopied(true);\n setTimeout(() => setCopied(false), 1400);\n };\n return (\n <div>\n <div className=\"mb-1 text-xs font-medium text-muted-foreground\">\n {label}\n </div>\n <div className=\"flex items-stretch gap-2\">\n {multiline ? (\n <textarea\n readOnly\n value={value}\n className=\"flex-1 h-20 rounded-md border border-input bg-background px-3 py-2 text-xs font-mono text-foreground resize-none focus:outline-none focus:ring-2 focus:ring-ring\"\n />\n ) : (\n <input\n readOnly\n value={value}\n className=\"flex-1 min-w-0 h-9 rounded-md border border-input bg-background px-3 text-xs font-mono text-foreground focus:outline-none focus:ring-2 focus:ring-ring\"\n />\n )}\n <button\n type=\"button\"\n onClick={copy}\n aria-label=\"Copy\"\n className={cn(BUTTON_OUTLINE_SM, \"w-9 px-0\")}\n >\n {copied ? <IconCheck size={14} /> : <IconCopy size={14} />}\n </button>\n </div>\n </div>\n );\n}\n\nconst selectContentClass =\n \"z-[2100] min-w-[12rem] overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md\";\nconst selectItemClass =\n \"relative flex w-full cursor-pointer select-none items-start gap-2 rounded-sm py-2 ps-8 pe-3 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\";\n\nfunction SelectItems({\n items,\n}: {\n items: Array<{ value: string; label: string; description?: string }>;\n}) {\n return (\n <>\n {items.map((it) => (\n <Select.Item\n key={it.value}\n value={it.value}\n className={selectItemClass}\n >\n <span className=\"absolute start-2 top-2 flex h-4 w-4 items-center justify-center\">\n <Select.ItemIndicator>\n <IconCheck size={14} />\n </Select.ItemIndicator>\n </span>\n <span className=\"flex flex-col\">\n <Select.ItemText>{it.label}</Select.ItemText>\n {it.description ? (\n <span className=\"text-xs text-muted-foreground\">\n {it.description}\n </span>\n ) : null}\n </span>\n </Select.Item>\n ))}\n </>\n );\n}\n\nfunction RoleSelect(props: { value: Role; onChange: (v: Role) => void }) {\n const current =\n ROLE_OPTIONS.find((o) => o.value === props.value) ?? ROLE_OPTIONS[0];\n return (\n <Select.Root\n value={props.value}\n onValueChange={(v) => props.onChange(v as Role)}\n >\n <Select.Trigger\n aria-label=\"Role\"\n className={cn(\n BUTTON_BASE,\n \"h-9 px-3 border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n )}\n >\n <Select.Value>{current.label}</Select.Value>\n <Select.Icon>\n <IconChevronDown size={14} />\n </Select.Icon>\n </Select.Trigger>\n <Select.Portal>\n <Select.Content\n className={selectContentClass}\n position=\"popper\"\n sideOffset={4}\n >\n <Select.Viewport>\n <SelectItems items={ROLE_OPTIONS} />\n </Select.Viewport>\n </Select.Content>\n </Select.Portal>\n </Select.Root>\n );\n}\n\nfunction VisibilitySelect(props: {\n value: Visibility;\n onChange: (v: Visibility) => void;\n disabled?: boolean;\n}) {\n const current = VIS_META[props.value];\n return (\n <Select.Root\n value={props.value}\n onValueChange={(v) => props.onChange(v as Visibility)}\n disabled={props.disabled}\n >\n <Select.Trigger\n aria-label=\"General access\"\n className={cn(\n BUTTON_BASE,\n \"h-7 px-1 -ms-1 bg-transparent text-foreground hover:bg-accent hover:text-accent-foreground\",\n )}\n >\n <Select.Value>{current.label}</Select.Value>\n <Select.Icon>\n <IconChevronDown size={14} />\n </Select.Icon>\n </Select.Trigger>\n <Select.Portal>\n <Select.Content\n className={selectContentClass}\n position=\"popper\"\n sideOffset={4}\n >\n <Select.Viewport>\n <SelectItems\n items={(Object.keys(VIS_META) as Visibility[]).map((k) => ({\n value: k,\n label: VIS_META[k].label,\n description: VIS_META[k].description,\n }))}\n />\n </Select.Viewport>\n </Select.Content>\n </Select.Portal>\n </Select.Root>\n );\n}\n\nfunction Avatar({ label, org }: { label: string; org?: boolean }) {\n return (\n <span\n aria-hidden\n className=\"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-muted text-[11px] font-semibold text-muted-foreground\"\n >\n {org ? (\n <IconBuilding size={14} strokeWidth={1.75} />\n ) : (\n (label.split(\"@\")[0]?.[0] ?? label[0] ?? \"?\").toUpperCase()\n )}\n </span>\n );\n}\n\nfunction getNotificationUrl(explicit?: string): string | undefined {\n if (explicit) return explicit;\n if (typeof window === \"undefined\") return undefined;\n return window.location.href;\n}\n\nfunction cap(s: string): string {\n return s.charAt(0).toUpperCase() + s.slice(1);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/deploy/build.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;GAYG;AAOH,OAAO,EAML,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,qBAAqB,CAAC;AA+B7B,eAAO,MAAM,6BAA6B,UAiBzC,CAAC;AAuBF,wBAAgB,wCAAwC,CACtD,WAAW,EAAE,MAAM,EAAE,GACpB,MAAM,CAaR;AAgBD,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CAAC,CAAC;AAgBvE,wBAAgB,yCAAyC,CACvD,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,MAAM,EACjB,WAAW,SAAK,GACf,IAAI,CAQN;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,eAAe,EAAE,EACzB,WAAW,EAAE,MAAM,EAAE,EACrB,kBAAkB,GAAE,MAAM,EAAO,EACjC,OAAO,GAAE,gBAAgB,EAAO,EAChC,aAAa,GAAE,oBAAoB,GAAG,IAAW,EACjD,mBAAmB,GAAE,MAAM,EAAO,EAClC,gBAAgB,SAAmC,GAClD,MAAM,CAskBR;AAyXD,wBAAgB,mBAAmB,IAAI,MAAM,EAAE,CAE9C;AAkHD,wBAAgB,OAAO,CACrB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,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delegating. Method, ALL headers (the HMAC
1360
1360
  // Authorization: Bearer MUST survive — the plugin verifies it) and the body are
1361
1361
  // preserved by cloning the incoming Request with only its URL pathname set.
1362
- export default async function handler(request) {
1363
- cachedHandler ??= (await import("./main.mjs")).default;
1364
- const url = new URL(request.url);
1365
- url.pathname = PROCESS_RUN_PATH;
1366
- // Read the body once and pass it through. GET/HEAD have no body.
1367
- const method = request.method || "POST";
1368
- const hasBody = method !== "GET" && method !== "HEAD";
1369
- const body = hasBody ? await request.text() : undefined;
1370
- const rewritten = new Request(url.toString(), {
1371
- method,
1372
- headers: request.headers,
1373
- body,
1374
- });
1375
- return cachedHandler(rewritten);
1362
+ export default async function handler(request, context) {
1363
+ try {
1364
+ cachedHandler ??= (await import("./main.mjs")).default;
1365
+ const url = new URL(request.url);
1366
+ url.pathname = PROCESS_RUN_PATH;
1367
+ // Read the body once and pass it through. GET/HEAD have no body.
1368
+ const method = request.method || "POST";
1369
+ const hasBody = method !== "GET" && method !== "HEAD";
1370
+ const body = hasBody ? await request.text() : undefined;
1371
+ const rewritten = new Request(url.toString(), {
1372
+ method,
1373
+ headers: request.headers,
1374
+ body,
1375
+ });
1376
+ // Netlify Functions v2 invokes the handler as (request, context); the Nitro
1377
+ // netlify handler accepts (request[, context]). Pass context through so a
1378
+ // handler that uses it (e.g. waitUntil) does not trip over an undefined arg
1379
+ // before it ever routes the request.
1380
+ return await cachedHandler(rewritten, context);
1381
+ } catch (err) {
1382
+ // Netlify already returned 202 for this background invocation and DISCARDS
1383
+ // this return, so a throw here is otherwise INVISIBLE — it would only surface
1384
+ // downstream as the reaper's "worker never claimed the run". Log it loudly
1385
+ // for the function log; the FOREGROUND circuit-breaker (production-agent.ts)
1386
+ // is what recovers the run by executing it inline when no worker claims.
1387
+ console.error(
1388
+ "[agent-background] wrapper failed before reaching the route:",
1389
+ (err && err.stack) || err,
1390
+ );
1391
+ throw err;
1392
+ }
1376
1393
  }
1377
1394
 
1378
1395
  export const config = {