@postman/sdk-config 0.23.0 → 0.25.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 (34) hide show
  1. package/dist/index.cjs +85 -2
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +2 -2
  4. package/dist/index.d.ts +2 -2
  5. package/dist/index.js +85 -3
  6. package/dist/index.js.map +1 -1
  7. package/dist/sdk-config/index.cjs +67 -1
  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 +67 -1
  12. package/dist/sdk-config/index.js.map +1 -1
  13. package/dist/sdk-config/v1/index.cjs +67 -1
  14. package/dist/sdk-config/v1/index.cjs.map +1 -1
  15. package/dist/sdk-config/v1/index.d.cts +16 -2
  16. package/dist/sdk-config/v1/index.d.ts +16 -2
  17. package/dist/sdk-config/v1/index.js +67 -1
  18. package/dist/sdk-config/v1/index.js.map +1 -1
  19. package/dist/sdk-config-ir/index.cjs +63 -1
  20. package/dist/sdk-config-ir/index.cjs.map +1 -1
  21. package/dist/sdk-config-ir/index.d.cts +2 -2
  22. package/dist/sdk-config-ir/index.d.ts +2 -2
  23. package/dist/sdk-config-ir/index.js +63 -2
  24. package/dist/sdk-config-ir/index.js.map +1 -1
  25. package/dist/sdk-config-ir/v1/index.cjs +63 -1
  26. package/dist/sdk-config-ir/v1/index.cjs.map +1 -1
  27. package/dist/sdk-config-ir/v1/index.d.cts +39 -3
  28. package/dist/sdk-config-ir/v1/index.d.ts +39 -3
  29. package/dist/sdk-config-ir/v1/index.js +63 -2
  30. package/dist/sdk-config-ir/v1/index.js.map +1 -1
  31. package/dist/{typescript-ZRqfOhMd.d.cts → typescript-BIq_eF34.d.cts} +10 -1
  32. package/dist/{typescript-ZRqfOhMd.d.ts → typescript-BIq_eF34.d.ts} +10 -1
  33. package/package.json +1 -1
  34. package/src/sdk-config/v1/README.md +31 -0
@@ -1,5 +1,5 @@
1
- import { j as JsonObject, S as SdkConfigDiagnostic } from '../../typescript-ZRqfOhMd.cjs';
2
- export { C as SDK_CONFIG_V1_CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE, a as SdkConfigV1CliDistributionConfig, b as SdkConfigV1CliDistributionGithubAppConfig, c as SdkConfigV1CliDistributionHomebrewConfig, d as SdkConfigV1CliDistributionScoopConfig, w as sdkConfigV1CliDistributionConfigSchema, x as sdkConfigV1CliDistributionGithubAppSchema, y as sdkConfigV1CliDistributionHomebrewSchema, z as sdkConfigV1CliDistributionScoopSchema, A as sdkConfigV1CliGenerationConfigSchema, B as sdkConfigV1ComposerPackageNameSchema, E as sdkConfigV1CsharpGenerationConfigSchema, H as sdkConfigV1ExactSemverSchema, I as sdkConfigV1GithubActionsSecretNameSchema, L as sdkConfigV1GoGenerationConfigSchema, N as sdkConfigV1GoModulePathSchema, O as sdkConfigV1JavaGenerationConfigSchema, V as sdkConfigV1KotlinGenerationConfigSchema, X as sdkConfigV1McpGenerationConfigSchema, Y as sdkConfigV1NonEmptyStringSchema, $ as sdkConfigV1ParentRelativePathSchema, a0 as sdkConfigV1PhpGenerationConfigSchema, a1 as sdkConfigV1PythonGenerationConfigSchema, a2 as sdkConfigV1RelativePathSchema, a3 as sdkConfigV1RubyGenerationConfigSchema, a4 as sdkConfigV1RustGenerationConfigSchema, a5 as sdkConfigV1SwiftGenerationConfigSchema, a6 as sdkConfigV1TerraformGenerationConfigSchema, a7 as sdkConfigV1TypescriptGenerationConfigSchema } from '../../typescript-ZRqfOhMd.cjs';
1
+ import { j as JsonObject, S as SdkConfigDiagnostic } from '../../typescript-BIq_eF34.cjs';
2
+ export { C as SDK_CONFIG_V1_CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE, a as SdkConfigV1CliDistributionConfig, b as SdkConfigV1CliDistributionGithubAppConfig, c as SdkConfigV1CliDistributionHomebrewConfig, d as SdkConfigV1CliDistributionScoopConfig, x as sdkConfigV1CliDistributionConfigSchema, y as sdkConfigV1CliDistributionGithubAppSchema, z as sdkConfigV1CliDistributionHomebrewSchema, A as sdkConfigV1CliDistributionScoopSchema, B as sdkConfigV1CliGenerationConfigSchema, E as sdkConfigV1ComposerPackageNameSchema, F as sdkConfigV1CsharpGenerationConfigSchema, I as sdkConfigV1ExactSemverSchema, L as sdkConfigV1GithubActionsSecretNameSchema, N as sdkConfigV1GoGenerationConfigSchema, O as sdkConfigV1GoModulePathSchema, Q as sdkConfigV1JavaGenerationConfigSchema, W as sdkConfigV1KotlinGenerationConfigSchema, Y as sdkConfigV1McpGenerationConfigSchema, Z as sdkConfigV1NonEmptyStringSchema, a0 as sdkConfigV1ParentRelativePathSchema, a1 as sdkConfigV1PhpGenerationConfigSchema, a2 as sdkConfigV1PythonGenerationConfigSchema, a3 as sdkConfigV1RelativePathSchema, a4 as sdkConfigV1RubyGenerationConfigSchema, a5 as sdkConfigV1RustGenerationConfigSchema, a6 as sdkConfigV1SwiftGenerationConfigSchema, a7 as sdkConfigV1TerraformGenerationConfigSchema, a8 as sdkConfigV1TypescriptGenerationConfigSchema } from '../../typescript-BIq_eF34.cjs';
3
3
  import { z } from 'zod';
4
4
 
5
5
  declare const sdkConfigV1AuthSchemeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -60,6 +60,7 @@ declare const sdkConfigV1AuthSchemeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
60
60
  }, z.core.$strict>, z.ZodObject<{
61
61
  type: z.ZodLiteral<"client-credentials">;
62
62
  tokenUrl: z.ZodString;
63
+ environmentTokenUrls: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
63
64
  refreshUrl: z.ZodOptional<z.ZodString>;
64
65
  scopes: z.ZodOptional<z.ZodArray<z.ZodObject<{
65
66
  name: z.ZodString;
@@ -186,6 +187,7 @@ declare const sdkConfigV1AuthConfigSchema: z.ZodObject<{
186
187
  }, z.core.$strict>, z.ZodObject<{
187
188
  type: z.ZodLiteral<"client-credentials">;
188
189
  tokenUrl: z.ZodString;
190
+ environmentTokenUrls: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
189
191
  refreshUrl: z.ZodOptional<z.ZodString>;
190
192
  scopes: z.ZodOptional<z.ZodArray<z.ZodObject<{
191
193
  name: z.ZodString;
@@ -334,6 +336,7 @@ declare const sdkConfigV1ApiConfigSchema: z.ZodObject<{
334
336
  }, z.core.$strict>, z.ZodObject<{
335
337
  type: z.ZodLiteral<"client-credentials">;
336
338
  tokenUrl: z.ZodString;
339
+ environmentTokenUrls: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
337
340
  refreshUrl: z.ZodOptional<z.ZodString>;
338
341
  scopes: z.ZodOptional<z.ZodArray<z.ZodObject<{
339
342
  name: z.ZodString;
@@ -930,6 +933,7 @@ declare const sdkConfigV1Schema: z.ZodObject<{
930
933
  }, z.core.$strict>, z.ZodObject<{
931
934
  type: z.ZodLiteral<"client-credentials">;
932
935
  tokenUrl: z.ZodString;
936
+ environmentTokenUrls: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
933
937
  refreshUrl: z.ZodOptional<z.ZodString>;
934
938
  scopes: z.ZodOptional<z.ZodArray<z.ZodObject<{
935
939
  name: z.ZodString;
@@ -10796,6 +10800,8 @@ declare const sdkConfigV1Schema: z.ZodObject<{
10796
10800
  }, z.core.$strict>>>;
10797
10801
  serverName: z.ZodOptional<z.ZodString>;
10798
10802
  serverDescription: z.ZodOptional<z.ZodString>;
10803
+ instructions: z.ZodOptional<z.ZodString>;
10804
+ appendInstructions: z.ZodOptional<z.ZodString>;
10799
10805
  excludeAvailability: z.ZodOptional<z.ZodArray<z.ZodEnum<{
10800
10806
  IN_DEVELOPMENT: "IN_DEVELOPMENT";
10801
10807
  PRE_RELEASE: "PRE_RELEASE";
@@ -10823,6 +10829,9 @@ declare const sdkConfigV1Schema: z.ZodObject<{
10823
10829
  customTools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
10824
10830
  path: z.ZodString;
10825
10831
  }, z.core.$strict>>>;
10832
+ hooks: z.ZodOptional<z.ZodObject<{
10833
+ path: z.ZodString;
10834
+ }, z.core.$strict>>;
10826
10835
  }, z.core.$strict>>;
10827
10836
  }, z.core.$strict>, z.ZodObject<{
10828
10837
  generatorVersion: z.ZodOptional<z.ZodString>;
@@ -22749,6 +22758,8 @@ declare const sdkConfigV1TargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
22749
22758
  }, z.core.$strict>>>;
22750
22759
  serverName: z.ZodOptional<z.ZodString>;
22751
22760
  serverDescription: z.ZodOptional<z.ZodString>;
22761
+ instructions: z.ZodOptional<z.ZodString>;
22762
+ appendInstructions: z.ZodOptional<z.ZodString>;
22752
22763
  excludeAvailability: z.ZodOptional<z.ZodArray<z.ZodEnum<{
22753
22764
  IN_DEVELOPMENT: "IN_DEVELOPMENT";
22754
22765
  PRE_RELEASE: "PRE_RELEASE";
@@ -22776,6 +22787,9 @@ declare const sdkConfigV1TargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
22776
22787
  customTools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
22777
22788
  path: z.ZodString;
22778
22789
  }, z.core.$strict>>>;
22790
+ hooks: z.ZodOptional<z.ZodObject<{
22791
+ path: z.ZodString;
22792
+ }, z.core.$strict>>;
22779
22793
  }, z.core.$strict>>;
22780
22794
  }, z.core.$strict>, z.ZodObject<{
22781
22795
  generatorVersion: z.ZodOptional<z.ZodString>;
@@ -1,5 +1,5 @@
1
- import { j as JsonObject, S as SdkConfigDiagnostic } from '../../typescript-ZRqfOhMd.js';
2
- export { C as SDK_CONFIG_V1_CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE, a as SdkConfigV1CliDistributionConfig, b as SdkConfigV1CliDistributionGithubAppConfig, c as SdkConfigV1CliDistributionHomebrewConfig, d as SdkConfigV1CliDistributionScoopConfig, w as sdkConfigV1CliDistributionConfigSchema, x as sdkConfigV1CliDistributionGithubAppSchema, y as sdkConfigV1CliDistributionHomebrewSchema, z as sdkConfigV1CliDistributionScoopSchema, A as sdkConfigV1CliGenerationConfigSchema, B as sdkConfigV1ComposerPackageNameSchema, E as sdkConfigV1CsharpGenerationConfigSchema, H as sdkConfigV1ExactSemverSchema, I as sdkConfigV1GithubActionsSecretNameSchema, L as sdkConfigV1GoGenerationConfigSchema, N as sdkConfigV1GoModulePathSchema, O as sdkConfigV1JavaGenerationConfigSchema, V as sdkConfigV1KotlinGenerationConfigSchema, X as sdkConfigV1McpGenerationConfigSchema, Y as sdkConfigV1NonEmptyStringSchema, $ as sdkConfigV1ParentRelativePathSchema, a0 as sdkConfigV1PhpGenerationConfigSchema, a1 as sdkConfigV1PythonGenerationConfigSchema, a2 as sdkConfigV1RelativePathSchema, a3 as sdkConfigV1RubyGenerationConfigSchema, a4 as sdkConfigV1RustGenerationConfigSchema, a5 as sdkConfigV1SwiftGenerationConfigSchema, a6 as sdkConfigV1TerraformGenerationConfigSchema, a7 as sdkConfigV1TypescriptGenerationConfigSchema } from '../../typescript-ZRqfOhMd.js';
1
+ import { j as JsonObject, S as SdkConfigDiagnostic } from '../../typescript-BIq_eF34.js';
2
+ export { C as SDK_CONFIG_V1_CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE, a as SdkConfigV1CliDistributionConfig, b as SdkConfigV1CliDistributionGithubAppConfig, c as SdkConfigV1CliDistributionHomebrewConfig, d as SdkConfigV1CliDistributionScoopConfig, x as sdkConfigV1CliDistributionConfigSchema, y as sdkConfigV1CliDistributionGithubAppSchema, z as sdkConfigV1CliDistributionHomebrewSchema, A as sdkConfigV1CliDistributionScoopSchema, B as sdkConfigV1CliGenerationConfigSchema, E as sdkConfigV1ComposerPackageNameSchema, F as sdkConfigV1CsharpGenerationConfigSchema, I as sdkConfigV1ExactSemverSchema, L as sdkConfigV1GithubActionsSecretNameSchema, N as sdkConfigV1GoGenerationConfigSchema, O as sdkConfigV1GoModulePathSchema, Q as sdkConfigV1JavaGenerationConfigSchema, W as sdkConfigV1KotlinGenerationConfigSchema, Y as sdkConfigV1McpGenerationConfigSchema, Z as sdkConfigV1NonEmptyStringSchema, a0 as sdkConfigV1ParentRelativePathSchema, a1 as sdkConfigV1PhpGenerationConfigSchema, a2 as sdkConfigV1PythonGenerationConfigSchema, a3 as sdkConfigV1RelativePathSchema, a4 as sdkConfigV1RubyGenerationConfigSchema, a5 as sdkConfigV1RustGenerationConfigSchema, a6 as sdkConfigV1SwiftGenerationConfigSchema, a7 as sdkConfigV1TerraformGenerationConfigSchema, a8 as sdkConfigV1TypescriptGenerationConfigSchema } from '../../typescript-BIq_eF34.js';
3
3
  import { z } from 'zod';
4
4
 
5
5
  declare const sdkConfigV1AuthSchemeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -60,6 +60,7 @@ declare const sdkConfigV1AuthSchemeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
60
60
  }, z.core.$strict>, z.ZodObject<{
61
61
  type: z.ZodLiteral<"client-credentials">;
62
62
  tokenUrl: z.ZodString;
63
+ environmentTokenUrls: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
63
64
  refreshUrl: z.ZodOptional<z.ZodString>;
64
65
  scopes: z.ZodOptional<z.ZodArray<z.ZodObject<{
65
66
  name: z.ZodString;
@@ -186,6 +187,7 @@ declare const sdkConfigV1AuthConfigSchema: z.ZodObject<{
186
187
  }, z.core.$strict>, z.ZodObject<{
187
188
  type: z.ZodLiteral<"client-credentials">;
188
189
  tokenUrl: z.ZodString;
190
+ environmentTokenUrls: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
189
191
  refreshUrl: z.ZodOptional<z.ZodString>;
190
192
  scopes: z.ZodOptional<z.ZodArray<z.ZodObject<{
191
193
  name: z.ZodString;
@@ -334,6 +336,7 @@ declare const sdkConfigV1ApiConfigSchema: z.ZodObject<{
334
336
  }, z.core.$strict>, z.ZodObject<{
335
337
  type: z.ZodLiteral<"client-credentials">;
336
338
  tokenUrl: z.ZodString;
339
+ environmentTokenUrls: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
337
340
  refreshUrl: z.ZodOptional<z.ZodString>;
338
341
  scopes: z.ZodOptional<z.ZodArray<z.ZodObject<{
339
342
  name: z.ZodString;
@@ -930,6 +933,7 @@ declare const sdkConfigV1Schema: z.ZodObject<{
930
933
  }, z.core.$strict>, z.ZodObject<{
931
934
  type: z.ZodLiteral<"client-credentials">;
932
935
  tokenUrl: z.ZodString;
936
+ environmentTokenUrls: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
933
937
  refreshUrl: z.ZodOptional<z.ZodString>;
934
938
  scopes: z.ZodOptional<z.ZodArray<z.ZodObject<{
935
939
  name: z.ZodString;
@@ -10796,6 +10800,8 @@ declare const sdkConfigV1Schema: z.ZodObject<{
10796
10800
  }, z.core.$strict>>>;
10797
10801
  serverName: z.ZodOptional<z.ZodString>;
10798
10802
  serverDescription: z.ZodOptional<z.ZodString>;
10803
+ instructions: z.ZodOptional<z.ZodString>;
10804
+ appendInstructions: z.ZodOptional<z.ZodString>;
10799
10805
  excludeAvailability: z.ZodOptional<z.ZodArray<z.ZodEnum<{
10800
10806
  IN_DEVELOPMENT: "IN_DEVELOPMENT";
10801
10807
  PRE_RELEASE: "PRE_RELEASE";
@@ -10823,6 +10829,9 @@ declare const sdkConfigV1Schema: z.ZodObject<{
10823
10829
  customTools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
10824
10830
  path: z.ZodString;
10825
10831
  }, z.core.$strict>>>;
10832
+ hooks: z.ZodOptional<z.ZodObject<{
10833
+ path: z.ZodString;
10834
+ }, z.core.$strict>>;
10826
10835
  }, z.core.$strict>>;
10827
10836
  }, z.core.$strict>, z.ZodObject<{
10828
10837
  generatorVersion: z.ZodOptional<z.ZodString>;
@@ -22749,6 +22758,8 @@ declare const sdkConfigV1TargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
22749
22758
  }, z.core.$strict>>>;
22750
22759
  serverName: z.ZodOptional<z.ZodString>;
22751
22760
  serverDescription: z.ZodOptional<z.ZodString>;
22761
+ instructions: z.ZodOptional<z.ZodString>;
22762
+ appendInstructions: z.ZodOptional<z.ZodString>;
22752
22763
  excludeAvailability: z.ZodOptional<z.ZodArray<z.ZodEnum<{
22753
22764
  IN_DEVELOPMENT: "IN_DEVELOPMENT";
22754
22765
  PRE_RELEASE: "PRE_RELEASE";
@@ -22776,6 +22787,9 @@ declare const sdkConfigV1TargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
22776
22787
  customTools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
22777
22788
  path: z.ZodString;
22778
22789
  }, z.core.$strict>>>;
22790
+ hooks: z.ZodOptional<z.ZodObject<{
22791
+ path: z.ZodString;
22792
+ }, z.core.$strict>>;
22779
22793
  }, z.core.$strict>>;
22780
22794
  }, z.core.$strict>, z.ZodObject<{
22781
22795
  generatorVersion: z.ZodOptional<z.ZodString>;
@@ -199,6 +199,9 @@ var oauthFlowSchema = z.discriminatedUnion("type", [
199
199
  z.strictObject({
200
200
  type: z.literal("client-credentials").describe("Uses the OAuth client credentials flow."),
201
201
  tokenUrl: nonEmptyStringSchema.describe("The URL used to obtain access tokens."),
202
+ environmentTokenUrls: z.record(nonEmptyStringSchema, nonEmptyStringSchema).optional().describe(
203
+ "Token URLs by environment name, for an API whose token endpoint differs per environment. When the selected environment has an entry, its URL replaces tokenUrl, so staging and development do not call the production token endpoint. Each key must name an entry of api.environments; environments without an entry use tokenUrl."
204
+ ),
202
205
  refreshUrl: nonEmptyStringSchema.optional().describe("The URL used to refresh access tokens."),
203
206
  scopes: z.array(oauthScopeSchema).optional().describe("The scopes supported by this flow.")
204
207
  }),
@@ -347,6 +350,34 @@ var apiConfigSchema = z.strictObject({
347
350
  */
348
351
  webhookSignature: webhookSignatureSchema.optional().describe("How generated helpers verify webhook signatures from the API.")
349
352
  });
353
+ function oauthEnvironmentTokenUrlsIssues(api, basePath) {
354
+ const environmentNames = new Set((api.environments ?? []).map(({ name }) => name));
355
+ const issues = [];
356
+ (api.auth?.schemes ?? []).forEach((scheme, schemeIndex) => {
357
+ if (scheme.type !== "oauth2") return;
358
+ scheme.flows.forEach((flow, flowIndex) => {
359
+ if (flow.type !== "client-credentials") return;
360
+ Object.keys(flow.environmentTokenUrls ?? {}).forEach((environment) => {
361
+ if (!environmentNames.has(environment)) {
362
+ issues.push({
363
+ message: `environmentTokenUrls "${environment}" must name an entry of api.environments`,
364
+ path: [
365
+ ...basePath,
366
+ "auth",
367
+ "schemes",
368
+ schemeIndex,
369
+ "flows",
370
+ flowIndex,
371
+ "environmentTokenUrls",
372
+ environment
373
+ ]
374
+ });
375
+ }
376
+ });
377
+ });
378
+ });
379
+ return issues;
380
+ }
350
381
 
351
382
  // src/sdk-config/v1/api.ts
352
383
  var sdkConfigV1AuthSchemeSchema = authSchemeSchema;
@@ -796,9 +827,20 @@ var mcpCustomToolSchema = z.strictObject({
796
827
  "Path to a TypeScript module that exports the tool `definition` and `handler`."
797
828
  )
798
829
  });
830
+ var mcpHooksSchema = z.strictObject({
831
+ path: relativePathSchema.describe(
832
+ "Path to a TypeScript module exporting the MCP request/response hooks (`beforeRequest`, `afterResponse`, `onError`, `transformResult`)."
833
+ )
834
+ });
799
835
  var mcpGenerationConfigSchema = typescriptGenerationConfigSchema.extend({
800
836
  serverName: nonEmptyStringSchema.optional().describe("The name advertised by the generated MCP server."),
801
837
  serverDescription: nonEmptyStringSchema.optional().describe("The description advertised by the generated MCP server."),
838
+ instructions: nonEmptyStringSchema.optional().describe(
839
+ "Replaces the auto-generated server instructions returned on initialize. WARNING: the generated instructions encode protocol wiring (the openapi:// resource and schema URI templates and the _meta keys the agent needs to browse docs and fetch full input schemas); replacing them drops that wiring and can break schema/doc browsing, so prefer appendInstructions unless you intend to restate it. Emitted verbatim and sent to the MCP client on every conversation, so keep it concise."
840
+ ),
841
+ appendInstructions: nonEmptyStringSchema.optional().describe(
842
+ "Appended after the auto-generated server instructions returned on initialize, preserving the generated protocol wiring. When both instructions and appendInstructions are set, this is appended after the replacement text. Emitted verbatim and sent to the MCP client on every conversation, so keep it concise."
843
+ ),
802
844
  excludeAvailability: z.array(z.enum(mcpAvailabilityStatuses)).optional().describe("Operation availability statuses excluded from MCP tool generation."),
803
845
  tools: mcpToolFilterSchema.optional().describe("Global operation filters for generated MCP tools."),
804
846
  toolsets: z.record(mcpToolsetNameSchema, mcpToolFilterSchema).optional().describe("Named MCP toolsets and the operation filters for each toolset."),
@@ -807,6 +849,9 @@ var mcpGenerationConfigSchema = typescriptGenerationConfigSchema.extend({
807
849
  ),
808
850
  customTools: z.record(mcpToolNameSchema, mcpCustomToolSchema).optional().describe(
809
851
  "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."
852
+ ),
853
+ hooks: mcpHooksSchema.optional().describe(
854
+ "Customer-authored request/response hooks, emitted into the generated server as `src/hooks.ts` (replacing the no-op stub)."
810
855
  )
811
856
  });
812
857
 
@@ -3202,6 +3247,9 @@ var sdkConfigV1Schema = z.strictObject({
3202
3247
  targets: z.array(sdkConfigV1TargetSchema).min(1).describe("Language targets to generate; each language may appear once.")
3203
3248
  }).superRefine(({ api, output, package: globalPackage, targets }, context) => {
3204
3249
  const configuredLanguages = /* @__PURE__ */ new Set();
3250
+ oauthEnvironmentTokenUrlsIssues(api, ["api"]).forEach(
3251
+ (issue) => context.addIssue({ code: "custom", ...issue })
3252
+ );
3205
3253
  targets.forEach((target, targetIndex) => {
3206
3254
  if (configuredLanguages.has(target.language)) {
3207
3255
  context.addIssue({
@@ -4130,6 +4178,8 @@ function mapMcp(config, state, basePath) {
4130
4178
  return compact({
4131
4179
  serverName: takeString(config, ["serverName"], state, basePath),
4132
4180
  serverDescription: takeString(config, ["serverDescription"], state, basePath),
4181
+ instructions: takeString(config, ["instructions"], state, basePath),
4182
+ appendInstructions: takeString(config, ["appendInstructions"], state, basePath),
4133
4183
  excludeAvailability: takeEnumArray(
4134
4184
  config,
4135
4185
  ["excludeAvailability"],
@@ -4149,7 +4199,8 @@ function mapMcp(config, state, basePath) {
4149
4199
  tools: takeToolFilter(config, ["tools"], state, basePath),
4150
4200
  toolsets: takeToolsets(config, ["toolsets"], state, basePath),
4151
4201
  mergedTools: takeMergedTools(config, ["mergedTools"], state, basePath),
4152
- customTools: takeCustomTools(config, ["customTools"], state, basePath)
4202
+ customTools: takeCustomTools(config, ["customTools"], state, basePath),
4203
+ hooks: takeHooks(config, ["hooks"], state, basePath)
4153
4204
  });
4154
4205
  }
4155
4206
  function mapReadme(value, language, activeLanguages, state, basePath) {
@@ -4531,6 +4582,21 @@ function takeCustomTools(value, aliases, state, basePath) {
4531
4582
  consume(state, located.path);
4532
4583
  return Object.fromEntries(entries.filter((entry) => entry !== void 0));
4533
4584
  }
4585
+ function takeHooks(value, aliases, state, basePath) {
4586
+ const located = takeObject(value, aliases, state, basePath);
4587
+ if (!located) return void 0;
4588
+ if (typeof located.value.path !== "string") {
4589
+ fail(
4590
+ "FERN_MCP_HOOKS_SPEC_INVALID",
4591
+ located.path,
4592
+ 'MCP hooks must be an object with a string "path"',
4593
+ 'Give "hooks" a "path" pointing at the TypeScript module exporting the request/response hooks.',
4594
+ ["targets", basePath[2], "generation", "hooks"]
4595
+ );
4596
+ }
4597
+ consume(state, located.path);
4598
+ return { path: located.value.path };
4599
+ }
4534
4600
  function takeMergedTools(value, aliases, state, basePath) {
4535
4601
  const located = takeObject(value, aliases, state, basePath);
4536
4602
  if (!located) return void 0;