agent-contracts 0.22.4 → 0.22.5
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/cli.js +20 -3
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.js +20 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -49957,13 +49957,13 @@ var DslSchema = z15.object({
|
|
|
49957
49957
|
// src/schema/json-schema-utils.ts
|
|
49958
49958
|
function resolveAllOf(schema) {
|
|
49959
49959
|
const allOf = schema["allOf"];
|
|
49960
|
-
if (!Array.isArray(allOf)) return schema;
|
|
49960
|
+
if (!Array.isArray(allOf)) return resolveNestedProperties(schema);
|
|
49961
49961
|
let mergedProperties = {};
|
|
49962
49962
|
let mergedRequired = [];
|
|
49963
49963
|
const mergedTop = {};
|
|
49964
49964
|
for (const sub of allOf) {
|
|
49965
49965
|
if (typeof sub !== "object" || sub === null || Array.isArray(sub)) continue;
|
|
49966
|
-
const subSchema = sub;
|
|
49966
|
+
const subSchema = resolveAllOf(sub);
|
|
49967
49967
|
if (subSchema["properties"] && typeof subSchema["properties"] === "object") {
|
|
49968
49968
|
mergedProperties = {
|
|
49969
49969
|
...mergedProperties,
|
|
@@ -49994,13 +49994,30 @@ function resolveAllOf(schema) {
|
|
|
49994
49994
|
}
|
|
49995
49995
|
const result = { ...mergedTop };
|
|
49996
49996
|
if (Object.keys(mergedProperties).length > 0) {
|
|
49997
|
-
result["properties"] = mergedProperties;
|
|
49997
|
+
result["properties"] = resolvePropertySchemas(mergedProperties);
|
|
49998
49998
|
}
|
|
49999
49999
|
if (mergedRequired.length > 0) {
|
|
50000
50000
|
result["required"] = [...new Set(mergedRequired)];
|
|
50001
50001
|
}
|
|
50002
50002
|
return result;
|
|
50003
50003
|
}
|
|
50004
|
+
function resolveNestedProperties(schema) {
|
|
50005
|
+
const props = schema["properties"];
|
|
50006
|
+
if (!props || typeof props !== "object") return schema;
|
|
50007
|
+
return { ...schema, properties: resolvePropertySchemas(props) };
|
|
50008
|
+
}
|
|
50009
|
+
function resolvePropertySchemas(properties) {
|
|
50010
|
+
const result = {};
|
|
50011
|
+
for (const [key, value] of Object.entries(properties)) {
|
|
50012
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
50013
|
+
const propSchema = value;
|
|
50014
|
+
result[key] = propSchema["allOf"] ? resolveAllOf(propSchema) : propSchema;
|
|
50015
|
+
} else {
|
|
50016
|
+
result[key] = value;
|
|
50017
|
+
}
|
|
50018
|
+
}
|
|
50019
|
+
return result;
|
|
50020
|
+
}
|
|
50004
50021
|
|
|
50005
50022
|
// src/schema/merge-operators.ts
|
|
50006
50023
|
import { z as z16 } from "zod";
|