@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,130 @@
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
+ */ /** Conditions a health claim names, as the object of cure, treat, heal or prevent. */ const CONDITIONS = '(?:anxiety|depression|insomnia|stress|pain|aches?|arthritis|inflammation|acne|eczema|psoriasis|rosacea|' + 'migraines?|headaches?|colds?|flu|covid(?:-19)?|viruse?s?|infections?|disease|diseases|illness|illnesses|' + 'cancer|tumou?rs?|diabetes|blood pressure|hypertension|cholesterol|asthma|allergies|adhd|autism|dementia|' + 'alzheimer\'?s|obesity|hair loss|baldness|wrinkles|scars?|nausea|indigestion|constipation|ulcers?|' + 'insulin resistance|fatigue)';
17
+ const CLAIM_PATTERNS = [
18
+ // What a product does to a condition.
19
+ {
20
+ kind: 'health',
21
+ pattern: new RegExp(`\\b(?:cures?|cured|curing|treats?|treating|treatment for|heals?|healing|relieves?|relief (?:from|of)|` + `prevents?|preventing|prevention of|protects? against|fights?|reverses?|eliminates?|reduces? the risk of)` + `\\s+(?:your\\s+|the\\s+|a\\s+|an\\s+|all\\s+|most\\s+|chronic\\s+|common\\s+|symptoms of\\s+)*${CONDITIONS}\\b`, 'i')
22
+ },
23
+ {
24
+ kind: 'health',
25
+ pattern: /\b(?:clinically|medically|scientifically) (?:proven|tested|shown|validated|approved)\b|\b(?:fda|ema|mhra)[- ]?(?:approved|cleared|registered|certified)\b|\b(?:doctor|physician|dermatologist|pediatrician|dentist|pharmacist)s?[- ](?:recommended|approved|endorsed)\b|\bhealing (?:properties|powers?|benefits)\b|\bboosts? (?:your |the )?immun(?:e system|ity)\b|\bimmune[- ]boosting\b|\bdetoxif(?:y|ies|ying) (?:your|the) body\b|\b(?:lose|burn) (?:weight|fat) (?:fast|quickly|without)\b|\bmiracle (?:cure|remedy)\b/i
26
+ },
27
+ // Money a buyer is promised.
28
+ {
29
+ kind: 'financial',
30
+ pattern: /\bguaranteed (?:returns?|income|profits?|earnings|payouts?|to (?:make|earn) money)\b|\brisk[- ]free (?:investment|returns?|income|profits?)\b|\bget rich\b|\bpassive income\b|\b(?:double|triple|multiply) your (?:money|investment|income|savings)\b|\bmake money (?:fast|quickly|from home)\b|\bfinancial freedom\b|\b(?:investment|financial|tax) advice\b|\bwill (?:increase|appreciate|grow) in value\b|\bpays? for itself\b/i
31
+ },
32
+ // Law a buyer is promised.
33
+ {
34
+ kind: 'legal',
35
+ pattern: /\blegal advice\b|\blegally (?:binding|approved|certified|compliant|required)\b|\b(?:court|lawyer|attorney)[- ](?:approved|certified|proven)\b|\blawsuit[- ]proof\b|\bguaranteed to (?:win|hold up)\b|\b(?:compliant|complies) with (?:all|every) (?:laws?|regulations?)\b|\bmeets all legal requirements\b|\b(?:gdpr|hipaa|ada|osha)[- ](?:compliant|certified|approved)\b/i
36
+ },
37
+ // Standing a product has, which only the merchant can say it has.
38
+ {
39
+ kind: 'endorsement',
40
+ pattern: /\bcertified (?:organic|vegan|gluten[- ]free|kosher|halal|fair ?trade|b corp|non[- ]gmo|cruelty[- ]free)\b|\b(?:usda|fair ?trade|b corp|non[- ]gmo project) (?:certified|verified|approved)\b|\bofficially licensed\b|\bendorsed by\b|\bas seen (?:on|in)\b|\baward[- ]winning\b|(?<![\w#])(?:#1|number one|no\. ?1)\s(?:rated|best[- ]?sell(?:ing|er)|recommended|brand)\b|\bbest[- ]sell(?:ing|er)\b|\bpatented\b|\bpatent[- ]pending\b/i
41
+ }
42
+ ];
43
+ /** A price written into copy: a currency sign or code beside an amount. */ const PRICE = /(?:[$€£¥]\s?\d[\d,]*(?:\.\d{1,2})?|\b\d[\d,]*(?:\.\d{1,2})?\s?(?:usd|eur|gbp|dollars?|euros?|pounds? sterling)\b)/i;
44
+ const collapse = (text)=>text.replace(/\s+/g, ' ').trim().toLowerCase();
45
+ /** Every phrase a pattern matches in a text, so one re-ask can remove them all. */ function everyMatch(pattern, text) {
46
+ const global = new RegExp(pattern.source, pattern.flags.includes('g') ? pattern.flags : `${pattern.flags}g`);
47
+ return [
48
+ ...text.matchAll(global)
49
+ ].map((match)=>match[0]);
50
+ }
51
+ /**
52
+ * Every claim the samples make that they may not. A certification, award,
53
+ * license or endorsement is allowed when the merchant's own words — the
54
+ * product's name and text, or the brief — contain the same phrase.
55
+ */ export function findStorefrontClaims(samples, merchantWords = '') {
56
+ const own = collapse(merchantWords);
57
+ const found = [];
58
+ for (const sample of samples){
59
+ for (const { kind, pattern } of CLAIM_PATTERNS){
60
+ for (const phrase of everyMatch(pattern, sample.text)){
61
+ if (kind === 'endorsement' && own.includes(collapse(phrase))) continue;
62
+ found.push({
63
+ kind,
64
+ at: sample.at,
65
+ phrase
66
+ });
67
+ }
68
+ }
69
+ }
70
+ return found;
71
+ }
72
+ /** A price in the samples that the merchant's own words do not state. */ export function findInventedPrices(samples, merchantWords = '') {
73
+ const own = collapse(merchantWords);
74
+ const found = [];
75
+ for (const sample of samples){
76
+ for (const phrase of everyMatch(PRICE, sample.text)){
77
+ if (!own.includes(collapse(phrase))) found.push({
78
+ kind: 'financial',
79
+ at: sample.at,
80
+ phrase
81
+ });
82
+ }
83
+ }
84
+ return found;
85
+ }
86
+ const CLAIM_WORDS = {
87
+ health: 'a health claim',
88
+ financial: 'a financial claim',
89
+ legal: 'a legal claim',
90
+ endorsement: 'a certification, award or endorsement the product’s own text does not state'
91
+ };
92
+ /**
93
+ * The claims as violations the generation loop re-asks for: one per kind, the
94
+ * phrases quoted in the detail the model is told, the places in `paths`.
95
+ */ export function storefrontClaimViolations(claims, prices = []) {
96
+ const violations = [];
97
+ const kinds = [
98
+ ...new Set(claims.map((claim)=>claim.kind))
99
+ ];
100
+ for (const kind of kinds){
101
+ const own = claims.filter((claim)=>claim.kind === kind);
102
+ violations.push({
103
+ rule: null,
104
+ code: `storefront-claim-${kind}`,
105
+ message: `The copy makes ${CLAIM_WORDS[kind]}. Say what the product is and how it is used instead.`,
106
+ detail: `Remove: ${[
107
+ ...new Set(own.map((claim)=>`"${claim.phrase}"`))
108
+ ].join(', ')}.`,
109
+ paths: [
110
+ ...new Set(own.map((claim)=>claim.at))
111
+ ]
112
+ });
113
+ }
114
+ if (prices.length) {
115
+ violations.push({
116
+ rule: null,
117
+ code: 'storefront-price-invented',
118
+ message: 'The copy states a price nobody gave. Leave prices out; the merchant sets them.',
119
+ detail: `Remove: ${[
120
+ ...new Set(prices.map((price)=>`"${price.phrase}"`))
121
+ ].join(', ')}.`,
122
+ paths: [
123
+ ...new Set(prices.map((price)=>price.at))
124
+ ]
125
+ });
126
+ }
127
+ return violations;
128
+ }
129
+
130
+ //# sourceMappingURL=ai-storefront-claims.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/ai/src/lib/model/ai-storefront-claims.ts"],"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\nimport type { AiDoctrineViolation } from '../runtime/ai-doctrine-validators'\n\n/**\n * STOREFRONT COPY SAFETY (AGL-2916): the claims AI-written product copy may not\n * make, checked in code on every answer rather than asked for in a prompt.\n *\n * A product description is published copy a shopper relies on, and a\n * generator writing one from a name and a photo knows nothing a claim would\n * rest on. So three kinds are refused outright, whatever the product:\n *\n * - **health** — what a product cures, treats, heals or prevents, clinical or\n * medical proof, a regulator's approval, a doctor's recommendation;\n * - **financial** — returns, income or profit promised, an investment that\n * cannot lose;\n * - **legal** — legal advice, a legal guarantee, compliance or approval.\n *\n * A fourth kind is refused unless the merchant's own words already state it:\n * a certification, an award, a license or an endorsement. The acceptable-use\n * rules every AI request carries (`runtime/ai-runtime.ts`) forbid copy that\n * claims an endorsement, certification or partnership not given as a fact,\n * and the merchant's product text is the only such fact the generator has.\n *\n * The patterns name CLAIMS, not topics: \"a sweet treat\", \"cured ham\" and \"a\n * soothing lavender scent\" are ordinary copy. A match is refused with the\n * phrase quoted, so the one re-ask the generation loop allows can remove\n * exactly that phrase.\n *\n * A price is refused the same way unless the merchant's own words state it:\n * prices are the merchant's to set, and a generator never invents one.\n */\n\nexport type AiStorefrontClaimKind = 'health' | 'financial' | 'legal' | 'endorsement'\n\n/** Conditions a health claim names, as the object of cure, treat, heal or prevent. */\nconst CONDITIONS =\n '(?:anxiety|depression|insomnia|stress|pain|aches?|arthritis|inflammation|acne|eczema|psoriasis|rosacea|' +\n 'migraines?|headaches?|colds?|flu|covid(?:-19)?|viruse?s?|infections?|disease|diseases|illness|illnesses|' +\n 'cancer|tumou?rs?|diabetes|blood pressure|hypertension|cholesterol|asthma|allergies|adhd|autism|dementia|' +\n 'alzheimer\\'?s|obesity|hair loss|baldness|wrinkles|scars?|nausea|indigestion|constipation|ulcers?|' +\n 'insulin resistance|fatigue)'\n\nconst CLAIM_PATTERNS: ReadonlyArray<{ kind: AiStorefrontClaimKind; pattern: RegExp }> = [\n // What a product does to a condition.\n {\n kind: 'health',\n pattern: new RegExp(\n `\\\\b(?:cures?|cured|curing|treats?|treating|treatment for|heals?|healing|relieves?|relief (?:from|of)|` +\n `prevents?|preventing|prevention of|protects? against|fights?|reverses?|eliminates?|reduces? the risk of)` +\n `\\\\s+(?:your\\\\s+|the\\\\s+|a\\\\s+|an\\\\s+|all\\\\s+|most\\\\s+|chronic\\\\s+|common\\\\s+|symptoms of\\\\s+)*${CONDITIONS}\\\\b`,\n 'i',\n ),\n },\n {\n kind: 'health',\n pattern:\n /\\b(?:clinically|medically|scientifically) (?:proven|tested|shown|validated|approved)\\b|\\b(?:fda|ema|mhra)[- ]?(?:approved|cleared|registered|certified)\\b|\\b(?:doctor|physician|dermatologist|pediatrician|dentist|pharmacist)s?[- ](?:recommended|approved|endorsed)\\b|\\bhealing (?:properties|powers?|benefits)\\b|\\bboosts? (?:your |the )?immun(?:e system|ity)\\b|\\bimmune[- ]boosting\\b|\\bdetoxif(?:y|ies|ying) (?:your|the) body\\b|\\b(?:lose|burn) (?:weight|fat) (?:fast|quickly|without)\\b|\\bmiracle (?:cure|remedy)\\b/i,\n },\n // Money a buyer is promised.\n {\n kind: 'financial',\n pattern:\n /\\bguaranteed (?:returns?|income|profits?|earnings|payouts?|to (?:make|earn) money)\\b|\\brisk[- ]free (?:investment|returns?|income|profits?)\\b|\\bget rich\\b|\\bpassive income\\b|\\b(?:double|triple|multiply) your (?:money|investment|income|savings)\\b|\\bmake money (?:fast|quickly|from home)\\b|\\bfinancial freedom\\b|\\b(?:investment|financial|tax) advice\\b|\\bwill (?:increase|appreciate|grow) in value\\b|\\bpays? for itself\\b/i,\n },\n // Law a buyer is promised.\n {\n kind: 'legal',\n pattern:\n /\\blegal advice\\b|\\blegally (?:binding|approved|certified|compliant|required)\\b|\\b(?:court|lawyer|attorney)[- ](?:approved|certified|proven)\\b|\\blawsuit[- ]proof\\b|\\bguaranteed to (?:win|hold up)\\b|\\b(?:compliant|complies) with (?:all|every) (?:laws?|regulations?)\\b|\\bmeets all legal requirements\\b|\\b(?:gdpr|hipaa|ada|osha)[- ](?:compliant|certified|approved)\\b/i,\n },\n // Standing a product has, which only the merchant can say it has.\n {\n kind: 'endorsement',\n pattern:\n /\\bcertified (?:organic|vegan|gluten[- ]free|kosher|halal|fair ?trade|b corp|non[- ]gmo|cruelty[- ]free)\\b|\\b(?:usda|fair ?trade|b corp|non[- ]gmo project) (?:certified|verified|approved)\\b|\\bofficially licensed\\b|\\bendorsed by\\b|\\bas seen (?:on|in)\\b|\\baward[- ]winning\\b|(?<![\\w#])(?:#1|number one|no\\. ?1)\\s(?:rated|best[- ]?sell(?:ing|er)|recommended|brand)\\b|\\bbest[- ]sell(?:ing|er)\\b|\\bpatented\\b|\\bpatent[- ]pending\\b/i,\n },\n]\n\n/** A price written into copy: a currency sign or code beside an amount. */\nconst PRICE =\n /(?:[$€£¥]\\s?\\d[\\d,]*(?:\\.\\d{1,2})?|\\b\\d[\\d,]*(?:\\.\\d{1,2})?\\s?(?:usd|eur|gbp|dollars?|euros?|pounds? sterling)\\b)/i\n\nexport interface AiStorefrontCopySample {\n /** Where the text sits in the answer, as `products[2].description`. */\n at: string\n text: string\n}\n\n/** One claim found, with the phrase that makes it. */\nexport interface AiStorefrontClaim {\n kind: AiStorefrontClaimKind\n at: string\n phrase: string\n}\n\nconst collapse = (text: string): string => text.replace(/\\s+/g, ' ').trim().toLowerCase()\n\n/** Every phrase a pattern matches in a text, so one re-ask can remove them all. */\nfunction everyMatch(pattern: RegExp, text: string): string[] {\n const global = new RegExp(pattern.source, pattern.flags.includes('g') ? pattern.flags : `${pattern.flags}g`)\n return [...text.matchAll(global)].map((match) => match[0])\n}\n\n/**\n * Every claim the samples make that they may not. A certification, award,\n * license or endorsement is allowed when the merchant's own words — the\n * product's name and text, or the brief — contain the same phrase.\n */\nexport function findStorefrontClaims(\n samples: readonly AiStorefrontCopySample[],\n merchantWords = '',\n): AiStorefrontClaim[] {\n const own = collapse(merchantWords)\n const found: AiStorefrontClaim[] = []\n for (const sample of samples) {\n for (const { kind, pattern } of CLAIM_PATTERNS) {\n for (const phrase of everyMatch(pattern, sample.text)) {\n if (kind === 'endorsement' && own.includes(collapse(phrase))) continue\n found.push({ kind, at: sample.at, phrase })\n }\n }\n }\n return found\n}\n\n/** A price in the samples that the merchant's own words do not state. */\nexport function findInventedPrices(\n samples: readonly AiStorefrontCopySample[],\n merchantWords = '',\n): AiStorefrontClaim[] {\n const own = collapse(merchantWords)\n const found: AiStorefrontClaim[] = []\n for (const sample of samples) {\n for (const phrase of everyMatch(PRICE, sample.text)) {\n if (!own.includes(collapse(phrase))) found.push({ kind: 'financial', at: sample.at, phrase })\n }\n }\n return found\n}\n\nconst CLAIM_WORDS: Readonly<Record<AiStorefrontClaimKind, string>> = {\n health: 'a health claim',\n financial: 'a financial claim',\n legal: 'a legal claim',\n endorsement: 'a certification, award or endorsement the product’s own text does not state',\n}\n\n/**\n * The claims as violations the generation loop re-asks for: one per kind, the\n * phrases quoted in the detail the model is told, the places in `paths`.\n */\nexport function storefrontClaimViolations(\n claims: readonly AiStorefrontClaim[],\n prices: readonly AiStorefrontClaim[] = [],\n): AiDoctrineViolation[] {\n const violations: AiDoctrineViolation[] = []\n const kinds = [...new Set(claims.map((claim) => claim.kind))]\n for (const kind of kinds) {\n const own = claims.filter((claim) => claim.kind === kind)\n violations.push({\n rule: null,\n code: `storefront-claim-${kind}`,\n message: `The copy makes ${CLAIM_WORDS[kind]}. Say what the product is and how it is used instead.`,\n detail: `Remove: ${[...new Set(own.map((claim) => `\"${claim.phrase}\"`))].join(', ')}.`,\n paths: [...new Set(own.map((claim) => claim.at))],\n })\n }\n if (prices.length) {\n violations.push({\n rule: null,\n code: 'storefront-price-invented',\n message: 'The copy states a price nobody gave. Leave prices out; the merchant sets them.',\n detail: `Remove: ${[...new Set(prices.map((price) => `\"${price.phrase}\"`))].join(', ')}.`,\n paths: [...new Set(prices.map((price) => price.at))],\n })\n }\n return violations\n}\n"],"names":["CONDITIONS","CLAIM_PATTERNS","kind","pattern","RegExp","PRICE","collapse","text","replace","trim","toLowerCase","everyMatch","global","source","flags","includes","matchAll","map","match","findStorefrontClaims","samples","merchantWords","own","found","sample","phrase","push","at","findInventedPrices","CLAIM_WORDS","health","financial","legal","endorsement","storefrontClaimViolations","claims","prices","violations","kinds","Set","claim","filter","rule","code","message","detail","join","paths","length","price"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAmCD,oFAAoF,GACpF,MAAMA,aACJ,4GACA,6GACA,6GACA,sGACA;AAEF,MAAMC,iBAAkF;IACtF,sCAAsC;IACtC;QACEC,MAAM;QACNC,SAAS,IAAIC,OACX,CAAC,qGAAqG,CAAC,GACrG,CAAC,wGAAwG,CAAC,GAC1G,CAAC,8FAA8F,EAAEJ,WAAW,GAAG,CAAC,EAClH;IAEJ;IACA;QACEE,MAAM;QACNC,SACE;IACJ;IACA,6BAA6B;IAC7B;QACED,MAAM;QACNC,SACE;IACJ;IACA,2BAA2B;IAC3B;QACED,MAAM;QACNC,SACE;IACJ;IACA,kEAAkE;IAClE;QACED,MAAM;QACNC,SACE;IACJ;CACD;AAED,yEAAyE,GACzE,MAAME,QACJ;AAeF,MAAMC,WAAW,CAACC,OAAyBA,KAAKC,OAAO,CAAC,QAAQ,KAAKC,IAAI,GAAGC,WAAW;AAEvF,iFAAiF,GACjF,SAASC,WAAWR,OAAe,EAAEI,IAAY;IAC/C,MAAMK,SAAS,IAAIR,OAAOD,QAAQU,MAAM,EAAEV,QAAQW,KAAK,CAACC,QAAQ,CAAC,OAAOZ,QAAQW,KAAK,GAAG,GAAGX,QAAQW,KAAK,CAAC,CAAC,CAAC;IAC3G,OAAO;WAAIP,KAAKS,QAAQ,CAACJ;KAAQ,CAACK,GAAG,CAAC,CAACC,QAAUA,KAAK,CAAC,EAAE;AAC3D;AAEA;;;;CAIC,GACD,OAAO,SAASC,qBACdC,OAA0C,EAC1CC,gBAAgB,EAAE;IAElB,MAAMC,MAAMhB,SAASe;IACrB,MAAME,QAA6B,EAAE;IACrC,KAAK,MAAMC,UAAUJ,QAAS;QAC5B,KAAK,MAAM,EAAElB,IAAI,EAAEC,OAAO,EAAE,IAAIF,eAAgB;YAC9C,KAAK,MAAMwB,UAAUd,WAAWR,SAASqB,OAAOjB,IAAI,EAAG;gBACrD,IAAIL,SAAS,iBAAiBoB,IAAIP,QAAQ,CAACT,SAASmB,UAAU;gBAC9DF,MAAMG,IAAI,CAAC;oBAAExB;oBAAMyB,IAAIH,OAAOG,EAAE;oBAAEF;gBAAO;YAC3C;QACF;IACF;IACA,OAAOF;AACT;AAEA,uEAAuE,GACvE,OAAO,SAASK,mBACdR,OAA0C,EAC1CC,gBAAgB,EAAE;IAElB,MAAMC,MAAMhB,SAASe;IACrB,MAAME,QAA6B,EAAE;IACrC,KAAK,MAAMC,UAAUJ,QAAS;QAC5B,KAAK,MAAMK,UAAUd,WAAWN,OAAOmB,OAAOjB,IAAI,EAAG;YACnD,IAAI,CAACe,IAAIP,QAAQ,CAACT,SAASmB,UAAUF,MAAMG,IAAI,CAAC;gBAAExB,MAAM;gBAAayB,IAAIH,OAAOG,EAAE;gBAAEF;YAAO;QAC7F;IACF;IACA,OAAOF;AACT;AAEA,MAAMM,cAA+D;IACnEC,QAAQ;IACRC,WAAW;IACXC,OAAO;IACPC,aAAa;AACf;AAEA;;;CAGC,GACD,OAAO,SAASC,0BACdC,MAAoC,EACpCC,SAAuC,EAAE;IAEzC,MAAMC,aAAoC,EAAE;IAC5C,MAAMC,QAAQ;WAAI,IAAIC,IAAIJ,OAAOlB,GAAG,CAAC,CAACuB,QAAUA,MAAMtC,IAAI;KAAG;IAC7D,KAAK,MAAMA,QAAQoC,MAAO;QACxB,MAAMhB,MAAMa,OAAOM,MAAM,CAAC,CAACD,QAAUA,MAAMtC,IAAI,KAAKA;QACpDmC,WAAWX,IAAI,CAAC;YACdgB,MAAM;YACNC,MAAM,CAAC,iBAAiB,EAAEzC,MAAM;YAChC0C,SAAS,CAAC,eAAe,EAAEf,WAAW,CAAC3B,KAAK,CAAC,qDAAqD,CAAC;YACnG2C,QAAQ,CAAC,QAAQ,EAAE;mBAAI,IAAIN,IAAIjB,IAAIL,GAAG,CAAC,CAACuB,QAAU,CAAC,CAAC,EAAEA,MAAMf,MAAM,CAAC,CAAC,CAAC;aAAG,CAACqB,IAAI,CAAC,MAAM,CAAC,CAAC;YACtFC,OAAO;mBAAI,IAAIR,IAAIjB,IAAIL,GAAG,CAAC,CAACuB,QAAUA,MAAMb,EAAE;aAAG;QACnD;IACF;IACA,IAAIS,OAAOY,MAAM,EAAE;QACjBX,WAAWX,IAAI,CAAC;YACdgB,MAAM;YACNC,MAAM;YACNC,SAAS;YACTC,QAAQ,CAAC,QAAQ,EAAE;mBAAI,IAAIN,IAAIH,OAAOnB,GAAG,CAAC,CAACgC,QAAU,CAAC,CAAC,EAAEA,MAAMxB,MAAM,CAAC,CAAC,CAAC;aAAG,CAACqB,IAAI,CAAC,MAAM,CAAC,CAAC;YACzFC,OAAO;mBAAI,IAAIR,IAAIH,OAAOnB,GAAG,CAAC,CAACgC,QAAUA,MAAMtB,EAAE;aAAG;QACtD;IACF;IACA,OAAOU;AACT"}
@@ -0,0 +1,82 @@
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
+ */
17
+ import { type BindingTokenCatalogEntry } from '@aglyn/aglyn/app-utils/binding-token-catalog';
18
+ /**
19
+ * What a generated page template renders for (AGL-2909): one page drawn once
20
+ * per record the site already keeps.
21
+ *
22
+ * - `entry` — a content collection's entry page: a blog post, an event, a
23
+ * case study. Picked as the collection's entry template screen.
24
+ * - `product` — the store's product page. Picked as the product template in
25
+ * Store settings.
26
+ * - `author` — an author's page. Picked as the author page screen.
27
+ *
28
+ * Everything that differs per record is a binding token, and the tokens a
29
+ * template may bind are the ones the platform fills on that page. For an
30
+ * entry and an author those are the besigner's own insert-picker catalogs, so
31
+ * what a model may bind and what an author can pick are one list; a product's
32
+ * are the commerce product page's, which no catalog names yet (below).
33
+ *
34
+ * Model only: shapes, the vocabularies and the inputs reader, no runtime.
35
+ */
36
+ export type AiTemplateSubject = 'entry' | 'product' | 'author';
37
+ export declare const AI_TEMPLATE_SUBJECTS: readonly AiTemplateSubject[];
38
+ /**
39
+ * The tokens the commerce product page fills. The commerce plugin's page
40
+ * resolver is their definition of record; a spec reads its source and holds
41
+ * this list to it in both directions, because a plugin never imports another
42
+ * plugin's internals.
43
+ */
44
+ export declare const AI_PRODUCT_TEMPLATE_TOKENS: readonly BindingTokenCatalogEntry[];
45
+ export interface AiTemplateSubjectDefinition {
46
+ subject: AiTemplateSubject;
47
+ /** One rendered page's record, as a sentence names it. */
48
+ noun: string;
49
+ /** The token the page's one h1 binds, so every record shows its own title. */
50
+ titleToken: string;
51
+ /** Every token the page may bind. */
52
+ tokens: readonly BindingTokenCatalogEntry[];
53
+ /**
54
+ * Palette blocks that fill themselves from this subject on its page, and
55
+ * render nothing on another subject's. Inside a Collection Entries card each
56
+ * fills from that card's entry instead, so a card is exempt.
57
+ */
58
+ blocks: readonly string[];
59
+ /** The template's name when the plan names none. */
60
+ defaultName: string;
61
+ /** Where a member puts the page to work, for the proposal and the docs. */
62
+ appliedIn: string;
63
+ }
64
+ export declare const AI_TEMPLATE_SUBJECT_DEFINITIONS: Readonly<Record<AiTemplateSubject, AiTemplateSubjectDefinition>>;
65
+ /** Every `{{…}}` token a string holds, spelled without inner whitespace. */
66
+ export declare function aiBindingTokensIn(value: string): string[];
67
+ /**
68
+ * Whether a token may fill a link or media prop whole: its field is an
69
+ * address or a picture (`{{entry.url}}`, `{{entry.coverImage}}`,
70
+ * `{{author.image}}`), never copy.
71
+ */
72
+ export declare function isAiAddressToken(token: string): boolean;
73
+ /** The tokens of a subject a link or media prop may hold. */
74
+ export declare function aiTemplateAddressTokens(definition: AiTemplateSubjectDefinition): string[];
75
+ /** What a template job reads from its inputs. */
76
+ export interface AiTemplateJobInputs {
77
+ subject: AiTemplateSubject;
78
+ /** The content collection an entry template is for; `null` for a product or author page. */
79
+ collectionId: string | null;
80
+ }
81
+ /** The inputs of a template job, or a sentence naming what is missing. */
82
+ export declare function parseAiTemplateJobInputs(inputs: Readonly<Record<string, unknown>> | null | undefined): AiTemplateJobInputs | string;
@@ -0,0 +1,136 @@
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
+ */ import { AUTHOR_TOKEN_CATALOG, COLLECTION_TOKEN_CATALOG, ENTRY_TOKEN_CATALOG } from "@aglyn/aglyn/app-utils/binding-token-catalog";
17
+ export const AI_TEMPLATE_SUBJECTS = [
18
+ 'entry',
19
+ 'product',
20
+ 'author'
21
+ ];
22
+ /**
23
+ * The tokens the commerce product page fills. The commerce plugin's page
24
+ * resolver is their definition of record; a spec reads its source and holds
25
+ * this list to it in both directions, because a plugin never imports another
26
+ * plugin's internals.
27
+ */ export const AI_PRODUCT_TEMPLATE_TOKENS = [
28
+ {
29
+ token: '{{product.name}}',
30
+ label: 'Name',
31
+ description: 'The product’s name.'
32
+ },
33
+ {
34
+ token: '{{product.description}}',
35
+ label: 'Description',
36
+ description: 'The product’s description.'
37
+ },
38
+ {
39
+ token: '{{product.price}}',
40
+ label: 'Price',
41
+ description: 'The price, or “From” the lowest price when variants differ.'
42
+ },
43
+ {
44
+ token: '{{product.image}}',
45
+ label: 'Image',
46
+ description: 'The product’s first image.'
47
+ },
48
+ {
49
+ token: '{{product.slug}}',
50
+ label: 'Slug',
51
+ description: 'The product’s URL segment.'
52
+ }
53
+ ];
54
+ /** The pager tokens, which resolve on an author's page over their own archive. */ const PAGINATION_TOKENS = COLLECTION_TOKEN_CATALOG.filter((entry)=>entry.token.startsWith('{{pagination.'));
55
+ export const AI_TEMPLATE_SUBJECT_DEFINITIONS = {
56
+ entry: {
57
+ subject: 'entry',
58
+ noun: 'a collection entry',
59
+ titleToken: '{{entry.title}}',
60
+ tokens: [
61
+ ...ENTRY_TOKEN_CATALOG,
62
+ ...COLLECTION_TOKEN_CATALOG
63
+ ],
64
+ blocks: [
65
+ 'collectionEntryMeta',
66
+ 'collectionEntryBody',
67
+ 'collectionEntryAuthor',
68
+ 'collectionRelated'
69
+ ],
70
+ defaultName: 'Entry page template',
71
+ appliedIn: 'the collection’s entry template screen, under Template screens in Content'
72
+ },
73
+ product: {
74
+ subject: 'product',
75
+ noun: 'a product',
76
+ titleToken: '{{product.name}}',
77
+ tokens: AI_PRODUCT_TEMPLATE_TOKENS,
78
+ blocks: [],
79
+ defaultName: 'Product page template',
80
+ appliedIn: 'the product page template in Store settings'
81
+ },
82
+ author: {
83
+ subject: 'author',
84
+ noun: 'an author',
85
+ titleToken: '{{author.name}}',
86
+ tokens: [
87
+ ...AUTHOR_TOKEN_CATALOG,
88
+ ...PAGINATION_TOKENS
89
+ ],
90
+ blocks: [
91
+ 'contentAuthorProfile'
92
+ ],
93
+ defaultName: 'Author page template',
94
+ appliedIn: 'the author page screen on the Authors tab'
95
+ }
96
+ };
97
+ /** Every `{{…}}` token a string holds, spelled without inner whitespace. */ export function aiBindingTokensIn(value) {
98
+ return [
99
+ ...value.matchAll(/\{\{\s*([^{}\s]+)\s*\}\}/g)
100
+ ].map((match)=>`{{${match[1]}}}`);
101
+ }
102
+ /**
103
+ * Whether a token may fill a link or media prop whole: its field is an
104
+ * address or a picture (`{{entry.url}}`, `{{entry.coverImage}}`,
105
+ * `{{author.image}}`), never copy.
106
+ */ export function isAiAddressToken(token) {
107
+ var _token_replace_split_pop;
108
+ const field = (_token_replace_split_pop = token.replace(/^\{\{|\}\}$/g, '').split('.').pop()) != null ? _token_replace_split_pop : '';
109
+ return /^(?:url|image)$|(?:Url|Image|Video)$/.test(field);
110
+ }
111
+ /** The tokens of a subject a link or media prop may hold. */ export function aiTemplateAddressTokens(definition) {
112
+ return definition.tokens.map((entry)=>entry.token).filter(isAiAddressToken);
113
+ }
114
+ const RECORD_ID = /^[A-Za-z0-9_-]{1,100}$/;
115
+ /** The inputs of a template job, or a sentence naming what is missing. */ export function parseAiTemplateJobInputs(inputs) {
116
+ var _ref;
117
+ const subject = String((_ref = inputs == null ? void 0 : inputs['subject']) != null ? _ref : '');
118
+ if (!AI_TEMPLATE_SUBJECTS.includes(subject)) {
119
+ return `Name what the template is for: inputs.subject is one of ${AI_TEMPLATE_SUBJECTS.join(', ')}`;
120
+ }
121
+ if (subject !== 'entry') return {
122
+ subject: subject,
123
+ collectionId: null
124
+ };
125
+ const raw = inputs == null ? void 0 : inputs['collectionId'];
126
+ const collectionId = typeof raw === 'string' ? raw.trim() : '';
127
+ if (!RECORD_ID.test(collectionId)) {
128
+ return 'An entry page template names its content collection in inputs.collectionId';
129
+ }
130
+ return {
131
+ subject: 'entry',
132
+ collectionId
133
+ };
134
+ }
135
+
136
+ //# sourceMappingURL=ai-template-subjects.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/ai/src/lib/model/ai-template-subjects.ts"],"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\nimport {\n AUTHOR_TOKEN_CATALOG,\n COLLECTION_TOKEN_CATALOG,\n ENTRY_TOKEN_CATALOG,\n type BindingTokenCatalogEntry,\n} from '@aglyn/aglyn/app-utils/binding-token-catalog'\n\n/**\n * What a generated page template renders for (AGL-2909): one page drawn once\n * per record the site already keeps.\n *\n * - `entry` — a content collection's entry page: a blog post, an event, a\n * case study. Picked as the collection's entry template screen.\n * - `product` — the store's product page. Picked as the product template in\n * Store settings.\n * - `author` — an author's page. Picked as the author page screen.\n *\n * Everything that differs per record is a binding token, and the tokens a\n * template may bind are the ones the platform fills on that page. For an\n * entry and an author those are the besigner's own insert-picker catalogs, so\n * what a model may bind and what an author can pick are one list; a product's\n * are the commerce product page's, which no catalog names yet (below).\n *\n * Model only: shapes, the vocabularies and the inputs reader, no runtime.\n */\n\nexport type AiTemplateSubject = 'entry' | 'product' | 'author'\n\nexport const AI_TEMPLATE_SUBJECTS: readonly AiTemplateSubject[] = ['entry', 'product', 'author']\n\n/**\n * The tokens the commerce product page fills. The commerce plugin's page\n * resolver is their definition of record; a spec reads its source and holds\n * this list to it in both directions, because a plugin never imports another\n * plugin's internals.\n */\nexport const AI_PRODUCT_TEMPLATE_TOKENS: readonly BindingTokenCatalogEntry[] = [\n { token: '{{product.name}}', label: 'Name', description: 'The product’s name.' },\n {\n token: '{{product.description}}',\n label: 'Description',\n description: 'The product’s description.',\n },\n {\n token: '{{product.price}}',\n label: 'Price',\n description: 'The price, or “From” the lowest price when variants differ.',\n },\n { token: '{{product.image}}', label: 'Image', description: 'The product’s first image.' },\n { token: '{{product.slug}}', label: 'Slug', description: 'The product’s URL segment.' },\n]\n\n/** The pager tokens, which resolve on an author's page over their own archive. */\nconst PAGINATION_TOKENS = COLLECTION_TOKEN_CATALOG.filter((entry) =>\n entry.token.startsWith('{{pagination.'),\n)\n\nexport interface AiTemplateSubjectDefinition {\n subject: AiTemplateSubject\n /** One rendered page's record, as a sentence names it. */\n noun: string\n /** The token the page's one h1 binds, so every record shows its own title. */\n titleToken: string\n /** Every token the page may bind. */\n tokens: readonly BindingTokenCatalogEntry[]\n /**\n * Palette blocks that fill themselves from this subject on its page, and\n * render nothing on another subject's. Inside a Collection Entries card each\n * fills from that card's entry instead, so a card is exempt.\n */\n blocks: readonly string[]\n /** The template's name when the plan names none. */\n defaultName: string\n /** Where a member puts the page to work, for the proposal and the docs. */\n appliedIn: string\n}\n\nexport const AI_TEMPLATE_SUBJECT_DEFINITIONS: Readonly<\n Record<AiTemplateSubject, AiTemplateSubjectDefinition>\n> = {\n entry: {\n subject: 'entry',\n noun: 'a collection entry',\n titleToken: '{{entry.title}}',\n tokens: [...ENTRY_TOKEN_CATALOG, ...COLLECTION_TOKEN_CATALOG],\n blocks: ['collectionEntryMeta', 'collectionEntryBody', 'collectionEntryAuthor', 'collectionRelated'],\n defaultName: 'Entry page template',\n appliedIn: 'the collection’s entry template screen, under Template screens in Content',\n },\n product: {\n subject: 'product',\n noun: 'a product',\n titleToken: '{{product.name}}',\n tokens: AI_PRODUCT_TEMPLATE_TOKENS,\n blocks: [],\n defaultName: 'Product page template',\n appliedIn: 'the product page template in Store settings',\n },\n author: {\n subject: 'author',\n noun: 'an author',\n titleToken: '{{author.name}}',\n tokens: [...AUTHOR_TOKEN_CATALOG, ...PAGINATION_TOKENS],\n blocks: ['contentAuthorProfile'],\n defaultName: 'Author page template',\n appliedIn: 'the author page screen on the Authors tab',\n },\n}\n\n/** Every `{{…}}` token a string holds, spelled without inner whitespace. */\nexport function aiBindingTokensIn(value: string): string[] {\n return [...value.matchAll(/\\{\\{\\s*([^{}\\s]+)\\s*\\}\\}/g)].map((match) => `{{${match[1]}}}`)\n}\n\n/**\n * Whether a token may fill a link or media prop whole: its field is an\n * address or a picture (`{{entry.url}}`, `{{entry.coverImage}}`,\n * `{{author.image}}`), never copy.\n */\nexport function isAiAddressToken(token: string): boolean {\n const field = token.replace(/^\\{\\{|\\}\\}$/g, '').split('.').pop() ?? ''\n return /^(?:url|image)$|(?:Url|Image|Video)$/.test(field)\n}\n\n/** The tokens of a subject a link or media prop may hold. */\nexport function aiTemplateAddressTokens(definition: AiTemplateSubjectDefinition): string[] {\n return definition.tokens.map((entry) => entry.token).filter(isAiAddressToken)\n}\n\n/** What a template job reads from its inputs. */\nexport interface AiTemplateJobInputs {\n subject: AiTemplateSubject\n /** The content collection an entry template is for; `null` for a product or author page. */\n collectionId: string | null\n}\n\nconst RECORD_ID = /^[A-Za-z0-9_-]{1,100}$/\n\n/** The inputs of a template job, or a sentence naming what is missing. */\nexport function parseAiTemplateJobInputs(\n inputs: Readonly<Record<string, unknown>> | null | undefined,\n): AiTemplateJobInputs | string {\n const subject = String(inputs?.['subject'] ?? '')\n if (!(AI_TEMPLATE_SUBJECTS as readonly string[]).includes(subject)) {\n return `Name what the template is for: inputs.subject is one of ${AI_TEMPLATE_SUBJECTS.join(', ')}`\n }\n if (subject !== 'entry') return { subject: subject as AiTemplateSubject, collectionId: null }\n const raw = inputs?.['collectionId']\n const collectionId = typeof raw === 'string' ? raw.trim() : ''\n if (!RECORD_ID.test(collectionId)) {\n return 'An entry page template names its content collection in inputs.collectionId'\n }\n return { subject: 'entry', collectionId }\n}\n"],"names":["AUTHOR_TOKEN_CATALOG","COLLECTION_TOKEN_CATALOG","ENTRY_TOKEN_CATALOG","AI_TEMPLATE_SUBJECTS","AI_PRODUCT_TEMPLATE_TOKENS","token","label","description","PAGINATION_TOKENS","filter","entry","startsWith","AI_TEMPLATE_SUBJECT_DEFINITIONS","subject","noun","titleToken","tokens","blocks","defaultName","appliedIn","product","author","aiBindingTokensIn","value","matchAll","map","match","isAiAddressToken","field","replace","split","pop","test","aiTemplateAddressTokens","definition","RECORD_ID","parseAiTemplateJobInputs","inputs","String","includes","join","collectionId","raw","trim"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SACEA,oBAAoB,EACpBC,wBAAwB,EACxBC,mBAAmB,QAEd,+CAA8C;AAuBrD,OAAO,MAAMC,uBAAqD;IAAC;IAAS;IAAW;CAAS,CAAA;AAEhG;;;;;CAKC,GACD,OAAO,MAAMC,6BAAkE;IAC7E;QAAEC,OAAO;QAAoBC,OAAO;QAAQC,aAAa;IAAsB;IAC/E;QACEF,OAAO;QACPC,OAAO;QACPC,aAAa;IACf;IACA;QACEF,OAAO;QACPC,OAAO;QACPC,aAAa;IACf;IACA;QAAEF,OAAO;QAAqBC,OAAO;QAASC,aAAa;IAA6B;IACxF;QAAEF,OAAO;QAAoBC,OAAO;QAAQC,aAAa;IAA6B;CACvF,CAAA;AAED,gFAAgF,GAChF,MAAMC,oBAAoBP,yBAAyBQ,MAAM,CAAC,CAACC,QACzDA,MAAML,KAAK,CAACM,UAAU,CAAC;AAuBzB,OAAO,MAAMC,kCAET;IACFF,OAAO;QACLG,SAAS;QACTC,MAAM;QACNC,YAAY;QACZC,QAAQ;eAAId;eAAwBD;SAAyB;QAC7DgB,QAAQ;YAAC;YAAuB;YAAuB;YAAyB;SAAoB;QACpGC,aAAa;QACbC,WAAW;IACb;IACAC,SAAS;QACPP,SAAS;QACTC,MAAM;QACNC,YAAY;QACZC,QAAQZ;QACRa,QAAQ,EAAE;QACVC,aAAa;QACbC,WAAW;IACb;IACAE,QAAQ;QACNR,SAAS;QACTC,MAAM;QACNC,YAAY;QACZC,QAAQ;eAAIhB;eAAyBQ;SAAkB;QACvDS,QAAQ;YAAC;SAAuB;QAChCC,aAAa;QACbC,WAAW;IACb;AACF,EAAC;AAED,0EAA0E,GAC1E,OAAO,SAASG,kBAAkBC,KAAa;IAC7C,OAAO;WAAIA,MAAMC,QAAQ,CAAC;KAA6B,CAACC,GAAG,CAAC,CAACC,QAAU,CAAC,EAAE,EAAEA,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;AAC1F;AAEA;;;;CAIC,GACD,OAAO,SAASC,iBAAiBtB,KAAa;QAC9BA;IAAd,MAAMuB,SAAQvB,2BAAAA,MAAMwB,OAAO,CAAC,gBAAgB,IAAIC,KAAK,CAAC,KAAKC,GAAG,cAAhD1B,2BAAsD;IACpE,OAAO,uCAAuC2B,IAAI,CAACJ;AACrD;AAEA,2DAA2D,GAC3D,OAAO,SAASK,wBAAwBC,UAAuC;IAC7E,OAAOA,WAAWlB,MAAM,CAACS,GAAG,CAAC,CAACf,QAAUA,MAAML,KAAK,EAAEI,MAAM,CAACkB;AAC9D;AASA,MAAMQ,YAAY;AAElB,wEAAwE,GACxE,OAAO,SAASC,yBACdC,MAA4D;;IAE5D,MAAMxB,UAAUyB,eAAOD,0BAAAA,MAAQ,CAAC,UAAU,mBAAI;IAC9C,IAAI,CAAC,AAAClC,qBAA2CoC,QAAQ,CAAC1B,UAAU;QAClE,OAAO,CAAC,wDAAwD,EAAEV,qBAAqBqC,IAAI,CAAC,OAAO;IACrG;IACA,IAAI3B,YAAY,SAAS,OAAO;QAAEA,SAASA;QAA8B4B,cAAc;IAAK;IAC5F,MAAMC,MAAML,0BAAAA,MAAQ,CAAC,eAAe;IACpC,MAAMI,eAAe,OAAOC,QAAQ,WAAWA,IAAIC,IAAI,KAAK;IAC5D,IAAI,CAACR,UAAUH,IAAI,CAACS,eAAe;QACjC,OAAO;IACT;IACA,OAAO;QAAE5B,SAAS;QAAS4B;IAAa;AAC1C"}
@@ -0,0 +1,210 @@
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
+ */
17
+ import { type HostThemeSource } from '@aglyn/aglyn/app-utils/marketplace-theme';
18
+ import type { HostTheme, HostThemeScheme } from '@aglyn/shared-data-types';
19
+ import { type ThemeColorToken, type ThemeComponentOverrideLeaf, type ThemeEditorControlId } from '@aglyn/shared-ui-theme/util/theme-editor-fields';
20
+ /**
21
+ * A theme proposal (AGL-2938): what a theme job hands a person to apply.
22
+ *
23
+ * Not a theme. A proposal is a set of theme editor controls set to values,
24
+ * applied to whatever the site's theme is when the person applies it, through
25
+ * the same writes the editor performs. A proposal that names three colors
26
+ * changes three colors, and every control it does not name is untouched by
27
+ * construction rather than by the model's restraint — which is what makes
28
+ * "make it feel warmer" a targeted diff instead of a regenerated theme.
29
+ *
30
+ * Pure and free of anything server-side: the job step builds a proposal, and
31
+ * the Theme section's widget previews and applies one, from this module.
32
+ */
33
+ export declare const AI_THEME_PROPOSAL_VERSION = 1;
34
+ /**
35
+ * `modify` changes what the brief is about and nothing else; `create` is a
36
+ * whole design over every control the editor has.
37
+ */
38
+ export type AiThemeProposalMode = 'modify' | 'create';
39
+ export declare const AI_THEME_PROPOSAL_MODES: readonly AiThemeProposalMode[];
40
+ /** The parts of a theme a brief can be about. */
41
+ export type AiThemeChangeGroup = 'color' | 'darkScheme' | 'typography' | 'shape' | 'spacing' | 'navigation' | 'components';
42
+ export declare const AI_THEME_CHANGE_GROUPS: readonly AiThemeChangeGroup[];
43
+ /** The controls a proposal sets one value on; component overrides are leaves of their own. */
44
+ export type AiThemeValueControl = Exclude<ThemeEditorControlId, 'components'>;
45
+ /** Every value control, as the catalog lists them. */
46
+ export declare const AI_THEME_VALUE_CONTROLS: readonly AiThemeValueControl[];
47
+ /** One editor control set to a value, or back to its default with `null`. */
48
+ export interface AiThemeControlChange {
49
+ control: AiThemeValueControl;
50
+ /** The scheme a color is set for; `null` for every other control. */
51
+ scheme: HostThemeScheme | null;
52
+ value: string | number | null;
53
+ /** What the site had set when the proposal was made; `null` when it inherited. */
54
+ before: string | number | null;
55
+ }
56
+ /** A value the proposal carries that the model did not write, and why. */
57
+ export interface AiThemeCorrection {
58
+ control: `color.${ThemeColorToken}`;
59
+ scheme: HostThemeScheme;
60
+ /** The value before the correction; `null` when the slot inherited. */
61
+ from: string | null;
62
+ to: string;
63
+ /**
64
+ * `contrast` — the pair fell below its bar and this is the nearest shade
65
+ * of the foreground that clears it. `dark-value` — the proposal changed an
66
+ * accent for light and gave no dark value, and this keeps the same hue
67
+ * readable on the dark background.
68
+ */
69
+ reason: 'contrast' | 'dark-value';
70
+ /** The colors a contrast correction was measured against. */
71
+ against?: string[];
72
+ /** The worst ratio before the correction. */
73
+ ratio?: number;
74
+ /** The bar the pair has to clear. */
75
+ required?: number;
76
+ }
77
+ export interface AiThemeProposal {
78
+ version: typeof AI_THEME_PROPOSAL_VERSION;
79
+ mode: AiThemeProposalMode;
80
+ /** One sentence naming what the proposal changes, in the brief's language. */
81
+ summary: string;
82
+ /**
83
+ * Where the site's theme came from when the proposal was made, which is
84
+ * how the editor's Save stores it: an installed theme's edits become its
85
+ * override patch, a default theme stores only the changed values, and a
86
+ * site's own theme changes in place.
87
+ */
88
+ source: HostThemeSource;
89
+ changes: AiThemeControlChange[];
90
+ components: ThemeComponentOverrideLeaf[];
91
+ /** The site's own component overrides are dropped before `components` apply. */
92
+ resetComponents: boolean;
93
+ corrections: AiThemeCorrection[];
94
+ /** What the model proposed that the proposal leaves out, in words. */
95
+ dropped: string[];
96
+ /** Anything else a person should read before applying, in words. */
97
+ notes: string[];
98
+ }
99
+ /** The color token a control writes, or `null` for a control that is not a color. */
100
+ export declare function aiThemeColorToken(control: string): ThemeColorToken | null;
101
+ /** What a control holds on a theme, as a proposal's `before` names it. */
102
+ export declare function readAiThemeControl(theme: HostTheme | undefined, control: AiThemeValueControl, scheme: HostThemeScheme | null): string | number | null;
103
+ /**
104
+ * The theme a set of changes produces on top of `theme`: each change written
105
+ * the way the editor writes it, then the component overrides. Returns a new
106
+ * object; `theme` is not mutated.
107
+ */
108
+ export declare function applyAiThemeChanges(theme: HostTheme | undefined, proposal: {
109
+ changes: ReadonlyArray<Pick<AiThemeControlChange, 'control' | 'scheme' | 'value'>>;
110
+ components: readonly ThemeComponentOverrideLeaf[];
111
+ resetComponents: boolean;
112
+ }): HostTheme;
113
+ /** The part of the theme a value control belongs to. */
114
+ export declare function aiThemeControlGroup(control: AiThemeValueControl): AiThemeChangeGroup;
115
+ /**
116
+ * The part of the theme a component override belongs to: the type ramp's
117
+ * overrides are typography, the app bar's and the toolbar's are navigation,
118
+ * and the rest are components.
119
+ */
120
+ export declare function aiThemeComponentGroup(component: ThemeComponentOverrideLeaf['component']): AiThemeChangeGroup;
121
+ /**
122
+ * The parts of the theme a job may change. A `create` job is a whole design.
123
+ * A `modify` job may change only what its brief is about, so "make it feel
124
+ * warmer" reaches the colors and nothing else; a brief that names no part at
125
+ * all — in another language, or in words this does not know — is taken to
126
+ * be about the whole design rather than refused.
127
+ */
128
+ export declare function aiThemeBriefScope(brief: string, mode: AiThemeProposalMode): ReadonlySet<AiThemeChangeGroup>;
129
+ /** A color as the site renders it in one scheme: its own value, else the brand's. */
130
+ export declare function effectiveThemeColor(theme: HostTheme | undefined, scheme: HostThemeScheme, token: ThemeColorToken): string | undefined;
131
+ /**
132
+ * The colors a set of changes gives a light value and no dark one, while the
133
+ * site's dark scheme is on. Each is a visitor in dark mode seeing half a
134
+ * change.
135
+ */
136
+ export declare function aiThemeMissingDarkValues(changes: ReadonlyArray<Pick<AiThemeControlChange, 'control' | 'scheme'>>, themeAfter: HostTheme): ThemeColorToken[];
137
+ /**
138
+ * The dark value an accent keeps when a proposal gave none: the same hue,
139
+ * lightened only as far as it takes to read on the dark background as a fill
140
+ * or an indicator. Surfaces, text and tints have no such value — a pale light
141
+ * surface lightened is still a light surface — so they go on inheriting the
142
+ * platform's dark palette, which is what a site with no dark design renders.
143
+ */
144
+ export declare function deriveAiThemeDarkAccent(light: string, themeAfter: HostTheme): string | null;
145
+ /** A foreground that has to read on each of its backgrounds. */
146
+ export interface AiThemeContrastPair {
147
+ foreground: ThemeColorToken;
148
+ backgrounds: readonly ThemeColorToken[];
149
+ required: number;
150
+ }
151
+ /**
152
+ * The pairs a proposal is held to. Body text on the page and on paper, and
153
+ * secondary text on the page, are the pairs the theme publish check
154
+ * (`validateThemeForPublish`) measures, at its bars; the primary color on
155
+ * the page is held to the bar a fill or an indicator owes.
156
+ */
157
+ export declare const AI_THEME_CONTRAST_PAIRS: readonly AiThemeContrastPair[];
158
+ export interface AiThemeContrastResult {
159
+ theme: HostTheme;
160
+ corrections: AiThemeCorrection[];
161
+ notes: string[];
162
+ }
163
+ /**
164
+ * Every pair a set of changes takes below its bar, corrected to the nearest
165
+ * shade of its foreground that clears it, and named.
166
+ *
167
+ * Only pairs the changes touched are corrected. A pair that already fell
168
+ * short with neither of its colors changed is named in `notes` and left
169
+ * alone, because correcting it would change a color the brief did not ask
170
+ * about. A dark scheme the site has switched off is not measured: no visitor
171
+ * sees it.
172
+ */
173
+ export declare function correctAiThemeContrast(themeAfter: HostTheme, touchedChanges: ReadonlyArray<Pick<AiThemeControlChange, 'control' | 'scheme'>>): AiThemeContrastResult;
174
+ export interface BuildAiThemeProposalInput {
175
+ /** The site's theme as the editor shows it, overrides resolved. */
176
+ base: HostTheme | undefined;
177
+ source: HostThemeSource;
178
+ mode: AiThemeProposalMode;
179
+ brief: string;
180
+ summary: string;
181
+ changes: ReadonlyArray<Pick<AiThemeControlChange, 'control' | 'scheme' | 'value'>>;
182
+ components: readonly ThemeComponentOverrideLeaf[];
183
+ resetComponents: boolean;
184
+ /** What reading the model's answer already left out, in words. */
185
+ dropped?: readonly string[];
186
+ notes?: readonly string[];
187
+ }
188
+ /**
189
+ * A proposal from what the model proposed, held to the editor and to the
190
+ * doctrine: changes that change nothing are gone, a modify brief reaches
191
+ * only the parts of the theme it names, accents keep a dark value, and every
192
+ * pair the proposal touches clears its contrast bar.
193
+ */
194
+ export declare function buildAiThemeProposal(input: BuildAiThemeProposalInput): AiThemeProposal;
195
+ /**
196
+ * What applying a proposal to the site's CURRENT theme produces, held to the
197
+ * contrast bars again: the theme may have changed since the proposal was
198
+ * made, and a proposal that cleared its bars against the old background can
199
+ * fall short against the new one. The corrections this makes are named
200
+ * beside the proposal's own.
201
+ */
202
+ export declare function aiThemeProposalAfter(theme: HostTheme | undefined, proposal: Pick<AiThemeProposal, 'changes' | 'components' | 'resetComponents'>): AiThemeContrastResult;
203
+ /** The changes whose `before` no longer matches the theme a proposal is applied to. */
204
+ export declare function aiThemeStaleChanges(theme: HostTheme | undefined, proposal: Pick<AiThemeProposal, 'changes'>): AiThemeControlChange[];
205
+ /**
206
+ * A proposal as a job output stores it, or `null` for anything that is not
207
+ * one. The job writes these through the Admin SDK and nothing else can, but
208
+ * a reader that applies what it reads to a theme checks the shape first.
209
+ */
210
+ export declare function readAiThemeProposal(value: unknown): AiThemeProposal | null;