Skip to main content

Module commerce

Module commerce 

Source
Expand description

Sellable-addon commerce model (Track B — generalising the ctxpkg paid artifact to addons).

Context packs are already sellable (price metadata + Stripe checkout + 402 download gating + verified publisher, GL #529/#516). This module generalises the artifact-side model to addons:

  • AddonPricing — optional [pricing] an addon carries (one-time or usage-metered). Absent ⇒ free.
  • paid_listing_gate — the mandatory security gate before money: an addon may only be listed/sold once it clears the P3 capability audit (super::audit::AuditReport::paid_eligible) and is a verified-publisher entry. This is the in-repo half of the plan’s “Security-Gate = Pflicht vor Paid”; the payment execution (Stripe checkout, 402 gating, Connect payouts — GL #532) reuses the existing ctxpkg billing rails, generalised to artifact_type = addon in the billing service.
  • usage_charge_cents — turns the P5 per-addon usage meter into a billable amount for usage-metered pricing.

Pure + deterministic (#498): the same gate result for the same manifest, so the CLI preview, the registry validator and a future publish endpoint agree.

Structs§

AddonPricing
[pricing] — optional commerce metadata for a sellable addon.
PaidGate
Outcome of the paid-listing gate: eligibility + the concrete blockers.

Enums§

PricingModel
How a paid addon is billed.

Functions§

paid_listing_gate
The mandatory security gate before an addon may be listed or sold for money (the plan’s gate before paid; depends on the P3 audit + #516 verified publisher). A free addon (no [pricing], or zero price) is always eligible — the gate only governs paid artifacts.
usage_charge_cents
The billable amount in cents for calls tool calls under usage pricing, prorated from the per-1k rate. 0 for non-usage pricing.