@kirha/planner 0.1.3 → 0.1.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/index.js +180 -167
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -20667,39 +20667,22 @@ function resolveValue(value, outputsByStepId) {
|
|
|
20667
20667
|
|
|
20668
20668
|
// src/validator/index.ts
|
|
20669
20669
|
var import_json52 = __toESM(require_lib(), 1);
|
|
20670
|
-
function createErrorContext(step, argumentPath, reference) {
|
|
20671
|
-
return {
|
|
20672
|
-
stepId: step.stepId,
|
|
20673
|
-
toolName: step.toolName,
|
|
20674
|
-
argumentPath: formatPath(argumentPath),
|
|
20675
|
-
...reference && {
|
|
20676
|
-
fromStepId: reference.$fromStep,
|
|
20677
|
-
outputPath: reference.$outputKey
|
|
20678
|
-
}
|
|
20679
|
-
};
|
|
20680
|
-
}
|
|
20681
|
-
function createValidationError(code, message, context, extra) {
|
|
20682
|
-
return {
|
|
20683
|
-
code,
|
|
20684
|
-
message,
|
|
20685
|
-
...context,
|
|
20686
|
-
...extra
|
|
20687
|
-
};
|
|
20688
|
-
}
|
|
20689
20670
|
function isValidPlan(steps, tools) {
|
|
20690
20671
|
const errors3 = [];
|
|
20691
20672
|
const toolsByName = new Map(tools.map((tool) => [tool.name, tool]));
|
|
20692
20673
|
const schemasByTool = new Map;
|
|
20693
20674
|
const stepsById = new Map(steps.map((step) => [step.stepId, step]));
|
|
20694
20675
|
for (const tool of tools) {
|
|
20695
|
-
|
|
20696
|
-
|
|
20697
|
-
|
|
20698
|
-
|
|
20699
|
-
|
|
20676
|
+
try {
|
|
20677
|
+
schemasByTool.set(tool.name, {
|
|
20678
|
+
input: parseSchema(tool.inputSchema),
|
|
20679
|
+
output: parseSchema(tool.outputSchema)
|
|
20680
|
+
});
|
|
20681
|
+
} catch (error47) {
|
|
20682
|
+
const detail = error47 instanceof Error ? error47.message : String(error47);
|
|
20700
20683
|
errors3.push({
|
|
20701
20684
|
code: "schema_parse_error",
|
|
20702
|
-
message: `Failed to parse input/output schema for tool "${tool.name}"${detail}`,
|
|
20685
|
+
message: `Failed to parse input/output schema for tool "${tool.name}": ${detail}`,
|
|
20703
20686
|
toolName: tool.name
|
|
20704
20687
|
});
|
|
20705
20688
|
}
|
|
@@ -20726,42 +20709,30 @@ function isValidPlan(steps, tools) {
|
|
|
20726
20709
|
continue;
|
|
20727
20710
|
}
|
|
20728
20711
|
traverseReferences(step.arguments, {
|
|
20729
|
-
onDependency: (ref,
|
|
20730
|
-
|
|
20731
|
-
|
|
20732
|
-
|
|
20733
|
-
|
|
20734
|
-
|
|
20735
|
-
|
|
20736
|
-
|
|
20737
|
-
|
|
20738
|
-
|
|
20712
|
+
onDependency: (ref, inputPath) => {
|
|
20713
|
+
const formattedInputPath = formatPath(inputPath);
|
|
20714
|
+
const expectedSchema = getSchemaAtPath(schemas3.input, inputPath);
|
|
20715
|
+
if (!expectedSchema) {
|
|
20716
|
+
errors3.push({
|
|
20717
|
+
code: "input_key_missing",
|
|
20718
|
+
message: `Input path "${formattedInputPath}" not found on tool "${step.toolName}"`,
|
|
20719
|
+
stepId: step.stepId,
|
|
20720
|
+
toolName: step.toolName,
|
|
20721
|
+
argumentPath: formattedInputPath,
|
|
20722
|
+
fromStepId: ref.$fromStep,
|
|
20723
|
+
outputPath: ref.$outputKey
|
|
20724
|
+
});
|
|
20725
|
+
return;
|
|
20726
|
+
}
|
|
20727
|
+
validateOutputReference(ref, formattedInputPath, expectedSchema, step, stepsById, schemasByTool, errors3);
|
|
20739
20728
|
},
|
|
20740
|
-
onTemplate: (ref,
|
|
20741
|
-
validateStringTemplateReference(
|
|
20742
|
-
reference: ref,
|
|
20743
|
-
argumentPath: path2,
|
|
20744
|
-
step,
|
|
20745
|
-
inputSchema: schemas3.input,
|
|
20746
|
-
stepsById,
|
|
20747
|
-
schemasByTool,
|
|
20748
|
-
errors: errors3
|
|
20749
|
-
});
|
|
20729
|
+
onTemplate: (ref, inputPath) => {
|
|
20730
|
+
validateStringTemplateReference(ref, inputPath, step, schemas3.input, stepsById, schemasByTool, errors3);
|
|
20750
20731
|
}
|
|
20751
20732
|
});
|
|
20752
20733
|
}
|
|
20753
20734
|
return { valid: errors3.length === 0, errors: errors3 };
|
|
20754
20735
|
}
|
|
20755
|
-
function parseToolSchemas(tool) {
|
|
20756
|
-
try {
|
|
20757
|
-
const input = parseSchema(tool.inputSchema);
|
|
20758
|
-
const output = parseSchema(tool.outputSchema);
|
|
20759
|
-
return { schemas: { input, output } };
|
|
20760
|
-
} catch (error47) {
|
|
20761
|
-
const errorDetail = error47 instanceof Error ? error47.message : String(error47);
|
|
20762
|
-
return { schemas: null, errorDetail };
|
|
20763
|
-
}
|
|
20764
|
-
}
|
|
20765
20736
|
function parseSchema(rawSchema) {
|
|
20766
20737
|
try {
|
|
20767
20738
|
return exports_external.fromJSONSchema(import_json52.default.parse(rawSchema));
|
|
@@ -20770,106 +20741,74 @@ function parseSchema(rawSchema) {
|
|
|
20770
20741
|
throw new Error(`Invalid JSON schema: ${message}`);
|
|
20771
20742
|
}
|
|
20772
20743
|
}
|
|
20773
|
-
function
|
|
20774
|
-
const
|
|
20775
|
-
|
|
20776
|
-
|
|
20777
|
-
|
|
20778
|
-
|
|
20779
|
-
|
|
20780
|
-
|
|
20781
|
-
}
|
|
20782
|
-
function validateDependencyReference({
|
|
20783
|
-
reference,
|
|
20784
|
-
argumentPath,
|
|
20785
|
-
step,
|
|
20786
|
-
inputSchema,
|
|
20787
|
-
stepsById,
|
|
20788
|
-
schemasByTool,
|
|
20789
|
-
errors: errors3
|
|
20790
|
-
}) {
|
|
20791
|
-
const expectedSchema = getExpectedSchemaOrError(inputSchema, argumentPath, step, reference, errors3);
|
|
20792
|
-
if (expectedSchema) {
|
|
20793
|
-
validateOutputReference({
|
|
20794
|
-
reference,
|
|
20795
|
-
argumentPath,
|
|
20796
|
-
expectedSchema,
|
|
20797
|
-
step,
|
|
20798
|
-
stepsById,
|
|
20799
|
-
schemasByTool,
|
|
20800
|
-
errors: errors3
|
|
20801
|
-
});
|
|
20802
|
-
}
|
|
20803
|
-
}
|
|
20804
|
-
function resolveSourceStep(reference, stepsById, context, errors3) {
|
|
20744
|
+
function validateOutputReference(reference, inputPath, expectedSchema, step, stepsById, schemasByTool, errors3) {
|
|
20745
|
+
const baseContext = {
|
|
20746
|
+
stepId: step.stepId,
|
|
20747
|
+
toolName: step.toolName,
|
|
20748
|
+
argumentPath: inputPath,
|
|
20749
|
+
fromStepId: reference.$fromStep,
|
|
20750
|
+
outputPath: reference.$outputKey
|
|
20751
|
+
};
|
|
20805
20752
|
const sourceStep = stepsById.get(reference.$fromStep);
|
|
20806
20753
|
if (!sourceStep) {
|
|
20807
|
-
errors3.push(
|
|
20808
|
-
|
|
20754
|
+
errors3.push({
|
|
20755
|
+
code: "dependency_step_missing",
|
|
20756
|
+
message: `Step "${reference.$fromStep}" not found`,
|
|
20757
|
+
...baseContext
|
|
20758
|
+
});
|
|
20759
|
+
return;
|
|
20809
20760
|
}
|
|
20810
|
-
return sourceStep;
|
|
20811
|
-
}
|
|
20812
|
-
function resolveSourceSchemas(sourceStep, schemasByTool, context, errors3) {
|
|
20813
20761
|
const sourceSchemas = schemasByTool.get(sourceStep.toolName);
|
|
20814
20762
|
if (!sourceSchemas) {
|
|
20815
|
-
errors3.push(
|
|
20816
|
-
|
|
20763
|
+
errors3.push({
|
|
20764
|
+
code: "schema_parse_error",
|
|
20765
|
+
message: `Output schema for tool "${sourceStep.toolName}" could not be parsed`,
|
|
20766
|
+
...baseContext
|
|
20767
|
+
});
|
|
20768
|
+
return;
|
|
20817
20769
|
}
|
|
20818
|
-
return sourceSchemas;
|
|
20819
|
-
}
|
|
20820
|
-
function resolveOutputSchema(reference, sourceSchemas, sourceStep, context, errors3) {
|
|
20821
20770
|
const outputSchema = getSchemaAtPath(sourceSchemas.output, parsePath(reference.$outputKey));
|
|
20822
20771
|
if (!outputSchema) {
|
|
20823
|
-
errors3.push(
|
|
20824
|
-
|
|
20825
|
-
|
|
20826
|
-
|
|
20827
|
-
}
|
|
20828
|
-
function validateOutputReference({
|
|
20829
|
-
reference,
|
|
20830
|
-
argumentPath,
|
|
20831
|
-
expectedSchema,
|
|
20832
|
-
step,
|
|
20833
|
-
stepsById,
|
|
20834
|
-
schemasByTool,
|
|
20835
|
-
errors: errors3
|
|
20836
|
-
}) {
|
|
20837
|
-
const context = createErrorContext(step, argumentPath, reference);
|
|
20838
|
-
const sourceStep = resolveSourceStep(reference, stepsById, context, errors3);
|
|
20839
|
-
if (!sourceStep)
|
|
20840
|
-
return;
|
|
20841
|
-
const sourceSchemas = resolveSourceSchemas(sourceStep, schemasByTool, context, errors3);
|
|
20842
|
-
if (!sourceSchemas)
|
|
20843
|
-
return;
|
|
20844
|
-
const outputSchema = resolveOutputSchema(reference, sourceSchemas, sourceStep, context, errors3);
|
|
20845
|
-
if (!outputSchema)
|
|
20772
|
+
errors3.push({
|
|
20773
|
+
code: "output_key_missing",
|
|
20774
|
+
message: `Output key "${reference.$outputKey}" not found on tool "${sourceStep.toolName}"`,
|
|
20775
|
+
...baseContext
|
|
20776
|
+
});
|
|
20846
20777
|
return;
|
|
20778
|
+
}
|
|
20847
20779
|
if (!isSchemaCompatible(expectedSchema, outputSchema)) {
|
|
20848
|
-
errors3.push(
|
|
20780
|
+
errors3.push({
|
|
20781
|
+
code: "type_mismatch",
|
|
20782
|
+
message: `Type mismatch for "${inputPath}"`,
|
|
20783
|
+
...baseContext,
|
|
20849
20784
|
expectedType: describeSchemaType(expectedSchema),
|
|
20850
20785
|
actualType: describeSchemaType(outputSchema)
|
|
20851
|
-
})
|
|
20786
|
+
});
|
|
20852
20787
|
}
|
|
20853
20788
|
}
|
|
20854
|
-
function validateStringTemplateReference({
|
|
20855
|
-
|
|
20856
|
-
|
|
20857
|
-
step,
|
|
20858
|
-
inputSchema,
|
|
20859
|
-
stepsById,
|
|
20860
|
-
schemasByTool,
|
|
20861
|
-
errors: errors3
|
|
20862
|
-
}) {
|
|
20863
|
-
const expectedSchema = getExpectedSchemaOrError(inputSchema, argumentPath, step, undefined, errors3);
|
|
20789
|
+
function validateStringTemplateReference(reference, inputPath, step, inputSchema, stepsById, schemasByTool, errors3) {
|
|
20790
|
+
const formattedInputPath = formatPath(inputPath);
|
|
20791
|
+
const expectedSchema = getSchemaAtPath(inputSchema, inputPath);
|
|
20864
20792
|
if (!expectedSchema) {
|
|
20793
|
+
errors3.push({
|
|
20794
|
+
code: "input_key_missing",
|
|
20795
|
+
message: `Input path "${formattedInputPath}" not found on tool "${step.toolName}"`,
|
|
20796
|
+
stepId: step.stepId,
|
|
20797
|
+
toolName: step.toolName,
|
|
20798
|
+
argumentPath: formattedInputPath
|
|
20799
|
+
});
|
|
20865
20800
|
return;
|
|
20866
20801
|
}
|
|
20867
|
-
const context = createErrorContext(step, argumentPath);
|
|
20868
20802
|
if (!isSchemaCompatible(expectedSchema, exports_external.string())) {
|
|
20869
|
-
errors3.push(
|
|
20803
|
+
errors3.push({
|
|
20804
|
+
code: "type_mismatch",
|
|
20805
|
+
message: `Type mismatch for "${formattedInputPath}"`,
|
|
20806
|
+
stepId: step.stepId,
|
|
20807
|
+
toolName: step.toolName,
|
|
20808
|
+
argumentPath: formattedInputPath,
|
|
20870
20809
|
expectedType: describeSchemaType(expectedSchema),
|
|
20871
20810
|
actualType: "string"
|
|
20872
|
-
})
|
|
20811
|
+
});
|
|
20873
20812
|
}
|
|
20874
20813
|
const stringCoercible = exports_external.union([
|
|
20875
20814
|
exports_external.string(),
|
|
@@ -20879,53 +20818,112 @@ function validateStringTemplateReference({
|
|
|
20879
20818
|
exports_external.array(exports_external.any())
|
|
20880
20819
|
]);
|
|
20881
20820
|
for (const ref of reference.$values) {
|
|
20882
|
-
validateOutputReference(
|
|
20883
|
-
reference: ref,
|
|
20884
|
-
argumentPath,
|
|
20885
|
-
expectedSchema: stringCoercible,
|
|
20886
|
-
step,
|
|
20887
|
-
stepsById,
|
|
20888
|
-
schemasByTool,
|
|
20889
|
-
errors: errors3
|
|
20890
|
-
});
|
|
20821
|
+
validateOutputReference(ref, formattedInputPath, stringCoercible, step, stepsById, schemasByTool, errors3);
|
|
20891
20822
|
}
|
|
20892
20823
|
}
|
|
20893
20824
|
function getSchemaAtPath(schema, path2) {
|
|
20894
|
-
|
|
20895
|
-
|
|
20896
|
-
|
|
20897
|
-
|
|
20898
|
-
|
|
20899
|
-
|
|
20900
|
-
|
|
20901
|
-
continue;
|
|
20902
|
-
}
|
|
20903
|
-
if (current instanceof exports_external.ZodArray && isNumericString(segment)) {
|
|
20904
|
-
current = unwrapSchema(current.element);
|
|
20905
|
-
continue;
|
|
20906
|
-
}
|
|
20907
|
-
if (!(current instanceof exports_external.ZodObject)) {
|
|
20825
|
+
const unwrapped = unwrapSchema(schema);
|
|
20826
|
+
if (path2.length === 0) {
|
|
20827
|
+
return unwrapped;
|
|
20828
|
+
}
|
|
20829
|
+
if (unwrapped instanceof exports_external.ZodUnion || unwrapped instanceof exports_external.ZodXor) {
|
|
20830
|
+
const resolvedOptions = unwrapped.options.map((option) => getSchemaAtPath(option, path2)).filter((resolved) => resolved !== undefined);
|
|
20831
|
+
if (resolvedOptions.length === 0) {
|
|
20908
20832
|
return;
|
|
20909
20833
|
}
|
|
20910
|
-
|
|
20911
|
-
|
|
20912
|
-
|
|
20834
|
+
if (resolvedOptions.length === 1) {
|
|
20835
|
+
return resolvedOptions[0];
|
|
20836
|
+
}
|
|
20837
|
+
return exports_external.union(resolvedOptions);
|
|
20838
|
+
}
|
|
20839
|
+
const segment = path2[0];
|
|
20840
|
+
if (segment === undefined) {
|
|
20841
|
+
return unwrapped;
|
|
20842
|
+
}
|
|
20843
|
+
const remainingPath = path2.slice(1);
|
|
20844
|
+
if (typeof segment === "number") {
|
|
20845
|
+
if (!(unwrapped instanceof exports_external.ZodArray)) {
|
|
20913
20846
|
return;
|
|
20914
20847
|
}
|
|
20915
|
-
|
|
20848
|
+
return getSchemaAtPath(unwrapped.element, remainingPath);
|
|
20916
20849
|
}
|
|
20917
|
-
|
|
20850
|
+
if (unwrapped instanceof exports_external.ZodArray && isNumericString(segment)) {
|
|
20851
|
+
return getSchemaAtPath(unwrapped.element, remainingPath);
|
|
20852
|
+
}
|
|
20853
|
+
if (!(unwrapped instanceof exports_external.ZodObject)) {
|
|
20854
|
+
return;
|
|
20855
|
+
}
|
|
20856
|
+
const childSchema = getObjectChildSchema(unwrapped, segment);
|
|
20857
|
+
if (!childSchema) {
|
|
20858
|
+
return;
|
|
20859
|
+
}
|
|
20860
|
+
return getSchemaAtPath(childSchema, remainingPath);
|
|
20861
|
+
}
|
|
20862
|
+
function getObjectChildSchema(schema, segment) {
|
|
20863
|
+
const shape = schema.shape;
|
|
20864
|
+
const direct = shape[segment];
|
|
20865
|
+
if (direct) {
|
|
20866
|
+
return direct;
|
|
20867
|
+
}
|
|
20868
|
+
const catchall = schema.def.catchall;
|
|
20869
|
+
if (!isUsableCatchall(catchall)) {
|
|
20870
|
+
return;
|
|
20871
|
+
}
|
|
20872
|
+
return catchall;
|
|
20873
|
+
}
|
|
20874
|
+
function isUsableCatchall(schema) {
|
|
20875
|
+
return Boolean(schema && !(schema instanceof exports_external.ZodUnknown || schema instanceof exports_external.ZodAny || schema instanceof exports_external.ZodNever));
|
|
20918
20876
|
}
|
|
20919
20877
|
function unwrapSchema(schema) {
|
|
20920
20878
|
if (schema instanceof exports_external.ZodOptional || schema instanceof exports_external.ZodDefault || schema instanceof exports_external.ZodNullable) {
|
|
20921
|
-
return unwrapSchema(schema.
|
|
20879
|
+
return unwrapSchema(schema.def.innerType);
|
|
20922
20880
|
}
|
|
20923
20881
|
return schema;
|
|
20924
20882
|
}
|
|
20925
20883
|
function isSchemaCompatible(expected, actual) {
|
|
20884
|
+
const expectedUnwrapped = unwrapSchema(expected);
|
|
20885
|
+
const actualUnwrapped = unwrapSchema(actual);
|
|
20886
|
+
if (expectedUnwrapped instanceof exports_external.ZodAny) {
|
|
20887
|
+
return true;
|
|
20888
|
+
}
|
|
20889
|
+
if (expectedUnwrapped instanceof exports_external.ZodUnion || expectedUnwrapped instanceof exports_external.ZodXor) {
|
|
20890
|
+
return expectedUnwrapped.options.some((option) => isSchemaCompatible(option, actualUnwrapped));
|
|
20891
|
+
}
|
|
20892
|
+
if (actualUnwrapped instanceof exports_external.ZodUnion || actualUnwrapped instanceof exports_external.ZodXor) {
|
|
20893
|
+
return actualUnwrapped.options.some((option) => isSchemaCompatible(expectedUnwrapped, option));
|
|
20894
|
+
}
|
|
20895
|
+
if (expectedUnwrapped instanceof exports_external.ZodArray && actualUnwrapped instanceof exports_external.ZodArray) {
|
|
20896
|
+
return isSchemaCompatible(expectedUnwrapped.element, actualUnwrapped.element);
|
|
20897
|
+
}
|
|
20898
|
+
if (expectedUnwrapped instanceof exports_external.ZodObject && actualUnwrapped instanceof exports_external.ZodObject) {
|
|
20899
|
+
const expectedShape = expectedUnwrapped.shape;
|
|
20900
|
+
const actualShape = actualUnwrapped.shape;
|
|
20901
|
+
for (const [key, expectedFieldSchema] of Object.entries(expectedShape)) {
|
|
20902
|
+
if (isOptionalField(expectedFieldSchema)) {
|
|
20903
|
+
continue;
|
|
20904
|
+
}
|
|
20905
|
+
const actualFieldSchema = actualShape[key];
|
|
20906
|
+
if (!actualFieldSchema) {
|
|
20907
|
+
return false;
|
|
20908
|
+
}
|
|
20909
|
+
if (!isSchemaCompatible(expectedFieldSchema, actualFieldSchema)) {
|
|
20910
|
+
return false;
|
|
20911
|
+
}
|
|
20912
|
+
}
|
|
20913
|
+
for (const [key, actualFieldSchema] of Object.entries(actualShape)) {
|
|
20914
|
+
const expectedFieldSchema = expectedShape[key];
|
|
20915
|
+
if (!expectedFieldSchema) {
|
|
20916
|
+
continue;
|
|
20917
|
+
}
|
|
20918
|
+
if (!isSchemaCompatible(expectedFieldSchema, actualFieldSchema)) {
|
|
20919
|
+
return false;
|
|
20920
|
+
}
|
|
20921
|
+
}
|
|
20922
|
+
return true;
|
|
20923
|
+
}
|
|
20926
20924
|
const expectedTypes = getTypeSet(expected);
|
|
20927
20925
|
const actualTypes = getTypeSet(actual);
|
|
20928
|
-
if (expectedTypes.has("any")) {
|
|
20926
|
+
if (expectedTypes.has("any") || actualTypes.has("unknown")) {
|
|
20929
20927
|
return true;
|
|
20930
20928
|
}
|
|
20931
20929
|
for (const actualType of actualTypes) {
|
|
@@ -20935,15 +20933,26 @@ function isSchemaCompatible(expected, actual) {
|
|
|
20935
20933
|
}
|
|
20936
20934
|
return false;
|
|
20937
20935
|
}
|
|
20936
|
+
function isOptionalField(schema) {
|
|
20937
|
+
return schema instanceof exports_external.ZodOptional || schema instanceof exports_external.ZodDefault;
|
|
20938
|
+
}
|
|
20938
20939
|
var KNOWN_ZOD_TYPES = [
|
|
20939
20940
|
[exports_external.ZodAny, "any"],
|
|
20941
|
+
[exports_external.ZodUnknown, "any"],
|
|
20940
20942
|
[exports_external.ZodString, "string"],
|
|
20941
20943
|
[exports_external.ZodNumber, "number"],
|
|
20942
20944
|
[exports_external.ZodBoolean, "boolean"],
|
|
20943
20945
|
[exports_external.ZodNull, "null"],
|
|
20944
20946
|
[exports_external.ZodArray, "array"],
|
|
20945
|
-
[exports_external.
|
|
20947
|
+
[exports_external.ZodTuple, "array"],
|
|
20948
|
+
[exports_external.ZodObject, "object"],
|
|
20949
|
+
[exports_external.ZodEnum, "string"]
|
|
20946
20950
|
];
|
|
20951
|
+
var LITERAL_TYPE_MAP = {
|
|
20952
|
+
string: "string",
|
|
20953
|
+
number: "number",
|
|
20954
|
+
boolean: "boolean"
|
|
20955
|
+
};
|
|
20947
20956
|
function getTypeSet(schema) {
|
|
20948
20957
|
const unwrapped = unwrapSchema(schema);
|
|
20949
20958
|
for (const [ZodClass, typeName] of KNOWN_ZOD_TYPES) {
|
|
@@ -20951,7 +20960,11 @@ function getTypeSet(schema) {
|
|
|
20951
20960
|
return new Set([typeName]);
|
|
20952
20961
|
}
|
|
20953
20962
|
}
|
|
20954
|
-
if (unwrapped instanceof exports_external.
|
|
20963
|
+
if (unwrapped instanceof exports_external.ZodLiteral) {
|
|
20964
|
+
const type = LITERAL_TYPE_MAP[typeof unwrapped.value];
|
|
20965
|
+
return new Set([type ?? "unknown"]);
|
|
20966
|
+
}
|
|
20967
|
+
if (unwrapped instanceof exports_external.ZodUnion || unwrapped instanceof exports_external.ZodXor) {
|
|
20955
20968
|
const types = new Set;
|
|
20956
20969
|
for (const option of unwrapped.options) {
|
|
20957
20970
|
for (const type of getTypeSet(option)) {
|