@north-light/cli 0.3.719 → 0.3.720
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/dist/core/rate-limit-scope.js +1 -1
- package/package.json +3 -3
- package/packages/crouter-api/dist/core/rate-limit-scope.js +11 -5
- package/packages/crouter-api/package.json +1 -1
- package/packages/crouter-identity/package.json +1 -1
- package/packages/crouter-plugin/package.json +3 -3
- package/runtime.lock.json +14 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var h=Object.defineProperty;var o=(e,t)=>h(e,"name",{value:t,configurable:!0});const w={seven_day_opus:"opus",seven_day_sonnet:"sonnet"},L=new Set(["five_hour","seven_day","overage"]),v={seven_day_overage_included:"anthropic-ratelimit-unified-7d_oi-status"},A=["opus","sonnet","haiku","fable","mythos"],S=48,k=256;function b(e){if(!e)return;const t=e.toLowerCase();return A.find(r=>t.includes(r))}o(b,"modelCooldownFamily");function j(e){return e?typeof Headers<"u"&&e instanceof Headers?[...e.entries()]:Object.entries(e).filter(t=>typeof t[1]=="string"):[]}o(j,"entries");function C(e){return e.startsWith("anthropic-ratelimit-")||e.startsWith("x-ratelimit-")||e==="retry-after"||e==="retry-after-ms"}o(C,"isRateLimitHeader");function E(e){const t={};for(const[r,i]of j(e)){const n=r.toLowerCase();if(C(n)){if(Object.keys(t).length>=S)break;t[n]=i.slice(0,k)}}return t}o(E,"rateLimitHeaders");function H(e,t,r=Date.now()){const i=E(e),n=i["anthropic-ratelimit-unified-representative-claim"]?.trim()||void 0,u=i["anthropic-ratelimit-unified-status"]?.trim()==="rejected",d=Number(i["anthropic-ratelimit-unified-reset"]),a=u&&Number.isFinite(d)&&d>0&&d*1e3>r?d*1e3:void 0,s=n===void 0?void 0:w[n],c=b(t),f=i["anthropic-ratelimit-unified-7d-status"]?.trim(),p=i["anthropic-ratelimit-unified-5h-status"]?.trim(),y=f!==void 0&&f!=="rejected"&&p!=="rejected",m=n===void 0?void 0:v[n],_=n!==void 0&&s===void 0&&!L.has(n)&&(m===void 0||i[m]?.trim()==="rejected"),l=s!==void 0?s===c?c:void 0:_&&y?c:void 0;return{scope:u&&l!==void 0?{kind:"model",family:l}:{kind:"account"},...n!==void 0?{claim:n}:{},...a!==void 0?{resetAt:a}:{},headers:i}}o(H,"classifyRateLimit");function W(e){return e.kind==="account"?"account":`model:${e.family}`}o(W,"describeRateLimitScope");export{H as classifyRateLimit,W as describeRateLimitScope,b as modelCooldownFamily,E as rateLimitHeaders};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.720",
|
|
4
4
|
"description": "crtr — agent runtime with memory, plugins, and marketplaces",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -158,8 +158,8 @@
|
|
|
158
158
|
},
|
|
159
159
|
"license": "UNLICENSED",
|
|
160
160
|
"dependencies": {
|
|
161
|
-
"@north-light/identity": "0.3.
|
|
162
|
-
"@north-light/plugin": "0.3.
|
|
161
|
+
"@north-light/identity": "0.3.720",
|
|
162
|
+
"@north-light/plugin": "0.3.720",
|
|
163
163
|
"@earendil-works/chord": "1.5.2",
|
|
164
164
|
"@earendil-works/pi-agent-core": "1.5.2",
|
|
165
165
|
"@earendil-works/pi-ai": "1.5.2",
|
|
@@ -12,12 +12,17 @@
|
|
|
12
12
|
// per-model weekly window matching the requested model's family, or when its
|
|
13
13
|
// claim is not a known account-wide window and the response itself reports the
|
|
14
14
|
// account-wide weekly window as not rejected (a per-model window such as the
|
|
15
|
-
// Fable weekly cap, whatever its claim is called).
|
|
16
|
-
//
|
|
17
|
-
//
|
|
15
|
+
// Fable weekly cap, whatever its claim is called). Anthropic reports the Fable
|
|
16
|
+
// weekly cap as `seven_day_overage_included` (status in `-7d_oi-status`): that
|
|
17
|
+
// claim is model-scoped on the same evidence, and only when `-7d_oi-status`
|
|
18
|
+
// itself is `rejected`. Anything else — missing status, no account-window
|
|
19
|
+
// evidence, a known window for a different family, models with no family,
|
|
20
|
+
// other providers — cools the whole account.
|
|
18
21
|
const MODEL_CLAIMS = { seven_day_opus: 'opus', seven_day_sonnet: 'sonnet' };
|
|
19
22
|
/** Claims that name an account-wide window: never model-scoped, whatever the per-window statuses say. */
|
|
20
|
-
const ACCOUNT_CLAIMS = new Set(['five_hour', 'seven_day', '
|
|
23
|
+
const ACCOUNT_CLAIMS = new Set(['five_hour', 'seven_day', 'overage']);
|
|
24
|
+
/** Per-model windows the vendor names with a claim of its own, mapped to the header carrying that window's status. */
|
|
25
|
+
const PER_MODEL_WINDOW_STATUS = { seven_day_overage_included: 'anthropic-ratelimit-unified-7d_oi-status' };
|
|
21
26
|
const FAMILIES = ['opus', 'sonnet', 'haiku', 'fable', 'mythos'];
|
|
22
27
|
const MAX_HEADERS = 48;
|
|
23
28
|
const MAX_VALUE = 256;
|
|
@@ -64,7 +69,8 @@ export function classifyRateLimit(headers, modelId, now = Date.now()) {
|
|
|
64
69
|
const weekly = recorded['anthropic-ratelimit-unified-7d-status']?.trim();
|
|
65
70
|
const fiveHour = recorded['anthropic-ratelimit-unified-5h-status']?.trim();
|
|
66
71
|
const accountWindowsOpen = weekly !== undefined && weekly !== 'rejected' && fiveHour !== 'rejected';
|
|
67
|
-
const
|
|
72
|
+
const windowStatus = claim === undefined ? undefined : PER_MODEL_WINDOW_STATUS[claim];
|
|
73
|
+
const unknownWindow = claim !== undefined && claimed === undefined && !ACCOUNT_CLAIMS.has(claim) && (windowStatus === undefined || recorded[windowStatus]?.trim() === 'rejected');
|
|
68
74
|
const scopedFamily = claimed !== undefined ? (claimed === family ? family : undefined) : unknownWindow && accountWindowsOpen ? family : undefined;
|
|
69
75
|
const scope = rejected && scopedFamily !== undefined ? { kind: 'model', family: scopedFamily } : { kind: 'account' };
|
|
70
76
|
return { scope, ...(claim !== undefined ? { claim } : {}), ...(resetAt !== undefined ? { resetAt } : {}), headers: recorded };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/api",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.720",
|
|
4
4
|
"description": "Typed crtrd /v1 API contract — DTOs, route builders, the error contract, the CrtrClient, and the command-plugin manifest format. Zero runtime dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/api/index.js",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/plugin",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.720",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"postpack": "node ../../scripts/pack-minify.mjs postpack packages/crouter-plugin"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@north-light/api": "0.3.
|
|
31
|
-
"@north-light/identity": "0.3.
|
|
30
|
+
"@north-light/api": "0.3.720",
|
|
31
|
+
"@north-light/identity": "0.3.720"
|
|
32
32
|
},
|
|
33
33
|
"license": "UNLICENSED",
|
|
34
34
|
"publishConfig": {
|
package/runtime.lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.720",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@north-light/cli",
|
|
9
|
-
"version": "0.3.
|
|
9
|
+
"version": "0.3.720",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "UNLICENSED",
|
|
12
12
|
"workspaces": [
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"@milkdown/preset-gfm": "^7.22.3",
|
|
29
29
|
"@milkdown/prose": "^7.22.3",
|
|
30
30
|
"@milkdown/utils": "^7.22.3",
|
|
31
|
-
"@north-light/identity": "0.3.
|
|
32
|
-
"@north-light/plugin": "0.3.
|
|
31
|
+
"@north-light/identity": "0.3.720",
|
|
32
|
+
"@north-light/plugin": "0.3.720",
|
|
33
33
|
"cron-parser": "^5.6.0",
|
|
34
34
|
"esbuild": "0.28.2",
|
|
35
35
|
"jose": "^6.2.12",
|
|
@@ -11902,17 +11902,17 @@
|
|
|
11902
11902
|
},
|
|
11903
11903
|
"packages/crouter-api": {
|
|
11904
11904
|
"name": "@north-light/api",
|
|
11905
|
-
"version": "0.3.
|
|
11905
|
+
"version": "0.3.720",
|
|
11906
11906
|
"license": "UNLICENSED"
|
|
11907
11907
|
},
|
|
11908
11908
|
"packages/crouter-env-docker": {
|
|
11909
11909
|
"name": "@north-light/env-docker",
|
|
11910
|
-
"version": "0.3.
|
|
11910
|
+
"version": "0.3.720",
|
|
11911
11911
|
"license": "UNLICENSED"
|
|
11912
11912
|
},
|
|
11913
11913
|
"packages/crouter-identity": {
|
|
11914
11914
|
"name": "@north-light/identity",
|
|
11915
|
-
"version": "0.3.
|
|
11915
|
+
"version": "0.3.720",
|
|
11916
11916
|
"license": "UNLICENSED",
|
|
11917
11917
|
"dependencies": {
|
|
11918
11918
|
"jose": "^6.2.1"
|
|
@@ -11920,21 +11920,21 @@
|
|
|
11920
11920
|
},
|
|
11921
11921
|
"packages/crouter-plugin": {
|
|
11922
11922
|
"name": "@north-light/plugin",
|
|
11923
|
-
"version": "0.3.
|
|
11923
|
+
"version": "0.3.720",
|
|
11924
11924
|
"license": "UNLICENSED",
|
|
11925
11925
|
"dependencies": {
|
|
11926
|
-
"@north-light/api": "0.3.
|
|
11927
|
-
"@north-light/identity": "0.3.
|
|
11926
|
+
"@north-light/api": "0.3.720",
|
|
11927
|
+
"@north-light/identity": "0.3.720"
|
|
11928
11928
|
}
|
|
11929
11929
|
},
|
|
11930
11930
|
"packages/crouter-sdk": {
|
|
11931
11931
|
"name": "@north-light/sdk",
|
|
11932
|
-
"version": "0.3.
|
|
11932
|
+
"version": "0.3.720",
|
|
11933
11933
|
"license": "UNLICENSED",
|
|
11934
11934
|
"dependencies": {
|
|
11935
|
-
"@north-light/api": "0.3.
|
|
11936
|
-
"@north-light/identity": "0.3.
|
|
11937
|
-
"@north-light/plugin": "0.3.
|
|
11935
|
+
"@north-light/api": "0.3.720",
|
|
11936
|
+
"@north-light/identity": "0.3.720",
|
|
11937
|
+
"@north-light/plugin": "0.3.720",
|
|
11938
11938
|
"jose": "^6.2.1"
|
|
11939
11939
|
},
|
|
11940
11940
|
"bin": {
|