@proposit/shared 0.15.0 → 0.15.1
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.
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Type, type Static } from "typebox";
|
|
2
|
+
export declare const BudgetExceededErrorBodySchema: Type.TObject<{
|
|
3
|
+
code: Type.TLiteral<"TOKEN_BUDGET_EXCEEDED">;
|
|
4
|
+
message: Type.TString;
|
|
5
|
+
usage: Type.TObject<{
|
|
6
|
+
used: Type.TInteger;
|
|
7
|
+
limit: Type.TInteger;
|
|
8
|
+
resetOn: Type.TString;
|
|
9
|
+
}>;
|
|
10
|
+
}>;
|
|
11
|
+
export type TBudgetExceededErrorBody = Static<typeof BudgetExceededErrorBodySchema>;
|
|
12
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/schemas/api/errors.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,IAAI,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAA;AAE3C,eAAO,MAAM,6BAA6B;;;;;;;;EAQxC,CAAA;AAEF,MAAM,MAAM,wBAAwB,GAAG,MAAM,CACzC,OAAO,6BAA6B,CACvC,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Canonical error-body shapes shared by server entry routes. The first
|
|
2
|
+
// member is the 402 budget-exceeded contract emitted by every LLM-bearing
|
|
3
|
+
// entry route (build, twitter/reddit/raw_text import) when the caller's
|
|
4
|
+
// per-user token budget is exhausted. The discriminating `code` matches the
|
|
5
|
+
// task-level settle code used for mid-pipeline overruns (TaskStatus.FAILED
|
|
6
|
+
// with errorData.code === "TOKEN_BUDGET_EXCEEDED") so the client has one
|
|
7
|
+
// classifier across both surfaces — request-level (this body) and
|
|
8
|
+
// task-level. `usage` lets the client surface used / limit / resetOn to the
|
|
9
|
+
// user.
|
|
10
|
+
import { Type } from "typebox";
|
|
11
|
+
export const BudgetExceededErrorBodySchema = Type.Object({
|
|
12
|
+
code: Type.Literal("TOKEN_BUDGET_EXCEEDED"),
|
|
13
|
+
message: Type.String(),
|
|
14
|
+
usage: Type.Object({
|
|
15
|
+
used: Type.Integer({ minimum: 0 }),
|
|
16
|
+
limit: Type.Integer({ minimum: 0 }),
|
|
17
|
+
resetOn: Type.String({ format: "date-time" }),
|
|
18
|
+
}),
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/schemas/api/errors.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,0EAA0E;AAC1E,wEAAwE;AACxE,4EAA4E;AAC5E,2EAA2E;AAC3E,yEAAyE;AACzE,kEAAkE;AAClE,4EAA4E;AAC5E,QAAQ;AAER,OAAO,EAAE,IAAI,EAAe,MAAM,SAAS,CAAA;AAE3C,MAAM,CAAC,MAAM,6BAA6B,GAAG,IAAI,CAAC,MAAM,CAAC;IACrD,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,uBAAuB,CAAC;IAC3C,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE;IACtB,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;QAClC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;QACnC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;KAChD,CAAC;CACL,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proposit/shared",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.1",
|
|
4
4
|
"description": "Runtime-agnostic TypeScript shared between proposit-server and proposit-mobile. Schemas, engine, api-client, and utilities.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/Proposit-App/proposit-shared",
|
|
@@ -38,6 +38,11 @@
|
|
|
38
38
|
"import": "./dist/schemas/api/auth/index.js",
|
|
39
39
|
"default": "./dist/schemas/api/auth/index.js"
|
|
40
40
|
},
|
|
41
|
+
"./schemas/api/errors": {
|
|
42
|
+
"types": "./dist/schemas/api/errors.d.ts",
|
|
43
|
+
"import": "./dist/schemas/api/errors.js",
|
|
44
|
+
"default": "./dist/schemas/api/errors.js"
|
|
45
|
+
},
|
|
41
46
|
"./schemas/api/grammar-violations": {
|
|
42
47
|
"types": "./dist/schemas/api/grammar-violations.d.ts",
|
|
43
48
|
"import": "./dist/schemas/api/grammar-violations.js",
|