cliskill 1.0.3 → 1.0.4
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/bootstrap/cli.js
CHANGED
|
@@ -1189,12 +1189,22 @@ function zodToJsonSchema(schema) {
|
|
|
1189
1189
|
return result2;
|
|
1190
1190
|
}
|
|
1191
1191
|
if (schema instanceof z2.ZodTuple) {
|
|
1192
|
-
const
|
|
1192
|
+
const itemSchemas = schema.items.map((item) => zodToJsonSchema(item));
|
|
1193
|
+
const allTypes = itemSchemas.map((s) => s.type).filter(Boolean);
|
|
1194
|
+
const uniqueTypes = [...new Set(allTypes)];
|
|
1195
|
+
let mergedItems;
|
|
1196
|
+
if (uniqueTypes.length === 1) {
|
|
1197
|
+
mergedItems = { type: uniqueTypes[0] };
|
|
1198
|
+
} else if (uniqueTypes.length > 1) {
|
|
1199
|
+
mergedItems = { anyOf: uniqueTypes.map((t) => ({ type: t })) };
|
|
1200
|
+
} else {
|
|
1201
|
+
mergedItems = {};
|
|
1202
|
+
}
|
|
1193
1203
|
const result2 = {
|
|
1194
1204
|
type: "array",
|
|
1195
|
-
items,
|
|
1196
|
-
minItems:
|
|
1197
|
-
maxItems:
|
|
1205
|
+
items: mergedItems,
|
|
1206
|
+
minItems: itemSchemas.length,
|
|
1207
|
+
maxItems: itemSchemas.length
|
|
1198
1208
|
};
|
|
1199
1209
|
if (schema.description) result2.description = schema.description;
|
|
1200
1210
|
return result2;
|
|
@@ -10030,4 +10040,4 @@ export {
|
|
|
10030
10040
|
MessageList,
|
|
10031
10041
|
runCli
|
|
10032
10042
|
};
|
|
10033
|
-
//# sourceMappingURL=chunk-
|
|
10043
|
+
//# sourceMappingURL=chunk-UJMUL64T.js.map
|