veryfront 0.1.436 → 0.1.437

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/esm/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.1.436",
3
+ "version": "0.1.437",
4
4
  "license": "Apache-2.0",
5
5
  "nodeModulesDir": "auto",
6
6
  "workspace": [
@@ -1 +1 @@
1
- {"version":3,"file":"provider-tool-compat.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/provider-tool-compat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE7D,MAAM,MAAM,0BAA0B,GAClC,WAAW,GACX,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,SAAS,CAAC;AAEd,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,0BAA0B,CAAC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,yBAAyB;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC;AAkBD,wBAAgB,sBAAsB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,mBAAmB,CAsB1E;AAeD,wBAAgB,iCAAiC,CAC/C,SAAS,EAAE,SAAS,MAAM,EAAE,EAC5B,OAAO,GAAE,yBAA8B,GACtC,MAAM,EAAE,CAsBV;AAED,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,SAAS,cAAc,EAAE,EAChC,OAAO,GAAE,yBAA8B,GACtC,cAAc,EAAE,CAclB;AAgHD,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,UAAU,EAClB,OAAO,GAAE,IAAI,CAAC,yBAAyB,EAAE,OAAO,CAAM,GACrD,UAAU,CAKZ"}
1
+ {"version":3,"file":"provider-tool-compat.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/provider-tool-compat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE7D,MAAM,MAAM,0BAA0B,GAClC,WAAW,GACX,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,SAAS,CAAC;AAEd,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,0BAA0B,CAAC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,yBAAyB;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC;AAoBD,wBAAgB,sBAAsB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,mBAAmB,CAsB1E;AAeD,wBAAgB,iCAAiC,CAC/C,SAAS,EAAE,SAAS,MAAM,EAAE,EAC5B,OAAO,GAAE,yBAA8B,GACtC,MAAM,EAAE,CAsBV;AAED,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,SAAS,cAAc,EAAE,EAChC,OAAO,GAAE,yBAA8B,GACtC,cAAc,EAAE,CAclB;AA6HD,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,UAAU,EAClB,OAAO,GAAE,IAAI,CAAC,yBAAyB,EAAE,OAAO,CAAM,GACrD,UAAU,CAKZ"}
@@ -6,6 +6,8 @@ const GOOGLE_UNSUPPORTED_SCHEMA_KEYS = new Set([
6
6
  "additionalProperties",
7
7
  "allOf",
8
8
  "default",
9
+ "exclusiveMaximum",
10
+ "exclusiveMinimum",
9
11
  "oneOf",
10
12
  "prefixItems",
11
13
  ]);
@@ -124,6 +126,12 @@ function getSharedLiteralType(values) {
124
126
  }
125
127
  return firstType;
126
128
  }
129
+ function getGoogleCompatibleSchemaType(type) {
130
+ if (!Array.isArray(type))
131
+ return type;
132
+ const nonNullTypes = type.filter((value) => value !== "null");
133
+ return nonNullTypes.length === 1 ? nonNullTypes[0] : undefined;
134
+ }
127
135
  function sanitizeGoogleSchemaValue(value) {
128
136
  if (Array.isArray(value)) {
129
137
  return value.map((item) => sanitizeGoogleSchemaValue(item));
@@ -138,6 +146,12 @@ function sanitizeGoogleSchemaValue(value) {
138
146
  if (key === "const" || key === "anyOf" || GOOGLE_UNSUPPORTED_SCHEMA_KEYS.has(key)) {
139
147
  continue;
140
148
  }
149
+ if (key === "type") {
150
+ const compatibleType = getGoogleCompatibleSchemaType(child);
151
+ if (compatibleType !== undefined)
152
+ sanitized.type = compatibleType;
153
+ continue;
154
+ }
141
155
  if (key === "properties" && isPlainRecord(child)) {
142
156
  sanitized.properties = Object.fromEntries(Object.entries(child).map(([propertyName, propertySchema]) => [
143
157
  propertyName,
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.1.436";
1
+ export declare const VERSION = "0.1.437";
2
2
  //# sourceMappingURL=version-constant.d.ts.map
@@ -1,3 +1,3 @@
1
1
  // Keep in sync with deno.json version.
2
2
  // scripts/release.ts updates this constant during releases.
3
- export const VERSION = "0.1.436";
3
+ export const VERSION = "0.1.437";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "veryfront",
3
- "version": "0.1.436",
3
+ "version": "0.1.437",
4
4
  "description": "The simplest way to build AI-powered apps",
5
5
  "keywords": [
6
6
  "react",
package/src/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.1.436",
3
+ "version": "0.1.437",
4
4
  "license": "Apache-2.0",
5
5
  "nodeModulesDir": "auto",
6
6
  "workspace": [
@@ -27,6 +27,8 @@ const GOOGLE_UNSUPPORTED_SCHEMA_KEYS = new Set([
27
27
  "additionalProperties",
28
28
  "allOf",
29
29
  "default",
30
+ "exclusiveMaximum",
31
+ "exclusiveMinimum",
30
32
  "oneOf",
31
33
  "prefixItems",
32
34
  ]);
@@ -175,6 +177,13 @@ function getSharedLiteralType(values: readonly unknown[]): JsonSchema["type"] |
175
177
  return firstType;
176
178
  }
177
179
 
180
+ function getGoogleCompatibleSchemaType(type: unknown): unknown {
181
+ if (!Array.isArray(type)) return type;
182
+
183
+ const nonNullTypes = type.filter((value) => value !== "null");
184
+ return nonNullTypes.length === 1 ? nonNullTypes[0] : undefined;
185
+ }
186
+
178
187
  function sanitizeGoogleSchemaValue(value: unknown): unknown {
179
188
  if (Array.isArray(value)) {
180
189
  return value.map((item) => sanitizeGoogleSchemaValue(item));
@@ -193,6 +202,12 @@ function sanitizeGoogleSchemaValue(value: unknown): unknown {
193
202
  continue;
194
203
  }
195
204
 
205
+ if (key === "type") {
206
+ const compatibleType = getGoogleCompatibleSchemaType(child);
207
+ if (compatibleType !== undefined) sanitized.type = compatibleType;
208
+ continue;
209
+ }
210
+
196
211
  if (key === "properties" && isPlainRecord(child)) {
197
212
  sanitized.properties = Object.fromEntries(
198
213
  Object.entries(child).map(([propertyName, propertySchema]) => [
@@ -1,3 +1,3 @@
1
1
  // Keep in sync with deno.json version.
2
2
  // scripts/release.ts updates this constant during releases.
3
- export const VERSION = "0.1.436";
3
+ export const VERSION = "0.1.437";