veryfront 0.1.655 → 0.1.657
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/cli/sync/ignore.d.ts.map +1 -1
- package/esm/cli/sync/ignore.js +66 -18
- package/esm/cli/templates/manifest.js +2 -2
- package/esm/deno.js +3 -3
- package/esm/src/agent/ag-ui/request-shared.d.ts.map +1 -1
- package/esm/src/agent/ag-ui/request-shared.js +1 -2
- package/esm/src/agent/index.d.ts +6 -4
- package/esm/src/agent/index.d.ts.map +1 -1
- package/esm/src/agent/index.js +6 -4
- package/esm/src/agent/runtime/message-adapter.d.ts +1 -1
- package/esm/src/agent/runtime/message-adapter.d.ts.map +1 -1
- package/esm/src/chat/message-prep.js +2 -2
- package/esm/src/integrations/_data.js +1 -1
- package/esm/src/internal-agents/run-stream.d.ts.map +1 -1
- package/esm/src/internal-agents/run-stream.js +7 -1
- package/esm/src/mcp/http-transport.d.ts +1 -1
- package/esm/src/mcp/http-transport.d.ts.map +1 -1
- package/esm/src/mcp/http-transport.js +4 -3
- package/esm/src/mcp/index.d.ts +2 -2
- package/esm/src/mcp/index.js +2 -2
- package/esm/src/mcp/server.d.ts +4 -6
- package/esm/src/mcp/server.d.ts.map +1 -1
- package/esm/src/mcp/server.js +42 -14
- package/esm/src/resource/index.d.ts +2 -2
- package/esm/src/resource/index.js +2 -2
- package/esm/src/resource/registry.d.ts.map +1 -1
- package/esm/src/resource/registry.js +5 -1
- package/esm/src/routing/api/module-loader/external-import-rewriter.d.ts.map +1 -1
- package/esm/src/routing/api/module-loader/external-import-rewriter.js +59 -59
- package/esm/src/security/client/html-sanitizer.d.ts +1 -0
- package/esm/src/security/client/html-sanitizer.d.ts.map +1 -1
- package/esm/src/security/client/html-sanitizer.js +44 -6
- package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.d.ts.map +1 -1
- package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.js +2 -2
- package/esm/src/server/services/rsc/orchestrators/page-handler.d.ts.map +1 -1
- package/esm/src/server/services/rsc/orchestrators/page-handler.js +3 -21
- package/esm/src/tool/factory.d.ts.map +1 -1
- package/esm/src/tool/factory.js +3 -35
- package/esm/src/tool/host-tools.d.ts.map +1 -1
- package/esm/src/tool/host-tools.js +2 -11
- package/esm/src/tool/index.d.ts +12 -8
- package/esm/src/tool/index.d.ts.map +1 -1
- package/esm/src/tool/index.js +12 -8
- package/esm/src/tool/schema/zod-json-schema.d.ts +6 -11
- package/esm/src/tool/schema/zod-json-schema.d.ts.map +1 -1
- package/esm/src/tool/schema/zod-json-schema.js +7 -37
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +1 -1
|
@@ -9,10 +9,9 @@
|
|
|
9
9
|
* `tool/factory.ts`, `workflow/registry.ts`, `routing/api/openapi/...`,
|
|
10
10
|
* `mcp/server.ts`, `cli/mcp/server.ts`) continue to compile.
|
|
11
11
|
*
|
|
12
|
-
* Inputs
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* so no zod-specific logic remains in this file.
|
|
12
|
+
* Inputs must be opaque `Schema<T>` values produced by `defineSchema`.
|
|
13
|
+
* Conversion is routed through the `SchemaValidator` contract so no
|
|
14
|
+
* zod-specific logic remains in this file.
|
|
16
15
|
*
|
|
17
16
|
* @module tool/schema/zod-json-schema
|
|
18
17
|
*/
|
|
@@ -29,52 +28,23 @@ function isContractSchema(value) {
|
|
|
29
28
|
typeof value.parse === "function" &&
|
|
30
29
|
typeof value.safeParse === "function");
|
|
31
30
|
}
|
|
32
|
-
/** Detect a raw zod schema: object with `_def` carrying `typeName` (v3) or `type` (v4). */
|
|
33
|
-
function isRawZodSchema(value) {
|
|
34
|
-
if (value === null || typeof value !== "object")
|
|
35
|
-
return false;
|
|
36
|
-
if (!("_def" in value))
|
|
37
|
-
return false;
|
|
38
|
-
const def = value._def;
|
|
39
|
-
if (!def || typeof def !== "object")
|
|
40
|
-
return false;
|
|
41
|
-
return typeof def.typeName === "string" || typeof def.type === "string";
|
|
42
|
-
}
|
|
43
31
|
/**
|
|
44
|
-
*
|
|
45
|
-
* shape so the contract's `toJsonSchema` / `isOptional` can unwrap it via
|
|
46
|
-
* the `__zod` brand.
|
|
47
|
-
*/
|
|
48
|
-
function wrapRawZod(value) {
|
|
49
|
-
return { __zod: value };
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Convert a `Schema<T>` (or, transitionally, a raw zod schema) into a
|
|
53
|
-
* JSON Schema document.
|
|
32
|
+
* Convert a `Schema<T>` into a JSON Schema document.
|
|
54
33
|
*
|
|
55
|
-
* Throws if the input is
|
|
56
|
-
* matches the pre-B2 behavior of the original `zodToJsonSchema` guard.
|
|
34
|
+
* Throws if the input is not a contract schema.
|
|
57
35
|
*/
|
|
58
36
|
export function zodToJsonSchema(schema) {
|
|
59
37
|
if (isContractSchema(schema)) {
|
|
60
38
|
return schemaToJsonSchema(schema);
|
|
61
39
|
}
|
|
62
|
-
|
|
63
|
-
return schemaToJsonSchema(wrapRawZod(schema));
|
|
64
|
-
}
|
|
65
|
-
throw new Error("Invalid Zod schema: missing _def property");
|
|
40
|
+
throw new Error("Invalid Veryfront schema: use defineSchema()");
|
|
66
41
|
}
|
|
67
42
|
/**
|
|
68
|
-
* Returns `true` when the schema permits `undefined`.
|
|
69
|
-
* contract `Schema<T>` and raw zod schemas for the same compatibility
|
|
70
|
-
* reasons as `zodToJsonSchema` above.
|
|
43
|
+
* Returns `true` when the schema permits `undefined`.
|
|
71
44
|
*/
|
|
72
45
|
export function isOptionalSchema(schema) {
|
|
73
46
|
if (isContractSchema(schema)) {
|
|
74
47
|
return schemaIsOptional(schema);
|
|
75
48
|
}
|
|
76
|
-
if (isRawZodSchema(schema)) {
|
|
77
|
-
return schemaIsOptional(wrapRawZod(schema));
|
|
78
|
-
}
|
|
79
49
|
return false;
|
|
80
50
|
}
|