veryfront 0.1.745 → 0.1.746

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.1.745",
3
+ "version": "0.1.746",
4
4
  "license": "Apache-2.0",
5
5
  "nodeModulesDir": "auto",
6
6
  "minimumDependencyAge": "P2D",
@@ -1 +1 @@
1
- {"version":3,"file":"static-generation.d.ts","sourceRoot":"","sources":["../../../../src/src/build/production-build/static-generation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAY3E,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9D,UAAU,CAAC,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,KAAK,GAAG,WAAW,CAAC;KAC3B,CAAC;IACF,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,cAAc,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,MAAM,EAAE,eAAe,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,aAAa,GAAG,IAAI,CAAC;IACpC,mGAAmG;IACnG,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAClE,8CAA8C;IAC9C,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAsHD,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,SAAS,EAAE,EACnB,OAAO,EAAE,UAAU,GAClB,OAAO,CAAC,QAAQ,CAAC,CAmGnB;AAED,wBAAsB,cAAc,CAClC,SAAS,EAAE,YAAY,EAAE,EACzB,OAAO,EAAE,UAAU,GAClB,OAAO,CAAC,QAAQ,CAAC,CAkDnB"}
1
+ {"version":3,"file":"static-generation.d.ts","sourceRoot":"","sources":["../../../../src/src/build/production-build/static-generation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAa3E,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9D,UAAU,CAAC,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,KAAK,GAAG,WAAW,CAAC;KAC3B,CAAC;IACF,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,cAAc,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,MAAM,EAAE,eAAe,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,aAAa,GAAG,IAAI,CAAC;IACpC,mGAAmG;IACnG,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAClE,8CAA8C;IAC9C,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAsHD,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,SAAS,EAAE,EACnB,OAAO,EAAE,UAAU,GAClB,OAAO,CAAC,QAAQ,CAAC,CAmGnB;AAED,wBAAsB,cAAc,CAClC,SAAS,EAAE,YAAY,EAAE,EACzB,OAAO,EAAE,UAAU,GAClB,OAAO,CAAC,QAAQ,CAAC,CAkDnB"}
@@ -10,6 +10,7 @@ import { generateImportMap } from "./client-runtime.js";
10
10
  import { cacheCSSAsync, extractCandidatesFromFiles, generateTailwindCSS, hashCSS, } from "../../html/styles-builder/index.js";
11
11
  import { DEFAULT_STYLESHEET } from "../../html/styles-builder/css-hash-cache.js";
12
12
  import { FRAMEWORK_CANDIDATES } from "../../server/handlers/dev/framework-candidates.generated.js";
13
+ import { jsonForInlineScript } from "../../security/client/html-sanitizer.js";
13
14
  function getOutputPath(outputDir, slug) {
14
15
  if (slug === "index")
15
16
  return join(outputDir, "index.html");
@@ -214,14 +215,14 @@ function generateClientRuntime(route, result, _baseUrl) {
214
215
  return `
215
216
  <!-- Page data for hydration -->
216
217
  <script data-veryfront-page type="application/json">
217
- ${JSON.stringify(pageData)}
218
+ ${jsonForInlineScript(pageData)}
218
219
  </script>
219
220
 
220
221
  <!-- Client runtime bootstrap -->
221
222
  <script type="module">
222
223
  import { boot } from '/_veryfront/client.js';
223
224
  if (typeof boot === 'function') {
224
- boot({ slug: '${route.slug}' });
225
+ boot({ slug: ${jsonForInlineScript(route.slug)} });
225
226
  }
226
227
  </script>
227
228
  </body>`;
@@ -2,4 +2,6 @@ export declare function escapeHTML(str: string): string;
2
2
  export declare const escapeHtml: typeof escapeHTML;
3
3
  export declare function buildAttributes(attrs: Record<string, string>): string;
4
4
  export declare function buildNonceAttribute(nonce?: string): string;
5
+ export declare function escapeInlineScriptContent(content: string): string;
6
+ export declare function escapeInlineStyleContent(content: string): string;
5
7
  //# sourceMappingURL=html-escape.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"html-escape.d.ts","sourceRoot":"","sources":["../../../src/src/html/html-escape.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAO9C;AAED,eAAO,MAAM,UAAU,mBAAa,CAAC;AAErC,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAIrE;AAED,wBAAgB,mBAAmB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAE1D"}
1
+ {"version":3,"file":"html-escape.d.ts","sourceRoot":"","sources":["../../../src/src/html/html-escape.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAO9C;AAED,eAAO,MAAM,UAAU,mBAAa,CAAC;AAErC,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAIrE;AAED,wBAAgB,mBAAmB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEjE;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEhE"}
@@ -15,3 +15,9 @@ export function buildAttributes(attrs) {
15
15
  export function buildNonceAttribute(nonce) {
16
16
  return nonce ? ` nonce="${escapeHTML(nonce)}"` : "";
17
17
  }
18
+ export function escapeInlineScriptContent(content) {
19
+ return String(content ?? "").replace(/<\/script/gi, "<\\/script");
20
+ }
21
+ export function escapeInlineStyleContent(content) {
22
+ return String(content ?? "").replace(/<\/style/gi, "<\\/style");
23
+ }
@@ -237,7 +237,7 @@ async function generateHTMLShellPartsImpl(meta, options, params, props, contentF
237
237
  ${modeStyles}
238
238
  ${slugForOverlay}
239
239
  </head>
240
- <body${bodyClass ? ` class="${bodyClass}"` : ""} suppressHydrationWarning>
240
+ <body${bodyClass ? ` class="${escapeHTML(bodyClass)}"` : ""} suppressHydrationWarning>
241
241
  <div ${rootAttributes}>`;
242
242
  const relativePagePath = getRelativePagePath(options.pagePath, options.projectDir);
243
243
  const studioScripts = options.studioEmbed
@@ -1 +1 @@
1
- {"version":3,"file":"tag-generators.d.ts","sourceRoot":"","sources":["../../../src/src/html/tag-generators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAoB/D,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,CAuB/D;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,CA2B/D;AAED,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,YAAY,EACtB,KAAK,CAAC,EAAE,MAAM,GACb,MAAM,CAoBR;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,YAAY,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAoBhF"}
1
+ {"version":3,"file":"tag-generators.d.ts","sourceRoot":"","sources":["../../../src/src/html/tag-generators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAyB/D,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,CAuB/D;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,CA2B/D;AAED,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,YAAY,EACtB,KAAK,CAAC,EAAE,MAAM,GACb,MAAM,CAsBR;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,YAAY,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAsBhF"}
@@ -1,4 +1,4 @@
1
- import { buildAttributes, escapeHTML } from "./html-escape.js";
1
+ import { buildAttributes, escapeHTML, escapeInlineScriptContent, escapeInlineStyleContent, } from "./html-escape.js";
2
2
  function filterAttrs(obj, excludeKeys) {
3
3
  return Object.fromEntries(Object.entries(obj).filter(([key]) => !excludeKeys.includes(key)));
4
4
  }
@@ -52,7 +52,7 @@ export function generateScriptTags(metadata, nonce) {
52
52
  if (!script.content)
53
53
  continue;
54
54
  const attrs = addNonceIfPresent(filterAttrs(script, ["content", "src"]), nonce);
55
- tags.push(`<script ${buildAttributes(attrs)}>${script.content}</script>`);
55
+ tags.push(`<script ${buildAttributes(attrs)}>${escapeInlineScriptContent(script.content)}</script>`);
56
56
  }
57
57
  return tags.join("\n ");
58
58
  }
@@ -67,7 +67,7 @@ export function generateStyleTags(metadata, nonce) {
67
67
  if (!style.content)
68
68
  continue;
69
69
  const attrs = addNonceIfPresent(filterAttrs(style, ["content", "href"]), nonce);
70
- tags.push(`<style ${buildAttributes(attrs)}>${style.content}</style>`);
70
+ tags.push(`<style ${buildAttributes(attrs)}>${escapeInlineStyleContent(style.content)}</style>`);
71
71
  }
72
72
  return tags.join("\n ");
73
73
  }
@@ -1 +1 @@
1
- {"version":3,"file":"html-head.d.ts","sourceRoot":"","sources":["../../../../src/src/rendering/orchestrator/html-head.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtE,UAAU,sBAAsB;IAC9B,QAAQ,EAAE;QAAE,MAAM,EAAE;YAAE,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;SAAE,CAAA;KAAE,CAAC;IAChE,UAAU,EAAE,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IAC3C,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC7C;AAED,wBAAgB,iBAAiB,CAAC,IAAI,CAAC,EAAE,aAAa,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAwD1F;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,sBAAsB,GAAG,cAAc,CAMhF"}
1
+ {"version":3,"file":"html-head.d.ts","sourceRoot":"","sources":["../../../../src/src/rendering/orchestrator/html-head.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAOtE,UAAU,sBAAsB;IAC9B,QAAQ,EAAE;QAAE,MAAM,EAAE;YAAE,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;SAAE,CAAA;KAAE,CAAC;IAChE,UAAU,EAAE,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IAC3C,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC7C;AAED,wBAAgB,iBAAiB,CAAC,IAAI,CAAC,EAAE,aAAa,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CA0D1F;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,sBAAsB,GAAG,cAAc,CAMhF"}
@@ -1,3 +1,4 @@
1
+ import { buildAttributes, escapeInlineScriptContent, escapeInlineStyleContent, } from "../../html/html-escape.js";
1
2
  export function buildHeadElements(head) {
2
3
  if (!head)
3
4
  return { scripts: "", other: "" };
@@ -17,9 +18,9 @@ export function buildHeadElements(head) {
17
18
  }
18
19
  attrPairs.push(["data-vf-hash", "vf" + Math.abs(sum).toString(36)]);
19
20
  }
20
- const attrStr = attrPairs.map(([k, v]) => `${k}="${v}"`).join(" ");
21
+ const attrStr = buildAttributes(Object.fromEntries(attrPairs));
21
22
  if (content) {
22
- scriptParts.push(`<script ${attrStr}>${content}</script>`);
23
+ scriptParts.push(`<script ${attrStr}>${escapeInlineScriptContent(content)}</script>`);
23
24
  }
24
25
  else if (attrs.src) {
25
26
  scriptParts.push(`<script ${attrStr}></script>`);
@@ -30,24 +31,24 @@ export function buildHeadElements(head) {
30
31
  continue;
31
32
  const attrs = [];
32
33
  if (meta.name)
33
- attrs.push(`name="${meta.name}"`);
34
+ attrs.push(["name", meta.name]);
34
35
  if (meta.property)
35
- attrs.push(`property="${meta.property}"`);
36
+ attrs.push(["property", meta.property]);
36
37
  if (meta.content)
37
- attrs.push(`content="${meta.content}"`);
38
+ attrs.push(["content", meta.content]);
38
39
  if (attrs.length)
39
- otherParts.push(`<meta ${attrs.join(" ")}>`);
40
+ otherParts.push(`<meta ${buildAttributes(Object.fromEntries(attrs))}>`);
40
41
  }
41
42
  for (const link of head.links) {
42
- const attrs = Object.entries(link)
43
+ const attrs = Object.fromEntries(Object.entries(link)
43
44
  .filter(([, v]) => v != null)
44
- .map(([k, v]) => `${k}="${v}"`)
45
- .join(" ");
46
- if (attrs)
47
- otherParts.push(`<link ${attrs}>`);
45
+ .map(([k, v]) => [k, String(v)]));
46
+ const attrStr = buildAttributes(attrs);
47
+ if (attrStr)
48
+ otherParts.push(`<link ${attrStr}>`);
48
49
  }
49
50
  for (const style of head.styles) {
50
- otherParts.push(`<style>${style}</style>`);
51
+ otherParts.push(`<style>${escapeInlineStyleContent(style)}</style>`);
51
52
  }
52
53
  return {
53
54
  scripts: scriptParts.join("\n "),
@@ -1 +1 @@
1
- {"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../../../src/src/rendering/orchestrator/html.ts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAClF,YAAY,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AA4DlF,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAsB;gBAExB,MAAM,EAAE,mBAAmB;IAIjC,gBAAgB,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC;IA0BjE,kBAAkB,CACtB,WAAW,EAAE,cAAc,EAC3B,OAAO,EAAE,IAAI,CAAC,qBAAqB,EAAE,MAAM,CAAC,GAC3C,OAAO,CAAC,cAAc,CAAC;YAqEZ,sBAAsB;YAqDtB,4BAA4B;YAiB5B,wBAAwB;YAmBxB,gBAAgB;YAyBhB,kBAAkB;IAwDhC,OAAO,CAAC,cAAc;YAQR,eAAe;YAaf,gBAAgB;IAgF9B;;;;OAIG;YACW,gBAAgB;CAc/B"}
1
+ {"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../../../src/src/rendering/orchestrator/html.ts"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAClF,YAAY,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AA4DlF,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAsB;gBAExB,MAAM,EAAE,mBAAmB;IAIjC,gBAAgB,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC;IA0BjE,kBAAkB,CACtB,WAAW,EAAE,cAAc,EAC3B,OAAO,EAAE,IAAI,CAAC,qBAAqB,EAAE,MAAM,CAAC,GAC3C,OAAO,CAAC,cAAc,CAAC;YAqEZ,sBAAsB;YAqDtB,4BAA4B;YAiB5B,wBAAwB;YAmBxB,gBAAgB;YAyBhB,kBAAkB;IAwDhC,OAAO,CAAC,cAAc;YAQR,eAAe;YAaf,gBAAgB;IAgF9B;;;;OAIG;YACW,gBAAgB;CAc/B"}
@@ -1,6 +1,7 @@
1
1
  import { join } from "../../platform/compat/path/index.js";
2
2
  import { getExtensionName } from "../../utils/path-utils.js";
3
3
  import { buildImportMapJson, extractHTMLMetadata, generateHTMLShellParts, injectHTMLContent, isFullHTMLDocument, } from "../../html/index.js";
4
+ import { buildNonceAttribute } from "../../html/html-escape.js";
4
5
  import { DEFAULT_DASHBOARD_PORT, rendererLogger } from "../../utils/index.js";
5
6
  import { addNonceToHtmlTags } from "../../html/nonce-injection.js";
6
7
  import { injectElementSelectors } from "../../studio/element-selector-injector.js";
@@ -46,7 +47,7 @@ function injectThemePersistenceScript(html, colorScheme, enabled, nonce) {
46
47
  return html;
47
48
  if (html.includes(`localStorage.setItem('theme','${colorScheme}')`))
48
49
  return html;
49
- const nonceAttr = nonce ? ` nonce="${nonce}"` : "";
50
+ const nonceAttr = buildNonceAttribute(nonce);
50
51
  const script = `<script${nonceAttr}>
51
52
  (function(){try{localStorage.setItem('theme','${colorScheme}')}catch(e){/* SILENT: localStorage may be unavailable */}})();
52
53
  </script>`;
@@ -1 +1 @@
1
- {"version":3,"file":"framework-candidates.generated.d.ts","sourceRoot":"","sources":["../../../../../src/src/server/handlers/dev/framework-candidates.generated.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,oBAAoB,EAAE,SAAS,MAAM,EAkrLjD,CAAC"}
1
+ {"version":3,"file":"framework-candidates.generated.d.ts","sourceRoot":"","sources":["../../../../../src/src/server/handlers/dev/framework-candidates.generated.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,oBAAoB,EAAE,SAAS,MAAM,EAisLjD,CAAC"}
@@ -1466,6 +1466,7 @@ export const FRAMEWORK_CANDIDATES = [
1466
1466
  "React.ReactElement):",
1467
1467
  "React.ReactElement,",
1468
1468
  "React.ReactElement;",
1469
+ "React.ReactElement<{",
1469
1470
  "React.ReactNode",
1470
1471
  "React.ReactNode);",
1471
1472
  "React.ReactNode;",
@@ -2136,6 +2137,7 @@ export const FRAMEWORK_CANDIDATES = [
2136
2137
  "assertEquals(nonce,",
2137
2138
  "assertEquals(preventDefaultCalls,",
2138
2139
  "assertEquals(removedExport",
2140
+ "assertEquals(script.includes(",
2139
2141
  "assertEquals(second.type,",
2140
2142
  "assertEquals(selectCalls,",
2141
2143
  "assertEquals(submitButton.className.includes(",
@@ -2149,6 +2151,7 @@ export const FRAMEWORK_CANDIDATES = [
2149
2151
  "assertExists(third);",
2150
2152
  "assertStringIncludes",
2151
2153
  "assertStringIncludes(html,",
2154
+ "assertStringIncludes(script,",
2152
2155
  "assistant",
2153
2156
  "assistant:",
2154
2157
  "assistant?:",
@@ -2518,6 +2521,7 @@ export const FRAMEWORK_CANDIDATES = [
2518
2521
  "code}",
2519
2522
  "code}</pre>",
2520
2523
  "color",
2524
+ "color-mode",
2521
2525
  "color-mode.tsx",
2522
2526
  "color-scheme",
2523
2527
  "color-scheme:",
@@ -2687,6 +2691,7 @@ export const FRAMEWORK_CANDIDATES = [
2687
2691
  "d:",
2688
2692
  "d=",
2689
2693
  "d=document.documentElement;${applyAttribute};d.style.colorScheme=r}catch(e){}})()",
2694
+ "dangerouslySetInnerHTML:",
2690
2695
  "dangerouslySetInnerHTML={{",
2691
2696
  "dark",
2692
2697
  "dark)",
@@ -2739,10 +2744,10 @@ export const FRAMEWORK_CANDIDATES = [
2739
2744
  "defaultChatTheme,",
2740
2745
  "defaultChatTheme:",
2741
2746
  "defaultMode",
2747
+ "defaultMode:",
2742
2748
  "defaultMode;",
2743
2749
  "defaultMode=",
2744
2750
  "defaultMode?:",
2745
- "defaultMode}",
2746
2751
  "defaultObj",
2747
2752
  "defaultObj[key];",
2748
2753
  "defaultTheme",
@@ -2921,6 +2926,7 @@ export const FRAMEWORK_CANDIDATES = [
2921
2926
  "element.getAttribute(",
2922
2927
  "element.nonce",
2923
2928
  "element.props,",
2929
+ "element.props.dangerouslySetInnerHTML.__html;",
2924
2930
  "element.type}-${index}",
2925
2931
  "element:",
2926
2932
  "elements",
@@ -2929,6 +2935,7 @@ export const FRAMEWORK_CANDIDATES = [
2929
2935
  "else",
2930
2936
  "embedded",
2931
2937
  "embedded:",
2938
+ "embedding",
2932
2939
  "empty",
2933
2940
  "empty.",
2934
2941
  "emptyState",
@@ -2970,6 +2977,7 @@ export const FRAMEWORK_CANDIDATES = [
2970
2977
  "escapeHtml",
2971
2978
  "escapeHtml(jsonStr);",
2972
2979
  "escaped",
2980
+ "escapes",
2973
2981
  "eslint-disable-next-line",
2974
2982
  "etc.",
2975
2983
  "etc.,",
@@ -3584,6 +3592,8 @@ export const FRAMEWORK_CANDIDATES = [
3584
3592
  "its",
3585
3593
  "join(",
3586
3594
  "joins",
3595
+ "jsonForInlineScript",
3596
+ "jsonForInlineScript(defaultMode)",
3587
3597
  "jsonStr",
3588
3598
  "justify-between",
3589
3599
  "justify-center",
@@ -3731,7 +3741,7 @@ export const FRAMEWORK_CANDIDATES = [
3731
3741
  "m21.44",
3732
3742
  "m5",
3733
3743
  "m;var",
3734
- "m=localStorage.getItem(",
3744
+ "m=localStorage.getItem(${jsonForInlineScript(storageKey)})||${",
3735
3745
  "makeMessage([",
3736
3746
  "makeMessage(parts:",
3737
3747
  "managed",
@@ -4804,6 +4814,8 @@ export const FRAMEWORK_CANDIDATES = [
4804
4814
  "score?:",
4805
4815
  "script",
4806
4816
  "script.getAttribute(",
4817
+ "script><script>alert(1)</script>",
4818
+ "script><script>alert(1)</script>//",
4807
4819
  "script[nonce],",
4808
4820
  "script}",
4809
4821
  "scroll",
@@ -5139,10 +5151,10 @@ export const FRAMEWORK_CANDIDATES = [
5139
5151
  "stopChat]);",
5140
5152
  "stopChat],",
5141
5153
  "stop}",
5154
+ "storage",
5142
5155
  "storageKey",
5143
5156
  "storageKey={storageKey}>",
5144
5157
  "storageKey?:",
5145
- "storageKey}",
5146
5158
  "streaming",
5147
5159
  "streaming.",
5148
5160
  "strict",
@@ -5545,6 +5557,8 @@ export const FRAMEWORK_CANDIDATES = [
5545
5557
  "typeof",
5546
5558
  "types",
5547
5559
  "typing",
5560
+ "u003c/script",
5561
+ "u003e",
5548
5562
  "unavailable",
5549
5563
  "unavailable,",
5550
5564
  "undefined",
@@ -5715,6 +5729,7 @@ export const FRAMEWORK_CANDIDATES = [
5715
5729
  "veryfront/testing/bdd.ts",
5716
5730
  "veryfront/utils/clsx.ts",
5717
5731
  "veryfront/utils/html-escape.ts",
5732
+ "vf",
5718
5733
  "vf-color-mode",
5719
5734
  "vf-color-mode-test-${crypto.randomUUID()}",
5720
5735
  "vf-head-style{color:red}",
@@ -6,4 +6,4 @@
6
6
  * @module
7
7
  */
8
8
  export const CLIENT_BOOT_BUNDLE = 'var ot=Object.defineProperty;var nt=(t,e,o)=>e in t?ot(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var m=(t,e,o)=>nt(t,typeof e!="symbol"?e+"":e,o);var st="3.2.3";function it(t,e,o,n){let s=[];if(n?.external?.length&&s.push(`external=${n.external.join(",")}`),s.push(`target=${n?.target??"es2022"}`),n?.deps){let d=Object.entries(n.deps).map(([l,p])=>`${l}@${p}`).join(",");s.push(`deps=${d}`)}let u=e?`@${e}`:"",c=o??"",i=s.length?`?${s.join("&")}`:"";return`https://esm.sh/${t}${u}${c}${i}`}function R(t,e,o,n=!1){return it(t,e,o,{external:n?["react"]:void 0,deps:{csstype:st}})}var ct="19.2.4",E=ct;function w(t=E){return{react:R("react",t),"react-dom":R("react-dom",t,void 0,!0),"react-dom/client":R("react-dom",t,"/client",!0),"react-dom/server":R("react-dom",t,"/server",!0),"react/jsx-runtime":R("react",t,"/jsx-runtime",!0),"react/jsx-dev-runtime":R("react",t,"/jsx-dev-runtime",!0)}}function V(t=E){return w(t).react}function H(t=E){return w(t)["react-dom/client"]}function lt(t){return t.replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}function D(t){return lt(btoa(t))}var Tr=Object.freeze({react:"","react-dom":"","react-dom/client":"","react-dom/server":"","react/jsx-runtime":"","react/jsx-dev-runtime":""});function v(t,e){if(!e)return!1;if(Object.prototype.hasOwnProperty.call(e,t))return!0;for(let o of Object.keys(e))if(o.endsWith("/")&&t.startsWith(o))return!0;return!1}function ut(t){try{return JSON.parse(t)?.imports??{}}catch{return{}}}function F(t=document){let e=t.querySelector(\'script[type="importmap"]\');return e?.textContent?ut(e.textContent):{}}var a="/_veryfront",b={RSC:`${a}/rsc/`,FS:`${a}/fs/`,MODULES:`${a}/modules/`,PAGES:`${a}/pages/`,DATA:`${a}/data/`,LIB:`${a}/lib/`,CHUNKS:`${a}/chunks/`,CLIENT:`${a}/client/`},G={HMR_RUNTIME:`${a}/hmr-runtime.js`,HMR:`${a}/hmr.js`,ERROR_OVERLAY:`${a}/error-overlay.js`,DEV_LOADER:`${a}/dev-loader.js`,CLIENT_LOG:`${a}/log`,CLIENT_JS:`${a}/client.js`,ROUTER_JS:`${a}/router.js`,PREFETCH_JS:`${a}/prefetch.js`,MANIFEST_JSON:`${a}/manifest.json`,APP_JS:`${a}/app.js`,RSC_CLIENT:`${a}/rsc/client.js`,RSC_MANIFEST:`${a}/rsc/manifest`,RSC_STREAM:`${a}/rsc/stream`,RSC_PAYLOAD:`${a}/rsc/payload`,RSC_RENDER:`${a}/rsc/render`,RSC_PAGE:`${a}/rsc/page`,RSC_MODULE:`${a}/rsc/module`,RSC_DOM:`${a}/rsc/dom.js`,LIB_CHAT_REACT:`${a}/lib/chat/react.js`,LIB_CHAT_COMPONENTS:`${a}/lib/chat/components.js`,LIB_CHAT_PRIMITIVES:`${a}/lib/chat/primitives.js`};var dt={ROOT:".veryfront",CACHE:".veryfront/cache",KV:".veryfront/kv",LOGS:".veryfront/logs",TMP:".veryfront/tmp"},Nr=dt.CACHE;var Dr={HMR_RUNTIME:G.HMR_RUNTIME,ERROR_OVERLAY:G.ERROR_OVERLAY};var y=b.RSC,k=b.FS,$="veryfront-hydration-data",_="rsc-root";function T(t=document){try{let e=t.getElementById($);return e?JSON.parse(e.textContent||"{}"):null}catch(e){return console.debug?.("[RSC] hydration data parse failed",e),null}}function C(t){return t?.clientModuleStrategy?t.clientModuleStrategy:t?.dev?"fs":"rsc-module"}function pt(t){return`${k}${D(t)}.js`}function mt(t,e){let o=e?`&v=${encodeURIComponent(e)}`:"";return`${y}module?rel=${encodeURIComponent(t)}${o}`}function I(t){if(t.strategy==="fs"){let e=t.absPath??t.rel;return e?pt(e):null}return mt(t.rel,t.version)}function O(t=document,e=E){let o=F(t);return{react:v("react",o)?"react":V(e),reactDomClient:v("react-dom/client",o)?"react-dom/client":H(e)}}function r(t){return{...t,create(e){return new M(e?.message||e?.detail||t.title,{slug:t.slug,category:t.category,status:e?.status??t.status,title:t.title,suggestion:t.suggestion,detail:e?.detail,cause:e?.cause,instance:e?.instance,context:e?.context})}}}var M=class extends Error{constructor(o,n){super(o);m(this,"slug");m(this,"category");m(this,"status");m(this,"title");m(this,"suggestion");m(this,"detail");m(this,"cause");m(this,"instance");m(this,"context");this.name="VeryfrontError",this.slug=n.slug,this.category=n.category,this.status=n.status,this.title=n.title,this.suggestion=n.suggestion,this.detail=n.detail,this.cause=n.cause,this.instance=n.instance,this.context=n.context}toRFC9457(){return{type:`https://veryfront.com/docs/errors/${this.slug}`,title:this.title,status:this.status,detail:this.detail,instance:this.instance,category:this.category,suggestion:this.suggestion,cause:typeof this.cause=="string"?this.cause:void 0}}getDocsUrl(){return`https://veryfront.com/docs/errors/${this.slug}`}};var Rt=r({slug:"config-not-found",category:"CONFIG",status:404,title:"Configuration file not found",suggestion:"Run \'vf init\' to create a configuration file"}),ft=r({slug:"config-invalid",category:"CONFIG",status:400,title:"Invalid configuration format",suggestion:"Check your veryfront.config.ts for syntax errors"}),Et=r({slug:"config-parse-error",category:"CONFIG",status:400,title:"Failed to parse configuration",suggestion:"Ensure your configuration file is valid TypeScript/JSON"}),yt=r({slug:"config-validation-error",category:"CONFIG",status:422,title:"Configuration validation failed",suggestion:"Check the configuration against the schema requirements"}),_t=r({slug:"config-type-error",category:"CONFIG",status:400,title:"Configuration type mismatch",suggestion:"Ensure configuration values match expected types"}),ht=r({slug:"import-map-invalid",category:"CONFIG",status:400,title:"Invalid import map configuration",suggestion:"Check your import map syntax and paths"}),St=r({slug:"cors-config-invalid",category:"CONFIG",status:400,title:"Invalid CORS configuration",suggestion:"Review CORS settings in your configuration"}),xt=r({slug:"config-validation-failed",category:"CONFIG",status:400,title:"Configuration validation failed",suggestion:"Check configuration values against requirements"}),Y={"config-not-found":Rt,"config-invalid":ft,"config-parse-error":Et,"config-validation-error":yt,"config-type-error":_t,"import-map-invalid":ht,"cors-config-invalid":St,"config-validation-failed":xt};var Tt=r({slug:"build-failed",category:"BUILD",status:500,title:"Build process failed",suggestion:"Check the build output for specific errors"}),Ct=r({slug:"bundle-error",category:"BUILD",status:500,title:"Bundle generation failed",suggestion:"Review bundler output for details"}),It=r({slug:"typescript-error",category:"BUILD",status:500,title:"TypeScript compilation error",suggestion:"Fix TypeScript errors shown in the output"}),Ot=r({slug:"mdx-compile-error",category:"BUILD",status:500,title:"MDX compilation failed",suggestion:"Check your MDX file syntax"}),At=r({slug:"asset-optimization-error",category:"BUILD",status:500,title:"Asset optimization failed",suggestion:"Check asset file formats and paths"}),Nt=r({slug:"ssg-generation-error",category:"BUILD",status:500,title:"Static site generation failed",suggestion:"Review SSG configuration and data fetching"}),Dt=r({slug:"sourcemap-error",category:"BUILD",status:500,title:"Source map generation failed",suggestion:"Check source map configuration"}),vt=r({slug:"compilation-error",category:"BUILD",status:500,title:"Compilation failed",suggestion:"Review compiler output for specific errors"}),B={"build-failed":Tt,"bundle-error":Ct,"typescript-error":It,"mdx-compile-error":Ot,"asset-optimization-error":At,"ssg-generation-error":Nt,"sourcemap-error":Dt,"compilation-error":vt};var bt=r({slug:"hydration-mismatch",category:"RUNTIME",status:500,title:"Client/server hydration mismatch",suggestion:"Ensure server and client render the same content"}),Mt=r({slug:"render-error",category:"RUNTIME",status:500,title:"Component render failed",suggestion:"Check component for runtime errors"}),Lt=r({slug:"component-error",category:"RUNTIME",status:500,title:"Component execution error",suggestion:"Review component logic and props"}),Ut=r({slug:"layout-not-found",category:"RUNTIME",status:404,title:"Layout component not found",suggestion:"Ensure layout file exists at the expected path"}),Pt=r({slug:"page-not-found",category:"RUNTIME",status:404,title:"Page component not found",suggestion:"Check that the page file exists in the routes directory"}),wt=r({slug:"api-error",category:"RUNTIME",status:500,title:"API route handler error",suggestion:"Review API route handler for errors"}),Vt=r({slug:"middleware-error",category:"RUNTIME",status:500,title:"Middleware execution error",suggestion:"Check middleware function for errors"}),j={"hydration-mismatch":bt,"render-error":Mt,"component-error":Lt,"layout-not-found":Ut,"page-not-found":Pt,"api-error":wt,"middleware-error":Vt};var Ht=r({slug:"route-conflict",category:"ROUTE",status:409,title:"Conflicting route definitions",suggestion:"Rename or reorganize conflicting route files"}),Ft=r({slug:"invalid-route-file",category:"ROUTE",status:400,title:"Invalid route file structure",suggestion:"Ensure route file exports required functions"}),Gt=r({slug:"route-handler-invalid",category:"ROUTE",status:400,title:"Invalid route handler export",suggestion:"Export a valid handler function from the route file"}),kt=r({slug:"dynamic-route-error",category:"ROUTE",status:500,title:"Dynamic route parsing failed",suggestion:"Check dynamic route segment syntax"}),$t=r({slug:"route-params-error",category:"ROUTE",status:400,title:"Route parameters invalid",suggestion:"Validate route parameter values"}),Yt=r({slug:"api-route-error",category:"ROUTE",status:500,title:"API route definition error",suggestion:"Review API route configuration"}),W={"route-conflict":Ht,"invalid-route-file":Ft,"route-handler-invalid":Gt,"dynamic-route-error":kt,"route-params-error":$t,"api-route-error":Yt};var Bt=r({slug:"module-not-found",category:"MODULE",status:404,title:"Module could not be resolved",suggestion:"Check the import path and ensure the module is installed"}),jt=r({slug:"import-resolution-error",category:"MODULE",status:500,title:"Import path resolution failed",suggestion:"Verify import paths and module configuration"}),Wt=r({slug:"circular-dependency",category:"MODULE",status:500,title:"Circular dependency detected",suggestion:"Refactor imports to break the circular dependency"}),qt=r({slug:"invalid-import",category:"MODULE",status:400,title:"Invalid import statement",suggestion:"Fix import syntax or path"}),zt=r({slug:"dependency-missing",category:"MODULE",status:404,title:"Required dependency not installed",suggestion:"Install the missing dependency with your package manager"}),Xt=r({slug:"version-mismatch",category:"MODULE",status:409,title:"Dependency version mismatch",suggestion:"Update dependencies to compatible versions"}),q={"module-not-found":Bt,"import-resolution-error":jt,"circular-dependency":Wt,"invalid-import":qt,"dependency-missing":zt,"version-mismatch":Xt};var Jt=r({slug:"port-in-use",category:"SERVER",status:409,title:"Server port already in use",suggestion:"Use a different port or stop the process using this port"}),Kt=r({slug:"server-start-error",category:"SERVER",status:500,title:"Server failed to start",suggestion:"Check server configuration and port availability"}),Zt=r({slug:"cache-error",category:"SERVER",status:500,title:"Cache operation failed",suggestion:"Clear the cache and try again"}),Qt=r({slug:"file-watch-error",category:"SERVER",status:500,title:"File watcher error",suggestion:"Restart the development server"}),te=r({slug:"request-error",category:"SERVER",status:500,title:"HTTP request handling error",suggestion:"Check request handler and middleware"}),ee=r({slug:"service-overloaded",category:"SERVER",status:503,title:"Service overloaded",suggestion:"Reduce load or scale up resources"}),re=r({slug:"semaphore-timeout",category:"SERVER",status:503,title:"Semaphore acquire timeout",suggestion:"Reduce concurrency or increase the semaphore acquire timeout"}),oe=r({slug:"circuit-breaker-open",category:"SERVER",status:503,title:"Circuit breaker is open",suggestion:"Wait for the breaker reset timeout before retrying"}),ne=r({slug:"cache-path-mismatch",category:"SERVER",status:500,title:"Cache path mismatch",suggestion:"Clear the cache directory and rebuild"}),se=r({slug:"network-error",category:"SERVER",status:502,title:"Network operation failed",suggestion:"Check network connectivity and retry"}),ie=r({slug:"api-client-error",category:"SERVER",status:500,title:"API client request failed",suggestion:"Check API connectivity and authentication"}),ae=r({slug:"token-storage-error",category:"SERVER",status:500,title:"Token storage operation failed",suggestion:"Check token storage backend and credentials"}),ce=r({slug:"cache-invariant-violation",category:"SERVER",status:500,title:"Cache path invariant violated",suggestion:"Clear the cache and rebuild"}),le=r({slug:"release-not-found",category:"SERVER",status:404,title:"No active release found",suggestion:"Deploy the project to create a release for this environment"}),ue=r({slug:"fallback-exhausted",category:"SERVER",status:500,title:"Primary and fallback operations both failed",suggestion:"Check service availability and connectivity"}),z={"port-in-use":Jt,"server-start-error":Kt,"cache-error":Zt,"file-watch-error":Qt,"request-error":te,"service-overloaded":ee,"semaphore-timeout":re,"circuit-breaker-open":oe,"cache-path-mismatch":ne,"network-error":se,"api-client-error":ie,"token-storage-error":ae,"cache-invariant-violation":ce,"release-not-found":le,"fallback-exhausted":ue};var ge=r({slug:"client-boundary-violation",category:"BOUNDARY",status:400,title:"Client boundary rule violation",suggestion:"Add \'use client\' directive or move code to a client component"}),de=r({slug:"server-only-in-client",category:"BOUNDARY",status:400,title:"Server-only code in client component",suggestion:"Move server-only code to a server component"}),pe=r({slug:"client-only-in-server",category:"BOUNDARY",status:400,title:"Client-only code in server component",suggestion:"Move client-only code to a client component"}),me=r({slug:"invalid-use-client",category:"BOUNDARY",status:400,title:"Invalid \'use client\' directive",suggestion:"Place \'use client\' at the top of the file"}),Re=r({slug:"invalid-use-server",category:"BOUNDARY",status:400,title:"Invalid \'use server\' directive",suggestion:"Place \'use server\' at the top of the file or function"}),fe=r({slug:"rsc-payload-error",category:"BOUNDARY",status:500,title:"RSC payload serialization error",suggestion:"Ensure props are serializable (no functions, symbols, etc.)"}),X={"client-boundary-violation":ge,"server-only-in-client":de,"client-only-in-server":pe,"invalid-use-client":me,"invalid-use-server":Re,"rsc-payload-error":fe};var Ee=r({slug:"hmr-error",category:"DEV",status:500,title:"Hot module replacement error",suggestion:"Restart the development server"}),ye=r({slug:"dev-server-error",category:"DEV",status:500,title:"Development server error",suggestion:"Check the dev server logs and restart"}),_e=r({slug:"fast-refresh-error",category:"DEV",status:500,title:"Fast refresh failed",suggestion:"Save the file again or restart the dev server"}),he=r({slug:"error-overlay-error",category:"DEV",status:500,title:"Error overlay failed",suggestion:"Check browser console for details"}),Se=r({slug:"source-map-error",category:"DEV",status:500,title:"Source map loading error",suggestion:"Rebuild or clear cache"}),J={"hmr-error":Ee,"dev-server-error":ye,"fast-refresh-error":_e,"error-overlay-error":he,"source-map-error":Se};var xe=r({slug:"deployment-error",category:"DEPLOY",status:500,title:"Deployment process failed",suggestion:"Check deployment logs for details"}),Te=r({slug:"platform-error",category:"DEPLOY",status:500,title:"Platform-specific error",suggestion:"Check platform documentation and requirements"}),Ce=r({slug:"env-var-missing",category:"DEPLOY",status:500,title:"Required environment variable missing",suggestion:"Set the required environment variable"}),Ie=r({slug:"production-build-required",category:"DEPLOY",status:400,title:"Production build required",suggestion:"Run \'vf build\' before deploying"}),K={"deployment-error":xe,"platform-error":Te,"env-var-missing":Ce,"production-build-required":Ie};var Oe=r({slug:"agent-error",category:"AGENT",status:500,title:"Agent operation error",suggestion:"Check agent configuration and logs"}),Ae=r({slug:"agent-not-found",category:"AGENT",status:404,title:"Agent not found",suggestion:"Verify the agent ID exists"}),Ne=r({slug:"agent-timeout",category:"AGENT",status:408,title:"Agent operation timed out",suggestion:"Increase timeout or simplify the request"}),De=r({slug:"agent-intent-error",category:"AGENT",status:400,title:"Agent intent parsing error",suggestion:"Rephrase the request more clearly"}),ve=r({slug:"orchestration-error",category:"AGENT",status:500,title:"Multi-agent orchestration error",suggestion:"Check agent coordination logic"}),be=r({slug:"cost-limit-exceeded",category:"AGENT",status:429,title:"Cost limit exceeded",suggestion:"Wait for the budget period to reset or increase the limit"}),Z={"agent-error":Oe,"agent-not-found":Ae,"agent-timeout":Ne,"agent-intent-error":De,"orchestration-error":ve,"cost-limit-exceeded":be};var Me=r({slug:"unknown-error",category:"GENERAL",status:500,title:"Unknown/unclassified error",suggestion:"Check logs for more details"}),Le=r({slug:"permission-denied",category:"GENERAL",status:403,title:"File/resource permission denied",suggestion:"Check file permissions and access rights"}),Ue=r({slug:"file-not-found",category:"GENERAL",status:404,title:"File not found",suggestion:"Verify the file path exists"}),Pe=r({slug:"resource-not-found",category:"GENERAL",status:404,title:"Requested resource not found",suggestion:"Verify the referenced resource ID or name exists"}),we=r({slug:"invalid-argument",category:"GENERAL",status:400,title:"Invalid function argument",suggestion:"Check argument types and values"}),Ve=r({slug:"timeout-error",category:"GENERAL",status:408,title:"Operation timed out",suggestion:"Increase timeout or optimize the operation"}),He=r({slug:"initialization-error",category:"GENERAL",status:500,title:"Initialization failed",suggestion:"Check initialization requirements and dependencies"}),Fe=r({slug:"not-supported",category:"GENERAL",status:501,title:"Feature not supported",suggestion:"Check documentation for supported features"}),L=r({slug:"security-violation",category:"GENERAL",status:403,title:"Security violation detected",suggestion:"Check for path traversal or unauthorized access attempts"}),Ge=r({slug:"input-validation-failed",category:"GENERAL",status:400,title:"Input validation failed",suggestion:"Check request input against validation rules"}),Q={"unknown-error":Me,"permission-denied":Le,"file-not-found":Ue,"resource-not-found":Pe,"invalid-argument":we,"timeout-error":Ve,"initialization-error":He,"not-supported":Fe,"security-violation":L,"input-validation-failed":Ge};var Ao={...Y,...B,...j,...W,...q,...z,...X,...J,...K,...Z,...Q};var ke=[{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 $e(){return ke.map(({source:t,flags:e,name:o})=>({pattern:new RegExp(t,e),name:o}))}function Ye(){let t=globalThis;return t.__VERYFRONT_DEV__===!0||t.Deno?.env?.get?.("VERYFRONT_ENV")==="development"}function h(t,e={}){let{strict:o=!1,warn:n=!0}=e;for(let{pattern:s,name:u}of $e())if(s.lastIndex=0,!!s.test(t)&&(n&&console.warn(`[Security] Suspicious ${u} detected in server HTML`),o||!Ye()))throw L.create({detail:`Potentially unsafe HTML: ${u} detected`});return t}var f=class{constructor(e,o){this.prefix=e;this.level=o}log(e,o,n,...s){this.level>e||o?.(n,...s)}debug(e,...o){this.log(0,console.debug,`[${this.prefix}] DEBUG: ${e}`,...o)}info(e,...o){this.log(1,console.log,`[${this.prefix}] ${e}`,...o)}warn(e,...o){this.log(2,console.warn,`[${this.prefix}] WARN: ${e}`,...o)}error(e,...o){this.log(3,console.error,`[${this.prefix}] ERROR: ${e}`,...o)}};function Be(){if(typeof window>"u")return 2;let t=globalThis;return t.__VERYFRONT_DEV__||t.__RSC_DEV__?t.__VERYFRONT_DEBUG__||t.__RSC_DEBUG__?0:1:2}var A=Be(),g=new f("RSC",A),Bo=new f("PREFETCH",A),jo=new f("HYDRATE",A),Wo=new f("VERYFRONT",A);function S(t,e){let o=e==="root"?_:`rsc-slot-${e}`,n=t.getElementById(o);if(n)return n;let s=t.createElement("div");return s.id=o,t.body.appendChild(s),s}function je(t,e){if(e.type!=="slot")return;let o=S(t,e.id);o.innerHTML=h(String(e.html??""))}function tt(t,e){let o=e.split(`\n`),n=o.pop()??"";for(let s of o){let u=s.trim();if(!u)continue;let c;try{c=JSON.parse(u)}catch(d){g.debug("[client-dom] malformed NDJSON line",{line:u,error:d instanceof Error?d.message:String(d)});continue}if(!c||typeof c!="object")continue;let i=c;if(i.type==="slot"){je(t,i);try{ze(t,i.id||"root")}catch(d){g.debug("[client-dom] hydration optional failed",d)}}}return n}function We(t){return new Promise((e,o)=>{let n=()=>o(new DOMException("aborted","AbortError"));if(t.aborted){n();return}t.addEventListener("abort",n,{once:!0})})}async function et(t,e=document,o){let n="body"in t?t:null,s=n?.body??t;if(!s)return;let u=s.getReader(),c=new TextDecoder,i="",d=!1;try{for(;;){if(o?.aborted)throw new DOMException("aborted","AbortError");let l=u.read(),{done:p,value:x}=o?await Promise.race([l,We(o)]):await l;if(p){d=!0;break}i+=c.decode(x,{stream:!0}),i=tt(e,i)}i&&tt(e,`${i}\n`)}catch(l){throw l instanceof Error&&l.name==="AbortError"||g.debug("[client-dom] consumeNdjsonStream error",l),l}finally{try{await u.cancel()}catch(l){d||g.debug("[client-dom] reader.cancel failed",l)}try{u.releaseLock()}catch(l){g.debug("[client-dom] reader.releaseLock failed",l)}if(typeof s.cancel=="function")try{await s.cancel()}catch(l){g.debug("[client-dom] stream.cancel failed",l)}if(typeof n?.body?.cancel=="function")try{await n.body.cancel()}catch(l){g.debug("[client-dom] response.body.cancel failed",l)}}}function qe(t,e){let o=S(t,e),n=[],s=u=>{let c=u;c.dataset?.clientRef&&n.push(c);for(let i of u.children)s(i)};return s(o),n}function ze(t,e){let o=qe(t,e);for(let n of o){let s=n.dataset?.clientRef;s&&(n.dataset.hydrated="true",g.debug("[client-dom] marked for hydration",s))}}var Xe=100;function Je(t,e){if(globalThis.__VF_CLIENT_MOD_CACHE??(globalThis.__VF_CLIENT_MOD_CACHE=new Map),globalThis.__VF_CLIENT_MOD_CACHE.size>=Xe){let o=globalThis.__VF_CLIENT_MOD_CACHE.keys().next().value;o&&globalThis.__VF_CLIENT_MOD_CACHE.delete(o)}globalThis.__VF_CLIENT_MOD_CACHE.set(t,e)}function Ke(t){let e=t.match(/^\\/app\\/(.+)#([A-Za-z0-9_]+)$/);return e?{rel:`/${e[1]||""}`,exportName:e[2]||"default"}:null}async function Ze(){try{let t=await fetch("/_veryfront/rsc/manifest");return t.ok?await t.json():null}catch{return null}}async function Qe(t,e,o){let n=t.graphIds?.client.find(c=>c.rel===e)?.path,s=`${e}#${t.hash??""}`;try{let c=globalThis.__VF_CLIENT_MOD_CACHE?.get(s);if(c)return c}catch(c){g.debug("hydrate: cache get failed",c)}let u=I({strategy:o,rel:e,absPath:n,version:t.hash});if(!u)return null;try{let c=await import(u);try{Je(s,c)}catch(i){g.debug("hydrate: cache set failed",i)}return c}catch(c){return g.debug("hydrate: failed to import module",{moduleUrl:u,error:c}),null}}async function rt(t=document){let e=null;try{e=await Ze()}catch(i){g.debug("hydrate: fetch manifest failed",i)}if(!e){g.debug("hydrate: no manifest");return}let o=Array.from(t.querySelectorAll("[data-client-ref]"));try{let i=globalThis.__VF_MANIFEST_HASH;if(!o.some(l=>l.dataset?.hydrated!=="true")&&i&&e.hash&&i===e.hash)return}catch(i){g.debug("hydrate: hmr hash read failed",i)}if(o.length===0){try{globalThis.__VF_MANIFEST_HASH=e.hash??""}catch(i){g.debug("hydrate: set hash failed",i)}return}let n=C(T(t));try{if(globalThis.__VF_TEST_MODE__){globalThis.__VF_HYDRATE_CALLED=!0,globalThis.__VF_MANIFEST_HASH=e.hash??"";return}}catch(i){g.debug("hydrate: test mode flags failed",i)}let s=O(t),[{default:u},{createRoot:c}]=await Promise.all([import(s.react),import(s.reactDomClient)]);for(let i of o){let d=i.dataset?.clientRef??"";if(!d||i.dataset?.hydrated==="true")continue;let l=Ke(d);if(!l)continue;let p=await Qe(e,l.rel,n);if(!p)continue;let x=p[l.exportName]??p.default;if(typeof x=="function")try{c(i).render(u.createElement(x,{})),i.dataset.hydrated="true"}catch(P){g.warn("hydrate: render failed",P)}}try{globalThis.__VF_MANIFEST_HASH=e.hash??""}catch(i){g.debug("hydrate: set hash failed (post)",i)}}async function tr(){let t=O(document),[e,o]=await Promise.all([import(t.react),import(t.reactDomClient)]);return{React:e,ReactDOM:o}}var er=new Set(["SCRIPT","STYLE","NOSCRIPT","TEMPLATE"]);function U(t){let e=t.getAttribute("style")??"";return t.hasAttribute("data-veryfront-head")||t.hasAttribute("hidden")||/(?:^|;)\\s*display\\s*:\\s*none(?:\\s*;|$)/i.test(e)||er.has(t.tagName.toUpperCase())}function rr(t,e){return t.find(o=>o.tagName.toUpperCase()==="DIV"&&!!o.getAttribute("class")?.trim()&&!U(o))??e}function or(t,e){return t===e}function nr(t,e){let o=document.createElement("div");o.setAttribute("data-veryfront-hydration-root","page");let n=t.find(s=>!U(s));n?.parentNode===e?e.insertBefore(o,n):e.appendChild(o);for(let s of t)!U(s)&&s.parentNode===e&&o.appendChild(s);return o}function sr(t,e,o=document){return!!e?.pagePath&&typeof t?.__veryfrontRenderPage=="function"&&!!o.getElementById("root")}function ir(t,e){return e?.pagePath?!1:!!t.getElementById(_)}function ar(t=import.meta.url){try{return new URL(t,"http://veryfront.local").searchParams.get("hydrate")==="1"}catch{return!1}}function cr(t){return t==="rsc-module"}async function lr(t){try{let e=await fetch(y+"stream"+t);if(!e.ok||!e.body)return!1;let o=new AbortController;return addEventListener("pagehide",()=>o.abort(),{once:!0}),await et(e,document,o.signal),!0}catch(e){return console.debug?.("[RSC] tryStream failed",e),!1}}async function N(){try{await rt(document)}catch(t){console.debug?.("[RSC] hydration failed",t)}}async function ur(t,e){try{let{React:o,ReactDOM:n}=await tr(),s=I({strategy:e,rel:t});if(!s)return!1;console.debug?.("[RSC] Loading component from:",s);let c=(await import(s)).default;if(typeof c!="function")return console.debug?.("[RSC] Page component is not a function"),!1;let i=Array.from(document.body.children),d=rr(i,document.body),l=or(d,document.body)?nr(i,document.body):d,p=o.createElement(c,{});return cr(e)?n.createRoot(l).render(p):n.hydrateRoot(l,p,{identifierPrefix:"vf",onRecoverableError:()=>{}}),console.debug?.("[RSC] Page component hydrated successfully"),!0}catch(o){return console.error("[RSC] Page hydration failed",o),!1}}async function gr(t){try{let e=await fetch(y+"payload"+t);if(!e.ok)return!1;let o=await e.json();if(o?.slots){for(let[n,s]of Object.entries(o.slots))S(document,n).innerHTML=h(String(s||""));return!0}return S(document,_).innerHTML=h(String(o?.html||"")),!0}catch(e){return console.debug?.("[RSC] payload fetch failed",e),!1}}async function dr(){try{let t=globalThis.window?.location.search??"",e=T(document);if(ar()){await N();return}let o=e?.pagePath,n=C(e);if(o){if(sr(globalThis.window,e,document)){console.debug?.("[RSC] Page renderer owns hydration");return}console.debug?.("[RSC] Found page component in hydration data:",o),await ur(o,n)&&console.debug?.("[RSC] Client component hydrated successfully");return}if(!ir(document,e))return;if(await lr(t)){await N();return}if(await gr(t)){await N();return}await N()}catch(t){console.error("[RSC] boot failed",t)}}if(typeof document<"u"){let t=()=>{dr()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t,{once:!0}):t()}export{dr as boot,rr as selectHydrationRoot,ir as shouldAttemptRSCTransport,ar as shouldHydrateOnly,cr as shouldRenderPageComponent,sr as shouldUsePageRendererHydration,or as shouldWrapPageHydrationRoot};\n';
9
- export const CLIENT_DOM_BUNDLE = 'var G=Object.defineProperty;var F=(r,t,o)=>t in r?G(r,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[t]=o;var l=(r,t,o)=>F(r,typeof t!="symbol"?t+"":t,o);function e(r){return{...r,create(t){return new f(t?.message||t?.detail||r.title,{slug:r.slug,category:r.category,status:t?.status??r.status,title:r.title,suggestion:r.suggestion,detail:t?.detail,cause:t?.cause,instance:t?.instance,context:t?.context})}}}var f=class extends Error{constructor(o,s){super(o);l(this,"slug");l(this,"category");l(this,"status");l(this,"title");l(this,"suggestion");l(this,"detail");l(this,"cause");l(this,"instance");l(this,"context");this.name="VeryfrontError",this.slug=s.slug,this.category=s.category,this.status=s.status,this.title=s.title,this.suggestion=s.suggestion,this.detail=s.detail,this.cause=s.cause,this.instance=s.instance,this.context=s.context}toRFC9457(){return{type:`https://veryfront.com/docs/errors/${this.slug}`,title:this.title,status:this.status,detail:this.detail,instance:this.instance,category:this.category,suggestion:this.suggestion,cause:typeof this.cause=="string"?this.cause:void 0}}getDocsUrl(){return`https://veryfront.com/docs/errors/${this.slug}`}};var k=e({slug:"config-not-found",category:"CONFIG",status:404,title:"Configuration file not found",suggestion:"Run \'vf init\' to create a configuration file"}),w=e({slug:"config-invalid",category:"CONFIG",status:400,title:"Invalid configuration format",suggestion:"Check your veryfront.config.ts for syntax errors"}),Y=e({slug:"config-parse-error",category:"CONFIG",status:400,title:"Failed to parse configuration",suggestion:"Ensure your configuration file is valid TypeScript/JSON"}),H=e({slug:"config-validation-error",category:"CONFIG",status:422,title:"Configuration validation failed",suggestion:"Check the configuration against the schema requirements"}),B=e({slug:"config-type-error",category:"CONFIG",status:400,title:"Configuration type mismatch",suggestion:"Ensure configuration values match expected types"}),$=e({slug:"import-map-invalid",category:"CONFIG",status:400,title:"Invalid import map configuration",suggestion:"Check your import map syntax and paths"}),j=e({slug:"cors-config-invalid",category:"CONFIG",status:400,title:"Invalid CORS configuration",suggestion:"Review CORS settings in your configuration"}),q=e({slug:"config-validation-failed",category:"CONFIG",status:400,title:"Configuration validation failed",suggestion:"Check configuration values against requirements"}),y={"config-not-found":k,"config-invalid":w,"config-parse-error":Y,"config-validation-error":H,"config-type-error":B,"import-map-invalid":$,"cors-config-invalid":j,"config-validation-failed":q};var z=e({slug:"build-failed",category:"BUILD",status:500,title:"Build process failed",suggestion:"Check the build output for specific errors"}),W=e({slug:"bundle-error",category:"BUILD",status:500,title:"Bundle generation failed",suggestion:"Review bundler output for details"}),J=e({slug:"typescript-error",category:"BUILD",status:500,title:"TypeScript compilation error",suggestion:"Fix TypeScript errors shown in the output"}),X=e({slug:"mdx-compile-error",category:"BUILD",status:500,title:"MDX compilation failed",suggestion:"Check your MDX file syntax"}),K=e({slug:"asset-optimization-error",category:"BUILD",status:500,title:"Asset optimization failed",suggestion:"Check asset file formats and paths"}),Z=e({slug:"ssg-generation-error",category:"BUILD",status:500,title:"Static site generation failed",suggestion:"Review SSG configuration and data fetching"}),Q=e({slug:"sourcemap-error",category:"BUILD",status:500,title:"Source map generation failed",suggestion:"Check source map configuration"}),ee=e({slug:"compilation-error",category:"BUILD",status:500,title:"Compilation failed",suggestion:"Review compiler output for specific errors"}),O={"build-failed":z,"bundle-error":W,"typescript-error":J,"mdx-compile-error":X,"asset-optimization-error":K,"ssg-generation-error":Z,"sourcemap-error":Q,"compilation-error":ee};var te=e({slug:"hydration-mismatch",category:"RUNTIME",status:500,title:"Client/server hydration mismatch",suggestion:"Ensure server and client render the same content"}),re=e({slug:"render-error",category:"RUNTIME",status:500,title:"Component render failed",suggestion:"Check component for runtime errors"}),oe=e({slug:"component-error",category:"RUNTIME",status:500,title:"Component execution error",suggestion:"Review component logic and props"}),se=e({slug:"layout-not-found",category:"RUNTIME",status:404,title:"Layout component not found",suggestion:"Ensure layout file exists at the expected path"}),ne=e({slug:"page-not-found",category:"RUNTIME",status:404,title:"Page component not found",suggestion:"Check that the page file exists in the routes directory"}),ie=e({slug:"api-error",category:"RUNTIME",status:500,title:"API route handler error",suggestion:"Review API route handler for errors"}),ae=e({slug:"middleware-error",category:"RUNTIME",status:500,title:"Middleware execution error",suggestion:"Check middleware function for errors"}),T={"hydration-mismatch":te,"render-error":re,"component-error":oe,"layout-not-found":se,"page-not-found":ne,"api-error":ie,"middleware-error":ae};var ce=e({slug:"route-conflict",category:"ROUTE",status:409,title:"Conflicting route definitions",suggestion:"Rename or reorganize conflicting route files"}),ue=e({slug:"invalid-route-file",category:"ROUTE",status:400,title:"Invalid route file structure",suggestion:"Ensure route file exports required functions"}),le=e({slug:"route-handler-invalid",category:"ROUTE",status:400,title:"Invalid route handler export",suggestion:"Export a valid handler function from the route file"}),ge=e({slug:"dynamic-route-error",category:"ROUTE",status:500,title:"Dynamic route parsing failed",suggestion:"Check dynamic route segment syntax"}),pe=e({slug:"route-params-error",category:"ROUTE",status:400,title:"Route parameters invalid",suggestion:"Validate route parameter values"}),Ee=e({slug:"api-route-error",category:"ROUTE",status:500,title:"API route definition error",suggestion:"Review API route configuration"}),I={"route-conflict":ce,"invalid-route-file":ue,"route-handler-invalid":le,"dynamic-route-error":ge,"route-params-error":pe,"api-route-error":Ee};var Re=e({slug:"module-not-found",category:"MODULE",status:404,title:"Module could not be resolved",suggestion:"Check the import path and ensure the module is installed"}),de=e({slug:"import-resolution-error",category:"MODULE",status:500,title:"Import path resolution failed",suggestion:"Verify import paths and module configuration"}),fe=e({slug:"circular-dependency",category:"MODULE",status:500,title:"Circular dependency detected",suggestion:"Refactor imports to break the circular dependency"}),me=e({slug:"invalid-import",category:"MODULE",status:400,title:"Invalid import statement",suggestion:"Fix import syntax or path"}),_e=e({slug:"dependency-missing",category:"MODULE",status:404,title:"Required dependency not installed",suggestion:"Install the missing dependency with your package manager"}),ye=e({slug:"version-mismatch",category:"MODULE",status:409,title:"Dependency version mismatch",suggestion:"Update dependencies to compatible versions"}),x={"module-not-found":Re,"import-resolution-error":de,"circular-dependency":fe,"invalid-import":me,"dependency-missing":_e,"version-mismatch":ye};var Oe=e({slug:"port-in-use",category:"SERVER",status:409,title:"Server port already in use",suggestion:"Use a different port or stop the process using this port"}),Te=e({slug:"server-start-error",category:"SERVER",status:500,title:"Server failed to start",suggestion:"Check server configuration and port availability"}),Ie=e({slug:"cache-error",category:"SERVER",status:500,title:"Cache operation failed",suggestion:"Clear the cache and try again"}),xe=e({slug:"file-watch-error",category:"SERVER",status:500,title:"File watcher error",suggestion:"Restart the development server"}),he=e({slug:"request-error",category:"SERVER",status:500,title:"HTTP request handling error",suggestion:"Check request handler and middleware"}),Se=e({slug:"service-overloaded",category:"SERVER",status:503,title:"Service overloaded",suggestion:"Reduce load or scale up resources"}),Ne=e({slug:"semaphore-timeout",category:"SERVER",status:503,title:"Semaphore acquire timeout",suggestion:"Reduce concurrency or increase the semaphore acquire timeout"}),ve=e({slug:"circuit-breaker-open",category:"SERVER",status:503,title:"Circuit breaker is open",suggestion:"Wait for the breaker reset timeout before retrying"}),Ae=e({slug:"cache-path-mismatch",category:"SERVER",status:500,title:"Cache path mismatch",suggestion:"Clear the cache directory and rebuild"}),Ce=e({slug:"network-error",category:"SERVER",status:502,title:"Network operation failed",suggestion:"Check network connectivity and retry"}),De=e({slug:"api-client-error",category:"SERVER",status:500,title:"API client request failed",suggestion:"Check API connectivity and authentication"}),Le=e({slug:"token-storage-error",category:"SERVER",status:500,title:"Token storage operation failed",suggestion:"Check token storage backend and credentials"}),Ue=e({slug:"cache-invariant-violation",category:"SERVER",status:500,title:"Cache path invariant violated",suggestion:"Clear the cache and rebuild"}),be=e({slug:"release-not-found",category:"SERVER",status:404,title:"No active release found",suggestion:"Deploy the project to create a release for this environment"}),Me=e({slug:"fallback-exhausted",category:"SERVER",status:500,title:"Primary and fallback operations both failed",suggestion:"Check service availability and connectivity"}),h={"port-in-use":Oe,"server-start-error":Te,"cache-error":Ie,"file-watch-error":xe,"request-error":he,"service-overloaded":Se,"semaphore-timeout":Ne,"circuit-breaker-open":ve,"cache-path-mismatch":Ae,"network-error":Ce,"api-client-error":De,"token-storage-error":Le,"cache-invariant-violation":Ue,"release-not-found":be,"fallback-exhausted":Me};var Pe=e({slug:"client-boundary-violation",category:"BOUNDARY",status:400,title:"Client boundary rule violation",suggestion:"Add \'use client\' directive or move code to a client component"}),Ve=e({slug:"server-only-in-client",category:"BOUNDARY",status:400,title:"Server-only code in client component",suggestion:"Move server-only code to a server component"}),Ge=e({slug:"client-only-in-server",category:"BOUNDARY",status:400,title:"Client-only code in server component",suggestion:"Move client-only code to a client component"}),Fe=e({slug:"invalid-use-client",category:"BOUNDARY",status:400,title:"Invalid \'use client\' directive",suggestion:"Place \'use client\' at the top of the file"}),ke=e({slug:"invalid-use-server",category:"BOUNDARY",status:400,title:"Invalid \'use server\' directive",suggestion:"Place \'use server\' at the top of the file or function"}),we=e({slug:"rsc-payload-error",category:"BOUNDARY",status:500,title:"RSC payload serialization error",suggestion:"Ensure props are serializable (no functions, symbols, etc.)"}),S={"client-boundary-violation":Pe,"server-only-in-client":Ve,"client-only-in-server":Ge,"invalid-use-client":Fe,"invalid-use-server":ke,"rsc-payload-error":we};var Ye=e({slug:"hmr-error",category:"DEV",status:500,title:"Hot module replacement error",suggestion:"Restart the development server"}),He=e({slug:"dev-server-error",category:"DEV",status:500,title:"Development server error",suggestion:"Check the dev server logs and restart"}),Be=e({slug:"fast-refresh-error",category:"DEV",status:500,title:"Fast refresh failed",suggestion:"Save the file again or restart the dev server"}),$e=e({slug:"error-overlay-error",category:"DEV",status:500,title:"Error overlay failed",suggestion:"Check browser console for details"}),je=e({slug:"source-map-error",category:"DEV",status:500,title:"Source map loading error",suggestion:"Rebuild or clear cache"}),N={"hmr-error":Ye,"dev-server-error":He,"fast-refresh-error":Be,"error-overlay-error":$e,"source-map-error":je};var qe=e({slug:"deployment-error",category:"DEPLOY",status:500,title:"Deployment process failed",suggestion:"Check deployment logs for details"}),ze=e({slug:"platform-error",category:"DEPLOY",status:500,title:"Platform-specific error",suggestion:"Check platform documentation and requirements"}),We=e({slug:"env-var-missing",category:"DEPLOY",status:500,title:"Required environment variable missing",suggestion:"Set the required environment variable"}),Je=e({slug:"production-build-required",category:"DEPLOY",status:400,title:"Production build required",suggestion:"Run \'vf build\' before deploying"}),v={"deployment-error":qe,"platform-error":ze,"env-var-missing":We,"production-build-required":Je};var Xe=e({slug:"agent-error",category:"AGENT",status:500,title:"Agent operation error",suggestion:"Check agent configuration and logs"}),Ke=e({slug:"agent-not-found",category:"AGENT",status:404,title:"Agent not found",suggestion:"Verify the agent ID exists"}),Ze=e({slug:"agent-timeout",category:"AGENT",status:408,title:"Agent operation timed out",suggestion:"Increase timeout or simplify the request"}),Qe=e({slug:"agent-intent-error",category:"AGENT",status:400,title:"Agent intent parsing error",suggestion:"Rephrase the request more clearly"}),et=e({slug:"orchestration-error",category:"AGENT",status:500,title:"Multi-agent orchestration error",suggestion:"Check agent coordination logic"}),tt=e({slug:"cost-limit-exceeded",category:"AGENT",status:429,title:"Cost limit exceeded",suggestion:"Wait for the budget period to reset or increase the limit"}),A={"agent-error":Xe,"agent-not-found":Ke,"agent-timeout":Ze,"agent-intent-error":Qe,"orchestration-error":et,"cost-limit-exceeded":tt};var rt=e({slug:"unknown-error",category:"GENERAL",status:500,title:"Unknown/unclassified error",suggestion:"Check logs for more details"}),ot=e({slug:"permission-denied",category:"GENERAL",status:403,title:"File/resource permission denied",suggestion:"Check file permissions and access rights"}),st=e({slug:"file-not-found",category:"GENERAL",status:404,title:"File not found",suggestion:"Verify the file path exists"}),nt=e({slug:"resource-not-found",category:"GENERAL",status:404,title:"Requested resource not found",suggestion:"Verify the referenced resource ID or name exists"}),it=e({slug:"invalid-argument",category:"GENERAL",status:400,title:"Invalid function argument",suggestion:"Check argument types and values"}),at=e({slug:"timeout-error",category:"GENERAL",status:408,title:"Operation timed out",suggestion:"Increase timeout or optimize the operation"}),ct=e({slug:"initialization-error",category:"GENERAL",status:500,title:"Initialization failed",suggestion:"Check initialization requirements and dependencies"}),ut=e({slug:"not-supported",category:"GENERAL",status:501,title:"Feature not supported",suggestion:"Check documentation for supported features"}),m=e({slug:"security-violation",category:"GENERAL",status:403,title:"Security violation detected",suggestion:"Check for path traversal or unauthorized access attempts"}),lt=e({slug:"input-validation-failed",category:"GENERAL",status:400,title:"Input validation failed",suggestion:"Check request input against validation rules"}),C={"unknown-error":rt,"permission-denied":ot,"file-not-found":st,"resource-not-found":nt,"invalid-argument":it,"timeout-error":at,"initialization-error":ct,"not-supported":ut,"security-violation":m,"input-validation-failed":lt};var ur={...y,...O,...T,...I,...x,...h,...S,...N,...v,...A,...C};var gt=[{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 pt(){return gt.map(({source:r,flags:t,name:o})=>({pattern:new RegExp(r,t),name:o}))}function Et(){let r=globalThis;return r.__VERYFRONT_DEV__===!0||r.Deno?.env?.get?.("VERYFRONT_ENV")==="development"}function D(r,t={}){let{strict:o=!1,warn:s=!0}=t;for(let{pattern:i,name:c}of pt())if(i.lastIndex=0,!!i.test(r)&&(s&&console.warn(`[Security] Suspicious ${c} detected in server HTML`),o||!Et()))throw m.create({detail:`Potentially unsafe HTML: ${c} detected`});return r}var R=class{constructor(t,o){this.prefix=t;this.level=o}log(t,o,s,...i){this.level>t||o?.(s,...i)}debug(t,...o){this.log(0,console.debug,`[${this.prefix}] DEBUG: ${t}`,...o)}info(t,...o){this.log(1,console.log,`[${this.prefix}] ${t}`,...o)}warn(t,...o){this.log(2,console.warn,`[${this.prefix}] WARN: ${t}`,...o)}error(t,...o){this.log(3,console.error,`[${this.prefix}] ERROR: ${t}`,...o)}};function Rt(){if(typeof window>"u")return 2;let r=globalThis;return r.__VERYFRONT_DEV__||r.__RSC_DEV__?r.__VERYFRONT_DEBUG__||r.__RSC_DEBUG__?0:1:2}var d=Rt(),p=new R("RSC",d),Nr=new R("PREFETCH",d),vr=new R("HYDRATE",d),Ar=new R("VERYFRONT",d);var n="/_veryfront",_={RSC:`${n}/rsc/`,FS:`${n}/fs/`,MODULES:`${n}/modules/`,PAGES:`${n}/pages/`,DATA:`${n}/data/`,LIB:`${n}/lib/`,CHUNKS:`${n}/chunks/`,CLIENT:`${n}/client/`},L={HMR_RUNTIME:`${n}/hmr-runtime.js`,HMR:`${n}/hmr.js`,ERROR_OVERLAY:`${n}/error-overlay.js`,DEV_LOADER:`${n}/dev-loader.js`,CLIENT_LOG:`${n}/log`,CLIENT_JS:`${n}/client.js`,ROUTER_JS:`${n}/router.js`,PREFETCH_JS:`${n}/prefetch.js`,MANIFEST_JSON:`${n}/manifest.json`,APP_JS:`${n}/app.js`,RSC_CLIENT:`${n}/rsc/client.js`,RSC_MANIFEST:`${n}/rsc/manifest`,RSC_STREAM:`${n}/rsc/stream`,RSC_PAYLOAD:`${n}/rsc/payload`,RSC_RENDER:`${n}/rsc/render`,RSC_PAGE:`${n}/rsc/page`,RSC_MODULE:`${n}/rsc/module`,RSC_DOM:`${n}/rsc/dom.js`,LIB_CHAT_REACT:`${n}/lib/chat/react.js`,LIB_CHAT_COMPONENTS:`${n}/lib/chat/components.js`,LIB_CHAT_PRIMITIVES:`${n}/lib/chat/primitives.js`};var ft={ROOT:".veryfront",CACHE:".veryfront/cache",KV:".veryfront/kv",LOGS:".veryfront/logs",TMP:".veryfront/tmp"},br=ft.CACHE;var Mr={HMR_RUNTIME:L.HMR_RUNTIME,ERROR_OVERLAY:L.ERROR_OVERLAY};var Fr=_.RSC,kr=_.FS;var U="rsc-root";function M(r,t){let o=t==="root"?U:`rsc-slot-${t}`,s=r.getElementById(o);if(s)return s;let i=r.createElement("div");return i.id=o,r.body.appendChild(i),i}function mt(r,t){if(t.type!=="slot")return;let o=M(r,t.id);o.innerHTML=D(String(t.html??""))}function b(r,t){let o=t.split(`\n`),s=o.pop()??"";for(let i of o){let c=i.trim();if(!c)continue;let g;try{g=JSON.parse(c)}catch(E){p.debug("[client-dom] malformed NDJSON line",{line:c,error:E instanceof Error?E.message:String(E)});continue}if(!g||typeof g!="object")continue;let u=g;if(u.type==="slot"){mt(r,u);try{Ot(r,u.id||"root")}catch(E){p.debug("[client-dom] hydration optional failed",E)}}}return s}function _t(r){return new Promise((t,o)=>{let s=()=>o(new DOMException("aborted","AbortError"));if(r.aborted){s();return}r.addEventListener("abort",s,{once:!0})})}async function $r(r,t=document,o){let s="body"in r?r:null,i=s?.body??r;if(!i)return;let c=i.getReader(),g=new TextDecoder,u="",E=!1;try{for(;;){if(o?.aborted)throw new DOMException("aborted","AbortError");let a=c.read(),{done:P,value:V}=o?await Promise.race([a,_t(o)]):await a;if(P){E=!0;break}u+=g.decode(V,{stream:!0}),u=b(t,u)}u&&b(t,`${u}\n`)}catch(a){throw a instanceof Error&&a.name==="AbortError"||p.debug("[client-dom] consumeNdjsonStream error",a),a}finally{try{await c.cancel()}catch(a){E||p.debug("[client-dom] reader.cancel failed",a)}try{c.releaseLock()}catch(a){p.debug("[client-dom] reader.releaseLock failed",a)}if(typeof i.cancel=="function")try{await i.cancel()}catch(a){p.debug("[client-dom] stream.cancel failed",a)}if(typeof s?.body?.cancel=="function")try{await s.body.cancel()}catch(a){p.debug("[client-dom] response.body.cancel failed",a)}}}function yt(r,t){let o=M(r,t),s=[],i=c=>{let g=c;g.dataset?.clientRef&&s.push(g);for(let u of c.children)i(u)};return i(o),s}function Ot(r,t){let o=yt(r,t);for(let s of o){let i=s.dataset?.clientRef;i&&(s.dataset.hydrated="true",p.debug("[client-dom] marked for hydration",i))}}export{$r as consumeNdjsonStream,M as getContainer};\n';
9
+ export const CLIENT_DOM_BUNDLE = 'var G=Object.defineProperty;var F=(r,t,o)=>t in r?G(r,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[t]=o;var l=(r,t,o)=>F(r,typeof t!="symbol"?t+"":t,o);function e(r){return{...r,create(t){return new f(t?.message||t?.detail||r.title,{slug:r.slug,category:r.category,status:t?.status??r.status,title:r.title,suggestion:r.suggestion,detail:t?.detail,cause:t?.cause,instance:t?.instance,context:t?.context})}}}var f=class extends Error{constructor(o,n){super(o);l(this,"slug");l(this,"category");l(this,"status");l(this,"title");l(this,"suggestion");l(this,"detail");l(this,"cause");l(this,"instance");l(this,"context");this.name="VeryfrontError",this.slug=n.slug,this.category=n.category,this.status=n.status,this.title=n.title,this.suggestion=n.suggestion,this.detail=n.detail,this.cause=n.cause,this.instance=n.instance,this.context=n.context}toRFC9457(){return{type:`https://veryfront.com/docs/errors/${this.slug}`,title:this.title,status:this.status,detail:this.detail,instance:this.instance,category:this.category,suggestion:this.suggestion,cause:typeof this.cause=="string"?this.cause:void 0}}getDocsUrl(){return`https://veryfront.com/docs/errors/${this.slug}`}};var k=e({slug:"config-not-found",category:"CONFIG",status:404,title:"Configuration file not found",suggestion:"Run \'vf init\' to create a configuration file"}),w=e({slug:"config-invalid",category:"CONFIG",status:400,title:"Invalid configuration format",suggestion:"Check your veryfront.config.ts for syntax errors"}),Y=e({slug:"config-parse-error",category:"CONFIG",status:400,title:"Failed to parse configuration",suggestion:"Ensure your configuration file is valid TypeScript/JSON"}),H=e({slug:"config-validation-error",category:"CONFIG",status:422,title:"Configuration validation failed",suggestion:"Check the configuration against the schema requirements"}),B=e({slug:"config-type-error",category:"CONFIG",status:400,title:"Configuration type mismatch",suggestion:"Ensure configuration values match expected types"}),$=e({slug:"import-map-invalid",category:"CONFIG",status:400,title:"Invalid import map configuration",suggestion:"Check your import map syntax and paths"}),j=e({slug:"cors-config-invalid",category:"CONFIG",status:400,title:"Invalid CORS configuration",suggestion:"Review CORS settings in your configuration"}),q=e({slug:"config-validation-failed",category:"CONFIG",status:400,title:"Configuration validation failed",suggestion:"Check configuration values against requirements"}),_={"config-not-found":k,"config-invalid":w,"config-parse-error":Y,"config-validation-error":H,"config-type-error":B,"import-map-invalid":$,"cors-config-invalid":j,"config-validation-failed":q};var z=e({slug:"build-failed",category:"BUILD",status:500,title:"Build process failed",suggestion:"Check the build output for specific errors"}),W=e({slug:"bundle-error",category:"BUILD",status:500,title:"Bundle generation failed",suggestion:"Review bundler output for details"}),J=e({slug:"typescript-error",category:"BUILD",status:500,title:"TypeScript compilation error",suggestion:"Fix TypeScript errors shown in the output"}),X=e({slug:"mdx-compile-error",category:"BUILD",status:500,title:"MDX compilation failed",suggestion:"Check your MDX file syntax"}),K=e({slug:"asset-optimization-error",category:"BUILD",status:500,title:"Asset optimization failed",suggestion:"Check asset file formats and paths"}),Z=e({slug:"ssg-generation-error",category:"BUILD",status:500,title:"Static site generation failed",suggestion:"Review SSG configuration and data fetching"}),Q=e({slug:"sourcemap-error",category:"BUILD",status:500,title:"Source map generation failed",suggestion:"Check source map configuration"}),ee=e({slug:"compilation-error",category:"BUILD",status:500,title:"Compilation failed",suggestion:"Review compiler output for specific errors"}),O={"build-failed":z,"bundle-error":W,"typescript-error":J,"mdx-compile-error":X,"asset-optimization-error":K,"ssg-generation-error":Z,"sourcemap-error":Q,"compilation-error":ee};var te=e({slug:"hydration-mismatch",category:"RUNTIME",status:500,title:"Client/server hydration mismatch",suggestion:"Ensure server and client render the same content"}),re=e({slug:"render-error",category:"RUNTIME",status:500,title:"Component render failed",suggestion:"Check component for runtime errors"}),oe=e({slug:"component-error",category:"RUNTIME",status:500,title:"Component execution error",suggestion:"Review component logic and props"}),ne=e({slug:"layout-not-found",category:"RUNTIME",status:404,title:"Layout component not found",suggestion:"Ensure layout file exists at the expected path"}),se=e({slug:"page-not-found",category:"RUNTIME",status:404,title:"Page component not found",suggestion:"Check that the page file exists in the routes directory"}),ie=e({slug:"api-error",category:"RUNTIME",status:500,title:"API route handler error",suggestion:"Review API route handler for errors"}),ae=e({slug:"middleware-error",category:"RUNTIME",status:500,title:"Middleware execution error",suggestion:"Check middleware function for errors"}),T={"hydration-mismatch":te,"render-error":re,"component-error":oe,"layout-not-found":ne,"page-not-found":se,"api-error":ie,"middleware-error":ae};var ce=e({slug:"route-conflict",category:"ROUTE",status:409,title:"Conflicting route definitions",suggestion:"Rename or reorganize conflicting route files"}),ue=e({slug:"invalid-route-file",category:"ROUTE",status:400,title:"Invalid route file structure",suggestion:"Ensure route file exports required functions"}),le=e({slug:"route-handler-invalid",category:"ROUTE",status:400,title:"Invalid route handler export",suggestion:"Export a valid handler function from the route file"}),ge=e({slug:"dynamic-route-error",category:"ROUTE",status:500,title:"Dynamic route parsing failed",suggestion:"Check dynamic route segment syntax"}),pe=e({slug:"route-params-error",category:"ROUTE",status:400,title:"Route parameters invalid",suggestion:"Validate route parameter values"}),Ee=e({slug:"api-route-error",category:"ROUTE",status:500,title:"API route definition error",suggestion:"Review API route configuration"}),I={"route-conflict":ce,"invalid-route-file":ue,"route-handler-invalid":le,"dynamic-route-error":ge,"route-params-error":pe,"api-route-error":Ee};var Re=e({slug:"module-not-found",category:"MODULE",status:404,title:"Module could not be resolved",suggestion:"Check the import path and ensure the module is installed"}),de=e({slug:"import-resolution-error",category:"MODULE",status:500,title:"Import path resolution failed",suggestion:"Verify import paths and module configuration"}),fe=e({slug:"circular-dependency",category:"MODULE",status:500,title:"Circular dependency detected",suggestion:"Refactor imports to break the circular dependency"}),me=e({slug:"invalid-import",category:"MODULE",status:400,title:"Invalid import statement",suggestion:"Fix import syntax or path"}),ye=e({slug:"dependency-missing",category:"MODULE",status:404,title:"Required dependency not installed",suggestion:"Install the missing dependency with your package manager"}),_e=e({slug:"version-mismatch",category:"MODULE",status:409,title:"Dependency version mismatch",suggestion:"Update dependencies to compatible versions"}),x={"module-not-found":Re,"import-resolution-error":de,"circular-dependency":fe,"invalid-import":me,"dependency-missing":ye,"version-mismatch":_e};var Oe=e({slug:"port-in-use",category:"SERVER",status:409,title:"Server port already in use",suggestion:"Use a different port or stop the process using this port"}),Te=e({slug:"server-start-error",category:"SERVER",status:500,title:"Server failed to start",suggestion:"Check server configuration and port availability"}),Ie=e({slug:"cache-error",category:"SERVER",status:500,title:"Cache operation failed",suggestion:"Clear the cache and try again"}),xe=e({slug:"file-watch-error",category:"SERVER",status:500,title:"File watcher error",suggestion:"Restart the development server"}),Se=e({slug:"request-error",category:"SERVER",status:500,title:"HTTP request handling error",suggestion:"Check request handler and middleware"}),he=e({slug:"service-overloaded",category:"SERVER",status:503,title:"Service overloaded",suggestion:"Reduce load or scale up resources"}),Ne=e({slug:"semaphore-timeout",category:"SERVER",status:503,title:"Semaphore acquire timeout",suggestion:"Reduce concurrency or increase the semaphore acquire timeout"}),ve=e({slug:"circuit-breaker-open",category:"SERVER",status:503,title:"Circuit breaker is open",suggestion:"Wait for the breaker reset timeout before retrying"}),Ae=e({slug:"cache-path-mismatch",category:"SERVER",status:500,title:"Cache path mismatch",suggestion:"Clear the cache directory and rebuild"}),Ce=e({slug:"network-error",category:"SERVER",status:502,title:"Network operation failed",suggestion:"Check network connectivity and retry"}),De=e({slug:"api-client-error",category:"SERVER",status:500,title:"API client request failed",suggestion:"Check API connectivity and authentication"}),Le=e({slug:"token-storage-error",category:"SERVER",status:500,title:"Token storage operation failed",suggestion:"Check token storage backend and credentials"}),Ue=e({slug:"cache-invariant-violation",category:"SERVER",status:500,title:"Cache path invariant violated",suggestion:"Clear the cache and rebuild"}),be=e({slug:"release-not-found",category:"SERVER",status:404,title:"No active release found",suggestion:"Deploy the project to create a release for this environment"}),Me=e({slug:"fallback-exhausted",category:"SERVER",status:500,title:"Primary and fallback operations both failed",suggestion:"Check service availability and connectivity"}),S={"port-in-use":Oe,"server-start-error":Te,"cache-error":Ie,"file-watch-error":xe,"request-error":Se,"service-overloaded":he,"semaphore-timeout":Ne,"circuit-breaker-open":ve,"cache-path-mismatch":Ae,"network-error":Ce,"api-client-error":De,"token-storage-error":Le,"cache-invariant-violation":Ue,"release-not-found":be,"fallback-exhausted":Me};var Pe=e({slug:"client-boundary-violation",category:"BOUNDARY",status:400,title:"Client boundary rule violation",suggestion:"Add \'use client\' directive or move code to a client component"}),Ve=e({slug:"server-only-in-client",category:"BOUNDARY",status:400,title:"Server-only code in client component",suggestion:"Move server-only code to a server component"}),Ge=e({slug:"client-only-in-server",category:"BOUNDARY",status:400,title:"Client-only code in server component",suggestion:"Move client-only code to a client component"}),Fe=e({slug:"invalid-use-client",category:"BOUNDARY",status:400,title:"Invalid \'use client\' directive",suggestion:"Place \'use client\' at the top of the file"}),ke=e({slug:"invalid-use-server",category:"BOUNDARY",status:400,title:"Invalid \'use server\' directive",suggestion:"Place \'use server\' at the top of the file or function"}),we=e({slug:"rsc-payload-error",category:"BOUNDARY",status:500,title:"RSC payload serialization error",suggestion:"Ensure props are serializable (no functions, symbols, etc.)"}),h={"client-boundary-violation":Pe,"server-only-in-client":Ve,"client-only-in-server":Ge,"invalid-use-client":Fe,"invalid-use-server":ke,"rsc-payload-error":we};var Ye=e({slug:"hmr-error",category:"DEV",status:500,title:"Hot module replacement error",suggestion:"Restart the development server"}),He=e({slug:"dev-server-error",category:"DEV",status:500,title:"Development server error",suggestion:"Check the dev server logs and restart"}),Be=e({slug:"fast-refresh-error",category:"DEV",status:500,title:"Fast refresh failed",suggestion:"Save the file again or restart the dev server"}),$e=e({slug:"error-overlay-error",category:"DEV",status:500,title:"Error overlay failed",suggestion:"Check browser console for details"}),je=e({slug:"source-map-error",category:"DEV",status:500,title:"Source map loading error",suggestion:"Rebuild or clear cache"}),N={"hmr-error":Ye,"dev-server-error":He,"fast-refresh-error":Be,"error-overlay-error":$e,"source-map-error":je};var qe=e({slug:"deployment-error",category:"DEPLOY",status:500,title:"Deployment process failed",suggestion:"Check deployment logs for details"}),ze=e({slug:"platform-error",category:"DEPLOY",status:500,title:"Platform-specific error",suggestion:"Check platform documentation and requirements"}),We=e({slug:"env-var-missing",category:"DEPLOY",status:500,title:"Required environment variable missing",suggestion:"Set the required environment variable"}),Je=e({slug:"production-build-required",category:"DEPLOY",status:400,title:"Production build required",suggestion:"Run \'vf build\' before deploying"}),v={"deployment-error":qe,"platform-error":ze,"env-var-missing":We,"production-build-required":Je};var Xe=e({slug:"agent-error",category:"AGENT",status:500,title:"Agent operation error",suggestion:"Check agent configuration and logs"}),Ke=e({slug:"agent-not-found",category:"AGENT",status:404,title:"Agent not found",suggestion:"Verify the agent ID exists"}),Ze=e({slug:"agent-timeout",category:"AGENT",status:408,title:"Agent operation timed out",suggestion:"Increase timeout or simplify the request"}),Qe=e({slug:"agent-intent-error",category:"AGENT",status:400,title:"Agent intent parsing error",suggestion:"Rephrase the request more clearly"}),et=e({slug:"orchestration-error",category:"AGENT",status:500,title:"Multi-agent orchestration error",suggestion:"Check agent coordination logic"}),tt=e({slug:"cost-limit-exceeded",category:"AGENT",status:429,title:"Cost limit exceeded",suggestion:"Wait for the budget period to reset or increase the limit"}),A={"agent-error":Xe,"agent-not-found":Ke,"agent-timeout":Ze,"agent-intent-error":Qe,"orchestration-error":et,"cost-limit-exceeded":tt};var rt=e({slug:"unknown-error",category:"GENERAL",status:500,title:"Unknown/unclassified error",suggestion:"Check logs for more details"}),ot=e({slug:"permission-denied",category:"GENERAL",status:403,title:"File/resource permission denied",suggestion:"Check file permissions and access rights"}),nt=e({slug:"file-not-found",category:"GENERAL",status:404,title:"File not found",suggestion:"Verify the file path exists"}),st=e({slug:"resource-not-found",category:"GENERAL",status:404,title:"Requested resource not found",suggestion:"Verify the referenced resource ID or name exists"}),it=e({slug:"invalid-argument",category:"GENERAL",status:400,title:"Invalid function argument",suggestion:"Check argument types and values"}),at=e({slug:"timeout-error",category:"GENERAL",status:408,title:"Operation timed out",suggestion:"Increase timeout or optimize the operation"}),ct=e({slug:"initialization-error",category:"GENERAL",status:500,title:"Initialization failed",suggestion:"Check initialization requirements and dependencies"}),ut=e({slug:"not-supported",category:"GENERAL",status:501,title:"Feature not supported",suggestion:"Check documentation for supported features"}),m=e({slug:"security-violation",category:"GENERAL",status:403,title:"Security violation detected",suggestion:"Check for path traversal or unauthorized access attempts"}),lt=e({slug:"input-validation-failed",category:"GENERAL",status:400,title:"Input validation failed",suggestion:"Check request input against validation rules"}),C={"unknown-error":rt,"permission-denied":ot,"file-not-found":nt,"resource-not-found":st,"invalid-argument":it,"timeout-error":at,"initialization-error":ct,"not-supported":ut,"security-violation":m,"input-validation-failed":lt};var ur={..._,...O,...T,...I,...x,...S,...h,...N,...v,...A,...C};var gt=[{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 pt(){return gt.map(({source:r,flags:t,name:o})=>({pattern:new RegExp(r,t),name:o}))}function Et(){let r=globalThis;return r.__VERYFRONT_DEV__===!0||r.Deno?.env?.get?.("VERYFRONT_ENV")==="development"}function D(r,t={}){let{strict:o=!1,warn:n=!0}=t;for(let{pattern:i,name:c}of pt())if(i.lastIndex=0,!!i.test(r)&&(n&&console.warn(`[Security] Suspicious ${c} detected in server HTML`),o||!Et()))throw m.create({detail:`Potentially unsafe HTML: ${c} detected`});return r}var R=class{constructor(t,o){this.prefix=t;this.level=o}log(t,o,n,...i){this.level>t||o?.(n,...i)}debug(t,...o){this.log(0,console.debug,`[${this.prefix}] DEBUG: ${t}`,...o)}info(t,...o){this.log(1,console.log,`[${this.prefix}] ${t}`,...o)}warn(t,...o){this.log(2,console.warn,`[${this.prefix}] WARN: ${t}`,...o)}error(t,...o){this.log(3,console.error,`[${this.prefix}] ERROR: ${t}`,...o)}};function Rt(){if(typeof window>"u")return 2;let r=globalThis;return r.__VERYFRONT_DEV__||r.__RSC_DEV__?r.__VERYFRONT_DEBUG__||r.__RSC_DEBUG__?0:1:2}var d=Rt(),p=new R("RSC",d),Nr=new R("PREFETCH",d),vr=new R("HYDRATE",d),Ar=new R("VERYFRONT",d);var s="/_veryfront",y={RSC:`${s}/rsc/`,FS:`${s}/fs/`,MODULES:`${s}/modules/`,PAGES:`${s}/pages/`,DATA:`${s}/data/`,LIB:`${s}/lib/`,CHUNKS:`${s}/chunks/`,CLIENT:`${s}/client/`},L={HMR_RUNTIME:`${s}/hmr-runtime.js`,HMR:`${s}/hmr.js`,ERROR_OVERLAY:`${s}/error-overlay.js`,DEV_LOADER:`${s}/dev-loader.js`,CLIENT_LOG:`${s}/log`,CLIENT_JS:`${s}/client.js`,ROUTER_JS:`${s}/router.js`,PREFETCH_JS:`${s}/prefetch.js`,MANIFEST_JSON:`${s}/manifest.json`,APP_JS:`${s}/app.js`,RSC_CLIENT:`${s}/rsc/client.js`,RSC_MANIFEST:`${s}/rsc/manifest`,RSC_STREAM:`${s}/rsc/stream`,RSC_PAYLOAD:`${s}/rsc/payload`,RSC_RENDER:`${s}/rsc/render`,RSC_PAGE:`${s}/rsc/page`,RSC_MODULE:`${s}/rsc/module`,RSC_DOM:`${s}/rsc/dom.js`,LIB_CHAT_REACT:`${s}/lib/chat/react.js`,LIB_CHAT_COMPONENTS:`${s}/lib/chat/components.js`,LIB_CHAT_PRIMITIVES:`${s}/lib/chat/primitives.js`};var ft={ROOT:".veryfront",CACHE:".veryfront/cache",KV:".veryfront/kv",LOGS:".veryfront/logs",TMP:".veryfront/tmp"},br=ft.CACHE;var Mr={HMR_RUNTIME:L.HMR_RUNTIME,ERROR_OVERLAY:L.ERROR_OVERLAY};var Fr=y.RSC,kr=y.FS;var U="rsc-root";function M(r,t){let o=t==="root"?U:`rsc-slot-${t}`,n=r.getElementById(o);if(n)return n;let i=r.createElement("div");return i.id=o,r.body.appendChild(i),i}function mt(r,t){if(t.type!=="slot")return;let o=M(r,t.id);o.innerHTML=D(String(t.html??""))}function b(r,t){let o=t.split(`\n`),n=o.pop()??"";for(let i of o){let c=i.trim();if(!c)continue;let g;try{g=JSON.parse(c)}catch(E){p.debug("[client-dom] malformed NDJSON line",{line:c,error:E instanceof Error?E.message:String(E)});continue}if(!g||typeof g!="object")continue;let u=g;if(u.type==="slot"){mt(r,u);try{Ot(r,u.id||"root")}catch(E){p.debug("[client-dom] hydration optional failed",E)}}}return n}function yt(r){return new Promise((t,o)=>{let n=()=>o(new DOMException("aborted","AbortError"));if(r.aborted){n();return}r.addEventListener("abort",n,{once:!0})})}async function $r(r,t=document,o){let n="body"in r?r:null,i=n?.body??r;if(!i)return;let c=i.getReader(),g=new TextDecoder,u="",E=!1;try{for(;;){if(o?.aborted)throw new DOMException("aborted","AbortError");let a=c.read(),{done:P,value:V}=o?await Promise.race([a,yt(o)]):await a;if(P){E=!0;break}u+=g.decode(V,{stream:!0}),u=b(t,u)}u&&b(t,`${u}\n`)}catch(a){throw a instanceof Error&&a.name==="AbortError"||p.debug("[client-dom] consumeNdjsonStream error",a),a}finally{try{await c.cancel()}catch(a){E||p.debug("[client-dom] reader.cancel failed",a)}try{c.releaseLock()}catch(a){p.debug("[client-dom] reader.releaseLock failed",a)}if(typeof i.cancel=="function")try{await i.cancel()}catch(a){p.debug("[client-dom] stream.cancel failed",a)}if(typeof n?.body?.cancel=="function")try{await n.body.cancel()}catch(a){p.debug("[client-dom] response.body.cancel failed",a)}}}function _t(r,t){let o=M(r,t),n=[],i=c=>{let g=c;g.dataset?.clientRef&&n.push(g);for(let u of c.children)i(u)};return i(o),n}function Ot(r,t){let o=_t(r,t);for(let n of o){let i=n.dataset?.clientRef;i&&(n.dataset.hydrated="true",p.debug("[client-dom] marked for hydration",i))}}export{$r as consumeNdjsonStream,M as getContainer};\n';
@@ -1,3 +1,3 @@
1
1
  /** Shared version value. */
2
- export declare const VERSION = "0.1.745";
2
+ export declare const VERSION = "0.1.746";
3
3
  //# sourceMappingURL=version-constant.d.ts.map
@@ -1,4 +1,4 @@
1
1
  // Keep in sync with deno.json version.
2
2
  // scripts/release.ts updates this constant during releases.
3
3
  /** Shared version value. */
4
- export const VERSION = "0.1.745";
4
+ export const VERSION = "0.1.746";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "veryfront",
3
- "version": "0.1.745",
3
+ "version": "0.1.746",
4
4
  "description": "The simplest way to build AI-powered apps",
5
5
  "keywords": [
6
6
  "react",