veryfront 0.1.635 → 0.1.637

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 (88) hide show
  1. package/esm/cli/commands/serve/command.d.ts.map +1 -1
  2. package/esm/cli/commands/serve/command.js +2 -1
  3. package/esm/deno.js +1 -1
  4. package/esm/src/cache/distributed-cache-init.d.ts +11 -2
  5. package/esm/src/cache/distributed-cache-init.d.ts.map +1 -1
  6. package/esm/src/cache/distributed-cache-init.js +2 -14
  7. package/esm/src/channels/control-plane.d.ts +5 -5
  8. package/esm/src/embedding/chunk.js +4 -2
  9. package/esm/src/errors/error-registry/agent.d.ts +16 -0
  10. package/esm/src/errors/error-registry/agent.d.ts.map +1 -0
  11. package/esm/src/errors/error-registry/agent.js +52 -0
  12. package/esm/src/errors/error-registry/boundary.d.ts +16 -0
  13. package/esm/src/errors/error-registry/boundary.d.ts.map +1 -0
  14. package/esm/src/errors/error-registry/boundary.js +52 -0
  15. package/esm/src/errors/error-registry/build.d.ts +20 -0
  16. package/esm/src/errors/error-registry/build.d.ts.map +1 -0
  17. package/esm/src/errors/error-registry/build.js +68 -0
  18. package/esm/src/errors/error-registry/config.d.ts +22 -0
  19. package/esm/src/errors/error-registry/config.d.ts.map +1 -0
  20. package/esm/src/errors/error-registry/config.js +70 -0
  21. package/esm/src/errors/error-registry/deploy.d.ts +12 -0
  22. package/esm/src/errors/error-registry/deploy.d.ts.map +1 -0
  23. package/esm/src/errors/error-registry/deploy.js +36 -0
  24. package/esm/src/errors/error-registry/dev.d.ts +14 -0
  25. package/esm/src/errors/error-registry/dev.d.ts.map +1 -0
  26. package/esm/src/errors/error-registry/dev.js +44 -0
  27. package/esm/src/errors/error-registry/general.d.ts +29 -0
  28. package/esm/src/errors/error-registry/general.d.ts.map +1 -0
  29. package/esm/src/errors/error-registry/general.js +92 -0
  30. package/esm/src/errors/error-registry/module.d.ts +16 -0
  31. package/esm/src/errors/error-registry/module.d.ts.map +1 -0
  32. package/esm/src/errors/error-registry/module.js +52 -0
  33. package/esm/src/errors/error-registry/route.d.ts +16 -0
  34. package/esm/src/errors/error-registry/route.d.ts.map +1 -0
  35. package/esm/src/errors/error-registry/route.js +52 -0
  36. package/esm/src/errors/error-registry/runtime.d.ts +18 -0
  37. package/esm/src/errors/error-registry/runtime.d.ts.map +1 -0
  38. package/esm/src/errors/error-registry/runtime.js +60 -0
  39. package/esm/src/errors/error-registry/server.d.ts +39 -0
  40. package/esm/src/errors/error-registry/server.d.ts.map +1 -0
  41. package/esm/src/errors/error-registry/server.js +129 -0
  42. package/esm/src/errors/error-registry.d.ts +79 -157
  43. package/esm/src/errors/error-registry.d.ts.map +1 -1
  44. package/esm/src/errors/error-registry.js +37 -706
  45. package/esm/src/errors/logging.d.ts.map +1 -1
  46. package/esm/src/errors/logging.js +7 -3
  47. package/esm/src/integrations/schema.d.ts +4 -4
  48. package/esm/src/internal-agents/control-plane-auth.d.ts +1 -1
  49. package/esm/src/internal-agents/run-stream.d.ts.map +1 -1
  50. package/esm/src/internal-agents/run-stream.js +15 -1
  51. package/esm/src/oauth/index.d.ts +1 -0
  52. package/esm/src/oauth/index.d.ts.map +1 -1
  53. package/esm/src/oauth/token-store/index.d.ts +1 -0
  54. package/esm/src/oauth/token-store/index.d.ts.map +1 -1
  55. package/esm/src/oauth/token-store/memory.d.ts +26 -4
  56. package/esm/src/oauth/token-store/memory.d.ts.map +1 -1
  57. package/esm/src/oauth/token-store/memory.js +42 -5
  58. package/esm/src/observability/log-buffer.d.ts.map +1 -1
  59. package/esm/src/observability/log-buffer.js +7 -1
  60. package/esm/src/platform/adapters/redis/modules.d.ts.map +1 -1
  61. package/esm/src/platform/adapters/redis/modules.js +3 -10
  62. package/esm/src/security/sandbox/project-worker.d.ts.map +1 -1
  63. package/esm/src/security/sandbox/project-worker.js +0 -1
  64. package/esm/src/server/dev-server/server.d.ts.map +1 -1
  65. package/esm/src/server/dev-server/server.js +2 -1
  66. package/esm/src/server/distributed-cache-initializers.d.ts +13 -0
  67. package/esm/src/server/distributed-cache-initializers.d.ts.map +1 -0
  68. package/esm/src/server/distributed-cache-initializers.js +22 -0
  69. package/esm/src/server/handlers/request/agent-stream.handler.d.ts.map +1 -1
  70. package/esm/src/server/handlers/request/agent-stream.handler.js +56 -16
  71. package/esm/src/server/index.d.ts +1 -0
  72. package/esm/src/server/index.d.ts.map +1 -1
  73. package/esm/src/server/index.js +1 -0
  74. package/esm/src/server/production-server.d.ts.map +1 -1
  75. package/esm/src/server/production-server.js +2 -1
  76. package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.d.ts.map +1 -1
  77. package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.js +2 -2
  78. package/esm/src/utils/logger/logger.d.ts.map +1 -1
  79. package/esm/src/utils/logger/logger.js +15 -5
  80. package/esm/src/utils/logger/redact.d.ts +64 -0
  81. package/esm/src/utils/logger/redact.d.ts.map +1 -0
  82. package/esm/src/utils/logger/redact.js +235 -0
  83. package/esm/src/utils/redis-client.d.ts.map +1 -1
  84. package/esm/src/utils/redis-client.js +0 -3
  85. package/esm/src/utils/version-constant.d.ts +1 -1
  86. package/esm/src/utils/version-constant.js +1 -1
  87. package/esm/src/workflow/schemas/workflow.schema.d.ts +4 -4
  88. package/package.json +2 -1
@@ -38,6 +38,7 @@ export { DevServer, startDevServer, startProductionServer };
38
38
  export { createVeryfrontServer, startNodeVeryfrontServer, startVeryfrontServer, } from "./service-server.js";
39
39
  import { ReloadNotifier } from "./reload-notifier.js";
40
40
  export { ReloadNotifier };
41
+ export { defaultDistributedCacheInitializers } from "./distributed-cache-initializers.js";
41
42
  /**
42
43
  * Create a Veryfront request handler for use with any HTTP framework.
43
44
  *
@@ -1 +1 @@
1
- {"version":3,"file":"production-server.d.ts","sourceRoot":"","sources":["../../../src/src/server/production-server.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAInE,OAAO,EAAiB,KAAK,eAA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9F,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC;AAED,gCAAgC;AAChC,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,4BAA4B,GACpC,OAAO,CAAC,YAAY,CAAC,CA0JvB"}
1
+ {"version":3,"file":"production-server.d.ts","sourceRoot":"","sources":["../../../src/src/server/production-server.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAInE,OAAO,EAAiB,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AA4BrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAgFtE,sEAAsE;AACtE,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kEAAkE;IAClE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,UAAU,aAAa;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,sFAAsF;IACtF,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oFAAoF;IACpF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,uGAAuG;IACvG,kBAAkB,CAAC,EAAE,SAAS,GAAG,YAAY,CAAC;IAC9C;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAClE,oFAAoF;IACpF,eAAe,CAAC,EAAE,gBAAgB,CAAC;IACnC,sFAAsF;IACtF,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC;AAED,6CAA6C;AAC7C,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACrB,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAED,mDAAmD;AACnD,MAAM,WAAW,4BAA6B,SAAQ,aAAa;IACjE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,8FAA8F;IAC9F,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC;AAED,gCAAgC;AAChC,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,4BAA4B,GACpC,OAAO,CAAC,YAAY,CAAC,CA0JvB"}
@@ -8,6 +8,7 @@ import { isDebugEnabled } from "../utils/constants/env.js";
8
8
  import { initializeOTLPWithApis, shutdownOTLP, withSpan, } from "../observability/tracing/otlp-setup.js";
9
9
  import { startConfiguredMemoryMonitoring, stopMemoryMonitoring, } from "../utils/memory/index.js";
10
10
  import { initializeDistributedCaches } from "../cache/distributed-cache-init.js";
11
+ import { defaultDistributedCacheInitializers } from "./distributed-cache-initializers.js";
11
12
  import { getConfig } from "../config/index.js";
12
13
  import { resolveStyleContentVersion } from "../html/styles-builder/content-version.js";
13
14
  import { buildPreparedCSSArtifactFromFiles, collectLocalProjectSourceFiles, readLocalProjectStylesheet, } from "../html/styles-builder/css-pregeneration.js";
@@ -220,7 +221,7 @@ if (globalThis[Symbol.for("import-meta-ponyfill-esmodule")](import.meta).main) {
220
221
  // Backend: API (production) > Redis (local dev) > Memory (fallback)
221
222
  const [otlpResult, cacheResult] = await Promise.allSettled([
222
223
  initializeOTLPWithApis(),
223
- initializeDistributedCaches(),
224
+ initializeDistributedCaches(defaultDistributedCacheInitializers),
224
225
  ]);
225
226
  if (otlpResult.status === "rejected") {
226
227
  logger.warn("OTLP initialization failed, continuing without tracing", {
@@ -1 +1 @@
1
- {"version":3,"file":"rsc-bundles.generated.d.ts","sourceRoot":"","sources":["../../../../../../src/src/server/services/rsc/endpoints/rsc-bundles.generated.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,kBAAkB,EAAE,MACu2xB,CAAC;AAEz4xB,eAAO,MAAM,iBAAiB,EAAE,MAC83iB,CAAC"}
1
+ {"version":3,"file":"rsc-bundles.generated.d.ts","sourceRoot":"","sources":["../../../../../../src/src/server/services/rsc/endpoints/rsc-bundles.generated.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,kBAAkB,EAAE,MACi11B,CAAC;AAEn31B,eAAO,MAAM,iBAAiB,EAAE,MAC40mB,CAAC"}
@@ -5,5 +5,5 @@
5
5
  * Do not edit manually — run `deno task generate` to regenerate.
6
6
  * @module
7
7
  */
8
- export const CLIENT_BOOT_BUNDLE = 'var W=Object.defineProperty;var q=(t,e,r)=>e in t?W(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var R=(t,e,r)=>q(t,typeof e!="symbol"?e+"":e,r);var z="3.2.3";function X(t,e,r,n){let s=[];if(n?.external?.length&&s.push(`external=${n.external.join(",")}`),s.push(`target=${n?.target??"es2022"}`),n?.deps){let d=Object.entries(n.deps).map(([l,p])=>`${l}@${p}`).join(",");s.push(`deps=${d}`)}let u=e?`@${e}`:"",c=r??"",i=s.length?`?${s.join("&")}`:"";return`https://esm.sh/${t}${u}${c}${i}`}function m(t,e,r,n=!1){return X(t,e,r,{external:n?["react"]:void 0,deps:{csstype:z}})}var K="19.2.4",E=K;function P(t=E){return{react:m("react",t),"react-dom":m("react-dom",t,void 0,!0),"react-dom/client":m("react-dom",t,"/client",!0),"react-dom/server":m("react-dom",t,"/server",!0),"react/jsx-runtime":m("react",t,"/jsx-runtime",!0),"react/jsx-dev-runtime":m("react",t,"/jsx-dev-runtime",!0)}}function V(t=E){return P(t).react}function H(t=E){return P(t)["react-dom/client"]}function Z(t){return t.replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}function D(t){return Z(btoa(t))}var Ft=Object.freeze({react:"","react-dom":"","react-dom/client":"","react-dom/server":"","react/jsx-runtime":"","react/jsx-dev-runtime":""});function v(t,e){if(!e)return!1;if(Object.prototype.hasOwnProperty.call(e,t))return!0;for(let r of Object.keys(e))if(r.endsWith("/")&&t.startsWith(r))return!0;return!1}function Q(t){try{return JSON.parse(t)?.imports??{}}catch{return{}}}function w(t=document){let e=t.querySelector(\'script[type="importmap"]\');return e?.textContent?Q(e.textContent):{}}var a="/_veryfront",b={RSC:`${a}/rsc/`,FS:`${a}/fs/`,MODULES:`${a}/modules/`,PAGES:`${a}/pages/`,DATA:`${a}/data/`,LIB:`${a}/lib/`,CHUNKS:`${a}/chunks/`,CLIENT:`${a}/client/`},F={HMR_RUNTIME:`${a}/hmr-runtime.js`,HMR:`${a}/hmr.js`,ERROR_OVERLAY:`${a}/error-overlay.js`,DEV_LOADER:`${a}/dev-loader.js`,CLIENT_LOG:`${a}/log`,CLIENT_JS:`${a}/client.js`,ROUTER_JS:`${a}/router.js`,PREFETCH_JS:`${a}/prefetch.js`,MANIFEST_JSON:`${a}/manifest.json`,APP_JS:`${a}/app.js`,RSC_CLIENT:`${a}/rsc/client.js`,RSC_MANIFEST:`${a}/rsc/manifest`,RSC_STREAM:`${a}/rsc/stream`,RSC_PAYLOAD:`${a}/rsc/payload`,RSC_RENDER:`${a}/rsc/render`,RSC_PAGE:`${a}/rsc/page`,RSC_MODULE:`${a}/rsc/module`,RSC_DOM:`${a}/rsc/dom.js`,LIB_CHAT_REACT:`${a}/lib/chat/react.js`,LIB_CHAT_COMPONENTS:`${a}/lib/chat/components.js`,LIB_CHAT_PRIMITIVES:`${a}/lib/chat/primitives.js`};var et={ROOT:".veryfront",CACHE:".veryfront/cache",KV:".veryfront/kv",LOGS:".veryfront/logs",TMP:".veryfront/tmp"},jt=et.CACHE;var Yt={HMR_RUNTIME:F.HMR_RUNTIME,ERROR_OVERLAY:F.ERROR_OVERLAY};var y=b.RSC,k=b.FS,$="veryfront-hydration-data",_="rsc-root";function O(t=document){try{let e=t.getElementById($);return e?JSON.parse(e.textContent||"{}"):null}catch(e){return console.debug?.("[RSC] hydration data parse failed",e),null}}function x(t){return t?.clientModuleStrategy?t.clientModuleStrategy:t?.dev?"fs":"rsc-module"}function rt(t){return`${k}${D(t)}.js`}function ot(t,e){let r=e?`&v=${encodeURIComponent(e)}`:"";return`${y}module?rel=${encodeURIComponent(t)}${r}`}function T(t){if(t.strategy==="fs"){let e=t.absPath??t.rel;return e?rt(e):null}return ot(t.rel,t.version)}function I(t=document,e=E){let r=w(t);return{react:v("react",r)?"react":V(e),reactDomClient:v("react-dom/client",r)?"react-dom/client":H(e)}}function o(t){return{...t,create(e){return new M(e?.message||e?.detail||t.title,{slug:t.slug,category:t.category,status:e?.status??t.status,title:t.title,suggestion:t.suggestion,detail:e?.detail,cause:e?.cause,instance:e?.instance,context:e?.context})}}}var M=class extends Error{constructor(r,n){super(r);R(this,"slug");R(this,"category");R(this,"status");R(this,"title");R(this,"suggestion");R(this,"detail");R(this,"cause");R(this,"instance");R(this,"context");this.name="VeryfrontError",this.slug=n.slug,this.category=n.category,this.status=n.status,this.title=n.title,this.suggestion=n.suggestion,this.detail=n.detail,this.cause=n.cause,this.instance=n.instance,this.context=n.context}toRFC9457(){return{type:`https://veryfront.com/docs/errors/${this.slug}`,title:this.title,status:this.status,detail:this.detail,instance:this.instance,category:this.category,suggestion:this.suggestion,cause:typeof this.cause=="string"?this.cause:void 0}}getDocsUrl(){return`https://veryfront.com/docs/errors/${this.slug}`}};var ue=o({slug:"config-not-found",category:"CONFIG",status:404,title:"Configuration file not found",suggestion:"Run \'vf init\' to create a configuration file"}),ge=o({slug:"config-invalid",category:"CONFIG",status:400,title:"Invalid configuration format",suggestion:"Check your veryfront.config.ts for syntax errors"}),de=o({slug:"config-parse-error",category:"CONFIG",status:400,title:"Failed to parse configuration",suggestion:"Ensure your configuration file is valid TypeScript/JSON"}),pe=o({slug:"config-validation-error",category:"CONFIG",status:422,title:"Configuration validation failed",suggestion:"Check the configuration against the schema requirements"}),Re=o({slug:"config-type-error",category:"CONFIG",status:400,title:"Configuration type mismatch",suggestion:"Ensure configuration values match expected types"}),me=o({slug:"import-map-invalid",category:"CONFIG",status:400,title:"Invalid import map configuration",suggestion:"Check your import map syntax and paths"}),fe=o({slug:"cors-config-invalid",category:"CONFIG",status:400,title:"Invalid CORS configuration",suggestion:"Review CORS settings in your configuration"}),Ee=o({slug:"config-validation-failed",category:"CONFIG",status:400,title:"Configuration validation failed",suggestion:"Check configuration values against requirements"}),ye=o({slug:"build-failed",category:"BUILD",status:500,title:"Build process failed",suggestion:"Check the build output for specific errors"}),_e=o({slug:"bundle-error",category:"BUILD",status:500,title:"Bundle generation failed",suggestion:"Review bundler output for details"}),he=o({slug:"typescript-error",category:"BUILD",status:500,title:"TypeScript compilation error",suggestion:"Fix TypeScript errors shown in the output"}),Ce=o({slug:"mdx-compile-error",category:"BUILD",status:500,title:"MDX compilation failed",suggestion:"Check your MDX file syntax"}),Se=o({slug:"asset-optimization-error",category:"BUILD",status:500,title:"Asset optimization failed",suggestion:"Check asset file formats and paths"}),Oe=o({slug:"ssg-generation-error",category:"BUILD",status:500,title:"Static site generation failed",suggestion:"Review SSG configuration and data fetching"}),xe=o({slug:"sourcemap-error",category:"BUILD",status:500,title:"Source map generation failed",suggestion:"Check source map configuration"}),Te=o({slug:"compilation-error",category:"BUILD",status:500,title:"Compilation failed",suggestion:"Review compiler output for specific errors"}),Ie=o({slug:"hydration-mismatch",category:"RUNTIME",status:500,title:"Client/server hydration mismatch",suggestion:"Ensure server and client render the same content"}),Ae=o({slug:"render-error",category:"RUNTIME",status:500,title:"Component render failed",suggestion:"Check component for runtime errors"}),Ne=o({slug:"component-error",category:"RUNTIME",status:500,title:"Component execution error",suggestion:"Review component logic and props"}),De=o({slug:"layout-not-found",category:"RUNTIME",status:404,title:"Layout component not found",suggestion:"Ensure layout file exists at the expected path"}),ve=o({slug:"page-not-found",category:"RUNTIME",status:404,title:"Page component not found",suggestion:"Check that the page file exists in the routes directory"}),be=o({slug:"api-error",category:"RUNTIME",status:500,title:"API route handler error",suggestion:"Review API route handler for errors"}),Me=o({slug:"middleware-error",category:"RUNTIME",status:500,title:"Middleware execution error",suggestion:"Check middleware function for errors"}),Le=o({slug:"route-conflict",category:"ROUTE",status:409,title:"Conflicting route definitions",suggestion:"Rename or reorganize conflicting route files"}),Ue=o({slug:"invalid-route-file",category:"ROUTE",status:400,title:"Invalid route file structure",suggestion:"Ensure route file exports required functions"}),Pe=o({slug:"route-handler-invalid",category:"ROUTE",status:400,title:"Invalid route handler export",suggestion:"Export a valid handler function from the route file"}),Ve=o({slug:"dynamic-route-error",category:"ROUTE",status:500,title:"Dynamic route parsing failed",suggestion:"Check dynamic route segment syntax"}),He=o({slug:"route-params-error",category:"ROUTE",status:400,title:"Route parameters invalid",suggestion:"Validate route parameter values"}),we=o({slug:"api-route-error",category:"ROUTE",status:500,title:"API route definition error",suggestion:"Review API route configuration"}),Fe=o({slug:"module-not-found",category:"MODULE",status:404,title:"Module could not be resolved",suggestion:"Check the import path and ensure the module is installed"}),ke=o({slug:"import-resolution-error",category:"MODULE",status:500,title:"Import path resolution failed",suggestion:"Verify import paths and module configuration"}),$e=o({slug:"circular-dependency",category:"MODULE",status:500,title:"Circular dependency detected",suggestion:"Refactor imports to break the circular dependency"}),Be=o({slug:"invalid-import",category:"MODULE",status:400,title:"Invalid import statement",suggestion:"Fix import syntax or path"}),Ge=o({slug:"dependency-missing",category:"MODULE",status:404,title:"Required dependency not installed",suggestion:"Install the missing dependency with your package manager"}),je=o({slug:"version-mismatch",category:"MODULE",status:409,title:"Dependency version mismatch",suggestion:"Update dependencies to compatible versions"}),Ye=o({slug:"port-in-use",category:"SERVER",status:409,title:"Server port already in use",suggestion:"Use a different port or stop the process using this port"}),We=o({slug:"server-start-error",category:"SERVER",status:500,title:"Server failed to start",suggestion:"Check server configuration and port availability"}),qe=o({slug:"cache-error",category:"SERVER",status:500,title:"Cache operation failed",suggestion:"Clear the cache and try again"}),ze=o({slug:"file-watch-error",category:"SERVER",status:500,title:"File watcher error",suggestion:"Restart the development server"}),Xe=o({slug:"request-error",category:"SERVER",status:500,title:"HTTP request handling error",suggestion:"Check request handler and middleware"}),Je=o({slug:"service-overloaded",category:"SERVER",status:503,title:"Service overloaded",suggestion:"Reduce load or scale up resources"}),Ke=o({slug:"semaphore-timeout",category:"SERVER",status:503,title:"Semaphore acquire timeout",suggestion:"Reduce concurrency or increase the semaphore acquire timeout"}),Ze=o({slug:"circuit-breaker-open",category:"SERVER",status:503,title:"Circuit breaker is open",suggestion:"Wait for the breaker reset timeout before retrying"}),Qe=o({slug:"cache-path-mismatch",category:"SERVER",status:500,title:"Cache path mismatch",suggestion:"Clear the cache directory and rebuild"}),tr=o({slug:"network-error",category:"SERVER",status:502,title:"Network operation failed",suggestion:"Check network connectivity and retry"}),er=o({slug:"api-client-error",category:"SERVER",status:500,title:"API client request failed",suggestion:"Check API connectivity and authentication"}),rr=o({slug:"token-storage-error",category:"SERVER",status:500,title:"Token storage operation failed",suggestion:"Check token storage backend and credentials"}),or=o({slug:"cache-invariant-violation",category:"SERVER",status:500,title:"Cache path invariant violated",suggestion:"Clear the cache and rebuild"}),nr=o({slug:"release-not-found",category:"SERVER",status:404,title:"No active release found",suggestion:"Deploy the project to create a release for this environment"}),sr=o({slug:"fallback-exhausted",category:"SERVER",status:500,title:"Primary and fallback operations both failed",suggestion:"Check service availability and connectivity"}),ir=o({slug:"client-boundary-violation",category:"BOUNDARY",status:400,title:"Client boundary rule violation",suggestion:"Add \'use client\' directive or move code to a client component"}),ar=o({slug:"server-only-in-client",category:"BOUNDARY",status:400,title:"Server-only code in client component",suggestion:"Move server-only code to a server component"}),cr=o({slug:"client-only-in-server",category:"BOUNDARY",status:400,title:"Client-only code in server component",suggestion:"Move client-only code to a client component"}),lr=o({slug:"invalid-use-client",category:"BOUNDARY",status:400,title:"Invalid \'use client\' directive",suggestion:"Place \'use client\' at the top of the file"}),ur=o({slug:"invalid-use-server",category:"BOUNDARY",status:400,title:"Invalid \'use server\' directive",suggestion:"Place \'use server\' at the top of the file or function"}),gr=o({slug:"rsc-payload-error",category:"BOUNDARY",status:500,title:"RSC payload serialization error",suggestion:"Ensure props are serializable (no functions, symbols, etc.)"}),dr=o({slug:"hmr-error",category:"DEV",status:500,title:"Hot module replacement error",suggestion:"Restart the development server"}),pr=o({slug:"dev-server-error",category:"DEV",status:500,title:"Development server error",suggestion:"Check the dev server logs and restart"}),Rr=o({slug:"fast-refresh-error",category:"DEV",status:500,title:"Fast refresh failed",suggestion:"Save the file again or restart the dev server"}),mr=o({slug:"error-overlay-error",category:"DEV",status:500,title:"Error overlay failed",suggestion:"Check browser console for details"}),fr=o({slug:"source-map-error",category:"DEV",status:500,title:"Source map loading error",suggestion:"Rebuild or clear cache"}),Er=o({slug:"deployment-error",category:"DEPLOY",status:500,title:"Deployment process failed",suggestion:"Check deployment logs for details"}),yr=o({slug:"platform-error",category:"DEPLOY",status:500,title:"Platform-specific error",suggestion:"Check platform documentation and requirements"}),_r=o({slug:"env-var-missing",category:"DEPLOY",status:500,title:"Required environment variable missing",suggestion:"Set the required environment variable"}),hr=o({slug:"production-build-required",category:"DEPLOY",status:400,title:"Production build required",suggestion:"Run \'vf build\' before deploying"}),Cr=o({slug:"agent-error",category:"AGENT",status:500,title:"Agent operation error",suggestion:"Check agent configuration and logs"}),Sr=o({slug:"agent-not-found",category:"AGENT",status:404,title:"Agent not found",suggestion:"Verify the agent ID exists"}),Or=o({slug:"agent-timeout",category:"AGENT",status:408,title:"Agent operation timed out",suggestion:"Increase timeout or simplify the request"}),xr=o({slug:"agent-intent-error",category:"AGENT",status:400,title:"Agent intent parsing error",suggestion:"Rephrase the request more clearly"}),Tr=o({slug:"orchestration-error",category:"AGENT",status:500,title:"Multi-agent orchestration error",suggestion:"Check agent coordination logic"}),Ir=o({slug:"cost-limit-exceeded",category:"AGENT",status:429,title:"Cost limit exceeded",suggestion:"Wait for the budget period to reset or increase the limit"}),Ar=o({slug:"unknown-error",category:"GENERAL",status:500,title:"Unknown/unclassified error",suggestion:"Check logs for more details"}),Nr=o({slug:"permission-denied",category:"GENERAL",status:403,title:"File/resource permission denied",suggestion:"Check file permissions and access rights"}),Dr=o({slug:"file-not-found",category:"GENERAL",status:404,title:"File not found",suggestion:"Verify the file path exists"}),vr=o({slug:"resource-not-found",category:"GENERAL",status:404,title:"Requested resource not found",suggestion:"Verify the referenced resource ID or name exists"}),br=o({slug:"invalid-argument",category:"GENERAL",status:400,title:"Invalid function argument",suggestion:"Check argument types and values"}),Mr=o({slug:"timeout-error",category:"GENERAL",status:408,title:"Operation timed out",suggestion:"Increase timeout or optimize the operation"}),Lr=o({slug:"initialization-error",category:"GENERAL",status:500,title:"Initialization failed",suggestion:"Check initialization requirements and dependencies"}),Ur=o({slug:"not-supported",category:"GENERAL",status:501,title:"Feature not supported",suggestion:"Check documentation for supported features"}),B=o({slug:"security-violation",category:"GENERAL",status:403,title:"Security violation detected",suggestion:"Check for path traversal or unauthorized access attempts"}),Pr=o({slug:"input-validation-failed",category:"GENERAL",status:400,title:"Input validation failed",suggestion:"Check request input against validation rules"});var nt=[{pattern:/<script[^>]*>[\\s\\S]*?<\\/script>/gi,name:"inline script"},{pattern:/javascript:/gi,name:"javascript: URL"},{pattern:/\\bon\\w+\\s*=/gi,name:"event handler attribute"},{pattern:/data:\\s*text\\/html/gi,name:"data: HTML URL"}];function st(){let t=globalThis;return t.__VERYFRONT_DEV__===!0||t.Deno?.env?.get?.("VERYFRONT_ENV")==="development"}function h(t,e={}){let{strict:r=!1,warn:n=!0}=e;for(let{pattern:s,name:u}of nt)if(s.lastIndex=0,!!s.test(t)&&(n&&console.warn(`[Security] Suspicious ${u} detected in server HTML`),r||!st()))throw B.create({detail:`Potentially unsafe HTML: ${u} detected`});return t}var f=class{constructor(e,r){this.prefix=e;this.level=r}log(e,r,n,...s){this.level>e||r?.(n,...s)}debug(e,...r){this.log(0,console.debug,`[${this.prefix}] DEBUG: ${e}`,...r)}info(e,...r){this.log(1,console.log,`[${this.prefix}] ${e}`,...r)}warn(e,...r){this.log(2,console.warn,`[${this.prefix}] WARN: ${e}`,...r)}error(e,...r){this.log(3,console.error,`[${this.prefix}] ERROR: ${e}`,...r)}};function it(){if(typeof window>"u")return 2;let t=globalThis;return t.__VERYFRONT_DEV__||t.__RSC_DEV__?t.__VERYFRONT_DEBUG__||t.__RSC_DEBUG__?0:1:2}var A=it(),g=new f("RSC",A),$r=new f("PREFETCH",A),Br=new f("HYDRATE",A),Gr=new f("VERYFRONT",A);function C(t,e){let r=e==="root"?_:`rsc-slot-${e}`,n=t.getElementById(r);if(n)return n;let s=t.createElement("div");return s.id=r,t.body.appendChild(s),s}function at(t,e){if(e.type!=="slot")return;let r=C(t,e.id);r.innerHTML=h(String(e.html??""))}function G(t,e){let r=e.split(`\n`),n=r.pop()??"";for(let s of r){let u=s.trim();if(!u)continue;let c;try{c=JSON.parse(u)}catch(d){g.debug("[client-dom] malformed NDJSON line",{line:u,error:d instanceof Error?d.message:String(d)});continue}if(!c||typeof c!="object")continue;let i=c;if(i.type==="slot"){at(t,i);try{ut(t,i.id||"root")}catch(d){g.debug("[client-dom] hydration optional failed",d)}}}return n}function ct(t){return new Promise((e,r)=>{let n=()=>r(new DOMException("aborted","AbortError"));if(t.aborted){n();return}t.addEventListener("abort",n,{once:!0})})}async function j(t,e=document,r){let n="body"in t?t:null,s=n?.body??t;if(!s)return;let u=s.getReader(),c=new TextDecoder,i="",d=!1;try{for(;;){if(r?.aborted)throw new DOMException("aborted","AbortError");let l=u.read(),{done:p,value:S}=r?await Promise.race([l,ct(r)]):await l;if(p){d=!0;break}i+=c.decode(S,{stream:!0}),i=G(e,i)}i&&G(e,`${i}\n`)}catch(l){throw l instanceof Error&&l.name==="AbortError"||g.debug("[client-dom] consumeNdjsonStream error",l),l}finally{try{await u.cancel()}catch(l){d||g.debug("[client-dom] reader.cancel failed",l)}try{u.releaseLock()}catch(l){g.debug("[client-dom] reader.releaseLock failed",l)}if(typeof s.cancel=="function")try{await s.cancel()}catch(l){g.debug("[client-dom] stream.cancel failed",l)}if(typeof n?.body?.cancel=="function")try{await n.body.cancel()}catch(l){g.debug("[client-dom] response.body.cancel failed",l)}}}function lt(t,e){let r=C(t,e),n=[],s=u=>{let c=u;c.dataset?.clientRef&&n.push(c);for(let i of u.children)s(i)};return s(r),n}function ut(t,e){let r=lt(t,e);for(let n of r){let s=n.dataset?.clientRef;s&&(n.dataset.hydrated="true",g.debug("[client-dom] marked for hydration",s))}}var gt=100;function dt(t,e){if(globalThis.__VF_CLIENT_MOD_CACHE??(globalThis.__VF_CLIENT_MOD_CACHE=new Map),globalThis.__VF_CLIENT_MOD_CACHE.size>=gt){let r=globalThis.__VF_CLIENT_MOD_CACHE.keys().next().value;r&&globalThis.__VF_CLIENT_MOD_CACHE.delete(r)}globalThis.__VF_CLIENT_MOD_CACHE.set(t,e)}function pt(t){let e=t.match(/^\\/app\\/(.+)#([A-Za-z0-9_]+)$/);return e?{rel:`/${e[1]||""}`,exportName:e[2]||"default"}:null}async function Rt(){try{let t=await fetch("/_veryfront/rsc/manifest");return t.ok?await t.json():null}catch{return null}}async function mt(t,e,r){let n=t.graphIds?.client.find(c=>c.rel===e)?.path,s=`${e}#${t.hash??""}`;try{let c=globalThis.__VF_CLIENT_MOD_CACHE?.get(s);if(c)return c}catch(c){g.debug("hydrate: cache get failed",c)}let u=T({strategy:r,rel:e,absPath:n,version:t.hash});if(!u)return null;try{let c=await import(u);try{dt(s,c)}catch(i){g.debug("hydrate: cache set failed",i)}return c}catch(c){return g.debug("hydrate: failed to import module",{moduleUrl:u,error:c}),null}}async function Y(t=document){let e=null;try{e=await Rt()}catch(i){g.debug("hydrate: fetch manifest failed",i)}if(!e){g.debug("hydrate: no manifest");return}let r=Array.from(t.querySelectorAll("[data-client-ref]"));try{let i=globalThis.__VF_MANIFEST_HASH;if(!r.some(l=>l.dataset?.hydrated!=="true")&&i&&e.hash&&i===e.hash)return}catch(i){g.debug("hydrate: hmr hash read failed",i)}if(r.length===0){try{globalThis.__VF_MANIFEST_HASH=e.hash??""}catch(i){g.debug("hydrate: set hash failed",i)}return}let n=x(O(t));try{if(globalThis.__VF_TEST_MODE__){globalThis.__VF_HYDRATE_CALLED=!0,globalThis.__VF_MANIFEST_HASH=e.hash??"";return}}catch(i){g.debug("hydrate: test mode flags failed",i)}let s=I(t),[{default:u},{createRoot:c}]=await Promise.all([import(s.react),import(s.reactDomClient)]);for(let i of r){let d=i.dataset?.clientRef??"";if(!d||i.dataset?.hydrated==="true")continue;let l=pt(d);if(!l)continue;let p=await mt(e,l.rel,n);if(!p)continue;let S=p[l.exportName]??p.default;if(typeof S=="function")try{c(i).render(u.createElement(S,{})),i.dataset.hydrated="true"}catch(U){g.warn("hydrate: render failed",U)}}try{globalThis.__VF_MANIFEST_HASH=e.hash??""}catch(i){g.debug("hydrate: set hash failed (post)",i)}}async function ft(){let t=I(document),[e,r]=await Promise.all([import(t.react),import(t.reactDomClient)]);return{React:e,ReactDOM:r}}var Et=new Set(["SCRIPT","STYLE","NOSCRIPT","TEMPLATE"]);function L(t){let e=t.getAttribute("style")??"";return t.hasAttribute("data-veryfront-head")||t.hasAttribute("hidden")||/(?:^|;)\\s*display\\s*:\\s*none(?:\\s*;|$)/i.test(e)||Et.has(t.tagName.toUpperCase())}function yt(t,e){return t.find(r=>r.tagName.toUpperCase()==="DIV"&&!!r.getAttribute("class")?.trim()&&!L(r))??e}function _t(t,e){return t===e}function ht(t,e){let r=document.createElement("div");r.setAttribute("data-veryfront-hydration-root","page");let n=t.find(s=>!L(s));n?.parentNode===e?e.insertBefore(r,n):e.appendChild(r);for(let s of t)!L(s)&&s.parentNode===e&&r.appendChild(s);return r}function Ct(t,e,r=document){return!!e?.pagePath&&typeof t?.__veryfrontRenderPage=="function"&&!!r.getElementById("root")}function St(t,e){return e?.pagePath?!1:!!t.getElementById(_)}function Ot(t=import.meta.url){try{return new URL(t,"http://veryfront.local").searchParams.get("hydrate")==="1"}catch{return!1}}function xt(t){return t==="rsc-module"}async function Tt(t){try{let e=await fetch(y+"stream"+t);if(!e.ok||!e.body)return!1;let r=new AbortController;return addEventListener("pagehide",()=>r.abort(),{once:!0}),await j(e,document,r.signal),!0}catch(e){return console.debug?.("[RSC] tryStream failed",e),!1}}async function N(){try{await Y(document)}catch(t){console.debug?.("[RSC] hydration failed",t)}}async function It(t,e){try{let{React:r,ReactDOM:n}=await ft(),s=T({strategy:e,rel:t});if(!s)return!1;console.debug?.("[RSC] Loading component from:",s);let c=(await import(s)).default;if(typeof c!="function")return console.debug?.("[RSC] Page component is not a function"),!1;let i=Array.from(document.body.children),d=yt(i,document.body),l=_t(d,document.body)?ht(i,document.body):d,p=r.createElement(c,{});return xt(e)?n.createRoot(l).render(p):n.hydrateRoot(l,p,{identifierPrefix:"vf",onRecoverableError:()=>{}}),console.debug?.("[RSC] Page component hydrated successfully"),!0}catch(r){return console.error("[RSC] Page hydration failed",r),!1}}async function At(t){try{let e=await fetch(y+"payload"+t);if(!e.ok)return!1;let r=await e.json();if(r?.slots){for(let[n,s]of Object.entries(r.slots))C(document,n).innerHTML=h(String(s||""));return!0}return C(document,_).innerHTML=h(String(r?.html||"")),!0}catch(e){return console.debug?.("[RSC] payload fetch failed",e),!1}}async function Nt(){try{let t=globalThis.window?.location.search??"",e=O(document);if(Ot()){await N();return}let r=e?.pagePath,n=x(e);if(r){if(Ct(globalThis.window,e,document)){console.debug?.("[RSC] Page renderer owns hydration");return}console.debug?.("[RSC] Found page component in hydration data:",r),await It(r,n)&&console.debug?.("[RSC] Client component hydrated successfully");return}if(!St(document,e))return;if(await Tt(t)){await N();return}if(await At(t)){await N();return}await N()}catch(t){console.error("[RSC] boot failed",t)}}if(typeof document<"u"){let t=()=>{Nt()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t,{once:!0}):t()}export{Nt as boot,yt as selectHydrationRoot,St as shouldAttemptRSCTransport,Ot as shouldHydrateOnly,xt as shouldRenderPageComponent,Ct as shouldUsePageRendererHydration,_t as shouldWrapPageHydrationRoot};\n';
9
- export const CLIENT_DOM_BUNDLE = 'var N=Object.defineProperty;var A=(r,t,o)=>t in r?N(r,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[t]=o;var l=(r,t,o)=>A(r,typeof t!="symbol"?t+"":t,o);function e(r){return{...r,create(t){return new f(t?.message||t?.detail||r.title,{slug:r.slug,category:r.category,status:t?.status??r.status,title:r.title,suggestion:r.suggestion,detail:t?.detail,cause:t?.cause,instance:t?.instance,context:t?.context})}}}var f=class extends Error{constructor(o,s){super(o);l(this,"slug");l(this,"category");l(this,"status");l(this,"title");l(this,"suggestion");l(this,"detail");l(this,"cause");l(this,"instance");l(this,"context");this.name="VeryfrontError",this.slug=s.slug,this.category=s.category,this.status=s.status,this.title=s.title,this.suggestion=s.suggestion,this.detail=s.detail,this.cause=s.cause,this.instance=s.instance,this.context=s.context}toRFC9457(){return{type:`https://veryfront.com/docs/errors/${this.slug}`,title:this.title,status:this.status,detail:this.detail,instance:this.instance,category:this.category,suggestion:this.suggestion,cause:typeof this.cause=="string"?this.cause:void 0}}getDocsUrl(){return`https://veryfront.com/docs/errors/${this.slug}`}};var z=e({slug:"config-not-found",category:"CONFIG",status:404,title:"Configuration file not found",suggestion:"Run \'vf init\' to create a configuration file"}),W=e({slug:"config-invalid",category:"CONFIG",status:400,title:"Invalid configuration format",suggestion:"Check your veryfront.config.ts for syntax errors"}),X=e({slug:"config-parse-error",category:"CONFIG",status:400,title:"Failed to parse configuration",suggestion:"Ensure your configuration file is valid TypeScript/JSON"}),K=e({slug:"config-validation-error",category:"CONFIG",status:422,title:"Configuration validation failed",suggestion:"Check the configuration against the schema requirements"}),J=e({slug:"config-type-error",category:"CONFIG",status:400,title:"Configuration type mismatch",suggestion:"Ensure configuration values match expected types"}),Z=e({slug:"import-map-invalid",category:"CONFIG",status:400,title:"Invalid import map configuration",suggestion:"Check your import map syntax and paths"}),Q=e({slug:"cors-config-invalid",category:"CONFIG",status:400,title:"Invalid CORS configuration",suggestion:"Review CORS settings in your configuration"}),ee=e({slug:"config-validation-failed",category:"CONFIG",status:400,title:"Configuration validation failed",suggestion:"Check configuration values against requirements"}),te=e({slug:"build-failed",category:"BUILD",status:500,title:"Build process failed",suggestion:"Check the build output for specific errors"}),re=e({slug:"bundle-error",category:"BUILD",status:500,title:"Bundle generation failed",suggestion:"Review bundler output for details"}),oe=e({slug:"typescript-error",category:"BUILD",status:500,title:"TypeScript compilation error",suggestion:"Fix TypeScript errors shown in the output"}),se=e({slug:"mdx-compile-error",category:"BUILD",status:500,title:"MDX compilation failed",suggestion:"Check your MDX file syntax"}),ne=e({slug:"asset-optimization-error",category:"BUILD",status:500,title:"Asset optimization failed",suggestion:"Check asset file formats and paths"}),ie=e({slug:"ssg-generation-error",category:"BUILD",status:500,title:"Static site generation failed",suggestion:"Review SSG configuration and data fetching"}),ae=e({slug:"sourcemap-error",category:"BUILD",status:500,title:"Source map generation failed",suggestion:"Check source map configuration"}),ce=e({slug:"compilation-error",category:"BUILD",status:500,title:"Compilation failed",suggestion:"Review compiler output for specific errors"}),ue=e({slug:"hydration-mismatch",category:"RUNTIME",status:500,title:"Client/server hydration mismatch",suggestion:"Ensure server and client render the same content"}),le=e({slug:"render-error",category:"RUNTIME",status:500,title:"Component render failed",suggestion:"Check component for runtime errors"}),ge=e({slug:"component-error",category:"RUNTIME",status:500,title:"Component execution error",suggestion:"Review component logic and props"}),de=e({slug:"layout-not-found",category:"RUNTIME",status:404,title:"Layout component not found",suggestion:"Ensure layout file exists at the expected path"}),pe=e({slug:"page-not-found",category:"RUNTIME",status:404,title:"Page component not found",suggestion:"Check that the page file exists in the routes directory"}),Ee=e({slug:"api-error",category:"RUNTIME",status:500,title:"API route handler error",suggestion:"Review API route handler for errors"}),Re=e({slug:"middleware-error",category:"RUNTIME",status:500,title:"Middleware execution error",suggestion:"Check middleware function for errors"}),fe=e({slug:"route-conflict",category:"ROUTE",status:409,title:"Conflicting route definitions",suggestion:"Rename or reorganize conflicting route files"}),me=e({slug:"invalid-route-file",category:"ROUTE",status:400,title:"Invalid route file structure",suggestion:"Ensure route file exports required functions"}),ye=e({slug:"route-handler-invalid",category:"ROUTE",status:400,title:"Invalid route handler export",suggestion:"Export a valid handler function from the route file"}),_e=e({slug:"dynamic-route-error",category:"ROUTE",status:500,title:"Dynamic route parsing failed",suggestion:"Check dynamic route segment syntax"}),Oe=e({slug:"route-params-error",category:"ROUTE",status:400,title:"Route parameters invalid",suggestion:"Validate route parameter values"}),he=e({slug:"api-route-error",category:"ROUTE",status:500,title:"API route definition error",suggestion:"Review API route configuration"}),Te=e({slug:"module-not-found",category:"MODULE",status:404,title:"Module could not be resolved",suggestion:"Check the import path and ensure the module is installed"}),Ie=e({slug:"import-resolution-error",category:"MODULE",status:500,title:"Import path resolution failed",suggestion:"Verify import paths and module configuration"}),xe=e({slug:"circular-dependency",category:"MODULE",status:500,title:"Circular dependency detected",suggestion:"Refactor imports to break the circular dependency"}),ve=e({slug:"invalid-import",category:"MODULE",status:400,title:"Invalid import statement",suggestion:"Fix import syntax or path"}),Ne=e({slug:"dependency-missing",category:"MODULE",status:404,title:"Required dependency not installed",suggestion:"Install the missing dependency with your package manager"}),Ae=e({slug:"version-mismatch",category:"MODULE",status:409,title:"Dependency version mismatch",suggestion:"Update dependencies to compatible versions"}),Ce=e({slug:"port-in-use",category:"SERVER",status:409,title:"Server port already in use",suggestion:"Use a different port or stop the process using this port"}),Se=e({slug:"server-start-error",category:"SERVER",status:500,title:"Server failed to start",suggestion:"Check server configuration and port availability"}),De=e({slug:"cache-error",category:"SERVER",status:500,title:"Cache operation failed",suggestion:"Clear the cache and try again"}),Le=e({slug:"file-watch-error",category:"SERVER",status:500,title:"File watcher error",suggestion:"Restart the development server"}),Ue=e({slug:"request-error",category:"SERVER",status:500,title:"HTTP request handling error",suggestion:"Check request handler and middleware"}),be=e({slug:"service-overloaded",category:"SERVER",status:503,title:"Service overloaded",suggestion:"Reduce load or scale up resources"}),Me=e({slug:"semaphore-timeout",category:"SERVER",status:503,title:"Semaphore acquire timeout",suggestion:"Reduce concurrency or increase the semaphore acquire timeout"}),Pe=e({slug:"circuit-breaker-open",category:"SERVER",status:503,title:"Circuit breaker is open",suggestion:"Wait for the breaker reset timeout before retrying"}),Ve=e({slug:"cache-path-mismatch",category:"SERVER",status:500,title:"Cache path mismatch",suggestion:"Clear the cache directory and rebuild"}),ke=e({slug:"network-error",category:"SERVER",status:502,title:"Network operation failed",suggestion:"Check network connectivity and retry"}),Fe=e({slug:"api-client-error",category:"SERVER",status:500,title:"API client request failed",suggestion:"Check API connectivity and authentication"}),we=e({slug:"token-storage-error",category:"SERVER",status:500,title:"Token storage operation failed",suggestion:"Check token storage backend and credentials"}),Ge=e({slug:"cache-invariant-violation",category:"SERVER",status:500,title:"Cache path invariant violated",suggestion:"Clear the cache and rebuild"}),He=e({slug:"release-not-found",category:"SERVER",status:404,title:"No active release found",suggestion:"Deploy the project to create a release for this environment"}),Be=e({slug:"fallback-exhausted",category:"SERVER",status:500,title:"Primary and fallback operations both failed",suggestion:"Check service availability and connectivity"}),$e=e({slug:"client-boundary-violation",category:"BOUNDARY",status:400,title:"Client boundary rule violation",suggestion:"Add \'use client\' directive or move code to a client component"}),Ye=e({slug:"server-only-in-client",category:"BOUNDARY",status:400,title:"Server-only code in client component",suggestion:"Move server-only code to a server component"}),je=e({slug:"client-only-in-server",category:"BOUNDARY",status:400,title:"Client-only code in server component",suggestion:"Move client-only code to a client component"}),qe=e({slug:"invalid-use-client",category:"BOUNDARY",status:400,title:"Invalid \'use client\' directive",suggestion:"Place \'use client\' at the top of the file"}),ze=e({slug:"invalid-use-server",category:"BOUNDARY",status:400,title:"Invalid \'use server\' directive",suggestion:"Place \'use server\' at the top of the file or function"}),We=e({slug:"rsc-payload-error",category:"BOUNDARY",status:500,title:"RSC payload serialization error",suggestion:"Ensure props are serializable (no functions, symbols, etc.)"}),Xe=e({slug:"hmr-error",category:"DEV",status:500,title:"Hot module replacement error",suggestion:"Restart the development server"}),Ke=e({slug:"dev-server-error",category:"DEV",status:500,title:"Development server error",suggestion:"Check the dev server logs and restart"}),Je=e({slug:"fast-refresh-error",category:"DEV",status:500,title:"Fast refresh failed",suggestion:"Save the file again or restart the dev server"}),Ze=e({slug:"error-overlay-error",category:"DEV",status:500,title:"Error overlay failed",suggestion:"Check browser console for details"}),Qe=e({slug:"source-map-error",category:"DEV",status:500,title:"Source map loading error",suggestion:"Rebuild or clear cache"}),et=e({slug:"deployment-error",category:"DEPLOY",status:500,title:"Deployment process failed",suggestion:"Check deployment logs for details"}),tt=e({slug:"platform-error",category:"DEPLOY",status:500,title:"Platform-specific error",suggestion:"Check platform documentation and requirements"}),rt=e({slug:"env-var-missing",category:"DEPLOY",status:500,title:"Required environment variable missing",suggestion:"Set the required environment variable"}),ot=e({slug:"production-build-required",category:"DEPLOY",status:400,title:"Production build required",suggestion:"Run \'vf build\' before deploying"}),st=e({slug:"agent-error",category:"AGENT",status:500,title:"Agent operation error",suggestion:"Check agent configuration and logs"}),nt=e({slug:"agent-not-found",category:"AGENT",status:404,title:"Agent not found",suggestion:"Verify the agent ID exists"}),it=e({slug:"agent-timeout",category:"AGENT",status:408,title:"Agent operation timed out",suggestion:"Increase timeout or simplify the request"}),at=e({slug:"agent-intent-error",category:"AGENT",status:400,title:"Agent intent parsing error",suggestion:"Rephrase the request more clearly"}),ct=e({slug:"orchestration-error",category:"AGENT",status:500,title:"Multi-agent orchestration error",suggestion:"Check agent coordination logic"}),ut=e({slug:"cost-limit-exceeded",category:"AGENT",status:429,title:"Cost limit exceeded",suggestion:"Wait for the budget period to reset or increase the limit"}),lt=e({slug:"unknown-error",category:"GENERAL",status:500,title:"Unknown/unclassified error",suggestion:"Check logs for more details"}),gt=e({slug:"permission-denied",category:"GENERAL",status:403,title:"File/resource permission denied",suggestion:"Check file permissions and access rights"}),dt=e({slug:"file-not-found",category:"GENERAL",status:404,title:"File not found",suggestion:"Verify the file path exists"}),pt=e({slug:"resource-not-found",category:"GENERAL",status:404,title:"Requested resource not found",suggestion:"Verify the referenced resource ID or name exists"}),Et=e({slug:"invalid-argument",category:"GENERAL",status:400,title:"Invalid function argument",suggestion:"Check argument types and values"}),Rt=e({slug:"timeout-error",category:"GENERAL",status:408,title:"Operation timed out",suggestion:"Increase timeout or optimize the operation"}),ft=e({slug:"initialization-error",category:"GENERAL",status:500,title:"Initialization failed",suggestion:"Check initialization requirements and dependencies"}),mt=e({slug:"not-supported",category:"GENERAL",status:501,title:"Feature not supported",suggestion:"Check documentation for supported features"}),y=e({slug:"security-violation",category:"GENERAL",status:403,title:"Security violation detected",suggestion:"Check for path traversal or unauthorized access attempts"}),yt=e({slug:"input-validation-failed",category:"GENERAL",status:400,title:"Input validation failed",suggestion:"Check request input against validation rules"});var C=[{pattern:/<script[^>]*>[\\s\\S]*?<\\/script>/gi,name:"inline script"},{pattern:/javascript:/gi,name:"javascript: URL"},{pattern:/\\bon\\w+\\s*=/gi,name:"event handler attribute"},{pattern:/data:\\s*text\\/html/gi,name:"data: HTML URL"}];function S(){let r=globalThis;return r.__VERYFRONT_DEV__===!0||r.Deno?.env?.get?.("VERYFRONT_ENV")==="development"}function _(r,t={}){let{strict:o=!1,warn:s=!0}=t;for(let{pattern:i,name:c}of C)if(i.lastIndex=0,!!i.test(r)&&(s&&console.warn(`[Security] Suspicious ${c} detected in server HTML`),o||!S()))throw y.create({detail:`Potentially unsafe HTML: ${c} detected`});return r}var E=class{constructor(t,o){this.prefix=t;this.level=o}log(t,o,s,...i){this.level>t||o?.(s,...i)}debug(t,...o){this.log(0,console.debug,`[${this.prefix}] DEBUG: ${t}`,...o)}info(t,...o){this.log(1,console.log,`[${this.prefix}] ${t}`,...o)}warn(t,...o){this.log(2,console.warn,`[${this.prefix}] WARN: ${t}`,...o)}error(t,...o){this.log(3,console.error,`[${this.prefix}] ERROR: ${t}`,...o)}};function D(){if(typeof window>"u")return 2;let r=globalThis;return r.__VERYFRONT_DEV__||r.__RSC_DEV__?r.__VERYFRONT_DEBUG__||r.__RSC_DEBUG__?0:1:2}var R=D(),d=new E("RSC",R),xt=new E("PREFETCH",R),vt=new E("HYDRATE",R),Nt=new E("VERYFRONT",R);var n="/_veryfront",m={RSC:`${n}/rsc/`,FS:`${n}/fs/`,MODULES:`${n}/modules/`,PAGES:`${n}/pages/`,DATA:`${n}/data/`,LIB:`${n}/lib/`,CHUNKS:`${n}/chunks/`,CLIENT:`${n}/client/`},O={HMR_RUNTIME:`${n}/hmr-runtime.js`,HMR:`${n}/hmr.js`,ERROR_OVERLAY:`${n}/error-overlay.js`,DEV_LOADER:`${n}/dev-loader.js`,CLIENT_LOG:`${n}/log`,CLIENT_JS:`${n}/client.js`,ROUTER_JS:`${n}/router.js`,PREFETCH_JS:`${n}/prefetch.js`,MANIFEST_JSON:`${n}/manifest.json`,APP_JS:`${n}/app.js`,RSC_CLIENT:`${n}/rsc/client.js`,RSC_MANIFEST:`${n}/rsc/manifest`,RSC_STREAM:`${n}/rsc/stream`,RSC_PAYLOAD:`${n}/rsc/payload`,RSC_RENDER:`${n}/rsc/render`,RSC_PAGE:`${n}/rsc/page`,RSC_MODULE:`${n}/rsc/module`,RSC_DOM:`${n}/rsc/dom.js`,LIB_CHAT_REACT:`${n}/lib/chat/react.js`,LIB_CHAT_COMPONENTS:`${n}/lib/chat/components.js`,LIB_CHAT_PRIMITIVES:`${n}/lib/chat/primitives.js`};var U={ROOT:".veryfront",CACHE:".veryfront/cache",KV:".veryfront/kv",LOGS:".veryfront/logs",TMP:".veryfront/tmp"},Lt=U.CACHE;var Ut={HMR_RUNTIME:O.HMR_RUNTIME,ERROR_OVERLAY:O.ERROR_OVERLAY};var Vt=m.RSC,kt=m.FS;var h="rsc-root";function I(r,t){let o=t==="root"?h:`rsc-slot-${t}`,s=r.getElementById(o);if(s)return s;let i=r.createElement("div");return i.id=o,r.body.appendChild(i),i}function b(r,t){if(t.type!=="slot")return;let o=I(r,t.id);o.innerHTML=_(String(t.html??""))}function T(r,t){let o=t.split(`\n`),s=o.pop()??"";for(let i of o){let c=i.trim();if(!c)continue;let g;try{g=JSON.parse(c)}catch(p){d.debug("[client-dom] malformed NDJSON line",{line:c,error:p instanceof Error?p.message:String(p)});continue}if(!g||typeof g!="object")continue;let u=g;if(u.type==="slot"){b(r,u);try{V(r,u.id||"root")}catch(p){d.debug("[client-dom] hydration optional failed",p)}}}return s}function M(r){return new Promise((t,o)=>{let s=()=>o(new DOMException("aborted","AbortError"));if(r.aborted){s();return}r.addEventListener("abort",s,{once:!0})})}async function Bt(r,t=document,o){let s="body"in r?r:null,i=s?.body??r;if(!i)return;let c=i.getReader(),g=new TextDecoder,u="",p=!1;try{for(;;){if(o?.aborted)throw new DOMException("aborted","AbortError");let a=c.read(),{done:x,value:v}=o?await Promise.race([a,M(o)]):await a;if(x){p=!0;break}u+=g.decode(v,{stream:!0}),u=T(t,u)}u&&T(t,`${u}\n`)}catch(a){throw a instanceof Error&&a.name==="AbortError"||d.debug("[client-dom] consumeNdjsonStream error",a),a}finally{try{await c.cancel()}catch(a){p||d.debug("[client-dom] reader.cancel failed",a)}try{c.releaseLock()}catch(a){d.debug("[client-dom] reader.releaseLock failed",a)}if(typeof i.cancel=="function")try{await i.cancel()}catch(a){d.debug("[client-dom] stream.cancel failed",a)}if(typeof s?.body?.cancel=="function")try{await s.body.cancel()}catch(a){d.debug("[client-dom] response.body.cancel failed",a)}}}function P(r,t){let o=I(r,t),s=[],i=c=>{let g=c;g.dataset?.clientRef&&s.push(g);for(let u of c.children)i(u)};return i(o),s}function V(r,t){let o=P(r,t);for(let s of o){let i=s.dataset?.clientRef;i&&(s.dataset.hydrated="true",d.debug("[client-dom] marked for hydration",i))}}export{Bt as consumeNdjsonStream,I as getContainer};\n';
8
+ export const CLIENT_BOOT_BUNDLE = 'var ot=Object.defineProperty;var nt=(t,e,o)=>e in t?ot(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var R=(t,e,o)=>nt(t,typeof e!="symbol"?e+"":e,o);var st="3.2.3";function it(t,e,o,n){let s=[];if(n?.external?.length&&s.push(`external=${n.external.join(",")}`),s.push(`target=${n?.target??"es2022"}`),n?.deps){let d=Object.entries(n.deps).map(([l,p])=>`${l}@${p}`).join(",");s.push(`deps=${d}`)}let u=e?`@${e}`:"",c=o??"",i=s.length?`?${s.join("&")}`:"";return`https://esm.sh/${t}${u}${c}${i}`}function m(t,e,o,n=!1){return it(t,e,o,{external:n?["react"]:void 0,deps:{csstype:st}})}var ct="19.2.4",E=ct;function V(t=E){return{react:m("react",t),"react-dom":m("react-dom",t,void 0,!0),"react-dom/client":m("react-dom",t,"/client",!0),"react-dom/server":m("react-dom",t,"/server",!0),"react/jsx-runtime":m("react",t,"/jsx-runtime",!0),"react/jsx-dev-runtime":m("react",t,"/jsx-dev-runtime",!0)}}function H(t=E){return V(t).react}function w(t=E){return V(t)["react-dom/client"]}function lt(t){return t.replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}function D(t){return lt(btoa(t))}var Cr=Object.freeze({react:"","react-dom":"","react-dom/client":"","react-dom/server":"","react/jsx-runtime":"","react/jsx-dev-runtime":""});function v(t,e){if(!e)return!1;if(Object.prototype.hasOwnProperty.call(e,t))return!0;for(let o of Object.keys(e))if(o.endsWith("/")&&t.startsWith(o))return!0;return!1}function ut(t){try{return JSON.parse(t)?.imports??{}}catch{return{}}}function F(t=document){let e=t.querySelector(\'script[type="importmap"]\');return e?.textContent?ut(e.textContent):{}}var a="/_veryfront",b={RSC:`${a}/rsc/`,FS:`${a}/fs/`,MODULES:`${a}/modules/`,PAGES:`${a}/pages/`,DATA:`${a}/data/`,LIB:`${a}/lib/`,CHUNKS:`${a}/chunks/`,CLIENT:`${a}/client/`},G={HMR_RUNTIME:`${a}/hmr-runtime.js`,HMR:`${a}/hmr.js`,ERROR_OVERLAY:`${a}/error-overlay.js`,DEV_LOADER:`${a}/dev-loader.js`,CLIENT_LOG:`${a}/log`,CLIENT_JS:`${a}/client.js`,ROUTER_JS:`${a}/router.js`,PREFETCH_JS:`${a}/prefetch.js`,MANIFEST_JSON:`${a}/manifest.json`,APP_JS:`${a}/app.js`,RSC_CLIENT:`${a}/rsc/client.js`,RSC_MANIFEST:`${a}/rsc/manifest`,RSC_STREAM:`${a}/rsc/stream`,RSC_PAYLOAD:`${a}/rsc/payload`,RSC_RENDER:`${a}/rsc/render`,RSC_PAGE:`${a}/rsc/page`,RSC_MODULE:`${a}/rsc/module`,RSC_DOM:`${a}/rsc/dom.js`,LIB_CHAT_REACT:`${a}/lib/chat/react.js`,LIB_CHAT_COMPONENTS:`${a}/lib/chat/components.js`,LIB_CHAT_PRIMITIVES:`${a}/lib/chat/primitives.js`};var dt={ROOT:".veryfront",CACHE:".veryfront/cache",KV:".veryfront/kv",LOGS:".veryfront/logs",TMP:".veryfront/tmp"},Ar=dt.CACHE;var Nr={HMR_RUNTIME:G.HMR_RUNTIME,ERROR_OVERLAY:G.ERROR_OVERLAY};var y=b.RSC,k=b.FS,$="veryfront-hydration-data",_="rsc-root";function T(t=document){try{let e=t.getElementById($);return e?JSON.parse(e.textContent||"{}"):null}catch(e){return console.debug?.("[RSC] hydration data parse failed",e),null}}function x(t){return t?.clientModuleStrategy?t.clientModuleStrategy:t?.dev?"fs":"rsc-module"}function pt(t){return`${k}${D(t)}.js`}function Rt(t,e){let o=e?`&v=${encodeURIComponent(e)}`:"";return`${y}module?rel=${encodeURIComponent(t)}${o}`}function I(t){if(t.strategy==="fs"){let e=t.absPath??t.rel;return e?pt(e):null}return Rt(t.rel,t.version)}function O(t=document,e=E){let o=F(t);return{react:v("react",o)?"react":H(e),reactDomClient:v("react-dom/client",o)?"react-dom/client":w(e)}}function r(t){return{...t,create(e){return new M(e?.message||e?.detail||t.title,{slug:t.slug,category:t.category,status:e?.status??t.status,title:t.title,suggestion:t.suggestion,detail:e?.detail,cause:e?.cause,instance:e?.instance,context:e?.context})}}}var M=class extends Error{constructor(o,n){super(o);R(this,"slug");R(this,"category");R(this,"status");R(this,"title");R(this,"suggestion");R(this,"detail");R(this,"cause");R(this,"instance");R(this,"context");this.name="VeryfrontError",this.slug=n.slug,this.category=n.category,this.status=n.status,this.title=n.title,this.suggestion=n.suggestion,this.detail=n.detail,this.cause=n.cause,this.instance=n.instance,this.context=n.context}toRFC9457(){return{type:`https://veryfront.com/docs/errors/${this.slug}`,title:this.title,status:this.status,detail:this.detail,instance:this.instance,category:this.category,suggestion:this.suggestion,cause:typeof this.cause=="string"?this.cause:void 0}}getDocsUrl(){return`https://veryfront.com/docs/errors/${this.slug}`}};var mt=r({slug:"config-not-found",category:"CONFIG",status:404,title:"Configuration file not found",suggestion:"Run \'vf init\' to create a configuration file"}),ft=r({slug:"config-invalid",category:"CONFIG",status:400,title:"Invalid configuration format",suggestion:"Check your veryfront.config.ts for syntax errors"}),Et=r({slug:"config-parse-error",category:"CONFIG",status:400,title:"Failed to parse configuration",suggestion:"Ensure your configuration file is valid TypeScript/JSON"}),yt=r({slug:"config-validation-error",category:"CONFIG",status:422,title:"Configuration validation failed",suggestion:"Check the configuration against the schema requirements"}),_t=r({slug:"config-type-error",category:"CONFIG",status:400,title:"Configuration type mismatch",suggestion:"Ensure configuration values match expected types"}),ht=r({slug:"import-map-invalid",category:"CONFIG",status:400,title:"Invalid import map configuration",suggestion:"Check your import map syntax and paths"}),St=r({slug:"cors-config-invalid",category:"CONFIG",status:400,title:"Invalid CORS configuration",suggestion:"Review CORS settings in your configuration"}),Ct=r({slug:"config-validation-failed",category:"CONFIG",status:400,title:"Configuration validation failed",suggestion:"Check configuration values against requirements"}),Y={"config-not-found":mt,"config-invalid":ft,"config-parse-error":Et,"config-validation-error":yt,"config-type-error":_t,"import-map-invalid":ht,"cors-config-invalid":St,"config-validation-failed":Ct};var Tt=r({slug:"build-failed",category:"BUILD",status:500,title:"Build process failed",suggestion:"Check the build output for specific errors"}),xt=r({slug:"bundle-error",category:"BUILD",status:500,title:"Bundle generation failed",suggestion:"Review bundler output for details"}),It=r({slug:"typescript-error",category:"BUILD",status:500,title:"TypeScript compilation error",suggestion:"Fix TypeScript errors shown in the output"}),Ot=r({slug:"mdx-compile-error",category:"BUILD",status:500,title:"MDX compilation failed",suggestion:"Check your MDX file syntax"}),At=r({slug:"asset-optimization-error",category:"BUILD",status:500,title:"Asset optimization failed",suggestion:"Check asset file formats and paths"}),Nt=r({slug:"ssg-generation-error",category:"BUILD",status:500,title:"Static site generation failed",suggestion:"Review SSG configuration and data fetching"}),Dt=r({slug:"sourcemap-error",category:"BUILD",status:500,title:"Source map generation failed",suggestion:"Check source map configuration"}),vt=r({slug:"compilation-error",category:"BUILD",status:500,title:"Compilation failed",suggestion:"Review compiler output for specific errors"}),B={"build-failed":Tt,"bundle-error":xt,"typescript-error":It,"mdx-compile-error":Ot,"asset-optimization-error":At,"ssg-generation-error":Nt,"sourcemap-error":Dt,"compilation-error":vt};var bt=r({slug:"hydration-mismatch",category:"RUNTIME",status:500,title:"Client/server hydration mismatch",suggestion:"Ensure server and client render the same content"}),Mt=r({slug:"render-error",category:"RUNTIME",status:500,title:"Component render failed",suggestion:"Check component for runtime errors"}),Lt=r({slug:"component-error",category:"RUNTIME",status:500,title:"Component execution error",suggestion:"Review component logic and props"}),Ut=r({slug:"layout-not-found",category:"RUNTIME",status:404,title:"Layout component not found",suggestion:"Ensure layout file exists at the expected path"}),Pt=r({slug:"page-not-found",category:"RUNTIME",status:404,title:"Page component not found",suggestion:"Check that the page file exists in the routes directory"}),Vt=r({slug:"api-error",category:"RUNTIME",status:500,title:"API route handler error",suggestion:"Review API route handler for errors"}),Ht=r({slug:"middleware-error",category:"RUNTIME",status:500,title:"Middleware execution error",suggestion:"Check middleware function for errors"}),j={"hydration-mismatch":bt,"render-error":Mt,"component-error":Lt,"layout-not-found":Ut,"page-not-found":Pt,"api-error":Vt,"middleware-error":Ht};var wt=r({slug:"route-conflict",category:"ROUTE",status:409,title:"Conflicting route definitions",suggestion:"Rename or reorganize conflicting route files"}),Ft=r({slug:"invalid-route-file",category:"ROUTE",status:400,title:"Invalid route file structure",suggestion:"Ensure route file exports required functions"}),Gt=r({slug:"route-handler-invalid",category:"ROUTE",status:400,title:"Invalid route handler export",suggestion:"Export a valid handler function from the route file"}),kt=r({slug:"dynamic-route-error",category:"ROUTE",status:500,title:"Dynamic route parsing failed",suggestion:"Check dynamic route segment syntax"}),$t=r({slug:"route-params-error",category:"ROUTE",status:400,title:"Route parameters invalid",suggestion:"Validate route parameter values"}),Yt=r({slug:"api-route-error",category:"ROUTE",status:500,title:"API route definition error",suggestion:"Review API route configuration"}),W={"route-conflict":wt,"invalid-route-file":Ft,"route-handler-invalid":Gt,"dynamic-route-error":kt,"route-params-error":$t,"api-route-error":Yt};var Bt=r({slug:"module-not-found",category:"MODULE",status:404,title:"Module could not be resolved",suggestion:"Check the import path and ensure the module is installed"}),jt=r({slug:"import-resolution-error",category:"MODULE",status:500,title:"Import path resolution failed",suggestion:"Verify import paths and module configuration"}),Wt=r({slug:"circular-dependency",category:"MODULE",status:500,title:"Circular dependency detected",suggestion:"Refactor imports to break the circular dependency"}),qt=r({slug:"invalid-import",category:"MODULE",status:400,title:"Invalid import statement",suggestion:"Fix import syntax or path"}),zt=r({slug:"dependency-missing",category:"MODULE",status:404,title:"Required dependency not installed",suggestion:"Install the missing dependency with your package manager"}),Xt=r({slug:"version-mismatch",category:"MODULE",status:409,title:"Dependency version mismatch",suggestion:"Update dependencies to compatible versions"}),q={"module-not-found":Bt,"import-resolution-error":jt,"circular-dependency":Wt,"invalid-import":qt,"dependency-missing":zt,"version-mismatch":Xt};var Jt=r({slug:"port-in-use",category:"SERVER",status:409,title:"Server port already in use",suggestion:"Use a different port or stop the process using this port"}),Kt=r({slug:"server-start-error",category:"SERVER",status:500,title:"Server failed to start",suggestion:"Check server configuration and port availability"}),Zt=r({slug:"cache-error",category:"SERVER",status:500,title:"Cache operation failed",suggestion:"Clear the cache and try again"}),Qt=r({slug:"file-watch-error",category:"SERVER",status:500,title:"File watcher error",suggestion:"Restart the development server"}),te=r({slug:"request-error",category:"SERVER",status:500,title:"HTTP request handling error",suggestion:"Check request handler and middleware"}),ee=r({slug:"service-overloaded",category:"SERVER",status:503,title:"Service overloaded",suggestion:"Reduce load or scale up resources"}),re=r({slug:"semaphore-timeout",category:"SERVER",status:503,title:"Semaphore acquire timeout",suggestion:"Reduce concurrency or increase the semaphore acquire timeout"}),oe=r({slug:"circuit-breaker-open",category:"SERVER",status:503,title:"Circuit breaker is open",suggestion:"Wait for the breaker reset timeout before retrying"}),ne=r({slug:"cache-path-mismatch",category:"SERVER",status:500,title:"Cache path mismatch",suggestion:"Clear the cache directory and rebuild"}),se=r({slug:"network-error",category:"SERVER",status:502,title:"Network operation failed",suggestion:"Check network connectivity and retry"}),ie=r({slug:"api-client-error",category:"SERVER",status:500,title:"API client request failed",suggestion:"Check API connectivity and authentication"}),ae=r({slug:"token-storage-error",category:"SERVER",status:500,title:"Token storage operation failed",suggestion:"Check token storage backend and credentials"}),ce=r({slug:"cache-invariant-violation",category:"SERVER",status:500,title:"Cache path invariant violated",suggestion:"Clear the cache and rebuild"}),le=r({slug:"release-not-found",category:"SERVER",status:404,title:"No active release found",suggestion:"Deploy the project to create a release for this environment"}),ue=r({slug:"fallback-exhausted",category:"SERVER",status:500,title:"Primary and fallback operations both failed",suggestion:"Check service availability and connectivity"}),z={"port-in-use":Jt,"server-start-error":Kt,"cache-error":Zt,"file-watch-error":Qt,"request-error":te,"service-overloaded":ee,"semaphore-timeout":re,"circuit-breaker-open":oe,"cache-path-mismatch":ne,"network-error":se,"api-client-error":ie,"token-storage-error":ae,"cache-invariant-violation":ce,"release-not-found":le,"fallback-exhausted":ue};var ge=r({slug:"client-boundary-violation",category:"BOUNDARY",status:400,title:"Client boundary rule violation",suggestion:"Add \'use client\' directive or move code to a client component"}),de=r({slug:"server-only-in-client",category:"BOUNDARY",status:400,title:"Server-only code in client component",suggestion:"Move server-only code to a server component"}),pe=r({slug:"client-only-in-server",category:"BOUNDARY",status:400,title:"Client-only code in server component",suggestion:"Move client-only code to a client component"}),Re=r({slug:"invalid-use-client",category:"BOUNDARY",status:400,title:"Invalid \'use client\' directive",suggestion:"Place \'use client\' at the top of the file"}),me=r({slug:"invalid-use-server",category:"BOUNDARY",status:400,title:"Invalid \'use server\' directive",suggestion:"Place \'use server\' at the top of the file or function"}),fe=r({slug:"rsc-payload-error",category:"BOUNDARY",status:500,title:"RSC payload serialization error",suggestion:"Ensure props are serializable (no functions, symbols, etc.)"}),X={"client-boundary-violation":ge,"server-only-in-client":de,"client-only-in-server":pe,"invalid-use-client":Re,"invalid-use-server":me,"rsc-payload-error":fe};var Ee=r({slug:"hmr-error",category:"DEV",status:500,title:"Hot module replacement error",suggestion:"Restart the development server"}),ye=r({slug:"dev-server-error",category:"DEV",status:500,title:"Development server error",suggestion:"Check the dev server logs and restart"}),_e=r({slug:"fast-refresh-error",category:"DEV",status:500,title:"Fast refresh failed",suggestion:"Save the file again or restart the dev server"}),he=r({slug:"error-overlay-error",category:"DEV",status:500,title:"Error overlay failed",suggestion:"Check browser console for details"}),Se=r({slug:"source-map-error",category:"DEV",status:500,title:"Source map loading error",suggestion:"Rebuild or clear cache"}),J={"hmr-error":Ee,"dev-server-error":ye,"fast-refresh-error":_e,"error-overlay-error":he,"source-map-error":Se};var Ce=r({slug:"deployment-error",category:"DEPLOY",status:500,title:"Deployment process failed",suggestion:"Check deployment logs for details"}),Te=r({slug:"platform-error",category:"DEPLOY",status:500,title:"Platform-specific error",suggestion:"Check platform documentation and requirements"}),xe=r({slug:"env-var-missing",category:"DEPLOY",status:500,title:"Required environment variable missing",suggestion:"Set the required environment variable"}),Ie=r({slug:"production-build-required",category:"DEPLOY",status:400,title:"Production build required",suggestion:"Run \'vf build\' before deploying"}),K={"deployment-error":Ce,"platform-error":Te,"env-var-missing":xe,"production-build-required":Ie};var Oe=r({slug:"agent-error",category:"AGENT",status:500,title:"Agent operation error",suggestion:"Check agent configuration and logs"}),Ae=r({slug:"agent-not-found",category:"AGENT",status:404,title:"Agent not found",suggestion:"Verify the agent ID exists"}),Ne=r({slug:"agent-timeout",category:"AGENT",status:408,title:"Agent operation timed out",suggestion:"Increase timeout or simplify the request"}),De=r({slug:"agent-intent-error",category:"AGENT",status:400,title:"Agent intent parsing error",suggestion:"Rephrase the request more clearly"}),ve=r({slug:"orchestration-error",category:"AGENT",status:500,title:"Multi-agent orchestration error",suggestion:"Check agent coordination logic"}),be=r({slug:"cost-limit-exceeded",category:"AGENT",status:429,title:"Cost limit exceeded",suggestion:"Wait for the budget period to reset or increase the limit"}),Z={"agent-error":Oe,"agent-not-found":Ae,"agent-timeout":Ne,"agent-intent-error":De,"orchestration-error":ve,"cost-limit-exceeded":be};var Me=r({slug:"unknown-error",category:"GENERAL",status:500,title:"Unknown/unclassified error",suggestion:"Check logs for more details"}),Le=r({slug:"permission-denied",category:"GENERAL",status:403,title:"File/resource permission denied",suggestion:"Check file permissions and access rights"}),Ue=r({slug:"file-not-found",category:"GENERAL",status:404,title:"File not found",suggestion:"Verify the file path exists"}),Pe=r({slug:"resource-not-found",category:"GENERAL",status:404,title:"Requested resource not found",suggestion:"Verify the referenced resource ID or name exists"}),Ve=r({slug:"invalid-argument",category:"GENERAL",status:400,title:"Invalid function argument",suggestion:"Check argument types and values"}),He=r({slug:"timeout-error",category:"GENERAL",status:408,title:"Operation timed out",suggestion:"Increase timeout or optimize the operation"}),we=r({slug:"initialization-error",category:"GENERAL",status:500,title:"Initialization failed",suggestion:"Check initialization requirements and dependencies"}),Fe=r({slug:"not-supported",category:"GENERAL",status:501,title:"Feature not supported",suggestion:"Check documentation for supported features"}),L=r({slug:"security-violation",category:"GENERAL",status:403,title:"Security violation detected",suggestion:"Check for path traversal or unauthorized access attempts"}),Ge=r({slug:"input-validation-failed",category:"GENERAL",status:400,title:"Input validation failed",suggestion:"Check request input against validation rules"}),Q={"unknown-error":Me,"permission-denied":Le,"file-not-found":Ue,"resource-not-found":Pe,"invalid-argument":Ve,"timeout-error":He,"initialization-error":we,"not-supported":Fe,"security-violation":L,"input-validation-failed":Ge};var Oo={...Y,...B,...j,...W,...q,...z,...X,...J,...K,...Z,...Q};var ke=[{pattern:/<script[^>]*>[\\s\\S]*?<\\/script>/gi,name:"inline script"},{pattern:/javascript:/gi,name:"javascript: URL"},{pattern:/\\bon\\w+\\s*=/gi,name:"event handler attribute"},{pattern:/data:\\s*text\\/html/gi,name:"data: HTML URL"}];function $e(){let t=globalThis;return t.__VERYFRONT_DEV__===!0||t.Deno?.env?.get?.("VERYFRONT_ENV")==="development"}function h(t,e={}){let{strict:o=!1,warn:n=!0}=e;for(let{pattern:s,name:u}of ke)if(s.lastIndex=0,!!s.test(t)&&(n&&console.warn(`[Security] Suspicious ${u} detected in server HTML`),o||!$e()))throw L.create({detail:`Potentially unsafe HTML: ${u} detected`});return t}var f=class{constructor(e,o){this.prefix=e;this.level=o}log(e,o,n,...s){this.level>e||o?.(n,...s)}debug(e,...o){this.log(0,console.debug,`[${this.prefix}] DEBUG: ${e}`,...o)}info(e,...o){this.log(1,console.log,`[${this.prefix}] ${e}`,...o)}warn(e,...o){this.log(2,console.warn,`[${this.prefix}] WARN: ${e}`,...o)}error(e,...o){this.log(3,console.error,`[${this.prefix}] ERROR: ${e}`,...o)}};function Ye(){if(typeof window>"u")return 2;let t=globalThis;return t.__VERYFRONT_DEV__||t.__RSC_DEV__?t.__VERYFRONT_DEBUG__||t.__RSC_DEBUG__?0:1:2}var A=Ye(),g=new f("RSC",A),Yo=new f("PREFETCH",A),Bo=new f("HYDRATE",A),jo=new f("VERYFRONT",A);function S(t,e){let o=e==="root"?_:`rsc-slot-${e}`,n=t.getElementById(o);if(n)return n;let s=t.createElement("div");return s.id=o,t.body.appendChild(s),s}function Be(t,e){if(e.type!=="slot")return;let o=S(t,e.id);o.innerHTML=h(String(e.html??""))}function tt(t,e){let o=e.split(`\n`),n=o.pop()??"";for(let s of o){let u=s.trim();if(!u)continue;let c;try{c=JSON.parse(u)}catch(d){g.debug("[client-dom] malformed NDJSON line",{line:u,error:d instanceof Error?d.message:String(d)});continue}if(!c||typeof c!="object")continue;let i=c;if(i.type==="slot"){Be(t,i);try{qe(t,i.id||"root")}catch(d){g.debug("[client-dom] hydration optional failed",d)}}}return n}function je(t){return new Promise((e,o)=>{let n=()=>o(new DOMException("aborted","AbortError"));if(t.aborted){n();return}t.addEventListener("abort",n,{once:!0})})}async function et(t,e=document,o){let n="body"in t?t:null,s=n?.body??t;if(!s)return;let u=s.getReader(),c=new TextDecoder,i="",d=!1;try{for(;;){if(o?.aborted)throw new DOMException("aborted","AbortError");let l=u.read(),{done:p,value:C}=o?await Promise.race([l,je(o)]):await l;if(p){d=!0;break}i+=c.decode(C,{stream:!0}),i=tt(e,i)}i&&tt(e,`${i}\n`)}catch(l){throw l instanceof Error&&l.name==="AbortError"||g.debug("[client-dom] consumeNdjsonStream error",l),l}finally{try{await u.cancel()}catch(l){d||g.debug("[client-dom] reader.cancel failed",l)}try{u.releaseLock()}catch(l){g.debug("[client-dom] reader.releaseLock failed",l)}if(typeof s.cancel=="function")try{await s.cancel()}catch(l){g.debug("[client-dom] stream.cancel failed",l)}if(typeof n?.body?.cancel=="function")try{await n.body.cancel()}catch(l){g.debug("[client-dom] response.body.cancel failed",l)}}}function We(t,e){let o=S(t,e),n=[],s=u=>{let c=u;c.dataset?.clientRef&&n.push(c);for(let i of u.children)s(i)};return s(o),n}function qe(t,e){let o=We(t,e);for(let n of o){let s=n.dataset?.clientRef;s&&(n.dataset.hydrated="true",g.debug("[client-dom] marked for hydration",s))}}var ze=100;function Xe(t,e){if(globalThis.__VF_CLIENT_MOD_CACHE??(globalThis.__VF_CLIENT_MOD_CACHE=new Map),globalThis.__VF_CLIENT_MOD_CACHE.size>=ze){let o=globalThis.__VF_CLIENT_MOD_CACHE.keys().next().value;o&&globalThis.__VF_CLIENT_MOD_CACHE.delete(o)}globalThis.__VF_CLIENT_MOD_CACHE.set(t,e)}function Je(t){let e=t.match(/^\\/app\\/(.+)#([A-Za-z0-9_]+)$/);return e?{rel:`/${e[1]||""}`,exportName:e[2]||"default"}:null}async function Ke(){try{let t=await fetch("/_veryfront/rsc/manifest");return t.ok?await t.json():null}catch{return null}}async function Ze(t,e,o){let n=t.graphIds?.client.find(c=>c.rel===e)?.path,s=`${e}#${t.hash??""}`;try{let c=globalThis.__VF_CLIENT_MOD_CACHE?.get(s);if(c)return c}catch(c){g.debug("hydrate: cache get failed",c)}let u=I({strategy:o,rel:e,absPath:n,version:t.hash});if(!u)return null;try{let c=await import(u);try{Xe(s,c)}catch(i){g.debug("hydrate: cache set failed",i)}return c}catch(c){return g.debug("hydrate: failed to import module",{moduleUrl:u,error:c}),null}}async function rt(t=document){let e=null;try{e=await Ke()}catch(i){g.debug("hydrate: fetch manifest failed",i)}if(!e){g.debug("hydrate: no manifest");return}let o=Array.from(t.querySelectorAll("[data-client-ref]"));try{let i=globalThis.__VF_MANIFEST_HASH;if(!o.some(l=>l.dataset?.hydrated!=="true")&&i&&e.hash&&i===e.hash)return}catch(i){g.debug("hydrate: hmr hash read failed",i)}if(o.length===0){try{globalThis.__VF_MANIFEST_HASH=e.hash??""}catch(i){g.debug("hydrate: set hash failed",i)}return}let n=x(T(t));try{if(globalThis.__VF_TEST_MODE__){globalThis.__VF_HYDRATE_CALLED=!0,globalThis.__VF_MANIFEST_HASH=e.hash??"";return}}catch(i){g.debug("hydrate: test mode flags failed",i)}let s=O(t),[{default:u},{createRoot:c}]=await Promise.all([import(s.react),import(s.reactDomClient)]);for(let i of o){let d=i.dataset?.clientRef??"";if(!d||i.dataset?.hydrated==="true")continue;let l=Je(d);if(!l)continue;let p=await Ze(e,l.rel,n);if(!p)continue;let C=p[l.exportName]??p.default;if(typeof C=="function")try{c(i).render(u.createElement(C,{})),i.dataset.hydrated="true"}catch(P){g.warn("hydrate: render failed",P)}}try{globalThis.__VF_MANIFEST_HASH=e.hash??""}catch(i){g.debug("hydrate: set hash failed (post)",i)}}async function Qe(){let t=O(document),[e,o]=await Promise.all([import(t.react),import(t.reactDomClient)]);return{React:e,ReactDOM:o}}var tr=new Set(["SCRIPT","STYLE","NOSCRIPT","TEMPLATE"]);function U(t){let e=t.getAttribute("style")??"";return t.hasAttribute("data-veryfront-head")||t.hasAttribute("hidden")||/(?:^|;)\\s*display\\s*:\\s*none(?:\\s*;|$)/i.test(e)||tr.has(t.tagName.toUpperCase())}function er(t,e){return t.find(o=>o.tagName.toUpperCase()==="DIV"&&!!o.getAttribute("class")?.trim()&&!U(o))??e}function rr(t,e){return t===e}function or(t,e){let o=document.createElement("div");o.setAttribute("data-veryfront-hydration-root","page");let n=t.find(s=>!U(s));n?.parentNode===e?e.insertBefore(o,n):e.appendChild(o);for(let s of t)!U(s)&&s.parentNode===e&&o.appendChild(s);return o}function nr(t,e,o=document){return!!e?.pagePath&&typeof t?.__veryfrontRenderPage=="function"&&!!o.getElementById("root")}function sr(t,e){return e?.pagePath?!1:!!t.getElementById(_)}function ir(t=import.meta.url){try{return new URL(t,"http://veryfront.local").searchParams.get("hydrate")==="1"}catch{return!1}}function ar(t){return t==="rsc-module"}async function cr(t){try{let e=await fetch(y+"stream"+t);if(!e.ok||!e.body)return!1;let o=new AbortController;return addEventListener("pagehide",()=>o.abort(),{once:!0}),await et(e,document,o.signal),!0}catch(e){return console.debug?.("[RSC] tryStream failed",e),!1}}async function N(){try{await rt(document)}catch(t){console.debug?.("[RSC] hydration failed",t)}}async function lr(t,e){try{let{React:o,ReactDOM:n}=await Qe(),s=I({strategy:e,rel:t});if(!s)return!1;console.debug?.("[RSC] Loading component from:",s);let c=(await import(s)).default;if(typeof c!="function")return console.debug?.("[RSC] Page component is not a function"),!1;let i=Array.from(document.body.children),d=er(i,document.body),l=rr(d,document.body)?or(i,document.body):d,p=o.createElement(c,{});return ar(e)?n.createRoot(l).render(p):n.hydrateRoot(l,p,{identifierPrefix:"vf",onRecoverableError:()=>{}}),console.debug?.("[RSC] Page component hydrated successfully"),!0}catch(o){return console.error("[RSC] Page hydration failed",o),!1}}async function ur(t){try{let e=await fetch(y+"payload"+t);if(!e.ok)return!1;let o=await e.json();if(o?.slots){for(let[n,s]of Object.entries(o.slots))S(document,n).innerHTML=h(String(s||""));return!0}return S(document,_).innerHTML=h(String(o?.html||"")),!0}catch(e){return console.debug?.("[RSC] payload fetch failed",e),!1}}async function gr(){try{let t=globalThis.window?.location.search??"",e=T(document);if(ir()){await N();return}let o=e?.pagePath,n=x(e);if(o){if(nr(globalThis.window,e,document)){console.debug?.("[RSC] Page renderer owns hydration");return}console.debug?.("[RSC] Found page component in hydration data:",o),await lr(o,n)&&console.debug?.("[RSC] Client component hydrated successfully");return}if(!sr(document,e))return;if(await cr(t)){await N();return}if(await ur(t)){await N();return}await N()}catch(t){console.error("[RSC] boot failed",t)}}if(typeof document<"u"){let t=()=>{gr()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t,{once:!0}):t()}export{gr as boot,er as selectHydrationRoot,sr as shouldAttemptRSCTransport,ir as shouldHydrateOnly,ar as shouldRenderPageComponent,nr as shouldUsePageRendererHydration,rr as shouldWrapPageHydrationRoot};\n';
9
+ export const CLIENT_DOM_BUNDLE = 'var P=Object.defineProperty;var k=(r,t,o)=>t in r?P(r,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[t]=o;var l=(r,t,o)=>k(r,typeof t!="symbol"?t+"":t,o);function e(r){return{...r,create(t){return new f(t?.message||t?.detail||r.title,{slug:r.slug,category:r.category,status:t?.status??r.status,title:r.title,suggestion:r.suggestion,detail:t?.detail,cause:t?.cause,instance:t?.instance,context:t?.context})}}}var f=class extends Error{constructor(o,s){super(o);l(this,"slug");l(this,"category");l(this,"status");l(this,"title");l(this,"suggestion");l(this,"detail");l(this,"cause");l(this,"instance");l(this,"context");this.name="VeryfrontError",this.slug=s.slug,this.category=s.category,this.status=s.status,this.title=s.title,this.suggestion=s.suggestion,this.detail=s.detail,this.cause=s.cause,this.instance=s.instance,this.context=s.context}toRFC9457(){return{type:`https://veryfront.com/docs/errors/${this.slug}`,title:this.title,status:this.status,detail:this.detail,instance:this.instance,category:this.category,suggestion:this.suggestion,cause:typeof this.cause=="string"?this.cause:void 0}}getDocsUrl(){return`https://veryfront.com/docs/errors/${this.slug}`}};var F=e({slug:"config-not-found",category:"CONFIG",status:404,title:"Configuration file not found",suggestion:"Run \'vf init\' to create a configuration file"}),w=e({slug:"config-invalid",category:"CONFIG",status:400,title:"Invalid configuration format",suggestion:"Check your veryfront.config.ts for syntax errors"}),Y=e({slug:"config-parse-error",category:"CONFIG",status:400,title:"Failed to parse configuration",suggestion:"Ensure your configuration file is valid TypeScript/JSON"}),H=e({slug:"config-validation-error",category:"CONFIG",status:422,title:"Configuration validation failed",suggestion:"Check the configuration against the schema requirements"}),B=e({slug:"config-type-error",category:"CONFIG",status:400,title:"Configuration type mismatch",suggestion:"Ensure configuration values match expected types"}),$=e({slug:"import-map-invalid",category:"CONFIG",status:400,title:"Invalid import map configuration",suggestion:"Check your import map syntax and paths"}),j=e({slug:"cors-config-invalid",category:"CONFIG",status:400,title:"Invalid CORS configuration",suggestion:"Review CORS settings in your configuration"}),q=e({slug:"config-validation-failed",category:"CONFIG",status:400,title:"Configuration validation failed",suggestion:"Check configuration values against requirements"}),y={"config-not-found":F,"config-invalid":w,"config-parse-error":Y,"config-validation-error":H,"config-type-error":B,"import-map-invalid":$,"cors-config-invalid":j,"config-validation-failed":q};var z=e({slug:"build-failed",category:"BUILD",status:500,title:"Build process failed",suggestion:"Check the build output for specific errors"}),W=e({slug:"bundle-error",category:"BUILD",status:500,title:"Bundle generation failed",suggestion:"Review bundler output for details"}),X=e({slug:"typescript-error",category:"BUILD",status:500,title:"TypeScript compilation error",suggestion:"Fix TypeScript errors shown in the output"}),K=e({slug:"mdx-compile-error",category:"BUILD",status:500,title:"MDX compilation failed",suggestion:"Check your MDX file syntax"}),J=e({slug:"asset-optimization-error",category:"BUILD",status:500,title:"Asset optimization failed",suggestion:"Check asset file formats and paths"}),Z=e({slug:"ssg-generation-error",category:"BUILD",status:500,title:"Static site generation failed",suggestion:"Review SSG configuration and data fetching"}),Q=e({slug:"sourcemap-error",category:"BUILD",status:500,title:"Source map generation failed",suggestion:"Check source map configuration"}),ee=e({slug:"compilation-error",category:"BUILD",status:500,title:"Compilation failed",suggestion:"Review compiler output for specific errors"}),O={"build-failed":z,"bundle-error":W,"typescript-error":X,"mdx-compile-error":K,"asset-optimization-error":J,"ssg-generation-error":Z,"sourcemap-error":Q,"compilation-error":ee};var te=e({slug:"hydration-mismatch",category:"RUNTIME",status:500,title:"Client/server hydration mismatch",suggestion:"Ensure server and client render the same content"}),re=e({slug:"render-error",category:"RUNTIME",status:500,title:"Component render failed",suggestion:"Check component for runtime errors"}),oe=e({slug:"component-error",category:"RUNTIME",status:500,title:"Component execution error",suggestion:"Review component logic and props"}),se=e({slug:"layout-not-found",category:"RUNTIME",status:404,title:"Layout component not found",suggestion:"Ensure layout file exists at the expected path"}),ne=e({slug:"page-not-found",category:"RUNTIME",status:404,title:"Page component not found",suggestion:"Check that the page file exists in the routes directory"}),ie=e({slug:"api-error",category:"RUNTIME",status:500,title:"API route handler error",suggestion:"Review API route handler for errors"}),ae=e({slug:"middleware-error",category:"RUNTIME",status:500,title:"Middleware execution error",suggestion:"Check middleware function for errors"}),T={"hydration-mismatch":te,"render-error":re,"component-error":oe,"layout-not-found":se,"page-not-found":ne,"api-error":ie,"middleware-error":ae};var ce=e({slug:"route-conflict",category:"ROUTE",status:409,title:"Conflicting route definitions",suggestion:"Rename or reorganize conflicting route files"}),ue=e({slug:"invalid-route-file",category:"ROUTE",status:400,title:"Invalid route file structure",suggestion:"Ensure route file exports required functions"}),le=e({slug:"route-handler-invalid",category:"ROUTE",status:400,title:"Invalid route handler export",suggestion:"Export a valid handler function from the route file"}),ge=e({slug:"dynamic-route-error",category:"ROUTE",status:500,title:"Dynamic route parsing failed",suggestion:"Check dynamic route segment syntax"}),pe=e({slug:"route-params-error",category:"ROUTE",status:400,title:"Route parameters invalid",suggestion:"Validate route parameter values"}),Ee=e({slug:"api-route-error",category:"ROUTE",status:500,title:"API route definition error",suggestion:"Review API route configuration"}),I={"route-conflict":ce,"invalid-route-file":ue,"route-handler-invalid":le,"dynamic-route-error":ge,"route-params-error":pe,"api-route-error":Ee};var Re=e({slug:"module-not-found",category:"MODULE",status:404,title:"Module could not be resolved",suggestion:"Check the import path and ensure the module is installed"}),de=e({slug:"import-resolution-error",category:"MODULE",status:500,title:"Import path resolution failed",suggestion:"Verify import paths and module configuration"}),fe=e({slug:"circular-dependency",category:"MODULE",status:500,title:"Circular dependency detected",suggestion:"Refactor imports to break the circular dependency"}),me=e({slug:"invalid-import",category:"MODULE",status:400,title:"Invalid import statement",suggestion:"Fix import syntax or path"}),_e=e({slug:"dependency-missing",category:"MODULE",status:404,title:"Required dependency not installed",suggestion:"Install the missing dependency with your package manager"}),ye=e({slug:"version-mismatch",category:"MODULE",status:409,title:"Dependency version mismatch",suggestion:"Update dependencies to compatible versions"}),x={"module-not-found":Re,"import-resolution-error":de,"circular-dependency":fe,"invalid-import":me,"dependency-missing":_e,"version-mismatch":ye};var Oe=e({slug:"port-in-use",category:"SERVER",status:409,title:"Server port already in use",suggestion:"Use a different port or stop the process using this port"}),Te=e({slug:"server-start-error",category:"SERVER",status:500,title:"Server failed to start",suggestion:"Check server configuration and port availability"}),Ie=e({slug:"cache-error",category:"SERVER",status:500,title:"Cache operation failed",suggestion:"Clear the cache and try again"}),xe=e({slug:"file-watch-error",category:"SERVER",status:500,title:"File watcher error",suggestion:"Restart the development server"}),he=e({slug:"request-error",category:"SERVER",status:500,title:"HTTP request handling error",suggestion:"Check request handler and middleware"}),Se=e({slug:"service-overloaded",category:"SERVER",status:503,title:"Service overloaded",suggestion:"Reduce load or scale up resources"}),Ne=e({slug:"semaphore-timeout",category:"SERVER",status:503,title:"Semaphore acquire timeout",suggestion:"Reduce concurrency or increase the semaphore acquire timeout"}),Ae=e({slug:"circuit-breaker-open",category:"SERVER",status:503,title:"Circuit breaker is open",suggestion:"Wait for the breaker reset timeout before retrying"}),ve=e({slug:"cache-path-mismatch",category:"SERVER",status:500,title:"Cache path mismatch",suggestion:"Clear the cache directory and rebuild"}),Ce=e({slug:"network-error",category:"SERVER",status:502,title:"Network operation failed",suggestion:"Check network connectivity and retry"}),De=e({slug:"api-client-error",category:"SERVER",status:500,title:"API client request failed",suggestion:"Check API connectivity and authentication"}),Le=e({slug:"token-storage-error",category:"SERVER",status:500,title:"Token storage operation failed",suggestion:"Check token storage backend and credentials"}),Ue=e({slug:"cache-invariant-violation",category:"SERVER",status:500,title:"Cache path invariant violated",suggestion:"Clear the cache and rebuild"}),be=e({slug:"release-not-found",category:"SERVER",status:404,title:"No active release found",suggestion:"Deploy the project to create a release for this environment"}),Me=e({slug:"fallback-exhausted",category:"SERVER",status:500,title:"Primary and fallback operations both failed",suggestion:"Check service availability and connectivity"}),h={"port-in-use":Oe,"server-start-error":Te,"cache-error":Ie,"file-watch-error":xe,"request-error":he,"service-overloaded":Se,"semaphore-timeout":Ne,"circuit-breaker-open":Ae,"cache-path-mismatch":ve,"network-error":Ce,"api-client-error":De,"token-storage-error":Le,"cache-invariant-violation":Ue,"release-not-found":be,"fallback-exhausted":Me};var Ve=e({slug:"client-boundary-violation",category:"BOUNDARY",status:400,title:"Client boundary rule violation",suggestion:"Add \'use client\' directive or move code to a client component"}),Ge=e({slug:"server-only-in-client",category:"BOUNDARY",status:400,title:"Server-only code in client component",suggestion:"Move server-only code to a server component"}),Pe=e({slug:"client-only-in-server",category:"BOUNDARY",status:400,title:"Client-only code in server component",suggestion:"Move client-only code to a client component"}),ke=e({slug:"invalid-use-client",category:"BOUNDARY",status:400,title:"Invalid \'use client\' directive",suggestion:"Place \'use client\' at the top of the file"}),Fe=e({slug:"invalid-use-server",category:"BOUNDARY",status:400,title:"Invalid \'use server\' directive",suggestion:"Place \'use server\' at the top of the file or function"}),we=e({slug:"rsc-payload-error",category:"BOUNDARY",status:500,title:"RSC payload serialization error",suggestion:"Ensure props are serializable (no functions, symbols, etc.)"}),S={"client-boundary-violation":Ve,"server-only-in-client":Ge,"client-only-in-server":Pe,"invalid-use-client":ke,"invalid-use-server":Fe,"rsc-payload-error":we};var Ye=e({slug:"hmr-error",category:"DEV",status:500,title:"Hot module replacement error",suggestion:"Restart the development server"}),He=e({slug:"dev-server-error",category:"DEV",status:500,title:"Development server error",suggestion:"Check the dev server logs and restart"}),Be=e({slug:"fast-refresh-error",category:"DEV",status:500,title:"Fast refresh failed",suggestion:"Save the file again or restart the dev server"}),$e=e({slug:"error-overlay-error",category:"DEV",status:500,title:"Error overlay failed",suggestion:"Check browser console for details"}),je=e({slug:"source-map-error",category:"DEV",status:500,title:"Source map loading error",suggestion:"Rebuild or clear cache"}),N={"hmr-error":Ye,"dev-server-error":He,"fast-refresh-error":Be,"error-overlay-error":$e,"source-map-error":je};var qe=e({slug:"deployment-error",category:"DEPLOY",status:500,title:"Deployment process failed",suggestion:"Check deployment logs for details"}),ze=e({slug:"platform-error",category:"DEPLOY",status:500,title:"Platform-specific error",suggestion:"Check platform documentation and requirements"}),We=e({slug:"env-var-missing",category:"DEPLOY",status:500,title:"Required environment variable missing",suggestion:"Set the required environment variable"}),Xe=e({slug:"production-build-required",category:"DEPLOY",status:400,title:"Production build required",suggestion:"Run \'vf build\' before deploying"}),A={"deployment-error":qe,"platform-error":ze,"env-var-missing":We,"production-build-required":Xe};var Ke=e({slug:"agent-error",category:"AGENT",status:500,title:"Agent operation error",suggestion:"Check agent configuration and logs"}),Je=e({slug:"agent-not-found",category:"AGENT",status:404,title:"Agent not found",suggestion:"Verify the agent ID exists"}),Ze=e({slug:"agent-timeout",category:"AGENT",status:408,title:"Agent operation timed out",suggestion:"Increase timeout or simplify the request"}),Qe=e({slug:"agent-intent-error",category:"AGENT",status:400,title:"Agent intent parsing error",suggestion:"Rephrase the request more clearly"}),et=e({slug:"orchestration-error",category:"AGENT",status:500,title:"Multi-agent orchestration error",suggestion:"Check agent coordination logic"}),tt=e({slug:"cost-limit-exceeded",category:"AGENT",status:429,title:"Cost limit exceeded",suggestion:"Wait for the budget period to reset or increase the limit"}),v={"agent-error":Ke,"agent-not-found":Je,"agent-timeout":Ze,"agent-intent-error":Qe,"orchestration-error":et,"cost-limit-exceeded":tt};var rt=e({slug:"unknown-error",category:"GENERAL",status:500,title:"Unknown/unclassified error",suggestion:"Check logs for more details"}),ot=e({slug:"permission-denied",category:"GENERAL",status:403,title:"File/resource permission denied",suggestion:"Check file permissions and access rights"}),st=e({slug:"file-not-found",category:"GENERAL",status:404,title:"File not found",suggestion:"Verify the file path exists"}),nt=e({slug:"resource-not-found",category:"GENERAL",status:404,title:"Requested resource not found",suggestion:"Verify the referenced resource ID or name exists"}),it=e({slug:"invalid-argument",category:"GENERAL",status:400,title:"Invalid function argument",suggestion:"Check argument types and values"}),at=e({slug:"timeout-error",category:"GENERAL",status:408,title:"Operation timed out",suggestion:"Increase timeout or optimize the operation"}),ct=e({slug:"initialization-error",category:"GENERAL",status:500,title:"Initialization failed",suggestion:"Check initialization requirements and dependencies"}),ut=e({slug:"not-supported",category:"GENERAL",status:501,title:"Feature not supported",suggestion:"Check documentation for supported features"}),m=e({slug:"security-violation",category:"GENERAL",status:403,title:"Security violation detected",suggestion:"Check for path traversal or unauthorized access attempts"}),lt=e({slug:"input-validation-failed",category:"GENERAL",status:400,title:"Input validation failed",suggestion:"Check request input against validation rules"}),C={"unknown-error":rt,"permission-denied":ot,"file-not-found":st,"resource-not-found":nt,"invalid-argument":it,"timeout-error":at,"initialization-error":ct,"not-supported":ut,"security-violation":m,"input-validation-failed":lt};var cr={...y,...O,...T,...I,...x,...h,...S,...N,...A,...v,...C};var gt=[{pattern:/<script[^>]*>[\\s\\S]*?<\\/script>/gi,name:"inline script"},{pattern:/javascript:/gi,name:"javascript: URL"},{pattern:/\\bon\\w+\\s*=/gi,name:"event handler attribute"},{pattern:/data:\\s*text\\/html/gi,name:"data: HTML URL"}];function pt(){let r=globalThis;return r.__VERYFRONT_DEV__===!0||r.Deno?.env?.get?.("VERYFRONT_ENV")==="development"}function D(r,t={}){let{strict:o=!1,warn:s=!0}=t;for(let{pattern:i,name:c}of gt)if(i.lastIndex=0,!!i.test(r)&&(s&&console.warn(`[Security] Suspicious ${c} detected in server HTML`),o||!pt()))throw m.create({detail:`Potentially unsafe HTML: ${c} detected`});return r}var R=class{constructor(t,o){this.prefix=t;this.level=o}log(t,o,s,...i){this.level>t||o?.(s,...i)}debug(t,...o){this.log(0,console.debug,`[${this.prefix}] DEBUG: ${t}`,...o)}info(t,...o){this.log(1,console.log,`[${this.prefix}] ${t}`,...o)}warn(t,...o){this.log(2,console.warn,`[${this.prefix}] WARN: ${t}`,...o)}error(t,...o){this.log(3,console.error,`[${this.prefix}] ERROR: ${t}`,...o)}};function Et(){if(typeof window>"u")return 2;let r=globalThis;return r.__VERYFRONT_DEV__||r.__RSC_DEV__?r.__VERYFRONT_DEBUG__||r.__RSC_DEBUG__?0:1:2}var d=Et(),p=new R("RSC",d),Sr=new R("PREFETCH",d),Nr=new R("HYDRATE",d),Ar=new R("VERYFRONT",d);var n="/_veryfront",_={RSC:`${n}/rsc/`,FS:`${n}/fs/`,MODULES:`${n}/modules/`,PAGES:`${n}/pages/`,DATA:`${n}/data/`,LIB:`${n}/lib/`,CHUNKS:`${n}/chunks/`,CLIENT:`${n}/client/`},L={HMR_RUNTIME:`${n}/hmr-runtime.js`,HMR:`${n}/hmr.js`,ERROR_OVERLAY:`${n}/error-overlay.js`,DEV_LOADER:`${n}/dev-loader.js`,CLIENT_LOG:`${n}/log`,CLIENT_JS:`${n}/client.js`,ROUTER_JS:`${n}/router.js`,PREFETCH_JS:`${n}/prefetch.js`,MANIFEST_JSON:`${n}/manifest.json`,APP_JS:`${n}/app.js`,RSC_CLIENT:`${n}/rsc/client.js`,RSC_MANIFEST:`${n}/rsc/manifest`,RSC_STREAM:`${n}/rsc/stream`,RSC_PAYLOAD:`${n}/rsc/payload`,RSC_RENDER:`${n}/rsc/render`,RSC_PAGE:`${n}/rsc/page`,RSC_MODULE:`${n}/rsc/module`,RSC_DOM:`${n}/rsc/dom.js`,LIB_CHAT_REACT:`${n}/lib/chat/react.js`,LIB_CHAT_COMPONENTS:`${n}/lib/chat/components.js`,LIB_CHAT_PRIMITIVES:`${n}/lib/chat/primitives.js`};var dt={ROOT:".veryfront",CACHE:".veryfront/cache",KV:".veryfront/kv",LOGS:".veryfront/logs",TMP:".veryfront/tmp"},Ur=dt.CACHE;var br={HMR_RUNTIME:L.HMR_RUNTIME,ERROR_OVERLAY:L.ERROR_OVERLAY};var Pr=_.RSC,kr=_.FS;var U="rsc-root";function M(r,t){let o=t==="root"?U:`rsc-slot-${t}`,s=r.getElementById(o);if(s)return s;let i=r.createElement("div");return i.id=o,r.body.appendChild(i),i}function ft(r,t){if(t.type!=="slot")return;let o=M(r,t.id);o.innerHTML=D(String(t.html??""))}function b(r,t){let o=t.split(`\n`),s=o.pop()??"";for(let i of o){let c=i.trim();if(!c)continue;let g;try{g=JSON.parse(c)}catch(E){p.debug("[client-dom] malformed NDJSON line",{line:c,error:E instanceof Error?E.message:String(E)});continue}if(!g||typeof g!="object")continue;let u=g;if(u.type==="slot"){ft(r,u);try{yt(r,u.id||"root")}catch(E){p.debug("[client-dom] hydration optional failed",E)}}}return s}function mt(r){return new Promise((t,o)=>{let s=()=>o(new DOMException("aborted","AbortError"));if(r.aborted){s();return}r.addEventListener("abort",s,{once:!0})})}async function Br(r,t=document,o){let s="body"in r?r:null,i=s?.body??r;if(!i)return;let c=i.getReader(),g=new TextDecoder,u="",E=!1;try{for(;;){if(o?.aborted)throw new DOMException("aborted","AbortError");let a=c.read(),{done:V,value:G}=o?await Promise.race([a,mt(o)]):await a;if(V){E=!0;break}u+=g.decode(G,{stream:!0}),u=b(t,u)}u&&b(t,`${u}\n`)}catch(a){throw a instanceof Error&&a.name==="AbortError"||p.debug("[client-dom] consumeNdjsonStream error",a),a}finally{try{await c.cancel()}catch(a){E||p.debug("[client-dom] reader.cancel failed",a)}try{c.releaseLock()}catch(a){p.debug("[client-dom] reader.releaseLock failed",a)}if(typeof i.cancel=="function")try{await i.cancel()}catch(a){p.debug("[client-dom] stream.cancel failed",a)}if(typeof s?.body?.cancel=="function")try{await s.body.cancel()}catch(a){p.debug("[client-dom] response.body.cancel failed",a)}}}function _t(r,t){let o=M(r,t),s=[],i=c=>{let g=c;g.dataset?.clientRef&&s.push(g);for(let u of c.children)i(u)};return i(o),s}function yt(r,t){let o=_t(r,t);for(let s of o){let i=s.dataset?.clientRef;i&&(s.dataset.hydrated="true",p.debug("[client-dom] marked for hydration",i))}}export{Br as consumeNdjsonStream,M as getContainer};\n';
@@ -1 +1 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../../src/src/utils/logger/logger.ts"],"names":[],"mappings":"AAEA,OAAO,EAOL,KAAK,YAAY,EAEjB,KAAK,eAAe,EAErB,MAAM,WAAW,CAAC;AAEnB,oBAAY,QAAQ;IAClB,KAAK,IAAI;IACT,IAAI,IAAI;IACR,IAAI,IAAI;IACR,KAAK,IAAI;CACV;AAED,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAExC;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAEhB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAElC,KAAK,CAAC,EAAE,eAAe,CAAC;IAExB,kJAAkJ;IAClJ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gJAAgJ;IAChJ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+IAA+I;IAC/I,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oJAAoJ;IACpJ,WAAW,CAAC,EAAE,MAAM,CAAC;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,MAAM,EACd,OAAO,CAAC,EAAE,oBAAoB,GAC7B,aAAa,CASf;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GACA,MAAM,CAER;AAED,8BAA8B;AAC9B,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE;IACV,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GACA,MAAM,CAUR"}
@@ -1,6 +1,7 @@
1
1
  import { getEnv, isStdoutTTY } from "../../platform/compat/process.js";
2
2
  import { RUNTIME_VERSION } from "../version.js";
3
3
  import { ANSI, colorize, formatContextText, formatTimestamp, LEVEL_COLORS, LEVEL_GLYPHS, padTag, serializeError, } from "./core.js";
4
+ import { redactSensitive, sanitizeSerializedError, sanitizeUrlCredentials } from "./redact.js";
4
5
  export var LogLevel;
5
6
  (function (LogLevel) {
6
7
  LogLevel[LogLevel["DEBUG"] = 0] = "DEBUG";
@@ -181,8 +182,11 @@ class ConsoleLogger {
181
182
  extractToEntryField(entry, mergedContext, "trace_id", (v) => String(v));
182
183
  extractToEntryField(entry, mergedContext, "span_id", (v) => String(v));
183
184
  extractToEntryField(entry, mergedContext, "project_slug", (v) => String(v));
184
- extractToEntryField(entry, mergedContext, "request_url", (v) => String(v));
185
- extractToEntryField(entry, mergedContext, "domain", (v) => String(v));
185
+ // request_url / domain are URL-shaped and lifted out of mergedContext
186
+ // *before* redactSensitive runs, so they bypass the key-based redactor.
187
+ // Scrub embedded credentials (userinfo, ?access_token=, …) here (#1989).
188
+ extractToEntryField(entry, mergedContext, "request_url", (v) => sanitizeUrlCredentials(String(v)));
189
+ extractToEntryField(entry, mergedContext, "domain", (v) => sanitizeUrlCredentials(String(v)));
186
190
  extractToEntryField(entry, mergedContext, "project_id", (v) => String(v));
187
191
  extractToEntryField(entry, mergedContext, "release_id", (v) => String(v));
188
192
  extractToEntryField(entry, mergedContext, "branch_id", (v) => String(v));
@@ -215,10 +219,16 @@ class ConsoleLogger {
215
219
  if (entry.conversationId && !entry.conversation_id) {
216
220
  entry.conversation_id = entry.conversationId;
217
221
  }
222
+ // Redact credential-like keys from the free-form context bag before
223
+ // serialization (the deliberate top-level fields above are already
224
+ // extracted out of mergedContext, so they are unaffected).
218
225
  if (Object.keys(mergedContext).length > 0)
219
- entry.context = mergedContext;
226
+ entry.context = redactSensitive(mergedContext);
227
+ // The serialized error (name/message/stack) bypasses the key-based
228
+ // redactor; scrub credentials embedded in its message/stack (DSNs, Mongo
229
+ // URIs, ?access_token= URLs, userinfo) before emission (#1989).
220
230
  if (error)
221
- entry.error = error;
231
+ entry.error = sanitizeSerializedError(error);
222
232
  return JSON.stringify(entry);
223
233
  }
224
234
  formatTextLine(level, message, args) {
@@ -231,7 +241,7 @@ class ConsoleLogger {
231
241
  const componentTag = this.componentName
232
242
  ? ` ${colorize(`[${this.componentName}]`, ANSI.dim, enableColor)}`
233
243
  : "";
234
- const contextText = formatContextText(mergedContext, error, enableColor);
244
+ const contextText = formatContextText(redactSensitive(mergedContext), sanitizeSerializedError(error), enableColor);
235
245
  return `${timestamp} ${tag} ${glyph}${componentTag} ${message}${contextText}`;
236
246
  }
237
247
  log(level, logLevel, consoleFn, message, args) {
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Secret / credential redaction for structured log context.
3
+ *
4
+ * Defense-in-depth (#1989): the logger, the error-logging path, and the
5
+ * observability log buffer all accept arbitrary `context`/`data` objects from
6
+ * callers and serialize them to log sinks. There is no guarantee a caller
7
+ * never hands us a tokens object, an `Authorization` header bag, or a request
8
+ * body with a password field. This pass masks values whose *key* looks like a
9
+ * credential before serialization, so an accidental
10
+ * `logger.info("...", { authorization: token })` cannot leak the secret.
11
+ *
12
+ * Scope is intentionally key-based: we do not attempt to find secrets embedded
13
+ * in free-form message strings (too lossy). The deny-list errs toward
14
+ * over-redaction — masking a benign `tokenCount` is acceptable; leaking a real
15
+ * token is not. The traversal fails *closed*: on a cycle, depth overflow, or a
16
+ * throwing getter it returns {@link REDACTED} rather than risk emitting an
17
+ * unredacted object.
18
+ */
19
+ /** Replacement value substituted for any sensitive field. */
20
+ export declare const REDACTED = "[REDACTED]";
21
+ /**
22
+ * Whether a context key names a credential and should have its value masked.
23
+ *
24
+ * Uses substring matching on a normalized key, so `clientSecret`,
25
+ * `x-api-key`, and `refresh_token` all match while benign words that merely
26
+ * *contain* a pattern as a separate token (e.g. `author`) do not — `author`
27
+ * normalizes to `author`, which contains none of the patterns.
28
+ */
29
+ export declare function isSensitiveKey(key: string): boolean;
30
+ /**
31
+ * Returns a redacted deep copy of `context`. Any property whose key is
32
+ * {@link isSensitiveKey} has its value replaced with {@link REDACTED}; nested
33
+ * plain objects, class instances, and arrays are traversed. The input is never
34
+ * mutated, and the pass fails closed (returns {@link REDACTED}) on cycles,
35
+ * depth overflow, or a throwing getter.
36
+ */
37
+ export declare function redactSensitive<T>(context: T): T;
38
+ /**
39
+ * Strip credentials from URL-shaped strings so they can be safely emitted in
40
+ * free-form text (error messages, stacks, lifted `request_url` fields). Unlike
41
+ * {@link redactSensitive}, which is key-based, this scrubs secrets embedded in
42
+ * the *value* itself:
43
+ *
44
+ * - URL userinfo: `http://user:pass@host` → `http://user:[REDACTED]@host`
45
+ * - sensitive query params: `?access_token=abc` → `?access_token=[REDACTED]`
46
+ *
47
+ * It is intentionally tolerant: it operates on any string (a DSN, a Mongo URI,
48
+ * an axios error message containing a URL) via regex rather than requiring a
49
+ * parseable URL, so malformed or partial URLs in error text are still scrubbed.
50
+ * Non-URL strings pass through unchanged.
51
+ */
52
+ export declare function sanitizeUrlCredentials(input: string): string;
53
+ /**
54
+ * Apply {@link sanitizeUrlCredentials} to the `message` and `stack` of a
55
+ * serialized-error-shaped object, returning a new object. Used by the logger's
56
+ * JSON and text paths so errors carrying DSNs, Mongo URIs, or
57
+ * `?access_token=`-bearing URLs do not leak credentials (the serialized error
58
+ * bypasses the key-based redactor). Returns the input unchanged when falsy.
59
+ */
60
+ export declare function sanitizeSerializedError<T extends {
61
+ message?: unknown;
62
+ stack?: unknown;
63
+ } | undefined>(error: T): T;
64
+ //# sourceMappingURL=redact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redact.d.ts","sourceRoot":"","sources":["../../../../src/src/utils/logger/redact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH,6DAA6D;AAC7D,eAAO,MAAM,QAAQ,eAAe,CAAC;AA2CrC;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAGnD;AA6ED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAEhD;AA2BD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CA4B5D;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,CAAC,SAAS;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,EAC5D,KAAK,EAAE,CAAC,GAAG,CAAC,CAMb"}