@guren/server 2.20.0 → 2.22.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.
Files changed (36) hide show
  1. package/dist/{Logger-DFifRAtc.js → Logger-DWXdtLSJ.js} +62 -2
  2. package/dist/agent/approval-status.d.ts +1 -1
  3. package/dist/agent/approval.d.ts +2 -2
  4. package/dist/agent/audit-emitter.d.ts +11 -1
  5. package/dist/agent/gate.d.ts +10 -8
  6. package/dist/agent/meta-tools.d.ts +13 -5
  7. package/dist/agent/pipeline.d.ts +10 -9
  8. package/dist/auth/index.js +1 -1
  9. package/dist/auth/password/DefaultHasher.d.ts +1 -0
  10. package/dist/{auth-BXcHQwHf.js → auth-CjE2oO50.js} +21 -2
  11. package/dist/cache/index.js +1 -1
  12. package/dist/{cache-DUhlolkJ.js → cache-DikxP7Bk.js} +2 -2
  13. package/dist/container/bindings.d.ts +4 -4
  14. package/dist/http/Application.d.ts +15 -0
  15. package/dist/http/middleware/index.d.ts +1 -1
  16. package/dist/http/middleware/session-manager.d.ts +7 -0
  17. package/dist/i18n/index.js +1 -1
  18. package/dist/index.d.ts +5 -3
  19. package/dist/index.js +628 -413
  20. package/dist/lambda/index.js +1 -1
  21. package/dist/logging/index.js +2 -2
  22. package/dist/{logging-DXmqqUl4.js → logging-Dmzdb6mL.js} +1 -1
  23. package/dist/mvc/Router.d.ts +18 -15
  24. package/dist/mvc/inertia/InertiaEngine.d.ts +6 -0
  25. package/dist/mvc/prototype.d.ts +105 -0
  26. package/dist/runtime/index.js +2 -2
  27. package/dist/storage/index.js +1 -1
  28. package/dist/support/keep-alive.d.ts +26 -0
  29. package/dist/support/request-deferrer.d.ts +10 -0
  30. package/dist/vite/index.js +147 -0
  31. package/dist/vite/plugin.d.ts +39 -0
  32. package/dist/{vite-manifest-BZQ-75hf.js → vite-manifest-D295_7-_.js} +1 -1
  33. package/package.json +5 -4
  34. package/dist/{DocsViewerServiceProvider-D2cuVgtN.js → DocsViewerServiceProvider-DWnlXx_y.js} +1 -1
  35. package/dist/{i18n-Cg1aajRP.js → i18n-BZ2VrSud.js} +1 -1
  36. package/dist/{storage-BB59f07j.js → storage-D_yNe54O.js} +1 -1
@@ -1,5 +1,5 @@
1
- import { r as getJob } from "../Job-CvDwk2Gj.js";
2
1
  import { n as detectServerlessRuntime } from "../serverless-D96rJb6x.js";
2
+ import { r as getJob } from "../Job-CvDwk2Gj.js";
3
3
  import { handle } from "hono/aws-lambda";
4
4
  //#region src/lambda/index.ts
5
5
  /** Create an AWS Lambda handler from an already booted Guren application. */
@@ -1,3 +1,3 @@
1
- import { n as filterSensitiveData, t as Logger } from "../Logger-DFifRAtc.js";
2
- import { a as DailyFileChannel, c as matchDailyFileDate, d as LOG_LEVEL_PRIORITY, i as setLogManager, l as FileChannel, n as createLogManager, o as dailyFileDateStamp, r as getLogManager, s as dailyFilePath, t as LogManager, u as ConsoleChannel } from "../logging-DXmqqUl4.js";
1
+ import { n as filterSensitiveData, t as Logger } from "../Logger-DWXdtLSJ.js";
2
+ import { a as DailyFileChannel, c as matchDailyFileDate, d as LOG_LEVEL_PRIORITY, i as setLogManager, l as FileChannel, n as createLogManager, o as dailyFileDateStamp, r as getLogManager, s as dailyFilePath, t as LogManager, u as ConsoleChannel } from "../logging-Dmzdb6mL.js";
3
3
  export { ConsoleChannel, DailyFileChannel, FileChannel, LOG_LEVEL_PRIORITY, LogManager, Logger, createLogManager, dailyFileDateStamp, dailyFilePath, filterSensitiveData, getLogManager, matchDailyFileDate, setLogManager };
@@ -1,4 +1,4 @@
1
- import { r as isPromiseLike, t as Logger } from "./Logger-DFifRAtc.js";
1
+ import { r as isPromiseLike, t as Logger } from "./Logger-DWXdtLSJ.js";
2
2
  import * as path$1 from "node:path";
3
3
  import * as fs from "node:fs";
4
4
  //#region src/logging/types.ts
@@ -3,6 +3,7 @@ import { Controller } from './Controller.js';
3
3
  import type { Container } from '../container/Container.js';
4
4
  import type { ValidationSchema } from '../http/middleware/validation.js';
5
5
  import { type MiddlewareCapabilities } from '../http/middleware/capabilities.js';
6
+ import { type PrototypeRouteHandler } from './prototype.js';
6
7
  /** Constructor type for Controller classes. */
7
8
  export type ControllerConstructor<T extends Controller = Controller> = (new (...args: any[]) => T) & {
8
9
  inject?: readonly string[];
@@ -17,7 +18,7 @@ export type RouteResult = Response | string | number | boolean | Record<string,
17
18
  * Inline handlers receive `next`, so Hono middleware (e.g.
18
19
  * `broadcast.sseMiddleware()`) can mount directly as a terminal handler.
19
20
  */
20
- export type RouteHandler<C extends ControllerConstructor = ControllerConstructor> = ((c: Context, next: Next) => RouteResult | Promise<RouteResult>) | ControllerAction<C>;
21
+ export type RouteHandler<C extends ControllerConstructor = ControllerConstructor> = ((c: Context, next: Next) => RouteResult | Promise<RouteResult>) | ControllerAction<C> | PrototypeRouteHandler;
21
22
  type ModelBindingResolver = (value: string) => Promise<unknown>;
22
23
  /** Model class with a findOrFail static method. */
23
24
  export interface BindableModel {
@@ -158,6 +159,8 @@ export interface RouteDefinition {
158
159
  bindings?: Record<string, string>;
159
160
  /** Agent metadata as declared (RFC 0016), no defaults applied. Absent: not a tool. */
160
161
  agent?: AgentRouteMetadata;
162
+ /** Still on its fixture (RFC 0021): registered with the `prototype` handler rather than a controller. */
163
+ prototype?: true;
161
164
  summary?: string;
162
165
  description?: string;
163
166
  tags?: string[];
@@ -222,22 +225,22 @@ export declare class Router<M extends string = never> {
222
225
  bind(param: string, modelOrResolver: RouteModelBinding | ModelBindingResolver): this;
223
226
  on<C extends ControllerConstructor>(method: string, path: string, handler: RouteHandler<C>, ...middlewares: MiddlewareHandler[]): RouteBuilder<M>;
224
227
  on<TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(method: string, path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: TypedRouteHandler<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>): RouteBuilder<M>;
225
- on<C extends ControllerConstructor, TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(method: string, path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: ControllerAction<C>): RouteBuilder<M>;
228
+ on<C extends ControllerConstructor, TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(method: string, path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: ControllerAction<C> | PrototypeRouteHandler): RouteBuilder<M>;
226
229
  get<C extends ControllerConstructor>(path: string, handler: RouteHandler<C>, ...middlewares: MiddlewareHandler[]): RouteBuilder<M>;
227
230
  get<TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: TypedRouteHandler<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>): RouteBuilder<M>;
228
- get<C extends ControllerConstructor, TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: ControllerAction<C>): RouteBuilder<M>;
231
+ get<C extends ControllerConstructor, TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: ControllerAction<C> | PrototypeRouteHandler): RouteBuilder<M>;
229
232
  post<C extends ControllerConstructor>(path: string, handler: RouteHandler<C>, ...middlewares: MiddlewareHandler[]): RouteBuilder<M>;
230
233
  post<TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: TypedRouteHandler<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>): RouteBuilder<M>;
231
- post<C extends ControllerConstructor, TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: ControllerAction<C>): RouteBuilder<M>;
234
+ post<C extends ControllerConstructor, TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: ControllerAction<C> | PrototypeRouteHandler): RouteBuilder<M>;
232
235
  put<C extends ControllerConstructor>(path: string, handler: RouteHandler<C>, ...middlewares: MiddlewareHandler[]): RouteBuilder<M>;
233
236
  put<TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: TypedRouteHandler<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>): RouteBuilder<M>;
234
- put<C extends ControllerConstructor, TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: ControllerAction<C>): RouteBuilder<M>;
237
+ put<C extends ControllerConstructor, TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: ControllerAction<C> | PrototypeRouteHandler): RouteBuilder<M>;
235
238
  patch<C extends ControllerConstructor>(path: string, handler: RouteHandler<C>, ...middlewares: MiddlewareHandler[]): RouteBuilder<M>;
236
239
  patch<TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: TypedRouteHandler<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>): RouteBuilder<M>;
237
- patch<C extends ControllerConstructor, TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: ControllerAction<C>): RouteBuilder<M>;
240
+ patch<C extends ControllerConstructor, TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: ControllerAction<C> | PrototypeRouteHandler): RouteBuilder<M>;
238
241
  delete<C extends ControllerConstructor>(path: string, handler: RouteHandler<C>, ...middlewares: MiddlewareHandler[]): RouteBuilder<M>;
239
242
  delete<TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: TypedRouteHandler<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>): RouteBuilder<M>;
240
- delete<C extends ControllerConstructor, TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: ControllerAction<C>): RouteBuilder<M>;
243
+ delete<C extends ControllerConstructor, TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: ControllerAction<C> | PrototypeRouteHandler): RouteBuilder<M>;
241
244
  /**
242
245
  * HTTP QUERY (RFC 10008): safe and idempotent like GET, but carries a body.
243
246
  * Handlers must not mutate state — CSRF protection deliberately skips QUERY
@@ -245,7 +248,7 @@ export declare class Router<M extends string = never> {
245
248
  */
246
249
  query<C extends ControllerConstructor>(path: string, handler: RouteHandler<C>, ...middlewares: MiddlewareHandler[]): RouteBuilder<M>;
247
250
  query<TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: TypedRouteHandler<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>): RouteBuilder<M>;
248
- query<C extends ControllerConstructor, TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: ControllerAction<C>): RouteBuilder<M>;
251
+ query<C extends ControllerConstructor, TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: ControllerAction<C> | PrototypeRouteHandler): RouteBuilder<M>;
249
252
  group(prefix: string, callback: (router: Router<M>) => void): this;
250
253
  route(name: string, params?: Record<string, string | number>): string;
251
254
  hasRoute(name: string): boolean;
@@ -273,24 +276,24 @@ declare class RouterMiddlewareGroupBuilder<M extends string = never> {
273
276
  group(callback: (router: Router<M>) => void): Router<M>;
274
277
  get<C extends ControllerConstructor>(path: string, handler: RouteHandler<C>, ...middlewares: MiddlewareHandler[]): RouteBuilder<M>;
275
278
  get<TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: TypedRouteHandler<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>): RouteBuilder<M>;
276
- get<C extends ControllerConstructor, TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: ControllerAction<C>): RouteBuilder<M>;
279
+ get<C extends ControllerConstructor, TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: ControllerAction<C> | PrototypeRouteHandler): RouteBuilder<M>;
277
280
  post<C extends ControllerConstructor>(path: string, handler: RouteHandler<C>, ...middlewares: MiddlewareHandler[]): RouteBuilder<M>;
278
281
  post<TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: TypedRouteHandler<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>): RouteBuilder<M>;
279
- post<C extends ControllerConstructor, TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: ControllerAction<C>): RouteBuilder<M>;
282
+ post<C extends ControllerConstructor, TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: ControllerAction<C> | PrototypeRouteHandler): RouteBuilder<M>;
280
283
  put<C extends ControllerConstructor>(path: string, handler: RouteHandler<C>, ...middlewares: MiddlewareHandler[]): RouteBuilder<M>;
281
284
  put<TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: TypedRouteHandler<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>): RouteBuilder<M>;
282
- put<C extends ControllerConstructor, TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: ControllerAction<C>): RouteBuilder<M>;
285
+ put<C extends ControllerConstructor, TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: ControllerAction<C> | PrototypeRouteHandler): RouteBuilder<M>;
283
286
  patch<C extends ControllerConstructor>(path: string, handler: RouteHandler<C>, ...middlewares: MiddlewareHandler[]): RouteBuilder<M>;
284
287
  patch<TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: TypedRouteHandler<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>): RouteBuilder<M>;
285
- patch<C extends ControllerConstructor, TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: ControllerAction<C>): RouteBuilder<M>;
288
+ patch<C extends ControllerConstructor, TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: ControllerAction<C> | PrototypeRouteHandler): RouteBuilder<M>;
286
289
  delete<C extends ControllerConstructor>(path: string, handler: RouteHandler<C>, ...middlewares: MiddlewareHandler[]): RouteBuilder<M>;
287
290
  delete<TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: TypedRouteHandler<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>): RouteBuilder<M>;
288
- delete<C extends ControllerConstructor, TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: ControllerAction<C>): RouteBuilder<M>;
291
+ delete<C extends ControllerConstructor, TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: ControllerAction<C> | PrototypeRouteHandler): RouteBuilder<M>;
289
292
  query<C extends ControllerConstructor>(path: string, handler: RouteHandler<C>, ...middlewares: MiddlewareHandler[]): RouteBuilder<M>;
290
293
  query<TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: TypedRouteHandler<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>): RouteBuilder<M>;
291
- query<C extends ControllerConstructor, TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: ControllerAction<C>): RouteBuilder<M>;
294
+ query<C extends ControllerConstructor, TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: ControllerAction<C> | PrototypeRouteHandler): RouteBuilder<M>;
292
295
  on<C extends ControllerConstructor>(method: string, path: string, handler: RouteHandler<C>, ...middlewares: MiddlewareHandler[]): RouteBuilder<M>;
293
296
  on<TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(method: string, path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: TypedRouteHandler<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>): RouteBuilder<M>;
294
- on<C extends ControllerConstructor, TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(method: string, path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: ControllerAction<C>): RouteBuilder<M>;
297
+ on<C extends ControllerConstructor, TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(method: string, path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: ControllerAction<C> | PrototypeRouteHandler): RouteBuilder<M>;
295
298
  }
296
299
  export {};
@@ -33,6 +33,12 @@ export interface InertiaSsrContext {
33
33
  export interface InertiaSsrResult {
34
34
  head: string[];
35
35
  body: string;
36
+ /**
37
+ * True when `body` already carries the page in its `data-page` element, as
38
+ * Inertia's own `createInertiaApp` writes it. Unset, the engine appends its
39
+ * element after the body: a second copy, never a document without a payload.
40
+ */
41
+ pageEmbedded?: boolean;
36
42
  }
37
43
  export type InertiaSsrRenderer = (context: InertiaSsrContext) => Promise<InertiaSsrResult> | InertiaSsrResult;
38
44
  export interface InertiaSsrOptions {
@@ -0,0 +1,105 @@
1
+ /**
2
+ * Server side of prototype mode (RFC 0021 Part 2): a route registered with the
3
+ * `prototype` handler answers from the app's fixture module until a
4
+ * controller replaces it. Development only; `Application` refuses to boot such
5
+ * routes in production without `GUREN_PROTOTYPE_ROUTES=1`. The fixture
6
+ * contract is consumed structurally, so this never imports the client package.
7
+ */
8
+ import type { Context } from 'hono';
9
+ import type { ValidationSchema } from '../http/middleware/validation.js';
10
+ import type { ContainerLike } from '../container/types.js';
11
+ declare const PROTOTYPE_HANDLER: unique symbol;
12
+ /** The branded object `router.get(path, prototype)` registers; never a function, so contract wrapping cannot hide it. */
13
+ export interface PrototypeRouteHandler {
14
+ readonly [PROTOTYPE_HANDLER]: true;
15
+ }
16
+ export declare const prototype: PrototypeRouteHandler;
17
+ export declare function isPrototypeHandler(value: unknown): value is PrototypeRouteHandler;
18
+ export type PrototypeResult = {
19
+ kind: 'page';
20
+ component: string;
21
+ props: Record<string, unknown>;
22
+ } | {
23
+ kind: 'redirect';
24
+ to: string;
25
+ params?: Record<string, string | number>;
26
+ } | {
27
+ kind: 'location';
28
+ url: string;
29
+ } | {
30
+ kind: 'errors';
31
+ errors: Record<string, string>;
32
+ } | {
33
+ kind: 'not-found';
34
+ };
35
+ export interface PrototypeServerContext {
36
+ method: string;
37
+ url: string;
38
+ params: Record<string, string>;
39
+ query: Record<string, unknown>;
40
+ /** The raw request body, as the browser client hands it over; the route's schema has already validated it. */
41
+ body: unknown;
42
+ state: unknown;
43
+ shared: Record<string, unknown>;
44
+ page(contract: {
45
+ id: string;
46
+ component?: string;
47
+ }, props: Record<string, unknown>): PrototypeResult;
48
+ redirect(to: string, params?: Record<string, string | number>): PrototypeResult;
49
+ location(url: string): PrototypeResult;
50
+ /** No error bag: the framework's `ValidationException` has none, so the client-side `bag` is ignored here. */
51
+ errors(errors: Record<string, string>): PrototypeResult;
52
+ notFound(): PrototypeResult;
53
+ flash(key: string, value: unknown): void;
54
+ }
55
+ export type PrototypeServerHandler = (ctx: PrototypeServerContext) => PrototypeResult | Promise<PrototypeResult>;
56
+ /**
57
+ * What `definePrototype()` from `@guren/inertia-client/prototype` produces,
58
+ * seen from the server. Handlers are accepted at `(ctx: never) => unknown`:
59
+ * the client types each one against its own manifest and page contracts,
60
+ * which is contravariant with any concrete context declared here, and the
61
+ * runtime hands over {@link PrototypeServerContext} and checks the result's `kind`.
62
+ */
63
+ export interface PrototypeFixture {
64
+ manifest: Record<string, {
65
+ method: string;
66
+ path: string;
67
+ }>;
68
+ shared?: Record<string, unknown>;
69
+ state?: () => unknown;
70
+ notFoundPage?: {
71
+ id: string;
72
+ component?: string;
73
+ };
74
+ routes: Record<string, ((ctx: never) => unknown) | undefined>;
75
+ }
76
+ export type PrototypeFixtureModule = {
77
+ default: PrototypeFixture;
78
+ } | PrototypeFixture;
79
+ export type PrototypeFixtureLoader = () => Promise<PrototypeFixtureModule>;
80
+ /** Container key the loaded fixture is bound under once `Application` has validated the prototype routes. */
81
+ export declare const PROTOTYPE_FIXTURE_BINDING = "prototype.fixture";
82
+ export declare function loadPrototypeFixture(loader: PrototypeFixtureLoader): Promise<PrototypeFixture>;
83
+ export interface PrototypeRouteLike {
84
+ method: string;
85
+ path: string;
86
+ name?: string;
87
+ schemas?: {
88
+ params?: ValidationSchema<unknown>;
89
+ query?: ValidationSchema<unknown>;
90
+ body?: ValidationSchema<unknown>;
91
+ };
92
+ }
93
+ export interface PrototypeRouteDependencies {
94
+ container?: ContainerLike;
95
+ /** `Router.route()`, for a `redirect()` naming a route. */
96
+ routeUrl(name: string, params?: Record<string, string | number>): string;
97
+ }
98
+ /**
99
+ * The route's handler: the fixture entry for the route name, run against the
100
+ * same context shape the browser client builds. The route contract is enforced
101
+ * first (`params`, `query`, `body`; not `output`, which only a response has), so `guren
102
+ * audit`'s "runtime-enforced" verdict stays true here.
103
+ */
104
+ export declare function createPrototypeRouteHandler(route: PrototypeRouteLike, deps: PrototypeRouteDependencies): (c: Context) => Promise<Response>;
105
+ export {};
@@ -1,10 +1,10 @@
1
1
  import { n as trimTrailingSlashes } from "../trim-slashes-BLY9hKAa.js";
2
+ import { _ as parseImportMap, a as getManifestCss, c as isViteProduction, d as startViteDevServer, f as GUREN_ASCII_ART, h as logDevServerBanner, i as clientManifestCandidates, l as loadViteManifest, o as getManifestFile, r as PUBLIC_ASSETS_URL_PREFIX, u as normalizeDevServerUrl } from "../vite-manifest-D295_7-_.js";
2
3
  import { n as hash } from "../Hash-D2DFd8xX.js";
3
- import { _ as parseImportMap, a as getManifestCss, c as isViteProduction, d as startViteDevServer, f as GUREN_ASCII_ART, h as logDevServerBanner, i as clientManifestCandidates, l as loadViteManifest, o as getManifestFile, r as PUBLIC_ASSETS_URL_PREFIX, u as normalizeDevServerUrl } from "../vite-manifest-BZQ-75hf.js";
4
4
  import { createRequire } from "node:module";
5
- import { realpath } from "node:fs/promises";
6
5
  import { dirname, extname, join, resolve, sep } from "node:path";
7
6
  import { fileURLToPath } from "node:url";
7
+ import { realpath } from "node:fs/promises";
8
8
  import { serveStatic } from "hono/bun";
9
9
  import { getMimeType } from "hono/utils/mime";
10
10
  //#region src/support/contained-path.ts
@@ -1,2 +1,2 @@
1
- import { a as LocalDriver, i as S3Driver, n as createStorageManager, r as MemoryDriver, t as StorageManager } from "../storage-BB59f07j.js";
1
+ import { a as LocalDriver, i as S3Driver, n as createStorageManager, r as MemoryDriver, t as StorageManager } from "../storage-D_yNe54O.js";
2
2
  export { LocalDriver, MemoryDriver, S3Driver, StorageManager, createStorageManager };
@@ -0,0 +1,26 @@
1
+ /**
2
+ * How a best-effort side channel (an audit sink, an approval notification, an
3
+ * async log channel) is invoked so that it can neither fail the call it was
4
+ * only recording nor be lost by the runtime. Three orderings have to hold
5
+ * together, and each is wrong in a way tests off Workers cannot see: a
6
+ * synchronous throw and a rejection both reach `onFailure`; the `.catch` is
7
+ * attached *before* deferring, since `waitUntil` on a rejecting promise raises
8
+ * an unhandled rejection in workerd; and `defer` itself throws there once the
9
+ * response has settled.
10
+ */
11
+ import { type Deferrer } from './request-deferrer.js';
12
+ export type { Deferrer };
13
+ /** One best-effort side channel, as {@link keepAlive} invokes it. */
14
+ export interface BestEffortChannel {
15
+ run: () => void | PromiseLike<unknown>;
16
+ onFailure: (error: unknown) => void;
17
+ /** Completes "<label> could not be deferred", so pass a noun phrase. */
18
+ label: string;
19
+ }
20
+ /**
21
+ * `defer` defaults to the deferrer of the Workers request being served, where
22
+ * an undeferred channel is abandoned with the request context; `waitUntil`
23
+ * keeps it alive past the response. Outside a request, and on every other
24
+ * runtime, there is none and the channel is fire-and-forget.
25
+ */
26
+ export declare function keepAlive(channel: BestEffortChannel, defer?: Deferrer | undefined): void;
@@ -0,0 +1,10 @@
1
+ /** `ExecutionContext.waitUntil`, bound to its context. */
2
+ export type Deferrer = (work: Promise<unknown>) => void;
3
+ /**
4
+ * `ctx` is typed `unknown` because `app.fetch`'s third argument is a cast
5
+ * wherever it arrives from. One without a callable `waitUntil` (every runtime
6
+ * but Workers) enters no scope, so a nested call keeps the outer request's.
7
+ */
8
+ export declare function runInRequestScope<T>(ctx: unknown, fn: () => T): T;
9
+ /** The deferrer of the request this code runs for, when one was entered. */
10
+ export declare function requestDeferrer(): Deferrer | undefined;
@@ -1,5 +1,10 @@
1
1
  import path from "node:path";
2
+ import { existsSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
2
3
  //#region src/vite/plugin.ts
4
+ /** Where the generated shell goes; `.guren/` is already gitignored and codegen-owned. */
5
+ const PROTOTYPE_SHELL_FILE = ".guren/prototype/index.html";
6
+ /** The override a project may ship instead of the generated shell. */
7
+ const PROTOTYPE_SHELL_OVERRIDE = "resources/js/prototype/index.html";
3
8
  const defaultOptions = {
4
9
  appAlias: "@",
5
10
  appDir: ".",
@@ -20,16 +25,149 @@ function gurenVitePlugin(options = {}) {
20
25
  ...defaultOptions,
21
26
  ...options
22
27
  };
28
+ let prototype;
23
29
  return {
24
30
  name: "guren:vite-config",
25
31
  enforce: "pre",
26
32
  config(config, env) {
33
+ if (env?.mode === "prototype") {
34
+ prototype = ensurePrototype(config, resolved);
35
+ return;
36
+ }
37
+ prototype = void 0;
27
38
  ensureDefaults(config, resolved, env);
39
+ },
40
+ configResolved(config) {
41
+ if (prototype) prototype.outDir = path.resolve(config.root ?? prototype.root, config.build?.outDir ?? prototype.outDir);
42
+ },
43
+ configureServer(server) {
44
+ if (!prototype) return;
45
+ const shellPath = prototype.shellPath;
46
+ return () => {
47
+ server.middlewares.use(async (req, res, next) => {
48
+ if (req.method !== "GET" && req.method !== "HEAD") return next();
49
+ if (!String(req.headers.accept ?? "").includes("text/html")) return next();
50
+ const url = req.url ?? "/";
51
+ if (/\.[a-z0-9]+$/iu.test(url.split("?")[0] ?? "")) return next();
52
+ try {
53
+ const html = await server.transformIndexHtml(url, readFileSync(shellPath, "utf8"), req.originalUrl);
54
+ res.setHeader("Content-Type", "text/html; charset=utf-8");
55
+ res.end(html);
56
+ } catch (error) {
57
+ next(error);
58
+ }
59
+ });
60
+ };
61
+ },
62
+ writeBundle() {
63
+ if (prototype) finishPrototypeBuild(prototype);
28
64
  }
29
65
  };
30
66
  }
67
+ /**
68
+ * The prototype branch, taken before the ordinary client defaults so none of
69
+ * `ensureBuild`'s outDir/base/publicDir reasoning applies: there is no server
70
+ * to serve `public/`, no manifest to read, and the entry is an HTML shell.
71
+ */
72
+ function ensurePrototype(config, options) {
73
+ const root = resolveRoot(config.root);
74
+ const prototype = options.prototype ?? {};
75
+ ensureAliases(config, options, root);
76
+ ensureServer(config, options);
77
+ ensurePreview(config, options);
78
+ config.define ??= {};
79
+ config.define["import.meta.env.GUREN_PROTOTYPE"] ??= "true";
80
+ config.appType ??= "custom";
81
+ config.base ??= prototype.base ?? "/";
82
+ if (typeof config.publicDir !== "string") config.publicDir = path.resolve(root, "public");
83
+ const copiedBuildDir = relativeIfInside(path.resolve(root, config.publicDir), resolveBuildOutputDirectory(root, options.outDir));
84
+ config.build ??= {};
85
+ config.build.outDir ??= prototype.outDir ?? "dist/prototype";
86
+ config.build.emptyOutDir ??= true;
87
+ config.build.copyPublicDir = true;
88
+ config.build.manifest ??= false;
89
+ config.build.ssrManifest ??= false;
90
+ const shellPath = resolvePrototypeShell(root, prototype.shell, options.entry);
91
+ config.build.rollupOptions ??= {};
92
+ config.build.rollupOptions.input ??= shellPath;
93
+ const output = normalizeRollupOutput(config.build.rollupOptions.output);
94
+ output.entryFileNames ??= options.entryFileNames;
95
+ output.chunkFileNames ??= options.chunkFileNames;
96
+ output.assetFileNames ??= options.assetFileNames;
97
+ output.manualChunks ??= createDefaultManualChunks(root);
98
+ config.build.rollupOptions.output = output;
99
+ return {
100
+ root,
101
+ outDir: path.resolve(root, config.build.outDir),
102
+ shellPath,
103
+ copiedBuildDir
104
+ };
105
+ }
106
+ function resolvePrototypeShell(root, shell, entry) {
107
+ if (shell) return path.resolve(root, shell);
108
+ const override = path.resolve(root, PROTOTYPE_SHELL_OVERRIDE);
109
+ if (existsSync(override)) return override;
110
+ const generated = path.resolve(root, PROTOTYPE_SHELL_FILE);
111
+ const contents = renderPrototypeShell(entry);
112
+ if (readShell(generated) !== contents) {
113
+ mkdirSync(path.dirname(generated), { recursive: true });
114
+ writeFileSync(generated, contents);
115
+ }
116
+ return generated;
117
+ }
118
+ /** The shell on disk, or null when there is none; read directly so no check-then-read window exists. */
119
+ function readShell(file) {
120
+ try {
121
+ return readFileSync(file, "utf8");
122
+ } catch {
123
+ return null;
124
+ }
125
+ }
126
+ function renderPrototypeShell(entry) {
127
+ return `<!doctype html>
128
+ <html lang="en">
129
+ <head>
130
+ <meta charset="utf-8" />
131
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
132
+ <meta name="robots" content="noindex, nofollow" />
133
+ <title>Prototype</title>
134
+ </head>
135
+ <body>
136
+ <div id="app"></div>
137
+ <script type="module" src="${`/${entry.replace(/^\.?\//u, "")}`}"><\/script>
138
+ </body>
139
+ </html>
140
+ `;
141
+ }
142
+ /**
143
+ * Vite emits an HTML input at its path relative to the root, so the shell
144
+ * lands nested; move it to the top, then add the SPA fallbacks: `404.html`
145
+ * (GitHub Pages) and `_redirects` (Netlify, Cloudflare Pages).
146
+ */
147
+ function finishPrototypeBuild(prototype) {
148
+ const relative = path.relative(prototype.root, prototype.shellPath);
149
+ const nested = path.resolve(prototype.outDir, relative);
150
+ const top = path.resolve(prototype.outDir, "index.html");
151
+ if (nested !== top && existsSync(nested)) {
152
+ renameSync(nested, top);
153
+ const topLevelDir = relative.split(path.sep)[0];
154
+ if (topLevelDir && topLevelDir !== "." && topLevelDir !== "..") rmSync(path.resolve(prototype.outDir, topLevelDir), {
155
+ recursive: true,
156
+ force: true
157
+ });
158
+ }
159
+ if (!existsSync(top)) throw new Error(`Prototype build produced no index.html in ${prototype.outDir}`);
160
+ if (prototype.copiedBuildDir) rmSync(path.resolve(prototype.outDir, prototype.copiedBuildDir), {
161
+ recursive: true,
162
+ force: true
163
+ });
164
+ writeFileSync(path.resolve(prototype.outDir, "404.html"), readFileSync(top));
165
+ writeFileSync(path.resolve(prototype.outDir, "_redirects"), "/* /index.html 200\n");
166
+ }
31
167
  function ensureDefaults(config, options, env) {
32
168
  const root = resolveRoot(config.root);
169
+ config.define ??= {};
170
+ config.define["import.meta.env.GUREN_PROTOTYPE"] ??= "false";
33
171
  ensureAliases(config, options, root);
34
172
  ensureServer(config, options);
35
173
  ensurePreview(config, options);
@@ -88,10 +226,13 @@ function ensureBuild(config, options, root, env) {
88
226
  if (!isSsrBuild && output.manualChunks === void 0) output.manualChunks = createDefaultManualChunks(root);
89
227
  config.build.rollupOptions.output = output;
90
228
  }
229
+ /** `@guren/inertia-client`'s prototype entry (src or dist) and the Hono router it alone imports. */
230
+ const PROTOTYPE_RUNTIME_MODULE = /\/inertia-client\/(?:src|dist)\/prototype(?:-[^/]+)?\.[jt]sx?$|\/node_modules\/hono\/dist\/router\//u;
91
231
  function createDefaultManualChunks(root) {
92
232
  const normalizedRoot = root.replace(/\\/gu, "/");
93
233
  return (id) => {
94
234
  const normalizedId = id.replace(/\\/gu, "/");
235
+ if (PROTOTYPE_RUNTIME_MODULE.test(normalizedId)) return;
95
236
  if (normalizedId.includes("/packages/inertia-client/")) return "inertia-vendor";
96
237
  if (normalizedId.includes("/packages/core/") || normalizedId.includes("/packages/server/") || normalizedId.includes("/packages/orm/")) return "framework-vendor";
97
238
  if (!normalizedId.includes("/node_modules/")) {
@@ -108,6 +249,12 @@ function createDefaultManualChunks(root) {
108
249
  function resolveBuildOutputDirectory(root, outDir) {
109
250
  return path.isAbsolute(outDir) ? outDir : path.resolve(root, outDir);
110
251
  }
252
+ /** The path from `parent` down to `child`, or undefined when `child` is not below it. */
253
+ function relativeIfInside(parent, child) {
254
+ const relative = path.relative(parent, child);
255
+ if (relative === "" || relative.startsWith("..") || path.isAbsolute(relative)) return void 0;
256
+ return relative;
257
+ }
111
258
  function deriveHttpBaseFromOutDir(outDir) {
112
259
  const normalized = outDir.replace(/\\/gu, "/").replace(/^\.\//u, "");
113
260
  if (normalized === "public") return "/public/";
@@ -25,10 +25,49 @@ export interface GurenVitePluginOptions {
25
25
  chunkFileNames?: string;
26
26
  /** Rollup naming pattern for extracted assets (defaults to `[name]-[hash][extname]`). */
27
27
  assetFileNames?: string;
28
+ /** Prototype mode (`vite --mode prototype`, RFC 0021): the static, server-less build. */
29
+ prototype?: GurenPrototypeOptions;
28
30
  }
31
+ export interface GurenPrototypeOptions {
32
+ /** Vite `base` for a build hosted under a subpath (a GitHub project page, a preview URL). Defaults to `/`. */
33
+ base?: string;
34
+ /** Output directory (defaults to `dist/prototype`). */
35
+ outDir?: string;
36
+ /**
37
+ * The HTML shell, relative to the project root. Defaults to
38
+ * `resources/js/prototype/index.html` when that file exists, else a
39
+ * generated shell under `.guren/prototype/`.
40
+ */
41
+ shell?: string;
42
+ }
43
+ /** Where the generated shell goes; `.guren/` is already gitignored and codegen-owned. */
44
+ export declare const PROTOTYPE_SHELL_FILE = ".guren/prototype/index.html";
45
+ /** The override a project may ship instead of the generated shell. */
46
+ export declare const PROTOTYPE_SHELL_OVERRIDE = "resources/js/prototype/index.html";
47
+ export declare const PROTOTYPE_MODE = "prototype";
29
48
  export declare function gurenVitePlugin(options?: GurenVitePluginOptions): {
30
49
  name: string;
31
50
  enforce: 'pre';
32
51
  config(config: Record<string, any>, env: Record<string, any>): void;
52
+ configResolved(config: Record<string, any>): void;
53
+ configureServer(server: ViteDevServerLike): (() => void) | undefined;
54
+ writeBundle(): void;
33
55
  };
56
+ interface ViteDevServerLike {
57
+ middlewares: {
58
+ use(handler: (req: IncomingLike, res: ResponseLike, next: (error?: unknown) => void) => void): void;
59
+ };
60
+ transformIndexHtml(url: string, html: string, originalUrl?: string): Promise<string>;
61
+ }
62
+ interface IncomingLike {
63
+ method?: string;
64
+ url?: string;
65
+ originalUrl?: string;
66
+ headers: Record<string, string | string[] | undefined>;
67
+ }
68
+ interface ResponseLike {
69
+ setHeader(name: string, value: string): void;
70
+ end(body: string): void;
71
+ }
72
+ export declare function renderPrototypeShell(entry: string): string;
34
73
  export default gurenVitePlugin;
@@ -34,7 +34,7 @@ function parseImportMap(value, options = {}) {
34
34
  const DEFAULT_DEV_STYLES_ENTRY = "/resources/css/app.css";
35
35
  //#endregion
36
36
  //#region package.json
37
- var version = "2.20.0";
37
+ var version = "2.22.0";
38
38
  //#endregion
39
39
  //#region src/http/dev-banner.ts
40
40
  figlet.parseFont("Standard", standard);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guren/server",
3
- "version": "2.20.0",
3
+ "version": "2.22.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",
@@ -142,14 +142,14 @@
142
142
  "test": "bun test"
143
143
  },
144
144
  "dependencies": {
145
- "@guren/orm": "^2.7.0",
145
+ "@guren/orm": "^2.8.0",
146
146
  "@modelcontextprotocol/sdk": "^1.30.0",
147
147
  "chalk": "^5.3.0",
148
148
  "consola": "^3.4.2",
149
149
  "figlet": "^1.7.0",
150
- "hono": "^4.13.0",
150
+ "hono": "^4.13.7",
151
151
  "ioredis": "^5.11.1",
152
- "nodemailer": "^9.0.1"
152
+ "nodemailer": "^9.1.1"
153
153
  },
154
154
  "peerDependencies": {
155
155
  "@aws-sdk/client-s3": "^3.0.0",
@@ -176,6 +176,7 @@
176
176
  "@types/ioredis": "^5.0.0",
177
177
  "@types/node": "^20.14.10",
178
178
  "@types/nodemailer": "^8.0.1",
179
+ "miniflare": "5.20260801.1-alpha",
179
180
  "tsdown": "^0.22.14",
180
181
  "typescript": "^7.0.2",
181
182
  "vite": "^8.0.0"
@@ -2,8 +2,8 @@ import { r as ServiceProvider } from "./loopback-guard-DT9gHF0F.js";
2
2
  import { n as createDocsViewerAccessGuard, r as isDocsViewerEnabled, t as DOCS_VIEWER_PATH } from "./endpoint-BXipU2Jj.js";
3
3
  import { createRequire } from "node:module";
4
4
  import { createHash } from "node:crypto";
5
- import { readFile } from "node:fs/promises";
6
5
  import { join } from "node:path";
6
+ import { readFile } from "node:fs/promises";
7
7
  //#region src/docs-viewer/DocsViewerServiceProvider.ts
8
8
  /**
9
9
  * How long a built `data.json` payload answers requests. Longer than the UI's
@@ -1,5 +1,5 @@
1
- import { readFile, readdir } from "node:fs/promises";
2
1
  import { basename, extname, join } from "node:path";
2
+ import { readFile, readdir } from "node:fs/promises";
3
3
  //#region src/i18n/pluralization.ts
4
4
  /**
5
5
  * Default pluralization rules per language, each returning the index of the
@@ -1,6 +1,6 @@
1
1
  import { t as trimSlashes } from "./trim-slashes-BLY9hKAa.js";
2
- import { copyFile, mkdir, open, readFile, readdir, rename, rm, stat, unlink, writeFile } from "node:fs/promises";
3
2
  import { dirname, join, resolve, sep } from "node:path";
3
+ import { copyFile, mkdir, open, readFile, readdir, rename, rm, stat, unlink, writeFile } from "node:fs/promises";
4
4
  import { existsSync } from "node:fs";
5
5
  import { Readable } from "node:stream";
6
6
  //#region src/support/warn-once.ts