From 8995b7656839a94cd76531c16d08bc0e9a19d5cf Mon Sep 17 00:00:00 2001 From: Richie McIlroy <33632126+richiemcilroy@users.noreply.github.com> Date: Fri, 13 Nov 2026 06:18:49 -0500 Subject: [PATCH 1/2] perf(web): load Infra auto top-up only when a transcript charge needs it --- apps/web/lib/developer-transcript-billing.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/web/lib/developer-transcript-billing.ts b/apps/web/lib/developer-transcript-billing.ts index 86e223a957..2691384db2 100644 --- a/apps/web/lib/developer-transcript-billing.ts +++ b/apps/web/lib/developer-transcript-billing.ts @@ -14,13 +14,18 @@ import { TRANSCRIPT_MIN_START_BALANCE_MICRO_CREDITS, type TranscriptErrorCode, } from "@/lib/developer-transcripts"; -import { scheduleAutoTopUp } from "@/lib/infra-auto-top-up"; import { availableBalance, heldTranscriptMicroCredits, } from "@/lib/infra-balance"; +import type { AutoTopUpTarget } from "@/lib/infra-auto-top-up"; import { accountStanding, readStandingAccount } from "@/lib/infra-standing"; +// Loaded on first use: the auto top-up module pulls in Stripe and the email +// templates, and this file ships in the step bundle every workflow loads. +const scheduleAutoTopUp = async (target: AutoTopUpTarget) => + (await import("@/lib/infra-auto-top-up")).scheduleAutoTopUp(target); + export const INSUFFICIENT_CREDITS_MESSAGE = "The credit balance could not cover this transcript. Nothing was charged."; From 2b984c179bc2f8a7d092a8d3260639fc8f4ef1a1 Mon Sep 17 00:00:00 2001 From: Richie McIlroy <33632126+richiemcilroy@users.noreply.github.com> Date: Fri, 13 Nov 2026 06:26:15 -0500 Subject: [PATCH 2/2] style(web): sort the auto top-up type import --- apps/web/lib/developer-transcript-billing.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/lib/developer-transcript-billing.ts b/apps/web/lib/developer-transcript-billing.ts index 2691384db2..0e803c5f92 100644 --- a/apps/web/lib/developer-transcript-billing.ts +++ b/apps/web/lib/developer-transcript-billing.ts @@ -14,11 +14,11 @@ import { TRANSCRIPT_MIN_START_BALANCE_MICRO_CREDITS, type TranscriptErrorCode, } from "@/lib/developer-transcripts"; +import type { AutoTopUpTarget } from "@/lib/infra-auto-top-up"; import { availableBalance, heldTranscriptMicroCredits, } from "@/lib/infra-balance"; -import type { AutoTopUpTarget } from "@/lib/infra-auto-top-up"; import { accountStanding, readStandingAccount } from "@/lib/infra-standing"; // Loaded on first use: the auto top-up module pulls in Stripe and the email