Files
plugins/packages
yetone 5292fc9f55 kiro 0.1.36: overage is its own window against its cap; the plan's credits are the plan's (wizcheu on X)
wizcheu on X, Kiro Power (10000 credits) with overage on: the Kiro IDE
shows "10000 used / 10000 covered in plan" and 2589.24 post-paid credits
used (12589.24 this month). magpie showed 12589.24 / 37500 (in "left"
mode 24910.76 / 37500), the overage cap taken for the month's whole
limit.

The cap counts the overage alone: it is the profile's "maximum allowed
overage" quota, in USD at $0.04 a credit (Kiro's Service Quotas
L-75434B0B; $400 is 10000 credits, the cap the 0.1.28 fixture had on a
2000-credit plan). So with overage on the month is now two windows, as
the IDE shows it:
- the plan's credits, min(used, plan) / plan, shown only (aside): using
  them up doesn't stop the account;
- "Overage": currentOveragesWithPrecision (else currentOverages, else
  what is past the plan) / overageCap, the window that stops it.
With overage off nothing changes. An Identity Center account's regions
sum each: the plans' sum first, shown only, then the overages' sum,
which is the one magpie weighs; a region is used up when its overage
is.

Run (mote, macOS, Bun 1.4.2, HOME a temp dir), at this commit:
- bun test packages/kiro: 172 pass, 0 fail.
- bun scripts/check.mjs: ok.
Broken by hand, bun test packages/kiro/region.test.mjs:
- index.mjs from origin/main (overage cap as the month): 6 fail,
  the reporter's numbers among them.
- a region used up by its plan, not its overage: 1 fail ("a region
  past its plan with overage left is still used").

Not tried: a real Kiro account with overage on. The fixture is built
from the reporter's screenshot (12589.24, 10000, 2589.24, 37500); the
overageCap-is-overage-only reading is from Kiro's quota docs, not from
a read of a real account at its cap.
2026-11-10 17:58:29 +08:00
..
middleware: param-override, model-map, system-prompt, word-guard and think-tags — gateway middleware that magpie runs on every agent's requests and replies, mostly New API's channel settings with the same JSON (the owner) — magpie can now run a plugin as gateway middleware (onRequest, onEvent, onResponse, in-process on moejs), and these are the first ones: param-override is New API's param_override (both forms, operations with gjson paths and conditions, return_error); model-map is model_mapping (chains, /regex/ keys with $1) and puts the asked-for name back into replies; system-prompt adds a prompt in each API's own place, keeping an agent's own unless override (New API's semantics), by agent or model; word-guard is the sensitive-word filter (reject or mask the user's text, optionally replies); think-tags strips a leading <think>…</think> from replies across stream chunks, or puts Chat reasoning_content into the text (thinking_to_content). Each is one file with no imports, named @magpie-community/middleware-<name>, with magpie.options as the example the app's editor starts from; registry.json lists them with "kind": "middleware" and no providers; check.mjs skips middleware-only packages. scripts/middleware.mjs calls the hooks as the gateway does (events split, [DONE] passed by) and runs each package's cases.json. Tested with a real DeepSeek account and real Claude Code through magpie's gateway: a mapped model named back in message_start, max_tokens capped, a system prompt appended for claude only, a word turned away as a 400 in Anthropic's shape, return_error as a 403 in Chat's, <think> stripped from Chat and Responses streams and an Anthropic whole reply, reasoning_content moved into the text. bun test (61 for these five) and bun scripts/check.mjs pass; packages/devin's two image tests fail on this machine only, as on main. Their first npm version has to be published by hand (trusted publishing can't create a package); until then magpie shows them as Coming soon.
2026-10-05 20:49:42 +08:00