@fayz-ai/admin 0.10.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 (557) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +44 -0
  3. package/dist/CommandPalette-2AL327XQ.js +258 -0
  4. package/dist/CommandPalette-2AL327XQ.js.map +1 -0
  5. package/dist/ImportWizard-CISHGNQC.js +3 -0
  6. package/dist/ImportWizard-CISHGNQC.js.map +1 -0
  7. package/dist/ScheduleEditor-BSFF7LME.js +1040 -0
  8. package/dist/ScheduleEditor-BSFF7LME.js.map +1 -0
  9. package/dist/SubscriptionPage-NLZAZO4P.js +7 -0
  10. package/dist/SubscriptionPage-NLZAZO4P.js.map +1 -0
  11. package/dist/access/context.d.ts +47 -0
  12. package/dist/access/context.d.ts.map +1 -0
  13. package/dist/access/headless.d.ts +21 -0
  14. package/dist/access/headless.d.ts.map +1 -0
  15. package/dist/access/index.d.ts +12 -0
  16. package/dist/access/index.d.ts.map +1 -0
  17. package/dist/access/limits-registry.d.ts +33 -0
  18. package/dist/access/limits-registry.d.ts.map +1 -0
  19. package/dist/access/module-nav.d.ts +15 -0
  20. package/dist/access/module-nav.d.ts.map +1 -0
  21. package/dist/access/resolver.d.ts +2 -0
  22. package/dist/access/resolver.d.ts.map +1 -0
  23. package/dist/access/types.d.ts +43 -0
  24. package/dist/access/types.d.ts.map +1 -0
  25. package/dist/access/upgrade-modal-store.d.ts +23 -0
  26. package/dist/access/upgrade-modal-store.d.ts.map +1 -0
  27. package/dist/app/AdminShell.d.ts +65 -0
  28. package/dist/app/AdminShell.d.ts.map +1 -0
  29. package/dist/app/LoginPage.d.ts +3 -0
  30. package/dist/app/LoginPage.d.ts.map +1 -0
  31. package/dist/app/admin-app.d.ts +23 -0
  32. package/dist/app/admin-app.d.ts.map +1 -0
  33. package/dist/app/config.d.ts +277 -0
  34. package/dist/app/config.d.ts.map +1 -0
  35. package/dist/app/core-entities.d.ts +25 -0
  36. package/dist/app/core-entities.d.ts.map +1 -0
  37. package/dist/app/derive-contract.d.ts +8 -0
  38. package/dist/app/derive-contract.d.ts.map +1 -0
  39. package/dist/app/nav-contributions.store.d.ts +17 -0
  40. package/dist/app/nav-contributions.store.d.ts.map +1 -0
  41. package/dist/app/routing.d.ts +10 -0
  42. package/dist/app/routing.d.ts.map +1 -0
  43. package/dist/app/scaffold.d.ts +17 -0
  44. package/dist/app/scaffold.d.ts.map +1 -0
  45. package/dist/billing/index.d.ts +5 -0
  46. package/dist/billing/index.d.ts.map +1 -0
  47. package/dist/billing/index.js +3 -0
  48. package/dist/billing/index.js.map +1 -0
  49. package/dist/billing/plan-badge.d.ts +17 -0
  50. package/dist/billing/plan-badge.d.ts.map +1 -0
  51. package/dist/billing/store.d.ts +40 -0
  52. package/dist/billing/store.d.ts.map +1 -0
  53. package/dist/chunk-5O2UJAQ7.js +534 -0
  54. package/dist/chunk-5O2UJAQ7.js.map +1 -0
  55. package/dist/chunk-PNAJODZM.js +315 -0
  56. package/dist/chunk-PNAJODZM.js.map +1 -0
  57. package/dist/chunk-RKXZ7RUG.js +20 -0
  58. package/dist/chunk-RKXZ7RUG.js.map +1 -0
  59. package/dist/chunk-TNTZHUL6.js +817 -0
  60. package/dist/chunk-TNTZHUL6.js.map +1 -0
  61. package/dist/chunk-UMRN6427.js +510 -0
  62. package/dist/chunk-UMRN6427.js.map +1 -0
  63. package/dist/chunk-VN5NTK26.js +36 -0
  64. package/dist/chunk-VN5NTK26.js.map +1 -0
  65. package/dist/chunk-VTEP2AQX.js +101 -0
  66. package/dist/chunk-VTEP2AQX.js.map +1 -0
  67. package/dist/chunk-YUHCC7JY.js +11 -0
  68. package/dist/chunk-YUHCC7JY.js.map +1 -0
  69. package/dist/components/RightRail.d.ts +8 -0
  70. package/dist/components/RightRail.d.ts.map +1 -0
  71. package/dist/components/auth/CenteredLogin.d.ts +13 -0
  72. package/dist/components/auth/CenteredLogin.d.ts.map +1 -0
  73. package/dist/components/auth/LoginForm.d.ts +12 -0
  74. package/dist/components/auth/LoginForm.d.ts.map +1 -0
  75. package/dist/components/auth/LoginPage.d.ts +15 -0
  76. package/dist/components/auth/LoginPage.d.ts.map +1 -0
  77. package/dist/components/auth/OAuthButtons.d.ts +10 -0
  78. package/dist/components/auth/OAuthButtons.d.ts.map +1 -0
  79. package/dist/components/auth/ProtectedRoute.d.ts +11 -0
  80. package/dist/components/auth/ProtectedRoute.d.ts.map +1 -0
  81. package/dist/components/auth/RecoveryForm.d.ts +9 -0
  82. package/dist/components/auth/RecoveryForm.d.ts.map +1 -0
  83. package/dist/components/auth/SignupForm.d.ts +10 -0
  84. package/dist/components/auth/SignupForm.d.ts.map +1 -0
  85. package/dist/components/auth/SplitLogin.d.ts +14 -0
  86. package/dist/components/auth/SplitLogin.d.ts.map +1 -0
  87. package/dist/components/auth/index.d.ts +7 -0
  88. package/dist/components/auth/index.d.ts.map +1 -0
  89. package/dist/components/billing/InvoiceList.d.ts +9 -0
  90. package/dist/components/billing/InvoiceList.d.ts.map +1 -0
  91. package/dist/components/billing/PlanSelector.d.ts +13 -0
  92. package/dist/components/billing/PlanSelector.d.ts.map +1 -0
  93. package/dist/components/billing/SoftLimitBanner.d.ts +5 -0
  94. package/dist/components/billing/SoftLimitBanner.d.ts.map +1 -0
  95. package/dist/components/billing/SubscriptionCard.d.ts +12 -0
  96. package/dist/components/billing/SubscriptionCard.d.ts.map +1 -0
  97. package/dist/components/billing/SubscriptionPage.d.ts +5 -0
  98. package/dist/components/billing/SubscriptionPage.d.ts.map +1 -0
  99. package/dist/components/billing/UpgradeModal.d.ts +3 -0
  100. package/dist/components/billing/UpgradeModal.d.ts.map +1 -0
  101. package/dist/components/billing/UpgradeOverlay.d.ts +15 -0
  102. package/dist/components/billing/UpgradeOverlay.d.ts.map +1 -0
  103. package/dist/components/billing/UpgradePrompt.d.ts +10 -0
  104. package/dist/components/billing/UpgradePrompt.d.ts.map +1 -0
  105. package/dist/components/billing/access-contract.d.ts +18 -0
  106. package/dist/components/billing/access-contract.d.ts.map +1 -0
  107. package/dist/components/billing/gates.d.ts +14 -0
  108. package/dist/components/billing/gates.d.ts.map +1 -0
  109. package/dist/components/billing/index.d.ts +15 -0
  110. package/dist/components/billing/index.d.ts.map +1 -0
  111. package/dist/components/billing/plan-feature.d.ts +11 -0
  112. package/dist/components/billing/plan-feature.d.ts.map +1 -0
  113. package/dist/components/chat/ChatAttachments.d.ts +23 -0
  114. package/dist/components/chat/ChatAttachments.d.ts.map +1 -0
  115. package/dist/components/chat/ChatComposer.d.ts +21 -0
  116. package/dist/components/chat/ChatComposer.d.ts.map +1 -0
  117. package/dist/components/chat/ChatConversation.d.ts +20 -0
  118. package/dist/components/chat/ChatConversation.d.ts.map +1 -0
  119. package/dist/components/chat/ChatFab.d.ts +17 -0
  120. package/dist/components/chat/ChatFab.d.ts.map +1 -0
  121. package/dist/components/chat/ChatHistory.d.ts +16 -0
  122. package/dist/components/chat/ChatHistory.d.ts.map +1 -0
  123. package/dist/components/chat/ChatMessages.d.ts +16 -0
  124. package/dist/components/chat/ChatMessages.d.ts.map +1 -0
  125. package/dist/components/chat/ChatSuggestions.d.ts +17 -0
  126. package/dist/components/chat/ChatSuggestions.d.ts.map +1 -0
  127. package/dist/components/chat/ConfirmActionCard.d.ts +19 -0
  128. package/dist/components/chat/ConfirmActionCard.d.ts.map +1 -0
  129. package/dist/components/chat/RecordChip.d.ts +12 -0
  130. package/dist/components/chat/RecordChip.d.ts.map +1 -0
  131. package/dist/components/chat/index.d.ts +4 -0
  132. package/dist/components/chat/index.d.ts.map +1 -0
  133. package/dist/components/chat/markdown.d.ts +5 -0
  134. package/dist/components/chat/markdown.d.ts.map +1 -0
  135. package/dist/components/connect/AddConnectorPanel.d.ts +32 -0
  136. package/dist/components/connect/AddConnectorPanel.d.ts.map +1 -0
  137. package/dist/components/connect/ConnectConsentPage.d.ts +12 -0
  138. package/dist/components/connect/ConnectConsentPage.d.ts.map +1 -0
  139. package/dist/components/connect/ConnectorDetail.d.ts +29 -0
  140. package/dist/components/connect/ConnectorDetail.d.ts.map +1 -0
  141. package/dist/components/connect/ConnectorMark.d.ts +20 -0
  142. package/dist/components/connect/ConnectorMark.d.ts.map +1 -0
  143. package/dist/components/connect/ConnectorRow.d.ts +33 -0
  144. package/dist/components/connect/ConnectorRow.d.ts.map +1 -0
  145. package/dist/components/connect/ConnectorsPanel.d.ts +40 -0
  146. package/dist/components/connect/ConnectorsPanel.d.ts.map +1 -0
  147. package/dist/components/connect/ConnectorsTab.d.ts +16 -0
  148. package/dist/components/connect/ConnectorsTab.d.ts.map +1 -0
  149. package/dist/components/connect/client-marks.d.ts +31 -0
  150. package/dist/components/connect/client-marks.d.ts.map +1 -0
  151. package/dist/components/connect/index.d.ts +12 -0
  152. package/dist/components/connect/index.d.ts.map +1 -0
  153. package/dist/components/connect/model.d.ts +151 -0
  154. package/dist/components/connect/model.d.ts.map +1 -0
  155. package/dist/components/connect/useConnectors.d.ts +24 -0
  156. package/dist/components/connect/useConnectors.d.ts.map +1 -0
  157. package/dist/components/layout/BottomNav.d.ts +24 -0
  158. package/dist/components/layout/BottomNav.d.ts.map +1 -0
  159. package/dist/components/layout/CommandPalette.d.ts +23 -0
  160. package/dist/components/layout/CommandPalette.d.ts.map +1 -0
  161. package/dist/components/layout/LocationSwitchOverlay.d.ts +3 -0
  162. package/dist/components/layout/LocationSwitchOverlay.d.ts.map +1 -0
  163. package/dist/components/layout/MockModeBanner.d.ts +3 -0
  164. package/dist/components/layout/MockModeBanner.d.ts.map +1 -0
  165. package/dist/components/layout/PrintChrome.d.ts +10 -0
  166. package/dist/components/layout/PrintChrome.d.ts.map +1 -0
  167. package/dist/components/layout/index.d.ts +6 -0
  168. package/dist/components/layout/index.d.ts.map +1 -0
  169. package/dist/components/notes/NotesPanel.d.ts +13 -0
  170. package/dist/components/notes/NotesPanel.d.ts.map +1 -0
  171. package/dist/components/notifications/ChangelogFeed.d.ts +8 -0
  172. package/dist/components/notifications/ChangelogFeed.d.ts.map +1 -0
  173. package/dist/components/notifications/NotificationBell.d.ts +9 -0
  174. package/dist/components/notifications/NotificationBell.d.ts.map +1 -0
  175. package/dist/components/notifications/NotificationInbox.d.ts +13 -0
  176. package/dist/components/notifications/NotificationInbox.d.ts.map +1 -0
  177. package/dist/components/notifications/ToastProvider.d.ts +2 -0
  178. package/dist/components/notifications/ToastProvider.d.ts.map +1 -0
  179. package/dist/components/notifications/index.d.ts +5 -0
  180. package/dist/components/notifications/index.d.ts.map +1 -0
  181. package/dist/components/organization/InviteMemberDialog.d.ts +10 -0
  182. package/dist/components/organization/InviteMemberDialog.d.ts.map +1 -0
  183. package/dist/components/organization/OrgInitializer.d.ts +7 -0
  184. package/dist/components/organization/OrgInitializer.d.ts.map +1 -0
  185. package/dist/components/organization/OrgSwitcher.d.ts +7 -0
  186. package/dist/components/organization/OrgSwitcher.d.ts.map +1 -0
  187. package/dist/components/organization/PermissionMatrixEditor.d.ts +22 -0
  188. package/dist/components/organization/PermissionMatrixEditor.d.ts.map +1 -0
  189. package/dist/components/organization/PermissionProfilesTab.d.ts +3 -0
  190. package/dist/components/organization/PermissionProfilesTab.d.ts.map +1 -0
  191. package/dist/components/organization/TeamTab.d.ts +3 -0
  192. package/dist/components/organization/TeamTab.d.ts.map +1 -0
  193. package/dist/components/organization/TenantOnboarding.d.ts +9 -0
  194. package/dist/components/organization/TenantOnboarding.d.ts.map +1 -0
  195. package/dist/components/organization/index.d.ts +7 -0
  196. package/dist/components/organization/index.d.ts.map +1 -0
  197. package/dist/components/plugins/ConnectorsHub.d.ts +5 -0
  198. package/dist/components/plugins/ConnectorsHub.d.ts.map +1 -0
  199. package/dist/components/plugins/PluginSettingsPanel.d.ts +28 -0
  200. package/dist/components/plugins/PluginSettingsPanel.d.ts.map +1 -0
  201. package/dist/components/right-rail.d.ts +58 -0
  202. package/dist/components/right-rail.d.ts.map +1 -0
  203. package/dist/components/settings/BrandingSettings.d.ts +12 -0
  204. package/dist/components/settings/BrandingSettings.d.ts.map +1 -0
  205. package/dist/components/settings/CompanySettings.d.ts +13 -0
  206. package/dist/components/settings/CompanySettings.d.ts.map +1 -0
  207. package/dist/components/settings/ConnectedBrandingSettings.d.ts +2 -0
  208. package/dist/components/settings/ConnectedBrandingSettings.d.ts.map +1 -0
  209. package/dist/components/settings/ConnectedCompanySettings.d.ts +2 -0
  210. package/dist/components/settings/ConnectedCompanySettings.d.ts.map +1 -0
  211. package/dist/components/settings/ConnectedFieldRulesSettings.d.ts +2 -0
  212. package/dist/components/settings/ConnectedFieldRulesSettings.d.ts.map +1 -0
  213. package/dist/components/settings/ConnectedSecuritySettings.d.ts +2 -0
  214. package/dist/components/settings/ConnectedSecuritySettings.d.ts.map +1 -0
  215. package/dist/components/settings/ConnectedUserProfile.d.ts +3 -0
  216. package/dist/components/settings/ConnectedUserProfile.d.ts.map +1 -0
  217. package/dist/components/settings/FieldRulesSettings.d.ts +11 -0
  218. package/dist/components/settings/FieldRulesSettings.d.ts.map +1 -0
  219. package/dist/components/settings/HolidaysSettings.d.ts +21 -0
  220. package/dist/components/settings/HolidaysSettings.d.ts.map +1 -0
  221. package/dist/components/settings/LocationsCrudPage.d.ts +6 -0
  222. package/dist/components/settings/LocationsCrudPage.d.ts.map +1 -0
  223. package/dist/components/settings/LocationsOverview.d.ts +19 -0
  224. package/dist/components/settings/LocationsOverview.d.ts.map +1 -0
  225. package/dist/components/settings/SecuritySettings.d.ts +17 -0
  226. package/dist/components/settings/SecuritySettings.d.ts.map +1 -0
  227. package/dist/components/settings/SettingsPage.d.ts +46 -0
  228. package/dist/components/settings/SettingsPage.d.ts.map +1 -0
  229. package/dist/components/settings/UserProfile.d.ts +12 -0
  230. package/dist/components/settings/UserProfile.d.ts.map +1 -0
  231. package/dist/components/settings/index.d.ts +11 -0
  232. package/dist/components/settings/index.d.ts.map +1 -0
  233. package/dist/components/shared/ContactPicker.d.ts +92 -0
  234. package/dist/components/shared/ContactPicker.d.ts.map +1 -0
  235. package/dist/components/shared/PersonLink.d.ts +29 -0
  236. package/dist/components/shared/PersonLink.d.ts.map +1 -0
  237. package/dist/components/shared/create-person.d.ts +20 -0
  238. package/dist/components/shared/create-person.d.ts.map +1 -0
  239. package/dist/crud/CrudCardGrid.d.ts +13 -0
  240. package/dist/crud/CrudCardGrid.d.ts.map +1 -0
  241. package/dist/crud/CrudDetailPage.d.ts +23 -0
  242. package/dist/crud/CrudDetailPage.d.ts.map +1 -0
  243. package/dist/crud/CrudFormPage.d.ts +18 -0
  244. package/dist/crud/CrudFormPage.d.ts.map +1 -0
  245. package/dist/crud/CrudListView.d.ts +92 -0
  246. package/dist/crud/CrudListView.d.ts.map +1 -0
  247. package/dist/crud/CrudPage.d.ts +27 -0
  248. package/dist/crud/CrudPage.d.ts.map +1 -0
  249. package/dist/crud/CrudSkeletons.d.ts +21 -0
  250. package/dist/crud/CrudSkeletons.d.ts.map +1 -0
  251. package/dist/crud/DeleteConfirmDialog.d.ts +11 -0
  252. package/dist/crud/DeleteConfirmDialog.d.ts.map +1 -0
  253. package/dist/crud/EntityOverview.d.ts +14 -0
  254. package/dist/crud/EntityOverview.d.ts.map +1 -0
  255. package/dist/crud/ImportWizard.d.ts +18 -0
  256. package/dist/crud/ImportWizard.d.ts.map +1 -0
  257. package/dist/crud/archetype-lookup.d.ts +30 -0
  258. package/dist/crud/archetype-lookup.d.ts.map +1 -0
  259. package/dist/crud/archetypes/ActiveToggle.d.ts +8 -0
  260. package/dist/crud/archetypes/ActiveToggle.d.ts.map +1 -0
  261. package/dist/crud/archetypes/AddressesTab.d.ts +21 -0
  262. package/dist/crud/archetypes/AddressesTab.d.ts.map +1 -0
  263. package/dist/crud/archetypes/ArchetypeStatusBar.d.ts +11 -0
  264. package/dist/crud/archetypes/ArchetypeStatusBar.d.ts.map +1 -0
  265. package/dist/crud/archetypes/BlockSettingsPopover.d.ts +15 -0
  266. package/dist/crud/archetypes/BlockSettingsPopover.d.ts.map +1 -0
  267. package/dist/crud/archetypes/ClientOrdersTab.d.ts +18 -0
  268. package/dist/crud/archetypes/ClientOrdersTab.d.ts.map +1 -0
  269. package/dist/crud/archetypes/EntityLink.d.ts +32 -0
  270. package/dist/crud/archetypes/EntityLink.d.ts.map +1 -0
  271. package/dist/crud/archetypes/LocationDetailTabs.d.ts +11 -0
  272. package/dist/crud/archetypes/LocationDetailTabs.d.ts.map +1 -0
  273. package/dist/crud/archetypes/LocationFormLayout.d.ts +12 -0
  274. package/dist/crud/archetypes/LocationFormLayout.d.ts.map +1 -0
  275. package/dist/crud/archetypes/OrderDetailView.d.ts +115 -0
  276. package/dist/crud/archetypes/OrderDetailView.d.ts.map +1 -0
  277. package/dist/crud/archetypes/OrderFormView.d.ts +112 -0
  278. package/dist/crud/archetypes/OrderFormView.d.ts.map +1 -0
  279. package/dist/crud/archetypes/OrderListView.d.ts +36 -0
  280. package/dist/crud/archetypes/OrderListView.d.ts.map +1 -0
  281. package/dist/crud/archetypes/PersonDetailTabs.d.ts +35 -0
  282. package/dist/crud/archetypes/PersonDetailTabs.d.ts.map +1 -0
  283. package/dist/crud/archetypes/PersonFormLayout.d.ts +13 -0
  284. package/dist/crud/archetypes/PersonFormLayout.d.ts.map +1 -0
  285. package/dist/crud/archetypes/PersonPicker.d.ts +23 -0
  286. package/dist/crud/archetypes/PersonPicker.d.ts.map +1 -0
  287. package/dist/crud/archetypes/ProductDetailTabs.d.ts +11 -0
  288. package/dist/crud/archetypes/ProductDetailTabs.d.ts.map +1 -0
  289. package/dist/crud/archetypes/ProductFormLayout.d.ts +12 -0
  290. package/dist/crud/archetypes/ProductFormLayout.d.ts.map +1 -0
  291. package/dist/crud/archetypes/ScheduleEditor.d.ts +7 -0
  292. package/dist/crud/archetypes/ScheduleEditor.d.ts.map +1 -0
  293. package/dist/crud/archetypes/ServiceDetailTabs.d.ts +10 -0
  294. package/dist/crud/archetypes/ServiceDetailTabs.d.ts.map +1 -0
  295. package/dist/crud/archetypes/ServiceFormLayout.d.ts +12 -0
  296. package/dist/crud/archetypes/ServiceFormLayout.d.ts.map +1 -0
  297. package/dist/crud/archetypes/SubjectDetailTabs.d.ts +12 -0
  298. package/dist/crud/archetypes/SubjectDetailTabs.d.ts.map +1 -0
  299. package/dist/crud/archetypes/SubjectFormLayout.d.ts +14 -0
  300. package/dist/crud/archetypes/SubjectFormLayout.d.ts.map +1 -0
  301. package/dist/crud/createCrudPage.d.ts +34 -0
  302. package/dist/crud/createCrudPage.d.ts.map +1 -0
  303. package/dist/crud/csv-export.d.ts +3 -0
  304. package/dist/crud/csv-export.d.ts.map +1 -0
  305. package/dist/crud/fieldToColumn.d.ts +14 -0
  306. package/dist/crud/fieldToColumn.d.ts.map +1 -0
  307. package/dist/crud/index.d.ts +16 -0
  308. package/dist/crud/index.d.ts.map +1 -0
  309. package/dist/crud/placeholder.d.ts +7 -0
  310. package/dist/crud/placeholder.d.ts.map +1 -0
  311. package/dist/crud/relation-field.d.ts +28 -0
  312. package/dist/crud/relation-field.d.ts.map +1 -0
  313. package/dist/data/client.d.ts +14 -0
  314. package/dist/data/client.d.ts.map +1 -0
  315. package/dist/db.cjs +14 -0
  316. package/dist/db.cjs.map +1 -0
  317. package/dist/db.d.ts +2 -0
  318. package/dist/db.d.ts.map +1 -0
  319. package/dist/db.js +3 -0
  320. package/dist/db.js.map +1 -0
  321. package/dist/hooks/index.d.ts +20 -0
  322. package/dist/hooks/index.d.ts.map +1 -0
  323. package/dist/hooks/useAITools.d.ts +23 -0
  324. package/dist/hooks/useAITools.d.ts.map +1 -0
  325. package/dist/hooks/useAgentSurface.d.ts +15 -0
  326. package/dist/hooks/useAgentSurface.d.ts.map +1 -0
  327. package/dist/hooks/useAuth.d.ts +16 -0
  328. package/dist/hooks/useAuth.d.ts.map +1 -0
  329. package/dist/hooks/useChat.d.ts +38 -0
  330. package/dist/hooks/useChat.d.ts.map +1 -0
  331. package/dist/hooks/useDictation.d.ts +31 -0
  332. package/dist/hooks/useDictation.d.ts.map +1 -0
  333. package/dist/hooks/useFieldRules.d.ts +6 -0
  334. package/dist/hooks/useFieldRules.d.ts.map +1 -0
  335. package/dist/hooks/useFormatters.d.ts +7 -0
  336. package/dist/hooks/useFormatters.d.ts.map +1 -0
  337. package/dist/hooks/useGlobalSearch.d.ts +10 -0
  338. package/dist/hooks/useGlobalSearch.d.ts.map +1 -0
  339. package/dist/hooks/useLayout.d.ts +16 -0
  340. package/dist/hooks/useLayout.d.ts.map +1 -0
  341. package/dist/hooks/useMicLevels.d.ts +10 -0
  342. package/dist/hooks/useMicLevels.d.ts.map +1 -0
  343. package/dist/hooks/useModuleNavigation.d.ts +27 -0
  344. package/dist/hooks/useModuleNavigation.d.ts.map +1 -0
  345. package/dist/hooks/useNotifications.d.ts +11 -0
  346. package/dist/hooks/useNotifications.d.ts.map +1 -0
  347. package/dist/hooks/usePluginPrefs.d.ts +23 -0
  348. package/dist/hooks/usePluginPrefs.d.ts.map +1 -0
  349. package/dist/hooks/usePlugins.d.ts +5 -0
  350. package/dist/hooks/usePlugins.d.ts.map +1 -0
  351. package/dist/hooks/useSystemPermission.d.ts +3 -0
  352. package/dist/hooks/useSystemPermission.d.ts.map +1 -0
  353. package/dist/hooks/useTenant.d.ts +23 -0
  354. package/dist/hooks/useTenant.d.ts.map +1 -0
  355. package/dist/hooks/useTenantPluginSettings.d.ts +12 -0
  356. package/dist/hooks/useTenantPluginSettings.d.ts.map +1 -0
  357. package/dist/hooks/useTenantPlugins.d.ts +10 -0
  358. package/dist/hooks/useTenantPlugins.d.ts.map +1 -0
  359. package/dist/hooks/useTranslation.d.ts +5 -0
  360. package/dist/hooks/useTranslation.d.ts.map +1 -0
  361. package/dist/index.d.ts +93 -0
  362. package/dist/index.d.ts.map +1 -0
  363. package/dist/index.js +17207 -0
  364. package/dist/index.js.map +1 -0
  365. package/dist/lib/agent-approvals.d.ts +27 -0
  366. package/dist/lib/agent-approvals.d.ts.map +1 -0
  367. package/dist/lib/agent-surface.d.ts +78 -0
  368. package/dist/lib/agent-surface.d.ts.map +1 -0
  369. package/dist/lib/ai-tool-handlers.d.ts +154 -0
  370. package/dist/lib/ai-tool-handlers.d.ts.map +1 -0
  371. package/dist/lib/apply-field-rules.d.ts +4 -0
  372. package/dist/lib/apply-field-rules.d.ts.map +1 -0
  373. package/dist/lib/assistant-delegation.d.ts +5 -0
  374. package/dist/lib/assistant-delegation.d.ts.map +1 -0
  375. package/dist/lib/assistant-feature.d.ts +8 -0
  376. package/dist/lib/assistant-feature.d.ts.map +1 -0
  377. package/dist/lib/attachments.d.ts +95 -0
  378. package/dist/lib/attachments.d.ts.map +1 -0
  379. package/dist/lib/auth-context.d.ts +5 -0
  380. package/dist/lib/auth-context.d.ts.map +1 -0
  381. package/dist/lib/cache.d.ts +18 -0
  382. package/dist/lib/cache.d.ts.map +1 -0
  383. package/dist/lib/cn.d.ts +2 -0
  384. package/dist/lib/cn.d.ts.map +1 -0
  385. package/dist/lib/core-ai-tools.d.ts +49 -0
  386. package/dist/lib/core-ai-tools.d.ts.map +1 -0
  387. package/dist/lib/create-client-orders-provider.d.ts +3 -0
  388. package/dist/lib/create-client-orders-provider.d.ts.map +1 -0
  389. package/dist/lib/csv.d.ts +14 -0
  390. package/dist/lib/csv.d.ts.map +1 -0
  391. package/dist/lib/currency.d.ts +7 -0
  392. package/dist/lib/currency.d.ts.map +1 -0
  393. package/dist/lib/dedup.d.ts +2 -0
  394. package/dist/lib/dedup.d.ts.map +1 -0
  395. package/dist/lib/entity-registry.d.ts +19 -0
  396. package/dist/lib/entity-registry.d.ts.map +1 -0
  397. package/dist/lib/entity-routes.d.ts +48 -0
  398. package/dist/lib/entity-routes.d.ts.map +1 -0
  399. package/dist/lib/fayz-agent.d.ts +23 -0
  400. package/dist/lib/fayz-agent.d.ts.map +1 -0
  401. package/dist/lib/format.d.ts +7 -0
  402. package/dist/lib/format.d.ts.map +1 -0
  403. package/dist/lib/locale-config.d.ts +8 -0
  404. package/dist/lib/locale-config.d.ts.map +1 -0
  405. package/dist/lib/notes-tasks-bridge.d.ts +28 -0
  406. package/dist/lib/notes-tasks-bridge.d.ts.map +1 -0
  407. package/dist/lib/org-context.d.ts +5 -0
  408. package/dist/lib/org-context.d.ts.map +1 -0
  409. package/dist/lib/plugins.d.ts +2 -0
  410. package/dist/lib/plugins.d.ts.map +1 -0
  411. package/dist/lib/record-refs.d.ts +31 -0
  412. package/dist/lib/record-refs.d.ts.map +1 -0
  413. package/dist/lib/router.d.ts +15 -0
  414. package/dist/lib/router.d.ts.map +1 -0
  415. package/dist/lib/schedule-config.d.ts +32 -0
  416. package/dist/lib/schedule-config.d.ts.map +1 -0
  417. package/dist/lib/schedule-service.d.ts +76 -0
  418. package/dist/lib/schedule-service.d.ts.map +1 -0
  419. package/dist/lib/search-targets.d.ts +12 -0
  420. package/dist/lib/search-targets.d.ts.map +1 -0
  421. package/dist/lib/speech.d.ts +36 -0
  422. package/dist/lib/speech.d.ts.map +1 -0
  423. package/dist/lib/supabase.d.ts +10 -0
  424. package/dist/lib/supabase.d.ts.map +1 -0
  425. package/dist/org/adapters/mock.d.ts +4 -0
  426. package/dist/org/adapters/mock.d.ts.map +1 -0
  427. package/dist/org/adapters/supabase.d.ts +33 -0
  428. package/dist/org/adapters/supabase.d.ts.map +1 -0
  429. package/dist/org/cache.d.ts +29 -0
  430. package/dist/org/cache.d.ts.map +1 -0
  431. package/dist/org/context.d.ts +36 -0
  432. package/dist/org/context.d.ts.map +1 -0
  433. package/dist/org/index.d.ts +10 -0
  434. package/dist/org/index.d.ts.map +1 -0
  435. package/dist/org/index.js +5 -0
  436. package/dist/org/index.js.map +1 -0
  437. package/dist/org/store.d.ts +20 -0
  438. package/dist/org/store.d.ts.map +1 -0
  439. package/dist/org/team-rows.d.ts +45 -0
  440. package/dist/org/team-rows.d.ts.map +1 -0
  441. package/dist/permissions/PermissionGate.d.ts +12 -0
  442. package/dist/permissions/PermissionGate.d.ts.map +1 -0
  443. package/dist/permissions/context.d.ts +39 -0
  444. package/dist/permissions/context.d.ts.map +1 -0
  445. package/dist/permissions/index.d.ts +5 -0
  446. package/dist/permissions/index.d.ts.map +1 -0
  447. package/dist/permissions/index.js +3 -0
  448. package/dist/permissions/index.js.map +1 -0
  449. package/dist/permissions/roles.d.ts +7 -0
  450. package/dist/permissions/roles.d.ts.map +1 -0
  451. package/dist/permissions/store.d.ts +21 -0
  452. package/dist/permissions/store.d.ts.map +1 -0
  453. package/dist/plugins/ModuleActionBar.d.ts +27 -0
  454. package/dist/plugins/ModuleActionBar.d.ts.map +1 -0
  455. package/dist/plugins/PluginRegistryManager.d.ts +13 -0
  456. package/dist/plugins/PluginRegistryManager.d.ts.map +1 -0
  457. package/dist/plugins/QuickActionsButton.d.ts +12 -0
  458. package/dist/plugins/QuickActionsButton.d.ts.map +1 -0
  459. package/dist/plugins/SettingsGroup.d.ts +25 -0
  460. package/dist/plugins/SettingsGroup.d.ts.map +1 -0
  461. package/dist/plugins/WidgetSlot.d.ts +8 -0
  462. package/dist/plugins/WidgetSlot.d.ts.map +1 -0
  463. package/dist/plugins/createPluginContext.d.ts +28 -0
  464. package/dist/plugins/createPluginContext.d.ts.map +1 -0
  465. package/dist/plugins/createViewRouter.d.ts +38 -0
  466. package/dist/plugins/createViewRouter.d.ts.map +1 -0
  467. package/dist/projects/ProjectsSettings.d.ts +3 -0
  468. package/dist/projects/ProjectsSettings.d.ts.map +1 -0
  469. package/dist/projects/SeuSiteWidget.d.ts +7 -0
  470. package/dist/projects/SeuSiteWidget.d.ts.map +1 -0
  471. package/dist/projects/provider.d.ts +8 -0
  472. package/dist/projects/provider.d.ts.map +1 -0
  473. package/dist/projects/store.d.ts +16 -0
  474. package/dist/projects/store.d.ts.map +1 -0
  475. package/dist/projects/types.d.ts +46 -0
  476. package/dist/projects/types.d.ts.map +1 -0
  477. package/dist/stores/auth.store.d.ts +12 -0
  478. package/dist/stores/auth.store.d.ts.map +1 -0
  479. package/dist/stores/billing.store.d.ts +2 -0
  480. package/dist/stores/billing.store.d.ts.map +1 -0
  481. package/dist/stores/chat.store.d.ts +208 -0
  482. package/dist/stores/chat.store.d.ts.map +1 -0
  483. package/dist/stores/createCrudStore.d.ts +54 -0
  484. package/dist/stores/createCrudStore.d.ts.map +1 -0
  485. package/dist/stores/index.d.ts +13 -0
  486. package/dist/stores/index.d.ts.map +1 -0
  487. package/dist/stores/invite.store.d.ts +11 -0
  488. package/dist/stores/invite.store.d.ts.map +1 -0
  489. package/dist/stores/layout.store.d.ts +2 -0
  490. package/dist/stores/layout.store.d.ts.map +1 -0
  491. package/dist/stores/locale.store.d.ts +17 -0
  492. package/dist/stores/locale.store.d.ts.map +1 -0
  493. package/dist/stores/location.store.d.ts +20 -0
  494. package/dist/stores/location.store.d.ts.map +1 -0
  495. package/dist/stores/notifications.store.d.ts +12 -0
  496. package/dist/stores/notifications.store.d.ts.map +1 -0
  497. package/dist/stores/organization.store.d.ts +2 -0
  498. package/dist/stores/organization.store.d.ts.map +1 -0
  499. package/dist/stores/permissions.store.d.ts +2 -0
  500. package/dist/stores/permissions.store.d.ts.map +1 -0
  501. package/dist/stores/plugin.store.d.ts +24 -0
  502. package/dist/stores/plugin.store.d.ts.map +1 -0
  503. package/dist/stores/tenant.store.d.ts +11 -0
  504. package/dist/stores/tenant.store.d.ts.map +1 -0
  505. package/dist/stores/theme.store.d.ts +17 -0
  506. package/dist/stores/theme.store.d.ts.map +1 -0
  507. package/dist/theme/dark.d.ts +3 -0
  508. package/dist/theme/dark.d.ts.map +1 -0
  509. package/dist/theme/index.d.ts +8 -0
  510. package/dist/theme/index.d.ts.map +1 -0
  511. package/dist/theme/light.d.ts +3 -0
  512. package/dist/theme/light.d.ts.map +1 -0
  513. package/dist/theme/tailwind-preset.d.ts +4 -0
  514. package/dist/theme/tailwind-preset.d.ts.map +1 -0
  515. package/dist/theme/tokens.d.ts +119 -0
  516. package/dist/theme/tokens.d.ts.map +1 -0
  517. package/dist/theme/utils.d.ts +31 -0
  518. package/dist/theme/utils.d.ts.map +1 -0
  519. package/dist/types/auth-adapter.d.ts +14 -0
  520. package/dist/types/auth-adapter.d.ts.map +1 -0
  521. package/dist/types/auth.d.ts +34 -0
  522. package/dist/types/auth.d.ts.map +1 -0
  523. package/dist/types/billing.d.ts +81 -0
  524. package/dist/types/billing.d.ts.map +1 -0
  525. package/dist/types/client-orders.d.ts +47 -0
  526. package/dist/types/client-orders.d.ts.map +1 -0
  527. package/dist/types/crud.d.ts +137 -0
  528. package/dist/types/crud.d.ts.map +1 -0
  529. package/dist/types/entities.d.ts +150 -0
  530. package/dist/types/entities.d.ts.map +1 -0
  531. package/dist/types/entity-lookup.d.ts +18 -0
  532. package/dist/types/entity-lookup.d.ts.map +1 -0
  533. package/dist/types/index.d.ts +17 -0
  534. package/dist/types/index.d.ts.map +1 -0
  535. package/dist/types/integrations.d.ts +48 -0
  536. package/dist/types/integrations.d.ts.map +1 -0
  537. package/dist/types/invite.d.ts +23 -0
  538. package/dist/types/invite.d.ts.map +1 -0
  539. package/dist/types/layout.d.ts +26 -0
  540. package/dist/types/layout.d.ts.map +1 -0
  541. package/dist/types/notifications.d.ts +31 -0
  542. package/dist/types/notifications.d.ts.map +1 -0
  543. package/dist/types/org-adapter.d.ts +92 -0
  544. package/dist/types/org-adapter.d.ts.map +1 -0
  545. package/dist/types/permissions.d.ts +39 -0
  546. package/dist/types/permissions.d.ts.map +1 -0
  547. package/dist/types/platform.d.ts +25 -0
  548. package/dist/types/platform.d.ts.map +1 -0
  549. package/dist/types/plugins.d.ts +269 -0
  550. package/dist/types/plugins.d.ts.map +1 -0
  551. package/dist/types/tenant.d.ts +74 -0
  552. package/dist/types/tenant.d.ts.map +1 -0
  553. package/dist/ui.d.ts +2 -0
  554. package/dist/ui.d.ts.map +1 -0
  555. package/dist/ui.js +3 -0
  556. package/dist/ui.js.map +1 -0
  557. package/package.json +94 -0
@@ -0,0 +1,27 @@
1
+ export interface AutoApprovalRule {
2
+ /** `toolName` or `toolName:scope` — what the decision is remembered against. */
3
+ key: string;
4
+ toolName: string;
5
+ /** Entity the rule is limited to, so "always create clients" never becomes
6
+ * "always create anything". */
7
+ scope?: string;
8
+ /** Human label for the revoke list ("Criar Cliente"). */
9
+ label: string;
10
+ createdAt: string;
11
+ }
12
+ export declare function isDestructiveTool(toolName: string): boolean;
13
+ export declare function approvalKey(toolName: string, scope?: string): string;
14
+ /** Re-render the revoke list when a grant is added or removed. */
15
+ export declare function subscribeAutoApprovals(listener: () => void): () => void;
16
+ export declare function listAutoApprovals(): AutoApprovalRule[];
17
+ export declare function isAutoApproved(toolName: string, scope?: string): boolean;
18
+ export declare function grantAutoApproval(input: {
19
+ toolName: string;
20
+ scope?: string;
21
+ label: string;
22
+ /** Force session-only. Destructive tools are session-only regardless. */
23
+ session?: boolean;
24
+ }): void;
25
+ export declare function revokeAutoApproval(key: string): void;
26
+ export declare function revokeAllAutoApprovals(): void;
27
+ //# sourceMappingURL=agent-approvals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-approvals.d.ts","sourceRoot":"","sources":["../../src/lib/agent-approvals.ts"],"names":[],"mappings":"AAsBA,MAAM,WAAW,gBAAgB;IAC/B,gFAAgF;IAChF,GAAG,EAAE,MAAM,CAAA;IACX,QAAQ,EAAE,MAAM,CAAA;IAChB;oCACgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;CAClB;AAKD,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAE3D;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAEpE;AA0CD,kEAAkE;AAClE,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAGvE;AAED,wBAAgB,iBAAiB,IAAI,gBAAgB,EAAE,CAEtD;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAKxE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IACvC,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,yEAAyE;IACzE,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,GAAG,IAAI,CAiBP;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAIpD;AAED,wBAAgB,sBAAsB,IAAI,IAAI,CAI7C"}
@@ -0,0 +1,78 @@
1
+ import type { PluginAITool } from '../types/plugins';
2
+ /**
3
+ * Agent Surface Contract — how the screen the user is looking at RIGHT NOW
4
+ * contributes to the assistant.
5
+ *
6
+ * The FAB's base capabilities (data primitives, navigation) are global. But a
7
+ * live, interactive surface — the form builder, a calendar, a reconciliation
8
+ * ledger — has TWO things the global catalog can't express:
9
+ *
10
+ * 1. State that only exists on screen (an unsaved form draft), which the model
11
+ * must SEE to help with, and
12
+ * 2. Tools that act on that live state (add a field to the draft the user is
13
+ * watching), which only make sense while the surface is mounted.
14
+ *
15
+ * A surface publishes both by calling `useAgentSurface(...)` on mount and
16
+ * withdrawing them on unmount. This module is the registry the shell reads:
17
+ * `useAITools` merges the tools, `useChat` folds the snapshot + instructions
18
+ * into the request, and the executors ride the normal client-plane handler map.
19
+ *
20
+ * This is the scalable seam: forms is the first consumer; agenda, financial and
21
+ * marketing adopt the same contract without touching the shell again.
22
+ */
23
+ export interface AgentSurfaceSnapshot {
24
+ /** One line naming what's on screen, e.g. 'Form builder — "Anamnese"'. */
25
+ title?: string;
26
+ /** Structured state the model should reason over (the form draft, filters…). */
27
+ state?: Record<string, unknown>;
28
+ /** The record this surface is centered on, when it is a detail page. */
29
+ record?: {
30
+ entity: string;
31
+ id: string;
32
+ label?: string;
33
+ summary?: Record<string, unknown>;
34
+ };
35
+ }
36
+ export interface AgentSurfaceTool {
37
+ /** Declared tool shape (name, description, params) — same as a plugin aiTool. */
38
+ tool: PluginAITool;
39
+ /** Client-plane executor that mutates the live surface. Read fresh each call. */
40
+ execute: (args: Record<string, unknown>) => unknown | Promise<unknown>;
41
+ }
42
+ export interface AgentSurfaceContribution {
43
+ /** Stable id for this surface instance, e.g. 'custom_forms.builder'. */
44
+ id: string;
45
+ /** Plugin that owns the surface, used for tool ranking. */
46
+ pluginId?: string;
47
+ /** Snapshot of what's on screen. Called fresh at send time — never cached. */
48
+ describe?: () => AgentSurfaceSnapshot;
49
+ /** Guidance appended to the request ONLY while this surface is mounted. */
50
+ instructions?: string;
51
+ /** Tools available only while this surface is mounted. */
52
+ tools?: AgentSurfaceTool[];
53
+ }
54
+ /** Registry entry keeps a getter, not the value, so closures stay fresh across
55
+ * re-renders without re-registering on every render. */
56
+ interface SurfaceEntry {
57
+ id: string;
58
+ get: () => AgentSurfaceContribution;
59
+ }
60
+ /** Add or replace a surface (by id). Called on mount. */
61
+ export declare function registerSurface(entry: SurfaceEntry): void;
62
+ /** Remove a surface. Called on unmount. */
63
+ export declare function unregisterSurface(id: string): void;
64
+ /** useSyncExternalStore subscription — fires only on mount/unmount, not on the
65
+ * per-render state changes inside a surface. */
66
+ export declare function subscribeSurfaces(cb: () => void): () => void;
67
+ /** Version counter for useSyncExternalStore; bumps when the set of surfaces
68
+ * changes so `useAITools` recomputes its catalog. */
69
+ export declare function getSurfaceVersion(): number;
70
+ /** Flat list of tool declarations across every mounted surface (for the catalog). */
71
+ export declare function getSurfaceTools(): PluginAITool[];
72
+ /** Snapshot + instructions from every mounted surface, read at send time. */
73
+ export declare function getActiveSurfaceContext(): {
74
+ snapshot: AgentSurfaceSnapshot[];
75
+ instructions: string[];
76
+ };
77
+ export {};
78
+ //# sourceMappingURL=agent-surface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-surface.d.ts","sourceRoot":"","sources":["../../src/lib/agent-surface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CA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AC,EAAE,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAG5D;AAED;sDACsD;AACtD,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,qFAAqF;AACrF,wBAAgB,eAAe,IAAI,YAAY,EAAE,CAEhD;AAED,6EAA6E;AAC7E,wBAAgB,uBAAuB,IAAI;IACzC,QAAQ,EAAE,oBAAoB,EAAE,CAAA;IAChC,YAAY,EAAE,MAAM,EAAE,CAAA;CACvB,CAeA"}
@@ -0,0 +1,154 @@
1
+ import type { EntityDef, OrgMember, Organization, PermissionProfile, TeamPerson } from '@fayz-ai/core';
2
+ import type { PluginAITool, PluginRegistryDef } from '../types/plugins';
3
+ /**
4
+ * Client-plane execution for the AI tool catalog.
5
+ *
6
+ * `useAITools()` declares *what* the surface can do — it is the catalog the
7
+ * model reasons over. This module is *how*: the browser runs the call against
8
+ * the session that is already open (org store, data providers, router) and
9
+ * hands a serialized result back to the agent.
10
+ *
11
+ * The split matters because Fayz never holds the surface's data credentials.
12
+ * The agent broker forwards the catalog, decides which tool to call, and
13
+ * returns the call for the surface to execute — the same contract a
14
+ * server-side channel (WhatsApp, email) satisfies with a server-side executor.
15
+ *
16
+ * **A capability is only advertised if it can run.** A declared tool with no
17
+ * executor is a promise to the model the surface cannot keep: it burns
18
+ * reasoning rounds retrying, then apologises. `buildAgentToolset` is the gate —
19
+ * everything it returns has a resolvable executor.
20
+ */
21
+ /** An entity the executor can read through its own data provider. */
22
+ export interface DataToolTarget {
23
+ label: string;
24
+ entity: EntityDef;
25
+ mockData?: Array<{
26
+ id: string;
27
+ }>;
28
+ /** Read-model (view/ledger): searchable/queryable but never writable. */
29
+ readOnly?: boolean;
30
+ }
31
+ export interface AIToolExecutionContext {
32
+ currentOrg: Organization | null;
33
+ members: OrgMember[];
34
+ /**
35
+ * Person-first team resolver — the same source the Team screen renders
36
+ * (people of the configured `team.personKinds`, each with an OPTIONAL access
37
+ * overlay). Absent when the app runs in legacy membership-only mode, in
38
+ * which case `members` is the whole team.
39
+ */
40
+ loadTeam?: () => Promise<TeamPerson[]>;
41
+ currentPath: string;
42
+ /** Pages the surface exposes, used to resolve navigation requests. */
43
+ routes: Array<{
44
+ path: string;
45
+ label?: string;
46
+ }>;
47
+ navigate: (path: string) => void;
48
+ /**
49
+ * Data-backed tools, keyed by the LLM-facing tool name. These execute
50
+ * generically through the entity's own data provider, so every registry and
51
+ * every CRUD entity the app declares is readable without a hand-written
52
+ * handler — which is what lets a new vertical work on day one.
53
+ */
54
+ dataTools: Map<string, DataToolTarget>;
55
+ /**
56
+ * The WRITE tools the agent can actually run this turn — what a refusal is
57
+ * allowed to point at, with the action each performs. Read tools and
58
+ * declared-but-unexecutable ones are excluded on purpose ("use listLeads" for
59
+ * an update is worse advice than none), and the action matters just as much:
60
+ * pointed at `updateLead` for a CREATE, the model called it with
61
+ * `lead_id: "N/A"`.
62
+ */
63
+ writeTools?: Array<{
64
+ name: string;
65
+ action?: string;
66
+ }>;
67
+ /**
68
+ * Org-management writes the agent can perform — today only access profiles.
69
+ * Narrowed to what is actually called: handing the executor the whole adapter
70
+ * would let a future tool remove members from a chat turn.
71
+ */
72
+ orgAdapter?: {
73
+ createProfile: (orgId: string, profile: Omit<PermissionProfile, 'id' | 'isSystem'>) => Promise<PermissionProfile>;
74
+ updateProfile?: (orgId: string, profileId: string, data: Partial<PermissionProfile>) => Promise<PermissionProfile>;
75
+ listProfiles?: (orgId: string) => Promise<PermissionProfile[]>;
76
+ } | null;
77
+ }
78
+ export type AIToolHandler = (args: Record<string, unknown>, context: AIToolExecutionContext) => unknown | Promise<unknown>;
79
+ /**
80
+ * Register an executor for a tool, keyed by the tool's `name` (the identifier
81
+ * the model calls, e.g. `getTeamMembers`). Plugins and apps call this to make
82
+ * their declared `aiTools` actually runnable.
83
+ */
84
+ export declare function registerAIToolHandler(name: string, handler: AIToolHandler): void;
85
+ export declare function registerAIToolHandlers(map: Record<string, AIToolHandler>): void;
86
+ /**
87
+ * Remove an executor. Surface-scoped tools (a form builder's field ops) live
88
+ * only while their screen is mounted; unregistering on unmount stops the model
89
+ * from calling a tool whose live target no longer exists.
90
+ */
91
+ export declare function unregisterAIToolHandler(name: string): void;
92
+ export declare function hasAIToolHandler(name: string): boolean;
93
+ export interface AIToolExecutionResult {
94
+ ok: boolean;
95
+ /** JSON-serialized payload handed back to the agent. */
96
+ content: string;
97
+ }
98
+ export declare function executeAITool(name: string, args: Record<string, unknown>, context: AIToolExecutionContext): Promise<AIToolExecutionResult>;
99
+ /**
100
+ * Index everything readable by the tool name its generator mints, so the
101
+ * executor can find the entity behind a call. Covers plugin registries and the
102
+ * app's own CRUD entities.
103
+ */
104
+ export declare function buildDataToolIndex(input: {
105
+ registries: Map<string, PluginRegistryDef[]>;
106
+ entities: Array<{
107
+ entityKey: string;
108
+ labelPlural: string;
109
+ entityDef?: EntityDef;
110
+ mockData?: Array<{
111
+ id: string;
112
+ }>;
113
+ }>;
114
+ registryToolName: (pluginId: string, registryId: string) => string;
115
+ entityToolName: (entityKey: string) => string;
116
+ queryEntities?: Array<{
117
+ key: string;
118
+ entity: EntityDef;
119
+ writable?: boolean;
120
+ }>;
121
+ }): Map<string, DataToolTarget>;
122
+ export interface AgentTool {
123
+ name: string;
124
+ description: string;
125
+ parameters?: Record<string, unknown>;
126
+ }
127
+ export interface BuildToolsetOptions {
128
+ dataTools: Map<string, DataToolTarget>;
129
+ /** Plugin owning the current route; its tools rank ahead of the rest. */
130
+ activePluginId?: string | null;
131
+ maxTools?: number;
132
+ }
133
+ /**
134
+ * Shape the declared catalog into the toolset sent to the agent.
135
+ *
136
+ * Two filters, both load-bearing:
137
+ *
138
+ * 1. *Executable only.* An advertised tool with no executor is worse than a
139
+ * missing one — the model spends rounds on it and then apologises.
140
+ * 2. *Contextual.* A mature app declares ~40 tools; sending all of them every
141
+ * turn costs input tokens on every request and degrades which tool the model
142
+ * picks. Tools owned by the plugin the user is currently looking at come
143
+ * first, then the rest, capped.
144
+ */
145
+ export declare function buildAgentToolset(tools: PluginAITool[], { dataTools, activePluginId, maxTools }: BuildToolsetOptions): AgentTool[];
146
+ /**
147
+ * Client-plane execution of an RPC-bound tool (`execution: {kind:'rpc'}`):
148
+ * calls the pool function as the signed-in user. The actor is the SESSION
149
+ * user — spine 016 makes the RPC reject any other p_actor for JWT callers, so
150
+ * this path cannot borrow someone else's role. Structured denials pass through
151
+ * to the model (conversational paywall); S4 moves this server-side untouched.
152
+ */
153
+ export declare function executeRpcTool(rpcName: string, args: Record<string, unknown>, userId: string | undefined): Promise<AIToolExecutionResult>;
154
+ //# sourceMappingURL=ai-tool-handlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-tool-handlers.d.ts","sourceRoot":"","sources":["../../src/lib/ai-tool-handlers.ts"],"names":[],"mappings":"AAgFA,OAAO,KAAK,EACV,SAAS,EACT,SAAS,EACT,YAAY,EAEZ,iBAAiB,EACjB,UAAU,EACX,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAEvE;;;;;;;;;;;;;;;;;GAiBG;AAEH,qEAAqE;AACrE,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,SAAS,CAAA;IACjB,QAAQ,CAAC,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAChC,yEAAyE;IACzE,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,YAAY,GAAG,IAAI,CAAA;IAC/B,OAAO,EAAE,SAAS,EAAE,CAAA;IACpB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,UAAU,EAAE,CAAC,CAAA;IACtC,WAAW,EAAE,MAAM,CAAA;IACnB,sEAAsE;IACtE,MAAM,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC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BAAmB;IAClC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;IACtC,yEAAyE;IACzE,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,YAAY,EAAE,EACrB,EAAE,SAAS,EAAE,cAAc,EAAE,QAA6B,EAAE,EAAE,mBAAmB,GAChF,SAAS,EAAE,CAoBb;AA4aD;;;;;;GAMG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,MAAM,EAAE,MAAM,GAAG,SAAS,GACzB,OAAO,CAAC,qBAAqB,CAAC,CAehC"}
@@ -0,0 +1,4 @@
1
+ import type { FieldDef, EntityFieldRules } from '../types/crud';
2
+ /** Merge tenant field-rule overrides into static FieldDef[]. Pure & testable. */
3
+ export declare function applyFieldRules(fields: FieldDef[], rules: EntityFieldRules | undefined): FieldDef[];
4
+ //# sourceMappingURL=apply-field-rules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply-field-rules.d.ts","sourceRoot":"","sources":["../../src/lib/apply-field-rules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAE/D,iFAAiF;AACjF,wBAAgB,eAAe,CAC7B,MAAM,EAAE,QAAQ,EAAE,EAClB,KAAK,EAAE,gBAAgB,GAAG,SAAS,GAClC,QAAQ,EAAE,CAOZ"}
@@ -0,0 +1,5 @@
1
+ /** The agentic hand-off: queue a prompt that auto-sends (the click IS the send
2
+ * intent) and flip the rail to the Chat tab. Shared by the Notes tab and any
3
+ * plugin surface (e.g. a task's "Conversar com IA"). */
4
+ export declare function useDelegateToAssistant(): (prompt: string) => void;
5
+ //# sourceMappingURL=assistant-delegation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assistant-delegation.d.ts","sourceRoot":"","sources":["../../src/lib/assistant-delegation.ts"],"names":[],"mappings":"AAIA;;yDAEyD;AACzD,wBAAgB,sBAAsB,IAAI,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAUjE"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Entitlement key for the AI assistant.
3
+ *
4
+ * A plan gates it with `entitlements.features.assistant = false`; absent means
5
+ * open, so apps that never declare it keep the assistant.
6
+ */
7
+ export declare const ASSISTANT_FEATURE = "assistant";
8
+ //# sourceMappingURL=assistant-feature.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assistant-feature.d.ts","sourceRoot":"","sources":["../../src/lib/assistant-feature.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,cAAc,CAAA"}
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Attachments for the assistant, parsed in the browser.
3
+ *
4
+ * The bytes NEVER leave this module. A spreadsheet of clients or patients is
5
+ * personal data (LGPD) — shipping it to a model provider to "have a look" is
6
+ * not a technical shortcut, it is a disclosure. So the file stays in the tab
7
+ * and only a DIGEST travels: the shape (sheets, headers, row count, inferred
8
+ * column types) plus a handful of sample rows. The model sees the FORM, never
9
+ * the data set.
10
+ *
11
+ * Everything here is therefore bounded on purpose: a 50k-row file and a 50-row
12
+ * file produce digests of roughly the same size.
13
+ */
14
+ export type AttachmentKind = 'spreadsheet' | 'csv' | 'text' | 'image' | 'pdf' | 'binary';
15
+ export type AttachmentColumnType = 'text' | 'number' | 'date' | 'boolean' | 'email' | 'phone';
16
+ export interface AttachmentColumn {
17
+ name: string;
18
+ type: AttachmentColumnType;
19
+ /** Detected literal shape ('dd/mm/yyyy', 'yyyy-mm-dd', '1.234,56'), when known. */
20
+ format?: string;
21
+ /** Why this column is not the type it looks like — ambiguity, mixed values. */
22
+ note?: string;
23
+ }
24
+ export interface AttachmentSheet {
25
+ name: string;
26
+ headers: string[];
27
+ /** Data rows, header excluded. Absent when only the head of the file was read. */
28
+ rowCount?: number;
29
+ sample: string[][];
30
+ columnTypes: AttachmentColumn[];
31
+ }
32
+ export interface AttachmentDigest {
33
+ id: string;
34
+ name: string;
35
+ mime: string;
36
+ size: number;
37
+ kind: AttachmentKind;
38
+ /** Spreadsheets with more than one tab. Single-tab files use the flat fields. */
39
+ sheets?: AttachmentSheet[];
40
+ headers?: string[];
41
+ rowCount?: number;
42
+ sample?: string[][];
43
+ columnTypes?: AttachmentColumn[];
44
+ /** Head of a text/markdown file. */
45
+ preview?: string;
46
+ /** Everything the reader had to guess at, truncate or give up on. */
47
+ warnings?: string[];
48
+ /** Set when the file could not be opened at all — the chip says what to do
49
+ * instead of pretending a shapeless digest is a reading. */
50
+ unreadable?: 'spreadsheet';
51
+ }
52
+ /** Park a file and get the handle everything else refers to it by. */
53
+ export declare function registerAttachment(file: File): string;
54
+ export declare function getAttachmentFile(id: string): File | undefined;
55
+ export declare function getAttachmentDigest(id: string): AttachmentDigest | undefined;
56
+ /** Drop the bytes. Called on chip removal and whenever the thread is cleared. */
57
+ export declare function releaseAttachment(id: string): void;
58
+ export declare function clearAttachmentRegistry(): void;
59
+ /**
60
+ * The file a tool call is about, resolved the way the MODEL can name it.
61
+ *
62
+ * The prompt shows attachments by filename, never by handle, so a tool that
63
+ * demanded the registry id would be asking for something the model was never
64
+ * told. Name match first, then the most recent readable file — a turn almost
65
+ * always has exactly one.
66
+ */
67
+ export declare function resolveAttachmentDigest(name?: string): AttachmentDigest | undefined;
68
+ /**
69
+ * Every row of an attached delimited file, as objects keyed by header.
70
+ *
71
+ * The digest carries five sample rows — enough to map, useless to import. This
72
+ * re-reads the bytes still parked in the registry, so the full set never had to
73
+ * travel anywhere: it goes browser -> database, and the model never sees a row.
74
+ */
75
+ export declare function readAllRows(digest: AttachmentDigest): Promise<Array<Record<string, string>>>;
76
+ /** Every readable file currently in play, for an error that can name them. */
77
+ export declare function listAttachmentNames(): string[];
78
+ export declare function detectKind(file: File): AttachmentKind;
79
+ /**
80
+ * Read a file into its digest. Registers the bytes when no id is supplied, so
81
+ * a caller that wants to show a "parsing" chip first can register up front and
82
+ * pass the id back in.
83
+ */
84
+ export declare function parseAttachment(file: File, id?: string): Promise<AttachmentDigest>;
85
+ /**
86
+ * Records are counted to the end of the text but only the first `SCAN_ROWS`
87
+ * are kept — the count is the fact worth reporting, the rows are not.
88
+ */
89
+ export declare function parseDelimited(text: string, delimiter: string): {
90
+ rows: string[][];
91
+ count: number;
92
+ };
93
+ export declare function inferColumn(name: string, values: string[], sheetName?: string, warnings?: string[]): AttachmentColumn;
94
+ export declare function formatBytes(bytes: number): string;
95
+ //# sourceMappingURL=attachments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachments.d.ts","sourceRoot":"","sources":["../../src/lib/attachments.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAA;AAExF,MAAM,MAAM,oBAAoB,GAC5B,MAAM,GACN,QAAQ,GACR,MAAM,GACN,SAAS,GACT,OAAO,GACP,OAAO,CAAA;AAEX,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,oBAAoB,CAAA;IAC1B,mFAAmF;IACnF,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,+EAA+E;IAC/E,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,kFAAkF;IAClF,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,EAAE,EAAE,CAAA;IAClB,WAAW,EAAE,gBAAgB,EAAE,CAAA;CAChC;AAED,MA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AK9C;AAUD,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,cAAc,CAWrD;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA8BxF;AAqID;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAuCnG;AAoCD,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EAAE,EAChB,SAAS,SAAK,EACd,QAAQ,GAAE,MAAM,EAAO,GACtB,gBAAgB,CA+ClB;AA4FD,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIjD"}
@@ -0,0 +1,5 @@
1
+ import type { AuthAdapter } from '../types/auth-adapter';
2
+ export declare const AuthAdapterProvider: import("react").Provider<AuthAdapter | null>;
3
+ export declare function useAuthAdapter(): AuthAdapter;
4
+ export declare function useAuthAdapterOptional(): AuthAdapter | null;
5
+ //# sourceMappingURL=auth-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-context.d.ts","sourceRoot":"","sources":["../../src/lib/auth-context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAIxD,eAAO,MAAM,mBAAmB,8CAA8B,CAAA;AAE9D,wBAAgB,cAAc,IAAI,WAAW,CAM5C;AAED,wBAAgB,sBAAsB,IAAI,WAAW,GAAG,IAAI,CAE3D"}
@@ -0,0 +1,18 @@
1
+ export interface CacheStore {
2
+ get<T>(key: string): T | undefined;
3
+ set<T>(key: string, data: T, ttl?: number): void;
4
+ /** Clear all entries whose key starts with `prefix` */
5
+ invalidate(prefix: string): void;
6
+ clear(): void;
7
+ size(): number;
8
+ }
9
+ export interface CacheConfig {
10
+ /** Default time-to-live in ms (default: 60 000 — 1 minute) */
11
+ defaultTTL?: number;
12
+ /** Maximum cached entries before LRU eviction (default: 500) */
13
+ maxEntries?: number;
14
+ }
15
+ export declare function stableKey(...parts: unknown[]): string;
16
+ export declare function createCacheStore(config?: CacheConfig): CacheStore;
17
+ export declare const globalCache: CacheStore;
18
+ //# sourceMappingURL=cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/lib/cache.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,UAAU;IACzB,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAAA;IAClC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAChD,uDAAuD;IACvD,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IAChC,KAAK,IAAI,IAAI,CAAA;IACb,IAAI,IAAI,MAAM,CAAA;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,8DAA8D;IAC9D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,gEAAgE;IAChE,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAgBD,wBAAgB,SAAS,CAAC,GAAG,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,CAErD;AAMD,wBAAgB,gBAAgB,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,UAAU,CAyDjE;AAMD,eAAO,MAAM,WAAW,YAAqB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { cn } from '@fayz-ai/ui';
2
+ //# sourceMappingURL=cn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../src/lib/cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA"}
@@ -0,0 +1,49 @@
1
+ import type { PluginAITool, PluginRegistryDef } from '../types/plugins';
2
+ import type { EntityDef, FeatureDeclaration, PermissionProfile } from '@fayz-ai/core';
3
+ import { type RegisteredEntity } from '@fayz-ai/core';
4
+ /**
5
+ * Core SaaS-level AI tools — always available, no plugin required.
6
+ */
7
+ export declare const coreAITools: PluginAITool[];
8
+ export declare function registryToolName(pluginId: string, registryId: string): string;
9
+ /**
10
+ * Auto-generates read tools from plugin registry definitions.
11
+ * Each registry gets a basic "list" tool so plugins get AI capabilities for free.
12
+ */
13
+ export declare function generateRegistryTools(pluginId: string, registries: PluginRegistryDef[]): PluginAITool[];
14
+ /**
15
+ * Formats a tool as a function signature: e.g. "getRevenue(period?)"
16
+ */
17
+ export declare function formatToolSignature(tool: PluginAITool): string;
18
+ export declare function entityToolName(entityKey: string): string;
19
+ export declare function buildDataPrimitiveTools(input: {
20
+ entities: RegisteredEntity[];
21
+ registries: Map<string, PluginRegistryDef[]>;
22
+ queryEntities?: Array<{
23
+ key: string;
24
+ entity: EntityDef;
25
+ writable?: boolean;
26
+ }>;
27
+ }): PluginAITool[];
28
+ /**
29
+ * The action vocabulary a profile can grant. Same four the permission matrix
30
+ * renders — a role built in chat and a role built on the screen must be the
31
+ * same kind of object, or the matrix would show a grant it cannot express.
32
+ */
33
+ export declare const PROFILE_ACTIONS: readonly ["read", "create", "edit", "delete"];
34
+ /**
35
+ * The access-profile tool, built from the features the app actually declares.
36
+ *
37
+ * Written as ONE tool that takes the whole grant map rather than a
38
+ * create-then-add-permission sequence: asked to describe access in prose,
39
+ * gpt-4o-mini writes a plausible-sounding paragraph and stops — the schema is
40
+ * what makes it commit to real feature ids, and what lets the executor reject
41
+ * the ones it invented.
42
+ *
43
+ * What it CANNOT do is deliberate: the four actions here never include
44
+ * `manage_roles`, the grant that confers `manage_permissions`. A profile minted
45
+ * from chat can therefore never hand out permissions itself.
46
+ */
47
+ export declare function buildPermissionTools(features: FeatureDeclaration[], profiles?: PermissionProfile[]): PluginAITool[];
48
+ export declare function generateEntityTools(entities?: RegisteredEntity[]): PluginAITool[];
49
+ //# sourceMappingURL=core-ai-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core-ai-tools.d.ts","sourceRoot":"","sources":["../../src/lib/core-ai-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACvE,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACrF,OAAO,EAAkB,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAGrE;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,YAAY,EAkErC,CAAA;AA0BD,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAK7E;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,EAAE,GAAG,YAAY,EAAE,CAoBvG;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAO9D;AAED,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAExD;AAmDD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE;IAC7C,QAAQ,EAAE,gBAAgB,EAAE,CAAA;IAC5B,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,CAAA;IAC5C,aAAa,CAAC,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,SAAS,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAA;CAC9E,GAAG,YAAY,EAAE,CA8MjB;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,+CAAgD,CAAA;AAK5E;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,kBAAkB,EAAE,EAC9B,QAAQ,GAAE,iBAAiB,EAAO,GACjC,YAAY,EAAE,CAoFhB;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,GAAE,gBAAgB,EAAqB,GAAG,YAAY,EAAE,CAoBnG"}
@@ -0,0 +1,3 @@
1
+ import type { ClientOrdersProvider } from '../types/client-orders';
2
+ export declare function createClientOrdersProvider(): ClientOrdersProvider;
3
+ //# sourceMappingURL=create-client-orders-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-client-orders-provider.d.ts","sourceRoot":"","sources":["../../src/lib/create-client-orders-provider.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,oBAAoB,EAA0D,MAAM,wBAAwB,CAAA;AAiD1H,wBAAgB,0BAA0B,IAAI,oBAAoB,CAqEjE"}
@@ -0,0 +1,14 @@
1
+ /** Column descriptor for generic CSV export */
2
+ export interface CSVColumn {
3
+ key: string;
4
+ label: string;
5
+ format?: (value: any, row: Record<string, any>) => string;
6
+ }
7
+ export declare function escapeCSVField(value: unknown): string;
8
+ /** Build a CSV string from columns + rows. Each cell runs through `column.format` if provided, then escaping. */
9
+ export declare function buildCSV(columns: CSVColumn[], rows: Record<string, any>[]): string;
10
+ /** Trigger a CSV file download in the browser. */
11
+ export declare function downloadCSV(csv: string, filename: string): void;
12
+ /** Convenience: build + download in one call. */
13
+ export declare function exportCSV(columns: CSVColumn[], rows: Record<string, any>[], filename: string): void;
14
+ //# sourceMappingURL=csv.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"csv.d.ts","sourceRoot":"","sources":["../../src/lib/csv.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,MAAM,CAAA;CAC1D;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAOrD;AAED,iHAAiH;AACjH,wBAAgB,QAAQ,CACtB,OAAO,EAAE,SAAS,EAAE,EACpB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAC1B,MAAM,CAYR;AAED,kDAAkD;AAClD,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAS/D;AAED,iDAAiD;AACjD,wBAAgB,SAAS,CACvB,OAAO,EAAE,SAAS,EAAE,EACpB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,EAC3B,QAAQ,EAAE,MAAM,GACf,IAAI,CAEN"}
@@ -0,0 +1,7 @@
1
+ export interface CurrencyConfig {
2
+ code: string;
3
+ locale: string;
4
+ symbol: string;
5
+ }
6
+ export declare function formatCurrency(value: number, currency?: CurrencyConfig): string;
7
+ //# sourceMappingURL=currency.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"currency.d.ts","sourceRoot":"","sources":["../../src/lib/currency.ts"],"names":[],"mappings":"AAcA,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,cAAc,GAAG,MAAM,CAO/E"}
@@ -0,0 +1,2 @@
1
+ export declare function dedup<T>(key: string, fn: () => Promise<T>): Promise<T>;
2
+ //# sourceMappingURL=dedup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dedup.d.ts","sourceRoot":"","sources":["../../src/lib/dedup.ts"],"names":[],"mappings":"AAMA,wBAAgB,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAUtE"}
@@ -0,0 +1,19 @@
1
+ import type { FieldDef, EntityDef } from '../types/crud';
2
+ import type { EntityArchetype } from '../types/entities';
3
+ export interface RegisteredEntity {
4
+ entityKey: string;
5
+ label: string;
6
+ labelPlural: string;
7
+ icon: string;
8
+ fields: FieldDef[];
9
+ source: 'page' | 'plugin';
10
+ archetype?: EntityArchetype;
11
+ pluginId?: string;
12
+ pluginName?: string;
13
+ pluginIcon?: string;
14
+ }
15
+ export declare function deriveEntityKey(entityDef: EntityDef): string;
16
+ export declare function registerEntity(entity: RegisteredEntity): void;
17
+ export declare function getRegisteredEntities(): RegisteredEntity[];
18
+ export declare function getEntityByKey(key: string): RegisteredEntity | undefined;
19
+ //# sourceMappingURL=entity-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity-registry.d.ts","sourceRoot":"","sources":["../../src/lib/entity-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAExD,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,QAAQ,EAAE,CAAA;IAClB,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAA;IACzB,SAAS,CAAC,EAAE,eAAe,CAAA;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAID,wBAAgB,eAAe,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAQ5D;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAE7D;AAED,wBAAgB,qBAAqB,IAAI,gBAAgB,EAAE,CAE1D;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAExE"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Global entity route registry.
3
+ *
4
+ * Populated once during buildNavigation() with mappings from
5
+ * "archetype:kind" (e.g. "person:staff") to the registered route path
6
+ * (e.g. "/registry/staff"). Used by PersonLink, command palette, and
7
+ * any component that needs to resolve an entity detail URL.
8
+ *
9
+ * An entry records whether the route can take an id: a CRUD page owns
10
+ * `/path/:id`, a hand-built page (the agenda) only has its list.
11
+ */
12
+ export interface EntityRouteEntry {
13
+ path: string;
14
+ /** The route renders `${path}/${id}` as a detail view. */
15
+ detail: boolean;
16
+ }
17
+ /** Replace the entity route map (called once at app init by buildNavigation).
18
+ * Accepts the legacy `Map<string, string>` shape (all detail-capable). */
19
+ export declare function setEntityRouteMap(map: Map<string, EntityRouteEntry | string>): void;
20
+ /**
21
+ * Resolve the route path for an entity given its archetype and kind.
22
+ * Returns the registered path (e.g. "/registry/staff") or null if not found.
23
+ *
24
+ * Tries "archetype:kind", then "archetype", then the entity key.
25
+ */
26
+ export declare function resolveEntityRoute(archetype?: string, kind?: string, entityKey?: string): string | null;
27
+ /** Whether the resolved route can show a single record, or only its list. */
28
+ export declare function entityRouteHasDetail(archetype?: string, kind?: string, entityKey?: string): boolean;
29
+ /**
30
+ * Build a full URL path for an entity detail page.
31
+ * Returns e.g. "/registry/staff/uuid" or "/registry/staff/uuid/schedule".
32
+ * Falls back to "/kind/uuid" if no route registered.
33
+ *
34
+ * A list-only route (a plugin page that shows these records but has no detail
35
+ * view) returns the bare path — appending an id there is a dead end.
36
+ */
37
+ export declare function resolveEntityHref(id: string, archetype?: string, kind?: string, tab?: string, entityKey?: string): string;
38
+ /** The href form — hash-prefixed, because the admin is a hash router. Use this
39
+ * for links, `openEntity` for clicks. */
40
+ export declare function resolveEntityAnchor(id: string, archetype?: string, kind?: string, tab?: string, entityKey?: string): string;
41
+ /**
42
+ * Resolve a record's URL and go there — the only way a surface should open one.
43
+ * `resolveEntityHref` returns a plain admin path, and handing that to a generic
44
+ * router adapter assigns `location.href`: a full page load to a URL the app does
45
+ * not serve. The palette and the chat chips both got that wrong independently.
46
+ */
47
+ export declare function openEntity(id: string, archetype?: string, kind?: string, tab?: string, entityKey?: string): void;
48
+ //# sourceMappingURL=entity-routes.d.ts.map