veryfront 0.1.623 → 0.1.625
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/README.md +3 -3
- package/esm/cli/commands/knowledge/command-help.d.ts.map +1 -1
- package/esm/cli/commands/knowledge/command-help.js +2 -3
- package/esm/cli/commands/knowledge/command.d.ts +2 -47
- package/esm/cli/commands/knowledge/command.d.ts.map +1 -1
- package/esm/cli/commands/knowledge/command.js +22 -124
- package/esm/cli/commands/knowledge/parser.d.ts +40 -0
- package/esm/cli/commands/knowledge/parser.d.ts.map +1 -0
- package/esm/cli/commands/knowledge/parser.js +353 -0
- package/esm/cli/commands/knowledge/result.d.ts +3 -3
- package/esm/cli/commands/knowledge/result.js +1 -1
- package/esm/cli/commands/styles/command.js +2 -2
- package/esm/cli/commands/task/command.js +4 -4
- package/esm/cli/commands/worker/command-help.js +4 -4
- package/esm/cli/commands/worker/command.d.ts +1 -1
- package/esm/cli/commands/worker/command.js +9 -9
- package/esm/cli/commands/workflow/command.js +4 -4
- package/esm/cli/utils/sanitize-run-output.d.ts +2 -0
- package/esm/cli/utils/sanitize-run-output.d.ts.map +1 -0
- package/esm/cli/utils/{sanitize-job-output.js → sanitize-run-output.js} +1 -1
- package/esm/cli/utils/write-run-result.d.ts +2 -0
- package/esm/cli/utils/write-run-result.d.ts.map +1 -0
- package/esm/cli/utils/write-run-result.js +16 -0
- package/esm/deno.d.ts +4 -3
- package/esm/deno.js +6 -5
- package/esm/src/build/production-build/static-generation.d.ts.map +1 -1
- package/esm/src/build/production-build/static-generation.js +85 -0
- package/esm/src/html/hydration-script-builder/templates/renderer.d.ts.map +1 -1
- package/esm/src/html/hydration-script-builder/templates/renderer.js +37 -4
- package/esm/src/integrations/_data.js +1 -1
- package/esm/src/integrations/schema.d.ts +8 -0
- package/esm/src/integrations/schema.d.ts.map +1 -1
- package/esm/src/integrations/schema.js +3 -0
- package/esm/src/internal-agents/run-stream.d.ts.map +1 -1
- package/esm/src/internal-agents/run-stream.js +20 -3
- package/esm/src/platform/adapters/veryfront-api-client/operations.d.ts +2 -2
- package/esm/src/platform/adapters/veryfront-api-client/operations.d.ts.map +1 -1
- package/esm/src/platform/adapters/veryfront-api-client/operations.js +2 -2
- package/esm/src/platform/adapters/veryfront-api-client/schemas/api.schema.d.ts +1 -1
- package/esm/src/platform/adapters/veryfront-api-client/schemas/api.schema.js +1 -1
- package/esm/src/react/components/chat/chat/components/attachment-pill.js +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts +1 -0
- package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-composer.js +27 -11
- package/esm/src/react/components/chat/chat/index.d.ts +1 -0
- package/esm/src/react/components/chat/chat/index.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/index.js +2 -2
- package/esm/src/react/components/chat/theme.js +1 -1
- package/esm/src/rendering/layouts/utils/applicator.d.ts.map +1 -1
- package/esm/src/rendering/layouts/utils/applicator.js +1 -1
- package/esm/src/rendering/layouts/utils/component-loader.d.ts +8 -0
- package/esm/src/rendering/layouts/utils/component-loader.d.ts.map +1 -1
- package/esm/src/rendering/layouts/utils/component-loader.js +19 -0
- package/esm/src/rendering/rsc/client-boot.ts +23 -6
- package/esm/src/runs/index.d.ts +27 -0
- package/esm/src/runs/index.d.ts.map +1 -0
- package/esm/src/runs/index.js +26 -0
- package/esm/src/runs/runs-client.d.ts +95 -0
- package/esm/src/runs/runs-client.d.ts.map +1 -0
- package/esm/src/runs/runs-client.js +181 -0
- package/esm/src/{jobs → runs}/runtime-env.d.ts.map +1 -1
- package/esm/src/{jobs → runs}/runtime-env.js +2 -2
- package/esm/src/runs/schemas.d.ts +236 -0
- package/esm/src/runs/schemas.d.ts.map +1 -0
- package/esm/src/runs/schemas.js +61 -0
- package/esm/src/security/deno-permissions.d.ts +2 -2
- package/esm/src/security/deno-permissions.js +2 -2
- package/esm/src/security/index.d.ts +1 -1
- package/esm/src/security/index.js +1 -1
- package/esm/src/server/build-app-route-renderer.d.ts +2 -0
- package/esm/src/server/build-app-route-renderer.d.ts.map +1 -1
- package/esm/src/server/build-app-route-renderer.js +51 -28
- package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/framework-candidates.generated.js +54 -8
- 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 +1 -1
- package/esm/src/server/services/static/static-file.service.d.ts.map +1 -1
- package/esm/src/server/services/static/static-file.service.js +9 -4
- package/esm/src/skill/index.d.ts +1 -1
- package/esm/src/skill/index.d.ts.map +1 -1
- package/esm/src/skill/index.js +1 -1
- package/esm/src/skill/prompt-augmentation.js +2 -2
- package/esm/src/skill/tools.d.ts +1 -1
- package/esm/src/skill/tools.d.ts.map +1 -1
- package/esm/src/skill/tools.js +11 -9
- package/esm/src/skill/types.d.ts +1 -0
- package/esm/src/skill/types.d.ts.map +1 -1
- package/esm/src/skill/types.js +1 -0
- package/esm/src/task/runner.js +1 -1
- package/esm/src/task/types.d.ts +4 -4
- package/esm/src/task/types.d.ts.map +1 -1
- package/esm/src/task/types.js +1 -1
- package/esm/src/tool/factory.d.ts.map +1 -1
- package/esm/src/tool/factory.js +10 -0
- package/esm/src/tool/types.d.ts +5 -4
- package/esm/src/tool/types.d.ts.map +1 -1
- package/esm/src/utils/index.d.ts +1 -1
- package/esm/src/utils/index.js +1 -1
- package/esm/src/utils/logger/index.d.ts +1 -1
- package/esm/src/utils/logger/index.js +1 -1
- package/esm/src/utils/logger/logger.d.ts +6 -6
- package/esm/src/utils/logger/logger.d.ts.map +1 -1
- package/esm/src/utils/logger/logger.js +10 -10
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/esm/src/workflow/executor/workflow-executor.js +3 -3
- package/esm/src/workflow/worker/{dynamic-job-entrypoint.d.ts → dynamic-run-entrypoint.d.ts} +2 -2
- package/esm/src/workflow/worker/{dynamic-job-entrypoint.d.ts.map → dynamic-run-entrypoint.d.ts.map} +1 -1
- package/esm/src/workflow/worker/{dynamic-job-entrypoint.js → dynamic-run-entrypoint.js} +1 -1
- package/esm/src/workflow/worker/executors/index.d.ts +8 -8
- package/esm/src/workflow/worker/executors/index.d.ts.map +1 -1
- package/esm/src/workflow/worker/executors/index.js +5 -5
- package/esm/src/workflow/worker/executors/k8s.d.ts +34 -34
- package/esm/src/workflow/worker/executors/k8s.d.ts.map +1 -1
- package/esm/src/workflow/worker/executors/k8s.js +59 -58
- package/esm/src/workflow/worker/executors/process.d.ts +15 -15
- package/esm/src/workflow/worker/executors/process.d.ts.map +1 -1
- package/esm/src/workflow/worker/executors/process.js +86 -86
- package/esm/src/workflow/worker/executors/types.d.ts +38 -39
- package/esm/src/workflow/worker/executors/types.d.ts.map +1 -1
- package/esm/src/workflow/worker/executors/types.js +9 -10
- package/esm/src/workflow/worker/index.d.ts +7 -7
- package/esm/src/workflow/worker/index.d.ts.map +1 -1
- package/esm/src/workflow/worker/index.js +9 -9
- package/esm/src/workflow/worker/{job-entrypoint.d.ts → run-entrypoint.d.ts} +3 -3
- package/esm/src/workflow/worker/{job-entrypoint.d.ts.map → run-entrypoint.d.ts.map} +1 -1
- package/esm/src/workflow/worker/{job-entrypoint.js → run-entrypoint.js} +2 -2
- package/esm/src/workflow/worker/{job-manager.d.ts → run-manager.d.ts} +32 -32
- package/esm/src/workflow/worker/run-manager.d.ts.map +1 -0
- package/esm/src/workflow/worker/{job-manager.js → run-manager.js} +63 -63
- package/esm/src/workflow/worker/shared.js +1 -1
- package/package.json +4 -4
- package/esm/cli/commands/knowledge/parser-source.d.ts +0 -2
- package/esm/cli/commands/knowledge/parser-source.d.ts.map +0 -1
- package/esm/cli/commands/knowledge/parser-source.js +0 -641
- package/esm/cli/utils/sanitize-job-output.d.ts +0 -2
- package/esm/cli/utils/sanitize-job-output.d.ts.map +0 -1
- package/esm/cli/utils/write-job-result.d.ts +0 -2
- package/esm/cli/utils/write-job-result.d.ts.map +0 -1
- package/esm/cli/utils/write-job-result.js +0 -16
- package/esm/src/jobs/index.d.ts +0 -25
- package/esm/src/jobs/index.d.ts.map +0 -1
- package/esm/src/jobs/index.js +0 -24
- package/esm/src/jobs/jobs-client.d.ts +0 -182
- package/esm/src/jobs/jobs-client.d.ts.map +0 -1
- package/esm/src/jobs/jobs-client.js +0 -255
- package/esm/src/jobs/schemas.d.ts +0 -1146
- package/esm/src/jobs/schemas.d.ts.map +0 -1
- package/esm/src/jobs/schemas.js +0 -294
- package/esm/src/workflow/worker/job-manager.d.ts.map +0 -1
- /package/esm/src/{jobs → runs}/runtime-env.d.ts +0 -0
|
@@ -6,7 +6,10 @@ import { join } from "../platform/compat/path/index.js";
|
|
|
6
6
|
import { getProjectReact, renderToStringAdapter } from "../react/index.js";
|
|
7
7
|
import { loadComponentFromSource } from "../modules/react-loader/index.js";
|
|
8
8
|
import { COMPILATION_ERROR } from "../errors/index.js";
|
|
9
|
-
import {
|
|
9
|
+
import { generateHydrationData, getProdScripts } from "../html/index.js";
|
|
10
|
+
import { buildImportMapJson } from "../html/utils.js";
|
|
11
|
+
import { getPreviewStylesheetLink } from "../html/dev-scripts.js";
|
|
12
|
+
import { shouldUnwrapAppRouterDocumentLayout, unwrapAppRouterDocumentLayout, } from "../rendering/layouts/utils/component-loader.js";
|
|
10
13
|
async function fileExists(adapter, filePath) {
|
|
11
14
|
try {
|
|
12
15
|
const st = await adapter.fs.stat(filePath);
|
|
@@ -22,10 +25,16 @@ async function loadComponent(adapter, filePath, projectDir, contentSourceId) {
|
|
|
22
25
|
return loadComponentFromSource(src, filePath, projectDir, adapter, {
|
|
23
26
|
projectId: projectDir,
|
|
24
27
|
dev: false,
|
|
25
|
-
moduleServerUrl: "",
|
|
28
|
+
moduleServerUrl: "",
|
|
26
29
|
contentSourceId,
|
|
27
30
|
});
|
|
28
31
|
}
|
|
32
|
+
function routePathToSlug(routePath) {
|
|
33
|
+
return routePath === "/" ? "" : routePath.replace(/^\/+/, "");
|
|
34
|
+
}
|
|
35
|
+
function hasUseClientDirective(source) {
|
|
36
|
+
return /^\s*['"]use client['"];?\s*$/m.test(source);
|
|
37
|
+
}
|
|
29
38
|
function getLayoutsForRoute(appRoot, routePath) {
|
|
30
39
|
const segments = routePath === "/" ? [] : routePath.split("/").filter(Boolean);
|
|
31
40
|
const layouts = [];
|
|
@@ -41,7 +50,7 @@ function getLayoutsForRoute(appRoot, routePath) {
|
|
|
41
50
|
* Render an App Router route to HTML
|
|
42
51
|
*/
|
|
43
52
|
export async function renderAppRouteToHTML(args) {
|
|
44
|
-
const { adapter, projectDir, routePath, pageFile, contentSourceId,
|
|
53
|
+
const { adapter, projectDir, routePath, pageFile, contentSourceId, stylesheetHref, includePreviewStylesheet, } = args;
|
|
45
54
|
const appRoot = join(projectDir, "app");
|
|
46
55
|
const layoutCandidates = getLayoutsForRoute(appRoot, routePath);
|
|
47
56
|
const layouts = [];
|
|
@@ -51,7 +60,13 @@ export async function renderAppRouteToHTML(args) {
|
|
|
51
60
|
}
|
|
52
61
|
// Get React from the project's node_modules to ensure element symbols match
|
|
53
62
|
const React = await getProjectReact();
|
|
54
|
-
const
|
|
63
|
+
const pageSource = await adapter.fs.readFile(pageFile);
|
|
64
|
+
const Page = await loadComponentFromSource(pageSource, pageFile, projectDir, adapter, {
|
|
65
|
+
projectId: projectDir,
|
|
66
|
+
dev: false,
|
|
67
|
+
moduleServerUrl: "",
|
|
68
|
+
contentSourceId,
|
|
69
|
+
});
|
|
55
70
|
if (typeof Page !== "function") {
|
|
56
71
|
throw COMPILATION_ERROR.create({
|
|
57
72
|
detail: "Invalid page component",
|
|
@@ -67,7 +82,10 @@ export async function renderAppRouteToHTML(args) {
|
|
|
67
82
|
const Layout = await loadComponent(adapter, layoutPath, projectDir, contentSourceId);
|
|
68
83
|
if (typeof Layout !== "function")
|
|
69
84
|
continue;
|
|
70
|
-
|
|
85
|
+
const LayoutToApply = shouldUnwrapAppRouterDocumentLayout(layoutPath, projectDir)
|
|
86
|
+
? unwrapAppRouterDocumentLayout(React, Layout)
|
|
87
|
+
: Layout;
|
|
88
|
+
element = React.createElement(LayoutToApply, { children: element });
|
|
71
89
|
}
|
|
72
90
|
catch (error) {
|
|
73
91
|
logger.debug("[BuildAppRouteRenderer] Layout loading failed, continuing without layout", error);
|
|
@@ -75,6 +93,30 @@ export async function renderAppRouteToHTML(args) {
|
|
|
75
93
|
}
|
|
76
94
|
const htmlInner = await renderToStringAdapter(element);
|
|
77
95
|
const title = "Veryfront App";
|
|
96
|
+
const slug = routePathToSlug(routePath);
|
|
97
|
+
const importMapJson = await buildImportMapJson({ projectDir });
|
|
98
|
+
const hydrationData = hasUseClientDirective(pageSource)
|
|
99
|
+
? generateHydrationData(slug, {}, {}, {
|
|
100
|
+
mode: "production",
|
|
101
|
+
environment: "production",
|
|
102
|
+
projectDir,
|
|
103
|
+
pagePath: pageFile,
|
|
104
|
+
pageType: "tsx",
|
|
105
|
+
isLocalProject: false,
|
|
106
|
+
forceProductionScripts: true,
|
|
107
|
+
nestedLayouts: layouts.map((layoutPath) => ({ kind: "tsx", path: layoutPath })),
|
|
108
|
+
}, { pretty: false })
|
|
109
|
+
: null;
|
|
110
|
+
const hydrationDataScript = hydrationData
|
|
111
|
+
? `
|
|
112
|
+
<script id="veryfront-hydration-data" type="application/json">${hydrationData}</script>`
|
|
113
|
+
: "";
|
|
114
|
+
const shouldIncludePreviewStylesheet = includePreviewStylesheet ?? !stylesheetHref;
|
|
115
|
+
const stylesheetLink = stylesheetHref
|
|
116
|
+
? `<link rel="stylesheet" href="${stylesheetHref}">`
|
|
117
|
+
: shouldIncludePreviewStylesheet
|
|
118
|
+
? getPreviewStylesheetLink()
|
|
119
|
+
: "";
|
|
78
120
|
return `<!DOCTYPE html>
|
|
79
121
|
<html lang="en">
|
|
80
122
|
<head>
|
|
@@ -84,34 +126,15 @@ export async function renderAppRouteToHTML(args) {
|
|
|
84
126
|
|
|
85
127
|
<!-- Import map for React dependencies -->
|
|
86
128
|
<script type="importmap">
|
|
87
|
-
${
|
|
129
|
+
${importMapJson}
|
|
88
130
|
</script>
|
|
89
131
|
|
|
132
|
+
${stylesheetLink}
|
|
90
133
|
</head>
|
|
91
134
|
<body>
|
|
92
135
|
<div id="root">${htmlInner}</div>
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
<script type="module">
|
|
96
|
-
// Basic app initialization for App Router pages
|
|
97
|
-
async function initializeApp() {
|
|
98
|
-
try {
|
|
99
|
-
// Import the app module if it exists
|
|
100
|
-
const appModule = await import('/_veryfront/app.js').catch(() => null);
|
|
101
|
-
if (appModule) {
|
|
102
|
-
console.log('App module loaded');
|
|
103
|
-
}
|
|
104
|
-
} catch (error) {
|
|
105
|
-
console.error('Failed to initialize app:', error);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
if (document.readyState === 'loading') {
|
|
110
|
-
document.addEventListener('DOMContentLoaded', initializeApp, { once: true });
|
|
111
|
-
} else {
|
|
112
|
-
initializeApp();
|
|
113
|
-
}
|
|
114
|
-
</script>
|
|
136
|
+
${hydrationDataScript}
|
|
137
|
+
${hydrationData ? getProdScripts(slug) : ""}
|
|
115
138
|
</body>
|
|
116
139
|
</html>`;
|
|
117
140
|
}
|
|
@@ -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,
|
|
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,EAg/KjD,CAAC"}
|
|
@@ -47,6 +47,7 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
47
47
|
"!node?.position?.start?.line;",
|
|
48
48
|
"!onFeedback)",
|
|
49
49
|
"!onRename)",
|
|
50
|
+
"!onSelectAttachment)",
|
|
50
51
|
"!onStop)",
|
|
51
52
|
"!onSubmit)",
|
|
52
53
|
"!onVoice)",
|
|
@@ -367,6 +368,8 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
367
368
|
"22",
|
|
368
369
|
"220",
|
|
369
370
|
"220)",
|
|
371
|
+
"224",
|
|
372
|
+
"224px",
|
|
370
373
|
"22H4a2",
|
|
371
374
|
"22h0a3.13",
|
|
372
375
|
"22l1.5-5.5Z",
|
|
@@ -584,6 +587,7 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
584
587
|
"AnthropicLogo({",
|
|
585
588
|
"Apply",
|
|
586
589
|
"Approval",
|
|
590
|
+
"Array.from(document.querySelectorAll(",
|
|
587
591
|
"Array.from(grouped.entries()).map(([label,",
|
|
588
592
|
"Array.from(groups.entries()).map(([provider,",
|
|
589
593
|
"ArrowDown",
|
|
@@ -599,7 +603,6 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
599
603
|
"AssistantMessage({",
|
|
600
604
|
"AssistantMessageProps",
|
|
601
605
|
"AssistantMessageProps):",
|
|
602
|
-
"Attach",
|
|
603
606
|
"AttachmentInfo",
|
|
604
607
|
"AttachmentInfo,",
|
|
605
608
|
"AttachmentInfo;",
|
|
@@ -1048,6 +1051,7 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
1048
1051
|
"HTML",
|
|
1049
1052
|
"HTMLButtonElement,",
|
|
1050
1053
|
"HTMLDivElement,",
|
|
1054
|
+
"HTMLElement).style.minWidth,",
|
|
1051
1055
|
"HTMLElement:",
|
|
1052
1056
|
"HTMLInputElement",
|
|
1053
1057
|
"HTMLStyleElement:",
|
|
@@ -1356,7 +1360,6 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
1356
1360
|
"Page()",
|
|
1357
1361
|
"PanelLeftIcon",
|
|
1358
1362
|
"PanelLeftIcon({",
|
|
1359
|
-
"PaperclipIcon",
|
|
1360
1363
|
"PaperclipIcon({",
|
|
1361
1364
|
"Parameters",
|
|
1362
1365
|
"Part",
|
|
@@ -1856,6 +1859,7 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
1856
1859
|
"[];",
|
|
1857
1860
|
"[]}",
|
|
1858
1861
|
"[activeThreadId,",
|
|
1862
|
+
"[attachmentMenuOpen,",
|
|
1859
1863
|
"[base];",
|
|
1860
1864
|
"[cardStyle,",
|
|
1861
1865
|
"[code]);",
|
|
@@ -1953,6 +1957,7 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
1953
1957
|
"action.",
|
|
1954
1958
|
"action.label}",
|
|
1955
1959
|
"action:",
|
|
1960
|
+
"actions",
|
|
1956
1961
|
"actions,",
|
|
1957
1962
|
"actions.",
|
|
1958
1963
|
"actions.length",
|
|
@@ -2029,6 +2034,7 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
2029
2034
|
"area",
|
|
2030
2035
|
"area.",
|
|
2031
2036
|
"aria-controls={open",
|
|
2037
|
+
"aria-expanded={attachmentMenuOpen}",
|
|
2032
2038
|
"aria-expanded={open}",
|
|
2033
2039
|
"aria-haspopup=",
|
|
2034
2040
|
"aria-label=",
|
|
@@ -2047,13 +2053,17 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
2047
2053
|
"as",
|
|
2048
2054
|
"asking",
|
|
2049
2055
|
"assert(",
|
|
2056
|
+
"assert(attachButton,",
|
|
2050
2057
|
"assert(button,",
|
|
2051
2058
|
"assert(button.includes(",
|
|
2059
|
+
"assert(menu,",
|
|
2052
2060
|
"assert(root,",
|
|
2053
2061
|
"assert(rootElement,",
|
|
2054
2062
|
"assert(script,",
|
|
2063
|
+
"assert(selectAction,",
|
|
2055
2064
|
"assert(style,",
|
|
2056
2065
|
"assert(theme.messageVariants({",
|
|
2066
|
+
"assert(uploadAction,",
|
|
2057
2067
|
"assert,",
|
|
2058
2068
|
"assertEquals",
|
|
2059
2069
|
"assertEquals(",
|
|
@@ -2068,6 +2078,7 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
2068
2078
|
"assertEquals(nonce,",
|
|
2069
2079
|
"assertEquals(removedExport",
|
|
2070
2080
|
"assertEquals(second.type,",
|
|
2081
|
+
"assertEquals(selectCalls,",
|
|
2071
2082
|
"assertEquals(theme.messageVariants({",
|
|
2072
2083
|
"assertEquals(third.type,",
|
|
2073
2084
|
"assertEquals,",
|
|
@@ -2085,6 +2096,8 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
2085
2096
|
"attachAccept:",
|
|
2086
2097
|
"attachAccept={attachAccept}",
|
|
2087
2098
|
"attachAccept?:",
|
|
2099
|
+
"attachButton",
|
|
2100
|
+
"attachButton.dispatchEvent(new",
|
|
2088
2101
|
"attachment",
|
|
2089
2102
|
"attachment,",
|
|
2090
2103
|
"attachment.",
|
|
@@ -2097,6 +2110,7 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
2097
2110
|
"attachment.type",
|
|
2098
2111
|
"attachment:",
|
|
2099
2112
|
"attachment={file}",
|
|
2113
|
+
"attachmentMenuOpen",
|
|
2100
2114
|
"attachments",
|
|
2101
2115
|
"attachments,",
|
|
2102
2116
|
"attachments.length",
|
|
@@ -2216,7 +2230,9 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
2216
2230
|
"border-t",
|
|
2217
2231
|
"border-t-transparent",
|
|
2218
2232
|
"border:",
|
|
2233
|
+
"borderRadius:",
|
|
2219
2234
|
"both",
|
|
2235
|
+
"bottom-11",
|
|
2220
2236
|
"bottom-4",
|
|
2221
2237
|
"bottom-full",
|
|
2222
2238
|
"bottom:",
|
|
@@ -2248,14 +2264,17 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
2248
2264
|
"building",
|
|
2249
2265
|
"built-in",
|
|
2250
2266
|
"button",
|
|
2267
|
+
"button)",
|
|
2251
2268
|
"button,",
|
|
2252
2269
|
"button.",
|
|
2253
2270
|
"button.dispatchEvent(new",
|
|
2271
|
+
"button.textContent?.trim()",
|
|
2254
2272
|
"button:",
|
|
2255
2273
|
"button>",
|
|
2256
2274
|
"button?:",
|
|
2257
2275
|
"buttonRef",
|
|
2258
2276
|
"buttonRef.current;",
|
|
2277
|
+
"button[aria-label=",
|
|
2259
2278
|
"buttons,",
|
|
2260
2279
|
"button{cursor:pointer;}",
|
|
2261
2280
|
"by",
|
|
@@ -2692,7 +2711,7 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
2692
2711
|
"directly.",
|
|
2693
2712
|
"disabled,",
|
|
2694
2713
|
"disabled:cursor-not-allowed",
|
|
2695
|
-
"disabled:opacity-
|
|
2714
|
+
"disabled:opacity-100",
|
|
2696
2715
|
"disabled:opacity-50",
|
|
2697
2716
|
"disabled:pointer-events-none",
|
|
2698
2717
|
"disabled={!content.trim()}",
|
|
@@ -2734,6 +2753,7 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
2734
2753
|
"document.head.querySelector('style[data-veryfront-managed=",
|
|
2735
2754
|
"document.querySelector(",
|
|
2736
2755
|
"document.querySelector('[data-hydrated=",
|
|
2756
|
+
"document.querySelector('[role=",
|
|
2737
2757
|
"document.querySelector<HTMLElement>(",
|
|
2738
2758
|
"document.removeEventListener(",
|
|
2739
2759
|
"document:",
|
|
@@ -2943,6 +2963,7 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
2943
2963
|
"file",
|
|
2944
2964
|
"file.",
|
|
2945
2965
|
"fileInputRef",
|
|
2966
|
+
"fileInputRef.current?.click();",
|
|
2946
2967
|
"fileInputRef.current?.click()}",
|
|
2947
2968
|
"filename",
|
|
2948
2969
|
"filename?:",
|
|
@@ -2954,6 +2975,7 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
2954
2975
|
"filter((p)",
|
|
2955
2976
|
"filter((p):",
|
|
2956
2977
|
"finally",
|
|
2978
|
+
"find(",
|
|
2957
2979
|
"fine-grained",
|
|
2958
2980
|
"first",
|
|
2959
2981
|
"first);",
|
|
@@ -3216,6 +3238,7 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
3216
3238
|
"horizontal",
|
|
3217
3239
|
"host",
|
|
3218
3240
|
"hover:bg-[var(--accent)]",
|
|
3241
|
+
"hover:bg-[var(--card)]",
|
|
3219
3242
|
"hover:bg-[var(--destructive)]/10",
|
|
3220
3243
|
"hover:bg-[var(--foreground)]/5",
|
|
3221
3244
|
"hover:bg-[var(--foreground)]/[0.03]",
|
|
@@ -3236,6 +3259,7 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
3236
3259
|
"html>",
|
|
3237
3260
|
"html><div",
|
|
3238
3261
|
"html><html",
|
|
3262
|
+
"html><html><body><div",
|
|
3239
3263
|
"html><html><head><style",
|
|
3240
3264
|
"https://ai-sdk.dev/elements)",
|
|
3241
3265
|
"https://esm.sh/mermaid@11.4.1?pin=v135",
|
|
@@ -3340,6 +3364,7 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
3340
3364
|
"input-box.tsx",
|
|
3341
3365
|
"input-streaming",
|
|
3342
3366
|
"input:",
|
|
3367
|
+
"input=",
|
|
3343
3368
|
"input={chat.input}",
|
|
3344
3369
|
"input={input}",
|
|
3345
3370
|
"input={input}>",
|
|
@@ -3630,9 +3655,9 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
3630
3655
|
"mb-4",
|
|
3631
3656
|
"md",
|
|
3632
3657
|
"md:",
|
|
3633
|
-
"md:px-4",
|
|
3634
|
-
"md:py-4",
|
|
3635
3658
|
"mdx:",
|
|
3659
|
+
"menu",
|
|
3660
|
+
"menuitem",
|
|
3636
3661
|
"mergeThemes",
|
|
3637
3662
|
"mergeThemes(defaultAgentTheme,",
|
|
3638
3663
|
"mergeThemes(defaultChatTheme,",
|
|
@@ -3711,11 +3736,13 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
3711
3736
|
"messagesRef.current.length",
|
|
3712
3737
|
"messages[messages.length",
|
|
3713
3738
|
"min-h-0",
|
|
3714
|
-
"min-h-
|
|
3739
|
+
"min-h-9",
|
|
3740
|
+
"min-h-[42px]",
|
|
3715
3741
|
"min-w-0",
|
|
3716
3742
|
"min-w-[220px]",
|
|
3717
3743
|
"min-w-[2ch]",
|
|
3718
3744
|
"min-w-full",
|
|
3745
|
+
"minWidth:",
|
|
3719
3746
|
"mismatch",
|
|
3720
3747
|
"ml-0.5",
|
|
3721
3748
|
"ml-1",
|
|
@@ -3911,6 +3938,7 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
3911
3938
|
"onAttach,",
|
|
3912
3939
|
"onAttach:",
|
|
3913
3940
|
"onAttach;",
|
|
3941
|
+
"onAttach={()",
|
|
3914
3942
|
"onAttach={onAttach}",
|
|
3915
3943
|
"onAttach?:",
|
|
3916
3944
|
"onBlur={commitRename}",
|
|
@@ -3934,6 +3962,7 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
3934
3962
|
"onChange(models[focusedIndex]!.value);",
|
|
3935
3963
|
"onChange,",
|
|
3936
3964
|
"onChange:",
|
|
3965
|
+
"onChange={()",
|
|
3937
3966
|
"onChange={(e)",
|
|
3938
3967
|
"onChange={(event)",
|
|
3939
3968
|
"onChange={chat.handleInputChange}",
|
|
@@ -4071,6 +4100,13 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
4071
4100
|
"onSelect,",
|
|
4072
4101
|
"onSelect:",
|
|
4073
4102
|
"onSelect={()",
|
|
4103
|
+
"onSelectAttachment",
|
|
4104
|
+
"onSelectAttachment();",
|
|
4105
|
+
"onSelectAttachment)",
|
|
4106
|
+
"onSelectAttachment,",
|
|
4107
|
+
"onSelectAttachment={()",
|
|
4108
|
+
"onSelectAttachment={onSelectAttachment}",
|
|
4109
|
+
"onSelectAttachment?:",
|
|
4074
4110
|
"onSelectThread(thread.id)}",
|
|
4075
4111
|
"onSelectThread,",
|
|
4076
4112
|
"onSelectThread:",
|
|
@@ -4144,6 +4180,7 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
4144
4180
|
"openai/gpt-4o",
|
|
4145
4181
|
"openai:",
|
|
4146
4182
|
"opening",
|
|
4183
|
+
"opens",
|
|
4147
4184
|
"option",
|
|
4148
4185
|
"option?.scrollIntoView({",
|
|
4149
4186
|
"optional",
|
|
@@ -4391,6 +4428,7 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
4391
4428
|
"react/components/chat",
|
|
4392
4429
|
"react/components/chat-style-provider",
|
|
4393
4430
|
"react/components/chat-tokens",
|
|
4431
|
+
"react/components/chat/chat/composition/chat-composer",
|
|
4394
4432
|
"react/components/chat/color-mode",
|
|
4395
4433
|
"react/components/chat/components/skill-badge",
|
|
4396
4434
|
"react/components/chat/components/tool-ui",
|
|
@@ -4571,7 +4609,6 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
4571
4609
|
"round",
|
|
4572
4610
|
"rounded",
|
|
4573
4611
|
"rounded-2xl",
|
|
4574
|
-
"rounded-[20px]",
|
|
4575
4612
|
"rounded-[22px]",
|
|
4576
4613
|
"rounded-full",
|
|
4577
4614
|
"rounded-lg",
|
|
@@ -4616,6 +4653,10 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
4616
4653
|
"second]",
|
|
4617
4654
|
"securityLevel:",
|
|
4618
4655
|
"seed{color:black}</style></head><body><div",
|
|
4656
|
+
"select",
|
|
4657
|
+
"selectAction",
|
|
4658
|
+
"selectAction.dispatchEvent(new",
|
|
4659
|
+
"selectCalls",
|
|
4619
4660
|
"selectThread",
|
|
4620
4661
|
"selectThread(id);",
|
|
4621
4662
|
"selectThread,",
|
|
@@ -4644,6 +4685,9 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
4644
4685
|
"setActiveThreadId(id);",
|
|
4645
4686
|
"setActiveThreadId(thread.id);",
|
|
4646
4687
|
"setActiveThreadId]",
|
|
4688
|
+
"setAttachmentMenuOpen((open)",
|
|
4689
|
+
"setAttachmentMenuOpen(false);",
|
|
4690
|
+
"setAttachmentMenuOpen]",
|
|
4647
4691
|
"setCardStyle({",
|
|
4648
4692
|
"setCardStyle]",
|
|
4649
4693
|
"setContent(e.target.value);",
|
|
@@ -4744,7 +4788,6 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
4744
4788
|
"setTimeout(resolve,",
|
|
4745
4789
|
"setTimeout>>(undefined);",
|
|
4746
4790
|
"shadow-lg",
|
|
4747
|
-
"shadow-md",
|
|
4748
4791
|
"shadow-sm",
|
|
4749
4792
|
"shadow-xl",
|
|
4750
4793
|
"shape",
|
|
@@ -5353,6 +5396,8 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
5353
5396
|
"updates.",
|
|
5354
5397
|
"updates:",
|
|
5355
5398
|
"upgrade",
|
|
5399
|
+
"upload",
|
|
5400
|
+
"uploadAction",
|
|
5356
5401
|
"uploaded",
|
|
5357
5402
|
"uploading",
|
|
5358
5403
|
"uploads",
|
|
@@ -5572,6 +5617,7 @@ export const FRAMEWORK_CANDIDATES = [
|
|
|
5572
5617
|
"yet</p>",
|
|
5573
5618
|
"your",
|
|
5574
5619
|
"your{",
|
|
5620
|
+
"z-20",
|
|
5575
5621
|
"z-50",
|
|
5576
5622
|
"zIndex:",
|
|
5577
5623
|
"zone",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rsc-bundles.generated.d.ts","sourceRoot":"","sources":["../../../../../../src/src/server/services/rsc/endpoints/rsc-bundles.generated.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"rsc-bundles.generated.d.ts","sourceRoot":"","sources":["../../../../../../src/src/server/services/rsc/endpoints/rsc-bundles.generated.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,kBAAkB,EAAE,MAC4hxB,CAAC;AAE9jxB,eAAO,MAAM,iBAAiB,EAAE,MACmjiB,CAAC"}
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* Do not edit manually — run `deno task generate` to regenerate.
|
|
6
6
|
* @module
|
|
7
7
|
*/
|
|
8
|
-
export const CLIENT_BOOT_BUNDLE = 'var W=Object.defineProperty;var q=(t,e,r)=>e in t?W(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var p=(t,e,r)=>q(t,typeof e!="symbol"?e+"":e,r);var z="3.2.3";function X(t,e,r,n){let s=[];if(n?.external?.length&&s.push(`external=${n.external.join(",")}`),s.push(`target=${n?.target??"es2022"}`),n?.deps){let d=Object.entries(n.deps).map(([l,R])=>`${l}@${R}`).join(",");s.push(`deps=${d}`)}let u=e?`@${e}`:"",c=r??"",i=s.length?`?${s.join("&")}`:"";return`https://esm.sh/${t}${u}${c}${i}`}function f(t,e,r,n=!1){return X(t,e,r,{external:n?["react"]:void 0,deps:{csstype:z}})}var K="19.2.4",E=K;function P(t=E){return{react:f("react",t),"react-dom":f("react-dom",t,void 0,!0),"react-dom/client":f("react-dom",t,"/client",!0),"react-dom/server":f("react-dom",t,"/server",!0),"react/jsx-runtime":f("react",t,"/jsx-runtime",!0),"react/jsx-dev-runtime":f("react",t,"/jsx-dev-runtime",!0)}}function V(t=E){return P(t).react}function w(t=E){return P(t)["react-dom/client"]}function Z(t){return t.replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}function D(t){return Z(btoa(t))}var Ht=Object.freeze({react:"","react-dom":"","react-dom/client":"","react-dom/server":"","react/jsx-runtime":"","react/jsx-dev-runtime":""});function v(t,e){if(!e)return!1;if(Object.prototype.hasOwnProperty.call(e,t))return!0;for(let r of Object.keys(e))if(r.endsWith("/")&&t.startsWith(r))return!0;return!1}function Q(t){try{return JSON.parse(t)?.imports??{}}catch{return{}}}function H(t=document){let e=t.querySelector(\'script[type="importmap"]\');return e?.textContent?Q(e.textContent):{}}var a="/_veryfront",b={RSC:`${a}/rsc/`,FS:`${a}/fs/`,MODULES:`${a}/modules/`,PAGES:`${a}/pages/`,DATA:`${a}/data/`,LIB:`${a}/lib/`,CHUNKS:`${a}/chunks/`,CLIENT:`${a}/client/`},F={HMR_RUNTIME:`${a}/hmr-runtime.js`,HMR:`${a}/hmr.js`,ERROR_OVERLAY:`${a}/error-overlay.js`,DEV_LOADER:`${a}/dev-loader.js`,CLIENT_LOG:`${a}/log`,CLIENT_JS:`${a}/client.js`,ROUTER_JS:`${a}/router.js`,PREFETCH_JS:`${a}/prefetch.js`,MANIFEST_JSON:`${a}/manifest.json`,APP_JS:`${a}/app.js`,RSC_CLIENT:`${a}/rsc/client.js`,RSC_MANIFEST:`${a}/rsc/manifest`,RSC_STREAM:`${a}/rsc/stream`,RSC_PAYLOAD:`${a}/rsc/payload`,RSC_RENDER:`${a}/rsc/render`,RSC_PAGE:`${a}/rsc/page`,RSC_MODULE:`${a}/rsc/module`,RSC_DOM:`${a}/rsc/dom.js`,LIB_CHAT_REACT:`${a}/lib/chat/react.js`,LIB_CHAT_COMPONENTS:`${a}/lib/chat/components.js`,LIB_CHAT_PRIMITIVES:`${a}/lib/chat/primitives.js`};var et={ROOT:".veryfront",CACHE:".veryfront/cache",KV:".veryfront/kv",LOGS:".veryfront/logs",TMP:".veryfront/tmp"},Gt=et.CACHE;var jt={HMR_RUNTIME:F.HMR_RUNTIME,ERROR_OVERLAY:F.ERROR_OVERLAY};var y=b.RSC,$=b.FS,k="veryfront-hydration-data",_="rsc-root";function x(t=document){try{let e=t.getElementById(k);return e?JSON.parse(e.textContent||"{}"):null}catch(e){return console.debug?.("[RSC] hydration data parse failed",e),null}}function S(t){return t?.clientModuleStrategy?t.clientModuleStrategy:t?.dev?"fs":"rsc-module"}function rt(t){return`${$}${D(t)}.js`}function ot(t,e){let r=e?`&v=${encodeURIComponent(e)}`:"";return`${y}module?rel=${encodeURIComponent(t)}${r}`}function T(t){if(t.strategy==="fs"){let e=t.absPath??t.rel;return e?rt(e):null}return ot(t.rel,t.version)}function I(t=document,e=E){let r=H(t);return{react:v("react",r)?"react":V(e),reactDomClient:v("react-dom/client",r)?"react-dom/client":w(e)}}function o(t){return{...t,create(e){return new M(e?.message||e?.detail||t.title,{slug:t.slug,category:t.category,status:e?.status??t.status,title:t.title,suggestion:t.suggestion,detail:e?.detail,cause:e?.cause,instance:e?.instance,context:e?.context})}}}var M=class extends Error{constructor(r,n){super(r);p(this,"slug");p(this,"category");p(this,"status");p(this,"title");p(this,"suggestion");p(this,"detail");p(this,"cause");p(this,"instance");p(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 le=o({slug:"config-not-found",category:"CONFIG",status:404,title:"Configuration file not found",suggestion:"Run \'vf init\' to create a configuration file"}),ue=o({slug:"config-invalid",category:"CONFIG",status:400,title:"Invalid configuration format",suggestion:"Check your veryfront.config.ts for syntax errors"}),ge=o({slug:"config-parse-error",category:"CONFIG",status:400,title:"Failed to parse configuration",suggestion:"Ensure your configuration file is valid TypeScript/JSON"}),de=o({slug:"config-validation-error",category:"CONFIG",status:422,title:"Configuration validation failed",suggestion:"Check the configuration against the schema requirements"}),pe=o({slug:"config-type-error",category:"CONFIG",status:400,title:"Configuration type mismatch",suggestion:"Ensure configuration values match expected types"}),Re=o({slug:"import-map-invalid",category:"CONFIG",status:400,title:"Invalid import map configuration",suggestion:"Check your import map syntax and paths"}),fe=o({slug:"cors-config-invalid",category:"CONFIG",status:400,title:"Invalid CORS configuration",suggestion:"Review CORS settings in your configuration"}),me=o({slug:"config-validation-failed",category:"CONFIG",status:400,title:"Configuration validation failed",suggestion:"Check configuration values against requirements"}),Ee=o({slug:"build-failed",category:"BUILD",status:500,title:"Build process failed",suggestion:"Check the build output for specific errors"}),ye=o({slug:"bundle-error",category:"BUILD",status:500,title:"Bundle generation failed",suggestion:"Review bundler output for details"}),_e=o({slug:"typescript-error",category:"BUILD",status:500,title:"TypeScript compilation error",suggestion:"Fix TypeScript errors shown in the output"}),he=o({slug:"mdx-compile-error",category:"BUILD",status:500,title:"MDX compilation failed",suggestion:"Check your MDX file syntax"}),Ce=o({slug:"asset-optimization-error",category:"BUILD",status:500,title:"Asset optimization failed",suggestion:"Check asset file formats and paths"}),Oe=o({slug:"ssg-generation-error",category:"BUILD",status:500,title:"Static site generation failed",suggestion:"Review SSG configuration and data fetching"}),xe=o({slug:"sourcemap-error",category:"BUILD",status:500,title:"Source map generation failed",suggestion:"Check source map configuration"}),Se=o({slug:"compilation-error",category:"BUILD",status:500,title:"Compilation failed",suggestion:"Review compiler output for specific errors"}),Te=o({slug:"hydration-mismatch",category:"RUNTIME",status:500,title:"Client/server hydration mismatch",suggestion:"Ensure server and client render the same content"}),Ie=o({slug:"render-error",category:"RUNTIME",status:500,title:"Component render failed",suggestion:"Check component for runtime errors"}),Ae=o({slug:"component-error",category:"RUNTIME",status:500,title:"Component execution error",suggestion:"Review component logic and props"}),Ne=o({slug:"layout-not-found",category:"RUNTIME",status:404,title:"Layout component not found",suggestion:"Ensure layout file exists at the expected path"}),De=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"}),ve=o({slug:"api-error",category:"RUNTIME",status:500,title:"API route handler error",suggestion:"Review API route handler for errors"}),be=o({slug:"middleware-error",category:"RUNTIME",status:500,title:"Middleware execution error",suggestion:"Check middleware function for errors"}),Me=o({slug:"route-conflict",category:"ROUTE",status:409,title:"Conflicting route definitions",suggestion:"Rename or reorganize conflicting route files"}),Le=o({slug:"invalid-route-file",category:"ROUTE",status:400,title:"Invalid route file structure",suggestion:"Ensure route file exports required functions"}),Ue=o({slug:"route-handler-invalid",category:"ROUTE",status:400,title:"Invalid route handler export",suggestion:"Export a valid handler function from the route file"}),Pe=o({slug:"dynamic-route-error",category:"ROUTE",status:500,title:"Dynamic route parsing failed",suggestion:"Check dynamic route segment syntax"}),Ve=o({slug:"route-params-error",category:"ROUTE",status:400,title:"Route parameters invalid",suggestion:"Validate route parameter values"}),we=o({slug:"api-route-error",category:"ROUTE",status:500,title:"API route definition error",suggestion:"Review API route configuration"}),He=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"}),Fe=o({slug:"import-resolution-error",category:"MODULE",status:500,title:"Import path resolution failed",suggestion:"Verify import paths and module configuration"}),$e=o({slug:"circular-dependency",category:"MODULE",status:500,title:"Circular dependency detected",suggestion:"Refactor imports to break the circular dependency"}),ke=o({slug:"invalid-import",category:"MODULE",status:400,title:"Invalid import statement",suggestion:"Fix import syntax or path"}),Be=o({slug:"dependency-missing",category:"MODULE",status:404,title:"Required dependency not installed",suggestion:"Install the missing dependency with your package manager"}),Ge=o({slug:"version-mismatch",category:"MODULE",status:409,title:"Dependency version mismatch",suggestion:"Update dependencies to compatible versions"}),je=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"}),Ye=o({slug:"server-start-error",category:"SERVER",status:500,title:"Server failed to start",suggestion:"Check server configuration and port availability"}),We=o({slug:"cache-error",category:"SERVER",status:500,title:"Cache operation failed",suggestion:"Clear the cache and try again"}),qe=o({slug:"file-watch-error",category:"SERVER",status:500,title:"File watcher error",suggestion:"Restart the development server"}),ze=o({slug:"request-error",category:"SERVER",status:500,title:"HTTP request handling error",suggestion:"Check request handler and middleware"}),Xe=o({slug:"service-overloaded",category:"SERVER",status:503,title:"Service overloaded",suggestion:"Reduce load or scale up resources"}),Je=o({slug:"cache-path-mismatch",category:"SERVER",status:500,title:"Cache path mismatch",suggestion:"Clear the cache directory and rebuild"}),Ke=o({slug:"network-error",category:"SERVER",status:502,title:"Network operation failed",suggestion:"Check network connectivity and retry"}),Ze=o({slug:"api-client-error",category:"SERVER",status:500,title:"API client request failed",suggestion:"Check API connectivity and authentication"}),Qe=o({slug:"token-storage-error",category:"SERVER",status:500,title:"Token storage operation failed",suggestion:"Check token storage backend and credentials"}),tr=o({slug:"cache-invariant-violation",category:"SERVER",status:500,title:"Cache path invariant violated",suggestion:"Clear the cache and rebuild"}),er=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"}),rr=o({slug:"fallback-exhausted",category:"SERVER",status:500,title:"Primary and fallback operations both failed",suggestion:"Check service availability and connectivity"}),or=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"}),nr=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"}),sr=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"}),ir=o({slug:"invalid-use-client",category:"BOUNDARY",status:400,title:"Invalid \'use client\' directive",suggestion:"Place \'use client\' at the top of the file"}),ar=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"}),cr=o({slug:"rsc-payload-error",category:"BOUNDARY",status:500,title:"RSC payload serialization error",suggestion:"Ensure props are serializable (no functions, symbols, etc.)"}),lr=o({slug:"hmr-error",category:"DEV",status:500,title:"Hot module replacement error",suggestion:"Restart the development server"}),ur=o({slug:"dev-server-error",category:"DEV",status:500,title:"Development server error",suggestion:"Check the dev server logs and restart"}),gr=o({slug:"fast-refresh-error",category:"DEV",status:500,title:"Fast refresh failed",suggestion:"Save the file again or restart the dev server"}),dr=o({slug:"error-overlay-error",category:"DEV",status:500,title:"Error overlay failed",suggestion:"Check browser console for details"}),pr=o({slug:"source-map-error",category:"DEV",status:500,title:"Source map loading error",suggestion:"Rebuild or clear cache"}),Rr=o({slug:"deployment-error",category:"DEPLOY",status:500,title:"Deployment process failed",suggestion:"Check deployment logs for details"}),fr=o({slug:"platform-error",category:"DEPLOY",status:500,title:"Platform-specific error",suggestion:"Check platform documentation and requirements"}),mr=o({slug:"env-var-missing",category:"DEPLOY",status:500,title:"Required environment variable missing",suggestion:"Set the required environment variable"}),Er=o({slug:"production-build-required",category:"DEPLOY",status:400,title:"Production build required",suggestion:"Run \'vf build\' before deploying"}),yr=o({slug:"agent-error",category:"AGENT",status:500,title:"Agent operation error",suggestion:"Check agent configuration and logs"}),_r=o({slug:"agent-not-found",category:"AGENT",status:404,title:"Agent not found",suggestion:"Verify the agent ID exists"}),hr=o({slug:"agent-timeout",category:"AGENT",status:408,title:"Agent operation timed out",suggestion:"Increase timeout or simplify the request"}),Cr=o({slug:"agent-intent-error",category:"AGENT",status:400,title:"Agent intent parsing error",suggestion:"Rephrase the request more clearly"}),Or=o({slug:"orchestration-error",category:"AGENT",status:500,title:"Multi-agent orchestration error",suggestion:"Check agent coordination logic"}),xr=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"}),Sr=o({slug:"unknown-error",category:"GENERAL",status:500,title:"Unknown/unclassified error",suggestion:"Check logs for more details"}),Tr=o({slug:"permission-denied",category:"GENERAL",status:403,title:"File/resource permission denied",suggestion:"Check file permissions and access rights"}),Ir=o({slug:"file-not-found",category:"GENERAL",status:404,title:"File not found",suggestion:"Verify the file path exists"}),Ar=o({slug:"resource-not-found",category:"GENERAL",status:404,title:"Requested resource not found",suggestion:"Verify the referenced resource ID or name exists"}),Nr=o({slug:"invalid-argument",category:"GENERAL",status:400,title:"Invalid function argument",suggestion:"Check argument types and values"}),Dr=o({slug:"timeout-error",category:"GENERAL",status:408,title:"Operation timed out",suggestion:"Increase timeout or optimize the operation"}),vr=o({slug:"initialization-error",category:"GENERAL",status:500,title:"Initialization failed",suggestion:"Check initialization requirements and dependencies"}),br=o({slug:"not-supported",category:"GENERAL",status:501,title:"Feature not supported",suggestion:"Check documentation for supported features"}),B=o({slug:"security-violation",category:"GENERAL",status:403,title:"Security violation detected",suggestion:"Check for path traversal or unauthorized access attempts"}),Mr=o({slug:"input-validation-failed",category:"GENERAL",status:400,title:"Input validation failed",suggestion:"Check request input against validation rules"});var nt=[{pattern:/<script[^>]*>[\\s\\S]*?<\\/script>/gi,name:"inline script"},{pattern:/javascript:/gi,name:"javascript: URL"},{pattern:/\\bon\\w+\\s*=/gi,name:"event handler attribute"},{pattern:/data:\\s*text\\/html/gi,name:"data: HTML URL"}];function st(){let t=globalThis;return t.__VERYFRONT_DEV__===!0||t.Deno?.env?.get?.("VERYFRONT_ENV")==="development"}function h(t,e={}){let{strict:r=!1,warn:n=!0}=e;for(let{pattern:s,name:u}of nt)if(s.lastIndex=0,!!s.test(t)&&(n&&console.warn(`[Security] Suspicious ${u} detected in server HTML`),r||!st()))throw B.create({detail:`Potentially unsafe HTML: ${u} detected`});return t}var m=class{constructor(e,r){this.prefix=e;this.level=r}log(e,r,n,...s){this.level>e||r?.(n,...s)}debug(e,...r){this.log(0,console.debug,`[${this.prefix}] DEBUG: ${e}`,...r)}info(e,...r){this.log(1,console.log,`[${this.prefix}] ${e}`,...r)}warn(e,...r){this.log(2,console.warn,`[${this.prefix}] WARN: ${e}`,...r)}error(e,...r){this.log(3,console.error,`[${this.prefix}] ERROR: ${e}`,...r)}};function it(){if(typeof window>"u")return 2;let t=globalThis;return t.__VERYFRONT_DEV__||t.__RSC_DEV__?t.__VERYFRONT_DEBUG__||t.__RSC_DEBUG__?0:1:2}var A=it(),g=new m("RSC",A),Hr=new m("PREFETCH",A),Fr=new m("HYDRATE",A),$r=new m("VERYFRONT",A);function C(t,e){let r=e==="root"?_:`rsc-slot-${e}`,n=t.getElementById(r);if(n)return n;let s=t.createElement("div");return s.id=r,t.body.appendChild(s),s}function at(t,e){if(e.type!=="slot")return;let r=C(t,e.id);r.innerHTML=h(String(e.html??""))}function G(t,e){let r=e.split(`\n`),n=r.pop()??"";for(let s of r){let u=s.trim();if(!u)continue;let c;try{c=JSON.parse(u)}catch(d){g.debug("[client-dom] malformed NDJSON line",{line:u,error:d instanceof Error?d.message:String(d)});continue}if(!c||typeof c!="object")continue;let i=c;if(i.type==="slot"){at(t,i);try{ut(t,i.id||"root")}catch(d){g.debug("[client-dom] hydration optional failed",d)}}}return n}function ct(t){return new Promise((e,r)=>{let n=()=>r(new DOMException("aborted","AbortError"));if(t.aborted){n();return}t.addEventListener("abort",n,{once:!0})})}async function j(t,e=document,r){let n="body"in t?t:null,s=n?.body??t;if(!s)return;let u=s.getReader(),c=new TextDecoder,i="",d=!1;try{for(;;){if(r?.aborted)throw new DOMException("aborted","AbortError");let l=u.read(),{done:R,value:O}=r?await Promise.race([l,ct(r)]):await l;if(R){d=!0;break}i+=c.decode(O,{stream:!0}),i=G(e,i)}i&&G(e,`${i}\n`)}catch(l){throw l instanceof Error&&l.name==="AbortError"||g.debug("[client-dom] consumeNdjsonStream error",l),l}finally{try{await u.cancel()}catch(l){d||g.debug("[client-dom] reader.cancel failed",l)}try{u.releaseLock()}catch(l){g.debug("[client-dom] reader.releaseLock failed",l)}if(typeof s.cancel=="function")try{await s.cancel()}catch(l){g.debug("[client-dom] stream.cancel failed",l)}if(typeof n?.body?.cancel=="function")try{await n.body.cancel()}catch(l){g.debug("[client-dom] response.body.cancel failed",l)}}}function lt(t,e){let r=C(t,e),n=[],s=u=>{let c=u;c.dataset?.clientRef&&n.push(c);for(let i of u.children)s(i)};return s(r),n}function ut(t,e){let r=lt(t,e);for(let n of r){let s=n.dataset?.clientRef;s&&(n.dataset.hydrated="true",g.debug("[client-dom] marked for hydration",s))}}var gt=100;function dt(t,e){if(globalThis.__VF_CLIENT_MOD_CACHE??(globalThis.__VF_CLIENT_MOD_CACHE=new Map),globalThis.__VF_CLIENT_MOD_CACHE.size>=gt){let r=globalThis.__VF_CLIENT_MOD_CACHE.keys().next().value;r&&globalThis.__VF_CLIENT_MOD_CACHE.delete(r)}globalThis.__VF_CLIENT_MOD_CACHE.set(t,e)}function pt(t){let e=t.match(/^\\/app\\/(.+)#([A-Za-z0-9_]+)$/);return e?{rel:`/${e[1]||""}`,exportName:e[2]||"default"}:null}async function Rt(){try{let t=await fetch("/_veryfront/rsc/manifest");return t.ok?await t.json():null}catch{return null}}async function ft(t,e,r){let n=t.graphIds?.client.find(c=>c.rel===e)?.path,s=`${e}#${t.hash??""}`;try{let c=globalThis.__VF_CLIENT_MOD_CACHE?.get(s);if(c)return c}catch(c){g.debug("hydrate: cache get failed",c)}let u=T({strategy:r,rel:e,absPath:n,version:t.hash});if(!u)return null;try{let c=await import(u);try{dt(s,c)}catch(i){g.debug("hydrate: cache set failed",i)}return c}catch(c){return g.debug("hydrate: failed to import module",{moduleUrl:u,error:c}),null}}async function Y(t=document){let e=null;try{e=await Rt()}catch(i){g.debug("hydrate: fetch manifest failed",i)}if(!e){g.debug("hydrate: no manifest");return}let r=Array.from(t.querySelectorAll("[data-client-ref]"));try{let i=globalThis.__VF_MANIFEST_HASH;if(!r.some(l=>l.dataset?.hydrated!=="true")&&i&&e.hash&&i===e.hash)return}catch(i){g.debug("hydrate: hmr hash read failed",i)}if(r.length===0){try{globalThis.__VF_MANIFEST_HASH=e.hash??""}catch(i){g.debug("hydrate: set hash failed",i)}return}let n=S(x(t));try{if(globalThis.__VF_TEST_MODE__){globalThis.__VF_HYDRATE_CALLED=!0,globalThis.__VF_MANIFEST_HASH=e.hash??"";return}}catch(i){g.debug("hydrate: test mode flags failed",i)}let s=I(t),[{default:u},{createRoot:c}]=await Promise.all([import(s.react),import(s.reactDomClient)]);for(let i of r){let d=i.dataset?.clientRef??"";if(!d||i.dataset?.hydrated==="true")continue;let l=pt(d);if(!l)continue;let R=await ft(e,l.rel,n);if(!R)continue;let O=R[l.exportName]??R.default;if(typeof O=="function")try{c(i).render(u.createElement(O,{})),i.dataset.hydrated="true"}catch(U){g.warn("hydrate: render failed",U)}}try{globalThis.__VF_MANIFEST_HASH=e.hash??""}catch(i){g.debug("hydrate: set hash failed (post)",i)}}async function mt(){let t=I(document),[e,r]=await Promise.all([import(t.react),import(t.reactDomClient)]);return{React:e,ReactDOM:r}}var Et=new Set(["SCRIPT","STYLE","NOSCRIPT","TEMPLATE"]);function L(t){let e=t.getAttribute("style")??"";return t.hasAttribute("data-veryfront-head")||t.hasAttribute("hidden")||/(?:^|;)\\s*display\\s*:\\s*none(?:\\s*;|$)/i.test(e)||Et.has(t.tagName.toUpperCase())}function yt(t,e){return t.find(r=>r.tagName.toUpperCase()==="DIV"&&!!r.getAttribute("class")?.trim()&&!L(r))??e}function _t(t,e){return t===e}function ht(t,e){let r=document.createElement("div");r.setAttribute("data-veryfront-hydration-root","page");let n=t.find(s=>!L(s));n?.parentNode===e?e.insertBefore(r,n):e.appendChild(r);for(let s of t)!L(s)&&s.parentNode===e&&r.appendChild(s);return r}function Ct(t,e){return!!e?.pagePath&&typeof t?.__veryfrontRenderPage=="function"}function Ot(t,e){return e?.pagePath?!1:!!t.getElementById(_)}function xt(t=import.meta.url){try{return new URL(t,"http://veryfront.local").searchParams.get("hydrate")==="1"}catch{return!1}}async function St(t){try{let e=await fetch(y+"stream"+t);if(!e.ok||!e.body)return!1;let r=new AbortController;return addEventListener("pagehide",()=>r.abort(),{once:!0}),await j(e,document,r.signal),!0}catch(e){return console.debug?.("[RSC] tryStream failed",e),!1}}async function N(){try{await Y(document)}catch(t){console.debug?.("[RSC] hydration failed",t)}}async function Tt(t,e){try{let{React:r,ReactDOM:n}=await mt(),s=T({strategy:e,rel:t});if(!s)return!1;console.debug?.("[RSC] Loading component from:",s);let c=(await import(s)).default;if(typeof c!="function")return console.debug?.("[RSC] Page component is not a function"),!1;let i=Array.from(document.body.children),d=yt(i,document.body),l=_t(d,document.body)?ht(i,document.body):d,R=r.createElement(c,{});return n.hydrateRoot(l,R,{identifierPrefix:"vf",onRecoverableError:()=>{}}),console.debug?.("[RSC] Page component hydrated successfully"),!0}catch(r){return console.error("[RSC] Page hydration failed",r),!1}}async function It(t){try{let e=await fetch(y+"payload"+t);if(!e.ok)return!1;let r=await e.json();if(r?.slots){for(let[n,s]of Object.entries(r.slots))C(document,n).innerHTML=h(String(s||""));return!0}return C(document,_).innerHTML=h(String(r?.html||"")),!0}catch(e){return console.debug?.("[RSC] payload fetch failed",e),!1}}async function At(){try{let t=globalThis.window?.location.search??"",e=x(document);if(xt()){await N();return}let r=e?.pagePath,n=S(e);if(r){if(Ct(globalThis.window,e)){console.debug?.("[RSC] Page renderer owns hydration");return}console.debug?.("[RSC] Found page component in hydration data:",r),await Tt(r,n)&&console.debug?.("[RSC] Client component hydrated successfully");return}if(!Ot(document,e))return;if(await St(t)){await N();return}if(await It(t)){await N();return}await N()}catch(t){console.error("[RSC] boot failed",t)}}if(typeof document<"u"){let t=()=>{At()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t,{once:!0}):t()}export{At as boot,yt as selectHydrationRoot,Ot as shouldAttemptRSCTransport,xt as shouldHydrateOnly,Ct as shouldUsePageRendererHydration,_t as shouldWrapPageHydrationRoot};\n';
|
|
8
|
+
export const CLIENT_BOOT_BUNDLE = 'var W=Object.defineProperty;var q=(t,e,r)=>e in t?W(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var R=(t,e,r)=>q(t,typeof e!="symbol"?e+"":e,r);var z="3.2.3";function X(t,e,r,n){let s=[];if(n?.external?.length&&s.push(`external=${n.external.join(",")}`),s.push(`target=${n?.target??"es2022"}`),n?.deps){let d=Object.entries(n.deps).map(([l,p])=>`${l}@${p}`).join(",");s.push(`deps=${d}`)}let u=e?`@${e}`:"",c=r??"",i=s.length?`?${s.join("&")}`:"";return`https://esm.sh/${t}${u}${c}${i}`}function f(t,e,r,n=!1){return X(t,e,r,{external:n?["react"]:void 0,deps:{csstype:z}})}var K="19.2.4",E=K;function P(t=E){return{react:f("react",t),"react-dom":f("react-dom",t,void 0,!0),"react-dom/client":f("react-dom",t,"/client",!0),"react-dom/server":f("react-dom",t,"/server",!0),"react/jsx-runtime":f("react",t,"/jsx-runtime",!0),"react/jsx-dev-runtime":f("react",t,"/jsx-dev-runtime",!0)}}function V(t=E){return P(t).react}function w(t=E){return P(t)["react-dom/client"]}function Z(t){return t.replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}function D(t){return Z(btoa(t))}var Ft=Object.freeze({react:"","react-dom":"","react-dom/client":"","react-dom/server":"","react/jsx-runtime":"","react/jsx-dev-runtime":""});function v(t,e){if(!e)return!1;if(Object.prototype.hasOwnProperty.call(e,t))return!0;for(let r of Object.keys(e))if(r.endsWith("/")&&t.startsWith(r))return!0;return!1}function Q(t){try{return JSON.parse(t)?.imports??{}}catch{return{}}}function H(t=document){let e=t.querySelector(\'script[type="importmap"]\');return e?.textContent?Q(e.textContent):{}}var a="/_veryfront",b={RSC:`${a}/rsc/`,FS:`${a}/fs/`,MODULES:`${a}/modules/`,PAGES:`${a}/pages/`,DATA:`${a}/data/`,LIB:`${a}/lib/`,CHUNKS:`${a}/chunks/`,CLIENT:`${a}/client/`},F={HMR_RUNTIME:`${a}/hmr-runtime.js`,HMR:`${a}/hmr.js`,ERROR_OVERLAY:`${a}/error-overlay.js`,DEV_LOADER:`${a}/dev-loader.js`,CLIENT_LOG:`${a}/log`,CLIENT_JS:`${a}/client.js`,ROUTER_JS:`${a}/router.js`,PREFETCH_JS:`${a}/prefetch.js`,MANIFEST_JSON:`${a}/manifest.json`,APP_JS:`${a}/app.js`,RSC_CLIENT:`${a}/rsc/client.js`,RSC_MANIFEST:`${a}/rsc/manifest`,RSC_STREAM:`${a}/rsc/stream`,RSC_PAYLOAD:`${a}/rsc/payload`,RSC_RENDER:`${a}/rsc/render`,RSC_PAGE:`${a}/rsc/page`,RSC_MODULE:`${a}/rsc/module`,RSC_DOM:`${a}/rsc/dom.js`,LIB_CHAT_REACT:`${a}/lib/chat/react.js`,LIB_CHAT_COMPONENTS:`${a}/lib/chat/components.js`,LIB_CHAT_PRIMITIVES:`${a}/lib/chat/primitives.js`};var et={ROOT:".veryfront",CACHE:".veryfront/cache",KV:".veryfront/kv",LOGS:".veryfront/logs",TMP:".veryfront/tmp"},jt=et.CACHE;var Yt={HMR_RUNTIME:F.HMR_RUNTIME,ERROR_OVERLAY:F.ERROR_OVERLAY};var y=b.RSC,$=b.FS,k="veryfront-hydration-data",_="rsc-root";function O(t=document){try{let e=t.getElementById(k);return e?JSON.parse(e.textContent||"{}"):null}catch(e){return console.debug?.("[RSC] hydration data parse failed",e),null}}function S(t){return t?.clientModuleStrategy?t.clientModuleStrategy:t?.dev?"fs":"rsc-module"}function rt(t){return`${$}${D(t)}.js`}function ot(t,e){let r=e?`&v=${encodeURIComponent(e)}`:"";return`${y}module?rel=${encodeURIComponent(t)}${r}`}function T(t){if(t.strategy==="fs"){let e=t.absPath??t.rel;return e?rt(e):null}return ot(t.rel,t.version)}function I(t=document,e=E){let r=H(t);return{react:v("react",r)?"react":V(e),reactDomClient:v("react-dom/client",r)?"react-dom/client":w(e)}}function o(t){return{...t,create(e){return new M(e?.message||e?.detail||t.title,{slug:t.slug,category:t.category,status:e?.status??t.status,title:t.title,suggestion:t.suggestion,detail:e?.detail,cause:e?.cause,instance:e?.instance,context:e?.context})}}}var M=class extends Error{constructor(r,n){super(r);R(this,"slug");R(this,"category");R(this,"status");R(this,"title");R(this,"suggestion");R(this,"detail");R(this,"cause");R(this,"instance");R(this,"context");this.name="VeryfrontError",this.slug=n.slug,this.category=n.category,this.status=n.status,this.title=n.title,this.suggestion=n.suggestion,this.detail=n.detail,this.cause=n.cause,this.instance=n.instance,this.context=n.context}toRFC9457(){return{type:`https://veryfront.com/docs/errors/${this.slug}`,title:this.title,status:this.status,detail:this.detail,instance:this.instance,category:this.category,suggestion:this.suggestion,cause:typeof this.cause=="string"?this.cause:void 0}}getDocsUrl(){return`https://veryfront.com/docs/errors/${this.slug}`}};var ue=o({slug:"config-not-found",category:"CONFIG",status:404,title:"Configuration file not found",suggestion:"Run \'vf init\' to create a configuration file"}),ge=o({slug:"config-invalid",category:"CONFIG",status:400,title:"Invalid configuration format",suggestion:"Check your veryfront.config.ts for syntax errors"}),de=o({slug:"config-parse-error",category:"CONFIG",status:400,title:"Failed to parse configuration",suggestion:"Ensure your configuration file is valid TypeScript/JSON"}),pe=o({slug:"config-validation-error",category:"CONFIG",status:422,title:"Configuration validation failed",suggestion:"Check the configuration against the schema requirements"}),Re=o({slug:"config-type-error",category:"CONFIG",status:400,title:"Configuration type mismatch",suggestion:"Ensure configuration values match expected types"}),fe=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"}),Ee=o({slug:"config-validation-failed",category:"CONFIG",status:400,title:"Configuration validation failed",suggestion:"Check configuration values against requirements"}),ye=o({slug:"build-failed",category:"BUILD",status:500,title:"Build process failed",suggestion:"Check the build output for specific errors"}),_e=o({slug:"bundle-error",category:"BUILD",status:500,title:"Bundle generation failed",suggestion:"Review bundler output for details"}),he=o({slug:"typescript-error",category:"BUILD",status:500,title:"TypeScript compilation error",suggestion:"Fix TypeScript errors shown in the output"}),Ce=o({slug:"mdx-compile-error",category:"BUILD",status:500,title:"MDX compilation failed",suggestion:"Check your MDX file syntax"}),xe=o({slug:"asset-optimization-error",category:"BUILD",status:500,title:"Asset optimization failed",suggestion:"Check asset file formats and paths"}),Oe=o({slug:"ssg-generation-error",category:"BUILD",status:500,title:"Static site generation failed",suggestion:"Review SSG configuration and data fetching"}),Se=o({slug:"sourcemap-error",category:"BUILD",status:500,title:"Source map generation failed",suggestion:"Check source map configuration"}),Te=o({slug:"compilation-error",category:"BUILD",status:500,title:"Compilation failed",suggestion:"Review compiler output for specific errors"}),Ie=o({slug:"hydration-mismatch",category:"RUNTIME",status:500,title:"Client/server hydration mismatch",suggestion:"Ensure server and client render the same content"}),Ae=o({slug:"render-error",category:"RUNTIME",status:500,title:"Component render failed",suggestion:"Check component for runtime errors"}),Ne=o({slug:"component-error",category:"RUNTIME",status:500,title:"Component execution error",suggestion:"Review component logic and props"}),De=o({slug:"layout-not-found",category:"RUNTIME",status:404,title:"Layout component not found",suggestion:"Ensure layout file exists at the expected path"}),ve=o({slug:"page-not-found",category:"RUNTIME",status:404,title:"Page component not found",suggestion:"Check that the page file exists in the routes directory"}),be=o({slug:"api-error",category:"RUNTIME",status:500,title:"API route handler error",suggestion:"Review API route handler for errors"}),Me=o({slug:"middleware-error",category:"RUNTIME",status:500,title:"Middleware execution error",suggestion:"Check middleware function for errors"}),Le=o({slug:"route-conflict",category:"ROUTE",status:409,title:"Conflicting route definitions",suggestion:"Rename or reorganize conflicting route files"}),Ue=o({slug:"invalid-route-file",category:"ROUTE",status:400,title:"Invalid route file structure",suggestion:"Ensure route file exports required functions"}),Pe=o({slug:"route-handler-invalid",category:"ROUTE",status:400,title:"Invalid route handler export",suggestion:"Export a valid handler function from the route file"}),Ve=o({slug:"dynamic-route-error",category:"ROUTE",status:500,title:"Dynamic route parsing failed",suggestion:"Check dynamic route segment syntax"}),we=o({slug:"route-params-error",category:"ROUTE",status:400,title:"Route parameters invalid",suggestion:"Validate route parameter values"}),He=o({slug:"api-route-error",category:"ROUTE",status:500,title:"API route definition error",suggestion:"Review API route configuration"}),Fe=o({slug:"module-not-found",category:"MODULE",status:404,title:"Module could not be resolved",suggestion:"Check the import path and ensure the module is installed"}),$e=o({slug:"import-resolution-error",category:"MODULE",status:500,title:"Import path resolution failed",suggestion:"Verify import paths and module configuration"}),ke=o({slug:"circular-dependency",category:"MODULE",status:500,title:"Circular dependency detected",suggestion:"Refactor imports to break the circular dependency"}),Be=o({slug:"invalid-import",category:"MODULE",status:400,title:"Invalid import statement",suggestion:"Fix import syntax or path"}),Ge=o({slug:"dependency-missing",category:"MODULE",status:404,title:"Required dependency not installed",suggestion:"Install the missing dependency with your package manager"}),je=o({slug:"version-mismatch",category:"MODULE",status:409,title:"Dependency version mismatch",suggestion:"Update dependencies to compatible versions"}),Ye=o({slug:"port-in-use",category:"SERVER",status:409,title:"Server port already in use",suggestion:"Use a different port or stop the process using this port"}),We=o({slug:"server-start-error",category:"SERVER",status:500,title:"Server failed to start",suggestion:"Check server configuration and port availability"}),qe=o({slug:"cache-error",category:"SERVER",status:500,title:"Cache operation failed",suggestion:"Clear the cache and try again"}),ze=o({slug:"file-watch-error",category:"SERVER",status:500,title:"File watcher error",suggestion:"Restart the development server"}),Xe=o({slug:"request-error",category:"SERVER",status:500,title:"HTTP request handling error",suggestion:"Check request handler and middleware"}),Je=o({slug:"service-overloaded",category:"SERVER",status:503,title:"Service overloaded",suggestion:"Reduce load or scale up resources"}),Ke=o({slug:"cache-path-mismatch",category:"SERVER",status:500,title:"Cache path mismatch",suggestion:"Clear the cache directory and rebuild"}),Ze=o({slug:"network-error",category:"SERVER",status:502,title:"Network operation failed",suggestion:"Check network connectivity and retry"}),Qe=o({slug:"api-client-error",category:"SERVER",status:500,title:"API client request failed",suggestion:"Check API connectivity and authentication"}),tr=o({slug:"token-storage-error",category:"SERVER",status:500,title:"Token storage operation failed",suggestion:"Check token storage backend and credentials"}),er=o({slug:"cache-invariant-violation",category:"SERVER",status:500,title:"Cache path invariant violated",suggestion:"Clear the cache and rebuild"}),rr=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"}),or=o({slug:"fallback-exhausted",category:"SERVER",status:500,title:"Primary and fallback operations both failed",suggestion:"Check service availability and connectivity"}),nr=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"}),sr=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"}),ir=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"}),ar=o({slug:"invalid-use-client",category:"BOUNDARY",status:400,title:"Invalid \'use client\' directive",suggestion:"Place \'use client\' at the top of the file"}),cr=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"}),lr=o({slug:"rsc-payload-error",category:"BOUNDARY",status:500,title:"RSC payload serialization error",suggestion:"Ensure props are serializable (no functions, symbols, etc.)"}),ur=o({slug:"hmr-error",category:"DEV",status:500,title:"Hot module replacement error",suggestion:"Restart the development server"}),gr=o({slug:"dev-server-error",category:"DEV",status:500,title:"Development server error",suggestion:"Check the dev server logs and restart"}),dr=o({slug:"fast-refresh-error",category:"DEV",status:500,title:"Fast refresh failed",suggestion:"Save the file again or restart the dev server"}),pr=o({slug:"error-overlay-error",category:"DEV",status:500,title:"Error overlay failed",suggestion:"Check browser console for details"}),Rr=o({slug:"source-map-error",category:"DEV",status:500,title:"Source map loading error",suggestion:"Rebuild or clear cache"}),fr=o({slug:"deployment-error",category:"DEPLOY",status:500,title:"Deployment process failed",suggestion:"Check deployment logs for details"}),mr=o({slug:"platform-error",category:"DEPLOY",status:500,title:"Platform-specific error",suggestion:"Check platform documentation and requirements"}),Er=o({slug:"env-var-missing",category:"DEPLOY",status:500,title:"Required environment variable missing",suggestion:"Set the required environment variable"}),yr=o({slug:"production-build-required",category:"DEPLOY",status:400,title:"Production build required",suggestion:"Run \'vf build\' before deploying"}),_r=o({slug:"agent-error",category:"AGENT",status:500,title:"Agent operation error",suggestion:"Check agent configuration and logs"}),hr=o({slug:"agent-not-found",category:"AGENT",status:404,title:"Agent not found",suggestion:"Verify the agent ID exists"}),Cr=o({slug:"agent-timeout",category:"AGENT",status:408,title:"Agent operation timed out",suggestion:"Increase timeout or simplify the request"}),xr=o({slug:"agent-intent-error",category:"AGENT",status:400,title:"Agent intent parsing error",suggestion:"Rephrase the request more clearly"}),Or=o({slug:"orchestration-error",category:"AGENT",status:500,title:"Multi-agent orchestration error",suggestion:"Check agent coordination logic"}),Sr=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"}),Tr=o({slug:"unknown-error",category:"GENERAL",status:500,title:"Unknown/unclassified error",suggestion:"Check logs for more details"}),Ir=o({slug:"permission-denied",category:"GENERAL",status:403,title:"File/resource permission denied",suggestion:"Check file permissions and access rights"}),Ar=o({slug:"file-not-found",category:"GENERAL",status:404,title:"File not found",suggestion:"Verify the file path exists"}),Nr=o({slug:"resource-not-found",category:"GENERAL",status:404,title:"Requested resource not found",suggestion:"Verify the referenced resource ID or name exists"}),Dr=o({slug:"invalid-argument",category:"GENERAL",status:400,title:"Invalid function argument",suggestion:"Check argument types and values"}),vr=o({slug:"timeout-error",category:"GENERAL",status:408,title:"Operation timed out",suggestion:"Increase timeout or optimize the operation"}),br=o({slug:"initialization-error",category:"GENERAL",status:500,title:"Initialization failed",suggestion:"Check initialization requirements and dependencies"}),Mr=o({slug:"not-supported",category:"GENERAL",status:501,title:"Feature not supported",suggestion:"Check documentation for supported features"}),B=o({slug:"security-violation",category:"GENERAL",status:403,title:"Security violation detected",suggestion:"Check for path traversal or unauthorized access attempts"}),Lr=o({slug:"input-validation-failed",category:"GENERAL",status:400,title:"Input validation failed",suggestion:"Check request input against validation rules"});var nt=[{pattern:/<script[^>]*>[\\s\\S]*?<\\/script>/gi,name:"inline script"},{pattern:/javascript:/gi,name:"javascript: URL"},{pattern:/\\bon\\w+\\s*=/gi,name:"event handler attribute"},{pattern:/data:\\s*text\\/html/gi,name:"data: HTML URL"}];function st(){let t=globalThis;return t.__VERYFRONT_DEV__===!0||t.Deno?.env?.get?.("VERYFRONT_ENV")==="development"}function h(t,e={}){let{strict:r=!1,warn:n=!0}=e;for(let{pattern:s,name:u}of nt)if(s.lastIndex=0,!!s.test(t)&&(n&&console.warn(`[Security] Suspicious ${u} detected in server HTML`),r||!st()))throw B.create({detail:`Potentially unsafe HTML: ${u} detected`});return t}var m=class{constructor(e,r){this.prefix=e;this.level=r}log(e,r,n,...s){this.level>e||r?.(n,...s)}debug(e,...r){this.log(0,console.debug,`[${this.prefix}] DEBUG: ${e}`,...r)}info(e,...r){this.log(1,console.log,`[${this.prefix}] ${e}`,...r)}warn(e,...r){this.log(2,console.warn,`[${this.prefix}] WARN: ${e}`,...r)}error(e,...r){this.log(3,console.error,`[${this.prefix}] ERROR: ${e}`,...r)}};function it(){if(typeof window>"u")return 2;let t=globalThis;return t.__VERYFRONT_DEV__||t.__RSC_DEV__?t.__VERYFRONT_DEBUG__||t.__RSC_DEBUG__?0:1:2}var A=it(),g=new m("RSC",A),Fr=new m("PREFETCH",A),$r=new m("HYDRATE",A),kr=new m("VERYFRONT",A);function C(t,e){let r=e==="root"?_:`rsc-slot-${e}`,n=t.getElementById(r);if(n)return n;let s=t.createElement("div");return s.id=r,t.body.appendChild(s),s}function at(t,e){if(e.type!=="slot")return;let r=C(t,e.id);r.innerHTML=h(String(e.html??""))}function G(t,e){let r=e.split(`\n`),n=r.pop()??"";for(let s of r){let u=s.trim();if(!u)continue;let c;try{c=JSON.parse(u)}catch(d){g.debug("[client-dom] malformed NDJSON line",{line:u,error:d instanceof Error?d.message:String(d)});continue}if(!c||typeof c!="object")continue;let i=c;if(i.type==="slot"){at(t,i);try{ut(t,i.id||"root")}catch(d){g.debug("[client-dom] hydration optional failed",d)}}}return n}function ct(t){return new Promise((e,r)=>{let n=()=>r(new DOMException("aborted","AbortError"));if(t.aborted){n();return}t.addEventListener("abort",n,{once:!0})})}async function j(t,e=document,r){let n="body"in t?t:null,s=n?.body??t;if(!s)return;let u=s.getReader(),c=new TextDecoder,i="",d=!1;try{for(;;){if(r?.aborted)throw new DOMException("aborted","AbortError");let l=u.read(),{done:p,value:x}=r?await Promise.race([l,ct(r)]):await l;if(p){d=!0;break}i+=c.decode(x,{stream:!0}),i=G(e,i)}i&&G(e,`${i}\n`)}catch(l){throw l instanceof Error&&l.name==="AbortError"||g.debug("[client-dom] consumeNdjsonStream error",l),l}finally{try{await u.cancel()}catch(l){d||g.debug("[client-dom] reader.cancel failed",l)}try{u.releaseLock()}catch(l){g.debug("[client-dom] reader.releaseLock failed",l)}if(typeof s.cancel=="function")try{await s.cancel()}catch(l){g.debug("[client-dom] stream.cancel failed",l)}if(typeof n?.body?.cancel=="function")try{await n.body.cancel()}catch(l){g.debug("[client-dom] response.body.cancel failed",l)}}}function lt(t,e){let r=C(t,e),n=[],s=u=>{let c=u;c.dataset?.clientRef&&n.push(c);for(let i of u.children)s(i)};return s(r),n}function ut(t,e){let r=lt(t,e);for(let n of r){let s=n.dataset?.clientRef;s&&(n.dataset.hydrated="true",g.debug("[client-dom] marked for hydration",s))}}var gt=100;function dt(t,e){if(globalThis.__VF_CLIENT_MOD_CACHE??(globalThis.__VF_CLIENT_MOD_CACHE=new Map),globalThis.__VF_CLIENT_MOD_CACHE.size>=gt){let r=globalThis.__VF_CLIENT_MOD_CACHE.keys().next().value;r&&globalThis.__VF_CLIENT_MOD_CACHE.delete(r)}globalThis.__VF_CLIENT_MOD_CACHE.set(t,e)}function pt(t){let e=t.match(/^\\/app\\/(.+)#([A-Za-z0-9_]+)$/);return e?{rel:`/${e[1]||""}`,exportName:e[2]||"default"}:null}async function Rt(){try{let t=await fetch("/_veryfront/rsc/manifest");return t.ok?await t.json():null}catch{return null}}async function ft(t,e,r){let n=t.graphIds?.client.find(c=>c.rel===e)?.path,s=`${e}#${t.hash??""}`;try{let c=globalThis.__VF_CLIENT_MOD_CACHE?.get(s);if(c)return c}catch(c){g.debug("hydrate: cache get failed",c)}let u=T({strategy:r,rel:e,absPath:n,version:t.hash});if(!u)return null;try{let c=await import(u);try{dt(s,c)}catch(i){g.debug("hydrate: cache set failed",i)}return c}catch(c){return g.debug("hydrate: failed to import module",{moduleUrl:u,error:c}),null}}async function Y(t=document){let e=null;try{e=await Rt()}catch(i){g.debug("hydrate: fetch manifest failed",i)}if(!e){g.debug("hydrate: no manifest");return}let r=Array.from(t.querySelectorAll("[data-client-ref]"));try{let i=globalThis.__VF_MANIFEST_HASH;if(!r.some(l=>l.dataset?.hydrated!=="true")&&i&&e.hash&&i===e.hash)return}catch(i){g.debug("hydrate: hmr hash read failed",i)}if(r.length===0){try{globalThis.__VF_MANIFEST_HASH=e.hash??""}catch(i){g.debug("hydrate: set hash failed",i)}return}let n=S(O(t));try{if(globalThis.__VF_TEST_MODE__){globalThis.__VF_HYDRATE_CALLED=!0,globalThis.__VF_MANIFEST_HASH=e.hash??"";return}}catch(i){g.debug("hydrate: test mode flags failed",i)}let s=I(t),[{default:u},{createRoot:c}]=await Promise.all([import(s.react),import(s.reactDomClient)]);for(let i of r){let d=i.dataset?.clientRef??"";if(!d||i.dataset?.hydrated==="true")continue;let l=pt(d);if(!l)continue;let p=await ft(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(U){g.warn("hydrate: render failed",U)}}try{globalThis.__VF_MANIFEST_HASH=e.hash??""}catch(i){g.debug("hydrate: set hash failed (post)",i)}}async function mt(){let t=I(document),[e,r]=await Promise.all([import(t.react),import(t.reactDomClient)]);return{React:e,ReactDOM:r}}var Et=new Set(["SCRIPT","STYLE","NOSCRIPT","TEMPLATE"]);function L(t){let e=t.getAttribute("style")??"";return t.hasAttribute("data-veryfront-head")||t.hasAttribute("hidden")||/(?:^|;)\\s*display\\s*:\\s*none(?:\\s*;|$)/i.test(e)||Et.has(t.tagName.toUpperCase())}function yt(t,e){return t.find(r=>r.tagName.toUpperCase()==="DIV"&&!!r.getAttribute("class")?.trim()&&!L(r))??e}function _t(t,e){return t===e}function ht(t,e){let r=document.createElement("div");r.setAttribute("data-veryfront-hydration-root","page");let n=t.find(s=>!L(s));n?.parentNode===e?e.insertBefore(r,n):e.appendChild(r);for(let s of t)!L(s)&&s.parentNode===e&&r.appendChild(s);return r}function Ct(t,e,r=document){return!!e?.pagePath&&typeof t?.__veryfrontRenderPage=="function"&&!!r.getElementById("root")}function xt(t,e){return e?.pagePath?!1:!!t.getElementById(_)}function Ot(t=import.meta.url){try{return new URL(t,"http://veryfront.local").searchParams.get("hydrate")==="1"}catch{return!1}}function St(t){return t==="rsc-module"}async function Tt(t){try{let e=await fetch(y+"stream"+t);if(!e.ok||!e.body)return!1;let r=new AbortController;return addEventListener("pagehide",()=>r.abort(),{once:!0}),await j(e,document,r.signal),!0}catch(e){return console.debug?.("[RSC] tryStream failed",e),!1}}async function N(){try{await Y(document)}catch(t){console.debug?.("[RSC] hydration failed",t)}}async function It(t,e){try{let{React:r,ReactDOM:n}=await mt(),s=T({strategy:e,rel:t});if(!s)return!1;console.debug?.("[RSC] Loading component from:",s);let c=(await import(s)).default;if(typeof c!="function")return console.debug?.("[RSC] Page component is not a function"),!1;let i=Array.from(document.body.children),d=yt(i,document.body),l=_t(d,document.body)?ht(i,document.body):d,p=r.createElement(c,{});return St(e)?n.createRoot(l).render(p):n.hydrateRoot(l,p,{identifierPrefix:"vf",onRecoverableError:()=>{}}),console.debug?.("[RSC] Page component hydrated successfully"),!0}catch(r){return console.error("[RSC] Page hydration failed",r),!1}}async function At(t){try{let e=await fetch(y+"payload"+t);if(!e.ok)return!1;let r=await e.json();if(r?.slots){for(let[n,s]of Object.entries(r.slots))C(document,n).innerHTML=h(String(s||""));return!0}return C(document,_).innerHTML=h(String(r?.html||"")),!0}catch(e){return console.debug?.("[RSC] payload fetch failed",e),!1}}async function Nt(){try{let t=globalThis.window?.location.search??"",e=O(document);if(Ot()){await N();return}let r=e?.pagePath,n=S(e);if(r){if(Ct(globalThis.window,e,document)){console.debug?.("[RSC] Page renderer owns hydration");return}console.debug?.("[RSC] Found page component in hydration data:",r),await It(r,n)&&console.debug?.("[RSC] Client component hydrated successfully");return}if(!xt(document,e))return;if(await Tt(t)){await N();return}if(await At(t)){await N();return}await N()}catch(t){console.error("[RSC] boot failed",t)}}if(typeof document<"u"){let t=()=>{Nt()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t,{once:!0}):t()}export{Nt as boot,yt as selectHydrationRoot,xt as shouldAttemptRSCTransport,Ot as shouldHydrateOnly,St as shouldRenderPageComponent,Ct as shouldUsePageRendererHydration,_t as shouldWrapPageHydrationRoot};\n';
|
|
9
9
|
export const CLIENT_DOM_BUNDLE = 'var N=Object.defineProperty;var A=(r,t,o)=>t in r?N(r,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[t]=o;var l=(r,t,o)=>A(r,typeof t!="symbol"?t+"":t,o);function e(r){return{...r,create(t){return new f(t?.message||t?.detail||r.title,{slug:r.slug,category:r.category,status:t?.status??r.status,title:r.title,suggestion:r.suggestion,detail:t?.detail,cause:t?.cause,instance:t?.instance,context:t?.context})}}}var f=class extends Error{constructor(o,s){super(o);l(this,"slug");l(this,"category");l(this,"status");l(this,"title");l(this,"suggestion");l(this,"detail");l(this,"cause");l(this,"instance");l(this,"context");this.name="VeryfrontError",this.slug=s.slug,this.category=s.category,this.status=s.status,this.title=s.title,this.suggestion=s.suggestion,this.detail=s.detail,this.cause=s.cause,this.instance=s.instance,this.context=s.context}toRFC9457(){return{type:`https://veryfront.com/docs/errors/${this.slug}`,title:this.title,status:this.status,detail:this.detail,instance:this.instance,category:this.category,suggestion:this.suggestion,cause:typeof this.cause=="string"?this.cause:void 0}}getDocsUrl(){return`https://veryfront.com/docs/errors/${this.slug}`}};var z=e({slug:"config-not-found",category:"CONFIG",status:404,title:"Configuration file not found",suggestion:"Run \'vf init\' to create a configuration file"}),W=e({slug:"config-invalid",category:"CONFIG",status:400,title:"Invalid configuration format",suggestion:"Check your veryfront.config.ts for syntax errors"}),X=e({slug:"config-parse-error",category:"CONFIG",status:400,title:"Failed to parse configuration",suggestion:"Ensure your configuration file is valid TypeScript/JSON"}),J=e({slug:"config-validation-error",category:"CONFIG",status:422,title:"Configuration validation failed",suggestion:"Check the configuration against the schema requirements"}),K=e({slug:"config-type-error",category:"CONFIG",status:400,title:"Configuration type mismatch",suggestion:"Ensure configuration values match expected types"}),Z=e({slug:"import-map-invalid",category:"CONFIG",status:400,title:"Invalid import map configuration",suggestion:"Check your import map syntax and paths"}),Q=e({slug:"cors-config-invalid",category:"CONFIG",status:400,title:"Invalid CORS configuration",suggestion:"Review CORS settings in your configuration"}),ee=e({slug:"config-validation-failed",category:"CONFIG",status:400,title:"Configuration validation failed",suggestion:"Check configuration values against requirements"}),te=e({slug:"build-failed",category:"BUILD",status:500,title:"Build process failed",suggestion:"Check the build output for specific errors"}),re=e({slug:"bundle-error",category:"BUILD",status:500,title:"Bundle generation failed",suggestion:"Review bundler output for details"}),oe=e({slug:"typescript-error",category:"BUILD",status:500,title:"TypeScript compilation error",suggestion:"Fix TypeScript errors shown in the output"}),se=e({slug:"mdx-compile-error",category:"BUILD",status:500,title:"MDX compilation failed",suggestion:"Check your MDX file syntax"}),ne=e({slug:"asset-optimization-error",category:"BUILD",status:500,title:"Asset optimization failed",suggestion:"Check asset file formats and paths"}),ie=e({slug:"ssg-generation-error",category:"BUILD",status:500,title:"Static site generation failed",suggestion:"Review SSG configuration and data fetching"}),ae=e({slug:"sourcemap-error",category:"BUILD",status:500,title:"Source map generation failed",suggestion:"Check source map configuration"}),ce=e({slug:"compilation-error",category:"BUILD",status:500,title:"Compilation failed",suggestion:"Review compiler output for specific errors"}),ue=e({slug:"hydration-mismatch",category:"RUNTIME",status:500,title:"Client/server hydration mismatch",suggestion:"Ensure server and client render the same content"}),le=e({slug:"render-error",category:"RUNTIME",status:500,title:"Component render failed",suggestion:"Check component for runtime errors"}),ge=e({slug:"component-error",category:"RUNTIME",status:500,title:"Component execution error",suggestion:"Review component logic and props"}),de=e({slug:"layout-not-found",category:"RUNTIME",status:404,title:"Layout component not found",suggestion:"Ensure layout file exists at the expected path"}),pe=e({slug:"page-not-found",category:"RUNTIME",status:404,title:"Page component not found",suggestion:"Check that the page file exists in the routes directory"}),Ee=e({slug:"api-error",category:"RUNTIME",status:500,title:"API route handler error",suggestion:"Review API route handler for errors"}),Re=e({slug:"middleware-error",category:"RUNTIME",status:500,title:"Middleware execution error",suggestion:"Check middleware function for errors"}),fe=e({slug:"route-conflict",category:"ROUTE",status:409,title:"Conflicting route definitions",suggestion:"Rename or reorganize conflicting route files"}),me=e({slug:"invalid-route-file",category:"ROUTE",status:400,title:"Invalid route file structure",suggestion:"Ensure route file exports required functions"}),ye=e({slug:"route-handler-invalid",category:"ROUTE",status:400,title:"Invalid route handler export",suggestion:"Export a valid handler function from the route file"}),_e=e({slug:"dynamic-route-error",category:"ROUTE",status:500,title:"Dynamic route parsing failed",suggestion:"Check dynamic route segment syntax"}),Oe=e({slug:"route-params-error",category:"ROUTE",status:400,title:"Route parameters invalid",suggestion:"Validate route parameter values"}),he=e({slug:"api-route-error",category:"ROUTE",status:500,title:"API route definition error",suggestion:"Review API route configuration"}),Te=e({slug:"module-not-found",category:"MODULE",status:404,title:"Module could not be resolved",suggestion:"Check the import path and ensure the module is installed"}),Ie=e({slug:"import-resolution-error",category:"MODULE",status:500,title:"Import path resolution failed",suggestion:"Verify import paths and module configuration"}),ve=e({slug:"circular-dependency",category:"MODULE",status:500,title:"Circular dependency detected",suggestion:"Refactor imports to break the circular dependency"}),xe=e({slug:"invalid-import",category:"MODULE",status:400,title:"Invalid import statement",suggestion:"Fix import syntax or path"}),Ne=e({slug:"dependency-missing",category:"MODULE",status:404,title:"Required dependency not installed",suggestion:"Install the missing dependency with your package manager"}),Ae=e({slug:"version-mismatch",category:"MODULE",status:409,title:"Dependency version mismatch",suggestion:"Update dependencies to compatible versions"}),Ce=e({slug:"port-in-use",category:"SERVER",status:409,title:"Server port already in use",suggestion:"Use a different port or stop the process using this port"}),Se=e({slug:"server-start-error",category:"SERVER",status:500,title:"Server failed to start",suggestion:"Check server configuration and port availability"}),De=e({slug:"cache-error",category:"SERVER",status:500,title:"Cache operation failed",suggestion:"Clear the cache and try again"}),Le=e({slug:"file-watch-error",category:"SERVER",status:500,title:"File watcher error",suggestion:"Restart the development server"}),Ue=e({slug:"request-error",category:"SERVER",status:500,title:"HTTP request handling error",suggestion:"Check request handler and middleware"}),be=e({slug:"service-overloaded",category:"SERVER",status:503,title:"Service overloaded",suggestion:"Reduce load or scale up resources"}),Me=e({slug:"cache-path-mismatch",category:"SERVER",status:500,title:"Cache path mismatch",suggestion:"Clear the cache directory and rebuild"}),Pe=e({slug:"network-error",category:"SERVER",status:502,title:"Network operation failed",suggestion:"Check network connectivity and retry"}),Ve=e({slug:"api-client-error",category:"SERVER",status:500,title:"API client request failed",suggestion:"Check API connectivity and authentication"}),Fe=e({slug:"token-storage-error",category:"SERVER",status:500,title:"Token storage operation failed",suggestion:"Check token storage backend and credentials"}),ke=e({slug:"cache-invariant-violation",category:"SERVER",status:500,title:"Cache path invariant violated",suggestion:"Clear the cache and rebuild"}),we=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"}),Ge=e({slug:"fallback-exhausted",category:"SERVER",status:500,title:"Primary and fallback operations both failed",suggestion:"Check service availability and connectivity"}),He=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"}),Be=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"}),$e=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"}),Ye=e({slug:"invalid-use-client",category:"BOUNDARY",status:400,title:"Invalid \'use client\' directive",suggestion:"Place \'use client\' at the top of the file"}),je=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"}),qe=e({slug:"rsc-payload-error",category:"BOUNDARY",status:500,title:"RSC payload serialization error",suggestion:"Ensure props are serializable (no functions, symbols, etc.)"}),ze=e({slug:"hmr-error",category:"DEV",status:500,title:"Hot module replacement error",suggestion:"Restart the development server"}),We=e({slug:"dev-server-error",category:"DEV",status:500,title:"Development server error",suggestion:"Check the dev server logs and restart"}),Xe=e({slug:"fast-refresh-error",category:"DEV",status:500,title:"Fast refresh failed",suggestion:"Save the file again or restart the dev server"}),Je=e({slug:"error-overlay-error",category:"DEV",status:500,title:"Error overlay failed",suggestion:"Check browser console for details"}),Ke=e({slug:"source-map-error",category:"DEV",status:500,title:"Source map loading error",suggestion:"Rebuild or clear cache"}),Ze=e({slug:"deployment-error",category:"DEPLOY",status:500,title:"Deployment process failed",suggestion:"Check deployment logs for details"}),Qe=e({slug:"platform-error",category:"DEPLOY",status:500,title:"Platform-specific error",suggestion:"Check platform documentation and requirements"}),et=e({slug:"env-var-missing",category:"DEPLOY",status:500,title:"Required environment variable missing",suggestion:"Set the required environment variable"}),tt=e({slug:"production-build-required",category:"DEPLOY",status:400,title:"Production build required",suggestion:"Run \'vf build\' before deploying"}),rt=e({slug:"agent-error",category:"AGENT",status:500,title:"Agent operation error",suggestion:"Check agent configuration and logs"}),ot=e({slug:"agent-not-found",category:"AGENT",status:404,title:"Agent not found",suggestion:"Verify the agent ID exists"}),st=e({slug:"agent-timeout",category:"AGENT",status:408,title:"Agent operation timed out",suggestion:"Increase timeout or simplify the request"}),nt=e({slug:"agent-intent-error",category:"AGENT",status:400,title:"Agent intent parsing error",suggestion:"Rephrase the request more clearly"}),it=e({slug:"orchestration-error",category:"AGENT",status:500,title:"Multi-agent orchestration error",suggestion:"Check agent coordination logic"}),at=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"}),ct=e({slug:"unknown-error",category:"GENERAL",status:500,title:"Unknown/unclassified error",suggestion:"Check logs for more details"}),ut=e({slug:"permission-denied",category:"GENERAL",status:403,title:"File/resource permission denied",suggestion:"Check file permissions and access rights"}),lt=e({slug:"file-not-found",category:"GENERAL",status:404,title:"File not found",suggestion:"Verify the file path exists"}),gt=e({slug:"resource-not-found",category:"GENERAL",status:404,title:"Requested resource not found",suggestion:"Verify the referenced resource ID or name exists"}),dt=e({slug:"invalid-argument",category:"GENERAL",status:400,title:"Invalid function argument",suggestion:"Check argument types and values"}),pt=e({slug:"timeout-error",category:"GENERAL",status:408,title:"Operation timed out",suggestion:"Increase timeout or optimize the operation"}),Et=e({slug:"initialization-error",category:"GENERAL",status:500,title:"Initialization failed",suggestion:"Check initialization requirements and dependencies"}),Rt=e({slug:"not-supported",category:"GENERAL",status:501,title:"Feature not supported",suggestion:"Check documentation for supported features"}),y=e({slug:"security-violation",category:"GENERAL",status:403,title:"Security violation detected",suggestion:"Check for path traversal or unauthorized access attempts"}),ft=e({slug:"input-validation-failed",category:"GENERAL",status:400,title:"Input validation failed",suggestion:"Check request input against validation rules"});var C=[{pattern:/<script[^>]*>[\\s\\S]*?<\\/script>/gi,name:"inline script"},{pattern:/javascript:/gi,name:"javascript: URL"},{pattern:/\\bon\\w+\\s*=/gi,name:"event handler attribute"},{pattern:/data:\\s*text\\/html/gi,name:"data: HTML URL"}];function S(){let r=globalThis;return r.__VERYFRONT_DEV__===!0||r.Deno?.env?.get?.("VERYFRONT_ENV")==="development"}function _(r,t={}){let{strict:o=!1,warn:s=!0}=t;for(let{pattern:i,name:c}of C)if(i.lastIndex=0,!!i.test(r)&&(s&&console.warn(`[Security] Suspicious ${c} detected in server HTML`),o||!S()))throw y.create({detail:`Potentially unsafe HTML: ${c} detected`});return r}var E=class{constructor(t,o){this.prefix=t;this.level=o}log(t,o,s,...i){this.level>t||o?.(s,...i)}debug(t,...o){this.log(0,console.debug,`[${this.prefix}] DEBUG: ${t}`,...o)}info(t,...o){this.log(1,console.log,`[${this.prefix}] ${t}`,...o)}warn(t,...o){this.log(2,console.warn,`[${this.prefix}] WARN: ${t}`,...o)}error(t,...o){this.log(3,console.error,`[${this.prefix}] ERROR: ${t}`,...o)}};function D(){if(typeof window>"u")return 2;let r=globalThis;return r.__VERYFRONT_DEV__||r.__RSC_DEV__?r.__VERYFRONT_DEBUG__||r.__RSC_DEBUG__?0:1:2}var R=D(),d=new E("RSC",R),Tt=new E("PREFETCH",R),It=new E("HYDRATE",R),vt=new E("VERYFRONT",R);var n="/_veryfront",m={RSC:`${n}/rsc/`,FS:`${n}/fs/`,MODULES:`${n}/modules/`,PAGES:`${n}/pages/`,DATA:`${n}/data/`,LIB:`${n}/lib/`,CHUNKS:`${n}/chunks/`,CLIENT:`${n}/client/`},O={HMR_RUNTIME:`${n}/hmr-runtime.js`,HMR:`${n}/hmr.js`,ERROR_OVERLAY:`${n}/error-overlay.js`,DEV_LOADER:`${n}/dev-loader.js`,CLIENT_LOG:`${n}/log`,CLIENT_JS:`${n}/client.js`,ROUTER_JS:`${n}/router.js`,PREFETCH_JS:`${n}/prefetch.js`,MANIFEST_JSON:`${n}/manifest.json`,APP_JS:`${n}/app.js`,RSC_CLIENT:`${n}/rsc/client.js`,RSC_MANIFEST:`${n}/rsc/manifest`,RSC_STREAM:`${n}/rsc/stream`,RSC_PAYLOAD:`${n}/rsc/payload`,RSC_RENDER:`${n}/rsc/render`,RSC_PAGE:`${n}/rsc/page`,RSC_MODULE:`${n}/rsc/module`,RSC_DOM:`${n}/rsc/dom.js`,LIB_CHAT_REACT:`${n}/lib/chat/react.js`,LIB_CHAT_COMPONENTS:`${n}/lib/chat/components.js`,LIB_CHAT_PRIMITIVES:`${n}/lib/chat/primitives.js`};var U={ROOT:".veryfront",CACHE:".veryfront/cache",KV:".veryfront/kv",LOGS:".veryfront/logs",TMP:".veryfront/tmp"},St=U.CACHE;var Dt={HMR_RUNTIME:O.HMR_RUNTIME,ERROR_OVERLAY:O.ERROR_OVERLAY};var Mt=m.RSC,Pt=m.FS;var h="rsc-root";function I(r,t){let o=t==="root"?h:`rsc-slot-${t}`,s=r.getElementById(o);if(s)return s;let i=r.createElement("div");return i.id=o,r.body.appendChild(i),i}function b(r,t){if(t.type!=="slot")return;let o=I(r,t.id);o.innerHTML=_(String(t.html??""))}function T(r,t){let o=t.split(`\n`),s=o.pop()??"";for(let i of o){let c=i.trim();if(!c)continue;let g;try{g=JSON.parse(c)}catch(p){d.debug("[client-dom] malformed NDJSON line",{line:c,error:p instanceof Error?p.message:String(p)});continue}if(!g||typeof g!="object")continue;let u=g;if(u.type==="slot"){b(r,u);try{V(r,u.id||"root")}catch(p){d.debug("[client-dom] hydration optional failed",p)}}}return s}function M(r){return new Promise((t,o)=>{let s=()=>o(new DOMException("aborted","AbortError"));if(r.aborted){s();return}r.addEventListener("abort",s,{once:!0})})}async function Gt(r,t=document,o){let s="body"in r?r:null,i=s?.body??r;if(!i)return;let c=i.getReader(),g=new TextDecoder,u="",p=!1;try{for(;;){if(o?.aborted)throw new DOMException("aborted","AbortError");let a=c.read(),{done:v,value:x}=o?await Promise.race([a,M(o)]):await a;if(v){p=!0;break}u+=g.decode(x,{stream:!0}),u=T(t,u)}u&&T(t,`${u}\n`)}catch(a){throw a instanceof Error&&a.name==="AbortError"||d.debug("[client-dom] consumeNdjsonStream error",a),a}finally{try{await c.cancel()}catch(a){p||d.debug("[client-dom] reader.cancel failed",a)}try{c.releaseLock()}catch(a){d.debug("[client-dom] reader.releaseLock failed",a)}if(typeof i.cancel=="function")try{await i.cancel()}catch(a){d.debug("[client-dom] stream.cancel failed",a)}if(typeof s?.body?.cancel=="function")try{await s.body.cancel()}catch(a){d.debug("[client-dom] response.body.cancel failed",a)}}}function P(r,t){let o=I(r,t),s=[],i=c=>{let g=c;g.dataset?.clientRef&&s.push(g);for(let u of c.children)i(u)};return i(o),s}function V(r,t){let o=P(r,t);for(let s of o){let i=s.dataset?.clientRef;i&&(s.dataset.hydrated="true",d.debug("[client-dom] marked for hydration",i))}}export{Gt as consumeNdjsonStream,I as getContainer};\n';
|