@aglyn/plugins-ai 1.0.0-beta.143

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 (717) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +25 -0
  3. package/package.json +60 -0
  4. package/src/index.d.ts +21 -0
  5. package/src/index.js +22 -0
  6. package/src/index.js.map +1 -0
  7. package/src/lib/activity/ai-activity-actions.d.ts +106 -0
  8. package/src/lib/activity/ai-activity-actions.js +209 -0
  9. package/src/lib/activity/ai-activity-actions.js.map +1 -0
  10. package/src/lib/activity/ai-activity.d.ts +219 -0
  11. package/src/lib/activity/ai-activity.js +251 -0
  12. package/src/lib/activity/ai-activity.js.map +1 -0
  13. package/src/lib/billing/ai-overage-charge.d.ts +102 -0
  14. package/src/lib/billing/ai-overage-charge.js +258 -0
  15. package/src/lib/billing/ai-overage-charge.js.map +1 -0
  16. package/src/lib/billing/ai-overage-close.d.ts +62 -0
  17. package/src/lib/billing/ai-overage-close.js +129 -0
  18. package/src/lib/billing/ai-overage-close.js.map +1 -0
  19. package/src/lib/billing/ai-overage-cutover.d.ts +63 -0
  20. package/src/lib/billing/ai-overage-cutover.js +114 -0
  21. package/src/lib/billing/ai-overage-cutover.js.map +1 -0
  22. package/src/lib/billing/ai-overage-events.d.ts +77 -0
  23. package/src/lib/billing/ai-overage-events.js +174 -0
  24. package/src/lib/billing/ai-overage-events.js.map +1 -0
  25. package/src/lib/billing/ai-overage-gate.d.ts +147 -0
  26. package/src/lib/billing/ai-overage-gate.js +177 -0
  27. package/src/lib/billing/ai-overage-gate.js.map +1 -0
  28. package/src/lib/billing/ai-overage-ledger.d.ts +135 -0
  29. package/src/lib/billing/ai-overage-ledger.js +278 -0
  30. package/src/lib/billing/ai-overage-ledger.js.map +1 -0
  31. package/src/lib/billing/ai-overage-standing-writes.d.ts +110 -0
  32. package/src/lib/billing/ai-overage-standing-writes.js +205 -0
  33. package/src/lib/billing/ai-overage-standing-writes.js.map +1 -0
  34. package/src/lib/billing/ai-overage-standing.d.ts +168 -0
  35. package/src/lib/billing/ai-overage-standing.js +215 -0
  36. package/src/lib/billing/ai-overage-standing.js.map +1 -0
  37. package/src/lib/billing/ai-overage-trigger.d.ts +30 -0
  38. package/src/lib/billing/ai-overage-trigger.js +76 -0
  39. package/src/lib/billing/ai-overage-trigger.js.map +1 -0
  40. package/src/lib/components/ai-allotment-editor.component.d.ts +40 -0
  41. package/src/lib/components/ai-allotment-editor.component.js +213 -0
  42. package/src/lib/components/ai-allotment-editor.component.js.map +1 -0
  43. package/src/lib/components/ai-assist-actions-context.d.ts +13 -0
  44. package/src/lib/components/ai-assist-actions-context.js +21 -0
  45. package/src/lib/components/ai-assist-actions-context.js.map +1 -0
  46. package/src/lib/components/ai-assist-provider.component.d.ts +51 -0
  47. package/src/lib/components/ai-assist-provider.component.js +519 -0
  48. package/src/lib/components/ai-assist-provider.component.js.map +1 -0
  49. package/src/lib/components/ai-brief-dialog.component.d.ts +56 -0
  50. package/src/lib/components/ai-brief-dialog.component.js +319 -0
  51. package/src/lib/components/ai-brief-dialog.component.js.map +1 -0
  52. package/src/lib/components/ai-collaborator-permissions-column.component.d.ts +32 -0
  53. package/src/lib/components/ai-collaborator-permissions-column.component.js +132 -0
  54. package/src/lib/components/ai-collaborator-permissions-column.component.js.map +1 -0
  55. package/src/lib/components/ai-credits-card.component.d.ts +34 -0
  56. package/src/lib/components/ai-credits-card.component.js +131 -0
  57. package/src/lib/components/ai-credits-card.component.js.map +1 -0
  58. package/src/lib/components/ai-credits-columns.component.d.ts +56 -0
  59. package/src/lib/components/ai-credits-columns.component.js +118 -0
  60. package/src/lib/components/ai-credits-columns.component.js.map +1 -0
  61. package/src/lib/components/ai-crm-email-draft.component.d.ts +17 -0
  62. package/src/lib/components/ai-crm-email-draft.component.js +159 -0
  63. package/src/lib/components/ai-crm-email-draft.component.js.map +1 -0
  64. package/src/lib/components/ai-crm-import-mapping.component.d.ts +20 -0
  65. package/src/lib/components/ai-crm-import-mapping.component.js +167 -0
  66. package/src/lib/components/ai-crm-import-mapping.component.js.map +1 -0
  67. package/src/lib/components/ai-crm-record-card.component.d.ts +27 -0
  68. package/src/lib/components/ai-crm-record-card.component.js +263 -0
  69. package/src/lib/components/ai-crm-record-card.component.js.map +1 -0
  70. package/src/lib/components/ai-describe-automation.component.d.ts +31 -0
  71. package/src/lib/components/ai-describe-automation.component.js +226 -0
  72. package/src/lib/components/ai-describe-automation.component.js.map +1 -0
  73. package/src/lib/components/ai-describe-button.component.d.ts +39 -0
  74. package/src/lib/components/ai-describe-button.component.js +87 -0
  75. package/src/lib/components/ai-describe-button.component.js.map +1 -0
  76. package/src/lib/components/ai-describe-page.component.d.ts +26 -0
  77. package/src/lib/components/ai-describe-page.component.js +18 -0
  78. package/src/lib/components/ai-describe-page.component.js.map +1 -0
  79. package/src/lib/components/ai-experiment-cards.component.d.ts +75 -0
  80. package/src/lib/components/ai-experiment-cards.component.js +573 -0
  81. package/src/lib/components/ai-experiment-cards.component.js.map +1 -0
  82. package/src/lib/components/ai-explain-automation.component.d.ts +31 -0
  83. package/src/lib/components/ai-explain-automation.component.js +265 -0
  84. package/src/lib/components/ai-explain-automation.component.js.map +1 -0
  85. package/src/lib/components/ai-insight-dialog.component.d.ts +37 -0
  86. package/src/lib/components/ai-insight-dialog.component.js +441 -0
  87. package/src/lib/components/ai-insight-dialog.component.js.map +1 -0
  88. package/src/lib/components/ai-job-plan.component.d.ts +46 -0
  89. package/src/lib/components/ai-job-plan.component.js +192 -0
  90. package/src/lib/components/ai-job-plan.component.js.map +1 -0
  91. package/src/lib/components/ai-model-selector.component.d.ts +21 -0
  92. package/src/lib/components/ai-model-selector.component.js +109 -0
  93. package/src/lib/components/ai-model-selector.component.js.map +1 -0
  94. package/src/lib/components/ai-page-brief-dialog.component.d.ts +29 -0
  95. package/src/lib/components/ai-page-brief-dialog.component.js +27 -0
  96. package/src/lib/components/ai-page-brief-dialog.component.js.map +1 -0
  97. package/src/lib/components/ai-permissions-on-host.component.d.ts +55 -0
  98. package/src/lib/components/ai-permissions-on-host.component.js +91 -0
  99. package/src/lib/components/ai-permissions-on-host.component.js.map +1 -0
  100. package/src/lib/components/ai-product-copy-card.component.d.ts +25 -0
  101. package/src/lib/components/ai-product-copy-card.component.js +328 -0
  102. package/src/lib/components/ai-product-copy-card.component.js.map +1 -0
  103. package/src/lib/components/ai-product-import-option.component.d.ts +14 -0
  104. package/src/lib/components/ai-product-import-option.component.js +58 -0
  105. package/src/lib/components/ai-product-import-option.component.js.map +1 -0
  106. package/src/lib/components/ai-products-hub-card.component.d.ts +15 -0
  107. package/src/lib/components/ai-products-hub-card.component.js +418 -0
  108. package/src/lib/components/ai-products-hub-card.component.js.map +1 -0
  109. package/src/lib/components/ai-products-proposals.component.d.ts +19 -0
  110. package/src/lib/components/ai-products-proposals.component.js +547 -0
  111. package/src/lib/components/ai-products-proposals.component.js.map +1 -0
  112. package/src/lib/components/ai-save-as-component.component.d.ts +38 -0
  113. package/src/lib/components/ai-save-as-component.component.js +231 -0
  114. package/src/lib/components/ai-save-as-component.component.js.map +1 -0
  115. package/src/lib/components/ai-seo-audit-card.component.d.ts +9 -0
  116. package/src/lib/components/ai-seo-audit-card.component.js +620 -0
  117. package/src/lib/components/ai-seo-audit-card.component.js.map +1 -0
  118. package/src/lib/components/ai-seo-fields-card.component.d.ts +10 -0
  119. package/src/lib/components/ai-seo-fields-card.component.js +453 -0
  120. package/src/lib/components/ai-seo-fields-card.component.js.map +1 -0
  121. package/src/lib/components/ai-site-batch-card.component.d.ts +32 -0
  122. package/src/lib/components/ai-site-batch-card.component.js +531 -0
  123. package/src/lib/components/ai-site-batch-card.component.js.map +1 -0
  124. package/src/lib/components/ai-site-seo-start-card.component.d.ts +26 -0
  125. package/src/lib/components/ai-site-seo-start-card.component.js +178 -0
  126. package/src/lib/components/ai-site-seo-start-card.component.js.map +1 -0
  127. package/src/lib/components/ai-site-start-card.component.d.ts +19 -0
  128. package/src/lib/components/ai-site-start-card.component.js +348 -0
  129. package/src/lib/components/ai-site-start-card.component.js.map +1 -0
  130. package/src/lib/components/ai-template-collection-field.component.d.ts +32 -0
  131. package/src/lib/components/ai-template-collection-field.component.js +63 -0
  132. package/src/lib/components/ai-template-collection-field.component.js.map +1 -0
  133. package/src/lib/components/ai-theme-proposal-card.component.d.ts +6 -0
  134. package/src/lib/components/ai-theme-proposal-card.component.js +619 -0
  135. package/src/lib/components/ai-theme-proposal-card.component.js.map +1 -0
  136. package/src/lib/components/ai-usage-strip.component.d.ts +27 -0
  137. package/src/lib/components/ai-usage-strip.component.js +145 -0
  138. package/src/lib/components/ai-usage-strip.component.js.map +1 -0
  139. package/src/lib/components/assist-edit-canvas.d.ts +169 -0
  140. package/src/lib/components/assist-edit-canvas.js +636 -0
  141. package/src/lib/components/assist-edit-canvas.js.map +1 -0
  142. package/src/lib/components/assist-edit-card.component.d.ts +16 -0
  143. package/src/lib/components/assist-edit-card.component.js +181 -0
  144. package/src/lib/components/assist-edit-card.component.js.map +1 -0
  145. package/src/lib/components/assist-jobs-drawer.component.d.ts +72 -0
  146. package/src/lib/components/assist-jobs-drawer.component.js +626 -0
  147. package/src/lib/components/assist-jobs-drawer.component.js.map +1 -0
  148. package/src/lib/components/assist-panel.component.d.ts +136 -0
  149. package/src/lib/components/assist-panel.component.js +1099 -0
  150. package/src/lib/components/assist-panel.component.js.map +1 -0
  151. package/src/lib/components/assist-signals-page.component.d.ts +3 -0
  152. package/src/lib/components/assist-signals-page.component.js +1017 -0
  153. package/src/lib/components/assist-signals-page.component.js.map +1 -0
  154. package/src/lib/components/besigner-ai-controls.component.d.ts +29 -0
  155. package/src/lib/components/besigner-ai-controls.component.js +81 -0
  156. package/src/lib/components/besigner-ai-controls.component.js.map +1 -0
  157. package/src/lib/components/billing-ai-allotments.component.d.ts +36 -0
  158. package/src/lib/components/billing-ai-allotments.component.js +486 -0
  159. package/src/lib/components/billing-ai-allotments.component.js.map +1 -0
  160. package/src/lib/components/billing-ai-top-users.component.d.ts +44 -0
  161. package/src/lib/components/billing-ai-top-users.component.js +304 -0
  162. package/src/lib/components/billing-ai-top-users.component.js.map +1 -0
  163. package/src/lib/components/billing-assist-overage-card.component.d.ts +69 -0
  164. package/src/lib/components/billing-assist-overage-card.component.js +437 -0
  165. package/src/lib/components/billing-assist-overage-card.component.js.map +1 -0
  166. package/src/lib/components/host-ai-allotments.component.d.ts +40 -0
  167. package/src/lib/components/host-ai-allotments.component.js +239 -0
  168. package/src/lib/components/host-ai-allotments.component.js.map +1 -0
  169. package/src/lib/components/member-ai-allotment-card.component.d.ts +28 -0
  170. package/src/lib/components/member-ai-allotment-card.component.js +172 -0
  171. package/src/lib/components/member-ai-allotment-card.component.js.map +1 -0
  172. package/src/lib/components/member-ai-usage-card.component.d.ts +28 -0
  173. package/src/lib/components/member-ai-usage-card.component.js +240 -0
  174. package/src/lib/components/member-ai-usage-card.component.js.map +1 -0
  175. package/src/lib/components/staff-org-ai-card.component.d.ts +17 -0
  176. package/src/lib/components/staff-org-ai-card.component.js +739 -0
  177. package/src/lib/components/staff-org-ai-card.component.js.map +1 -0
  178. package/src/lib/components/staff-org-usage-ai-columns.component.d.ts +41 -0
  179. package/src/lib/components/staff-org-usage-ai-columns.component.js +65 -0
  180. package/src/lib/components/staff-org-usage-ai-columns.component.js.map +1 -0
  181. package/src/lib/components/staff-orgs-ai-spend-column.component.d.ts +28 -0
  182. package/src/lib/components/staff-orgs-ai-spend-column.component.js +89 -0
  183. package/src/lib/components/staff-orgs-ai-spend-column.component.js.map +1 -0
  184. package/src/lib/components/staff-user-ai-usage-card.component.d.ts +27 -0
  185. package/src/lib/components/staff-user-ai-usage-card.component.js +183 -0
  186. package/src/lib/components/staff-user-ai-usage-card.component.js.map +1 -0
  187. package/src/lib/components/use-ai-allotments.d.ts +49 -0
  188. package/src/lib/components/use-ai-allotments.js +171 -0
  189. package/src/lib/components/use-ai-allotments.js.map +1 -0
  190. package/src/lib/components/use-ai-crm-answer.d.ts +50 -0
  191. package/src/lib/components/use-ai-crm-answer.js +220 -0
  192. package/src/lib/components/use-ai-crm-answer.js.map +1 -0
  193. package/src/lib/components/use-ai-job-run.d.ts +51 -0
  194. package/src/lib/components/use-ai-job-run.js +176 -0
  195. package/src/lib/components/use-ai-job-run.js.map +1 -0
  196. package/src/lib/components/use-ai-model-choice.d.ts +47 -0
  197. package/src/lib/components/use-ai-model-choice.js +150 -0
  198. package/src/lib/components/use-ai-model-choice.js.map +1 -0
  199. package/src/lib/components/use-ai-products-jobs.d.ts +36 -0
  200. package/src/lib/components/use-ai-products-jobs.js +190 -0
  201. package/src/lib/components/use-ai-products-jobs.js.map +1 -0
  202. package/src/lib/components/use-ai-usage-meter.d.ts +11 -0
  203. package/src/lib/components/use-ai-usage-meter.js +96 -0
  204. package/src/lib/components/use-ai-usage-meter.js.map +1 -0
  205. package/src/lib/components/use-org-ai-usage.d.ts +42 -0
  206. package/src/lib/components/use-org-ai-usage.js +181 -0
  207. package/src/lib/components/use-org-ai-usage.js.map +1 -0
  208. package/src/lib/components/use-staff-orgs-ai-spend.d.ts +18 -0
  209. package/src/lib/components/use-staff-orgs-ai-spend.js +127 -0
  210. package/src/lib/components/use-staff-orgs-ai-spend.js.map +1 -0
  211. package/src/lib/constants.d.ts +24 -0
  212. package/src/lib/constants.js +23 -0
  213. package/src/lib/constants.js.map +1 -0
  214. package/src/lib/declarations.d.ts +48 -0
  215. package/src/lib/declarations.js +129 -0
  216. package/src/lib/declarations.js.map +1 -0
  217. package/src/lib/declarations.server.d.ts +35 -0
  218. package/src/lib/declarations.server.js +138 -0
  219. package/src/lib/declarations.server.js.map +1 -0
  220. package/src/lib/insights/ai-figure-readers.d.ts +90 -0
  221. package/src/lib/insights/ai-figure-readers.js +863 -0
  222. package/src/lib/insights/ai-figure-readers.js.map +1 -0
  223. package/src/lib/insights/ai-insight-digest.d.ts +165 -0
  224. package/src/lib/insights/ai-insight-digest.js +363 -0
  225. package/src/lib/insights/ai-insight-digest.js.map +1 -0
  226. package/src/lib/insights/ai-insight-readers.d.ts +71 -0
  227. package/src/lib/insights/ai-insight-readers.js +141 -0
  228. package/src/lib/insights/ai-insight-readers.js.map +1 -0
  229. package/src/lib/jobs/ai-crm-access.d.ts +61 -0
  230. package/src/lib/jobs/ai-crm-access.js +94 -0
  231. package/src/lib/jobs/ai-crm-access.js.map +1 -0
  232. package/src/lib/jobs/ai-email-bindings.d.ts +97 -0
  233. package/src/lib/jobs/ai-email-bindings.js +147 -0
  234. package/src/lib/jobs/ai-email-bindings.js.map +1 -0
  235. package/src/lib/jobs/ai-job-admission.d.ts +82 -0
  236. package/src/lib/jobs/ai-job-admission.js +45 -0
  237. package/src/lib/jobs/ai-job-admission.js.map +1 -0
  238. package/src/lib/jobs/ai-job-budget.d.ts +167 -0
  239. package/src/lib/jobs/ai-job-budget.js +161 -0
  240. package/src/lib/jobs/ai-job-budget.js.map +1 -0
  241. package/src/lib/jobs/ai-job-campaign-step.d.ts +108 -0
  242. package/src/lib/jobs/ai-job-campaign-step.js +340 -0
  243. package/src/lib/jobs/ai-job-campaign-step.js.map +1 -0
  244. package/src/lib/jobs/ai-job-component-checks.d.ts +74 -0
  245. package/src/lib/jobs/ai-job-component-checks.js +442 -0
  246. package/src/lib/jobs/ai-job-component-checks.js.map +1 -0
  247. package/src/lib/jobs/ai-job-component-step.d.ts +75 -0
  248. package/src/lib/jobs/ai-job-component-step.js +262 -0
  249. package/src/lib/jobs/ai-job-component-step.js.map +1 -0
  250. package/src/lib/jobs/ai-job-crm-step.d.ts +192 -0
  251. package/src/lib/jobs/ai-job-crm-step.js +734 -0
  252. package/src/lib/jobs/ai-job-crm-step.js.map +1 -0
  253. package/src/lib/jobs/ai-job-draft-ids.d.ts +62 -0
  254. package/src/lib/jobs/ai-job-draft-ids.js +132 -0
  255. package/src/lib/jobs/ai-job-draft-ids.js.map +1 -0
  256. package/src/lib/jobs/ai-job-drafts.d.ts +304 -0
  257. package/src/lib/jobs/ai-job-drafts.js +557 -0
  258. package/src/lib/jobs/ai-job-drafts.js.map +1 -0
  259. package/src/lib/jobs/ai-job-email-step.d.ts +195 -0
  260. package/src/lib/jobs/ai-job-email-step.js +547 -0
  261. package/src/lib/jobs/ai-job-email-step.js.map +1 -0
  262. package/src/lib/jobs/ai-job-experiment-step.d.ts +105 -0
  263. package/src/lib/jobs/ai-job-experiment-step.js +445 -0
  264. package/src/lib/jobs/ai-job-experiment-step.js.map +1 -0
  265. package/src/lib/jobs/ai-job-form-step.d.ts +250 -0
  266. package/src/lib/jobs/ai-job-form-step.js +634 -0
  267. package/src/lib/jobs/ai-job-form-step.js.map +1 -0
  268. package/src/lib/jobs/ai-job-generation.d.ts +114 -0
  269. package/src/lib/jobs/ai-job-generation.js +384 -0
  270. package/src/lib/jobs/ai-job-generation.js.map +1 -0
  271. package/src/lib/jobs/ai-job-insight-budget.d.ts +41 -0
  272. package/src/lib/jobs/ai-job-insight-budget.js +46 -0
  273. package/src/lib/jobs/ai-job-insight-budget.js.map +1 -0
  274. package/src/lib/jobs/ai-job-insight-step.d.ts +58 -0
  275. package/src/lib/jobs/ai-job-insight-step.js +350 -0
  276. package/src/lib/jobs/ai-job-insight-step.js.map +1 -0
  277. package/src/lib/jobs/ai-job-layout-step.d.ts +103 -0
  278. package/src/lib/jobs/ai-job-layout-step.js +340 -0
  279. package/src/lib/jobs/ai-job-layout-step.js.map +1 -0
  280. package/src/lib/jobs/ai-job-page-budget.d.ts +57 -0
  281. package/src/lib/jobs/ai-job-page-budget.js +60 -0
  282. package/src/lib/jobs/ai-job-page-budget.js.map +1 -0
  283. package/src/lib/jobs/ai-job-page-sections.d.ts +150 -0
  284. package/src/lib/jobs/ai-job-page-sections.js +450 -0
  285. package/src/lib/jobs/ai-job-page-sections.js.map +1 -0
  286. package/src/lib/jobs/ai-job-page-step.d.ts +198 -0
  287. package/src/lib/jobs/ai-job-page-step.js +667 -0
  288. package/src/lib/jobs/ai-job-page-step.js.map +1 -0
  289. package/src/lib/jobs/ai-job-plan-conformance.d.ts +107 -0
  290. package/src/lib/jobs/ai-job-plan-conformance.js +164 -0
  291. package/src/lib/jobs/ai-job-plan-conformance.js.map +1 -0
  292. package/src/lib/jobs/ai-job-plan-step.d.ts +196 -0
  293. package/src/lib/jobs/ai-job-plan-step.js +458 -0
  294. package/src/lib/jobs/ai-job-plan-step.js.map +1 -0
  295. package/src/lib/jobs/ai-job-plugin-drafts.d.ts +76 -0
  296. package/src/lib/jobs/ai-job-plugin-drafts.js +91 -0
  297. package/src/lib/jobs/ai-job-plugin-drafts.js.map +1 -0
  298. package/src/lib/jobs/ai-job-products-step.d.ts +106 -0
  299. package/src/lib/jobs/ai-job-products-step.js +436 -0
  300. package/src/lib/jobs/ai-job-products-step.js.map +1 -0
  301. package/src/lib/jobs/ai-job-seo-budget.d.ts +52 -0
  302. package/src/lib/jobs/ai-job-seo-budget.js +63 -0
  303. package/src/lib/jobs/ai-job-seo-budget.js.map +1 -0
  304. package/src/lib/jobs/ai-job-seo-step.d.ts +145 -0
  305. package/src/lib/jobs/ai-job-seo-step.js +809 -0
  306. package/src/lib/jobs/ai-job-seo-step.js.map +1 -0
  307. package/src/lib/jobs/ai-job-site-step.d.ts +252 -0
  308. package/src/lib/jobs/ai-job-site-step.js +538 -0
  309. package/src/lib/jobs/ai-job-site-step.js.map +1 -0
  310. package/src/lib/jobs/ai-job-template-step.d.ts +105 -0
  311. package/src/lib/jobs/ai-job-template-step.js +391 -0
  312. package/src/lib/jobs/ai-job-template-step.js.map +1 -0
  313. package/src/lib/jobs/ai-job-text-step.d.ts +125 -0
  314. package/src/lib/jobs/ai-job-text-step.js +128 -0
  315. package/src/lib/jobs/ai-job-text-step.js.map +1 -0
  316. package/src/lib/jobs/ai-job-theme-budget.d.ts +38 -0
  317. package/src/lib/jobs/ai-job-theme-budget.js +43 -0
  318. package/src/lib/jobs/ai-job-theme-budget.js.map +1 -0
  319. package/src/lib/jobs/ai-job-theme-step.d.ts +115 -0
  320. package/src/lib/jobs/ai-job-theme-step.js +337 -0
  321. package/src/lib/jobs/ai-job-theme-step.js.map +1 -0
  322. package/src/lib/jobs/ai-job-workflow-step.d.ts +139 -0
  323. package/src/lib/jobs/ai-job-workflow-step.js +530 -0
  324. package/src/lib/jobs/ai-job-workflow-step.js.map +1 -0
  325. package/src/lib/jobs/ai-jobs-beat.d.ts +78 -0
  326. package/src/lib/jobs/ai-jobs-beat.js +93 -0
  327. package/src/lib/jobs/ai-jobs-beat.js.map +1 -0
  328. package/src/lib/jobs/ai-jobs-pause.d.ts +38 -0
  329. package/src/lib/jobs/ai-jobs-pause.js +45 -0
  330. package/src/lib/jobs/ai-jobs-pause.js.map +1 -0
  331. package/src/lib/jobs/ai-jobs.d.ts +558 -0
  332. package/src/lib/jobs/ai-jobs.js +1410 -0
  333. package/src/lib/jobs/ai-jobs.js.map +1 -0
  334. package/src/lib/jobs/ai-media-asset-server.d.ts +34 -0
  335. package/src/lib/jobs/ai-media-asset-server.js +34 -0
  336. package/src/lib/jobs/ai-media-asset-server.js.map +1 -0
  337. package/src/lib/jobs/ai-media-asset.d.ts +59 -0
  338. package/src/lib/jobs/ai-media-asset.js +86 -0
  339. package/src/lib/jobs/ai-media-asset.js.map +1 -0
  340. package/src/lib/jobs/ai-product-image.d.ts +78 -0
  341. package/src/lib/jobs/ai-product-image.js +113 -0
  342. package/src/lib/jobs/ai-product-image.js.map +1 -0
  343. package/src/lib/jobs/ai-theme-brand-inputs.d.ts +125 -0
  344. package/src/lib/jobs/ai-theme-brand-inputs.js +378 -0
  345. package/src/lib/jobs/ai-theme-brand-inputs.js.map +1 -0
  346. package/src/lib/jobs/ai-theme-brand-server.d.ts +33 -0
  347. package/src/lib/jobs/ai-theme-brand-server.js +33 -0
  348. package/src/lib/jobs/ai-theme-brand-server.js.map +1 -0
  349. package/src/lib/jobs/ai-workflow-records.d.ts +84 -0
  350. package/src/lib/jobs/ai-workflow-records.js +158 -0
  351. package/src/lib/jobs/ai-workflow-records.js.map +1 -0
  352. package/src/lib/jobs/fixtures/ai-free-page-built-recording.d.ts +31 -0
  353. package/src/lib/jobs/fixtures/ai-free-page-built-recording.js +367 -0
  354. package/src/lib/jobs/fixtures/ai-free-page-built-recording.js.map +1 -0
  355. package/src/lib/jobs/fixtures/ai-free-page-recording.d.ts +69 -0
  356. package/src/lib/jobs/fixtures/ai-free-page-recording.js +442 -0
  357. package/src/lib/jobs/fixtures/ai-free-page-recording.js.map +1 -0
  358. package/src/lib/jobs/fixtures/ai-page-briefs.d.ts +146 -0
  359. package/src/lib/jobs/fixtures/ai-page-briefs.js +1850 -0
  360. package/src/lib/jobs/fixtures/ai-page-briefs.js.map +1 -0
  361. package/src/lib/model/ai-allotments.d.ts +208 -0
  362. package/src/lib/model/ai-allotments.js +269 -0
  363. package/src/lib/model/ai-allotments.js.map +1 -0
  364. package/src/lib/model/ai-automation-draft.d.ts +74 -0
  365. package/src/lib/model/ai-automation-draft.js +310 -0
  366. package/src/lib/model/ai-automation-draft.js.map +1 -0
  367. package/src/lib/model/ai-automation-outline.d.ts +50 -0
  368. package/src/lib/model/ai-automation-outline.js +262 -0
  369. package/src/lib/model/ai-automation-outline.js.map +1 -0
  370. package/src/lib/model/ai-build-plan.d.ts +197 -0
  371. package/src/lib/model/ai-build-plan.js +438 -0
  372. package/src/lib/model/ai-build-plan.js.map +1 -0
  373. package/src/lib/model/ai-crm.d.ts +237 -0
  374. package/src/lib/model/ai-crm.js +225 -0
  375. package/src/lib/model/ai-crm.js.map +1 -0
  376. package/src/lib/model/ai-experiment-proposal.d.ts +68 -0
  377. package/src/lib/model/ai-experiment-proposal.js +146 -0
  378. package/src/lib/model/ai-experiment-proposal.js.map +1 -0
  379. package/src/lib/model/ai-experiment.d.ts +309 -0
  380. package/src/lib/model/ai-experiment.js +395 -0
  381. package/src/lib/model/ai-experiment.js.map +1 -0
  382. package/src/lib/model/ai-insight.d.ts +178 -0
  383. package/src/lib/model/ai-insight.js +201 -0
  384. package/src/lib/model/ai-insight.js.map +1 -0
  385. package/src/lib/model/ai-jobs.types.d.ts +412 -0
  386. package/src/lib/model/ai-jobs.types.js +42 -0
  387. package/src/lib/model/ai-jobs.types.js.map +1 -0
  388. package/src/lib/model/ai-page-job.d.ts +92 -0
  389. package/src/lib/model/ai-page-job.js +159 -0
  390. package/src/lib/model/ai-page-job.js.map +1 -0
  391. package/src/lib/model/ai-permissions.d.ts +49 -0
  392. package/src/lib/model/ai-permissions.js +97 -0
  393. package/src/lib/model/ai-permissions.js.map +1 -0
  394. package/src/lib/model/ai-plan-capabilities.d.ts +139 -0
  395. package/src/lib/model/ai-plan-capabilities.js +149 -0
  396. package/src/lib/model/ai-plan-capabilities.js.map +1 -0
  397. package/src/lib/model/ai-products.d.ts +251 -0
  398. package/src/lib/model/ai-products.js +253 -0
  399. package/src/lib/model/ai-products.js.map +1 -0
  400. package/src/lib/model/ai-seo.d.ts +208 -0
  401. package/src/lib/model/ai-seo.js +150 -0
  402. package/src/lib/model/ai-seo.js.map +1 -0
  403. package/src/lib/model/ai-site-inventory.d.ts +164 -0
  404. package/src/lib/model/ai-site-inventory.js +145 -0
  405. package/src/lib/model/ai-site-inventory.js.map +1 -0
  406. package/src/lib/model/ai-site-job.d.ts +247 -0
  407. package/src/lib/model/ai-site-job.js +314 -0
  408. package/src/lib/model/ai-site-job.js.map +1 -0
  409. package/src/lib/model/ai-site-start-seo.d.ts +103 -0
  410. package/src/lib/model/ai-site-start-seo.js +154 -0
  411. package/src/lib/model/ai-site-start-seo.js.map +1 -0
  412. package/src/lib/model/ai-site-start.d.ts +122 -0
  413. package/src/lib/model/ai-site-start.js +159 -0
  414. package/src/lib/model/ai-site-start.js.map +1 -0
  415. package/src/lib/model/ai-site-switch.d.ts +56 -0
  416. package/src/lib/model/ai-site-switch.js +73 -0
  417. package/src/lib/model/ai-site-switch.js.map +1 -0
  418. package/src/lib/model/ai-storefront-claims.d.ts +70 -0
  419. package/src/lib/model/ai-storefront-claims.js +130 -0
  420. package/src/lib/model/ai-storefront-claims.js.map +1 -0
  421. package/src/lib/model/ai-template-subjects.d.ts +82 -0
  422. package/src/lib/model/ai-template-subjects.js +136 -0
  423. package/src/lib/model/ai-template-subjects.js.map +1 -0
  424. package/src/lib/model/ai-theme-proposal.d.ts +210 -0
  425. package/src/lib/model/ai-theme-proposal.js +506 -0
  426. package/src/lib/model/ai-theme-proposal.js.map +1 -0
  427. package/src/lib/model/ai-tokens.d.ts +96 -0
  428. package/src/lib/model/ai-tokens.js +117 -0
  429. package/src/lib/model/ai-tokens.js.map +1 -0
  430. package/src/lib/model/ai-usage-by-user.d.ts +120 -0
  431. package/src/lib/model/ai-usage-by-user.js +139 -0
  432. package/src/lib/model/ai-usage-by-user.js.map +1 -0
  433. package/src/lib/model/ai-workflow-job.d.ts +111 -0
  434. package/src/lib/model/ai-workflow-job.js +183 -0
  435. package/src/lib/model/ai-workflow-job.js.map +1 -0
  436. package/src/lib/model/assist-edit.d.ts +261 -0
  437. package/src/lib/model/assist-edit.js +175 -0
  438. package/src/lib/model/assist-edit.js.map +1 -0
  439. package/src/lib/plugin-config.d.ts +33 -0
  440. package/src/lib/plugin-config.js +118 -0
  441. package/src/lib/plugin-config.js.map +1 -0
  442. package/src/lib/plugin.d.ts +30 -0
  443. package/src/lib/plugin.js +525 -0
  444. package/src/lib/plugin.js.map +1 -0
  445. package/src/lib/providers/anthropic.d.ts +84 -0
  446. package/src/lib/providers/anthropic.js +432 -0
  447. package/src/lib/providers/anthropic.js.map +1 -0
  448. package/src/lib/providers/catalog.d.ts +197 -0
  449. package/src/lib/providers/catalog.js +312 -0
  450. package/src/lib/providers/catalog.js.map +1 -0
  451. package/src/lib/providers/contract.d.ts +464 -0
  452. package/src/lib/providers/contract.js +274 -0
  453. package/src/lib/providers/contract.js.map +1 -0
  454. package/src/lib/providers/model-choice.d.ts +119 -0
  455. package/src/lib/providers/model-choice.js +416 -0
  456. package/src/lib/providers/model-choice.js.map +1 -0
  457. package/src/lib/providers/openai-compatible.d.ts +58 -0
  458. package/src/lib/providers/openai-compatible.js +361 -0
  459. package/src/lib/providers/openai-compatible.js.map +1 -0
  460. package/src/lib/providers/registry.d.ts +49 -0
  461. package/src/lib/providers/registry.js +71 -0
  462. package/src/lib/providers/registry.js.map +1 -0
  463. package/src/lib/providers/routing.d.ts +98 -0
  464. package/src/lib/providers/routing.js +450 -0
  465. package/src/lib/providers/routing.js.map +1 -0
  466. package/src/lib/runtime/ai-abuse-guards.d.ts +113 -0
  467. package/src/lib/runtime/ai-abuse-guards.js +148 -0
  468. package/src/lib/runtime/ai-abuse-guards.js.map +1 -0
  469. package/src/lib/runtime/ai-component-bindings.d.ts +67 -0
  470. package/src/lib/runtime/ai-component-bindings.js +106 -0
  471. package/src/lib/runtime/ai-component-bindings.js.map +1 -0
  472. package/src/lib/runtime/ai-device-audit.d.ts +109 -0
  473. package/src/lib/runtime/ai-device-audit.js +97 -0
  474. package/src/lib/runtime/ai-device-audit.js.map +1 -0
  475. package/src/lib/runtime/ai-doctrine-validators.d.ts +720 -0
  476. package/src/lib/runtime/ai-doctrine-validators.js +3133 -0
  477. package/src/lib/runtime/ai-doctrine-validators.js.map +1 -0
  478. package/src/lib/runtime/ai-doctrine.d.ts +372 -0
  479. package/src/lib/runtime/ai-doctrine.js +944 -0
  480. package/src/lib/runtime/ai-doctrine.js.map +1 -0
  481. package/src/lib/runtime/ai-eval-live.d.ts +321 -0
  482. package/src/lib/runtime/ai-eval-live.js +1257 -0
  483. package/src/lib/runtime/ai-eval-live.js.map +1 -0
  484. package/src/lib/runtime/ai-eval-memory-firestore.d.ts +51 -0
  485. package/src/lib/runtime/ai-eval-memory-firestore.js +183 -0
  486. package/src/lib/runtime/ai-eval-memory-firestore.js.map +1 -0
  487. package/src/lib/runtime/ai-eval.d.ts +441 -0
  488. package/src/lib/runtime/ai-eval.js +1151 -0
  489. package/src/lib/runtime/ai-eval.js.map +1 -0
  490. package/src/lib/runtime/ai-gate.d.ts +130 -0
  491. package/src/lib/runtime/ai-gate.js +272 -0
  492. package/src/lib/runtime/ai-gate.js.map +1 -0
  493. package/src/lib/runtime/ai-generation-bounds.d.ts +24 -0
  494. package/src/lib/runtime/ai-generation-bounds.js +23 -0
  495. package/src/lib/runtime/ai-generation-bounds.js.map +1 -0
  496. package/src/lib/runtime/ai-insight-check.d.ts +76 -0
  497. package/src/lib/runtime/ai-insight-check.js +281 -0
  498. package/src/lib/runtime/ai-insight-check.js.map +1 -0
  499. package/src/lib/runtime/ai-node-tree.d.ts +181 -0
  500. package/src/lib/runtime/ai-node-tree.js +931 -0
  501. package/src/lib/runtime/ai-node-tree.js.map +1 -0
  502. package/src/lib/runtime/ai-page-links.d.ts +79 -0
  503. package/src/lib/runtime/ai-page-links.js +135 -0
  504. package/src/lib/runtime/ai-page-links.js.map +1 -0
  505. package/src/lib/runtime/ai-palette.d.ts +252 -0
  506. package/src/lib/runtime/ai-palette.generated.d.ts +34 -0
  507. package/src/lib/runtime/ai-palette.generated.js +5263 -0
  508. package/src/lib/runtime/ai-palette.generated.js.map +1 -0
  509. package/src/lib/runtime/ai-palette.js +187 -0
  510. package/src/lib/runtime/ai-palette.js.map +1 -0
  511. package/src/lib/runtime/ai-products-generation.d.ts +107 -0
  512. package/src/lib/runtime/ai-products-generation.js +250 -0
  513. package/src/lib/runtime/ai-products-generation.js.map +1 -0
  514. package/src/lib/runtime/ai-repeated-items.d.ts +95 -0
  515. package/src/lib/runtime/ai-repeated-items.js +397 -0
  516. package/src/lib/runtime/ai-repeated-items.js.map +1 -0
  517. package/src/lib/runtime/ai-runtime.d.ts +148 -0
  518. package/src/lib/runtime/ai-runtime.js +237 -0
  519. package/src/lib/runtime/ai-runtime.js.map +1 -0
  520. package/src/lib/runtime/ai-template-examples.d.ts +71 -0
  521. package/src/lib/runtime/ai-template-examples.js +135 -0
  522. package/src/lib/runtime/ai-template-examples.js.map +1 -0
  523. package/src/lib/runtime/assist-answer-cache.d.ts +80 -0
  524. package/src/lib/runtime/assist-answer-cache.js +184 -0
  525. package/src/lib/runtime/assist-answer-cache.js.map +1 -0
  526. package/src/lib/runtime/seo-audit.d.ts +93 -0
  527. package/src/lib/runtime/seo-audit.js +260 -0
  528. package/src/lib/runtime/seo-audit.js.map +1 -0
  529. package/src/lib/runtime/seo-content-fixes.d.ts +41 -0
  530. package/src/lib/runtime/seo-content-fixes.js +168 -0
  531. package/src/lib/runtime/seo-content-fixes.js.map +1 -0
  532. package/src/lib/runtime/seo-fields.d.ts +152 -0
  533. package/src/lib/runtime/seo-fields.js +215 -0
  534. package/src/lib/runtime/seo-fields.js.map +1 -0
  535. package/src/lib/runtime/seo-page-facts.d.ts +61 -0
  536. package/src/lib/runtime/seo-page-facts.js +150 -0
  537. package/src/lib/runtime/seo-page-facts.js.map +1 -0
  538. package/src/lib/runtime/site-inventory.d.ts +63 -0
  539. package/src/lib/runtime/site-inventory.js +230 -0
  540. package/src/lib/runtime/site-inventory.js.map +1 -0
  541. package/src/lib/server/ai-admin-org.d.ts +33 -0
  542. package/src/lib/server/ai-admin-org.js +381 -0
  543. package/src/lib/server/ai-admin-org.js.map +1 -0
  544. package/src/lib/server/ai-admin-orgs-spend.d.ts +40 -0
  545. package/src/lib/server/ai-admin-orgs-spend.js +129 -0
  546. package/src/lib/server/ai-admin-orgs-spend.js.map +1 -0
  547. package/src/lib/server/ai-admin-overage.d.ts +19 -0
  548. package/src/lib/server/ai-admin-overage.js +246 -0
  549. package/src/lib/server/ai-admin-overage.js.map +1 -0
  550. package/src/lib/server/ai-admin-signals.d.ts +34 -0
  551. package/src/lib/server/ai-admin-signals.js +330 -0
  552. package/src/lib/server/ai-admin-signals.js.map +1 -0
  553. package/src/lib/server/ai-admin-user.d.ts +27 -0
  554. package/src/lib/server/ai-admin-user.js +128 -0
  555. package/src/lib/server/ai-admin-user.js.map +1 -0
  556. package/src/lib/server/ai-allotments.d.ts +27 -0
  557. package/src/lib/server/ai-allotments.js +544 -0
  558. package/src/lib/server/ai-allotments.js.map +1 -0
  559. package/src/lib/server/ai-assist-prompts.d.ts +102 -0
  560. package/src/lib/server/ai-assist-prompts.js +207 -0
  561. package/src/lib/server/ai-assist-prompts.js.map +1 -0
  562. package/src/lib/server/ai-assist.d.ts +119 -0
  563. package/src/lib/server/ai-assist.js +517 -0
  564. package/src/lib/server/ai-assist.js.map +1 -0
  565. package/src/lib/server/ai-crm-answer.d.ts +30 -0
  566. package/src/lib/server/ai-crm-answer.js +98 -0
  567. package/src/lib/server/ai-crm-answer.js.map +1 -0
  568. package/src/lib/server/ai-generate-component.d.ts +111 -0
  569. package/src/lib/server/ai-generate-component.js +643 -0
  570. package/src/lib/server/ai-generate-component.js.map +1 -0
  571. package/src/lib/server/ai-host-permissions.d.ts +46 -0
  572. package/src/lib/server/ai-host-permissions.js +204 -0
  573. package/src/lib/server/ai-host-permissions.js.map +1 -0
  574. package/src/lib/server/ai-insight-answer.d.ts +30 -0
  575. package/src/lib/server/ai-insight-answer.js +83 -0
  576. package/src/lib/server/ai-insight-answer.js.map +1 -0
  577. package/src/lib/server/ai-insight-digest-route.d.ts +30 -0
  578. package/src/lib/server/ai-insight-digest-route.js +156 -0
  579. package/src/lib/server/ai-insight-digest-route.js.map +1 -0
  580. package/src/lib/server/ai-jobs-batch.d.ts +48 -0
  581. package/src/lib/server/ai-jobs-batch.js +306 -0
  582. package/src/lib/server/ai-jobs-batch.js.map +1 -0
  583. package/src/lib/server/ai-jobs-beat-route.d.ts +36 -0
  584. package/src/lib/server/ai-jobs-beat-route.js +86 -0
  585. package/src/lib/server/ai-jobs-beat-route.js.map +1 -0
  586. package/src/lib/server/ai-jobs-cancel.d.ts +30 -0
  587. package/src/lib/server/ai-jobs-cancel.js +74 -0
  588. package/src/lib/server/ai-jobs-cancel.js.map +1 -0
  589. package/src/lib/server/ai-jobs-events-route.d.ts +31 -0
  590. package/src/lib/server/ai-jobs-events-route.js +51 -0
  591. package/src/lib/server/ai-jobs-events-route.js.map +1 -0
  592. package/src/lib/server/ai-jobs-events.d.ts +55 -0
  593. package/src/lib/server/ai-jobs-events.js +144 -0
  594. package/src/lib/server/ai-jobs-events.js.map +1 -0
  595. package/src/lib/server/ai-jobs-gate.d.ts +47 -0
  596. package/src/lib/server/ai-jobs-gate.js +106 -0
  597. package/src/lib/server/ai-jobs-gate.js.map +1 -0
  598. package/src/lib/server/ai-jobs-resume.d.ts +23 -0
  599. package/src/lib/server/ai-jobs-resume.js +209 -0
  600. package/src/lib/server/ai-jobs-resume.js.map +1 -0
  601. package/src/lib/server/ai-jobs-route.d.ts +32 -0
  602. package/src/lib/server/ai-jobs-route.js +307 -0
  603. package/src/lib/server/ai-jobs-route.js.map +1 -0
  604. package/src/lib/server/ai-models.d.ts +18 -0
  605. package/src/lib/server/ai-models.js +134 -0
  606. package/src/lib/server/ai-models.js.map +1 -0
  607. package/src/lib/server/ai-seo-apply.d.ts +53 -0
  608. package/src/lib/server/ai-seo-apply.js +294 -0
  609. package/src/lib/server/ai-seo-apply.js.map +1 -0
  610. package/src/lib/server/ai-usage.d.ts +18 -0
  611. package/src/lib/server/ai-usage.js +220 -0
  612. package/src/lib/server/ai-usage.js.map +1 -0
  613. package/src/lib/server/assist-chat.d.ts +234 -0
  614. package/src/lib/server/assist-chat.js +1446 -0
  615. package/src/lib/server/assist-chat.js.map +1 -0
  616. package/src/lib/server/assist-edit-applied.d.ts +22 -0
  617. package/src/lib/server/assist-edit-applied.js +239 -0
  618. package/src/lib/server/assist-edit-applied.js.map +1 -0
  619. package/src/lib/server/assist-edit.d.ts +124 -0
  620. package/src/lib/server/assist-edit.js +1000 -0
  621. package/src/lib/server/assist-edit.js.map +1 -0
  622. package/src/lib/server/assist-feedback.d.ts +31 -0
  623. package/src/lib/server/assist-feedback.js +115 -0
  624. package/src/lib/server/assist-feedback.js.map +1 -0
  625. package/src/lib/server/assist-view-context.d.ts +343 -0
  626. package/src/lib/server/assist-view-context.js +690 -0
  627. package/src/lib/server/assist-view-context.js.map +1 -0
  628. package/src/lib/server/billing-credits.d.ts +59 -0
  629. package/src/lib/server/billing-credits.js +146 -0
  630. package/src/lib/server/billing-credits.js.map +1 -0
  631. package/src/lib/server/billing-overage.d.ts +19 -0
  632. package/src/lib/server/billing-overage.js +337 -0
  633. package/src/lib/server/billing-overage.js.map +1 -0
  634. package/src/lib/server.d.ts +32 -0
  635. package/src/lib/server.js +265 -0
  636. package/src/lib/server.js.map +1 -0
  637. package/src/lib/subprocessors.d.ts +18 -0
  638. package/src/lib/subprocessors.js +52 -0
  639. package/src/lib/subprocessors.js.map +1 -0
  640. package/src/lib/tools/ai-component-tool.d.ts +99 -0
  641. package/src/lib/tools/ai-component-tool.js +369 -0
  642. package/src/lib/tools/ai-component-tool.js.map +1 -0
  643. package/src/lib/tools/ai-crm-tool.d.ts +106 -0
  644. package/src/lib/tools/ai-crm-tool.js +488 -0
  645. package/src/lib/tools/ai-crm-tool.js.map +1 -0
  646. package/src/lib/tools/ai-duplicate-resource-tool.d.ts +71 -0
  647. package/src/lib/tools/ai-duplicate-resource-tool.js +164 -0
  648. package/src/lib/tools/ai-duplicate-resource-tool.js.map +1 -0
  649. package/src/lib/tools/ai-experiment-tool.d.ts +40 -0
  650. package/src/lib/tools/ai-experiment-tool.js +155 -0
  651. package/src/lib/tools/ai-experiment-tool.js.map +1 -0
  652. package/src/lib/tools/ai-insight-tool.d.ts +46 -0
  653. package/src/lib/tools/ai-insight-tool.js +200 -0
  654. package/src/lib/tools/ai-insight-tool.js.map +1 -0
  655. package/src/lib/tools/ai-inventory-lookup-tool.d.ts +86 -0
  656. package/src/lib/tools/ai-inventory-lookup-tool.js +164 -0
  657. package/src/lib/tools/ai-inventory-lookup-tool.js.map +1 -0
  658. package/src/lib/tools/ai-products-tool.d.ts +65 -0
  659. package/src/lib/tools/ai-products-tool.js +644 -0
  660. package/src/lib/tools/ai-products-tool.js.map +1 -0
  661. package/src/lib/tools/ai-seo-tool.d.ts +162 -0
  662. package/src/lib/tools/ai-seo-tool.js +546 -0
  663. package/src/lib/tools/ai-seo-tool.js.map +1 -0
  664. package/src/lib/tools/ai-theme-tool.d.ts +101 -0
  665. package/src/lib/tools/ai-theme-tool.js +562 -0
  666. package/src/lib/tools/ai-theme-tool.js.map +1 -0
  667. package/src/lib/tools/ai-workflow-tool.d.ts +166 -0
  668. package/src/lib/tools/ai-workflow-tool.js +860 -0
  669. package/src/lib/tools/ai-workflow-tool.js.map +1 -0
  670. package/src/lib/usage/ai-allotment-alerts.d.ts +72 -0
  671. package/src/lib/usage/ai-allotment-alerts.js +157 -0
  672. package/src/lib/usage/ai-allotment-alerts.js.map +1 -0
  673. package/src/lib/usage/ai-allotments.d.ts +125 -0
  674. package/src/lib/usage/ai-allotments.js +239 -0
  675. package/src/lib/usage/ai-allotments.js.map +1 -0
  676. package/src/lib/usage/ai-model-sample.d.ts +36 -0
  677. package/src/lib/usage/ai-model-sample.js +68 -0
  678. package/src/lib/usage/ai-model-sample.js.map +1 -0
  679. package/src/lib/usage/ai-usage-alerts.d.ts +55 -0
  680. package/src/lib/usage/ai-usage-alerts.js +114 -0
  681. package/src/lib/usage/ai-usage-alerts.js.map +1 -0
  682. package/src/lib/usage/ai-usage-by-user.d.ts +161 -0
  683. package/src/lib/usage/ai-usage-by-user.js +211 -0
  684. package/src/lib/usage/ai-usage-by-user.js.map +1 -0
  685. package/src/lib/usage/ai-usage-eraser.d.ts +29 -0
  686. package/src/lib/usage/ai-usage-eraser.js +40 -0
  687. package/src/lib/usage/ai-usage-eraser.js.map +1 -0
  688. package/src/lib/usage/ai-usage-meter.d.ts +39 -0
  689. package/src/lib/usage/ai-usage-meter.js +85 -0
  690. package/src/lib/usage/ai-usage-meter.js.map +1 -0
  691. package/src/lib/usage/ai-usage-wire.d.ts +184 -0
  692. package/src/lib/usage/ai-usage-wire.js +98 -0
  693. package/src/lib/usage/ai-usage-wire.js.map +1 -0
  694. package/src/lib/usage/assist-ceiling.d.ts +87 -0
  695. package/src/lib/usage/assist-ceiling.js +110 -0
  696. package/src/lib/usage/assist-ceiling.js.map +1 -0
  697. package/src/lib/usage/assist-free-taste.d.ts +225 -0
  698. package/src/lib/usage/assist-free-taste.js +308 -0
  699. package/src/lib/usage/assist-free-taste.js.map +1 -0
  700. package/src/lib/usage/assist-refusals.d.ts +69 -0
  701. package/src/lib/usage/assist-refusals.js +79 -0
  702. package/src/lib/usage/assist-refusals.js.map +1 -0
  703. package/src/lib/usage/assist-signal-mining.d.ts +375 -0
  704. package/src/lib/usage/assist-signal-mining.js +344 -0
  705. package/src/lib/usage/assist-signal-mining.js.map +1 -0
  706. package/src/lib/usage/assist-usage.d.ts +571 -0
  707. package/src/lib/usage/assist-usage.js +978 -0
  708. package/src/lib/usage/assist-usage.js.map +1 -0
  709. package/src/lib/usage/staff-org-ai.d.ts +242 -0
  710. package/src/lib/usage/staff-org-ai.js +173 -0
  711. package/src/lib/usage/staff-org-ai.js.map +1 -0
  712. package/src/lib/usage/staff-org-usage-ai.d.ts +83 -0
  713. package/src/lib/usage/staff-org-usage-ai.js +59 -0
  714. package/src/lib/usage/staff-org-usage-ai.js.map +1 -0
  715. package/src/lib/usage/staff-orgs-ai-spend.d.ts +83 -0
  716. package/src/lib/usage/staff-orgs-ai-spend.js +114 -0
  717. package/src/lib/usage/staff-orgs-ai-spend.js.map +1 -0
@@ -0,0 +1,437 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ 'use client';
17
+ import { _ as _extends } from "@swc/helpers/_/_extends";
18
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
19
+ import { CardDisplay, useConfirmationContext, useLoading } from "@aglyn/shared-ui-jsx";
20
+ import { pluginDocsHelp } from "@aglyn/aglyn/app-utils/docs-help";
21
+ import { useSnackbar } from "@aglyn/shared-ui-snackstack";
22
+ import { Alert, Button, Chip, FormControlLabel, Stack, Switch, TextField, Typography } from "@mui/material";
23
+ import { useCallback, useEffect, useState } from "react";
24
+ import { useUser } from "@aglyn/tenant-feature-instance";
25
+ import { authorizedFetch } from "@aglyn/shared-util-http/authorized-token";
26
+ import { aiAddonName } from "@aglyn/aglyn";
27
+ import { ASSIST_OVERAGE_CAP_CONTROL_LABEL, ASSIST_OVERAGE_CAP_MAX_USD, ASSIST_OVERAGE_CAP_MIN_USD } from "@aglyn/aglyn/app-utils/assist-credits";
28
+ /**
29
+ * The org's own controls on AI assist spend: the hard cap at the band
30
+ * (AGL-2653) and the dollar ceiling on overage (AGL-2898).
31
+ *
32
+ * ## What this card is
33
+ *
34
+ * Credits past a plan's included assist band are SOLD by default, at the
35
+ * plan's per-1,000 rate, the way storage past its band bills by default. This
36
+ * card offers the two controls a customer has over that: a switch that makes
37
+ * the band a wall, so the assistant refuses there and nothing past it is ever
38
+ * billed; and, with the switch off, a monthly ceiling in dollars on the
39
+ * overage the org will buy before the assistant stops. Both are optional and
40
+ * unset unless chosen — the storage cap's siblings, for the same reason a
41
+ * ceiling on metered spend is the END USER's control, offered rather than
42
+ * imposed.
43
+ *
44
+ * ## Why a switch AND a number
45
+ *
46
+ * The switch answers "sell past the band at all?" and needs no figure: the
47
+ * band is the plan's, and a second band here would drift from it. The
48
+ * ceiling answers "and if so, how much?", which is a figure only the customer
49
+ * can name — it is a bound on THEIR invoice, not a quantity the plan sold.
50
+ * The ceiling is offered only while the switch is off, because past a wall
51
+ * there is no overage to bound.
52
+ *
53
+ * ## Why the switch is edited here and enforced there
54
+ *
55
+ * The route owns every refusal: a plan that sells no overage, a value that
56
+ * is not a boolean, a missing permission. This card sends the boolean and
57
+ * renders the route's own answer rather than pre-validating against constants
58
+ * that would then be a second source of truth. The rate it quotes arrives on
59
+ * the same payload, so what the card says the overage costs is what the
60
+ * invoice bills.
61
+ *
62
+ * ## Why turning it OFF is confirmed and turning it ON is not
63
+ *
64
+ * Off is the direction that can raise a bill, so it asks; on never raises
65
+ * one, so it is a plain click. Off is also always available, on any plan and
66
+ * from any state — an org that wants the sale back must not have to argue
67
+ * with a precondition.
68
+ */ /**
69
+ * The card as the Billing → Usage page's plugin band mounts it (AGL-2939):
70
+ * the overage controls under the heading and help the page used to draw
71
+ * around them.
72
+ */ export default function BillingAssistOverageCard(props) {
73
+ return /*#__PURE__*/ _jsx("div", {
74
+ id: "assist-overage",
75
+ children: /*#__PURE__*/ _jsx(CardDisplay, {
76
+ header: 'AI credits overage',
77
+ subheader: 'Extra AI credits past your included band are billed on your ' + 'monthly invoice. Stop at the band, or stop once the overage ' + 'reaches an amount you choose.',
78
+ help: pluginDocsHelp('billing', {
79
+ anchor: '#assist-overage',
80
+ excerpt: 'On a paid plan the assistant keeps answering past your ' + 'included credits and the extra is billed at your plan\'s ' + 'per-1,000 rate, unless you switch on the stop at the included band.'
81
+ }),
82
+ contentGutterX: true,
83
+ contentGutterY: true,
84
+ children: /*#__PURE__*/ _jsx(BillingAssistOverageControls, _extends({}, props))
85
+ })
86
+ });
87
+ }
88
+ export function BillingAssistOverageControls({ orgId, canManage }) {
89
+ const { data: user } = useUser();
90
+ const { enqueueSnackbar } = useSnackbar();
91
+ const { queueLoading } = useLoading();
92
+ const { confirm } = useConfirmationContext();
93
+ const [state, setState] = useState(null);
94
+ const [busy, setBusy] = useState(false);
95
+ /** The ceiling field, as typed; the route validates, this only carries. */ const [capInput, setCapInput] = useState('');
96
+ /**
97
+ * Three outcomes, not two (the AGL-1380 rule). "The assistant keeps going
98
+ * past your band" is a claim about this org's billing settings; rendering
99
+ * it because a request FAILED would tell an org that asked to be stopped
100
+ * that it had not.
101
+ */ const [loadState, setLoadState] = useState('pending');
102
+ /** Bumped by Retry, and after every write, to re-run the load effect. */ const [retryNonce, setRetryNonce] = useState(0);
103
+ const sendRequest = useCallback(async (body)=>{
104
+ const response = await authorizedFetch(user, '/api/ai/billing/overage', {
105
+ method: 'POST',
106
+ headers: {
107
+ 'Content-Type': 'application/json'
108
+ },
109
+ body: JSON.stringify(_extends({
110
+ orgId
111
+ }, body))
112
+ });
113
+ const payload = await response.json().catch(()=>({}));
114
+ if (!response.ok) {
115
+ var _ref;
116
+ // The route's own sentence, verbatim: its 409 explains why a plan
117
+ // with no rate has nothing to switch, which is more specific than
118
+ // anything this card could invent.
119
+ enqueueSnackbar((_ref = payload == null ? void 0 : payload.error) != null ? _ref : 'AI assist setting request failed', {
120
+ variant: 'warning',
121
+ persist: false
122
+ });
123
+ return {
124
+ ok: false,
125
+ payload
126
+ };
127
+ }
128
+ return {
129
+ ok: true,
130
+ payload
131
+ };
132
+ }, [
133
+ user,
134
+ orgId,
135
+ enqueueSnackbar
136
+ ]);
137
+ useEffect(()=>{
138
+ if (!orgId || !user) return;
139
+ let cancelled = false;
140
+ setLoadState('pending');
141
+ sendRequest({
142
+ action: 'get'
143
+ }).then((outcome)=>{
144
+ if (cancelled) return;
145
+ if (!outcome.ok) return void setLoadState('error');
146
+ const next = outcome.payload;
147
+ // A card that cannot name the price must not quote one. The rate
148
+ // appears in the sentence beside the switch whenever overage is
149
+ // sold, and a defaulted 0 would tell a person about to leave the
150
+ // switch off that the extra costs "$0.00 per 1,000". A payload that
151
+ // says overage is sold but cannot say at what is a LOAD FAILURE.
152
+ if (typeof (next == null ? void 0 : next.hardCap) !== 'boolean' || typeof (next == null ? void 0 : next.sellsOverage) !== 'boolean' || next.sellsOverage && (!Number.isFinite(Number(next.overageRateUsdPer1k)) || !Number.isFinite(Number(next.bandCredits)))) {
153
+ return void setLoadState('error');
154
+ }
155
+ // The ceiling half of the payload is read strictly, the way the
156
+ // resolver reads the stored field: anything that is not a finite
157
+ // number is NO ceiling, never a ceiling of `undefined` that renders
158
+ // as "$NaN". The label and bounds fall back to the same constants the
159
+ // route serves them from.
160
+ const capUsd = typeof next.capUsd === 'number' && Number.isFinite(next.capUsd) ? next.capUsd : null;
161
+ setState(_extends({}, next, {
162
+ capUsd,
163
+ capLabel: typeof next.capLabel === 'string' && next.capLabel ? next.capLabel : ASSIST_OVERAGE_CAP_CONTROL_LABEL,
164
+ minCapUsd: Number.isFinite(Number(next.minCapUsd)) ? Number(next.minCapUsd) : ASSIST_OVERAGE_CAP_MIN_USD,
165
+ maxCapUsd: Number.isFinite(Number(next.maxCapUsd)) ? Number(next.maxCapUsd) : ASSIST_OVERAGE_CAP_MAX_USD
166
+ }));
167
+ setCapInput(capUsd === null ? '' : String(capUsd));
168
+ setLoadState('loaded');
169
+ })// A rejected fetch — offline, a wedged route — never reached the
170
+ // snackbar inside the request, so this is the only place it can become
171
+ // something the card renders.
172
+ .catch(()=>{
173
+ if (!cancelled) setLoadState('error');
174
+ });
175
+ return ()=>{
176
+ cancelled = true;
177
+ };
178
+ }, [
179
+ orgId,
180
+ user,
181
+ sendRequest,
182
+ retryNonce
183
+ ]);
184
+ const setHardCap = useCallback(async (hardCap)=>{
185
+ const rate = state == null ? void 0 : state.overageRateUsdPer1k;
186
+ if (!hardCap) {
187
+ // The loading overlay must drop BEFORE the confirm dialog opens — it
188
+ // sits above the dialog and swallows the Confirm click (AGL-535). So
189
+ // the confirm runs first and `queueLoading` only wraps the write.
190
+ const accepted = await confirm({
191
+ title: 'Keep AI assist going past your included credits?',
192
+ description: 'The assistant will keep answering once your included credits ' + 'are used, and the extra credits will be billed on your monthly ' + `invoice${rate != null ? ` at $${rate.toFixed(2)} per 1,000` : ''}. You can turn the stop back on at any time.`,
193
+ confirmationText: 'Keep going'
194
+ }).then(()=>true).catch(()=>false);
195
+ if (!accepted) return;
196
+ }
197
+ setBusy(true);
198
+ const dequeue = queueLoading();
199
+ try {
200
+ const outcome = await sendRequest({
201
+ action: 'setHardCap',
202
+ hardCap
203
+ });
204
+ if (!outcome.ok) return;
205
+ enqueueSnackbar(hardCap ? 'AI assist will stop at your included credits. Nothing past ' + 'the band is billed.' : 'AI assist keeps going past your included credits' + (rate != null ? `, billed at $${rate.toFixed(2)} per 1,000.` : '.'), {
206
+ variant: 'success',
207
+ persist: false
208
+ });
209
+ setRetryNonce((nonce)=>nonce + 1);
210
+ } catch (unused) {
211
+ enqueueSnackbar('Could not update your AI assist setting', {
212
+ variant: 'warning',
213
+ persist: false
214
+ });
215
+ } finally{
216
+ dequeue();
217
+ setBusy(false);
218
+ }
219
+ }, [
220
+ state,
221
+ confirm,
222
+ queueLoading,
223
+ sendRequest,
224
+ enqueueSnackbar
225
+ ]);
226
+ /**
227
+ * Set or clear the ceiling. Neither direction asks first: setting one
228
+ * only ever lowers a bill, and clearing one returns the org to the
229
+ * open-ended overage the switch already told it about. The route owns the
230
+ * range check, so a figure it refuses comes back as its own sentence.
231
+ */ const setCap = useCallback(async (capUsd)=>{
232
+ setBusy(true);
233
+ const dequeue = queueLoading();
234
+ try {
235
+ const outcome = await sendRequest({
236
+ action: 'setCap',
237
+ capUsd
238
+ });
239
+ if (!outcome.ok) return;
240
+ enqueueSnackbar(capUsd === null ? 'AI assist overage ceiling removed. Extra credits keep billing ' + 'at your plan’s rate with no monthly stop.' : `AI assist will stop once this month’s overage reaches ` + `$${capUsd.toFixed(2)}.`, {
241
+ variant: 'success',
242
+ persist: false
243
+ });
244
+ setRetryNonce((nonce)=>nonce + 1);
245
+ } catch (unused) {
246
+ enqueueSnackbar('Could not update your AI assist ceiling', {
247
+ variant: 'warning',
248
+ persist: false
249
+ });
250
+ } finally{
251
+ dequeue();
252
+ setBusy(false);
253
+ }
254
+ }, [
255
+ queueLoading,
256
+ sendRequest,
257
+ enqueueSnackbar
258
+ ]);
259
+ if (loadState === 'pending') {
260
+ return /*#__PURE__*/ _jsx(Typography, {
261
+ variant: "body2",
262
+ color: "text.secondary",
263
+ children: "Loading your AI assist settings…"
264
+ });
265
+ }
266
+ if (loadState === 'error' || !state) {
267
+ return /*#__PURE__*/ _jsx(Alert, {
268
+ severity: "warning",
269
+ action: /*#__PURE__*/ _jsx(Button, {
270
+ size: "small",
271
+ color: "inherit",
272
+ onClick: ()=>setRetryNonce((nonce)=>nonce + 1),
273
+ children: "Retry"
274
+ }),
275
+ children: "We couldn’t load your AI assist settings. Nothing has changed."
276
+ });
277
+ }
278
+ const { hardCap, capUsd, bandCredits, overageRateUsdPer1k, sellsOverage, label, capLabel, minCapUsd, maxCapUsd } = state;
279
+ const band = bandCredits == null ? null : Math.round(bandCredits);
280
+ const rate = overageRateUsdPer1k == null ? null : overageRateUsdPer1k.toFixed(2);
281
+ // The ceiling is a bound on overage, and overage exists only while the
282
+ // switch is off on a plan that sells past its band. It stays reachable to
283
+ // CLEAR whenever one is set, so an org that turned the switch on afterwards
284
+ // is not left carrying a figure it cannot remove.
285
+ const offersCeiling = sellsOverage && !hardCap;
286
+ const showsCeiling = offersCeiling || capUsd !== null;
287
+ // A plan that sells no overage has nothing for the switch to stop, so
288
+ // there is nothing to configure. Say that plainly rather than rendering a
289
+ // switch the route would refuse with a 409 — but keep the switch reachable
290
+ // for an org that turned it on and then moved to a plan that sells none,
291
+ // so it can turn it off.
292
+ const nothingToStop = !sellsOverage && !hardCap;
293
+ return /*#__PURE__*/ _jsxs(Stack, {
294
+ spacing: 2,
295
+ children: [
296
+ /*#__PURE__*/ _jsxs(Stack, {
297
+ direction: "row",
298
+ spacing: 1,
299
+ sx: {
300
+ flexWrap: 'wrap',
301
+ gap: 1
302
+ },
303
+ children: [
304
+ /*#__PURE__*/ _jsx(Chip, {
305
+ label: hardCap ? 'Stops at the included band' : nothingToStop ? band === null ? 'No AI assist credits' : 'Included credits only' : capUsd !== null ? `Stops at $${capUsd.toFixed(2)} of overage` : 'No stop — extra credits bill',
306
+ size: "small",
307
+ color: hardCap || capUsd !== null ? 'primary' : 'default'
308
+ }),
309
+ band !== null ? /*#__PURE__*/ _jsx(Chip, {
310
+ label: `${band.toLocaleString()} credits/mo included`,
311
+ size: "small"
312
+ }) : null
313
+ ]
314
+ }),
315
+ nothingToStop && band === null ? // No band at all, and nothing ever billed for AI, so neither stop
316
+ // applies — the switch has no band to stop at and the ceiling has no
317
+ // overage to bound. Since AGL-3203 every plan row carries a band, so
318
+ // this is an org whose band was overridden to zero.
319
+ /*#__PURE__*/ _jsxs(Alert, {
320
+ severity: "info",
321
+ children: [
322
+ "Your plan includes no AI credits and is never charged for any, so there is no band to stop at, no overage to put a dollar ceiling on, and nothing to configure here. Upgrade above, or add",
323
+ ' ',
324
+ aiAddonName(),
325
+ " on a paid plan, to get a band."
326
+ ]
327
+ }) : nothingToStop ? // Enterprise: a band, and no rate to sell past it at. The assistant
328
+ // stops at the band on its own and nothing is ever billed for it.
329
+ /*#__PURE__*/ _jsxs(Alert, {
330
+ severity: "info",
331
+ children: [
332
+ "Your plan includes ",
333
+ /*#__PURE__*/ _jsx("strong", {
334
+ children: band == null ? void 0 : band.toLocaleString()
335
+ }),
336
+ " AI assist credits a month and sells none past them: the assistant stops at the included band and you are ",
337
+ /*#__PURE__*/ _jsx("strong", {
338
+ children: "never charged"
339
+ }),
340
+ " for AI assist, so there is nothing to switch."
341
+ ]
342
+ }) : /*#__PURE__*/ _jsxs(_Fragment, {
343
+ children: [
344
+ /*#__PURE__*/ _jsx(Typography, {
345
+ variant: "body2",
346
+ color: "text.secondary",
347
+ children: sellsOverage ? `Your plan includes ${band == null ? void 0 : band.toLocaleString()} AI assist credits ` + `a month. Past that, the assistant keeps answering and the ` + `extra credits are billed at $${rate} per 1,000 on your ` + `monthly invoice.` : `Your plan no longer sells AI assist credits past its band, ` + `so this switch is not doing anything. You can safely turn ` + `it off.`
348
+ }),
349
+ sellsOverage ? /*#__PURE__*/ _jsx(Typography, {
350
+ variant: "body2",
351
+ color: "text.secondary",
352
+ children: "If you would rather the assistant stopped at the included band, turn this on. This is optional — most people leave it off."
353
+ }) : null,
354
+ /*#__PURE__*/ _jsxs(Stack, {
355
+ spacing: 0.5,
356
+ children: [
357
+ /*#__PURE__*/ _jsx(FormControlLabel, {
358
+ control: /*#__PURE__*/ _jsx(Switch, {
359
+ checked: hardCap,
360
+ disabled: !canManage || busy || !hardCap && !sellsOverage,
361
+ onChange: (event)=>void setHardCap(event.target.checked)
362
+ }),
363
+ label: label
364
+ }),
365
+ /*#__PURE__*/ _jsx(Typography, {
366
+ variant: "caption",
367
+ color: "text.secondary",
368
+ children: hardCap ? `On: the assistant stops once your included credits are ` + `used, and you are never billed for AI assist.` + (sellsOverage ? ` Turn it off to keep going at $${rate} per 1,000 credits.` : '') : `Off: extra credits past the included band are billed at ` + `$${rate} per 1,000.`
369
+ })
370
+ ]
371
+ }),
372
+ showsCeiling ? /*#__PURE__*/ _jsxs(Stack, {
373
+ spacing: 1,
374
+ children: [
375
+ /*#__PURE__*/ _jsx(Typography, {
376
+ variant: "body2",
377
+ color: "text.secondary",
378
+ children: offersCeiling ? capUsd === null ? 'Or keep going, but only so far: set a monthly ceiling ' + 'on the extra credits you will pay for. The assistant ' + 'stops for the rest of the month once this month’s ' + 'overage reaches it. Optional, and separate from the ' + 'switch above.' : `The assistant stops for the rest of the month once ` + `this month’s overage reaches $${capUsd.toFixed(2)}. ` + `Raise, lower or remove the ceiling at any time.` : `A ceiling of $${(capUsd != null ? capUsd : 0).toFixed(2)} is set, but ` + `with the assistant stopping at the included band there ` + `is no overage for it to bound. You can safely remove it.`
379
+ }),
380
+ /*#__PURE__*/ _jsxs(Stack, {
381
+ direction: "row",
382
+ spacing: 2,
383
+ sx: {
384
+ alignItems: 'flex-start',
385
+ flexWrap: 'wrap',
386
+ rowGap: 2
387
+ },
388
+ children: [
389
+ offersCeiling ? /*#__PURE__*/ _jsxs(_Fragment, {
390
+ children: [
391
+ /*#__PURE__*/ _jsx(TextField, {
392
+ label: capLabel,
393
+ type: "number",
394
+ size: "small",
395
+ value: capInput,
396
+ disabled: !canManage || busy,
397
+ onChange: (event)=>setCapInput(event.target.value),
398
+ slotProps: {
399
+ htmlInput: {
400
+ min: minCapUsd,
401
+ max: maxCapUsd,
402
+ step: 1
403
+ }
404
+ },
405
+ helperText: `In USD, between $${minCapUsd} and $${maxCapUsd.toLocaleString()}.`
406
+ }),
407
+ /*#__PURE__*/ _jsx(Button, {
408
+ variant: "outlined",
409
+ disabled: !canManage || busy || capInput.trim() === '',
410
+ onClick: ()=>void setCap(Number(capInput)),
411
+ children: capUsd === null ? 'Set a monthly ceiling' : 'Save ceiling'
412
+ })
413
+ ]
414
+ }) : null,
415
+ capUsd !== null ? /*#__PURE__*/ _jsx(Button, {
416
+ variant: "text",
417
+ color: "warning",
418
+ disabled: !canManage || busy,
419
+ onClick: ()=>void setCap(null),
420
+ children: "Remove ceiling"
421
+ }) : null
422
+ ]
423
+ })
424
+ ]
425
+ }) : null
426
+ ]
427
+ }),
428
+ !canManage ? /*#__PURE__*/ _jsx(Typography, {
429
+ variant: "caption",
430
+ color: "text.secondary",
431
+ children: "You need the Manage billing permission to change this."
432
+ }) : null
433
+ ]
434
+ });
435
+ }
436
+
437
+ //# sourceMappingURL=billing-assist-overage-card.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/ai/src/lib/components/billing-assist-overage-card.component.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'use client'\n\nimport { CardDisplay, useConfirmationContext, useLoading } from '@aglyn/shared-ui-jsx'\nimport { pluginDocsHelp } from '@aglyn/aglyn/app-utils/docs-help'\nimport { useSnackbar } from '@aglyn/shared-ui-snackstack'\nimport {\n Alert,\n Button,\n Chip,\n FormControlLabel,\n Stack,\n Switch,\n TextField,\n Typography,\n} from '@mui/material'\nimport { useCallback, useEffect, useState } from 'react'\nimport { useUser } from '@aglyn/tenant-feature-instance'\nimport { authorizedFetch } from '@aglyn/shared-util-http/authorized-token'\nimport { aiAddonName } from '@aglyn/aglyn'\nimport {\n ASSIST_OVERAGE_CAP_CONTROL_LABEL,\n ASSIST_OVERAGE_CAP_MAX_USD,\n ASSIST_OVERAGE_CAP_MIN_USD,\n} from '@aglyn/aglyn/app-utils/assist-credits'\n\n/** The `get` payload of `/api/billing/assist-overage`. */\ninterface AssistOverageState {\n /** Whether the org asked to be stopped at its band. Absent by default. */\n hardCap: boolean\n /** The org's ceiling on this month's overage in USD, or `null` for none. */\n capUsd: number | null\n /** The plan's included credits a month, or `null` where it sells none. */\n bandCredits: number | null\n /** The per-1,000 rate credits past the band bill at, or `null`. */\n overageRateUsdPer1k: number | null\n /** True when there is a band AND a rate to sell past it at. */\n sellsOverage: boolean\n /** The switch's label, served so the refusal and the switch share it. */\n label: string\n /** The ceiling's label, served for the same reason. */\n capLabel: string\n /** The range the route accepts for the ceiling. */\n minCapUsd: number\n maxCapUsd: number\n}\n\nexport interface BillingAssistOverageCardProps {\n orgId?: string | null\n /** billing.manage: the switch acts; view-only otherwise. */\n canManage: boolean\n}\n\n/**\n * The org's own controls on AI assist spend: the hard cap at the band\n * (AGL-2653) and the dollar ceiling on overage (AGL-2898).\n *\n * ## What this card is\n *\n * Credits past a plan's included assist band are SOLD by default, at the\n * plan's per-1,000 rate, the way storage past its band bills by default. This\n * card offers the two controls a customer has over that: a switch that makes\n * the band a wall, so the assistant refuses there and nothing past it is ever\n * billed; and, with the switch off, a monthly ceiling in dollars on the\n * overage the org will buy before the assistant stops. Both are optional and\n * unset unless chosen — the storage cap's siblings, for the same reason a\n * ceiling on metered spend is the END USER's control, offered rather than\n * imposed.\n *\n * ## Why a switch AND a number\n *\n * The switch answers \"sell past the band at all?\" and needs no figure: the\n * band is the plan's, and a second band here would drift from it. The\n * ceiling answers \"and if so, how much?\", which is a figure only the customer\n * can name — it is a bound on THEIR invoice, not a quantity the plan sold.\n * The ceiling is offered only while the switch is off, because past a wall\n * there is no overage to bound.\n *\n * ## Why the switch is edited here and enforced there\n *\n * The route owns every refusal: a plan that sells no overage, a value that\n * is not a boolean, a missing permission. This card sends the boolean and\n * renders the route's own answer rather than pre-validating against constants\n * that would then be a second source of truth. The rate it quotes arrives on\n * the same payload, so what the card says the overage costs is what the\n * invoice bills.\n *\n * ## Why turning it OFF is confirmed and turning it ON is not\n *\n * Off is the direction that can raise a bill, so it asks; on never raises\n * one, so it is a plain click. Off is also always available, on any plan and\n * from any state — an org that wants the sale back must not have to argue\n * with a precondition.\n */\n/**\n * The card as the Billing → Usage page's plugin band mounts it (AGL-2939):\n * the overage controls under the heading and help the page used to draw\n * around them.\n */\nexport default function BillingAssistOverageCard(props: BillingAssistOverageCardProps) {\n return (\n <div id=\"assist-overage\">\n <CardDisplay\n header={'AI credits overage'}\n subheader={\n 'Extra AI credits past your included band are billed on your ' +\n 'monthly invoice. Stop at the band, or stop once the overage ' +\n 'reaches an amount you choose.'\n }\n help={pluginDocsHelp('billing', {\n anchor: '#assist-overage',\n excerpt:\n 'On a paid plan the assistant keeps answering past your ' +\n 'included credits and the extra is billed at your plan\\'s ' +\n 'per-1,000 rate, unless you switch on the stop at the included band.',\n })}\n contentGutterX\n contentGutterY\n >\n <BillingAssistOverageControls {...props} />\n </CardDisplay>\n </div>\n )\n}\n\nexport function BillingAssistOverageControls({\n orgId,\n canManage,\n}: BillingAssistOverageCardProps) {\n const { data: user } = useUser()\n const { enqueueSnackbar } = useSnackbar()\n const { queueLoading } = useLoading()\n const { confirm } = useConfirmationContext()\n const [state, setState] = useState<AssistOverageState | null>(null)\n const [busy, setBusy] = useState(false)\n /** The ceiling field, as typed; the route validates, this only carries. */\n const [capInput, setCapInput] = useState('')\n /**\n * Three outcomes, not two (the AGL-1380 rule). \"The assistant keeps going\n * past your band\" is a claim about this org's billing settings; rendering\n * it because a request FAILED would tell an org that asked to be stopped\n * that it had not.\n */\n const [loadState, setLoadState] = useState<'pending' | 'error' | 'loaded'>(\n 'pending',\n )\n /** Bumped by Retry, and after every write, to re-run the load effect. */\n const [retryNonce, setRetryNonce] = useState(0)\n\n const sendRequest = useCallback(\n async (\n body: Record<string, unknown>,\n ): Promise<{ ok: boolean; payload?: any }> => {\n const response = await authorizedFetch(\n user,\n '/api/ai/billing/overage',\n {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ orgId, ...body }),\n },\n )\n const payload = await response.json().catch(() => ({}))\n if (!response.ok) {\n // The route's own sentence, verbatim: its 409 explains why a plan\n // with no rate has nothing to switch, which is more specific than\n // anything this card could invent.\n enqueueSnackbar(payload?.error ?? 'AI assist setting request failed', {\n variant: 'warning',\n persist: false,\n })\n return { ok: false, payload }\n }\n return { ok: true, payload }\n },\n [user, orgId, enqueueSnackbar],\n )\n\n useEffect(() => {\n if (!orgId || !user) return\n let cancelled = false\n setLoadState('pending')\n sendRequest({ action: 'get' })\n .then((outcome) => {\n if (cancelled) return\n if (!outcome.ok) return void setLoadState('error')\n const next = outcome.payload as AssistOverageState\n // A card that cannot name the price must not quote one. The rate\n // appears in the sentence beside the switch whenever overage is\n // sold, and a defaulted 0 would tell a person about to leave the\n // switch off that the extra costs \"$0.00 per 1,000\". A payload that\n // says overage is sold but cannot say at what is a LOAD FAILURE.\n if (\n typeof next?.hardCap !== 'boolean' ||\n typeof next?.sellsOverage !== 'boolean' ||\n (next.sellsOverage &&\n (!Number.isFinite(Number(next.overageRateUsdPer1k)) ||\n !Number.isFinite(Number(next.bandCredits))))\n ) {\n return void setLoadState('error')\n }\n // The ceiling half of the payload is read strictly, the way the\n // resolver reads the stored field: anything that is not a finite\n // number is NO ceiling, never a ceiling of `undefined` that renders\n // as \"$NaN\". The label and bounds fall back to the same constants the\n // route serves them from.\n const capUsd =\n typeof next.capUsd === 'number' && Number.isFinite(next.capUsd)\n ? next.capUsd\n : null\n setState({\n ...next,\n capUsd,\n capLabel:\n typeof next.capLabel === 'string' && next.capLabel\n ? next.capLabel\n : ASSIST_OVERAGE_CAP_CONTROL_LABEL,\n minCapUsd: Number.isFinite(Number(next.minCapUsd))\n ? Number(next.minCapUsd)\n : ASSIST_OVERAGE_CAP_MIN_USD,\n maxCapUsd: Number.isFinite(Number(next.maxCapUsd))\n ? Number(next.maxCapUsd)\n : ASSIST_OVERAGE_CAP_MAX_USD,\n })\n setCapInput(capUsd === null ? '' : String(capUsd))\n setLoadState('loaded')\n })\n // A rejected fetch — offline, a wedged route — never reached the\n // snackbar inside the request, so this is the only place it can become\n // something the card renders.\n .catch(() => {\n if (!cancelled) setLoadState('error')\n })\n return () => {\n cancelled = true\n }\n }, [orgId, user, sendRequest, retryNonce])\n\n const setHardCap = useCallback(\n async (hardCap: boolean) => {\n const rate = state?.overageRateUsdPer1k\n if (!hardCap) {\n // The loading overlay must drop BEFORE the confirm dialog opens — it\n // sits above the dialog and swallows the Confirm click (AGL-535). So\n // the confirm runs first and `queueLoading` only wraps the write.\n const accepted = await confirm({\n title: 'Keep AI assist going past your included credits?',\n description:\n 'The assistant will keep answering once your included credits ' +\n 'are used, and the extra credits will be billed on your monthly ' +\n `invoice${\n rate != null ? ` at $${rate.toFixed(2)} per 1,000` : ''\n }. You can turn the stop back on at any time.`,\n confirmationText: 'Keep going',\n })\n .then(() => true)\n .catch(() => false)\n if (!accepted) return\n }\n\n setBusy(true)\n const dequeue = queueLoading()\n try {\n const outcome = await sendRequest({ action: 'setHardCap', hardCap })\n if (!outcome.ok) return\n enqueueSnackbar(\n hardCap\n ? 'AI assist will stop at your included credits. Nothing past ' +\n 'the band is billed.'\n : 'AI assist keeps going past your included credits' +\n (rate != null\n ? `, billed at $${rate.toFixed(2)} per 1,000.`\n : '.'),\n { variant: 'success', persist: false },\n )\n setRetryNonce((nonce) => nonce + 1)\n } catch {\n enqueueSnackbar('Could not update your AI assist setting', {\n variant: 'warning',\n persist: false,\n })\n } finally {\n dequeue()\n setBusy(false)\n }\n },\n [state, confirm, queueLoading, sendRequest, enqueueSnackbar],\n )\n\n /**\n * Set or clear the ceiling. Neither direction asks first: setting one\n * only ever lowers a bill, and clearing one returns the org to the\n * open-ended overage the switch already told it about. The route owns the\n * range check, so a figure it refuses comes back as its own sentence.\n */\n const setCap = useCallback(\n async (capUsd: number | null) => {\n setBusy(true)\n const dequeue = queueLoading()\n try {\n const outcome = await sendRequest({ action: 'setCap', capUsd })\n if (!outcome.ok) return\n enqueueSnackbar(\n capUsd === null\n ? 'AI assist overage ceiling removed. Extra credits keep billing ' +\n 'at your plan’s rate with no monthly stop.'\n : `AI assist will stop once this month’s overage reaches ` +\n `$${capUsd.toFixed(2)}.`,\n { variant: 'success', persist: false },\n )\n setRetryNonce((nonce) => nonce + 1)\n } catch {\n enqueueSnackbar('Could not update your AI assist ceiling', {\n variant: 'warning',\n persist: false,\n })\n } finally {\n dequeue()\n setBusy(false)\n }\n },\n [queueLoading, sendRequest, enqueueSnackbar],\n )\n\n if (loadState === 'pending') {\n return (\n <Typography variant=\"body2\" color=\"text.secondary\">\n Loading your AI assist settings…\n </Typography>\n )\n }\n\n if (loadState === 'error' || !state) {\n return (\n <Alert\n severity=\"warning\"\n action={\n <Button\n size=\"small\"\n color=\"inherit\"\n onClick={() => setRetryNonce((nonce) => nonce + 1)}\n >\n Retry\n </Button>\n }\n >\n We couldn’t load your AI assist settings. Nothing has changed.\n </Alert>\n )\n }\n\n const {\n hardCap,\n capUsd,\n bandCredits,\n overageRateUsdPer1k,\n sellsOverage,\n label,\n capLabel,\n minCapUsd,\n maxCapUsd,\n } = state\n const band = bandCredits == null ? null : Math.round(bandCredits)\n const rate = overageRateUsdPer1k == null ? null : overageRateUsdPer1k.toFixed(2)\n // The ceiling is a bound on overage, and overage exists only while the\n // switch is off on a plan that sells past its band. It stays reachable to\n // CLEAR whenever one is set, so an org that turned the switch on afterwards\n // is not left carrying a figure it cannot remove.\n const offersCeiling = sellsOverage && !hardCap\n const showsCeiling = offersCeiling || capUsd !== null\n\n // A plan that sells no overage has nothing for the switch to stop, so\n // there is nothing to configure. Say that plainly rather than rendering a\n // switch the route would refuse with a 409 — but keep the switch reachable\n // for an org that turned it on and then moved to a plan that sells none,\n // so it can turn it off.\n const nothingToStop = !sellsOverage && !hardCap\n\n return (\n <Stack spacing={2}>\n <Stack direction=\"row\" spacing={1} sx={{ flexWrap: 'wrap', gap: 1 }}>\n <Chip\n label={\n hardCap\n ? 'Stops at the included band'\n : nothingToStop\n ? band === null\n ? 'No AI assist credits'\n : 'Included credits only'\n : capUsd !== null\n ? `Stops at $${capUsd.toFixed(2)} of overage`\n : 'No stop — extra credits bill'\n }\n size=\"small\"\n color={hardCap || capUsd !== null ? 'primary' : 'default'}\n />\n {band !== null ? (\n <Chip label={`${band.toLocaleString()} credits/mo included`} size=\"small\" />\n ) : null}\n </Stack>\n\n {nothingToStop && band === null ? (\n // No band at all, and nothing ever billed for AI, so neither stop\n // applies — the switch has no band to stop at and the ceiling has no\n // overage to bound. Since AGL-3203 every plan row carries a band, so\n // this is an org whose band was overridden to zero.\n <Alert severity=\"info\">\n Your plan includes no AI credits and is never charged for any, so\n there is no band to stop at, no overage to put a dollar ceiling on,\n and nothing to configure here. Upgrade above, or add{' '}\n {aiAddonName()} on a paid plan, to get a band.\n </Alert>\n ) : nothingToStop ? (\n // Enterprise: a band, and no rate to sell past it at. The assistant\n // stops at the band on its own and nothing is ever billed for it.\n <Alert severity=\"info\">\n Your plan includes <strong>{band?.toLocaleString()}</strong> AI assist\n credits a month and sells none past them: the assistant stops at the\n included band and you are <strong>never charged</strong> for AI\n assist, so there is nothing to switch.\n </Alert>\n ) : (\n <>\n <Typography variant=\"body2\" color=\"text.secondary\">\n {sellsOverage\n ? `Your plan includes ${band?.toLocaleString()} AI assist credits ` +\n `a month. Past that, the assistant keeps answering and the ` +\n `extra credits are billed at $${rate} per 1,000 on your ` +\n `monthly invoice.`\n : `Your plan no longer sells AI assist credits past its band, ` +\n `so this switch is not doing anything. You can safely turn ` +\n `it off.`}\n </Typography>\n {sellsOverage ? (\n <Typography variant=\"body2\" color=\"text.secondary\">\n If you would rather the assistant stopped at the included band,\n turn this on. This is optional — most people leave it off.\n </Typography>\n ) : null}\n <Stack spacing={0.5}>\n <FormControlLabel\n control={\n <Switch\n checked={hardCap}\n disabled={!canManage || busy || (!hardCap && !sellsOverage)}\n onChange={(event) => void setHardCap(event.target.checked)}\n />\n }\n label={label}\n />\n <Typography variant=\"caption\" color=\"text.secondary\">\n {hardCap\n ? `On: the assistant stops once your included credits are ` +\n `used, and you are never billed for AI assist.` +\n (sellsOverage\n ? ` Turn it off to keep going at $${rate} per 1,000 credits.`\n : '')\n : `Off: extra credits past the included band are billed at ` +\n `$${rate} per 1,000.`}\n </Typography>\n </Stack>\n\n {showsCeiling ? (\n <Stack spacing={1}>\n <Typography variant=\"body2\" color=\"text.secondary\">\n {offersCeiling\n ? capUsd === null\n ? 'Or keep going, but only so far: set a monthly ceiling ' +\n 'on the extra credits you will pay for. The assistant ' +\n 'stops for the rest of the month once this month’s ' +\n 'overage reaches it. Optional, and separate from the ' +\n 'switch above.'\n : `The assistant stops for the rest of the month once ` +\n `this month’s overage reaches $${capUsd.toFixed(2)}. ` +\n `Raise, lower or remove the ceiling at any time.`\n : `A ceiling of $${(capUsd ?? 0).toFixed(2)} is set, but ` +\n `with the assistant stopping at the included band there ` +\n `is no overage for it to bound. You can safely remove it.`}\n </Typography>\n <Stack\n direction=\"row\"\n spacing={2}\n sx={{ alignItems: 'flex-start', flexWrap: 'wrap', rowGap: 2 }}\n >\n {offersCeiling ? (\n <>\n <TextField\n label={capLabel}\n type=\"number\"\n size=\"small\"\n value={capInput}\n disabled={!canManage || busy}\n onChange={(event) => setCapInput(event.target.value)}\n slotProps={{\n htmlInput: { min: minCapUsd, max: maxCapUsd, step: 1 },\n }}\n helperText={`In USD, between $${minCapUsd} and $${maxCapUsd.toLocaleString()}.`}\n />\n <Button\n variant=\"outlined\"\n disabled={!canManage || busy || capInput.trim() === ''}\n onClick={() => void setCap(Number(capInput))}\n >\n {capUsd === null ? 'Set a monthly ceiling' : 'Save ceiling'}\n </Button>\n </>\n ) : null}\n {capUsd !== null ? (\n <Button\n variant=\"text\"\n color=\"warning\"\n disabled={!canManage || busy}\n onClick={() => void setCap(null)}\n >\n Remove ceiling\n </Button>\n ) : null}\n </Stack>\n </Stack>\n ) : null}\n </>\n )}\n\n {!canManage ? (\n <Typography variant=\"caption\" color=\"text.secondary\">\n You need the Manage billing permission to change this.\n </Typography>\n ) : null}\n </Stack>\n )\n}\n"],"names":["CardDisplay","useConfirmationContext","useLoading","pluginDocsHelp","useSnackbar","Alert","Button","Chip","FormControlLabel","Stack","Switch","TextField","Typography","useCallback","useEffect","useState","useUser","authorizedFetch","aiAddonName","ASSIST_OVERAGE_CAP_CONTROL_LABEL","ASSIST_OVERAGE_CAP_MAX_USD","ASSIST_OVERAGE_CAP_MIN_USD","BillingAssistOverageCard","props","div","id","header","subheader","help","anchor","excerpt","contentGutterX","contentGutterY","BillingAssistOverageControls","orgId","canManage","data","user","enqueueSnackbar","queueLoading","confirm","state","setState","busy","setBusy","capInput","setCapInput","loadState","setLoadState","retryNonce","setRetryNonce","sendRequest","body","response","method","headers","JSON","stringify","payload","json","catch","ok","error","variant","persist","cancelled","action","then","outcome","next","hardCap","sellsOverage","Number","isFinite","overageRateUsdPer1k","bandCredits","capUsd","capLabel","minCapUsd","maxCapUsd","String","setHardCap","rate","accepted","title","description","toFixed","confirmationText","dequeue","nonce","setCap","color","severity","size","onClick","label","band","Math","round","offersCeiling","showsCeiling","nothingToStop","spacing","direction","sx","flexWrap","gap","toLocaleString","strong","control","checked","disabled","onChange","event","target","alignItems","rowGap","type","value","slotProps","htmlInput","min","max","step","helperText","trim"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;AAEA,SAASA,WAAW,EAAEC,sBAAsB,EAAEC,UAAU,QAAQ,uBAAsB;AACtF,SAASC,cAAc,QAAQ,mCAAkC;AACjE,SA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,EAAE,CAACV,iBAAAA,SAAU,GAAGU,OAAO,CAAC,GAAG,aAAa,CAAC,GACxD,CAAC,uDAAuD,CAAC,GACzD,CAAC,wDAAwD,CAAC;;0CAEhE,MAAC7E;gCACC8F,WAAU;gCACVD,SAAS;gCACTE,IAAI;oCAAEW,YAAY;oCAAcV,UAAU;oCAAQW,QAAQ;gCAAE;;oCAE3DjB,8BACC;;0DACE,KAACxF;gDACCoF,OAAOlB;gDACPwC,MAAK;gDACLxB,MAAK;gDACLyB,OAAOzE;gDACPkE,UAAU,CAAC5E,aAAaQ;gDACxBqE,UAAU,CAACC,QAAUnE,YAAYmE,MAAMC,MAAM,CAACI,KAAK;gDACnDC,WAAW;oDACTC,WAAW;wDAAEC,KAAK3C;wDAAW4C,KAAK3C;wDAAW4C,MAAM;oDAAE;gDACvD;gDACAC,YAAY,CAAC,iBAAiB,EAAE9C,UAAU,MAAM,EAAEC,UAAU4B,cAAc,GAAG,CAAC,CAAC;;0DAEjF,KAACrG;gDACCyD,SAAQ;gDACRgD,UAAU,CAAC5E,aAAaQ,QAAQE,SAASgF,IAAI,OAAO;gDACpD/B,SAAS,IAAM,KAAKJ,OAAOlB,OAAO3B;0DAEjC+B,WAAW,OAAO,0BAA0B;;;yCAG/C;oCACHA,WAAW,qBACV,KAACtE;wCACCyD,SAAQ;wCACR4B,OAAM;wCACNoB,UAAU,CAAC5E,aAAaQ;wCACxBmD,SAAS,IAAM,KAAKJ,OAAO;kDAC5B;yCAGC;;;;yBAGN;;;YAIP,CAACvD,0BACA,KAACvB;gBAAWmD,SAAQ;gBAAU4B,OAAM;0BAAiB;iBAGnD;;;AAGV"}
@@ -0,0 +1,40 @@
1
+ /** A row as the collaborators table hands it to a column. */
2
+ interface CollaboratorRow {
3
+ $id?: string;
4
+ uid?: string;
5
+ status?: string;
6
+ }
7
+ /**
8
+ * THE SITE COLLABORATORS TABLE'S AI ALLOTMENT COLUMN (AGL-2942): what each
9
+ * collaborator may draw on THIS site each month. Set here by a manager with
10
+ * `billing.manage` or by the site's admin — never by the collaborator on
11
+ * themselves. A team member's row reads a dash: their allotment spans every
12
+ * site and is set on their own page.
13
+ */
14
+ export declare function AiCollaboratorAllotmentHeader(): import("react").JSX.Element;
15
+ export declare namespace AiCollaboratorAllotmentHeader {
16
+ var displayName: string;
17
+ }
18
+ export declare function AiCollaboratorAllotmentCell(props: {
19
+ orgId?: string;
20
+ hostId?: string;
21
+ member?: CollaboratorRow;
22
+ }): import("react").JSX.Element;
23
+ export declare namespace AiCollaboratorAllotmentCell {
24
+ var displayName: string;
25
+ }
26
+ /**
27
+ * THE SITE'S OWN AI ALLOTMENT (AGL-2942), beneath its collaborators table:
28
+ * what everyone on the site may draw together each month — the agency's
29
+ * per-client budget. Set by a manager with `billing.manage`; readable by
30
+ * the site's admin. The collaborators card names the site and no org, so
31
+ * the route resolves the org from the site.
32
+ */
33
+ export declare function AiSiteAllotmentCard(props: {
34
+ hostId?: string;
35
+ orgId?: string;
36
+ }): import("react").JSX.Element;
37
+ export declare namespace AiSiteAllotmentCard {
38
+ var displayName: string;
39
+ }
40
+ export {};