From 26260fda021568d1e8b8c11890352addc7b23420 Mon Sep 17 00:00:00 2001 From: Pierre Brisorgueil Date: Thu, 18 Jun 2026 15:32:56 +0200 Subject: [PATCH 1/2] feat(billing): add demo equivalences config for the nav compute gauge Ships a neutral devkit demo billing.equivalences block so the Vue nav compute-gauge renders its capacity-chip estimate out of the box and the serverConfig.billing.equivalences contract is documented in config. The auth config endpoint already serves this key verbatim; downstream projects override with their own kinds/labels/unit costs (or omit it -> gauge shows raw units). Supports pierreb-devkit/Vue#4349. --- .../config/billing.development.config.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/modules/billing/config/billing.development.config.js b/modules/billing/config/billing.development.config.js index 6047321c2..106f7c2e2 100644 --- a/modules/billing/config/billing.development.config.js +++ b/modules/billing/config/billing.development.config.js @@ -38,6 +38,23 @@ const config = { * Used by middleware error responses (METER_EXHAUSTED, QUOTA_EXCEEDED). */ upgradeUrl: '/billing/plans', + /** + * Display-only capacity equivalences for the nav compute gauge + * (Vue billing.navComputeGauge.component). Each entry maps an operation "kind" + * to its unit cost; the gauge renders `floor(remaining / unitCost)` as a + * human-readable "~N easy / ~M heavy operations remaining" estimate. Served + * verbatim to the client via the auth config (serverConfig.billing.equivalences). + * + * DEVKIT DEMO VALUES — illustrative only. Downstream projects override with + * their own kinds / labels / unit costs (or omit the block → the gauge shows + * raw units only). null / absent / [] → no-op. + * + * Entry shape: { kind: 'easy' | 'hard', unitCost: number > 0, label: string } + */ + equivalences: [ + { kind: 'easy', unitCost: 200, label: 'easy operations' }, + { kind: 'hard', unitCost: 2000, label: 'heavy operations' }, + ], /** * When true, mounts attachUsageContext on protected /api/billing/* routes. * Emits X-Meter-Remaining on billing responses. Off by default to avoid From 308c4dbc4104e6858767e0027e54ddb8c98d9011 Mon Sep 17 00:00:00 2001 From: Pierre Brisorgueil Date: Thu, 18 Jun 2026 16:46:50 +0200 Subject: [PATCH 2/2] docs(billing): clarify demo equivalences is a downstream-override default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Correct the comment: the block ships as the billing base config, so omitting it downstream inherits the demo values — disable explicitly with [] / null. Drop the '~' from the example to match the exact integer counts the gauge renders. --- modules/billing/config/billing.development.config.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/billing/config/billing.development.config.js b/modules/billing/config/billing.development.config.js index 106f7c2e2..234cb3ddd 100644 --- a/modules/billing/config/billing.development.config.js +++ b/modules/billing/config/billing.development.config.js @@ -42,12 +42,15 @@ const config = { * Display-only capacity equivalences for the nav compute gauge * (Vue billing.navComputeGauge.component). Each entry maps an operation "kind" * to its unit cost; the gauge renders `floor(remaining / unitCost)` as a - * human-readable "~N easy / ~M heavy operations remaining" estimate. Served + * human-readable "N easy / M heavy operations remaining" estimate. Served * verbatim to the client via the auth config (serverConfig.billing.equivalences). + * Only surfaces while `meterMode` is on (the gauge is hidden otherwise). * - * DEVKIT DEMO VALUES — illustrative only. Downstream projects override with - * their own kinds / labels / unit costs (or omit the block → the gauge shows - * raw units only). null / absent / [] → no-op. + * DEVKIT DEMO VALUES — illustrative, like the other billing defaults in this file. + * DOWNSTREAM-OVERRIDE: set your own kinds / labels / unit costs, or set + * `equivalences: []` (or `null`) to show raw units only. Because this ships as + * the billing base config, simply omitting the key downstream inherits these + * demo values — disable the chips explicitly with `[]` / `null`. * * Entry shape: { kind: 'easy' | 'hard', unitCost: number > 0, label: string } */