veryfront 0.1.1098 → 0.1.1099
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/deno.js +1 -1
- package/esm/src/modules/server/module-server.d.ts +6 -0
- package/esm/src/modules/server/module-server.d.ts.map +1 -1
- package/esm/src/modules/server/module-server.js +15 -1
- package/esm/src/rendering/orchestrator/module-loader/module-persistence.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/module-persistence.js +39 -15
- package/esm/src/tool/host-tools.d.ts.map +1 -1
- package/esm/src/tool/host-tools.js +13 -5
- package/esm/src/transforms/import-rewriter/strategies/alias-strategy.d.ts.map +1 -1
- package/esm/src/transforms/import-rewriter/strategies/alias-strategy.js +3 -2
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +5 -5
package/esm/deno.js
CHANGED
|
@@ -47,4 +47,10 @@ export declare function serveModule(req: Request, options: ModuleServerOptions):
|
|
|
47
47
|
* @returns true if request path starts with /_vf_modules/
|
|
48
48
|
*/
|
|
49
49
|
export declare function isModuleRequest(req: Request): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Content type for a dev module response.
|
|
52
|
+
*
|
|
53
|
+
* Exported for testing.
|
|
54
|
+
*/
|
|
55
|
+
export declare function getDevModuleContentType(modulePath: string): string;
|
|
50
56
|
//# sourceMappingURL=module-server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-server.d.ts","sourceRoot":"","sources":["../../../../src/src/modules/server/module-server.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAG5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AA2DtE;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAwDrD,CAAC;AAyEF,MAAM,WAAW,mBAAmB;IAClC,yDAAyD;IACzD,SAAS,EAAE,MAAM,CAAC;IAClB,6BAA6B;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB;IACtB,OAAO,EAAE,cAAc,CAAC;IACxB,uBAAuB;IACvB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,+DAA+D;IAC/D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gFAAgF;IAChF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,yDAAyD;IACzD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sFAAsF;IACtF,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,sDAAsD;AACtD,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAqczF;AAwWD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAGrD"}
|
|
1
|
+
{"version":3,"file":"module-server.d.ts","sourceRoot":"","sources":["../../../../src/src/modules/server/module-server.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAG5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AA2DtE;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAwDrD,CAAC;AAyEF,MAAM,WAAW,mBAAmB;IAClC,yDAAyD;IACzD,SAAS,EAAE,MAAM,CAAC;IAClB,6BAA6B;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB;IACtB,OAAO,EAAE,cAAc,CAAC;IACxB,uBAAuB;IACvB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,+DAA+D;IAC/D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gFAAgF;IAChF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,yDAAyD;IACzD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sFAAsF;IACtF,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,sDAAsD;AACtD,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAqczF;AAwWD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAGrD;AAiBD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAyBlE"}
|
|
@@ -786,7 +786,14 @@ function getModuleHeaders(modulePath, options = {}) {
|
|
|
786
786
|
: "no-cache",
|
|
787
787
|
};
|
|
788
788
|
}
|
|
789
|
-
|
|
789
|
+
/** Source extensions the module server compiles to JavaScript before serving. */
|
|
790
|
+
const COMPILED_TO_JS_EXTENSIONS = /\.(?:tsx?|jsx|mdx|md)$/;
|
|
791
|
+
/**
|
|
792
|
+
* Content type for a dev module response.
|
|
793
|
+
*
|
|
794
|
+
* Exported for testing.
|
|
795
|
+
*/
|
|
796
|
+
export function getDevModuleContentType(modulePath) {
|
|
790
797
|
const normalizedPath = modulePath.toLowerCase();
|
|
791
798
|
if (normalizedPath.endsWith(".map") || normalizedPath.endsWith(".json")) {
|
|
792
799
|
return "application/json; charset=utf-8";
|
|
@@ -794,6 +801,13 @@ function getDevModuleContentType(modulePath) {
|
|
|
794
801
|
if (normalizedPath.endsWith(".css")) {
|
|
795
802
|
return "text/css; charset=utf-8";
|
|
796
803
|
}
|
|
804
|
+
// The request path carries the *source* extension, but the body we serve is
|
|
805
|
+
// always the compiled JavaScript. Typing the response from the source
|
|
806
|
+
// extension yields `application/typescript`, which browsers refuse to execute
|
|
807
|
+
// as a module under strict MIME checking.
|
|
808
|
+
if (COMPILED_TO_JS_EXTENSIONS.test(normalizedPath)) {
|
|
809
|
+
return "application/javascript; charset=utf-8";
|
|
810
|
+
}
|
|
797
811
|
const detected = getContentTypeForPath(normalizedPath);
|
|
798
812
|
if (detected === "application/octet-stream") {
|
|
799
813
|
return "application/javascript; charset=utf-8";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-persistence.d.ts","sourceRoot":"","sources":["../../../../../src/src/rendering/orchestrator/module-loader/module-persistence.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"module-persistence.d.ts","sourceRoot":"","sources":["../../../../../src/src/rendering/orchestrator/module-loader/module-persistence.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAuDzE,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,cAAc,CAAC;IAC7B,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,uEAAuE;AACvE,wBAAsB,wBAAwB,CAC5C,KAAK,EAAE,6BAA6B,GACnC,OAAO,CAAC,MAAM,CAAC,CA+DjB"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { join } from "../../../platform/compat/path/index.js";
|
|
7
7
|
import { rendererLogger } from "../../../utils/index.js";
|
|
8
|
+
import { isCacheWriteRaceError } from "../../../utils/cache-file-ops.js";
|
|
8
9
|
import { hashCodeHex } from "../../../utils/hash-utils.js";
|
|
9
10
|
import { getModulePathCache, saveModulePathCache, } from "../../../transforms/mdx/esm-module-loader/cache/index.js";
|
|
10
11
|
import { buildMdxEsmPathCacheKey } from "../../../transforms/mdx/esm-module-loader/cache-format.js";
|
|
@@ -26,19 +27,22 @@ function pruneCreatedDirs() {
|
|
|
26
27
|
deleted++;
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
|
-
async function ensureDir(adapter, dir) {
|
|
30
|
-
if (createdDirs.has(dir))
|
|
30
|
+
async function ensureDir(adapter, dir, force = false) {
|
|
31
|
+
if (!force && createdDirs.has(dir))
|
|
31
32
|
return;
|
|
32
33
|
try {
|
|
33
34
|
await adapter.fs.mkdir(dir, { recursive: true });
|
|
34
35
|
}
|
|
35
|
-
catch (
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
catch (error) {
|
|
37
|
+
// `recursive: true` is a no-op on an existing directory, so a rejection here
|
|
38
|
+
// means the directory may genuinely be absent (EMFILE, EACCES, a racing
|
|
39
|
+
// sweep). Drop the memo so the next attempt retries instead of assuming the
|
|
40
|
+
// directory is present forever after.
|
|
41
|
+
createdDirs.delete(dir);
|
|
42
|
+
throw error;
|
|
41
43
|
}
|
|
44
|
+
createdDirs.add(dir);
|
|
45
|
+
pruneCreatedDirs();
|
|
42
46
|
}
|
|
43
47
|
/** Write a transformed module artifact and register cache pointers. */
|
|
44
48
|
export async function persistTransformedModule(input) {
|
|
@@ -49,17 +53,37 @@ export async function persistTransformedModule(input) {
|
|
|
49
53
|
const jsPath = relativePath.replace(/\.(tsx?|jsx|mdx)$/, `.${transformedHash}.js`);
|
|
50
54
|
const tempFilePath = join(input.tmpDir, jsPath);
|
|
51
55
|
const tempDir = tempFilePath.substring(0, tempFilePath.lastIndexOf("/"));
|
|
52
|
-
await ensureDir(input.localAdapter, tempDir)
|
|
56
|
+
await ensureDir(input.localAdapter, tempDir).catch(() => {
|
|
57
|
+
// Fall through to the write, which retries the mkdir on failure.
|
|
58
|
+
});
|
|
53
59
|
try {
|
|
54
60
|
await input.localAdapter.fs.writeFile(tempFilePath, input.transformedCode);
|
|
55
61
|
}
|
|
56
62
|
catch (error) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
// The cache directory can vanish between mkdir and write — a manual
|
|
64
|
+
// `rm -rf .cache`, a cache sweep, or a mkdir that never actually landed.
|
|
65
|
+
// Force the directory back into existence and retry once before failing.
|
|
66
|
+
if (!isCacheWriteRaceError(error)) {
|
|
67
|
+
logger.error("Failed to write module:", {
|
|
68
|
+
filePath: input.filePath,
|
|
69
|
+
tempFilePath,
|
|
70
|
+
error: error instanceof Error ? error.message : String(error),
|
|
71
|
+
});
|
|
72
|
+
throw error;
|
|
73
|
+
}
|
|
74
|
+
try {
|
|
75
|
+
await ensureDir(input.localAdapter, tempDir, true);
|
|
76
|
+
await input.localAdapter.fs.writeFile(tempFilePath, input.transformedCode);
|
|
77
|
+
logger.debug("Recreated module cache directory after failed write", { tempDir });
|
|
78
|
+
}
|
|
79
|
+
catch (retryError) {
|
|
80
|
+
logger.error("Failed to write module:", {
|
|
81
|
+
filePath: input.filePath,
|
|
82
|
+
tempFilePath,
|
|
83
|
+
error: retryError instanceof Error ? retryError.message : String(retryError),
|
|
84
|
+
});
|
|
85
|
+
throw retryError;
|
|
86
|
+
}
|
|
63
87
|
}
|
|
64
88
|
if (input.contentSourceId) {
|
|
65
89
|
const normalizedPath = `_vf_modules/${relativePath.replace(/\.(tsx?|jsx|mdx)$/, ".js")}`;
|
|
@@ -1 +1 @@
|
|
|
1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B,8BAA8B,CAC5C,WAAW,EAAE,WAAW,EACxB,OAAO,CAAC,EAAE,8BAA8B,GACvC,OAAO,CAAC;AACX,0CAA0C;AAC1C,wBAAgB,8BAA8B,CAC5C,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpC,OAAO,CAAC,EAAE,8BAA8B,GACvC,OAAO,CAAC"}
|
|
@@ -16,10 +16,15 @@ function isSchemaLike(value) {
|
|
|
16
16
|
// defineSchema wrapper without a brand yet — match on the contract surface.
|
|
17
17
|
return "_output" in value && typeof value.safeParse === "function";
|
|
18
18
|
}
|
|
19
|
+
function isParserBackedPrecomputedSchema(input) {
|
|
20
|
+
return (isRecord(input.inputSchema) &&
|
|
21
|
+
typeof input.inputSchema.parse === "function" &&
|
|
22
|
+
isRecord(input.inputSchemaJson));
|
|
23
|
+
}
|
|
19
24
|
function isHostToolDefinition(value) {
|
|
20
25
|
return (isRecord(value) &&
|
|
21
26
|
typeof value.description === "string" &&
|
|
22
|
-
isSchemaLike(value.inputSchema) &&
|
|
27
|
+
(isSchemaLike(value.inputSchema) || isParserBackedPrecomputedSchema(value)) &&
|
|
23
28
|
typeof value.execute === "function");
|
|
24
29
|
}
|
|
25
30
|
function defaultToolCallId(toolName) {
|
|
@@ -42,22 +47,25 @@ export function createToolsFromHostDefinitions(definitions, options = {}) {
|
|
|
42
47
|
continue;
|
|
43
48
|
const execute = async (input, context) => await definition.execute(input, normalizeExecutionContext(toolName, context, options));
|
|
44
49
|
try {
|
|
45
|
-
|
|
46
|
-
|
|
50
|
+
if (definition.inputSchemaJson) {
|
|
51
|
+
tools[toolName] = dynamicTool({
|
|
47
52
|
id: toolName,
|
|
48
53
|
description: definition.description,
|
|
49
54
|
inputSchema: definition.inputSchema,
|
|
50
55
|
inputSchemaJson: definition.inputSchemaJson,
|
|
51
56
|
execute,
|
|
52
57
|
mcp: definition.mcp,
|
|
53
|
-
})
|
|
54
|
-
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
else if (isSchemaLike(definition.inputSchema)) {
|
|
61
|
+
tools[toolName] = tool({
|
|
55
62
|
id: toolName,
|
|
56
63
|
description: definition.description,
|
|
57
64
|
inputSchema: definition.inputSchema,
|
|
58
65
|
execute,
|
|
59
66
|
mcp: definition.mcp,
|
|
60
67
|
});
|
|
68
|
+
}
|
|
61
69
|
}
|
|
62
70
|
catch (error) {
|
|
63
71
|
agentLogger.warn("Skipping host tool: schema conversion failed", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alias-strategy.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/import-rewriter/strategies/alias-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,EACd,aAAa,EACd,MAAM,aAAa,CAAC;AAGrB,qBAAa,aAAc,YAAW,qBAAqB;IACzD,QAAQ,CAAC,IAAI,WAAW;IACxB,QAAQ,CAAC,QAAQ,KAAK;IAEtB,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,OAAO;IAIzD,OAAO,CAAC,IAAI,EAAE,mBAAmB,EAAE,GAAG,EAAE,cAAc,GAAG,aAAa;
|
|
1
|
+
{"version":3,"file":"alias-strategy.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/import-rewriter/strategies/alias-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,EACd,aAAa,EACd,MAAM,aAAa,CAAC;AAGrB,qBAAa,aAAc,YAAW,qBAAqB;IACzD,QAAQ,CAAC,IAAI,WAAW;IACxB,QAAQ,CAAC,QAAQ,KAAK;IAEtB,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,OAAO;IAIzD,OAAO,CAAC,IAAI,EAAE,mBAAmB,EAAE,GAAG,EAAE,cAAc,GAAG,aAAa;IAyCtE,OAAO,CAAC,mBAAmB;CAoB5B;AAED,eAAO,MAAM,aAAa,eAAsB,CAAC"}
|
|
@@ -32,8 +32,9 @@ export class AliasStrategy {
|
|
|
32
32
|
const relativeFilePath = this.getRelativeFilePath(ctx.filePath, ctx.projectDir);
|
|
33
33
|
const fileDir = relativeFilePath.substring(0, relativeFilePath.lastIndexOf("/"));
|
|
34
34
|
const depth = fileDir.split("/").filter(Boolean).length;
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
const prefix = depth === 0 ? "./" : "../".repeat(depth);
|
|
36
|
+
let relativePath = normalizeExtension(`${prefix}${path}`);
|
|
37
|
+
if (!/\.(tsx?|jsx?|mjs|cjs|mdx|css|js)$/.test(relativePath)) {
|
|
37
38
|
relativePath = `${relativePath}.js`;
|
|
38
39
|
}
|
|
39
40
|
return { specifier: relativePath };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "veryfront",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1099",
|
|
4
4
|
"description": "The simplest way to build AI-powered apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -328,10 +328,10 @@
|
|
|
328
328
|
"@types/react": "19.2.14",
|
|
329
329
|
"@types/react-dom": "19.2.3",
|
|
330
330
|
"ws": "8.21.0",
|
|
331
|
-
"@veryfront/ext-bundler-esbuild": "0.1.
|
|
332
|
-
"@veryfront/ext-content-mdx": "0.1.
|
|
333
|
-
"@veryfront/ext-css-tailwind": "0.1.
|
|
334
|
-
"@veryfront/ext-parser-babel": "0.1.
|
|
331
|
+
"@veryfront/ext-bundler-esbuild": "0.1.1099",
|
|
332
|
+
"@veryfront/ext-content-mdx": "0.1.1099",
|
|
333
|
+
"@veryfront/ext-css-tailwind": "0.1.1099",
|
|
334
|
+
"@veryfront/ext-parser-babel": "0.1.1099"
|
|
335
335
|
},
|
|
336
336
|
"devDependencies": {
|
|
337
337
|
"@types/node": "20.9.0"
|