@aglyn/aglyn 1.0.0-beta.219 → 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 (175) hide show
  1. package/package.json +12 -12
  2. package/src/lib/app-utils/actions.d.ts +1 -59
  3. package/src/lib/app-utils/actions.js +7 -72
  4. package/src/lib/app-utils/actions.js.map +1 -1
  5. package/src/lib/app-utils/consent-groups.d.ts +1 -1
  6. package/src/lib/app-utils/consent-groups.js.map +1 -1
  7. package/src/lib/app-utils/console-routes.d.ts +0 -36
  8. package/src/lib/app-utils/console-routes.js +2 -37
  9. package/src/lib/app-utils/console-routes.js.map +1 -1
  10. package/src/lib/app-utils/contacts.d.ts +1 -1
  11. package/src/lib/app-utils/contacts.js.map +1 -1
  12. package/src/lib/app-utils/container-membership.d.ts +93 -0
  13. package/src/lib/app-utils/container-membership.js +165 -0
  14. package/src/lib/app-utils/container-membership.js.map +1 -0
  15. package/src/lib/app-utils/crm-task-reminders.d.ts +23 -6
  16. package/src/lib/app-utils/crm-task-reminders.js +32 -11
  17. package/src/lib/app-utils/crm-task-reminders.js.map +1 -1
  18. package/src/lib/app-utils/crm.d.ts +24 -4
  19. package/src/lib/app-utils/crm.js +23 -0
  20. package/src/lib/app-utils/crm.js.map +1 -1
  21. package/src/lib/app-utils/csv-upload.d.ts +1 -1
  22. package/src/lib/app-utils/csv-upload.js +1 -1
  23. package/src/lib/app-utils/csv-upload.js.map +1 -1
  24. package/src/lib/app-utils/{dataset-csv.d.ts → csv.d.ts} +10 -43
  25. package/src/lib/app-utils/{dataset-csv.js → csv.js} +10 -81
  26. package/src/lib/app-utils/csv.js.map +1 -0
  27. package/src/lib/app-utils/datasets.d.ts +0 -19
  28. package/src/lib/app-utils/datasets.js +0 -13
  29. package/src/lib/app-utils/datasets.js.map +1 -1
  30. package/src/lib/app-utils/docs-help.generated.d.ts +2 -2
  31. package/src/lib/app-utils/docs-help.generated.js +2 -0
  32. package/src/lib/app-utils/docs-help.generated.js.map +1 -1
  33. package/src/lib/app-utils/docs-index.generated.js +63 -35
  34. package/src/lib/app-utils/docs-index.generated.js.map +1 -1
  35. package/src/lib/app-utils/dynamic-list-rule.js +3 -3
  36. package/src/lib/app-utils/dynamic-list-rule.js.map +1 -1
  37. package/src/lib/app-utils/email-text.d.ts +80 -0
  38. package/src/lib/app-utils/email-text.js +189 -0
  39. package/src/lib/app-utils/email-text.js.map +1 -0
  40. package/src/lib/app-utils/{list-assignment-policy.d.ts → enrollment-basis.d.ts} +4 -0
  41. package/src/lib/app-utils/{list-assignment-policy.js → enrollment-basis.js} +5 -1
  42. package/src/lib/app-utils/enrollment-basis.js.map +1 -0
  43. package/src/lib/app-utils/expand-repeatables.js +4 -4
  44. package/src/lib/app-utils/expand-repeatables.js.map +1 -1
  45. package/src/lib/app-utils/forms.js +2 -2
  46. package/src/lib/app-utils/forms.js.map +1 -1
  47. package/src/lib/app-utils/health-report.d.ts +2 -3
  48. package/src/lib/app-utils/health-report.js +8 -6
  49. package/src/lib/app-utils/health-report.js.map +1 -1
  50. package/src/lib/app-utils/inbound-mail-domain.d.ts +27 -0
  51. package/src/lib/app-utils/inbound-mail-domain.js +31 -0
  52. package/src/lib/app-utils/inbound-mail-domain.js.map +1 -0
  53. package/src/lib/app-utils/lockdown.d.ts +11 -0
  54. package/src/lib/app-utils/lockdown.js +33 -3
  55. package/src/lib/app-utils/lockdown.js.map +1 -1
  56. package/src/lib/app-utils/member-email-aliases.d.ts +25 -0
  57. package/src/lib/app-utils/member-email-aliases.js +29 -0
  58. package/src/lib/app-utils/member-email-aliases.js.map +1 -1
  59. package/src/lib/app-utils/notifications.d.ts +69 -0
  60. package/src/lib/app-utils/notifications.js +119 -0
  61. package/src/lib/app-utils/notifications.js.map +1 -1
  62. package/src/lib/app-utils/operator-alerts.d.ts +15 -1
  63. package/src/lib/app-utils/operator-alerts.js +47 -10
  64. package/src/lib/app-utils/operator-alerts.js.map +1 -1
  65. package/src/lib/app-utils/plan-entitlements.d.ts +164 -178
  66. package/src/lib/app-utils/plan-entitlements.js +200 -224
  67. package/src/lib/app-utils/plan-entitlements.js.map +1 -1
  68. package/src/lib/app-utils/platform-marketing-consent.d.ts +56 -2
  69. package/src/lib/app-utils/platform-marketing-consent.js +6 -5
  70. package/src/lib/app-utils/platform-marketing-consent.js.map +1 -1
  71. package/src/lib/app-utils/plugin-starter-templates.generated.d.ts +12 -0
  72. package/src/lib/app-utils/plugin-starter-templates.generated.js +711 -0
  73. package/src/lib/app-utils/plugin-starter-templates.generated.js.map +1 -0
  74. package/src/lib/app-utils/repeat-query.d.ts +56 -0
  75. package/src/lib/app-utils/{dataset-query.js → repeat-query.js} +16 -16
  76. package/src/lib/app-utils/repeat-query.js.map +1 -0
  77. package/src/lib/app-utils/server.d.ts +7 -9
  78. package/src/lib/app-utils/server.js +18 -26
  79. package/src/lib/app-utils/server.js.map +1 -1
  80. package/src/lib/app-utils/starter-template-nodes.d.ts +137 -0
  81. package/src/lib/app-utils/starter-template-nodes.js +129 -0
  82. package/src/lib/app-utils/starter-template-nodes.js.map +1 -0
  83. package/src/lib/app-utils/starter-templates.d.ts +11 -34
  84. package/src/lib/app-utils/starter-templates.js +19 -230
  85. package/src/lib/app-utils/starter-templates.js.map +1 -1
  86. package/src/lib/app-utils/{email-topics.d.ts → subscription-topics.d.ts} +64 -48
  87. package/src/lib/app-utils/{email-topics.js → subscription-topics.js} +39 -109
  88. package/src/lib/app-utils/subscription-topics.js.map +1 -0
  89. package/src/lib/app-utils/usage-budget.d.ts +73 -188
  90. package/src/lib/app-utils/usage-budget.js +58 -194
  91. package/src/lib/app-utils/usage-budget.js.map +1 -1
  92. package/src/lib/app-utils/utm-attribution.d.ts +1 -1
  93. package/src/lib/app-utils/utm-attribution.js +1 -1
  94. package/src/lib/app-utils/utm-attribution.js.map +1 -1
  95. package/src/lib/app-utils/{campaign-touch.d.ts → utm-touch.d.ts} +21 -13
  96. package/src/lib/app-utils/{campaign-touch.js → utm-touch.js} +30 -22
  97. package/src/lib/app-utils/utm-touch.js.map +1 -0
  98. package/src/lib/app-utils/variables.d.ts +9 -9
  99. package/src/lib/app-utils/variables.js.map +1 -1
  100. package/src/lib/app-utils/visitor-record-ceiling.d.ts +32 -0
  101. package/src/lib/app-utils/visitor-record-ceiling.js +39 -0
  102. package/src/lib/app-utils/visitor-record-ceiling.js.map +1 -1
  103. package/src/lib/foundation/definitions/org-billing.types.d.ts +2 -2
  104. package/src/lib/foundation/definitions/org-billing.types.js.map +1 -1
  105. package/src/lib/plugin-manager/feature-plugins.d.ts +80 -79
  106. package/src/lib/plugin-manager/feature-plugins.js +22 -35
  107. package/src/lib/plugin-manager/feature-plugins.js.map +1 -1
  108. package/src/lib/plugin-manager/first-party-plugins.generated.d.ts +12 -1
  109. package/src/lib/plugin-manager/first-party-plugins.generated.js +58 -2
  110. package/src/lib/plugin-manager/first-party-plugins.generated.js.map +1 -1
  111. package/src/lib/plugin-manager/index.d.ts +0 -1
  112. package/src/lib/plugin-manager/index.js +0 -1
  113. package/src/lib/plugin-manager/index.js.map +1 -1
  114. package/src/lib/plugin-manager/plugin-contact-capture.d.ts +9 -4
  115. package/src/lib/plugin-manager/plugin-contact-capture.js.map +1 -1
  116. package/src/lib/plugin-manager/plugin-containers.d.ts +68 -0
  117. package/src/lib/plugin-manager/plugin-containers.generated.d.ts +10 -0
  118. package/src/lib/plugin-manager/plugin-containers.generated.js +20 -0
  119. package/src/lib/plugin-manager/plugin-containers.generated.js.map +1 -0
  120. package/src/lib/plugin-manager/plugin-containers.js +27 -0
  121. package/src/lib/plugin-manager/plugin-containers.js.map +1 -0
  122. package/src/lib/plugin-manager/plugin-entitlements.d.ts +8 -0
  123. package/src/lib/plugin-manager/plugin-entitlements.js.map +1 -1
  124. package/src/lib/plugin-manager/plugin-membership-detach.js +1 -1
  125. package/src/lib/plugin-manager/plugin-membership-detach.js.map +1 -1
  126. package/src/lib/plugin-manager/plugin-record-email-state.d.ts +69 -0
  127. package/src/lib/plugin-manager/plugin-record-email-state.js +32 -0
  128. package/src/lib/plugin-manager/plugin-record-email-state.js.map +1 -1
  129. package/src/lib/plugin-manager/plugin-record-lists.d.ts +115 -0
  130. package/src/lib/plugin-manager/plugin-record-lists.js +75 -0
  131. package/src/lib/plugin-manager/plugin-record-lists.js.map +1 -0
  132. package/src/lib/plugin-manager/plugin-record-timeline.d.ts +42 -8
  133. package/src/lib/plugin-manager/plugin-record-timeline.js.map +1 -1
  134. package/src/lib/plugin-manager/plugin-site-beacons.d.ts +71 -0
  135. package/src/lib/plugin-manager/plugin-site-beacons.js +54 -0
  136. package/src/lib/plugin-manager/plugin-site-beacons.js.map +1 -0
  137. package/src/lib/plugin-manager/plugin-subscription-topics.generated.d.ts +11 -0
  138. package/src/lib/plugin-manager/plugin-subscription-topics.generated.js +41 -0
  139. package/src/lib/plugin-manager/plugin-subscription-topics.generated.js.map +1 -0
  140. package/src/lib/plugin-manager/plugin-usage-axes.d.ts +212 -0
  141. package/src/lib/plugin-manager/plugin-usage-axes.js +82 -3
  142. package/src/lib/plugin-manager/plugin-usage-axes.js.map +1 -1
  143. package/src/lib/plugin-manager/plugin-usage-meters.d.ts +108 -0
  144. package/src/lib/plugin-manager/plugin-usage-meters.js +105 -0
  145. package/src/lib/plugin-manager/plugin-usage-meters.js.map +1 -0
  146. package/src/lib/plugin-manager/usage-alert-contributors.d.ts +76 -6
  147. package/src/lib/plugin-manager/usage-alert-contributors.js +23 -10
  148. package/src/lib/plugin-manager/usage-alert-contributors.js.map +1 -1
  149. package/src/lib/app-utils/assist-credits.d.ts +0 -482
  150. package/src/lib/app-utils/assist-credits.js +0 -510
  151. package/src/lib/app-utils/assist-credits.js.map +0 -1
  152. package/src/lib/app-utils/campaign-membership.d.ts +0 -121
  153. package/src/lib/app-utils/campaign-membership.js +0 -189
  154. package/src/lib/app-utils/campaign-membership.js.map +0 -1
  155. package/src/lib/app-utils/campaign-touch.js.map +0 -1
  156. package/src/lib/app-utils/console-record-links.d.ts +0 -84
  157. package/src/lib/app-utils/console-record-links.js +0 -76
  158. package/src/lib/app-utils/console-record-links.js.map +0 -1
  159. package/src/lib/app-utils/crm-booking.d.ts +0 -75
  160. package/src/lib/app-utils/crm-booking.js +0 -133
  161. package/src/lib/app-utils/crm-booking.js.map +0 -1
  162. package/src/lib/app-utils/crm-inbound.d.ts +0 -245
  163. package/src/lib/app-utils/crm-inbound.js +0 -407
  164. package/src/lib/app-utils/crm-inbound.js.map +0 -1
  165. package/src/lib/app-utils/crm-reports.d.ts +0 -479
  166. package/src/lib/app-utils/crm-reports.js +0 -680
  167. package/src/lib/app-utils/crm-reports.js.map +0 -1
  168. package/src/lib/app-utils/dataset-csv.js.map +0 -1
  169. package/src/lib/app-utils/dataset-query.d.ts +0 -57
  170. package/src/lib/app-utils/dataset-query.js.map +0 -1
  171. package/src/lib/app-utils/email-topics.js.map +0 -1
  172. package/src/lib/app-utils/list-assignment-policy.js.map +0 -1
  173. package/src/lib/plugin-manager/plugin-metered-lines.d.ts +0 -97
  174. package/src/lib/plugin-manager/plugin-metered-lines.js +0 -123
  175. package/src/lib/plugin-manager/plugin-metered-lines.js.map +0 -1
@@ -930,6 +930,75 @@ export declare const INFRA_COGS_PER_SITE_USD = 2;
930
930
  * The console keeps importing it from `usage-metering` unchanged.
931
931
  */
932
932
  export declare const METERED_MARKUP = 1.3;
933
+ /**
934
+ * What the CDN requests behind ONE page view cost once the platform is past
935
+ * its hosting plan's included request allowance, at the DEAREST region the
936
+ * CDN bills, in USD per view (AGL-1879, AGL-3444). A page view billed past a
937
+ * plan's band is priced at `(perPageView + this) × METERED_MARKUP` — $0.70
938
+ * per 1,000 — and every `bandwidthGb` band is sized with it counted.
939
+ *
940
+ * ## Why a page view needs a second cost term
941
+ *
942
+ * `perPageView` prices what a view WEIGHS: the bytes it transfers at the
943
+ * CDN's per-GB rate, plus the Firestore reads behind the render. The CDN also
944
+ * charges per REQUEST once the team's monthly allowance is spent — Vercel Pro
945
+ * includes 10,000,000 a month, then bills $2.00 to $3.20 per million by
946
+ * region. A cold load of `aglyn.com/` makes 57 first-party requests to settle
947
+ * (`tools/tenant-page-budget.json`, `wireCalibration.measuredAgainst`), so the
948
+ * allowance is about 175,000 views of that page a month, platform-wide —
949
+ * about 169 GB of included bandwidth — where the 1 TB transfer allowance
950
+ * lasts about 1.4 million. The request allowance runs out first.
951
+ *
952
+ * ## Why the dearest region
953
+ *
954
+ * The CDN bills a request, and the bytes it transfers, in the region that
955
+ * SERVES it — the one nearest the visitor — so a site whose audience is in
956
+ * São Paulo or Cape Town costs what those regions cost, and nothing about a
957
+ * plan can choose otherwise. The platform's rule is that no plan is under
958
+ * water at any utilization and that "at cost + 30%" is true of every billed
959
+ * unit, so both terms of a page view are priced where the CDN is dearest:
960
+ * transfer at $0.35 per GB (in `perPageView`) and requests at $3.20 per
961
+ * million (here). Past the allowance a view then costs:
962
+ *
963
+ * | | weight | requests | cost / 1k | margin at $0.70 |
964
+ * |-----------------------------------|------------|-----------|-----------|-----------------|
965
+ * | the page as measured (748.5 KB) | $0.262148 | $0.182400 | $0.4445 | +36.5% |
966
+ * | the priced basis (1012.8 KB) | $0.354715 | $0.182400 | $0.5371 | +23.3% |
967
+ *
968
+ * — at least 30% over cost in every region, which is the claim `/pricing`
969
+ * makes.
970
+ *
971
+ * ## The figure
972
+ *
973
+ * $0.00018374681 is 57.42 requests at $3.20 per million — the measured 57,
974
+ * with the basis set ABOVE the measurement as the weight basis is — pinned so
975
+ * the billed price lands on a whole cent: ($0.354715 + $0.1824) × 1.3 is
976
+ * $0.6982 per 1,000, rounded up to $0.70, and ($0.354715 + $0.183747) × 1.3
977
+ * is exactly $0.70. Published as "Our cost $0.538462 / You pay $0.70", the
978
+ * "at cost + 30%" claim stays true of the cost a billed view incurs in the
979
+ * dearest region, and so in every other.
980
+ *
981
+ * ## ⛔ Not in {@link ORG_COGS_UNIT_RATES_USD}, deliberately
982
+ *
983
+ * `perPageView` is half of a pair with `ESTIMATED_PAGE_TRANSFER_BYTES` — one
984
+ * page weight in dollars and in bytes — and `npm run check:page-view-rate`
985
+ * recovers that weight from the rate. A per-request charge is not
986
+ * proportional to weight, so folding it into `perPageView` would make the
987
+ * gate read a page nobody serves.
988
+ *
989
+ * ## The INCLUDED bands carry it too
990
+ *
991
+ * A view inside a plan's band makes the same requests as one past it, and
992
+ * once the platform is past the allowance the CDN bills them either way, so
993
+ * the `bandwidthGb` bands are sized with this term counted: $0.190 per
994
+ * included GB on top of $0.367 of weight. `tier-margin-floor.spec.ts`
995
+ * multiplies it in and pins every tier at 100% of every band.
996
+ *
997
+ * Lives HERE, beside the markup, for the reason the markup does: the
998
+ * `/pricing` generator publishes the cost column from it and cannot import
999
+ * anything under `apps/console`.
1000
+ */
1001
+ export declare const PAGE_VIEW_CDN_REQUEST_COST_USD = 0.00018374681;
933
1002
  /**
934
1003
  * Monthly unit costs for the meters the rollup already records (AGL-1134).
935
1004
  *
@@ -953,6 +1022,23 @@ export declare const METERED_MARKUP = 1.3;
953
1022
  * infrastructure pass-through, and the customer is charged those figures
954
1023
  * times `METERED_MARKUP`. They therefore appear in `METERED_UNIT_RATES_USD`
955
1024
  * as well, with identical values, and must be changed in both places at once.
1025
+ * A page view billed past its band also carries
1026
+ * {@link PAGE_VIEW_CDN_REQUEST_COST_USD}, which neither table holds: it is
1027
+ * the per-request CDN charge past the hosting plan's allowance, and this
1028
+ * table's `perPageView` is the weight-proportional half of what a band is
1029
+ * sized against — the request term is the other.
1030
+ *
1031
+ * ## Every Vercel-billed input is priced at Vercel's dearest region
1032
+ *
1033
+ * The CDN and functions bill by region, from $0.15 to $0.35 per GB of
1034
+ * transfer, $2.00 to $3.20 per million requests, and $0.128 to $0.221 per
1035
+ * hour of active CPU (memory $0.0106 to $0.0183 per GB-hour), and a plan
1036
+ * cannot choose where its visitors are. So the Vercel share of every rate
1037
+ * here is priced at the dearest region (AGL-3444): the transfer inside
1038
+ * `perPageView`, the function invocation inside `perFormSubmission`, and the
1039
+ * compute inside `perRun`. The GCP shares — object and Firestore storage, and
1040
+ * the Firestore reads and writes behind a render, a submission or a run —
1041
+ * are priced as they were.
956
1042
  *
957
1043
  * Everything else here is a cost-model input ONLY. `dataStoragePerGbMonth`,
958
1044
  * `perApiRequest`, `perContactMonth` and `perEmailSend` price what an org
@@ -962,9 +1048,11 @@ export declare const METERED_MARKUP = 1.3;
962
1048
  * "at cost + 30%" claim, which is true of exactly three meters.
963
1049
  *
964
1050
  * The first three were corrected 2026-08-09 (AGL-1280) — storage $0.03 →
965
- * $0.026 and form submissions $0.0005 → $0.00005 — and `perPageView` was
966
- * re-pegged 2026-09-09 (AGL-2711), from $0.0001 to $0.00016153846. All three
967
- * MUST be changed here and in `METERED_UNIT_RATES_USD` together. See that
1051
+ * $0.026 and form submissions $0.0005 → $0.00005 — `perPageView` was
1052
+ * re-pegged 2026-09-09 (AGL-2711), from $0.0001 to $0.00016153846, and the
1053
+ * last two were re-priced at Vercel's dearest region on 2026-10-01
1054
+ * (AGL-3444): page views $0.00035471473, form submissions $0.000053846154.
1055
+ * All three MUST be changed here and in `METERED_UNIT_RATES_USD` together. See that
968
1056
  * table for each figure's basis; it is the one a customer is billed against,
969
1057
  * so it is the one that carries the working.
970
1058
  *
@@ -985,8 +1073,8 @@ export declare const ORG_COGS_UNIT_RATES_USD: {
985
1073
  * ⛔ HALF OF A PAIR — see ESTIMATED_PAGE_TRANSFER_BYTES, which states the
986
1074
  * same page in bytes as this states it in dollars. Both are calibrated
987
1075
  * against a 1012.8 KB page and neither may move alone: their quotient is
988
- * the cost of a gigabyte, and that is what every bandwidthGb band on the
989
- * ladder was sized against.
1076
+ * the cost of a gigabyte's weight, and that — with the request term — is
1077
+ * what every bandwidthGb band on the ladder is sized against.
990
1078
  */
991
1079
  perPageView: number;
992
1080
  perFormSubmission: number;
@@ -1010,7 +1098,7 @@ export declare const ORG_COGS_UNIT_RATES_USD: {
1010
1098
  */
1011
1099
  perEmailSend: number;
1012
1100
  /**
1013
- * One workflow or action run — $12 per million.
1101
+ * One workflow or action run — $13 per million.
1014
1102
  *
1015
1103
  * Derived from the run paths at list prices (2026-09-07), because nothing
1016
1104
  * measurable exists yet: runs execute inside the Vercel request that fired
@@ -1029,9 +1117,11 @@ export declare const ORG_COGS_UNIT_RATES_USD: {
1029
1117
  * - writes: the activity row and the counter increment — 2, at $0.18 per
1030
1118
  * 100,000 = $0.0000036
1031
1119
  * - compute: a few milliseconds of active CPU and memory on Fluid compute
1032
- * for the expression evaluation, about $0.000001
1120
+ * for the expression evaluation, about $0.000001 in the cheapest
1121
+ * region and $0.0000017 in the dearest ($0.221 against $0.128 an
1122
+ * hour of active CPU), which is where it is priced
1033
1123
  *
1034
- * $0.0000118, carried as $0.000012. It scales with the catalog a site holds
1124
+ * $0.0000125, carried as $0.000013. It scales with the catalog a site holds
1035
1125
  * — every `limit(100)` read above is a query that costs one read per
1036
1126
  * document returned — and a step that writes a dataset record or calls a
1037
1127
  * webhook adds to it, so this is the typical figure, not the ceiling.
@@ -1583,10 +1673,10 @@ export declare function checkHostRegisterQuota(org: Partial<AglynOrgBilling> | n
1583
1673
  */
1584
1674
  export declare function resolveTransactionFeePct(org: Partial<AglynOrgBilling> | null | undefined, productType: 'physical' | 'digital' | 'service'): number;
1585
1675
  /**
1586
- * Stripe's processing cost on ONE storefront destination charge, in cents
1587
- * (AGL-2152) — the dearest enabled method's percentage plus the fixed 30¢,
1588
- * rounded UP on the percentage so the answer is never a cent short of what
1589
- * Stripe actually debits.
1676
+ * Stripe's processing cost on ONE destination-charge sale, in cents
1677
+ * (AGL-2152) — a storefront order, a booking deposit — the dearest enabled
1678
+ * method's percentage plus the fixed 30¢, rounded UP on the percentage so the
1679
+ * answer is never a cent short of what Stripe actually debits.
1590
1680
  *
1591
1681
  * WHO PAYS THIS. Every storefront charge is a DESTINATION charge:
1592
1682
  * `payment_intent_data[transfer_data][destination]` names the merchant's
@@ -1612,18 +1702,18 @@ export declare function resolveTransactionFeePct(org: Partial<AglynOrgBilling> |
1612
1702
  * decides the set — and per AGL-2343 that configuration has `klarna` and
1613
1703
  * `affirm` on beside the card family. Pricing this at the card rate would be
1614
1704
  * wrong exactly on the orders where it cost the most, which is the same
1615
- * reasoning `marketplaceBreakEvenUsd` already applies to the listing floor;
1616
- * these are deliberately the SAME two constants so the two cannot drift.
1705
+ * reasoning the marketplace listing floor applies; both are defined from the
1706
+ * SAME processing constants so the two cannot drift.
1617
1707
  *
1618
1708
  * THE ONE-LINE LEVER. On a card-family order this over-recovers by the spread
1619
1709
  * between the two rates. Pinning `payment_method_types` on the storefront
1620
1710
  * sessions to the card family would make 2.9% the true binding rate, and
1621
- * `STOREFRONT_PROCESSING_PERCENT` below is then the single identifier to
1711
+ * `SALE_PROCESSING_PERCENT` below is then the single identifier to
1622
1712
  * repoint. That is a product decision about which payment methods a storefront
1623
1713
  * offers, not this one; it is recorded on AGL-2152 and in the Pricing Decision
1624
1714
  * Log so it can be taken deliberately.
1625
1715
  */
1626
- export declare function storefrontProcessingCostCents(chargeCents: number): number;
1716
+ export declare function saleProcessingCostCents(chargeCents: number): number;
1627
1717
  /**
1628
1718
  * The Stripe Connect `application_fee_amount` for ONE storefront sale
1629
1719
  * (AGL-2152) — the platform's advertised take PLUS Stripe's processing cost,
@@ -1656,7 +1746,7 @@ export declare function resolveTransactionFeeCents(org: Partial<AglynOrgBilling>
1656
1746
  *
1657
1747
  * A Stripe Subscription accepts no `application_fee_amount` — only
1658
1748
  * `application_fee_percent`, a rate with at most two decimal places — so the
1659
- * fixed 30¢ that `storefrontProcessingCostCents` adds in cents has to be
1749
+ * fixed 30¢ that `saleProcessingCostCents` adds in cents has to be
1660
1750
  * folded into the rate. `(rate × amount + fixed) ÷ amount` is, with the
1661
1751
  * amount cancelled,
1662
1752
  *
@@ -1673,10 +1763,10 @@ export declare function resolveTransactionFeeCents(org: Partial<AglynOrgBilling>
1673
1763
  * decimal outright, so the only honest direction is over. Integers, because
1674
1764
  * `0.09 * 100` is not `9` in floating point and a percent one ulp above a
1675
1765
  * whole hundredth would round up to the next one. The same two constants as
1676
- * the one-time path, so repointing `STOREFRONT_PROCESSING_PERCENT` moves
1766
+ * the one-time path, so repointing `SALE_PROCESSING_PERCENT` moves
1677
1767
  * both surfaces together. Zero for a charge that is not a charge.
1678
1768
  */
1679
- export declare function storefrontProcessingPassThroughPercent(amountCents: number): number;
1769
+ export declare function saleProcessingPassThroughPercent(amountCents: number): number;
1680
1770
  /**
1681
1771
  * The `application_fee_percent` for ONE storefront subscription (AGL-2655):
1682
1772
  * the plan's advertised take PLUS Stripe's processing cost as a percent —
@@ -1723,163 +1813,45 @@ export declare function resolveMarketplaceFeePct(org: Partial<AglynOrgBilling> |
1723
1813
  */
1724
1814
  export declare function bindingMarketplaceFeePct(): number;
1725
1815
  /**
1726
- * What one marketplace sale costs the PLATFORM to process (AGL-2343).
1727
- *
1728
- * NONE OF THESE IS AN AGLYN PRICE. They are Stripe's published US rates and
1729
- * the Texas rate the platform remits, and they exist only as inputs to a
1730
- * figure shown to a publisher while they type. Nothing is billed from them —
1731
- * the charged amounts are `resolveMarketplaceFeePct` and Stripe's own
1732
- * invoicing — so changing one changes a sentence, never a bill.
1816
+ * What one destination-charge sale costs the PLATFORM to process (AGL-2343):
1817
+ * a storefront order, a booking deposit, a marketplace listing. On a
1818
+ * destination charge Stripe debits its fee from the PLATFORM's balance, so
1819
+ * every surface that sells through the platform's account prices its take
1820
+ * against these.
1733
1821
  *
1734
- * WHY THE PLATFORM PAYS THE PROCESSING FEE AT ALL. Marketplace checkout is a
1735
- * DESTINATION charge with a fixed `transfer_data[amount]` and deliberately no
1736
- * `application_fee_amount`, so that the sales tax stays with the platform that
1737
- * owes it (AGL-1544). On a destination charge Stripe debits its fee from the
1738
- * PLATFORM's balance, and it is charged on `amount_total` — the listing price
1739
- * plus the tax added on top of it.
1740
- *
1741
- * So a $1 listing at a 20% take rate is a loss: the buyer pays $1.08, the
1742
- * seller is transferred $0.80, $0.08 is owed to the state, Aglyn keeps $0.20
1743
- * and pays Stripe about $0.33. Net −$0.13.
1822
+ * NONE OF THESE IS AN AGLYN PRICE. They are Stripe's published US rates, and
1823
+ * they exist only as inputs to a platform take and to figures a seller reads;
1824
+ * changing one never changes a price list.
1744
1825
  *
1745
1826
  * THE BNPL RATE IS THE ONE THAT BINDS, and it is not hypothetical: the live
1746
1827
  * default payment method configuration has `klarna` and `affirm` enabled
1747
- * alongside `card`, `cashapp`, `link`, `amazon_pay` and `apple_pay`, and the
1748
- * marketplace session pins no `payment_method_types`, so a buyer may pay by
1749
- * either. Break-even is computed from the dearest enabled method, because a
1750
- * figure computed from the cheapest would be wrong exactly when it mattered.
1751
- * IF BNPL IS EVER TURNED OFF FOR MARKETPLACE SESSIONS, this constant is what
1752
- * has to move with it.
1753
- */
1754
- export declare const MARKETPLACE_PROCESSING_PERCENT_CARD = 2.9;
1828
+ * alongside `card`, `cashapp`, `link`, `amazon_pay` and `apple_pay`, and no
1829
+ * checkout session pins `payment_method_types`, so a buyer may pay by either.
1830
+ * A cost computed from the cheapest method would be wrong exactly when it
1831
+ * mattered.
1832
+ */
1833
+ export declare const CARD_PROCESSING_PERCENT = 2.9;
1755
1834
  /** Klarna/Affirm, roughly. See the note above — this is the binding one. */
1756
- export declare const MARKETPLACE_PROCESSING_PERCENT_BNPL = 6;
1835
+ export declare const BNPL_PROCESSING_PERCENT = 6;
1757
1836
  /** Stripe's per-transaction fixed component, in cents. */
1758
- export declare const MARKETPLACE_PROCESSING_FIXED_CENTS = 30;
1759
- /**
1760
- * The tax rate the break-even figure assumes. Tax is added ON TOP of the
1761
- * listing price and enlarges the base Stripe charges its percentage against,
1762
- * so it makes the platform's cost slightly worse; the real rate is whatever
1763
- * `automatic_tax` computes for the buyer's address, and this is the
1764
- * platform's own Texas rate as a representative figure.
1765
- */
1766
- export declare const MARKETPLACE_ASSUMED_TAX_PERCENT = 8.25;
1767
- /**
1768
- * The processing rate a STOREFRONT destination charge is priced against
1769
- * (AGL-2152), and the one identifier to repoint if the storefront's payment
1770
- * method set changes.
1771
- *
1772
- * Deliberately its OWN name rather than a direct use of the marketplace
1773
- * constants, while being defined as one of them: the two surfaces share
1774
- * Stripe's published rates and today share the platform's payment method
1775
- * configuration, but they are separate product decisions. A future choice to
1776
- * pin `payment_method_types` on storefront sessions to the card family — and
1777
- * so to recover at `MARKETPLACE_PROCESSING_PERCENT_CARD` — must not silently
1778
- * lower the marketplace listing floor, which is derived from the same figure
1779
- * for a different flow.
1780
- */
1781
- export declare const STOREFRONT_PROCESSING_PERCENT = 6;
1837
+ export declare const PROCESSING_FIXED_CENTS = 30;
1838
+ /**
1839
+ * The processing rate a storefront or booking destination charge is priced
1840
+ * against (AGL-2152), and the one identifier to repoint if those sessions'
1841
+ * payment method set changes.
1842
+ *
1843
+ * Deliberately its OWN name rather than a direct use of the binding rate,
1844
+ * while being defined as it: every seller shares Stripe's published rates and
1845
+ * today shares the platform's payment method configuration, but each surface
1846
+ * is a separate product decision. A future choice to pin
1847
+ * `payment_method_types` on storefront sessions to the card family — and so
1848
+ * to recover at `CARD_PROCESSING_PERCENT` — must not silently lower the
1849
+ * marketplace listing floor, which is derived from the binding rate for a
1850
+ * different flow.
1851
+ */
1852
+ export declare const SALE_PROCESSING_PERCENT = 6;
1782
1853
  /** Stripe's per-transaction fixed component, in cents. Not rate-dependent. */
1783
- export declare const STOREFRONT_PROCESSING_FIXED_CENTS = 30;
1784
- /** Where the money goes on one sale of a paid listing (AGL-2343). */
1785
- export interface MarketplaceSaleEconomics {
1786
- /** The listing price. */
1787
- priceCents: number;
1788
- /** Added on top, and owed to the state. */
1789
- taxCents: number;
1790
- /** What the buyer is charged. */
1791
- buyerPaysCents: number;
1792
- /** `transfer_data[amount]` — the seller's share of the pre-tax price. */
1793
- sellerReceivesCents: number;
1794
- /** The platform's take. */
1795
- platformFeeCents: number;
1796
- /** Stripe's fee, debited from the platform on a destination charge. */
1797
- processingCents: number;
1798
- /** `platformFeeCents - processingCents`. Negative is a loss on the sale. */
1799
- platformNetCents: number;
1800
- }
1801
- /**
1802
- * The funds flow for one sale, mirroring what `checkout.ts` actually builds
1803
- * (AGL-2343): tax exclusive and on top, a fixed transfer of the seller's share
1804
- * of the PRE-tax price, and Stripe's fee charged on the buyer's total.
1805
- */
1806
- export declare function marketplaceSaleEconomics(priceUsd: number, feePercent: number, processingPercent?: number): MarketplaceSaleEconomics;
1807
- /**
1808
- * The cheapest WHOLE-DOLLAR price at which the platform does not lose money on
1809
- * a sale (AGL-2343).
1810
- *
1811
- * Whole dollars because every publish route rounds `priceUsd` to one, so a
1812
- * fractional break-even is not a price anyone can actually set. Searched
1813
- * rather than solved algebraically so that it can never disagree with
1814
- * `marketplaceSaleEconomics` — the rounding in there is what decides the
1815
- * answer at these amounts, and a closed form would drift from it silently.
1816
- *
1817
- * THIS IS THE ENFORCED FLOOR: `marketplaceMinPriceUsd` returns this figure
1818
- * and every publish door refuses a paid listing under it. Recorded in the Pricing
1819
- * Decision Log and on AGL-2343.
1820
- */
1821
- export declare function marketplaceBreakEvenUsd(feePercent?: number, processingPercent?: number): number;
1822
- /**
1823
- * THE MINIMUM PRICE a paid marketplace listing may carry (AGL-2343).
1824
- *
1825
- * The floor is not a chosen round number — it is the break-even price itself,
1826
- * the
1827
- * cheapest whole dollar at which `marketplaceSaleEconomics` stops returning a
1828
- * negative platform net, computed at the take rate that breaks even LATEST and
1829
- * the dearest payment method the live configuration enables. Today that is $3.
1830
- *
1831
- * DERIVED, NEVER RESTATED. A second hand-written copy of this number in a
1832
- * publish route or a form is the artifact that decays into a route refusing a
1833
- * price a form invited, so both the server-side validator
1834
- * (`MARKETPLACE_MIN_PRICE_USD` in the marketplace model) and every price field
1835
- * read this. If the payment method set changes, or the plan table's lowest
1836
- * take rate moves, the floor moves with them on the next call.
1837
- *
1838
- * ZERO IS NOT BELOW THE FLOOR. A free listing takes no payment at all, so it
1839
- * costs nothing to process; the floor is a minimum on PAID listings only.
1840
- */
1841
- export declare function marketplaceMinPriceUsd(): number;
1842
- /**
1843
- * Whether a price is a PAID price that the floor refuses (AGL-2343) — the one
1844
- * predicate a form uses to mark its price field in error and hold its publish
1845
- * button, so that the button and the server agree about what is publishable.
1846
- *
1847
- * Rounds first because every publish route does, and a form's value is a
1848
- * string mid-type: `'2.6'` is stored as $3 and must read as allowed here, or
1849
- * the button would refuse a price the route accepts.
1850
- */
1851
- export declare function isBelowMarketplacePriceFloor(priceUsd: unknown): boolean;
1852
- /**
1853
- * The sentence a publish form shows under its price field when the price is
1854
- * below the floor (AGL-2343), or `undefined` when there is nothing to say.
1855
- *
1856
- * NOT ADVISORY ANY MORE. The same figure is enforced by every publish route
1857
- * through `publishPreconditionRefusal`, so this text has to read as a
1858
- * requirement rather than a warning — a publisher who is told "consider
1859
- * raising it" and then refused has been lied to by the form. It still explains
1860
- * WHY, because a bare minimum with no arithmetic behind it reads as an
1861
- * arbitrary tax on cheap listings.
1862
- *
1863
- * Shared by every publish form rather than written into each, because the
1864
- * figure has to be the same one in all of them and the wording is the only
1865
- * place a publisher ever sees it.
1866
- *
1867
- * Quoted at the take rate that breaks even LATEST, so the sentence holds for a
1868
- * free-plan publisher too.
1869
- */
1870
- export declare function marketplacePriceCostNote(priceUsd: unknown): string | undefined;
1871
- /**
1872
- * The standing helper sentence a price field shows when there is nothing wrong
1873
- * (AGL-2343): the minimum stated up front, so a publisher meets it while
1874
- * typing instead of discovering it as a refusal.
1875
- *
1876
- * A capability that is not surfaced in the console does not count as shipped,
1877
- * and that applies to a REFUSAL as much as to a feature: a floor only a route
1878
- * knows about is a trap.
1879
- *
1880
- * @param suffix whatever else that particular form needs to say, appended.
1881
- */
1882
- export declare function marketplacePriceFloorHint(suffix?: string): string;
1854
+ export declare const SALE_PROCESSING_FIXED_CENTS = 30;
1883
1855
  /**
1884
1856
  * The cheapest plan whose BASE features include `feature`, in ladder order —
1885
1857
  * the answer to "which plan do I need for this?", which is the one thing an
@@ -1938,6 +1910,15 @@ export { PLATFORM_BRANDING_PROFILE } from './platform-brand';
1938
1910
  * entitlement the stored profile is ignored entirely and the full Aglyn
1939
1911
  * brand is returned — so an org that white-labeled and then downgraded
1940
1912
  * reverts cleanly.
1913
+ *
1914
+ * An org WITH the entitlement that has stored no brand value at all gets the
1915
+ * full Aglyn brand too (AGL-3440). The entitlement is the right to a brand,
1916
+ * not a brand: until the org sets one, every name it shows is the platform's
1917
+ * anyway, so the white-label profile's blanks — no logo, no support link, no
1918
+ * home — conceal nothing and only strip the platform's own header and footer
1919
+ * from mail whose every line already names the platform. Every Enterprise
1920
+ * org carries the entitlement, Aglyn's own included. One field set, and the
1921
+ * rules below apply.
1941
1922
  */
1942
1923
  export declare function resolveBrandingProfile(org: Partial<AglynOrgBilling> | null | undefined): ResolvedBrandingProfile;
1943
1924
  /**
@@ -2450,7 +2431,9 @@ export declare function checkFormSubmissionAbuseCeiling(org: Partial<AglynOrgBil
2450
2431
  * view costs. They are one physical measurement written in two units, and
2451
2432
  * what every `bandwidthGb` band is actually sized against is neither of them
2452
2433
  * alone but their quotient — `(1 GB ÷ this) × perPageView`, the cost of a
2453
- * gigabyte. That quotient is stable even while the page's weight is not,
2434
+ * gigabyte's WEIGHT, to which the band sizing adds the CDN requests the same
2435
+ * views make ({@link PAGE_VIEW_CDN_REQUEST_COST_USD}). That quotient is
2436
+ * stable even while the page's weight is not,
2454
2437
  * which is precisely why moving one half re-prices every band on the ladder
2455
2438
  * without touching a band: a heavier page costs more per view and buys fewer
2456
2439
  * views per gigabyte, and the two cancel.
@@ -2498,11 +2481,13 @@ export declare function bandwidthGbFromPageViews(pageViews: number): number;
2498
2481
  * It is a CAP, not a price, and it is lower than {@link
2499
2482
  * FORM_ABUSE_CEILING_MULTIPLE} because bandwidth is the largest cost line the
2500
2483
  * platform carries and the one a stranger can spend on the customer's behalf.
2501
- * Past the band every 1,000 views bills $0.21 against about $0.16 of real
2502
- * cost, so the tail is no longer a loss — but a scraper, a hotlinked asset or
2503
- * a botnet still bills the account holder for traffic they did not ask for,
2504
- * and the ceiling is what bounds that before staff look at it. At 10× the
2505
- * band that tail was open-ended on Agency; at 3× it is bounded.
2484
+ * Past the band every 1,000 views bills $0.70 against at most $0.54 of real
2485
+ * cost — the dearest region's — once the CDN's request allowance is spent
2486
+ * ({@link PAGE_VIEW_CDN_REQUEST_COST_USD}), so the tail is not a loss — but a
2487
+ * scraper, a hotlinked asset or a botnet still bills the account holder for
2488
+ * traffic they did not ask for, and the ceiling is what bounds that before
2489
+ * staff look at it. At 10× the band that tail was open-ended on Agency; at 3×
2490
+ * it is bounded.
2506
2491
  */
2507
2492
  export declare const BANDWIDTH_ABUSE_CEILING_MULTIPLE = 3;
2508
2493
  /**
@@ -2513,9 +2498,10 @@ export declare const BANDWIDTH_ABUSE_CEILING_MULTIPLE = 3;
2513
2498
  * Free includes 2 GB ≈ 2,071 views; 3× would be ~6,212, which a genuinely
2514
2499
  * successful hobby site (a post that lands on Hacker News) reaches in an
2515
2500
  * afternoon and would be a miserable first experience of the platform.
2516
- * 100,000 views/month ≈ 96.6 GB ≈ **$16 of real COGS** at
2517
- * `METERED_UNIT_RATES_USD.perPageView` — well above the free band, and an
2518
- * order of magnitude below the $162 a million views costs. It is the number
2501
+ * 100,000 views/month ≈ 96.6 GB ≈ **$54 of real COGS** at the dearest
2502
+ * region (`METERED_UNIT_RATES_USD.perPageView` plus
2503
+ * `PAGE_VIEW_CDN_REQUEST_COST_USD`) — well above the free band, and an order
2504
+ * of magnitude below the $538 a million views costs. It is the number
2519
2505
  * that makes "free stays free" true without making it stingy.
2520
2506
  */
2521
2507
  export declare const BANDWIDTH_ABUSE_CEILING_FLOOR = 100000;