@aglyn/aglyn 1.0.0-beta.218 → 1.0.0-beta.220

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 (455) hide show
  1. package/package.json +12 -12
  2. package/src/lib/app-utils/actions.d.ts +26 -433
  3. package/src/lib/app-utils/actions.js +108 -633
  4. package/src/lib/app-utils/actions.js.map +1 -1
  5. package/src/lib/app-utils/activity-presenter.d.ts +3 -3
  6. package/src/lib/app-utils/activity-presenter.js +36 -52
  7. package/src/lib/app-utils/activity-presenter.js.map +1 -1
  8. package/src/lib/app-utils/analytics-events.d.ts +1 -1
  9. package/src/lib/app-utils/analytics-events.js.map +1 -1
  10. package/src/lib/app-utils/analytics-provider.d.ts +182 -0
  11. package/src/lib/app-utils/analytics-provider.js +133 -0
  12. package/src/lib/app-utils/analytics-provider.js.map +1 -0
  13. package/src/lib/app-utils/api-plugins.d.ts +46 -0
  14. package/src/lib/app-utils/api-plugins.js +19 -0
  15. package/src/lib/app-utils/api-plugins.js.map +1 -1
  16. package/src/lib/app-utils/{marketplace-overrides.d.ts → artifact-overrides.d.ts} +9 -6
  17. package/src/lib/app-utils/{marketplace-overrides.js → artifact-overrides.js} +10 -7
  18. package/src/lib/app-utils/artifact-overrides.js.map +1 -0
  19. package/src/lib/app-utils/{marketplace-provenance.d.ts → artifact-provenance.d.ts} +12 -10
  20. package/src/lib/app-utils/{marketplace-provenance.js → artifact-provenance.js} +9 -7
  21. package/src/lib/app-utils/artifact-provenance.js.map +1 -0
  22. package/src/lib/app-utils/binding-token-catalog.d.ts +5 -13
  23. package/src/lib/app-utils/binding-token-catalog.js +17 -41
  24. package/src/lib/app-utils/binding-token-catalog.js.map +1 -1
  25. package/src/lib/app-utils/brand-support-line.d.ts +36 -0
  26. package/src/lib/app-utils/brand-support-line.js +38 -0
  27. package/src/lib/app-utils/brand-support-line.js.map +1 -0
  28. package/src/lib/app-utils/collection-entries.d.ts +2 -2
  29. package/src/lib/app-utils/collection-entries.js.map +1 -1
  30. package/src/lib/app-utils/consent-group-change.d.ts +4 -0
  31. package/src/lib/app-utils/consent-group-change.js.map +1 -1
  32. package/src/lib/app-utils/consent-groups.d.ts +1 -1
  33. package/src/lib/app-utils/consent-groups.js.map +1 -1
  34. package/src/lib/app-utils/console-routes.d.ts +15 -42
  35. package/src/lib/app-utils/console-routes.js +10 -39
  36. package/src/lib/app-utils/console-routes.js.map +1 -1
  37. package/src/lib/app-utils/contacts.d.ts +24 -2
  38. package/src/lib/app-utils/contacts.js +21 -5
  39. package/src/lib/app-utils/contacts.js.map +1 -1
  40. package/src/lib/app-utils/container-membership.d.ts +93 -0
  41. package/src/lib/app-utils/container-membership.js +165 -0
  42. package/src/lib/app-utils/container-membership.js.map +1 -0
  43. package/src/lib/app-utils/crm-task-reminders.d.ts +23 -6
  44. package/src/lib/app-utils/crm-task-reminders.js +32 -11
  45. package/src/lib/app-utils/crm-task-reminders.js.map +1 -1
  46. package/src/lib/app-utils/crm.d.ts +24 -4
  47. package/src/lib/app-utils/crm.js +23 -0
  48. package/src/lib/app-utils/crm.js.map +1 -1
  49. package/src/lib/app-utils/cross-pool-desync.d.ts +39 -0
  50. package/src/lib/app-utils/cross-pool-desync.js +47 -0
  51. package/src/lib/app-utils/cross-pool-desync.js.map +1 -0
  52. package/src/lib/app-utils/csv-upload.d.ts +29 -0
  53. package/src/lib/app-utils/csv-upload.js +29 -0
  54. package/src/lib/app-utils/csv-upload.js.map +1 -0
  55. package/src/lib/app-utils/{dataset-csv.d.ts → csv.d.ts} +10 -43
  56. package/src/lib/app-utils/{dataset-csv.js → csv.js} +10 -81
  57. package/src/lib/app-utils/csv.js.map +1 -0
  58. package/src/lib/app-utils/dataset-models.d.ts +5 -5
  59. package/src/lib/app-utils/dataset-models.js +19 -2
  60. package/src/lib/app-utils/dataset-models.js.map +1 -1
  61. package/src/lib/app-utils/datasets.d.ts +65 -30
  62. package/src/lib/app-utils/datasets.js +74 -24
  63. package/src/lib/app-utils/datasets.js.map +1 -1
  64. package/src/lib/app-utils/docs-deflection.d.ts +6 -6
  65. package/src/lib/app-utils/docs-deflection.js.map +1 -1
  66. package/src/lib/app-utils/docs-help.generated.d.ts +14 -8
  67. package/src/lib/app-utils/docs-help.generated.js +23 -6
  68. package/src/lib/app-utils/docs-help.generated.js.map +1 -1
  69. package/src/lib/app-utils/docs-index.generated.d.ts +2 -2
  70. package/src/lib/app-utils/docs-index.generated.js +570 -346
  71. package/src/lib/app-utils/docs-index.generated.js.map +1 -1
  72. package/src/lib/app-utils/docs-retrieval.d.ts +3 -3
  73. package/src/lib/app-utils/docs-retrieval.js +14 -10
  74. package/src/lib/app-utils/docs-retrieval.js.map +1 -1
  75. package/src/lib/app-utils/duplicate-resource.d.ts +4 -1
  76. package/src/lib/app-utils/duplicate-resource.js +7 -4
  77. package/src/lib/app-utils/duplicate-resource.js.map +1 -1
  78. package/src/lib/app-utils/dynamic-list-rule.d.ts +1 -1
  79. package/src/lib/app-utils/dynamic-list-rule.js +3 -3
  80. package/src/lib/app-utils/dynamic-list-rule.js.map +1 -1
  81. package/src/lib/app-utils/element-ui.d.ts +1 -1
  82. package/src/lib/app-utils/element-ui.js +1 -1
  83. package/src/lib/app-utils/element-ui.js.map +1 -1
  84. package/src/lib/app-utils/email-starter-policy.js +3 -3
  85. package/src/lib/app-utils/email-starter-policy.js.map +1 -1
  86. package/src/lib/app-utils/email-text.d.ts +80 -0
  87. package/src/lib/app-utils/email-text.js +189 -0
  88. package/src/lib/app-utils/email-text.js.map +1 -0
  89. package/src/lib/app-utils/{list-assignment-policy.d.ts → enrollment-basis.d.ts} +4 -0
  90. package/src/lib/app-utils/{list-assignment-policy.js → enrollment-basis.js} +5 -1
  91. package/src/lib/app-utils/enrollment-basis.js.map +1 -0
  92. package/src/lib/app-utils/entity-picker-context.d.ts +10 -5
  93. package/src/lib/app-utils/entity-picker-context.js.map +1 -1
  94. package/src/lib/app-utils/error-beacon.d.ts +75 -6
  95. package/src/lib/app-utils/error-beacon.js +160 -21
  96. package/src/lib/app-utils/error-beacon.js.map +1 -1
  97. package/src/lib/app-utils/expand-repeatables.d.ts +10 -10
  98. package/src/lib/app-utils/expand-repeatables.js +14 -14
  99. package/src/lib/app-utils/expand-repeatables.js.map +1 -1
  100. package/src/lib/app-utils/forms.js +2 -2
  101. package/src/lib/app-utils/forms.js.map +1 -1
  102. package/src/lib/app-utils/health-report.d.ts +2 -3
  103. package/src/lib/app-utils/health-report.js +8 -6
  104. package/src/lib/app-utils/health-report.js.map +1 -1
  105. package/src/lib/app-utils/host-events.d.ts +82 -0
  106. package/src/lib/app-utils/host-events.js +62 -0
  107. package/src/lib/app-utils/host-events.js.map +1 -0
  108. package/src/lib/app-utils/inbound-mail-domain.d.ts +27 -0
  109. package/src/lib/app-utils/inbound-mail-domain.js +31 -0
  110. package/src/lib/app-utils/inbound-mail-domain.js.map +1 -0
  111. package/src/lib/app-utils/lockdown.d.ts +11 -0
  112. package/src/lib/app-utils/lockdown.js +33 -3
  113. package/src/lib/app-utils/lockdown.js.map +1 -1
  114. package/src/lib/app-utils/margin-utilization.d.ts +4 -69
  115. package/src/lib/app-utils/margin-utilization.js +82 -69
  116. package/src/lib/app-utils/margin-utilization.js.map +1 -1
  117. package/src/lib/app-utils/member-email-aliases.d.ts +25 -0
  118. package/src/lib/app-utils/member-email-aliases.js +29 -0
  119. package/src/lib/app-utils/member-email-aliases.js.map +1 -1
  120. package/src/lib/app-utils/node-definition-sanitizer.d.ts +16 -16
  121. package/src/lib/app-utils/node-definition-sanitizer.js +24 -20
  122. package/src/lib/app-utils/node-definition-sanitizer.js.map +1 -1
  123. package/src/lib/app-utils/node-interactions.d.ts +7 -7
  124. package/src/lib/app-utils/node-interactions.js.map +1 -1
  125. package/src/lib/app-utils/notifications.d.ts +147 -47
  126. package/src/lib/app-utils/notifications.js +182 -44
  127. package/src/lib/app-utils/notifications.js.map +1 -1
  128. package/src/lib/app-utils/operator-alerts.d.ts +15 -1
  129. package/src/lib/app-utils/operator-alerts.js +47 -10
  130. package/src/lib/app-utils/operator-alerts.js.map +1 -1
  131. package/src/lib/app-utils/payments-configured.d.ts +8 -21
  132. package/src/lib/app-utils/payments-configured.js +8 -23
  133. package/src/lib/app-utils/payments-configured.js.map +1 -1
  134. package/src/lib/app-utils/plan-entitlements.d.ts +207 -306
  135. package/src/lib/app-utils/plan-entitlements.js +345 -528
  136. package/src/lib/app-utils/plan-entitlements.js.map +1 -1
  137. package/src/lib/app-utils/platform-brand.d.ts +10 -0
  138. package/src/lib/app-utils/platform-brand.js +14 -3
  139. package/src/lib/app-utils/platform-brand.js.map +1 -1
  140. package/src/lib/app-utils/platform-marketing-consent.d.ts +56 -2
  141. package/src/lib/app-utils/platform-marketing-consent.js +6 -5
  142. package/src/lib/app-utils/platform-marketing-consent.js.map +1 -1
  143. package/src/lib/app-utils/plugin-api-rate-limit.d.ts +7 -1
  144. package/src/lib/app-utils/plugin-api-rate-limit.js +11 -3
  145. package/src/lib/app-utils/plugin-api-rate-limit.js.map +1 -1
  146. package/src/lib/app-utils/plugin-bundle-checks.js +2 -2
  147. package/src/lib/app-utils/plugin-bundle-checks.js.map +1 -1
  148. package/src/lib/app-utils/plugin-host-events.generated.d.ts +12 -0
  149. package/src/lib/app-utils/plugin-host-events.generated.js +169 -0
  150. package/src/lib/app-utils/plugin-host-events.generated.js.map +1 -0
  151. package/src/lib/app-utils/plugin-release-flags.generated.d.ts +12 -0
  152. package/src/lib/app-utils/plugin-release-flags.generated.js +106 -0
  153. package/src/lib/app-utils/plugin-release-flags.generated.js.map +1 -0
  154. package/src/lib/app-utils/plugin-starter-templates.generated.d.ts +12 -0
  155. package/src/lib/app-utils/plugin-starter-templates.generated.js +711 -0
  156. package/src/lib/app-utils/plugin-starter-templates.generated.js.map +1 -0
  157. package/src/lib/app-utils/realm-host-surface.generated.js +2 -0
  158. package/src/lib/app-utils/realm-host-surface.generated.js.map +1 -1
  159. package/src/lib/app-utils/release-flags.d.ts +14 -5
  160. package/src/lib/app-utils/release-flags.js +21 -125
  161. package/src/lib/app-utils/release-flags.js.map +1 -1
  162. package/src/lib/app-utils/repeat-query.d.ts +56 -0
  163. package/src/lib/app-utils/{dataset-query.js → repeat-query.js} +16 -16
  164. package/src/lib/app-utils/repeat-query.js.map +1 -0
  165. package/src/lib/app-utils/repeat-sources.d.ts +9 -0
  166. package/src/lib/app-utils/repeat-sources.js.map +1 -1
  167. package/src/lib/app-utils/retained-refusals.d.ts +73 -0
  168. package/src/lib/app-utils/retained-refusals.js +186 -0
  169. package/src/lib/app-utils/retained-refusals.js.map +1 -0
  170. package/src/lib/app-utils/scope-tokens.d.ts +27 -0
  171. package/src/lib/app-utils/scope-tokens.js +61 -0
  172. package/src/lib/app-utils/scope-tokens.js.map +1 -1
  173. package/src/lib/app-utils/screen-link-context.js +3 -3
  174. package/src/lib/app-utils/screen-link-context.js.map +1 -1
  175. package/src/lib/app-utils/screen-route.js +1 -1
  176. package/src/lib/app-utils/screen-route.js.map +1 -1
  177. package/src/lib/app-utils/seo-audit.d.ts +132 -0
  178. package/src/lib/app-utils/seo-audit.js +246 -0
  179. package/src/lib/app-utils/seo-audit.js.map +1 -0
  180. package/src/lib/app-utils/seo-keywords.d.ts +48 -0
  181. package/src/lib/app-utils/seo-keywords.js +60 -0
  182. package/src/lib/app-utils/seo-keywords.js.map +1 -0
  183. package/src/lib/app-utils/seo-page-facts.d.ts +66 -0
  184. package/src/lib/app-utils/seo-page-facts.js +155 -0
  185. package/src/lib/app-utils/seo-page-facts.js.map +1 -0
  186. package/src/lib/app-utils/seo-site-scan.d.ts +126 -0
  187. package/src/lib/app-utils/seo-site-scan.js +162 -0
  188. package/src/lib/app-utils/seo-site-scan.js.map +1 -0
  189. package/src/lib/app-utils/seo-title-variables.js +1 -1
  190. package/src/lib/app-utils/seo-title-variables.js.map +1 -1
  191. package/src/lib/app-utils/server.d.ts +13 -18
  192. package/src/lib/app-utils/server.js +33 -51
  193. package/src/lib/app-utils/server.js.map +1 -1
  194. package/src/lib/app-utils/site-interactions.d.ts +501 -0
  195. package/src/lib/app-utils/site-interactions.js +554 -0
  196. package/src/lib/app-utils/site-interactions.js.map +1 -0
  197. package/src/lib/app-utils/{marketplace-theme.d.ts → site-theme.d.ts} +13 -2
  198. package/src/lib/app-utils/{marketplace-theme.js → site-theme.js} +2 -2
  199. package/src/lib/app-utils/site-theme.js.map +1 -0
  200. package/src/lib/app-utils/sitemap.d.ts +4 -3
  201. package/src/lib/app-utils/sitemap.js +9 -7
  202. package/src/lib/app-utils/sitemap.js.map +1 -1
  203. package/src/lib/app-utils/stale-build-error.d.ts +51 -0
  204. package/src/lib/app-utils/stale-build-error.js +100 -1
  205. package/src/lib/app-utils/stale-build-error.js.map +1 -1
  206. package/src/lib/app-utils/starter-template-nodes.d.ts +137 -0
  207. package/src/lib/app-utils/starter-template-nodes.js +129 -0
  208. package/src/lib/app-utils/starter-template-nodes.js.map +1 -0
  209. package/src/lib/app-utils/starter-templates.d.ts +11 -34
  210. package/src/lib/app-utils/starter-templates.js +19 -230
  211. package/src/lib/app-utils/starter-templates.js.map +1 -1
  212. package/src/lib/app-utils/{email-topics.d.ts → subscription-topics.d.ts} +64 -48
  213. package/src/lib/app-utils/{email-topics.js → subscription-topics.js} +39 -109
  214. package/src/lib/app-utils/subscription-topics.js.map +1 -0
  215. package/src/lib/app-utils/tax-jurisdiction-figures.d.ts +118 -0
  216. package/src/lib/app-utils/tax-jurisdiction-figures.js +123 -0
  217. package/src/lib/app-utils/tax-jurisdiction-figures.js.map +1 -0
  218. package/src/lib/app-utils/theme-library.d.ts +10 -3
  219. package/src/lib/app-utils/theme-library.js +13 -4
  220. package/src/lib/app-utils/theme-library.js.map +1 -1
  221. package/src/lib/app-utils/usage-budget.d.ts +73 -188
  222. package/src/lib/app-utils/usage-budget.js +58 -194
  223. package/src/lib/app-utils/usage-budget.js.map +1 -1
  224. package/src/lib/app-utils/{campaign-attribution.d.ts → utm-attribution.d.ts} +11 -6
  225. package/src/lib/app-utils/{campaign-attribution.js → utm-attribution.js} +13 -8
  226. package/src/lib/app-utils/utm-attribution.js.map +1 -0
  227. package/src/lib/app-utils/{campaign-forwarding.d.ts → utm-forwarding.d.ts} +14 -14
  228. package/src/lib/app-utils/{campaign-forwarding.js → utm-forwarding.js} +26 -26
  229. package/src/lib/app-utils/utm-forwarding.js.map +1 -0
  230. package/src/lib/app-utils/{campaign-touch.d.ts → utm-touch.d.ts} +25 -17
  231. package/src/lib/app-utils/{campaign-touch.js → utm-touch.js} +38 -30
  232. package/src/lib/app-utils/utm-touch.js.map +1 -0
  233. package/src/lib/app-utils/variables.d.ts +9 -9
  234. package/src/lib/app-utils/variables.js.map +1 -1
  235. package/src/lib/app-utils/video-object.js +6 -5
  236. package/src/lib/app-utils/video-object.js.map +1 -1
  237. package/src/lib/app-utils/visitor-consent.d.ts +41 -164
  238. package/src/lib/app-utils/visitor-consent.js +66 -277
  239. package/src/lib/app-utils/visitor-consent.js.map +1 -1
  240. package/src/lib/app-utils/visitor-record-ceiling.d.ts +32 -0
  241. package/src/lib/app-utils/visitor-record-ceiling.js +39 -0
  242. package/src/lib/app-utils/visitor-record-ceiling.js.map +1 -1
  243. package/src/lib/app-utils/web-vitals-rum.d.ts +7 -7
  244. package/src/lib/app-utils/web-vitals-rum.js +31 -63
  245. package/src/lib/app-utils/web-vitals-rum.js.map +1 -1
  246. package/src/lib/app-utils/where-used.d.ts +11 -6
  247. package/src/lib/app-utils/where-used.js +3 -8
  248. package/src/lib/app-utils/where-used.js.map +1 -1
  249. package/src/lib/foundation/definitions/components.types.d.ts +1 -1
  250. package/src/lib/foundation/definitions/components.types.js +1 -1
  251. package/src/lib/foundation/definitions/components.types.js.map +1 -1
  252. package/src/lib/foundation/definitions/org-billing.types.d.ts +11 -137
  253. package/src/lib/foundation/definitions/org-billing.types.js.map +1 -1
  254. package/src/lib/foundation/definitions/organization.types.d.ts +1 -3
  255. package/src/lib/foundation/definitions/organization.types.js.map +1 -1
  256. package/src/lib/foundation/definitions/platform.types.d.ts +11 -5
  257. package/src/lib/foundation/definitions/platform.types.js.map +1 -1
  258. package/src/lib/foundation/definitions/write-deny-coverage.util.d.ts +16 -0
  259. package/src/lib/foundation/definitions/write-deny-coverage.util.js +20 -0
  260. package/src/lib/foundation/definitions/write-deny-coverage.util.js.map +1 -1
  261. package/src/lib/foundation/index.d.ts +1 -1
  262. package/src/lib/foundation/index.js.map +1 -1
  263. package/src/lib/plugin-manager/besigner-documents.d.ts +96 -0
  264. package/src/lib/plugin-manager/besigner-documents.js +61 -0
  265. package/src/lib/plugin-manager/besigner-documents.js.map +1 -0
  266. package/src/lib/plugin-manager/computed-variables.d.ts +71 -0
  267. package/src/lib/plugin-manager/computed-variables.js +74 -0
  268. package/src/lib/plugin-manager/computed-variables.js.map +1 -0
  269. package/src/lib/plugin-manager/custom-fields.d.ts +29 -2
  270. package/src/lib/plugin-manager/custom-fields.js +47 -1
  271. package/src/lib/plugin-manager/custom-fields.js.map +1 -1
  272. package/src/lib/plugin-manager/feature-plugins.d.ts +372 -99
  273. package/src/lib/plugin-manager/feature-plugins.js +126 -51
  274. package/src/lib/plugin-manager/feature-plugins.js.map +1 -1
  275. package/src/lib/plugin-manager/first-party-plugins.generated.d.ts +134 -0
  276. package/src/lib/plugin-manager/first-party-plugins.generated.js +840 -10
  277. package/src/lib/plugin-manager/first-party-plugins.generated.js.map +1 -1
  278. package/src/lib/plugin-manager/index.d.ts +0 -1
  279. package/src/lib/plugin-manager/index.js +0 -1
  280. package/src/lib/plugin-manager/index.js.map +1 -1
  281. package/src/lib/plugin-manager/plugin-activity-actions.d.ts +12 -0
  282. package/src/lib/plugin-manager/plugin-activity-actions.js +25 -0
  283. package/src/lib/plugin-manager/plugin-activity-actions.js.map +1 -1
  284. package/src/lib/plugin-manager/plugin-contact-capture.d.ts +9 -4
  285. package/src/lib/plugin-manager/plugin-contact-capture.js.map +1 -1
  286. package/src/lib/plugin-manager/plugin-containers.d.ts +68 -0
  287. package/src/lib/plugin-manager/plugin-containers.generated.d.ts +10 -0
  288. package/src/lib/plugin-manager/plugin-containers.generated.js +20 -0
  289. package/src/lib/plugin-manager/plugin-containers.generated.js.map +1 -0
  290. package/src/lib/plugin-manager/plugin-containers.js +27 -0
  291. package/src/lib/plugin-manager/plugin-containers.js.map +1 -0
  292. package/src/lib/plugin-manager/plugin-contributions.d.ts +1 -1
  293. package/src/lib/plugin-manager/plugin-contributions.js.map +1 -1
  294. package/src/lib/plugin-manager/plugin-declarations-repair.d.ts +36 -0
  295. package/src/lib/plugin-manager/plugin-declarations-repair.js +64 -0
  296. package/src/lib/plugin-manager/plugin-declarations-repair.js.map +1 -0
  297. package/src/lib/plugin-manager/plugin-dependents.d.ts +101 -0
  298. package/src/lib/plugin-manager/plugin-dependents.js +75 -0
  299. package/src/lib/plugin-manager/plugin-dependents.js.map +1 -0
  300. package/src/lib/plugin-manager/plugin-distribution.d.ts +55 -0
  301. package/src/lib/plugin-manager/plugin-distribution.js +45 -0
  302. package/src/lib/plugin-manager/plugin-distribution.js.map +1 -0
  303. package/src/lib/plugin-manager/plugin-entitlements.d.ts +8 -0
  304. package/src/lib/plugin-manager/plugin-entitlements.js.map +1 -1
  305. package/src/lib/plugin-manager/plugin-host-collections.d.ts +17 -0
  306. package/src/lib/plugin-manager/plugin-host-collections.js +6 -0
  307. package/src/lib/plugin-manager/plugin-host-collections.js.map +1 -1
  308. package/src/lib/plugin-manager/plugin-host-resources.d.ts +133 -0
  309. package/src/lib/plugin-manager/plugin-host-resources.js +52 -0
  310. package/src/lib/plugin-manager/plugin-host-resources.js.map +1 -0
  311. package/src/lib/plugin-manager/plugin-membership-detach.js +1 -1
  312. package/src/lib/plugin-manager/plugin-membership-detach.js.map +1 -1
  313. package/src/lib/plugin-manager/plugin-org-erasure.d.ts +28 -2
  314. package/src/lib/plugin-manager/plugin-org-erasure.js +61 -2
  315. package/src/lib/plugin-manager/plugin-org-erasure.js.map +1 -1
  316. package/src/lib/plugin-manager/plugin-plan-entitlements.d.ts +123 -0
  317. package/src/lib/plugin-manager/plugin-plan-entitlements.js +101 -0
  318. package/src/lib/plugin-manager/plugin-plan-entitlements.js.map +1 -0
  319. package/src/lib/plugin-manager/plugin-record-email-state.d.ts +69 -0
  320. package/src/lib/plugin-manager/plugin-record-email-state.js +32 -0
  321. package/src/lib/plugin-manager/plugin-record-email-state.js.map +1 -1
  322. package/src/lib/plugin-manager/plugin-record-index.d.ts +95 -0
  323. package/src/lib/plugin-manager/plugin-record-index.js +51 -0
  324. package/src/lib/plugin-manager/plugin-record-index.js.map +1 -0
  325. package/src/lib/plugin-manager/plugin-record-lists.d.ts +115 -0
  326. package/src/lib/plugin-manager/plugin-record-lists.js +75 -0
  327. package/src/lib/plugin-manager/plugin-record-lists.js.map +1 -0
  328. package/src/lib/plugin-manager/plugin-record-timeline.d.ts +42 -8
  329. package/src/lib/plugin-manager/plugin-record-timeline.js.map +1 -1
  330. package/src/lib/plugin-manager/plugin-record-written.d.ts +58 -0
  331. package/src/lib/plugin-manager/plugin-record-written.js +42 -0
  332. package/src/lib/plugin-manager/plugin-record-written.js.map +1 -0
  333. package/src/lib/plugin-manager/plugin-revenue-sources.d.ts +213 -0
  334. package/src/lib/plugin-manager/plugin-revenue-sources.js +194 -0
  335. package/src/lib/plugin-manager/plugin-revenue-sources.js.map +1 -0
  336. package/src/lib/plugin-manager/plugin-site-beacons.d.ts +71 -0
  337. package/src/lib/plugin-manager/plugin-site-beacons.js +54 -0
  338. package/src/lib/plugin-manager/plugin-site-beacons.js.map +1 -0
  339. package/src/lib/plugin-manager/plugin-site-bundle.d.ts +145 -0
  340. package/src/lib/plugin-manager/plugin-site-bundle.js +78 -0
  341. package/src/lib/plugin-manager/plugin-site-bundle.js.map +1 -0
  342. package/src/lib/plugin-manager/plugin-site-cache.d.ts +12 -0
  343. package/src/lib/plugin-manager/plugin-site-cache.js.map +1 -1
  344. package/src/lib/plugin-manager/plugin-site-export.d.ts +81 -0
  345. package/src/lib/plugin-manager/plugin-site-export.js +40 -0
  346. package/src/lib/plugin-manager/plugin-site-export.js.map +1 -0
  347. package/src/lib/plugin-manager/plugin-sitemap-sections.d.ts +88 -0
  348. package/src/lib/plugin-manager/plugin-sitemap-sections.js +29 -0
  349. package/src/lib/plugin-manager/plugin-sitemap-sections.js.map +1 -0
  350. package/src/lib/plugin-manager/plugin-subscription-topics.generated.d.ts +11 -0
  351. package/src/lib/plugin-manager/plugin-subscription-topics.generated.js +41 -0
  352. package/src/lib/plugin-manager/plugin-subscription-topics.generated.js.map +1 -0
  353. package/src/lib/plugin-manager/plugin-tax-profile.d.ts +20 -4
  354. package/src/lib/plugin-manager/plugin-tax-profile.js.map +1 -1
  355. package/src/lib/plugin-manager/plugin-tax-return-sources.d.ts +255 -0
  356. package/src/lib/plugin-manager/plugin-tax-return-sources.js +191 -0
  357. package/src/lib/plugin-manager/plugin-tax-return-sources.js.map +1 -0
  358. package/src/lib/plugin-manager/plugin-template-sources.d.ts +75 -0
  359. package/src/lib/plugin-manager/plugin-template-sources.js +37 -0
  360. package/src/lib/plugin-manager/plugin-template-sources.js.map +1 -0
  361. package/src/lib/plugin-manager/plugin-usage-axes.d.ts +319 -0
  362. package/src/lib/plugin-manager/plugin-usage-axes.js +186 -0
  363. package/src/lib/plugin-manager/plugin-usage-axes.js.map +1 -0
  364. package/src/lib/plugin-manager/plugin-usage-meters.d.ts +108 -0
  365. package/src/lib/plugin-manager/plugin-usage-meters.js +105 -0
  366. package/src/lib/plugin-manager/plugin-usage-meters.js.map +1 -0
  367. package/src/lib/plugin-manager/plugin-zones.d.ts +4 -5
  368. package/src/lib/plugin-manager/plugin-zones.js.map +1 -1
  369. package/src/lib/plugin-manager/realm-host-aglyn.generated.js +2 -0
  370. package/src/lib/plugin-manager/realm-host-aglyn.generated.js.map +1 -1
  371. package/src/lib/plugin-manager/record-captured-contact.d.ts +1 -14
  372. package/src/lib/plugin-manager/record-captured-contact.js +10 -32
  373. package/src/lib/plugin-manager/record-captured-contact.js.map +1 -1
  374. package/src/lib/plugin-manager/repeat-rows.d.ts +124 -0
  375. package/src/lib/plugin-manager/repeat-rows.js +108 -0
  376. package/src/lib/plugin-manager/repeat-rows.js.map +1 -0
  377. package/src/lib/plugin-manager/submission-record-target.d.ts +144 -0
  378. package/src/lib/plugin-manager/submission-record-target.js +125 -0
  379. package/src/lib/plugin-manager/submission-record-target.js.map +1 -0
  380. package/src/lib/plugin-manager/usage-alert-contributors.d.ts +76 -6
  381. package/src/lib/plugin-manager/usage-alert-contributors.js +23 -10
  382. package/src/lib/plugin-manager/usage-alert-contributors.js.map +1 -1
  383. package/src/lib/plugin-manager/video-embed-provider.d.ts +108 -0
  384. package/src/lib/plugin-manager/video-embed-provider.js +165 -0
  385. package/src/lib/plugin-manager/video-embed-provider.js.map +1 -0
  386. package/src/lib/types/nodes.d.ts +2 -2
  387. package/src/lib/types/nodes.js.map +1 -1
  388. package/src/lib/app-utils/assist-credits.d.ts +0 -482
  389. package/src/lib/app-utils/assist-credits.js +0 -509
  390. package/src/lib/app-utils/assist-credits.js.map +0 -1
  391. package/src/lib/app-utils/campaign-attribution.js.map +0 -1
  392. package/src/lib/app-utils/campaign-forwarding.js.map +0 -1
  393. package/src/lib/app-utils/campaign-membership.d.ts +0 -121
  394. package/src/lib/app-utils/campaign-membership.js +0 -189
  395. package/src/lib/app-utils/campaign-membership.js.map +0 -1
  396. package/src/lib/app-utils/campaign-touch.js.map +0 -1
  397. package/src/lib/app-utils/console-record-links.d.ts +0 -163
  398. package/src/lib/app-utils/console-record-links.js +0 -180
  399. package/src/lib/app-utils/console-record-links.js.map +0 -1
  400. package/src/lib/app-utils/contact-holder.d.ts +0 -68
  401. package/src/lib/app-utils/contact-holder.js +0 -129
  402. package/src/lib/app-utils/contact-holder.js.map +0 -1
  403. package/src/lib/app-utils/contact-merge.d.ts +0 -136
  404. package/src/lib/app-utils/contact-merge.js +0 -412
  405. package/src/lib/app-utils/contact-merge.js.map +0 -1
  406. package/src/lib/app-utils/crm-booking.d.ts +0 -75
  407. package/src/lib/app-utils/crm-booking.js +0 -133
  408. package/src/lib/app-utils/crm-booking.js.map +0 -1
  409. package/src/lib/app-utils/crm-csv.d.ts +0 -239
  410. package/src/lib/app-utils/crm-csv.js +0 -467
  411. package/src/lib/app-utils/crm-csv.js.map +0 -1
  412. package/src/lib/app-utils/crm-digest.d.ts +0 -185
  413. package/src/lib/app-utils/crm-digest.js +0 -272
  414. package/src/lib/app-utils/crm-digest.js.map +0 -1
  415. package/src/lib/app-utils/crm-inbound.d.ts +0 -245
  416. package/src/lib/app-utils/crm-inbound.js +0 -407
  417. package/src/lib/app-utils/crm-inbound.js.map +0 -1
  418. package/src/lib/app-utils/crm-reports.d.ts +0 -479
  419. package/src/lib/app-utils/crm-reports.js +0 -680
  420. package/src/lib/app-utils/crm-reports.js.map +0 -1
  421. package/src/lib/app-utils/dataset-csv.js.map +0 -1
  422. package/src/lib/app-utils/dataset-query.d.ts +0 -57
  423. package/src/lib/app-utils/dataset-query.js.map +0 -1
  424. package/src/lib/app-utils/email-topics.js.map +0 -1
  425. package/src/lib/app-utils/form-dataset-binding.d.ts +0 -50
  426. package/src/lib/app-utils/form-dataset-binding.js +0 -74
  427. package/src/lib/app-utils/form-dataset-binding.js.map +0 -1
  428. package/src/lib/app-utils/list-assignment-policy.js.map +0 -1
  429. package/src/lib/app-utils/list-import.d.ts +0 -158
  430. package/src/lib/app-utils/list-import.js +0 -332
  431. package/src/lib/app-utils/list-import.js.map +0 -1
  432. package/src/lib/app-utils/marketplace-listing-visibility.d.ts +0 -122
  433. package/src/lib/app-utils/marketplace-listing-visibility.js +0 -147
  434. package/src/lib/app-utils/marketplace-listing-visibility.js.map +0 -1
  435. package/src/lib/app-utils/marketplace-overrides.js.map +0 -1
  436. package/src/lib/app-utils/marketplace-provenance.js.map +0 -1
  437. package/src/lib/app-utils/marketplace-theme.js.map +0 -1
  438. package/src/lib/app-utils/marketplace-update-state.d.ts +0 -119
  439. package/src/lib/app-utils/marketplace-update-state.js +0 -132
  440. package/src/lib/app-utils/marketplace-update-state.js.map +0 -1
  441. package/src/lib/app-utils/publisher-agreement.d.ts +0 -289
  442. package/src/lib/app-utils/publisher-agreement.js +0 -321
  443. package/src/lib/app-utils/publisher-agreement.js.map +0 -1
  444. package/src/lib/app-utils/wistia-embed.d.ts +0 -104
  445. package/src/lib/app-utils/wistia-embed.js +0 -138
  446. package/src/lib/app-utils/wistia-embed.js.map +0 -1
  447. package/src/lib/app-utils/workflows.d.ts +0 -136
  448. package/src/lib/app-utils/workflows.js +0 -346
  449. package/src/lib/app-utils/workflows.js.map +0 -1
  450. package/src/lib/plugin-manager/commerce-zone-props.d.ts +0 -172
  451. package/src/lib/plugin-manager/commerce-zone-props.js +0 -31
  452. package/src/lib/plugin-manager/commerce-zone-props.js.map +0 -1
  453. package/src/lib/plugin-manager/plugin-metered-lines.d.ts +0 -97
  454. package/src/lib/plugin-manager/plugin-metered-lines.js +0 -123
  455. package/src/lib/plugin-manager/plugin-metered-lines.js.map +0 -1
@@ -0,0 +1,37 @@
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 { PLUGIN_TEMPLATE_SOURCES } from "./first-party-plugins.generated.js";
17
+ /** A template saved on the site itself — and one written before `source`. */ export const AUTHORED_TEMPLATE_SOURCE = 'authored';
18
+ /** A first-party starter, copied into the library when it was used or edited. */ export const STARTER_TEMPLATE_SOURCE = 'starter';
19
+ export { PLUGIN_TEMPLATE_SOURCES };
20
+ /** Every `source.type` a plugin in this build stamps on a template it installs. */ export const INSTALLED_TEMPLATE_SOURCE_TYPES = PLUGIN_TEMPLATE_SOURCES.map((source)=>source.type);
21
+ /**
22
+ * The declaration behind a template's `source.type`, or `null` for the
23
+ * platform's own two values, a missing stamp, and a stamp no plugin in this
24
+ * build declares.
25
+ */ export function installedTemplateSource(type) {
26
+ var _PLUGIN_TEMPLATE_SOURCES_find;
27
+ if (typeof type !== 'string') return null;
28
+ return (_PLUGIN_TEMPLATE_SOURCES_find = PLUGIN_TEMPLATE_SOURCES.find((source)=>source.type === type)) != null ? _PLUGIN_TEMPLATE_SOURCES_find : null;
29
+ }
30
+ /**
31
+ * Whether a template was installed rather than saved here or started from a
32
+ * starter: any stamp but the platform's own two, declared or not.
33
+ */ export function isInstalledTemplateSource(type) {
34
+ return typeof type === 'string' && type !== '' && type !== AUTHORED_TEMPLATE_SOURCE && type !== STARTER_TEMPLATE_SOURCE;
35
+ }
36
+
37
+ //# sourceMappingURL=plugin-template-sources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../libs/aglyn/src/lib/plugin-manager/plugin-template-sources.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 { PLUGIN_TEMPLATE_SOURCES } from './first-party-plugins.generated'\n\n/**\n * Where a site's template came from, by its stored `source.type` (AGL-666,\n * AGL-3080).\n *\n * The stamp is server-managed, which is what lets a site's library show it as\n * a trust signal. Two values are the platform's own: {@link\n * AUTHORED_TEMPLATE_SOURCE}, a template saved on the site, and {@link\n * STARTER_TEMPLATE_SOURCE}, a first-party starter copied in when it was used\n * or edited. Every other value is stamped by a plugin that INSTALLS templates\n * into a site's library, and that plugin declares it as `templateSource` in\n * `plugins.config.json`: the value its install route writes, the badge the\n * library shows, and the sentence explaining the badge.\n *\n * ## Compiled, never registered\n *\n * The readers ask before any plugin code has loaded, and one of them asks\n * Firestore by value: the template gallery's own shelf holds a site's saved\n * AND installed templates, as a `source.type in [...]` clause. A runtime\n * registry the page had not filled yet would leave every installed template\n * off that shelf with nothing to say it was missing, so the declaration is\n * data the generator compiles.\n *\n * ## A type no plugin declares\n *\n * A template installed by a plugin this build no longer carries keeps its\n * stamp, and the stamp still says a server installed it. It reads as\n * installed ({@link installedTemplateSource} answers `null`, and the\n * library's badge says \"Installed\") rather than as something the site\n * authored.\n */\nexport interface PluginTemplateSource {\n /** The plugin that declared it. */\n pluginId: string\n /** The `source.type` the plugin's install route stamps. */\n type: string\n /** The library's badge: the name of where the template came from. */\n label: string\n /** One sentence saying where the template came from, for the badge's hint. */\n description: string\n}\n\n/** A template saved on the site itself — and one written before `source`. */\nexport const AUTHORED_TEMPLATE_SOURCE = 'authored'\n\n/** A first-party starter, copied into the library when it was used or edited. */\nexport const STARTER_TEMPLATE_SOURCE = 'starter'\n\nexport { PLUGIN_TEMPLATE_SOURCES }\n\n/** Every `source.type` a plugin in this build stamps on a template it installs. */\nexport const INSTALLED_TEMPLATE_SOURCE_TYPES: readonly string[] =\n PLUGIN_TEMPLATE_SOURCES.map((source) => source.type)\n\n/**\n * The declaration behind a template's `source.type`, or `null` for the\n * platform's own two values, a missing stamp, and a stamp no plugin in this\n * build declares.\n */\nexport function installedTemplateSource(\n type: unknown,\n): PluginTemplateSource | null {\n if (typeof type !== 'string') return null\n return PLUGIN_TEMPLATE_SOURCES.find((source) => source.type === type) ?? null\n}\n\n/**\n * Whether a template was installed rather than saved here or started from a\n * starter: any stamp but the platform's own two, declared or not.\n */\nexport function isInstalledTemplateSource(type: unknown): boolean {\n return (\n typeof type === 'string' &&\n type !== '' &&\n type !== AUTHORED_TEMPLATE_SOURCE &&\n type !== STARTER_TEMPLATE_SOURCE\n )\n}\n"],"names":["PLUGIN_TEMPLATE_SOURCES","AUTHORED_TEMPLATE_SOURCE","STARTER_TEMPLATE_SOURCE","INSTALLED_TEMPLATE_SOURCE_TYPES","map","source","type","installedTemplateSource","find","isInstalledTemplateSource"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,uBAAuB,QAAQ,qCAAiC;AA2CzE,2EAA2E,GAC3E,OAAO,MAAMC,2BAA2B,WAAU;AAElD,+EAA+E,GAC/E,OAAO,MAAMC,0BAA0B,UAAS;AAEhD,SAASF,uBAAuB,GAAE;AAElC,iFAAiF,GACjF,OAAO,MAAMG,kCACXH,wBAAwBI,GAAG,CAAC,CAACC,SAAWA,OAAOC,IAAI,EAAC;AAEtD;;;;CAIC,GACD,OAAO,SAASC,wBACdD,IAAa;QAGNN;IADP,IAAI,OAAOM,SAAS,UAAU,OAAO;IACrC,QAAON,gCAAAA,wBAAwBQ,IAAI,CAAC,CAACH,SAAWA,OAAOC,IAAI,KAAKA,iBAAzDN,gCAAkE;AAC3E;AAEA;;;CAGC,GACD,OAAO,SAASS,0BAA0BH,IAAa;IACrD,OACE,OAAOA,SAAS,YAChBA,SAAS,MACTA,SAASL,4BACTK,SAASJ;AAEb"}
@@ -0,0 +1,319 @@
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
+ /**
18
+ * WHAT A PLUGIN'S USAGE COSTS, AND HOW MUCH OF ITS BAND IT SPENT (AGL-3080).
19
+ *
20
+ * The platform keeps one cost model (`orgMonthlyCogsUsd`) and one
21
+ * utilization table (`margin-utilization.ts`), and both read the monthly
22
+ * usage rollup. Several of the rollup's meters are a plugin's: the AI
23
+ * plugin's provider spend, the CRM's records, the forms plugin's
24
+ * submissions, the workflows plugin's runs. Core used to name each of them —
25
+ * its rollup field, the unit rate that prices it, the band it is measured
26
+ * against — so a plugin that metered something new could not reach the
27
+ * discount guardrail without a core edit, and core could not be taken
28
+ * without the plugins it named.
29
+ *
30
+ * So a plugin declares its meters, and core composes them:
31
+ *
32
+ * - a COST AXIS names the rollup fields a meter is recorded under and the
33
+ * `ORG_COGS_UNIT_RATES_USD` key that prices one unit, or no key when the
34
+ * field is already dollars. `orgMonthlyCogsUsd` prices it beside core's
35
+ * own axes, and `orgCogsInputFrom` forwards its fields.
36
+ * - a BAND names the rollup fields that measure it and the entitlement that
37
+ * says what the plan includes. The utilization table reads it beside
38
+ * core's own bands. A METERED band is also billed past what the plan
39
+ * includes, at cost × `METERED_MARKUP`, beside storage and bandwidth: the
40
+ * invoice sweep, the Billing card's estimate, the monthly summary and the
41
+ * staff usage rows read it from here.
42
+ * - a SPEND LINE names the month document holding what the plugin's usage
43
+ * came to at the rates it bills, the deployment variable naming the month
44
+ * it is first charged for, and the unit a customer sees it in. The usage
45
+ * budget shows it beside the metered figure and counts it once charged.
46
+ * - a METER names what the plugin measures in the monthly usage sweep
47
+ * (`plugin-usage-meters.ts`), so the sweep can refuse to bill a month the
48
+ * registered meter is missing from.
49
+ *
50
+ * ## What core keeps
51
+ *
52
+ * The MONEY. Every unit rate stays in `ORG_COGS_UNIT_RATES_USD`, beside the
53
+ * billed table it is reconciled against (`METERED_UNIT_RATES_USD`, which a
54
+ * metered band names its rate in), and every included figure stays in
55
+ * `PLAN_ENTITLEMENTS`. A declaration names fields and keys; it carries no
56
+ * price. The one number a declaration may carry is a band's unit cost, where
57
+ * the band is sold in a unit OF cost (a credit is a fixed quantity of
58
+ * dollars), and that number is the plugin's own definition of its unit.
59
+ *
60
+ * ## Compiled, never registered
61
+ *
62
+ * The cost model's readers include the staff org page, which prices a rollup
63
+ * in the browser, and the discount guardrail, whose every wrong answer is in
64
+ * the approving direction: a cost axis a registry had not filled would price
65
+ * at nothing and approve a discount the margin cannot carry. So these are
66
+ * compiled from each plugin's `usage-axes` declaration by the manifest
67
+ * generator, like the plan figures, and a rate key core does not have is an
68
+ * error rather than a zero.
69
+ */
70
+ import type { ReleaseFlagKey } from '../app-utils/release-flags';
71
+ /** A meter a plugin contributes to the platform's cost model. */
72
+ export interface PluginCostAxisDeclaration {
73
+ /** The breakdown key every staff reader shows it under. */
74
+ id: string;
75
+ /** Where it sorts among the cost model's axes; core's own are multiples of 10. */
76
+ order: number;
77
+ /** Rollup fields summed for the axis. */
78
+ fields: readonly string[];
79
+ /**
80
+ * Read only when every one of `fields` is absent from a rollup — the
81
+ * narrower field an older rollup recorded the same meter under.
82
+ */
83
+ fallbackFields?: readonly string[];
84
+ /**
85
+ * Rollup fields recorded beside the meter so its sum is legible, forwarded
86
+ * by `orgCogsInputFrom` and never priced.
87
+ */
88
+ recordedFields?: readonly string[];
89
+ /**
90
+ * Rollup fields the plugin's usage sweep writes beside the meter for its
91
+ * staff surfaces to read — served on the staff usage rows, `null` where a
92
+ * rollup never wrote one, and never forwarded to the cost model.
93
+ */
94
+ staffFields?: readonly string[];
95
+ /**
96
+ * The `ORG_COGS_UNIT_RATES_USD` key pricing one unit. Absent when the
97
+ * fields are already dollars, which then enter the model at ×1.
98
+ */
99
+ rate?: string;
100
+ /**
101
+ * The month's LIVE reading, when the rollup's figure is a snapshot a meter
102
+ * keeps adding to: `orgs/{orgId}/{collection}/{month}`, the first of
103
+ * `fields` that is a positive number. It replaces the axis's first rollup
104
+ * field wherever a reader fetches it.
105
+ */
106
+ live?: {
107
+ collection: string;
108
+ fields: readonly string[];
109
+ };
110
+ }
111
+ /** A band a plugin contributes to the utilization table. */
112
+ export interface PluginUsageBandDeclaration {
113
+ /** The band's key, and the column the staff table shows it under. */
114
+ id: string;
115
+ label: string;
116
+ order: number;
117
+ /** Rollup fields summed for what the org used. */
118
+ fields: readonly string[];
119
+ fallbackFields?: readonly string[];
120
+ /** The resolved entitlement holding what the plan includes. */
121
+ entitlement: string;
122
+ /** The entitlement is per SITE and the org-wide band is it × `hostLimit`. */
123
+ perHost?: boolean;
124
+ /**
125
+ * The band is sold in a unit of cost and the rollup records dollars: what
126
+ * was used is `ceil(dollars / unitCostUsd)`, rounded UP so spend already
127
+ * made never reads as less of the band.
128
+ */
129
+ unitCostUsd?: number;
130
+ /**
131
+ * The per-site monthly counter the band is measured by:
132
+ * `hosts/{hostId}/counters/{hostCounter}`, field `{month}`, summed over the
133
+ * workspace's sites.
134
+ */
135
+ hostCounter?: string;
136
+ /**
137
+ * The workspace is WARNED as it approaches and reaches this band, by the
138
+ * usage-alerts sweep, from its `hostCounter` against what the plan includes
139
+ * of `entitlement`, once per threshold per month. `label` names the band in
140
+ * the title ("monthly workflow runs") and `noun` in the opening sentence
141
+ * ("workflow runs"); `outcome` is what happens at the band — `stops`,
142
+ * `bills` or `continues` — and `reached` and `approach` are the sentences
143
+ * that say so, at the band and approaching it.
144
+ */
145
+ alert?: {
146
+ label: string;
147
+ noun: string;
148
+ outcome: 'stops' | 'bills' | 'continues';
149
+ reached: string;
150
+ approach: string;
151
+ };
152
+ /**
153
+ * The band is one of the INFRASTRUCTURE meters (AGL-1280): what the
154
+ * workspace uses past it is billed at our cost × `METERED_MARKUP`, beside
155
+ * storage and bandwidth, on the same invoice line and the same estimate.
156
+ * A metered band names one rollup field and the `hostCounter` it is
157
+ * measured by.
158
+ */
159
+ metered?: PluginMeteredBand;
160
+ }
161
+ /** How a metered band is priced, quoted and withheld. */
162
+ export interface PluginMeteredBand {
163
+ /**
164
+ * The `METERED_UNIT_RATES_USD` key holding our cost per unit — never a
165
+ * number: the rate table is the platform's, beside the markup it is
166
+ * published with.
167
+ */
168
+ rate: string;
169
+ /** The count a published price is quoted per: `1000` reads "per 1,000". */
170
+ quotedPer: number;
171
+ /** The band in running prose, plural and lowercase: "form submissions". */
172
+ noun: string;
173
+ /**
174
+ * A release flag the overage waits behind: while it is off for the
175
+ * workspace, the units are counted and the charge is recorded as withheld
176
+ * rather than billed — nobody is charged for what they cannot reach
177
+ * (AGL-1604). The rollup records the verdict as `{field}Billed` and what
178
+ * was forgone, at cost, as `{field}OverageWithheldUsd`.
179
+ */
180
+ withheldUntil?: ReleaseFlagKey;
181
+ }
182
+ /**
183
+ * A line of a workspace's monthly SPEND a plugin contributes to its usage
184
+ * budget (`usage-budget.ts`): what the plugin's usage came to this month, in
185
+ * the dollars it is billed at, shown on the customer's budget card and
186
+ * counted toward the budget from the month the plugin starts charging for it.
187
+ */
188
+ export interface PluginSpendLineDeclaration {
189
+ /** The line's key. */
190
+ id: string;
191
+ /** What the budget card and the budget alert call it. */
192
+ label: string;
193
+ /**
194
+ * Where the month's figure is read: `orgs/{orgId}/{collection}/{month}`,
195
+ * field `field`, in dollars.
196
+ */
197
+ live: {
198
+ collection: string;
199
+ field: string;
200
+ };
201
+ /**
202
+ * The deployment variable naming the first month (`YYYY-MM`) the line is
203
+ * charged for. Until it names this month or an earlier one — and on any
204
+ * value that is not a month — the line is shown and never counted.
205
+ */
206
+ billedFromEnv: string;
207
+ /**
208
+ * The unit the customer is shown the line in, when the stored dollars are
209
+ * not theirs to see: `ceil(dollars / costUsd)` of `label`, and the dollar
210
+ * figure never crosses to the browser.
211
+ */
212
+ unit?: {
213
+ costUsd: number;
214
+ label: string;
215
+ };
216
+ }
217
+ /**
218
+ * A meter the plugin measures in the platform's monthly usage sweep and
219
+ * registers at runtime (`plugin-usage-meters.ts`). Declared as well as
220
+ * registered so the sweep can refuse to bill a workspace's month without it.
221
+ */
222
+ export interface PluginUsageMeterDeclaration {
223
+ /** As `registerPluginUsageMeter` names it. */
224
+ id: string;
225
+ }
226
+ export type ResolvedPluginCostAxis = PluginCostAxisDeclaration & {
227
+ pluginId: string;
228
+ };
229
+ export type ResolvedPluginUsageBand = PluginUsageBandDeclaration & {
230
+ pluginId: string;
231
+ };
232
+ export type ResolvedPluginSpendLine = PluginSpendLineDeclaration & {
233
+ pluginId: string;
234
+ };
235
+ export type ResolvedPluginUsageMeter = PluginUsageMeterDeclaration & {
236
+ pluginId: string;
237
+ };
238
+ /** What a plugin's `usageAxes` function answers. */
239
+ export interface PluginUsageAxesDeclaration {
240
+ costAxes?: readonly PluginCostAxisDeclaration[];
241
+ bands?: readonly PluginUsageBandDeclaration[];
242
+ spendLines?: readonly PluginSpendLineDeclaration[];
243
+ meters?: readonly PluginUsageMeterDeclaration[];
244
+ }
245
+ export declare function pluginCostAxes(): readonly ResolvedPluginCostAxis[];
246
+ export declare function pluginUsageBands(): readonly ResolvedPluginUsageBand[];
247
+ /** A declared band that is metered, with its one field and its counter. */
248
+ export type ResolvedPluginMeteredBand = ResolvedPluginUsageBand & {
249
+ metered: PluginMeteredBand;
250
+ hostCounter: string;
251
+ };
252
+ /**
253
+ * Every band billed at cost past what the plan includes, in band order — the
254
+ * infrastructure meters a plugin adds beside storage and bandwidth.
255
+ */
256
+ export declare function meteredPluginBands(): readonly ResolvedPluginMeteredBand[];
257
+ /** A declared band measured by a per-site counter and never billed past it. */
258
+ export type ResolvedPluginCountedBand = ResolvedPluginUsageBand & {
259
+ hostCounter: string;
260
+ };
261
+ /**
262
+ * Every band measured by a per-site counter and not metered, in band order:
263
+ * the usage sweep sums each across the workspace's sites and records it under
264
+ * the band's first field, and the staff usage rows show the count. A metered
265
+ * band's counter is read with the infrastructure meters instead.
266
+ */
267
+ export declare function countedPluginBands(): readonly ResolvedPluginCountedBand[];
268
+ /** The rollup field a metered band records its count under. */
269
+ export declare function meteredBandField(band: ResolvedPluginMeteredBand): string;
270
+ /**
271
+ * Where the rollup records a withheld band's verdict (`metered.withheldUntil`):
272
+ * whether the month billed the band's overage, and what was forgone, at cost,
273
+ * when it did not. Without the second a withheld month reads as a month that
274
+ * stayed inside the band.
275
+ */
276
+ export declare function meteredBandVerdictFields(band: ResolvedPluginMeteredBand): {
277
+ billed: string;
278
+ withheldUsd: string;
279
+ };
280
+ export declare function pluginSpendLines(): readonly ResolvedPluginSpendLine[];
281
+ /**
282
+ * What a rollup recorded for a declared meter: `fields` summed, or
283
+ * `fallbackFields` summed when the rollup carries none of `fields` at all.
284
+ *
285
+ * "Carries none" is `null` or absent, never zero. A rollup that measured
286
+ * zero has answered, and must not fall back to a figure recorded under an
287
+ * older, narrower basis.
288
+ */
289
+ export declare function declaredMeterReading(source: Readonly<Record<string, unknown>> | null | undefined, declared: {
290
+ fields: readonly string[];
291
+ fallbackFields?: readonly string[];
292
+ }): number;
293
+ /**
294
+ * The live reading a cost axis names: the first of its `live.fields` that is
295
+ * a positive number on the month's document, or `undefined` when none is.
296
+ * `undefined` is "keep the rollup's snapshot", never zero.
297
+ */
298
+ export declare function liveMeterReading(document: {
299
+ get(field: string): unknown;
300
+ } | null | undefined, live: {
301
+ fields: readonly string[];
302
+ }): number | undefined;
303
+ /** Every rollup field the declared cost axes read or record, in order. */
304
+ export declare function pluginCostAxisFields(): string[];
305
+ /**
306
+ * A month's rollup as a staff reader is served it, one entry per field the
307
+ * declared cost axes read, record or serve to staff (`get` reads one rollup
308
+ * field).
309
+ *
310
+ * A field an axis prices reads zero where the rollup lacks it, as the cost
311
+ * model reads it — except where the axis falls back to an older basis when
312
+ * the rollup carries none of its fields: there absence is the answer that
313
+ * selects the fallback, so it is served as `null`, and a reader pricing the
314
+ * served row reads the month the way the sweep did. A field an axis only
315
+ * records or serves reads `null` when the rollup never wrote it: "not
316
+ * recorded" and "recorded zero" are different answers, and a projection
317
+ * that collapses them invents history (AGL-2321).
318
+ */
319
+ export declare function pluginCostAxisProjection(get: (field: string) => unknown): Record<string, number | null>;
@@ -0,0 +1,186 @@
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
+ * WHAT A PLUGIN'S USAGE COSTS, AND HOW MUCH OF ITS BAND IT SPENT (AGL-3080).
18
+ *
19
+ * The platform keeps one cost model (`orgMonthlyCogsUsd`) and one
20
+ * utilization table (`margin-utilization.ts`), and both read the monthly
21
+ * usage rollup. Several of the rollup's meters are a plugin's: the AI
22
+ * plugin's provider spend, the CRM's records, the forms plugin's
23
+ * submissions, the workflows plugin's runs. Core used to name each of them —
24
+ * its rollup field, the unit rate that prices it, the band it is measured
25
+ * against — so a plugin that metered something new could not reach the
26
+ * discount guardrail without a core edit, and core could not be taken
27
+ * without the plugins it named.
28
+ *
29
+ * So a plugin declares its meters, and core composes them:
30
+ *
31
+ * - a COST AXIS names the rollup fields a meter is recorded under and the
32
+ * `ORG_COGS_UNIT_RATES_USD` key that prices one unit, or no key when the
33
+ * field is already dollars. `orgMonthlyCogsUsd` prices it beside core's
34
+ * own axes, and `orgCogsInputFrom` forwards its fields.
35
+ * - a BAND names the rollup fields that measure it and the entitlement that
36
+ * says what the plan includes. The utilization table reads it beside
37
+ * core's own bands. A METERED band is also billed past what the plan
38
+ * includes, at cost × `METERED_MARKUP`, beside storage and bandwidth: the
39
+ * invoice sweep, the Billing card's estimate, the monthly summary and the
40
+ * staff usage rows read it from here.
41
+ * - a SPEND LINE names the month document holding what the plugin's usage
42
+ * came to at the rates it bills, the deployment variable naming the month
43
+ * it is first charged for, and the unit a customer sees it in. The usage
44
+ * budget shows it beside the metered figure and counts it once charged.
45
+ * - a METER names what the plugin measures in the monthly usage sweep
46
+ * (`plugin-usage-meters.ts`), so the sweep can refuse to bill a month the
47
+ * registered meter is missing from.
48
+ *
49
+ * ## What core keeps
50
+ *
51
+ * The MONEY. Every unit rate stays in `ORG_COGS_UNIT_RATES_USD`, beside the
52
+ * billed table it is reconciled against (`METERED_UNIT_RATES_USD`, which a
53
+ * metered band names its rate in), and every included figure stays in
54
+ * `PLAN_ENTITLEMENTS`. A declaration names fields and keys; it carries no
55
+ * price. The one number a declaration may carry is a band's unit cost, where
56
+ * the band is sold in a unit OF cost (a credit is a fixed quantity of
57
+ * dollars), and that number is the plugin's own definition of its unit.
58
+ *
59
+ * ## Compiled, never registered
60
+ *
61
+ * The cost model's readers include the staff org page, which prices a rollup
62
+ * in the browser, and the discount guardrail, whose every wrong answer is in
63
+ * the approving direction: a cost axis a registry had not filled would price
64
+ * at nothing and approve a discount the margin cannot carry. So these are
65
+ * compiled from each plugin's `usage-axes` declaration by the manifest
66
+ * generator, like the plan figures, and a rate key core does not have is an
67
+ * error rather than a zero.
68
+ */ import { PLUGIN_COST_AXES_DECLARED, PLUGIN_SPEND_LINES_DECLARED, PLUGIN_USAGE_BANDS_DECLARED } from "./first-party-plugins.generated.js";
69
+ export function pluginCostAxes() {
70
+ return PLUGIN_COST_AXES_DECLARED;
71
+ }
72
+ export function pluginUsageBands() {
73
+ return PLUGIN_USAGE_BANDS_DECLARED;
74
+ }
75
+ /**
76
+ * Every band billed at cost past what the plan includes, in band order — the
77
+ * infrastructure meters a plugin adds beside storage and bandwidth.
78
+ */ export function meteredPluginBands() {
79
+ return PLUGIN_USAGE_BANDS_DECLARED.filter((band)=>Boolean(band.metered && band.hostCounter));
80
+ }
81
+ /**
82
+ * Every band measured by a per-site counter and not metered, in band order:
83
+ * the usage sweep sums each across the workspace's sites and records it under
84
+ * the band's first field, and the staff usage rows show the count. A metered
85
+ * band's counter is read with the infrastructure meters instead.
86
+ */ export function countedPluginBands() {
87
+ return PLUGIN_USAGE_BANDS_DECLARED.filter((band)=>Boolean(band.hostCounter && !band.metered));
88
+ }
89
+ /** The rollup field a metered band records its count under. */ export function meteredBandField(band) {
90
+ return band.fields[0];
91
+ }
92
+ /**
93
+ * Where the rollup records a withheld band's verdict (`metered.withheldUntil`):
94
+ * whether the month billed the band's overage, and what was forgone, at cost,
95
+ * when it did not. Without the second a withheld month reads as a month that
96
+ * stayed inside the band.
97
+ */ export function meteredBandVerdictFields(band) {
98
+ const field = meteredBandField(band);
99
+ return {
100
+ billed: `${field}Billed`,
101
+ withheldUsd: `${field}OverageWithheldUsd`
102
+ };
103
+ }
104
+ export function pluginSpendLines() {
105
+ return PLUGIN_SPEND_LINES_DECLARED;
106
+ }
107
+ /** A positive finite number, or 0 — the reading every meter is priced from. */ function meterValue(value) {
108
+ const parsed = Number(value != null ? value : 0);
109
+ return Number.isFinite(parsed) && parsed > 0 ? parsed : 0;
110
+ }
111
+ /**
112
+ * What a rollup recorded for a declared meter: `fields` summed, or
113
+ * `fallbackFields` summed when the rollup carries none of `fields` at all.
114
+ *
115
+ * "Carries none" is `null` or absent, never zero. A rollup that measured
116
+ * zero has answered, and must not fall back to a figure recorded under an
117
+ * older, narrower basis.
118
+ */ export function declaredMeterReading(source, declared) {
119
+ var _declared_fallbackFields;
120
+ const present = declared.fields.some((field)=>(source == null ? void 0 : source[field]) != null);
121
+ const fields = !present && ((_declared_fallbackFields = declared.fallbackFields) == null ? void 0 : _declared_fallbackFields.length) ? declared.fallbackFields : declared.fields;
122
+ return fields.reduce((sum, field)=>sum + meterValue(source == null ? void 0 : source[field]), 0);
123
+ }
124
+ /**
125
+ * The live reading a cost axis names: the first of its `live.fields` that is
126
+ * a positive number on the month's document, or `undefined` when none is.
127
+ * `undefined` is "keep the rollup's snapshot", never zero.
128
+ */ export function liveMeterReading(document, live) {
129
+ for (const field of live.fields){
130
+ const value = meterValue(document == null ? void 0 : document.get(field));
131
+ if (value > 0) return value;
132
+ }
133
+ return undefined;
134
+ }
135
+ /** Every rollup field the declared cost axes read or record, in order. */ export function pluginCostAxisFields() {
136
+ const fields = [];
137
+ for (const axis of PLUGIN_COST_AXES_DECLARED){
138
+ var _axis_fallbackFields, _axis_recordedFields;
139
+ for (const field of [
140
+ ...axis.fields,
141
+ ...(_axis_fallbackFields = axis.fallbackFields) != null ? _axis_fallbackFields : [],
142
+ ...(_axis_recordedFields = axis.recordedFields) != null ? _axis_recordedFields : []
143
+ ]){
144
+ if (!fields.includes(field)) fields.push(field);
145
+ }
146
+ }
147
+ return fields;
148
+ }
149
+ /**
150
+ * A month's rollup as a staff reader is served it, one entry per field the
151
+ * declared cost axes read, record or serve to staff (`get` reads one rollup
152
+ * field).
153
+ *
154
+ * A field an axis prices reads zero where the rollup lacks it, as the cost
155
+ * model reads it — except where the axis falls back to an older basis when
156
+ * the rollup carries none of its fields: there absence is the answer that
157
+ * selects the fallback, so it is served as `null`, and a reader pricing the
158
+ * served row reads the month the way the sweep did. A field an axis only
159
+ * records or serves reads `null` when the rollup never wrote it: "not
160
+ * recorded" and "recorded zero" are different answers, and a projection
161
+ * that collapses them invents history (AGL-2321).
162
+ */ export function pluginCostAxisProjection(get) {
163
+ const out = {};
164
+ for (const axis of PLUGIN_COST_AXES_DECLARED){
165
+ var _axis_recordedFields, _axis_staffFields, _axis_fallbackFields, _axis_recordedFields1, _axis_staffFields1;
166
+ var _axis_fallbackFields1;
167
+ const absentIsNull = [
168
+ ...((_axis_fallbackFields1 = axis.fallbackFields) == null ? void 0 : _axis_fallbackFields1.length) ? axis.fields : [],
169
+ ...(_axis_recordedFields = axis.recordedFields) != null ? _axis_recordedFields : [],
170
+ ...(_axis_staffFields = axis.staffFields) != null ? _axis_staffFields : []
171
+ ];
172
+ for (const field of [
173
+ ...axis.fields,
174
+ ...(_axis_fallbackFields = axis.fallbackFields) != null ? _axis_fallbackFields : [],
175
+ ...(_axis_recordedFields1 = axis.recordedFields) != null ? _axis_recordedFields1 : [],
176
+ ...(_axis_staffFields1 = axis.staffFields) != null ? _axis_staffFields1 : []
177
+ ]){
178
+ if (field in out) continue;
179
+ const value = get(field);
180
+ out[field] = value != null ? Number(value) : absentIsNull.includes(field) ? null : 0;
181
+ }
182
+ }
183
+ return out;
184
+ }
185
+
186
+ //# sourceMappingURL=plugin-usage-axes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../libs/aglyn/src/lib/plugin-manager/plugin-usage-axes.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\n/**\n * WHAT A PLUGIN'S USAGE COSTS, AND HOW MUCH OF ITS BAND IT SPENT (AGL-3080).\n *\n * The platform keeps one cost model (`orgMonthlyCogsUsd`) and one\n * utilization table (`margin-utilization.ts`), and both read the monthly\n * usage rollup. Several of the rollup's meters are a plugin's: the AI\n * plugin's provider spend, the CRM's records, the forms plugin's\n * submissions, the workflows plugin's runs. Core used to name each of them —\n * its rollup field, the unit rate that prices it, the band it is measured\n * against — so a plugin that metered something new could not reach the\n * discount guardrail without a core edit, and core could not be taken\n * without the plugins it named.\n *\n * So a plugin declares its meters, and core composes them:\n *\n * - a COST AXIS names the rollup fields a meter is recorded under and the\n * `ORG_COGS_UNIT_RATES_USD` key that prices one unit, or no key when the\n * field is already dollars. `orgMonthlyCogsUsd` prices it beside core's\n * own axes, and `orgCogsInputFrom` forwards its fields.\n * - a BAND names the rollup fields that measure it and the entitlement that\n * says what the plan includes. The utilization table reads it beside\n * core's own bands. A METERED band is also billed past what the plan\n * includes, at cost × `METERED_MARKUP`, beside storage and bandwidth: the\n * invoice sweep, the Billing card's estimate, the monthly summary and the\n * staff usage rows read it from here.\n * - a SPEND LINE names the month document holding what the plugin's usage\n * came to at the rates it bills, the deployment variable naming the month\n * it is first charged for, and the unit a customer sees it in. The usage\n * budget shows it beside the metered figure and counts it once charged.\n * - a METER names what the plugin measures in the monthly usage sweep\n * (`plugin-usage-meters.ts`), so the sweep can refuse to bill a month the\n * registered meter is missing from.\n *\n * ## What core keeps\n *\n * The MONEY. Every unit rate stays in `ORG_COGS_UNIT_RATES_USD`, beside the\n * billed table it is reconciled against (`METERED_UNIT_RATES_USD`, which a\n * metered band names its rate in), and every included figure stays in\n * `PLAN_ENTITLEMENTS`. A declaration names fields and keys; it carries no\n * price. The one number a declaration may carry is a band's unit cost, where\n * the band is sold in a unit OF cost (a credit is a fixed quantity of\n * dollars), and that number is the plugin's own definition of its unit.\n *\n * ## Compiled, never registered\n *\n * The cost model's readers include the staff org page, which prices a rollup\n * in the browser, and the discount guardrail, whose every wrong answer is in\n * the approving direction: a cost axis a registry had not filled would price\n * at nothing and approve a discount the margin cannot carry. So these are\n * compiled from each plugin's `usage-axes` declaration by the manifest\n * generator, like the plan figures, and a rate key core does not have is an\n * error rather than a zero.\n */\n\nimport type { ReleaseFlagKey } from '../app-utils/release-flags'\nimport {\n PLUGIN_COST_AXES_DECLARED,\n PLUGIN_SPEND_LINES_DECLARED,\n PLUGIN_USAGE_BANDS_DECLARED,\n} from './first-party-plugins.generated'\n\n/** A meter a plugin contributes to the platform's cost model. */\nexport interface PluginCostAxisDeclaration {\n /** The breakdown key every staff reader shows it under. */\n id: string\n /** Where it sorts among the cost model's axes; core's own are multiples of 10. */\n order: number\n /** Rollup fields summed for the axis. */\n fields: readonly string[]\n /**\n * Read only when every one of `fields` is absent from a rollup — the\n * narrower field an older rollup recorded the same meter under.\n */\n fallbackFields?: readonly string[]\n /**\n * Rollup fields recorded beside the meter so its sum is legible, forwarded\n * by `orgCogsInputFrom` and never priced.\n */\n recordedFields?: readonly string[]\n /**\n * Rollup fields the plugin's usage sweep writes beside the meter for its\n * staff surfaces to read — served on the staff usage rows, `null` where a\n * rollup never wrote one, and never forwarded to the cost model.\n */\n staffFields?: readonly string[]\n /**\n * The `ORG_COGS_UNIT_RATES_USD` key pricing one unit. Absent when the\n * fields are already dollars, which then enter the model at ×1.\n */\n rate?: string\n /**\n * The month's LIVE reading, when the rollup's figure is a snapshot a meter\n * keeps adding to: `orgs/{orgId}/{collection}/{month}`, the first of\n * `fields` that is a positive number. It replaces the axis's first rollup\n * field wherever a reader fetches it.\n */\n live?: { collection: string; fields: readonly string[] }\n}\n\n/** A band a plugin contributes to the utilization table. */\nexport interface PluginUsageBandDeclaration {\n /** The band's key, and the column the staff table shows it under. */\n id: string\n label: string\n order: number\n /** Rollup fields summed for what the org used. */\n fields: readonly string[]\n fallbackFields?: readonly string[]\n /** The resolved entitlement holding what the plan includes. */\n entitlement: string\n /** The entitlement is per SITE and the org-wide band is it × `hostLimit`. */\n perHost?: boolean\n /**\n * The band is sold in a unit of cost and the rollup records dollars: what\n * was used is `ceil(dollars / unitCostUsd)`, rounded UP so spend already\n * made never reads as less of the band.\n */\n unitCostUsd?: number\n /**\n * The per-site monthly counter the band is measured by:\n * `hosts/{hostId}/counters/{hostCounter}`, field `{month}`, summed over the\n * workspace's sites.\n */\n hostCounter?: string\n /**\n * The workspace is WARNED as it approaches and reaches this band, by the\n * usage-alerts sweep, from its `hostCounter` against what the plan includes\n * of `entitlement`, once per threshold per month. `label` names the band in\n * the title (\"monthly workflow runs\") and `noun` in the opening sentence\n * (\"workflow runs\"); `outcome` is what happens at the band — `stops`,\n * `bills` or `continues` — and `reached` and `approach` are the sentences\n * that say so, at the band and approaching it.\n */\n alert?: {\n label: string\n noun: string\n outcome: 'stops' | 'bills' | 'continues'\n reached: string\n approach: string\n }\n /**\n * The band is one of the INFRASTRUCTURE meters (AGL-1280): what the\n * workspace uses past it is billed at our cost × `METERED_MARKUP`, beside\n * storage and bandwidth, on the same invoice line and the same estimate.\n * A metered band names one rollup field and the `hostCounter` it is\n * measured by.\n */\n metered?: PluginMeteredBand\n}\n\n/** How a metered band is priced, quoted and withheld. */\nexport interface PluginMeteredBand {\n /**\n * The `METERED_UNIT_RATES_USD` key holding our cost per unit — never a\n * number: the rate table is the platform's, beside the markup it is\n * published with.\n */\n rate: string\n /** The count a published price is quoted per: `1000` reads \"per 1,000\". */\n quotedPer: number\n /** The band in running prose, plural and lowercase: \"form submissions\". */\n noun: string\n /**\n * A release flag the overage waits behind: while it is off for the\n * workspace, the units are counted and the charge is recorded as withheld\n * rather than billed — nobody is charged for what they cannot reach\n * (AGL-1604). The rollup records the verdict as `{field}Billed` and what\n * was forgone, at cost, as `{field}OverageWithheldUsd`.\n */\n withheldUntil?: ReleaseFlagKey\n}\n\n/**\n * A line of a workspace's monthly SPEND a plugin contributes to its usage\n * budget (`usage-budget.ts`): what the plugin's usage came to this month, in\n * the dollars it is billed at, shown on the customer's budget card and\n * counted toward the budget from the month the plugin starts charging for it.\n */\nexport interface PluginSpendLineDeclaration {\n /** The line's key. */\n id: string\n /** What the budget card and the budget alert call it. */\n label: string\n /**\n * Where the month's figure is read: `orgs/{orgId}/{collection}/{month}`,\n * field `field`, in dollars.\n */\n live: { collection: string; field: string }\n /**\n * The deployment variable naming the first month (`YYYY-MM`) the line is\n * charged for. Until it names this month or an earlier one — and on any\n * value that is not a month — the line is shown and never counted.\n */\n billedFromEnv: string\n /**\n * The unit the customer is shown the line in, when the stored dollars are\n * not theirs to see: `ceil(dollars / costUsd)` of `label`, and the dollar\n * figure never crosses to the browser.\n */\n unit?: { costUsd: number; label: string }\n}\n\n/**\n * A meter the plugin measures in the platform's monthly usage sweep and\n * registers at runtime (`plugin-usage-meters.ts`). Declared as well as\n * registered so the sweep can refuse to bill a workspace's month without it.\n */\nexport interface PluginUsageMeterDeclaration {\n /** As `registerPluginUsageMeter` names it. */\n id: string\n}\n\nexport type ResolvedPluginCostAxis = PluginCostAxisDeclaration & { pluginId: string }\nexport type ResolvedPluginUsageBand = PluginUsageBandDeclaration & { pluginId: string }\nexport type ResolvedPluginSpendLine = PluginSpendLineDeclaration & { pluginId: string }\nexport type ResolvedPluginUsageMeter = PluginUsageMeterDeclaration & { pluginId: string }\n\n/** What a plugin's `usageAxes` function answers. */\nexport interface PluginUsageAxesDeclaration {\n costAxes?: readonly PluginCostAxisDeclaration[]\n bands?: readonly PluginUsageBandDeclaration[]\n spendLines?: readonly PluginSpendLineDeclaration[]\n meters?: readonly PluginUsageMeterDeclaration[]\n}\n\nexport function pluginCostAxes(): readonly ResolvedPluginCostAxis[] {\n return PLUGIN_COST_AXES_DECLARED\n}\n\nexport function pluginUsageBands(): readonly ResolvedPluginUsageBand[] {\n return PLUGIN_USAGE_BANDS_DECLARED\n}\n\n/** A declared band that is metered, with its one field and its counter. */\nexport type ResolvedPluginMeteredBand = ResolvedPluginUsageBand & {\n metered: PluginMeteredBand\n hostCounter: string\n}\n\n/**\n * Every band billed at cost past what the plan includes, in band order — the\n * infrastructure meters a plugin adds beside storage and bandwidth.\n */\nexport function meteredPluginBands(): readonly ResolvedPluginMeteredBand[] {\n return PLUGIN_USAGE_BANDS_DECLARED.filter(\n (band): band is ResolvedPluginMeteredBand =>\n Boolean(band.metered && band.hostCounter),\n )\n}\n\n/** A declared band measured by a per-site counter and never billed past it. */\nexport type ResolvedPluginCountedBand = ResolvedPluginUsageBand & {\n hostCounter: string\n}\n\n/**\n * Every band measured by a per-site counter and not metered, in band order:\n * the usage sweep sums each across the workspace's sites and records it under\n * the band's first field, and the staff usage rows show the count. A metered\n * band's counter is read with the infrastructure meters instead.\n */\nexport function countedPluginBands(): readonly ResolvedPluginCountedBand[] {\n return PLUGIN_USAGE_BANDS_DECLARED.filter(\n (band): band is ResolvedPluginCountedBand =>\n Boolean(band.hostCounter && !band.metered),\n )\n}\n\n/** The rollup field a metered band records its count under. */\nexport function meteredBandField(band: ResolvedPluginMeteredBand): string {\n return band.fields[0]!\n}\n\n/**\n * Where the rollup records a withheld band's verdict (`metered.withheldUntil`):\n * whether the month billed the band's overage, and what was forgone, at cost,\n * when it did not. Without the second a withheld month reads as a month that\n * stayed inside the band.\n */\nexport function meteredBandVerdictFields(band: ResolvedPluginMeteredBand): {\n billed: string\n withheldUsd: string\n} {\n const field = meteredBandField(band)\n return { billed: `${field}Billed`, withheldUsd: `${field}OverageWithheldUsd` }\n}\n\nexport function pluginSpendLines(): readonly ResolvedPluginSpendLine[] {\n return PLUGIN_SPEND_LINES_DECLARED\n}\n\n/** A positive finite number, or 0 — the reading every meter is priced from. */\nfunction meterValue(value: unknown): number {\n const parsed = Number(value ?? 0)\n return Number.isFinite(parsed) && parsed > 0 ? parsed : 0\n}\n\n/**\n * What a rollup recorded for a declared meter: `fields` summed, or\n * `fallbackFields` summed when the rollup carries none of `fields` at all.\n *\n * \"Carries none\" is `null` or absent, never zero. A rollup that measured\n * zero has answered, and must not fall back to a figure recorded under an\n * older, narrower basis.\n */\nexport function declaredMeterReading(\n source: Readonly<Record<string, unknown>> | null | undefined,\n declared: {\n fields: readonly string[]\n fallbackFields?: readonly string[]\n },\n): number {\n const present = declared.fields.some((field) => source?.[field] != null)\n const fields =\n !present && declared.fallbackFields?.length\n ? declared.fallbackFields\n : declared.fields\n return fields.reduce((sum, field) => sum + meterValue(source?.[field]), 0)\n}\n\n/**\n * The live reading a cost axis names: the first of its `live.fields` that is\n * a positive number on the month's document, or `undefined` when none is.\n * `undefined` is \"keep the rollup's snapshot\", never zero.\n */\nexport function liveMeterReading(\n document: { get(field: string): unknown } | null | undefined,\n live: { fields: readonly string[] },\n): number | undefined {\n for (const field of live.fields) {\n const value = meterValue(document?.get(field))\n if (value > 0) return value\n }\n return undefined\n}\n\n/** Every rollup field the declared cost axes read or record, in order. */\nexport function pluginCostAxisFields(): string[] {\n const fields: string[] = []\n for (const axis of PLUGIN_COST_AXES_DECLARED) {\n for (const field of [\n ...axis.fields,\n ...(axis.fallbackFields ?? []),\n ...(axis.recordedFields ?? []),\n ]) {\n if (!fields.includes(field)) fields.push(field)\n }\n }\n return fields\n}\n\n/**\n * A month's rollup as a staff reader is served it, one entry per field the\n * declared cost axes read, record or serve to staff (`get` reads one rollup\n * field).\n *\n * A field an axis prices reads zero where the rollup lacks it, as the cost\n * model reads it — except where the axis falls back to an older basis when\n * the rollup carries none of its fields: there absence is the answer that\n * selects the fallback, so it is served as `null`, and a reader pricing the\n * served row reads the month the way the sweep did. A field an axis only\n * records or serves reads `null` when the rollup never wrote it: \"not\n * recorded\" and \"recorded zero\" are different answers, and a projection\n * that collapses them invents history (AGL-2321).\n */\nexport function pluginCostAxisProjection(\n get: (field: string) => unknown,\n): Record<string, number | null> {\n const out: Record<string, number | null> = {}\n for (const axis of PLUGIN_COST_AXES_DECLARED) {\n const absentIsNull = [\n ...(axis.fallbackFields?.length ? axis.fields : []),\n ...(axis.recordedFields ?? []),\n ...(axis.staffFields ?? []),\n ]\n for (const field of [\n ...axis.fields,\n ...(axis.fallbackFields ?? []),\n ...(axis.recordedFields ?? []),\n ...(axis.staffFields ?? []),\n ]) {\n if (field in out) continue\n const value = get(field)\n out[field] =\n value != null ? Number(value) : absentIsNull.includes(field) ? null : 0\n }\n }\n return out\n}\n"],"names":["PLUGIN_COST_AXES_DECLARED","PLUGIN_SPEND_LINES_DECLARED","PLUGIN_USAGE_BANDS_DECLARED","pluginCostAxes","pluginUsageBands","meteredPluginBands","filter","band","Boolean","metered","hostCounter","countedPluginBands","meteredBandField","fields","meteredBandVerdictFields","field","billed","withheldUsd","pluginSpendLines","meterValue","value","parsed","Number","isFinite","declaredMeterReading","source","declared","present","some","fallbackFields","length","reduce","sum","liveMeterReading","document","live","get","undefined","pluginCostAxisFields","axis","recordedFields","includes","push","pluginCostAxisProjection","out","absentIsNull","staffFields"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoDC,GAGD,SACEA,yBAAyB,EACzBC,2BAA2B,EAC3BC,2BAA2B,QACtB,qCAAiC;AAsKxC,OAAO,SAASC;IACd,OAAOH;AACT;AAEA,OAAO,SAASI;IACd,OAAOF;AACT;AAQA;;;CAGC,GACD,OAAO,SAASG;IACd,OAAOH,4BAA4BI,MAAM,CACvC,CAACC,OACCC,QAAQD,KAAKE,OAAO,IAAIF,KAAKG,WAAW;AAE9C;AAOA;;;;;CAKC,GACD,OAAO,SAASC;IACd,OAAOT,4BAA4BI,MAAM,CACvC,CAACC,OACCC,QAAQD,KAAKG,WAAW,IAAI,CAACH,KAAKE,OAAO;AAE/C;AAEA,6DAA6D,GAC7D,OAAO,SAASG,iBAAiBL,IAA+B;IAC9D,OAAOA,KAAKM,MAAM,CAAC,EAAE;AACvB;AAEA;;;;;CAKC,GACD,OAAO,SAASC,yBAAyBP,IAA+B;IAItE,MAAMQ,QAAQH,iBAAiBL;IAC/B,OAAO;QAAES,QAAQ,GAAGD,MAAM,MAAM,CAAC;QAAEE,aAAa,GAAGF,MAAM,kBAAkB,CAAC;IAAC;AAC/E;AAEA,OAAO,SAASG;IACd,OAAOjB;AACT;AAEA,6EAA6E,GAC7E,SAASkB,WAAWC,KAAc;IAChC,MAAMC,SAASC,OAAOF,gBAAAA,QAAS;IAC/B,OAAOE,OAAOC,QAAQ,CAACF,WAAWA,SAAS,IAAIA,SAAS;AAC1D;AAEA;;;;;;;CAOC,GACD,OAAO,SAASG,qBACdC,MAA4D,EAC5DC,QAGC;QAIaA;IAFd,MAAMC,UAAUD,SAASb,MAAM,CAACe,IAAI,CAAC,CAACb,QAAUU,CAAAA,0BAAAA,MAAQ,CAACV,MAAM,KAAI;IACnE,MAAMF,SACJ,CAACc,aAAWD,2BAAAA,SAASG,cAAc,qBAAvBH,yBAAyBI,MAAM,IACvCJ,SAASG,cAAc,GACvBH,SAASb,MAAM;IACrB,OAAOA,OAAOkB,MAAM,CAAC,CAACC,KAAKjB,QAAUiB,MAAMb,WAAWM,0BAAAA,MAAQ,CAACV,MAAM,GAAG;AAC1E;AAEA;;;;CAIC,GACD,OAAO,SAASkB,iBACdC,QAA4D,EAC5DC,IAAmC;IAEnC,KAAK,MAAMpB,SAASoB,KAAKtB,MAAM,CAAE;QAC/B,MAAMO,QAAQD,WAAWe,4BAAAA,SAAUE,GAAG,CAACrB;QACvC,IAAIK,QAAQ,GAAG,OAAOA;IACxB;IACA,OAAOiB;AACT;AAEA,wEAAwE,GACxE,OAAO,SAASC;IACd,MAAMzB,SAAmB,EAAE;IAC3B,KAAK,MAAM0B,QAAQvC,0BAA2B;YAGtCuC,sBACAA;QAHN,KAAK,MAAMxB,SAAS;eACfwB,KAAK1B,MAAM;gBACV0B,uBAAAA,KAAKV,cAAc,YAAnBU,uBAAuB,EAAE;gBACzBA,uBAAAA,KAAKC,cAAc,YAAnBD,uBAAuB,EAAE;SAC9B,CAAE;YACD,IAAI,CAAC1B,OAAO4B,QAAQ,CAAC1B,QAAQF,OAAO6B,IAAI,CAAC3B;QAC3C;IACF;IACA,OAAOF;AACT;AAEA;;;;;;;;;;;;;CAaC,GACD,OAAO,SAAS8B,yBACdP,GAA+B;IAE/B,MAAMQ,MAAqC,CAAC;IAC5C,KAAK,MAAML,QAAQvC,0BAA2B;YAGtCuC,sBACAA,mBAIAA,sBACAA,uBACAA;YARAA;QADN,MAAMM,eAAe;eACfN,EAAAA,wBAAAA,KAAKV,cAAc,qBAAnBU,sBAAqBT,MAAM,IAAGS,KAAK1B,MAAM,GAAG,EAAE;gBAC9C0B,uBAAAA,KAAKC,cAAc,YAAnBD,uBAAuB,EAAE;gBACzBA,oBAAAA,KAAKO,WAAW,YAAhBP,oBAAoB,EAAE;SAC3B;QACD,KAAK,MAAMxB,SAAS;eACfwB,KAAK1B,MAAM;gBACV0B,uBAAAA,KAAKV,cAAc,YAAnBU,uBAAuB,EAAE;gBACzBA,wBAAAA,KAAKC,cAAc,YAAnBD,wBAAuB,EAAE;gBACzBA,qBAAAA,KAAKO,WAAW,YAAhBP,qBAAoB,EAAE;SAC3B,CAAE;YACD,IAAIxB,SAAS6B,KAAK;YAClB,MAAMxB,QAAQgB,IAAIrB;YAClB6B,GAAG,CAAC7B,MAAM,GACRK,SAAS,OAAOE,OAAOF,SAASyB,aAAaJ,QAAQ,CAAC1B,SAAS,OAAO;QAC1E;IACF;IACA,OAAO6B;AACT"}