@hilbras/sdk 3.4.4 → 3.6.0
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/README.md +17 -10
- package/dist/frameworks/astro/endpoints.js +58 -16
- package/dist/frameworks/astro/index.d.ts +1 -0
- package/dist/frameworks/nextjs/api/index.d.ts +15 -0
- package/dist/frameworks/nextjs/api/index.js +14 -0
- package/dist/frameworks/nextjs/api/stream.d.ts +44 -0
- package/dist/frameworks/nextjs/api/stream.js +150 -0
- package/dist/frameworks/nextjs/edge/index.d.ts +12 -0
- package/dist/frameworks/nextjs/edge/index.js +11 -0
- package/dist/frameworks/nextjs/edge/middleware.d.ts +85 -0
- package/dist/frameworks/nextjs/edge/middleware.js +113 -0
- package/dist/frameworks/nextjs/index.d.ts +1 -0
- package/dist/frameworks/nextjs/next-runtime.d.ts +63 -0
- package/dist/frameworks/nextjs/next-runtime.js +41 -0
- package/dist/frameworks/nextjs/route-handlers.js +51 -27
- package/dist/frameworks/nextjs/server.d.ts +24 -1
- package/dist/frameworks/nextjs/server.js +24 -1
- package/dist/frameworks/react-client/index.d.ts +35 -0
- package/dist/frameworks/react-client/index.js +31 -0
- package/dist/frameworks/react-client/provider.d.ts +45 -0
- package/dist/frameworks/react-client/provider.js +40 -0
- package/dist/frameworks/react-client/use-chat.d.ts +85 -0
- package/dist/frameworks/react-client/use-chat.js +202 -0
- package/dist/frameworks/react-client/use-completion.d.ts +66 -0
- package/dist/frameworks/react-client/use-completion.js +117 -0
- package/dist/frameworks/react-client/use-cost.d.ts +62 -0
- package/dist/frameworks/react-client/use-cost.js +68 -0
- package/dist/frameworks/remix/actions.js +58 -16
- package/dist/frameworks/remix/index.d.ts +1 -0
- package/dist/frameworks/shared/handler-core.d.ts +143 -2
- package/dist/frameworks/shared/handler-core.js +134 -5
- package/package.json +17 -3
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* and how to build a `Response`.
|
|
16
16
|
*/
|
|
17
17
|
import { HilbrasClient } from "../../client/client.js";
|
|
18
|
+
import type { Tool } from "../../types/tools.js";
|
|
18
19
|
/** Options common to every framework handler factory. */
|
|
19
20
|
export interface FrameworkHandlerBaseOptions {
|
|
20
21
|
/** Catalog provider id or display name, e.g. `"openai"` or `"OpenAI"`. */
|
|
@@ -28,7 +29,102 @@ export interface FrameworkHandlerBaseOptions {
|
|
|
28
29
|
* catalog `envKey` (for example `OPENAI_API_KEY`).
|
|
29
30
|
*/
|
|
30
31
|
apiKey?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Whether fields in the request body may override the factory's own options.
|
|
34
|
+
*
|
|
35
|
+
* `true` (the default, and the v3.4 behaviour) lets a caller choose
|
|
36
|
+
* `body.model`, `body.temperature`, `body.maxTokens`, `body.tools` and
|
|
37
|
+
* `body.maxSteps`. `false` ignores all of them and uses only the values
|
|
38
|
+
* configured on the factory, which is what a public route wants.
|
|
39
|
+
*
|
|
40
|
+
* The default flips to `false` in 4.0.0.
|
|
41
|
+
*/
|
|
42
|
+
trustClientFields?: boolean;
|
|
43
|
+
/** Bounded request limits. Every field is individually overridable. */
|
|
44
|
+
limits?: Partial<FrameworkHandlerLimits>;
|
|
45
|
+
/**
|
|
46
|
+
* Called once per request after the body is validated and before any provider
|
|
47
|
+
* call. Throw to reject the request; `errorResponse` maps the thrown error, so
|
|
48
|
+
* a `RequestValidationError` carrying 401 or 403 becomes that status and
|
|
49
|
+
* anything else becomes a generic 500.
|
|
50
|
+
*
|
|
51
|
+
* This is the authentication and authorization extension point.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* createChatHandler({
|
|
56
|
+
* provider: "openai",
|
|
57
|
+
* model: "gpt-4o",
|
|
58
|
+
* onRequest({ request }) {
|
|
59
|
+
* if (request.headers.get("authorization") !== `Bearer ${process.env.SESSION}`) {
|
|
60
|
+
* throw new RequestValidationError("Unauthorized", undefined, 401);
|
|
61
|
+
* }
|
|
62
|
+
* },
|
|
63
|
+
* });
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
onRequest?: (context: FrameworkRequestContext) => void | Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* Called for every request that fails, including one rejected by `onRequest`.
|
|
69
|
+
* This is where the server-side log belongs: `errorResponse` deliberately
|
|
70
|
+
* withholds detail from the response body, so without this hook a provider
|
|
71
|
+
* error is invisible to the operator.
|
|
72
|
+
*/
|
|
73
|
+
onError?: (error: unknown, context: FrameworkErrorContext) => void | Promise<void>;
|
|
74
|
+
}
|
|
75
|
+
/** What an `onRequest` hook receives. */
|
|
76
|
+
export interface FrameworkRequestContext {
|
|
77
|
+
/** The incoming request. */
|
|
78
|
+
request: Request;
|
|
79
|
+
/** The parsed JSON body. */
|
|
80
|
+
body: Record<string, unknown>;
|
|
81
|
+
/**
|
|
82
|
+
* The fields the handler will actually use, after `trustClientFields` and the
|
|
83
|
+
* limits have been applied. A hook that authorizes per-model should read this
|
|
84
|
+
* rather than `body`, because these are the values that reach the provider.
|
|
85
|
+
*/
|
|
86
|
+
effective: FrameworkEffectiveFields;
|
|
87
|
+
}
|
|
88
|
+
/** The resolved request parameters, after allowlist and limit handling. */
|
|
89
|
+
export interface FrameworkEffectiveFields {
|
|
90
|
+
model: string;
|
|
91
|
+
provider: string;
|
|
92
|
+
messages?: unknown[];
|
|
93
|
+
prompt?: string;
|
|
94
|
+
tools?: Tool[];
|
|
95
|
+
maxSteps?: number;
|
|
96
|
+
maxTokens?: number;
|
|
97
|
+
temperature?: number;
|
|
98
|
+
stream: boolean;
|
|
31
99
|
}
|
|
100
|
+
/** What an `onError` hook receives. */
|
|
101
|
+
export interface FrameworkErrorContext {
|
|
102
|
+
request: Request;
|
|
103
|
+
/** `"request"` for a caller or validation failure, `"provider"` otherwise. */
|
|
104
|
+
phase: "request" | "provider";
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Bounds on what a single request may ask for.
|
|
108
|
+
*
|
|
109
|
+
* The defaults are deliberately generous — no realistic chat request reaches
|
|
110
|
+
* them — so enabling them does not change the behaviour of an existing route,
|
|
111
|
+
* while still bounding the worst case an unauthenticated caller can force.
|
|
112
|
+
*/
|
|
113
|
+
export interface FrameworkHandlerLimits {
|
|
114
|
+
/** Maximum request body size in bytes. Default 1 MiB. */
|
|
115
|
+
maxBodyBytes: number;
|
|
116
|
+
/** Maximum messages in a chat request. Default 200. */
|
|
117
|
+
maxMessages: number;
|
|
118
|
+
/** Maximum tools in a chat request. Default 64. */
|
|
119
|
+
maxTools: number;
|
|
120
|
+
/** Upper clamp applied to `maxSteps`. Default 25. */
|
|
121
|
+
maxStepsClamp: number;
|
|
122
|
+
/** Upper clamp applied to `maxTokens`. Default 32768. */
|
|
123
|
+
maxTokensClamp: number;
|
|
124
|
+
/** Inclusive clamp applied to `temperature`. Default `[0, 2]`. */
|
|
125
|
+
temperatureClamp: [number, number];
|
|
126
|
+
}
|
|
127
|
+
export declare const DEFAULT_HANDLER_LIMITS: Readonly<FrameworkHandlerLimits>;
|
|
32
128
|
/** Resolve a provider spelling to its canonical catalog id. */
|
|
33
129
|
export declare function resolveCatalogProviderId(provider: string): string;
|
|
34
130
|
/**
|
|
@@ -61,17 +157,62 @@ export declare function createFrameworkClientPool(options: {
|
|
|
61
157
|
apiKey?: string;
|
|
62
158
|
client?: HilbrasClient;
|
|
63
159
|
}): FrameworkClientPool;
|
|
160
|
+
/** Merge caller-supplied limits over the defaults. */
|
|
161
|
+
export declare function resolveLimits(overrides?: Partial<FrameworkHandlerLimits>): FrameworkHandlerLimits;
|
|
162
|
+
/**
|
|
163
|
+
* Read the request body as text, rejecting anything over `maxBodyBytes`.
|
|
164
|
+
*
|
|
165
|
+
* `content-length` is consulted first because it is free, but it is only a hint:
|
|
166
|
+
* a request with no header, or a lying one, is still measured by reading the
|
|
167
|
+
* body. The host normally caps `Content-Length` for us, so it cannot be relied
|
|
168
|
+
* on to reject an oversized body before it is buffered.
|
|
169
|
+
*/
|
|
170
|
+
export declare function readBodyText(request: Request, limits?: FrameworkHandlerLimits): Promise<string>;
|
|
64
171
|
/**
|
|
65
|
-
* Read and parse a JSON request body
|
|
172
|
+
* Read and parse a JSON request body, enforcing `maxBodyBytes`.
|
|
66
173
|
*
|
|
67
174
|
* Malformed JSON previously threw a bare `SyntaxError` out of the handler, so
|
|
68
175
|
* the response depended entirely on the host framework's error handling.
|
|
69
176
|
*/
|
|
70
|
-
export declare function readJsonBody(request: Request): Promise<Record<string, unknown>>;
|
|
177
|
+
export declare function readJsonBody(request: Request, limits?: FrameworkHandlerLimits): Promise<Record<string, unknown>>;
|
|
71
178
|
/** Read a required non-empty string field from a parsed body. */
|
|
72
179
|
export declare function requireString(body: Record<string, unknown>, field: string): string;
|
|
73
180
|
/** Read a required array field from a parsed body. */
|
|
74
181
|
export declare function requireArray(body: Record<string, unknown>, field: string): unknown[];
|
|
182
|
+
/**
|
|
183
|
+
* Resolve the fields a chat request may contribute.
|
|
184
|
+
*
|
|
185
|
+
* This is the single place that decides what a caller is allowed to influence,
|
|
186
|
+
* which is why all four chat-shaped handlers share it. `trustClientFields`
|
|
187
|
+
* selects *whether* the body is consulted; the limits bound *how far* it is
|
|
188
|
+
* trusted.
|
|
189
|
+
*/
|
|
190
|
+
export declare function resolveChatFields(body: Record<string, unknown>, options: {
|
|
191
|
+
model: string;
|
|
192
|
+
tools?: Tool[];
|
|
193
|
+
maxSteps?: number;
|
|
194
|
+
trustClientFields: boolean;
|
|
195
|
+
limits: FrameworkHandlerLimits;
|
|
196
|
+
}): Omit<FrameworkEffectiveFields, "provider">;
|
|
197
|
+
/**
|
|
198
|
+
* Resolve the fields a completion request may contribute.
|
|
199
|
+
*
|
|
200
|
+
* `stream` is resolved but not yet acted on: the completion handlers answer with
|
|
201
|
+
* a JSON body either way, so a caller sending `stream: true` is served the same
|
|
202
|
+
* documented shape rather than a half-implemented stream.
|
|
203
|
+
*/
|
|
204
|
+
export declare function resolveCompletionFields(body: Record<string, unknown>, options: {
|
|
205
|
+
model: string;
|
|
206
|
+
trustClientFields: boolean;
|
|
207
|
+
limits: FrameworkHandlerLimits;
|
|
208
|
+
}): Omit<FrameworkEffectiveFields, "provider" | "messages" | "tools" | "maxSteps">;
|
|
209
|
+
/**
|
|
210
|
+
* Classify an error for the `onError` hook.
|
|
211
|
+
*
|
|
212
|
+
* A validation failure — including one raised by `onRequest` — is the caller's
|
|
213
|
+
* fault and is not worth an error-level log; anything else is.
|
|
214
|
+
*/
|
|
215
|
+
export declare function isRequestPhaseError(error: unknown): boolean;
|
|
75
216
|
/**
|
|
76
217
|
* Map a thrown error to an HTTP response.
|
|
77
218
|
*
|
|
@@ -17,6 +17,14 @@
|
|
|
17
17
|
import { HilbrasClient } from "../../client/client.js";
|
|
18
18
|
import { getProviderCatalog, listProviders } from "../../catalog/index.js";
|
|
19
19
|
import { ConfigurationError, RequestValidationError } from "../../errors/index.js";
|
|
20
|
+
export const DEFAULT_HANDLER_LIMITS = Object.freeze({
|
|
21
|
+
maxBodyBytes: 1024 * 1024,
|
|
22
|
+
maxMessages: 200,
|
|
23
|
+
maxTools: 64,
|
|
24
|
+
maxStepsClamp: 25,
|
|
25
|
+
maxTokensClamp: 32768,
|
|
26
|
+
temperatureClamp: [0, 2],
|
|
27
|
+
});
|
|
20
28
|
/** Resolve a provider spelling to its canonical catalog id. */
|
|
21
29
|
export function resolveCatalogProviderId(provider) {
|
|
22
30
|
return (listProviders().find((id) => id.toLowerCase() === provider.toLowerCase()) ?? provider);
|
|
@@ -77,23 +85,63 @@ export function createFrameworkClientPool(options) {
|
|
|
77
85
|
};
|
|
78
86
|
return pool;
|
|
79
87
|
}
|
|
88
|
+
/** Merge caller-supplied limits over the defaults. */
|
|
89
|
+
export function resolveLimits(overrides) {
|
|
90
|
+
if (!overrides)
|
|
91
|
+
return { ...DEFAULT_HANDLER_LIMITS };
|
|
92
|
+
return {
|
|
93
|
+
...DEFAULT_HANDLER_LIMITS,
|
|
94
|
+
...overrides,
|
|
95
|
+
temperatureClamp: [
|
|
96
|
+
overrides.temperatureClamp?.[0] ?? DEFAULT_HANDLER_LIMITS.temperatureClamp[0],
|
|
97
|
+
overrides.temperatureClamp?.[1] ?? DEFAULT_HANDLER_LIMITS.temperatureClamp[1],
|
|
98
|
+
],
|
|
99
|
+
};
|
|
100
|
+
}
|
|
80
101
|
/**
|
|
81
|
-
* Read
|
|
102
|
+
* Read the request body as text, rejecting anything over `maxBodyBytes`.
|
|
82
103
|
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
104
|
+
* `content-length` is consulted first because it is free, but it is only a hint:
|
|
105
|
+
* a request with no header, or a lying one, is still measured by reading the
|
|
106
|
+
* body. The host normally caps `Content-Length` for us, so it cannot be relied
|
|
107
|
+
* on to reject an oversized body before it is buffered.
|
|
85
108
|
*/
|
|
86
|
-
export async function
|
|
109
|
+
export async function readBodyText(request, limits = DEFAULT_HANDLER_LIMITS) {
|
|
110
|
+
const declared = Number(request.headers.get("content-length") ?? Number.NaN);
|
|
111
|
+
if (Number.isFinite(declared) && declared > limits.maxBodyBytes) {
|
|
112
|
+
throw new RequestValidationError(`Request body exceeds the ${limits.maxBodyBytes} byte limit`, "Raise `limits.maxBodyBytes` on the handler factory if this is expected.", 413);
|
|
113
|
+
}
|
|
87
114
|
let raw;
|
|
88
115
|
try {
|
|
89
|
-
|
|
116
|
+
if (typeof request.text === "function") {
|
|
117
|
+
raw = await request.text();
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
raw = new TextDecoder().decode(await request.arrayBuffer());
|
|
121
|
+
}
|
|
90
122
|
}
|
|
91
123
|
catch {
|
|
92
124
|
throw new RequestValidationError("Request body could not be read");
|
|
93
125
|
}
|
|
126
|
+
// `text()` yields a UTF-16 string, so measure the encoded byte length rather
|
|
127
|
+
// than the character count: a body of multi-byte characters has fewer
|
|
128
|
+
// characters than bytes, and comparing lengths would under-count it.
|
|
129
|
+
if (new TextEncoder().encode(raw).byteLength > limits.maxBodyBytes) {
|
|
130
|
+
throw new RequestValidationError(`Request body exceeds the ${limits.maxBodyBytes} byte limit`, "Raise `limits.maxBodyBytes` on the handler factory if this is expected.", 413);
|
|
131
|
+
}
|
|
94
132
|
if (raw.trim().length === 0) {
|
|
95
133
|
throw new RequestValidationError("Request body is empty", "Send a JSON object.");
|
|
96
134
|
}
|
|
135
|
+
return raw;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Read and parse a JSON request body, enforcing `maxBodyBytes`.
|
|
139
|
+
*
|
|
140
|
+
* Malformed JSON previously threw a bare `SyntaxError` out of the handler, so
|
|
141
|
+
* the response depended entirely on the host framework's error handling.
|
|
142
|
+
*/
|
|
143
|
+
export async function readJsonBody(request, limits = DEFAULT_HANDLER_LIMITS) {
|
|
144
|
+
const raw = await readBodyText(request, limits);
|
|
97
145
|
try {
|
|
98
146
|
const parsed = JSON.parse(raw);
|
|
99
147
|
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
@@ -123,6 +171,87 @@ export function requireArray(body, field) {
|
|
|
123
171
|
}
|
|
124
172
|
return value;
|
|
125
173
|
}
|
|
174
|
+
/** Clamp a number into `[min, max]`. */
|
|
175
|
+
function clampNumber(value, min, max) {
|
|
176
|
+
return Math.min(Math.max(value, min), max);
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Resolve the fields a chat request may contribute.
|
|
180
|
+
*
|
|
181
|
+
* This is the single place that decides what a caller is allowed to influence,
|
|
182
|
+
* which is why all four chat-shaped handlers share it. `trustClientFields`
|
|
183
|
+
* selects *whether* the body is consulted; the limits bound *how far* it is
|
|
184
|
+
* trusted.
|
|
185
|
+
*/
|
|
186
|
+
export function resolveChatFields(body, options) {
|
|
187
|
+
const messages = requireArray(body, "messages");
|
|
188
|
+
if (messages.length > options.limits.maxMessages) {
|
|
189
|
+
throw new RequestValidationError(`Request has ${messages.length} messages, exceeding the limit of ${options.limits.maxMessages}`, "Raise `limits.maxMessages` on the handler factory if this is expected.");
|
|
190
|
+
}
|
|
191
|
+
const trust = options.trustClientFields;
|
|
192
|
+
const model = trust && typeof body.model === "string" && body.model.length > 0
|
|
193
|
+
? body.model
|
|
194
|
+
: options.model;
|
|
195
|
+
let tools = options.tools;
|
|
196
|
+
if (tools && tools.length > options.limits.maxTools) {
|
|
197
|
+
throw new RequestValidationError(`Handler is configured with ${tools.length} tools, exceeding the limit of ${options.limits.maxTools}`, "Raise `limits.maxTools` on the handler factory if this is expected.");
|
|
198
|
+
}
|
|
199
|
+
if (trust && Array.isArray(body.tools)) {
|
|
200
|
+
if (body.tools.length > options.limits.maxTools) {
|
|
201
|
+
throw new RequestValidationError(`Request has ${body.tools.length} tools, exceeding the limit of ${options.limits.maxTools}`, "Raise `limits.maxTools` on the handler factory if this is expected.");
|
|
202
|
+
}
|
|
203
|
+
tools = body.tools;
|
|
204
|
+
}
|
|
205
|
+
const [tempMin, tempMax] = options.limits.temperatureClamp;
|
|
206
|
+
const maxStepsRaw = trust && typeof body.maxSteps === "number" ? body.maxSteps : options.maxSteps;
|
|
207
|
+
return {
|
|
208
|
+
model,
|
|
209
|
+
messages,
|
|
210
|
+
tools,
|
|
211
|
+
maxSteps: typeof maxStepsRaw === "number" ? Math.min(maxStepsRaw, options.limits.maxStepsClamp) : undefined,
|
|
212
|
+
maxTokens: trust && typeof body.maxTokens === "number"
|
|
213
|
+
? Math.min(body.maxTokens, options.limits.maxTokensClamp)
|
|
214
|
+
: undefined,
|
|
215
|
+
temperature: trust && typeof body.temperature === "number"
|
|
216
|
+
? clampNumber(body.temperature, tempMin, tempMax)
|
|
217
|
+
: undefined,
|
|
218
|
+
stream: body.stream !== false,
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Resolve the fields a completion request may contribute.
|
|
223
|
+
*
|
|
224
|
+
* `stream` is resolved but not yet acted on: the completion handlers answer with
|
|
225
|
+
* a JSON body either way, so a caller sending `stream: true` is served the same
|
|
226
|
+
* documented shape rather than a half-implemented stream.
|
|
227
|
+
*/
|
|
228
|
+
export function resolveCompletionFields(body, options) {
|
|
229
|
+
const prompt = requireString(body, "prompt");
|
|
230
|
+
const trust = options.trustClientFields;
|
|
231
|
+
const [tempMin, tempMax] = options.limits.temperatureClamp;
|
|
232
|
+
return {
|
|
233
|
+
model: trust && typeof body.model === "string" && body.model.length > 0
|
|
234
|
+
? body.model
|
|
235
|
+
: options.model,
|
|
236
|
+
prompt,
|
|
237
|
+
maxTokens: trust && typeof body.maxTokens === "number"
|
|
238
|
+
? Math.min(body.maxTokens, options.limits.maxTokensClamp)
|
|
239
|
+
: undefined,
|
|
240
|
+
temperature: trust && typeof body.temperature === "number"
|
|
241
|
+
? clampNumber(body.temperature, tempMin, tempMax)
|
|
242
|
+
: undefined,
|
|
243
|
+
stream: body.stream !== false,
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Classify an error for the `onError` hook.
|
|
248
|
+
*
|
|
249
|
+
* A validation failure — including one raised by `onRequest` — is the caller's
|
|
250
|
+
* fault and is not worth an error-level log; anything else is.
|
|
251
|
+
*/
|
|
252
|
+
export function isRequestPhaseError(error) {
|
|
253
|
+
return error instanceof RequestValidationError;
|
|
254
|
+
}
|
|
126
255
|
/**
|
|
127
256
|
* Map a thrown error to an HTTP response.
|
|
128
257
|
*
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hilbras/sdk",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "Provider-agnostic LLM client SDK
|
|
3
|
+
"version": "3.6.0",
|
|
4
|
+
"description": "Provider-agnostic LLM client SDK \u2014 streaming, tool calling, embeddings, image generation, speech synthesis, transcription, reranking, circuit breaker, retry, reasoning normalization, cost enforcement, structured output with schema validation, type-safe tool builder, and SSRF-safe provider registration. Zero runtime dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -167,6 +167,10 @@
|
|
|
167
167
|
"types": "./dist/frameworks/react/index.d.ts",
|
|
168
168
|
"import": "./dist/frameworks/react/index.js"
|
|
169
169
|
},
|
|
170
|
+
"./react-client": {
|
|
171
|
+
"types": "./dist/frameworks/react-client/index.d.ts",
|
|
172
|
+
"import": "./dist/frameworks/react-client/index.js"
|
|
173
|
+
},
|
|
170
174
|
"./vue": {
|
|
171
175
|
"types": "./dist/frameworks/vue/index.d.ts",
|
|
172
176
|
"import": "./dist/frameworks/vue/index.js"
|
|
@@ -191,6 +195,14 @@
|
|
|
191
195
|
"types": "./dist/frameworks/nextjs/index.d.ts",
|
|
192
196
|
"import": "./dist/frameworks/nextjs/index.js"
|
|
193
197
|
},
|
|
198
|
+
"./nextjs/api": {
|
|
199
|
+
"types": "./dist/frameworks/nextjs/api/index.d.ts",
|
|
200
|
+
"import": "./dist/frameworks/nextjs/api/index.js"
|
|
201
|
+
},
|
|
202
|
+
"./nextjs/edge": {
|
|
203
|
+
"types": "./dist/frameworks/nextjs/edge/index.d.ts",
|
|
204
|
+
"import": "./dist/frameworks/nextjs/edge/index.js"
|
|
205
|
+
},
|
|
194
206
|
"./astro": {
|
|
195
207
|
"types": "./dist/frameworks/astro/index.d.ts",
|
|
196
208
|
"import": "./dist/frameworks/astro/index.js"
|
|
@@ -242,7 +254,9 @@
|
|
|
242
254
|
"check:package": "npm run build && node tools/check-package.mjs",
|
|
243
255
|
"test:root": "vitest run",
|
|
244
256
|
"build:packages": "npm run build --workspaces --if-present",
|
|
245
|
-
"test:packages": "npm run build:packages && npm run test --workspace hilbras --workspace create-hilbras-app --workspace @hilbras/
|
|
257
|
+
"test:packages": "npm run build:packages && npm run test --workspace hilbras --workspace create-hilbras-app --workspace @hilbras/ui",
|
|
258
|
+
"check:docs": "bash tools/check-doc-examples.sh",
|
|
259
|
+
"check:subpaths": "node tools/gen-subpath-table.mjs --check"
|
|
246
260
|
},
|
|
247
261
|
"engines": {
|
|
248
262
|
"node": ">=18"
|