4 Commits
Author SHA1 Message Date
d0fddb42b0 feat: the package is @bitbaum/ai-kit — npm's typosquat guard owns the bare name (#25)
First-publish attempt returned E403: 'Package name too similar to existing
package aikit' — the unscoped name is permanently unpublishable, no auth or
token changes that. Scoped to the org that owns the repos: @bitbaum/ai-kit.
Self-referencing imports in src/tests and the README install line follow.
77/77 tests green under the new name; consumers' import-path updates ride
the Wave-7 pin swap, which touches those exact files anyway.


Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-03 07:27:48 -07:00
GandClaude Opus 5 9009d73d3f chore: add a formatter (#22)
* chore: add a formatter, matching the style this repo already writes

singleQuote=false was chosen by counting this repo's own
imports, not by fleet decree. The fleet is genuinely split and the two repos
that already had a .prettierrc disagreed with each other, so there was no
standard to restore. Quote style does not cross repo boundaries; having a
gate does.

Markdown is ignored for now — prettier rewraps prose, which would bury the
real diff.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* style: format with prettier (27 files)

Mechanical. No behaviour change. This SHA is listed in
.git-blame-ignore-revs so `git blame` skips it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* chore: teach git blame to skip the reformat

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix(ci): ignore dist-cjs, which only exists on the runner

format:check passed locally and failed in CI on six files under dist-cjs/. The
ignore list covered 'dist' but not its siblings, and CI builds before verify —
so those files exist on the runner and never locally. A clean local check is no
evidence when a build precedes the gate.

Widened to dist-* so dist-esm and friends cannot repeat this.

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-31 10:42:02 +02:00
GandClaude Opus 5 0462b74365 feat!: become ai-kit — the AI layer in one install (#5)
The owner of this fleet read the name `ai-ration` and could not tell what the
package did. That is not a cosmetic complaint. An unreadable name is a cost paid
at every install decision, and this package had exactly ONE adopter while five
repos that skipped it — botsmann, evig, kivvi, orangecat, truthseeker — were all
taken down together on 2026-08-26 by a retired model id, which is precisely the
failure `chain` and `catalog` exist to prevent. "Ration" named one of five
modules and hid the other four.

Renamed, and widened to match how an app actually thinks about this. Adding an
AI feature looks like one decision and is really four — which model, is it still
there, what do the 429s mean, who gets the free tier — plus filling forms. Get
any one wrong and it fails identically from outside: the assistant is broken.
AOZ is the proof: it adopted the form half, hand-rolled the rest because that
was a second decision nobody made, and then reported "KI-Assistent nicht
konfiguriert" on a deployment whose key was valid.

So `ai-forms` is re-exported from the root and from ./forms, ./react and
./server. It is NOT absorbed: it works, four apps run it, and it is genuinely
useful outside this fleet. Swallowing it would break four repos to satisfy a
filing system. React stays on its own subpath as an optional peer so importing
ai-kit on a server never pulls in a UI library.

threadkit and limitkit are deliberately NOT merged. Neither has anything to do
with AI — an app throttling its login form should not install a model catalogue
to do it.

Four new tests cover the merge itself, because the merge IS the feature: without
them a broken re-export quietly turns this back into ai-ration under a friendlier
name and nothing else here would notice.

BREAKING CHANGE: the package is now `ai-kit`. Import from 'ai-kit'.
The GitHub repo is renamed; existing `github:maonakamoto/ai-ration` installs
continue to resolve through GitHub's redirect.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-26 14:33:08 +02:00
Mao NakamotoandClaude Opus 5 71b665e5b5 feat: ai-ration — free-tier chain, 429 classification, fair-share rationing
Three pure modules extracted from FleetCrown, where each was written after the
matching failure had already happened in production:

  chain      — a fallback list ACROSS VENDORS. A single pinned free model is a
               scheduled outage, and stepping down to a smaller model at the
               SAME vendor buys nothing: it draws on the same org-wide daily
               budget, so when the day runs dry every link is already dead.

  limits     — the three kinds of 429 share a status, a `type` and a `code`, and
               need OPPOSITE responses. Only the body separates them. Treating
               `size` as `capacity` broke a tool loop on every single turn;
               treating `daily` as `capacity` is the same mistake one level
               deeper.

  fair-share — divide a fixed daily pool across users active TODAY, paced through
               the day, with a one-turn floor so nobody's first question is
               refused. The goal is not throughput; it is that every active user
               gets a usable amount every day.

No HTTP client on purpose. Every consumer already has its own calling
conventions, retries and logging; replacing those is a rewrite rather than an
adoption. This package supplies the decisions and leaves the fetch alone.

Two things fixed in the extraction rather than carried over:

- `humanizeWait`'s singular hour was unreachable. With the boundary at 90
  minutes, anything reaching the hours branch divided to at least 1.5, which
  rounds to 2 — so "about 1 hour" could never print and an hour-long wait was
  announced as two. Boundary moved to 60 and the case is now tested.
- The fair-share header quoted a 10k turn cost. A measured turn was ~16k, so the
  worked example understated the squeeze by nearly half.

Tests import the package BY NAME rather than reaching into dist/, so a broken
`exports` map or a `files` list that forgets to ship dist/ fails here instead of
at the first consumer's install.

31 tests, all green via `npm run verify`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-16 11:49:17 +02:00