Skip to content

feat: billing workspace templates for platform and tenant billing - #44

Merged
yyyyaaa merged 5 commits into
mainfrom
phat/billing-workspace
Sep 25, 2026
Merged

yyyyaaa merged 5 commits into
mainfrom
phat/billing-workspace

Conversation

@yyyyaaa

@yyyyaaa yyyyaaa commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Replaces the ten billing-* blocks and their showcase with two workspace templates built on a shared kit:
    • billing-account: the customer workspace (overview, usage by credit pool, plans with a change preview, credits and gift codes, invoices, activity).
    • billing-console: the operator workspace for platform or tenant billing (overview, catalog with entitlement matrix, meters, packs and gift codes, customers, payment provider with readiness and the gated billing switch, platform database standing).
    • billing-kit: provider-neutral contracts, formatters, the built-in Stripe descriptor, and every card, table and dialog the templates use.
  • Extracts workspace-kit (shell, sidebar rail and drawer, view frame, primitives, ViewTransition wrapper) from agents-builder; agents-builder now uses it.
  • Gift codes: customers redeem a code (dialog, inline field, ?code= prefill, typed refusals, history); operators create codes, bulk-create single-use batches with CSV export, pause them, and see redemptions. Codes credit billing meters (e.g. compute) or limits (e.g. seats).
  • Payment providers are descriptors passed by the host; Stripe ships built in, one provider is active at a time and can be switched.
  • Rebuilds the billing feature pack and Console Kit module on billing-account.
  • Docs site: one Billing section (/blocks/billing) with tabs for Billing Account, Billing Console, and the feature pack. Storybook covers both templates and every kit component group.

BREAKING CHANGE: the billing-* registry blocks are removed; install billing-account, billing-console, or billing-kit instead.

Backend notes (constructive-db, not blocking)

  • One payment provider per database, and the billing functions are Stripe-only.
  • Credit codes exist only in the limits module (per user, limit credits); compute or meter credit codes are still future work.
  • The redemption trigger uses RAISE WARNING for not found, expired and max redemptions, does not check is_active, and users cannot resolve a code to its id; a redeem_credit_code(code) function is needed.
  • Balances, credits, invoices and the ledger have no public read contract, so the Console Kit module offers the overview and plans views only.

Test plan

  • pnpm check (typecheck, lint, registry build and parity, all tests)
  • Flow tests for plan change and scheduling, refusals, views, gift code redemption, catalog persistence, code creation and bulk batches; server rendering of every view
  • Clean installs: billing-account, billing-console, agents-builder, console-module-billing, preset-full
  • Browser checks in Storybook and the docs site, light and dark, desktop and phone
  • CI delivery: pnpm pack:check, registry smoke installs, pnpm build:pages, Pages artifact
  • pnpm build:storybook

Move the shell, sidebar navigation, view frame, primitives and the
ViewTransition wrapper into workspace-kit so the billing templates and
agents-builder share one workspace shell.
billing-kit holds provider-neutral contracts, formatters, the Stripe
descriptor and the shared billing components, including gift codes.
billing-account is the customer workspace and billing-console the
operator workspace for platform and tenant billing.
Remove the ten billing blocks and their showcase, rebuild the billing
feature pack and Console Kit module on billing-account, and document
both templates under one Billing section of the docs site.

BREAKING CHANGE: the billing-* registry blocks are removed; install
billing-account, billing-console or billing-kit instead.
@tenki-reviewer

tenki-reviewer Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Review complete. No issues found — approved ✅.


This is a documentation-only change that updates how agents select billing surfaces: the routing table, eval expectations, ownership reference, and workspace guidance now point to billing-account for customer billing and billing-console for billing operations. It also corrects the view-transition.tsx path to workspace-kit, documents the shared workspace-kit templates, and adds the by-file import rule for sibling registry trees.

Files Change
.agents/skills/constructive-blocks/SKILL.md Replaces the single billing row with rows for billing-account, billing-console, promo/credit codes, and billing-kit leaves.
.agents/skills/constructive-blocks/evals/evals.json Updates the billing eval to inspect billing-account and choose it or focused billing-kit leaves.
.agents/skills/constructive-blocks/references/surfaces-and-ownership.md Splits billing into customer-facing (billing-account) and operator (billing-console) ownership rows and annotates the billing doc URLs.
AGENTS.md Fixes the view-transition path, adds billing-kit to the @source example, and documents shared workspace-kit templates plus the by-file import and registryDependencies rules.

Reviewed commit: 61fde9c

@yyyyaaa
yyyyaaa merged commit 4507fc1 into main Sep 25, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant