@postman/sdk-config 0.20.0 → 0.23.0
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.cjs +192 -94
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +192 -95
- package/dist/index.js.map +1 -1
- package/dist/sdk-config/index.cjs +191 -94
- package/dist/sdk-config/index.cjs.map +1 -1
- package/dist/sdk-config/index.d.cts +1 -1
- package/dist/sdk-config/index.d.ts +1 -1
- package/dist/sdk-config/index.js +191 -94
- package/dist/sdk-config/index.js.map +1 -1
- package/dist/sdk-config/v1/index.cjs +191 -94
- package/dist/sdk-config/v1/index.cjs.map +1 -1
- package/dist/sdk-config/v1/index.d.cts +20 -2
- package/dist/sdk-config/v1/index.d.ts +20 -2
- package/dist/sdk-config/v1/index.js +191 -94
- package/dist/sdk-config/v1/index.js.map +1 -1
- package/dist/sdk-config-ir/index.cjs +24 -1
- package/dist/sdk-config-ir/index.cjs.map +1 -1
- package/dist/sdk-config-ir/index.d.cts +1 -1
- package/dist/sdk-config-ir/index.d.ts +1 -1
- package/dist/sdk-config-ir/index.js +24 -2
- package/dist/sdk-config-ir/index.js.map +1 -1
- package/dist/sdk-config-ir/v1/index.cjs +24 -1
- package/dist/sdk-config-ir/v1/index.cjs.map +1 -1
- package/dist/sdk-config-ir/v1/index.d.cts +29 -2
- package/dist/sdk-config-ir/v1/index.d.ts +29 -2
- package/dist/sdk-config-ir/v1/index.js +24 -2
- package/dist/sdk-config-ir/v1/index.js.map +1 -1
- package/dist/{typescript-VEqEGvnA.d.cts → typescript-ZRqfOhMd.d.cts} +23 -1
- package/dist/{typescript-VEqEGvnA.d.ts → typescript-ZRqfOhMd.d.ts} +23 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -700,6 +700,121 @@ var docsConfigSchema = zod.z.strictObject({
|
|
|
700
700
|
var sdkConfigV1ReadmeEndpointSchema = readmeEndpointSchema;
|
|
701
701
|
var sdkConfigV1ReadmeCustomSectionSchema = readmeCustomSectionSchema;
|
|
702
702
|
var sdkConfigV1DocsConfigSchema = docsConfigSchema;
|
|
703
|
+
var compilerOptionsSchema = zod.z.strictObject({
|
|
704
|
+
target: nonEmptyStringSchema.optional().describe("The JavaScript language target passed to TypeScript."),
|
|
705
|
+
module: nonEmptyStringSchema.optional().describe("The module format passed to TypeScript."),
|
|
706
|
+
lib: zod.z.array(nonEmptyStringSchema).optional().describe("The runtime library definitions passed to TypeScript.")
|
|
707
|
+
});
|
|
708
|
+
var packageScriptSchema = zod.z.strictObject({
|
|
709
|
+
name: nonEmptyStringSchema.describe("The package script name."),
|
|
710
|
+
command: nonEmptyStringSchema.describe("The command executed by the package script.")
|
|
711
|
+
});
|
|
712
|
+
var httpClientSchema = zod.z.strictObject({
|
|
713
|
+
name: zod.z.enum(["axios", "fetch", "node-fetch"]).describe("The HTTP client used by generated TypeScript code.")
|
|
714
|
+
});
|
|
715
|
+
var typescriptGenerationConfigSchema = zod.z.strictObject({
|
|
716
|
+
typescriptVersion: nonEmptyStringSchema.optional().describe("The TypeScript version used by the generated project."),
|
|
717
|
+
zodVersion: nonEmptyStringSchema.optional().describe("The Zod version used by generated runtime schemas."),
|
|
718
|
+
compilerOptions: compilerOptionsSchema.optional().describe("TypeScript compiler options for the generated project."),
|
|
719
|
+
httpClient: httpClientSchema.optional().describe("The HTTP client used by generated TypeScript code."),
|
|
720
|
+
packageManager: zod.z.enum(["pnpm", "yarn"]).optional().describe("The package manager used by the generated project."),
|
|
721
|
+
packageManagerVersion: nonEmptyStringSchema.optional().describe("The package manager version used by the generated project."),
|
|
722
|
+
testFramework: zod.z.enum(["jest", "vitest"]).optional().describe("The test framework used by generated tests."),
|
|
723
|
+
namingStrategy: zod.z.enum(["base", "originalPropertyNames"]).optional().describe("How schema property names are converted into TypeScript identifiers."),
|
|
724
|
+
bundle: zod.z.boolean().optional().describe("Whether the generated package includes bundled output."),
|
|
725
|
+
exportClassDefault: zod.z.boolean().optional().describe("Whether the client class is also exported as the default export."),
|
|
726
|
+
/** Name of the top-level namespace export emitted by Fern-compatible TypeScript SDKs. */
|
|
727
|
+
namespaceExportName: nonEmptyStringSchema.optional().describe("The top-level namespace export name."),
|
|
728
|
+
consolidateTypeFiles: zod.z.boolean().optional().describe("Whether generated types are consolidated into fewer source files."),
|
|
729
|
+
formDataSupport: zod.z.enum(["Node16", "Node18"]).optional().describe(
|
|
730
|
+
"The multipart form-data implementation: Node16 uses the form-data packages, Node18 uses the platform FormData."
|
|
731
|
+
),
|
|
732
|
+
allowExtraFields: zod.z.boolean().optional().describe(
|
|
733
|
+
"Whether response parsing keeps unrecognized object keys and accepts unrecognized union members and enum values."
|
|
734
|
+
),
|
|
735
|
+
generateSubpackageExports: zod.z.boolean().optional().describe(
|
|
736
|
+
"Whether the package manifest exports each subpackage client as its own entry point."
|
|
737
|
+
),
|
|
738
|
+
exportAllRequestsAtRoot: zod.z.boolean().optional().describe("Whether every request type is also exported from the package root."),
|
|
739
|
+
generateEndpointMetadata: zod.z.boolean().optional().describe("Whether generated clients expose metadata for each endpoint."),
|
|
740
|
+
outputEsm: zod.z.boolean().optional().describe(
|
|
741
|
+
"Whether the package is marked as an ES module while still shipping its CommonJS build."
|
|
742
|
+
),
|
|
743
|
+
neverThrowErrors: zod.z.boolean().optional().describe(
|
|
744
|
+
"Whether client methods return a wrapped response instead of throwing on a non-2xx status."
|
|
745
|
+
),
|
|
746
|
+
includeOtherInUnionTypes: zod.z.boolean().optional().describe("Whether union types gain a member for variants the SDK does not recognize."),
|
|
747
|
+
includeUtilsOnUnionMembers: zod.z.boolean().optional().describe("Whether helper utilities are generated on each member of a union type."),
|
|
748
|
+
omitFernHeaders: zod.z.boolean().optional().describe("Whether requests omit the SDK identification headers and the User-Agent header."),
|
|
749
|
+
linter: zod.z.enum(["biome", "oxlint", "none"]).optional().describe("The linter configured in the generated project."),
|
|
750
|
+
formatter: zod.z.enum(["prettier", "biome", "oxfmt", "none"]).optional().describe("The formatter configured in the generated project."),
|
|
751
|
+
exports: jsonObjectSchema.optional().describe(
|
|
752
|
+
"package.json exports entries, keyed by subpath, applied over the generated exports. Each subpath replaces the generated one."
|
|
753
|
+
),
|
|
754
|
+
files: zod.z.array(nonEmptyStringSchema).optional().describe("package.json files entries, listed ahead of the generated ones."),
|
|
755
|
+
engines: zod.z.record(nonEmptyStringSchema, nonEmptyStringSchema).optional().describe("package.json engines version ranges, keyed by engine name such as node."),
|
|
756
|
+
lintStaged: zod.z.record(nonEmptyStringSchema, zod.z.array(nonEmptyStringSchema).min(1)).optional().describe("lint-staged commands to run, keyed by file glob."),
|
|
757
|
+
browser: zod.z.record(nonEmptyStringSchema, zod.z.union([zod.z.boolean(), nonEmptyStringSchema])).optional().describe(
|
|
758
|
+
"package.json browser field: a module or file is excluded (false) or replaced by another path."
|
|
759
|
+
),
|
|
760
|
+
allowCustomFetcher: zod.z.boolean().optional().describe("Whether callers can supply a custom fetch implementation."),
|
|
761
|
+
useBrandedStringAliases: zod.z.boolean().optional().describe("Whether string aliases are emitted as distinct branded types."),
|
|
762
|
+
useLegacyExports: zod.z.boolean().optional().describe("Whether the package emits the legacy export layout."),
|
|
763
|
+
useBigInt: zod.z.boolean().optional().describe("Whether 64-bit integer values are represented with bigint."),
|
|
764
|
+
serdeLayer: zod.z.boolean().optional().describe("Whether generated models use Fern serialization and deserialization helpers."),
|
|
765
|
+
/** Ship only the ESM build (drops CJS) to avoid the Node dual-package hazard. */
|
|
766
|
+
esmOnly: zod.z.boolean().optional().describe("Whether the package emits only ECMAScript modules."),
|
|
767
|
+
scripts: zod.z.array(packageScriptSchema).optional().describe("Additional scripts added to the generated package manifest.")
|
|
768
|
+
});
|
|
769
|
+
|
|
770
|
+
// src/sdk-config-domain/v1/language/mcp.ts
|
|
771
|
+
var mcpAvailabilityStatuses = [
|
|
772
|
+
"IN_DEVELOPMENT",
|
|
773
|
+
"PRE_RELEASE",
|
|
774
|
+
"GENERAL_AVAILABILITY",
|
|
775
|
+
"DEPRECATED",
|
|
776
|
+
"ALPHA",
|
|
777
|
+
"BETA",
|
|
778
|
+
"PREVIEW",
|
|
779
|
+
"LEGACY"
|
|
780
|
+
];
|
|
781
|
+
var mcpToolFilterSchema = zod.z.strictObject({
|
|
782
|
+
include: zod.z.array(nonEmptyStringSchema).optional().describe("Operations explicitly included as MCP tools."),
|
|
783
|
+
exclude: zod.z.array(nonEmptyStringSchema).optional().describe("Operations explicitly excluded from MCP tools.")
|
|
784
|
+
});
|
|
785
|
+
var mcpToolsetNameSchema = nonEmptyStringSchema.refine(
|
|
786
|
+
(name) => name !== "default" && /^[a-z0-9-]+$/.test(name),
|
|
787
|
+
'toolset names must match [a-z0-9-]+ and cannot be "default"'
|
|
788
|
+
);
|
|
789
|
+
var MCP_TOOL_NAME_PATTERN = /^[a-zA-Z0-9_-]{1,64}$/;
|
|
790
|
+
var mcpToolNameSchema = nonEmptyStringSchema.refine(
|
|
791
|
+
(name) => MCP_TOOL_NAME_PATTERN.test(name),
|
|
792
|
+
"tool names must match [a-zA-Z0-9_-]{1,64}"
|
|
793
|
+
);
|
|
794
|
+
var mcpMergedToolSchema = mcpToolFilterSchema.extend({
|
|
795
|
+
dispatchOn: nonEmptyStringSchema.describe(
|
|
796
|
+
"The tool argument whose value selects which member operation to call."
|
|
797
|
+
),
|
|
798
|
+
description: nonEmptyStringSchema.optional().describe("Overrides the generated description of the merged tool.")
|
|
799
|
+
});
|
|
800
|
+
var mcpCustomToolSchema = zod.z.strictObject({
|
|
801
|
+
path: relativePathSchema.describe(
|
|
802
|
+
"Path to a TypeScript module that exports the tool `definition` and `handler`."
|
|
803
|
+
)
|
|
804
|
+
});
|
|
805
|
+
var mcpGenerationConfigSchema = typescriptGenerationConfigSchema.extend({
|
|
806
|
+
serverName: nonEmptyStringSchema.optional().describe("The name advertised by the generated MCP server."),
|
|
807
|
+
serverDescription: nonEmptyStringSchema.optional().describe("The description advertised by the generated MCP server."),
|
|
808
|
+
excludeAvailability: zod.z.array(zod.z.enum(mcpAvailabilityStatuses)).optional().describe("Operation availability statuses excluded from MCP tool generation."),
|
|
809
|
+
tools: mcpToolFilterSchema.optional().describe("Global operation filters for generated MCP tools."),
|
|
810
|
+
toolsets: zod.z.record(mcpToolsetNameSchema, mcpToolFilterSchema).optional().describe("Named MCP toolsets and the operation filters for each toolset."),
|
|
811
|
+
mergedTools: zod.z.record(mcpToolNameSchema, mcpMergedToolSchema).optional().describe(
|
|
812
|
+
"Tools that fan several operations into one, dispatching on an argument. Each entry selects its member operations with the same include/exclude filter as `tools`."
|
|
813
|
+
),
|
|
814
|
+
customTools: zod.z.record(mcpToolNameSchema, mcpCustomToolSchema).optional().describe(
|
|
815
|
+
"Hand-written tools, keyed by tool name, each pointing at a TypeScript module that exports its `definition` and `handler`. Emitted alongside the operation-derived tools."
|
|
816
|
+
)
|
|
817
|
+
});
|
|
703
818
|
|
|
704
819
|
// src/sdk-config/v1/fern-config-mapper-types.ts
|
|
705
820
|
var FernConfigMappingError = class extends Error {
|
|
@@ -2817,99 +2932,6 @@ var javaGenerationConfigSchema = jvmGenerationConfigSchema.extend({
|
|
|
2817
2932
|
|
|
2818
2933
|
// src/sdk-config-domain/v1/language/kotlin.ts
|
|
2819
2934
|
var kotlinGenerationConfigSchema = jvmGenerationConfigSchema;
|
|
2820
|
-
var compilerOptionsSchema = zod.z.strictObject({
|
|
2821
|
-
target: nonEmptyStringSchema.optional().describe("The JavaScript language target passed to TypeScript."),
|
|
2822
|
-
module: nonEmptyStringSchema.optional().describe("The module format passed to TypeScript."),
|
|
2823
|
-
lib: zod.z.array(nonEmptyStringSchema).optional().describe("The runtime library definitions passed to TypeScript.")
|
|
2824
|
-
});
|
|
2825
|
-
var packageScriptSchema = zod.z.strictObject({
|
|
2826
|
-
name: nonEmptyStringSchema.describe("The package script name."),
|
|
2827
|
-
command: nonEmptyStringSchema.describe("The command executed by the package script.")
|
|
2828
|
-
});
|
|
2829
|
-
var httpClientSchema = zod.z.strictObject({
|
|
2830
|
-
name: zod.z.enum(["axios", "fetch", "node-fetch"]).describe("The HTTP client used by generated TypeScript code.")
|
|
2831
|
-
});
|
|
2832
|
-
var typescriptGenerationConfigSchema = zod.z.strictObject({
|
|
2833
|
-
typescriptVersion: nonEmptyStringSchema.optional().describe("The TypeScript version used by the generated project."),
|
|
2834
|
-
zodVersion: nonEmptyStringSchema.optional().describe("The Zod version used by generated runtime schemas."),
|
|
2835
|
-
compilerOptions: compilerOptionsSchema.optional().describe("TypeScript compiler options for the generated project."),
|
|
2836
|
-
httpClient: httpClientSchema.optional().describe("The HTTP client used by generated TypeScript code."),
|
|
2837
|
-
packageManager: zod.z.enum(["pnpm", "yarn"]).optional().describe("The package manager used by the generated project."),
|
|
2838
|
-
packageManagerVersion: nonEmptyStringSchema.optional().describe("The package manager version used by the generated project."),
|
|
2839
|
-
testFramework: zod.z.enum(["jest", "vitest"]).optional().describe("The test framework used by generated tests."),
|
|
2840
|
-
namingStrategy: zod.z.enum(["base", "originalPropertyNames"]).optional().describe("How schema property names are converted into TypeScript identifiers."),
|
|
2841
|
-
bundle: zod.z.boolean().optional().describe("Whether the generated package includes bundled output."),
|
|
2842
|
-
exportClassDefault: zod.z.boolean().optional().describe("Whether the client class is also exported as the default export."),
|
|
2843
|
-
/** Name of the top-level namespace export emitted by Fern-compatible TypeScript SDKs. */
|
|
2844
|
-
namespaceExportName: nonEmptyStringSchema.optional().describe("The top-level namespace export name."),
|
|
2845
|
-
consolidateTypeFiles: zod.z.boolean().optional().describe("Whether generated types are consolidated into fewer source files."),
|
|
2846
|
-
formDataSupport: zod.z.enum(["Node16", "Node18"]).optional().describe(
|
|
2847
|
-
"The multipart form-data implementation: Node16 uses the form-data packages, Node18 uses the platform FormData."
|
|
2848
|
-
),
|
|
2849
|
-
allowExtraFields: zod.z.boolean().optional().describe(
|
|
2850
|
-
"Whether response parsing keeps unrecognized object keys and accepts unrecognized union members and enum values."
|
|
2851
|
-
),
|
|
2852
|
-
generateSubpackageExports: zod.z.boolean().optional().describe(
|
|
2853
|
-
"Whether the package manifest exports each subpackage client as its own entry point."
|
|
2854
|
-
),
|
|
2855
|
-
exportAllRequestsAtRoot: zod.z.boolean().optional().describe("Whether every request type is also exported from the package root."),
|
|
2856
|
-
generateEndpointMetadata: zod.z.boolean().optional().describe("Whether generated clients expose metadata for each endpoint."),
|
|
2857
|
-
outputEsm: zod.z.boolean().optional().describe(
|
|
2858
|
-
"Whether the package is marked as an ES module while still shipping its CommonJS build."
|
|
2859
|
-
),
|
|
2860
|
-
neverThrowErrors: zod.z.boolean().optional().describe(
|
|
2861
|
-
"Whether client methods return a wrapped response instead of throwing on a non-2xx status."
|
|
2862
|
-
),
|
|
2863
|
-
includeOtherInUnionTypes: zod.z.boolean().optional().describe("Whether union types gain a member for variants the SDK does not recognize."),
|
|
2864
|
-
includeUtilsOnUnionMembers: zod.z.boolean().optional().describe("Whether helper utilities are generated on each member of a union type."),
|
|
2865
|
-
omitFernHeaders: zod.z.boolean().optional().describe("Whether requests omit the SDK identification headers and the User-Agent header."),
|
|
2866
|
-
linter: zod.z.enum(["biome", "oxlint", "none"]).optional().describe("The linter configured in the generated project."),
|
|
2867
|
-
formatter: zod.z.enum(["prettier", "biome", "oxfmt", "none"]).optional().describe("The formatter configured in the generated project."),
|
|
2868
|
-
exports: jsonObjectSchema.optional().describe(
|
|
2869
|
-
"package.json exports entries, keyed by subpath, applied over the generated exports. Each subpath replaces the generated one."
|
|
2870
|
-
),
|
|
2871
|
-
files: zod.z.array(nonEmptyStringSchema).optional().describe("package.json files entries, listed ahead of the generated ones."),
|
|
2872
|
-
engines: zod.z.record(nonEmptyStringSchema, nonEmptyStringSchema).optional().describe("package.json engines version ranges, keyed by engine name such as node."),
|
|
2873
|
-
lintStaged: zod.z.record(nonEmptyStringSchema, zod.z.array(nonEmptyStringSchema).min(1)).optional().describe("lint-staged commands to run, keyed by file glob."),
|
|
2874
|
-
browser: zod.z.record(nonEmptyStringSchema, zod.z.union([zod.z.boolean(), nonEmptyStringSchema])).optional().describe(
|
|
2875
|
-
"package.json browser field: a module or file is excluded (false) or replaced by another path."
|
|
2876
|
-
),
|
|
2877
|
-
allowCustomFetcher: zod.z.boolean().optional().describe("Whether callers can supply a custom fetch implementation."),
|
|
2878
|
-
useBrandedStringAliases: zod.z.boolean().optional().describe("Whether string aliases are emitted as distinct branded types."),
|
|
2879
|
-
useLegacyExports: zod.z.boolean().optional().describe("Whether the package emits the legacy export layout."),
|
|
2880
|
-
useBigInt: zod.z.boolean().optional().describe("Whether 64-bit integer values are represented with bigint."),
|
|
2881
|
-
serdeLayer: zod.z.boolean().optional().describe("Whether generated models use Fern serialization and deserialization helpers."),
|
|
2882
|
-
/** Ship only the ESM build (drops CJS) to avoid the Node dual-package hazard. */
|
|
2883
|
-
esmOnly: zod.z.boolean().optional().describe("Whether the package emits only ECMAScript modules."),
|
|
2884
|
-
scripts: zod.z.array(packageScriptSchema).optional().describe("Additional scripts added to the generated package manifest.")
|
|
2885
|
-
});
|
|
2886
|
-
|
|
2887
|
-
// src/sdk-config-domain/v1/language/mcp.ts
|
|
2888
|
-
var mcpAvailabilityStatuses = [
|
|
2889
|
-
"IN_DEVELOPMENT",
|
|
2890
|
-
"PRE_RELEASE",
|
|
2891
|
-
"GENERAL_AVAILABILITY",
|
|
2892
|
-
"DEPRECATED",
|
|
2893
|
-
"ALPHA",
|
|
2894
|
-
"BETA",
|
|
2895
|
-
"PREVIEW",
|
|
2896
|
-
"LEGACY"
|
|
2897
|
-
];
|
|
2898
|
-
var mcpToolFilterSchema = zod.z.strictObject({
|
|
2899
|
-
include: zod.z.array(nonEmptyStringSchema).optional().describe("Operations explicitly included as MCP tools."),
|
|
2900
|
-
exclude: zod.z.array(nonEmptyStringSchema).optional().describe("Operations explicitly excluded from MCP tools.")
|
|
2901
|
-
});
|
|
2902
|
-
var mcpToolsetNameSchema = nonEmptyStringSchema.refine(
|
|
2903
|
-
(name) => name !== "default" && /^[a-z0-9-]+$/.test(name),
|
|
2904
|
-
'toolset names must match [a-z0-9-]+ and cannot be "default"'
|
|
2905
|
-
);
|
|
2906
|
-
var mcpGenerationConfigSchema = typescriptGenerationConfigSchema.extend({
|
|
2907
|
-
serverName: nonEmptyStringSchema.optional().describe("The name advertised by the generated MCP server."),
|
|
2908
|
-
serverDescription: nonEmptyStringSchema.optional().describe("The description advertised by the generated MCP server."),
|
|
2909
|
-
excludeAvailability: zod.z.array(zod.z.enum(mcpAvailabilityStatuses)).optional().describe("Operation availability statuses excluded from MCP tool generation."),
|
|
2910
|
-
tools: mcpToolFilterSchema.optional().describe("Global operation filters for generated MCP tools."),
|
|
2911
|
-
toolsets: zod.z.record(mcpToolsetNameSchema, mcpToolFilterSchema).optional().describe("Named MCP toolsets and the operation filters for each toolset.")
|
|
2912
|
-
});
|
|
2913
2935
|
var phpGenerationConfigSchema = zod.z.strictObject({
|
|
2914
2936
|
propertyAccess: zod.z.enum(["public", "private"]).optional().describe("The visibility of generated PHP model properties."),
|
|
2915
2937
|
generateClientInterfaces: zod.z.boolean().optional().describe("Whether interfaces are generated for PHP client classes.")
|
|
@@ -4143,7 +4165,9 @@ function mapMcp(config, state, basePath) {
|
|
|
4143
4165
|
basePath
|
|
4144
4166
|
),
|
|
4145
4167
|
tools: takeToolFilter(config, ["tools"], state, basePath),
|
|
4146
|
-
toolsets: takeToolsets(config, ["toolsets"], state, basePath)
|
|
4168
|
+
toolsets: takeToolsets(config, ["toolsets"], state, basePath),
|
|
4169
|
+
mergedTools: takeMergedTools(config, ["mergedTools"], state, basePath),
|
|
4170
|
+
customTools: takeCustomTools(config, ["customTools"], state, basePath)
|
|
4147
4171
|
});
|
|
4148
4172
|
}
|
|
4149
4173
|
function mapReadme(value, language, activeLanguages, state, basePath) {
|
|
@@ -4497,6 +4521,79 @@ function takeToolsets(value, aliases, state, basePath) {
|
|
|
4497
4521
|
consume(state, located.path);
|
|
4498
4522
|
return Object.fromEntries(entries.filter((entry) => entry !== void 0));
|
|
4499
4523
|
}
|
|
4524
|
+
function takeCustomTools(value, aliases, state, basePath) {
|
|
4525
|
+
const located = takeObject(value, aliases, state, basePath);
|
|
4526
|
+
if (!located) return void 0;
|
|
4527
|
+
const entries = Object.entries(located.value).map(([name, spec]) => {
|
|
4528
|
+
if (!MCP_TOOL_NAME_PATTERN.test(name)) {
|
|
4529
|
+
fail(
|
|
4530
|
+
"FERN_MCP_CUSTOM_TOOL_NAME_INVALID",
|
|
4531
|
+
[...located.path, name],
|
|
4532
|
+
`MCP custom tool name "${name}" is not valid in SDK Config v1`,
|
|
4533
|
+
"Rename the custom tool to match [a-zA-Z0-9_-] and at most 64 characters.",
|
|
4534
|
+
["targets", basePath[2], "generation", "customTools", name]
|
|
4535
|
+
);
|
|
4536
|
+
}
|
|
4537
|
+
if (!isObject(spec) || typeof spec.path !== "string") {
|
|
4538
|
+
fail(
|
|
4539
|
+
"FERN_MCP_CUSTOM_TOOL_SPEC_INVALID",
|
|
4540
|
+
[...located.path, name],
|
|
4541
|
+
`MCP custom tool "${name}" must be an object with a string "path"`,
|
|
4542
|
+
'Give the custom tool a "path" pointing at the TypeScript module that exports its definition and handler.',
|
|
4543
|
+
["targets", basePath[2], "generation", "customTools", name]
|
|
4544
|
+
);
|
|
4545
|
+
}
|
|
4546
|
+
return [name, { path: spec.path }];
|
|
4547
|
+
});
|
|
4548
|
+
if (entries.some((entry) => !entry)) return void 0;
|
|
4549
|
+
consume(state, located.path);
|
|
4550
|
+
return Object.fromEntries(entries.filter((entry) => entry !== void 0));
|
|
4551
|
+
}
|
|
4552
|
+
function takeMergedTools(value, aliases, state, basePath) {
|
|
4553
|
+
const located = takeObject(value, aliases, state, basePath);
|
|
4554
|
+
if (!located) return void 0;
|
|
4555
|
+
const entries = Object.entries(located.value).map(([name, spec]) => {
|
|
4556
|
+
if (!MCP_TOOL_NAME_PATTERN.test(name)) {
|
|
4557
|
+
fail(
|
|
4558
|
+
"FERN_MCP_MERGED_TOOL_NAME_INVALID",
|
|
4559
|
+
[...located.path, name],
|
|
4560
|
+
`MCP merged tool name "${name}" is not valid in SDK Config v1`,
|
|
4561
|
+
"Rename the merged tool to match [a-zA-Z0-9_-] and at most 64 characters.",
|
|
4562
|
+
["targets", basePath[2], "generation", "mergedTools", name]
|
|
4563
|
+
);
|
|
4564
|
+
}
|
|
4565
|
+
if (!isObject(spec)) {
|
|
4566
|
+
fail(
|
|
4567
|
+
"FERN_MCP_MERGED_TOOL_SPEC_INVALID",
|
|
4568
|
+
[...located.path, name],
|
|
4569
|
+
`MCP merged tool "${name}" must be an object`,
|
|
4570
|
+
'Give the merged tool a "dispatchOn" argument and an include/exclude filter selecting its member operations.',
|
|
4571
|
+
["targets", basePath[2], "generation", "mergedTools", name]
|
|
4572
|
+
);
|
|
4573
|
+
}
|
|
4574
|
+
if (typeof spec.dispatchOn !== "string") {
|
|
4575
|
+
fail(
|
|
4576
|
+
"FERN_MCP_MERGED_TOOL_DISPATCH_ON_MISSING",
|
|
4577
|
+
[...located.path, name, "dispatchOn"],
|
|
4578
|
+
`MCP merged tool "${name}" is missing a string "dispatchOn"`,
|
|
4579
|
+
'Set "dispatchOn" to the tool argument whose value selects which member operation to call.',
|
|
4580
|
+
["targets", basePath[2], "generation", "mergedTools", name, "dispatchOn"]
|
|
4581
|
+
);
|
|
4582
|
+
}
|
|
4583
|
+
return [
|
|
4584
|
+
name,
|
|
4585
|
+
compact({
|
|
4586
|
+
dispatchOn: spec.dispatchOn,
|
|
4587
|
+
description: typeof spec.description === "string" ? spec.description : void 0,
|
|
4588
|
+
include: stringArrayValue(spec.include),
|
|
4589
|
+
exclude: stringArrayValue(spec.exclude)
|
|
4590
|
+
})
|
|
4591
|
+
];
|
|
4592
|
+
});
|
|
4593
|
+
if (entries.some((entry) => !entry)) return void 0;
|
|
4594
|
+
consume(state, located.path);
|
|
4595
|
+
return Object.fromEntries(entries.filter((entry) => entry !== void 0));
|
|
4596
|
+
}
|
|
4500
4597
|
var unsupportedFieldSchema = zod.z.strictObject({
|
|
4501
4598
|
source: zod.z.enum(["fern", "postman", "sdk-config-ir"]).describe("The configuration surface containing the unsupported field."),
|
|
4502
4599
|
path: zod.z.array(zod.z.union([nonEmptyStringSchema, zod.z.number().int().nonnegative()])).min(1).describe("The property path to the unsupported field in its source configuration."),
|
|
@@ -5163,6 +5260,7 @@ function parseSdkConfigIrV1ForConsumption(value) {
|
|
|
5163
5260
|
|
|
5164
5261
|
exports.CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE = CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE;
|
|
5165
5262
|
exports.FernConfigMappingError = FernConfigMappingError;
|
|
5263
|
+
exports.MCP_TOOL_NAME_PATTERN = MCP_TOOL_NAME_PATTERN;
|
|
5166
5264
|
exports.SDK_CONFIG_IR_V1_SCHEMA_VERSION = SDK_CONFIG_IR_V1_SCHEMA_VERSION;
|
|
5167
5265
|
exports.SDK_CONFIG_V1_CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE = CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE;
|
|
5168
5266
|
exports.SDK_CONFIG_V1_SCHEMA_VERSION = SDK_CONFIG_V1_SCHEMA_VERSION;
|