@aglyn/aglyn 1.0.0-beta.217 → 1.0.0-beta.219

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 (348) hide show
  1. package/package.json +14 -14
  2. package/src/lib/app-utils/actions.d.ts +25 -374
  3. package/src/lib/app-utils/actions.js +101 -561
  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/admin-audit-index.js +2 -2
  9. package/src/lib/app-utils/admin-audit-index.js.map +1 -1
  10. package/src/lib/app-utils/analytics-events.d.ts +11 -2
  11. package/src/lib/app-utils/analytics-events.js +11 -2
  12. package/src/lib/app-utils/analytics-events.js.map +1 -1
  13. package/src/lib/app-utils/analytics-provider.d.ts +182 -0
  14. package/src/lib/app-utils/analytics-provider.js +133 -0
  15. package/src/lib/app-utils/analytics-provider.js.map +1 -0
  16. package/src/lib/app-utils/api-plugins.d.ts +46 -0
  17. package/src/lib/app-utils/api-plugins.js +19 -0
  18. package/src/lib/app-utils/api-plugins.js.map +1 -1
  19. package/src/lib/app-utils/{marketplace-overrides.d.ts → artifact-overrides.d.ts} +9 -6
  20. package/src/lib/app-utils/{marketplace-overrides.js → artifact-overrides.js} +10 -7
  21. package/src/lib/app-utils/artifact-overrides.js.map +1 -0
  22. package/src/lib/app-utils/{marketplace-provenance.d.ts → artifact-provenance.d.ts} +12 -10
  23. package/src/lib/app-utils/{marketplace-provenance.js → artifact-provenance.js} +9 -7
  24. package/src/lib/app-utils/artifact-provenance.js.map +1 -0
  25. package/src/lib/app-utils/assist-credits.js +2 -1
  26. package/src/lib/app-utils/assist-credits.js.map +1 -1
  27. package/src/lib/app-utils/binding-token-catalog.d.ts +5 -13
  28. package/src/lib/app-utils/binding-token-catalog.js +17 -41
  29. package/src/lib/app-utils/binding-token-catalog.js.map +1 -1
  30. package/src/lib/app-utils/binding-tokens.js +1 -1
  31. package/src/lib/app-utils/binding-tokens.js.map +1 -1
  32. package/src/lib/app-utils/brand-support-line.d.ts +36 -0
  33. package/src/lib/app-utils/brand-support-line.js +38 -0
  34. package/src/lib/app-utils/brand-support-line.js.map +1 -0
  35. package/src/lib/app-utils/campaign-touch.d.ts +5 -5
  36. package/src/lib/app-utils/campaign-touch.js +8 -8
  37. package/src/lib/app-utils/campaign-touch.js.map +1 -1
  38. package/src/lib/app-utils/collection-entries.d.ts +2 -2
  39. package/src/lib/app-utils/collection-entries.js.map +1 -1
  40. package/src/lib/app-utils/consent-group-change.d.ts +4 -0
  41. package/src/lib/app-utils/consent-group-change.js.map +1 -1
  42. package/src/lib/app-utils/console-record-links.d.ts +10 -89
  43. package/src/lib/app-utils/console-record-links.js +3 -107
  44. package/src/lib/app-utils/console-record-links.js.map +1 -1
  45. package/src/lib/app-utils/console-routes.d.ts +16 -7
  46. package/src/lib/app-utils/console-routes.js +9 -3
  47. package/src/lib/app-utils/console-routes.js.map +1 -1
  48. package/src/lib/app-utils/contacts.d.ts +23 -1
  49. package/src/lib/app-utils/contacts.js +21 -5
  50. package/src/lib/app-utils/contacts.js.map +1 -1
  51. package/src/lib/app-utils/cross-pool-desync.d.ts +39 -0
  52. package/src/lib/app-utils/cross-pool-desync.js +47 -0
  53. package/src/lib/app-utils/cross-pool-desync.js.map +1 -0
  54. package/src/lib/app-utils/csv-upload.d.ts +29 -0
  55. package/src/lib/app-utils/csv-upload.js +29 -0
  56. package/src/lib/app-utils/csv-upload.js.map +1 -0
  57. package/src/lib/app-utils/dataset-models.d.ts +5 -5
  58. package/src/lib/app-utils/dataset-models.js +19 -2
  59. package/src/lib/app-utils/dataset-models.js.map +1 -1
  60. package/src/lib/app-utils/datasets.d.ts +65 -11
  61. package/src/lib/app-utils/datasets.js +74 -11
  62. package/src/lib/app-utils/datasets.js.map +1 -1
  63. package/src/lib/app-utils/docs-deflection.d.ts +6 -6
  64. package/src/lib/app-utils/docs-deflection.js.map +1 -1
  65. package/src/lib/app-utils/docs-help.generated.d.ts +12 -6
  66. package/src/lib/app-utils/docs-help.generated.js +21 -6
  67. package/src/lib/app-utils/docs-help.generated.js.map +1 -1
  68. package/src/lib/app-utils/docs-index.generated.d.ts +2 -2
  69. package/src/lib/app-utils/docs-index.generated.js +514 -318
  70. package/src/lib/app-utils/docs-index.generated.js.map +1 -1
  71. package/src/lib/app-utils/docs-retrieval.d.ts +3 -3
  72. package/src/lib/app-utils/docs-retrieval.js +14 -10
  73. package/src/lib/app-utils/docs-retrieval.js.map +1 -1
  74. package/src/lib/app-utils/duplicate-resource.d.ts +4 -1
  75. package/src/lib/app-utils/duplicate-resource.js +7 -4
  76. package/src/lib/app-utils/duplicate-resource.js.map +1 -1
  77. package/src/lib/app-utils/dynamic-list-rule.d.ts +1 -1
  78. package/src/lib/app-utils/dynamic-list-rule.js.map +1 -1
  79. package/src/lib/app-utils/element-ui.d.ts +1 -1
  80. package/src/lib/app-utils/element-ui.js +1 -1
  81. package/src/lib/app-utils/element-ui.js.map +1 -1
  82. package/src/lib/app-utils/email-starter-policy.js +3 -3
  83. package/src/lib/app-utils/email-starter-policy.js.map +1 -1
  84. package/src/lib/app-utils/entity-picker-context.d.ts +10 -5
  85. package/src/lib/app-utils/entity-picker-context.js.map +1 -1
  86. package/src/lib/app-utils/error-beacon.d.ts +75 -6
  87. package/src/lib/app-utils/error-beacon.js +160 -21
  88. package/src/lib/app-utils/error-beacon.js.map +1 -1
  89. package/src/lib/app-utils/expand-repeatables.d.ts +10 -10
  90. package/src/lib/app-utils/expand-repeatables.js +10 -10
  91. package/src/lib/app-utils/expand-repeatables.js.map +1 -1
  92. package/src/lib/app-utils/host-events.d.ts +82 -0
  93. package/src/lib/app-utils/host-events.js +62 -0
  94. package/src/lib/app-utils/host-events.js.map +1 -0
  95. package/src/lib/app-utils/lockdown.d.ts +33 -1
  96. package/src/lib/app-utils/lockdown.js +45 -4
  97. package/src/lib/app-utils/lockdown.js.map +1 -1
  98. package/src/lib/app-utils/margin-utilization.d.ts +4 -69
  99. package/src/lib/app-utils/margin-utilization.js +82 -69
  100. package/src/lib/app-utils/margin-utilization.js.map +1 -1
  101. package/src/lib/app-utils/node-definition-sanitizer.d.ts +16 -16
  102. package/src/lib/app-utils/node-definition-sanitizer.js +24 -20
  103. package/src/lib/app-utils/node-definition-sanitizer.js.map +1 -1
  104. package/src/lib/app-utils/node-interactions.d.ts +7 -7
  105. package/src/lib/app-utils/node-interactions.js.map +1 -1
  106. package/src/lib/app-utils/notifications.d.ts +78 -47
  107. package/src/lib/app-utils/notifications.js +63 -44
  108. package/src/lib/app-utils/notifications.js.map +1 -1
  109. package/src/lib/app-utils/payments-configured.d.ts +8 -21
  110. package/src/lib/app-utils/payments-configured.js +8 -23
  111. package/src/lib/app-utils/payments-configured.js.map +1 -1
  112. package/src/lib/app-utils/plan-entitlements.d.ts +43 -128
  113. package/src/lib/app-utils/plan-entitlements.js +145 -304
  114. package/src/lib/app-utils/plan-entitlements.js.map +1 -1
  115. package/src/lib/app-utils/platform-brand.d.ts +10 -0
  116. package/src/lib/app-utils/platform-brand.js +14 -3
  117. package/src/lib/app-utils/platform-brand.js.map +1 -1
  118. package/src/lib/app-utils/plugin-api-rate-limit.d.ts +7 -1
  119. package/src/lib/app-utils/plugin-api-rate-limit.js +11 -3
  120. package/src/lib/app-utils/plugin-api-rate-limit.js.map +1 -1
  121. package/src/lib/app-utils/plugin-bundle-checks.js +2 -2
  122. package/src/lib/app-utils/plugin-bundle-checks.js.map +1 -1
  123. package/src/lib/app-utils/plugin-host-events.generated.d.ts +12 -0
  124. package/src/lib/app-utils/plugin-host-events.generated.js +169 -0
  125. package/src/lib/app-utils/plugin-host-events.generated.js.map +1 -0
  126. package/src/lib/app-utils/plugin-release-flags.generated.d.ts +12 -0
  127. package/src/lib/app-utils/plugin-release-flags.generated.js +106 -0
  128. package/src/lib/app-utils/plugin-release-flags.generated.js.map +1 -0
  129. package/src/lib/app-utils/realm-host-surface.generated.js +2 -0
  130. package/src/lib/app-utils/realm-host-surface.generated.js.map +1 -1
  131. package/src/lib/app-utils/release-flags.d.ts +14 -5
  132. package/src/lib/app-utils/release-flags.js +21 -125
  133. package/src/lib/app-utils/release-flags.js.map +1 -1
  134. package/src/lib/app-utils/repeat-sources.d.ts +9 -0
  135. package/src/lib/app-utils/repeat-sources.js.map +1 -1
  136. package/src/lib/app-utils/retained-refusals.d.ts +73 -0
  137. package/src/lib/app-utils/retained-refusals.js +186 -0
  138. package/src/lib/app-utils/retained-refusals.js.map +1 -0
  139. package/src/lib/app-utils/scope-tokens.d.ts +27 -0
  140. package/src/lib/app-utils/scope-tokens.js +61 -0
  141. package/src/lib/app-utils/scope-tokens.js.map +1 -1
  142. package/src/lib/app-utils/screen-link-context.js +3 -3
  143. package/src/lib/app-utils/screen-link-context.js.map +1 -1
  144. package/src/lib/app-utils/screen-route.d.ts +15 -0
  145. package/src/lib/app-utils/screen-route.js +21 -1
  146. package/src/lib/app-utils/screen-route.js.map +1 -1
  147. package/src/lib/app-utils/seo-audit.d.ts +132 -0
  148. package/src/lib/app-utils/seo-audit.js +246 -0
  149. package/src/lib/app-utils/seo-audit.js.map +1 -0
  150. package/src/lib/app-utils/seo-keywords.d.ts +48 -0
  151. package/src/lib/app-utils/seo-keywords.js +60 -0
  152. package/src/lib/app-utils/seo-keywords.js.map +1 -0
  153. package/src/lib/app-utils/seo-page-facts.d.ts +66 -0
  154. package/src/lib/app-utils/seo-page-facts.js +155 -0
  155. package/src/lib/app-utils/seo-page-facts.js.map +1 -0
  156. package/src/lib/app-utils/seo-site-scan.d.ts +126 -0
  157. package/src/lib/app-utils/seo-site-scan.js +162 -0
  158. package/src/lib/app-utils/seo-site-scan.js.map +1 -0
  159. package/src/lib/app-utils/seo-title-variables.js +1 -1
  160. package/src/lib/app-utils/seo-title-variables.js.map +1 -1
  161. package/src/lib/app-utils/server.d.ts +6 -9
  162. package/src/lib/app-utils/server.js +17 -27
  163. package/src/lib/app-utils/server.js.map +1 -1
  164. package/src/lib/app-utils/site-interactions.d.ts +501 -0
  165. package/src/lib/app-utils/site-interactions.js +554 -0
  166. package/src/lib/app-utils/site-interactions.js.map +1 -0
  167. package/src/lib/app-utils/{marketplace-theme.d.ts → site-theme.d.ts} +13 -2
  168. package/src/lib/app-utils/{marketplace-theme.js → site-theme.js} +5 -2
  169. package/src/lib/app-utils/site-theme.js.map +1 -0
  170. package/src/lib/app-utils/sitemap.d.ts +4 -3
  171. package/src/lib/app-utils/sitemap.js +9 -7
  172. package/src/lib/app-utils/sitemap.js.map +1 -1
  173. package/src/lib/app-utils/stale-build-error.d.ts +51 -0
  174. package/src/lib/app-utils/stale-build-error.js +100 -1
  175. package/src/lib/app-utils/stale-build-error.js.map +1 -1
  176. package/src/lib/app-utils/starter-templates.d.ts +20 -0
  177. package/src/lib/app-utils/starter-templates.js +49 -0
  178. package/src/lib/app-utils/starter-templates.js.map +1 -1
  179. package/src/lib/app-utils/tax-jurisdiction-figures.d.ts +118 -0
  180. package/src/lib/app-utils/tax-jurisdiction-figures.js +123 -0
  181. package/src/lib/app-utils/tax-jurisdiction-figures.js.map +1 -0
  182. package/src/lib/app-utils/theme-library.d.ts +10 -3
  183. package/src/lib/app-utils/theme-library.js +13 -4
  184. package/src/lib/app-utils/theme-library.js.map +1 -1
  185. package/src/lib/app-utils/{campaign-attribution.d.ts → utm-attribution.d.ts} +11 -6
  186. package/src/lib/app-utils/{campaign-attribution.js → utm-attribution.js} +13 -8
  187. package/src/lib/app-utils/utm-attribution.js.map +1 -0
  188. package/src/lib/app-utils/{campaign-forwarding.d.ts → utm-forwarding.d.ts} +14 -14
  189. package/src/lib/app-utils/{campaign-forwarding.js → utm-forwarding.js} +26 -26
  190. package/src/lib/app-utils/utm-forwarding.js.map +1 -0
  191. package/src/lib/app-utils/video-object.js +6 -5
  192. package/src/lib/app-utils/video-object.js.map +1 -1
  193. package/src/lib/app-utils/visitor-consent.d.ts +41 -164
  194. package/src/lib/app-utils/visitor-consent.js +66 -277
  195. package/src/lib/app-utils/visitor-consent.js.map +1 -1
  196. package/src/lib/app-utils/web-vitals-rum.d.ts +7 -7
  197. package/src/lib/app-utils/web-vitals-rum.js +31 -63
  198. package/src/lib/app-utils/web-vitals-rum.js.map +1 -1
  199. package/src/lib/app-utils/where-used.d.ts +11 -6
  200. package/src/lib/app-utils/where-used.js +3 -8
  201. package/src/lib/app-utils/where-used.js.map +1 -1
  202. package/src/lib/canvas-manager/canvas-manager.js +3 -3
  203. package/src/lib/canvas-manager/canvas-manager.js.map +1 -1
  204. package/src/lib/foundation/definitions/components.types.d.ts +1 -1
  205. package/src/lib/foundation/definitions/components.types.js +1 -1
  206. package/src/lib/foundation/definitions/components.types.js.map +1 -1
  207. package/src/lib/foundation/definitions/org-billing.types.d.ts +18 -135
  208. package/src/lib/foundation/definitions/org-billing.types.js.map +1 -1
  209. package/src/lib/foundation/definitions/organization.types.d.ts +6 -3
  210. package/src/lib/foundation/definitions/organization.types.js.map +1 -1
  211. package/src/lib/foundation/definitions/platform.types.d.ts +27 -5
  212. package/src/lib/foundation/definitions/platform.types.js.map +1 -1
  213. package/src/lib/foundation/definitions/write-deny-coverage.util.d.ts +16 -0
  214. package/src/lib/foundation/definitions/write-deny-coverage.util.js +20 -0
  215. package/src/lib/foundation/definitions/write-deny-coverage.util.js.map +1 -1
  216. package/src/lib/foundation/index.d.ts +1 -1
  217. package/src/lib/foundation/index.js.map +1 -1
  218. package/src/lib/plugin-manager/besigner-documents.d.ts +96 -0
  219. package/src/lib/plugin-manager/besigner-documents.js +61 -0
  220. package/src/lib/plugin-manager/besigner-documents.js.map +1 -0
  221. package/src/lib/plugin-manager/computed-variables.d.ts +71 -0
  222. package/src/lib/plugin-manager/computed-variables.js +74 -0
  223. package/src/lib/plugin-manager/computed-variables.js.map +1 -0
  224. package/src/lib/plugin-manager/custom-fields.d.ts +29 -2
  225. package/src/lib/plugin-manager/custom-fields.js +47 -1
  226. package/src/lib/plugin-manager/custom-fields.js.map +1 -1
  227. package/src/lib/plugin-manager/feature-plugins.d.ts +292 -20
  228. package/src/lib/plugin-manager/feature-plugins.js +105 -17
  229. package/src/lib/plugin-manager/feature-plugins.js.map +1 -1
  230. package/src/lib/plugin-manager/first-party-plugins.generated.d.ts +123 -0
  231. package/src/lib/plugin-manager/first-party-plugins.generated.js +785 -14
  232. package/src/lib/plugin-manager/first-party-plugins.generated.js.map +1 -1
  233. package/src/lib/plugin-manager/plugin-activity-actions.d.ts +12 -0
  234. package/src/lib/plugin-manager/plugin-activity-actions.js +25 -0
  235. package/src/lib/plugin-manager/plugin-activity-actions.js.map +1 -1
  236. package/src/lib/plugin-manager/plugin-contributions.d.ts +1 -1
  237. package/src/lib/plugin-manager/plugin-contributions.js.map +1 -1
  238. package/src/lib/plugin-manager/plugin-declarations-repair.d.ts +36 -0
  239. package/src/lib/plugin-manager/plugin-declarations-repair.js +64 -0
  240. package/src/lib/plugin-manager/plugin-declarations-repair.js.map +1 -0
  241. package/src/lib/plugin-manager/plugin-dependents.d.ts +101 -0
  242. package/src/lib/plugin-manager/plugin-dependents.js +75 -0
  243. package/src/lib/plugin-manager/plugin-dependents.js.map +1 -0
  244. package/src/lib/plugin-manager/plugin-distribution.d.ts +55 -0
  245. package/src/lib/plugin-manager/plugin-distribution.js +45 -0
  246. package/src/lib/plugin-manager/plugin-distribution.js.map +1 -0
  247. package/src/lib/plugin-manager/plugin-host-collections.d.ts +17 -0
  248. package/src/lib/plugin-manager/plugin-host-collections.js +6 -0
  249. package/src/lib/plugin-manager/plugin-host-collections.js.map +1 -1
  250. package/src/lib/plugin-manager/plugin-host-resources.d.ts +133 -0
  251. package/src/lib/plugin-manager/plugin-host-resources.js +52 -0
  252. package/src/lib/plugin-manager/plugin-host-resources.js.map +1 -0
  253. package/src/lib/plugin-manager/plugin-org-erasure.d.ts +28 -2
  254. package/src/lib/plugin-manager/plugin-org-erasure.js +61 -2
  255. package/src/lib/plugin-manager/plugin-org-erasure.js.map +1 -1
  256. package/src/lib/plugin-manager/plugin-plan-entitlements.d.ts +123 -0
  257. package/src/lib/plugin-manager/plugin-plan-entitlements.js +101 -0
  258. package/src/lib/plugin-manager/plugin-plan-entitlements.js.map +1 -0
  259. package/src/lib/plugin-manager/plugin-record-index.d.ts +95 -0
  260. package/src/lib/plugin-manager/plugin-record-index.js +51 -0
  261. package/src/lib/plugin-manager/plugin-record-index.js.map +1 -0
  262. package/src/lib/plugin-manager/plugin-record-written.d.ts +58 -0
  263. package/src/lib/plugin-manager/plugin-record-written.js +42 -0
  264. package/src/lib/plugin-manager/plugin-record-written.js.map +1 -0
  265. package/src/lib/plugin-manager/plugin-revenue-sources.d.ts +213 -0
  266. package/src/lib/plugin-manager/plugin-revenue-sources.js +194 -0
  267. package/src/lib/plugin-manager/plugin-revenue-sources.js.map +1 -0
  268. package/src/lib/plugin-manager/plugin-site-bundle.d.ts +145 -0
  269. package/src/lib/plugin-manager/plugin-site-bundle.js +78 -0
  270. package/src/lib/plugin-manager/plugin-site-bundle.js.map +1 -0
  271. package/src/lib/plugin-manager/plugin-site-cache.d.ts +12 -0
  272. package/src/lib/plugin-manager/plugin-site-cache.js.map +1 -1
  273. package/src/lib/plugin-manager/plugin-site-export.d.ts +81 -0
  274. package/src/lib/plugin-manager/plugin-site-export.js +40 -0
  275. package/src/lib/plugin-manager/plugin-site-export.js.map +1 -0
  276. package/src/lib/plugin-manager/plugin-sitemap-sections.d.ts +88 -0
  277. package/src/lib/plugin-manager/plugin-sitemap-sections.js +29 -0
  278. package/src/lib/plugin-manager/plugin-sitemap-sections.js.map +1 -0
  279. package/src/lib/plugin-manager/plugin-tax-profile.d.ts +20 -4
  280. package/src/lib/plugin-manager/plugin-tax-profile.js.map +1 -1
  281. package/src/lib/plugin-manager/plugin-tax-return-sources.d.ts +255 -0
  282. package/src/lib/plugin-manager/plugin-tax-return-sources.js +191 -0
  283. package/src/lib/plugin-manager/plugin-tax-return-sources.js.map +1 -0
  284. package/src/lib/plugin-manager/plugin-template-sources.d.ts +75 -0
  285. package/src/lib/plugin-manager/plugin-template-sources.js +37 -0
  286. package/src/lib/plugin-manager/plugin-template-sources.js.map +1 -0
  287. package/src/lib/plugin-manager/plugin-usage-axes.d.ts +107 -0
  288. package/src/lib/plugin-manager/plugin-usage-axes.js +107 -0
  289. package/src/lib/plugin-manager/plugin-usage-axes.js.map +1 -0
  290. package/src/lib/plugin-manager/plugin-zones.d.ts +4 -5
  291. package/src/lib/plugin-manager/plugin-zones.js.map +1 -1
  292. package/src/lib/plugin-manager/realm-host-aglyn.generated.js +2 -0
  293. package/src/lib/plugin-manager/realm-host-aglyn.generated.js.map +1 -1
  294. package/src/lib/plugin-manager/record-captured-contact.d.ts +1 -14
  295. package/src/lib/plugin-manager/record-captured-contact.js +10 -32
  296. package/src/lib/plugin-manager/record-captured-contact.js.map +1 -1
  297. package/src/lib/plugin-manager/repeat-rows.d.ts +124 -0
  298. package/src/lib/plugin-manager/repeat-rows.js +108 -0
  299. package/src/lib/plugin-manager/repeat-rows.js.map +1 -0
  300. package/src/lib/plugin-manager/submission-record-target.d.ts +144 -0
  301. package/src/lib/plugin-manager/submission-record-target.js +125 -0
  302. package/src/lib/plugin-manager/submission-record-target.js.map +1 -0
  303. package/src/lib/plugin-manager/video-embed-provider.d.ts +108 -0
  304. package/src/lib/plugin-manager/video-embed-provider.js +165 -0
  305. package/src/lib/plugin-manager/video-embed-provider.js.map +1 -0
  306. package/src/lib/types/nodes.d.ts +2 -2
  307. package/src/lib/types/nodes.js.map +1 -1
  308. package/src/lib/app-utils/campaign-attribution.js.map +0 -1
  309. package/src/lib/app-utils/campaign-forwarding.js.map +0 -1
  310. package/src/lib/app-utils/contact-holder.d.ts +0 -68
  311. package/src/lib/app-utils/contact-holder.js +0 -129
  312. package/src/lib/app-utils/contact-holder.js.map +0 -1
  313. package/src/lib/app-utils/contact-merge.d.ts +0 -136
  314. package/src/lib/app-utils/contact-merge.js +0 -412
  315. package/src/lib/app-utils/contact-merge.js.map +0 -1
  316. package/src/lib/app-utils/crm-csv.d.ts +0 -239
  317. package/src/lib/app-utils/crm-csv.js +0 -467
  318. package/src/lib/app-utils/crm-csv.js.map +0 -1
  319. package/src/lib/app-utils/crm-digest.d.ts +0 -185
  320. package/src/lib/app-utils/crm-digest.js +0 -272
  321. package/src/lib/app-utils/crm-digest.js.map +0 -1
  322. package/src/lib/app-utils/form-dataset-binding.d.ts +0 -50
  323. package/src/lib/app-utils/form-dataset-binding.js +0 -74
  324. package/src/lib/app-utils/form-dataset-binding.js.map +0 -1
  325. package/src/lib/app-utils/list-import.d.ts +0 -158
  326. package/src/lib/app-utils/list-import.js +0 -332
  327. package/src/lib/app-utils/list-import.js.map +0 -1
  328. package/src/lib/app-utils/marketplace-listing-visibility.d.ts +0 -122
  329. package/src/lib/app-utils/marketplace-listing-visibility.js +0 -147
  330. package/src/lib/app-utils/marketplace-listing-visibility.js.map +0 -1
  331. package/src/lib/app-utils/marketplace-overrides.js.map +0 -1
  332. package/src/lib/app-utils/marketplace-provenance.js.map +0 -1
  333. package/src/lib/app-utils/marketplace-theme.js.map +0 -1
  334. package/src/lib/app-utils/marketplace-update-state.d.ts +0 -119
  335. package/src/lib/app-utils/marketplace-update-state.js +0 -132
  336. package/src/lib/app-utils/marketplace-update-state.js.map +0 -1
  337. package/src/lib/app-utils/publisher-agreement.d.ts +0 -289
  338. package/src/lib/app-utils/publisher-agreement.js +0 -321
  339. package/src/lib/app-utils/publisher-agreement.js.map +0 -1
  340. package/src/lib/app-utils/wistia-embed.d.ts +0 -104
  341. package/src/lib/app-utils/wistia-embed.js +0 -138
  342. package/src/lib/app-utils/wistia-embed.js.map +0 -1
  343. package/src/lib/app-utils/workflows.d.ts +0 -136
  344. package/src/lib/app-utils/workflows.js +0 -346
  345. package/src/lib/app-utils/workflows.js.map +0 -1
  346. package/src/lib/plugin-manager/commerce-zone-props.d.ts +0 -172
  347. package/src/lib/plugin-manager/commerce-zone-props.js +0 -31
  348. package/src/lib/plugin-manager/commerce-zone-props.js.map +0 -1
@@ -0,0 +1,191 @@
1
+ import { _ as _extends } from "@swc/helpers/_/_extends";
2
+ /**
3
+ * @license
4
+ * Copyright 2026 Aglyn LLC
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */ /**
18
+ * THE SALES A PLUGIN MADE THROUGH THE PLATFORM, ON THE OPERATOR'S RETURN
19
+ * (AGL-3080).
20
+ *
21
+ * The operator — whoever runs this deployment — files a sales tax return for
22
+ * the sales it FACILITATED, not only for its own. Its own subscription
23
+ * invoices are platform billing and the return sums them itself. A plugin
24
+ * that sells through the platform's account — a storefront checkout whose tax
25
+ * Stripe computes against the operator's registrations, a marketplace charge
26
+ * whose tax stays platform-side — holds records the return cannot read
27
+ * without knowing that plugin's storage, and a classification of them the
28
+ * return has no business restating.
29
+ *
30
+ * So the division is: the FILING is the platform's — the period, the
31
+ * jurisdiction and registration, the verdict, the working-papers export and
32
+ * the Texas Webfile lines. What a plugin sold, how each of its rows
33
+ * classifies and who is liable for it, and the words a preparer reads about
34
+ * it, are the plugin's. A source answers one period with a
35
+ * {@link TaxReturnSourceAnswer}: its findings, its lines for the filing
36
+ * figures, its tables and figures for the screen, its blocks for the export,
37
+ * and its own summary and rows carried whole for the audit.
38
+ *
39
+ * ## ⛔ AN UNREAD SOURCE REFUSES, IT NEVER READS AS ZERO
40
+ *
41
+ * Decided before anything else, because this is a legal filing. A source
42
+ * that answered nothing is indistinguishable, on a total, from a source that
43
+ * sold nothing — and a return signed on that total understates what the
44
+ * operator collected and holds. So:
45
+ *
46
+ * - **Declared and not registered** — every plugin whose sales belong on the
47
+ * return says so with `"taxReturnSource": true` in `plugins.config.json`,
48
+ * compiled into {@link PLUGIN_TAX_RETURN_SOURCES}. A declared plugin that
49
+ * registered no source in this process answers `outcome: 'refused'`. A
50
+ * runtime registry alone could not say this: an empty registry looks
51
+ * exactly like a deployment where nothing sells.
52
+ * - **Threw, or answered a malformed section** — `outcome: 'refused'`, with
53
+ * the sentence the return prints.
54
+ * - **Truncated, or holding rows no period can reach** — answered, and the
55
+ * platform raises each as a BLOCKING finding itself; a source cannot word
56
+ * its way out of either.
57
+ *
58
+ * The return turns every refusal into a blocking "do not file from this"
59
+ * finding. {@link readTaxReturnSources} never throws and never drops a
60
+ * declared source.
61
+ *
62
+ * The reader is the staff tax-return route, which awaits `ensureAll` on the
63
+ * `consoleApi` surface before it asks, so a runtime registry is filled before
64
+ * the question; the compiled declaration is what makes a MISSING
65
+ * registration a refusal rather than an absence.
66
+ *
67
+ * ⚑ The discriminant is a string: this repo compiles with
68
+ * `strictNullChecks: false`, under which a boolean-literal union does not
69
+ * narrow (see `plugin-artifact-inventory.ts`).
70
+ */ import { PLUGIN_TAX_RETURN_SOURCES } from "./first-party-plugins.generated.js";
71
+ import { definePluginServiceContract, registerPluginService, resolvePluginServices } from "./plugin-services.js";
72
+ export { PLUGIN_TAX_RETURN_SOURCES };
73
+ /** Every source answers; one per plugin. */ export const TAX_RETURN_SOURCES = definePluginServiceContract('core.tax-return-sources', {
74
+ multiple: true
75
+ });
76
+ /**
77
+ * Installs a plugin's source. Owner = the loader's marker inside a register
78
+ * fn, else `options.pluginId`. Registering again replaces the plugin's
79
+ * earlier source, so a module evaluated twice does not answer twice.
80
+ */ export function registerTaxReturnSource(source, options) {
81
+ if (typeof (source == null ? void 0 : source.read) !== 'function') {
82
+ throw new Error('a tax return source needs a read function');
83
+ }
84
+ registerPluginService(TAX_RETURN_SOURCES, source, _extends({}, (options == null ? void 0 : options.pluginId) ? {
85
+ pluginId: options.pluginId
86
+ } : {}));
87
+ }
88
+ /** The plugins with a registered source, in the order they answer. */ export function listTaxReturnSources() {
89
+ return resolvePluginServices(TAX_RETURN_SOURCES).map((entry)=>entry.pluginId);
90
+ }
91
+ const isText = (value)=>typeof value === 'string' && value.trim().length > 0;
92
+ const isCount = (value)=>typeof value === 'number' && Number.isFinite(value) && value >= 0;
93
+ /**
94
+ * What is wrong with an answer, or null when it can be printed.
95
+ *
96
+ * Checked because the answer crosses a package boundary into a legal
97
+ * document: a finding with a NaN count sums to NaN and the verdict reads
98
+ * clean, and a missing array is a section that silently shows nothing.
99
+ */ function malformed(answer) {
100
+ if (!answer || typeof answer !== 'object') return 'no section';
101
+ if (!isText(answer.id) || !isText(answer.name) || !isText(answer.title)) {
102
+ return 'a section with no id, name or title';
103
+ }
104
+ if (typeof answer.truncated !== 'boolean') return 'no truncation flag';
105
+ if (!isCount(answer.undatedRows)) return 'no count of undated rows';
106
+ for (const key of [
107
+ 'findings',
108
+ 'filingLines',
109
+ 'tables',
110
+ 'figures',
111
+ 'exports',
112
+ 'rows'
113
+ ]){
114
+ if (!Array.isArray(answer[key])) return `no ${key}`;
115
+ }
116
+ const badFinding = answer.findings.find((finding)=>!isText(finding == null ? void 0 : finding.id) || finding.severity !== 'blocking' && finding.severity !== 'review' || !isCount(finding.count));
117
+ if (badFinding) return 'a finding with no id, severity or count';
118
+ return null;
119
+ }
120
+ /**
121
+ * Every source's answer for one period — declared sources first, in the
122
+ * compiled order, then any other registered source in registration order.
123
+ *
124
+ * NEVER THROWS and never drops a declared source: a declared plugin with no
125
+ * registration, a source that threw, and a malformed or duplicate answer
126
+ * each come back as `outcome: 'refused'` with the sentence the return prints.
127
+ * `declared` is the compiled {@link PLUGIN_TAX_RETURN_SOURCES} unless a spec
128
+ * passes its own.
129
+ */ export async function readTaxReturnSources(request, declared = PLUGIN_TAX_RETURN_SOURCES) {
130
+ const registered = resolvePluginServices(TAX_RETURN_SOURCES);
131
+ const order = [
132
+ ...declared,
133
+ ...registered.map((entry)=>entry.pluginId).filter((pluginId)=>!declared.includes(pluginId))
134
+ ].filter((pluginId, index, all)=>all.indexOf(pluginId) === index);
135
+ const answers = await Promise.all(order.map(async (pluginId)=>{
136
+ var _registered_find;
137
+ const source = (_registered_find = registered.find((entry)=>entry.pluginId === pluginId)) == null ? void 0 : _registered_find.impl;
138
+ if (!source) {
139
+ console.error(`[tax-return] "${pluginId}" declares a tax return source and none is ` + 'registered in this process; its sales cannot be read.');
140
+ return {
141
+ outcome: 'refused',
142
+ pluginId,
143
+ id: pluginId,
144
+ reason: `The “${pluginId}” plugin sells through the platform and registered ` + 'nothing to read its sales with.'
145
+ };
146
+ }
147
+ try {
148
+ const answer = await source.read(request);
149
+ const problem = malformed(answer);
150
+ if (problem) {
151
+ return {
152
+ outcome: 'refused',
153
+ pluginId,
154
+ id: pluginId,
155
+ reason: `The “${pluginId}” plugin answered ${problem}.`
156
+ };
157
+ }
158
+ return _extends({}, answer, {
159
+ outcome: 'answered',
160
+ pluginId
161
+ });
162
+ } catch (error) {
163
+ console.error(`[tax-return] "${pluginId}" failed to read its sales`, error);
164
+ return {
165
+ outcome: 'refused',
166
+ pluginId,
167
+ id: pluginId,
168
+ reason: `The “${pluginId}” plugin could not read its sales for this period.`
169
+ };
170
+ }
171
+ }));
172
+ // Two sources under one id would print two cards and one set of findings
173
+ // under the same key, and a finding that names the wrong source's rows is
174
+ // worse than none. The later one is refused, visibly.
175
+ const seen = new Set();
176
+ return answers.map((section)=>{
177
+ if (section.outcome !== 'answered') return section;
178
+ if (!seen.has(section.id)) {
179
+ seen.add(section.id);
180
+ return section;
181
+ }
182
+ return {
183
+ outcome: 'refused',
184
+ pluginId: section.pluginId,
185
+ id: section.pluginId,
186
+ reason: `The “${section.pluginId}” plugin answered as “${section.id}”, which ` + 'another source already is.'
187
+ };
188
+ });
189
+ }
190
+
191
+ //# sourceMappingURL=plugin-tax-return-sources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../libs/aglyn/src/lib/plugin-manager/plugin-tax-return-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\n/**\n * THE SALES A PLUGIN MADE THROUGH THE PLATFORM, ON THE OPERATOR'S RETURN\n * (AGL-3080).\n *\n * The operator — whoever runs this deployment — files a sales tax return for\n * the sales it FACILITATED, not only for its own. Its own subscription\n * invoices are platform billing and the return sums them itself. A plugin\n * that sells through the platform's account — a storefront checkout whose tax\n * Stripe computes against the operator's registrations, a marketplace charge\n * whose tax stays platform-side — holds records the return cannot read\n * without knowing that plugin's storage, and a classification of them the\n * return has no business restating.\n *\n * So the division is: the FILING is the platform's — the period, the\n * jurisdiction and registration, the verdict, the working-papers export and\n * the Texas Webfile lines. What a plugin sold, how each of its rows\n * classifies and who is liable for it, and the words a preparer reads about\n * it, are the plugin's. A source answers one period with a\n * {@link TaxReturnSourceAnswer}: its findings, its lines for the filing\n * figures, its tables and figures for the screen, its blocks for the export,\n * and its own summary and rows carried whole for the audit.\n *\n * ## ⛔ AN UNREAD SOURCE REFUSES, IT NEVER READS AS ZERO\n *\n * Decided before anything else, because this is a legal filing. A source\n * that answered nothing is indistinguishable, on a total, from a source that\n * sold nothing — and a return signed on that total understates what the\n * operator collected and holds. So:\n *\n * - **Declared and not registered** — every plugin whose sales belong on the\n * return says so with `\"taxReturnSource\": true` in `plugins.config.json`,\n * compiled into {@link PLUGIN_TAX_RETURN_SOURCES}. A declared plugin that\n * registered no source in this process answers `outcome: 'refused'`. A\n * runtime registry alone could not say this: an empty registry looks\n * exactly like a deployment where nothing sells.\n * - **Threw, or answered a malformed section** — `outcome: 'refused'`, with\n * the sentence the return prints.\n * - **Truncated, or holding rows no period can reach** — answered, and the\n * platform raises each as a BLOCKING finding itself; a source cannot word\n * its way out of either.\n *\n * The return turns every refusal into a blocking \"do not file from this\"\n * finding. {@link readTaxReturnSources} never throws and never drops a\n * declared source.\n *\n * The reader is the staff tax-return route, which awaits `ensureAll` on the\n * `consoleApi` surface before it asks, so a runtime registry is filled before\n * the question; the compiled declaration is what makes a MISSING\n * registration a refusal rather than an absence.\n *\n * ⚑ The discriminant is a string: this repo compiles with\n * `strictNullChecks: false`, under which a boolean-literal union does not\n * narrow (see `plugin-artifact-inventory.ts`).\n */\n\nimport { PLUGIN_TAX_RETURN_SOURCES } from './first-party-plugins.generated'\nimport {\n definePluginServiceContract,\n registerPluginService,\n resolvePluginServices,\n} from './plugin-services'\n\nexport { PLUGIN_TAX_RETURN_SOURCES }\n\n/** Which exporter the filing jurisdiction gets. */\nexport type TaxReturnFilingForm = 'tx-webfile' | 'breakdown'\n\n/**\n * The jurisdiction the operator files in, as the platform resolved it from\n * its own configuration. A source words its lines and findings for THIS\n * jurisdiction and never assumes one.\n */\nexport interface TaxReturnFiling {\n /** The bucket key: `US-TX`, `US-CA`, `GB`. */\n code: string\n /** How a sentence names it: `Texas`, or the code itself. */\n label: string\n /** Which exporter the filing lines are for. */\n form: TaxReturnFilingForm\n /** How a sentence names the filing figures: `Items 1–3`, `the breakdown`. */\n figuresName: string\n}\n\n/** What the return asks every source, once per period. */\nexport interface TaxReturnSourceRequest {\n /** `2026-Q3` or `2026-09`, echoed for the record. */\n period: string\n /** Half-open UTC bounds of the period. */\n start: Date\n end: Date\n filing: TaxReturnFiling\n /**\n * The most documents the operator will read for one source. Past it the\n * answer is `truncated`, and a truncated source blocks the return: the\n * ceiling is the operator's policy, so a source is TOLD it.\n */\n rowCap: number\n}\n\nexport type TaxReturnFindingSeverity = 'blocking' | 'review'\n\n/**\n * One finding, in the words a preparer reads. `blocking` means the return\n * must not be filed until it is resolved; `review` means a figure is\n * qualified. A zero count is not raised.\n */\nexport interface TaxReturnFinding {\n /** Stable, and unique on the return. */\n id: string\n severity: TaxReturnFindingSeverity\n /** Rows, or cents where the label says so. */\n count: number\n label: string\n /** What it means for the return, and what to do — not a restatement. */\n detail: string\n}\n\n/** A line printed beneath the platform's own filing figures. */\nexport interface TaxReturnFilingLine {\n /** The form's item number where the figure maps to one, else `—`. */\n item: string\n label: string\n /** Dollars, or null when the figure is not computed. */\n dollars: string | null\n note: string\n}\n\n/** One cell of a source's table on the screen. */\nexport interface TaxReturnSectionCell {\n text: string\n /** A second, quieter line under the text. */\n caption?: string\n /**\n * A short tag beside the text. `attention` marks the figure that needs a\n * decision; `neutral` qualifies one.\n */\n tag?: { label: string; tone: 'attention' | 'neutral' }\n /** The figure a reader must not miss. */\n strong?: boolean\n}\n\nexport interface TaxReturnSectionColumn {\n label: string\n /** Right-aligned. */\n numeric?: boolean\n /** Money: set in a fixed-width face so columns of cents line up. */\n money?: boolean\n}\n\n/** A table on the source's card. */\nexport interface TaxReturnSectionTable {\n /** A subheading above the table; the first table sits under the card's own. */\n heading?: string\n /** A sentence between the heading and the table. */\n description?: string\n columns: TaxReturnSectionColumn[]\n rows: Array<{ key: string; cells: TaxReturnSectionCell[] }>\n /** What the table says when it has no rows. */\n empty: string\n /** A caption under the table. */\n footnote?: string\n}\n\n/** One label/value line of a source's figures. */\nexport interface TaxReturnSectionFigure {\n label: string\n value: string\n note: string\n}\n\n/**\n * One block of the working-papers export, as the CSV's own rows.\n *\n * `jurisdictions` places it beside the operator's own sales by jurisdiction,\n * before the working papers; `sections` places it after them, where each\n * source's figures sit. The platform separates blocks with a blank row.\n */\nexport interface TaxReturnExportBlock {\n placement: 'jurisdictions' | 'sections'\n rows: string[][]\n}\n\n/** What a source answers for one period. */\nexport interface TaxReturnSourceAnswer {\n /** Stable key for the source's findings and its card, unique on the return. */\n id: string\n /** The noun for its rows: `Storefront`, `Marketplace`. */\n name: string\n /** The card's heading. */\n title: string\n /** The card's help, as a documentation excerpt. */\n help: string\n /** The paragraph under the heading. */\n intro: string\n /** Documents past the request's `rowCap` were not read. */\n truncated: boolean\n /** Rows no period query can reach — in this return and every other. */\n undatedRows: number\n /** The source's own findings. Truncation and undated rows are raised by the platform. */\n findings: TaxReturnFinding[]\n /** Lines beneath the filing figures, for the request's `filing.form`. */\n filingLines: TaxReturnFilingLine[]\n tables: TaxReturnSectionTable[]\n figures: TaxReturnSectionFigure[]\n exports: TaxReturnExportBlock[]\n /** The source's own figures, carried whole for the audit. */\n summary: unknown\n /** The rows behind them, as the source projects them for the working papers. */\n rows: unknown[]\n}\n\n/** One source on the return: its answer, or why there is none. */\nexport type TaxReturnSection =\n | ({ outcome: 'answered'; pluginId: string } & TaxReturnSourceAnswer)\n | {\n outcome: 'refused'\n pluginId: string\n /** The plugin id: a refused source never said what it calls itself. */\n id: string\n /** Why nothing from this source is on the return, as the return prints it. */\n reason: string\n }\n\nexport interface TaxReturnSource {\n /**\n * This plugin's sales for one period. May throw: the return refuses the\n * source rather than read a throw as nothing sold.\n */\n read(request: TaxReturnSourceRequest): Promise<TaxReturnSourceAnswer>\n}\n\n/** Every source answers; one per plugin. */\nexport const TAX_RETURN_SOURCES = definePluginServiceContract<TaxReturnSource>(\n 'core.tax-return-sources',\n { multiple: true },\n)\n\n/**\n * Installs a plugin's source. Owner = the loader's marker inside a register\n * fn, else `options.pluginId`. Registering again replaces the plugin's\n * earlier source, so a module evaluated twice does not answer twice.\n */\nexport function registerTaxReturnSource(\n source: TaxReturnSource,\n options?: { pluginId?: string },\n): void {\n if (typeof source?.read !== 'function') {\n throw new Error('a tax return source needs a read function')\n }\n registerPluginService(TAX_RETURN_SOURCES, source, {\n ...(options?.pluginId ? { pluginId: options.pluginId } : {}),\n })\n}\n\n/** The plugins with a registered source, in the order they answer. */\nexport function listTaxReturnSources(): string[] {\n return resolvePluginServices(TAX_RETURN_SOURCES).map((entry) => entry.pluginId)\n}\n\nconst isText = (value: unknown): value is string =>\n typeof value === 'string' && value.trim().length > 0\n\nconst isCount = (value: unknown): boolean =>\n typeof value === 'number' && Number.isFinite(value) && value >= 0\n\n/**\n * What is wrong with an answer, or null when it can be printed.\n *\n * Checked because the answer crosses a package boundary into a legal\n * document: a finding with a NaN count sums to NaN and the verdict reads\n * clean, and a missing array is a section that silently shows nothing.\n */\nfunction malformed(answer: TaxReturnSourceAnswer): string | null {\n if (!answer || typeof answer !== 'object') return 'no section'\n if (!isText(answer.id) || !isText(answer.name) || !isText(answer.title)) {\n return 'a section with no id, name or title'\n }\n if (typeof answer.truncated !== 'boolean') return 'no truncation flag'\n if (!isCount(answer.undatedRows)) return 'no count of undated rows'\n for (const key of ['findings', 'filingLines', 'tables', 'figures', 'exports', 'rows'] as const) {\n if (!Array.isArray(answer[key])) return `no ${key}`\n }\n const badFinding = answer.findings.find(\n (finding) =>\n !isText(finding?.id) ||\n (finding.severity !== 'blocking' && finding.severity !== 'review') ||\n !isCount(finding.count),\n )\n if (badFinding) return 'a finding with no id, severity or count'\n return null\n}\n\n/**\n * Every source's answer for one period — declared sources first, in the\n * compiled order, then any other registered source in registration order.\n *\n * NEVER THROWS and never drops a declared source: a declared plugin with no\n * registration, a source that threw, and a malformed or duplicate answer\n * each come back as `outcome: 'refused'` with the sentence the return prints.\n * `declared` is the compiled {@link PLUGIN_TAX_RETURN_SOURCES} unless a spec\n * passes its own.\n */\nexport async function readTaxReturnSources(\n request: TaxReturnSourceRequest,\n declared: readonly string[] = PLUGIN_TAX_RETURN_SOURCES,\n): Promise<TaxReturnSection[]> {\n const registered = resolvePluginServices(TAX_RETURN_SOURCES)\n const order = [\n ...declared,\n ...registered\n .map((entry) => entry.pluginId)\n .filter((pluginId) => !declared.includes(pluginId)),\n ].filter((pluginId, index, all) => all.indexOf(pluginId) === index)\n\n const answers = await Promise.all(\n order.map(async (pluginId): Promise<TaxReturnSection> => {\n const source = registered.find((entry) => entry.pluginId === pluginId)?.impl\n if (!source) {\n console.error(\n `[tax-return] \"${pluginId}\" declares a tax return source and none is ` +\n 'registered in this process; its sales cannot be read.',\n )\n return {\n outcome: 'refused',\n pluginId,\n id: pluginId,\n reason:\n `The “${pluginId}” plugin sells through the platform and registered ` +\n 'nothing to read its sales with.',\n }\n }\n try {\n const answer = await source.read(request)\n const problem = malformed(answer)\n if (problem) {\n return {\n outcome: 'refused',\n pluginId,\n id: pluginId,\n reason: `The “${pluginId}” plugin answered ${problem}.`,\n }\n }\n return { ...answer, outcome: 'answered', pluginId }\n } catch (error) {\n console.error(`[tax-return] \"${pluginId}\" failed to read its sales`, error)\n return {\n outcome: 'refused',\n pluginId,\n id: pluginId,\n reason: `The “${pluginId}” plugin could not read its sales for this period.`,\n }\n }\n }),\n )\n\n // Two sources under one id would print two cards and one set of findings\n // under the same key, and a finding that names the wrong source's rows is\n // worse than none. The later one is refused, visibly.\n const seen = new Set<string>()\n return answers.map((section) => {\n if (section.outcome !== 'answered') return section\n if (!seen.has(section.id)) {\n seen.add(section.id)\n return section\n }\n return {\n outcome: 'refused',\n pluginId: section.pluginId,\n id: section.pluginId,\n reason:\n `The “${section.pluginId}” plugin answered as “${section.id}”, which ` +\n 'another source already is.',\n }\n })\n}\n"],"names":["PLUGIN_TAX_RETURN_SOURCES","definePluginServiceContract","registerPluginService","resolvePluginServices","TAX_RETURN_SOURCES","multiple","registerTaxReturnSource","source","options","read","Error","pluginId","listTaxReturnSources","map","entry","isText","value","trim","length","isCount","Number","isFinite","malformed","answer","id","name","title","truncated","undatedRows","key","Array","isArray","badFinding","findings","find","finding","severity","count","readTaxReturnSources","request","declared","registered","order","filter","includes","index","all","indexOf","answers","Promise","impl","console","error","outcome","reason","problem","seen","Set","section","has","add"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqDC,GAED,SAASA,yBAAyB,QAAQ,qCAAiC;AAC3E,SACEC,2BAA2B,EAC3BC,qBAAqB,EACrBC,qBAAqB,QAChB,uBAAmB;AAE1B,SAASH,yBAAyB,GAAE;AAyKpC,0CAA0C,GAC1C,OAAO,MAAMI,qBAAqBH,4BAChC,2BACA;IAAEI,UAAU;AAAK,GAClB;AAED;;;;CAIC,GACD,OAAO,SAASC,wBACdC,MAAuB,EACvBC,OAA+B;IAE/B,IAAI,QAAOD,0BAAAA,OAAQE,IAAI,MAAK,YAAY;QACtC,MAAM,IAAIC,MAAM;IAClB;IACAR,sBAAsBE,oBAAoBG,QAAQ,aAC5CC,CAAAA,2BAAAA,QAASG,QAAQ,IAAG;QAAEA,UAAUH,QAAQG,QAAQ;IAAC,IAAI,CAAC;AAE9D;AAEA,oEAAoE,GACpE,OAAO,SAASC;IACd,OAAOT,sBAAsBC,oBAAoBS,GAAG,CAAC,CAACC,QAAUA,MAAMH,QAAQ;AAChF;AAEA,MAAMI,SAAS,CAACC,QACd,OAAOA,UAAU,YAAYA,MAAMC,IAAI,GAAGC,MAAM,GAAG;AAErD,MAAMC,UAAU,CAACH,QACf,OAAOA,UAAU,YAAYI,OAAOC,QAAQ,CAACL,UAAUA,SAAS;AAElE;;;;;;CAMC,GACD,SAASM,UAAUC,MAA6B;IAC9C,IAAI,CAACA,UAAU,OAAOA,WAAW,UAAU,OAAO;IAClD,IAAI,CAACR,OAAOQ,OAAOC,EAAE,KAAK,CAACT,OAAOQ,OAAOE,IAAI,KAAK,CAACV,OAAOQ,OAAOG,KAAK,GAAG;QACvE,OAAO;IACT;IACA,IAAI,OAAOH,OAAOI,SAAS,KAAK,WAAW,OAAO;IAClD,IAAI,CAACR,QAAQI,OAAOK,WAAW,GAAG,OAAO;IACzC,KAAK,MAAMC,OAAO;QAAC;QAAY;QAAe;QAAU;QAAW;QAAW;KAAO,CAAW;QAC9F,IAAI,CAACC,MAAMC,OAAO,CAACR,MAAM,CAACM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAEA,KAAK;IACrD;IACA,MAAMG,aAAaT,OAAOU,QAAQ,CAACC,IAAI,CACrC,CAACC,UACC,CAACpB,OAAOoB,2BAAAA,QAASX,EAAE,KAClBW,QAAQC,QAAQ,KAAK,cAAcD,QAAQC,QAAQ,KAAK,YACzD,CAACjB,QAAQgB,QAAQE,KAAK;IAE1B,IAAIL,YAAY,OAAO;IACvB,OAAO;AACT;AAEA;;;;;;;;;CASC,GACD,OAAO,eAAeM,qBACpBC,OAA+B,EAC/BC,WAA8BxC,yBAAyB;IAEvD,MAAMyC,aAAatC,sBAAsBC;IACzC,MAAMsC,QAAQ;WACTF;WACAC,WACA5B,GAAG,CAAC,CAACC,QAAUA,MAAMH,QAAQ,EAC7BgC,MAAM,CAAC,CAAChC,WAAa,CAAC6B,SAASI,QAAQ,CAACjC;KAC5C,CAACgC,MAAM,CAAC,CAAChC,UAAUkC,OAAOC,MAAQA,IAAIC,OAAO,CAACpC,cAAckC;IAE7D,MAAMG,UAAU,MAAMC,QAAQH,GAAG,CAC/BJ,MAAM7B,GAAG,CAAC,OAAOF;YACA8B;QAAf,MAAMlC,UAASkC,mBAAAA,WAAWP,IAAI,CAAC,CAACpB,QAAUA,MAAMH,QAAQ,KAAKA,8BAA9C8B,iBAAyDS,IAAI;QAC5E,IAAI,CAAC3C,QAAQ;YACX4C,QAAQC,KAAK,CACX,CAAC,cAAc,EAAEzC,SAAS,2CAA2C,CAAC,GACpE;YAEJ,OAAO;gBACL0C,SAAS;gBACT1C;gBACAa,IAAIb;gBACJ2C,QACE,CAAC,KAAK,EAAE3C,SAAS,mDAAmD,CAAC,GACrE;YACJ;QACF;QACA,IAAI;YACF,MAAMY,SAAS,MAAMhB,OAAOE,IAAI,CAAC8B;YACjC,MAAMgB,UAAUjC,UAAUC;YAC1B,IAAIgC,SAAS;gBACX,OAAO;oBACLF,SAAS;oBACT1C;oBACAa,IAAIb;oBACJ2C,QAAQ,CAAC,KAAK,EAAE3C,SAAS,kBAAkB,EAAE4C,QAAQ,CAAC,CAAC;gBACzD;YACF;YACA,OAAO,aAAKhC;gBAAQ8B,SAAS;gBAAY1C;;QAC3C,EAAE,OAAOyC,OAAO;YACdD,QAAQC,KAAK,CAAC,CAAC,cAAc,EAAEzC,SAAS,0BAA0B,CAAC,EAAEyC;YACrE,OAAO;gBACLC,SAAS;gBACT1C;gBACAa,IAAIb;gBACJ2C,QAAQ,CAAC,KAAK,EAAE3C,SAAS,kDAAkD,CAAC;YAC9E;QACF;IACF;IAGF,yEAAyE;IACzE,0EAA0E;IAC1E,sDAAsD;IACtD,MAAM6C,OAAO,IAAIC;IACjB,OAAOT,QAAQnC,GAAG,CAAC,CAAC6C;QAClB,IAAIA,QAAQL,OAAO,KAAK,YAAY,OAAOK;QAC3C,IAAI,CAACF,KAAKG,GAAG,CAACD,QAAQlC,EAAE,GAAG;YACzBgC,KAAKI,GAAG,CAACF,QAAQlC,EAAE;YACnB,OAAOkC;QACT;QACA,OAAO;YACLL,SAAS;YACT1C,UAAU+C,QAAQ/C,QAAQ;YAC1Ba,IAAIkC,QAAQ/C,QAAQ;YACpB2C,QACE,CAAC,KAAK,EAAEI,QAAQ/C,QAAQ,CAAC,sBAAsB,EAAE+C,QAAQlC,EAAE,CAAC,SAAS,CAAC,GACtE;QACJ;IACF;AACF"}
@@ -0,0 +1,75 @@
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 { PLUGIN_TEMPLATE_SOURCES } from './first-party-plugins.generated';
18
+ /**
19
+ * Where a site's template came from, by its stored `source.type` (AGL-666,
20
+ * AGL-3080).
21
+ *
22
+ * The stamp is server-managed, which is what lets a site's library show it as
23
+ * a trust signal. Two values are the platform's own: {@link
24
+ * AUTHORED_TEMPLATE_SOURCE}, a template saved on the site, and {@link
25
+ * STARTER_TEMPLATE_SOURCE}, a first-party starter copied in when it was used
26
+ * or edited. Every other value is stamped by a plugin that INSTALLS templates
27
+ * into a site's library, and that plugin declares it as `templateSource` in
28
+ * `plugins.config.json`: the value its install route writes, the badge the
29
+ * library shows, and the sentence explaining the badge.
30
+ *
31
+ * ## Compiled, never registered
32
+ *
33
+ * The readers ask before any plugin code has loaded, and one of them asks
34
+ * Firestore by value: the template gallery's own shelf holds a site's saved
35
+ * AND installed templates, as a `source.type in [...]` clause. A runtime
36
+ * registry the page had not filled yet would leave every installed template
37
+ * off that shelf with nothing to say it was missing, so the declaration is
38
+ * data the generator compiles.
39
+ *
40
+ * ## A type no plugin declares
41
+ *
42
+ * A template installed by a plugin this build no longer carries keeps its
43
+ * stamp, and the stamp still says a server installed it. It reads as
44
+ * installed ({@link installedTemplateSource} answers `null`, and the
45
+ * library's badge says "Installed") rather than as something the site
46
+ * authored.
47
+ */
48
+ export interface PluginTemplateSource {
49
+ /** The plugin that declared it. */
50
+ pluginId: string;
51
+ /** The `source.type` the plugin's install route stamps. */
52
+ type: string;
53
+ /** The library's badge: the name of where the template came from. */
54
+ label: string;
55
+ /** One sentence saying where the template came from, for the badge's hint. */
56
+ description: string;
57
+ }
58
+ /** A template saved on the site itself — and one written before `source`. */
59
+ export declare const AUTHORED_TEMPLATE_SOURCE = "authored";
60
+ /** A first-party starter, copied into the library when it was used or edited. */
61
+ export declare const STARTER_TEMPLATE_SOURCE = "starter";
62
+ export { PLUGIN_TEMPLATE_SOURCES };
63
+ /** Every `source.type` a plugin in this build stamps on a template it installs. */
64
+ export declare const INSTALLED_TEMPLATE_SOURCE_TYPES: readonly string[];
65
+ /**
66
+ * The declaration behind a template's `source.type`, or `null` for the
67
+ * platform's own two values, a missing stamp, and a stamp no plugin in this
68
+ * build declares.
69
+ */
70
+ export declare function installedTemplateSource(type: unknown): PluginTemplateSource | null;
71
+ /**
72
+ * Whether a template was installed rather than saved here or started from a
73
+ * starter: any stamp but the platform's own two, declared or not.
74
+ */
75
+ export declare function isInstalledTemplateSource(type: unknown): boolean;
@@ -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,107 @@
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
+ /** A meter a plugin contributes to the platform's cost model. */
18
+ export interface PluginCostAxisDeclaration {
19
+ /** The breakdown key every staff reader shows it under. */
20
+ id: string;
21
+ /** Where it sorts among the cost model's axes; core's own are multiples of 10. */
22
+ order: number;
23
+ /** Rollup fields summed for the axis. */
24
+ fields: readonly string[];
25
+ /**
26
+ * Read only when every one of `fields` is absent from a rollup — the
27
+ * narrower field an older rollup recorded the same meter under.
28
+ */
29
+ fallbackFields?: readonly string[];
30
+ /**
31
+ * Rollup fields recorded beside the meter so its sum is legible, forwarded
32
+ * by `orgCogsInputFrom` and never priced.
33
+ */
34
+ recordedFields?: readonly string[];
35
+ /**
36
+ * The `ORG_COGS_UNIT_RATES_USD` key pricing one unit. Absent when the
37
+ * fields are already dollars, which then enter the model at ×1.
38
+ */
39
+ rate?: string;
40
+ /**
41
+ * The month's LIVE reading, when the rollup's figure is a snapshot a meter
42
+ * keeps adding to: `orgs/{orgId}/{collection}/{month}`, the first of
43
+ * `fields` that is a positive number. It replaces the axis's first rollup
44
+ * field wherever a reader fetches it.
45
+ */
46
+ live?: {
47
+ collection: string;
48
+ fields: readonly string[];
49
+ };
50
+ }
51
+ /** A band a plugin contributes to the utilization table. */
52
+ export interface PluginUsageBandDeclaration {
53
+ /** The band's key, and the column the staff table shows it under. */
54
+ id: string;
55
+ label: string;
56
+ order: number;
57
+ /** Rollup fields summed for what the org used. */
58
+ fields: readonly string[];
59
+ fallbackFields?: readonly string[];
60
+ /** The resolved entitlement holding what the plan includes. */
61
+ entitlement: string;
62
+ /** The entitlement is per SITE and the org-wide band is it × `hostLimit`. */
63
+ perHost?: boolean;
64
+ /**
65
+ * The band is sold in a unit of cost and the rollup records dollars: what
66
+ * was used is `ceil(dollars / unitCostUsd)`, rounded UP so spend already
67
+ * made never reads as less of the band.
68
+ */
69
+ unitCostUsd?: number;
70
+ }
71
+ export type ResolvedPluginCostAxis = PluginCostAxisDeclaration & {
72
+ pluginId: string;
73
+ };
74
+ export type ResolvedPluginUsageBand = PluginUsageBandDeclaration & {
75
+ pluginId: string;
76
+ };
77
+ /** What a plugin's `usageAxes` function answers. */
78
+ export interface PluginUsageAxesDeclaration {
79
+ costAxes?: readonly PluginCostAxisDeclaration[];
80
+ bands?: readonly PluginUsageBandDeclaration[];
81
+ }
82
+ export declare function pluginCostAxes(): readonly ResolvedPluginCostAxis[];
83
+ export declare function pluginUsageBands(): readonly ResolvedPluginUsageBand[];
84
+ /**
85
+ * What a rollup recorded for a declared meter: `fields` summed, or
86
+ * `fallbackFields` summed when the rollup carries none of `fields` at all.
87
+ *
88
+ * "Carries none" is `null` or absent, never zero. A rollup that measured
89
+ * zero has answered, and must not fall back to a figure recorded under an
90
+ * older, narrower basis.
91
+ */
92
+ export declare function declaredMeterReading(source: Readonly<Record<string, unknown>> | null | undefined, declared: {
93
+ fields: readonly string[];
94
+ fallbackFields?: readonly string[];
95
+ }): number;
96
+ /**
97
+ * The live reading a cost axis names: the first of its `live.fields` that is
98
+ * a positive number on the month's document, or `undefined` when none is.
99
+ * `undefined` is "keep the rollup's snapshot", never zero.
100
+ */
101
+ export declare function liveMeterReading(document: {
102
+ get(field: string): unknown;
103
+ } | null | undefined, live: {
104
+ fields: readonly string[];
105
+ }): number | undefined;
106
+ /** Every rollup field the declared cost axes read or record, in order. */
107
+ export declare function pluginCostAxisFields(): string[];
@@ -0,0 +1,107 @@
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.
38
+ *
39
+ * ## What core keeps
40
+ *
41
+ * The MONEY. Every unit rate stays in `ORG_COGS_UNIT_RATES_USD`, beside the
42
+ * billed table it is reconciled against, and every included figure stays in
43
+ * `PLAN_ENTITLEMENTS`. A declaration names fields and keys; it carries no
44
+ * price. The one number a declaration may carry is a band's unit cost, where
45
+ * the band is sold in a unit OF cost (a credit is a fixed quantity of
46
+ * dollars), and that number is the plugin's own definition of its unit.
47
+ *
48
+ * ## Compiled, never registered
49
+ *
50
+ * The cost model's readers include the staff org page, which prices a rollup
51
+ * in the browser, and the discount guardrail, whose every wrong answer is in
52
+ * the approving direction: a cost axis a registry had not filled would price
53
+ * at nothing and approve a discount the margin cannot carry. So these are
54
+ * compiled from each plugin's `usage-axes` declaration by the manifest
55
+ * generator, like the plan figures, and a rate key core does not have is an
56
+ * error rather than a zero.
57
+ */ import { PLUGIN_USAGE_BANDS_DECLARED, PLUGIN_COST_AXES_DECLARED } from "./first-party-plugins.generated.js";
58
+ export function pluginCostAxes() {
59
+ return PLUGIN_COST_AXES_DECLARED;
60
+ }
61
+ export function pluginUsageBands() {
62
+ return PLUGIN_USAGE_BANDS_DECLARED;
63
+ }
64
+ /** A positive finite number, or 0 — the reading every meter is priced from. */ function meterValue(value) {
65
+ const parsed = Number(value != null ? value : 0);
66
+ return Number.isFinite(parsed) && parsed > 0 ? parsed : 0;
67
+ }
68
+ /**
69
+ * What a rollup recorded for a declared meter: `fields` summed, or
70
+ * `fallbackFields` summed when the rollup carries none of `fields` at all.
71
+ *
72
+ * "Carries none" is `null` or absent, never zero. A rollup that measured
73
+ * zero has answered, and must not fall back to a figure recorded under an
74
+ * older, narrower basis.
75
+ */ export function declaredMeterReading(source, declared) {
76
+ var _declared_fallbackFields;
77
+ const present = declared.fields.some((field)=>(source == null ? void 0 : source[field]) != null);
78
+ const fields = !present && ((_declared_fallbackFields = declared.fallbackFields) == null ? void 0 : _declared_fallbackFields.length) ? declared.fallbackFields : declared.fields;
79
+ return fields.reduce((sum, field)=>sum + meterValue(source == null ? void 0 : source[field]), 0);
80
+ }
81
+ /**
82
+ * The live reading a cost axis names: the first of its `live.fields` that is
83
+ * a positive number on the month's document, or `undefined` when none is.
84
+ * `undefined` is "keep the rollup's snapshot", never zero.
85
+ */ export function liveMeterReading(document, live) {
86
+ for (const field of live.fields){
87
+ const value = meterValue(document == null ? void 0 : document.get(field));
88
+ if (value > 0) return value;
89
+ }
90
+ return undefined;
91
+ }
92
+ /** Every rollup field the declared cost axes read or record, in order. */ export function pluginCostAxisFields() {
93
+ const fields = [];
94
+ for (const axis of PLUGIN_COST_AXES_DECLARED){
95
+ var _axis_fallbackFields, _axis_recordedFields;
96
+ for (const field of [
97
+ ...axis.fields,
98
+ ...(_axis_fallbackFields = axis.fallbackFields) != null ? _axis_fallbackFields : [],
99
+ ...(_axis_recordedFields = axis.recordedFields) != null ? _axis_recordedFields : []
100
+ ]){
101
+ if (!fields.includes(field)) fields.push(field);
102
+ }
103
+ }
104
+ return fields;
105
+ }
106
+
107
+ //# 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.\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, 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 {\n PLUGIN_USAGE_BANDS_DECLARED,\n PLUGIN_COST_AXES_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 * 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\nexport type ResolvedPluginCostAxis = PluginCostAxisDeclaration & { pluginId: string }\nexport type ResolvedPluginUsageBand = PluginUsageBandDeclaration & { pluginId: string }\n\n/** What a plugin's `usageAxes` function answers. */\nexport interface PluginUsageAxesDeclaration {\n costAxes?: readonly PluginCostAxisDeclaration[]\n bands?: readonly PluginUsageBandDeclaration[]\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 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"],"names":["PLUGIN_USAGE_BANDS_DECLARED","PLUGIN_COST_AXES_DECLARED","pluginCostAxes","pluginUsageBands","meterValue","value","parsed","Number","isFinite","declaredMeterReading","source","declared","present","fields","some","field","fallbackFields","length","reduce","sum","liveMeterReading","document","live","get","undefined","pluginCostAxisFields","axis","recordedFields","includes","push"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyCC,GAED,SACEA,2BAA2B,EAC3BC,yBAAyB,QACpB,qCAAiC;AAgExC,OAAO,SAASC;IACd,OAAOD;AACT;AAEA,OAAO,SAASE;IACd,OAAOH;AACT;AAEA,6EAA6E,GAC7E,SAASI,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,SAASE,MAAM,CAACC,IAAI,CAAC,CAACC,QAAUL,CAAAA,0BAAAA,MAAQ,CAACK,MAAM,KAAI;IACnE,MAAMF,SACJ,CAACD,aAAWD,2BAAAA,SAASK,cAAc,qBAAvBL,yBAAyBM,MAAM,IACvCN,SAASK,cAAc,GACvBL,SAASE,MAAM;IACrB,OAAOA,OAAOK,MAAM,CAAC,CAACC,KAAKJ,QAAUI,MAAMf,WAAWM,0BAAAA,MAAQ,CAACK,MAAM,GAAG;AAC1E;AAEA;;;;CAIC,GACD,OAAO,SAASK,iBACdC,QAA4D,EAC5DC,IAAmC;IAEnC,KAAK,MAAMP,SAASO,KAAKT,MAAM,CAAE;QAC/B,MAAMR,QAAQD,WAAWiB,4BAAAA,SAAUE,GAAG,CAACR;QACvC,IAAIV,QAAQ,GAAG,OAAOA;IACxB;IACA,OAAOmB;AACT;AAEA,wEAAwE,GACxE,OAAO,SAASC;IACd,MAAMZ,SAAmB,EAAE;IAC3B,KAAK,MAAMa,QAAQzB,0BAA2B;YAGtCyB,sBACAA;QAHN,KAAK,MAAMX,SAAS;eACfW,KAAKb,MAAM;gBACVa,uBAAAA,KAAKV,cAAc,YAAnBU,uBAAuB,EAAE;gBACzBA,uBAAAA,KAAKC,cAAc,YAAnBD,uBAAuB,EAAE;SAC9B,CAAE;YACD,IAAI,CAACb,OAAOe,QAAQ,CAACb,QAAQF,OAAOgB,IAAI,CAACd;QAC3C;IACF;IACA,OAAOF;AACT"}
@@ -21,10 +21,9 @@
21
21
  * a slot id has always been an open string, so a plugin could already host a
22
22
  * zone of its own. What it could not do is say what that zone HANDS a widget.
23
23
  * The props had to be a type, the type had to be somewhere both sides import,
24
- * and "somewhere both sides import" was read as the core — which is how
25
- * `plugin-manager/commerce-zone-props.ts` and `plugin-manager/record-zone-props.ts`
26
- * came to spell out the commerce catalog and the record vocabulary of two
27
- * named plugins inside the platform.
24
+ * and "somewhere both sides import" was read as the core — which is how a
25
+ * named plugin's catalog or record vocabulary comes to be spelled out inside
26
+ * the platform.
28
27
  *
29
28
  * So the declaration moves to the plugin. A plugin defines a token for its
30
29
  * zone with {@link definePluginZone}, carrying the props type on the token,
@@ -36,7 +35,7 @@
36
35
  *
37
36
  * A zone token is `{ id }` and nothing else: `__props` is a phantom field that
38
37
  * never holds a value, so the props type is carried at the type level and
39
- * erased. That is the same trick the two type-only modules above use, and it
38
+ * erased. That is the same trick a type-only props module uses, and it
40
39
  * is load-bearing rather than tidy — AGL-3082 measured the zone catalog on the
41
40
  * published page's static graph, and a declaration that put a plugin's prop
42
41
  * SHAPES there would have made every published page carry the console's