@guren/server 2.29.0 → 2.30.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 (32) hide show
  1. package/dist/{Gate-DFiuutZm.js → Gate-COWQbA96.js} +1 -1
  2. package/dist/{Job-DsFMcXVk.js → Job-0Prk8k0z.js} +1 -1
  3. package/dist/{MessageSigner-Bd25ZJAV.js → MessageSigner-DIUT1Yao.js} +4 -2
  4. package/dist/{Resource-ZMJH4lyD.js → Resource-D1tF6Qwp.js} +3 -3
  5. package/dist/auth/index.js +1 -1
  6. package/dist/{auth-DIugW0O-.js → auth-DRMeSwev.js} +1 -1
  7. package/dist/authorization/index.js +2 -2
  8. package/dist/{authorization-DUjeyGWh.js → authorization-DEHuBps5.js} +1 -1
  9. package/dist/broadcasting/index.js +1 -1
  10. package/dist/{broadcasting-N4cRV42s.js → broadcasting-CcevVE5Y.js} +1 -1
  11. package/dist/{default-application-DWwscxfW.js → default-application-s9SE-Er7.js} +1 -1
  12. package/dist/{dev-banner-BAXzolUl.js → dev-banner-Cw8VnH6J.js} +1 -1
  13. package/dist/encryption/index.js +2 -2
  14. package/dist/{encryption-CWK5l22W.js → encryption-BS-FGkqS.js} +2 -2
  15. package/dist/errors/debug-page.d.ts +4 -2
  16. package/dist/events/index.js +1 -1
  17. package/dist/{events-DQavGm8W.js → events-B6gfJkCH.js} +1 -1
  18. package/dist/i18n/index.js +1 -1
  19. package/dist/{i18n-DmMKcbqj.js → i18n-BShPpJZa.js} +1 -1
  20. package/dist/index.js +337 -286
  21. package/dist/internal/testing.js +1 -1
  22. package/dist/lambda/index.js +1 -1
  23. package/dist/logging/index.js +1 -1
  24. package/dist/{logging-Ci0mBk5k.js → logging-Br9bZlaG.js} +1 -1
  25. package/dist/mail/index.js +1 -1
  26. package/dist/{mail-CI2Kfe8P.js → mail-BQ2y2U5c.js} +2 -2
  27. package/dist/notifications/index.js +1 -1
  28. package/dist/{notifications-Bp2uamzD.js → notifications-R7Uj-aT7.js} +2 -2
  29. package/dist/queue/index.js +2 -2
  30. package/dist/{queue-C8s3buYz.js → queue-jvxB1MFh.js} +1 -1
  31. package/dist/runtime/index.js +1 -1
  32. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
1
  import { t as HttpException } from "./HttpException-BlQ2yEmT.js";
2
- import { h as warnDeprecatedSetter, i as bindAmbient, m as warnDeprecatedGetter, n as ambientBinding } from "./default-application-DWwscxfW.js";
2
+ import { g as warnDeprecatedSetter, h as warnDeprecatedGetter, i as bindAmbient, n as ambientBinding } from "./default-application-s9SE-Er7.js";
3
3
  import { r as getAuthContext } from "./context-af2n5abO.js";
4
4
  //#region src/errors/exceptions/AuthorizationException.ts
5
5
  /** 403: the user is authenticated but not allowed to perform the action. */
@@ -1,6 +1,6 @@
1
1
  import { t as resolveOptional } from "./resolve-optional-ax6gPWTp.js";
2
2
  import { t as warnOnce } from "./warn-once-p-IlMjra.js";
3
- import { h as warnDeprecatedSetter, m as warnDeprecatedGetter, n as ambientBinding, o as defaultContainer, r as ambientContainer } from "./default-application-DWwscxfW.js";
3
+ import { g as warnDeprecatedSetter, h as warnDeprecatedGetter, n as ambientBinding, o as defaultContainer, r as ambientContainer } from "./default-application-s9SE-Er7.js";
4
4
  import { randomBytes } from "node:crypto";
5
5
  //#region src/support/registry-collision.ts
6
6
  const ADVICE = {
@@ -75,8 +75,10 @@ var MessageSigner = class {
75
75
  return `${encodedPayload}.${createSignature(encodedPayload, this.keyring.current)}`;
76
76
  }
77
77
  verify(token, options = {}) {
78
- const [encodedPayload, signature, extra] = token.split(".");
79
- if (!encodedPayload || !signature || extra) return null;
78
+ const segments = token.split(".");
79
+ if (segments.length !== 2) return null;
80
+ const [encodedPayload, signature] = segments;
81
+ if (!encodedPayload || !signature) return null;
80
82
  if (![this.keyring.current, ...this.keyring.previous].some((key) => signaturesMatch(signature, createSignature(encodedPayload, key)))) return null;
81
83
  let payload;
82
84
  try {
@@ -3,13 +3,13 @@ import { n as getValidatedInput, r as readValidatedInput } from "./validated-inp
3
3
  import { n as ValidationException } from "./errors-JpkcCjjn.js";
4
4
  import { n as parseImportMap, t as DEFAULT_DEV_STYLES_ENTRY } from "./inertia-defaults-BjrcT7za.js";
5
5
  import { t as resolveOptional } from "./resolve-optional-ax6gPWTp.js";
6
- import { h as warnDeprecatedSetter, m as warnDeprecatedGetter } from "./default-application-DWwscxfW.js";
6
+ import { g as warnDeprecatedSetter, h as warnDeprecatedGetter } from "./default-application-s9SE-Er7.js";
7
7
  import { n as ServiceProvider } from "./ServiceProvider-G0YclITd.js";
8
8
  import { r as getAuthContext } from "./context-af2n5abO.js";
9
9
  import { o as getApiTokenOrFail } from "./api-token-BbgDEd6j.js";
10
- import { a as resolveI18n } from "./i18n-DmMKcbqj.js";
10
+ import { a as resolveI18n } from "./i18n-BShPpJZa.js";
11
11
  import { r as tryGetRequestContainer } from "./request-container-BbuH0JJy.js";
12
- import { d as resolveGate } from "./Gate-DFiuutZm.js";
12
+ import { d as resolveGate } from "./Gate-COWQbA96.js";
13
13
  import { t as jsx_runtime_exports } from "./jsx-runtime.js";
14
14
  import { getCookie } from "hono/cookie";
15
15
  import { isAbsolute, resolve } from "node:path";
@@ -1,3 +1,3 @@
1
- import { A as verifyOAuthState, B as ModelUserProvider, C as createGoogleOAuthProviderConfig, D as fetchOAuthUserProfile, E as exchangeOAuthCode, H as NodeHasher, I as AuthManager, O as parseOAuthRedirectUrl, R as TokenGuard, S as createGitHubOAuthProviderConfig, T as createOAuthState, U as ScryptHasher, W as BaseUserProvider, _ as OAUTH_SESSION_BINDING_KEY, a as isEmailVerified, b as buildOAuthRedirectUrl, c as verifyEmailToken, d as completePasswordReset, f as createPasswordResetToken, g as MemoryOAuthStateStore, h as AuthenticatableModel, i as createEmailVerificationToken, k as sanitizeOAuthRedirect, l as MemoryPasswordResetStore, m as verifyPasswordResetToken, n as buildVerificationUrl, o as parseVerificationUrl, p as parsePasswordResetUrl, r as completeEmailVerification, s as requireVerifiedEmail, t as MemoryEmailVerificationStore, u as buildPasswordResetUrl, v as OAuthManager, w as createOAuthManager, x as createDiscordOAuthProviderConfig, y as buildOAuthAuthorizeUrl, z as SessionGuard } from "../auth-DIugW0O-.js";
1
+ import { A as verifyOAuthState, B as ModelUserProvider, C as createGoogleOAuthProviderConfig, D as fetchOAuthUserProfile, E as exchangeOAuthCode, H as NodeHasher, I as AuthManager, O as parseOAuthRedirectUrl, R as TokenGuard, S as createGitHubOAuthProviderConfig, T as createOAuthState, U as ScryptHasher, W as BaseUserProvider, _ as OAUTH_SESSION_BINDING_KEY, a as isEmailVerified, b as buildOAuthRedirectUrl, c as verifyEmailToken, d as completePasswordReset, f as createPasswordResetToken, g as MemoryOAuthStateStore, h as AuthenticatableModel, i as createEmailVerificationToken, k as sanitizeOAuthRedirect, l as MemoryPasswordResetStore, m as verifyPasswordResetToken, n as buildVerificationUrl, o as parseVerificationUrl, p as parsePasswordResetUrl, r as completeEmailVerification, s as requireVerifiedEmail, t as MemoryEmailVerificationStore, u as buildPasswordResetUrl, v as OAuthManager, w as createOAuthManager, x as createDiscordOAuthProviderConfig, y as buildOAuthAuthorizeUrl, z as SessionGuard } from "../auth-DRMeSwev.js";
2
2
  import { C as secureCompare, S as parseTokenUrl, _ as verifyApiToken, a as getApiToken, b as generateToken, d as revokeAllApiTokens, f as revokeApiToken, g as tokenCanAny, h as tokenCanAll, i as createBearerTokenMiddleware, l as parseApiToken, m as tokenCan, n as MemoryApiTokenStore, o as getApiTokenOrFail, r as createApiToken, s as getUserApiTokens, t as API_TOKEN_KEY, u as readBearerToken, v as buildTokenUrl, w as secureStringCompare, x as hashToken, y as generateId } from "../api-token-BbgDEd6j.js";
3
3
  export { API_TOKEN_KEY, ScryptHasher as Argon2Hasher, ScryptHasher, AuthManager, AuthenticatableModel, BaseUserProvider, MemoryApiTokenStore, MemoryEmailVerificationStore, MemoryOAuthStateStore, MemoryPasswordResetStore, ModelUserProvider, NodeHasher, OAUTH_SESSION_BINDING_KEY, OAuthManager, SessionGuard, TokenGuard, buildOAuthAuthorizeUrl, buildOAuthRedirectUrl, buildPasswordResetUrl, buildTokenUrl, buildVerificationUrl, completeEmailVerification, completePasswordReset, createApiToken, createBearerTokenMiddleware, createDiscordOAuthProviderConfig, createEmailVerificationToken, createGitHubOAuthProviderConfig, createGoogleOAuthProviderConfig, createOAuthManager, createOAuthState, createPasswordResetToken, exchangeOAuthCode, fetchOAuthUserProfile, generateId, generateToken, getApiToken, getApiTokenOrFail, getUserApiTokens, hashToken, isEmailVerified, parseApiToken, parseOAuthRedirectUrl, parsePasswordResetUrl, parseTokenUrl, parseVerificationUrl, readBearerToken, requireVerifiedEmail, revokeAllApiTokens, revokeApiToken, sanitizeOAuthRedirect, secureCompare, secureStringCompare, tokenCan, tokenCanAll, tokenCanAny, verifyApiToken, verifyEmailToken, verifyOAuthState, verifyPasswordResetToken };
@@ -1,4 +1,4 @@
1
- import { o as getAppKeyringFromEnv, r as deriveAppKeyring, t as MessageSigner } from "./MessageSigner-Bd25ZJAV.js";
1
+ import { o as getAppKeyringFromEnv, r as deriveAppKeyring, t as MessageSigner } from "./MessageSigner-DIUT1Yao.js";
2
2
  import { n as detectServerlessRuntime, t as SERVERLESS_RUNTIME_LABELS } from "./serverless-D96rJb6x.js";
3
3
  import { a as setResolvedPrincipal, i as getResolvedPrincipal, o as AuthenticationException, r as getAuthContext } from "./context-af2n5abO.js";
4
4
  import { d as verifyPassword, o as needsRehash, r as hashPassword } from "./Hash-D2DFd8xX.js";
@@ -1,3 +1,3 @@
1
- import { a as withAuthorization, n as authorizeMiddleware, o as Policy, r as authorizeResourceMiddleware, s as definePolicy, t as authorizeAllMiddleware } from "../authorization-DUjeyGWh.js";
2
- import { a as cannot, f as setGate, i as can, l as getGate, n as Response, o as createGate, r as authorize, s as defineGate, t as Gate, u as isAuthorizationResponse } from "../Gate-DFiuutZm.js";
1
+ import { a as withAuthorization, n as authorizeMiddleware, o as Policy, r as authorizeResourceMiddleware, s as definePolicy, t as authorizeAllMiddleware } from "../authorization-DEHuBps5.js";
2
+ import { a as cannot, f as setGate, i as can, l as getGate, n as Response, o as createGate, r as authorize, s as defineGate, t as Gate, u as isAuthorizationResponse } from "../Gate-COWQbA96.js";
3
3
  export { Gate, Policy, Response, authorize, authorizeAllMiddleware, authorizeMiddleware, authorizeResourceMiddleware, can, cannot, createGate, defineGate, definePolicy, getGate, isAuthorizationResponse, setGate, withAuthorization };
@@ -1,5 +1,5 @@
1
1
  import { r as tryGetRequestContainer } from "./request-container-BbuH0JJy.js";
2
- import { c as denialToException, d as resolveGate, n as Response, p as AuthorizationException } from "./Gate-DFiuutZm.js";
2
+ import { c as denialToException, d as resolveGate, n as Response, p as AuthorizationException } from "./Gate-COWQbA96.js";
3
3
  //#region src/http/middleware/capabilities.ts
4
4
  /**
5
5
  * Internal security-capability marker (RFC 0007): built-in middleware
@@ -1,2 +1,2 @@
1
- import { a as setBroadcastManager, c as PresenceChannel, i as getBroadcastManager, l as PrivateChannel, n as BroadcastManager, o as RedisDriver, r as createBroadcastManager, s as MemoryDriver, t as createTypedBroadcaster, u as Channel } from "../broadcasting-N4cRV42s.js";
1
+ import { a as setBroadcastManager, c as PresenceChannel, i as getBroadcastManager, l as PrivateChannel, n as BroadcastManager, o as RedisDriver, r as createBroadcastManager, s as MemoryDriver, t as createTypedBroadcaster, u as Channel } from "../broadcasting-CcevVE5Y.js";
2
2
  export { BroadcastManager, Channel, MemoryDriver, PresenceChannel, PrivateChannel, RedisDriver, createBroadcastManager, createTypedBroadcaster, getBroadcastManager, setBroadcastManager };
@@ -1,5 +1,5 @@
1
1
  import { a as parseRequestPayload, t as asRecord } from "./request-CLOYytGP.js";
2
- import { h as warnDeprecatedSetter, i as bindAmbient, m as warnDeprecatedGetter, n as ambientBinding } from "./default-application-DWwscxfW.js";
2
+ import { g as warnDeprecatedSetter, h as warnDeprecatedGetter, i as bindAmbient, n as ambientBinding } from "./default-application-s9SE-Er7.js";
3
3
  import { r as getAuthContext } from "./context-af2n5abO.js";
4
4
  import { n as isHotReloadRuntime, t as claimHotDisposable } from "./hot-disposables-W2fH-GID.js";
5
5
  import { c as randomHex } from "./Random-S0OvCuR8.js";
@@ -348,4 +348,4 @@ function warnIfAmbiguous() {
348
348
  if (ambiguous) warnOnce("ambient-application-ambiguous", AMBIGUOUS_WARNING);
349
349
  }
350
350
  //#endregion
351
- export { defaultApplication as a, resolve as c, createContainer as d, getContainer as f, warnDeprecatedSetter as h, bindAmbient as i, useAsDefaultApplication as l, warnDeprecatedGetter as m, ambientBinding as n, defaultContainer as o, setContainer as p, ambientContainer as r, resetDefaultApplication as s, adoptDefaultApplication as t, Container as u };
351
+ export { defaultApplication as a, resolve as c, createContainer as d, getContainer as f, warnDeprecatedSetter as g, warnDeprecatedGetter as h, bindAmbient as i, useAsDefaultApplication as l, warnDeprecated as m, ambientBinding as n, defaultContainer as o, setContainer as p, ambientContainer as r, resetDefaultApplication as s, adoptDefaultApplication as t, Container as u };
@@ -4,7 +4,7 @@ import chalk from "chalk";
4
4
  import figlet from "figlet";
5
5
  import standard from "figlet/importable-fonts/Standard.js";
6
6
  //#region package.json
7
- var version = "2.29.0";
7
+ var version = "2.30.0";
8
8
  //#endregion
9
9
  //#region src/http/dev-banner.ts
10
10
  var dev_banner_exports = /* @__PURE__ */ __exportAll({
@@ -1,5 +1,5 @@
1
- import { a as generateAppKey, c as parseAppKey, i as encodeDerivedKey, l as parsePreviousAppKeys, n as deriveAppKey, o as getAppKeyringFromEnv, r as deriveAppKeyring, s as normalizeAppKey, t as MessageSigner } from "../MessageSigner-Bd25ZJAV.js";
1
+ import { a as generateAppKey, c as parseAppKey, i as encodeDerivedKey, l as parsePreviousAppKeys, n as deriveAppKey, o as getAppKeyringFromEnv, r as deriveAppKeyring, s as normalizeAppKey, t as MessageSigner } from "../MessageSigner-DIUT1Yao.js";
2
2
  import { a as md5, c as sha256, d as verifyPassword, i as hmac, l as sha512, n as hash, o as needsRehash, r as hashPassword, s as secureCompare, t as check, u as verifyHmac } from "../Hash-D2DFd8xX.js";
3
3
  import { a as random, c as randomHex, d as sample, f as shuffle, i as pick, l as randomInt, m as uuid, n as generatePassword, o as randomBase64, p as urlSafeToken, r as generateSlug, s as randomBase64Url, t as generateOtp, u as randomString } from "../Random-S0OvCuR8.js";
4
- import { a as decrypt, c as getEncrypter, i as createEncrypter, l as setEncrypter, n as verifySignedUrl, o as encrypt, r as Encrypter, s as generateKey, t as signUrl } from "../encryption-CWK5l22W.js";
4
+ import { a as decrypt, c as getEncrypter, i as createEncrypter, l as setEncrypter, n as verifySignedUrl, o as encrypt, r as Encrypter, s as generateKey, t as signUrl } from "../encryption-BS-FGkqS.js";
5
5
  export { Encrypter, MessageSigner, check, createEncrypter, decrypt, deriveAppKey, deriveAppKeyring, encodeDerivedKey, encrypt, generateAppKey, generateKey, generateOtp, generatePassword, generateSlug, getAppKeyringFromEnv, getEncrypter, hash, hashPassword, hmac, md5, needsRehash, normalizeAppKey, parseAppKey, parsePreviousAppKeys, pick, random, randomBase64, randomBase64Url, randomHex, randomInt, randomString, sample, secureCompare, setEncrypter, sha256, sha512, shuffle, signUrl, urlSafeToken, uuid, verifyHmac, verifyPassword, verifySignedUrl };
@@ -1,5 +1,5 @@
1
- import { a as generateAppKey, s as normalizeAppKey, t as MessageSigner } from "./MessageSigner-Bd25ZJAV.js";
2
- import { h as warnDeprecatedSetter, i as bindAmbient, m as warnDeprecatedGetter, n as ambientBinding } from "./default-application-DWwscxfW.js";
1
+ import { a as generateAppKey, s as normalizeAppKey, t as MessageSigner } from "./MessageSigner-DIUT1Yao.js";
2
+ import { g as warnDeprecatedSetter, h as warnDeprecatedGetter, i as bindAmbient, n as ambientBinding } from "./default-application-s9SE-Er7.js";
3
3
  import { createCipheriv, createDecipheriv, createHmac, randomBytes } from "crypto";
4
4
  //#region src/encryption/Encrypter.ts
5
5
  /**
@@ -2,7 +2,9 @@ import type { MiddlewareHandler } from 'hono';
2
2
  /** Development-only error page: exposes the stack trace and request details. */
3
3
  export declare function renderDebugPage(error: Error, request?: Request): string;
4
4
  /**
5
- * Renders a debug page in development; in production the error is re-thrown for
6
- * the ExceptionHandler.
5
+ * @deprecated since 2.30.0, removed in 3.0.0. The ExceptionHandler renders this
6
+ * page itself for a browser request while debug details are on. Hono hands a
7
+ * handler's error to the app's `onError` where it is thrown, so this `catch`
8
+ * never sees one in a Guren app.
7
9
  */
8
10
  export declare function debugErrorMiddleware(): MiddlewareHandler;
@@ -1,2 +1,2 @@
1
- import { a as RequestFinished, c as UserLoggedOut, d as EventManager, f as createEventManager, i as JobProcessed, l as createQueueEventDispatcher, n as ApplicationStarted, o as RequestReceived, p as Event, r as JobFailed, s as UserAuthenticated, t as ApplicationShutdown, u as Listener } from "../events-DQavGm8W.js";
1
+ import { a as RequestFinished, c as UserLoggedOut, d as EventManager, f as createEventManager, i as JobProcessed, l as createQueueEventDispatcher, n as ApplicationStarted, o as RequestReceived, p as Event, r as JobFailed, s as UserAuthenticated, t as ApplicationShutdown, u as Listener } from "../events-B6gfJkCH.js";
2
2
  export { ApplicationShutdown, ApplicationStarted, Event, EventManager, JobFailed, JobProcessed, Listener, RequestFinished, RequestReceived, UserAuthenticated, UserLoggedOut, createEventManager, createQueueEventDispatcher };
@@ -1,5 +1,5 @@
1
1
  import { t as warnOnce } from "./warn-once-p-IlMjra.js";
2
- import { d as resolveQueueDriver, l as registerJob, p as reportRegistryCollision, t as Job } from "./Job-DsFMcXVk.js";
2
+ import { d as resolveQueueDriver, l as registerJob, p as reportRegistryCollision, t as Job } from "./Job-0Prk8k0z.js";
3
3
  //#region src/events/Event.ts
4
4
  /** Base class for all application events. */
5
5
  var Event = class {
@@ -1,2 +1,2 @@
1
- import { a as resolveI18n, c as tc, d as Translator, f as getPluralizationRule, i as getI18n, l as tryGetI18n, m as selectPluralForm, n as I18nManager, o as setI18n, p as pluralizationRules, r as createI18n, s as t, t as MemoryLoader, u as JsonLoader } from "../i18n-DmMKcbqj.js";
1
+ import { a as resolveI18n, c as tc, d as Translator, f as getPluralizationRule, i as getI18n, l as tryGetI18n, m as selectPluralForm, n as I18nManager, o as setI18n, p as pluralizationRules, r as createI18n, s as t, t as MemoryLoader, u as JsonLoader } from "../i18n-BShPpJZa.js";
2
2
  export { I18nManager, JsonLoader, MemoryLoader, Translator, createI18n, getI18n, getPluralizationRule, pluralizationRules, resolveI18n, selectPluralForm, setI18n, t, tc, tryGetI18n };
@@ -1,4 +1,4 @@
1
- import { h as warnDeprecatedSetter, i as bindAmbient, m as warnDeprecatedGetter, n as ambientBinding } from "./default-application-DWwscxfW.js";
1
+ import { g as warnDeprecatedSetter, h as warnDeprecatedGetter, i as bindAmbient, n as ambientBinding } from "./default-application-s9SE-Er7.js";
2
2
  import { basename, extname, join } from "node:path";
3
3
  import { readFile, readdir } from "node:fs/promises";
4
4
  //#region src/i18n/pluralization.ts
package/dist/index.js CHANGED
@@ -1,18 +1,18 @@
1
- import { C as setInertiaSsrRenderer, D as isDeferredProp, E as isAlwaysProp, O as ensureErrorStackTracePolyfill, S as setInertiaDocument, T as defer, a as renderDocument, b as inertia, c as getRequestLocale, d as mountModuleRoutes, f as definePlugin, g as shareInertiaProps, h as setInertiaSharedProps, i as Controller, l as getRequestTranslator, m as resolveSharedInertiaProps, n as Resource, o as LOCALE_CONTEXT_KEY, p as getInertiaSharedPropsResolver, r as collect, s as detectLocaleMiddleware, t as JsonResource, u as defineModule, w as always } from "./Resource-ZMJH4lyD.js";
1
+ import { C as setInertiaSsrRenderer, D as isDeferredProp, E as isAlwaysProp, O as ensureErrorStackTracePolyfill, S as setInertiaDocument, T as defer, a as renderDocument, b as inertia, c as getRequestLocale, d as mountModuleRoutes, f as definePlugin, g as shareInertiaProps, h as setInertiaSharedProps, i as Controller, l as getRequestTranslator, m as resolveSharedInertiaProps, n as Resource, o as LOCALE_CONTEXT_KEY, p as getInertiaSharedPropsResolver, r as collect, s as detectLocaleMiddleware, t as JsonResource, u as defineModule, w as always } from "./Resource-D1tF6Qwp.js";
2
2
  import { a as parseRequestPayload, i as parseRequestBody, n as flattenRequestQueries, r as formatValidationErrors } from "./request-CLOYytGP.js";
3
3
  import { i as setValidatedInput, n as getValidatedInput } from "./validated-input-D84J8wcC.js";
4
4
  import { t as HttpException } from "./HttpException-BlQ2yEmT.js";
5
5
  import { n as ValidationException } from "./errors-JpkcCjjn.js";
6
- import { a as withAuthorization, c as capabilitiesOf, i as derivableAbility, l as mergeCapabilities, n as authorizeMiddleware, o as Policy, r as authorizeResourceMiddleware, s as definePolicy, t as authorizeAllMiddleware, u as stampCapabilities } from "./authorization-DUjeyGWh.js";
6
+ import { a as withAuthorization, c as capabilitiesOf, i as derivableAbility, l as mergeCapabilities, n as authorizeMiddleware, o as Policy, r as authorizeResourceMiddleware, s as definePolicy, t as authorizeAllMiddleware, u as stampCapabilities } from "./authorization-DEHuBps5.js";
7
7
  import { a as mapToolResponse, c as AGENT_PREFLIGHT_VERDICT_HEADER, i as describeBuildFailure, n as advertisesStructuredOutput, o as isDispatchedToolRequest, r as buildToolRequest, t as PREFLIGHT_ARGUMENT } from "./dispatch-ENWpBxbE.js";
8
8
  import { i as trimSlashes } from "./contained-path-BkNSBljW.js";
9
9
  import { PATH_PARAM_PATTERN, extractPathParamNames } from "./internal/route-path.js";
10
- import { a as generateAppKey, c as parseAppKey, i as encodeDerivedKey, l as parsePreviousAppKeys, n as deriveAppKey, o as getAppKeyringFromEnv, r as deriveAppKeyring, s as normalizeAppKey, t as MessageSigner } from "./MessageSigner-Bd25ZJAV.js";
10
+ import { a as generateAppKey, c as parseAppKey, i as encodeDerivedKey, l as parsePreviousAppKeys, n as deriveAppKey, o as getAppKeyringFromEnv, r as deriveAppKeyring, s as normalizeAppKey, t as MessageSigner } from "./MessageSigner-DIUT1Yao.js";
11
11
  import { n as detectServerlessRuntime, t as SERVERLESS_RUNTIME_LABELS } from "./serverless-D96rJb6x.js";
12
- import { A as verifyOAuthState, B as ModelUserProvider, C as createGoogleOAuthProviderConfig, D as fetchOAuthUserProfile, E as exchangeOAuthCode, F as normalizeRedirectTarget, G as installAgentPrincipal, H as NodeHasher, I as AuthManager, J as createSessionMiddleware, K as readAgentPrincipal, L as DEFAULT_PROVIDER, M as jsonResponse, N as hostMatchesAllowlist, O as parseOAuthRedirectUrl, P as isAppRelativePath, R as TokenGuard, S as createGitHubOAuthProviderConfig, T as createOAuthState, U as ScryptHasher, V as DefaultHasher, W as BaseUserProvider, X as getSessionFromContext, Y as defaultCookieSecure, _ as OAUTH_SESSION_BINDING_KEY, a as isEmailVerified, b as buildOAuthRedirectUrl, c as verifyEmailToken, d as completePasswordReset, f as createPasswordResetToken, g as MemoryOAuthStateStore, h as AuthenticatableModel, i as createEmailVerificationToken, j as defineMiddleware, k as sanitizeOAuthRedirect, l as MemoryPasswordResetStore, m as verifyPasswordResetToken, n as buildVerificationUrl, o as parseVerificationUrl, p as parsePasswordResetUrl, q as MemorySessionStore, r as completeEmailVerification, s as requireVerifiedEmail, t as MemoryEmailVerificationStore, u as buildPasswordResetUrl, v as OAuthManager, w as createOAuthManager, x as createDiscordOAuthProviderConfig, y as buildOAuthAuthorizeUrl, z as SessionGuard } from "./auth-DIugW0O-.js";
12
+ import { A as verifyOAuthState, B as ModelUserProvider, C as createGoogleOAuthProviderConfig, D as fetchOAuthUserProfile, E as exchangeOAuthCode, F as normalizeRedirectTarget, G as installAgentPrincipal, H as NodeHasher, I as AuthManager, J as createSessionMiddleware, K as readAgentPrincipal, L as DEFAULT_PROVIDER, M as jsonResponse, N as hostMatchesAllowlist, O as parseOAuthRedirectUrl, P as isAppRelativePath, R as TokenGuard, S as createGitHubOAuthProviderConfig, T as createOAuthState, U as ScryptHasher, V as DefaultHasher, W as BaseUserProvider, X as getSessionFromContext, Y as defaultCookieSecure, _ as OAUTH_SESSION_BINDING_KEY, a as isEmailVerified, b as buildOAuthRedirectUrl, c as verifyEmailToken, d as completePasswordReset, f as createPasswordResetToken, g as MemoryOAuthStateStore, h as AuthenticatableModel, i as createEmailVerificationToken, j as defineMiddleware, k as sanitizeOAuthRedirect, l as MemoryPasswordResetStore, m as verifyPasswordResetToken, n as buildVerificationUrl, o as parseVerificationUrl, p as parsePasswordResetUrl, q as MemorySessionStore, r as completeEmailVerification, s as requireVerifiedEmail, t as MemoryEmailVerificationStore, u as buildPasswordResetUrl, v as OAuthManager, w as createOAuthManager, x as createDiscordOAuthProviderConfig, y as buildOAuthAuthorizeUrl, z as SessionGuard } from "./auth-DRMeSwev.js";
13
13
  import { t as resolveOptional } from "./resolve-optional-ax6gPWTp.js";
14
14
  import { t as warnOnce } from "./warn-once-p-IlMjra.js";
15
- import { a as defaultApplication, c as resolve, d as createContainer, f as getContainer, h as warnDeprecatedSetter, i as bindAmbient, l as useAsDefaultApplication, m as warnDeprecatedGetter, n as ambientBinding, o as defaultContainer, p as setContainer, r as ambientContainer, s as resetDefaultApplication, t as adoptDefaultApplication, u as Container } from "./default-application-DWwscxfW.js";
15
+ import { a as defaultApplication, c as resolve, d as createContainer, f as getContainer, g as warnDeprecatedSetter, h as warnDeprecatedGetter, i as bindAmbient, l as useAsDefaultApplication, m as warnDeprecated, n as ambientBinding, o as defaultContainer, p as setContainer, r as ambientContainer, s as resetDefaultApplication, t as adoptDefaultApplication, u as Container } from "./default-application-s9SE-Er7.js";
16
16
  import { n as ServiceProvider, t as ProviderManager } from "./ServiceProvider-G0YclITd.js";
17
17
  import { o as AuthenticationException, r as getAuthContext, t as AUTH_CONTEXT_KEY } from "./context-af2n5abO.js";
18
18
  import { a as md5, c as sha256, d as verifyPassword, i as hmac, l as sha512, n as hash, o as needsRehash, r as hashPassword, s as secureCompare, t as check, u as verifyHmac } from "./Hash-D2DFd8xX.js";
@@ -22,24 +22,24 @@ import { a as RedisStore, i as FileStore, n as createCacheManager, o as MemorySt
22
22
  import { n as createRedisClient, r as RedisSessionStore } from "./client-C5Wj9P9o.js";
23
23
  import { i as loadRuntimeErrorsModule, r as captureRuntimeError, s as isMcpEndpointEnabled, t as RUNTIME_ERRORS_BINDING } from "./runtime-error-capture-BclelWhA.js";
24
24
  import { n as isHotReloadRuntime, r as matchingOpenParen, t as claimHotDisposable } from "./hot-disposables-W2fH-GID.js";
25
- import { a as setBroadcastManager, c as PresenceChannel, d as createWebSocketOriginGuard, i as getBroadcastManager, l as PrivateChannel, n as BroadcastManager, o as RedisDriver, r as createBroadcastManager, s as MemoryDriver, t as createTypedBroadcaster, u as Channel } from "./broadcasting-N4cRV42s.js";
26
- import { c as tc, d as Translator, f as getPluralizationRule, i as getI18n, l as tryGetI18n, m as selectPluralForm, n as I18nManager, o as setI18n, p as pluralizationRules, r as createI18n, s as t, t as MemoryLoader, u as JsonLoader } from "./i18n-DmMKcbqj.js";
25
+ import { a as setBroadcastManager, c as PresenceChannel, d as createWebSocketOriginGuard, i as getBroadcastManager, l as PrivateChannel, n as BroadcastManager, o as RedisDriver, r as createBroadcastManager, s as MemoryDriver, t as createTypedBroadcaster, u as Channel } from "./broadcasting-CcevVE5Y.js";
26
+ import { c as tc, d as Translator, f as getPluralizationRule, i as getI18n, l as tryGetI18n, m as selectPluralForm, n as I18nManager, o as setI18n, p as pluralizationRules, r as createI18n, s as t, t as MemoryLoader, u as JsonLoader } from "./i18n-BShPpJZa.js";
27
27
  import { n as getRequestContainer, r as tryGetRequestContainer, t as CONTAINER_CONTEXT_KEY } from "./request-container-BbuH0JJy.js";
28
28
  import { n as isAgentToolRequest } from "./agent-request-Caj6bnbj.js";
29
- import { a as cannot, f as setGate, i as can, l as getGate, n as Response$1, o as createGate, p as AuthorizationException, r as authorize, s as defineGate, t as Gate } from "./Gate-DFiuutZm.js";
29
+ import { a as cannot, f as setGate, i as can, l as getGate, n as Response$1, o as createGate, p as AuthorizationException, r as authorize, s as defineGate, t as Gate } from "./Gate-COWQbA96.js";
30
30
  import { r as isDocsViewerEnabled } from "./endpoint-CTIzcagh.js";
31
31
  import { n as isWildcardHost, t as formatHostPort } from "./host-port-t6wQFaRu.js";
32
32
  import { C as stopBunServerBounded, S as stopActiveViteDevServer, _ as registerBunTeardown, b as setActiveBunServer, c as isViteProduction, d as startViteDevServer, g as hotReloadStopBound, h as getGlobalState, i as clientManifestCandidates, l as loadViteManifest, m as closeOwnedViteDevServer, n as INJECTED_CLIENT_MANIFEST_SOURCE, o as getManifestFile, p as adoptViteDevServer, r as PUBLIC_ASSETS_URL_PREFIX, s as injectedClientManifest, u as normalizeDevServerUrl, v as releaseActiveBunServer, x as stopActiveBunServer, y as reusableActiveViteDevServer } from "./vite-manifest-DO0pU1vm.js";
33
33
  import { readObjectSchema, toJsonSchema } from "./internal/zod-json-schema.js";
34
- import { a as RequestFinished, c as UserLoggedOut, d as EventManager, f as createEventManager, i as JobProcessed, l as createQueueEventDispatcher, n as ApplicationStarted, o as RequestReceived, p as Event, r as JobFailed, s as UserAuthenticated, t as ApplicationShutdown, u as Listener } from "./events-DQavGm8W.js";
35
- import { a as NotificationManager, c as setNotificationManager, d as getNotification, f as registerNotification, i as MailChannel, l as resolveNotifiableType, n as SlackChannel, o as createNotificationManager, p as Notification, r as DatabaseChannel, s as getNotificationManager, t as MemoryChannel, u as clearNotificationRegistry } from "./notifications-Bp2uamzD.js";
36
- import { a as getJob, d as resolveQueueDriver, f as setQueueDriver, l as registerJob, n as clearJobRegistry, o as getQueueDriver, r as clearQueueDriver, s as getRegisteredJobs, t as Job, u as resolveJobName } from "./Job-DsFMcXVk.js";
37
- import { a as processJob, c as RedisDriver$1, i as Worker, l as SyncDriver, n as createQueueManager, o as SqsDriver, r as FailedJobReporter, s as createSqsAdapter, t as QueueManager, u as MemoryDriver$1 } from "./queue-C8s3buYz.js";
38
- import { a as MailManager, c as MemoryTransport, i as setMailManager, l as ResendTransport, n as getMailManager, o as createMailManager, r as mail, s as LogTransport, t as Mail, u as SmtpTransport } from "./mail-CI2Kfe8P.js";
34
+ import { a as RequestFinished, c as UserLoggedOut, d as EventManager, f as createEventManager, i as JobProcessed, l as createQueueEventDispatcher, n as ApplicationStarted, o as RequestReceived, p as Event, r as JobFailed, s as UserAuthenticated, t as ApplicationShutdown, u as Listener } from "./events-B6gfJkCH.js";
35
+ import { a as NotificationManager, c as setNotificationManager, d as getNotification, f as registerNotification, i as MailChannel, l as resolveNotifiableType, n as SlackChannel, o as createNotificationManager, p as Notification, r as DatabaseChannel, s as getNotificationManager, t as MemoryChannel, u as clearNotificationRegistry } from "./notifications-R7Uj-aT7.js";
36
+ import { a as getJob, d as resolveQueueDriver, f as setQueueDriver, l as registerJob, n as clearJobRegistry, o as getQueueDriver, r as clearQueueDriver, s as getRegisteredJobs, t as Job, u as resolveJobName } from "./Job-0Prk8k0z.js";
37
+ import { a as processJob, c as RedisDriver$1, i as Worker, l as SyncDriver, n as createQueueManager, o as SqsDriver, r as FailedJobReporter, s as createSqsAdapter, t as QueueManager, u as MemoryDriver$1 } from "./queue-jvxB1MFh.js";
38
+ import { a as MailManager, c as MemoryTransport, i as setMailManager, l as ResendTransport, n as getMailManager, o as createMailManager, r as mail, s as LogTransport, t as Mail, u as SmtpTransport } from "./mail-BQ2y2U5c.js";
39
39
  import { a as LOG_LEVEL_PRIORITY, i as matchDailyFileDate, n as dailyFileDateStamp, r as dailyFilePath, t as DailyFileChannel } from "./DailyFileChannel-CTTPA0EF.js";
40
- import { a as FileChannel, i as setLogManager, n as createLogManager, o as ConsoleChannel, r as getLogManager, t as LogManager } from "./logging-Ci0mBk5k.js";
40
+ import { a as FileChannel, i as setLogManager, n as createLogManager, o as ConsoleChannel, r as getLogManager, t as LogManager } from "./logging-Br9bZlaG.js";
41
41
  import { a as random, c as randomHex, d as sample, f as shuffle, i as pick, l as randomInt, m as uuid, n as generatePassword, o as randomBase64, p as urlSafeToken, r as generateSlug, s as randomBase64Url, t as generateOtp, u as randomString } from "./Random-S0OvCuR8.js";
42
- import { a as decrypt, c as getEncrypter, i as createEncrypter, l as setEncrypter, n as verifySignedUrl, o as encrypt, r as Encrypter, s as generateKey, t as signUrl } from "./encryption-CWK5l22W.js";
42
+ import { a as decrypt, c as getEncrypter, i as createEncrypter, l as setEncrypter, n as verifySignedUrl, o as encrypt, r as Encrypter, s as generateKey, t as signUrl } from "./encryption-BS-FGkqS.js";
43
43
  import { a as LocalDriver, i as S3Driver, n as createStorageManager, r as MemoryDriver$2, t as StorageManager } from "./storage-IlUesK2t.js";
44
44
  import { a as CacheCheck, c as HealthManager, i as StorageCheck, l as createHealthManager, n as customCheck, o as RedisCheck, r as MemoryCheck, s as DatabaseCheck, t as CustomCheck, u as HealthCheck } from "./health-Bg0Xj3aD.js";
45
45
  import { a as ScheduledTask, c as isDue, d as parseCron, f as toTimezone, i as Schedule, l as isDueInTimezone, n as createScheduler, o as getNextOccurrence, p as MemorySchedulerLock, r as PendingSchedule, s as getNextOccurrences, t as Scheduler, u as matchesCron } from "./scheduling-DNV5tj44.js";
@@ -1354,9 +1354,12 @@ function remember(ctx, token, boundId) {
1354
1354
  return token;
1355
1355
  }
1356
1356
  function csrfField(ctx) {
1357
- const token = getCsrfToken(ctx);
1357
+ const token = escapeAttribute(getCsrfToken(ctx));
1358
1358
  return `<input type="hidden" name="${CSRF_FORM_FIELD}" value="${token}" />`;
1359
1359
  }
1360
+ function escapeAttribute(value) {
1361
+ return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
1362
+ }
1360
1363
  /**
1361
1364
  * The token must carry a valid app-key signature, and be in the mode the
1362
1365
  * *request* fixes: session-bound needs a matching `sid` (a sibling-subdomain
@@ -2135,26 +2138,37 @@ function renderErrorPage(statusCode, message) {
2135
2138
  <meta name="viewport" content="width=device-width, initial-scale=1">
2136
2139
  <title>${statusCode} ${title}</title>
2137
2140
  <style>
2141
+ /* Guren UI's tokens (github.com/gurenjs/guren-ui); the link home is the screen's one crimson fill. */
2142
+ :root {
2143
+ color-scheme: light;
2144
+ --g-page: #ffffff; --g-heading: #111827; --g-text-2: #4b5563; --g-line-strong: #d1d5db;
2145
+ --g-accent: #db1b1b; --g-accent-down: #b91c1c; --g-on-accent: #fff5f5;
2146
+ }
2147
+ @media (prefers-color-scheme: dark) {
2148
+ :root { color-scheme: dark; --g-page: #1a1a2e; --g-heading: #e0def4; --g-text-2: #908caa; --g-line-strong: #3d3d5c; }
2149
+ }
2138
2150
  * { margin: 0; padding: 0; box-sizing: border-box; }
2139
2151
  body {
2140
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
2152
+ font-family: 'Noto Sans JP', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
2141
2153
  min-height: 100vh;
2142
2154
  display: flex;
2143
2155
  align-items: center;
2144
2156
  justify-content: center;
2145
- background: #fafaf9;
2146
- color: #1c1917;
2157
+ background: var(--g-page);
2158
+ color: var(--g-heading);
2159
+ -webkit-font-smoothing: antialiased;
2147
2160
  }
2148
2161
  .container { text-align: center; padding: 2rem; }
2149
- .status { font-size: 6rem; font-weight: 700; color: #d6d3d1; line-height: 1; }
2150
- .title { font-size: 1.5rem; font-weight: 600; margin-top: 1rem; }
2151
- .description { color: #78716c; margin-top: 0.5rem; max-width: 28rem; }
2162
+ .status { font: 700 6rem/1 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace; color: var(--g-line-strong); }
2163
+ .title { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; margin-top: 1rem; }
2164
+ .description { color: var(--g-text-2); margin-top: 0.5rem; max-width: 28rem; }
2152
2165
  .home-link {
2153
- display: inline-block; margin-top: 2rem; padding: 0.625rem 1.5rem;
2154
- background: #1c1917; color: #fff; border-radius: 0.375rem;
2155
- text-decoration: none; font-size: 0.875rem; font-weight: 500;
2166
+ display: inline-block; margin-top: 2rem; padding: 8px 16px;
2167
+ background: var(--g-accent); color: var(--g-on-accent); border-radius: 8px;
2168
+ text-decoration: none; font-size: 13.5px; font-weight: 700;
2156
2169
  }
2157
- .home-link:hover { background: #292524; }
2170
+ .home-link:hover { background: var(--g-accent-down); }
2171
+ .home-link:focus-visible { outline: 2px solid var(--g-accent); outline-offset: 2px; }
2158
2172
  </style>
2159
2173
  </head>
2160
2174
  <body>
@@ -2197,6 +2211,291 @@ const STATUS_DESCRIPTIONS = {
2197
2211
  504: "The server did not receive a timely response from an upstream server."
2198
2212
  };
2199
2213
  //#endregion
2214
+ //#region src/errors/debug-page.ts
2215
+ /** Development-only error page: exposes the stack trace and request details. */
2216
+ function renderDebugPage(error, request) {
2217
+ const errorName = error.name || "Error";
2218
+ const errorMessage = escapeHtml(error.message || "An unknown error occurred");
2219
+ const stackFrames = parseStackTrace(error.stack ?? "");
2220
+ const statusCode = getStatusCode(error);
2221
+ const requestSection = request ? renderRequestSection(request) : "";
2222
+ const stackSection = renderStackSection(stackFrames);
2223
+ const environmentSection = renderEnvironmentSection();
2224
+ return `<!DOCTYPE html>
2225
+ <html lang="en">
2226
+ <head>
2227
+ <meta charset="utf-8">
2228
+ <meta name="viewport" content="width=device-width, initial-scale=1">
2229
+ <title>${escapeHtml(errorName)}: ${errorMessage}</title>
2230
+ <style>
2231
+ /* Guren UI's tokens (github.com/gurenjs/guren-ui), following the OS theme. */
2232
+ :root {
2233
+ color-scheme: light;
2234
+ --g-font-sans: 'Noto Sans JP', ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
2235
+ --g-font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
2236
+ --g-page: #ffffff; --g-panel: #ffffff; --g-raised: #fffafa; --g-line: #e5e7eb; --g-line-strong: #d1d5db;
2237
+ --g-heading: #111827; --g-text: #1f2937; --g-text-2: #4b5563; --g-muted: #9ca3af;
2238
+ --g-danger: #b91c1c; --g-danger-chip: #f23a3a; --g-danger-tint: #fff1f2; --g-accent: #db1b1b;
2239
+ --g-shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
2240
+ }
2241
+ @media (prefers-color-scheme: dark) {
2242
+ :root {
2243
+ color-scheme: dark;
2244
+ --g-page: #1a1a2e; --g-panel: #1e1e34; --g-raised: #232340; --g-line: #2e2e4a; --g-line-strong: #3d3d5c;
2245
+ --g-heading: #e0def4; --g-text: #e0def4; --g-text-2: #908caa; --g-muted: #6e6a86;
2246
+ --g-danger: #ffa5a5; --g-danger-tint: rgba(242, 58, 58, 0.12);
2247
+ --g-shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
2248
+ }
2249
+ }
2250
+ * { margin: 0; padding: 0; box-sizing: border-box; }
2251
+ body { font-family: var(--g-font-sans); background: var(--g-page); color: var(--g-text); line-height: 1.6; min-height: 100vh; -webkit-font-smoothing: antialiased; }
2252
+ code, .mono { font-family: var(--g-font-mono); }
2253
+ .container { max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem; }
2254
+
2255
+ .error-header { display: flex; align-items: flex-start; gap: 1.5rem; margin-bottom: 2rem; padding: 2rem; background: var(--g-panel); border: 1px solid var(--g-line); border-radius: 12px; border-left: 4px solid var(--g-danger-chip); box-shadow: var(--g-shadow-card); }
2256
+ .status-badge { flex-shrink: 0; display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; background: var(--g-danger-tint); color: var(--g-danger); font: 700 1.25rem/1 var(--g-font-mono); border-radius: 12px; }
2257
+ .error-info { min-width: 0; }
2258
+ .error-class { font-size: 1.5rem; font-weight: 700; color: var(--g-danger); letter-spacing: -0.01em; margin-bottom: 0.25rem; word-break: break-word; }
2259
+ .error-message { font-size: 1.1rem; color: var(--g-heading); word-break: break-word; }
2260
+
2261
+ .section { margin-bottom: 1rem; background: var(--g-panel); border: 1px solid var(--g-line); border-radius: 12px; box-shadow: var(--g-shadow-card); overflow: hidden; }
2262
+ .section-toggle { display: flex; align-items: center; gap: 0.75rem; width: 100%; padding: 1rem 1.25rem; background: none; border: none; cursor: pointer; color: var(--g-heading); text-align: left; font-family: inherit; }
2263
+ .section-toggle:hover { background: var(--g-raised); }
2264
+ .section-toggle:focus-visible { outline: 2px solid var(--g-accent); outline-offset: -2px; }
2265
+ .section-toggle h2 { font-size: 15px; font-weight: 700; }
2266
+ .toggle-icon { font-size: 0.7rem; color: var(--g-muted); flex-shrink: 0; width: 1rem; text-align: center; }
2267
+ .badge { font: 500 12px/1.6 var(--g-font-mono); color: var(--g-text-2); background: var(--g-raised); box-shadow: inset 0 0 0 1px var(--g-line); padding: 2px 9px; border-radius: 999px; margin-left: auto; }
2268
+ .section-content { padding: 0 1.25rem 1.25rem; }
2269
+
2270
+ .stack-frames { display: flex; flex-direction: column; gap: 2px; }
2271
+ .frame { padding: 0.6rem 0.75rem; border-radius: 8px; cursor: default; transition: background 0.15s; }
2272
+ .frame:hover { background: var(--g-raised); }
2273
+ .frame.vendor { opacity: 0.5; }
2274
+ .frame.vendor:hover { opacity: 0.75; }
2275
+ .frame-header { display: flex; align-items: center; gap: 0.75rem; font-size: 0.875rem; }
2276
+ .frame-index { color: var(--g-muted); font: 500 0.75rem var(--g-font-mono); min-width: 2rem; flex-shrink: 0; }
2277
+ .frame-method { color: var(--g-heading); font-family: var(--g-font-mono); font-weight: 500; }
2278
+ .frame-location { color: var(--g-text-2); font-family: var(--g-font-mono); font-size: 0.8rem; margin-left: auto; text-align: right; word-break: break-all; }
2279
+
2280
+ .request-summary { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
2281
+ .method-badge { display: inline-block; padding: 2px 9px; color: var(--g-text-2); background: var(--g-raised); box-shadow: inset 0 0 0 1px var(--g-line); font: 500 12px/1.6 var(--g-font-mono); border-radius: 999px; }
2282
+ .request-url { font-family: var(--g-font-mono); font-size: 0.9rem; word-break: break-all; }
2283
+
2284
+ .subsection { margin-top: 1rem; }
2285
+ .subsection h3 { font: 500 11.5px/1.6 var(--g-font-mono); color: var(--g-muted); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.06em; }
2286
+
2287
+ .details-table { width: 100%; border-collapse: collapse; }
2288
+ .details-table tr { border-bottom: 1px solid var(--g-line); }
2289
+ .details-table tr:last-child { border-bottom: none; }
2290
+ .details-table td { padding: 0.4rem 0; font-size: 0.85rem; vertical-align: top; }
2291
+ .details-table td.key { color: var(--g-text-2); font-weight: 500; width: 200px; padding-right: 1rem; font-family: var(--g-font-mono); font-size: 0.8rem; }
2292
+ .details-table td.value { color: var(--g-text); word-break: break-all; font-family: var(--g-font-mono); font-size: 0.8rem; }
2293
+
2294
+ .muted { color: var(--g-muted); font-style: italic; }
2295
+ .footer { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--g-line); text-align: center; color: var(--g-muted); font-size: 0.8rem; }
2296
+ </style>
2297
+ </head>
2298
+ <body>
2299
+ <div class="container">
2300
+ <header class="error-header">
2301
+ <div class="status-badge">${statusCode}</div>
2302
+ <div class="error-info">
2303
+ <h1 class="error-class">${escapeHtml(errorName)}</h1>
2304
+ <p class="error-message">${errorMessage}</p>
2305
+ </div>
2306
+ </header>
2307
+
2308
+ ${stackSection}
2309
+ ${requestSection}
2310
+ ${environmentSection}
2311
+
2312
+ <footer class="footer">
2313
+ <p>Guren Framework &mdash; Debug Error Page</p>
2314
+ </footer>
2315
+ </div>
2316
+
2317
+ <script>
2318
+ function toggleSection(button) {
2319
+ var section = button.closest('.section');
2320
+ var content = section.querySelector('.section-content');
2321
+ var icon = button.querySelector('.toggle-icon');
2322
+ if (content.style.display === 'none') {
2323
+ content.style.display = 'block';
2324
+ icon.innerHTML = '\\u25BC';
2325
+ section.classList.remove('collapsed');
2326
+ } else {
2327
+ content.style.display = 'none';
2328
+ icon.innerHTML = '\\u25B6';
2329
+ section.classList.add('collapsed');
2330
+ }
2331
+ }
2332
+ <\/script>
2333
+ </body>
2334
+ </html>`;
2335
+ }
2336
+ /**
2337
+ * @deprecated since 2.30.0, removed in 3.0.0. The ExceptionHandler renders this
2338
+ * page itself for a browser request while debug details are on. Hono hands a
2339
+ * handler's error to the app's `onError` where it is thrown, so this `catch`
2340
+ * never sees one in a Guren app.
2341
+ */
2342
+ function debugErrorMiddleware() {
2343
+ warnDeprecated("debug-error-middleware", "debugErrorMiddleware", "Remove it: the ExceptionHandler renders the debug page for a browser request while debug details are on.", {
2344
+ since: "2.30.0",
2345
+ removedIn: "3.0.0"
2346
+ });
2347
+ return async (c, next) => {
2348
+ try {
2349
+ await next();
2350
+ } catch (err) {
2351
+ if (typeof process !== "undefined" && process.env.NODE_ENV === "production") throw err;
2352
+ const error = err instanceof Error ? err : new Error(String(err));
2353
+ const statusCode = getStatusCode(error);
2354
+ const html = renderDebugPage(error, c.req.raw);
2355
+ return new Response(html, {
2356
+ status: statusCode,
2357
+ headers: { "Content-Type": "text/html; charset=utf-8" }
2358
+ });
2359
+ }
2360
+ };
2361
+ }
2362
+ /**
2363
+ * Split a `file:line:col` suffix off a location string, scanning from the
2364
+ * right so drive letters and URLs with colons stay part of the file path.
2365
+ */
2366
+ function splitLocation(location) {
2367
+ const lastColon = location.lastIndexOf(":");
2368
+ if (lastColon <= 0) return null;
2369
+ const prevColon = location.lastIndexOf(":", lastColon - 1);
2370
+ if (prevColon <= 0) return null;
2371
+ const line = location.slice(prevColon + 1, lastColon);
2372
+ const col = location.slice(lastColon + 1);
2373
+ if (!/^\d+$/.test(line) || !/^\d+$/.test(col)) return null;
2374
+ return {
2375
+ file: location.slice(0, prevColon),
2376
+ line,
2377
+ col
2378
+ };
2379
+ }
2380
+ function parseStackTrace(stack) {
2381
+ return stack.split("\n").slice(1).map((line) => {
2382
+ const trimmed = line.trim();
2383
+ if (!/^at\s/u.test(trimmed)) return null;
2384
+ const rest = trimmed.slice(2).trim();
2385
+ if (rest.endsWith(")")) {
2386
+ const open = matchingOpenParen(rest, rest.length - 1);
2387
+ if (open !== void 0 && open > 0) {
2388
+ const location = splitLocation(rest.slice(open + 1, -1));
2389
+ if (location) return {
2390
+ func: rest.slice(0, open).trim(),
2391
+ ...location
2392
+ };
2393
+ }
2394
+ }
2395
+ const location = splitLocation(rest);
2396
+ if (location) return {
2397
+ func: "<anonymous>",
2398
+ ...location
2399
+ };
2400
+ return null;
2401
+ }).filter((frame) => frame !== null);
2402
+ }
2403
+ function getStatusCode(error) {
2404
+ if ("statusCode" in error && typeof error.statusCode === "number") return error.statusCode;
2405
+ return 500;
2406
+ }
2407
+ function escapeHtml(text) {
2408
+ return text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
2409
+ }
2410
+ function renderStackSection(frames) {
2411
+ if (frames.length === 0) return `
2412
+ <section class="section">
2413
+ <button class="section-toggle" onclick="toggleSection(this)">
2414
+ <span class="toggle-icon">&#9660;</span>
2415
+ <h2>Stack Trace</h2>
2416
+ </button>
2417
+ <div class="section-content">
2418
+ <p class="muted">No stack trace available.</p>
2419
+ </div>
2420
+ </section>`;
2421
+ const frameRows = frames.map((frame, index) => {
2422
+ return `
2423
+ <div class="frame${frame.file.includes("node_modules") || frame.file.includes("bun:") ? " vendor" : ""}">
2424
+ <div class="frame-header">
2425
+ <span class="frame-index">#${index}</span>
2426
+ <span class="frame-method">${escapeHtml(frame.func)}</span>
2427
+ <span class="frame-location">${escapeHtml(frame.file)}:${frame.line}:${frame.col}</span>
2428
+ </div>
2429
+ </div>`;
2430
+ }).join("");
2431
+ return `
2432
+ <section class="section">
2433
+ <button class="section-toggle" onclick="toggleSection(this)">
2434
+ <span class="toggle-icon">&#9660;</span>
2435
+ <h2>Stack Trace</h2>
2436
+ <span class="badge">${frames.length} frames</span>
2437
+ </button>
2438
+ <div class="section-content">
2439
+ <div class="stack-frames">
2440
+ ${frameRows}
2441
+ </div>
2442
+ </div>
2443
+ </section>`;
2444
+ }
2445
+ const REDACTED_HEADERS = /* @__PURE__ */ new Set([
2446
+ "cookie",
2447
+ "authorization",
2448
+ "proxy-authorization",
2449
+ "x-xsrf-token",
2450
+ "x-csrf-token"
2451
+ ]);
2452
+ const REDACTED_VALUE = "[redacted]";
2453
+ function renderRequestSection(request) {
2454
+ const url = new URL(request.url);
2455
+ const headers = [];
2456
+ request.headers.forEach((value, key) => {
2457
+ const shown = REDACTED_HEADERS.has(key.toLowerCase()) ? REDACTED_VALUE : value;
2458
+ headers.push(`<tr><td class="key">${escapeHtml(key)}</td><td class="value">${escapeHtml(shown)}</td></tr>`);
2459
+ });
2460
+ const headersTable = headers.length > 0 ? `<table class="details-table">${headers.join("\n")}</table>` : "<p class=\"muted\">No headers.</p>";
2461
+ return `
2462
+ <section class="section">
2463
+ <button class="section-toggle" onclick="toggleSection(this)">
2464
+ <span class="toggle-icon">&#9660;</span>
2465
+ <h2>Request</h2>
2466
+ </button>
2467
+ <div class="section-content">
2468
+ <div class="request-summary">
2469
+ <span class="method-badge">${escapeHtml(request.method)}</span>
2470
+ <span class="request-url">${escapeHtml(url.pathname + url.search)}</span>
2471
+ </div>
2472
+ <div class="subsection">
2473
+ <h3>Headers</h3>
2474
+ ${headersTable}
2475
+ </div>
2476
+ </div>
2477
+ </section>`;
2478
+ }
2479
+ function renderEnvironmentSection() {
2480
+ const nodeEnv = typeof process !== "undefined" ? process.env.NODE_ENV ?? "undefined" : "undefined";
2481
+ const bunVersion = typeof process !== "undefined" ? process.versions?.bun ?? "N/A" : "N/A";
2482
+ const platform = typeof process !== "undefined" ? process.platform ?? "unknown" : "unknown";
2483
+ return `
2484
+ <section class="section collapsed">
2485
+ <button class="section-toggle" onclick="toggleSection(this)">
2486
+ <span class="toggle-icon">&#9654;</span>
2487
+ <h2>Environment</h2>
2488
+ </button>
2489
+ <div class="section-content" style="display:none;">
2490
+ <table class="details-table">
2491
+ <tr><td class="key">NODE_ENV</td><td class="value">${escapeHtml(nodeEnv)}</td></tr>
2492
+ <tr><td class="key">Bun Version</td><td class="value">${escapeHtml(bunVersion)}</td></tr>
2493
+ <tr><td class="key">Platform</td><td class="value">${escapeHtml(platform)}</td></tr>
2494
+ </table>
2495
+ </div>
2496
+ </section>`;
2497
+ }
2498
+ //#endregion
2200
2499
  //#region src/errors/ExceptionHandler.ts
2201
2500
  /** Centralized error handling: reporting, per-class renderers, middleware. */
2202
2501
  var ExceptionHandler = class {
@@ -2258,17 +2557,19 @@ var ExceptionHandler = class {
2258
2557
  renderDefaultException(error, ctx) {
2259
2558
  const debug = this.shouldShowDetails();
2260
2559
  const statusCode = resolveExceptionStatus(error);
2261
- if (HttpException.isHttpException(error)) {
2262
- const { body } = error.toResponse(debug);
2263
- if (this.wantsHtmlResponse(ctx) && !debug) return ctx.html(renderErrorPage(statusCode, body.message), statusCode);
2264
- return ctx.json(body, statusCode);
2560
+ let body;
2561
+ if (HttpException.isHttpException(error)) body = error.toResponse(debug).body;
2562
+ else {
2563
+ body = { message: statusCode < 500 || debug ? error.message : "Internal Server Error" };
2564
+ if (debug) {
2565
+ body.exception = error.name;
2566
+ body.stack = error.stack;
2567
+ }
2265
2568
  }
2266
- const body = { message: statusCode < 500 || debug ? error.message : "Internal Server Error" };
2267
- if (debug) {
2268
- body.exception = error.name;
2269
- body.stack = error.stack;
2569
+ if (this.wantsHtmlResponse(ctx)) {
2570
+ const html = debug && statusCode >= 500 ? renderDebugPage(error, ctx.req.raw) : renderErrorPage(statusCode, body.message);
2571
+ return ctx.html(html, statusCode);
2270
2572
  }
2271
- if (this.wantsHtmlResponse(ctx) && !debug) return ctx.html(renderErrorPage(statusCode, body.message), statusCode);
2272
2573
  return ctx.json(body, statusCode);
2273
2574
  }
2274
2575
  /** False for Inertia, XHR and JSON callers, which need a JSON payload. */
@@ -3262,7 +3563,7 @@ let devBanner;
3262
3563
  */
3263
3564
  async function loadDevBanner() {
3264
3565
  if (typeof process === "undefined") return devBanner;
3265
- if (process.env.NODE_ENV !== "production") devBanner ??= await import("./dev-banner-BAXzolUl.js").then((n) => n.n);
3566
+ if (process.env.NODE_ENV !== "production") devBanner ??= await import("./dev-banner-Cw8VnH6J.js").then((n) => n.n);
3266
3567
  return devBanner;
3267
3568
  }
3268
3569
  /**
@@ -7270,256 +7571,6 @@ var AutoDiscovery = class {
7270
7571
  }
7271
7572
  };
7272
7573
  //#endregion
7273
- //#region src/errors/debug-page.ts
7274
- /** Development-only error page: exposes the stack trace and request details. */
7275
- function renderDebugPage(error, request) {
7276
- const errorName = error.name || "Error";
7277
- const errorMessage = escapeHtml(error.message || "An unknown error occurred");
7278
- const stackFrames = parseStackTrace(error.stack ?? "");
7279
- const statusCode = getStatusCode(error);
7280
- const requestSection = request ? renderRequestSection(request) : "";
7281
- const stackSection = renderStackSection(stackFrames);
7282
- const environmentSection = renderEnvironmentSection();
7283
- return `<!DOCTYPE html>
7284
- <html lang="en">
7285
- <head>
7286
- <meta charset="utf-8">
7287
- <meta name="viewport" content="width=device-width, initial-scale=1">
7288
- <title>${escapeHtml(errorName)}: ${errorMessage}</title>
7289
- <style>
7290
- * { margin: 0; padding: 0; box-sizing: border-box; }
7291
- body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: #0f0f13; color: #e0e0e8; line-height: 1.6; min-height: 100vh; }
7292
- code, .mono { font-family: ui-monospace, "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace; }
7293
- .container { max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem; }
7294
-
7295
- .error-header { display: flex; align-items: flex-start; gap: 1.5rem; margin-bottom: 2rem; padding: 2rem; background: #1a1a24; border: 1px solid #2a2a3a; border-radius: 12px; border-left: 4px solid #ef4444; }
7296
- .status-badge { flex-shrink: 0; display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; background: #2d1b1b; color: #ef4444; font-size: 1.25rem; font-weight: 700; border-radius: 12px; }
7297
- .error-info { min-width: 0; }
7298
- .error-class { font-size: 1.5rem; font-weight: 700; color: #ef4444; margin-bottom: 0.25rem; word-break: break-word; }
7299
- .error-message { font-size: 1.1rem; color: #c0c0cc; word-break: break-word; }
7300
-
7301
- .section { margin-bottom: 1rem; background: #1a1a24; border: 1px solid #2a2a3a; border-radius: 8px; overflow: hidden; }
7302
- .section-toggle { display: flex; align-items: center; gap: 0.75rem; width: 100%; padding: 1rem 1.25rem; background: none; border: none; cursor: pointer; color: #e0e0e8; text-align: left; font-family: inherit; }
7303
- .section-toggle:hover { background: #22222e; }
7304
- .section-toggle h2 { font-size: 1rem; font-weight: 600; }
7305
- .toggle-icon { font-size: 0.7rem; color: #888; flex-shrink: 0; width: 1rem; text-align: center; }
7306
- .badge { font-size: 0.75rem; color: #888; background: #2a2a3a; padding: 0.15rem 0.5rem; border-radius: 999px; margin-left: auto; }
7307
- .section-content { padding: 0 1.25rem 1.25rem; }
7308
-
7309
- .stack-frames { display: flex; flex-direction: column; gap: 2px; }
7310
- .frame { padding: 0.6rem 0.75rem; border-radius: 6px; cursor: default; transition: background 0.15s; }
7311
- .frame:hover { background: #22222e; }
7312
- .frame.vendor { opacity: 0.45; }
7313
- .frame.vendor:hover { opacity: 0.7; }
7314
- .frame-header { display: flex; align-items: center; gap: 0.75rem; font-size: 0.875rem; }
7315
- .frame-index { color: #555; font-size: 0.75rem; min-width: 2rem; flex-shrink: 0; }
7316
- .frame-method { color: #a78bfa; font-family: ui-monospace, "SF Mono", "Fira Code", Menlo, Consolas, monospace; font-weight: 500; }
7317
- .frame-location { color: #888; font-family: ui-monospace, "SF Mono", "Fira Code", Menlo, Consolas, monospace; font-size: 0.8rem; margin-left: auto; text-align: right; word-break: break-all; }
7318
-
7319
- .request-summary { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
7320
- .method-badge { display: inline-block; padding: 0.2rem 0.6rem; background: #2d1b4e; color: #a78bfa; font-size: 0.8rem; font-weight: 700; border-radius: 4px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
7321
- .request-url { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.9rem; word-break: break-all; }
7322
-
7323
- .subsection { margin-top: 1rem; }
7324
- .subsection h3 { font-size: 0.85rem; font-weight: 600; color: #888; margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.05em; }
7325
-
7326
- .details-table { width: 100%; border-collapse: collapse; }
7327
- .details-table tr { border-bottom: 1px solid #22222e; }
7328
- .details-table tr:last-child { border-bottom: none; }
7329
- .details-table td { padding: 0.4rem 0; font-size: 0.85rem; vertical-align: top; }
7330
- .details-table td.key { color: #a78bfa; font-weight: 500; width: 200px; padding-right: 1rem; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.8rem; }
7331
- .details-table td.value { color: #c0c0cc; word-break: break-all; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.8rem; }
7332
-
7333
- .muted { color: #555; font-style: italic; }
7334
- .footer { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid #2a2a3a; text-align: center; color: #555; font-size: 0.8rem; }
7335
- </style>
7336
- </head>
7337
- <body>
7338
- <div class="container">
7339
- <header class="error-header">
7340
- <div class="status-badge">${statusCode}</div>
7341
- <div class="error-info">
7342
- <h1 class="error-class">${escapeHtml(errorName)}</h1>
7343
- <p class="error-message">${errorMessage}</p>
7344
- </div>
7345
- </header>
7346
-
7347
- ${stackSection}
7348
- ${requestSection}
7349
- ${environmentSection}
7350
-
7351
- <footer class="footer">
7352
- <p>Guren Framework &mdash; Debug Error Page</p>
7353
- </footer>
7354
- </div>
7355
-
7356
- <script>
7357
- function toggleSection(button) {
7358
- var section = button.closest('.section');
7359
- var content = section.querySelector('.section-content');
7360
- var icon = button.querySelector('.toggle-icon');
7361
- if (content.style.display === 'none') {
7362
- content.style.display = 'block';
7363
- icon.innerHTML = '\\u25BC';
7364
- section.classList.remove('collapsed');
7365
- } else {
7366
- content.style.display = 'none';
7367
- icon.innerHTML = '\\u25B6';
7368
- section.classList.add('collapsed');
7369
- }
7370
- }
7371
- <\/script>
7372
- </body>
7373
- </html>`;
7374
- }
7375
- /**
7376
- * Renders a debug page in development; in production the error is re-thrown for
7377
- * the ExceptionHandler.
7378
- */
7379
- function debugErrorMiddleware() {
7380
- return async (c, next) => {
7381
- try {
7382
- await next();
7383
- } catch (err) {
7384
- if (typeof process !== "undefined" && process.env.NODE_ENV === "production") throw err;
7385
- const error = err instanceof Error ? err : new Error(String(err));
7386
- const statusCode = getStatusCode(error);
7387
- const html = renderDebugPage(error, c.req.raw);
7388
- return new Response(html, {
7389
- status: statusCode,
7390
- headers: { "Content-Type": "text/html; charset=utf-8" }
7391
- });
7392
- }
7393
- };
7394
- }
7395
- /**
7396
- * Split a `file:line:col` suffix off a location string, scanning from the
7397
- * right so drive letters and URLs with colons stay part of the file path.
7398
- */
7399
- function splitLocation(location) {
7400
- const lastColon = location.lastIndexOf(":");
7401
- if (lastColon <= 0) return null;
7402
- const prevColon = location.lastIndexOf(":", lastColon - 1);
7403
- if (prevColon <= 0) return null;
7404
- const line = location.slice(prevColon + 1, lastColon);
7405
- const col = location.slice(lastColon + 1);
7406
- if (!/^\d+$/.test(line) || !/^\d+$/.test(col)) return null;
7407
- return {
7408
- file: location.slice(0, prevColon),
7409
- line,
7410
- col
7411
- };
7412
- }
7413
- function parseStackTrace(stack) {
7414
- return stack.split("\n").slice(1).map((line) => {
7415
- const trimmed = line.trim();
7416
- if (!/^at\s/u.test(trimmed)) return null;
7417
- const rest = trimmed.slice(2).trim();
7418
- if (rest.endsWith(")")) {
7419
- const open = matchingOpenParen(rest, rest.length - 1);
7420
- if (open !== void 0 && open > 0) {
7421
- const location = splitLocation(rest.slice(open + 1, -1));
7422
- if (location) return {
7423
- func: rest.slice(0, open).trim(),
7424
- ...location
7425
- };
7426
- }
7427
- }
7428
- const location = splitLocation(rest);
7429
- if (location) return {
7430
- func: "<anonymous>",
7431
- ...location
7432
- };
7433
- return null;
7434
- }).filter((frame) => frame !== null);
7435
- }
7436
- function getStatusCode(error) {
7437
- if ("statusCode" in error && typeof error.statusCode === "number") return error.statusCode;
7438
- return 500;
7439
- }
7440
- function escapeHtml(text) {
7441
- return text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
7442
- }
7443
- function renderStackSection(frames) {
7444
- if (frames.length === 0) return `
7445
- <section class="section">
7446
- <button class="section-toggle" onclick="toggleSection(this)">
7447
- <span class="toggle-icon">&#9660;</span>
7448
- <h2>Stack Trace</h2>
7449
- </button>
7450
- <div class="section-content">
7451
- <p class="muted">No stack trace available.</p>
7452
- </div>
7453
- </section>`;
7454
- const frameRows = frames.map((frame, index) => {
7455
- return `
7456
- <div class="frame${frame.file.includes("node_modules") || frame.file.includes("bun:") ? " vendor" : ""}">
7457
- <div class="frame-header">
7458
- <span class="frame-index">#${index}</span>
7459
- <span class="frame-method">${escapeHtml(frame.func)}</span>
7460
- <span class="frame-location">${escapeHtml(frame.file)}:${frame.line}:${frame.col}</span>
7461
- </div>
7462
- </div>`;
7463
- }).join("");
7464
- return `
7465
- <section class="section">
7466
- <button class="section-toggle" onclick="toggleSection(this)">
7467
- <span class="toggle-icon">&#9660;</span>
7468
- <h2>Stack Trace</h2>
7469
- <span class="badge">${frames.length} frames</span>
7470
- </button>
7471
- <div class="section-content">
7472
- <div class="stack-frames">
7473
- ${frameRows}
7474
- </div>
7475
- </div>
7476
- </section>`;
7477
- }
7478
- function renderRequestSection(request) {
7479
- const url = new URL(request.url);
7480
- const headers = [];
7481
- request.headers.forEach((value, key) => {
7482
- headers.push(`<tr><td class="key">${escapeHtml(key)}</td><td class="value">${escapeHtml(value)}</td></tr>`);
7483
- });
7484
- const headersTable = headers.length > 0 ? `<table class="details-table">${headers.join("\n")}</table>` : "<p class=\"muted\">No headers.</p>";
7485
- return `
7486
- <section class="section">
7487
- <button class="section-toggle" onclick="toggleSection(this)">
7488
- <span class="toggle-icon">&#9660;</span>
7489
- <h2>Request</h2>
7490
- </button>
7491
- <div class="section-content">
7492
- <div class="request-summary">
7493
- <span class="method-badge">${escapeHtml(request.method)}</span>
7494
- <span class="request-url">${escapeHtml(url.pathname + url.search)}</span>
7495
- </div>
7496
- <div class="subsection">
7497
- <h3>Headers</h3>
7498
- ${headersTable}
7499
- </div>
7500
- </div>
7501
- </section>`;
7502
- }
7503
- function renderEnvironmentSection() {
7504
- const nodeEnv = typeof process !== "undefined" ? process.env.NODE_ENV ?? "undefined" : "undefined";
7505
- const bunVersion = typeof process !== "undefined" ? process.versions?.bun ?? "N/A" : "N/A";
7506
- const platform = typeof process !== "undefined" ? process.platform ?? "unknown" : "unknown";
7507
- return `
7508
- <section class="section collapsed">
7509
- <button class="section-toggle" onclick="toggleSection(this)">
7510
- <span class="toggle-icon">&#9654;</span>
7511
- <h2>Environment</h2>
7512
- </button>
7513
- <div class="section-content" style="display:none;">
7514
- <table class="details-table">
7515
- <tr><td class="key">NODE_ENV</td><td class="value">${escapeHtml(nodeEnv)}</td></tr>
7516
- <tr><td class="key">Bun Version</td><td class="value">${escapeHtml(bunVersion)}</td></tr>
7517
- <tr><td class="key">Platform</td><td class="value">${escapeHtml(platform)}</td></tr>
7518
- </table>
7519
- </div>
7520
- </section>`;
7521
- }
7522
- //#endregion
7523
7574
  //#region src/config/env.ts
7524
7575
  /**
7525
7576
  * The declared environment (RFC 0027 §1): one schema, validated at boot by
@@ -1,4 +1,4 @@
1
- import { _ as INERTIA_VARY, f as definePlugin, i as Controller, n as Resource, r as collect, t as JsonResource, u as defineModule, v as acceptsJson, x as serializePage, y as buildInertiaPage } from "../Resource-ZMJH4lyD.js";
1
+ import { _ as INERTIA_VARY, f as definePlugin, i as Controller, n as Resource, r as collect, t as JsonResource, u as defineModule, v as acceptsJson, x as serializePage, y as buildInertiaPage } from "../Resource-D1tF6Qwp.js";
2
2
  import { r as formatValidationErrors } from "../request-CLOYytGP.js";
3
3
  import { n as ValidationException } from "../errors-JpkcCjjn.js";
4
4
  import { n as ServiceProvider } from "../ServiceProvider-G0YclITd.js";
@@ -1,5 +1,5 @@
1
1
  import { n as detectServerlessRuntime } from "../serverless-D96rJb6x.js";
2
- import { a as getJob } from "../Job-DsFMcXVk.js";
2
+ import { a as getJob } from "../Job-0Prk8k0z.js";
3
3
  import { t as deserializeQueuedJob } from "../serialize-CKXek0Tr.js";
4
4
  import { handle } from "hono/aws-lambda";
5
5
  //#region src/lambda/index.ts
@@ -1,4 +1,4 @@
1
1
  import { n as filterSensitiveData, t as Logger } from "../Logger-DWXdtLSJ.js";
2
2
  import { a as LOG_LEVEL_PRIORITY, i as matchDailyFileDate, n as dailyFileDateStamp, r as dailyFilePath, t as DailyFileChannel } from "../DailyFileChannel-CTTPA0EF.js";
3
- import { a as FileChannel, i as setLogManager, n as createLogManager, o as ConsoleChannel, r as getLogManager, t as LogManager } from "../logging-Ci0mBk5k.js";
3
+ import { a as FileChannel, i as setLogManager, n as createLogManager, o as ConsoleChannel, r as getLogManager, t as LogManager } from "../logging-Br9bZlaG.js";
4
4
  export { ConsoleChannel, DailyFileChannel, FileChannel, LOG_LEVEL_PRIORITY, LogManager, Logger, createLogManager, dailyFileDateStamp, dailyFilePath, filterSensitiveData, getLogManager, matchDailyFileDate, setLogManager };
@@ -1,4 +1,4 @@
1
- import { h as warnDeprecatedSetter, i as bindAmbient, m as warnDeprecatedGetter, n as ambientBinding } from "./default-application-DWwscxfW.js";
1
+ import { g as warnDeprecatedSetter, h as warnDeprecatedGetter, i as bindAmbient, n as ambientBinding } from "./default-application-s9SE-Er7.js";
2
2
  import { r as isPromiseLike, t as Logger } from "./Logger-DWXdtLSJ.js";
3
3
  import { a as LOG_LEVEL_PRIORITY, t as DailyFileChannel } from "./DailyFileChannel-CTTPA0EF.js";
4
4
  import * as path$1 from "node:path";
@@ -1,2 +1,2 @@
1
- import { a as MailManager, c as MemoryTransport, i as setMailManager, l as ResendTransport, n as getMailManager, o as createMailManager, r as mail, s as LogTransport, t as Mail, u as SmtpTransport } from "../mail-CI2Kfe8P.js";
1
+ import { a as MailManager, c as MemoryTransport, i as setMailManager, l as ResendTransport, n as getMailManager, o as createMailManager, r as mail, s as LogTransport, t as Mail, u as SmtpTransport } from "../mail-BQ2y2U5c.js";
2
2
  export { LogTransport, Mail, MailManager, MemoryTransport, ResendTransport, SmtpTransport, createMailManager, getMailManager, mail, setMailManager };
@@ -1,6 +1,6 @@
1
1
  import { t as resolveOptional } from "./resolve-optional-ax6gPWTp.js";
2
- import { h as warnDeprecatedSetter, i as bindAmbient, m as warnDeprecatedGetter, n as ambientBinding } from "./default-application-DWwscxfW.js";
3
- import { c as pinnedQueueDriver, d as resolveQueueDriver, i as enqueueJob, l as registerJob, t as Job } from "./Job-DsFMcXVk.js";
2
+ import { g as warnDeprecatedSetter, h as warnDeprecatedGetter, i as bindAmbient, n as ambientBinding } from "./default-application-s9SE-Er7.js";
3
+ import { c as pinnedQueueDriver, d as resolveQueueDriver, i as enqueueJob, l as registerJob, t as Job } from "./Job-0Prk8k0z.js";
4
4
  import { t as parseMailAddress } from "./address-D0Iq-XIH.js";
5
5
  import nodemailer from "nodemailer";
6
6
  //#region src/mail/transports/SmtpTransport.ts
@@ -1,2 +1,2 @@
1
- import { a as NotificationManager, c as setNotificationManager, d as getNotification, f as registerNotification, i as MailChannel, l as resolveNotifiableType, n as SlackChannel, o as createNotificationManager, p as Notification, r as DatabaseChannel, s as getNotificationManager, t as MemoryChannel, u as clearNotificationRegistry } from "../notifications-Bp2uamzD.js";
1
+ import { a as NotificationManager, c as setNotificationManager, d as getNotification, f as registerNotification, i as MailChannel, l as resolveNotifiableType, n as SlackChannel, o as createNotificationManager, p as Notification, r as DatabaseChannel, s as getNotificationManager, t as MemoryChannel, u as clearNotificationRegistry } from "../notifications-R7Uj-aT7.js";
2
2
  export { DatabaseChannel, MailChannel, MemoryChannel, Notification, NotificationManager, SlackChannel, clearNotificationRegistry, createNotificationManager, getNotification, getNotificationManager, registerNotification, resolveNotifiableType, setNotificationManager };
@@ -1,5 +1,5 @@
1
- import { h as warnDeprecatedSetter, i as bindAmbient, m as warnDeprecatedGetter, n as ambientBinding } from "./default-application-DWwscxfW.js";
2
- import { l as registerJob, p as reportRegistryCollision, t as Job } from "./Job-DsFMcXVk.js";
1
+ import { g as warnDeprecatedSetter, h as warnDeprecatedGetter, i as bindAmbient, n as ambientBinding } from "./default-application-s9SE-Er7.js";
2
+ import { l as registerJob, p as reportRegistryCollision, t as Job } from "./Job-0Prk8k0z.js";
3
3
  import { t as parseMailAddress } from "./address-D0Iq-XIH.js";
4
4
  //#region src/notifications/Notification.ts
5
5
  /**
@@ -1,3 +1,3 @@
1
- import { a as getJob, d as resolveQueueDriver, f as setQueueDriver, l as registerJob, n as clearJobRegistry, o as getQueueDriver, r as clearQueueDriver, s as getRegisteredJobs, t as Job, u as resolveJobName } from "../Job-DsFMcXVk.js";
2
- import { a as processJob, c as RedisDriver, i as Worker, l as SyncDriver, n as createQueueManager, o as SqsDriver, r as FailedJobReporter, s as createSqsAdapter, t as QueueManager, u as MemoryDriver } from "../queue-C8s3buYz.js";
1
+ import { a as getJob, d as resolveQueueDriver, f as setQueueDriver, l as registerJob, n as clearJobRegistry, o as getQueueDriver, r as clearQueueDriver, s as getRegisteredJobs, t as Job, u as resolveJobName } from "../Job-0Prk8k0z.js";
2
+ import { a as processJob, c as RedisDriver, i as Worker, l as SyncDriver, n as createQueueManager, o as SqsDriver, r as FailedJobReporter, s as createSqsAdapter, t as QueueManager, u as MemoryDriver } from "../queue-jvxB1MFh.js";
3
3
  export { FailedJobReporter, Job, MemoryDriver, QueueManager, RedisDriver, SqsDriver, SyncDriver, Worker, clearJobRegistry, clearQueueDriver, createQueueManager, createSqsAdapter, getJob, getQueueDriver, getRegisteredJobs, processJob, registerJob, resolveJobName, resolveQueueDriver, setQueueDriver };
@@ -1,5 +1,5 @@
1
1
  import { t as warnOnce } from "./warn-once-p-IlMjra.js";
2
- import { a as getJob, i as enqueueJob } from "./Job-DsFMcXVk.js";
2
+ import { a as getJob, i as enqueueJob } from "./Job-0Prk8k0z.js";
3
3
  import { t as describeDriverMap } from "./driver-map-CkQc52j-.js";
4
4
  import { t as deserializeQueuedJob } from "./serialize-CKXek0Tr.js";
5
5
  import { randomUUID } from "node:crypto";
@@ -2,7 +2,7 @@ import { a as trimTrailingSlashes, n as isRealPathWithin, t as isPathWithin } fr
2
2
  import { n as parseImportMap } from "../inertia-defaults-BjrcT7za.js";
3
3
  import { n as hash } from "../Hash-D2DFd8xX.js";
4
4
  import { a as getManifestCss, c as isViteProduction, d as startViteDevServer, i as clientManifestCandidates, l as loadViteManifest, o as getManifestFile, r as PUBLIC_ASSETS_URL_PREFIX, u as normalizeDevServerUrl } from "../vite-manifest-DO0pU1vm.js";
5
- import { r as logDevServerBanner, t as GUREN_ASCII_ART } from "../dev-banner-BAXzolUl.js";
5
+ import { r as logDevServerBanner, t as GUREN_ASCII_ART } from "../dev-banner-Cw8VnH6J.js";
6
6
  import { createRequire } from "node:module";
7
7
  import { dirname, extname, join, resolve } from "node:path";
8
8
  import { fileURLToPath } from "node:url";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guren/server",
3
- "version": "2.29.0",
3
+ "version": "2.30.0",
4
4
  "description": "HTTP layer of the Guren framework, on Hono: routing, controllers, middleware, auth, sessions, queues and the AWS Lambda adapter. Applications import it through @guren/core.",
5
5
  "keywords": [
6
6
  "guren",
@@ -164,7 +164,7 @@
164
164
  "test": "bun test"
165
165
  },
166
166
  "dependencies": {
167
- "@guren/orm": "^2.13.1",
167
+ "@guren/orm": "^2.14.0",
168
168
  "chalk": "^5.3.0",
169
169
  "consola": "^3.4.2",
170
170
  "figlet": "^1.7.0",