@postman/sdk-config 0.21.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.
Files changed (35) hide show
  1. package/dist/index.cjs +196 -253
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +1 -1
  4. package/dist/index.d.ts +1 -1
  5. package/dist/index.js +196 -254
  6. package/dist/index.js.map +1 -1
  7. package/dist/sdk-config/index.cjs +195 -253
  8. package/dist/sdk-config/index.cjs.map +1 -1
  9. package/dist/sdk-config/index.d.cts +1 -1
  10. package/dist/sdk-config/index.d.ts +1 -1
  11. package/dist/sdk-config/index.js +195 -253
  12. package/dist/sdk-config/index.js.map +1 -1
  13. package/dist/sdk-config/v1/index.cjs +195 -253
  14. package/dist/sdk-config/v1/index.cjs.map +1 -1
  15. package/dist/sdk-config/v1/index.d.cts +20 -767
  16. package/dist/sdk-config/v1/index.d.ts +20 -767
  17. package/dist/sdk-config/v1/index.js +195 -253
  18. package/dist/sdk-config/v1/index.js.map +1 -1
  19. package/dist/sdk-config-ir/index.cjs +26 -150
  20. package/dist/sdk-config-ir/index.cjs.map +1 -1
  21. package/dist/sdk-config-ir/index.d.cts +1 -1
  22. package/dist/sdk-config-ir/index.d.ts +1 -1
  23. package/dist/sdk-config-ir/index.js +26 -151
  24. package/dist/sdk-config-ir/index.js.map +1 -1
  25. package/dist/sdk-config-ir/v1/index.cjs +26 -150
  26. package/dist/sdk-config-ir/v1/index.cjs.map +1 -1
  27. package/dist/sdk-config-ir/v1/index.d.cts +29 -446
  28. package/dist/sdk-config-ir/v1/index.d.ts +29 -446
  29. package/dist/sdk-config-ir/v1/index.js +26 -151
  30. package/dist/sdk-config-ir/v1/index.js.map +1 -1
  31. package/dist/{typescript-DNic6Rq5.d.cts → typescript-ZRqfOhMd.d.cts} +23 -21
  32. package/dist/{typescript-DNic6Rq5.d.ts → typescript-ZRqfOhMd.d.ts} +23 -21
  33. package/package.json +1 -1
  34. package/src/sdk-config/v1/README.md +12 -24
  35. package/src/sdk-config-ir/v1/README.md +0 -39
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 {
@@ -967,28 +1082,6 @@ function fieldNameMapSchema(field) {
967
1082
  }
968
1083
  });
969
1084
  }
970
- var SAFE_TEXT_PATTERN = /^[^"\\\x00-\x1f]*$/;
971
- var HEX_COLOR_PATTERN = /^#[0-9a-fA-F]{6}$/;
972
- var provisionFlagSchema = zod.z.string().regex(KEBAB_NAME_PATTERN, {
973
- message: 'profiles.provisionOperation.flag must be a kebab-case flag name without dashes, such as "api-key"'
974
- });
975
- var provisionParametersSchema = zod.z.record(zod.z.string(), zod.z.string()).superRefine((value, context) => {
976
- for (const [key, text] of Object.entries(value)) {
977
- if (!FIELD_NAME_PATTERN.test(key)) {
978
- context.addIssue({
979
- code: "custom",
980
- message: "profiles.provisionOperation.parameters keys must be field names containing only [A-Za-z0-9_.-]",
981
- path: [key]
982
- });
983
- } else if (!SAFE_TEXT_PATTERN.test(text)) {
984
- context.addIssue({
985
- code: "custom",
986
- message: "profiles.provisionOperation.parameters values must not contain quotes, backslashes or control characters",
987
- path: [key]
988
- });
989
- }
990
- }
991
- });
992
1085
  var profilesProvisionOperationSchema = zod.z.strictObject({
993
1086
  operation: dottedCommandPathSchema("profiles.provisionOperation.operation").describe(
994
1087
  "The dotted command path of the operation that mints a profile credential."
@@ -996,16 +1089,7 @@ var profilesProvisionOperationSchema = zod.z.strictObject({
996
1089
  credential: fieldNameMapSchema("profiles.provisionOperation.credential").refine((value) => Object.keys(value).length > 0, {
997
1090
  message: "profiles.provisionOperation.credential must map at least one credential field"
998
1091
  }).describe("Maps each stored credential field to the response field that supplies it."),
999
- revokeParameters: fieldNameMapSchema("profiles.provisionOperation.revokeParameters").optional().describe("Maps each revoke-operation parameter to the response field that supplies it."),
1000
- flag: provisionFlagSchema.optional().describe(
1001
- 'The long name of the "profiles create" flag, without "--". The generator defaults it to "provision", which stays accepted as a hidden alias.'
1002
- ),
1003
- parameters: provisionParametersSchema.optional().describe(
1004
- "Extra request values sent with the operation. {cli}, {profile}, {user} and {host} are substituted; a value the profile sets wins."
1005
- ),
1006
- profileParameters: fieldNameMapSchema("profiles.provisionOperation.profileParameters").optional().describe(
1007
- "Maps each profile parameter to the typed credential field it is copied from, so requests keep it once the credential is replaced by the provisioned key."
1008
- )
1092
+ revokeParameters: fieldNameMapSchema("profiles.provisionOperation.revokeParameters").optional().describe("Maps each revoke-operation parameter to the response field that supplies it.")
1009
1093
  });
1010
1094
  var profilesConfigSchema = zod.z.strictObject({
1011
1095
  enabled: zod.z.boolean().describe("Whether the CLI emits profile commands and the global --profile flag."),
@@ -1013,24 +1097,6 @@ var profilesConfigSchema = zod.z.strictObject({
1013
1097
  revokeOperation: dottedCommandPathSchema("profiles.revokeOperation").optional().describe('The dotted command path called by "profiles remove --revoke".'),
1014
1098
  provisionOperation: profilesProvisionOperationSchema.optional().describe('The operation called by "profiles create --provision" and its response mapping.')
1015
1099
  });
1016
- var bannerColorsSchema = (field) => zod.z.array(
1017
- zod.z.string().regex(HEX_COLOR_PATTERN, {
1018
- message: `banner.${field} must hold 6-digit hex colours such as "#4949F2"`
1019
- })
1020
- );
1021
- var bannerObjectSchema = zod.z.strictObject({
1022
- text: nonEmptyStringSchema.describe("The banner text. May span several lines."),
1023
- colors: bannerColorsSchema("colors").optional().describe("One colour for a solid banner, or several for a gradient along the direction."),
1024
- lineColors: bannerColorsSchema("lineColors").optional().describe("One colour per line of the banner. Exclusive with colors."),
1025
- direction: zod.z.enum(["horizontal", "vertical", "diagonal"]).optional().describe("The direction of the gradient. The generator defaults to horizontal."),
1026
- animate: zod.z.boolean().optional().describe(
1027
- "Whether root --help on an interactive terminal plays a short shimmer across the banner before printing it."
1028
- )
1029
- }).refine((banner) => banner.colors === void 0 || banner.lineColors === void 0, {
1030
- message: "banner must set either colors (a gradient) or lineColors (one colour per line), not both",
1031
- path: ["lineColors"]
1032
- });
1033
- var bannerSchema = zod.z.union([nonEmptyStringSchema, bannerObjectSchema]);
1034
1100
  var oauthPropertyPathSchema = zod.z.string().regex(FIELD_NAME_PATTERN, {
1035
1101
  message: 'must be a property name, or a dotted path to a nested property, such as "data.token"'
1036
1102
  }).regex(/^[^.]+(\.[^.]+)*$/, { message: "must not have an empty path segment" });
@@ -1100,9 +1166,6 @@ var cliGenerationConfigSchema = zod.z.strictObject({
1100
1166
  profiles: profilesConfigSchema.optional().describe("Named profile command configuration."),
1101
1167
  splitTypeCrates: zod.z.boolean().optional().describe("Whether generated types are split into one crate per API behind a facade crate."),
1102
1168
  userAgentSuffixFlag: userAgentSuffixFlagSchema.optional().describe('The long flag name, without "--", that appends a product token to the User-Agent.'),
1103
- banner: bannerSchema.optional().describe(
1104
- "The banner printed above root --help: a string, or text with colours, a gradient direction, per-line colours and an animation switch."
1105
- ),
1106
1169
  oauthTokenEndpoints: zod.z.record(nonEmptyStringSchema, oauthTokenEndpointsSchema).optional().describe(
1107
1170
  "Per OAuth scheme id (api.auth.schemes[].id), the names of the properties of the token and refresh requests and responses, for the client credentials flow of an API whose token endpoint does not use the RFC 6749 names."
1108
1171
  )
@@ -1115,18 +1178,10 @@ var CLI_GENERATION_FIELDS = [
1115
1178
  "rootGroup",
1116
1179
  "profiles",
1117
1180
  "splitTypeCrates",
1118
- "userAgentSuffixFlag",
1119
- "banner"
1181
+ "userAgentSuffixFlag"
1120
1182
  ];
1121
1183
  var PROFILES_FIELDS = ["enabled", "commandName", "revokeOperation"];
1122
- var PROVISION_OPERATION_FIELDS = [
1123
- "operation",
1124
- "credential",
1125
- "revokeParameters",
1126
- "flag",
1127
- "parameters",
1128
- "profileParameters"
1129
- ];
1184
+ var PROVISION_OPERATION_FIELDS = ["operation", "credential", "revokeParameters"];
1130
1185
  function mapCliGeneration(config, state, basePath, targetIndex) {
1131
1186
  const generation = {};
1132
1187
  for (const field of CLI_GENERATION_FIELDS) {
@@ -2723,52 +2778,6 @@ var sdkConfigV1CliOutputConfigSchema = zod.z.discriminatedUnion(
2723
2778
  var sdkConfigV1ReplayConfigSchema = zod.z.strictObject({
2724
2779
  enabled: zod.z.boolean().describe("Whether regeneration reapplies customer-authored repository changes.")
2725
2780
  });
2726
- var errorResponsesHttpMethodSchema = zod.z.enum([
2727
- "get",
2728
- "post",
2729
- "put",
2730
- "patch",
2731
- "delete",
2732
- "head",
2733
- "options",
2734
- "trace"
2735
- ]);
2736
- var errorResponsesEnsureSchema = zod.z.strictObject({
2737
- statusCode: zod.z.number().int().min(400).max(599).describe("The 4xx or 5xx status code added to an operation that does not declare it."),
2738
- methods: zod.z.array(errorResponsesHttpMethodSchema).optional().describe("The HTTP methods whose operations receive the response. Defaults to all methods.")
2739
- });
2740
- var errorResponsesSchema = zod.z.strictObject({
2741
- schema: zod.z.record(zod.z.string(), zod.z.unknown()).describe(
2742
- "The OpenAPI schema of error response bodies, inline. The client resolves a schema file to its content before the config reaches the generator. Any $ref inside must be a local #/components/... pointer into the spec it is applied to."
2743
- ),
2744
- name: nonEmptyStringSchema.optional().describe(
2745
- "The name of the generated error body type. Defaults to the schema title, then ProblemDetails."
2746
- ),
2747
- applyTo: zod.z.enum(["all", "untyped"]).optional().describe(
2748
- "all replaces the body of every 4xx/5xx response with the schema. untyped only fills in 4xx/5xx responses that declare no body schema. Defaults to all."
2749
- ),
2750
- ensure: zod.z.array(errorResponsesEnsureSchema).optional().describe("Error responses added to operations that do not already declare them.")
2751
- });
2752
- var exampleDepthSchema = zod.z.strictObject({
2753
- maxDepth: zod.z.number().int().min(0).optional().describe("How many levels of optional properties an example includes. 0 leaves them out.")
2754
- });
2755
- var exampleGenerationSchema = zod.z.strictObject({
2756
- request: exampleDepthSchema.optional().describe("Depth of generated request examples."),
2757
- response: exampleDepthSchema.optional().describe("Depth of generated response examples.")
2758
- });
2759
- var resolveAliasesSchema = zod.z.union([
2760
- zod.z.boolean(),
2761
- zod.z.strictObject({
2762
- except: zod.z.array(nonEmptyStringSchema).optional().describe("Component schema names whose aliases are kept.")
2763
- })
2764
- ]);
2765
- var endpointFilterSchema = zod.z.strictObject({
2766
- endpoints: zod.z.array(
2767
- nonEmptyStringSchema.describe(
2768
- 'An endpoint to keep, as "METHOD /path/template". An entry in another shape is ignored.'
2769
- )
2770
- ).describe("The only endpoints imported. Every other operation is dropped before conversion.")
2771
- });
2772
2781
  var apiImportSettingsSchema = zod.z.strictObject({
2773
2782
  respectNullableSchemas: zod.z.boolean().optional().describe("Whether nullable schemas remain nullable in generated types."),
2774
2783
  titleAsSchemaName: zod.z.boolean().optional().describe("Whether a schema title can determine the generated type name."),
@@ -2797,56 +2806,7 @@ var apiImportSettingsSchema = zod.z.strictObject({
2797
2806
  resolveSchemaCollisions: zod.z.boolean().optional().describe("Whether colliding imported schema names are resolved automatically."),
2798
2807
  asyncApiMessageNaming: zod.z.enum(["v1", "v2"]).optional().describe("The naming strategy used for messages imported from AsyncAPI."),
2799
2808
  defaultIntegerFormat: zod.z.enum(["int32", "int64", "uint32", "uint64"]).optional().describe("The integer format used when a schema does not declare one."),
2800
- respectByteFormat: zod.z.boolean().optional().describe("Whether string schemas with format byte are imported as base64-encoded bytes."),
2801
- additionalPropertiesDefaultsTo: zod.z.boolean().optional().describe(
2802
- "Whether an object schema that does not declare additionalProperties admits any extra property."
2803
- ),
2804
- optionalAdditionalProperties: zod.z.boolean().optional().describe("Whether the values of a nullable map are also nullable."),
2805
- anyOfSiblingPropertiesAsObject: zod.z.boolean().optional().describe(
2806
- "Whether an anyOf that only constrains which sibling properties are present imports as the object it sits beside."
2807
- ),
2808
- preserveSingleSchemaOneOf: zod.z.boolean().optional().describe(
2809
- "Whether a oneOf with a single member stays a union instead of collapsing to that member."
2810
- ),
2811
- preserveOneOfInAllOf: zod.z.boolean().optional().describe(
2812
- "Whether a oneOf inside an allOf stays a union of the merged variants instead of being flattened."
2813
- ),
2814
- removeDiscriminantsFromSchemas: zod.z.enum(["always", "never"]).optional().describe(
2815
- "Whether the discriminator property is removed from the schemas of a discriminated union."
2816
- ),
2817
- coerceConstsTo: zod.z.enum(["literals", "enums", "enums-coerceable-to-literals"]).optional().describe(
2818
- "What a const imports as: a literal, a single-value enum, or an enum that coerceEnumsToLiterals can turn into a literal."
2819
- ),
2820
- resolveAliases: resolveAliasesSchema.optional().describe(
2821
- "Whether references to alias-like schemas are replaced by the schema they alias, optionally keeping the named exceptions."
2822
- ),
2823
- respectForwardCompatibleEnums: zod.z.boolean().optional().describe(
2824
- "Whether a query or header parameter that accepts an enum or any string keeps both options."
2825
- ),
2826
- inferForwardCompatible: zod.z.boolean().optional().describe(
2827
- "Whether a oneOf or anyOf of an enum and a plain string imports as a forward-compatible enum."
2828
- ),
2829
- respectOperationIdWordBoundaries: zod.z.boolean().optional().describe(
2830
- "Whether operation ids are split at every word boundary when method names are derived."
2831
- ),
2832
- namespacedErrors: zod.z.boolean().optional().describe("Whether an error response takes the x-fern-sdk-namespace it declares."),
2833
- defaultFormParameterEncoding: zod.z.enum(["form", "json"]).optional().describe("How multipart form properties without an explicit content type are encoded."),
2834
- respectParameterContent: zod.z.boolean().optional().describe(
2835
- "Whether a header declared with a JSON content entry instead of a schema is typed by that content."
2836
- ),
2837
- useBytesForBinaryResponse: zod.z.boolean().optional().describe("Whether a binary response is returned as bytes instead of a file stream."),
2838
- useReadVariantForResponses: zod.z.boolean().optional().describe(
2839
- "Whether responses use the read variant of a schema that has read-only properties. Needs respectReadonlySchemas."
2840
- ),
2841
- exampleGeneration: exampleGenerationSchema.optional().describe("How deep the examples generated for operations without one go."),
2842
- filter: endpointFilterSchema.optional().describe("Restricts the import to a list of endpoints."),
2843
- groupEnvironmentsByHost: zod.z.boolean().optional().describe("Whether HTTP and WebSocket servers with the same host become one environment."),
2844
- multiServerStrategy: zod.z.enum(["environment-per-server", "urls-per-environment"]).optional().describe(
2845
- "Whether each named server is its own environment or a named URL of one environment."
2846
- ),
2847
- inferDefaultEnvironment: zod.z.boolean().optional().describe("Whether the first server becomes the default environment."),
2848
- respectPerSpecBasePath: zod.z.boolean().optional().describe("Whether each spec's plain x-fern-base-path applies to that spec's endpoints."),
2849
- errorResponses: errorResponsesSchema.optional().describe("A shared error body schema applied to the 4xx/5xx responses of the specs.")
2809
+ respectByteFormat: zod.z.boolean().optional().describe("Whether string schemas with format byte are imported as base64-encoded bytes.")
2850
2810
  });
2851
2811
  var sourceSpecTypeSchema = zod.z.enum([
2852
2812
  "openapi",
@@ -2972,99 +2932,6 @@ var javaGenerationConfigSchema = jvmGenerationConfigSchema.extend({
2972
2932
 
2973
2933
  // src/sdk-config-domain/v1/language/kotlin.ts
2974
2934
  var kotlinGenerationConfigSchema = jvmGenerationConfigSchema;
2975
- var compilerOptionsSchema = zod.z.strictObject({
2976
- target: nonEmptyStringSchema.optional().describe("The JavaScript language target passed to TypeScript."),
2977
- module: nonEmptyStringSchema.optional().describe("The module format passed to TypeScript."),
2978
- lib: zod.z.array(nonEmptyStringSchema).optional().describe("The runtime library definitions passed to TypeScript.")
2979
- });
2980
- var packageScriptSchema = zod.z.strictObject({
2981
- name: nonEmptyStringSchema.describe("The package script name."),
2982
- command: nonEmptyStringSchema.describe("The command executed by the package script.")
2983
- });
2984
- var httpClientSchema = zod.z.strictObject({
2985
- name: zod.z.enum(["axios", "fetch", "node-fetch"]).describe("The HTTP client used by generated TypeScript code.")
2986
- });
2987
- var typescriptGenerationConfigSchema = zod.z.strictObject({
2988
- typescriptVersion: nonEmptyStringSchema.optional().describe("The TypeScript version used by the generated project."),
2989
- zodVersion: nonEmptyStringSchema.optional().describe("The Zod version used by generated runtime schemas."),
2990
- compilerOptions: compilerOptionsSchema.optional().describe("TypeScript compiler options for the generated project."),
2991
- httpClient: httpClientSchema.optional().describe("The HTTP client used by generated TypeScript code."),
2992
- packageManager: zod.z.enum(["pnpm", "yarn"]).optional().describe("The package manager used by the generated project."),
2993
- packageManagerVersion: nonEmptyStringSchema.optional().describe("The package manager version used by the generated project."),
2994
- testFramework: zod.z.enum(["jest", "vitest"]).optional().describe("The test framework used by generated tests."),
2995
- namingStrategy: zod.z.enum(["base", "originalPropertyNames"]).optional().describe("How schema property names are converted into TypeScript identifiers."),
2996
- bundle: zod.z.boolean().optional().describe("Whether the generated package includes bundled output."),
2997
- exportClassDefault: zod.z.boolean().optional().describe("Whether the client class is also exported as the default export."),
2998
- /** Name of the top-level namespace export emitted by Fern-compatible TypeScript SDKs. */
2999
- namespaceExportName: nonEmptyStringSchema.optional().describe("The top-level namespace export name."),
3000
- consolidateTypeFiles: zod.z.boolean().optional().describe("Whether generated types are consolidated into fewer source files."),
3001
- formDataSupport: zod.z.enum(["Node16", "Node18"]).optional().describe(
3002
- "The multipart form-data implementation: Node16 uses the form-data packages, Node18 uses the platform FormData."
3003
- ),
3004
- allowExtraFields: zod.z.boolean().optional().describe(
3005
- "Whether response parsing keeps unrecognized object keys and accepts unrecognized union members and enum values."
3006
- ),
3007
- generateSubpackageExports: zod.z.boolean().optional().describe(
3008
- "Whether the package manifest exports each subpackage client as its own entry point."
3009
- ),
3010
- exportAllRequestsAtRoot: zod.z.boolean().optional().describe("Whether every request type is also exported from the package root."),
3011
- generateEndpointMetadata: zod.z.boolean().optional().describe("Whether generated clients expose metadata for each endpoint."),
3012
- outputEsm: zod.z.boolean().optional().describe(
3013
- "Whether the package is marked as an ES module while still shipping its CommonJS build."
3014
- ),
3015
- neverThrowErrors: zod.z.boolean().optional().describe(
3016
- "Whether client methods return a wrapped response instead of throwing on a non-2xx status."
3017
- ),
3018
- includeOtherInUnionTypes: zod.z.boolean().optional().describe("Whether union types gain a member for variants the SDK does not recognize."),
3019
- includeUtilsOnUnionMembers: zod.z.boolean().optional().describe("Whether helper utilities are generated on each member of a union type."),
3020
- omitFernHeaders: zod.z.boolean().optional().describe("Whether requests omit the SDK identification headers and the User-Agent header."),
3021
- linter: zod.z.enum(["biome", "oxlint", "none"]).optional().describe("The linter configured in the generated project."),
3022
- formatter: zod.z.enum(["prettier", "biome", "oxfmt", "none"]).optional().describe("The formatter configured in the generated project."),
3023
- exports: jsonObjectSchema.optional().describe(
3024
- "package.json exports entries, keyed by subpath, applied over the generated exports. Each subpath replaces the generated one."
3025
- ),
3026
- files: zod.z.array(nonEmptyStringSchema).optional().describe("package.json files entries, listed ahead of the generated ones."),
3027
- engines: zod.z.record(nonEmptyStringSchema, nonEmptyStringSchema).optional().describe("package.json engines version ranges, keyed by engine name such as node."),
3028
- lintStaged: zod.z.record(nonEmptyStringSchema, zod.z.array(nonEmptyStringSchema).min(1)).optional().describe("lint-staged commands to run, keyed by file glob."),
3029
- browser: zod.z.record(nonEmptyStringSchema, zod.z.union([zod.z.boolean(), nonEmptyStringSchema])).optional().describe(
3030
- "package.json browser field: a module or file is excluded (false) or replaced by another path."
3031
- ),
3032
- allowCustomFetcher: zod.z.boolean().optional().describe("Whether callers can supply a custom fetch implementation."),
3033
- useBrandedStringAliases: zod.z.boolean().optional().describe("Whether string aliases are emitted as distinct branded types."),
3034
- useLegacyExports: zod.z.boolean().optional().describe("Whether the package emits the legacy export layout."),
3035
- useBigInt: zod.z.boolean().optional().describe("Whether 64-bit integer values are represented with bigint."),
3036
- serdeLayer: zod.z.boolean().optional().describe("Whether generated models use Fern serialization and deserialization helpers."),
3037
- /** Ship only the ESM build (drops CJS) to avoid the Node dual-package hazard. */
3038
- esmOnly: zod.z.boolean().optional().describe("Whether the package emits only ECMAScript modules."),
3039
- scripts: zod.z.array(packageScriptSchema).optional().describe("Additional scripts added to the generated package manifest.")
3040
- });
3041
-
3042
- // src/sdk-config-domain/v1/language/mcp.ts
3043
- var mcpAvailabilityStatuses = [
3044
- "IN_DEVELOPMENT",
3045
- "PRE_RELEASE",
3046
- "GENERAL_AVAILABILITY",
3047
- "DEPRECATED",
3048
- "ALPHA",
3049
- "BETA",
3050
- "PREVIEW",
3051
- "LEGACY"
3052
- ];
3053
- var mcpToolFilterSchema = zod.z.strictObject({
3054
- include: zod.z.array(nonEmptyStringSchema).optional().describe("Operations explicitly included as MCP tools."),
3055
- exclude: zod.z.array(nonEmptyStringSchema).optional().describe("Operations explicitly excluded from MCP tools.")
3056
- });
3057
- var mcpToolsetNameSchema = nonEmptyStringSchema.refine(
3058
- (name) => name !== "default" && /^[a-z0-9-]+$/.test(name),
3059
- 'toolset names must match [a-z0-9-]+ and cannot be "default"'
3060
- );
3061
- var mcpGenerationConfigSchema = typescriptGenerationConfigSchema.extend({
3062
- serverName: nonEmptyStringSchema.optional().describe("The name advertised by the generated MCP server."),
3063
- serverDescription: nonEmptyStringSchema.optional().describe("The description advertised by the generated MCP server."),
3064
- excludeAvailability: zod.z.array(zod.z.enum(mcpAvailabilityStatuses)).optional().describe("Operation availability statuses excluded from MCP tool generation."),
3065
- tools: mcpToolFilterSchema.optional().describe("Global operation filters for generated MCP tools."),
3066
- toolsets: zod.z.record(mcpToolsetNameSchema, mcpToolFilterSchema).optional().describe("Named MCP toolsets and the operation filters for each toolset.")
3067
- });
3068
2935
  var phpGenerationConfigSchema = zod.z.strictObject({
3069
2936
  propertyAccess: zod.z.enum(["public", "private"]).optional().describe("The visibility of generated PHP model properties."),
3070
2937
  generateClientInterfaces: zod.z.boolean().optional().describe("Whether interfaces are generated for PHP client classes.")
@@ -4298,7 +4165,9 @@ function mapMcp(config, state, basePath) {
4298
4165
  basePath
4299
4166
  ),
4300
4167
  tools: takeToolFilter(config, ["tools"], state, basePath),
4301
- 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)
4302
4171
  });
4303
4172
  }
4304
4173
  function mapReadme(value, language, activeLanguages, state, basePath) {
@@ -4652,6 +4521,79 @@ function takeToolsets(value, aliases, state, basePath) {
4652
4521
  consume(state, located.path);
4653
4522
  return Object.fromEntries(entries.filter((entry) => entry !== void 0));
4654
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
+ }
4655
4597
  var unsupportedFieldSchema = zod.z.strictObject({
4656
4598
  source: zod.z.enum(["fern", "postman", "sdk-config-ir"]).describe("The configuration surface containing the unsupported field."),
4657
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."),
@@ -5318,6 +5260,7 @@ function parseSdkConfigIrV1ForConsumption(value) {
5318
5260
 
5319
5261
  exports.CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE = CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE;
5320
5262
  exports.FernConfigMappingError = FernConfigMappingError;
5263
+ exports.MCP_TOOL_NAME_PATTERN = MCP_TOOL_NAME_PATTERN;
5321
5264
  exports.SDK_CONFIG_IR_V1_SCHEMA_VERSION = SDK_CONFIG_IR_V1_SCHEMA_VERSION;
5322
5265
  exports.SDK_CONFIG_V1_CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE = CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE;
5323
5266
  exports.SDK_CONFIG_V1_SCHEMA_VERSION = SDK_CONFIG_V1_SCHEMA_VERSION;