veryfront 0.1.634 → 0.1.636

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 (72) 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/agent/runtime/text-generation-runtime-message-converter.d.ts.map +1 -1
  5. package/esm/src/agent/runtime/text-generation-runtime-message-converter.js +154 -13
  6. package/esm/src/cache/distributed-cache-init.d.ts +11 -2
  7. package/esm/src/cache/distributed-cache-init.d.ts.map +1 -1
  8. package/esm/src/cache/distributed-cache-init.js +2 -14
  9. package/esm/src/channels/control-plane.d.ts +5 -5
  10. package/esm/src/embedding/chunk.js +4 -2
  11. package/esm/src/errors/error-registry/agent.d.ts +16 -0
  12. package/esm/src/errors/error-registry/agent.d.ts.map +1 -0
  13. package/esm/src/errors/error-registry/agent.js +52 -0
  14. package/esm/src/errors/error-registry/boundary.d.ts +16 -0
  15. package/esm/src/errors/error-registry/boundary.d.ts.map +1 -0
  16. package/esm/src/errors/error-registry/boundary.js +52 -0
  17. package/esm/src/errors/error-registry/build.d.ts +20 -0
  18. package/esm/src/errors/error-registry/build.d.ts.map +1 -0
  19. package/esm/src/errors/error-registry/build.js +68 -0
  20. package/esm/src/errors/error-registry/config.d.ts +22 -0
  21. package/esm/src/errors/error-registry/config.d.ts.map +1 -0
  22. package/esm/src/errors/error-registry/config.js +70 -0
  23. package/esm/src/errors/error-registry/deploy.d.ts +12 -0
  24. package/esm/src/errors/error-registry/deploy.d.ts.map +1 -0
  25. package/esm/src/errors/error-registry/deploy.js +36 -0
  26. package/esm/src/errors/error-registry/dev.d.ts +14 -0
  27. package/esm/src/errors/error-registry/dev.d.ts.map +1 -0
  28. package/esm/src/errors/error-registry/dev.js +44 -0
  29. package/esm/src/errors/error-registry/general.d.ts +29 -0
  30. package/esm/src/errors/error-registry/general.d.ts.map +1 -0
  31. package/esm/src/errors/error-registry/general.js +92 -0
  32. package/esm/src/errors/error-registry/module.d.ts +16 -0
  33. package/esm/src/errors/error-registry/module.d.ts.map +1 -0
  34. package/esm/src/errors/error-registry/module.js +52 -0
  35. package/esm/src/errors/error-registry/route.d.ts +16 -0
  36. package/esm/src/errors/error-registry/route.d.ts.map +1 -0
  37. package/esm/src/errors/error-registry/route.js +52 -0
  38. package/esm/src/errors/error-registry/runtime.d.ts +18 -0
  39. package/esm/src/errors/error-registry/runtime.d.ts.map +1 -0
  40. package/esm/src/errors/error-registry/runtime.js +60 -0
  41. package/esm/src/errors/error-registry/server.d.ts +39 -0
  42. package/esm/src/errors/error-registry/server.d.ts.map +1 -0
  43. package/esm/src/errors/error-registry/server.js +129 -0
  44. package/esm/src/errors/error-registry.d.ts +79 -157
  45. package/esm/src/errors/error-registry.d.ts.map +1 -1
  46. package/esm/src/errors/error-registry.js +37 -706
  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/security/sandbox/project-worker.d.ts.map +1 -1
  52. package/esm/src/security/sandbox/project-worker.js +0 -1
  53. package/esm/src/server/dev-server/server.d.ts.map +1 -1
  54. package/esm/src/server/dev-server/server.js +2 -1
  55. package/esm/src/server/distributed-cache-initializers.d.ts +13 -0
  56. package/esm/src/server/distributed-cache-initializers.d.ts.map +1 -0
  57. package/esm/src/server/distributed-cache-initializers.js +22 -0
  58. package/esm/src/server/handlers/request/agent-stream.handler.d.ts.map +1 -1
  59. package/esm/src/server/handlers/request/agent-stream.handler.js +56 -16
  60. package/esm/src/server/index.d.ts +1 -0
  61. package/esm/src/server/index.d.ts.map +1 -1
  62. package/esm/src/server/index.js +1 -0
  63. package/esm/src/server/production-server.d.ts.map +1 -1
  64. package/esm/src/server/production-server.js +2 -1
  65. package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.d.ts.map +1 -1
  66. package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.js +2 -2
  67. package/esm/src/utils/redis-client.d.ts.map +1 -1
  68. package/esm/src/utils/redis-client.js +0 -3
  69. package/esm/src/utils/version-constant.d.ts +1 -1
  70. package/esm/src/utils/version-constant.js +1 -1
  71. package/esm/src/workflow/schemas/workflow.schema.d.ts +4 -4
  72. package/package.json +1 -1
@@ -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":"redis-client.d.ts","sourceRoot":"","sources":["../../../src/src/utils/redis-client.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,WAAW;IAC1B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACzC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACnF,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7C,IAAI,CACF,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAC3C,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;IAC/C,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACtD,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,GAAG,IAAI,CAAC;IACjE,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAUD,wBAAsB,cAAc,CAAC,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,WAAW,CAAC,CA4B3F;AAgED,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C"}
1
+ {"version":3,"file":"redis-client.d.ts","sourceRoot":"","sources":["../../../src/src/utils/redis-client.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,WAAW;IAC1B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACzC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACnF,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7C,IAAI,CACF,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAC3C,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;IAC/C,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACtD,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,GAAG,IAAI,CAAC;IACjE,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAsBD,wBAAsB,cAAc,CAAC,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,WAAW,CAAC,CA4B3F;AA6DD,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C"}
@@ -38,12 +38,10 @@ export async function getRedisClient(options = {}) {
38
38
  }
39
39
  }
40
40
  async function createClient(options) {
41
- // deno-lint-ignore no-explicit-any
42
41
  let createClientFn;
43
42
  try {
44
43
  const redisClientModule = "npm:@redis/client@1.5.8";
45
44
  const mod = await import(redisClientModule);
46
- // deno-lint-ignore no-explicit-any
47
45
  createClientFn = mod.createClient;
48
46
  }
49
47
  catch (error) {
@@ -57,7 +55,6 @@ async function createClient(options) {
57
55
  if (!useTls && getEnv("NODE_ENV") === "production") {
58
56
  logger.warn("Redis connection without TLS in production. Set REDIS_URL to rediss:// or pass tls: true.");
59
57
  }
60
- // deno-lint-ignore no-explicit-any
61
58
  const clientOpts = { url };
62
59
  if (useTls) {
63
60
  clientOpts.socket = { tls: true };
@@ -1,3 +1,3 @@
1
1
  /** Shared version value. */
2
- export declare const VERSION = "0.1.634";
2
+ export declare const VERSION = "0.1.636";
3
3
  //# sourceMappingURL=version-constant.d.ts.map
@@ -1,4 +1,4 @@
1
1
  // Keep in sync with deno.json version.
2
2
  // scripts/release.ts updates this constant during releases.
3
3
  /** Shared version value. */
4
- export const VERSION = "0.1.634";
4
+ export const VERSION = "0.1.636";
@@ -82,7 +82,7 @@ export declare const getCheckpointSchema: () => import("../../internal-agents/sc
82
82
  /**
83
83
  * Approval status schema
84
84
  */
85
- export declare const getApprovalStatusSchema: () => import("../../internal-agents/schema.js").Schema<"expired" | "rejected" | "pending" | "approved">;
85
+ export declare const getApprovalStatusSchema: () => import("../../internal-agents/schema.js").Schema<"rejected" | "expired" | "pending" | "approved">;
86
86
  /**
87
87
  * Pending approval schema
88
88
  */
@@ -94,7 +94,7 @@ export declare const getPendingApprovalSchema: () => import("../../internal-agen
94
94
  approvers: import("../../internal-agents/schema.js").Schema<string[] | undefined>;
95
95
  requestedAt: import("../../internal-agents/schema.js").Schema<Date>;
96
96
  expiresAt: import("../../internal-agents/schema.js").Schema<Date | undefined>;
97
- status: import("../../internal-agents/schema.js").Schema<"expired" | "rejected" | "pending" | "approved">;
97
+ status: import("../../internal-agents/schema.js").Schema<"rejected" | "expired" | "pending" | "approved">;
98
98
  decidedBy: import("../../internal-agents/schema.js").Schema<string | undefined>;
99
99
  decidedAt: import("../../internal-agents/schema.js").Schema<Date | undefined>;
100
100
  comment: import("../../internal-agents/schema.js").Schema<string | undefined>;
@@ -192,7 +192,7 @@ export declare const CheckpointSchema: import("../../internal-agents/schema.js")
192
192
  completedAt: import("../../internal-agents/schema.js").Schema<Date | undefined>;
193
193
  }>>>;
194
194
  }>>;
195
- export declare const ApprovalStatusSchema: import("../../internal-agents/schema.js").Schema<"expired" | "rejected" | "pending" | "approved">;
195
+ export declare const ApprovalStatusSchema: import("../../internal-agents/schema.js").Schema<"rejected" | "expired" | "pending" | "approved">;
196
196
  export declare const PendingApprovalSchema: import("../../internal-agents/schema.js").Schema<import("../../extensions/schema/schema-validator.js").InferShape<{
197
197
  id: import("../../internal-agents/schema.js").Schema<string>;
198
198
  nodeId: import("../../internal-agents/schema.js").Schema<string>;
@@ -201,7 +201,7 @@ export declare const PendingApprovalSchema: import("../../internal-agents/schema
201
201
  approvers: import("../../internal-agents/schema.js").Schema<string[] | undefined>;
202
202
  requestedAt: import("../../internal-agents/schema.js").Schema<Date>;
203
203
  expiresAt: import("../../internal-agents/schema.js").Schema<Date | undefined>;
204
- status: import("../../internal-agents/schema.js").Schema<"expired" | "rejected" | "pending" | "approved">;
204
+ status: import("../../internal-agents/schema.js").Schema<"rejected" | "expired" | "pending" | "approved">;
205
205
  decidedBy: import("../../internal-agents/schema.js").Schema<string | undefined>;
206
206
  decidedAt: import("../../internal-agents/schema.js").Schema<Date | undefined>;
207
207
  comment: import("../../internal-agents/schema.js").Schema<string | undefined>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "veryfront",
3
- "version": "0.1.634",
3
+ "version": "0.1.636",
4
4
  "description": "The simplest way to build AI-powered apps",
5
5
  "keywords": [
6
6
  "react",