veryfront 0.1.1221 → 0.1.1223
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/deno.js +3 -3
- package/esm/src/agent/ag-ui/browser-chunk-encoder.d.ts +2 -0
- package/esm/src/agent/ag-ui/browser-chunk-encoder.d.ts.map +1 -1
- package/esm/src/agent/ag-ui/browser-chunk-encoder.js +1 -0
- package/esm/src/agent/ag-ui/browser-encoder.d.ts +15 -1
- package/esm/src/agent/ag-ui/browser-encoder.d.ts.map +1 -1
- package/esm/src/agent/ag-ui/browser-encoder.js +19 -1
- package/esm/src/agent/ag-ui/chat-ui-chunk-browser-encoder.d.ts +2 -0
- package/esm/src/agent/ag-ui/chat-ui-chunk-browser-encoder.d.ts.map +1 -1
- package/esm/src/agent/ag-ui/chat-ui-chunk-browser-encoder.js +1 -0
- package/esm/src/agent/ag-ui/chunk-encoder-bridge.d.ts +2 -0
- package/esm/src/agent/ag-ui/chunk-encoder-bridge.d.ts.map +1 -1
- package/esm/src/agent/ag-ui/chunk-encoder-bridge.js +1 -1
- package/esm/src/agent/ag-ui/runtime-event-encoder.d.ts +2 -0
- package/esm/src/agent/ag-ui/runtime-event-encoder.d.ts.map +1 -1
- package/esm/src/agent/ag-ui/runtime-event-encoder.js +1 -1
- package/esm/src/agent/hosted/chat-runtime-tool-assembly.d.ts +9 -5
- package/esm/src/agent/hosted/chat-runtime-tool-assembly.d.ts.map +1 -1
- package/esm/src/agent/hosted/child-fork-step-message-preparation.d.ts +14 -9
- package/esm/src/agent/hosted/child-fork-step-message-preparation.d.ts.map +1 -1
- package/esm/src/agent/hosted/child-fork-step-message-preparation.js +0 -3
- package/esm/src/agent/hosted/child-lifecycle.d.ts.map +1 -1
- package/esm/src/agent/hosted/child-lifecycle.js +31 -11
- package/esm/src/agent/hosted/durable-child-fork-execution.d.ts +59 -0
- package/esm/src/agent/hosted/durable-child-fork-execution.d.ts.map +1 -1
- package/esm/src/agent/hosted/durable-child-fork-execution.js +46 -0
- package/esm/src/agent/hosted/project-remote-tool-source.d.ts +13 -5
- package/esm/src/agent/hosted/project-remote-tool-source.d.ts.map +1 -1
- package/esm/src/agent/hosted/project-remote-tool-source.js +3 -3
- package/esm/src/agent/hosted/runtime-essential-tools.d.ts.map +1 -1
- package/esm/src/agent/hosted/runtime-essential-tools.js +0 -17
- package/esm/src/agent/index.d.ts +1 -1
- package/esm/src/agent/index.d.ts.map +1 -1
- package/esm/src/agent/index.js +1 -1
- package/esm/src/agent/runtime/tool-discovery-context.d.ts +27 -12
- package/esm/src/agent/runtime/tool-discovery-context.d.ts.map +1 -1
- package/esm/src/build/production-build/client-runtime.d.ts.map +1 -1
- package/esm/src/build/production-build/client-runtime.js +7 -0
- package/esm/src/html/hydration-script-builder/hydration-runtime.generated.js +1 -1
- package/esm/src/internal-agents/ag-ui-sse.d.ts +2 -2
- package/esm/src/internal-agents/ag-ui-sse.d.ts.map +1 -1
- package/esm/src/internal-agents/ag-ui-sse.js +31 -20
- package/esm/src/platform/compat/http/pinned-fetch.d.ts +1 -1
- package/esm/src/security/client/html-sanitizer.d.ts +8 -0
- package/esm/src/security/client/html-sanitizer.d.ts.map +1 -1
- package/esm/src/security/client/html-sanitizer.js +4 -1
- package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.d.ts.map +1 -1
- package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.js +2 -2
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +8 -8
|
@@ -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 ht=Object.defineProperty;var _t=(e,t,r)=>t in e?ht(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var E=(e,t,r)=>_t(e,typeof t!="symbol"?t+"":t,r);var Us=Array.prototype.at,Hs=Array.prototype.filter,xt=Array.prototype.join,vs=Array.prototype.map,ks=Array.prototype.pop,Tt=Array.prototype.push,$s=Array.prototype.sort,Ae=Reflect.apply;function G(e,t){return Ae(xt,e,[t])}function w(e,t){Ae(Tt,e,[t])}var St="3.2.3",At=Object.entries;function Ct(e){let t=[];if(e?.external?.length&&w(t,`external=${G(e.external,",")}`),w(t,`target=${e?.target??"es2022"}`),e?.deps){let r=[],n=At(e.deps);for(let o=0;o<n.length;o++){let[i,a]=n[o];w(r,`${i}@${a}`)}w(t,`deps=${G(r,",")}`)}return t}function bt(e,t,r,n){let o=Ct(n),i=t?`@${t}`:"",a=r??"",c=o.length?`?${G(o,"&")}`:"";return`https://esm.sh/${e}${i}${a}${c}`}function T(e,t,r,n=!1){return bt(e,t,r,{external:n?["react"]:void 0,deps:{csstype:St}})}var It="19.2.4",M=It;function Ce(e=M){return{react:T("react",e),"react-dom":T("react-dom",e,void 0,!0),"react-dom/client":T("react-dom",e,"/client",!0),"react-dom/server":T("react-dom",e,"/server",!0),"react/jsx-runtime":T("react",e,"/jsx-runtime",!0),"react/jsx-dev-runtime":T("react",e,"/jsx-dev-runtime",!0)}}function be(e=M){return Ce(e).react}function Oe(e=M){return Ce(e)["react-dom/client"]}function Nt(e){return e.replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}function Dt(e){if(typeof globalThis.btoa=="function")try{return globalThis.btoa(e)}catch{return wt(new TextEncoder().encode(e))}let t=globalThis.Buffer;if(t)return t.from(e,"utf8").toString("base64");throw new Error("Base64 encoding is not supported in this runtime")}function wt(e){let t=globalThis.Buffer;if(t)return t.from(e).toString("base64");if(typeof globalThis.btoa=="function"){let n=[];for(let o=0;o<e.length;o+=24576){let i=Math.min(o+24576,e.length),a=String.fromCharCode(...e.subarray(o,i));n.push(globalThis.btoa(a))}return n.join("")}throw new Error("Base64 encoding is not supported in this runtime")}function ae(e){return Nt(Dt(e))}var Js=Object.freeze({react:"","react-dom":"","react-dom/client":"","react-dom/server":"","react/jsx-runtime":"","react/jsx-dev-runtime":""});function B(e,t){if(!t)return!1;if(Object.prototype.hasOwnProperty.call(t,e))return!0;for(let r of Object.keys(t))if(r.endsWith("/")&&e.startsWith(r))return!0;return!1}function Mt(e){try{return JSON.parse(e)?.imports??{}}catch(t){return console.warn("Failed to parse import map JSON; treating as empty",{errorName:t instanceof Error?t.name:typeof t,inputLength:e.length}),{}}}function ce(e=document){let t=e.querySelector(\'script[type="importmap"]\');return t?.textContent?Mt(t.textContent):{}}var Qs=Object.freeze({IPV4:"127.0.0.1",IPV6:"::1",HOSTNAME:"localhost"});var Pt=5e3,Lt=1e4,ri=16*1024*1024,Ut=5e3;var Ht=100;var vt=Object.freeze([5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4]),ni=Object.freeze([1,5,10,25,50,100,250,500,1e3,2500,5e3,1e4]),oi=Object.freeze({server:Object.freeze({port:3e3,hostname:"0.0.0.0"}),timeouts:Object.freeze({default:Pt,api:3e4,ssr:Lt,hmr:3e4,sandbox:Ut}),cache:Object.freeze({jit:Object.freeze({maxSize:Ht,tempDirPrefix:"vf-bundle-"})}),metrics:Object.freeze({ssrBoundaries:vt})});var p="/_veryfront",le={RSC:`${p}/rsc/`,FS:`${p}/fs/`,MODULES:`${p}/modules/`,PAGES:`${p}/pages/`,DATA:`${p}/data/`,LIB:`${p}/lib/`,CHUNKS:`${p}/chunks/`,CLIENT:`${p}/client/`},Ne={HMR_RUNTIME:`${p}/hmr-runtime.js`,HMR:`${p}/hmr.js`,ERROR_OVERLAY:`${p}/error-overlay.js`,DEV_LOADER:`${p}/dev-loader.js`,CLIENT_LOG:`${p}/log`,CLIENT_JS:`${p}/client.js`,ROUTER_JS:`${p}/router.js`,PREFETCH_JS:`${p}/prefetch.js`,MANIFEST_JSON:`${p}/manifest.json`,APP_JS:`${p}/app.js`,RSC_CLIENT:`${p}/rsc/client.js`,RSC_MANIFEST:`${p}/rsc/manifest`,RSC_STREAM:`${p}/rsc/stream`,RSC_PAYLOAD:`${p}/rsc/payload`,RSC_RENDER:`${p}/rsc/render`,RSC_PAGE:`${p}/rsc/page`,RSC_MODULE:`${p}/rsc/module`,RSC_DOM:`${p}/rsc/dom.js`,LIB_CHAT_REACT:`${p}/lib/chat/react.js`,LIB_CHAT_COMPONENTS:`${p}/lib/chat/components.js`,LIB_CHAT_PRIMITIVES:`${p}/lib/chat/primitives.js`};var kt={ROOT:".veryfront",CACHE:".veryfront/cache",KV:".veryfront/kv",LOGS:".veryfront/logs",TMP:".veryfront/tmp"},ii=kt.CACHE;var ai={HMR_RUNTIME:Ne.HMR_RUNTIME,ERROR_OVERLAY:Ne.ERROR_OVERLAY};var P=le.RSC,De=le.FS;var L="rsc-root",j="x-veryfront-dependency-pins";var C=class{constructor(t,r){E(this,"prefix",t);E(this,"level",r)}log(t,r,n,...o){this.level>t||r?.(n,...o)}debug(t,...r){this.log(0,console.debug,`[${this.prefix}] DEBUG: ${t}`,...r)}info(t,...r){this.log(1,console.log,`[${this.prefix}] ${t}`,...r)}warn(t,...r){this.log(2,console.warn,`[${this.prefix}] WARN: ${t}`,...r)}error(t,...r){this.log(3,console.error,`[${this.prefix}] ERROR: ${t}`,...r)}};function $t(){if(typeof window>"u")return 2;let e=globalThis;return e.__VERYFRONT_DEV__||e.__RSC_DEV__?e.__VERYFRONT_DEBUG__||e.__RSC_DEBUG__?0:1:2}var z=$t(),g=new C("RSC",z),gi=new C("PREFETCH",z),fi=new C("HYDRATE",z),pi=new C("VERYFRONT",z);var Vt="veryfront-hydration-data";function ue(e){try{let t=[...e.querySelectorAll(`[id="${Vt}"]`)];if(t.length!==1)return null;let r=e.body;if(!r)return null;let n=t[0];return r.firstElementChild!==n&&n.parentElement!==r||n.tagName?.toLowerCase()!=="script"||n.getAttribute("type")?.trim().toLowerCase()!=="application/json"?null:n}catch{return null}}function b(e=document){try{let t=ue(e);return t?JSON.parse(t.textContent||"{}"):null}catch(t){return g.debug("hydration data parse failed",t),null}}function Y(e,t){if(!t?.startsWith("on:"))return!1;try{let r=ue(e);if(!r)return!1;let n=JSON.parse(r.textContent||"{}");return n.dependencyPinningCacheKey=t,r.textContent=JSON.stringify(n),!0}catch(r){return g.debug("hydration dependency snapshot seed failed",r),!1}}function W(e){return e?.clientModuleStrategy?e.clientModuleStrategy:e?.dev?"fs":"rsc-module"}function Ft(e,t){if(!t)return e;let r=e.includes("?")?"&":"?";return`${e}${r}v=${encodeURIComponent(t)}`}function K(e,t){if(!t?.startsWith("on:"))return e;let r=e.indexOf("#"),n=r===-1?"":e.slice(r),o=r===-1?e:e.slice(0,r),i=o.indexOf("?"),a=i===-1?o:o.slice(0,i),c=new URLSearchParams(i===-1?"":o.slice(i+1));c.set("pins",t);let u=c.toString();return`${a}${u?`?${u}`:""}${n}`}function Gt(e,t){return Ft(`${De}${ae(e)}.js`,t)}function Bt(e,t,r){let n=t?`&v=${encodeURIComponent(t)}`:"";return K(`${P}module?rel=${encodeURIComponent(e)}${n}`,r)}function U(e){let t=e?.dependencyPinningCacheKey;return t?.startsWith("on:")?{[j]:t}:{}}function jt(e){return e.replace(/^\\/+_vf_modules\\//,"").replace(/^\\/+/,"").replace(/\\.js$/,"")}var zt=/\\.(tsx|ts|jsx|mdx|js)$/;function Yt(e){let t=jt(e),r=[e,t];return zt.test(t)||r.push(`${t}.tsx`,`${t}.ts`,`${t}.jsx`,`${t}.mdx`,`${t}.js`),Array.from(new Set(r))}function Wt(e,t){if(!e)return null;for(let r of Yt(t)){let n=e[r];if(n)return n}return null}function X(e){if(e.strategy==="fs"){let r=e.absPath??e.rel;return r?K(Gt(r,e.version),e.dependencyPinningCacheKey):null}let t=Wt(e.releaseAssetModules,e.rel);return t||Bt(e.rel,e.version,e.dependencyPinningCacheKey)}function q(e=document,t=M){let r=ce(e);return{react:B("react",r)?"react":be(t),reactDomClient:B("react-dom/client",r)?"react-dom/client":Oe(t)}}function we(e=document){let t=ce(e);return B("veryfront/router",t)?"veryfront/router":null}var Kt=new Set(["CONFIG","BUILD","RUNTIME","ROUTE","MODULE","SERVER","BOUNDARY","DEV","DEPLOY","AGENT","GENERAL"]);function Xt(e,...t){let r=Object.create(null),n=e.charAt(0).toUpperCase()+e.slice(1);for(let o of t)for(let[i,a]of Object.entries(o)){if(typeof a!="object"||a===null||!Object.hasOwn(a,"slug"))throw new Error(`${n} entry "${i}" must define a slug`);let c=a.slug;if(typeof c!="string")throw new Error(`${n} entry "${i}" must define a string slug`);if(c!==i)throw new Error(`${n} key "${i}" does not match entry slug "${c}"`);if(Object.hasOwn(r,i))throw new Error(`Duplicate ${e} slug "${i}"`);r[i]=a}return Object.freeze(r)}function Me(...e){for(let t of e)for(let r of Object.values(t)){if(typeof r.slug!="string"||r.slug.length<3||r.slug.length>40||!/^[a-z][a-z0-9-]*[a-z0-9]$/.test(r.slug))throw new TypeError(`Registered error slug must be 3-40 characters of lowercase kebab-case, got "${r.slug}"`);if(typeof r.category!="string"||!Kt.has(r.category))throw new TypeError(`Registered error has unknown category "${r.category}"`);if(!Number.isInteger(r.status)||r.status<400||r.status>=600)throw new RangeError(`Registered error status must be an integer from 400 through 599, got ${r.status}`);if(typeof r.title!="string"||r.title.trim().length===0)throw new TypeError("Registered error title must be a non-empty string");if(r.suggestion!==void 0&&(typeof r.suggestion!="string"||r.suggestion.trim().length===0))throw new TypeError("Registered error suggestion must be non-empty when provided")}return Xt("error registry",...e)}var J={reset:"\\x1B[0m",dim:"\\x1B[2m",gray:"\\x1B[90m",red:"\\x1B[31m",green:"\\x1B[32m",yellow:"\\x1B[33m",blue:"\\x1B[34m",magenta:"\\x1B[35m",cyan:"\\x1B[36m"},bi={debug:J.gray,info:J.green,warn:J.yellow,error:J.red};var m="[REDACTED]",y=Reflect.apply,qt=Array.prototype.pop,Jt=Array.prototype.push;var Ii=Array.prototype,Ni=BigInt.prototype.toString,ve=Map,Zt=Map.prototype.delete,Qt=Map.prototype.get,er=Map.prototype.keys,tr=Map.prototype.set;var _=Object.getOwnPropertyDescriptor,rr=Object.getPrototypeOf,Di=Object.hasOwn,wi=Object.prototype,nr=Set,or=decodeURIComponent,A=URL,Mi=Number.isFinite,Pi=Number.isInteger,de=RegExp.prototype.exec,sr=_(RegExp.prototype,"global").get,ir=_(RegExp.prototype,"unicode").get,ar=String.prototype.charCodeAt,cr=String.prototype.includes,lr=String.prototype.indexOf,Pe=String.prototype.slice,ke=String.prototype.startsWith,$e=String.prototype.toLowerCase,ur=Set.prototype.add,Li=Set.prototype.delete,dr=Set.prototype.has,gr=rr(new ve().keys()).next,fr=_(Map.prototype,"size").get,Ui=_(A.prototype,"host").get,Hi=_(A.prototype,"origin").get,pr=_(A.prototype,"password").get,vi=_(A.prototype,"pathname").get,ki=_(A.prototype,"protocol").get,yr=_(A.prototype,"username").get,mr=/[^a-z0-9]/g,Er=/([a-z0-9])([A-Z])/g,Rr=/([A-Z])([A-Z][a-z])/g,hr=/\\b(?:sk-[A-Za-z0-9._-]{8,}|gh[po]_[A-Za-z0-9._-]{8,}|xox[baprs]-[A-Za-z0-9._-]{8,}|eyJ[A-Za-z0-9._-]{8,})\\b/g;function h(e,t,r){let n=y(sr,t,[]),o=y(ir,t,[]),i=0,a=!1,c="";t.lastIndex=0;try{for(;;){let u=y(de,t,[e]);if(u===null)break;let l=u[0],d=u.index;if(c+=S(e,i,d),c+=typeof r=="string"?r:r(u),i=d+l.length,a=!0,!n)break;l.length===0&&(t.lastIndex=_r(e,d,o))}}finally{t.lastIndex=0}return a?c+S(e,i):e}function ge(e){let t=y($e,e,[]);return h(t,mr,"")}function O(e,t){return y(ar,e,[t])}function _r(e,t,r){let n=t+1;if(!r||n>=e.length)return n;let o=O(e,t);if(o<55296||o>56319)return n;let i=O(e,n);return i>=56320&&i<=57343?t+2:n}function S(e,t,r){return r===void 0?y(Pe,e,[t]):y(Pe,e,[t,r])}function xr(e){let t=[],r=0;for(let n=0;n<=e.length;n++){let o=n===e.length?-1:O(e,n);o>=97&&o<=122||o>=48&&o<=57||(n>r&&(t[t.length]=S(e,r,n)),r=n+1)}return t}var Z=["password","passwd","pwd","passphrase","secret","clientsecret","token","apikey","accesskey","privatekey","credential","authheader","authorization","cookie","bearer","jwt","connectionstring","signature","sessionid","sid","otp","mfa","pin","salt","xsrf","csrf"],Tr=512,Sr=128,H=new ve;var Ar=256;function Cr(e){let t=e.length<=Sr;if(t){let o=y(Qt,H,[e]);if(o!==void 0)return o}let r=ge(e),n=r==="auth";for(let o=0;!n&&o<Z.length;o++)n=y(cr,r,[Z[o]]);if(t){if(y(fr,H,[])>=Tr){let i=y(er,H,[]),a=y(gr,i,[]).value;a!==void 0&&y(Zt,H,[a])}y(tr,H,[e,n])}return n}var Le=["access_token","accesstoken","refresh_token","api_key","apikey","code","token","secret","client_secret","password","passwd","pwd","state","sig","signature","auth","x-amz-credential","x-amz-signature","x-amz-security-token","x-goog-credential","x-goog-signature"],Ve=new nr;for(let e=0;e<Le.length;e++)y(ur,Ve,[ge(Le[e])]);var br=/(\\b[a-z][a-z0-9+.-]*:\\/\\/|\\/\\/)([^/?#\\s]+)@/gi,Or=/(\\b[a-z][a-z0-9+.-]*:\\/\\/|\\/\\/)([a-z0-9._~!$&\'()*+,;=%-]+):([^/?#@\\r\\n \\t]+[ \\t][^/?#@\\r\\n]*)@/gi,Ir=3;function Nr(e){return e===" "||e==="\t"||e===","||e===";"||e==="&"||e==="?"||e==="#"}function Dr(e){if(!e)return!1;let t=O(e,0);return t>=65&&t<=90||t>=97&&t<=122}function Fe(e){return Dr(e)||e==="_"||e==="$"}function wr(e){if(!e)return!1;let t=O(e,0);return Fe(e)||t>=48&&t<=57||e==="."||e==="-"}function Ge(e,t){let r=t,n=e[r]===\'"\'||e[r]==="\'"?e[r++]:"";if(!Fe(e[r]))return!1;for(r++;wr(e[r]);)r++;if(n){if(e[r]!==n)return!1;r++}for(;e[r]===" "||e[r]==="\t";)r++;return e[r]===":"||e[r]==="="}function Be(e){return e==="\\r"||e===`\n`||e==="}"||e==="]"||Nr(e)}function je(e,t){let r=t;for(;r<e.length&&Be(e[r]);)r++;return r}function Ue(e,t){let r=je(e,t);return r>=e.length||Ge(e,r)}function Mr(e,t){let r=t,n=!0;if(y(ke,e,[m,t])){let d=t+m.length;if(Ue(e,d))return{end:d,replacement:m};r=d,n=!1}let o=n&&(e[r]===\'"\'||e[r]==="\'"||e[r]==="`")?e[r]:"",i=!1,a=()=>o?`${o}${m}${i?o:""}`:m,c=[],u="",l=-1;for(let d=r;d<e.length;){let f=e[d];if(u){if(f==="\\\\"){d+=2;continue}if(f===u){if(l===r&&c.length===0)return i=!0,{end:d+1,replacement:a()};u="",l=-1}d++;continue}if(f===\'"\'||f==="\'"||f==="`"){u=f,l=d,d++;continue}if(f==="{"||f==="["){y(Jt,c,[f==="{"?"}":"]"]),d++;continue}if(c.length>0&&(f==="}"||f==="]")){if(c[c.length-1]!==f)return{end:e.length,replacement:a()};if(y(qt,c,[]),d++,c.length===0&&Ue(e,d))return{end:d,replacement:a()};continue}if(c.length>0||!Be(f)){d++;continue}let R=d;if(d=je(e,d),d>=e.length||Ge(e,d))return{end:R,replacement:a()}}return{end:e.length,replacement:a()}}function He(e,t,r,n){let o=0,i="";for(let a=y(de,t,[e]);a;a=y(de,t,[e])){let c=a[r];if(!Pr(c))continue;let u=t.lastIndex,l=n===void 0?void 0:a[n],d=u+m.length;if((l==="?"||l==="&"||l===";")&&y(ke,e,[m,u])&&e[d]==="#")continue;let f=Mr(e,u);i+=S(e,o,a.index),i+=a[0],i+=f.replacement,o=f.end,t.lastIndex=f.end}return o===0?e:i+S(e,o)}function Pr(e){if(e.length>Ar)return!0;let t=h(e,Rr,i=>`${i[1]} ${i[2]}`),r=h(t,Er,i=>`${i[1]} ${i[2]}`),n=y($e,r,[]),o=xr(n);for(let i=0;i<o.length;i++){if(o[i].length===0)continue;let a="";for(let c=i;c<o.length;c++){let u=o[c];if(u.length!==0){a+=u;for(let l=0;l<Z.length;l++)if(a===Z[l])return!0}}}return o.length===1&&o[0]==="auth"}function Lr(e,t,r){let n=-1;for(let a=0;a<r.length;a++){let c=O(r,a);if(c===32||c===9){n=a;break}}if(n<0)return!1;let o=`${t}:${S(r,0,n)}`,i=e==="//"?`https://${o}`:`${e}${o}`;try{let a=new A(i),c=y(yr,a,[]),u=y(pr,a,[]);return c.length===0&&u.length===0}catch{return!1}}function Ur(e){let t=e;for(let r=0;r<Ir;r++){let n;try{n=or(t)}catch{break}if(n===t)break;t=n}return t}function fe(e){if(typeof e!="string"||e.length===0)return e;let t=h(e,br,r=>{let n=r[1],o=r[2],i=y(lr,o,[":"]);if(i===-1)return`${n}${m}@`;let a=S(o,0,i);return`${n}${a}:${m}@`});return t=h(t,Or,r=>{let n=r[1],o=r[2],i=r[3];return Lr(n,o,i)?r[0]:`${n}${o}:${m}@`}),t=h(t,/([?#&;])([-a-z0-9_.%\\[\\]]+)=([^&#;\\s]*)/gi,r=>{let n=r[1],o=r[2],i=Ur(o);return y(dr,Ve,[ge(i)])||Cr(i)?`${n}${o}=${m}`:r[0]}),t=h(t,/(^|[^a-z0-9_-])((?:set-cookie|cookie)\\s*:\\s*)[^\\r\\n]*/gi,r=>`${r[1]}${r[2]}${m}`),t=h(t,/\\b(authorization\\s*[:=]\\s*)[^\\r\\n]*/gi,r=>`${r[1]}${m}`),t=h(t,/\\b(bearer|basic)(\\s+)(?:"[^"\\r\\n]*"|\'[^\'\\r\\n]*\'|[a-z0-9._~+/=-]+)/gi,r=>`${r[1]}${r[2]}${m}`),t=h(t,hr,m),t=He(t,/(["\'])([_$a-z][a-z0-9_.$-]*)\\1(\\s*[:=]\\s*)/gi,2),t=He(t,/(^|[^a-z0-9_.$-])([_$a-z][a-z0-9_.$-]*)(\\s*[:=]\\s*)/gi,2,1),t}var Hr=2048;var Bi=64*1024,vr=256,kr="https://veryfront.com/docs/errors/",ze="...[truncated]",pe="unknown-error";function Ye(e,t){if(e.length<=t)return e;let r=Math.max(0,t-ze.length);return`${$r(e,r)}${ze}`}function $r(e,t){let r=e.slice(0,t),n=r.charCodeAt(r.length-1);return n>=55296&&n<=56319&&(r=r.slice(0,-1)),r}function Vr(e){let t="";for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if(n>=55296&&n<=56319){let o=e.charCodeAt(r+1);o>=56320&&o<=57343?(t+=e.slice(r,r+2),r++):t+="\\uFFFD";continue}t+=n>=56320&&n<=57343?"\\uFFFD":e.charAt(r)}return t}function I(e){return typeof e!="string"?m:Ye(fe(e),Hr)}function Fr(e){let t=typeof e=="string"?fe(e):pe,r=Ye(t||pe,vr),n=Vr(r);return n==="."||n===".."?pe:n}function Q(e){let t=encodeURIComponent(Fr(e));return`${kr}${t}`}var Xe=Reflect.apply,Gr=Object.freeze,Br=Object.getOwnPropertyDescriptors,We=Number.isFinite,qe=new WeakSet,jr=WeakSet.prototype.add,zr=WeakSet.prototype.has,Yr=new Set(["CONFIG","BUILD","RUNTIME","ROUTE","MODULE","SERVER","BOUNDARY","DEV","DEPLOY","AGENT","GENERAL"]);function s(e){let t={...e},r={...t,create(n){let o=n?.message,i=n?.detail,a=n?.cause,c=n?.instance,u=n?.context,l=n?.status??t.status;return new ye(o||i||t.title,{slug:t.slug,category:t.category,status:l,title:t.title,suggestion:t.suggestion,exitCode:t.exitCode,detail:i,cause:a,instance:c,context:u})}};return Gr(r)}var ye=class extends Error{constructor(r,n){super(r);E(this,"slug");E(this,"category");E(this,"status");E(this,"title");E(this,"suggestion");E(this,"exitCode");E(this,"detail");E(this,"cause");E(this,"instance");E(this,"context");Xe(jr,qe,[this]),this.name="VeryfrontError",this.slug=n.slug,this.category=n.category,this.status=n.status,this.title=n.title,this.suggestion=n.suggestion,this.exitCode=n.exitCode,this.detail=n.detail,this.cause=n.cause,this.instance=n.instance,this.context=n.context}toRFC9457(){let r=Ke(this);return r?{type:Q(r.slug),title:I(r.title),status:r.status,detail:r.detail===void 0?void 0:I(r.detail),instance:r.instance===void 0?void 0:I(r.instance),category:r.category,suggestion:r.suggestion===void 0?void 0:I(r.suggestion),cause:typeof r.cause=="string"?I(r.cause):void 0}:{type:Q("unknown-error"),title:"Unknown/unclassified error",status:500,category:"GENERAL"}}getDocsUrl(){let r=Ke(this);return Q(r?.slug??"unknown-error")}};function Je(e){return typeof e=="object"&&e!==null&&Xe(zr,qe,[e])===!0}function Ke(e){return Je(e)?Wr(e):null}function Wr(e){try{if(!Je(e))return null;let t=Br(e),r=ne=>{let D=t[ne];return D&&"value"in D?D.value:void 0},n=r("slug"),o=r("category"),i=r("status"),a=r("title"),c=r("message"),u=r("suggestion"),l=r("exitCode"),d=r("detail"),f=r("cause"),R=r("instance"),$=r("context"),x=r("stack");return typeof n!="string"||!Yr.has(o)||typeof i!="number"||!We(i)||typeof a!="string"||typeof c!="string"||u!==void 0&&typeof u!="string"||l!==void 0&&(typeof l!="number"||!We(l))||d!==void 0&&typeof d!="string"||R!==void 0&&typeof R!="string"||x!==void 0&&typeof x!="string"?null:{slug:n,category:o,status:i,title:a,message:c,suggestion:u,exitCode:l,detail:d,cause:f,instance:R,context:$,stack:x}}catch{return null}}var Kr=s({slug:"config-not-found",category:"CONFIG",status:404,title:"Configuration file not found",suggestion:"Create veryfront.config.js, veryfront.config.ts, or veryfront.config.mjs in the project root"}),Xr=s({slug:"config-invalid",category:"CONFIG",status:400,title:"Invalid configuration format",suggestion:"Check the reported configuration path and validation details"}),qr=s({slug:"config-parse-error",category:"CONFIG",status:400,title:"Failed to parse configuration",suggestion:"Ensure your configuration file contains valid JavaScript or TypeScript"}),Jr=s({slug:"config-validation-error",category:"CONFIG",status:422,title:"Configuration validation failed",suggestion:"Check the configuration against the schema requirements"}),Zr=s({slug:"config-type-error",category:"CONFIG",status:400,title:"Configuration type mismatch",suggestion:"Ensure configuration values match expected types"}),Qr=s({slug:"import-map-invalid",category:"CONFIG",status:400,title:"Invalid import map configuration",suggestion:"Check your import map syntax and paths"}),en=s({slug:"cors-config-invalid",category:"CONFIG",status:400,title:"Invalid CORS configuration",suggestion:"Review CORS settings in your configuration"}),tn=s({slug:"config-validation-failed",category:"CONFIG",status:400,title:"Configuration validation failed",suggestion:"Check configuration values against requirements"}),rn=s({slug:"webhook-config-invalid",category:"CONFIG",status:400,title:"Invalid webhook configuration",suggestion:"Check webhook definition fields, target settings, and eventFilter conditions"}),nn=s({slug:"schedule-config-invalid",category:"CONFIG",status:400,title:"Invalid schedule configuration",suggestion:"Check schedule definition fields, cron expression, target settings, and positive-integer limits"}),on=s({slug:"trigger-config-invalid",category:"CONFIG",status:400,title:"Invalid trigger configuration",suggestion:"Check trigger ID format (lowercase, alphanumeric, dots/slashes/hyphens) and ensure all input values are JSON-serializable"}),Ze={"config-not-found":Kr,"config-invalid":Xr,"config-parse-error":qr,"config-validation-error":Jr,"config-type-error":Zr,"import-map-invalid":Qr,"cors-config-invalid":en,"config-validation-failed":tn,"webhook-config-invalid":rn,"schedule-config-invalid":nn,"trigger-config-invalid":on};var sn=s({slug:"build-failed",category:"BUILD",status:500,title:"Build process failed",suggestion:"Check the build output for specific errors"}),an=s({slug:"bundle-error",category:"BUILD",status:500,title:"Bundle generation failed",suggestion:"Review bundler output for details"}),cn=s({slug:"typescript-error",category:"BUILD",status:500,title:"TypeScript compilation error",suggestion:"Fix TypeScript errors shown in the output"}),ln=s({slug:"mdx-compile-error",category:"BUILD",status:500,title:"MDX compilation failed",suggestion:"Check your MDX file syntax"}),un=s({slug:"asset-optimization-error",category:"BUILD",status:500,title:"Asset optimization failed",suggestion:"Check asset file formats and paths"}),dn=s({slug:"ssg-generation-error",category:"BUILD",status:500,title:"Static site generation failed",suggestion:"Review SSG configuration and data fetching"}),gn=s({slug:"sourcemap-error",category:"BUILD",status:500,title:"Source map generation failed",suggestion:"Check source map configuration"}),fn=s({slug:"compilation-error",category:"BUILD",status:500,title:"Compilation failed",suggestion:"Review compiler output for specific errors"}),Qe={"build-failed":sn,"bundle-error":an,"typescript-error":cn,"mdx-compile-error":ln,"asset-optimization-error":un,"ssg-generation-error":dn,"sourcemap-error":gn,"compilation-error":fn};var pn=s({slug:"hydration-mismatch",category:"RUNTIME",status:500,title:"Client/server hydration mismatch",suggestion:"Ensure server and client render the same content"}),yn=s({slug:"render-error",category:"RUNTIME",status:500,title:"Component render failed",suggestion:"Check component for runtime errors"}),mn=s({slug:"component-error",category:"RUNTIME",status:500,title:"Component execution error",suggestion:"Review component logic and props"}),En=s({slug:"layout-not-found",category:"RUNTIME",status:404,title:"Layout component not found",suggestion:"Ensure layout file exists at the expected path"}),Rn=s({slug:"page-not-found",category:"RUNTIME",status:404,title:"Page component not found",suggestion:"Check that the page file exists in the routes directory"}),hn=s({slug:"api-error",category:"RUNTIME",status:500,title:"API route handler error",suggestion:"Review API route handler for errors"}),_n=s({slug:"middleware-error",category:"RUNTIME",status:500,title:"Middleware execution error",suggestion:"Check middleware function for errors"}),xn=s({slug:"trigger-target-not-found",category:"RUNTIME",status:404,title:"Trigger target not found",suggestion:"Ensure the referenced task or workflow ID is registered in the project"}),Tn=s({slug:"trigger-execution-failed",category:"RUNTIME",status:500,title:"Trigger target execution failed",suggestion:"Check the task or workflow for errors and review the trigger input"}),Sn=s({slug:"trigger-not-supported",category:"RUNTIME",status:501,title:"Trigger target type not supported in local runtime",suggestion:"Use a workflow or task target for local trigger runs; agent targets require the Cloud runtime"}),et={"hydration-mismatch":pn,"render-error":yn,"component-error":mn,"layout-not-found":En,"page-not-found":Rn,"api-error":hn,"middleware-error":_n,"trigger-target-not-found":xn,"trigger-execution-failed":Tn,"trigger-not-supported":Sn};var An=s({slug:"route-conflict",category:"ROUTE",status:409,title:"Conflicting route definitions",suggestion:"Rename or reorganize conflicting route files"}),Cn=s({slug:"invalid-route-file",category:"ROUTE",status:400,title:"Invalid route file structure",suggestion:"Ensure route file exports required functions"}),bn=s({slug:"route-handler-invalid",category:"ROUTE",status:400,title:"Invalid route handler export",suggestion:"Export a valid handler function from the route file"}),On=s({slug:"dynamic-route-error",category:"ROUTE",status:500,title:"Dynamic route parsing failed",suggestion:"Check dynamic route segment syntax"}),In=s({slug:"route-params-error",category:"ROUTE",status:400,title:"Route parameters invalid",suggestion:"Validate route parameter values"}),Nn=s({slug:"api-route-error",category:"ROUTE",status:500,title:"API route definition error",suggestion:"Review API route configuration"}),tt={"route-conflict":An,"invalid-route-file":Cn,"route-handler-invalid":bn,"dynamic-route-error":On,"route-params-error":In,"api-route-error":Nn};var Dn=s({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"}),wn=s({slug:"import-resolution-error",category:"MODULE",status:500,title:"Import path resolution failed",suggestion:"Verify import paths and module configuration"}),Mn=s({slug:"circular-dependency",category:"MODULE",status:500,title:"Circular dependency detected",suggestion:"Refactor imports to break the circular dependency"}),Pn=s({slug:"invalid-import",category:"MODULE",status:400,title:"Invalid import statement",suggestion:"Fix import syntax or path"}),Ln=s({slug:"dependency-missing",category:"MODULE",status:404,title:"Required dependency not installed",suggestion:"Install the missing dependency with your package manager"}),Un=s({slug:"version-mismatch",category:"MODULE",status:409,title:"Dependency version mismatch",suggestion:"Update dependencies to compatible versions"}),Hn=s({slug:"lockfile-format-mismatch",category:"MODULE",status:409,title:"Lockfile format is not supported",suggestion:"Upgrade Veryfront or migrate the lockfile before modifying it"}),vn=s({slug:"lockfile-read-error",category:"MODULE",status:500,title:"Lockfile could not be read safely",suggestion:"Check file access or restore a valid lockfile before retrying"}),rt={"module-not-found":Dn,"import-resolution-error":wn,"circular-dependency":Mn,"invalid-import":Pn,"dependency-missing":Ln,"version-mismatch":Un,"lockfile-format-mismatch":Hn,"lockfile-read-error":vn};var kn=s({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"}),$n=s({slug:"server-start-error",category:"SERVER",status:500,title:"Server failed to start",suggestion:"Check server configuration and port availability"}),Vn=s({slug:"cache-error",category:"SERVER",status:500,title:"Cache operation failed",suggestion:"Clear the cache and try again"}),Fn=s({slug:"file-watch-error",category:"SERVER",status:500,title:"File watcher error",suggestion:"Restart the development server"}),Gn=s({slug:"request-error",category:"SERVER",status:500,title:"HTTP request handling error",suggestion:"Check request handler and middleware"}),Bn=s({slug:"service-overloaded",category:"SERVER",status:503,title:"Service overloaded",suggestion:"Reduce load or scale up resources"}),jn=s({slug:"project-execution-unavailable",category:"SERVER",status:503,title:"Project execution unavailable",suggestion:"Route the project to a dedicated isolated runtime"}),zn=s({slug:"semaphore-timeout",category:"SERVER",status:503,title:"Semaphore acquire timeout",suggestion:"Reduce concurrency or increase the semaphore acquire timeout"}),Yn=s({slug:"circuit-breaker-open",category:"SERVER",status:503,title:"Circuit breaker is open",suggestion:"Wait for the breaker reset timeout before retrying"}),Wn=s({slug:"cache-path-mismatch",category:"SERVER",status:500,title:"Cache path mismatch",suggestion:"Clear the cache directory and rebuild"}),Kn=s({slug:"network-error",category:"SERVER",status:502,title:"Network operation failed",suggestion:"Check network connectivity and retry"}),Xn=s({slug:"api-client-error",category:"SERVER",status:500,title:"API client request failed",suggestion:"Check API connectivity and authentication"}),qn=s({slug:"token-storage-error",category:"SERVER",status:500,title:"Token storage operation failed",suggestion:"Check token storage backend and credentials"}),Jn=s({slug:"cache-invariant-violation",category:"SERVER",status:500,title:"Cache path invariant violated",suggestion:"Clear the cache and rebuild"}),Zn=s({slug:"release-not-found",category:"SERVER",status:404,title:"No active release found",suggestion:"Deploy the project to create a release for this environment"}),Qn=s({slug:"fallback-exhausted",category:"SERVER",status:500,title:"Primary and fallback operations both failed",suggestion:"Check service availability and connectivity"}),eo=s({slug:"rag-store-corrupt",category:"SERVER",status:500,title:"RAG store file is corrupt",suggestion:"Repair or move the store file aside, then retry; it was not overwritten"}),to=s({slug:"rag-store-unavailable",category:"SERVER",status:500,title:"RAG store file is unavailable",suggestion:"Check storage availability, permissions, and concurrent operations, then retry"}),nt={"port-in-use":kn,"server-start-error":$n,"cache-error":Vn,"file-watch-error":Fn,"request-error":Gn,"service-overloaded":Bn,"project-execution-unavailable":jn,"semaphore-timeout":zn,"circuit-breaker-open":Yn,"cache-path-mismatch":Wn,"network-error":Kn,"api-client-error":Xn,"token-storage-error":qn,"cache-invariant-violation":Jn,"release-not-found":Zn,"fallback-exhausted":Qn,"rag-store-corrupt":eo,"rag-store-unavailable":to};var ro=s({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"}),no=s({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"}),oo=s({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"}),so=s({slug:"invalid-use-client",category:"BOUNDARY",status:400,title:"Invalid \'use client\' directive",suggestion:"Place \'use client\' at the top of the file"}),io=s({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"}),ao=s({slug:"rsc-payload-error",category:"BOUNDARY",status:500,title:"RSC payload serialization error",suggestion:"Ensure props are serializable (no functions, symbols, etc.)"}),co=s({slug:"ssr-output-limit-exceeded",category:"BOUNDARY",status:500,title:"SSR output limit exceeded",suggestion:"Reduce the rendered HTML size or split the response into smaller pages"}),ot={"client-boundary-violation":ro,"server-only-in-client":no,"client-only-in-server":oo,"invalid-use-client":so,"invalid-use-server":io,"rsc-payload-error":ao,"ssr-output-limit-exceeded":co};var lo=s({slug:"hmr-error",category:"DEV",status:500,title:"Hot module replacement error",suggestion:"Restart the development server"}),uo=s({slug:"dev-server-error",category:"DEV",status:500,title:"Development server error",suggestion:"Check the dev server logs and restart"}),go=s({slug:"fast-refresh-error",category:"DEV",status:500,title:"Fast refresh failed",suggestion:"Save the file again or restart the dev server"}),fo=s({slug:"error-overlay-error",category:"DEV",status:500,title:"Error overlay failed",suggestion:"Check browser console for details"}),po=s({slug:"source-map-error",category:"DEV",status:500,title:"Source map loading error",suggestion:"Rebuild or clear cache"}),st={"hmr-error":lo,"dev-server-error":uo,"fast-refresh-error":go,"error-overlay-error":fo,"source-map-error":po};var yo=s({slug:"deployment-error",category:"DEPLOY",status:500,title:"Deployment process failed",suggestion:"Check deployment logs for details"}),mo=s({slug:"platform-error",category:"DEPLOY",status:500,title:"Platform-specific error",suggestion:"Check platform documentation and requirements"}),Eo=s({slug:"env-var-missing",category:"DEPLOY",status:500,title:"Required environment variable missing",suggestion:"Set the required environment variable"}),Ro=s({slug:"production-build-required",category:"DEPLOY",status:400,title:"Production build required",suggestion:"Run \'veryfront build\' before deploying"}),ho=s({slug:"environment-not-found",category:"DEPLOY",status:404,title:"Deployment environment not found",suggestion:"Check environment names with: veryfront config"}),_o=s({slug:"release-missing-version",category:"DEPLOY",status:500,title:"Release has no version",suggestion:"Try again or check the build logs in Studio"}),xo=s({slug:"release-build-timeout",category:"DEPLOY",status:408,title:"Release build timed out",suggestion:"Try again or check the build logs in Studio"}),To=s({slug:"deployment-verification-timeout",category:"DEPLOY",status:408,title:"Deployment verification timed out",suggestion:"Try again or check the deployment status in Studio"}),So=s({slug:"push-receipt-missing",category:"DEPLOY",status:400,title:"Push receipt not found",suggestion:"Run: veryfront push --branch main first"}),Ao=s({slug:"source-digest-mismatch",category:"DEPLOY",status:409,title:"Release source digest mismatch",suggestion:"Run veryfront push again to re-upload source files"}),Co=s({slug:"preview-hostname-too-long",category:"DEPLOY",status:400,title:"Preview hostname too long",suggestion:"Use a shorter project slug or branch name"}),bo=s({slug:"branch-not-found",category:"DEPLOY",status:404,title:"Branch not found",suggestion:"List branches in Studio or push a new one with: veryfront push --branch <name>"}),it={"deployment-error":yo,"platform-error":mo,"env-var-missing":Eo,"production-build-required":Ro,"environment-not-found":ho,"release-missing-version":_o,"release-build-timeout":xo,"deployment-verification-timeout":To,"push-receipt-missing":So,"source-digest-mismatch":Ao,"preview-hostname-too-long":Co,"branch-not-found":bo};var Oo=s({slug:"agent-error",category:"AGENT",status:500,title:"Agent operation error",suggestion:"Check agent configuration and logs"}),Io=s({slug:"agent-not-found",category:"AGENT",status:404,title:"Agent not found",suggestion:"Verify the agent ID exists"}),No=s({slug:"agent-timeout",category:"AGENT",status:408,title:"Agent operation timed out",suggestion:"Increase timeout or simplify the request"}),Do=s({slug:"agent-intent-error",category:"AGENT",status:400,title:"Agent intent parsing error",suggestion:"Rephrase the request more clearly"}),wo=s({slug:"orchestration-error",category:"AGENT",status:500,title:"Multi-agent orchestration error",suggestion:"Check agent coordination logic"}),Mo=s({slug:"cost-limit-exceeded",category:"AGENT",status:429,title:"Cost limit exceeded",suggestion:"Wait for the budget period to reset or increase the limit"}),Po=s({slug:"tool-id-conflict",category:"AGENT",status:409,title:"Tool ID conflict",suggestion:"Use a unique tool ID or rename one of the conflicting tools"}),Lo=s({slug:"durable-run-event-persistence-failed",category:"AGENT",status:500,title:"Durable run event persistence failed",suggestion:"Correct invalid or oversized event data, or retry after durable event storage recovers"}),at={"agent-error":Oo,"agent-not-found":Io,"agent-timeout":No,"agent-intent-error":Do,"orchestration-error":wo,"cost-limit-exceeded":Mo,"tool-id-conflict":Po,"durable-run-event-persistence-failed":Lo};var Uo=s({slug:"unknown-error",category:"GENERAL",status:500,title:"Unknown/unclassified error",suggestion:"Check logs for more details"}),Ho=s({slug:"authentication-required",category:"GENERAL",status:401,title:"Authentication required",suggestion:"Set VERYFRONT_API_TOKEN or run \'veryfront login\'"}),vo=s({slug:"permission-denied",category:"GENERAL",status:403,title:"File/resource permission denied",suggestion:"Check file permissions and access rights"}),ko=s({slug:"file-not-found",category:"GENERAL",status:404,title:"File not found",suggestion:"Verify the file path exists"}),$o=s({slug:"resource-not-found",category:"GENERAL",status:404,title:"Requested resource not found",suggestion:"Verify the referenced resource ID or name exists"}),Vo=s({slug:"invalid-argument",category:"GENERAL",status:400,title:"Invalid function argument",suggestion:"Check argument types and values",exitCode:2}),Fo=s({slug:"timeout-error",category:"GENERAL",status:408,title:"Operation timed out",suggestion:"Increase timeout or optimize the operation"}),Go=s({slug:"initialization-error",category:"GENERAL",status:500,title:"Initialization failed",suggestion:"Check initialization requirements and dependencies"}),Bo=s({slug:"not-supported",category:"GENERAL",status:501,title:"Feature not supported",suggestion:"Check documentation for supported features"}),me=s({slug:"security-violation",category:"GENERAL",status:403,title:"Security violation detected",suggestion:"Check for path traversal or unauthorized access attempts"}),jo=s({slug:"input-validation-failed",category:"GENERAL",status:400,title:"Input validation failed",suggestion:"Check request input against validation rules"}),zo=s({slug:"project-source-empty",category:"GENERAL",status:400,title:"Project source is empty",suggestion:"Add project files or run \'veryfront init\'"}),Yo=s({slug:"nested-cwd-scope",category:"GENERAL",status:500,title:"Working directory scope nested inside another",suggestion:"Do the inner work directly in the outer scope\'s callback instead of opening a second one"}),ct={"unknown-error":Uo,"authentication-required":Ho,"permission-denied":vo,"file-not-found":ko,"resource-not-found":$o,"invalid-argument":Vo,"timeout-error":Fo,"initialization-error":Go,"not-supported":Bo,"security-violation":me,"input-validation-failed":jo,"project-source-empty":zo,"nested-cwd-scope":Yo};var wa=Me(Ze,Qe,et,tt,rt,nt,ot,st,it,at,ct);var Wo=[{source:String.raw`<script[^>]*>[\\s\\S]*?<\\/script>`,flags:"gi",name:"inline script"},{source:String.raw`javascript:`,flags:"gi",name:"javascript: URL"},{source:String.raw`\\bon\\w+\\s*=`,flags:"gi",name:"event handler attribute"},{source:String.raw`data:\\s*text\\/html`,flags:"gi",name:"data: HTML URL"}];function Ko(){return Wo.map(({source:e,flags:t,name:r})=>({pattern:new RegExp(e,t),name:r}))}function Xo(){let e=globalThis;return e.__VERYFRONT_DEV__===!0||e.Deno?.env?.get?.("VERYFRONT_ENV")==="development"}function v(e,t={}){let{allowInlineScripts:r=!1,strict:n=!1,warn:o=!0}=t;for(let{pattern:i,name:a}of Ko())if(!(r&&a==="inline script")&&(i.lastIndex=0,!!i.test(e)&&(o&&console.warn(`[Security] Suspicious ${a} detected in server HTML`),n||!Xo())))throw me.create({detail:`Potentially unsafe HTML: ${a} detected`});return e}function k(e,t){let r=t==="root"?L:`rsc-slot-${t}`,n=e.getElementById(r);if(n)return n;let o=e.createElement("div");return o.id=r,e.body.appendChild(o),o}function qo(e,t){if(t.type!=="slot")return;let r=k(e,t.id);r.innerHTML=v(String(t.html??""))}function lt(e,t){let r=t.split(`\n`),n=r.pop()??"";for(let o of r){let i=o.trim();if(!i)continue;let a;try{a=JSON.parse(i)}catch(u){g.debug("[client-dom] malformed NDJSON line",{line:i,error:u instanceof Error?u.message:String(u)});continue}if(!a||typeof a!="object")continue;let c=a;if(c.type==="slot"){qo(e,c);try{Qo(e,c.id||"root")}catch(u){g.debug("[client-dom] hydration optional failed",u)}}}return n}function Jo(e){return new Promise((t,r)=>{let n=()=>r(new DOMException("aborted","AbortError"));if(e.aborted){n();return}e.addEventListener("abort",n,{once:!0})})}async function ut(e,t=document,r){let n="body"in e?e:null,o=n?.body??e;if(!o)return;n&&Y(t,n.headers.get(j));let i=o.getReader(),a=new TextDecoder,c="",u=!1;try{for(;;){if(r?.aborted)throw new DOMException("aborted","AbortError");let l=i.read(),{done:d,value:f}=r?await Promise.race([l,Jo(r)]):await l;if(d){u=!0;break}c+=a.decode(f,{stream:!0}),c=lt(t,c)}c&<(t,`${c}\n`)}catch(l){throw l instanceof Error&&l.name==="AbortError"||g.debug("[client-dom] consumeNdjsonStream error",l),l}finally{try{await i.cancel()}catch(l){u||g.debug("[client-dom] reader.cancel failed",l)}try{i.releaseLock()}catch(l){g.debug("[client-dom] reader.releaseLock failed",l)}if(typeof o.cancel=="function")try{await o.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 Zo(e,t){let r=k(e,t),n=[],o=i=>{let a=i;a.dataset?.clientRef&&n.push(a);for(let c of i.children)o(c)};return o(r),n}function Qo(e,t){let r=Zo(e,t);for(let n of r){let o=n.dataset?.clientRef;o&&(n.dataset.hydrated="true",g.debug("[client-dom] marked for hydration",o))}}var es=new Set(["server","client","html","fragment"]);function dt(e){if(!e)return[];try{let t=JSON.parse(e);return rs(t)?t.nodes:[]}catch{return[]}}async function Re(e,t,r){return await Promise.all(e.map(n=>ts(n,t,r)))}async function ts(e,t,r){if(e.type==="html")return e.text??e.html??"";let n=await Re(e.children??[],t,r);if(e.type==="fragment"||e.type==="server"&&!e.component)return t.createElement(t.Fragment,{},...n);if(e.type==="server")return t.createElement(e.component,e.props??{},...n);let o=await r(e.component);return o?t.createElement(o,e.props??{},...n):null}function rs(e){return!Ee(e)||e.version!==1||!Array.isArray(e.nodes)?!1:e.nodes.every(t=>gt(t,0))}function gt(e,t){return t>100||!Ee(e)||!es.has(e.type)||e.type==="html"&&typeof e.html!="string"&&typeof e.text!="string"||e.type==="client"&&typeof e.component!="string"||e.type==="server"&&e.component!==void 0&&typeof e.component!="string"||e.props!==void 0&&!Ee(e.props)?!1:e.children===void 0?!0:Array.isArray(e.children)&&e.children.every(r=>gt(r,t+1))}function Ee(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ns(e){if(!e)return{};let t={};for(let[r,n]of Object.entries(e))t[r]=Array.isArray(n)?n.join("/"):n;return t}async function ee(e,t,r=document){try{let n=we(r);if(!n)return e;let i=(await import(n)).wrapForHydration;return typeof i!="function"?e:i(e,{params:ns(t?.params),frontmatter:t?.frontmatter??{},data:t?.props??{}})}catch(n){return g.debug("router provider wrap failed",n),e}}var os="Unknown dependency snapshot",ss="export default null; // Unknown dependency snapshot",he="__VF_DEPENDENCY_SNAPSHOT_RECOVERY_STARTED__";function is(){return globalThis}async function as(e){if(e.status!==409)return!1;try{let t=(await e.clone().text()).trim();return t===os||t===ss}catch{return!1}}async function N(e,t=()=>globalThis.location.reload()){if(!await as(e))return!1;let r=is();if(r[he])return!0;r[he]=!0;try{t()}catch{return delete r[he],!1}return!0}async function te(e,t=globalThis.fetch,r=()=>globalThis.location.reload()){try{let n=new URL(e,"http://veryfront.local").searchParams.getAll("pins");if(n.length!==1||!n[0]?.startsWith("on:"))return!1;let o=await t(e,{cache:"no-store"});return await N(o,r)}catch{return!1}}var cs=100;function ls(e,t){if(globalThis.__VF_CLIENT_MOD_CACHE??(globalThis.__VF_CLIENT_MOD_CACHE=new Map),globalThis.__VF_CLIENT_MOD_CACHE.size>=cs){let r=globalThis.__VF_CLIENT_MOD_CACHE.keys().next().value;r&&globalThis.__VF_CLIENT_MOD_CACHE.delete(r)}globalThis.__VF_CLIENT_MOD_CACHE.set(e,t)}function ft(e){let t=e.match(/^\\/app\\/(.+)#([\\w$.-]+)$/);if(t)return{rel:`/${t[1]||""}`,exportName:t[2]||"default"};let r=e.match(/^(\\/_veryfront\\/[^#]+)#([\\w$.-]+)$/);return r?{moduleUrl:r[1],exportName:r[2]||"default"}:(g.debug("hydrate: unrecognised client ref format, skipping",{ref:e}),null)}function us(e){let t=e.dataset?.rscProps;if(!t)return{};try{let r=JSON.parse(t);return r&&typeof r=="object"&&!Array.isArray(r)?r:{}}catch(r){return g.debug("hydrate: invalid client boundary props, using empty props",r),{}}}function ds(e){return dt(e.dataset?.rscChildren)}function gs(e){return"/_veryfront/rsc/manifest"}function fs(e){return U(e)}async function ps(e=document){try{let t=b(e),r=await fetch(gs(t),{headers:fs(t)});return r.ok?await r.json():(await N(r),null)}catch{return null}}async function pt(e,t,r,n={}){let o=ys(e,t,r,n.releaseAssetModules),i=t.moduleUrl??t.rel;if(!i)return null;let a=`${i}#${e.hash??""}`;try{let c=globalThis.__VF_CLIENT_MOD_CACHE?.get(a);if(c)return c}catch(c){g.debug("hydrate: cache get failed",c)}if(!o)return null;try{let c=await(n.importModule??(u=>import(u)))(o);try{ls(a,c)}catch(u){g.debug("hydrate: cache set failed",u)}return c}catch(c){return g.debug("hydrate: failed to import module",{moduleUrl:o,error:c}),await(n.recoverSnapshotFailure??te)(o),null}}function ys(e,t,r,n){if(t.moduleUrl)return K(t.moduleUrl,e.dependencyPinningCacheKey);if(!t.rel)return null;let o=e.graphIds?.client.find(i=>i.rel===t.rel)?.path;return X({strategy:r,rel:t.rel,absPath:o,version:e.hash,dependencyPinningCacheKey:e.dependencyPinningCacheKey,releaseAssetModules:n})}function ms(e){let t=Array.from(e.querySelectorAll("[data-client-ref]")),r=new Set(t);return t.filter(n=>{let o=n.parentElement;for(;o;){if(r.has(o))return!1;o=o.parentElement}return!0})}async function yt(e=document){let t=null;try{t=await ps(e)}catch(l){g.debug("hydrate: fetch manifest failed",l)}if(!t){g.debug("hydrate: no manifest");return}let r=ms(e);try{let l=globalThis.__VF_MANIFEST_HASH;if(!r.some(f=>f.dataset?.hydrated!=="true")&&l&&t.hash&&l===t.hash)return}catch(l){g.debug("hydrate: hmr hash read failed",l)}if(r.length===0){try{globalThis.__VF_MANIFEST_HASH=t.hash??""}catch(l){g.debug("hydrate: set hash failed",l)}return}let n=b(e),o=W(n),i=n?.releaseAssetModules;try{if(globalThis.__VF_TEST_MODE__){globalThis.__VF_HYDRATE_CALLED=!0,globalThis.__VF_MANIFEST_HASH=t.hash??"";return}}catch(l){g.debug("hydrate: test mode flags failed",l)}let a=q(e,n?.reactVersion),[{default:c},{createRoot:u}]=await Promise.all([import(a.react),import(a.reactDomClient)]);for(let l of r){let d=l.dataset?.clientRef??"";if(!d||l.dataset?.hydrated==="true")continue;let f=ft(d);if(!f)continue;let R=await pt(t,f,o,{releaseAssetModules:i});if(!R)continue;let $=R[f.exportName]??R.default;if(typeof $=="function")try{let x=u(l),ne=us(l),D=ds(l),mt=await Re(D,{Fragment:c.Fragment,createElement(V,oe,...F){return c.createElement(V,oe,...F)}},async V=>{let oe=t.modules.find(Rt=>Rt.id===V),F=t.components?.[V],Te=oe?.clientRef??(F?`${F}#default`:void 0);if(!Te)return null;let se=ft(Te);if(!se)return null;let ie=await pt(t,se,o,{releaseAssetModules:i});if(!ie)return null;let Se=ie[se.exportName]??ie.default;return typeof Se=="function"?Se:null}),Et=await ee(c.createElement($,ne,...mt),n,e);x.render(Et),l.dataset.hydrated="true"}catch(x){g.warn("hydrate: render failed",x)}}try{globalThis.__VF_MANIFEST_HASH=t.hash??""}catch(l){g.debug("hydrate: set hash failed (post)",l)}}var _e="data-vf-react-head-owner";var Es=2*1024*1024,lc=Es*2;var uc=64*1024,dc=1024*1024,gc=1024*1024;var fc=new TextEncoder;async function Rs(){let e=b(document),t=q(document,e?.reactVersion),[r,n]=await Promise.all([import(t.react),import(t.reactDomClient)]);return{React:r,ReactDOM:n}}var hs=new Set(["SCRIPT","STYLE","NOSCRIPT","TEMPLATE"]);function xe(e){let t=e.getAttribute("style")??"";return e.hasAttribute("data-veryfront-head")||e.hasAttribute("hidden")||/(?:^|;)\\s*display\\s*:\\s*none(?:\\s*;|$)/i.test(t)||hs.has(e.tagName.toUpperCase())}function _s(e,t){return e.find(r=>r.tagName.toUpperCase()==="DIV"&&!!r.getAttribute("class")?.trim()&&!xe(r))??t}function xs(e,t){return e===t}function Ts(e,t){let r=document.createElement("div");r.setAttribute("data-veryfront-hydration-root","page");let n=e.find(o=>!xe(o));n?.parentNode===t?t.insertBefore(r,n):t.appendChild(r);for(let o of e)!xe(o)&&o.parentNode===t&&r.appendChild(o);return r}function Ss(e,t){for(let r of e){let n=[...r.hasAttribute(_e)?[r]:[],...r.querySelectorAll(`[${_e}]`)];for(let o of n)t.contains(o)||o.remove()}}function As(e,t,r=document){return!!t?.pagePath&&typeof e?.__veryfrontRenderPage=="function"&&!!r.getElementById("root")}function Cs(e,t){return t?.pagePath?!1:!!e.getElementById(L)}function bs(e=import.meta.url){try{return new URL(e,"http://veryfront.local").searchParams.get("hydrate")==="1"}catch{return!1}}function Os(e){return e==="rsc-module"}function Is(e,t){return e?e.startsWith("?")?e:`?${e}`:""}function Ns(e,t,r){return X({strategy:t,rel:e,releaseAssetModules:r?.releaseAssetModules,dependencyPinningCacheKey:r?.dependencyPinningCacheKey})}async function Ds(e,t){try{let r=await fetch(P+"stream"+e,{headers:U(t)});if(!r.ok)return await N(r)?"snapshot-conflict":"failure";if(!r.body)return"failure";let n=new AbortController;return addEventListener("pagehide",()=>n.abort(),{once:!0}),await ut(r,document,n.signal),"success"}catch(r){return g.debug("tryStream failed",r),"failure"}}async function re(){try{await yt(document)}catch(e){g.debug("hydration failed",e)}}async function ws(e,t,r){try{let{React:n,ReactDOM:o}=await Rs(),i=Ns(e,t,r);if(!i)return!1;g.debug("Loading component from:",i);let a;try{a=await import(i)}catch(R){throw await te(i),R}let c=a.default;if(typeof c!="function")return g.debug("Page component is not a function"),!1;let u=Array.from(document.body.children),l=_s(u,document.body),d=xs(l,document.body)?Ts(u,document.body):l;Ss(u,d);let f=await ee(n.createElement(c,{}),r);return Os(t)?o.createRoot(d).render(f):o.hydrateRoot(d,f,{identifierPrefix:"vf",onRecoverableError:()=>{}}),g.debug("Page component hydrated successfully"),!0}catch(n){return g.error("Page hydration failed",n),!1}}async function Ms(e,t){try{let r=await fetch(P+"payload"+e,{headers:U(t)});if(!r.ok)return await N(r)?"snapshot-conflict":"failure";let n=await r.json();if(Y(document,n?.dependencyPinningCacheKey),n?.slots){for(let[o,i]of Object.entries(n.slots))k(document,o).innerHTML=v(String(i||""));return"success"}return k(document,L).innerHTML=v(String(n?.html||"")),"success"}catch(r){return g.debug("payload fetch failed",r),"failure"}}async function Ps(){try{let e=b(document),t=Is(globalThis.window?.location.search??"",e?.dependencyPinningCacheKey);if(bs()){await re();return}let r=e?.pagePath,n=W(e);if(r){if(As(globalThis.window,e,document)){g.debug("Page renderer owns hydration");return}g.debug("Found page component in hydration data:",r),await ws(r,n,e)&&g.debug("Client component hydrated successfully");return}if(!Cs(document,e))return;let o=await Ds(t,e);if(o==="snapshot-conflict")return;if(o==="success"){await re();return}let i=await Ms(t,e);if(i==="snapshot-conflict")return;if(i==="success"){await re();return}await re()}catch(e){g.error("boot failed",e)}}if(typeof document<"u"){let e=()=>{Ps()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):e()}export{Ps as boot,Ns as buildPageHydrationModuleUrl,Is as buildRSCTransportQuery,Ss as retireAbandonedHeadOwnerMarkers,_s as selectHydrationRoot,Cs as shouldAttemptRSCTransport,bs as shouldHydrateOnly,Os as shouldRenderPageComponent,As as shouldUsePageRendererHydration,xs as shouldWrapPageHydrationRoot};\n';
|
|
9
|
-
export const CLIENT_DOM_BUNDLE = 'var Nt=Object.defineProperty;var bt=(e,r,t)=>r in e?Nt(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var m=(e,r,t)=>bt(e,typeof r!="symbol"?r+"":r,t);var Dt=new Set(["CONFIG","BUILD","RUNTIME","ROUTE","MODULE","SERVER","BOUNDARY","DEV","DEPLOY","AGENT","GENERAL"]);function Ut(e,...r){let t=Object.create(null),n=e.charAt(0).toUpperCase()+e.slice(1);for(let s of r)for(let[i,a]of Object.entries(s)){if(typeof a!="object"||a===null||!Object.hasOwn(a,"slug"))throw new Error(`${n} entry "${i}" must define a slug`);let c=a.slug;if(typeof c!="string")throw new Error(`${n} entry "${i}" must define a string slug`);if(c!==i)throw new Error(`${n} key "${i}" does not match entry slug "${c}"`);if(Object.hasOwn(t,i))throw new Error(`Duplicate ${e} slug "${i}"`);t[i]=a}return Object.freeze(t)}function F(...e){for(let r of e)for(let t of Object.values(r)){if(typeof t.slug!="string"||t.slug.length<3||t.slug.length>40||!/^[a-z][a-z0-9-]*[a-z0-9]$/.test(t.slug))throw new TypeError(`Registered error slug must be 3-40 characters of lowercase kebab-case, got "${t.slug}"`);if(typeof t.category!="string"||!Dt.has(t.category))throw new TypeError(`Registered error has unknown category "${t.category}"`);if(!Number.isInteger(t.status)||t.status<400||t.status>=600)throw new RangeError(`Registered error status must be an integer from 400 through 599, got ${t.status}`);if(typeof t.title!="string"||t.title.trim().length===0)throw new TypeError("Registered error title must be a non-empty string");if(t.suggestion!==void 0&&(typeof t.suggestion!="string"||t.suggestion.trim().length===0))throw new TypeError("Registered error suggestion must be non-empty when provided")}return Ut("error registry",...e)}var C={reset:"\\x1B[0m",dim:"\\x1B[2m",gray:"\\x1B[90m",red:"\\x1B[31m",green:"\\x1B[32m",yellow:"\\x1B[33m",blue:"\\x1B[34m",magenta:"\\x1B[35m",cyan:"\\x1B[36m"},Kn={debug:C.gray,info:C.green,warn:C.yellow,error:C.red};var E="[REDACTED]",p=Reflect.apply,Lt=Array.prototype.pop,wt=Array.prototype.push;var Xn=Array.prototype,Jn=BigInt.prototype.toString,B=Map,vt=Map.prototype.delete,Pt=Map.prototype.get,Mt=Map.prototype.keys,kt=Map.prototype.set;var h=Object.getOwnPropertyDescriptor,$t=Object.getPrototypeOf,Zn=Object.hasOwn,Qn=Object.prototype,Vt=Set,Gt=decodeURIComponent,_=URL,to=Number.isFinite,eo=Number.isInteger,w=RegExp.prototype.exec,Ft=h(RegExp.prototype,"global").get,Ht=h(RegExp.prototype,"unicode").get,jt=String.prototype.charCodeAt,zt=String.prototype.includes,Yt=String.prototype.indexOf,H=String.prototype.slice,W=String.prototype.startsWith,K=String.prototype.toLowerCase,Bt=Set.prototype.add,ro=Set.prototype.delete,Wt=Set.prototype.has,Kt=$t(new B().keys()).next,qt=h(Map.prototype,"size").get,no=h(_.prototype,"host").get,oo=h(_.prototype,"origin").get,Xt=h(_.prototype,"password").get,so=h(_.prototype,"pathname").get,io=h(_.prototype,"protocol").get,Jt=h(_.prototype,"username").get,Zt=/[^a-z0-9]/g,Qt=/([a-z0-9])([A-Z])/g,te=/([A-Z])([A-Z][a-z])/g,ee=/\\b(?:sk-[A-Za-z0-9._-]{8,}|gh[po]_[A-Za-z0-9._-]{8,}|xox[baprs]-[A-Za-z0-9._-]{8,}|eyJ[A-Za-z0-9._-]{8,})\\b/g;function y(e,r,t){let n=p(Ft,r,[]),s=p(Ht,r,[]),i=0,a=!1,c="";r.lastIndex=0;try{for(;;){let l=p(w,r,[e]);if(l===null)break;let u=l[0],g=l.index;if(c+=x(e,i,g),c+=typeof t=="string"?t:t(l),i=g+u.length,a=!0,!n)break;u.length===0&&(r.lastIndex=re(e,g,s))}}finally{r.lastIndex=0}return a?c+x(e,i):e}function v(e){let r=p(K,e,[]);return y(r,Zt,"")}function S(e,r){return p(jt,e,[r])}function re(e,r,t){let n=r+1;if(!t||n>=e.length)return n;let s=S(e,r);if(s<55296||s>56319)return n;let i=S(e,n);return i>=56320&&i<=57343?r+2:n}function x(e,r,t){return t===void 0?p(H,e,[r]):p(H,e,[r,t])}function ne(e){let r=[],t=0;for(let n=0;n<=e.length;n++){let s=n===e.length?-1:S(e,n);s>=97&&s<=122||s>=48&&s<=57||(n>t&&(r[r.length]=x(e,t,n)),t=n+1)}return r}var N=["password","passwd","pwd","passphrase","secret","clientsecret","token","apikey","accesskey","privatekey","credential","authheader","authorization","cookie","bearer","jwt","connectionstring","signature","sessionid","sid","otp","mfa","pin","salt","xsrf","csrf"],oe=512,se=128,A=new B;var ie=256;function ae(e){let r=e.length<=se;if(r){let s=p(Pt,A,[e]);if(s!==void 0)return s}let t=v(e),n=t==="auth";for(let s=0;!n&&s<N.length;s++)n=p(zt,t,[N[s]]);if(r){if(p(qt,A,[])>=oe){let i=p(Mt,A,[]),a=p(Kt,i,[]).value;a!==void 0&&p(vt,A,[a])}p(kt,A,[e,n])}return n}var j=["access_token","accesstoken","refresh_token","api_key","apikey","code","token","secret","client_secret","password","passwd","pwd","state","sig","signature","auth","x-amz-credential","x-amz-signature","x-amz-security-token","x-goog-credential","x-goog-signature"],q=new Vt;for(let e=0;e<j.length;e++)p(Bt,q,[v(j[e])]);var ce=/(\\b[a-z][a-z0-9+.-]*:\\/\\/|\\/\\/)([^/?#\\s]+)@/gi,ue=/(\\b[a-z][a-z0-9+.-]*:\\/\\/|\\/\\/)([a-z0-9._~!$&\'()*+,;=%-]+):([^/?#@\\r\\n \\t]+[ \\t][^/?#@\\r\\n]*)@/gi,le=3;function ge(e){return e===" "||e==="\t"||e===","||e===";"||e==="&"||e==="?"||e==="#"}function de(e){if(!e)return!1;let r=S(e,0);return r>=65&&r<=90||r>=97&&r<=122}function X(e){return de(e)||e==="_"||e==="$"}function pe(e){if(!e)return!1;let r=S(e,0);return X(e)||r>=48&&r<=57||e==="."||e==="-"}function J(e,r){let t=r,n=e[t]===\'"\'||e[t]==="\'"?e[t++]:"";if(!X(e[t]))return!1;for(t++;pe(e[t]);)t++;if(n){if(e[t]!==n)return!1;t++}for(;e[t]===" "||e[t]==="\t";)t++;return e[t]===":"||e[t]==="="}function Z(e){return e==="\\r"||e===`\n`||e==="}"||e==="]"||ge(e)}function Q(e,r){let t=r;for(;t<e.length&&Z(e[t]);)t++;return t}function z(e,r){let t=Q(e,r);return t>=e.length||J(e,t)}function fe(e,r){let t=r,n=!0;if(p(W,e,[E,r])){let g=r+E.length;if(z(e,g))return{end:g,replacement:E};t=g,n=!1}let s=n&&(e[t]===\'"\'||e[t]==="\'"||e[t]==="`")?e[t]:"",i=!1,a=()=>s?`${s}${E}${i?s:""}`:E,c=[],l="",u=-1;for(let g=t;g<e.length;){let f=e[g];if(l){if(f==="\\\\"){g+=2;continue}if(f===l){if(u===t&&c.length===0)return i=!0,{end:g+1,replacement:a()};l="",u=-1}g++;continue}if(f===\'"\'||f==="\'"||f==="`"){l=f,u=g,g++;continue}if(f==="{"||f==="["){p(wt,c,[f==="{"?"}":"]"]),g++;continue}if(c.length>0&&(f==="}"||f==="]")){if(c[c.length-1]!==f)return{end:e.length,replacement:a()};if(p(Lt,c,[]),g++,c.length===0&&z(e,g))return{end:g,replacement:a()};continue}if(c.length>0||!Z(f)){g++;continue}let T=g;if(g=Q(e,g),g>=e.length||J(e,g))return{end:T,replacement:a()}}return{end:e.length,replacement:a()}}function Y(e,r,t,n){let s=0,i="";for(let a=p(w,r,[e]);a;a=p(w,r,[e])){let c=a[t];if(!Ee(c))continue;let l=r.lastIndex,u=n===void 0?void 0:a[n],g=l+E.length;if((u==="?"||u==="&"||u===";")&&p(W,e,[E,l])&&e[g]==="#")continue;let f=fe(e,l);i+=x(e,s,a.index),i+=a[0],i+=f.replacement,s=f.end,r.lastIndex=f.end}return s===0?e:i+x(e,s)}function Ee(e){if(e.length>ie)return!0;let r=y(e,te,i=>`${i[1]} ${i[2]}`),t=y(r,Qt,i=>`${i[1]} ${i[2]}`),n=p(K,t,[]),s=ne(n);for(let i=0;i<s.length;i++){if(s[i].length===0)continue;let a="";for(let c=i;c<s.length;c++){let l=s[c];if(l.length!==0){a+=l;for(let u=0;u<N.length;u++)if(a===N[u])return!0}}}return s.length===1&&s[0]==="auth"}function me(e,r,t){let n=-1;for(let a=0;a<t.length;a++){let c=S(t,a);if(c===32||c===9){n=a;break}}if(n<0)return!1;let s=`${r}:${x(t,0,n)}`,i=e==="//"?`https://${s}`:`${e}${s}`;try{let a=new _(i),c=p(Jt,a,[]),l=p(Xt,a,[]);return c.length===0&&l.length===0}catch{return!1}}function Re(e){let r=e;for(let t=0;t<le;t++){let n;try{n=Gt(r)}catch{break}if(n===r)break;r=n}return r}function P(e){if(typeof e!="string"||e.length===0)return e;let r=y(e,ce,t=>{let n=t[1],s=t[2],i=p(Yt,s,[":"]);if(i===-1)return`${n}${E}@`;let a=x(s,0,i);return`${n}${a}:${E}@`});return r=y(r,ue,t=>{let n=t[1],s=t[2],i=t[3];return me(n,s,i)?t[0]:`${n}${s}:${E}@`}),r=y(r,/([?#&;])([-a-z0-9_.%\\[\\]]+)=([^&#;\\s]*)/gi,t=>{let n=t[1],s=t[2],i=Re(s);return p(Wt,q,[v(i)])||ae(i)?`${n}${s}=${E}`:t[0]}),r=y(r,/(^|[^a-z0-9_-])((?:set-cookie|cookie)\\s*:\\s*)[^\\r\\n]*/gi,t=>`${t[1]}${t[2]}${E}`),r=y(r,/\\b(authorization\\s*[:=]\\s*)[^\\r\\n]*/gi,t=>`${t[1]}${E}`),r=y(r,/\\b(bearer|basic)(\\s+)(?:"[^"\\r\\n]*"|\'[^\'\\r\\n]*\'|[a-z0-9._~+/=-]+)/gi,t=>`${t[1]}${t[2]}${E}`),r=y(r,ee,E),r=Y(r,/(["\'])([_$a-z][a-z0-9_.$-]*)\\1(\\s*[:=]\\s*)/gi,2),r=Y(r,/(^|[^a-z0-9_.$-])([_$a-z][a-z0-9_.$-]*)(\\s*[:=]\\s*)/gi,2,1),r}var ye=2048;var go=64*1024,he=256,xe="https://veryfront.com/docs/errors/",tt="...[truncated]",M="unknown-error";function et(e,r){if(e.length<=r)return e;let t=Math.max(0,r-tt.length);return`${_e(e,t)}${tt}`}function _e(e,r){let t=e.slice(0,r),n=t.charCodeAt(t.length-1);return n>=55296&&n<=56319&&(t=t.slice(0,-1)),t}function Se(e){let r="";for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n>=55296&&n<=56319){let s=e.charCodeAt(t+1);s>=56320&&s<=57343?(r+=e.slice(t,t+2),t++):r+="\\uFFFD";continue}r+=n>=56320&&n<=57343?"\\uFFFD":e.charAt(t)}return r}function I(e){return typeof e!="string"?E:et(P(e),ye)}function Ie(e){let r=typeof e=="string"?P(e):M,t=et(r||M,he),n=Se(t);return n==="."||n===".."?M:n}function b(e){let r=encodeURIComponent(Ie(e));return`${xe}${r}`}var ot=Reflect.apply,Oe=Object.freeze,Te=Object.getOwnPropertyDescriptors,rt=Number.isFinite,st=new WeakSet,Ae=WeakSet.prototype.add,Ce=WeakSet.prototype.has,Ne=new Set(["CONFIG","BUILD","RUNTIME","ROUTE","MODULE","SERVER","BOUNDARY","DEV","DEPLOY","AGENT","GENERAL"]);function o(e){let r={...e},t={...r,create(n){let s=n?.message,i=n?.detail,a=n?.cause,c=n?.instance,l=n?.context,u=n?.status??r.status;return new k(s||i||r.title,{slug:r.slug,category:r.category,status:u,title:r.title,suggestion:r.suggestion,exitCode:r.exitCode,detail:i,cause:a,instance:c,context:l})}};return Oe(t)}var k=class extends Error{constructor(t,n){super(t);m(this,"slug");m(this,"category");m(this,"status");m(this,"title");m(this,"suggestion");m(this,"exitCode");m(this,"detail");m(this,"cause");m(this,"instance");m(this,"context");ot(Ae,st,[this]),this.name="VeryfrontError",this.slug=n.slug,this.category=n.category,this.status=n.status,this.title=n.title,this.suggestion=n.suggestion,this.exitCode=n.exitCode,this.detail=n.detail,this.cause=n.cause,this.instance=n.instance,this.context=n.context}toRFC9457(){let t=nt(this);return t?{type:b(t.slug),title:I(t.title),status:t.status,detail:t.detail===void 0?void 0:I(t.detail),instance:t.instance===void 0?void 0:I(t.instance),category:t.category,suggestion:t.suggestion===void 0?void 0:I(t.suggestion),cause:typeof t.cause=="string"?I(t.cause):void 0}:{type:b("unknown-error"),title:"Unknown/unclassified error",status:500,category:"GENERAL"}}getDocsUrl(){let t=nt(this);return b(t?.slug??"unknown-error")}};function it(e){return typeof e=="object"&&e!==null&&ot(Ce,st,[e])===!0}function nt(e){return it(e)?be(e):null}function be(e){try{if(!it(e))return null;let r=Te(e),t=Ct=>{let L=r[Ct];return L&&"value"in L?L.value:void 0},n=t("slug"),s=t("category"),i=t("status"),a=t("title"),c=t("message"),l=t("suggestion"),u=t("exitCode"),g=t("detail"),f=t("cause"),T=t("instance"),At=t("context"),U=t("stack");return typeof n!="string"||!Ne.has(s)||typeof i!="number"||!rt(i)||typeof a!="string"||typeof c!="string"||l!==void 0&&typeof l!="string"||u!==void 0&&(typeof u!="number"||!rt(u))||g!==void 0&&typeof g!="string"||T!==void 0&&typeof T!="string"||U!==void 0&&typeof U!="string"?null:{slug:n,category:s,status:i,title:a,message:c,suggestion:l,exitCode:u,detail:g,cause:f,instance:T,context:At,stack:U}}catch{return null}}var De=o({slug:"config-not-found",category:"CONFIG",status:404,title:"Configuration file not found",suggestion:"Create veryfront.config.js, veryfront.config.ts, or veryfront.config.mjs in the project root"}),Ue=o({slug:"config-invalid",category:"CONFIG",status:400,title:"Invalid configuration format",suggestion:"Check the reported configuration path and validation details"}),Le=o({slug:"config-parse-error",category:"CONFIG",status:400,title:"Failed to parse configuration",suggestion:"Ensure your configuration file contains valid JavaScript or TypeScript"}),we=o({slug:"config-validation-error",category:"CONFIG",status:422,title:"Configuration validation failed",suggestion:"Check the configuration against the schema requirements"}),ve=o({slug:"config-type-error",category:"CONFIG",status:400,title:"Configuration type mismatch",suggestion:"Ensure configuration values match expected types"}),Pe=o({slug:"import-map-invalid",category:"CONFIG",status:400,title:"Invalid import map configuration",suggestion:"Check your import map syntax and paths"}),Me=o({slug:"cors-config-invalid",category:"CONFIG",status:400,title:"Invalid CORS configuration",suggestion:"Review CORS settings in your configuration"}),ke=o({slug:"config-validation-failed",category:"CONFIG",status:400,title:"Configuration validation failed",suggestion:"Check configuration values against requirements"}),$e=o({slug:"webhook-config-invalid",category:"CONFIG",status:400,title:"Invalid webhook configuration",suggestion:"Check webhook definition fields, target settings, and eventFilter conditions"}),Ve=o({slug:"schedule-config-invalid",category:"CONFIG",status:400,title:"Invalid schedule configuration",suggestion:"Check schedule definition fields, cron expression, target settings, and positive-integer limits"}),Ge=o({slug:"trigger-config-invalid",category:"CONFIG",status:400,title:"Invalid trigger configuration",suggestion:"Check trigger ID format (lowercase, alphanumeric, dots/slashes/hyphens) and ensure all input values are JSON-serializable"}),at={"config-not-found":De,"config-invalid":Ue,"config-parse-error":Le,"config-validation-error":we,"config-type-error":ve,"import-map-invalid":Pe,"cors-config-invalid":Me,"config-validation-failed":ke,"webhook-config-invalid":$e,"schedule-config-invalid":Ve,"trigger-config-invalid":Ge};var Fe=o({slug:"build-failed",category:"BUILD",status:500,title:"Build process failed",suggestion:"Check the build output for specific errors"}),He=o({slug:"bundle-error",category:"BUILD",status:500,title:"Bundle generation failed",suggestion:"Review bundler output for details"}),je=o({slug:"typescript-error",category:"BUILD",status:500,title:"TypeScript compilation error",suggestion:"Fix TypeScript errors shown in the output"}),ze=o({slug:"mdx-compile-error",category:"BUILD",status:500,title:"MDX compilation failed",suggestion:"Check your MDX file syntax"}),Ye=o({slug:"asset-optimization-error",category:"BUILD",status:500,title:"Asset optimization failed",suggestion:"Check asset file formats and paths"}),Be=o({slug:"ssg-generation-error",category:"BUILD",status:500,title:"Static site generation failed",suggestion:"Review SSG configuration and data fetching"}),We=o({slug:"sourcemap-error",category:"BUILD",status:500,title:"Source map generation failed",suggestion:"Check source map configuration"}),Ke=o({slug:"compilation-error",category:"BUILD",status:500,title:"Compilation failed",suggestion:"Review compiler output for specific errors"}),ct={"build-failed":Fe,"bundle-error":He,"typescript-error":je,"mdx-compile-error":ze,"asset-optimization-error":Ye,"ssg-generation-error":Be,"sourcemap-error":We,"compilation-error":Ke};var qe=o({slug:"hydration-mismatch",category:"RUNTIME",status:500,title:"Client/server hydration mismatch",suggestion:"Ensure server and client render the same content"}),Xe=o({slug:"render-error",category:"RUNTIME",status:500,title:"Component render failed",suggestion:"Check component for runtime errors"}),Je=o({slug:"component-error",category:"RUNTIME",status:500,title:"Component execution error",suggestion:"Review component logic and props"}),Ze=o({slug:"layout-not-found",category:"RUNTIME",status:404,title:"Layout component not found",suggestion:"Ensure layout file exists at the expected path"}),Qe=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"}),tr=o({slug:"api-error",category:"RUNTIME",status:500,title:"API route handler error",suggestion:"Review API route handler for errors"}),er=o({slug:"middleware-error",category:"RUNTIME",status:500,title:"Middleware execution error",suggestion:"Check middleware function for errors"}),rr=o({slug:"trigger-target-not-found",category:"RUNTIME",status:404,title:"Trigger target not found",suggestion:"Ensure the referenced task or workflow ID is registered in the project"}),nr=o({slug:"trigger-execution-failed",category:"RUNTIME",status:500,title:"Trigger target execution failed",suggestion:"Check the task or workflow for errors and review the trigger input"}),or=o({slug:"trigger-not-supported",category:"RUNTIME",status:501,title:"Trigger target type not supported in local runtime",suggestion:"Use a workflow or task target for local trigger runs; agent targets require the Cloud runtime"}),ut={"hydration-mismatch":qe,"render-error":Xe,"component-error":Je,"layout-not-found":Ze,"page-not-found":Qe,"api-error":tr,"middleware-error":er,"trigger-target-not-found":rr,"trigger-execution-failed":nr,"trigger-not-supported":or};var sr=o({slug:"route-conflict",category:"ROUTE",status:409,title:"Conflicting route definitions",suggestion:"Rename or reorganize conflicting route files"}),ir=o({slug:"invalid-route-file",category:"ROUTE",status:400,title:"Invalid route file structure",suggestion:"Ensure route file exports required functions"}),ar=o({slug:"route-handler-invalid",category:"ROUTE",status:400,title:"Invalid route handler export",suggestion:"Export a valid handler function from the route file"}),cr=o({slug:"dynamic-route-error",category:"ROUTE",status:500,title:"Dynamic route parsing failed",suggestion:"Check dynamic route segment syntax"}),ur=o({slug:"route-params-error",category:"ROUTE",status:400,title:"Route parameters invalid",suggestion:"Validate route parameter values"}),lr=o({slug:"api-route-error",category:"ROUTE",status:500,title:"API route definition error",suggestion:"Review API route configuration"}),lt={"route-conflict":sr,"invalid-route-file":ir,"route-handler-invalid":ar,"dynamic-route-error":cr,"route-params-error":ur,"api-route-error":lr};var gr=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"}),dr=o({slug:"import-resolution-error",category:"MODULE",status:500,title:"Import path resolution failed",suggestion:"Verify import paths and module configuration"}),pr=o({slug:"circular-dependency",category:"MODULE",status:500,title:"Circular dependency detected",suggestion:"Refactor imports to break the circular dependency"}),fr=o({slug:"invalid-import",category:"MODULE",status:400,title:"Invalid import statement",suggestion:"Fix import syntax or path"}),Er=o({slug:"dependency-missing",category:"MODULE",status:404,title:"Required dependency not installed",suggestion:"Install the missing dependency with your package manager"}),mr=o({slug:"version-mismatch",category:"MODULE",status:409,title:"Dependency version mismatch",suggestion:"Update dependencies to compatible versions"}),Rr=o({slug:"lockfile-format-mismatch",category:"MODULE",status:409,title:"Lockfile format is not supported",suggestion:"Upgrade Veryfront or migrate the lockfile before modifying it"}),yr=o({slug:"lockfile-read-error",category:"MODULE",status:500,title:"Lockfile could not be read safely",suggestion:"Check file access or restore a valid lockfile before retrying"}),gt={"module-not-found":gr,"import-resolution-error":dr,"circular-dependency":pr,"invalid-import":fr,"dependency-missing":Er,"version-mismatch":mr,"lockfile-format-mismatch":Rr,"lockfile-read-error":yr};var hr=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"}),xr=o({slug:"server-start-error",category:"SERVER",status:500,title:"Server failed to start",suggestion:"Check server configuration and port availability"}),_r=o({slug:"cache-error",category:"SERVER",status:500,title:"Cache operation failed",suggestion:"Clear the cache and try again"}),Sr=o({slug:"file-watch-error",category:"SERVER",status:500,title:"File watcher error",suggestion:"Restart the development server"}),Ir=o({slug:"request-error",category:"SERVER",status:500,title:"HTTP request handling error",suggestion:"Check request handler and middleware"}),Or=o({slug:"service-overloaded",category:"SERVER",status:503,title:"Service overloaded",suggestion:"Reduce load or scale up resources"}),Tr=o({slug:"project-execution-unavailable",category:"SERVER",status:503,title:"Project execution unavailable",suggestion:"Route the project to a dedicated isolated runtime"}),Ar=o({slug:"semaphore-timeout",category:"SERVER",status:503,title:"Semaphore acquire timeout",suggestion:"Reduce concurrency or increase the semaphore acquire timeout"}),Cr=o({slug:"circuit-breaker-open",category:"SERVER",status:503,title:"Circuit breaker is open",suggestion:"Wait for the breaker reset timeout before retrying"}),Nr=o({slug:"cache-path-mismatch",category:"SERVER",status:500,title:"Cache path mismatch",suggestion:"Clear the cache directory and rebuild"}),br=o({slug:"network-error",category:"SERVER",status:502,title:"Network operation failed",suggestion:"Check network connectivity and retry"}),Dr=o({slug:"api-client-error",category:"SERVER",status:500,title:"API client request failed",suggestion:"Check API connectivity and authentication"}),Ur=o({slug:"token-storage-error",category:"SERVER",status:500,title:"Token storage operation failed",suggestion:"Check token storage backend and credentials"}),Lr=o({slug:"cache-invariant-violation",category:"SERVER",status:500,title:"Cache path invariant violated",suggestion:"Clear the cache and rebuild"}),wr=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"}),vr=o({slug:"fallback-exhausted",category:"SERVER",status:500,title:"Primary and fallback operations both failed",suggestion:"Check service availability and connectivity"}),Pr=o({slug:"rag-store-corrupt",category:"SERVER",status:500,title:"RAG store file is corrupt",suggestion:"Repair or move the store file aside, then retry; it was not overwritten"}),Mr=o({slug:"rag-store-unavailable",category:"SERVER",status:500,title:"RAG store file is unavailable",suggestion:"Check storage availability, permissions, and concurrent operations, then retry"}),dt={"port-in-use":hr,"server-start-error":xr,"cache-error":_r,"file-watch-error":Sr,"request-error":Ir,"service-overloaded":Or,"project-execution-unavailable":Tr,"semaphore-timeout":Ar,"circuit-breaker-open":Cr,"cache-path-mismatch":Nr,"network-error":br,"api-client-error":Dr,"token-storage-error":Ur,"cache-invariant-violation":Lr,"release-not-found":wr,"fallback-exhausted":vr,"rag-store-corrupt":Pr,"rag-store-unavailable":Mr};var kr=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"}),$r=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"}),Vr=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"}),Gr=o({slug:"invalid-use-client",category:"BOUNDARY",status:400,title:"Invalid \'use client\' directive",suggestion:"Place \'use client\' at the top of the file"}),Fr=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"}),Hr=o({slug:"rsc-payload-error",category:"BOUNDARY",status:500,title:"RSC payload serialization error",suggestion:"Ensure props are serializable (no functions, symbols, etc.)"}),jr=o({slug:"ssr-output-limit-exceeded",category:"BOUNDARY",status:500,title:"SSR output limit exceeded",suggestion:"Reduce the rendered HTML size or split the response into smaller pages"}),pt={"client-boundary-violation":kr,"server-only-in-client":$r,"client-only-in-server":Vr,"invalid-use-client":Gr,"invalid-use-server":Fr,"rsc-payload-error":Hr,"ssr-output-limit-exceeded":jr};var zr=o({slug:"hmr-error",category:"DEV",status:500,title:"Hot module replacement error",suggestion:"Restart the development server"}),Yr=o({slug:"dev-server-error",category:"DEV",status:500,title:"Development server error",suggestion:"Check the dev server logs and restart"}),Br=o({slug:"fast-refresh-error",category:"DEV",status:500,title:"Fast refresh failed",suggestion:"Save the file again or restart the dev server"}),Wr=o({slug:"error-overlay-error",category:"DEV",status:500,title:"Error overlay failed",suggestion:"Check browser console for details"}),Kr=o({slug:"source-map-error",category:"DEV",status:500,title:"Source map loading error",suggestion:"Rebuild or clear cache"}),ft={"hmr-error":zr,"dev-server-error":Yr,"fast-refresh-error":Br,"error-overlay-error":Wr,"source-map-error":Kr};var qr=o({slug:"deployment-error",category:"DEPLOY",status:500,title:"Deployment process failed",suggestion:"Check deployment logs for details"}),Xr=o({slug:"platform-error",category:"DEPLOY",status:500,title:"Platform-specific error",suggestion:"Check platform documentation and requirements"}),Jr=o({slug:"env-var-missing",category:"DEPLOY",status:500,title:"Required environment variable missing",suggestion:"Set the required environment variable"}),Zr=o({slug:"production-build-required",category:"DEPLOY",status:400,title:"Production build required",suggestion:"Run \'veryfront build\' before deploying"}),Qr=o({slug:"environment-not-found",category:"DEPLOY",status:404,title:"Deployment environment not found",suggestion:"Check environment names with: veryfront config"}),tn=o({slug:"release-missing-version",category:"DEPLOY",status:500,title:"Release has no version",suggestion:"Try again or check the build logs in Studio"}),en=o({slug:"release-build-timeout",category:"DEPLOY",status:408,title:"Release build timed out",suggestion:"Try again or check the build logs in Studio"}),rn=o({slug:"deployment-verification-timeout",category:"DEPLOY",status:408,title:"Deployment verification timed out",suggestion:"Try again or check the deployment status in Studio"}),nn=o({slug:"push-receipt-missing",category:"DEPLOY",status:400,title:"Push receipt not found",suggestion:"Run: veryfront push --branch main first"}),on=o({slug:"source-digest-mismatch",category:"DEPLOY",status:409,title:"Release source digest mismatch",suggestion:"Run veryfront push again to re-upload source files"}),sn=o({slug:"preview-hostname-too-long",category:"DEPLOY",status:400,title:"Preview hostname too long",suggestion:"Use a shorter project slug or branch name"}),an=o({slug:"branch-not-found",category:"DEPLOY",status:404,title:"Branch not found",suggestion:"List branches in Studio or push a new one with: veryfront push --branch <name>"}),Et={"deployment-error":qr,"platform-error":Xr,"env-var-missing":Jr,"production-build-required":Zr,"environment-not-found":Qr,"release-missing-version":tn,"release-build-timeout":en,"deployment-verification-timeout":rn,"push-receipt-missing":nn,"source-digest-mismatch":on,"preview-hostname-too-long":sn,"branch-not-found":an};var cn=o({slug:"agent-error",category:"AGENT",status:500,title:"Agent operation error",suggestion:"Check agent configuration and logs"}),un=o({slug:"agent-not-found",category:"AGENT",status:404,title:"Agent not found",suggestion:"Verify the agent ID exists"}),ln=o({slug:"agent-timeout",category:"AGENT",status:408,title:"Agent operation timed out",suggestion:"Increase timeout or simplify the request"}),gn=o({slug:"agent-intent-error",category:"AGENT",status:400,title:"Agent intent parsing error",suggestion:"Rephrase the request more clearly"}),dn=o({slug:"orchestration-error",category:"AGENT",status:500,title:"Multi-agent orchestration error",suggestion:"Check agent coordination logic"}),pn=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"}),fn=o({slug:"tool-id-conflict",category:"AGENT",status:409,title:"Tool ID conflict",suggestion:"Use a unique tool ID or rename one of the conflicting tools"}),En=o({slug:"durable-run-event-persistence-failed",category:"AGENT",status:500,title:"Durable run event persistence failed",suggestion:"Correct invalid or oversized event data, or retry after durable event storage recovers"}),mt={"agent-error":cn,"agent-not-found":un,"agent-timeout":ln,"agent-intent-error":gn,"orchestration-error":dn,"cost-limit-exceeded":pn,"tool-id-conflict":fn,"durable-run-event-persistence-failed":En};var mn=o({slug:"unknown-error",category:"GENERAL",status:500,title:"Unknown/unclassified error",suggestion:"Check logs for more details"}),Rn=o({slug:"authentication-required",category:"GENERAL",status:401,title:"Authentication required",suggestion:"Set VERYFRONT_API_TOKEN or run \'veryfront login\'"}),yn=o({slug:"permission-denied",category:"GENERAL",status:403,title:"File/resource permission denied",suggestion:"Check file permissions and access rights"}),hn=o({slug:"file-not-found",category:"GENERAL",status:404,title:"File not found",suggestion:"Verify the file path exists"}),xn=o({slug:"resource-not-found",category:"GENERAL",status:404,title:"Requested resource not found",suggestion:"Verify the referenced resource ID or name exists"}),_n=o({slug:"invalid-argument",category:"GENERAL",status:400,title:"Invalid function argument",suggestion:"Check argument types and values",exitCode:2}),Sn=o({slug:"timeout-error",category:"GENERAL",status:408,title:"Operation timed out",suggestion:"Increase timeout or optimize the operation"}),In=o({slug:"initialization-error",category:"GENERAL",status:500,title:"Initialization failed",suggestion:"Check initialization requirements and dependencies"}),On=o({slug:"not-supported",category:"GENERAL",status:501,title:"Feature not supported",suggestion:"Check documentation for supported features"}),$=o({slug:"security-violation",category:"GENERAL",status:403,title:"Security violation detected",suggestion:"Check for path traversal or unauthorized access attempts"}),Tn=o({slug:"input-validation-failed",category:"GENERAL",status:400,title:"Input validation failed",suggestion:"Check request input against validation rules"}),An=o({slug:"project-source-empty",category:"GENERAL",status:400,title:"Project source is empty",suggestion:"Add project files or run \'veryfront init\'"}),Cn=o({slug:"nested-cwd-scope",category:"GENERAL",status:500,title:"Working directory scope nested inside another",suggestion:"Do the inner work directly in the outer scope\'s callback instead of opening a second one"}),Rt={"unknown-error":mn,"authentication-required":Rn,"permission-denied":yn,"file-not-found":hn,"resource-not-found":xn,"invalid-argument":_n,"timeout-error":Sn,"initialization-error":In,"not-supported":On,"security-violation":$,"input-validation-failed":Tn,"project-source-empty":An,"nested-cwd-scope":Cn};var ts=F(at,ct,ut,lt,gt,dt,pt,ft,Et,mt,Rt);var Nn=[{source:String.raw`<script[^>]*>[\\s\\S]*?<\\/script>`,flags:"gi",name:"inline script"},{source:String.raw`javascript:`,flags:"gi",name:"javascript: URL"},{source:String.raw`\\bon\\w+\\s*=`,flags:"gi",name:"event handler attribute"},{source:String.raw`data:\\s*text\\/html`,flags:"gi",name:"data: HTML URL"}];function bn(){return Nn.map(({source:e,flags:r,name:t})=>({pattern:new RegExp(e,r),name:t}))}function Dn(){let e=globalThis;return e.__VERYFRONT_DEV__===!0||e.Deno?.env?.get?.("VERYFRONT_ENV")==="development"}function yt(e,r={}){let{allowInlineScripts:t=!1,strict:n=!1,warn:s=!0}=r;for(let{pattern:i,name:a}of bn())if(!(t&&a==="inline script")&&(i.lastIndex=0,!!i.test(e)&&(s&&console.warn(`[Security] Suspicious ${a} detected in server HTML`),n||!Dn())))throw $.create({detail:`Potentially unsafe HTML: ${a} detected`});return e}var O=class{constructor(r,t){m(this,"prefix",r);m(this,"level",t)}log(r,t,n,...s){this.level>r||t?.(n,...s)}debug(r,...t){this.log(0,console.debug,`[${this.prefix}] DEBUG: ${r}`,...t)}info(r,...t){this.log(1,console.log,`[${this.prefix}] ${r}`,...t)}warn(r,...t){this.log(2,console.warn,`[${this.prefix}] WARN: ${r}`,...t)}error(r,...t){this.log(3,console.error,`[${this.prefix}] ERROR: ${r}`,...t)}};function Un(){if(typeof window>"u")return 2;let e=globalThis;return e.__VERYFRONT_DEV__||e.__RSC_DEV__?e.__VERYFRONT_DEBUG__||e.__RSC_DEBUG__?0:1:2}var D=Un(),R=new O("RSC",D),Es=new O("PREFETCH",D),ms=new O("HYDRATE",D),Rs=new O("VERYFRONT",D);var xs=Object.freeze({IPV4:"127.0.0.1",IPV6:"::1",HOSTNAME:"localhost"});var Ln=5e3,wn=1e4,Is=16*1024*1024,vn=5e3;var Pn=100;var Mn=Object.freeze([5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4]),Os=Object.freeze([1,5,10,25,50,100,250,500,1e3,2500,5e3,1e4]),Ts=Object.freeze({server:Object.freeze({port:3e3,hostname:"0.0.0.0"}),timeouts:Object.freeze({default:Ln,api:3e4,ssr:wn,hmr:3e4,sandbox:vn}),cache:Object.freeze({jit:Object.freeze({maxSize:Pn,tempDirPrefix:"vf-bundle-"})}),metrics:Object.freeze({ssrBoundaries:Mn})});var d="/_veryfront",V={RSC:`${d}/rsc/`,FS:`${d}/fs/`,MODULES:`${d}/modules/`,PAGES:`${d}/pages/`,DATA:`${d}/data/`,LIB:`${d}/lib/`,CHUNKS:`${d}/chunks/`,CLIENT:`${d}/client/`},xt={HMR_RUNTIME:`${d}/hmr-runtime.js`,HMR:`${d}/hmr.js`,ERROR_OVERLAY:`${d}/error-overlay.js`,DEV_LOADER:`${d}/dev-loader.js`,CLIENT_LOG:`${d}/log`,CLIENT_JS:`${d}/client.js`,ROUTER_JS:`${d}/router.js`,PREFETCH_JS:`${d}/prefetch.js`,MANIFEST_JSON:`${d}/manifest.json`,APP_JS:`${d}/app.js`,RSC_CLIENT:`${d}/rsc/client.js`,RSC_MANIFEST:`${d}/rsc/manifest`,RSC_STREAM:`${d}/rsc/stream`,RSC_PAYLOAD:`${d}/rsc/payload`,RSC_RENDER:`${d}/rsc/render`,RSC_PAGE:`${d}/rsc/page`,RSC_MODULE:`${d}/rsc/module`,RSC_DOM:`${d}/rsc/dom.js`,LIB_CHAT_REACT:`${d}/lib/chat/react.js`,LIB_CHAT_COMPONENTS:`${d}/lib/chat/components.js`,LIB_CHAT_PRIMITIVES:`${d}/lib/chat/primitives.js`};var kn={ROOT:".veryfront",CACHE:".veryfront/cache",KV:".veryfront/kv",LOGS:".veryfront/logs",TMP:".veryfront/tmp"},Cs=kn.CACHE;var Ns={HMR_RUNTIME:xt.HMR_RUNTIME,ERROR_OVERLAY:xt.ERROR_OVERLAY};var $n=V.RSC,Vn=V.FS;var _t="rsc-root",G="x-veryfront-dependency-pins";var ws=Array.prototype.at,vs=Array.prototype.filter,Ps=Array.prototype.join,Ms=Array.prototype.map,ks=Array.prototype.pop,$s=Array.prototype.push,Vs=Array.prototype.sort;var ti=Object.freeze({react:"","react-dom":"","react-dom/client":"","react-dom/server":"","react/jsx-runtime":"","react/jsx-dev-runtime":""});var Fn="veryfront-hydration-data";function St(e){try{let r=[...e.querySelectorAll(`[id="${Fn}"]`)];if(r.length!==1)return null;let t=e.body;if(!t)return null;let n=r[0];return t.firstElementChild!==n&&n.parentElement!==t||n.tagName?.toLowerCase()!=="script"||n.getAttribute("type")?.trim().toLowerCase()!=="application/json"?null:n}catch{return null}}function It(e,r){if(!r?.startsWith("on:"))return!1;try{let t=St(e);if(!t)return!1;let n=JSON.parse(t.textContent||"{}");return n.dependencyPinningCacheKey=r,t.textContent=JSON.stringify(n),!0}catch(t){return R.debug("hydration dependency snapshot seed failed",t),!1}}function Tt(e,r){let t=r==="root"?_t:`rsc-slot-${r}`,n=e.getElementById(t);if(n)return n;let s=e.createElement("div");return s.id=t,e.body.appendChild(s),s}function Hn(e,r){if(r.type!=="slot")return;let t=Tt(e,r.id);t.innerHTML=yt(String(r.html??""))}function Ot(e,r){let t=r.split(`\n`),n=t.pop()??"";for(let s of t){let i=s.trim();if(!i)continue;let a;try{a=JSON.parse(i)}catch(l){R.debug("[client-dom] malformed NDJSON line",{line:i,error:l instanceof Error?l.message:String(l)});continue}if(!a||typeof a!="object")continue;let c=a;if(c.type==="slot"){Hn(e,c);try{Yn(e,c.id||"root")}catch(l){R.debug("[client-dom] hydration optional failed",l)}}}return n}function jn(e){return new Promise((r,t)=>{let n=()=>t(new DOMException("aborted","AbortError"));if(e.aborted){n();return}e.addEventListener("abort",n,{once:!0})})}async function xi(e,r=document,t){let n="body"in e?e:null,s=n?.body??e;if(!s)return;n&&It(r,n.headers.get(G));let i=s.getReader(),a=new TextDecoder,c="",l=!1;try{for(;;){if(t?.aborted)throw new DOMException("aborted","AbortError");let u=i.read(),{done:g,value:f}=t?await Promise.race([u,jn(t)]):await u;if(g){l=!0;break}c+=a.decode(f,{stream:!0}),c=Ot(r,c)}c&&Ot(r,`${c}\n`)}catch(u){throw u instanceof Error&&u.name==="AbortError"||R.debug("[client-dom] consumeNdjsonStream error",u),u}finally{try{await i.cancel()}catch(u){l||R.debug("[client-dom] reader.cancel failed",u)}try{i.releaseLock()}catch(u){R.debug("[client-dom] reader.releaseLock failed",u)}if(typeof s.cancel=="function")try{await s.cancel()}catch(u){R.debug("[client-dom] stream.cancel failed",u)}if(typeof n?.body?.cancel=="function")try{await n.body.cancel()}catch(u){R.debug("[client-dom] response.body.cancel failed",u)}}}function zn(e,r){let t=Tt(e,r),n=[],s=i=>{let a=i;a.dataset?.clientRef&&n.push(a);for(let c of i.children)s(c)};return s(t),n}function Yn(e,r){let t=zn(e,r);for(let n of t){let s=n.dataset?.clientRef;s&&(n.dataset.hydrated="true",R.debug("[client-dom] marked for hydration",s))}}export{xi as consumeNdjsonStream,Tt as getContainer};\n';
|
|
8
|
+
export const CLIENT_BOOT_BUNDLE = 'var at=Object.defineProperty;var ct=(e,t,n)=>t in e?at(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var m=(e,t,n)=>ct(e,typeof t!="symbol"?t+"":t,n);var Ar=Array.prototype.at,Tr=Array.prototype.filter,lt=Array.prototype.join,br=Array.prototype.map,Cr=Array.prototype.pop,dt=Array.prototype.push,wr=Array.prototype.sort,Ae=Reflect.apply;function z(e,t){return Ae(lt,e,[t])}function O(e,t){Ae(dt,e,[t])}var ut="3.2.3",ft=Object.entries;function gt(e){let t=[];if(e?.external?.length&&O(t,`external=${z(e.external,",")}`),O(t,`target=${e?.target??"es2022"}`),e?.deps){let n=[],r=ft(e.deps);for(let o=0;o<r.length;o++){let[i,s]=r[o];O(n,`${i}@${s}`)}O(t,`deps=${z(n,",")}`)}return t}function pt(e,t,n,r){let o=gt(r),i=t?`@${t}`:"",s=n??"",a=o.length?`?${z(o,"&")}`:"";return`https://esm.sh/${e}${i}${s}${a}`}function S(e,t,n,r=!1){return pt(e,t,n,{external:r?["react"]:void 0,deps:{csstype:ut}})}var mt="19.2.4",I=mt;function Te(e=I){return{react:S("react",e),"react-dom":S("react-dom",e,void 0,!0),"react-dom/client":S("react-dom",e,"/client",!0),"react-dom/server":S("react-dom",e,"/server",!0),"react/jsx-runtime":S("react",e,"/jsx-runtime",!0),"react/jsx-dev-runtime":S("react",e,"/jsx-dev-runtime",!0)}}function be(e=I){return Te(e).react}function Ce(e=I){return Te(e)["react-dom/client"]}function ht(e){return e.replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}function Et(e){if(typeof globalThis.btoa=="function")try{return globalThis.btoa(e)}catch{return Rt(new TextEncoder().encode(e))}let t=globalThis.Buffer;if(t)return t.from(e,"utf8").toString("base64");throw new Error("Base64 encoding is not supported in this runtime")}function Rt(e){let t=globalThis.Buffer;if(t)return t.from(e).toString("base64");if(typeof globalThis.btoa=="function"){let r=[];for(let o=0;o<e.length;o+=24576){let i=Math.min(o+24576,e.length),s=String.fromCharCode(...e.subarray(o,i));r.push(globalThis.btoa(s))}return r.join("")}throw new Error("Base64 encoding is not supported in this runtime")}function ae(e){return ht(Et(e))}var vr=Object.freeze({react:"","react-dom":"","react-dom/client":"","react-dom/server":"","react/jsx-runtime":"","react/jsx-dev-runtime":""});function B(e,t){if(!t)return!1;if(Object.prototype.hasOwnProperty.call(t,e))return!0;for(let n of Object.keys(t))if(n.endsWith("/")&&e.startsWith(n))return!0;return!1}function _t(e){try{return JSON.parse(e)?.imports??{}}catch(t){return console.warn("Failed to parse import map JSON; treating as empty",{errorName:t instanceof Error?t.name:typeof t,inputLength:e.length}),{}}}function ce(e=document){let t=e.querySelector(\'script[type="importmap"]\');return t?.textContent?_t(t.textContent):{}}var Vr=Object.freeze({IPV4:"127.0.0.1",IPV6:"::1",HOSTNAME:"localhost"});var xt=5e3,St=1e4,jr=16*1024*1024,At=5e3;var Tt=100;var bt=Object.freeze([5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4]),Gr=Object.freeze([1,5,10,25,50,100,250,500,1e3,2500,5e3,1e4]),Wr=Object.freeze({server:Object.freeze({port:3e3,hostname:"0.0.0.0"}),timeouts:Object.freeze({default:xt,api:3e4,ssr:St,hmr:3e4,sandbox:At}),cache:Object.freeze({jit:Object.freeze({maxSize:Tt,tempDirPrefix:"vf-bundle-"})}),metrics:Object.freeze({ssrBoundaries:bt})});var g="/_veryfront",le={RSC:`${g}/rsc/`,FS:`${g}/fs/`,MODULES:`${g}/modules/`,PAGES:`${g}/pages/`,DATA:`${g}/data/`,LIB:`${g}/lib/`,CHUNKS:`${g}/chunks/`,CLIENT:`${g}/client/`},De={HMR_RUNTIME:`${g}/hmr-runtime.js`,HMR:`${g}/hmr.js`,ERROR_OVERLAY:`${g}/error-overlay.js`,DEV_LOADER:`${g}/dev-loader.js`,CLIENT_LOG:`${g}/log`,CLIENT_JS:`${g}/client.js`,ROUTER_JS:`${g}/router.js`,PREFETCH_JS:`${g}/prefetch.js`,MANIFEST_JSON:`${g}/manifest.json`,APP_JS:`${g}/app.js`,RSC_CLIENT:`${g}/rsc/client.js`,RSC_MANIFEST:`${g}/rsc/manifest`,RSC_STREAM:`${g}/rsc/stream`,RSC_PAYLOAD:`${g}/rsc/payload`,RSC_RENDER:`${g}/rsc/render`,RSC_PAGE:`${g}/rsc/page`,RSC_MODULE:`${g}/rsc/module`,RSC_DOM:`${g}/rsc/dom.js`,LIB_CHAT_REACT:`${g}/lib/chat/react.js`,LIB_CHAT_COMPONENTS:`${g}/lib/chat/components.js`,LIB_CHAT_PRIMITIVES:`${g}/lib/chat/primitives.js`};var Ct={ROOT:".veryfront",CACHE:".veryfront/cache",KV:".veryfront/kv",LOGS:".veryfront/logs",TMP:".veryfront/tmp"},Yr=Ct.CACHE;var Xr={HMR_RUNTIME:De.HMR_RUNTIME,ERROR_OVERLAY:De.ERROR_OVERLAY};var P=le.RSC,Ne=le.FS;var H="rsc-root",j="x-veryfront-dependency-pins";var b=class{constructor(t,n){m(this,"prefix",t);m(this,"level",n)}log(t,n,r,...o){this.level>t||n?.(r,...o)}debug(t,...n){this.log(0,console.debug,`[${this.prefix}] DEBUG: ${t}`,...n)}info(t,...n){this.log(1,console.log,`[${this.prefix}] ${t}`,...n)}warn(t,...n){this.log(2,console.warn,`[${this.prefix}] WARN: ${t}`,...n)}error(t,...n){this.log(3,console.error,`[${this.prefix}] ERROR: ${t}`,...n)}};function wt(){if(typeof window>"u")return 2;let e=globalThis;return e.__VERYFRONT_DEV__||e.__RSC_DEV__?e.__VERYFRONT_DEBUG__||e.__RSC_DEBUG__?0:1:2}var G=wt(),u=new b("RSC",G),eo=new b("PREFETCH",G),to=new b("HYDRATE",G),no=new b("VERYFRONT",G);var Dt="veryfront-hydration-data";function de(e){try{let t=[...e.querySelectorAll(`[id="${Dt}"]`)];if(t.length!==1)return null;let n=e.body;if(!n)return null;let r=t[0];return n.firstElementChild!==r&&r.parentElement!==n||r.tagName?.toLowerCase()!=="script"||r.getAttribute("type")?.trim().toLowerCase()!=="application/json"?null:r}catch{return null}}function C(e=document){try{let t=de(e);return t?JSON.parse(t.textContent||"{}"):null}catch(t){return u.debug("hydration data parse failed",t),null}}function W(e,t){if(!t?.startsWith("on:"))return!1;try{let n=de(e);if(!n)return!1;let r=JSON.parse(n.textContent||"{}");return r.dependencyPinningCacheKey=t,n.textContent=JSON.stringify(r),!0}catch(n){return u.debug("hydration dependency snapshot seed failed",n),!1}}function K(e){return e?.clientModuleStrategy?e.clientModuleStrategy:e?.dev?"fs":"rsc-module"}function Nt(e,t){if(!t)return e;let n=e.includes("?")?"&":"?";return`${e}${n}v=${encodeURIComponent(t)}`}function Y(e,t){if(!t?.startsWith("on:"))return e;let n=e.indexOf("#"),r=n===-1?"":e.slice(n),o=n===-1?e:e.slice(0,n),i=o.indexOf("?"),s=i===-1?o:o.slice(0,i),a=new URLSearchParams(i===-1?"":o.slice(i+1));a.set("pins",t);let l=a.toString();return`${s}${l?`?${l}`:""}${r}`}function Mt(e,t){return Nt(`${Ne}${ae(e)}.js`,t)}function Ot(e,t,n){let r=t?`&v=${encodeURIComponent(t)}`:"";return Y(`${P}module?rel=${encodeURIComponent(e)}${r}`,n)}function L(e){let t=e?.dependencyPinningCacheKey;return t?.startsWith("on:")?{[j]:t}:{}}function It(e){return e.replace(/^\\/+_vf_modules\\//,"").replace(/^\\/+/,"").replace(/\\.js$/,"")}var Pt=/\\.(tsx|ts|jsx|mdx|js)$/;function Ht(e){let t=It(e),n=[e,t];return Pt.test(t)||n.push(`${t}.tsx`,`${t}.ts`,`${t}.jsx`,`${t}.mdx`,`${t}.js`),Array.from(new Set(n))}function Lt(e,t){if(!e)return null;for(let n of Ht(t)){let r=e[n];if(r)return r}return null}function X(e){if(e.strategy==="fs"){let n=e.absPath??e.rel;return n?Y(Mt(n,e.version),e.dependencyPinningCacheKey):null}let t=Lt(e.releaseAssetModules,e.rel);return t||Ot(e.rel,e.version,e.dependencyPinningCacheKey)}function J(e=document,t=I){let n=ce(e);return{react:B("react",n)?"react":be(t),reactDomClient:B("react-dom/client",n)?"react-dom/client":Ce(t)}}function Me(e=document){let t=ce(e);return B("veryfront/router",t)?"veryfront/router":null}var q={reset:"\\x1B[0m",dim:"\\x1B[2m",gray:"\\x1B[90m",red:"\\x1B[31m",green:"\\x1B[32m",yellow:"\\x1B[33m",blue:"\\x1B[34m",magenta:"\\x1B[35m",cyan:"\\x1B[36m"},po={debug:q.gray,info:q.green,warn:q.yellow,error:q.red};var y="[REDACTED]",p=Reflect.apply,Ut=Array.prototype.pop,$t=Array.prototype.push;var mo=Array.prototype,ho=BigInt.prototype.toString,Le=Map,kt=Map.prototype.delete,vt=Map.prototype.get,Ft=Map.prototype.keys,Vt=Map.prototype.set;var _=Object.getOwnPropertyDescriptor,zt=Object.getPrototypeOf,Eo=Object.hasOwn,Ro=Object.prototype,Bt=Set,jt=decodeURIComponent,T=URL,_o=Number.isFinite,xo=Number.isInteger,ue=RegExp.prototype.exec,Gt=_(RegExp.prototype,"global").get,Wt=_(RegExp.prototype,"unicode").get,Kt=String.prototype.charCodeAt,Yt=String.prototype.includes,Xt=String.prototype.indexOf,Oe=String.prototype.slice,Ue=String.prototype.startsWith,$e=String.prototype.toLowerCase,Jt=Set.prototype.add,So=Set.prototype.delete,qt=Set.prototype.has,Zt=zt(new Le().keys()).next,Qt=_(Map.prototype,"size").get,Ao=_(T.prototype,"host").get,To=_(T.prototype,"origin").get,en=_(T.prototype,"password").get,bo=_(T.prototype,"pathname").get,Co=_(T.prototype,"protocol").get,tn=_(T.prototype,"username").get,nn=/[^a-z0-9]/g,rn=/([a-z0-9])([A-Z])/g,on=/([A-Z])([A-Z][a-z])/g,sn=/\\b(?:sk-[A-Za-z0-9._-]{8,}|gh[po]_[A-Za-z0-9._-]{8,}|xox[baprs]-[A-Za-z0-9._-]{8,}|eyJ[A-Za-z0-9._-]{8,})\\b/g;function R(e,t,n){let r=p(Gt,t,[]),o=p(Wt,t,[]),i=0,s=!1,a="";t.lastIndex=0;try{for(;;){let l=p(ue,t,[e]);if(l===null)break;let c=l[0],d=l.index;if(a+=A(e,i,d),a+=typeof n=="string"?n:n(l),i=d+c.length,s=!0,!r)break;c.length===0&&(t.lastIndex=an(e,d,o))}}finally{t.lastIndex=0}return s?a+A(e,i):e}function fe(e){let t=p($e,e,[]);return R(t,nn,"")}function w(e,t){return p(Kt,e,[t])}function an(e,t,n){let r=t+1;if(!n||r>=e.length)return r;let o=w(e,t);if(o<55296||o>56319)return r;let i=w(e,r);return i>=56320&&i<=57343?t+2:r}function A(e,t,n){return n===void 0?p(Oe,e,[t]):p(Oe,e,[t,n])}function cn(e){let t=[],n=0;for(let r=0;r<=e.length;r++){let o=r===e.length?-1:w(e,r);o>=97&&o<=122||o>=48&&o<=57||(r>n&&(t[t.length]=A(e,n,r)),n=r+1)}return t}var Z=["password","passwd","pwd","passphrase","secret","clientsecret","token","apikey","accesskey","privatekey","credential","authheader","authorization","cookie","bearer","jwt","connectionstring","signature","sessionid","sid","otp","mfa","pin","salt","xsrf","csrf"],ln=512,dn=128,U=new Le;var un=256;function fn(e){let t=e.length<=dn;if(t){let o=p(vt,U,[e]);if(o!==void 0)return o}let n=fe(e),r=n==="auth";for(let o=0;!r&&o<Z.length;o++)r=p(Yt,n,[Z[o]]);if(t){if(p(Qt,U,[])>=ln){let i=p(Ft,U,[]),s=p(Zt,i,[]).value;s!==void 0&&p(kt,U,[s])}p(Vt,U,[e,r])}return r}var Ie=["access_token","accesstoken","refresh_token","api_key","apikey","code","token","secret","client_secret","password","passwd","pwd","state","sig","signature","auth","x-amz-credential","x-amz-signature","x-amz-security-token","x-goog-credential","x-goog-signature"],ke=new Bt;for(let e=0;e<Ie.length;e++)p(Jt,ke,[fe(Ie[e])]);var gn=/(\\b[a-z][a-z0-9+.-]*:\\/\\/|\\/\\/)([^/?#\\s]+)@/gi,pn=/(\\b[a-z][a-z0-9+.-]*:\\/\\/|\\/\\/)([a-z0-9._~!$&\'()*+,;=%-]+):([^/?#@\\r\\n \\t]+[ \\t][^/?#@\\r\\n]*)@/gi,yn=3;function mn(e){return e===" "||e==="\t"||e===","||e===";"||e==="&"||e==="?"||e==="#"}function hn(e){if(!e)return!1;let t=w(e,0);return t>=65&&t<=90||t>=97&&t<=122}function ve(e){return hn(e)||e==="_"||e==="$"}function En(e){if(!e)return!1;let t=w(e,0);return ve(e)||t>=48&&t<=57||e==="."||e==="-"}function Fe(e,t){let n=t,r=e[n]===\'"\'||e[n]==="\'"?e[n++]:"";if(!ve(e[n]))return!1;for(n++;En(e[n]);)n++;if(r){if(e[n]!==r)return!1;n++}for(;e[n]===" "||e[n]==="\t";)n++;return e[n]===":"||e[n]==="="}function Ve(e){return e==="\\r"||e===`\n`||e==="}"||e==="]"||mn(e)}function ze(e,t){let n=t;for(;n<e.length&&Ve(e[n]);)n++;return n}function Pe(e,t){let n=ze(e,t);return n>=e.length||Fe(e,n)}function Rn(e,t){let n=t,r=!0;if(p(Ue,e,[y,t])){let d=t+y.length;if(Pe(e,d))return{end:d,replacement:y};n=d,r=!1}let o=r&&(e[n]===\'"\'||e[n]==="\'"||e[n]==="`")?e[n]:"",i=!1,s=()=>o?`${o}${y}${i?o:""}`:y,a=[],l="",c=-1;for(let d=n;d<e.length;){let f=e[d];if(l){if(f==="\\\\"){d+=2;continue}if(f===l){if(c===n&&a.length===0)return i=!0,{end:d+1,replacement:s()};l="",c=-1}d++;continue}if(f===\'"\'||f==="\'"||f==="`"){l=f,c=d,d++;continue}if(f==="{"||f==="["){p($t,a,[f==="{"?"}":"]"]),d++;continue}if(a.length>0&&(f==="}"||f==="]")){if(a[a.length-1]!==f)return{end:e.length,replacement:s()};if(p(Ut,a,[]),d++,a.length===0&&Pe(e,d))return{end:d,replacement:s()};continue}if(a.length>0||!Ve(f)){d++;continue}let E=d;if(d=ze(e,d),d>=e.length||Fe(e,d))return{end:E,replacement:s()}}return{end:e.length,replacement:s()}}function He(e,t,n,r){let o=0,i="";for(let s=p(ue,t,[e]);s;s=p(ue,t,[e])){let a=s[n];if(!_n(a))continue;let l=t.lastIndex,c=r===void 0?void 0:s[r],d=l+y.length;if((c==="?"||c==="&"||c===";")&&p(Ue,e,[y,l])&&e[d]==="#")continue;let f=Rn(e,l);i+=A(e,o,s.index),i+=s[0],i+=f.replacement,o=f.end,t.lastIndex=f.end}return o===0?e:i+A(e,o)}function _n(e){if(e.length>un)return!0;let t=R(e,on,i=>`${i[1]} ${i[2]}`),n=R(t,rn,i=>`${i[1]} ${i[2]}`),r=p($e,n,[]),o=cn(r);for(let i=0;i<o.length;i++){if(o[i].length===0)continue;let s="";for(let a=i;a<o.length;a++){let l=o[a];if(l.length!==0){s+=l;for(let c=0;c<Z.length;c++)if(s===Z[c])return!0}}}return o.length===1&&o[0]==="auth"}function xn(e,t,n){let r=-1;for(let s=0;s<n.length;s++){let a=w(n,s);if(a===32||a===9){r=s;break}}if(r<0)return!1;let o=`${t}:${A(n,0,r)}`,i=e==="//"?`https://${o}`:`${e}${o}`;try{let s=new T(i),a=p(tn,s,[]),l=p(en,s,[]);return a.length===0&&l.length===0}catch{return!1}}function Sn(e){let t=e;for(let n=0;n<yn;n++){let r;try{r=jt(t)}catch{break}if(r===t)break;t=r}return t}function ge(e){if(typeof e!="string"||e.length===0)return e;let t=R(e,gn,n=>{let r=n[1],o=n[2],i=p(Xt,o,[":"]);if(i===-1)return`${r}${y}@`;let s=A(o,0,i);return`${r}${s}:${y}@`});return t=R(t,pn,n=>{let r=n[1],o=n[2],i=n[3];return xn(r,o,i)?n[0]:`${r}${o}:${y}@`}),t=R(t,/([?#&;])([-a-z0-9_.%\\[\\]]+)=([^&#;\\s]*)/gi,n=>{let r=n[1],o=n[2],i=Sn(o);return p(qt,ke,[fe(i)])||fn(i)?`${r}${o}=${y}`:n[0]}),t=R(t,/(^|[^a-z0-9_-])((?:set-cookie|cookie)\\s*:\\s*)[^\\r\\n]*/gi,n=>`${n[1]}${n[2]}${y}`),t=R(t,/\\b(authorization\\s*[:=]\\s*)[^\\r\\n]*/gi,n=>`${n[1]}${y}`),t=R(t,/\\b(bearer|basic)(\\s+)(?:"[^"\\r\\n]*"|\'[^\'\\r\\n]*\'|[a-z0-9._~+/=-]+)/gi,n=>`${n[1]}${n[2]}${y}`),t=R(t,sn,y),t=He(t,/(["\'])([_$a-z][a-z0-9_.$-]*)\\1(\\s*[:=]\\s*)/gi,2),t=He(t,/(^|[^a-z0-9_.$-])([_$a-z][a-z0-9_.$-]*)(\\s*[:=]\\s*)/gi,2,1),t}var An=2048;var Oo=64*1024,Tn=256,bn="https://veryfront.com/docs/errors/",Be="...[truncated]",pe="unknown-error";function je(e,t){if(e.length<=t)return e;let n=Math.max(0,t-Be.length);return`${Cn(e,n)}${Be}`}function Cn(e,t){let n=e.slice(0,t),r=n.charCodeAt(n.length-1);return r>=55296&&r<=56319&&(n=n.slice(0,-1)),n}function wn(e){let t="";for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r>=55296&&r<=56319){let o=e.charCodeAt(n+1);o>=56320&&o<=57343?(t+=e.slice(n,n+2),n++):t+="\\uFFFD";continue}t+=r>=56320&&r<=57343?"\\uFFFD":e.charAt(n)}return t}function D(e){return typeof e!="string"?y:je(ge(e),An)}function Dn(e){let t=typeof e=="string"?ge(e):pe,n=je(t||pe,Tn),r=wn(n);return r==="."||r===".."?pe:r}function Q(e){let t=encodeURIComponent(Dn(e));return`${bn}${t}`}var Ke=Reflect.apply,Nn=Object.freeze,Mn=Object.getOwnPropertyDescriptors,Ge=Number.isFinite,Ye=new WeakSet,On=WeakSet.prototype.add,In=WeakSet.prototype.has,Pn=new Set(["CONFIG","BUILD","RUNTIME","ROUTE","MODULE","SERVER","BOUNDARY","DEV","DEPLOY","AGENT","GENERAL"]);function h(e){let t={...e},n={...t,create(r){let o=r?.message,i=r?.detail,s=r?.cause,a=r?.instance,l=r?.context,c=r?.status??t.status;return new ye(o||i||t.title,{slug:t.slug,category:t.category,status:c,title:t.title,suggestion:t.suggestion,exitCode:t.exitCode,detail:i,cause:s,instance:a,context:l})}};return Nn(n)}var ye=class extends Error{constructor(n,r){super(n);m(this,"slug");m(this,"category");m(this,"status");m(this,"title");m(this,"suggestion");m(this,"exitCode");m(this,"detail");m(this,"cause");m(this,"instance");m(this,"context");Ke(On,Ye,[this]),this.name="VeryfrontError",this.slug=r.slug,this.category=r.category,this.status=r.status,this.title=r.title,this.suggestion=r.suggestion,this.exitCode=r.exitCode,this.detail=r.detail,this.cause=r.cause,this.instance=r.instance,this.context=r.context}toRFC9457(){let n=We(this);return n?{type:Q(n.slug),title:D(n.title),status:n.status,detail:n.detail===void 0?void 0:D(n.detail),instance:n.instance===void 0?void 0:D(n.instance),category:n.category,suggestion:n.suggestion===void 0?void 0:D(n.suggestion),cause:typeof n.cause=="string"?D(n.cause):void 0}:{type:Q("unknown-error"),title:"Unknown/unclassified error",status:500,category:"GENERAL"}}getDocsUrl(){let n=We(this);return Q(n?.slug??"unknown-error")}};function Xe(e){return typeof e=="object"&&e!==null&&Ke(In,Ye,[e])===!0}function We(e){return Xe(e)?Hn(e):null}function Hn(e){try{if(!Xe(e))return null;let t=Mn(e),n=re=>{let M=t[re];return M&&"value"in M?M.value:void 0},r=n("slug"),o=n("category"),i=n("status"),s=n("title"),a=n("message"),l=n("suggestion"),c=n("exitCode"),d=n("detail"),f=n("cause"),E=n("instance"),v=n("context"),x=n("stack");return typeof r!="string"||!Pn.has(o)||typeof i!="number"||!Ge(i)||typeof s!="string"||typeof a!="string"||l!==void 0&&typeof l!="string"||c!==void 0&&(typeof c!="number"||!Ge(c))||d!==void 0&&typeof d!="string"||E!==void 0&&typeof E!="string"||x!==void 0&&typeof x!="string"?null:{slug:r,category:o,status:i,title:s,message:a,suggestion:l,exitCode:c,detail:d,cause:f,instance:E,context:v,stack:x}}catch{return null}}var $o=h({slug:"unknown-error",category:"GENERAL",status:500,title:"Unknown/unclassified error",suggestion:"Check logs for more details"}),ko=h({slug:"authentication-required",category:"GENERAL",status:401,title:"Authentication required",suggestion:"Set VERYFRONT_API_TOKEN or run \'veryfront login\'"}),vo=h({slug:"permission-denied",category:"GENERAL",status:403,title:"File/resource permission denied",suggestion:"Check file permissions and access rights"}),Fo=h({slug:"file-not-found",category:"GENERAL",status:404,title:"File not found",suggestion:"Verify the file path exists"}),Vo=h({slug:"resource-not-found",category:"GENERAL",status:404,title:"Requested resource not found",suggestion:"Verify the referenced resource ID or name exists"}),zo=h({slug:"invalid-argument",category:"GENERAL",status:400,title:"Invalid function argument",suggestion:"Check argument types and values",exitCode:2}),Bo=h({slug:"timeout-error",category:"GENERAL",status:408,title:"Operation timed out",suggestion:"Increase timeout or optimize the operation"}),jo=h({slug:"initialization-error",category:"GENERAL",status:500,title:"Initialization failed",suggestion:"Check initialization requirements and dependencies"}),Go=h({slug:"not-supported",category:"GENERAL",status:501,title:"Feature not supported",suggestion:"Check documentation for supported features"}),Je=h({slug:"security-violation",category:"GENERAL",status:403,title:"Security violation detected",suggestion:"Check for path traversal or unauthorized access attempts"}),Wo=h({slug:"input-validation-failed",category:"GENERAL",status:400,title:"Input validation failed",suggestion:"Check request input against validation rules"}),Ko=h({slug:"project-source-empty",category:"GENERAL",status:400,title:"Project source is empty",suggestion:"Add project files or run \'veryfront init\'"}),Yo=h({slug:"nested-cwd-scope",category:"GENERAL",status:500,title:"Working directory scope nested inside another",suggestion:"Do the inner work directly in the outer scope\'s callback instead of opening a second one"});var Ln=[{source:String.raw`<script[^>]*>[\\s\\S]*?<\\/script>`,flags:"gi",name:"inline script"},{source:String.raw`javascript:`,flags:"gi",name:"javascript: URL"},{source:String.raw`\\bon\\w+\\s*=`,flags:"gi",name:"event handler attribute"},{source:String.raw`data:\\s*text\\/html`,flags:"gi",name:"data: HTML URL"}];function Un(){return Ln.map(({source:e,flags:t,name:n})=>({pattern:new RegExp(e,t),name:n}))}function $n(){let e=globalThis;return e.__VERYFRONT_DEV__===!0||e.Deno?.env?.get?.("VERYFRONT_ENV")==="development"}function $(e,t={}){let{allowInlineScripts:n=!1,strict:r=!1,warn:o=!0}=t;for(let{pattern:i,name:s}of Un())if(!(n&&s==="inline script")&&(i.lastIndex=0,!!i.test(e)&&(o&&console.warn(`[Security] Suspicious ${s} detected in server HTML`),r||!$n())))throw Je.create({detail:`Potentially unsafe HTML: ${s} detected`});return e}function k(e,t){let n=t==="root"?H:`rsc-slot-${t}`,r=e.getElementById(n);if(r)return r;let o=e.createElement("div");return o.id=n,e.body.appendChild(o),o}function kn(e,t){if(t.type!=="slot")return;let n=k(e,t.id);n.innerHTML=$(String(t.html??""))}function qe(e,t){let n=t.split(`\n`),r=n.pop()??"";for(let o of n){let i=o.trim();if(!i)continue;let s;try{s=JSON.parse(i)}catch(l){u.debug("[client-dom] malformed NDJSON line",{line:i,error:l instanceof Error?l.message:String(l)});continue}if(!s||typeof s!="object")continue;let a=s;if(a.type==="slot"){kn(e,a);try{Vn(e,a.id||"root")}catch(l){u.debug("[client-dom] hydration optional failed",l)}}}return r}function vn(e){return new Promise((t,n)=>{let r=()=>n(new DOMException("aborted","AbortError"));if(e.aborted){r();return}e.addEventListener("abort",r,{once:!0})})}async function Ze(e,t=document,n){let r="body"in e?e:null,o=r?.body??e;if(!o)return;r&&W(t,r.headers.get(j));let i=o.getReader(),s=new TextDecoder,a="",l=!1;try{for(;;){if(n?.aborted)throw new DOMException("aborted","AbortError");let c=i.read(),{done:d,value:f}=n?await Promise.race([c,vn(n)]):await c;if(d){l=!0;break}a+=s.decode(f,{stream:!0}),a=qe(t,a)}a&&qe(t,`${a}\n`)}catch(c){throw c instanceof Error&&c.name==="AbortError"||u.debug("[client-dom] consumeNdjsonStream error",c),c}finally{try{await i.cancel()}catch(c){l||u.debug("[client-dom] reader.cancel failed",c)}try{i.releaseLock()}catch(c){u.debug("[client-dom] reader.releaseLock failed",c)}if(typeof o.cancel=="function")try{await o.cancel()}catch(c){u.debug("[client-dom] stream.cancel failed",c)}if(typeof r?.body?.cancel=="function")try{await r.body.cancel()}catch(c){u.debug("[client-dom] response.body.cancel failed",c)}}}function Fn(e,t){let n=k(e,t),r=[],o=i=>{let s=i;s.dataset?.clientRef&&r.push(s);for(let a of i.children)o(a)};return o(n),r}function Vn(e,t){let n=Fn(e,t);for(let r of n){let o=r.dataset?.clientRef;o&&(r.dataset.hydrated="true",u.debug("[client-dom] marked for hydration",o))}}var zn=new Set(["server","client","html","fragment"]);function Qe(e){if(!e)return[];try{let t=JSON.parse(e);return jn(t)?t.nodes:[]}catch{return[]}}async function he(e,t,n){return await Promise.all(e.map(r=>Bn(r,t,n)))}async function Bn(e,t,n){if(e.type==="html")return e.text??e.html??"";let r=await he(e.children??[],t,n);if(e.type==="fragment"||e.type==="server"&&!e.component)return t.createElement(t.Fragment,{},...r);if(e.type==="server")return t.createElement(e.component,e.props??{},...r);let o=await n(e.component);return o?t.createElement(o,e.props??{},...r):null}function jn(e){return!me(e)||e.version!==1||!Array.isArray(e.nodes)?!1:e.nodes.every(t=>et(t,0))}function et(e,t){return t>100||!me(e)||!zn.has(e.type)||e.type==="html"&&typeof e.html!="string"&&typeof e.text!="string"||e.type==="client"&&typeof e.component!="string"||e.type==="server"&&e.component!==void 0&&typeof e.component!="string"||e.props!==void 0&&!me(e.props)?!1:e.children===void 0?!0:Array.isArray(e.children)&&e.children.every(n=>et(n,t+1))}function me(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Gn(e){if(!e)return{};let t={};for(let[n,r]of Object.entries(e))t[n]=Array.isArray(r)?r.join("/"):r;return t}async function ee(e,t,n=document){try{let r=Me(n);if(!r)return e;let i=(await import(r)).wrapForHydration;return typeof i!="function"?e:i(e,{params:Gn(t?.params),frontmatter:t?.frontmatter??{},data:t?.props??{}})}catch(r){return u.debug("router provider wrap failed",r),e}}var Wn="Unknown dependency snapshot",Kn="export default null; // Unknown dependency snapshot",Ee="__VF_DEPENDENCY_SNAPSHOT_RECOVERY_STARTED__";function Yn(){return globalThis}async function Xn(e){if(e.status!==409)return!1;try{let t=(await e.clone().text()).trim();return t===Wn||t===Kn}catch{return!1}}async function N(e,t=()=>globalThis.location.reload()){if(!await Xn(e))return!1;let n=Yn();if(n[Ee])return!0;n[Ee]=!0;try{t()}catch{return delete n[Ee],!1}return!0}async function te(e,t=globalThis.fetch,n=()=>globalThis.location.reload()){try{let r=new URL(e,"http://veryfront.local").searchParams.getAll("pins");if(r.length!==1||!r[0]?.startsWith("on:"))return!1;let o=await t(e,{cache:"no-store"});return await N(o,n)}catch{return!1}}var Jn=100;function qn(e,t){if(globalThis.__VF_CLIENT_MOD_CACHE??(globalThis.__VF_CLIENT_MOD_CACHE=new Map),globalThis.__VF_CLIENT_MOD_CACHE.size>=Jn){let n=globalThis.__VF_CLIENT_MOD_CACHE.keys().next().value;n&&globalThis.__VF_CLIENT_MOD_CACHE.delete(n)}globalThis.__VF_CLIENT_MOD_CACHE.set(e,t)}function tt(e){let t=e.match(/^\\/app\\/(.+)#([\\w$.-]+)$/);if(t)return{rel:`/${t[1]||""}`,exportName:t[2]||"default"};let n=e.match(/^(\\/_veryfront\\/[^#]+)#([\\w$.-]+)$/);return n?{moduleUrl:n[1],exportName:n[2]||"default"}:(u.debug("hydrate: unrecognised client ref format, skipping",{ref:e}),null)}function Zn(e){let t=e.dataset?.rscProps;if(!t)return{};try{let n=JSON.parse(t);return n&&typeof n=="object"&&!Array.isArray(n)?n:{}}catch(n){return u.debug("hydrate: invalid client boundary props, using empty props",n),{}}}function Qn(e){return Qe(e.dataset?.rscChildren)}function er(e){return"/_veryfront/rsc/manifest"}function tr(e){return L(e)}async function nr(e=document){try{let t=C(e),n=await fetch(er(t),{headers:tr(t)});return n.ok?await n.json():(await N(n),null)}catch{return null}}async function nt(e,t,n,r={}){let o=rr(e,t,n,r.releaseAssetModules),i=t.moduleUrl??t.rel;if(!i)return null;let s=`${i}#${e.hash??""}`;try{let a=globalThis.__VF_CLIENT_MOD_CACHE?.get(s);if(a)return a}catch(a){u.debug("hydrate: cache get failed",a)}if(!o)return null;try{let a=await(r.importModule??(l=>import(l)))(o);try{qn(s,a)}catch(l){u.debug("hydrate: cache set failed",l)}return a}catch(a){return u.debug("hydrate: failed to import module",{moduleUrl:o,error:a}),await(r.recoverSnapshotFailure??te)(o),null}}function rr(e,t,n,r){if(t.moduleUrl)return Y(t.moduleUrl,e.dependencyPinningCacheKey);if(!t.rel)return null;let o=e.graphIds?.client.find(i=>i.rel===t.rel)?.path;return X({strategy:n,rel:t.rel,absPath:o,version:e.hash,dependencyPinningCacheKey:e.dependencyPinningCacheKey,releaseAssetModules:r})}function or(e){let t=Array.from(e.querySelectorAll("[data-client-ref]")),n=new Set(t);return t.filter(r=>{let o=r.parentElement;for(;o;){if(n.has(o))return!1;o=o.parentElement}return!0})}async function rt(e=document){let t=null;try{t=await nr(e)}catch(c){u.debug("hydrate: fetch manifest failed",c)}if(!t){u.debug("hydrate: no manifest");return}let n=or(e);try{let c=globalThis.__VF_MANIFEST_HASH;if(!n.some(f=>f.dataset?.hydrated!=="true")&&c&&t.hash&&c===t.hash)return}catch(c){u.debug("hydrate: hmr hash read failed",c)}if(n.length===0){try{globalThis.__VF_MANIFEST_HASH=t.hash??""}catch(c){u.debug("hydrate: set hash failed",c)}return}let r=C(e),o=K(r),i=r?.releaseAssetModules;try{if(globalThis.__VF_TEST_MODE__){globalThis.__VF_HYDRATE_CALLED=!0,globalThis.__VF_MANIFEST_HASH=t.hash??"";return}}catch(c){u.debug("hydrate: test mode flags failed",c)}let s=J(e,r?.reactVersion),[{default:a},{createRoot:l}]=await Promise.all([import(s.react),import(s.reactDomClient)]);for(let c of n){let d=c.dataset?.clientRef??"";if(!d||c.dataset?.hydrated==="true")continue;let f=tt(d);if(!f)continue;let E=await nt(t,f,o,{releaseAssetModules:i});if(!E)continue;let v=E[f.exportName]??E.default;if(typeof v=="function")try{let x=l(c),re=Zn(c),M=Qn(c),ot=await he(M,{Fragment:a.Fragment,createElement(F,oe,...V){return a.createElement(F,oe,...V)}},async F=>{let oe=t.modules.find(st=>st.id===F),V=t.components?.[F],xe=oe?.clientRef??(V?`${V}#default`:void 0);if(!xe)return null;let ie=tt(xe);if(!ie)return null;let se=await nt(t,ie,o,{releaseAssetModules:i});if(!se)return null;let Se=se[ie.exportName]??se.default;return typeof Se=="function"?Se:null}),it=await ee(a.createElement(v,re,...ot),r,e);x.render(it),c.dataset.hydrated="true"}catch(x){u.warn("hydrate: render failed",x)}}try{globalThis.__VF_MANIFEST_HASH=t.hash??""}catch(c){u.debug("hydrate: set hash failed (post)",c)}}var Re="data-vf-react-head-owner";var ir=2*1024*1024,yi=ir*2;var mi=64*1024,hi=1024*1024,Ei=1024*1024;var Ri=new TextEncoder;async function sr(){let e=C(document),t=J(document,e?.reactVersion),[n,r]=await Promise.all([import(t.react),import(t.reactDomClient)]);return{React:n,ReactDOM:r}}var ar=new Set(["SCRIPT","STYLE","NOSCRIPT","TEMPLATE"]);function _e(e){let t=e.getAttribute("style")??"";return e.hasAttribute("data-veryfront-head")||e.hasAttribute("hidden")||/(?:^|;)\\s*display\\s*:\\s*none(?:\\s*;|$)/i.test(t)||ar.has(e.tagName.toUpperCase())}function cr(e,t){return e.find(n=>n.tagName.toUpperCase()==="DIV"&&!!n.getAttribute("class")?.trim()&&!_e(n))??t}function lr(e,t){return e===t}function dr(e,t){let n=document.createElement("div");n.setAttribute("data-veryfront-hydration-root","page");let r=e.find(o=>!_e(o));r?.parentNode===t?t.insertBefore(n,r):t.appendChild(n);for(let o of e)!_e(o)&&o.parentNode===t&&n.appendChild(o);return n}function ur(e,t){for(let n of e){let r=[...n.hasAttribute(Re)?[n]:[],...n.querySelectorAll(`[${Re}]`)];for(let o of r)t.contains(o)||o.remove()}}function fr(e,t,n=document){return!!t?.pagePath&&typeof e?.__veryfrontRenderPage=="function"&&!!n.getElementById("root")}function gr(e,t){return t?.pagePath?!1:!!e.getElementById(H)}function pr(e=import.meta.url){try{return new URL(e,"http://veryfront.local").searchParams.get("hydrate")==="1"}catch{return!1}}function yr(e){return e==="rsc-module"}function mr(e,t){return e?e.startsWith("?")?e:`?${e}`:""}function hr(e,t,n){return X({strategy:t,rel:e,releaseAssetModules:n?.releaseAssetModules,dependencyPinningCacheKey:n?.dependencyPinningCacheKey})}async function Er(e,t){try{let n=await fetch(P+"stream"+e,{headers:L(t)});if(!n.ok)return await N(n)?"snapshot-conflict":"failure";if(!n.body)return"failure";let r=new AbortController;return addEventListener("pagehide",()=>r.abort(),{once:!0}),await Ze(n,document,r.signal),"success"}catch(n){return u.debug("tryStream failed",n),"failure"}}async function ne(){try{await rt(document)}catch(e){u.debug("hydration failed",e)}}async function Rr(e,t,n){try{let{React:r,ReactDOM:o}=await sr(),i=hr(e,t,n);if(!i)return!1;u.debug("Loading component from:",i);let s;try{s=await import(i)}catch(E){throw await te(i),E}let a=s.default;if(typeof a!="function")return u.debug("Page component is not a function"),!1;let l=Array.from(document.body.children),c=cr(l,document.body),d=lr(c,document.body)?dr(l,document.body):c;ur(l,d);let f=await ee(r.createElement(a,{}),n);return yr(t)?o.createRoot(d).render(f):o.hydrateRoot(d,f,{identifierPrefix:"vf",onRecoverableError:()=>{}}),u.debug("Page component hydrated successfully"),!0}catch(r){return u.error("Page hydration failed",r),!1}}async function _r(e,t){try{let n=await fetch(P+"payload"+e,{headers:L(t)});if(!n.ok)return await N(n)?"snapshot-conflict":"failure";let r=await n.json();if(W(document,r?.dependencyPinningCacheKey),r?.slots){for(let[o,i]of Object.entries(r.slots))k(document,o).innerHTML=$(String(i||""));return"success"}return k(document,H).innerHTML=$(String(r?.html||"")),"success"}catch(n){return u.debug("payload fetch failed",n),"failure"}}async function xr(){try{let e=C(document),t=mr(globalThis.window?.location.search??"",e?.dependencyPinningCacheKey);if(pr()){await ne();return}let n=e?.pagePath,r=K(e);if(n){if(fr(globalThis.window,e,document)){u.debug("Page renderer owns hydration");return}u.debug("Found page component in hydration data:",n),await Rr(n,r,e)&&u.debug("Client component hydrated successfully");return}if(!gr(document,e))return;let o=await Er(t,e);if(o==="snapshot-conflict")return;if(o==="success"){await ne();return}let i=await _r(t,e);if(i==="snapshot-conflict")return;if(i==="success"){await ne();return}await ne()}catch(e){u.error("boot failed",e)}}if(typeof document<"u"){let e=()=>{xr()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):e()}export{xr as boot,hr as buildPageHydrationModuleUrl,mr as buildRSCTransportQuery,ur as retireAbandonedHeadOwnerMarkers,cr as selectHydrationRoot,gr as shouldAttemptRSCTransport,pr as shouldHydrateOnly,yr as shouldRenderPageComponent,fr as shouldUsePageRendererHydration,lr as shouldWrapPageHydrationRoot};\n';
|
|
9
|
+
export const CLIENT_DOM_BUNDLE = 'var Et=Object.defineProperty;var yt=(t,n,e)=>n in t?Et(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var m=(t,n,e)=>yt(t,typeof n!="symbol"?n+"":n,e);var I={reset:"\\x1B[0m",dim:"\\x1B[2m",gray:"\\x1B[90m",red:"\\x1B[31m",green:"\\x1B[32m",yellow:"\\x1B[33m",blue:"\\x1B[34m",magenta:"\\x1B[35m",cyan:"\\x1B[36m"},Ue={debug:I.gray,info:I.green,warn:I.yellow,error:I.red};var p="[REDACTED]",g=Reflect.apply,xt=Array.prototype.pop,Rt=Array.prototype.push;var ke=Array.prototype,He=BigInt.prototype.toString,v=Map,ht=Map.prototype.delete,_t=Map.prototype.get,St=Map.prototype.keys,At=Map.prototype.set;var R=Object.getOwnPropertyDescriptor,bt=Object.getPrototypeOf,ze=Object.hasOwn,Ve=Object.prototype,Tt=Set,Ct=decodeURIComponent,_=URL,je=Number.isFinite,Fe=Number.isInteger,L=RegExp.prototype.exec,It=R(RegExp.prototype,"global").get,Nt=R(RegExp.prototype,"unicode").get,Ot=String.prototype.charCodeAt,Dt=String.prototype.includes,$t=String.prototype.indexOf,V=String.prototype.slice,B=String.prototype.startsWith,W=String.prototype.toLowerCase,wt=Set.prototype.add,Ge=Set.prototype.delete,Lt=Set.prototype.has,Pt=bt(new v().keys()).next,Ut=R(Map.prototype,"size").get,ve=R(_.prototype,"host").get,Be=R(_.prototype,"origin").get,Mt=R(_.prototype,"password").get,We=R(_.prototype,"pathname").get,Ye=R(_.prototype,"protocol").get,kt=R(_.prototype,"username").get,Ht=/[^a-z0-9]/g,zt=/([a-z0-9])([A-Z])/g,Vt=/([A-Z])([A-Z][a-z])/g,jt=/\\b(?:sk-[A-Za-z0-9._-]{8,}|gh[po]_[A-Za-z0-9._-]{8,}|xox[baprs]-[A-Za-z0-9._-]{8,}|eyJ[A-Za-z0-9._-]{8,})\\b/g;function x(t,n,e){let r=g(It,n,[]),o=g(Nt,n,[]),s=0,i=!1,a="";n.lastIndex=0;try{for(;;){let u=g(L,n,[t]);if(u===null)break;let c=u[0],l=u.index;if(a+=h(t,s,l),a+=typeof e=="string"?e:e(u),s=l+c.length,i=!0,!r)break;c.length===0&&(n.lastIndex=Ft(t,l,o))}}finally{n.lastIndex=0}return i?a+h(t,s):t}function P(t){let n=g(W,t,[]);return x(n,Ht,"")}function S(t,n){return g(Ot,t,[n])}function Ft(t,n,e){let r=n+1;if(!e||r>=t.length)return r;let o=S(t,n);if(o<55296||o>56319)return r;let s=S(t,r);return s>=56320&&s<=57343?n+2:r}function h(t,n,e){return e===void 0?g(V,t,[n]):g(V,t,[n,e])}function Gt(t){let n=[],e=0;for(let r=0;r<=t.length;r++){let o=r===t.length?-1:S(t,r);o>=97&&o<=122||o>=48&&o<=57||(r>e&&(n[n.length]=h(t,e,r)),e=r+1)}return n}var N=["password","passwd","pwd","passphrase","secret","clientsecret","token","apikey","accesskey","privatekey","credential","authheader","authorization","cookie","bearer","jwt","connectionstring","signature","sessionid","sid","otp","mfa","pin","salt","xsrf","csrf"],vt=512,Bt=128,C=new v;var Wt=256;function Yt(t){let n=t.length<=Bt;if(n){let o=g(_t,C,[t]);if(o!==void 0)return o}let e=P(t),r=e==="auth";for(let o=0;!r&&o<N.length;o++)r=g(Dt,e,[N[o]]);if(n){if(g(Ut,C,[])>=vt){let s=g(St,C,[]),i=g(Pt,s,[]).value;i!==void 0&&g(ht,C,[i])}g(At,C,[t,r])}return r}var j=["access_token","accesstoken","refresh_token","api_key","apikey","code","token","secret","client_secret","password","passwd","pwd","state","sig","signature","auth","x-amz-credential","x-amz-signature","x-amz-security-token","x-goog-credential","x-goog-signature"],Y=new Tt;for(let t=0;t<j.length;t++)g(wt,Y,[P(j[t])]);var Kt=/(\\b[a-z][a-z0-9+.-]*:\\/\\/|\\/\\/)([^/?#\\s]+)@/gi,Xt=/(\\b[a-z][a-z0-9+.-]*:\\/\\/|\\/\\/)([a-z0-9._~!$&\'()*+,;=%-]+):([^/?#@\\r\\n \\t]+[ \\t][^/?#@\\r\\n]*)@/gi,Jt=3;function qt(t){return t===" "||t==="\t"||t===","||t===";"||t==="&"||t==="?"||t==="#"}function Zt(t){if(!t)return!1;let n=S(t,0);return n>=65&&n<=90||n>=97&&n<=122}function K(t){return Zt(t)||t==="_"||t==="$"}function Qt(t){if(!t)return!1;let n=S(t,0);return K(t)||n>=48&&n<=57||t==="."||t==="-"}function X(t,n){let e=n,r=t[e]===\'"\'||t[e]==="\'"?t[e++]:"";if(!K(t[e]))return!1;for(e++;Qt(t[e]);)e++;if(r){if(t[e]!==r)return!1;e++}for(;t[e]===" "||t[e]==="\t";)e++;return t[e]===":"||t[e]==="="}function J(t){return t==="\\r"||t===`\n`||t==="}"||t==="]"||qt(t)}function q(t,n){let e=n;for(;e<t.length&&J(t[e]);)e++;return e}function F(t,n){let e=q(t,n);return e>=t.length||X(t,e)}function te(t,n){let e=n,r=!0;if(g(B,t,[p,n])){let l=n+p.length;if(F(t,l))return{end:l,replacement:p};e=l,r=!1}let o=r&&(t[e]===\'"\'||t[e]==="\'"||t[e]==="`")?t[e]:"",s=!1,i=()=>o?`${o}${p}${s?o:""}`:p,a=[],u="",c=-1;for(let l=e;l<t.length;){let f=t[l];if(u){if(f==="\\\\"){l+=2;continue}if(f===u){if(c===e&&a.length===0)return s=!0,{end:l+1,replacement:i()};u="",c=-1}l++;continue}if(f===\'"\'||f==="\'"||f==="`"){u=f,c=l,l++;continue}if(f==="{"||f==="["){g(Rt,a,[f==="{"?"}":"]"]),l++;continue}if(a.length>0&&(f==="}"||f==="]")){if(a[a.length-1]!==f)return{end:t.length,replacement:i()};if(g(xt,a,[]),l++,a.length===0&&F(t,l))return{end:l,replacement:i()};continue}if(a.length>0||!J(f)){l++;continue}let T=l;if(l=q(t,l),l>=t.length||X(t,l))return{end:T,replacement:i()}}return{end:t.length,replacement:i()}}function G(t,n,e,r){let o=0,s="";for(let i=g(L,n,[t]);i;i=g(L,n,[t])){let a=i[e];if(!ee(a))continue;let u=n.lastIndex,c=r===void 0?void 0:i[r],l=u+p.length;if((c==="?"||c==="&"||c===";")&&g(B,t,[p,u])&&t[l]==="#")continue;let f=te(t,u);s+=h(t,o,i.index),s+=i[0],s+=f.replacement,o=f.end,n.lastIndex=f.end}return o===0?t:s+h(t,o)}function ee(t){if(t.length>Wt)return!0;let n=x(t,Vt,s=>`${s[1]} ${s[2]}`),e=x(n,zt,s=>`${s[1]} ${s[2]}`),r=g(W,e,[]),o=Gt(r);for(let s=0;s<o.length;s++){if(o[s].length===0)continue;let i="";for(let a=s;a<o.length;a++){let u=o[a];if(u.length!==0){i+=u;for(let c=0;c<N.length;c++)if(i===N[c])return!0}}}return o.length===1&&o[0]==="auth"}function ne(t,n,e){let r=-1;for(let i=0;i<e.length;i++){let a=S(e,i);if(a===32||a===9){r=i;break}}if(r<0)return!1;let o=`${n}:${h(e,0,r)}`,s=t==="//"?`https://${o}`:`${t}${o}`;try{let i=new _(s),a=g(kt,i,[]),u=g(Mt,i,[]);return a.length===0&&u.length===0}catch{return!1}}function re(t){let n=t;for(let e=0;e<Jt;e++){let r;try{r=Ct(n)}catch{break}if(r===n)break;n=r}return n}function U(t){if(typeof t!="string"||t.length===0)return t;let n=x(t,Kt,e=>{let r=e[1],o=e[2],s=g($t,o,[":"]);if(s===-1)return`${r}${p}@`;let i=h(o,0,s);return`${r}${i}:${p}@`});return n=x(n,Xt,e=>{let r=e[1],o=e[2],s=e[3];return ne(r,o,s)?e[0]:`${r}${o}:${p}@`}),n=x(n,/([?#&;])([-a-z0-9_.%\\[\\]]+)=([^&#;\\s]*)/gi,e=>{let r=e[1],o=e[2],s=re(o);return g(Lt,Y,[P(s)])||Yt(s)?`${r}${o}=${p}`:e[0]}),n=x(n,/(^|[^a-z0-9_-])((?:set-cookie|cookie)\\s*:\\s*)[^\\r\\n]*/gi,e=>`${e[1]}${e[2]}${p}`),n=x(n,/\\b(authorization\\s*[:=]\\s*)[^\\r\\n]*/gi,e=>`${e[1]}${p}`),n=x(n,/\\b(bearer|basic)(\\s+)(?:"[^"\\r\\n]*"|\'[^\'\\r\\n]*\'|[a-z0-9._~+/=-]+)/gi,e=>`${e[1]}${e[2]}${p}`),n=x(n,jt,p),n=G(n,/(["\'])([_$a-z][a-z0-9_.$-]*)\\1(\\s*[:=]\\s*)/gi,2),n=G(n,/(^|[^a-z0-9_.$-])([_$a-z][a-z0-9_.$-]*)(\\s*[:=]\\s*)/gi,2,1),n}var oe=2048;var Ze=64*1024,se=256,ie="https://veryfront.com/docs/errors/",Z="...[truncated]",M="unknown-error";function Q(t,n){if(t.length<=n)return t;let e=Math.max(0,n-Z.length);return`${ae(t,e)}${Z}`}function ae(t,n){let e=t.slice(0,n),r=e.charCodeAt(e.length-1);return r>=55296&&r<=56319&&(e=e.slice(0,-1)),e}function ce(t){let n="";for(let e=0;e<t.length;e++){let r=t.charCodeAt(e);if(r>=55296&&r<=56319){let o=t.charCodeAt(e+1);o>=56320&&o<=57343?(n+=t.slice(e,e+2),e++):n+="\\uFFFD";continue}n+=r>=56320&&r<=57343?"\\uFFFD":t.charAt(e)}return n}function A(t){return typeof t!="string"?p:Q(U(t),oe)}function ue(t){let n=typeof t=="string"?U(t):M,e=Q(n||M,se),r=ce(e);return r==="."||r===".."?M:r}function O(t){let n=encodeURIComponent(ue(t));return`${ie}${n}`}var nt=Reflect.apply,le=Object.freeze,de=Object.getOwnPropertyDescriptors,tt=Number.isFinite,rt=new WeakSet,ge=WeakSet.prototype.add,fe=WeakSet.prototype.has,pe=new Set(["CONFIG","BUILD","RUNTIME","ROUTE","MODULE","SERVER","BOUNDARY","DEV","DEPLOY","AGENT","GENERAL"]);function E(t){let n={...t},e={...n,create(r){let o=r?.message,s=r?.detail,i=r?.cause,a=r?.instance,u=r?.context,c=r?.status??n.status;return new k(o||s||n.title,{slug:n.slug,category:n.category,status:c,title:n.title,suggestion:n.suggestion,exitCode:n.exitCode,detail:s,cause:i,instance:a,context:u})}};return le(e)}var k=class extends Error{constructor(e,r){super(e);m(this,"slug");m(this,"category");m(this,"status");m(this,"title");m(this,"suggestion");m(this,"exitCode");m(this,"detail");m(this,"cause");m(this,"instance");m(this,"context");nt(ge,rt,[this]),this.name="VeryfrontError",this.slug=r.slug,this.category=r.category,this.status=r.status,this.title=r.title,this.suggestion=r.suggestion,this.exitCode=r.exitCode,this.detail=r.detail,this.cause=r.cause,this.instance=r.instance,this.context=r.context}toRFC9457(){let e=et(this);return e?{type:O(e.slug),title:A(e.title),status:e.status,detail:e.detail===void 0?void 0:A(e.detail),instance:e.instance===void 0?void 0:A(e.instance),category:e.category,suggestion:e.suggestion===void 0?void 0:A(e.suggestion),cause:typeof e.cause=="string"?A(e.cause):void 0}:{type:O("unknown-error"),title:"Unknown/unclassified error",status:500,category:"GENERAL"}}getDocsUrl(){let e=et(this);return O(e?.slug??"unknown-error")}};function ot(t){return typeof t=="object"&&t!==null&&nt(fe,rt,[t])===!0}function et(t){return ot(t)?me(t):null}function me(t){try{if(!ot(t))return null;let n=de(t),e=mt=>{let w=n[mt];return w&&"value"in w?w.value:void 0},r=e("slug"),o=e("category"),s=e("status"),i=e("title"),a=e("message"),u=e("suggestion"),c=e("exitCode"),l=e("detail"),f=e("cause"),T=e("instance"),pt=e("context"),$=e("stack");return typeof r!="string"||!pe.has(o)||typeof s!="number"||!tt(s)||typeof i!="string"||typeof a!="string"||u!==void 0&&typeof u!="string"||c!==void 0&&(typeof c!="number"||!tt(c))||l!==void 0&&typeof l!="string"||T!==void 0&&typeof T!="string"||$!==void 0&&typeof $!="string"?null:{slug:r,category:o,status:s,title:i,message:a,suggestion:u,exitCode:c,detail:l,cause:f,instance:T,context:pt,stack:$}}catch{return null}}var on=E({slug:"unknown-error",category:"GENERAL",status:500,title:"Unknown/unclassified error",suggestion:"Check logs for more details"}),sn=E({slug:"authentication-required",category:"GENERAL",status:401,title:"Authentication required",suggestion:"Set VERYFRONT_API_TOKEN or run \'veryfront login\'"}),an=E({slug:"permission-denied",category:"GENERAL",status:403,title:"File/resource permission denied",suggestion:"Check file permissions and access rights"}),cn=E({slug:"file-not-found",category:"GENERAL",status:404,title:"File not found",suggestion:"Verify the file path exists"}),un=E({slug:"resource-not-found",category:"GENERAL",status:404,title:"Requested resource not found",suggestion:"Verify the referenced resource ID or name exists"}),ln=E({slug:"invalid-argument",category:"GENERAL",status:400,title:"Invalid function argument",suggestion:"Check argument types and values",exitCode:2}),dn=E({slug:"timeout-error",category:"GENERAL",status:408,title:"Operation timed out",suggestion:"Increase timeout or optimize the operation"}),gn=E({slug:"initialization-error",category:"GENERAL",status:500,title:"Initialization failed",suggestion:"Check initialization requirements and dependencies"}),fn=E({slug:"not-supported",category:"GENERAL",status:501,title:"Feature not supported",suggestion:"Check documentation for supported features"}),st=E({slug:"security-violation",category:"GENERAL",status:403,title:"Security violation detected",suggestion:"Check for path traversal or unauthorized access attempts"}),pn=E({slug:"input-validation-failed",category:"GENERAL",status:400,title:"Input validation failed",suggestion:"Check request input against validation rules"}),mn=E({slug:"project-source-empty",category:"GENERAL",status:400,title:"Project source is empty",suggestion:"Add project files or run \'veryfront init\'"}),En=E({slug:"nested-cwd-scope",category:"GENERAL",status:500,title:"Working directory scope nested inside another",suggestion:"Do the inner work directly in the outer scope\'s callback instead of opening a second one"});var Ee=[{source:String.raw`<script[^>]*>[\\s\\S]*?<\\/script>`,flags:"gi",name:"inline script"},{source:String.raw`javascript:`,flags:"gi",name:"javascript: URL"},{source:String.raw`\\bon\\w+\\s*=`,flags:"gi",name:"event handler attribute"},{source:String.raw`data:\\s*text\\/html`,flags:"gi",name:"data: HTML URL"}];function ye(){return Ee.map(({source:t,flags:n,name:e})=>({pattern:new RegExp(t,n),name:e}))}function xe(){let t=globalThis;return t.__VERYFRONT_DEV__===!0||t.Deno?.env?.get?.("VERYFRONT_ENV")==="development"}function it(t,n={}){let{allowInlineScripts:e=!1,strict:r=!1,warn:o=!0}=n;for(let{pattern:s,name:i}of ye())if(!(e&&i==="inline script")&&(s.lastIndex=0,!!s.test(t)&&(o&&console.warn(`[Security] Suspicious ${i} detected in server HTML`),r||!xe())))throw st.create({detail:`Potentially unsafe HTML: ${i} detected`});return t}var b=class{constructor(n,e){m(this,"prefix",n);m(this,"level",e)}log(n,e,r,...o){this.level>n||e?.(r,...o)}debug(n,...e){this.log(0,console.debug,`[${this.prefix}] DEBUG: ${n}`,...e)}info(n,...e){this.log(1,console.log,`[${this.prefix}] ${n}`,...e)}warn(n,...e){this.log(2,console.warn,`[${this.prefix}] WARN: ${n}`,...e)}error(n,...e){this.log(3,console.error,`[${this.prefix}] ERROR: ${n}`,...e)}};function Re(){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 D=Re(),y=new b("RSC",D),hn=new b("PREFETCH",D),_n=new b("HYDRATE",D),Sn=new b("VERYFRONT",D);var Tn=Object.freeze({IPV4:"127.0.0.1",IPV6:"::1",HOSTNAME:"localhost"});var he=5e3,_e=1e4,Nn=16*1024*1024,Se=5e3;var Ae=100;var be=Object.freeze([5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4]),On=Object.freeze([1,5,10,25,50,100,250,500,1e3,2500,5e3,1e4]),Dn=Object.freeze({server:Object.freeze({port:3e3,hostname:"0.0.0.0"}),timeouts:Object.freeze({default:he,api:3e4,ssr:_e,hmr:3e4,sandbox:Se}),cache:Object.freeze({jit:Object.freeze({maxSize:Ae,tempDirPrefix:"vf-bundle-"})}),metrics:Object.freeze({ssrBoundaries:be})});var d="/_veryfront",H={RSC:`${d}/rsc/`,FS:`${d}/fs/`,MODULES:`${d}/modules/`,PAGES:`${d}/pages/`,DATA:`${d}/data/`,LIB:`${d}/lib/`,CHUNKS:`${d}/chunks/`,CLIENT:`${d}/client/`},ct={HMR_RUNTIME:`${d}/hmr-runtime.js`,HMR:`${d}/hmr.js`,ERROR_OVERLAY:`${d}/error-overlay.js`,DEV_LOADER:`${d}/dev-loader.js`,CLIENT_LOG:`${d}/log`,CLIENT_JS:`${d}/client.js`,ROUTER_JS:`${d}/router.js`,PREFETCH_JS:`${d}/prefetch.js`,MANIFEST_JSON:`${d}/manifest.json`,APP_JS:`${d}/app.js`,RSC_CLIENT:`${d}/rsc/client.js`,RSC_MANIFEST:`${d}/rsc/manifest`,RSC_STREAM:`${d}/rsc/stream`,RSC_PAYLOAD:`${d}/rsc/payload`,RSC_RENDER:`${d}/rsc/render`,RSC_PAGE:`${d}/rsc/page`,RSC_MODULE:`${d}/rsc/module`,RSC_DOM:`${d}/rsc/dom.js`,LIB_CHAT_REACT:`${d}/lib/chat/react.js`,LIB_CHAT_COMPONENTS:`${d}/lib/chat/components.js`,LIB_CHAT_PRIMITIVES:`${d}/lib/chat/primitives.js`};var Te={ROOT:".veryfront",CACHE:".veryfront/cache",KV:".veryfront/kv",LOGS:".veryfront/logs",TMP:".veryfront/tmp"},wn=Te.CACHE;var Ln={HMR_RUNTIME:ct.HMR_RUNTIME,ERROR_OVERLAY:ct.ERROR_OVERLAY};var Ce=H.RSC,Ie=H.FS;var ut="rsc-root",z="x-veryfront-dependency-pins";var Hn=Array.prototype.at,zn=Array.prototype.filter,Vn=Array.prototype.join,jn=Array.prototype.map,Fn=Array.prototype.pop,Gn=Array.prototype.push,vn=Array.prototype.sort;var sr=Object.freeze({react:"","react-dom":"","react-dom/client":"","react-dom/server":"","react/jsx-runtime":"","react/jsx-dev-runtime":""});var Oe="veryfront-hydration-data";function lt(t){try{let n=[...t.querySelectorAll(`[id="${Oe}"]`)];if(n.length!==1)return null;let e=t.body;if(!e)return null;let r=n[0];return e.firstElementChild!==r&&r.parentElement!==e||r.tagName?.toLowerCase()!=="script"||r.getAttribute("type")?.trim().toLowerCase()!=="application/json"?null:r}catch{return null}}function dt(t,n){if(!n?.startsWith("on:"))return!1;try{let e=lt(t);if(!e)return!1;let r=JSON.parse(e.textContent||"{}");return r.dependencyPinningCacheKey=n,e.textContent=JSON.stringify(r),!0}catch(e){return y.debug("hydration dependency snapshot seed failed",e),!1}}function ft(t,n){let e=n==="root"?ut:`rsc-slot-${n}`,r=t.getElementById(e);if(r)return r;let o=t.createElement("div");return o.id=e,t.body.appendChild(o),o}function De(t,n){if(n.type!=="slot")return;let e=ft(t,n.id);e.innerHTML=it(String(n.html??""))}function gt(t,n){let e=n.split(`\n`),r=e.pop()??"";for(let o of e){let s=o.trim();if(!s)continue;let i;try{i=JSON.parse(s)}catch(u){y.debug("[client-dom] malformed NDJSON line",{line:s,error:u instanceof Error?u.message:String(u)});continue}if(!i||typeof i!="object")continue;let a=i;if(a.type==="slot"){De(t,a);try{Le(t,a.id||"root")}catch(u){y.debug("[client-dom] hydration optional failed",u)}}}return r}function $e(t){return new Promise((n,e)=>{let r=()=>e(new DOMException("aborted","AbortError"));if(t.aborted){r();return}t.addEventListener("abort",r,{once:!0})})}async function Tr(t,n=document,e){let r="body"in t?t:null,o=r?.body??t;if(!o)return;r&&dt(n,r.headers.get(z));let s=o.getReader(),i=new TextDecoder,a="",u=!1;try{for(;;){if(e?.aborted)throw new DOMException("aborted","AbortError");let c=s.read(),{done:l,value:f}=e?await Promise.race([c,$e(e)]):await c;if(l){u=!0;break}a+=i.decode(f,{stream:!0}),a=gt(n,a)}a&>(n,`${a}\n`)}catch(c){throw c instanceof Error&&c.name==="AbortError"||y.debug("[client-dom] consumeNdjsonStream error",c),c}finally{try{await s.cancel()}catch(c){u||y.debug("[client-dom] reader.cancel failed",c)}try{s.releaseLock()}catch(c){y.debug("[client-dom] reader.releaseLock failed",c)}if(typeof o.cancel=="function")try{await o.cancel()}catch(c){y.debug("[client-dom] stream.cancel failed",c)}if(typeof r?.body?.cancel=="function")try{await r.body.cancel()}catch(c){y.debug("[client-dom] response.body.cancel failed",c)}}}function we(t,n){let e=ft(t,n),r=[],o=s=>{let i=s;i.dataset?.clientRef&&r.push(i);for(let a of s.children)o(a)};return o(e),r}function Le(t,n){let e=we(t,n);for(let r of e){let o=r.dataset?.clientRef;o&&(r.dataset.hydrated="true",y.debug("[client-dom] marked for hydration",o))}}export{Tr as consumeNdjsonStream,ft as getContainer};\n';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "veryfront",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1223",
|
|
4
4
|
"description": "The simplest way to build AI-powered apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -421,13 +421,13 @@
|
|
|
421
421
|
"@deno/shim-crypto": "0.3.1",
|
|
422
422
|
"@types/react": "19.2.14",
|
|
423
423
|
"@types/react-dom": "19.2.3",
|
|
424
|
-
"@veryfront/ext-bundler-esbuild": "0.1.
|
|
425
|
-
"@veryfront/ext-content-mdx": "0.1.
|
|
426
|
-
"@veryfront/ext-css-tailwind": "0.1.
|
|
427
|
-
"@veryfront/ext-dev-ui-react": "0.1.
|
|
428
|
-
"@veryfront/ext-node-websocket-ws": "0.1.
|
|
429
|
-
"@veryfront/ext-parser-babel": "0.1.
|
|
430
|
-
"@veryfront/ext-yaml": "0.1.
|
|
424
|
+
"@veryfront/ext-bundler-esbuild": "0.1.1223",
|
|
425
|
+
"@veryfront/ext-content-mdx": "0.1.1223",
|
|
426
|
+
"@veryfront/ext-css-tailwind": "0.1.1223",
|
|
427
|
+
"@veryfront/ext-dev-ui-react": "0.1.1223",
|
|
428
|
+
"@veryfront/ext-node-websocket-ws": "0.1.1223",
|
|
429
|
+
"@veryfront/ext-parser-babel": "0.1.1223",
|
|
430
|
+
"@veryfront/ext-yaml": "0.1.1223"
|
|
431
431
|
},
|
|
432
432
|
"devDependencies": {
|
|
433
433
|
"@types/node": "20.9.0"
|