@limitry/cli 1.0.0-rc.7 → 1.0.0-rc.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +112 -0
- package/README.md +4 -4
- package/dist/limitry.mjs +498 -473
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,118 @@
|
|
|
2
2
|
|
|
3
3
|
What changed in the Limitry CLI (`@limitry/cli`). Generated from the source on each release; newest first.
|
|
4
4
|
|
|
5
|
+
## 1.0.0-rc.9 (2026-10-22)
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- `POST /v1/checks` can now answer `503` with the code `busy` when
|
|
10
|
+
Limitry is deciding too many checks for those subjects at once. Nothing
|
|
11
|
+
was charged. `guard` and `reserve` (TypeScript and Python) send the
|
|
12
|
+
check again with the same key, within the same 30 seconds they give
|
|
13
|
+
`moving`, before the limit's fail mode decides. Each retry of `busy` or
|
|
14
|
+
`moving` now waits the answer's `Retry-After` plus a random backoff that
|
|
15
|
+
grows with each try, so clients don't all come back at the same moment.
|
|
16
|
+
Older SDK versions treat `busy` as Limitry being unreachable after their
|
|
17
|
+
usual two quick retries, so the fail mode decides; upgrade to retry it.
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- A very busy workspace's counts are now spread over more of Limitry's
|
|
22
|
+
servers as its traffic grows. While some of them move, which takes a few
|
|
23
|
+
seconds, checks, commits and releases on those subjects answer `503`
|
|
24
|
+
with the new error code `moving` and `Retry-After: 1`; nothing is
|
|
25
|
+
counted. `guard` and `reserve` (TypeScript and Python) and the CLI send
|
|
26
|
+
the same request again with the same Idempotency-Key for up to 30
|
|
27
|
+
seconds, each try with its own time budget, before a limit's fail mode
|
|
28
|
+
applies, so work is neither run uncounted nor left uncommitted.
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
|
|
32
|
+
- A reservation (`mode: "reserve"`) now starts a subject's period, as a
|
|
33
|
+
plain check does: on a `billing_date` limit with no billing date set
|
|
34
|
+
yet, the first reservation's time becomes the subject's billing date,
|
|
35
|
+
and on a `first_use` limit it starts the period. Before, reservations
|
|
36
|
+
made before the subject's first commit could each count in a period of
|
|
37
|
+
their own, so a monthly limit could let more through than its amount.
|
|
38
|
+
A reservation you release still starts the period, with nothing used in
|
|
39
|
+
it.
|
|
40
|
+
- A `503 moving` answer with `Retry-After: 0` is now retried after at least
|
|
41
|
+
a second, not at once, and still for at most 30 seconds. A client made
|
|
42
|
+
with `maxRetries: 0` no longer sends the SDK's internal
|
|
43
|
+
`x-limitry-moving` header to the API.
|
|
44
|
+
|
|
45
|
+
## 1.0.0-rc.8 (2026-10-21)
|
|
46
|
+
|
|
47
|
+
### Added
|
|
48
|
+
|
|
49
|
+
- Limits have `counting`: `fast` answers the instant it decides, and
|
|
50
|
+
`guaranteed` stores every count safely before answering, so the limit
|
|
51
|
+
never goes over, even if a server fails. A `total` balance defaults to
|
|
52
|
+
`guaranteed`, every other window to `fast`. Set it when creating or
|
|
53
|
+
updating a limit (`counting`, `--counting`), or in `limitry.json`.
|
|
54
|
+
|
|
55
|
+
### Changed
|
|
56
|
+
|
|
57
|
+
- - Creating a limit needs only who it is for, the amount and the window:
|
|
58
|
+
`limits.create({ subject: { kind: "user" }, amount: 100, window: "month" })`
|
|
59
|
+
(`limitry limits create --subject '{"kind":"user"}' --amount 100 --window month`).
|
|
60
|
+
`action` defaults to every action (`*`), `unit` to `units`, and `name`
|
|
61
|
+
to the sentence the limit reads as, such as "100 units per user per
|
|
62
|
+
month". If a limit already has that name, the API answers `409`: give
|
|
63
|
+
this one a `name`. `limitry.json` entries still need a `name`.
|
|
64
|
+
- A limit's input names who it is for as `subject: { kind, id }` (was
|
|
65
|
+
`subjectKind` and `subjectId`), the same shape the limit itself has.
|
|
66
|
+
- What a limit counts is fixed once it is created: its subject, action,
|
|
67
|
+
unit, window, `every`, `start` and `rolling`. Changing one answers
|
|
68
|
+
`400 invalid_request`: create a new limit and archive the old one (its
|
|
69
|
+
history stays). Name, amount, fail mode and enabled still change any
|
|
70
|
+
time. `limitry sync` refuses such a change until you rename the entry.
|
|
71
|
+
- A limit says when a check last reached it (`lastCheckedAt`), so you can
|
|
72
|
+
see a limit no check names.
|
|
73
|
+
- One name for each idea, everywhere: the API, both SDKs, the CLI, the MCP
|
|
74
|
+
tools, `limitry.json` and webhooks. Update your code when you upgrade:
|
|
75
|
+
|
|
76
|
+
- `hold()` is `reserve()`: it takes `cost` (was `estimate`), and the block
|
|
77
|
+
gets a `Reservation` (was `Held`; Python `Reservation` and
|
|
78
|
+
`AsyncReservation`), with the same `cost()` and `extend()`.
|
|
79
|
+
- A refusal throws `LimitReached` (was `LimitExceeded`), with `limitId`
|
|
80
|
+
(Python `limit_id`) and `reason` `limit_reached` or
|
|
81
|
+
`too_many_reservations`. When Limitry can't be reached and a limit fails
|
|
82
|
+
closed, you now get a separate `Unavailable` error. "Can't be reached"
|
|
83
|
+
also covers a `402 plan_limit_reached` and a `429` from Limitry's flood
|
|
84
|
+
guard, so each limit's fail mode decides instead of your code getting an
|
|
85
|
+
error.
|
|
86
|
+
- A check's answer lists its limits in `limits` (was `remaining`): read
|
|
87
|
+
`decision.limits[0].remaining`. Every answer that names a limit says
|
|
88
|
+
`limitId`: `reason.limitId`, `limits[].limitId`, `usage.standing`'s
|
|
89
|
+
`limits[].limitId`, and webhook payloads.
|
|
90
|
+
- The refusal code is `limit_reached` (was `limit_exceeded`), and the
|
|
91
|
+
webhook event is `limit.reached` (was `limit.exceeded`): subscribe your
|
|
92
|
+
endpoints to the new name.
|
|
93
|
+
- Usage says `refused` (was `denied`); `usage.subjects` no longer has
|
|
94
|
+
`over` (it is `refused > 0`).
|
|
95
|
+
- Credits: `limits.credits.create()` and `limits.credits.list()` at
|
|
96
|
+
`/v1/limits/{limitId}/credits` (were `limits.grants.*` at `…/grants`),
|
|
97
|
+
ids start `crd_` (were `grt_`), and the approval an agent asks for is
|
|
98
|
+
`limit.credit` (was `limit.grant`).
|
|
99
|
+
- A period that starts on the subject's billing date is
|
|
100
|
+
`start: "billing_date"` (was `"anchor"`), and `subjects.update()` takes
|
|
101
|
+
`billingDate` (was `anchor`); the subject says `billingDate` too.
|
|
102
|
+
- `usage.standing()` and `usage.query()` take one `subject`, written
|
|
103
|
+
`kind:id` (`user:usr_123`), instead of separate kind and id fields
|
|
104
|
+
(`limitry usage standing --subject user:usr_123`).
|
|
105
|
+
- A limit's id starts `lmt_` (was `lim_`); keys still start `lim_test_`
|
|
106
|
+
and `lim_live_`.
|
|
107
|
+
- `limitry sync --preview` (was `--dry-run`), and the API's `preview`
|
|
108
|
+
(was `dryRun`), in what you send and what comes back.
|
|
109
|
+
|
|
110
|
+
### Removed
|
|
111
|
+
|
|
112
|
+
- Limits no longer have `counting` (Fast or Guaranteed), and the CLI no
|
|
113
|
+
longer has `--counting`: every count is now saved before Limitry answers,
|
|
114
|
+
for every limit. Remove `counting` from your code and from
|
|
115
|
+
`limitry.json`; Limitry ignores it.
|
|
116
|
+
|
|
5
117
|
## 1.0.0-rc.7 (2026-10-19)
|
|
6
118
|
|
|
7
119
|
### Added
|
package/README.md
CHANGED
|
@@ -28,15 +28,15 @@ Commands act in **test** unless you say otherwise, so trying things
|
|
|
28
28
|
never touches the limits your customers depend on.
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
|
-
# 100 AI replies a day for each user
|
|
32
|
-
limitry limits create --
|
|
33
|
-
--
|
|
31
|
+
# 100 AI replies a day for each user ("100 replies per user per day for ai-call")
|
|
32
|
+
limitry limits create --subject '{"kind":"user"}' --action ai-call \
|
|
33
|
+
--amount 100 --unit replies --window day
|
|
34
34
|
|
|
35
35
|
# Check a user, as your code would
|
|
36
36
|
limitry check user:usr_123 ai-call
|
|
37
37
|
|
|
38
38
|
# Where a user stands, without counting anything
|
|
39
|
-
limitry usage standing --
|
|
39
|
+
limitry usage standing --subject user:usr_123
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
When a limit is right, copy it to live from the **Limits** page in the
|