Pay as you go beside the subscriptions, the way OpenRouter charges:
- ./credits: append-only CreditLedger with idempotency keys and an
in-memory ledger; balance, FIFO lots and debt; charge refused with 402
below the app's floor or over a spending key's daily/weekly/monthly
limit; hold then settle or release; top-up quotes with a fee per rail
in integer arithmetic; refund eligibility (window, fee kept, rails that
never refund); expiry of old lots; auto top-up decision with backoff
and a failure cap; credit events applied idempotently; top-ups through
any PaymentProvider (OrangeCat: sats, never refundable).
- ./stripe: stripeCredits — top-up Checkout Session (saves the method
off-session when auto top-up is on), off-session PaymentIntent with an
Idempotency-Key, refunds, and webhook mapping for
checkout.session.completed, payment_intent.succeeded/payment_failed
and charge.refunded. The pass provider ignores top-up sessions.
- ./react: CreditBalance, TopUp, AutoTopUp, CreditActivity; PickerTier
gains optional rates for a pay-as-you-go tier.
No price, fee or threshold is built in; all are the app's config.
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r
Co-authored-by: Claude <noreply@anthropic.com>
* feat(paykit 0.6.0): Stripe subscriptions, intro coupon, portal, plan screens
Owner, 2026-12-03: a monthly subscription that renews until cancelled, a
yearly plan at a discount, and a discount on the first months.
- stripe: stripeBilling — mode=subscription Checkout Sessions with an
inline recurring price, an intro price as a duration=repeating coupon
under a deterministic id (read, created on resource_missing, a racing
resource_already_exists is the same coupon), Billing Portal sessions,
the subscription read back, and the signed webhook reduced to five
events. Reads the current and pre-2025-03-31 API shapes. No payment
method named: Stripe documents TWINT as supporting recurring payments.
The one-time provider ignores subscription checkouts, so one endpoint
carries both. StripeError gains `code`.
- checkout: SubscriptionPlan/Event/Record, applySubscriptionEvent (pure,
safe with repeated and out-of-order events), subscriptionAccessUntil,
subscriptionStanding.
- plans: subscriptionPricing (year per month, saving rounded down).
- react + styles.css: PlanPicker and PlanReview, styled through --pk-*
variables with --sk-* and system light/dark fallbacks. react is an
optional peer dependency.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r
* fix(paykit 0.6.0): cancelSubscription, unpaid periods grant nothing, unbroken tab names
- stripeBilling.cancelSubscription(id): DELETE /v1/subscriptions/{id}, for an
app's own reasons such as a deleted account; a missing one is null.
- applySubscriptionEvent / recordFromSnapshot: a past_due or unpaid
subscription already names the next period's end, which nobody paid for;
only a subscription in good standing or a paid invoice moves access.
- styles.css: no hyphens:auto on the tier switch.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r
---------
Co-authored-by: Claude <noreply@anthropic.com>
The fleet's shared keys name it BRAVE_API_KEY; braveProvider read only
BRAVE_SEARCH_API_KEY, so a box holding the key never searched Brave.
webSearchConfigured(env) replaces apps' own copies of the variable list.
Claude-Session: https://claude.ai/code/session_019MDtmvTCDbJAYNKQpNyKzz
Co-authored-by: Claude <noreply@anthropic.com>
`deletedPath` is where a person lands once their account is deleted, so a
product can say "Your account was deleted" instead of showing the page after
signing out. Without it, deletion leads to `homePath` as before.
The demo gains a `?panel` mode; browser checks cover sign-out, deletion with
`deletedPath` and deletion without it.
Claude-Session: https://claude.ai/code/session_019MDtmsTRGc34xnG6koVuAY
Co-authored-by: Claude <noreply@anthropic.com>
Provider.maxOutputTokens, by model id. Groq's free tier allows some models
1,000 output tokens a minute; asked for 1,500 such a link is refused as too
large and the walk moves on, so it never answers. With a cap it is asked
for what it can give, in complete and completeStream. The caller's
maxTokens stays the ceiling; with none, a capped link sends its cap.
linkMaxTokens(link, requested) is the rule, exported and tested.
Claude-Session: https://claude.ai/code/session_019MDtmsTRGc34xnG6koVuAY
Co-authored-by: Claude <noreply@anthropic.com>
An element built by the page goes stale when an answer arrives without the
page rendering again; Heidi's "From here: Talk" under the last turn depends
on the messages. One test; unit and browser checks pass.
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r
Co-authored-by: Claude <noreply@anthropic.com>
Owner, 2026-12-01, on Heidi: switching between Translate and Talk changed
nothing on screen. ChatThread/ChatApp take renderBefore(message, { index,
messages }); ThreadDivider is the thin rule with a word in it. Style in the
full sheet (the embedded one is at its budget). One render test; all unit and
browser checks pass.
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r
Co-authored-by: Claude <noreply@anthropic.com>
The frame, the five screens in one order (Overview, Inbox, People, Health,
Money) and the contract for prepared work, moved out of heidi's /manage.
- @bitbaum/adminkit: PreparedAction (act is required), prepared(), Trend,
defineBackOffice/screensFor/mayOpen, mayRemove (same answers as
accountkit's, compared in the tests), words in German and English.
- @bitbaum/adminkit/react: BackOfficeFrame, Overview, Inbox, People, Health,
Money, InvitationLanding. Data in as props, the product's own functions as
form actions; no database, mail, auth or server action in the package.
- styles.css: adk-* classes on --adk-* variables. Checked in a browser at
320 and 390px in both languages: nothing past the screen, 44px targets,
one navigation row, one primary button per screen.
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r
Co-authored-by: Claude <noreply@anthropic.com>
ai-kit/choice: chooseChain, readOwnKey, preferFirst, pickableModels,
redactKeys, checkOwnKey: whose model answers a request and whose money
it spends, decided once instead of in each product.
chatkit: ModelSheet `plan` (the product's paid way to a stronger model),
`freeNote`, `ownTitle`; useModelOptions wires chip, sheet, browser store,
key check and free list; ModelNudge under an answer a free model wrote.
Claude-Session: https://claude.ai/code/session_019MDtmvTCDbJAYNKQpNyKzz
Co-authored-by: Claude <noreply@anthropic.com>
The back-office access rules of the fleet contract, moved out of heidi:
@bitbaum/accountkit/auth/managers (createManagers, requireManager),
createManagerTables in /auth/schema, and the /auth/roles subpath.
Every rule is in the statement that makes the change: single-use hashed
invitations that die with their inviter, admin-only changes checked
against the database, the last admin kept under a row lock, one history
row per change, a bootstrap way in that counts only while no admin exists.
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r
Co-authored-by: Claude <noreply@anthropic.com>
* feat(paykit 0.5.0, sitekit 0.9.0): plans with prices and a waitlist, before a product can charge
paykit/plans: Tier (open, waitlist, checkout, contact), formatMoney,
readWaitlistEntry, WaitlistStore and joinWaitlist: what a product
offers, how a price is written, and the whole of a waitlist route.
sitekit: PlanTable and WaitlistForm: plan cards with one action each;
a waitlist action opens a one-field form in the card. A tier goes on
sale by turning that action into a link to the checkout.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvTCDbJAYNKQpNyKzz
* fix(sitekit): the waitlist form's note is an alert only when something went wrong
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvTCDbJAYNKQpNyKzz
---------
Co-authored-by: Claude <noreply@anthropic.com>
- rememberLocale (+ switchLocaleHref, localeCookie, isSafeNextPath): the route
that remembers a reader's language in an app with no language in its URL;
relative 303, checked next, Secure over HTTPS (sbb-fundbuero's lessons)
- alternateLanguages: hreflang alternates for Next metadata
- langkit check --code <dirs> [--fail-unused]: messages no code appears to ask
for; measured on eight apps, hand-traced samples were dead messages
- fix: with nineteen languages the switcher widened a 390px page to 1081px
inside sitekit's masthead; now it scrolls inside itself. Checked in a real
browser at 320/390/1280px
- first public version: private removed, 0.2.0 (0.1.0 was never published)
Claude-Session: https://claude.ai/code/session_019MDtmsTRGc34xnG6koVuAY
Co-authored-by: Claude <noreply@anthropic.com>
Owner, 2026-11-29, on Solon's "ask the law" box in a place's page: the chat
window should be expandable to full screen and work like the other chats.
Every product with a chat in a page would otherwise build its own.
- `expandable` (with fill="parent"): a header button before New chat opens
the same chat over the whole screen and puts it back. Nothing is remounted:
the thread, a running answer and the words in the box stay. Open, it
follows the visual viewport and the page behind does not scroll.
- Escape returns it to the page after the innermost thing (a sheet, a menu
or the chat list takes the key first).
- `onExpandedChange`; labels `expand` and `collapse`; aria-pressed while open.
- `.ck-app-expanded` in the ChatApp section of styles.css (position: fixed,
layer --ck-expanded-z, default 1000).
- demo/app.html?embed=1 and 32 new checks in test/browser-app.mjs at 390px
and 1440px. browser-app: 129 passed. Unit tests: 280 passed. typecheck,
lint and format:check clean.
Claude-Session: https://claude.ai/code/session_019MDtmvTCDbJAYNKQpNyKzz
Co-authored-by: Claude <noreply@anthropic.com>
* langkit: one way to be multilingual across the fleet
A survey of the bitbaum repos (docs/survey-2026-11-29.md) found 22 apps with
more than one language: 14 on next-intl, 8 with their own tables, and around
them 8 private Accept-Language parsers, 4 cookie names and 12 home-made
completeness checks. The decision (docs/decision.md) keeps ICU MessageFormat
on next-intl's engine and puts the repeated parts in one package:
- defineLanguages: the list, names, direction, fallbacks, regional variants
- pickLocale: the reader's choice, the browser, the content, the default
- createMessages: typed ICU messages on use-intl/core, usable in server
components without a provider; de-CH is German respelled, not a file
- langkit check: missing/extra/empty keys, ICU syntax, arguments, plural
forms, ß in Swiss German; for each app's verify
- toIcu: drafts ICU messages from hand-written copy tables
- LanguageSwitcher: plain links, fits sitekit's masthead actions
Proof without touching the app: BiasLens's rewrite-copy.ts (copied at
c3497b7 as a fixture), all 107 entries in en, de, de-CH and fr, says the same
through langkit. Two deliberate differences are asserted as tests.
Not on npm yet: a new package needs the owner's one npm sign-in (README).
Claude-Session: https://claude.ai/code/session_019MDtmsTRGc34xnG6koVuAY
* langkit: private until its first publish
A merged version bump publishes from GitLab, and npm cannot trust a package
that does not exist yet. Marked private so the merge starts no publish that
must fail; publishing 0.1.0 is the owner's one npm sign-in plus removing this
line.
Claude-Session: https://claude.ai/code/session_019MDtmsTRGc34xnG6koVuAY
---------
Co-authored-by: Claude <noreply@anthropic.com>
* test(chatkit): hold the earlier page until the reader stops scrolling
The "earlier messages load above" check failed about one run in four
(kits#3's merge check). Logged runs showed why: loading starts 200px
before the top, the wheel loop sent one more tick while the page was in
flight, and when that tick landed after the page arrived it moved the
reader 300px up from the place the thread had correctly kept (offset 325
every failure, 110 every pass). chatkit's anchoring was right; the test
raced its own input.
The demo now takes ?hold=older: an earlier page waits for
ckMessenger.release(). The test wheels up until the thread asks for it,
waits for its own scrolling to rest, then releases the page. 100 runs
serial plus 4x25 in parallel: 0 failures.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(chatkit): hold the voice answer until "thinking" has been read
The root verify run for this branch failed on a second flaky browser
check: "what was heard is shown while the answer is on its way". The
fixture answered 150ms into "thinking"; the test waited for the phase,
then read the line in a second round trip, and on a busy machine the
line already showed the answer. Same shape as the messenger race.
demo/voice.tsx takes ?hold=answer: the answer waits for
__voice.release(). The loop test reads "thinking" (what was heard, the
microphone closed), then releases, for both of its turns. Under load
(4 in parallel): old 1/20 failed, new 0/52.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
ci-publish.sh read each package.json's old version with `git show
BEFORE:file | node`. For a package that did not exist before the push,
git exits 128, and under pipefail the assignment ended the whole run before
it printed anything: the main push that added datakit (#15) failed in 0.6 s.
Now the missing file reads as no old version, so a new package is a target.
Checked: CI_PUBLISH_DRY=1 with BEFORE=592949d on 14574b7 exited 128 before,
and says 'would publish datakit 0.1.0' after (already on npm, so the real
run skips it).
Claude-Session: https://claude.ai/code/session_019MDtmvTCDbJAYNKQpNyKzz
Co-authored-by: Claude <noreply@anthropic.com>
Gitea pushes main on to gitlab.com/bitbaum/kits after every merge (a push mirror); GitLab CI now runs on that push too and publishes every package whose version it changed (scripts/ci-publish.sh). Tags still publish one package, as release.sh does. A version already on npm is skipped; resource_group keeps a tag and a main push from racing.
Checked by dry run (CI_PUBLISH_DRY=1) on this repo's history: a0197d1..c31f0ca → chatkit 0.46.0, paykit 0.4.0; tag paykit-v0.4.0 → paykit 0.4.0; a new branch → nothing.
Claude-Session: https://claude.ai/code/session_019MDtmsvGp1KVF8b3TMcU8J
Co-authored-by: Cato <cato@orangecat.ch>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* feat(chatkit 0.46.0, paykit 0.4.0): ModelSheet/ModelChip and failure actions; Stripe provider
chatkit: ModelChip and ModelSheet (Heidi's model picker as a package), ChatFailure.action and ChatFailure.retry. Ported from the old bitbaum/chatkit branch claude/model-sheet-and-failure-action.
paykit: @bitbaum/paykit/stripe, cards, TWINT and wallets through a Stripe account. Ported from the old bitbaum/paykit branch claude/stripe-provider.
Versions are raised in this PR: with forge-ops' publish step, the merge tags chatkit-v0.46.0 and paykit-v0.4.0 on GitLab, which publishes them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsvGp1KVF8b3TMcU8J
* feat(chatkit): ModelSheet free-model choice; ModelChip names a pick or the last answer
Heidi's model window let the reader tap a free model to ask it first and linked a comparison; its button named the picked model or the one that last answered. Without these the package could not replace Heidi's copy (Heidi AGENTS.md: extend the package).
ModelSheet: freePick, onFreePick, compareHref, format; labels pickTitle, pickHint, auto, autoHint, compare. ModelChip: picked, served, format, answeredBy, className. All optional; without them nothing changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsvGp1KVF8b3TMcU8J
---------
Co-authored-by: Cato <cato@orangecat.ch>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
accountkit 0.33.0, ai-kit 1.32.0 and design-tokens 1.8.0 carry the changes
that waited in their changelogs since publishing stopped on 2026-11-15; the
other 11 are patch releases with no code change. Publishing each once from
GitLab validates its new trust (npm drops one unused for 2 days).
scripts/trust-gitlab.sh replaces an older (GitHub) trust instead of failing:
npm keeps one per package, and bip-kit and chartkit failed with ENEEDAUTH.
README: releasing never needs npm; only a brand-new package needs one trust.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
A chart was one SVG drawn 640 units wide, and an SVG scales its text with
it: in a ~330px phone column the 12px labels came out at ~6px (measured on
orangecat.ch, 2026-11-20). Columns under 480px now get a compact form,
switched by a container query on .bp-chart-frame (no JavaScript): bar
charts become HTML rows (label, bar, value), line and area charts an SVG
drawn at 340 units. Long x labels are thinned so they never overlap.
Checked in Chromium at 375px (smallest label 16px, no sideways scroll) and
1100px (wide form, unchanged). The new test fails on the old renderer.
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* feat(chartkit): LineExplorer — a chart the reader works; numbers shown with every value a link
- @bitbaum/chartkit/explore: LineExplorer ("use client") over LineChart.
Toggle series (never the last), narrow periods, figures or change since
the first period; the view is data the app keeps in its URL
(initial / onViewChange). Every control 44px, every word from the app.
- LineChart `numbers`: the table behind the chart shown behind a
disclosure, each value a link to its source. Hidden table stays text.
- TableCell can be { text, href }. LineSeries.colour keeps a colour stable.
- Browser test works the explorer at 390/1280, light/dark: toggles,
range, change from 0, table links, 44px targets, no overflow, audit.
First of Solon's "every number clickable, slice and dice" phases; upstream
so every product gets it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(chatkit): the reader's place is where it was when history loads, not a fixed 240px
The Messenger check failed on main every run (325px): loading starts 200px
before the top (the observer's margin), so where the reader stands when the
page arrives varies. Measure the first message before and after the load;
a lost place still fails (it would jump down a whole page, off screen).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat(chartkit): the explorer's figures/change switch reads as a choice, not as switched off
The unchosen option was drawn muted, like a series switched off. It is a
choice of two: the chosen one is filled, the other reads as any button.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat(chartkit): LineExplorer defaultView — the app's own start, what Reset returns to
A product that keeps a series off until asked for (a second grey median)
showed Reset on first load. defaultView is the starting view: Reset returns
to it and only a departure from it counts as a change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The first GitLab publish (sitekit 0.8.0) succeeded but the job failed: the
check ran while npm still said 'being processed'.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(ci): publish without provenance — npm rejects it while package.json names the old repos
The first GitLab publish (sitekit 0.8.0) got npm's trusted-publishing login,
then failed E422: provenance said gitlab.com/bitbaum/kits, package.json
repository said github.com/bitbaum/sitekit. NPM_CONFIG_PROVENANCE=false did
not switch it off under trusted publishing; --provenance=false does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(ci): no sigstore token, so npm cannot switch provenance on
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* ci(kits): publish to npm from GitLab.com on a release tag
npm's trusted publishing (no stored npm token) accepts only GitHub Actions,
GitLab.com shared runners and CircleCI cloud. GitHub Actions has been off for
the bitbaum org since 2026-11-15 and Gitea's runners are self-hosted, so every
release needed an npm sign-in and a security key on the laptop.
- .gitlab-ci.yml: on `<folder>-v<version>`, check the version matches, pack
with pnpm (workspace ranges written in), publish the tarball with npm.
- scripts/release.sh: bump, verify, commit, tag, push to origin and gitlab;
no npm login.
- scripts/trust-gitlab.sh: once per package, trust the GitLab job.
Provenance stays off until package.json `repository` names the project that
builds it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* ci(kits): trust a package at its first GitLab release (npm drops unused trusts after 2 days)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
kits follows the same path as every repo: PRs on GitHub, the forge merge
check verifies (root verify) and merges, Gitea keeps an automatic copy. The
Gitea-only check workflow is removed.
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* feat(sitekit): a theme as data, AA-checked, and the SiteDocument page frame
siteThemeSchema / siteThemeCss turn a site's look into a value a server can
render without a stylesheet per site: one colour per semantic class (plus an
optional dark palette), faces from a closed self-hosted list, tracking,
radius and width, emitted as both the section tokens and the chrome's
--sk-* tokens. Text tokens below WCAG AA on either surface, and a button
label below AA on the accent, are refused with the measured ratio.
SiteDocument is the page frame consumers wrote by hand (camille's catch-all
route, class for class), so an engine-served page and an exported repository
render the same component.
Step 2 of loki ADR-0001 (the sites platform).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat(sitekit): siteSettingsSchema — lang and a one-line banner, read the same by engine and export
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat(sitekit): a form section — the first block with a server half
Closed fields (name, email, phone, message), a required privacy note and
anchor; refuses a field asked twice and a form nobody could answer. Renders a
plain HTML POST to the host's endpoint (SiteSections / SiteDocument `forms`
prop) with a honeypot and a live-region notice after the redirect back;
without a host it renders words, never a dead form. Settings gain `formTo`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat(sitekit): a gallery section — sized, lazy, never stretched or cropped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat(sitekit): booking requests (date, time, people) and a map section on OpenStreetMap
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat(sitekit): card actions — a shop links each product to where it is sold
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(sitekit): the map's show control reads as a control (+ like the FAQ)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
- .gitea/workflows/check.yml: on PR/push, verify the touched packages and
their dependents, on the laptop runner.
- scripts/release.sh: bump, verify package + dependents, tag, npm publish,
push; --pending lists versions npm does not have.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Under load, wheel ticks already sent can land after the earlier page arrives,
so the check measured mid-scroll: it failed 1 in 6 on unchanged code.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Root package.json + pnpm-workspace.yaml (settings merged from the packages'
own workspace files); per-package lockfiles and .github workflows removed —
one lockfile, CI comes back once, for the whole repo.
- Internal dependencies linked from source (workspace:^).
- README: packages, versions at the move, how to work here.
Every package's own verify passes in the workspace (chatkit's scroll browser
test is timing-flaky on a loaded machine: passed and failed on the same code).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>