skedyul 0.1.5 → 0.1.6
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/dist/server.js +15 -4
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -20,14 +20,25 @@ function normalizeBilling(billing) {
|
|
|
20
20
|
// mismatches between the zod dependency used here and the one used by the
|
|
21
21
|
// library. At runtime the schemas are compatible.
|
|
22
22
|
const zodToJsonSchemaLoose = zod_to_json_schema_1.zodToJsonSchema;
|
|
23
|
+
let schemaIdCounter = 0;
|
|
23
24
|
function toJsonSchema(schema) {
|
|
24
25
|
if (!schema)
|
|
25
26
|
return undefined;
|
|
26
27
|
try {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
const schemaName = `ToolSchema${schemaIdCounter++}`;
|
|
29
|
+
const json = zodToJsonSchemaLoose(schema, schemaName);
|
|
30
|
+
if (typeof json === 'object' &&
|
|
31
|
+
json !== null &&
|
|
32
|
+
'$ref' in json &&
|
|
33
|
+
typeof json.$ref === 'string' &&
|
|
34
|
+
json.$ref.startsWith('#/definitions/')) {
|
|
35
|
+
const defName = json.$ref.split('/').pop();
|
|
36
|
+
const definitions = json.definitions;
|
|
37
|
+
if (defName && definitions && definitions[defName]) {
|
|
38
|
+
return definitions[defName];
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return json;
|
|
31
42
|
}
|
|
32
43
|
catch {
|
|
33
44
|
return undefined;
|